/** * The bounded maintenance pass for the application command mailbox (WFT-84). * * Maintenance is the only thing that advances time-driven work: releasing a * delayed command, reclaiming an expired lease at its original FIFO position, * dead-lettering a command past its absolute deadline, and retiring terminal * receipts past their retention window. Nothing here runs on a hidden timer — a * host with `backgroundTasks: 'manual'` calls `runMaintenance()` and gets * exactly one deterministic pass. * * Every pass is bounded. It walks the command keyspace in pages of * `maintenanceBatchSize` records, up to {@link MAILBOX_MAINTENANCE_MAX_PAGES} * pages per call, carrying its cursor to the next call when the cap cuts it * short; and it retires at most `maintenanceBatchSize` terminal receipts. A large * mailbox drains across several calls instead of one unbounded sweep. * * @module core/mailbox-maintenance */ import type { MailboxMaintenanceReport } from './mailbox-contract.ts'; import { type MailboxRuntime } from './mailbox-internals.ts'; /** * Run one bounded maintenance pass. * * The scan decodes every command record it visits, so a single corrupt record * raises `PersistedDataCorruptError` and halts the pass. That is deliberate: a * mailbox whose durable state is untrustworthy must not keep reclaiming leases * and dead-lettering commands around the damage. */ export declare function runMailboxMaintenance(runtime: MailboxRuntime, now: number): Promise;