@the-open-engine/zeroshot 6.17.0 → 6.19.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/cli/index.js +11 -14
- package/lib/agent-cli-provider/adapters/claude.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/claude.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/claude.js +30 -0
- package/lib/agent-cli-provider/adapters/claude.js.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.js +37 -0
- package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
- package/lib/agent-cli-provider/adapters/gemini.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/gemini.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/gemini.js +115 -4
- package/lib/agent-cli-provider/adapters/gemini.js.map +1 -1
- package/lib/agent-cli-provider/adapters/opencode.d.ts +2 -2
- package/lib/agent-cli-provider/adapters/opencode.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/opencode.js +108 -0
- package/lib/agent-cli-provider/adapters/opencode.js.map +1 -1
- package/lib/agent-cli-provider/contract-options.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-options.js +12 -0
- package/lib/agent-cli-provider/contract-options.js.map +1 -1
- package/lib/agent-cli-provider/index.d.ts +2 -2
- package/lib/agent-cli-provider/index.d.ts.map +1 -1
- package/lib/agent-cli-provider/index.js +2 -1
- package/lib/agent-cli-provider/index.js.map +1 -1
- package/lib/agent-cli-provider/omp-release.d.ts +15 -0
- package/lib/agent-cli-provider/omp-release.d.ts.map +1 -0
- package/lib/agent-cli-provider/omp-release.js +50 -0
- package/lib/agent-cli-provider/omp-release.js.map +1 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.d.ts +38 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.d.ts.map +1 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.js +267 -0
- package/lib/agent-cli-provider/omp-rpc-protocol.js.map +1 -0
- package/lib/agent-cli-provider/provider-registry.d.ts +35 -8
- package/lib/agent-cli-provider/provider-registry.d.ts.map +1 -1
- package/lib/agent-cli-provider/provider-registry.js +29 -1
- package/lib/agent-cli-provider/provider-registry.js.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.d.ts.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.js +36 -5
- package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -1
- package/lib/agent-cli-provider/types.d.ts +30 -3
- package/lib/agent-cli-provider/types.d.ts.map +1 -1
- package/lib/agent-cli-provider/types.js.map +1 -1
- package/lib/cluster/errors.cjs +4 -1
- package/lib/cluster/errors.d.ts +2 -0
- package/lib/cluster/errors.mjs +2 -0
- package/lib/cluster/index.cjs +8 -1
- package/lib/cluster/index.d.ts +4 -1
- package/lib/cluster/index.mjs +4 -1
- package/lib/cluster/json-source.cjs +61 -0
- package/lib/cluster/json-source.d.ts +4 -0
- package/lib/cluster/json-source.mjs +55 -0
- package/lib/cluster/payload-value.cjs +76 -0
- package/lib/cluster/payload-value.d.ts +7 -0
- package/lib/cluster/payload-value.mjs +72 -0
- package/lib/cluster/validators.cjs +21 -0
- package/lib/cluster/validators.d.ts +4 -1
- package/lib/cluster/validators.mjs +19 -1
- package/lib/provider-names.js +10 -0
- package/lib/settings.js +6 -3
- package/lib/setup-plan.js +5 -5
- package/lib/start-cluster.js +3 -3
- package/package.json +2 -2
- package/src/agent/agent-lifecycle.js +4 -4
- package/src/agent/agent-task-executor.js +201 -416
- package/src/agent/output-extraction.js +39 -14
- package/src/agent/output-reformatter.js +154 -111
- package/src/agent/pr-verification.js +4 -1
- package/src/agent-cli-provider/adapters/claude.ts +39 -2
- package/src/agent-cli-provider/adapters/codex.ts +56 -2
- package/src/agent-cli-provider/adapters/gemini.ts +102 -6
- package/src/agent-cli-provider/adapters/opencode.ts +85 -2
- package/src/agent-cli-provider/contract-options.ts +16 -0
- package/src/agent-cli-provider/index.ts +4 -0
- package/src/agent-cli-provider/omp-release.ts +63 -0
- package/src/agent-cli-provider/omp-rpc-protocol.ts +396 -0
- package/src/agent-cli-provider/provider-registry.ts +52 -4
- package/src/agent-cli-provider/single-agent-runtime.ts +52 -5
- package/src/agent-cli-provider/types.ts +36 -2
- package/src/agent-wrapper.js +5 -5
- package/src/claude-task-runner.js +5 -3
- package/src/cluster/errors.ts +1 -0
- package/src/cluster/index.ts +4 -0
- package/src/cluster/json-source.ts +71 -0
- package/src/cluster/payload-value.ts +84 -0
- package/src/cluster/validators.ts +31 -2
- package/src/config-validator.js +3 -2
- package/src/isolation-manager.js +6 -2
- package/src/orchestrator.js +36 -16
- package/src/preflight.js +2 -1
- package/task-lib/attachable-watcher.js +1 -0
- package/task-lib/command-spec-cleanup.js +57 -11
- package/task-lib/commands/run.js +1 -0
- package/task-lib/provider-session-capture.js +8 -0
- package/task-lib/runner.js +9 -6
- package/task-lib/watcher.js +1 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firstInputValidationIssue = firstInputValidationIssue;
|
|
4
|
+
exports.assertInputValue = assertInputValue;
|
|
5
|
+
const errors_js_1 = require("./errors.cjs");
|
|
6
|
+
function isJsonInteger(value) {
|
|
7
|
+
return typeof value === 'number' && Number.isFinite(value) && Number.isInteger(value);
|
|
8
|
+
}
|
|
9
|
+
function evaluate(type, value, path) {
|
|
10
|
+
switch (type.kind) {
|
|
11
|
+
case 'null':
|
|
12
|
+
return value === null ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'null' };
|
|
13
|
+
case 'boolean':
|
|
14
|
+
return typeof value === 'boolean' ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'boolean' };
|
|
15
|
+
case 'integer':
|
|
16
|
+
return isJsonInteger(value) ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'integer' };
|
|
17
|
+
case 'number':
|
|
18
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
19
|
+
? null
|
|
20
|
+
: { path, code: 'TYPE_MISMATCH', expectedKind: 'number' };
|
|
21
|
+
case 'string':
|
|
22
|
+
return typeof value === 'string' ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'string' };
|
|
23
|
+
case 'enum':
|
|
24
|
+
if (typeof value !== 'string')
|
|
25
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'enum' };
|
|
26
|
+
return type.values.includes(value)
|
|
27
|
+
? null
|
|
28
|
+
: { path, code: 'UNKNOWN_ENUM_LABEL', expectedKind: 'enum' };
|
|
29
|
+
case 'array': {
|
|
30
|
+
if (!Array.isArray(value))
|
|
31
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'array' };
|
|
32
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
33
|
+
const issue = evaluate(type.items, value[index], `${path}/${index}`);
|
|
34
|
+
if (issue)
|
|
35
|
+
return issue;
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
case 'record': {
|
|
40
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
41
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'record' };
|
|
42
|
+
}
|
|
43
|
+
const record = value;
|
|
44
|
+
const fieldNames = Object.keys(type.fields).sort();
|
|
45
|
+
for (const name of fieldNames) {
|
|
46
|
+
const field = type.fields[name];
|
|
47
|
+
if (!field)
|
|
48
|
+
continue;
|
|
49
|
+
const fieldPath = `${path}/${name}`;
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(record, name)) {
|
|
51
|
+
const issue = evaluate(field.type, record[name], fieldPath);
|
|
52
|
+
if (issue)
|
|
53
|
+
return issue;
|
|
54
|
+
}
|
|
55
|
+
else if (field.required) {
|
|
56
|
+
return { path: fieldPath, code: 'MISSING_REQUIRED_FIELD', expectedKind: field.type.kind };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const declared = new Set(fieldNames);
|
|
60
|
+
const unknownField = Object.keys(record).sort().find((name) => !declared.has(name));
|
|
61
|
+
return unknownField
|
|
62
|
+
? { path: `${path}/${unknownField}`, code: 'UNKNOWN_FIELD', expectedKind: 'record' }
|
|
63
|
+
: null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function firstInputValidationIssue(type, value, path = '') {
|
|
68
|
+
const issue = evaluate(type, value, path);
|
|
69
|
+
return issue ? { path: issue.path, code: issue.code } : null;
|
|
70
|
+
}
|
|
71
|
+
function assertInputValue(type, value) {
|
|
72
|
+
const issue = evaluate(type, value, '');
|
|
73
|
+
if (!issue)
|
|
74
|
+
return;
|
|
75
|
+
throw new errors_js_1.ClusterRequestError(`input value at '${issue.path || '/'}' failed validation: ${issue.code}, expected ${issue.expectedKind}`, 'INVALID_INPUT');
|
|
76
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PayloadType } from './generated/protocol.js';
|
|
2
|
+
export type InputValidationIssue = {
|
|
3
|
+
readonly path: string;
|
|
4
|
+
readonly code: 'TYPE_MISMATCH' | 'MISSING_REQUIRED_FIELD' | 'UNKNOWN_FIELD' | 'UNKNOWN_ENUM_LABEL';
|
|
5
|
+
};
|
|
6
|
+
export declare function firstInputValidationIssue(type: PayloadType, value: unknown, path?: string): InputValidationIssue | null;
|
|
7
|
+
export declare function assertInputValue(type: PayloadType, value: unknown): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ClusterRequestError } from './errors.mjs';
|
|
2
|
+
function isJsonInteger(value) {
|
|
3
|
+
return typeof value === 'number' && Number.isFinite(value) && Number.isInteger(value);
|
|
4
|
+
}
|
|
5
|
+
function evaluate(type, value, path) {
|
|
6
|
+
switch (type.kind) {
|
|
7
|
+
case 'null':
|
|
8
|
+
return value === null ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'null' };
|
|
9
|
+
case 'boolean':
|
|
10
|
+
return typeof value === 'boolean' ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'boolean' };
|
|
11
|
+
case 'integer':
|
|
12
|
+
return isJsonInteger(value) ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'integer' };
|
|
13
|
+
case 'number':
|
|
14
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
15
|
+
? null
|
|
16
|
+
: { path, code: 'TYPE_MISMATCH', expectedKind: 'number' };
|
|
17
|
+
case 'string':
|
|
18
|
+
return typeof value === 'string' ? null : { path, code: 'TYPE_MISMATCH', expectedKind: 'string' };
|
|
19
|
+
case 'enum':
|
|
20
|
+
if (typeof value !== 'string')
|
|
21
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'enum' };
|
|
22
|
+
return type.values.includes(value)
|
|
23
|
+
? null
|
|
24
|
+
: { path, code: 'UNKNOWN_ENUM_LABEL', expectedKind: 'enum' };
|
|
25
|
+
case 'array': {
|
|
26
|
+
if (!Array.isArray(value))
|
|
27
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'array' };
|
|
28
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
29
|
+
const issue = evaluate(type.items, value[index], `${path}/${index}`);
|
|
30
|
+
if (issue)
|
|
31
|
+
return issue;
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
case 'record': {
|
|
36
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
37
|
+
return { path, code: 'TYPE_MISMATCH', expectedKind: 'record' };
|
|
38
|
+
}
|
|
39
|
+
const record = value;
|
|
40
|
+
const fieldNames = Object.keys(type.fields).sort();
|
|
41
|
+
for (const name of fieldNames) {
|
|
42
|
+
const field = type.fields[name];
|
|
43
|
+
if (!field)
|
|
44
|
+
continue;
|
|
45
|
+
const fieldPath = `${path}/${name}`;
|
|
46
|
+
if (Object.prototype.hasOwnProperty.call(record, name)) {
|
|
47
|
+
const issue = evaluate(field.type, record[name], fieldPath);
|
|
48
|
+
if (issue)
|
|
49
|
+
return issue;
|
|
50
|
+
}
|
|
51
|
+
else if (field.required) {
|
|
52
|
+
return { path: fieldPath, code: 'MISSING_REQUIRED_FIELD', expectedKind: field.type.kind };
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
const declared = new Set(fieldNames);
|
|
56
|
+
const unknownField = Object.keys(record).sort().find((name) => !declared.has(name));
|
|
57
|
+
return unknownField
|
|
58
|
+
? { path: `${path}/${unknownField}`, code: 'UNKNOWN_FIELD', expectedKind: 'record' }
|
|
59
|
+
: null;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export function firstInputValidationIssue(type, value, path = '') {
|
|
64
|
+
const issue = evaluate(type, value, path);
|
|
65
|
+
return issue ? { path: issue.path, code: issue.code } : null;
|
|
66
|
+
}
|
|
67
|
+
export function assertInputValue(type, value) {
|
|
68
|
+
const issue = evaluate(type, value, '');
|
|
69
|
+
if (!issue)
|
|
70
|
+
return;
|
|
71
|
+
throw new ClusterRequestError(`input value at '${issue.path || '/'}' failed validation: ${issue.code}, expected ${issue.expectedKind}`, 'INVALID_INPUT');
|
|
72
|
+
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.assertDefinition = assertDefinition;
|
|
4
4
|
exports.assertMethodResult = assertMethodResult;
|
|
5
|
+
exports.assertGraphSpec = assertGraphSpec;
|
|
6
|
+
exports.assertGraphProfile = assertGraphProfile;
|
|
7
|
+
exports.assertGraphProfileSupported = assertGraphProfileSupported;
|
|
5
8
|
const _2020_js_1 = require("ajv/dist/2020.js");
|
|
6
9
|
const protocol_js_1 = require("./generated/protocol.cjs");
|
|
7
10
|
const protocol_schema_js_1 = require("./generated/protocol-schema.cjs");
|
|
@@ -44,3 +47,21 @@ function assertMethodResult(method, value) {
|
|
|
44
47
|
throw error;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
50
|
+
function assertRequestDefinition(definition, value, code) {
|
|
51
|
+
const validate = validatorFor(definition);
|
|
52
|
+
if (validate(value))
|
|
53
|
+
return;
|
|
54
|
+
const details = (validate.errors ?? []).map((error) => `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`).join('; ');
|
|
55
|
+
throw new errors_js_1.ClusterRequestError(`${definition} validation failed: ${details}`, code);
|
|
56
|
+
}
|
|
57
|
+
function assertGraphSpec(value) {
|
|
58
|
+
assertRequestDefinition('GraphSpec', value, 'INVALID_GRAPH');
|
|
59
|
+
}
|
|
60
|
+
function assertGraphProfile(value) {
|
|
61
|
+
assertRequestDefinition('GraphProfile', value, 'INVALID_GRAPH_PROFILE');
|
|
62
|
+
}
|
|
63
|
+
function assertGraphProfileSupported(profile, capabilities) {
|
|
64
|
+
if (!capabilities.graphProfiles?.includes(profile)) {
|
|
65
|
+
throw new errors_js_1.ClusterRequestError(`graph profile ${profile} is not among the server's advertised graphProfiles`, 'UNSUPPORTED_GRAPH_PROFILE');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import type { ClusterMethod } from './generated/protocol.js';
|
|
1
|
+
import type { ClusterMethod, GraphProfile, GraphSpec, ServerCapabilities } from './generated/protocol.js';
|
|
2
2
|
export declare function assertDefinition(definition: string, value: unknown): void;
|
|
3
3
|
export declare function assertMethodResult(method: ClusterMethod, value: unknown): void;
|
|
4
|
+
export declare function assertGraphSpec(value: unknown): asserts value is GraphSpec;
|
|
5
|
+
export declare function assertGraphProfile(value: unknown): asserts value is GraphProfile;
|
|
6
|
+
export declare function assertGraphProfileSupported(profile: GraphProfile, capabilities: ServerCapabilities): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Ajv2020 from 'ajv/dist/2020.js';
|
|
2
2
|
import { METHOD_RESULT_DEFINITIONS, PROTOCOL_VERSION, } from './generated/protocol.mjs';
|
|
3
3
|
import { CLUSTER_PROTOCOL_SCHEMA } from './generated/protocol-schema.mjs';
|
|
4
|
-
import { ClusterProtocolError } from './errors.mjs';
|
|
4
|
+
import { ClusterProtocolError, ClusterRequestError } from './errors.mjs';
|
|
5
5
|
const ajv = new Ajv2020({
|
|
6
6
|
allErrors: true,
|
|
7
7
|
strict: false,
|
|
@@ -40,3 +40,21 @@ export function assertMethodResult(method, value) {
|
|
|
40
40
|
throw error;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
|
+
function assertRequestDefinition(definition, value, code) {
|
|
44
|
+
const validate = validatorFor(definition);
|
|
45
|
+
if (validate(value))
|
|
46
|
+
return;
|
|
47
|
+
const details = (validate.errors ?? []).map((error) => `${error.instancePath || '/'} ${error.message ?? 'is invalid'}`).join('; ');
|
|
48
|
+
throw new ClusterRequestError(`${definition} validation failed: ${details}`, code);
|
|
49
|
+
}
|
|
50
|
+
export function assertGraphSpec(value) {
|
|
51
|
+
assertRequestDefinition('GraphSpec', value, 'INVALID_GRAPH');
|
|
52
|
+
}
|
|
53
|
+
export function assertGraphProfile(value) {
|
|
54
|
+
assertRequestDefinition('GraphProfile', value, 'INVALID_GRAPH_PROFILE');
|
|
55
|
+
}
|
|
56
|
+
export function assertGraphProfileSupported(profile, capabilities) {
|
|
57
|
+
if (!capabilities.graphProfiles?.includes(profile)) {
|
|
58
|
+
throw new ClusterRequestError(`graph profile ${profile} is not among the server's advertised graphProfiles`, 'UNSUPPORTED_GRAPH_PROFILE');
|
|
59
|
+
}
|
|
60
|
+
}
|
package/lib/provider-names.js
CHANGED
|
@@ -63,15 +63,25 @@ function providerSupportsCapability(name, capability) {
|
|
|
63
63
|
return registry.supportsProviderCapability(name, capability);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
function providerSupportsOutputReformatting(name) {
|
|
67
|
+
return registry.supportsProviderOutputReformatting(name);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getDefaultProviderId() {
|
|
71
|
+
return registry.getDefaultProviderId();
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
module.exports = {
|
|
67
75
|
KNOWN_PROVIDER_NAMES,
|
|
68
76
|
PROVIDER_ALIASES,
|
|
69
77
|
PROVIDER_CAPABILITIES,
|
|
70
78
|
VALID_PROVIDERS,
|
|
79
|
+
getDefaultProviderId,
|
|
71
80
|
getProviderMetadata,
|
|
72
81
|
listProviderMetadata,
|
|
73
82
|
normalizeProviderName,
|
|
74
83
|
normalizeProviderSettings,
|
|
75
84
|
providerSupportsCapability,
|
|
85
|
+
providerSupportsOutputReformatting,
|
|
76
86
|
resolveProviderCommand,
|
|
77
87
|
};
|
package/lib/settings.js
CHANGED
|
@@ -11,6 +11,7 @@ const lockfile = require('proper-lockfile');
|
|
|
11
11
|
const { validateMountConfig, validateEnvPassthrough } = require('./docker-config');
|
|
12
12
|
const {
|
|
13
13
|
VALID_PROVIDERS,
|
|
14
|
+
getDefaultProviderId,
|
|
14
15
|
normalizeProviderName,
|
|
15
16
|
normalizeProviderSettings,
|
|
16
17
|
} = require('./provider-names');
|
|
@@ -119,7 +120,7 @@ function validateModelAgainstMax(requestedModel, maxModel, minModel = null) {
|
|
|
119
120
|
const DEFAULT_SETTINGS_BASE = {
|
|
120
121
|
maxModel: 'opus', // Cost ceiling - agents cannot use models above this
|
|
121
122
|
minModel: null, // Cost floor - agents cannot use models below this (null = no minimum)
|
|
122
|
-
defaultProvider:
|
|
123
|
+
defaultProvider: getDefaultProviderId(),
|
|
123
124
|
get providerSettings() {
|
|
124
125
|
// Dynamically build from providers on first access
|
|
125
126
|
return getProviderDefaults();
|
|
@@ -297,7 +298,10 @@ function mergeLoadedSettings(parsed) {
|
|
|
297
298
|
const merged = { ...resolvedDefaultSettings(), ...normalized };
|
|
298
299
|
merged.defaultProvider =
|
|
299
300
|
normalizeProviderName(merged.defaultProvider) || DEFAULT_SETTINGS.defaultProvider;
|
|
300
|
-
merged.providerSettings = mergeProviderSettings(
|
|
301
|
+
merged.providerSettings = mergeProviderSettings(
|
|
302
|
+
getProviderDefaults(),
|
|
303
|
+
normalized.providerSettings
|
|
304
|
+
);
|
|
301
305
|
if (
|
|
302
306
|
merged.autoCheckUpdates === false ||
|
|
303
307
|
typeof merged.lastUpdateCheckClaim !== 'string' ||
|
|
@@ -351,7 +355,6 @@ function readSettingsForMutation(settingsFile) {
|
|
|
351
355
|
};
|
|
352
356
|
}
|
|
353
357
|
|
|
354
|
-
|
|
355
358
|
const updatesDisabled = parsed.autoCheckUpdates === false || parsed.updatePolicy === 'off';
|
|
356
359
|
return {
|
|
357
360
|
settings: mergeLoadedSettings(parsed),
|
package/lib/setup-plan.js
CHANGED
|
@@ -77,6 +77,7 @@ function defaultDeps() {
|
|
|
77
77
|
const { execSync } = require('../src/lib/safe-exec');
|
|
78
78
|
const { listProviders, getProvider } = require('../src/providers');
|
|
79
79
|
const { getProviderDefaults } = require('./provider-defaults');
|
|
80
|
+
const { getDefaultProviderId } = require('./provider-names');
|
|
80
81
|
const packageJson = require('../package.json');
|
|
81
82
|
|
|
82
83
|
return {
|
|
@@ -88,6 +89,7 @@ function defaultDeps() {
|
|
|
88
89
|
listProviders,
|
|
89
90
|
getProvider,
|
|
90
91
|
getProviderDefaults,
|
|
92
|
+
getDefaultProviderId,
|
|
91
93
|
getNodeVersion: () => process.version,
|
|
92
94
|
getPackageVersion: () => packageJson.version,
|
|
93
95
|
};
|
|
@@ -204,11 +206,9 @@ function buildRecommendedAndRisk({ cwd, facts, env, deps }) {
|
|
|
204
206
|
const recommended = {};
|
|
205
207
|
const risk = {};
|
|
206
208
|
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
recommended.defaultProvider = firstAvailableProvider ? firstAvailableProvider[0] : 'claude';
|
|
211
|
-
risk.defaultProvider = firstAvailableProvider ? 'low' : 'medium';
|
|
209
|
+
const registryDefault = deps.getDefaultProviderId();
|
|
210
|
+
recommended.defaultProvider = registryDefault;
|
|
211
|
+
risk.defaultProvider = facts.providers[registryDefault]?.cliAvailable ? 'low' : 'medium';
|
|
212
212
|
|
|
213
213
|
for (const name of Object.keys(facts.providers)) {
|
|
214
214
|
recommended[providerLevelDecisionId(name)] = buildProviderLevelRecommendation(name, deps);
|
package/lib/start-cluster.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const { spawnSync } = require('child_process');
|
|
3
3
|
const chalk = require('chalk');
|
|
4
|
-
const { normalizeProviderName } = require('./provider-names');
|
|
4
|
+
const { normalizeProviderName, getDefaultProviderId } = require('./provider-names');
|
|
5
5
|
const { getProvider } = require('../src/providers');
|
|
6
6
|
const { detectProvider } = require('../src/issue-providers');
|
|
7
7
|
const TemplateResolver = require('../src/template-resolver');
|
|
@@ -161,9 +161,9 @@ function resolveConfigPath(configName) {
|
|
|
161
161
|
|
|
162
162
|
function ensureConfigProviderDefaults(config, settings) {
|
|
163
163
|
if (!config.defaultProvider) {
|
|
164
|
-
config.defaultProvider = settings.defaultProvider ||
|
|
164
|
+
config.defaultProvider = settings.defaultProvider || getDefaultProviderId();
|
|
165
165
|
}
|
|
166
|
-
config.defaultProvider = normalizeProviderName(config.defaultProvider) ||
|
|
166
|
+
config.defaultProvider = normalizeProviderName(config.defaultProvider) || getDefaultProviderId();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
function applyProviderOverrideToConfig(config, providerOverride, settings) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-open-engine/zeroshot",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.19.0",
|
|
4
4
|
"description": "Multi-agent orchestration engine for Claude, Codex, and Gemini",
|
|
5
5
|
"main": "src/orchestrator.js",
|
|
6
6
|
"bin": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"test:providers:live": "npm run build:agent-cli-provider && node scripts/live-provider-smoke.js",
|
|
51
51
|
"check:agent-cli-provider": "npm run check:agent-cli-provider:ci",
|
|
52
52
|
"check:agent-cli-provider:ci": "npm run typecheck:agent-cli-provider && npm run lint:agent-cli-provider && npm run build:agent-cli-provider && npm run test:agent-cli-provider",
|
|
53
|
-
"test:cluster-client": "npm run build:cluster && node --test tests/cluster/client.test.js tests/cluster/parity.test.js tests/cluster/architecture.test.js tests/cluster/verifier-regressions.test.js",
|
|
53
|
+
"test:cluster-client": "npm run build:cluster && node --test tests/cluster/client.test.js tests/cluster/parity.test.js tests/cluster/architecture.test.js tests/cluster/verifier-regressions.test.js tests/cluster/request-validation.test.js",
|
|
54
54
|
"test:cluster-package": "npm run build:cluster && node --test tests/cluster/package.test.js",
|
|
55
55
|
"dev:link": "npm link",
|
|
56
56
|
"lint": "eslint .",
|
|
@@ -18,7 +18,7 @@ const IsolationManager = require('../isolation-manager');
|
|
|
18
18
|
const crypto = require('crypto');
|
|
19
19
|
const { bufferMessage, scheduleDrain, drainBufferedMessages } = require('../message-buffer');
|
|
20
20
|
const { isPlatformSupported } = require('./agent-stuck-detector');
|
|
21
|
-
const { normalizeProviderName } = require('../../lib/provider-names');
|
|
21
|
+
const { normalizeProviderName, getDefaultProviderId } = require('../../lib/provider-names');
|
|
22
22
|
const { loadSettings } = require('../../lib/settings');
|
|
23
23
|
const { findPlatformMismatchReason } = require('./validation-platform');
|
|
24
24
|
const { calculateRateLimitDelay, isRateLimitError } = require('./rate-limit-backoff');
|
|
@@ -64,7 +64,7 @@ async function createValidatorIsolation(agent, isolationConfig) {
|
|
|
64
64
|
cluster.config?.forceProvider ||
|
|
65
65
|
cluster.config?.defaultProvider ||
|
|
66
66
|
loadSettings().defaultProvider ||
|
|
67
|
-
|
|
67
|
+
getDefaultProviderId()
|
|
68
68
|
);
|
|
69
69
|
// Run validators on the provider's image variant (installs its CLI as a Docker-cached layer).
|
|
70
70
|
const image = IsolationManager.imageForProvider(providerName, isolationConfig.image);
|
|
@@ -427,7 +427,7 @@ function publishTaskStarted(agent, triggeringMessage) {
|
|
|
427
427
|
agent._publishLifecycle('TASK_STARTED', {
|
|
428
428
|
iteration: agent.iteration,
|
|
429
429
|
model: agent._selectModel(),
|
|
430
|
-
provider: agent._resolveProvider ? agent._resolveProvider() :
|
|
430
|
+
provider: agent._resolveProvider ? agent._resolveProvider() : getDefaultProviderId(),
|
|
431
431
|
modelSpec,
|
|
432
432
|
triggeredBy: triggeringMessage.topic,
|
|
433
433
|
triggerFrom: triggeringMessage.sender,
|
|
@@ -447,7 +447,7 @@ function publishTaskCompleted(agent, result) {
|
|
|
447
447
|
iteration: agent.iteration,
|
|
448
448
|
success: true,
|
|
449
449
|
taskId: agent.currentTaskId,
|
|
450
|
-
provider: agent._resolveProvider ? agent._resolveProvider() :
|
|
450
|
+
provider: agent._resolveProvider ? agent._resolveProvider() : getDefaultProviderId(),
|
|
451
451
|
tokenUsage: result.tokenUsage || null,
|
|
452
452
|
contextSequence: session?.contextSequence ?? agent.currentContextSequence,
|
|
453
453
|
guidanceSequence: session?.guidanceSequence ?? agent.currentGuidanceSequence ?? null,
|