import type { CodeState } from "./types.js"; import type { CodeRunOptions, CodeRunResult, CodeToolCall, CodeToolResult } from "./types.js"; export type BridgedCodeCall = CodeToolCall & { callId: string; }; export type CodeRunEvent = { type: "wave"; runId: string; wave: number; calls: BridgedCodeCall[]; } | { type: "done"; runId: string; result: CodeRunResult; }; export type RunState = "queued" | "executing" | "awaiting_outputs" | "resuming" | "terminal"; type PendingWave = { waveId: number; nonce: number; calls: BridgedCodeCall[]; resolve: (results: readonly CodeToolResult[]) => void; reject: (error: Error) => void; }; type RunEntry = { runId: string; sessionId?: string; responseIds: Set; state: RunState; events: CodeRunEvent[]; waiter?: (event: CodeRunEvent) => void; pending?: PendingWave; abort: AbortController; createdAt: number; lastActiveAt: number; started: boolean; }; export declare function beginCodeRun(responseId: string, options: Omit, sessionId?: string): Promise; export declare function continueCodeRun(previousResponseId: string, nextResponseId: string, outputs: Array<{ callId: string; output: string; isError?: boolean; }>): Promise; export declare function hasCodeRun(responseId: string | undefined): boolean; export declare function clearCodeRuns(): void; export declare function clearCodeRunsForResponse(responseId: string): void; export declare function clearCodeRunsForSession(sessionId: string): void; export declare function getCodeModeSessionState(sessionId: string | undefined): CodeState; export declare function putCodeModeSessionState(sessionId: string | undefined, state: CodeState): void; export declare function getRunState(responseId: string): RunState | undefined; export declare function getRunId(responseId: string): string | undefined; /** * Testing hook: backdate all awaiting runs and force a GC sweep. * Resolves after the next GC timer fires and settles idle runs. */ export declare const __codeModeTesting: { forceIdleSweep(): Promise; }; export { RunEntry }; //# sourceMappingURL=coordinator.d.ts.map