FsProvider and ShellProvider — that you can implement for any environment.
This lets you run the same agent code locally, in a sandbox, or in the cloud, just by swapping the provider.
Interfaces
FsProvider
ShellProvider
Environment
TheEnvironment type combines both providers:
Built-in Providers
NodeFsProvider
The default filesystem provider for Node.js environments. Usesnode:fs under the hood.
| Option | Default | Description |
|---|---|---|
cwd | process.cwd() | Working directory for resolving relative paths |
maxFileSize | 10 MB | Maximum file size readFile will load |
- File size guard — throws
FileTooLargeErrorif a file exceedsmaxFileSize - Auto-mkdir —
writeFilecreates parent directories automatically - Path resolution — relative paths are resolved from
cwd
NodeShellProvider
The default shell provider for Node.js. Runs commands viabash -c.
| Option | Default | Description |
|---|---|---|
cwd | process.cwd() | Default working directory for commands |
maxStdout | 50,000 chars | Truncate stdout beyond this length |
maxStderr | 10,000 chars | Truncate stderr beyond this length |
exec method supports per-call timeout (default 30s), cwd, and env overrides.
VfsFsProvider
A virtual filesystem provider from the@openharness/provider-vfs package. Provides sandboxed, in-memory, or SQLite-backed file access — ideal for testing, isolated execution, or environments without a real filesystem.
/workspace. It initializes lazily on first use.
Options:
| Option | Default | Description |
|---|---|---|
vfs | — | Pre-created VirtualFileSystem instance (skips auto-creation) |
provider | MemoryProvider | VFS storage backend |
vfsOptions | { moduleHooks: false, virtualCwd: true } | Options passed to vfs.create() |
mountPoint | "/workspace" | Mount point for the virtual filesystem |
maxFileSize | 10 MB | Maximum file size readFile will load |
Storage Backends
The VFS provider supports three backends via@platformatic/vfs (or the future node:vfs):
- Memory (default)
- SQLite
- Real FS
In-memory filesystem — fast, ephemeral, no persistence:
Accessing the VFS Instance
For advanced use cases, you can access the underlyingVirtualFileSystem:
Custom Providers
Implement theFsProvider and/or ShellProvider interfaces to support any environment:
- E2B sandboxes for isolated code execution
- Cloudflare Workers for edge deployment
- Daytona for managed dev environments
- Docker containers for reproducible builds
- Custom APIs wrapping remote filesystems