dsh-baton-mcp 0.6.5-next.2 → 0.6.6

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
@@ -59,10 +59,6 @@ That is all. To hand a task over, end the request with "hand it to DeepSeek Harn
59
59
 
60
60
  ## See it run
61
61
 
62
- *Claude Code and Codex each hand DeepSeek Harness a task, and its subagents build this rainy-night street in 1 h 41 min. 40 s, sound on.*
63
-
64
- https://github.com/user-attachments/assets/72e2fdff-275e-48bc-8e5a-39ffb025a0a8
65
-
66
62
  <p align="center">
67
63
  <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/en/flow-dark.gif"><img src="./assets/readme/en/flow.gif" width="100%" alt="Typical flow: create a workspace, send the task, wait without polling (Claude Code is woken once, Codex waits up to 59 minutes in one dsh_wait call), follow up in the same session"></picture>
68
64
  </p>
package/README.zh-CN.md CHANGED
@@ -59,10 +59,6 @@ dsh-baton 是一个 MCP 服务器加一个 Harness 小插件。主 Agent 用一
59
59
 
60
60
  ## 看它跑
61
61
 
62
- *Claude Code 和 Codex 各派一个任务给 DeepSeek Harness,它的子代理用 1 小时 41 分搭出了这条雨夜街道。40 秒,建议开声音。*
63
-
64
- https://github.com/user-attachments/assets/ed931637-acb3-4c16-8c52-72298ea90485
65
-
66
62
  <p align="center">
67
63
  <picture><source media="(prefers-color-scheme: dark)" srcset="./assets/readme/zh/flow-dark.gif"><img src="./assets/readme/zh/flow.gif" width="100%" alt="典型流程:新建工作区、派发任务、不轮询地等待(Claude Code 结束时被唤醒一次,Codex 一次 dsh_wait 最多等 59 分钟)、在同一个对话里续接追问"></picture>
68
64
  </p>
package/host/lib/index.js CHANGED
@@ -523,7 +523,7 @@ export function apply(ctx) {
523
523
  const ids = new Set(pending.map((m) => m?.source?.rpcId))
524
524
  const gone = waiting.filter((r) => !ids.has(r.requestId))
525
525
  if (!gone.length) return []
526
- const log = await controller.inspect(sessionId, signal()).catch(() => null)
526
+ const log = await sessionLog(sessionId).catch(() => null)
527
527
  if (!Array.isArray(log?.events)) return []
528
528
  const delivered = new Set(log.events.filter((e) => e.type === 'user/message').map((e) => e.data?.source?.rpcId))
529
529
  return gone.filter((r) => !delivered.has(r.requestId) && !r.sawPrompt)
@@ -739,8 +739,32 @@ export function apply(ctx) {
739
739
  return out
740
740
  }
741
741
 
742
+ // A session's whole event log and its folder. Harness up to 0.2.1 has sessionController.inspect;
743
+ // 0.2.2 replaced it with paged history (events): the newest page first, beforeSeq walks back,
744
+ // throughSeq pins every page to the same cut. The folder then comes from the session list.
745
+ async function sessionLog(sessionId) {
746
+ if (typeof controller.inspect === 'function') return controller.inspect(sessionId, signal())
747
+ if (typeof controller.events !== 'function') throw new Error('This DeepSeek Harness version cannot read a session log.')
748
+ const address = { kind: 'session', sessionId }
749
+ const pages = []
750
+ let throughSeq
751
+ let beforeSeq
752
+ for (;;) {
753
+ const page = await controller.events({ address, maxMessages: 500, ...(throughSeq === undefined ? {} : { throughSeq }), ...(beforeSeq === undefined ? {} : { beforeSeq }) }, signal())
754
+ throughSeq ??= page.cursor
755
+ const events = (page.records ?? []).filter((r) => r?.type === 'event' && r.event).map((r) => r.event)
756
+ pages.unshift(events)
757
+ if (!page.hasMore || !events.length || events[0].seq === beforeSeq) break
758
+ beforeSeq = events[0].seq
759
+ }
760
+ const seen = new Set()
761
+ const events = pages.flat().filter((e) => (seen.has(e.seq) ? false : (seen.add(e.seq), true)))
762
+ const { items } = await controller.list({}, signal())
763
+ return { meta: { cwd: items.find((it) => it.sessionId === sessionId)?.cwd ?? null }, events }
764
+ }
765
+
742
766
  async function readSession({ session_id, last = 10 }) {
743
- const { meta, events } = await controller.inspect(session_id, signal())
767
+ const { meta, events } = await sessionLog(session_id)
744
768
  const messages = []
745
769
  let title = null
746
770
  for (const e of events) {
@@ -900,7 +924,7 @@ export function apply(ctx) {
900
924
  // the events so far, to tell whether one came during the read.
901
925
  followedUntil.set(session_id, Date.now() + 60_000)
902
926
  const gen = eventGen.get(session_id) ?? 0
903
- const [goal, log] = await Promise.all([goalOf(session_id), controller.inspect(session_id, signal())])
927
+ const [goal, log] = await Promise.all([goalOf(session_id), sessionLog(session_id)])
904
928
  const { ended, running, runningSince } = turnsOf(log?.events)
905
929
  // A first call counts from the start of the round under way, so what it already wrote is
906
930
  // reported; one that comes after the goal stopped, from the start of the last round.
@@ -989,7 +1013,7 @@ export function apply(ctx) {
989
1013
  // A session at a glance, for a client that holds only its id: what it is doing, its goal
990
1014
  // and the reply of its last turn.
991
1015
  async function sessionStatus({ session_id }) {
992
- const [act, goal, log] = await Promise.all([activity({ session_id }), goalOf(session_id), controller.inspect(session_id, signal()).catch(() => null)])
1016
+ const [act, goal, log] = await Promise.all([activity({ session_id }), goalOf(session_id), sessionLog(session_id).catch(() => null)])
993
1017
  const { ended, running } = turnsOf(log?.events)
994
1018
  const question = questions.get(session_id)
995
1019
  return {
package/host/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-baton-host",
3
- "version": "0.6.5-next.2",
3
+ "version": "0.6.6",
4
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.",
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.5-next.2"
23
+ "dsh-baton-mcp": "0.6.6"
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.5-next.2",
3
+ "version": "0.6.6",
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.5-next.2",
10
+ "version": "0.6.6",
11
11
  "packages": [
12
12
  {
13
13
  "registryType": "npm",
14
14
  "identifier": "dsh-baton-mcp",
15
- "version": "0.6.5-next.2",
15
+ "version": "0.6.6",
16
16
  "transport": {
17
17
  "type": "stdio"
18
18
  }