import { type ExhaustedRow } from "./dispatch.js"; import type { Config } from "./config.js"; /** Bumped when the row shape changes; a mismatch restores nothing rather than guessing. */ export declare const CURRENT_DISPATCH_EXHAUSTION_VERSION = 1; export interface DispatchExhaustionFile { version: number; rows: ExhaustedRow[]; } export declare function getDispatchExhaustionPath(): string; /** * Read the still-live rows. Absent file, unreadable file, wrong version, or an unrecognized * envelope all yield an empty list — never a throw, never a partial cooldown from a shape we * did not recognize. */ export declare function loadExhaustedRows(opts?: { path?: string; now?: number; }): ExhaustedRow[]; export declare function saveExhaustedRows(rows: readonly ExhaustedRow[], opts?: { path?: string; now?: number; }): void; /** * Wire a config's ladder state to the file: restore what is still cooling, then flush on every * change, debounced through the shared `WriteBehindTimer`. Returns the number restored. */ export declare function installDispatchExhaustionPersistence(cfg: Config, opts?: { path?: string; now?: () => number; }): number; /** * The shutdown seam: write every dirty death NOW. Until 2026-09-08 nothing could — a * vendor-stated cooldown reported in the last two seconds before a graceful stop was lost, and * the lane retried. Returns how many files were written. */ export declare function flushDispatchExhaustionPersistence(): number;