dsh-baton-mcp 0.6.0-next.0 → 0.6.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
@@ -69,33 +69,55 @@ That is all. If Harness says it could not register, run `npx -y dsh-baton-mcp se
69
69
  - **Codex** waits inside `dsh_wait`, up to 270 s per call, just under its 300 s tool timeout. An unfinished wait returns only the state, so Codex calls again without summarising. Codex gets no `wait_command`: its terminal cannot wake it, so it would poll.
70
70
  - Codex asks you to approve MCP tool calls: approve the `dsh-baton` tools. For unattended `codex exec` runs, add `--approve-for-me`.
71
71
 
72
- **How a hand-over is checked** (from 0.6.0): the client sends the task with `checks`, the project's own test commands such as `npm test`. dsh-baton notes the folder's files before the run, and when the run ends it lists the files created, changed and deleted and runs the checks itself; this `evidence` comes from dsh-baton, not from the DeepSeek reply. The message also asks Harness to have a read-only sub-agent check the work against every requirement and end with a table (requirement, met, file:line). The client accepts from the evidence and that table, sends anything not met back in one message, and reads code only for rows not met. A new session starts in the folder the conversation works in unless `cwd` names another one.
72
+ **How a hand-over is checked** (from 0.6.0)
73
73
 
74
- ## Token usage
74
+ You don't have to take DeepSeek's word for it. Before the run, dsh-baton notes what is in the folder. When the run ends it shows exactly which files were created, changed or deleted, and runs your project's own tests itself (`npm test`, or whatever the client passes as `checks`). A second, read-only DeepSeek agent then goes through the request point by point and ends with a table: requirement, met or not, and where (file:line). Claude or GPT reads just that, sends anything missing back in one message, and opens code only where a row says "not met". Unless `cwd` names another folder, the new Harness session starts in the folder you're already working in.
75
75
 
76
- Measured on 2026-10-25/26 with plain-language requests (what a user would type, plus "hand it to DeepSeek Harness"), the same model in both arms, three runs per cell, and every run checked by the same hidden acceptance test. Cost per task at list price; DeepSeek at its peak price, the most conservative case:
76
+ <p align="center">
77
+ <img src="./docs/benchmarks/token-usage-2026-10/charts/evidence-chain.svg" width="100%" alt="Evidence chain of one real hand-over: the user asks, Codex writes the spec and checks, dsh-baton snapshots the folder, DeepSeek Harness writes 11 files, dsh-baton lists the changed files and runs npm test itself, Codex sends one fix back on its own, dsh-baton checks again, Codex accepts, and the benchmark's own test passes 13 of 13">
78
+ </p>
77
79
 
78
- | Task | Claude Code alone | Claude Code → 0.6.0 | Codex alone | Codex → 0.6.0 |
79
- |---|---|---|---|---|
80
- | Medium: CLI, modules, tests | $1.07 | $0.37 client, $0.55 with DeepSeek | $0.17 | $0.09 client, $0.29 with DeepSeek |
81
- | Large: web app, API, tests | $2.13 | $0.41 client, $0.70 with DeepSeek | $0.41 | $0.10 client, $0.41 with DeepSeek |
80
+ ## Token usage
82
81
 
83
- - **Claude Code** spends 65–81% less, and still about half or less once DeepSeek is added.
84
- - **Codex** (gpt-6.1-sol, high) spends half to three quarters less of its own model, so a ChatGPT Plus 5-hour window lasts more than twice as long: 0.8% instead of 1.9% per medium task, 1.0% instead of 4.3% per large one. Sol is cheap, so with DeepSeek added a medium task costs more in total than doing it in Codex, and a large one about the same; the saving is in the subscription quota. With a pricier model the total drops too.
85
- - All 12 runs of 0.6.0 passed the acceptance test the first time.
82
+ **In short: hand over the big, long jobs.** A feature that spans many files, a large refactor, a whole small app: that is where it saves the most. Claude Code's own bill drops by 65–81%, and Codex gets 2 to 4 times as many tasks out of a ChatGPT Plus 5-hour window.
86
83
 
87
- The [full report](./docs/benchmarks/token-usage-2026-10.md) has the method, every run, the earlier builds that were compared, raw data and scripts.
84
+ **The honest part:** for small and medium tasks, Codex on GPT-6.1 Sol is cheap enough that doing it alone costs less in total than handing it over. The hand-over pays off when you want Claude or GPT to plan and review, a cheaper model to do the typing, and you'd rather not keep hitting the 5-hour limit.
85
+
86
+ **Who this is for:** most of us pay for Claude or ChatGPT with a plan (Plus, Pro, Max 5x…), while DeepSeek is pay-as-you-go from a balance you top up, so every hand-over is money spent outside your plan. If your plan's limits already cover how you work, you don't need this: keep it simple and keep the money. If you're like me and keep running long, messy jobs with round after round of changes, and keep hitting the limit, a little DeepSeek spend gets you a lot more out of the plan you already pay for.
88
87
 
89
88
  <p align="center">
90
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-total-claude-release.svg" width="100%" alt="Claude Code cost per task: alone vs handed over, with and without the DeepSeek share">
91
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-total-codex-release.svg" width="100%" alt="Codex cost per task: alone vs handed over, with and without the DeepSeek share">
92
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-codex-quota-release.svg" width="100%" alt="Codex Plus 5-hour window used per task">
89
+ <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-combined.svg" width="100%" alt="Cost per task, working alone vs handed over with 0.6.0: Claude Code (Opus 5.5) and Codex (GPT-6.1 Sol, GPT-6 Astra), each on its own scale">
93
90
  </p>
94
91
 
92
+ Cost per task at list price, DeepSeek V4.1 Flash 1017 at its peak price:
93
+
94
+ | Client · model | Task | Alone | Handed over, client only | Handed over, with DeepSeek |
95
+ |---|---|---|---|---|
96
+ | Claude Code · Opus 5.5 high | Medium | $1.07 | $0.37 (−65%) | $0.55 (−49%) |
97
+ | Claude Code · Opus 5.5 high | Large | $2.13 | $0.41 (−81%) | $0.70 (−67%) |
98
+ | Codex · GPT-6.1 Sol high | Medium | $0.17 | $0.09 (−49%) | $0.29 (+73%) |
99
+ | Codex · GPT-6.1 Sol high | Large | $0.41 | $0.10 (−75%) | $0.41 (−2%) |
100
+ | Codex · GPT-6 Astra high | Medium | $0.79 | $0.45 (−43%) | $0.65 (−18%) |
101
+
102
+ Share of the ChatGPT Plus 5-hour window per task: Sol medium 1.9% → 0.8%, Sol large 4.3% → 1.0%, Astra medium 7% → 3%.
103
+
104
+ <details>
105
+ <summary>What was tested, and how</summary>
106
+
107
+ - **Two tasks, asked the way a user would** (the requests are in Chinese, linked as written):
108
+ - Medium: a command-line task manager in Node, no dependencies, split into modules, with tests. [Request](docs/benchmarks/token-usage-2026-10/natural/medium.md) · [acceptance check](docs/benchmarks/token-usage-2026-10/checks/natural-medium.mjs)
109
+ - Large: a task manager web app, Node server plus page, REST API, stats, tests and a README. [Request](docs/benchmarks/token-usage-2026-10/natural/large.md) · [acceptance check](docs/benchmarks/token-usage-2026-10/checks/natural-large.mjs)
110
+ - **The only difference** in the hand-over runs is one line added at the end: 交给 DeepSeek Harness 去做。 ("Hand it to DeepSeek Harness.")
111
+ - Same model and effort in both arms, three runs per cell (Astra: one run, medium only), and every run judged by the same acceptance check, which the model never sees. All 12 hand-over runs passed it the first time.
112
+ - Prices are list prices. DeepSeek is counted at its peak price, the most conservative case; the real DeepSeek bill came to about 58% of that.
113
+ - Every run, the raw data and the scripts: [run log](docs/benchmarks/token-usage-2026-10/LOG.md) and [full report](docs/benchmarks/token-usage-2026-10.md).
114
+
115
+ </details>
116
+
95
117
  ## Tools
96
118
 
97
119
  <p align="center">
98
- <img src="./assets/readme/tools.svg" width="100%" alt="Workspaces: list, create, rename. Sessions: list, read, activity, rename. Runs: send, status, wait, cancel, list runs">
120
+ <img src="./assets/readme/tools.svg" width="100%" alt="Nine tools in the tool list: list workspaces, list sessions, read session, send, status, wait, answer, cancel, call. Six less used tools are reached through dsh_call: create and rename workspace, session activity, rename session, update queued, list runs">
99
121
  </p>
100
122
 
101
123
  <p align="center">
@@ -108,19 +130,19 @@ The [full report](./docs/benchmarks/token-usage-2026-10.md) has the method, ever
108
130
  | Tool | What it does |
109
131
  |---|---|
110
132
  | `dsh_list_workspaces` | Workspaces in the Harness sidebar |
111
- | `dsh_create_workspace` | Register a folder as a workspace (creates the folder if missing); returns the existing one if already registered |
133
+ | `dsh_create_workspace` | Through `dsh_call`. Register a folder as a workspace (creates the folder if missing); returns the existing one if already registered |
112
134
  | `dsh_list_sessions` | Sessions newest first, with title, folder and running state; filter by folder or text. Archived sessions are left out |
113
135
  | `dsh_read_session` | Recent prompts and replies of one session (with tool names); `archived: true` for an archived session |
114
136
  | `dsh_send` | Send a message: `session_id` continues that session; otherwise a new one starts in `cwd` or `workspace_id`, or, with neither, in the folder the conversation works in (a `cwd` that is not a workspace yet is registered first; a `cwd` outside the conversation's folder is allowed and noted in `folder_note`). `checks`: test commands dsh-baton runs itself when the run ends (see How a hand-over is checked). Returns a `run_id` at once. In Harness the message is marked "Sent by Claude / ChatGPT from another chat". An archived session is refused: unarchive it in Harness, or start a new session. To a busy session, `mode` `followup` queues the message after the current turn and `steer` adds it to the running turn; left out, it does what Harness's own setting says (Settings → sending while busy: queue or steer), and `followup` when that cannot be read. `mode_source` says which applied |
115
137
  | `dsh_status` | Run progress: state, recent text and tool calls, final reply; `waiting_on` when the turn is over but sub-agents or jobs still run; `human_interjections` when someone typed in the Harness UI mid-run; state `interrupted` for a run cut short by a Harness restart |
116
138
  | `dsh_wait` | Wait for the run to end; a finished run carries `evidence` (files changed, check results) when the message was sent with `checks` (or until it stops to ask a person, see `dsh_answer`): up to 270 s per call for Codex, 50 s for other clients. Still going: returns `timed_out` with just the state; call it again. Clients that can wait in the background use `dsh_send`'s `wait_command` instead. `dsh_status` is a one-off look, not a way to wait |
117
139
  | `dsh_answer` | Answer the questions a run stopped to ask (Harness's ask_user_question): per question, an option number or label, free text, or skip; one at a time or all at once. `dsh_wait` and `wait_command` return as soon as a run asks, with the questions (`needs_input`, `question`; the option Harness's model would pick is in `harness_suggested`, apart from the labels). The assistant answers by its own judgment only when you told it to decide, and then passes `reason` and tells you what it chose and why; otherwise it brings you the questions, starting with its own recommendation and reason. You can also answer in the Harness window: whoever answers first wins |
118
- | `dsh_session_activity` | What a session is doing now: running turn, sub-agents (any depth), background jobs; `archived: true` for an archived session |
119
- | `dsh_update_queued` | Change a message still waiting in the queue of a busy session, by its `run_id`: `edit` its text, `remove` it, or `steer` it into the running turn now. Once it has reached the conversation it can no longer be changed |
140
+ | `dsh_session_activity` | Through `dsh_call`. What a session is doing now: running turn, sub-agents (any depth), background jobs; `archived: true` for an archived session |
141
+ | `dsh_update_queued` | Through `dsh_call`. Change a message still waiting in the queue of a busy session, by its `run_id`: `edit` its text, `remove` it, or `steer` it into the running turn now. Once it has reached the conversation it can no longer be changed |
120
142
  | `dsh_cancel` | Stop everything a session is doing, by `run_id` or `session_id`: turn, sub-agents, jobs. Harness also drops the messages waiting in its queue; their runs end as `cancelled` |
121
- | `dsh_rename_session` | Rename a session |
122
- | `dsh_rename_workspace` | Rename a workspace (sidebar title only; the folder is not moved) |
123
- | `dsh_list_runs` | Recent runs, optionally of one session |
143
+ | `dsh_rename_session` | Through `dsh_call`. Rename a session |
144
+ | `dsh_rename_workspace` | Through `dsh_call`. Rename a workspace (sidebar title only; the folder is not moved) |
145
+ | `dsh_list_runs` | Through `dsh_call`. Recent runs, optionally of one session |
124
146
  | `dsh_call` | Calls any `dsh_*` tool by name: the less used tools (create and rename workspace, rename session, session activity, update queued, list runs) are not in the tool list from 0.6.0 on, to keep every request short, and are reached this way; also for a conversation whose tool list predates an update. An unknown name lists the tools |
125
147
 
126
148
  </details>
@@ -164,13 +186,16 @@ When the plugin is unreachable, the MCP server falls back to Harness's `dsh head
164
186
 
165
187
  ## Install details
166
188
 
189
+ <details>
190
+ <summary>What the plugin does, updating, removing, upgrading from dsh-bridge, installing from source, Windows</summary>
191
+
167
192
  **What the plugin does when switched on.** It copies the MCP server to `~/.dsh-baton/app`, a folder that stays put, and writes the MCP entry into `~/.claude.json` and `~/.codex/config.toml` directly, keeping a `*.bak-dsh-baton` backup of each. It starts the server with your own Node.js ≥ 22.15 when it finds one on `PATH`; without one, with Harness's own runtime (the Harness app in Node mode, `ELECTRON_RUN_AS_NODE=1`), so nothing else has to be installed. Either way it works with only the desktop apps installed, when `claude` / `codex` are not on your `PATH`. It runs again on each Harness start: an entry that is already right, or a working one that starts another copy of dsh-baton, is left alone. In Harness, the source switches to the npm registry ("Official npm registry", 「npm 官方源」) by itself once you type the package name, and no restart is needed. To turn the registration off, set `DSH_BATON_AUTO_REGISTER=0` for Harness.
168
193
 
169
194
  **Updates need no restart.** When a newer version lands in `~/.dsh-baton/app` (a plugin update, `setup`, or a copy by hand), conversations already open in Claude Code and Codex use it from their next `dsh_*` call: the server checks the folder before each call, starts the new version, and says once in that call's result that it was updated. A `dsh_wait` that is already running finishes on the old version first. If the new version cannot start, the old one keeps working and the result says why. A tool added in the new version shows up in Claude Code at once (the server tells the client its tool list changed); Codex keeps the tool list a conversation started with, so it does not show a new tool until the next conversation; from 0.5.9 on it can still use one at once through `dsh_call`, which the update note points to, and the tools it already has run the new code right away. This works from the version after 0.5.8 on; a server started from 0.5.8 or earlier needs one last restart (or `/mcp` reconnect) to pick it up.
170
195
 
171
196
  **`npx -y dsh-baton-mcp setup`** does the same registration from a terminal: for a plugin that could not register, or when you come from an MCP directory. With the plugin already registered it changes nothing, then points you to the plugin if it is missing.
172
197
 
173
- **Updating.** Harness has an update button only for its official plugins, so: Plugins → dsh-baton-host → **Uninstall**, then **Add plugin** → `dsh-baton-host`. For a while after a release, Harness installs the previous version instead (pnpm's `minimumReleaseAge` holds back versions published very recently, and the install dialog says so); to get the new one at once, type the version: `dsh-baton-host@0.5.0`. Switched on again, the plugin brings the MCP server to the same version; new conversations use it. If the two are ever out of step, the first tool call that notices it says so.
198
+ **Updating.** Harness has an update button only for its official plugins, so: Plugins → dsh-baton-host → **Uninstall**, then **Add plugin** → `dsh-baton-host`. For a while after a release, Harness installs the previous version instead (pnpm's `minimumReleaseAge` holds back versions published very recently, and the install dialog says so); to get the new one at once, type the version: `dsh-baton-host@0.6.0`. A pre-release must always be added by its exact version, such as `dsh-baton-host@0.6.0-next.0`: Harness resolves `@next` to a broken placeholder. Plain `dsh-baton-host` gets the latest release. Switched on again, the plugin brings the MCP server to the same version; new conversations use it. If the two are ever out of step, the first tool call that notices it says so, naming the older side and the newer side's exact version to install.
174
199
 
175
200
  **Removing.** Harness → Plugins → dsh-baton-host → **Uninstall**, then `npx -y dsh-baton-mcp setup --remove`. The plugin cannot tell an uninstall from Harness quitting, so it leaves the MCP entries to that command, which also deletes `~/.dsh-baton/app`; run records stay in `~/.dsh-baton` until you delete it.
176
201
 
@@ -200,6 +225,8 @@ codex mcp add dsh-baton -- "$(command -v node)" "$PWD/dsh-baton/src/server.mjs"
200
225
 
201
226
  </details>
202
227
 
228
+ </details>
229
+
203
230
  ## Security and limits
204
231
 
205
232
  <p align="center">
package/README.zh-CN.md CHANGED
@@ -50,7 +50,7 @@ Codex 和 Claude 轮流往同一个 Harness 对话发消息,每条都标明是
50
50
 
51
51
  插件启用后会为 Claude Code 和 Codex 注册 dsh-baton(对所有文件夹生效),Harness 里会弹出提示。
52
52
 
53
- **2. 检查:**在 Claude Code 或 Codex 里**新开**一个对话,让它调用 `dsh_list_workspaces`,会列出你的 Harness 工作区。
53
+ **2. 检查**:在 Claude Code 或 Codex 里**新开**一个对话,让它调用 `dsh_list_workspaces`,会列出你的 Harness 工作区。
54
54
 
55
55
  就这些。如果 Harness 提示没能注册,在终端运行 `npx -y dsh-baton-mcp setup`(这需要 Node.js ≥ 22.15),它做的是同样的注册。更新、卸载和 Windows 说明在[后面](#安装细节)。
56
56
 
@@ -69,33 +69,55 @@ Codex 和 Claude 轮流往同一个 Harness 对话发消息,每条都标明是
69
69
  - **Codex** 在 `dsh_wait` 里等待,每次最多 270 秒,刚好低于它 300 秒的工具超时。没做完时只返回状态,Codex 会直接再调用,不会去总结进度。Codex 不会收到 `wait_command`:它的终端无法在命令结束时唤醒它,只能轮询。
70
70
  - Codex 调用 MCP 工具时会请你批准,批准 `dsh-baton` 的工具即可;无人值守的 `codex exec` 加上 `--approve-for-me`。
71
71
 
72
- **转交之后怎么验收**(0.6.0 起):客户端发任务时附上 `checks`,也就是项目自己的测试命令,比如 `npm test`。dsh-baton 在运行前记下文件夹里的文件,运行结束后自己列出新建、修改、删除了哪些文件,并自己跑一遍这些命令;这份 `evidence`(证据)来自 dsh-baton,不是 DeepSeek 的自述。消息末尾还会请 Harness 派一个只读子智能体,对照每条需求复查,最后附一张表(需求、是否满足、依据在哪个文件第几行)。客户端凭证据和这张表验收,没满足的一次性发回去修,只对没满足的行看代码。新开对话默认建在当前对话所在的文件夹,除非用 `cwd` 指定别的文件夹。
72
+ **转交之后怎么验收**(0.6.0 起)
73
73
 
74
- ## Token 用量实测
74
+ 不用光听 DeepSeek 自己说做完了。运行前,dsh-baton 先记下文件夹里有什么;运行结束后,它会列出到底新建、修改、删除了哪些文件,并亲自跑一遍项目自己的测试(`npm test`,或者客户端在 `checks` 里给的命令)。接着,另一个只读的 DeepSeek 子智能体会对照需求逐条检查,最后给一张表:哪条需求、做到没有、依据在哪个文件第几行。Claude 或 GPT 只看这些,没做到的一次性发回去改,只有表里写着「没做到」的地方才去翻代码。不用 `cwd` 指定的话,新对话就开在你当前工作的文件夹里。
75
75
 
76
- 2026-10-25/26 实测:用户用大白话提需求(末尾加一句「交给 DeepSeek Harness 去做」),两边用同一个模型,每格跑 3 次,每次都用同一套隐藏的验收脚本检查。下表是每个任务的平均花费,按标价计;DeepSeek 按高峰价,是最保守的算法:
76
+ <p align="center">
77
+ <img src="./docs/benchmarks/token-usage-2026-10/charts/evidence-chain.zh.svg" width="100%" alt="一次真实转交的证据链:用户提需求,Codex 写规格和验收命令,dsh-baton 给文件夹拍快照,DeepSeek Harness 写出 11 个文件,dsh-baton 自己列出改动并跑 npm test,Codex 主动打回一处,dsh-baton 再次验收,Codex 通过,基准测试自己的验收 13/13 通过">
78
+ </p>
77
79
 
78
- | 任务 | Claude Code 自己做 | Claude Code → 0.6.0 | Codex 自己做 | Codex → 0.6.0 |
79
- |---|---|---|---|---|
80
- | 中号:命令行工具、分模块、测试 | $1.07 | 主 Agent $0.37,含 DeepSeek $0.55 | $0.17 | 主 Agent $0.09,含 DeepSeek $0.29 |
81
- | 大号:网页应用、接口、测试 | $2.13 | 主 Agent $0.41,含 DeepSeek $0.70 | $0.41 | 主 Agent $0.10,含 DeepSeek $0.41 |
80
+ ## Token 用量实测
82
81
 
83
- - **Claude Code** 自己的花费少 65–81%,加上 DeepSeek 后总价也只有自己做的一半左右甚至更少。
84
- - **Codex**(gpt-6.1-sol,high)自己模型的花费少一半到四分之三,ChatGPT Plus 的 5 小时额度能多撑一倍以上:中号任务从 1.9% 降到 0.8%,大号从 4.3% 降到 1.0%。Sol 本身很便宜,加上 DeepSeek 后,中号的总价比 Codex 自己做还贵,大号基本持平;省下的是订阅额度。主模型越贵,总价也越省。
85
- - 0.6.0 的 12 次运行全部一次通过验收。
82
+ **一句话:大活、长活交给它**。一次性做一个跨很多文件的功能、一次大重构、一整个小应用,这种时候最省:Claude Code 自己的花费少 65–81%,Codex 在 ChatGPT Plus 一个 5 小时额度里能多做 2 到 4 倍的任务。
86
83
 
87
- [完整报告](./docs/benchmarks/token-usage-2026-10.md)里有方法、每一次运行、对比过的其他版本、原始数据和脚本。
84
+ **说实话**:中小任务,Codex 用 GPT-6.1 Sol 自己做,总价反而比转交更便宜。转交值得的场景是:你想让 Claude 或 GPT 负责规划和把关,让更便宜的模型去动手写,又不想老是撞上 5 小时额度上限。
85
+
86
+ **适合谁**:大多数人用 Claude 或 ChatGPT 走的是订阅套餐(Plus、Pro、Max 5x 之类),而 DeepSeek 是充值后按用量扣费,所以每次转交都是套餐之外多花的钱。如果你的套餐额度本来就够用,就不用折腾这套流程,省一点是一点。如果你像我一样,经常跑又长又杂、要反复修改的大任务,老是撞上额度上限,那花一点 DeepSeek 的钱,就能让你已经付费的套餐多干很多活。
88
87
 
89
88
  <p align="center">
90
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-total-claude-release.zh.svg" width="100%" alt="Claude Code 每个任务的花费:自己做与转交,含与不含 DeepSeek">
91
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-total-codex-release.zh.svg" width="100%" alt="Codex 每个任务的花费:自己做与转交,含与不含 DeepSeek">
92
- <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-codex-quota-release.zh.svg" width="100%" alt="Codex Plus 每个任务占用的 5 小时额度">
89
+ <img src="./docs/benchmarks/token-usage-2026-10/charts/natural-combined.zh.svg" width="100%" alt="每个任务的花费,自己做与用 0.6.0 转交:Claude Code(Opus 5.5)和 Codex(GPT-6.1 Sol、GPT-6 Astra),各用自己的刻度">
93
90
  </p>
94
91
 
92
+ 每个任务的花费,按标价计,DeepSeek V4.1 Flash 1017 按高峰价:
93
+
94
+ | 客户端 · 模型 | 任务 | 自己做 | 转交,只算客户端 | 转交,含 DeepSeek |
95
+ |---|---|---|---|---|
96
+ | Claude Code · Opus 5.5 high | 中号 | $1.07 | $0.37(−65%) | $0.55(−49%) |
97
+ | Claude Code · Opus 5.5 high | 大号 | $2.13 | $0.41(−81%) | $0.70(−67%) |
98
+ | Codex · GPT-6.1 Sol high | 中号 | $0.17 | $0.09(−49%) | $0.29(+73%) |
99
+ | Codex · GPT-6.1 Sol high | 大号 | $0.41 | $0.10(−75%) | $0.41(−2%) |
100
+ | Codex · GPT-6 Astra high | 中号 | $0.79 | $0.45(−43%) | $0.65(−18%) |
101
+
102
+ 每个任务占 ChatGPT Plus 5 小时额度:Sol 中号 1.9% → 0.8%,Sol 大号 4.3% → 1.0%,Astra 中号 7% → 3%。
103
+
104
+ <details>
105
+ <summary>测了什么、怎么测的</summary>
106
+
107
+ - **两个任务,用普通用户的口吻提**(原文如下,可以直接点开看):
108
+ - 中号:用 Node 写一个命令行任务管理工具,零依赖,分模块,带测试。[需求原文](docs/benchmarks/token-usage-2026-10/natural/medium.md) · [验收脚本](docs/benchmarks/token-usage-2026-10/checks/natural-medium.mjs)
109
+ - 大号:一个任务管理网页应用,Node 服务器加前端页面,REST 接口、统计、测试和 README。[需求原文](docs/benchmarks/token-usage-2026-10/natural/large.md) · [验收脚本](docs/benchmarks/token-usage-2026-10/checks/natural-large.mjs)
110
+ - **转交组唯一的区别**,是在需求末尾多一句:交给 DeepSeek Harness 去做。
111
+ - 两组用同一个模型、同样的推理强度,每格跑 3 次(Astra 只跑了中号,各 1 次);每次都用同一套验收脚本检查,模型看不到这个脚本。转交组 12 次全部一次通过。
112
+ - 价格按标价算。DeepSeek 按高峰价,是最保守的算法;实际 DeepSeek 账单大约是这个数的 58%。
113
+ - 每一次运行、原始数据和脚本:[运行日志](docs/benchmarks/token-usage-2026-10/LOG.md)、[完整报告](docs/benchmarks/token-usage-2026-10.md)。
114
+
115
+ </details>
116
+
95
117
  ## 工具
96
118
 
97
119
  <p align="center">
98
- <img src="./assets/readme/zh/tools.svg" width="100%" alt="工作区:列出、新建、改名。对话:列出、读取、当前活动、改名。运行:发送、状态、等待、取消、列出最近运行">
120
+ <img src="./assets/readme/zh/tools.svg" width="100%" alt="工具列表里有 9 个:列出工作区、列出对话、读取对话、发送、状态、等待、回答、取消、dsh_call。另外 6 个不常用的经 dsh_call 调用:新建和改名工作区、对话动态、给对话改名、修改排队消息、列出运行">
99
121
  </p>
100
122
 
101
123
  <p align="center">
@@ -108,19 +130,19 @@ Codex 和 Claude 轮流往同一个 Harness 对话发消息,每条都标明是
108
130
  | 工具 | 作用 |
109
131
  |---|---|
110
132
  | `dsh_list_workspaces` | 列出 Harness 侧边栏里的工作区 |
111
- | `dsh_create_workspace` | 把一个文件夹登记为工作区(文件夹不存在会先创建);已登记的直接返回原来那个 |
133
+ | `dsh_create_workspace` | 经 `dsh_call` 调用。把一个文件夹登记为工作区(文件夹不存在会先创建);已登记的直接返回原来那个 |
112
134
  | `dsh_list_sessions` | 列出对话(最新在前),带标题、目录、是否在跑;可按目录或关键字过滤。已归档的对话不会列出 |
113
135
  | `dsh_read_session` | 读某个对话最近的消息和回复(含用到的工具名);已归档的对话会带 `archived: true` |
114
136
  | `dsh_send` | 发消息。带 `session_id` 续接那个对话;否则新开对话,建在 `cwd` 或 `workspace_id` 指定的位置,都不带时建在当前对话所在的文件夹(`cwd` 还不是工作区时会先登记;指定的 `cwd` 在当前对话文件夹之外也可以,结果里的 `folder_note` 会提醒)。`checks`:运行结束后 dsh-baton 自己跑的测试命令(见「转交之后怎么验收」)。立即返回 `run_id`。Harness 里这条消息会标注「由 Claude / ChatGPT 从另一个聊天发送」。已归档的对话会被拒绝:先在 Harness 里取消归档,或新开对话。对话正忙时,`mode` 为 `followup` 会排在当前回合之后,`steer` 会插进正在跑的回合;不传时跟随 Harness 自己的设置(设置 → 繁忙时的发送行为:排队发送或插话发送),读不到设置时按 `followup`。返回里的 `mode_source` 说明用的是哪种 |
115
137
  | `dsh_status` | 查看运行进度:状态、最近的文字和工具调用、最终回复;回合结束但子智能体/后台任务还在跑时给出 `waiting_on`;中途有人在 Harness 界面里发消息时给出 `human_interjections`;被 Harness 重启打断的任务状态为 `interrupted` |
116
138
  | `dsh_wait` | 等运行结束;发消息时带了 `checks` 的,结束后会附上 `evidence`(改了哪些文件、测试结果)(或者等到它停下来问人,见 `dsh_answer`):Codex 每次最多等 270 秒,其他客户端 50 秒。没做完会带 `timed_out`,只返回状态,再调用一次即可。能在后台等待的客户端改用 `dsh_send` 返回的 `wait_command`。`dsh_status` 只用来看一眼,不用来等待 |
117
139
  | `dsh_answer` | 回答运行中途提出的问题(Harness 的 ask_user_question):每道题可以填选项编号或选项文字、自由填写,或者跳过;可以逐题回答,也可以一次答完。运行一提问,`dsh_wait` 和 `wait_command` 就会立刻返回,并带上题目(`needs_input`、`question`;Harness 那边模型推荐的选项单独放在 `harness_suggested` 里,不再写在选项文字中)。只有你说过让它自己决定时,助手才会按自己的判断回答,这时它会带上 `reason`,并告诉你选了什么、为什么;否则它会把题目转给你,开头先写它自己的建议和理由。你也可以直接在 Harness 窗口里回答,谁先答就算谁的 |
118
- | `dsh_session_activity` | 对话此刻在做什么:正在跑的回合、子智能体(任意层级)、后台任务;已归档的对话会带 `archived: true` |
119
- | `dsh_update_queued` | 按 `run_id` 修改还在忙碌对话队列里等待的消息:`edit` 改文字,`remove` 撤回,`steer` 立刻插进正在跑的回合。消息一旦进入对话就改不了了 |
140
+ | `dsh_session_activity` | 经 `dsh_call` 调用。对话此刻在做什么:正在跑的回合、子智能体(任意层级)、后台任务;已归档的对话会带 `archived: true` |
141
+ | `dsh_update_queued` | 经 `dsh_call` 调用。按 `run_id` 修改还在忙碌对话队列里等待的消息:`edit` 改文字,`remove` 撤回,`steer` 立刻插进正在跑的回合。消息一旦进入对话就改不了了 |
120
142
  | `dsh_cancel` | 按 `run_id` 或 `session_id` 停掉整个对话的工作:当前回合、子智能体、后台任务。Harness 会同时清掉队列里等待的消息,这些运行记为 `cancelled` |
121
- | `dsh_rename_session` | 给对话改名 |
122
- | `dsh_rename_workspace` | 给工作区改名(只改侧边栏标题,不动文件夹) |
123
- | `dsh_list_runs` | 列出最近的运行,可按会话筛选 |
143
+ | `dsh_rename_session` | 经 `dsh_call` 调用。给对话改名 |
144
+ | `dsh_rename_workspace` | 经 `dsh_call` 调用。给工作区改名(只改侧边栏标题,不动文件夹) |
145
+ | `dsh_list_runs` | 经 `dsh_call` 调用。列出最近的运行,可按会话筛选 |
124
146
  | `dsh_call` | 按名字调用任意 `dsh_*` 工具:0.6.0 起,不常用的工具(新建和重命名工作区、重命名对话、对话动态、修改排队消息、运行列表)不再出现在工具列表里,好让每次请求更短,改由这里调用;对话的工具列表还是更新前的旧版时也用它。名字不存在时会列出所有可用工具 |
125
147
 
126
148
  </details>
@@ -166,21 +188,24 @@ dsh-baton rename-workspace ~/code/new-app 新名字
166
188
 
167
189
  ## 安装细节
168
190
 
169
- **插件启用时做了什么。**它把 MCP 服务器复制到 `~/.dsh-baton/app` 这个固定的文件夹,再直接把 MCP 注册写进 `~/.claude.json` 和 `~/.codex/config.toml`,各留一份 `*.bak-dsh-baton` 备份。电脑上有 Node.js ≥ 22.15(在 `PATH` 里能找到)就用它启动服务器;没有的话,就用 Harness 自带的运行环境(Harness 应用本身以 Node 模式运行,`ELECTRON_RUN_AS_NODE=1`),不用另外安装任何东西。两种情况下,只装了桌面应用、`claude` / `codex` 不在 `PATH` 里也能用。每次 Harness 启动都会再检查一遍:已经正确的注册、或者指向另一份可用 dsh-baton 的注册,都不会改动。在 Harness 里输入包名后,安装源会自动切到「npm 官方源」(英文界面是 "Official npm registry"),不用另外选择,也不用重启。不想让插件自动注册,给 Harness 设置 `DSH_BATON_AUTO_REGISTER=0`。
191
+ <details>
192
+ <summary>插件做了什么、更新、卸载、从 dsh-bridge 升级、从源码安装、Windows</summary>
193
+
194
+ **插件启用时做了什么**。它把 MCP 服务器复制到 `~/.dsh-baton/app` 这个固定的文件夹,再直接把 MCP 注册写进 `~/.claude.json` 和 `~/.codex/config.toml`,各留一份 `*.bak-dsh-baton` 备份。电脑上有 Node.js ≥ 22.15(在 `PATH` 里能找到)就用它启动服务器;没有的话,就用 Harness 自带的运行环境(Harness 应用本身以 Node 模式运行,`ELECTRON_RUN_AS_NODE=1`),不用另外安装任何东西。两种情况下,只装了桌面应用、`claude` / `codex` 不在 `PATH` 里也能用。每次 Harness 启动都会再检查一遍:已经正确的注册、或者指向另一份可用 dsh-baton 的注册,都不会改动。在 Harness 里输入包名后,安装源会自动切到「npm 官方源」(英文界面是 "Official npm registry"),不用另外选择,也不用重启。不想让插件自动注册,给 Harness 设置 `DSH_BATON_AUTO_REGISTER=0`。
170
195
 
171
- **更新不用重启。**新版本装进 `~/.dsh-baton/app` 后(插件更新、`setup` 或手动复制),Claude Code 和 Codex 里已经开着的对话,下一次调用 `dsh_*` 工具时就会用上:服务器每次调用前检查这个文件夹,启动新版本,并在这次调用的结果里提示一次已经更新。正在进行的 `dsh_wait` 会先在旧版本里跑完。新版本启动失败时,旧版本继续工作,结果里会说明原因。新版本新增的工具,Claude Code 里马上就能用(服务器会通知客户端工具列表变了);Codex 一直用对话开始时的工具列表,新工具要到下一个新对话才会显示;从 0.5.9 起,旧对话里也能通过 `dsh_call` 马上用上新功能(更新提示里会写明),已有的工具也会立刻用上新代码。这个功能从 0.5.8 之后的版本开始有效;由 0.5.8 或更早版本启动的服务器,还需要最后重启一次(或在 `/mcp` 里重新连接)。
196
+ **更新不用重启**。新版本装进 `~/.dsh-baton/app` 后(插件更新、`setup` 或手动复制),Claude Code 和 Codex 里已经开着的对话,下一次调用 `dsh_*` 工具时就会用上:服务器每次调用前检查这个文件夹,启动新版本,并在这次调用的结果里提示一次已经更新。正在进行的 `dsh_wait` 会先在旧版本里跑完。新版本启动失败时,旧版本继续工作,结果里会说明原因。新版本新增的工具,Claude Code 里马上就能用(服务器会通知客户端工具列表变了);Codex 一直用对话开始时的工具列表,新工具要到下一个新对话才会显示;从 0.5.9 起,旧对话里也能通过 `dsh_call` 马上用上新功能(更新提示里会写明),已有的工具也会立刻用上新代码。这个功能从 0.5.8 之后的版本开始有效;由 0.5.8 或更早版本启动的服务器,还需要最后重启一次(或在 `/mcp` 里重新连接)。
172
197
 
173
198
  **`npx -y dsh-baton-mcp setup`** 在终端里做同样的注册:用于插件没能注册的情况,或者从 MCP 目录过来的用户。插件已经注册过时它什么都不改;插件没装的话,它会提示去添加。
174
199
 
175
- **更新。**Harness 只给官方插件提供"更新"按钮,所以要:插件 → dsh-baton-host → **卸载**,再**添加插件** → `dsh-baton-host`。新版本刚发布的一段时间里,Harness 会装上一个版本(pnpm 的 `minimumReleaseAge` 会暂缓刚发布的版本,安装弹窗里会说明);想马上用新版,输入带版本号的名字:`dsh-baton-host@0.5.0`。重新启用后,插件会把 MCP 服务器也更新到同一版本,新开的对话就会用上。万一两边版本对不上,第一次发现不一致的工具调用会提示。
200
+ **更新**。Harness 只给官方插件提供"更新"按钮,所以要:插件 → dsh-baton-host → **卸载**,再**添加插件** → `dsh-baton-host`。新版本刚发布的一段时间里,Harness 会装上一个版本(pnpm 的 `minimumReleaseAge` 会暂缓刚发布的版本,安装弹窗里会说明);想马上用新版,输入带版本号的名字:`dsh-baton-host@0.6.0`。预发布版必须写确切版本号添加,比如 `dsh-baton-host@0.6.0-next.0`:Harness 会把 `@next` 解析成一个坏掉的占位包。只输入 `dsh-baton-host` 装的是最新正式版。重新启用后,插件会把 MCP 服务器也更新到同一版本,新开的对话就会用上。万一两边版本对不上,第一次发现不一致的工具调用会提示,并写明哪一边旧、另一边的确切版本号。
176
201
 
177
- **卸载。**Harness → 插件 → dsh-baton-host → **卸载**,再运行 `npx -y dsh-baton-mcp setup --remove`。插件分不清"被卸载"和"Harness 退出",所以 MCP 注册交给这条命令删,它也会删掉 `~/.dsh-baton/app`;运行记录留在 `~/.dsh-baton`,不需要的话自己删掉。
202
+ **卸载**。Harness → 插件 → dsh-baton-host → **卸载**,再运行 `npx -y dsh-baton-mcp setup --remove`。插件分不清"被卸载"和"Harness 退出",所以 MCP 注册交给这条命令删,它也会删掉 `~/.dsh-baton/app`;运行记录留在 `~/.dsh-baton`,不需要的话自己删掉。
178
203
 
179
- **从 dsh-bridge 升级。**在 Harness 里先卸载 `dsh-bridge-host`,再添加 `dsh-baton-host`;启用后它会替换掉旧的 `dsh-bridge` MCP 注册。`DSH_BRIDGE_*` 环境变量和已有的 `~/.dsh-bridge` 文件夹暂时继续可用。工具前缀变成 `mcp__dsh-baton__…`,权限白名单里写了旧前缀的要改一下。0.4 之前通过粘贴 `~/.dsh-baton/app/host` 装的插件仍然能用,但不会跟着 npm 更新:卸载它,再按包名添加 `dsh-baton-host`。
204
+ **从 dsh-bridge 升级**。在 Harness 里先卸载 `dsh-bridge-host`,再添加 `dsh-baton-host`;启用后它会替换掉旧的 `dsh-bridge` MCP 注册。`DSH_BRIDGE_*` 环境变量和已有的 `~/.dsh-bridge` 文件夹暂时继续可用。工具前缀变成 `mcp__dsh-baton__…`,权限白名单里写了旧前缀的要改一下。0.4 之前通过粘贴 `~/.dsh-baton/app/host` 装的插件仍然能用,但不会跟着 npm 更新:卸载它,再按包名添加 `dsh-baton-host`。
180
205
 
181
206
  **从源码安装**(想跟进 `main` 或改代码):`git clone https://github.com/JialaoLiu/dsh-baton.git`,然后在 Harness 里从克隆目录的 `host` 文件夹添加插件(添加插件 → 粘贴路径)。启用后注册的就是克隆目录本身,改动在发布前就能跑起来;更新用 `git pull`。在终端里运行 `node dsh-baton/src/cli.mjs setup` 也能注册克隆目录。
182
207
 
183
- **Windows。**步骤相同;[WINDOWS.md](WINDOWS.md) 说明了不同之处(用命名管道代替套接字文件),以及插件页装不上或卸不掉时的修法。
208
+ **Windows**。步骤相同;[WINDOWS.md](WINDOWS.md) 说明了不同之处(用命名管道代替套接字文件),以及插件页装不上或卸不掉时的修法。
184
209
 
185
210
  <details>
186
211
  <summary>手动注册与 Claude 桌面应用</summary>
@@ -202,6 +227,8 @@ codex mcp add dsh-baton -- "$(command -v node)" "$PWD/dsh-baton/src/server.mjs"
202
227
 
203
228
  </details>
204
229
 
230
+ </details>
231
+
205
232
  ## 安全与限制
206
233
 
207
234
  <p align="center">
package/host/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-baton-host",
3
- "version": "0.6.0-next.0",
3
+ "version": "0.6.0",
4
4
  "description": "DeepSeek Harness plugin for dsh-baton: adding it is the whole install. Switched on, it registers the dsh-baton MCP server for Claude Code and Codex, then takes the baton over a local, owner-only control socket, runs it in a specific session through the host's own session controller, and hands the result back when the turn is done.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "dsh-baton-mcp": "0.6.0-next.0"
23
+ "dsh-baton-mcp": "0.6.0"
24
24
  },
25
25
  "license": "MIT",
26
26
  "dsh": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-baton-mcp",
3
- "version": "0.6.0-next.0",
3
+ "version": "0.6.0",
4
4
  "mcpName": "io.github.JialaoLiu/dsh-baton",
5
5
  "description": "Pass the baton from Claude Code, Codex or any MCP client to a local DeepSeek Harness: an MCP server that hands off tasks, continues a specific session, shows the run live in Harness and hands the result back when it is done.",
6
6
  "type": "module",
package/server.json CHANGED
@@ -7,12 +7,12 @@
7
7
  "url": "https://github.com/JialaoLiu/dsh-baton",
8
8
  "source": "github"
9
9
  },
10
- "version": "0.6.0-next.0",
10
+ "version": "0.6.0",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "dsh-baton-mcp",
15
- "version": "0.6.0-next.0",
15
+ "version": "0.6.0",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }
package/src/core.mjs CHANGED
@@ -168,11 +168,18 @@ export async function hostAvailable() {
168
168
  export const hostVersionSeen = () => hostVersion
169
169
 
170
170
  // The plugin and the MCP server update separately (Harness and npx), so they can drift.
171
- // A different major.minor gets a note asking to update the older side; patch releases mix.
171
+ // A different major.minor gets a note asking to update the older side to the newer side's
172
+ // exact version; patch releases mix. Not @latest: on a pre-release that would go back a version
173
+ // (and Harness resolves a tag such as @next to a broken tarball, so the plugin needs the number).
172
174
  const minorOf = (v) => String(v).split('.').slice(0, 2).join('.')
175
+ const parts = (v) => String(v).split('-')[0].split('.').map(Number)
176
+ const older = (a, b) => { const x = parts(a), y = parts(b); for (let i = 0; i < 3; i++) if (x[i] !== y[i]) return x[i] < y[i]; return false }
173
177
  export function versionWarning(plugin = hostVersion, server = VERSION) {
174
178
  if (!plugin || minorOf(plugin) === minorOf(server)) return null
175
- return `The Harness plugin dsh-baton-host is ${plugin} but this MCP server is ${server}. Update the older one: the server with \`npx -y dsh-baton-mcp@latest setup\`, the plugin in Harness (Plugins → dsh-baton-host → Uninstall, then Add plugin → dsh-baton-host).`
179
+ const fix = older(plugin, server)
180
+ ? `Update the plugin in Harness: Plugins → dsh-baton-host → Uninstall, then Add plugin → dsh-baton-host@${server}.`
181
+ : `Update the server: \`npx -y dsh-baton-mcp@${plugin} setup\`.`
182
+ return `The Harness plugin dsh-baton-host is ${plugin} but this MCP server is ${server}. ${fix}`
176
183
  }
177
184
 
178
185
  // Who a relayed message is from, shown on it in the Harness chat: DSH_BATON_SENDER if set,