/** * CLI Cleanup Command * Removes project artifacts created by monomind/monomind * * github.com/monoes/monomind */ import type { Command } from '../types.js'; /** A single stale-scratch candidate returned by {@link findStaleScratch}. */ interface StaleScratchItem { path: string; description: string; size: number; } /** * Find prunable entries under the per-project data base (default * ~/.monomind/projects). Exported for tests — `baseDir`/`now` injectable. * * Classification per dir: * - `origin.json` present and its recorded path still exists → keep the dir, * but flag a leftover `lancedb/` subdir (dead since the SQLite engine swap). * - `origin.json` present, recorded path gone → orphaned → prune. * - no `origin.json` (pre-2.3.1 dirs can't prove their origin) → prune only * when untouched for {@link UNKNOWN_DIR_MAX_AGE_MS} — or immediately with * `--aggressive`, which treats unprovable dirs as junk (safe: every live * project rewrites origin.json on its next memory access). */ export declare function findOrphanedProjectData(baseDir: string, now: number, aggressive: boolean): StaleScratchItem[]; /** * Find stale mastermind scratch under `.monomind/taskdev/` and `.monomind/loops/`. * Exported for tests. Never returns `progress.md` (the taskdev recovery ledger), * directories, or loop JSON it cannot parse — deleting the unclassifiable loses data. * * A loop JSON is only ever classified as abandoned when it has a real, positive, * numeric `nextRunAt` timestamp that is more than a day in the past. Live producers * write `nextRunAt: 0` (real /do loops) or `nextRunAt: null` (dashboard) — those, * along with missing/non-numeric values, are never eligible for deletion regardless * of `status`, since a crashed daemon can leave a stale `status: 'running'` behind. */ export declare function findStaleScratch(cwd: string, now: number): StaleScratchItem[]; /** * Cleanup command definition */ export declare const cleanupCommand: Command; export default cleanupCommand; //# sourceMappingURL=cleanup.d.ts.map