import type { PortableTool } from "../portable-tool.js";
export declare const WEB_FETCH_TOOL_NAME: "web_fetch";
export interface WebFetchToolParams {
    url: string;
    extractMode?: "markdown" | "text" | "json";
    maxChars?: number;
    query?: string;
    extract?: boolean;
    summarize?: boolean;
}
export declare const WEB_FETCH_TOOL_SCHEMA: {
    readonly type: "object";
    readonly properties: {
        readonly url: {
            readonly type: "string";
            readonly description: "HTTP or HTTPS URL to fetch.";
        };
        readonly extractMode: {
            readonly type: "string";
            readonly enum: readonly ["markdown", "text", "json"];
            readonly description: "Extraction mode: \"markdown\" (default), \"text\", or \"json\" (LLM-driven structured extraction).";
        };
        readonly maxChars: {
            readonly type: "number";
            readonly description: "Maximum characters to return (truncates when exceeded).";
            readonly minimum: 100;
        };
        readonly query: {
            readonly type: "string";
            readonly description: "Original search query. When provided, returns the most query-relevant sections.";
        };
        readonly extract: {
            readonly type: "boolean";
            readonly description: "When true, returns structured extraction (title, summary, key facts, entities, topics, sentiment).";
        };
        readonly summarize: {
            readonly type: "boolean";
            readonly description: string;
        };
    };
    readonly required: readonly ["url"];
};
export interface WebFetchResult {
    content: string;
    title?: string;
    relevantExcerpts?: string[];
    summary?: string;
    extraction?: {
        title?: string;
        summary?: string;
        keyFacts?: string[];
        entities?: string[];
        topics?: string[];
        sentiment?: string;
    };
}
/** Deps injected by the host runtime for web fetching. */
export interface WebFetchToolDeps {
    /**
     * Fetch a URL and extract content.
     * The host handles user-agent rotation, anti-block,
     * JS rendering, caching, and content extraction.
     */
    fetchUrl(params: {
        url: string;
        extractMode?: "markdown" | "text" | "json";
        maxChars?: number;
        query?: string;
        extract?: boolean;
        /** 调用方取消信号(§15-1):用户中断后抓取必须随之中止,不再烧带宽/时间 */
        signal?: AbortSignal;
    }): Promise<WebFetchResult>;
    /**
     * Optional: summarize long content using a small/cheap model.
     * When provided and summarize=true is requested, called after fetchUrl.
     * Should return a concise summary (< 500 chars) preserving key information.
     */
    summarizeContent?(content: string, query?: string): Promise<string>;
}
export declare function createWebFetchTool(deps: WebFetchToolDeps): PortableTool<WebFetchToolParams>;
