/** * Storage key builders for the durable application command mailbox (WFT-84). * * Spread into `KEYS` in `interface.ts` rather than declared there, so the * mailbox keyspace can carry its full rationale without pushing that file past * its documented line ceiling. Callers still reach these through `KEYS`, which * keeps one import contract for storage keys. * * Every key is scoped by an opaque `(namespace, resourceId)` pair. Weft never * interprets either component, and no key here overlaps the workflow, schedule, * or worker-protocol keyspaces. * * @module storage/mailbox-keys */ /** * Mailbox header, command record, FIFO delivery index, idempotency binding, and * terminal-retention index keys. * * Spread into `KEYS`; not intended to be imported directly by mailbox code. */ export declare const MAILBOX_KEYS: { /** * The durable mailbox header for one `(namespace, resourceId)` application * command mailbox: FIFO sequence allocator plus the open-backlog counter that * admission backpressure reads. One key per mailbox, so admission and terminal * transitions serialize against each other per mailbox rather than globally. */ readonly applicationMailbox: (namespace: string, resourceId: string) => string; /** * A single-use probe an event sink writes in the first commit it makes for a * mailbox, read back from the mailbox's own storage. Its presence proves the * sink committed here rather than to some other backend; it is deleted as * soon as it has been observed. */ readonly applicationMailboxSinkProbe: (namespace: string, resourceId: string, nonce: string) => string; /** Scan prefix for every canonical command record in one mailbox. */ readonly applicationCommandPrefix: (namespace: string, resourceId: string) => string; /** * The one authoritative record for a command. Every transition proves the * expected prior bytes through `storage.conditionalBatch`, so this key is the * command's compare-and-swap fence. */ readonly applicationCommand: (namespace: string, resourceId: string, commandId: string) => string; /** Scan prefix for a mailbox's FIFO delivery index. */ readonly applicationCommandReadyPrefix: (namespace: string, resourceId: string) => string; /** * The FIFO delivery index, keyed by the command's ORIGINAL admission sequence * so a redelivered command re-enters at the position it was first admitted to * rather than at the back of the queue. */ readonly applicationCommandReady: (namespace: string, resourceId: string, sequence: number) => string; /** * Maps an idempotency key to the command id admitted for it. Written in the * same conditional batch as the command record, gated on this key being * absent, so concurrent same-key admissions converge on one command. Retained * past terminal so a post-terminal retry resolves the original receipt instead * of admitting a second command. */ readonly applicationCommandIdempotency: (namespace: string, resourceId: string, key: string) => string; /** Scan prefix for a mailbox's full sequence-ordered listing index. */ readonly applicationCommandBySequencePrefix: (namespace: string, resourceId: string) => string; /** * Every command in the mailbox, ordered by admission sequence. * * Distinct from the delivery index, which holds only the deliverable subset: a * claimed or terminal command leaves that index but stays here until retention * retires it. Bounded, ordered listing needs an index covering every state, * because command records themselves are keyed by minted id and therefore scan * in arbitrary order. */ readonly applicationCommandBySequence: (namespace: string, resourceId: string, sequence: number) => string; /** Scan prefix for a mailbox's terminal-receipt retention index. */ readonly applicationCommandTerminalPrefix: (namespace: string, resourceId: string) => string; /** * Terminal-receipt retention index, sorted by the time the command reached a * terminal disposition so retention sweeps delete the oldest bounded batch * first. */ readonly applicationCommandTerminal: (namespace: string, resourceId: string, terminalAt: number, commandId: string) => string; };