Class: MountedCompositeFilesystem
Composite mount namespace whose virtual root has no repository-level
.gitignore. Mastra’s list tool probes that relative file before walking;
an empty result keeps native ignore handling enabled without routing the
virtual-root lookup into an unrelated mount.
Extends
Section titled “Extends”CompositeFilesystem
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MountedCompositeFilesystem(
config):MountedCompositeFilesystem
Parameters
Section titled “Parameters”config
Section titled “config”CompositeFilesystemConfig
Returns
Section titled “Returns”MountedCompositeFilesystem
Overrides
Section titled “Overrides”CompositeFilesystem.constructor
Properties
Section titled “Properties”
readonlyid:string
Unique identifier for this filesystem instance
Inherited from
Section titled “Inherited from”CompositeFilesystem.id
readonlyname:"CompositeFilesystem"="CompositeFilesystem"
Human-readable name (e.g., ‘LocalFilesystem’, ‘AgentFS’)
Inherited from
Section titled “Inherited from”CompositeFilesystem.name
provider
Section titled “provider”
readonlyprovider:"composite"="composite"
Provider type identifier
Inherited from
Section titled “Inherited from”CompositeFilesystem.provider
readOnly?
Section titled “readOnly?”
readonlyoptionalreadOnly?:boolean
When true, all write operations to this filesystem are blocked. Read operations are still allowed.
Default
Section titled “Default”falseInherited from
Section titled “Inherited from”CompositeFilesystem.readOnly
status
Section titled “status”status:
ProviderStatus
Current status
Inherited from
Section titled “Inherited from”CompositeFilesystem.status
Accessors
Section titled “Accessors”mountPaths
Section titled “mountPaths”Get Signature
Section titled “Get Signature”get mountPaths():
string[]
Get all mount paths.
Returns
Section titled “Returns”string[]
Inherited from
Section titled “Inherited from”CompositeFilesystem.mountPaths
mounts
Section titled “mounts”Get Signature
Section titled “Get Signature”get mounts():
ReadonlyMountMap<TMounts>
Get the mounts map.
Returns a typed map where get() preserves the concrete filesystem type per mount path.
Returns
Section titled “Returns”ReadonlyMountMap<TMounts>
Inherited from
Section titled “Inherited from”CompositeFilesystem.mounts
Methods
Section titled “Methods”appendFile()
Section titled “appendFile()”appendFile(
path,content):Promise<void>
Append content to a file. Creates the file if it doesn’t exist.
Parameters
Section titled “Parameters”string
content
Section titled “content”FileContent
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”CompositeFilesystem.appendFile
copyFile()
Section titled “copyFile()”copyFile(
src,dest,options?):Promise<void>
Copy a file to a new location.
Parameters
Section titled “Parameters”string
string
options?
Section titled “options?”CopyOptions
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if source doesn’t exist
Throws
Section titled “Throws”if destination exists and overwrite is false
Inherited from
Section titled “Inherited from”CompositeFilesystem.copyFile
deleteFile()
Section titled “deleteFile()”deleteFile(
path,options?):Promise<void>
Delete a file.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”RemoveOptions
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if file doesn’t exist and force is false
Throws
Section titled “Throws”if path is a directory
Inherited from
Section titled “Inherited from”CompositeFilesystem.deleteFile
destroy()
Section titled “destroy()”destroy():
Promise<void>
Clean up all resources.
Called when the workspace is being permanently shut down. Use for operations like:
- Terminating cloud instances
- Closing all connections
- Cleaning up temporary files
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”CompositeFilesystem.destroy
exists()
Section titled “exists()”exists(
path):Promise<boolean>
Check if a path exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”CompositeFilesystem.exists
getFilesystemForPath()
Section titled “getFilesystemForPath()”getFilesystemForPath(
path):WorkspaceFilesystem|undefined
Get the underlying filesystem for a given path. Returns undefined if the path doesn’t resolve to any mount.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”WorkspaceFilesystem | undefined
Inherited from
Section titled “Inherited from”CompositeFilesystem.getFilesystemForPath
getInfo()
Section titled “getInfo()”getInfo():
Promise<FilesystemInfo<Record<string,unknown>>>
Get status and metadata for this composite filesystem.
Includes info from each mounted filesystem in metadata.mounts.
Returns
Section titled “Returns”Promise<FilesystemInfo<Record<string, unknown>>>
Inherited from
Section titled “Inherited from”CompositeFilesystem.getInfo
getInstructions()
Section titled “getInstructions()”getInstructions(
_opts?):string
Get instructions describing the mounted filesystems. Used by agents to understand available storage locations.
Parameters
Section titled “Parameters”_opts?
Section titled “_opts?”requestContext?
Section titled “requestContext?”RequestContext<unknown>
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”CompositeFilesystem.getInstructions
getMountPathForPath()
Section titled “getMountPathForPath()”getMountPathForPath(
path):string|undefined
Get the mount path for a given path. Returns undefined if the path doesn’t resolve to any mount.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”CompositeFilesystem.getMountPathForPath
init()
Section titled “init()”init():
Promise<void>
One-time setup operations.
Called once when the workspace is first initialized. Use for operations like:
- Creating base directories
- Setting up database tables
- Provisioning cloud resources
- Installing dependencies
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”CompositeFilesystem.init
isDirectory()
Section titled “isDirectory()”isDirectory(
path):Promise<boolean>
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”CompositeFilesystem.isDirectory
isFile()
Section titled “isFile()”isFile(
path):Promise<boolean>
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<boolean>
Inherited from
Section titled “Inherited from”CompositeFilesystem.isFile
mkdir()
Section titled “mkdir()”mkdir(
path,options?):Promise<void>
Create a directory.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”recursive?
Section titled “recursive?”boolean
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if path already exists as a file
Inherited from
Section titled “Inherited from”CompositeFilesystem.mkdir
moveFile()
Section titled “moveFile()”moveFile(
src,dest,options?):Promise<void>
Move/rename a file.
Parameters
Section titled “Parameters”string
string
options?
Section titled “options?”CopyOptions
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if source doesn’t exist
Throws
Section titled “Throws”if destination exists and overwrite is false
Inherited from
Section titled “Inherited from”CompositeFilesystem.moveFile
readdir()
Section titled “readdir()”readdir(
path,options?):Promise<FileEntry[]>
List directory contents.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”ListOptions
Returns
Section titled “Returns”Promise<FileEntry[]>
Throws
Section titled “Throws”if directory doesn’t exist
Throws
Section titled “Throws”if path is a file
Inherited from
Section titled “Inherited from”CompositeFilesystem.readdir
readFile()
Section titled “readFile()”readFile(
inputPath,options?):Promise<string|Buffer<ArrayBufferLike>>
Parameters
Section titled “Parameters”inputPath
Section titled “inputPath”string
options?
Section titled “options?”ReadOptions
Returns
Section titled “Returns”Promise<string | Buffer<ArrayBufferLike>>
Overrides
Section titled “Overrides”CompositeFilesystem.readFile
resolveAbsolutePath()
Section titled “resolveAbsolutePath()”resolveAbsolutePath(
path):string|undefined
Resolve a workspace-relative path to an absolute disk path. Strips the mount prefix and delegates to the underlying filesystem.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string | undefined
Inherited from
Section titled “Inherited from”CompositeFilesystem.resolveAbsolutePath
rmdir()
Section titled “rmdir()”rmdir(
path,options?):Promise<void>
Remove a directory.
Parameters
Section titled “Parameters”string
options?
Section titled “options?”RemoveOptions
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if directory doesn’t exist and force is false
Throws
Section titled “Throws”if directory is not empty and recursive is false
Inherited from
Section titled “Inherited from”CompositeFilesystem.rmdir
stat()
Section titled “stat()”stat(
path):Promise<FileStat>
Get file/directory metadata.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<FileStat>
Throws
Section titled “Throws”if path doesn’t exist
Inherited from
Section titled “Inherited from”CompositeFilesystem.stat
writeFile()
Section titled “writeFile()”writeFile(
path,content,options?):Promise<void>
Write content to a file. Creates the file if it doesn’t exist.
Parameters
Section titled “Parameters”string
content
Section titled “content”FileContent
options?
Section titled “options?”WriteOptions
Returns
Section titled “Returns”Promise<void>
Throws
Section titled “Throws”if parent directory doesn’t exist and recursive is false
Throws
Section titled “Throws”if file exists and overwrite is false
Inherited from
Section titled “Inherited from”CompositeFilesystem.writeFile