dsh-taskbridge 1.8.0 → 1.9.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +246 -231
  3. package/antigravity/agents/dsh-taskbridge.md +17 -14
  4. package/antigravity/skills/dsh-taskbridge/SKILL.md +40 -27
  5. package/bin/dsh-delegate-codex-agent.js +9 -4
  6. package/codex/skills/dsh-taskbridge/SKILL.md +131 -0
  7. package/codex/skills/dsh-taskbridge/rules-reference-96027c387cb9b7587efa4aa3836235d86db1108068e007dc08196e807ca25e5d.md +114 -0
  8. package/docs/INTRODUCTION.md +148 -119
  9. package/docs/INTRODUCTION.zh.md +151 -134
  10. package/docs/antigravity-integration.md +47 -42
  11. package/docs/assets/taskbridge-workflow.en.svg +72 -0
  12. package/docs/assets/taskbridge-workflow.zh.png +0 -0
  13. package/docs/claude-code.md +18 -18
  14. package/docs/codex-integration.md +139 -113
  15. package/docs/conversation-placement.md +7 -6
  16. package/docs/releases/1.8.0.zh.md +16 -16
  17. package/docs/releases/1.8.1.zh.md +24 -0
  18. package/docs/releases/1.9.0.zh.md +31 -0
  19. package/docs/runtime-compatibility.md +7 -9
  20. package/docs/silent-wait.md +17 -26
  21. package/docs/taskbridge-upgrade.md +4 -4
  22. package/lib/client.d.ts +74 -3
  23. package/lib/client.js +7 -7
  24. package/locale/en.json +7 -7
  25. package/locale/zh.json +7 -7
  26. package/package.json +11 -4
  27. package/src/antigravity/installer.js +1099 -1046
  28. package/src/antigravity/seam.js +142 -142
  29. package/src/client/api.js +258 -16
  30. package/src/client/index.jsx +130 -26
  31. package/src/client/task-cleanup.js +130 -5
  32. package/src/codex/agent-ownership.js +72 -12
  33. package/src/codex/installer.js +691 -268
  34. package/src/config/defaults.js +11 -15
  35. package/src/http/execution-plane.js +17 -0
  36. package/src/http/user-plane.js +17 -1
  37. package/src/index.d.ts +9 -1
  38. package/src/index.js +86 -64
  39. package/src/jobs/engine.js +279 -5
  40. package/src/jobs/history.js +18 -2
  41. package/src/jobs/plan-store.js +83 -0
  42. package/src/jobs/record-cleanup.js +714 -195
  43. package/src/mcp/server.js +271 -38
  44. package/src/mcp/wait.js +34 -15
  45. package/src/runtime/agent-runner.js +1 -0
  46. package/src/runtime/permissions.js +18 -0
  47. package/src/runtime/session-placement.js +36 -1
  48. package/src/runtime/worker-prompt.js +14 -9
  49. package/src/workspace/worktrees.js +155 -1
  50. package/codex/dsh-taskbridge.toml +0 -170
@@ -0,0 +1,31 @@
1
+ # DSH TaskBridge 1.9.0 更新说明
2
+
3
+ ## 摘要
4
+
5
+ `1.9.0` 完成了 **Codex 原生技能(Skill + 按需附页)单链直等架构升级**、**跨宿主分层派工内核重构**、**多阶段隔离工作树复用与 MCP 往返减负**,以及 **DSH 插件市场「立刻启用」瞬间 404 竞态修复**:
6
+
7
+ 1. **Codex 从子智能体升级为原生技能(Skill)单链直等架构**:托管目标由旧版 `agents/dsh-taskbridge.toml` 升级为 `$CODEX_HOME/skills/dsh-taskbridge/SKILL.md` 及同目录哈希固定附页 `rules-reference-<sha256>.md`,让当前 Codex 会话在明确指派时读入紧凑入口并直调 `delegate_submit({ autoPreflight: true, wait: true })` + 单链 `delegate_wait`(配合 `tool_timeout_sec = 3660` 静默长等),根除 `spawn_agent` + 短超时 `wait_agent` 每 45–55 秒轮询空转。
8
+ 2. **老版本子智能体无感安全退役**:自动识别未修改过的 `0.1.6`–`1.8.x` 旧托管 `agents/dsh-taskbridge.toml` / `agents/dsh-delegate.toml`,在确保新技能落盘且写入前二次逐字节复验后安全删除;用户自定义编辑过的旧文件原样保留并提示。
9
+ 3. **跨宿主分层派工内核重构与双端理念对齐**:源码层将跨平台公共派工内核(`integrations/core/`)与各宿主薄适配壳(`integrations/adapters/`)分离并通过 `npm run build:integrations` 统一组装、单测锁死零漂移;双端统一为「**大任务拆小包 + 指方向与契约防跑偏(禁代写逐行代码)+ 务实审查防洁癖返工**」,Antigravity 同步收紧主控与 `flash` 子智能体省流边界。
10
+ 4. **跨子包隔离工作树复用与 MCP 往返压缩**:
11
+ - `delegate_submit` 新增 `reuseWorktreeFromTaskId`(下游子包复用上游已验收隔离 `worktree` 并开启全新 DSH 会话,全程不污染主仓库,联动清理自动做引用保护)及 `autoPreflight` / `wait` 单次调用合并;
12
+ - 正式版的 `delegate_permission_decide` 按本次调用的精确参数指纹逐次审批。预览版客户端通过 `allow-once` 传入 `scope: "task-command"` 时,正式版按单次审批 `scope: "once"` 处理。
13
+ - `delegate_result` 新增 `includeDiff: false`(本地审查 `executionWorkspacePath` 时免去重复回传大段补丁),任务回执补充 `execution.usage.delta` 与 `cumulative` 双口径统计。
14
+ 5. **彻底修复 DSH 插件市场「立刻启用」瞬间 404**:后端先注册 HTTP 路由再并行执行启动刷新,前端冷启动遇到短暂 404 时静默退避重试并自动恢复,不再连弹多条红框。
15
+
16
+ ---
17
+
18
+ ## 双端 7 题黑盒基准实测摘要(`1.9.0-test6` 候选构建 vs 同宿主无插件基线)
19
+
20
+ 以下为 `1.9.0-test6` 候选包的黑盒基准实测。用例覆盖边界拦截(`T0A`/`T0B`)、核心模块实现(`T1`–`T4`)和含 235 项单测的企业级三域计费平台重构(`T5`)。DSH 后端采用轻量模型 `deepseek-v4.1-flash`。
21
+
22
+ - **Antigravity 端(`gemini-4-neon-xhigh` 主控 + `flash` 后台子智能体)**:`7/7` 全满分通过(均分 `100`,`T1–T5` 同题得分与无插件基线 `5/5` 持平),`T1–T5` 同题主控平均步数 `11.00 → 11.80` 步基本持平(7 题全集均步 `9.57`),`T1–T5` 同题强模型**有效 Token(非缓存输入 + 输出)净省 `32.06%`**(`618,861 → 420,450`,其中 `T5` 净省 **`37.95%`**,`T1`/`T2`/`T3` 连含缓存总 Token 也比基线低 `9.8%`–`19.2%`)。
23
+ - **Codex 端(`gpt-6.2-sol / xhigh` 主控 + 原生 Skill 单链直等)**:`6/7` 通过,`T1–T5` 同题通过 `4/5`(均分 `96`)且逐题得分与无插件 Codex 基线 **100% 一致**(`T5` 满分通过,`T2` 两组显式传入超额策略补测均满分),`T1–T5` 同题主控平均步数 `11.20 → 28.60` 步(7 题全集均步 `21.29`),`T1–T5` 同题主控**有效 Token 净省 `24.50%`**(`608,065 → 459,102`,其中 `T5` 净省 **`43.32%`**、主控输出 Token 降 `47.9%`;7 题有效 Token 较旧轮询态 `2,367,661` 暴降 **78.7%**)。
24
+ - **结论要点**:多文件实现与跨模块重构(`T2`/`T3`/`T5`)强模型有效 Token 稳定节省 **13%–43.3%** 且同题得分与无插件基线完全持平;几分钟可改完的极小单点修改(`T4`)存在固定调度开销,建议直接在指挥端顺手完成。
25
+
26
+ ---
27
+
28
+ ## 升级说明
29
+
30
+ - **从 `1.8.1` 或更早版本升级**:在 DSH 中安装 `1.9.0` 并启用后,DSH 启动刷新会自动把未修改过的旧 `agents/dsh-taskbridge.toml`(及测试版 `SKILL.md`)迁移为最新 `skills/dsh-taskbridge/SKILL.md` + 规则附页并清理旧文件;随后新开 Codex 会话或重启 Codex 即可生效。
31
+ - **如果项目 `AGENTS.md` 仍写了“派给子智能体 `dsh-taskbridge`”**:建议同步改为由当前 Codex 会话按 `skills/dsh-taskbridge/SKILL.md` 直接执行单链 `delegate_submit` + `delegate_wait`,避免再次触发 `spawn_agent` + `wait_agent` 轮询。
@@ -1,6 +1,6 @@
1
1
  # Runtime compatibility
2
2
 
3
- Build 1.8.0 retains the loading policy introduced in 1.4.2: **no DSH version whitelist**: it omits `engines.dsh`, declares
3
+ Build 1.9.0 retains the loading policy introduced in 1.4.2: **no DSH version whitelist**: it omits `engines.dsh`, declares
4
4
  host-provided `@deepseek-ai/dsh-*` peers as `*`, and publishes no DSH engine range
5
5
  in the custom plugin index. The plugin uses runtime capability checks rather than
6
6
  rejecting a host solely by its version number. Node.js `>=24` is still required.
@@ -35,8 +35,8 @@ and does not represent whole-task or billing savings. See the 1.4.0 Release note
35
35
  the [measurement report](https://github.com/ranranyya/dsh-taskbridge/blob/master/docs/releases/1.4.0-token-benchmark.zh.md) for their exact boundaries.
36
36
  An older production profile must
37
37
  be upgraded to this build, and the
38
- Codex companion refreshed from the settings page (or by the startup check, which now also
39
- upgrades the installed MCP entry) and Codex reloaded before the new wait rules and the
38
+ Codex native skill refreshed from the settings page (or by the startup check, which also
39
+ upgrades the installed MCP entry and retires untouched legacy `.toml` subagents) and Codex reloaded before the new wait rules and the
40
40
  managed `tool_timeout_sec` take effect. No unit-test count and no mock constitutes an
41
41
  acceptance run.
42
42
 
@@ -53,7 +53,7 @@ acceptance run.
53
53
  - Development dependencies remain pinned for reproducible tests; they do not
54
54
  restrict the host-provided peer versions used by an installed plugin.
55
55
  - Older plugin packages keep their own metadata and can still be refused by a
56
- newer host. Upgrade to `dsh-taskbridge@1.5.2` to use this loading policy.
56
+ newer host. Upgrade to `dsh-taskbridge@1.9.0` (or `1.4.2+`) to use this loading policy.
57
57
 
58
58
  ## 2. What DSH 0.2.2 changes
59
59
 
@@ -183,16 +183,14 @@ What remains genuinely unverified:
183
183
 
184
184
  ## 5. Upgrading from an older plugin build
185
185
 
186
- 1. Download `dsh-taskbridge-1.5.2.tgz` from the GitHub Release, or build the package locally (`npm pack`).
186
+ 1. Download `dsh-taskbridge-1.9.0.tgz` from the GitHub Release (or install `dsh-taskbridge` from npm), or build the package locally (`npm pack`).
187
187
  2. Install it the way your surface requires: the Desktop **Plugins manager** for a
188
188
  Desktop profile (npm/CLI operations on that profile are refused), or
189
- `dsh plugin --profile <name> add ./dsh-taskbridge-1.5.2.tgz` for a CLI profile you
189
+ `dsh plugin --profile <name> add ./dsh-taskbridge-1.9.0.tgz` for a CLI profile you
190
190
  start yourself.
191
191
  3. The settings, the switch value and the task history are preserved
192
192
  (`$DSH_HOME/data/dsh-delegate`); nothing is migrated destructively.
193
- 4. If the Codex companion was installed, no action is needed: a `0.1.11` — or `0.1.10` —
194
- agent file whose bytes still match a published template is refreshed automatically on
195
- startup, or explicitly from the Codex panel. A file you edited is left untouched.
193
+ 4. If the Codex or Antigravity integration was installed, untouched managed files (including `0.1.10` / `0.1.11` through `1.8.x` legacy `.toml` companions and earlier `1.9.0` skills) are refreshed/migrated automatically on startup, or explicitly from the **Codex integration** / **Antigravity integration** panels. Any file you edited is left untouched.
196
194
  5. To roll back, re-install the older `.tgz`. The data directory is not deleted.
197
195
  Older packages retain their own version restrictions and may be refused by the
198
196
  host; the unrestricted policy is specific to 1.4.2 and later builds that keep it.
@@ -104,13 +104,14 @@ DSH **真正开始执行**、并且在执行满 `selfCheckSeconds` 时,插件
104
104
  | --- | --- | --- |
105
105
  | `heartbeat` | 没什么要报告的(内部心跳) | 正常情况下看不到;看到了就继续等待同一任务 |
106
106
  | `attention` | `checkpoint: "progress"` —— 任务**连续**超过提醒间隔没有**任何新成果回传给派工方**(默认 40 分钟)。**不是**"等待结束",也**不是**"跑得太久"。也可能是**重复失败**(`checkpoint: "failure"`,见 4.3) | 读诊断(`noDeliveryForMs` 是未回传多久,`activity` 是 DSH 在做什么),**默认继续等待**;不要在只是没回传成果时取消或判失败 |
107
- | `permission` | 有一次工具调用在等授权决定 | 审查这一次调用的完整操作,然后决定一次,再继续等待同一任务 |
107
+ | `permission` | 有一次工具调用在等授权决定 | 审查这一次调用的完整操作,然后决定一次(可带 `waitAfterDecision: true`),再继续等待同一任务 |
108
+ | `question` | 执行端发起了原生普通提问(`awaiting-question`) | 调用 `delegate_question_answer` 逐题作答(可带 `waitAfterAnswer: true` 直接续等);问答不授予任何权限 |
108
109
  | `ready` | 执行结束,等待宿主审查 | 读**一次**完整证据,自己审查;这不等于已接受 |
109
110
  | `failed` / `cancelled` | 运行没有产出 | 读一次记录的原因后报告 |
110
- | `interrupted` | **任务记录本身**已中断(例如进程重启留下),不会继续 | 读一次记录后报告;不要继续盲等同一任务 |
111
+ | `interrupted` | 本次等待观察被中断(`terminal: false` 且 `state` 为 `pending`/`running`),或任务记录本身是重启中断历史(`terminal: true` 且 `state: "interrupted"`) | 按返回字段区分(见 4.1):`terminal: false` 且仍在运行时继续 `delegate_wait` 同一任务;`terminal: true` 时调一次 `delegate_result` 后停止等待;状态未知时先调一次 `delegate_result` 核实 |
111
112
  | `wait-limit` | 本轮等待预算用完,任务没有任何变化 | `actionable: false`、`terminal: false`:不需要任何业务判断,立刻用同一 `taskId` 再等(不传 `waitSeconds`) |
112
113
 
113
- **`actionable` 的含义**:只有真正需要派工方处理的原因(`attention`、`permission`、`ready`、
114
+ **`actionable` 的含义**:只有真正需要派工方处理的原因(`attention`、`permission`、`question`、`ready`、
114
115
  `failed`、`cancelled`、`interrupted`)才是 `actionable: true`。`wait-limit` 是 `actionable: false`:
115
116
  它只说明**这次调用**自己的预算用完了,不是任务事实,也不需要决定。这个标志描述的是答案本身,
116
117
  **不承诺**派工方宿主不会因此唤醒它自己的模型——是否被唤醒由宿主管。
@@ -356,25 +357,16 @@ token 用量和费用在这个进程里**不可见**,因此报告为 `not-inte
356
357
  **最新的 `continueFromTaskId`**,引擎每次都重新校验所有权、路径、原 checkout 与会话。
357
358
  **绝不**用"改成新任务"绕过一次拒绝。
358
359
 
359
- ### 团队模式(Agent Teams)由指挥官按任务决定
360
+ ### 团队模式(Agent Teams,1.7.0+ 默认策略)
360
361
 
361
362
  `delegate_submit` 的可选布尔 `agentTeams` 选择 DSH 的 Agent Teams 模式
362
- (模型菜单里的"启用智能体团队协作")用于**本任务自己的** DSH 会话。它不是 Codex 自己的
363
- 多智能体功能。用户在派工制度上决定一次"由 Codex 按复杂度决定",
364
- 不需要每次派工都问用户。
365
-
366
- - 简单单文件或强顺序依赖的活:**显式**传 `agentTeams: false`(schema 支持该字段时)。
367
- **省略字段不等于关闭**——省略表示"没有做出新决定",运行会保留(续接时继承)会话原有的选择。
368
- 仓库 AGENTS 禁止再委派的场景必须显式 `false`,并交代哪些操作改由 root 执行(那些仍需正常审批)。
369
- - 只有确实能拆成**可并行**的独立模块、且收益覆盖协调成本时才打开,并在派工文本里写明理由。
370
- - 续接不重复决策:插件继承链条的选择,省略即沿用父任务;要让这一次跟进关闭,必须显式 `false`;
371
- 只有范围变化足以推翻时才显式给出新值。
372
- - 执行用的 provider / model / effort 仍由用户的配置决定,`agentTeams` **从不覆盖**它们。
373
- - 只通过这个 schema 字段表达。工具版本不支持时要**说明并请求加载新集成**,
374
- 不得伪造成功,也不得改用别的字段、任务文本或其他通道。
375
- - 团队成员按 DSH 原生策略运行(子成员的审批默认 `never`),只能在既有范围内工作;
376
- 需要额外权限的**具体动作由 root 执行**,再走本通道原有的单次审批。
377
- 不要宣称子成员审批已打通,不要放松 `owns`,不要改宿主策略。
363
+ (模型菜单里的"启用智能体团队协作")用于**本任务自己的** DSH 会话。它不是 Codex 或 Antigravity 自己的多智能体功能:
364
+
365
+ - **默认省略,仅在用户明确指定时传值**:指挥端**仅当用户在本次派工中明确要求开启或关闭**智能体团队协作时,才显式传 `agentTeams: true` 或 `agentTeams: false`;用户未明确提及时一律**省略**该字段。
366
+ - **新任务与续接的回退规则**:省略 `agentTeams` 时,新任务沿用插件「执行设置 → 新任务默认开启智能体协作」开关(新安装与升级默认关闭);`continueFromTaskId` 续接任务自动继承原任务链的选择(若早期历史记录未存过选择,插件不写入任何值,保留该原生会话现有模式)。
367
+ - **不支持团队协作宿主的严格行为**:若当前 DSH 没有智能体协作服务,显式传 `true` **或**显式传 `false` 都会在投递提示词前直接拒绝(必须原样回报拒绝原因,切勿改传另一值重试);只有插件默认的隐式关闭仍会照常运行,并在回执中如实报告 `team.applied: false`(未应用,不要将其表述为“已关闭团队”)。
368
+ - 执行用的 provider / model / effort 仍由用户的配置决定,`agentTeams` **从不覆盖**它们;一个外层派工始终只占一个并发名额。
369
+ - 团队成员按 DSH 原生策略运行(子成员的审批默认 `never`),只能在既有范围内工作;需要额外权限的**具体动作由 root 执行**,再走本通道原有的逐次审批。
378
370
 
379
371
  ### 审查证据的读法
380
372
 
@@ -388,14 +380,14 @@ token 用量和费用在这个进程里**不可见**,因此报告为 `not-inte
388
380
  ## 8. 已有用户如何升级
389
381
 
390
382
  1. 在 DSH 的插件设置页打开 **Codex 集成**;
391
- 2. 点 **安装 / 更新 Codex 集成**(按钮会把这个插件发布的旧版本文件更新到当前版本);
383
+ 2. 点 **安装 / 更新 TaskBridge 技能**(按钮会安装原生技能 `skills/dsh-taskbridge/SKILL.md`、更新托管 MCP 条目并安全退役未修改的旧版子智能体文件);
392
384
  3. 让 Codex 重新载入:新开会话或重启 Codex。
393
385
 
394
386
  `1.2.0` 起,**入口脚本路径未变的已安装托管条目不再需要手工点按钮**:插件启动自检会检查已安装的
395
387
  `mcp_servers.dsh-delegate` 条目,只要它带托管标记、command 是本包的 Node 命令、`args[0]`
396
388
  **正好是本安装的** `dsh-delegate-mcp.js`,而且**已经过期**(缺少 `tool_timeout_sec`),就在原地补齐。
397
389
  入口脚本路径已经指向插件旧目录的条目,启动自检只会报告 `conflict`,不会替操作者改路径:请点
398
- **安装 / 更新 Codex 集成** 或 **修复**,显式动作才会在证明该旧路径是同一包的**真实安装**
390
+ **安装 / 更新 TaskBridge 技能** 或 **仅修复 MCP 配置**,显式动作才会在证明该旧路径是同一包的**真实安装**
399
391
  (真实目录 + `package.json` 的 `name` 与 `bin["dsh-delegate-mcp"]` 映射都对得上)之后采纳它。
400
392
 
401
393
  更新会为托管 MCP 条目补上 `tool_timeout_sec = 3660`。客户端可能不认这个字段,或用自己的默认
@@ -406,15 +398,14 @@ token 用量和费用在这个进程里**不可见**,因此报告为 `not-inte
406
398
  - 旧版本写的、带托管标记的条目会被就地补齐,文件里其它内容原样保留;
407
399
  - 没有托管标记的同名条目视为**你自己写的**,不会被改写、覆盖或删除;
408
400
  - 值不是整数的条目同样视为别人的定义;
409
- - 你自己编辑过的子智能体文件会被报告为"不属于已知版本",插件不会改动它;
401
+ - 你自己编辑过的技能文件或旧子智能体文件会被报告为"不属于已知版本",插件不会改动它;
410
402
  - 启动自检**不会创建**条目:没安装就什么都不写;
411
- - `$CODEX_HOME` 或 `agents/` 是链接(含 Windows junction)时一律拒绝,连条目状态都不再
412
- 穿过链接去读;
403
+ - `$CODEX_HOME`、`skills/`、`skills/dsh-taskbridge/` 或 `agents/` 是链接(含 Windows junction)时一律拒绝,连条目状态都不再穿过链接去读;
413
404
  - 写前重新读取并重新判定,期间发生变化(漂移)就拒绝,不覆盖。
414
405
 
415
406
  ## 9. 已知限制
416
407
 
417
- - 插件的监控只在**有人观察**时运行:没有派工方在等待时,它不启动定时器,也不消耗任何东西。
408
+ - **本机自检与观察回调的分工**:开始运行满 10 分钟(默认)的只读本机自检随任务真正启动执行排一次性可取消定时器(无需派工方正在等待,任务结束即清除,零模型消耗);40 分钟(默认)无新成果回传的进度检查与重复失败提醒则在派工方调用 `delegate_wait` 观察时返回,空闲时不产生任何后台轮询消耗。
418
409
  - 提醒阈值是安全网,不是进度条。插件**不**计算完成百分比,也**不**猜测还剩多久。
419
410
  - 一次 `delegate_wait` 的默认等待是 3600 秒(上限也是 3600 秒),每次内部观察最多 25 秒;
420
411
  前者由工具本身约束,与 `tool_timeout_sec` 的关系是:后者必须比前者略大,才能让一整轮
@@ -6,17 +6,17 @@
6
6
 
7
7
  1. 等待当前任务结束,关闭旧插件的本机调用开关。
8
8
  2. 在 DSH 插件管理中停用并卸载本项目旧 `dsh-delegate` 或 `dsh-taskdispatch` 包。**保留 `<DSH_HOME>/data/dsh-delegate` 数据目录**;DSH 若提供删除数据选项,不要勾选。新旧包不能同时启用。
9
- 3. 在“添加插件”中输入 **`dsh-taskbridge`**。中国大陆镜像未同步时改选 npm 官方源。也可安装对应版本的本地包,例如 `dsh-taskbridge-1.8.0.tgz`,或添加本项目固定 Git 提交的自定义索引。不要手动修改 Desktop 保留的 profile。
9
+ 3. 在“添加插件”中输入 **`dsh-taskbridge`**。中国大陆镜像未同步时改选 npm 官方源。也可安装对应版本的本地包,例如 `dsh-taskbridge-1.9.0.tgz`,或添加本项目固定 Git 提交的自定义索引。不要手动修改 Desktop 保留的 profile。
10
10
  4. 打开 **DSH TaskBridge** 配置页,核对 API、模型、思考强度和总开关。数据目录与旧版相同;安装前关闭旧开关,避免恢复之前保存的开启状态。
11
- 5. 在 Codex 集成中点击“安装 / 更新 TaskBridge 智能体”,更新智能体及 MCP,然后重新加载 Codex。未修改的旧 `dsh-delegate.toml` 会迁移为 `dsh-taskbridge.toml`;修改过的文件保留。只需修复 MCP 时可使用“仅修复 MCP 配置”。启动自检不会接管其他安装目录。
11
+ 5. 在 Codex 集成中点击“安装 / 更新 TaskBridge 技能”,安装原生技能 `skills/dsh-taskbridge/SKILL.md` 并更新 MCP,然后重新加载 Codex。未修改的旧 `agents/dsh-delegate.toml` 与 `agents/dsh-taskbridge.toml` 会在迁移后自动安全移除;用户手动改过的文件原样保留。只需修复 MCP 时可使用“仅修复 MCP 配置”。启动自检不会接管其他安装目录。
12
12
  6. 若添加过旧索引,改用 `https://ranranyya.github.io/dsh-taskbridge/index.json`。
13
13
 
14
14
  ## 保持兼容的技术标识
15
15
 
16
16
  - 数据与端点:`<DSH_HOME>/data/dsh-delegate`、`runtime-endpoint.json`。
17
17
  - 环境变量:`DSH_DELEGATE_*`。
18
- - MCP 工具:`delegate_status`、`delegate_preflight`、`delegate_submit`、`delegate_wait`、`delegate_result`、`delegate_cancel`、`delegate_permission_decide`。
19
- - Codex MCP 条目:`mcp_servers.dsh-delegate`。智能体文件从 1.3.2 起改为 `agents/dsh-taskbridge.toml`,对外名称为 `dsh-taskbridge`。
18
+ - MCP 工具(全套 11 个):`delegate_status`、`delegate_preflight`、`delegate_plan`、`delegate_submit`、`delegate_wait`、`delegate_permission_decide`、`delegate_question_answer`、`delegate_result`、`delegate_review`、`delegate_cancel`、`delegate_metrics`。
19
+ - Codex MCP 条目:`mcp_servers.dsh-delegate`。1.9.0 起 Codex 托管规则改为原生技能 `skills/dsh-taskbridge/SKILL.md`(并自动安全退役未修改的旧版 `agents/dsh-taskbridge.toml` / `agents/dsh-delegate.toml`)。
20
20
  - MCP/控制程序:`bin/dsh-delegate-mcp.js`、`bin/dsh-delegate-control.js`。
21
21
 
22
22
  保留的内部名称不会让安装指向其他 npm 项目。仍存在的旧包入口须证明真实文件、bin 映射及本项目仓库来源。1.3.2 的显式安装/修复也接受本插件目录旁已卸载的 `node_modules/dsh-delegate` 或 `dsh-taskdispatch` 标准入口,前提是原 MCP 配置带托管标记且结构符合插件规则。其他路径、自定义包装器和用户编辑过的智能体文件保留;启动自检不会接管搬家路径。
package/lib/client.d.ts CHANGED
@@ -483,10 +483,10 @@ export declare const ROUTES: Readonly<Record<string, string>> & {
483
483
  };
484
484
 
485
485
  /**
486
- * One target's presentation state: agent file, MCP entry or DSH switch.
486
+ * One target's presentation state: Codex skill file (`SKILL.md`), MCP entry or DSH switch.
487
487
  *
488
488
  * The three are reported separately because they are independent: an installed
489
- * agent does not imply a configured MCP entry, and neither implies that the DSH
489
+ * skill does not imply a configured MCP entry, and neither implies that the DSH
490
490
  * local-call switch is on.
491
491
  */
492
492
  export interface DelegateCodexTargetView {
@@ -548,6 +548,17 @@ export interface DelegateCleanupCandidate {
548
548
  parentNodeId: string | null;
549
549
  nodeId: string | null;
550
550
  nodeKind: string;
551
+ /**
552
+ * The host's status for the chain (`accepted`, `failed`, `cancelled`, …), or `null`
553
+ * when the projection stated none. It is what the preset shortcuts read; the page
554
+ * never derives it from a title or a time.
555
+ */
556
+ nodeStatus?: string | null;
557
+ /**
558
+ * The chain's isolation (`worktree` or `shared`), when the projection stated one.
559
+ * It is descriptive only: the browser half never decides what may be deleted from it.
560
+ */
561
+ isolation?: string | null;
551
562
  selectable: boolean;
552
563
  blockers: string[];
553
564
  reason: string | null;
@@ -605,7 +616,63 @@ export declare function cleanupSelectionSummary(
605
616
  export declare function cleanupRequest(
606
617
  selection: Record<string, string[]>,
607
618
  candidates: DelegateCleanupCandidate[],
608
- ): { body: { chains: DelegateCleanupChain[] }; problems: string[] };
619
+ options?: DelegateCleanupOptions,
620
+ ): { body: DelegateCleanupRequest; problems: string[] };
621
+
622
+ /**
623
+ * The linked cleanup choices of one batch. Each flag is independently opt-in and is
624
+ * absent from the request body unless it is `true`; the host treats an absent flag as
625
+ * "leave that alone".
626
+ *
627
+ * - `archiveSessions` archives the dispatched DSH conversation of each removed round.
628
+ * - `removeWorktrees` removes a `worktree`-isolated task's managed tree and its
629
+ * temporary Workspace; a `shared` task's directory and the source checkout are
630
+ * never touched.
631
+ * - `cleanPlans` removes planning nodes that no remaining task still references.
632
+ */
633
+ export interface DelegateCleanupOptions {
634
+ archiveSessions?: boolean;
635
+ removeWorktrees?: boolean;
636
+ cleanPlans?: boolean;
637
+ }
638
+
639
+ /** The request body of `POST /api/dsh-delegate/tasks/cleanup`. */
640
+ export interface DelegateCleanupRequest {
641
+ chains: DelegateCleanupChain[];
642
+ archiveSessions?: true;
643
+ removeWorktrees?: true;
644
+ cleanPlans?: true;
645
+ }
646
+
647
+ /** Which status group one preset shortcut selects. */
648
+ export declare const CLEANUP_PRESETS: readonly ['all', 'accepted', 'failed-cancelled'];
649
+
650
+ /**
651
+ * Batch-select the selectable chains matching a preset, optionally restricted to the
652
+ * chain ids currently visible under the page's own filters.
653
+ * @param candidates - current candidates.
654
+ * @param preset - `all`, `accepted` (chains the host accepted) or `failed-cancelled`.
655
+ * @param visibleChainIds - optional set/array of chain ids the filter leaves visible.
656
+ * @returns the selection map, bounded to `MAX_CLEANUP_CHAINS`.
657
+ */
658
+ export declare function selectCleanupCandidatesByPreset(
659
+ candidates: DelegateCleanupCandidate[],
660
+ preset?: 'all' | 'accepted' | 'failed-cancelled',
661
+ visibleChainIds?: Set<string> | string[] | null,
662
+ ): Record<string, string[]>;
663
+
664
+ /**
665
+ * The confirmation sentence drawn above the confirm button, before anything is sent.
666
+ * @param summary - the selection's chain/round counts.
667
+ * @param options - the linked cleanup choices currently ticked.
668
+ */
669
+ export declare function cleanupConfirmText(
670
+ summary: { chains: number; rounds: number },
671
+ options?: DelegateCleanupOptions,
672
+ ): string;
673
+
674
+ /** Plain-Chinese description of one completed orphan worktree/session sweep. */
675
+ export declare function describeOrphanCleanupOutcome(outcome: unknown): string;
609
676
 
610
677
  /** Stable fingerprint of a selection, for change detection across refreshes. */
611
678
  export declare function cleanupSelectionKey(
@@ -679,6 +746,10 @@ export interface DelegateClientModule {
679
746
  cleanupOutcome: typeof cleanupOutcome;
680
747
  describeCleanupOutcome: typeof describeCleanupOutcome;
681
748
  cleanupWarningText: typeof cleanupWarningText;
749
+ /** Linked cleanup: preset shortcuts, confirmation text and the orphan sweep summary. */
750
+ selectCleanupCandidatesByPreset: typeof selectCleanupCandidatesByPreset;
751
+ cleanupConfirmText: typeof cleanupConfirmText;
752
+ describeOrphanCleanupOutcome: typeof describeOrphanCleanupOutcome;
682
753
  /** Execution choices: the new-task Agent Teams default and its origin labels. */
683
754
  executionOf: typeof executionOf;
684
755
  AGENT_TEAMS_DEFAULT_FOR_NEW_TASKS: typeof AGENT_TEAMS_DEFAULT_FOR_NEW_TASKS;