dsh-taskbridge 1.3.1 → 1.3.2
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/CHANGELOG.md +9 -0
- package/README.md +36 -38
- package/bin/dsh-delegate-codex-agent.js +1 -1
- package/codex/{dsh-delegate.toml → dsh-taskbridge.toml} +14 -12
- package/docs/INTRODUCTION.md +2 -2
- package/docs/INTRODUCTION.zh.md +4 -2
- package/docs/codex-integration.md +27 -12
- package/docs/conversation-placement.md +11 -0
- package/docs/plugin-market.md +1 -1
- package/docs/runtime-compatibility.md +13 -10
- package/docs/taskbridge-upgrade.md +6 -6
- package/lib/client.js +6 -6
- package/package.json +6 -3
- package/src/client/index.jsx +6 -6
- package/src/codex/installer.js +50 -11
- package/src/http/execution-plane.js +2 -0
- package/src/index.js +1 -1
- package/src/jobs/engine.js +5 -0
- package/src/jobs/title.js +17 -0
- package/src/mcp/server.js +2 -1
- package/src/runtime/agent-runner.js +2 -0
- package/src/runtime/session-placement.js +20 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.2 — TaskBridge companion and descriptive task workspace names
|
|
4
|
+
|
|
5
|
+
- Rename the shipped Codex companion to `dsh-taskbridge` (`agents/dsh-taskbridge.toml`). Install and startup migrate an unchanged, recognized published `dsh-delegate.toml` and remove the old managed file; edited agent files remain operator-owned. Add TaskBridge CLI aliases while retaining the existing binaries and internal MCP identifiers.
|
|
6
|
+
- Add an optional `title` to `delegate_submit` and carry it through HTTP, the job engine and the native Workspace controller. Newly created Workspaces use a short description of the work rather than the worktree's `task-UUID` directory name. Older callers derive a title from the prompt's goal. Follow-ups and existing Workspaces keep their titles; duplicate titles receive a short suffix. No additional model call is made for naming.
|
|
7
|
+
- Explicit Codex install/repair can migrate a marked legacy MCP entry after the old package was uninstalled, when its missing package path is a known sibling of the current `dsh-taskbridge` installation. Custom wrappers, unrelated paths and automatic startup path adoption remain excluded.
|
|
8
|
+
- Update the settings page, companion dispatch rules and upgrade instructions. Model selection, delegation authorization, quiet waiting and host review retain their existing behavior.
|
|
9
|
+
|
|
10
|
+
- Make loopback HTTP test fixtures avoid Fetch-blocked ports, which Windows can allocate from a customized low dynamic-port range. This only affects tests.
|
|
11
|
+
|
|
3
12
|
## 1.3.1 — DSH TaskBridge identity and npm distribution
|
|
4
13
|
|
|
5
14
|
- Unify the project, GitHub repository, plugin title, package and bundle identity as **DSH TaskBridge** / `dsh-taskbridge`. The previous GitHub-only `dsh-taskdispatch` name was rejected by npm's similarity protection; it never became an npm package.
|
package/README.md
CHANGED
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
你向指挥端提出目标;指挥端规划、拆分、派工和审查,DSH 根据插件设置执行。插件可选择 DSH 已接入的 API 提供方、执行模型及其支持的思考强度,并配置超时、并发与工作区隔离;额外模型审查可单独开关和配置。任务交付后集中审查,需要改进时续接同一任务对话。
|
|
6
6
|
|
|
7
7
|
- [详细中文介绍](docs/INTRODUCTION.zh.md) · [English introduction](docs/INTRODUCTION.md)
|
|
8
|
-
- [从 DSH Delegate/TaskDispatch 迁移到
|
|
8
|
+
- [从 DSH Delegate/TaskDispatch 迁移到 TaskBridge](docs/taskbridge-upgrade.md):包名为 `dsh-taskbridge`,保留旧数据和 MCP 技术标识,不要同时启用新旧插件。
|
|
9
9
|
- [在 DSH“发现”中搜索和安装](docs/plugin-market.md):添加本项目的自定义索引,安装源固定到本项目的 Git 提交。
|
|
10
10
|
- [Claude Code 手动 MCP 接入](docs/claude-code.md);Codex 继续使用设置页的安装/修复按钮。Claude Code 的一键安装按钮和真实客户端验收尚未完成。
|
|
11
|
+
- [1.3.2 更新说明](docs/releases/1.3.2.zh.md):Codex 智能体更名、任务工作区命名和旧安装路径修复;[1.3.1 发布报告](docs/releases/1.3.1.zh.md)保留历史分发核验结果。
|
|
11
12
|
|
|
12
13
|
DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总开关后,调用 DSH
|
|
13
14
|
已配置的接口执行任务,执行结果回到宿主(例如 Codex)自行验收。
|
|
@@ -15,7 +16,7 @@ DeepSeek Harness(DSH)的委托插件:让 MCP 宿主在你开启本机总
|
|
|
15
16
|
新安装时本机调用总开关默认关闭。开关状态会保存在插件设置中,重启后恢复保存值;
|
|
16
17
|
关闭时拒绝新的委派任务,并请求停止正在运行的任务。
|
|
17
18
|
|
|
18
|
-
> **发布版本:`1.3.
|
|
19
|
+
> **发布版本:`1.3.2`(智能体更名与任务工作区命名)。** 源码仓库和可下载的 Release
|
|
19
20
|
> 位于 [GitHub](https://github.com/ranranyya/dsh-taskbridge)。npm 安装标识为 **`dsh-taskbridge`**,
|
|
20
21
|
> GitHub Release 同时提供 `.tgz`。`1.1.0` 的静默等待说明见
|
|
21
22
|
> [`docs/silent-wait.md`](./docs/silent-wait.md);`1.2.0` 修正了其中三处真实问题(等待中断的
|
|
@@ -46,13 +47,13 @@ profile 是**应用保留的**:npm / `dsh plugin` CLI 对该 profile 的操作
|
|
|
46
47
|
Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式 profile 里执行 npm/pnpm
|
|
47
48
|
命令,也不要直接编辑其中的文件。
|
|
48
49
|
|
|
49
|
-
1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.3.
|
|
50
|
+
1. 打开 Desktop 的 **Plugins manager → 添加插件**,输入 **`dsh-taskbridge@1.3.2`**。
|
|
50
51
|
若中国大陆镜像尚未同步,先选择 npm 官方源再重试。安装后的显示名为 **DSH TaskBridge**。
|
|
51
52
|
也可以从本项目 Release 下载 `.tgz`,或在仓库根目录打包:
|
|
52
53
|
|
|
53
54
|
```bash
|
|
54
55
|
npm pack
|
|
55
|
-
# → dsh-taskbridge-1.3.
|
|
56
|
+
# → dsh-taskbridge-1.3.2.tgz
|
|
56
57
|
```
|
|
57
58
|
|
|
58
59
|
2. 使用本地包时,通过 **添加插件**入口选择下载或生成的 `.tgz`(或本仓库目录)完成安装。
|
|
@@ -66,7 +67,7 @@ Desktop 侧的包操作只能交给应用完成——不要在 Desktop 的正式
|
|
|
66
67
|
|
|
67
68
|
```bash
|
|
68
69
|
# 装进一个 profile(例:web)
|
|
69
|
-
dsh plugin --profile web add ./dsh-taskbridge-1.3.
|
|
70
|
+
dsh plugin --profile web add ./dsh-taskbridge-1.3.2.tgz && dsh plugin --profile web why dsh-taskbridge
|
|
70
71
|
|
|
71
72
|
# 启动(首次启动会自动把插件 bundle 追加到 dsh.profile.bundles)
|
|
72
73
|
dsh --profile web
|
|
@@ -79,7 +80,7 @@ dsh --profile web
|
|
|
79
80
|
### 说明与注意
|
|
80
81
|
|
|
81
82
|
- **不要装进你正在用的正式 profile 做试验。** 建议先用一次性 profile:
|
|
82
|
-
`dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.3.
|
|
83
|
+
`dsh plugin --profile dsh-delegate-try add ./dsh-taskbridge-1.3.2.tgz`,再把
|
|
83
84
|
`DSH_HOME` 指向临时目录做隔离验证。该命令同样只用于 CLI profile。
|
|
84
85
|
- 该包声明了 `@deepseek-ai/dsh-*` 的 peer,若你的包管理器默认自动安装 peer,
|
|
85
86
|
安装过程会尝试解析这些版本。可显式关闭:`npm_config_auto_install_peers=false`
|
|
@@ -123,6 +124,8 @@ dsh --profile web
|
|
|
123
124
|
`continueFromTaskId` 的**跟进任务**才会续接那一条任务会话(同 Workspace、同 Session)。
|
|
124
125
|
详见 `docs/conversation-placement.md`。
|
|
125
126
|
|
|
127
|
+
**工作区按内容命名。** 派工时通过 `delegate_submit.title` 提供简短任务名称,例如“制作潘德 G 版装备表”。新建的 DSH Workspace 使用这个名称;旧客户端未提供标题时从任务目标中提取,不会额外调用模型。名称重合时追加短标识。续接任务及已有 Workspace 保持原名称,磁盘中的工作树路径仍使用任务 ID。
|
|
128
|
+
|
|
126
129
|
## 4. 本机调用开关
|
|
127
130
|
|
|
128
131
|
- 新安装默认关闭;安装、提示词内容和模型调用都不会自动开启它。
|
|
@@ -229,26 +232,19 @@ dsh --profile web
|
|
|
229
232
|
|
|
230
233
|
### 6.1 Codex 集成(设置页一键安装)
|
|
231
234
|
|
|
232
|
-
Codex
|
|
235
|
+
Codex 支持一键安装集成。**「Codex 集成」**分页提供一个明确的按钮动作:点击一次即可完成
|
|
233
236
|
|
|
234
|
-
1. 安装自定义子智能体文件 `CODEX_HOME/agents/dsh-
|
|
235
|
-
时为 `%USERPROFILE%\.codex\agents\dsh-
|
|
237
|
+
1. 安装自定义子智能体文件 `CODEX_HOME/agents/dsh-taskbridge.toml`(未设置 `CODEX_HOME`
|
|
238
|
+
时为 `%USERPROFILE%\.codex\agents\dsh-taskbridge.toml`);
|
|
236
239
|
2. 在 `CODEX_HOME/config.toml` 里登记本包自带的 stdio MCP 服务
|
|
237
240
|
`mcp_servers.dsh-delegate`,让子智能体可以使用 `delegate_status` /
|
|
238
|
-
`delegate_preflight` / `delegate_submit` / `delegate_result` / `delegate_cancel` /
|
|
241
|
+
`delegate_preflight` / `delegate_submit` / `delegate_wait` / `delegate_result` / `delegate_cancel` /
|
|
239
242
|
`delegate_permission_decide`。
|
|
240
243
|
|
|
241
244
|
需要说明的边界(分页里也有同样的提示):
|
|
242
245
|
|
|
243
|
-
-
|
|
244
|
-
|
|
245
|
-
「仅修复 MCP 配置」「移除插件托管项」三个按钮。唯一的例外是**插件启动时的一次受限迁移**:
|
|
246
|
-
只有当 `agents/dsh-delegate.toml` 与某个**已发布版本的模板逐字节相同**(枚举的摘要表)时,
|
|
247
|
-
才会把它刷新为当前版本;比较的是**原始字节**,插件不会把 CRLF 归一化成 LF 再比,也不会改写
|
|
248
|
-
你文件的行尾。已发布版本若同时存在打包的 CRLF 与 LF 文本两种字节形态,摘要表会为两种形态各列
|
|
249
|
-
一条,两条都是精确的已发布身份。它**不会**创建缺失的 agent、不会创建 `agents/` 目录、不会写
|
|
250
|
-
`config.toml`,正文被改过或来源不明的文件一律不动。「刷新状态」和分页打开时的读取都只是只读诊断。
|
|
251
|
-
- **不覆盖、不删除你写的文件。** 同名但内容不同的 `agents/dsh-delegate.toml` 会被保留,
|
|
246
|
+
- **首次安装由按钮触发,启动刷新已有托管集成。** 点击「安装 / 更新 TaskBridge 智能体」安装智能体和 MCP;「仅修复 MCP 配置」不改智能体。启动时会刷新与已发布模板字节一致的文件,并更新同一安装位置的已托管 MCP 配置。1.3.2 还会把未修改的旧 `agents/dsh-delegate.toml` 迁移成 `agents/dsh-taskbridge.toml`,清除旧文件,避免两个名字同时出现。没有既有托管智能体时,启动不会首次安装;正文被改过或新文件被用户占用时保留用户文件。「刷新状态」和分页打开时的读取只做诊断。
|
|
247
|
+
- **不覆盖、不删除你写的文件。** 同名但内容不同的 `agents/dsh-taskbridge.toml` 会被保留,
|
|
252
248
|
界面报告为「不属于已知版本」;只有与**某个已发布版本逐字节相同**的托管文件才会被更新或删除,
|
|
253
249
|
仅版本号变旧、正文被改过一字的文件都不会动。`config.toml` 里由插件写入的条目带托管标记注释;
|
|
254
250
|
**没有该标记**的同名条目(即使 `command`/`args` 与插件要写的完全一致)同样视为你自己写的,
|
|
@@ -283,11 +279,11 @@ Codex 是唯一支持的宿主。**「Codex 集成」**分页提供一个明确
|
|
|
283
279
|
- **安装后需要 Codex 重新载入。** 新开会话或重启 Codex 才会读到新的子智能体和 MCP 条目。
|
|
284
280
|
Codex 官方文档说明了[自定义子智能体](https://learn.chatgpt.com/docs/agent-configuration/subagents)和
|
|
285
281
|
[MCP 连接](https://learn.chatgpt.com/docs/extend/mcp?surface=cli);这些文档支持 agent 配置与
|
|
286
|
-
MCP 继承,但**没有**说明当前 Codex 桌面版/CLI 的输入框支持用 `@dsh-
|
|
282
|
+
MCP 继承,但**没有**说明当前 Codex 桌面版/CLI 的输入框支持用 `@dsh-taskbridge` 选中该子智能体。
|
|
287
283
|
本插件因此**不宣称**任何 Codex 界面支持这种 `@` 直接调用,只保证子智能体文件与 MCP 工具存在,
|
|
288
284
|
由你通过 Codex 自身提供的选择方式指派它。
|
|
289
|
-
- **触发规则写死在 agent 文件里**(见 `codex/dsh-
|
|
290
|
-
(例如写出 `@dsh-
|
|
285
|
+
- **触发规则写死在 agent 文件里**(见 `codex/dsh-taskbridge.toml`):只有在父请求明确指派
|
|
286
|
+
(例如写出 `@dsh-taskbridge`、从智能体列表中选择它,或明确要求把该实现任务交给 DSH)时才派发;
|
|
291
287
|
仅仅在无关问题里提到 DSH / DeepSeek / 本插件**不是**派发请求。派发前先调用
|
|
292
288
|
`delegate_status` 检查开关,再调用 `delegate_preflight` 读取工作区事实:干净仓库按插件设置里
|
|
293
289
|
的 **worktree** 隔离派发;**脏仓库不会被自动降级**,指挥官根据任务和变更路径判断能否安全共享,
|
|
@@ -313,8 +309,8 @@ node bin/dsh-delegate-codex-agent.js remove # 只删除插件托管项
|
|
|
313
309
|
退出码:`0` 完成,`2` 因冲突/拒绝而未改动,`1` 失败。
|
|
314
310
|
|
|
315
311
|
已安装的托管 MCP 条目会在插件启动时**自动**原地补齐缺失的 `tool_timeout_sec`(入口脚本正好是
|
|
316
|
-
本安装时)。入口路径已经指向旧安装的条目不会被启动自检改写:请用「安装 / 更新
|
|
317
|
-
「仅修复 MCP
|
|
312
|
+
本安装时)。入口路径已经指向旧安装的条目不会被启动自检改写:请用「安装 / 更新 TaskBridge 智能体」或
|
|
313
|
+
「仅修复 MCP 配置」显式采纳;仍存在的旧包须证明身份,已卸载的同级旧包按 1.3.2 的标准路径规则迁移。显式按钮仍然是
|
|
318
314
|
未安装时唯一会创建条目的动作。
|
|
319
315
|
|
|
320
316
|
## 7. 凭据隔离
|
|
@@ -348,10 +344,10 @@ node bin/dsh-delegate-codex-agent.js remove # 只删除插件托管项
|
|
|
348
344
|
运行时走旧路径;读回失败在任何路径上都是投递提示词之前的严格失败,不会以“未声明的路线”运行。
|
|
349
345
|
细节与逐版本对照见 [`docs/runtime-compatibility.md`](./docs/runtime-compatibility.md)。
|
|
350
346
|
- 续接的会话身份规则见第 6 节(同一已验证 `connectionId`、重启后与持久 history 互证)。这条
|
|
351
|
-
|
|
347
|
+
能力已包含在插件中;本文件**不声称** DSH Desktop 真实安装
|
|
352
348
|
已通过,也不声称做过真实攻击复现。
|
|
353
|
-
-
|
|
354
|
-
|
|
349
|
+
- DSH Desktop 正式版本上的真实安装与真实模型执行验收尚未完成;`0.2.2-rc.1` 的原生全量加载
|
|
350
|
+
已在隔离夹具通过,具体范围见运行时兼容文档,不能等同于生产环境端到端验收。
|
|
355
351
|
|
|
356
352
|
详见 `docs/worker-permissions.md`。
|
|
357
353
|
|
|
@@ -418,7 +414,7 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
|
|
|
418
414
|
60 分钟的等待跑完;客户端如果应用自己的默认工具超时(Codex 的历史默认是一分钟),仍可能提前
|
|
419
415
|
结束等待,这是插件不能解除的客户端限制。
|
|
420
416
|
|
|
421
|
-
升级后的操作:设置页 → Codex 集成 → **安装 / 更新
|
|
417
|
+
升级后的操作:设置页 → Codex 集成 → **安装 / 更新 TaskBridge 智能体**,然后让 Codex 重新载入
|
|
422
418
|
(新开会话或重启)。
|
|
423
419
|
|
|
424
420
|
完整说明见 [`docs/silent-wait.md`](./docs/silent-wait.md)。
|
|
@@ -487,7 +483,7 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
|
|
|
487
483
|
command 是本包的 Node 命令、`args[0]` 正好是本安装的 `dsh-delegate-mcp.js`)**且**缺
|
|
488
484
|
`tool_timeout_sec` 的条目,才会在原地补齐。入口路径已经指向旧安装的条目只会被报告为
|
|
489
485
|
`conflict`,启动不会替操作者改路径。
|
|
490
|
-
- 「安装 / 更新
|
|
486
|
+
- 「安装 / 更新 TaskBridge 智能体」或「仅修复 MCP 配置」是唯一会采纳旧路径的入口:它要求旧路径是
|
|
491
487
|
真实安装(真实的 root/bin/入口文件,`package.json` 的 `name` 是本包且
|
|
492
488
|
`bin["dsh-delegate-mcp"]` 映射到该入口),并在写入前重查当前 config 指纹、边界和条目所有权;
|
|
493
489
|
期间有任何改动就拒绝。
|
|
@@ -498,23 +494,24 @@ Codex 子智能体现在按「提交 → `delegate_wait` 同一任务」运作
|
|
|
498
494
|
不是目录都拒绝升级,缺失层级逐级创建并复核,绝不沿链接把完整 config 写出去。
|
|
499
495
|
- 已发布的 `1.1.0` 子智能体文件(CRLF 与 LF 两种字节形态)已加入精确识别列表,所以旧
|
|
500
496
|
agent 能安全升级;`1.1.0` 之前、正文已变的历史版本按各自已发布的精确摘要识别。
|
|
501
|
-
- 设置页保留显式「安装 / 更新
|
|
497
|
+
- 设置页保留显式「安装 / 更新 TaskBridge 智能体」按钮,并显示 `outdated` 的**具体漂移项**与说明。
|
|
502
498
|
|
|
503
|
-
###
|
|
499
|
+
### 1.2.0 当时未覆盖的验收
|
|
504
500
|
|
|
505
501
|
- 没有再次执行 DSH Desktop 正式 profile 上的端到端真实模型运行,也没有实测宿主串行时控制通道的
|
|
506
502
|
现场行为(自动测试用的是本机 mock 执行面与真实 stdio 夹具,不依赖真实模型)。
|
|
507
|
-
-
|
|
503
|
+
- 上述是 1.2.0 的历史验收边界。当前 1.3.1 已发布到 GitHub 和 npm;分发核验结果见
|
|
504
|
+
[发布报告](docs/releases/1.3.1.zh.md),不代表额外完成了真实模型或 Desktop 客户端验收。
|
|
508
505
|
|
|
509
506
|
## 8. 升级 / 导出 / 卸载 / 回滚
|
|
510
507
|
|
|
511
508
|
```bash
|
|
512
509
|
# Desktop:在 Plugins manager 里对已安装的 dsh-taskbridge 执行更新 / 卸载
|
|
513
|
-
#
|
|
510
|
+
# (可从 npm 安装新版本,或下载 Release 的 .tgz 后添加)。
|
|
514
511
|
# 不要在 Desktop 的正式 profile 下执行下面的 CLI 命令。
|
|
515
512
|
|
|
516
513
|
# CLI web profile 的升级:换成本地新包或(将来)新版本
|
|
517
|
-
dsh plugin --profile web add ./dsh-taskbridge-1.3.
|
|
514
|
+
dsh plugin --profile web add ./dsh-taskbridge-1.3.2.tgz
|
|
518
515
|
|
|
519
516
|
# 导出:界面里"导出非敏感配置"按钮,或用只读 API
|
|
520
517
|
# GET /api/dsh-delegate/settings
|
|
@@ -537,7 +534,8 @@ dsh plugin --profile web remove dsh-taskbridge
|
|
|
537
534
|
|
|
538
535
|
## 9. 限制(请如实理解)
|
|
539
536
|
|
|
540
|
-
-
|
|
537
|
+
- **发布渠道**:1.3.1 已通过 npm、GitHub Release 和本项目自定义插件索引分发。索引不是官方默认
|
|
538
|
+
市场收录;更新能力取决于 DSH 客户端,插件没有独立的自动更新程序,也未提供作者签名或构建来源证明。
|
|
541
539
|
- **DSH 版本锁定**:`peerDependencies` 与 `engines.dsh` 精确声明四个版本(`0.2.0-rc.2`、
|
|
542
540
|
`0.2.1-rc.2`、`0.2.1-rc.3`、`0.2.2-rc.1`),其余版本会被 peer 门禁拒绝。其中
|
|
543
541
|
`0.2.0-rc.2` 是开发与自动测试版本,`0.2.1-rc.2` 的验收在**隔离 profile** 中完成,
|
|
@@ -576,11 +574,11 @@ dsh plugin --profile web remove dsh-taskbridge
|
|
|
576
574
|
- **审查不是批准**:附加审查只产出发现,不代表宿主验收;任务完成状态是
|
|
577
575
|
"等待宿主审查",不是"已通过"。
|
|
578
576
|
- **Codex 集成的限制**:
|
|
579
|
-
-
|
|
580
|
-
- **不宣称**当前 Codex 桌面版/CLI 支持用 `@dsh-
|
|
577
|
+
- 一键安装按钮只支持 Codex;Claude Code 可按接入说明手动配置标准 MCP,尚无一键安装按钮或真实客户端验收。
|
|
578
|
+
- **不宣称**当前 Codex 桌面版/CLI 支持用 `@dsh-taskbridge` 在输入框直接选中该子智能体:
|
|
581
579
|
这取决于 Codex 版本自身是否提供提及选择,仓库内没有官方文档或运行时证据支持该说法。
|
|
582
580
|
插件只保证子智能体文件与 MCP 条目存在;安装后必须让 Codex 重新载入。
|
|
583
|
-
- 仅管理 `agents/dsh-
|
|
581
|
+
- 仅管理 `agents/dsh-taskbridge.toml` 与 `config.toml` 里的 `mcp_servers.dsh-delegate`
|
|
584
582
|
一项;不修改 Codex 的其他设置,不删除用户自己写的同名文件。所有权按内容证明:
|
|
585
583
|
MCP 条目必须有本插件的托管标记注释,agent 文件必须与当前模板或某个**已发布版本逐字节相同**,
|
|
586
584
|
否则一律视为你的文件并拒绝改动。
|
|
@@ -82,7 +82,7 @@ function printHelp() {
|
|
|
82
82
|
process.stdout.write([
|
|
83
83
|
'Usage: dsh-delegate-codex-agent <install|status|repair|remove>',
|
|
84
84
|
'Uses CODEX_HOME when set; otherwise uses ~/.codex.',
|
|
85
|
-
'install/repair write agents/dsh-
|
|
85
|
+
'install/repair write agents/dsh-taskbridge.toml and register mcp_servers.dsh-delegate in config.toml.',
|
|
86
86
|
'remove deletes only files this plugin still owns; a modified file is left untouched.',
|
|
87
87
|
'Never enables the DSH local-call switch and never edits unrelated Codex settings.',
|
|
88
88
|
].join('\n') + '\n');
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
# dsh-
|
|
1
|
+
# dsh-taskbridge Codex companion — managed by the DSH TaskBridge plugin settings page.
|
|
2
2
|
# Editing this file turns it into an operator-owned file: the plugin then never
|
|
3
3
|
# overwrites or removes it, and reports it as "modified" instead.
|
|
4
|
-
version = "1.3.
|
|
4
|
+
version = "1.3.2"
|
|
5
5
|
|
|
6
|
-
name = "dsh-
|
|
7
|
-
description = "Dispatch an explicitly assigned implementation task to DSH through the dsh-
|
|
6
|
+
name = "dsh-taskbridge"
|
|
7
|
+
description = "Dispatch an explicitly assigned implementation task to DSH through the dsh-taskbridge MCP tools, then return evidence for Codex review."
|
|
8
8
|
|
|
9
9
|
developer_instructions = """
|
|
10
10
|
You are a dispatcher to DSH, not an implementer. Codex plans and reviews; the DSH
|
|
11
|
-
|
|
11
|
+
TaskBridge worker executes. Do not edit files or implement anything locally.
|
|
12
12
|
|
|
13
13
|
ACTIVATION (check this before anything else)
|
|
14
14
|
1. Dispatch only when the parent request explicitly selects this agent for the
|
|
15
|
-
current task — for example the operator writes the exact mention `@dsh-
|
|
15
|
+
current task — for example the operator writes the exact mention `@dsh-taskbridge`,
|
|
16
16
|
or chooses this agent from the agent picker, or explicitly says to delegate this
|
|
17
17
|
implementation task to DSH.
|
|
18
|
-
2. Text that merely mentions DSH, DeepSeek, dsh-
|
|
18
|
+
2. Text that merely mentions DSH, DeepSeek, dsh-taskbridge, delegation or this agent
|
|
19
19
|
while asking an unrelated question is NOT a dispatch request. Neither is a
|
|
20
20
|
question about the plugin, its settings, its logs or its status.
|
|
21
21
|
3. For explanation, planning, review-only, summarising or status questions, do not
|
|
@@ -68,8 +68,10 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
68
68
|
- `isolation: "shared"` (reason `PREFLIGHT_DIRTY_SHARED_EXPLICIT`) — a dirty
|
|
69
69
|
workspace was already allowed explicitly. Dispatch only if that allowance is
|
|
70
70
|
part of this request; it must be preserved.
|
|
71
|
-
3.
|
|
72
|
-
|
|
71
|
+
3. Set `title` to a short description of the actual work, in the operator's language
|
|
72
|
+
(for example, "修复登录错误" or "制作潘德 G 版装备表"). Do not use role instructions,
|
|
73
|
+
task ids or generic labels as the title. Then submit one complete, bounded task
|
|
74
|
+
containing the exact authorized workspace path supplied by the parent session, the concrete work to perform, and
|
|
73
75
|
the acceptance checks. Never guess a different workspace. Include the workspace
|
|
74
76
|
facts and the isolation decision in the dispatch text: whether the repository is
|
|
75
77
|
clean or dirty, the changed-file count and bounded paths from the preflight, the
|
|
@@ -184,13 +186,13 @@ DISPATCH (only for an explicitly assigned implementation task)
|
|
|
184
186
|
else — not a status read, not a cancel. If the operator asks to STOP or INSPECT the
|
|
185
187
|
delegated task and the MCP connection is blocked that way, use the plugin's
|
|
186
188
|
independent control process instead of waiting for the wait to end:
|
|
187
|
-
- Run the `dsh-
|
|
189
|
+
- Run the `dsh-taskbridge-control` binary that is installed NEXT TO this plugin's MCP
|
|
188
190
|
script, in the same package directory (`<dir of the configured MCP args[0]>/
|
|
189
191
|
dsh-delegate-control.js`, run with the `node` executable the MCP entry already
|
|
190
192
|
uses). Derive it from this plugin's own MCP configuration — never call an
|
|
191
193
|
unrelated script, never download one, and never guess a path from memory.
|
|
192
|
-
- Exactly two commands exist: `dsh-
|
|
193
|
-
task's compact current state as JSON, and `dsh-
|
|
194
|
+
- Exactly two commands exist: `dsh-taskbridge-control status <taskId>` prints the
|
|
195
|
+
task's compact current state as JSON, and `dsh-taskbridge-control cancel <taskId>`
|
|
194
196
|
asks the harness to stop exactly that task. Both use the same local endpoint the
|
|
195
197
|
MCP server uses. Neither can submit a task, change a setting, touch the delegation
|
|
196
198
|
switch, or act on any other task.
|
package/docs/INTRODUCTION.md
CHANGED
|
@@ -8,8 +8,8 @@ The settings include the local delegation switch, worker model/effort, task time
|
|
|
8
8
|
|
|
9
9
|
The quiet wait observes execution inside the program and returns at actionable boundaries. Pending wider-permission calls are presented to the commander for a single-call decision. Completion is evidence for host review, never automatic host acceptance.
|
|
10
10
|
|
|
11
|
-
Codex has
|
|
11
|
+
Codex has a managed agent/MCP installation button. Version 1.3.2 names the companion `dsh-taskbridge` and migrates unchanged published legacy companions. New DSH Workspaces use the task's work-content title; explicit follow-ups keep the original Workspace and conversation. Claude Code connects using standard stdio MCP; see [the manual guide](claude-code.md). A Claude one-click installer and native client mention selection are not promised.
|
|
12
12
|
|
|
13
13
|
Version 1.3.1 adopts DSH TaskBridge and the package identity `dsh-taskbridge`, replacing `dsh-delegate` and the GitHub-only `dsh-taskdispatch` 1.3.0. Read the [upgrade guide](taskbridge-upgrade.md) before replacing an old installation. Historical data, MCP tools, environment variables and the Codex `dsh-delegate` technical identifier remain compatible. Do not run old and new bundles together.
|
|
14
14
|
|
|
15
|
-
In DSH's Add plugin dialog, use `dsh-taskbridge@1.3.
|
|
15
|
+
In DSH's Add plugin dialog, use `dsh-taskbridge@1.3.2`; use the official npm registry if a regional mirror has not synchronized yet. Distribution also uses GitHub releases and a [DSH custom plugin index](plugin-market.md) pinned to exact Git commits. This is not universal official marketplace inclusion. Actual token savings and a full real Desktop update/restart have not been measured.
|
package/docs/INTRODUCTION.zh.md
CHANGED
|
@@ -18,14 +18,16 @@
|
|
|
18
18
|
|
|
19
19
|
需要更大权限的工具调用会暂停,指挥端根据准确操作和指纹决定单次允许或拒绝,不是默认全部放行。交付后集中审查,修正通过 `continueFromTaskId` 续接原对话与执行工作区。
|
|
20
20
|
|
|
21
|
+
1.3.2 起,新建的 DSH 工作区按实际工作内容命名,例如“制作潘德 G 版装备表”,不再只显示工作树的任务编号。指挥端随派工提交标题,旧客户端则从任务目标提取;续接同一任务时保留原名称与对话。
|
|
22
|
+
|
|
21
23
|
## 连接 Claude Code 与 Codex
|
|
22
24
|
|
|
23
|
-
- **Codex**:设置页提供智能体及 MCP
|
|
25
|
+
- **Codex**:设置页提供智能体及 MCP 的安装/修复按钮。智能体名为 `dsh-taskbridge`,更新会迁移未修改的旧智能体,派工规则随安装写入。客户端是否提供输入框 `@` 选择由客户端版本决定。
|
|
24
26
|
- **Claude Code**:通过标准 stdio MCP 连接,参见 [接入说明](claude-code.md)。目前没有一键安装 Claude Code 的按钮,也未进行真实 Claude Code 客户端验收。
|
|
25
27
|
|
|
26
28
|
## 安装、升级和边界
|
|
27
29
|
|
|
28
|
-
项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.3.
|
|
30
|
+
项目原名 DSH Delegate,1.3.0 曾使用 DSH TaskDispatch。1.3.1 起统一为 **DSH TaskBridge**,包名为 `dsh-taskbridge`。从旧包升级请先阅读 [更名升级说明](taskbridge-upgrade.md)。在 DSH“添加插件”中输入 `dsh-taskbridge@1.3.2`;中国大陆镜像若尚未同步,改选 npm 官方源。GitHub Release 同时提供安装包。
|
|
29
31
|
|
|
30
32
|
[插件索引与更新说明](plugin-market.md)介绍如何添加索引,在 DSH 的“发现”中搜索本插件。发布自定义索引不代表已进入官方内置市场;DSH 当前需要用户自行添加可信索引。
|
|
31
33
|
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
# Codex integration contract
|
|
2
2
|
|
|
3
|
-
Status: implemented in 1.3.
|
|
4
|
-
out of scope and no surface for them is provided.
|
|
3
|
+
Status: implemented in 1.3.2 (1.1.0 shipped the wait rules; 1.2.0 adds the installed-integration upgrade). This automatic installer covers Codex. Claude Code uses the separate manual MCP guide.
|
|
5
4
|
|
|
6
5
|
This document is the contract between the plugin's settings page (browser half),
|
|
7
6
|
the host-side installer (`src/codex/installer.js`) and the two files it manages.
|
|
8
7
|
It is written so a reviewer can check the code against it without reading the
|
|
9
8
|
README.
|
|
10
9
|
|
|
10
|
+
## TaskBridge companion migration (1.3.2)
|
|
11
|
+
|
|
12
|
+
The public companion is now `dsh-taskbridge`, installed as
|
|
13
|
+
`agents/dsh-taskbridge.toml`. An explicit install or the startup refresh migrates
|
|
14
|
+
an unchanged, recognized published `agents/dsh-delegate.toml` and removes the old
|
|
15
|
+
managed file after the new managed template is present. Edited files and an
|
|
16
|
+
operator-owned destination remain untouched; startup does not perform a first
|
|
17
|
+
installation when no previous managed companion exists. The MCP table remains
|
|
18
|
+
`mcp_servers.dsh-delegate`, and `delegate_*` tool names remain compatible.
|
|
19
|
+
|
|
20
|
+
Explicit install/repair can also adopt a marked standard legacy MCP path after
|
|
21
|
+
the old `dsh-delegate` or `dsh-taskdispatch` package has been uninstalled from the
|
|
22
|
+
same `node_modules` as the current `dsh-taskbridge`. This narrow exception does
|
|
23
|
+
not apply to custom wrappers, other directories, or automatic startup refresh.
|
|
24
|
+
`repair` remains MCP-only. TaskBridge CLI aliases point at the existing bin files.
|
|
25
|
+
|
|
11
26
|
---
|
|
12
27
|
|
|
13
28
|
## 1. What is owned, and what is not
|
|
14
29
|
|
|
15
30
|
| Path | Owner | The plugin may | The plugin may never |
|
|
16
31
|
| --- | --- | --- | --- |
|
|
17
|
-
| `$CODEX_HOME/agents/dsh-
|
|
32
|
+
| `$CODEX_HOME/agents/dsh-taskbridge.toml` | managed copy of `codex/dsh-taskbridge.toml` | create it **exclusively** on explicit install when absent; refresh a byte-exact known build during plugin startup or explicit install; delete it on `remove` only after re-reading it and finding the same bytes it classified | overwrite or delete a file that is not that exact build — including a file with an old version line whose body was edited, and including a file that changed in the window between the status read and the write/removal |
|
|
18
33
|
| `$CODEX_HOME/config.toml`, table `mcp_servers.dsh-delegate` | operator, with one managed entry | add the entry when absent; update `command`/`args`/its own `env.DSH_DELEGATE_DISCOVERY_FILE` when the entry carries **the plugin marker** *and* is the exact shape this plugin writes; on an explicit `install`/`repair` only, adopt a recorded `args[0]` that is a PROVED real installation of this package (manifest `name` + `bin["dsh-delegate-mcp"]` mapping) | touch any other key, table, comment or ordering; adopt, update or delete an unmarked same-name entry, even one whose values coincide; adopt a differing script path from the automatic startup check |
|
|
19
34
|
| `$CODEX_HOME` and `$CODEX_HOME/agents` | Codex | read them (lstat **and** the Windows file attributes); create `agents` (`0700`) when both are real directories | create them relative to the process working directory; **follow a link at either level** (POSIX symlink, Windows junction/reparse point) for any read-through, write or delete |
|
|
20
35
|
| DSH local-call switch | operator | report it | change it |
|
|
@@ -28,7 +43,7 @@ nobody named.
|
|
|
28
43
|
|
|
29
44
|
`lstat` on the final file is not enough: if `$CODEX_HOME/agents` is a junction,
|
|
30
45
|
`mkdir -p` and the file create walk *through* it and write
|
|
31
|
-
`agents/dsh-
|
|
46
|
+
`agents/dsh-taskbridge.toml` outside the Codex home entirely. Both directories are
|
|
32
47
|
therefore inspected as *boundaries*:
|
|
33
48
|
|
|
34
49
|
| `$CODEX_HOME` | `$CODEX_HOME/agents` | result |
|
|
@@ -406,7 +421,7 @@ falling back, and so does `refreshManagedIntegration` when the caller passes a
|
|
|
406
421
|
`startupTarget` whose `home` is `null` — the plugin never walks a junction and never
|
|
407
422
|
substitutes a tree nobody named.
|
|
408
423
|
|
|
409
|
-
The explicit 安装 / 更新
|
|
424
|
+
The explicit 安装 / 更新 TaskBridge 智能体 button (action `install`) is unchanged and remains
|
|
410
425
|
the way to *create* the two managed targets. `status` reports the drift (`mcp.drift`)
|
|
411
426
|
and, when an entry is `outdated`, a note naming exactly which owned facts are stale.
|
|
412
427
|
|
|
@@ -454,10 +469,10 @@ The page's `init()` issues a `GET`; the three buttons are the only callers of th
|
|
|
454
469
|
|
|
455
470
|
**The single write at plugin load is the integration refresh.** `apply()` calls the
|
|
456
471
|
seam's `refreshManagedIntegration()` once — only when a Codex home directory exists — which
|
|
457
|
-
refreshes `agents/dsh-
|
|
472
|
+
refreshes `agents/dsh-taskbridge.toml` when its complete bytes equal one of the enumerated
|
|
458
473
|
`KNOWN_AGENT_TEMPLATES` digests (section 5) **and** upgrades an already installed
|
|
459
474
|
`mcp_servers.dsh-delegate` entry that is provably this plugin's and merely stale
|
|
460
|
-
(section 2.4).
|
|
475
|
+
(section 2.4). Apart from migrating an existing recognized legacy companion to its new name in 1.3.2, it never creates a missing agent, never creates `agents/`, never creates
|
|
461
476
|
the MCP entry, and never touches a `modified`/`conflict` file: everything else stays an
|
|
462
477
|
explicit `install`. A refusal or failure is logged and startup continues, so a Codex
|
|
463
478
|
problem cannot stop the plugin from loading.
|
|
@@ -488,7 +503,7 @@ successful diagnosis.
|
|
|
488
503
|
```jsonc
|
|
489
504
|
{
|
|
490
505
|
"codexHome": "…",
|
|
491
|
-
"packageVersion": "1.3.
|
|
506
|
+
"packageVersion": "1.3.2",
|
|
492
507
|
"boundary": { "blocked": false, "link": null, "unknown": false, "home": "directory", "agents": "directory" },
|
|
493
508
|
"agent": {
|
|
494
509
|
"path": "…", "state": "installed", "installed": true, "managed": true,
|
|
@@ -686,7 +701,7 @@ The instructions must state all of the following. They are asserted in
|
|
|
686
701
|
one fails the build:
|
|
687
702
|
|
|
688
703
|
1. **Explicit assignment only.** Dispatch only when the parent request explicitly
|
|
689
|
-
selects this agent (the exact mention `@dsh-
|
|
704
|
+
selects this agent (the exact mention `@dsh-taskbridge`, the agent picker, or an
|
|
690
705
|
explicit instruction to delegate this implementation task to DSH).
|
|
691
706
|
2. **Mention is not dispatch.** Text that merely mentions DSH, DeepSeek,
|
|
692
707
|
dsh-delegate, delegation or the agent while asking something else is not a
|
|
@@ -856,7 +871,7 @@ one fails the build:
|
|
|
856
871
|
### 5.2 What the file cannot guarantee: `@` selection
|
|
857
872
|
|
|
858
873
|
**This plugin does not claim that any Codex surface supports selecting the agent by
|
|
859
|
-
typing `@dsh-
|
|
874
|
+
typing `@dsh-taskbridge`.** Only verified facts are stated:
|
|
860
875
|
|
|
861
876
|
* A custom-agent file at `$CODEX_HOME/agents/<name>.toml` is a Codex-recognised
|
|
862
877
|
definition, and the parent session's MCP tools are inherited by it — this is what
|
|
@@ -867,7 +882,7 @@ typing `@dsh-delegate`.** Only verified facts are stated:
|
|
|
867
882
|
versions under test, so the wording here (and in the settings page) says the
|
|
868
883
|
mention *may* select the agent, and claims no more.
|
|
869
884
|
|
|
870
|
-
Consequently the agent's own instructions treat `@dsh-
|
|
885
|
+
Consequently the agent's own instructions treat `@dsh-taskbridge` as **one example**
|
|
871
886
|
of an explicit selection, alongside the agent picker and an explicit instruction to
|
|
872
887
|
delegate. If a Codex build does not offer `@` selection, the agent still works when
|
|
873
888
|
chosen through whatever selection mechanism that build does provide. A new Codex
|
|
@@ -887,7 +902,7 @@ session (or a restart) is required to load the new file and the new MCP entry.
|
|
|
887
902
|
| `repair` with the agent file missing or `outdated` | `changed: ["mcp"]` or `[]`; the agent file is not created and not refreshed, and `agents/` is not created |
|
|
888
903
|
| the boundary cannot be verified (no spawnable shell / no PowerShell) | `conflict` (`boundary-unverified`); everything refused, nothing assumed safe |
|
|
889
904
|
| agents dir missing | created on install (`0700`) when the boundary is clean |
|
|
890
|
-
| `agents/dsh-
|
|
905
|
+
| `agents/dsh-taskbridge.toml` is a symlink or a directory | `conflict`; untouched |
|
|
891
906
|
| a different agent file appears between status and install | `modified`; untouched (first install is exclusive) |
|
|
892
907
|
| an agent file is rewritten between the status read and `remove` | `AGENT_USER_MODIFIED` (`modified-before-removal`); the new bytes are kept |
|
|
893
908
|
| the agent path is replaced by a directory / a link before `remove` | `AGENT_PATH_CONFLICT`; the entry is left in place |
|
|
@@ -19,6 +19,17 @@ Workspace for the run's execution path, and supplying it continues the DSH
|
|
|
19
19
|
Workspace and Session that *that* task drove. Supplying it is the only way any
|
|
20
20
|
conversation is ever continued.
|
|
21
21
|
|
|
22
|
+
## Workspace display names (1.3.2)
|
|
23
|
+
|
|
24
|
+
`delegate_submit.title` is an optional, short description of the actual work in
|
|
25
|
+
the operator's language. The engine derives a title from the prompt's goal when
|
|
26
|
+
older callers omit it. Only newly created Workspace groups are renamed through
|
|
27
|
+
`workspaceController.rename({ workspaceId, title })`; an existing Workspace or
|
|
28
|
+
an explicit follow-up retains its current name. Conflicting names receive a short
|
|
29
|
+
task-id suffix. Naming needs no model call and does not change the execution
|
|
30
|
+
directory, Git branch or task identity. Historical Workspaces are not renamed in
|
|
31
|
+
bulk.
|
|
32
|
+
|
|
22
33
|
## The two questions, and the two services that answer them
|
|
23
34
|
|
|
24
35
|
| Question | Native service | Dependency key |
|
package/docs/plugin-market.md
CHANGED
|
@@ -15,7 +15,7 @@ https://ranranyya.github.io/dsh-taskbridge/index.json
|
|
|
15
15
|
3. 搜索 **DSH TaskBridge** 或 **dsh-taskbridge**。
|
|
16
16
|
4. 安装确认框应显示本项目 GitHub 仓库和精确提交。核对后安装,不要改填别人的 `dsh-delegate` 或 `dsh-dispatch` npm 包。
|
|
17
17
|
|
|
18
|
-
当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.3.
|
|
18
|
+
当前索引采用固定 Git 提交作为安装来源,不依赖本机 npm 登录。另一种安装方式是直接在“添加插件”中输入 `dsh-taskbridge@1.3.2`,无需添加索引;若中国大陆镜像未同步,改选 npm 官方源。GitHub Release 同时提供 `.tgz` 和 SHA256 文件。
|
|
19
19
|
|
|
20
20
|
## 新版本
|
|
21
21
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Runtime compatibility
|
|
2
2
|
|
|
3
|
-
This document states which DSH runtimes this plugin build (`1.3.
|
|
4
|
-
`dsh-taskbridge-1.3.
|
|
3
|
+
This document states which DSH runtimes this plugin build (`1.3.2`, package
|
|
4
|
+
`dsh-taskbridge-1.3.2.tgz`) may be loaded into, what changed in the newest one, and what
|
|
5
5
|
has and has not been verified on it. It is a compatibility note, not an acceptance
|
|
6
|
-
report; the package is distributed through the GitHub Release.
|
|
6
|
+
report; the package is distributed through npm and the GitHub Release. See the
|
|
7
|
+
[1.3.2 release notes](releases/1.3.2.zh.md) for upgrade details and the
|
|
8
|
+
[1.3.1 release report](releases/1.3.1.zh.md) for historical distribution verification.
|
|
7
9
|
|
|
8
10
|
`1.1.0` added silent waiting: the global `monitoring` thresholds (self-check and attention
|
|
9
11
|
intervals), bounded activity metadata on every task view, the authenticated monitoring
|
|
@@ -20,12 +22,13 @@ and the execution implementation are carried over unchanged from `1.0.0`; the DS
|
|
|
20
22
|
compatibility described here was introduced by `0.1.12` and is historical fact for this
|
|
21
23
|
build.
|
|
22
24
|
|
|
23
|
-
**
|
|
24
|
-
profile
|
|
25
|
+
**Historical 1.2.0 acceptance boundary, not a live installation inventory:** during
|
|
26
|
+
that release's checks, the operator's Desktop profile was on `1.1.0` and `1.2.0` had
|
|
27
|
+
not been installed into it. The complete
|
|
25
28
|
Desktop upgrade/restart acceptance and the actual token-saving ratio have not been
|
|
26
|
-
measured.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
measured in the current 1.3.2 publication either. MCP/CLI acceptance evidence belongs
|
|
30
|
+
in the Release notes and is not pre-filled here. An older production profile must
|
|
31
|
+
be upgraded to this build, and the
|
|
29
32
|
Codex companion refreshed from the settings page (or by the startup check, which now also
|
|
30
33
|
upgrades the installed MCP entry) and Codex reloaded before the new wait rules and the
|
|
31
34
|
managed `tool_timeout_sec` take effect. No unit-test count and no mock constitutes an
|
|
@@ -194,10 +197,10 @@ What remains genuinely unverified:
|
|
|
194
197
|
|
|
195
198
|
## 5. Upgrading from an older plugin build
|
|
196
199
|
|
|
197
|
-
1. Download `dsh-taskbridge-1.3.
|
|
200
|
+
1. Download `dsh-taskbridge-1.3.2.tgz` from the GitHub Release, or build the package locally (`npm pack`).
|
|
198
201
|
2. Install it the way your surface requires: the Desktop **Plugins manager** for a
|
|
199
202
|
Desktop profile (npm/CLI operations on that profile are refused), or
|
|
200
|
-
`dsh plugin --profile <name> add ./dsh-taskbridge-1.3.
|
|
203
|
+
`dsh plugin --profile <name> add ./dsh-taskbridge-1.3.2.tgz` for a CLI profile you
|
|
201
204
|
start yourself.
|
|
202
205
|
3. The settings, the switch value and the task history are preserved
|
|
203
206
|
(`$DSH_HOME/data/dsh-delegate`); nothing is migrated destructively.
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
## 升级步骤
|
|
6
6
|
|
|
7
|
-
1.
|
|
7
|
+
1. 等待当前任务结束,关闭旧插件的本机调用开关。
|
|
8
8
|
2. 在 DSH 插件管理中停用并卸载本项目旧 `dsh-delegate` 或 `dsh-taskdispatch` 包。**保留 `<DSH_HOME>/data/dsh-delegate` 数据目录**;DSH 若提供删除数据选项,不要勾选。新旧包不能同时启用。
|
|
9
|
-
3. 在“添加插件”中输入 **`dsh-taskbridge@1.3.
|
|
9
|
+
3. 在“添加插件”中输入 **`dsh-taskbridge@1.3.2`**。中国大陆镜像未同步时改选 npm 官方源。也可安装本项目 Release 的 `dsh-taskbridge-1.3.2.tgz`,或添加本项目固定 Git 提交的自定义索引。不要手动修改 Desktop 保留的 profile。
|
|
10
10
|
4. 打开 **DSH TaskBridge** 配置页,核对 API、模型、思考强度和总开关。数据目录与旧版相同;安装前关闭旧开关,避免恢复之前保存的开启状态。
|
|
11
|
-
5. 在 Codex 集成中点击“安装 / 更新 Codex
|
|
11
|
+
5. 在 Codex 集成中点击“安装 / 更新 TaskBridge 智能体”,更新智能体及 MCP,然后重新加载 Codex。未修改的旧 `dsh-delegate.toml` 会迁移为 `dsh-taskbridge.toml`;修改过的文件保留。只需修复 MCP 时可使用“仅修复 MCP 配置”。启动自检不会接管其他安装目录。
|
|
12
12
|
6. 若添加过旧索引,改用 `https://ranranyya.github.io/dsh-taskbridge/index.json`。
|
|
13
13
|
|
|
14
14
|
## 保持兼容的技术标识
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
- 数据与端点:`<DSH_HOME>/data/dsh-delegate`、`runtime-endpoint.json`。
|
|
17
17
|
- 环境变量:`DSH_DELEGATE_*`。
|
|
18
18
|
- MCP 工具:`delegate_status`、`delegate_preflight`、`delegate_submit`、`delegate_wait`、`delegate_result`、`delegate_cancel`、`delegate_permission_decide`。
|
|
19
|
-
- Codex
|
|
19
|
+
- Codex MCP 条目:`mcp_servers.dsh-delegate`。智能体文件从 1.3.2 起改为 `agents/dsh-taskbridge.toml`,对外名称为 `dsh-taskbridge`。
|
|
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 配置带托管标记且结构符合插件规则。其他路径、自定义包装器和用户编辑过的智能体文件保留;启动自检不会接管搬家路径。
|
|
23
23
|
|
|
24
24
|
## 版本差异
|
|
25
25
|
|
|
26
|
-
1.2.0 完成静默等待中断语义、独立控制通道和既有 Codex 集成升级修复。1.3.0 增加中英文介绍、图标、更名兼容和自定义插件索引。1.3.1 统一为 TaskBridge 并增加 npm
|
|
26
|
+
1.2.0 完成静默等待中断语义、独立控制通道和既有 Codex 集成升级修复。1.3.0 增加中英文介绍、图标、更名兼容和自定义插件索引。1.3.1 统一为 TaskBridge 并增加 npm 安装渠道。1.3.2 将 Codex 智能体同步更名、新工作区按任务内容命名,并修复旧包卸载后的 MCP 路径迁移;不改变模型选择、等待、审批或审查流程。从 TaskBridge 1.3.1 升到 1.3.2 是同包小版本更新。
|
|
27
27
|
|
|
28
28
|
更名是包身份迁移,不能称为对旧包的普通原地更新。隔离配置目录中的迁移测试不等于已经在真实 Desktop 完成卸载、安装和重启验收。
|
package/lib/client.js
CHANGED
|
@@ -2832,7 +2832,7 @@ window.__ModuleLoader__.load({
|
|
|
2832
2832
|
const badgeTone = isAwaitingPermission(task) ? "warn" : task.state === "awaiting-host-review" ? "warn" : task.state === "failed" ? "warn" : "off";
|
|
2833
2833
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshdg-item", children: [
|
|
2834
2834
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshdg-item-head", children: [
|
|
2835
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", {
|
|
2835
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: task.title || task.taskId }),
|
|
2836
2836
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, { tone: badgeTone, children: taskStateLabel(task.state) }),
|
|
2837
2837
|
isAwaitingPermission(task) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, { tone: "warn", children: PERMISSION_STATE_LABELS.pending }) : null,
|
|
2838
2838
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshdg-spacer" }),
|
|
@@ -2997,7 +2997,7 @@ window.__ModuleLoader__.load({
|
|
|
2997
2997
|
const progress = taskProgress(task);
|
|
2998
2998
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshdg-item", children: [
|
|
2999
2999
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshdg-item-head", children: [
|
|
3000
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: task.title || task.taskId }),
|
|
3001
3001
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, { tone: isAwaitingPermission(task) ? "warn" : task.state === "awaiting-host-review" ? "warn" : task.state === "failed" ? "warn" : "off", children: taskStateLabel(task.state) }),
|
|
3002
3002
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, { tone: progress.tone, children: taskPhaseLabel(task.phase) }),
|
|
3003
3003
|
isAwaitingPermission(task) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, { tone: "warn", children: PERMISSION_STATE_LABELS.pending }) : null,
|
|
@@ -3072,7 +3072,7 @@ window.__ModuleLoader__.load({
|
|
|
3072
3072
|
] }),
|
|
3073
3073
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "dshdg-muted", children: [
|
|
3074
3074
|
"点下面的按钮,把 ",
|
|
3075
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshdg-mono", children: "agents/dsh-
|
|
3075
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshdg-mono", children: "agents/dsh-taskbridge.toml" }),
|
|
3076
3076
|
" 装进 Codex 目录,并在 Codex 的 ",
|
|
3077
3077
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dshdg-mono", children: "config.toml" }),
|
|
3078
3078
|
" 里登记本插件的 stdio MCP 服务(delegate_status / delegate_submit / delegate_result / delegate_wait / delegate_cancel)。首次安装只会由你点击触发:打开本页、安装或升级本插件都不会自动创建子智能体文件或 MCP 条目。已经安装过的情况下,插件下次启动会把本插件自己写入的过期托管条目就地更新(例如补上 tool_timeout_sec);它不会改写非托管、被你改过的条目,也不会触碰 Codex 的其他设置。下面会显示当前条目缺了什么。"
|
|
@@ -3092,7 +3092,7 @@ window.__ModuleLoader__.load({
|
|
|
3092
3092
|
codex.mcp?.state === "outdated" ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "dshdg-hint", "data-dshdg-codex-drift": "", children: [
|
|
3093
3093
|
"这个托管 MCP 条目已经过期:",
|
|
3094
3094
|
codexMcpDriftText(codex.mcp),
|
|
3095
|
-
"。插件下次启动会自动在原地更新;也可以点上面的「安装 / 更新
|
|
3095
|
+
"。插件下次启动会自动在原地更新;也可以点上面的「安装 / 更新 TaskBridge 智能体」。"
|
|
3096
3096
|
] }) : null,
|
|
3097
3097
|
notes.length === 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dshdg-hint", children: notes.map((note) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: note.text }, note.code)) }),
|
|
3098
3098
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dshdg-row", children: [
|
|
@@ -3101,7 +3101,7 @@ window.__ModuleLoader__.load({
|
|
|
3101
3101
|
}, children: refreshing ? "读取中…" : "刷新状态" }),
|
|
3102
3102
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "dshdg-primary", disabled, onClick: () => {
|
|
3103
3103
|
void store.runCodexAction("install");
|
|
3104
|
-
}, children: busy ? "处理中…" : "安装 / 更新
|
|
3104
|
+
}, children: busy ? "处理中…" : "安装 / 更新 TaskBridge 智能体" }),
|
|
3105
3105
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", disabled, onClick: () => {
|
|
3106
3106
|
void store.runCodexAction("repair");
|
|
3107
3107
|
}, children: "仅修复 MCP 配置" }),
|
|
@@ -3111,7 +3111,7 @@ window.__ModuleLoader__.load({
|
|
|
3111
3111
|
] }),
|
|
3112
3112
|
snapshot.codexOutcome === null || snapshot.codexOutcome === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dshdg-hint", children: describeCodexOutcome(snapshot.codexOutcome) })
|
|
3113
3113
|
] }),
|
|
3114
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dshdg-hint", children: "安装后需要让 Codex 重新载入:新开会话或重启 Codex,才会读到新的子智能体和 MCP 条目。本插件不宣称当前 Codex 桌面版/CLI 能在输入框用 @dsh-
|
|
3114
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dshdg-hint", children: "安装后需要让 Codex 重新载入:新开会话或重启 Codex,才会读到新的子智能体和 MCP 条目。本插件不宣称当前 Codex 桌面版/CLI 能在输入框用 @dsh-taskbridge 直接选中该子智能体——这取决于 Codex 版本自身是否提供提及选择;这里只保证子智能体文件与 MCP 工具存在,并由你在 Codex 提供的选择方式中指派它。子智能体只在明确指派时派发任务,并在提交前先检查上面的本机调用开关;本页不会替你打开该开关。同名的自定义 agent 会被保留并报告为冲突;没有本插件托管标记注释的同名 MCP 条目也视为你自己写的,不会被覆盖或删除。" })
|
|
3115
3115
|
] });
|
|
3116
3116
|
}
|
|
3117
3117
|
var TABS = Object.freeze([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-taskbridge",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"description": "让 Claude Code 或 Codex 指挥 DSH 完成任务;在 DSH 插件中配置 API、执行模型、思考强度、权限审批与集中审查。",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,7 +36,10 @@
|
|
|
36
36
|
"bin": {
|
|
37
37
|
"dsh-delegate-mcp": "bin/dsh-delegate-mcp.js",
|
|
38
38
|
"dsh-delegate-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
39
|
-
"dsh-delegate-control": "bin/dsh-delegate-control.js"
|
|
39
|
+
"dsh-delegate-control": "bin/dsh-delegate-control.js",
|
|
40
|
+
"dsh-taskbridge-mcp": "bin/dsh-delegate-mcp.js",
|
|
41
|
+
"dsh-taskbridge-codex-agent": "bin/dsh-delegate-codex-agent.js",
|
|
42
|
+
"dsh-taskbridge-control": "bin/dsh-delegate-control.js"
|
|
40
43
|
},
|
|
41
44
|
"files": [
|
|
42
45
|
"src/**/*.js",
|
|
@@ -49,7 +52,7 @@
|
|
|
49
52
|
"bin/dsh-delegate-codex-agent.js",
|
|
50
53
|
"bin/dsh-delegate-control.js",
|
|
51
54
|
"bin/dsh-delegate-control.d.ts",
|
|
52
|
-
"codex/dsh-
|
|
55
|
+
"codex/dsh-taskbridge.toml",
|
|
53
56
|
"cordis.patch.yml",
|
|
54
57
|
"README.md",
|
|
55
58
|
"LICENSE",
|
package/src/client/index.jsx
CHANGED
|
@@ -1759,7 +1759,7 @@ function TaskDetail({ store, task }) {
|
|
|
1759
1759
|
return (
|
|
1760
1760
|
<div className="dshdg-item">
|
|
1761
1761
|
<div className="dshdg-item-head">
|
|
1762
|
-
<strong
|
|
1762
|
+
<strong>{task.title || task.taskId}</strong>
|
|
1763
1763
|
<Badge tone={badgeTone}>
|
|
1764
1764
|
{taskStateLabel(task.state)}
|
|
1765
1765
|
</Badge>
|
|
@@ -2022,7 +2022,7 @@ function TasksPanel({ store, snapshot }) {
|
|
|
2022
2022
|
return (
|
|
2023
2023
|
<div className="dshdg-item" key={task.taskId}>
|
|
2024
2024
|
<div className="dshdg-item-head">
|
|
2025
|
-
<span
|
|
2025
|
+
<span>{task.title || task.taskId}</span>
|
|
2026
2026
|
<Badge tone={isAwaitingPermission(task)
|
|
2027
2027
|
? 'warn'
|
|
2028
2028
|
: (task.state === 'awaiting-host-review' ? 'warn' : (task.state === 'failed' ? 'warn' : 'off'))}>
|
|
@@ -2131,7 +2131,7 @@ function CodexPanel({ store, snapshot }) {
|
|
|
2131
2131
|
</div>
|
|
2132
2132
|
<p className="dshdg-muted">
|
|
2133
2133
|
{'点下面的按钮,把 '}
|
|
2134
|
-
<span className="dshdg-mono">agents/dsh-
|
|
2134
|
+
<span className="dshdg-mono">agents/dsh-taskbridge.toml</span>
|
|
2135
2135
|
{' 装进 Codex 目录,并在 Codex 的 '}
|
|
2136
2136
|
<span className="dshdg-mono">config.toml</span>
|
|
2137
2137
|
{' 里登记本插件的 stdio MCP 服务(delegate_status / delegate_submit / delegate_result / delegate_wait / delegate_cancel)。'
|
|
@@ -2158,7 +2158,7 @@ function CodexPanel({ store, snapshot }) {
|
|
|
2158
2158
|
<p className="dshdg-hint" data-dshdg-codex-drift="">
|
|
2159
2159
|
{'这个托管 MCP 条目已经过期:'}
|
|
2160
2160
|
{codexMcpDriftText(codex.mcp)}
|
|
2161
|
-
{'。插件下次启动会自动在原地更新;也可以点上面的「安装 / 更新
|
|
2161
|
+
{'。插件下次启动会自动在原地更新;也可以点上面的「安装 / 更新 TaskBridge 智能体」。'}
|
|
2162
2162
|
</p>
|
|
2163
2163
|
) : null}
|
|
2164
2164
|
{notes.length === 0 ? null : (
|
|
@@ -2171,7 +2171,7 @@ function CodexPanel({ store, snapshot }) {
|
|
|
2171
2171
|
{refreshing ? '读取中…' : '刷新状态'}
|
|
2172
2172
|
</button>
|
|
2173
2173
|
<button type="button" className="dshdg-primary" disabled={disabled} onClick={() => { void store.runCodexAction('install'); }}>
|
|
2174
|
-
{busy ? '处理中…' : '安装 / 更新
|
|
2174
|
+
{busy ? '处理中…' : '安装 / 更新 TaskBridge 智能体'}
|
|
2175
2175
|
</button>
|
|
2176
2176
|
<button type="button" disabled={disabled} onClick={() => { void store.runCodexAction('repair'); }}>
|
|
2177
2177
|
仅修复 MCP 配置
|
|
@@ -2187,7 +2187,7 @@ function CodexPanel({ store, snapshot }) {
|
|
|
2187
2187
|
)}
|
|
2188
2188
|
<p className="dshdg-hint">
|
|
2189
2189
|
{'安装后需要让 Codex 重新载入:新开会话或重启 Codex,才会读到新的子智能体和 MCP 条目。'
|
|
2190
|
-
+ '本插件不宣称当前 Codex 桌面版/CLI 能在输入框用 @dsh-
|
|
2190
|
+
+ '本插件不宣称当前 Codex 桌面版/CLI 能在输入框用 @dsh-taskbridge 直接选中该子智能体——这取决于 Codex 版本自身是否提供提及选择;'
|
|
2191
2191
|
+ '这里只保证子智能体文件与 MCP 工具存在,并由你在 Codex 提供的选择方式中指派它。'
|
|
2192
2192
|
+ '子智能体只在明确指派时派发任务,并在提交前先检查上面的本机调用开关;本页不会替你打开该开关。'
|
|
2193
2193
|
+ '同名的自定义 agent 会被保留并报告为冲突;没有本插件托管标记注释的同名 MCP 条目也视为你自己写的,不会被覆盖或删除。'}
|
package/src/codex/installer.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
// -------------------------------------
|
|
6
6
|
// This module owns exactly two things in a Codex home:
|
|
7
7
|
//
|
|
8
|
-
// 1. `$CODEX_HOME/agents/dsh-
|
|
9
|
-
// template `codex/dsh-
|
|
8
|
+
// 1. `$CODEX_HOME/agents/dsh-taskbridge.toml` — a *managed copy* of the shipped
|
|
9
|
+
// template `codex/dsh-taskbridge.toml`. Ownership is proved by content, never by
|
|
10
10
|
// the file name or a version line alone:
|
|
11
11
|
// * a file that is byte-identical to the template this build would write is
|
|
12
12
|
// `installed` (and removable);
|
|
@@ -94,7 +94,8 @@ import {
|
|
|
94
94
|
} from './toml.js';
|
|
95
95
|
|
|
96
96
|
/** Agent file name inside `$CODEX_HOME/agents`. */
|
|
97
|
-
export const AGENT_FILENAME = 'dsh-
|
|
97
|
+
export const AGENT_FILENAME = 'dsh-taskbridge.toml';
|
|
98
|
+
export const LEGACY_AGENT_FILENAME = 'dsh-delegate.toml';
|
|
98
99
|
|
|
99
100
|
/** MCP server entry name inside Codex's `mcp_servers` table. */
|
|
100
101
|
export const MCP_SERVER_NAME = 'dsh-delegate';
|
|
@@ -126,7 +127,9 @@ export const CODEX_ACTIONS = Object.freeze(['status', 'install', 'repair', 'remo
|
|
|
126
127
|
* historical release in the product data.
|
|
127
128
|
* @type {Array<{ version: string, sha256: string }>}
|
|
128
129
|
*/
|
|
129
|
-
export const KNOWN_AGENT_TEMPLATES = [
|
|
130
|
+
export const KNOWN_AGENT_TEMPLATES = [
|
|
131
|
+
{ version: '1.3.1', sha256: '2793b656be4a1906e16edfdd0103540bfad05681a413c166b578b02333ea2618' },
|
|
132
|
+
{ version: '1.3.1', sha256: 'b48558d6d6acca58b94a01029d6c884c4789488c7926cdaca40cb6cd15eea2ae' },
|
|
130
133
|
{
|
|
131
134
|
version: '0.1.6',
|
|
132
135
|
sha256: '6a9d0da5b32d62a2a1f61d1fba37d54789cde0774afb3abccb5dc12b400c82be',
|
|
@@ -1448,6 +1451,19 @@ export async function isOwnedEntryScript(candidate, installed, options = {}) {
|
|
|
1448
1451
|
return await isOtherInstallationOfThisPackage(recorded, options.rootPackageName ?? PACKAGE_NAME);
|
|
1449
1452
|
}
|
|
1450
1453
|
|
|
1454
|
+
/** Explicit repair also accepts an uninstalled legacy sibling in the same node_modules. */
|
|
1455
|
+
export async function isExplicitlyMigratableScript(candidate, installed) {
|
|
1456
|
+
if (await isOwnedEntryScript(candidate, installed)) return true;
|
|
1457
|
+
const oldRoot = packageEntryRoot(candidate);
|
|
1458
|
+
const newRoot = packageEntryRoot(installed);
|
|
1459
|
+
if (oldRoot === null || newRoot === null) return false;
|
|
1460
|
+
if (!['dsh-delegate', 'dsh-taskdispatch'].includes(basename(oldRoot))) return false;
|
|
1461
|
+
if (basename(newRoot) !== 'dsh-taskbridge' || basename(dirname(newRoot)) !== 'node_modules') return false;
|
|
1462
|
+
if (!samePlatformPath(dirname(oldRoot), dirname(newRoot))) return false;
|
|
1463
|
+
try { await lstat(oldRoot); return false; }
|
|
1464
|
+
catch (error) { return error?.code === 'ENOENT'; }
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1451
1467
|
/**
|
|
1452
1468
|
* The SYNCHRONOUS proof the classifier may use: the recorded script is this
|
|
1453
1469
|
* installation's own file.
|
|
@@ -2233,7 +2249,7 @@ function buildNotes({ agent, mcp, script, configError, nodeError = null }) {
|
|
|
2233
2249
|
if (agent.state === AGENT_STATES.modified) {
|
|
2234
2250
|
notes.push({
|
|
2235
2251
|
code: 'AGENT_USER_MODIFIED',
|
|
2236
|
-
text:
|
|
2252
|
+
text: `已存在内容不同的 agents/${AGENT_FILENAME},本插件不会覆盖或删除它;如需插件版本请先自行移动该文件。`,
|
|
2237
2253
|
});
|
|
2238
2254
|
}
|
|
2239
2255
|
if (agent.state === AGENT_STATES.conflict) {
|
|
@@ -2241,12 +2257,12 @@ function buildNotes({ agent, mcp, script, configError, nodeError = null }) {
|
|
|
2241
2257
|
// operator needs to know which one: a link on the way to the file (home or
|
|
2242
2258
|
// `agents/`), or a final path that is not a regular file (a link, a directory).
|
|
2243
2259
|
const text = agent.reason === 'codex-home-is-link'
|
|
2244
|
-
?
|
|
2260
|
+
? `Codex home 本身是链接(符号链接或 Windows reparse point/junction),本插件不会穿过它写入或删除 agents/${AGENT_FILENAME}。`
|
|
2245
2261
|
: agent.reason === 'agents-dir-is-link'
|
|
2246
|
-
?
|
|
2262
|
+
? `agents 目录是链接(符号链接或 Windows reparse point/junction),本插件不会穿过它写入或删除 ${AGENT_FILENAME}。`
|
|
2247
2263
|
: agent.reason === 'boundary-unverified'
|
|
2248
2264
|
? 'Codex home 或 agents 目录无法确认是真实目录(可能缺少 Windows PowerShell),本插件不会写入或删除任何文件。'
|
|
2249
|
-
:
|
|
2265
|
+
: `agents/${AGENT_FILENAME} 不是普通文件(可能是链接或目录),本插件不会改动它。`;
|
|
2250
2266
|
notes.push({ code: 'AGENT_PATH_CONFLICT', text });
|
|
2251
2267
|
}
|
|
2252
2268
|
if (agent.state === AGENT_STATES.outdated) {
|
|
@@ -2362,6 +2378,7 @@ export async function runCodexAction(action, {
|
|
|
2362
2378
|
|
|
2363
2379
|
if (action === 'remove') {
|
|
2364
2380
|
await removeManaged(before, { changed, refused });
|
|
2381
|
+
await migrateLegacyAgent(before, { changed, refused }, { removeOnly: true });
|
|
2365
2382
|
} else if (action === 'repair') {
|
|
2366
2383
|
// MCP only: the agent file is not touched at all — not created, not refreshed,
|
|
2367
2384
|
// not deleted. The returned status still reports its real (possibly `not-installed`
|
|
@@ -2386,9 +2403,30 @@ export async function runCodexAction(action, {
|
|
|
2386
2403
|
*/
|
|
2387
2404
|
async function installManaged(before, outcome) {
|
|
2388
2405
|
await installManagedAgent(before, outcome);
|
|
2406
|
+
await migrateLegacyAgent(before, outcome);
|
|
2389
2407
|
await installMcpEntry(before, outcome);
|
|
2390
2408
|
}
|
|
2391
2409
|
|
|
2410
|
+
/** Move a previously installed, unchanged companion to the public TaskBridge name. */
|
|
2411
|
+
async function migrateLegacyAgent(before, outcome, { removeOnly = false } = {}) {
|
|
2412
|
+
const legacyPath = join(before.codexHome, 'agents', LEGACY_AGENT_FILENAME);
|
|
2413
|
+
const legacy = await inspectFile(legacyPath);
|
|
2414
|
+
if (legacy.kind !== 'file' || !isKnownPriorTemplate(legacy.contents)) return;
|
|
2415
|
+
if (!removeOnly) {
|
|
2416
|
+
if (before.agent.state === AGENT_STATES.missing) {
|
|
2417
|
+
const current = await inspectFile(before.agent.path);
|
|
2418
|
+
if (current.kind === 'missing') await installManagedAgent(before, outcome);
|
|
2419
|
+
}
|
|
2420
|
+
const template = renderAgentFile(await readAgentTemplate(), before.packageVersion);
|
|
2421
|
+
const current = await inspectFile(before.agent.path);
|
|
2422
|
+
if (current.kind !== 'file' || current.contents !== template) return;
|
|
2423
|
+
}
|
|
2424
|
+
const currentLegacy = await inspectFile(legacyPath);
|
|
2425
|
+
if (currentLegacy.kind !== 'file' || currentLegacy.contents !== legacy.contents) return;
|
|
2426
|
+
await unlink(legacyPath);
|
|
2427
|
+
if (!outcome.changed.includes('agent')) outcome.changed.push('agent');
|
|
2428
|
+
}
|
|
2429
|
+
|
|
2392
2430
|
/**
|
|
2393
2431
|
* Refresh only an agent file whose complete bytes match a known shipped template.
|
|
2394
2432
|
*
|
|
@@ -2428,6 +2466,7 @@ export async function refreshKnownAgentTemplate(options = {}) {
|
|
|
2428
2466
|
if (before.agent.state === AGENT_STATES.outdated) {
|
|
2429
2467
|
await installManagedAgent(before, { changed, refused });
|
|
2430
2468
|
}
|
|
2469
|
+
await migrateLegacyAgent(before, { changed, refused });
|
|
2431
2470
|
if (refreshMcp === true) {
|
|
2432
2471
|
// The automatic MCP half: only a provably-owned, merely-stale definition is
|
|
2433
2472
|
// rewritten, and only after the boundary and the config digest are re-proved. It
|
|
@@ -3128,7 +3167,7 @@ export async function adoptProvedMovedInstall(before) {
|
|
|
3128
3167
|
const args = Array.isArray(mcp.previous.args) ? mcp.previous.args : [];
|
|
3129
3168
|
if (args.length !== 1) return null;
|
|
3130
3169
|
if (mcp.previous.command !== mcp.desired.command && !isLegacyDesktopCommand(mcp.previous.command)) return null;
|
|
3131
|
-
if ((await
|
|
3170
|
+
if ((await isExplicitlyMigratableScript(args[0], mcp.desired.args[0])) !== true) return null;
|
|
3132
3171
|
let loaded;
|
|
3133
3172
|
try {
|
|
3134
3173
|
loaded = await loadConfig(mcp.path);
|
|
@@ -3145,7 +3184,7 @@ export async function adoptProvedMovedInstall(before) {
|
|
|
3145
3184
|
if (classification.marked !== true || classification.reason !== 'args-shape-not-ours') return null;
|
|
3146
3185
|
const currentArgs = Array.isArray(classification.previous?.args) ? classification.previous.args : [];
|
|
3147
3186
|
if (currentArgs.length !== 1) return null;
|
|
3148
|
-
if ((await
|
|
3187
|
+
if ((await isExplicitlyMigratableScript(currentArgs[0], mcp.desired.args[0])) !== true) return null;
|
|
3149
3188
|
return { document: loaded.document, classification, desired: mcp.desired };
|
|
3150
3189
|
}
|
|
3151
3190
|
|
|
@@ -3236,7 +3275,7 @@ export async function adoptMovedInstall(adopted, outcome, before) {
|
|
|
3236
3275
|
return;
|
|
3237
3276
|
}
|
|
3238
3277
|
const currentArgs = Array.isArray(classification.previous?.args) ? classification.previous.args : [];
|
|
3239
|
-
if (currentArgs.length !== 1 || (await
|
|
3278
|
+
if (currentArgs.length !== 1 || (await isExplicitlyMigratableScript(currentArgs[0], mcp.desired.args[0])) !== true) {
|
|
3240
3279
|
refuse('MCP_ENTRY_CONFLICT',
|
|
3241
3280
|
'the recorded entry script is no longer provably an installation of this package, so nothing was written',
|
|
3242
3281
|
'script-not-provably-ours');
|
|
@@ -212,6 +212,7 @@ async function submitTask({ req, res, connection, deps }) {
|
|
|
212
212
|
connectionId: connection.connectionId,
|
|
213
213
|
workspacePath: body.workspacePath,
|
|
214
214
|
prompt: body.prompt,
|
|
215
|
+
...(body.title === undefined ? {} : { title: body.title }),
|
|
215
216
|
overrides: body.overrides,
|
|
216
217
|
...(continueFromTaskId === undefined ? {} : { continueFromTaskId }),
|
|
217
218
|
});
|
|
@@ -229,6 +230,7 @@ async function submitTask({ req, res, connection, deps }) {
|
|
|
229
230
|
authorization,
|
|
230
231
|
workspacePath: body.workspacePath,
|
|
231
232
|
prompt: body.prompt,
|
|
233
|
+
...(body.title === undefined ? {} : { title: body.title }),
|
|
232
234
|
overrides: body.overrides,
|
|
233
235
|
...(continueFromTaskId === undefined ? {} : { continueFromTaskId }),
|
|
234
236
|
});
|
package/src/index.js
CHANGED
|
@@ -511,7 +511,7 @@ export async function apply(ctx, config = {}) {
|
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
/** Version reported by the runtime facts block. Mirrors `package.json`. */
|
|
514
|
-
const PLUGIN_VERSION = '1.3.
|
|
514
|
+
const PLUGIN_VERSION = '1.3.2';
|
|
515
515
|
|
|
516
516
|
/**
|
|
517
517
|
* Read the native approval service without turning absence into a throw.
|
package/src/jobs/engine.js
CHANGED
|
@@ -71,6 +71,7 @@ import { RUN_OUTCOMES, RunError, SessionPlacementRefusal, diagnostic, runAgent }
|
|
|
71
71
|
import { PermissionBridge, PermissionError, PERMISSION_CODES } from '../runtime/permissions.js';
|
|
72
72
|
import { DELEGATE_SANDBOX_MODE } from '../runtime/sandbox.js';
|
|
73
73
|
import { rememberSession, SESSION_CODES } from '../runtime/session-placement.js';
|
|
74
|
+
import { taskTitle } from './title.js';
|
|
74
75
|
import { REVIEW_STATES, reviewWork } from '../review/reviewer.js';
|
|
75
76
|
import { buildReviewPrompt, buildWorkerPrompt } from '../review/prompts.js';
|
|
76
77
|
import { captureBaseline, captureDiff } from '../workspace/audit.js';
|
|
@@ -425,6 +426,7 @@ export class JobEngine {
|
|
|
425
426
|
? 'switch'
|
|
426
427
|
: (request?.authorization === 'session' ? 'session' : 'task');
|
|
427
428
|
const task = this.createTask(prompt, authorization);
|
|
429
|
+
task.title = taskTitle(request?.title, prompt);
|
|
428
430
|
// Frozen before the first await so the task record states, from the moment it
|
|
429
431
|
// exists, whether it starts a conversation or continues one.
|
|
430
432
|
task.continueFromTaskId = continueFromTaskId === '' ? null : continueFromTaskId;
|
|
@@ -2467,6 +2469,7 @@ export class JobEngine {
|
|
|
2467
2469
|
task.native.started = true;
|
|
2468
2470
|
const pending = runAgent(this.deps, {
|
|
2469
2471
|
prompt,
|
|
2472
|
+
title: task.title,
|
|
2470
2473
|
cwd: task.executionPath,
|
|
2471
2474
|
selection: workerSelection,
|
|
2472
2475
|
timeoutMs: task.effective.worker.timeoutSeconds * 1000,
|
|
@@ -2985,6 +2988,7 @@ export class JobEngine {
|
|
|
2985
2988
|
return {
|
|
2986
2989
|
taskId: task.taskId,
|
|
2987
2990
|
state: task.state,
|
|
2991
|
+
title: task.title ?? taskTitle(null, task.prompt),
|
|
2988
2992
|
phase: task.phase,
|
|
2989
2993
|
createdAt: task.createdAt ?? null,
|
|
2990
2994
|
startedAt: task.startedAt ?? null,
|
|
@@ -3340,6 +3344,7 @@ export class JobEngine {
|
|
|
3340
3344
|
const view = {
|
|
3341
3345
|
taskId: task.taskId,
|
|
3342
3346
|
state: task.state,
|
|
3347
|
+
title: task.title ?? taskTitle(null, task.prompt),
|
|
3343
3348
|
phase: task.phase,
|
|
3344
3349
|
createdAt: task.createdAt,
|
|
3345
3350
|
startedAt: task.startedAt,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { redactText } from '../config/redact.js';
|
|
2
|
+
|
|
3
|
+
/** A display title is task content, never a directory name or routing instruction. */
|
|
4
|
+
export function taskTitle(title, prompt = '') {
|
|
5
|
+
const lines = String(prompt).split(/\r?\n/u).map(line => line.trim()).filter(Boolean);
|
|
6
|
+
const goal = lines.findIndex(line => /^(?:#{1,6}\s*)?(?:目标|任务目标|工作内容|任务|goal|objective|task)(?:\s*[::]|\s*$)/iu.test(line));
|
|
7
|
+
let text = typeof title === 'string' ? title.trim() : '';
|
|
8
|
+
if (!text && goal >= 0) {
|
|
9
|
+
text = lines[goal].replace(/^(?:#{1,6}\s*)?(?:目标|任务目标|工作内容|任务|goal|objective|task)\s*[::]?\s*/iu, '') || lines[goal + 1] || '';
|
|
10
|
+
}
|
|
11
|
+
if (!text) {
|
|
12
|
+
text = lines.find(line => !/^(?:you are\b|act as\b|你是|你负责|```|#{1,6}\s*(?:instructions|角色|执行规则))/iu.test(line)) || '委派任务';
|
|
13
|
+
}
|
|
14
|
+
text = redactText(text).replace(/^[#*\-\d.\s]+/u, '').replace(/[\u0000-\u001f\u007f]+/gu, ' ').replace(/\s+/gu, ' ').trim();
|
|
15
|
+
const chars = Array.from(text || '委派任务');
|
|
16
|
+
return chars.length > 48 ? chars.slice(0, 47).join('') + '…' : chars.join('');
|
|
17
|
+
}
|
package/src/mcp/server.js
CHANGED
|
@@ -76,7 +76,7 @@ export const SUPPORTED_PROTOCOL_VERSIONS = Object.freeze([
|
|
|
76
76
|
export const LATEST_PROTOCOL_VERSION = SUPPORTED_PROTOCOL_VERSIONS[0];
|
|
77
77
|
|
|
78
78
|
/** Identifies this server in the handshake. */
|
|
79
|
-
export const SERVER_INFO = Object.freeze({ name: 'dsh-delegate', version: '1.3.
|
|
79
|
+
export const SERVER_INFO = Object.freeze({ name: 'dsh-delegate', version: '1.3.2' });
|
|
80
80
|
|
|
81
81
|
/** Bound on a tool result's text. A task view can be large; a model's context cannot. */
|
|
82
82
|
export const MAX_TOOL_TEXT_CHARS = 20_000;
|
|
@@ -232,6 +232,7 @@ export const TOOLS = Object.freeze([
|
|
|
232
232
|
+ 'different source path names a different repository and the continuation is refused.',
|
|
233
233
|
},
|
|
234
234
|
prompt: { type: 'string', description: 'The task to perform.' },
|
|
235
|
+
title: { type: 'string', maxLength: 120, description: 'Short work-content title in the operator\'s language, e.g. 修复登录错误. Used to name the new DSH Workspace; omit role instructions and task ids. A follow-up keeps its existing Workspace name.' },
|
|
235
236
|
overrides: {
|
|
236
237
|
type: 'object',
|
|
237
238
|
description: 'Optional per-task overrides (model/effort/timeout). Validated by the harness.',
|
|
@@ -521,6 +521,7 @@ async function resolvePlacement(deps, request) {
|
|
|
521
521
|
if (request?.sessionId !== undefined && request?.sessionId !== null) return null;
|
|
522
522
|
const placement = await placeSession(deps, {
|
|
523
523
|
path: request?.cwd,
|
|
524
|
+
title: request?.title,
|
|
524
525
|
// The only thing that can continue an existing conversation, and it is the
|
|
525
526
|
// caller's explicit statement that this submission is a follow-up to THAT task.
|
|
526
527
|
// Omitted means a new conversation, always.
|
|
@@ -1237,6 +1238,7 @@ export async function driveAgent(deps, request) {
|
|
|
1237
1238
|
reused: placement.reused === true,
|
|
1238
1239
|
workspaceId: placement.workspaceId ?? null,
|
|
1239
1240
|
workspacePath: placement.workspacePath ?? null,
|
|
1241
|
+
workspaceTitle: placement.workspaceTitle ?? null,
|
|
1240
1242
|
sessionId: target.sessionId ?? placement.sessionId ?? null,
|
|
1241
1243
|
},
|
|
1242
1244
|
cancelCause: target.abortCause,
|
|
@@ -287,7 +287,7 @@ export function continuationOf(value) {
|
|
|
287
287
|
* @returns {Promise<{ workspaceId: string, path: string, created: boolean }>} the Workspace fact.
|
|
288
288
|
* @throws {SessionPlacementError} when the controller refuses or reports nothing usable.
|
|
289
289
|
*/
|
|
290
|
-
export async function ensureWorkspace(workspaces, path) {
|
|
290
|
+
export async function ensureWorkspace(workspaces, path, title = null, taskId = '') {
|
|
291
291
|
let value;
|
|
292
292
|
try {
|
|
293
293
|
value = await workspaces.create({ path });
|
|
@@ -309,8 +309,23 @@ export async function ensureWorkspace(workspaces, path) {
|
|
|
309
309
|
{ returned: value === null || typeof value !== 'object' ? typeof value : 'object without workspace.workspaceId' },
|
|
310
310
|
);
|
|
311
311
|
}
|
|
312
|
+
let workspaceTitle = workspace.title ?? null;
|
|
313
|
+
let namingError = null;
|
|
314
|
+
if (value.created === true && typeof title === 'string' && title.trim() !== '' && typeof workspaces.rename === 'function') {
|
|
315
|
+
try {
|
|
316
|
+
let renamed;
|
|
317
|
+
try { renamed = await workspaces.rename({ workspaceId, title }); }
|
|
318
|
+
catch (error) {
|
|
319
|
+
if (error?.code !== 'workspace/name-conflict') throw error;
|
|
320
|
+
renamed = await workspaces.rename({ workspaceId, title: `${title} · ${taskId.slice(-6) || workspaceId.slice(-6)}` });
|
|
321
|
+
}
|
|
322
|
+
workspaceTitle = renamed?.workspace?.title ?? title;
|
|
323
|
+
} catch (error) { namingError = diagnostic(error?.message ?? error, 200); }
|
|
324
|
+
}
|
|
312
325
|
return {
|
|
313
326
|
workspaceId,
|
|
327
|
+
workspaceTitle,
|
|
328
|
+
namingError,
|
|
314
329
|
path: typeof workspace.path === 'string' && workspace.path !== '' ? workspace.path : path,
|
|
315
330
|
created: value?.created === true,
|
|
316
331
|
};
|
|
@@ -369,7 +384,8 @@ export async function placeSession(deps, request) {
|
|
|
369
384
|
const execPath = request.path;
|
|
370
385
|
const continueFromTaskId = continuationOf(request?.continueFromTaskId);
|
|
371
386
|
|
|
372
|
-
const workspace = await ensureWorkspace(workspaces, execPath);
|
|
387
|
+
const workspace = await ensureWorkspace(workspaces, execPath, continueFromTaskId === null ? request?.title : null, request?.taskId ?? deps.taskId ?? '');
|
|
388
|
+
if (workspace.namingError) deps.logger?.warn?.(`TaskBridge workspace title: ${workspace.namingError}`);
|
|
373
389
|
|
|
374
390
|
if (continueFromTaskId !== null) {
|
|
375
391
|
const parent = await loadContinuation(deps, continueFromTaskId);
|
|
@@ -386,6 +402,7 @@ export async function placeSession(deps, request) {
|
|
|
386
402
|
continuedFromTaskId: continueFromTaskId,
|
|
387
403
|
reused: true,
|
|
388
404
|
workspaceId: workspace.workspaceId,
|
|
405
|
+
workspaceTitle: workspace.workspaceTitle,
|
|
389
406
|
workspacePath: workspace.path,
|
|
390
407
|
workspaceCreated: workspace.created,
|
|
391
408
|
sessionId: resumed.sessionId,
|
|
@@ -405,6 +422,7 @@ export async function placeSession(deps, request) {
|
|
|
405
422
|
continuedFromTaskId: null,
|
|
406
423
|
reused: false,
|
|
407
424
|
workspaceId: workspace.workspaceId,
|
|
425
|
+
workspaceTitle: workspace.workspaceTitle,
|
|
408
426
|
workspacePath: workspace.path,
|
|
409
427
|
workspaceCreated: workspace.created,
|
|
410
428
|
sessionId: created.sessionId,
|