deepline 0.3.541 → 0.3.543

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +106 -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 +17 -1
  8. package/dist/bundling-sources/shared_libs/integration-contracts/calendar-delegation.ts +132 -0
  9. package/dist/bundling-sources/shared_libs/integration-contracts/tool-connection.ts +13 -0
  10. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -1
  11. package/dist/bundling-sources/shared_libs/observability/queue-health.ts +9 -0
  12. package/dist/bundling-sources/shared_libs/observability/queue-item-connectors.ts +1 -0
  13. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +5 -5
  14. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +34 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +11 -5
  16. package/dist/bundling-sources/shared_libs/play-runtime/baked-runner-image.ts +9 -7
  17. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +235 -12
  18. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +20 -1
  19. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +39 -30
  20. package/dist/bundling-sources/shared_libs/play-runtime/event-wait-tools.ts +2 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/experiment-switches.ts +10 -4
  22. package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +209 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +4 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +24 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -1
  26. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +37 -0
  28. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +42 -3
  29. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +7 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +15 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +23 -5
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +320 -836
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/vercel-sandbox.ts +1061 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +862 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +45 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +3 -1
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +11 -5
  38. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-contract.ts +20 -2
  39. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +71 -34
  40. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-provider-profile.ts +286 -0
  41. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +4 -1
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +12 -3
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +46 -55
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +127 -5
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +7 -1
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +214 -0
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/managed-sandbox-resource-sql.ts +118 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +1 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +226 -144
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +1 -1
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +2 -1
  53. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +11 -13
  54. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-operation.ts +42 -7
  55. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +2 -1
  56. package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +2 -2
  57. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +17 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/vercel-sandbox-runtime-config.ts +217 -0
  59. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +23 -0
  60. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +1 -0
  61. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +76 -6
  62. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -0
  63. package/dist/bundling-sources/shared_libs/security/credential-revision.ts +50 -0
  64. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +2 -1
  65. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +37 -0
  66. package/dist/cli/{auth-WJXA7XGM.mjs → auth-ITAELTOA.mjs} +5 -5
  67. package/dist/cli/auth-S6B5WUU5.js +43 -0
  68. package/dist/cli/{billing-34IV5DSV.js → billing-33XVFDUJ.js} +101 -101
  69. package/dist/cli/{billing-SHS4HMWT.mjs → billing-WZ7RVZW4.mjs} +12 -12
  70. package/dist/cli/{chunk-UKO6POLZ.js → chunk-23D224GI.js} +37 -17
  71. package/dist/cli/{chunk-DF7ARQRB.mjs → chunk-274WKLSY.mjs} +2 -2
  72. package/dist/cli/{chunk-GBAT5NMI.mjs → chunk-2HSZCQMT.mjs} +48 -6
  73. package/dist/cli/{chunk-VLEVVDWG.js → chunk-2JHYYB3F.js} +3 -3
  74. package/dist/cli/{chunk-FVZ5Y5L6.js → chunk-2KTGZKRE.js} +18 -18
  75. package/dist/cli/{chunk-6TZEDCN7.js → chunk-2LNTKICO.js} +3 -3
  76. package/dist/cli/{chunk-FYQWTENQ.js → chunk-2NCJQEZH.js} +53 -53
  77. package/dist/cli/{chunk-CNBPATLI.js → chunk-3JZXU5OB.js} +5 -5
  78. package/dist/cli/{chunk-323I5KQ5.js → chunk-46BEBZ3M.js} +497 -328
  79. package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
  80. package/dist/cli/{chunk-XO2SGONT.mjs → chunk-4SKDSSPU.mjs} +2 -2
  81. package/dist/cli/{chunk-53QZ24DP.mjs → chunk-52YK3EII.mjs} +2 -2
  82. package/dist/cli/{chunk-S7NKIEHL.js → chunk-5MN3BKNB.js} +16 -16
  83. package/dist/cli/{chunk-XTR32PMA.mjs → chunk-5VIPTLRX.mjs} +1 -1
  84. package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
  85. package/dist/cli/{chunk-QI76LGE3.mjs → chunk-6SJZMMD5.mjs} +37 -190
  86. package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
  87. package/dist/cli/{chunk-GLINYHY7.mjs → chunk-AACKPOGA.mjs} +1 -1
  88. package/dist/cli/{chunk-Q66ADD4O.js → chunk-BGAUADV4.js} +41 -41
  89. package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
  90. package/dist/cli/{chunk-F3TLGM2U.js → chunk-C35NLLSA.js} +5 -5
  91. package/dist/cli/{chunk-LRPFCB2P.mjs → chunk-D6YAU3CF.mjs} +182 -13
  92. package/dist/cli/{chunk-FRPJSFNL.mjs → chunk-DH43ECTN.mjs} +7 -3
  93. package/dist/cli/{chunk-IZXMX65M.js → chunk-DI3GL3T6.js} +316 -469
  94. package/dist/cli/{chunk-OK4JMVTM.js → chunk-DUGTPVT7.js} +7 -7
  95. package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
  96. package/dist/cli/{chunk-KIYETQ6K.js → chunk-EHUG6EUT.js} +26 -26
  97. package/dist/cli/chunk-F6VSQ5LN.js +455 -0
  98. package/dist/cli/{chunk-JZNKEHXQ.mjs → chunk-FNW2SGPD.mjs} +2 -2
  99. package/dist/cli/{chunk-M6XIKHBS.js → chunk-GRCFX2EG.js} +4 -4
  100. package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
  101. package/dist/cli/{chunk-FTKX7OGB.mjs → chunk-HKJ26NRN.mjs} +5 -5
  102. package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
  103. package/dist/cli/{chunk-POZPEDW7.js → chunk-J2F6F5GL.js} +7 -7
  104. package/dist/cli/{chunk-7AUQSK24.mjs → chunk-JXG7HWBA.mjs} +1 -1
  105. package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
  106. package/dist/cli/{chunk-WIV3E6Y7.js → chunk-MCBUWK5K.js} +22 -22
  107. package/dist/cli/{chunk-2TAGAPLL.js → chunk-NHKP2NSU.js} +2 -2
  108. package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
  109. package/dist/cli/{chunk-UXXFCOE3.js → chunk-NLENABRU.js} +6 -6
  110. package/dist/cli/{chunk-DHC7EGI7.mjs → chunk-NR3O56FT.mjs} +5 -5
  111. package/dist/cli/{chunk-MPYM6TUO.js → chunk-O2KLWUNI.js} +44 -44
  112. package/dist/cli/{chunk-BMNLD63A.mjs → chunk-OAFKUHN5.mjs} +4 -4
  113. package/dist/cli/{chunk-RYYGNUNO.mjs → chunk-OELJKQOL.mjs} +24 -4
  114. package/dist/cli/{chunk-ZD673XAL.js → chunk-PX7XAVUC.js} +24 -20
  115. package/dist/cli/{chunk-FOCNY4GV.js → chunk-QFRMVI4S.js} +3 -3
  116. package/dist/cli/{chunk-AU7ZKXW5.mjs → chunk-R57UCXQG.mjs} +1 -1
  117. package/dist/cli/{chunk-IPVRMYWT.js → chunk-RKF263LR.js} +5 -5
  118. package/dist/cli/{chunk-CQDQNZGH.js → chunk-SL6MYJYM.js} +1 -0
  119. package/dist/cli/{chunk-BUCTWJBM.js → chunk-STXG2LFC.js} +2 -2
  120. package/dist/cli/{chunk-ECPCZVDM.mjs → chunk-SU4K4SUU.mjs} +1 -1
  121. package/dist/cli/{chunk-ABDXKELH.mjs → chunk-SYOPHFKB.mjs} +6 -6
  122. package/dist/cli/{chunk-H74CLEMB.mjs → chunk-SZNJENGT.mjs} +3 -3
  123. package/dist/cli/{chunk-5N4ENMYE.js → chunk-TBCNL2T5.js} +1 -1
  124. package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
  125. package/dist/cli/{chunk-C2LYJ3EX.js → chunk-UJ6GOV7K.js} +13 -13
  126. package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
  127. package/dist/cli/{chunk-6PJAC3P5.mjs → chunk-VSJEOSYL.mjs} +1 -1
  128. package/dist/cli/{chunk-NB4AIXEA.mjs → chunk-W2OPPSAZ.mjs} +3 -3
  129. package/dist/cli/{chunk-5LNWLEO3.mjs → chunk-XBM3KABD.mjs} +3 -3
  130. package/dist/cli/{chunk-VMIIUMAN.mjs → chunk-XFPVFWZR.mjs} +1 -1
  131. package/dist/cli/{chunk-UC5QFQGC.mjs → chunk-XSN6BAZT.mjs} +5 -5
  132. package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
  133. package/dist/cli/{chunk-S6FF7Q5P.js → chunk-YE3T73BV.js} +10 -10
  134. package/dist/cli/{chunk-CY5LW6DW.js → chunk-YJYKZ2U3.js} +2 -2
  135. package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
  136. package/dist/cli/{chunk-ZL2DER5D.mjs → chunk-ZRT2PNYY.mjs} +1 -1
  137. package/dist/cli/{chunk-WZMG2M65.mjs → chunk-ZSPBJB7I.mjs} +4 -4
  138. package/dist/cli/command-docs.js +3 -3
  139. package/dist/cli/command-docs.mjs +2 -2
  140. package/dist/cli/concurrent-runs-help-E4OYD3DS.js +21 -0
  141. package/dist/cli/{concurrent-runs-help-ZJ77SAEU.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
  142. package/dist/cli/{csv-PX7F5YJN.mjs → csv-5QW2HPHT.mjs} +4 -4
  143. package/dist/cli/{csv-MJLIZZOR.js → csv-SSOFTXHU.js} +13 -13
  144. package/dist/cli/{db-BNCNAY4G.js → db-4LK5AJNO.js} +29 -29
  145. package/dist/cli/{db-KPKGTHPA.mjs → db-K2JMR6EM.mjs} +8 -8
  146. package/dist/cli/describe-AC6PLEFP.js +50 -0
  147. package/dist/cli/describe-AXHQZHTT.mjs +50 -0
  148. package/dist/cli/describe-core.d.mts +3 -3
  149. package/dist/cli/describe-core.d.ts +3 -3
  150. package/dist/cli/describe-core.js +3 -3
  151. package/dist/cli/describe-core.mjs +2 -2
  152. package/dist/cli/{executions-YNOFR7T2.js → executions-AATJQQAQ.js} +10 -10
  153. package/dist/cli/{executions-NMQY4GEY.mjs → executions-FY2XTX2W.mjs} +8 -8
  154. package/dist/cli/{feedback-LWYEO5LL.mjs → feedback-MKBPRGS6.mjs} +6 -6
  155. package/dist/cli/{feedback-RCP5DPO6.js → feedback-QPVJER75.js} +14 -14
  156. package/dist/cli/{git-3O4PFP3Q.mjs → git-AGRFZR3K.mjs} +5 -5
  157. package/dist/cli/git-RUYFQEJX.js +25 -0
  158. package/dist/cli/index.js +150 -146
  159. package/dist/cli/index.mjs +49 -45
  160. package/dist/cli/integrations-OUQ6U33M.mjs +98 -0
  161. package/dist/cli/integrations-R6OUFZXI.js +98 -0
  162. package/dist/cli/{legacy-noops-KFP674JT.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
  163. package/dist/cli/{legacy-noops-ZPZRG366.js → legacy-noops-H7INM2QN.js} +9 -9
  164. package/dist/cli/{mcp-OCYUXQ6L.mjs → mcp-2Z2YVOLK.mjs} +72 -15
  165. package/dist/cli/{mcp-HCXDW6PL.js → mcp-33F7D7WI.js} +89 -32
  166. package/dist/cli/{monitors-7Q7YT22Y.js → monitors-KDUJHAKJ.js} +102 -102
  167. package/dist/cli/{monitors-V5KJIJJE.mjs → monitors-NZD2WIKK.mjs} +9 -9
  168. package/dist/cli/{org-S37K6QYH.js → org-4PQGHLEB.js} +164 -88
  169. package/dist/cli/{org-C3QLHX7U.mjs → org-EJW45RUA.mjs} +84 -8
  170. package/dist/cli/{play-MXQ2DKML.mjs → play-3CM5RT5J.mjs} +44 -25
  171. package/dist/cli/{play-MLREAYHJ.js → play-MLHMQL4G.js} +374 -355
  172. package/dist/cli/{providers-FDJ4ZOST.mjs → providers-BHYBJI4R.mjs} +10 -9
  173. package/dist/cli/{providers-PPDWY7DH.js → providers-YBJG7277.js} +13 -12
  174. package/dist/cli/{quickstart-2Z57AMB7.mjs → quickstart-LL3MR562.mjs} +4 -4
  175. package/dist/cli/{quickstart-BOWQM7S7.js → quickstart-O7L2NNGJ.js} +6 -6
  176. package/dist/cli/{run-66HXNJNV.js → run-HJ2AR6CM.js} +49 -48
  177. package/dist/cli/{run-5RNJGPQ2.mjs → run-OK545H5Q.mjs} +28 -27
  178. package/dist/cli/search-UUNS6BCC.js +32 -0
  179. package/dist/cli/{search-7G4FYQYO.mjs → search-Z5ZKMRTX.mjs} +9 -9
  180. package/dist/cli/{search-output-6K4FHCVI.mjs → search-output-Q5VHNUWG.mjs} +4 -4
  181. package/dist/cli/{search-output-L6ICQDBL.js → search-output-SVW4DETG.js} +6 -6
  182. package/dist/cli/{secrets-PWFJKF7G.js → secrets-ENQWMCB5.js} +17 -17
  183. package/dist/cli/{secrets-FTQPCU7O.mjs → secrets-QIKIEFWB.mjs} +8 -8
  184. package/dist/cli/{sessions-YSSAAQVJ.mjs → sessions-AETO22RF.mjs} +6 -6
  185. package/dist/cli/sessions-FNSUDERA.js +22 -0
  186. package/dist/cli/{settings-KN7GNZ5J.mjs → settings-G5RGRPFV.mjs} +16 -16
  187. package/dist/cli/{settings-CZEMF2WD.js → settings-OFLIFTMZ.js} +89 -89
  188. package/dist/cli/{setup-5WLHGH57.mjs → setup-G4N3X6KG.mjs} +9 -9
  189. package/dist/cli/{setup-RW4X6DX4.js → setup-QW7Y62XD.js} +49 -49
  190. package/dist/cli/skills-3IXIY2IV.js +36 -0
  191. package/dist/cli/{skills-DLVI7IZK.mjs → skills-QRFQGHNA.mjs} +7 -7
  192. package/dist/cli/{tools-JVYQF7P3.mjs → tools-52BH7UTF.mjs} +20 -19
  193. package/dist/cli/tools-MYBUMPKH.js +57 -0
  194. package/dist/cli/update-GT7574UU.js +34 -0
  195. package/dist/cli/{update-XKLXU7YS.mjs → update-SDGZLAGL.mjs} +9 -9
  196. package/dist/cli/{views-QRRCWP6B.mjs → views-3BIJFJMQ.mjs} +8 -8
  197. package/dist/cli/{views-YNUYFS3S.js → views-5QKAWYPI.js} +23 -23
  198. package/dist/cli/{workflow-YUKADKCJ.js → workflow-G67RPWVY.js} +19 -19
  199. package/dist/cli/{workflow-KYFMA4LM.mjs → workflow-QAK773FR.mjs} +9 -9
  200. package/dist/{client-B1fixtK1.d.ts → client-D1ga52xq.d.ts} +1 -1
  201. package/dist/{client-CE4QBVbp.d.mts → client-bd4QQIXo.d.mts} +1 -1
  202. package/dist/{client-core-C-3FVlVq.d.ts → client-core-B6eMVx8h.d.ts} +335 -4
  203. package/dist/{client-core-2BkNBgrx.d.mts → client-core-CqfWNf2Q.d.mts} +335 -4
  204. package/dist/{compiler-manifest-Cys06iYg.d.ts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
  205. package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.ts} +21 -0
  206. package/dist/{errors-B6eMjKcr.d.mts → errors-CwKXXtuu.d.mts} +1 -1
  207. package/dist/{errors-rdOUqcU2.d.ts → errors-Lm9_vJHZ.d.ts} +1 -1
  208. package/dist/{index-ejWadAL5.d.ts → index-3vJ-V9yw.d.ts} +1 -1
  209. package/dist/{index-CZdYO81A.d.mts → index-DjwsAt82.d.mts} +1 -1
  210. package/dist/index.d.mts +7 -7
  211. package/dist/index.d.ts +7 -7
  212. package/dist/index.js +12 -12
  213. package/dist/index.mjs +8 -8
  214. package/dist/install-integrity.json +147 -133
  215. package/dist/plays/bundle-play-file.d.mts +3 -3
  216. package/dist/plays/bundle-play-file.d.ts +3 -3
  217. package/dist/plays/bundle-play-file.mjs +23 -4
  218. package/dist/plays/play-description.d.mts +2 -2
  219. package/dist/plays/play-description.d.ts +2 -2
  220. package/dist/plays/run-request.d.mts +2 -2
  221. package/dist/plays/run-request.d.ts +2 -2
  222. package/dist/plays/run-request.js +2 -2
  223. package/dist/plays/run-request.mjs +1 -1
  224. package/dist/release.d.mts +1 -1
  225. package/dist/release.d.ts +1 -1
  226. package/dist/release.js +2 -2
  227. package/dist/release.mjs +1 -1
  228. package/dist/server.d.mts +4 -4
  229. package/dist/server.d.ts +4 -4
  230. package/dist/server.js +7 -7
  231. package/dist/server.mjs +5 -5
  232. package/package.json +1 -1
  233. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal-resource-usage.ts +0 -222
  234. package/dist/cli/auth-V76O674K.js +0 -43
  235. package/dist/cli/concurrent-runs-help-MFEPUP6Y.js +0 -21
  236. package/dist/cli/describe-5OUJA5TH.mjs +0 -49
  237. package/dist/cli/describe-7MF5AHIU.js +0 -49
  238. package/dist/cli/git-WLQ3BS6K.js +0 -25
  239. package/dist/cli/search-LTUIIV6W.js +0 -32
  240. package/dist/cli/sessions-2IVFGTPA.js +0 -22
  241. package/dist/cli/skills-WT42AZVH.js +0 -36
  242. package/dist/cli/tools-D6STYBQG.js +0 -56
  243. package/dist/cli/update-XTUKBC3J.js +0 -34
@@ -1,4 +1,8 @@
1
1
  import { createRateLimitedRuntimeLogger } from '../observability/runtime-console';
2
+ import {
3
+ startFleetSandboxSweepTimers,
4
+ type FleetSandboxSweepAdapter,
5
+ } from './/fleet-sandbox-sweep';
2
6
  import { withRuntimeSchedulerClient } from './/scheduler-backends/postgres-pool';
3
7
  import { RUNTIME_CAPACITY_POLICY } from './/runtime-capacity-policy';
4
8
  import { isIsolatedRuntimeSchedulerSchema } from './/runtime-scheduler-topology';
@@ -20,41 +24,43 @@ export type DaytonaSandboxJanitorOptions = {
20
24
  };
21
25
 
22
26
  /**
23
- * Start the production-only Daytona orphan sweep.
27
+ * The Daytona Adapter for the Fleet Sandbox Sweep, or null when this process
28
+ * must not sweep Daytona.
24
29
  *
25
30
  * Sandboxes have a source-scoped label shared by production, previews, and
26
31
  * worktrees. An isolated schema cannot authoritatively distinguish its own
27
32
  * sandboxes from the others, so it must never sweep. The fixed runtime
28
- * controller is the one production owner; moving this here makes the Daytona
33
+ * controller is the one production owner; keeping it there makes the Daytona
29
34
  * list/read traffic constant with fleet size.
35
+ *
36
+ * Enumeration is the Daytona label list; termination restores the durable
37
+ * Sandbox Cleanup obligation through the exact operation ledger
38
+ * (`reapOrphanDaytonaSandboxes`), never an unledgered provider delete.
30
39
  */
31
- export function startDaytonaSandboxJanitor(
40
+ export function createDaytonaFleetSandboxSweepAdapter(
32
41
  options: DaytonaSandboxJanitorOptions,
33
- ): { stop: () => void } {
42
+ ): FleetSandboxSweepAdapter | null {
34
43
  if (!process.env.DAYTONA_API_KEY?.trim()) {
35
44
  console.info('[daytona-janitor.controller] disabled (no DAYTONA_API_KEY)');
36
- return { stop: () => undefined };
45
+ return null;
37
46
  }
38
47
  if (isIsolatedRuntimeSchedulerSchema(options.schema)) {
39
48
  console.info('[daytona-janitor.controller] disabled (isolated schema)', {
40
49
  schema: options.schema,
41
50
  });
42
- return { stop: () => undefined };
51
+ return null;
43
52
  }
44
53
 
45
- let running = false;
46
54
  // Spans passes, so it cannot live in the per-pass reaper.
47
55
  const reportStaleList = createRateLimitedRuntimeLogger({
48
56
  log: (...args) => console.warn(...args),
49
57
  intervalMs: DAYTONA_STALE_LIST_ALERT_INTERVAL_MS,
50
58
  });
51
- const runPass = async (): Promise<void> => {
52
- if (running) {
53
- console.info('[daytona-janitor.controller] skip (previous pass running)');
54
- return;
55
- }
56
- running = true;
57
- try {
59
+ return {
60
+ provider: 'daytona',
61
+ scope: 'provider_inventory',
62
+ intervalMs: DAYTONA_JANITOR_INTERVAL_MS,
63
+ async runPass() {
58
64
  const [
59
65
  { listDaytonaControlSandboxes },
60
66
  { loadDaytonaRequiredConfig },
@@ -94,31 +100,34 @@ export function startDaytonaSandboxJanitor(
94
100
  }),
95
101
  options: { reportStaleList },
96
102
  });
97
- } catch (error) {
103
+ },
104
+ reportPassFailure(error) {
98
105
  // This is a best-effort resource backstop. A failed sweep must never
99
106
  // terminate the controller that scales and recovers customer work.
100
107
  console.warn('[daytona-janitor.controller] pass failed', {
101
108
  error: error instanceof Error ? error.message : String(error),
102
109
  });
103
- } finally {
104
- running = false;
105
- }
110
+ },
111
+ reportOverlap() {
112
+ console.info('[daytona-janitor.controller] skip (previous pass running)');
113
+ },
106
114
  };
115
+ }
107
116
 
108
- const interval = setInterval(() => {
109
- void runPass();
110
- }, DAYTONA_JANITOR_INTERVAL_MS);
111
- interval.unref();
112
-
113
- // Run once immediately. The singleton controller has no fleet-start
114
- // stampede to smooth, and an early pass shortens recovery after deploy.
115
- void runPass();
117
+ /**
118
+ * Start the production-only Daytona orphan sweep on the Fleet Sandbox Sweep's
119
+ * timer-driven owner: one pass now, then one every
120
+ * `DAYTONA_JANITOR_INTERVAL_MS`.
121
+ */
122
+ export function startDaytonaSandboxJanitor(
123
+ options: DaytonaSandboxJanitorOptions,
124
+ ): { stop: () => void } {
125
+ const adapter = createDaytonaFleetSandboxSweepAdapter(options);
126
+ if (!adapter) return { stop: () => undefined };
127
+ const { stop } = startFleetSandboxSweepTimers({ adapters: [adapter] });
116
128
  console.info('[daytona-janitor.controller] scheduled', {
117
129
  intervalMs: DAYTONA_JANITOR_INTERVAL_MS,
118
130
  schema: options.schema,
119
131
  });
120
-
121
- return {
122
- stop: () => clearInterval(interval),
123
- };
132
+ return { stop };
124
133
  }
@@ -1,6 +1,8 @@
1
1
  export const EVENT_WAIT_TOOL_IDS: ReadonlySet<string> = new Set([
2
2
  'slack_message_with_hitl',
3
3
  'slack_wait_for_action',
4
+ 'resend_send_and_wait',
5
+ 'resend_wait_for_reply',
4
6
  'slack_send_message_with_hitl',
5
7
  'test_wait_for_event',
6
8
  ]);
@@ -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,12 @@ 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
+ rows: input.rows,
3462
+ outputFields: input.outputFields,
3463
+ existing: settlement.columns,
3464
+ });
3429
3465
  runtimeMapDatasetSettlements.set(datasetId, settlement);
3430
3466
  emitWorkerLog(
3431
3467
  `[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 +3745,9 @@ async function run(
3709
3745
  succeededRows: settlement.succeededRows,
3710
3746
  failedRows: settlement.failedRows,
3711
3747
  complete: true,
3748
+ ...(settlement.columns?.length
3749
+ ? { columns: settlement.columns }
3750
+ : {}),
3712
3751
  at: Date.now(),
3713
3752
  },
3714
3753
  },
@@ -4658,7 +4697,7 @@ let runnerTerminalPushContext: {
4658
4697
  gatewayBaseUrl: string;
4659
4698
  executorToken: string;
4660
4699
  runId: string;
4661
- sandboxProvider?: 'daytona' | 'modal';
4700
+ sandboxProvider?: 'daytona' | 'modal' | 'vercel';
4662
4701
  } | null = null;
4663
4702
 
4664
4703
  function terminalPushContextFromConfig(