deepline 0.3.541 → 0.3.543
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 +106 -2
- package/dist/bundling-sources/sdk/src/index.ts +7 -0
- package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
- package/dist/bundling-sources/sdk/src/types.ts +17 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
- package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
- package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
- package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
- package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
- package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
- package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
- package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
- package/dist/cli/{auth-WJXA7XGM.mjs → auth-ITAELTOA.mjs} +5 -5
- package/dist/cli/auth-S6B5WUU5.js +43 -0
- package/dist/cli/{billing-34IV5DSV.js → billing-33XVFDUJ.js} +101 -101
- package/dist/cli/{billing-SHS4HMWT.mjs → billing-WZ7RVZW4.mjs} +12 -12
- package/dist/cli/{chunk-UKO6POLZ.js → chunk-23D224GI.js} +37 -17
- package/dist/cli/{chunk-DF7ARQRB.mjs → chunk-274WKLSY.mjs} +2 -2
- package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
- package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
- package/dist/cli/{chunk-FVZ5Y5L6.js → chunk-2KTGZKRE.js} +18 -18
- package/dist/cli/{chunk-6TZEDCN7.js → chunk-2LNTKICO.js} +3 -3
- package/dist/cli/{chunk-FYQWTENQ.js → chunk-2NCJQEZH.js} +53 -53
- package/dist/cli/{chunk-CNBPATLI.js → chunk-3JZXU5OB.js} +5 -5
- package/dist/cli/{chunk-323I5KQ5.js → chunk-46BEBZ3M.js} +497 -328
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-XO2SGONT.mjs → chunk-4SKDSSPU.mjs} +2 -2
- package/dist/cli/{chunk-53QZ24DP.mjs → chunk-52YK3EII.mjs} +2 -2
- package/dist/cli/{chunk-S7NKIEHL.js → chunk-5MN3BKNB.js} +16 -16
- package/dist/cli/{chunk-XTR32PMA.mjs → chunk-5VIPTLRX.mjs} +1 -1
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-QI76LGE3.mjs → chunk-6SJZMMD5.mjs} +37 -190
- package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
- package/dist/cli/{chunk-GLINYHY7.mjs → chunk-AACKPOGA.mjs} +1 -1
- package/dist/cli/{chunk-Q66ADD4O.js → chunk-BGAUADV4.js} +41 -41
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-F3TLGM2U.js → chunk-C35NLLSA.js} +5 -5
- package/dist/cli/{chunk-LRPFCB2P.mjs → chunk-D6YAU3CF.mjs} +182 -13
- package/dist/cli/{chunk-FRPJSFNL.mjs → chunk-DH43ECTN.mjs} +7 -3
- package/dist/cli/{chunk-IZXMX65M.js → chunk-DI3GL3T6.js} +316 -469
- package/dist/cli/{chunk-OK4JMVTM.js → chunk-DUGTPVT7.js} +7 -7
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-KIYETQ6K.js → chunk-EHUG6EUT.js} +26 -26
- package/dist/cli/chunk-F6VSQ5LN.js +455 -0
- package/dist/cli/{chunk-JZNKEHXQ.mjs → chunk-FNW2SGPD.mjs} +2 -2
- package/dist/cli/{chunk-M6XIKHBS.js → chunk-GRCFX2EG.js} +4 -4
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-FTKX7OGB.mjs → chunk-HKJ26NRN.mjs} +5 -5
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-POZPEDW7.js → chunk-J2F6F5GL.js} +7 -7
- package/dist/cli/{chunk-7AUQSK24.mjs → chunk-JXG7HWBA.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-WIV3E6Y7.js → chunk-MCBUWK5K.js} +22 -22
- package/dist/cli/{chunk-2TAGAPLL.js → chunk-NHKP2NSU.js} +2 -2
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-UXXFCOE3.js → chunk-NLENABRU.js} +6 -6
- package/dist/cli/{chunk-DHC7EGI7.mjs → chunk-NR3O56FT.mjs} +5 -5
- package/dist/cli/{chunk-MPYM6TUO.js → chunk-O2KLWUNI.js} +44 -44
- package/dist/cli/{chunk-BMNLD63A.mjs → chunk-OAFKUHN5.mjs} +4 -4
- package/dist/cli/{chunk-RYYGNUNO.mjs → chunk-OELJKQOL.mjs} +24 -4
- package/dist/cli/{chunk-ZD673XAL.js → chunk-PX7XAVUC.js} +24 -20
- package/dist/cli/{chunk-FOCNY4GV.js → chunk-QFRMVI4S.js} +3 -3
- package/dist/cli/{chunk-AU7ZKXW5.mjs → chunk-R57UCXQG.mjs} +1 -1
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-BUCTWJBM.js → chunk-STXG2LFC.js} +2 -2
- package/dist/cli/{chunk-ECPCZVDM.mjs → chunk-SU4K4SUU.mjs} +1 -1
- package/dist/cli/{chunk-ABDXKELH.mjs → chunk-SYOPHFKB.mjs} +6 -6
- package/dist/cli/{chunk-H74CLEMB.mjs → chunk-SZNJENGT.mjs} +3 -3
- package/dist/cli/{chunk-5N4ENMYE.js → chunk-TBCNL2T5.js} +1 -1
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-C2LYJ3EX.js → chunk-UJ6GOV7K.js} +13 -13
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-6PJAC3P5.mjs → chunk-VSJEOSYL.mjs} +1 -1
- package/dist/cli/{chunk-NB4AIXEA.mjs → chunk-W2OPPSAZ.mjs} +3 -3
- package/dist/cli/{chunk-5LNWLEO3.mjs → chunk-XBM3KABD.mjs} +3 -3
- package/dist/cli/{chunk-VMIIUMAN.mjs → chunk-XFPVFWZR.mjs} +1 -1
- package/dist/cli/{chunk-UC5QFQGC.mjs → chunk-XSN6BAZT.mjs} +5 -5
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-S6FF7Q5P.js → chunk-YE3T73BV.js} +10 -10
- package/dist/cli/{chunk-CY5LW6DW.js → chunk-YJYKZ2U3.js} +2 -2
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-ZL2DER5D.mjs → chunk-ZRT2PNYY.mjs} +1 -1
- package/dist/cli/{chunk-WZMG2M65.mjs → chunk-ZSPBJB7I.mjs} +4 -4
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
- package/dist/cli/{concurrent-runs-help-ZJ77SAEU.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
- package/dist/cli/{csv-PX7F5YJN.mjs → csv-5QW2HPHT.mjs} +4 -4
- package/dist/cli/{csv-MJLIZZOR.js → csv-SSOFTXHU.js} +13 -13
- package/dist/cli/{db-BNCNAY4G.js → db-4LK5AJNO.js} +29 -29
- package/dist/cli/{db-KPKGTHPA.mjs → db-K2JMR6EM.mjs} +8 -8
- package/dist/cli/describe-AC6PLEFP.js +50 -0
- package/dist/cli/describe-AXHQZHTT.mjs +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 +3 -3
- package/dist/cli/describe-core.mjs +2 -2
- package/dist/cli/{executions-YNOFR7T2.js → executions-AATJQQAQ.js} +10 -10
- package/dist/cli/{executions-NMQY4GEY.mjs → executions-FY2XTX2W.mjs} +8 -8
- package/dist/cli/{feedback-LWYEO5LL.mjs → feedback-MKBPRGS6.mjs} +6 -6
- package/dist/cli/{feedback-RCP5DPO6.js → feedback-QPVJER75.js} +14 -14
- package/dist/cli/{git-3O4PFP3Q.mjs → git-AGRFZR3K.mjs} +5 -5
- package/dist/cli/git-RUYFQEJX.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
- package/dist/cli/integrations-R6OUFZXI.js +98 -0
- package/dist/cli/{legacy-noops-KFP674JT.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
- package/dist/cli/{legacy-noops-ZPZRG366.js → legacy-noops-H7INM2QN.js} +9 -9
- package/dist/cli/{mcp-OCYUXQ6L.mjs → mcp-2Z2YVOLK.mjs} +72 -15
- package/dist/cli/{mcp-HCXDW6PL.js → mcp-33F7D7WI.js} +89 -32
- package/dist/cli/{monitors-7Q7YT22Y.js → monitors-KDUJHAKJ.js} +102 -102
- package/dist/cli/{monitors-V5KJIJJE.mjs → monitors-NZD2WIKK.mjs} +9 -9
- package/dist/cli/{org-S37K6QYH.js → org-4PQGHLEB.js} +164 -88
- package/dist/cli/{org-C3QLHX7U.mjs → org-EJW45RUA.mjs} +84 -8
- package/dist/cli/{play-MXQ2DKML.mjs → play-3CM5RT5J.mjs} +44 -25
- package/dist/cli/{play-MLREAYHJ.js → play-MLHMQL4G.js} +374 -355
- package/dist/cli/{providers-FDJ4ZOST.mjs → providers-BHYBJI4R.mjs} +10 -9
- package/dist/cli/{providers-PPDWY7DH.js → providers-YBJG7277.js} +13 -12
- package/dist/cli/{quickstart-2Z57AMB7.mjs → quickstart-LL3MR562.mjs} +4 -4
- package/dist/cli/{quickstart-BOWQM7S7.js → quickstart-O7L2NNGJ.js} +6 -6
- package/dist/cli/{run-66HXNJNV.js → run-HJ2AR6CM.js} +49 -48
- package/dist/cli/{run-5RNJGPQ2.mjs → run-OK545H5Q.mjs} +28 -27
- package/dist/cli/search-UUNS6BCC.js +32 -0
- package/dist/cli/{search-7G4FYQYO.mjs → search-Z5ZKMRTX.mjs} +9 -9
- package/dist/cli/{search-output-6K4FHCVI.mjs → search-output-Q5VHNUWG.mjs} +4 -4
- package/dist/cli/{search-output-L6ICQDBL.js → search-output-SVW4DETG.js} +6 -6
- package/dist/cli/{secrets-PWFJKF7G.js → secrets-ENQWMCB5.js} +17 -17
- package/dist/cli/{secrets-FTQPCU7O.mjs → secrets-QIKIEFWB.mjs} +8 -8
- package/dist/cli/{sessions-YSSAAQVJ.mjs → sessions-AETO22RF.mjs} +6 -6
- package/dist/cli/sessions-FNSUDERA.js +22 -0
- package/dist/cli/{settings-KN7GNZ5J.mjs → settings-G5RGRPFV.mjs} +16 -16
- package/dist/cli/{settings-CZEMF2WD.js → settings-OFLIFTMZ.js} +89 -89
- package/dist/cli/{setup-5WLHGH57.mjs → setup-G4N3X6KG.mjs} +9 -9
- package/dist/cli/{setup-RW4X6DX4.js → setup-QW7Y62XD.js} +49 -49
- package/dist/cli/skills-3IXIY2IV.js +36 -0
- package/dist/cli/{skills-DLVI7IZK.mjs → skills-QRFQGHNA.mjs} +7 -7
- package/dist/cli/{tools-JVYQF7P3.mjs → tools-52BH7UTF.mjs} +20 -19
- package/dist/cli/tools-MYBUMPKH.js +57 -0
- package/dist/cli/update-GT7574UU.js +34 -0
- package/dist/cli/{update-XKLXU7YS.mjs → update-SDGZLAGL.mjs} +9 -9
- package/dist/cli/{views-QRRCWP6B.mjs → views-3BIJFJMQ.mjs} +8 -8
- package/dist/cli/{views-YNUYFS3S.js → views-5QKAWYPI.js} +23 -23
- package/dist/cli/{workflow-YUKADKCJ.js → workflow-G67RPWVY.js} +19 -19
- package/dist/cli/{workflow-KYFMA4LM.mjs → workflow-QAK773FR.mjs} +9 -9
- package/dist/{client-B1fixtK1.d.ts → client-D1ga52xq.d.ts} +1 -1
- package/dist/{client-CE4QBVbp.d.mts → client-bd4QQIXo.d.mts} +1 -1
- package/dist/{client-core-C-3FVlVq.d.ts → client-core-B6eMVx8h.d.ts} +335 -4
- package/dist/{client-core-2BkNBgrx.d.mts → client-core-CqfWNf2Q.d.mts} +335 -4
- package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
- package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
- package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
- package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
- package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +12 -12
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +147 -133
- 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/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 +2 -2
- package/dist/plays/run-request.mjs +1 -1
- 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 +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
- package/dist/cli/auth-V76O674K.js +0 -43
- package/dist/cli/concurrent-runs-help-MFEPUP6Y.js +0 -21
- package/dist/cli/describe-5OUJA5TH.mjs +0 -49
- package/dist/cli/describe-7MF5AHIU.js +0 -49
- package/dist/cli/git-WLQ3BS6K.js +0 -25
- package/dist/cli/search-LTUIIV6W.js +0 -32
- package/dist/cli/sessions-2IVFGTPA.js +0 -22
- package/dist/cli/skills-WT42AZVH.js +0 -36
- package/dist/cli/tools-D6STYBQG.js +0 -56
- package/dist/cli/update-XTUKBC3J.js +0 -34
package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts
CHANGED
|
@@ -138,7 +138,7 @@ function createRunnerCallbacks(input: {
|
|
|
138
138
|
return converted;
|
|
139
139
|
};
|
|
140
140
|
const requireResource = (
|
|
141
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime',
|
|
141
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel',
|
|
142
142
|
sandboxId: string,
|
|
143
143
|
) => {
|
|
144
144
|
const resource = input.resources.get(`${provider}:${sandboxId}`);
|
|
@@ -326,7 +326,7 @@ export function playRunnerRuntimeResourceFromSandboxExecutionResource(
|
|
|
326
326
|
|
|
327
327
|
function sandboxProviderForRuntimeResourceKind(
|
|
328
328
|
kind: PlayRunnerRuntimeResource['kind'],
|
|
329
|
-
): 'daytona' | 'modal' | 'agentcore_runtime' {
|
|
329
|
+
): 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel' {
|
|
330
330
|
switch (kind) {
|
|
331
331
|
case 'daytona_sandbox':
|
|
332
332
|
return 'daytona';
|
|
@@ -334,12 +334,14 @@ function sandboxProviderForRuntimeResourceKind(
|
|
|
334
334
|
return 'modal';
|
|
335
335
|
case 'agentcore_runtime_session':
|
|
336
336
|
return 'agentcore_runtime';
|
|
337
|
+
case 'vercel_sandbox':
|
|
338
|
+
return 'vercel';
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
|
|
340
342
|
function runtimeResourceRoutingDomain(
|
|
341
343
|
resource: PlayRunnerRuntimeResource,
|
|
342
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime',
|
|
344
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel',
|
|
343
345
|
): string | null {
|
|
344
346
|
switch (provider) {
|
|
345
347
|
case 'daytona':
|
|
@@ -348,6 +350,8 @@ function runtimeResourceRoutingDomain(
|
|
|
348
350
|
return resource.modalAppId ?? null;
|
|
349
351
|
case 'agentcore_runtime':
|
|
350
352
|
return resource.agentcoreRuntimeArn ?? null;
|
|
353
|
+
case 'vercel':
|
|
354
|
+
return resource.vercelProjectId ?? null;
|
|
351
355
|
}
|
|
352
356
|
}
|
|
353
357
|
|
|
@@ -361,6 +365,8 @@ function runtimeResourceKindForSandboxProvider(
|
|
|
361
365
|
return 'modal_sandbox';
|
|
362
366
|
case 'agentcore_runtime':
|
|
363
367
|
return 'agentcore_runtime_session';
|
|
368
|
+
case 'vercel':
|
|
369
|
+
return 'vercel_sandbox';
|
|
364
370
|
}
|
|
365
371
|
}
|
|
366
372
|
|
|
@@ -373,6 +379,7 @@ function runtimeResourceRoutingFields(
|
|
|
373
379
|
| 'daytonaOrganizationId'
|
|
374
380
|
| 'modalAppId'
|
|
375
381
|
| 'agentcoreRuntimeArn'
|
|
382
|
+
| 'vercelProjectId'
|
|
376
383
|
> {
|
|
377
384
|
switch (provider) {
|
|
378
385
|
case 'daytona':
|
|
@@ -384,6 +391,8 @@ function runtimeResourceRoutingFields(
|
|
|
384
391
|
return { modalAppId: resource.routingDomain ?? undefined };
|
|
385
392
|
case 'agentcore_runtime':
|
|
386
393
|
return { agentcoreRuntimeArn: resource.routingDomain ?? undefined };
|
|
394
|
+
case 'vercel':
|
|
395
|
+
return { vercelProjectId: resource.routingDomain ?? undefined };
|
|
387
396
|
}
|
|
388
397
|
}
|
|
389
398
|
|
|
@@ -119,6 +119,11 @@ export type PlaySchedulerSubmitInput = RetainedPipelineCarrier & {
|
|
|
119
119
|
force?: boolean;
|
|
120
120
|
/** Explicit cache bypass for completed ctx.tools.execute receipts. */
|
|
121
121
|
forceToolRefresh?: boolean | null;
|
|
122
|
+
/**
|
|
123
|
+
* Internal reuse window in seconds for completed provider-call results
|
|
124
|
+
* (`play_run.cache_reuse_window`). Absent means authored freshness.
|
|
125
|
+
*/
|
|
126
|
+
cacheReuseWindowSeconds?: number | null;
|
|
122
127
|
/** Validated per-run ceiling for provider-tool executions and ctx.fetch. */
|
|
123
128
|
maxConcurrentExternalCalls?: number | null;
|
|
124
129
|
maxConcurrentRows?: number | null;
|
|
@@ -354,6 +359,8 @@ export type PlaySchedulerCancelOutcome =
|
|
|
354
359
|
|
|
355
360
|
export type PlaySchedulerSignalPayload = {
|
|
356
361
|
kind: 'integration_event' | 'cancel' | 'custom';
|
|
362
|
+
/** Stable source delivery identity; absent retains legacy signal behavior. */
|
|
363
|
+
deliveryId?: string;
|
|
357
364
|
eventKey?: string;
|
|
358
365
|
data?: unknown;
|
|
359
366
|
};
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts
CHANGED
|
@@ -145,11 +145,12 @@ import {
|
|
|
145
145
|
type DaytonaCrashDiagnostic,
|
|
146
146
|
type DaytonaSandboxDeleteOutcome,
|
|
147
147
|
} from '../runner-backends/backends/daytona';
|
|
148
|
+
import { findModalSandboxIdsByTags } from '../runner-backends/backends/modal';
|
|
149
|
+
import { createFleetSandboxSweep } from '../fleet-sandbox-sweep';
|
|
148
150
|
import {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
} from '../runner-backends/backends/modal';
|
|
151
|
+
earlySandboxFleetSweepAdapter,
|
|
152
|
+
earlySandboxSweepAdapters,
|
|
153
|
+
} from './early-sandbox-lane';
|
|
153
154
|
import {
|
|
154
155
|
resolveDetachedRunnerRuntimeLimitSeconds,
|
|
155
156
|
type DetachedRunnerSuspension,
|
|
@@ -381,7 +382,10 @@ import {
|
|
|
381
382
|
runtimeSandboxCapacityAdmissionMode,
|
|
382
383
|
RuntimeSandboxCapacityLimitError,
|
|
383
384
|
} from './runtime-sandbox-capacity';
|
|
384
|
-
import {
|
|
385
|
+
import {
|
|
386
|
+
runtimeSandboxProviderForResourceKind,
|
|
387
|
+
runtimeSandboxRoutingDomainForResource,
|
|
388
|
+
} from './runtime-sandbox-operation';
|
|
385
389
|
import {
|
|
386
390
|
createPostgresSandboxCleanupStore,
|
|
387
391
|
createSandboxCleanupJob,
|
|
@@ -613,9 +617,9 @@ const RUNTIME_CLAIM_LEASE_SECONDS =
|
|
|
613
617
|
const HEARTBEAT_CLAIM_TIMEOUT_SECONDS = RUNTIME_CLAIM_LEASE_SECONDS;
|
|
614
618
|
|
|
615
619
|
/** `startupReadToolIds` for the runner context, from the launch's contract plan; empty when it names none. */
|
|
616
|
-
export function startupReadToolIdsContext(
|
|
617
|
-
|
|
618
|
-
|
|
620
|
+
export function startupReadToolIdsContext(contractSnapshot: unknown): {
|
|
621
|
+
startupReadToolIds?: string[];
|
|
622
|
+
} {
|
|
619
623
|
const pipeline =
|
|
620
624
|
contractSnapshot && typeof contractSnapshot === 'object'
|
|
621
625
|
? (contractSnapshot as { staticPipeline?: unknown }).staticPipeline
|
|
@@ -2884,7 +2888,7 @@ function sandboxCapacityExceededCause(): string {
|
|
|
2884
2888
|
* capacity/cleanup owner before it can receive one of these leases.
|
|
2885
2889
|
*/
|
|
2886
2890
|
type ManagedSandboxCapacityResource = PlayRunnerRuntimeResource & {
|
|
2887
|
-
kind: 'daytona_sandbox' | 'modal_sandbox';
|
|
2891
|
+
kind: 'daytona_sandbox' | 'modal_sandbox' | 'vercel_sandbox';
|
|
2888
2892
|
sandboxCapacityLeaseId: string;
|
|
2889
2893
|
};
|
|
2890
2894
|
|
|
@@ -2893,7 +2897,8 @@ function isManagedSandboxCapacityResource(
|
|
|
2893
2897
|
): resource is ManagedSandboxCapacityResource {
|
|
2894
2898
|
return (
|
|
2895
2899
|
(resource.kind === 'daytona_sandbox' ||
|
|
2896
|
-
resource.kind === 'modal_sandbox'
|
|
2900
|
+
resource.kind === 'modal_sandbox' ||
|
|
2901
|
+
resource.kind === 'vercel_sandbox') &&
|
|
2897
2902
|
typeof resource.sandboxCapacityLeaseId === 'string' &&
|
|
2898
2903
|
resource.sandboxCapacityLeaseId.trim().length > 0
|
|
2899
2904
|
);
|
|
@@ -5767,10 +5772,9 @@ async function executeAssignedAbsurdAttempt(input: {
|
|
|
5767
5772
|
runnerResource.daytonaEnvironment ??
|
|
5768
5773
|
'production',
|
|
5769
5774
|
routingDomain:
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
: runnerResource.modalAppId?.trim() || null,
|
|
5775
|
+
runtimeSandboxRoutingDomainForResource(
|
|
5776
|
+
runnerResource,
|
|
5777
|
+
),
|
|
5774
5778
|
},
|
|
5775
5779
|
options,
|
|
5776
5780
|
);
|
|
@@ -8483,7 +8487,11 @@ export const ABSURD_DETACHED_RUNNER_LIVENESS_PAGE_LIMIT = 100;
|
|
|
8483
8487
|
/** How soon an unproven sandbox may be read again. */
|
|
8484
8488
|
export const ABSURD_DETACHED_RUNNER_LIVENESS_RECHECK_MS = 60_000;
|
|
8485
8489
|
|
|
8486
|
-
const ABSURD_DETACHED_RUNNER_LIVENESS_PROVIDERS = [
|
|
8490
|
+
const ABSURD_DETACHED_RUNNER_LIVENESS_PROVIDERS = [
|
|
8491
|
+
'daytona',
|
|
8492
|
+
'modal',
|
|
8493
|
+
'vercel',
|
|
8494
|
+
] as const;
|
|
8487
8495
|
/** Inspection stages that carry no answer from the provider about the sandbox. */
|
|
8488
8496
|
const DETACHED_RUNNER_UNANSWERED_STAGES: ReadonlySet<string> = new Set([
|
|
8489
8497
|
'sandbox_lookup_failed',
|
|
@@ -8516,9 +8524,9 @@ export function createAbsurdDetachedRunnerLivenessSweepState(): AbsurdDetachedRu
|
|
|
8516
8524
|
return {
|
|
8517
8525
|
generation: 0,
|
|
8518
8526
|
nextCheckAtMs: new Map(),
|
|
8519
|
-
afterRunIds: { daytona: null, modal: null },
|
|
8520
|
-
readsInFlight: { daytona: 0, modal: 0 },
|
|
8521
|
-
abandonedReads: { daytona: 0, modal: 0 },
|
|
8527
|
+
afterRunIds: { daytona: null, modal: null, vercel: null },
|
|
8528
|
+
readsInFlight: { daytona: 0, modal: 0, vercel: 0 },
|
|
8529
|
+
abandonedReads: { daytona: 0, modal: 0, vercel: 0 },
|
|
8522
8530
|
settling: false,
|
|
8523
8531
|
projecting: false,
|
|
8524
8532
|
};
|
|
@@ -8615,7 +8623,7 @@ export async function recoverAbsurdRuntimeStaleDetachedRunners(input: {
|
|
|
8615
8623
|
};
|
|
8616
8624
|
}): Promise<AbsurdDetachedRunnerLivenessOutcome> {
|
|
8617
8625
|
const { state } = input;
|
|
8618
|
-
state.abandonedReads ??= { daytona: 0, modal: 0 };
|
|
8626
|
+
state.abandonedReads ??= { daytona: 0, modal: 0, vercel: 0 };
|
|
8619
8627
|
state.settling ??= false;
|
|
8620
8628
|
state.projecting ??= false;
|
|
8621
8629
|
const readDeadline =
|
|
@@ -8630,6 +8638,7 @@ export async function recoverAbsurdRuntimeStaleDetachedRunners(input: {
|
|
|
8630
8638
|
const answeredReads: Record<DetachedRunnerLivenessProvider, number> = {
|
|
8631
8639
|
daytona: 0,
|
|
8632
8640
|
modal: 0,
|
|
8641
|
+
vercel: 0,
|
|
8633
8642
|
};
|
|
8634
8643
|
const options = input.schedulerOptions ?? {};
|
|
8635
8644
|
const now = input.clock?.now ?? Date.now;
|
|
@@ -10140,7 +10149,7 @@ async function claimPostgresSchedulerSandboxCleanupBatch(input: {
|
|
|
10140
10149
|
environment: 'preview' | 'production';
|
|
10141
10150
|
schedulerOptions: Pick<PostgresSchedulerOptions, 'schema'>;
|
|
10142
10151
|
limit: number;
|
|
10143
|
-
providers?: Array<'daytona' | 'modal'>;
|
|
10152
|
+
providers?: Array<'daytona' | 'modal' | 'vercel'>;
|
|
10144
10153
|
}): Promise<PostgresSchedulerSandboxCleanupJob[]> {
|
|
10145
10154
|
return await input.runWithClient((client) =>
|
|
10146
10155
|
claimPostgresSchedulerSandboxCleanupJobs(
|
|
@@ -10570,7 +10579,7 @@ export async function drainPostgresSchedulerSandboxCleanupOnce(input: {
|
|
|
10570
10579
|
schedulerOptions?: Pick<PostgresSchedulerOptions, 'schema'>;
|
|
10571
10580
|
limit?: number;
|
|
10572
10581
|
timeoutMs?: number;
|
|
10573
|
-
providers?: Array<'daytona' | 'modal'>;
|
|
10582
|
+
providers?: Array<'daytona' | 'modal' | 'vercel'>;
|
|
10574
10583
|
readSandboxCrashDiagnostic?: AbsurdRuntimeWorkerDeps['readSandboxCrashDiagnostic'];
|
|
10575
10584
|
}): Promise<{ claimed: number; deleted: number; retried: number }> {
|
|
10576
10585
|
const options = input.schedulerOptions ?? {};
|
|
@@ -10888,7 +10897,7 @@ export async function runPostgresSchedulerSandboxCleanupController(input: {
|
|
|
10888
10897
|
pollIntervalMs?: number;
|
|
10889
10898
|
shutdownTimeoutMs?: number;
|
|
10890
10899
|
sleep?: (ms: number) => Promise<void>;
|
|
10891
|
-
providers?: Array<'daytona' | 'modal'>;
|
|
10900
|
+
providers?: Array<'daytona' | 'modal' | 'vercel'>;
|
|
10892
10901
|
readSandboxCrashDiagnostic?: AbsurdRuntimeWorkerDeps['readSandboxCrashDiagnostic'];
|
|
10893
10902
|
}): Promise<void> {
|
|
10894
10903
|
const concurrency = Math.max(
|
|
@@ -10914,8 +10923,20 @@ export async function runPostgresSchedulerSandboxCleanupController(input: {
|
|
|
10914
10923
|
});
|
|
10915
10924
|
let reservedRecovery: Promise<void> | null = null;
|
|
10916
10925
|
let nextReservedRecoveryAt = 0;
|
|
10917
|
-
|
|
10918
|
-
|
|
10926
|
+
// Durable orphan cleanup for early (E2) sandboxes, which are created before
|
|
10927
|
+
// any run row exists; their create tags are the obligation. One sweep per
|
|
10928
|
+
// provider that supports early start (Modal today), each on its own
|
|
10929
|
+
// interval. The shared Fleet Sandbox Sweep never awaits a pass, so a slow
|
|
10930
|
+
// provider never holds up cleanup claims.
|
|
10931
|
+
const fleetSandboxSweep = createFleetSandboxSweep({
|
|
10932
|
+
adapters: earlySandboxSweepAdapters(input.providers).map((adapter) =>
|
|
10933
|
+
earlySandboxFleetSweepAdapter({
|
|
10934
|
+
adapter,
|
|
10935
|
+
runtimeSchedulerSchema: input.schedulerOptions.schema ?? null,
|
|
10936
|
+
reportFailure: reportReconciliationPollFailure,
|
|
10937
|
+
}),
|
|
10938
|
+
),
|
|
10939
|
+
});
|
|
10919
10940
|
|
|
10920
10941
|
const startJob = (job: PostgresSchedulerSandboxCleanupJob): void => {
|
|
10921
10942
|
const task = processPostgresSchedulerSandboxCleanupJob({
|
|
@@ -10992,37 +11013,7 @@ export async function runPostgresSchedulerSandboxCleanupController(input: {
|
|
|
10992
11013
|
{ error: error instanceof Error ? error.message : String(error) },
|
|
10993
11014
|
);
|
|
10994
11015
|
}
|
|
10995
|
-
|
|
10996
|
-
input.providers?.includes('modal') &&
|
|
10997
|
-
!earlyModalSweep &&
|
|
10998
|
-
Date.now() >= nextEarlyModalSweepAt
|
|
10999
|
-
) {
|
|
11000
|
-
// Durable orphan cleanup for early (E2) sandboxes, which are created
|
|
11001
|
-
// before any run row exists; their create tags are the obligation.
|
|
11002
|
-
// Not awaited: a slow provider never holds up cleanup claims.
|
|
11003
|
-
nextEarlyModalSweepAt = Date.now() + EARLY_MODAL_SANDBOX_SWEEP_INTERVAL_MS;
|
|
11004
|
-
const sweep = sweepOrphanEarlyModalSandboxesForWorker({
|
|
11005
|
-
runtimeSchedulerSchema: input.schedulerOptions.schema ?? null,
|
|
11006
|
-
})
|
|
11007
|
-
.then((outcome) => {
|
|
11008
|
-
if ('observed' in outcome && outcome.observed > 0) {
|
|
11009
|
-
console.info(
|
|
11010
|
-
'[absurd-runtime.worker] early_modal_sandbox_sweep_observed',
|
|
11011
|
-
outcome,
|
|
11012
|
-
);
|
|
11013
|
-
}
|
|
11014
|
-
})
|
|
11015
|
-
.catch((error) => {
|
|
11016
|
-
reportReconciliationPollFailure(
|
|
11017
|
-
'[absurd-runtime.worker] early_modal_sandbox_sweep_failed',
|
|
11018
|
-
{ error: error instanceof Error ? error.message : String(error) },
|
|
11019
|
-
);
|
|
11020
|
-
})
|
|
11021
|
-
.finally(() => {
|
|
11022
|
-
if (earlyModalSweep === sweep) earlyModalSweep = null;
|
|
11023
|
-
});
|
|
11024
|
-
earlyModalSweep = sweep;
|
|
11025
|
-
}
|
|
11016
|
+
fleetSandboxSweep.runDuePasses();
|
|
11026
11017
|
if (input.providers?.includes('modal')) {
|
|
11027
11018
|
try {
|
|
11028
11019
|
const reconciliation =
|
|
@@ -3,12 +3,34 @@ import {
|
|
|
3
3
|
type PlayRuntimeBackendId,
|
|
4
4
|
} from '../backend';
|
|
5
5
|
import {
|
|
6
|
+
isRuntimeSandboxCanaryProduction,
|
|
6
7
|
resolveRuntimeSandboxPlacementPolicy,
|
|
7
8
|
RUNTIME_SANDBOX_PLACEMENT_POLICY_CATALOG,
|
|
8
9
|
RUNTIME_SANDBOX_PLACEMENT_POLICY_ENV,
|
|
9
10
|
runtimeSandboxPlacementPoliciesForBackend,
|
|
10
11
|
type RuntimeSandboxPlacementPolicy,
|
|
11
12
|
} from '../runtime-sandbox-placement-policy';
|
|
13
|
+
import {
|
|
14
|
+
assertRuntimeSandboxProvidersSupport,
|
|
15
|
+
runtimeSandboxLaneRequiredCapabilities,
|
|
16
|
+
runtimeSandboxProvidersInCanonicalOrder,
|
|
17
|
+
type RuntimeSandboxProviderId,
|
|
18
|
+
} from '../runtime-sandbox-provider-profile';
|
|
19
|
+
import {
|
|
20
|
+
EARLY_SANDBOX_START,
|
|
21
|
+
earlySandboxRequiredCapabilities,
|
|
22
|
+
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
23
|
+
type EarlySandboxSwitches,
|
|
24
|
+
} from '../runner-backends/early-sandbox';
|
|
25
|
+
import {
|
|
26
|
+
CLAIM_AFFINITY_FOR_EARLY_SANDBOX,
|
|
27
|
+
EARLY_SANDBOX_CLAIM_AFFINITY_READER,
|
|
28
|
+
} from './early-sandbox-claim-affinity';
|
|
29
|
+
import { runtimeSandboxCapacityAdmissionMode } from './runtime-sandbox-capacity';
|
|
30
|
+
import {
|
|
31
|
+
LOCAL_RUNTIME_SCHEDULER_SCHEMA_ENV,
|
|
32
|
+
RUNTIME_SCHEDULER_SCHEMA_ENV,
|
|
33
|
+
} from './runtime-scheduler-schema';
|
|
12
34
|
|
|
13
35
|
/**
|
|
14
36
|
* Boot-time required-env contract for the Absurd runtime worker entrypoint.
|
|
@@ -45,7 +67,7 @@ export const ABSURD_WORKER_REQUIRED_ENV = [
|
|
|
45
67
|
export function runtimeSandboxProviderCapabilities(
|
|
46
68
|
backend: PlayRuntimeBackendId,
|
|
47
69
|
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
48
|
-
):
|
|
70
|
+
): RuntimeSandboxProviderId[] {
|
|
49
71
|
return [
|
|
50
72
|
...new Set(
|
|
51
73
|
runtimeSandboxPlacementPoliciesRunnableByWorker(backend, env).flatMap(
|
|
@@ -65,7 +87,12 @@ export function runtimeSandboxPlacementPoliciesForWorkerEnv(
|
|
|
65
87
|
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
66
88
|
) {
|
|
67
89
|
const configured = env[RUNTIME_SANDBOX_PLACEMENT_POLICY_ENV]?.trim();
|
|
68
|
-
|
|
90
|
+
// A Preview-only policy runs only on a lane pinned to it, so it never adds
|
|
91
|
+
// a credential requirement to an unpinned (Production) worker.
|
|
92
|
+
if (!configured)
|
|
93
|
+
return runtimeSandboxPlacementPoliciesForBackend(backend).filter(
|
|
94
|
+
(policy) => !policy.previewOnly,
|
|
95
|
+
);
|
|
69
96
|
const policy = resolveRuntimeSandboxPlacementPolicy(configured);
|
|
70
97
|
if (policy.compatibilityRuntimeBackend !== backend) {
|
|
71
98
|
throw new Error(
|
|
@@ -94,6 +121,7 @@ export function runtimeSandboxPlacementPoliciesRunnableByWorker(
|
|
|
94
121
|
).filter(
|
|
95
122
|
(policy) =>
|
|
96
123
|
!configured.includes(policy) &&
|
|
124
|
+
!policy.previewOnly &&
|
|
97
125
|
policy.requiredCredentialEnv.every((name) => Boolean(env[name]?.trim())),
|
|
98
126
|
);
|
|
99
127
|
return [...configured, ...credentialed];
|
|
@@ -124,8 +152,102 @@ export function assertAbsurdWorkerRequiredEnv(
|
|
|
124
152
|
const missing = [...providerRequired, ...ABSURD_WORKER_REQUIRED_ENV].filter(
|
|
125
153
|
(name) => !env[name]?.trim(),
|
|
126
154
|
);
|
|
127
|
-
if (missing.length
|
|
128
|
-
|
|
129
|
-
|
|
155
|
+
if (missing.length > 0) {
|
|
156
|
+
throw new Error(
|
|
157
|
+
`Missing required absurd runtime worker configuration: ${missing.join(', ')}.`,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Refuse to boot a lane that would place a run on a provider lacking a
|
|
164
|
+
* capability the lane needs (a Production lane needs shared capacity, cleanup
|
|
165
|
+
* and billing), naming the provider's own reason.
|
|
166
|
+
*/
|
|
167
|
+
export function assertRuntimeSandboxLaneSupported(
|
|
168
|
+
backend: PlayRuntimeBackendId,
|
|
169
|
+
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
170
|
+
earlySandboxSwitches: EarlySandboxSwitches = STATIC_EARLY_SANDBOX_SWITCHES,
|
|
171
|
+
/** The worker's final schema (env or `--schema`); env when omitted. */
|
|
172
|
+
runtimeSchedulerSchema?: string | null,
|
|
173
|
+
): void {
|
|
174
|
+
// Same Production predicate the canary uses: a production build on the
|
|
175
|
+
// prod-default scheduler schema. An unset schema is the prod default.
|
|
176
|
+
const production = isRuntimeSandboxCanaryProduction({
|
|
177
|
+
nodeEnv: env.NODE_ENV,
|
|
178
|
+
runtimeSchedulerSchema:
|
|
179
|
+
runtimeSchedulerSchema?.trim() ||
|
|
180
|
+
env[LOCAL_RUNTIME_SCHEDULER_SCHEMA_ENV]?.trim() ||
|
|
181
|
+
env[RUNTIME_SCHEDULER_SCHEMA_ENV]?.trim() ||
|
|
182
|
+
null,
|
|
183
|
+
});
|
|
184
|
+
const required = runtimeSandboxLaneRequiredCapabilities({
|
|
185
|
+
environment: production ? 'production' : 'preview',
|
|
186
|
+
capacityAdmission: runtimeSandboxCapacityAdmissionMode({ ...env }),
|
|
187
|
+
});
|
|
188
|
+
// Every policy the lane executes, including credentialed extras.
|
|
189
|
+
for (const policy of runtimeSandboxPlacementPoliciesRunnableByWorker(
|
|
190
|
+
backend,
|
|
191
|
+
env,
|
|
192
|
+
)) {
|
|
193
|
+
assertRuntimeSandboxProvidersSupport({
|
|
194
|
+
subject: `Runtime worker placement policy ${policy.id}`,
|
|
195
|
+
providers: policy.providers,
|
|
196
|
+
required,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
// A static early-sandbox switch (E2, PB, CA or CAR) is lane-wide.
|
|
200
|
+
assertEarlySandboxLaneSupported({
|
|
201
|
+
subject: `Runtime worker ${backend} lane early sandbox`,
|
|
202
|
+
backend,
|
|
203
|
+
env,
|
|
204
|
+
switches: earlySandboxSwitches,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/** The static (lane-wide) early-sandbox switch values. CA counts with CAR. */
|
|
209
|
+
export const STATIC_EARLY_SANDBOX_SWITCHES: EarlySandboxSwitches = {
|
|
210
|
+
earlyStart: EARLY_SANDBOX_START,
|
|
211
|
+
preboot: PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
212
|
+
claimAffinity:
|
|
213
|
+
CLAIM_AFFINITY_FOR_EARLY_SANDBOX || EARLY_SANDBOX_CLAIM_AFFINITY_READER,
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* The providers an early sandbox on this lane is adopted from: the first
|
|
218
|
+
* provider of each placement policy the lane is configured for (not the
|
|
219
|
+
* credentialed extras), in canonical order. A run's early sandbox is started
|
|
220
|
+
* before its policy is known, so every one of them must support it.
|
|
221
|
+
*/
|
|
222
|
+
export function earlySandboxLaneProviders(
|
|
223
|
+
backend: PlayRuntimeBackendId,
|
|
224
|
+
env: Readonly<Record<string, string | undefined>> = process.env,
|
|
225
|
+
): RuntimeSandboxProviderId[] {
|
|
226
|
+
return runtimeSandboxProvidersInCanonicalOrder(
|
|
227
|
+
runtimeSandboxPlacementPoliciesForWorkerEnv(backend, env).map(
|
|
228
|
+
(policy) => policy.providers[0],
|
|
229
|
+
),
|
|
130
230
|
);
|
|
131
231
|
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Fails loudly when an early-sandbox switch that is on needs a capability one
|
|
235
|
+
* of the lane's early-sandbox providers declares unsupported in its Runtime
|
|
236
|
+
* Sandbox Provider Profile. With every switch off it reads nothing.
|
|
237
|
+
*/
|
|
238
|
+
export function assertEarlySandboxLaneSupported(input: {
|
|
239
|
+
subject: string;
|
|
240
|
+
backend: PlayRuntimeBackendId;
|
|
241
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
242
|
+
switches: EarlySandboxSwitches;
|
|
243
|
+
}): RuntimeSandboxProviderId[] {
|
|
244
|
+
const required = earlySandboxRequiredCapabilities(input.switches);
|
|
245
|
+
if (required.length === 0) return [];
|
|
246
|
+
const providers = earlySandboxLaneProviders(input.backend, input.env);
|
|
247
|
+
assertRuntimeSandboxProvidersSupport({
|
|
248
|
+
subject: input.subject,
|
|
249
|
+
providers,
|
|
250
|
+
required,
|
|
251
|
+
});
|
|
252
|
+
return providers;
|
|
253
|
+
}
|
|
@@ -498,7 +498,13 @@ function absurdRunHandle(input: {
|
|
|
498
498
|
await withRuntimeSchedulerClient(poolOptions, (client) =>
|
|
499
499
|
recordPostgresSchedulerSignal(
|
|
500
500
|
client,
|
|
501
|
-
{
|
|
501
|
+
{
|
|
502
|
+
runId: input.runId,
|
|
503
|
+
eventKey,
|
|
504
|
+
boundaryId,
|
|
505
|
+
payload: eventPayload,
|
|
506
|
+
...(payload.deliveryId ? { deliveryId: payload.deliveryId } : {}),
|
|
507
|
+
},
|
|
502
508
|
effectiveOptions,
|
|
503
509
|
),
|
|
504
510
|
);
|