@menghuan1918/dsh-apollo 0.4.0 → 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 +281 -470
- package/package.json +8 -5
- 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/src/config.js
CHANGED
|
@@ -11,10 +11,18 @@
|
|
|
11
11
|
* - 普通字段(`trustedHosts`、`declareOwnsHost`)是**部署标志**:只在行配置里
|
|
12
12
|
* 声明,改动会让 Loader 正常重挂本行(重挂才需要重新读)。
|
|
13
13
|
*
|
|
14
|
+
* 0.5.0 的所有权边界:
|
|
15
|
+
* - **仍在运行时使用**:`exitGuard`(只控制运行中后台 job 的退出守卫)与
|
|
16
|
+
* `declareOwnsHost`(宿主部署标志)。最小行配置页只展示 `exitGuard`。
|
|
17
|
+
* - **deprecated、运行时不再读取**:`tiers.*`、`subagents.*`、`trustedHosts`。
|
|
18
|
+
* 它们只保留旧默认值,让 0.4.x 的 profile 能正常装载;`src/migrate.js`
|
|
19
|
+
* 在启动后把用户值一次性补进 dsh-better-subagent 的同名路径
|
|
20
|
+
* (`exitGuard` → `childExitGuard`),之后这些字段保持惰性,客户端也不把
|
|
21
|
+
* 它们当作可用的子代理设置。不要新增消费方。
|
|
22
|
+
*
|
|
14
23
|
* 可编辑范围(volatile,即 dsh-settings 投影出的行配置表单字段):
|
|
15
|
-
* `exitGuard
|
|
16
|
-
*
|
|
17
|
-
* 其他路径),所以部署标志不会从网页上被改写。
|
|
24
|
+
* `exitGuard`、以及 deprecated 的 `tiers.*` / `subagents.*`。表单写入只能落在
|
|
25
|
+
* volatile 路径上(dsh-settings 会拒绝其他路径),所以部署标志不会从网页上被改写。
|
|
18
26
|
*
|
|
19
27
|
* 持久化:DSH 的 configEditor 把表单写入落到活动 profile 的 cordis.patch.yml
|
|
20
28
|
* (本行 id 的 `config` 覆盖层),不再有 `<dshHome>/eng.json` 写入路径;旧文件
|
|
@@ -107,19 +115,28 @@ export const TIER_NAMES = Object.freeze(['fast', 'quality'])
|
|
|
107
115
|
/**
|
|
108
116
|
* 本插件行的正式配置 schema。
|
|
109
117
|
*
|
|
110
|
-
* `exitGuard
|
|
111
|
-
* (即时生效、不重挂);`trustedHosts
|
|
112
|
-
*
|
|
118
|
+
* `exitGuard` 与 deprecated 的 `subagents.{eng,global}`、`subagents.{codex,claude}`
|
|
119
|
+
* 标 volatile(即时生效、不重挂);`trustedHosts`(deprecated)与
|
|
120
|
+
* `declareOwnsHost` 是普通部署标志(改动重挂本行后生效)。
|
|
113
121
|
*/
|
|
114
122
|
export const Config = z.object({
|
|
115
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* 退出守卫总开关(默认关闭):只控制运行中**后台 job** 的拦截。
|
|
125
|
+
* 运行中子代理的拦截由 dsh-better-subagent 的 childExitGuard 拥有。
|
|
126
|
+
*/
|
|
116
127
|
exitGuard: z.boolean().default(false).volatile(),
|
|
117
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* @deprecated 0.5.0 起重命名为 dsh-better-subagent 的 `tiers.*`,本字段只供
|
|
130
|
+
* 迁移读取;运行时提示词不再从这里生成。保留旧默认值以装载旧 profile。
|
|
131
|
+
*/
|
|
118
132
|
tiers: z.object({
|
|
119
133
|
fast: TierSchema,
|
|
120
134
|
quality: TierSchema,
|
|
121
135
|
}),
|
|
122
|
-
/**
|
|
136
|
+
/**
|
|
137
|
+
* @deprecated 0.5.0 起由 dsh-better-subagent 拥有同名字段;这里只为旧 profile
|
|
138
|
+
* 装载与一次性迁移保留。运行时(CLI 路由、范围判断、提示词)不再读取。
|
|
139
|
+
*/
|
|
123
140
|
subagents: z.object({
|
|
124
141
|
/** 工程模式预设(`eng`/`eng-ptc`)可见这些后端。 */
|
|
125
142
|
eng: z.boolean().default(true).volatile(),
|
|
@@ -128,7 +145,11 @@ export const Config = z.object({
|
|
|
128
145
|
codex: backendSchema(BACKENDS.codex),
|
|
129
146
|
claude: backendSchema(BACKENDS.claude),
|
|
130
147
|
}),
|
|
131
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* @deprecated 0.5.0 起由 dsh-better-subagent 的 `trustedHosts` 拥有(只约束
|
|
150
|
+
* 该插件的只读接口);这里只为旧 profile 装载与迁移保留,Apollo 不再注册
|
|
151
|
+
* HTTP 路由,字段在运行时无效。
|
|
152
|
+
*/
|
|
132
153
|
trustedHosts: z.array(z.string()).default([]),
|
|
133
154
|
/** 注入 `__DSH_TRANSPORT__.ownsHost` 让官方 client 把反代页面当 loopback(默认关闭)。 */
|
|
134
155
|
declareOwnsHost: z.boolean().default(false),
|
package/src/index.js
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Apollo's single host row registers bundled skills,
|
|
3
|
-
* and the
|
|
4
|
-
*
|
|
2
|
+
* Apollo's single host row registers bundled skills, its own minimal row
|
|
3
|
+
* settings, and the one-time old-config migration into the independent
|
|
4
|
+
* dsh-better-subagent / dsh-better-compact rows. Presets are still delivered by
|
|
5
|
+
* bundle patches. Browser code remains a no-build closure factory.
|
|
6
|
+
*
|
|
7
|
+
* Apollo no longer implements subagent CLI protocols/routing, the wait tool,
|
|
8
|
+
* capability/model HTTP probes, tier/delegation prompt generation or the child
|
|
9
|
+
* exit guard — those are owned by the standalone plugins and only assembled
|
|
10
|
+
* here through the shared stable rows.
|
|
5
11
|
*/
|
|
6
12
|
|
|
7
13
|
import { readFile, readdir } from 'node:fs/promises'
|
|
8
14
|
import { dirname, join } from 'node:path'
|
|
9
15
|
import { fileURLToPath } from 'node:url'
|
|
16
|
+
import { mountMigration } from './migrate.js'
|
|
10
17
|
import { mountSettings } from './settings.js'
|
|
11
|
-
import { mountSubagents } from './subagents.js'
|
|
12
18
|
export { Config } from './config.js'
|
|
13
19
|
|
|
14
20
|
const PROVIDER_NAME = 'dsh-apollo'
|
|
@@ -23,12 +29,12 @@ export const name = 'apollo-skills'
|
|
|
23
29
|
/** Service required by the bundled skill provider. */
|
|
24
30
|
export const inject = ['skills']
|
|
25
31
|
|
|
26
|
-
/** Register the packaged skills provider and
|
|
32
|
+
/** Register the packaged skills provider, mount settings and old-config migration. */
|
|
27
33
|
export function apply(ctx, config) {
|
|
28
34
|
ctx.skills.registerProvider(() => createProvider(ctx))
|
|
29
35
|
if (typeof ctx.inject === 'function') {
|
|
30
|
-
mountSettings(ctx, config)
|
|
31
|
-
|
|
36
|
+
const settings = mountSettings(ctx, config)
|
|
37
|
+
mountMigration(ctx, config, { legacyImport: settings.legacyImport })
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
|