dsh-mcp-ops 0.2.1 → 0.3.0

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.md CHANGED
@@ -10,9 +10,12 @@ DeepSeek Harness(dsh)插件:在设置页管理 MCP 服务。
10
10
  工具枚举。同名冲突交给组合层(补丁层)声明的服务可以**接管 / 释放**。
11
11
  - **环境变量**:逐服务配置环境变量,勾选「密钥」的变量在配置文件里**不落明文**,真值只进 DSH 凭据库;
12
12
  另有**进程级环境变量**,统一注入 stdio 子进程(含密钥)。
13
- - **工具注入**:两种模式 —— **按需检索**(模型调用 `mcp_tool_search` 时才注入当前对话)与
14
- **全量注入**(每轮注入所有已启用工具);支持逐工具勾选。
15
- - **OAuth 授权**:远程 MCP(HTTP / SSE)服务的 OAuth 授权,浏览器回调与回环两种回调路径都可用。
13
+ - **工具注入**:两种模式 —— **按需加载**(官方 `toolLoading: 'on-demand'`:工具只进提示词目录,
14
+ agent 用 `mcp__<服务>__load_tools` 按需装载,**仅对发起装载的会话生效**)与 **全量注入**
15
+ (`eager`);两种模式下都可以逐工具关闭。
16
+ - **OAuth 授权**:远程 MCP(streamable-http)的 OAuth **委托官方 `dsh-mcp-client`** —— 本插件只声明
17
+ `oauth.credentialKey`,发现 / 客户端注册 / PKCE / 回调 / 换取与刷新 token 全部由官方承担,
18
+ 凭据落在 DSH 统一凭据库(`mcp-client/<id>`),授权状态显示在卡片上。
16
19
  - **配置真源**:`$DSH_HOME/.mcp.json`(缺省 `~/.dsh/.mcp.json`)—— 服务定义在 `mcpServers`,
17
20
  本插件的状态(注入模式、覆盖项、逐工具开关、进程级变量)在同一个文件的 `configs` 段,
18
21
  **就地写回**(只改必须改的字节,文件里的注释与未知键原样保留)。
@@ -25,16 +28,23 @@ DeepSeek Harness(dsh)插件:在设置页管理 MCP 服务。
25
28
 
26
29
  ```sh
27
30
  # 已发布到 npm 仓库(固定版本;不写 @<版本> 则装 latest)
28
- dsh plugin --profile web add dsh-mcp-ops@0.2.1
31
+ dsh plugin --profile web add dsh-mcp-ops@0.3.0
29
32
 
30
33
  # 或本地 tarball(pnpm pack 的产物)
31
- dsh plugin --profile web add /path/to/dsh-mcp-ops-0.2.1.tgz
34
+ dsh plugin --profile web add /path/to/dsh-mcp-ops-0.3.0.tgz
32
35
 
33
36
  # 卸载
34
37
  dsh plugin --profile web remove dsh-mcp-ops
35
38
  ```
36
39
 
37
- **支持的 dsh 版本**:`0.2.2-rc.1` 及以后的 `0.2.x`(`engines.dsh: ^0.2.2-rc.1`、`engines.node: >=24.9.0`)。**不再支持 `0.2.1` 及更早**:旧闭包里 `system-prompt/assemble` 仍可改 `tools`、`tools.restrict()` 不作用于执行侧,本插件的可见性实现依赖"三面对齐",在旧闭包上会静默退化,因此宁可拒绝加载。
40
+ **支持的 dsh 版本**:`0.2.3` 及以后的 `0.2.x`(`engines.dsh: >=0.2.3-0 <0.3.0-0`、`engines.node: ^24.22.3 || >=26.13.1`)。**不再支持 `0.2.2` 及更早**:`0.2.3` 才提供 `oauth` 与 `toolLoading` 两个注册字段,本插件的 OAuth 与按需加载都建立在它们之上。
41
+
42
+ ### 0.3.0 的破坏性变更
43
+
44
+ - **OAuth 交给官方**:不再自建 `DSH_MCP_OAUTH_*` 凭据、不再注册回调路由。升级后旧的 OAuth 记录成为孤儿(**不会被删除**),需要重新授权一次。
45
+ - **注入模式改名**:`search` → `on-demand`、`full` → `eager`(首次读取时自动映射,落盘后只写新值)。
46
+ - **不再有 `mcp_tool_search` 与热集**:按需加载由官方的 `mcp__<服务>__load_tools` 承担;跨服务器关键词检索因此不再提供。
47
+ - **已知语义差异**:`on-demand` 下被关闭的工具仍会出现在官方目录里(目录由官方生成),但调用时会被拒绝。
38
48
 
39
49
  本包声明了 `dsh.bundle`,官方流程会自动把依赖写进 profile 的 `package.json` 并登记进
40
50
  `dsh.profile.bundles`,包内的 `cordis.patch.yml` 作为 bundle 层自动应用 —— 不需要手工编辑任何
@@ -52,7 +62,7 @@ pnpm pack --pack-destination docker # 打 tarball 供镜像构建(prepack 会
52
62
 
53
63
  ```
54
64
  src/host/ host 半部(构建出 lib/,esbuild bundle:false,保留 @deepseek-ai/* 导入)
55
- src/client/ 浏览器半部(构建出 lib/client.js,ModuleLoader wire format + CSS Modules)
65
+ src/client/ 浏览器半部(构建出 lib/client.js,ModuleLoader wire format + `meta().stylesheets`)
56
66
  scripts/ build-host / build-client / check-client-bundle / test / dsh-toolchain
57
67
  tests/unit/ 零依赖逻辑用例 tests/integration/ 需要 DSH 闭包与 lib/ 产物
58
68
  docker/ Dockerfile(官方 dsh plugin 命令装配)/ verify*.mjs / docker-compose.yaml
@@ -66,20 +76,37 @@ docs/ 详细设计与官方依赖落点
66
76
  - 版本号唯一来源是 `package.json` 的 `version`,改版本时同步 `docker/docker-compose.yaml` 的镜像标签;
67
77
  `docker/Dockerfile` 里的 tgz 名用通配符,不写死版本。
68
78
 
69
- 真机验证一律在本项目自己的容器里做(**不要**装进宿主 `~/.dsh`):
79
+ 真机验证一律在本项目自己的容器里做(**不要**装进宿主 `~/.dsh`)。**只有首次建容器、或
80
+ `docker/Dockerfile` 的 `BASE_IMAGE`(基线镜像)变了才重建镜像**;之后每轮都走热更新:
70
81
 
71
82
  ```sh
83
+ # 日常改动(host / client 都算):构建 → 打包 → 覆盖安装 → restart → 两条验收,不重建镜像
84
+ node scripts/verify.mjs
85
+
86
+ # 首次,或基线镜像变了:重建镜像并起容器(约 10 分钟)
72
87
  pnpm run --config.verify-deps-before-run=false build && pnpm pack --pack-destination docker &&
73
- docker build --progress=plain -t founder/dsh-mcp-ops:0.2.1 -f docker/Dockerfile docker/ &&
88
+ docker build --progress=plain -t founder/dsh-mcp-ops:0.3.0 -f docker/Dockerfile docker/ &&
74
89
  HOME=/home/ubuntu docker compose -f docker/docker-compose.yaml --project-directory docker up -d --force-recreate
90
+ ```
75
91
 
92
+ 手工只跑两条验收脚本时:
93
+
94
+ ```sh
76
95
  node docker/verify.mjs # 容器端到端(装配终态 / 启动日志 / 服务侧 sync / locale 元数据 / 客户端产物)
77
96
  TOKEN=$(docker logs dsh-mcp-ops 2>&1 | grep -o 'token=[A-Za-z0-9_-]*' | tail -1 | cut -d= -f2)
78
97
  docker exec -e DSH_GUI_URL="http://127.0.0.1:3080/?token=$TOKEN" dsh-mcp-ops \
79
98
  node "$PWD/docker/verify-gui.mjs" # 真实浏览器验收(含截图)
80
99
  ```
81
100
 
82
- 改客户端代码**必须重建镜像**:DSH 会缓存插件的客户端产物,换 `lib/client.js` 对浏览器无效。
101
+ 容器里没有仓库挂载时,`verify-gui.mjs`、`tests/fixtures/echo-mcp-server.mjs` 与 `locale/`
102
+ 要先 `docker cp` 进 `/tmp/gui`(路径约定见 `AGENTS.md`);用 `node scripts/verify.mjs` 则不用管,
103
+ 它会自己送。
104
+
105
+ 改客户端代码**不用重建镜像,但也不能只替换 `lib/client.js`**:镜像把 profile 打进
106
+ `/home/node/dsh-profiles-web.tar.gz`,容器的 entrypoint 每次启动都用它重置
107
+ `profiles/web/node_modules`,Web 壳又按产物内容算 `rev` —— 直接 `docker cp` 一个 `client.js`
108
+ 进去,服务端发出去的还是旧字节。`node scripts/verify.mjs` 走的是正路:打包新 tgz → 在容器**本地**
109
+ 的 profile 副本上跑官方 `dsh plugin add` → 重新打 profile tarball → `docker restart`,然后自动验收。
83
110
 
84
111
  ## 发布说明
85
112
 
@@ -99,8 +126,8 @@ npm publish --dry-run --registry=https://registry.npmjs.org/
99
126
  npm publish --registry=https://registry.npmjs.org/ --access public
100
127
 
101
128
  # 4) 发布后核对并打 tag
102
- npm view dsh-mcp-ops@0.2.1 --registry=https://registry.npmjs.org/
103
- git tag -a v0.2.1 -m "dsh-mcp-ops 0.2.1" && git push origin v0.2.1
129
+ npm view dsh-mcp-ops@0.3.0 --registry=https://registry.npmjs.org/
130
+ git tag -a v0.3.0 -m "dsh-mcp-ops 0.3.0" && git push origin v0.3.0
104
131
  ```
105
132
 
106
133
  72 小时内可 `npm unpublish dsh-mcp-ops@<版本>` 撤回;超时只能 `npm deprecate`。