import type { SessionSurface } from './session-surface.js'; /** * How often the sweep repeats after startup: 6 hours. Hours, not minutes, the * residue this reclaims accumulates per crashed session, not continuously, and * a directory scan is not something a foreground surface should be doing often. */ export declare const DURABILITY_HOUSEKEEPING_INTERVAL_MS: number; export interface DurabilityHousekeepingInput { /** The product's declare-once storage handle; every swept path derives from it. */ readonly surface: SessionSurface; /** * The session this process is using right now, read at sweep time rather * than captured once, a resume or fork can repoint it between sweeps. * Returning null means "not known yet", which is safe: the age and liveness * rules independently protect an actively written artefact. */ readonly currentSessionId?: () => string | null; /** Extra directories to scan for `.unrecognized` quarantine files. */ readonly extraQuarantineDirs?: readonly string[]; } export interface DurabilityHousekeepingOutcome { readonly livenessMarkers: number; readonly transcriptJournals: number; readonly quarantineFiles: number; readonly anchorSidecars: number; /** Sum of the four counts above, zero means nothing was reclaimed. */ readonly total: number; } /** * Run all four reaps once and return what each reclaimed. * * Each reap is isolated: one throwing is logged at warn level and counted as * zero, and the remaining reaps still run. The caller never sees an exception. */ export declare function runDurabilityHousekeeping(input: DurabilityHousekeepingInput): DurabilityHousekeepingOutcome; /** * Start durability housekeeping: one sweep now, then a repeating sweep every * `DURABILITY_HOUSEKEEPING_INTERVAL_MS`. Returns a disposer that stops the * timer; calling it more than once is harmless. * * The timer is `unref()`d, so an undisposed sweeper can never hold the process * open, same convention the store-snapshot scheduler and the config-file * watchers in durability-services.ts use. */ export declare function startDurabilityHousekeeping(input: DurabilityHousekeepingInput, options?: { readonly intervalMs?: number; }): () => void; //# sourceMappingURL=durability-housekeeping.d.ts.map