import { z } from 'zod';
import { type InferProvider } from './capability-definition.js';
/**
 * Per-destination metadata returned by `backup-destination.listDestinations`.
 * Defined here (not in `backup-destination.cap.ts`) because both caps need
 * it and `backup` is the foundation — the destination cap imports from us.
 */
/**
 * Provider-side destination metadata. The addon returns a SHORT id
 * (`subId`) — orchestrator-internal-only routing prepends the addon's
 * manifest id to produce the externally-visible globally-unique id.
 *
 * Why split: the addon shouldn't have to know its own manifest id.
 * That id is owned by `package.json` and the kernel's registry; making
 * the addon repeat it leaks framework state into addon code and
 * breaks if the manifest is ever renamed.
 */
declare const BackupSubDestinationInfoSchema: z.ZodObject<{
    subId: z.ZodString;
    displayName: z.ZodString;
    description: z.ZodOptional<z.ZodString>;
    kind: z.ZodString;
    triggerSupported: z.ZodBoolean;
    restoreSupported: z.ZodBoolean;
}, z.core.$strip>;
/**
 * Orchestrator-side destination metadata. The orchestrator computes
 * `id = <addonId>:<subId>` from its provider lookup so consumers
 * (admin UI, restore flow) see one canonical key.
 *
 * Phase 4 (admin UI redesign) adds the per-destination policy fields
 * (`enabled`, `retentionCount`, `label`) so the destinations table can
 * render the joined view without a follow-up round-trip. The backend
 * already joins these in `listDestinations` — we now surface them on
 * the wire.
 *
 * `lastSuccessAt` / `lastSuccessSizeBytes` are computed from each
 * location's `manifests.json` (newest archive). Optional — locations
 * with no archives yet leave them undefined.
 */
declare const BackupDestinationInfoSchema: z.ZodObject<{
    subId: z.ZodString;
    displayName: z.ZodString;
    description: z.ZodOptional<z.ZodString>;
    kind: z.ZodString;
    triggerSupported: z.ZodBoolean;
    restoreSupported: z.ZodBoolean;
    id: z.ZodString;
    addonId: z.ZodString;
    enabled: z.ZodBoolean;
    retentionCount: z.ZodNumber;
    label: z.ZodOptional<z.ZodString>;
    lastSuccessAt: z.ZodOptional<z.ZodNumber>;
    lastSuccessSizeBytes: z.ZodOptional<z.ZodNumber>;
    cron: z.ZodOptional<z.ZodString>;
    nextRunAt: z.ZodOptional<z.ZodNumber>;
    lastRunAt: z.ZodOptional<z.ZodNumber>;
}, z.core.$strip>;
/**
 * Per-archive entry returned by `backup.listArchives({ destinationId })`.
 * Same shape the destination drill-in renders. Sourced from the per-
 * location `manifests.json` (no per-archive tarball read required).
 */
declare const BackupArchiveEntrySchema: z.ZodObject<{
    id: z.ZodString;
    filename: z.ZodString;
    createdAt: z.ZodNumber;
    sizeBytes: z.ZodNumber;
    label: z.ZodOptional<z.ZodString>;
    locations: z.ZodReadonly<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
declare const BackupEntrySchema: z.ZodObject<{
    id: z.ZodString;
    destinationId: z.ZodOptional<z.ZodString>;
    label: z.ZodOptional<z.ZodString>;
    createdAt: z.ZodNumber;
    sizeBytes: z.ZodNumber;
    locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
}, z.core.$strip>;
declare const ArchiveEntrySchema: z.ZodObject<{
    path: z.ZodString;
    kind: z.ZodEnum<{
        file: "file";
        dir: "dir";
        symlink: "symlink";
    }>;
    sizeBytes: z.ZodNumber;
    mtime: z.ZodNumber;
}, z.core.$strip>;
declare const ArchiveManifestSchema: z.ZodObject<{
    archiveVersion: z.ZodLiteral<1>;
    createdAt: z.ZodNumber;
    dataDir: z.ZodString;
    locations: z.ZodArray<z.ZodString>;
    entries: z.ZodArray<z.ZodObject<{
        path: z.ZodString;
        kind: z.ZodEnum<{
            file: "file";
            dir: "dir";
            symlink: "symlink";
        }>;
        sizeBytes: z.ZodNumber;
        mtime: z.ZodNumber;
    }, z.core.$strip>>;
    totalBytes: z.ZodNumber;
    totalFiles: z.ZodNumber;
}, z.core.$strip>;
declare const LocationStatSchema: z.ZodObject<{
    name: z.ZodString;
    sizeBytes: z.ZodNumber;
    fileCount: z.ZodNumber;
    present: z.ZodBoolean;
}, z.core.$strip>;
/**
 * backup — singleton capability for backup management.
 *
 * Implemented by `local-backup` addon. Future providers (S3, rsync)
 * can replace it by registering the same capability.
 */
export declare const backupCapability: {
    readonly name: "backup";
    readonly scope: "system";
    readonly mode: "singleton";
    readonly methods: {
        /**
         * Flat aggregate of every destination across every registered
         * `backup-destination` provider. This is the orchestrator-side
         * surface; it expands per-addon `listDestinations()` results into
         * one list the UI can render directly.
         */
        readonly listDestinations: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            subId: z.ZodString;
            displayName: z.ZodString;
            description: z.ZodOptional<z.ZodString>;
            kind: z.ZodString;
            triggerSupported: z.ZodBoolean;
            restoreSupported: z.ZodBoolean;
            id: z.ZodString;
            addonId: z.ZodString;
            enabled: z.ZodBoolean;
            retentionCount: z.ZodNumber;
            label: z.ZodOptional<z.ZodString>;
            lastSuccessAt: z.ZodOptional<z.ZodNumber>;
            lastSuccessSizeBytes: z.ZodOptional<z.ZodNumber>;
            cron: z.ZodOptional<z.ZodString>;
            nextRunAt: z.ZodOptional<z.ZodNumber>;
            lastRunAt: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Trigger a backup. Without `destinations` the orchestrator fans
         * out to every destination flagged as enabled in the routing
         * config; with it, only the listed addons receive the archive.
         */
        readonly trigger: import("./capability-definition.js").CapabilityMethodSchema<z.ZodOptional<z.ZodObject<{
            destinations: z.ZodOptional<z.ZodArray<z.ZodString>>;
            locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
            label: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            destinationId: z.ZodOptional<z.ZodString>;
            label: z.ZodOptional<z.ZodString>;
            createdAt: z.ZodNumber;
            sizeBytes: z.ZodNumber;
            locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>>>, "mutation">;
        /** Union of every destination's archives, each tagged with `destinationId`. */
        readonly list: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            destinationId: z.ZodOptional<z.ZodString>;
            label: z.ZodOptional<z.ZodString>;
            createdAt: z.ZodNumber;
            sizeBytes: z.ZodNumber;
            locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Pre-backup snapshot of the well-known locations on disk — sizes
         * + file counts. Powers the opt-in checklist that lets the
         * operator pick which subsections of state get archived.
         */
        readonly listLocations: import("./capability-definition.js").CapabilityMethodSchema<z.ZodVoid, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            name: z.ZodString;
            sizeBytes: z.ZodNumber;
            fileCount: z.ZodNumber;
            present: z.ZodBoolean;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Read the embedded `.camstack-backup-manifest.json` from a
         * previously-created archive. The manifest carries the full
         * file/dir listing with sizes + mtimes — the readdir snapshot
         * the UI shows in the "Contents" panel. Returns `null` when the
         * archive predates manifests (created before this feature
         * shipped).
         */
        readonly getEntries: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            destinationId: z.ZodString;
            backupId: z.ZodString;
        }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
            archiveVersion: z.ZodLiteral<1>;
            createdAt: z.ZodNumber;
            dataDir: z.ZodString;
            locations: z.ZodArray<z.ZodString>;
            entries: z.ZodArray<z.ZodObject<{
                path: z.ZodString;
                kind: z.ZodEnum<{
                    file: "file";
                    dir: "dir";
                    symlink: "symlink";
                }>;
                sizeBytes: z.ZodNumber;
                mtime: z.ZodNumber;
            }, z.core.$strip>>;
            totalBytes: z.ZodNumber;
            totalFiles: z.ZodNumber;
        }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
        readonly restore: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            destinationId: z.ZodString;
            backupId: z.ZodString;
            locations: z.ZodOptional<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
        readonly delete: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            destinationId: z.ZodString;
            backupId: z.ZodString;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
        /**
         * List archives at a single destination. Reads the per-location
         * `manifests.json` and returns one entry per archive (newest
         * first). Powers the destinations-table drill-in in admin UI.
         */
        readonly listArchives: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            destinationId: z.ZodString;
        }, z.core.$strip>, z.ZodReadonly<z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            filename: z.ZodString;
            createdAt: z.ZodNumber;
            sizeBytes: z.ZodNumber;
            label: z.ZodOptional<z.ZodString>;
            locations: z.ZodReadonly<z.ZodArray<z.ZodString>>;
        }, z.core.$strip>>>, import("./capability-definition.js").CapabilityMethodKind>;
        /**
         * Upsert a per-destination policy row. The `locationId` MUST be
         * the id of an existing `backups`-typed `StorageLocation`. Used
         * by the admin-UI destinations table (enable toggle + retention
         * input + optional label).
         */
        readonly upsertDestinationPolicy: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            locationId: z.ZodString;
            enabled: z.ZodBoolean;
            retentionCount: z.ZodNumber;
            label: z.ZodOptional<z.ZodString>;
            cron: z.ZodOptional<z.ZodString>;
        }, z.core.$strip>, z.ZodVoid, "mutation">;
        /**
         * Validate a cron expression and peek the next N firing times.
         * Used by the admin-UI CronEditor to render a live "next-run"
         * preview as the operator edits the pattern.
         */
        readonly previewSchedule: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
            cron: z.ZodString;
            count: z.ZodOptional<z.ZodNumber>;
        }, z.core.$strip>, z.ZodObject<{
            ok: z.ZodBoolean;
            error: z.ZodOptional<z.ZodString>;
            nextRuns: z.ZodReadonly<z.ZodArray<z.ZodNumber>>;
        }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
    };
};
export type IBackupProvider = InferProvider<typeof backupCapability>;
export { BackupEntrySchema, BackupSubDestinationInfoSchema, BackupDestinationInfoSchema, BackupArchiveEntrySchema, ArchiveEntrySchema, ArchiveManifestSchema, LocationStatSchema, };
//# sourceMappingURL=backup.cap.d.ts.map