deepline 0.3.461 → 0.3.462

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 (296) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +7593 -0
  2. package/dist/bundling-sources/sdk/src/client.ts +8 -7366
  3. package/dist/bundling-sources/sdk/src/http-core.ts +1239 -0
  4. package/dist/bundling-sources/sdk/src/http.ts +6 -1231
  5. package/dist/bundling-sources/sdk/src/index.ts +4 -1
  6. package/dist/bundling-sources/sdk/src/play.ts +5 -5
  7. package/dist/bundling-sources/sdk/src/plays/client-core.ts +437 -0
  8. package/dist/bundling-sources/sdk/src/plays/client.ts +4 -421
  9. package/dist/bundling-sources/sdk/src/plays/input-example.ts +3 -4
  10. package/dist/bundling-sources/sdk/src/plays/play-description.ts +1 -1
  11. package/dist/bundling-sources/sdk/src/plays/run-request.ts +1 -1
  12. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  13. package/dist/bundling-sources/sdk/src/server.ts +43 -0
  14. package/dist/bundling-sources/sdk/src/types.ts +15 -5
  15. package/dist/bundling-sources/shared_libs/integration-contracts/billing-entitlements.ts +15 -0
  16. package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +0 -307
  17. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
  18. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +3 -2
  19. package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
  20. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +34 -0
  21. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +59 -0
  22. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +94 -1
  23. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +11 -1
  24. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-failure-codes.ts +24 -0
  25. package/dist/bundling-sources/shared_libs/observability/dlq.ts +32 -0
  26. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +57 -3
  27. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +1 -0
  28. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +66 -1
  29. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +36 -7
  30. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +250 -11
  31. package/dist/bundling-sources/shared_libs/play-runtime/array-input-store.ts +319 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +991 -359
  33. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +17 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +13 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +110 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +155 -6
  37. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +110 -6
  38. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +127 -13
  39. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +14 -1
  40. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +57 -1
  41. package/dist/bundling-sources/shared_libs/play-runtime/free-company-lookup-batching.ts +218 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +42 -5
  43. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-budget-state-backend.ts +6 -1
  44. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +92 -31
  45. package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +69 -14
  46. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +93 -23
  47. package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +15 -4
  48. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +22 -18
  49. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +5 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +190 -14
  52. package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +131 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +77 -2
  54. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +271 -2
  55. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +51 -0
  56. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -0
  57. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +27 -1
  58. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
  59. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
  60. package/dist/bundling-sources/shared_libs/play-runtime/provider-text-for-log.ts +63 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +19 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-event-transport.ts +112 -16
  63. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +104 -2
  64. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +265 -151
  65. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +17 -0
  66. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +35 -14
  67. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +12 -1
  68. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +4 -0
  69. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-labels.ts +36 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +136 -70
  71. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +237 -36
  72. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +148 -4
  73. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +6 -0
  74. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +285 -32
  75. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +251 -56
  76. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +29 -4
  77. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +27 -0
  78. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +22 -1
  79. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1397 -382
  80. package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +920 -0
  81. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +16 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +38 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/runtime-flow.ts +6 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +26 -1
  85. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +30 -0
  86. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +14 -3
  87. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +31 -4
  88. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +47 -0
  89. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +20 -7
  90. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +12 -0
  91. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +9 -0
  92. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +10 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +4 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1496 -320
  95. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +31 -1
  96. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1389 -129
  97. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +36 -0
  98. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +162 -23
  100. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +499 -115
  101. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +377 -9
  102. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +117 -8
  103. package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +25 -0
  104. package/dist/bundling-sources/shared_libs/play-runtime/terminal-runtime-performance.ts +391 -0
  105. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +40 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +6 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/mapped-calls.ts +171 -0
  108. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/receipt-cohort.ts +16 -1
  109. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +26 -3
  110. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +16 -2
  111. package/dist/bundling-sources/shared_libs/play-runtime/transport-error-diagnostics.ts +28 -0
  112. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +55 -5
  113. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +41 -1
  114. package/dist/bundling-sources/shared_libs/plays/contracts.ts +4 -0
  115. package/dist/bundling-sources/shared_libs/plays/dataset.ts +9 -3
  116. package/dist/bundling-sources/shared_libs/plays/deploy/manifest-contract.ts +2 -0
  117. package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +3 -2
  118. package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +2 -2
  119. package/dist/bundling-sources/shared_libs/plays/run-output-summary.ts +66 -0
  120. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +1 -1
  121. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +43 -1
  122. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +9 -0
  123. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +91 -13
  124. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +3 -0
  125. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +41 -24
  126. package/dist/bundling-sources/shared_libs/security/attested-client-ip.ts +91 -0
  127. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +0 -11
  128. package/dist/cli/{auth-6HJXNWUG.mjs → auth-JDLEY7VU.mjs} +5 -4
  129. package/dist/cli/auth-UXKY6TCC.js +41 -0
  130. package/dist/cli/{billing-6P5HO6QG.js → billing-HXAXB3XZ.js} +152 -78
  131. package/dist/cli/{billing-MJ42N7YF.mjs → billing-SDHLBLMV.mjs} +84 -10
  132. package/dist/cli/{chunk-5MDIZX7M.js → chunk-3ACMRZRV.js} +8 -6
  133. package/dist/cli/{chunk-FGLKOWSC.mjs → chunk-3KZCFOZ6.mjs} +1 -1
  134. package/dist/cli/chunk-4KQ6SIBC.mjs +1038 -0
  135. package/dist/cli/{chunk-Z2GUFYT6.js → chunk-5LEAXRHV.js} +11 -11
  136. package/dist/cli/{chunk-MEAIOXJL.mjs → chunk-6NNVJDVR.mjs} +7 -5
  137. package/dist/cli/{chunk-NMJ4D2WO.js → chunk-6PMCRYDA.js} +216 -91
  138. package/dist/cli/{chunk-RY4IVOU3.mjs → chunk-6RNQGWFD.mjs} +16 -806
  139. package/dist/cli/{chunk-EBU7LQ64.js → chunk-6V7KVRR5.js} +3 -3
  140. package/dist/cli/{chunk-OZBWRICM.js → chunk-7LFIMWMW.js} +2 -2
  141. package/dist/cli/chunk-7MJ6VI2T.mjs +19 -0
  142. package/dist/cli/chunk-7SWNPNML.js +1039 -0
  143. package/dist/cli/{chunk-IHHLTHE7.mjs → chunk-7U3XNPOA.mjs} +267 -38
  144. package/dist/cli/{chunk-5FDKJQZE.js → chunk-7VZHXVOQ.js} +1 -1
  145. package/dist/cli/{chunk-R64BGGRQ.mjs → chunk-AT636LLU.mjs} +2 -2
  146. package/dist/cli/{chunk-MDJPEGVN.js → chunk-BGTPIMSM.js} +392 -261
  147. package/dist/cli/{chunk-KVJ5VHW5.mjs → chunk-CKSOY47X.mjs} +2 -2
  148. package/dist/cli/{chunk-7DH2FD7Y.mjs → chunk-D464JW3N.mjs} +5 -85
  149. package/dist/cli/chunk-D6DXOUTO.mjs +827 -0
  150. package/dist/cli/{describe-2WQY7ZCY.js → chunk-EM4TXCCI.js} +27 -44
  151. package/dist/cli/chunk-F6QV42MC.mjs +91 -0
  152. package/dist/cli/chunk-FKVYR3QA.mjs +1039 -0
  153. package/dist/cli/{chunk-FGMX4HUZ.js → chunk-GEGW5HPZ.js} +29 -27
  154. package/dist/cli/{chunk-TNMBPMMC.js → chunk-HUB3CCM2.js} +13 -4
  155. package/dist/cli/{chunk-ACCR7POB.js → chunk-I6VHOU5O.js} +27 -27
  156. package/dist/cli/{chunk-Z2XUZC34.js → chunk-IAYSWZDJ.js} +188 -76
  157. package/dist/cli/chunk-JF3TLIMQ.js +19 -0
  158. package/dist/cli/{chunk-HDFRJ4IT.mjs → chunk-JVHOS3K3.mjs} +177 -65
  159. package/dist/cli/{chunk-V7REJRDZ.mjs → chunk-LFXLQEZN.mjs} +1 -1
  160. package/dist/cli/{chunk-CRYOUPEB.js → chunk-LROWFPGN.js} +16 -16
  161. package/dist/cli/{chunk-SLEUWLJE.mjs → chunk-MSY22NQW.mjs} +5 -5
  162. package/dist/cli/{chunk-BGY2PLP7.mjs → chunk-MUUQZIOF.mjs} +23 -49
  163. package/dist/cli/{chunk-FCAZQ7WV.js → chunk-NBLSCHKK.js} +52 -50
  164. package/dist/cli/{chunk-QAJAJPKK.mjs → chunk-NHRWZPWZ.mjs} +4 -2
  165. package/dist/cli/{chunk-KXMNM4AQ.js → chunk-NMU3VR5U.js} +4 -5
  166. package/dist/cli/{chunk-QIW7TVV6.mjs → chunk-O2RX5A66.mjs} +14 -12
  167. package/dist/cli/{chunk-SAZFZQRI.js → chunk-OMQ23IXL.js} +2 -2
  168. package/dist/cli/{chunk-5IYOUBFZ.js → chunk-OPJAJBD4.js} +28 -54
  169. package/dist/cli/{chunk-FJZILBL7.mjs → chunk-PHSEINNH.mjs} +5 -5
  170. package/dist/cli/{chunk-3DNKFH2G.mjs → chunk-PKHVSIJG.mjs} +19 -1
  171. package/dist/cli/{chunk-WIYWSYDS.mjs → chunk-Q2EIZKVX.mjs} +3 -3
  172. package/dist/cli/{chunk-5FY72YOV.js → chunk-QJZ6WNWD.js} +8 -8
  173. package/dist/cli/{chunk-EIMG75BT.mjs → chunk-S3A4IXBQ.mjs} +4 -5
  174. package/dist/cli/{chunk-3BMLICF7.mjs → chunk-S42YIQNE.mjs} +13 -8
  175. package/dist/cli/{chunk-RFONC4WJ.mjs → chunk-S6UAJR6V.mjs} +3 -3
  176. package/dist/cli/{chunk-G7L27KZB.mjs → chunk-TKAQR3IB.mjs} +31 -21
  177. package/dist/cli/{chunk-QWRHGGUH.js → chunk-UAJFWWZE.js} +20 -2
  178. package/dist/cli/{chunk-VZBCEA5S.mjs → chunk-UDRPEZ5F.mjs} +223 -92
  179. package/dist/cli/{chunk-KCCOQ5G5.js → chunk-ULK7JGGI.js} +511 -282
  180. package/dist/cli/chunk-V335HGX5.js +1038 -0
  181. package/dist/cli/{chunk-MGXEUZHL.mjs → chunk-V3MEA7NB.mjs} +7 -5
  182. package/dist/cli/{chunk-O6QOMHCH.js → chunk-VFGVXXZP.js} +37 -35
  183. package/dist/cli/chunk-VLEVVDWG.js +91 -0
  184. package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-VPHN2HAL.mjs} +216 -91
  185. package/dist/cli/{chunk-CFUTOWE4.js → chunk-WG3KGAII.js} +8 -88
  186. package/dist/cli/{describe-FRAVCY5F.mjs → chunk-WIY6U6GD.mjs} +19 -36
  187. package/dist/cli/{chunk-PNATXKLP.js → chunk-XANRM3QA.js} +6 -6
  188. package/dist/cli/{chunk-KGQNIA37.js → chunk-XQCTG5OO.js} +44 -34
  189. package/dist/cli/{chunk-T3MVIPHG.mjs → chunk-XZAFIOUQ.mjs} +1 -1
  190. package/dist/cli/chunk-Y4DPU4OM.js +827 -0
  191. package/dist/cli/chunk-YT5EODJO.js +920 -0
  192. package/dist/cli/{chunk-SCIR5JXW.js → chunk-ZGQSFYD2.js} +56 -51
  193. package/dist/cli/{chunk-QEYHTIV4.mjs → chunk-ZUK6LIJB.mjs} +10 -1
  194. package/dist/cli/command-docs.d.mts +5 -0
  195. package/dist/cli/command-docs.d.ts +5 -0
  196. package/dist/cli/command-docs.js +2 -2
  197. package/dist/cli/command-docs.mjs +1 -1
  198. package/dist/cli/{csv-NX7NO3O6.js → csv-C56GSCEU.js} +13 -12
  199. package/dist/cli/{csv-DQ6GW5B5.mjs → csv-L54JS7TF.mjs} +4 -3
  200. package/dist/cli/{db-R72DFMP6.js → db-MOGRMZTA.js} +30 -27
  201. package/dist/cli/{db-2YP33M4K.mjs → db-YVBUW2DX.mjs} +10 -7
  202. package/dist/cli/describe-KYEULWPG.js +48 -0
  203. package/dist/cli/describe-NLZKKT7C.mjs +48 -0
  204. package/dist/cli/describe-core.d.mts +153 -5
  205. package/dist/cli/describe-core.d.ts +153 -5
  206. package/dist/cli/describe-core.js +9 -5
  207. package/dist/cli/describe-core.mjs +10 -6
  208. package/dist/cli/{executions-ZLHD4QIT.js → executions-A7L4ULPP.js} +9 -7
  209. package/dist/cli/{executions-WFBU7L2Q.mjs → executions-ZBGSTT37.mjs} +7 -5
  210. package/dist/cli/{feedback-CN3HJFVF.mjs → feedback-G6GU37FD.mjs} +6 -5
  211. package/dist/cli/{feedback-NDV6TPHG.js → feedback-OHLY7RYD.js} +10 -9
  212. package/dist/cli/getting-started.d.mts +6 -6
  213. package/dist/cli/getting-started.d.ts +6 -6
  214. package/dist/cli/getting-started.js +2 -2
  215. package/dist/cli/getting-started.mjs +1 -1
  216. package/dist/cli/git-P76N4NDQ.js +25 -0
  217. package/dist/cli/{git-QAD6E3HW.mjs → git-PKZW3QD5.mjs} +5 -4
  218. package/dist/cli/index.js +152 -142
  219. package/dist/cli/index.mjs +56 -46
  220. package/dist/cli/{legacy-noops-KVC5QJ74.js → legacy-noops-5LM3D724.js} +8 -7
  221. package/dist/cli/{legacy-noops-TPTKNBI2.mjs → legacy-noops-LJJYG6YA.mjs} +5 -4
  222. package/dist/cli/{monitors-SV57JFLO.mjs → monitors-72QV4ALO.mjs} +19 -6
  223. package/dist/cli/{monitors-KCROV6PJ.js → monitors-UX3H5DC2.js} +103 -90
  224. package/dist/cli/{org-KX6QIR7A.mjs → org-6RRRKOCP.mjs} +9 -6
  225. package/dist/cli/{org-NJYX5743.js → org-IF7ISUVB.js} +70 -67
  226. package/dist/cli/pages-3SU3HKL7.js +252 -0
  227. package/dist/cli/pages-DXDYYKEK.mjs +252 -0
  228. package/dist/cli/{play-IQQ57L7Z.mjs → play-AHASKRLA.mjs} +512 -1508
  229. package/dist/cli/{play-32L7EQN4.js → play-EUIUVLUH.js} +1090 -2086
  230. package/dist/cli/{providers-4WEC2EQN.mjs → providers-GWGE3WY3.mjs} +7 -5
  231. package/dist/cli/{providers-ZQV6QLVQ.js → providers-V5WU4VXJ.js} +10 -8
  232. package/dist/cli/{quickstart-RQ76RIUE.mjs → quickstart-OXKQ5ZST.mjs} +5 -4
  233. package/dist/cli/{quickstart-HKUSFADF.js → quickstart-QP65I5PF.js} +13 -12
  234. package/dist/cli/run-6MM72IGL.mjs +443 -0
  235. package/dist/cli/run-F3FTYS56.js +443 -0
  236. package/dist/cli/search-OYKOOI7A.js +32 -0
  237. package/dist/cli/{search-ZRAVFBZC.mjs → search-ZMEBVJZB.mjs} +8 -6
  238. package/dist/cli/{secrets-J3G5Y43U.js → secrets-ACND5N6A.js} +16 -14
  239. package/dist/cli/{secrets-CMJOVNVH.mjs → secrets-XRCJFF3L.mjs} +7 -5
  240. package/dist/cli/{sessions-MDQYY5CB.mjs → sessions-RTK3CEW6.mjs} +5 -4
  241. package/dist/cli/{sessions-WY7VN4AE.js → sessions-ZGRJPCFF.js} +6 -5
  242. package/dist/cli/{settings-HTNTFKCE.js → settings-PD5KWQQZ.js} +80 -77
  243. package/dist/cli/{settings-4RWZPCT5.mjs → settings-XDRBPRDE.mjs} +14 -11
  244. package/dist/cli/{setup-P3GYYZWG.mjs → setup-3HPYAOCC.mjs} +12 -10
  245. package/dist/cli/{setup-QGCAP62X.js → setup-E2Q6PXHC.js} +53 -51
  246. package/dist/cli/{skills-7NAE4ICL.mjs → skills-OOQFMPOV.mjs} +7 -6
  247. package/dist/cli/skills-XYWV52KB.js +31 -0
  248. package/dist/cli/tools-ASCDZJCK.js +55 -0
  249. package/dist/cli/tools-C5ZT3UIC.mjs +55 -0
  250. package/dist/cli/update-5RQSEIFM.js +33 -0
  251. package/dist/cli/{update-GODLRKNB.mjs → update-ZWJTADIW.mjs} +9 -8
  252. package/dist/cli/{workflow-4BXOUVEO.mjs → workflow-23NMPAJ7.mjs} +10 -8
  253. package/dist/cli/{workflow-AO3A6LXN.js → workflow-TCXU5YJV.js} +20 -18
  254. package/dist/client-DS2IWYZF.d.ts +10 -0
  255. package/dist/client-DTwnz_AW.d.mts +10 -0
  256. package/dist/{client-CYqG23K1.d.ts → client-core-B_6HAIBy.d.ts} +385 -12
  257. package/dist/{client-BbU5_j7n.d.mts → client-core-DzBSlY1U.d.mts} +385 -12
  258. package/dist/{compiler-manifest-CWz_sNOQ.d.ts → compiler-manifest-Dcyd3-Zd.d.mts} +43 -1
  259. package/dist/{compiler-manifest-CWz_sNOQ.d.mts → compiler-manifest-Dcyd3-Zd.d.ts} +43 -1
  260. package/dist/errors-d-sTrZhe.d.mts +142 -0
  261. package/dist/errors-yQwfgrcX.d.ts +142 -0
  262. package/dist/{index-BF2JB_Ug.d.mts → index-C6oXchjN.d.mts} +1 -1
  263. package/dist/{index-4NPXDzlD.d.ts → index-P56zy_z5.d.ts} +1 -1
  264. package/dist/index.d.mts +11 -147
  265. package/dist/index.d.ts +11 -147
  266. package/dist/index.js +15 -11
  267. package/dist/index.mjs +14 -10
  268. package/dist/install-integrity.json +141 -104
  269. package/dist/plays/bundle-play-file.d.mts +3 -3
  270. package/dist/plays/bundle-play-file.d.ts +3 -3
  271. package/dist/plays/bundle-play-file.mjs +2 -1
  272. package/dist/plays/play-description.d.mts +2 -2
  273. package/dist/plays/play-description.d.ts +2 -2
  274. package/dist/plays/play-description.js +2 -2
  275. package/dist/plays/play-description.mjs +1 -1
  276. package/dist/plays/run-request.d.mts +2 -2
  277. package/dist/plays/run-request.d.ts +2 -2
  278. package/dist/release.d.mts +1 -1
  279. package/dist/release.d.ts +1 -1
  280. package/dist/release.js +2 -2
  281. package/dist/release.mjs +1 -1
  282. package/dist/server.d.mts +17 -0
  283. package/dist/server.d.ts +17 -0
  284. package/dist/server.js +76 -0
  285. package/dist/server.mjs +76 -0
  286. package/package.json +6 -1
  287. package/dist/cli/auth-IACERYQH.js +0 -40
  288. package/dist/cli/chunk-PQUUWFXY.js +0 -95
  289. package/dist/cli/chunk-YBWAG72P.mjs +0 -95
  290. package/dist/cli/chunk-YQDUODZW.js +0 -1710
  291. package/dist/cli/git-JVI36ZFV.js +0 -24
  292. package/dist/cli/search-75X5LTDE.js +0 -30
  293. package/dist/cli/skills-BKJ53JOQ.js +0 -30
  294. package/dist/cli/tools-COWMIEJ6.mjs +0 -45
  295. package/dist/cli/tools-TASOCE7I.js +0 -45
  296. package/dist/cli/update-SJIKVME6.js +0 -32
@@ -72,6 +72,7 @@ import {
72
72
  } from './runtime-heartbeat';
73
73
  import {
74
74
  formatRunnerGatewayTransportSummary,
75
+ isRunnerGatewayNoResponseError,
75
76
  type RunnerGatewayTransportEvent,
76
77
  } from './runtime-gateway-transport';
77
78
  import { startConfiguredPlayRunnerRuntimeDeadline } from './runtime-deadline';
@@ -118,7 +119,6 @@ import {
118
119
  formatDatasetRegistrationLog,
119
120
  } from '../dataset-lifecycle-log';
120
121
  import {
121
- assertCustomerPlayReturnWithinLimit,
122
122
  RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_BYTES,
123
123
  RUNTIME_RECEIPT_COMPLETION_BUFFER_MAX_ITEMS,
124
124
  RUNTIME_RECEIPT_COMPLETION_MAX_IN_FLIGHT_BATCHES,
@@ -126,9 +126,15 @@ import {
126
126
  RUNTIME_RECEIPT_CONTROL_BUFFER_MAX_ITEMS,
127
127
  RUNTIME_RECEIPT_CONTROL_MAX_IN_FLIGHT_BATCHES,
128
128
  RUNNER_POST_TERMINAL_DIAGNOSTIC_MAX_BYTES,
129
+ truncateCustomerPlayReturnWithinLimit,
129
130
  } from '../output-size-limits';
130
131
  import {
131
132
  resolveRuntimeReferencedPlay,
133
+ getRuntimeArrayInputManifest,
134
+ beginRuntimeArrayInput,
135
+ putRuntimeArrayInputPage,
136
+ sealRuntimeArrayInput,
137
+ readRuntimeArrayInputPage,
132
138
  createCompleteRuntimeMapRowsOperation,
133
139
  finishRuntimeSheetRunMembership,
134
140
  createRuntimeSheetDatasetPageReader,
@@ -137,6 +143,7 @@ import {
137
143
  readRuntimeSheetDatasetRows,
138
144
  releaseRuntimeWorkReceipts,
139
145
  startRuntimeSheetDataset,
146
+ startRuntimeSheetDatasetPages,
140
147
  supersededRuntimeMapRows,
141
148
  type RuntimeMapRowsStaleRow,
142
149
  type RuntimeMapRowsWriteResult,
@@ -240,6 +247,7 @@ import {
240
247
  } from '../app-runtime-api';
241
248
  import { RUNTIME_CAPACITY_POLICY } from '../runtime-capacity-policy';
242
249
  import { RUNTIME_RELIABILITY_POLICY } from '../runtime-reliability-policy';
250
+ import { RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS } from '../runtime-constants';
243
251
 
244
252
  const playRuntimeRequire = createRequire(`${process.cwd()}/package.json`);
245
253
  const moduleRuntime = playRuntimeRequire('module') as {
@@ -576,11 +584,11 @@ export async function fetchRunnerRuntimeControl(input: {
576
584
  }): Promise<Response> {
577
585
  const fetchImpl = input.fetchImpl ?? fetch;
578
586
  const sleepImpl = input.sleepImpl ?? sleepRunnerRuntimeControlRetry;
579
- for (
580
- let attempt = 1;
581
- attempt <= RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS;
582
- attempt += 1
583
- ) {
587
+ const startedAt = Date.now();
588
+ // Error responses spend the ordinary attempts. A request that gets no
589
+ // response at all keeps retrying through a sandbox network cut.
590
+ let respondedAttempts = 0;
591
+ for (let attempt = 1; ; attempt += 1) {
584
592
  const timeoutMs =
585
593
  input.timeoutMs ?? RUNNER_RUNTIME_CONTROL_REQUEST_TIMEOUT_MS;
586
594
  const timeoutSignal = AbortSignal.timeout(timeoutMs);
@@ -613,14 +621,15 @@ export async function fetchRunnerRuntimeControl(input: {
613
621
  `gateway and the launch carries vercelProtectionBypassToken.`,
614
622
  );
615
623
  }
624
+ respondedAttempts += 1;
616
625
  if (
617
626
  input.retrySafe &&
618
- attempt < RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS &&
627
+ respondedAttempts < RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS &&
619
628
  isRetryableRuntimeControlStatus(response.status)
620
629
  ) {
621
630
  await response.text().catch(() => '');
622
631
  await sleepImpl(
623
- RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[attempt - 1] ?? 250,
632
+ RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[respondedAttempts - 1] ?? 250,
624
633
  );
625
634
  continue;
626
635
  }
@@ -646,17 +655,29 @@ export async function fetchRunnerRuntimeControl(input: {
646
655
  const transportMessage = timeoutSignal.aborted
647
656
  ? `timed out after ${timeoutMs}ms`
648
657
  : message;
649
- if (!input.retrySafe || attempt >= RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS) {
650
- throw new Error(
651
- `${input.description} transport failed: ${transportMessage}`,
658
+ const failure = new Error(
659
+ `${input.description} transport failed: ${transportMessage}`,
660
+ );
661
+ if (!input.retrySafe || input.init.signal?.aborted) throw failure;
662
+ const delayMs =
663
+ RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[attempt - 1] ??
664
+ Math.min(
665
+ 8_000,
666
+ 1_000 * (attempt - RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS.length),
652
667
  );
668
+ const outageRetryAllowed =
669
+ (timeoutSignal.aborted || isRunnerGatewayNoResponseError(error)) &&
670
+ Date.now() - startedAt + delayMs <=
671
+ RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS;
672
+ if (
673
+ attempt >= RUNNER_RUNTIME_CONTROL_MAX_ATTEMPTS &&
674
+ !outageRetryAllowed
675
+ ) {
676
+ throw failure;
653
677
  }
654
- await sleepImpl(
655
- RUNNER_RUNTIME_CONTROL_RETRY_DELAYS_MS[attempt - 1] ?? 250,
656
- );
678
+ await sleepImpl(delayMs);
657
679
  }
658
680
  }
659
- throw new Error(`${input.description} transport failed.`);
660
681
  }
661
682
 
662
683
  function createRuntimeToolMetadataResolver(config: PlayRunnerExecutionConfig) {
@@ -888,6 +909,7 @@ function createRateStateBackendForConfig(
888
909
  vercelProtectionBypassToken:
889
910
  config.context.vercelProtectionBypassToken ?? null,
890
911
  integrationMode: config.context.integrationMode,
912
+ connectionRetryBudgetMs: RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS,
891
913
  };
892
914
  return {
893
915
  requireSharedRateState: true,
@@ -2211,6 +2233,7 @@ async function run(
2211
2233
  executorToken: config.context.executorToken ?? '',
2212
2234
  vercelProtectionBypassToken: config.context.vercelProtectionBypassToken,
2213
2235
  runtimeTestFaultHeader: config.context.runtimeTestFaultHeader ?? null,
2236
+ connectionRetryBudgetMs: RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS,
2214
2237
  };
2215
2238
  const receiptGatewayResponseObserver = createReceiptGatewayResponseObserver();
2216
2239
  const receiptGatewayBaseUrl = config.context.receiptGatewayBaseUrl?.trim();
@@ -2360,6 +2383,24 @@ async function run(
2360
2383
  toolResponseContract: config.context.toolResponseContract,
2361
2384
  toolResponseReceiptRevision: config.context.toolResponseReceiptRevision,
2362
2385
  });
2386
+ const arrayInputRuntimeContext = (scope: {
2387
+ playName: string;
2388
+ runId: string;
2389
+ }) => ({
2390
+ baseUrl: receiptGatewayBaseUrl || config.context.baseUrl,
2391
+ executorToken: config.context.executorToken,
2392
+ // Input snapshots must cross the gateway's current-attempt fence, even
2393
+ // when ordinary row persistence can use a preloaded tenant session.
2394
+ dbSessionStrategy: 'gateway_only' as const,
2395
+ preloadedDbSessions: runtimePreloadedDbSessions,
2396
+ postgresSessionUnwrapKey: runtimePostgresSessionUnwrapKey,
2397
+ abortSignal: persistenceSignal,
2398
+ playName: scope.playName,
2399
+ runId: scope.runId,
2400
+ orgId: config.context.orgId,
2401
+ userEmail: config.context.userEmail,
2402
+ vercelProtectionBypassToken: config.context.vercelProtectionBypassToken,
2403
+ });
2363
2404
  const ctx = createPlayContext({
2364
2405
  artifactRuntimeContract,
2365
2406
  rowAdmissionSignal: options?.rowAdmissionSignal,
@@ -2435,6 +2476,52 @@ async function run(
2435
2476
  convexUrl: config.context.convexUrl,
2436
2477
  runtimeSchedulerSchema: config.context.runtimeSchedulerSchema ?? null,
2437
2478
  runtimeSheetBackedMapDatasets: true,
2479
+ runtimeArrayInputStagingEnabled: true,
2480
+ runtimeArrayInputStore: {
2481
+ getManifest: (scope) =>
2482
+ retryRuntimeSheetPersistence({
2483
+ description: `runtime array input getManifest table=${scope.tableNamespace}`,
2484
+ log: (line) => emitWorkerLog(line, options),
2485
+ signal: persistenceSignal,
2486
+ run: () =>
2487
+ getRuntimeArrayInputManifest(
2488
+ arrayInputRuntimeContext(scope),
2489
+ scope,
2490
+ ),
2491
+ }),
2492
+ begin: (input) =>
2493
+ retryRuntimeSheetPersistence({
2494
+ description: `runtime array input begin table=${input.tableNamespace}`,
2495
+ log: (line) => emitWorkerLog(line, options),
2496
+ signal: persistenceSignal,
2497
+ run: () =>
2498
+ beginRuntimeArrayInput(arrayInputRuntimeContext(input), input),
2499
+ }),
2500
+ putPage: (input) =>
2501
+ retryRuntimeSheetPersistence({
2502
+ description: `runtime array input putPage table=${input.tableNamespace}`,
2503
+ log: (line) => emitWorkerLog(line, options),
2504
+ signal: persistenceSignal,
2505
+ run: () =>
2506
+ putRuntimeArrayInputPage(arrayInputRuntimeContext(input), input),
2507
+ }),
2508
+ seal: (input) =>
2509
+ retryRuntimeSheetPersistence({
2510
+ description: `runtime array input seal table=${input.tableNamespace}`,
2511
+ log: (line) => emitWorkerLog(line, options),
2512
+ signal: persistenceSignal,
2513
+ run: () =>
2514
+ sealRuntimeArrayInput(arrayInputRuntimeContext(input), input),
2515
+ }),
2516
+ readPage: (input) =>
2517
+ retryRuntimeSheetPersistence({
2518
+ description: `runtime array input readPage table=${input.tableNamespace}`,
2519
+ log: (line) => emitWorkerLog(line, options),
2520
+ signal: persistenceSignal,
2521
+ run: () =>
2522
+ readRuntimeArrayInputPage(arrayInputRuntimeContext(input), input),
2523
+ }),
2524
+ },
2438
2525
  runtimeReceiptClaimsEstablishExecutionFence:
2439
2526
  receiptStoreAdapter?.claimsEstablishExecutionFence === true,
2440
2527
  workflowId: config.context.workflowId,
@@ -2644,7 +2731,7 @@ async function run(
2644
2731
  options,
2645
2732
  );
2646
2733
  },
2647
- onMapStart: async (items, tableNamespace, mapContext) => {
2734
+ onMapStartPages: async function* (items, tableNamespace, mapContext) {
2648
2735
  assertPlayRunnerRuntimeSheetPersistenceContext(config.context);
2649
2736
  const { baseUrl, orgId } = config.context;
2650
2737
  const startedAt = Date.now();
@@ -2681,153 +2768,161 @@ async function run(
2681
2768
  // after a scheduler wake recreates this Map. Retain the local version as
2682
2769
  // an additional consistency check across pages of this runner.
2683
2770
  const existingAttempt = runtimeSheetAttempts.get(attemptKey);
2684
- const mapStartResult = await retryRuntimeSheetPersistence({
2685
- description: `runtime map start table=${tableNamespace}`,
2686
- log: (line) => emitWorkerLog(line, options),
2687
- signal: persistenceSignal,
2688
- run: () =>
2689
- startRuntimeSheetDataset(
2690
- {
2691
- executorToken,
2692
- baseUrl,
2693
- vercelProtectionBypassToken:
2694
- config.context.vercelProtectionBypassToken,
2695
- orgId,
2696
- playName,
2697
- runId,
2698
- userEmail,
2699
- dbSessionStrategy: config.context.dbSessionStrategy,
2700
- preloadedDbSessions: canUseRootPreloadedDbSessions
2701
- ? runtimePreloadedDbSessions
2702
- : undefined,
2703
- postgresSessionUnwrapKey: canUseRootPreloadedDbSessions
2704
- ? runtimePostgresSessionUnwrapKey
2705
- : executorToken,
2706
- abortSignal: persistenceSignal,
2707
- },
2708
- {
2709
- playName,
2710
- tableNamespace,
2711
- playInput: runtimeInputObject,
2712
- sheetContract: augmentSheetContractWithDatasetFields({
2713
- contract: sheetContract,
2714
- rows: items,
2715
- columnTypes: mapContext.columnTypes,
2716
- }),
2717
- rows: items,
2718
- stableWriteIntent: true,
2719
- pendingRerunAdmission: true,
2720
- includePreviousCells: mapContext.includePreviousCells,
2721
- previousCellsBudgetBytes: mapContext.previousCellsBudgetBytes,
2722
- inputOffset: mapContext.inputOffset,
2723
- mode: mapContext.mode,
2724
- runId,
2725
- attemptId: deterministicRuntimeSheetAttemptId({
2726
- playName,
2727
- runId,
2728
- tableNamespace,
2729
- attemptSeq: runnerRunAttempt,
2730
- }),
2731
- attemptOwnerRunId: runId,
2732
- attemptSeq: runnerRunAttempt,
2733
- ...runtimeSheetStartWriteVersion(existingAttempt),
2734
- ...(playRunnerContextRuntimeSheetForce(config.context)
2735
- ? { force: true }
2736
- : {}),
2737
- },
2738
- ),
2739
- });
2740
- if (mapStartResult.membershipCapture === true)
2741
- membershipCapturingMaps.add(attemptKey);
2742
- const datasetId = createRuntimeDatasetId(playName, tableNamespace);
2743
- const datasetPath = `datasets.${tableNamespace}`;
2744
- const settlement = runtimeMapDatasetSettlements.get(datasetId) ?? {
2745
- datasetId,
2746
- path: datasetPath,
2747
- tableNamespace,
2748
- runId,
2749
- persistedRows: 0,
2750
- succeededRows: 0,
2751
- failedRows: 0,
2752
- };
2753
- // `completedRows` is the sheet admission result, not a terminal write
2754
- // for this run. Normal maps still execute every admitted row (the tool
2755
- // receipt may be reused inside that execution), and their terminal
2756
- // callback below is the authoritative settlement. Counting these rows
2757
- // here as well would report N rows at map start and another N rows at
2758
- // terminal persistence, advertising 2N rows for an N-row Dataset Handle.
2759
- // `net_new` maps exclude these rows before execution, so they must not
2760
- // be counted here either.
2761
- runtimeMapDatasetSettlements.set(datasetId, settlement);
2762
- emitRunnerEvent(
2771
+ const admissionPages = startRuntimeSheetDatasetPages(
2763
2772
  {
2764
- type: 'execution_event',
2765
- event: {
2766
- type: RUN_EVENT_KIND.datasetLifecycle,
2767
- datasetId,
2768
- path: datasetPath,
2769
- tableNamespace,
2770
- phase: 'registered',
2771
- persistedRows: 0,
2772
- succeededRows: 0,
2773
- failedRows: 0,
2774
- complete: false,
2775
- // ADR 0019 dataset-grain row birth. These rows entered from
2776
- // play-body code, so the only witnessed fact is how many arrived at
2777
- // this table — never a per-row source mapping, which the runtime
2778
- // does not see here. `rowCountIn` counts rows admitted through this
2779
- // boundary so far, so a paged dataset converges upward instead of
2780
- // reporting only its last page.
2781
- bornFrom: {
2782
- table: tableNamespace,
2783
- rowCountIn: (mapContext.inputOffset ?? 0) + items.length,
2784
- },
2785
- at: Date.now(),
2786
- },
2773
+ executorToken,
2774
+ baseUrl,
2775
+ vercelProtectionBypassToken:
2776
+ config.context.vercelProtectionBypassToken,
2777
+ orgId,
2778
+ playName,
2779
+ runId,
2780
+ userEmail,
2781
+ dbSessionStrategy: config.context.dbSessionStrategy,
2782
+ preloadedDbSessions: canUseRootPreloadedDbSessions
2783
+ ? runtimePreloadedDbSessions
2784
+ : undefined,
2785
+ postgresSessionUnwrapKey: canUseRootPreloadedDbSessions
2786
+ ? runtimePostgresSessionUnwrapKey
2787
+ : executorToken,
2788
+ abortSignal: persistenceSignal,
2787
2789
  },
2788
- options,
2789
- );
2790
- emitRunnerEvent(
2791
2790
  {
2792
- type: 'log',
2793
- at: new Date().toISOString(),
2794
- source: 'play',
2795
- line: formatDatasetRegistrationLog({
2796
- dataset: { path: datasetPath, tableNamespace },
2797
- rows: items.length,
2791
+ playName,
2792
+ tableNamespace,
2793
+ sheetContract: augmentSheetContractWithDatasetFields({
2794
+ contract: sheetContract,
2795
+ rows: items,
2796
+ columnTypes: mapContext.columnTypes,
2798
2797
  }),
2798
+ rows: items,
2799
+ stableWriteIntent: true,
2800
+ pendingRerunAdmission: true,
2801
+ includePreviousCells: mapContext.includePreviousCells,
2802
+ previousCellsBudgetBytes: mapContext.previousCellsBudgetBytes,
2803
+ inputOffset: mapContext.inputOffset,
2804
+ mode: mapContext.mode,
2805
+ runId,
2806
+ attemptId: deterministicRuntimeSheetAttemptId({
2807
+ playName,
2808
+ runId,
2809
+ tableNamespace,
2810
+ attemptSeq: runnerRunAttempt,
2811
+ }),
2812
+ attemptOwnerRunId: runId,
2813
+ attemptSeq: runnerRunAttempt,
2814
+ ...runtimeSheetStartWriteVersion(existingAttempt),
2815
+ ...(playRunnerContextRuntimeSheetForce(config.context)
2816
+ ? { force: true }
2817
+ : {}),
2818
+ },
2819
+ {
2820
+ runPage: (run) =>
2821
+ retryRuntimeSheetPersistence({
2822
+ description: `runtime map start table=${tableNamespace}`,
2823
+ log: (line) => emitWorkerLog(line, options),
2824
+ signal: persistenceSignal,
2825
+ run,
2826
+ }),
2799
2827
  },
2800
- options,
2801
2828
  );
2802
- if (
2803
- mapStartResult.attemptId &&
2804
- mapStartResult.attemptOwnerRunId &&
2805
- mapStartResult.attemptExpiresAt
2806
- ) {
2807
- runtimeSheetAttempts.set(
2808
- attemptKey,
2809
- runtimeSheetAttemptForMapStart({
2829
+ let registered = false;
2830
+ for await (const mapStartResult of admissionPages) {
2831
+ if (mapStartResult.membershipCapture === true)
2832
+ membershipCapturingMaps.add(attemptKey);
2833
+ if (!registered) {
2834
+ registered = true;
2835
+ const datasetId = createRuntimeDatasetId(playName, tableNamespace);
2836
+ const datasetPath = `datasets.${tableNamespace}`;
2837
+ const settlement = runtimeMapDatasetSettlements.get(datasetId) ?? {
2838
+ datasetId,
2839
+ path: datasetPath,
2810
2840
  tableNamespace,
2811
2841
  runId,
2812
- existing: existingAttempt,
2813
- mapStartResult: {
2814
- attemptId: mapStartResult.attemptId,
2815
- attemptOwnerRunId: mapStartResult.attemptOwnerRunId,
2816
- attemptExpiresAt: mapStartResult.attemptExpiresAt,
2817
- attemptSeq: mapStartResult.attemptSeq,
2818
- writeVersion: mapStartResult.writeVersion,
2842
+ persistedRows: 0,
2843
+ succeededRows: 0,
2844
+ failedRows: 0,
2845
+ };
2846
+ // `completedRows` is the sheet admission result, not a terminal write
2847
+ // for this run. Normal maps still execute every admitted row (the tool
2848
+ // receipt may be reused inside that execution), and their terminal
2849
+ // callback below is the authoritative settlement. Counting these rows
2850
+ // here as well would report N rows at map start and another N rows at
2851
+ // terminal persistence, advertising 2N rows for an N-row Dataset Handle.
2852
+ // `net_new` maps exclude these rows before execution, so they must not
2853
+ // be counted here either.
2854
+ runtimeMapDatasetSettlements.set(datasetId, settlement);
2855
+ emitRunnerEvent(
2856
+ {
2857
+ type: 'execution_event',
2858
+ event: {
2859
+ type: RUN_EVENT_KIND.datasetLifecycle,
2860
+ datasetId,
2861
+ path: datasetPath,
2862
+ tableNamespace,
2863
+ phase: 'registered',
2864
+ persistedRows: 0,
2865
+ succeededRows: 0,
2866
+ failedRows: 0,
2867
+ complete: false,
2868
+ // ADR 0019 dataset-grain row birth. These rows entered from
2869
+ // play-body code, so the only witnessed fact is how many arrived at
2870
+ // this table — never a per-row source mapping, which the runtime
2871
+ // does not see here. `rowCountIn` counts rows admitted through this
2872
+ // boundary so far, so a paged dataset converges upward instead of
2873
+ // reporting only its last page.
2874
+ bornFrom: {
2875
+ table: tableNamespace,
2876
+ rowCountIn: (mapContext.inputOffset ?? 0) + items.length,
2877
+ },
2878
+ at: Date.now(),
2879
+ },
2819
2880
  },
2820
- runnerRunAttempt,
2821
- }),
2822
- );
2881
+ options,
2882
+ );
2883
+ emitRunnerEvent(
2884
+ {
2885
+ type: 'log',
2886
+ at: new Date().toISOString(),
2887
+ source: 'play',
2888
+ line: formatDatasetRegistrationLog({
2889
+ dataset: { path: datasetPath, tableNamespace },
2890
+ rows: items.length,
2891
+ }),
2892
+ },
2893
+ options,
2894
+ );
2895
+ }
2896
+ if (
2897
+ mapStartResult.attemptId &&
2898
+ mapStartResult.attemptOwnerRunId &&
2899
+ mapStartResult.attemptExpiresAt
2900
+ ) {
2901
+ runtimeSheetAttempts.set(
2902
+ attemptKey,
2903
+ runtimeSheetAttemptForMapStart({
2904
+ tableNamespace,
2905
+ runId,
2906
+ existing: runtimeSheetAttempts.get(attemptKey),
2907
+ mapStartResult: {
2908
+ attemptId: mapStartResult.attemptId,
2909
+ attemptOwnerRunId: mapStartResult.attemptOwnerRunId,
2910
+ attemptExpiresAt: mapStartResult.attemptExpiresAt,
2911
+ attemptSeq: mapStartResult.attemptSeq,
2912
+ writeVersion: mapStartResult.writeVersion,
2913
+ },
2914
+ runnerRunAttempt,
2915
+ }),
2916
+ );
2917
+ }
2918
+ inserted += mapStartResult.inserted;
2919
+ skipped += mapStartResult.skipped;
2920
+ yield mapStartResult;
2823
2921
  }
2824
2922
  emitWorkerLog(
2825
2923
  `[perf] runtime map setup table=${tableNamespace} rows=${items.length} elapsed_ms=${Date.now() - startedAt}`,
2826
2924
  options,
2827
2925
  );
2828
- inserted += mapStartResult.inserted;
2829
- skipped += mapStartResult.skipped;
2830
- return mapStartResult;
2831
2926
  },
2832
2927
  onMapRowsCheckpoint: async (input) => {
2833
2928
  if (input.updates.length === 0) return;
@@ -2878,6 +2973,8 @@ async function run(
2878
2973
  vercelProtectionBypassToken:
2879
2974
  config.context.vercelProtectionBypassToken,
2880
2975
  signal: persistenceSignal,
2976
+ connectionRetryBudgetMs:
2977
+ RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS,
2881
2978
  },
2882
2979
  {
2883
2980
  playName,
@@ -3800,10 +3897,27 @@ export function projectPlayResultForTransport(
3800
3897
  output[key] = entry;
3801
3898
  }
3802
3899
 
3803
- assertCustomerPlayReturnWithinLimit({
3900
+ const boundedOutput = truncateCustomerPlayReturnWithinLimit({
3804
3901
  value: output,
3805
3902
  });
3806
- return { output, warnings: [] };
3903
+ return {
3904
+ output: boundedOutput.value,
3905
+ warnings: boundedOutput.truncated
3906
+ ? [
3907
+ {
3908
+ code: 'RUN_OUTPUT_TRUNCATED',
3909
+ reason: 'byte_limit',
3910
+ message:
3911
+ 'The Play return was truncated to fit the output limit. Return a Dataset Handle to keep a large result recoverable.',
3912
+ originalBytesAtLeast: boundedOutput.originalBytesAtLeast,
3913
+ retainedBytes: boundedOutput.retainedBytes,
3914
+ limitBytes: boundedOutput.limitBytes,
3915
+ retryable: false,
3916
+ recoverableFrom: 'none',
3917
+ },
3918
+ ]
3919
+ : [],
3920
+ };
3807
3921
  }
3808
3922
 
3809
3923
  function serializePlayResult<T>(value: T): T {
@@ -58,6 +58,23 @@ export function runnerGatewayTransportErrorCode(error: unknown): string {
58
58
  return SAFE_ERROR_NAMES.has(name) ? name : 'unknown';
59
59
  }
60
60
 
61
+ /**
62
+ * True when a request got no HTTP response at all: DNS, connect, reset, or a
63
+ * socket that stalled. Node's fetch reports these as `fetch failed` or
64
+ * `terminated` with an errno or undici code on the cause.
65
+ */
66
+ export function isRunnerGatewayNoResponseError(error: unknown): boolean {
67
+ if (
68
+ /^(?:E[A-Z0-9_]+|UND_ERR_[A-Z0-9_]+)$/.test(
69
+ runnerGatewayTransportErrorCode(error),
70
+ )
71
+ ) {
72
+ return true;
73
+ }
74
+ const message = error instanceof Error ? error.message : '';
75
+ return /^(?:fetch failed|terminated)$/i.test(message);
76
+ }
77
+
61
78
  export function updateRunnerGatewayTransportSummary(
62
79
  previous: RunnerGatewayTransportSummary | null,
63
80
  event: RunnerGatewayTransportEvent,