import type { UploadedMessageFile } from '../http/routes/chat-input.js'; import { type CodexThreadTurnRuntimeOptions } from '../http/codex-thread-turn.js'; type CodexFollowupInput = { threadId: string; turnId: string; text: string; attachments: UploadedMessageFile[]; cwd?: string; runtimeOptions: CodexThreadTurnRuntimeOptions; }; type QueuedCodexFollowup = CodexFollowupInput & { queuedAt: string; state?: 'queued' | 'dispatching' | 'blocked' | 'discarded'; nativeTurnId?: string; requiresPostcondition?: boolean; recoveryError?: string; }; export declare function enqueueCodexFollowup(input: CodexFollowupInput): number; export type CodexTurnQueueState = { occupied: boolean; queuePosition: number | null; }; /** * Return the user-visible state before a native client waits for the writer * slot. This is intentionally a snapshot: the reservation remains the * authoritative serialization mechanism. */ export declare function codexTurnQueueState(threadId: string): CodexTurnQueueState; export type CodexTurnReservation = { threadId: string; token: string; requestTurnId?: string; }; export declare function listCodexFollowups(threadId: string): QueuedCodexFollowup[]; /** Discard delivery bookkeeping only; never interrupt or replay native work. */ export declare function discardCodexFollowup(threadId: string, turnId: string, acknowledgeUncertain?: boolean, resolvedNativeTurnId?: string): Promise; /** * Reserve the single writer slot for a native bridge turn. Native clients * keep their own JSON-RPC request open until this resolves, so the request * is forwarded only after the previous turn has become idle. */ export declare function acquireCodexTurn(threadId: string): Promise; /** Release a native bridge reservation and continue the per-thread queue. */ export declare function releaseCodexTurn(reservation: CodexTurnReservation): void; /** Wake queued work after a turn owned by an external hook/process completes. */ export declare function notifyCodexThreadIdle(threadId: string): void; export declare function submitCodexTurn(input: CodexFollowupInput): { status: 'accepted'; } | { status: 'queued'; queuePosition: number; }; export declare function drainCodexFollowups(threadId: string): void; export {}; //# sourceMappingURL=codex-followup-queue.d.ts.map