dsh-plugin
DayuanJiang/next-ai-draw-iodsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
一个 shell 工具:Windows 上统一执行 PowerShell / Git Bash / WSL,外加交互式 PTY 终端,默认终端由用户在设置中选择。
A DeepSeek Harness (DSH) plugin: one shell tool that runs commands through PowerShell / Git Bash / WSL on Windows, plus an interactive terminal tool — all following the terminal you choose in the Web UI settings.
| Backend | Runs | Syntax / paths | Env vars |
|---|---|---|---|
powershell (default) | pwsh -NoLogo -NoProfile -NonInteractive -Command <cmd> | PowerShell; C:\\... | $env:NAME |
gitbash | Git for Windows bash -lc <cmd> | POSIX; /d/WorkSpace; PATH includes /usr/bin and /mingw64/bin | $NAME |
wsl | wsl [-d <distro>] -e bash -lc <cmd> | Linux; /mnt/d/... | $NAME (via WSLENV) |
shell tool always obeys it.shell tool resolves the DSH sandbox policy per call and confines PowerShell argv through ctx.sandbox — same fail-closed SandboxUnavailableError semantics as the shipped executors. Git Bash and WSL run unconfined: WSL is its own Linux VM, while Git Bash cannot run under the DSH Windows ACL restricted-token runner (Cygwin/MSYS2 aborts with CreateFileMapping Win32 error 5). Official sandbox_permissions / justification escalation and denial markers included.terminal tool opens persistent real-PTY sessions over node-pty — on non-Windows via the official ctx.subprocess.spawnTerminal seam, on Windows directly through node-pty because the upstream seam's process inspector is POSIX-only. Actions open / send / read / signal / close; shell state persists across calls; sessions are managed as background jobs and auto-close when idle.run_in_background / job_output / job_kill).The package ships the official dsh.bundle manifest (its own cordis.patch.yml): listing dsh-bash-terminal in a profile's dsh.profile.bundles auto-applies the mount — no manual profile edits.
npm install -g dsh-bash-terminal
dsh plugin --profile web add dsh-bash-terminal # adds to profile bundles + applies the patch
powershell -ExecutionPolicy Bypass -File install.ps1 install # patches the DSH settings-UI allowlist (see below)
# restart dsh web
DSH limitation: the Web settings client only exposes a hard-coded allowlist of settings namespaces (
dsh-host-apiproxy); third-party settings writes are refused withsettings-not-exposedotherwise.install.ps1patches the allowlist (with a backup) — re-run it after upgrading DSH;install/uninstallrestores it.
For local development (junction install, source changes apply instantly) see the Chinese README's development section.
danger-full-access sessions run directly (no wrapping).ctx.sandbox.confine; fail-closed when no backend is available.CreateFileMapping Win32 error 5); results report enforcement: gitbash-unconfined.enforcement: wsl-isolation).[sandbox: file access denied under <mode> mode] marker plus a same-turn escalation hint; the model may retry once with sandbox_permissions + justification (user-approved via ctx.approval).terminal actions: open (start a session on the configured default terminal), send (write input + read new output), read, signal (SIGINT = Ctrl+C etc.), close, list (enumerate live sessions). Reads wait for output to settle (quiet 300ms, cap 5s) so send returns the complete reply; buffer overflow reports a truncated notice. State (cwd / variables / aliases) persists across calls; end input with \\n. Sessions are background jobs (job_kill works) and auto-close after 10 idle minutes (idleMs overrides on open).
wsl -e bash -lc ... works; for interactive WSL prefer a real terminal (Windows Terminal / WSL app) or retry.signal maps SIGINT to Ctrl+C (\x03); other signals (SIGTERM / SIGKILL / SIGTSTP / SIGHUP) degrade to terminating the session.Web UI: Settings -> General -> Default terminal. Plugin row config overrides: defaultShell, timeoutMs, maxTimeoutMs, pwshPath, gitBashPath, wslPath.
powershell -ExecutionPolicy Bypass -File install.ps1 uninstall
node test/unit.mjs && node test/apply.mjs && node test/client.mjs && node test/terminal.mjs