/** * Agent tools - definitions, interfaces, and re-exports. * * Heavy implementation is split into: * mcpIntegration.ts — Z.AI and MiniMax MCP API helpers * toolParsing.ts — parseToolCalls, parseOpenAIToolCalls, parseAnthropicToolCalls * toolExecution.ts — executeTool, validatePath, createActionLog */ export interface OpenAITool { type: 'function'; function: { name: string; description: string; parameters: { type: 'object'; properties: Record; required: string[]; }; }; } export interface AnthropicTool { name: string; description: string; input_schema: { type: 'object'; properties: Record; required: string[]; }; } export interface ToolCall { tool: string; parameters: Record; id?: string; } export interface ToolResult { success: boolean; output: string; error?: string; tool: string; parameters: Record; } export interface ActionLog { type: 'read' | 'write' | 'edit' | 'delete' | 'command' | 'search' | 'list' | 'mkdir' | 'fetch'; target: string; result: 'success' | 'error'; details?: string; timestamp: number; } export declare const AGENT_TOOLS: { read_file: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; }; }; write_file: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; content: { type: string; description: string; required: boolean; }; }; }; edit_file: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; old_text: { type: string; description: string; required: boolean; }; new_text: { type: string; description: string; required: boolean; }; }; }; delete_file: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; }; }; list_files: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; recursive: { type: string; description: string; required: boolean; }; }; }; create_directory: { name: string; description: string; parameters: { path: { type: string; description: string; required: boolean; }; }; }; execute_command: { name: string; description: string; parameters: { command: { type: string; description: string; required: boolean; }; args: { type: string; description: string; required: boolean; }; }; }; search_code: { name: string; description: string; parameters: { pattern: { type: string; description: string; required: boolean; }; path: { type: string; description: string; required: boolean; }; }; }; find_files: { name: string; description: string; parameters: { pattern: { type: string; description: string; required: boolean; }; path: { type: string; description: string; required: boolean; }; }; }; fetch_url: { name: string; description: string; parameters: { url: { type: string; description: string; required: boolean; }; }; }; web_search: { name: string; description: string; parameters: { query: { type: string; description: string; required: boolean; }; domain_filter: { type: string; description: string; required: boolean; }; recency: { type: string; description: string; required: boolean; }; }; }; web_read: { name: string; description: string; parameters: { url: { type: string; description: string; required: boolean; }; format: { type: string; description: string; required: boolean; }; }; }; github_read: { name: string; description: string; parameters: { repo: { type: string; description: string; required: boolean; }; action: { type: string; description: string; required: boolean; }; query: { type: string; description: string; required: boolean; }; path: { type: string; description: string; required: boolean; }; }; }; minimax_web_search: { name: string; description: string; parameters: { query: { type: string; description: string; required: boolean; }; }; }; zai_analyze_image: { name: string; description: string; parameters: { prompt: { type: string; description: string; required: boolean; }; image_url: { type: string; description: string; required: boolean; }; }; }; minimax_understand_image: { name: string; description: string; parameters: { prompt: { type: string; description: string; required: boolean; }; image_url: { type: string; description: string; required: boolean; }; }; }; }; /** * Shape of additional (non-built-in) tools merged into the agent's catalog. * Used by MCP integration — the registered tool's prefixed name and the raw * MCP `tools/list` schema are both passed through. */ export interface AdditionalToolDef { /** Name the agent must use to invoke this tool (e.g. `fs__read_file`). */ name: string; description?: string; /** JSON-schema-like `input_schema` from the MCP server's tools/list reply. */ inputSchema?: Record; } /** * Format tool definitions for system prompt (text-based fallback). * Optionally appends an "Additional tools" section listing tools from * sources outside the built-in catalog (currently MCP servers). */ export declare function formatToolDefinitions(additionalTools?: AdditionalToolDef[], allowedToolNames?: ReadonlySet): string; /** * Get tools in OpenAI Function Calling format. * Additional tools (e.g. MCP) are appended with their JSON-schema as-is. */ export declare function getOpenAITools(additionalTools?: AdditionalToolDef[], allowedToolNames?: ReadonlySet): OpenAITool[]; /** * Get tools in Anthropic Tool Use format. * Additional tools (e.g. MCP) are appended with their JSON-schema as-is. */ export declare function getAnthropicTools(additionalTools?: AdditionalToolDef[], allowedToolNames?: ReadonlySet): AnthropicTool[]; export { normalizeToolName, parseOpenAIToolCalls, parseAnthropicToolCalls, parseToolCalls } from './toolParsing'; export { executeTool, validatePath, createActionLog } from './toolExecution';