/** Where a sweep's disclosure is written, inside the wake root. */ export declare const WAKE_REAP_RECEIPT_FILE = "reaped.json"; /** Default cap on retained debug clips. */ export declare const WAKE_RETAINED_MAX_FILES = 200; /** Default age after which a retained clip is reaped, in hours. */ export declare const WAKE_RETAINED_MAX_AGE_HOURS = 24; /** Age after which an abandoned partial download is reaped, in hours. */ export declare const WAKE_PARTIAL_MAX_AGE_HOURS = 6; /** How often the periodic sweeper runs, in milliseconds. */ export declare const WAKE_SWEEP_INTERVAL_MS: number; /** Why one path was reaped. */ export type WakeReapReason = /** A `.part` file left behind by an interrupted download. */ 'abandoned-partial' /** Present but its bytes do not hash to the pin, torn, truncated, or the wrong asset. */ | 'failed-verification' /** An artifact of a model version the manifest no longer lists. */ | 'unpinned-version' /** Retained audio older than the TTL. */ | 'retained-expired' /** Retained audio beyond the count cap, oldest first. */ | 'retained-over-cap' /** Retained audio whose owning session no longer exists. */ | 'retained-orphaned'; /** One reaped path. */ export interface WakeReapedEntry { readonly path: string; readonly reason: WakeReapReason; readonly bytes: number; } /** What one sweep did. Returned AND written to the receipt. */ export interface WakeReapSummary { readonly at: string; readonly wakeRoot: string; readonly reaped: readonly WakeReapedEntry[]; readonly bytesReclaimed: number; /** Paths a sweep wanted to remove but could not, with the reason. */ readonly failures: readonly { readonly path: string; readonly error: string; }[]; } export interface WakeRecoveryOptions { readonly managedRoot: string; /** Model version whose artifacts are current. Defaults to the manifest default. */ readonly version?: string | undefined; /** Session ids still alive; retained audio for any other session is orphaned. */ readonly liveSessionIds?: readonly string[] | undefined; readonly retainedMaxFiles?: number | undefined; readonly retainedMaxAgeHours?: number | undefined; /** Injected clock, so TTL behaviour is deterministic under test. */ readonly now?: number | undefined; /** Skip writing the receipt, for a caller that only wants the summary. */ readonly skipReceipt?: boolean | undefined; } /** * Sweep the managed wake-word tree once. Safe to call at any time, from any * number of processes; returns what it removed. */ export declare function sweepWakeStorage(options: WakeRecoveryOptions): WakeReapSummary; /** * The filename a retained clip MUST be written under, so the sweeper can tell * whose it is. * * The convention is load-bearing rather than cosmetic: {@link sweepRetained} * reads the session id from the first `--`-delimited segment, so a host that * invents its own naming gets clips reaped as orphans, or worse, never reaped. * Exported so no surface has to re-derive it from reading this file. */ export declare function retainedClipFileName(sessionId: string, at: number, extension?: string): string; /** A running periodic sweeper. */ export interface WakeRecoverySweeper { /** Run a sweep now, outside the schedule. */ sweepNow(): WakeReapSummary; /** Stop the schedule. Idempotent. */ stop(): void; } /** * Sweep at recovery and then on a schedule, so a long-lived daemon does not go * a week between sweeps. Returns the first sweep's summary through * {@link WakeRecoverySweeper.sweepNow} on demand. */ export declare function startWakeRecoverySweeper(options: WakeRecoveryOptions & { readonly intervalMs?: number | undefined; }): WakeRecoverySweeper; //# sourceMappingURL=recovery.d.ts.map