/**
 * Immutable preview artifacts.
 *
 * A live preview mount (`state/preview/<sessionId>/`) is mutable: every
 * `preview_open` refresh rewrites it. This module captures the exact mounted
 * bytes after a successful mount into `state/preview-artifacts/<sessionId>/`
 * so historical preview cards can restore their original bytes without
 * re-reading the source file path.
 */
import * as previewMount from "./mount.js";
export interface PreviewArtifactRecord {
    artifactId: string;
    sessionId: string;
    entry: string;
    contentHash: string;
    createdAt: number;
    mtime: number;
    files: string[];
}
export interface PreviewArtifactMountResult extends previewMount.MountResult {
    artifactId: string;
}
export declare class PreviewArtifactError extends Error {
    statusCode: number;
    constructor(statusCode: number, message: string);
}
export declare function setPreviewArtifactRootForTesting(dir: string | undefined): void;
export declare function artifactSessionDir(sessionId: string): string;
export declare function artifactDir(sessionId: string, artifactId: string): string;
export declare function artifactMountDir(sessionId: string, artifactId: string): string;
/**
 * Capture the exact current live preview mount as an immutable artifact.
 * Reuses an existing artifact when the same session already captured the same
 * contentHash.
 */
export declare function persistPreviewArtifact(sessionId: string, mountResult: previewMount.MountResult): PreviewArtifactRecord;
/** Read and validate one artifact record. */
export declare function readPreviewArtifact(sessionId: string, artifactId: string): PreviewArtifactRecord;
/**
 * Restore an immutable artifact into the single live preview mount.
 * Validation and staging happen before the live mount is touched, so missing,
 * wrong-session, and corrupt artifacts cannot alias to current content.
 */
export declare function restorePreviewArtifact(sessionId: string, artifactId: string): PreviewArtifactMountResult;
/** Delete all artifacts for a session. Idempotent. */
export declare function removeArtifacts(sessionId: string): void;
/**
 * Explicit maintenance helper: remove artifact directories whose session id is
 * absent from the caller-provided live+archived session set.
 */
export declare function sweepOrphanArtifacts(knownSessionIds: Iterable<string>): {
    removed: string[];
    kept: string[];
};
export declare function findPreviewArtifactByHash(sessionId: string, contentHash: string): PreviewArtifactRecord | null;
//# sourceMappingURL=artifacts.d.ts.map