/** * Encoding and fail-closed decoding for the durable application mailbox's * command records (WFT-84). Index records live in * `mailbox-index-codec.ts`; shared readers in * `mailbox-codec-primitives.ts`. * * Decoding is deliberately paranoid. A mailbox record is the authority for * delivery, fencing, and terminal disposition, so a truncated, hand-edited, or * cross-version record must raise `PersistedDataCorruptError` rather than be * coerced into a plausible-looking state — silently treating a corrupt record * as `available` would redeliver work that already applied. * * @module core/mailbox-codec */ import type { ApplicationCommandRecord } from './mailbox-types.ts'; import { isApplicationCommandLeased } from './mailbox-types.ts'; /** * Decode one persisted command record, failing closed on anything unexpected. * * @throws {PersistedDataCorruptError} When the stored bytes are not a * well-formed current-version command record. */ export declare function decodeApplicationCommandRecord(bytes: Uint8Array, key: string): ApplicationCommandRecord; /** * Encode a command record for storage. */ export declare function encodeApplicationCommandRecord(record: ApplicationCommandRecord): Uint8Array; /** * Whether a decoded record still holds an attempt lease. Re-exported here so * storage callers need only one import. */ export { isApplicationCommandLeased };