/** * WebFetch tool: fetch a web page and return its content as processed text. * * Two-model architecture: * 1. Fetch: HTTP request via Node built-in fetch * 2. Convert: HTML to markdown via Turndown * 3. Summarize: utility model answers the prompt using the page content * * The main agent never sees raw page content. * * Reference: docs/cortex/tools/web-fetch.md */ import { Type, type Static } from 'typebox'; import type { ToolContentDetails } from '../../types.js'; import { WebFetchCache } from './cache.js'; import type { CortexToolRuntime } from '../runtime.js'; export declare const WebFetchParams: Type.TObject<{ url: Type.TString; prompt: Type.TString; }>; export type WebFetchParamsType = Static; export interface WebFetchDetails { finalUrl: string; statusCode: number; cacheHit: boolean; rawSize: number; markdownSize: number; } /** * Check whether an IP address (v4 or v6) belongs to a private, loopback, * link-local, or otherwise non-routable range. Handles IPv4-mapped IPv6 * addresses (::ffff:x.x.x.x) and parses octets numerically to catch * alternate encodings (decimal IPs, zero-padded, etc.). */ export declare function isPrivateIp(ip: string): boolean; export interface WebFetchToolConfig { runtime?: CortexToolRuntime | undefined; /** Utility model completion function for summarization. */ utilityComplete?: ((context: unknown) => Promise) | undefined; /** Max fetches per agentic loop. */ maxPerLoop?: number | undefined; } export declare function createWebFetchTool(config: WebFetchToolConfig): { name: string; description: string; parameters: typeof WebFetchParams; execute: (params: WebFetchParamsType) => Promise>; /** Reset the per-loop rate counter. Called at the start of each loop. */ resetRateLimit: () => void; /** Get the underlying cache (for testing/diagnostics). */ getCache: () => WebFetchCache; }; //# sourceMappingURL=index.d.ts.map