@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/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`、`tiers.fast`、`tiers.quality`、`subagents.eng`、`subagents.global`、
16
- * `subagents.codex.*`、`subagents.claude.*`。表单写入只能落在 volatile 路径上(dsh-settings 会拒绝
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`、`subagents.{eng,global}`、`subagents.{codex,claude}` 标 volatile
111
- * (即时生效、不重挂);`trustedHosts`、`declareOwnsHost` 是普通部署标志
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
- /** 子代理模型分档(工程模式提示词按此渲染;路由须在 allowedModels 白名单内)。 */
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
- /** 子代理 CLI 后端的接入范围与每后端配置。 */
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
- /** 允许调用本包 HTTP 路由的反向代理权威(host 或 host:port);默认只信 loopback。 */
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, profile-backed settings,
3
- * and the CLI adapters that extend existing subagent tools. Presets are still
4
- * delivered by bundle patches. Browser code remains a no-build closure factory.
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 mount the panel. */
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
- mountSubagents(ctx, config)
36
+ const settings = mountSettings(ctx, config)
37
+ mountMigration(ctx, config, { legacyImport: settings.legacyImport })
32
38
  }
33
39
  }
34
40