import type { CodemodeOperation } from "@opengeni/contracts"; import { type Database } from "./database.js"; export type CodemodeContinuationScope = { accountId: string; workspaceId: string; sessionId: string; turnId: string; attemptId: string; executionGeneration: number; }; /** Persist semantics before policy preparation can create a linked review. */ export declare function bindCodemodePreparation(db: Database, input: CodemodeContinuationScope & { operationId: string; claimId: string; effectDigest: string; }): Promise; /** Waiting is a durable pre-effect state. It releases the worker claim and never rewrites origin. */ export declare function waitForCodemodeApproval(db: Database, input: CodemodeContinuationScope & { operationId: string; claimId: string; requestId: string; actionFingerprint: string; effectDigest: string; }): Promise; /** Worker-owned inventory for this logical turn. Public access additionally proves the current caller. */ export declare function listTurnCodemodeApprovals(db: Database, input: Pick): Promise; /** Current worker adopts the exact reviewed operation only after a committed human decision. * Catalog and origin remain immutable; the separate execution FK names the new owner. */ export declare function adoptCodemodeApproval(db: Database, input: CodemodeContinuationScope & { operationId: string; callerSubjectId: string; catalogDigest: string; effectDigest: string | null; }, onTerminal?: (tx: Database, operation: CodemodeOperation) => Promise): Promise; /** * Read a handle with the current exact attempt and same original caller; old * bearer authority is insufficient. This is a status read polled while a * caller waits, so it is one plain snapshot select: it proves the exact live * attempt in the same statement but takes no session/turn/attempt row locks * and is not refused by a pending Pause/Steer, which owns the write fence only. */ export declare function readTurnCodemodeOperation(db: Database, input: CodemodeContinuationScope & { operationId: string; callerSubjectId: string; }): Promise; /** Signed sandbox subjects are attempt-bound; only the same owning turn can use this mapping. */ export declare function codemodeCallerCanContinue(row: { attemptId: string; callerSubjectId: string; }, current: { attemptId: string; callerSubjectId: string; }): boolean;