import type { Tool, ToolResult, ToolInvocationContext } from "../types.js"; import { type BrowserPageReader } from "./browser-page-fallback.js"; import { type ReturnedHttpSourceResolution } from "../mcp/returned-http-source.js"; export interface WebFetchReceipt { schema: "omnius.web-fetch-receipt.v1"; requestedUrl: string; finalUrl: string; status: number; contentType: string; responseBytes: number; responseSha256: string; fetchedAt: string; linkStatus: "retrieved"; returnedSource?: { sourceRef: string; serverName: string; consumption: 'body_read'; }; } export declare class WebFetchTool implements Tool { #private; name: string; private readonly eagerSourceMaxBytes; readonly returnedHttpSourceConsumer?: Readonly<{ selector: 'source_ref'; }>; private readonly returnedSourceResolver?; private readonly browserFallback; /** Companion tools registered beside this one; unfed hosts keep the full guidance. */ private browserAvailable; private crawlAvailable; /** Host storage policy, independent of model tool arguments. Low-memory * deployments can keep all nonempty responses disk-backed. A browser reader * lets a rejected headless request recover through a real browser. */ constructor(options?: { eagerSourceMaxBytes?: number; browserFallback?: BrowserPageReader; returnedSourceResolver?: (sourceRef: string, context?: ToolInvocationContext) => Readonly | undefined; }); isReadOnly(): boolean; acceptsInvocationContext: boolean; private _active; private _fetchCache; private _streamedCache; cancel(): void; description: string; setAvailableTools(names: ReadonlySet): string; parameters: { type: string; properties: { url: { type: string; description: string; }; max_length: { type: string; description: string; }; format: { type: string; enum: string[]; description: string; }; }; required: string[]; }; execute(args: Record, context?: ToolInvocationContext): Promise; }