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.
Files changed (246) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +112 -2
  2. package/dist/bundling-sources/sdk/src/index.ts +7 -0
  3. package/dist/bundling-sources/sdk/src/integrations.ts +198 -0
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +3 -0
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/tool-calls.ts +35 -11
  7. package/dist/bundling-sources/sdk/src/types.ts +10 -0
  8. package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
  9. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +3 -1
  10. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
  11. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +108 -1
  12. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
  13. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
  14. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  15. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
  16. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
  18. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
  19. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
  20. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
  22. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +29 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
  25. package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
  29. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
  30. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +43 -3
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
  39. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
  42. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
  43. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +49 -55
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +229 -144
  54. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +2 -2
  55. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
  56. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
  57. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
  58. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
  59. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
  60. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
  62. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
  63. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
  64. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
  65. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
  66. package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
  67. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
  68. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
  69. package/dist/cli/auth-ENBXAKQS.js +43 -0
  70. package/dist/cli/{auth-IGBGOB4E.mjs → auth-IMWJAHPU.mjs} +5 -5
  71. package/dist/cli/{billing-IB2TWE74.js → billing-Y55PR2PV.js} +101 -101
  72. package/dist/cli/{billing-N37W2I62.mjs → billing-YQMW3QJI.mjs} +12 -12
  73. package/dist/cli/chunk-22OBDYHP.js +455 -0
  74. package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
  75. package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
  76. package/dist/cli/{chunk-D44DP4KJ.js → chunk-3I26HMJ7.js} +37 -17
  77. package/dist/cli/{chunk-B5NP3SHX.mjs → chunk-3JDA23NN.mjs} +2 -2
  78. package/dist/cli/{chunk-QXNOSCYL.js → chunk-3KGMM4KS.js} +1 -1
  79. package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-456RRXAP.mjs} +5 -5
  80. package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
  81. package/dist/cli/{chunk-FGGPCAGC.js → chunk-4PKHFW56.js} +18 -18
  82. package/dist/cli/{chunk-QONO7FRF.mjs → chunk-57G4NYOL.mjs} +1 -1
  83. package/dist/cli/{chunk-46V7QSJE.mjs → chunk-5PR4VLLL.mjs} +3 -3
  84. package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
  85. package/dist/cli/{chunk-AKY7KZRJ.js → chunk-7GNZEOTH.js} +6 -6
  86. package/dist/cli/{chunk-LFMQVSEI.js → chunk-7HMMTSDA.js} +5 -5
  87. package/dist/cli/{chunk-ORA5TMML.mjs → chunk-BEQ7RQLT.mjs} +5 -5
  88. package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
  89. package/dist/cli/{chunk-GM73TZ2W.js → chunk-C4P2KLWT.js} +41 -41
  90. package/dist/cli/{chunk-DNGACHFX.js → chunk-COJHT2KF.js} +22 -22
  91. package/dist/cli/{chunk-6SLEHAXX.js → chunk-DF2X7GJG.js} +5 -5
  92. package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DVDWAC2M.mjs} +7 -3
  93. package/dist/cli/{chunk-5CAVURVS.js → chunk-DYDHLBSK.js} +53 -53
  94. package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
  95. package/dist/cli/{chunk-EHLCWGWN.js → chunk-G26VJCNT.js} +4 -4
  96. package/dist/cli/{chunk-WL2GUGNZ.js → chunk-GQHRGBHV.js} +7 -7
  97. package/dist/cli/{chunk-DADH3WPE.mjs → chunk-GV45TTI6.mjs} +2 -2
  98. package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
  99. package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-H4SAHB3Q.mjs} +3 -3
  100. package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-HAQRF6DJ.mjs} +2 -2
  101. package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-HBSWATOU.mjs} +6 -6
  102. package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-HVJQF5BI.mjs} +2 -2
  103. package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
  104. package/dist/cli/{chunk-Z5YRKX7K.mjs → chunk-HXM2JUGD.mjs} +1 -1
  105. package/dist/cli/{chunk-JPT6VE54.js → chunk-IFIJ4DBJ.js} +2 -2
  106. package/dist/cli/{chunk-HAITCPCG.js → chunk-JBWOE6AP.js} +16 -16
  107. package/dist/cli/{chunk-AWLPERL3.js → chunk-JWVG7ZPX.js} +3 -3
  108. package/dist/cli/{chunk-3XXXMSSP.js → chunk-KE6CSCUF.js} +44 -44
  109. package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-LPUBBUKX.mjs} +24 -4
  110. package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-LQ6RRYXN.mjs} +5 -5
  111. package/dist/cli/{chunk-FFDZT255.mjs → chunk-LW274RO7.mjs} +1 -1
  112. package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
  113. package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
  114. package/dist/cli/{chunk-VHJUH3TB.js → chunk-ON56ISO6.js} +3 -3
  115. package/dist/cli/{chunk-4I47NCRI.js → chunk-PDJ4UDCO.js} +498 -328
  116. package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-PFGOCUH3.mjs} +1 -1
  117. package/dist/cli/{chunk-Q7WDXLYO.js → chunk-PKRW76XG.js} +2 -2
  118. package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-PMW5YP72.mjs} +37 -190
  119. package/dist/cli/{chunk-5APOJWJF.mjs → chunk-Q7ZOWNKR.mjs} +183 -13
  120. package/dist/cli/{chunk-WACIN4PR.mjs → chunk-REEOMNCO.mjs} +3 -3
  121. package/dist/cli/{chunk-DMXLZ57N.js → chunk-RG34YBDE.js} +2 -2
  122. package/dist/cli/{chunk-3LEUSRV3.mjs → chunk-RJPDCSTD.mjs} +4 -4
  123. package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
  124. package/dist/cli/{chunk-AUFE624T.js → chunk-RUFR4PUO.js} +10 -10
  125. package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-SK3HPU2J.mjs} +1 -1
  126. package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-SKS53WM6.mjs} +4 -4
  127. package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
  128. package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
  129. package/dist/cli/{chunk-CFZCRM6R.js → chunk-UHIAQPVA.js} +26 -26
  130. package/dist/cli/{chunk-D7GWEBMF.js → chunk-UNMNGRPB.js} +7 -7
  131. package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
  132. package/dist/cli/{chunk-TTBHOMAA.js → chunk-W7X4KH45.js} +316 -469
  133. package/dist/cli/chunk-WBSGPLH5.mjs +455 -0
  134. package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-WUEORIOY.mjs} +1 -1
  135. package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
  136. package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-YIRVKMON.mjs} +1 -1
  137. package/dist/cli/{chunk-NDNEARE3.js → chunk-Z44YTSTA.js} +13 -13
  138. package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
  139. package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-ZHY4T5M6.mjs} +1 -1
  140. package/dist/cli/{chunk-E7B73LGT.js → chunk-ZY6FL4O4.js} +24 -20
  141. package/dist/cli/command-docs.js +3 -3
  142. package/dist/cli/command-docs.mjs +2 -2
  143. package/dist/cli/{concurrent-runs-help-DIBGMEIN.mjs → concurrent-runs-help-KBWPKSTP.mjs} +7 -7
  144. package/dist/cli/concurrent-runs-help-TOMLCMV7.js +21 -0
  145. package/dist/cli/{csv-CAVA3EMS.mjs → csv-M5EBEMZH.mjs} +4 -4
  146. package/dist/cli/{csv-XZAM7EYZ.js → csv-XGGDZTQI.js} +13 -13
  147. package/dist/cli/{db-PPGEOBNG.js → db-CVPR54XK.js} +29 -29
  148. package/dist/cli/{db-HD332QI7.mjs → db-M6FJ6J6E.mjs} +8 -8
  149. package/dist/cli/describe-RUODIS6M.js +50 -0
  150. package/dist/cli/describe-X6QA2U3C.mjs +50 -0
  151. package/dist/cli/describe-core.d.mts +3 -3
  152. package/dist/cli/describe-core.d.ts +3 -3
  153. package/dist/cli/describe-core.js +3 -3
  154. package/dist/cli/describe-core.mjs +2 -2
  155. package/dist/cli/{executions-AFEOLB4A.mjs → executions-EHTS2XJX.mjs} +8 -8
  156. package/dist/cli/{executions-4ZKBL7IC.js → executions-VJEEWN22.js} +10 -10
  157. package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-76VGY4GP.mjs} +6 -6
  158. package/dist/cli/{feedback-M6Y33JKT.js → feedback-DQPUCUXO.js} +14 -14
  159. package/dist/cli/{git-632RYEF6.mjs → git-IY6DKKLR.mjs} +5 -5
  160. package/dist/cli/git-RLHTSYRY.js +25 -0
  161. package/dist/cli/index.js +150 -146
  162. package/dist/cli/index.mjs +49 -45
  163. package/dist/cli/integrations-242LE3TQ.mjs +98 -0
  164. package/dist/cli/integrations-CQSTIKFY.js +98 -0
  165. package/dist/cli/{legacy-noops-KWZMXYAU.mjs → legacy-noops-SWTSTMRY.mjs} +6 -6
  166. package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-U72DO6ZF.js} +9 -9
  167. package/dist/cli/{mcp-PESLHAAC.mjs → mcp-JJH6JR52.mjs} +72 -15
  168. package/dist/cli/{mcp-35QA6YG7.js → mcp-L473BKLJ.js} +89 -32
  169. package/dist/cli/{monitors-4DTUZLAI.js → monitors-3TF2DOFD.js} +119 -104
  170. package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-VSYHUBKC.mjs} +26 -11
  171. package/dist/cli/{org-DJNKMFCZ.mjs → org-S5VIKU2E.mjs} +8 -8
  172. package/dist/cli/{org-FWCBZMER.js → org-YKVI2ZTI.js} +90 -90
  173. package/dist/cli/{play-PHVQEEEZ.mjs → play-C7T5A3QM.mjs} +44 -25
  174. package/dist/cli/{play-FZ45M4KD.js → play-DOWEG45Y.js} +374 -355
  175. package/dist/cli/{providers-46E67QG7.mjs → providers-BMVVX3VD.mjs} +10 -9
  176. package/dist/cli/{providers-QJU6FMDD.js → providers-TAZPPFTB.js} +13 -12
  177. package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-A3WKMKTW.mjs} +4 -4
  178. package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-HD6FQXGR.js} +6 -6
  179. package/dist/cli/{run-WKSIRXEC.js → run-BVVV2UX7.js} +49 -48
  180. package/dist/cli/{run-2W2TJ6QA.mjs → run-FV7TWNOC.mjs} +28 -27
  181. package/dist/cli/{search-Y2CFLSYB.mjs → search-MGK6WIKS.mjs} +9 -9
  182. package/dist/cli/search-VJFCWUZN.js +32 -0
  183. package/dist/cli/{search-output-2IK6ZZDY.js → search-output-6Y7KEPIE.js} +6 -6
  184. package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-GM7LDZKE.mjs} +4 -4
  185. package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-4RFAR7YI.mjs} +8 -8
  186. package/dist/cli/{secrets-JVJIHGU4.js → secrets-SISXIXSZ.js} +17 -17
  187. package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-CE3OMEG7.mjs} +6 -6
  188. package/dist/cli/sessions-OWWZJZXH.js +22 -0
  189. package/dist/cli/{settings-5WHMFRNQ.js → settings-4HPM3K4A.js} +89 -89
  190. package/dist/cli/{settings-YQOPF3AI.mjs → settings-E22IDSX2.mjs} +16 -16
  191. package/dist/cli/{setup-3VJMKDEU.js → setup-BDRSNLKX.js} +49 -49
  192. package/dist/cli/{setup-O5U5IEVW.mjs → setup-BK65MDZ6.mjs} +9 -9
  193. package/dist/cli/{skills-G6J5PF35.mjs → skills-FI2GZMR4.mjs} +7 -7
  194. package/dist/cli/skills-ZLBFUAFR.js +36 -0
  195. package/dist/cli/tools-3K72VE33.js +57 -0
  196. package/dist/cli/{tools-AG7SWL5Y.mjs → tools-HMMWYUNW.mjs} +20 -19
  197. package/dist/cli/update-QZV6DH5V.js +34 -0
  198. package/dist/cli/{update-K73DD6CR.mjs → update-WDKBSXV5.mjs} +9 -9
  199. package/dist/cli/{views-4D2OTLIO.js → views-775AUDWQ.js} +23 -23
  200. package/dist/cli/{views-MO6DIOMR.mjs → views-JYIJCO23.mjs} +8 -8
  201. package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-4H6KQRFQ.js} +19 -19
  202. package/dist/cli/{workflow-MMZMAELI.mjs → workflow-FKKHE3IU.mjs} +9 -9
  203. package/dist/{client-DLG9mHDh.d.mts → client-ANT3pyoa.d.mts} +1 -1
  204. package/dist/{client-X-FJD5Dp.d.ts → client-DD_FyJVd.d.ts} +1 -1
  205. package/dist/{client-core-WtnqyBwY.d.mts → client-core-Dg9tKhdB.d.mts} +339 -3
  206. package/dist/{client-core-0jmHfFBv.d.ts → client-core-QHmo73k1.d.ts} +339 -3
  207. package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
  208. package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
  209. package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
  210. package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
  211. package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
  212. package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
  213. package/dist/index.d.mts +7 -7
  214. package/dist/index.d.ts +7 -7
  215. package/dist/index.js +12 -12
  216. package/dist/index.mjs +8 -8
  217. package/dist/install-integrity.json +147 -133
  218. package/dist/plays/bundle-play-file.d.mts +3 -3
  219. package/dist/plays/bundle-play-file.d.ts +3 -3
  220. package/dist/plays/bundle-play-file.mjs +23 -4
  221. package/dist/plays/play-description.d.mts +2 -2
  222. package/dist/plays/play-description.d.ts +2 -2
  223. package/dist/plays/run-request.d.mts +2 -2
  224. package/dist/plays/run-request.d.ts +2 -2
  225. package/dist/plays/run-request.js +2 -2
  226. package/dist/plays/run-request.mjs +1 -1
  227. package/dist/release.d.mts +1 -1
  228. package/dist/release.d.ts +1 -1
  229. package/dist/release.js +2 -2
  230. package/dist/release.mjs +1 -1
  231. package/dist/server.d.mts +4 -4
  232. package/dist/server.d.ts +4 -4
  233. package/dist/server.js +7 -7
  234. package/dist/server.mjs +5 -5
  235. package/package.json +1 -1
  236. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
  237. package/dist/cli/auth-2PH6RSKL.js +0 -43
  238. package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
  239. package/dist/cli/describe-5TFFB2PM.js +0 -49
  240. package/dist/cli/describe-THQU7N47.mjs +0 -49
  241. package/dist/cli/git-AQLQYWRI.js +0 -25
  242. package/dist/cli/search-YLJFCJTK.js +0 -32
  243. package/dist/cli/sessions-TZ33UCPS.js +0 -22
  244. package/dist/cli/skills-WZY3XDT3.js +0 -36
  245. package/dist/cli/tools-BXQBL72Q.js +0 -56
  246. package/dist/cli/update-XYP5EII6.js +0 -34
@@ -53,6 +53,7 @@ type ExperimentSwitchDefinition =
53
53
  };
54
54
 
55
55
  const MODAL = 'packages/play-runtime/runner-backends/backends/modal.ts';
56
+ const EARLY_SANDBOX = 'packages/play-runtime/runner-backends/early-sandbox.ts';
56
57
 
57
58
  export const EXPERIMENT_SWITCHES = {
58
59
  B: {
@@ -102,13 +103,13 @@ export const EXPERIMENT_SWITCHES = {
102
103
  E2: {
103
104
  perRun: true,
104
105
  summary:
105
- "Start the run's Modal sandbox at admission (app hint) and adopt it at launch (worker).",
106
+ "Start the run's sandbox at admission (app hint), on a lane whose providers support early start, and adopt it at launch (worker).",
106
107
  constants: [
107
108
  {
108
109
  file: 'apps/deepline-api/src/lib/plays/early-sandbox-hint.ts',
109
110
  name: 'PREVIEW_EARLY_SANDBOX_HINT',
110
111
  },
111
- { file: MODAL, name: 'EARLY_MODAL_SANDBOX_START' },
112
+ { file: EARLY_SANDBOX, name: 'EARLY_SANDBOX_START' },
112
113
  ],
113
114
  },
114
115
  S1: {
@@ -122,14 +123,19 @@ export const EXPERIMENT_SWITCHES = {
122
123
  summary:
123
124
  'Adopting an in-process early sandbox checks the tags this process set instead of reading them back (worker).',
124
125
  constants: [
125
- { file: MODAL, name: 'ADOPT_IN_PROCESS_EARLY_SANDBOX_WITHOUT_TAG_READ' },
126
+ {
127
+ file: EARLY_SANDBOX,
128
+ name: 'ADOPT_IN_PROCESS_EARLY_SANDBOX_WITHOUT_TAG_READ',
129
+ },
126
130
  ],
127
131
  },
128
132
  PB: {
129
133
  perRun: true,
130
134
  summary:
131
135
  'With E2 and the baked image, start the baked runner (waiting for its config) on the early sandbox; the in-process launch delivers the envelope, config last (worker).',
132
- constants: [{ file: MODAL, name: 'PREBOOT_RUNNER_IN_EARLY_SANDBOX' }],
136
+ constants: [
137
+ { file: EARLY_SANDBOX, name: 'PREBOOT_RUNNER_IN_EARLY_SANDBOX' },
138
+ ],
133
139
  },
134
140
  PWM: {
135
141
  perRun: true,
@@ -0,0 +1,209 @@
1
+ /**
2
+ * Fleet Sandbox Sweep: the one Module that runs every provider's orphan sweep.
3
+ *
4
+ * Durable cleanup deletes each sandbox the scheduler knows about. A sweep is
5
+ * the backstop for the ones it lost: a worker crash between create and the
6
+ * cleanup enqueue, or a sandbox started before any run row existed. Each
7
+ * provider plugs in an Adapter that enumerates its candidates and terminates
8
+ * (or restores the durable cleanup obligation for) the ones its policy proves
9
+ * dead. This Module owns what is common to every Adapter:
10
+ *
11
+ * - which sweeps a provider may run, checked against its Provider Profile:
12
+ * only a provider that supports `orphanEnumeration` may sweep its whole
13
+ * inventory;
14
+ * - cadence: each Adapter declares its interval, and a pass starts only when
15
+ * it is due;
16
+ * - single flight: a pass never overlaps the same provider's previous pass;
17
+ * - isolation: each provider's pass runs independently, so one provider's
18
+ * failure, slowness, or synchronous throw never suppresses another's pass;
19
+ * - containment: a failed pass is reported through the Adapter and never
20
+ * escapes into the process that hosts the sweep.
21
+ *
22
+ * Two owners host it. The fixed runtime controller runs timer-driven passes
23
+ * (`startFleetSandboxSweepTimers`), so provider list traffic stays constant
24
+ * with fleet size. A runtime worker runs loop-driven passes from its cleanup
25
+ * controller (`createFleetSandboxSweep(...).runDuePasses()`), never awaiting
26
+ * them, so a slow provider never holds up cleanup claims.
27
+ */
28
+ import {
29
+ runtimeSandboxProviderProfile,
30
+ type RuntimeSandboxProviderId,
31
+ } from './/runtime-sandbox-provider-profile';
32
+
33
+ /** What an Adapter's pass enumerates. */
34
+ export type FleetSandboxSweepScope =
35
+ /** Every sandbox the provider holds for this fleet. Requires the profile's
36
+ * `orphanEnumeration`. */
37
+ | 'provider_inventory'
38
+ /** Only sandboxes created before any run row exists (early start). Their
39
+ * create tags are the cleanup obligation, so no inventory scan is needed. */
40
+ | 'unadopted_early_sandboxes';
41
+
42
+ export type FleetSandboxSweepAdapter = Readonly<{
43
+ provider: RuntimeSandboxProviderId;
44
+ scope: FleetSandboxSweepScope;
45
+ /** Minimum spacing between pass starts. */
46
+ intervalMs: number;
47
+ /**
48
+ * One pass: enumerate, apply the provider's age, ownership and dry-run
49
+ * policy, and terminate or restore cleanup for each dead sandbox. A
50
+ * rejection is reported through `reportPassFailure`.
51
+ */
52
+ runPass: () => Promise<void>;
53
+ /** Receives a failed pass. Must not throw; a throw is swallowed. */
54
+ reportPassFailure: (error: unknown) => void;
55
+ /** Called when a timer-driven pass is due while the previous one runs. */
56
+ reportOverlap?: () => void;
57
+ }>;
58
+
59
+ export class FleetSandboxSweepAdapterError extends Error {
60
+ constructor(message: string) {
61
+ super(message);
62
+ this.name = 'FleetSandboxSweepAdapterError';
63
+ }
64
+ }
65
+
66
+ /** Fails loudly before any pass when an Adapter claims more than its profile
67
+ * supports or two Adapters claim the same provider. */
68
+ export function assertFleetSandboxSweepAdapters(
69
+ adapters: readonly FleetSandboxSweepAdapter[],
70
+ ): void {
71
+ const seen = new Set<RuntimeSandboxProviderId>();
72
+ for (const adapter of adapters) {
73
+ if (seen.has(adapter.provider)) {
74
+ throw new FleetSandboxSweepAdapterError(
75
+ `Fleet sandbox sweep has two Adapters for ${adapter.provider}.`,
76
+ );
77
+ }
78
+ seen.add(adapter.provider);
79
+ if (!Number.isSafeInteger(adapter.intervalMs) || adapter.intervalMs <= 0) {
80
+ throw new FleetSandboxSweepAdapterError(
81
+ `Fleet sandbox sweep for ${adapter.provider} needs a positive integer interval.`,
82
+ );
83
+ }
84
+ if (adapter.scope === 'provider_inventory') {
85
+ const support = runtimeSandboxProviderProfile(adapter.provider)
86
+ .capabilities.orphanEnumeration;
87
+ if ('reason' in support) {
88
+ throw new FleetSandboxSweepAdapterError(
89
+ `Fleet sandbox sweep cannot enumerate ${adapter.provider}: ${support.reason}`,
90
+ );
91
+ }
92
+ }
93
+ }
94
+ }
95
+
96
+ type PassState = {
97
+ adapter: FleetSandboxSweepAdapter;
98
+ running: Promise<void> | null;
99
+ nextDueAtMs: number;
100
+ };
101
+
102
+ export type FleetSandboxSweep = {
103
+ /**
104
+ * Loop-driven owners: start every pass that is due and not already running,
105
+ * without awaiting it. A pass is due once its interval has elapsed since
106
+ * the previous pass started; the first call starts every pass.
107
+ */
108
+ runDuePasses: () => void;
109
+ /** Timer-driven owners: start this provider's pass now unless one runs. */
110
+ runPassNow: (provider: RuntimeSandboxProviderId) => void;
111
+ /** Resolves when every in-flight pass has settled. */
112
+ settled: () => Promise<void>;
113
+ };
114
+
115
+ export function createFleetSandboxSweep(input: {
116
+ adapters: readonly FleetSandboxSweepAdapter[];
117
+ /** Injected clock; read on every call so fake timers apply. */
118
+ now?: () => number;
119
+ }): FleetSandboxSweep {
120
+ assertFleetSandboxSweepAdapters(input.adapters);
121
+ const now = input.now ?? (() => Date.now());
122
+ const states: PassState[] = input.adapters.map((adapter) => ({
123
+ adapter,
124
+ running: null,
125
+ nextDueAtMs: 0,
126
+ }));
127
+
128
+ const start = (state: PassState, startedAtMs: number): void => {
129
+ state.nextDueAtMs = startedAtMs + state.adapter.intervalMs;
130
+ // The async wrapper turns a synchronous throw into a rejection, so it is
131
+ // reported like any other failed pass and never reaches the next Adapter.
132
+ const pass: Promise<void> = (async () => {
133
+ await state.adapter.runPass();
134
+ })()
135
+ .catch((error: unknown) => {
136
+ try {
137
+ state.adapter.reportPassFailure(error);
138
+ } catch {
139
+ // A broken reporter must not fail the host process.
140
+ }
141
+ })
142
+ .finally(() => {
143
+ if (state.running === pass) state.running = null;
144
+ });
145
+ state.running = pass;
146
+ };
147
+
148
+ return {
149
+ runDuePasses() {
150
+ for (const state of states) {
151
+ if (state.running) continue;
152
+ const nowMs = now();
153
+ if (nowMs < state.nextDueAtMs) continue;
154
+ start(state, nowMs);
155
+ }
156
+ },
157
+ runPassNow(provider) {
158
+ const state = states.find(
159
+ (candidate) => candidate.adapter.provider === provider,
160
+ );
161
+ if (!state) {
162
+ throw new FleetSandboxSweepAdapterError(
163
+ `Fleet sandbox sweep has no Adapter for ${provider}.`,
164
+ );
165
+ }
166
+ if (state.running) {
167
+ try {
168
+ state.adapter.reportOverlap?.();
169
+ } catch {
170
+ // Reporting only.
171
+ }
172
+ return;
173
+ }
174
+ start(state, now());
175
+ },
176
+ async settled() {
177
+ await Promise.all(
178
+ states.flatMap((state) => (state.running ? [state.running] : [])),
179
+ );
180
+ },
181
+ };
182
+ }
183
+
184
+ /**
185
+ * Timer-driven owner: run every Adapter's pass once now, then once per its
186
+ * interval, skipping (and reporting) a tick whose previous pass still runs.
187
+ * Timers are unref'd so the sweep never keeps a process alive.
188
+ */
189
+ export function startFleetSandboxSweepTimers(input: {
190
+ adapters: readonly FleetSandboxSweepAdapter[];
191
+ }): { stop: () => void; sweep: FleetSandboxSweep } {
192
+ const sweep = createFleetSandboxSweep({ adapters: input.adapters });
193
+ const intervals = input.adapters.map((adapter) => {
194
+ const interval = setInterval(() => {
195
+ sweep.runPassNow(adapter.provider);
196
+ }, adapter.intervalMs);
197
+ interval.unref?.();
198
+ return interval;
199
+ });
200
+ // Run once immediately: a singleton controller has no fleet-start stampede
201
+ // to smooth, and an early pass shortens recovery after a deploy.
202
+ for (const adapter of input.adapters) sweep.runPassNow(adapter.provider);
203
+ return {
204
+ sweep,
205
+ stop: () => {
206
+ for (const interval of intervals) clearInterval(interval);
207
+ },
208
+ };
209
+ }
@@ -34,6 +34,10 @@ export const PLAY_LAUNCH_ENVELOPE_FIELD_ROLES: {
34
34
  asyncRequestFingerprint: 'identity',
35
35
  force: 'identity',
36
36
  forceToolRefresh: 'identity',
37
+ // An internal reuse window only changes which completed receipts a call
38
+ // may reuse (an at-least-once cache); a retry that differs only here is the
39
+ // same launch, and the stored digest stays unchanged for older launches.
40
+ cacheReuseWindowSeconds: 'detail',
37
41
  maxConcurrentExternalCalls: 'identity',
38
42
  maxConcurrentRows: 'identity',
39
43
  integrationMode: 'identity',
@@ -67,7 +67,8 @@ export type PlayRunRecoveryReason =
67
67
  | 'runtime_initialization_transport_before_execution'
68
68
  | 'runner_startup_not_live_before_execution'
69
69
  | 'runtime_traffic_hold_before_execution'
70
- | 'runtime_traffic_throttled_before_execution';
70
+ | 'runtime_traffic_throttled_before_execution'
71
+ | 'vercel_sandbox_unavailable_before_execution';
71
72
 
72
73
  export type PlayRunRecoveryDecision = Readonly<{
73
74
  /** A fresh sandbox is safe only before customer code can have started. */
@@ -492,6 +493,28 @@ export function recoveryForRunnerStartupNotLive(
492
493
  });
493
494
  }
494
495
 
496
+ /**
497
+ * Vercel Sandbox (Preview only) refused, rate limited, or did not settle a
498
+ * create before any runner command was sent. The Adapter has already recorded
499
+ * the deterministic sandbox name and asked for its confirmed deletion, so a
500
+ * fresh attempt on a new sandbox is safe. `runtime` scope: the Modal circuit
501
+ * must not open for a Vercel outage.
502
+ */
503
+ export function recoveryForVercelSandboxUnavailable(
504
+ error: unknown,
505
+ ): PlayRunRecoveryError {
506
+ return new PlayRunRecoveryError({
507
+ decision: {
508
+ stage: 'pre_code',
509
+ action: 'defer',
510
+ reason: 'vercel_sandbox_unavailable_before_execution',
511
+ dependency: 'runtime',
512
+ },
513
+ message: 'Vercel Sandbox was unavailable before customer execution began.',
514
+ cause: error,
515
+ });
516
+ }
517
+
495
518
  /**
496
519
  * A runner transport classifier has already proved that the result has no
497
520
  * customer rows or steps. Keep its engine retry typed so an ordinary failed
@@ -3,9 +3,10 @@
3
3
  * after a resource fact and cleanup obligation exist; it neither creates a
4
4
  * sandbox nor decides a Play Run terminal state.
5
5
  */
6
+ import type { RuntimeSandboxProviderId } from '../../runtime-sandbox-provider-profile';
6
7
 
7
8
  export type SandboxCleanupResource = {
8
- provider: 'daytona' | 'modal';
9
+ provider: RuntimeSandboxProviderId;
9
10
  sandboxId: string;
10
11
  routingDomain: string | null;
11
12
  runId: string;
@@ -341,6 +341,11 @@ export interface PlayRunnerContextConfig extends RetainedPipelineCarrier {
341
341
  startupReadToolIds?: string[] | null;
342
342
  force?: boolean | null;
343
343
  forceToolRefresh?: boolean | null;
344
+ /**
345
+ * Optional internal reuse window in seconds (`play_run.cache_reuse_window`).
346
+ * Absent on older launches, which keep authored freshness.
347
+ */
348
+ cacheReuseWindowSeconds?: number | null;
344
349
  /**
345
350
  * Controls how scoped Postgres sessions enter the runner. `preloaded` means
346
351
  * the launch config carries short-lived encrypted sessions minted before
@@ -392,7 +397,7 @@ export interface RunnerPushExecutionConfig {
392
397
  runId: string;
393
398
  /** The provider that acquired this sandbox, which a Daytona-selected launch
394
399
  * can differ from after fallback. Absent from older workers. */
395
- sandboxProvider?: 'daytona' | 'modal';
400
+ sandboxProvider?: 'daytona' | 'modal' | 'vercel';
396
401
  /** Test drill only: how long the sandbox watchdog withholds heartbeats once
397
402
  * customer code starts. Absent from every ordinary launch. */
398
403
  heartbeatSilenceMs?: number;
@@ -155,6 +155,11 @@ export type PlayRunLedgerDatasetSnapshot = {
155
155
  * back-filled from row counts, which would assert a lineage nobody observed.
156
156
  */
157
157
  bornFrom?: PlayDatasetBornFrom | null;
158
+ /**
159
+ * Stored column names in the order the run wrote them: row keys as the Play
160
+ * built them, then each withColumn. Absent on runs from before the field.
161
+ */
162
+ columns?: string[];
158
163
  updatedAt: number;
159
164
  };
160
165
 
@@ -388,6 +393,8 @@ export type PlayRunLedgerEvent =
388
393
  complete?: boolean;
389
394
  /** Dataset-grain row birth, stated once per dataset (ADR 0019). */
390
395
  bornFrom?: PlayDatasetBornFrom;
396
+ /** Stored column names in the order the run wrote them. */
397
+ columns?: string[];
391
398
  })
392
399
  | (PlayRunLedgerBaseEvent & {
393
400
  type: typeof RUN_EVENT_KIND.activityObserved;
@@ -1001,6 +1008,7 @@ export function normalizePlayRunLedgerSnapshot(
1001
1008
  ? rawDataset.phase
1002
1009
  : 'registered';
1003
1010
  const datasetBornFrom = normalizeDatasetBornFrom(rawDataset.bornFrom);
1011
+ const datasetColumns = normalizeDatasetColumns(rawDataset.columns);
1004
1012
  datasetsById[datasetId] = {
1005
1013
  datasetId,
1006
1014
  path: optionalString(rawDataset.path) ?? `datasets.${datasetId}`,
@@ -1018,6 +1026,7 @@ export function normalizePlayRunLedgerSnapshot(
1018
1026
  // dropped rather than half-admitted, so a dataset either states where its
1019
1027
  // rows came from or says nothing.
1020
1028
  ...(datasetBornFrom ? { bornFrom: datasetBornFrom } : {}),
1029
+ ...(datasetColumns ? { columns: datasetColumns } : {}),
1021
1030
  updatedAt: finiteNumber(rawDataset.updatedAt) ?? 0,
1022
1031
  };
1023
1032
  }
@@ -2525,6 +2534,14 @@ export function reducePlayRunLedgerEvent(
2525
2534
  current?.bornFrom,
2526
2535
  event.bornFrom,
2527
2536
  );
2537
+ // The longest order wins: each phase event restates the run's order so
2538
+ // far, and a later one (a page, or the terminal write's withColumns)
2539
+ // only extends it. An event without one keeps what was recorded.
2540
+ const eventColumns = normalizeDatasetColumns(event.columns);
2541
+ const columns =
2542
+ eventColumns && eventColumns.length >= (current?.columns?.length ?? 0)
2543
+ ? eventColumns
2544
+ : current?.columns;
2528
2545
  const next: PlayRunLedgerDatasetSnapshot = {
2529
2546
  datasetId: event.datasetId,
2530
2547
  path: event.path,
@@ -2555,6 +2572,7 @@ export function reducePlayRunLedgerEvent(
2555
2572
  // record and must not erase the one that was witnessed; a paged
2556
2573
  // dataset re-registers with a larger admitted-row count.
2557
2574
  ...(mergedBornFrom ? { bornFrom: mergedBornFrom } : {}),
2575
+ ...(columns ? { columns } : {}),
2558
2576
  updatedAt: occurredAt,
2559
2577
  };
2560
2578
  return withTiming({
@@ -3075,3 +3093,22 @@ export function buildPlayRunLedgerEventsFromStatusPatch(input: {
3075
3093
 
3076
3094
  return events;
3077
3095
  }
3096
+
3097
+ /**
3098
+ * A dataset's written column order, or undefined: a non-empty list of
3099
+ * distinct, non-empty strings. Anything else is treated as not stated, so an
3100
+ * older or malformed writer falls back to the table's own order.
3101
+ */
3102
+ export function normalizeDatasetColumns(value: unknown): string[] | undefined {
3103
+ if (!Array.isArray(value) || value.length === 0) return undefined;
3104
+ const columns: string[] = [];
3105
+ const seen = new Set<string>();
3106
+ for (const entry of value) {
3107
+ if (typeof entry !== 'string' || !entry.trim() || seen.has(entry)) {
3108
+ return undefined;
3109
+ }
3110
+ seen.add(entry);
3111
+ columns.push(entry);
3112
+ }
3113
+ return columns;
3114
+ }
@@ -69,7 +69,10 @@ import {
69
69
  normalizeToolHttpErrorMessage,
70
70
  summarizeHtmlErrorBody,
71
71
  } from '../tool-http-errors';
72
- import { augmentSheetContractWithDatasetFields } from '../../play-data-plane/sheet-contract';
72
+ import {
73
+ augmentSheetContractWithDatasetFields,
74
+ datasetWrittenColumnOrder,
75
+ } from '../../play-data-plane/sheet-contract';
73
76
  import { nextWorkCounterInvocationSeq } from '../runtime-work-counters';
74
77
  import type { RuntimeApiResponseMeta } from '../app-runtime-api';
75
78
  import { onMemoryPressure } from '../memory-pressure-signal';
@@ -367,6 +370,7 @@ const RUNTIME_RECEIPT_GATEWAY_REQUEST_TIMEOUT_MS =
367
370
  // or refuses an ambiguous unbound post, so transient gateway responses are safe
368
371
  // to retry without creating a second card.
369
372
  const RETRY_SAFE_EVENT_WAIT_ARM_TOOLS = new Set([
373
+ 'resend_send_and_wait',
370
374
  'test_wait_for_event',
371
375
  'slack_wait_for_action',
372
376
  ]);
@@ -1154,12 +1158,14 @@ export function createRuntimeEventWaitHandler(
1154
1158
  // Only a newer app advertises this phase. Do not send a new request to an
1155
1159
  // older app during the rollout-skew window.
1156
1160
  if (boundary.timeoutPolicy?.finalizeOnTimeout !== true) return;
1157
- await callRuntimeEventWaitEndpoint({
1161
+ const result = await callRuntimeEventWaitEndpoint({
1158
1162
  phase: 'timeout',
1159
1163
  payload,
1160
1164
  context,
1161
1165
  boundary,
1162
1166
  });
1167
+ if (result.resolvedOutput)
1168
+ return { resolvedOutput: result.resolvedOutput };
1163
1169
  },
1164
1170
  };
1165
1171
  return handler;
@@ -1513,6 +1519,17 @@ function emitSystemLog(line: string, options?: ExecutePlayRunnerOptions): void {
1513
1519
 
1514
1520
  export function playRunnerContextCachePolicy(
1515
1521
  context: PlayRunnerExecutionConfig['context'],
1522
+ ): ContextOptions['cachePolicy'] | undefined {
1523
+ const policy = playRunnerContextForcePolicy(context);
1524
+ const window = context.cacheReuseWindowSeconds;
1525
+ // Optional launch field: older launches carry none.
1526
+ if (typeof window !== 'number' || !Number.isSafeInteger(window) || window <= 0)
1527
+ return policy;
1528
+ return { ...policy, cacheReuseWindowSeconds: window };
1529
+ }
1530
+
1531
+ function playRunnerContextForcePolicy(
1532
+ context: PlayRunnerExecutionConfig['context'],
1516
1533
  ): ContextOptions['cachePolicy'] | undefined {
1517
1534
  // A person resumed this run after fixing what made it stop, so calls that
1518
1535
  // failed before the resume run again. Successes stay recorded: only failed
@@ -2489,6 +2506,8 @@ async function run(
2489
2506
  persistedRows: number;
2490
2507
  succeededRows: number;
2491
2508
  failedRows: number;
2509
+ /** Stored column names in the order this run wrote them. */
2510
+ columns?: string[];
2492
2511
  }
2493
2512
  >();
2494
2513
  const runtimeSheetAttemptKey = (input: {
@@ -2825,6 +2844,9 @@ async function run(
2825
2844
  succeededRows: settlement.succeededRows,
2826
2845
  failedRows: settlement.failedRows,
2827
2846
  complete: false,
2847
+ ...(settlement.columns?.length
2848
+ ? { columns: settlement.columns }
2849
+ : {}),
2828
2850
  at: event.at,
2829
2851
  },
2830
2852
  },
@@ -3042,6 +3064,11 @@ async function run(
3042
3064
  // terminal persistence, advertising 2N rows for an N-row Dataset Handle.
3043
3065
  // `net_new` maps exclude these rows before execution, so they must not
3044
3066
  // be counted here either.
3067
+ settlement.columns = datasetWrittenColumnOrder({
3068
+ contract: sheetContract,
3069
+ rows: items,
3070
+ existing: settlement.columns,
3071
+ });
3045
3072
  runtimeMapDatasetSettlements.set(datasetId, settlement);
3046
3073
  emitRunnerEvent(
3047
3074
  {
@@ -3056,6 +3083,9 @@ async function run(
3056
3083
  succeededRows: 0,
3057
3084
  failedRows: 0,
3058
3085
  complete: false,
3086
+ ...(settlement.columns.length > 0
3087
+ ? { columns: settlement.columns }
3088
+ : {}),
3059
3089
  // ADR 0019 dataset-grain row birth. These rows entered from
3060
3090
  // play-body code, so the only witnessed fact is how many arrived at
3061
3091
  // this table — never a per-row source mapping, which the runtime
@@ -3426,6 +3456,13 @@ async function run(
3426
3456
  settlement.persistedRows += committedTerminalRows;
3427
3457
  settlement.succeededRows += succeededRows;
3428
3458
  settlement.failedRows += failedRows;
3459
+ settlement.columns = datasetWrittenColumnOrder({
3460
+ contract: sheetContract,
3461
+ // Completed rows arrive as map outcomes; the row itself is `data`.
3462
+ rows: input.rows.map((row) => row.data),
3463
+ outputFields: input.outputFields,
3464
+ existing: settlement.columns,
3465
+ });
3429
3466
  runtimeMapDatasetSettlements.set(datasetId, settlement);
3430
3467
  emitWorkerLog(
3431
3468
  `[perf] runtime map persist table=${input.tableNamespace} rows=${input.rows.length} updated=${result.updated} accepted=${committedTerminalRows} stale=${staleKeys.size} elapsed_ms=${Date.now() - persistStartedAt}`,
@@ -3709,6 +3746,9 @@ async function run(
3709
3746
  succeededRows: settlement.succeededRows,
3710
3747
  failedRows: settlement.failedRows,
3711
3748
  complete: true,
3749
+ ...(settlement.columns?.length
3750
+ ? { columns: settlement.columns }
3751
+ : {}),
3712
3752
  at: Date.now(),
3713
3753
  },
3714
3754
  },
@@ -4658,7 +4698,7 @@ let runnerTerminalPushContext: {
4658
4698
  gatewayBaseUrl: string;
4659
4699
  executorToken: string;
4660
4700
  runId: string;
4661
- sandboxProvider?: 'daytona' | 'modal';
4701
+ sandboxProvider?: 'daytona' | 'modal' | 'vercel';
4662
4702
  } | null = null;
4663
4703
 
4664
4704
  function terminalPushContextFromConfig(
@@ -64,6 +64,7 @@ export type RuntimeToolHooks = Required<
64
64
  | 'getToolOperation'
65
65
  | 'getToolIdempotencyScope'
66
66
  | 'getToolReusableResultSupport'
67
+ | 'getToolEffect'
67
68
  | 'getToolRetryPolicy'
68
69
  | 'getToolDurableRetryContext'
69
70
  | 'getToolActionCacheVersion'
@@ -123,6 +124,12 @@ export function createRuntimeToolHooks(input: {
123
124
  }
124
125
  return support;
125
126
  },
127
+ getToolEffect: async (toolId) => {
128
+ const effect = (await getRuntimeToolMetadata(toolId)).effect;
129
+ return effect === 'read' || effect === 'write' || effect === 'destructive'
130
+ ? effect
131
+ : null;
132
+ },
126
133
  getToolRetryPolicy: async (toolId) => {
127
134
  const metadata = await getRuntimeToolMetadata(toolId);
128
135
  return {
@@ -11,6 +11,7 @@ import type {
11
11
  import { daytonaPlayRunnerBackend } from './daytona';
12
12
  import { DaytonaSandboxAcquisitionUnavailableError } from './daytona-lifecycle';
13
13
  import { modalPlayRunnerBackend } from './modal';
14
+ import { vercelSandboxPlayRunnerBackend } from './vercel-sandbox';
14
15
  import { isPlayRunRecoveryError } from '../../play-run-recovery-policy';
15
16
  import {
16
17
  canTransitionRuntimeSandboxPlacement,
@@ -271,6 +272,7 @@ export function createRuntimeSandboxPlacementBackendForPolicy(
271
272
  overrides: {
272
273
  daytona?: PlayRunnerBackend;
273
274
  modal?: PlayRunnerBackend;
275
+ vercel?: PlayRunnerBackend;
274
276
  } = {},
275
277
  ): PlayRunnerBackend {
276
278
  return createRuntimeSandboxPlacementBackend({
@@ -284,6 +286,12 @@ export function createRuntimeSandboxPlacementBackendForPolicy(
284
286
  backend: overrides.modal ?? modalPlayRunnerBackend,
285
287
  classifyAcquisitionFailure: classifyModalAcquisitionFailure,
286
288
  },
289
+ // No policy transitions away from Vercel Sandbox, so it never
290
+ // classifies a failure as a fallback reason.
291
+ vercel: {
292
+ backend: overrides.vercel ?? vercelSandboxPlayRunnerBackend,
293
+ classifyAcquisitionFailure: () => null,
294
+ },
287
295
  },
288
296
  });
289
297
  }
@@ -324,6 +332,11 @@ export const modalThenDaytonaPlayRunnerBackend =
324
332
  RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalThenDaytonaV1,
325
333
  );
326
334
 
335
+ export const vercelSandboxOnlyPlayRunnerBackend =
336
+ createRuntimeSandboxPlacementBackendForPolicy(
337
+ RUNTIME_SANDBOX_PLACEMENT_POLICIES.vercelSandboxOnlyV1,
338
+ );
339
+
327
340
  const DEFAULT_POLICY_BACKENDS: Readonly<
328
341
  Record<RuntimeSandboxPlacementPolicyId, PlayRunnerBackend>
329
342
  > = {
@@ -336,6 +349,8 @@ const DEFAULT_POLICY_BACKENDS: Readonly<
336
349
  [RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalOnlyV1]: modalOnlyPlayRunnerBackend,
337
350
  [RUNTIME_SANDBOX_PLACEMENT_POLICIES.modalThenDaytonaV1]:
338
351
  modalThenDaytonaPlayRunnerBackend,
352
+ [RUNTIME_SANDBOX_PLACEMENT_POLICIES.vercelSandboxOnlyV1]:
353
+ vercelSandboxOnlyPlayRunnerBackend,
339
354
  };
340
355
 
341
356
  export function resolveDefaultRuntimeSandboxPlacementBackend(
@@ -99,6 +99,13 @@ export type StagedDaytonaPayload = {
99
99
  /** The inline command prints the baked verdict line before reading stdin. */
100
100
  verifiesBakedRunner?: boolean;
101
101
  };
102
+ /**
103
+ * An uploaded envelope with an in-command baked-runner check: `command`
104
+ * prefixed by the guard that prints the verdict and exits 98 before running
105
+ * anything unless the baked file hashes to the pin. Set only when the
106
+ * caller asked for `verifyInCommand` without stdin delivery.
107
+ */
108
+ bakedGuardedCommand?: string;
102
109
  };
103
110
 
104
111
  /** Exit code of the inline prefix when stdin did not carry the whole envelope. */
@@ -159,10 +166,11 @@ export type BakedRunnerExpectation = {
159
166
  path: string;
160
167
  verified: Promise<boolean>;
161
168
  /**
162
- * Inline (stdin) delivery only: the launch command itself verifies the
163
- * baked file before reading stdin, printing the verdict line first, so no
164
- * separate verify call is made. `verified` must then resolve true; a
165
- * non-`ok` verdict makes the command exit 98 before reading the envelope.
169
+ * The launch command itself verifies the baked file, printing the verdict
170
+ * line first, so no separate verify call is made. `verified` must then
171
+ * resolve true; a non-`ok` verdict makes the command exit 98 before running
172
+ * anything. With stdin delivery the guard is part of `inlineCommand`; with
173
+ * an uploaded envelope it is `bakedGuardedCommand`.
166
174
  */
167
175
  verifyInCommand?: boolean;
168
176
  };
@@ -669,7 +677,7 @@ async function timedRunnerPayloadUpload(input: {
669
677
  /** Records the acquired provider in the config the sandbox reads. */
670
678
  export function withRunnerSandboxProvider(
671
679
  config: PlayRunnerExecutionConfig,
672
- sandboxProvider: 'daytona' | 'modal',
680
+ sandboxProvider: 'daytona' | 'modal' | 'vercel',
673
681
  ): PlayRunnerExecutionConfig {
674
682
  const push = config.context.runnerPushExecution;
675
683
  if (!push) return config;
@@ -1277,8 +1285,18 @@ export async function stageRunnerPayload(input: {
1277
1285
  });
1278
1286
  }
1279
1287
 
1288
+ const bakedGuardedCommand =
1289
+ !inlineDelivery && input.bakedRunner?.verifyInCommand
1290
+ ? `${bakedRunnerGuardPrefix({
1291
+ nodeCommand,
1292
+ path: input.bakedRunner.path,
1293
+ hash: input.bakedRunner.hash,
1294
+ })}${command}`
1295
+ : undefined;
1296
+
1280
1297
  return {
1281
1298
  ...(inline ? { inlineEnvelope: inline } : {}),
1299
+ ...(bakedGuardedCommand ? { bakedGuardedCommand } : {}),
1282
1300
  workDir: input.workDir,
1283
1301
  command,
1284
1302
  outputPath,