dsh-baton-host 0.6.10 → 0.6.12

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.md +14 -61
  2. package/lib/index.js +38 -2
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -1,76 +1,29 @@
1
- <p align="center">
2
- <img src="https://raw.githubusercontent.com/JialaoLiu/dsh-baton/main/assets/readme/en/hero.gif" width="100%" alt="dsh-baton: pass the baton from Claude Code or Codex to DeepSeek Harness, watch it run live, and get it handed back when it's done">
3
- </p>
4
-
5
- <p align="center">
6
- <a href="https://github.com/JialaoLiu/dsh-baton#readme">dsh-baton</a> · <a href="https://github.com/JialaoLiu/dsh-baton/blob/main/README.zh-CN.md">中文说明</a>
7
- </p>
8
-
9
- <p align="center">
10
- macOS · Windows (<a href="https://github.com/JialaoLiu/dsh-baton/blob/main/WINDOWS.md">guide</a>) · no Node.js needed · zero dependencies · MIT
11
- </p>
12
-
13
1
  # dsh-baton-host
14
2
 
15
- The DeepSeek Harness plugin for [dsh-baton](https://github.com/JialaoLiu/dsh-baton#readme). It runs inside the Harness host (desktop app or `dsh web`) and serves a local, owner-only Unix socket (`~/.dsh-baton/host.sock`; a per-user named pipe on Windows). Through it, an MCP client can list and create workspaces, create sessions, continue a specific session, and wait for its turn to finish. All of this goes through Harness's own session controller, so the messages show up live in the Harness UI.
3
+ Hand coding tasks from Claude Code or Codex to DeepSeek Harness: they run live in this window and come back with the changed files and test results. [Full guide](https://github.com/JialaoLiu/dsh-baton#readme)
16
4
 
17
- DeepSeek Harness 插件,配合 [dsh-baton](https://github.com/JialaoLiu/dsh-baton/blob/main/README.zh-CN.md) 使用。它运行在 Harness 内部,只开一个当前用户才能访问的本地套接字,让 MCP 客户端能新建工作区和对话、续接指定对话、等待任务完成。所有操作都走 Harness 官方会话服务,界面实时可见。
18
-
19
- <p align="center">
20
- <img src="https://raw.githubusercontent.com/JialaoLiu/dsh-baton/main/assets/readme/en/features.svg" width="100%" alt="Create workspaces and sessions, continue a session, run live in the Harness UI labelled with the sender, get woken when it is done, no extra API key, macOS and Windows with zero dependencies">
21
- </p>
5
+ 让 Claude Code 或 Codex 把编码任务交给 DeepSeek Harness:任务在这个窗口里实时跑,做完带着改动文件和测试结果交回去。[完整说明](https://github.com/JialaoLiu/dsh-baton/blob/main/README.zh-CN.md)
22
6
 
23
7
  ## Install / 安装
24
8
 
25
- <p align="center">
26
- <img src="https://raw.githubusercontent.com/JialaoLiu/dsh-baton/main/assets/readme/en/install.svg" width="100%" alt="Step 1: in Harness open Plugins, Add plugin, enter dsh-baton-host, Install, Enable now; it registers dsh-baton for Claude Code and Codex. Step 2: in a new chat, ask for dsh_list_workspaces">
27
- </p>
28
-
29
- Harness → Plugins / 插件 → Add plugin / 添加插件 → `dsh-baton-host` → Install / 安装 → Enable now / 立即启用
30
-
31
- That is the whole install: switched on, the plugin registers the dsh-baton MCP server (the `dsh-baton-mcp` package, installed with it) for Claude Code and Codex, user-wide, and Harness says so. New conversations then have the `dsh_*` tools. If it could not register, run `npx -y dsh-baton-mcp setup`. Details: [dsh-baton](https://github.com/JialaoLiu/dsh-baton#install-details).
32
-
33
- 装好就完成了:插件启用时会为 Claude Code 和 Codex 注册 dsh-baton MCP 服务器(`dsh-baton-mcp` 包,随插件一起安装),Harness 里会提示。新开的对话就有 `dsh_*` 工具。没能注册的话,运行 `npx -y dsh-baton-mcp setup`。详见 [dsh-baton](https://github.com/JialaoLiu/dsh-baton/blob/main/README.zh-CN.md#安装细节)。
34
-
35
- Codex needs nothing extra: from 0.6.4 it waits for a run in one `dsh_wait` call of up to 59 minutes, with no hook to trust. / Codex 不用额外设置:从 0.6.4 起一次 `dsh_wait` 最长等 59 分钟,不需要信任钩子。
36
-
37
- Update / 更新: uninstall, then add it again; the MCP server is updated with it. Right after a release, type the exact version, such as `dsh-baton-host@0.6.4`. / 先卸载再重新添加,MCP 服务器会一起更新;刚发版时请输入完整版本号,例如 `dsh-baton-host@0.6.4`。
38
-
39
- Remove / 卸载: uninstall, then `npx -y dsh-baton-mcp setup --remove` / 卸载插件后运行 `npx -y dsh-baton-mcp setup --remove`.
9
+ **Install / 安装**: Plugins / 插件 → Add plugin / 添加插件 → `dsh-baton-host` → Install / 安装 → Enable now / 立即启用. That registers dsh-baton for Claude Code and Codex. / 启用后会为 Claude Code 和 Codex 注册 dsh-baton。
40
10
 
41
- ## How it works / 工作原理
11
+ **Check / 验证**:
12
+ 1. Open a new chat in Claude Code or Codex; Codex asks once to approve the dsh-baton tools. / 在 Claude Code 或 Codex 里新开对话,Codex 第一次会请你批准 dsh-baton 的工具。
13
+ 2. Ask it to call `dsh_list_workspaces`; it lists your Harness workspaces. / 让它调用 `dsh_list_workspaces`,会列出你的 Harness 工作区。
42
14
 
43
- <p align="center">
44
- <img src="https://raw.githubusercontent.com/JialaoLiu/dsh-baton/main/assets/readme/en/architecture.gif" width="100%" alt="MCP clients call dsh-baton-mcp over stdio; it reaches the dsh-baton-host plugin inside Harness through an owner-only local socket; the plugin drives Harness sessions live, with dsh headless as fallback">
45
- </p>
15
+ Not registered? / 没能注册?Run `npx -y dsh-baton-mcp setup`.
46
16
 
47
- ## Socket protocol / 套接字协议
17
+ ## Update / 更新
48
18
 
49
- Newline-delimited JSON: request `{"id", "method", "params"}`, reply `{"id", "result"}` or `{"id", "error"}`.
19
+ Version → **Update to x.y.z** (press **Recheck** first if it says up to date). On Harness 0.2.1: uninstall, then add `dsh-baton-host@x.y.z`.
50
20
 
51
- | Method | Params |
52
- |---|---|
53
- | `ping` | — |
54
- | `workspaces` | — |
55
- | `create_workspace` | `path`, `title?`, `create_dir?` (default `true`) |
56
- | `list_sessions` | `cwd?`, `query?`, `limit?` |
57
- | `read_session` | `session_id`, `last?` |
58
- | `models` | — |
59
- | `send` | `message`, and `session_id` or `cwd` or `workspace_id`; `mode?` (`followup` \| `steer`; left out, Harness's busy-send setting, else `followup`) |
60
- | `status` | `run_id`, `tail?` |
61
- | `wait` | `run_id`, `timeout_s?` |
62
- | `activity` | `session_id` |
63
- | `cancel` | `run_id` or `session_id` |
64
- | `rename_session` | `session_id`, `title` |
65
- | `rename_workspace` | `workspace_id` or `path`, `title` |
66
- | `list_runs` | `session_id?`, `limit?` |
67
- | `answer` | `run_id`, `answers` (`[{ id?, choose?, text?, skip? }]`) |
68
- | `update_queued` | `run_id`, `action` (`edit` \| `remove` \| `steer`), `message?` (for `edit`) |
21
+ 版本一栏 → **更新到 x.y.z**(显示已是最新时先点 **重新检查**)。Harness 0.2.1:先卸载,再添加 `dsh-baton-host@x.y.z`。
69
22
 
70
- `DSH_BATON_SOCKET` / `DSH_BATON_HOME` in the Harness process environment move the socket. `DSH_BATON_AUTO_REGISTER=0` turns off the MCP registration.
23
+ ## Remove / 卸载
71
24
 
72
- The Plugins page reads the registration outcome from `GET /dsh-baton/status` on the Harness web server.
25
+ Uninstall, then run `npx -y dsh-baton-mcp setup --remove`. / 卸载插件后运行 `npx -y dsh-baton-mcp setup --remove`。
73
26
 
74
- ## License
27
+ ---
75
28
 
76
- MIT
29
+ [Socket protocol / 套接字协议](https://github.com/JialaoLiu/dsh-baton/blob/main/host/PROTOCOL.md) · MIT
package/lib/index.js CHANGED
@@ -790,6 +790,7 @@ export function apply(ctx) {
790
790
 
791
791
  let goalsService = null
792
792
  let agentsService = null
793
+ let teamsService = null
793
794
  const activations = new Map() // sessionId -> 'armed' | 'disarmed', from goal/activation-changed
794
795
  ctx.on('goal/activation-changed', guard('goal activation', ({ sessionId, goal } = {}) => {
795
796
  if (!sessionId) return
@@ -1174,9 +1175,32 @@ export function apply(ctx) {
1174
1175
  }
1175
1176
  }
1176
1177
 
1177
- async function send({ message, session_id, cwd, workspace_id, mode: asked, sender, model, reasoning_effort }) {
1178
+ // --- Agent Teams ----------------------------------------------------------------
1179
+ // Harness 0.2.2-rc.2 turns a root session's Team mode on or off from its model menu
1180
+ // ("Use Agent Teams"): agentTeams.setEnabled with the session's live root Agent. The
1181
+ // selection is saved in the session, so it holds for later messages and restarts.
1182
+ const TEAMS_UNSUPPORTED = 'this DeepSeek Harness cannot turn Agent Teams on per session; that needs Harness 0.2.2-rc.2 or later: update Harness, or send without team'
1183
+ async function setTeam(sessionId, enabled) {
1184
+ if (typeof teamsService?.setEnabled !== 'function') throw new Error(TEAMS_UNSUPPORTED)
1185
+ // The exact live Agent from Harness's registry, as its own UI lookup takes it: Team rejects
1186
+ // any other object ("subagent tree access requires the exact live caller"). A session not
1187
+ // loaded yet is loaded first.
1188
+ let agent = agentsService?.get?.(sessionId)
1189
+ if (!agent && typeof controller.resolveAgent === 'function') {
1190
+ await controller.resolveAgent(sessionId)
1191
+ agent = agentsService?.get?.(sessionId)
1192
+ }
1193
+ // A finished sub-agent's session is never loaded again: name the likely cause.
1194
+ if (!agent) throw new Error(`session ${sessionId} is not loaded in Harness; if it is a sub-agent's (teammate's) session, change Team mode on its root session instead`)
1195
+ await teamsService.setEnabled(agent, enabled)
1196
+ }
1197
+
1198
+ async function send({ message, session_id, cwd, workspace_id, mode: asked, sender, model, reasoning_effort, team }) {
1178
1199
  if (!message || !message.trim()) throw new Error('message is required')
1179
1200
  if (asked != null && asked !== 'followup' && asked !== 'steer') throw new Error('mode must be followup or steer')
1201
+ if (team != null && typeof team !== 'boolean') throw new Error('team must be true or false')
1202
+ // Checked before a new session is made, so a Harness without them is left as it was.
1203
+ if (team != null && typeof teamsService?.setEnabled !== 'function') throw new Error(`Nothing was sent: ${TEAMS_UNSUPPORTED}`)
1180
1204
  // Without a mode, a message to a busy session does what Harness's own busy-send setting says.
1181
1205
  const fromHarness = asked == null ? harnessBusyMode() : null
1182
1206
  const mode = asked ?? fromHarness ?? 'followup'
@@ -1209,6 +1233,12 @@ export function apply(ctx) {
1209
1233
  const chosen = await applyModel(sessionId, plan, isNew).catch((error) => {
1210
1234
  throw new Error(`${isNew ? `Session ${sessionId} was created, but no message was sent: ` : 'No message was sent: '}the model could not be set (${error?.message ?? error})`)
1211
1235
  })
1236
+ // Team mode goes on (or off) before the prompt, so the first step already has the Team tools.
1237
+ if (team != null) {
1238
+ await setTeam(sessionId, team).catch((error) => {
1239
+ throw new Error(`${isNew ? `Session ${sessionId} was created, but no message was sent: ` : 'No message was sent: '}Agent Teams could not be turned ${team ? 'on' : 'off'} (${error?.message ?? error})`)
1240
+ })
1241
+ }
1212
1242
  // A session that never picked a model runs on Harness's default.
1213
1243
  let provider = chosen.model?.provider
1214
1244
  if (!provider) try { provider = defaultModel()?.currentSelection?.()?.provider } catch { /* unknown: no check */ }
@@ -1237,6 +1267,7 @@ export function apply(ctx) {
1237
1267
  mode_source: modeSource,
1238
1268
  model: chosen.model,
1239
1269
  model_source: chosen.source,
1270
+ ...(team != null ? { team } : {}),
1240
1271
  ...(ahead.length ? { other_active_runs: ahead } : {}),
1241
1272
  ...(workspace ? { workspace } : {}),
1242
1273
  }
@@ -1362,7 +1393,8 @@ export function apply(ctx) {
1362
1393
  }
1363
1394
 
1364
1395
  const methods = {
1365
- ping: () => ({ name, version: VERSION, pid: process.pid }),
1396
+ // features: what this plugin can do that an older one cannot (team: dsh_send team).
1397
+ ping: () => ({ name, version: VERSION, pid: process.pid, features: ['team'] }),
1366
1398
  workspaces,
1367
1399
  create_workspace: createWorkspace,
1368
1400
  list_sessions: listSessions,
@@ -1469,6 +1501,10 @@ export function apply(ctx) {
1469
1501
  agentsService = child.agents
1470
1502
  child.effect(() => () => { if (agentsService === child.agents) agentsService = null }, 'dsh-baton-host agents')
1471
1503
  })
1504
+ ctx.inject(['agentTeams'], (child) => {
1505
+ teamsService = child.agentTeams
1506
+ child.effect(() => () => { if (teamsService === child.agentTeams) teamsService = null }, 'dsh-baton-host agent teams')
1507
+ })
1472
1508
  ctx.inject(['webServer'], (web) => {
1473
1509
  web.effect(() => web.webServer.register({
1474
1510
  kind: 'exact',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-baton-host",
3
- "version": "0.6.10",
4
- "description": "DeepSeek Harness plugin for dsh-baton: hand coding tasks from Claude Code or Codex to DeepSeek Harness on your machine. Adding it is the whole install: it registers the dsh-baton MCP server for Claude Code and Codex, runs each task live in the Harness window, wakes the main agent when the run ends and hands back the changed files, the project's own test results and a requirement-by-requirement checklist.",
3
+ "version": "0.6.12",
4
+ "description": "Hand coding tasks from Claude Code or Codex to DeepSeek Harness: they run live in the Harness window and come back with the changed files and test results.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "dsh-baton-mcp": "0.6.10"
23
+ "dsh-baton-mcp": "0.6.12"
24
24
  },
25
25
  "license": "MIT",
26
26
  "dsh": {