import type { WorkspaceBackend, WorkspaceReservation, ManifestWriteResult } from "./workspace_sync.js"; /** The durable directory for one scope, under the runner's persist root. */ export declare function localScopeDir(persistRoot: string, workflowId: string, environmentId: string | null, workspaceKey: string | null): string; export declare class LocalWorkspaceBackend implements WorkspaceBackend { private readonly scopeDir; private readonly manifestPath; private readonly packsDir; private readonly lockPath; constructor(scopeDir: string); /** The customer's own disk, so there is no ceiling of ours to enforce and nothing to meter. A local * run is fully eligible — that is I3: only the store changes. */ reserve(): Promise; readManifest(): Promise<{ bytes: Uint8Array | null; generation: string | null; }>; /** * Compare-and-swap the manifest. * * The generation is the file's (mtime, size). Two runs of one workflow can share a scope on a single * daemon, so the read-modify-write really can interleave, and a plain overwrite would silently drop * one run's merge. The check and the rename happen under an exclusive lock file, so there is no * window between them — the lock is held for microseconds, never across the pack uploads. */ writeManifest(bytes: Uint8Array, expected: string | null): Promise; existingPacks(digests: readonly string[]): Promise>; /** Written by temp + rename, so a crash can never leave a short pack under a digest that promises * its full contents. A concurrent writer producing the same digest writes identical bytes, so the * rename racing itself is harmless. */ writePack(digest: string, bytes: Uint8Array): Promise; readPack(digest: string): Promise; deletePacks(digests: readonly string[]): Promise; private packPath; /** `(mtimeMs, size)` of the manifest, or null when there is none. Cheap, and enough to detect that * someone else wrote — the lock is what makes it safe to act on. */ private generation; /** Exclusive-create lock. Returns the release function. A stale lock (a crashed holder) times out * into a conflict rather than blocking the run forever — losing one persist is recoverable, hanging * a run is not. */ private lock; }