/** * Leaper Agent – Web Tools * Fetch URLs, search the web, extract content, and more. */ import type { ToolDefinition } from './registry.js'; export type SearchProvider = 'brave' | 'duckduckgo' | 'tavily' | 'exa' | 'auto'; export interface WebFetchOptions { url: string; timeout?: number; extract_text?: boolean; max_chars?: number; } export interface WebFetchResult { success: boolean; url: string; content?: string; title?: string; status_code?: number; content_type?: string; error?: string; } export interface SearchOptions { query: string; provider?: SearchProvider; num_results?: number; date_range?: 'day' | 'week' | 'month' | 'year'; safe_search?: boolean; } export interface SearchResult { title: string; url: string; snippet: string; published_date?: string; score?: number; } export interface WebSearchResult { success: boolean; results?: SearchResult[]; query?: string; provider?: string; error?: string; } export interface WebExtractOptions { url: string; instruction?: string; format?: 'markdown' | 'text' | 'html'; max_chars?: number; } export interface WebExtractResult { success: boolean; url: string; content?: string; format?: string; error?: string; } export interface WebCrawlOptions { url: string; instruction?: string; max_pages?: number; max_depth?: number; } export interface WebCrawlResult { success: boolean; pages?: Array<{ url: string; content: string; }>; error?: string; } export declare function isSafeUrl(url: string): boolean; export declare function stripBase64Images(html: string): string; export declare function htmlToText(html: string): string; export declare function extractTitle(html: string): string; export declare function fetchUrl(opts: WebFetchOptions): Promise; export declare function searchBrave(query: string, numResults: number): Promise; export declare function searchTavily(query: string, numResults: number): Promise; export declare function detectSearchProvider(): SearchProvider; export declare function searchWeb(opts: SearchOptions): Promise; export declare function extractContent(opts: WebExtractOptions): Promise; export declare function crawlWebsite(opts: WebCrawlOptions): Promise; export declare const webFetchTool: ToolDefinition; export declare const webSearchTool: ToolDefinition; export declare const webExtractTool: ToolDefinition; //# sourceMappingURL=web.d.ts.map