import { SubAgentDef } from "./agent-pool.mjs"; import { ToolDispatcher } from "./sandbox-runtime.mjs"; //#region extensions/crypto/src/services/agent-orchestrator.d.ts type LlmProvider = 'anthropic' | 'openrouter' | 'openai' | 'bankr'; interface OrchestratorResult { /** The sub-agent's final text response. */ response: string; /** Tool calls made during execution. */ toolCalls: ToolCallRecord[]; /** Total LLM tokens used (input + output). Estimated. */ tokensUsed: number; /** Execution time in ms. */ durationMs: number; /** Whether the task completed or was cut short. */ status: 'completed' | 'timeout' | 'max_calls' | 'error'; /** Error message if status is 'error'. */ error?: string; } interface ToolCallRecord { tool: string; args: Record; result: string; durationMs: number; } /** Tool schema for the sub-agent (simplified JSON Schema). */ interface ToolSchema { name: string; description: string; input_schema: Record; } declare function detectProvider(): LlmProvider; declare function getApiKey(provider: LlmProvider): string | null; /** * Build tool schemas for the sub-agent from the registered tool list. * Only includes tools that are in the agent's allowedTools list. */ declare function buildToolSchemas(allowedTools: string[], registeredTools: Array<{ name: string; description: string; parameters: any; }>): ToolSchema[]; /** * Execute a task with a sub-agent. * * 1. Sends the task to the sub-agent's LLM with its system prompt * 2. If the LLM requests tool calls, executes them via the dispatcher * 3. Feeds tool results back and continues until the LLM produces a final response * 4. Enforces maxToolCalls and timeout */ declare function executeSubAgent(agent: SubAgentDef, task: string, dispatcher: ToolDispatcher, registeredTools: Array<{ name: string; description: string; parameters: any; }>): Promise; //#endregion export { LlmProvider, OrchestratorResult, ToolCallRecord, buildToolSchemas, detectProvider, executeSubAgent, getApiKey }; //# sourceMappingURL=agent-orchestrator.d.mts.map