import { A2AModule } from '../modules/a2a/a2a.module.js'; import { MCPModule } from '../modules/mcp/mcp.module.js'; import { ThreadObject } from '../types/memory.js'; import { ConnectorTool } from '../types/connector.js'; import { StreamEvent } from '../types/stream.js'; import { ModelModule } from '../modules/models/model.module.js'; import '@a2a-js/sdk'; import '../types/mcp.js'; import '@modelcontextprotocol/sdk/client/sse.js'; import '@modelcontextprotocol/sdk/client/stdio.js'; import '@modelcontextprotocol/sdk/client/streamableHttp.js'; import '../modules/models/base.model.js'; type ToolCallingMode = "all" | "mcp"; /** * Hard cap on the tool-calling iteration loop. The loop normally exits when * the model returns a turn with no tool_calls; the cap is a defense-in-depth * guard against runaway interactions caused by protocol drift or persistent * model loops. */ declare const MAX_TOOL_ITERATIONS = 15; declare class ToolCallingService { private modelModule; private a2aModule?; private mcpModule?; constructor(modelModule: ModelModule, a2aModule?: A2AModule, mcpModule?: MCPModule); getTools(params: { toolPrompt: string; mode?: ToolCallingMode; }): Promise; run(params: { messages: unknown[]; tools: ConnectorTool[]; query: string; thread: ThreadObject; toolChoice?: "auto" | "required"; }): AsyncGenerator; private selectTool; private executeTool; } export { MAX_TOOL_ITERATIONS, type ToolCallingMode, ToolCallingService };