@zhivex-ai/harness 1.3.0-rc.3 → 1.3.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 (157) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +12 -10
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +4 -4
  5. package/contracts/engine-api.json +334 -0
  6. package/contracts/public-api.json +267 -1
  7. package/contracts/stable-api-signatures.json +43 -43
  8. package/dist/acp-cli.js +54 -18
  9. package/dist/approvals/approval-history.d.ts +22 -0
  10. package/dist/approvals/explicit-review.d.ts +24 -0
  11. package/dist/approvals/host-policy-identity.d.ts +3 -0
  12. package/dist/cli/arguments.d.ts +6 -2
  13. package/dist/cli/checkpoints.d.ts +230 -0
  14. package/dist/cli/cli-profiles.d.ts +4 -2
  15. package/dist/cli/governance-report.d.ts +5 -0
  16. package/dist/cli/policy-decisions.d.ts +9 -0
  17. package/dist/cli/policy.d.ts +5 -0
  18. package/dist/cli/presentation.d.ts +3 -1
  19. package/dist/cli/terminal/terminal-ui.d.ts +4 -0
  20. package/dist/{cli-entry-xmf48p6a.js → cli-entry-1gfg3brj.js} +14921 -10692
  21. package/dist/cli-entry-bx3vjw7h.js +656 -0
  22. package/dist/{index-fvca1xea.js → cli-entry-d5788aay.js} +339 -58
  23. package/dist/{cli-qgwvtk0w.js → cli-etsmtst3.js} +918 -2222
  24. package/dist/cli.js +3 -5
  25. package/dist/client/acp-mcp-admission.d.ts +32 -0
  26. package/dist/client/acp-mcp-host.d.ts +19 -0
  27. package/dist/client/acp-mcp-session.d.ts +14 -0
  28. package/dist/client/acp-stdio.d.ts +2 -0
  29. package/dist/client/acp.d.ts +4 -1
  30. package/dist/client/adapter.d.ts +13 -1
  31. package/dist/client/json-contracts.d.ts +107 -4
  32. package/dist/client/local-service.d.ts +2 -0
  33. package/dist/client/protocol.d.ts +127 -1
  34. package/dist/client/service-events.d.ts +4 -0
  35. package/dist/compat/cli-options.d.ts +13 -1
  36. package/dist/compat/code-support.js +23 -87
  37. package/dist/{config-q32jm1e6.js → config-c002f06f.js} +1 -1
  38. package/dist/{config-6gtpxvjv.js → config-j3jga5wh.js} +3 -1
  39. package/dist/context/adaptive-compaction.d.ts +1 -0
  40. package/dist/context/compaction.d.ts +1 -1
  41. package/dist/context/request-measurements.d.ts +17 -0
  42. package/dist/context/request-projection.d.ts +10 -0
  43. package/dist/context/task-memory.d.ts +1 -0
  44. package/dist/engine/acp.d.ts +2 -0
  45. package/dist/engine/acp.js +197 -1
  46. package/dist/engine/client.js +11 -4
  47. package/dist/engine/desktop-providers-v1.d.ts +4 -0
  48. package/dist/engine/desktop-providers-v1.js +18 -0
  49. package/dist/engine/desktop-state-v1.d.ts +10 -0
  50. package/dist/engine/desktop-state-v1.js +168 -0
  51. package/dist/engine/index.d.ts +12 -0
  52. package/dist/engine/index.js +571 -71
  53. package/dist/engine/mcp-stdio-v1.d.ts +11 -0
  54. package/dist/engine/mcp-stdio-v1.js +108 -0
  55. package/dist/engine/models.d.ts +3 -0
  56. package/dist/engine/models.js +894 -0
  57. package/dist/engine/protocol.d.ts +1 -0
  58. package/dist/engine/protocol.js +24 -0
  59. package/dist/engine/service.js +12 -5
  60. package/dist/execution/acceptance-snapshot.d.ts +2 -0
  61. package/dist/execution/execution-environment.d.ts +10 -0
  62. package/dist/execution/mcp-oci-channel.d.ts +11 -0
  63. package/dist/execution/mcp-oci-server.d.ts +38 -0
  64. package/dist/execution/mcp-oci-workspace.d.ts +23 -0
  65. package/dist/execution/mcp-resource-recovery.d.ts +19 -0
  66. package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
  67. package/dist/hostile-repository-demo.js +3169 -1163
  68. package/dist/{index-f4sb0e2q.js → index-2jrdcj6b.js} +17 -2
  69. package/dist/{index-77h9qr5h.js → index-3ah1f369.js} +40 -10
  70. package/dist/{index-pgqz45fj.js → index-42gp2hy8.js} +197 -1091
  71. package/dist/{index-41fkzt91.js → index-4jw3tvy8.js} +10 -2
  72. package/dist/index-6m08wvab.js +1768 -0
  73. package/dist/index-8705zxpr.js +145 -0
  74. package/dist/{index-d0wrghff.js → index-8vm2m34s.js} +225 -1416
  75. package/dist/index-8zzhggxv.js +477 -0
  76. package/dist/index-a97bezbz.js +1073 -0
  77. package/dist/index-azmwjp95.js +1004 -0
  78. package/dist/{cli-entry-0mmeag20.js → index-gq9xagx2.js} +122 -836
  79. package/dist/index-h0mqx2ed.js +1373 -0
  80. package/dist/index-hnaxfpb5.js +5589 -0
  81. package/dist/{index-2aymdsqc.js → index-qfpz5y2v.js} +24 -0
  82. package/dist/{index-kfgt9yqq.js → index-w2sj0wkw.js} +33 -10
  83. package/dist/index-wg1sd3at.js +80 -0
  84. package/dist/index-xqxeypt5.js +888 -0
  85. package/dist/index-yb239ghk.js +961 -0
  86. package/dist/index-z0qxmkm2.js +3389 -0
  87. package/dist/index.js +85 -72
  88. package/dist/integrations/mcp-host-session.d.ts +26 -0
  89. package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
  90. package/dist/integrations/mcp-stdio-client.d.ts +44 -0
  91. package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
  92. package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
  93. package/dist/integrations/mcp-stdio-session.d.ts +7 -0
  94. package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
  95. package/dist/internal/desktop/catalog.d.ts +2 -0
  96. package/dist/internal/desktop/persistence.d.ts +2 -3
  97. package/dist/internal/desktop/providers.d.ts +1 -0
  98. package/dist/models/catalog.d.ts +2 -0
  99. package/dist/persistence/governance-context.d.ts +126 -0
  100. package/dist/persistence/governance-report.d.ts +299 -0
  101. package/dist/persistence/host-database-backup.d.ts +28 -0
  102. package/dist/persistence/mcp-execution-journal.d.ts +19 -0
  103. package/dist/persistence/mcp-reconciliation.d.ts +33 -0
  104. package/dist/persistence/mcp-resource-journal.d.ts +54 -0
  105. package/dist/persistence/workspace-checkpoints.d.ts +138 -0
  106. package/dist/providers/anthropic-continuation.d.ts +5 -0
  107. package/dist/providers/providers.d.ts +1 -1
  108. package/dist/providers/vertex-auth.d.ts +27 -0
  109. package/dist/runtime/delegation-contracts.d.ts +9 -0
  110. package/dist/runtime/delegation-correction.d.ts +9 -0
  111. package/dist/runtime/delegation-result.d.ts +73 -0
  112. package/dist/runtime/error-diagnostics.d.ts +86 -0
  113. package/dist/runtime/harness.d.ts +11 -1
  114. package/dist/runtime/policy-decisions.d.ts +66 -0
  115. package/dist/runtime/policy-inspection.d.ts +52 -0
  116. package/dist/runtime/provider-diagnostics.d.ts +1 -0
  117. package/dist/runtime/runtime-instructions.d.ts +8 -0
  118. package/dist/runtime/task-acceptance-checks.d.ts +103 -0
  119. package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
  120. package/dist/runtime/task-acceptance-host.d.ts +20 -0
  121. package/dist/runtime/task-acceptance-record.d.ts +107 -0
  122. package/dist/runtime/task-acceptance-validation.d.ts +25 -0
  123. package/dist/runtime/task-acceptance.d.ts +47 -0
  124. package/dist/runtime/time-to-safe-fix.d.ts +83 -0
  125. package/dist/runtime/tool-policy-file.d.ts +23 -0
  126. package/dist/runtime/tool-policy-paths.d.ts +5 -0
  127. package/dist/runtime/tool-policy.d.ts +6 -0
  128. package/dist/service-cli.js +14 -7
  129. package/dist/{service-client-cli-gs78wrxe.js → service-client-cli-3365rfav.js} +307 -248
  130. package/dist/verify-historical-migrations.js +3134 -1129
  131. package/dist/workspace/path-policy.d.ts +4 -0
  132. package/dist/zhx.js +3 -5
  133. package/docs/ACP.md +14 -2
  134. package/docs/ANTHROPIC.md +33 -0
  135. package/docs/CLI.md +132 -0
  136. package/docs/CLIENT_PROTOCOL.md +45 -0
  137. package/docs/CODE_RELEASE.md +35 -18
  138. package/docs/ENGINE_API.md +216 -7
  139. package/docs/EXTENSIBILITY.md +46 -3
  140. package/docs/FIRST_USE.md +6 -6
  141. package/docs/LOCAL_SERVICE.md +13 -0
  142. package/docs/MCP_STDIO.md +20 -0
  143. package/docs/README.md +1 -0
  144. package/docs/STABILITY.md +4 -2
  145. package/docs/SUPPORT_MATRIX.md +1 -1
  146. package/docs/TOOL_POLICY.md +81 -0
  147. package/docs/VERTEX.md +50 -0
  148. package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
  149. package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
  150. package/docs/support-matrix.json +2 -0
  151. package/evaluations/representative-assembly-matrix.json +46 -1
  152. package/evaluations/task-acceptance-routes.json +7 -0
  153. package/examples/README.md +3 -3
  154. package/package.json +43 -12
  155. package/dist/cli-entry-64pdp3k5.js +0 -17
  156. package/dist/cli-entry-7h9savv5.js +0 -375
  157. package/dist/index-5wjwe91x.js +0 -9434
@@ -0,0 +1,888 @@
1
+ // src/models/catalog.ts
2
+ import { z } from "zod";
3
+ // src/models/catalog.json
4
+ var catalog_default = {
5
+ schemaVersion: 1,
6
+ revision: "2026-09-29-vertex",
7
+ providers: [
8
+ {
9
+ id: "openai",
10
+ defaultModel: "gpt-6-luna",
11
+ models: [
12
+ {
13
+ id: "gpt-6-astra",
14
+ name: "gpt-6-astra",
15
+ group: "primary",
16
+ order: 0,
17
+ lifecycle: "active",
18
+ validation: "unverified",
19
+ capabilities: [
20
+ "chat",
21
+ "tools"
22
+ ],
23
+ limits: {
24
+ contextWindowTokens: 1050000,
25
+ contextWindowType: "combined",
26
+ maxOutputTokens: 128000,
27
+ evidence: {
28
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
29
+ checkedAt: "2026-09-24"
30
+ }
31
+ },
32
+ pricing: {
33
+ currency: "USD",
34
+ inputPerMillionTokens: 10,
35
+ outputPerMillionTokens: 50,
36
+ cachedInputPerMillionTokens: 1,
37
+ maxInputTokens: 272000,
38
+ scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
39
+ evidence: {
40
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
41
+ checkedAt: "2026-09-24"
42
+ }
43
+ },
44
+ compaction: {
45
+ suitability: "candidate",
46
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
47
+ evidence: {
48
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
49
+ checkedAt: "2026-09-24"
50
+ }
51
+ }
52
+ },
53
+ {
54
+ id: "gpt-6-sol",
55
+ name: "gpt-6-sol",
56
+ group: "primary",
57
+ order: 1,
58
+ lifecycle: "active",
59
+ validation: "unverified",
60
+ capabilities: [
61
+ "chat",
62
+ "tools",
63
+ "vision"
64
+ ],
65
+ limits: {
66
+ contextWindowTokens: 1050000,
67
+ contextWindowType: "combined",
68
+ maxOutputTokens: 128000,
69
+ evidence: {
70
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
71
+ checkedAt: "2026-09-24"
72
+ }
73
+ },
74
+ pricing: {
75
+ currency: "USD",
76
+ inputPerMillionTokens: 2,
77
+ outputPerMillionTokens: 10,
78
+ cachedInputPerMillionTokens: 0.2,
79
+ maxInputTokens: 272000,
80
+ scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
81
+ evidence: {
82
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
83
+ checkedAt: "2026-09-24"
84
+ }
85
+ },
86
+ compaction: {
87
+ suitability: "candidate",
88
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
89
+ evidence: {
90
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
91
+ checkedAt: "2026-09-24"
92
+ }
93
+ }
94
+ },
95
+ {
96
+ id: "gpt-6-luna",
97
+ name: "gpt-6-luna",
98
+ group: "primary",
99
+ order: 2,
100
+ lifecycle: "active",
101
+ validation: "unverified",
102
+ capabilities: [
103
+ "chat",
104
+ "tools",
105
+ "vision"
106
+ ],
107
+ limits: {
108
+ contextWindowTokens: 1050000,
109
+ contextWindowType: "combined",
110
+ maxOutputTokens: 128000,
111
+ evidence: {
112
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
113
+ checkedAt: "2026-09-24"
114
+ }
115
+ },
116
+ pricing: {
117
+ currency: "USD",
118
+ inputPerMillionTokens: 0.1,
119
+ outputPerMillionTokens: 0.5,
120
+ cachedInputPerMillionTokens: 0.01,
121
+ maxInputTokens: 272000,
122
+ scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
123
+ evidence: {
124
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
125
+ checkedAt: "2026-09-24"
126
+ }
127
+ },
128
+ compaction: {
129
+ suitability: "candidate",
130
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
131
+ evidence: {
132
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
133
+ checkedAt: "2026-09-24"
134
+ }
135
+ }
136
+ },
137
+ {
138
+ id: "gpt-5.6-sol",
139
+ name: "gpt-5.6-sol",
140
+ group: "other",
141
+ order: 3,
142
+ lifecycle: "unknown",
143
+ validation: "unverified",
144
+ capabilities: [
145
+ "chat",
146
+ "tools"
147
+ ]
148
+ },
149
+ {
150
+ id: "gpt-5.6-terra",
151
+ name: "gpt-5.6-terra",
152
+ group: "other",
153
+ order: 4,
154
+ lifecycle: "unknown",
155
+ validation: "unverified",
156
+ capabilities: [
157
+ "chat",
158
+ "tools"
159
+ ]
160
+ },
161
+ {
162
+ id: "gpt-5.6-luna",
163
+ name: "gpt-5.6-luna",
164
+ group: "other",
165
+ order: 5,
166
+ lifecycle: "unknown",
167
+ validation: "unverified",
168
+ capabilities: [
169
+ "chat",
170
+ "tools"
171
+ ]
172
+ },
173
+ {
174
+ id: "gpt-5.5",
175
+ name: "gpt-5.5",
176
+ group: "other",
177
+ order: 6,
178
+ lifecycle: "unknown",
179
+ validation: "unverified",
180
+ capabilities: [
181
+ "chat",
182
+ "tools"
183
+ ],
184
+ reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
185
+ },
186
+ {
187
+ id: "gpt-5.4",
188
+ name: "gpt-5.4",
189
+ group: "other",
190
+ order: 7,
191
+ lifecycle: "unknown",
192
+ validation: "unverified",
193
+ capabilities: [
194
+ "chat",
195
+ "tools"
196
+ ],
197
+ reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
198
+ },
199
+ {
200
+ id: "gpt-5.4-mini",
201
+ name: "gpt-5.4-mini",
202
+ group: "other",
203
+ order: 8,
204
+ lifecycle: "unknown",
205
+ validation: "unverified",
206
+ capabilities: [
207
+ "chat",
208
+ "tools"
209
+ ],
210
+ reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
211
+ },
212
+ {
213
+ id: "gpt-4o-mini",
214
+ name: "gpt-4o-mini",
215
+ group: "other",
216
+ order: 9,
217
+ lifecycle: "unknown",
218
+ validation: "unverified",
219
+ capabilities: [
220
+ "chat",
221
+ "tools"
222
+ ],
223
+ reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices.",
224
+ limits: {
225
+ contextWindowTokens: 128000,
226
+ contextWindowType: "combined",
227
+ maxOutputTokens: 16384,
228
+ evidence: {
229
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
230
+ checkedAt: "2026-09-24"
231
+ }
232
+ },
233
+ pricing: {
234
+ currency: "USD",
235
+ inputPerMillionTokens: 0.15,
236
+ outputPerMillionTokens: 0.6,
237
+ cachedInputPerMillionTokens: 0.075,
238
+ scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
239
+ evidence: {
240
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
241
+ checkedAt: "2026-09-24"
242
+ }
243
+ },
244
+ compaction: {
245
+ suitability: "candidate",
246
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
247
+ evidence: {
248
+ sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
249
+ checkedAt: "2026-09-24"
250
+ }
251
+ }
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ id: "qwen",
257
+ defaultModel: "qwen3.8-max",
258
+ models: [
259
+ {
260
+ id: "qwen3.8-flash",
261
+ name: "qwen3.8-flash",
262
+ group: "primary",
263
+ order: 0,
264
+ lifecycle: "unknown",
265
+ validation: "unverified",
266
+ capabilities: [
267
+ "chat",
268
+ "tools"
269
+ ],
270
+ limits: {
271
+ contextWindowTokens: 1e6,
272
+ contextWindowType: "combined",
273
+ maxOutputTokens: 131072,
274
+ maxInputTokens: 983616,
275
+ evidence: {
276
+ sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
277
+ checkedAt: "2026-09-24"
278
+ }
279
+ },
280
+ compaction: {
281
+ suitability: "candidate",
282
+ reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
283
+ evidence: {
284
+ sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
285
+ checkedAt: "2026-09-24"
286
+ }
287
+ }
288
+ },
289
+ {
290
+ id: "qwen3.8-max",
291
+ name: "qwen3.8-max",
292
+ group: "primary",
293
+ order: 1,
294
+ lifecycle: "unknown",
295
+ validation: "unverified",
296
+ capabilities: [
297
+ "chat",
298
+ "tools"
299
+ ],
300
+ limits: {
301
+ contextWindowTokens: 1e6,
302
+ contextWindowType: "combined",
303
+ maxOutputTokens: 131072,
304
+ maxInputTokens: 983616,
305
+ evidence: {
306
+ sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
307
+ checkedAt: "2026-09-24"
308
+ }
309
+ },
310
+ compaction: {
311
+ suitability: "candidate",
312
+ reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
313
+ evidence: {
314
+ sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
315
+ checkedAt: "2026-09-24"
316
+ }
317
+ }
318
+ },
319
+ {
320
+ id: "glm-5.3",
321
+ name: "GLM 5.3",
322
+ group: "primary",
323
+ order: 2,
324
+ lifecycle: "active",
325
+ validation: "unverified",
326
+ capabilities: [
327
+ "chat",
328
+ "tools"
329
+ ],
330
+ reason: "Zhipu model served by Alibaba Model Studio; region and account access vary"
331
+ },
332
+ {
333
+ id: "deepseek-v4.1-flash",
334
+ name: "DeepSeek V4.1 Flash",
335
+ group: "primary",
336
+ order: 3,
337
+ lifecycle: "active",
338
+ validation: "unverified",
339
+ capabilities: [
340
+ "chat",
341
+ "tools",
342
+ "vision"
343
+ ],
344
+ reason: "DeepSeek model served by Alibaba Model Studio; region and account access vary"
345
+ },
346
+ {
347
+ id: "kimi-k3",
348
+ name: "Kimi K3",
349
+ group: "primary",
350
+ order: 4,
351
+ lifecycle: "active",
352
+ validation: "unverified",
353
+ capabilities: [
354
+ "chat",
355
+ "tools",
356
+ "vision"
357
+ ],
358
+ reason: "Moonshot model served by Alibaba Model Studio; region and account access vary"
359
+ },
360
+ {
361
+ id: "qwen3.7-plus",
362
+ name: "qwen3.7-plus",
363
+ group: "primary",
364
+ order: 5,
365
+ lifecycle: "unknown",
366
+ validation: "unverified",
367
+ capabilities: [
368
+ "chat",
369
+ "tools"
370
+ ]
371
+ },
372
+ {
373
+ id: "qwen3.8-omni-flash",
374
+ name: "qwen3.8-omni-flash",
375
+ group: "other",
376
+ order: 6,
377
+ lifecycle: "unknown",
378
+ validation: "unverified",
379
+ capabilities: [
380
+ "chat",
381
+ "tools"
382
+ ]
383
+ },
384
+ {
385
+ id: "qwen3.8-max-0902",
386
+ name: "qwen3.8-max-0902",
387
+ group: "other",
388
+ order: 7,
389
+ lifecycle: "unknown",
390
+ validation: "unverified",
391
+ capabilities: [
392
+ "chat",
393
+ "tools"
394
+ ]
395
+ },
396
+ {
397
+ id: "qwen3.8-max-preview",
398
+ name: "qwen3.8-max-preview",
399
+ group: "other",
400
+ order: 8,
401
+ lifecycle: "unknown",
402
+ validation: "unverified",
403
+ capabilities: [
404
+ "chat",
405
+ "tools"
406
+ ]
407
+ },
408
+ {
409
+ id: "qwen3.7-max",
410
+ name: "qwen3.7-max",
411
+ group: "other",
412
+ order: 9,
413
+ lifecycle: "unknown",
414
+ validation: "unverified",
415
+ capabilities: [
416
+ "chat",
417
+ "tools"
418
+ ]
419
+ },
420
+ {
421
+ id: "qwen3.6-flash",
422
+ name: "qwen3.6-flash",
423
+ group: "other",
424
+ order: 10,
425
+ lifecycle: "unknown",
426
+ validation: "unverified",
427
+ capabilities: [
428
+ "chat",
429
+ "tools"
430
+ ]
431
+ },
432
+ {
433
+ id: "qwen3.5-omni-plus",
434
+ name: "qwen3.5-omni-plus",
435
+ group: "other",
436
+ order: 11,
437
+ lifecycle: "unknown",
438
+ validation: "unverified",
439
+ capabilities: [
440
+ "chat",
441
+ "tools"
442
+ ]
443
+ },
444
+ {
445
+ id: "qwen-plus",
446
+ name: "qwen-plus",
447
+ group: "other",
448
+ order: 12,
449
+ lifecycle: "unknown",
450
+ validation: "unverified",
451
+ capabilities: [
452
+ "chat",
453
+ "tools"
454
+ ]
455
+ }
456
+ ]
457
+ },
458
+ {
459
+ id: "gemini",
460
+ defaultModel: "gemini-3.6-flash",
461
+ models: [
462
+ {
463
+ id: "gemini-3.8-flash",
464
+ name: "gemini-3.8-flash",
465
+ group: "other",
466
+ order: 0,
467
+ lifecycle: "unknown",
468
+ validation: "unverified",
469
+ capabilities: [
470
+ "chat",
471
+ "tools"
472
+ ],
473
+ limits: {
474
+ contextWindowTokens: 1048576,
475
+ contextWindowType: "input",
476
+ maxOutputTokens: 65536,
477
+ evidence: {
478
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash",
479
+ checkedAt: "2026-09-24"
480
+ }
481
+ },
482
+ compaction: {
483
+ suitability: "candidate",
484
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
485
+ evidence: {
486
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash",
487
+ checkedAt: "2026-09-24"
488
+ }
489
+ }
490
+ },
491
+ {
492
+ id: "gemini-3.7-flash",
493
+ name: "gemini-3.7-flash",
494
+ group: "other",
495
+ order: 1,
496
+ lifecycle: "unknown",
497
+ validation: "unverified",
498
+ capabilities: [
499
+ "chat",
500
+ "tools"
501
+ ],
502
+ limits: {
503
+ contextWindowTokens: 1048576,
504
+ contextWindowType: "input",
505
+ maxOutputTokens: 65536,
506
+ evidence: {
507
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash",
508
+ checkedAt: "2026-09-24"
509
+ }
510
+ },
511
+ compaction: {
512
+ suitability: "candidate",
513
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
514
+ evidence: {
515
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash",
516
+ checkedAt: "2026-09-24"
517
+ }
518
+ }
519
+ },
520
+ {
521
+ id: "gemini-3.6-flash",
522
+ name: "gemini-3.6-flash",
523
+ group: "primary",
524
+ order: 2,
525
+ lifecycle: "unknown",
526
+ validation: "unverified",
527
+ capabilities: [
528
+ "chat",
529
+ "tools"
530
+ ],
531
+ limits: {
532
+ contextWindowTokens: 1048576,
533
+ contextWindowType: "input",
534
+ maxOutputTokens: 65536,
535
+ evidence: {
536
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.6-flash",
537
+ checkedAt: "2026-09-24"
538
+ }
539
+ },
540
+ compaction: {
541
+ suitability: "candidate",
542
+ reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
543
+ evidence: {
544
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.6-flash",
545
+ checkedAt: "2026-09-24"
546
+ }
547
+ }
548
+ },
549
+ {
550
+ id: "gemini-3.5-flash-lite",
551
+ name: "gemini-3.5-flash-lite",
552
+ group: "other",
553
+ order: 3,
554
+ lifecycle: "unknown",
555
+ validation: "unverified",
556
+ capabilities: [
557
+ "chat",
558
+ "tools"
559
+ ],
560
+ limits: {
561
+ contextWindowTokens: 1048576,
562
+ contextWindowType: "input",
563
+ maxOutputTokens: 65536,
564
+ evidence: {
565
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash-lite",
566
+ checkedAt: "2026-09-24"
567
+ }
568
+ },
569
+ compaction: {
570
+ suitability: "candidate",
571
+ reason: "Editorial candidate based on documented document parsing and text generation; summary fidelity has not been benchmarked.",
572
+ evidence: {
573
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash-lite",
574
+ checkedAt: "2026-09-24"
575
+ }
576
+ },
577
+ pricing: {
578
+ currency: "USD",
579
+ inputPerMillionTokens: 0.3,
580
+ outputPerMillionTokens: 2.5,
581
+ cachedInputPerMillionTokens: 0.03,
582
+ scope: "Standard paid-tier text tokens; includes output thinking tokens, excludes cache storage and tool charges.",
583
+ evidence: {
584
+ sourceUrl: "https://ai.google.dev/gemini-api/docs/pricing#gemini-3.5-flash-lite",
585
+ checkedAt: "2026-09-24"
586
+ }
587
+ }
588
+ },
589
+ {
590
+ id: "gemini-3.5-flash",
591
+ name: "gemini-3.5-flash",
592
+ group: "other",
593
+ order: 4,
594
+ lifecycle: "unknown",
595
+ validation: "unverified",
596
+ capabilities: [
597
+ "chat",
598
+ "tools"
599
+ ]
600
+ },
601
+ {
602
+ id: "gemini-3.1-pro-preview",
603
+ name: "gemini-3.1-pro-preview",
604
+ group: "other",
605
+ order: 5,
606
+ lifecycle: "unknown",
607
+ validation: "unverified",
608
+ capabilities: [
609
+ "chat",
610
+ "tools"
611
+ ]
612
+ },
613
+ {
614
+ id: "gemini-3.1-pro-preview-customtools",
615
+ name: "gemini-3.1-pro-preview-customtools",
616
+ group: "other",
617
+ order: 6,
618
+ lifecycle: "unknown",
619
+ validation: "unverified",
620
+ capabilities: [
621
+ "chat",
622
+ "tools"
623
+ ]
624
+ },
625
+ {
626
+ id: "gemini-3-flash-preview",
627
+ name: "gemini-3-flash-preview",
628
+ group: "other",
629
+ order: 7,
630
+ lifecycle: "unknown",
631
+ validation: "unverified",
632
+ capabilities: [
633
+ "chat",
634
+ "tools"
635
+ ]
636
+ },
637
+ {
638
+ id: "gemini-3.1-flash-lite",
639
+ name: "gemini-3.1-flash-lite",
640
+ group: "other",
641
+ order: 8,
642
+ lifecycle: "unknown",
643
+ validation: "unverified",
644
+ capabilities: [
645
+ "chat",
646
+ "tools"
647
+ ]
648
+ }
649
+ ]
650
+ },
651
+ {
652
+ id: "meta",
653
+ defaultModel: "muse-spark-1.3",
654
+ models: [
655
+ {
656
+ id: "muse-spark-1.3",
657
+ name: "muse-spark-1.3",
658
+ group: "primary",
659
+ order: 0,
660
+ lifecycle: "active",
661
+ validation: "unverified",
662
+ capabilities: [
663
+ "chat",
664
+ "tools"
665
+ ]
666
+ },
667
+ {
668
+ id: "muse-spark-1.2",
669
+ name: "muse-spark-1.2",
670
+ group: "primary",
671
+ order: 1,
672
+ lifecycle: "unknown",
673
+ validation: "unverified",
674
+ capabilities: [
675
+ "chat",
676
+ "tools"
677
+ ]
678
+ },
679
+ {
680
+ id: "muse-spark-1.2-contributor",
681
+ name: "muse-spark-1.2-contributor",
682
+ group: "other",
683
+ order: 2,
684
+ lifecycle: "unknown",
685
+ validation: "unverified",
686
+ capabilities: [
687
+ "chat",
688
+ "tools"
689
+ ]
690
+ },
691
+ {
692
+ id: "muse-spark-1.1",
693
+ name: "muse-spark-1.1",
694
+ group: "other",
695
+ order: 3,
696
+ lifecycle: "unknown",
697
+ validation: "unverified",
698
+ capabilities: [
699
+ "chat",
700
+ "tools"
701
+ ]
702
+ }
703
+ ]
704
+ },
705
+ {
706
+ id: "anthropic",
707
+ defaultModel: "claude-sonnet-5",
708
+ models: [
709
+ {
710
+ id: "claude-sonnet-5",
711
+ name: "claude-sonnet-5",
712
+ group: "primary",
713
+ order: 0,
714
+ lifecycle: "active",
715
+ validation: "unverified",
716
+ capabilities: [
717
+ "chat",
718
+ "tools",
719
+ "vision"
720
+ ],
721
+ reason: "Provisional Anthropic API route. Account access and live Harness certification are not verified."
722
+ },
723
+ {
724
+ id: "claude-haiku-4-5",
725
+ name: "claude-haiku-4-5",
726
+ group: "other",
727
+ order: 1,
728
+ lifecycle: "active",
729
+ validation: "unverified",
730
+ capabilities: [
731
+ "chat",
732
+ "tools",
733
+ "vision"
734
+ ],
735
+ reason: "Provisional Anthropic API route. Account access and live Harness certification are not verified."
736
+ },
737
+ {
738
+ id: "claude-opus-5-5",
739
+ name: "claude-opus-5-5",
740
+ group: "other",
741
+ order: 2,
742
+ lifecycle: "active",
743
+ validation: "unverified",
744
+ capabilities: [
745
+ "chat",
746
+ "tools",
747
+ "vision"
748
+ ],
749
+ reason: "Provisional Anthropic API route. Account access and live Harness certification are not verified."
750
+ }
751
+ ]
752
+ },
753
+ {
754
+ id: "vertex",
755
+ defaultModel: "gemini-3.7-flash",
756
+ models: [
757
+ {
758
+ id: "gemini-3.7-flash",
759
+ name: "Gemini 3.7 Flash (Vertex)",
760
+ group: "primary",
761
+ order: 0,
762
+ lifecycle: "unknown",
763
+ validation: "unverified",
764
+ capabilities: [
765
+ "chat",
766
+ "tools"
767
+ ],
768
+ reason: "Provisional Vertex route; availability depends on project, region and IAM. No live certification."
769
+ }
770
+ ]
771
+ }
772
+ ]
773
+ };
774
+
775
+ // src/models/catalog.ts
776
+ var modelId = z.string().min(1).max(160).regex(/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/);
777
+ var text = z.string().min(1).max(300).regex(/^[^\x00-\x1f\x7f-\x9f]*$/);
778
+ var evidence = z.object({
779
+ sourceUrl: z.url().max(1000).refine((value) => {
780
+ const url = new URL(value);
781
+ return url.protocol === "https:" && !url.username && !url.password;
782
+ }, "Evidence requires an HTTPS URL without credentials"),
783
+ checkedAt: z.iso.date()
784
+ }).strict();
785
+ var tokenLimit = z.number().int().positive().max(1e9);
786
+ var price = z.number().finite().nonnegative().max(1e6);
787
+ var catalogModelSchema = z.object({
788
+ id: modelId,
789
+ name: text,
790
+ group: z.enum(["primary", "other"]),
791
+ order: z.number().int().min(0),
792
+ lifecycle: z.enum(["active", "deprecated", "retired", "unknown"]),
793
+ validation: z.enum(["verified", "unverified"]),
794
+ capabilities: z.array(z.enum(["chat", "tools", "vision"])).max(3),
795
+ reason: text.optional(),
796
+ replacement: modelId.optional(),
797
+ retirementDate: z.iso.date().optional(),
798
+ limits: z.object({
799
+ contextWindowTokens: tokenLimit,
800
+ contextWindowType: z.enum(["combined", "input"]),
801
+ maxOutputTokens: tokenLimit,
802
+ maxInputTokens: tokenLimit.optional(),
803
+ evidence
804
+ }).strict().optional(),
805
+ pricing: z.object({
806
+ currency: z.literal("USD"),
807
+ inputPerMillionTokens: price,
808
+ outputPerMillionTokens: price,
809
+ cachedInputPerMillionTokens: price.optional(),
810
+ maxInputTokens: tokenLimit.optional(),
811
+ scope: text,
812
+ evidence
813
+ }).strict().optional(),
814
+ compaction: z.object({
815
+ suitability: z.enum(["candidate", "evaluated", "unsuitable", "unknown"]),
816
+ reason: text,
817
+ evidence
818
+ }).strict().optional()
819
+ }).strict().superRefine((model, ctx) => {
820
+ if (!model.limits)
821
+ return;
822
+ if (model.limits.maxInputTokens !== undefined && model.limits.maxInputTokens > model.limits.contextWindowTokens) {
823
+ ctx.addIssue({ code: "custom", message: "maxInputTokens exceeds context window" });
824
+ }
825
+ if (model.limits.contextWindowType === "combined" && model.limits.maxOutputTokens > model.limits.contextWindowTokens) {
826
+ ctx.addIssue({ code: "custom", message: "maxOutputTokens exceeds combined context window" });
827
+ }
828
+ });
829
+ var modelCatalogSchema = z.object({
830
+ schemaVersion: z.literal(1),
831
+ revision: z.string().min(1).max(80).regex(/^[a-zA-Z0-9._-]+$/),
832
+ providers: z.array(z.object({
833
+ id: z.enum(["openai", "qwen", "gemini", "meta", "anthropic", "vertex"]),
834
+ defaultModel: modelId,
835
+ models: z.array(catalogModelSchema).min(1).max(500)
836
+ }).strict()).length(6)
837
+ }).strict().superRefine((catalog, ctx) => {
838
+ const invalid = (message) => ctx.addIssue({ code: "custom", message });
839
+ if (new Set(catalog.providers.map((p) => p.id)).size !== 6)
840
+ invalid("Duplicate providers");
841
+ for (const provider of catalog.providers) {
842
+ const ids = new Set(provider.models.map((m) => m.id));
843
+ if (ids.size !== provider.models.length)
844
+ invalid(`Duplicate models: ${provider.id}`);
845
+ const preferred = provider.models.find((m) => m.id === provider.defaultModel);
846
+ if (!preferred || preferred.group !== "primary" || preferred.lifecycle === "retired")
847
+ invalid(`Invalid default: ${provider.id}`);
848
+ for (const model of provider.models) {
849
+ if (model.group === "primary" && model.lifecycle === "retired")
850
+ invalid("Retired primary model");
851
+ if (model.replacement && (!ids.has(model.replacement) || model.replacement === model.id))
852
+ invalid("Invalid replacement");
853
+ }
854
+ }
855
+ });
856
+ var bundledModelCatalog = modelCatalogSchema.parse(catalog_default);
857
+ var bundledDefaultModel = (provider) => {
858
+ const entry = bundledModelCatalog.providers.find((p) => p.id === provider);
859
+ if (!entry)
860
+ throw new Error("UNKNOWN_CATALOG_PROVIDER");
861
+ return entry.defaultModel;
862
+ };
863
+ function catalogModels(catalog, provider, current) {
864
+ const models = [...catalog.providers.find((p) => p.id === provider)?.models ?? []].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
865
+ if (current && !models.some((m) => m.id === current))
866
+ models.unshift({
867
+ id: current,
868
+ name: current,
869
+ group: "other",
870
+ order: 0,
871
+ lifecycle: "unknown",
872
+ validation: "unverified",
873
+ capabilities: []
874
+ });
875
+ return models;
876
+ }
877
+ function modelDescription(model) {
878
+ return [
879
+ model.lifecycle === "deprecated" ? "In retirement" : model.lifecycle === "retired" ? "Retired" : "",
880
+ model.validation === "unverified" ? "Unverified" : "Verified in Zhivex",
881
+ model.limits ? `Context: ${model.limits.contextWindowTokens.toLocaleString("en-US")} tokens (${model.limits.contextWindowType}) · Output: ${model.limits.maxOutputTokens.toLocaleString("en-US")}` : "Context: unknown",
882
+ model.reason,
883
+ model.replacement ? `Suggested replacement: ${model.replacement}` : "",
884
+ model.retirementDate ? `Retirement: ${model.retirementDate}` : ""
885
+ ].filter(Boolean).join(" · ");
886
+ }
887
+
888
+ export { catalogModelSchema, modelCatalogSchema, bundledModelCatalog, bundledDefaultModel, catalogModels, modelDescription };