@hyzyn/dsh-plugin-kit 0.1.20 → 0.1.22

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.
Files changed (3) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +4 -3
  3. package/package.json +13 -10
package/README.en.md CHANGED
@@ -111,7 +111,7 @@ dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (
111
111
  - **MCP integration (on by default)**: DSH’s MCP client does not declare roots, so `codegraph serve --mcp` can only look upward from its working directory for `.codegraph/` — when the host starts in the home directory, `mcp__codegraph__*` calls fail with “No CodeGraph project is loaded”. This plugin manages the codegraph MCP server row in `~/.dsh/cordis.patch.yml` and aligns its cwd with the default project path (the card’s “Set as default project” switches it in one click and the MCP server hot-restarts on save); a row already configured in the MCP card only gets its cwd filled in, other fields are left untouched. Disable with `mcpIntegration: false`.
112
112
  - **Where it is stored**: the index lives in the project’s `.codegraph/` directory (created by `codegraph index`); the plugin has no config file of its own.
113
113
  - **Note**: the target project needs a Codegraph index first; unindexed projects return guidance to fall back to regular tools. Indexing / rebuilding are local CLI operations that consume real disk and CPU.
114
- - **Compatibility and tuning**: verified end to end on DSH `0.1.5-rc.2` + codegraph CLI `1.5.0` (declares `engines.dsh: >=0.1.2-rc.1 <0.2.0`); the CLI commands and flags used are listed in the package README. For large repositories, raise `indexTimeoutMs` (default 600s; `cliTimeoutMs` covers query commands, default 60s), and enable `indexForce` when the CLI refuses to index a home directory / filesystem root.
114
+ - **Compatibility and tuning**: verified end to end on DSH `0.1.5-rc.2` + codegraph CLI `1.5.0` (declares `dsh.engines.dsh: >=0.1.2-rc.1`); the CLI commands and flags used are listed in the package README. For large repositories, raise `indexTimeoutMs` (default 600s; `cliTimeoutMs` covers query commands, default 60s), and enable `indexForce` when the CLI refuses to index a home directory / filesystem root.
115
115
 
116
116
  ![Codegraph settings card](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-codegraph.png)
117
117
 
@@ -163,14 +163,14 @@ dsh-plugin-kit is a general-purpose plugin collection for the DeepSeek Harness (
163
163
  - **Where it is stored**: the managed block of `~/.dsh/prompts.yml`.
164
164
  - **Note**: each Prompt must have at least one version, and a single version’s content must be ≤ 500KB.
165
165
 
166
- ![Prompt management plugin](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-promat.png)
166
+ ![Prompt management plugin](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-prompt.png)
167
167
 
168
168
  ## Quick Start
169
169
 
170
170
  ### System Requirements
171
171
 
172
172
  - DeepSeek Harness installed and `dsh web` starts normally. The current verified baseline is DSH `0.1.5-rc.2` (host routes, browser half, systemPrompt injections, and the managed MCP row, end to end).
173
- - Plugins may declare the DSH release line they support via `engines.dsh` (e.g. `@hyzyn/dsh-codegraph` declares `>=0.1.2-rc.1 <0.2.0`); the plugin market reads it to show compatible / incompatible, and an undeclared package shows as “unknown”.
173
+ - Every installable plugin declares the DSH release line it supports via `dsh.engines.dsh` (this repository uses `>=0.1.2-rc.1` across the board); the plugin market reads it to show compatible / incompatible, and an undeclared package shows as “unknown”. **Only the `>=X.Y.Z[-prerelease]` form is supported**: `^0.1.2`, `~0.1.2` or a two-sided `>=0.1.2-rc.1 <0.2.0` all read as “cannot verify”, and a declared-but-unverifiable requirement fails closed — the update is refused outright, which is worse than declaring nothing. CI enforces this with `node scripts/check-dsh-engines.mjs`.
174
174
  - No extra requirements for npm installs; installing from this repository requires Node.js >= 22.19 and pnpm 10.
175
175
 
176
176
  ### Three-Step Setup
package/README.md CHANGED
@@ -113,7 +113,7 @@ dsh-plugin-kit 是给 DeepSeek Harness(DSH)Web GUI 用的通用插件集合
113
113
  - **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` 关闭。
114
114
  - **存哪里**:索引在项目 `.codegraph/` 目录(由 `codegraph index` 生成);默认项目路径持久化在 settings 命名空间 `codegraph`。
115
115
  - **注意**:查询目标项目需要先有 Codegraph 索引;未索引项目会返回指引改用常规工具。索引 / 重建为本地 CLI 操作,消耗真实磁盘与 CPU。一台 codegraph MCP 服务器同一时刻只挂载一个默认项目,其它已索引项目可在工具调用里传 `projectPath` 查询。
116
- - **兼容与调优**:已在 DSH `0.1.5-rc.2` + codegraph CLI `1.5.0` 上实测(声明 `engines.dsh: >=0.1.2-rc.1 <0.2.0`);CLI 命令与旗标见包内 README。大仓库全量重建可调 `indexTimeoutMs`(默认 600s,查询档 `cliTimeoutMs` 默认 60s),CLI 拒绝索引家目录 / 文件系统根时开 `indexForce`。
116
+ - **兼容与调优**:已在 DSH `0.1.5-rc.2` + codegraph CLI `1.5.0` 上实测(声明 `dsh.engines.dsh: >=0.1.2-rc.1`);CLI 命令与旗标见包内 README。大仓库全量重建可调 `indexTimeoutMs`(默认 600s,查询档 `cliTimeoutMs` 默认 60s),CLI 拒绝索引家目录 / 文件系统根时开 `indexForce`。
117
117
 
118
118
  ![Codegraph 设置卡片](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-codegraph.png)
119
119
 
@@ -142,6 +142,7 @@ dsh-plugin-kit 是给 DeepSeek Harness(DSH)Web GUI 用的通用插件集合
142
142
  - **终端按钮**:装了 tty ≥ 0.15.0 时,卡片第一个图标是「终端」——点击在**面板底部弹出终端抽屉**(tty 的 `ttyTerminal.mount` 就地嵌入),看着日志直接进容器敲命令,面板不收起;tty 为 0.14.0 时退回「新开终端标签 + 收面板」,更旧或未装则退化为复制命令。
143
143
  - **上下文入口**:装了 tty ≥ 0.13.0 时,SSH 标签的连接栏(SFTP 旁)会出现「容器」按钮——点击直接用当前会话那台主机打开面板(插件加载期间一直显示;目标在点击时按连接簿名 / `host:port` 解析,没配目标会提示怎么配)。
144
144
  - **目标**:`kind=local` 走宿主所在机器的 docker CLI;`kind=ssh` 可直接**引用 tty 连接簿条目名**(数据级复用,tty 零改动;未装 tty 时用内联 host/username),经 ssh2 exec channel 在远端执行,主机指纹 TOFU 钉扎并以 tty 已有记录作种子。
145
+ - **跨目标与需关注**:总览页一屏汇总全部目标(计数卡 + 跨目标异常表,单目标失败不影响其余);「需关注」口径覆盖不健康 / 反复重启 / **被 OOM 杀** / 非零退出 / 僵死,agent 侧 `docker_attention` 与 `docker_ps target:'*'` 同样支持跨目标聚合。
145
146
  - **支持**:容器列表(`all` 含已停止)、`docker inspect` 详情、日志(tail / 时间戳 / since)、**实时日志流**(FOLLOW 开关走 SSE `docker logs --follow`,本地与 SSH 目标都支持,自动滚动 / 过滤着色与快照共用,容器退出自动切回快照)、`docker stats` **快照 + 实时流**(SSE,60 点 sparkline 看 CPU / 内存趋势;这条流不会自然结束,前端主动断)、**Compose 项目视图**(按 `composeProject` / `composeService` 分组,项目级聚合日志在客户端按 `[service]` 前缀混流)、**容器事件活动流**(SSE `docker events` → 列表头部「活动」条 + 500ms 防抖刷新容器列表)、**网络与卷**(列表 + 详情:子网 / 网关 / 接入容器、挂载点 / 选项 / 标签;删除与 prune 需 `allowMutations`)、**多目标总览**(不选目标一屏看全部主机:计数卡 + 异常容器置顶表;并行取数、单目标失败只影响自己那一格;只读、无跨目标操作)、以及**容器列表多选的临时聚合日志**(勾 2~8 个容器即开混流)、镜像列表 + **镜像详情**(`docker image inspect` 的层 / 大小 + `docker history` 构建历史)、**`docker pull` 进度流**(SSE 逐层)、镜像删除 / dangling 清理(需 `allowMutations`)、一次性 exec(返回退出码与 stdout/stderr);`dockerBin` 可填 `podman`;输出超限自动截断。四条 SSE 长流(日志 / 统计 / 事件 / 拉取)共用同一份 `openSseStream` 基建(心跳 / 活跃流登记 / 断开清理)。
146
147
  - **安全模型(重点)**:docker socket ≈ 目标主机 root 权限,因此**默认只读**——`allowMutations` 未开启时启停删被拒(HTTP 403,工具不注册),`allowExec` 未开启时 exec 被拒;容器名 / ID 过白名单校验,命令一律 argv 构造 + 单引号转义;密码 / 口令建议 `env:VAR` 引用且永不回传浏览器。
147
148
  - **存哪里**:settings 命名空间 `docker`(`~/.dsh/settings.yaml`)。
@@ -165,14 +166,14 @@ dsh-plugin-kit 是给 DeepSeek Harness(DSH)Web GUI 用的通用插件集合
165
166
  - **存哪里**:`~/.dsh/prompts.yml` 的托管区块。
166
167
  - **注意**:每个 Prompt 至少一个版本,单版本内容 ≤ 500KB。
167
168
 
168
- ![Prompt 管理插件](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-promat.png)
169
+ ![Prompt 管理插件](https://cdn.jsdelivr.net/gh/hyzyn/dsh-plugin-kit@main/docs/dsh-plugin-kit-prompt.png)
169
170
 
170
171
  ## 快速开始
171
172
 
172
173
  ### 系统要求
173
174
 
174
175
  - 已安装 DeepSeek Harness,`dsh web` 可正常启动。当前实测基线为 DSH `0.1.5-rc.2`(宿主路由、浏览器半体、systemPrompt 注入、MCP 托管行全链路)。
175
- - 插件可用 `engines.dsh` 声明支持的 DSH 版本线(如 `@hyzyn/dsh-codegraph` 声明 `>=0.1.2-rc.1 <0.2.0`),插件市场据此显示兼容 / 不兼容;未声明的包在市场里显示为「未知」。
176
+ - 每个可安装插件都在 `dsh.engines.dsh` 声明支持的 DSH 版本线(本仓库统一 `>=0.1.2-rc.1`),插件市场据此显示兼容 / 不兼容;未声明的包显示为「未知」。**只支持 `>=X.Y.Z[-预发布]` 一种形式**:`^0.1.2`、`~0.1.2`、两段式 `>=0.1.2-rc.1 <0.2.0` 都会被判成「无法验证」,而已声明却无法验证是 fail-closed——更新会被直接拦下,比不声明更糟。CI 跑 `node scripts/check-dsh-engines.mjs` 兜底。
176
177
  - npm 安装方式无额外要求;从仓库安装需要 Node.js >= 22.19 与 pnpm 10。
177
178
 
178
179
  ### 三步上手
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyzyn/dsh-plugin-kit",
3
- "version": "0.1.20",
3
+ "version": "0.1.22",
4
4
  "type": "module",
5
5
  "description": "通用 DSH 插件库(pnpm monorepo):模板插件、插件开发工具包、一键聚合安装包。根包同时是全家桶 bundle(dsh.bundle.patch),DSH 与插件市场可直接识别安装。",
6
6
  "main": "lib/index.js",
@@ -11,6 +11,9 @@
11
11
  "dsh": {
12
12
  "bundle": {
13
13
  "patch": "./cordis.patch.yml"
14
+ },
15
+ "engines": {
16
+ "dsh": ">=0.1.2-rc.1"
14
17
  }
15
18
  },
16
19
  "devDependencies": {
@@ -35,15 +38,15 @@
35
38
  "access": "public"
36
39
  },
37
40
  "dependencies": {
38
- "@hyzyn/dsh-codegraph": "0.2.0",
39
- "@hyzyn/dsh-docker": "0.4.0",
40
- "@hyzyn/dsh-env": "0.2.2",
41
- "@hyzyn/dsh-mcp": "0.1.9",
42
- "@hyzyn/dsh-profile": "0.1.7",
43
- "@hyzyn/dsh-prompt": "0.1.8",
44
- "@hyzyn/dsh-rss": "0.3.0",
45
- "@hyzyn/dsh-search": "0.3.0",
46
- "@hyzyn/dsh-tty": "0.17.0"
41
+ "@hyzyn/dsh-codegraph": "0.2.2",
42
+ "@hyzyn/dsh-docker": "0.5.0",
43
+ "@hyzyn/dsh-env": "0.2.3",
44
+ "@hyzyn/dsh-mcp": "0.1.10",
45
+ "@hyzyn/dsh-profile": "0.1.8",
46
+ "@hyzyn/dsh-prompt": "0.1.9",
47
+ "@hyzyn/dsh-rss": "0.3.1",
48
+ "@hyzyn/dsh-search": "0.3.1",
49
+ "@hyzyn/dsh-tty": "0.17.1"
47
50
  },
48
51
  "scripts": {
49
52
  "build": "pnpm -r build",