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
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts
CHANGED
|
@@ -91,7 +91,7 @@ const RUNTIME_EVENT_LOG_POSITION_EXPRESSION = `jsonb_set(
|
|
|
91
91
|
// Migration readiness tracks this projection body independently of scheduler
|
|
92
92
|
// wire and schema versions. Bump when a changed trigger must be reinstalled.
|
|
93
93
|
export const RUNTIME_EVENT_SEARCH_OUTBOX_PROJECTION_MARKER =
|
|
94
|
-
'runtime-event-search-epoch-resume-lifecycle-reuse';
|
|
94
|
+
'runtime-event-search-epoch-resume-lifecycle-reuse-dataset-columns';
|
|
95
95
|
/** Trusted trigger-authored state; absent on already-projected legacy rows. */
|
|
96
96
|
export const RUNTIME_EVENT_DEFERRED_PROJECTION_FIELD =
|
|
97
97
|
'_runtimeSearchProjectionPending';
|
|
@@ -3563,7 +3563,7 @@ export async function attachRuntimeEventSearchTriggers(
|
|
|
3563
3563
|
'tableNamespace', value->'tableNamespace', 'phase', value->'phase',
|
|
3564
3564
|
'persistedRows', value->'persistedRows', 'succeededRows', value->'succeededRows',
|
|
3565
3565
|
'failedRows', value->'failedRows', 'complete', value->'complete',
|
|
3566
|
-
'bornFrom', value->'bornFrom')
|
|
3566
|
+
'bornFrom', value->'bornFrom', 'columns', value->'columns')
|
|
3567
3567
|
WHEN ${RUN_EVENT_KIND_SQL_LITERAL.activityObserved} THEN jsonb_build_object(
|
|
3568
3568
|
'observation', value->'observation')
|
|
3569
3569
|
WHEN ${RUN_EVENT_KIND_SQL_LITERAL.workCounters} THEN jsonb_build_object(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MANAGED_SANDBOX_RESOURCE_KIND_LIST_SQL } from './managed-sandbox-resource-sql';
|
|
1
2
|
import { createHash, randomUUID } from 'node:crypto';
|
|
2
3
|
import {
|
|
3
4
|
withRuntimeSchedulerClient,
|
|
@@ -1589,7 +1590,7 @@ export async function readRuntimeSandboxCapacityTestEvidence(
|
|
|
1589
1590
|
CROSS JOIN LATERAL jsonb_array_elements(CASE
|
|
1590
1591
|
WHEN jsonb_typeof(attempt.resource_json) = 'array' THEN attempt.resource_json
|
|
1591
1592
|
WHEN attempt.resource_json IS NULL THEN '[]'::jsonb ELSE jsonb_build_array(attempt.resource_json) END) AS resource
|
|
1592
|
-
WHERE attempt.run_id = owned_run.run_id AND resource->>'kind' IN
|
|
1593
|
+
WHERE attempt.run_id = owned_run.run_id AND resource->>'kind' IN ${MANAGED_SANDBOX_RESOURCE_KIND_LIST_SQL}
|
|
1593
1594
|
AND NULLIF(resource->>'sandboxId', '') IS NOT NULL),
|
|
1594
1595
|
'computeJobStatus', (SELECT status FROM ${schema}."compute_billing_jobs_v2" AS job WHERE job.run_id = owned_run.run_id),
|
|
1595
1596
|
'firstAcquiredAtMs', (SELECT floor(extract(epoch FROM min(provider_created_at)) * 1000)::bigint FROM owned_operations),
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MANAGED_SANDBOX_RESOURCE_KIND_LIST_SQL,
|
|
3
|
+
managedSandboxProviderSql,
|
|
4
|
+
managedSandboxRoutingDomainSql,
|
|
5
|
+
} from './managed-sandbox-resource-sql';
|
|
1
6
|
import type {
|
|
2
7
|
PostgresSchedulerOptions,
|
|
3
8
|
PostgresSchedulerQueryClient,
|
|
@@ -264,11 +269,9 @@ async function previewRuntimeSandboxOperationBackfillPage(
|
|
|
264
269
|
WITH candidates AS (
|
|
265
270
|
SELECT attempt.run_id, attempt.attempt, attempt.updated_at,
|
|
266
271
|
resource.ordinal::integer AS resource_ordinal,
|
|
267
|
-
|
|
272
|
+
${managedSandboxProviderSql("resource.value->>'kind'")} AS provider,
|
|
268
273
|
resource.value->>'sandboxId' AS sandbox_id,
|
|
269
|
-
coalesce(
|
|
270
|
-
WHEN 'modal_sandbox' THEN NULLIF(resource.value->>'modalAppId', '')
|
|
271
|
-
ELSE NULLIF(resource.value->>'daytonaOrganizationId', '') END, '')
|
|
274
|
+
coalesce(${managedSandboxRoutingDomainSql('resource.value')}, '')
|
|
272
275
|
AS routing_domain_key
|
|
273
276
|
FROM ${attempts} AS attempt
|
|
274
277
|
CROSS JOIN LATERAL jsonb_array_elements(
|
|
@@ -276,7 +279,7 @@ async function previewRuntimeSandboxOperationBackfillPage(
|
|
|
276
279
|
THEN attempt.resource_json ELSE jsonb_build_array(attempt.resource_json) END
|
|
277
280
|
) WITH ORDINALITY AS resource(value, ordinal)
|
|
278
281
|
WHERE attempt.resource_json IS NOT NULL
|
|
279
|
-
AND resource.value->>'kind' IN
|
|
282
|
+
AND resource.value->>'kind' IN ${MANAGED_SANDBOX_RESOURCE_KIND_LIST_SQL}
|
|
280
283
|
AND NULLIF(resource.value->>'sandboxId', '') IS NOT NULL
|
|
281
284
|
AND ($1::text IS NULL OR
|
|
282
285
|
(attempt.updated_at, attempt.run_id, attempt.attempt, resource.ordinal) >
|
|
@@ -308,8 +311,6 @@ async function previewRuntimeSandboxOperationBackfillPage(
|
|
|
308
311
|
input.cursor?.attempt ?? 0,
|
|
309
312
|
input.cursor?.resourceOrdinal ?? 0,
|
|
310
313
|
limit + 1,
|
|
311
|
-
RuntimeSandboxProvider.Modal,
|
|
312
|
-
RuntimeSandboxProvider.Daytona,
|
|
313
314
|
],
|
|
314
315
|
);
|
|
315
316
|
const hasMore = page.rows.length > limit;
|
|
@@ -740,13 +741,10 @@ export async function backfillRuntimeSandboxOperationsFromAttemptResources(
|
|
|
740
741
|
WITH resources AS MATERIALIZED (
|
|
741
742
|
SELECT attempt.run_id, attempt.attempt, attempt.updated_at, run.org_id,
|
|
742
743
|
resource.value AS resource, resource.ordinal::integer AS resource_ordinal,
|
|
743
|
-
|
|
744
|
-
WHEN 'modal_sandbox' THEN 'modal' ELSE 'daytona' END AS provider,
|
|
744
|
+
${managedSandboxProviderSql("resource.value->>'kind'")} AS provider,
|
|
745
745
|
COALESCE(NULLIF(resource.value->>'runtimeEnvironment', ''),
|
|
746
746
|
NULLIF(resource.value->>'daytonaEnvironment', ''), 'production') AS environment,
|
|
747
|
-
|
|
748
|
-
WHEN 'modal_sandbox' THEN NULLIF(resource.value->>'modalAppId', '')
|
|
749
|
-
ELSE NULLIF(resource.value->>'daytonaOrganizationId', '') END AS routing_domain
|
|
747
|
+
${managedSandboxRoutingDomainSql('resource.value')} AS routing_domain
|
|
750
748
|
FROM ${attempts} AS attempt
|
|
751
749
|
JOIN ${runs} AS run ON run.run_id = attempt.run_id
|
|
752
750
|
CROSS JOIN LATERAL jsonb_array_elements(
|
|
@@ -754,7 +752,7 @@ export async function backfillRuntimeSandboxOperationsFromAttemptResources(
|
|
|
754
752
|
THEN attempt.resource_json ELSE jsonb_build_array(attempt.resource_json) END
|
|
755
753
|
) WITH ORDINALITY AS resource(value, ordinal)
|
|
756
754
|
WHERE attempt.resource_json IS NOT NULL
|
|
757
|
-
AND resource.value->>'kind' IN
|
|
755
|
+
AND resource.value->>'kind' IN ${MANAGED_SANDBOX_RESOURCE_KIND_LIST_SQL}
|
|
758
756
|
AND NULLIF(resource.value->>'sandboxId', '') IS NOT NULL
|
|
759
757
|
AND ($7::jsonb IS NULL OR attempt.run_id IN (
|
|
760
758
|
SELECT target.run_id FROM jsonb_to_recordset($7::jsonb) AS target(run_id text)
|
|
@@ -16,6 +16,8 @@ export enum RuntimeSandboxOperationState {
|
|
|
16
16
|
export enum RuntimeSandboxProvider {
|
|
17
17
|
Daytona = 'daytona',
|
|
18
18
|
Modal = 'modal',
|
|
19
|
+
/** Preview-only; admitted by the v68 provider checks. */
|
|
20
|
+
Vercel = 'vercel',
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
export type RuntimeSandboxOperationReserved = {
|
|
@@ -195,9 +197,7 @@ export function runtimeSandboxOperationFromStates(
|
|
|
195
197
|
const states = (
|
|
196
198
|
RUNTIME_SANDBOX_OPERATION_STATE_TRANSITIONS[transition]
|
|
197
199
|
.from as readonly RuntimeSandboxOperationTransitionSource[]
|
|
198
|
-
).filter(
|
|
199
|
-
(state): state is RuntimeSandboxOperationState => state !== ABSENT,
|
|
200
|
-
);
|
|
200
|
+
).filter((state): state is RuntimeSandboxOperationState => state !== ABSENT);
|
|
201
201
|
if (states.length === 0) {
|
|
202
202
|
throw new Error(
|
|
203
203
|
`Sandbox operation transition ${transition} only inserts; it has no from-state.`,
|
|
@@ -351,10 +351,45 @@ export function decodeRuntimeSandboxOperation(
|
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
export type ManagedSandboxResourceKind =
|
|
355
|
+
| 'daytona_sandbox'
|
|
356
|
+
| 'modal_sandbox'
|
|
357
|
+
| 'vercel_sandbox';
|
|
358
|
+
|
|
354
359
|
export function runtimeSandboxProviderForResourceKind(
|
|
355
|
-
kind:
|
|
360
|
+
kind: ManagedSandboxResourceKind,
|
|
356
361
|
): RuntimeSandboxProvider {
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
362
|
+
switch (kind) {
|
|
363
|
+
case 'daytona_sandbox':
|
|
364
|
+
return RuntimeSandboxProvider.Daytona;
|
|
365
|
+
case 'modal_sandbox':
|
|
366
|
+
return RuntimeSandboxProvider.Modal;
|
|
367
|
+
case 'vercel_sandbox':
|
|
368
|
+
return RuntimeSandboxProvider.Vercel;
|
|
369
|
+
default:
|
|
370
|
+
throw new Error(
|
|
371
|
+
`Unknown managed sandbox resource kind: ${String(kind)}.`,
|
|
372
|
+
);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/** The provider's stable ownership domain recorded on a managed resource. */
|
|
377
|
+
export function runtimeSandboxRoutingDomainForResource(resource: {
|
|
378
|
+
kind: ManagedSandboxResourceKind;
|
|
379
|
+
daytonaOrganizationId?: string | null;
|
|
380
|
+
modalAppId?: string | null;
|
|
381
|
+
vercelProjectId?: string | null;
|
|
382
|
+
}): string | null {
|
|
383
|
+
switch (resource.kind) {
|
|
384
|
+
case 'daytona_sandbox':
|
|
385
|
+
return resource.daytonaOrganizationId?.trim() || null;
|
|
386
|
+
case 'modal_sandbox':
|
|
387
|
+
return resource.modalAppId?.trim() || null;
|
|
388
|
+
case 'vercel_sandbox':
|
|
389
|
+
return resource.vercelProjectId?.trim() || null;
|
|
390
|
+
default:
|
|
391
|
+
throw new Error(
|
|
392
|
+
`Unknown managed sandbox resource kind: ${String(resource.kind)}.`,
|
|
393
|
+
);
|
|
394
|
+
}
|
|
360
395
|
}
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts
CHANGED
|
@@ -178,7 +178,8 @@ export async function handleRuntimeGatewayWorkerWake(
|
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* Preview experiment E2: an admitted run asks the worker lane to start its
|
|
181
|
-
*
|
|
181
|
+
* sandbox early (`early-sandbox-lane.ts` selects the lane's provider Adapter;
|
|
182
|
+
* Modal only). The body names only the run's caller workflow id and
|
|
182
183
|
* org; the worker derives everything else from its own deployment. A lossy
|
|
183
184
|
* hint: a miss only means the launch creates its sandbox as today.
|
|
184
185
|
*/
|
|
@@ -53,12 +53,12 @@ export type PlayExecutionSuspension =
|
|
|
53
53
|
* is named. */
|
|
54
54
|
runnerAttempt: number;
|
|
55
55
|
/** Missing on historical records, which are Daytona. */
|
|
56
|
-
sandboxProvider?: 'daytona' | 'modal';
|
|
56
|
+
sandboxProvider?: 'daytona' | 'modal' | 'vercel';
|
|
57
57
|
/** Versioned physical identity for provider-safe wake and cleanup.
|
|
58
58
|
* Legacy fields remain until every launch-pinned release has drained. */
|
|
59
59
|
runtimeSandboxRef?: {
|
|
60
60
|
schemaVersion: 1;
|
|
61
|
-
provider: 'daytona' | 'modal';
|
|
61
|
+
provider: 'daytona' | 'modal' | 'vercel';
|
|
62
62
|
resourceId: string;
|
|
63
63
|
routingDomain: string | null;
|
|
64
64
|
};
|
|
@@ -11,6 +11,7 @@ const ALWAYS_FRESH_INTEGRATION_TOOL_IDS = new Set([
|
|
|
11
11
|
'google_workspace_write_table',
|
|
12
12
|
// Google sharing and the current credential must be checked on every call.
|
|
13
13
|
'google_calendar_availability_get_free_busy',
|
|
14
|
+
'google_calendar_availability_get_workspace_free_busy',
|
|
14
15
|
'google_calendar_availability_query_free_busy',
|
|
15
16
|
'google_calendar_availability_get_booking_event',
|
|
16
17
|
'google_calendar_availability_insert_event',
|
|
@@ -31,6 +32,7 @@ export function isAlwaysFreshIntegrationTool(toolId: string): boolean {
|
|
|
31
32
|
const ALWAYS_FRESH_INTEGRATION_READ_TOOL_IDS = new Set([
|
|
32
33
|
'google_workspace_request',
|
|
33
34
|
'google_calendar_availability_get_free_busy',
|
|
35
|
+
'google_calendar_availability_get_workspace_free_busy',
|
|
34
36
|
'google_calendar_availability_query_free_busy',
|
|
35
37
|
'google_calendar_availability_get_booking_event',
|
|
36
38
|
]);
|
|
@@ -259,3 +261,18 @@ export function legacySharedCacheReuseSupport(
|
|
|
259
261
|
: 'This action has no declared read-result reuse capability. Use staleAfterSeconds: 0; completed operations still recover within their run.',
|
|
260
262
|
};
|
|
261
263
|
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* A run's internal cache reuse window (`cacheReuseWindowSeconds`) applied to a
|
|
267
|
+
* call's window: the longer of the two, with an authored 0 counting as the
|
|
268
|
+
* window. Null or omitted (reuse without age limit) stays as authored. Apply it
|
|
269
|
+
* only to calls `reusableWindowEligibility` allows.
|
|
270
|
+
*/
|
|
271
|
+
export function applyCacheReuseWindow<T extends number | null | undefined>(
|
|
272
|
+
staleAfterSeconds: T,
|
|
273
|
+
cacheReuseWindowSeconds: number,
|
|
274
|
+
): T | number {
|
|
275
|
+
return staleAfterSeconds === null || staleAfterSeconds === undefined
|
|
276
|
+
? staleAfterSeconds
|
|
277
|
+
: Math.max(staleAfterSeconds, cacheReuseWindowSeconds);
|
|
278
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import {
|
|
3
|
+
STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS,
|
|
4
|
+
validatePlaySandboxRuntimeLimits,
|
|
5
|
+
type PlaySandboxRuntimeLimits,
|
|
6
|
+
} from '../plays/sandbox-runtime-limits';
|
|
7
|
+
import {
|
|
8
|
+
PLAY_RUNNER_STARTUP_GRACE_SECONDS,
|
|
9
|
+
PLAY_RUNNER_TERMINAL_GRACE_SECONDS,
|
|
10
|
+
} from './runtime-constants';
|
|
11
|
+
import { isIsolatedRuntimeSchedulerSchema } from './runtime-scheduler-topology';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Vercel Sandbox runner configuration (Preview only, `vercel_sandbox_only@1`).
|
|
15
|
+
*
|
|
16
|
+
* Team and project are non-secret ownership identities, so they are constants:
|
|
17
|
+
* every sandbox lives in the dedicated `deepline-sandboxes` project, never in
|
|
18
|
+
* the `deepline-api` app project. Only the access token is a
|
|
19
|
+
* credential, and it reaches the worker as `VERCEL_SANDBOX_TOKEN`; it is never
|
|
20
|
+
* passed into a sandbox.
|
|
21
|
+
*/
|
|
22
|
+
export const VERCEL_SANDBOX_TEAM_ID = 'team_FEybZv3iEDOVhmUqFS4xlL3a';
|
|
23
|
+
/** `deepline-sandboxes`: holds sandboxes only, so a token scoped to it reaches nothing else. */
|
|
24
|
+
export const VERCEL_SANDBOX_PROJECT_ID = 'prj_Oecd0m99kmQ6wBeLqbTenR4rUsgC';
|
|
25
|
+
export const VERCEL_SANDBOX_TOKEN_ENV = 'VERCEL_SANDBOX_TOKEN';
|
|
26
|
+
/** Closest to the Fly `iad` gateways; Vercel's default Sandbox region. */
|
|
27
|
+
export const VERCEL_SANDBOX_REGION = 'iad1';
|
|
28
|
+
/** Managed Node 22 image. The `cjs_node20` artifact target runs unchanged. */
|
|
29
|
+
export const VERCEL_SANDBOX_IMAGE = 'vercel/sandbox/node:22';
|
|
30
|
+
export const VERCEL_SANDBOX_WORKDIR = '/vercel/sandbox/deepline';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Vercel Sandbox plan limits (Pro/Enterprise, docs as of 2026-11-17,
|
|
34
|
+
* https://vercel.com/docs/sandbox/pricing). A launch that would exceed one of
|
|
35
|
+
* these fails loudly before any create.
|
|
36
|
+
*/
|
|
37
|
+
export const VERCEL_SANDBOX_PLAN_LIMITS = {
|
|
38
|
+
/** One session; the run's limit plus startup and terminal grace must fit. */
|
|
39
|
+
maxSessionSeconds: 24 * 60 * 60,
|
|
40
|
+
/** 1 or an even number up to this. */
|
|
41
|
+
maxVcpus: 8,
|
|
42
|
+
memoryGiBPerVcpu: 2,
|
|
43
|
+
/** Account-wide; Vercel rejects creates beyond it. */
|
|
44
|
+
maxConcurrentSandboxes: 10_000,
|
|
45
|
+
/** Dynamic: starts at 150 vCPU/min and ramps to 5,000 vCPU/min. */
|
|
46
|
+
startingVcpuAllocationPerMinute: 150,
|
|
47
|
+
/** Deletes share a 20 requests/second team quota. */
|
|
48
|
+
deleteRequestsPerSecond: 20,
|
|
49
|
+
/** Each create may carry at most five tags. */
|
|
50
|
+
maxTags: 5,
|
|
51
|
+
} as const;
|
|
52
|
+
|
|
53
|
+
export class VercelSandboxLimitExceededError extends Error {
|
|
54
|
+
constructor(message: string) {
|
|
55
|
+
super(`VERCEL_SANDBOX_LIMIT_EXCEEDED: ${message}`);
|
|
56
|
+
this.name = 'VercelSandboxLimitExceededError';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export class VercelSandboxPreviewOnlyError extends Error {
|
|
61
|
+
constructor() {
|
|
62
|
+
super(
|
|
63
|
+
'VERCEL_SANDBOX_PREVIEW_ONLY: vercel_sandbox_only@1 runs only on an isolated Preview runtime lane and is refused in Production.',
|
|
64
|
+
);
|
|
65
|
+
this.name = 'VercelSandboxPreviewOnlyError';
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type VercelSandboxRequiredConfig = {
|
|
70
|
+
token: string;
|
|
71
|
+
teamId: string;
|
|
72
|
+
projectId: string;
|
|
73
|
+
region: string;
|
|
74
|
+
image: string;
|
|
75
|
+
workdir: string;
|
|
76
|
+
vcpus: number;
|
|
77
|
+
memoryGiB: number;
|
|
78
|
+
/** Session timeout handed to Vercel: the provider-enforced hard bound. */
|
|
79
|
+
sessionTimeoutMs: number;
|
|
80
|
+
limits: PlaySandboxRuntimeLimits;
|
|
81
|
+
/** CIDR egress allowlist when configured; otherwise unrestricted (Preview). */
|
|
82
|
+
networkPolicy: 'allow-all' | { subnets: { allow: string[] } };
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/** 1 vCPU, or the smallest even count whose 2 GiB/vCPU covers the request. */
|
|
86
|
+
export function vercelSandboxVcpusForLimits(
|
|
87
|
+
limits: Pick<PlaySandboxRuntimeLimits, 'cpu' | 'memoryGiB'>,
|
|
88
|
+
): number {
|
|
89
|
+
const needed = Math.max(
|
|
90
|
+
1,
|
|
91
|
+
Math.ceil(limits.cpu),
|
|
92
|
+
Math.ceil(limits.memoryGiB / VERCEL_SANDBOX_PLAN_LIMITS.memoryGiBPerVcpu),
|
|
93
|
+
);
|
|
94
|
+
const vcpus = needed === 1 ? 1 : needed + (needed % 2);
|
|
95
|
+
if (vcpus > VERCEL_SANDBOX_PLAN_LIMITS.maxVcpus) {
|
|
96
|
+
throw new VercelSandboxLimitExceededError(
|
|
97
|
+
`the run needs ${vcpus} vCPUs (cpu ${limits.cpu}, memory ${limits.memoryGiB} GiB); Vercel Sandbox allows at most ${VERCEL_SANDBOX_PLAN_LIMITS.maxVcpus}.`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return vcpus;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function vercelSandboxSessionTimeoutMs(
|
|
104
|
+
limits: Pick<PlaySandboxRuntimeLimits, 'timeoutSeconds'>,
|
|
105
|
+
): number {
|
|
106
|
+
const seconds =
|
|
107
|
+
limits.timeoutSeconds +
|
|
108
|
+
PLAY_RUNNER_STARTUP_GRACE_SECONDS +
|
|
109
|
+
PLAY_RUNNER_TERMINAL_GRACE_SECONDS;
|
|
110
|
+
if (seconds > VERCEL_SANDBOX_PLAN_LIMITS.maxSessionSeconds) {
|
|
111
|
+
throw new VercelSandboxLimitExceededError(
|
|
112
|
+
`the run needs a ${seconds}s session; Vercel Sandbox allows at most ${VERCEL_SANDBOX_PLAN_LIMITS.maxSessionSeconds}s.`,
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
return seconds * 1_000;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function cidrAllowlist(value: string | undefined): string[] | null {
|
|
119
|
+
const values = (value ?? '')
|
|
120
|
+
.split(',')
|
|
121
|
+
.map((entry) => entry.trim())
|
|
122
|
+
.filter(Boolean)
|
|
123
|
+
.filter((entry) => !entry.includes(':'));
|
|
124
|
+
return values.length > 0 ? values : null;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* True only on an isolated Preview lane. Production workers never run this
|
|
129
|
+
* Adapter: the policy is excluded from unpinned catalogs and refused by launch
|
|
130
|
+
* writers, and this check refuses it again at the provider boundary.
|
|
131
|
+
*/
|
|
132
|
+
export function isVercelSandboxPreviewLane(input: {
|
|
133
|
+
runtimeSchedulerSchema: string | null | undefined;
|
|
134
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
135
|
+
}): boolean {
|
|
136
|
+
const env = input.env ?? process.env;
|
|
137
|
+
return (
|
|
138
|
+
env.DEEPLINE_RUNTIME_ENVIRONMENT === 'preview' &&
|
|
139
|
+
isIsolatedRuntimeSchedulerSchema(input.runtimeSchedulerSchema)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function loadVercelSandboxRequiredConfig(input: {
|
|
144
|
+
runtimeSchedulerSchema: string | null | undefined;
|
|
145
|
+
limits?: PlaySandboxRuntimeLimits | null;
|
|
146
|
+
env?: Readonly<Record<string, string | undefined>>;
|
|
147
|
+
}): VercelSandboxRequiredConfig {
|
|
148
|
+
const env = input.env ?? process.env;
|
|
149
|
+
if (
|
|
150
|
+
!isVercelSandboxPreviewLane({
|
|
151
|
+
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
|
152
|
+
env,
|
|
153
|
+
})
|
|
154
|
+
) {
|
|
155
|
+
throw new VercelSandboxPreviewOnlyError();
|
|
156
|
+
}
|
|
157
|
+
const token = env[VERCEL_SANDBOX_TOKEN_ENV]?.trim();
|
|
158
|
+
if (!token) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
`${VERCEL_SANDBOX_TOKEN_ENV} is required for vercel_sandbox_only@1.`,
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
const limits = validatePlaySandboxRuntimeLimits(
|
|
164
|
+
input.limits ?? { ...STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS },
|
|
165
|
+
);
|
|
166
|
+
const vcpus = vercelSandboxVcpusForLimits(limits);
|
|
167
|
+
const cidrs = cidrAllowlist(env.DEEPLINE_DAYTONA_NETWORK_ALLOW_LIST);
|
|
168
|
+
return {
|
|
169
|
+
token,
|
|
170
|
+
teamId: VERCEL_SANDBOX_TEAM_ID,
|
|
171
|
+
projectId: VERCEL_SANDBOX_PROJECT_ID,
|
|
172
|
+
region: VERCEL_SANDBOX_REGION,
|
|
173
|
+
image: VERCEL_SANDBOX_IMAGE,
|
|
174
|
+
workdir: VERCEL_SANDBOX_WORKDIR,
|
|
175
|
+
vcpus,
|
|
176
|
+
memoryGiB: vcpus * VERCEL_SANDBOX_PLAN_LIMITS.memoryGiBPerVcpu,
|
|
177
|
+
sessionTimeoutMs: vercelSandboxSessionTimeoutMs(limits),
|
|
178
|
+
limits,
|
|
179
|
+
networkPolicy: cidrs ? { subnets: { allow: cidrs } } : 'allow-all',
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Lane tag value: Vercel lists by one tag, so an operator can list exactly
|
|
185
|
+
* this lane's sandboxes with it. A hash keeps the value short and
|
|
186
|
+
* charset-safe.
|
|
187
|
+
*/
|
|
188
|
+
export function vercelSandboxLaneTag(
|
|
189
|
+
runtimeSchedulerSchema: string | null | undefined,
|
|
190
|
+
): string {
|
|
191
|
+
const schema = runtimeSchedulerSchema?.trim();
|
|
192
|
+
if (!schema) {
|
|
193
|
+
throw new Error('Vercel Sandbox requires a runtime scheduler schema.');
|
|
194
|
+
}
|
|
195
|
+
return createHash('sha256')
|
|
196
|
+
.update(`vercel-sandbox-lane@1:${schema}`)
|
|
197
|
+
.digest('hex')
|
|
198
|
+
.slice(0, 20);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Deterministic-by-intent sandbox name, recorded durably before create so an
|
|
203
|
+
* ambiguous create always has an exact identity to delete. The nonce makes a
|
|
204
|
+
* retried attempt on the same run never collide with an earlier sandbox.
|
|
205
|
+
*/
|
|
206
|
+
export function vercelSandboxName(input: {
|
|
207
|
+
runId: string;
|
|
208
|
+
attempt: number;
|
|
209
|
+
nonce: string;
|
|
210
|
+
}): string {
|
|
211
|
+
return `dl-${createHash('sha256')
|
|
212
|
+
.update(
|
|
213
|
+
`vercel-sandbox-name@1:${input.runId}:${input.attempt}:${input.nonce}`,
|
|
214
|
+
)
|
|
215
|
+
.digest('hex')
|
|
216
|
+
.slice(0, 24)}`;
|
|
217
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { BillingEntitlements } from '../integration-contracts/billing-entitlements';
|
|
2
|
+
import { TOOL_CONNECTION_NAME_PATTERN } from '../integration-contracts/tool-connection';
|
|
3
|
+
export { isToolConnectionName } from '../integration-contracts/tool-connection';
|
|
2
4
|
export type { BillingEntitlements } from '../integration-contracts/billing-entitlements';
|
|
3
5
|
import { Type, type Static, type TSchema } from '@sinclair/typebox';
|
|
4
6
|
import { Value } from '@sinclair/typebox/value';
|
|
@@ -937,6 +939,8 @@ export type PlayToolCallRetryPolicy = Static<
|
|
|
937
939
|
|
|
938
940
|
/** The one public type for durable managed-tool calls. */
|
|
939
941
|
export type PlayToolExecutionRequest = {
|
|
942
|
+
/** Name of an explicitly selected workspace connection. */
|
|
943
|
+
connection?: string;
|
|
940
944
|
id: string;
|
|
941
945
|
tool: string;
|
|
942
946
|
input: Record<string, unknown>;
|
|
@@ -2472,6 +2476,24 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
2472
2476
|
description: 'Integration tool id resolved against the generated ToolMap.',
|
|
2473
2477
|
errorMessage: 'ctx.tools.execute tool must be a non-empty tool id.',
|
|
2474
2478
|
},
|
|
2479
|
+
'ctx.tools.execute.connection': {
|
|
2480
|
+
schema: Type.String({ pattern: TOOL_CONNECTION_NAME_PATTERN }),
|
|
2481
|
+
fixtures: {
|
|
2482
|
+
valid: 'outbound',
|
|
2483
|
+
invalid: 'Outbound',
|
|
2484
|
+
absent: undefined,
|
|
2485
|
+
unresolved: { expression: 'connectionName' },
|
|
2486
|
+
edition1: undefined,
|
|
2487
|
+
},
|
|
2488
|
+
referenceType: 'string',
|
|
2489
|
+
required: false,
|
|
2490
|
+
resolution: 'static-required',
|
|
2491
|
+
issueCode: 'play_authoring_tool_request_invalid',
|
|
2492
|
+
description:
|
|
2493
|
+
'Exact workspace authorization name or Google Workspace domain for the tool.',
|
|
2494
|
+
errorMessage:
|
|
2495
|
+
'Use a literal workspace connection name or Google Workspace domain.',
|
|
2496
|
+
},
|
|
2475
2497
|
'ctx.tools.execute.input': {
|
|
2476
2498
|
schema: Type.Record(Type.String(), Type.Unknown()),
|
|
2477
2499
|
fixtures: {
|
|
@@ -3552,6 +3574,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
3552
3574
|
'export type ToolExecutionRequest<K extends string> = {',
|
|
3553
3575
|
` readonly id: ${cloudReferenceType('ctx.tools.execute.id')};`,
|
|
3554
3576
|
` readonly tool: ${cloudReferenceType('ctx.tools.execute.tool')};`,
|
|
3577
|
+
` readonly connection?: ${cloudReferenceType('ctx.tools.execute.connection')};`,
|
|
3555
3578
|
` readonly input: ${cloudReferenceType('ctx.tools.execute.input')};`,
|
|
3556
3579
|
` readonly description?: ${cloudReferenceType('ctx.tools.execute.description')};`,
|
|
3557
3580
|
` readonly force?: ${cloudReferenceType('ctx.tools.execute.force')};`,
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* into a local binding on the same line.
|
|
17
17
|
*/
|
|
18
18
|
import { basename } from 'node:path';
|
|
19
|
+
import { isToolConnectionName } from '../integration-contracts/tool-connection';
|
|
19
20
|
import { isAstNode, TypeScriptParser, type AstNode } from './ts-ast';
|
|
20
21
|
|
|
21
22
|
export const SCRIPT_SDK = 'deepline';
|
|
@@ -438,16 +439,82 @@ function typeArgument(call: AstNode): AstNode | null {
|
|
|
438
439
|
export function wrapScriptPlay(
|
|
439
440
|
source: string,
|
|
440
441
|
script: ScriptPlay,
|
|
441
|
-
{
|
|
442
|
+
{
|
|
443
|
+
typed,
|
|
444
|
+
authoredSource = source,
|
|
445
|
+
}: { typed: boolean; authoredSource?: string },
|
|
442
446
|
): string {
|
|
443
447
|
const { entry, entryCall } = script;
|
|
448
|
+
const program = programOf(source)!;
|
|
449
|
+
// Diagram instrumentation can wrap a statement in a callback. Validate
|
|
450
|
+
// connection placement against the authored function, before those wrappers.
|
|
451
|
+
const authoredProgram = programOf(authoredSource)!;
|
|
452
|
+
const authoredEntry =
|
|
453
|
+
authoredSource === source ? entry : playForm(authoredProgram)?.entry;
|
|
454
|
+
let usesNamedConnection = false;
|
|
455
|
+
function inspectNamedCalls(node: AstNode, nested: boolean) {
|
|
456
|
+
if (node.type === 'CallExpression' && isAstNode(node.callee)) {
|
|
457
|
+
const callee = node.callee;
|
|
458
|
+
const namespace = callee.object;
|
|
459
|
+
const request = Array.isArray(node.arguments)
|
|
460
|
+
? node.arguments[0]
|
|
461
|
+
: undefined;
|
|
462
|
+
if (
|
|
463
|
+
callee.type === 'MemberExpression' &&
|
|
464
|
+
!callee.computed &&
|
|
465
|
+
isAstNode(callee.property) &&
|
|
466
|
+
callee.property.name === 'execute' &&
|
|
467
|
+
isAstNode(namespace) &&
|
|
468
|
+
namespace.type === 'MemberExpression' &&
|
|
469
|
+
!namespace.computed &&
|
|
470
|
+
isAstNode(namespace.object) &&
|
|
471
|
+
namespace.object.name === script.contextName &&
|
|
472
|
+
isAstNode(namespace.property) &&
|
|
473
|
+
namespace.property.name === 'tools' &&
|
|
474
|
+
isAstNode(request) &&
|
|
475
|
+
request.type === 'ObjectExpression'
|
|
476
|
+
) {
|
|
477
|
+
const fields = Array.isArray(request.properties)
|
|
478
|
+
? request.properties.filter(isAstNode)
|
|
479
|
+
: [];
|
|
480
|
+
const named = fields.find(
|
|
481
|
+
(field) =>
|
|
482
|
+
isAstNode(field.key) &&
|
|
483
|
+
(field.key.name === 'connection' ||
|
|
484
|
+
field.key.value === 'connection'),
|
|
485
|
+
);
|
|
486
|
+
if (named) {
|
|
487
|
+
if (nested)
|
|
488
|
+
fail(
|
|
489
|
+
authoredSource,
|
|
490
|
+
named,
|
|
491
|
+
'Named connections currently require a tool call in the Play entry function.',
|
|
492
|
+
);
|
|
493
|
+
if (
|
|
494
|
+
!isAstNode(named.value) ||
|
|
495
|
+
!isToolConnectionName(named.value.value)
|
|
496
|
+
) {
|
|
497
|
+
fail(
|
|
498
|
+
authoredSource,
|
|
499
|
+
named,
|
|
500
|
+
'Use a literal workspace connection name or Google Workspace domain.',
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
usesNamedConnection = true;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
const childIsNested =
|
|
508
|
+
nested || (FUNCTION_TYPES.has(node.type) && node !== authoredEntry?.node);
|
|
509
|
+
for (const child of childNodes(node))
|
|
510
|
+
inspectNamedCalls(child, childIsNested);
|
|
511
|
+
}
|
|
512
|
+
inspectNamedCalls(authoredProgram, false);
|
|
444
513
|
// TypeScript sources annotate what they declare, so the wrapped form also
|
|
445
514
|
// type-checks under noImplicitAny.
|
|
446
515
|
const unknownType = typed ? ': unknown' : '';
|
|
447
516
|
const anyType = typed ? ': any' : '';
|
|
448
|
-
const runtimeImport = defaultImportName(
|
|
449
|
-
headerOf(programOf(source)!).find(isSdkImport),
|
|
450
|
-
)
|
|
517
|
+
const runtimeImport = defaultImportName(headerOf(program).find(isSdkImport))
|
|
451
518
|
? `import { runScriptPlay as __deeplineRunScriptPlay } from '${SCRIPT_SDK}';`
|
|
452
519
|
: `import ${SCRIPT_SDK}, { runScriptPlay as __deeplineRunScriptPlay } from '${SCRIPT_SDK}';`;
|
|
453
520
|
const entryBindings = entry
|
|
@@ -455,7 +522,10 @@ export function wrapScriptPlay(
|
|
|
455
522
|
: '';
|
|
456
523
|
const prefix =
|
|
457
524
|
`${runtimeImport} export default async function (__deeplineContext${unknownType}, __deeplineInput${anyType}) {` +
|
|
458
|
-
` return __deeplineRunScriptPlay(__deeplineContext, __deeplineInput, async () => {${entryBindings}
|
|
525
|
+
` return __deeplineRunScriptPlay(__deeplineContext, __deeplineInput, async () => {${entryBindings}` +
|
|
526
|
+
(usesNamedConnection
|
|
527
|
+
? ` if (!('namedWorkspaceConnections' in ${script.contextName}.tools)) throw new Error('This Play requires a runner that supports named workspace connections.');`
|
|
528
|
+
: '');
|
|
459
529
|
const edits: Array<{ at: number; end?: number; text: string }> = [
|
|
460
530
|
{
|
|
461
531
|
at: script.headerEnd,
|
|
@@ -463,7 +533,7 @@ export function wrapScriptPlay(
|
|
|
463
533
|
},
|
|
464
534
|
];
|
|
465
535
|
// `export const config = {...}` runs inside the run as `const config`.
|
|
466
|
-
const configExport = configExportOf(
|
|
536
|
+
const configExport = configExportOf(program);
|
|
467
537
|
if (configExport) {
|
|
468
538
|
const declared = configExport.declaration as AstNode;
|
|
469
539
|
edits.push({
|
|
@@ -1500,6 +1500,7 @@ export type PlayStaticSubstep = PlayStaticSubstepMetadata &
|
|
|
1500
1500
|
| {
|
|
1501
1501
|
type: 'tool';
|
|
1502
1502
|
toolId: string;
|
|
1503
|
+
connection?: string;
|
|
1503
1504
|
field: string;
|
|
1504
1505
|
paramsSource?: string;
|
|
1505
1506
|
/** The code computing the call's local inputs (`const candidate =
|