@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.
- package/CHANGELOG.md +53 -0
- package/README.md +12 -10
- package/SECURITY.md +1 -1
- package/SUPPORT.md +4 -4
- package/contracts/engine-api.json +334 -0
- package/contracts/public-api.json +267 -1
- package/contracts/stable-api-signatures.json +43 -43
- package/dist/acp-cli.js +54 -18
- package/dist/approvals/approval-history.d.ts +22 -0
- package/dist/approvals/explicit-review.d.ts +24 -0
- package/dist/approvals/host-policy-identity.d.ts +3 -0
- package/dist/cli/arguments.d.ts +6 -2
- package/dist/cli/checkpoints.d.ts +230 -0
- package/dist/cli/cli-profiles.d.ts +4 -2
- package/dist/cli/governance-report.d.ts +5 -0
- package/dist/cli/policy-decisions.d.ts +9 -0
- package/dist/cli/policy.d.ts +5 -0
- package/dist/cli/presentation.d.ts +3 -1
- package/dist/cli/terminal/terminal-ui.d.ts +4 -0
- package/dist/{cli-entry-xmf48p6a.js → cli-entry-1gfg3brj.js} +14921 -10692
- package/dist/cli-entry-bx3vjw7h.js +656 -0
- package/dist/{index-fvca1xea.js → cli-entry-d5788aay.js} +339 -58
- package/dist/{cli-qgwvtk0w.js → cli-etsmtst3.js} +918 -2222
- package/dist/cli.js +3 -5
- package/dist/client/acp-mcp-admission.d.ts +32 -0
- package/dist/client/acp-mcp-host.d.ts +19 -0
- package/dist/client/acp-mcp-session.d.ts +14 -0
- package/dist/client/acp-stdio.d.ts +2 -0
- package/dist/client/acp.d.ts +4 -1
- package/dist/client/adapter.d.ts +13 -1
- package/dist/client/json-contracts.d.ts +107 -4
- package/dist/client/local-service.d.ts +2 -0
- package/dist/client/protocol.d.ts +127 -1
- package/dist/client/service-events.d.ts +4 -0
- package/dist/compat/cli-options.d.ts +13 -1
- package/dist/compat/code-support.js +23 -87
- package/dist/{config-q32jm1e6.js → config-c002f06f.js} +1 -1
- package/dist/{config-6gtpxvjv.js → config-j3jga5wh.js} +3 -1
- package/dist/context/adaptive-compaction.d.ts +1 -0
- package/dist/context/compaction.d.ts +1 -1
- package/dist/context/request-measurements.d.ts +17 -0
- package/dist/context/request-projection.d.ts +10 -0
- package/dist/context/task-memory.d.ts +1 -0
- package/dist/engine/acp.d.ts +2 -0
- package/dist/engine/acp.js +197 -1
- package/dist/engine/client.js +11 -4
- package/dist/engine/desktop-providers-v1.d.ts +4 -0
- package/dist/engine/desktop-providers-v1.js +18 -0
- package/dist/engine/desktop-state-v1.d.ts +10 -0
- package/dist/engine/desktop-state-v1.js +168 -0
- package/dist/engine/index.d.ts +12 -0
- package/dist/engine/index.js +571 -71
- package/dist/engine/mcp-stdio-v1.d.ts +11 -0
- package/dist/engine/mcp-stdio-v1.js +108 -0
- package/dist/engine/models.d.ts +3 -0
- package/dist/engine/models.js +894 -0
- package/dist/engine/protocol.d.ts +1 -0
- package/dist/engine/protocol.js +24 -0
- package/dist/engine/service.js +12 -5
- package/dist/execution/acceptance-snapshot.d.ts +2 -0
- package/dist/execution/execution-environment.d.ts +10 -0
- package/dist/execution/mcp-oci-channel.d.ts +11 -0
- package/dist/execution/mcp-oci-server.d.ts +38 -0
- package/dist/execution/mcp-oci-workspace.d.ts +23 -0
- package/dist/execution/mcp-resource-recovery.d.ts +19 -0
- package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
- package/dist/hostile-repository-demo.js +3169 -1163
- package/dist/{index-f4sb0e2q.js → index-2jrdcj6b.js} +17 -2
- package/dist/{index-77h9qr5h.js → index-3ah1f369.js} +40 -10
- package/dist/{index-pgqz45fj.js → index-42gp2hy8.js} +197 -1091
- package/dist/{index-41fkzt91.js → index-4jw3tvy8.js} +10 -2
- package/dist/index-6m08wvab.js +1768 -0
- package/dist/index-8705zxpr.js +145 -0
- package/dist/{index-d0wrghff.js → index-8vm2m34s.js} +225 -1416
- package/dist/index-8zzhggxv.js +477 -0
- package/dist/index-a97bezbz.js +1073 -0
- package/dist/index-azmwjp95.js +1004 -0
- package/dist/{cli-entry-0mmeag20.js → index-gq9xagx2.js} +122 -836
- package/dist/index-h0mqx2ed.js +1373 -0
- package/dist/index-hnaxfpb5.js +5589 -0
- package/dist/{index-2aymdsqc.js → index-qfpz5y2v.js} +24 -0
- package/dist/{index-kfgt9yqq.js → index-w2sj0wkw.js} +33 -10
- package/dist/index-wg1sd3at.js +80 -0
- package/dist/index-xqxeypt5.js +888 -0
- package/dist/index-yb239ghk.js +961 -0
- package/dist/index-z0qxmkm2.js +3389 -0
- package/dist/index.js +85 -72
- package/dist/integrations/mcp-host-session.d.ts +26 -0
- package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
- package/dist/integrations/mcp-stdio-client.d.ts +44 -0
- package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
- package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
- package/dist/integrations/mcp-stdio-session.d.ts +7 -0
- package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
- package/dist/internal/desktop/catalog.d.ts +2 -0
- package/dist/internal/desktop/persistence.d.ts +2 -3
- package/dist/internal/desktop/providers.d.ts +1 -0
- package/dist/models/catalog.d.ts +2 -0
- package/dist/persistence/governance-context.d.ts +126 -0
- package/dist/persistence/governance-report.d.ts +299 -0
- package/dist/persistence/host-database-backup.d.ts +28 -0
- package/dist/persistence/mcp-execution-journal.d.ts +19 -0
- package/dist/persistence/mcp-reconciliation.d.ts +33 -0
- package/dist/persistence/mcp-resource-journal.d.ts +54 -0
- package/dist/persistence/workspace-checkpoints.d.ts +138 -0
- package/dist/providers/anthropic-continuation.d.ts +5 -0
- package/dist/providers/providers.d.ts +1 -1
- package/dist/providers/vertex-auth.d.ts +27 -0
- package/dist/runtime/delegation-contracts.d.ts +9 -0
- package/dist/runtime/delegation-correction.d.ts +9 -0
- package/dist/runtime/delegation-result.d.ts +73 -0
- package/dist/runtime/error-diagnostics.d.ts +86 -0
- package/dist/runtime/harness.d.ts +11 -1
- package/dist/runtime/policy-decisions.d.ts +66 -0
- package/dist/runtime/policy-inspection.d.ts +52 -0
- package/dist/runtime/provider-diagnostics.d.ts +1 -0
- package/dist/runtime/runtime-instructions.d.ts +8 -0
- package/dist/runtime/task-acceptance-checks.d.ts +103 -0
- package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
- package/dist/runtime/task-acceptance-host.d.ts +20 -0
- package/dist/runtime/task-acceptance-record.d.ts +107 -0
- package/dist/runtime/task-acceptance-validation.d.ts +25 -0
- package/dist/runtime/task-acceptance.d.ts +47 -0
- package/dist/runtime/time-to-safe-fix.d.ts +83 -0
- package/dist/runtime/tool-policy-file.d.ts +23 -0
- package/dist/runtime/tool-policy-paths.d.ts +5 -0
- package/dist/runtime/tool-policy.d.ts +6 -0
- package/dist/service-cli.js +14 -7
- package/dist/{service-client-cli-gs78wrxe.js → service-client-cli-3365rfav.js} +307 -248
- package/dist/verify-historical-migrations.js +3134 -1129
- package/dist/workspace/path-policy.d.ts +4 -0
- package/dist/zhx.js +3 -5
- package/docs/ACP.md +14 -2
- package/docs/ANTHROPIC.md +33 -0
- package/docs/CLI.md +132 -0
- package/docs/CLIENT_PROTOCOL.md +45 -0
- package/docs/CODE_RELEASE.md +35 -18
- package/docs/ENGINE_API.md +216 -7
- package/docs/EXTENSIBILITY.md +46 -3
- package/docs/FIRST_USE.md +6 -6
- package/docs/LOCAL_SERVICE.md +13 -0
- package/docs/MCP_STDIO.md +20 -0
- package/docs/README.md +1 -0
- package/docs/STABILITY.md +4 -2
- package/docs/SUPPORT_MATRIX.md +1 -1
- package/docs/TOOL_POLICY.md +81 -0
- package/docs/VERTEX.md +50 -0
- package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
- package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
- package/docs/support-matrix.json +2 -0
- package/evaluations/representative-assembly-matrix.json +46 -1
- package/evaluations/task-acceptance-routes.json +7 -0
- package/examples/README.md +3 -3
- package/package.json +43 -12
- package/dist/cli-entry-64pdp3k5.js +0 -17
- package/dist/cli-entry-7h9savv5.js +0 -375
- package/dist/index-5wjwe91x.js +0 -9434
|
@@ -1,9 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VERTEX_ENVIRONMENT,
|
|
3
|
+
createVertexModel,
|
|
4
|
+
vertexConfigured
|
|
5
|
+
} from "./index-8705zxpr.js";
|
|
6
|
+
import {
|
|
7
|
+
bundledDefaultModel
|
|
8
|
+
} from "./index-xqxeypt5.js";
|
|
9
|
+
|
|
1
10
|
// src/providers/reasoning.ts
|
|
2
|
-
import { z
|
|
3
|
-
import { wrapLanguageModel as
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
import { wrapLanguageModel as wrapLanguageModel5 } from "@zhivex-ai/core";
|
|
13
|
+
|
|
14
|
+
// src/providers/anthropic-continuation.ts
|
|
15
|
+
import { ValidationError, wrapLanguageModel } from "@zhivex-ai/core";
|
|
16
|
+
async function* assembleAnthropicContinuation(events) {
|
|
17
|
+
let pending;
|
|
18
|
+
let bytes = 0;
|
|
19
|
+
const invalid = () => new ValidationError("Invalid or oversized Anthropic signed continuation block.");
|
|
20
|
+
const flush = function* () {
|
|
21
|
+
if (!pending)
|
|
22
|
+
return;
|
|
23
|
+
if (!pending.signature)
|
|
24
|
+
throw invalid();
|
|
25
|
+
yield { type: "provider-data", provider: "anthropic", data: pending };
|
|
26
|
+
pending = undefined;
|
|
27
|
+
bytes = 0;
|
|
28
|
+
};
|
|
29
|
+
for await (const event of events) {
|
|
30
|
+
if (event.type === "provider-data" && event.provider === "anthropic" && event.data && typeof event.data === "object" && !Array.isArray(event.data)) {
|
|
31
|
+
const data = event.data;
|
|
32
|
+
if (data.type === "thinking_delta" || data.type === "signature_delta") {
|
|
33
|
+
const field = data.type === "thinking_delta" ? "thinking" : "signature";
|
|
34
|
+
if (!pending || typeof data[field] !== "string")
|
|
35
|
+
throw invalid();
|
|
36
|
+
bytes += Buffer.byteLength(data[field]);
|
|
37
|
+
if (bytes > 1024 * 1024)
|
|
38
|
+
throw invalid();
|
|
39
|
+
pending[field] += data[field];
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (data.type === "thinking") {
|
|
43
|
+
yield* flush();
|
|
44
|
+
if (typeof data.thinking !== "string" || typeof data.signature !== "string")
|
|
45
|
+
throw invalid();
|
|
46
|
+
pending = { type: "thinking", thinking: data.thinking, signature: data.signature };
|
|
47
|
+
bytes = Buffer.byteLength(data.thinking) + Buffer.byteLength(data.signature);
|
|
48
|
+
if (bytes > 1024 * 1024)
|
|
49
|
+
throw invalid();
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
yield* flush();
|
|
54
|
+
yield event;
|
|
55
|
+
}
|
|
56
|
+
yield* flush();
|
|
57
|
+
}
|
|
58
|
+
var withAnthropicContinuation = (model) => wrapLanguageModel(model, [{
|
|
59
|
+
name: "harness-anthropic-signed-continuation-v1",
|
|
60
|
+
wrapStream: async (_context, next) => assembleAnthropicContinuation(await next())
|
|
61
|
+
}]);
|
|
4
62
|
|
|
5
63
|
// src/providers/qwen-hosted-policy.ts
|
|
6
|
-
import { wrapLanguageModel } from "@zhivex-ai/core";
|
|
64
|
+
import { wrapLanguageModel as wrapLanguageModel2 } from "@zhivex-ai/core";
|
|
7
65
|
function withQwenHostedPolicy(model) {
|
|
8
66
|
if (model.modelId !== "kimi-k3")
|
|
9
67
|
return model;
|
|
@@ -16,7 +74,7 @@ function withQwenHostedPolicy(model) {
|
|
|
16
74
|
}
|
|
17
75
|
input.providerOptions = { ...options, apiMode: "chat", enable_thinking: true };
|
|
18
76
|
};
|
|
19
|
-
const wrapped =
|
|
77
|
+
const wrapped = wrapLanguageModel2(model, [{
|
|
20
78
|
name: "harness-kimi-k3-chat-thinking-v1",
|
|
21
79
|
async wrapGenerate(context, next) {
|
|
22
80
|
prepare(context.input);
|
|
@@ -98,7 +156,7 @@ var createMetaContinuationFetch = (fetcher = fetch, backoff = [1000, 2000]) => {
|
|
|
98
156
|
};
|
|
99
157
|
|
|
100
158
|
// src/providers/meta-replay.ts
|
|
101
|
-
import { wrapLanguageModel as
|
|
159
|
+
import { wrapLanguageModel as wrapLanguageModel3 } from "@zhivex-ai/core";
|
|
102
160
|
import { withTimeoutSignal } from "@zhivex-ai/core/provider";
|
|
103
161
|
import { createMeta } from "@zhivex-ai/meta";
|
|
104
162
|
var replayPlan = (messages) => {
|
|
@@ -165,7 +223,7 @@ var createMetaReplayModel = (options, modelId) => {
|
|
|
165
223
|
} }
|
|
166
224
|
};
|
|
167
225
|
};
|
|
168
|
-
return
|
|
226
|
+
return wrapLanguageModel3(createMeta(options)(modelId), [{
|
|
169
227
|
name: "harness-meta-stateless-replay-v1",
|
|
170
228
|
async wrapGenerate({ input }) {
|
|
171
229
|
const prepared = prepare(input);
|
|
@@ -252,835 +310,16 @@ function annotateMetaRequestError(error) {
|
|
|
252
310
|
throw error;
|
|
253
311
|
}
|
|
254
312
|
|
|
255
|
-
// src/models/catalog.ts
|
|
256
|
-
import { z } from "zod";
|
|
257
|
-
// src/models/catalog.json
|
|
258
|
-
var catalog_default = {
|
|
259
|
-
schemaVersion: 1,
|
|
260
|
-
revision: "2026-09-26-frontier",
|
|
261
|
-
providers: [
|
|
262
|
-
{
|
|
263
|
-
id: "openai",
|
|
264
|
-
defaultModel: "gpt-6-luna",
|
|
265
|
-
models: [
|
|
266
|
-
{
|
|
267
|
-
id: "gpt-6-astra",
|
|
268
|
-
name: "gpt-6-astra",
|
|
269
|
-
group: "primary",
|
|
270
|
-
order: 0,
|
|
271
|
-
lifecycle: "active",
|
|
272
|
-
validation: "unverified",
|
|
273
|
-
capabilities: [
|
|
274
|
-
"chat",
|
|
275
|
-
"tools"
|
|
276
|
-
],
|
|
277
|
-
limits: {
|
|
278
|
-
contextWindowTokens: 1050000,
|
|
279
|
-
contextWindowType: "combined",
|
|
280
|
-
maxOutputTokens: 128000,
|
|
281
|
-
evidence: {
|
|
282
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
|
|
283
|
-
checkedAt: "2026-09-24"
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
pricing: {
|
|
287
|
-
currency: "USD",
|
|
288
|
-
inputPerMillionTokens: 10,
|
|
289
|
-
outputPerMillionTokens: 50,
|
|
290
|
-
cachedInputPerMillionTokens: 1,
|
|
291
|
-
maxInputTokens: 272000,
|
|
292
|
-
scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
|
|
293
|
-
evidence: {
|
|
294
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
|
|
295
|
-
checkedAt: "2026-09-24"
|
|
296
|
-
}
|
|
297
|
-
},
|
|
298
|
-
compaction: {
|
|
299
|
-
suitability: "candidate",
|
|
300
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
301
|
-
evidence: {
|
|
302
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-astra",
|
|
303
|
-
checkedAt: "2026-09-24"
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
id: "gpt-6-sol",
|
|
309
|
-
name: "gpt-6-sol",
|
|
310
|
-
group: "primary",
|
|
311
|
-
order: 1,
|
|
312
|
-
lifecycle: "active",
|
|
313
|
-
validation: "unverified",
|
|
314
|
-
capabilities: [
|
|
315
|
-
"chat",
|
|
316
|
-
"tools",
|
|
317
|
-
"vision"
|
|
318
|
-
],
|
|
319
|
-
limits: {
|
|
320
|
-
contextWindowTokens: 1050000,
|
|
321
|
-
contextWindowType: "combined",
|
|
322
|
-
maxOutputTokens: 128000,
|
|
323
|
-
evidence: {
|
|
324
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
|
|
325
|
-
checkedAt: "2026-09-24"
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
pricing: {
|
|
329
|
-
currency: "USD",
|
|
330
|
-
inputPerMillionTokens: 2,
|
|
331
|
-
outputPerMillionTokens: 10,
|
|
332
|
-
cachedInputPerMillionTokens: 0.2,
|
|
333
|
-
maxInputTokens: 272000,
|
|
334
|
-
scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
|
|
335
|
-
evidence: {
|
|
336
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
|
|
337
|
-
checkedAt: "2026-09-24"
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
compaction: {
|
|
341
|
-
suitability: "candidate",
|
|
342
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
343
|
-
evidence: {
|
|
344
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-sol",
|
|
345
|
-
checkedAt: "2026-09-24"
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
id: "gpt-6-luna",
|
|
351
|
-
name: "gpt-6-luna",
|
|
352
|
-
group: "primary",
|
|
353
|
-
order: 2,
|
|
354
|
-
lifecycle: "active",
|
|
355
|
-
validation: "unverified",
|
|
356
|
-
capabilities: [
|
|
357
|
-
"chat",
|
|
358
|
-
"tools",
|
|
359
|
-
"vision"
|
|
360
|
-
],
|
|
361
|
-
limits: {
|
|
362
|
-
contextWindowTokens: 1050000,
|
|
363
|
-
contextWindowType: "combined",
|
|
364
|
-
maxOutputTokens: 128000,
|
|
365
|
-
evidence: {
|
|
366
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
|
|
367
|
-
checkedAt: "2026-09-24"
|
|
368
|
-
}
|
|
369
|
-
},
|
|
370
|
-
pricing: {
|
|
371
|
-
currency: "USD",
|
|
372
|
-
inputPerMillionTokens: 0.1,
|
|
373
|
-
outputPerMillionTokens: 0.5,
|
|
374
|
-
cachedInputPerMillionTokens: 0.01,
|
|
375
|
-
maxInputTokens: 272000,
|
|
376
|
-
scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
|
|
377
|
-
evidence: {
|
|
378
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
|
|
379
|
-
checkedAt: "2026-09-24"
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
compaction: {
|
|
383
|
-
suitability: "candidate",
|
|
384
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
385
|
-
evidence: {
|
|
386
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-6-luna",
|
|
387
|
-
checkedAt: "2026-09-24"
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
id: "gpt-5.6-sol",
|
|
393
|
-
name: "gpt-5.6-sol",
|
|
394
|
-
group: "other",
|
|
395
|
-
order: 3,
|
|
396
|
-
lifecycle: "unknown",
|
|
397
|
-
validation: "unverified",
|
|
398
|
-
capabilities: [
|
|
399
|
-
"chat",
|
|
400
|
-
"tools"
|
|
401
|
-
]
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
id: "gpt-5.6-terra",
|
|
405
|
-
name: "gpt-5.6-terra",
|
|
406
|
-
group: "other",
|
|
407
|
-
order: 4,
|
|
408
|
-
lifecycle: "unknown",
|
|
409
|
-
validation: "unverified",
|
|
410
|
-
capabilities: [
|
|
411
|
-
"chat",
|
|
412
|
-
"tools"
|
|
413
|
-
]
|
|
414
|
-
},
|
|
415
|
-
{
|
|
416
|
-
id: "gpt-5.6-luna",
|
|
417
|
-
name: "gpt-5.6-luna",
|
|
418
|
-
group: "other",
|
|
419
|
-
order: 5,
|
|
420
|
-
lifecycle: "unknown",
|
|
421
|
-
validation: "unverified",
|
|
422
|
-
capabilities: [
|
|
423
|
-
"chat",
|
|
424
|
-
"tools"
|
|
425
|
-
]
|
|
426
|
-
},
|
|
427
|
-
{
|
|
428
|
-
id: "gpt-5.5",
|
|
429
|
-
name: "gpt-5.5",
|
|
430
|
-
group: "other",
|
|
431
|
-
order: 6,
|
|
432
|
-
lifecycle: "unknown",
|
|
433
|
-
validation: "unverified",
|
|
434
|
-
capabilities: [
|
|
435
|
-
"chat",
|
|
436
|
-
"tools"
|
|
437
|
-
],
|
|
438
|
-
reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
|
|
439
|
-
},
|
|
440
|
-
{
|
|
441
|
-
id: "gpt-5.4",
|
|
442
|
-
name: "gpt-5.4",
|
|
443
|
-
group: "other",
|
|
444
|
-
order: 7,
|
|
445
|
-
lifecycle: "unknown",
|
|
446
|
-
validation: "unverified",
|
|
447
|
-
capabilities: [
|
|
448
|
-
"chat",
|
|
449
|
-
"tools"
|
|
450
|
-
],
|
|
451
|
-
reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
id: "gpt-5.4-mini",
|
|
455
|
-
name: "gpt-5.4-mini",
|
|
456
|
-
group: "other",
|
|
457
|
-
order: 8,
|
|
458
|
-
lifecycle: "unknown",
|
|
459
|
-
validation: "unverified",
|
|
460
|
-
capabilities: [
|
|
461
|
-
"chat",
|
|
462
|
-
"tools"
|
|
463
|
-
],
|
|
464
|
-
reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices."
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
id: "gpt-4o-mini",
|
|
468
|
-
name: "gpt-4o-mini",
|
|
469
|
-
group: "other",
|
|
470
|
-
order: 9,
|
|
471
|
-
lifecycle: "unknown",
|
|
472
|
-
validation: "unverified",
|
|
473
|
-
capabilities: [
|
|
474
|
-
"chat",
|
|
475
|
-
"tools"
|
|
476
|
-
],
|
|
477
|
-
reason: "Earlier generation; GPT-6 and GPT-5.6 are the current primary choices.",
|
|
478
|
-
limits: {
|
|
479
|
-
contextWindowTokens: 128000,
|
|
480
|
-
contextWindowType: "combined",
|
|
481
|
-
maxOutputTokens: 16384,
|
|
482
|
-
evidence: {
|
|
483
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
|
|
484
|
-
checkedAt: "2026-09-24"
|
|
485
|
-
}
|
|
486
|
-
},
|
|
487
|
-
pricing: {
|
|
488
|
-
currency: "USD",
|
|
489
|
-
inputPerMillionTokens: 0.15,
|
|
490
|
-
outputPerMillionTokens: 0.6,
|
|
491
|
-
cachedInputPerMillionTokens: 0.075,
|
|
492
|
-
scope: "Standard text tokens; excludes regional, mode, cache-write and tool charges.",
|
|
493
|
-
evidence: {
|
|
494
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
|
|
495
|
-
checkedAt: "2026-09-24"
|
|
496
|
-
}
|
|
497
|
-
},
|
|
498
|
-
compaction: {
|
|
499
|
-
suitability: "candidate",
|
|
500
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
501
|
-
evidence: {
|
|
502
|
-
sourceUrl: "https://developers.openai.com/api/docs/models/gpt-4o-mini",
|
|
503
|
-
checkedAt: "2026-09-24"
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
]
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
id: "qwen",
|
|
511
|
-
defaultModel: "qwen3.8-max",
|
|
512
|
-
models: [
|
|
513
|
-
{
|
|
514
|
-
id: "qwen3.8-flash",
|
|
515
|
-
name: "qwen3.8-flash",
|
|
516
|
-
group: "primary",
|
|
517
|
-
order: 0,
|
|
518
|
-
lifecycle: "unknown",
|
|
519
|
-
validation: "unverified",
|
|
520
|
-
capabilities: [
|
|
521
|
-
"chat",
|
|
522
|
-
"tools"
|
|
523
|
-
],
|
|
524
|
-
limits: {
|
|
525
|
-
contextWindowTokens: 1e6,
|
|
526
|
-
contextWindowType: "combined",
|
|
527
|
-
maxOutputTokens: 131072,
|
|
528
|
-
maxInputTokens: 983616,
|
|
529
|
-
evidence: {
|
|
530
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
|
|
531
|
-
checkedAt: "2026-09-24"
|
|
532
|
-
}
|
|
533
|
-
},
|
|
534
|
-
compaction: {
|
|
535
|
-
suitability: "candidate",
|
|
536
|
-
reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
|
|
537
|
-
evidence: {
|
|
538
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
|
|
539
|
-
checkedAt: "2026-09-24"
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
id: "qwen3.8-max",
|
|
545
|
-
name: "qwen3.8-max",
|
|
546
|
-
group: "primary",
|
|
547
|
-
order: 1,
|
|
548
|
-
lifecycle: "unknown",
|
|
549
|
-
validation: "unverified",
|
|
550
|
-
capabilities: [
|
|
551
|
-
"chat",
|
|
552
|
-
"tools"
|
|
553
|
-
],
|
|
554
|
-
limits: {
|
|
555
|
-
contextWindowTokens: 1e6,
|
|
556
|
-
contextWindowType: "combined",
|
|
557
|
-
maxOutputTokens: 131072,
|
|
558
|
-
maxInputTokens: 983616,
|
|
559
|
-
evidence: {
|
|
560
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
|
|
561
|
-
checkedAt: "2026-09-24"
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
compaction: {
|
|
565
|
-
suitability: "candidate",
|
|
566
|
-
reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
|
|
567
|
-
evidence: {
|
|
568
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
|
|
569
|
-
checkedAt: "2026-09-24"
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
},
|
|
573
|
-
{
|
|
574
|
-
id: "glm-5.3",
|
|
575
|
-
name: "GLM 5.3",
|
|
576
|
-
group: "primary",
|
|
577
|
-
order: 2,
|
|
578
|
-
lifecycle: "active",
|
|
579
|
-
validation: "unverified",
|
|
580
|
-
capabilities: [
|
|
581
|
-
"chat",
|
|
582
|
-
"tools"
|
|
583
|
-
],
|
|
584
|
-
reason: "Zhipu model served by Alibaba Model Studio; region and account access vary"
|
|
585
|
-
},
|
|
586
|
-
{
|
|
587
|
-
id: "deepseek-v4.1-flash",
|
|
588
|
-
name: "DeepSeek V4.1 Flash",
|
|
589
|
-
group: "primary",
|
|
590
|
-
order: 3,
|
|
591
|
-
lifecycle: "active",
|
|
592
|
-
validation: "unverified",
|
|
593
|
-
capabilities: [
|
|
594
|
-
"chat",
|
|
595
|
-
"tools",
|
|
596
|
-
"vision"
|
|
597
|
-
],
|
|
598
|
-
reason: "DeepSeek model served by Alibaba Model Studio; region and account access vary"
|
|
599
|
-
},
|
|
600
|
-
{
|
|
601
|
-
id: "kimi-k3",
|
|
602
|
-
name: "Kimi K3",
|
|
603
|
-
group: "primary",
|
|
604
|
-
order: 4,
|
|
605
|
-
lifecycle: "active",
|
|
606
|
-
validation: "unverified",
|
|
607
|
-
capabilities: [
|
|
608
|
-
"chat",
|
|
609
|
-
"tools",
|
|
610
|
-
"vision"
|
|
611
|
-
],
|
|
612
|
-
reason: "Moonshot model served by Alibaba Model Studio; region and account access vary"
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
id: "qwen3.7-plus",
|
|
616
|
-
name: "qwen3.7-plus",
|
|
617
|
-
group: "primary",
|
|
618
|
-
order: 5,
|
|
619
|
-
lifecycle: "unknown",
|
|
620
|
-
validation: "unverified",
|
|
621
|
-
capabilities: [
|
|
622
|
-
"chat",
|
|
623
|
-
"tools"
|
|
624
|
-
]
|
|
625
|
-
},
|
|
626
|
-
{
|
|
627
|
-
id: "qwen3.8-omni-flash",
|
|
628
|
-
name: "qwen3.8-omni-flash",
|
|
629
|
-
group: "other",
|
|
630
|
-
order: 6,
|
|
631
|
-
lifecycle: "unknown",
|
|
632
|
-
validation: "unverified",
|
|
633
|
-
capabilities: [
|
|
634
|
-
"chat",
|
|
635
|
-
"tools"
|
|
636
|
-
]
|
|
637
|
-
},
|
|
638
|
-
{
|
|
639
|
-
id: "qwen3.8-max-0902",
|
|
640
|
-
name: "qwen3.8-max-0902",
|
|
641
|
-
group: "other",
|
|
642
|
-
order: 7,
|
|
643
|
-
lifecycle: "unknown",
|
|
644
|
-
validation: "unverified",
|
|
645
|
-
capabilities: [
|
|
646
|
-
"chat",
|
|
647
|
-
"tools"
|
|
648
|
-
]
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
id: "qwen3.8-max-preview",
|
|
652
|
-
name: "qwen3.8-max-preview",
|
|
653
|
-
group: "other",
|
|
654
|
-
order: 8,
|
|
655
|
-
lifecycle: "unknown",
|
|
656
|
-
validation: "unverified",
|
|
657
|
-
capabilities: [
|
|
658
|
-
"chat",
|
|
659
|
-
"tools"
|
|
660
|
-
]
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
id: "qwen3.7-max",
|
|
664
|
-
name: "qwen3.7-max",
|
|
665
|
-
group: "other",
|
|
666
|
-
order: 9,
|
|
667
|
-
lifecycle: "unknown",
|
|
668
|
-
validation: "unverified",
|
|
669
|
-
capabilities: [
|
|
670
|
-
"chat",
|
|
671
|
-
"tools"
|
|
672
|
-
]
|
|
673
|
-
},
|
|
674
|
-
{
|
|
675
|
-
id: "qwen3.6-flash",
|
|
676
|
-
name: "qwen3.6-flash",
|
|
677
|
-
group: "other",
|
|
678
|
-
order: 10,
|
|
679
|
-
lifecycle: "unknown",
|
|
680
|
-
validation: "unverified",
|
|
681
|
-
capabilities: [
|
|
682
|
-
"chat",
|
|
683
|
-
"tools"
|
|
684
|
-
]
|
|
685
|
-
},
|
|
686
|
-
{
|
|
687
|
-
id: "qwen3.5-omni-plus",
|
|
688
|
-
name: "qwen3.5-omni-plus",
|
|
689
|
-
group: "other",
|
|
690
|
-
order: 11,
|
|
691
|
-
lifecycle: "unknown",
|
|
692
|
-
validation: "unverified",
|
|
693
|
-
capabilities: [
|
|
694
|
-
"chat",
|
|
695
|
-
"tools"
|
|
696
|
-
]
|
|
697
|
-
},
|
|
698
|
-
{
|
|
699
|
-
id: "qwen-plus",
|
|
700
|
-
name: "qwen-plus",
|
|
701
|
-
group: "other",
|
|
702
|
-
order: 12,
|
|
703
|
-
lifecycle: "unknown",
|
|
704
|
-
validation: "unverified",
|
|
705
|
-
capabilities: [
|
|
706
|
-
"chat",
|
|
707
|
-
"tools"
|
|
708
|
-
]
|
|
709
|
-
}
|
|
710
|
-
]
|
|
711
|
-
},
|
|
712
|
-
{
|
|
713
|
-
id: "gemini",
|
|
714
|
-
defaultModel: "gemini-3.6-flash",
|
|
715
|
-
models: [
|
|
716
|
-
{
|
|
717
|
-
id: "gemini-3.8-flash",
|
|
718
|
-
name: "gemini-3.8-flash",
|
|
719
|
-
group: "other",
|
|
720
|
-
order: 0,
|
|
721
|
-
lifecycle: "unknown",
|
|
722
|
-
validation: "unverified",
|
|
723
|
-
capabilities: [
|
|
724
|
-
"chat",
|
|
725
|
-
"tools"
|
|
726
|
-
],
|
|
727
|
-
limits: {
|
|
728
|
-
contextWindowTokens: 1048576,
|
|
729
|
-
contextWindowType: "input",
|
|
730
|
-
maxOutputTokens: 65536,
|
|
731
|
-
evidence: {
|
|
732
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash",
|
|
733
|
-
checkedAt: "2026-09-24"
|
|
734
|
-
}
|
|
735
|
-
},
|
|
736
|
-
compaction: {
|
|
737
|
-
suitability: "candidate",
|
|
738
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
739
|
-
evidence: {
|
|
740
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.8-flash",
|
|
741
|
-
checkedAt: "2026-09-24"
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
},
|
|
745
|
-
{
|
|
746
|
-
id: "gemini-3.7-flash",
|
|
747
|
-
name: "gemini-3.7-flash",
|
|
748
|
-
group: "other",
|
|
749
|
-
order: 1,
|
|
750
|
-
lifecycle: "unknown",
|
|
751
|
-
validation: "unverified",
|
|
752
|
-
capabilities: [
|
|
753
|
-
"chat",
|
|
754
|
-
"tools"
|
|
755
|
-
],
|
|
756
|
-
limits: {
|
|
757
|
-
contextWindowTokens: 1048576,
|
|
758
|
-
contextWindowType: "input",
|
|
759
|
-
maxOutputTokens: 65536,
|
|
760
|
-
evidence: {
|
|
761
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash",
|
|
762
|
-
checkedAt: "2026-09-24"
|
|
763
|
-
}
|
|
764
|
-
},
|
|
765
|
-
compaction: {
|
|
766
|
-
suitability: "candidate",
|
|
767
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
768
|
-
evidence: {
|
|
769
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.7-flash",
|
|
770
|
-
checkedAt: "2026-09-24"
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
},
|
|
774
|
-
{
|
|
775
|
-
id: "gemini-3.6-flash",
|
|
776
|
-
name: "gemini-3.6-flash",
|
|
777
|
-
group: "primary",
|
|
778
|
-
order: 2,
|
|
779
|
-
lifecycle: "unknown",
|
|
780
|
-
validation: "unverified",
|
|
781
|
-
capabilities: [
|
|
782
|
-
"chat",
|
|
783
|
-
"tools"
|
|
784
|
-
],
|
|
785
|
-
limits: {
|
|
786
|
-
contextWindowTokens: 1048576,
|
|
787
|
-
contextWindowType: "input",
|
|
788
|
-
maxOutputTokens: 65536,
|
|
789
|
-
evidence: {
|
|
790
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.6-flash",
|
|
791
|
-
checkedAt: "2026-09-24"
|
|
792
|
-
}
|
|
793
|
-
},
|
|
794
|
-
compaction: {
|
|
795
|
-
suitability: "candidate",
|
|
796
|
-
reason: "Editorial candidate based on documented text generation and token limits; summary fidelity has not been benchmarked.",
|
|
797
|
-
evidence: {
|
|
798
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.6-flash",
|
|
799
|
-
checkedAt: "2026-09-24"
|
|
800
|
-
}
|
|
801
|
-
}
|
|
802
|
-
},
|
|
803
|
-
{
|
|
804
|
-
id: "gemini-3.5-flash-lite",
|
|
805
|
-
name: "gemini-3.5-flash-lite",
|
|
806
|
-
group: "other",
|
|
807
|
-
order: 3,
|
|
808
|
-
lifecycle: "unknown",
|
|
809
|
-
validation: "unverified",
|
|
810
|
-
capabilities: [
|
|
811
|
-
"chat",
|
|
812
|
-
"tools"
|
|
813
|
-
],
|
|
814
|
-
limits: {
|
|
815
|
-
contextWindowTokens: 1048576,
|
|
816
|
-
contextWindowType: "input",
|
|
817
|
-
maxOutputTokens: 65536,
|
|
818
|
-
evidence: {
|
|
819
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash-lite",
|
|
820
|
-
checkedAt: "2026-09-24"
|
|
821
|
-
}
|
|
822
|
-
},
|
|
823
|
-
compaction: {
|
|
824
|
-
suitability: "candidate",
|
|
825
|
-
reason: "Editorial candidate based on documented document parsing and text generation; summary fidelity has not been benchmarked.",
|
|
826
|
-
evidence: {
|
|
827
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/models/gemini-3.5-flash-lite",
|
|
828
|
-
checkedAt: "2026-09-24"
|
|
829
|
-
}
|
|
830
|
-
},
|
|
831
|
-
pricing: {
|
|
832
|
-
currency: "USD",
|
|
833
|
-
inputPerMillionTokens: 0.3,
|
|
834
|
-
outputPerMillionTokens: 2.5,
|
|
835
|
-
cachedInputPerMillionTokens: 0.03,
|
|
836
|
-
scope: "Standard paid-tier text tokens; includes output thinking tokens, excludes cache storage and tool charges.",
|
|
837
|
-
evidence: {
|
|
838
|
-
sourceUrl: "https://ai.google.dev/gemini-api/docs/pricing#gemini-3.5-flash-lite",
|
|
839
|
-
checkedAt: "2026-09-24"
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
{
|
|
844
|
-
id: "gemini-3.5-flash",
|
|
845
|
-
name: "gemini-3.5-flash",
|
|
846
|
-
group: "other",
|
|
847
|
-
order: 4,
|
|
848
|
-
lifecycle: "unknown",
|
|
849
|
-
validation: "unverified",
|
|
850
|
-
capabilities: [
|
|
851
|
-
"chat",
|
|
852
|
-
"tools"
|
|
853
|
-
]
|
|
854
|
-
},
|
|
855
|
-
{
|
|
856
|
-
id: "gemini-3.1-pro-preview",
|
|
857
|
-
name: "gemini-3.1-pro-preview",
|
|
858
|
-
group: "other",
|
|
859
|
-
order: 5,
|
|
860
|
-
lifecycle: "unknown",
|
|
861
|
-
validation: "unverified",
|
|
862
|
-
capabilities: [
|
|
863
|
-
"chat",
|
|
864
|
-
"tools"
|
|
865
|
-
]
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
id: "gemini-3.1-pro-preview-customtools",
|
|
869
|
-
name: "gemini-3.1-pro-preview-customtools",
|
|
870
|
-
group: "other",
|
|
871
|
-
order: 6,
|
|
872
|
-
lifecycle: "unknown",
|
|
873
|
-
validation: "unverified",
|
|
874
|
-
capabilities: [
|
|
875
|
-
"chat",
|
|
876
|
-
"tools"
|
|
877
|
-
]
|
|
878
|
-
},
|
|
879
|
-
{
|
|
880
|
-
id: "gemini-3-flash-preview",
|
|
881
|
-
name: "gemini-3-flash-preview",
|
|
882
|
-
group: "other",
|
|
883
|
-
order: 7,
|
|
884
|
-
lifecycle: "unknown",
|
|
885
|
-
validation: "unverified",
|
|
886
|
-
capabilities: [
|
|
887
|
-
"chat",
|
|
888
|
-
"tools"
|
|
889
|
-
]
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
id: "gemini-3.1-flash-lite",
|
|
893
|
-
name: "gemini-3.1-flash-lite",
|
|
894
|
-
group: "other",
|
|
895
|
-
order: 8,
|
|
896
|
-
lifecycle: "unknown",
|
|
897
|
-
validation: "unverified",
|
|
898
|
-
capabilities: [
|
|
899
|
-
"chat",
|
|
900
|
-
"tools"
|
|
901
|
-
]
|
|
902
|
-
}
|
|
903
|
-
]
|
|
904
|
-
},
|
|
905
|
-
{
|
|
906
|
-
id: "meta",
|
|
907
|
-
defaultModel: "muse-spark-1.3",
|
|
908
|
-
models: [
|
|
909
|
-
{
|
|
910
|
-
id: "muse-spark-1.3",
|
|
911
|
-
name: "muse-spark-1.3",
|
|
912
|
-
group: "primary",
|
|
913
|
-
order: 0,
|
|
914
|
-
lifecycle: "active",
|
|
915
|
-
validation: "unverified",
|
|
916
|
-
capabilities: [
|
|
917
|
-
"chat",
|
|
918
|
-
"tools"
|
|
919
|
-
]
|
|
920
|
-
},
|
|
921
|
-
{
|
|
922
|
-
id: "muse-spark-1.2",
|
|
923
|
-
name: "muse-spark-1.2",
|
|
924
|
-
group: "primary",
|
|
925
|
-
order: 1,
|
|
926
|
-
lifecycle: "unknown",
|
|
927
|
-
validation: "unverified",
|
|
928
|
-
capabilities: [
|
|
929
|
-
"chat",
|
|
930
|
-
"tools"
|
|
931
|
-
]
|
|
932
|
-
},
|
|
933
|
-
{
|
|
934
|
-
id: "muse-spark-1.2-contributor",
|
|
935
|
-
name: "muse-spark-1.2-contributor",
|
|
936
|
-
group: "other",
|
|
937
|
-
order: 2,
|
|
938
|
-
lifecycle: "unknown",
|
|
939
|
-
validation: "unverified",
|
|
940
|
-
capabilities: [
|
|
941
|
-
"chat",
|
|
942
|
-
"tools"
|
|
943
|
-
]
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
id: "muse-spark-1.1",
|
|
947
|
-
name: "muse-spark-1.1",
|
|
948
|
-
group: "other",
|
|
949
|
-
order: 3,
|
|
950
|
-
lifecycle: "unknown",
|
|
951
|
-
validation: "unverified",
|
|
952
|
-
capabilities: [
|
|
953
|
-
"chat",
|
|
954
|
-
"tools"
|
|
955
|
-
]
|
|
956
|
-
}
|
|
957
|
-
]
|
|
958
|
-
}
|
|
959
|
-
]
|
|
960
|
-
};
|
|
961
|
-
|
|
962
|
-
// src/models/catalog.ts
|
|
963
|
-
var modelId = z.string().min(1).max(160).regex(/^[a-zA-Z0-9][a-zA-Z0-9._:/-]*$/);
|
|
964
|
-
var text = z.string().min(1).max(300).regex(/^[^\x00-\x1f\x7f-\x9f]*$/);
|
|
965
|
-
var evidence = z.object({
|
|
966
|
-
sourceUrl: z.url().max(1000).refine((value) => {
|
|
967
|
-
const url = new URL(value);
|
|
968
|
-
return url.protocol === "https:" && !url.username && !url.password;
|
|
969
|
-
}, "Evidence requires an HTTPS URL without credentials"),
|
|
970
|
-
checkedAt: z.iso.date()
|
|
971
|
-
}).strict();
|
|
972
|
-
var tokenLimit = z.number().int().positive().max(1e9);
|
|
973
|
-
var price = z.number().finite().nonnegative().max(1e6);
|
|
974
|
-
var catalogModelSchema = z.object({
|
|
975
|
-
id: modelId,
|
|
976
|
-
name: text,
|
|
977
|
-
group: z.enum(["primary", "other"]),
|
|
978
|
-
order: z.number().int().min(0),
|
|
979
|
-
lifecycle: z.enum(["active", "deprecated", "retired", "unknown"]),
|
|
980
|
-
validation: z.enum(["verified", "unverified"]),
|
|
981
|
-
capabilities: z.array(z.enum(["chat", "tools", "vision"])).max(3),
|
|
982
|
-
reason: text.optional(),
|
|
983
|
-
replacement: modelId.optional(),
|
|
984
|
-
retirementDate: z.iso.date().optional(),
|
|
985
|
-
limits: z.object({
|
|
986
|
-
contextWindowTokens: tokenLimit,
|
|
987
|
-
contextWindowType: z.enum(["combined", "input"]),
|
|
988
|
-
maxOutputTokens: tokenLimit,
|
|
989
|
-
maxInputTokens: tokenLimit.optional(),
|
|
990
|
-
evidence
|
|
991
|
-
}).strict().optional(),
|
|
992
|
-
pricing: z.object({
|
|
993
|
-
currency: z.literal("USD"),
|
|
994
|
-
inputPerMillionTokens: price,
|
|
995
|
-
outputPerMillionTokens: price,
|
|
996
|
-
cachedInputPerMillionTokens: price.optional(),
|
|
997
|
-
maxInputTokens: tokenLimit.optional(),
|
|
998
|
-
scope: text,
|
|
999
|
-
evidence
|
|
1000
|
-
}).strict().optional(),
|
|
1001
|
-
compaction: z.object({
|
|
1002
|
-
suitability: z.enum(["candidate", "evaluated", "unsuitable", "unknown"]),
|
|
1003
|
-
reason: text,
|
|
1004
|
-
evidence
|
|
1005
|
-
}).strict().optional()
|
|
1006
|
-
}).strict().superRefine((model, ctx) => {
|
|
1007
|
-
if (!model.limits)
|
|
1008
|
-
return;
|
|
1009
|
-
if (model.limits.maxInputTokens !== undefined && model.limits.maxInputTokens > model.limits.contextWindowTokens) {
|
|
1010
|
-
ctx.addIssue({ code: "custom", message: "maxInputTokens exceeds context window" });
|
|
1011
|
-
}
|
|
1012
|
-
if (model.limits.contextWindowType === "combined" && model.limits.maxOutputTokens > model.limits.contextWindowTokens) {
|
|
1013
|
-
ctx.addIssue({ code: "custom", message: "maxOutputTokens exceeds combined context window" });
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
var modelCatalogSchema = z.object({
|
|
1017
|
-
schemaVersion: z.literal(1),
|
|
1018
|
-
revision: z.string().min(1).max(80).regex(/^[a-zA-Z0-9._-]+$/),
|
|
1019
|
-
providers: z.array(z.object({
|
|
1020
|
-
id: z.enum(["openai", "qwen", "gemini", "meta"]),
|
|
1021
|
-
defaultModel: modelId,
|
|
1022
|
-
models: z.array(catalogModelSchema).min(1).max(500)
|
|
1023
|
-
}).strict()).length(4)
|
|
1024
|
-
}).strict().superRefine((catalog, ctx) => {
|
|
1025
|
-
const invalid = (message) => ctx.addIssue({ code: "custom", message });
|
|
1026
|
-
if (new Set(catalog.providers.map((p) => p.id)).size !== 4)
|
|
1027
|
-
invalid("Duplicate providers");
|
|
1028
|
-
for (const provider of catalog.providers) {
|
|
1029
|
-
const ids = new Set(provider.models.map((m) => m.id));
|
|
1030
|
-
if (ids.size !== provider.models.length)
|
|
1031
|
-
invalid(`Duplicate models: ${provider.id}`);
|
|
1032
|
-
const preferred = provider.models.find((m) => m.id === provider.defaultModel);
|
|
1033
|
-
if (!preferred || preferred.group !== "primary" || preferred.lifecycle === "retired")
|
|
1034
|
-
invalid(`Invalid default: ${provider.id}`);
|
|
1035
|
-
for (const model of provider.models) {
|
|
1036
|
-
if (model.group === "primary" && model.lifecycle === "retired")
|
|
1037
|
-
invalid("Retired primary model");
|
|
1038
|
-
if (model.replacement && (!ids.has(model.replacement) || model.replacement === model.id))
|
|
1039
|
-
invalid("Invalid replacement");
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
});
|
|
1043
|
-
var bundledModelCatalog = modelCatalogSchema.parse(catalog_default);
|
|
1044
|
-
var bundledDefaultModel = (provider) => {
|
|
1045
|
-
const entry = bundledModelCatalog.providers.find((p) => p.id === provider);
|
|
1046
|
-
if (!entry)
|
|
1047
|
-
throw new Error("UNKNOWN_CATALOG_PROVIDER");
|
|
1048
|
-
return entry.defaultModel;
|
|
1049
|
-
};
|
|
1050
|
-
function catalogModels(catalog, provider, current) {
|
|
1051
|
-
const models = [...catalog.providers.find((p) => p.id === provider)?.models ?? []].sort((a, b) => a.order - b.order || a.id.localeCompare(b.id));
|
|
1052
|
-
if (current && !models.some((m) => m.id === current))
|
|
1053
|
-
models.unshift({
|
|
1054
|
-
id: current,
|
|
1055
|
-
name: current,
|
|
1056
|
-
group: "other",
|
|
1057
|
-
order: 0,
|
|
1058
|
-
lifecycle: "unknown",
|
|
1059
|
-
validation: "unverified",
|
|
1060
|
-
capabilities: []
|
|
1061
|
-
});
|
|
1062
|
-
return models;
|
|
1063
|
-
}
|
|
1064
|
-
function modelDescription(model) {
|
|
1065
|
-
return [
|
|
1066
|
-
model.lifecycle === "deprecated" ? "In retirement" : model.lifecycle === "retired" ? "Retired" : "",
|
|
1067
|
-
model.validation === "unverified" ? "Unverified" : "Verified in Zhivex",
|
|
1068
|
-
model.limits ? `Context: ${model.limits.contextWindowTokens.toLocaleString("en-US")} tokens (${model.limits.contextWindowType}) · Output: ${model.limits.maxOutputTokens.toLocaleString("en-US")}` : "Context: unknown",
|
|
1069
|
-
model.reason,
|
|
1070
|
-
model.replacement ? `Suggested replacement: ${model.replacement}` : "",
|
|
1071
|
-
model.retirementDate ? `Retirement: ${model.retirementDate}` : ""
|
|
1072
|
-
].filter(Boolean).join(" · ");
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1075
313
|
// src/providers/providers.ts
|
|
1076
314
|
import { createHash } from "node:crypto";
|
|
1077
315
|
import {
|
|
1078
|
-
wrapLanguageModel as
|
|
316
|
+
wrapLanguageModel as wrapLanguageModel4
|
|
1079
317
|
} from "@zhivex-ai/core";
|
|
318
|
+
import { createAnthropic } from "@zhivex-ai/anthropic";
|
|
1080
319
|
import { createGemini } from "@zhivex-ai/gemini";
|
|
1081
320
|
import { createOpenAI } from "@zhivex-ai/openai";
|
|
1082
321
|
import { createQwen } from "@zhivex-ai/qwen";
|
|
1083
|
-
var PROVIDERS = ["meta", "qwen", "openai", "gemini"];
|
|
322
|
+
var PROVIDERS = ["meta", "qwen", "openai", "gemini", "anthropic", "vertex"];
|
|
1084
323
|
var HARNESS_PROVIDER_CAPABILITIES = [
|
|
1085
324
|
"streaming",
|
|
1086
325
|
"tool-calling",
|
|
@@ -1299,13 +538,13 @@ var createProviderRegistry = (registrations) => {
|
|
|
1299
538
|
const credentials = Object.freeze(registration.descriptor.credentialNames.map((name) => Object.freeze({ name, present: Boolean(env[name]?.trim()) })));
|
|
1300
539
|
return Object.freeze({
|
|
1301
540
|
...registration.descriptor,
|
|
1302
|
-
configured: credentials.length === 0 || credentials.some((credential) => credential.present),
|
|
541
|
+
configured: registration.descriptor.id === "vertex" ? vertexConfigured(env) : credentials.length === 0 || credentials.some((credential) => credential.present),
|
|
1303
542
|
credentials,
|
|
1304
543
|
configuration: providerConfiguration(registration.diagnostics, env)
|
|
1305
544
|
});
|
|
1306
545
|
})),
|
|
1307
546
|
transportFingerprint: (env = process.env) => {
|
|
1308
|
-
const transport = frozenRegistrations.map((registration) => {
|
|
547
|
+
const transport = frozenRegistrations.filter((registration) => (registration.descriptor.id !== "anthropic" || Boolean(env.ANTHROPIC_BASE_URL?.trim())) && (registration.descriptor.id !== "vertex" || VERTEX_ENVIRONMENT.some((name) => Boolean(env[name]?.trim())))).map((registration) => {
|
|
1309
548
|
const names = [
|
|
1310
549
|
registration.diagnostics.endpointEnvironmentVariable,
|
|
1311
550
|
...(registration.diagnostics.presence ?? []).map((entry) => entry.environmentVariable),
|
|
@@ -1399,12 +638,12 @@ var normalizeStreamToolCallIds = async function* (model, input, events) {
|
|
|
1399
638
|
};
|
|
1400
639
|
}
|
|
1401
640
|
};
|
|
1402
|
-
var withQwenDurableToolCallIds = (model) =>
|
|
641
|
+
var withQwenDurableToolCallIds = (model) => wrapLanguageModel4(model, [{
|
|
1403
642
|
name: "harness-qwen-durable-tool-call-ids",
|
|
1404
643
|
wrapGenerate: async ({ input }, next) => normalizeGenerateToolCallIds(model, input, await next()),
|
|
1405
644
|
wrapStream: async ({ input }, next) => normalizeStreamToolCallIds(model, input, await next())
|
|
1406
645
|
}]);
|
|
1407
|
-
var withOpenAIToolResultEnvelopes = (model) =>
|
|
646
|
+
var withOpenAIToolResultEnvelopes = (model) => wrapLanguageModel4(model, [{
|
|
1408
647
|
name: "harness-openai-tool-result-envelopes-v1",
|
|
1409
648
|
async wrapGenerate({ input }, next) {
|
|
1410
649
|
input.toolResultFormat = "envelope";
|
|
@@ -1415,7 +654,7 @@ var withOpenAIToolResultEnvelopes = (model) => wrapLanguageModel3(model, [{
|
|
|
1415
654
|
return next();
|
|
1416
655
|
}
|
|
1417
656
|
}]);
|
|
1418
|
-
var withMetaResponses = (model) =>
|
|
657
|
+
var withMetaResponses = (model) => wrapLanguageModel4(model, [{
|
|
1419
658
|
name: "harness-meta-responses-v1",
|
|
1420
659
|
async wrapGenerate({ input }, next) {
|
|
1421
660
|
input.providerOptions = { ...input.providerOptions, apiMode: "responses" };
|
|
@@ -1435,6 +674,41 @@ var withMetaResponses = (model) => wrapLanguageModel3(model, [{
|
|
|
1435
674
|
}
|
|
1436
675
|
}]);
|
|
1437
676
|
var BUILTIN_PROVIDER_REGISTRATIONS = Object.freeze([
|
|
677
|
+
{
|
|
678
|
+
descriptor: {
|
|
679
|
+
id: "vertex",
|
|
680
|
+
name: "Google Cloud Vertex AI",
|
|
681
|
+
defaultModel: bundledDefaultModel("vertex"),
|
|
682
|
+
credentialNames: [],
|
|
683
|
+
capabilities: HARNESS_PROVIDER_CAPABILITIES,
|
|
684
|
+
support: "provisional"
|
|
685
|
+
},
|
|
686
|
+
diagnostics: { presence: [
|
|
687
|
+
{ key: "project", environmentVariable: "GOOGLE_CLOUD_PROJECT" },
|
|
688
|
+
{ key: "location", environmentVariable: "VERTEX_LOCATION" },
|
|
689
|
+
{ key: "adcFile", environmentVariable: "GOOGLE_APPLICATION_CREDENTIALS" }
|
|
690
|
+
] },
|
|
691
|
+
factory: ({ model, env }) => createVertexModel(model, env)
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
descriptor: {
|
|
695
|
+
id: "anthropic",
|
|
696
|
+
name: "Anthropic",
|
|
697
|
+
defaultModel: bundledDefaultModel("anthropic"),
|
|
698
|
+
credentialNames: ["ANTHROPIC_API_KEY"],
|
|
699
|
+
capabilities: HARNESS_PROVIDER_CAPABILITIES,
|
|
700
|
+
support: "provisional"
|
|
701
|
+
},
|
|
702
|
+
diagnostics: { endpointEnvironmentVariable: "ANTHROPIC_BASE_URL" },
|
|
703
|
+
factory: ({ model, env, credentials }) => {
|
|
704
|
+
const baseURL = env.ANTHROPIC_BASE_URL?.trim();
|
|
705
|
+
return withAnthropicContinuation(createAnthropic({
|
|
706
|
+
apiKey: credentials.require(),
|
|
707
|
+
baseURL: baseURL || "https://api.anthropic.com/v1",
|
|
708
|
+
workspaceId: null
|
|
709
|
+
})(model));
|
|
710
|
+
}
|
|
711
|
+
},
|
|
1438
712
|
{
|
|
1439
713
|
descriptor: {
|
|
1440
714
|
id: "meta",
|
|
@@ -1525,7 +799,7 @@ var DEFAULT_PROVIDER_REGISTRY = createProviderRegistry(BUILTIN_PROVIDER_REGISTRA
|
|
|
1525
799
|
var PROVIDER_DESCRIPTORS = DEFAULT_PROVIDER_REGISTRY.descriptors;
|
|
1526
800
|
|
|
1527
801
|
// src/providers/reasoning.ts
|
|
1528
|
-
var reasoningEffortSchema =
|
|
802
|
+
var reasoningEffortSchema = z.enum(["default", "none", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
1529
803
|
var supportedReasoningEfforts = (capabilities) => ["default", ...capabilities.reasoning ? capabilities.reasoningEfforts ?? [] : []];
|
|
1530
804
|
function modelReasoningEfforts(provider, model) {
|
|
1531
805
|
if (!DEFAULT_PROVIDER_REGISTRY.has(provider))
|
|
@@ -1539,7 +813,7 @@ function withReasoningEffort(model, value) {
|
|
|
1539
813
|
return model;
|
|
1540
814
|
if (!supportedReasoningEfforts(model.capabilities).includes(value))
|
|
1541
815
|
throw new Error(`Reasoning effort ${value} is not declared for ${model.provider}/${model.modelId}. Use default or a supported level.`);
|
|
1542
|
-
return
|
|
816
|
+
return wrapLanguageModel5(model, [{
|
|
1543
817
|
name: `harness-reasoning-${value}`,
|
|
1544
818
|
async wrapGenerate(context, next) {
|
|
1545
819
|
context.input.reasoning = { ...context.input.reasoning, effort: value };
|
|
@@ -1627,6 +901,18 @@ class HarnessProviderError extends HarnessError {
|
|
|
1627
901
|
this.name = "HarnessProviderError";
|
|
1628
902
|
}
|
|
1629
903
|
}
|
|
904
|
+
|
|
905
|
+
class HarnessApprovalError extends HarnessError {
|
|
906
|
+
constructor(message, options = {}) {
|
|
907
|
+
super(message, {
|
|
908
|
+
code: "APPROVAL_REQUIRED",
|
|
909
|
+
category: "approval",
|
|
910
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
911
|
+
});
|
|
912
|
+
this.name = "HarnessApprovalError";
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
|
|
1630
916
|
class HarnessExecutionError extends HarnessError {
|
|
1631
917
|
constructor(message, options = {}) {
|
|
1632
918
|
super(message, {
|
|
@@ -2054,4 +1340,4 @@ var createProviderModel = (config, env = process.env, registry = DEFAULT_PROVIDE
|
|
|
2054
1340
|
}
|
|
2055
1341
|
};
|
|
2056
1342
|
var providerAvailability = (env = process.env, registry = DEFAULT_PROVIDER_REGISTRY) => registry.availability(env);
|
|
2057
|
-
export {
|
|
1343
|
+
export { PROVIDERS, createProviderRegistry, BUILTIN_PROVIDER_REGISTRATIONS, DEFAULT_PROVIDER_REGISTRY, PROVIDER_DESCRIPTORS, reasoningEffortSchema, modelReasoningEfforts, withReasoningEffort, HARNESS_ERROR_CODES, HARNESS_ERROR_SCHEMA_VERSION, HarnessError, HarnessConfigError, HarnessWorkspaceError, HarnessStateConflictError, HarnessProviderError, HarnessApprovalError, HarnessExecutionError, harnessErrorDocument, normalizeHarnessError, DEFAULT_ALLOWED_CHECKS, HARNESS_CONFIG_SCHEMA_VERSION, HARNESS_CONFIG_MIGRATABLE_SCHEMA_VERSIONS, HARNESS_STORE_BACKENDS, HARNESS_EXECUTION_BACKENDS, HARNESS_OCI_RUNTIMES, HARNESS_OCI_SHELL_MODES, HARNESS_EXECUTION_POLICY_VERSION, DEFAULT_OCI_EXECUTION, HARNESS_REQUIRED_CAPABILITIES, HARNESS_SUBAGENT_PROFILES, DEFAULT_HARNESS_MAX_STEPS, DEFAULT_HARNESS_BUDGET, DEFAULT_HARNESS_COMPACTION, DEFAULT_SUBAGENT_BUDGET, migrateHarnessConfigInput, defaultHarnessNamespace, parseProvider, providerDescriptor, resolveHarnessConfig, createProviderModel, providerAvailability };
|