/** * `web.fetch` registry handler. * * Thin adapter that converts a {@link WebFetchArgs} call into a typed * {@link WebFetchOutcome} via {@link webFetchCore}, emits exactly one * `auditLog("tool.web_fetch", payload)` per invocation (Requirement 5.6), * and returns the standard {@link ToolResult} shape consumed by the agent * loop and `tool.batch`. * * Output composition (per the design's "ToolResult mapping" section): * * * mode= resolvedIp= ... * * * * --- * * * On error outcomes the `output` field begins with the human-readable * message defined in the design's error matrix (e.g. * "Refusing binary content type: image/png"). */ import type { ToolResult } from "../../types.js"; import type { ToolRunOptions } from "../registry.js"; import { type WebFetchCoreOptions } from "./fetch-core.js"; import { type WebFetchArgs } from "./types.js"; /** * Optional injection point for tests so they can stub the underlying * transport without monkey-patching `node:http`/`node:https`. Production * callers never pass these; the registry handler invokes `webFetch` * with no extra options. */ export interface WebFetchOptions extends ToolRunOptions { core?: WebFetchCoreOptions; } /** * Run `web.fetch`. Always emits a single audit-log entry; never throws — * argument validation, SSRF blocks, network errors, HTTP errors, and * timeouts surface as `ok=false` results. */ export declare function webFetch(args: WebFetchArgs, options?: WebFetchOptions): Promise;