/** * 7-day log rotation for peaks-loop. * * daily files are named by UTC date, so a "new day" automatically * means a new file. The retention sweep runs at the start of every * peaks-loop invocation and removes any `peaks-loop-*.log` whose * UTC date is more than `retentionDays` days behind today. * * No external dep — `fs.readdirSync` + `statSync.mtimeMs` (or, for * the name-derived path, parse the YYYY-MM-DD from the file name). * We prefer the file NAME (not mtime) so a user who copies an old * log back into the directory does not have it re-deleted on the * next sweep. */ export type ApplyRetentionOptions = { /** Number of days to keep. Defaults to 7. */ retentionDays?: number; /** Wall-clock for tests. Defaults to `Date.now()`. */ nowMs?: number; /** Override log dir (used by tests). */ dirOverride?: string; }; /** * Delete any `peaks-loop-YYYY-MM-DD.log` file in the log dir whose * UTC date is more than `retentionDays` days older than today. * Returns the absolute paths of the deleted files (for tests + * observability). * * The function is best-effort: a per-file unlink failure is * silently swallowed (the file may have been removed by another * process between the `readdir` and the `unlink`). */ export declare function applyRetention(opts?: ApplyRetentionOptions): string[];