deepline 0.3.551 → 0.3.553
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/bundling-sources/sdk/src/client-core.ts +130 -12
- package/dist/bundling-sources/sdk/src/compat.ts +239 -87
- package/dist/bundling-sources/sdk/src/config.ts +113 -2
- package/dist/bundling-sources/sdk/src/errors.ts +2 -0
- package/dist/bundling-sources/sdk/src/http-core.ts +124 -10
- package/dist/bundling-sources/sdk/src/index.ts +2 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +6 -4
- package/dist/bundling-sources/sdk/src/play.ts +3 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +66 -30
- package/dist/bundling-sources/sdk/src/tool-calls.ts +2 -1
- package/dist/bundling-sources/sdk/src/tool-failure-hint.ts +104 -0
- package/dist/bundling-sources/sdk/src/types.ts +9 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +4 -2
- package/dist/bundling-sources/shared_libs/integration-contracts/billing-plan-skus.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/action-actor.ts +2 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/credit-recovery.ts +58 -4
- package/dist/bundling-sources/shared_libs/monitors/billing/policy-builders.ts +8 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/pricing.ts +11 -0
- package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/deactivation-reasons.ts +103 -5
- package/dist/bundling-sources/shared_libs/monitors/fleets/converge-admission.ts +133 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-attention.ts +165 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-release.ts +726 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/fence-walk.ts +274 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/issues.ts +1 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/provider-bulk-wait.ts +126 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/shared-payload.ts +189 -0
- package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +28 -0
- package/dist/bundling-sources/shared_libs/monitors/inbound-publish-key.ts +4 -0
- package/dist/bundling-sources/shared_libs/monitors/inventory-counter-errors.ts +25 -0
- package/dist/bundling-sources/shared_libs/monitors/org-monitor-limits.ts +65 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +11 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +152 -1
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +390 -10
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-errors.ts +34 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-identity-claims.ts +66 -30
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-state.ts +30 -0
- package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +80 -13
- package/dist/bundling-sources/shared_libs/monitors/provider-resource-failure.ts +26 -3
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +41 -13
- package/dist/bundling-sources/shared_libs/monitors/signal-radars/raw-receipt-causes.ts +219 -0
- package/dist/bundling-sources/shared_libs/monitors/snitcher-ip2company.ts +21 -10
- package/dist/bundling-sources/shared_libs/monitors/starter-templates.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/tamradar-countries.ts +285 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-guidance.ts +6 -0
- package/dist/bundling-sources/shared_libs/monitors/tracking-provider-integrations.ts +13 -0
- package/dist/bundling-sources/shared_libs/observability/dlq.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/log-metadata.ts +5 -3
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +10 -1
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/redaction.ts +24 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +312 -41
- package/dist/bundling-sources/shared_libs/observability/scheduled-work-manual.ts +1 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/preview-r2-oidc.ts +188 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +170 -16
- package/dist/bundling-sources/shared_libs/play-data-plane/runtime-sheet-storage-contract.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +68 -2
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +568 -26
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-fetch-caller-deadline.ts +200 -0
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/runtime-topology.ts +21 -1
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +14 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +70 -2
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +3 -3
- package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +16 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +92 -16
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +62 -0
- package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +74 -3
- package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +31 -3
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +39 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +33 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +300 -57
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +87 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +241 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +161 -14
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +16 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-compression.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +298 -46
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +62 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-scheduler-topology.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +36 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +206 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +185 -64
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-slot-ledger.ts +157 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +110 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-listener-hint.ts +323 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/executor-attempt-standing.ts +72 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/integration-operation-value-storage.ts +23 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +32 -10
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-workspace-purge.ts +199 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +632 -66
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +517 -16
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-api-origin.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +599 -2
- package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +26 -1
- package/dist/bundling-sources/shared_libs/play-runtime/startup-read-tool-ids.ts +60 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +51 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-call-retry-facts.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +113 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -7
- package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +37 -7
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +40 -5
- package/dist/bundling-sources/shared_libs/plays/deploy/api-client.ts +3 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/control-plane-types.ts +16 -0
- package/dist/bundling-sources/shared_libs/plays/deploy/run-deployment.ts +10 -41
- package/dist/bundling-sources/shared_libs/plays/extension-bridge.ts +33 -0
- package/dist/bundling-sources/shared_libs/plays/row-identity.ts +18 -1
- package/dist/bundling-sources/shared_libs/plays/tool-execution-error.ts +108 -0
- package/dist/bundling-sources/shared_libs/plays/trigger-config-contract.ts +14 -0
- package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +171 -0
- package/dist/bundling-sources/shared_libs/product-notifications/events.ts +27 -1
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +9 -24
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +178 -5
- package/dist/bundling-sources/shared_libs/security/signup-email-dns-screen.ts +148 -0
- package/dist/bundling-sources/shared_libs/tool-execution-error.ts +108 -0
- package/dist/cli/{auth-E7BH4GMJ.mjs → auth-I3QAU4RV.mjs} +8 -7
- package/dist/cli/auth-MQCN7WGZ.js +44 -0
- package/dist/cli/{billing-OXKU462W.mjs → billing-3IC54OQQ.mjs} +202 -59
- package/dist/cli/{billing-DNQAZGX7.js → billing-YGFFVAIC.js} +302 -159
- package/dist/cli/{chunk-COGREZAO.js → chunk-2B5B5KAW.js} +210 -128
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-T2B5BVZE.js → chunk-3NTP2OSG.js} +13 -13
- package/dist/cli/{chunk-FOTGUFVK.mjs → chunk-45OAVGU6.mjs} +5 -5
- package/dist/cli/{chunk-54EEYLTF.js → chunk-4747TPLV.js} +3 -3
- package/dist/cli/{chunk-CLRAANWH.mjs → chunk-4BFTDNHU.mjs} +1 -1
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-4HYNMXXF.mjs} +4 -4
- package/dist/cli/{chunk-5S6PHKRV.mjs → chunk-4SMCFQ23.mjs} +1 -1
- package/dist/cli/{chunk-VWLHRZFG.mjs → chunk-55F6HNOY.mjs} +5 -5
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-VTGG2RT3.js → chunk-6NE3RRRY.js} +1 -1
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-MNSTCJMX.mjs → chunk-72V4PDH5.mjs} +18 -18
- package/dist/cli/{chunk-ZCDKE4UH.js → chunk-74RES4DS.js} +5 -5
- package/dist/cli/{chunk-WKBHUB6R.js → chunk-7GEMELKI.js} +366 -320
- package/dist/cli/{chunk-C4CUZH57.js → chunk-7O6J6A7P.js} +1871 -92
- package/dist/cli/{chunk-7RSIFA72.js → chunk-7SERLBNR.js} +161 -53
- package/dist/cli/{chunk-3G6QZACZ.js → chunk-7YRJ5UC4.js} +21 -21
- package/dist/cli/{chunk-I4VKGNAQ.mjs → chunk-A7DLBE5K.mjs} +136 -54
- package/dist/cli/{chunk-GGB3JYCW.mjs → chunk-AGICYWGN.mjs} +299 -69
- package/dist/cli/{chunk-44KSACJW.mjs → chunk-AGIQDA2T.mjs} +12 -12
- package/dist/cli/{chunk-PACD5DGC.js → chunk-AGLR6QVN.js} +255 -109
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-4OMAGJ6U.js → chunk-BVDKFS2T.js} +2 -2
- package/dist/cli/{chunk-LPJPCGT3.js → chunk-CACFJODG.js} +190 -134
- package/dist/cli/{chunk-GVYLCCKN.mjs → chunk-CAEBJOYU.mjs} +1 -1
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-POLUE7D5.js → chunk-DP2VH7CO.js} +12 -12
- package/dist/cli/{chunk-D6M5HFBB.mjs → chunk-DP64MD6U.mjs} +1 -1
- package/dist/cli/{chunk-W425ERWN.mjs → chunk-DZA7RFGL.mjs} +5 -5
- package/dist/cli/{chunk-R7J7CJPZ.js → chunk-E2G2DNAB.js} +4 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-E7WZOX2A.mjs} +22 -18
- package/dist/cli/{chunk-44I675YK.js → chunk-FM7LPUPA.js} +41 -41
- package/dist/cli/{chunk-2UXDHFSF.mjs → chunk-GAVZ4EOD.mjs} +1 -1
- package/dist/cli/{chunk-Z2FIOG3V.js → chunk-HEBO3XNZ.js} +27 -31
- package/dist/cli/{chunk-6PWJKMFQ.mjs → chunk-HSJ6X2AQ.mjs} +4 -4
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-HVI55MTK.js} +61 -10
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-IH6GDNKW.js} +21 -21
- package/dist/cli/{chunk-3KYBDAR3.js → chunk-IMX7J4DU.js} +8 -8
- package/dist/cli/{chunk-HEHVGEZV.mjs → chunk-INEMTYMT.mjs} +8 -8
- package/dist/cli/{chunk-5VVSEU67.js → chunk-IUOGII7D.js} +6 -7
- package/dist/cli/{chunk-MXGA6JFI.mjs → chunk-JJGWHITQ.mjs} +5 -5
- package/dist/cli/{chunk-QM6Y6S4E.js → chunk-JLGP5XAJ.js} +5 -5
- package/dist/cli/{chunk-V6SCP4B7.mjs → chunk-LFOERUQY.mjs} +69 -3
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-ZMNGZ6XS.mjs → chunk-LH5PZKER.mjs} +80 -24
- package/dist/cli/{chunk-MR5LTVHD.js → chunk-LRDHPOZW.js} +69 -69
- package/dist/cli/{chunk-5LUF4LAR.mjs → chunk-LRZGS6RZ.mjs} +3 -0
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-UDXULACQ.js → chunk-MLABYI4M.js} +90 -24
- package/dist/cli/{chunk-S7IZWGUA.mjs → chunk-NDNHYONK.mjs} +17 -21
- package/dist/cli/{chunk-4D3WIZST.mjs → chunk-OTV2UUKW.mjs} +164 -18
- package/dist/cli/{chunk-XYE5XPGF.js → chunk-Q6Z6N3A7.js} +18 -18
- package/dist/cli/{chunk-7WQNWJQW.mjs → chunk-QG6JIWUL.mjs} +151 -43
- package/dist/cli/{chunk-3T65J5RG.mjs → chunk-QI5S5HWB.mjs} +2 -2
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-PM7MO62Y.mjs → chunk-RMNOZKRI.mjs} +3 -3
- package/dist/cli/{chunk-NMWGZD6Y.js → chunk-RTV4RF7N.js} +36 -36
- package/dist/cli/{chunk-CQ6JYQSW.js → chunk-SBH4CKPN.js} +11 -11
- package/dist/cli/{chunk-BIIJATTX.mjs → chunk-SG3LUONJ.mjs} +3 -3
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-TFEXSHPM.js} +22 -18
- package/dist/cli/{chunk-5IL7SC45.mjs → chunk-TN4TY6TT.mjs} +6 -7
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-UEVKMZLR.mjs} +54 -3
- package/dist/cli/{chunk-RE5MJBEV.mjs → chunk-UVQJYV76.mjs} +2 -2
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-W2ZWQUHT.js → chunk-WOCHZCUJ.js} +2 -2
- package/dist/cli/{chunk-ZDQFBJPO.js → chunk-XLIHTJVM.js} +348 -118
- package/dist/cli/{chunk-2ZYRBMQM.js → chunk-Y6SP3JMI.js} +22 -22
- package/dist/cli/{chunk-PPSDCN6C.js → chunk-YUA6HA6D.js} +2 -2
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/{chunk-E64HFB4L.mjs → chunk-Z6XPSHKM.mjs} +87 -41
- package/dist/cli/{chunk-7DOQ3OEX.mjs → chunk-Z7AOIHFE.mjs} +1870 -91
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-CFJH4KXV.js +22 -0
- package/dist/cli/{concurrent-runs-help-C6L6I5OR.mjs → concurrent-runs-help-DNV2X5AZ.mjs} +9 -8
- package/dist/cli/{csv-QMF4FWE7.js → csv-SA6ELJY6.js} +16 -15
- package/dist/cli/{csv-SYSDXFEM.mjs → csv-ZXZGHWOM.mjs} +7 -6
- package/dist/cli/{db-Q7HURWRZ.mjs → db-A54SP6AD.mjs} +16 -16
- package/dist/cli/{db-YSHPPA4H.js → db-JHFEIQBU.js} +43 -43
- package/dist/cli/describe-PHQ33AGS.mjs +50 -0
- package/dist/cli/describe-RHJ4XRFI.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-G7U3VUXN.mjs → executions-HL2M2DFU.mjs} +10 -10
- package/dist/cli/{executions-MWBC5TAW.js → executions-TLFZRHBJ.js} +12 -12
- package/dist/cli/{feedback-SD55OY6H.js → feedback-5UEX5UZK.js} +17 -16
- package/dist/cli/{feedback-GMHIFLBJ.mjs → feedback-QMBTNXVG.mjs} +9 -8
- package/dist/cli/git-4JWOOHBG.js +26 -0
- package/dist/cli/{git-HPE45OPD.mjs → git-LKGXVIVC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-HFKVBY6G.js → integrations-6RUTLMN7.js} +23 -27
- package/dist/cli/{integrations-2W4MGIQR.mjs → integrations-FGGRVUJ7.mjs} +15 -19
- package/dist/cli/{legacy-noops-SXVNDEXN.js → legacy-noops-J3Z7QRWZ.js} +12 -11
- package/dist/cli/{legacy-noops-GZYKNU2Z.mjs → legacy-noops-YIPRMVXZ.mjs} +9 -8
- package/dist/cli/{mcp-PJRHQHHU.js → mcp-6LWFP7RW.js} +121 -48
- package/dist/cli/{mcp-BWA6KULG.mjs → mcp-CHDYFO7F.mjs} +100 -27
- package/dist/cli/{monitors-K2WSI6CR.js → monitors-STM6A7OU.js} +221 -186
- package/dist/cli/{monitors-SYQKCATO.mjs → monitors-UGRY2BXI.mjs} +58 -23
- package/dist/cli/org-3SYOUQCX.mjs +2289 -0
- package/dist/cli/org-ZOBSNSIB.js +2289 -0
- package/dist/cli/outcomes-H4YYAT5X.js +2865 -0
- package/dist/cli/outcomes-Z3P2JE67.mjs +2865 -0
- package/dist/cli/{play-SZXY2F2S.js → play-SM4CW2GS.js} +1116 -846
- package/dist/cli/{play-TTMABJEI.mjs → play-SN5YWLS7.mjs} +375 -105
- package/dist/cli/{providers-GQIOMRQO.mjs → providers-WZ4YBR5Y.mjs} +10 -10
- package/dist/cli/{providers-YDHCTZAF.js → providers-WZARYMCF.js} +13 -13
- package/dist/cli/{quickstart-PHSSMKCA.mjs → quickstart-2575BNKA.mjs} +7 -6
- package/dist/cli/{quickstart-BNYOXQXG.js → quickstart-PS4YHQJ6.js} +9 -8
- package/dist/cli/{run-GFIAZXVL.js → run-FLZ6OTM7.js} +51 -51
- package/dist/cli/{run-74C3C75C.mjs → run-ZUHCZOJS.mjs} +31 -31
- package/dist/cli/run-identity-LMLFMACS.js +31 -0
- package/dist/cli/{run-identity-MRNCEGV2.mjs → run-identity-MAZ7ANH5.mjs} +9 -3
- package/dist/cli/{search-3SWUB7KX.mjs → search-HLPPKQEO.mjs} +11 -11
- package/dist/cli/search-JJWVHR3N.js +32 -0
- package/dist/cli/{search-output-K2SWHVHQ.mjs → search-output-PDAXNOGP.mjs} +9 -8
- package/dist/cli/{search-output-6JF3S4TP.js → search-output-RXJLU36B.js} +12 -11
- package/dist/cli/{secrets-2M4XWEKE.mjs → secrets-CGELYQ3H.mjs} +11 -11
- package/dist/cli/{secrets-2SAKLH2H.js → secrets-QJNG7G2Y.js} +20 -20
- package/dist/cli/sessions-DHTBT2GN.js +23 -0
- package/dist/cli/{sessions-A64BCXTO.mjs → sessions-ELMWVR4M.mjs} +9 -8
- package/dist/cli/{settings-HV64WIJF.js → settings-44I44P5F.js} +89 -89
- package/dist/cli/{settings-SVGEC3FI.mjs → settings-RR3LZXL7.mjs} +16 -16
- package/dist/cli/{setup-EDC3NEJ3.mjs → setup-KGWRWH4B.mjs} +20 -19
- package/dist/cli/{setup-FHXOLQGQ.js → setup-KTEYOCJO.js} +60 -59
- package/dist/cli/skills-EPZPEXI2.js +37 -0
- package/dist/cli/{skills-3HGHZMXB.mjs → skills-FPRID2I5.mjs} +10 -9
- package/dist/cli/tools-IGQQ5TML.js +57 -0
- package/dist/cli/{tools-P2QS6A6Q.mjs → tools-PI4WMDLY.mjs} +23 -23
- package/dist/cli/update-4RNCVYGE.js +37 -0
- package/dist/cli/{update-552BYQM4.mjs → update-VJOJAZ7B.mjs} +14 -11
- package/dist/cli/{views-PA25NAE3.js → views-NTUOLNQU.js} +62 -64
- package/dist/cli/{views-LD5HXJYY.mjs → views-OVPSINZO.mjs} +47 -49
- package/dist/cli/{workflow-FIDBUQV6.js → workflow-2UDYDM6F.js} +23 -23
- package/dist/cli/{workflow-LDYFGBYP.mjs → workflow-7OEFNXZC.mjs} +13 -13
- package/dist/{client-DuDFiJDU.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-t9HZAkFD.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-DydMQOft.d.mts → client-core-SLLGBTht.d.mts} +285 -23
- package/dist/{client-core-CJRzLanv.d.ts → client-core-p0sOxnkl.d.ts} +285 -23
- package/dist/{compiler-manifest-BqwVrOri.d.mts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.ts} +70 -5
- package/dist/{errors-BU8FB99X.d.mts → errors-CZCrBFrQ.d.mts} +1 -1
- package/dist/{errors-DfVN_FUG.d.ts → errors-DsUkLrdZ.d.ts} +1 -1
- package/dist/{index-BGnvtYGc.d.ts → index-B6RTOZGC.d.ts} +1 -1
- package/dist/{index-DjZgwpGw.d.mts → index-DeOVrEmX.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +66 -55
- package/dist/index.mjs +25 -14
- package/dist/install-integrity.json +162 -142
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +23 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.mjs +2 -2
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/plays/run-request.js +4 -4
- package/dist/plays/run-request.mjs +3 -3
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +15 -13
- package/dist/server.mjs +9 -7
- package/package.json +1 -1
- package/dist/cli/auth-B4PI7GVY.js +0 -43
- package/dist/cli/concurrent-runs-help-JEFQZTJI.js +0 -21
- package/dist/cli/describe-PXTSBJTL.js +0 -50
- package/dist/cli/describe-YGMQBV44.mjs +0 -50
- package/dist/cli/git-I3JV7IGH.js +0 -25
- package/dist/cli/org-5KD7X7IA.mjs +0 -1282
- package/dist/cli/org-YQ2CR32B.js +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-2RRRF4LW.js +0 -32
- package/dist/cli/sessions-SBH27JNW.js +0 -22
- package/dist/cli/skills-Y3SRLOYD.js +0 -36
- package/dist/cli/tools-OFYPUPUV.js +0 -57
- package/dist/cli/update-SOUSCLB7.js +0 -34
|
@@ -116,6 +116,39 @@ export function callerPlayWorkflowIdMatchesRequest(
|
|
|
116
116
|
);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
/**
|
|
120
|
+
* The part of a caller-owned run id that names the run: family, timestamp and
|
|
121
|
+
* entropy. The `-caller-<sha256>` tail only binds the id to its request, so a
|
|
122
|
+
* reader that finds the run by this prefix needs nothing else.
|
|
123
|
+
*/
|
|
124
|
+
const SHORT_PLAY_RUN_ID_RE =
|
|
125
|
+
/^play\/[a-z0-9/-]+\/run\/\d{8}t\d{6}-\d{3}-[a-z0-9]{8}$/;
|
|
126
|
+
|
|
127
|
+
/** Shape of a short run id, as `shortPlayRunId` prints it. */
|
|
128
|
+
export function isShortPlayRunId(value: string): boolean {
|
|
129
|
+
return SHORT_PLAY_RUN_ID_RE.test(value);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/** A run id as people read and type it: caller-owned ids lose their hash tail. */
|
|
133
|
+
export function shortPlayRunId(runId: string): string {
|
|
134
|
+
const short = runId.replace(/-caller-[a-f0-9]{64}$/, '');
|
|
135
|
+
return isShortPlayRunId(short) ? short : runId;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The short id to look a run up by, when `value` cannot be read as written:
|
|
140
|
+
* a short id itself, or a caller-owned id whose hash tail is not the 64 hex
|
|
141
|
+
* characters every caller id carries (agents copying a long id drop or skip
|
|
142
|
+
* characters of the hash). A well-formed full id, or anything that is not a
|
|
143
|
+
* Play run id, returns null and is read exactly as given.
|
|
144
|
+
*/
|
|
145
|
+
export function playRunIdLookupPrefix(value: string): string | null {
|
|
146
|
+
if (isShortPlayRunId(value)) return value;
|
|
147
|
+
const match = /^(.*)-caller-([a-f0-9]*)$/i.exec(value);
|
|
148
|
+
if (!match || /^[a-f0-9]{64}$/.test(match[2]!)) return null;
|
|
149
|
+
return isShortPlayRunId(match[1]!) ? match[1]! : null;
|
|
150
|
+
}
|
|
151
|
+
|
|
119
152
|
export type PlayRunIdentity = {
|
|
120
153
|
workflowId: string;
|
|
121
154
|
runId: string;
|
|
@@ -33,6 +33,30 @@ export function isRunLedgerProjectionChunk(
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/** Ordered outbox facts every Run Ledger receiver proves in one receipt. */
|
|
37
|
+
export const RUN_LEDGER_PROJECTION_PREFIX_DEFAULT_FACTS = 8;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A run whose terminal is pending delivers its outbox backlog in receipts of
|
|
41
|
+
* up to this many facts, so the terminal waits one Convex commit per 32 facts
|
|
42
|
+
* rather than per 8. A receipt names its fact count (`deliveryPrefixFacts`)
|
|
43
|
+
* only above the default, and a projector sends one only to a receiver whose
|
|
44
|
+
* app build advertised it.
|
|
45
|
+
*/
|
|
46
|
+
export const RUN_LEDGER_TERMINAL_BACKLOG_PREFIX_MAX_FACTS = 32;
|
|
47
|
+
|
|
48
|
+
/** Shared wire validation for a receipt's named fact count. */
|
|
49
|
+
export function isRunLedgerDeliveryPrefixFacts(
|
|
50
|
+
value: unknown,
|
|
51
|
+
): value is number {
|
|
52
|
+
return (
|
|
53
|
+
typeof value === 'number' &&
|
|
54
|
+
Number.isSafeInteger(value) &&
|
|
55
|
+
value > RUN_LEDGER_PROJECTION_PREFIX_DEFAULT_FACTS &&
|
|
56
|
+
value <= RUN_LEDGER_TERMINAL_BACKLOG_PREFIX_MAX_FACTS
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
36
60
|
export const RUN_LEDGER_PROJECTION_LEASE_LOST_REASONS = [
|
|
37
61
|
'delivery_lease_not_current',
|
|
38
62
|
'head_lease_missing',
|
|
@@ -12,9 +12,12 @@ import { RUN_EVENT_KIND } from '../run-event-catalog';
|
|
|
12
12
|
import { hydratePlayRunnerConfig } from '../protocol';
|
|
13
13
|
import { DURABLE_RUNS_ROLLOUT } from '../durable-runs-rollout';
|
|
14
14
|
import {
|
|
15
|
+
readRuntimeToolStartupReadAnswer,
|
|
15
16
|
readStartupReadToolIds,
|
|
17
|
+
RUNTIME_TOOL_STARTUP_READS_TOOL_PARAM,
|
|
16
18
|
staticPipelineStartupReadToolIds,
|
|
17
19
|
} from '../startup-read-tool-ids';
|
|
20
|
+
import { PLAY_RUNTIME_TOOL_STARTUP_READS_PATH } from '../runtime-api-paths';
|
|
18
21
|
import { appendFileSync, createReadStream, writeFileSync } from 'node:fs';
|
|
19
22
|
import { readFile } from 'node:fs/promises';
|
|
20
23
|
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
@@ -63,7 +66,11 @@ import {
|
|
|
63
66
|
runtimeLimitExceededCause,
|
|
64
67
|
runtimeLimitExceededFailure,
|
|
65
68
|
} from '../run-failure';
|
|
66
|
-
import {
|
|
69
|
+
import {
|
|
70
|
+
createPlayContext,
|
|
71
|
+
SERIALIZE_DATASET_ROWS_ONCE,
|
|
72
|
+
} from '../context';
|
|
73
|
+
import { resolveExperimentSwitch } from '../experiment-switches';
|
|
67
74
|
import {
|
|
68
75
|
isHtmlErrorBody,
|
|
69
76
|
normalizeToolHttpErrorMessage,
|
|
@@ -288,7 +295,12 @@ import {
|
|
|
288
295
|
} from '../app-runtime-api';
|
|
289
296
|
import { RUNTIME_CAPACITY_POLICY } from '../runtime-capacity-policy';
|
|
290
297
|
import { RUNTIME_RELIABILITY_POLICY } from '../runtime-reliability-policy';
|
|
291
|
-
import {
|
|
298
|
+
import {
|
|
299
|
+
isAccountAccessUnavailableResponse,
|
|
300
|
+
RUNNER_ACCOUNT_ACCESS_UNAVAILABLE_RETRY_BUDGET_MS,
|
|
301
|
+
RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS,
|
|
302
|
+
RUNNER_GATEWAY_SCHEDULER_UNAVAILABLE_RETRY_BUDGET_MS,
|
|
303
|
+
} from '../runtime-constants';
|
|
292
304
|
|
|
293
305
|
const playRuntimeRequire = createRequire(`${process.cwd()}/package.json`);
|
|
294
306
|
const moduleRuntime = playRuntimeRequire('module') as {
|
|
@@ -587,10 +599,94 @@ function isRetryableRuntimeControlStatus(status: number): boolean {
|
|
|
587
599
|
);
|
|
588
600
|
}
|
|
589
601
|
|
|
602
|
+
/**
|
|
603
|
+
* The gateway's declared answer while its scheduler DB breaker is open or a
|
|
604
|
+
* scheduler DB call fails as unavailable. Only retry-safe (read) lookups wait
|
|
605
|
+
* it out, and the next attempt may land on a healthy gateway instance.
|
|
606
|
+
*/
|
|
607
|
+
function isRunnerGatewaySchedulerUnavailableResponse(
|
|
608
|
+
response: Response,
|
|
609
|
+
): boolean {
|
|
610
|
+
return (
|
|
611
|
+
response.status === 503 &&
|
|
612
|
+
response.headers.get('x-deepline-error-code') ===
|
|
613
|
+
'RUNTIME_SCHEDULER_UNAVAILABLE'
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/** 100 ms, 250 ms, then 1 s growing by 1 s per attempt up to 8 s. */
|
|
618
|
+
function runnerRuntimeControlRetryDelayMs(retryAttempt: number): number {
|
|
619
|
+
return (
|
|
620
|
+
RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[retryAttempt - 1] ??
|
|
621
|
+
Math.min(
|
|
622
|
+
8_000,
|
|
623
|
+
1_000 * (retryAttempt - RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS.length),
|
|
624
|
+
)
|
|
625
|
+
);
|
|
626
|
+
}
|
|
627
|
+
|
|
590
628
|
async function sleepRunnerRuntimeControlRetry(ms: number): Promise<void> {
|
|
591
629
|
await new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
592
630
|
}
|
|
593
631
|
|
|
632
|
+
/**
|
|
633
|
+
* Whether the execution gateway attests execute-fenced-v2. Only an answer is
|
|
634
|
+
* a verdict: a definitive response without the attestation means unsupported.
|
|
635
|
+
* A transport failure, timeout or retryable status retries under the runtime
|
|
636
|
+
* control policy and, once exhausted, throws: one unreachable hop is not
|
|
637
|
+
* evidence the gateway lacks the receiver. Answering `false` there failed
|
|
638
|
+
* every row of a Play with "does not support execute-fenced-v2" while the
|
|
639
|
+
* gateway was serving other runs (PR Checks run 44427143252).
|
|
640
|
+
*/
|
|
641
|
+
export async function probeDurableInvocationFenceSupport(input: {
|
|
642
|
+
gatewayBaseUrl: string;
|
|
643
|
+
signal?: AbortSignal;
|
|
644
|
+
fetchImpl?: (url: string, init: RequestInit) => Promise<Response>;
|
|
645
|
+
sleep?: (ms: number) => Promise<void>;
|
|
646
|
+
}): Promise<boolean> {
|
|
647
|
+
const fetchImpl = input.fetchImpl ?? safeNodeOutboundFetch;
|
|
648
|
+
const sleep = input.sleep ?? sleepRunnerRuntimeControlRetry;
|
|
649
|
+
let lastFailure: unknown;
|
|
650
|
+
for (
|
|
651
|
+
let attempt = 1;
|
|
652
|
+
attempt <= RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS;
|
|
653
|
+
attempt += 1
|
|
654
|
+
) {
|
|
655
|
+
if (attempt > 1) await sleep(runnerRuntimeControlRetryDelayMs(attempt - 1));
|
|
656
|
+
input.signal?.throwIfAborted();
|
|
657
|
+
const timeoutSignal = AbortSignal.timeout(
|
|
658
|
+
RUNNER_RUNTIME_CONTROL_REQUEST_TIMEOUT_MS,
|
|
659
|
+
);
|
|
660
|
+
let response: Response;
|
|
661
|
+
try {
|
|
662
|
+
response = await fetchImpl(`${input.gatewayBaseUrl}/healthz`, {
|
|
663
|
+
redirect: 'manual',
|
|
664
|
+
signal: input.signal
|
|
665
|
+
? AbortSignal.any([input.signal, timeoutSignal])
|
|
666
|
+
: timeoutSignal,
|
|
667
|
+
});
|
|
668
|
+
} catch (error) {
|
|
669
|
+
input.signal?.throwIfAborted();
|
|
670
|
+
lastFailure = error;
|
|
671
|
+
continue;
|
|
672
|
+
}
|
|
673
|
+
if (isRetryableRuntimeControlStatus(response.status)) {
|
|
674
|
+
lastFailure = new Error(`HTTP ${response.status}`);
|
|
675
|
+
continue;
|
|
676
|
+
}
|
|
677
|
+
return (
|
|
678
|
+
response.ok &&
|
|
679
|
+
response.headers.get(DURABLE_INVOCATION_FENCE_ATTESTATION_HEADER) ===
|
|
680
|
+
DURABLE_INVOCATION_FENCE_ATTESTATION_VALUE
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
throw new Error(
|
|
684
|
+
`The execution gateway health probe at ${runnerRuntimeControlUrlHost(input.gatewayBaseUrl)} ` +
|
|
685
|
+
`did not answer after ${RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS} attempt(s). No provider request was submitted.`,
|
|
686
|
+
{ cause: lastFailure },
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
|
|
594
690
|
function runnerRuntimeControlUrlHost(url: string): string {
|
|
595
691
|
try {
|
|
596
692
|
return new URL(url).host;
|
|
@@ -619,11 +715,40 @@ export class RunnerRuntimeControlRedirectError extends Error {
|
|
|
619
715
|
* including a failed or non-200 prefetch, falls through to the unchanged
|
|
620
716
|
* request path with its own retries and errors.
|
|
621
717
|
*/
|
|
718
|
+
type RunnerStartupReadAnswer = {
|
|
719
|
+
status: number;
|
|
720
|
+
headers: [string, string][];
|
|
721
|
+
body: string;
|
|
722
|
+
} | null;
|
|
723
|
+
|
|
622
724
|
const runnerStartupReadPrefetch = new Map<
|
|
623
725
|
string,
|
|
624
|
-
Promise<
|
|
726
|
+
Promise<RunnerStartupReadAnswer>
|
|
625
727
|
>();
|
|
626
728
|
|
|
729
|
+
function runnerStartupReadGet(
|
|
730
|
+
url: string,
|
|
731
|
+
headers: Record<string, string>,
|
|
732
|
+
fetchImpl: typeof fetch,
|
|
733
|
+
): Promise<RunnerStartupReadAnswer> {
|
|
734
|
+
return fetchImpl(url, {
|
|
735
|
+
method: 'GET',
|
|
736
|
+
headers,
|
|
737
|
+
redirect: 'manual',
|
|
738
|
+
signal: AbortSignal.timeout(RUNNER_RUNTIME_CONTROL_REQUEST_TIMEOUT_MS),
|
|
739
|
+
}).then(
|
|
740
|
+
async (response) =>
|
|
741
|
+
response.status === 200
|
|
742
|
+
? {
|
|
743
|
+
status: response.status,
|
|
744
|
+
headers: [...response.headers.entries()],
|
|
745
|
+
body: await response.text(),
|
|
746
|
+
}
|
|
747
|
+
: (await response.text().catch(() => ''), null),
|
|
748
|
+
() => null,
|
|
749
|
+
);
|
|
750
|
+
}
|
|
751
|
+
|
|
627
752
|
export function prefetchRunnerRuntimeControlGet(
|
|
628
753
|
url: string,
|
|
629
754
|
headers: Record<string, string>,
|
|
@@ -632,23 +757,130 @@ export function prefetchRunnerRuntimeControlGet(
|
|
|
632
757
|
if (runnerStartupReadPrefetch.has(url)) return;
|
|
633
758
|
runnerStartupReadPrefetch.set(
|
|
634
759
|
url,
|
|
635
|
-
|
|
760
|
+
runnerStartupReadGet(url, headers, fetchImpl),
|
|
761
|
+
);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
/** The gateway's cap on one runtime-tools lookup response. */
|
|
765
|
+
const RUNNER_STARTUP_READ_ANSWER_MAX_BYTES = 256 * 1024;
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Switch SR (`startupReadBatch`): the same startup reads as
|
|
769
|
+
* `prefetchRunnerRuntimeControlGet` gives each tool's metadata and auth-scope
|
|
770
|
+
* URL, fetched in one GET (`PLAY_RUNTIME_TOOL_STARTUP_READS_PATH`) whose body
|
|
771
|
+
* carries each per-tool route's status and body. Each URL keeps its own entry
|
|
772
|
+
* and is consumed exactly as before:
|
|
773
|
+
* - a 200 answer is reused once, with the headers the runner reads from that
|
|
774
|
+
* lookup (the relay's recovery transport header, which it sets on this
|
|
775
|
+
* response as on an auth-scope GET);
|
|
776
|
+
* - a non-200 or oversized answer is not reused, so the first real lookup
|
|
777
|
+
* makes the per-tool GET and meets that route's own outcome;
|
|
778
|
+
* - a batch refused at once (any 4xx but 429: an older gateway's or app's
|
|
779
|
+
* refusal of the unknown path), a malformed body, or a body missing a
|
|
780
|
+
* lookup turns that lookup into its per-tool prefetch, as with the switch
|
|
781
|
+
* off;
|
|
782
|
+
* - a batch that failed slowly or under load (timeout, transport error, 5xx,
|
|
783
|
+
* 429) is not repeated per tool: each lookup is a failed prefetch, so the
|
|
784
|
+
* first real lookup makes its own GET with its own retries, and one startup
|
|
785
|
+
* read never waits out two timeouts.
|
|
786
|
+
*/
|
|
787
|
+
export function prefetchRunnerStartupReadsInOneRequest(
|
|
788
|
+
baseUrl: string,
|
|
789
|
+
toolIds: readonly string[],
|
|
790
|
+
headers: Record<string, string>,
|
|
791
|
+
fetchImpl: typeof fetch = fetch,
|
|
792
|
+
): void {
|
|
793
|
+
const reads = toolIds
|
|
794
|
+
.flatMap((toolId) => {
|
|
795
|
+
const base = `${baseUrl}/api/v2/plays/runtime-tools/${encodeURIComponent(toolId)}`;
|
|
796
|
+
return [
|
|
797
|
+
{ toolId, kind: 'metadata' as const, url: base },
|
|
798
|
+
{ toolId, kind: 'authScope' as const, url: `${base}/auth-scope` },
|
|
799
|
+
];
|
|
800
|
+
})
|
|
801
|
+
.filter(({ url }) => !runnerStartupReadPrefetch.has(url));
|
|
802
|
+
if (reads.length === 0) return;
|
|
803
|
+
const query = new URLSearchParams(
|
|
804
|
+
[...new Set(reads.map(({ toolId }) => toolId))].map((toolId) => [
|
|
805
|
+
RUNTIME_TOOL_STARTUP_READS_TOOL_PARAM,
|
|
806
|
+
toolId,
|
|
807
|
+
]),
|
|
808
|
+
);
|
|
809
|
+
const batch = fetchImpl(
|
|
810
|
+
`${baseUrl}${PLAY_RUNTIME_TOOL_STARTUP_READS_PATH}?${query}`,
|
|
811
|
+
{
|
|
636
812
|
method: 'GET',
|
|
637
813
|
headers,
|
|
638
814
|
redirect: 'manual',
|
|
639
815
|
signal: AbortSignal.timeout(RUNNER_RUNTIME_CONTROL_REQUEST_TIMEOUT_MS),
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
816
|
+
},
|
|
817
|
+
)
|
|
818
|
+
.then(
|
|
819
|
+
async (
|
|
820
|
+
response,
|
|
821
|
+
): Promise<
|
|
822
|
+
'refused' | 'failed' | { body: unknown; transport: string | null }
|
|
823
|
+
> => {
|
|
824
|
+
if (response.status !== 200) {
|
|
825
|
+
await response.text().catch(() => '');
|
|
826
|
+
return response.status >= 400 &&
|
|
827
|
+
response.status < 500 &&
|
|
828
|
+
response.status !== 429
|
|
829
|
+
? 'refused'
|
|
830
|
+
: 'failed';
|
|
831
|
+
}
|
|
832
|
+
const text = await response.text();
|
|
833
|
+
let body: unknown;
|
|
834
|
+
try {
|
|
835
|
+
body = JSON.parse(text);
|
|
836
|
+
} catch {
|
|
837
|
+
return 'refused';
|
|
838
|
+
}
|
|
839
|
+
return {
|
|
840
|
+
body,
|
|
841
|
+
transport: response.headers.get(
|
|
842
|
+
RUNTIME_ASYNC_EXECUTION_RECOVERY_TRANSPORT_HEADER,
|
|
843
|
+
),
|
|
844
|
+
};
|
|
845
|
+
},
|
|
846
|
+
)
|
|
847
|
+
.catch(() => 'failed' as const);
|
|
848
|
+
for (const read of reads) {
|
|
849
|
+
runnerStartupReadPrefetch.set(
|
|
850
|
+
read.url,
|
|
851
|
+
batch.then((served) => {
|
|
852
|
+
if (served === 'failed') return null;
|
|
853
|
+
const answer =
|
|
854
|
+
served === 'refused'
|
|
855
|
+
? null
|
|
856
|
+
: readRuntimeToolStartupReadAnswer(
|
|
857
|
+
served.body,
|
|
858
|
+
read.toolId,
|
|
859
|
+
read.kind,
|
|
860
|
+
);
|
|
861
|
+
if (served === 'refused' || !answer)
|
|
862
|
+
return runnerStartupReadGet(read.url, headers, fetchImpl);
|
|
863
|
+
if (
|
|
864
|
+
answer.status !== 200 ||
|
|
865
|
+
new TextEncoder().encode(answer.body).byteLength >
|
|
866
|
+
RUNNER_STARTUP_READ_ANSWER_MAX_BYTES
|
|
867
|
+
)
|
|
868
|
+
return null;
|
|
869
|
+
const answerHeaders: [string, string][] = [
|
|
870
|
+
['content-type', 'application/json'],
|
|
871
|
+
];
|
|
872
|
+
if (read.kind === 'authScope') {
|
|
873
|
+
answerHeaders.push(['cache-control', 'no-store']);
|
|
874
|
+
if (served.transport !== null)
|
|
875
|
+
answerHeaders.push([
|
|
876
|
+
RUNTIME_ASYNC_EXECUTION_RECOVERY_TRANSPORT_HEADER,
|
|
877
|
+
served.transport,
|
|
878
|
+
]);
|
|
879
|
+
}
|
|
880
|
+
return { status: 200, headers: answerHeaders, body: answer.body };
|
|
881
|
+
}),
|
|
882
|
+
);
|
|
883
|
+
}
|
|
652
884
|
}
|
|
653
885
|
|
|
654
886
|
async function takeRunnerStartupRead(
|
|
@@ -690,6 +922,10 @@ export async function prefetchStaticToolStartupReads(
|
|
|
690
922
|
Authorization: `Bearer ${token}`,
|
|
691
923
|
...(await vercelBypassHeaders(config)),
|
|
692
924
|
};
|
|
925
|
+
if (config.context.startupReadBatch === true) {
|
|
926
|
+
prefetchRunnerStartupReadsInOneRequest(baseUrl, [...toolIds], headers);
|
|
927
|
+
return;
|
|
928
|
+
}
|
|
693
929
|
for (const id of toolIds) {
|
|
694
930
|
const base = `${baseUrl}/api/v2/plays/runtime-tools/${encodeURIComponent(id)}`;
|
|
695
931
|
prefetchRunnerRuntimeControlGet(base, headers);
|
|
@@ -756,16 +992,32 @@ export async function fetchRunnerRuntimeControl(input: {
|
|
|
756
992
|
);
|
|
757
993
|
}
|
|
758
994
|
respondedAttempts += 1;
|
|
759
|
-
if (
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
995
|
+
if (input.retrySafe && isRetryableRuntimeControlStatus(response.status)) {
|
|
996
|
+
const delayMs = runnerRuntimeControlRetryDelayMs(respondedAttempts);
|
|
997
|
+
// A declared scheduler-breaker 503 outlasts three quick attempts, so it
|
|
998
|
+
// keeps retrying within its own wall-clock budget, then fails loudly.
|
|
999
|
+
const schedulerOutageRetryAllowed =
|
|
1000
|
+
!input.init.signal?.aborted &&
|
|
1001
|
+
isRunnerGatewaySchedulerUnavailableResponse(response) &&
|
|
1002
|
+
Date.now() - startedAt + delayMs <=
|
|
1003
|
+
RUNNER_GATEWAY_SCHEDULER_UNAVAILABLE_RETRY_BUDGET_MS;
|
|
1004
|
+
// The app's account-access cutoff could not verify the executor (its
|
|
1005
|
+
// dependency failed); it refused before any route ran. A blip of a few
|
|
1006
|
+
// seconds outlasts three quick attempts, so it gets its own budget.
|
|
1007
|
+
const accountAccessRetryAllowed =
|
|
1008
|
+
!input.init.signal?.aborted &&
|
|
1009
|
+
isAccountAccessUnavailableResponse(response) &&
|
|
1010
|
+
Date.now() - startedAt + delayMs <=
|
|
1011
|
+
RUNNER_ACCOUNT_ACCESS_UNAVAILABLE_RETRY_BUDGET_MS;
|
|
1012
|
+
if (
|
|
1013
|
+
respondedAttempts < RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS ||
|
|
1014
|
+
schedulerOutageRetryAllowed ||
|
|
1015
|
+
accountAccessRetryAllowed
|
|
1016
|
+
) {
|
|
1017
|
+
await response.text().catch(() => '');
|
|
1018
|
+
await sleepImpl(delayMs);
|
|
1019
|
+
continue;
|
|
1020
|
+
}
|
|
769
1021
|
}
|
|
770
1022
|
// `fetch()` resolves once headers arrive. Leaving the body for callers
|
|
771
1023
|
// means this attempt's timeout signal can fire during `response.json()`
|
|
@@ -797,13 +1049,7 @@ export async function fetchRunnerRuntimeControl(input: {
|
|
|
797
1049
|
const retryAttempt = responseReceived
|
|
798
1050
|
? respondedAttempts
|
|
799
1051
|
: noResponseAttempts;
|
|
800
|
-
const delayMs =
|
|
801
|
-
RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[retryAttempt - 1] ??
|
|
802
|
-
Math.min(
|
|
803
|
-
8_000,
|
|
804
|
-
1_000 *
|
|
805
|
-
(retryAttempt - RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS.length),
|
|
806
|
-
);
|
|
1052
|
+
const delayMs = runnerRuntimeControlRetryDelayMs(retryAttempt);
|
|
807
1053
|
const outageRetryAllowed =
|
|
808
1054
|
!responseReceived &&
|
|
809
1055
|
(timeoutSignal.aborted || isRunnerGatewayNoResponseError(error)) &&
|
|
@@ -818,7 +1064,9 @@ export async function fetchRunnerRuntimeControl(input: {
|
|
|
818
1064
|
}
|
|
819
1065
|
}
|
|
820
1066
|
|
|
821
|
-
function createRuntimeToolMetadataResolver(
|
|
1067
|
+
export function createRuntimeToolMetadataResolver(
|
|
1068
|
+
config: PlayRunnerExecutionConfig,
|
|
1069
|
+
) {
|
|
822
1070
|
const cached = new Map<string, Promise<RuntimeToolMetadata>>();
|
|
823
1071
|
|
|
824
1072
|
return async (toolId: string): Promise<RuntimeToolMetadata> => {
|
|
@@ -1524,7 +1772,11 @@ export function playRunnerContextCachePolicy(
|
|
|
1524
1772
|
const policy = playRunnerContextForcePolicy(context);
|
|
1525
1773
|
const window = context.cacheReuseWindowSeconds;
|
|
1526
1774
|
// Optional launch field: older launches carry none.
|
|
1527
|
-
if (
|
|
1775
|
+
if (
|
|
1776
|
+
typeof window !== 'number' ||
|
|
1777
|
+
!Number.isSafeInteger(window) ||
|
|
1778
|
+
window <= 0
|
|
1779
|
+
)
|
|
1528
1780
|
return policy;
|
|
1529
1781
|
return { ...policy, cacheReuseWindowSeconds: window };
|
|
1530
1782
|
}
|
|
@@ -2520,7 +2772,10 @@ async function run(
|
|
|
2520
2772
|
sheetContract?: PlaySheetContract;
|
|
2521
2773
|
}): string[] =>
|
|
2522
2774
|
settlement.sheetContract
|
|
2523
|
-
? datasetDisplayColumnOrder(
|
|
2775
|
+
? datasetDisplayColumnOrder(
|
|
2776
|
+
settlement.columns ?? [],
|
|
2777
|
+
settlement.sheetContract,
|
|
2778
|
+
)
|
|
2524
2779
|
: [...(settlement.columns ?? [])];
|
|
2525
2780
|
const runtimeSheetAttemptKey = (input: {
|
|
2526
2781
|
playName: string;
|
|
@@ -2627,6 +2882,7 @@ async function run(
|
|
|
2627
2882
|
executionGatewayBaseUrl: config.context.executionGatewayBaseUrl,
|
|
2628
2883
|
...playRunnerInvocationFenceFlags(config.context),
|
|
2629
2884
|
runtimeTestFaultHeader: config.context.runtimeTestFaultHeader ?? null,
|
|
2885
|
+
experimentSwitchOverrides: config.context.experimentSwitchOverrides ?? null,
|
|
2630
2886
|
integrationMode: config.context.integrationMode,
|
|
2631
2887
|
docflowEnabled: config.context.docflowEnabled === true,
|
|
2632
2888
|
fixtureBehavior: config.context.fixtureBehavior,
|
|
@@ -2646,27 +2902,7 @@ async function run(
|
|
|
2646
2902
|
) {
|
|
2647
2903
|
return false;
|
|
2648
2904
|
}
|
|
2649
|
-
|
|
2650
|
-
const timeoutSignal = AbortSignal.timeout(
|
|
2651
|
-
RUNNER_RUNTIME_CONTROL_REQUEST_TIMEOUT_MS,
|
|
2652
|
-
);
|
|
2653
|
-
const response = await safeNodeOutboundFetch(
|
|
2654
|
-
`${gatewayBaseUrl}/healthz`,
|
|
2655
|
-
{
|
|
2656
|
-
redirect: 'manual',
|
|
2657
|
-
signal: signal
|
|
2658
|
-
? AbortSignal.any([signal, timeoutSignal])
|
|
2659
|
-
: timeoutSignal,
|
|
2660
|
-
},
|
|
2661
|
-
);
|
|
2662
|
-
return (
|
|
2663
|
-
response.ok &&
|
|
2664
|
-
response.headers.get(DURABLE_INVOCATION_FENCE_ATTESTATION_HEADER) ===
|
|
2665
|
-
DURABLE_INVOCATION_FENCE_ATTESTATION_VALUE
|
|
2666
|
-
);
|
|
2667
|
-
} catch {
|
|
2668
|
-
return false;
|
|
2669
|
-
}
|
|
2905
|
+
return probeDurableInvocationFenceSupport({ gatewayBaseUrl, signal });
|
|
2670
2906
|
},
|
|
2671
2907
|
dbSessionStrategy: config.context.dbSessionStrategy,
|
|
2672
2908
|
createRuntimeSheetDatasetPageReader: (scope) =>
|
|
@@ -3372,6 +3608,13 @@ async function run(
|
|
|
3372
3608
|
attemptSeq: attempt?.attemptSeq ?? runnerRunAttempt,
|
|
3373
3609
|
writeVersion: attempt?.writeVersion ?? null,
|
|
3374
3610
|
},
|
|
3611
|
+
{
|
|
3612
|
+
preparedBody: resolveExperimentSwitch(
|
|
3613
|
+
'SO1',
|
|
3614
|
+
config.context.experimentSwitchOverrides,
|
|
3615
|
+
SERIALIZE_DATASET_ROWS_ONCE,
|
|
3616
|
+
),
|
|
3617
|
+
},
|
|
3375
3618
|
);
|
|
3376
3619
|
const result = await retryRuntimeSheetPersistence({
|
|
3377
3620
|
description: `runtime map persist table=${input.tableNamespace}`,
|