@aiwayds/dsh-model-sync 0.8.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.
Files changed (68) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +9 -4
  3. package/README.zh-CN.md +9 -4
  4. package/lib/builtin-catalog-snapshot.d.ts +5 -1
  5. package/lib/builtin-catalog-snapshot.js +13 -10
  6. package/lib/builtin-catalog-snapshot.js.map +1 -1
  7. package/lib/index.d.ts +366 -0
  8. package/lib/index.js +729 -13
  9. package/lib/index.js.map +1 -1
  10. package/lib/opencode-go-diagnose.d.ts +74 -0
  11. package/lib/opencode-go-diagnose.js +146 -0
  12. package/lib/opencode-go-diagnose.js.map +1 -0
  13. package/lib/opencode-go-grouping.d.ts +29 -0
  14. package/lib/opencode-go-grouping.js +77 -0
  15. package/lib/opencode-go-grouping.js.map +1 -0
  16. package/lib/opencode-go-journal.d.ts +110 -0
  17. package/lib/opencode-go-journal.js +406 -0
  18. package/lib/opencode-go-journal.js.map +1 -0
  19. package/lib/opencode-go-migrate.d.ts +343 -0
  20. package/lib/opencode-go-migrate.js +1300 -0
  21. package/lib/opencode-go-migrate.js.map +1 -0
  22. package/lib/opencode-go-migration.d.ts +227 -0
  23. package/lib/opencode-go-migration.js +384 -0
  24. package/lib/opencode-go-migration.js.map +1 -0
  25. package/lib/opencode-go-planner.d.ts +153 -0
  26. package/lib/opencode-go-planner.js +339 -0
  27. package/lib/opencode-go-planner.js.map +1 -0
  28. package/lib/opencode-go-profile.d.ts +57 -0
  29. package/lib/opencode-go-profile.js +103 -0
  30. package/lib/opencode-go-profile.js.map +1 -0
  31. package/lib/opencode-go-scheduler.d.ts +128 -0
  32. package/lib/opencode-go-scheduler.js +241 -0
  33. package/lib/opencode-go-scheduler.js.map +1 -0
  34. package/lib/opencode-go-source.d.ts +117 -0
  35. package/lib/opencode-go-source.js +331 -0
  36. package/lib/opencode-go-source.js.map +1 -0
  37. package/lib/opencode-go-store.d.ts +18 -0
  38. package/lib/opencode-go-store.js +68 -0
  39. package/lib/opencode-go-store.js.map +1 -0
  40. package/lib/opencode-go-sync.d.ts +94 -0
  41. package/lib/opencode-go-sync.js +364 -0
  42. package/lib/opencode-go-sync.js.map +1 -0
  43. package/lib/opencode-go-writer.d.ts +132 -0
  44. package/lib/opencode-go-writer.js +966 -0
  45. package/lib/opencode-go-writer.js.map +1 -0
  46. package/lib/provider-native.d.ts +3 -1
  47. package/lib/provider-native.js +4 -2
  48. package/lib/provider-native.js.map +1 -1
  49. package/lib/remote-catalog.d.ts +37 -0
  50. package/lib/remote-catalog.js +261 -3
  51. package/lib/remote-catalog.js.map +1 -1
  52. package/package.json +18 -18
  53. package/src/builtin-catalog-snapshot.ts +18 -11
  54. package/src/index.ts +873 -12
  55. package/src/opencode-go-diagnose.ts +222 -0
  56. package/src/opencode-go-grouping.ts +97 -0
  57. package/src/opencode-go-journal.ts +458 -0
  58. package/src/opencode-go-migrate.ts +1694 -0
  59. package/src/opencode-go-migration.ts +552 -0
  60. package/src/opencode-go-planner.ts +505 -0
  61. package/src/opencode-go-profile.ts +114 -0
  62. package/src/opencode-go-scheduler.ts +315 -0
  63. package/src/opencode-go-source.ts +424 -0
  64. package/src/opencode-go-store.ts +73 -0
  65. package/src/opencode-go-sync.ts +503 -0
  66. package/src/opencode-go-writer.ts +1189 -0
  67. package/src/provider-native.ts +3 -1
  68. package/src/remote-catalog.ts +293 -3
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