@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,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable capacity waits and wakes for Codex chat turns on the shared
|
|
3
|
+
* subscription core (M3 PR 2a, inventory EP-T09/T10). Reached only for an
|
|
4
|
+
* account whose Codex cutover row is enabled; the legacy Codex waiter path is
|
|
5
|
+
* untouched. Workflow activity names, signal names and argument shapes stay
|
|
6
|
+
* those of the legacy Codex wait: the activities look a waiter id up in the
|
|
7
|
+
* core table first and fall back to the legacy table.
|
|
8
|
+
*
|
|
9
|
+
* The wait, wake and reconcile steps are provider-neutral (SuperGrok track
|
|
10
|
+
* X1b): a `CoreWaitBinding` supplies one provider's database entry points.
|
|
11
|
+
* The Codex-named functions are Codex's bindings and are unchanged.
|
|
12
|
+
*/
|
|
13
|
+
import { armSubscriptionCoreCodexCapacityWait, readSubscriptionCoreCodexTurnModel, reconcileSubscriptionCoreCodexCapacityWait, type Database, type SubscriptionCoreCodexCapacityWait, type SubscriptionCoreCodexWaitEvaluation, type SubscriptionCoreCodexWakeScope, type SubscriptionCoreCodexPlacementEvaluation, type SubscriptionCoreTurnIdentity, type SubscriptionCoreWaiterProvider } from "@opengeni/db";
|
|
14
|
+
import { type EventBus } from "@opengeni/events";
|
|
15
|
+
import type { Settings } from "@opengeni/config";
|
|
16
|
+
import type { CodexCapacityWaitRef, SignalCodexCapacityWorkflow } from "./types.js";
|
|
17
|
+
/** Typed wake signal attempts before the outbox gives the fast path up. */
|
|
18
|
+
export declare const CORE_CODEX_WAKE_DELIVERY_MAX_ATTEMPTS = 8;
|
|
19
|
+
/** Exponential retry for one typed wake signal: 1 s doubling to 5 minutes. */
|
|
20
|
+
export declare function coreCodexWakeRetryDelayMs(attemptCount: number): number;
|
|
21
|
+
export type CoreCodexWakeServices = {
|
|
22
|
+
db: Database;
|
|
23
|
+
settings?: Settings;
|
|
24
|
+
signalCodexCapacityWorkflow?: SignalCodexCapacityWorkflow | null | undefined;
|
|
25
|
+
};
|
|
26
|
+
/** One provider's database entry points for its core waiters. */
|
|
27
|
+
export type CoreWaitBinding = {
|
|
28
|
+
provider: SubscriptionCoreWaiterProvider;
|
|
29
|
+
arm: typeof armSubscriptionCoreCodexCapacityWait;
|
|
30
|
+
getWaiterById: (db: Database, input: {
|
|
31
|
+
workspaceId: string;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
waiterId: string;
|
|
34
|
+
}) => Promise<SubscriptionCoreCodexCapacityWait | null>;
|
|
35
|
+
readTurnModel: typeof readSubscriptionCoreCodexTurnModel;
|
|
36
|
+
recoverHealth: (db: Database, identity: SubscriptionCoreTurnIdentity) => Promise<number>;
|
|
37
|
+
evaluatePlacement: (db: Database, request: {
|
|
38
|
+
identity: SubscriptionCoreTurnIdentity;
|
|
39
|
+
productModelId: string;
|
|
40
|
+
reasoningLevel: string;
|
|
41
|
+
}) => Promise<SubscriptionCoreCodexPlacementEvaluation>;
|
|
42
|
+
wakeWaiters: (db: Database, input: {
|
|
43
|
+
accountId: string;
|
|
44
|
+
reason: string;
|
|
45
|
+
workspaceIds?: readonly string[];
|
|
46
|
+
}) => Promise<SubscriptionCoreCodexWakeScope[]>;
|
|
47
|
+
reconcileWaiter: typeof reconcileSubscriptionCoreCodexCapacityWait;
|
|
48
|
+
/**
|
|
49
|
+
* Re-read the provider's usage before a timed or woken reconcile evaluates
|
|
50
|
+
* placement, for a provider whose usage read can end an exhaustion before
|
|
51
|
+
* its stored reset (its waiters then recheck on a bounded backoff), under
|
|
52
|
+
* the parked turn's exact accepted identity (the same read placement
|
|
53
|
+
* evaluation uses; never called without one). Best effort: a failure
|
|
54
|
+
* leaves the stored state, and placement decides.
|
|
55
|
+
*/
|
|
56
|
+
refreshBeforeReconcile?: (services: {
|
|
57
|
+
db: Database;
|
|
58
|
+
settings: Settings;
|
|
59
|
+
}, turn: SubscriptionCoreTurnIdentity) => Promise<void>;
|
|
60
|
+
};
|
|
61
|
+
/** Codex's binding (each call resolves the Codex-named entry point at call time). */
|
|
62
|
+
export declare const CODEX_CORE_WAIT_BINDING: CoreWaitBinding;
|
|
63
|
+
export type CoreCodexWakeDeliveryResult = {
|
|
64
|
+
claimed: number;
|
|
65
|
+
delivered: number;
|
|
66
|
+
retried: number;
|
|
67
|
+
abandoned: number;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Drain one workspace's due typed wake obligations: claim (fenced by claim
|
|
71
|
+
* generation), signal `codexCapacityChanged` with the waiter's wake revision,
|
|
72
|
+
* then mark delivered; a failed signal is retried with bounded backoff and
|
|
73
|
+
* given up after a fixed number of attempts. Idempotent across a crash
|
|
74
|
+
* between the database wake and the signal: an unacknowledged claim becomes
|
|
75
|
+
* due again when its claim expires, and the generic session workflow wake
|
|
76
|
+
* committed with the same database wake still reaches the workflow.
|
|
77
|
+
*/
|
|
78
|
+
export declare function deliverSubscriptionCoreCodexWakes(services: CoreCodexWakeServices, scope: SubscriptionCoreCodexWakeScope): Promise<CoreCodexWakeDeliveryResult>;
|
|
79
|
+
/**
|
|
80
|
+
* A capacity change for the account's Codex pool: wake every waiting core
|
|
81
|
+
* waiter (database first, outbox and generic wake in the same commit), then
|
|
82
|
+
* deliver the typed signals. Best effort after the commit; never throws.
|
|
83
|
+
*/
|
|
84
|
+
export declare function wakeSubscriptionCoreCodexWaitersAndDeliver(services: CoreCodexWakeServices, input: {
|
|
85
|
+
accountId: string;
|
|
86
|
+
reason: string;
|
|
87
|
+
workspaceIds?: readonly string[];
|
|
88
|
+
}): Promise<SubscriptionCoreCodexWakeScope[]>;
|
|
89
|
+
/** The same wake for any provider's core waiters. */
|
|
90
|
+
export declare function wakeSubscriptionCoreWaitersAndDeliver(services: CoreCodexWakeServices, binding: Pick<CoreWaitBinding, "wakeWaiters">, input: {
|
|
91
|
+
accountId: string;
|
|
92
|
+
reason: string;
|
|
93
|
+
workspaceIds?: readonly string[];
|
|
94
|
+
}): Promise<SubscriptionCoreCodexWakeScope[]>;
|
|
95
|
+
/**
|
|
96
|
+
* What core placement says about a blocked turn now: run, wait (with its
|
|
97
|
+
* reason, earliest reset and quarantine end), revoked (the exact accepted
|
|
98
|
+
* turn no longer authorizes core use) or paused (the cutover is switched off;
|
|
99
|
+
* the work stays parked). Due quarantines are returned to service first, and
|
|
100
|
+
* a recovery wakes the account's other waiters.
|
|
101
|
+
*/
|
|
102
|
+
export declare function evaluateCoreCodexBlockedTurn(services: CoreCodexWakeServices, input: {
|
|
103
|
+
accountId: string;
|
|
104
|
+
workspaceId: string;
|
|
105
|
+
sessionId: string;
|
|
106
|
+
turnId: string;
|
|
107
|
+
}): Promise<SubscriptionCoreCodexWaitEvaluation>;
|
|
108
|
+
/** The same evaluation for any provider's blocked turn. */
|
|
109
|
+
export declare function evaluateCoreBlockedTurn(services: CoreCodexWakeServices, binding: CoreWaitBinding, input: {
|
|
110
|
+
accountId: string;
|
|
111
|
+
workspaceId: string;
|
|
112
|
+
sessionId: string;
|
|
113
|
+
turnId: string;
|
|
114
|
+
}): Promise<SubscriptionCoreCodexWaitEvaluation>;
|
|
115
|
+
/** Return due quarantines to service under this accepted turn; wake others if any recovered. */
|
|
116
|
+
export declare function recoverCoreCodexHealthAndWake(services: CoreCodexWakeServices, identity: SubscriptionCoreTurnIdentity): Promise<number>;
|
|
117
|
+
/** The same recovery for any provider's connections. */
|
|
118
|
+
export declare function recoverCoreHealthAndWake(services: CoreCodexWakeServices, binding: Pick<CoreWaitBinding, "recoverHealth" | "wakeWaiters">, identity: SubscriptionCoreTurnIdentity): Promise<number>;
|
|
119
|
+
export type CoreCodexReconcileResult = ({
|
|
120
|
+
action: "waiting";
|
|
121
|
+
} & CodexCapacityWaitRef) | {
|
|
122
|
+
action: "resumed" | "paused" | "superseded" | "stale";
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Reconcile one core waiter for the workflow (timer, signal, queue wake or
|
|
126
|
+
* recovery). Returns null when the waiter id is not a core waiter, so the
|
|
127
|
+
* caller falls back to the legacy Codex waiter with the same reference.
|
|
128
|
+
*/
|
|
129
|
+
export declare function reconcileCoreCodexCapacityWait(services: CoreCodexWakeServices & {
|
|
130
|
+
bus: EventBus;
|
|
131
|
+
}, input: {
|
|
132
|
+
accountId: string;
|
|
133
|
+
workspaceId: string;
|
|
134
|
+
sessionId: string;
|
|
135
|
+
waiterId: string;
|
|
136
|
+
generation: number;
|
|
137
|
+
}): Promise<CoreCodexReconcileResult | null>;
|
|
138
|
+
/**
|
|
139
|
+
* The same reconcile for any provider: the waiter is looked up by the exact
|
|
140
|
+
* id and generation the workflow recorded. Null when the id names no core
|
|
141
|
+
* waiter of the binding's provider.
|
|
142
|
+
*/
|
|
143
|
+
export declare function reconcileCoreCapacityWait(services: CoreCodexWakeServices & {
|
|
144
|
+
bus: EventBus;
|
|
145
|
+
/** Present on the workflow's reconcile; the in-turn arm has just placed. */
|
|
146
|
+
settings?: Settings;
|
|
147
|
+
}, binding: CoreWaitBinding, input: {
|
|
148
|
+
accountId: string;
|
|
149
|
+
workspaceId: string;
|
|
150
|
+
sessionId: string;
|
|
151
|
+
waiterId: string;
|
|
152
|
+
generation: number;
|
|
153
|
+
}): Promise<CoreCodexReconcileResult | null>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import { type Database, type SubscriptionCoreConnectionToken, type SubscriptionCoreFetch, type SubscriptionCoreProvider, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
3
|
+
/** Verified: nothing reached the provider. */
|
|
4
|
+
export declare class SubscriptionCoreImageDispatchRejected extends Error {
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
export declare function runSubscriptionCoreImageOperation<T, Bearer>(input: {
|
|
8
|
+
db: Database;
|
|
9
|
+
settings: Settings;
|
|
10
|
+
provider: SubscriptionCoreProvider;
|
|
11
|
+
identity: SubscriptionCoreTurnIdentity;
|
|
12
|
+
connectionId: string;
|
|
13
|
+
attemptId: string;
|
|
14
|
+
executionGeneration: number;
|
|
15
|
+
/** The image ledger's operation id (keys the operation lease). */
|
|
16
|
+
operationId: string;
|
|
17
|
+
toolCallId: string;
|
|
18
|
+
/** The turn's chat-lease dispatch fence: the live attempt still holds the chat lease. */
|
|
19
|
+
assertChatLease: () => Promise<void>;
|
|
20
|
+
/** Maps the core token to the provider client's bearer (inside the pre-dispatch guard). */
|
|
21
|
+
bearer: (token: SubscriptionCoreConnectionToken) => Bearer;
|
|
22
|
+
fetchImpl?: SubscriptionCoreFetch;
|
|
23
|
+
}, generate: (operation: {
|
|
24
|
+
auth: {
|
|
25
|
+
getToken: () => Promise<Bearer>;
|
|
26
|
+
refresh: () => Promise<Bearer>;
|
|
27
|
+
};
|
|
28
|
+
fetch: SubscriptionCoreFetch;
|
|
29
|
+
}) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { type Database, type SubscriptionCoreProvider, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
2
|
+
import type { Settings } from "@opengeni/config";
|
|
3
|
+
/**
|
|
4
|
+
* A stored exhaustion (or a model cooldown the adapter's usage read can end)
|
|
5
|
+
* is re-read at most this often per connection, however many waiters
|
|
6
|
+
* recheck: each waiter rechecks on the bounded backoff (at most every 15
|
|
7
|
+
* minutes), so a parked turn sees an early provider reset within about 50
|
|
8
|
+
* minutes instead of at a stale reset days away.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CORE_USAGE_RECHECK_MIN_INTERVAL_MS: number;
|
|
11
|
+
/**
|
|
12
|
+
* The per-connection interval above counts from the last stored reading, so
|
|
13
|
+
* a probe that stores nothing (the endpoint fails, or answers without
|
|
14
|
+
* windows) would otherwise be repeated by every waiter's recheck. This worker
|
|
15
|
+
* attempts one probe scope (a provider's shared pool in a workspace, or one
|
|
16
|
+
* owner's personal connections) at most this often, whatever the outcome.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CORE_USAGE_PROBE_ATTEMPT_INTERVAL_MS: number;
|
|
19
|
+
/** Test seam: forget every recorded probe attempt (every provider). */
|
|
20
|
+
export declare function resetCoreUsageProbeAttempts(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Before a parked core turn's reconcile, for a provider whose usage read can
|
|
23
|
+
* end an exhaustion before its stored reset (its adapter's
|
|
24
|
+
* `usageReadEndsQuotaExhaustion`): one usage read per blocked connection the
|
|
25
|
+
* work can use whose stored quota was not observed within
|
|
26
|
+
* `CORE_USAGE_RECHECK_MIN_INTERVAL_MS`, through the same core probe the usage
|
|
27
|
+
* refresh routes use.
|
|
28
|
+
*
|
|
29
|
+
* - Shared connections in this workspace's explicit context, as the core's
|
|
30
|
+
* service subject.
|
|
31
|
+
* - With `personalTurn` (the exact accepted turn that waits): only the
|
|
32
|
+
* personal connections placement's personal authorization admits for that
|
|
33
|
+
* turn, each read as the owner in their own Personal workspace.
|
|
34
|
+
*
|
|
35
|
+
* A recovery wakes the organization's core waiters of that provider. A failed
|
|
36
|
+
* probe never blocks a waiter; the stored state stands. Each probe scope is
|
|
37
|
+
* attempted at most once per `CORE_USAGE_PROBE_ATTEMPT_INTERVAL_MS` in this
|
|
38
|
+
* worker.
|
|
39
|
+
*/
|
|
40
|
+
export declare function refreshBlockedCoreQuotaBeforeReconcile(input: {
|
|
41
|
+
provider: SubscriptionCoreProvider;
|
|
42
|
+
db: Database;
|
|
43
|
+
settings: Settings;
|
|
44
|
+
accountId: string;
|
|
45
|
+
workspaceId: string;
|
|
46
|
+
personalTurn?: SubscriptionCoreTurnIdentity | null;
|
|
47
|
+
fetch?: typeof fetch;
|
|
48
|
+
now?: number;
|
|
49
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Database, type SubscriptionCoreTurnIdentity } from "@opengeni/db";
|
|
2
|
+
import type { Settings } from "@opengeni/config";
|
|
3
|
+
/**
|
|
4
|
+
* After the SuperGrok receipt: one billing probe per exhausted connection
|
|
5
|
+
* the work can use (design 5.3, EP-N22), never legacy rows.
|
|
6
|
+
*
|
|
7
|
+
* - Shared connections in this workspace's explicit context, as the core's
|
|
8
|
+
* service subject.
|
|
9
|
+
* - With `personalTurn` (the exact accepted turn being placed or waiting):
|
|
10
|
+
* only the personal connections placement's personal authorization admits
|
|
11
|
+
* for that turn
|
|
12
|
+
* (its initiating human is the session owner, a private session or the
|
|
13
|
+
* owner's Personal workspace, the frozen v2 entry at the current
|
|
14
|
+
* authority generation, personal connections allowed), each read as the
|
|
15
|
+
* owner in their own Personal workspace (the administered
|
|
16
|
+
* `personal_owner` read). Any other turn reads no personal connection.
|
|
17
|
+
*
|
|
18
|
+
* A recovery wakes the organization's SuperGrok core waiters: a shared
|
|
19
|
+
* connection can serve every workspace it reaches, and an owner's parked
|
|
20
|
+
* private work may wait in any workspace. A failed probe never blocks
|
|
21
|
+
* placement or a waiter; the stored state stands.
|
|
22
|
+
*/
|
|
23
|
+
export declare function refreshExhaustedXaiCoreQuota(input: {
|
|
24
|
+
db: Database;
|
|
25
|
+
settings: Settings;
|
|
26
|
+
accountId: string;
|
|
27
|
+
workspaceId: string;
|
|
28
|
+
personalTurn?: SubscriptionCoreTurnIdentity | null;
|
|
29
|
+
fetch?: typeof fetch;
|
|
30
|
+
}): Promise<void>;
|
|
@@ -6,6 +6,8 @@ import type { EventBus } from "@opengeni/events";
|
|
|
6
6
|
import type { Observability } from "@opengeni/observability";
|
|
7
7
|
import type { OpenGeniRuntime } from "@opengeni/runtime";
|
|
8
8
|
import type { ObjectStorage } from "@opengeni/storage";
|
|
9
|
+
import type { VaultConnectionCredentialsPort } from "@opengeni/vaults";
|
|
10
|
+
import type { OnePasswordVaultProviderFactory } from "@opengeni/core";
|
|
9
11
|
export type WakeSessionWorkflowSignal = (input: {
|
|
10
12
|
accountId: string;
|
|
11
13
|
workspaceId: string;
|
|
@@ -78,7 +80,12 @@ export type SharedActivityServices = {
|
|
|
78
80
|
startSandboxReaperWorkflow?: StartSandboxReaperWorkflow | null;
|
|
79
81
|
startVideoGenerationWorkflow?: StartVideoGenerationWorkflow | null;
|
|
80
82
|
entitlements?: EntitlementsPort | null;
|
|
81
|
-
connectionCredentials?:
|
|
83
|
+
connectionCredentials?: VaultConnectionCredentialsPort | null;
|
|
84
|
+
/**
|
|
85
|
+
* Builds 1Password providers for linked vaults (dynamic import of
|
|
86
|
+
* `@opengeni/vaults-onepassword`); null leaves 1Password vaults unavailable.
|
|
87
|
+
*/
|
|
88
|
+
onePasswordVaultProvider?: OnePasswordVaultProviderFactory | null;
|
|
82
89
|
/** Standalone, default-off personal GitHub smart-HTTP broker consumer. */
|
|
83
90
|
personalGitHubCredentials?: ConnectionCredentialsPort["gitCredentials"] | null;
|
|
84
91
|
};
|
|
@@ -87,6 +94,11 @@ export type SharedActivityServices = {
|
|
|
87
94
|
export type ControlActivityServices = SharedActivityServices;
|
|
88
95
|
/** Turn workers own the model loop and never construct document parsers. */
|
|
89
96
|
export type TurnActivityServices = SharedActivityServices & {
|
|
97
|
+
/** Host-owned containment: stop polling and checkpoint peer turns before exit.
|
|
98
|
+
* Bare activity embedders must provide their own worker lifecycle edge. */
|
|
99
|
+
requestWorkerDrain: () => void;
|
|
100
|
+
/** Deterministic test clock for the cleanup-only monitor. */
|
|
101
|
+
turnFinalizationTimeoutMs?: number | undefined;
|
|
90
102
|
runtime: OpenGeniRuntime;
|
|
91
103
|
/** Provider-free test/profiling seam; production injects the real runtime summarizer. */
|
|
92
104
|
summarizeContextForCompaction: typeof import("@opengeni/runtime").summarizeForCompaction;
|
|
@@ -97,7 +109,7 @@ export type ActivityServices = ControlActivityServices & TurnActivityServices &
|
|
|
97
109
|
};
|
|
98
110
|
export type CodexCapacityWaitRef = {
|
|
99
111
|
/** Absent only for Temporal histories written before provider-tagged waits. */
|
|
100
|
-
provider?: "codex" | "xai";
|
|
112
|
+
provider?: "codex" | "xai" | "claude";
|
|
101
113
|
waiterId: string;
|
|
102
114
|
generation: number;
|
|
103
115
|
nextCheckAt: string;
|
|
@@ -118,7 +130,7 @@ export type ReconcileCodexCapacityWaitInput = {
|
|
|
118
130
|
generation: number;
|
|
119
131
|
cause: "timer" | "signal" | "queue" | "recovery";
|
|
120
132
|
/** Absent only for Codex waits and pre-provider-tagged workflow histories. */
|
|
121
|
-
provider?: "codex" | "xai";
|
|
133
|
+
provider?: "codex" | "xai" | "claude";
|
|
122
134
|
};
|
|
123
135
|
export type ReconcileCodexCapacityWaitResult = ({
|
|
124
136
|
action: "waiting";
|
|
@@ -174,6 +186,20 @@ export type ReconcileSessionAttemptQuiescenceInput = {
|
|
|
174
186
|
export type ReconcileSessionAttemptQuiescenceResult = {
|
|
175
187
|
action: "quiesced" | "pending" | "stale";
|
|
176
188
|
};
|
|
189
|
+
export type ReconcileSettledSessionAttemptInput = {
|
|
190
|
+
accountId: string;
|
|
191
|
+
workspaceId: string;
|
|
192
|
+
sessionId: string;
|
|
193
|
+
turnId: string;
|
|
194
|
+
attemptId: string;
|
|
195
|
+
executionGeneration: number;
|
|
196
|
+
workflowId: string;
|
|
197
|
+
workflowRunId: string;
|
|
198
|
+
activityId: string;
|
|
199
|
+
};
|
|
200
|
+
export type ReconcileSettledSessionAttemptResult = {
|
|
201
|
+
action: "recovering" | "exceeded" | "pending" | "stale";
|
|
202
|
+
};
|
|
177
203
|
export type FailSessionAttemptInput = {
|
|
178
204
|
accountId: string;
|
|
179
205
|
workspaceId: string;
|
|
@@ -207,6 +233,7 @@ export type FailSessionAttemptResult = {
|
|
|
207
233
|
action: "failed";
|
|
208
234
|
} | {
|
|
209
235
|
action: "recovering";
|
|
236
|
+
continueDelayMs?: number;
|
|
210
237
|
} | {
|
|
211
238
|
action: "unclaimed";
|
|
212
239
|
} | {
|
|
@@ -235,6 +262,25 @@ export type PostClaimDatabaseRecoveryDetail = {
|
|
|
235
262
|
providerRecoveryCount?: number;
|
|
236
263
|
/** Safe classified provider cause paired with providerRecoveryCount. */
|
|
237
264
|
providerFailureCode?: string;
|
|
265
|
+
/** Preserve a confirmed-overload Retry-After through checkpoint DB outages. */
|
|
266
|
+
providerRecoveryContinueDelayMs?: number;
|
|
267
|
+
/** Persist the no-replay setup marker, not a new provider/setup attempt. */
|
|
268
|
+
sandboxSetupOutcomeUnknown?: true;
|
|
269
|
+
/** Preserve the exhausted budget for a command proven not dispatched. */
|
|
270
|
+
sandboxSetupRecoveryExhausted?: true;
|
|
271
|
+
/** Content-free task usage receipts whose write failed after their
|
|
272
|
+
* provider responses were received. The DB-only control lane writes them
|
|
273
|
+
* with their original identities before any replacement attempt, so known
|
|
274
|
+
* usage is neither lost nor re-requested. Bounded; omitted when none. */
|
|
275
|
+
sessionUsageReceipts?: PostClaimSessionUsageReceipt[];
|
|
276
|
+
};
|
|
277
|
+
export type PostClaimSessionUsageReceipt = {
|
|
278
|
+
sessionId: string;
|
|
279
|
+
sourceId: string;
|
|
280
|
+
turnId: string | null;
|
|
281
|
+
amountMicros: number | null;
|
|
282
|
+
pricingSource: "configured_list_price" | "gateway_reported" | null;
|
|
283
|
+
model: string | null;
|
|
238
284
|
};
|
|
239
285
|
export declare const POST_CLAIM_DATABASE_RECOVERY_FAILURE_TYPE = "OpenGeniPostClaimDatabaseRecovery";
|
|
240
286
|
export declare const POST_CLAIM_DATABASE_RECOVERY_FAILURE_MESSAGE = "Agent turn database recovery required after attempt claim.";
|
|
@@ -311,6 +357,16 @@ export type ExpireSessionInteractionInterventionInput = {
|
|
|
311
357
|
export type ExpireSessionInteractionInterventionResult = {
|
|
312
358
|
action: "expired" | "stale" | "not_found";
|
|
313
359
|
};
|
|
360
|
+
export type ExpireScheduledRunHumanWaitInput = {
|
|
361
|
+
accountId: string;
|
|
362
|
+
workspaceId: string;
|
|
363
|
+
sessionId: string;
|
|
364
|
+
turnId: string;
|
|
365
|
+
runId: string;
|
|
366
|
+
};
|
|
367
|
+
export type ExpireScheduledRunHumanWaitResult = {
|
|
368
|
+
action: "expired" | "stale" | "not_found";
|
|
369
|
+
};
|
|
314
370
|
export type MarkSessionIdleInput = {
|
|
315
371
|
workspaceId: string;
|
|
316
372
|
sessionId: string;
|
|
@@ -333,17 +389,24 @@ export type DispatchScheduledTaskRunInput = {
|
|
|
333
389
|
triggerType: Extract<ScheduledTaskTriggerType, "scheduled">;
|
|
334
390
|
agentRunUsageIdempotencyKey?: never;
|
|
335
391
|
initiator?: never;
|
|
392
|
+
credentialRestriction?: never;
|
|
336
393
|
} | {
|
|
337
394
|
triggerType: Extract<ScheduledTaskTriggerType, "manual" | "initial" | "provider_event" | "retry" | "repair">;
|
|
338
395
|
agentRunUsageIdempotencyKey: string;
|
|
339
396
|
/** Exact identity used by the API-side charge for this same trigger. */
|
|
340
397
|
initiator: TurnInitiator;
|
|
398
|
+
/** Trusted API-side caller ceiling for this occurrence, not the schedule. */
|
|
399
|
+
credentialRestriction?: "developer_setup";
|
|
341
400
|
});
|
|
342
401
|
export type DispatchScheduledTaskRunResult = {
|
|
343
402
|
action: "deleted";
|
|
344
403
|
} | {
|
|
345
404
|
action: "blocked";
|
|
346
|
-
|
|
405
|
+
runId?: string;
|
|
406
|
+
diagnostic?: import("@opengeni/contracts").ConnectionAccountSelectionDiagnostic;
|
|
407
|
+
/** Present when the occurrence was refused as a visible run receipt. */
|
|
408
|
+
refusal?: import("@opengeni/contracts").ScheduledTaskAdmissionRefusal;
|
|
409
|
+
reason: "insufficient_credits" | "allowance_exhausted" | "monthly_model_cost_limit" | "monthly_agent_run_limit" | "session_usage_limit" | "malformed_manual_trigger" | "scheduled_task_paused" | "scheduled_authority_exhausted" | "scheduled_run_terminal" | "scheduled_execution_unrepresentable" | "connection_account_unavailable" | "scheduled_authority_unavailable" | "machine_target_unavailable" | "machine_enrollment_inactive" | "variable_set_unavailable" | "rig_version_unavailable" | "scheduled_model_unavailable" | "knowledge_source_paused" | "legacy_source_schedule_requires_migration" | "atlassian_native_retired" | "incident_preflight_metadata_missing" | "incident_responder_under_capable" | "incident_data_source_unsuitable";
|
|
347
410
|
} | {
|
|
348
411
|
action: "start" | "signal";
|
|
349
412
|
accountId: string;
|
|
@@ -436,6 +499,6 @@ type ClaimedRunAgentTurnResult = {
|
|
|
436
499
|
};
|
|
437
500
|
export type RunAgentTurnResult = ClaimedRunAgentTurnResult | {
|
|
438
501
|
status: "unclaimed";
|
|
439
|
-
reason: "gate-closed" | "no-work" | "stale-approval" | "control-pending";
|
|
502
|
+
reason: "gate-closed" | "no-work" | "stale-approval" | "control-pending" | "dispatch-expired";
|
|
440
503
|
};
|
|
441
504
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VideoGenerationAcceptedReceipt, type GenerateVideoToolInput, type VideoGenerationCapabilities, type VideoGenerationPolicy
|
|
2
|
-
import { type Database
|
|
1
|
+
import { VideoGenerationAcceptedReceipt, type GenerateVideoToolInput, type VideoGenerationCapabilities, type VideoGenerationPolicy } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "@opengeni/db";
|
|
3
3
|
import { type Settings } from "@opengeni/config";
|
|
4
4
|
import type { ObjectStorage } from "@opengeni/storage";
|
|
5
5
|
import { type SandboxCommandRunner } from "./video-reference-staging.js";
|
|
@@ -19,12 +19,6 @@ export declare function videoCapabilitiesForTurn(input: {
|
|
|
19
19
|
credential: VideoGenerationCredentialLease;
|
|
20
20
|
}): VideoGenerationCapabilities;
|
|
21
21
|
export declare function managedVideoGenerationCredentialLease(settings: Settings): VideoGenerationCredentialLease | null;
|
|
22
|
-
export declare function xaiVideoGenerationCredentialLease(input: {
|
|
23
|
-
settings: Settings;
|
|
24
|
-
credential: XaiCredentialForRun;
|
|
25
|
-
subjectId: string;
|
|
26
|
-
authoritySnapshot: XaiProviderAccountAuthoritySnapshotV1;
|
|
27
|
-
}): VideoGenerationCredentialLease;
|
|
28
22
|
export declare function admitVideoGenerationRequest(input: {
|
|
29
23
|
db: Database;
|
|
30
24
|
storage: ObjectStorage;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import type { XaiProviderAccountAuthoritySnapshotV1 } from "@opengeni/contracts";
|
|
2
1
|
export type VideoGenerationProviderCredential = Readonly<{
|
|
3
2
|
kind: "api-key";
|
|
4
3
|
apiKey: string;
|
|
5
|
-
}>
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
}>
|
|
5
|
+
/**
|
|
6
|
+
* A subscription-core funded operation (after the provider's cutover
|
|
7
|
+
* receipt): a reference to the canonical connection, no token material.
|
|
8
|
+
* The credential is read through the core connection seam under the
|
|
9
|
+
* operation's `video` lease at each use (design 5.3, EP-N13/EP-N14).
|
|
10
|
+
*/
|
|
11
|
+
| Readonly<{
|
|
12
|
+
kind: "subscription-connection";
|
|
13
|
+
provider: string;
|
|
14
|
+
connectionId: string;
|
|
13
15
|
}>;
|
|
14
16
|
/** One frozen, provider-neutral credential envelope for every video funding route. */
|
|
15
17
|
export declare function encryptVideoGenerationApiKey(key: Uint8Array, apiKey: string): string;
|
|
16
|
-
export declare function
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
export declare function encryptVideoGenerationConnectionReference(key: Uint8Array, reference: {
|
|
19
|
+
provider: string;
|
|
20
|
+
connectionId: string;
|
|
21
|
+
}): string;
|
|
19
22
|
/**
|
|
20
23
|
* Decrypt without ever attaching parser/decryption errors: JSON parser errors
|
|
21
24
|
* may quote plaintext and must not enter Temporal failure payloads or logs.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Subscription-funded video on the shared subscription core (design 5.3,
|
|
3
|
+
* EP-T17/EP-N12 funding and selection, EP-N13/EP-N14 admission and
|
|
4
|
+
* reconciliation), for any provider whose adapter funds media.
|
|
5
|
+
*
|
|
6
|
+
* - Selection: the first shared organization- or workspace-scoped candidate
|
|
7
|
+
* for the session's recorded owner (the session's explicit choice, then
|
|
8
|
+
* the effective primary, then pool order) whose stored quota is not
|
|
9
|
+
* exhausted now; none when every candidate is exhausted. Never a personal
|
|
10
|
+
* connection: a video job outlives its turn, and reconciliation has no
|
|
11
|
+
* turn authority.
|
|
12
|
+
* - Admission records a reference to that canonical connection, never token
|
|
13
|
+
* material, so no organization-scope envelope can be refused (EP-N13).
|
|
14
|
+
* - Reconciliation reads the credential through the core connection seam
|
|
15
|
+
* under a `video` operation lease on exactly that connection and refreshes
|
|
16
|
+
* only under the core lock (EP-N14). Without a usable connection the
|
|
17
|
+
* operation waits until its recovery deadline (decision 6).
|
|
18
|
+
* - Anything that stops a run before its first request reached the provider
|
|
19
|
+
* (the operation lease's fence, a refused bearer after a 401, a bearer
|
|
20
|
+
* the provider cannot use) is a `SubscriptionCoreVideoDispatchRejected`:
|
|
21
|
+
* verified, nothing reached the provider.
|
|
22
|
+
* - Nothing here reads or writes the chat session binding beyond the
|
|
23
|
+
* candidate order's explicit choice.
|
|
24
|
+
*/
|
|
25
|
+
import { type Settings } from "@opengeni/config";
|
|
26
|
+
import { type Database, type SubscriptionCoreConnectionToken, type SubscriptionCoreFetch, type SubscriptionCoreProvider } from "@opengeni/db";
|
|
27
|
+
import type { VideoGenerationCredentialLease } from "./video-generation-admission.js";
|
|
28
|
+
type SessionContext = {
|
|
29
|
+
accountId: string;
|
|
30
|
+
workspaceId: string;
|
|
31
|
+
sessionId: string;
|
|
32
|
+
};
|
|
33
|
+
/** Verified: nothing reached the provider in this run. */
|
|
34
|
+
export declare class SubscriptionCoreVideoDispatchRejected extends Error {
|
|
35
|
+
constructor();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The video funding lease for this session, or null when no shared
|
|
39
|
+
* connection can fund it (none assigned, or every one's stored quota is
|
|
40
|
+
* exhausted now: the provider would refuse the start).
|
|
41
|
+
*/
|
|
42
|
+
export declare function subscriptionCoreVideoGenerationCredentialLease(db: Database, settings: Settings, provider: SubscriptionCoreProvider, fundingSource: VideoGenerationCredentialLease["fundingSource"], context: SessionContext): Promise<VideoGenerationCredentialLease | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Run one reconciliation step on the operation's recorded connection under
|
|
45
|
+
* a `video` operation lease. `unavailable` when the session (or its owner
|
|
46
|
+
* context) is gone, the lease is refused, or the connection's first bearer
|
|
47
|
+
* cannot be read or used (a relogin, a revoked or unassigned connection):
|
|
48
|
+
* nothing reached the provider. `bearer` maps the core token to the
|
|
49
|
+
* provider client's bearer inside the pre-dispatch guard.
|
|
50
|
+
*/
|
|
51
|
+
export declare function withSubscriptionCoreVideoConnection<T, Bearer>(db: Database, settings: Settings, provider: SubscriptionCoreProvider, operation: {
|
|
52
|
+
id: string;
|
|
53
|
+
accountId: string;
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
sessionId: string | null;
|
|
56
|
+
}, connectionId: string, bearer: (token: SubscriptionCoreConnectionToken) => Bearer, run: (connection: {
|
|
57
|
+
auth: {
|
|
58
|
+
getToken: () => Promise<Bearer>;
|
|
59
|
+
refresh: () => Promise<Bearer>;
|
|
60
|
+
};
|
|
61
|
+
fetch: SubscriptionCoreFetch;
|
|
62
|
+
}) => Promise<T>, deps?: {
|
|
63
|
+
fetchImpl?: SubscriptionCoreFetch;
|
|
64
|
+
}): Promise<{
|
|
65
|
+
kind: "ran";
|
|
66
|
+
value: T;
|
|
67
|
+
} | {
|
|
68
|
+
kind: "unavailable";
|
|
69
|
+
}>;
|
|
70
|
+
export {};
|
|
@@ -108,6 +108,8 @@ export declare function captureWhileIdle(input: {
|
|
|
108
108
|
* to release() regardless.
|
|
109
109
|
*/
|
|
110
110
|
export declare function captureWorkspaceRevision(input: CaptureWorkspaceRevisionInput): Promise<void>;
|
|
111
|
+
/** Count one committed logical capture and observe its end-to-end duration. */
|
|
112
|
+
export declare function recordWorkspaceCaptureCompleted(observability: Pick<Observability, "incrementCounter" | "observeHistogram">, durationMs: number): void;
|
|
111
113
|
/**
|
|
112
114
|
* sha256 over the CHANGE SURFACE only — per-file (path, status, hash, deleted,
|
|
113
115
|
* tooLarge), exact HEAD identity, the working diff summary, and exact committed
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { CredentialProviderResponse, type CredentialProviderRequest, type RunCredentialsRequest, type RunCredentialsResolution } from "@opengeni/contracts";
|
|
3
|
+
import { resolveWorkspaceCredentialProvider, resolveInitiatingHuman, type Database } from "@opengeni/db";
|
|
4
|
+
import { pinnedFetch } from "@opengeni/network";
|
|
5
|
+
export declare const GIT_CREDENTIALS_FILE = "git/credentials";
|
|
6
|
+
export declare const GIT_CREDENTIALS_FILE_ENV = "OPENGENI_GIT_CREDENTIALS_FILE";
|
|
7
|
+
export declare const PROVIDER_GIT_CONFIG_COUNT_ENV = "OPENGENI_PROVIDER_GIT_CONFIG_COUNT";
|
|
8
|
+
export declare class CredentialProviderError extends Error {
|
|
9
|
+
constructor(message: string);
|
|
10
|
+
}
|
|
11
|
+
export type WorkspaceRunCredentialResolver = (input: RunCredentialsRequest) => Promise<RunCredentialsResolution>;
|
|
12
|
+
type ProviderOk = Extract<CredentialProviderResponse, {
|
|
13
|
+
status: "ok";
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* Turn the provider's `git` sugar into ordinary run-credential material: one
|
|
17
|
+
* renewable credential-store file plus a read-only helper configured through
|
|
18
|
+
* GIT_CONFIG_* environment entries appended after any the host already set.
|
|
19
|
+
*/
|
|
20
|
+
export declare function withGitCredentialHelper(response: ProviderOk): ProviderOk;
|
|
21
|
+
export declare function credentialProviderRequestBody(input: RunCredentialsRequest, initiatingHumanSubjectId: string | null, initiatingHuman?: CredentialProviderRequest["initiatingHuman"], selection?: Pick<CredentialProviderRequest, "lane" | "mcpServers">): CredentialProviderRequest;
|
|
22
|
+
export declare function toRunCredentialsResolution(response: CredentialProviderResponse, scope: {
|
|
23
|
+
accountId: string;
|
|
24
|
+
workspaceId: string;
|
|
25
|
+
sessionId: string;
|
|
26
|
+
}): RunCredentialsResolution;
|
|
27
|
+
export type WorkspaceCredentialProviderDeps = {
|
|
28
|
+
fetch?: typeof pinnedFetch;
|
|
29
|
+
resolveProvider?: typeof resolveWorkspaceCredentialProvider;
|
|
30
|
+
resolveHuman?: typeof resolveInitiatingHuman;
|
|
31
|
+
/** Trusted selected session-attached remote targets, frozen by the worker. */
|
|
32
|
+
mcpServers?: readonly {
|
|
33
|
+
id: string;
|
|
34
|
+
url: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Resolve the workspace's configured HTTP credential provider, if any. The
|
|
39
|
+
* returned resolver has the same contract as a host `runCredentials` port, so
|
|
40
|
+
* provisioning, file materialization, renewal, and reconnect notices reuse the
|
|
41
|
+
* existing run-credential lifecycle unchanged.
|
|
42
|
+
*/
|
|
43
|
+
export declare function workspaceCredentialProviderResolver(db: Database, settings: Settings, scope: {
|
|
44
|
+
accountId: string;
|
|
45
|
+
workspaceId: string;
|
|
46
|
+
}, initiatingHumanSubjectId: string | null, deps?: WorkspaceCredentialProviderDeps): Promise<WorkspaceRunCredentialResolver | null>;
|
|
47
|
+
export {};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { type XaiFetch, type XaiSubscriptionRequestContext } from "@opengeni/xai-subscription";
|
|
5
|
-
export type XaiTurnRequestAuthorization = {
|
|
6
|
-
context: XaiSubscriptionRequestContext;
|
|
7
|
-
credentialId: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function buildXaiTurnRequestAuthorization(input: {
|
|
10
|
-
db: Database;
|
|
11
|
-
settings: Settings;
|
|
12
|
-
accountId: string;
|
|
13
|
-
workspaceId: string;
|
|
14
|
-
subjectId: string;
|
|
1
|
+
import { type XaiSubscriptionRequestContext } from "@opengeni/xai-subscription";
|
|
2
|
+
/** The request-context options of a core SuperGrok turn. */
|
|
3
|
+
export type XaiTurnRequestContextOptions = {
|
|
15
4
|
sessionId: string;
|
|
16
5
|
turnId: string;
|
|
17
|
-
credentialId: string;
|
|
18
|
-
authoritySnapshot: XaiProviderAccountAuthoritySnapshotV1;
|
|
19
|
-
fetch?: XaiFetch;
|
|
20
6
|
hostedSearch?: XaiSubscriptionRequestContext["hostedSearch"];
|
|
21
7
|
onFinalContextUsage?: XaiSubscriptionRequestContext["onFinalContextUsage"];
|
|
22
8
|
nextRequestId?: XaiSubscriptionRequestContext["nextRequestId"];
|
|
23
9
|
streamIdleTimeoutMs?: XaiSubscriptionRequestContext["streamIdleTimeoutMs"];
|
|
24
10
|
onModelRequestDiagnostic?: XaiSubscriptionRequestContext["onModelRequestDiagnostic"];
|
|
25
11
|
onModelRequestEvent?: XaiSubscriptionRequestContext["onModelRequestEvent"];
|
|
26
|
-
}
|
|
12
|
+
};
|
|
13
|
+
/** One turn's SuperGrok request context from its core bearer source and custody. */
|
|
14
|
+
export declare function xaiTurnRequestContext(input: XaiTurnRequestContextOptions, credentials: Pick<XaiSubscriptionRequestContext, "getToken" | "refresh" | "beforeProviderDispatch" | "onProviderRequestSettled">): XaiSubscriptionRequestContext;
|