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
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
export { buildDaytonaPayloadMaterializerSource } from '../../daytona-payload-contract';
|
|
39
39
|
import { compactPlayArtifactForRuntimeTransport } from '../../../plays/artifact-transport';
|
|
40
40
|
import { buildBakedRunnerVerifySource } from '../../baked-runner-image';
|
|
41
|
+
import { resolveExperimentSwitch } from '../../experiment-switches';
|
|
41
42
|
import { DURABLE_RUNS_ROLLOUT } from '../../durable-runs-rollout';
|
|
42
43
|
import type {
|
|
43
44
|
DaytonaExecutionContext,
|
|
@@ -254,6 +255,36 @@ export function buildCombinedMaterializeAndWatchdogSource(
|
|
|
254
255
|
return `{${buildDaytonaPayloadMaterializerSource()}}process.argv.splice(1,6);${watchdogSource}`;
|
|
255
256
|
}
|
|
256
257
|
|
|
258
|
+
/**
|
|
259
|
+
* N1 (off): on the inline baked launch, one Node process verifies the baked
|
|
260
|
+
* runner, materializes the payload and becomes the runtime watchdog. Today
|
|
261
|
+
* that is three Node starts in series before the runner's own (the shell
|
|
262
|
+
* guard's `node -e` verify, the materializer, the watchdog); on the 0.5-core
|
|
263
|
+
* standard sandbox each start is a large share of command-accepted to
|
|
264
|
+
* heartbeat. The verdict line and its meaning are unchanged: it is written
|
|
265
|
+
* first, on the exec's stdout (fd 3, duplicated before the output capture),
|
|
266
|
+
* and any non-`ok` verdict exits 98 before the payload is materialized or the
|
|
267
|
+
* runner is started. The shell then exits 98 without running the
|
|
268
|
+
* crash-terminal epilogue, exactly as the shell guard did. Per-run capable
|
|
269
|
+
* (experiment switch N1). The combined process keeps the materializer's heap
|
|
270
|
+
* for the run (about 13 MiB in the #10002 comparison).
|
|
271
|
+
*/
|
|
272
|
+
export const ONE_NODE_GUARDED_INLINE_LAUNCH = false;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* The N1 verify block: reads the baked runner path, its expected sha256 and
|
|
276
|
+
* the pass marker path from argv[1..3]. On `ok` it first writes the pass
|
|
277
|
+
* marker (a failed write makes the verdict `unverified`, which is not `ok`).
|
|
278
|
+
* It then prints exactly one `baked-runner:<verdict>` line on fd 3 and closes
|
|
279
|
+
* it, and on any verdict but `ok` exits 98. The arguments are then removed, so
|
|
280
|
+
* the materializer and the watchdog read the positions they always had. The
|
|
281
|
+
* shell exits 98 unless the pass marker exists, so a guard that refused or
|
|
282
|
+
* died before a verdict never reaches the epilogue (as with the shell guard).
|
|
283
|
+
*/
|
|
284
|
+
export function buildOneNodeBakedRunnerGuardSource(): string {
|
|
285
|
+
return `{const fs=require('node:fs');const c=require('node:crypto');let r='missing';try{r=c.createHash('sha256').update(fs.readFileSync(process.argv[1])).digest('hex')===process.argv[2]?'ok':'mismatch'}catch(e){}if(r==='ok'){try{fs.writeFileSync(process.argv[3],'ok')}catch(e){r='unverified'}}try{fs.writeSync(3,'baked-runner:'+r+'\\n');fs.closeSync(3)}catch(e){}if(r!=='ok')process.exit(${INLINE_BAKED_RUNNER_UNVERIFIED_EXIT_CODE})}process.argv.splice(1,3);`;
|
|
286
|
+
}
|
|
287
|
+
|
|
257
288
|
/**
|
|
258
289
|
* Crash-containment epilogue (push execution). The parked worker no longer
|
|
259
290
|
* holds anything that returns when the runner process dies, so a runner that
|
|
@@ -727,8 +758,23 @@ function buildDetachedRunnerCommand(input: {
|
|
|
727
758
|
artifactCodePath: string;
|
|
728
759
|
artifactSourceMapPath: string;
|
|
729
760
|
} | null;
|
|
730
|
-
|
|
761
|
+
/**
|
|
762
|
+
* N1: verify this baked runner inside the single materialize-and-watchdog
|
|
763
|
+
* Node process (verdict on fd 3) instead of a separate shell guard. Needs
|
|
764
|
+
* `materialize`.
|
|
765
|
+
*/
|
|
766
|
+
oneNodeBakedGuard?: { path: string; hash: string };
|
|
767
|
+
}): DetachedRunnerPaths & {
|
|
768
|
+
command: string;
|
|
769
|
+
/** N1 only: the marker the guard writes once the baked runner verified. */
|
|
770
|
+
bakedPassMarkerPath?: string;
|
|
771
|
+
} {
|
|
731
772
|
const { workDir, configPath, crashPusherPath, materialize } = input;
|
|
773
|
+
const oneNodeBakedGuard =
|
|
774
|
+
materialize !== null ? (input.oneNodeBakedGuard ?? null) : null;
|
|
775
|
+
const bakedPassMarkerPath = oneNodeBakedGuard
|
|
776
|
+
? `${workDir}/deepline-play-baked-verified-${randomUUID()}.txt`
|
|
777
|
+
: null;
|
|
732
778
|
const runtimeLimitSeconds = input.sandboxRuntimeLimits.timeoutSeconds;
|
|
733
779
|
const outputPath = `${workDir}/deepline-play-output-${randomUUID()}.log`;
|
|
734
780
|
const crashPusherLogPath = `${workDir}/deepline-play-crash-terminal-${randomUUID()}.log`;
|
|
@@ -759,7 +805,9 @@ function buildDetachedRunnerCommand(input: {
|
|
|
759
805
|
? shellQuote(input.nodeBinaryPath)
|
|
760
806
|
: 'node';
|
|
761
807
|
const singleNodeStart =
|
|
762
|
-
materialize !== null &&
|
|
808
|
+
materialize !== null &&
|
|
809
|
+
(oneNodeBakedGuard !== null ||
|
|
810
|
+
DURABLE_RUNS_ROLLOUT.singleNodeMaterializeWatchdog);
|
|
763
811
|
const watchdogSource = buildDaytonaRuntimeWatchdogSource(
|
|
764
812
|
input.sandboxRuntimeLimits,
|
|
765
813
|
input.memoryLimitMiB,
|
|
@@ -770,9 +818,17 @@ function buildDetachedRunnerCommand(input: {
|
|
|
770
818
|
'-e',
|
|
771
819
|
shellQuote(
|
|
772
820
|
singleNodeStart
|
|
773
|
-
? buildCombinedMaterializeAndWatchdogSource(watchdogSource)
|
|
821
|
+
? `${oneNodeBakedGuard ? buildOneNodeBakedRunnerGuardSource() : ''}${buildCombinedMaterializeAndWatchdogSource(watchdogSource)}`
|
|
774
822
|
: watchdogSource,
|
|
775
823
|
),
|
|
824
|
+
// N1 guard arguments, consumed (and removed from argv) first.
|
|
825
|
+
...(oneNodeBakedGuard && bakedPassMarkerPath
|
|
826
|
+
? [
|
|
827
|
+
shellQuote(oneNodeBakedGuard.path),
|
|
828
|
+
shellQuote(oneNodeBakedGuard.hash),
|
|
829
|
+
shellQuote(bakedPassMarkerPath),
|
|
830
|
+
]
|
|
831
|
+
: []),
|
|
776
832
|
// Materializer arguments, consumed (and removed from argv) before the
|
|
777
833
|
// watchdog reads its own.
|
|
778
834
|
...(singleNodeStart && materialize
|
|
@@ -821,10 +877,20 @@ function buildDetachedRunnerCommand(input: {
|
|
|
821
877
|
// Its own retry diagnostics are kept in a separate log: appending them to
|
|
822
878
|
// `outputPath` after a near-gateway-sized result could hide that result from
|
|
823
879
|
// a later bounded-tail recovery read.
|
|
824
|
-
|
|
880
|
+
// N1: unless the guard proved the baked runner (its pass marker), exit 98
|
|
881
|
+
// here, before the epilogue, as the shell guard did: no crash terminal is
|
|
882
|
+
// pushed for a run whose launch falls back to the full upload.
|
|
883
|
+
const bakedRefusalExit = bakedPassMarkerPath
|
|
884
|
+
? `if [ ! -e ${shellQuote(bakedPassMarkerPath)} ]; then exit ${INLINE_BAKED_RUNNER_UNVERIFIED_EXIT_CODE}; fi; `
|
|
885
|
+
: '';
|
|
886
|
+
const bakedRefusalCleanup = bakedPassMarkerPath
|
|
887
|
+
? ` ${shellQuote(bakedPassMarkerPath)}`
|
|
888
|
+
: '';
|
|
889
|
+
const command = `rm -f${bakedRefusalCleanup} ${shellQuote(outputPath)} ${shellQuote(crashPusherLogPath)} ${shellQuote(exitCodePath)} ${shellQuote(oomKillBaselinePath)} ${shellQuote(runnerPidPath)} ${shellQuote(runtimeStartedPath)} ${shellQuote(runtimeCompletedPath)} ${shellQuote(runtimeLimitMarkerPath)} ${shellQuote(terminationDiagnosticPath)} ${shellQuote(memoryLedgerPath)} ${shellQuote(`${memoryLedgerPath}.tmp`)} ${shellQuote(memoryPressurePath)} ${shellQuote(progressEventPath)} ${shellQuote(`${progressEventPath}.*`)} ${shellQuote(startupDiagnosticPath)}; ( awk '$1 == "oom_kill" { print $2 }' /sys/fs/cgroup/memory.events 2>/dev/null || true ) > ${shellQuote(oomKillBaselinePath)}; ( ${runnerCommand} ) > ${shellQuote(outputPath)} 2>&1; code=$?; ${bakedRefusalExit}printf '%s' "$code" > ${shellQuote(exitCodePath)}; ${runtimeReliabilityEnv}${nodeCommand} ${shellQuote(crashPusherPath)} ${shellQuote(configPath)} "$code" ${shellQuote(outputPath)} ${shellQuote(runtimeLimitMarkerPath)} ${shellQuote(oomKillBaselinePath)} /sys/fs/cgroup/memory.events ${shellQuote(terminationDiagnosticPath)} ${shellQuote(runtimeCompletedPath)} > ${shellQuote(crashPusherLogPath)} 2>&1 || true; printf 'deepline runner output captured: %s\\n' ${shellQuote(outputPath)}; exit "$code"`;
|
|
825
890
|
|
|
826
891
|
return {
|
|
827
892
|
command,
|
|
893
|
+
...(bakedPassMarkerPath ? { bakedPassMarkerPath } : {}),
|
|
828
894
|
outputPath,
|
|
829
895
|
exitCodePath,
|
|
830
896
|
oomKillBaselinePath,
|
|
@@ -1221,6 +1287,18 @@ export async function stageRunnerPayload(input: {
|
|
|
1221
1287
|
};
|
|
1222
1288
|
}
|
|
1223
1289
|
|
|
1290
|
+
// N1: only the inline baked launch that verifies in its own command, so a
|
|
1291
|
+
// refusal still exits 98 before anything runs and selects the full upload.
|
|
1292
|
+
const oneNodeBakedGuard =
|
|
1293
|
+
inlineDelivery &&
|
|
1294
|
+
input.bakedRunner?.verifyInCommand === true &&
|
|
1295
|
+
resolveExperimentSwitch(
|
|
1296
|
+
'N1',
|
|
1297
|
+
input.config.context.experimentSwitchOverrides,
|
|
1298
|
+
ONE_NODE_GUARDED_INLINE_LAUNCH,
|
|
1299
|
+
)
|
|
1300
|
+
? { path: input.bakedRunner.path, hash: input.bakedRunner.hash }
|
|
1301
|
+
: null;
|
|
1224
1302
|
const {
|
|
1225
1303
|
command,
|
|
1226
1304
|
outputPath,
|
|
@@ -1233,6 +1311,7 @@ export async function stageRunnerPayload(input: {
|
|
|
1233
1311
|
progressEventPath,
|
|
1234
1312
|
startupDiagnosticPath,
|
|
1235
1313
|
} = buildDetachedRunnerCommand({
|
|
1314
|
+
...(oneNodeBakedGuard ? { oneNodeBakedGuard } : {}),
|
|
1236
1315
|
workDir,
|
|
1237
1316
|
nodeBinaryPath: input.nodeBinaryPath,
|
|
1238
1317
|
sandboxTarget: input.sandbox.target,
|
|
@@ -1263,11 +1342,13 @@ export async function stageRunnerPayload(input: {
|
|
|
1263
1342
|
envelopePath,
|
|
1264
1343
|
envelope: inlineEnvelope,
|
|
1265
1344
|
base64,
|
|
1266
|
-
|
|
1345
|
+
// N1 writes its verdict on fd 3: the exec's stdout, duplicated before
|
|
1346
|
+
// the runner's output capture replaces fd 1.
|
|
1347
|
+
inlineCommand: `${oneNodeBakedGuard ? 'exec 3>&1; ' : ''}${inlineEnvelopeCommandPrefix({
|
|
1267
1348
|
envelopePath,
|
|
1268
1349
|
base64Length: base64.length,
|
|
1269
1350
|
bytes: inlineEnvelope.byteLength,
|
|
1270
|
-
...(input.bakedRunner?.verifyInCommand
|
|
1351
|
+
...(input.bakedRunner?.verifyInCommand && !oneNodeBakedGuard
|
|
1271
1352
|
? {
|
|
1272
1353
|
verifyBakedRunner: {
|
|
1273
1354
|
nodeCommand,
|
|
@@ -108,11 +108,17 @@ import {
|
|
|
108
108
|
import {
|
|
109
109
|
assertEarlySandboxEgress,
|
|
110
110
|
earlySandboxEgressKey,
|
|
111
|
+
earlySandboxEgressRefusal,
|
|
111
112
|
earlySandboxEnvironment,
|
|
112
113
|
earlySandboxGatewayHosts,
|
|
113
114
|
EarlySandboxEnvironmentError,
|
|
114
115
|
EarlySandboxGatewayAddressWatch,
|
|
116
|
+
EARLY_SANDBOX_NARROW_MIN_STABLE_MS,
|
|
117
|
+
EARLY_SANDBOX_NARROW_PREFIX,
|
|
118
|
+
narrowEarlySandboxAllowlist,
|
|
115
119
|
type EarlySandboxEgressRefusal,
|
|
120
|
+
type EarlySandboxNarrowedAllowlist,
|
|
121
|
+
type EarlySandboxNarrowRefusal,
|
|
116
122
|
type EarlySandboxEnvironment,
|
|
117
123
|
type EarlySandboxScope,
|
|
118
124
|
} from '../early-sandbox-egress';
|
|
@@ -1792,11 +1798,18 @@ async function createEarlyModalSandbox(
|
|
|
1792
1798
|
),
|
|
1793
1799
|
})
|
|
1794
1800
|
: baseImage;
|
|
1801
|
+
// EN: the same choice as the hint's, derived again here. A gateway change
|
|
1802
|
+
// since the hint changes the egress key, and the scope check below refuses.
|
|
1803
|
+
const earlyAllowlist = earlyModalEgressNarrowWanted(
|
|
1804
|
+
input.experimentSwitchOverrides,
|
|
1805
|
+
)
|
|
1806
|
+
? earlyModalEarlyAllowlistOrThrow(modalConfig.outboundCidrAllowlist)
|
|
1807
|
+
: modalConfig.outboundCidrAllowlist;
|
|
1795
1808
|
const earlyParams = earlyModalSandboxCreateParams({
|
|
1796
1809
|
limits: modalConfig.limits,
|
|
1797
1810
|
memoryPolicy,
|
|
1798
1811
|
workdir: modalConfig.workdir,
|
|
1799
|
-
outboundCidrAllowlist:
|
|
1812
|
+
outboundCidrAllowlist: earlyAllowlist,
|
|
1800
1813
|
supervisorSidecar,
|
|
1801
1814
|
});
|
|
1802
1815
|
// The key names the scope the hint was accepted for; the create must carry
|
|
@@ -2005,12 +2018,166 @@ export function startEarlyModalSandboxEgressWatch(): void {
|
|
|
2005
2018
|
earlyModalGatewayAddresses.start();
|
|
2006
2019
|
}
|
|
2007
2020
|
|
|
2021
|
+
/**
|
|
2022
|
+
* EN (per-run; granted only through a per-organization fast_launch@7 pin): an early sandbox without the sidecar
|
|
2023
|
+
* carries a narrowed allowlist (`narrowEarlySandboxAllowlist`: each gateway
|
|
2024
|
+
* IPv4 as a /32, contained in the deployment's, from an address set stable
|
|
2025
|
+
* for EARLY_SANDBOX_NARROW_MIN_STABLE_MS) instead of the deployment's. Its
|
|
2026
|
+
* egress key names that list, so only a launch whose own fresh derivation
|
|
2027
|
+
* gives the same list adopts it; any other launch misses and creates its own
|
|
2028
|
+
* sandbox with the deployment's allowlist, byte-identical to today.
|
|
2029
|
+
*/
|
|
2030
|
+
export const NARROW_EARLY_SANDBOX_EGRESS = false;
|
|
2031
|
+
|
|
2032
|
+
/** Whether this run's early sandbox (and its adoption) uses EN. */
|
|
2033
|
+
export function earlyModalEgressNarrowWanted(
|
|
2034
|
+
overrides: EarlySandboxStartRequest['experimentSwitchOverrides'],
|
|
2035
|
+
): boolean {
|
|
2036
|
+
return (
|
|
2037
|
+
!DURABLE_RUNS_ROLLOUT.modalSupervisorSidecar &&
|
|
2038
|
+
resolveExperimentSwitch('EN', overrides, NARROW_EARLY_SANDBOX_EGRESS)
|
|
2039
|
+
);
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
/**
|
|
2043
|
+
* The allowlist an early create carries: EN's narrowed list when it can be
|
|
2044
|
+
* derived now, otherwise the deployment's (exactly today's). The gate, the
|
|
2045
|
+
* key and the create all use this, so they agree; a launch derives the same
|
|
2046
|
+
* choice with `earlyModalAdoptionEgress`.
|
|
2047
|
+
*/
|
|
2048
|
+
export function earlyModalEarlyAllowlist(input: {
|
|
2049
|
+
narrow: boolean;
|
|
2050
|
+
outboundCidrAllowlist: string[] | null;
|
|
2051
|
+
gateway?: EarlySandboxGatewayAddressWatch;
|
|
2052
|
+
nowMs?: number;
|
|
2053
|
+
}): {
|
|
2054
|
+
allowlist: string[] | null;
|
|
2055
|
+
narrowRefusal: EarlySandboxNarrowRefusal | null;
|
|
2056
|
+
/**
|
|
2057
|
+
* With a narrowing refusal: the gate's verdict on the deployment list for
|
|
2058
|
+
* the same gateway state and time. A caller never keys or creates with a
|
|
2059
|
+
* fallback list the gate refuses.
|
|
2060
|
+
*/
|
|
2061
|
+
deploymentRefusal: EarlySandboxEgressRefusal | null;
|
|
2062
|
+
} {
|
|
2063
|
+
if (!input.narrow)
|
|
2064
|
+
return {
|
|
2065
|
+
allowlist: input.outboundCidrAllowlist,
|
|
2066
|
+
narrowRefusal: null,
|
|
2067
|
+
deploymentRefusal: null,
|
|
2068
|
+
};
|
|
2069
|
+
const gateway = input.gateway ?? earlyModalGatewayAddresses;
|
|
2070
|
+
const nowMs = input.nowMs ?? Date.now();
|
|
2071
|
+
const narrowed = earlyModalNarrowedAllowlist({ ...input, gateway, nowMs });
|
|
2072
|
+
if (!('refused' in narrowed))
|
|
2073
|
+
return {
|
|
2074
|
+
allowlist: narrowed.allowlist,
|
|
2075
|
+
narrowRefusal: null,
|
|
2076
|
+
deploymentRefusal: null,
|
|
2077
|
+
};
|
|
2078
|
+
return {
|
|
2079
|
+
allowlist: input.outboundCidrAllowlist,
|
|
2080
|
+
narrowRefusal: narrowed.refused,
|
|
2081
|
+
deploymentRefusal: earlySandboxEgressRefusal({
|
|
2082
|
+
outboundCidrAllowlist: input.outboundCidrAllowlist,
|
|
2083
|
+
gatewayHosts: earlySandboxGatewayHosts(),
|
|
2084
|
+
gateway: gateway.state(),
|
|
2085
|
+
nowMs,
|
|
2086
|
+
}),
|
|
2087
|
+
};
|
|
2088
|
+
}
|
|
2089
|
+
|
|
2090
|
+
/**
|
|
2091
|
+
* The early create's allowlist under EN, or a throw when neither the
|
|
2092
|
+
* narrowed nor the deployment list passes the gate now (the gate passed a
|
|
2093
|
+
* moment earlier, so this is a state change, never a policy outcome).
|
|
2094
|
+
*/
|
|
2095
|
+
function earlyModalEarlyAllowlistOrThrow(
|
|
2096
|
+
outboundCidrAllowlist: string[] | null,
|
|
2097
|
+
): string[] | null {
|
|
2098
|
+
const early = earlyModalEarlyAllowlist({
|
|
2099
|
+
narrow: true,
|
|
2100
|
+
outboundCidrAllowlist,
|
|
2101
|
+
});
|
|
2102
|
+
if (early.deploymentRefusal)
|
|
2103
|
+
throw new Error(
|
|
2104
|
+
`EARLY_MODAL_SANDBOX_SCOPE_CHANGED: narrowing is refused (${early.narrowRefusal}) and so is the deployment list (${early.deploymentRefusal}); no early sandbox was created.`,
|
|
2105
|
+
);
|
|
2106
|
+
return early.allowlist;
|
|
2107
|
+
}
|
|
2108
|
+
|
|
2109
|
+
/** EN's narrowed list from this process's current gateway resolution. */
|
|
2110
|
+
export function earlyModalNarrowedAllowlist(input: {
|
|
2111
|
+
outboundCidrAllowlist: readonly string[] | null;
|
|
2112
|
+
gateway?: EarlySandboxGatewayAddressWatch;
|
|
2113
|
+
nowMs?: number;
|
|
2114
|
+
}): EarlySandboxNarrowedAllowlist {
|
|
2115
|
+
const gateway = input.gateway ?? earlyModalGatewayAddresses;
|
|
2116
|
+
gateway.start();
|
|
2117
|
+
return narrowEarlySandboxAllowlist({
|
|
2118
|
+
outboundCidrAllowlist: input.outboundCidrAllowlist,
|
|
2119
|
+
prefix: EARLY_SANDBOX_NARROW_PREFIX,
|
|
2120
|
+
minStableMs: EARLY_SANDBOX_NARROW_MIN_STABLE_MS,
|
|
2121
|
+
gatewayHosts: earlySandboxGatewayHosts(),
|
|
2122
|
+
gateway: gateway.state(),
|
|
2123
|
+
nowMs: input.nowMs ?? Date.now(),
|
|
2124
|
+
});
|
|
2125
|
+
}
|
|
2126
|
+
|
|
2127
|
+
/**
|
|
2128
|
+
* The egress parameters a launch adopts an early sandbox under. Without EN,
|
|
2129
|
+
* the launch's own create parameters (today). With EN, the list this launch
|
|
2130
|
+
* derives now: equal to the early create's only when the gateways have not
|
|
2131
|
+
* changed since, so a changed address set is an egress-key miss and the
|
|
2132
|
+
* launch creates its own sandbox with `sandboxParams`. A launch with a CSV
|
|
2133
|
+
* source URL (fetched inside the sandbox, from a host that is not a gateway)
|
|
2134
|
+
* or a sidecar never expects a narrowed sandbox. The fallback create always
|
|
2135
|
+
* uses `sandboxParams`; this only chooses what adoption expects.
|
|
2136
|
+
*/
|
|
2137
|
+
export function earlyModalAdoptionEgress(input: {
|
|
2138
|
+
narrowWanted: boolean;
|
|
2139
|
+
supervisorSidecar: boolean;
|
|
2140
|
+
csvSourceUrl: string | null | undefined;
|
|
2141
|
+
sandboxParams: Pick<ModalSandboxCreateParams, 'outboundCidrAllowlist'>;
|
|
2142
|
+
narrow: (
|
|
2143
|
+
allowlist: readonly string[] | null,
|
|
2144
|
+
) => EarlySandboxNarrowedAllowlist;
|
|
2145
|
+
}): {
|
|
2146
|
+
params: Pick<ModalSandboxCreateParams, 'outboundCidrAllowlist'>;
|
|
2147
|
+
narrowed: boolean;
|
|
2148
|
+
refusal: EarlySandboxNarrowRefusal | 'csv_source_url' | 'sidecar' | null;
|
|
2149
|
+
} {
|
|
2150
|
+
if (!input.narrowWanted)
|
|
2151
|
+
return { params: input.sandboxParams, narrowed: false, refusal: null };
|
|
2152
|
+
const refusal = input.supervisorSidecar
|
|
2153
|
+
? ('sidecar' as const)
|
|
2154
|
+
: input.csvSourceUrl?.trim()
|
|
2155
|
+
? ('csv_source_url' as const)
|
|
2156
|
+
: null;
|
|
2157
|
+
if (refusal) return { params: input.sandboxParams, narrowed: false, refusal };
|
|
2158
|
+
const narrowed = input.narrow(
|
|
2159
|
+
input.sandboxParams.outboundCidrAllowlist ?? null,
|
|
2160
|
+
);
|
|
2161
|
+
if ('refused' in narrowed)
|
|
2162
|
+
return {
|
|
2163
|
+
params: input.sandboxParams,
|
|
2164
|
+
narrowed: false,
|
|
2165
|
+
refusal: narrowed.refused,
|
|
2166
|
+
};
|
|
2167
|
+
return {
|
|
2168
|
+
params: { outboundCidrAllowlist: narrowed.allowlist },
|
|
2169
|
+
narrowed: true,
|
|
2170
|
+
refusal: null,
|
|
2171
|
+
};
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2008
2174
|
/**
|
|
2009
2175
|
* The fail-closed egress gate for an early sandbox without the sidecar (see
|
|
2010
2176
|
* `../early-sandbox-egress.ts`): refuse, loudly, unless the early create's
|
|
2011
2177
|
* allowlist is non-empty, no entry is wider than /24, and every resolved IPv4
|
|
2012
2178
|
* address of both gateways is covered. A refusal starts nothing; the launch
|
|
2013
|
-
* creates its own sandbox, as today.
|
|
2179
|
+
* creates its own sandbox, as today. With `narrow` (EN), the list checked is
|
|
2180
|
+
* the narrowed one, and a narrowing refusal is the gate's refusal.
|
|
2014
2181
|
*/
|
|
2015
2182
|
export function earlyModalSandboxEgressRefusal(
|
|
2016
2183
|
input: {
|
|
@@ -2018,8 +2185,9 @@ export function earlyModalSandboxEgressRefusal(
|
|
|
2018
2185
|
gateway?: EarlySandboxGatewayAddressWatch;
|
|
2019
2186
|
readAllowlist?: () => ModalOutboundCidrAllowlistRead;
|
|
2020
2187
|
nowMs?: number;
|
|
2188
|
+
narrow?: boolean;
|
|
2021
2189
|
} = {},
|
|
2022
|
-
):
|
|
2190
|
+
): EarlySandboxNarrowRefusal | null {
|
|
2023
2191
|
const gateway = input.gateway ?? earlyModalGatewayAddresses;
|
|
2024
2192
|
gateway.start();
|
|
2025
2193
|
const read = (
|
|
@@ -2029,13 +2197,38 @@ export function earlyModalSandboxEgressRefusal(
|
|
|
2029
2197
|
runtimeSchedulerSchema: input.runtimeSchedulerSchema ?? null,
|
|
2030
2198
|
}))
|
|
2031
2199
|
)();
|
|
2200
|
+
const nowMs = input.nowMs ?? Date.now();
|
|
2201
|
+
const early = earlyModalEarlyAllowlist({
|
|
2202
|
+
narrow: Boolean(input.narrow) && !read.error,
|
|
2203
|
+
outboundCidrAllowlist: read.allowlist,
|
|
2204
|
+
gateway,
|
|
2205
|
+
nowMs,
|
|
2206
|
+
});
|
|
2207
|
+
const allowlist = early.allowlist;
|
|
2208
|
+
if (early.narrowRefusal) {
|
|
2209
|
+
// Narrowing refused: the deployment list decides, exactly as without
|
|
2210
|
+
// EN. Only when it is refused too is the narrowing reason the refusal.
|
|
2211
|
+
const plain = early.deploymentRefusal;
|
|
2212
|
+
if (plain === null) return null;
|
|
2213
|
+
console.error(
|
|
2214
|
+
JSON.stringify({
|
|
2215
|
+
event: `${EARLY_MODAL_LOG_SCOPE}.egress_refused`,
|
|
2216
|
+
reason: early.narrowRefusal,
|
|
2217
|
+
narrowed: true,
|
|
2218
|
+
deploymentRefusal: plain,
|
|
2219
|
+
allowlistEntries: read.allowlist?.length ?? null,
|
|
2220
|
+
gatewayStatus: gateway.state().status,
|
|
2221
|
+
}),
|
|
2222
|
+
);
|
|
2223
|
+
return early.narrowRefusal;
|
|
2224
|
+
}
|
|
2032
2225
|
return assertEarlySandboxEgress({
|
|
2033
2226
|
logScope: EARLY_MODAL_LOG_SCOPE,
|
|
2034
|
-
outboundCidrAllowlist:
|
|
2227
|
+
outboundCidrAllowlist: allowlist,
|
|
2035
2228
|
allowlistError: read.error,
|
|
2036
2229
|
gatewayHosts: earlySandboxGatewayHosts(),
|
|
2037
2230
|
gateway: gateway.state(),
|
|
2038
|
-
nowMs
|
|
2231
|
+
nowMs,
|
|
2039
2232
|
});
|
|
2040
2233
|
}
|
|
2041
2234
|
|
|
@@ -2046,7 +2239,7 @@ export function earlyModalSandboxEgressRefusal(
|
|
|
2046
2239
|
*/
|
|
2047
2240
|
export function earlyModalSandboxStartUnavailable(
|
|
2048
2241
|
input: Parameters<typeof earlyModalSandboxEgressRefusal>[0] = {},
|
|
2049
|
-
):
|
|
2242
|
+
): EarlySandboxNarrowRefusal | 'environment_unknown' | null {
|
|
2050
2243
|
try {
|
|
2051
2244
|
earlySandboxEnvironment();
|
|
2052
2245
|
} catch (error) {
|
|
@@ -2098,12 +2291,25 @@ export const modalEarlySandboxAdapter: EarlySandboxAdapter<ModalSandbox> = {
|
|
|
2098
2291
|
provider: 'modal',
|
|
2099
2292
|
logScope: EARLY_MODAL_LOG_SCOPE,
|
|
2100
2293
|
registry: earlyModalSandboxes,
|
|
2101
|
-
startUnavailable: () =>
|
|
2294
|
+
startUnavailable: (input) =>
|
|
2295
|
+
earlyModalSandboxStartUnavailable({
|
|
2296
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
2297
|
+
narrow: earlyModalEgressNarrowWanted(input.experimentSwitchOverrides),
|
|
2298
|
+
}),
|
|
2102
2299
|
scope: (input) => {
|
|
2103
2300
|
const read = readModalOutboundCidrAllowlist({
|
|
2104
2301
|
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
2105
2302
|
});
|
|
2106
2303
|
if (read.error) throw new Error(read.error);
|
|
2304
|
+
if (earlyModalEgressNarrowWanted(input.experimentSwitchOverrides)) {
|
|
2305
|
+
// Called synchronously right after the gate, so the same gateway state
|
|
2306
|
+
// and the same choice (narrowed, or the deployment list).
|
|
2307
|
+
// No list means no allowlist key, exactly as modalSandboxNetworkParams.
|
|
2308
|
+
return modalSandboxCreateScope({
|
|
2309
|
+
outboundCidrAllowlist:
|
|
2310
|
+
earlyModalEarlyAllowlistOrThrow(read.allowlist) ?? undefined,
|
|
2311
|
+
});
|
|
2312
|
+
}
|
|
2107
2313
|
return modalSandboxCreateScope(
|
|
2108
2314
|
modalSandboxNetworkParams({
|
|
2109
2315
|
supervisorSidecar: DURABLE_RUNS_ROLLOUT.modalSupervisorSidecar,
|
|
@@ -2429,6 +2635,28 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2429
2635
|
const createParams = { ...sandboxParams, tags: createTags };
|
|
2430
2636
|
const createSandbox = () =>
|
|
2431
2637
|
modalConfig.client.sandboxes.create(app, image, createParams);
|
|
2638
|
+
const adoptionEgress = earlyAdoptionEnvironment
|
|
2639
|
+
? earlyModalAdoptionEgress({
|
|
2640
|
+
narrowWanted: earlyModalEgressNarrowWanted(
|
|
2641
|
+
config.context.experimentSwitchOverrides,
|
|
2642
|
+
),
|
|
2643
|
+
supervisorSidecar: supervisorPlan !== null,
|
|
2644
|
+
csvSourceUrl: config.csvSourceUrl,
|
|
2645
|
+
sandboxParams,
|
|
2646
|
+
narrow: (allowlist) =>
|
|
2647
|
+
earlyModalNarrowedAllowlist({
|
|
2648
|
+
outboundCidrAllowlist: allowlist,
|
|
2649
|
+
}),
|
|
2650
|
+
})
|
|
2651
|
+
: null;
|
|
2652
|
+
if (
|
|
2653
|
+
adoptionEgress &&
|
|
2654
|
+
(adoptionEgress.narrowed || adoptionEgress.refusal)
|
|
2655
|
+
)
|
|
2656
|
+
emitModalStage(config.context, 'early:egress', {
|
|
2657
|
+
narrowed: adoptionEgress.narrowed,
|
|
2658
|
+
reason: adoptionEgress.refusal,
|
|
2659
|
+
});
|
|
2432
2660
|
sandbox = await awaitModalSandboxCreate({
|
|
2433
2661
|
create:
|
|
2434
2662
|
earlyAdoptionEnvironment && config.context.workflowId
|
|
@@ -2437,9 +2665,12 @@ export const modalPlayRunnerBackend: PlayRunnerBackend = {
|
|
|
2437
2665
|
modalAppId: app.appId,
|
|
2438
2666
|
workflowId: config.context.workflowId,
|
|
2439
2667
|
// The early create's scope builder, so the two cannot drift.
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2668
|
+
// EN changes only the egress adoption expects, never the
|
|
2669
|
+
// fallback create's.
|
|
2670
|
+
scope: modalSandboxCreateScope(
|
|
2671
|
+
adoptionEgress?.params ?? sandboxParams,
|
|
2672
|
+
{ environment: earlyAdoptionEnvironment },
|
|
2673
|
+
),
|
|
2443
2674
|
expectedLimitsKey: modalSandboxLimitsKey(sandboxParams),
|
|
2444
2675
|
createTags,
|
|
2445
2676
|
context: config.context,
|