import type { CodexAppDispatchLedgerEntry, CodexAppGenerationCommit } from '../types.js'; export type CodexAppDispatchIdentity = Pick; /** Any ledger entry is daemon-owned unfinished work. Lifecycle mutations that * can replace a worker, pane, cwd, or chat route must reject while this is true; * explicit session close is the sole abandon operation. */ export declare function hasUnsettledCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[] | undefined): boolean; /** * Authorize a worker-hosted `botmux send` relay against the immutable Codex * App origin. `requireExact` is true for a live Codex App turn even when the * ledger has just become empty: settlement winning before watcher admission * must reject, never downgrade the old capability into an ordinary send. */ export declare function validateCodexAppManagedSendOrigin(ledger: readonly CodexAppDispatchLedgerEntry[] | undefined, origin: { turnId?: string; dispatchAttempt?: number; }, requireExact: boolean): { ok: true; requiresLedger: boolean; } | { ok: false; error: string; }; export declare function appendAcceptedCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[], entry: Omit): CodexAppDispatchLedgerEntry[]; export declare function prepareCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[], identity: CodexAppDispatchIdentity): { ok: true; ledger: CodexAppDispatchLedgerEntry[]; } | { ok: false; error: string; }; /** A worker proved that a prepared write left the runner input untouched (or * fully flushed invalid), so the exact item may return to accepted and retry in * the same FIFO without minting a second dispatch. */ export declare function retryPreparedCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[], identity: CodexAppDispatchIdentity): { ok: true; ledger: CodexAppDispatchLedgerEntry[]; } | { ok: false; error: string; }; export declare function cancelCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[], identity: CodexAppDispatchIdentity): { ok: true; ledger: CodexAppDispatchLedgerEntry[]; } | { ok: false; error: string; }; /** * Remove one exact VC delivery attempt after its owned CLI backing has been * authoritatively proved absent. Unlike ordinary cancellation, this does not * reject a prepared successor: the dead generation can no longer execute the * fenced attempt, and retaining it would make a replacement restore N beside * the delivery hub's replayed N+1. * * No match is idempotent success because the worker may have durably retired * the entry before it exited. More than one match is corruption and remains * fail-closed because the receipt identity does not contain a dispatchId. */ export declare function retireCodexAppDispatchAfterBackingMissing(ledger: readonly CodexAppDispatchLedgerEntry[], turnId: string, dispatchAttempt: number): { ok: true; ledger: CodexAppDispatchLedgerEntry[]; } | { ok: false; error: string; }; export declare function settleCodexAppDispatch(ledger: readonly CodexAppDispatchLedgerEntry[], commits: readonly CodexAppGenerationCommit[], identity: CodexAppDispatchIdentity, generation: string, seq: number): { ok: true; ledger: CodexAppDispatchLedgerEntry[]; commits: CodexAppGenerationCommit[]; settledEntry: CodexAppDispatchLedgerEntry; } | { ok: false; error: string; }; export declare function committedCodexAppSequence(commits: readonly CodexAppGenerationCommit[], generation: string, seq: number): boolean; /** A proved fresh runner retires every prior generation and its ACK history. */ export declare function retainFreshCodexAppGeneration(commits: readonly CodexAppGenerationCommit[], generation: string): CodexAppGenerationCommit[]; //# sourceMappingURL=codex-app-dispatch-ledger.d.ts.map