@opengeni/worker-bundle 2.0.1 → 2.0.2-canary.38789554071001
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/dist/activities/agent-run-admission.d.ts +1 -12
- package/dist/activities/agent-turn/admission.d.ts +88 -10
- package/dist/activities/agent-turn/agent-build.d.ts +14 -3
- package/dist/activities/agent-turn/claim.d.ts +4 -1
- package/dist/activities/agent-turn/claude-core.d.ts +195 -0
- package/dist/activities/agent-turn/code-search.d.ts +60 -0
- package/dist/activities/agent-turn/codex-capacity.d.ts +3 -0
- package/dist/activities/agent-turn/codex-core-capacity.d.ts +37 -0
- package/dist/activities/agent-turn/codex-core-claim.d.ts +40 -0
- package/dist/activities/agent-turn/codex-core-errors.d.ts +102 -0
- package/dist/activities/agent-turn/codex-core-failover.d.ts +15 -0
- package/dist/activities/agent-turn/codex-core-requests.d.ts +28 -0
- package/dist/activities/agent-turn/codex-core-settlement.d.ts +77 -0
- package/dist/activities/agent-turn/codex-credit-policy.d.ts +30 -0
- package/dist/activities/agent-turn/codex-plan-entitlement.d.ts +105 -0
- package/dist/activities/agent-turn/codex-usage-policy.d.ts +2 -0
- package/dist/activities/agent-turn/codex.d.ts +2 -19
- package/dist/activities/agent-turn/compaction-interruption.d.ts +32 -0
- package/dist/activities/agent-turn/compaction-prep.d.ts +30 -1
- package/dist/activities/agent-turn/credential-leases.d.ts +64 -37
- package/dist/activities/agent-turn/credential-restriction.d.ts +3 -0
- package/dist/activities/agent-turn/errors.d.ts +185 -26
- package/dist/activities/agent-turn/failure-settlement.d.ts +10 -43
- package/dist/activities/agent-turn/final-reply.d.ts +18 -0
- package/dist/activities/agent-turn/finalization-monitor.d.ts +7 -2
- package/dist/activities/agent-turn/finalization.d.ts +2 -0
- package/dist/activities/agent-turn/github-repository-bindings.d.ts +2 -0
- package/dist/activities/agent-turn/governance-model.d.ts +13 -1
- package/dist/activities/agent-turn/history-sink.d.ts +4 -1
- package/dist/activities/agent-turn/history.d.ts +2 -0
- package/dist/activities/agent-turn/input-wait-reply.d.ts +76 -0
- package/dist/activities/agent-turn/meaningful-output.d.ts +9 -0
- package/dist/activities/agent-turn/media-artifacts.d.ts +5 -3
- package/dist/activities/agent-turn/model-call-admission.d.ts +15 -0
- package/dist/activities/agent-turn/model-usage.d.ts +56 -14
- package/dist/activities/agent-turn/model-wire-dispatch.d.ts +15 -0
- package/dist/activities/agent-turn/optional-repositories.d.ts +59 -0
- package/dist/activities/agent-turn/prompt-tool-availability.d.ts +17 -0
- package/dist/activities/agent-turn/provider-dispatch-barrier.d.ts +12 -1
- package/dist/activities/agent-turn/provider-recovery-copy.d.ts +24 -0
- package/dist/activities/agent-turn/provider-recovery-metrics.d.ts +18 -0
- package/dist/activities/agent-turn/provider-recovery-policy.d.ts +6 -0
- package/dist/activities/agent-turn/quiescence.d.ts +6 -7
- package/dist/activities/agent-turn/recovery-warning.d.ts +6 -5
- package/dist/activities/agent-turn/refresh-credentials.d.ts +6 -0
- package/dist/activities/agent-turn/run-credentials.d.ts +9 -5
- package/dist/activities/agent-turn/run.d.ts +27 -2
- package/dist/activities/agent-turn/sandbox-establish.d.ts +1 -0
- package/dist/activities/agent-turn/sandbox-provision.d.ts +25 -1
- package/dist/activities/agent-turn/sandbox-route.d.ts +3 -0
- package/dist/activities/agent-turn/sandbox-runtime.d.ts +1 -1
- package/dist/activities/agent-turn/secret-resolver.d.ts +64 -0
- package/dist/activities/agent-turn/session-title.d.ts +60 -3
- package/dist/activities/agent-turn/session-usage-custody.d.ts +66 -0
- package/dist/activities/agent-turn/skill-checkout.d.ts +25 -6
- package/dist/activities/agent-turn/skill-read.d.ts +70 -2
- package/dist/activities/agent-turn/skill-search.d.ts +2 -0
- package/dist/activities/agent-turn/skill-tools.d.ts +41 -4
- package/dist/activities/agent-turn/skill-transfer.d.ts +18 -6
- package/dist/activities/agent-turn/stream-attempt.d.ts +6 -3
- package/dist/activities/agent-turn/subscription-capacity-arming.d.ts +41 -0
- package/dist/activities/agent-turn/subscription-core-capacity.d.ts +86 -0
- package/dist/activities/agent-turn/subscription-core-failover.d.ts +69 -0
- package/dist/activities/agent-turn/subscription-core-placed.d.ts +14 -0
- package/dist/activities/agent-turn/subscription-core-requests.d.ts +109 -0
- package/dist/activities/agent-turn/subscription-core-settlement.d.ts +112 -0
- package/dist/activities/agent-turn/subscription-lease.d.ts +44 -0
- package/dist/activities/agent-turn/subscription-serving-capacity.d.ts +6 -0
- package/dist/activities/agent-turn/subscription-serving-catalog.d.ts +13 -0
- package/dist/activities/agent-turn/subscription-serving-claim.d.ts +30 -0
- package/dist/activities/agent-turn/subscription-serving-providers.d.ts +2 -0
- package/dist/activities/agent-turn/tool-environment.d.ts +31 -6
- package/dist/activities/agent-turn/tool-policy.d.ts +55 -3
- package/dist/activities/agent-turn/turn-context.d.ts +104 -5
- package/dist/activities/agent-turn/web-search.d.ts +57 -0
- package/dist/activities/agent-turn/xai-core.d.ts +96 -0
- package/dist/activities/automations.d.ts +3 -1
- package/dist/activities/browser-deadline-checkpoint.d.ts +34 -0
- package/dist/activities/capabilities.d.ts +8 -20
- package/dist/activities/codemode-dispatcher.d.ts +20 -3
- package/dist/activities/codex-capacity.d.ts +1 -56
- package/dist/activities/codex-image-generation.d.ts +49 -3
- package/dist/activities/common.d.ts +3 -1
- package/dist/activities/context-compaction.d.ts +41 -2
- package/dist/activities/environment.d.ts +1 -19
- package/dist/activities/gmail-files.d.ts +50 -0
- package/dist/activities/goals.d.ts +1 -9
- package/dist/activities/incident-telemetry-authority.d.ts +5 -2
- package/dist/activities/incident-telemetry-preflight.d.ts +10 -3
- package/dist/activities/knowledge-indexing.d.ts +19 -0
- package/dist/activities/mcp-account-routes.d.ts +2 -21
- package/dist/activities/model-call-fact-reconciler.d.ts +34 -0
- package/dist/activities/open-suffix-resume.d.ts +15 -0
- package/dist/activities/parent-wake.d.ts +17 -12
- package/dist/activities/programmatic-approvals.d.ts +10 -0
- package/dist/activities/requester-unavailable-receipt.d.ts +8 -0
- package/dist/activities/retained-screenshots.d.ts +7 -2
- package/dist/activities/run-credential-renewal.d.ts +1 -0
- package/dist/activities/run-credentials.d.ts +16 -4
- package/dist/activities/run-input.d.ts +17 -0
- package/dist/activities/sandbox-lease.d.ts +132 -12
- package/dist/activities/scheduled-tasks.d.ts +4 -35
- package/dist/activities/session-archive.d.ts +58 -0
- package/dist/activities/session-state.d.ts +15 -3
- package/dist/activities/session-storage.d.ts +44 -0
- package/dist/activities/subscription-core-claude-waits.d.ts +2 -0
- package/dist/activities/subscription-core-codex-quota.d.ts +25 -0
- package/dist/activities/subscription-core-codex-waits.d.ts +153 -0
- package/dist/activities/subscription-core-image-operation.d.ts +29 -0
- package/dist/activities/subscription-core-usage-recheck.d.ts +49 -0
- package/dist/activities/subscription-core-wait-bindings.d.ts +3 -0
- package/dist/activities/subscription-core-xai-quota.d.ts +30 -0
- package/dist/activities/subscription-core-xai-waits.d.ts +2 -0
- package/dist/activities/types.d.ts +68 -5
- package/dist/activities/video-generation-admission.d.ts +2 -8
- package/dist/activities/video-generation-credential.d.ts +15 -12
- package/dist/activities/video-generation-subscription-core.d.ts +70 -0
- package/dist/activities/workspace-capture.d.ts +2 -0
- package/dist/activities/workspace-credential-provider.d.ts +47 -0
- package/dist/activities/xai-auth.d.ts +6 -18
- package/dist/activities/xai-image-generation.d.ts +22 -6
- package/dist/{activities-control-QA6OLRQY.js → activities-control-5IIVRXLA.js} +1569 -2883
- package/dist/activities-control-5IIVRXLA.js.map +1 -0
- package/dist/activities-control.d.ts +64 -4
- package/dist/{activities-turn-YVVKCGAK.js → activities-turn-FLYJOM54.js} +9300 -4403
- package/dist/activities-turn-FLYJOM54.js.map +1 -0
- package/dist/activities.d.ts +64 -4
- package/dist/artifact-materializer-entry.js +107 -36
- package/dist/artifact-materializer-entry.js.map +1 -1
- package/dist/artifact-outbox-entry.js +132 -61
- package/dist/artifact-outbox-entry.js.map +1 -1
- package/dist/browser-deadline-checkpoint-contract.d.ts +2 -0
- package/dist/{chunk-GDCLDKSH.js → chunk-24GP3BX5.js} +79 -72
- package/dist/chunk-24GP3BX5.js.map +1 -0
- package/dist/{chunk-RAMNYSAW.js → chunk-4ER3YXOT.js} +22 -4
- package/dist/chunk-4ER3YXOT.js.map +1 -0
- package/dist/{chunk-I7HKKMUJ.js → chunk-5NNS4327.js} +734 -58
- package/dist/chunk-5NNS4327.js.map +1 -0
- package/dist/chunk-MVESOYFC.js +3746 -0
- package/dist/chunk-MVESOYFC.js.map +1 -0
- package/dist/{chunk-M3NVMF2V.js → chunk-N57B3PJ5.js} +2307 -3951
- package/dist/chunk-N57B3PJ5.js.map +1 -0
- package/dist/chunk-NQDVJ6RI.js +2823 -0
- package/dist/chunk-NQDVJ6RI.js.map +1 -0
- package/dist/chunk-O7UPBWXK.js +79 -0
- package/dist/chunk-O7UPBWXK.js.map +1 -0
- package/dist/chunk-W2QSM5HR.js +414 -0
- package/dist/chunk-W2QSM5HR.js.map +1 -0
- package/dist/chunk-ZN3XJR33.js +227 -0
- package/dist/chunk-ZN3XJR33.js.map +1 -0
- package/dist/editable-artifact-outbox-dispatcher.d.ts +12 -1
- package/dist/editable-artifact-outbox-service.d.ts +3 -1
- package/dist/host-export-pump.d.ts +3 -1
- package/dist/host-export.d.ts +2 -2
- package/dist/host-export.js +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/index.d.ts +49 -48
- package/dist/index.js +835 -256
- package/dist/index.js.map +1 -1
- package/dist/internal-maintenance.d.ts +63 -0
- package/dist/maintenance-cadence.d.ts +43 -0
- package/dist/observability-metrics.d.ts +293 -24
- package/dist/onepassword-vault-provider.d.ts +7 -0
- package/dist/parent-wake-PCLH7A3Y.js +24 -0
- package/dist/parent-wake-PCLH7A3Y.js.map +1 -0
- package/dist/personal-github-git-credentials.d.ts +1 -1
- package/dist/readiness-checks.d.ts +39 -0
- package/dist/retained-process-retry.d.ts +7 -0
- package/dist/sandbox-lease-BJYU72N3.js +84 -0
- package/dist/sandbox-lease-BJYU72N3.js.map +1 -0
- package/dist/sandbox-reaper-contract.d.ts +25 -0
- package/dist/sandbox-resume.d.ts +72 -4
- package/dist/sandbox-routing.d.ts +4 -2
- package/dist/session-event-fanout.d.ts +6 -0
- package/dist/site-auth-maintenance-WK3MR2PV.js +12 -0
- package/dist/site-auth-maintenance-WK3MR2PV.js.map +1 -0
- package/dist/telemetry-scheduler.d.ts +14 -0
- package/dist/temporal-runtime-logger.d.ts +22 -0
- package/dist/turn-task-queue-reader.d.ts +18 -0
- package/dist/turn-worker-activity-telemetry.d.ts +47 -0
- package/dist/worker-service-lifecycle.d.ts +12 -0
- package/dist/workflow-bundle.js +468 -71
- package/dist/workflows/activities.d.ts +1 -1
- package/dist/workflows/browser-deadline-checkpoint.d.ts +10 -0
- package/dist/workflows/sandbox-reaper.d.ts +10 -1
- package/dist/workflows/scheduled-tasks.d.ts +4 -0
- package/dist/workflows/session-storage.d.ts +2 -0
- package/dist/workflows/session.d.ts +36 -0
- package/dist/workflows/site-auth-maintenance.d.ts +2 -1
- package/dist/workflows/workflow-wake.d.ts +14 -3
- package/dist/workflows.d.ts +3 -1
- package/package.json +26 -20
- package/src/activities/agent-run-admission.ts +1 -82
- package/src/activities/agent-turn/admission.ts +175 -24
- package/src/activities/agent-turn/agent-build.ts +226 -145
- package/src/activities/agent-turn/claim.ts +363 -64
- package/src/activities/agent-turn/claude-core.ts +587 -0
- package/src/activities/agent-turn/code-search.ts +275 -0
- package/src/activities/agent-turn/codex-capacity.ts +30 -757
- package/src/activities/agent-turn/codex-core-capacity.ts +190 -0
- package/src/activities/agent-turn/codex-core-claim.ts +83 -0
- package/src/activities/agent-turn/codex-core-errors.ts +308 -0
- package/src/activities/agent-turn/codex-core-failover.ts +73 -0
- package/src/activities/agent-turn/codex-core-requests.ts +86 -0
- package/src/activities/agent-turn/codex-core-settlement.ts +263 -0
- package/src/activities/agent-turn/codex-credit-policy.ts +247 -0
- package/src/activities/agent-turn/codex-plan-entitlement.ts +254 -0
- package/src/activities/agent-turn/codex-usage-policy.ts +2 -0
- package/src/activities/agent-turn/codex.ts +8 -76
- package/src/activities/agent-turn/compaction-interruption.ts +56 -0
- package/src/activities/agent-turn/compaction-prep.ts +249 -36
- package/src/activities/agent-turn/credential-leases.ts +269 -214
- package/src/activities/agent-turn/credential-restriction.ts +14 -0
- package/src/activities/agent-turn/errors.ts +1152 -82
- package/src/activities/agent-turn/failure-settlement.ts +879 -886
- package/src/activities/agent-turn/final-reply.ts +46 -0
- package/src/activities/agent-turn/finalization-monitor.ts +17 -5
- package/src/activities/agent-turn/finalization.ts +107 -88
- package/src/activities/agent-turn/github-repository-bindings.ts +3 -1
- package/src/activities/agent-turn/governance-model.ts +90 -22
- package/src/activities/agent-turn/history-sink.ts +42 -12
- package/src/activities/agent-turn/history.ts +25 -5
- package/src/activities/agent-turn/input-wait-reply.ts +139 -0
- package/src/activities/agent-turn/knowledge-source-tools.ts +2 -0
- package/src/activities/agent-turn/meaningful-output.ts +44 -0
- package/src/activities/agent-turn/media-artifacts.ts +3 -1
- package/src/activities/agent-turn/model-call-admission.ts +114 -0
- package/src/activities/agent-turn/model-usage.ts +299 -233
- package/src/activities/agent-turn/model-wire-dispatch.ts +27 -0
- package/src/activities/agent-turn/optional-repositories.ts +224 -0
- package/src/activities/agent-turn/prompt-tool-availability.ts +27 -0
- package/src/activities/agent-turn/provider-dispatch-barrier.ts +22 -0
- package/src/activities/agent-turn/provider-recovery-copy.ts +76 -0
- package/src/activities/agent-turn/provider-recovery-metrics.ts +64 -0
- package/src/activities/agent-turn/provider-recovery-policy.ts +25 -0
- package/src/activities/agent-turn/quiescence.ts +7 -7
- package/src/activities/agent-turn/recovery-warning.ts +6 -8
- package/src/activities/agent-turn/refresh-credentials.ts +44 -0
- package/src/activities/agent-turn/run-credentials.ts +124 -76
- package/src/activities/agent-turn/run.ts +501 -112
- package/src/activities/agent-turn/sandbox-establish.ts +152 -75
- package/src/activities/agent-turn/sandbox-provision.ts +54 -1
- package/src/activities/agent-turn/sandbox-route.ts +4 -1
- package/src/activities/agent-turn/sandbox-runtime.ts +319 -11
- package/src/activities/agent-turn/secret-resolver.ts +155 -0
- package/src/activities/agent-turn/session-title.ts +177 -12
- package/src/activities/agent-turn/session-usage-custody.ts +170 -0
- package/src/activities/agent-turn/skill-checkout.ts +111 -24
- package/src/activities/agent-turn/skill-install.ts +1 -1
- package/src/activities/agent-turn/skill-read.ts +374 -28
- package/src/activities/agent-turn/skill-save.ts +35 -7
- package/src/activities/agent-turn/skill-search.ts +9 -0
- package/src/activities/agent-turn/skill-selection.ts +4 -0
- package/src/activities/agent-turn/skill-tools.ts +208 -21
- package/src/activities/agent-turn/skill-transfer.ts +68 -23
- package/src/activities/agent-turn/stream-attempt.ts +634 -111
- package/src/activities/agent-turn/subscription-capacity-arming.ts +81 -0
- package/src/activities/agent-turn/subscription-core-capacity.ts +439 -0
- package/src/activities/agent-turn/subscription-core-failover.ts +229 -0
- package/src/activities/agent-turn/subscription-core-placed.ts +37 -0
- package/src/activities/agent-turn/subscription-core-requests.ts +271 -0
- package/src/activities/agent-turn/subscription-core-settlement.ts +234 -0
- package/src/activities/agent-turn/subscription-lease.ts +140 -0
- package/src/activities/agent-turn/subscription-serving-capacity.ts +195 -0
- package/src/activities/agent-turn/subscription-serving-catalog.ts +71 -0
- package/src/activities/agent-turn/subscription-serving-claim.ts +178 -0
- package/src/activities/agent-turn/subscription-serving-providers.ts +15 -0
- package/src/activities/agent-turn/tool-environment.ts +384 -292
- package/src/activities/agent-turn/tool-policy.ts +104 -4
- package/src/activities/agent-turn/tool-result-spill.ts +1 -0
- package/src/activities/agent-turn/turn-context.ts +124 -8
- package/src/activities/agent-turn/web-search.ts +431 -0
- package/src/activities/agent-turn/xai-core.ts +301 -0
- package/src/activities/automations.ts +81 -6
- package/src/activities/browser-deadline-checkpoint.ts +297 -0
- package/src/activities/capabilities.ts +53 -213
- package/src/activities/codemode-dispatcher.ts +236 -14
- package/src/activities/codex-capacity.ts +27 -380
- package/src/activities/codex-image-generation.ts +252 -42
- package/src/activities/common.ts +12 -0
- package/src/activities/connector-attachments.ts +3 -1
- package/src/activities/context-compaction.ts +182 -21
- package/src/activities/environment.ts +18 -106
- package/src/activities/gmail-files.ts +108 -0
- package/src/activities/goals.ts +120 -204
- package/src/activities/image-generation-operation.ts +1 -1
- package/src/activities/incident-telemetry-authority.ts +80 -50
- package/src/activities/incident-telemetry-preflight.ts +27 -15
- package/src/activities/knowledge-indexing.ts +287 -17
- package/src/activities/knowledge-source-sync.ts +10 -0
- package/src/activities/mcp-account-routes.ts +2 -124
- package/src/activities/model-call-fact-reconciler.ts +112 -0
- package/src/activities/open-suffix-resume.ts +122 -88
- package/src/activities/parent-wake.ts +89 -21
- package/src/activities/programmatic-approvals.ts +26 -0
- package/src/activities/requester-unavailable-receipt.ts +14 -0
- package/src/activities/retained-screenshots.ts +135 -24
- package/src/activities/run-credential-renewal.ts +13 -1
- package/src/activities/run-credentials.ts +61 -19
- package/src/activities/run-input.ts +124 -9
- package/src/activities/sandbox-lease.ts +1615 -73
- package/src/activities/scheduled-tasks.ts +780 -147
- package/src/activities/session-archive.ts +382 -0
- package/src/activities/session-state.ts +219 -10
- package/src/activities/session-storage.ts +124 -0
- package/src/activities/site-auth-maintenance.ts +5 -2
- package/src/activities/subscription-core-claude-waits.ts +49 -0
- package/src/activities/subscription-core-codex-quota.ts +46 -0
- package/src/activities/subscription-core-codex-waits.ts +488 -0
- package/src/activities/subscription-core-image-operation.ts +126 -0
- package/src/activities/subscription-core-usage-recheck.ts +146 -0
- package/src/activities/subscription-core-wait-bindings.ts +12 -0
- package/src/activities/subscription-core-xai-quota.ts +85 -0
- package/src/activities/subscription-core-xai-waits.ts +48 -0
- package/src/activities/types.ts +85 -9
- package/src/activities/video-generation-admission.ts +1 -36
- package/src/activities/video-generation-credential.ts +38 -56
- package/src/activities/video-generation-reconciliation.ts +150 -131
- package/src/activities/video-generation-subscription-core.ts +180 -0
- package/src/activities/workspace-capture.ts +13 -2
- package/src/activities/workspace-credential-provider.ts +302 -0
- package/src/activities/xai-auth.ts +34 -112
- package/src/activities/xai-image-generation.ts +84 -36
- package/src/activities-control.ts +8 -0
- package/src/activities-turn.ts +5 -0
- package/src/activities.ts +17 -0
- package/src/activity-services.ts +29 -4
- package/src/browser-deadline-checkpoint-contract.ts +5 -0
- package/src/editable-artifact-hint-broker.ts +3 -0
- package/src/editable-artifact-materializer-service.ts +85 -39
- package/src/editable-artifact-materializer-subprocess.ts +47 -2
- package/src/editable-artifact-outbox-dispatcher.ts +107 -46
- package/src/editable-artifact-outbox-service.ts +55 -25
- package/src/github-rest-mcp.ts +1 -1
- package/src/host-export-pump.ts +26 -4
- package/src/host-export.ts +4 -1
- package/src/http.ts +4 -2
- package/src/index.ts +222 -282
- package/src/internal-maintenance.ts +347 -0
- package/src/maintenance-cadence.ts +156 -0
- package/src/observability-metrics.ts +1173 -73
- package/src/onepassword-vault-provider.ts +11 -0
- package/src/personal-github-git-credentials.ts +3 -1
- package/src/pr-review-credentials.ts +1 -1
- package/src/readiness-checks.ts +113 -0
- package/src/retained-process-retry.ts +36 -0
- package/src/sandbox-reaper-contract.ts +33 -0
- package/src/sandbox-resume.ts +444 -73
- package/src/sandbox-routing.ts +230 -75
- package/src/session-event-fanout.ts +23 -0
- package/src/telemetry-scheduler.ts +53 -0
- package/src/temporal-runtime-logger.ts +44 -0
- package/src/turn-task-queue-reader.ts +110 -0
- package/src/turn-worker-activity-telemetry.ts +209 -0
- package/src/worker-service-lifecycle.ts +54 -1
- package/src/workflows/activities.ts +16 -1
- package/src/workflows/browser-deadline-checkpoint.ts +55 -0
- package/src/workflows/file-upload-reaper.ts +2 -0
- package/src/workflows/sandbox-reaper.ts +88 -0
- package/src/workflows/scheduled-tasks.ts +26 -13
- package/src/workflows/session-storage.ts +19 -0
- package/src/workflows/session.ts +238 -33
- package/src/workflows/site-auth-maintenance.ts +2 -1
- package/src/workflows/workflow-wake.ts +26 -4
- package/src/workflows.ts +7 -0
- package/dist/activities/agent-turn/xai-capacity.d.ts +0 -2
- package/dist/activities/codex-fleet-shadow.d.ts +0 -74
- package/dist/activities/codex-rotation.d.ts +0 -200
- package/dist/activities/xai-quota.d.ts +0 -3
- package/dist/activities-control-QA6OLRQY.js.map +0 -1
- package/dist/activities-turn-YVVKCGAK.js.map +0 -1
- package/dist/chunk-GDCLDKSH.js.map +0 -1
- package/dist/chunk-I7HKKMUJ.js.map +0 -1
- package/dist/chunk-M3NVMF2V.js.map +0 -1
- package/dist/chunk-RAMNYSAW.js.map +0 -1
- package/src/activities/agent-turn/xai-capacity.ts +0 -257
- package/src/activities/codex-fleet-shadow.ts +0 -306
- package/src/activities/codex-rotation.ts +0 -685
- package/src/activities/xai-quota.ts +0 -35
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The turn's shared-core placement with the provider that placed it (at most
|
|
3
|
+
* one provider places a turn). Provider-neutral callers (checkpoints, the
|
|
4
|
+
* between-calls revalidation) use this instead of a provider's field.
|
|
5
|
+
*/
|
|
6
|
+
import type { Database } from "@opengeni/db";
|
|
7
|
+
import { type CoreTurnPlacementProvider } from "./subscription-core-capacity.js";
|
|
8
|
+
import type { SubscriptionCorePlacedFields, SubscriptionCoreTurn } from "./turn-context.js";
|
|
9
|
+
export declare function placedSubscriptionCore(providerTurn: SubscriptionCorePlacedFields): {
|
|
10
|
+
core: SubscriptionCoreTurn;
|
|
11
|
+
provider: CoreTurnPlacementProvider;
|
|
12
|
+
} | null;
|
|
13
|
+
/** Between model calls: settle committed responses, then recheck the source. */
|
|
14
|
+
export declare function revalidatePlacedSubscriptionCore(db: Database, providerTurn: SubscriptionCorePlacedFields): Promise<void>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prefix for this activity execution's physical model request IDs.
|
|
3
|
+
*
|
|
4
|
+
* Request reservations are unique per account, so an ID must not repeat across
|
|
5
|
+
* turns or executions. A Temporal activity ID is unique only within its own
|
|
6
|
+
* workflow (every turn's first activity is typically "1"), and a retried
|
|
7
|
+
* activity keeps its ID, so the prefix also names the turn attempt and the
|
|
8
|
+
* activity attempt.
|
|
9
|
+
*/
|
|
10
|
+
export declare function providerRequestIdPrefix(input: {
|
|
11
|
+
turnAttemptId: string;
|
|
12
|
+
activityId: string;
|
|
13
|
+
activityAttempt: number;
|
|
14
|
+
}): string;
|
|
15
|
+
/** One physical request: the logical request id and its transport attempt. */
|
|
16
|
+
export type SubscriptionCoreRequestIdentity = {
|
|
17
|
+
requestId: string;
|
|
18
|
+
transportAttempt: number;
|
|
19
|
+
};
|
|
20
|
+
export type SubscriptionCoreRequestSettlement = SubscriptionCoreRequestIdentity & {
|
|
21
|
+
/** Transport evidence only; response_received is NOT a durable history checkpoint. */
|
|
22
|
+
outcome: "response_received" | "refused" | "unknown";
|
|
23
|
+
};
|
|
24
|
+
export type CoreSubscriptionRequestsDeps = {
|
|
25
|
+
reserve: (request: SubscriptionCoreRequestIdentity) => Promise<{
|
|
26
|
+
operationId: string;
|
|
27
|
+
}>;
|
|
28
|
+
settle: (request: {
|
|
29
|
+
operationId: string;
|
|
30
|
+
outcome: SubscriptionCoreRequestSettlement["outcome"];
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
/** The provider's name in internal error text. */
|
|
33
|
+
displayName: string;
|
|
34
|
+
/** The provider's unresolved-outcome error (the durable fence raises the same). */
|
|
35
|
+
outcomeUnknown: () => Error;
|
|
36
|
+
isOutcomeUnknown: (error: unknown) => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* The provider's model call may send a continuation request after a
|
|
39
|
+
* complete response, before the history checkpoint (a paused server-side
|
|
40
|
+
* tool). The lane then admits a further reservation while every pending
|
|
41
|
+
* request has received its response; each is still reserved before its
|
|
42
|
+
* I/O and settled once at the checkpoint. Off: any pending request
|
|
43
|
+
* refuses a new one.
|
|
44
|
+
*/
|
|
45
|
+
continuesAfterResponse?: boolean;
|
|
46
|
+
};
|
|
47
|
+
/** One attempt's bounded request custody; no tokens or response bodies live here. */
|
|
48
|
+
export declare function createCoreSubscriptionRequests(deps: CoreSubscriptionRequestsDeps): {
|
|
49
|
+
reserve(request: SubscriptionCoreRequestIdentity): Promise<void>;
|
|
50
|
+
observe(request: SubscriptionCoreRequestSettlement): Promise<void>;
|
|
51
|
+
/** Call only AFTER the response/history writer has committed durably. */
|
|
52
|
+
checkpoint(): Promise<void>;
|
|
53
|
+
/** Absence of a response (including a detached timeout) is never replay proof. */
|
|
54
|
+
canRecover(): boolean;
|
|
55
|
+
/** Preserve an observed unknown outcome even when the SDK throws a plain HTTP error. */
|
|
56
|
+
hasUnknownOutcome(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* True only when every unknown outcome came from this attempt's own
|
|
59
|
+
* settled request and nothing is still reserved or in flight. The request
|
|
60
|
+
* row keeps its unknown outcome; closing this attempt as recoverable lets
|
|
61
|
+
* the next generation be admitted.
|
|
62
|
+
*/
|
|
63
|
+
unknownIsOwnAndSettled(): boolean;
|
|
64
|
+
/** The durable fence refused this attempt because of an earlier unresolved request. */
|
|
65
|
+
admissionRefused(): boolean;
|
|
66
|
+
/** When a request of this lane last received a response (the binding's cache clock). */
|
|
67
|
+
lastResponseReceivedAt(): Date | null;
|
|
68
|
+
};
|
|
69
|
+
export type CoreSubscriptionRequests = ReturnType<typeof createCoreSubscriptionRequests>;
|
|
70
|
+
/**
|
|
71
|
+
* An HTTP error status is a definite answer: no model response was produced.
|
|
72
|
+
* Timeouts (408, 504) and conflicts (409) stay ambiguous because the
|
|
73
|
+
* provider may still be processing the request (every core transport's rule).
|
|
74
|
+
*/
|
|
75
|
+
export declare function definiteRefusalStatus(status: number): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Reads a successful response body as it passes to the SDK and decides the
|
|
78
|
+
* request's outcome when the body ends (`ended`) or stops early (an error or
|
|
79
|
+
* a cancel by the reader). Without one, a body read to its end is a
|
|
80
|
+
* response and anything else is unknown.
|
|
81
|
+
*/
|
|
82
|
+
export type CoreResponseInspector = {
|
|
83
|
+
chunk: (bytes: Uint8Array) => void;
|
|
84
|
+
outcome: (ended: boolean) => SubscriptionCoreRequestSettlement["outcome"];
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Settle one physical request of a lane from the response a fetch-level
|
|
88
|
+
* transport received: a definite error status is refused at once and an
|
|
89
|
+
* ambiguous one is unknown; any other response settles when its body ends or
|
|
90
|
+
* stops (the inspector decides; a body that stops early is unknown, never
|
|
91
|
+
* replayed). The returned response carries the same status, headers and
|
|
92
|
+
* bytes.
|
|
93
|
+
*/
|
|
94
|
+
export declare function settleCoreResponse(lane: Pick<CoreSubscriptionRequests, "observe">, request: SubscriptionCoreRequestIdentity, response: Response, inspector?: CoreResponseInspector): Promise<Response>;
|
|
95
|
+
type CoreLanes = {
|
|
96
|
+
requests?: Pick<CoreSubscriptionRequests, "hasUnknownOutcome" | "canRecover" | "checkpoint">;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* The terminal unknown-outcome failure of a core turn, or null: an earlier or
|
|
100
|
+
* own request whose outcome is unknown (the error chain carries the core's
|
|
101
|
+
* code, or the main lane observed one) is never replayed automatically.
|
|
102
|
+
* Tool-less title requests never enter history and do not fence main recovery.
|
|
103
|
+
*/
|
|
104
|
+
export declare function coreRequestOutcomeUnknownFailure(error: unknown, core: CoreLanes, outcomeUnknown: () => Error): (Error & {
|
|
105
|
+
code: string;
|
|
106
|
+
}) | null;
|
|
107
|
+
/** After the history commit, settle main responses; titles do not fence recovery. */
|
|
108
|
+
export declare function coreLanesRecoverAfterCheckpoint(core: CoreLanes, commitHistory: () => Promise<void>): Promise<boolean>;
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refusal settlement and finalization for a chat turn on the shared
|
|
3
|
+
* subscription core, for any provider whose errors classify into shared
|
|
4
|
+
* outcomes (SuperGrok track X1b; the Claude track binds the same steps).
|
|
5
|
+
* Every write is scoped to the exact accepted turn and its live lease, and
|
|
6
|
+
* the bookkeeping is best effort: it never changes how the turn settles by
|
|
7
|
+
* itself. Codex keeps its own M3 step (`codex-core-settlement.ts` and the
|
|
8
|
+
* Codex branch of `failure-settlement.ts`), whose refusal kinds predate the
|
|
9
|
+
* shared outcomes.
|
|
10
|
+
*/
|
|
11
|
+
import { type Database, type SubscriptionCoreProvider, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
12
|
+
import { type ProviderErrorOutcome } from "@opengeni/subscriptions";
|
|
13
|
+
import type { RunAgentTurnResult } from "../types.js";
|
|
14
|
+
import { type SubscriptionCoreCodexTurnError } from "./codex-core-errors.js";
|
|
15
|
+
import type { CoreSubscriptionTurnLease } from "./credential-leases.js";
|
|
16
|
+
import type { TurnFailureDeps } from "./failure-settlement.js";
|
|
17
|
+
import { type CoreFailoverBinding } from "./subscription-core-failover.js";
|
|
18
|
+
import type { SubscriptionCoreTurn } from "./turn-context.js";
|
|
19
|
+
type LeaseFence = Pick<CoreSubscriptionTurnLease, "holderId" | "generation">;
|
|
20
|
+
/** The refresh generation the turn's latest request carried. */
|
|
21
|
+
export declare function coreRequestRefreshGeneration(core: SubscriptionCoreTurn): number;
|
|
22
|
+
/**
|
|
23
|
+
* Record a definitive refusal against the leased connection through the
|
|
24
|
+
* shared plan (`planSubscriptionCoreRefusal`): the (turn, connection)
|
|
25
|
+
* failure receipt, which counts toward the per-turn failover bound, then the
|
|
26
|
+
* health state that keeps placement away (a quota observation fenced on the
|
|
27
|
+
* refresh generation the refused bearer carried, a model cooldown, or a
|
|
28
|
+
* sign-in or forbidden quarantine). Whether the credential renews and was
|
|
29
|
+
* already refreshed before the refusal comes from the provider's binding.
|
|
30
|
+
* `receipt` reports whether the refusal was recorded.
|
|
31
|
+
*/
|
|
32
|
+
export declare function recordCoreSubscriptionRefusal(input: {
|
|
33
|
+
db: Database;
|
|
34
|
+
provider: SubscriptionCoreProvider;
|
|
35
|
+
core: SubscriptionCoreTurn;
|
|
36
|
+
lease: LeaseFence;
|
|
37
|
+
outcome: ProviderErrorOutcome;
|
|
38
|
+
/** How the provider's transport treats the refused credential (`CoreRefusalBinding.credential`). */
|
|
39
|
+
credential: CoreRefusalCredential;
|
|
40
|
+
now?: Date;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
receipt: boolean;
|
|
43
|
+
health: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
/**
|
|
46
|
+
* Finalization for a core turn before its lease is released: a completed
|
|
47
|
+
* model call moves the binding's cache-warmth clock. A refused or failed
|
|
48
|
+
* call leaves no warm cache.
|
|
49
|
+
*/
|
|
50
|
+
export declare function touchCoreSubscriptionBinding(input: {
|
|
51
|
+
db: Database;
|
|
52
|
+
provider: SubscriptionCoreProvider;
|
|
53
|
+
core: SubscriptionCoreTurn;
|
|
54
|
+
lease: LeaseFence;
|
|
55
|
+
modelCallCompletedAt: Date | null;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
/** One provider's refusal settlement inputs. */
|
|
58
|
+
/**
|
|
59
|
+
* How a provider's transport treats a refused credential: whether it renews,
|
|
60
|
+
* and whether an unauthorized request was already refreshed and retried once
|
|
61
|
+
* before the refusal reached settlement.
|
|
62
|
+
*/
|
|
63
|
+
export type CoreRefusalCredential = {
|
|
64
|
+
renewable: boolean;
|
|
65
|
+
refreshedBeforeRefusal: boolean;
|
|
66
|
+
};
|
|
67
|
+
export type CoreRefusalBinding = {
|
|
68
|
+
provider: SubscriptionCoreProvider;
|
|
69
|
+
displayName: string;
|
|
70
|
+
credential: CoreRefusalCredential;
|
|
71
|
+
/** The provider's classification of a failed model request (null: not a refusal). */
|
|
72
|
+
classify: (error: unknown) => ProviderErrorOutcome | null;
|
|
73
|
+
/**
|
|
74
|
+
* Joins the turn's in-flight observations of the leased connection (a
|
|
75
|
+
* provider that reports quota per response) before the refusal is recorded
|
|
76
|
+
* and the lease released, so placement sees them and none is dropped by
|
|
77
|
+
* the lease fence. Best effort.
|
|
78
|
+
*/
|
|
79
|
+
joinObservations?: (deps: TurnFailureDeps, core: SubscriptionCoreTurn) => Promise<void>;
|
|
80
|
+
lease: (deps: TurnFailureDeps) => CoreSubscriptionTurnLease;
|
|
81
|
+
isSourceDisconnected: (db: Database, identity: SubscriptionCoreTurnIdentity, connectionId: string) => Promise<boolean>;
|
|
82
|
+
failover: CoreFailoverBinding;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Failure settlement of a core turn's definitive refusal: the provider's
|
|
86
|
+
* classification becomes a shared outcome, the refusal is recorded against
|
|
87
|
+
* the leased connection, and the same turn re-places within the per-turn
|
|
88
|
+
* bound (another account, or a durable wait). A graceful source disconnect
|
|
89
|
+
* re-places without a refusal. Returns the settled result, or the typed
|
|
90
|
+
* terminal failure when automatic re-placement was not possible (null: not
|
|
91
|
+
* an account refusal, so the generic failure path settles the turn). The
|
|
92
|
+
* caller runs this only when no request outcome is unknown and the lease
|
|
93
|
+
* was not lost.
|
|
94
|
+
*/
|
|
95
|
+
export declare function settleCoreSubscriptionRefusal(deps: TurnFailureDeps, core: SubscriptionCoreTurn, binding: CoreRefusalBinding): Promise<{
|
|
96
|
+
result: RunAgentTurnResult | null;
|
|
97
|
+
failure: SubscriptionCoreCodexTurnError | null;
|
|
98
|
+
}>;
|
|
99
|
+
/**
|
|
100
|
+
* Finalization of a core turn before its lease is released: a completed
|
|
101
|
+
* model call of the conversation lane moves the binding's cache clock (a
|
|
102
|
+
* session-title request has another prompt prefix and warms no conversation
|
|
103
|
+
* cache, as for Codex). No per-turn quota call runs on the core path: quota
|
|
104
|
+
* is observed on refusal and by the out-of-turn probe.
|
|
105
|
+
*/
|
|
106
|
+
export declare function finalizeCoreSubscriptionTurn(input: {
|
|
107
|
+
db: Database;
|
|
108
|
+
provider: SubscriptionCoreProvider;
|
|
109
|
+
core: SubscriptionCoreTurn;
|
|
110
|
+
lease: LeaseFence;
|
|
111
|
+
}): Promise<void>;
|
|
112
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type LeaseRenewReason = "timer" | "runtime_event" | "model_usage";
|
|
2
|
+
export type LeaseLossReason = "deadline" | "not_found";
|
|
3
|
+
type LeaseIdentity = {
|
|
4
|
+
turnId: string;
|
|
5
|
+
holderId: string;
|
|
6
|
+
generation: number;
|
|
7
|
+
};
|
|
8
|
+
export type SubscriptionLeaseDeps = {
|
|
9
|
+
ttlMs: number;
|
|
10
|
+
getTurnId: () => string | undefined;
|
|
11
|
+
heartbeat: (identity: LeaseIdentity) => Promise<Date | null>;
|
|
12
|
+
onLost: (reason: LeaseLossReason) => void;
|
|
13
|
+
onRenewed?: (reason: LeaseRenewReason) => void;
|
|
14
|
+
onError: (error: unknown, reason: LeaseRenewReason) => void;
|
|
15
|
+
lostError: (reason: LeaseLossReason) => Error;
|
|
16
|
+
now?: () => number;
|
|
17
|
+
};
|
|
18
|
+
/** Cross-provider lease lifecycle. Only on-time DB confirmation extends ownership. */
|
|
19
|
+
export declare class SubscriptionTurnLease {
|
|
20
|
+
private readonly leaseDeps;
|
|
21
|
+
held: boolean;
|
|
22
|
+
lost: boolean;
|
|
23
|
+
lossReason: LeaseLossReason | null;
|
|
24
|
+
holderId: string | null;
|
|
25
|
+
generation: number | null;
|
|
26
|
+
confirmedUntilMs: number | null;
|
|
27
|
+
private heartbeatInFlight;
|
|
28
|
+
private heartbeatTimer;
|
|
29
|
+
private readonly now;
|
|
30
|
+
private readonly renewalIntervalMs;
|
|
31
|
+
constructor(leaseDeps: SubscriptionLeaseDeps);
|
|
32
|
+
private expired;
|
|
33
|
+
markLost: (reason: LeaseLossReason) => void;
|
|
34
|
+
assertUsable: () => void;
|
|
35
|
+
renew: (reason?: LeaseRenewReason) => Promise<void>;
|
|
36
|
+
startHeartbeat: () => void;
|
|
37
|
+
stopHeartbeat: () => void;
|
|
38
|
+
}
|
|
39
|
+
/** One turn attempt's core lease holder for a provider (`<provider>-turn:<attempt>`). */
|
|
40
|
+
export declare function subscriptionTurnLeaseHolderId(provider: string, displayName: string, input: {
|
|
41
|
+
workflowId: string;
|
|
42
|
+
attemptId: string;
|
|
43
|
+
}, turnId: string): string;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ServingAttempt } from "./subscription-serving-claim.js";
|
|
2
|
+
import type { CapacityPhaseDeps, CapacityPhaseOutcome } from "./codex-capacity.js";
|
|
3
|
+
/** Between-attempt switch only: placement has committed before any provenance
|
|
4
|
+
* or recovery writer runs. No model/tool call has started at this phase.
|
|
5
|
+
*/
|
|
6
|
+
export declare function selectServingTurnCapacity(deps: CapacityPhaseDeps, context: ServingAttempt): Promise<CapacityPhaseOutcome>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { type Database, type SubscriptionCoreFailoverModel, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
3
|
+
/** Shared by live placement and durable-wait evaluation, without importing
|
|
4
|
+
* provider runtime hooks into the control worker. Catalog entries are not
|
|
5
|
+
* authority: the core rechecks every candidate against accepted and live scope.
|
|
6
|
+
*/
|
|
7
|
+
export declare function servingCatalog(settings: Settings, providerIds: readonly string[]): SubscriptionCoreFailoverModel[];
|
|
8
|
+
/** The control worker has raw deployment settings, not claim's credential
|
|
9
|
+
* overlays. Resolve the same current model definitions without loading keys
|
|
10
|
+
* or filtering exhausted accounts out of the catalog. Core placement owns
|
|
11
|
+
* authority/readiness, independently of catalog membership.
|
|
12
|
+
*/
|
|
13
|
+
export declare function servingCatalogForBlockedTurn(db: Database, settings: Settings, identity: SubscriptionCoreTurnIdentity, productModelId: string, providerIds: readonly string[]): Promise<SubscriptionCoreFailoverModel[]>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { type TurnExecutionPolicyV1, type TurnServingPolicyV1 } from "@opengeni/contracts";
|
|
3
|
+
import { type Database, type SubscriptionCoreFailoverModel, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
4
|
+
export { servingCatalog } from "./subscription-serving-catalog.js";
|
|
5
|
+
export type ServingAttempt = {
|
|
6
|
+
acceptedPolicy: TurnExecutionPolicyV1;
|
|
7
|
+
identity: SubscriptionCoreTurnIdentity;
|
|
8
|
+
homeProviderId: string;
|
|
9
|
+
models: SubscriptionCoreFailoverModel[];
|
|
10
|
+
revision: TurnServingPolicyV1 | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function noServingModelMapping(): Error;
|
|
13
|
+
export declare function servingPolicyForSelection(settings: Settings, accepted: TurnExecutionPolicyV1, modelId: string, reasoning: string): TurnExecutionPolicyV1;
|
|
14
|
+
/** Already-portable only. Disabled/restricted/maintenance paths do not record
|
|
15
|
+
* provenance or enable a provider. Accepted policy and presentation stay fixed.
|
|
16
|
+
*/
|
|
17
|
+
export declare function claimServingAttempt(input: {
|
|
18
|
+
db: Database;
|
|
19
|
+
settings: Settings;
|
|
20
|
+
accountId: string;
|
|
21
|
+
workspaceId: string;
|
|
22
|
+
sessionId: string;
|
|
23
|
+
turnId: string;
|
|
24
|
+
attemptId: string;
|
|
25
|
+
executionGeneration: number;
|
|
26
|
+
compactionMode: string;
|
|
27
|
+
source: string;
|
|
28
|
+
acceptedPolicy: TurnExecutionPolicyV1;
|
|
29
|
+
providerIds: readonly string[];
|
|
30
|
+
}): Promise<ServingAttempt | null>;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
import { type AttemptConnectorActionBinding, type ConnectorActionPolicyHooks } from "@opengeni/runtime";
|
|
1
|
+
import { type RunMcpCredentials, type AttemptConnectorActionBinding, type ConnectorActionPolicyHooks } from "@opengeni/runtime";
|
|
2
2
|
import { type Settings } from "@opengeni/config";
|
|
3
3
|
import { withFirstPartyTools } from "../goals.js";
|
|
4
4
|
import type { TurnActivityServices as ActivityServices, RunAgentTurnInput } from "../types.js";
|
|
5
5
|
import { ToolResultSpill } from "./tool-result-spill.js";
|
|
6
6
|
import { createTurnMediaArtifacts } from "./media-artifacts.js";
|
|
7
|
+
import { type ResourceRef, type Permission } from "@opengeni/contracts";
|
|
7
8
|
import type { ClaimTurnOk } from "./claim.js";
|
|
8
9
|
import type { GovernanceModelOk } from "./governance-model.js";
|
|
9
10
|
import type { SandboxTurnRuntime } from "./sandbox-runtime.js";
|
|
10
11
|
import type { sandboxArtifactRuntimeAdmission } from "./sandbox-route.js";
|
|
11
|
-
import type { AttemptIdentityState, EventingState, SandboxRuntimeState, WorkspaceRefState } from "./turn-context.js";
|
|
12
|
+
import type { AttemptIdentityState, EventingState, RenewalState, SandboxRuntimeState, WorkspaceRefState } from "./turn-context.js";
|
|
13
|
+
import { type AttemptVaultAccess } from "./secret-resolver.js";
|
|
14
|
+
/** A linked turn's immutable policy must survive array and token boundaries. */
|
|
15
|
+
export declare function linkedTurnFirstPartyPermissions(selected: Permission[] | null, linked: {
|
|
16
|
+
permissions: Permission[];
|
|
17
|
+
permissionMode?: "legacy" | "explicit";
|
|
18
|
+
} | null): Permission[] | null;
|
|
12
19
|
export type PrepareTurnToolPolicyDeps = {
|
|
13
20
|
input: RunAgentTurnInput;
|
|
14
21
|
db: ActivityServices["db"];
|
|
15
22
|
cancellationSignal: AbortSignal | undefined;
|
|
16
|
-
connectionCredentials: ActivityServices["connectionCredentials"];
|
|
17
23
|
turn: ClaimTurnOk["turn"];
|
|
18
24
|
session: ClaimTurnOk["session"];
|
|
19
25
|
fileAuthoritySubjectId: ClaimTurnOk["fileAuthoritySubjectId"];
|
|
@@ -23,6 +29,8 @@ export type PrepareTurnToolPolicyDeps = {
|
|
|
23
29
|
workspaceRefs: WorkspaceRefState;
|
|
24
30
|
};
|
|
25
31
|
export type PrepareTurnToolRuntimeDeps = {
|
|
32
|
+
/** Connected-vault providers and the shared read budget for this attempt. */
|
|
33
|
+
vaultAccess: AttemptVaultAccess;
|
|
26
34
|
fetchKnowledgeSource?: ((input: import("../types.js").RunKnowledgeSourceSyncBatchInput) => Promise<import("../types.js").RunKnowledgeSourceSyncBatchResult>) | undefined;
|
|
27
35
|
input: RunAgentTurnInput;
|
|
28
36
|
catalogSourceSettings: Settings;
|
|
@@ -42,11 +50,14 @@ export type PrepareTurnToolRuntimeDeps = {
|
|
|
42
50
|
fileAuthoritySubjectId: ClaimTurnOk["fileAuthoritySubjectId"];
|
|
43
51
|
capabilitySettings: ClaimTurnOk["capabilitySettings"];
|
|
44
52
|
installedApiIntegrations: ClaimTurnOk["installedApiIntegrations"];
|
|
45
|
-
|
|
53
|
+
codexAppsCoreConnectionId?: ClaimTurnOk["codexAppsCoreConnectionId"];
|
|
46
54
|
turnExecutionPolicy: ClaimTurnOk["turnExecutionPolicy"];
|
|
47
55
|
trigger: ClaimTurnOk["trigger"];
|
|
48
56
|
runSettings: GovernanceModelOk["runSettings"];
|
|
57
|
+
resolvedModel: GovernanceModelOk["resolvedModel"];
|
|
49
58
|
lazyToolTransport: GovernanceModelOk["lazyToolTransport"];
|
|
59
|
+
/** The workspace allows Opengeni credits; paid web tools are omitted when not. */
|
|
60
|
+
workspaceCreditModelsAllowed: GovernanceModelOk["workspaceCreditModelsAllowed"];
|
|
50
61
|
turnTools: ReturnType<typeof withFirstPartyTools>;
|
|
51
62
|
connectionScope: {
|
|
52
63
|
accountId: string;
|
|
@@ -60,8 +71,18 @@ export type PrepareTurnToolRuntimeDeps = {
|
|
|
60
71
|
credentialSubjectId: ClaimTurnOk["credentialSubjectId"];
|
|
61
72
|
interactionInterventionResume: ClaimTurnOk["interactionInterventionResume"];
|
|
62
73
|
runWorkspaceMutationForSandbox: SandboxTurnRuntime["runWorkspaceMutationForSandbox"];
|
|
74
|
+
/** Deployment and workspace allow the Jev-backed code_search tool. */
|
|
75
|
+
codeSearchEnabled: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* False for an optional repository that sits this turn out after losing
|
|
78
|
+
* access (dropUnavailableOptionalRepositories), so no tool surface offers it.
|
|
79
|
+
*/
|
|
80
|
+
retainsOptionalRepository?: (resource: ResourceRef) => boolean;
|
|
63
81
|
throwIfWorkerShuttingDown: () => void;
|
|
64
82
|
throwIfTurnCancelled: () => void;
|
|
83
|
+
/** Present when this turn resolves host-managed run credentials. */
|
|
84
|
+
runCredentialRenewals?: RenewalState | undefined;
|
|
85
|
+
runMcpCredentials?: RunMcpCredentials;
|
|
65
86
|
};
|
|
66
87
|
export declare function prepareTurnToolPolicy(deps: PrepareTurnToolPolicyDeps): Promise<{
|
|
67
88
|
turnResources: ({
|
|
@@ -81,6 +102,7 @@ export declare function prepareTurnToolPolicy(deps: PrepareTurnToolPolicyDeps):
|
|
|
81
102
|
connectionId?: string | undefined;
|
|
82
103
|
githubInstallationId?: number | undefined;
|
|
83
104
|
githubRepositoryId?: number | undefined;
|
|
105
|
+
optional?: boolean | undefined;
|
|
84
106
|
} | {
|
|
85
107
|
kind: "file";
|
|
86
108
|
fileId: string;
|
|
@@ -103,6 +125,7 @@ export declare function prepareTurnToolPolicy(deps: PrepareTurnToolPolicyDeps):
|
|
|
103
125
|
connectionId?: string | undefined;
|
|
104
126
|
githubInstallationId?: number | undefined;
|
|
105
127
|
githubRepositoryId?: number | undefined;
|
|
128
|
+
optional?: boolean | undefined;
|
|
106
129
|
} | {
|
|
107
130
|
kind: "file";
|
|
108
131
|
fileId: string;
|
|
@@ -114,13 +137,12 @@ export declare function prepareTurnToolPolicy(deps: PrepareTurnToolPolicyDeps):
|
|
|
114
137
|
id: string;
|
|
115
138
|
eager?: boolean | undefined;
|
|
116
139
|
optional?: boolean | undefined;
|
|
140
|
+
allowedTools?: string[] | undefined;
|
|
117
141
|
}[];
|
|
118
142
|
connectionScope: {
|
|
119
143
|
accountId: string;
|
|
120
144
|
workspaceId: string;
|
|
121
145
|
};
|
|
122
|
-
workspaceVariableSet: import("@opengeni/db").VariableSetForRun | null;
|
|
123
|
-
sandboxWorkspaceEnvironmentValues: Record<string, string>;
|
|
124
146
|
}>;
|
|
125
147
|
export declare function prepareTurnToolRuntime(deps: PrepareTurnToolRuntimeDeps): Promise<{
|
|
126
148
|
attemptConnectorActionBindings: AttemptConnectorActionBinding[];
|
|
@@ -131,6 +153,7 @@ export declare function prepareTurnToolRuntime(deps: PrepareTurnToolRuntimeDeps)
|
|
|
131
153
|
url: string;
|
|
132
154
|
allowedTools?: string[] | undefined;
|
|
133
155
|
timeoutMs?: number | undefined;
|
|
156
|
+
setupTimeoutMs?: number | undefined;
|
|
134
157
|
cacheToolsList: boolean;
|
|
135
158
|
requireApproval?: boolean | string[] | undefined;
|
|
136
159
|
headers?: Record<string, string> | undefined;
|
|
@@ -162,6 +185,8 @@ export declare function prepareTurnToolRuntime(deps: PrepareTurnToolRuntimeDeps)
|
|
|
162
185
|
generateSessionTitleInParallel: boolean;
|
|
163
186
|
postToolPreparationStartedAt: number;
|
|
164
187
|
preparationIndependentToolNames: string[];
|
|
188
|
+
codeSearchAvailable: boolean;
|
|
189
|
+
promptToolAvailability: import("@opengeni/runtime").AgentPromptToolAvailability | undefined;
|
|
165
190
|
skillCatalog: {
|
|
166
191
|
id: string;
|
|
167
192
|
name: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type ComputerToolMode, type LazyToolTransport } from "@opengeni/runtime";
|
|
1
|
+
import { type ComputerToolMode, type LazyToolTransport, type OpenGeniRuntime } from "@opengeni/runtime";
|
|
2
|
+
import type { TurnExecutionPolicyV1 } from "@opengeni/contracts";
|
|
2
3
|
import { type ModelProviderApi, type ResolvedModelProvider, type Settings } from "@opengeni/config";
|
|
3
4
|
import { type ModelAttachmentInputPolicy } from "../run-input.js";
|
|
4
5
|
export declare function shouldStartOnTurnRecording(params: {
|
|
@@ -44,10 +45,53 @@ export declare function structuredToolTransportForTurn(resolvedModel: {
|
|
|
44
45
|
};
|
|
45
46
|
} | null): boolean;
|
|
46
47
|
/**
|
|
47
|
-
*
|
|
48
|
+
* `text.verbosity: "low"` is the Codex CLI default for its GPT-5-family models
|
|
49
|
+
* and keeps final answers short. Send it only where the wire is known to accept
|
|
50
|
+
* it: the ChatGPT/Codex subscription backend, direct OpenAI Responses, and the
|
|
51
|
+
* Azure OpenAI Responses wire, where the parallel session-title request already
|
|
52
|
+
* sends the same field with the turn's model. Gateways, xAI, other
|
|
53
|
+
* OpenAI-compatible endpoints and chat wires keep their provider default. The
|
|
54
|
+
* result depends only on the route and model, so a session sends the same value
|
|
55
|
+
* on every request until its model changes, and a model change already starts a
|
|
56
|
+
* new prompt-cache prefix.
|
|
57
|
+
*/
|
|
58
|
+
export declare function textVerbosityForTurn(resolvedModel: {
|
|
59
|
+
provider: {
|
|
60
|
+
id: string;
|
|
61
|
+
kind: ResolvedModelProvider["kind"];
|
|
62
|
+
api: ModelProviderApi;
|
|
63
|
+
wireProfile: "openai" | "azure-openai";
|
|
64
|
+
builtin: boolean;
|
|
65
|
+
baseUrl?: string | undefined;
|
|
66
|
+
};
|
|
67
|
+
} | null, upstreamModelId: string): "low" | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* Ask supported reasoning Responses routes for their provider-selected summary
|
|
70
|
+
* format. This is public summary text, never private or encrypted reasoning.
|
|
71
|
+
* Codex and unverified compatible wires retain the existing detailed setting.
|
|
72
|
+
*/
|
|
73
|
+
export declare function reasoningSummaryForTurn(resolvedModel: {
|
|
74
|
+
provider: {
|
|
75
|
+
id: string;
|
|
76
|
+
api: ModelProviderApi;
|
|
77
|
+
wireProfile: "openai" | "azure-openai";
|
|
78
|
+
builtin: boolean;
|
|
79
|
+
baseUrl?: string | undefined;
|
|
80
|
+
};
|
|
81
|
+
configured: {
|
|
82
|
+
upstreamModelId: string;
|
|
83
|
+
capabilities: {
|
|
84
|
+
reasoning: {
|
|
85
|
+
runnable: boolean;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
} | null): "auto" | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Progressive tool disclosure is universal for supported Opengeni turns; only
|
|
48
92
|
* its contained transport differs. Codex keeps its native path, built-in direct
|
|
49
93
|
* OpenAI/Azure Responses use native client tool search, and every other ordinary
|
|
50
|
-
* function-calling provider uses
|
|
94
|
+
* function-calling provider uses Opengeni's stable search/invoke dispatcher.
|
|
51
95
|
*/
|
|
52
96
|
export declare function lazyToolTransportForTurn(resolvedModel: {
|
|
53
97
|
provider: {
|
|
@@ -69,6 +113,14 @@ export declare function shouldDeferNonEagerToolPreparation(args: {
|
|
|
69
113
|
triggerKind: "next" | "approval";
|
|
70
114
|
triggerType: string;
|
|
71
115
|
}): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Resolve the provider routing/gating shape for an accepted turn. The current
|
|
118
|
+
* definition is projected back onto the verified frozen policy: a turn
|
|
119
|
+
* accepted before hosted web search was enabled keeps its frozen tool set on
|
|
120
|
+
* every recovery attempt (stable tool prefix, exact accepted definition); the
|
|
121
|
+
* next accepted logical turn resolves the newly enabled tool.
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveAcceptedTurnModel(runtime: Pick<OpenGeniRuntime, "resolveTurnModel">, settings: Settings, policy: TurnExecutionPolicyV1): ReturnType<OpenGeniRuntime["resolveTurnModel"]>;
|
|
72
124
|
/**
|
|
73
125
|
* Native web search is a runtime capability, not part of the session's MCP
|
|
74
126
|
* allow-list. Attach it whenever the resolved provider advertises runnable
|