@the-open-engine/zeroshot 6.29.0 → 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/cli/index.js +2 -4
- package/lib/agent-cli-provider/adapters/codex.d.ts.map +1 -1
- package/lib/agent-cli-provider/adapters/codex.js +0 -1
- package/lib/agent-cli-provider/adapters/codex.js.map +1 -1
- 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/client.cjs +30 -7
- package/lib/cluster/client.d.cts +52 -0
- package/lib/cluster/client.d.mts +52 -0
- package/lib/cluster/client.d.ts +4 -6
- package/lib/cluster/client.mjs +32 -9
- package/lib/cluster/connection-state.cjs +25 -0
- package/lib/cluster/connection-state.d.cts +13 -0
- package/lib/cluster/connection-state.d.mts +13 -0
- package/lib/cluster/connection-state.d.ts +13 -0
- package/lib/cluster/connection-state.mjs +21 -0
- package/lib/{target/hosted-run/contracts.js → cluster/connection-types.cjs} +0 -1
- package/lib/cluster/connection-types.d.cts +33 -0
- package/lib/cluster/connection-types.d.mts +33 -0
- package/lib/cluster/connection-types.d.ts +33 -0
- package/lib/cluster/connection-types.mjs +1 -0
- package/lib/cluster/connection.cjs +18 -46
- package/lib/cluster/connection.d.cts +26 -0
- package/lib/cluster/connection.d.mts +26 -0
- package/lib/cluster/connection.d.ts +7 -25
- package/lib/cluster/connection.mjs +12 -42
- package/lib/cluster/errors.cjs +9 -1
- package/lib/cluster/errors.d.cts +29 -0
- package/lib/cluster/errors.d.mts +29 -0
- package/lib/cluster/errors.d.ts +4 -0
- package/lib/cluster/errors.mjs +7 -0
- package/lib/cluster/frames.d.cts +12 -0
- package/lib/cluster/frames.d.mts +12 -0
- package/lib/cluster/generated/protocol-schema.d.cts +1 -0
- package/lib/cluster/generated/protocol-schema.d.mts +1 -0
- package/lib/cluster/generated/protocol.d.cts +781 -0
- package/lib/cluster/generated/protocol.d.mts +781 -0
- package/lib/cluster/index.cjs +2 -2
- package/lib/cluster/index.d.cts +13 -0
- package/lib/cluster/index.d.mts +13 -0
- package/lib/cluster/index.d.ts +3 -3
- package/lib/cluster/index.mjs +2 -2
- package/lib/cluster/json-source.cjs +1 -0
- package/lib/cluster/json-source.d.cts +5 -0
- package/lib/cluster/json-source.d.mts +5 -0
- package/lib/cluster/json-source.d.ts +1 -0
- package/lib/cluster/json-source.mjs +1 -0
- package/lib/cluster/payload-value.cjs +1 -0
- package/lib/cluster/payload-value.d.cts +8 -0
- package/lib/cluster/payload-value.d.mts +8 -0
- package/lib/cluster/payload-value.d.ts +1 -0
- package/lib/cluster/payload-value.mjs +1 -0
- package/lib/cluster/queue.d.cts +15 -0
- package/lib/cluster/queue.d.mts +15 -0
- package/lib/cluster/socket.cjs +8 -0
- package/lib/cluster/socket.d.cts +13 -0
- package/lib/cluster/socket.d.mts +13 -0
- package/lib/cluster/socket.d.ts +2 -0
- package/lib/cluster/socket.mjs +7 -0
- package/lib/cluster/subscriptions.d.cts +73 -0
- package/lib/cluster/subscriptions.d.mts +73 -0
- package/lib/cluster/subscriptions.d.ts +5 -1
- package/lib/cluster/validators.cjs +1 -0
- package/lib/cluster/validators.d.cts +7 -0
- package/lib/cluster/validators.d.mts +7 -0
- package/lib/cluster/validators.d.ts +1 -0
- package/lib/cluster/validators.mjs +1 -0
- package/lib/cluster-worker/engine-adapter-common.js +37 -0
- package/lib/cluster-worker/engine-adapter.js +24 -30
- package/lib/cluster-worker/engine-start.js +59 -0
- package/lib/cluster-worker/index.js +49 -67
- package/lib/cluster-worker/profiles.js +1 -42
- 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/lib/hosted-session/authority.cjs +61 -0
- package/lib/hosted-session/authority.d.cts +3 -0
- package/lib/hosted-session/authority.d.mts +3 -0
- package/lib/hosted-session/authority.d.ts +3 -0
- package/lib/hosted-session/authority.mjs +57 -0
- package/lib/hosted-session/coordinator.cjs +78 -51
- package/lib/hosted-session/coordinator.d.cts +11 -0
- package/lib/hosted-session/coordinator.d.mts +11 -0
- package/lib/hosted-session/coordinator.d.ts +4 -2
- package/lib/hosted-session/coordinator.mjs +75 -51
- package/lib/hosted-session/errors.cjs +25 -0
- package/lib/hosted-session/errors.d.cts +10 -0
- package/lib/hosted-session/errors.d.mts +10 -0
- package/lib/hosted-session/errors.d.ts +10 -0
- package/lib/hosted-session/errors.mjs +19 -0
- package/lib/hosted-session/index.cjs +4 -1
- package/lib/hosted-session/index.d.cts +2 -0
- package/lib/hosted-session/index.d.mts +2 -0
- package/lib/hosted-session/index.d.ts +2 -2
- package/lib/hosted-session/index.mjs +1 -1
- package/lib/hosted-session/reconnecting-watch.cjs +131 -0
- package/lib/hosted-session/reconnecting-watch.d.cts +13 -0
- package/lib/hosted-session/reconnecting-watch.d.mts +13 -0
- package/lib/hosted-session/reconnecting-watch.d.ts +13 -0
- package/lib/hosted-session/reconnecting-watch.mjs +127 -0
- package/lib/hosted-session/types.d.cts +32 -0
- package/lib/hosted-session/types.d.mts +32 -0
- package/lib/hosted-session/types.d.ts +19 -7
- package/lib/hosted-target/access-url.cjs +44 -0
- package/lib/hosted-target/access-url.d.cts +2 -0
- package/lib/hosted-target/access-url.d.mts +2 -0
- package/lib/hosted-target/access-url.d.ts +2 -0
- package/lib/hosted-target/access-url.mjs +41 -0
- package/lib/hosted-target/adapter-request.cjs +12 -0
- package/lib/hosted-target/adapter-request.d.cts +17 -0
- package/lib/hosted-target/adapter-request.d.mts +17 -0
- package/lib/hosted-target/adapter-request.d.ts +17 -0
- package/lib/hosted-target/adapter-request.mjs +9 -0
- package/lib/hosted-target/adapter-types.cjs +2 -0
- package/lib/hosted-target/adapter-types.d.cts +27 -0
- package/lib/hosted-target/adapter-types.d.mts +27 -0
- package/lib/hosted-target/adapter-types.d.ts +27 -0
- package/lib/hosted-target/adapter-types.mjs +1 -0
- package/lib/hosted-target/bounds.cjs +10 -0
- package/lib/hosted-target/bounds.d.cts +7 -0
- package/lib/hosted-target/bounds.d.mts +7 -0
- package/lib/hosted-target/bounds.d.ts +7 -0
- package/lib/hosted-target/bounds.mjs +7 -0
- package/lib/hosted-target/capsule-error-response.cjs +76 -0
- package/lib/hosted-target/capsule-error-response.d.cts +2 -0
- package/lib/hosted-target/capsule-error-response.d.mts +2 -0
- package/lib/hosted-target/capsule-error-response.d.ts +2 -0
- package/lib/hosted-target/capsule-error-response.mjs +73 -0
- package/lib/hosted-target/errors.cjs +88 -0
- package/lib/hosted-target/errors.d.cts +36 -0
- package/lib/hosted-target/errors.d.mts +36 -0
- package/lib/hosted-target/errors.d.ts +36 -0
- package/lib/hosted-target/errors.mjs +75 -0
- package/lib/hosted-target/index.cjs +16 -0
- package/lib/hosted-target/index.d.cts +3 -0
- package/lib/hosted-target/index.d.mts +3 -0
- package/lib/hosted-target/index.d.ts +3 -0
- package/lib/hosted-target/index.mjs +2 -0
- package/lib/hosted-target/response-validation.cjs +169 -0
- package/lib/hosted-target/response-validation.d.cts +5 -0
- package/lib/hosted-target/response-validation.d.mts +5 -0
- package/lib/hosted-target/response-validation.d.ts +5 -0
- package/lib/hosted-target/response-validation.mjs +163 -0
- package/lib/hosted-target/retry-executor.cjs +51 -0
- package/lib/hosted-target/retry-executor.d.cts +8 -0
- package/lib/hosted-target/retry-executor.d.mts +8 -0
- package/lib/hosted-target/retry-executor.d.ts +8 -0
- package/lib/hosted-target/retry-executor.mjs +48 -0
- package/lib/hosted-target/retry.cjs +78 -0
- package/lib/hosted-target/retry.d.cts +9 -0
- package/lib/hosted-target/retry.d.mts +9 -0
- package/lib/hosted-target/retry.d.ts +9 -0
- package/lib/hosted-target/retry.mjs +73 -0
- package/lib/hosted-target/target-adapter.cjs +10 -0
- package/lib/hosted-target/target-adapter.d.cts +3 -0
- package/lib/hosted-target/target-adapter.d.mts +3 -0
- package/lib/hosted-target/target-adapter.d.ts +3 -0
- package/lib/hosted-target/target-adapter.mjs +7 -0
- package/lib/hosted-target/types.cjs +4 -0
- package/lib/hosted-target/types.d.cts +50 -0
- package/lib/hosted-target/types.d.mts +50 -0
- package/lib/hosted-target/types.d.ts +50 -0
- package/lib/hosted-target/types.mjs +1 -0
- package/lib/hosted-target/zero-cloud-v1-adapter.cjs +185 -0
- package/lib/hosted-target/zero-cloud-v1-adapter.d.cts +13 -0
- package/lib/hosted-target/zero-cloud-v1-adapter.d.mts +13 -0
- package/lib/hosted-target/zero-cloud-v1-adapter.d.ts +13 -0
- package/lib/hosted-target/zero-cloud-v1-adapter.mjs +181 -0
- package/lib/start-cluster.js +3 -3
- package/lib/target/bounded-response.cjs +51 -0
- package/lib/target/bounded-response.d.cts +1 -0
- package/lib/target/bounded-response.d.mts +1 -0
- package/lib/target/bounded-response.d.ts +1 -0
- package/lib/target/bounded-response.js +51 -0
- package/lib/target/bounded-response.mjs +48 -0
- package/lib/target/credential-lock.js +1 -3
- package/lib/target/credential-store.js +9 -4
- package/lib/target/device-flow.cjs +213 -0
- package/lib/target/device-flow.d.cts +54 -0
- package/lib/target/device-flow.d.mts +54 -0
- package/lib/target/device-flow.d.ts +26 -14
- package/lib/target/device-flow.js +162 -58
- package/lib/target/device-flow.mjs +203 -0
- package/lib/target/discovery-errors.cjs +10 -0
- package/lib/target/discovery-errors.d.cts +3 -0
- package/lib/target/discovery-errors.d.mts +3 -0
- package/lib/target/discovery-errors.d.ts +3 -0
- package/lib/target/discovery-errors.js +10 -0
- package/lib/target/discovery-errors.mjs +6 -0
- package/lib/target/discovery-sections.cjs +191 -0
- package/lib/target/discovery-sections.d.cts +52 -0
- package/lib/target/discovery-sections.d.mts +52 -0
- package/lib/target/discovery-sections.d.ts +52 -0
- package/lib/target/discovery-sections.js +191 -0
- package/lib/target/discovery-sections.mjs +179 -0
- package/lib/target/discovery-validation.cjs +109 -0
- package/lib/target/discovery-validation.d.cts +28 -0
- package/lib/target/discovery-validation.d.mts +28 -0
- package/lib/target/discovery-validation.d.ts +28 -0
- package/lib/target/discovery-validation.js +109 -0
- package/lib/target/discovery-validation.mjs +99 -0
- package/lib/target/discovery.cjs +112 -0
- package/lib/target/discovery.d.cts +74 -0
- package/lib/target/discovery.d.mts +74 -0
- package/lib/target/discovery.d.ts +67 -5
- package/lib/target/discovery.js +94 -79
- package/lib/target/discovery.mjs +105 -0
- package/lib/target/index.d.ts +6 -6
- package/lib/target/index.js +36 -36
- package/lib/target/oauth-http.d.ts +2 -0
- package/lib/target/oauth-http.js +25 -0
- package/lib/target/refresh-exchange.d.ts +11 -0
- package/lib/target/refresh-exchange.js +24 -0
- package/lib/target/refresh-revocation.d.ts +8 -0
- package/lib/target/refresh-revocation.js +19 -0
- package/lib/target/route-template.cjs +85 -0
- package/lib/target/route-template.d.cts +7 -0
- package/lib/target/route-template.d.mts +7 -0
- package/lib/target/route-template.d.ts +7 -0
- package/lib/target/route-template.js +85 -0
- package/lib/target/route-template.mjs +81 -0
- package/lib/target/session-errors.d.ts +4 -0
- package/lib/target/session-errors.js +12 -0
- package/lib/target/session-verification.d.ts +10 -0
- package/lib/target/session-verification.js +42 -0
- package/lib/target/target-registry.d.ts +7 -3
- package/lib/target/target-registry.js +41 -10
- package/lib/target/target-session-manager.d.ts +48 -0
- package/lib/target/target-session-manager.js +226 -0
- package/lib/target/target-session.d.ts +39 -32
- package/lib/target/target-session.js +63 -151
- package/lib/target/token-response.cjs +51 -0
- package/lib/target/token-response.d.cts +7 -0
- package/lib/target/token-response.d.mts +7 -0
- package/lib/target/token-response.d.ts +7 -0
- package/lib/target/token-response.js +51 -0
- package/lib/target/token-response.mjs +48 -0
- package/package.json +14 -7
- package/protocol/openengine-cluster/v1/worker.schema.json +171 -9
- package/scripts/build-cluster.js +23 -3
- package/scripts/opcore-introduced-check.js +0 -2
- package/src/agent-cli-provider/adapters/codex.ts +0 -1
- 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
- package/src/cluster/client.ts +42 -15
- package/src/cluster/connection-state.ts +33 -0
- package/src/cluster/connection-types.ts +28 -0
- package/src/cluster/connection.ts +37 -68
- package/src/cluster/errors.ts +5 -0
- package/src/cluster/index.ts +3 -1
- package/src/cluster/json-source.ts +1 -0
- package/src/cluster/payload-value.ts +1 -0
- package/src/cluster/socket.ts +13 -0
- package/src/cluster/subscriptions.ts +7 -2
- package/src/cluster/validators.ts +1 -0
- package/src/cluster/ws.d.ts +1 -1
- package/src/hosted-session/authority.ts +77 -0
- package/src/hosted-session/coordinator.ts +113 -56
- package/src/hosted-session/errors.ts +21 -0
- package/src/hosted-session/index.ts +14 -2
- package/src/hosted-session/reconnecting-watch.ts +148 -0
- package/src/hosted-session/types.ts +22 -8
- package/src/hosted-target/access-url.ts +46 -0
- package/src/hosted-target/adapter-request.ts +28 -0
- package/src/hosted-target/adapter-types.ts +39 -0
- package/src/hosted-target/bounds.ts +1 -0
- package/src/hosted-target/capsule-error-response.ts +107 -0
- package/src/hosted-target/errors.ts +36 -35
- package/src/hosted-target/index.ts +10 -23
- package/src/hosted-target/response-validation.ts +170 -62
- package/src/hosted-target/retry-executor.ts +62 -0
- package/src/hosted-target/retry.ts +47 -11
- package/src/hosted-target/target-adapter.ts +12 -8
- package/src/hosted-target/types.ts +19 -18
- package/src/hosted-target/zero-cloud-v1-adapter.ts +229 -316
- package/src/isolation-manager.js +1 -16
- package/src/target/bounded-response.ts +68 -0
- package/src/target/credential-lock.ts +1 -3
- package/src/target/credential-store.ts +14 -10
- package/src/target/device-flow.ts +209 -85
- package/src/target/discovery-errors.ts +6 -0
- package/src/target/discovery-sections.ts +251 -0
- package/src/target/discovery-validation.ts +144 -0
- package/src/target/discovery.ts +163 -97
- package/src/target/index.ts +15 -11
- package/src/target/oauth-http.ts +27 -0
- package/src/target/refresh-exchange.ts +36 -0
- package/src/target/refresh-revocation.ts +29 -0
- package/src/target/route-template.ts +105 -0
- package/src/target/session-errors.ts +9 -0
- package/src/target/session-verification.ts +51 -0
- package/src/target/target-registry.ts +60 -27
- package/src/target/target-session-manager.ts +285 -0
- package/src/target/target-session.ts +105 -226
- package/src/target/token-response.ts +62 -0
- package/docker/zeroshot-oecp/Cargo.toml +0 -12
- package/docker/zeroshot-oecp/Dockerfile +0 -65
- package/docker/zeroshot-oecp/src/main.rs +0 -32
- package/lib/target/bounded-json.d.ts +0 -6
- package/lib/target/bounded-json.js +0 -43
- package/lib/target/hosted-run/client.d.ts +0 -26
- package/lib/target/hosted-run/client.js +0 -158
- package/lib/target/hosted-run/commands.d.ts +0 -4
- package/lib/target/hosted-run/commands.js +0 -113
- package/lib/target/hosted-run/contracts.d.ts +0 -49
- package/lib/target/hosted-run/input.d.ts +0 -5
- package/lib/target/hosted-run/input.js +0 -200
- package/lib/target/hosted-run.d.ts +0 -4
- package/lib/target/hosted-run.js +0 -12
- package/src/target/bounded-json.ts +0 -48
- package/src/target/hosted-run/client.ts +0 -198
- package/src/target/hosted-run/commands.ts +0 -140
- package/src/target/hosted-run/contracts.ts +0 -53
- package/src/target/hosted-run/input.ts +0 -199
- package/src/target/hosted-run.ts +0 -8
|
@@ -246,15 +246,32 @@
|
|
|
246
246
|
"null"
|
|
247
247
|
]
|
|
248
248
|
},
|
|
249
|
+
"modelLevel": {
|
|
250
|
+
"enum": [
|
|
251
|
+
"level1",
|
|
252
|
+
"level2",
|
|
253
|
+
"level3"
|
|
254
|
+
]
|
|
255
|
+
},
|
|
249
256
|
"prompt": {
|
|
250
257
|
"type": [
|
|
251
258
|
"string",
|
|
252
259
|
"null"
|
|
253
260
|
]
|
|
254
261
|
},
|
|
262
|
+
"provider": {
|
|
263
|
+
"minLength": 1,
|
|
264
|
+
"pattern": "\\S",
|
|
265
|
+
"type": "string"
|
|
266
|
+
},
|
|
255
267
|
"providerProfile": {
|
|
256
268
|
"$ref": "#/$defs/CredentialHandle"
|
|
257
269
|
},
|
|
270
|
+
"repository": {
|
|
271
|
+
"minLength": 1,
|
|
272
|
+
"pattern": "\\S",
|
|
273
|
+
"type": "string"
|
|
274
|
+
},
|
|
258
275
|
"source": {
|
|
259
276
|
"enum": [
|
|
260
277
|
"issue",
|
|
@@ -267,13 +284,89 @@
|
|
|
267
284
|
"source",
|
|
268
285
|
"artifacts",
|
|
269
286
|
"isolationProfile",
|
|
270
|
-
"providerProfile"
|
|
287
|
+
"providerProfile",
|
|
288
|
+
"repository",
|
|
289
|
+
"provider",
|
|
290
|
+
"modelLevel"
|
|
271
291
|
],
|
|
272
292
|
"title": "LegacyShipRequest",
|
|
273
293
|
"type": "object"
|
|
274
294
|
},
|
|
275
295
|
"LegacyShipResult": {
|
|
276
296
|
"additionalProperties": false,
|
|
297
|
+
"oneOf": [
|
|
298
|
+
{
|
|
299
|
+
"properties": {
|
|
300
|
+
"branch": {
|
|
301
|
+
"minLength": 1,
|
|
302
|
+
"pattern": "\\S",
|
|
303
|
+
"type": "string"
|
|
304
|
+
},
|
|
305
|
+
"headRevision": {
|
|
306
|
+
"minLength": 1,
|
|
307
|
+
"pattern": "\\S",
|
|
308
|
+
"type": "string"
|
|
309
|
+
},
|
|
310
|
+
"pullRequestUrl": {
|
|
311
|
+
"minLength": 1,
|
|
312
|
+
"pattern": "\\S",
|
|
313
|
+
"type": "string"
|
|
314
|
+
},
|
|
315
|
+
"repository": {
|
|
316
|
+
"minLength": 1,
|
|
317
|
+
"pattern": "\\S",
|
|
318
|
+
"type": "string"
|
|
319
|
+
},
|
|
320
|
+
"status": {
|
|
321
|
+
"const": "succeeded"
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
"required": [
|
|
325
|
+
"repository",
|
|
326
|
+
"branch",
|
|
327
|
+
"headRevision",
|
|
328
|
+
"pullRequestUrl"
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"properties": {
|
|
333
|
+
"branch": {
|
|
334
|
+
"type": "null"
|
|
335
|
+
},
|
|
336
|
+
"headRevision": {
|
|
337
|
+
"type": "null"
|
|
338
|
+
},
|
|
339
|
+
"pullRequestUrl": {
|
|
340
|
+
"type": "null"
|
|
341
|
+
},
|
|
342
|
+
"repository": {
|
|
343
|
+
"type": "null"
|
|
344
|
+
},
|
|
345
|
+
"status": {
|
|
346
|
+
"const": "succeeded"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
"properties": {
|
|
352
|
+
"branch": {
|
|
353
|
+
"type": "null"
|
|
354
|
+
},
|
|
355
|
+
"headRevision": {
|
|
356
|
+
"type": "null"
|
|
357
|
+
},
|
|
358
|
+
"pullRequestUrl": {
|
|
359
|
+
"type": "null"
|
|
360
|
+
},
|
|
361
|
+
"repository": {
|
|
362
|
+
"type": "null"
|
|
363
|
+
},
|
|
364
|
+
"status": {
|
|
365
|
+
"const": "failed"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
],
|
|
277
370
|
"properties": {
|
|
278
371
|
"artifacts": {
|
|
279
372
|
"items": {
|
|
@@ -281,10 +374,39 @@
|
|
|
281
374
|
},
|
|
282
375
|
"type": "array"
|
|
283
376
|
},
|
|
377
|
+
"branch": {
|
|
378
|
+
"type": [
|
|
379
|
+
"string",
|
|
380
|
+
"null"
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
"headRevision": {
|
|
384
|
+
"type": [
|
|
385
|
+
"string",
|
|
386
|
+
"null"
|
|
387
|
+
]
|
|
388
|
+
},
|
|
389
|
+
"pullRequestUrl": {
|
|
390
|
+
"type": [
|
|
391
|
+
"string",
|
|
392
|
+
"null"
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
"repository": {
|
|
396
|
+
"type": [
|
|
397
|
+
"string",
|
|
398
|
+
"null"
|
|
399
|
+
]
|
|
400
|
+
},
|
|
284
401
|
"status": {
|
|
285
|
-
"
|
|
402
|
+
"enum": [
|
|
403
|
+
"succeeded",
|
|
404
|
+
"failed"
|
|
405
|
+
]
|
|
286
406
|
},
|
|
287
407
|
"summary": {
|
|
408
|
+
"minLength": 1,
|
|
409
|
+
"pattern": "\\S",
|
|
288
410
|
"type": "string"
|
|
289
411
|
}
|
|
290
412
|
},
|
|
@@ -296,13 +418,6 @@
|
|
|
296
418
|
"title": "LegacyShipResult",
|
|
297
419
|
"type": "object"
|
|
298
420
|
},
|
|
299
|
-
"LegacyShipStatus": {
|
|
300
|
-
"enum": [
|
|
301
|
-
"succeeded",
|
|
302
|
-
"failed"
|
|
303
|
-
],
|
|
304
|
-
"type": "string"
|
|
305
|
-
},
|
|
306
421
|
"PayloadType": {
|
|
307
422
|
"oneOf": [
|
|
308
423
|
{
|
|
@@ -985,18 +1100,41 @@
|
|
|
985
1100
|
"kind": "string"
|
|
986
1101
|
}
|
|
987
1102
|
},
|
|
1103
|
+
"modelLevel": {
|
|
1104
|
+
"required": true,
|
|
1105
|
+
"type": {
|
|
1106
|
+
"kind": "enum",
|
|
1107
|
+
"values": [
|
|
1108
|
+
"level1",
|
|
1109
|
+
"level2",
|
|
1110
|
+
"level3"
|
|
1111
|
+
]
|
|
1112
|
+
}
|
|
1113
|
+
},
|
|
988
1114
|
"prompt": {
|
|
989
1115
|
"required": false,
|
|
990
1116
|
"type": {
|
|
991
1117
|
"kind": "string"
|
|
992
1118
|
}
|
|
993
1119
|
},
|
|
1120
|
+
"provider": {
|
|
1121
|
+
"required": true,
|
|
1122
|
+
"type": {
|
|
1123
|
+
"kind": "string"
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
994
1126
|
"providerProfile": {
|
|
995
1127
|
"required": true,
|
|
996
1128
|
"type": {
|
|
997
1129
|
"kind": "string"
|
|
998
1130
|
}
|
|
999
1131
|
},
|
|
1132
|
+
"repository": {
|
|
1133
|
+
"required": true,
|
|
1134
|
+
"type": {
|
|
1135
|
+
"kind": "string"
|
|
1136
|
+
}
|
|
1137
|
+
},
|
|
1000
1138
|
"source": {
|
|
1001
1139
|
"required": true,
|
|
1002
1140
|
"type": {
|
|
@@ -1114,6 +1252,30 @@
|
|
|
1114
1252
|
"kind": "array"
|
|
1115
1253
|
}
|
|
1116
1254
|
},
|
|
1255
|
+
"branch": {
|
|
1256
|
+
"required": false,
|
|
1257
|
+
"type": {
|
|
1258
|
+
"kind": "string"
|
|
1259
|
+
}
|
|
1260
|
+
},
|
|
1261
|
+
"headRevision": {
|
|
1262
|
+
"required": false,
|
|
1263
|
+
"type": {
|
|
1264
|
+
"kind": "string"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
"pullRequestUrl": {
|
|
1268
|
+
"required": false,
|
|
1269
|
+
"type": {
|
|
1270
|
+
"kind": "string"
|
|
1271
|
+
}
|
|
1272
|
+
},
|
|
1273
|
+
"repository": {
|
|
1274
|
+
"required": false,
|
|
1275
|
+
"type": {
|
|
1276
|
+
"kind": "string"
|
|
1277
|
+
}
|
|
1278
|
+
},
|
|
1117
1279
|
"status": {
|
|
1118
1280
|
"required": true,
|
|
1119
1281
|
"type": {
|
package/scripts/build-cluster.js
CHANGED
|
@@ -6,8 +6,11 @@ const path = require('node:path');
|
|
|
6
6
|
const root = path.resolve(__dirname, '..');
|
|
7
7
|
const clusterBuildRoot = path.join(root, '.cluster-build');
|
|
8
8
|
const hostedSessionBuildRoot = path.join(root, '.hosted-session-build');
|
|
9
|
+
const hostedTargetBuildRoot = path.join(root, '.hosted-target-build');
|
|
9
10
|
const clusterOutputRoot = path.join(root, 'lib/cluster');
|
|
10
11
|
const hostedSessionOutputRoot = path.join(root, 'lib/hosted-session');
|
|
12
|
+
const hostedTargetOutputRoot = path.join(root, 'lib/hosted-target');
|
|
13
|
+
const targetOutputRoot = path.join(root, 'lib/target');
|
|
11
14
|
|
|
12
15
|
function filesBelow(directory) {
|
|
13
16
|
const entries = fs.readdirSync(directory, { withFileTypes: true });
|
|
@@ -17,6 +20,15 @@ function filesBelow(directory) {
|
|
|
17
20
|
});
|
|
18
21
|
}
|
|
19
22
|
|
|
23
|
+
function declarationContent(source, localExtension) {
|
|
24
|
+
return fs
|
|
25
|
+
.readFileSync(source, 'utf8')
|
|
26
|
+
.replace(/(["'])(\.\.?\/[^"']+)\.ts\1/g, (_match, quote, specifier) => {
|
|
27
|
+
const extension = specifier.startsWith('../target/') ? '.js' : localExtension;
|
|
28
|
+
return `${quote}${specifier}${extension}${quote}`;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
function copyBuild(sourceRoot, outputRoot, mode) {
|
|
21
33
|
for (const source of filesBelow(sourceRoot)) {
|
|
22
34
|
const relative = path.relative(sourceRoot, source);
|
|
@@ -32,15 +44,18 @@ function copyBuild(sourceRoot, outputRoot, mode) {
|
|
|
32
44
|
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
33
45
|
fs.writeFileSync(target, content);
|
|
34
46
|
} else if (mode === 'cjs' && extension === '.ts' && relative.endsWith('.d.ts')) {
|
|
35
|
-
const
|
|
36
|
-
fs.mkdirSync(path.dirname(
|
|
37
|
-
fs.
|
|
47
|
+
const base = path.join(outputRoot, relative.slice(0, -5));
|
|
48
|
+
fs.mkdirSync(path.dirname(base), { recursive: true });
|
|
49
|
+
fs.writeFileSync(`${base}.d.ts`, declarationContent(source, '.js'));
|
|
50
|
+
fs.writeFileSync(`${base}.d.cts`, declarationContent(source, '.cjs'));
|
|
51
|
+
fs.writeFileSync(`${base}.d.mts`, declarationContent(source, '.mjs'));
|
|
38
52
|
}
|
|
39
53
|
}
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
fs.rmSync(clusterOutputRoot, { recursive: true, force: true });
|
|
43
57
|
fs.rmSync(hostedSessionOutputRoot, { recursive: true, force: true });
|
|
58
|
+
fs.rmSync(hostedTargetOutputRoot, { recursive: true, force: true });
|
|
44
59
|
copyBuild(path.join(clusterBuildRoot, 'cjs'), clusterOutputRoot, 'cjs');
|
|
45
60
|
copyBuild(path.join(clusterBuildRoot, 'esm'), clusterOutputRoot, 'esm');
|
|
46
61
|
copyBuild(
|
|
@@ -53,5 +68,10 @@ copyBuild(
|
|
|
53
68
|
hostedSessionOutputRoot,
|
|
54
69
|
'esm'
|
|
55
70
|
);
|
|
71
|
+
copyBuild(path.join(hostedTargetBuildRoot, 'cjs', 'hosted-target'), hostedTargetOutputRoot, 'cjs');
|
|
72
|
+
copyBuild(path.join(hostedTargetBuildRoot, 'esm', 'hosted-target'), hostedTargetOutputRoot, 'esm');
|
|
73
|
+
copyBuild(path.join(hostedTargetBuildRoot, 'cjs', 'target'), targetOutputRoot, 'cjs');
|
|
74
|
+
copyBuild(path.join(hostedTargetBuildRoot, 'esm', 'target'), targetOutputRoot, 'esm');
|
|
56
75
|
fs.rmSync(clusterBuildRoot, { recursive: true, force: true });
|
|
57
76
|
fs.rmSync(hostedSessionBuildRoot, { recursive: true, force: true });
|
|
77
|
+
fs.rmSync(hostedTargetBuildRoot, { recursive: true, force: true });
|
|
@@ -197,8 +197,6 @@ function createRequest(repo, baseline, changes, options) {
|
|
|
197
197
|
for (const change of changes) {
|
|
198
198
|
normalizeBaselineRename(baseline, change);
|
|
199
199
|
if (change.kind === 'D') {
|
|
200
|
-
overlays.push({ action: 'delete', path: change.path });
|
|
201
|
-
files.push(change.path);
|
|
202
200
|
continue;
|
|
203
201
|
}
|
|
204
202
|
const content = readAfter(repo, change, options.staged);
|
|
@@ -28,7 +28,6 @@ import { parseCodexEvent } from './codex-parser';
|
|
|
28
28
|
|
|
29
29
|
const MODEL_CATALOG: Readonly<Record<string, ModelCatalogEntry>> = {
|
|
30
30
|
'gpt-5.4': { rank: 2 },
|
|
31
|
-
'openai/gpt-5.4': { rank: 2 },
|
|
32
31
|
'gpt-5.5': { rank: 3 },
|
|
33
32
|
'gpt-5.6': { rank: 3 },
|
|
34
33
|
'gpt-5.6-sol': { rank: 3 },
|
|
@@ -21,8 +21,11 @@ import { getString, isRecord, unknownToMessage } from './json';
|
|
|
21
21
|
import type { ErrorClassification } from './types';
|
|
22
22
|
import type { ProcessRunner } from './process-runner';
|
|
23
23
|
|
|
24
|
-
function runBuildCommand(
|
|
25
|
-
|
|
24
|
+
function runBuildCommand(
|
|
25
|
+
request: RequestData,
|
|
26
|
+
runtimeSettings?: Record<string, unknown>
|
|
27
|
+
): ContractEnvelope {
|
|
28
|
+
const { adapter, commandSpec, options } = buildCommandSpec(request, runtimeSettings);
|
|
26
29
|
const webSearch = {
|
|
27
30
|
requested: options.webSearch === true,
|
|
28
31
|
effective: options.webSearch === true && options.cliFeatures?.supportsWebSearch === true,
|
|
@@ -134,19 +137,20 @@ function runClassifyError(request: RequestData): ContractEnvelope {
|
|
|
134
137
|
|
|
135
138
|
export function dispatchRequest(
|
|
136
139
|
request: RequestData,
|
|
137
|
-
runner: ProcessRunner
|
|
140
|
+
runner: ProcessRunner,
|
|
141
|
+
runtimeSettings?: Record<string, unknown>
|
|
138
142
|
): ContractEnvelope | Promise<ContractEnvelope> {
|
|
139
143
|
switch (request.command) {
|
|
140
144
|
case 'probe':
|
|
141
145
|
return runProbe(request);
|
|
142
146
|
case 'build-command':
|
|
143
|
-
return runBuildCommand(request);
|
|
147
|
+
return runBuildCommand(request, runtimeSettings);
|
|
144
148
|
case 'parse-output':
|
|
145
149
|
return runParseOutput(request);
|
|
146
150
|
case 'classify-error':
|
|
147
151
|
return runClassifyError(request);
|
|
148
152
|
case 'invoke':
|
|
149
|
-
return runInvoke(request, runner);
|
|
153
|
+
return runInvoke(request, runner, runtimeSettings);
|
|
150
154
|
default:
|
|
151
155
|
throw contractError({
|
|
152
156
|
code: 'unknown-command',
|
|
@@ -120,9 +120,10 @@ async function runOmpRpcContractPrompt(
|
|
|
120
120
|
|
|
121
121
|
export async function runInvoke(
|
|
122
122
|
request: RequestData,
|
|
123
|
-
runner: ProcessRunner
|
|
123
|
+
runner: ProcessRunner,
|
|
124
|
+
runtimeSettings?: Record<string, unknown>
|
|
124
125
|
): Promise<ContractEnvelope> {
|
|
125
|
-
const { adapter, commandSpec, context, options } = buildCommandSpec(request);
|
|
126
|
+
const { adapter, commandSpec, context, options } = buildCommandSpec(request, runtimeSettings);
|
|
126
127
|
const timeoutMs = optionalNumber(request.raw, 'timeoutMs');
|
|
127
128
|
const runnerOptions = timeoutMs === undefined ? {} : { timeoutMs };
|
|
128
129
|
const invokeSpec = getProviderRegistryEntry(adapter.id).invoke;
|
|
@@ -94,7 +94,10 @@ function buildOptions(request: RequestData): BuildProviderCommandOptions {
|
|
|
94
94
|
return { ...options, cwd };
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
export function buildCommandSpec(
|
|
97
|
+
export function buildCommandSpec(
|
|
98
|
+
request: RequestData,
|
|
99
|
+
runtimeSettings?: Record<string, unknown>
|
|
100
|
+
): {
|
|
98
101
|
readonly adapter: ProviderAdapter;
|
|
99
102
|
readonly commandSpec: CommandSpec;
|
|
100
103
|
readonly options: BuildProviderCommandOptions;
|
|
@@ -103,11 +106,14 @@ export function buildCommandSpec(request: RequestData): {
|
|
|
103
106
|
const adapter = adapterForProvider(request.provider);
|
|
104
107
|
const context = requiredString(request.raw, 'context');
|
|
105
108
|
const options = buildOptions(request);
|
|
106
|
-
const prepared = prepareSingleAgentProviderCommand(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
const prepared = prepareSingleAgentProviderCommand(
|
|
110
|
+
{
|
|
111
|
+
provider: adapter.id,
|
|
112
|
+
context,
|
|
113
|
+
options,
|
|
114
|
+
},
|
|
115
|
+
runtimeSettings
|
|
116
|
+
);
|
|
111
117
|
return {
|
|
112
118
|
adapter: prepared.adapter,
|
|
113
119
|
context,
|
|
@@ -32,6 +32,7 @@ export interface ProviderExecutableResponse {
|
|
|
32
32
|
|
|
33
33
|
export interface ProviderExecutableOptions {
|
|
34
34
|
readonly runner?: ProcessRunner;
|
|
35
|
+
readonly runtimeSettings?: Record<string, unknown>;
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
export async function runProviderExecutable(
|
|
@@ -41,7 +42,11 @@ export async function runProviderExecutable(
|
|
|
41
42
|
const fallback = requestEnvelopeData(input);
|
|
42
43
|
try {
|
|
43
44
|
const request = validateRequest(input, providerExecutableSchemaVersion);
|
|
44
|
-
const envelope = await dispatchRequest(
|
|
45
|
+
const envelope = await dispatchRequest(
|
|
46
|
+
request,
|
|
47
|
+
options.runner ?? spawnProcessRunner(),
|
|
48
|
+
options.runtimeSettings
|
|
49
|
+
);
|
|
45
50
|
return {
|
|
46
51
|
envelope: finalizeEnvelope(envelope, request.env),
|
|
47
52
|
exitCode: 0,
|
|
@@ -715,6 +715,10 @@ export function getProviderRegistryEntry(name: string): ProviderRegistryEntry {
|
|
|
715
715
|
throw new Error(`Unknown provider: ${name}. Valid: ${providerIds.join(', ')}`);
|
|
716
716
|
}
|
|
717
717
|
|
|
718
|
+
export function credentialEnvKeysForProvider(providerId: string): readonly string[] {
|
|
719
|
+
return getProviderRegistryEntry(providerId).credentialEnvKeys;
|
|
720
|
+
}
|
|
721
|
+
|
|
718
722
|
export function resolveProviderCommand(name: string): {
|
|
719
723
|
readonly command: string;
|
|
720
724
|
readonly args: readonly string[];
|
|
@@ -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;
|