/**
 * Per-session preview mount lifecycle.
 *
 * Single source of truth for `<bobbitStateDir>/preview/<sid>/`. Owned by
 * the gateway: agent extension POSTs HTML / file paths to a mount endpoint
 * (WP-D), the route handler calls `writeInline` / `mountFile` here, and
 * the content-origin route (WP-B) serves files back out of `mountDir(sid)`.
 *
 * Asset inclusion contract (post opt-in):
 *   - `writeInline(sid, html, entry?)` writes only the entry — no siblings.
 *   - `mountFile(sid, srcFile, assets?)` copies only `srcFile` plus the
 *     declared assets (literals or single-segment globs). Sibling files in
 *     the source dir that are NOT declared are NOT copied. There is no
 *     BFS-of-everything fallback. See docs/preview-architecture.md.
 *
 * Public API:
 *   mountDir(sid)                               → host directory
 *   writeInline(sid, html, entry?)              → write inline.html (or chosen entry)
 *   mountFile(sid, srcFile, assets?)            → copy entry + declared assets
 *   removeMount(sid)                            → recursive delete (idempotent)
 *   watchMount(sid, onChange)                   → debounced fs watch + unsubscribe
 *
 * All errors are `PreviewMountError` with a `statusCode` so the route handler
 * can map directly to HTTP. Codes: 400 / 403 / 404 / 500.
 */
/**
 * @deprecated The 100 MiB mount ceiling was removed when asset inclusion
 * became explicit (agents declare what to copy via `assets[]`/`manifest`).
 * Kept as a re-export for backwards compatibility with imports that exist
 * elsewhere in-tree; the value is no longer enforced.
 */
export declare const MAX_MOUNT_BYTES: number;
/** Default entry filename when only inline HTML is supplied. */
export declare const DEFAULT_INLINE_ENTRY = "inline.html";
export interface MountResult {
    /** Public content-origin URL the renderer should open. */
    url: string;
    /** Host-absolute path to the entry file (debug parity with v2 markers). */
    path: string;
    /**
     * Project-root-relative entry identifier — always `<sessionId>/<entry>`
     * with forward slashes (POSIX) regardless of host OS. Host-invariant, so
     * its size is bounded by content shape, not where `bobbitStateDir()`
     * happens to live on disk. Stamped into the v3 preview-snapshot block by
     * the agent tool so the per-block size stays under the 250 B cap on
     * macOS (`/private/var/folders/...`) and Windows E2E harness paths too.
     * See `defaults/tools/html/extension.ts` and `defaults/tools/html/snapshot.ts`.
     */
    relPath: string;
    /** Relative entry filename inside the mount. */
    entry: string;
    /** mtime of the entry file in ms since epoch. */
    mtime: number;
    /** Stable SHA-256 identity for the mounted preview tree. */
    contentHash: string;
}
/** Extension of MountResult returned by `mountFile`: echoes resolved assets. */
export interface MountFileResult extends MountResult {
    /** Asset paths actually copied, relative to the entry file's directory.
     *  Useful for the route handler / renderer to round-trip. */
    assets: string[];
}
/** Typed error so the route handler can map directly to HTTP. */
export declare class PreviewMountError extends Error {
    statusCode: number;
    constructor(statusCode: number, message: string);
}
export declare function setPreviewRootForTesting(dir: string | undefined): void;
/**
 * Path to the per-session mount directory WITHOUT creating it as a side
 * effect. Use this when you need to check `fs.existsSync(mountPath(sid))`
 * (e.g. to decide whether a live mount exists before staging a restore).
 * Differs from `mountDir(sid)` which calls `fs.mkdirSync(dir, { recursive: true })`.
 */
export declare function mountPath(sessionId: string): string;
export declare function mountDir(sessionId: string): string;
export declare function writeInline(sessionId: string, html: string, entry?: string): MountResult;
/**
 * Mount the entry HTML file plus a caller-declared list of assets.
 *
 * Behaviour:
 *   - Stages the entry + resolved assets into a sibling tmp directory first,
 *     reading ALL source data before touching `destRoot`. This is what makes
 *     re-opening a path that lives inside the existing mount safe (Bug 4):
 *     sources are captured before the wipe runs.
 *   - Then wipes `destRoot`'s contents (preserving its inode so any active
 *     `watchMount()` handle stays valid) and renames each staged entry into
 *     place.
 *   - Copies only `srcFile` plus the resolved `assets` (literals + globs).
 *   - Globs may use `*` and `?` in a single path segment; `**`/`[...]`/`{a,b}`
 *     are rejected.
 *   - Symlink escape: any resolved asset whose realpath is not contained in
 *     the entry's source dir is rejected with 403.
 *   - Unmatched literal asset → 404.
 *   - On any staging error, the tmp dir is deleted and `destRoot` is left
 *     untouched (previous mount preserved).
 *
 * No size cap — the agent is responsible for declaring only what it needs.
 */
export declare function mountFile(sessionId: string, srcFile: string, assets?: string[]): MountFileResult;
export declare function contentHashForMount(sessionId: string): string;
export declare function removeMount(sessionId: string): void;
export declare function watchMount(sessionId: string, onChange: () => void): () => void;
//# sourceMappingURL=mount.d.ts.map