/** * Tool call parsing from LLM responses. * * Handles OpenAI function-calling format, Anthropic tool_use format, * and legacy text-based tool call formats. */ import { ToolCall } from './tools'; /** * Normalize tool name to lowercase with underscores. * * MCP tools (`__`) are returned untouched. Their names are the * server's, not ours: `brave-search__brave_web_search` or * `context7__resolve-library-id` must reach the registry exactly as advertised, * or the server lookup and the server's own tool lookup both miss. No built-in * tool name contains `__`, so the check cannot catch one of ours. */ export declare function normalizeToolName(name: string): string; /** * Extract parameters from truncated/partial JSON for tool calls. * Fallback when JSON.parse fails due to API truncation. */ declare function extractPartialToolParams(toolName: string, rawArgs: string): Record | null; export declare function parseOpenAIToolCalls(toolCalls: unknown[]): ToolCall[]; export declare function parseAnthropicToolCalls(content: unknown[]): ToolCall[]; declare function tryExtractParams(str: string): Record | null; declare function tryParseToolCall(str: string): ToolCall | null; /** * Parse tool calls from LLM response text. * Supports: , , ```tool blocks, inline JSON. */ export declare function parseToolCalls(response: string): ToolCall[]; export declare const _extractPartialToolParamsForTest: typeof extractPartialToolParams; export declare const _tryExtractParamsForTest: typeof tryExtractParams; export declare const _tryParseToolCallForTest: typeof tryParseToolCall; export {};