deepline 0.3.542 → 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 +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/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-IGBGOB4E.mjs → auth-ITAELTOA.mjs} +5 -5
  67. package/dist/cli/auth-S6B5WUU5.js +43 -0
  68. package/dist/cli/{billing-IB2TWE74.js → billing-33XVFDUJ.js} +101 -101
  69. package/dist/cli/{billing-N37W2I62.mjs → billing-WZ7RVZW4.mjs} +12 -12
  70. package/dist/cli/{chunk-D44DP4KJ.js → chunk-23D224GI.js} +37 -17
  71. package/dist/cli/{chunk-B5NP3SHX.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-FGGPCAGC.js → chunk-2KTGZKRE.js} +18 -18
  75. package/dist/cli/{chunk-AWLPERL3.js → chunk-2LNTKICO.js} +3 -3
  76. package/dist/cli/{chunk-5CAVURVS.js → chunk-2NCJQEZH.js} +53 -53
  77. package/dist/cli/{chunk-6SLEHAXX.js → chunk-3JZXU5OB.js} +5 -5
  78. package/dist/cli/{chunk-4I47NCRI.js → chunk-46BEBZ3M.js} +497 -328
  79. package/dist/cli/{chunk-V4EYJKGJ.js → chunk-4JQEAYN3.js} +156 -17
  80. package/dist/cli/{chunk-DADH3WPE.mjs → chunk-4SKDSSPU.mjs} +2 -2
  81. package/dist/cli/{chunk-FX4OWXKK.mjs → chunk-52YK3EII.mjs} +2 -2
  82. package/dist/cli/{chunk-HAITCPCG.js → chunk-5MN3BKNB.js} +16 -16
  83. package/dist/cli/{chunk-FFDZT255.mjs → chunk-5VIPTLRX.mjs} +1 -1
  84. package/dist/cli/{chunk-OLH2PHMC.mjs → chunk-6P7TGCHQ.mjs} +1 -1
  85. package/dist/cli/{chunk-YK7NNZD4.mjs → chunk-6SJZMMD5.mjs} +37 -190
  86. package/dist/cli/chunk-7AUQTNLB.mjs +455 -0
  87. package/dist/cli/{chunk-I5EAIFGO.mjs → chunk-AACKPOGA.mjs} +1 -1
  88. package/dist/cli/{chunk-GM73TZ2W.js → chunk-BGAUADV4.js} +41 -41
  89. package/dist/cli/{chunk-KQSTV4MW.js → chunk-BLYW6FFB.js} +60 -18
  90. package/dist/cli/{chunk-LFMQVSEI.js → chunk-C35NLLSA.js} +5 -5
  91. package/dist/cli/{chunk-5APOJWJF.mjs → chunk-D6YAU3CF.mjs} +182 -13
  92. package/dist/cli/{chunk-TT4JUUC3.mjs → chunk-DH43ECTN.mjs} +7 -3
  93. package/dist/cli/{chunk-TTBHOMAA.js → chunk-DI3GL3T6.js} +316 -469
  94. package/dist/cli/{chunk-D7GWEBMF.js → chunk-DUGTPVT7.js} +7 -7
  95. package/dist/cli/{chunk-UNDLNT3V.js → chunk-ECWOIXAV.js} +1 -1
  96. package/dist/cli/{chunk-CFZCRM6R.js → chunk-EHUG6EUT.js} +26 -26
  97. package/dist/cli/chunk-F6VSQ5LN.js +455 -0
  98. package/dist/cli/{chunk-ACVTMAW4.mjs → chunk-FNW2SGPD.mjs} +2 -2
  99. package/dist/cli/{chunk-EHLCWGWN.js → chunk-GRCFX2EG.js} +4 -4
  100. package/dist/cli/{chunk-OVX3Q5Q3.mjs → chunk-GWNYLIF7.mjs} +1 -1
  101. package/dist/cli/{chunk-6WQDHEVF.mjs → chunk-HKJ26NRN.mjs} +5 -5
  102. package/dist/cli/{chunk-L2VKAASU.mjs → chunk-HXIR3VQL.mjs} +21 -0
  103. package/dist/cli/{chunk-WL2GUGNZ.js → chunk-J2F6F5GL.js} +7 -7
  104. package/dist/cli/{chunk-2VRKBHMD.mjs → chunk-JXG7HWBA.mjs} +1 -1
  105. package/dist/cli/{chunk-Z2XA6YU4.mjs → chunk-LX35AXTN.mjs} +1 -0
  106. package/dist/cli/{chunk-DNGACHFX.js → chunk-MCBUWK5K.js} +22 -22
  107. package/dist/cli/{chunk-Q7WDXLYO.js → chunk-NHKP2NSU.js} +2 -2
  108. package/dist/cli/{chunk-FANIRW74.mjs → chunk-NIPLY25A.mjs} +0 -2
  109. package/dist/cli/{chunk-AKY7KZRJ.js → chunk-NLENABRU.js} +6 -6
  110. package/dist/cli/{chunk-ORA5TMML.mjs → chunk-NR3O56FT.mjs} +5 -5
  111. package/dist/cli/{chunk-3XXXMSSP.js → chunk-O2KLWUNI.js} +44 -44
  112. package/dist/cli/{chunk-ZVNYBQ77.mjs → chunk-OAFKUHN5.mjs} +4 -4
  113. package/dist/cli/{chunk-2ZGSHVZE.mjs → chunk-OELJKQOL.mjs} +24 -4
  114. package/dist/cli/{chunk-E7B73LGT.js → chunk-PX7XAVUC.js} +24 -20
  115. package/dist/cli/{chunk-VHJUH3TB.js → chunk-QFRMVI4S.js} +3 -3
  116. package/dist/cli/{chunk-Z5YRKX7K.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-JPT6VE54.js → chunk-STXG2LFC.js} +2 -2
  120. package/dist/cli/{chunk-SCLP5H4P.mjs → chunk-SU4K4SUU.mjs} +1 -1
  121. package/dist/cli/{chunk-NLZHLEHD.mjs → chunk-SYOPHFKB.mjs} +6 -6
  122. package/dist/cli/{chunk-WACIN4PR.mjs → chunk-SZNJENGT.mjs} +3 -3
  123. package/dist/cli/{chunk-QXNOSCYL.js → chunk-TBCNL2T5.js} +1 -1
  124. package/dist/cli/{chunk-E4CABWXL.js → chunk-TI6DTURF.js} +22 -1
  125. package/dist/cli/{chunk-NDNEARE3.js → chunk-UJ6GOV7K.js} +13 -13
  126. package/dist/cli/{chunk-GWHA4DAC.js → chunk-UV4RU2TE.js} +0 -2
  127. package/dist/cli/{chunk-P4MDTBAA.mjs → chunk-VSJEOSYL.mjs} +1 -1
  128. package/dist/cli/{chunk-EGOCGWCI.mjs → chunk-W2OPPSAZ.mjs} +3 -3
  129. package/dist/cli/{chunk-46V7QSJE.mjs → chunk-XBM3KABD.mjs} +3 -3
  130. package/dist/cli/{chunk-QONO7FRF.mjs → chunk-XFPVFWZR.mjs} +1 -1
  131. package/dist/cli/{chunk-PLIKPGOO.mjs → chunk-XSN6BAZT.mjs} +5 -5
  132. package/dist/cli/{chunk-IDDKNMFX.mjs → chunk-Y3T5GWYK.mjs} +153 -14
  133. package/dist/cli/{chunk-AUFE624T.js → chunk-YE3T73BV.js} +10 -10
  134. package/dist/cli/{chunk-DMXLZ57N.js → chunk-YJYKZ2U3.js} +2 -2
  135. package/dist/cli/{chunk-F6QV42MC.mjs → chunk-Z7SXGOIQ.mjs} +1 -1
  136. package/dist/cli/{chunk-SWO5QOXB.mjs → chunk-ZRT2PNYY.mjs} +1 -1
  137. package/dist/cli/{chunk-3LEUSRV3.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-DIBGMEIN.mjs → concurrent-runs-help-Z6ODNL4E.mjs} +7 -7
  142. package/dist/cli/{csv-CAVA3EMS.mjs → csv-5QW2HPHT.mjs} +4 -4
  143. package/dist/cli/{csv-XZAM7EYZ.js → csv-SSOFTXHU.js} +13 -13
  144. package/dist/cli/{db-PPGEOBNG.js → db-4LK5AJNO.js} +29 -29
  145. package/dist/cli/{db-HD332QI7.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-4ZKBL7IC.js → executions-AATJQQAQ.js} +10 -10
  153. package/dist/cli/{executions-AFEOLB4A.mjs → executions-FY2XTX2W.mjs} +8 -8
  154. package/dist/cli/{feedback-J2YPLKMF.mjs → feedback-MKBPRGS6.mjs} +6 -6
  155. package/dist/cli/{feedback-M6Y33JKT.js → feedback-QPVJER75.js} +14 -14
  156. package/dist/cli/{git-632RYEF6.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-KWZMXYAU.mjs → legacy-noops-DVL2RRKL.mjs} +6 -6
  163. package/dist/cli/{legacy-noops-4Y62TKPC.js → legacy-noops-H7INM2QN.js} +9 -9
  164. package/dist/cli/{mcp-PESLHAAC.mjs → mcp-2Z2YVOLK.mjs} +72 -15
  165. package/dist/cli/{mcp-35QA6YG7.js → mcp-33F7D7WI.js} +89 -32
  166. package/dist/cli/{monitors-4DTUZLAI.js → monitors-KDUJHAKJ.js} +102 -102
  167. package/dist/cli/{monitors-YVBKBJBU.mjs → monitors-NZD2WIKK.mjs} +9 -9
  168. package/dist/cli/{org-FWCBZMER.js → org-4PQGHLEB.js} +90 -90
  169. package/dist/cli/{org-DJNKMFCZ.mjs → org-EJW45RUA.mjs} +8 -8
  170. package/dist/cli/{play-PHVQEEEZ.mjs → play-3CM5RT5J.mjs} +44 -25
  171. package/dist/cli/{play-FZ45M4KD.js → play-MLHMQL4G.js} +374 -355
  172. package/dist/cli/{providers-46E67QG7.mjs → providers-BHYBJI4R.mjs} +10 -9
  173. package/dist/cli/{providers-QJU6FMDD.js → providers-YBJG7277.js} +13 -12
  174. package/dist/cli/{quickstart-6HMJJ4RR.mjs → quickstart-LL3MR562.mjs} +4 -4
  175. package/dist/cli/{quickstart-HOL7H5FS.js → quickstart-O7L2NNGJ.js} +6 -6
  176. package/dist/cli/{run-WKSIRXEC.js → run-HJ2AR6CM.js} +49 -48
  177. package/dist/cli/{run-2W2TJ6QA.mjs → run-OK545H5Q.mjs} +28 -27
  178. package/dist/cli/search-UUNS6BCC.js +32 -0
  179. package/dist/cli/{search-Y2CFLSYB.mjs → search-Z5ZKMRTX.mjs} +9 -9
  180. package/dist/cli/{search-output-FCZ35PHF.mjs → search-output-Q5VHNUWG.mjs} +4 -4
  181. package/dist/cli/{search-output-2IK6ZZDY.js → search-output-SVW4DETG.js} +6 -6
  182. package/dist/cli/{secrets-JVJIHGU4.js → secrets-ENQWMCB5.js} +17 -17
  183. package/dist/cli/{secrets-PNPNUZLX.mjs → secrets-QIKIEFWB.mjs} +8 -8
  184. package/dist/cli/{sessions-GY5VVQGO.mjs → sessions-AETO22RF.mjs} +6 -6
  185. package/dist/cli/sessions-FNSUDERA.js +22 -0
  186. package/dist/cli/{settings-YQOPF3AI.mjs → settings-G5RGRPFV.mjs} +16 -16
  187. package/dist/cli/{settings-5WHMFRNQ.js → settings-OFLIFTMZ.js} +89 -89
  188. package/dist/cli/{setup-O5U5IEVW.mjs → setup-G4N3X6KG.mjs} +9 -9
  189. package/dist/cli/{setup-3VJMKDEU.js → setup-QW7Y62XD.js} +49 -49
  190. package/dist/cli/skills-3IXIY2IV.js +36 -0
  191. package/dist/cli/{skills-G6J5PF35.mjs → skills-QRFQGHNA.mjs} +7 -7
  192. package/dist/cli/{tools-AG7SWL5Y.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-K73DD6CR.mjs → update-SDGZLAGL.mjs} +9 -9
  196. package/dist/cli/{views-MO6DIOMR.mjs → views-3BIJFJMQ.mjs} +8 -8
  197. package/dist/cli/{views-4D2OTLIO.js → views-5QKAWYPI.js} +23 -23
  198. package/dist/cli/{workflow-ZEMFCS4Y.js → workflow-G67RPWVY.js} +19 -19
  199. package/dist/cli/{workflow-MMZMAELI.mjs → workflow-QAK773FR.mjs} +9 -9
  200. package/dist/{client-X-FJD5Dp.d.ts → client-D1ga52xq.d.ts} +1 -1
  201. package/dist/{client-DLG9mHDh.d.mts → client-bd4QQIXo.d.mts} +1 -1
  202. package/dist/{client-core-0jmHfFBv.d.ts → client-core-B6eMVx8h.d.ts} +334 -3
  203. package/dist/{client-core-WtnqyBwY.d.mts → client-core-CqfWNf2Q.d.mts} +334 -3
  204. package/dist/{compiler-manifest-Cys06iYg.d.mts → compiler-manifest-BWFtsQIC.d.mts} +21 -0
  205. package/dist/{compiler-manifest-Cys06iYg.d.ts → 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-2PH6RSKL.js +0 -43
  235. package/dist/cli/concurrent-runs-help-BNIDBKML.js +0 -21
  236. package/dist/cli/describe-5TFFB2PM.js +0 -49
  237. package/dist/cli/describe-THQU7N47.mjs +0 -49
  238. package/dist/cli/git-AQLQYWRI.js +0 -25
  239. package/dist/cli/search-YLJFCJTK.js +0 -32
  240. package/dist/cli/sessions-TZ33UCPS.js +0 -22
  241. package/dist/cli/skills-WZY3XDT3.js +0 -36
  242. package/dist/cli/tools-BXQBL72Q.js +0 -56
  243. package/dist/cli/update-XYP5EII6.js +0 -34
@@ -277,17 +277,17 @@
277
277
  "id": "github.prebuilt-benchmarks",
278
278
  "name": "Prebuilt benchmarks",
279
279
  "scheduler": "github_actions",
280
- "cadence": "0 14 * * 1",
280
+ "cadence": "30 7 * * *",
281
281
  "timezone": "UTC",
282
282
  "source": ".github/workflows/prebuilt-benchmarks.yml",
283
283
  "locator": "schedule:",
284
284
  "owner": "evals",
285
285
  "criticality": "reporting",
286
- "purpose": "Run each prebuilt play on its fixed labeled sample in a disposable Production workspace with the published CLI and publish found, exact, recall, precision and settled credits.",
287
- "successDefinition": "Every benchmark exports its rows, scores them, settles within its credit cap, and the summary uploads; the disposable workspace is deleted.",
288
- "failureDefinition": "Workspace bootstrap, dataset load, a play run, export, scoring, a credit-cap overrun, or workspace deletion fails.",
286
+ "purpose": "Run each prebuilt play on its fixed labeled sample in the persistent benchmark workspace on Production with the published CLI (reusing results under 4 days old when nothing changed) and publish found, exact, recall, precision and settled credits.",
287
+ "successDefinition": "Every benchmark exports its rows (or reuses a recent fresh run), scores them, settles within its credit cap and the workspace's 2000-credit monthly usage cap, and the summary uploads.",
288
+ "failureDefinition": "A dataset load, play run, export, scoring or credit-cap overrun fails, or the workspace's monthly usage cap is missing or used up.",
289
289
  "startGraceMs": 600000,
290
- "runTimeoutMs": 7200000,
290
+ "runTimeoutMs": 18000000,
291
291
  "failureAlert": "github_workflow_run",
292
292
  "domainReportRequired": true
293
293
  },
@@ -284,3 +284,37 @@ export function augmentSheetContractWithDatasetFields(input: {
284
284
 
285
285
  return { ...input.contract, columns: [...inputColumns, ...outputColumns] };
286
286
  }
287
+
288
+ /**
289
+ * A dataset's stored column names in the order a run wrote them: each row's
290
+ * keys in the order the Play built them (first seen across `rows`), then each
291
+ * output field (its `withColumn`s, in declaration order), continuing an order
292
+ * recorded earlier in the run (`existing`). This is the order the run page
293
+ * shows; the table's own column order is creation order across every run and
294
+ * goes stale when a Play changes.
295
+ */
296
+ export function datasetWrittenColumnOrder(input: {
297
+ contract: PlaySheetContract;
298
+ rows: readonly Record<string, unknown>[];
299
+ outputFields?: readonly string[];
300
+ existing?: readonly string[];
301
+ }): string[] {
302
+ const order = [...(input.existing ?? [])];
303
+ const seen = new Set(order);
304
+ const append = (field: string) => {
305
+ if (!isDatasetPayloadField(field)) return;
306
+ const declared = input.contract.columns.find(
307
+ (column) =>
308
+ (column.source === 'input' || column.source === 'datasetColumn') &&
309
+ (column.field ?? column.id) === field,
310
+ );
311
+ const sqlName = declared?.sqlName ?? sqlSafePlayColumnName(field);
312
+ if (seen.has(sqlName)) return;
313
+ seen.add(sqlName);
314
+ order.push(sqlName);
315
+ };
316
+ for (const row of input.rows)
317
+ for (const field of Object.keys(row)) append(field);
318
+ for (const field of input.outputFields ?? []) append(field);
319
+ return order;
320
+ }
@@ -165,6 +165,8 @@ export type RuntimeStatusUpdate = {
165
165
  complete?: boolean;
166
166
  /** Dataset-grain row birth, stated once per dataset (ADR 0019). */
167
167
  bornFrom?: PlayDatasetBornFrom;
168
+ /** Stored column names in the order the run wrote them. */
169
+ columns?: string[];
168
170
  at: number;
169
171
  }>;
170
172
  /** Sparse typed activity facts. Routing/deduplication happens server-side. */
@@ -2472,10 +2474,9 @@ export async function listViewsViaAppRuntime(
2472
2474
  context: WorkerRuntimeApiContext,
2473
2475
  ): Promise<PlayViewLink[]> {
2474
2476
  try {
2475
- const result = await postAppRuntimeApi<{ views: PlayViewLink[] }>(
2476
- context,
2477
- { action: 'list_views' },
2478
- );
2477
+ const result = await postAppRuntimeApi<{ views: PlayViewLink[] }>(context, {
2478
+ action: 'list_views',
2479
+ });
2479
2480
  return result.views;
2480
2481
  } catch (error) {
2481
2482
  // An older receiver does not know list_views. Say so instead of returning
@@ -2728,7 +2729,11 @@ async function updateRunStatusViaAppRuntimeUnlocked(
2728
2729
  // an unattributed or stale birth for the whole run.
2729
2730
  (event.bornFrom !== undefined &&
2730
2731
  (!current.bornFrom ||
2731
- event.bornFrom.rowCountIn > current.bornFrom.rowCountIn));
2732
+ event.bornFrom.rowCountIn > current.bornFrom.rowCountIn)) ||
2733
+ // A longer written column order (a later page or the terminal write
2734
+ // adding withColumns) is a change the snapshot must keep.
2735
+ (event.columns !== undefined &&
2736
+ event.columns.length > (current.columns?.length ?? 0));
2732
2737
  if (!changesSnapshot) continue;
2733
2738
  events.push({
2734
2739
  type: RUN_EVENT_KIND.datasetLifecycle,
@@ -2750,6 +2755,7 @@ async function updateRunStatusViaAppRuntimeUnlocked(
2750
2755
  : { failedRows: event.failedRows }),
2751
2756
  ...(event.complete === undefined ? {} : { complete: event.complete }),
2752
2757
  ...(event.bornFrom === undefined ? {} : { bornFrom: event.bornFrom }),
2758
+ ...(event.columns === undefined ? {} : { columns: event.columns }),
2753
2759
  });
2754
2760
  }
2755
2761
  const latestActivities = new Map(
@@ -32,14 +32,16 @@ export const BAKED_RUNNER_SELF_MODE = 'self';
32
32
  export const BAKED_RUNNER_OFF_MODE = 'off';
33
33
 
34
34
  /**
35
- * Release-owned enable for self-versioned baked runner images. While false, an
36
- * unset worker setting keeps today's full upload, and the Production release
37
- * and Preview `runtime up` do not publish. Flipping it to true makes, in the
38
- * same release, the release publish `deepline-play-runner:<own bundle hash>`
39
- * before its workers roll and those workers look that image up. Read by
40
- * `.github/workflows/production-release.yml` and `scripts/runtime-target.ts`.
35
+ * Release-owned enable for self-versioned baked runner images. While true, an
36
+ * unset worker setting means `self`: each worker looks up
37
+ * `deepline-play-runner:<own bundle hash>`, and the Production release and
38
+ * Preview preparation publish that image beside the worker roll. A worker
39
+ * whose image is absent, unreadable or mismatched uploads the runner as
40
+ * before. `DEEPLINE_BAKED_RUNNER_HASH=off` on a worker is the kill switch.
41
+ * Read from the release SHA by `.github/workflows/production-release.yml` and
42
+ * from the target checkout by `scripts/run-daytona-preview-release-gate.sh`.
41
43
  */
42
- export const BAKED_RUNNER_SELF_VERSIONED: boolean = false;
44
+ export const BAKED_RUNNER_SELF_VERSIONED: boolean = true;
43
45
  export const BAKED_RUNNER_ROOT = '/opt/deepline/runner';
44
46
  export const BAKED_RUNNER_FILE_NAME = 'play-runner.cjs';
45
47
 
@@ -340,6 +340,7 @@ import {
340
340
  import {
341
341
  CtxFetchHttpError,
342
342
  LEGACY_PLAY_AUTHORING_CONTRACT_EDITION,
343
+ isToolConnectionName,
343
344
  PLAY_AUTHORING_CONTRACT_EDITION,
344
345
  normalizePlayAuthoringCustomerDbStatement,
345
346
  validateOptionalPlayAuthoringField,
@@ -402,6 +403,7 @@ import {
402
403
  isQueryResultDatasetTool,
403
404
  } from './query-result-dataset';
404
405
  import {
406
+ applyCacheReuseWindow,
405
407
  isAlwaysFreshIntegrationTool,
406
408
  isAlwaysFreshIntegrationWriteTool,
407
409
  reusableWindowEligibility,
@@ -751,6 +753,14 @@ const authoredStepContext = new AsyncLocalStorage<{
751
753
  invocationId?: string;
752
754
  }>();
753
755
  const toolExecutionOverrides = new AsyncLocalStorage<{ force: boolean }>();
756
+ const namedWorkspaceTool = new AsyncLocalStorage<{
757
+ toolId: string;
758
+ name: string;
759
+ id: string;
760
+ grantGeneration: number;
761
+ digest: string;
762
+ rateScope: { bucketId: string; token: string };
763
+ }>();
754
764
  /**
755
765
  * `ctx.runSteps` passes each `runIf` leg to `ctx.step` with a receipt gate
756
766
  * keyed by the leg's body. Unless the run's checkpoint already holds the
@@ -3390,9 +3400,11 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
3390
3400
  Promise<ResolvedPlayExecutor>
3391
3401
  >();
3392
3402
  readonly tools = {
3403
+ namedWorkspaceConnections: true,
3393
3404
  execute: <TOutput = unknown>(request: {
3394
3405
  id: string;
3395
3406
  tool: string;
3407
+ connection?: string;
3396
3408
  input: Record<string, unknown>;
3397
3409
  description?: string;
3398
3410
  force?: boolean;
@@ -3407,6 +3419,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
3407
3419
  'ctx.tools.execute requires a request object: ctx.tools.execute({ id, tool, input, description }).',
3408
3420
  );
3409
3421
  }
3422
+ if (request.connection !== undefined) {
3423
+ const { connection, ...call } = request;
3424
+ return this.withNamedWorkspaceTool(call.tool, connection, () =>
3425
+ this.tools.execute<TOutput>(call),
3426
+ );
3427
+ }
3410
3428
  validatePlayAuthoringField('ctx.tools.execute.id', request.id);
3411
3429
  validatePlayAuthoringField('ctx.tools.execute.tool', request.tool);
3412
3430
  validatePlayAuthoringField('ctx.tools.execute.input', request.input);
@@ -3886,7 +3904,12 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
3886
3904
  options.getToolQueueHints,
3887
3905
  options.getToolProvider,
3888
3906
  ),
3889
- resolveRateScope: options.getToolRateScope,
3907
+ resolveRateScope: (toolId, provider) => {
3908
+ const named = namedWorkspaceTool.getStore();
3909
+ return named?.toolId === toolId
3910
+ ? named.rateScope
3911
+ : (options.getToolRateScope?.(toolId, provider) ?? null);
3912
+ },
3890
3913
  maxConcurrentExternalCalls: options.maxConcurrentExternalCalls,
3891
3914
  maxConcurrentRows: options.maxConcurrentRows,
3892
3915
  // A root run keeps depth 0 (its first child play is depth 1) but still
@@ -4390,6 +4413,33 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
4390
4413
  return callOrder.id;
4391
4414
  }
4392
4415
 
4416
+ /**
4417
+ * Whether the run's internal reuse window may lengthen this call's window.
4418
+ * The Play author never accepted reuse, so only a catalog read qualifies:
4419
+ * effect `read`, no invocation-scoped idempotency, no execution fence. A
4420
+ * write, send or purchase keeps its authored window, as does a tool whose
4421
+ * effect is unknown or whose metadata lookup fails.
4422
+ */
4423
+ private async cacheReuseWindowAdmits(
4424
+ toolId: string,
4425
+ input: Record<string, unknown>,
4426
+ ): Promise<boolean> {
4427
+ try {
4428
+ const [scope, retry, effect] = await Promise.all([
4429
+ this.#options.getToolIdempotencyScope?.(toolId),
4430
+ this.#options.getToolRetryPolicy?.(toolId, input),
4431
+ this.#options.getToolEffect?.(toolId),
4432
+ ]);
4433
+ return (
4434
+ effect === 'read' &&
4435
+ scope !== 'invocation' &&
4436
+ retry?.requiresExecutionFence !== true
4437
+ );
4438
+ } catch {
4439
+ return false;
4440
+ }
4441
+ }
4442
+
4393
4443
  /**
4394
4444
  * A tool is a read on replay mismatch only when its metadata proves it: no
4395
4445
  * invocation-scoped idempotency, no execution fence, not SQL, and either a
@@ -7355,6 +7405,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
7355
7405
  private async resolveToolAuthScopeDigest(
7356
7406
  toolId: string,
7357
7407
  ): Promise<string | null> {
7408
+ const named = namedWorkspaceTool.getStore();
7409
+ if (named?.toolId === toolId) return named.digest;
7358
7410
  const configured = await this.#options.getToolAuthScopeDigest?.(toolId);
7359
7411
  if (typeof configured === 'string' && configured.trim()) {
7360
7412
  return configured.trim();
@@ -7366,6 +7418,73 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
7366
7418
  this.#options.invalidateToolAuthScopeDigest?.(toolId);
7367
7419
  }
7368
7420
 
7421
+ private async withNamedWorkspaceTool<T>(
7422
+ toolId: string,
7423
+ name: string,
7424
+ execute: () => Promise<T>,
7425
+ ): Promise<T> {
7426
+ if (!isToolConnectionName(name)) {
7427
+ throw new Error('Choose a valid workspace connection name.');
7428
+ }
7429
+ if (
7430
+ rowContext.getStore() ||
7431
+ authoredStepContext.getStore() ||
7432
+ this.activeInlineComposition ||
7433
+ this.pureMapExecutionActive
7434
+ ) {
7435
+ throw new Error(
7436
+ 'Named workspace connections currently require a tool call in the Play entry function.',
7437
+ );
7438
+ }
7439
+ const { baseUrl, executorToken } = this.#options;
7440
+ if (!baseUrl || !executorToken)
7441
+ throw new Error(
7442
+ 'Named workspace connections require a Deepline Play run.',
7443
+ );
7444
+ const path = `/api/v2/plays/runtime-tools/${encodeURIComponent(toolId)}/auth-scope`;
7445
+ const url = new URL(path, baseUrl);
7446
+ url.searchParams.set('connection', name);
7447
+ const response = await fetch(url, {
7448
+ headers: {
7449
+ Authorization: `Bearer ${executorToken}`,
7450
+ ...(await this.vercelProtectionHeaders()),
7451
+ },
7452
+ redirect: 'error',
7453
+ signal: AbortSignal.timeout(15_000),
7454
+ });
7455
+ const result = await response.json().catch(() => null);
7456
+ const binding = result?.workspaceConnection;
7457
+ if (!response.ok)
7458
+ throw new Error(
7459
+ typeof result?.error === 'string'
7460
+ ? result.error
7461
+ : 'Could not resolve the named workspace connection.',
7462
+ );
7463
+ if (
7464
+ binding?.name !== name ||
7465
+ typeof binding.id !== 'string' ||
7466
+ !Number.isSafeInteger(binding.grantGeneration) ||
7467
+ typeof result?.digest !== 'string' ||
7468
+ !result.digest ||
7469
+ typeof result?.rateScope?.bucketId !== 'string' ||
7470
+ typeof result.rateScope.token !== 'string'
7471
+ )
7472
+ throw new Error(
7473
+ 'The runtime gateway did not confirm the named workspace connection.',
7474
+ );
7475
+ return namedWorkspaceTool.run(
7476
+ {
7477
+ toolId,
7478
+ name,
7479
+ id: binding.id,
7480
+ grantGeneration: binding.grantGeneration,
7481
+ digest: result.digest,
7482
+ rateScope: result.rateScope,
7483
+ },
7484
+ execute,
7485
+ );
7486
+ }
7487
+
7369
7488
  #replayUnsafeMarker: Promise<void> | null = null;
7370
7489
 
7371
7490
  /**
@@ -15103,14 +15222,44 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
15103
15222
  'Call the Google Calendar booking tool directly in the admitted Play.',
15104
15223
  );
15105
15224
  }
15225
+ const refreshed =
15226
+ this.#options.cachePolicy?.forceToolRefresh === true ||
15227
+ toolExecutionOverrides.getStore()?.force === true;
15228
+ // The run's internal reuse window (`cacheReuseWindowSeconds`). A refresh
15229
+ // and an authored `force` still win over it.
15230
+ const reuseWindow =
15231
+ refreshed || options?.force === true
15232
+ ? undefined
15233
+ : this.#options.cachePolicy?.cacheReuseWindowSeconds;
15106
15234
  if (!this.usesExplicitFreshness) {
15107
15235
  this.reuseCountSupported = false;
15108
- return this.executeToolLegacyInternal(key, toolId, input, options);
15236
+ let legacyOptions = options;
15237
+ if (reuseWindow) {
15238
+ const eventWait = Boolean(
15239
+ await this.#options.getIntegrationEventWaitHandler?.(toolId),
15240
+ );
15241
+ const verdict = reusableWindowEligibility({
15242
+ kind: 'tool',
15243
+ toolId,
15244
+ input,
15245
+ eventWait,
15246
+ });
15247
+ if (
15248
+ !('message' in verdict) &&
15249
+ (await this.cacheReuseWindowAdmits(toolId, input))
15250
+ ) {
15251
+ legacyOptions = {
15252
+ ...options,
15253
+ staleAfterSeconds: applyCacheReuseWindow(
15254
+ options?.staleAfterSeconds,
15255
+ reuseWindow,
15256
+ ),
15257
+ };
15258
+ }
15259
+ }
15260
+ return this.executeToolLegacyInternal(key, toolId, input, legacyOptions);
15109
15261
  }
15110
15262
  const policy = resolveExplicitDurableCallPolicy(options ?? {});
15111
- const refreshed =
15112
- this.#options.cachePolicy?.forceToolRefresh === true ||
15113
- toolExecutionOverrides.getStore()?.force === true;
15114
15263
  // A refresh of an authored reusable read still publishes its fresh result
15115
15264
  // as the request's newest shared result. An authored 0 never does.
15116
15265
  const refreshMayPublish =
@@ -15177,7 +15326,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
15177
15326
  throw new Error(reuseVerdict.message);
15178
15327
  }
15179
15328
  const eventWait =
15180
- policy.effective === 0 && !refreshMayPublish
15329
+ policy.effective === 0 && !refreshMayPublish && !reuseWindow
15181
15330
  ? null
15182
15331
  : ((await this.#options.getIntegrationEventWaitHandler?.(toolId)) ??
15183
15332
  null);
@@ -15195,6 +15344,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
15195
15344
  throw new Error(effectiveVerdict.message);
15196
15345
  }
15197
15346
  const mustExecuteEveryTime = 'message' in effectiveVerdict;
15347
+ if (
15348
+ reuseWindow &&
15349
+ !mustExecuteEveryTime &&
15350
+ (await this.cacheReuseWindowAdmits(toolId, input))
15351
+ ) {
15352
+ policy.effective = applyCacheReuseWindow(policy.effective, reuseWindow);
15353
+ }
15198
15354
  // A refresh of a reusable call still publishes its fresh result as the
15199
15355
  // request's newest shared result; an authored 0 never does.
15200
15356
  const publishLatestOnRefresh = refreshMayPublish && !mustExecuteEveryTime;
@@ -16838,7 +16994,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
16838
16994
  } catch (error) {
16839
16995
  if (
16840
16996
  !(error instanceof ToolExecuteAuthScopeChangedError) ||
16841
- authScopeAttempt > 0
16997
+ authScopeAttempt > 0 ||
16998
+ namedWorkspaceTool.getStore() !== undefined
16842
16999
  ) {
16843
17000
  throw error;
16844
17001
  }
@@ -16974,7 +17131,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
16974
17131
  // durable can still repeat the finalizer on a later attempt.
16975
17132
  if (timeoutFinalizedAt === undefined && handler.onTimeout) {
16976
17133
  try {
16977
- await handler.onTimeout({
17134
+ const finalized = await handler.onTimeout({
16978
17135
  payload: input,
16979
17136
  context: eventContext,
16980
17137
  boundary: {
@@ -16995,6 +17152,29 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
16995
17152
  ...(timeoutPolicy ? { timeoutPolicy } : {}),
16996
17153
  },
16997
17154
  });
17155
+ if (finalized && finalized.resolvedOutput) {
17156
+ // The provider owner arbitrates a reply racing the scheduler's
17157
+ // timeout. Persist its winning outcome before the Play consumes it.
17158
+ existing.output = finalized.resolvedOutput;
17159
+ this.checkpoint.resolvedBoundaries = {
17160
+ ...(this.checkpoint.resolvedBoundaries ?? {}),
17161
+ [preparedBoundary.boundaryId]: {
17162
+ ...existing,
17163
+ timeoutFinalizedAt: Date.now(),
17164
+ },
17165
+ };
17166
+ this.#options.onBatchComplete?.(this.checkpoint);
17167
+ return await this.wrapToolExecutionResult({
17168
+ toolId,
17169
+ status: 'completed',
17170
+ result: existing.output,
17171
+ toolResponse: { rawV2: existing.output, view: 'rawV2' },
17172
+ execution: toolExecutionMetadataForOutcome({
17173
+ kind: 'checkpoint',
17174
+ cacheKey: `integration_event:${preparedBoundary.boundaryId}`,
17175
+ }),
17176
+ });
17177
+ }
16998
17178
  timeoutFinalizedAt = Date.now();
16999
17179
  } catch (error) {
17000
17180
  this.recordSlackHitlTimeoutFailure(error);
@@ -17051,6 +17231,27 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
17051
17231
  this.runtimeLog(
17052
17232
  `Integration event ${preparedBoundary.boundaryId}: recovered response from checkpoint`,
17053
17233
  );
17234
+ const outputProjection =
17235
+ existing.outputProjection ?? preparedBoundary.outputProjection;
17236
+ const eventOutput = recordOrNull(existing.output);
17237
+ if (
17238
+ outputProjection === 'event_payload' &&
17239
+ eventOutput?.timed_out !== true &&
17240
+ eventOutput &&
17241
+ 'event_payload' in eventOutput
17242
+ ) {
17243
+ const providerOutput = recordOrNull(eventOutput.event_payload);
17244
+ if (!providerOutput)
17245
+ throw new Error(
17246
+ 'The integration event has no provider reply payload.',
17247
+ );
17248
+ existing.output = providerOutput;
17249
+ this.checkpoint.resolvedBoundaries = {
17250
+ ...(this.checkpoint.resolvedBoundaries ?? {}),
17251
+ [preparedBoundary.boundaryId]: { ...existing, outputProjection },
17252
+ };
17253
+ this.#options.onBatchComplete?.(this.checkpoint);
17254
+ }
17054
17255
  // Wrapped like every other tool result (toolOutput.raw, getters) — the
17055
17256
  // non-suspending runtimes (workers' synthetic wait interception) hand
17056
17257
  // plays a wrapped ToolExecuteResult, so the resume replay must too.
@@ -17095,7 +17296,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
17095
17296
  });
17096
17297
  // An unanswered checkpoint suspends above without re-arming the provider.
17097
17298
  // New boundaries receive one absolute expiry, persisted for later replays.
17098
- const eventExpiresAtMs = Date.now() + boundary.timeoutMs;
17299
+ const eventExpiresAtMs =
17300
+ boundary.eventExpiresAtMs ?? Date.now() + boundary.timeoutMs;
17099
17301
 
17100
17302
  if (boundary.resolvedOutput) {
17101
17303
  this.checkpoint.resolvedBoundaries = {
@@ -17108,6 +17310,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
17108
17310
  provider: boundary.provider,
17109
17311
  toolId: boundary.toolId,
17110
17312
  output: boundary.resolvedOutput,
17313
+ ...(boundary.outputProjection
17314
+ ? { outputProjection: boundary.outputProjection }
17315
+ : {}),
17111
17316
  ...(boundary.timeoutPolicy
17112
17317
  ? { timeoutPolicy: boundary.timeoutPolicy }
17113
17318
  : {}),
@@ -17157,6 +17362,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
17157
17362
  eventExpiresAtMs,
17158
17363
  provider: boundary.provider,
17159
17364
  toolId: boundary.toolId,
17365
+ ...(boundary.outputProjection
17366
+ ? { outputProjection: boundary.outputProjection }
17367
+ : {}),
17160
17368
  ...(boundary.requestKey ? { requestKey: boundary.requestKey } : {}),
17161
17369
  ...(boundary.interactionId
17162
17370
  ? { interactionId: boundary.interactionId }
@@ -21550,6 +21758,8 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
21550
21758
  'executorToken and baseUrl are required for tool API calls (cloud execution only)',
21551
21759
  );
21552
21760
  }
21761
+ const selected = namedWorkspaceTool.getStore();
21762
+ const named = selected?.toolId === toolId ? selected : undefined;
21553
21763
  const requestsDurableInvocationFence =
21554
21764
  this.#options.requestDurableInvocationFence === true ||
21555
21765
  this.#options.durableInvocationFence === true;
@@ -21605,8 +21815,9 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
21605
21815
  // Keep receipts, runner heartbeats, terminals, sheets, and runtime control
21606
21816
  // on baseUrl (the receipt gateway). Only the potentially long-lived
21607
21817
  // provider request may use the separately managed execution relay.
21608
- const executionBaseUrl =
21609
- this.#options.executionGatewayBaseUrl?.trim() || this.#options.baseUrl;
21818
+ const executionBaseUrl = named
21819
+ ? this.#options.baseUrl
21820
+ : this.#options.executionGatewayBaseUrl?.trim() || this.#options.baseUrl;
21610
21821
  const toolErrorSchemaVersion = this.currentToolErrorSchemaVersion;
21611
21822
  const providerNoProgressScope = stableDigest(
21612
21823
  `${provider}\u0000${executionAuthScopeDigest ?? ''}`,
@@ -21794,6 +22005,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
21794
22005
  // support execute-fenced-v2 while ordinary provider calls continue
21795
22006
  // through /execute with no durable-operation metadata at all.
21796
22007
  const usesDurableInvocationFence =
22008
+ !named &&
21797
22009
  requestsDurableInvocationFence &&
21798
22010
  requiresExecutionFence &&
21799
22011
  !uncachedAsyncLifecycleCall;
@@ -21832,7 +22044,10 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
21832
22044
  DURABLE_INVOCATION_FENCE_VERSION,
21833
22045
  )
21834
22046
  : 'execute';
21835
- const url = `${executionBaseUrl.replace(/\/$/, '')}${integrationExecutePath(toolId, executeSuffix)}`;
22047
+ const executePath = named
22048
+ ? `/api/v2/tools/${encodeURIComponent(toolId)}/execute-with-connection`
22049
+ : integrationExecutePath(toolId, executeSuffix);
22050
+ const url = `${executionBaseUrl.replace(/\/$/, '')}${executePath}`;
21836
22051
  const fixtureReplaySafe = this.#options.integrationMode === 'fixture';
21837
22052
  const readOnlyQuery = isQueryResultDatasetReadRequest(
21838
22053
  toolId,
@@ -22063,6 +22278,13 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
22063
22278
  } | null = null;
22064
22279
  const serializedRequestBody = (invocationAttempt: number) =>
22065
22280
  JSON.stringify({
22281
+ ...(named
22282
+ ? {
22283
+ connection: named.name,
22284
+ connectionId: named.id,
22285
+ authorizationVersion: named.grantGeneration,
22286
+ }
22287
+ : {}),
22066
22288
  payload: shouldResolveAsyncOperationInRuntime
22067
22289
  ? asyncOperationLaunchInput(asyncContract!, toolInputSnapshot)
22068
22290
  : toolInputSnapshot,
@@ -23064,6 +23286,7 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
23064
23286
  // actual receiver. Older gateways refuse this path
23065
23287
  // before admission; direct app routes do not serve it.
23066
23288
  dispatchedWithProviderPermit =
23289
+ !named &&
23067
23290
  !providerPermitReceiverUnavailable &&
23068
23291
  providerGatewayDispatchProof?.dispatchValidationSupported ===
23069
23292
  true;
@@ -693,6 +693,8 @@ export type PlayExecutionEvent =
693
693
  * than repeated — or invented — per row.
694
694
  */
695
695
  bornFrom?: PlayDatasetBornFrom;
696
+ /** Stored column names in the order the run wrote them (row keys, then withColumns). Absent from older runs. */
697
+ columns?: string[];
696
698
  at: number;
697
699
  }
698
700
  | {
@@ -806,6 +808,8 @@ export type IntegrationEventWaitBoundary = {
806
808
  boundaryId: string;
807
809
  eventKey: string;
808
810
  timeoutMs: number;
811
+ /** Owner's absolute deadline; old providers may omit it. */
812
+ eventExpiresAtMs?: number;
809
813
  provider: string;
810
814
  toolId: string;
811
815
  messageRef?: {
@@ -817,6 +821,8 @@ export type IntegrationEventWaitBoundary = {
817
821
  interactionId?: string;
818
822
  /** A previously completed identical request can resolve without parking. */
819
823
  resolvedOutput?: Record<string, unknown>;
824
+ /** Absent preserves the historical scheduler event envelope. */
825
+ outputProjection?: 'event_payload';
820
826
  /**
821
827
  * Optional control-plane timeout behavior. Missing preserves the legacy
822
828
  * "return the timed_out result" replay behavior for older app deployments.
@@ -856,7 +862,7 @@ export type IntegrationEventWaitHandler = {
856
862
  payload: Record<string, unknown>;
857
863
  context: IntegrationEventWaitRuntimeContext;
858
864
  boundary: IntegrationEventWaitBoundary;
859
- }) => Promise<void>;
865
+ }) => Promise<void | { resolvedOutput: Record<string, unknown> }>;
860
866
  /**
861
867
  * When set, timeout finalization is side-effect-only: the Play stays parked
862
868
  * instead of consuming a `timed_out` result.
@@ -973,11 +979,16 @@ export interface ContextOptions {
973
979
  * runs; a resumed attempt of the current run reuses its completed receipts.
974
980
  * forceFailedToolRefresh reclaims only failed receipts, preserving completed
975
981
  * provider-call idempotency while allowing forced repair runs to make progress.
982
+ * cacheReuseWindowSeconds (internal, `play_run.cache_reuse_window`) lets each
983
+ * tool call that `reusableWindowEligibility` allows reuse completed results
984
+ * up to this many seconds old, an authored 0 included. forceToolRefresh and
985
+ * an authored `force` win over it.
976
986
  */
977
987
  cachePolicy?: {
978
988
  forceStepRefresh?: boolean;
979
989
  forceToolRefresh?: boolean;
980
990
  forceFailedToolRefresh?: boolean;
991
+ cacheReuseWindowSeconds?: number;
981
992
  };
982
993
  /** Called after each durable batch completes for scheduler checkpointing. */
983
994
  onBatchComplete?: (checkpoint: PlayCheckpoint) => void;
@@ -1164,6 +1175,13 @@ export interface ContextOptions {
1164
1175
  getToolReusableResultSupport?: (
1165
1176
  toolId: string,
1166
1177
  ) => Promise<{ supported: boolean; unavailableReason: string | null }>;
1178
+ /**
1179
+ * What one call can change, from the catalog. Null when the metadata
1180
+ * predates the field: callers treat that as a write.
1181
+ */
1182
+ getToolEffect?: (
1183
+ toolId: string,
1184
+ ) => Promise<'read' | 'write' | 'destructive' | null>;
1167
1185
  getToolRetryPolicy?: (
1168
1186
  toolId: string,
1169
1187
  input: Record<string, unknown>,
@@ -1449,6 +1467,7 @@ export interface PlayCheckpoint {
1449
1467
  * Missing fields preserve legacy checkpoint replay behavior.
1450
1468
  */
1451
1469
  timeoutPolicy?: IntegrationEventWaitBoundary['timeoutPolicy'];
1470
+ outputProjection?: IntegrationEventWaitBoundary['outputProjection'];
1452
1471
  output?: unknown;
1453
1472
  completedAt?: number;
1454
1473
  /** Timestamp of the successful provider timeout finalizer, if any. */