Materialize a full lazy archive group: fetch the zip once, parse its central directory, and write every non-deleted entry into its stub. Subsequent calls are no-ops.
Async-materialize a lazy file or archive-backed file if the given path resolves to one. Call this before any synchronous read (e.g. in handleExec) to avoid sync XHR which deadlocks with COOP/COEP. Returns true if something was materialized, false if already concrete.
Export all lazy archive groups for transfer to another instance.
Export all pending lazy entries for transfer to another instance.
Return a copy of image-level metadata, or null if the image did not declare any.
Return lazy metadata for path, following symlinks through stat().
Import lazy archive groups from another instance. Assumes stubs already exist.
Import lazy file entries from another instance (e.g., main thread → worker). Does not create files — assumes the files already exist in the SharedArrayBuffer.
Register a lazy archive group: creates stubs in SharedFS for every file entry and records metadata so that accessing any one of them triggers a single archive fetch that materializes all files in the group.
Parse the zip's central directory (via host/src/vfs/zip.ts) and pass the
resulting ZipEntry[] in zipEntries. mountPrefix maps the zip's
internal paths into the VFS (e.g. prefix "/usr/" turns "bin/vim" into
"/usr/bin/vim").
OptionalsymlinkTargets: Map<string, string>Register a lazy file: creates an empty stub in SharedFS and records metadata so that read() will fetch content on demand via sync XHR. Returns the inode number (useful for forwarding to other instances).
Rewrite the URL of every registered lazy archive group. Useful when the VFS image was built with relative URLs (e.g. "vim.zip") and the runtime needs to resolve them against a deployment base URL.
Rewrite the URL of every registered lazy file. Useful when a VFS image was built with placeholder URLs and the browser runtime needs to replace them with bundler-produced asset URLs.
Save the current filesystem state as a portable binary image.
With materializeAll: true, all lazy files are fetched and written
into the filesystem before saving, producing a self-contained image.
Otherwise, lazy file metadata (path/URL/size) is preserved in the
image and restored on load.
Optionaloptions: VfsImageOptionsSet or clear image-level metadata for the next saveImage() call.
StaticassertValidate an image's optional kernel ABI declaration. Images without a
kernelAbi declaration are accepted so legacy/data-only images keep
loading; callers that require an explicit declaration should check
readImageMetadata(image)?.kernelAbi first.
StaticcreateOptionalmaxSizeBytes: numberStaticfromStaticfromRestore a MemoryFileSystem from a previously saved VFS image. Allocates a new SharedArrayBuffer and populates it from the image.
When maxByteLength is specified, creates a growable SharedArrayBuffer
so the filesystem can expand beyond the image's original size, up to the
maximum already recorded in the image superblock.
Optionaloptions: { maxByteLength?: number }StaticreadRead image-level metadata without materializing the filesystem SAB.
Return the underlying SharedArrayBuffer (for sharing with workers).