@hyzyn/dsh-plugin-kit 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -18,7 +18,7 @@ Repo gates: `pnpm typecheck` / `pnpm build` / `pnpm aggregate`.
18
18
 
19
19
  <p align="center">
20
20
  <strong>The plugin family for the DeepSeek Harness (DSH) Web GUI</strong><br>
21
- <em>Environment variables · MCP servers · Prompt · Profile · RSS · Global search · Codegraph · Plugin scaffolding</em>
21
+ <em>Environment variables · MCP servers · Prompt · Profile · RSS · Global search · Codegraph · Terminal panel · Plugin scaffolding</em>
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -29,7 +29,7 @@ Repo gates: `pnpm typecheck` / `pnpm build` / `pnpm aggregate`.
29
29
 
30
30
  ## What It Is
31
31
 
32
- dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (DSH) Web GUI: environment variable / secret management, MCP server configuration, Prompt management, Profile management, RSS / news aggregation, global search, and Codegraph integration, plus a one-command scaffolding tool for generating new plugins. Everything mounts into `dsh web` through the official profile mechanism, so no DSH source changes are needed. Install the plugins individually, or install everything at once with the aggregate package.
32
+ dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (DSH) Web GUI: environment variable / secret management, MCP server configuration, Prompt management, Profile management, RSS / news aggregation, global search, Codegraph integration, and a terminal panel, plus a one-command scaffolding tool for generating new plugins. Everything mounts into `dsh web` through the official profile mechanism, so no DSH source changes are needed. Install the plugins individually, or install everything at once with the aggregate package.
33
33
 
34
34
  ![Example of DSH plugin management cards](docs/dsh-plugin-kit-mcp.png)
35
35
 
@@ -42,6 +42,7 @@ dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (
42
42
  | RSS aggregation | None | Multiple sources + daily “Today’s Worth Reading” digest |
43
43
  | Global search | Session titles/content only | Unified sidebar full-text search over historical sessions |
44
44
  | Codegraph integration | None | Code-graph card: index status / symbol search / callers-callees-impact / one-click sync-index |
45
+ | Terminal panel | None | Sidebar “Terminal” entry + xterm.js modal: multi-tab real PTY terminal (vim / htop / dev servers), cwd follows session, hot-reload config |
45
46
  | Plugin development | Hand-written boilerplate | `pnpm create-plugin` scaffolding + `@hyzyn/dsh-kit` type helpers |
46
47
 
47
48
  ## Feature Plugins
@@ -126,6 +127,14 @@ dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (
126
127
 
127
128
  ![Codegraph settings card](docs/dsh-plugin-kit-codegraph.png)
128
129
 
130
+ ### Terminal Panel (@hyzyn/dsh-tty)
131
+
132
+ - **What it does**: adds a “Terminal” entry to the Web GUI sidebar that opens a large modal with an embedded xterm.js interactive terminal (real PTY via node-pty), with multi-tab support, capable of running arbitrary commands and TUI programs (vim / htop / dev servers).
133
+ - **How to use**: install, then restart `dsh web`; click “Terminal” in the sidebar → the first terminal is created automatically (default `$SHELL`) → use “+” in the tab bar to open more tabs and ✕ to close; new tabs default to the current DSH session’s working directory; Ctrl+F searches inside the terminal, and the toolbar offers clear / copy / paste; closing the panel or pressing Esc ends all sessions.
134
+ - **Supports**: multi-tab sessions (multiple sessions per connection, protocol v2 with sid); working directory follows the current session (sessions client service); TERM=xterm-256color injection (via a `-c` wrapper layer so TUI apps don’t degrade); resize passthrough to node-pty’s native API; a WebSocket frame protocol (spawn/input/resize/kill ↔ ready/data/exit/error); downstream backpressure protection; loopback trust fence; concurrency cap (default 4); settings hot-reload (settings/updated); agent tools (tty_list / tty_capture / tty_send, to inspect and interact with long-running processes in the user's terminal).
135
+ - **Where it is stored**: no config file of its own; configuration lives in the “Settings → Plugins → Terminal Panel” card.
136
+ - **Note**: resize relies on DSH’s internal terminal-handle shape (known limitation); output is a UTF-8 text stream, so `cat`-ing binary files shows replacement characters. See `packages/tty/README.md` for details.
137
+
129
138
  ## Quick Start
130
139
 
131
140
  ### System Requirements
@@ -195,6 +204,7 @@ dsh plugin --profile web add @hyzyn/dsh-profile # Profile management
195
204
  dsh plugin --profile web add @hyzyn/dsh-rss # RSS / news aggregation
196
205
  dsh plugin --profile web add @hyzyn/dsh-search # Global search
197
206
  dsh plugin --profile web add @hyzyn/dsh-codegraph # Codegraph integration
207
+ dsh plugin --profile web add @hyzyn/dsh-tty # Terminal panel
198
208
  ```
199
209
 
200
210
  ### Verify and Uninstall
@@ -292,6 +302,7 @@ A: There may be root-owned files in the local `~/.npm` cache (a historical npm b
292
302
  - Profile deletion is recursive and irreversible after the in-panel confirmation. The built-in `web` profile is protected; `headless` can be deleted.
293
303
  - RSS needs network access on first startup. An unreachable source does not block other sources, but that source may be missing from the day’s digest.
294
304
  - The browser half depends on the official `dsh-web-app` settings panel slots service; non-official Web GUIs may not show the management cards.
305
+ - The terminal panel (dsh-tty) resize passthrough relies on DSH’s internal terminal-handle shape, and TERM injection needs the `-c` wrapper layer (DSH hard-codes node-pty `name:"dumb"`); see `packages/tty/README.md`.
295
306
  - Installing from the repository requires Node.js >= 22.19 and pnpm 10; it is for development/debugging only. npm installs are not affected.
296
307
 
297
308
  ## Contributing
package/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  <p align="center">
20
20
  <strong>DeepSeek Harness(DSH)Web GUI 的插件全家桶</strong><br>
21
- <em>环境变量 · MCP 服务器 · Prompt · Profile · RSS · 全局搜索 · Codegraph 集成 · 插件脚手架</em>
21
+ <em>环境变量 · MCP 服务器 · Prompt · Profile · RSS · 全局搜索 · Codegraph 集成 · 终端面板 · 插件脚手架</em>
22
22
  </p>
23
23
 
24
24
  <p align="center">
@@ -42,6 +42,7 @@ dsh-plugin-kit 是给 DeepSeek Harness(DSH)Web GUI 用的通用插件集合
42
42
  | RSS 聚合 | 无 | 多源订阅 + 每日「今日值得读」自动摘要 |
43
43
  | 全局搜索 | 仅会话标题/内容 | 侧边栏统一全文搜索历史会话、Prompt、MCP 工具与设置面板 |
44
44
  | Codegraph 集成 | 无 | 代码图谱卡片:索引状态 / 符号搜索 / 调用链 / 影响面 / 一键 sync-index |
45
+ | 终端面板 | 无 | 侧边栏「终端」入口 + xterm.js 大弹窗:多标签页真实 PTY 终端(vim/htop/dev server),cwd 跟随会话,配置热生效 |
45
46
  | 插件开发 | 手写样板 | `pnpm create-plugin` 脚手架 + `@hyzyn/dsh-kit` 类型助手 |
46
47
 
47
48
  ## 功能插件
@@ -103,11 +104,25 @@ dsh-plugin-kit 是给 DeepSeek Harness(DSH)Web GUI 用的通用插件集合
103
104
  - **做什么**:代码图谱集成——设置 → 插件 里的「Codegraph」卡片提供索引状态、符号搜索、callers / callees / impact 查看和一键 sync / index;安装后自动向 systemPrompt 注入 CodeGraph 使用指引,模型在已索引项目里优先用 `codegraph_explore` / `codegraph explore` 查询代码而不是 grep / read。
104
105
  - **怎么用**:打开 设置 → 插件 →「Codegraph」→ 查看索引状态、搜索符号、点击结果查看源码与调用链 / 影响面、手动 Sync / 重建索引。
105
106
  - **支持**:索引状态(版本、文件 / 符号 / 边数量、最后索引时间、待同步变更);符号搜索与 node / callers / callees / impact 详情;**默认路径跟随当前活动会话的工作目录**(切换项目会话自动切换,手动输入可临时覆盖);一键增量 sync 与全量重建。
106
- - **存哪里**:索引在项目 `.codegraph/` 目录(由 `codegraph index` 生成);插件无独立配置文件。
107
- - **注意**:查询目标项目需要先有 Codegraph 索引;未索引项目会返回指引改用常规工具。索引 / 重建为本地 CLI 操作,消耗真实磁盘与 CPU。
107
+ - **MCP 托管(默认开)**:DSH 的 MCP 客户端不声明 roots,`codegraph serve --mcp` 只能从工作目录向上找 `.codegraph/`——宿主若从家目录启动,模型调用 `mcp__codegraph__*` 会拿到 "No CodeGraph project is loaded"。本插件自动在 `~/.dsh/cordis.patch.yml` 托管 codegraph MCP 服务器行并把 cwd 对齐默认项目路径(卡片「设为默认项目」一键切换,保存即热重启 MCP 服务器);已在 MCP 卡片配置过的行只补 cwd 不动其它字段。可用 `mcpIntegration: false` 关闭。
108
+ - **存哪里**:索引在项目 `.codegraph/` 目录(由 `codegraph index` 生成);默认项目路径持久化在 settings 命名空间 `codegraph`。
109
+ - **注意**:查询目标项目需要先有 Codegraph 索引;未索引项目会返回指引改用常规工具。索引 / 重建为本地 CLI 操作,消耗真实磁盘与 CPU。一台 codegraph MCP 服务器同一时刻只挂载一个默认项目,其它已索引项目可在工具调用里传 `projectPath` 查询。
108
110
 
109
111
  ![Codegraph 设置卡片](docs/dsh-plugin-kit-codegraph.png)
110
112
 
113
+ ### 终端面板(@hyzyn/dsh-tty)
114
+
115
+ - **做什么**:在 Web GUI 侧边栏加一个「终端」入口,点击打开大弹窗,内嵌 xterm.js 全交互终端(node-pty 真实 PTY),支持多标签页,可运行任意命令与 TUI 程序(vim / htop / dev server 等)。
116
+ - **怎么用**:安装后重启 `dsh web`,侧边栏点击「终端」→ 自动创建第一个终端(默认 `$SHELL`)→ 标签栏「+」新建、✕ 关闭;新标签默认在当前 DSH 会话工作目录打开;Ctrl+F 终端内搜索,工具栏清屏/复制/粘贴。
117
+ - **最小化(状态并入侧边栏入口)**:点弹窗外空白处、按 Esc 或标题栏「—」把面板收起,PTY 会话与输出缓冲保持存活;侧边栏「终端」入口显示会话数徽标与状态点,点击入口恢复;悬浮条 ✕ / 标题栏 ✕ 才真正关闭并结束全部会话。
118
+ - **支持**:多标签页(单连接多会话,帧协议 v2 带 sid);cwd 跟随当前会话(sessions 客户端服务);TERM=xterm-256color 注入(`-c` 包装层,TUI 应用不退化);resize 透传 node-pty 原生 API;WS 双向帧协议(spawn/input/resize/kill ↔ ready/data/exit/error);下行背压保护;loopback 信任围栏;并发上限(默认 4);配置保存即热生效(settings/updated);agent 工具集(tty_list / tty_capture / tty_send,可查看与交互用户终端里的长驻进程)。
119
+ - **存哪里**:无独立配置文件;配置走「设置 → 插件 → 终端面板」卡片。
120
+ - **注意**:resize 依赖 DSH 内部 terminal handle 结构(已知限制);输出为 utf8 文本流,`cat` 二进制文件会有替换字符。详细见 `packages/tty/README.md`。
121
+
122
+ ![终端面板:多标签页 xterm 弹窗,标题栏含最小化「—」与关闭 ✕](docs/dsh-plugin-kit-tty.png)
123
+
124
+ ![终端面板设置卡片:shell / TERM / 并发上限等保存即热生效](docs/dsh-plugin-kit-tty-setting.png)
125
+
111
126
  ### RSS / 新闻聚合(@hyzyn/dsh-rss)
112
127
 
113
128
  - **做什么**:订阅多个 RSS / Atom 源,每天自动汇总成一篇「今日值得读」Markdown,并注入 systemPrompt 供模型直接引用。
@@ -194,6 +209,7 @@ dsh plugin --profile web add @hyzyn/dsh-profile # Profile 管理
194
209
  dsh plugin --profile web add @hyzyn/dsh-rss # RSS / 新闻聚合
195
210
  dsh plugin --profile web add @hyzyn/dsh-search # 全局搜索
196
211
  dsh plugin --profile web add @hyzyn/dsh-codegraph # Codegraph 集成
212
+ dsh plugin --profile web add @hyzyn/dsh-tty # 终端面板
197
213
  ```
198
214
 
199
215
  ### 验证与卸载
@@ -288,9 +304,11 @@ A: 本机 `~/.npm` 缓存存在 root-owned 文件(历史 npm bug),执行 `
288
304
  ## 已知限制
289
305
 
290
306
  - MCP 的 `~/.dsh/cordis.patch.yml` 里托管区块只应放服务器配置;手工追加插件行会导致 `duplicate loader entry id` 启动失败。
307
+ - Codegraph 的 MCP 托管只对齐 codegraph 一个服务器的工作目录;DSH 的 MCP 客户端暂不声明 roots,切换项目需在 Codegraph 卡片「设为默认项目」或调用工具时传 `projectPath`。
291
308
  - Profile 删除为递归删除,面板内会二次确认,但一旦执行不可撤销;内置 `web` profile 受保护,`headless` 可删。
292
309
  - RSS 首次启动需要联网抓取;某个源不可达不会阻塞其它源,但当天 digest 可能缺少该源内容。
293
310
  - 浏览器半体依赖官方 `dsh-web-app` 的设置面板 slots 服务,非官方 Web GUI 可能不显示管理卡片。
311
+ - 终端面板(dsh-tty)的 resize 透传依赖 DSH 内部 terminal handle 结构,TERM 注入需经 `-c` 包装层(DSH 硬编码 node-pty name:"dumb");详见 `packages/tty/README.md`。
294
312
  - 仓库安装需要 Node.js >= 22.19 与 pnpm 10,仅供开发调试;npm 安装不受影响。
295
313
 
296
314
  ## 参与贡献
package/cordis.patch.yml CHANGED
@@ -45,3 +45,8 @@
45
45
  - insert:
46
46
  - id: global-search
47
47
  name: '@hyzyn/dsh-search'
48
+
49
+ # from ../packages/tty
50
+ - insert:
51
+ - id: tty
52
+ name: '@hyzyn/dsh-tty'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyzyn/dsh-plugin-kit",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "通用 DSH 插件库(pnpm monorepo):模板插件、插件开发工具包、一键聚合安装包。根包同时是全家桶 bundle(dsh.bundle.patch),DSH 与插件市场可直接识别安装。",
6
6
  "main": "lib/index.js",
@@ -16,7 +16,6 @@
16
16
  "devDependencies": {
17
17
  "typescript": "~5.7.2"
18
18
  },
19
- "packageManager": "pnpm@10.30.3",
20
19
  "license": "MIT",
21
20
  "files": [
22
21
  "lib",
@@ -27,14 +26,15 @@
27
26
  "access": "public"
28
27
  },
29
28
  "dependencies": {
30
- "@hyzyn/dsh-codegraph": "0.1.4",
29
+ "@hyzyn/dsh-codegraph": "0.1.5",
31
30
  "@hyzyn/dsh-env": "0.1.4",
32
31
  "@hyzyn/dsh-hello": "0.1.1",
33
32
  "@hyzyn/dsh-mcp": "0.1.3",
34
33
  "@hyzyn/dsh-profile": "0.1.4",
35
34
  "@hyzyn/dsh-prompt": "0.1.3",
36
- "@hyzyn/dsh-rss": "0.1.5",
37
- "@hyzyn/dsh-search": "0.1.2"
35
+ "@hyzyn/dsh-rss": "0.1.6",
36
+ "@hyzyn/dsh-search": "0.1.3",
37
+ "@hyzyn/dsh-tty": "0.1.1"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "pnpm -r build",