import type { RuntimeVFS, VFSEntry } from '../../vfs.ts'; /** * Monty's mount view: the shared core, spelled the way the binding * needs it, plus a negative cache. * * Three things the core deliberately does not do live here. Every * failure is re-thrown under its python exception name, because the * binding turns `err.name` into the guest exception type and agent * code catches `FileNotFoundError`, not a bare Error. A path outside * every mount is *declined* rather than failed, so monty falls back to * its own in-memory tree; the core's `mountOf` answers null for both * "no mounts wired" and "not under one", which are different questions * here. And a path the mount already answered "not there" for is * remembered, because monty asks whether a path exists on nearly every * guest expression and each miss otherwise costs a fresh listing; * every mutation keeps the cache honest. * * Args: * core: the shared op vocabulary. */ export declare class MontyVFS { private readonly core; private readonly missing; constructor(core: RuntimeVFS); /** * Forget every remembered absence. * * The cache may only span one command. This object lives as long as * the runtime, but python builds its `MirageOSAccess` (and with it * the `_missing` set this mirrors) once per run, so a file a shell * command creates between two monty commands has to be visible to * the second one. Callers reset at the top of `run` and each `eval`. */ reset(): void; /** * True when `path` may be serviced by the mounts. An empty live view * means no scoping: every path routes to the workspace. */ serves(path: string): boolean; read(path: string): Promise; /** * The file's bytes, or null when the mount does not have it — the * shape python's `MontyVFS.read` answers, for callers that need * "missing" as a value (an append's base) rather than a raise. */ readOrNull(path: string): Promise; write(path: string, data: unknown): Promise; /** * Extend `path` by `tail`, shipping only the delta when the mount * takes one; `whole` is the running content for the write fallback * (S3 registers `write` without `append`). */ append(path: string, tail: Uint8Array, whole: Uint8Array): Promise; /** Establish an empty file, the open-time effect of 'w'/'a' on a missing path. */ create(path: string): Promise; /** Discard content, the open-time effect of 'w' on an existing path. */ truncate(path: string): Promise; mkdir(path: string, parents?: boolean): Promise; rmdir(path: string): Promise; unlink(path: string): Promise; /** * Rename within one mount, spelling a cross-mount pair as EXDEV. * * POSIX answers EXDEV for a rename across filesystems, which is also * what tells a caller to copy instead. Monty ships no `shutil`, so * its own code has to write that fallback by hand; the runtimes with * a real stdlib get it from `shutil.move`, which retries on exactly * this errno. * * Args: * src: the rename source. * dst: the rename destination. */ rename(src: string, dst: string): Promise; /** The directory's entries. Throws when it is not a directory. */ readdir(path: string): Promise; /** * Whether the mount's name plane holds a symlink at `path`. * * Read off the parent's listing, which the door already marks, so a * predicate the guest asks per path costs no dispatch of its own * beyond the one `entryFor` was going to make. A parent that will * not list answers False, the same as pathlib does for a path it * cannot reach. * * Args: * path: the path to test. */ isLink(path: string): Promise; /** The parent's entry for `path`, or null when the parent lacks one. */ entryFor(path: string): Promise; /** * Remember `path` as absent when `err` says it is, then hand the * error back for throwing. A transport failure is not an absence, * so only the three fs codes that mean "nothing here" are cached. * * Args: * path: the path the operation named. * err: the guest-shaped error the op failed with. */ private absent; private mutate; } //# sourceMappingURL=vfs.d.ts.map