dsh-baton-mcp 0.6.11 → 0.6.13
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 +3 -1
- package/README.zh-CN.md +3 -1
- package/host/lib/index.js +38 -2
- package/host/package.json +2 -2
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/core.mjs +12 -1
- package/src/mcp.mjs +1 -1
package/README.md
CHANGED
|
@@ -187,6 +187,8 @@ Working alone, Astra rated its own work 23/23; the independent check found 17/23
|
|
|
187
187
|
|
|
188
188
|
**Pick a model:** just say which one, for example "hand it to DeepSeek, V4 Pro". `dsh_send` passes it as `model` (and `reasoning_effort`), matched against the models Harness lists, so a model Harness adds later works as soon as it shows up. It applies to that session only; Harness's default model stays as it was. `dsh_list_models` shows what is available.
|
|
189
189
|
|
|
190
|
+
**Agent Teams:** ask for them, for example "hand it to DeepSeek with Agent Teams". `dsh_send` passes `team: true` and the session runs with Harness's Agent Teams on (Harness 0.2.2-rc.2 or later): the lead splits the work on a shared task board with its teammates, and the run comes back once they are done. `team: false` turns them off again.
|
|
191
|
+
|
|
190
192
|
**Answering Harness's questions:** the main agent answers the way the task needs, rather than picking the least bad option. See `dsh_answer` under [Tools](#tools).
|
|
191
193
|
|
|
192
194
|
**Several runs at once.** When a task is split across sessions, the main agent sends them all and waits for them together; whichever ends first comes back first, so it can review it and send a fix while the rest still run.
|
|
@@ -238,7 +240,7 @@ The server's MCP instructions are a single sentence; how to hand over, wait and
|
|
|
238
240
|
| `dsh_list_sessions` | Sessions newest first, with title, folder, running state and `model` (what its next request uses); filter by folder or text. Archived sessions are left out |
|
|
239
241
|
| `dsh_list_models` | The models Harness can run (provider, id, name, reasoning efforts) and its default model |
|
|
240
242
|
| `dsh_read_session` | Recent prompts and replies of one session (with tool names); `archived: true` for an archived session |
|
|
241
|
-
| `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](#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. `model` only when the user names one ("DeepSeek-V4 Pro", "v4-pro"; `reasoning_effort` likewise): it is matched against Harness's own model list, ignoring case, spaces, hyphens and a leading DeepSeek, so a model Harness adds later (V4.1 Pro) works as soon as Harness lists it; a name that matches nothing or several fails the send, before anything is created, with the list (`provider/model` picks one). It is set on that session before the message goes in, and Harness's default model is put back as it was (Harness saves a session's pick as the default too). Left out, a continued session keeps its own model and a new one uses Harness's default. The reply says which in `model` and `model_source` |
|
|
243
|
+
| `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](#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. `model` only when the user names one ("DeepSeek-V4 Pro", "v4-pro"; `reasoning_effort` likewise): it is matched against Harness's own model list, ignoring case, spaces, hyphens and a leading DeepSeek, so a model Harness adds later (V4.1 Pro) works as soon as Harness lists it; a name that matches nothing or several fails the send, before anything is created, with the list (`provider/model` picks one). It is set on that session before the message goes in, and Harness's default model is put back as it was (Harness saves a session's pick as the default too). Left out, a continued session keeps its own model and a new one uses Harness's default. The reply says which in `model` and `model_source`. `team` (Harness 0.2.2-rc.2 or later): `true` turns Agent Teams on for the session before the message goes in, `false` turns them off; refused, with nothing sent, on an older Harness or on a sub-agent's session |
|
|
242
244
|
| `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; `model` the run was sent with. With `session_id` instead of `run_id`: what the session is doing, its Harness goal and its last turn's reply |
|
|
243
245
|
| `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 3540 s per call for Codex (its tool timeout for dsh-baton less 60 s; 270 s when that is not set), 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. A run in a session with a Harness goal is waited for until the goal stops (`until` `turn` and `every_minutes` for progress reports). With `session_id` instead of `run_id` it follows the session's Harness goal without sending anything (`until`, `cursor`, `every_minutes`; see How each client waits). With `run_ids` it waits for several runs and returns as soon as any ends or asks (`ended`, `still_running`) |
|
|
244
246
|
| `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; on a single choice, free text replaces the option. `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`) and a layout for passing them on (`relay`, `question_tool`). When you let the main agent decide, it takes an option only if it fits as written, and otherwise answers in its own words; before it picks an option for you, the first call is held back and it writes the answer you would want without the options, sending the option only if the two agree. Otherwise it brings you the questions with its recommendation first, which may be an answer outside the options; pick that and only the answer itself is sent. You can also answer in the Harness window: whoever answers first wins |
|
package/README.zh-CN.md
CHANGED
|
@@ -187,6 +187,8 @@ Codex 占 ChatGPT Plus 5 小时额度的比例,以及主 Agent 自己的花费
|
|
|
187
187
|
|
|
188
188
|
**指定模型**:直接说用哪个就行,比如「交给 DeepSeek,用 V4 Pro」。`dsh_send` 会把它作为 `model`(以及 `reasoning_effort`)传过去,按 Harness 自己的模型列表匹配,所以 Harness 以后新加的模型一出现就能用。只对这个对话生效,Harness 的默认模型保持不变。`dsh_list_models` 可以看有哪些模型。
|
|
189
189
|
|
|
190
|
+
**智能体团队**:直接说要用就行,比如「交给 DeepSeek,用智能体团队做」。`dsh_send` 会传 `team: true`,这个对话就开着 Harness 的智能体团队协作跑(需要 Harness 0.2.2-rc.2 及以上):lead 和队友在共享任务板上分工,都做完了才交回。`team: false` 可以再关掉。
|
|
191
|
+
|
|
190
192
|
**回答 Harness 的提问**:主 Agent 按任务真正需要的答案来回答,不会在几个都不合适的选项里挑一个凑合。细节见[完整工具说明](#工具)里的 `dsh_answer`。
|
|
191
193
|
|
|
192
194
|
**同时等多个任务**。一个任务拆给几个会话做时,主 Agent 全部发出去再一起等;哪个先做完就先拿到哪个,马上检查、发返修,其他的接着跑。
|
|
@@ -238,7 +240,7 @@ Codex 占 ChatGPT Plus 5 小时额度的比例,以及主 Agent 自己的花费
|
|
|
238
240
|
| `dsh_list_sessions` | 列出对话(最新在前),带标题、目录、是否在跑和 `model`(下一次请求用的模型);可按目录或关键字过滤。已归档的对话不会列出 |
|
|
239
241
|
| `dsh_list_models` | 列出 Harness 能用的模型(provider、id、名称、推理强度)和它的默认模型 |
|
|
240
242
|
| `dsh_read_session` | 读某个对话最近的消息和回复(含用到的工具名);已归档的对话会带 `archived: true` |
|
|
241
|
-
| `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` 说明用的是哪种。`model` 只在用户点名模型时传(如“DeepSeek-V4 Pro”“v4-pro”;`reasoning_effort` 同理):按 Harness 自己的模型列表匹配,不分大小写,忽略空格、连字符和开头的 DeepSeek,所以 Harness 以后上线的模型(如 V4.1 Pro)一出现在列表里就能用;匹配不到或匹配到多个时,发送直接失败、什么都不创建,并列出可用模型(用 `provider/model` 指定其一)。模型在消息发出前设到该对话上,Harness 的默认模型会恢复原样(Harness 会把对话里选的模型同时存成默认)。不传时,续接的对话沿用它自己的模型,新对话用 Harness 默认模型。返回值的 `model` 和 `model_source`
|
|
243
|
+
| `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` 说明用的是哪种。`model` 只在用户点名模型时传(如“DeepSeek-V4 Pro”“v4-pro”;`reasoning_effort` 同理):按 Harness 自己的模型列表匹配,不分大小写,忽略空格、连字符和开头的 DeepSeek,所以 Harness 以后上线的模型(如 V4.1 Pro)一出现在列表里就能用;匹配不到或匹配到多个时,发送直接失败、什么都不创建,并列出可用模型(用 `provider/model` 指定其一)。模型在消息发出前设到该对话上,Harness 的默认模型会恢复原样(Harness 会把对话里选的模型同时存成默认)。不传时,续接的对话沿用它自己的模型,新对话用 Harness 默认模型。返回值的 `model` 和 `model_source` 写明用的是哪个。`team`(需要 Harness 0.2.2-rc.2 及以上):`true` 在消息发出前为该对话打开智能体团队协作,`false` 关闭;Harness 版本太旧或传的是子智能体的对话时,直接拒绝、什么都不发 |
|
|
242
244
|
| `dsh_status` | 查看运行进度:状态、最近的文字和工具调用、最终回复;回合结束但子智能体/后台任务还在跑时给出 `waiting_on`;中途有人在 Harness 界面里发消息时给出 `human_interjections`;被 Harness 重启打断的任务状态为 `interrupted`;以及这次运行发送时用的 `model`。用 `session_id` 代替 `run_id` 时:会话正在做什么、它的 Harness 目标,以及上一回合的回复 |
|
|
243
245
|
| `dsh_wait` | 等运行结束;发消息时带了 `checks` 的,结束后会附上 `evidence`(改了哪些文件、测试结果)(或者等到它停下来问人,见 `dsh_answer`):Codex 每次最多等 3540 秒(它对 dsh-baton 的工具超时减 60 秒;没设时 270 秒),其他客户端 50 秒。没做完会带 `timed_out`,只返回状态,再调用一次即可。能在后台等待的客户端改用 `dsh_send` 返回的 `wait_command`。`dsh_status` 只用来看一眼,不用来等待。发到带 Harness 目标的会话的任务会一直等到目标停下(要汇报进度时用 `until` 为 `turn` 和 `every_minutes`)。用 `session_id` 代替 `run_id` 时,不发任何消息,跟进这个会话的 Harness 目标(`until`、`cursor`、`every_minutes`;见“各客户端怎么等待”)。用 `run_ids` 时同时等多个任务,任何一个做完或提问就返回(`ended`、`still_running`) |
|
|
244
246
|
| `dsh_answer` | 回答运行中途提出的问题(Harness 的 ask_user_question):每道题可以填选项编号或选项文字、自由填写,或者跳过;单选题填了文字就以文字为准。运行一提问,`dsh_wait` 和 `wait_command` 就立刻返回,带上题目(`needs_input`、`question`;Harness 模型推荐的选项在 `harness_suggested`)和转给你时用的排版(`relay`、`question_tool`)。你让主 Agent 自己决定时,选项照原文正好合适它才选,否则用自己的话回答;要替你选某个选项时,第一次调用不会发出,它得先不看选项写出你想要的答案,两者一致才发。没让它决定时,它把题目转给你,开头先写它的建议,建议可以不在选项里;你选了这条建议,就只发这条答案。你也可以直接在 Harness 窗口里回答,谁先答就算谁的 |
|
package/host/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
|
-
|
|
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
|
-
|
|
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/host/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-baton-host",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
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",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"LICENSE"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"dsh-baton-mcp": "0.6.
|
|
23
|
+
"dsh-baton-mcp": "0.6.13"
|
|
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.
|
|
3
|
+
"version": "0.6.13",
|
|
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.
|
|
10
|
+
"version": "0.6.13",
|
|
11
11
|
"packages": [
|
|
12
12
|
{
|
|
13
13
|
"registryType": "npm",
|
|
14
14
|
"identifier": "dsh-baton-mcp",
|
|
15
|
-
"version": "0.6.
|
|
15
|
+
"version": "0.6.13",
|
|
16
16
|
"transport": {
|
|
17
17
|
"type": "stdio"
|
|
18
18
|
}
|
package/src/core.mjs
CHANGED
|
@@ -156,10 +156,13 @@ export const VERSION = JSON.parse(fs.readFileSync(path.join(ROOT, 'package.json'
|
|
|
156
156
|
|
|
157
157
|
// The plugin version from the last successful ping.
|
|
158
158
|
let hostVersion = null
|
|
159
|
+
let hostFeatures = []
|
|
159
160
|
|
|
160
161
|
export async function hostAvailable() {
|
|
161
162
|
try {
|
|
162
|
-
|
|
163
|
+
const pong = await hostCall('ping', {}, { timeoutMs: 2000 })
|
|
164
|
+
hostVersion = pong?.version ?? null
|
|
165
|
+
hostFeatures = Array.isArray(pong?.features) ? pong.features : []
|
|
163
166
|
return true
|
|
164
167
|
} catch {
|
|
165
168
|
return false
|
|
@@ -870,6 +873,14 @@ export const api = {
|
|
|
870
873
|
throw new Error(`The Harness plugin dsh-baton-host ${hostVersion ?? ''} is too old to choose a model; this MCP server is ${VERSION}. Nothing was sent. Update the plugin: Plugins → dsh-baton-host → Uninstall, then Add plugin → dsh-baton-host@${VERSION}, or send without model.`.replace(' ', ' '))
|
|
871
874
|
})
|
|
872
875
|
}
|
|
876
|
+
// A client whose tool list predates team (a conversation open since before an update) sends
|
|
877
|
+
// it as the string "true" or "false": take that as the boolean it means.
|
|
878
|
+
if (typeof a.team === 'string' && /^(true|false)$/i.test(a.team.trim())) a = { ...a, team: a.team.trim().toLowerCase() === 'true' }
|
|
879
|
+
// Agent Teams live in Harness itself; a plugin without the team feature would drop it silently.
|
|
880
|
+
if (a.team != null) {
|
|
881
|
+
if (!host) throw new Error('Agent Teams need the dsh-baton-host plugin running inside DeepSeek Harness. Nothing was sent.')
|
|
882
|
+
if (!hostFeatures.includes('team')) throw new Error(`The Harness plugin dsh-baton-host ${hostVersion} is too old to turn on Agent Teams; this MCP server is ${VERSION}. Nothing was sent. Update the plugin (Plugins → dsh-baton-host → Update to ${VERSION}), or send without team.`)
|
|
883
|
+
}
|
|
873
884
|
// No Harness CLI to run the turn without the app (the Windows app has none on PATH): what
|
|
874
885
|
// is wrong is that Harness is not running, not that a CLI is missing.
|
|
875
886
|
if (!host) { try { dshBin() } catch { throw new Error('DeepSeek Harness is not running, or its dsh-baton-host plugin is switched off: open Harness (Plugins → dsh-baton-host on) and send again.') } }
|
package/src/mcp.mjs
CHANGED
|
@@ -284,7 +284,7 @@ const TOOLS = [
|
|
|
284
284
|
name: 'dsh_send',
|
|
285
285
|
annotations: annotations('Send message', hints(false, false, false)),
|
|
286
286
|
description: 'Hand a task to DeepSeek Harness, or continue a session: returns at once with a run_id and a hint saying how to wait for the reply; follow it. Call it directly, no need to list anything first. A new session starts in the folder this conversation works in, or in cwd or workspace_id (a new cwd is registered first); session_id continues that session. message arrives verbatim as a user message, and Harness does not see this conversation: make it self-contained, in the user\'s language, the full, explicit spec, asking for tests that cover each requirement. Keep a leading /goal (it sets a Harness goal) and the user\'s goal text as written. For a large task, write a concrete spec (goal, modules and the files each owns, level of detail, acceptance criteria) rather than passing the user\'s words on, and send independent parts to separate sessions in parallel, each owning its own files; wait for them together (dsh_wait run_ids), review each as it returns and send its fixes at once. With checks, a short request for a sub-agent review table is appended. To a busy session, mode followup queues the message and steer adds it to the running turn; left out, the Harness setting decides.',
|
|
287
|
-
inputSchema: { type: 'object', required: ['message'], properties: { message: str('The task or reply to send'), session_id: str('Existing session to continue'), cwd: str('Workspace folder for a new session; leave out to use the folder this conversation works in'), workspace_id: str('Harness workspace for a new session (from dsh_list_workspaces)'), mode: { type: 'string', enum: ['followup', 'steer'], description: "followup queues after the current turn; steer injects into a running turn. Omit to follow Harness's busy-send setting" }, model: str('Only when the user names a model for this run (e.g. "DeepSeek-V4 Pro"
|
|
287
|
+
inputSchema: { type: 'object', required: ['message'], properties: { message: str('The task or reply to send'), session_id: str('Existing session to continue'), cwd: str('Workspace folder for a new session; leave out to use the folder this conversation works in'), workspace_id: str('Harness workspace for a new session (from dsh_list_workspaces)'), mode: { type: 'string', enum: ['followup', 'steer'], description: "followup queues after the current turn; steer injects into a running turn. Omit to follow Harness's busy-send setting" }, model: str('Only when the user names a model for this run (e.g. "DeepSeek-V4 Pro"); otherwise the session keeps its own, or Harness\'s default for a new one. Matched ignoring case, spaces, hyphens and a leading DeepSeek; no match or several fails the send with the list (provider/model picks one). Sets this session only'), team: { type: 'boolean', description: 'Only when the user asks for Agent Teams: true turns them on for this session, false off' }, reasoning_effort: str('Only when the user names a reasoning effort, e.g. high; one of the efforts dsh_list_models shows for the model'), checks: { type: 'array', items: { type: 'string' }, description: 'The project\'s own test commands, e.g. npm test, or python -m pytest (a bare pytest is often not on PATH, on Windows especially); never check scripts you write yourself. dsh-baton runs them in the folder when the run ends and returns exit codes and the last output lines as evidence.' } } },
|
|
288
288
|
run: async (a, { meta } = {}) => {
|
|
289
289
|
// A new session goes to this conversation's folder unless the call names another one;
|
|
290
290
|
// a different folder is allowed but said back, so a wrong guess does not go unnoticed.
|