import { type BackupStreamState, type PersistentConsumerCheckpoint, type SpaceBackupSelection } from "@cotal-ai/core"; import { type MaintenanceAuthMode, type StoreIdentity } from "@cotal-ai/workspace"; import type { AuthorityFingerprint } from "./maintenance-files.js"; export declare const BACKUP_MANIFEST_FORMAT: "cotal-space-backup/v1"; export interface BackupFileRecord { path: string; size: number; sha256: string; kind: "snapshot" | "checkpoints"; stream?: string; } export interface BackupStreamRecord { stream: string; snapshot: string; config: Record; state: BackupStreamState; } export interface BackupManifest { format: typeof BACKUP_MANIFEST_FORMAT; createdAt: string; space: string; selection: SpaceBackupSelection; mode: MaintenanceAuthMode; source: StoreIdentity; authority?: AuthorityFingerprint; streams: BackupStreamRecord[]; checkpoints: string; files: BackupFileRecord[]; } export interface ArtifactWriter { directory: string; identity: { dev: bigint; ino: bigint; }; writeFile(name: string, kind: BackupFileRecord["kind"], source: AsyncIterable | Uint8Array | string, stream?: string): Promise; publish(manifest: Omit, files: BackupFileRecord[]): BackupManifest; cleanup(): void; } /** One artifact file that is missing, undeclared, or not the declared size and SHA-256. `file` is null * for an undeclared name that is not a valid artifact file name, so it is never printed. */ export declare class ArtifactFileFault extends Error { readonly file: string | null; readonly fault: "missing" | "undeclared" | "mismatch"; constructor(file: string | null, fault: "missing" | "undeclared" | "mismatch"); } export declare function createArtifactWriter(destination: string): ArtifactWriter; /** Whether an artifact restores only into a root that still holds the trust state it was taken * under: a full artifact of an authenticated space commits to that root's trust chain, so it cannot * move to another machine or a fresh root. */ export declare function isTrustBound(selection: string, mode: string): boolean; /** The receipt line for a trust-bound artifact. */ export declare const TRUST_BOUND_TEXT = "only a root that still holds the trust state it was taken under, not another machine or a fresh root"; /** Inspect manifest bytes, or hash every named file, without staging, starting a broker or restoring. */ export declare function inspectBackupArtifact(artifactPath: string, verify: boolean): { kind: "backup-integrity" | "backup-inspection"; directory: string; format: "cotal-space-backup/v1"; createdAt: string; space: string; selection: SpaceBackupSelection; mode: MaintenanceAuthMode; sourcePath: string; sourceGeneration: string; authorityRecorded: boolean; authorityValidated: boolean; trustBound: boolean; integrity: "not-checked" | "matched-declared-sizes-and-sha256"; manifestSha256: string; fileCount: number; bytesDeclared: string; files: { path: string; kind: "snapshot" | "checkpoints"; stream: string | null; size: number; sha256: string; }[]; streams: { stream: string; snapshot: string; }[]; brokerStarted: boolean; staged: boolean; restored: boolean; restorationProven: boolean; }; export interface StagedArtifact { manifest: BackupManifest; directory: string; cleanup(): void; } /** Validate exact names and pin verified bytes into a private attempt directory before any mutation. */ export declare function stageArtifact(artifactPath: string, parent: string): StagedArtifact; export declare function readStagedCheckpoints(staged: StagedArtifact): PersistentConsumerCheckpoint[]; export declare function snapshotFileName(stream: string): string; //# sourceMappingURL=backup-artifact.d.ts.map