/** * [WHO]: ToolInfo, ToolOrchestrator class * [FROM]: Depends on agent-core, extensions * [TO]: Consumed by core/runtime/agent-session.ts * [HERE]: core/tools/orchestrator.ts - runtime tool registry, lookup, and active-tool resolution */ import type { AgentTool } from "@catui/agent-core"; import type { ToolDefinition, ToolInfo } from "../extensions-host/index.js"; export interface ToolOrchestratorOptions { /** Initial custom tools from SDK options */ customTools?: ToolDefinition[]; /** Initial active tool names */ initialActiveToolNames?: string[]; /** Tool registry from extensions */ getExtensionTools: () => Map; } export declare class ToolOrchestrator { private _toolRegistry; private _activeToolNames; private _customTools; private _initialActiveToolNames?; private _getExtensionTools; constructor(options: ToolOrchestratorOptions); /** * Get all registered tool names */ getToolNames(): string[]; /** * Get the names of currently active tools */ getActiveToolNames(): string[]; /** * Replace the runtime registry after tools are rebuilt. */ replaceTools(tools: Iterable, activeToolNames?: string[]): void; /** * Get all configured tools with name, description, and parameter schema */ getAllTools(): ToolInfo[]; /** * Get tool by name */ getTool(name: string): AgentTool | undefined; /** * Check if tool exists */ hasTool(name: string): boolean; /** * Set active tools by name * Returns the tools that were actually set and valid tool names */ setActiveToolsByName(toolNames: string[]): { tools: AgentTool[]; validToolNames: string[]; }; /** * Register a tool */ registerTool(name: string, tool: AgentTool): void; /** * Get custom tools */ getCustomTools(): ToolDefinition[]; /** * Replace custom tools after dynamic MCP refresh. */ setCustomTools(customTools: ToolDefinition[]): void; /** * Get initial active tool names */ getInitialActiveToolNames(): string[] | undefined; /** * Get extension tools map */ getExtensionTools(): Map; }