@aiwayds/dsh-model-sync 0.9.0 → 0.11.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.
Files changed (74) hide show
  1. package/README.md +20 -3
  2. package/README.zh-CN.md +20 -3
  3. package/lib/builtin-catalog-snapshot.js +6 -3
  4. package/lib/builtin-catalog-snapshot.js.map +1 -1
  5. package/lib/index.d.ts +379 -0
  6. package/lib/index.js +897 -13
  7. package/lib/index.js.map +1 -1
  8. package/lib/opencode-go-diagnose.d.ts +74 -0
  9. package/lib/opencode-go-diagnose.js +146 -0
  10. package/lib/opencode-go-diagnose.js.map +1 -0
  11. package/lib/opencode-go-grouping.d.ts +29 -0
  12. package/lib/opencode-go-grouping.js +77 -0
  13. package/lib/opencode-go-grouping.js.map +1 -0
  14. package/lib/opencode-go-journal.d.ts +110 -0
  15. package/lib/opencode-go-journal.js +406 -0
  16. package/lib/opencode-go-journal.js.map +1 -0
  17. package/lib/opencode-go-migrate.d.ts +343 -0
  18. package/lib/opencode-go-migrate.js +1300 -0
  19. package/lib/opencode-go-migrate.js.map +1 -0
  20. package/lib/opencode-go-migration.d.ts +227 -0
  21. package/lib/opencode-go-migration.js +384 -0
  22. package/lib/opencode-go-migration.js.map +1 -0
  23. package/lib/opencode-go-one-shot.d.ts +276 -0
  24. package/lib/opencode-go-one-shot.js +1094 -0
  25. package/lib/opencode-go-one-shot.js.map +1 -0
  26. package/lib/opencode-go-patch-file.d.ts +123 -0
  27. package/lib/opencode-go-patch-file.js +1185 -0
  28. package/lib/opencode-go-patch-file.js.map +1 -0
  29. package/lib/opencode-go-planner.d.ts +153 -0
  30. package/lib/opencode-go-planner.js +339 -0
  31. package/lib/opencode-go-planner.js.map +1 -0
  32. package/lib/opencode-go-profile.d.ts +57 -0
  33. package/lib/opencode-go-profile.js +103 -0
  34. package/lib/opencode-go-profile.js.map +1 -0
  35. package/lib/opencode-go-scheduler.d.ts +128 -0
  36. package/lib/opencode-go-scheduler.js +241 -0
  37. package/lib/opencode-go-scheduler.js.map +1 -0
  38. package/lib/opencode-go-source.d.ts +117 -0
  39. package/lib/opencode-go-source.js +331 -0
  40. package/lib/opencode-go-source.js.map +1 -0
  41. package/lib/opencode-go-store.d.ts +18 -0
  42. package/lib/opencode-go-store.js +68 -0
  43. package/lib/opencode-go-store.js.map +1 -0
  44. package/lib/opencode-go-sync.d.ts +94 -0
  45. package/lib/opencode-go-sync.js +364 -0
  46. package/lib/opencode-go-sync.js.map +1 -0
  47. package/lib/opencode-go-writer.d.ts +132 -0
  48. package/lib/opencode-go-writer.js +966 -0
  49. package/lib/opencode-go-writer.js.map +1 -0
  50. package/lib/provider-native.d.ts +3 -1
  51. package/lib/provider-native.js +4 -2
  52. package/lib/provider-native.js.map +1 -1
  53. package/lib/remote-catalog.d.ts +61 -0
  54. package/lib/remote-catalog.js +307 -3
  55. package/lib/remote-catalog.js.map +1 -1
  56. package/package.json +15 -15
  57. package/src/builtin-catalog-snapshot.ts +6 -3
  58. package/src/index.ts +1060 -12
  59. package/src/opencode-go-diagnose.ts +222 -0
  60. package/src/opencode-go-grouping.ts +97 -0
  61. package/src/opencode-go-journal.ts +458 -0
  62. package/src/opencode-go-migrate.ts +1694 -0
  63. package/src/opencode-go-migration.ts +552 -0
  64. package/src/opencode-go-one-shot.ts +1354 -0
  65. package/src/opencode-go-patch-file.ts +1168 -0
  66. package/src/opencode-go-planner.ts +505 -0
  67. package/src/opencode-go-profile.ts +114 -0
  68. package/src/opencode-go-scheduler.ts +315 -0
  69. package/src/opencode-go-source.ts +424 -0
  70. package/src/opencode-go-store.ts +73 -0
  71. package/src/opencode-go-sync.ts +503 -0
  72. package/src/opencode-go-writer.ts +1189 -0
  73. package/src/provider-native.ts +3 -1
  74. package/src/remote-catalog.ts +359 -3
package/README.md CHANGED
@@ -30,7 +30,9 @@ Model lists drift: providers ship new models, retire old ones, and adjust capabi
30
30
  - **Scheduled refresh.** `intervalMinutes` auto rounds (default 240 / 4h) plus a `startupDelaySeconds` initial delay (default 5); each round logs the same report a manual refresh produces. `0` disarms the interval (startup-only). The interval re-arms live when the config changes (`src/index.ts`).
31
31
  - **Change reporting / diff.** Every round reports added/removed model ids (`diffModelIds`), and in `settings` mode added/removed/changed entries against the current raw settings (`diffEntries`, `diff.ts`). Dropped and degraded entries are reported with their reasons.
32
32
  - **`modelSync` service.** Exposes a `modelSync` service (`syncNow()`) that a UI can call to force one refresh round and read the report.
33
- - **`/model-sync` command.** The plugin registers a `/model-sync` slash command itself through the shared dsh command registry (`@deepseek-ai/dsh-commands`), so every interactive UI lists it automatically — no UI-side wiring. Running it forces one sync round on the spot and prints the same report the scheduled rounds log; the sync scope is decided by `managedRoutes` (arguments are ignored). The registry is an optional peer: hosts without a command registry still get the scheduled rounds and the `modelSync` service.
33
+ - **`/model-sync` command.** The plugin registers a `/model-sync` slash command itself through the shared dsh command registry (`@deepseek-ai/dsh-commands`), so every interactive UI lists it automatically — no UI-side wiring. Running it forces one sync round on the spot and prints the same report the scheduled rounds log; the sync scope is decided by `managedRoutes` (arguments are ignored). The registry is an optional peer: hosts without a command registry still get the scheduled rounds and the `modelSync` service. Its subcommands are `go`/`status` (one full opencode-go round), `adopt go` (the same round with adoption), `migrate plan|apply|rollback|status` (the only writer gated by the explicit token triple; `plan` is read-only, `apply` requires a plan hash, a 6-digit confirm code and `--ack-managed`), and `migrate-go` (one-shot full migration: plan + file backups + one in-command confirmation + apply, per profile — see below). `eject` is retired — `migrate rollback` is the only rollback entry.
34
+ - **opencode-go sync (opt-in).** With `opencode.go.enabled: true`, three routes — `opencode-go` (chat-completions), `opencode-go-msg` (messages), `opencode-go-resp` (responses) — sync from the official public `/v1/models` listing instead of pi.dev. It is off by default, so existing handwritten opencode-go lists are frozen until you opt in. These go routes are separate from the default pi.dev `managedRoutes` above.
35
+ - **`/opencode-status` read-only diagnostic.** Compares the official opencode-go `/v1/models` listing with the current profile's routes (no writes, no settings mutation).
34
36
  - **Translation rules.** pi.dev entries are translated into settings-writable model profiles (`translate.ts`): base-matching vs base-less classification, `reasoningEfforts` derivation (S2 gate), `compat` gating to `openai-completions` (S5 gate), `maxTokens` handling, and drop logic for mixed-protocol routes. Capacity values get a sanity gate: a `contextWindow` that is not a positive integer, or a `maxTokens` that is not a positive integer strictly below the context window (listings sometimes echo the context window into `maxTokens`), is skipped with a degrade warning instead of written.
35
37
  - **Your overrides are durable.** `modelOverrides` is your own per-model channel (think levels, narrowed context windows). dsh refuses a models list beside non-empty overrides, so the sync folds your fields into the written models, clears the key in the same write, and re-applies the values from its store (`~/.dsh/models-store.json`) on every round — they keep winning over the synced values for as long as the route is managed.
36
38
  - **Safe-by-default options:**
@@ -82,6 +84,7 @@ Configure the plugin under the `dsh-model-sync` settings entry — on dsh 0.1.7+
82
84
  | `forceMaxReasoningEffort` | `false` | Force max reasoning effort on models with a non-empty `thinkingFormat` |
83
85
  | `providerNativeFetch` | `true` | Union each mapped provider's first-party `/models` listing into the pi.dev result (additions only) |
84
86
  | `keepDeprecatedBuiltin` | `false` | Opt back into emitting builtin ids the official default model list dropped (dsh 0.1.7 removed `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp`; dsh 0.2.0 removed `omen-alpha` on opencode-go and `glm-4.7` / `glm-5-turbo` / `glm-5.1` / `glm-5.2` / `glm-5.2-highspeed` / `glm-5v-turbo` on zai-coding-cn; the snapshot keeps the data but no longer syncs them by default) |
87
+ | `opencode.go.enabled` | `false` | Opt in to official-listing sync for the three `opencode-go*` routes; default off keeps existing handwritten opencode-go lists frozen (need sync → set `true` explicitly) |
85
88
 
86
89
  Example (settings section `dsh-model-sync`; a legacy `settings.yaml` `model-sync:` section is not auto-imported by the dsh 0.1.7 host itself — the plugin recovers it once at boot, see above):
87
90
 
@@ -112,9 +115,23 @@ providers:
112
115
 
113
116
  Note that listing data itself can be noisy: values are sanity-gated (positive integers; `maxTokens` strictly below `contextWindow`), and stripped values show up in the sync report as `DEGRADED` lines with reasons.
114
117
 
115
- ### Manual refresh: the `/model-sync` command
118
+ ### Manual refresh: `/model-sync` and `/opencode-status`
116
119
 
117
- Type `/model-sync` in any interactive UI to force one sync round on the spot. The plugin registers the command in the shared command registry (`@deepseek-ai/dsh-commands`), and UIs discover it automatically. It returns the same report the scheduled rounds log. The sync scope is decided by `managedRoutes`; any arguments typed after the command are ignored. Hosts without a command registry degrade gracefully — the scheduled rounds and the `modelSync` service keep working.
120
+ Type `/model-sync` in any interactive UI to force one sync round on the spot. The plugin registers the command in the shared command registry (`@deepseek-ai/dsh-commands`), and UIs discover it automatically. It returns the same report the scheduled rounds log. The sync scope is decided by `managedRoutes`; extra arguments to a bare `/model-sync` are ignored. Hosts without a command registry degrade gracefully — the scheduled rounds and the `modelSync` service keep working.
121
+
122
+ opencode-go adds subcommands: `/model-sync go` (or `status`) runs one full go round, `/model-sync adopt go` runs it with adoption, and `/model-sync migrate plan|apply|rollback|status` is the only writer gated by the explicit token triple — `plan` is read-only and `apply` requires a plan hash, a 6-digit confirm code and `--ack-managed`. `eject` is retired; use `migrate rollback` to revert. `/opencode-status` is a separate read-only diagnostic that compares the official listing with the current profile's routes; it never writes settings or credentials.
123
+
124
+ ### One-shot migration: `/model-sync migrate-go`
125
+
126
+ `/model-sync migrate-go` runs the full migration pipeline in one command, for the current profile by default or `--all-profiles` (every profile whose patch still carries a legacy opencode-go stub — a models-only section without `api`/`baseURL`):
127
+
128
+ ```bash
129
+ /model-sync migrate-go [--all-profiles] [--adopt] [--prune-user-extra] [--rewrite-refs=default-model|config]
130
+ ```
131
+
132
+ Fixed pipeline: plan (the same read-only builder `migrate plan` prints) → file backups BEFORE any write (`cordis.patch.yml.bak.<YYYYMMDD-HHMMSS>` per target profile plus one `models-store.json.bak.<same-stamp>`; 3 newest kept per category; created under an exclusive O_EXCL claim with an atomic tmp+rename write) → ONE interactive confirmation (via the host ask-user channel; its question names the legacy stubs, the per-id add/move/delete rows — every id deleted via `--adopt`/`--prune-user-extra` listed individually — the per-profile summary, the plan's managed-after notice quoted verbatim, the slots being created and the backup paths) → apply through the unchanged `migrate apply` consent gate (the hash/code are derived caller-side; there is no `--yes`/`--auto`). Right before apply every file is re-hashed and a file changed since its backup aborts that target (or the run for the shared store) with zero writes — rerun the command. Missing credential → fail-closed before any fetch, write, or backup. A missing or unanswered confirmation channel → fail-closed with the manual `migrate plan`/`apply` path and the computed hashes (config untouched; the already-created backups stay); an aborted invocation or an ambiguous answer (both labels selected) after the ask is treated as cancel — zero writes. Any apply failure stops the batch and restores every file the run changed — but only while its content still matches what this run last wrote there: a file a concurrent process touched is reported as `concurrent modification detected, not restored` with the backup path for manual handling instead of being overwritten (patch restores go through the atomic io the apply used; the models-store restore goes through the same cross-process lock accessor as every other store writer). On success `opencode.go.enabled` flips to `true` in the current profile and the detail log lands at `~/.dsh/storages/dsh-model-sync/migrate-go-<stamp>.log`. Rollback per profile: `/model-sync migrate rollback --plan <planHash>`.
133
+
134
+ Slots come from the resolved top-level `opencode.go.routes` config — no google slot is created unless the configuration (or an existing section) calls for one, and no other provider is ever touched. Design rationale, alternatives, and revocation path: [ADR 0001 — in-command single confirmation for migrate-go](docs/adr/0001-in-command-single-confirmation-for-migrate-go.md).
118
135
 
119
136
  ## Development
120
137
 
package/README.zh-CN.md CHANGED
@@ -30,7 +30,9 @@ https://github.com/user-attachments/assets/c3f9c8b1-ea5e-470c-b8a8-60a81fc5c20a
30
30
  - **定时刷新。** `intervalMinutes` 周期轮(默认 240,即 4 小时)加 `startupDelaySeconds` 启动延迟(默认 5 秒);每轮自动刷新输出的报告与手动刷新完全相同。`0` 表示关闭周期(仅启动时刷一次)。配置变更时周期会实时重新挂载(`src/index.ts`)。
31
31
  - **变更报告 / diff。** 每轮报告新增/移除的模型 id(`diffModelIds`);`settings` 模式下还会对照当前原始 settings 报告新增/移除/变更的条目(`diffEntries`,`diff.ts`)。被丢弃(dropped)与降级(degraded)的条目连同原因一并报告。
32
32
  - **`modelSync` 服务。** 对外暴露 `modelSync` 服务(`syncNow()`),UI 调用它即可强制跑一轮刷新并读取报告。
33
- - **`/model-sync` 命令。** 插件自行通过共享的 dsh 命令注册表(`@deepseek-ai/dsh-commands`)注册 `/model-sync` 斜杠命令,所有交互式 UI 自动发现并列出——UI 侧零配合。执行它当场强制跑一轮刷新,输出的报告与定时轮完全相同;同步范围由 `managedRoutes` 决定(参数会被忽略)。命令注册表是可选 peer:没有命令注册服务的宿主照常降级,定时刷新与 `modelSync` 服务不受影响。
33
+ - **`/model-sync` 命令。** 插件自行通过共享的 dsh 命令注册表(`@deepseek-ai/dsh-commands`)注册 `/model-sync` 斜杠命令,所有交互式 UI 自动发现并列出——UI 侧零配合。执行它当场强制跑一轮刷新,输出的报告与定时轮完全相同;同步范围由 `managedRoutes` 决定(裸命令后附带的额外参数会被忽略)。命令注册表是可选 peer:没有命令注册服务的宿主照常降级,定时刷新与 `modelSync` 服务不受影响。其子命令为 `go`/`status`(跑一整轮 opencode-go 同步)、`adopt go`(带采纳跑同一轮)、`migrate plan|apply|rollback|status`(唯一经显式令牌三重门把守的写入路径;`plan` 只读,`apply` 需要 plan hash、6 位确认码与 `--ack-managed`)以及 `migrate-go`(一键完成整段迁移:plan + 文件备份 + 一次命令内确认 + apply,见下文)。`eject` 已下线——回退只用 `migrate rollback`。
34
+ - **opencode-go 同步(需显式开启)。** 设 `opencode.go.enabled: true` 后,三条路由——`opencode-go`(chat-completions)、`opencode-go-msg`(messages)、`opencode-go-resp`(responses)——改为从官方公开 `/v1/models` 清单同步,而非 pi.dev。默认关闭,因此现存手写的 opencode-go 列表在开启前保持冻结。这三条 go 路由与上文的默认 pi.dev `managedRoutes` 相互独立。
35
+ - **`/opencode-status` 只读诊断。** 对照官方 opencode-go `/v1/models` 清单与当前 profile 的路由(零写入、不改 settings)。
34
36
  - **翻译规则。** pi.dev 条目被翻译成 settings 可写的模型 profile(`translate.ts`):base-matching 与 base-less 分类、`reasoningEfforts` 推导(S2 gate)、`compat` 门控到 `openai-completions`(S5 gate)、`maxTokens` 处理,以及混合协议路由的丢弃逻辑。容量值另有卫生门:非正整数的 `contextWindow`,或不是「严格小于 contextWindow 的正整数」的 `maxTokens`(有的列表会把 context window 回声填进 maxTokens),一律跳过不写,并在报告中以降级警告说明。
35
37
  - **你的覆盖不会被吃掉。** `modelOverrides` 是你自己的按模型调整通道(think level、收窄 context window 等)。dsh 拒绝 models 列表与非空 modelOverrides 并存,因此同步会把覆盖字段折叠进写入的 models、在同一次写入中清掉该键,并把原值存进 `~/.dsh/models-store.json` 逐轮回放——只要路由仍被托管,覆盖就持续压过同步值。
36
38
  - **默认安全的开关:**
@@ -82,6 +84,7 @@ dsh plugin remove @aiwayds/dsh-model-sync
82
84
  | `forceMaxReasoningEffort` | `false` | 对 `thinkingFormat` 非空的模型强制 max reasoning effort |
83
85
  | `providerNativeFetch` | `true` | 把各厂商自家的 `/models` 列表并入 pi.dev 结果(只增不减) |
84
86
  | `keepDeprecatedBuiltin` | `false` | 重新同步官方默认列表已移除的内置 id(dsh 0.1.7 移除了 `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp`;dsh 0.2.0 移除了 opencode-go 的 `omen-alpha` 与 zai-coding-cn 的 `glm-4.7` / `glm-5-turbo` / `glm-5.1` / `glm-5.2` / `glm-5.2-highspeed` / `glm-5v-turbo`;快照保留数据但默认不再同步) |
87
+ | `opencode.go.enabled` | `false` | 开启则对三条 `opencode-go*` 路由改用官方清单同步;默认关闭使现存手写 opencode-go 列表保持冻结(需要同步时显式设 `true`) |
85
88
 
86
89
  示例:
87
90
 
@@ -114,9 +117,23 @@ providers:
114
117
 
115
118
  另外列表数据本身可能有噪声:容量值有卫生门(正整数;`maxTokens` 必须严格小于 `contextWindow`),被剥离的值会在同步报告里以 `DEGRADED` 行连同原因出现。
116
119
 
117
- ### 手动刷新:`/model-sync` 命令
120
+ ### 手动刷新:`/model-sync` 与 `/opencode-status`
118
121
 
119
- 在任意交互式 UI 里输入 `/model-sync` 即可当场强制跑一轮同步。命令由插件自己注册进共享命令注册表(`@deepseek-ai/dsh-commands`),UI 自动发现。它返回与定时轮相同的报告;同步范围由 `managedRoutes` 决定,命令后面的参数一律忽略。没有命令注册服务的宿主会平滑降级——定时刷新与 `modelSync` 服务照常工作。
122
+ 在任意交互式 UI 里输入 `/model-sync` 即可当场强制跑一轮同步。命令由插件自己注册进共享命令注册表(`@deepseek-ai/dsh-commands`),UI 自动发现。它返回与定时轮相同的报告;同步范围由 `managedRoutes` 决定,裸命令后附带的额外参数会被忽略。没有命令注册服务的宿主会平滑降级——定时刷新与 `modelSync` 服务照常工作。
123
+
124
+ opencode-go 增加了子命令:`/model-sync go`(或 `status`)跑一整轮 go 同步,`/model-sync adopt go` 带采纳跑同一轮,`/model-sync migrate plan|apply|rollback|status` 是唯一经显式令牌三重门把守的写入路径——`plan` 只读,`apply` 需要 plan hash、6 位确认码与 `--ack-managed`。`eject` 已下线,回退请用 `migrate rollback`。`/opencode-status` 是另一条只读诊断命令,对照官方清单与当前 profile 路由,从不写入 settings 或凭据。
125
+
126
+ ### 一键迁移:`/model-sync migrate-go`
127
+
128
+ `/model-sync migrate-go` 一条命令跑完整段迁移流水线;默认只处理当前 profile,`--all-profiles` 处理全部 patch 里仍带 opencode-go 旧残桩(只有 `models`、无 `api`/`baseURL` 的段)的 profile:
129
+
130
+ ```bash
131
+ /model-sync migrate-go [--all-profiles] [--adopt] [--prune-user-extra] [--rewrite-refs=default-model|config]
132
+ ```
133
+
134
+ 固定流水线:生成计划(与 `migrate plan` 打印的同一只读构建)→ 写入前先做文件备份(每个目标 profile 一份 `cordis.patch.yml.bak.<YYYYMMDD-HHMMSS>`,全局一份 `models-store.json.bak.<同一时间戳>`;每类按文件名时间戳保留最新 3 份;备份以 O_EXCL 独占声明创建,经原子 tmp+rename 落盘)→ 仅弹一次交互确认(走宿主 ask-user 通道;题干列出将替换的旧残桩、逐 id 的增/移/删动作行——经 `--adopt`/`--prune-user-extra` 删除的每个 id 单独列出——每个 profile 的摘要、计划「迁移后转为托管」提示的原文(官方清单下架即自动移除)、将新建的槽位与备份路径)→ 经原封不动的 `migrate apply` 同意门执行(hash/确认码由调用侧算出;不存在 `--yes`/`--auto`)。apply 前一刻对所有文件全量重算 sha256,任一文件自备份后被改动即中止该目标(共享 store 则中止整轮),零写入——重跑命令即可。缺凭证 → 在任何外呼、写入、备份之前 fail-closed。确认通道缺失或未应答 → fail-closed,改走手动 `migrate plan`/`apply` 流程并给出已算出的 hash(配置零写入;已生成的备份保留);ask 之后用户中断(abort)或答案同时勾选两个选项(歧义)一律按取消处理——零写入。任一 apply 失败则中止整批并还原本轮改动的所有文件——但仅当文件内容仍与本轮最后写入的一致:被并发进程改过的文件按 `concurrent modification detected, not restored` 报告并给出备份路径,交由人工处理而不是被覆盖(patch 还原走 apply 同款的原子 io;models-store 还原走与其他 store 写入相同的跨进程锁访问器,绝不裸覆盖;本轮新建的 store 会在同一守卫下移除)。成功后当前 profile 的 `opencode.go.enabled` 置为 `true`,明细日志落在 `~/.dsh/storages/dsh-model-sync/migrate-go-<时间戳>.log`。逐 profile 回退:`/model-sync migrate rollback --plan <planHash>`。
135
+
136
+ 槽位来自顶层 `opencode.go.routes` 配置的解析结果——除非配置(或现存段)要求,不会创建 google 槽,也从不触碰其他 provider。设计取舍与撤销路径见 [ADR 0001:migrate-go 的命令内单次确认](docs/adr/0001-in-command-single-confirmation-for-migrate-go.md)。
120
137
 
121
138
  ## 开发
122
139
 
@@ -16,7 +16,6 @@ export const BUILTIN_CATALOG_SNAPSHOT = {
16
16
  { id: 'deepseek-v4.1-flash', api: 'openai-completions', maxTokens: 384000 },
17
17
  { id: 'gemini-4-argon', api: 'google-generative-ai', maxTokens: 65536 },
18
18
  { id: 'glm-5.1', api: 'openai-completions', maxTokens: 32768, deprecated: true },
19
- { id: 'glm-5.2', api: 'openai-completions', maxTokens: 131072 },
20
19
  { id: 'glm-5.3', api: 'openai-completions', maxTokens: 131072 },
21
20
  { id: 'glm-5.3-flash', api: 'openai-completions', maxTokens: 131072 },
22
21
  { id: 'gpt-5.6-luna', api: 'openai-responses', maxTokens: 128000 },
@@ -24,13 +23,16 @@ export const BUILTIN_CATALOG_SNAPSHOT = {
24
23
  { id: 'grok-4.6', api: 'openai-responses', maxTokens: 500000, deprecated: true },
25
24
  { id: 'grok-4.7', api: 'openai-responses', maxTokens: 500000 },
26
25
  { id: 'hy3', api: 'openai-completions', maxTokens: 128000 },
26
+ { id: 'hy4', api: 'openai-completions', maxTokens: 65536 },
27
+ { id: 'hy4-flash-free', api: 'openai-completions', maxTokens: 65536 },
27
28
  { id: 'hy4-preview', api: 'openai-completions', maxTokens: 64000 },
28
29
  { id: 'iceman-contributor-free', api: 'openai-completions', maxTokens: 131072 },
29
30
  { id: 'kimi-k2.6', api: 'openai-completions', maxTokens: 65536, deprecated: true },
30
31
  { id: 'kimi-k2.7-code', api: 'openai-completions', maxTokens: 262144 },
31
- { id: 'kimi-k3', api: 'openai-completions', maxTokens: 131072 },
32
- { id: 'kimi-k3.1-pro', api: 'openai-completions', maxTokens: 131072 },
32
+ { id: 'kimi-k3', api: 'openai-completions', maxTokens: 1048576 },
33
+ { id: 'kimi-k3.1-pro', api: 'openai-completions', maxTokens: 1048576 },
33
34
  { id: 'longcat-2.0', api: 'openai-completions', maxTokens: 131072 },
35
+ { id: 'longcat-2.5-free', api: 'openai-completions', maxTokens: 262144 },
34
36
  { id: 'mimo-v2.5', api: 'openai-completions', maxTokens: 128000 },
35
37
  { id: 'mimo-v2.5-pro', api: 'openai-completions', maxTokens: 128000 },
36
38
  { id: 'mimo-v2.6-flash', api: 'openai-completions', maxTokens: 131072 },
@@ -46,6 +48,7 @@ export const BUILTIN_CATALOG_SNAPSHOT = {
46
48
  { id: 'qwen3.7-plus', api: 'anthropic-messages', maxTokens: 65536 },
47
49
  { id: 'qwen3.8-flash', api: 'anthropic-messages', maxTokens: 131072 },
48
50
  { id: 'qwen3.8-max', api: 'anthropic-messages', maxTokens: 131072 },
51
+ { id: 'qwen4-max', api: 'anthropic-messages', maxTokens: 262144 },
49
52
  { id: 'step-5-preview', api: 'openai-completions', maxTokens: 65536 }
50
53
  ],
51
54
  'xiaomi-token-plan-cn': [
@@ -1 +1 @@
1
- {"version":3,"file":"builtin-catalog-snapshot.js","sourceRoot":"","sources":["../src/builtin-catalog-snapshot.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAsC7E,8CAA8C;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAA8B;IACjE,YAAY,EAAE;QACZ,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QACpE,EAAE,EAAE,EAAE,wBAAwB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QAC9E,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QAClE,EAAE,EAAE,EAAE,oBAAoB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;KAC3E;IACD,aAAa,EAAE;QACb,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QACjE,EAAE,EAAE,EAAE,kBAAkB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QACxE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;QAC3F,EAAE,EAAE,EAAE,8BAA8B,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;QACtG,EAAE,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QACvE,EAAE,EAAE,EAAE,qBAAqB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QAC3E,EAAE,E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,EAAE,SAAS,EAAE,MAAM,EAAE;QACzE,EAAE,EAAE,EAAE,cAAc,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;KACvF;CACF,CAAA"}
package/lib/index.d.ts CHANGED
@@ -18,9 +18,35 @@ import z from '@deepseek-ai/schemastery';
18
18
  import type { Context } from '@deepseek-ai/cordis';
19
19
  import { type RemoteCatalogEntry } from './remote-catalog.ts';
20
20
  import { type BuiltinModelData } from './translate.ts';
21
+ import { type RewriteRefMode } from './opencode-go-migrate.ts';
21
22
  export declare const name = "dsh-model-sync";
22
23
  /** The settings seam this plugin consumes (its own config namespace). */
23
24
  export declare const inject: string[];
25
+ /** P1d-2 seams: injected official entries (plan/apply) and optional reference writer. */
26
+ export declare const GO_MIGRATION_ENTRIES_SERVICE = "goMigrationEntries";
27
+ export declare const GO_MIGRATION_REF_WRITER_SERVICE = "goMigrationRefWriter";
28
+ /** Public (unauthenticated) official catalog ids for id classification (design §14.2).
29
+ * `undefined` ⇒ fail-closed `unclassified`. Tests inject an array/function. */
30
+ export declare const GO_MIGRATION_PUBLIC_CATALOG_SERVICE = "goMigrationPublicCatalog";
31
+ /** Capability flag: when true, `--adopt` is refused and plan mode is adopt-disabled. */
32
+ export declare const GO_MIGRATION_ADOPT_DISABLED_SERVICE = "goMigrationAdoptDisabled";
33
+ /** Optional override for the single-flight check (tests inject an in-flight mutex). */
34
+ export declare const GO_MIGRATION_MUTEX_SERVICE = "goMigrationMutex";
35
+ /** O1/C2 seam: injected write-ahead journal store (tests use a temp-dir store). */
36
+ export declare const GO_JOURNAL_STORE_SERVICE = "goJournalStore";
37
+ /**
38
+ * One-shot migrate-go path overrides (tests point everything at a temp dir;
39
+ * a host may pin non-default locations). Plain `undefined` fields fall back
40
+ * to resolveDshHome() / MODELS_STORE_PATH / `<home>/profiles`.
41
+ */
42
+ export declare const GO_ONESHOT_PATHS_SERVICE = "goOneShotPaths";
43
+ export interface GoOneShotPaths {
44
+ home?: string;
45
+ modelsStorePath?: string;
46
+ profilesDir?: string;
47
+ /** TEST FAULT INJECTION ONLY: see OneShotDeps.faultOwnershipWriteOnKeyPrefix. */
48
+ testOnlyOwnershipWriteFaultPrefix?: string;
49
+ }
24
50
  /**
25
51
  * The plugin's `Config` schema: the settings form the 0.1.7 host projects from
26
52
  * the `dsh-model-sync` entry. Every field is user-adjustable and therefore
@@ -73,6 +99,165 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
73
99
  * a re-emitted retired id is a model the 0.1.7 host no longer resolves.
74
100
  */
75
101
  keepDeprecatedBuiltin: z<boolean, boolean, "volatile-defined">;
102
+ /**
103
+ * OpenCode Go / Zen configuration contract (design §6.2.6). Published in one
104
+ * Config schema in P1: read-only subset (go.enabled/ref/modelsUrl/
105
+ * intervalMinutes, zen.enabled/ref/mode/modelsUrl) plus the write-side subset
106
+ * (go.routes/adoptExisting/pinnedModels/confirmRemovals,
107
+ * zen.routes/seedFromBuiltin). Defaults are byte-for-byte the P0 constants —
108
+ * `modelsUrl` and `ref` are imported from the P0 modules so a P0→P1 drift is
109
+ * impossible. Zen stays login-only with no modelsUrl by default (design A5).
110
+ * Nested leaves are `.volatile()` (host settings can edit them); the parent
111
+ * objects are not, because schemastery forbids a volatile field under an
112
+ * enclosing volatile field.
113
+ */
114
+ opencode: z<Schemastery.ObjectS<NoInfer<{
115
+ go: z<Schemastery.ObjectS<NoInfer<{
116
+ enabled: z<boolean, boolean, "volatile-defined">;
117
+ ref: z<string, string, "volatile-defined">;
118
+ modelsUrl: z<string, string, "volatile-defined">;
119
+ intervalMinutes: z<number, number, "volatile-defined">;
120
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
121
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
122
+ routes: z<Schemastery.ObjectS<NoInfer<{
123
+ chat: z<string, string, "volatile-defined">;
124
+ msg: z<string, string, "volatile-defined">;
125
+ resp: z<string, string, "volatile-defined">;
126
+ google: z<string, string, "volatile-defined">;
127
+ }>>, Schemastery.ObjectT<NoInfer<{
128
+ chat: z<string, string, "volatile-defined">;
129
+ msg: z<string, string, "volatile-defined">;
130
+ resp: z<string, string, "volatile-defined">;
131
+ google: z<string, string, "volatile-defined">;
132
+ }>>, "defined">;
133
+ confirmRemovals: z<number, number, "volatile-defined">;
134
+ }>>, Schemastery.ObjectT<NoInfer<{
135
+ enabled: z<boolean, boolean, "volatile-defined">;
136
+ ref: z<string, string, "volatile-defined">;
137
+ modelsUrl: z<string, string, "volatile-defined">;
138
+ intervalMinutes: z<number, number, "volatile-defined">;
139
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
140
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
141
+ routes: z<Schemastery.ObjectS<NoInfer<{
142
+ chat: z<string, string, "volatile-defined">;
143
+ msg: z<string, string, "volatile-defined">;
144
+ resp: z<string, string, "volatile-defined">;
145
+ google: z<string, string, "volatile-defined">;
146
+ }>>, Schemastery.ObjectT<NoInfer<{
147
+ chat: z<string, string, "volatile-defined">;
148
+ msg: z<string, string, "volatile-defined">;
149
+ resp: z<string, string, "volatile-defined">;
150
+ google: z<string, string, "volatile-defined">;
151
+ }>>, "defined">;
152
+ confirmRemovals: z<number, number, "volatile-defined">;
153
+ }>>, "defined">;
154
+ zen: z<Schemastery.ObjectS<NoInfer<{
155
+ enabled: z<boolean, boolean, "volatile-defined">;
156
+ ref: z<string, string, "volatile-defined">;
157
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
158
+ /** No proven listing endpoint; without it routes mode is unsupported. */
159
+ modelsUrl: z<string, string, "volatile">;
160
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
161
+ routes: z<Schemastery.ObjectS<NoInfer<{
162
+ chat: z<string, string, "volatile-defined">;
163
+ msg: z<string, string, "volatile-defined">;
164
+ resp: z<string, string, "volatile-defined">;
165
+ }>>, Schemastery.ObjectT<NoInfer<{
166
+ chat: z<string, string, "volatile-defined">;
167
+ msg: z<string, string, "volatile-defined">;
168
+ resp: z<string, string, "volatile-defined">;
169
+ }>>, "defined">;
170
+ }>>, Schemastery.ObjectT<NoInfer<{
171
+ enabled: z<boolean, boolean, "volatile-defined">;
172
+ ref: z<string, string, "volatile-defined">;
173
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
174
+ /** No proven listing endpoint; without it routes mode is unsupported. */
175
+ modelsUrl: z<string, string, "volatile">;
176
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
177
+ routes: z<Schemastery.ObjectS<NoInfer<{
178
+ chat: z<string, string, "volatile-defined">;
179
+ msg: z<string, string, "volatile-defined">;
180
+ resp: z<string, string, "volatile-defined">;
181
+ }>>, Schemastery.ObjectT<NoInfer<{
182
+ chat: z<string, string, "volatile-defined">;
183
+ msg: z<string, string, "volatile-defined">;
184
+ resp: z<string, string, "volatile-defined">;
185
+ }>>, "defined">;
186
+ }>>, "defined">;
187
+ }>>, Schemastery.ObjectT<NoInfer<{
188
+ go: z<Schemastery.ObjectS<NoInfer<{
189
+ enabled: z<boolean, boolean, "volatile-defined">;
190
+ ref: z<string, string, "volatile-defined">;
191
+ modelsUrl: z<string, string, "volatile-defined">;
192
+ intervalMinutes: z<number, number, "volatile-defined">;
193
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
194
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
195
+ routes: z<Schemastery.ObjectS<NoInfer<{
196
+ chat: z<string, string, "volatile-defined">;
197
+ msg: z<string, string, "volatile-defined">;
198
+ resp: z<string, string, "volatile-defined">;
199
+ google: z<string, string, "volatile-defined">;
200
+ }>>, Schemastery.ObjectT<NoInfer<{
201
+ chat: z<string, string, "volatile-defined">;
202
+ msg: z<string, string, "volatile-defined">;
203
+ resp: z<string, string, "volatile-defined">;
204
+ google: z<string, string, "volatile-defined">;
205
+ }>>, "defined">;
206
+ confirmRemovals: z<number, number, "volatile-defined">;
207
+ }>>, Schemastery.ObjectT<NoInfer<{
208
+ enabled: z<boolean, boolean, "volatile-defined">;
209
+ ref: z<string, string, "volatile-defined">;
210
+ modelsUrl: z<string, string, "volatile-defined">;
211
+ intervalMinutes: z<number, number, "volatile-defined">;
212
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
213
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
214
+ routes: z<Schemastery.ObjectS<NoInfer<{
215
+ chat: z<string, string, "volatile-defined">;
216
+ msg: z<string, string, "volatile-defined">;
217
+ resp: z<string, string, "volatile-defined">;
218
+ google: z<string, string, "volatile-defined">;
219
+ }>>, Schemastery.ObjectT<NoInfer<{
220
+ chat: z<string, string, "volatile-defined">;
221
+ msg: z<string, string, "volatile-defined">;
222
+ resp: z<string, string, "volatile-defined">;
223
+ google: z<string, string, "volatile-defined">;
224
+ }>>, "defined">;
225
+ confirmRemovals: z<number, number, "volatile-defined">;
226
+ }>>, "defined">;
227
+ zen: z<Schemastery.ObjectS<NoInfer<{
228
+ enabled: z<boolean, boolean, "volatile-defined">;
229
+ ref: z<string, string, "volatile-defined">;
230
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
231
+ /** No proven listing endpoint; without it routes mode is unsupported. */
232
+ modelsUrl: z<string, string, "volatile">;
233
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
234
+ routes: z<Schemastery.ObjectS<NoInfer<{
235
+ chat: z<string, string, "volatile-defined">;
236
+ msg: z<string, string, "volatile-defined">;
237
+ resp: z<string, string, "volatile-defined">;
238
+ }>>, Schemastery.ObjectT<NoInfer<{
239
+ chat: z<string, string, "volatile-defined">;
240
+ msg: z<string, string, "volatile-defined">;
241
+ resp: z<string, string, "volatile-defined">;
242
+ }>>, "defined">;
243
+ }>>, Schemastery.ObjectT<NoInfer<{
244
+ enabled: z<boolean, boolean, "volatile-defined">;
245
+ ref: z<string, string, "volatile-defined">;
246
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
247
+ /** No proven listing endpoint; without it routes mode is unsupported. */
248
+ modelsUrl: z<string, string, "volatile">;
249
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
250
+ routes: z<Schemastery.ObjectS<NoInfer<{
251
+ chat: z<string, string, "volatile-defined">;
252
+ msg: z<string, string, "volatile-defined">;
253
+ resp: z<string, string, "volatile-defined">;
254
+ }>>, Schemastery.ObjectT<NoInfer<{
255
+ chat: z<string, string, "volatile-defined">;
256
+ msg: z<string, string, "volatile-defined">;
257
+ resp: z<string, string, "volatile-defined">;
258
+ }>>, "defined">;
259
+ }>>, "defined">;
260
+ }>>, "defined">;
76
261
  }>>, Schemastery.ObjectT<NoInfer<{
77
262
  /**
78
263
  * Write mode: 'settings' (default, zero-patch settings.mutate pipeline) or
@@ -117,6 +302,165 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
117
302
  * a re-emitted retired id is a model the 0.1.7 host no longer resolves.
118
303
  */
119
304
  keepDeprecatedBuiltin: z<boolean, boolean, "volatile-defined">;
305
+ /**
306
+ * OpenCode Go / Zen configuration contract (design §6.2.6). Published in one
307
+ * Config schema in P1: read-only subset (go.enabled/ref/modelsUrl/
308
+ * intervalMinutes, zen.enabled/ref/mode/modelsUrl) plus the write-side subset
309
+ * (go.routes/adoptExisting/pinnedModels/confirmRemovals,
310
+ * zen.routes/seedFromBuiltin). Defaults are byte-for-byte the P0 constants —
311
+ * `modelsUrl` and `ref` are imported from the P0 modules so a P0→P1 drift is
312
+ * impossible. Zen stays login-only with no modelsUrl by default (design A5).
313
+ * Nested leaves are `.volatile()` (host settings can edit them); the parent
314
+ * objects are not, because schemastery forbids a volatile field under an
315
+ * enclosing volatile field.
316
+ */
317
+ opencode: z<Schemastery.ObjectS<NoInfer<{
318
+ go: z<Schemastery.ObjectS<NoInfer<{
319
+ enabled: z<boolean, boolean, "volatile-defined">;
320
+ ref: z<string, string, "volatile-defined">;
321
+ modelsUrl: z<string, string, "volatile-defined">;
322
+ intervalMinutes: z<number, number, "volatile-defined">;
323
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
324
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
325
+ routes: z<Schemastery.ObjectS<NoInfer<{
326
+ chat: z<string, string, "volatile-defined">;
327
+ msg: z<string, string, "volatile-defined">;
328
+ resp: z<string, string, "volatile-defined">;
329
+ google: z<string, string, "volatile-defined">;
330
+ }>>, Schemastery.ObjectT<NoInfer<{
331
+ chat: z<string, string, "volatile-defined">;
332
+ msg: z<string, string, "volatile-defined">;
333
+ resp: z<string, string, "volatile-defined">;
334
+ google: z<string, string, "volatile-defined">;
335
+ }>>, "defined">;
336
+ confirmRemovals: z<number, number, "volatile-defined">;
337
+ }>>, Schemastery.ObjectT<NoInfer<{
338
+ enabled: z<boolean, boolean, "volatile-defined">;
339
+ ref: z<string, string, "volatile-defined">;
340
+ modelsUrl: z<string, string, "volatile-defined">;
341
+ intervalMinutes: z<number, number, "volatile-defined">;
342
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
343
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
344
+ routes: z<Schemastery.ObjectS<NoInfer<{
345
+ chat: z<string, string, "volatile-defined">;
346
+ msg: z<string, string, "volatile-defined">;
347
+ resp: z<string, string, "volatile-defined">;
348
+ google: z<string, string, "volatile-defined">;
349
+ }>>, Schemastery.ObjectT<NoInfer<{
350
+ chat: z<string, string, "volatile-defined">;
351
+ msg: z<string, string, "volatile-defined">;
352
+ resp: z<string, string, "volatile-defined">;
353
+ google: z<string, string, "volatile-defined">;
354
+ }>>, "defined">;
355
+ confirmRemovals: z<number, number, "volatile-defined">;
356
+ }>>, "defined">;
357
+ zen: z<Schemastery.ObjectS<NoInfer<{
358
+ enabled: z<boolean, boolean, "volatile-defined">;
359
+ ref: z<string, string, "volatile-defined">;
360
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
361
+ /** No proven listing endpoint; without it routes mode is unsupported. */
362
+ modelsUrl: z<string, string, "volatile">;
363
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
364
+ routes: z<Schemastery.ObjectS<NoInfer<{
365
+ chat: z<string, string, "volatile-defined">;
366
+ msg: z<string, string, "volatile-defined">;
367
+ resp: z<string, string, "volatile-defined">;
368
+ }>>, Schemastery.ObjectT<NoInfer<{
369
+ chat: z<string, string, "volatile-defined">;
370
+ msg: z<string, string, "volatile-defined">;
371
+ resp: z<string, string, "volatile-defined">;
372
+ }>>, "defined">;
373
+ }>>, Schemastery.ObjectT<NoInfer<{
374
+ enabled: z<boolean, boolean, "volatile-defined">;
375
+ ref: z<string, string, "volatile-defined">;
376
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
377
+ /** No proven listing endpoint; without it routes mode is unsupported. */
378
+ modelsUrl: z<string, string, "volatile">;
379
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
380
+ routes: z<Schemastery.ObjectS<NoInfer<{
381
+ chat: z<string, string, "volatile-defined">;
382
+ msg: z<string, string, "volatile-defined">;
383
+ resp: z<string, string, "volatile-defined">;
384
+ }>>, Schemastery.ObjectT<NoInfer<{
385
+ chat: z<string, string, "volatile-defined">;
386
+ msg: z<string, string, "volatile-defined">;
387
+ resp: z<string, string, "volatile-defined">;
388
+ }>>, "defined">;
389
+ }>>, "defined">;
390
+ }>>, Schemastery.ObjectT<NoInfer<{
391
+ go: z<Schemastery.ObjectS<NoInfer<{
392
+ enabled: z<boolean, boolean, "volatile-defined">;
393
+ ref: z<string, string, "volatile-defined">;
394
+ modelsUrl: z<string, string, "volatile-defined">;
395
+ intervalMinutes: z<number, number, "volatile-defined">;
396
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
397
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
398
+ routes: z<Schemastery.ObjectS<NoInfer<{
399
+ chat: z<string, string, "volatile-defined">;
400
+ msg: z<string, string, "volatile-defined">;
401
+ resp: z<string, string, "volatile-defined">;
402
+ google: z<string, string, "volatile-defined">;
403
+ }>>, Schemastery.ObjectT<NoInfer<{
404
+ chat: z<string, string, "volatile-defined">;
405
+ msg: z<string, string, "volatile-defined">;
406
+ resp: z<string, string, "volatile-defined">;
407
+ google: z<string, string, "volatile-defined">;
408
+ }>>, "defined">;
409
+ confirmRemovals: z<number, number, "volatile-defined">;
410
+ }>>, Schemastery.ObjectT<NoInfer<{
411
+ enabled: z<boolean, boolean, "volatile-defined">;
412
+ ref: z<string, string, "volatile-defined">;
413
+ modelsUrl: z<string, string, "volatile-defined">;
414
+ intervalMinutes: z<number, number, "volatile-defined">;
415
+ adoptExisting: z<boolean, boolean, "volatile-defined">;
416
+ pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
417
+ routes: z<Schemastery.ObjectS<NoInfer<{
418
+ chat: z<string, string, "volatile-defined">;
419
+ msg: z<string, string, "volatile-defined">;
420
+ resp: z<string, string, "volatile-defined">;
421
+ google: z<string, string, "volatile-defined">;
422
+ }>>, Schemastery.ObjectT<NoInfer<{
423
+ chat: z<string, string, "volatile-defined">;
424
+ msg: z<string, string, "volatile-defined">;
425
+ resp: z<string, string, "volatile-defined">;
426
+ google: z<string, string, "volatile-defined">;
427
+ }>>, "defined">;
428
+ confirmRemovals: z<number, number, "volatile-defined">;
429
+ }>>, "defined">;
430
+ zen: z<Schemastery.ObjectS<NoInfer<{
431
+ enabled: z<boolean, boolean, "volatile-defined">;
432
+ ref: z<string, string, "volatile-defined">;
433
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
434
+ /** No proven listing endpoint; without it routes mode is unsupported. */
435
+ modelsUrl: z<string, string, "volatile">;
436
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
437
+ routes: z<Schemastery.ObjectS<NoInfer<{
438
+ chat: z<string, string, "volatile-defined">;
439
+ msg: z<string, string, "volatile-defined">;
440
+ resp: z<string, string, "volatile-defined">;
441
+ }>>, Schemastery.ObjectT<NoInfer<{
442
+ chat: z<string, string, "volatile-defined">;
443
+ msg: z<string, string, "volatile-defined">;
444
+ resp: z<string, string, "volatile-defined">;
445
+ }>>, "defined">;
446
+ }>>, Schemastery.ObjectT<NoInfer<{
447
+ enabled: z<boolean, boolean, "volatile-defined">;
448
+ ref: z<string, string, "volatile-defined">;
449
+ mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
450
+ /** No proven listing endpoint; without it routes mode is unsupported. */
451
+ modelsUrl: z<string, string, "volatile">;
452
+ seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
453
+ routes: z<Schemastery.ObjectS<NoInfer<{
454
+ chat: z<string, string, "volatile-defined">;
455
+ msg: z<string, string, "volatile-defined">;
456
+ resp: z<string, string, "volatile-defined">;
457
+ }>>, Schemastery.ObjectT<NoInfer<{
458
+ chat: z<string, string, "volatile-defined">;
459
+ msg: z<string, string, "volatile-defined">;
460
+ resp: z<string, string, "volatile-defined">;
461
+ }>>, "defined">;
462
+ }>>, "defined">;
463
+ }>>, "defined">;
120
464
  }>>, "plain">;
121
465
  /**
122
466
  * A stable configuration reference — the protocol the 0.1.7 host hands the
@@ -141,10 +485,45 @@ interface ModelSyncConfigValue {
141
485
  forceMaxReasoningEffort: VolatileRef<boolean>;
142
486
  providerNativeFetch: VolatileRef<boolean>;
143
487
  keepDeprecatedBuiltin: VolatileRef<boolean>;
488
+ opencode: {
489
+ go: {
490
+ enabled: VolatileRef<boolean>;
491
+ ref: VolatileRef<string>;
492
+ modelsUrl: VolatileRef<string>;
493
+ intervalMinutes: VolatileRef<number>;
494
+ adoptExisting: VolatileRef<boolean>;
495
+ pinnedModels: VolatileRef<readonly string[]>;
496
+ routes: Record<'chat' | 'msg' | 'resp' | 'google', VolatileRef<string>>;
497
+ confirmRemovals: VolatileRef<number>;
498
+ };
499
+ zen: {
500
+ enabled: VolatileRef<boolean>;
501
+ ref: VolatileRef<string>;
502
+ mode: VolatileRef<'login-only' | 'routes'>;
503
+ modelsUrl: VolatileRef<string | undefined>;
504
+ seedFromBuiltin: VolatileRef<boolean>;
505
+ routes: Record<'chat' | 'msg' | 'resp', VolatileRef<string>>;
506
+ };
507
+ };
144
508
  }
145
509
  /** The `modelSync` service surfaced to UIs: run one refresh round and get the report. */
146
510
  export interface ModelSyncService {
147
511
  syncNow(): Promise<string>;
512
+ /** P1d-2: host-service mirrors of the migrate commands (design §14.5). */
513
+ migratePlan?(options?: {
514
+ adopt?: boolean;
515
+ rewriteRefs?: RewriteRefMode;
516
+ pruneUserExtra?: boolean;
517
+ }): Promise<string>;
518
+ migrateApply?(args: {
519
+ planHash?: string;
520
+ confirmCode?: string;
521
+ ackManaged?: boolean;
522
+ }): Promise<string>;
523
+ migrateRollback?(args: {
524
+ planHash?: string;
525
+ }): Promise<string>;
526
+ migrateStatus?(): Promise<string>;
148
527
  }
149
528
  /** Default route list — exported for tests that need to iterate the same set
150
529
  * the plugin syncs when `managedRoutes` is empty. Not part of the public