/** * Cleanup — scratch pruning (--scratch): stale taskdev handoff files and * abandoned loop state, plus the shared remove/report and size helpers. * Extracted from cleanup.ts. */ /** A single stale-scratch candidate returned by {@link findStaleScratch}. */ export interface StaleScratchItem { path: string; description: string; size: number; } /** * 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[]; /** * Report (dry run) or delete a batch of file/dir items, printing the same * `[would remove]` / `[removed]` / `[failed]` lines used across cleanup modes. * Shared by the scratch branch; the main artifact loop keeps its own copy * because of the `--keep-config` `.claude/settings.json` preservation special case. */ export declare function removeOrReport(cwd: string, items: { path: string; description: string; size: number; type: 'dir' | 'file'; }[], dryRun: boolean): { removed: number; removedSize: number; }; /** * Format bytes into a human-readable string */ export declare function formatSize(bytes: number): string; //# sourceMappingURL=cleanup-scratch.d.ts.map