/** * SkillKit Native Web Intelligence Engine * ========================================= * Zero external API dependencies. No Tavily, no SerpAPI, no paid keys. * SkillKit builds its own web intelligence from scratch. * * 5 capabilities (inspired by Tavily's architecture, built natively): * 1. SEARCH — Multi-source web search (DuckDuckGo HTML + Google fallback + SearXNG) * 2. EXTRACT — Content extraction from any URL (Readability-style + metadata) * 3. CRAWL — Deep website crawling with link following and depth control * 4. RESEARCH — Multi-step deep research with AI-powered synthesis * 5. MAP — Site URL structure discovery (sitemap.xml + link harvesting) * * How it works WITHOUT paid APIs: * - Search: Scrapes DuckDuckGo HTML (no API key needed), parses results * - Extract: Fetches raw HTML, strips boilerplate via content-density algorithm * - Crawl: BFS link-follower with domain scoping, depth limits, robots.txt respect * - Research: Orchestrates search → extract → synthesize in multiple rounds * - Map: Parses sitemap.xml + discovers links via crawl (URL-only mode) * * @module web-engine */ export interface SearchResult { title: string; url: string; snippet: string; source: string; position: number; } export interface SearchResponse { query: string; results: SearchResult[]; total_results: number; search_engine: string; response_time_ms: number; } export interface ExtractedContent { url: string; title: string; description: string; content: string; raw_html?: string; language?: string; published_date?: string; author?: string; word_count: number; links: string[]; images: string[]; metadata: Record; } export interface ExtractResponse { results: ExtractedContent[]; failed: Array<{ url: string; error: string; }>; response_time_ms: number; } export interface CrawlPage { url: string; title: string; content: string; depth: number; links_found: number; word_count: number; } export interface CrawlResponse { base_url: string; pages: CrawlPage[]; total_pages: number; total_links_discovered: number; max_depth_reached: number; response_time_ms: number; } export interface ResearchSource { title: string; url: string; snippet: string; relevance_score: number; } export interface ResearchResponse { query: string; summary: string; key_findings: string[]; sources: ResearchSource[]; search_rounds: number; total_pages_analyzed: number; response_time_ms: number; } export interface MapResponse { base_url: string; urls: string[]; total_urls: number; sitemap_found: boolean; response_time_ms: number; } /** * Native web search using DuckDuckGo HTML scraping. * No API key needed. Free. Unlimited. * * Fallback order: DuckDuckGo HTML → Google HTML (if DDG blocked) → SearXNG (if configured) */ export declare function nativeSearch(query: string, options?: { max_results?: number; region?: string; time_range?: string; safe_search?: boolean; searxng_url?: string; }): Promise; /** * Extract clean, structured content from one or more URLs. * Native implementation — no Tavily, no Readability.js dependency. * Uses content-density algorithm + metadata extraction. */ export declare function nativeExtract(urls: string | string[], options?: { include_raw_html?: boolean; include_links?: boolean; include_images?: boolean; timeout?: number; }): Promise; /** * Native BFS web crawler. * Follows links from a starting URL, collecting content from discovered pages. * Respects: domain scope, depth limits, URL patterns, page limits. */ export declare function nativeCrawl(startUrl: string, options?: { max_depth?: number; max_pages?: number; include_patterns?: string[]; exclude_patterns?: string[]; same_domain_only?: boolean; respect_robots?: boolean; }): Promise; /** * Multi-step deep research engine. * Performs multiple rounds of: search → extract top results → identify gaps → refine search. * * If a `synthesize` callback is provided (AI model function), it generates a cohesive summary. * Without it, returns structured findings from multiple search rounds. */ export declare function nativeResearch(query: string, options?: { max_rounds?: number; max_sources?: number; depth?: 'basic' | 'advanced'; synthesize?: (findings: string[], query: string) => Promise; searxng_url?: string; }): Promise; /** * Map a website's complete URL structure. * First tries sitemap.xml, then falls back to link-discovery crawl (URL-only mode). * Fast — doesn't extract content, just discovers URLs. */ export declare function nativeMap(url: string, options?: { max_urls?: number; max_depth?: number; include_subdomains?: boolean; }): Promise; //# sourceMappingURL=web-engine.d.ts.map