/** * Structured-adaptive streaming tool executor. * Starts complete streamed tool calls before the assistant response finishes, * while preserving ordered tool_result emission for the next model turn. * [WHO]: StructuredAdaptiveStreamingToolExecutor * [FROM]: @catui/ai * [TO]: Consumed by core/lib/agent-core/src/index.ts * [HERE]: core/lib/agent-core/src/structured-adaptive-streaming-tool-executor.ts - owned by core/lib/agent-core/AGENT.md */ import { EventStream } from "@catui/ai/events"; import type { AgentEvent, AgentLoopConfig, AgentMessage, AgentTool } from "./types.js"; import { type StructuredAdaptiveToolCall, type StructuredAdaptiveToolRunResult } from "./structured-adaptive-tool-orchestration.js"; /** * @deprecated Replaced by the unified standard loop's concurrent batching. The * weak-model-compatible loop converged into `agentLoop`; streaming tool * pre-execution is no longer needed because the standard loop executes tools * after the assistant response completes (with `createInterruptedToolResults` * closing the turn on error/abort). This class is retained for public API * compatibility only and has no in-tree consumer. */ export declare class StructuredAdaptiveStreamingToolExecutor { private readonly stream; private readonly canUseTool?; private readonly toolPolicies?; private readonly checkpointStore?; private readonly checkpointTtlMs?; private readonly sessionId?; private readonly messageCount; private readonly toolByName; private readonly records; private readonly maxConcurrency; private discardedReason; private parentAborted; private parentAbortReason; private approvalRequired; constructor(tools: AgentTool[] | undefined, signal: AbortSignal | undefined, stream: EventStream, maxConcurrency: number, canUseTool?: AgentLoopConfig["canUseTool"], toolPolicies?: AgentLoopConfig["toolPolicies"], checkpointStore?: AgentLoopConfig["checkpointStore"], checkpointTtlMs?: number | undefined, sessionId?: string | undefined, messageCount?: number); get size(): number; get toolCalls(): readonly StructuredAdaptiveToolCall[]; addTool(toolCall: StructuredAdaptiveToolCall): void; drain(): Promise; discardAndDrain(reason: string, abortMode?: "all" | "cancel"): Promise; private processQueue; private canStart; private start; private completeAsDeferred; private completeWithSyntheticError; }