/**
 * Audit snapshot persistence module.
 * Save, load, and list point-in-time audit result snapshots.
 * Schema v2 adds auditVersion to the audit envelope.
 * V1 snapshots are auto-migrated on load (auditVersion defaults to "1.0.0").
 */
import { z } from "zod";
import type { AuditResult, SnapshotFile, SnapshotListEntry } from "./types.js";
export declare const auditCheckSchema: z.ZodObject<{
    id: z.ZodString;
    category: z.ZodString;
    name: z.ZodString;
    severity: z.ZodEnum<{
        critical: "critical";
        warning: "warning";
        info: "info";
    }>;
    passed: z.ZodBoolean;
    currentValue: z.ZodString;
    expectedValue: z.ZodString;
    fixCommand: z.ZodOptional<z.ZodString>;
    explain: z.ZodOptional<z.ZodString>;
    complianceRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
        framework: z.ZodString;
        controlId: z.ZodString;
        version: z.ZodString;
        description: z.ZodString;
        coverage: z.ZodEnum<{
            full: "full";
            partial: "partial";
        }>;
        level: z.ZodOptional<z.ZodEnum<{
            L1: "L1";
            L2: "L2";
        }>>;
    }, z.core.$strip>>>;
    tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
    vpsIrrelevant: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare const categorySchema: z.ZodObject<{
    name: z.ZodString;
    checks: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        category: z.ZodString;
        name: z.ZodString;
        severity: z.ZodEnum<{
            critical: "critical";
            warning: "warning";
            info: "info";
        }>;
        passed: z.ZodBoolean;
        currentValue: z.ZodString;
        expectedValue: z.ZodString;
        fixCommand: z.ZodOptional<z.ZodString>;
        explain: z.ZodOptional<z.ZodString>;
        complianceRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
            framework: z.ZodString;
            controlId: z.ZodString;
            version: z.ZodString;
            description: z.ZodString;
            coverage: z.ZodEnum<{
                full: "full";
                partial: "partial";
            }>;
            level: z.ZodOptional<z.ZodEnum<{
                L1: "L1";
                L2: "L2";
            }>>;
        }, z.core.$strip>>>;
        tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
        vpsIrrelevant: z.ZodOptional<z.ZodBoolean>;
    }, z.core.$strip>>;
    score: z.ZodNumber;
    maxScore: z.ZodNumber;
    connectionError: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>;
export declare const quickWinSchema: z.ZodObject<{
    commands: z.ZodArray<z.ZodString>;
    currentScore: z.ZodNumber;
    projectedScore: z.ZodNumber;
    description: z.ZodString;
}, z.core.$strip>;
/** Schema v1 — legacy format, no auditVersion field */
export declare const snapshotFileV1Schema: z.ZodObject<{
    audit: z.ZodObject<{
        serverName: z.ZodString;
        serverIp: z.ZodString;
        platform: z.ZodEnum<{
            coolify: "coolify";
            dokploy: "dokploy";
            bare: "bare";
        }>;
        timestamp: z.ZodString;
        overallScore: z.ZodNumber;
        categories: z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            checks: z.ZodArray<z.ZodObject<{
                id: z.ZodString;
                category: z.ZodString;
                name: z.ZodString;
                severity: z.ZodEnum<{
                    critical: "critical";
                    warning: "warning";
                    info: "info";
                }>;
                passed: z.ZodBoolean;
                currentValue: z.ZodString;
                expectedValue: z.ZodString;
                fixCommand: z.ZodOptional<z.ZodString>;
                explain: z.ZodOptional<z.ZodString>;
                complianceRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
                    framework: z.ZodString;
                    controlId: z.ZodString;
                    version: z.ZodString;
                    description: z.ZodString;
                    coverage: z.ZodEnum<{
                        full: "full";
                        partial: "partial";
                    }>;
                    level: z.ZodOptional<z.ZodEnum<{
                        L1: "L1";
                        L2: "L2";
                    }>>;
                }, z.core.$strip>>>;
                tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
                vpsIrrelevant: z.ZodOptional<z.ZodBoolean>;
            }, z.core.$strip>>;
            score: z.ZodNumber;
            maxScore: z.ZodNumber;
            connectionError: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>;
        quickWins: z.ZodArray<z.ZodObject<{
            commands: z.ZodArray<z.ZodString>;
            currentScore: z.ZodNumber;
            projectedScore: z.ZodNumber;
            description: z.ZodString;
        }, z.core.$strip>>;
        skippedCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
        vpsType: z.ZodOptional<z.ZodString>;
        vpsAdjustedCount: z.ZodOptional<z.ZodNumber>;
        warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
    }, z.core.$strip>;
    name: z.ZodOptional<z.ZodString>;
    savedAt: z.ZodString;
    schemaVersion: z.ZodLiteral<1>;
}, z.core.$strip>;
/** Schema v2 — includes auditVersion in audit object */
export declare const snapshotFileV2Schema: z.ZodObject<{
    audit: z.ZodObject<{
        serverName: z.ZodString;
        serverIp: z.ZodString;
        platform: z.ZodEnum<{
            coolify: "coolify";
            dokploy: "dokploy";
            bare: "bare";
        }>;
        timestamp: z.ZodString;
        overallScore: z.ZodNumber;
        categories: z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            checks: z.ZodArray<z.ZodObject<{
                id: z.ZodString;
                category: z.ZodString;
                name: z.ZodString;
                severity: z.ZodEnum<{
                    critical: "critical";
                    warning: "warning";
                    info: "info";
                }>;
                passed: z.ZodBoolean;
                currentValue: z.ZodString;
                expectedValue: z.ZodString;
                fixCommand: z.ZodOptional<z.ZodString>;
                explain: z.ZodOptional<z.ZodString>;
                complianceRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{
                    framework: z.ZodString;
                    controlId: z.ZodString;
                    version: z.ZodString;
                    description: z.ZodString;
                    coverage: z.ZodEnum<{
                        full: "full";
                        partial: "partial";
                    }>;
                    level: z.ZodOptional<z.ZodEnum<{
                        L1: "L1";
                        L2: "L2";
                    }>>;
                }, z.core.$strip>>>;
                tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
                vpsIrrelevant: z.ZodOptional<z.ZodBoolean>;
            }, z.core.$strip>>;
            score: z.ZodNumber;
            maxScore: z.ZodNumber;
            connectionError: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>;
        quickWins: z.ZodArray<z.ZodObject<{
            commands: z.ZodArray<z.ZodString>;
            currentScore: z.ZodNumber;
            projectedScore: z.ZodNumber;
            description: z.ZodString;
        }, z.core.$strip>>;
        skippedCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
        vpsType: z.ZodOptional<z.ZodString>;
        vpsAdjustedCount: z.ZodOptional<z.ZodNumber>;
        warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
        auditVersion: z.ZodString;
    }, z.core.$strip>;
    name: z.ZodOptional<z.ZodString>;
    savedAt: z.ZodString;
    schemaVersion: z.ZodLiteral<2>;
}, z.core.$strip>;
/**
 * Save an audit result as a snapshot.
 * Uses withFileLock + atomic write (tmp + rename) for safety.
 * Directory created with mode 0o700 if it doesn't exist.
 */
export declare function saveSnapshot(result: AuditResult, name?: string): Promise<void>;
/**
 * Load and validate a snapshot file.
 * Supports schema v2 (native) and v1 (auto-migrated to v2).
 * Returns null for missing files, corrupt JSON, or unknown schema versions.
 */
export declare function loadSnapshot(serverIp: string, filename: string): Promise<SnapshotFile | null>;
/**
 * List all snapshots for a server IP, sorted chronologically (oldest first).
 * Handles corrupt files gracefully by marking them with corrupt: true.
 * Supports both v1 (migrated) and v2 snapshot formats.
 * Returns empty array if no snapshots directory exists.
 */
export declare function listSnapshots(serverIp: string): Promise<SnapshotListEntry[]>;
//# sourceMappingURL=snapshot.d.ts.map