type Awaitable = Value | Promise; export type TerminalInteractionReservationFailureFence = "write_started" | "confirmed"; export interface TerminalInteractionDispatchHooks { authorize(context: Context): Awaitable; beforeDispatch(context: Context): Promise; } export interface TerminalInteractionResponseTransaction { /** * Managed legacy state may have committed even when its synchronous save * throws. Watch CAS writes only become authoritative after confirmation. */ readonly reservationFailureFence: TerminalInteractionReservationFailureFence; dispatch(hooks: TerminalInteractionDispatchHooks): Promise; authorize(context: Context): Awaitable; createReservation(context: Context): Reservation; reserve(context: Context, reservation: Reservation, /** Mark the exact durable-commit boundary before outer lock cleanup. */ confirmReservation: () => void): Awaitable; release(reservation: Reservation, error: unknown): Awaitable; releaseFailure(reservation: Reservation, error: unknown, releaseError: unknown): Awaitable; markUncertain(reservation: Reservation, error: unknown): Awaitable; consume(reservation: Reservation, execution: Execution): Awaitable; responded(execution: Execution): boolean; isInputNotStarted(error: unknown): boolean; duplicateReservationError(): unknown; inputNotStartedError(error: unknown): unknown; missingReservationError(): unknown; } export type TerminalInteractionResponseTransactionResult = { readonly state: "blocked"; readonly execution: Execution; readonly reservation?: Reservation; } | { readonly state: "consumed"; readonly execution: Execution; readonly reservation: Reservation; }; /** * Subject-neutral one-shot response transaction. The ports retain ownership * of Store shape, locking, audit wording, and native bridge semantics; this * kernel only keeps the reserve/release/uncertain/consume ordering identical. */ export declare function executeTerminalInteractionResponseTransaction(transaction: TerminalInteractionResponseTransaction): Promise>; export {};