import type { LlmStreamEvent, ProviderConfig, ProviderMessage, ProviderTool } from "./types"; interface ToolCallFn { (name: string, args: Record): Promise; } interface ToolLoopParams { config: ProviderConfig; /** Initial conversation history + the user turn that triggers the run. */ messages: ProviderMessage[]; /** Tools available to the LLM (already filtered by the caller). */ tools: ProviderTool[]; /** Executes an MCP tool and returns its raw result. */ callTool: ToolCallFn; /** Cap on assistant↔tool turns. */ maxSteps?: number; signal?: AbortSignal; } /** * Provider-agnostic tool loop. Streams the assistant response, executes any * tool calls via `callTool`, appends their results, and continues until the * assistant produces a response with no more tool calls, or `maxSteps` is * exhausted. * * This replaces MCPAgent.streamEvents() without pulling in langchain. */ export declare function runToolLoop(params: ToolLoopParams): AsyncGenerator; /** * Non-streaming helper used by the server-side `handleChatRequest` path. * Runs the same tool loop but collects the final assistant text and tool * invocations into a result object. */ export declare function runToolLoopNonStreaming(params: ToolLoopParams): Promise<{ content: string; toolCalls: { toolName: string; args: Record; result: unknown; }[]; }>; export {}; //# sourceMappingURL=toolLoop.d.ts.map