/** * TTL GC for persisted chat attachments (`.spectral/attachments//`). * * Mirrors `src/server/offload-gc.ts`: the sweep removes per-session * directories whose session no longer exists AND whose directory mtime is * older than `SPECTRAL_ATTACHMENT_TTL_DAYS` (default 7). Sessions that still * exist in the store are never swept, however old their attachments are. * * Best-effort and synchronous: callers fire-and-forget it (server startup, * first prompt). Never throws. * * @module @spectral/server/attachments/cleanup */ /** Session dirs older than this (in days) are swept when their session is gone. */ export declare const DEFAULT_ATTACHMENT_TTL_DAYS = 7; /** Effective TTL in ms (override via `SPECTRAL_ATTACHMENT_TTL_DAYS`). */ export declare function getAttachmentTtlMs(): number; export interface AttachmentSweepResult { removedSessions: number; removedBytes: number; } export interface SweepAttachmentsOptions { /** `.spectral/attachments` root to sweep (per project cwd). */ root: string; /** * Session ids that still exist — their directories are NEVER swept, * however old. Omitted = treat every session as gone (TTL-only sweep). */ activeSessionIds?: Iterable; /** Epoch ms "now" (tests). Defaults to `Date.now()`. */ now?: number; /** TTL override in ms (tests). Defaults to `getAttachmentTtlMs()`. */ ttlMs?: number; } /** * Remove stale attachment session directories. A directory is removed only * when BOTH: its name matches no active session id AND its mtime is older * than the TTL. Dotfiles (`.gitignore`) and stray non-directories are left * alone. Never throws. */ export declare function sweepAttachments(options: SweepAttachmentsOptions): AttachmentSweepResult; //# sourceMappingURL=cleanup.d.ts.map