@zhivex-ai/harness 1.2.0-rc.9 → 1.2.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 +36 -0
- package/README.md +7 -7
- package/contracts/public-api.json +5 -0
- package/contracts/stable-api-signatures.json +28 -28
- package/dist/acp-cli.js +804 -545
- package/dist/cli/arguments.d.ts +2 -0
- package/dist/cli/cli-credentials.d.ts +1 -1
- package/dist/cli/cli-options.d.ts +1 -1
- package/dist/cli/cli-profiles.d.ts +15 -0
- package/dist/cli/cli-stream.d.ts +3 -3
- package/dist/cli/console/console-commands.d.ts +3 -3
- package/dist/cli/console/console-input.d.ts +22 -3
- package/dist/cli/console/console-navigation.d.ts +3 -0
- package/dist/cli/console/console-presentation.d.ts +8 -2
- package/dist/cli/console/console-reasoning.d.ts +3 -0
- package/dist/cli/presentation.d.ts +3 -0
- package/dist/cli/run-document.d.ts +4 -4
- package/dist/cli/terminal/activity-history.d.ts +15 -0
- package/dist/cli/terminal/tool-activity.d.ts +3 -1
- package/dist/{cli-2dxcfrz5.js → cli-3jmy4h5h.js} +348 -187
- package/dist/{cli-entry-t3bay5k5.js → cli-entry-427869g9.js} +287 -180
- package/dist/{cli-entry-0mhbpe8j.js → cli-entry-b1mfvmxe.js} +2 -1
- package/dist/{cli-entry-gddtj1db.js → cli-entry-c2f58zj2.js} +699 -139
- package/dist/cli.js +2 -2
- package/dist/client/json-contracts.d.ts +20 -0
- package/dist/{config-w1npe8mp.js → config-1k9t4jhh.js} +1 -1
- package/dist/context/task-memory.d.ts +2 -2
- package/dist/hostile-repository-demo.js +661 -448
- package/dist/index.js +1517 -1074
- package/dist/persistence/operations.d.ts +5 -1
- package/dist/persistence/state-backup-stream.d.ts +4 -0
- package/dist/providers/meta-replay.d.ts +1 -1
- package/dist/providers/qwen-context.d.ts +2 -0
- package/dist/providers/qwen-hosted-policy.d.ts +5 -0
- package/dist/providers/reasoning.d.ts +18 -0
- package/dist/runtime/config.d.ts +3 -0
- package/dist/runtime/error-diagnostics.d.ts +2 -0
- package/dist/runtime/harness.d.ts +1 -1
- package/dist/runtime/model-edit-references.d.ts +4 -2
- package/dist/runtime/runtime-policy.d.ts +5 -4
- package/dist/runtime/time-to-safe-fix.d.ts +6 -1
- package/dist/service-cli.js +820 -575
- package/dist/{service-client-cli-1c9j6xah.js → service-client-cli-yx56n0hc.js} +66 -8
- package/dist/tools/execution.d.ts +8 -8
- package/dist/tools/workspace.d.ts +16 -16
- package/dist/verify-historical-migrations.js +830 -574
- package/dist/workspace/file-security.d.ts +6 -0
- package/dist/zhx.js +2 -2
- package/docs/CLI.md +52 -1
- package/docs/DURABLE_OPERATIONS.md +8 -0
- package/docs/EXTENSIBILITY.md +1 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/MODEL_CATALOG.md +28 -1
- package/evaluations/representative-assembly-matrix.json +46 -1
- package/evaluations/representative-repositories-v2.jsonl +7 -0
- package/examples/README.md +4 -4
- package/package.json +7 -7
|
@@ -1,126 +1,39 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import path from "node:path";
|
|
1
|
+
// src/providers/reasoning.ts
|
|
2
|
+
import { z as z2 } from "zod";
|
|
3
|
+
import { wrapLanguageModel as wrapLanguageModel4 } from "@zhivex-ai/core";
|
|
5
4
|
|
|
6
|
-
// src/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class HarnessError extends Error {
|
|
19
|
-
code;
|
|
20
|
-
category;
|
|
21
|
-
retryable;
|
|
22
|
-
constructor(message, options) {
|
|
23
|
-
super(message, options.cause === undefined ? undefined : { cause: options.cause });
|
|
24
|
-
this.name = "HarnessError";
|
|
25
|
-
this.code = options.code;
|
|
26
|
-
this.category = options.category;
|
|
27
|
-
this.retryable = options.retryable ?? false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
class HarnessConfigError extends HarnessError {
|
|
32
|
-
constructor(message, options = {}) {
|
|
33
|
-
super(message, {
|
|
34
|
-
code: "CONFIG_INVALID",
|
|
35
|
-
category: "configuration",
|
|
36
|
-
...options.cause === undefined ? {} : { cause: options.cause }
|
|
37
|
-
});
|
|
38
|
-
this.name = "HarnessConfigError";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
class HarnessWorkspaceError extends HarnessError {
|
|
43
|
-
constructor(message, options = {}) {
|
|
44
|
-
super(message, {
|
|
45
|
-
code: "WORKSPACE_UNSAFE",
|
|
46
|
-
category: "workspace",
|
|
47
|
-
...options.cause === undefined ? {} : { cause: options.cause }
|
|
48
|
-
});
|
|
49
|
-
this.name = "HarnessWorkspaceError";
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
class HarnessStateConflictError extends HarnessError {
|
|
54
|
-
constructor(message, options = {}) {
|
|
55
|
-
super(message, {
|
|
56
|
-
code: "STATE_CONFLICT",
|
|
57
|
-
category: "state",
|
|
58
|
-
retryable: options.retryable ?? false,
|
|
59
|
-
...options.cause === undefined ? {} : { cause: options.cause }
|
|
60
|
-
});
|
|
61
|
-
this.name = "HarnessStateConflictError";
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
class HarnessProviderError extends HarnessError {
|
|
66
|
-
constructor(message, options = {}) {
|
|
67
|
-
super(message, {
|
|
68
|
-
code: "PROVIDER_UNAVAILABLE",
|
|
69
|
-
category: "provider",
|
|
70
|
-
retryable: options.retryable ?? true,
|
|
71
|
-
...options.cause === undefined ? {} : { cause: options.cause }
|
|
72
|
-
});
|
|
73
|
-
this.name = "HarnessProviderError";
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
class HarnessExecutionError extends HarnessError {
|
|
77
|
-
constructor(message, options = {}) {
|
|
78
|
-
super(message, {
|
|
79
|
-
code: "EXECUTION_FAILED",
|
|
80
|
-
category: "execution",
|
|
81
|
-
retryable: options.retryable ?? false,
|
|
82
|
-
...options.cause === undefined ? {} : { cause: options.cause }
|
|
83
|
-
});
|
|
84
|
-
this.name = "HarnessExecutionError";
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
var harnessErrorDocument = (error) => {
|
|
88
|
-
const normalized = normalizeHarnessError(error);
|
|
89
|
-
return {
|
|
90
|
-
schemaVersion: HARNESS_ERROR_SCHEMA_VERSION,
|
|
91
|
-
kind: "error",
|
|
92
|
-
error: {
|
|
93
|
-
code: normalized.code,
|
|
94
|
-
category: normalized.category,
|
|
95
|
-
retryable: normalized.retryable
|
|
5
|
+
// src/providers/qwen-hosted-policy.ts
|
|
6
|
+
import { wrapLanguageModel } from "@zhivex-ai/core";
|
|
7
|
+
function withQwenHostedPolicy(model) {
|
|
8
|
+
if (model.modelId !== "kimi-k3")
|
|
9
|
+
return model;
|
|
10
|
+
const prepare = (input) => {
|
|
11
|
+
const options = input.providerOptions ?? {};
|
|
12
|
+
if (options.apiMode && !["auto", "chat"].includes(String(options.apiMode)))
|
|
13
|
+
throw new Error("Kimi K3 on Model Studio requires Chat Completions.");
|
|
14
|
+
if (input.reasoning?.effort !== undefined || input.reasoning?.budgetTokens !== undefined || options.reasoning_effort !== undefined || options.thinking_budget !== undefined || options.enable_thinking === false) {
|
|
15
|
+
throw new Error("Kimi K3 on Model Studio currently supports default thinking only.");
|
|
96
16
|
}
|
|
17
|
+
input.providerOptions = { ...options, apiMode: "chat", enable_thinking: true };
|
|
97
18
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
if (name === "ConflictError" || code === "SQLITE_BUSY" || code === "SQLITE_LOCKED") {
|
|
117
|
-
return new HarnessStateConflictError(message, {
|
|
118
|
-
cause: error,
|
|
119
|
-
retryable: code === "SQLITE_BUSY" || code === "SQLITE_LOCKED"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
return new HarnessExecutionError(message, { cause: error });
|
|
123
|
-
};
|
|
19
|
+
const wrapped = wrapLanguageModel(model, [{
|
|
20
|
+
name: "harness-kimi-k3-chat-thinking-v1",
|
|
21
|
+
async wrapGenerate(context, next) {
|
|
22
|
+
prepare(context.input);
|
|
23
|
+
return next();
|
|
24
|
+
},
|
|
25
|
+
async wrapStream(context, next) {
|
|
26
|
+
prepare(context.input);
|
|
27
|
+
return next();
|
|
28
|
+
}
|
|
29
|
+
}]);
|
|
30
|
+
return { ...wrapped, capabilities: {
|
|
31
|
+
...wrapped.capabilities,
|
|
32
|
+
reasoningEfforts: [],
|
|
33
|
+
webSearch: false,
|
|
34
|
+
...wrapped.capabilities.agentCapabilities ? { agentCapabilities: { ...wrapped.capabilities.agentCapabilities, hostedWebSearch: false, codeExecution: false, webExtraction: false } } : {}
|
|
35
|
+
} };
|
|
36
|
+
}
|
|
124
37
|
|
|
125
38
|
// src/providers/meta-continuation.ts
|
|
126
39
|
import { setTimeout as delay } from "node:timers/promises";
|
|
@@ -185,7 +98,7 @@ var createMetaContinuationFetch = (fetcher = fetch, backoff = [1000, 2000]) => {
|
|
|
185
98
|
};
|
|
186
99
|
|
|
187
100
|
// src/providers/meta-replay.ts
|
|
188
|
-
import { wrapLanguageModel } from "@zhivex-ai/core";
|
|
101
|
+
import { wrapLanguageModel as wrapLanguageModel2 } from "@zhivex-ai/core";
|
|
189
102
|
import { createMeta } from "@zhivex-ai/meta";
|
|
190
103
|
var replayPlan = (messages) => {
|
|
191
104
|
let offset = 0;
|
|
@@ -251,7 +164,7 @@ var createMetaReplayModel = (options, modelId) => {
|
|
|
251
164
|
} }
|
|
252
165
|
};
|
|
253
166
|
};
|
|
254
|
-
return
|
|
167
|
+
return wrapLanguageModel2(createMeta(options)(modelId), [{
|
|
255
168
|
name: "harness-meta-stateless-replay-v1",
|
|
256
169
|
async wrapGenerate({ input }) {
|
|
257
170
|
const prepared = prepare(input);
|
|
@@ -296,7 +209,7 @@ import { z } from "zod";
|
|
|
296
209
|
// src/models/catalog.json
|
|
297
210
|
var catalog_default = {
|
|
298
211
|
schemaVersion: 1,
|
|
299
|
-
revision: "2026-09-
|
|
212
|
+
revision: "2026-09-26-frontier",
|
|
300
213
|
providers: [
|
|
301
214
|
{
|
|
302
215
|
id: "openai",
|
|
@@ -430,7 +343,7 @@ var catalog_default = {
|
|
|
430
343
|
{
|
|
431
344
|
id: "gpt-5.6-sol",
|
|
432
345
|
name: "gpt-5.6-sol",
|
|
433
|
-
group: "
|
|
346
|
+
group: "other",
|
|
434
347
|
order: 3,
|
|
435
348
|
lifecycle: "unknown",
|
|
436
349
|
validation: "unverified",
|
|
@@ -442,7 +355,7 @@ var catalog_default = {
|
|
|
442
355
|
{
|
|
443
356
|
id: "gpt-5.6-terra",
|
|
444
357
|
name: "gpt-5.6-terra",
|
|
445
|
-
group: "
|
|
358
|
+
group: "other",
|
|
446
359
|
order: 4,
|
|
447
360
|
lifecycle: "unknown",
|
|
448
361
|
validation: "unverified",
|
|
@@ -454,7 +367,7 @@ var catalog_default = {
|
|
|
454
367
|
{
|
|
455
368
|
id: "gpt-5.6-luna",
|
|
456
369
|
name: "gpt-5.6-luna",
|
|
457
|
-
group: "
|
|
370
|
+
group: "other",
|
|
458
371
|
order: 5,
|
|
459
372
|
lifecycle: "unknown",
|
|
460
373
|
validation: "unverified",
|
|
@@ -550,34 +463,10 @@ var catalog_default = {
|
|
|
550
463
|
defaultModel: "qwen3.8-max",
|
|
551
464
|
models: [
|
|
552
465
|
{
|
|
553
|
-
id: "qwen3.8-
|
|
554
|
-
name: "qwen3.8-
|
|
555
|
-
group: "other",
|
|
556
|
-
order: 0,
|
|
557
|
-
lifecycle: "unknown",
|
|
558
|
-
validation: "unverified",
|
|
559
|
-
capabilities: [
|
|
560
|
-
"chat",
|
|
561
|
-
"tools"
|
|
562
|
-
]
|
|
563
|
-
},
|
|
564
|
-
{
|
|
565
|
-
id: "qwen3.8-max-0902",
|
|
566
|
-
name: "qwen3.8-max-0902",
|
|
567
|
-
group: "other",
|
|
568
|
-
order: 1,
|
|
569
|
-
lifecycle: "unknown",
|
|
570
|
-
validation: "unverified",
|
|
571
|
-
capabilities: [
|
|
572
|
-
"chat",
|
|
573
|
-
"tools"
|
|
574
|
-
]
|
|
575
|
-
},
|
|
576
|
-
{
|
|
577
|
-
id: "qwen3.8-max",
|
|
578
|
-
name: "qwen3.8-max",
|
|
466
|
+
id: "qwen3.8-flash",
|
|
467
|
+
name: "qwen3.8-flash",
|
|
579
468
|
group: "primary",
|
|
580
|
-
order:
|
|
469
|
+
order: 0,
|
|
581
470
|
lifecycle: "unknown",
|
|
582
471
|
validation: "unverified",
|
|
583
472
|
capabilities: [
|
|
@@ -590,7 +479,7 @@ var catalog_default = {
|
|
|
590
479
|
maxOutputTokens: 131072,
|
|
591
480
|
maxInputTokens: 983616,
|
|
592
481
|
evidence: {
|
|
593
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-
|
|
482
|
+
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
|
|
594
483
|
checkedAt: "2026-09-24"
|
|
595
484
|
}
|
|
596
485
|
},
|
|
@@ -598,16 +487,16 @@ var catalog_default = {
|
|
|
598
487
|
suitability: "candidate",
|
|
599
488
|
reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
|
|
600
489
|
evidence: {
|
|
601
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-
|
|
490
|
+
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-flash",
|
|
602
491
|
checkedAt: "2026-09-24"
|
|
603
492
|
}
|
|
604
493
|
}
|
|
605
494
|
},
|
|
606
495
|
{
|
|
607
|
-
id: "qwen3.8-
|
|
608
|
-
name: "qwen3.8-
|
|
609
|
-
group: "
|
|
610
|
-
order:
|
|
496
|
+
id: "qwen3.8-max",
|
|
497
|
+
name: "qwen3.8-max",
|
|
498
|
+
group: "primary",
|
|
499
|
+
order: 1,
|
|
611
500
|
lifecycle: "unknown",
|
|
612
501
|
validation: "unverified",
|
|
613
502
|
capabilities: [
|
|
@@ -620,7 +509,7 @@ var catalog_default = {
|
|
|
620
509
|
maxOutputTokens: 131072,
|
|
621
510
|
maxInputTokens: 983616,
|
|
622
511
|
evidence: {
|
|
623
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-
|
|
512
|
+
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
|
|
624
513
|
checkedAt: "2026-09-24"
|
|
625
514
|
}
|
|
626
515
|
},
|
|
@@ -628,16 +517,57 @@ var catalog_default = {
|
|
|
628
517
|
suitability: "candidate",
|
|
629
518
|
reason: "Editorial candidate based on documented text generation. Conservative thinking-mode input limit; summary fidelity has not been benchmarked.",
|
|
630
519
|
evidence: {
|
|
631
|
-
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-
|
|
520
|
+
sourceUrl: "https://www.alibabacloud.com/help/en/model-studio/qwen3-8-max",
|
|
632
521
|
checkedAt: "2026-09-24"
|
|
633
522
|
}
|
|
634
523
|
}
|
|
635
524
|
},
|
|
636
525
|
{
|
|
637
|
-
id: "
|
|
638
|
-
name: "
|
|
639
|
-
group: "
|
|
526
|
+
id: "glm-5.3",
|
|
527
|
+
name: "GLM 5.3",
|
|
528
|
+
group: "primary",
|
|
529
|
+
order: 2,
|
|
530
|
+
lifecycle: "active",
|
|
531
|
+
validation: "unverified",
|
|
532
|
+
capabilities: [
|
|
533
|
+
"chat",
|
|
534
|
+
"tools"
|
|
535
|
+
],
|
|
536
|
+
reason: "Zhipu model served by Alibaba Model Studio; region and account access vary"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
id: "deepseek-v4.1-flash",
|
|
540
|
+
name: "DeepSeek V4.1 Flash",
|
|
541
|
+
group: "primary",
|
|
542
|
+
order: 3,
|
|
543
|
+
lifecycle: "active",
|
|
544
|
+
validation: "unverified",
|
|
545
|
+
capabilities: [
|
|
546
|
+
"chat",
|
|
547
|
+
"tools",
|
|
548
|
+
"vision"
|
|
549
|
+
],
|
|
550
|
+
reason: "DeepSeek model served by Alibaba Model Studio; region and account access vary"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
id: "kimi-k3",
|
|
554
|
+
name: "Kimi K3",
|
|
555
|
+
group: "primary",
|
|
640
556
|
order: 4,
|
|
557
|
+
lifecycle: "active",
|
|
558
|
+
validation: "unverified",
|
|
559
|
+
capabilities: [
|
|
560
|
+
"chat",
|
|
561
|
+
"tools",
|
|
562
|
+
"vision"
|
|
563
|
+
],
|
|
564
|
+
reason: "Moonshot model served by Alibaba Model Studio; region and account access vary"
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
id: "qwen3.7-plus",
|
|
568
|
+
name: "qwen3.7-plus",
|
|
569
|
+
group: "primary",
|
|
570
|
+
order: 5,
|
|
641
571
|
lifecycle: "unknown",
|
|
642
572
|
validation: "unverified",
|
|
643
573
|
capabilities: [
|
|
@@ -646,10 +576,10 @@ var catalog_default = {
|
|
|
646
576
|
]
|
|
647
577
|
},
|
|
648
578
|
{
|
|
649
|
-
id: "qwen3.
|
|
650
|
-
name: "qwen3.
|
|
579
|
+
id: "qwen3.8-omni-flash",
|
|
580
|
+
name: "qwen3.8-omni-flash",
|
|
651
581
|
group: "other",
|
|
652
|
-
order:
|
|
582
|
+
order: 6,
|
|
653
583
|
lifecycle: "unknown",
|
|
654
584
|
validation: "unverified",
|
|
655
585
|
capabilities: [
|
|
@@ -658,10 +588,34 @@ var catalog_default = {
|
|
|
658
588
|
]
|
|
659
589
|
},
|
|
660
590
|
{
|
|
661
|
-
id: "qwen3.
|
|
662
|
-
name: "qwen3.
|
|
591
|
+
id: "qwen3.8-max-0902",
|
|
592
|
+
name: "qwen3.8-max-0902",
|
|
663
593
|
group: "other",
|
|
664
|
-
order:
|
|
594
|
+
order: 7,
|
|
595
|
+
lifecycle: "unknown",
|
|
596
|
+
validation: "unverified",
|
|
597
|
+
capabilities: [
|
|
598
|
+
"chat",
|
|
599
|
+
"tools"
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
id: "qwen3.8-max-preview",
|
|
604
|
+
name: "qwen3.8-max-preview",
|
|
605
|
+
group: "other",
|
|
606
|
+
order: 8,
|
|
607
|
+
lifecycle: "unknown",
|
|
608
|
+
validation: "unverified",
|
|
609
|
+
capabilities: [
|
|
610
|
+
"chat",
|
|
611
|
+
"tools"
|
|
612
|
+
]
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
id: "qwen3.7-max",
|
|
616
|
+
name: "qwen3.7-max",
|
|
617
|
+
group: "other",
|
|
618
|
+
order: 9,
|
|
665
619
|
lifecycle: "unknown",
|
|
666
620
|
validation: "unverified",
|
|
667
621
|
capabilities: [
|
|
@@ -673,7 +627,7 @@ var catalog_default = {
|
|
|
673
627
|
id: "qwen3.6-flash",
|
|
674
628
|
name: "qwen3.6-flash",
|
|
675
629
|
group: "other",
|
|
676
|
-
order:
|
|
630
|
+
order: 10,
|
|
677
631
|
lifecycle: "unknown",
|
|
678
632
|
validation: "unverified",
|
|
679
633
|
capabilities: [
|
|
@@ -685,7 +639,7 @@ var catalog_default = {
|
|
|
685
639
|
id: "qwen3.5-omni-plus",
|
|
686
640
|
name: "qwen3.5-omni-plus",
|
|
687
641
|
group: "other",
|
|
688
|
-
order:
|
|
642
|
+
order: 11,
|
|
689
643
|
lifecycle: "unknown",
|
|
690
644
|
validation: "unverified",
|
|
691
645
|
capabilities: [
|
|
@@ -697,7 +651,7 @@ var catalog_default = {
|
|
|
697
651
|
id: "qwen-plus",
|
|
698
652
|
name: "qwen-plus",
|
|
699
653
|
group: "other",
|
|
700
|
-
order:
|
|
654
|
+
order: 12,
|
|
701
655
|
lifecycle: "unknown",
|
|
702
656
|
validation: "unverified",
|
|
703
657
|
capabilities: [
|
|
@@ -1073,7 +1027,7 @@ function modelDescription(model) {
|
|
|
1073
1027
|
// src/providers/providers.ts
|
|
1074
1028
|
import { createHash } from "node:crypto";
|
|
1075
1029
|
import {
|
|
1076
|
-
wrapLanguageModel as
|
|
1030
|
+
wrapLanguageModel as wrapLanguageModel3
|
|
1077
1031
|
} from "@zhivex-ai/core";
|
|
1078
1032
|
import { createGemini } from "@zhivex-ai/gemini";
|
|
1079
1033
|
import { createOpenAI } from "@zhivex-ai/openai";
|
|
@@ -1397,12 +1351,12 @@ var normalizeStreamToolCallIds = async function* (model, input, events) {
|
|
|
1397
1351
|
};
|
|
1398
1352
|
}
|
|
1399
1353
|
};
|
|
1400
|
-
var withQwenDurableToolCallIds = (model) =>
|
|
1354
|
+
var withQwenDurableToolCallIds = (model) => wrapLanguageModel3(model, [{
|
|
1401
1355
|
name: "harness-qwen-durable-tool-call-ids",
|
|
1402
1356
|
wrapGenerate: async ({ input }, next) => normalizeGenerateToolCallIds(model, input, await next()),
|
|
1403
1357
|
wrapStream: async ({ input }, next) => normalizeStreamToolCallIds(model, input, await next())
|
|
1404
1358
|
}]);
|
|
1405
|
-
var withOpenAIToolResultEnvelopes = (model) =>
|
|
1359
|
+
var withOpenAIToolResultEnvelopes = (model) => wrapLanguageModel3(model, [{
|
|
1406
1360
|
name: "harness-openai-tool-result-envelopes-v1",
|
|
1407
1361
|
async wrapGenerate({ input }, next) {
|
|
1408
1362
|
input.toolResultFormat = "envelope";
|
|
@@ -1413,7 +1367,7 @@ var withOpenAIToolResultEnvelopes = (model) => wrapLanguageModel2(model, [{
|
|
|
1413
1367
|
return next();
|
|
1414
1368
|
}
|
|
1415
1369
|
}]);
|
|
1416
|
-
var withMetaResponses = (model) =>
|
|
1370
|
+
var withMetaResponses = (model) => wrapLanguageModel3(model, [{
|
|
1417
1371
|
name: "harness-meta-responses-v1",
|
|
1418
1372
|
async wrapGenerate({ input }, next) {
|
|
1419
1373
|
input.providerOptions = { ...input.providerOptions, apiMode: "responses" };
|
|
@@ -1474,12 +1428,12 @@ var BUILTIN_PROVIDER_REGISTRATIONS = Object.freeze([
|
|
|
1474
1428
|
const baseURL = env.QWEN_BASE_URL?.trim();
|
|
1475
1429
|
const workspaceId = env.QWEN_WORKSPACE_ID?.trim();
|
|
1476
1430
|
const region = optionalQwenRegion(env.QWEN_REGION?.trim());
|
|
1477
|
-
return withQwenDurableToolCallIds(createQwen({
|
|
1431
|
+
return withQwenHostedPolicy(withQwenDurableToolCallIds(createQwen({
|
|
1478
1432
|
apiKey: credentials.require(),
|
|
1479
1433
|
...baseURL ? { baseURL } : {},
|
|
1480
1434
|
...workspaceId ? { workspaceId } : {},
|
|
1481
1435
|
...region ? { region } : {}
|
|
1482
|
-
})(model));
|
|
1436
|
+
})(model)));
|
|
1483
1437
|
}
|
|
1484
1438
|
},
|
|
1485
1439
|
{
|
|
@@ -1522,6 +1476,158 @@ var BUILTIN_PROVIDER_REGISTRATIONS = Object.freeze([
|
|
|
1522
1476
|
var DEFAULT_PROVIDER_REGISTRY = createProviderRegistry(BUILTIN_PROVIDER_REGISTRATIONS);
|
|
1523
1477
|
var PROVIDER_DESCRIPTORS = DEFAULT_PROVIDER_REGISTRY.descriptors;
|
|
1524
1478
|
|
|
1479
|
+
// src/providers/reasoning.ts
|
|
1480
|
+
var reasoningEffortSchema = z2.enum(["default", "none", "minimal", "low", "medium", "high", "xhigh", "max"]);
|
|
1481
|
+
var supportedReasoningEfforts = (capabilities) => ["default", ...capabilities.reasoning ? capabilities.reasoningEfforts ?? [] : []];
|
|
1482
|
+
function modelReasoningEfforts(provider, model) {
|
|
1483
|
+
if (!DEFAULT_PROVIDER_REGISTRY.has(provider))
|
|
1484
|
+
return ["default"];
|
|
1485
|
+
const descriptor = DEFAULT_PROVIDER_REGISTRY.descriptor(provider);
|
|
1486
|
+
const env = Object.fromEntries(descriptor.credentialNames.map((name) => [name, "capability-inspection-only"]));
|
|
1487
|
+
return supportedReasoningEfforts(DEFAULT_PROVIDER_REGISTRY.createModel({ provider, model }, env).capabilities);
|
|
1488
|
+
}
|
|
1489
|
+
function withReasoningEffort(model, value) {
|
|
1490
|
+
if (!value || value === "default")
|
|
1491
|
+
return model;
|
|
1492
|
+
if (!supportedReasoningEfforts(model.capabilities).includes(value))
|
|
1493
|
+
throw new Error(`Reasoning effort ${value} is not declared for ${model.provider}/${model.modelId}. Use default or a supported level.`);
|
|
1494
|
+
return wrapLanguageModel4(model, [{
|
|
1495
|
+
name: `harness-reasoning-${value}`,
|
|
1496
|
+
async wrapGenerate(context, next) {
|
|
1497
|
+
context.input.reasoning = { ...context.input.reasoning, effort: value };
|
|
1498
|
+
return next();
|
|
1499
|
+
},
|
|
1500
|
+
async wrapStream(context, next) {
|
|
1501
|
+
context.input.reasoning = { ...context.input.reasoning, effort: value };
|
|
1502
|
+
return next();
|
|
1503
|
+
}
|
|
1504
|
+
}]);
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
// src/runtime/config.ts
|
|
1508
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
1509
|
+
import { realpathSync } from "node:fs";
|
|
1510
|
+
import path from "node:path";
|
|
1511
|
+
|
|
1512
|
+
// src/runtime/errors.ts
|
|
1513
|
+
var HARNESS_ERROR_CODES = [
|
|
1514
|
+
"CONFIG_INVALID",
|
|
1515
|
+
"CLI_USAGE_INVALID",
|
|
1516
|
+
"WORKSPACE_UNSAFE",
|
|
1517
|
+
"STATE_CONFLICT",
|
|
1518
|
+
"PROVIDER_UNAVAILABLE",
|
|
1519
|
+
"APPROVAL_REQUIRED",
|
|
1520
|
+
"EXECUTION_FAILED"
|
|
1521
|
+
];
|
|
1522
|
+
var HARNESS_ERROR_SCHEMA_VERSION = 1;
|
|
1523
|
+
|
|
1524
|
+
class HarnessError extends Error {
|
|
1525
|
+
code;
|
|
1526
|
+
category;
|
|
1527
|
+
retryable;
|
|
1528
|
+
constructor(message, options) {
|
|
1529
|
+
super(message, options.cause === undefined ? undefined : { cause: options.cause });
|
|
1530
|
+
this.name = "HarnessError";
|
|
1531
|
+
this.code = options.code;
|
|
1532
|
+
this.category = options.category;
|
|
1533
|
+
this.retryable = options.retryable ?? false;
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
class HarnessConfigError extends HarnessError {
|
|
1538
|
+
constructor(message, options = {}) {
|
|
1539
|
+
super(message, {
|
|
1540
|
+
code: "CONFIG_INVALID",
|
|
1541
|
+
category: "configuration",
|
|
1542
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
1543
|
+
});
|
|
1544
|
+
this.name = "HarnessConfigError";
|
|
1545
|
+
}
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
class HarnessWorkspaceError extends HarnessError {
|
|
1549
|
+
constructor(message, options = {}) {
|
|
1550
|
+
super(message, {
|
|
1551
|
+
code: "WORKSPACE_UNSAFE",
|
|
1552
|
+
category: "workspace",
|
|
1553
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
1554
|
+
});
|
|
1555
|
+
this.name = "HarnessWorkspaceError";
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
class HarnessStateConflictError extends HarnessError {
|
|
1560
|
+
constructor(message, options = {}) {
|
|
1561
|
+
super(message, {
|
|
1562
|
+
code: "STATE_CONFLICT",
|
|
1563
|
+
category: "state",
|
|
1564
|
+
retryable: options.retryable ?? false,
|
|
1565
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
1566
|
+
});
|
|
1567
|
+
this.name = "HarnessStateConflictError";
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
class HarnessProviderError extends HarnessError {
|
|
1572
|
+
constructor(message, options = {}) {
|
|
1573
|
+
super(message, {
|
|
1574
|
+
code: "PROVIDER_UNAVAILABLE",
|
|
1575
|
+
category: "provider",
|
|
1576
|
+
retryable: options.retryable ?? true,
|
|
1577
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
1578
|
+
});
|
|
1579
|
+
this.name = "HarnessProviderError";
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
class HarnessExecutionError extends HarnessError {
|
|
1583
|
+
constructor(message, options = {}) {
|
|
1584
|
+
super(message, {
|
|
1585
|
+
code: "EXECUTION_FAILED",
|
|
1586
|
+
category: "execution",
|
|
1587
|
+
retryable: options.retryable ?? false,
|
|
1588
|
+
...options.cause === undefined ? {} : { cause: options.cause }
|
|
1589
|
+
});
|
|
1590
|
+
this.name = "HarnessExecutionError";
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
var harnessErrorDocument = (error) => {
|
|
1594
|
+
const normalized = normalizeHarnessError(error);
|
|
1595
|
+
return {
|
|
1596
|
+
schemaVersion: HARNESS_ERROR_SCHEMA_VERSION,
|
|
1597
|
+
kind: "error",
|
|
1598
|
+
error: {
|
|
1599
|
+
code: normalized.code,
|
|
1600
|
+
category: normalized.category,
|
|
1601
|
+
retryable: normalized.retryable
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
};
|
|
1605
|
+
var numericStatuses = (error) => {
|
|
1606
|
+
if (!error || typeof error !== "object")
|
|
1607
|
+
return;
|
|
1608
|
+
const record = error;
|
|
1609
|
+
const values = [record.status, record.statusCode].filter((value) => typeof value === "number" && Number.isSafeInteger(value));
|
|
1610
|
+
return values.length > 0 ? values : undefined;
|
|
1611
|
+
};
|
|
1612
|
+
var normalizeHarnessError = (error) => {
|
|
1613
|
+
if (error instanceof HarnessError)
|
|
1614
|
+
return error;
|
|
1615
|
+
const message = error instanceof Error ? error.message : "Harness execution failed.";
|
|
1616
|
+
const statuses = numericStatuses(error) ?? [];
|
|
1617
|
+
if (statuses.some((status) => status === 429 || status >= 500 && status <= 599)) {
|
|
1618
|
+
return new HarnessProviderError(message, { cause: error, retryable: true });
|
|
1619
|
+
}
|
|
1620
|
+
const name = error && typeof error === "object" && typeof error.name === "string" ? error.name : "";
|
|
1621
|
+
const code = error && typeof error === "object" && typeof error.code === "string" ? error.code : "";
|
|
1622
|
+
if (name === "ConflictError" || code === "SQLITE_BUSY" || code === "SQLITE_LOCKED") {
|
|
1623
|
+
return new HarnessStateConflictError(message, {
|
|
1624
|
+
cause: error,
|
|
1625
|
+
retryable: code === "SQLITE_BUSY" || code === "SQLITE_LOCKED"
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
return new HarnessExecutionError(message, { cause: error });
|
|
1629
|
+
};
|
|
1630
|
+
|
|
1525
1631
|
// src/runtime/config.ts
|
|
1526
1632
|
var DEFAULT_ALLOWED_CHECKS = ["test", "typecheck", "lint", "build"];
|
|
1527
1633
|
var HARNESS_CONFIG_SCHEMA_VERSION = 5;
|
|
@@ -1857,6 +1963,7 @@ var resolveHarnessConfig = (input = {}, registry = DEFAULT_PROVIDER_REGISTRY) =>
|
|
|
1857
1963
|
schemaVersion: HARNESS_CONFIG_SCHEMA_VERSION,
|
|
1858
1964
|
provider,
|
|
1859
1965
|
model: input.model ?? process.env.ZHIVEX_HARNESS_MODEL ?? descriptor.defaultModel,
|
|
1966
|
+
...input.reasoningEffort === undefined || input.reasoningEffort === "default" ? {} : { reasoningEffort: reasoningEffortSchema.parse(input.reasoningEffort) },
|
|
1860
1967
|
workspace,
|
|
1861
1968
|
stateDirectory: canonicalStateDirectory(requestedWorkspace, workspace, input.stateDirectory),
|
|
1862
1969
|
storeBackend,
|
|
@@ -1899,4 +2006,4 @@ var createProviderModel = (config, env = process.env, registry = DEFAULT_PROVIDE
|
|
|
1899
2006
|
}
|
|
1900
2007
|
};
|
|
1901
2008
|
var providerAvailability = (env = process.env, registry = DEFAULT_PROVIDER_REGISTRY) => registry.availability(env);
|
|
1902
|
-
export { HARNESS_ERROR_CODES, HARNESS_ERROR_SCHEMA_VERSION, HarnessError, HarnessConfigError, HarnessWorkspaceError, HarnessStateConflictError, HarnessProviderError, HarnessExecutionError, harnessErrorDocument, normalizeHarnessError, modelCatalogSchema, bundledModelCatalog, catalogModels, modelDescription, PROVIDERS, createProviderRegistry, BUILTIN_PROVIDER_REGISTRATIONS, DEFAULT_PROVIDER_REGISTRY, PROVIDER_DESCRIPTORS, 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 };
|
|
2009
|
+
export { HARNESS_ERROR_CODES, HARNESS_ERROR_SCHEMA_VERSION, HarnessError, HarnessConfigError, HarnessWorkspaceError, HarnessStateConflictError, HarnessProviderError, HarnessExecutionError, harnessErrorDocument, normalizeHarnessError, modelCatalogSchema, bundledModelCatalog, catalogModels, modelDescription, PROVIDERS, createProviderRegistry, BUILTIN_PROVIDER_REGISTRATIONS, DEFAULT_PROVIDER_REGISTRY, PROVIDER_DESCRIPTORS, reasoningEffortSchema, modelReasoningEfforts, withReasoningEffort, 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 };
|
|
@@ -29,6 +29,7 @@ var CLI_OPTION_NAMES = [
|
|
|
29
29
|
"--compaction-provider",
|
|
30
30
|
"--provider",
|
|
31
31
|
"--model",
|
|
32
|
+
"--reasoning",
|
|
32
33
|
"--profile",
|
|
33
34
|
"--route",
|
|
34
35
|
"--workspace",
|
|
@@ -112,7 +113,7 @@ var CLI_OPTION_DEFINITIONS = Object.fromEntries(CLI_OPTION_NAMES.map((name) => [
|
|
|
112
113
|
conflictsWith: conflicts[name] ?? []
|
|
113
114
|
}]));
|
|
114
115
|
var locator = ["--workspace", "--state-dir", "--store", "--tenant", "--user", "--namespace"];
|
|
115
|
-
var provider = ["--provider", "--model"];
|
|
116
|
+
var provider = ["--provider", "--model", "--reasoning"];
|
|
116
117
|
var profile = ["--profile"];
|
|
117
118
|
var project = ["--mcp-config", "--context-config", "--no-project-context"];
|
|
118
119
|
var execution = [
|