import { BaseCache } from '../../cache/base.cjs';
import * as promise_based_task from 'promise-based-task';
import { JSONToolOutput, Tool, BaseToolOptions, ToolEmitter, ToolInput, BaseToolRunOptions } from '../base.cjs';
import { z } from 'zod';
import { RunContext } from '../../context.cjs';
import { E as Emitter } from '../../emitter-BWtGHYn0.cjs';
import '../../internals/serializable.cjs';
import '../../internals/types.cjs';
import '../../internals/helpers/guards.cjs';
import 'ajv';
import '../../errors.cjs';
import '../../internals/helpers/schema.cjs';
import 'zod-to-json-schema';
import '../../internals/helpers/promise.cjs';

interface CrawlerOutput {
    url: string;
    statusCode: number;
    statusText: string;
    contentType: string;
    content: string;
}
declare class WebCrawlerToolOutput extends JSONToolOutput<CrawlerOutput> {
    getTextContent(): string;
}
type HttpClient = (url: string, options?: RequestInit) => Promise<HttpClientResponse>;
interface HttpClientResponse {
    status: number;
    statusText: string;
    headers: Headers;
    text(): Promise<string>;
}
type Parser = (response: HttpClientResponse) => Promise<string>;
interface WebsiteCrawlerToolOptions extends BaseToolOptions {
    client?: HttpClient;
    parser?: Parser;
    request?: RequestInit;
}
declare class WebCrawlerTool extends Tool<WebCrawlerToolOutput, WebsiteCrawlerToolOptions> {
    name: string;
    description: string;
    inputSchema(): z.ZodObject<{
        url: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        url: string;
    }, {
        url: string;
    }>;
    protected client: HttpClient;
    protected parser: Parser;
    readonly emitter: ToolEmitter<ToolInput<this>, WebCrawlerToolOutput>;
    constructor({ client, parser, ...options }?: WebsiteCrawlerToolOptions);
    protected _run({ url }: ToolInput<this>, _options: Partial<BaseToolRunOptions>, run: RunContext<this>): Promise<WebCrawlerToolOutput>;
    createSnapshot(): {
        client: HttpClient;
        parser: Parser;
        name: string;
        description: string;
        options: WebsiteCrawlerToolOptions;
        cache: BaseCache<promise_based_task.Task<WebCrawlerToolOutput, any>>;
        emitter: Emitter<any>;
    };
    loadSnapshot({ client, parser, ...snapshot }: ReturnType<typeof this.createSnapshot>): void;
}

export { type HttpClient, WebCrawlerTool, WebCrawlerToolOutput };
