import type { Session } from '../../types/session.js'; import type { EffectToolExecutor, ToolContext } from '../../types/run-context.js'; import type { Tool, AnyTool } from '../../types/effectTool.js'; import type { ToolEnforcer } from '../../guards/ToolEnforcer.js'; import { type ToolCallPair } from './pairing.js'; export interface CoreToolExecutorConfig { tools: Record; enforcer?: ToolEnforcer; parallelExecution?: boolean; agentId?: string; onInterim?: (message: string, toolName: string) => void; /** * Called for each chunk an async-iterable tool yields, as it arrives. The aggregate is * still the tool's result; this is progress, not output. */ onChunk?: (chunk: unknown, toolName: string, toolCallId: string) => void; } export interface CoreExecuteArgs { name: string; args: unknown; session: Session; abortSignal?: AbortSignal; toolCallId?: string; toolCtx?: ToolContext; /** Flow-local tool def passed by the driver; wins over the registry when both exist. */ def?: AnyTool; } export declare class CoreToolExecutor implements EffectToolExecutor { private readonly tools; private readonly enforcer?; private readonly parallelExecution; private readonly agentId; private readonly onInterim?; private readonly onChunk?; private readonly pairing; private executionGate; private callHistory; constructor(config: CoreToolExecutorConfig); getPairs(): ToolCallPair[]; getTool(name: string): Tool | undefined; execute(args: CoreExecuteArgs): Promise; private withSerialGate; private executeInner; }