Documentation Index
Fetch the complete documentation index at: https://docs.mesa.dev/llms.txt
Use this file to discover all available pages before exploring further.
mesa.fs.mount(...) returns a MesaFileSystem backed by Mesa’s native filesystem implementation.
mount() resolves repository IDs, mints a scoped API key for the mounted repos, and connects to the VCS backend. The SDK attempts to revoke mounted keys on process shutdown and garbage collection.
Options
Repositories to mount. The array must be non-empty.
Access mode. Defaults to
rw. Read-only mounts mint a read scoped key and reject write operations with read-only filesystem behavior.Optional on-disk cache. When omitted, the mount uses in-memory caching only.
Minimum native log level. Defaults to
warn.Per-instance structured log callback from the native filesystem.
RepoConfig
Pin a repository to a bookmark or change at mount time.Repository name.
Bookmark to check out. Mutually exclusive with
changeId.Change ID to check out. Mutually exclusive with
bookmark.Disk cache
Directory for the on-disk cache.
Optional cache size cap. When omitted, the native extension auto-sizes the budget against system resources.
Paths
Mounted filesystem paths include the organization and repository name:Response
Returns aPromise<MesaFileSystem>.
MesaFileSystem
The returnedfs object implements the just-bash filesystem interface and exposes async file I/O, metadata, traversal, mutation, Bash, and mounted-repo version-control helpers.
Byte and text I/O
Read a file as text using a Node-compatible encoding. The
binary encoding follows the just-bash latin1 byte-string convention.Read raw file bytes.
Replace file contents, creating the file if missing. Parent directories must already exist.
Append text or bytes to a file, creating it if missing.
Return whether a path exists. Follows symlinks.
Metadata and traversal
Return metadata for a path, following symlinks.
mtime is a JavaScript Date.Return metadata for a path without following symlinks.
mtime is a JavaScript Date.Return entry names in a directory. Sort client-side if you need deterministic ordering.
readdirWithFileTypes(path)
Promise<Array<{ name: string; isFile: boolean; isDirectory: boolean; isSymbolicLink: boolean }>>
Return entry names with file type flags.
Resolve symlinks and
.. segments to a canonical path.Return the target of a symlink.
Join and normalize a path against a base path without touching the filesystem.
Return a synchronous snapshot of paths known to the filesystem.
Mutations
Create a directory. With
{ recursive: true }, create missing parents and do nothing when the path already exists as a directory.Remove a file or directory. Use
{ recursive: true } for non-empty directories and { force: true } to ignore missing paths.Copy a file or directory. Use
{ recursive: true } for directories.Move or rename a file or directory.
Set permission bits, such as
0o755.Create a symlink. Relative targets are stored verbatim and resolve against the parent of
linkPath at read time.Set access and modification times with JavaScript
Date values.Create a hard link if supported by the native filesystem implementation.
FsStat
stat(...) and lstat(...) return FsStat.
Whether the path is a regular file.
Whether the path is a directory.
Whether the path is a symlink. This is
false from stat(...) when the target exists because stat follows symlinks.POSIX mode bits.
Size in bytes.
Modification time.
Related filesystem methods
| Method namespace | Reference |
|---|---|
fs.bash(...) | fs.bash() |
fs.change | fs.change |
fs.bookmark | fs.bookmark |
Errors
ThrowsInvalidOptionsError for an empty repo list. API key minting, repo lookup, or VCS connection failures can throw API errors or connection errors.
