feat(tools): added arXiv and wikipedia tools/blocks & docs (#814)

* feat(tools): added arxiv tools

* feat(tools): added wikipedia tool

* updated docs & remove empty interface

* remove empty interface

* fixed docs generator

* fixed wikipedia

* removed hasExpandableContent from tool-input for consistency across all tools, irregardless of their parsm

* lint

---------

Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local>
This commit is contained in:
Waleed Latif
2025-07-28 19:39:26 -07:00
committed by GitHub
parent 5b1f948686
commit 308f39e8b9
36 changed files with 1617 additions and 42 deletions

View File

@@ -216,8 +216,13 @@ function findBlockType(content: string, blockName: string): string {
// Helper to extract a string property from content
function extractStringProperty(content: string, propName: string): string | null {
const simpleMatch = content.match(new RegExp(`${propName}\\s*:\\s*['"]([^'"]+)['"]`, 'm'))
if (simpleMatch) return simpleMatch[1]
// Try single quotes first - more permissive approach
const singleQuoteMatch = content.match(new RegExp(`${propName}\\s*:\\s*'([^']*)'`, 'm'))
if (singleQuoteMatch) return singleQuoteMatch[1]
// Try double quotes
const doubleQuoteMatch = content.match(new RegExp(`${propName}\\s*:\\s*"([^"]*)"`, 'm'))
if (doubleQuoteMatch) return doubleQuoteMatch[1]
// Try to match multi-line string with template literals
const templateMatch = content.match(new RegExp(`${propName}\\s*:\\s*\`([^\`]+)\``, 's'))
@@ -556,7 +561,10 @@ function extractToolInfo(
const requiredMatch = paramBlock.match(/required\s*:\s*(true|false)/)
// More careful extraction of description with handling for multiline descriptions
let descriptionMatch = paramBlock.match(/description\s*:\s*['"]([^'"]+)['"]/)
let descriptionMatch = paramBlock.match(/description\s*:\s*'([^']*)'/)
if (!descriptionMatch) {
descriptionMatch = paramBlock.match(/description\s*:\s*"([^"]*)"/)
}
if (!descriptionMatch) {
// Try for template literals if the description uses backticks
descriptionMatch = paramBlock.match(/description\s*:\s*`([^`]+)`/)