export interface WebTool { name: string; description: string; inputSchema: { type: string; properties: Record; required: string[]; }; } export interface WebToolResult { success: boolean; output?: string; error?: string; } export declare class WebTools { private static instance; private constructor(); static getInstance(): WebTools; /** * Get available web tools */ getTools(): WebTool[]; /** * Execute a web tool */ executeTool(toolName: string, args: any): Promise; /** * Search the web using DuckDuckGo */ private toolSearch; /** * Fetch content from a URL */ private toolFetch; /** * Scrape structured data from a webpage */ private toolScrape; /** * Format tools for AI system prompt */ formatToolsForPrompt(): string; /** * Convert tools to OpenAI tools array format * Used when sending tools parameter in chat completion requests */ toOpenAITools(): any[]; /** * Parse tool call from AI response * Supports multiple formats: * 1. JSON: {"tool": "web_search", "args": {...}} * 2. Function tags: */ parseToolCall(response: string): { tool: string; args: any; } | null; } /** * Usage Example: * * const webTools = WebTools.getInstance(); * * // Search the web * const searchResult = await webTools.executeTool('web_search', { * query: 'latest TypeScript features', * max_results: 5 * }); * * // Fetch webpage content * const fetchResult = await webTools.executeTool('web_fetch', { * url: 'https://example.com', * selector: 'article' * }); * * // Scrape structured data * const scrapeResult = await webTools.executeTool('web_scrape', { * url: 'https://example.com/products', * selectors: { * title: 'h1', * prices: '.price', * descriptions: '.description' * } * }); */ //# sourceMappingURL=web-tools.d.ts.map