export declare const PI_WORK_ROOT_ENV = "PI_WORK_ROOT"; export declare const WORK_RUN_MANIFEST_FILE = ".pi-work-run.json"; export interface WorkRetentionOptions { maxAgeMs?: number; maxRuns?: number; maxTotalBytes?: number; /** Fixed tenant-wide cap for recursive file entries inspected during one prune. */ maxScannedEntries?: number; /** Fixed cap for run directories inspected during one prune. */ maxScannedRuns?: number; now?: number; } /** * Clamp caller-selected retention to the harness ceiling. Consumers may retain less, but cannot turn * a managed work tenant into an unbounded artifact store by raising or disabling these limits. */ export declare function boundedWorkRetention(options?: WorkRetentionOptions): WorkRetentionOptions; export interface AcquireWorkRunOptions { agentDir: string; category: string; tenant: string; runId?: string; retention?: WorkRetentionOptions | false; now?: number; } export interface WorkRunLease { readonly path: string; readonly category: string; readonly tenant: string; readonly runId: string; touch(): void; release(): void; } export declare function assertPortablePathSegment(label: string, value: string): void; /** * Report whether a managed run is leased or being cleaned. Stale local markers are removed as part * of the check; malformed or foreign-host markers remain fail-closed and count as active. */ export declare function hasActiveWorkRunLease(runDir: string): boolean; export declare function getWorkRoot(agentDir: string): string; export declare function getWorkTenantDir(agentDir: string, category: string, tenant: string): string; export declare function getWorkRunDir(agentDir: string, category: string, tenant: string, runId: string): string; export declare function createWorkRunId(now?: number): string; export declare function pruneWorkTenant(agentDir: string, category: string, tenant: string, options?: WorkRetentionOptions): string[]; export declare function getProcessWorkRun(agentDir: string, category: string, tenant: string, runId?: string): WorkRunLease; export declare function acquireWorkRun(options: AcquireWorkRunOptions): WorkRunLease; //# sourceMappingURL=work-directory.d.ts.map