import type { WorkspaceFs } from "@vendoai/core"; /** * Does a machine's whole-tree walk carry this path home? `/host` is the * deployment's own files, projected per turn, so it never comes back. * * A SHAPE, and deliberately not a permission — it is the only question a walk of * a real disk can answer, because a disk has no store to ask. Both machines ask * it: `claude-code/local.ts` here, and the box door's own copy in * `packages/harnesses/box/turn-routes.mjs`. Whether a carried path may LAND is * `canCommit`'s, per file, against live rows. */ export declare const inWritableMount: (path: string) => boolean; /** SHA-256 of the bytes — the §3.5 diff key. */ export declare function contentHash(bytes: Uint8Array): string; /** * One file as the box receives it. * * `readOnly` is PER FILE, not per mount (§3.5 over §9.7): `/host` is read-only * for everyone, and inside an org mount a file the caller holds only viewer on * lands read-only beside an editable one. That is what stops the model doing * work the sync-back would have to throw away — it meets the refusal when it * reaches for the file, not after it has rewritten it. */ export interface CheckoutFile { path: string; bytes: Uint8Array; readOnly: boolean; } /** One file as the box hands it back. */ export interface SyncFile { path: string; bytes: Uint8Array; } /** * What a machine's disk is KNOWN to hold — the baseline every sync-back diffs * against, persisted for the life of one conversation. * * It exists because a warm box is not re-materialized between turns (that is * what makes turn 2 free), so its tree dates from conversation start. Diffing * turn-end contents against a FRESH store read instead would compare the box's * copy to a store someone else may have moved underneath it: a file changed * out-of-band (another thread of the same user, an app tool, an automation) * hash-mismatches the box's stale copy and gets written BACK, destroying the * newer state; an out-of-band delete gets resurrected. Measured, then pinned. * * With this baseline, "unchanged in the box" means SKIP — the store keeps * whatever it has — and only what the box actually changed is written. */ export interface TreeState { /** Syncable path → content hash the machine's disk holds. */ hashes: Map; /** Checked-out paths the box walk cannot carry back — see WALK_SKIP_BYTES. */ oversized: Set; } export declare const emptyTree: () => TreeState; export interface WorkspaceCheckout { /** Every file this caller may see, filtered at checkout — the box is born * filtered, because there are no checks inside it (design §8). */ readonly files: readonly CheckoutFile[]; /** The baseline this checkout is diffing against, so the caller can persist it * alongside the machine that now holds that tree. */ readonly tree: TreeState; /** * Mid-turn sync of the hot paths only. Never deletes: a mid-turn view of the * box's disk is a snapshot of work in progress, not a statement about what the * user still owns. */ syncHot(files: readonly SyncFile[]): Promise; /** * Turn-end sync. Every changed writable path lands, and a file that was in the * checkout and is absent now is deleted — `rm` in the box is a real edit. */ syncAll(files: readonly SyncFile[]): Promise; } export declare function checkoutWorkspace(workspace: WorkspaceFs, /** The machine's persisted baseline, filled in place when `reseed`. */ tree?: TreeState, /** * True when the machine's disk is about to be materialized FROM this checkout, * so the baseline is derived here — after materialize the box holds exactly * what the store just handed it. * * False for a WARM machine, whose tree already IS the truth about its disk. The * store is then deliberately not consulted for the baseline: it may have moved * underneath the box, and the box's stale copy must never be written back over * the newer state. That is the whole stale-clobber fix. */ reseed?: boolean, /** * Which paths `syncHot` may land — the hot-path vocabulary, injected because * this package no longer imports `@vendoai/apps` (composition hands the driver * `hotPathAppId`; see `HotPathsPort`). Omitted, `syncHot` lands nothing, which * is exactly the bare-runtime deployment where nobody watches hot paths. */ isHot?: (path: string) => boolean): Promise; //# sourceMappingURL=materialize.d.ts.map