dsh-web-terminal
DSH Web GUI 本地终端插件:基于 node-pty 的多标签 xterm.js 面板,经 WebSocket 流式连接宿主进程,热插拔挂载。
iamsee123
@iamsee123
⬇ 1
★ 1
main
安装
dsh plugin --profile web add github:iamsee123/dsh-web-terminal
需要可复现安装时,可在仓库后追加 #commit 固定提交。
DSH Web GUI 本地终端插件:基于 node-pty 的多标签 xterm.js 面板,经 WebSocket 流式连接宿主进程,热插拔挂载。
该插件未提供要点说明,请参考仓库 README。
deepseek-harnessdshdsh-plugindsh-plugins
- 安装并启动 DeepSeek Harness:
npx @deepseek-ai/dsh web - 在终端执行上面的安装命令(CLI 会解析插件并核验来源)
- 用 dsh plugins list 确认已安装,必要时重启 Harness 生效
插件以当前 dsh 进程的权限运行,安装时可能执行代码。请先通读仓库源码与许可证,确认无破坏性命令与越权访问;本站只做索引,不对第三方插件安全性作担保。
| 代码仓库 | github.com/iamsee123/dsh-web-terminal |
| 许可证 | MIT |
| 主要语言 | main |
| 下载量 | 1 |
| GitHub 星标 | 1 |
| 最近推送 | 2026-08-16 |
| 收录日期 | 2026-09-19 |
| 分类 | 工具与能力 |
事实信息来自公开插件目录快照(2026-10-01),介绍文案由本站再加工。
以下为插件仓库 README 全文(原始内容,由公开目录抓取整理)。
# dsh-web-terminal
A **local terminal** plugin for the [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) web GUI. Adds a sidebar **Terminal** entry with a multi-tab [xterm.js](https://xtermjs.org/) panel; every tab runs a real PTY shell on the host process via [node-pty](https://github.com/microsoft/node-pty), streamed over a WebSocket route.
Features:
- Real pseudo-terminal shells — interactive programs (`vim`, `top`, `htop`), Ctrl-C, resize all work
- Multi-tab terminal panel with new / close / disconnect / reconnect / clear controls
- Auto-fit on panel open, window resize, and container changes
- Shell and working directory configurable (settings panel or patch yaml)
- Loopback-only trust fence on every route
- Hot-pluggable: no dsh source changes, mounts through the web profile bundle list (same dual-face plugin pattern as [dsh-ssh](https://github.com/zhu1090093659/dsh-web-ui/tree/main/packages/dsh-ssh))
## Architecture
| Half | Entry | Responsibility |
|---|---|---|
| host (node) | `lib/index.js` (`src/index.ts`) | node-pty shell sessions, `/api/dsh-terminal/info` route, `/api/dsh-terminal/terminal` WebSocket upgrade, system-prompt announcement, settings namespace (shell/cwd) |
| client (browser) | `lib/client.js` (`src/client/index.ts`) | sidebar Terminal entry (DOM injection, self-healing), multi-tab terminal panel (React + xterm.js) |
Wire protocol (`src/protocol.ts`):
- client → host: `{type:"input",data}`, `{type:"resize",cols,rows}`
- host → client: `{type:"ready",shell}`, `{type:"output",data}`, `{type:"exit",code,error?}`
Security: all routes carry a loopback-only trust fence (same-origin + 127.0.0.1/localhost checks). The terminal executes commands with the host user's privileges — equivalent to direct shell access.
## Install into the web profile
Option A — bundle list (recommended):
```sh
# 1) one-time: allow node-pty build scripts in ~/.dsh/profiles/web/pnpm-workspace.yaml
# allowBuilds:
# esbuild: true
# node-pty: true
# 2) add the dependency (adjust the path to your checkout)
cd ~/.dsh/profiles/web
pnpm add dsh-web-terminal@link:/path/to/dsh-web-terminal
# 3) append "dsh-web-terminal" to dsh.profile.bundles in package.json
# (the bundle's cordis.patch.yml inserts the id=terminal plugin row)
# 4) restart dsh web
```
Option B — manual patch row in `~/.dsh/profiles/web/cordis.patch.yml` (with the package installed in the profile):
```yaml
- insert:
- id: terminal
name: 'dsh-web-terminal'
```
## Configuration (settings panel / patch yaml)
```yaml
- id: terminal
config:
enabled: true
announceToAgent: true
shell: /bin/zsh # default: $SHELL
cwd: /path/to/work # default: host process cwd (workspace root)
```
## Development
```sh
pnpm install # pnpm-workspace.yaml must allow esbuild / node-pty build scripts
pnpm run typecheck # tsc --noEmit
pnpm run build # esbuild: lib/index.js (host) + lib/client.js (ModuleLoader wrapper)
pnpm test # client bundle syntax + jsdom ModuleLoader simulation
node scripts/smoke.mjs # host WebSocket link smoke test
node scripts/browser-diag.mjs # Playwright: open the real GUI, click Terminal, type a command
```
The build script embeds `node_modules/@xterm/xterm/css/xterm.css` into `src/client/xterm-css.ts` (generated) because the ModuleLoader environment has no CSS loader.
### Known pitfalls
1. **Client externals**: only platform seed words (react family) and shell-own modules (`@deepseek-ai/*`) may stay external. `@xterm/*` must be **bundled** — otherwise the ModuleLoader reports `require("@xterm/xterm") missed the module table` (dsh-ssh bundles xterm too).
2. **Panel height chain**: `[data-dsh-terminal-view]` is an absolute container; its direct child `.dshTermView` needs `height: 100%` or the inner `.dshTermPanel { height: 100% }` resolves against an auto-height parent and the whole flex chain collapses (terminal squashed to a 2px strip).
3. **node-pty spawn-helper permissions**: the prebuilt `prebuilds//spawn-helper` may lose its executable bit (`posix_spawnp failed`); run `pnpm run fix:spawn-helper` (also runs automatically on `pnpm install` via postinstall). Note node-pty spawn is blocked inside the dsh file sandbox — run smoke tests against a real dsh process.
## Verify
```sh
curl http://127.0.0.1:3080/api/dsh-terminal/info
# {"shell":"/bin/zsh","platform":"darwin",...}
# browser: refresh the GUI → sidebar Terminal → new tab → type commands
```
## License
MIT
数据来源:公开的 DeepSeek Harness 插件目录与各插件 GitHub 仓库。本站为独立第三方目录,与 DeepSeek、幻方(High-Flyer)及插件作者均无隶属或背书关系。