dsh) is a plugin-based agent harness on Cordis. @struktoai/mirage-dsh gives dsh one Mirage workspace as its filesystem and shell, so its tools work on whatever the workspace mounts: S3, Slack, Gmail, Postgres, disk.
Install
What is wired to what
- The agent starts in the disk mount that holds the directory dsh was launched from, or in
/. Theworking_directorytool moves between mounts. - Each
bashcall is a fresh shell. GiveMirageShellExecutorasessionIdto keep exports and functions between calls. - Mount modes and session profiles apply to every tool.
DSH_PERMISSION_MODE=read-onlymakes every mount read-only. - An ask rule shows in dsh’s approval prompt. With no prompt, the line is refused and the question stays pending: answer it through
ctx.mirage.decisions, then run the line again.
Example
examples/typescript/agents/dsh/dsh.ts is a longer runnable version, with Python and permissions.
Use a workspace on a Mirage server
GiveMirageService a remote instead of a workspace and the plugins call the workspace a Mirage server holds: each bash line goes to its shell, each file call to its VFS API. dsh can then run where nothing is mounted, such as a Cloudflare Worker. Import from @struktoai/mirage-dsh/remote there, which leaves out @struktoai/mirage-node:
- The server owns the mounts, machines and profiles.
sessionIdnames a session on the server, created on first use. - The plugins make no sandbox claim, so
DSH_PERMISSION_MODE=read-onlydoes not narrow a remote workspace. Give the session a read-only profile on the server instead. - Asks are answered on the server, at
/v1/workspaces/{id}/asks. MirageSubprocessneeds a workspace in the same process.ctx.mirage.explainasks the server’s?explain=true, so it works only where the server serves it.
Use with the dsh CLI
The package is also a dsh bundle. Added to a profile, it replaces dsh’s filesystem, shell, subprocess and spill providers with the Mirage ones:/tmp. Set your own mounts, Python and permissions in the profile’s cordis.patch.yml. Python runs only on an exec mount:
glob and grep tools stay off, since they start programs on the host. The agent searches with rg, grep and find in bash.