dsh-superagent-ptc 0.0.0-stage → 0.1.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-super-agent-mode contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE.md ADDED
@@ -0,0 +1,47 @@
1
+ # Third-party reference notice
2
+
3
+ ## Package identity and provenance
4
+
5
+ `dsh-superagent-ptc` (display name **SuperAgent PTC**) is the renamed continuation of this workspace's original `dsh-super-agent-mode` implementation. The rename on 2026-11-19 changes the package, global bare Host Loader row, Host export name, client `data-plugin`, and ModuleLoader id. It intentionally preserves the established `super_agent_mode` storage domain, `plugin:dsh-super-agent-mode/proof` native record, `dsh-super-agent-mode/projection` RPC endpoint, and right-sidebar internal identifiers so existing Runs and proofs remain readable.
6
+
7
+ Development-only `@deepseek-ai/*` pins are aligned to DSH 0.2.2-rc.5; the declared runtime compatibility range remains `>=0.2.2-rc.3 <0.3.0-0`.
8
+
9
+ ## dsh-super-ptc-mode
10
+
11
+ - Upstream: https://github.com/zouyuanqing/dsh-super-ptc-mode
12
+ - Copyright: Copyright (c) 2026 zouyuanqing
13
+ - License: MIT
14
+ - Local reference snapshot used during development (not redistributed).
15
+ - Reference files: `cordis.patch.yml` and `LICENSE`
16
+ - Reuse: the thin preset-composition approach and Lead delegation doctrine informed this package. The Super Agent persona and composition are rewritten for the current DSH rc.3 contract, including direct use of `@deepseek-ai/dsh-tool-executor-ptc`.
17
+
18
+ The upstream MIT notice is preserved below:
19
+
20
+ > MIT License
21
+ >
22
+ > Copyright (c) 2026 zouyuanqing
23
+ >
24
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
25
+ > of this software and associated documentation files (the "Software"), to deal
26
+ > in the Software without restriction, including without limitation the rights
27
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
28
+ > copies of the Software, and to permit persons to whom the Software is
29
+ > furnished to do so, subject to the following conditions:
30
+ >
31
+ > The above copyright notice and this permission notice shall be included in all
32
+ > copies or substantial portions of the Software.
33
+ >
34
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
35
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
36
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
37
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
38
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
39
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
40
+ > SOFTWARE.
41
+
42
+ ## Additional implementation references
43
+
44
+ - `@khorsheed/dsh-taskpilot` 0.3.7 (MIT, https://github.com/Khorsheed/dsh-taskpilot): behavior-only reference for attaching session supervision to existing composer/right-sidebar surfaces. No TaskPilot implementation is copied.
45
+ - Local `dsh-codeflow` (MIT): reference for narrowing the slots interface structurally instead of importing the unrelated hoisted pre-rc.3 slots declarations. `scripts/build-client.mjs` adapts its MIT esbuild CJS + `window.__ModuleLoader__.load` recipe for this package. No CodeGraph implementation is copied.
46
+
47
+ No implementation is copied from the UNLICENSED dsh-task-supervisor reference.
package/README.md CHANGED
@@ -1,3 +1,226 @@
1
- # Temporary Holding Version
1
+ # SuperAgent PTC
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/dsh-superagent-ptc?color=cb3837)](https://www.npmjs.com/package/dsh-superagent-ptc)
4
+ [![npm downloads](https://img.shields.io/npm/dm/dsh-superagent-ptc?color=blue)](https://www.npmjs.com/package/dsh-superagent-ptc)
5
+ [![license MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)
6
+ [![DSH](https://img.shields.io/badge/DSH-0.2.2--rc.5-6f42c1)](https://github.com/deepseek-ai/deepseek-harness)
7
+ [![tests](https://img.shields.io/badge/tests-176%2F176-brightgreen)](docs/VALIDATION.md)
8
+
9
+ > **Long-task supervision layer for DeepSeek Harness** — versioned anchors, bounded delegation, independent acceptance, evidence-gated release.
10
+ > **DSH 长任务监督层** —— 目标锚点、有界委派、独立验收、证据放行。
11
+
12
+ SuperAgent PTC turns "the agent says it is done" into "an independent reviewer proved it is done". It is a **preset-first** plugin: it adds a supervision plane on top of the native PTC / Agent / Goal / Teams runtime instead of building a second agent loop, task board or router.
13
+
14
+ ```
15
+ 你:把这份调研拆成三项工作,逐个验收后再写总结
16
+ SuperAgent PTC:Run + Anchor → 逐项 Mandate 派给 Worker → standard Reviewer 独立核验
17
+ → 证据通过才放行 → super_snapshot 给出可验证的 revision/proof
18
+ ```
19
+
20
+ ![Layered architecture](docs/images/architecture-layers.png)
21
+
22
+ ## 目录
23
+
24
+ - [为什么需要它](#为什么需要它)
25
+ - [特性](#特性)
26
+ - [双层架构](#双层架构)
27
+ - [监督循环](#监督循环)
28
+ - [安装](#安装)
29
+ - [快速上手](#快速上手)
30
+ - [工具一览](#工具一览)
31
+ - [右栏监管面板](#右栏监管面板)
32
+ - [证据门与安全边界](#证据门与安全边界)
33
+ - [兼容性](#兼容性)
34
+ - [验证](#验证)
35
+ - [常见问题](#常见问题)
36
+ - [开发与贡献](#开发与贡献)
37
+ - [许可](#许可)
38
+
39
+ ## 为什么需要它
40
+
41
+ 长任务失败通常不是"模型不会",而是四件事没有被约束:
42
+
43
+ | 常见问题 | 后果 | SuperAgent PTC 的做法 |
44
+ | --- | --- | --- |
45
+ | 目标在长对话里漂移 | 做到一半换了题目 | **版本化 Anchor**:目标、DoD、义务都有版本,纠正会显式失效旧工作 |
46
+ | Agent 自报完成 | "done" 但没有验证 | `reported_done ≠ accepted`,必须过独立 Reviewer 与证据门 |
47
+ | 委派没有边界 | Worker 越权、重复劳动 | **Mandate 委派合同**:工作项、写域、模型路由、attempt 计数都冻结在合同里 |
48
+ | 崩溃后状态不明 | 不知道做到哪,证据是否可信 | **SnapshotProof + RunState v2**:先写原生证明,再落存储,最后替换 live core |
49
+
50
+ ## 特性
51
+
52
+ - **Preset-first**:与标准、创造、PTC、极简并列的一个 Agent 预设(`SuperAgent PTC`),不改默认模型、权限或其他会话。
53
+ - **七项监管工具**:`super_run`、`super_anchor`、`super_mandate`、`super_evidence`、`super_review`、`super_route`、`super_snapshot`,全部通过 PTC 的 `run_code` 调用,不新增脚本工具。
54
+ - **原生身份绑定**:Worker / Reviewer 是真实的原生子 Agent;Host 用原生 `sendMessage` 唤醒绑定的 Reviewer,杜绝"Lead 自己扮演 Reviewer"。
55
+ - **独立只读验收**:Reviewer 必须是原生 `standard` 预设,guard 对它的写操作和未知 shell 分类 fail-closed;`pwsh` 只读命令(含 `$env:` 读取)按实际参数分类。
56
+ - **分型证据门**:证据只有 `pass / fail / unknown` 三态;`unknown` 不放行;build/单测/截图不能替代 runtime 证据。
57
+ - **失败预算与可恢复审计**:同 fingerprint 达上限即 blocked;`super_run recover` 增代并保留完整审计链。
58
+ - **客户端可视化**:右栏监管面板 + composer 入口,只读投影,不写状态。
59
+ - **零全局副作用**:普通会话没有 `super_*` 工具、没有提示词、没有面板。
60
+
61
+ ### 一张表说清"它不做什么"
62
+
63
+ | 不做 | 原因 |
64
+ | --- | --- |
65
+ | 不重建 Agent loop / 任务板 / 全局路由 | 原生 Session、Agent、Goal、Teams 才是执行权威 |
66
+ | 不提供全局文件权限沙箱 | 写域是协作契约,不是操作系统级隔离 |
67
+ | 不做自动模型降级 | 只在显式授权、allowlist 与预算内的有界故障切换 |
68
+ | 不把 `reported_done` 当验收 | 独立 Reviewer + 证据门才产生 `accepted` |
69
+
70
+ ## 双层架构
71
+
72
+ 监管面(Control Plane)只回答"能不能放行",执行面(Execution Plane)只回答"实际做了什么",两者之间只有一条契约膜:`super_*` 工具是状态与证据的唯一写入口。
73
+
74
+ ![Dual-layer architecture](docs/images/architecture-dual.png)
75
+
76
+ - **A 监督面**:Lead 维护 Anchor 与义务账本;Mandate 冻结工作项、写域、路由与 attempt;证据门与预算决定放行。
77
+ - **契约膜**:任何状态变更都必须穿过 `super_*` 的 CAS 校验,双层之间没有第二套写路径。
78
+ - **B 执行面**:PTC `run_code` 编排宿主工具、原生 `subagent` 创建 Worker/Reviewer,回执以 `reported_done` 与工具结果的形式返回。
79
+ - **共同底座**:原生运行时提供身份、生命周期与证明;`storageDomain RunState v2` 与 `SnapshotProof` 保证崩溃后可恢复。
80
+
81
+ ## 监督循环
82
+
83
+ ![Supervision loop](docs/images/lifecycle.png)
84
+
85
+ ```text
86
+ super_run create # 目标 + 完成定义 + 门禁策略
87
+ super_run plan # 工作项 / 依赖 / 义务(开放账本)
88
+ super_anchor # 版本化锚点;纠正时显式失效受影响工作
89
+ super_mandate prepare # 冻结工作项、写域、模型路由、attempt
90
+ super_mandate bind # 绑定原生 Worker SessionId
91
+ super_mandate bindReviewer # 绑定 standard Reviewer,Host 原生唤醒
92
+ super_evidence record # 证据三态,必须可追溯
93
+ super_review evaluate # 门禁评估
94
+ super_review decide/release # 通过才放行
95
+ super_snapshot # 只读核对 revision / generation / proof
96
+ ```
97
+
98
+ ## 安装
99
+
100
+ 要求:DSH `>=0.2.2-rc.3 <0.3.0-0`,Node `^22.19.0 || >=24`。
101
+
102
+ ```bash
103
+ # npm 安装到当前 profile
104
+ dsh plugin --profile desktop add dsh-superagent-ptc
105
+
106
+ # 或使用完整包名说明(等价)
107
+ dsh plugin --profile desktop add npm:dsh-superagent-ptc
108
+ ```
109
+
110
+ 安装后**完全退出并重新启动 DSH**,然后新建会话,在预设选择器里选择 **SuperAgent PTC**。
111
+
112
+ ### 通过 DSH 插件市场索引安装
113
+
114
+ 在 DSH → 设置 → 插件 → 发现 中添加索引 URL,然后搜索 `SuperAgent PTC`:
115
+
116
+ ```text
117
+ https://raw.githubusercontent.com/BioAIEvolu/dsh-superagent-ptc/main/market-index.json
118
+ ```
119
+
120
+ 该索引已通过 DSH 官方 `parseMarketIndex` 校验,安装规格为 `dsh-superagent-ptc@0.1.0`。
121
+
122
+ 想先本地试用?把仓库 clone 下来用 `link:` 安装:
123
+
124
+ ```bash
125
+ git clone https://github.com/BioAIEvolu/dsh-superagent-ptc.git
126
+ dsh plugin --profile desktop add link:/absolute/path/to/dsh-superagent-ptc
127
+ ```
128
+
129
+ ## 快速上手
130
+
131
+ 1. 新建会话,选择 **SuperAgent PTC** 预设。
132
+ 2. 直接说清目标与完成标准,例如:
133
+
134
+ ```text
135
+ 用 SuperAgent PTC 做最小监管闭环:
136
+ super_run create 建 Run;plan 两个工作项,W1 读 README 并给 3 条要点,W2 依赖 W1 本阶段保持 held;
137
+ Worker 继承 super-agent,Reviewer 用 agent_preset=standard;
138
+ prepare/bind/bindReviewer 后由 Reviewer 独立记录 coverage 证据并 evaluate/decide/release;
139
+ 最后 super_snapshot 报告真实 Run/WorkItem/Mandate/Evidence/Decision ID 与 revision/generation/proof。
140
+ ```
141
+
142
+ 3. 点击 composer 上方的 **Super Agent 监管**,右栏会显示真实 Run 状态与审计时间线。
143
+
144
+ ## 工具一览
145
+
146
+ | 工具 | 关键动作 | 说明 |
147
+ | --- | --- | --- |
148
+ | `super_run` | `create` `plan` `show` `recover` `complete` | Run 生命周期;`recover` 增代并重新对账 |
149
+ | `super_anchor` | `show` `apply` `history` | 版本化锚点;纠正时显式失效受影响工作 |
150
+ | `super_mandate` | `prepare` `bind` `bindReviewer` `report` `show` | 委派合同与原生 SessionId 绑定 |
151
+ | `super_evidence` | `record` `observe` `list` | 证据三态,写域与来源角色校验 |
152
+ | `super_review` | `evaluate` `decide` `release` | 独立验收与放行 |
153
+ | `super_route` | `show` `set` `inspect` `switch` | 当前 Run 的模型策略与有界切换 |
154
+ | `super_snapshot` | `{}` | 只读核对 Run / gate / proof / recovery |
155
+
156
+ 每个写动作都带 `expectedRevision` / `expectedGeneration`,冲突即拒绝,不会静默覆盖。
157
+
158
+ ## 右栏监管面板
159
+
160
+ ![Right panel anatomy](docs/images/panel-mockup.png)
161
+
162
+ - 面板是**只读投影**:`目标/Anchor`、`模型策略与路由审计`、`工作项`、`Mandate`、`证据与门禁`、`审计时间线`、`议程/attempt`。
163
+ - 面板不写状态;所有变更只能由 `super_*` 工具穿过 Host 的 CAS 校验完成。
164
+ - composer 入口不阻塞输入,普通会话看不到该入口。
165
+
166
+ ## 证据门与安全边界
167
+
168
+ | 规则 | 行为 |
169
+ | --- | --- |
170
+ | 证据三态 | `pass` 才可能放行;`fail` 阻塞;`unknown` 不当作通过 |
171
+ | 来源角色 | 证据必须来自允许的角色与写域,跨项复用的旧证据会被标记 stale |
172
+ | Reviewer 只读 | 写操作、未知 shell、权限提升指令一律 fail-closed;只读命令按参数分类 |
173
+ | 提交顺序 | `SnapshotProof` → `storageDomain` → live core;任一步失败即中止 |
174
+ | 恢复 | `recover` 增加 generation,旧证据不复用;quarantine 只允许 root Lead 处理 |
175
+ | 沙箱边界 | 本插件**不提供**操作系统级文件权限沙箱,写域是协作契约 |
176
+ | 信任边界 | SnapshotProof 依赖原生会话日志,不防御恶意宿主或直接篡改原生日志 |
177
+
178
+ ## 兼容性
179
+
180
+ | 项 | 值 |
181
+ | --- | --- |
182
+ | DSH | `>=0.2.2-rc.3 <0.3.0-0`(开发与验证基线 `0.2.2-rc.5`) |
183
+ | Node | `^22.19.0 || >=24.0.0` |
184
+ | 宿主侧 peer | `dsh-session`、`dsh-storage-domain`、`dsh-tools`、`react` |
185
+ | 客户端 | web surface,`@deepseek-ai/dsh-client-connection`、`ui-conversation`、`ui-sidebar-right`、`ui-subagent` |
186
+
187
+ ## 验证
188
+
189
+ - 自动化:**176 / 176 pass**,`typecheck` 与 `build` 均 exit 0。
190
+ - 真实桌面链路:两条独立 Electron 会话完成监督闭环,含跨代恢复(generation 1→4)、多次 Anchor 修订、独立 Reviewer 放行与 SnapshotProof 对齐。
191
+ - 修复记录:Reviewer 只读 guard 曾把 `pwsh "$env:NAME"` 误判为写操作;已按实际参数分类并加入回归用例。
192
+ - 详细证据摘要见 [docs/VALIDATION.md](docs/VALIDATION.md)。
193
+
194
+ ### 明确未覆盖
195
+
196
+ - 真实 provider 故障下的自动切换、预算耗尽 blocked、`model.select` 失败分支:尚未在实机发生,保持 unknown。
197
+ - 未提供全局文件权限沙箱;不承诺跨会话隔离之外的安全边界。
198
+
199
+ ## 常见问题
200
+
201
+ **Q:选了预设但没有 `super_*` 工具?**
202
+ 只有 `super-agent` 会话与已绑定且验证过的只读 Reviewer 才拿到工具;确认预设确实切换成功,并完全重启 DSH。
203
+
204
+ **Q:Reviewer 一直无法 decide?**
205
+ 查看门禁返回的 `missingEvidence` / `staleEvidence` / `REVIEWER_NOT_READONLY`:前者补证据,后者说明 Reviewer 有过写回执,需换新的只读 Reviewer。
206
+
207
+ **Q:崩溃后 Run 状态怎么恢复?**
208
+ root Lead 调用 `super_run recover`;generation 会增加,旧证据不复用,需要在新 generation 重新取证。
209
+
210
+ **Q:能当全局路由/自动降级用吗?**
211
+ 不能。`super_route` 只管理当前 Run 的显式策略;没有 out-of-the-box 的全局自动路由。
212
+
213
+ ## 开发与贡献
214
+
215
+ ```bash
216
+ pnpm install
217
+ pnpm typecheck && pnpm build && pnpm test
218
+ ```
219
+
220
+ - 目录:`src/core`(纯状态机,无 Host 依赖)、`src/host`(工具、guard、routing、存储)、`src/client`(面板与入口)、`test/`。
221
+ - 提交前请保持 `typecheck`、`build`、`test` 全绿;核心状态机改动需补正反例。
222
+ - 欢迎 Issue / PR:https://github.com/BioAIEvolu/dsh-superagent-ptc/issues
223
+
224
+ ## 许可
225
+
226
+ MIT License,见 [LICENSE](LICENSE)。上游 DSH 组件版权与来源见 [NOTICE.md](NOTICE.md)。
@@ -0,0 +1,165 @@
1
+ # dsh-superagent-ptc — DSH >=0.2.2-rc.3 <0.3.0-0 profile bundle patch.
2
+ # One global bare-package Host row enables client-module discovery; super tools/prompt
3
+ # use current-preset/bound-Reviewer conditions and never leak into ordinary sessions.
4
+ # Tool composition follows the installed official PTC preset. The PTC executor
5
+ # is mounted directly; Agent Teams remains host-controlled per agent.
6
+ - insert:
7
+ - id: super-agent-host-global
8
+ name: dsh-superagent-ptc
9
+ - id: preset-super-agent
10
+ name: '@deepseek-ai/dsh-agent-preset'
11
+ config:
12
+ id: super-agent
13
+ order: 5
14
+ name: SuperAgent PTC 模式
15
+ description: PTC+ 目标锚点 + 有界委派 + 独立验收 + 证据放行;保留未决义务,无证据不放行。
16
+ plugins:
17
+ - id: persona
18
+ name: '@deepseek-ai/dsh-persona'
19
+ config:
20
+ prefix: You are a coding agent powered by the {{model}} model.
21
+ suffix: |
22
+ 你是 Super Agent 模式中的长任务监管协作者。按运行时身份区分 Lead、Worker、Reviewer,不要把某一角色的权限或职责套给另一角色。
23
+
24
+ 作为 Lead,主 Agent 不直接实现:先建立 goal、目标锚点、验收标准与任务拆分,通过 Mandate 委派给 Worker,持续监工、整合并请求独立验收。Lead 负责接口、依赖、冲突与放行决策,不把亲自写实现当作默认路径。
25
+
26
+ Mandate 至少绑定 work item、当前 anchor version、write scopes、acceptance、Worker、独立 Reviewer、attempt 与可用的 native task/agent IDs。写作用域是协作契约,不是全局文件权限沙箱;所有工具仍受宿主原有 sandbox/approval 管线约束。创建 Run 时每个 obligation 必须提供 id/kind/text,kind 只能是 requirement/prohibition/coverage;可选 requiredEvidence/animation/coverage/sourceId,不得省略 kind 或增加未知字段。规划 WorkItem 必须提供 id/title/dependencies/writeScopes/acceptance/obligationIds/gateProfile,依赖字段是 dependencies,不得写 dependsOn 或省略必填字段。
27
+
28
+ 异常进入 quarantine 后,root Lead 使用 super_run 的 recover 动作,从最后一个原生 SnapshotProof 匹配的 storage record 做 fresh restore;只有新 proof 与 storage 持久化成功才替换 live 并清除 quarantine。不要重复 create 或假装清空错误即可恢复。普通 CoreResult 校验拒绝不进入 quarantine,修正参数后可立即重试。
29
+
30
+ Worker 只在 Mandate 与写作用域内实现,记录真实命令、回执、产物与失败,不把 reported_done 当作 accepted。Worker 默认继承 super-agent PTC,委派时省略 agent_preset;Reviewer 必须使用 agent_preset: 'standard' 选择 native standard,避免 PTC run_code 与只读验收门冲突。Reviewer 必须独立于 Worker、只读核验验收标准和证据;Reviewer 与 Worker 相同、发生写入、证据缺失或不支持核验时,不得 pass。先完成 prepare/bindReviewer 及 proof/storage/live 提交,再由 Host 用原生 sendMessage 唤醒空闲 Reviewer;下一 step 的 tools.resolve 会重新评估 super 工具可见性。唤醒消息明确当前请求的 super_snapshot/super_evidence/super_review/super_run/super_anchor/super_mandate/super_route 工具清单,Reviewer 必须首先实际执行 super_snapshot({}) 并读取返回 JSON,再按当前 Mandate 执行 super_evidence 与 super_review;不要先盘点/推断工具或声称工具不可用。不要让待命 Reviewer 在绑定前寻找 super 工具,不要由 Lead 代审,也不要给 Reviewer 写权限。
31
+
32
+ 优先使用宿主原生委派与共享任务抽象。Teams 仅在实际启用时使用 team_task、list_agents、send_message、wait_agent 等当前能力;不要假定 Team 已开启。Teams 未启用或能力不可证实时,用原生 subagent + Mandate/native IDs 降级,并在 UI/报告中标 unknown 或 未受控,不伪造 Team 状态。
33
+
34
+ 每个目标、约束和未决义务都绑定版本锚点。最新用户纠正优先:使受影响的旧 Mandate、证据与决定 superseded,但未撤回的开放义务必须保留并进入新 anchor;旧 anchor/attempt 的证据不能放行新工作。
35
+
36
+ 证据只有 pass / fail / unknown 三态。缺失、超时、格式错误、来源不符、过期或宿主不支持均为 unknown;静态、构建或单元证据不能替代 GUI、动画、hover 或数值对账证据。无证据不放行,unknown 不放行,self-pass 不放行。
37
+
38
+ 独立验收是 accepted/completed 的必要条件。设置同指纹失败预算与总返工预算;达到预算即 blocked,只有用户新证据或显式重签才能重开。最终回答必须区分已验证、部分完成、失败与未决事项,不宣称本预设提供全局文件权限沙箱或绕过宿主权限的能力。
39
+ - id: agent-instructions
40
+ name: '@deepseek-ai/dsh-agent-instructions'
41
+ config:
42
+ maxBytes: 65536
43
+ - id: time-context
44
+ name: '@deepseek-ai/dsh-time-context'
45
+ - id: tool-bash
46
+ name: '@deepseek-ai/dsh-tool-bash'
47
+ disabled: !!js process.platform === 'win32'
48
+ - id: tool-pwsh
49
+ name: '@deepseek-ai/dsh-tool-pwsh'
50
+ disabled: !!js process.platform !== 'win32'
51
+ - id: tool-fs
52
+ name: '@deepseek-ai/dsh-tool-fs'
53
+ config:
54
+ applyPatch: false
55
+ - id: tool-fs-search
56
+ name: '@deepseek-ai/dsh-tool-fs-search'
57
+ config:
58
+ sampleOverCapGlobResults: false
59
+ - id: tool-jobs
60
+ name: '@deepseek-ai/dsh-tool-jobs'
61
+ - id: tool-schedule
62
+ name: '@deepseek-ai/dsh-tool-schedule'
63
+ - id: skill-filesystem
64
+ name: '@deepseek-ai/dsh-skill-filesystem'
65
+ - id: tool-skill
66
+ name: '@deepseek-ai/dsh-tool-skill'
67
+ - id: command-goal
68
+ name: '@deepseek-ai/dsh-command-goal'
69
+ - id: tool-goal
70
+ name: '@deepseek-ai/dsh-tool-goal'
71
+ - id: planning
72
+ name: cordis:group
73
+ group: true
74
+ isolate:
75
+ planMode: true
76
+ config:
77
+ - id: plan-mode
78
+ name: '@deepseek-ai/dsh-plan-mode'
79
+ config:
80
+ section: |
81
+ You are in plan mode. Stay in plan mode until the user approves your plan through exit_plan_mode or switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
82
+
83
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
84
+
85
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
86
+
87
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
88
+
89
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
90
+
91
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
92
+ - id: compaction
93
+ name: cordis:group
94
+ group: true
95
+ isolate:
96
+ compaction: true
97
+ toolResultPruner: true
98
+ config:
99
+ - id: compaction-basic
100
+ name: '@deepseek-ai/dsh-compaction-basic'
101
+ - id: command-compact
102
+ name: '@deepseek-ai/dsh-command-compact'
103
+ - id: tool-result-pruner
104
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
105
+ config:
106
+ thresholdChars: 8192
107
+ headChars: 4096
108
+ tailChars: 1024
109
+ - id: delegation
110
+ name: cordis:group
111
+ group: true
112
+ isolate:
113
+ workflowEngine: true
114
+ config:
115
+ - id: tool-subagent-control
116
+ name: '@deepseek-ai/dsh-tool-subagent-control'
117
+ config:
118
+ interrupt: false
119
+ - id: tool-subagent
120
+ name: '@deepseek-ai/dsh-tool-subagent'
121
+ config:
122
+ provider: spawn
123
+ toolName: subagent
124
+ modelSelection: true
125
+ modelDiscovery: true
126
+ # Omitting agent_preset keeps the Worker on super-agent PTC;
127
+ # Lead may explicitly select native standard for a Reviewer.
128
+ allowedAgentPresets: [super-agent, standard]
129
+ - id: tool-subagent-fork
130
+ name: '@deepseek-ai/dsh-tool-subagent'
131
+ config:
132
+ provider: fork
133
+ toolName: subagent_fork
134
+ - id: workflow-ptc
135
+ name: '@deepseek-ai/dsh-workflow-ptc'
136
+ disabled: true
137
+ config:
138
+ provider: spawn
139
+ - id: tool-workflow
140
+ name: '@deepseek-ai/dsh-tool-workflow'
141
+ disabled: true
142
+ - id: tool-ask-user
143
+ name: '@deepseek-ai/dsh-tool-ask-user'
144
+ - id: tool-todo
145
+ name: '@deepseek-ai/dsh-tool-todo'
146
+ config:
147
+ allowParallelInProgress: true
148
+ - id: tool-web
149
+ name: '@deepseek-ai/dsh-tool-web'
150
+ config:
151
+ fetch: true
152
+ searchTimeoutMs: 60000
153
+ - id: tool-executor-ptc
154
+ name: '@deepseek-ai/dsh-tool-executor-ptc'
155
+ - id: present
156
+ name: '@deepseek-ai/dsh-tool-present'
157
+ - id: tool-office
158
+ name: '@deepseek-ai/dsh-tool-office'
159
+ - id: tool-plugin-manager
160
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
161
+ disabled: true
162
+ - id: tool-plugin-market
163
+ name: '@deepseek-ai/dsh-plugin-market/tools'
164
+ disabled: true
165
+