import type { HarneryStorageCatalog } from "./catalog.js"; export declare const HARNERY_MAINTENANCE_TRANSACTION_SCHEMA: "harnery.storage-maintenance-transaction/v1"; export declare const HARNERY_MAINTENANCE_RECEIPT_SCHEMA: "harnery.storage-maintenance-receipt/v1"; export declare const HARNERY_MAINTENANCE_CURSOR_SCHEMA: "harnery.storage-maintenance-cursor/v1"; export declare const HARNERY_MAINTENANCE_PRESSURE_SCHEMA: "harnery.storage-pressure/v1"; export interface HarneryMaintenanceBudget { max_duration_ms: number; max_files: number; max_bytes: number; } export interface HarneryStoragePressureFamily { family_id: string; logical_bytes: number; regular_files: number; needs_maintenance: boolean; observed_at: string; } export interface HarneryStoragePressureSummary { schema: typeof HARNERY_MAINTENANCE_PRESSURE_SCHEMA; captured_at: string; families: readonly HarneryStoragePressureFamily[]; } export interface HarneryMaintenanceAction { action_id: string; family_id: string; kind: string; target_ref: string; files: number; bytes: number; destructive: boolean; /** Exact provider-owned destructive scope; generic destructive actions are never authorized. */ authorization_scope?: string; /** Effective user/source retention policy frozen into the plan. */ effective_policy_fingerprint?: string; expected_sha256?: string; metadata?: Readonly>; } export interface HarneryMaintenanceProviderPlan { actions: readonly HarneryMaintenanceAction[]; next_cursor?: string; } export interface HarneryMaintenanceProvider { family_id: string; /** The sole destructive scope this provider may plan and apply. */ destructive_scope?: string; budget?: Partial; plan(input: { coord_root: string; pressure: HarneryStoragePressureFamily; cursor?: string; budget: HarneryMaintenanceBudget; now: Date; }): HarneryMaintenanceProviderPlan | Promise; apply(input: { coord_root: string; transaction_id: string; action: HarneryMaintenanceAction; now: Date; }): HarneryMaintenanceMutation | Promise; } export interface HarneryMaintenanceMutation { outcome: "applied" | "already_applied" | "refused"; output_sha256?: string; detail?: string; } export interface HarneryMaintenanceTransaction { schema: typeof HARNERY_MAINTENANCE_TRANSACTION_SCHEMA; transaction_id: string; created_at: string; updated_at: string; state: "planned" | "running" | "committed" | "refused" | "failed"; dry_run: boolean; catalog_policies: Readonly>; effective_policy_fingerprints: Readonly>; budget: HarneryMaintenanceBudget; actions: readonly HarneryMaintenanceAction[]; next_cursors: Readonly>; reason_codes: readonly string[]; } export interface HarneryMaintenanceReceipt { schema: typeof HARNERY_MAINTENANCE_RECEIPT_SCHEMA; transaction_id: string; action_id: string; family_id: string; action_sha256: string; outcome: HarneryMaintenanceMutation["outcome"]; output_sha256?: string; detail?: string; committed_at: string; } export interface HarneryAutomaticMaintenanceResult { ran: boolean; reason: "disabled" | "no-pressure" | "fresh" | "contended" | "planned" | "committed"; transaction_id?: string; actions: number; files: number; bytes: number; } export declare const DEFAULT_MAINTENANCE_BUDGET: HarneryMaintenanceBudget; export declare function planStorageMaintenance(catalog: HarneryStorageCatalog, providers: readonly HarneryMaintenanceProvider[], pressure: HarneryStoragePressureSummary, options?: { now?: Date; budget?: HarneryMaintenanceBudget; family_id?: string; persist?: boolean; transaction_id?: string; }): Promise; export declare function executeStorageMaintenance(catalog: HarneryStorageCatalog, providers: readonly HarneryMaintenanceProvider[], transactionId: string, options: { yes: boolean; now?: Date; authorize_structured_log_deletion?: boolean; }): Promise; export declare function runAutomaticMaintenanceSlice(catalog: HarneryStorageCatalog, providers: readonly HarneryMaintenanceProvider[], options?: { now?: Date; budget?: HarneryMaintenanceBudget; execute?: boolean; }): Promise; export declare function readMaintenanceTransaction(coordRoot: string, transactionId: string): HarneryMaintenanceTransaction; export declare function listMaintenanceTransactions(coordRoot: string): HarneryMaintenanceTransaction[]; export declare function writePressureSummary(coordRoot: string, summary: HarneryStoragePressureSummary): void; export declare function readPressureSummary(coordRoot: string): HarneryStoragePressureSummary | undefined; export declare class HarneryMaintenanceError extends Error { readonly code: string; constructor(code: string, message: string); } //# sourceMappingURL=maintenance.d.ts.map