deepline 0.3.460 → 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 (297) 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/billing/state.ts +28 -0
  17. package/dist/bundling-sources/shared_libs/monitors/callback-security.ts +0 -307
  18. package/dist/bundling-sources/shared_libs/monitors/http-error-response.ts +3 -0
  19. package/dist/bundling-sources/shared_libs/monitors/lifecycle-notifications.ts +3 -2
  20. package/dist/bundling-sources/shared_libs/monitors/package.json +2 -0
  21. package/dist/bundling-sources/shared_libs/monitors/provider-callback-verification.ts +34 -0
  22. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-batch-operation.ts +59 -0
  23. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +94 -1
  24. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +35 -1
  25. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-failure-codes.ts +24 -0
  26. package/dist/bundling-sources/shared_libs/observability/dlq.ts +32 -0
  27. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +57 -3
  28. package/dist/bundling-sources/shared_libs/observability/scheduled-work.ts +1 -0
  29. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +66 -1
  30. package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +36 -7
  31. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +250 -11
  32. package/dist/bundling-sources/shared_libs/play-runtime/array-input-store.ts +319 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +991 -359
  34. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +17 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-janitor.ts +13 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/daytona-sandbox-reaper.ts +110 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +155 -6
  38. package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +110 -6
  39. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +127 -13
  40. package/dist/bundling-sources/shared_libs/play-runtime/execution-capabilities.ts +14 -1
  41. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +57 -1
  42. package/dist/bundling-sources/shared_libs/play-runtime/free-company-lookup-batching.ts +218 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/gateway-postgres-admission.ts +42 -5
  44. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-budget-state-backend.ts +6 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +92 -31
  46. package/dist/bundling-sources/shared_libs/play-runtime/governor/block-reserving-budget-state-backend.ts +69 -14
  47. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +93 -23
  48. package/dist/bundling-sources/shared_libs/play-runtime/governor/in-memory-rate-state-backend.ts +15 -4
  49. package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +22 -18
  50. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +5 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -0
  52. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +190 -14
  53. package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +131 -0
  54. package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +77 -2
  55. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +271 -2
  56. package/dist/bundling-sources/shared_libs/play-runtime/play-run-recovery-policy.ts +51 -0
  57. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/contracts.ts +2 -0
  58. package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +27 -1
  59. package/dist/bundling-sources/shared_libs/play-runtime/play-runtime-batching-registry.ts +2 -0
  60. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
  61. package/dist/bundling-sources/shared_libs/play-runtime/provider-text-for-log.ts +63 -0
  62. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +19 -0
  63. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-event-transport.ts +112 -16
  64. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +104 -2
  65. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +265 -151
  66. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-gateway-transport.ts +17 -0
  67. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +35 -14
  68. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-sheet-persistence-retry.ts +12 -1
  69. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +4 -0
  70. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-labels.ts +36 -0
  71. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +136 -70
  72. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +237 -36
  73. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +148 -4
  74. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +6 -0
  75. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +285 -32
  76. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +251 -56
  77. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +29 -4
  78. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/sandbox-create-outcome.ts +27 -0
  79. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +22 -1
  80. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1397 -382
  81. package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +920 -0
  82. package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +16 -0
  83. package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +38 -0
  84. package/dist/bundling-sources/shared_libs/play-runtime/runtime-flow.ts +6 -0
  85. package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +26 -1
  86. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +30 -0
  87. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +14 -3
  88. package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-writer.ts +31 -4
  89. package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-transition.ts +47 -0
  90. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +20 -7
  91. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +12 -0
  92. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +9 -0
  93. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +10 -0
  94. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +4 -0
  95. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +1496 -320
  96. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-worker-required-env.ts +31 -1
  97. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +1389 -129
  98. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +36 -0
  99. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
  100. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +162 -23
  101. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +499 -115
  102. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +377 -9
  103. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-ledger-reconciliation.ts +117 -8
  104. package/dist/bundling-sources/shared_libs/play-runtime/secret-resolution-retry-policy.ts +25 -0
  105. package/dist/bundling-sources/shared_libs/play-runtime/terminal-runtime-performance.ts +391 -0
  106. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +40 -0
  107. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +6 -0
  108. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/mapped-calls.ts +171 -0
  109. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/receipt-cohort.ts +16 -1
  110. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +26 -3
  111. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +16 -2
  112. package/dist/bundling-sources/shared_libs/play-runtime/transport-error-diagnostics.ts +28 -0
  113. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-storage-contract.ts +55 -5
  114. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +41 -1
  115. package/dist/bundling-sources/shared_libs/plays/contracts.ts +4 -0
  116. package/dist/bundling-sources/shared_libs/plays/dataset.ts +9 -3
  117. package/dist/bundling-sources/shared_libs/plays/deploy/manifest-contract.ts +2 -0
  118. package/dist/bundling-sources/shared_libs/plays/deploy/manifest.ts +3 -2
  119. package/dist/bundling-sources/shared_libs/plays/deploy/project-serializer.ts +2 -2
  120. package/dist/bundling-sources/shared_libs/plays/run-output-summary.ts +66 -0
  121. package/dist/bundling-sources/shared_libs/plays/script-entry.ts +1 -1
  122. package/dist/bundling-sources/shared_libs/product-notifications/catalog.ts +43 -1
  123. package/dist/bundling-sources/shared_libs/product-notifications/content.ts +9 -0
  124. package/dist/bundling-sources/shared_libs/product-notifications/email.ts +91 -13
  125. package/dist/bundling-sources/shared_libs/product-notifications/events.ts +3 -0
  126. package/dist/bundling-sources/shared_libs/product-notifications/slack-delivery.ts +41 -24
  127. package/dist/bundling-sources/shared_libs/security/attested-client-ip.ts +91 -0
  128. package/dist/bundling-sources/shared_libs/security/internal-actor.ts +0 -11
  129. package/dist/cli/{auth-HKA6ZVHQ.mjs → auth-JDLEY7VU.mjs} +5 -4
  130. package/dist/cli/auth-UXKY6TCC.js +41 -0
  131. package/dist/cli/{billing-MTO2ZZ3G.js → billing-HXAXB3XZ.js} +152 -78
  132. package/dist/cli/{billing-26G44S5N.mjs → billing-SDHLBLMV.mjs} +84 -10
  133. package/dist/cli/{chunk-BHGII2D6.js → chunk-3ACMRZRV.js} +8 -6
  134. package/dist/cli/{chunk-S4Q2XCGM.mjs → chunk-3KZCFOZ6.mjs} +1 -1
  135. package/dist/cli/chunk-4KQ6SIBC.mjs +1038 -0
  136. package/dist/cli/{chunk-Z2GUFYT6.js → chunk-5LEAXRHV.js} +11 -11
  137. package/dist/cli/{chunk-XAYO3Q2X.mjs → chunk-6NNVJDVR.mjs} +7 -5
  138. package/dist/cli/{chunk-NMJ4D2WO.js → chunk-6PMCRYDA.js} +216 -91
  139. package/dist/cli/{chunk-OMM54B3X.mjs → chunk-6RNQGWFD.mjs} +16 -806
  140. package/dist/cli/{chunk-EBU7LQ64.js → chunk-6V7KVRR5.js} +3 -3
  141. package/dist/cli/{chunk-RDPTDDKX.js → chunk-7LFIMWMW.js} +2 -2
  142. package/dist/cli/chunk-7MJ6VI2T.mjs +19 -0
  143. package/dist/cli/chunk-7SWNPNML.js +1039 -0
  144. package/dist/cli/{chunk-CTRPCARW.mjs → chunk-7U3XNPOA.mjs} +267 -38
  145. package/dist/cli/{chunk-RBTTUYZZ.js → chunk-7VZHXVOQ.js} +1 -1
  146. package/dist/cli/{chunk-YVBWO647.mjs → chunk-AT636LLU.mjs} +2 -2
  147. package/dist/cli/{chunk-VTODQWQA.js → chunk-BGTPIMSM.js} +392 -261
  148. package/dist/cli/{chunk-KADIT5NV.mjs → chunk-CKSOY47X.mjs} +2 -2
  149. package/dist/cli/{chunk-7DH2FD7Y.mjs → chunk-D464JW3N.mjs} +5 -85
  150. package/dist/cli/chunk-D6DXOUTO.mjs +827 -0
  151. package/dist/cli/{describe-QW54QQNB.js → chunk-EM4TXCCI.js} +27 -44
  152. package/dist/cli/chunk-F6QV42MC.mjs +91 -0
  153. package/dist/cli/chunk-FKVYR3QA.mjs +1039 -0
  154. package/dist/cli/{chunk-LMAULZLF.js → chunk-GEGW5HPZ.js} +29 -27
  155. package/dist/cli/{chunk-M52JQSLK.js → chunk-HUB3CCM2.js} +13 -4
  156. package/dist/cli/{chunk-YHTQM5XI.js → chunk-I6VHOU5O.js} +27 -27
  157. package/dist/cli/{chunk-Z2XUZC34.js → chunk-IAYSWZDJ.js} +188 -76
  158. package/dist/cli/chunk-JF3TLIMQ.js +19 -0
  159. package/dist/cli/{chunk-HDFRJ4IT.mjs → chunk-JVHOS3K3.mjs} +177 -65
  160. package/dist/cli/{chunk-LAWEURCT.mjs → chunk-LFXLQEZN.mjs} +1 -1
  161. package/dist/cli/{chunk-2PBN4SZE.js → chunk-LROWFPGN.js} +16 -16
  162. package/dist/cli/{chunk-SLEUWLJE.mjs → chunk-MSY22NQW.mjs} +5 -5
  163. package/dist/cli/{chunk-LVJOFUU7.mjs → chunk-MUUQZIOF.mjs} +23 -49
  164. package/dist/cli/{chunk-2XHWOQF4.js → chunk-NBLSCHKK.js} +52 -50
  165. package/dist/cli/{chunk-526R2HON.mjs → chunk-NHRWZPWZ.mjs} +4 -2
  166. package/dist/cli/{chunk-KXMNM4AQ.js → chunk-NMU3VR5U.js} +4 -5
  167. package/dist/cli/{chunk-W3BE3CHK.mjs → chunk-O2RX5A66.mjs} +14 -12
  168. package/dist/cli/{chunk-UKFZT7RF.js → chunk-OMQ23IXL.js} +2 -2
  169. package/dist/cli/{chunk-LJTFZOHU.js → chunk-OPJAJBD4.js} +28 -54
  170. package/dist/cli/{chunk-MLFR6DVF.mjs → chunk-PHSEINNH.mjs} +5 -5
  171. package/dist/cli/{chunk-3DNKFH2G.mjs → chunk-PKHVSIJG.mjs} +19 -1
  172. package/dist/cli/{chunk-WIYWSYDS.mjs → chunk-Q2EIZKVX.mjs} +3 -3
  173. package/dist/cli/{chunk-VJAEA4CS.js → chunk-QJZ6WNWD.js} +8 -8
  174. package/dist/cli/{chunk-EIMG75BT.mjs → chunk-S3A4IXBQ.mjs} +4 -5
  175. package/dist/cli/{chunk-RZSTT45F.mjs → chunk-S42YIQNE.mjs} +13 -8
  176. package/dist/cli/{chunk-YULBYKAK.mjs → chunk-S6UAJR6V.mjs} +3 -3
  177. package/dist/cli/{chunk-G7L27KZB.mjs → chunk-TKAQR3IB.mjs} +31 -21
  178. package/dist/cli/{chunk-QWRHGGUH.js → chunk-UAJFWWZE.js} +20 -2
  179. package/dist/cli/{chunk-ZR2RLI4O.mjs → chunk-UDRPEZ5F.mjs} +223 -92
  180. package/dist/cli/{chunk-QGAWTBIR.js → chunk-ULK7JGGI.js} +511 -282
  181. package/dist/cli/chunk-V335HGX5.js +1038 -0
  182. package/dist/cli/{chunk-NH6JSJW6.mjs → chunk-V3MEA7NB.mjs} +7 -5
  183. package/dist/cli/{chunk-NRGGFVVB.js → chunk-VFGVXXZP.js} +37 -35
  184. package/dist/cli/chunk-VLEVVDWG.js +91 -0
  185. package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-VPHN2HAL.mjs} +216 -91
  186. package/dist/cli/{chunk-CFUTOWE4.js → chunk-WG3KGAII.js} +8 -88
  187. package/dist/cli/{describe-TOMIAT37.mjs → chunk-WIY6U6GD.mjs} +19 -36
  188. package/dist/cli/{chunk-YS2YBSJB.js → chunk-XANRM3QA.js} +6 -6
  189. package/dist/cli/{chunk-KGQNIA37.js → chunk-XQCTG5OO.js} +44 -34
  190. package/dist/cli/{chunk-EJGBLXDZ.mjs → chunk-XZAFIOUQ.mjs} +1 -1
  191. package/dist/cli/chunk-Y4DPU4OM.js +827 -0
  192. package/dist/cli/chunk-YT5EODJO.js +920 -0
  193. package/dist/cli/{chunk-2WRO2UJ5.js → chunk-ZGQSFYD2.js} +56 -51
  194. package/dist/cli/{chunk-OJ6RUKVT.mjs → chunk-ZUK6LIJB.mjs} +10 -1
  195. package/dist/cli/command-docs.d.mts +5 -0
  196. package/dist/cli/command-docs.d.ts +5 -0
  197. package/dist/cli/command-docs.js +2 -2
  198. package/dist/cli/command-docs.mjs +1 -1
  199. package/dist/cli/{csv-6FNFYJUC.js → csv-C56GSCEU.js} +13 -12
  200. package/dist/cli/{csv-MDHT4BKK.mjs → csv-L54JS7TF.mjs} +4 -3
  201. package/dist/cli/{db-D6AMVOEW.js → db-MOGRMZTA.js} +30 -27
  202. package/dist/cli/{db-74O3RFWY.mjs → db-YVBUW2DX.mjs} +10 -7
  203. package/dist/cli/describe-KYEULWPG.js +48 -0
  204. package/dist/cli/describe-NLZKKT7C.mjs +48 -0
  205. package/dist/cli/describe-core.d.mts +153 -5
  206. package/dist/cli/describe-core.d.ts +153 -5
  207. package/dist/cli/describe-core.js +9 -5
  208. package/dist/cli/describe-core.mjs +10 -6
  209. package/dist/cli/{executions-N4FMGVSC.js → executions-A7L4ULPP.js} +9 -7
  210. package/dist/cli/{executions-PVSF4HUF.mjs → executions-ZBGSTT37.mjs} +7 -5
  211. package/dist/cli/{feedback-OB7NANZW.mjs → feedback-G6GU37FD.mjs} +6 -5
  212. package/dist/cli/{feedback-WFSPCAI2.js → feedback-OHLY7RYD.js} +10 -9
  213. package/dist/cli/getting-started.d.mts +6 -6
  214. package/dist/cli/getting-started.d.ts +6 -6
  215. package/dist/cli/getting-started.js +2 -2
  216. package/dist/cli/getting-started.mjs +1 -1
  217. package/dist/cli/git-P76N4NDQ.js +25 -0
  218. package/dist/cli/{git-FHUSPAEU.mjs → git-PKZW3QD5.mjs} +5 -4
  219. package/dist/cli/index.js +152 -142
  220. package/dist/cli/index.mjs +56 -46
  221. package/dist/cli/{legacy-noops-ECHNA5HN.js → legacy-noops-5LM3D724.js} +8 -7
  222. package/dist/cli/{legacy-noops-HMK4BSCI.mjs → legacy-noops-LJJYG6YA.mjs} +5 -4
  223. package/dist/cli/{monitors-U7VQ3EZM.mjs → monitors-72QV4ALO.mjs} +19 -6
  224. package/dist/cli/{monitors-XLLFNENH.js → monitors-UX3H5DC2.js} +103 -90
  225. package/dist/cli/{org-6H3USO5M.mjs → org-6RRRKOCP.mjs} +9 -6
  226. package/dist/cli/{org-QX6ER2HN.js → org-IF7ISUVB.js} +70 -67
  227. package/dist/cli/pages-3SU3HKL7.js +252 -0
  228. package/dist/cli/pages-DXDYYKEK.mjs +252 -0
  229. package/dist/cli/{play-MOB2WYOR.mjs → play-AHASKRLA.mjs} +512 -1508
  230. package/dist/cli/{play-WNB7HBZK.js → play-EUIUVLUH.js} +1090 -2086
  231. package/dist/cli/{providers-CXEZ23E2.mjs → providers-GWGE3WY3.mjs} +7 -5
  232. package/dist/cli/{providers-7M3DISKX.js → providers-V5WU4VXJ.js} +10 -8
  233. package/dist/cli/{quickstart-ZFCHKHF6.mjs → quickstart-OXKQ5ZST.mjs} +5 -4
  234. package/dist/cli/{quickstart-CLJT4AZL.js → quickstart-QP65I5PF.js} +13 -12
  235. package/dist/cli/run-6MM72IGL.mjs +443 -0
  236. package/dist/cli/run-F3FTYS56.js +443 -0
  237. package/dist/cli/search-OYKOOI7A.js +32 -0
  238. package/dist/cli/{search-FVYWYIC3.mjs → search-ZMEBVJZB.mjs} +8 -6
  239. package/dist/cli/{secrets-YRLKZQS5.js → secrets-ACND5N6A.js} +16 -14
  240. package/dist/cli/{secrets-WAMPTQFC.mjs → secrets-XRCJFF3L.mjs} +7 -5
  241. package/dist/cli/{sessions-IQ332BJH.mjs → sessions-RTK3CEW6.mjs} +5 -4
  242. package/dist/cli/{sessions-44J6WIVU.js → sessions-ZGRJPCFF.js} +6 -5
  243. package/dist/cli/{settings-4IJR2I2T.js → settings-PD5KWQQZ.js} +80 -77
  244. package/dist/cli/{settings-22S6NIFQ.mjs → settings-XDRBPRDE.mjs} +14 -11
  245. package/dist/cli/{setup-OZUPKKPW.mjs → setup-3HPYAOCC.mjs} +12 -10
  246. package/dist/cli/{setup-3FWSRNOX.js → setup-E2Q6PXHC.js} +53 -51
  247. package/dist/cli/{skills-5CW3NFP3.mjs → skills-OOQFMPOV.mjs} +7 -6
  248. package/dist/cli/skills-XYWV52KB.js +31 -0
  249. package/dist/cli/tools-ASCDZJCK.js +55 -0
  250. package/dist/cli/tools-C5ZT3UIC.mjs +55 -0
  251. package/dist/cli/update-5RQSEIFM.js +33 -0
  252. package/dist/cli/{update-IBULOV7P.mjs → update-ZWJTADIW.mjs} +9 -8
  253. package/dist/cli/{workflow-MVZT7MWT.mjs → workflow-23NMPAJ7.mjs} +10 -8
  254. package/dist/cli/{workflow-Z7FW6GT2.js → workflow-TCXU5YJV.js} +20 -18
  255. package/dist/client-DS2IWYZF.d.ts +10 -0
  256. package/dist/client-DTwnz_AW.d.mts +10 -0
  257. package/dist/{client-CYqG23K1.d.ts → client-core-B_6HAIBy.d.ts} +385 -12
  258. package/dist/{client-BbU5_j7n.d.mts → client-core-DzBSlY1U.d.mts} +385 -12
  259. package/dist/{compiler-manifest-CWz_sNOQ.d.mts → compiler-manifest-Dcyd3-Zd.d.mts} +43 -1
  260. package/dist/{compiler-manifest-CWz_sNOQ.d.ts → compiler-manifest-Dcyd3-Zd.d.ts} +43 -1
  261. package/dist/errors-d-sTrZhe.d.mts +142 -0
  262. package/dist/errors-yQwfgrcX.d.ts +142 -0
  263. package/dist/{index-BF2JB_Ug.d.mts → index-C6oXchjN.d.mts} +1 -1
  264. package/dist/{index-4NPXDzlD.d.ts → index-P56zy_z5.d.ts} +1 -1
  265. package/dist/index.d.mts +11 -147
  266. package/dist/index.d.ts +11 -147
  267. package/dist/index.js +15 -11
  268. package/dist/index.mjs +14 -10
  269. package/dist/install-integrity.json +141 -104
  270. package/dist/plays/bundle-play-file.d.mts +3 -3
  271. package/dist/plays/bundle-play-file.d.ts +3 -3
  272. package/dist/plays/bundle-play-file.mjs +2 -1
  273. package/dist/plays/play-description.d.mts +2 -2
  274. package/dist/plays/play-description.d.ts +2 -2
  275. package/dist/plays/play-description.js +2 -2
  276. package/dist/plays/play-description.mjs +1 -1
  277. package/dist/plays/run-request.d.mts +2 -2
  278. package/dist/plays/run-request.d.ts +2 -2
  279. package/dist/release.d.mts +1 -1
  280. package/dist/release.d.ts +1 -1
  281. package/dist/release.js +2 -2
  282. package/dist/release.mjs +1 -1
  283. package/dist/server.d.mts +17 -0
  284. package/dist/server.d.ts +17 -0
  285. package/dist/server.js +76 -0
  286. package/dist/server.mjs +76 -0
  287. package/package.json +6 -1
  288. package/dist/cli/auth-VDOCNR7H.js +0 -40
  289. package/dist/cli/chunk-PQUUWFXY.js +0 -95
  290. package/dist/cli/chunk-QJLKYYPX.js +0 -1710
  291. package/dist/cli/chunk-YBWAG72P.mjs +0 -95
  292. package/dist/cli/git-4PMBJSH5.js +0 -24
  293. package/dist/cli/search-4CCQCTVD.js +0 -30
  294. package/dist/cli/skills-LMNM6B5F.js +0 -30
  295. package/dist/cli/tools-AGBBDJ7P.js +0 -45
  296. package/dist/cli/tools-NOPBDRGW.mjs +0 -45
  297. package/dist/cli/update-U3W6USVD.js +0 -32
@@ -17,6 +17,22 @@ export const PLAY_RUNNER_TERMINAL_GRACE_SECONDS = 90;
17
17
  */
18
18
  export const PLAY_RUNNER_STARTUP_GRACE_SECONDS = 4 * 60;
19
19
 
20
+ /**
21
+ * Longest sandbox network cut a running Play must survive. Daytona cut running
22
+ * sandboxes off for 564 to 621 seconds between 2026-10-27 and 2026-10-30 while
23
+ * their processes kept running.
24
+ */
25
+ export const SANDBOX_NETWORK_CUT_MAX_MS = 11 * 60_000;
26
+
27
+ /**
28
+ * How long the runner keeps retrying a gateway request that gets no HTTP
29
+ * response at all: the longest cut, plus a 30-second request timeout and its
30
+ * backoff on each side of it. A request that gets an error response keeps its
31
+ * own, shorter budget.
32
+ */
33
+ export const RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS =
34
+ SANDBOX_NETWORK_CUT_MAX_MS + 60_000;
35
+
20
36
  /**
21
37
  * Runner timeout includes setup, cleanup, and billing headroom after the
22
38
  * user-code runtime cap.
@@ -86,6 +86,44 @@ export function normalizePlayRuntimeSelection(
86
86
  };
87
87
  }
88
88
 
89
+ /**
90
+ * The app's own runtime, on a named sandbox placement policy. Internal-only:
91
+ * the `play_run.sandbox_placement` capability in
92
+ * `@deepline/auth/internal-capabilities` decides who may send it.
93
+ */
94
+ export type PlayNativeRuntimeSelection = {
95
+ environment: 'native';
96
+ sandboxPlacementPolicy: string;
97
+ };
98
+
99
+ /** Every `runtime` value a Play run accepts. */
100
+ export type PlayRunRuntimeSelection =
101
+ | PlayRuntimeSelection
102
+ | PlayNativeRuntimeSelection;
103
+
104
+ export function normalizePlayRunRuntimeSelection(
105
+ value: unknown,
106
+ ): PlayRunRuntimeSelection | null {
107
+ if (!value || typeof value !== 'object' || Array.isArray(value)) return null;
108
+ const record = value as Record<string, unknown>;
109
+ if (record.environment !== 'native') {
110
+ return normalizePlayRuntimeSelection(value);
111
+ }
112
+ if (
113
+ Object.keys(record).some(
114
+ (key) => key !== 'environment' && key !== 'sandboxPlacementPolicy',
115
+ )
116
+ ) {
117
+ return null;
118
+ }
119
+ const sandboxPlacementPolicy = normalizePlayRuntimeSandboxPlacementPolicy(
120
+ record.sandboxPlacementPolicy,
121
+ );
122
+ return sandboxPlacementPolicy
123
+ ? { environment: 'native', sandboxPlacementPolicy }
124
+ : null;
125
+ }
126
+
89
127
  export function normalizePlayRuntimeEnvironment(
90
128
  value: unknown,
91
129
  ): PlayRuntimeEnvironment | null {
@@ -252,6 +252,12 @@ export function createRuntimeDispatchFlow<
252
252
  : null;
253
253
  if (!providerPermit) {
254
254
  releaseExecutionSlot();
255
+ // A backend without a local due permit must re-enter provider
256
+ // admission. First let FIFO waiters return their reserved slots:
257
+ // immediately resolved provider admissions can otherwise circulate
258
+ // that reservation forever without allowing timers or aborts to run.
259
+ // Neither a provider permit nor an execution slot is held here.
260
+ await new Promise<void>((resolve) => setTimeout(resolve, 0));
255
261
  continue;
256
262
  }
257
263
  }
@@ -19,6 +19,7 @@ export const RUNTIME_TEST_FAULT_IDS = [
19
19
  'receipt_claim_response_timeout',
20
20
  'modal_sandbox_create_resource_exhausted',
21
21
  'runtime_sheet_page_tail_hold_ms',
22
+ 'runner_heartbeat_silence_ms',
22
23
  ] as const;
23
24
 
24
25
  export type RuntimeTestFaultName = (typeof RUNTIME_TEST_FAULT_IDS)[number];
@@ -40,7 +41,8 @@ export type RuntimeIncidentSafetyFact =
40
41
  | 'bounded_provider_execution'
41
42
  | 'retry_or_explicit_recovery'
42
43
  | 'no_user_code_before_recovery'
43
- | 'all_rows_settle_once';
44
+ | 'all_rows_settle_once'
45
+ | 'no_loss_verdict_without_provider_proof';
44
46
 
45
47
  /**
46
48
  * The automated evidence that proves this drill. A focused regression owns a
@@ -353,6 +355,29 @@ export const RUNTIME_INCIDENT_DRILL_CATALOG: readonly RuntimeIncidentDrill[] = [
353
355
  target: 'page-tail-sheet-write-hold-e2e',
354
356
  },
355
357
  },
358
+ {
359
+ id: 'runner_heartbeat_silence_ms',
360
+ description:
361
+ 'Stop a live detached runner heartbeating for a bounded time while its process keeps running.',
362
+ topologies: LOCAL_AND_PREVIEW_TOPOLOGIES,
363
+ control: {
364
+ kind: 'runtime_test_fault',
365
+ // The 120-second lease plus 80 seconds of confirmation puts the first
366
+ // provider read at about 200 seconds. The rest absorbs late wakes, so
367
+ // that read lands inside the silence and not after it.
368
+ defaultValue: 300_000,
369
+ valueMeaning: 'milliseconds',
370
+ },
371
+ expected: {
372
+ outcome:
373
+ 'The worker asks the provider once the lease and confirmation pass, the sandbox is not proven gone, and the same attempt finishes after heartbeats return.',
374
+ safetyFacts: ['same_logical_run', 'no_loss_verdict_without_provider_proof'],
375
+ },
376
+ verification: {
377
+ kind: 'preview_black_box',
378
+ target: 'silent-runner-liveness-e2e',
379
+ },
380
+ },
356
381
  ];
357
382
 
358
383
  export type RuntimeTestFaultDrill = Omit<
@@ -24,6 +24,31 @@ export const RUNTIME_SHEET_ADMISSION_OPERATION_CONTRACT: DeployedOperationContra
24
24
  },
25
25
  });
26
26
 
27
+ /** Named, run-scoped array source snapshots. Older receivers retain legacy array admission. */
28
+ export const RUNTIME_ARRAY_INPUT_CAPABILITIES = {
29
+ runtime_array_input_get_manifest: 'receipt.read',
30
+ runtime_array_input_begin: 'receipt.write',
31
+ runtime_array_input_put_page: 'receipt.write',
32
+ runtime_array_input_seal: 'receipt.write',
33
+ runtime_array_input_read_page: 'receipt.read',
34
+ } as const satisfies Readonly<Record<string, RuntimeExecutionCapability>>;
35
+
36
+ export const RUNTIME_ARRAY_INPUT_OPERATION_CONTRACT: DeployedOperationContract =
37
+ deployed.operation({
38
+ id: 'runtime-array-input-actions',
39
+ actions: RUNTIME_ARRAY_INPUT_CAPABILITIES,
40
+ olderReceiver: {
41
+ runtime_array_input_get_manifest: {
42
+ kind: 'feature-unavailable',
43
+ code: 'RUNTIME_ARRAY_INPUT_UNAVAILABLE',
44
+ },
45
+ runtime_array_input_begin: {
46
+ kind: 'feature-unavailable',
47
+ code: 'RUNTIME_ARRAY_INPUT_UNAVAILABLE',
48
+ },
49
+ },
50
+ });
51
+
27
52
  /**
28
53
  * One declarative owner for the runtime action → authority relationship. The
29
54
  * route still owns authentication and execution; callers can add an action in
@@ -73,6 +98,7 @@ export const RUNTIME_OPERATION_CAPABILITIES = {
73
98
  resolve_secret: 'secret.resolve',
74
99
  // Provider prices and availability use the existing discovery authority.
75
100
  get_billing_entitlements: 'tool.inspect',
101
+ write_page: 'page.write',
76
102
  } as const satisfies Readonly<Record<string, RuntimeExecutionCapability>>;
77
103
 
78
104
  export const RUNTIME_OPERATION_CONTRACT: DeployedOperationContract =
@@ -84,6 +110,10 @@ export const RUNTIME_OPERATION_CONTRACT: DeployedOperationContract =
84
110
  kind: 'feature-unavailable',
85
111
  code: 'BILLING_ENTITLEMENTS_UNAVAILABLE',
86
112
  },
113
+ write_page: {
114
+ kind: 'feature-unavailable',
115
+ code: 'PAGES_UNAVAILABLE',
116
+ },
87
117
  project_run_events: {
88
118
  kind: 'equivalent-fallback',
89
119
  action: 'append_run_events',
@@ -35,6 +35,7 @@ import {
35
35
  RuntimeReceiptWriterResultCountError,
36
36
  writeRuntimeReceiptWithBackpressure,
37
37
  } from './runtime-receipt-writer';
38
+ import { RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS } from './runtime-constants';
38
39
 
39
40
  type ReceiptOutput =
40
41
  | RuntimeStepReceipt
@@ -122,8 +123,12 @@ export type RuntimeReceiptStoreHandlers = Required<
122
123
  // Four ambiguous 30-second receipt requests previously consumed the writer's
123
124
  // entire two-minute budget. Receipt operations are idempotent and buffered, so
124
125
  // keep retry ownership here and allow independent transports enough attempts
125
- // to recover from a short gateway/network impairment.
126
+ // to recover from a short gateway impairment. This budget covers retryable
127
+ // error responses; requests that get no response at all retry through a whole
128
+ // sandbox network cut instead.
126
129
  export const RUNTIME_RECEIPT_STORE_RETRY_BUDGET_MS = 5 * 60_000;
130
+ export const RUNTIME_RECEIPT_STORE_CONNECTION_RETRY_BUDGET_MS =
131
+ RUNNER_GATEWAY_CONNECTION_RETRY_BUDGET_MS;
127
132
 
128
133
  /**
129
134
  * The runner's single Work Receipt Adapter.
@@ -221,6 +226,8 @@ export class RuntimeReceiptStoreAdapter {
221
226
  maxBufferedItems: options.maxBufferedItems,
222
227
  maxBufferedBytes: options.maxBufferedBytes,
223
228
  maxRetryElapsedMs: RUNTIME_RECEIPT_STORE_RETRY_BUDGET_MS,
229
+ maxConnectionRetryElapsedMs:
230
+ RUNTIME_RECEIPT_STORE_CONNECTION_RETRY_BUDGET_MS,
224
231
  classifyRetryableError: classifyReceiptRetry,
225
232
  onRetryEvent: (event) =>
226
233
  emitReceiptWriterRetryTelemetry({
@@ -534,12 +541,16 @@ function receiptCommandOrderingKeys(
534
541
  }
535
542
  }
536
543
 
537
- function classifyReceiptRetry(error: unknown): { retryAfterMs: number } | null {
544
+ function classifyReceiptRetry(
545
+ error: unknown,
546
+ ): { retryAfterMs: number; connectionFailure?: boolean } | null {
538
547
  if (isAppRuntimeApiCapacityError(error)) {
539
548
  return { retryAfterMs: error.retryAfterMs };
540
549
  }
541
550
  if (error instanceof AppRuntimeApiTransportError) {
542
- return { retryAfterMs: 250 };
551
+ // The one-attempt transport throws this only when no complete HTTP
552
+ // response arrived: DNS, connect, reset, or its request timeout.
553
+ return { retryAfterMs: 250, connectionFailure: true };
543
554
  }
544
555
  if (error instanceof AppRuntimeApiResponseError && error.retryable) {
545
556
  return { retryAfterMs: 250 };
@@ -1,5 +1,10 @@
1
1
  type RetryableReceiptError = {
2
2
  retryAfterMs: number;
3
+ /**
4
+ * The request got no HTTP response at all. Time spent this way counts only
5
+ * against `maxConnectionRetryElapsedMs`, never against `maxRetryElapsedMs`.
6
+ */
7
+ connectionFailure?: boolean;
3
8
  };
4
9
 
5
10
  const MAX_RETRY_JITTER_RATIO = 0.25;
@@ -155,6 +160,7 @@ export class RuntimeReceiptWriter<Input, Output> {
155
160
  Required<RuntimeReceiptWriterLaneBufferLimit>
156
161
  >;
157
162
  readonly #maxRetryElapsedMs: number;
163
+ readonly #maxConnectionRetryElapsedMs: number;
158
164
  readonly #onRetryEvent:
159
165
  | ((event: RuntimeReceiptWriterRetryEvent<Input>) => void)
160
166
  | null;
@@ -219,7 +225,13 @@ export class RuntimeReceiptWriter<Input, Output> {
219
225
  maxBufferedByLane?: Readonly<
220
226
  Record<string, RuntimeReceiptWriterLaneBufferLimit>
221
227
  >;
228
+ /** Retry budget for failures that returned an HTTP response. */
222
229
  maxRetryElapsedMs?: number;
230
+ /**
231
+ * Retry budget for a batch whose latest failure got no HTTP response,
232
+ * measured from its first attempt. Defaults to `maxRetryElapsedMs`.
233
+ */
234
+ maxConnectionRetryElapsedMs?: number;
223
235
  onRetryEvent?: (event: RuntimeReceiptWriterRetryEvent<Input>) => void;
224
236
  /**
225
237
  * Called with the writer's buffered byte total every time it changes. The
@@ -299,6 +311,10 @@ export class RuntimeReceiptWriter<Input, Output> {
299
311
  options.maxRetryElapsedMs,
300
312
  2 * 60_000,
301
313
  );
314
+ this.#maxConnectionRetryElapsedMs = normalizePositiveInteger(
315
+ options.maxConnectionRetryElapsedMs,
316
+ this.#maxRetryElapsedMs,
317
+ );
302
318
  this.#onRetryEvent = options.onRetryEvent ?? null;
303
319
  this.#onBufferedBytesChanged = options.onBufferedBytesChanged ?? null;
304
320
  this.#onStatsChanged = options.onStatsChanged ?? null;
@@ -793,9 +809,14 @@ export class RuntimeReceiptWriter<Input, Output> {
793
809
  ): Promise<readonly Output[]> {
794
810
  const inputs = batch.map((pending) => pending.input);
795
811
  const startedAt = Date.now();
812
+ // Attempts that got no response, with the waits after them. They do not
813
+ // spend the error-response budget, so a 503 just after a long network cut
814
+ // still gets the full ordinary budget.
815
+ let connectionFailureMs = 0;
796
816
  let attempt = 0;
797
817
  while (true) {
798
818
  attempt += 1;
819
+ const attemptStartedAt = Date.now();
799
820
  if (this.#closeController.signal.aborted) {
800
821
  throw this.#closeReason;
801
822
  }
@@ -821,20 +842,23 @@ export class RuntimeReceiptWriter<Input, Output> {
821
842
  const retry = this.#classifyRetryableError(error);
822
843
  if (!retry) throw error;
823
844
  const elapsedMs = Date.now() - startedAt;
824
- if (elapsedMs >= this.#maxRetryElapsedMs) {
845
+ const [budgetElapsedMs, budgetMs] = retry.connectionFailure
846
+ ? [elapsedMs, this.#maxConnectionRetryElapsedMs]
847
+ : [elapsedMs - connectionFailureMs, this.#maxRetryElapsedMs];
848
+ if (budgetElapsedMs >= budgetMs) {
825
849
  throw new RuntimeReceiptWriterRetryDeadlineError(
826
850
  attempt,
827
851
  elapsedMs,
828
- this.#maxRetryElapsedMs,
852
+ budgetMs,
829
853
  { cause: error },
830
854
  );
831
855
  }
832
856
  const retryAfterMs = jitteredRetryDelayMs(retry.retryAfterMs);
833
- if (elapsedMs + retryAfterMs > this.#maxRetryElapsedMs) {
857
+ if (budgetElapsedMs + retryAfterMs > budgetMs) {
834
858
  throw new RuntimeReceiptWriterRetryDeadlineError(
835
859
  attempt,
836
860
  elapsedMs,
837
- this.#maxRetryElapsedMs,
861
+ budgetMs,
838
862
  { cause: error },
839
863
  );
840
864
  }
@@ -848,6 +872,9 @@ export class RuntimeReceiptWriter<Input, Output> {
848
872
  error,
849
873
  });
850
874
  await this.#waitForRetry(retryAfterMs, batch);
875
+ if (retry.connectionFailure) {
876
+ connectionFailureMs += Date.now() - attemptStartedAt;
877
+ }
851
878
  }
852
879
  }
853
880
  }
@@ -24,6 +24,53 @@ export type RuntimePreparedFailedRow = RuntimePreparedCompletedRow & {
24
24
  error: string;
25
25
  };
26
26
 
27
+ // Logical parameter framing for index/null tags and array-element overhead.
28
+ // This is a batching estimate, not an exact wire or executor-memory bound.
29
+ const RUNTIME_PREPARED_ROW_FRAMING_BYTES = 64;
30
+ const preparedRowEncoder = new TextEncoder();
31
+
32
+ /** Chunk already-serialized SQL inputs without touching authored object graphs. */
33
+ export function chunkPreparedRuntimeSheetRows<
34
+ T extends RuntimePreparedCompletedRow & { error?: string },
35
+ >(rows: readonly T[], input: { maxRows: number; maxBytes: number }): T[][] {
36
+ if (
37
+ !Number.isSafeInteger(input.maxRows) ||
38
+ input.maxRows <= 0 ||
39
+ !Number.isSafeInteger(input.maxBytes) ||
40
+ input.maxBytes <= 0
41
+ ) {
42
+ throw new Error(
43
+ 'Prepared Runtime Sheet chunk limits must be positive safe integers.',
44
+ );
45
+ }
46
+ const chunks: T[][] = [];
47
+ let chunk: T[] = [];
48
+ let chunkBytes = 0;
49
+ for (const row of rows) {
50
+ const bytes =
51
+ RUNTIME_PREPARED_ROW_FRAMING_BYTES +
52
+ preparedRowEncoder.encode(row.key).byteLength +
53
+ preparedRowEncoder.encode(row.data_patch_json).byteLength +
54
+ preparedRowEncoder.encode(row.cell_meta_patch_json).byteLength +
55
+ (row.error === undefined
56
+ ? 0
57
+ : preparedRowEncoder.encode(row.error).byteLength);
58
+ if (
59
+ chunk.length > 0 &&
60
+ (chunk.length >= input.maxRows || bytes > input.maxBytes - chunkBytes)
61
+ ) {
62
+ chunks.push(chunk);
63
+ chunk = [];
64
+ chunkBytes = 0;
65
+ }
66
+ // A valid row larger than the target budget remains one intact singleton.
67
+ chunk.push(row);
68
+ chunkBytes += bytes;
69
+ }
70
+ if (chunk.length > 0) chunks.push(chunk);
71
+ return chunks;
72
+ }
73
+
27
74
  export function normalizeRuntimeMapInputIndex(value: unknown): number | null {
28
75
  if (typeof value !== 'number' || !Number.isFinite(value)) {
29
76
  return null;
@@ -90,19 +90,32 @@ export function resolveRuntimeSandboxComputeItems(input: {
90
90
  * A provider create may finish after the original run has terminalized. Those
91
91
  * resources cannot be appended to the run's already-finalized billing
92
92
  * session, so the scheduler settles each through a stable adjustment session.
93
+ *
94
+ * A recovered create is recorded from its reservation, without the ceiling a
95
+ * live create carries, and cleanup may find it weeks later. It still bills no
96
+ * more than one run could: `maxBillingDurationSeconds` fills any missing one.
93
97
  */
94
98
  export function resolveLateRuntimeSandboxComputeItems(input: {
95
99
  resources: readonly unknown[];
96
100
  endedAt: number;
101
+ maxBillingDurationSeconds: number;
97
102
  }): ComputeBillingItem[] {
103
+ const lateResources: Record<string, unknown>[] = [];
104
+ for (const resource of input.resources) {
105
+ if (!resource || typeof resource !== 'object' || Array.isArray(resource)) {
106
+ continue;
107
+ }
108
+ const value = resource as Record<string, unknown>;
109
+ if (value.lateAcquired !== true) continue;
110
+ lateResources.push({
111
+ ...value,
112
+ maxBillingDurationSeconds:
113
+ finiteNonNegative(value.maxBillingDurationSeconds) ??
114
+ input.maxBillingDurationSeconds,
115
+ });
116
+ }
98
117
  return resolveRuntimeSandboxComputeItems({
99
- resources: input.resources.filter(
100
- (resource) =>
101
- Boolean(resource) &&
102
- typeof resource === 'object' &&
103
- !Array.isArray(resource) &&
104
- (resource as Record<string, unknown>).lateAcquired === true,
105
- ),
118
+ resources: lateResources,
106
119
  endedAt: input.endedAt,
107
120
  });
108
121
  }
@@ -1,3 +1,5 @@
1
+ import type { PlayRunnerDaytonaCleanupIntent } from '../runner-backends/types';
2
+
1
3
  /**
2
4
  * Sandbox Runs is the portable lifecycle boundary around a physical execution
3
5
  * resource. It is deliberately narrower than the scheduler attempt: it does
@@ -245,12 +247,17 @@ export type SandboxExecutionAdmission = {
245
247
  providerOperationToken?: string | null;
246
248
  /** Resume the existing durable provider operation before any new create. */
247
249
  resumeExistingProviderOperation?: boolean;
250
+ /** Existing operation has durable delete intent; cleanup owns it. */
251
+ resumePendingDelete?: boolean;
248
252
  /** Scheduler-clock age of the operation being resumed. */
249
253
  existingProviderOperationAgeMs?: number;
250
254
  }
251
255
  | { kind: 'pre_code_deferred'; reason: SandboxPreCodeDeferralReason }
252
256
  >;
253
257
  releaseCapacity(input: { leaseId: string }): Promise<void>;
258
+ recordDaytonaCleanupIntent?(
259
+ intent: PlayRunnerDaytonaCleanupIntent,
260
+ ): Promise<void>;
254
261
  claimProviderCircuit(input: {
255
262
  provider: Exclude<SandboxProvider, 'local'>;
256
263
  }): Promise<{ allowed: boolean; probeToken: string | null }>;
@@ -312,12 +319,17 @@ export type SandboxExecutionLifecycle = {
312
319
  providerOperationToken?: string | null;
313
320
  /** Resume the existing durable provider operation before any new create. */
314
321
  resumeExistingProviderOperation?: boolean;
322
+ /** Existing operation has durable delete intent; cleanup owns it. */
323
+ resumePendingDelete?: boolean;
315
324
  /** Scheduler-clock age of the operation being resumed. */
316
325
  existingProviderOperationAgeMs?: number;
317
326
  }
318
327
  | { kind: 'pre_code_deferred'; reason: SandboxPreCodeDeferralReason }
319
328
  >;
320
329
  releaseCapacity(input: { leaseId: string }): Promise<void>;
330
+ recordDaytonaCleanupIntent?(
331
+ intent: PlayRunnerDaytonaCleanupIntent,
332
+ ): Promise<void>;
321
333
  claimProviderCircuit(input: {
322
334
  provider: Exclude<SandboxProvider, 'local'>;
323
335
  }): Promise<{ allowed: boolean; probeToken: string | null }>;
@@ -249,6 +249,15 @@ function createExecutionLifecycle<Launch, Checkpoint, Suspension, RunnerResult>(
249
249
  await requireAdmission().reserveCapacity(value),
250
250
  releaseCapacity: async (value) =>
251
251
  await requireAdmission().releaseCapacity(value),
252
+ recordDaytonaCleanupIntent: async (intent) => {
253
+ const recorder = requireAdmission().recordDaytonaCleanupIntent;
254
+ if (!recorder) {
255
+ throw new Error(
256
+ 'Sandbox Runs admission has no Daytona cleanup-intent owner.',
257
+ );
258
+ }
259
+ await recorder(intent);
260
+ },
252
261
  claimProviderCircuit: async (value) =>
253
262
  await requireAdmission().claimProviderCircuit(value),
254
263
  markProviderHealthy: async (value) =>
@@ -188,6 +188,9 @@ function createRunnerCallbacks(input: {
188
188
  ...(outcome.resumeExistingProviderOperation === true
189
189
  ? { resumeExistingProviderOperation: true }
190
190
  : {}),
191
+ ...(outcome.resumePendingDelete === true
192
+ ? { resumePendingDelete: true }
193
+ : {}),
191
194
  ...(outcome.existingProviderOperationAgeMs === undefined
192
195
  ? {}
193
196
  : {
@@ -199,6 +202,13 @@ function createRunnerCallbacks(input: {
199
202
  releaseSandboxCapacity: async (leaseId) => {
200
203
  await input.lifecycle.releaseCapacity({ leaseId });
201
204
  },
205
+ ...(input.lifecycle.recordDaytonaCleanupIntent
206
+ ? {
207
+ recordDaytonaCleanupIntent: async (intent) => {
208
+ await input.lifecycle.recordDaytonaCleanupIntent?.(intent);
209
+ },
210
+ }
211
+ : {}),
202
212
  shouldAttemptSandboxProvider: async (provider) =>
203
213
  await input.lifecycle.claimProviderCircuit({ provider }),
204
214
  markSandboxProviderHealthy: async (provider, probeToken) => {
@@ -158,6 +158,10 @@ export type PlaySchedulerSubmitInput = RetainedPipelineCarrier & {
158
158
  * When omitted, legacy schedulers fall back to baseUrl.
159
159
  */
160
160
  runtimeApiBaseUrl?: string | null;
161
+ /** The pinned runtime API origin can retire durable array input on terminal delivery. */
162
+ arrayInputTerminalRetirementSupported?: boolean;
163
+ /** Immutable app build that owns terminal array-input retirement. */
164
+ arrayInputTerminalProjectionOrigin?: string | null;
161
165
  /**
162
166
  * Stable signing origin for executor JWTs. This is intentionally distinct
163
167
  * from runtimeApiBaseUrl: a staged Vercel deployment must receive the