deepline 0.3.552 → 0.3.554
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 +107 -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 +118 -8
- 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 +8 -1
- 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 +9 -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-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/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 +168 -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 +444 -39
- 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-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 +72 -0
- 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 +254 -44
- 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 +259 -52
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +13 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +30 -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-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/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-KVSBJZOX.mjs → auth-HJUNW7T2.mjs} +8 -7
- package/dist/cli/auth-SP6SKZJZ.js +44 -0
- package/dist/cli/{billing-FQREA7UA.js → billing-4TSA5HEC.js} +297 -161
- package/dist/cli/{billing-54RHFEBI.mjs → billing-SJYRJAQ2.mjs} +197 -61
- package/dist/cli/{chunk-4MK42735.js → chunk-2HMN5H54.js} +215 -130
- package/dist/cli/{chunk-UBKA33KY.mjs → chunk-2MGZAI54.mjs} +17 -0
- package/dist/cli/{chunk-EOPEYCY7.mjs → chunk-2ORPFQUA.mjs} +18 -18
- package/dist/cli/{chunk-RQZQVFCJ.js → chunk-2OVHNHCF.js} +2 -2
- package/dist/cli/{chunk-QX7LFGJR.mjs → chunk-33WRQSQ2.mjs} +1874 -91
- package/dist/cli/{chunk-UPMRIVZB.js → chunk-3IKGZ4CG.js} +74 -13
- package/dist/cli/{chunk-EUPVF4SU.mjs → chunk-3Z4VFCXO.mjs} +8 -8
- package/dist/cli/{chunk-GKYAYLRI.js → chunk-4DOFGIEJ.js} +27 -31
- package/dist/cli/{chunk-4TALT2M3.mjs → chunk-52Q5KETX.mjs} +69 -3
- package/dist/cli/{chunk-RBEUVDZF.js → chunk-5CYZHOKI.js} +249 -107
- package/dist/cli/{chunk-LX35AXTN.mjs → chunk-5TYLSS4Q.mjs} +6 -6
- package/dist/cli/{chunk-IYSTRCLX.mjs → chunk-62AUAWQV.mjs} +4 -4
- package/dist/cli/{chunk-ZIAXDBXX.mjs → chunk-62HWJXST.mjs} +17 -21
- package/dist/cli/{chunk-QY3ZNU6Z.mjs → chunk-6EXOAT6T.mjs} +2 -2
- package/dist/cli/{chunk-EITMD3A5.js → chunk-6VLFQZK6.js} +8 -8
- package/dist/cli/{chunk-ADRC5I3R.js → chunk-7OWI736E.js} +30 -30
- package/dist/cli/{chunk-NURW5XH4.mjs → chunk-ASB47RXJ.mjs} +1 -1
- package/dist/cli/{chunk-PTVD2GVQ.mjs → chunk-B6HO2XWH.mjs} +13 -13
- package/dist/cli/{chunk-YJHE3O5M.mjs → chunk-BOZAP2EM.mjs} +141 -56
- package/dist/cli/chunk-BVXIGOBZ.js +32 -0
- package/dist/cli/{chunk-XDVT3GOM.js → chunk-CFJFUVX2.js} +18 -1
- package/dist/cli/{chunk-WE5HES3H.mjs → chunk-D6Z6POKE.mjs} +151 -43
- package/dist/cli/{chunk-AZQ264ID.mjs → chunk-DSKSFFK2.mjs} +1 -1
- package/dist/cli/{chunk-SHLFOPD6.js → chunk-DUBXUAAO.js} +5 -5
- package/dist/cli/{chunk-V436Z54K.js → chunk-E2G2DNAB.js} +3 -1
- package/dist/cli/{chunk-HO3XK3R7.js → chunk-E74KGKFZ.js} +8 -8
- package/dist/cli/{chunk-77AAAGVB.js → chunk-ECHKAC7M.js} +2 -2
- package/dist/cli/{chunk-KWSH5T7K.js → chunk-EN5NHCCQ.js} +21 -21
- package/dist/cli/{chunk-6RZOWL2V.mjs → chunk-F7CMRKSK.mjs} +1 -1
- package/dist/cli/{chunk-JWUAX6OP.js → chunk-FBAFX43W.js} +11 -11
- package/dist/cli/{chunk-AQWQ2BFX.mjs → chunk-FXQ3JKE3.mjs} +1 -1
- package/dist/cli/{chunk-QPKH23EC.mjs → chunk-GA2M3G3Y.mjs} +5 -5
- package/dist/cli/{chunk-G4O75EXF.js → chunk-GHT2NDL7.js} +18 -18
- package/dist/cli/{chunk-MF2GHZDO.js → chunk-GRZENGNE.js} +2 -2
- package/dist/cli/{chunk-4UUR4TCH.js → chunk-IVZKMJUK.js} +1875 -92
- package/dist/cli/{chunk-FTJLJCE5.mjs → chunk-KVBQY4ST.mjs} +3 -3
- package/dist/cli/{chunk-S5S355UY.mjs → chunk-KZHBDMGF.mjs} +12 -12
- package/dist/cli/{chunk-BBTKAASQ.js → chunk-LFQJW4S2.js} +42 -1
- package/dist/cli/{chunk-6ZORHRKB.mjs → chunk-LRZGS6RZ.mjs} +2 -0
- package/dist/cli/{chunk-2WFPHBR4.js → chunk-LY5MMXFF.js} +47 -29
- package/dist/cli/{chunk-BAIST2BR.js → chunk-M7STM3MZ.js} +36 -36
- package/dist/cli/{chunk-SL6MYJYM.js → chunk-MJTVX4QK.js} +35 -35
- package/dist/cli/{chunk-45PVGZST.js → chunk-OPTV7D2V.js} +508 -361
- package/dist/cli/{chunk-PFO3ISXA.js → chunk-OVEYWO4H.js} +174 -129
- package/dist/cli/{chunk-BGBJV26E.mjs → chunk-PC2FTUCP.mjs} +4 -4
- package/dist/cli/{chunk-WLN3SUIA.js → chunk-PQQMPUCZ.js} +3 -3
- package/dist/cli/{chunk-HYC4MKGK.mjs → chunk-Q7ACILL2.mjs} +5 -5
- package/dist/cli/{chunk-CBV7AKWM.js → chunk-R6DZ6NQ2.js} +5 -5
- package/dist/cli/{chunk-57VZVF5D.mjs → chunk-RBBTCYQB.mjs} +3 -3
- package/dist/cli/{chunk-F2LH7TGF.js → chunk-RTHMGSZX.js} +21 -21
- package/dist/cli/{chunk-YLTMXJFC.mjs → chunk-S6W6SJ6E.mjs} +158 -16
- package/dist/cli/chunk-STXDSVQZ.mjs +32 -0
- package/dist/cli/{chunk-WEHCBH5R.mjs → chunk-TGUQET3O.mjs} +67 -6
- package/dist/cli/{chunk-IHRKLXZN.js → chunk-TJ6HLN56.js} +5 -5
- package/dist/cli/{chunk-3FD5EQ62.js → chunk-TOO3YM5N.js} +6 -7
- package/dist/cli/{chunk-QILKGXYF.mjs → chunk-UBBYHB2B.mjs} +2 -2
- package/dist/cli/{chunk-6PRW5UBA.mjs → chunk-UC4BDZKI.mjs} +299 -69
- package/dist/cli/{chunk-634ZDA3F.js → chunk-UNNOZKRT.js} +1 -1
- package/dist/cli/{chunk-IDVVIXPJ.js → chunk-UOT7HPBH.js} +41 -41
- package/dist/cli/{chunk-6YCA5NKJ.js → chunk-UYCZFQYQ.js} +12 -12
- package/dist/cli/{chunk-7IKQKKNX.js → chunk-VIUUTEHY.js} +90 -24
- package/dist/cli/{chunk-Z5TSLLOW.mjs → chunk-VLO5NFH2.mjs} +63 -18
- package/dist/cli/{chunk-U7QRMBIY.mjs → chunk-VQ75KX7G.mjs} +5 -5
- package/dist/cli/{chunk-4NQF6KJ3.js → chunk-VV4XGZ24.js} +13 -13
- package/dist/cli/{chunk-FSIVF2SI.mjs → chunk-VZGLIK5U.mjs} +1 -1
- package/dist/cli/{chunk-S46HWQKO.js → chunk-W6CZDTIR.js} +69 -69
- package/dist/cli/{chunk-XVB7V4N7.js → chunk-WL7P32PI.js} +161 -53
- package/dist/cli/{chunk-DJ2JDK4O.mjs → chunk-XD3MFTHA.mjs} +1 -1
- package/dist/cli/{chunk-GGGAEVCX.mjs → chunk-XFZX6FNM.mjs} +40 -22
- package/dist/cli/{chunk-AWJPDPMA.mjs → chunk-XU6QNM4D.mjs} +1 -1
- package/dist/cli/{chunk-QAORXEY3.mjs → chunk-YCOGPOUX.mjs} +6 -7
- package/dist/cli/{chunk-VQALXEXO.js → chunk-YQKCH4R7.js} +348 -118
- package/dist/cli/{chunk-6O5HOODW.mjs → chunk-YY55NYAH.mjs} +207 -60
- package/dist/cli/{chunk-JL2OTMSG.mjs → chunk-Z3A2S3QM.mjs} +41 -0
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/{concurrent-runs-help-Q4KPAUJX.mjs → concurrent-runs-help-O3Q5IPLF.mjs} +9 -8
- package/dist/cli/concurrent-runs-help-ZFRZWX5V.js +22 -0
- package/dist/cli/{csv-F5VAGX4K.js → csv-4ZQ2RATI.js} +16 -15
- package/dist/cli/{csv-2PTVDNO6.mjs → csv-Y3BFPEM6.mjs} +7 -6
- package/dist/cli/{db-IEDXAUF7.mjs → db-3JYY4JNN.mjs} +17 -17
- package/dist/cli/{db-Z3OIUFMM.js → db-VEIFS4M7.js} +45 -45
- package/dist/cli/describe-EVJ4MFVU.mjs +50 -0
- package/dist/cli/describe-FG625QPF.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 +7 -7
- package/dist/cli/describe-core.mjs +6 -6
- package/dist/cli/{executions-H6H5655J.js → executions-HPZXOOVX.js} +12 -12
- package/dist/cli/{executions-R3LP74QN.mjs → executions-PCXZKEHM.mjs} +10 -10
- package/dist/cli/{feedback-WL3MRVT5.mjs → feedback-Y6VKZNY6.mjs} +9 -8
- package/dist/cli/{feedback-VFOUR66B.js → feedback-ZKFHFVL6.js} +17 -16
- package/dist/cli/git-RUBMALLH.js +26 -0
- package/dist/cli/{git-YX2J4GCI.mjs → git-UMPR2QYC.mjs} +8 -7
- package/dist/cli/index.js +170 -158
- package/dist/cli/index.mjs +60 -48
- package/dist/cli/{integrations-E2JZYKHS.js → integrations-3GQCTRTF.js} +23 -27
- package/dist/cli/{integrations-5ZK5KLVP.mjs → integrations-V3TM6XAB.mjs} +15 -19
- package/dist/cli/{legacy-noops-SMN3GSXY.mjs → legacy-noops-JZBUD7ZE.mjs} +9 -8
- package/dist/cli/{legacy-noops-3VW4IJTH.js → legacy-noops-VYCO7NGW.js} +12 -11
- package/dist/cli/{mcp-UQV2K4EW.js → mcp-4OIWTCE6.js} +121 -48
- package/dist/cli/{mcp-V6MGCYAG.mjs → mcp-PH4KZ76P.mjs} +100 -27
- package/dist/cli/{monitors-R3BBDCRC.js → monitors-E2A6VPBY.js} +221 -186
- package/dist/cli/{monitors-GGKS5W6M.mjs → monitors-SSMGIDGX.mjs} +58 -23
- package/dist/cli/org-SFDKSK5D.mjs +2289 -0
- package/dist/cli/org-WUDZGWBT.js +2289 -0
- package/dist/cli/outcomes-QT7LQBPK.mjs +2865 -0
- package/dist/cli/outcomes-Y7SZTLSL.js +2865 -0
- package/dist/cli/{play-MDWPR4XG.mjs → play-EK7KSFPL.mjs} +376 -106
- package/dist/cli/{play-2MVO27VO.js → play-GDNHCRRR.js} +1150 -880
- package/dist/cli/{providers-AKDYFZJZ.mjs → providers-FVZLRXAU.mjs} +10 -10
- package/dist/cli/{providers-2AACRUZH.js → providers-ZKOSECLV.js} +13 -13
- package/dist/cli/{quickstart-H6IV3PV3.js → quickstart-KSDKIXYD.js} +9 -8
- package/dist/cli/{quickstart-QDGRJFZY.mjs → quickstart-UJZ6PIQV.mjs} +7 -6
- package/dist/cli/{run-RTSQNGRD.mjs → run-E7MZ7P35.mjs} +35 -33
- package/dist/cli/{run-2634REDK.js → run-PD2BBG6S.js} +55 -53
- 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-TKSPTPHA.js +32 -0
- package/dist/cli/{search-6AOJ4XPP.mjs → search-VTFUFTOY.mjs} +11 -11
- package/dist/cli/{search-output-S5ODBL5E.js → search-output-G2AGDCOY.js} +13 -12
- package/dist/cli/{search-output-6ADMTOU5.mjs → search-output-PFVXQCWA.mjs} +10 -9
- package/dist/cli/{secrets-TFIFBFB3.mjs → secrets-7CIMEMX7.mjs} +11 -11
- package/dist/cli/{secrets-LHCIIHMT.js → secrets-BCOQ4U7U.js} +20 -20
- package/dist/cli/sessions-4CO556VD.js +23 -0
- package/dist/cli/{sessions-WHBVUHVW.mjs → sessions-IUCQZEF7.mjs} +9 -8
- package/dist/cli/{settings-EBONWL5C.mjs → settings-KZN62UQK.mjs} +16 -16
- package/dist/cli/{settings-CP4FVK2W.js → settings-REL4736M.js} +89 -89
- package/dist/cli/{setup-I5AZE3IU.mjs → setup-2P7OG3OU.mjs} +22 -24
- package/dist/cli/{setup-LFGHTNLQ.js → setup-2XIVBBCS.js} +62 -64
- package/dist/cli/skills-JYT5DEY6.js +37 -0
- package/dist/cli/{skills-W76AO5XE.mjs → skills-VIGNDJKI.mjs} +10 -9
- package/dist/cli/tools-NTVUQ2TG.js +57 -0
- package/dist/cli/{tools-7IJHGF6W.mjs → tools-W3QT5EJY.mjs} +24 -24
- package/dist/cli/{update-GFOPZTHY.mjs → update-GZVBVMY3.mjs} +14 -11
- package/dist/cli/update-TWJZPUZM.js +37 -0
- package/dist/cli/{views-D4NX4SBG.mjs → views-BOGEH424.mjs} +47 -49
- package/dist/cli/{views-BPL2TQJ4.js → views-TOLJNLSV.js} +62 -64
- package/dist/cli/{workflow-ZYNAUCKC.js → workflow-ENWFRK5M.js} +23 -23
- package/dist/cli/{workflow-YXP42FUI.mjs → workflow-VDG2FDQV.mjs} +13 -13
- package/dist/{client-CyXGrO4D.d.mts → client-B8f7RNF8.d.mts} +1 -1
- package/dist/{client-Bf3IpUKN.d.ts → client-C5TgXmJQ.d.ts} +1 -1
- package/dist/{client-core-BxsLnXlm.d.mts → client-core-SLLGBTht.d.mts} +268 -23
- package/dist/{client-core-BWd0lX0Z.d.ts → client-core-p0sOxnkl.d.ts} +268 -23
- package/dist/{compiler-manifest-BqwVrOri.d.ts → compiler-manifest-D_zZEh9Q.d.mts} +70 -5
- package/dist/{compiler-manifest-BqwVrOri.d.mts → 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 +163 -144
- 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-MMNVWATX.js +0 -43
- package/dist/cli/chunk-AID3OYVJ.js +0 -8
- package/dist/cli/chunk-OVDNJAJN.mjs +0 -8
- package/dist/cli/concurrent-runs-help-FQAIHKKC.js +0 -21
- package/dist/cli/describe-QDANCTS3.mjs +0 -50
- package/dist/cli/describe-VUTT5ZKU.js +0 -50
- package/dist/cli/git-ETB3GH3K.js +0 -25
- package/dist/cli/org-GRYVMNSW.js +0 -1282
- package/dist/cli/org-Z37NGJV4.mjs +0 -1282
- package/dist/cli/run-identity-G257GQED.js +0 -25
- package/dist/cli/search-VTW2YNBS.js +0 -32
- package/dist/cli/sessions-CJ4FJ2WB.js +0 -22
- package/dist/cli/skills-R7EBXREW.js +0 -36
- package/dist/cli/tools-V7U2BDXM.js +0 -57
- package/dist/cli/update-4COPZETK.js +0 -34
|
@@ -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,
|
package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts
CHANGED
|
@@ -111,9 +111,8 @@ function parseIpv4Cidr(entry: string): Ipv4Cidr | null {
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
function cidrCovers(cidr: Ipv4Cidr, address: number): boolean {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return ((cidr.network & mask) >>> 0) === ((address & mask) >>> 0);
|
|
114
|
+
const mask = cidrMask(cidr.prefix);
|
|
115
|
+
return (cidr.network & mask) >>> 0 === (address & mask) >>> 0;
|
|
117
116
|
}
|
|
118
117
|
|
|
119
118
|
/** Gateway hostnames (or literal IPv4s) whose addresses the gate checks. */
|
|
@@ -147,6 +146,12 @@ export type EarlySandboxGatewayAddresses =
|
|
|
147
146
|
/** Every IPv4 address of every host. */
|
|
148
147
|
addresses: readonly string[];
|
|
149
148
|
atMs: number;
|
|
149
|
+
/**
|
|
150
|
+
* When this exact address set was first resolved, carried across
|
|
151
|
+
* refreshes that return the same set; a failed refresh resets it.
|
|
152
|
+
* Absent on states built elsewhere, which narrowing then refuses.
|
|
153
|
+
*/
|
|
154
|
+
stableSinceMs?: number;
|
|
150
155
|
};
|
|
151
156
|
|
|
152
157
|
/**
|
|
@@ -170,26 +175,157 @@ export function earlySandboxEgressRefusal(input: {
|
|
|
170
175
|
return 'egress_allowlist_too_wide';
|
|
171
176
|
cidrs.push(cidr);
|
|
172
177
|
}
|
|
178
|
+
const fresh = freshGatewayAddresses(input);
|
|
179
|
+
if ('refused' in fresh) return fresh.refused;
|
|
180
|
+
for (const value of fresh.addresses) {
|
|
181
|
+
if (!cidrs.some((cidr) => cidrCovers(cidr, value)))
|
|
182
|
+
return 'egress_gateway_uncovered';
|
|
183
|
+
}
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* The gateways' current IPv4 addresses as integers, or why they cannot be
|
|
189
|
+
* trusted: unconfigured, not yet (or not for these hosts) resolved, failed,
|
|
190
|
+
* stale, empty or not IPv4.
|
|
191
|
+
*/
|
|
192
|
+
function freshGatewayAddresses(input: {
|
|
193
|
+
gatewayHosts: readonly string[] | null;
|
|
194
|
+
gateway: EarlySandboxGatewayAddresses;
|
|
195
|
+
nowMs: number;
|
|
196
|
+
}): { addresses: number[] } | { refused: EarlySandboxEgressRefusal } {
|
|
173
197
|
if (!input.gatewayHosts || input.gatewayHosts.length === 0)
|
|
174
|
-
return 'egress_gateway_unconfigured';
|
|
198
|
+
return { refused: 'egress_gateway_unconfigured' };
|
|
175
199
|
const gateway = input.gateway;
|
|
176
|
-
if (gateway.status === 'pending')
|
|
177
|
-
|
|
200
|
+
if (gateway.status === 'pending')
|
|
201
|
+
return { refused: 'egress_gateway_dns_pending' };
|
|
202
|
+
if (gateway.status === 'failed')
|
|
203
|
+
return { refused: 'egress_gateway_dns_failed' };
|
|
178
204
|
// Resolved for other hosts (the env changed): not yet resolved for these.
|
|
179
205
|
if (
|
|
180
206
|
gateway.hosts.length !== input.gatewayHosts.length ||
|
|
181
207
|
gateway.hosts.some((host, index) => host !== input.gatewayHosts![index])
|
|
182
208
|
)
|
|
183
|
-
return 'egress_gateway_dns_pending';
|
|
209
|
+
return { refused: 'egress_gateway_dns_pending' };
|
|
184
210
|
if (input.nowMs - gateway.atMs > EARLY_SANDBOX_GATEWAY_DNS_MAX_AGE_MS)
|
|
185
|
-
return 'egress_gateway_dns_stale';
|
|
186
|
-
if (gateway.addresses.length === 0)
|
|
211
|
+
return { refused: 'egress_gateway_dns_stale' };
|
|
212
|
+
if (gateway.addresses.length === 0)
|
|
213
|
+
return { refused: 'egress_gateway_dns_failed' };
|
|
214
|
+
const addresses: number[] = [];
|
|
187
215
|
for (const address of gateway.addresses) {
|
|
188
216
|
const value = ipv4ToInt(address);
|
|
189
|
-
if (value === null
|
|
190
|
-
|
|
217
|
+
if (value === null) return { refused: 'egress_gateway_uncovered' };
|
|
218
|
+
addresses.push(value);
|
|
191
219
|
}
|
|
192
|
-
return
|
|
220
|
+
return { addresses };
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function intToIpv4(value: number): string {
|
|
224
|
+
return [24, 16, 8, 0].map((shift) => (value >>> shift) & 255).join('.');
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function cidrMask(prefix: number): number {
|
|
228
|
+
return prefix === 0 ? 0 : (0xffffffff << (32 - prefix)) >>> 0;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Whether every address of `inner` is in `outer`. */
|
|
232
|
+
function cidrContains(outer: Ipv4Cidr, inner: Ipv4Cidr): boolean {
|
|
233
|
+
return (
|
|
234
|
+
inner.prefix >= outer.prefix &&
|
|
235
|
+
(inner.network & cidrMask(outer.prefix)) >>> 0 ===
|
|
236
|
+
(outer.network & cidrMask(outer.prefix)) >>> 0
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
export type EarlySandboxNarrowedAllowlist =
|
|
241
|
+
| { allowlist: string[] }
|
|
242
|
+
| {
|
|
243
|
+
refused:
|
|
244
|
+
| EarlySandboxEgressRefusal
|
|
245
|
+
| 'egress_narrow_prefix_invalid'
|
|
246
|
+
| 'egress_narrow_uncontained'
|
|
247
|
+
| 'egress_narrow_unstable';
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
export type EarlySandboxNarrowRefusal = Extract<
|
|
251
|
+
EarlySandboxNarrowedAllowlist,
|
|
252
|
+
{ refused: unknown }
|
|
253
|
+
>['refused'];
|
|
254
|
+
|
|
255
|
+
/** The narrowed list's prefix: each gateway address alone. */
|
|
256
|
+
export const EARLY_SANDBOX_NARROW_PREFIX = 32;
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* How long the gateways' address set must have stayed the same before a
|
|
260
|
+
* narrowed list is derived from it. An adopted sandbox keeps its list for its
|
|
261
|
+
* whole run, so a set that just changed is the likeliest to change again.
|
|
262
|
+
*/
|
|
263
|
+
export const EARLY_SANDBOX_NARROW_MIN_STABLE_MS = 30 * 60_000;
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* An allowlist for one early sandbox that only shrinks the deployment's:
|
|
267
|
+
* each current gateway address masked to `prefix` (24..32), kept only when
|
|
268
|
+
* some deployment entry fully contains it. Pure, and refuses (fail closed)
|
|
269
|
+
* on anything the gate itself would refuse about the gateways, on an
|
|
270
|
+
* unusable deployment allowlist, and on a derived range the deployment
|
|
271
|
+
* allowlist does not contain. Whatever it returns passes
|
|
272
|
+
* `earlySandboxEgressRefusal` for the same gateway state.
|
|
273
|
+
*
|
|
274
|
+
* With `minStableMs`, it also refuses (`egress_narrow_unstable`) unless the
|
|
275
|
+
* gateway address set has stayed the same for at least that long.
|
|
276
|
+
*
|
|
277
|
+
* Used only behind the per-run EN switch (Modal early create and adoption),
|
|
278
|
+
* which only a per-organization fast_launch@7 pin grants.
|
|
279
|
+
*/
|
|
280
|
+
export function narrowEarlySandboxAllowlist(input: {
|
|
281
|
+
outboundCidrAllowlist: readonly string[] | null | undefined;
|
|
282
|
+
prefix: number;
|
|
283
|
+
gatewayHosts: readonly string[] | null;
|
|
284
|
+
gateway: EarlySandboxGatewayAddresses;
|
|
285
|
+
nowMs: number;
|
|
286
|
+
minStableMs?: number;
|
|
287
|
+
}): EarlySandboxNarrowedAllowlist {
|
|
288
|
+
if (
|
|
289
|
+
!Number.isInteger(input.prefix) ||
|
|
290
|
+
input.prefix < EARLY_SANDBOX_EGRESS_MIN_PREFIX ||
|
|
291
|
+
input.prefix > 32
|
|
292
|
+
)
|
|
293
|
+
return { refused: 'egress_narrow_prefix_invalid' };
|
|
294
|
+
const allowlist = input.outboundCidrAllowlist;
|
|
295
|
+
if (!allowlist) return { refused: 'egress_allowlist_missing' };
|
|
296
|
+
if (allowlist.length === 0) return { refused: 'egress_allowlist_empty' };
|
|
297
|
+
const deployment: Ipv4Cidr[] = [];
|
|
298
|
+
for (const entry of allowlist) {
|
|
299
|
+
const cidr = parseIpv4Cidr(entry);
|
|
300
|
+
if (!cidr) return { refused: 'egress_allowlist_invalid' };
|
|
301
|
+
deployment.push(cidr);
|
|
302
|
+
}
|
|
303
|
+
const fresh = freshGatewayAddresses(input);
|
|
304
|
+
if ('refused' in fresh) return fresh;
|
|
305
|
+
if (input.minStableMs !== undefined) {
|
|
306
|
+
const stableSinceMs =
|
|
307
|
+
input.gateway.status === 'resolved'
|
|
308
|
+
? input.gateway.stableSinceMs
|
|
309
|
+
: undefined;
|
|
310
|
+
if (
|
|
311
|
+
stableSinceMs === undefined ||
|
|
312
|
+
input.nowMs - stableSinceMs < input.minStableMs
|
|
313
|
+
)
|
|
314
|
+
return { refused: 'egress_narrow_unstable' };
|
|
315
|
+
}
|
|
316
|
+
const narrowed = new Set<string>();
|
|
317
|
+
for (const address of fresh.addresses) {
|
|
318
|
+
if (!deployment.some((cidr) => cidrCovers(cidr, address)))
|
|
319
|
+
return { refused: 'egress_gateway_uncovered' };
|
|
320
|
+
const derived = {
|
|
321
|
+
network: (address & cidrMask(input.prefix)) >>> 0,
|
|
322
|
+
prefix: input.prefix,
|
|
323
|
+
};
|
|
324
|
+
if (!deployment.some((cidr) => cidrContains(cidr, derived)))
|
|
325
|
+
return { refused: 'egress_narrow_uncontained' };
|
|
326
|
+
narrowed.add(`${intToIpv4(derived.network)}/${derived.prefix}`);
|
|
327
|
+
}
|
|
328
|
+
return { allowlist: [...narrowed].sort() };
|
|
193
329
|
}
|
|
194
330
|
|
|
195
331
|
export type ResolveIpv4 = (host: string) => Promise<string[]>;
|
|
@@ -266,11 +402,22 @@ export class EarlySandboxGatewayAddressWatch {
|
|
|
266
402
|
throw new Error(`no IPv4 address for ${host}`);
|
|
267
403
|
for (const address of resolved) addresses.add(address);
|
|
268
404
|
}
|
|
405
|
+
const sorted = [...addresses].sort();
|
|
406
|
+
const previous = this.#state;
|
|
407
|
+
const atMs = this.#nowMs();
|
|
408
|
+
const unchanged =
|
|
409
|
+
previous.status === 'resolved' &&
|
|
410
|
+
previous.hosts.join(',') === hosts.join(',') &&
|
|
411
|
+
previous.addresses.join(',') === sorted.join(',');
|
|
269
412
|
this.#state = {
|
|
270
413
|
status: 'resolved',
|
|
271
414
|
hosts,
|
|
272
|
-
addresses:
|
|
273
|
-
atMs
|
|
415
|
+
addresses: sorted,
|
|
416
|
+
atMs,
|
|
417
|
+
stableSinceMs:
|
|
418
|
+
unchanged && previous.stableSinceMs !== undefined
|
|
419
|
+
? previous.stableSinceMs
|
|
420
|
+
: atMs,
|
|
274
421
|
};
|
|
275
422
|
} catch (error) {
|
|
276
423
|
this.#state = {
|
|
@@ -213,10 +213,21 @@ export class EarlySandboxRegistry<
|
|
|
213
213
|
take(key: string): Promise<EarlySandboxEntry<TSandbox> | null> | undefined {
|
|
214
214
|
const entry = this.#entries.get(key);
|
|
215
215
|
this.#entries.delete(key);
|
|
216
|
-
if (entry)
|
|
216
|
+
if (entry) {
|
|
217
|
+
this.#release(entry);
|
|
218
|
+
for (const handler of this.#takeHandlers) handler(key);
|
|
219
|
+
}
|
|
217
220
|
return entry;
|
|
218
221
|
}
|
|
219
222
|
|
|
223
|
+
/** LH: told each key a launch (or a reap) takes from this registry. */
|
|
224
|
+
subscribeTake(handler: (key: string) => void): () => void {
|
|
225
|
+
this.#takeHandlers.add(handler);
|
|
226
|
+
return () => this.#takeHandlers.delete(handler);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
readonly #takeHandlers = new Set<(key: string) => void>();
|
|
230
|
+
|
|
220
231
|
/**
|
|
221
232
|
* The reaper or sweep has settled this sandbox (terminated, or found it
|
|
222
233
|
* adopted by a launch elsewhere): it no longer counts as outstanding. A
|
|
@@ -396,8 +407,10 @@ export type EarlySandboxAdapter<
|
|
|
396
407
|
/**
|
|
397
408
|
* Why this process cannot start an early sandbox on this provider now (a
|
|
398
409
|
* provider precondition), or null. Checked after E2 resolves on; not logged.
|
|
410
|
+
* It gets the hinted run, whose per-run switches may change the egress
|
|
411
|
+
* policy the create would carry (Modal's EN).
|
|
399
412
|
*/
|
|
400
|
-
startUnavailable(): string | null;
|
|
413
|
+
startUnavailable(input: EarlySandboxStartRequest): string | null;
|
|
401
414
|
/**
|
|
402
415
|
* The environment and egress policy this process's early create would
|
|
403
416
|
* carry; part of the key. Called only after `startUnavailable` is null.
|
|
@@ -437,7 +450,7 @@ export function startEarlySandbox<TSandbox extends EarlySandboxHandle>(
|
|
|
437
450
|
input.experimentSwitchOverrides,
|
|
438
451
|
EARLY_SANDBOX_START,
|
|
439
452
|
) ||
|
|
440
|
-
adapter.startUnavailable() !== null
|
|
453
|
+
adapter.startUnavailable(input) !== null
|
|
441
454
|
)
|
|
442
455
|
return false;
|
|
443
456
|
// The key and the adoption check are org-scoped; a hint without an org
|
|
@@ -274,3 +274,40 @@ export async function gunzipRuntimeApiRequestBody(input: {
|
|
|
274
274
|
throw error;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
+
|
|
278
|
+
/** The existing runtime JSON transport, with cancellable compressed-body reads. */
|
|
279
|
+
export async function readRuntimeApiRequestJson(input: {
|
|
280
|
+
request: Request;
|
|
281
|
+
maxBytes: number;
|
|
282
|
+
signal?: AbortSignal;
|
|
283
|
+
}): Promise<unknown> {
|
|
284
|
+
const { request } = input;
|
|
285
|
+
if (!isGzipContentEncoding(request.headers.get('content-encoding')))
|
|
286
|
+
return request.json();
|
|
287
|
+
const signal = input.signal ?? request.signal;
|
|
288
|
+
const reader = request.body?.getReader();
|
|
289
|
+
if (!reader) throw new SyntaxError('Runtime request body is empty.');
|
|
290
|
+
const chunks: Buffer[] = [];
|
|
291
|
+
const onAbort = () => {
|
|
292
|
+
void reader.cancel(signal.reason).catch(() => undefined);
|
|
293
|
+
};
|
|
294
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
295
|
+
try {
|
|
296
|
+
if (signal.aborted) throw signal.reason;
|
|
297
|
+
while (true) {
|
|
298
|
+
const { value, done } = await reader.read();
|
|
299
|
+
if (signal.aborted) throw signal.reason;
|
|
300
|
+
if (done) break;
|
|
301
|
+
chunks.push(Buffer.from(value));
|
|
302
|
+
}
|
|
303
|
+
} finally {
|
|
304
|
+
signal.removeEventListener('abort', onAbort);
|
|
305
|
+
reader.releaseLock();
|
|
306
|
+
}
|
|
307
|
+
const decoded = await gunzipRuntimeApiRequestBody({
|
|
308
|
+
body: Buffer.concat(chunks),
|
|
309
|
+
maxBytes: input.maxBytes,
|
|
310
|
+
});
|
|
311
|
+
if (signal.aborted) throw signal.reason;
|
|
312
|
+
return JSON.parse(decoded.toString('utf8')) as unknown;
|
|
313
|
+
}
|
|
@@ -36,3 +36,12 @@ export function integrationExecutePath(
|
|
|
36
36
|
): string {
|
|
37
37
|
return `/api/v2/integrations/${encodeURIComponent(toolId)}/${suffix}`;
|
|
38
38
|
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One GET for a runner's park-fence startup reads: every named tool's
|
|
42
|
+
* metadata and auth-scope answer, as the two per-tool routes would give them
|
|
43
|
+
* (`startup-read-tool-ids.ts`). Not under `runtime-tools/`, so no tool id can
|
|
44
|
+
* shadow it.
|
|
45
|
+
*/
|
|
46
|
+
export const PLAY_RUNTIME_TOOL_STARTUP_READS_PATH =
|
|
47
|
+
'/api/v2/plays/runtime-tool-startup-reads';
|