Skip to content

ReadOnlyFileSystem

Capability wrapper that enforces read-only access at the filesystem boundary. This matters for mixed workspaces: prompt/tool policy alone cannot protect a knowledge mount when another mount intentionally accepts writes.

new ReadOnlyFileSystem(source): ReadOnlyFileSystem;
Parameter Type

source

FileSystem

ReadOnlyFileSystem

readonly readOnly: true = true;

readonly source: FileSystem;
appendFile(path, _content): Promise<void>;
Parameter Type

path

string

_content

string | Uint8Array<ArrayBufferLike>

Promise<void>

FileSystem.appendFile


cp(
_src,
dest,
_options?): Promise<void>;
Parameter Type

_src

string

dest

string

_options?

CpOptions

Promise<void>

FileSystem.cp


exists(path): Promise<boolean>;
Parameter Type

path

string

Promise<boolean>

FileSystem.exists


glob(pattern): Promise<string[]>;
Parameter Type

pattern

string

Promise<string[]>

FileSystem.glob


lstat(path): Promise<FsStat>;
Parameter Type

path

string

Promise<FsStat>

FileSystem.lstat


mkdir(path, _options?): Promise<void>;
Parameter Type

path

string

_options?

MkdirOptions

Promise<void>

FileSystem.mkdir


mv(_src, dest): Promise<void>;
Parameter Type

_src

string

dest

string

Promise<void>

FileSystem.mv


readdir(path): Promise<string[]>;
Parameter Type

path

string

Promise<string[]>

FileSystem.readdir


readdirWithFileTypes(path): Promise<FileSystemDirent[]>;
Parameter Type

path

string

Promise<FileSystemDirent[]>

FileSystem.readdirWithFileTypes


readFile(path): Promise<string>;
Parameter Type

path

string

Promise<string>

FileSystem.readFile


readFileBytes(path): Promise<Uint8Array<ArrayBufferLike>>;
Parameter Type

path

string

Promise<Uint8Array<ArrayBufferLike>>

FileSystem.readFileBytes


readlink(path): Promise<string>;
Parameter Type

path

string

Promise<string>

FileSystem.readlink


realpath(path): Promise<string>;
Parameter Type

path

string

Promise<string>

FileSystem.realpath


resolvePath(base, path): string;
Parameter Type

base

string

path

string

string

FileSystem.resolvePath


rm(path, _options?): Promise<void>;
Parameter Type

path

string

_options?

RmOptions

Promise<void>

FileSystem.rm


stat(path): Promise<FsStat>;
Parameter Type

path

string

Promise<FsStat>

FileSystem.stat


symlink(_target, linkPath): Promise<void>;
Parameter Type

_target

string

linkPath

string

Promise<void>

FileSystem.symlink


writeFile(path, _content): Promise<void>;
Parameter Type

path

string

_content

string

Promise<void>

FileSystem.writeFile


writeFileBytes(path, _content): Promise<void>;
Parameter Type

path

string

_content

Uint8Array

Promise<void>

FileSystem.writeFileBytes