import type { ServerResponse } from "node:http";
import { create } from "@bufbuild/protobuf";
import type { AgentToolPolicy } from "../config.js";
import { ExecServerMessageSchema } from "../gen/agent/v1/agent_pb.js";
import type { Logger } from "../logger.js";
import type { OpenAIToolCall } from "../providers/openai.js";
import { type CursorToolError } from "./results.js";
export { cursorOpenAITools } from "./schemas.js";
export { agentExecClientMessageFields } from "./results.js";
export interface CursorToolRuntime {
    logger: Logger;
    nextAgentExecId: number;
    config: {
        agentToolPolicy: AgentToolPolicy;
        toolResultTimeoutMs?: number;
    };
}
interface CursorToolExecutionOptions {
    signal?: AbortSignal;
}
declare const TOOL_ARGUMENT_SCHEMAS: {
    read_file: {
        properties: {
            path: "string";
            offset: "integer";
            limit: "integer";
        };
        required: string[];
        nonEmpty: string[];
    };
    list_dir: {
        properties: {
            path: "string";
        };
        required: string[];
        nonEmpty: string[];
    };
    grep: {
        properties: {
            pattern: "string";
            path: "string";
            glob: "string";
            head_limit: "integer";
        };
        required: string[];
        nonEmpty: string[];
    };
    run_shell: {
        properties: {
            command: "string";
            working_directory: "string";
            timeout: "integer";
            description: "string";
        };
        required: string[];
        nonEmpty: string[];
    };
    write_file: {
        properties: {
            path: "string";
            content: "string";
            return_file_content_after_write: "boolean";
        };
        required: string[];
        nonEmpty: string[];
    };
    apply_patch: {
        properties: {
            path: "string";
            old_string: "string";
            new_string: "string";
            replace_all: "boolean";
        };
        required: string[];
        nonEmpty: string[];
    };
    delete_path: {
        properties: {
            path: "string";
        };
        required: string[];
        nonEmpty: string[];
    };
    fetch_url: {
        properties: {
            url: "string";
        };
        required: string[];
        nonEmpty: string[];
    };
    mcp_tool: {
        properties: {
            provider_identifier: "string";
            tool_name: "string";
            name: "string";
            arguments: "object";
        };
        required: string[];
        nonEmpty: string[];
    };
};
type SupportedOpenAIToolName = keyof typeof TOOL_ARGUMENT_SCHEMAS;
export type CursorToolValidationResult = {
    ok: true;
    name: SupportedOpenAIToolName;
    args: Record<string, unknown>;
} | {
    ok: false;
    error: CursorToolError;
};
export declare function executeCursorToolCall(response: ServerResponse, runtime: CursorToolRuntime, payloads: AsyncIterator<Buffer>, toolCall: OpenAIToolCall, options?: CursorToolExecutionOptions): Promise<string>;
export declare function validateCursorToolCall(toolCall: OpenAIToolCall, policy: AgentToolPolicy): CursorToolValidationResult;
export declare function cursorToolCallToExecServerMessage(id: number, execId: string, name: SupportedOpenAIToolName, toolCallId: string, args: Record<string, unknown>): ReturnType<typeof create<typeof ExecServerMessageSchema>> | undefined;
export declare function summarizeToolArgs(args: Record<string, unknown>): Record<string, unknown>;
