reeval 0.21.0 → 0.23.0

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 (397) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/README.md +15 -15
  3. package/dist/{adapter-BdzhdRYo.js → adapter-Dlq3-4OS.js} +7 -50
  4. package/dist/adapter-Dlq3-4OS.js.map +1 -0
  5. package/dist/{agent-Dx-bDmlV.js → agent-OsAfayRf.js} +11 -12
  6. package/dist/agent-OsAfayRf.js.map +1 -0
  7. package/dist/{agents-l0-k7vw3.js → agents-BztvTkfM.js} +46 -37
  8. package/dist/agents-BztvTkfM.js.map +1 -0
  9. package/dist/{app-files-B-CQYB0c.js → app-files-6NHzghym.js} +3 -3
  10. package/dist/app-files-6NHzghym.js.map +1 -0
  11. package/dist/{assemble-CsZIcJo8.js → assemble-Doa1m-HW.js} +17 -15
  12. package/dist/{assemble-CsZIcJo8.js.map → assemble-Doa1m-HW.js.map} +1 -1
  13. package/dist/{assemble-CYMpN8LC.js → assemble-XrZskSNj.js} +1 -1
  14. package/dist/attach-BH2HdwH_.js +219 -0
  15. package/dist/attach-BH2HdwH_.js.map +1 -0
  16. package/dist/{attempt-CKfKsqqw.js → attempt-_dUsblVx.js} +2 -2
  17. package/dist/{attempt-CKfKsqqw.js.map → attempt-_dUsblVx.js.map} +1 -1
  18. package/dist/{attempt-host-BwSmNYkX.js → attempt-host-8mQV8Uee.js} +7 -7
  19. package/dist/{attempt-host-BwSmNYkX.js.map → attempt-host-8mQV8Uee.js.map} +1 -1
  20. package/dist/boat-DKRH0Gv7.js +1 -0
  21. package/dist/boat-DKjqo_ie.js +704 -0
  22. package/dist/boat-DKjqo_ie.js.map +1 -0
  23. package/dist/boat-images-CRN_U_eG.js +366 -0
  24. package/dist/boat-images-CRN_U_eG.js.map +1 -0
  25. package/dist/bundle-DU2aQVeq.js +780 -0
  26. package/dist/bundle-DU2aQVeq.js.map +1 -0
  27. package/dist/{capture-BqIAeFyC.js → capture-By1byHaX.js} +52 -27
  28. package/dist/capture-By1byHaX.js.map +1 -0
  29. package/dist/capture-BzjNv0qP.js +1 -0
  30. package/dist/{cli-s_3opn_I.js → cli-DMHOwdVr.js} +560 -1049
  31. package/dist/cli-DMHOwdVr.js.map +1 -0
  32. package/dist/{cli-spec-DxzIjmq_.js → cli-spec-D0wuUaj9.js} +179 -42
  33. package/dist/cli-spec-D0wuUaj9.js.map +1 -0
  34. package/dist/cli.js +2 -2
  35. package/dist/{client-C5fIzHQa.js → client-B41UK150.js} +8 -4
  36. package/dist/client-B41UK150.js.map +1 -0
  37. package/dist/{command-BJ7KqczP.js → command-8GIHYGZf.js} +9 -9
  38. package/dist/{command-BJ7KqczP.js.map → command-8GIHYGZf.js.map} +1 -1
  39. package/dist/{command-B5OAIjp7.js → command-CAmnWLFL.js} +14 -14
  40. package/dist/{command-B5OAIjp7.js.map → command-CAmnWLFL.js.map} +1 -1
  41. package/dist/{command-BXLZsEwQ.js → command-CXxckfsq.js} +13 -13
  42. package/dist/{command-BXLZsEwQ.js.map → command-CXxckfsq.js.map} +1 -1
  43. package/dist/{command-DA_SHQUQ.js → command-ao0NZ8h0.js} +16 -15
  44. package/dist/command-ao0NZ8h0.js.map +1 -0
  45. package/dist/{commands-BPvAOEmb.js → commands-B3lnIPj5.js} +1 -1
  46. package/dist/{commands-BKBamOcX.js → commands-ttChCsAy.js} +15 -15
  47. package/dist/{commands-BKBamOcX.js.map → commands-ttChCsAy.js.map} +1 -1
  48. package/dist/{config-C0URar0t.js → config-myJT1Qjc.js} +62 -37
  49. package/dist/config-myJT1Qjc.js.map +1 -0
  50. package/dist/{context-Sj58aJEu.js → context-DnzR9TNK.js} +2 -2
  51. package/dist/{context-Sj58aJEu.js.map → context-DnzR9TNK.js.map} +1 -1
  52. package/dist/cost-CdRX1s2p.js +1 -0
  53. package/dist/{cursor-catalog-FWgSo-T1.js → cursor-catalog-CUQrabJ_.js} +2 -2
  54. package/dist/{cursor-catalog-FWgSo-T1.js.map → cursor-catalog-CUQrabJ_.js.map} +1 -1
  55. package/dist/daytona-Dfhwtr9P.js +677 -0
  56. package/dist/daytona-Dfhwtr9P.js.map +1 -0
  57. package/dist/daytona-image-CnG6G00x.js +183 -0
  58. package/dist/daytona-image-CnG6G00x.js.map +1 -0
  59. package/dist/daytona-image-yJK3c4EV.js +1 -0
  60. package/dist/{db-BjAWxVAG.js → db-5H95sFii.js} +35 -9
  61. package/dist/{db-BjAWxVAG.js.map → db-5H95sFii.js.map} +1 -1
  62. package/dist/db-Bbg1n_2M.js +2 -0
  63. package/dist/{default-effort-CWlhZ6U1.js → default-effort-CtNY9CGW.js} +1 -1
  64. package/dist/{default-effort-Ck2GYIxX.js → default-effort-DYpCkJRk.js} +2 -2
  65. package/dist/{default-effort-Ck2GYIxX.js.map → default-effort-DYpCkJRk.js.map} +1 -1
  66. package/dist/{docker-D74l67k8.js → docker-CR0JZ1FE.js} +4 -4
  67. package/dist/{docker-D74l67k8.js.map → docker-CR0JZ1FE.js.map} +1 -1
  68. package/dist/docker-kpudeSxV.js +1 -0
  69. package/dist/{doctor-eFxyn6at.js → doctor-aE-RMbB_.js} +63 -76
  70. package/dist/doctor-aE-RMbB_.js.map +1 -0
  71. package/dist/{environment-CJIKz-Ud.js → environment-C8pUCD_A.js} +138 -53
  72. package/dist/environment-C8pUCD_A.js.map +1 -0
  73. package/dist/{errors-C1GBcWE2.js → errors-DPUoUTdK.js} +2 -2
  74. package/dist/{errors-C1GBcWE2.js.map → errors-DPUoUTdK.js.map} +1 -1
  75. package/dist/{eval-source-CXIRJ91v.js → eval-source-CaLIGH3U.js} +6 -6
  76. package/dist/{eval-source-CXIRJ91v.js.map → eval-source-CaLIGH3U.js.map} +1 -1
  77. package/dist/{evaluate-DA4QsrHO.js → evaluate-4kBVtwZZ.js} +250 -215
  78. package/dist/evaluate-4kBVtwZZ.js.map +1 -0
  79. package/dist/{evaluate-DHrU4Wld.d.ts → evaluate-DHaNtgVf.d.ts} +2 -2
  80. package/dist/events-CXxFvVMK.js +475 -0
  81. package/dist/events-CXxFvVMK.js.map +1 -0
  82. package/dist/{fake-bootstrap-CnwWG3kP.js → fake-bootstrap-CzxrCqO3.js} +2 -2
  83. package/dist/{fake-bootstrap-CnwWG3kP.js.map → fake-bootstrap-CzxrCqO3.js.map} +1 -1
  84. package/dist/files-BFnkOAhn.js +1 -0
  85. package/dist/files-BgQxoDlN.js +1 -0
  86. package/dist/{files-D6j-XpaK.js → files-BkvxIqfI.js} +4 -4
  87. package/dist/{files-D6j-XpaK.js.map → files-BkvxIqfI.js.map} +1 -1
  88. package/dist/{files-g1watgRC.js → files-CDfG8swM.js} +2 -2
  89. package/dist/{files-g1watgRC.js.map → files-CDfG8swM.js.map} +1 -1
  90. package/dist/files-CSe4VaMj.js +1 -0
  91. package/dist/{files-F44NRCN0.js → files-CX_mmvCc.js} +8 -8
  92. package/dist/{files-F44NRCN0.js.map → files-CX_mmvCc.js.map} +1 -1
  93. package/dist/{files-BrGVs4gY.js → files-Cs2dtb7-.js} +2 -2
  94. package/dist/{files-BrGVs4gY.js.map → files-Cs2dtb7-.js.map} +1 -1
  95. package/dist/{files-BaqXvB88.js → files-D6M7J3iX.js} +1 -1
  96. package/dist/{files-BVVWAS0A.js → files-DgHeTdCZ.js} +6 -6
  97. package/dist/{files-BVVWAS0A.js.map → files-DgHeTdCZ.js.map} +1 -1
  98. package/dist/{files-Bey1VAex.js → files-DpwJW3w6.js} +3 -3
  99. package/dist/{files-Bey1VAex.js.map → files-DpwJW3w6.js.map} +1 -1
  100. package/dist/gateway.d.ts +1 -1
  101. package/dist/{git-Jqkf9SBa.js → git-BnnNEXqh.js} +3 -3
  102. package/dist/{git-Jqkf9SBa.js.map → git-BnnNEXqh.js.map} +1 -1
  103. package/dist/harness-install-BfMBYDfP.js +53 -0
  104. package/dist/harness-install-BfMBYDfP.js.map +1 -0
  105. package/dist/harness.d.ts +1 -1
  106. package/dist/hosted-5Zz2peTR.js +260 -0
  107. package/dist/hosted-5Zz2peTR.js.map +1 -0
  108. package/dist/hosted-Co-waHe0.js +131 -0
  109. package/dist/hosted-Co-waHe0.js.map +1 -0
  110. package/dist/hosted-run-202QicZ-.js +1 -0
  111. package/dist/hosted-run-BfAPIMyT.js +230 -0
  112. package/dist/hosted-run-BfAPIMyT.js.map +1 -0
  113. package/dist/{ids-B-JKTCP8.js → ids-a6cr243_.js} +17 -12
  114. package/dist/ids-a6cr243_.js.map +1 -0
  115. package/dist/{images-Dsc4Wi-F.js → images-DtXwj2wL.js} +70 -55
  116. package/dist/images-DtXwj2wL.js.map +1 -0
  117. package/dist/index.d.ts +2 -2
  118. package/dist/index.js +5 -5
  119. package/dist/init-BiL6B3S4.js +1 -0
  120. package/dist/{init-QB5ecPDA.js → init-Ci_IAp8p.js} +5 -5
  121. package/dist/{init-QB5ecPDA.js.map → init-Ci_IAp8p.js.map} +1 -1
  122. package/dist/{ink-list-mCJypk3d.js → ink-list-Dnh6XD3C.js} +54 -15
  123. package/dist/ink-list-Dnh6XD3C.js.map +1 -0
  124. package/dist/inputs-load-DPUP_IFL.js +95 -0
  125. package/dist/inputs-load-DPUP_IFL.js.map +1 -0
  126. package/dist/inputs-load-M-BGe7gd.js +1 -0
  127. package/dist/inputs-z4JqnQ5g.js +190 -0
  128. package/dist/inputs-z4JqnQ5g.js.map +1 -0
  129. package/dist/internal/vm.d.ts +16 -0
  130. package/dist/internal/vm.js +22 -0
  131. package/dist/internal/vm.js.map +1 -0
  132. package/dist/{invocations-BSr4lRzI.js → invocations-C1gY3E0J.js} +4 -4
  133. package/dist/{invocations-BSr4lRzI.js.map → invocations-C1gY3E0J.js.map} +1 -1
  134. package/dist/jiti-ILwyxt93.js +54 -0
  135. package/dist/jiti-ILwyxt93.js.map +1 -0
  136. package/dist/{judge-eGH39PaP.js → judge-DwzqucLS.js} +9 -6
  137. package/dist/{judge-eGH39PaP.js.map → judge-DwzqucLS.js.map} +1 -1
  138. package/dist/judge.d.ts +1 -1
  139. package/dist/judge.js +1 -1
  140. package/dist/kinds-DEKXOWVJ.js +592 -0
  141. package/dist/kinds-DEKXOWVJ.js.map +1 -0
  142. package/dist/{layout-DfQa4mJs.js → layout-nCnU9Vu2.js} +2 -2
  143. package/dist/{layout-DfQa4mJs.js.map → layout-nCnU9Vu2.js.map} +1 -1
  144. package/dist/{list-Dh6T0kdr.js → list-MK4L8tfW.js} +14 -11
  145. package/dist/{list-Dh6T0kdr.js.map → list-MK4L8tfW.js.map} +1 -1
  146. package/dist/{live-y1p3oNXH.js → live-BkPNXVmN.js} +8 -8
  147. package/dist/{live-y1p3oNXH.js.map → live-BkPNXVmN.js.map} +1 -1
  148. package/dist/{live-xTZs0c61.js → live-Dlq-S2yy.js} +7 -5
  149. package/dist/live-Dlq-S2yy.js.map +1 -0
  150. package/dist/live-gZtkBwuo.js +1 -0
  151. package/dist/machine-service-Byl0BlcT.js +1 -0
  152. package/dist/machine-service-CZiXiVsS.js +709 -0
  153. package/dist/machine-service-CZiXiVsS.js.map +1 -0
  154. package/dist/machines-Ch5bhgvk.js +279 -0
  155. package/dist/machines-Ch5bhgvk.js.map +1 -0
  156. package/dist/model-C6aoJLg_.js +1 -0
  157. package/dist/{model-jRKSQBg6.js → model-CRh8aiYS.js} +6 -5
  158. package/dist/model-CRh8aiYS.js.map +1 -0
  159. package/dist/{model-3pZZzloU.js → model-DRa7yv6K.js} +6 -5
  160. package/dist/model-DRa7yv6K.js.map +1 -0
  161. package/dist/{model-DNpKiHqO.js → model-LoLnq9y1.js} +2 -2
  162. package/dist/{model-DNpKiHqO.js.map → model-LoLnq9y1.js.map} +1 -1
  163. package/dist/{model-DEjwetkJ.js → model-lLaUxxno.js} +1 -1
  164. package/dist/{node-DM-mLGdX.js → node-BQjSQw0d.js} +19 -8
  165. package/dist/node-BQjSQw0d.js.map +1 -0
  166. package/dist/{openrouter-models-C0aRo633.js → openrouter-models-B1sIOTD2.js} +2 -2
  167. package/dist/{openrouter-models-C0aRo633.js.map → openrouter-models-B1sIOTD2.js.map} +1 -1
  168. package/dist/options-I9I3FwMl.js +1 -0
  169. package/dist/own-reads-CYmBlrHK.js +15 -0
  170. package/dist/own-reads-CYmBlrHK.js.map +1 -0
  171. package/dist/{patch-Bx-qp8Li.js → patch-D8X6VB-e.js} +2 -2
  172. package/dist/{patch-Bx-qp8Li.js.map → patch-D8X6VB-e.js.map} +1 -1
  173. package/dist/{plan-ChO0A-xn.js → plan-DgIVIrXJ.js} +47 -9
  174. package/dist/plan-DgIVIrXJ.js.map +1 -0
  175. package/dist/{plugins-BioMWncI.js → plugins-DvEbow6a.js} +17 -637
  176. package/dist/plugins-DvEbow6a.js.map +1 -0
  177. package/dist/{preflight-CJSGzMzc.js → preflight-BKGbxN67.js} +9 -8
  178. package/dist/preflight-BKGbxN67.js.map +1 -0
  179. package/dist/{preflight-qFCXmxha.js → preflight-Qm4wE094.js} +9 -4
  180. package/dist/preflight-Qm4wE094.js.map +1 -0
  181. package/dist/preflight-dJqs5x3r.js +1 -0
  182. package/dist/preflight-fyV5nnea.js +1 -0
  183. package/dist/prepare-BAjRSoku.js +389 -0
  184. package/dist/prepare-BAjRSoku.js.map +1 -0
  185. package/dist/prepare-CRPPfRJf.js +2 -0
  186. package/dist/prices-C0gKS_8G.js +1 -0
  187. package/dist/{prices-BrY_ihLs.js → prices-DCokI_Ka.js} +3 -3
  188. package/dist/{prices-BrY_ihLs.js.map → prices-DCokI_Ka.js.map} +1 -1
  189. package/dist/{provenance-B-flBAzR.js → provenance-CSyRCc9B.js} +4 -4
  190. package/dist/{provenance-B-flBAzR.js.map → provenance-CSyRCc9B.js.map} +1 -1
  191. package/dist/{providers-B6StVyfG.js → providers-DkaEJvF5.js} +185 -35
  192. package/dist/providers-DkaEJvF5.js.map +1 -0
  193. package/dist/providers-DxZ26YoG.js +1 -0
  194. package/dist/{query-CkLmJv7R.js → query-BL66BOqL.js} +2 -2
  195. package/dist/{query-CkLmJv7R.js.map → query-BL66BOqL.js.map} +1 -1
  196. package/dist/query-C9OKU1Vz.js +1 -0
  197. package/dist/{questions-CJIh2FSX.js → questions-boVPzGoC.js} +7 -7
  198. package/dist/{questions-CJIh2FSX.js.map → questions-boVPzGoC.js.map} +1 -1
  199. package/dist/recipe-qyIpP96r.js +128 -0
  200. package/dist/recipe-qyIpP96r.js.map +1 -0
  201. package/dist/{record-nVVujCW7.js → record-D1_D1KFY.js} +12 -4
  202. package/dist/record-D1_D1KFY.js.map +1 -0
  203. package/dist/{redact-DL2BTykw.js → redact-t-L3VGy8.js} +91 -2
  204. package/dist/redact-t-L3VGy8.js.map +1 -0
  205. package/dist/{remarks-B3wjKscW.js → remarks-DEvk5f8v.js} +7 -7
  206. package/dist/{remarks-B3wjKscW.js.map → remarks-DEvk5f8v.js.map} +1 -1
  207. package/dist/{remote-C88amFRN.js → remote-CQoBRpOv.js} +5 -5
  208. package/dist/{remote-C88amFRN.js.map → remote-CQoBRpOv.js.map} +1 -1
  209. package/dist/resolve-BdpO8BN1.js +1 -0
  210. package/dist/{resolve-Bul8lHaa.js → resolve-Bfo8sjd-.js} +2 -2
  211. package/dist/{resolve-Bul8lHaa.js.map → resolve-Bfo8sjd-.js.map} +1 -1
  212. package/dist/{resolve-G576PiFJ.js → resolve-D2RqmybX.js} +9 -9
  213. package/dist/{resolve-G576PiFJ.js.map → resolve-D2RqmybX.js.map} +1 -1
  214. package/dist/resources-DqdwihhT.js +62 -0
  215. package/dist/resources-DqdwihhT.js.map +1 -0
  216. package/dist/{results-zVHIW6xw.js → results-BpxzyoMd.js} +5 -5
  217. package/dist/{results-zVHIW6xw.js.map → results-BpxzyoMd.js.map} +1 -1
  218. package/dist/{resume-D_PcUXfG.js → resume-2ekm_9OB.js} +78 -7
  219. package/dist/resume-2ekm_9OB.js.map +1 -0
  220. package/dist/{retry-BvTzCxdc.js → retry-CAhpW1hH.js} +4 -4
  221. package/dist/{retry-BvTzCxdc.js.map → retry-CAhpW1hH.js.map} +1 -1
  222. package/dist/{routes-B0F2R-K7.js → routes-Cp4gAjBZ.js} +118 -70
  223. package/dist/routes-Cp4gAjBZ.js.map +1 -0
  224. package/dist/{runtime-B3r_pAq6.js → runtime-C5fKSFCz.js} +46 -5
  225. package/dist/runtime-C5fKSFCz.js.map +1 -0
  226. package/dist/sandbox/boat.d.ts +11 -3
  227. package/dist/sandbox/boat.js +18 -4
  228. package/dist/sandbox/boat.js.map +1 -1
  229. package/dist/sandbox/daytona.d.ts +30 -0
  230. package/dist/sandbox/daytona.js +49 -0
  231. package/dist/sandbox/daytona.js.map +1 -0
  232. package/dist/{sandbox-Duh3z1TV.js → sandbox-t-Q-8lA_.js} +2 -2
  233. package/dist/{sandbox-Duh3z1TV.js.map → sandbox-t-Q-8lA_.js.map} +1 -1
  234. package/dist/sandbox.d.ts +1 -1
  235. package/dist/sandbox.js +1 -1
  236. package/dist/{server-DUWMRKik.js → server-BcLg9WzE.js} +10 -10
  237. package/dist/{server-DUWMRKik.js.map → server-BcLg9WzE.js.map} +1 -1
  238. package/dist/server-Buav2-CG.js +1 -0
  239. package/dist/services-BG8xuU82.js +39 -0
  240. package/dist/services-BG8xuU82.js.map +1 -0
  241. package/dist/{source-CHuN4Nfg.js → source-CrXM19HD.js} +2 -2
  242. package/dist/{source-CHuN4Nfg.js.map → source-CrXM19HD.js.map} +1 -1
  243. package/dist/source-dvxkqYvk.js +1 -0
  244. package/dist/src-5dCrqbFd.js +2 -0
  245. package/dist/{src-BI0v8qlZ.js → src-Bb3k9Kn_.js} +8 -5
  246. package/dist/{src-BI0v8qlZ.js.map → src-Bb3k9Kn_.js.map} +1 -1
  247. package/dist/{src-boB6D-5T.js → src-Bf5RZlPi.js} +2 -2
  248. package/dist/{src-boB6D-5T.js.map → src-Bf5RZlPi.js.map} +1 -1
  249. package/dist/{src-BqNzHHWn.js → src-C3OhA5pw.js} +2 -2
  250. package/dist/{src-BqNzHHWn.js.map → src-C3OhA5pw.js.map} +1 -1
  251. package/dist/{src-BHJ4MWvY.js → src-C5rrQlt8.js} +2199 -771
  252. package/dist/src-C5rrQlt8.js.map +1 -0
  253. package/dist/{src-CeBhwD8k.js → src-C6MsGyD6.js} +1 -1
  254. package/dist/{src-De0KY5S_.js → src-Cf4vRyea.js} +2 -2
  255. package/dist/src-DEbNp-rx.js +1 -0
  256. package/dist/{src-B-HuDqpH.js → src-DNWiU__5.js} +2 -2
  257. package/dist/{src-B-HuDqpH.js.map → src-DNWiU__5.js.map} +1 -1
  258. package/dist/src-DrLbG1HM.js +2 -0
  259. package/dist/{src--yl1OypK.js → src-Ds1pmXTg.js} +2 -2
  260. package/dist/{src-DA95rM6v.js → src-DwcCKsV0.js} +2 -2
  261. package/dist/{src-CmA5Yev6.js → src-DwcTn4JY.js} +2 -2
  262. package/dist/{src-CmA5Yev6.js.map → src-DwcTn4JY.js.map} +1 -1
  263. package/dist/{src-CZaYu6ER.js → src-VG2IRoT4.js} +1 -1
  264. package/dist/{src-DL-EE4DU.js → src-c3ZQu7Uu.js} +2 -2
  265. package/dist/{src-DL-EE4DU.js.map → src-c3ZQu7Uu.js.map} +1 -1
  266. package/dist/{src-CkEiiyON.js → src-io_SKoZ5.js} +2 -2
  267. package/dist/ssh-pool-BorCizYw.js +1 -0
  268. package/dist/ssh-pool-Dvfx5GuV.js +174 -0
  269. package/dist/ssh-pool-Dvfx5GuV.js.map +1 -0
  270. package/dist/start-COB07NpH.js +718 -0
  271. package/dist/start-COB07NpH.js.map +1 -0
  272. package/dist/{state-DUBRDyMk.js → state-B319V1p8.js} +16 -16
  273. package/dist/{state-DUBRDyMk.js.map → state-B319V1p8.js.map} +1 -1
  274. package/dist/state-C5oBvmoZ.js +1 -0
  275. package/dist/store/local.d.ts +1 -1
  276. package/dist/store/s3.d.ts +1 -1
  277. package/dist/suite-BwJGOhCZ.js +2 -0
  278. package/dist/{suite-B9J6Afg6.js → suite-D1tgXZxM.js} +2 -2
  279. package/dist/{suite-B9J6Afg6.js.map → suite-D1tgXZxM.js.map} +1 -1
  280. package/dist/{summary-CSp4cfnr.js → summary-ClLns_wv.js} +8 -5
  281. package/dist/summary-ClLns_wv.js.map +1 -0
  282. package/dist/{sync-CxAY6Dki.js → sync-mOG74RXH.js} +5 -5
  283. package/dist/{sync-CxAY6Dki.js.map → sync-mOG74RXH.js.map} +1 -1
  284. package/dist/{tart-CcrrtSrp.js → tart-DMppfbEm.js} +100 -295
  285. package/dist/tart-DMppfbEm.js.map +1 -0
  286. package/dist/{tart-bake-F-6seRC9.js → tart-bake-Cva_qdir.js} +18 -62
  287. package/dist/tart-bake-Cva_qdir.js.map +1 -0
  288. package/dist/{tart-bake-RK7RaT9E.js → tart-bake-DVIoXWr_.js} +1 -1
  289. package/dist/{tart-cli-ClvRniLQ.js → tart-cli-D88c5YYJ.js} +1 -1
  290. package/dist/{tart-cli-B86Jqo1t.js → tart-cli-LzDud2Z6.js} +2 -2
  291. package/dist/{tart-cli-B86Jqo1t.js.map → tart-cli-LzDud2Z6.js.map} +1 -1
  292. package/dist/{tart-hosts-Brii7zHM.js → tart-hosts-8N6Tt7Yb.js} +1 -1
  293. package/dist/{tart-hosts-DPyZsg-1.js → tart-hosts-CTRY5kQ2.js} +3 -3
  294. package/dist/{tart-hosts-DPyZsg-1.js.map → tart-hosts-CTRY5kQ2.js.map} +1 -1
  295. package/dist/{tart-images-CWSf03w8.js → tart-images-JfHirU8W.js} +2 -2
  296. package/dist/{tart-images-CWSf03w8.js.map → tart-images-JfHirU8W.js.map} +1 -1
  297. package/dist/testing.d.ts +2 -2
  298. package/dist/testing.js +4 -4
  299. package/dist/{tool-class-CVDdJy0H.js → tool-class-CncfCw03.js} +2 -2
  300. package/dist/{tool-class-CVDdJy0H.js.map → tool-class-CncfCw03.js.map} +1 -1
  301. package/dist/{transcript-BP_2hji-.js → transcript-BXWZiMuC.js} +2 -2
  302. package/dist/{transcript-BP_2hji-.js.map → transcript-BXWZiMuC.js.map} +1 -1
  303. package/dist/{types-BJ0wh8wC.d.ts → types-BDo8ttQo.d.ts} +253 -5
  304. package/dist/types-CbcnJxCy.js.map +1 -1
  305. package/dist/ui-DUiVPbQ2.js +1024 -0
  306. package/dist/ui-DUiVPbQ2.js.map +1 -0
  307. package/dist/vercel-models-Ci33llXz.js +21 -0
  308. package/dist/vercel-models-Ci33llXz.js.map +1 -0
  309. package/dist/view/index.d.ts +6 -1
  310. package/dist/view/index.js +4 -4
  311. package/dist/views-B0qZR5Ef.js +2 -0
  312. package/dist/{views-DRxXCyIH.js → views-CiZGh3ws.js} +6 -6
  313. package/dist/{views-DRxXCyIH.js.map → views-CiZGh3ws.js.map} +1 -1
  314. package/dist/vm-container-BVn7pXfD.js +148 -0
  315. package/dist/vm-container-BVn7pXfD.js.map +1 -0
  316. package/dist/vm-images-CNk-Zl2a.js +375 -0
  317. package/dist/vm-images-CNk-Zl2a.js.map +1 -0
  318. package/dist/{worker-entry-C3Q4U63F.js → worker-entry-DmXQ2Znu.js} +31 -11
  319. package/dist/worker-entry-DmXQ2Znu.js.map +1 -0
  320. package/dist/workspace-CRgFdmgW.js +1 -0
  321. package/dist/{workspace-P72SXLXr.js → workspace-wwvwEHzP.js} +6 -6
  322. package/dist/{workspace-P72SXLXr.js.map → workspace-wwvwEHzP.js.map} +1 -1
  323. package/docker/Dockerfile +1 -1
  324. package/package.json +17 -2
  325. package/skills/reeval/references/environments.md +4 -3
  326. package/dist/adapter-BdzhdRYo.js.map +0 -1
  327. package/dist/agent-Dx-bDmlV.js.map +0 -1
  328. package/dist/agents-l0-k7vw3.js.map +0 -1
  329. package/dist/app-files-B-CQYB0c.js.map +0 -1
  330. package/dist/boat-CZpAreTB.js +0 -108
  331. package/dist/boat-CZpAreTB.js.map +0 -1
  332. package/dist/boat-su1Y7LPd.js +0 -325
  333. package/dist/boat-su1Y7LPd.js.map +0 -1
  334. package/dist/capture-BqIAeFyC.js.map +0 -1
  335. package/dist/capture-D0Ln5aCP.js +0 -1
  336. package/dist/cli-s_3opn_I.js.map +0 -1
  337. package/dist/cli-spec-DxzIjmq_.js.map +0 -1
  338. package/dist/client-C5fIzHQa.js.map +0 -1
  339. package/dist/command-DA_SHQUQ.js.map +0 -1
  340. package/dist/config-C0URar0t.js.map +0 -1
  341. package/dist/cost-IM80LyGD.js +0 -1
  342. package/dist/db-Bc4L-Wcr.js +0 -2
  343. package/dist/docker-CDdK6Ity.js +0 -271
  344. package/dist/docker-CDdK6Ity.js.map +0 -1
  345. package/dist/docker-DMug3l-a.js +0 -1
  346. package/dist/doctor-eFxyn6at.js.map +0 -1
  347. package/dist/environment-CJIKz-Ud.js.map +0 -1
  348. package/dist/evaluate-DA4QsrHO.js.map +0 -1
  349. package/dist/files-BjOJw4sn.js +0 -1
  350. package/dist/files-CNHhSyb3.js +0 -1
  351. package/dist/files-CW1lChNh.js +0 -1
  352. package/dist/ids-B-JKTCP8.js.map +0 -1
  353. package/dist/images-Dsc4Wi-F.js.map +0 -1
  354. package/dist/init-C0oUG3jh.js +0 -1
  355. package/dist/ink-list-mCJypk3d.js.map +0 -1
  356. package/dist/live-DwjWJTdn.js +0 -1
  357. package/dist/live-xTZs0c61.js.map +0 -1
  358. package/dist/model-3pZZzloU.js.map +0 -1
  359. package/dist/model-jRKSQBg6.js.map +0 -1
  360. package/dist/model-nfewGTzB.js +0 -1
  361. package/dist/node-DM-mLGdX.js.map +0 -1
  362. package/dist/options-DpsJ_5CU.js +0 -1
  363. package/dist/plan-ChO0A-xn.js.map +0 -1
  364. package/dist/plugins-BioMWncI.js.map +0 -1
  365. package/dist/preflight-BUjk_6wT.js +0 -1
  366. package/dist/preflight-CJSGzMzc.js.map +0 -1
  367. package/dist/preflight-DD3fI4Hz.js +0 -1
  368. package/dist/preflight-qFCXmxha.js.map +0 -1
  369. package/dist/prepare-D7oSSFNm.js +0 -268
  370. package/dist/prepare-D7oSSFNm.js.map +0 -1
  371. package/dist/prepare-xHU2BpN-.js +0 -2
  372. package/dist/prices-B1vm_lPk.js +0 -1
  373. package/dist/providers-B6StVyfG.js.map +0 -1
  374. package/dist/providers-Dljf6al6.js +0 -1
  375. package/dist/query-BAc2tQZj.js +0 -1
  376. package/dist/record-nVVujCW7.js.map +0 -1
  377. package/dist/redact-DL2BTykw.js.map +0 -1
  378. package/dist/resolve-DW92wpIZ.js +0 -1
  379. package/dist/resume-D_PcUXfG.js.map +0 -1
  380. package/dist/routes-B0F2R-K7.js.map +0 -1
  381. package/dist/runtime-B3r_pAq6.js.map +0 -1
  382. package/dist/server-CGEsvVRG.js +0 -1
  383. package/dist/source-Wz1Nrfue.js +0 -1
  384. package/dist/src-BHJ4MWvY.js.map +0 -1
  385. package/dist/src-BL-_0QoE.js +0 -1
  386. package/dist/src-C-mOSczH.js +0 -2
  387. package/dist/src-CwH_nEaw.js +0 -2
  388. package/dist/state-B3jex5KU.js +0 -1
  389. package/dist/suite-Bhs9-Z7O.js +0 -2
  390. package/dist/summary-CSp4cfnr.js.map +0 -1
  391. package/dist/tarball-CESxtK4X.js +0 -257
  392. package/dist/tarball-CESxtK4X.js.map +0 -1
  393. package/dist/tart-CcrrtSrp.js.map +0 -1
  394. package/dist/tart-bake-F-6seRC9.js.map +0 -1
  395. package/dist/views-i67V1ly3.js +0 -2
  396. package/dist/worker-entry-C3Q4U63F.js.map +0 -1
  397. package/dist/workspace-DhUOW8if.js +0 -1
@@ -0,0 +1,677 @@
1
+ import { un as run } from "./src-C5rrQlt8.js";
2
+ import { g as redactSecrets, x as registerSecret } from "./redact-t-L3VGy8.js";
3
+ import { t as InfraError } from "./types-CbcnJxCy.js";
4
+ import { t as PrepareError } from "./provider-ieWOn4YS.js";
5
+ import { C as retryAfterMs, M as sandboxLabels, j as optionalPeer, w as runLabels } from "./boat-DKjqo_ie.js";
6
+ import { i as RATE_LIMIT_WAITS } from "./machine-service-CZiXiVsS.js";
7
+ import { n as missingSshTool, r as newKey, t as createPooledSshSandbox } from "./ssh-pool-Dvfx5GuV.js";
8
+ import { t as daytonaImage } from "./daytona-image-CnG6G00x.js";
9
+ import { dirname, join } from "node:path";
10
+ import { randomBytes } from "node:crypto";
11
+ import { tmpdir } from "node:os";
12
+ import { mkdir, mkdtemp, rm, writeFile } from "node:fs/promises";
13
+ import { setTimeout } from "node:timers/promises";
14
+ // src/sandbox/daytona.ts
15
+ const DAYTONA_SDK = "@daytona/sdk";
16
+ /** Where the SDK sends its calls, when not Daytona's own API. */
17
+ const DAYTONA_API_URL = "DAYTONA_API_URL";
18
+ /** Daytona's SDK, from beside reeval or else from the project. */
19
+ const loadDaytonaSdk = optionalPeer(DAYTONA_SDK, {
20
+ stage: "daytona",
21
+ message: `daytona() needs Daytona's SDK, which isn't installed. ${`Install Daytona's SDK in this project: npm i ${DAYTONA_SDK}`}`
22
+ });
23
+ /** Why `sandbox`'s key can't be read from this process's environment, or null. */
24
+ function daytonaKeyProblem(sandbox) {
25
+ const name = sandbox.apiKey.from;
26
+ const value = process.env[name];
27
+ if (!value) return `daytona() needs a Daytona API key in ${name}, which isn't set`;
28
+ if (/\s/.test(value)) return `${name} has whitespace or a line break in it (a key pasted from a wrapped line?); set it to the key alone`;
29
+ return null;
30
+ }
31
+ const usage = (message) => new PrepareError({
32
+ class: "config",
33
+ stage: "daytona",
34
+ ref: null,
35
+ cause: null,
36
+ log: null,
37
+ usage: true,
38
+ message
39
+ });
40
+ /** A client for `sandbox`'s organization; the key goes from the environment to the SDK, nowhere else. */
41
+ async function daytonaClient(sandbox, projectRoot) {
42
+ const problem = daytonaKeyProblem(sandbox);
43
+ if (problem) throw usage(`${problem}. Set it in the environment or the project's .env.local.`);
44
+ const { Daytona } = await loadDaytonaSdk(projectRoot);
45
+ const apiKey = process.env[sandbox.apiKey.from];
46
+ registerSecret(apiKey);
47
+ const apiUrl = process.env[DAYTONA_API_URL];
48
+ return new Daytona({
49
+ apiKey,
50
+ useDeprecatedPolling: true,
51
+ ...apiUrl ? { apiUrl } : {}
52
+ });
53
+ }
54
+ const statusOf = (error) => error.statusCode;
55
+ const headerOf = (error, name) => {
56
+ const headers = error.headers;
57
+ const value = typeof headers?.get === "function" ? headers.get(name) : headers?.[name];
58
+ return value == null ? null : String(value);
59
+ };
60
+ const messageOf = (error) => error instanceof Error ? error.message : String(error);
61
+ /** Daytona refused a start for now: 429, with when to try again if it said. */
62
+ var DaytonaRateLimited = class extends Error {
63
+ retryAfterMs;
64
+ constructor(message, retryAfterMs) {
65
+ super(message);
66
+ this.name = "DaytonaRateLimited";
67
+ this.retryAfterMs = retryAfterMs;
68
+ }
69
+ };
70
+ const rateLimited = (error, what) => statusOf(error) === 429 ? new DaytonaRateLimited(`Daytona is limiting ${what}: ${messageOf(error)}`, retryAfterMs(headerOf(error, "retry-after"), messageOf(error))) : null;
71
+ /**
72
+ * `call` again while Daytona answers 429, waiting as the pool waits out a refused start: its
73
+ * `Retry-After`, else a backoff that doubles, for at most the pool's time.
74
+ */
75
+ async function whileLimited(what, call, signal, waits = RATE_LIMIT_WAITS) {
76
+ const startedAt = Date.now();
77
+ let backoff = waits.backoffMs;
78
+ for (;;) try {
79
+ return await call();
80
+ } catch (error) {
81
+ const limited = rateLimited(error, what);
82
+ if (!limited) throw error;
83
+ const wait = limited.retryAfterMs ?? backoff;
84
+ backoff = Math.min(backoff * 2, waits.maxBackoffMs);
85
+ if (Date.now() - startedAt + wait > waits.maxRateWaitMs) throw limited;
86
+ await setTimeout(wait, void 0, { signal });
87
+ }
88
+ }
89
+ /** `work`, or `signal`'s reason as soon as it aborts; `orphan` gets what `work` gives after that. */
90
+ function abortable(work, signal, orphan) {
91
+ return new Promise((resolve, reject) => {
92
+ const onAbort = () => {
93
+ work.then(orphan, () => {});
94
+ reject(signal.reason);
95
+ };
96
+ if (signal.aborted) return onAbort();
97
+ signal.addEventListener("abort", onAbort, { once: true });
98
+ work.then((value) => {
99
+ signal.removeEventListener("abort", onAbort);
100
+ resolve(value);
101
+ }, (error) => {
102
+ signal.removeEventListener("abort", onAbort);
103
+ reject(error);
104
+ });
105
+ });
106
+ }
107
+ /** The default snapshot of each size. */
108
+ const snapshotOf = (sandbox) => `daytona-${sandbox.size ?? "medium"}`;
109
+ /** Each size's resources, as Daytona's default snapshot of that size has them. */
110
+ const RESOURCES = {
111
+ small: {
112
+ cpu: 1,
113
+ memory: 1,
114
+ disk: 3
115
+ },
116
+ medium: {
117
+ cpu: 2,
118
+ memory: 4,
119
+ disk: 8
120
+ },
121
+ large: {
122
+ cpu: 4,
123
+ memory: 8,
124
+ disk: 10
125
+ }
126
+ };
127
+ const resourcesOf = (size) => RESOURCES[size];
128
+ const spell = (ms) => ms >= 6e4 ? `${Math.round(ms / 6e4)} minutes` : `${Math.round(ms / 1e3)} seconds`;
129
+ /** How long a snapshot another run is making may take before preflight stops waiting on it. */
130
+ const SNAPSHOT_WAITS = {
131
+ pollMs: 2e3,
132
+ waitMs: 9e5,
133
+ buildMs: 18e5
134
+ };
135
+ /** The SDK's `Image` of a Dockerfile, with the files its `COPY` lines name. */
136
+ async function sdkImage(image, root) {
137
+ const { Image } = await loadDaytonaSdk(root);
138
+ const built = new Image();
139
+ built.dockerfileCommands([(image.dockerfile ?? "").trimEnd()], image.contextDir);
140
+ return built;
141
+ }
142
+ const failed = (o) => new PrepareError({
143
+ class: o.class,
144
+ stage: "daytona",
145
+ ref: o.ref,
146
+ cause: null,
147
+ log: o.log ?? null,
148
+ message: o.message
149
+ });
150
+ /** Why Daytona's build failed, from the SDK's error: the snapshot's or sandbox's `errorReason`. */
151
+ const buildFailure = (error) => {
152
+ const message = messageOf(error);
153
+ const snapshot = /^Failed to create snapshot\. Name: \S+ Reason: ([\s\S]*)$/.exec(message);
154
+ if (snapshot) return snapshot[1] ?? "";
155
+ const sandbox = /failed to start with status: build_failed, error reason: ([\s\S]*)$/.exec(message);
156
+ return sandbox ? sandbox[1] ?? "" : null;
157
+ };
158
+ /**
159
+ * Makes sure Daytona has snapshot `name`, building it from `image` when it doesn't, and says
160
+ * `no-permission` when the key can't make or read snapshots. A snapshot another run (or a CLI
161
+ * that was killed) left on its way is waited on for up to `waits.waitMs`; an inactive one is
162
+ * activated; one in `error` or `build_failed` is deleted and built once more, and a build that
163
+ * fails is a config failure with Daytona's reason.
164
+ */
165
+ async function ensureSnapshot(api, o) {
166
+ const waits = o.waits ?? SNAPSHOT_WAITS;
167
+ const { name, signal } = o;
168
+ const deadline = Date.now() + waits.waitMs;
169
+ const call = (work) => whileLimited("calls", work, signal);
170
+ const unreachable = (error) => failed({
171
+ class: "transient",
172
+ ref: name,
173
+ message: `Couldn't reach Daytona: ${messageOf(error)}`
174
+ });
175
+ let rebuilt = false;
176
+ let reported;
177
+ let busy = false;
178
+ const building = () => {
179
+ if (!busy) o.building?.();
180
+ busy = true;
181
+ };
182
+ for (;;) {
183
+ signal.throwIfAborted();
184
+ let found;
185
+ try {
186
+ found = await call(() => api.snapshot.get(name));
187
+ } catch (error) {
188
+ if (signal.aborted) throw error;
189
+ const code = statusOf(error);
190
+ if (code === 401 || code === 403) return "no-permission";
191
+ if (code !== 404) throw unreachable(error);
192
+ found = null;
193
+ }
194
+ if (!found) {
195
+ building();
196
+ o.log(`daytona: building snapshot ${name}`);
197
+ const built = await build();
198
+ if (built === "no-permission" || built === "ready") return built;
199
+ await wait("being created by another run");
200
+ continue;
201
+ }
202
+ const state = found.state ?? "unknown";
203
+ if (state === "active") return "ready";
204
+ if (state === "error" || state === "build_failed") {
205
+ const reason = found.errorReason || "no reason given";
206
+ if (rebuilt) throw buildFailed(reason);
207
+ rebuilt = true;
208
+ building();
209
+ o.log(`daytona: snapshot ${name} is in ${state} (${reason}): deleting it to build it again`);
210
+ await call(() => api.snapshot.delete(found)).catch((error) => {
211
+ if (signal.aborted) throw error;
212
+ if (statusOf(error) !== 404) throw unreachable(error);
213
+ });
214
+ continue;
215
+ }
216
+ if (state === "inactive") {
217
+ o.log(`daytona: activating snapshot ${name}`);
218
+ await call(() => api.snapshot.activate(found)).catch((error) => {
219
+ if (signal.aborted) throw error;
220
+ if (statusOf(error) !== 409) throw unreachable(error);
221
+ });
222
+ continue;
223
+ }
224
+ await wait(state);
225
+ }
226
+ async function wait(state) {
227
+ building();
228
+ if (Date.now() >= deadline) throw failed({
229
+ class: "transient",
230
+ ref: name,
231
+ message: `Daytona's snapshot ${name} was still ${state} after ${spell(waits.waitMs)}. Another run may be building it: run again once it's active, or delete it in Daytona to build it anew.`
232
+ });
233
+ if (reported !== state) o.log(`daytona: waiting for snapshot ${name}, which is ${state}`);
234
+ reported = state;
235
+ await setTimeout(waits.pollMs, void 0, { signal });
236
+ }
237
+ function buildFailed(reason) {
238
+ return failed({
239
+ class: "config",
240
+ ref: name,
241
+ log: o.dockerfileLog,
242
+ message: `Daytona couldn't build snapshot ${name}: ${reason}${o.dockerfileLog ? `\nThe Dockerfile reeval generated is ${o.dockerfileLog}` : ""}`
243
+ });
244
+ }
245
+ async function build() {
246
+ const timeout = AbortSignal.any([signal, AbortSignal.timeout(waits.buildMs)]);
247
+ try {
248
+ await abortable(call(async () => api.snapshot.create({
249
+ name,
250
+ image: await o.image(),
251
+ resources: o.resources
252
+ }, {})), timeout, () => {});
253
+ return "ready";
254
+ } catch (error) {
255
+ if (signal.aborted) throw error;
256
+ if (timeout.aborted) throw failed({
257
+ class: "transient",
258
+ ref: name,
259
+ message: `Daytona's build of snapshot ${name} didn't finish in ${spell(waits.buildMs)}`
260
+ });
261
+ const code = statusOf(error);
262
+ if (code === 401 || code === 403) return "no-permission";
263
+ if (code === 409) return "again";
264
+ const reason = buildFailure(error);
265
+ if (reason !== null) throw buildFailed(reason || "no reason given");
266
+ throw unreachable(error);
267
+ }
268
+ }
269
+ }
270
+ /**
271
+ * Builds the image once in a sandbox that stops after 15 idle minutes and is deleted as it stops,
272
+ * so the run's creates find it in Daytona's build cache, and deletes it.
273
+ */
274
+ async function warmImage(api, sandbox, o) {
275
+ const name = `${sandbox.prefix}-warm-${o.name.slice(-12)}-${randomBytes(2).toString("hex")}`;
276
+ const remove = (s) => s.delete().catch(() => {});
277
+ await remove(await abortable(whileLimited("starts", async () => api.create({
278
+ name,
279
+ image: await o.image(),
280
+ resources: o.resources,
281
+ labels: {
282
+ ...sandboxLabels(),
283
+ ...runLabels(sandbox, "preflight")
284
+ },
285
+ autoStopInterval: 15,
286
+ autoDeleteInterval: 0
287
+ }, { timeout: BUILD_TIMEOUT_S }), o.signal), o.signal, remove).catch(async (error) => {
288
+ if (o.signal.aborted) throw error;
289
+ const id = error.sandboxId;
290
+ if (id) await api.get(id).then(remove, () => {});
291
+ const reason = buildFailure(error);
292
+ if (reason !== null) throw failed({
293
+ class: "config",
294
+ ref: o.name,
295
+ log: o.dockerfileLog,
296
+ message: `Daytona couldn't build the image ${o.name}: ${reason || "no reason given"}${o.dockerfileLog ? `\nThe Dockerfile reeval generated is ${o.dockerfileLog}` : ""}`
297
+ });
298
+ throw failed({
299
+ class: "transient",
300
+ ref: o.name,
301
+ message: `Daytona didn't start a sandbox to build the image ${o.name}: ${messageOf(error)}`
302
+ });
303
+ }));
304
+ }
305
+ /**
306
+ * Preflight for a recipe's sandbox: checks the organization, generates the image and has Daytona
307
+ * build it, into a snapshot or, when the key can't make snapshots, once into its build cache for
308
+ * every create to find. Null without a recipe: sandboxes start from Daytona's default snapshot.
309
+ */
310
+ async function prepareDaytona(sandbox, harness, ctx, waits) {
311
+ await checkDaytona(sandbox, ctx.root);
312
+ const image = await ctx.retry(() => daytonaImage(sandbox, harness, { signal: ctx.signal }));
313
+ if (!image) return null;
314
+ if (image.unpinned) ctx.log(`daytona: ${image.unpinned.ref} isn't pinned by digest (${image.unpinned.reason}), so the image is keyed on its name`);
315
+ const dockerfileLog = join(ctx.root, ".reeval", "cache", "images", `${image.name}.Dockerfile`);
316
+ await mkdir(dirname(dockerfileLog), { recursive: true });
317
+ await writeFile(dockerfileLog, image.dockerfile);
318
+ const api = await daytonaClient(sandbox, ctx.root);
319
+ const built = () => sdkImage(image, ctx.root);
320
+ const resources = resourcesOf(sandbox.size ?? "medium");
321
+ const common = {
322
+ name: image.name,
323
+ image: built,
324
+ resources,
325
+ signal: ctx.signal,
326
+ dockerfileLog
327
+ };
328
+ let building = false;
329
+ const got = await ensureSnapshot(api, {
330
+ ...common,
331
+ log: ctx.log,
332
+ ...waits && { waits },
333
+ building: () => {
334
+ building = true;
335
+ ctx.image?.({
336
+ name: image.name,
337
+ cached: false
338
+ });
339
+ }
340
+ });
341
+ if (!building) ctx.image?.({
342
+ name: image.name,
343
+ cached: got === "ready"
344
+ });
345
+ const start = {
346
+ name: image.name,
347
+ harnessBaked: image.harnessBaked,
348
+ ...got === "ready" ? { snapshot: image.name } : {
349
+ dockerfile: image.dockerfile,
350
+ ...image.contextDir !== void 0 && { contextDir: image.contextDir }
351
+ }
352
+ };
353
+ if (got === "no-permission") {
354
+ ctx.log(`daytona: the key in ${sandbox.apiKey.from} can't make snapshots, so every sandbox builds ${image.name}; building it once so Daytona's build cache has it`);
355
+ await warmImage(api, sandbox, common);
356
+ }
357
+ return {
358
+ start,
359
+ baked: image.name,
360
+ key: image.key
361
+ };
362
+ }
363
+ /** What a sandbox starts from, as {@link prepareDaytona} left it. */
364
+ const daytonaStart = (handle) => {
365
+ const start = handle?.start;
366
+ return start && typeof start === "object" ? start : void 0;
367
+ };
368
+ /** How long a created sandbox may take to start, in seconds. */
369
+ const START_TIMEOUT_S = 180;
370
+ /** How long a sandbox whose image Daytona builds (or finds in its build cache) may take, in seconds. */
371
+ const BUILD_TIMEOUT_S = 1800;
372
+ /** How long a run's cleanup may wait on one organization, so an unreachable API can't stall it. */
373
+ const CLEANUP_TIMEOUT_MS = 3e4;
374
+ /**
375
+ * How long an SSH token lives: past any attempt's machine, which the pool keeps alive and reuses,
376
+ * and which deleting the sandbox revokes first.
377
+ */
378
+ const SSH_TOKEN_MINUTES = 1440;
379
+ /**
380
+ * Where `ssh` reaches the sandbox from Daytona's `sshCommand` (`ssh <token>@ssh.app.daytona.io`,
381
+ * maybe with `-p <port>`), or null when it names no host.
382
+ */
383
+ function sshTarget(command) {
384
+ const words = command.trim().split(/\s+/);
385
+ if (words[0] !== "ssh") return null;
386
+ let port = 22;
387
+ let destination;
388
+ for (let i = 1; i < words.length; i++) {
389
+ const word = words[i];
390
+ if (word === "-p") port = Number(words[++i]);
391
+ else if (word.startsWith("-p") && /^-p\d+$/.test(word)) port = Number(word.slice(2));
392
+ else if (word === "-o" || word === "-i" || word === "-l") i++;
393
+ else if (!word.startsWith("-")) destination ??= word;
394
+ }
395
+ const at = destination?.lastIndexOf("@") ?? -1;
396
+ if (!destination || at <= 0 || !Number.isInteger(port) || port <= 0) return null;
397
+ return {
398
+ user: destination.slice(0, at),
399
+ host: destination.slice(at + 1),
400
+ port
401
+ };
402
+ }
403
+ /** The SSH server's host keys at `host:port`, as known_hosts lines under `alias`. */
404
+ async function hostKeys(host, port, alias) {
405
+ const scanned = await run("ssh-keyscan", [
406
+ "-T",
407
+ "10",
408
+ "-p",
409
+ String(port),
410
+ host
411
+ ]);
412
+ const lines = scanned.stdout.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("#")).map((l) => l.split(/\s+/)).filter((w) => w.length >= 3).map((w) => `${alias} ${w[1]} ${w[2]}`);
413
+ if (!lines.length) throw new InfraError(`Daytona's SSH gateway at ${host}:${port} gave no host key: ${scanned.stderr.trim().slice(-300) || "ssh-keyscan found none"}`);
414
+ return `${lines.join("\n")}\n`;
415
+ }
416
+ /**
417
+ * The organization's pool. Daytona says no start limits up front, so the pool starts what the run
418
+ * asks for, up to `maxConcurrent`, and holds every start back for a 429's `Retry-After`.
419
+ */
420
+ const openDaytonaPool = async (sandbox, o) => {
421
+ const api = await daytonaClient(sandbox, o.root);
422
+ const k = sandbox.attemptsPerMachine ?? 1;
423
+ const start = o.image;
424
+ const image = start?.dockerfile ? await sdkImage(start, o.root) : void 0;
425
+ return {
426
+ provider: daytonaPoolProvider(sandbox, api, o.runId, start && {
427
+ ...start,
428
+ image
429
+ }),
430
+ options: {
431
+ limits: {
432
+ machines: sandbox.maxConcurrent ? Math.ceil(sandbox.maxConcurrent / k) : 1e3,
433
+ startsPerMinute: null,
434
+ startsPerHour: null
435
+ },
436
+ attemptsPerMachine: k,
437
+ reuse: sandbox.reuse ?? false
438
+ }
439
+ };
440
+ };
441
+ /** Starting, keeping and removing `descriptor`'s sandboxes for the run's pool, in the main process. */
442
+ function daytonaPoolProvider(descriptor, api, runId, start) {
443
+ const size = descriptor.size ?? "medium";
444
+ const snapshot = start ? start.snapshot : snapshotOf(descriptor);
445
+ const loginRoot = start !== void 0;
446
+ const labels = runLabels(descriptor, runId);
447
+ const extra = sandboxLabels();
448
+ const made = /* @__PURE__ */ new Map();
449
+ const remove = async (sandbox) => {
450
+ await sandbox.delete().catch((error) => {
451
+ if (statusOf(error) !== 404) throw error;
452
+ });
453
+ };
454
+ return {
455
+ helper: "daytona()",
456
+ rateLimited: (error) => error instanceof DaytonaRateLimited ? { retryAfterMs: error.retryAfterMs } : null,
457
+ async keepAlive(id, ttlSeconds) {
458
+ const sandbox = made.get(id)?.sandbox ?? await whileLimited("calls", () => api.get(id));
459
+ await whileLimited("calls", () => sandbox.setTtl(Math.ceil(ttlSeconds / 60)));
460
+ },
461
+ async remove(id) {
462
+ const entry = made.get(id);
463
+ made.delete(id);
464
+ await remove(entry?.sandbox ?? await api.get(id).catch(() => null) ?? never(id)).catch(() => {});
465
+ if (entry) await rm(entry.dir, {
466
+ recursive: true,
467
+ force: true
468
+ });
469
+ },
470
+ async start(signal, ttlSeconds) {
471
+ const name = `${descriptor.prefix}-${labels["reeval-run"]}-${randomBytes(3).toString("hex")}`;
472
+ const dir = await mkdtemp(join(tmpdir(), "reeval-daytona-"));
473
+ let sandbox;
474
+ try {
475
+ const created = await abortable(api.create({
476
+ name,
477
+ ...snapshot ? { snapshot } : {
478
+ image: start?.image,
479
+ resources: resourcesOf(size)
480
+ },
481
+ labels: {
482
+ ...extra,
483
+ ...labels
484
+ },
485
+ autoStopInterval: 0,
486
+ ephemeral: true,
487
+ ttlMinutes: Math.ceil(ttlSeconds / 60)
488
+ }, { timeout: snapshot ? START_TIMEOUT_S : BUILD_TIMEOUT_S }), signal, (late) => remove(late).catch(() => {})).catch(async (error) => {
489
+ if (signal.aborted) throw error;
490
+ const limited = rateLimited(error, "starts");
491
+ if (limited) throw limited;
492
+ const id = error.sandboxId;
493
+ if (id) await api.get(id).then(remove, () => {});
494
+ throw new InfraError(`Daytona didn't start a sandbox: ${messageOf(error)}`);
495
+ });
496
+ sandbox = created;
497
+ const access = await whileLimited("calls", () => created.createSshAccess(SSH_TOKEN_MINUTES), signal).catch((error) => {
498
+ if (signal.aborted) throw error;
499
+ throw new InfraError(`Daytona didn't give SSH access: ${messageOf(error)}`);
500
+ });
501
+ registerSecret(access.token);
502
+ const target = sshTarget(access.sshCommand);
503
+ if (!target) throw new InfraError(`Daytona gave sandbox ${sandbox.id} no SSH destination to connect to (got ${JSON.stringify(redactSecrets(access.sshCommand))})`);
504
+ const key = await newKey(dir, "Daytona");
505
+ const knownHostsFile = join(dir, "known_hosts");
506
+ await writeFile(knownHostsFile, await hostKeys(target.host, target.port, sandbox.id));
507
+ signal.throwIfAborted();
508
+ made.set(sandbox.id, {
509
+ sandbox,
510
+ dir
511
+ });
512
+ return {
513
+ id: sandbox.id,
514
+ info: {
515
+ id: sandbox.id,
516
+ name,
517
+ size,
518
+ host: target.host,
519
+ port: target.port,
520
+ user: target.user,
521
+ identityFile: key.file,
522
+ knownHostsFile,
523
+ route: `${target.host}:${target.port} (Daytona's SSH gateway)`,
524
+ secretUser: true,
525
+ ...loginRoot && { loginRoot: true },
526
+ ...start?.harnessBaked && { harnessBaked: true }
527
+ }
528
+ };
529
+ } catch (error) {
530
+ if (sandbox) await remove(sandbox).catch(() => {});
531
+ await rm(dir, {
532
+ recursive: true,
533
+ force: true
534
+ });
535
+ throw error;
536
+ }
537
+ }
538
+ };
539
+ }
540
+ const never = (id) => {
541
+ throw new Error(`no Daytona sandbox ${id}`);
542
+ };
543
+ async function createDaytonaSandbox(descriptor, options) {
544
+ let start;
545
+ if (options.harness) {
546
+ const { preparedFor } = await import("./preflight-dJqs5x3r.js");
547
+ const { daytonaProvider } = await import("./providers-DxZ26YoG.js");
548
+ const handle = preparedFor(process.cwd(), options.runId, daytonaProvider(), descriptor, options.harness);
549
+ start = handle ? daytonaStart(handle) : void 0;
550
+ }
551
+ const { image, from, dockerfile, install } = descriptor;
552
+ if (!start && (image ?? from ?? dockerfile ?? install) !== void 0) throw new InfraError("The daytona() sandbox's image wasn't prepared before the run started");
553
+ return createPooledSshSandbox(descriptor, options, {
554
+ ...start && { image: start },
555
+ helper: "daytona()",
556
+ sandbox: "daytona",
557
+ size: descriptor.size ?? "medium",
558
+ description: (info) => `daytona sandbox ${info.id} (${info.size})`
559
+ });
560
+ }
561
+ /**
562
+ * Deletes every sandbox the run left on each organization and prefix in `sandboxes`, found by the
563
+ * run's labels: another prefix, or another run's tag, is someone else's.
564
+ */
565
+ async function removeRunSandboxes(runId, sandboxes) {
566
+ const seen = /* @__PURE__ */ new Set();
567
+ for (const sandbox of sandboxes) {
568
+ const key = `${sandbox.apiKey.from}\0${sandbox.prefix}`;
569
+ if (seen.has(key) || daytonaKeyProblem(sandbox)) continue;
570
+ seen.add(key);
571
+ const api = await daytonaClient(sandbox).catch(() => null);
572
+ if (!api) continue;
573
+ const deadline = AbortSignal.timeout(CLEANUP_TIMEOUT_MS);
574
+ const work = (async () => {
575
+ const left = [];
576
+ for await (const s of api.list({
577
+ labels: runLabels(sandbox, runId),
578
+ limit: 100
579
+ })) left.push(s);
580
+ await Promise.all(left.map((s) => s.delete().catch(() => {})));
581
+ })().catch(() => {});
582
+ await Promise.race([work, new Promise((resolve) => deadline.addEventListener("abort", () => resolve()))]);
583
+ }
584
+ }
585
+ /** The machines and attempts the run's pool keeps going: `maxConcurrent`'s, when it's set. */
586
+ async function daytonaCapacity(sandbox) {
587
+ if (!sandbox.maxConcurrent) return null;
588
+ const k = sandbox.attemptsPerMachine ?? 1;
589
+ return {
590
+ machines: Math.ceil(sandbox.maxConcurrent / k),
591
+ attempts: sandbox.maxConcurrent
592
+ };
593
+ }
594
+ /** The host's OpenSSH tools a Daytona sandbox runs on, or the first one missing. */
595
+ const missingDaytonaSshTool = () => missingSshTool([
596
+ ["ssh", ["-V"]],
597
+ ["ssh-keygen", ["-?"]],
598
+ ["ssh-keyscan", ["-?"]]
599
+ ]);
600
+ /**
601
+ * Preflight's check of one organization: the host has OpenSSH, the key is set, the SDK loads, and
602
+ * Daytona takes the key (listing the run's sandboxes, which it refuses for a bad one).
603
+ */
604
+ async function checkDaytona(sandbox, projectRoot) {
605
+ try {
606
+ sandboxLabels();
607
+ } catch (error) {
608
+ throw usage(error.message);
609
+ }
610
+ const tool = await missingDaytonaSshTool();
611
+ if (tool) throw usage(`daytona() runs every command over SSH, and there's no ${tool} on PATH: install an OpenSSH client (openssh-client on Debian and Ubuntu)`);
612
+ const api = await daytonaClient(sandbox, projectRoot);
613
+ try {
614
+ for await (const _ of api.list({
615
+ labels: runLabels(sandbox, "preflight"),
616
+ limit: 1
617
+ })) break;
618
+ } catch (error) {
619
+ const code = statusOf(error);
620
+ if (code === 401 || code === 403) throw usage(`Daytona refused the API key in ${sandbox.apiKey.from}: ${messageOf(error)}`);
621
+ throw new PrepareError({
622
+ class: "transient",
623
+ stage: "daytona",
624
+ ref: null,
625
+ cause: null,
626
+ log: null,
627
+ message: `Couldn't reach Daytona: ${messageOf(error)}`
628
+ });
629
+ }
630
+ }
631
+ /** `reeval doctor`: the OpenSSH client, and each Daytona organization `sandboxes` use. */
632
+ async function daytonaDoctor(sandboxes, ctx) {
633
+ const accounts = /* @__PURE__ */ new Map();
634
+ for (const sandbox of sandboxes) accounts.set(sandbox.apiKey.from, sandbox);
635
+ if (!accounts.size) return [];
636
+ const missing = await ctx.deps.missingSshTool();
637
+ const checks = [missing ? {
638
+ id: "ssh",
639
+ status: "fail",
640
+ summary: `daytona() runs every command over SSH, and there's no ${missing} on PATH`,
641
+ fix: "install an OpenSSH client (openssh-client on Debian and Ubuntu)"
642
+ } : {
643
+ id: "ssh",
644
+ status: "ok",
645
+ summary: "an OpenSSH client for daytona()"
646
+ }];
647
+ for (const sandbox of accounts.values()) {
648
+ const key = sandbox.apiKey.from;
649
+ if (!ctx.deps.env[key]) {
650
+ checks.push({
651
+ id: "daytona",
652
+ status: "fail",
653
+ summary: `daytona() needs a Daytona API key in ${key}, which isn't set`,
654
+ fix: `set ${key} in ${ctx.envFile}`
655
+ });
656
+ continue;
657
+ }
658
+ try {
659
+ await ctx.deps.daytonaAccount(sandbox, ctx.root, ctx.online);
660
+ checks.push({
661
+ id: "daytona",
662
+ status: "ok",
663
+ summary: ctx.online ? `Daytona takes the key in ${key}` : `Daytona's SDK loads, and ${key} is set (--online asks Daytona whether it takes the key)`
664
+ });
665
+ } catch (error) {
666
+ checks.push({
667
+ id: "daytona",
668
+ status: "fail",
669
+ summary: redactSecrets(error.message)
670
+ });
671
+ }
672
+ }
673
+ return checks;
674
+ }
675
+ export { checkDaytona, createDaytonaSandbox, daytonaCapacity, daytonaClient, daytonaDoctor, daytonaStart, loadDaytonaSdk, openDaytonaPool, prepareDaytona, removeRunSandboxes };
676
+
677
+ //# sourceMappingURL=daytona-Dfhwtr9P.js.map