import { WorkflowLeaseManager } from "./workflow-lease.js"; import type { RunProjectionV2 } from "./workflow-types.js"; export interface CleanupItem { readonly kind: "run" | "worker-session" | "artifact"; readonly path: string; readonly bytes: number; } export interface CleanupCandidate { readonly requestKey: string; readonly runId: string; readonly updatedAt: string; readonly ageMs: number; readonly items: readonly CleanupItem[]; readonly reclaimableBytes: number; } export interface CleanupSkip { readonly requestKey: string; readonly runId: string; readonly reason: "not-old-enough" | "active-run" | "ambiguous-run" | "active-worker" | "held-session-lease" | "corrupt-session-lease"; readonly diagnostic: string; } export interface RunCleanupPlan { readonly dryRun: true; readonly olderThanMs: number; readonly candidates: readonly CleanupCandidate[]; readonly skipped: readonly CleanupSkip[]; readonly reclaimableBytes: number; } export interface RunCleanupResult extends Omit { readonly dryRun: false; readonly auditEventPath: string | null; readonly deletedRunIds: readonly string[]; } interface CleanupRunCatalog { listRuns(): Promise; } interface CleanupLeaseAuthority { withCurrentSupervisor(generation: string, operation: () => Promise): Promise; inspectWorkerSession(sessionPath: string): ReturnType; } export interface WorkflowRunCleanupOptions { readonly namespaceDirectory: string; readonly store: CleanupRunCatalog; readonly leaseManager: CleanupLeaseAuthority; readonly supervisorGeneration: string; readonly now?: () => Date; readonly randomUUID?: () => string; readonly removePath?: (path: string) => Promise; } export declare class CleanupConfirmationError extends Error { constructor(message: string); } export declare class WorkflowRunCleanup { #private; constructor(options: WorkflowRunCleanupOptions); plan(olderThanMs: number): Promise; execute(input: { readonly olderThanMs: number; readonly confirmed: boolean; }): Promise; } export declare function confirmCleanupDeletion(input: { readonly dryRun: boolean; readonly yes: boolean; readonly tui: boolean; readonly confirm?: () => Promise; }): Promise; export declare function parseCleanupAge(value: string): number; export {}; //# sourceMappingURL=run-cleanup.d.ts.map