@the-open-engine/zeroshot 6.29.1 → 6.30.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 +4 -0
- package/lib/agent-cli-provider/contract-actions.d.ts +1 -1
- package/lib/agent-cli-provider/contract-actions.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-actions.js +5 -5
- package/lib/agent-cli-provider/contract-actions.js.map +1 -1
- package/lib/agent-cli-provider/contract-invoke.d.ts +1 -1
- package/lib/agent-cli-provider/contract-invoke.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-invoke.js +2 -2
- package/lib/agent-cli-provider/contract-invoke.js.map +1 -1
- package/lib/agent-cli-provider/contract-support.d.ts +1 -1
- package/lib/agent-cli-provider/contract-support.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract-support.js +2 -2
- package/lib/agent-cli-provider/contract-support.js.map +1 -1
- package/lib/agent-cli-provider/contract.d.ts +1 -0
- package/lib/agent-cli-provider/contract.d.ts.map +1 -1
- package/lib/agent-cli-provider/contract.js +1 -1
- package/lib/agent-cli-provider/contract.js.map +1 -1
- package/lib/agent-cli-provider/index.d.ts +1 -1
- 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/provider-registry.d.ts +1 -0
- package/lib/agent-cli-provider/provider-registry.d.ts.map +1 -1
- package/lib/agent-cli-provider/provider-registry.js +4 -0
- package/lib/agent-cli-provider/provider-registry.js.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.d.ts +3 -3
- package/lib/agent-cli-provider/single-agent-runtime.d.ts.map +1 -1
- package/lib/agent-cli-provider/single-agent-runtime.js +22 -48
- package/lib/agent-cli-provider/single-agent-runtime.js.map +1 -1
- package/lib/cluster-worker/engine-adapter-common.js +37 -0
- package/lib/cluster-worker/engine-adapter.js +20 -20
- package/lib/cluster-worker/engine-start.js +59 -0
- package/lib/cluster-worker/index.js +49 -67
- package/lib/cluster-worker/runtime-dependencies.js +49 -0
- package/lib/cluster-worker/runtime-support.js +2 -34
- package/lib/cluster-worker/terminal-normalizer.js +9 -10
- package/package.json +11 -1
- package/protocol/openengine-cluster/v1/worker.schema.json +171 -9
- package/src/agent-cli-provider/contract-actions.ts +9 -5
- package/src/agent-cli-provider/contract-invoke.ts +3 -2
- package/src/agent-cli-provider/contract-support.ts +12 -6
- package/src/agent-cli-provider/contract.ts +6 -1
- package/src/agent-cli-provider/index.ts +1 -0
- package/src/agent-cli-provider/provider-registry.ts +4 -0
- package/src/agent-cli-provider/single-agent-runtime.ts +32 -45
|
@@ -86,23 +86,19 @@ type MutableModelSpec = {
|
|
|
86
86
|
const MODEL_LEVELS: readonly ModelLevel[] = ['level1', 'level2', 'level3'];
|
|
87
87
|
const REASONING_EFFORTS: readonly ReasoningEffort[] = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
88
88
|
const LEGACY_ISOLATED_PROVIDER_SETTINGS_ENV = 'ZEROSHOT_ISOLATED_PROVIDER_SETTINGS_JSON';
|
|
89
|
-
const settingsModule: unknown = require('../../lib/settings');
|
|
90
89
|
const providerDetectionModule: unknown = require('../../lib/provider-detection');
|
|
91
|
-
const claudeAuthModule: unknown = require('../../lib/settings/claude-auth');
|
|
92
90
|
|
|
93
|
-
const loadSettingsFn = moduleFunction(settingsModule, 'loadSettings');
|
|
94
|
-
const getClaudeCommandFn = moduleFunction(settingsModule, 'getClaudeCommand');
|
|
95
91
|
const commandExistsFn = moduleFunction(providerDetectionModule, 'commandExists');
|
|
96
92
|
const getHelpOutputFn = moduleFunction(providerDetectionModule, 'getHelpOutput');
|
|
97
93
|
const getVersionOutputFn = moduleFunction(providerDetectionModule, 'getVersionOutput');
|
|
98
|
-
const resolveClaudeAuthFn = moduleFunction(claudeAuthModule, 'resolveClaudeAuth');
|
|
99
94
|
|
|
100
95
|
export function prepareSingleAgentProviderCommand(
|
|
101
|
-
input: SingleAgentProviderCommandInput
|
|
96
|
+
input: SingleAgentProviderCommandInput,
|
|
97
|
+
runtimeSettings?: Record<string, unknown>
|
|
102
98
|
): PreparedSingleAgentProviderCommand {
|
|
103
99
|
rejectCallerSuppliedModelProvenance(input);
|
|
104
100
|
const baseOptions = input.options ?? {};
|
|
105
|
-
const settings = loadRuntimeSettings();
|
|
101
|
+
const settings = runtimeSettings ?? loadRuntimeSettings();
|
|
106
102
|
const adapter = adapterForRuntimeInput(input.provider, settings);
|
|
107
103
|
const providerSettings = runtimeProviderSettings(
|
|
108
104
|
settings,
|
|
@@ -116,7 +112,8 @@ export function prepareSingleAgentProviderCommand(
|
|
|
116
112
|
const cliFeatures = resolveRuntimeCliFeatures(
|
|
117
113
|
adapter.id,
|
|
118
114
|
baseOptions.cliFeatures,
|
|
119
|
-
requestedWebSearch === true
|
|
115
|
+
requestedWebSearch === true,
|
|
116
|
+
settings
|
|
120
117
|
);
|
|
121
118
|
const authEnv = baseOptions.authEnv ?? resolveRuntimeAuthEnv(adapter.id, settings);
|
|
122
119
|
const options = buildRuntimeOptions(baseOptions, adapter, providerSettings, {
|
|
@@ -161,17 +158,21 @@ function buildRuntimeCommand(
|
|
|
161
158
|
return recoveryAdapter.buildStructuredOutputRecoveryCommand(context, options);
|
|
162
159
|
}
|
|
163
160
|
|
|
164
|
-
export function detectRuntimeProviderCliFeatures(
|
|
165
|
-
|
|
161
|
+
export function detectRuntimeProviderCliFeatures(
|
|
162
|
+
provider: string,
|
|
163
|
+
runtimeSettings?: Record<string, unknown>
|
|
164
|
+
): ProviderCliFeatures {
|
|
165
|
+
return probeRuntimeProviderCli(provider, undefined, runtimeSettings).capabilities;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
function resolveRuntimeCliFeatures(
|
|
169
169
|
provider: ProviderId,
|
|
170
170
|
overrides: CliFeatureOverrides | undefined,
|
|
171
|
-
webSearchRequested: boolean
|
|
171
|
+
webSearchRequested: boolean,
|
|
172
|
+
runtimeSettings: Record<string, unknown>
|
|
172
173
|
): CliFeatureOverrides {
|
|
173
174
|
if (provider === 'gateway') {
|
|
174
|
-
const detected = detectRuntimeProviderCliFeatures(provider);
|
|
175
|
+
const detected = detectRuntimeProviderCliFeatures(provider, runtimeSettings);
|
|
175
176
|
return {
|
|
176
177
|
...detected,
|
|
177
178
|
...overrides,
|
|
@@ -180,13 +181,13 @@ function resolveRuntimeCliFeatures(
|
|
|
180
181
|
};
|
|
181
182
|
}
|
|
182
183
|
if (getProviderRegistryEntry(provider).invoke.lane === 'acp-stdio') {
|
|
183
|
-
const detected = detectRuntimeProviderCliFeatures(provider);
|
|
184
|
+
const detected = detectRuntimeProviderCliFeatures(provider, runtimeSettings);
|
|
184
185
|
if (overrides === undefined) return detected;
|
|
185
186
|
return mergeAcpFailClosedCliFeatures(detected, overrides);
|
|
186
187
|
}
|
|
187
|
-
if (overrides === undefined) return detectRuntimeProviderCliFeatures(provider);
|
|
188
|
+
if (overrides === undefined) return detectRuntimeProviderCliFeatures(provider, runtimeSettings);
|
|
188
189
|
if (!webSearchRequested) return overrides;
|
|
189
|
-
const detected = detectRuntimeProviderCliFeatures(provider);
|
|
190
|
+
const detected = detectRuntimeProviderCliFeatures(provider, runtimeSettings);
|
|
190
191
|
return {
|
|
191
192
|
...overrides,
|
|
192
193
|
supportsResume:
|
|
@@ -225,14 +226,16 @@ function mergeAcpFailClosedCliFeatures(
|
|
|
225
226
|
|
|
226
227
|
export function probeRuntimeProviderCli(
|
|
227
228
|
provider: string,
|
|
228
|
-
evidence?: RuntimeProbeEvidence
|
|
229
|
+
evidence?: RuntimeProbeEvidence,
|
|
230
|
+
runtimeSettings?: Record<string, unknown>
|
|
229
231
|
): RuntimeProviderProbe {
|
|
230
232
|
const adapter = getProviderAdapter(provider);
|
|
231
233
|
if (adapter.id === 'gateway') {
|
|
232
|
-
return probeGatewayProvider(adapter);
|
|
234
|
+
return probeGatewayProvider(adapter, runtimeSettings);
|
|
233
235
|
}
|
|
234
236
|
const requested = getProviderRegistryEntry(adapter.id).settingsFields.includes('webSearch')
|
|
235
|
-
? runtimeProviderSettings(loadRuntimeSettings(), adapter.id, process.cwd())
|
|
237
|
+
? runtimeProviderSettings(runtimeSettings ?? loadRuntimeSettings(), adapter.id, process.cwd())
|
|
238
|
+
.webSearch === true
|
|
236
239
|
: false;
|
|
237
240
|
const helpCommand = runtimeHelpCommand(adapter.id);
|
|
238
241
|
const commandAvailable =
|
|
@@ -406,7 +409,9 @@ function resolveRuntimeAuthEnv(
|
|
|
406
409
|
settings: Record<string, unknown>
|
|
407
410
|
): Readonly<Record<string, string>> {
|
|
408
411
|
if (provider !== 'claude') return {};
|
|
409
|
-
|
|
412
|
+
const claudeAuthModule: unknown = require('../../lib/settings/claude-auth');
|
|
413
|
+
const resolveClaudeAuth = moduleFunction(claudeAuthModule, 'resolveClaudeAuth');
|
|
414
|
+
return stringRecordFromUnknown(resolveClaudeAuth(settings), 'resolveClaudeAuth');
|
|
410
415
|
}
|
|
411
416
|
|
|
412
417
|
function adapterForRuntimeInput(
|
|
@@ -452,16 +457,16 @@ function runtimeProviderSettings(
|
|
|
452
457
|
}
|
|
453
458
|
|
|
454
459
|
function runtimeHelpCommand(provider: ProviderId): CommandParts {
|
|
455
|
-
if (provider === 'claude') {
|
|
456
|
-
return commandPartsFromUnknown(getClaudeCommandFn(), 'getClaudeCommand');
|
|
457
|
-
}
|
|
458
460
|
return resolveProviderCommand(provider);
|
|
459
461
|
}
|
|
460
462
|
|
|
461
|
-
function probeGatewayProvider(
|
|
463
|
+
function probeGatewayProvider(
|
|
464
|
+
adapter: ProviderAdapter,
|
|
465
|
+
runtimeSettings?: Record<string, unknown>
|
|
466
|
+
): RuntimeProviderProbe {
|
|
462
467
|
const capabilities = attestedCliFeatures(adapter, '', '');
|
|
463
468
|
try {
|
|
464
|
-
const settings = loadRuntimeSettings();
|
|
469
|
+
const settings = runtimeSettings ?? loadRuntimeSettings();
|
|
465
470
|
const providerSettings = runtimeProviderSettings(settings, 'gateway', process.cwd());
|
|
466
471
|
resolveGatewayConfiguration(
|
|
467
472
|
providerSettings.gateway,
|
|
@@ -532,7 +537,9 @@ function loadRuntimeSettings(): Record<string, unknown> {
|
|
|
532
537
|
`${LEGACY_ISOLATED_PROVIDER_SETTINGS_ENV} is not a trusted settings channel; use the settings file.`
|
|
533
538
|
);
|
|
534
539
|
}
|
|
535
|
-
|
|
540
|
+
const settingsModule: unknown = require('../../lib/settings');
|
|
541
|
+
const loadSettings = moduleFunction(settingsModule, 'loadSettings');
|
|
542
|
+
return requiredRecord(loadSettings(), 'loadSettings');
|
|
536
543
|
}
|
|
537
544
|
|
|
538
545
|
function rejectCallerSuppliedModelProvenance(input: SingleAgentProviderCommandInput): void {
|
|
@@ -554,13 +561,6 @@ function isUnknownFunction(value: unknown): value is UnknownFunction {
|
|
|
554
561
|
return typeof value === 'function';
|
|
555
562
|
}
|
|
556
563
|
|
|
557
|
-
function commandPartsFromUnknown(value: unknown, field: string): CommandParts {
|
|
558
|
-
const record = requiredRecord(value, field);
|
|
559
|
-
return {
|
|
560
|
-
command: requiredStringValue(record.command, `${field}.command`),
|
|
561
|
-
args: stringArray(record.args, `${field}.args`),
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
564
|
|
|
565
565
|
function levelOverridesFromUnknown(value: unknown, field: string): LevelOverrides {
|
|
566
566
|
if (value === undefined) return {};
|
|
@@ -632,10 +632,6 @@ function optionalString(value: unknown, field: string): string | undefined {
|
|
|
632
632
|
throw new Error(`${field} must be a string.`);
|
|
633
633
|
}
|
|
634
634
|
|
|
635
|
-
function requiredStringValue(value: unknown, field: string): string {
|
|
636
|
-
if (typeof value === 'string' && value.length > 0) return value;
|
|
637
|
-
throw new Error(`${field} must be a non-empty string.`);
|
|
638
|
-
}
|
|
639
635
|
|
|
640
636
|
function optionalRecord(
|
|
641
637
|
value: unknown,
|
|
@@ -661,15 +657,6 @@ function stringRecordFromUnknown(value: unknown, field: string): Readonly<Record
|
|
|
661
657
|
return result;
|
|
662
658
|
}
|
|
663
659
|
|
|
664
|
-
function stringArray(value: unknown, field: string): readonly string[] {
|
|
665
|
-
if (!Array.isArray(value)) throw new Error(`${field} must be an array.`);
|
|
666
|
-
const result: string[] = [];
|
|
667
|
-
for (const item of value) {
|
|
668
|
-
if (typeof item !== 'string') throw new Error(`${field} entries must be strings.`);
|
|
669
|
-
result.push(item);
|
|
670
|
-
}
|
|
671
|
-
return result;
|
|
672
|
-
}
|
|
673
660
|
|
|
674
661
|
function stringResult(value: unknown): string {
|
|
675
662
|
if (typeof value === 'string') return value;
|