deepline 0.3.461 → 0.3.463

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/tamradar.ts +17 -17
  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 +61 -0
  23. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-upstream-identity.ts +122 -2
  24. package/dist/bundling-sources/shared_libs/monitors/signal-radars/inbound-dead-letter.ts +11 -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 +38 -12
  111. package/dist/bundling-sources/shared_libs/play-runtime/tool-result.ts +33 -9
  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-6HJXNWUG.mjs → auth-LZLBR4C3.mjs} +5 -4
  130. package/dist/cli/auth-XPGKBJKB.js +41 -0
  131. package/dist/cli/{billing-6P5HO6QG.js → billing-6TJPNJQD.js} +152 -78
  132. package/dist/cli/{billing-MJ42N7YF.mjs → billing-OTOP5RE4.mjs} +84 -10
  133. package/dist/cli/{chunk-FCAZQ7WV.js → chunk-2NISBXMN.js} +52 -50
  134. package/dist/cli/{chunk-PNATXKLP.js → chunk-2ZIRCBYG.js} +6 -6
  135. package/dist/cli/{chunk-5FDKJQZE.js → chunk-3BOIOCNX.js} +1 -1
  136. package/dist/cli/chunk-3BVLLJ3H.mjs +1038 -0
  137. package/dist/cli/{chunk-FJZILBL7.mjs → chunk-3U5EAP6E.mjs} +5 -5
  138. package/dist/cli/{describe-FRAVCY5F.mjs → chunk-4YZKBBLZ.mjs} +19 -36
  139. package/dist/cli/{chunk-QWRHGGUH.js → chunk-5DRNNC72.js} +20 -2
  140. package/dist/cli/{chunk-Z2GUFYT6.js → chunk-5LEAXRHV.js} +11 -11
  141. package/dist/cli/{chunk-5MDIZX7M.js → chunk-5LHXOIPT.js} +8 -6
  142. package/dist/cli/{chunk-NMJ4D2WO.js → chunk-6PMCRYDA.js} +216 -91
  143. package/dist/cli/{chunk-EBU7LQ64.js → chunk-6V7KVRR5.js} +3 -3
  144. package/dist/cli/{chunk-MGXEUZHL.mjs → chunk-7D6X7IXW.mjs} +7 -5
  145. package/dist/cli/{chunk-SAZFZQRI.js → chunk-7FCYPAPP.js} +2 -2
  146. package/dist/cli/{chunk-ACCR7POB.js → chunk-7XYDDCQ2.js} +27 -27
  147. package/dist/cli/{chunk-5IYOUBFZ.js → chunk-ALZBANZI.js} +28 -54
  148. package/dist/cli/{chunk-3DNKFH2G.mjs → chunk-BAPTQDLF.mjs} +19 -1
  149. package/dist/cli/chunk-BGNWI3KH.js +827 -0
  150. package/dist/cli/{chunk-V7REJRDZ.mjs → chunk-C25QE4CH.mjs} +1 -1
  151. package/dist/cli/{chunk-FGMX4HUZ.js → chunk-CBZP6J3V.js} +29 -27
  152. package/dist/cli/{chunk-QEYHTIV4.mjs → chunk-CTQ56DXP.mjs} +10 -1
  153. package/dist/cli/{chunk-IHHLTHE7.mjs → chunk-CVQ7N5CV.mjs} +267 -38
  154. package/dist/cli/{chunk-7DH2FD7Y.mjs → chunk-D464JW3N.mjs} +5 -85
  155. package/dist/cli/{chunk-MEAIOXJL.mjs → chunk-DHXCBITQ.mjs} +7 -5
  156. package/dist/cli/chunk-F2RHUPVH.mjs +827 -0
  157. package/dist/cli/chunk-F6QV42MC.mjs +91 -0
  158. package/dist/cli/{chunk-OZBWRICM.js → chunk-FK2HNDCN.js} +2 -2
  159. package/dist/cli/{chunk-BGY2PLP7.mjs → chunk-GUT7CLOL.mjs} +23 -49
  160. package/dist/cli/{chunk-RY4IVOU3.mjs → chunk-I624J4H5.mjs} +16 -806
  161. package/dist/cli/{chunk-Z2XUZC34.js → chunk-IAYSWZDJ.js} +188 -76
  162. package/dist/cli/{chunk-FGLKOWSC.mjs → chunk-IKWRUNAP.mjs} +1 -1
  163. package/dist/cli/{chunk-KCCOQ5G5.js → chunk-JVDKZJUH.js} +511 -282
  164. package/dist/cli/{chunk-HDFRJ4IT.mjs → chunk-JVHOS3K3.mjs} +177 -65
  165. package/dist/cli/chunk-LYFKBLJI.mjs +1039 -0
  166. package/dist/cli/{chunk-SLEUWLJE.mjs → chunk-MSY22NQW.mjs} +5 -5
  167. package/dist/cli/{chunk-5FY72YOV.js → chunk-NAPTMYTY.js} +8 -8
  168. package/dist/cli/{chunk-O6QOMHCH.js → chunk-NDHJR2WZ.js} +37 -35
  169. package/dist/cli/{chunk-KXMNM4AQ.js → chunk-NMU3VR5U.js} +4 -5
  170. package/dist/cli/chunk-NTLI6P6Y.mjs +19 -0
  171. package/dist/cli/{chunk-RFONC4WJ.mjs → chunk-O3BJYD6D.mjs} +3 -3
  172. package/dist/cli/{describe-2WQY7ZCY.js → chunk-PVY4DPPF.js} +27 -44
  173. package/dist/cli/{chunk-WIYWSYDS.mjs → chunk-Q2EIZKVX.mjs} +3 -3
  174. package/dist/cli/{chunk-VZBCEA5S.mjs → chunk-RD6IQ2JY.mjs} +223 -92
  175. package/dist/cli/chunk-RGOUCIIZ.js +1039 -0
  176. package/dist/cli/{chunk-EIMG75BT.mjs → chunk-S3A4IXBQ.mjs} +4 -5
  177. package/dist/cli/{chunk-QIW7TVV6.mjs → chunk-S4XQCFES.mjs} +14 -12
  178. package/dist/cli/chunk-SKU6ECIY.js +19 -0
  179. package/dist/cli/{chunk-CRYOUPEB.js → chunk-TIRBDQ3W.js} +16 -16
  180. package/dist/cli/{chunk-G7L27KZB.mjs → chunk-TKAQR3IB.mjs} +31 -21
  181. package/dist/cli/{chunk-MDJPEGVN.js → chunk-UC4SFYNU.js} +392 -261
  182. package/dist/cli/{chunk-3BMLICF7.mjs → chunk-UIURR26V.mjs} +13 -8
  183. package/dist/cli/{chunk-TNMBPMMC.js → chunk-UROQDCVW.js} +13 -4
  184. package/dist/cli/{chunk-R64BGGRQ.mjs → chunk-VDGTTH7K.mjs} +2 -2
  185. package/dist/cli/chunk-VLEVVDWG.js +91 -0
  186. package/dist/cli/{chunk-R2GLGLDR.mjs → chunk-VPHN2HAL.mjs} +216 -91
  187. package/dist/cli/chunk-VY2GBNTX.js +1038 -0
  188. package/dist/cli/{chunk-CFUTOWE4.js → chunk-WG3KGAII.js} +8 -88
  189. package/dist/cli/{chunk-QAJAJPKK.mjs → chunk-WUMIYOXQ.mjs} +4 -2
  190. package/dist/cli/{chunk-SCIR5JXW.js → chunk-WUZS2HK6.js} +56 -51
  191. package/dist/cli/{chunk-T3MVIPHG.mjs → chunk-XDWS2JJT.mjs} +1 -1
  192. package/dist/cli/{chunk-KGQNIA37.js → chunk-XQCTG5OO.js} +44 -34
  193. package/dist/cli/{chunk-KVJ5VHW5.mjs → chunk-XW2JIYG7.mjs} +2 -2
  194. package/dist/cli/chunk-YGGIZ3VT.js +920 -0
  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-NX7NO3O6.js → csv-EH5QWR4O.js} +13 -12
  200. package/dist/cli/{csv-DQ6GW5B5.mjs → csv-OK45Z5XQ.mjs} +4 -3
  201. package/dist/cli/{db-R72DFMP6.js → db-3ESJKETS.js} +30 -27
  202. package/dist/cli/{db-2YP33M4K.mjs → db-6Z5E4HKN.mjs} +10 -7
  203. package/dist/cli/describe-PNDQB7YS.mjs +48 -0
  204. package/dist/cli/describe-QUF7VTTR.js +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-WFBU7L2Q.mjs → executions-2NTWQFEG.mjs} +7 -5
  210. package/dist/cli/{executions-ZLHD4QIT.js → executions-KUOBRX5V.js} +9 -7
  211. package/dist/cli/{feedback-CN3HJFVF.mjs → feedback-7RPRMSGY.mjs} +6 -5
  212. package/dist/cli/{feedback-NDV6TPHG.js → feedback-UPHAZJ4C.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-QAD6E3HW.mjs → git-SCYP6WSZ.mjs} +5 -4
  218. package/dist/cli/git-UH653WHV.js +25 -0
  219. package/dist/cli/index.js +152 -142
  220. package/dist/cli/index.mjs +56 -46
  221. package/dist/cli/{legacy-noops-KVC5QJ74.js → legacy-noops-7XMFCVRG.js} +8 -7
  222. package/dist/cli/{legacy-noops-TPTKNBI2.mjs → legacy-noops-A4KYAGI6.mjs} +5 -4
  223. package/dist/cli/{monitors-SV57JFLO.mjs → monitors-FLC5J7RI.mjs} +19 -6
  224. package/dist/cli/{monitors-KCROV6PJ.js → monitors-NZV6IX5H.js} +103 -90
  225. package/dist/cli/{org-NJYX5743.js → org-IZ7UP3XF.js} +70 -67
  226. package/dist/cli/{org-KX6QIR7A.mjs → org-LUETJ7Z5.mjs} +9 -6
  227. package/dist/cli/pages-22ML3O7O.js +252 -0
  228. package/dist/cli/pages-EUX5EAGF.mjs +252 -0
  229. package/dist/cli/{play-IQQ57L7Z.mjs → play-CDHPAKKM.mjs} +512 -1508
  230. package/dist/cli/{play-32L7EQN4.js → play-USJBQADG.js} +1090 -2086
  231. package/dist/cli/{providers-4WEC2EQN.mjs → providers-CCXZ3SQF.mjs} +7 -5
  232. package/dist/cli/{providers-ZQV6QLVQ.js → providers-WFEUNPGC.js} +10 -8
  233. package/dist/cli/{quickstart-HKUSFADF.js → quickstart-O4JSUORZ.js} +13 -12
  234. package/dist/cli/{quickstart-RQ76RIUE.mjs → quickstart-ZUULI635.mjs} +5 -4
  235. package/dist/cli/run-ISDJYJMU.js +443 -0
  236. package/dist/cli/run-QJ4NX5F5.mjs +443 -0
  237. package/dist/cli/{search-ZRAVFBZC.mjs → search-IX3XKZJ3.mjs} +8 -6
  238. package/dist/cli/search-TIFNLRPM.js +32 -0
  239. package/dist/cli/{secrets-CMJOVNVH.mjs → secrets-7VUDXTUZ.mjs} +7 -5
  240. package/dist/cli/{secrets-J3G5Y43U.js → secrets-ELQSNCTR.js} +16 -14
  241. package/dist/cli/{sessions-WY7VN4AE.js → sessions-A3FG3AZX.js} +6 -5
  242. package/dist/cli/{sessions-MDQYY5CB.mjs → sessions-VOIQ62GB.mjs} +5 -4
  243. package/dist/cli/{settings-4RWZPCT5.mjs → settings-S6N6EFBG.mjs} +14 -11
  244. package/dist/cli/{settings-HTNTFKCE.js → settings-ZTXQEMZI.js} +80 -77
  245. package/dist/cli/{setup-P3GYYZWG.mjs → setup-AYPIK4JE.mjs} +12 -10
  246. package/dist/cli/{setup-QGCAP62X.js → setup-Y3WOIFLS.js} +53 -51
  247. package/dist/cli/{skills-7NAE4ICL.mjs → skills-5SF5QWNI.mjs} +7 -6
  248. package/dist/cli/skills-MWFRMG3H.js +31 -0
  249. package/dist/cli/tools-3XNZ4J64.mjs +55 -0
  250. package/dist/cli/tools-XEC4OD3R.js +55 -0
  251. package/dist/cli/{update-GODLRKNB.mjs → update-3U4OVX5R.mjs} +9 -8
  252. package/dist/cli/update-DWYEYTZE.js +33 -0
  253. package/dist/cli/{workflow-4BXOUVEO.mjs → workflow-2M5JP7SA.mjs} +10 -8
  254. package/dist/cli/{workflow-AO3A6LXN.js → workflow-RM7H7555.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.ts → compiler-manifest-Dcyd3-Zd.d.mts} +43 -1
  260. package/dist/{compiler-manifest-CWz_sNOQ.d.mts → 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 +16 -12
  268. package/dist/index.mjs +15 -11
  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-IACERYQH.js +0 -40
  289. package/dist/cli/chunk-PQUUWFXY.js +0 -95
  290. package/dist/cli/chunk-YBWAG72P.mjs +0 -95
  291. package/dist/cli/chunk-YQDUODZW.js +0 -1710
  292. package/dist/cli/git-JVI36ZFV.js +0 -24
  293. package/dist/cli/search-75X5LTDE.js +0 -30
  294. package/dist/cli/skills-BKJ53JOQ.js +0 -30
  295. package/dist/cli/tools-COWMIEJ6.mjs +0 -45
  296. package/dist/cli/tools-TASOCE7I.js +0 -45
  297. package/dist/cli/update-SJIKVME6.js +0 -32
@@ -1,3 +1,4 @@
1
+ import { AsyncLocalStorage } from 'node:async_hooks';
1
2
  import type { ModalClient } from 'modal';
2
3
  import { isIsolatedRuntimeSchedulerSchema } from './runtime-scheduler-topology';
3
4
  import {
@@ -84,15 +85,89 @@ export async function loadModalRequiredConfig(input: {
84
85
  };
85
86
  }
86
87
 
88
+ type ModalGrpcMiddleware = NonNullable<
89
+ NonNullable<ConstructorParameters<typeof ModalClient>[0]>['grpcMiddleware']
90
+ >[number];
91
+
92
+ const modalCallSignal = new AsyncLocalStorage<AbortSignal>();
93
+
94
+ /**
95
+ * Cancel every Modal control-plane call `fn` makes once `signal` aborts. A
96
+ * deadline that only stops waiting leaves the call open, so a stuck provider
97
+ * would pile up unanswered reads behind it.
98
+ */
99
+ export function withModalCallSignal<T>(
100
+ signal: AbortSignal,
101
+ fn: () => Promise<T>,
102
+ ): Promise<T> {
103
+ return modalCallSignal.run(signal, fn);
104
+ }
105
+
106
+ // Modal runs custom middleware outside its own retry loop, so the signal also
107
+ // ends a retry or throttle wait.
108
+ const cancelModalCallsWithScopedSignal: ModalGrpcMiddleware =
109
+ async function* (call, options) {
110
+ const signal = modalCallSignal.getStore();
111
+ // Every caller shares one auth token refresh, so one read's deadline must
112
+ // not cancel it.
113
+ if (
114
+ !signal ||
115
+ call.method.path === '/modal.client.ModalClient/AuthTokenGet'
116
+ ) {
117
+ return yield* call.next(call.request, options);
118
+ }
119
+ return yield* call.next(call.request, {
120
+ ...options,
121
+ signal: options.signal
122
+ ? AbortSignal.any([options.signal, signal])
123
+ : signal,
124
+ });
125
+ };
126
+
127
+ let sharedModalClient: {
128
+ tokenId: string;
129
+ tokenSecret: string;
130
+ client: Promise<ModalClient>;
131
+ } | null = null;
132
+
133
+ /**
134
+ * Each `ModalClient` opens its own gRPC channel and nothing here closes one, so
135
+ * a client per call grows a long-lived process with every Modal read.
136
+ */
137
+ function modalClientForTokens(
138
+ tokenId: string,
139
+ tokenSecret: string,
140
+ ): Promise<ModalClient> {
141
+ if (
142
+ sharedModalClient?.tokenId === tokenId &&
143
+ sharedModalClient.tokenSecret === tokenSecret
144
+ ) {
145
+ return sharedModalClient.client;
146
+ }
147
+ const client = import('modal').then(
148
+ ({ ModalClient }) =>
149
+ new ModalClient({
150
+ tokenId,
151
+ tokenSecret,
152
+ grpcMiddleware: [cancelModalCallsWithScopedSignal],
153
+ }),
154
+ );
155
+ const entry = { tokenId, tokenSecret, client };
156
+ sharedModalClient = entry;
157
+ client.catch(() => {
158
+ if (sharedModalClient === entry) sharedModalClient = null;
159
+ });
160
+ return client;
161
+ }
162
+
87
163
  export async function loadModalClientConfig(
88
164
  input: { env?: NodeJS.ProcessEnv } = {},
89
165
  ): Promise<ModalClientConfig> {
90
166
  const env = input.env ?? process.env;
91
167
  const tokenId = requiredEnv(env, 'MODAL_TOKEN_ID');
92
168
  const tokenSecret = requiredEnv(env, 'MODAL_TOKEN_SECRET');
93
- const { ModalClient } = await import('modal');
94
169
  return {
95
- client: new ModalClient({ tokenId, tokenSecret }),
170
+ client: await modalClientForTokens(tokenId, tokenSecret),
96
171
  appName:
97
172
  env.DEEPLINE_MODAL_RUNNER_APP_NAME?.trim() || MODAL_RUNNER_APP_NAME,
98
173
  image: env.DEEPLINE_MODAL_RUNNER_IMAGE?.trim() || MODAL_RUNNER_IMAGE,
@@ -31,7 +31,7 @@ export const LEDGER_TERMINAL_RESULT_MAX_DEPTH = 10;
31
31
  export const CONVEX_LEDGER_ARRAY_MAX_ITEMS = 8_192;
32
32
  export const CONVEX_LEDGER_OBJECT_MAX_FIELDS = 1_024;
33
33
  export const CONVEX_LEDGER_FIELD_NAME_MAX_LENGTH = 1_024;
34
- /** Customer-visible values and complete authored returns share one 5 MiB cap. */
34
+ /** Customer-visible values and retained authored returns share one 5 MiB cap. */
35
35
  export const CUSTOMER_OUTPUT_VALUE_MAX_BYTES = 5 * 1024 * 1024;
36
36
  export const CUSTOMER_OUTPUT_TOTAL_MAX_BYTES = 5 * 1024 * 1024;
37
37
  /** Inline Postgres receipt contract: one serialized output is at most 10 MiB. */
@@ -58,6 +58,12 @@ export const RUNTIME_RECEIPT_CONTROL_BUFFER_MAX_ITEMS = 2_000;
58
58
  * is required to resume execution.
59
59
  */
60
60
  export const RUNNER_TERMINAL_PUSH_MAX_BODY_BYTES = 16 * 1024 * 1024;
61
+ /**
62
+ * Oversized sheet admissions use bounded requests with room for returned row
63
+ * metadata. A single row may exceed this target, up to the unchanged gateway
64
+ * body ceiling; the target is never a new customer input-value limit.
65
+ */
66
+ export const RUNTIME_SHEET_START_TARGET_BODY_BYTES = 12 * 1024 * 1024;
61
67
  /**
62
68
  * Receipt commands are measured before the runtime client adds its request
63
69
  * envelope. Keep a full 4 MiB below the gateway body ceiling so one legal
@@ -459,7 +465,7 @@ export const RUN_LIST_OUTPUT_PREVIEW_LIMITS = {
459
465
  maxFields: 40,
460
466
  // The list endpoint returns multiple historical runs in one polling page.
461
467
  // Reserve enough room for run state and legacy rows by keeping each preview
462
- // at 4 KiB; the complete authored result remains separately readable up to
468
+ // at 4 KiB; the retained authored result remains separately readable up to
463
469
  // the 5 MiB customer-output ceiling.
464
470
  maxBytes: 4_000,
465
471
  maxDepth: 4,
@@ -1436,6 +1442,269 @@ export function assertCustomerPlayReturnWithinLimit(input: {
1436
1442
  });
1437
1443
  }
1438
1444
 
1445
+ const JSON_OUTPUT_TRUNCATION_SUFFIX = '…[truncated]';
1446
+ const OMIT_JSON_OUTPUT_VALUE = Symbol('OMIT_JSON_OUTPUT_VALUE');
1447
+
1448
+ type JsonOutputProjection = {
1449
+ value: unknown;
1450
+ bytes: number;
1451
+ truncated: boolean;
1452
+ };
1453
+
1454
+ function jsonStringCharacterBytes(value: string, index: number) {
1455
+ const code = value.charCodeAt(index);
1456
+ if (code === 0x22 || code === 0x5c) return { bytes: 2, width: 1 };
1457
+ if (code <= 0x1f) {
1458
+ return {
1459
+ bytes:
1460
+ code === 0x08 ||
1461
+ code === 0x09 ||
1462
+ code === 0x0a ||
1463
+ code === 0x0c ||
1464
+ code === 0x0d
1465
+ ? 2
1466
+ : 6,
1467
+ width: 1,
1468
+ };
1469
+ }
1470
+ if (code >= 0xd800 && code <= 0xdbff) {
1471
+ const next = value.charCodeAt(index + 1);
1472
+ return next >= 0xdc00 && next <= 0xdfff
1473
+ ? { bytes: 4, width: 2 }
1474
+ : { bytes: 6, width: 1 };
1475
+ }
1476
+ if (code >= 0xdc00 && code <= 0xdfff) return { bytes: 6, width: 1 };
1477
+ if (code <= 0x7f) return { bytes: 1, width: 1 };
1478
+ if (code <= 0x7ff) return { bytes: 2, width: 1 };
1479
+ return { bytes: 3, width: 1 };
1480
+ }
1481
+
1482
+ function truncateJsonStringToByteLimit(
1483
+ value: string,
1484
+ limitBytes: number,
1485
+ ): JsonOutputProjection | null {
1486
+ if (limitBytes < 2) return null;
1487
+ const suffixBytes = jsonStringByteLength(JSON_OUTPUT_TRUNCATION_SUFFIX) - 2;
1488
+ const prefixLimitBytes = limitBytes - 2 - suffixBytes;
1489
+ if (prefixLimitBytes < 0) {
1490
+ return { value: '', bytes: 2, truncated: true };
1491
+ }
1492
+
1493
+ let prefixBytes = 0;
1494
+ let prefixEnd = 0;
1495
+ while (prefixEnd < value.length) {
1496
+ const next = jsonStringCharacterBytes(value, prefixEnd);
1497
+ if (prefixBytes + next.bytes > prefixLimitBytes) break;
1498
+ prefixBytes += next.bytes;
1499
+ prefixEnd += next.width;
1500
+ }
1501
+
1502
+ const projected = `${value.slice(0, prefixEnd)}${JSON_OUTPUT_TRUNCATION_SUFFIX}`;
1503
+ return {
1504
+ value: projected,
1505
+ bytes: jsonStringByteLength(projected),
1506
+ truncated: true,
1507
+ };
1508
+ }
1509
+
1510
+ function projectJsonValueWithinByteLimit(
1511
+ value: unknown,
1512
+ limitBytes: number,
1513
+ key: string,
1514
+ inArray: boolean,
1515
+ toJsonAlreadyApplied = false,
1516
+ ): JsonOutputProjection | null {
1517
+ let normalized = value;
1518
+ if (
1519
+ !toJsonAlreadyApplied &&
1520
+ normalized !== null &&
1521
+ typeof normalized === 'object' &&
1522
+ typeof (normalized as { toJSON?: unknown }).toJSON === 'function'
1523
+ ) {
1524
+ normalized = (normalized as { toJSON: (key: string) => unknown }).toJSON(
1525
+ key,
1526
+ );
1527
+ return projectJsonValueWithinByteLimit(
1528
+ normalized,
1529
+ limitBytes,
1530
+ key,
1531
+ inArray,
1532
+ true,
1533
+ );
1534
+ }
1535
+
1536
+ if (
1537
+ normalized === undefined ||
1538
+ typeof normalized === 'function' ||
1539
+ typeof normalized === 'symbol'
1540
+ ) {
1541
+ return inArray
1542
+ ? { value: null, bytes: 4, truncated: false }
1543
+ : { value: OMIT_JSON_OUTPUT_VALUE, bytes: 0, truncated: false };
1544
+ }
1545
+
1546
+ let measurement: BoundedJsonByteLength;
1547
+ try {
1548
+ measurement = jsonByteLengthUpTo(normalized, limitBytes);
1549
+ } catch (error) {
1550
+ throw new Error(
1551
+ `play return cannot be serialized as JSON: ${error instanceof Error ? error.message : String(error)}`,
1552
+ );
1553
+ }
1554
+ if (!measurement.exceeded) {
1555
+ return {
1556
+ value: normalized,
1557
+ bytes: measurement.bytes,
1558
+ truncated: false,
1559
+ };
1560
+ }
1561
+
1562
+ if (typeof normalized === 'string') {
1563
+ return truncateJsonStringToByteLimit(normalized, limitBytes);
1564
+ }
1565
+
1566
+ if (Array.isArray(normalized)) {
1567
+ if (limitBytes < 2) return null;
1568
+ const values: unknown[] = [];
1569
+ let bytes = 2;
1570
+ let truncated = false;
1571
+ for (let index = 0; index < normalized.length; index += 1) {
1572
+ const separatorBytes = values.length > 0 ? 1 : 0;
1573
+ const childLimitBytes = limitBytes - bytes - separatorBytes;
1574
+ if (childLimitBytes < 1) {
1575
+ truncated = true;
1576
+ break;
1577
+ }
1578
+ const child = projectJsonValueWithinByteLimit(
1579
+ normalized[index],
1580
+ childLimitBytes,
1581
+ String(index),
1582
+ true,
1583
+ );
1584
+ if (!child || child.value === OMIT_JSON_OUTPUT_VALUE) {
1585
+ truncated = true;
1586
+ break;
1587
+ }
1588
+ values.push(child.value);
1589
+ bytes += separatorBytes + child.bytes;
1590
+ if (child.truncated) {
1591
+ truncated = true;
1592
+ break;
1593
+ }
1594
+ }
1595
+ return {
1596
+ value: values,
1597
+ bytes,
1598
+ truncated: truncated || values.length < normalized.length,
1599
+ };
1600
+ }
1601
+
1602
+ if (normalized !== null && typeof normalized === 'object') {
1603
+ if (limitBytes < 2) return null;
1604
+ const output = Object.create(null) as Record<string, unknown>;
1605
+ const entries = Object.keys(normalized);
1606
+ let bytes = 2;
1607
+ let fields = 0;
1608
+ let truncated = false;
1609
+ for (const childKey of entries) {
1610
+ const childValue = (normalized as Record<string, unknown>)[childKey];
1611
+ if (
1612
+ childValue === undefined ||
1613
+ typeof childValue === 'function' ||
1614
+ typeof childValue === 'symbol'
1615
+ ) {
1616
+ continue;
1617
+ }
1618
+ const keyBytes = jsonStringByteLength(childKey) + 1;
1619
+ const separatorBytes = fields > 0 ? 1 : 0;
1620
+ const childLimitBytes = limitBytes - bytes - separatorBytes - keyBytes;
1621
+ if (childLimitBytes < 1) {
1622
+ truncated = true;
1623
+ break;
1624
+ }
1625
+ const child = projectJsonValueWithinByteLimit(
1626
+ childValue,
1627
+ childLimitBytes,
1628
+ childKey,
1629
+ false,
1630
+ );
1631
+ if (!child || child.value === OMIT_JSON_OUTPUT_VALUE) {
1632
+ truncated = true;
1633
+ break;
1634
+ }
1635
+ output[childKey] = child.value;
1636
+ bytes += separatorBytes + keyBytes + child.bytes;
1637
+ fields += 1;
1638
+ if (child.truncated) {
1639
+ truncated = true;
1640
+ break;
1641
+ }
1642
+ }
1643
+ return {
1644
+ value: output,
1645
+ bytes,
1646
+ truncated: truncated || fields < entries.length,
1647
+ };
1648
+ }
1649
+
1650
+ return null;
1651
+ }
1652
+
1653
+ export function truncateCustomerPlayReturnWithinLimit(input: {
1654
+ value: Record<string, unknown>;
1655
+ path?: string;
1656
+ totalLimitBytes?: number;
1657
+ }): {
1658
+ value: Record<string, unknown>;
1659
+ truncated: boolean;
1660
+ originalBytesAtLeast: number;
1661
+ retainedBytes: number;
1662
+ limitBytes: number;
1663
+ } {
1664
+ const path = input.path ?? 'play return';
1665
+ const limitBytes = input.totalLimitBytes ?? CUSTOMER_OUTPUT_TOTAL_MAX_BYTES;
1666
+ let measurement: BoundedJsonByteLength;
1667
+ try {
1668
+ measurement = jsonByteLengthUpTo(input.value, limitBytes);
1669
+ } catch (error) {
1670
+ throw new Error(
1671
+ `${path} cannot be serialized as JSON: ${error instanceof Error ? error.message : String(error)}`,
1672
+ );
1673
+ }
1674
+ if (!measurement.exceeded) {
1675
+ return {
1676
+ value: input.value,
1677
+ truncated: false,
1678
+ originalBytesAtLeast: measurement.bytes,
1679
+ retainedBytes: measurement.bytes,
1680
+ limitBytes,
1681
+ };
1682
+ }
1683
+
1684
+ const projection = projectJsonValueWithinByteLimit(
1685
+ input.value,
1686
+ limitBytes,
1687
+ '',
1688
+ false,
1689
+ );
1690
+ if (
1691
+ !projection ||
1692
+ projection.value === OMIT_JSON_OUTPUT_VALUE ||
1693
+ !projection.value ||
1694
+ typeof projection.value !== 'object' ||
1695
+ Array.isArray(projection.value)
1696
+ ) {
1697
+ throw new Error(`${path} could not be truncated to valid JSON output.`);
1698
+ }
1699
+ return {
1700
+ value: projection.value as Record<string, unknown>,
1701
+ truncated: true,
1702
+ originalBytesAtLeast: measurement.bytes,
1703
+ retainedBytes: projection.bytes,
1704
+ limitBytes,
1705
+ };
1706
+ }
1707
+
1439
1708
  const RUNTIME_RECEIPT_OUTPUT_SIZE_ADVICE =
1440
1709
  'This receipt result is too large for durable call caching. This usually means raw search results, HTML, or a large list is being cached as one cell. Parse it before returning it from the tool boundary.';
1441
1710
 
@@ -1,3 +1,4 @@
1
+ import { boundedProviderTextForLog } from './provider-text-for-log';
1
2
  import { RUNTIME_RELIABILITY_POLICY } from './runtime-reliability-policy';
2
3
 
3
4
  /**
@@ -45,6 +46,7 @@ export type PlayRunRecoveryReason =
45
46
  | 'daytona_sandbox_acquisition_unavailable_before_execution'
46
47
  | 'runtime_scheduler_unavailable_before_execution'
47
48
  | 'runtime_initialization_transport_before_execution'
49
+ | 'runner_startup_not_live_before_execution'
48
50
  | 'runtime_traffic_hold_before_execution'
49
51
  | 'runtime_traffic_throttled_before_execution';
50
52
 
@@ -145,6 +147,29 @@ export function playRunRecoveryLogDetail(
145
147
  }
146
148
  }
147
149
 
150
+ /**
151
+ * The provider's own words from the cause of a recovery error, for the same
152
+ * defer log and under the same rules as the detail above. One reason covers a
153
+ * spend limit and a busy provider, and only this text tells them apart. gRPC
154
+ * `details` wins because `message` spends the bound on the RPC path first.
155
+ */
156
+ export function playRunRecoveryProviderText(error: unknown): string | null {
157
+ try {
158
+ if (!isPlayRunRecoveryError(error)) return null;
159
+ const cause: unknown = error.cause;
160
+ if (!cause || typeof cause !== 'object') return null;
161
+ const { details, message } = cause as {
162
+ details?: unknown;
163
+ message?: unknown;
164
+ };
165
+ return (
166
+ boundedProviderTextForLog(details) ?? boundedProviderTextForLog(message)
167
+ );
168
+ } catch {
169
+ return null;
170
+ }
171
+ }
172
+
148
173
  function errorCode(error: unknown): string | number | null {
149
174
  if (!error || typeof error !== 'object') return null;
150
175
  const code = (error as { code?: unknown }).code;
@@ -369,6 +394,32 @@ export function recoveryForModalRunnerStartupFailure(
369
394
  });
370
395
  }
371
396
 
397
+ /**
398
+ * No sandbox this attempt started got a live runner: the runner never reached
399
+ * the sandbox, because its upload or command failed, or it never reached the
400
+ * gateway. The worker never parked a runner, so none could release customer
401
+ * code, and the attempt fence rejects any runner left behind. The fault can
402
+ * outlast an attempt's own starts, so it waits on the durable defer ladder
403
+ * rather than failing the run. It names no provider: a bad host or the
404
+ * sandbox's network is not a provider account fault, so it must not open a
405
+ * provider circuit.
406
+ */
407
+ export function recoveryForRunnerStartupNotLive(
408
+ error: unknown,
409
+ ): PlayRunRecoveryError {
410
+ return new PlayRunRecoveryError({
411
+ decision: {
412
+ stage: 'pre_code',
413
+ action: 'defer',
414
+ reason: 'runner_startup_not_live_before_execution',
415
+ dependency: 'runtime',
416
+ },
417
+ message:
418
+ 'The sandbox runner did not start before customer execution began.',
419
+ cause: error,
420
+ });
421
+ }
422
+
372
423
  /**
373
424
  * A runner transport classifier has already proved that the result has no
374
425
  * customer rows or steps. Keep its engine retry typed so an ordinary failed
@@ -17,6 +17,8 @@ export type SandboxCleanupResource = {
17
17
  export type SandboxCleanupDeleteOutcome =
18
18
  | { kind: 'deleted'; routingDomain: string | null }
19
19
  | { kind: 'already_absent'; routingDomain: string | null }
20
+ /** Nothing failed, but the provider has not yet shown the resource is gone. */
21
+ | { kind: 'pending'; code: string; detail: string }
20
22
  /** The provider outcome is ambiguous or failed; its resource remains live. */
21
23
  | { kind: 'failed'; code: string; detail: string };
22
24
 
@@ -37,6 +37,14 @@ export function createSandboxCleanupJob(
37
37
 
38
38
  try {
39
39
  const deletion = await ports.deletion.delete(input);
40
+ if (deletion.kind === 'pending') {
41
+ return await scheduleRetry(
42
+ ports,
43
+ input,
44
+ deletion.detail,
45
+ confirmationReadDelay(input.resource.failureCount + 1),
46
+ );
47
+ }
40
48
  if (deletion.kind === 'failed') {
41
49
  if (deletion.code === 'missing_routing_domain') {
42
50
  const reason = `missing_routing_domain: ${deletion.detail}`.slice(
@@ -120,8 +128,8 @@ async function scheduleRetry(
120
128
  ports: SandboxCleanupPorts,
121
129
  input: SandboxCleanupInput,
122
130
  error: string,
131
+ retryAfterMs = retryDelay(input.resource.failureCount + 1),
123
132
  ): Promise<SandboxCleanupOutcome> {
124
- const retryAfterMs = retryDelay(input.resource.failureCount + 1);
125
133
  const scheduled = await ports.store.retry({
126
134
  resource: input.resource,
127
135
  error,
@@ -139,6 +147,24 @@ function retryDelay(nextFailureCount: number): number {
139
147
  );
140
148
  }
141
149
 
150
+ /**
151
+ * Janitor sightings put Daytona's record about 3 seconds behind an accepted
152
+ * delete on Oct 31 (115 sightings of 10,785 deletes, 5-minute passes). Reading
153
+ * at 5 seconds usually needs one read, so a cleanup costs three control
154
+ * requests. At 500,000 cleanups a month that is under 1 request per second, and
155
+ * the 4/s dense-load peak stays near 12/s, against a budget of 25/s. Doubling
156
+ * to 5 minutes leaves a stuck sandbox costing one read per interval.
157
+ */
158
+ const CONFIRMATION_READ_DELAY_MS = 5_000;
159
+
160
+ function confirmationReadDelay(nextFailureCount: number): number {
161
+ return Math.min(
162
+ 5 * 60_000,
163
+ CONFIRMATION_READ_DELAY_MS *
164
+ 2 ** Math.min(6, Math.max(0, nextFailureCount - 1)),
165
+ );
166
+ }
167
+
142
168
  function validate(input: SandboxCleanupInput): void {
143
169
  const { resource } = input;
144
170
  if (!resource.sandboxId.trim() || !resource.runId.trim()) {
@@ -2,6 +2,7 @@ import { bouncebanBatchStrategies } from './/bounceban-batching';
2
2
  import type { AnyBatchOperationStrategy } from './batching-types';
3
3
  import { bettercontactBatchStrategies } from './bettercontact-batching';
4
4
  import { DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES } from './default-batch-strategies';
5
+ import { freeCompanyLookupBatchStrategies } from './free-company-lookup-batching';
5
6
  import { fullenrichBatchStrategies } from './fullenrich-batching';
6
7
  import { opensosdataBatchStrategies } from './opensosdata-batching';
7
8
  import { zerobounceBatchStrategies } from './zerobounce-batching';
@@ -15,6 +16,7 @@ export const PLAY_RUNTIME_BATCH_OPERATION_REGISTRY: Record<
15
16
  ...DEFAULT_PLAY_RUNTIME_BATCH_STRATEGIES,
16
17
  ...bettercontactBatchStrategies,
17
18
  ...bouncebanBatchStrategies,
19
+ ...freeCompanyLookupBatchStrategies,
18
20
  ...fullenrichBatchStrategies,
19
21
  ...opensosdataBatchStrategies,
20
22
  ...testAsyncBatchStrategies,
@@ -312,6 +312,9 @@ export interface RunnerPushExecutionConfig {
312
312
  /** The provider that acquired this sandbox, which a Daytona-selected launch
313
313
  * can differ from after fallback. Absent from older workers. */
314
314
  sandboxProvider?: 'daytona' | 'modal';
315
+ /** Test drill only: how long the sandbox watchdog withholds heartbeats once
316
+ * customer code starts. Absent from every ordinary launch. */
317
+ heartbeatSilenceMs?: number;
315
318
  }
316
319
 
317
320
  export interface PlayRunnerExecutionConfig {
@@ -0,0 +1,63 @@
1
+ const LOGGED_PROVIDER_TEXT_MAX_CHARS = 160;
2
+
3
+ /**
4
+ * Credential redaction for a provider control-plane error message. Shared by
5
+ * lookup-failure descriptions and the provider text below.
6
+ */
7
+ export function redactProviderErrorDetail(value: string): string {
8
+ return value
9
+ .replace(
10
+ /authorization\s*[=:]\s*bearer\s+[^\s,;]+/gi,
11
+ 'Authorization=Bearer [redacted]',
12
+ )
13
+ .replace(
14
+ /(authorization\s*[=:]\s*)(?!bearer\s+\[redacted\])[^\s,;]+/gi,
15
+ '$1[redacted]',
16
+ )
17
+ .replace(/(bearer\s+)[^\s,;]+/gi, '$1[redacted]')
18
+ .replace(/((?:api[_-]?key|token)\s*[=:]\s*)[^\s,;]+/gi, '$1[redacted]')
19
+ .replace(/\s+/g, ' ')
20
+ .trim()
21
+ .slice(0, 1_000);
22
+ }
23
+
24
+ /**
25
+ * Provider free text (for example a sandbox `errorReason`) for logs. This
26
+ * field is written by the provider, so it is redacted more strictly than the
27
+ * shared function alone: URL userinfo, any authorization scheme, password,
28
+ * secret, token, signature, credential and key pairs in query, header or JSON
29
+ * form, email addresses, and opaque identifiers such as organization ids. It
30
+ * is then cut to one short fixed bound so an upstream response is never
31
+ * copied wholesale.
32
+ */
33
+ export function boundedProviderTextForLog(value: unknown): string | null {
34
+ if (typeof value !== 'string') return null;
35
+ const strict = value
36
+ .replace(/(\b[a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi, '$1[redacted]@')
37
+ .replace(
38
+ /(authorization\s*[=:]\s*["']?)(?:[a-z]+\s+)?[^\s,;"']+/gi,
39
+ '$1[redacted]',
40
+ )
41
+ .replace(/\b(basic|bearer)\s+[A-Za-z0-9+/=._~-]{8,}/gi, '$1 [redacted]')
42
+ .replace(
43
+ /(["']?[\w.-]*(?:password|passwd|secret|token|signature|credential|api[_-]?key|access[_-]?key)[\w.-]*["']?\s*[=:]\s*)(?:"[^"]*"|'[^']*'|[^\s&,;"'}\]]+)/gi,
44
+ '$1[redacted]',
45
+ )
46
+ .replace(
47
+ /[A-Za-z0-9._%+-]+@[A-Za-z0-9-]+(?:\.[A-Za-z0-9-]+)+/g,
48
+ '[redacted-email]',
49
+ )
50
+ .replace(
51
+ /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/gi,
52
+ '[redacted-id]',
53
+ )
54
+ .replace(
55
+ /\b(?=[A-Za-z0-9_-]*\d)(?=[A-Za-z0-9_-]*[A-Za-z])[A-Za-z0-9_-]{24,}\b/g,
56
+ '[redacted-id]',
57
+ );
58
+ const bounded = redactProviderErrorDetail(strict).slice(
59
+ 0,
60
+ LOGGED_PROVIDER_TEXT_MAX_CHARS,
61
+ );
62
+ return bounded || null;
63
+ }
@@ -230,7 +230,26 @@ export type RuntimeResourceObservation = {
230
230
  sheetFlushBytes?: number | null;
231
231
  };
232
232
 
233
+ /** Decoded runner execute-response envelopes; permits are not resident memory. */
234
+ export type RuntimeToolResponseBodyAdmissionSnapshot = {
235
+ turns: number;
236
+ measuredTurns: number;
237
+ decodedUtf8BytesTotal: number;
238
+ decodedUtf8BytesMax: number;
239
+ /** Peak concurrent expected-or-measured reservations; not RSS or heap usage. */
240
+ permitBytesPeak: number;
241
+ queuedTurns: number;
242
+ /** Budget refusal checks, not distinct delayed calls or rows. */
243
+ budgetRefusals: number;
244
+ progressAdmissions: number;
245
+ unpricedAdmissions: number;
246
+ };
247
+
233
248
  export type RuntimeResourceSnapshot = {
249
+ /** Optional for snapshots produced before byte-lane telemetry was added. */
250
+ memoryAdmission?: {
251
+ toolResponseBody: RuntimeToolResponseBodyAdmissionSnapshot;
252
+ };
234
253
  /**
235
254
  * Selected execute-route stages across every physical request that published
236
255
  * the complete timing header. Kept once per run so mixed-provider fixtures