/** * Audit log pruning with optional archive-before-delete. * * Prunes audit_log rows older than a configurable retention period. * When archiveBeforePrune is enabled, exports prunable rows to * a gzip-compressed JSONL file before deletion. * * Never throws — logs warnings on failure. Safe for fire-and-forget * startup wiring. * * @task T5339 */ import type { LoggingConfig } from '@cleocode/contracts'; export interface PruneResult { rowsArchived: number; rowsDeleted: number; archivePath?: string; } /** * Prune old audit_log rows from tasks.db. * * 1. If auditRetentionDays is 0 or undefined, skip age-based pruning. * 2. Compute cutoff timestamp from auditRetentionDays. * 3. If archiveBeforePrune, select rows older than cutoff and write to * .cleo/backups/logs/audit-YYYY-MM-DD.jsonl.gz. * 4. Delete rows older than cutoff from audit_log. * * Idempotent — safe to call multiple times. * Never throws — returns zero counts on any error. * * @param cleoDir - Absolute path to .cleo directory * @param config - LoggingConfig with auditRetentionDays and archiveBeforePrune */ export declare function pruneAuditLog(cleoDir: string, config: LoggingConfig): Promise; //# sourceMappingURL=audit-prune.d.ts.map