dsh-as-mcp 0.52.83 → 0.52.84

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/CHANGELOG.md CHANGED
@@ -6,6 +6,29 @@ plugin is pre-1.0, so a minor bump is a feature and a patch is a fix or docs.
6
6
  A Chinese summary of every release lives in [CHANGELOG.zh.md](./CHANGELOG.zh.md);
7
7
  this file stays the authoritative record.
8
8
 
9
+ ## 0.52.84
10
+
11
+ - The GitHub-install instructions now lead with the approval that keeps working. pnpm matches a
12
+ git dependency's build by `<name>@<git url>` with no `#<ref>`, so one `allowBuilds` entry covers
13
+ every later commit; the previous text led with the commit-pinned key pnpm prints
14
+ (`…/tar.gz/<sha>: true`), which stops matching on the next push and forced a fresh manual
15
+ approval on every update. The section also states the correct floor for the two commands it
16
+ documents — `github:…` and a release `.tgz` are both fetched as tarballs, so the repository form
17
+ needs pnpm ≥11.19.0 (11.11.0 only covers cloned git dependencies), and pnpm 10 names the same
18
+ decision `onlyBuiltDependencies` — and points at the channels that need no build approval: `npm`
19
+ and the prebuilt Release asset, neither of which runs `prepare`.
20
+ - `tools/check-docs.mjs` now fails when either README's git-install guidance drifts from the
21
+ package's own identity. While `package.json` keeps a `prepare` script and `lib/` stays
22
+ gitignored, both languages must carry the manifest-derived key
23
+ (`dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git`) and name
24
+ `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`. A package or repository rename, or making the build
25
+ unnecessary, therefore breaks the release check instead of silently leaving readers a key that
26
+ matches nothing. Issue #1 is why this exists: a Plugin Hub 1.6.5 install fell back to the git
27
+ channel after its own npm lookup missed this package, pnpm's build gate refused the `prepare`
28
+ run, and DSH's generic hint left the reporter to copy a key by hand.
29
+ - Install guidance is the only change: the built `lib/` and every tool behave as in 0.52.83, apart
30
+ from the version the MCP `initialize` result advertises.
31
+
9
32
  ## 0.52.83
10
33
 
11
34
  - A first-time MCP client now learns the reporting contract where it actually looks. The `initialize`
package/CHANGELOG.zh.md CHANGED
@@ -6,6 +6,12 @@
6
6
  - 两份文件的**版本标题必须完全一致**(集合与顺序),由 `tools/check-docs.mjs` 强制检查——发布时漏写中文条目会让检查失败,中文读者不会悄悄落后一个版本。
7
7
  - 版本号遵循 SemVer;项目仍是 pre-1.0,所以 minor 是功能,patch 是修复或文档。
8
8
 
9
+ ## 0.52.84
10
+
11
+ - GitHub 安装指引改为先给「能长期有效的放行方式」:pnpm 按 `<name>@<git url>`(不带 `#<ref>`)匹配 git 依赖的构建,一条 `allowBuilds` 条目就能覆盖之后的所有 commit;原文先让读者抄 pnpm 打印的、钉在 commit 上的 key(`…/tar.gz/<sha>: true`),上游一 push 就失效,每更新一次都得重新手动放行。同时纠正本页两条命令的实际门槛:`github:…` 与 release `.tgz` 都按 tarball 拉取,所以按仓库 URL 放行需要 pnpm ≥11.19.0(11.11.0 只覆盖克隆形式的 git 依赖);pnpm 10 上该开关叫 `onlyBuiltDependencies`。并新增「不放行构建」的通道:npm 与预构建的 Release 资产,两者都不执行 `prepare`。
12
+ - `tools/check-docs.mjs` 新增漂移检查:只要 `package.json` 还带 `prepare` 且 `lib/` 仍在 `.gitignore` 里,中英两份 README 就必须带上由 manifest 推导出的 key(`dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git`)并点名 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`;改包名或仓库名、或提交 `lib/` 删掉 `prepare`,检查会失败或自动不再要求这段——不会再把一个匹配不上任何东西的 key 留在文档里。这条来自 issue #1:Plugin Hub 1.6.5 自己的 npm 反查没命中本包、回退到 git 通道,pnpm 的构建门禁拦下 `prepare`,而 DSH 只打印通用提示,读者只能自己抄 key。
13
+ - 除上述安装说明外无行为变化:构建产物与各工具与 0.52.83 相同,差别只有 MCP `initialize` 宣告的版本号。
14
+
9
15
  ## 0.52.83
10
16
 
11
17
  - 首次接入的 MCP 客户端现在能在它真正会读的地方看到上报契约:`initialize` 指令、`session_prompt` 的描述与 `wait` 选项都写明"`wait: false` 启动 → 用 `session_status` 跟进(`waitMs` 让变化即刻返回)",以及失败通道(`turn.failure` = `{kind, message}`;正常完成不带 failure 块)。`session_prompt` 首次提供 output schema(含 `turn.failure`);`session_status` 的 output schema 从只有 `sessionId`/`running` 扩展为完整报告(`idleMs`、`stalled`、`failure`、`lastTurn`、`changed`、`waitedMs` 等),schema 感知的客户端不必猜。很多 MCP 宿主不会把 `initialize.instructions` 传给模型,所以工具描述才是唯一可靠的首屏说明——这些措辞现在由测试固定,而不是靠习惯维护。
package/README.md CHANGED
@@ -76,33 +76,52 @@ dsh plugin --profile <name> add github:xiseliuli/dsh-as-mcp
76
76
  ```
77
77
 
78
78
  A git install fetches source, not the built `lib/`, so pnpm must run this package's `prepare`
79
- script (`tsdown && node scripts/build-client.mjs`) to produce it. pnpm ≥10 refuses to run that
80
- script — and the `esbuild` postinstall the build depends on — until the profile allows them, so
81
- the first `add` fails with `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`.
82
-
83
- A bare package name in `allowBuilds` works for `esbuild` (a registry dependency) but never for
84
- `dsh-as-mcp` here: pnpm only approves a git-hosted build by its exact resolved key, never by
85
- name alone ([pnpm docs](https://pnpm.io/settings/build#allowbuilds)). The failed `add` prints
86
- that exact key in its error; copy it verbatim into the profile's `pnpm-workspace.yaml`
87
- (`~/.dsh/profiles/<name>/pnpm-workspace.yaml`) and re-run the `add`. Don't rely on pnpm having
88
- written a placeholder entry for you — on this failure path it does not. The result looks like:
79
+ script (`tsdown && node scripts/build-client.mjs`) to produce it. pnpm's supply-chain gate blocks
80
+ dependency build scripts by default — the `esbuild` postinstall the build needs included — until
81
+ the profile allows them, so the first `add` fails with `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`.
82
+ That refusal is pnpm's policy, not a packaging defect: a git dependency can execute arbitrary
83
+ code at install time, so pnpm requires an exact, explicit approval.
84
+
85
+ **Approve the build once, by repository URL.** pnpm matches a git dependency's build by
86
+ `<name>@<git url>` with no `#<ref>`, so a single entry keeps the build working across commits and
87
+ releases. On a profile whose pnpm is ≥11.19.0 — DSH 0.2.1-rc.5 bundles 11.28.5, and a successful
88
+ `add` names the version it used on its last line (`… using pnpm v…`) — add this to the profile's
89
+ `pnpm-workspace.yaml` (`~/.dsh/profiles/<name>/pnpm-workspace.yaml`) and re-run the `add`:
89
90
 
90
91
  ```yaml
91
92
  allowBuilds:
92
- '<the exact git spec pnpm wrote, including its commit hash>': true
93
+ 'dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git': true
93
94
  esbuild: true
94
95
  ```
95
96
 
96
- Treat that allowance as permission to run this package's code on your machine at install time;
97
- pin a commit (`github:xiseliuli/dsh-as-mcp#<sha>`) so a later push cannot silently change what runs.
98
- `dsh plugin add` runs the pnpm version DSH pins (v11.28.5 in DSH 0.2.1-rc.5 — its output ends with
99
- `using pnpm v…`), so the following applies only once DSH ships a newer pnpm. If the
100
- profile's pnpm is ≥11.19.0 (≥11.11.0 for a cloned, non-`github:` git dependency), you can instead
101
- approve the repository itself — `'dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git': true`, with
102
- no `#<sha>` — so a later commit on the same repo keeps building without re-approval; on an older
103
- pnpm the exact-commit key is your only option and needs re-approving after every update
104
- ([pnpm 11.11 release notes](https://pnpm.io/blog/releases/11.11-11.14),
105
- [pnpm/pnpm#12367](https://github.com/pnpm/pnpm/issues/12367)).
97
+ A bare name (`dsh-as-mcp: true`) never approves a git-hosted artifact; pnpm matches on the
98
+ identity, not the package name ([pnpm docs](https://pnpm.io/settings/build#allowbuilds)).
99
+
100
+ On an older pnpm (11.0–11.18) only the exact key works, because approving a tarball-fetched
101
+ `github:` dependency by repository URL landed in
102
+ [pnpm 11.19.0](https://github.com/pnpm/pnpm/releases/tag/v11.19.0) — both commands on this page
103
+ are fetched as tarballs (`github:…`, and a release `.tgz`). The failed `add` prints that exact key
104
+ pinned to the resolved commit; copy it verbatim, keeping it on one line if the terminal wrapped
105
+ it, and expect to re-approve after any update
106
+ ([pnpm/pnpm#12367](https://github.com/pnpm/pnpm/issues/12367)). Don't wait for pnpm to write the
107
+ entry for you: on this failure path it writes nothing. On pnpm 10 the same decision is
108
+ `onlyBuiltDependencies`, not `allowBuilds`; trust the key pnpm prints.
109
+
110
+ The approval is permission to run this package's build code on your machine at install time. If
111
+ you pin a commit (`github:xiseliuli/dsh-as-mcp#<sha>`), the key must carry that commit; the
112
+ repository-URL key above approves any commit from this repository.
113
+
114
+ **Without approving a build**, install a published artifact instead — both ship the built `lib/`
115
+ and never run `prepare`:
116
+
117
+ ```bash
118
+ dsh plugin --profile <name> add dsh-as-mcp
119
+ dsh plugin --profile <name> add \
120
+ https://github.com/xiseliuli/dsh-as-mcp/releases/download/v<version>/dsh-as-mcp-<version>.tgz
121
+ ```
122
+
123
+ Git installs also need DSH ≥ `0.1.5-rc.1` ([Compatibility](#compatibility)); an older runtime
124
+ refuses the plugin unless an exact-version exemption is granted with `dsh plugin allow-version`.
106
125
 
107
126
  **From a tarball:**
108
127
 
package/README.zh.md CHANGED
@@ -73,31 +73,47 @@ dsh plugin --profile <名称> add github:xiseliuli/dsh-as-mcp
73
73
  ```
74
74
 
75
75
  git 安装拉下来的是源码,不是构建产物 `lib/`,所以 pnpm 得跑本包的 `prepare` 脚本
76
- (`tsdown && node scripts/build-client.mjs`)才能把它建出来。pnpm ≥10 默认拒绝执行这个脚本——
77
- 连带它依赖的 `esbuild` 的 postinstall 也一并拦下——直到 profile 显式放行,所以第一次 `add` 会以
78
- `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED` 失败。
76
+ (`tsdown && node scripts/build-client.mjs`)才能把它建出来。pnpm 的供应链门禁默认拒绝执行
77
+ 依赖的构建脚本——连带它依赖的 `esbuild` 的 postinstall 也一并拦下——直到 profile 显式放行,
78
+ 所以第一次 `add` 会以 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED` 失败。这是 pnpm 的策略,不是打包
79
+ 缺陷:git 依赖在安装期可以执行任意代码,所以 pnpm 要求一次精确、明确的放行。
79
80
 
80
- `allowBuilds` 里写裸包名,对 `esbuild`(来自 registry)有效,但对这里的 `dsh-as-mcp` 永远无效:
81
- pnpm 只认 git 依赖精确解析出来的那个 key,不认包名
82
- ([pnpm 文档](https://pnpm.io/settings/build#allowbuilds))。失败的那次 `add` 会在报错里打印这个
83
- 精确 key;把它原样抄进 profile 的 `pnpm-workspace.yaml`(`~/.dsh/profiles/<名称>/pnpm-workspace.yaml`),
84
- 再重新跑一次 `add`。不要指望 pnpm 已经替你写好占位项——这条失败路径下它不会写。结果长这样:
81
+ **一次放行、按仓库 URL 生效(推荐)。** pnpm 按 `<name>@<git url>`(不带 `#<ref>`)匹配 git 依赖的
82
+ 构建,因此一条条目就能跨 commit、跨版本一直有效。profile 的 pnpm ≥11.19.0 时——DSH 0.2.1-rc.5
83
+ 自带 11.28.5,成功的那次 `add` 最后一行会写明用的版本(`… using pnpm v…`)——把下面这段写进
84
+ profile 的 `pnpm-workspace.yaml`(`~/.dsh/profiles/<名称>/pnpm-workspace.yaml`),再重跑 `add`:
85
85
 
86
86
  ```yaml
87
87
  allowBuilds:
88
- '<pnpm 写出来的那个精确 git spec,含 commit hash>': true
88
+ 'dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git': true
89
89
  esbuild: true
90
90
  ```
91
91
 
92
- 这个放行等于允许在你机器上、在安装阶段执行这个包的代码——建议钉死到某个 commit
93
- (`github:xiseliuli/dsh-as-mcp#<sha>`),免得后续的 push 悄悄改掉实际跑的代码。`dsh plugin add` 使用的是
94
- DSH 锁定的 pnpm 版本(DSH 0.2.1-rc.5 为 v11.28.5,输出末尾会打印 `using pnpm v…`),所以下面这条要等
95
- DSH 自带更新的 pnpm 后才适用。如果 profile 用的 pnpm
96
- ≥11.19.0(若是克隆而非 `github:` 这种 tarball 形式的 git 依赖,则 ≥11.11.0 即可),可以改为放行整个
97
- 仓库——`'dsh-as-mcp@git+https://github.com/xiseliuli/dsh-as-mcp.git': true`,不带 `#<sha>`——这样同一个仓库
98
- 之后再提交新 commit 也不用重新放行;更早的 pnpm 版本只能用精确 commit 的 key,每次更新都要重新放行一次
99
- ([pnpm 11.11 release notes](https://pnpm.io/blog/releases/11.11-11.14),
100
- [pnpm/pnpm#12367](https://github.com/pnpm/pnpm/issues/12367))。
92
+ 裸包名(`dsh-as-mcp: true`)永远不会放行 git 托管产物:pnpm 认的是带来源的身份,不是包名
93
+ ([pnpm 文档](https://pnpm.io/settings/build#allowbuilds))。
94
+
95
+ 更早的 pnpm(11.0–11.18)只认精确 key,因为「按仓库 URL 放行 tarball 形式的 `github:` 依赖」是
96
+ [pnpm 11.19.0](https://github.com/pnpm/pnpm/releases/tag/v11.19.0) 才有的——本页两条命令
97
+ (`github:…` 和 release `.tgz`)都是按 tarball 拉取的。失败的那次 `add` 会打印这个精确 key
98
+ (钉在解析出的 commit 上);原样抄过去,如果终端把 URL 折行了就拼回一行;并且此后**每次更新都要
99
+ 重新放行**([pnpm/pnpm#12367](https://github.com/pnpm/pnpm/issues/12367))。不要指望 pnpm 已经替你
100
+ 写好占位项:这条失败路径下它不会写。pnpm 10 上这个开关叫 `onlyBuiltDependencies` 而不是
101
+ `allowBuilds`,以报错里给出的 key 为准。
102
+
103
+ 这个放行等于允许在你机器上、在安装阶段执行这个包的构建代码。如果你把依赖钉死到某个 commit
104
+ (`github:xiseliuli/dsh-as-mcp#<sha>`),key 就必须带那个 commit;上面那条仓库 URL 形式放行的是
105
+ 本仓库的任意 commit。
106
+
107
+ **不想放行构建**,就装已经构建好的发布物——两者都带现成的 `lib/`,都不执行 `prepare`:
108
+
109
+ ```bash
110
+ dsh plugin --profile <名称> add dsh-as-mcp
111
+ dsh plugin --profile <名称> add \
112
+ https://github.com/xiseliuli/dsh-as-mcp/releases/download/v<版本>/dsh-as-mcp-<版本>.tgz
113
+ ```
114
+
115
+ git 安装还要求 DSH ≥ `0.1.5-rc.1`(见[兼容性](#兼容性));更老的运行时会拒绝加载,除非用
116
+ `dsh plugin allow-version` 授予精确版本豁免。
101
117
 
102
118
  **从 tarball:**
103
119
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-as-mcp",
3
- "version": "0.52.83",
3
+ "version": "0.52.84",
4
4
  "description": "Expose this DeepSeek Harness as an MCP server: create workspaces and sessions, drive DSH agents, edit files, run commands (foreground and background), fork/rename/rename-model sessions, and read exact token usage and cost receipts for every call.",
5
5
  "type": "module",
6
6
  "license": "MIT",