deepline 0.3.542 → 0.3.544
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 +112 -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 +10 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +3 -1
- package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
- package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
- 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/durable-summary-events.ts +29 -0
- 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 +43 -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 +49 -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 +229 -144
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -2
- 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-ENBXAKQS.js +43 -0
- package/dist/cli/{auth-IGBGOB4E.mjs → auth-IMWJAHPU.mjs} +5 -5
- package/dist/cli/{billing-IB2TWE74.js → billing-Y55PR2PV.js} +101 -101
- package/dist/cli/{billing-N37W2I62.mjs → billing-YQMW3QJI.mjs} +12 -12
- package/dist/cli/chunk-22OBDYHP.js +455 -0
- 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-D44DP4KJ.js → chunk-3I26HMJ7.js} +37 -17
- package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-3JDA23NN.mjs} +2 -2
- package/dist/cli/{chunk-QXNOSCYL.js → chunk-3KGMM4KS.js} +1 -1
- package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-456RRXAP.mjs} +5 -5
- package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
- package/dist/cli/{chunk-FGGPCAGC.js → chunk-4PKHFW56.js} +18 -18
- package/dist/cli/{chunk-QONO7FRF.mjs → chunk-57G4NYOL.mjs} +1 -1
- package/dist/cli/{chunk-46V7QSJE.mjs → chunk-5PR4VLLL.mjs} +3 -3
- package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
- package/dist/cli/{chunk-AKY7KZRJ.js → chunk-7GNZEOTH.js} +6 -6
- package/dist/cli/{chunk-LFMQVSEI.js → chunk-7HMMTSDA.js} +5 -5
- package/dist/cli/{chunk-ORA5TMML.mjs → chunk-BEQ7RQLT.mjs} +5 -5
- package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
- package/dist/cli/{chunk-GM73TZ2W.js → chunk-C4P2KLWT.js} +41 -41
- package/dist/cli/{chunk-DNGACHFX.js → chunk-COJHT2KF.js} +22 -22
- package/dist/cli/{chunk-6SLEHAXX.js → chunk-DF2X7GJG.js} +5 -5
- package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DVDWAC2M.mjs} +7 -3
- package/dist/cli/{chunk-5CAVURVS.js → chunk-DYDHLBSK.js} +53 -53
- package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
- package/dist/cli/{chunk-EHLCWGWN.js → chunk-G26VJCNT.js} +4 -4
- package/dist/cli/{chunk-WL2GUGNZ.js → chunk-GQHRGBHV.js} +7 -7
- package/dist/cli/{chunk-DADH3WPE.mjs → chunk-GV45TTI6.mjs} +2 -2
- package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
- package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-H4SAHB3Q.mjs} +3 -3
- package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-HAQRF6DJ.mjs} +2 -2
- package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-HBSWATOU.mjs} +6 -6
- package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-HVJQF5BI.mjs} +2 -2
- package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
- package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-HXM2JUGD.mjs} +1 -1
- package/dist/cli/{chunk-JPT6VE54.js → chunk-IFIJ4DBJ.js} +2 -2
- package/dist/cli/{chunk-HAITCPCG.js → chunk-JBWOE6AP.js} +16 -16
- package/dist/cli/{chunk-AWLPERL3.js → chunk-JWVG7ZPX.js} +3 -3
- package/dist/cli/{chunk-3XXXMSSP.js → chunk-KE6CSCUF.js} +44 -44
- package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-LPUBBUKX.mjs} +24 -4
- package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-LQ6RRYXN.mjs} +5 -5
- package/dist/cli/{chunk-FFDZT255.mjs → chunk-LW274RO7.mjs} +1 -1
- package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
- package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
- package/dist/cli/{chunk-VHJUH3TB.js → chunk-ON56ISO6.js} +3 -3
- package/dist/cli/{chunk-4I47NCRI.js → chunk-PDJ4UDCO.js} +498 -328
- package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-PFGOCUH3.mjs} +1 -1
- package/dist/cli/{chunk-Q7WDXLYO.js → chunk-PKRW76XG.js} +2 -2
- package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-PMW5YP72.mjs} +37 -190
- package/dist/cli/{chunk-5APOJWJF.mjs → chunk-Q7ZOWNKR.mjs} +183 -13
- package/dist/cli/{chunk-WACIN4PR.mjs → chunk-REEOMNCO.mjs} +3 -3
- package/dist/cli/{chunk-DMXLZ57N.js → chunk-RG34YBDE.js} +2 -2
- package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-RJPDCSTD.mjs} +4 -4
- package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
- package/dist/cli/{chunk-AUFE624T.js → chunk-RUFR4PUO.js} +10 -10
- package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-SK3HPU2J.mjs} +1 -1
- package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-SKS53WM6.mjs} +4 -4
- package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
- package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
- package/dist/cli/{chunk-CFZCRM6R.js → chunk-UHIAQPVA.js} +26 -26
- package/dist/cli/{chunk-D7GWEBMF.js → chunk-UNMNGRPB.js} +7 -7
- package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
- package/dist/cli/{chunk-TTBHOMAA.js → chunk-W7X4KH45.js} +316 -469
- package/dist/cli/chunk-WBSGPLH5.mjs +455 -0
- package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-WUEORIOY.mjs} +1 -1
- package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
- package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-YIRVKMON.mjs} +1 -1
- package/dist/cli/{chunk-NDNEARE3.js → chunk-Z44YTSTA.js} +13 -13
- package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
- package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-ZHY4T5M6.mjs} +1 -1
- package/dist/cli/{chunk-E7B73LGT.js → chunk-ZY6FL4O4.js} +24 -20
- package/dist/cli/command-docs.js +3 -3
- package/dist/cli/command-docs.mjs +2 -2
- package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-KBWPKSTP.mjs} +7 -7
- package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
- package/dist/cli/{csv-CAVA3EMS.mjs → csv-M5EBEMZH.mjs} +4 -4
- package/dist/cli/{csv-XZAM7EYZ.js → csv-XGGDZTQI.js} +13 -13
- package/dist/cli/{db-PPGEOBNG.js → db-CVPR54XK.js} +29 -29
- package/dist/cli/{db-HD332QI7.mjs → db-M6FJ6J6E.mjs} +8 -8
- package/dist/cli/describe-RUODIS6M.js +50 -0
- package/dist/cli/describe-X6QA2U3C.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-AFEOLB4A.mjs → executions-EHTS2XJX.mjs} +8 -8
- package/dist/cli/{executions-4ZKBL7IC.js → executions-VJEEWN22.js} +10 -10
- package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-76VGY4GP.mjs} +6 -6
- package/dist/cli/{feedback-M6Y33JKT.js → feedback-DQPUCUXO.js} +14 -14
- package/dist/cli/{git-632RYEF6.mjs → git-IY6DKKLR.mjs} +5 -5
- package/dist/cli/git-RLHTSYRY.js +25 -0
- package/dist/cli/index.js +150 -146
- package/dist/cli/index.mjs +49 -45
- package/dist/cli/integrations-242LE3TQ.mjs +98 -0
- package/dist/cli/integrations-CQSTIKFY.js +98 -0
- package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
- package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-U72DO6ZF.js} +9 -9
- package/dist/cli/{mcp-PESLHAAC.mjs → mcp-JJH6JR52.mjs} +72 -15
- package/dist/cli/{mcp-35QA6YG7.js → mcp-L473BKLJ.js} +89 -32
- package/dist/cli/{monitors-4DTUZLAI.js → monitors-3TF2DOFD.js} +119 -104
- package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-VSYHUBKC.mjs} +26 -11
- package/dist/cli/{org-DJNKMFCZ.mjs → org-S5VIKU2E.mjs} +8 -8
- package/dist/cli/{org-FWCBZMER.js → org-YKVI2ZTI.js} +90 -90
- package/dist/cli/{play-PHVQEEEZ.mjs → play-C7T5A3QM.mjs} +44 -25
- package/dist/cli/{play-FZ45M4KD.js → play-DOWEG45Y.js} +374 -355
- package/dist/cli/{providers-46E67QG7.mjs → providers-BMVVX3VD.mjs} +10 -9
- package/dist/cli/{providers-QJU6FMDD.js → providers-TAZPPFTB.js} +13 -12
- package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-A3WKMKTW.mjs} +4 -4
- package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-HD6FQXGR.js} +6 -6
- package/dist/cli/{run-WKSIRXEC.js → run-BVVV2UX7.js} +49 -48
- package/dist/cli/{run-2W2TJ6QA.mjs → run-FV7TWNOC.mjs} +28 -27
- package/dist/cli/{search-Y2CFLSYB.mjs → search-MGK6WIKS.mjs} +9 -9
- package/dist/cli/search-VJFCWUZN.js +32 -0
- package/dist/cli/{search-output-2IK6ZZDY.js → search-output-6Y7KEPIE.js} +6 -6
- package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-GM7LDZKE.mjs} +4 -4
- package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-4RFAR7YI.mjs} +8 -8
- package/dist/cli/{secrets-JVJIHGU4.js → secrets-SISXIXSZ.js} +17 -17
- package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-CE3OMEG7.mjs} +6 -6
- package/dist/cli/sessions-OWWZJZXH.js +22 -0
- package/dist/cli/{settings-5WHMFRNQ.js → settings-4HPM3K4A.js} +89 -89
- package/dist/cli/{settings-YQOPF3AI.mjs → settings-E22IDSX2.mjs} +16 -16
- package/dist/cli/{setup-3VJMKDEU.js → setup-BDRSNLKX.js} +49 -49
- package/dist/cli/{setup-O5U5IEVW.mjs → setup-BK65MDZ6.mjs} +9 -9
- package/dist/cli/{skills-G6J5PF35.mjs → skills-FI2GZMR4.mjs} +7 -7
- package/dist/cli/skills-ZLBFUAFR.js +36 -0
- package/dist/cli/tools-3K72VE33.js +57 -0
- package/dist/cli/{tools-AG7SWL5Y.mjs → tools-HMMWYUNW.mjs} +20 -19
- package/dist/cli/update-QZV6DH5V.js +34 -0
- package/dist/cli/{update-K73DD6CR.mjs → update-WDKBSXV5.mjs} +9 -9
- package/dist/cli/{views-4D2OTLIO.js → views-775AUDWQ.js} +23 -23
- package/dist/cli/{views-MO6DIOMR.mjs → views-JYIJCO23.mjs} +8 -8
- package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-4H6KQRFQ.js} +19 -19
- package/dist/cli/{workflow-MMZMAELI.mjs → workflow-FKKHE3IU.mjs} +9 -9
- package/dist/{client-DLG9mHDh.d.mts → client-ANT3pyoa.d.mts} +1 -1
- package/dist/{client-X-FJD5Dp.d.ts → client-DD_FyJVd.d.ts} +1 -1
- package/dist/{client-core-WtnqyBwY.d.mts → client-core-Dg9tKhdB.d.mts} +339 -3
- package/dist/{client-core-0jmHfFBv.d.ts → client-core-QHmo73k1.d.ts} +339 -3
- package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
- package/dist/{compiler-manifest-Cys06iYg.d.ts → 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-2PH6RSKL.js +0 -43
- package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
- package/dist/cli/describe-5TFFB2PM.js +0 -49
- package/dist/cli/describe-THQU7N47.mjs +0 -49
- package/dist/cli/git-AQLQYWRI.js +0 -25
- package/dist/cli/search-YLJFCJTK.js +0 -32
- package/dist/cli/sessions-TZ33UCPS.js +0 -22
- package/dist/cli/skills-WZY3XDT3.js +0 -36
- package/dist/cli/tools-BXQBL72Q.js +0 -56
- package/dist/cli/update-XYP5EII6.js +0 -34
|
@@ -8,6 +8,11 @@ import {
|
|
|
8
8
|
inspectDetachedModalRunner,
|
|
9
9
|
readDetachedModalRuntimeCompletion,
|
|
10
10
|
} from './backends/modal';
|
|
11
|
+
import {
|
|
12
|
+
deleteVercelSandboxByName,
|
|
13
|
+
inspectDetachedVercelRunner,
|
|
14
|
+
readDetachedVercelRuntimeCompletion,
|
|
15
|
+
} from './backends/vercel-sandbox';
|
|
11
16
|
import {
|
|
12
17
|
readPersistedRuntimeSandboxRef,
|
|
13
18
|
type RuntimeSandboxProviderId,
|
|
@@ -175,6 +180,18 @@ export function runtimeSandboxRefFromResource(
|
|
|
175
180
|
: null,
|
|
176
181
|
};
|
|
177
182
|
}
|
|
183
|
+
if (resource.kind === 'vercel_sandbox') {
|
|
184
|
+
return {
|
|
185
|
+
schemaVersion: 1,
|
|
186
|
+
provider: 'vercel',
|
|
187
|
+
resourceId,
|
|
188
|
+
routingDomain:
|
|
189
|
+
typeof resource.vercelProjectId === 'string' &&
|
|
190
|
+
resource.vercelProjectId.trim()
|
|
191
|
+
? resource.vercelProjectId.trim()
|
|
192
|
+
: null,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
178
195
|
return null;
|
|
179
196
|
}
|
|
180
197
|
|
|
@@ -274,5 +291,33 @@ export const defaultRuntimeSandboxReconciliation =
|
|
|
274
291
|
expectedAppId: ref.routingDomain,
|
|
275
292
|
}),
|
|
276
293
|
},
|
|
294
|
+
{
|
|
295
|
+
// Preview-only (`vercel_sandbox_only@1`). The resource id is the
|
|
296
|
+
// sandbox name recorded before its create; the domain is the project.
|
|
297
|
+
provider: 'vercel',
|
|
298
|
+
delete: async (ref) => {
|
|
299
|
+
const outcome = await deleteVercelSandboxByName({
|
|
300
|
+
name: ref.resourceId,
|
|
301
|
+
expectedProjectId: ref.routingDomain,
|
|
302
|
+
});
|
|
303
|
+
return { ...outcome, routingDomain: outcome.projectId };
|
|
304
|
+
},
|
|
305
|
+
inspectDetachedRunner: (ref, suspension, options) =>
|
|
306
|
+
inspectDetachedVercelRunner({
|
|
307
|
+
name: ref.resourceId,
|
|
308
|
+
outputPath: suspension.outputPath,
|
|
309
|
+
exitCodePath: suspension.exitCodePath,
|
|
310
|
+
expectedProjectId: ref.routingDomain,
|
|
311
|
+
...(options?.skipCapturedOutput
|
|
312
|
+
? { skipCapturedOutput: true }
|
|
313
|
+
: {}),
|
|
314
|
+
}),
|
|
315
|
+
readWorkCompletedAt: (ref, path) =>
|
|
316
|
+
readDetachedVercelRuntimeCompletion({
|
|
317
|
+
name: ref.resourceId,
|
|
318
|
+
runtimeCompletedPath: path,
|
|
319
|
+
expectedProjectId: ref.routingDomain,
|
|
320
|
+
}),
|
|
321
|
+
},
|
|
277
322
|
],
|
|
278
323
|
});
|
package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { RuntimeSandboxProviderId } from '../runtime-sandbox-provider-profile';
|
|
2
|
+
|
|
1
3
|
export type SandboxCreateOutcome = 'succeeded' | 'failed' | 'unknown';
|
|
2
4
|
|
|
3
5
|
/**
|
|
@@ -8,7 +10,7 @@ export type SandboxCreateOutcome = 'succeeded' | 'failed' | 'unknown';
|
|
|
8
10
|
* `unknown` means the request outlived its client deadline and may still land.
|
|
9
11
|
*/
|
|
10
12
|
export function logSandboxCreateOutcome(input: {
|
|
11
|
-
provider:
|
|
13
|
+
provider: RuntimeSandboxProviderId;
|
|
12
14
|
outcome: SandboxCreateOutcome;
|
|
13
15
|
runId: string | null | undefined;
|
|
14
16
|
reason?: string | null;
|
|
@@ -11,7 +11,11 @@ import type {
|
|
|
11
11
|
} from '../protocol';
|
|
12
12
|
|
|
13
13
|
export type PlayRunnerRuntimeResource = {
|
|
14
|
-
kind:
|
|
14
|
+
kind:
|
|
15
|
+
| 'daytona_sandbox'
|
|
16
|
+
| 'modal_sandbox'
|
|
17
|
+
| 'agentcore_runtime_session'
|
|
18
|
+
| 'vercel_sandbox';
|
|
15
19
|
sandboxId: string;
|
|
16
20
|
/** Runtime estate that owns provider credentials and durable cleanup. */
|
|
17
21
|
runtimeEnvironment?: 'preview' | 'production';
|
|
@@ -26,6 +30,8 @@ export type PlayRunnerRuntimeResource = {
|
|
|
26
30
|
* the cleanup routing domain.
|
|
27
31
|
*/
|
|
28
32
|
agentcoreRuntimeArn?: string;
|
|
33
|
+
/** Stable, non-secret Vercel project that owns a `vercel_sandbox`. */
|
|
34
|
+
vercelProjectId?: string;
|
|
29
35
|
billingStartedAt: number;
|
|
30
36
|
billingEndedAt?: number | null;
|
|
31
37
|
/**
|
|
@@ -105,7 +111,7 @@ export type PlayRunnerRuntimeLifecycleEvent = {
|
|
|
105
111
|
* resource identity to cross the no-replay boundary.
|
|
106
112
|
*/
|
|
107
113
|
export type PlayRunnerCommandAcceptance = {
|
|
108
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime';
|
|
114
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel';
|
|
109
115
|
sandboxId: string;
|
|
110
116
|
};
|
|
111
117
|
|
|
@@ -218,7 +224,7 @@ export interface PlayRunnerCallbacks {
|
|
|
218
224
|
workerSlot?: PlayRunnerWorkerSlot;
|
|
219
225
|
/** Reserve one physical-sandbox slot immediately before a provider create. */
|
|
220
226
|
reserveSandboxCapacity?: (
|
|
221
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime',
|
|
227
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel',
|
|
222
228
|
providerAttempt?: number,
|
|
223
229
|
) => Promise<{
|
|
224
230
|
leaseId: string;
|
|
@@ -239,11 +245,11 @@ export interface PlayRunnerCallbacks {
|
|
|
239
245
|
* pre-code recovery outcome instead.
|
|
240
246
|
*/
|
|
241
247
|
shouldAttemptSandboxProvider?: (
|
|
242
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime',
|
|
248
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel',
|
|
243
249
|
) => Promise<{ allowed: boolean; probeToken: string | null }>;
|
|
244
250
|
/** A durably recorded resource may close only the probe that owns it. */
|
|
245
251
|
markSandboxProviderHealthy?: (
|
|
246
|
-
provider: 'daytona' | 'modal' | 'agentcore_runtime',
|
|
252
|
+
provider: 'daytona' | 'modal' | 'agentcore_runtime' | 'vercel',
|
|
247
253
|
probeToken: string | null,
|
|
248
254
|
) => Promise<void>;
|
|
249
255
|
/**
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { deployed, readDeployedObject } from '@deepline/deployed-contracts';
|
|
2
|
+
import {
|
|
3
|
+
isRuntimeSandboxProviderId,
|
|
4
|
+
type RuntimeSandboxProviderId,
|
|
5
|
+
} from './runtime-sandbox-provider-profile';
|
|
2
6
|
|
|
3
|
-
export type RuntimeSandboxProviderId
|
|
7
|
+
export type { RuntimeSandboxProviderId };
|
|
4
8
|
|
|
5
9
|
export type RuntimeSandboxRef = {
|
|
6
10
|
/** Internal normalized form; persisted writer markers are diagnostic only. */
|
|
@@ -48,7 +52,7 @@ export function readPersistedRuntimeSandboxRef(input: {
|
|
|
48
52
|
typeof value.resourceId === 'string' ? value.resourceId.trim() : '';
|
|
49
53
|
const routingDomain = value.routingDomain;
|
|
50
54
|
if (
|
|
51
|
-
(provider
|
|
55
|
+
!isRuntimeSandboxProviderId(provider) ||
|
|
52
56
|
!resourceId ||
|
|
53
57
|
resourceId !== input.expectedSandboxId.trim() ||
|
|
54
58
|
(routingDomain !== null && typeof routingDomain !== 'string') ||
|
|
@@ -66,3 +70,17 @@ export function readPersistedRuntimeSandboxRef(input: {
|
|
|
66
70
|
typeof routingDomain === 'string' ? routingDomain.trim() : null,
|
|
67
71
|
};
|
|
68
72
|
}
|
|
73
|
+
|
|
74
|
+
/** A new ref in its one internal normalized form. */
|
|
75
|
+
export function runtimeSandboxRef(input: {
|
|
76
|
+
provider: RuntimeSandboxProviderId;
|
|
77
|
+
resourceId: string;
|
|
78
|
+
routingDomain: string | null;
|
|
79
|
+
}): RuntimeSandboxRef {
|
|
80
|
+
return {
|
|
81
|
+
schemaVersion: 1,
|
|
82
|
+
provider: input.provider,
|
|
83
|
+
resourceId: input.resourceId,
|
|
84
|
+
routingDomain: input.routingDomain,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -1,14 +1,51 @@
|
|
|
1
1
|
import { PLAY_RUNTIME_BACKENDS, type PlayRuntimeBackendId } from './backend';
|
|
2
2
|
import { createHash } from 'node:crypto';
|
|
3
3
|
import { isIsolatedRuntimeSchedulerSchema } from './runtime-scheduler-topology';
|
|
4
|
+
import {
|
|
5
|
+
runtimeSandboxProviderCredentialEnv,
|
|
6
|
+
runtimeSandboxProviderProfile,
|
|
7
|
+
runtimeSandboxProvidersInCanonicalOrder,
|
|
8
|
+
type RuntimeSandboxProviderId,
|
|
9
|
+
} from './runtime-sandbox-provider-profile';
|
|
4
10
|
|
|
5
11
|
export const RUNTIME_SANDBOX_PROVIDERS = {
|
|
6
12
|
daytona: 'daytona',
|
|
7
13
|
modal: 'modal',
|
|
8
|
-
|
|
14
|
+
/** Preview-only: its profile does not support Production. */
|
|
15
|
+
vercel: 'vercel',
|
|
16
|
+
} as const satisfies Record<RuntimeSandboxProviderId, RuntimeSandboxProviderId>;
|
|
9
17
|
|
|
10
|
-
export type RuntimeSandboxProvider =
|
|
11
|
-
|
|
18
|
+
export type RuntimeSandboxProvider = RuntimeSandboxProviderId;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Credentials and cleanup ownership follow from the providers a policy may
|
|
22
|
+
* place on; the Provider Profile owns both facts.
|
|
23
|
+
*/
|
|
24
|
+
function placementPolicy(
|
|
25
|
+
policy: Omit<
|
|
26
|
+
RuntimeSandboxPlacementPolicy,
|
|
27
|
+
'requiredCredentialEnv' | 'cleanupProviders' | 'previewOnly'
|
|
28
|
+
>,
|
|
29
|
+
): RuntimeSandboxPlacementPolicy {
|
|
30
|
+
return {
|
|
31
|
+
...policy,
|
|
32
|
+
requiredCredentialEnv: runtimeSandboxProviderCredentialEnv(
|
|
33
|
+
policy.providers,
|
|
34
|
+
),
|
|
35
|
+
cleanupProviders: runtimeSandboxProvidersInCanonicalOrder(
|
|
36
|
+
policy.providers,
|
|
37
|
+
),
|
|
38
|
+
// A policy placing on any provider without Production support runs only
|
|
39
|
+
// on a Preview lane pinned to it.
|
|
40
|
+
...(policy.providers.every(
|
|
41
|
+
(provider) =>
|
|
42
|
+
runtimeSandboxProviderProfile(provider).capabilities.production
|
|
43
|
+
.supported,
|
|
44
|
+
)
|
|
45
|
+
? {}
|
|
46
|
+
: { previewOnly: true as const }),
|
|
47
|
+
};
|
|
48
|
+
}
|
|
12
49
|
|
|
13
50
|
/**
|
|
14
51
|
* Stable durable ids. Changing provider order or transition rules creates a
|
|
@@ -20,6 +57,7 @@ export const RUNTIME_SANDBOX_PLACEMENT_POLICIES = {
|
|
|
20
57
|
daytonaModalCanaryV1: 'daytona_modal_canary@1',
|
|
21
58
|
modalOnlyV1: 'modal_only@1',
|
|
22
59
|
modalThenDaytonaV1: 'modal_then_daytona@1',
|
|
60
|
+
vercelSandboxOnlyV1: 'vercel_sandbox_only@1',
|
|
23
61
|
} as const;
|
|
24
62
|
|
|
25
63
|
/** Deployment-scoped policy selection for an isolated runtime lane. */
|
|
@@ -49,6 +87,12 @@ export type RuntimeSandboxPlacementPolicy = Readonly<{
|
|
|
49
87
|
transitions: readonly RuntimeSandboxPlacementTransition[];
|
|
50
88
|
requiredCredentialEnv: readonly string[];
|
|
51
89
|
cleanupProviders: readonly RuntimeSandboxProvider[];
|
|
90
|
+
/**
|
|
91
|
+
* Runs only on a worker lane pinned to this exact policy, in Preview. It is
|
|
92
|
+
* never an operator default, never part of an unpinned worker's catalog, and
|
|
93
|
+
* a launch writer refuses it in Production.
|
|
94
|
+
*/
|
|
95
|
+
previewOnly?: true;
|
|
52
96
|
canary?: Readonly<{
|
|
53
97
|
provider: RuntimeSandboxProvider;
|
|
54
98
|
basisPoints: number;
|
|
@@ -102,7 +146,7 @@ export function selectRuntimeSandboxCanary(input: {
|
|
|
102
146
|
};
|
|
103
147
|
}
|
|
104
148
|
|
|
105
|
-
const DAYTONA_THEN_MODAL_V1
|
|
149
|
+
const DAYTONA_THEN_MODAL_V1 = placementPolicy({
|
|
106
150
|
id: RUNTIME_SANDBOX_PLACEMENT_POLICIES.daytonaThenModalV1,
|
|
107
151
|
compatibilityRuntimeBackend: PLAY_RUNTIME_BACKENDS.daytona,
|
|
108
152
|
providers: [
|
|
@@ -120,16 +164,7 @@ const DAYTONA_THEN_MODAL_V1: RuntimeSandboxPlacementPolicy = {
|
|
|
120
164
|
],
|
|
121
165
|
},
|
|
122
166
|
],
|
|
123
|
-
|
|
124
|
-
'DAYTONA_API_KEY',
|
|
125
|
-
'MODAL_TOKEN_ID',
|
|
126
|
-
'MODAL_TOKEN_SECRET',
|
|
127
|
-
],
|
|
128
|
-
cleanupProviders: [
|
|
129
|
-
RUNTIME_SANDBOX_PROVIDERS.daytona,
|
|
130
|
-
RUNTIME_SANDBOX_PROVIDERS.modal,
|
|
131
|
-
],
|
|
132
|
-
};
|
|
167
|
+
});
|
|
133
168
|
|
|
134
169
|
/**
|
|
135
170
|
* Staged Daytona-compatible policy. Workers learn this policy before launch
|
|
@@ -152,23 +187,19 @@ const DAYTONA_MODAL_CANARY_V1: RuntimeSandboxPlacementPolicy = {
|
|
|
152
187
|
* Frozen compatibility policy for launches written before placement policy ids
|
|
153
188
|
* existed. It is retained until every pre-policy release lane has drained.
|
|
154
189
|
*/
|
|
155
|
-
const DAYTONA_ONLY_V1
|
|
190
|
+
const DAYTONA_ONLY_V1 = placementPolicy({
|
|
156
191
|
id: RUNTIME_SANDBOX_PLACEMENT_POLICIES.daytonaOnlyV1,
|
|
157
192
|
compatibilityRuntimeBackend: PLAY_RUNTIME_BACKENDS.daytona,
|
|
158
193
|
providers: [RUNTIME_SANDBOX_PROVIDERS.daytona],
|
|
159
194
|
transitions: [],
|
|
160
|
-
|
|
161
|
-
cleanupProviders: [RUNTIME_SANDBOX_PROVIDERS.daytona],
|
|
162
|
-
};
|
|
195
|
+
});
|
|
163
196
|
|
|
164
|
-
const MODAL_ONLY_V1
|
|
197
|
+
const MODAL_ONLY_V1 = placementPolicy({
|
|
165
198
|
id: RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalOnlyV1,
|
|
166
199
|
compatibilityRuntimeBackend: PLAY_RUNTIME_BACKENDS.modal,
|
|
167
200
|
providers: [RUNTIME_SANDBOX_PROVIDERS.modal],
|
|
168
201
|
transitions: [],
|
|
169
|
-
|
|
170
|
-
cleanupProviders: [RUNTIME_SANDBOX_PROVIDERS.modal],
|
|
171
|
-
};
|
|
202
|
+
});
|
|
172
203
|
|
|
173
204
|
/**
|
|
174
205
|
* Modal first, for when Daytona is unhealthy. It runs on the Daytona lane and
|
|
@@ -178,7 +209,7 @@ const MODAL_ONLY_V1: RuntimeSandboxPlacementPolicy = {
|
|
|
178
209
|
* a cleanup obligation and never runs the Play. Any later Modal failure stays
|
|
179
210
|
* on Modal.
|
|
180
211
|
*/
|
|
181
|
-
const MODAL_THEN_DAYTONA_V1
|
|
212
|
+
const MODAL_THEN_DAYTONA_V1 = placementPolicy({
|
|
182
213
|
id: RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalThenDaytonaV1,
|
|
183
214
|
compatibilityRuntimeBackend: PLAY_RUNTIME_BACKENDS.daytona,
|
|
184
215
|
providers: [
|
|
@@ -193,16 +224,20 @@ const MODAL_THEN_DAYTONA_V1: RuntimeSandboxPlacementPolicy = {
|
|
|
193
224
|
reasons: ['provider_capacity_exhausted'],
|
|
194
225
|
},
|
|
195
226
|
],
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Vercel Sandbox, Preview only (its Provider Profile has no Production
|
|
231
|
+
* support). It runs on the Modal logical lane (same artifact and worker image)
|
|
232
|
+
* but never touches Modal: its only provider is Vercel Sandbox. It uses the
|
|
233
|
+
* shared capacity ledger, operation ledger and durable cleanup like the others.
|
|
234
|
+
*/
|
|
235
|
+
const VERCEL_SANDBOX_ONLY_V1 = placementPolicy({
|
|
236
|
+
id: RUNTIME_SANDBOX_PLACEMENT_POLICIES.vercelSandboxOnlyV1,
|
|
237
|
+
compatibilityRuntimeBackend: PLAY_RUNTIME_BACKENDS.modal,
|
|
238
|
+
providers: [RUNTIME_SANDBOX_PROVIDERS.vercel],
|
|
239
|
+
transitions: [],
|
|
240
|
+
});
|
|
206
241
|
|
|
207
242
|
export const RUNTIME_SANDBOX_PLACEMENT_POLICY_CATALOG: Readonly<
|
|
208
243
|
Record<RuntimeSandboxPlacementPolicyId, RuntimeSandboxPlacementPolicy>
|
|
@@ -215,6 +250,8 @@ export const RUNTIME_SANDBOX_PLACEMENT_POLICY_CATALOG: Readonly<
|
|
|
215
250
|
[RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalOnlyV1]: MODAL_ONLY_V1,
|
|
216
251
|
[RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalThenDaytonaV1]:
|
|
217
252
|
MODAL_THEN_DAYTONA_V1,
|
|
253
|
+
[RUNTIME_SANDBOX_PLACEMENT_POLICIES.vercelSandboxOnlyV1]:
|
|
254
|
+
VERCEL_SANDBOX_ONLY_V1,
|
|
218
255
|
};
|
|
219
256
|
|
|
220
257
|
export function resolveRuntimeSandboxPlacementPolicy(
|
|
@@ -278,7 +315,7 @@ export function operatorDefaultRuntimeSandboxPlacementPolicyIds(
|
|
|
278
315
|
backend: PlayRuntimeBackendId,
|
|
279
316
|
): readonly RuntimeSandboxPlacementPolicyId[] {
|
|
280
317
|
return runtimeSandboxPlacementPoliciesForBackend(backend)
|
|
281
|
-
.filter((policy) => policy !== DAYTONA_ONLY_V1)
|
|
318
|
+
.filter((policy) => policy !== DAYTONA_ONLY_V1 && !policy.previewOnly)
|
|
282
319
|
.map((policy) => policy.id);
|
|
283
320
|
}
|
|
284
321
|
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime Sandbox Provider Profile: the one place that says what a placement
|
|
3
|
+
* sandbox provider (Daytona, Modal, Vercel Sandbox) is and what it supports. AgentCore runtime
|
|
4
|
+
* sessions are not placement providers and are deliberately outside it.
|
|
5
|
+
*
|
|
6
|
+
* Placement policies derive their credentials and cleanup ownership from these
|
|
7
|
+
* profiles, and a worker lane is refused at boot when a provider it would
|
|
8
|
+
* place on lacks a capability the lane needs. A provider that does not support
|
|
9
|
+
* something says so here, with a reason, instead of a runtime branch deciding
|
|
10
|
+
* it mid-run.
|
|
11
|
+
*
|
|
12
|
+
* Pure data: no provider SDK, scheduler or app imports.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export type RuntimeSandboxProviderSupport =
|
|
16
|
+
| Readonly<{ supported: true }>
|
|
17
|
+
| Readonly<{ supported: false; reason: string }>;
|
|
18
|
+
|
|
19
|
+
const SUPPORTED: RuntimeSandboxProviderSupport = { supported: true };
|
|
20
|
+
|
|
21
|
+
function unsupported(reason: string): RuntimeSandboxProviderSupport {
|
|
22
|
+
return { supported: false, reason };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Capabilities a lane can require. Each is owned by a shared Module; the
|
|
27
|
+
* provider only declares whether its Adapter plugs into it.
|
|
28
|
+
*/
|
|
29
|
+
export type RuntimeSandboxProviderCapability =
|
|
30
|
+
/** Customer runs in Production. */
|
|
31
|
+
| 'production'
|
|
32
|
+
/** The shared per-org capacity ledger and provider operation ledger. */
|
|
33
|
+
| 'capacityLedger'
|
|
34
|
+
/** The shared durable cleanup jobs and the reconciliation registry. */
|
|
35
|
+
| 'durableCleanup'
|
|
36
|
+
/** The shared compute billing session (`compute_billing_jobs_v2`). */
|
|
37
|
+
| 'computeBilling'
|
|
38
|
+
/** Fleet orphan enumeration of every sandbox the provider holds for us. */
|
|
39
|
+
| 'orphanEnumeration'
|
|
40
|
+
/** The hash-verified prebuilt runner image (`baked-runner-image.ts`). */
|
|
41
|
+
| 'bakedRunner'
|
|
42
|
+
/** Early sandbox start at admission (E2). */
|
|
43
|
+
| 'earlyStart'
|
|
44
|
+
/** Pre-booting the runner in an early sandbox (PB). */
|
|
45
|
+
| 'preboot'
|
|
46
|
+
/** Early-sandbox claim affinity (CA/CAR). */
|
|
47
|
+
| 'claimAffinity'
|
|
48
|
+
/** An egress CIDR allowlist, required before Production. */
|
|
49
|
+
| 'egressAllowlist';
|
|
50
|
+
|
|
51
|
+
export const RUNTIME_SANDBOX_PROVIDER_CAPABILITIES = [
|
|
52
|
+
'production',
|
|
53
|
+
'capacityLedger',
|
|
54
|
+
'durableCleanup',
|
|
55
|
+
'computeBilling',
|
|
56
|
+
'orphanEnumeration',
|
|
57
|
+
'bakedRunner',
|
|
58
|
+
'earlyStart',
|
|
59
|
+
'preboot',
|
|
60
|
+
'claimAffinity',
|
|
61
|
+
'egressAllowlist',
|
|
62
|
+
] as const satisfies readonly RuntimeSandboxProviderCapability[];
|
|
63
|
+
|
|
64
|
+
export type RuntimeSandboxProviderProfile = Readonly<{
|
|
65
|
+
provider: string;
|
|
66
|
+
/** `PlayRunnerRuntimeResource.kind` this provider's resource facts carry. */
|
|
67
|
+
resourceKind: string;
|
|
68
|
+
/** Worker-only credentials a lane must hold to place on this provider. */
|
|
69
|
+
credentialEnv: readonly string[];
|
|
70
|
+
capabilities: Readonly<
|
|
71
|
+
Record<RuntimeSandboxProviderCapability, RuntimeSandboxProviderSupport>
|
|
72
|
+
>;
|
|
73
|
+
}>;
|
|
74
|
+
|
|
75
|
+
const DAYTONA_PROFILE = {
|
|
76
|
+
provider: 'daytona',
|
|
77
|
+
resourceKind: 'daytona_sandbox',
|
|
78
|
+
credentialEnv: ['DAYTONA_API_KEY'],
|
|
79
|
+
capabilities: {
|
|
80
|
+
production: SUPPORTED,
|
|
81
|
+
capacityLedger: SUPPORTED,
|
|
82
|
+
durableCleanup: SUPPORTED,
|
|
83
|
+
computeBilling: SUPPORTED,
|
|
84
|
+
orphanEnumeration: SUPPORTED,
|
|
85
|
+
bakedRunner: unsupported(
|
|
86
|
+
'The Daytona Adapter never plans a baked launch; it always uploads the runner bundle.',
|
|
87
|
+
),
|
|
88
|
+
earlyStart: unsupported(
|
|
89
|
+
'Early sandbox start is implemented only in the Modal Adapter.',
|
|
90
|
+
),
|
|
91
|
+
preboot: unsupported(
|
|
92
|
+
'Runner pre-boot is implemented only in the Modal Adapter.',
|
|
93
|
+
),
|
|
94
|
+
claimAffinity: unsupported(
|
|
95
|
+
'Claim affinity follows an early sandbox, which Daytona does not start.',
|
|
96
|
+
),
|
|
97
|
+
egressAllowlist: SUPPORTED,
|
|
98
|
+
},
|
|
99
|
+
} as const satisfies RuntimeSandboxProviderProfile;
|
|
100
|
+
|
|
101
|
+
const MODAL_PROFILE = {
|
|
102
|
+
provider: 'modal',
|
|
103
|
+
resourceKind: 'modal_sandbox',
|
|
104
|
+
credentialEnv: ['MODAL_TOKEN_ID', 'MODAL_TOKEN_SECRET'],
|
|
105
|
+
capabilities: {
|
|
106
|
+
production: SUPPORTED,
|
|
107
|
+
capacityLedger: SUPPORTED,
|
|
108
|
+
durableCleanup: SUPPORTED,
|
|
109
|
+
computeBilling: SUPPORTED,
|
|
110
|
+
orphanEnumeration: unsupported(
|
|
111
|
+
'The Fleet Sandbox Sweep enumerates only unadopted early Modal sandboxes (by their early-start tags); every other Modal sandbox relies on durable cleanup and the sandbox lifetime.',
|
|
112
|
+
),
|
|
113
|
+
bakedRunner: SUPPORTED,
|
|
114
|
+
earlyStart: SUPPORTED,
|
|
115
|
+
preboot: SUPPORTED,
|
|
116
|
+
claimAffinity: SUPPORTED,
|
|
117
|
+
egressAllowlist: SUPPORTED,
|
|
118
|
+
},
|
|
119
|
+
} as const satisfies RuntimeSandboxProviderProfile;
|
|
120
|
+
|
|
121
|
+
/** Canonical order: credentials and cleanup ownership are listed in it. */
|
|
122
|
+
const VERCEL_PROFILE = {
|
|
123
|
+
provider: 'vercel',
|
|
124
|
+
resourceKind: 'vercel_sandbox',
|
|
125
|
+
credentialEnv: ['VERCEL_SANDBOX_TOKEN'],
|
|
126
|
+
capabilities: {
|
|
127
|
+
production: unsupported(
|
|
128
|
+
'Vercel Sandbox is a Preview-only experiment: Production placement needs owner approval, priced compute billing and a Sandbox-scoped credential.',
|
|
129
|
+
),
|
|
130
|
+
capacityLedger: SUPPORTED,
|
|
131
|
+
durableCleanup: SUPPORTED,
|
|
132
|
+
computeBilling: unsupported(
|
|
133
|
+
'No Vercel Sandbox compute price is approved; its sandboxes are not billed.',
|
|
134
|
+
),
|
|
135
|
+
orphanEnumeration: unsupported(
|
|
136
|
+
'Every Vercel sandbox name is recorded before create, so durable cleanup owns it; fleet enumeration is not wired.',
|
|
137
|
+
),
|
|
138
|
+
bakedRunner: SUPPORTED,
|
|
139
|
+
earlyStart: unsupported(
|
|
140
|
+
'Early sandbox start is implemented only in the Modal Adapter.',
|
|
141
|
+
),
|
|
142
|
+
preboot: unsupported(
|
|
143
|
+
'Runner pre-boot is implemented only in the Modal Adapter.',
|
|
144
|
+
),
|
|
145
|
+
claimAffinity: unsupported(
|
|
146
|
+
'Claim affinity follows an early sandbox, which Vercel does not start.',
|
|
147
|
+
),
|
|
148
|
+
egressAllowlist: SUPPORTED,
|
|
149
|
+
},
|
|
150
|
+
} as const satisfies RuntimeSandboxProviderProfile;
|
|
151
|
+
|
|
152
|
+
export const RUNTIME_SANDBOX_PROVIDER_PROFILES = [
|
|
153
|
+
DAYTONA_PROFILE,
|
|
154
|
+
MODAL_PROFILE,
|
|
155
|
+
VERCEL_PROFILE,
|
|
156
|
+
] as const;
|
|
157
|
+
|
|
158
|
+
export type RuntimeSandboxProviderId =
|
|
159
|
+
(typeof RUNTIME_SANDBOX_PROVIDER_PROFILES)[number]['provider'];
|
|
160
|
+
|
|
161
|
+
export type RuntimeSandboxResourceKind =
|
|
162
|
+
(typeof RUNTIME_SANDBOX_PROVIDER_PROFILES)[number]['resourceKind'];
|
|
163
|
+
|
|
164
|
+
export const RUNTIME_SANDBOX_PROVIDER_IDS: readonly RuntimeSandboxProviderId[] =
|
|
165
|
+
RUNTIME_SANDBOX_PROVIDER_PROFILES.map((profile) => profile.provider);
|
|
166
|
+
|
|
167
|
+
export function isRuntimeSandboxProviderId(
|
|
168
|
+
value: unknown,
|
|
169
|
+
): value is RuntimeSandboxProviderId {
|
|
170
|
+
return (
|
|
171
|
+
typeof value === 'string' &&
|
|
172
|
+
(RUNTIME_SANDBOX_PROVIDER_IDS as readonly string[]).includes(value)
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function runtimeSandboxProviderProfile(
|
|
177
|
+
provider: RuntimeSandboxProviderId,
|
|
178
|
+
): RuntimeSandboxProviderProfile {
|
|
179
|
+
const profile = RUNTIME_SANDBOX_PROVIDER_PROFILES.find(
|
|
180
|
+
(candidate) => candidate.provider === provider,
|
|
181
|
+
);
|
|
182
|
+
if (!profile) {
|
|
183
|
+
throw new Error(`Unknown runtime sandbox provider "${String(provider)}".`);
|
|
184
|
+
}
|
|
185
|
+
return profile;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** The given providers, deduplicated, in canonical profile order. */
|
|
189
|
+
export function runtimeSandboxProvidersInCanonicalOrder(
|
|
190
|
+
providers: readonly RuntimeSandboxProviderId[],
|
|
191
|
+
): RuntimeSandboxProviderId[] {
|
|
192
|
+
return RUNTIME_SANDBOX_PROVIDER_IDS.filter((id) => providers.includes(id));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/** Credentials for a set of providers, deduplicated, in canonical order. */
|
|
196
|
+
export function runtimeSandboxProviderCredentialEnv(
|
|
197
|
+
providers: readonly RuntimeSandboxProviderId[],
|
|
198
|
+
): string[] {
|
|
199
|
+
return [
|
|
200
|
+
...new Set(
|
|
201
|
+
runtimeSandboxProvidersInCanonicalOrder(providers).flatMap(
|
|
202
|
+
(provider) => runtimeSandboxProviderProfile(provider).credentialEnv,
|
|
203
|
+
),
|
|
204
|
+
),
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* What a worker lane needs from every provider it may place on. Production
|
|
210
|
+
* lanes need the shared capacity, cleanup and billing owners; an `enforce`
|
|
211
|
+
* capacity lane needs the ledger.
|
|
212
|
+
*/
|
|
213
|
+
export function runtimeSandboxLaneRequiredCapabilities(lane: {
|
|
214
|
+
environment: 'preview' | 'production';
|
|
215
|
+
capacityAdmission: 'observe' | 'enforce';
|
|
216
|
+
}): RuntimeSandboxProviderCapability[] {
|
|
217
|
+
const required = new Set<RuntimeSandboxProviderCapability>();
|
|
218
|
+
if (lane.environment === 'production') {
|
|
219
|
+
required.add('production');
|
|
220
|
+
required.add('capacityLedger');
|
|
221
|
+
required.add('durableCleanup');
|
|
222
|
+
required.add('computeBilling');
|
|
223
|
+
}
|
|
224
|
+
if (lane.capacityAdmission === 'enforce') required.add('capacityLedger');
|
|
225
|
+
return RUNTIME_SANDBOX_PROVIDER_CAPABILITIES.filter((capability) =>
|
|
226
|
+
required.has(capability),
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export type RuntimeSandboxCapabilityShortfall = Readonly<{
|
|
231
|
+
provider: RuntimeSandboxProviderId;
|
|
232
|
+
capability: RuntimeSandboxProviderCapability;
|
|
233
|
+
reason: string;
|
|
234
|
+
}>;
|
|
235
|
+
|
|
236
|
+
export function runtimeSandboxCapabilityShortfalls(input: {
|
|
237
|
+
providers: readonly RuntimeSandboxProviderId[];
|
|
238
|
+
required: readonly RuntimeSandboxProviderCapability[];
|
|
239
|
+
}): RuntimeSandboxCapabilityShortfall[] {
|
|
240
|
+
const shortfalls: RuntimeSandboxCapabilityShortfall[] = [];
|
|
241
|
+
for (const provider of runtimeSandboxProvidersInCanonicalOrder(
|
|
242
|
+
input.providers,
|
|
243
|
+
)) {
|
|
244
|
+
const profile = runtimeSandboxProviderProfile(provider);
|
|
245
|
+
for (const capability of input.required) {
|
|
246
|
+
const support = profile.capabilities[capability];
|
|
247
|
+
// `in` narrows under every tsconfig, including non-strict ones.
|
|
248
|
+
if ('reason' in support) {
|
|
249
|
+
shortfalls.push({ provider, capability, reason: support.reason });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return shortfalls;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export class RuntimeSandboxCapabilityUnsupportedError extends Error {
|
|
257
|
+
constructor(
|
|
258
|
+
readonly subject: string,
|
|
259
|
+
readonly shortfalls: readonly RuntimeSandboxCapabilityShortfall[],
|
|
260
|
+
) {
|
|
261
|
+
super(
|
|
262
|
+
`${subject} needs sandbox capabilities its providers do not support: ${shortfalls
|
|
263
|
+
.map(
|
|
264
|
+
(shortfall) =>
|
|
265
|
+
`${shortfall.provider} lacks ${shortfall.capability} (${shortfall.reason})`,
|
|
266
|
+
)
|
|
267
|
+
.join('; ')}.`,
|
|
268
|
+
);
|
|
269
|
+
this.name = 'RuntimeSandboxCapabilityUnsupportedError';
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Fails loudly, before any run, when a provider lacks a required capability. */
|
|
274
|
+
export function assertRuntimeSandboxProvidersSupport(input: {
|
|
275
|
+
subject: string;
|
|
276
|
+
providers: readonly RuntimeSandboxProviderId[];
|
|
277
|
+
required: readonly RuntimeSandboxProviderCapability[];
|
|
278
|
+
}): void {
|
|
279
|
+
const shortfalls = runtimeSandboxCapabilityShortfalls(input);
|
|
280
|
+
if (shortfalls.length > 0) {
|
|
281
|
+
throw new RuntimeSandboxCapabilityUnsupportedError(
|
|
282
|
+
input.subject,
|
|
283
|
+
shortfalls,
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PlayRunnerDaytonaCleanupIntent } from '../runner-backends/types';
|
|
2
|
+
import type { RuntimeSandboxProviderId } from '../runtime-sandbox-provider-profile';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Sandbox Runs is the portable lifecycle boundary around a physical execution
|
|
@@ -17,6 +18,7 @@ export type SandboxProvider =
|
|
|
17
18
|
| 'daytona'
|
|
18
19
|
| 'modal'
|
|
19
20
|
| 'agentcore_runtime'
|
|
21
|
+
| 'vercel'
|
|
20
22
|
| 'local';
|
|
21
23
|
|
|
22
24
|
/** A portable, credential-free description of one execution resource. */
|
|
@@ -199,6 +201,7 @@ export type SandboxExecutionResource = SandboxRunResource & {
|
|
|
199
201
|
| 'daytona_sandbox'
|
|
200
202
|
| 'modal_sandbox'
|
|
201
203
|
| 'agentcore_runtime_session'
|
|
204
|
+
| 'vercel_sandbox'
|
|
202
205
|
| 'local_process';
|
|
203
206
|
runtimeEnvironment?: 'preview' | 'production';
|
|
204
207
|
billingEndedAtMs?: number | null;
|
|
@@ -221,7 +224,7 @@ export type SandboxCreateIntent = {
|
|
|
221
224
|
};
|
|
222
225
|
|
|
223
226
|
export type SandboxProviderLifecycleEvent = {
|
|
224
|
-
provider:
|
|
227
|
+
provider: RuntimeSandboxProviderId;
|
|
225
228
|
type: 'create_call_started' | 'create_call_succeeded' | 'create_call_failed';
|
|
226
229
|
providerAttempt: number;
|
|
227
230
|
occurredAtMs: number;
|