@opengeni/worker-bundle 2.0.1 → 2.0.2-canary.38686408778001
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 +172 -28
- 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 +3 -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 +30 -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-NTXZHYET.js} +1552 -2876
- package/dist/activities-control-NTXZHYET.js.map +1 -0
- package/dist/activities-control.d.ts +64 -4
- package/dist/{activities-turn-YVVKCGAK.js → activities-turn-RKRI5GY4.js} +9238 -4392
- package/dist/activities-turn-RKRI5GY4.js.map +1 -0
- package/dist/activities.d.ts +64 -4
- package/dist/artifact-materializer-entry.js +104 -35
- 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-M3NVMF2V.js → chunk-7BIHFUGB.js} +2293 -3956
- package/dist/chunk-7BIHFUGB.js.map +1 -0
- package/dist/chunk-MVESOYFC.js +3746 -0
- package/dist/chunk-MVESOYFC.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 +1134 -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 +26 -4
- 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 +94 -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 +599 -110
- 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 +162 -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 +116 -9
- package/src/activities/sandbox-lease.ts +1615 -73
- package/src/activities/scheduled-tasks.ts +758 -141
- 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 +79 -38
- 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,431 @@
|
|
|
1
|
+
import type { AttemptToolDefinition } from "@opengeni/codemode";
|
|
2
|
+
import {
|
|
3
|
+
WEB_FETCH_TOOL_NAME,
|
|
4
|
+
WEB_SEARCH_TOOL_NAME,
|
|
5
|
+
webSearchCallPricing,
|
|
6
|
+
webSearchCreditMicros,
|
|
7
|
+
webSearchProviderConfig,
|
|
8
|
+
webSearchToolPlan,
|
|
9
|
+
type WebSearchProviderConfig,
|
|
10
|
+
type WebSearchProviderEndpoint,
|
|
11
|
+
type WebSearchProviderToolName,
|
|
12
|
+
type WebSearchSettings,
|
|
13
|
+
} from "@opengeni/config";
|
|
14
|
+
import {
|
|
15
|
+
WebSearchBillingRefusedError,
|
|
16
|
+
type WebSearchBilling,
|
|
17
|
+
type WebSearchCallCost,
|
|
18
|
+
type WebSearchCallScope,
|
|
19
|
+
} from "@opengeni/core";
|
|
20
|
+
import type { Observability } from "@opengeni/observability";
|
|
21
|
+
import {
|
|
22
|
+
WEB_FETCH_TOOL_DESCRIPTION,
|
|
23
|
+
WEB_FETCH_RETAINED_MAX_CHARS,
|
|
24
|
+
WEB_SEARCH_TOOL_DESCRIPTION,
|
|
25
|
+
WebSearchProviderError,
|
|
26
|
+
WebToolArgumentError,
|
|
27
|
+
createWebFetchProvider,
|
|
28
|
+
createWebSearchProvider,
|
|
29
|
+
parseWebFetchArguments,
|
|
30
|
+
parseWebSearchArguments,
|
|
31
|
+
renderWebPageWindow,
|
|
32
|
+
renderWebSearchResults,
|
|
33
|
+
webFetchInputSchema,
|
|
34
|
+
webSearchInputSchema,
|
|
35
|
+
type WebPage,
|
|
36
|
+
} from "@opengeni/runtime/web-search";
|
|
37
|
+
import { hostedWebSearchForTurn } from "./tool-policy";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Which web search one turn gets: the provider's hosted tool, Opengeni's
|
|
41
|
+
* provider tools, or neither. Tool preparation and agent construction both
|
|
42
|
+
* call this with the same accepted model and settings, so they agree.
|
|
43
|
+
*/
|
|
44
|
+
export function turnWebSearchPlan(
|
|
45
|
+
resolvedModel: {
|
|
46
|
+
configured: { hostedWebSearch: boolean };
|
|
47
|
+
provider: { kind?: string };
|
|
48
|
+
} | null,
|
|
49
|
+
settings: WebSearchSettings,
|
|
50
|
+
workspaceCreditModelsAllowed: boolean,
|
|
51
|
+
) {
|
|
52
|
+
return webSearchToolPlan(settings, {
|
|
53
|
+
hostedWebSearch: hostedWebSearchForTurn(resolvedModel, settings.webSearchEnabled),
|
|
54
|
+
// SuperGrok's native search is added by its transport, not as an agent
|
|
55
|
+
// tool, so provider tools would only duplicate it.
|
|
56
|
+
transportHostedSearch: resolvedModel?.provider.kind === "xai-subscription",
|
|
57
|
+
// A workspace with Opengeni credits off is offered only free providers.
|
|
58
|
+
creditsDisabled: !workspaceCreditModelsAllowed,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Pages kept per attempt so paging through one page is not billed again. */
|
|
63
|
+
const PAGE_CACHE_ENTRIES = 16;
|
|
64
|
+
|
|
65
|
+
function textResult(text: string, isError: boolean) {
|
|
66
|
+
return { isError, content: [{ type: "text" as const, text }] };
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
type Pricing = ReturnType<typeof webSearchCallPricing>;
|
|
70
|
+
type Operation = "search" | "fetch";
|
|
71
|
+
|
|
72
|
+
function settledCost(
|
|
73
|
+
operationId: string,
|
|
74
|
+
operation: Operation,
|
|
75
|
+
provider: string,
|
|
76
|
+
pricing: Pricing,
|
|
77
|
+
reportedCostMicros: number | undefined,
|
|
78
|
+
): WebSearchCallCost {
|
|
79
|
+
// An explicit operator price wins; then the provider's own reported cost;
|
|
80
|
+
// then the built-in list price.
|
|
81
|
+
const basis: WebSearchCallCost["basis"] = pricing.explicit
|
|
82
|
+
? "configured_price"
|
|
83
|
+
: reportedCostMicros !== undefined
|
|
84
|
+
? "provider_reported"
|
|
85
|
+
: "list_price";
|
|
86
|
+
const providerMicros =
|
|
87
|
+
basis === "provider_reported" ? reportedCostMicros! : pricing.providerMicros;
|
|
88
|
+
return {
|
|
89
|
+
operationId,
|
|
90
|
+
operation,
|
|
91
|
+
provider,
|
|
92
|
+
providerMicros,
|
|
93
|
+
creditMicros: webSearchCreditMicros(providerMicros, pricing.marginBps),
|
|
94
|
+
marginBps: pricing.marginBps,
|
|
95
|
+
basis,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function providerFailure(error: WebSearchProviderError): string {
|
|
100
|
+
return `${error.message}${error.retryable ? ". You may retry shortly." : "."}`;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Closed outcome set for `opengeni_web_search_calls_total`. */
|
|
104
|
+
export type WebSearchCallOutcome =
|
|
105
|
+
| "ok"
|
|
106
|
+
| "provider_error"
|
|
107
|
+
| "provider_retryable"
|
|
108
|
+
| "billing_refused"
|
|
109
|
+
| "error";
|
|
110
|
+
|
|
111
|
+
type WebSearchObservability = Pick<Observability, "warn" | "incrementCounter" | "observeHistogram">;
|
|
112
|
+
|
|
113
|
+
const WEB_SEARCH_DURATION_BUCKETS = [0.25, 0.5, 1, 2, 4, 8, 15, 30];
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* One provider call: a counter by fixed outcome plus its latency. Labels are
|
|
117
|
+
* the operation, the configured provider id, and the outcome only, never the
|
|
118
|
+
* query, URL, or session.
|
|
119
|
+
*/
|
|
120
|
+
function recordWebSearchCall(
|
|
121
|
+
observability: WebSearchObservability,
|
|
122
|
+
operation: Operation,
|
|
123
|
+
provider: string,
|
|
124
|
+
outcome: WebSearchCallOutcome,
|
|
125
|
+
startedAt: number,
|
|
126
|
+
): void {
|
|
127
|
+
observability.incrementCounter({
|
|
128
|
+
name: "opengeni_web_search_calls_total",
|
|
129
|
+
help: "Provider web search/fetch calls made by the worker, by operation, provider and outcome.",
|
|
130
|
+
labels: { operation, provider, outcome },
|
|
131
|
+
});
|
|
132
|
+
observability.observeHistogram({
|
|
133
|
+
name: "opengeni_web_search_call_duration_seconds",
|
|
134
|
+
help: "Provider web search/fetch call duration in seconds.",
|
|
135
|
+
buckets: WEB_SEARCH_DURATION_BUCKETS,
|
|
136
|
+
value: (performance.now() - startedAt) / 1000,
|
|
137
|
+
labels: { operation, provider },
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function providerFailureOutcome(error: WebSearchProviderError): WebSearchCallOutcome {
|
|
142
|
+
return error.retryable ? "provider_retryable" : "provider_error";
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/** A provider rejected the key or the account is out of quota. */
|
|
146
|
+
const CREDENTIAL_COOLDOWN_MS = 10 * 60_000;
|
|
147
|
+
/** A provider rate-limited, timed out, or failed on its side. */
|
|
148
|
+
const TRANSIENT_COOLDOWN_MS = 60_000;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Process-wide provider health for failover ordering. A provider that just
|
|
152
|
+
* failed in a way that will repeat (rate limit, outage, rejected key) moves
|
|
153
|
+
* behind the healthy providers of its slot until its cooldown passes. It is
|
|
154
|
+
* never skipped: when every provider is cooling down they are tried in their
|
|
155
|
+
* configured order.
|
|
156
|
+
*/
|
|
157
|
+
export class WebProviderHealth {
|
|
158
|
+
private readonly coolingUntil = new Map<string, number>();
|
|
159
|
+
constructor(private readonly now: () => number = Date.now) {}
|
|
160
|
+
|
|
161
|
+
order<T extends { endpoint: WebSearchProviderEndpoint }>(
|
|
162
|
+
operation: Operation,
|
|
163
|
+
candidates: readonly T[],
|
|
164
|
+
): T[] {
|
|
165
|
+
const now = this.now();
|
|
166
|
+
const cooling = (candidate: T) =>
|
|
167
|
+
(this.coolingUntil.get(`${operation}:${candidate.endpoint.provider}`) ?? 0) > now;
|
|
168
|
+
return [
|
|
169
|
+
...candidates.filter((candidate) => !cooling(candidate)),
|
|
170
|
+
...candidates.filter(cooling),
|
|
171
|
+
];
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
failed(operation: Operation, provider: string, error: WebSearchProviderError): void {
|
|
175
|
+
const status = error.status;
|
|
176
|
+
const cooldown =
|
|
177
|
+
status === 401 || status === 402 || status === 403
|
|
178
|
+
? CREDENTIAL_COOLDOWN_MS
|
|
179
|
+
: error.retryable
|
|
180
|
+
? TRANSIENT_COOLDOWN_MS
|
|
181
|
+
: 0;
|
|
182
|
+
if (cooldown > 0) this.coolingUntil.set(`${operation}:${provider}`, this.now() + cooldown);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
succeeded(operation: Operation, provider: string): void {
|
|
186
|
+
this.coolingUntil.delete(`${operation}:${provider}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const sharedProviderHealth = new WebProviderHealth();
|
|
191
|
+
|
|
192
|
+
type Candidate<Adapter> = {
|
|
193
|
+
endpoint: WebSearchProviderEndpoint;
|
|
194
|
+
adapter: Adapter;
|
|
195
|
+
pricing: Pricing;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
type CallOutcome<T> = { ok: true; value: T } | { ok: false; message: string };
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Try a slot's providers in order until one answers. Each paid provider is
|
|
202
|
+
* admitted for its own price just before it is called, and only the provider
|
|
203
|
+
* that answered is settled. A provider failure (not a cancelled turn, not a
|
|
204
|
+
* bug) moves to the next provider; the model sees an error only when every
|
|
205
|
+
* provider failed or was refused.
|
|
206
|
+
*/
|
|
207
|
+
async function callWithFailover<Adapter, T>(input: {
|
|
208
|
+
operation: Operation;
|
|
209
|
+
candidates: readonly Candidate<Adapter>[];
|
|
210
|
+
health: WebProviderHealth;
|
|
211
|
+
scope: WebSearchCallScope;
|
|
212
|
+
billing: WebSearchBilling;
|
|
213
|
+
observability: WebSearchObservability;
|
|
214
|
+
operationId: string;
|
|
215
|
+
signal: AbortSignal | undefined;
|
|
216
|
+
call: (adapter: Adapter) => Promise<T>;
|
|
217
|
+
reportedCostMicros: (value: T) => number | undefined;
|
|
218
|
+
settle: (cost: WebSearchCallCost) => Promise<void>;
|
|
219
|
+
}): Promise<CallOutcome<T>> {
|
|
220
|
+
const ordered = input.health.order(input.operation, input.candidates);
|
|
221
|
+
const label = input.operation === "search" ? "Web search" : "Web fetch";
|
|
222
|
+
let lastFailure: WebSearchProviderError | null = null;
|
|
223
|
+
let refusal: WebSearchBillingRefusedError | null = null;
|
|
224
|
+
for (const [index, candidate] of ordered.entries()) {
|
|
225
|
+
const provider = candidate.endpoint.provider;
|
|
226
|
+
try {
|
|
227
|
+
await input.billing.admit(input.scope, candidate.pricing.providerMicros);
|
|
228
|
+
} catch (error) {
|
|
229
|
+
if (!(error instanceof WebSearchBillingRefusedError)) throw error;
|
|
230
|
+
recordWebSearchCall(
|
|
231
|
+
input.observability,
|
|
232
|
+
input.operation,
|
|
233
|
+
provider,
|
|
234
|
+
"billing_refused",
|
|
235
|
+
performance.now(),
|
|
236
|
+
);
|
|
237
|
+
refusal ??= error;
|
|
238
|
+
continue;
|
|
239
|
+
}
|
|
240
|
+
const startedAt = performance.now();
|
|
241
|
+
try {
|
|
242
|
+
const value = await input.call(candidate.adapter);
|
|
243
|
+
recordWebSearchCall(input.observability, input.operation, provider, "ok", startedAt);
|
|
244
|
+
input.health.succeeded(input.operation, provider);
|
|
245
|
+
await input.settle(
|
|
246
|
+
settledCost(
|
|
247
|
+
input.operationId,
|
|
248
|
+
input.operation,
|
|
249
|
+
provider,
|
|
250
|
+
candidate.pricing,
|
|
251
|
+
input.reportedCostMicros(value),
|
|
252
|
+
),
|
|
253
|
+
);
|
|
254
|
+
return { ok: true, value };
|
|
255
|
+
} catch (error) {
|
|
256
|
+
if (input.signal?.aborted) throw error;
|
|
257
|
+
if (!(error instanceof WebSearchProviderError)) {
|
|
258
|
+
recordWebSearchCall(input.observability, input.operation, provider, "error", startedAt);
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
261
|
+
recordWebSearchCall(
|
|
262
|
+
input.observability,
|
|
263
|
+
input.operation,
|
|
264
|
+
provider,
|
|
265
|
+
providerFailureOutcome(error),
|
|
266
|
+
startedAt,
|
|
267
|
+
);
|
|
268
|
+
input.health.failed(input.operation, provider, error);
|
|
269
|
+
input.observability.warn("web search provider call failed", {
|
|
270
|
+
operation: input.operation,
|
|
271
|
+
provider,
|
|
272
|
+
status: error.status ?? undefined,
|
|
273
|
+
retryable: error.retryable,
|
|
274
|
+
failover: index < ordered.length - 1,
|
|
275
|
+
error: error.message,
|
|
276
|
+
});
|
|
277
|
+
lastFailure = error;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (lastFailure)
|
|
281
|
+
return { ok: false, message: `${label} failed: ${providerFailure(lastFailure)}` };
|
|
282
|
+
return { ok: false, message: refusal?.message ?? `${label} is not available.` };
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* The `web_search` and `web_fetch` attempt tools for one turn. The caller
|
|
287
|
+
* decides which names the turn gets ({@link webSearchToolPlan}); this only
|
|
288
|
+
* builds them. Provider keys stay in the worker and never reach a sandbox.
|
|
289
|
+
*/
|
|
290
|
+
export function webSearchToolDefinitions(input: {
|
|
291
|
+
settings: WebSearchSettings;
|
|
292
|
+
tools: readonly WebSearchProviderToolName[];
|
|
293
|
+
scope: WebSearchCallScope;
|
|
294
|
+
billing: WebSearchBilling;
|
|
295
|
+
observability: WebSearchObservability;
|
|
296
|
+
fetch?: typeof fetch;
|
|
297
|
+
health?: WebProviderHealth;
|
|
298
|
+
}): AttemptToolDefinition[] {
|
|
299
|
+
const config: WebSearchProviderConfig | null = webSearchProviderConfig(input.settings);
|
|
300
|
+
if (!config || input.tools.length === 0) return [];
|
|
301
|
+
const health = input.health ?? sharedProviderHealth;
|
|
302
|
+
const adapterInput = {
|
|
303
|
+
timeoutMs: config.timeoutMs,
|
|
304
|
+
...(input.fetch ? { fetch: input.fetch } : {}),
|
|
305
|
+
};
|
|
306
|
+
const settle = async (cost: WebSearchCallCost) => {
|
|
307
|
+
try {
|
|
308
|
+
await input.billing.settle(input.scope, cost);
|
|
309
|
+
} catch (error) {
|
|
310
|
+
// The provider already answered. Keep the model's result; the missing
|
|
311
|
+
// receipt is an operator-visible accounting fault, never a tool failure.
|
|
312
|
+
input.observability.warn("web search usage settlement failed", {
|
|
313
|
+
operation: cost.operation,
|
|
314
|
+
provider: cost.provider,
|
|
315
|
+
error: error instanceof Error ? error.message : String(error),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
const shared = {
|
|
320
|
+
health,
|
|
321
|
+
scope: input.scope,
|
|
322
|
+
billing: input.billing,
|
|
323
|
+
observability: input.observability,
|
|
324
|
+
settle,
|
|
325
|
+
};
|
|
326
|
+
const definitions: AttemptToolDefinition[] = [];
|
|
327
|
+
|
|
328
|
+
if (input.tools.includes(WEB_SEARCH_TOOL_NAME) && config.search.length > 0) {
|
|
329
|
+
const candidates = config.search.map((endpoint) => ({
|
|
330
|
+
endpoint,
|
|
331
|
+
adapter: createWebSearchProvider({ ...adapterInput, endpoint }),
|
|
332
|
+
pricing: webSearchCallPricing(config, endpoint, "search"),
|
|
333
|
+
}));
|
|
334
|
+
definitions.push({
|
|
335
|
+
identity: { serverId: "opengeni", toolName: WEB_SEARCH_TOOL_NAME },
|
|
336
|
+
modelName: WEB_SEARCH_TOOL_NAME,
|
|
337
|
+
codemodePath: ["opengeni", WEB_SEARCH_TOOL_NAME],
|
|
338
|
+
title: "Search the web",
|
|
339
|
+
description: WEB_SEARCH_TOOL_DESCRIPTION,
|
|
340
|
+
inputSchema: webSearchInputSchema as unknown as AttemptToolDefinition["inputSchema"],
|
|
341
|
+
annotations: {
|
|
342
|
+
title: "Search the web",
|
|
343
|
+
readOnlyHint: true,
|
|
344
|
+
destructiveHint: false,
|
|
345
|
+
idempotentHint: true,
|
|
346
|
+
openWorldHint: true,
|
|
347
|
+
},
|
|
348
|
+
source: "opengeni",
|
|
349
|
+
approval: "none",
|
|
350
|
+
execute: async (args, context) => {
|
|
351
|
+
let request: ReturnType<typeof parseWebSearchArguments>;
|
|
352
|
+
try {
|
|
353
|
+
request = parseWebSearchArguments(args);
|
|
354
|
+
} catch (error) {
|
|
355
|
+
if (error instanceof WebToolArgumentError) return textResult(error.message, true);
|
|
356
|
+
throw error;
|
|
357
|
+
}
|
|
358
|
+
const outcome = await callWithFailover({
|
|
359
|
+
...shared,
|
|
360
|
+
operation: "search",
|
|
361
|
+
candidates,
|
|
362
|
+
operationId: context.operationId,
|
|
363
|
+
signal: context.signal,
|
|
364
|
+
call: (adapter) => adapter.search(request, { signal: context.signal }),
|
|
365
|
+
reportedCostMicros: (response) => response.reportedCostMicros,
|
|
366
|
+
});
|
|
367
|
+
return outcome.ok
|
|
368
|
+
? textResult(renderWebSearchResults(request.query, outcome.value.results), false)
|
|
369
|
+
: textResult(outcome.message, true);
|
|
370
|
+
},
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if (input.tools.includes(WEB_FETCH_TOOL_NAME) && config.fetch.length > 0) {
|
|
375
|
+
const candidates = config.fetch.map((endpoint) => ({
|
|
376
|
+
endpoint,
|
|
377
|
+
adapter: createWebFetchProvider({ ...adapterInput, endpoint }),
|
|
378
|
+
pricing: webSearchCallPricing(config, endpoint, "fetch"),
|
|
379
|
+
}));
|
|
380
|
+
const pages = new Map<string, WebPage>();
|
|
381
|
+
definitions.push({
|
|
382
|
+
identity: { serverId: "opengeni", toolName: WEB_FETCH_TOOL_NAME },
|
|
383
|
+
modelName: WEB_FETCH_TOOL_NAME,
|
|
384
|
+
codemodePath: ["opengeni", WEB_FETCH_TOOL_NAME],
|
|
385
|
+
title: "Read a web page",
|
|
386
|
+
description: WEB_FETCH_TOOL_DESCRIPTION,
|
|
387
|
+
inputSchema: webFetchInputSchema as unknown as AttemptToolDefinition["inputSchema"],
|
|
388
|
+
annotations: {
|
|
389
|
+
title: "Read a web page",
|
|
390
|
+
readOnlyHint: true,
|
|
391
|
+
destructiveHint: false,
|
|
392
|
+
idempotentHint: true,
|
|
393
|
+
openWorldHint: true,
|
|
394
|
+
},
|
|
395
|
+
source: "opengeni",
|
|
396
|
+
approval: "none",
|
|
397
|
+
execute: async (args, context) => {
|
|
398
|
+
let request: ReturnType<typeof parseWebFetchArguments>;
|
|
399
|
+
try {
|
|
400
|
+
request = parseWebFetchArguments(args);
|
|
401
|
+
} catch (error) {
|
|
402
|
+
if (error instanceof WebToolArgumentError) return textResult(error.message, true);
|
|
403
|
+
throw error;
|
|
404
|
+
}
|
|
405
|
+
const cached = pages.get(request.url);
|
|
406
|
+
if (cached) return textResult(renderWebPageWindow(cached, request), false);
|
|
407
|
+
const outcome = await callWithFailover({
|
|
408
|
+
...shared,
|
|
409
|
+
operation: "fetch",
|
|
410
|
+
candidates,
|
|
411
|
+
operationId: context.operationId,
|
|
412
|
+
signal: context.signal,
|
|
413
|
+
call: (adapter) => adapter.fetch({ url: request.url }, { signal: context.signal }),
|
|
414
|
+
reportedCostMicros: (page) => page.reportedCostMicros,
|
|
415
|
+
});
|
|
416
|
+
if (!outcome.ok) return textResult(outcome.message, true);
|
|
417
|
+
const page = outcome.value;
|
|
418
|
+
if (pages.size >= PAGE_CACHE_ENTRIES) {
|
|
419
|
+
pages.delete(pages.keys().next().value!);
|
|
420
|
+
}
|
|
421
|
+
// Bound per-attempt memory; one extra character keeps the cut visible.
|
|
422
|
+
pages.set(request.url, {
|
|
423
|
+
...page,
|
|
424
|
+
content: page.content.slice(0, WEB_FETCH_RETAINED_MAX_CHARS + 1),
|
|
425
|
+
});
|
|
426
|
+
return textResult(renderWebPageWindow(page, request), false);
|
|
427
|
+
},
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
return definitions;
|
|
431
|
+
}
|