import { BaseCache } from '../../cache/base.cjs';
import * as promise_based_task from 'promise-based-task';
import { customsearch_v1 } from '@googleapis/customsearch';
import { SearchToolOptions, SearchToolResult, SearchToolOutput, SearchToolRunOptions } from './base.cjs';
import { Tool, ToolEmitter, ToolInput } 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 '../../internals/helpers/promise.cjs';
import '../../errors.cjs';
import '../../internals/helpers/schema.cjs';
import 'zod-to-json-schema';

interface GoogleSearchToolOptions extends SearchToolOptions {
    apiKey?: string;
    cseId?: string;
    maxResults: number;
}
type GoogleSearchToolRunOptions = SearchToolRunOptions;
interface GoogleSearchToolResult extends SearchToolResult {
}
declare class GoogleSearchToolOutput extends SearchToolOutput<GoogleSearchToolResult> {
    readonly results: GoogleSearchToolResult[];
    constructor(results: GoogleSearchToolResult[]);
    createSnapshot(): {
        results: GoogleSearchToolResult[];
    };
    loadSnapshot(snapshot: ReturnType<typeof this.createSnapshot>): void;
}
declare class GoogleSearchTool extends Tool<GoogleSearchToolOutput, GoogleSearchToolOptions, GoogleSearchToolRunOptions> {
    name: string;
    description: string;
    readonly emitter: ToolEmitter<ToolInput<this>, GoogleSearchToolOutput>;
    inputSchema(): z.ZodObject<{
        query: z.ZodString;
    }, "strip", z.ZodTypeAny, {
        query: string;
    }, {
        query: string;
    }>;
    protected apiKey: string;
    protected cseId: string;
    constructor(options?: GoogleSearchToolOptions);
    protected get client(): customsearch_v1.Customsearch;
    protected _run({ query: input }: ToolInput<this>, _options: Partial<GoogleSearchToolRunOptions>, run: RunContext<this>): Promise<GoogleSearchToolOutput>;
    createSnapshot(): {
        apiKey: string;
        cseId: string;
        name: string;
        description: string;
        options: GoogleSearchToolOptions;
        cache: BaseCache<promise_based_task.Task<GoogleSearchToolOutput, any>>;
        emitter: Emitter<any>;
    };
    loadSnapshot({ apiKey, cseId, ...snapshot }: ReturnType<typeof this.createSnapshot>): void;
}

export { GoogleSearchTool, type GoogleSearchToolOptions, GoogleSearchToolOutput, type GoogleSearchToolResult };
