@aiwayds/dsh-model-sync 0.9.0 → 0.10.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 +8 -3
- package/README.zh-CN.md +8 -3
- package/lib/builtin-catalog-snapshot.js +6 -3
- package/lib/builtin-catalog-snapshot.js.map +1 -1
- package/lib/index.d.ts +366 -0
- package/lib/index.js +729 -13
- package/lib/index.js.map +1 -1
- package/lib/opencode-go-diagnose.d.ts +74 -0
- package/lib/opencode-go-diagnose.js +146 -0
- package/lib/opencode-go-diagnose.js.map +1 -0
- package/lib/opencode-go-grouping.d.ts +29 -0
- package/lib/opencode-go-grouping.js +77 -0
- package/lib/opencode-go-grouping.js.map +1 -0
- package/lib/opencode-go-journal.d.ts +110 -0
- package/lib/opencode-go-journal.js +406 -0
- package/lib/opencode-go-journal.js.map +1 -0
- package/lib/opencode-go-migrate.d.ts +343 -0
- package/lib/opencode-go-migrate.js +1300 -0
- package/lib/opencode-go-migrate.js.map +1 -0
- package/lib/opencode-go-migration.d.ts +227 -0
- package/lib/opencode-go-migration.js +384 -0
- package/lib/opencode-go-migration.js.map +1 -0
- package/lib/opencode-go-planner.d.ts +153 -0
- package/lib/opencode-go-planner.js +339 -0
- package/lib/opencode-go-planner.js.map +1 -0
- package/lib/opencode-go-profile.d.ts +57 -0
- package/lib/opencode-go-profile.js +103 -0
- package/lib/opencode-go-profile.js.map +1 -0
- package/lib/opencode-go-scheduler.d.ts +128 -0
- package/lib/opencode-go-scheduler.js +241 -0
- package/lib/opencode-go-scheduler.js.map +1 -0
- package/lib/opencode-go-source.d.ts +117 -0
- package/lib/opencode-go-source.js +331 -0
- package/lib/opencode-go-source.js.map +1 -0
- package/lib/opencode-go-store.d.ts +18 -0
- package/lib/opencode-go-store.js +68 -0
- package/lib/opencode-go-store.js.map +1 -0
- package/lib/opencode-go-sync.d.ts +94 -0
- package/lib/opencode-go-sync.js +364 -0
- package/lib/opencode-go-sync.js.map +1 -0
- package/lib/opencode-go-writer.d.ts +132 -0
- package/lib/opencode-go-writer.js +966 -0
- package/lib/opencode-go-writer.js.map +1 -0
- package/lib/provider-native.d.ts +3 -1
- package/lib/provider-native.js +4 -2
- package/lib/provider-native.js.map +1 -1
- package/lib/remote-catalog.d.ts +37 -0
- package/lib/remote-catalog.js +261 -3
- package/lib/remote-catalog.js.map +1 -1
- package/package.json +15 -15
- package/src/builtin-catalog-snapshot.ts +6 -3
- package/src/index.ts +873 -12
- package/src/opencode-go-diagnose.ts +222 -0
- package/src/opencode-go-grouping.ts +97 -0
- package/src/opencode-go-journal.ts +458 -0
- package/src/opencode-go-migrate.ts +1694 -0
- package/src/opencode-go-migration.ts +552 -0
- package/src/opencode-go-planner.ts +505 -0
- package/src/opencode-go-profile.ts +114 -0
- package/src/opencode-go-scheduler.ts +315 -0
- package/src/opencode-go-source.ts +424 -0
- package/src/opencode-go-store.ts +73 -0
- package/src/opencode-go-sync.ts +503 -0
- package/src/opencode-go-writer.ts +1189 -0
- package/src/provider-native.ts +3 -1
- package/src/remote-catalog.ts +293 -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), and `migrate plan|apply|rollback|status` (the only explicit-consent config writer; `plan` is read-only, `apply` requires a plan hash, a 6-digit confirm code and `--ack-managed`). `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,11 @@ 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:
|
|
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`;
|
|
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 explicit-consent config writer — `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.
|
|
118
123
|
|
|
119
124
|
## Development
|
|
120
125
|
|
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`
|
|
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`)。`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,11 @@ 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`
|
|
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 或凭据。
|
|
120
125
|
|
|
121
126
|
## 开发
|
|
122
127
|
|
|
@@ -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:
|
|
32
|
-
{ id: 'kimi-k3.1-pro', api: 'openai-completions', maxTokens:
|
|
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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IAAI,EAAE;QACrF,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;QACjF,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;QACjF,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE;QAC3F,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QAC/D,EAAE,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE;QACrE,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,EAAE,oBAAoB,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,22 @@ 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";
|
|
24
37
|
/**
|
|
25
38
|
* The plugin's `Config` schema: the settings form the 0.1.7 host projects from
|
|
26
39
|
* the `dsh-model-sync` entry. Every field is user-adjustable and therefore
|
|
@@ -73,6 +86,165 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
73
86
|
* a re-emitted retired id is a model the 0.1.7 host no longer resolves.
|
|
74
87
|
*/
|
|
75
88
|
keepDeprecatedBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
89
|
+
/**
|
|
90
|
+
* OpenCode Go / Zen configuration contract (design §6.2.6). Published in one
|
|
91
|
+
* Config schema in P1: read-only subset (go.enabled/ref/modelsUrl/
|
|
92
|
+
* intervalMinutes, zen.enabled/ref/mode/modelsUrl) plus the write-side subset
|
|
93
|
+
* (go.routes/adoptExisting/pinnedModels/confirmRemovals,
|
|
94
|
+
* zen.routes/seedFromBuiltin). Defaults are byte-for-byte the P0 constants —
|
|
95
|
+
* `modelsUrl` and `ref` are imported from the P0 modules so a P0→P1 drift is
|
|
96
|
+
* impossible. Zen stays login-only with no modelsUrl by default (design A5).
|
|
97
|
+
* Nested leaves are `.volatile()` (host settings can edit them); the parent
|
|
98
|
+
* objects are not, because schemastery forbids a volatile field under an
|
|
99
|
+
* enclosing volatile field.
|
|
100
|
+
*/
|
|
101
|
+
opencode: z<Schemastery.ObjectS<NoInfer<{
|
|
102
|
+
go: z<Schemastery.ObjectS<NoInfer<{
|
|
103
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
104
|
+
ref: z<string, string, "volatile-defined">;
|
|
105
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
106
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
107
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
108
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
109
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
110
|
+
chat: z<string, string, "volatile-defined">;
|
|
111
|
+
msg: z<string, string, "volatile-defined">;
|
|
112
|
+
resp: z<string, string, "volatile-defined">;
|
|
113
|
+
google: z<string, string, "volatile-defined">;
|
|
114
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
115
|
+
chat: z<string, string, "volatile-defined">;
|
|
116
|
+
msg: z<string, string, "volatile-defined">;
|
|
117
|
+
resp: z<string, string, "volatile-defined">;
|
|
118
|
+
google: z<string, string, "volatile-defined">;
|
|
119
|
+
}>>, "defined">;
|
|
120
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
121
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
122
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
123
|
+
ref: z<string, string, "volatile-defined">;
|
|
124
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
125
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
126
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
127
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
128
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
129
|
+
chat: z<string, string, "volatile-defined">;
|
|
130
|
+
msg: z<string, string, "volatile-defined">;
|
|
131
|
+
resp: z<string, string, "volatile-defined">;
|
|
132
|
+
google: z<string, string, "volatile-defined">;
|
|
133
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
134
|
+
chat: z<string, string, "volatile-defined">;
|
|
135
|
+
msg: z<string, string, "volatile-defined">;
|
|
136
|
+
resp: z<string, string, "volatile-defined">;
|
|
137
|
+
google: z<string, string, "volatile-defined">;
|
|
138
|
+
}>>, "defined">;
|
|
139
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
140
|
+
}>>, "defined">;
|
|
141
|
+
zen: z<Schemastery.ObjectS<NoInfer<{
|
|
142
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
143
|
+
ref: z<string, string, "volatile-defined">;
|
|
144
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
145
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
146
|
+
modelsUrl: z<string, string, "volatile">;
|
|
147
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
148
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
149
|
+
chat: z<string, string, "volatile-defined">;
|
|
150
|
+
msg: z<string, string, "volatile-defined">;
|
|
151
|
+
resp: z<string, string, "volatile-defined">;
|
|
152
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
153
|
+
chat: z<string, string, "volatile-defined">;
|
|
154
|
+
msg: z<string, string, "volatile-defined">;
|
|
155
|
+
resp: z<string, string, "volatile-defined">;
|
|
156
|
+
}>>, "defined">;
|
|
157
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
158
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
159
|
+
ref: z<string, string, "volatile-defined">;
|
|
160
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
161
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
162
|
+
modelsUrl: z<string, string, "volatile">;
|
|
163
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
164
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
165
|
+
chat: z<string, string, "volatile-defined">;
|
|
166
|
+
msg: z<string, string, "volatile-defined">;
|
|
167
|
+
resp: z<string, string, "volatile-defined">;
|
|
168
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
169
|
+
chat: z<string, string, "volatile-defined">;
|
|
170
|
+
msg: z<string, string, "volatile-defined">;
|
|
171
|
+
resp: z<string, string, "volatile-defined">;
|
|
172
|
+
}>>, "defined">;
|
|
173
|
+
}>>, "defined">;
|
|
174
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
175
|
+
go: z<Schemastery.ObjectS<NoInfer<{
|
|
176
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
177
|
+
ref: z<string, string, "volatile-defined">;
|
|
178
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
179
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
180
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
181
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
182
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
183
|
+
chat: z<string, string, "volatile-defined">;
|
|
184
|
+
msg: z<string, string, "volatile-defined">;
|
|
185
|
+
resp: z<string, string, "volatile-defined">;
|
|
186
|
+
google: z<string, string, "volatile-defined">;
|
|
187
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
188
|
+
chat: z<string, string, "volatile-defined">;
|
|
189
|
+
msg: z<string, string, "volatile-defined">;
|
|
190
|
+
resp: z<string, string, "volatile-defined">;
|
|
191
|
+
google: z<string, string, "volatile-defined">;
|
|
192
|
+
}>>, "defined">;
|
|
193
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
194
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
195
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
196
|
+
ref: z<string, string, "volatile-defined">;
|
|
197
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
198
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
199
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
200
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
201
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
202
|
+
chat: z<string, string, "volatile-defined">;
|
|
203
|
+
msg: z<string, string, "volatile-defined">;
|
|
204
|
+
resp: z<string, string, "volatile-defined">;
|
|
205
|
+
google: z<string, string, "volatile-defined">;
|
|
206
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
207
|
+
chat: z<string, string, "volatile-defined">;
|
|
208
|
+
msg: z<string, string, "volatile-defined">;
|
|
209
|
+
resp: z<string, string, "volatile-defined">;
|
|
210
|
+
google: z<string, string, "volatile-defined">;
|
|
211
|
+
}>>, "defined">;
|
|
212
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
213
|
+
}>>, "defined">;
|
|
214
|
+
zen: z<Schemastery.ObjectS<NoInfer<{
|
|
215
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
216
|
+
ref: z<string, string, "volatile-defined">;
|
|
217
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
218
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
219
|
+
modelsUrl: z<string, string, "volatile">;
|
|
220
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
221
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
222
|
+
chat: z<string, string, "volatile-defined">;
|
|
223
|
+
msg: z<string, string, "volatile-defined">;
|
|
224
|
+
resp: z<string, string, "volatile-defined">;
|
|
225
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
226
|
+
chat: z<string, string, "volatile-defined">;
|
|
227
|
+
msg: z<string, string, "volatile-defined">;
|
|
228
|
+
resp: z<string, string, "volatile-defined">;
|
|
229
|
+
}>>, "defined">;
|
|
230
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
231
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
232
|
+
ref: z<string, string, "volatile-defined">;
|
|
233
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
234
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
235
|
+
modelsUrl: z<string, string, "volatile">;
|
|
236
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
237
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
238
|
+
chat: z<string, string, "volatile-defined">;
|
|
239
|
+
msg: z<string, string, "volatile-defined">;
|
|
240
|
+
resp: z<string, string, "volatile-defined">;
|
|
241
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
242
|
+
chat: z<string, string, "volatile-defined">;
|
|
243
|
+
msg: z<string, string, "volatile-defined">;
|
|
244
|
+
resp: z<string, string, "volatile-defined">;
|
|
245
|
+
}>>, "defined">;
|
|
246
|
+
}>>, "defined">;
|
|
247
|
+
}>>, "defined">;
|
|
76
248
|
}>>, Schemastery.ObjectT<NoInfer<{
|
|
77
249
|
/**
|
|
78
250
|
* Write mode: 'settings' (default, zero-patch settings.mutate pipeline) or
|
|
@@ -117,6 +289,165 @@ export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
|
117
289
|
* a re-emitted retired id is a model the 0.1.7 host no longer resolves.
|
|
118
290
|
*/
|
|
119
291
|
keepDeprecatedBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
292
|
+
/**
|
|
293
|
+
* OpenCode Go / Zen configuration contract (design §6.2.6). Published in one
|
|
294
|
+
* Config schema in P1: read-only subset (go.enabled/ref/modelsUrl/
|
|
295
|
+
* intervalMinutes, zen.enabled/ref/mode/modelsUrl) plus the write-side subset
|
|
296
|
+
* (go.routes/adoptExisting/pinnedModels/confirmRemovals,
|
|
297
|
+
* zen.routes/seedFromBuiltin). Defaults are byte-for-byte the P0 constants —
|
|
298
|
+
* `modelsUrl` and `ref` are imported from the P0 modules so a P0→P1 drift is
|
|
299
|
+
* impossible. Zen stays login-only with no modelsUrl by default (design A5).
|
|
300
|
+
* Nested leaves are `.volatile()` (host settings can edit them); the parent
|
|
301
|
+
* objects are not, because schemastery forbids a volatile field under an
|
|
302
|
+
* enclosing volatile field.
|
|
303
|
+
*/
|
|
304
|
+
opencode: z<Schemastery.ObjectS<NoInfer<{
|
|
305
|
+
go: z<Schemastery.ObjectS<NoInfer<{
|
|
306
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
307
|
+
ref: z<string, string, "volatile-defined">;
|
|
308
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
309
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
310
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
311
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
312
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
313
|
+
chat: z<string, string, "volatile-defined">;
|
|
314
|
+
msg: z<string, string, "volatile-defined">;
|
|
315
|
+
resp: z<string, string, "volatile-defined">;
|
|
316
|
+
google: z<string, string, "volatile-defined">;
|
|
317
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
318
|
+
chat: z<string, string, "volatile-defined">;
|
|
319
|
+
msg: z<string, string, "volatile-defined">;
|
|
320
|
+
resp: z<string, string, "volatile-defined">;
|
|
321
|
+
google: z<string, string, "volatile-defined">;
|
|
322
|
+
}>>, "defined">;
|
|
323
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
324
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
325
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
326
|
+
ref: z<string, string, "volatile-defined">;
|
|
327
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
328
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
329
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
330
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
331
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
332
|
+
chat: z<string, string, "volatile-defined">;
|
|
333
|
+
msg: z<string, string, "volatile-defined">;
|
|
334
|
+
resp: z<string, string, "volatile-defined">;
|
|
335
|
+
google: z<string, string, "volatile-defined">;
|
|
336
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
337
|
+
chat: z<string, string, "volatile-defined">;
|
|
338
|
+
msg: z<string, string, "volatile-defined">;
|
|
339
|
+
resp: z<string, string, "volatile-defined">;
|
|
340
|
+
google: z<string, string, "volatile-defined">;
|
|
341
|
+
}>>, "defined">;
|
|
342
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
343
|
+
}>>, "defined">;
|
|
344
|
+
zen: z<Schemastery.ObjectS<NoInfer<{
|
|
345
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
346
|
+
ref: z<string, string, "volatile-defined">;
|
|
347
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
348
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
349
|
+
modelsUrl: z<string, string, "volatile">;
|
|
350
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
351
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
352
|
+
chat: z<string, string, "volatile-defined">;
|
|
353
|
+
msg: z<string, string, "volatile-defined">;
|
|
354
|
+
resp: z<string, string, "volatile-defined">;
|
|
355
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
356
|
+
chat: z<string, string, "volatile-defined">;
|
|
357
|
+
msg: z<string, string, "volatile-defined">;
|
|
358
|
+
resp: z<string, string, "volatile-defined">;
|
|
359
|
+
}>>, "defined">;
|
|
360
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
361
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
362
|
+
ref: z<string, string, "volatile-defined">;
|
|
363
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
364
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
365
|
+
modelsUrl: z<string, string, "volatile">;
|
|
366
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
367
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
368
|
+
chat: z<string, string, "volatile-defined">;
|
|
369
|
+
msg: z<string, string, "volatile-defined">;
|
|
370
|
+
resp: z<string, string, "volatile-defined">;
|
|
371
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
372
|
+
chat: z<string, string, "volatile-defined">;
|
|
373
|
+
msg: z<string, string, "volatile-defined">;
|
|
374
|
+
resp: z<string, string, "volatile-defined">;
|
|
375
|
+
}>>, "defined">;
|
|
376
|
+
}>>, "defined">;
|
|
377
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
378
|
+
go: z<Schemastery.ObjectS<NoInfer<{
|
|
379
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
380
|
+
ref: z<string, string, "volatile-defined">;
|
|
381
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
382
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
383
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
384
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
385
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
386
|
+
chat: z<string, string, "volatile-defined">;
|
|
387
|
+
msg: z<string, string, "volatile-defined">;
|
|
388
|
+
resp: z<string, string, "volatile-defined">;
|
|
389
|
+
google: z<string, string, "volatile-defined">;
|
|
390
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
391
|
+
chat: z<string, string, "volatile-defined">;
|
|
392
|
+
msg: z<string, string, "volatile-defined">;
|
|
393
|
+
resp: z<string, string, "volatile-defined">;
|
|
394
|
+
google: z<string, string, "volatile-defined">;
|
|
395
|
+
}>>, "defined">;
|
|
396
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
397
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
398
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
399
|
+
ref: z<string, string, "volatile-defined">;
|
|
400
|
+
modelsUrl: z<string, string, "volatile-defined">;
|
|
401
|
+
intervalMinutes: z<number, number, "volatile-defined">;
|
|
402
|
+
adoptExisting: z<boolean, boolean, "volatile-defined">;
|
|
403
|
+
pinnedModels: z<NoInfer<string[]>, NoInfer<string[]>, "volatile-defined">;
|
|
404
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
405
|
+
chat: z<string, string, "volatile-defined">;
|
|
406
|
+
msg: z<string, string, "volatile-defined">;
|
|
407
|
+
resp: z<string, string, "volatile-defined">;
|
|
408
|
+
google: z<string, string, "volatile-defined">;
|
|
409
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
410
|
+
chat: z<string, string, "volatile-defined">;
|
|
411
|
+
msg: z<string, string, "volatile-defined">;
|
|
412
|
+
resp: z<string, string, "volatile-defined">;
|
|
413
|
+
google: z<string, string, "volatile-defined">;
|
|
414
|
+
}>>, "defined">;
|
|
415
|
+
confirmRemovals: z<number, number, "volatile-defined">;
|
|
416
|
+
}>>, "defined">;
|
|
417
|
+
zen: z<Schemastery.ObjectS<NoInfer<{
|
|
418
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
419
|
+
ref: z<string, string, "volatile-defined">;
|
|
420
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
421
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
422
|
+
modelsUrl: z<string, string, "volatile">;
|
|
423
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
424
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
425
|
+
chat: z<string, string, "volatile-defined">;
|
|
426
|
+
msg: z<string, string, "volatile-defined">;
|
|
427
|
+
resp: z<string, string, "volatile-defined">;
|
|
428
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
429
|
+
chat: z<string, string, "volatile-defined">;
|
|
430
|
+
msg: z<string, string, "volatile-defined">;
|
|
431
|
+
resp: z<string, string, "volatile-defined">;
|
|
432
|
+
}>>, "defined">;
|
|
433
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
434
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
435
|
+
ref: z<string, string, "volatile-defined">;
|
|
436
|
+
mode: z<"login-only" | "routes", "login-only" | "routes", "volatile-defined">;
|
|
437
|
+
/** No proven listing endpoint; without it routes mode is unsupported. */
|
|
438
|
+
modelsUrl: z<string, string, "volatile">;
|
|
439
|
+
seedFromBuiltin: z<boolean, boolean, "volatile-defined">;
|
|
440
|
+
routes: z<Schemastery.ObjectS<NoInfer<{
|
|
441
|
+
chat: z<string, string, "volatile-defined">;
|
|
442
|
+
msg: z<string, string, "volatile-defined">;
|
|
443
|
+
resp: z<string, string, "volatile-defined">;
|
|
444
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
445
|
+
chat: z<string, string, "volatile-defined">;
|
|
446
|
+
msg: z<string, string, "volatile-defined">;
|
|
447
|
+
resp: z<string, string, "volatile-defined">;
|
|
448
|
+
}>>, "defined">;
|
|
449
|
+
}>>, "defined">;
|
|
450
|
+
}>>, "defined">;
|
|
120
451
|
}>>, "plain">;
|
|
121
452
|
/**
|
|
122
453
|
* A stable configuration reference — the protocol the 0.1.7 host hands the
|
|
@@ -141,10 +472,45 @@ interface ModelSyncConfigValue {
|
|
|
141
472
|
forceMaxReasoningEffort: VolatileRef<boolean>;
|
|
142
473
|
providerNativeFetch: VolatileRef<boolean>;
|
|
143
474
|
keepDeprecatedBuiltin: VolatileRef<boolean>;
|
|
475
|
+
opencode: {
|
|
476
|
+
go: {
|
|
477
|
+
enabled: VolatileRef<boolean>;
|
|
478
|
+
ref: VolatileRef<string>;
|
|
479
|
+
modelsUrl: VolatileRef<string>;
|
|
480
|
+
intervalMinutes: VolatileRef<number>;
|
|
481
|
+
adoptExisting: VolatileRef<boolean>;
|
|
482
|
+
pinnedModels: VolatileRef<readonly string[]>;
|
|
483
|
+
routes: Record<'chat' | 'msg' | 'resp' | 'google', VolatileRef<string>>;
|
|
484
|
+
confirmRemovals: VolatileRef<number>;
|
|
485
|
+
};
|
|
486
|
+
zen: {
|
|
487
|
+
enabled: VolatileRef<boolean>;
|
|
488
|
+
ref: VolatileRef<string>;
|
|
489
|
+
mode: VolatileRef<'login-only' | 'routes'>;
|
|
490
|
+
modelsUrl: VolatileRef<string | undefined>;
|
|
491
|
+
seedFromBuiltin: VolatileRef<boolean>;
|
|
492
|
+
routes: Record<'chat' | 'msg' | 'resp', VolatileRef<string>>;
|
|
493
|
+
};
|
|
494
|
+
};
|
|
144
495
|
}
|
|
145
496
|
/** The `modelSync` service surfaced to UIs: run one refresh round and get the report. */
|
|
146
497
|
export interface ModelSyncService {
|
|
147
498
|
syncNow(): Promise<string>;
|
|
499
|
+
/** P1d-2: host-service mirrors of the migrate commands (design §14.5). */
|
|
500
|
+
migratePlan?(options?: {
|
|
501
|
+
adopt?: boolean;
|
|
502
|
+
rewriteRefs?: RewriteRefMode;
|
|
503
|
+
pruneUserExtra?: boolean;
|
|
504
|
+
}): Promise<string>;
|
|
505
|
+
migrateApply?(args: {
|
|
506
|
+
planHash?: string;
|
|
507
|
+
confirmCode?: string;
|
|
508
|
+
ackManaged?: boolean;
|
|
509
|
+
}): Promise<string>;
|
|
510
|
+
migrateRollback?(args: {
|
|
511
|
+
planHash?: string;
|
|
512
|
+
}): Promise<string>;
|
|
513
|
+
migrateStatus?(): Promise<string>;
|
|
148
514
|
}
|
|
149
515
|
/** Default route list — exported for tests that need to iterate the same set
|
|
150
516
|
* the plugin syncs when `managedRoutes` is empty. Not part of the public
|