dsh-any-agent 0.1.1 → 0.1.2

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
@@ -134,13 +134,22 @@ dsh-any-agent-setup --yes --permission read-only
134
134
  dsh-any-agent-setup --remove --yes # take it back out
135
135
  ```
136
136
 
137
- **From a local checkout**
137
+ **What `setup` will and will not touch**
138
+
139
+ It is additive. Verified against a real machine holding existing MCP servers (Cursor with four, Codex with two, Claude Code with five, Zed with 33 settings keys): every pre-existing entry survived unchanged, nothing was reformatted, and the only diff was one new key per client. Each of those four clients then answered an `initialize` handshake from the command written into its config.
140
+
141
+ ```
142
+ Cursor 4 -> 5 entries existing entries byte-identical
143
+ Codex 2 -> 3 sections node_repl and rea bodies unchanged
144
+ Claude Code 5 -> 6 servers all four originals still listed
145
+ Zed 33 -> 33 keys only context_servers gained a child
146
+ ```
138
147
 
139
- The `dsh-any-agent` executable is on your `PATH` after a global install, so every client below can call it by name. Otherwise point `command` at `node` and `args` at `<checkout>/server/bin/dsh-any-agent.mjs`.
148
+ The one thing it does modify in place is the JSON formatting of `mcp.json` and `settings.json` (it re-serialises with 2-space indent). Values are preserved; whitespace is not guaranteed to be. A `.bak-dsh-<timestamp>` copy sits beside each file it touched.
140
149
 
141
150
  **From a local checkout**
142
151
 
143
- Clone or unzip anywhere, then point `command` at `node` and `args` at `<checkout>/server/bin/dsh-any-agent.mjs` (shown below).
152
+ Clone or unzip anywhere, then point `command` at `node` and `args` at `<checkout>/bin/dsh-any-agent.mjs` (shown below).
144
153
 
145
154
  ---
146
155
 
@@ -463,6 +472,52 @@ When you first start this server it creates a DSH profile under `~/.dsh/profiles
463
472
 
464
473
  So the **product** is `dsh-any-agent`; the **persisted identifiers** keep the old name on purpose. This is a deliberate compatibility decision, not an oversight. If you are setting this up from scratch and want a different profile name, set `DSH_MCP_PROFILE` — the server will use whatever you give it.
465
474
 
475
+ ## 📦 Releasing
476
+
477
+ Checklist for cutting a version. The ordering matters; two of these steps exist because skipping them shipped a broken release.
478
+
479
+ ```bash
480
+ # 1. Bump the version. SERVER_VERSION reads package.json, so nothing else
481
+ # needs editing -- that duplication used to drift.
482
+ npm version patch --no-git-tag-version
483
+ # then update CHANGELOG.md by hand: move [Unreleased] into a new section
484
+
485
+ # 2. Prove it offline (same suites CI runs, no model, no DSH)
486
+ node test/guards.mjs && node test/prune.mjs
487
+ node test/approval-details.mjs && node test/setup.mjs
488
+ node test/package-check.mjs
489
+
490
+ # 3. Confirm the tarball itself: packs, installs, starts
491
+ npm pack --dry-run
492
+ # then, in a scratch dir: npm install <tgz> && node_modules/.bin/dsh-any-agent --version
493
+
494
+ # 4. Tag and push (CI must be green before publishing)
495
+ git add -A && git commit -m "chore: release x.y.z"
496
+ git tag vx.y.z && git push origin main --tags
497
+
498
+ # 5. Publish
499
+ npm publish
500
+ ```
501
+
502
+ **Do not trust a 404 after publishing.** npm processes new versions asynchronously (`PUT 202`, not `200`). Querying the registry a few seconds later still returns 404 and looks like failure. Confirm success from the local npm debug log first:
503
+
504
+ ```
505
+ grep 'http fetch PUT 202' "$LOCALAPPDATA/npm-cache/_logs/<latest>.log"
506
+ ```
507
+
508
+ then wait a minute or two and check `npm view dsh-any-agent dist-tags`.
509
+
510
+ **If a published version is broken, deprecate it — do not leave it installable.** `0.1.0` declared `node >=20` while actually requiring 22.15; anyone pinning it got a server that could not start:
511
+
512
+ ```bash
513
+ npm deprecate "dsh-any-agent@0.1.0" \
514
+ "Node 20 cannot start this version. Upgrade to 0.1.1+ (requires Node >=22.15)."
515
+ ```
516
+
517
+ `deprecate` prints a warning on install without unpublishing, which is the right tool: the tarball stays for anyone already depending on it. Note this needs an interactive OTP — granular access tokens with bypass-2FA are not allowed to perform it (npm restricted that in July 2026), so run it yourself rather than from CI.
518
+
519
+ **Badges lag.** shields.io caches for five minutes (`max-age=300`), so a fresh publish shows the old version, the old `node` floor, and sometimes `license: package not found` — that last string is shields' generic failure text for a license it could not read, not a missing license. Wait and hard-refresh before assuming the metadata is wrong.
520
+
466
521
  ## 💬 Support
467
522
 
468
523
  - **Bug reports, feature requests, setup questions** — [open an issue](https://github.com/xmtlzzz/dsh-any-agent/issues); all of it is welcome there
package/README.zh.md CHANGED
@@ -149,13 +149,22 @@ dsh-any-agent-setup --yes --permission read-only
149
149
  dsh-any-agent-setup --remove --yes # 全部移除
150
150
  ```
151
151
 
152
- **从本地目录安装**
152
+ **setup 会动什么、不会动什么**
153
+
154
+ 它只做新增。在真正装着别的 MCP 服务器的机器上验证过(Cursor 4 个、Codex 2 个段、Claude Code 5 个、Zed 33 个配置键):所有既有条目原样保留,没有被重新格式化,唯一的差异是每个客户端多了一个键。之后这四个客户端都用配置里写入的命令真实跑通了一次 `initialize` 握手。
155
+
156
+ ```
157
+ Cursor 4 -> 5 个条目 既有条目逐字节相同
158
+ Codex 2 -> 3 个段 node_repl 与 rea 内容不变
159
+ Claude Code 5 -> 6 个服务 原有四个都还在列表里
160
+ Zed 33 -> 33 个键 只有 context_servers 多了个子项
161
+ ```
153
162
 
154
- 全局安装后 `dsh-any-agent` 命令就在 `PATH` 上,下面每种客户端都可以直接按名字调用。否则把 `command` 指向 `node`、`args` 指向 `<解压目录>/server/bin/dsh-any-agent.mjs`。
163
+ 唯一会就地改动的是 `mcp.json` 和 `settings.json` 的**排版**(会按 2 空格缩进重新序列化)。值不变,但空白格式不保证原样。每个被改的文件旁边都留了 `.bak-dsh-<时间戳>` 备份。
155
164
 
156
165
  **从本地目录安装**
157
166
 
158
- 解压到任意位置,把 `command` 指向 `node`、`args` 指向 `<解压目录>/server/bin/dsh-any-agent.mjs`(见下)。
167
+ 解压到任意位置,把 `command` 指向 `node`、`args` 指向 `<解压目录>/bin/dsh-any-agent.mjs`(见下)。
159
168
 
160
169
  ---
161
170
 
@@ -480,6 +489,52 @@ DSH 的会话有**跨进程写锁**:**持有者活着就永不过期,也没
480
489
 
481
490
  所以**产品名**是 `dsh-any-agent`,**持久标识**故意保留旧名。这是刻意的兼容决定,不是漏改。如果你是全新部署、想要别的 profile 名,直接设 `DSH_MCP_PROFILE` —— 服务会照你给的名字用。
482
491
 
492
+ ## 📦 发布流程
493
+
494
+ 发版清单。顺序有讲究 —— 其中两步是因为跳过它们发过一次坏版本才补上的。
495
+
496
+ ```bash
497
+ # 1. 升版本号。SERVER_VERSION 读的是 package.json,别处不用改
498
+ # (以前这里有两份数字,漂移过)
499
+ npm version patch --no-git-tag-version
500
+ # 然后手工改 CHANGELOG.md:把 [Unreleased] 变成新版本一节
501
+
502
+ # 2. 本地跑一遍离线套件(和 CI 相同,不花 token、不需要 DSH)
503
+ node test/guards.mjs && node test/prune.mjs
504
+ node test/approval-details.mjs && node test/setup.mjs
505
+ node test/package-check.mjs
506
+
507
+ # 3. 确认 tarball 本身:打得出来、装得上、起得来
508
+ npm pack --dry-run
509
+ # 再在临时目录里:npm install <tgz> && node_modules/.bin/dsh-any-agent --version
510
+
511
+ # 4. 打 tag 并推送(CI 绿了再发)
512
+ git add -A && git commit -m "chore: release x.y.z"
513
+ git tag vx.y.z && git push origin main --tags
514
+
515
+ # 5. 发布
516
+ npm publish
517
+ ```
518
+
519
+ **发布后看到 404,不要当成失败。** npm 对新版本是异步入库(返回 `PUT 202` 而不是 `200`),几秒后去查 registry 仍然是 404,看起来像没发成功。先确认本地 npm 日志里有这一行:
520
+
521
+ ```
522
+ grep 'http fetch PUT 202' "$LOCALAPPDATA/npm-cache/_logs/<最新的>.log"
523
+ ```
524
+
525
+ 然后等一两分钟再查 `npm view dsh-any-agent dist-tags`。
526
+
527
+ **已发布的版本如果有问题,用 deprecate 而不是放着不管。** `0.1.0` 声明 `node >=20` 但实际需要 22.15,锁版本装它的人会得到一个起不来的服务:
528
+
529
+ ```bash
530
+ npm deprecate "dsh-any-agent@0.1.0" \
531
+ "Node 20 cannot start this version. Upgrade to 0.1.1+ (requires Node >=22.15)."
532
+ ```
533
+
534
+ `deprecate` 只在安装时打印警告、不删包 —— 这是对的工具:已经依赖它的人仍然能装到那个 tarball。注意这条**需要交互式 OTP**:带 bypass-2FA 的 granular token 不允许执行(npm 2026 年 7 月收紧的),所以要你自己跑,别放在 CI 里。
535
+
536
+ **徽章有延迟。** shields.io 缓存五分钟(`max-age=300`),所以刚发完会显示旧版本号、旧的 `node` 下限,有时还会显示 `license: package not found` —— 那个字符串是 shields 读不到 license 时的通用失败文案,不是真的没有 license。等一会并强制刷新,再判断元数据是不是错的。
537
+
483
538
  ## 💬 支持
484
539
 
485
540
  - **Bug、功能请求、部署提问** —— [提 issue](https://github.com/xmtlzzz/dsh-any-agent/issues),都往这里放
package/bin/setup.mjs CHANGED
@@ -159,7 +159,13 @@ const CLIENTS = [
159
159
  const { command, args } = launch();
160
160
  const envs = [];
161
161
  for (const [k, v] of Object.entries(desiredEnv())) envs.push('-e', k + '=' + v);
162
- const r = run(['mcp', 'add', NAME, '-s', 'user', ...envs, '--', command, ...args]);
162
+ // On Windows the child is spawned through cmd (shell: true), so an
163
+ // argument containing spaces must be quoted or it is split: a command of
164
+ // "C:\Program Files\nodejs\node.exe" arrives as "C:\Program" plus a
165
+ // stray "Files\nodejs\node.exe" argument, and Claude Code then fails
166
+ // to connect with CONNECTION_CLOSED. Quote anything with a space.
167
+ const quote = (s) => (IS_WIN && /\s/.test(s) ? '"' + s + '"' : s);
168
+ const r = run(['mcp', 'add', NAME, '-s', 'user', ...envs, '--', quote(command), ...args.map(quote)]);
163
169
  if (r.status !== 0) {
164
170
  return { error: tried(r).trim().split('\n')[0] || 'claude exited ' + r.status };
165
171
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-any-agent",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Drive DeepSeek Harness (DSH) as a long-lived coding agent from any MCP client — Claude Code, Codex, Cursor, or your own. Resume-aware, interruptible, approval-capable.",
5
5
  "type": "module",
6
6
  "license": "MIT",