Skip to main content
M

dsh-workbench

maxisoft-git/dsh-workbench

Project card in the right sidebar, read from .dsh/workbench.json in the workspace: site URL, SSH host, docroot, database, deploy command, accounts and notes. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.

Install

dsh plugin --profile web add github:maxisoft-git/dsh-workbench

README

Workbench

English · Русский · 简体中文

License: MIT DSH >= 0.2.2-rc.1

A project card for the current workspace, shown in a right-sidebar tab titled «Рабочий стол» with three sections: «Проект» (the card), «Деплой» (readiness checks, a confirmed run of the card's deploy command, a site check) and «Прод» (protected hosts and a decision journal). The card is one JSON file, .dsh/workbench.json, in the workspace directory, meant to be committed with the project. The plugin adds the workbench_card tool and the /card command, and a check that asks a human before a shell-like tool call touches a protected host or docroot. It does not deploy without a click, is not a secret store, and the production check is advisory: it cannot stop a command it never sees.

What it adds

RowEffect
Right-sidebar tab «Рабочий стол»One tab type (workbench): the card with «Заполнить» / «Изменить», «Сохранить», «Отмена», «Обновить» and «Скопировать как контекст», plus the «Деплой» and «Прод» sections. Opened from the sidebar's add control, the guide card «Рабочий стол», or the command-menu entry /workbench.
Tool workbench_cardaction: "get" prints the card as a markdown block; action: "update" merges only the supplied fields, so one call can fill one value. Optional dir for another directory inside the workspace.
Command /cardPrints the card of the session directory as markdown, without a model turn.
Host routesGET/PUT /api/workbench/card (read, replace), GET /api/workbench/prod (protected hosts and journal), POST /api/workbench/deploy (preflight, run, postcheck). Loopback and same-origin only.
Production checkA tools/pre-execute hook: a bash, pwsh or terminal_send call whose command touches a protected host or docroot is held until a human types the target name.

Install

DSH 0.2.2-rc.1 or newer.

In DSH. Plugins → Add plugin with the installation spec github:maxisoft-git/dsh-workbench. The plugin manager installs it for the whole profile; a new session picks it up.

From a checkout. git clone https://github.com/maxisoft-git/dsh-workbench.git, then install that absolute directory with Plugins → Add plugin.

Use

  1. Open the tab: right sidebar → add → guide card «Рабочий стол», or the command-menu entry. The panel follows the selected session.
/workbench
  1. Press «Заполнить» on an empty card, or «Изменить» on a filled one. The fields are Название, Сайт, SSH, Docroot, База, Деплой, Аккаунты (one per line) and Заметки; then press «Сохранить».
  2. Or let the agent fill the same file:
workbench_card { "action": "get" }
workbench_card { "action": "update", "card": { "title": "Example", "url": "https://example.test", "ssh": "example-prod", "docroot": "/var/www/example.test", "database": "localhost · example · example", "deploy": "./deploy.sh" } }
  1. Print it in a session without the panel:
/card
  1. «Скопировать как контекст» puts the same markdown block on the clipboard, for a message or a note.
  2. «Деплой»: press «Проверить готовность» to run the readiness checks — a clean git tree, a deploy command in the card, a URL for the site check, and the card's docroot reachable on the card's ssh host. Nothing runs on its own when the section opens. «Выполнить деплой» shows the exact command and waits for «Да, выполнить»; the command is taken from the card, never from the request, runs in the workspace directory, is stopped after 300 seconds, and its output is capped at 20 KB. The approval is bound to the exact command text — its sha256 is kept in .dsh/workbench-deploy-approval.json, and editing the command invalidates it. After a finished run the panel presses the site check itself; «Проверить сайт» repeats it on demand.
  3. «Прод» lists the protected hosts and docroot of this workspace and the newest journal entries. When the agent runs a shell command that touches one of them, a card appears above the composer: type the target name the prompt asks for — a host name or the docroot path — to run it. The «Отменить» button, an empty answer, a mismatched answer or a question that cannot be asked all deny the call.

The card holds: title, url, ssh, docroot, database, deploy, accounts (an array) and notes. An empty field is absent from the file and shows as «не заполнено». Bounds: 64 KiB for the file, 2000 characters per text field, 40 account entries of 300 characters.

Configuration

There are no keys in the plugin row. What you configure is the card, and the card is project data:

KeyDefaultMeaningWhere it is stored
title— (empty)Human name of the project; the tab header falls back to «Рабочий стол», the markdown block to the directory name.dsh/workbench.json in the workspace
url— (empty)Site URL, including the scheme; the postcheck targetthe same file
ssh— (empty)SSH host alias or user@host for the docroot probe and the deploythe same file
docroot— (empty)Absolute path of the site root on the serverthe same file
database— (empty)Database host, name and user — not a passwordthe same file
deploy— (empty)The command that deploys this project, run through the shellthe same file
accounts[]One entry per line; logins or credential references, no passwordsthe same file
notes— (empty)What an agent must know before touching the projectthe same file

The tool's dir argument defaults to the session working directory; it must stay inside the workspace, and an absolute path or a .. escape is refused.

The card is a plain file beside the code, so it travels with the repository and every checkout carries its own. Whether it is committed is up to the project: a repository whose .gitignore excludes .dsh/ keeps the card local, and the plugin does not touch your .gitignore.

Data and network

The card is sent to the model provider. When the agent reads or fills the card — with workbench_card or /card — the fields, including accounts and notes, travel to the provider as part of the conversation. That is why the plugin documents accounts as logins or credential references and never asks for a password.

Three actions leave the machine or touch another host, and none of them runs until someone clicks:

  • Postcheck performs a GET of the card's url — on «Проверить сайт», and automatically after a deploy you confirmed. Only http(s) is accepted, redirects are not followed, link-local hosts are refused, and the request times out after 15 seconds.
  • Preflight runs git status --porcelain in the workspace and, when both ssh and docroot are set, opens one SSH connection: ssh -o BatchMode=yes -o ConnectTimeout=8 -- <ssh> 'test -d …'.
  • Deploy runs the card's deploy command in the workspace directory with a filtered environment — only PATH, HOME, SHELL, LANG and TERM — after a human click and a confirmation, and is stopped after 300 seconds. What that command contacts is up to the command.

Files written on disk, all under <workspace>/.dsh/:

FileContent
workbench.jsonthe card; written atomically through a temp file and renamed, file mode 0600
workbench-prod.jsonlthe production journal, one JSON line per decision; rotated to .1 at 512 KiB
workbench-deploy-approval.jsonthe sha256 of the deploy command text a human approved, so the same exact command is not asked twice

Turning it off: disable the plugin — the tab, the tool, the command, the routes and the check disappear; the files stay. Nothing is sent anywhere while the plugin is idle.

Security

SECURITY.md — how to report a vulnerability and which versions are supported. SECURITY-AUDIT.md — the per-plugin audit: data flow, permissions, findings and their fixes.

The production check is an advisory check, not a sandbox. It sees only tool calls named bash, pwsh or terminal_send as they pass through DSH's tool registry; it splits the command text at unquoted shell operators, judges every segment, parses ssh options, and matches the arguments against the card's ssh, url and docroot plus a built-in list of known project servers. A destructive command on a host it does not recognise is still asked about. When a verdict applies, it asks the human to type the target name; a wait longer than 120 seconds, an aborted question, a missing answerer, an empty or different answer, and any error inside the check all deny the call, and every decision — confirmed, denied, unavailable — is appended to the journal before the call proceeds or returns.

It does not prevent: the panel deploy, which is a deliberate click; commands a person types into their own terminal; commands run by other plugins, MCP tools or by a script a tool starts; anything inside a deploy script or a Makefile; a host reached by an address the rules do not recognise; or a command that reads as harmless but is not. An allowed command runs with the permissions of the DSH process. The value of the check is that an accidental ssh prod … restart stops and asks; it is not a boundary.

The panel routes answer loopback callers only, reject a foreign Origin, require application/json for writes, bound the body, confine ?dir= to the session workspace, and write nothing outside <dir>/.dsh/.

Requirements

  • DeepSeek Harness 0.2.2-rc.1 or newer.
  • Node.js 22.19.0 or newer, as declared in engines.
  • git in PATH for the preflight tree check, and an ssh client for the docroot probe; both are optional — the checks report a failure instead.
  • No plugin configuration, no database and no external service.

Development

  • npm test runs three offline scripts: scripts/smoke.mjs (card store, deploy phases, journal, command rules), scripts/prod-guard-regressions.mjs (every bypass that used to work, plus the read-only commands that must stay quiet) and scripts/prod-guard-wiring.mjs (the guard against a Host context that enforces Cordis's own service-access rule).
  • npm run test:guard runs the two guard suites alone.
  • npm run verify checks the manifest, the patch file, the three locale files and the required README, LICENSE, CHANGELOG, SECURITY and SECURITY-AUDIT files.
  • Local link install: Plugins → Add plugin with the absolute path of the checkout. No build step.
  • Layout: index.js (Host: routes, tool, /card, the production check), client.js (Browser: the tab), lib/card.mjs (card shape, bounds, atomic write), lib/prod-rules.mjs (pure command classification), lib/deploy.mjs (preflight, run, postcheck), lib/journal.mjs (the JSONL journal), cordis.patch.yml, locale/, scripts/.

License

MIT © 2026 maxisoft-git

Related plugins