import type { AgentTool } from "@earendil-works/pi-agent-core"; /** * How a tool call is ordered against the other calls of the same assistant message. * - "shared": may overlap other shared calls; waits for the latest earlier exclusive call (default) * - "exclusive": waits for every earlier call; later calls wait for it * - function: resolved per call from its prepared arguments; a throwing resolver means "exclusive" */ export type ToolConcurrencyMode = "shared" | "exclusive"; export type ToolConcurrency> = ToolConcurrencyMode | ((args: Partial) => ToolConcurrencyMode); export declare function resolveToolConcurrency(concurrency: ToolConcurrency | undefined, args: Partial): ToolConcurrencyMode; /** * Orders tool executions in the order they start. The agent loop starts a batch's calls in * assistant-message order, so an exclusive call observes every earlier call's effects and no * later call observes the state from before it. */ export declare class ToolExecutionScheduler { #private; /** Runs `run` synchronously when nothing earlier blocks it, so its abort listeners attach immediately. */ schedule(mode: ToolConcurrencyMode, run: () => Promise): Promise; } /** Route a tool's executions through a session scheduler according to its declared concurrency. */ export declare function scheduleToolExecution(tool: AgentTool, scheduler: ToolExecutionScheduler, abortError?: () => Error): AgentTool; //# sourceMappingURL=tool-concurrency.d.ts.map