@menghuan1918/dsh-apollo 0.4.1 → 0.5.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.
- package/README.md +135 -131
- package/cordis.patch.yml +75 -42
- package/docs/DEVELOPMENT.md +280 -468
- package/package.json +7 -4
- package/presets/eng/plugins/exit-guard/index.js +39 -51
- package/presets/eng/plugins/mode-instructions/index.js +23 -59
- package/presets/eng-ptc.patch.yml +5 -9
- package/presets/eng.patch.yml +29 -36
- package/src/client.js +63 -912
- package/src/config.js +31 -10
- package/src/index.js +13 -7
- package/src/migrate.js +602 -0
- package/src/owns-host.js +66 -0
- package/src/settings.js +39 -35
- package/presets/eng/plugins/wait-subagent/index.js +0 -233
- package/presets/eng/plugins/wait-subagent/package.json +0 -7
- package/src/cli/claude.js +0 -166
- package/src/cli/codex.js +0 -164
- package/src/cli/jsonl.js +0 -216
- package/src/cli-adapter.js +0 -198
- package/src/cli-sessions.js +0 -69
- package/src/panel.js +0 -844
- package/src/subagents.js +0 -198
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<h1 align="center">dsh-apollo</h1>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
DeepSeek Harness 的<strong>插件集合入口</strong>:流程技能 · 工程预设 ·
|
|
4
|
+
DeepSeek Harness 的<strong>插件集合入口</strong>:流程技能 · 工程预设 · 独立长期目标 · 子代理增强 · 压缩策略
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<a href="https://www.npmjs.com/package/@menghuan1918/dsh-apollo"><img src="https://img.shields.io/npm/v/%40menghuan1918%2Fdsh-apollo.svg" alt="npm 版本"></a>
|
|
9
9
|
<a href="LICENSE"><img alt="License" src="https://img.shields.io/github/license/Menghuan1918/dsh-apollo?color=blue"></a>
|
|
10
|
-
<a href="package.json"><img alt="Node ^22.19.0 || >=24.0.0" src="https://img.shields.io/badge/node-%5E22.19%20%7C%7C%20%3E%3D24-339933?logo=node.js&logoColor=white"></a>
|
|
10
|
+
<a href="package.json"><img alt="Node ^22.19.0 || >=24.0.0" src="https://img.shields.io/badge/node-%5E22.19.0%20%7C%7C%20%3E%3D24-339933?logo=node.js&logoColor=white"></a>
|
|
11
11
|
<a href="package.json"><img alt="DSH >=0.2.1-rc.2 <0.3.0" src="https://img.shields.io/badge/DSH-%3E%3D0.2.1--rc.2%20%3C0.3.0-4B32C3"></a>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
@@ -15,26 +15,33 @@
|
|
|
15
15
|
<a href="#这是什么">是什么</a> ·
|
|
16
16
|
<a href="#能力地图">能力地图</a> ·
|
|
17
17
|
<a href="#安装">安装</a> ·
|
|
18
|
-
<a href="
|
|
19
|
-
<a href="
|
|
20
|
-
<a href="
|
|
18
|
+
<a href="#从-04x-升级">升级</a> ·
|
|
19
|
+
<a href="#设置与行归属">设置</a> ·
|
|
20
|
+
<a href="#独立使用与组合安装">组合</a> ·
|
|
21
21
|
<a href="#faq">FAQ</a> ·
|
|
22
22
|
<a href="docs/DEVELOPMENT.md">开发文档</a>
|
|
23
23
|
</p>
|
|
24
24
|
|
|
25
25
|
## 这是什么
|
|
26
26
|
|
|
27
|
-
Apollo 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH
|
|
27
|
+
Apollo 是 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(DSH)的**插件集合入口**:安装一次,同时得到流程技能、两套工程预设,并把三个各自独立发布、可单独使用的插件装配进同一个 profile:
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
- **[`dsh-better-goal`](https://github.com/Menghuan1918/dsh-better-goal)**:长期目标、暂停与提问超时;
|
|
30
|
+
- **[`@menghuan1918/dsh-better-subagent`](https://github.com/Menghuan1918/dsh-better-subagent)**:Codex / Claude 可续接 CLI 子代理、`wait_subagent`、运行中子代理守卫、模型分档与子代理提示词;
|
|
31
|
+
- **[`dsh-better-compact`](https://github.com/Menghuan1918/dsh-better-compact)**:native / goal / file-handoff 三种压缩模式与只读诊断。
|
|
32
|
+
|
|
33
|
+
> **0.5.0 的所有权变化**:Apollo 不再实现 CLI 协议/路由、`wait_subagent`、能力探针、子代理设置页、模型分档/委派提示词或运行中子代理守卫。这些代码只在独立插件里保留一份;Apollo 只做**装配、通用工程纪律、后台任务退出守卫、旧配置迁移**。Apollo 也不再注册 `/apollo/api/*` —— 该前缀由 better-subagent 作为只读兼容别名拥有。
|
|
30
34
|
|
|
31
35
|
```mermaid
|
|
32
36
|
flowchart TB
|
|
33
37
|
A["dsh-apollo<br/>插件集合入口"]
|
|
34
38
|
A --> S["流程技能<br/>拆 Spec · 并行 · 审查"]
|
|
35
39
|
A --> E["工程模式<br/>eng / eng-ptc"]
|
|
36
|
-
A -->
|
|
37
|
-
A -.
|
|
40
|
+
A --> J["后台任务退出守卫<br/>Apollo 唯一运行时开关"]
|
|
41
|
+
A -. 精确依赖 + 相同稳定行 .-> G["dsh-better-goal"]
|
|
42
|
+
A -. 精确依赖 + 相同稳定行 .-> SA["better-subagent<br/>CLI 子代理 · wait · 分档"]
|
|
43
|
+
A -. 精确依赖 + 相同稳定行 .-> C["better-compact<br/>压缩模式与引擎"]
|
|
44
|
+
E -. 预设内 engine 行 .-> C
|
|
38
45
|
```
|
|
39
46
|
|
|
40
47
|
## 能力地图
|
|
@@ -42,9 +49,10 @@ flowchart TB
|
|
|
42
49
|
| 模块 | 入口 | 提供什么 |
|
|
43
50
|
|---|---|---|
|
|
44
51
|
| 流程技能 | 会话内用 `/技能名` 或按描述自动选用 | 把大任务拆成可验证的 Spec,按波次实现、审查、验证后合入 |
|
|
45
|
-
| 工程预设 | 预设选择器:`eng` / `eng-ptc` |
|
|
46
|
-
|
|
|
47
|
-
|
|
|
52
|
+
| 工程预设 | 预设选择器:`eng` / `eng-ptc` | 通用工程纪律、后台任务守卫、完整工作流;压缩用 better-compact 引擎 |
|
|
53
|
+
| 子代理增强 | **Plugins → better-subagent 行** | CLI 后台子代理、等待续接、运行中子代理守卫、模型分档 |
|
|
54
|
+
| 压缩 | **Plugins → dsh-better-compact 行** | native / goal / handoff、预算、摘要路由、只读诊断 |
|
|
55
|
+
| 长期目标 | **Plugins → dsh-better-goal 行** + `/goal` | 每个会话一个持久目标,可暂停、可恢复 |
|
|
48
56
|
|
|
49
57
|
### 流程技能
|
|
50
58
|
|
|
@@ -59,196 +67,192 @@ flowchart TB
|
|
|
59
67
|
| `/code-review` | 并行检查仓库标准与原始需求,并排报告 |
|
|
60
68
|
| `/handoff` | 把当前上下文整理为交接文档;仅由用户手动触发 |
|
|
61
69
|
|
|
62
|
-
|
|
70
|
+
技能需要在所选预设中挂载 DSH 的技能工具,两套工程预设已挂载。
|
|
63
71
|
|
|
64
72
|
### 工程预设
|
|
65
73
|
|
|
66
74
|
| 预设(ID) | 适合 | 关键差异 |
|
|
67
75
|
|---|---|---|
|
|
68
|
-
| 工程模式 — `eng` | 编码 / 基础设施任务 | 原生工具调用;保留 workflow
|
|
69
|
-
| 工程(PTC)模式 — `eng-ptc` | 多步、循环、需要过滤汇总的任务 | 工具经 `run_code` 的 TypeScript SDK
|
|
76
|
+
| 工程模式 — `eng` | 编码 / 基础设施任务 | 原生工具调用;保留 workflow 工具 |
|
|
77
|
+
| 工程(PTC)模式 — `eng-ptc` | 多步、循环、需要过滤汇总的任务 | 工具经 `run_code` 的 TypeScript SDK 调用;与官方 PTC 模式一致不提供 workflow |
|
|
70
78
|
|
|
71
|
-
|
|
79
|
+
两套预设共用 Apollo 的通用工程纪律(KISS、证据先行、修复根因、防过度设计与过度防御、权限与依赖边界、命令与进程纪律)。**委派规则与模型分档不在 Apollo**:由 better-subagent 在 `agent/created` 时按预设与活配置注册自己的 prompt section。完整组装结果见 [prompts/eng.md](prompts/eng.md) 与 [prompts/eng-ptc.md](prompts/eng-ptc.md)。
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
两套预设的压缩组里,原生 `compaction-basic` 被替换为 `dsh-better-compact/engine`(与独立 bundle 完全相同的稳定行),保留 `command-compact` 与 `tool-result-pruner`。工程模式不提供自动化任务工具;退出守卫默认关闭,只检查本会话仍运行的后台 job,不管理 pm2、systemd、nohup 等外部进程。
|
|
74
82
|
|
|
75
83
|
## 安装
|
|
76
84
|
|
|
77
|
-
需要 Node.js `^22.19.0 || >=24.0.0`,以及 DSH `>=0.2.1-rc.2 <0.3.0`。已验证基线是 DSH `0.2.1-rc.2
|
|
78
|
-
|
|
79
|
-
```mermaid
|
|
80
|
-
flowchart TB
|
|
81
|
-
A["安装 Apollo"] --> B["重启 DSH"]
|
|
82
|
-
B --> C["选择工程模式"]
|
|
83
|
-
C --> D["可选:设置 CLI"]
|
|
84
|
-
D --> E["开始任务"]
|
|
85
|
-
```
|
|
85
|
+
需要 Node.js `^22.19.0 || >=24.0.0`,以及 DSH `>=0.2.1-rc.2 <0.3.0`。已验证基线是 DSH `0.2.1-rc.2`。
|
|
86
86
|
|
|
87
87
|
```sh
|
|
88
|
-
# npm
|
|
89
|
-
dsh plugin --profile <profile> add @menghuan1918/dsh-apollo@0.
|
|
88
|
+
# npm 安装(发布后)
|
|
89
|
+
dsh plugin --profile <profile> add @menghuan1918/dsh-apollo@0.5.0
|
|
90
90
|
|
|
91
91
|
# 或从 GitHub main 源码安装(备选)
|
|
92
92
|
dsh plugin --profile <profile> add github:Menghuan1918/dsh-apollo
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
> **发布状态(诚实说明)**:Apollo `0.5.0` 把 `dsh-better-subagent@0.1.0` 与 `dsh-better-compact@0.1.0` 声明为**精确 npm 依赖**,但截至本实现完成,这两个版本尚未发布到 npm。Apollo 0.5.0 必须在两个子包发布并按顺序验证后再发布;本仓库的验证使用本地 tarball `npm install --no-save`,提交的 manifest 中**没有** `file:` / `link:` / Git 说明符。
|
|
96
|
+
|
|
97
|
+
安装、升级或换包都会改变运行的代码,必须重启对应 profile 的 DSH 进程;只刷新网页不够。目标行、子代理行与压缩行由 Apollo 的 bundle patch 插入,不需要再单独 `add` 三个子包。
|
|
96
98
|
|
|
97
|
-
>
|
|
99
|
+
> **不要重复添加**:已经显式选中 better-subagent / better-compact bundle 的 profile,再加 Apollo 会形成“双显式来源”。Loader 仍只激活一行,但 DSH 0.2.1-rc.2 会把同一 id 的配置写入拒绝为只读(见[独立使用与组合安装](#独立使用与组合安装))。只保留一个显式入口。
|
|
98
100
|
|
|
99
|
-
如果之前通过 GitHub 或 `link:` 安装了旧名 `dsh-apollo`,迁移到 scoped npm
|
|
101
|
+
如果之前通过 GitHub 或 `link:` 安装了旧名 `dsh-apollo`,迁移到 scoped npm 包时请手动处理,不要依赖自动迁移。会话记录会保留,但换包后仍须重启 profile:
|
|
100
102
|
|
|
101
103
|
```sh
|
|
102
104
|
dsh plugin --profile <profile> remove dsh-apollo
|
|
103
|
-
dsh plugin --profile <profile> add @menghuan1918/dsh-apollo@0.
|
|
105
|
+
dsh plugin --profile <profile> add @menghuan1918/dsh-apollo@0.5.0
|
|
104
106
|
```
|
|
105
107
|
|
|
106
108
|
> `dsh-apollo` 只是旧入口名;unscoped 的 `dsh-apollo` 已被其他项目占用,不要从 npm 安装它。
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
## 从 0.4.x 升级
|
|
109
111
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
你不需要记住工具名或调用格式:在会话里正常派发任务即可。需要时,Agent 会把子任务交给本机 Codex / Claude 后台执行,结果回到父会话;之后可以继续同一任务。
|
|
112
|
+
0.5.0 把子代理与压缩能力移出 Apollo。旧 profile 不需要手工重填配置:Apollo 启动后在 settings/loader 可用时运行一次**幂等迁移**([src/migrate.js](src/migrate.js))。
|
|
113
113
|
|
|
114
114
|
```mermaid
|
|
115
|
-
flowchart
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
flowchart LR
|
|
116
|
+
A["旧 Apollo 行<br/>tiers / subagents / trustedHosts / exitGuard"] --> B["启动后迁移"]
|
|
117
|
+
C["旧 eng / eng-ptc 预设里的<br/>原生 compaction-basic 显式配置"] --> B
|
|
118
|
+
B --> D["dsh-better-subagent<br/>缺失字段补齐"]
|
|
119
|
+
B --> E["dsh-better-compact<br/>缺失字段补齐"]
|
|
120
|
+
B --> F["Apollo exitGuard<br/>只留 job/通用守卫"]
|
|
121
121
|
```
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
规则:
|
|
124
124
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
- **目标行已有的显式用户值优先**;迁移只补缺失字段,不覆盖你在新设置页里改过的值。显式 `false` / `0` / `""` / `[]` 都是值。
|
|
126
|
+
- 旧 `exitGuard` 的初值同时复制到 better-subagent 的 `childExitGuard`;Apollo 自己的 `exitGuard` 继续作为后台 job/通用守卫开关,之后两者可独立配置。
|
|
127
|
+
- 旧原生 `compaction-basic` 的显式配置(`auto`、阈值、headroom、保留方式、摘要路由、输出上限、重试、`modelPolicies`)补进 better-compact;目标缺失的模式采用默认 `goal`。
|
|
128
|
+
- `trustedHosts` 是非 volatile 部署字段,经宿主 configEditor 写到目标行,不绕过字段限制。
|
|
129
|
+
- 迁移**不删除**旧配置、不复制 CLI 身份 KV、不复制 goal 状态;写入后重读验证,失败/目标行尚不可写时明确报告“待迁移/需重载”,不会假装成功。
|
|
130
|
+
- 旧 `apollo-skills` 行里的 `tiers` / `subagents` / `trustedHosts` 降级为 **deprecated、运行时无效**,只为装载旧 profile 与迁移保留;网页上不再把它们作为活跃子代理设置展示。
|
|
129
131
|
|
|
130
|
-
|
|
132
|
+
升级后:
|
|
131
133
|
|
|
132
|
-
|
|
134
|
+
1. 重启 profile(只刷新网页不算重载)。
|
|
135
|
+
2. 迁移写入的压缩设置需要**再重载一次**才会被运行中的引擎采用(引擎使用载入时冻结快照;设置页/inspect 会显示 `requiresReload`)。
|
|
136
|
+
3. 如果旧 profile 曾用网页编辑器保存过 `preset-eng` / `preset-eng-ptc` 的整份覆盖,那份覆盖会按 DSH 规则优先于新 bundle 的预设;其中如果还引用原生 `compaction-basic`,需要重新保存/清理该预设覆盖,才能用上新的 engine。
|
|
137
|
+
4. 如果旧预设行已经被手动删除,迁移会报告 `source-missing` 而不是假装保留:请按 [dsh-better-compact 的配置表](https://github.com/Menghuan1918/dsh-better-compact#configuration) 手工把旧值填进新的 compact 行,或恢复升级前的 `cordis.patch.yml` 备份。多个预设显式配置无法确定时迁移报告 `ambiguous`,不会猜。
|
|
133
138
|
|
|
134
|
-
|
|
135
|
-
|---|---|---|
|
|
136
|
-
| Codex | `codex debug models`(失败退回 `--bundled`) | 清单跟随 `config.toml` 的 model_provider;id 取 `slug`,effort 取 `supported_reasoning_levels`,默认 effort 取 `default_reasoning_level`,只收 `visibility: "list"` 的模型。 |
|
|
137
|
-
| Claude | `GET {ANTHROPIC_BASE_URL}/v1/models` | Claude CLI 没有模型清单命令;Apollo 读取与 CLI 相同的端点与凭据(进程 env,其次 `~/.claude/settings.json` 的 `env`)。凭据只在宿主进程内用于请求头,不会返回给页面。effort 固定为 `low` / `medium` / `high` / `xhigh` / `max`,默认 `high`。 |
|
|
138
|
-
|
|
139
|
-
> Codex 的 `profile` 不参与发现(`codex debug models` 不接受 `-p`);profile 若改了 model_provider,请手填该 profile 的模型。Claude 的 OAuth 订阅凭据存在系统钥匙串时不参与发现——请手填模型,或把 `ANTHROPIC_AUTH_TOKEN` / `ANTHROPIC_API_KEY` 放进进程 env 或 `~/.claude/settings.json` 的 `env`。
|
|
140
|
-
|
|
141
|
-
> **安全默认**
|
|
142
|
-
>
|
|
143
|
-
> - CLI 权限**不继承父会话**;默认 Codex 为 `read-only`,Claude 为 `plan`。
|
|
144
|
-
> - CLI 默认关闭;Apollo 不安装、不登录 CLI,请先在本机完成安装与登录。
|
|
145
|
-
> - 权限每轮读取最新设置;模型、effort、可执行文件和初始目录在创建时固定。
|
|
146
|
-
> - Codex 固定非交互审批,Claude 的权限提问自动拒绝;CLI 仍受宿主文件沙箱限制。
|
|
147
|
-
|
|
148
|
-
### 行为边界
|
|
139
|
+
## 设置与行归属
|
|
149
140
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
141
|
+
| 行 | 所属包 | 主要设置 | 生效 |
|
|
142
|
+
|---|---|---|---|
|
|
143
|
+
| `apollo-skills` | Apollo | `exitGuard`(**只**拦运行中后台 job) | volatile,保存即生效 |
|
|
144
|
+
| `dsh-better-subagent` | better-subagent | `childExitGuard`、`tiers.*`、两个 CLI 后端、`subagents.eng/global` | volatile,保存即生效 |
|
|
145
|
+
| `dsh-better-compact` | better-compact | 模式、auto、阈值/headroom/保留、摘要模型、重试、模型策略 | volatile 保存;**引擎快照需重载 profile** |
|
|
146
|
+
| `dsh-better-goal` | goal | 轮数策略、提问超时 | volatile,保存即生效 |
|
|
153
147
|
|
|
154
|
-
|
|
148
|
+
- Apollo 的最小行页只保留后台任务退出守卫与迁移说明。
|
|
149
|
+
- 子代理页、压缩页分别由两个独立包自己的浏览器半边注册;它们也注册 Apollo 集成槽别名(`@menghuan1918/dsh-apollo#<row>`、`dsh-apollo#<row>`),独立与集成共用同一份实现,不产生三份配置。
|
|
150
|
+
- 运行中子代理的拦截与 Apollo 的后台 job 守卫是**两个独立开关**;任意一个关闭都不影响原生工具。
|
|
151
|
+
- 原生 `subagent` / `subagent_fork` / `send_message` / `interrupt_agent` 注册表不变;better-subagent 只是在它上面加路由、等待工具与提示词,不拆第二套 registry。
|
|
155
152
|
|
|
156
|
-
|
|
153
|
+
### 什么时候需要重启
|
|
157
154
|
|
|
158
|
-
|
|
155
|
+
| 改动 | 生效方式 |
|
|
156
|
+
|---|---|
|
|
157
|
+
| Apollo `exitGuard`、子代理行、goal 行设置 | 保存后即时生效 |
|
|
158
|
+
| better-compact 设置 | 保存后写入 profile;重启 profile 后引擎采用新快照 |
|
|
159
|
+
| 安装 / 升级 / 移除 bundle、修改预设或顶层 patch | 重启对应 profile 的 DSH 进程 |
|
|
160
|
+
| 已有 CLI 子代理的模型 / effort / profile / 可执行文件 / 初始目录 | 创建时固定;改设置只影响新任务 |
|
|
161
|
+
| 已有 CLI 子代理的权限 | 每轮读取最新设置 |
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
- **固定值默认 `256`**,只在 `fixed` 模式生效。
|
|
162
|
-
- **提问超时默认 `120` 秒**,`-1` 表示永不超时;只影响之后新建的等待,超时不会被当作同意。
|
|
163
|
-
- **重开、恢复或 fork 会话**后,目标与计数恢复,但自动续跑停止;**Agent 可以自行恢复续跑**,人类也可以用 `/goal resume` 或 UI 继续——没有“必须人类先发言”或“只有 UI 才能恢复”的限制。用户中断会停止续跑。
|
|
164
|
-
- 完成前应逐项核对当前文件、命令和测试结果;失败可带具体原因停止。
|
|
163
|
+
## 独立使用与组合安装
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
两个新插件都不依赖 Apollo,也可以单独使用:
|
|
167
166
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
| `roundLimit` | `256` | 仅 `fixed` 模式使用的正整数上限 |
|
|
172
|
-
| `questionTimeoutSeconds` | `120` | 新提问等待秒数;`-1` 永不超时 |
|
|
167
|
+
```sh
|
|
168
|
+
# 只装子代理增强
|
|
169
|
+
dsh plugin --profile <profile> add @menghuan1918/dsh-better-subagent@0.1.0
|
|
173
170
|
|
|
174
|
-
|
|
171
|
+
# 只装压缩
|
|
172
|
+
dsh plugin --profile <profile> add dsh-better-compact@0.1.0
|
|
173
|
+
```
|
|
175
174
|
|
|
176
|
-
|
|
175
|
+
独立安装时的行、页面和提示词与 Apollo 集成完全相同;行 id/name 也是同一组稳定值。区别只在**由谁插入这些行**:Apollo 的 bundle patch 自己携带同样的行,因为 DSH 不会自动应用传递依赖的 bundle patch。
|
|
177
176
|
|
|
178
|
-
|
|
177
|
+
| 组合 | 结果 |
|
|
178
|
+
|---|---|
|
|
179
|
+
| 只有 Apollo | Apollo 插入 goal / subagent / compact companion+engine / 自己的行;工程预设内带 compact engine |
|
|
180
|
+
| 只有独立 bundle | 各自插入同样的行;没有 Apollo 的工程预设、技能或 job 守卫 |
|
|
181
|
+
| Apollo + 独立 bundle 同时显式选中 | Loader 仍按行 id 只激活**一行**实例,但 DSH 0.2.1-rc.2 会拒绝为同一 id 写入配置:行可读、开关/配置**只读**(见下) |
|
|
179
182
|
|
|
180
|
-
|
|
181
|
-
|---|---|---|
|
|
182
|
-
| `exitGuard` | `false` | 退出守卫;开启后在回合结束时拦下仍在运行的后台工作,用户中断始终放行 |
|
|
183
|
-
| `tiers.fast` / `tiers.quality` | 空(沿用父会话路由) | 子代理快速档(探索、侦察、批量排查)与质量档(复杂实现、调试、审查、设计)的 provider / model / effort;从「子代理 → 模型选择」白名单下拉选择,写进工程模式提示词 |
|
|
184
|
-
| `subagents.eng` | `true` | 在 `eng` / `eng-ptc` 中接入 CLI 后台任务 |
|
|
185
|
-
| `subagents.global` | `false` | 在所有具备所需工具和服务的预设中接入 |
|
|
186
|
-
| `codex.enabled` / `claude.enabled` | `false` | 启用对应 CLI 后端 |
|
|
187
|
-
| `executable` | `codex` / `claude` | PATH 命令名、绝对路径或 `~/` 路径 |
|
|
188
|
-
| `defaultModel` / `models` | 空 / `[]` | 启用前至少配置一个模型、默认模型和匹配的 effort;可用「自动发现模型」从本机 CLI 或 Anthropic 端点补齐 |
|
|
183
|
+
### 双显式 bundle 的只读限制(已在临时 profile 验证)
|
|
189
184
|
|
|
190
|
-
|
|
185
|
+
在 DSH `0.2.1-rc.2` 上,同一行 id 由两个显式 bundle 插入时:
|
|
191
186
|
|
|
192
|
-
|
|
187
|
+
- 运行实例仍然只有一个:`wait_subagent`、提示词 section、压缩引擎和工具都不会重复;
|
|
188
|
+
- 行配置**可以读**(设置页能看到值),但保存会被宿主拒绝(实测信息为 `Configuration for "<id>" is overridden by a home patch or command-line overlay`);
|
|
189
|
+
- 插件管理器里的“组合行不可寻址/只读”标记属于 Web 管理界面,当前 headless 冒烟没有点验该 UI 标签,只验证了实际写入限制。
|
|
193
190
|
|
|
194
|
-
|
|
191
|
+
恢复方法:**只保留一个显式入口**。例如移除独立 bundle 或移除 Apollo,然后重启 profile:
|
|
195
192
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
193
|
+
```sh
|
|
194
|
+
dsh plugin --profile <profile> remove dsh-better-subagent
|
|
195
|
+
dsh plugin --profile <profile> remove dsh-better-compact
|
|
196
|
+
# 或反过来移除 Apollo,仅保留独立包
|
|
197
|
+
```
|
|
200
198
|
|
|
201
|
-
|
|
199
|
+
不要为了“多一层保险”同时安装两套入口。
|
|
202
200
|
|
|
203
|
-
###
|
|
201
|
+
### 禁用、卸载与回退
|
|
204
202
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
| 已有 CLI 后台任务的权限 | 每轮读取最新设置 |
|
|
203
|
+
- 移除独立 bundle **不会**移除 Apollo 仍然装配的同一稳定行;反之亦然。文档必须按“有效 row 的来源”而不是 bundle 名判断。
|
|
204
|
+
- 彻底移除压缩增强:从 Apollo 组合中移除 Apollo,或把预设/组合改回原生压缩。**只禁用独立 compact bundle 不会恢复 Apollo 预设内的 engine 行**,因为该 engine 由 Apollo 自己的预设 patch 声明;需要移除 Apollo,或恢复一份使用原生 `compaction-basic` 的预设覆盖。
|
|
205
|
+
- 彻底移除子代理增强:移除 Apollo(或至少禁用其 `dsh-better-subagent` 行)。原生 create/fork/message/interrupt 仍可用;CLI-only 旧会话需要重新安装 better-subagent 才能续接,其它原生会话不受影响。
|
|
206
|
+
- 卸载不删除原生压缩事件、goal 日志或 CLI 身份 KV;handoff 临时文件不是必需依赖,删除后已压缩会话仍可从原生 checkpoint 恢复。
|
|
207
|
+
- 回退到 0.4.x 前先备份 profile 的 `cordis.patch.yml`;旧字段仍能装载,但 0.5.0 写入的新行配置不会被 0.4.x 读取。
|
|
211
208
|
|
|
212
|
-
##
|
|
209
|
+
## 提示词归属
|
|
213
210
|
|
|
214
|
-
|
|
211
|
+
运行时只有一份来源:
|
|
215
212
|
|
|
216
|
-
|
|
213
|
+
- **Apollo**(`eng-mode-instructions`):通用工程纪律 + `exitGuard` 开启时的 job-only 退出守卫说明;不含委派、分档、CLI 目录或 child guard。
|
|
214
|
+
- **better-subagent**(per-Agent sections):`better-subagent:delegation`(委派 + fast/quality 分档,`eng-ptc` 自行追加 PTC fan-out)、`better-subagent:child-guard`(`childExitGuard` 开启时)、`better-subagent:cli-subagents`(有启用后端时)。
|
|
215
|
+
- **better-compact**:不注册系统提示词段。
|
|
217
216
|
|
|
218
|
-
|
|
217
|
+
[prompts/eng.md](prompts/eng.md) / [prompts/eng-ptc.md](prompts/eng-ptc.md) 由真实 headless 宿主装配生成(`npm run prompts`),临时 profile 会复制三个独立包的真实发布文件,所以快照里的新插件段落来自它们自己的运行时实现,而不是 Apollo 的第二份副本。
|
|
219
218
|
|
|
220
|
-
|
|
219
|
+
## Specs 与发布包
|
|
221
220
|
|
|
222
|
-
|
|
221
|
+
本仓库的私有设计 Specs(`docs/specs/`)**不进入 Git 提交,也不进入 npm 包**:
|
|
223
222
|
|
|
224
|
-
|
|
223
|
+
- 它们由本仓库的 Git 私有排除规则忽略;
|
|
224
|
+
- `package.json` 的 `files` 只列入 `docs/DEVELOPMENT.md`,并额外用 [.npmignore](.npmignore) 排除 `docs/specs/`;
|
|
225
|
+
- `tests/packaging.test.mjs` 直接运行 `npm pack --dry-run --json`,断言发布清单没有 Specs、测试、脚本、快照或 tarball。
|
|
225
226
|
|
|
226
|
-
|
|
227
|
+
发布顺序:**先发布并验证两个独立包(`@menghuan1918/dsh-better-subagent@0.1.0`、`dsh-better-compact@0.1.0`),再发布 Apollo 0.5.0**。Apollo 的精确依赖指向尚不存在的版本时,`npm install` 会失败;不要用开发 `file:`/`link:` 依赖发布。两个子仓各自有 trusted publishing workflow;Apollo 的 [release workflow](.github/workflows/release.yml) 只发布本包。
|
|
227
228
|
|
|
228
|
-
|
|
229
|
+
## 验证状态(诚实记录)
|
|
229
230
|
|
|
230
|
-
|
|
231
|
+
在本实现提交时验证过(命令与结果见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)):
|
|
231
232
|
|
|
232
|
-
|
|
233
|
+
- `npm test`:配置/装配/漂移/迁移纯函数/settings/客户端/prompt/发布清单全部通过,含真实 temp-profile 迁移测试;
|
|
234
|
+
- `npm run prompts`:用发布布局复制 Apollo + 三个独立包,由真实 headless 宿主重新生成两份快照;
|
|
235
|
+
- `npm pack --dry-run --json`:发布清单无 Specs/tests/scripts/prompts/tarball;
|
|
236
|
+
- `node scripts/runtime-smoke.mjs apollo|standalone|both`:临时 profile + 脚本化 LLM 适配器(无凭据),覆盖单实例行、旧配置迁移、eng 回合、native subagent create/wait、手动 `/compact`、inspect、真实后台 job 退出守卫、保存→`requiresReload`→重启→`activeConfig`、独立组合与双显式 bundle 的只读限制。
|
|
233
237
|
|
|
234
|
-
|
|
238
|
+
**未验证 / 明确限制**:
|
|
235
239
|
|
|
236
|
-
|
|
240
|
+
- 两个子包的 `0.1.0` 尚未发布;本轮只用本地 tarball 验证,未验证 npm registry 安装路径。
|
|
241
|
+
- 未修改或重启用户当前运行的 profile,未验证当前 GUI(`http://127.0.0.1:3384`)的设置页/卡片;S3 视觉设置页的 GUI 验收归 S3/最终宿主验收。
|
|
242
|
+
- 未运行真实 Codex/Claude CLI 的真实模型回合(那属于两个子包自己的验证;Apollo 侧本轮只用脚本化适配器)。
|
|
243
|
+
- 真实模型摘要保真、缓存命中率与跨版本预设漂移仍需按实际环境复验。
|
|
237
244
|
|
|
238
|
-
|
|
245
|
+
## 开发
|
|
239
246
|
|
|
240
247
|
```sh
|
|
241
|
-
|
|
248
|
+
npm install
|
|
249
|
+
npm test
|
|
250
|
+
npm run prompts # 需要 DSH_PACKAGE_ROOT
|
|
251
|
+
npm run smoke -- apollo # 或 standalone / both / all,需要 DSH_PACKAGE_ROOT
|
|
242
252
|
```
|
|
243
253
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
</details>
|
|
247
|
-
|
|
248
|
-
## 开发文档
|
|
249
|
-
|
|
250
|
-
实现、配置、测试、冒烟和历史兼容细节见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
|
|
254
|
+
实现、迁移契约、测试细节与冒烟场景见 [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)。
|
|
251
255
|
|
|
252
256
|
## 许可与致谢
|
|
253
257
|
|
|
254
|
-
本包采用 **GPL-3.0-or-later**,见 [LICENSE](LICENSE)。工程预设改编自 DeepSeek Harness 的 MIT 标准预设与 PTC 预设([预设声明](presets/eng/NOTICE)、[MIT 许可](third-party/LICENSE-MIT-dsh-standard-preset));`tdd` / `diagnosing-bugs` 改编自 [mattpocock/skills](https://github.com/mattpocock/skills)([第三方声明](third-party/NOTICE-mattpocock-skills)
|
|
258
|
+
本包采用 **GPL-3.0-or-later**,见 [LICENSE](LICENSE)。工程预设改编自 DeepSeek Harness 的 MIT 标准预设与 PTC 预设([预设声明](presets/eng/NOTICE)、[MIT 许可](third-party/LICENSE-MIT-dsh-standard-preset));`tdd` / `diagnosing-bugs` 改编自 [mattpocock/skills](https://github.com/mattpocock/skills)([第三方声明](third-party/NOTICE-mattpocock-skills))。子代理与压缩实现分别在各自仓库保留版权与许可声明。
|
package/cordis.patch.yml
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
# dsh-apollo bundle patch: inserts the
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
#
|
|
5
|
-
# `dsh plugin --profile <name> add
|
|
1
|
+
# dsh-apollo bundle patch: inserts the host-plane rows this package needs into
|
|
2
|
+
# the profile roster. Applied as a profile bundle layer (the first entry of the
|
|
3
|
+
# `dsh.bundle.patch` array in package.json — the eng/eng-ptc preset patches in
|
|
4
|
+
# presets/ load after it); activate with
|
|
5
|
+
# `dsh plugin --profile <name> add @menghuan1918/dsh-apollo`.
|
|
6
|
+
#
|
|
7
|
+
# Apollo 0.5.0 is an integration bundle. The subagent and compaction features
|
|
8
|
+
# are owned by two independent plugins, and Apollo repeats their *same stable
|
|
9
|
+
# rows* here because DSH does not auto-apply a transitive dependency's bundle
|
|
10
|
+
# patch (`dsh plugin add` only selects directly installed bundles):
|
|
11
|
+
#
|
|
12
|
+
# - `@menghuan1918/dsh-better-subagent` owns the Codex/Claude CLI subagents,
|
|
13
|
+
# `wait_subagent`, the running-child exit guard, the subagent settings page
|
|
14
|
+
# and every subagent-specific prompt section;
|
|
15
|
+
# - `dsh-better-compact` (host companion) + `dsh-better-compact/engine`
|
|
16
|
+
# (engine row) own compaction; the native host-plane `compaction-basic` is
|
|
17
|
+
# disabled here exactly like the standalone bundle, and the eng/eng-ptc
|
|
18
|
+
# presets carry the engine row inside their own compaction realm;
|
|
19
|
+
# - `dsh-better-goal` keeps owning the goal domain.
|
|
20
|
+
#
|
|
21
|
+
# Selecting both the standalone bundle and Apollo still loads one instance: the
|
|
22
|
+
# Loader keys entries by row id. The same rule makes the double-explicit-bundle
|
|
23
|
+
# combination unaddressable in DSH 0.2.1-rc.2 (the config editor excludes
|
|
24
|
+
# duplicate ids), so prefer one explicit entry; see docs/DEVELOPMENT.md.
|
|
6
25
|
#
|
|
7
26
|
# ── goal domain: independent dsh-better-goal row ────────────────────────────
|
|
8
27
|
# The native goal service, round driver, /goal command, model-facing tool and
|
|
9
|
-
# GoalBar UI are disabled below and replaced by
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
# still loads one row: the Loader keys entries by row id.
|
|
13
|
-
#
|
|
14
|
-
# Apollo carries the lines itself because DSH does not auto-apply a transitive
|
|
15
|
-
# dependency's bundle patch — `dsh plugin add` only selects the directly
|
|
16
|
-
# installed bundle. Consequently, disabling or removing the standalone
|
|
17
|
-
# dsh-better-goal bundle does NOT disable this row; goal remains available
|
|
18
|
-
# through Apollo. Conversely, a profile that already selected the standalone
|
|
19
|
-
# bundle must not hand-write a third row.
|
|
28
|
+
# GoalBar UI are disabled below and replaced by dsh-better-goal's own stable
|
|
29
|
+
# row. Disabling or removing the standalone dsh-better-goal bundle does NOT
|
|
30
|
+
# disable this row; goal remains available through Apollo.
|
|
20
31
|
- id: goal
|
|
21
32
|
disabled: true
|
|
22
33
|
- id: goal-round-driver
|
|
@@ -32,6 +43,32 @@
|
|
|
32
43
|
- id: dsh-better-goal
|
|
33
44
|
name: dsh-better-goal
|
|
34
45
|
|
|
46
|
+
# ── compaction: independent dsh-better-compact rows ─────────────────────────
|
|
47
|
+
# Same stable rows/ids as the standalone bundle. `compaction-basic` is the
|
|
48
|
+
# native host-plane default; Web compositions already disable it and mount
|
|
49
|
+
# compaction inside each preset, while headless compositions keep this
|
|
50
|
+
# disabled row so exactly one compaction service exists. The host-plane engine
|
|
51
|
+
# detects a preset-owned engine and stays out of the way.
|
|
52
|
+
- id: compaction-basic
|
|
53
|
+
disabled: true
|
|
54
|
+
|
|
55
|
+
- insert:
|
|
56
|
+
- id: dsh-better-compact
|
|
57
|
+
name: dsh-better-compact
|
|
58
|
+
|
|
59
|
+
- id: dsh-better-compact-engine
|
|
60
|
+
name: dsh-better-compact/engine
|
|
61
|
+
|
|
62
|
+
# ── subagent enhancement: independent dsh-better-subagent row ───────────────
|
|
63
|
+
# One host-plane row owns the CLI adapters/routing bridge, the `wait_subagent`
|
|
64
|
+
# tool, the running-child exit guard, `/better-subagent/api/*` (+ the
|
|
65
|
+
# `/apollo/api/*` read aliases) and the subagent prompt sections. It does not
|
|
66
|
+
# replace the native subagent registry: create/fork/message/interrupt still
|
|
67
|
+
# come from the host tools.
|
|
68
|
+
- insert:
|
|
69
|
+
- id: dsh-better-subagent
|
|
70
|
+
name: '@menghuan1918/dsh-better-subagent'
|
|
71
|
+
|
|
35
72
|
# ── Apollo host row ─────────────────────────────────────────────────────────
|
|
36
73
|
# The apollo-skills row is one row on purpose. The row's module specifier must
|
|
37
74
|
# be this package's npm name (`@menghuan1918/dsh-apollo`), not a short alias,
|
|
@@ -42,37 +79,33 @@
|
|
|
42
79
|
# would resolve host code only if an alias existed, then silently lose the
|
|
43
80
|
# client half (the manifest name no longer matches). The page-side closure id
|
|
44
81
|
# is the manifest package name too. It rejects a second active row resolving to
|
|
45
|
-
# the same package name ("resolves from multiple active Loader sources").
|
|
46
|
-
# this one node half does every job:
|
|
82
|
+
# the same package name ("resolves from multiple active Loader sources").
|
|
47
83
|
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
# 2.
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
84
|
+
# Apollo 0.5.0 keeps only the responsibilities that were not migrated:
|
|
85
|
+
# 1. the packaged skills/ tree on the skill registry's global layer;
|
|
86
|
+
# 2. the formal row Config (src/config.js) with its minimal browser page —
|
|
87
|
+
# the background-job `exitGuard` switch and the `declareOwnsHost`
|
|
88
|
+
# deployment flag, plus deprecated load-only fields kept so old profiles
|
|
89
|
+
# load during migration;
|
|
90
|
+
# 3. the one-time legacy `exitGuard` import and the one-time old-config
|
|
91
|
+
# migration into dsh-better-subagent / dsh-better-compact (src/migrate.js);
|
|
92
|
+
# 4. the `declareOwnsHost` index tap.
|
|
93
|
+
# It no longer registers `/apollo/api/*` (dsh-better-subagent owns those read
|
|
94
|
+
# aliases) and no longer implements CLI protocols, subagent routing, the wait
|
|
95
|
+
# tool, tier/delegation prompt generation or the child exit guard.
|
|
59
96
|
#
|
|
60
|
-
# Row config — two classes of fields (details in README, section
|
|
61
|
-
# - volatile, editable from the Web form: `exitGuard
|
|
62
|
-
# `
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
# to call /apollo/api/* (loopback is always trusted);
|
|
69
|
-
# `declareOwnsHost: boolean` — the boot global above; off by default,
|
|
70
|
-
# enable only behind a trusted proxy.
|
|
97
|
+
# Row config — two classes of fields (details in README, section 设置与权限):
|
|
98
|
+
# - volatile, editable from the Web form: `exitGuard` (background jobs only)
|
|
99
|
+
# and the deprecated `tiers.*` / `subagents.*` / `exitGuard`-era fields that
|
|
100
|
+
# the migration reads; every deprecated field is inert at runtime;
|
|
101
|
+
# - deployment flags, hand-written here, never edited from the Web form:
|
|
102
|
+
# `trustedHosts` (deprecated, load-only; the new plugin owns its own
|
|
103
|
+
# `trustedHosts`), `declareOwnsHost` (the boot global above; off by
|
|
104
|
+
# default, enable only behind a trusted proxy).
|
|
71
105
|
#
|
|
72
106
|
# Presets are separate bundle-patch rows (presets/eng.patch.yml,
|
|
73
107
|
# presets/eng-ptc.patch.yml): a preset is an `insert` of a
|
|
74
|
-
# `@deepseek-ai/dsh-agent-preset` row read straight from that file
|
|
75
|
-
# sync-into-<dshHome>/.agent-presets delivery no longer exists.
|
|
108
|
+
# `@deepseek-ai/dsh-agent-preset` row read straight from that file.
|
|
76
109
|
- insert:
|
|
77
110
|
- id: apollo-skills
|
|
78
111
|
name: '@menghuan1918/dsh-apollo'
|