Skip to main content
DeepSeek Harness (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 /. The working_directory tool moves between mounts.
  • Each bash call is a fresh shell. Give MirageShellExecutor a sessionId to keep exports and functions between calls.
  • Mount modes and session profiles apply to every tool. DSH_PERMISSION_MODE=read-only makes 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

Give MirageService 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. sessionId names a session on the server, created on first use.
  • The plugins make no sandbox claim, so DSH_PERMISSION_MODE=read-only does 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.
  • MirageSubprocess needs a workspace in the same process.
  • ctx.mirage.explain asks 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:
The bundle mounts one RAM disk at /tmp. Set your own mounts, Python and permissions in the profile’s cordis.patch.yml. Python runs only on an exec mount:
PowerShell and the glob and grep tools stay off, since they start programs on the host. The agent searches with rg, grep and find in bash.