@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.13

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 (429) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/LICENSE +21 -0
  3. package/README.md +110 -2
  4. package/dist/cjs/BunFileSystem.d.ts +44 -0
  5. package/dist/cjs/BunFileSystem.d.ts.map +1 -0
  6. package/dist/cjs/BunFileSystem.js +38 -0
  7. package/dist/cjs/BunFileSystem.js.map +7 -0
  8. package/dist/cjs/BunHost.d.ts +205 -0
  9. package/dist/cjs/BunHost.d.ts.map +1 -0
  10. package/dist/cjs/BunHost.js +148 -0
  11. package/dist/cjs/BunHost.js.map +7 -0
  12. package/dist/cjs/index.d.ts +26 -0
  13. package/dist/cjs/index.d.ts.map +1 -0
  14. package/dist/cjs/index.js +37 -0
  15. package/dist/cjs/index.js.map +7 -0
  16. package/dist/cjs/package.json +1 -0
  17. package/dist/esm/BunFileSystem.d.ts +44 -0
  18. package/dist/esm/BunFileSystem.d.ts.map +1 -0
  19. package/dist/esm/BunFileSystem.js +35 -0
  20. package/dist/esm/BunFileSystem.js.map +1 -0
  21. package/dist/esm/BunHost.d.ts +205 -0
  22. package/dist/esm/BunHost.d.ts.map +1 -0
  23. package/dist/esm/BunHost.js +248 -0
  24. package/dist/esm/BunHost.js.map +1 -0
  25. package/dist/esm/index.d.ts +26 -0
  26. package/dist/esm/index.d.ts.map +1 -0
  27. package/dist/esm/index.js +26 -0
  28. package/dist/esm/index.js.map +1 -0
  29. package/dist/vendor/adapters.json +3067 -0
  30. package/dist/vendor/bun/BunAddressResolver.d.ts +15 -0
  31. package/dist/vendor/bun/BunAddressResolver.js +8 -0
  32. package/dist/vendor/bun/BunChildProcessSpawner.d.ts +8 -0
  33. package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
  34. package/dist/vendor/bun/BunClusterHttp.d.ts +76 -0
  35. package/dist/vendor/bun/BunClusterHttp.js +39 -0
  36. package/dist/vendor/bun/BunClusterSocket.d.ts +70 -0
  37. package/dist/vendor/bun/BunClusterSocket.js +22 -0
  38. package/dist/vendor/bun/BunCrypto.d.ts +11 -0
  39. package/dist/vendor/bun/BunCrypto.js +8 -0
  40. package/dist/vendor/bun/BunDatagramSocket.d.ts +227 -0
  41. package/dist/vendor/bun/BunDatagramSocket.js +11 -0
  42. package/dist/vendor/bun/BunDns.d.ts +72 -0
  43. package/dist/vendor/bun/BunDns.js +12 -0
  44. package/dist/vendor/bun/BunFileSystem.d.ts +11 -0
  45. package/dist/vendor/bun/BunFileSystem.js +9 -0
  46. package/dist/vendor/bun/BunHttpClient.d.ts +10 -0
  47. package/dist/vendor/bun/BunHttpClient.js +1 -0
  48. package/dist/vendor/bun/BunHttpPlatform.d.ts +11 -0
  49. package/dist/vendor/bun/BunHttpPlatform.js +11 -0
  50. package/dist/vendor/bun/BunHttpServer.d.ts +151 -0
  51. package/dist/vendor/bun/BunHttpServer.js +38 -0
  52. package/dist/vendor/bun/BunHttpServerRequest.d.ts +20 -0
  53. package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
  54. package/dist/vendor/bun/BunMultipart.d.ts +34 -0
  55. package/dist/vendor/bun/BunMultipart.js +12 -0
  56. package/dist/vendor/bun/BunPath.d.ts +27 -0
  57. package/dist/vendor/bun/BunPath.js +12 -0
  58. package/dist/vendor/bun/BunRedis.d.ts +53 -0
  59. package/dist/vendor/bun/BunRedis.js +11 -0
  60. package/dist/vendor/bun/BunRuntime.d.ts +88 -0
  61. package/dist/vendor/bun/BunRuntime.js +8 -0
  62. package/dist/vendor/bun/BunServices.d.ts +37 -0
  63. package/dist/vendor/bun/BunServices.js +23 -0
  64. package/dist/vendor/bun/BunSink.d.ts +9 -0
  65. package/dist/vendor/bun/BunSink.js +12 -0
  66. package/dist/vendor/bun/BunSocket.d.ts +45 -0
  67. package/dist/vendor/bun/BunSocket.js +29 -0
  68. package/dist/vendor/bun/BunSocketServer.d.ts +9 -0
  69. package/dist/vendor/bun/BunSocketServer.js +21 -0
  70. package/dist/vendor/bun/BunStdio.d.ts +12 -0
  71. package/dist/vendor/bun/BunStdio.js +10 -0
  72. package/dist/vendor/bun/BunStream.d.ts +20 -0
  73. package/dist/vendor/bun/BunStream.js +30 -0
  74. package/dist/vendor/bun/BunTerminal.d.ts +24 -0
  75. package/dist/vendor/bun/BunTerminal.js +10 -0
  76. package/dist/vendor/bun/BunWorker.d.ts +22 -0
  77. package/dist/vendor/bun/BunWorker.js +9 -0
  78. package/dist/vendor/bun/BunWorkerRunner.d.ts +13 -0
  79. package/dist/vendor/bun/BunWorkerRunner.js +7 -0
  80. package/dist/vendor/bun/LICENSE +21 -0
  81. package/dist/vendor/bun/index.d.ts +130 -0
  82. package/dist/vendor/bun/index.js +121 -0
  83. package/dist/vendor/chunk-226TYKP6.js +60 -0
  84. package/dist/vendor/chunk-2ADOI6ZN.js +18 -0
  85. package/dist/vendor/chunk-2AP6TO77.js +71 -0
  86. package/dist/vendor/chunk-2LGUVSNM.js +20 -0
  87. package/dist/vendor/chunk-3SUO3TTE.js +40 -0
  88. package/dist/vendor/chunk-4O4Z52A2.js +48 -0
  89. package/dist/vendor/chunk-4YK2MHSO.js +20 -0
  90. package/dist/vendor/chunk-6B775XB2.js +85 -0
  91. package/dist/vendor/chunk-6KYVM2ZC.js +419 -0
  92. package/dist/vendor/chunk-6QPSLCUZ.js +0 -0
  93. package/dist/vendor/chunk-6R444NFO.js +104 -0
  94. package/dist/vendor/chunk-7JOAEKDV.js +503 -0
  95. package/dist/vendor/chunk-7VJC3PHX.js +63 -0
  96. package/dist/vendor/chunk-7ZKNPDTP.js +26 -0
  97. package/dist/vendor/chunk-ABPRHPJP.js +15 -0
  98. package/dist/vendor/chunk-AMAL6TRE.js +93 -0
  99. package/dist/vendor/chunk-AW6WQVI7.js +29 -0
  100. package/dist/vendor/chunk-BHV44Z6K.js +36 -0
  101. package/dist/vendor/chunk-BIR74JJK.js +93 -0
  102. package/dist/vendor/chunk-BTXZUHUI.js +7 -0
  103. package/dist/vendor/chunk-BVV46N3V.js +515 -0
  104. package/dist/vendor/chunk-C7UMBJO6.js +31 -0
  105. package/dist/vendor/chunk-CN4K2U6M.js +20 -0
  106. package/dist/vendor/chunk-D6XNHJPW.js +18 -0
  107. package/dist/vendor/chunk-DHTPLWAP.js +34 -0
  108. package/dist/vendor/chunk-DWSNOBD4.js +18 -0
  109. package/dist/vendor/chunk-DX4VFONH.js +81 -0
  110. package/dist/vendor/chunk-EIO7BKW3.js +63 -0
  111. package/dist/vendor/chunk-FIPFWLCV.js +144 -0
  112. package/dist/vendor/chunk-GITB76ZP.js +22 -0
  113. package/dist/vendor/chunk-GMORYZG4.js +62 -0
  114. package/dist/vendor/chunk-HXGVOKHF.js +22 -0
  115. package/dist/vendor/chunk-HYPKWCVW.js +374 -0
  116. package/dist/vendor/chunk-IJON5WTO.js +34 -0
  117. package/dist/vendor/chunk-IXI7RW3A.js +580 -0
  118. package/dist/vendor/chunk-J43O5GFH.js +28 -0
  119. package/dist/vendor/chunk-JTST2Z7N.js +58 -0
  120. package/dist/vendor/chunk-JYD572EF.js +18 -0
  121. package/dist/vendor/chunk-K6GWBGJM.js +16 -0
  122. package/dist/vendor/chunk-KANNAI65.js +62 -0
  123. package/dist/vendor/chunk-KEMBVIRS.js +128 -0
  124. package/dist/vendor/chunk-LOB26XOO.js +0 -0
  125. package/dist/vendor/chunk-M2QOSF47.js +53 -0
  126. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  127. package/dist/vendor/chunk-NGGMPIWR.js +65 -0
  128. package/dist/vendor/chunk-NNTJGFLB.js +21 -0
  129. package/dist/vendor/chunk-NU53DHQR.js +18 -0
  130. package/dist/vendor/chunk-OAY4MA3I.js +28 -0
  131. package/dist/vendor/chunk-OV2KKGBA.js +16 -0
  132. package/dist/vendor/chunk-PBM2HJOX.js +118 -0
  133. package/dist/vendor/chunk-Q5UCOQNO.js +70 -0
  134. package/dist/vendor/chunk-Q7YXUH7M.js +414 -0
  135. package/dist/vendor/chunk-QKYYD3AZ.js +131 -0
  136. package/dist/vendor/chunk-QLI7T34M.js +18 -0
  137. package/dist/vendor/chunk-QR2ZOVOL.js +18 -0
  138. package/dist/vendor/chunk-R2PFJKSP.js +274 -0
  139. package/dist/vendor/chunk-RX5TKFP7.js +51 -0
  140. package/dist/vendor/chunk-S3MN5OXB.js +34 -0
  141. package/dist/vendor/chunk-T5WDTZCE.js +249 -0
  142. package/dist/vendor/chunk-TBMTA5LD.js +14 -0
  143. package/dist/vendor/chunk-TCKM3JXD.js +325 -0
  144. package/dist/vendor/chunk-UXIG7ALP.js +229 -0
  145. package/dist/vendor/chunk-V577GRCI.js +438 -0
  146. package/dist/vendor/chunk-VS6VBUH6.js +57 -0
  147. package/dist/vendor/chunk-WGUQHMX2.js +18 -0
  148. package/dist/vendor/chunk-WNS3OER2.js +18 -0
  149. package/dist/vendor/chunk-X6FYP2EH.js +109 -0
  150. package/dist/vendor/chunk-XAVBQY4D.js +20 -0
  151. package/dist/vendor/chunk-XAZH2ZEU.js +43 -0
  152. package/dist/vendor/chunk-XDPP24MG.js +129 -0
  153. package/dist/vendor/chunk-XF3WZCMZ.js +26 -0
  154. package/dist/vendor/chunk-XXVMTKX5.js +0 -0
  155. package/dist/vendor/chunk-YJGNV6EV.js +85 -0
  156. package/dist/vendor/chunk-ZJEHEPDQ.js +18 -0
  157. package/dist/vendor/cjs/bun/BunAddressResolver.d.ts +15 -0
  158. package/dist/vendor/cjs/bun/BunAddressResolver.js +1 -0
  159. package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +8 -0
  160. package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
  161. package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +76 -0
  162. package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
  163. package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +70 -0
  164. package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
  165. package/dist/vendor/cjs/bun/BunCrypto.d.ts +11 -0
  166. package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
  167. package/dist/vendor/cjs/bun/BunDatagramSocket.d.ts +227 -0
  168. package/dist/vendor/cjs/bun/BunDatagramSocket.js +1 -0
  169. package/dist/vendor/cjs/bun/BunDns.d.ts +72 -0
  170. package/dist/vendor/cjs/bun/BunDns.js +1 -0
  171. package/dist/vendor/cjs/bun/BunFileSystem.d.ts +11 -0
  172. package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
  173. package/dist/vendor/cjs/bun/BunHttpClient.d.ts +10 -0
  174. package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
  175. package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +11 -0
  176. package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
  177. package/dist/vendor/cjs/bun/BunHttpServer.d.ts +151 -0
  178. package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
  179. package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +20 -0
  180. package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
  181. package/dist/vendor/cjs/bun/BunMultipart.d.ts +34 -0
  182. package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
  183. package/dist/vendor/cjs/bun/BunPath.d.ts +27 -0
  184. package/dist/vendor/cjs/bun/BunPath.js +1 -0
  185. package/dist/vendor/cjs/bun/BunRedis.d.ts +53 -0
  186. package/dist/vendor/cjs/bun/BunRedis.js +1 -0
  187. package/dist/vendor/cjs/bun/BunRuntime.d.ts +88 -0
  188. package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
  189. package/dist/vendor/cjs/bun/BunServices.d.ts +37 -0
  190. package/dist/vendor/cjs/bun/BunServices.js +1 -0
  191. package/dist/vendor/cjs/bun/BunSink.d.ts +9 -0
  192. package/dist/vendor/cjs/bun/BunSink.js +1 -0
  193. package/dist/vendor/cjs/bun/BunSocket.d.ts +45 -0
  194. package/dist/vendor/cjs/bun/BunSocket.js +1 -0
  195. package/dist/vendor/cjs/bun/BunSocketServer.d.ts +9 -0
  196. package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
  197. package/dist/vendor/cjs/bun/BunStdio.d.ts +12 -0
  198. package/dist/vendor/cjs/bun/BunStdio.js +1 -0
  199. package/dist/vendor/cjs/bun/BunStream.d.ts +20 -0
  200. package/dist/vendor/cjs/bun/BunStream.js +1 -0
  201. package/dist/vendor/cjs/bun/BunTerminal.d.ts +24 -0
  202. package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
  203. package/dist/vendor/cjs/bun/BunWorker.d.ts +22 -0
  204. package/dist/vendor/cjs/bun/BunWorker.js +1 -0
  205. package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +13 -0
  206. package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
  207. package/dist/vendor/cjs/bun/index.d.ts +130 -0
  208. package/dist/vendor/cjs/bun/index.js +1 -0
  209. package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
  210. package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
  211. package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +8 -0
  212. package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
  213. package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +54 -0
  214. package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
  215. package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +85 -0
  216. package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
  217. package/dist/vendor/cjs/node/NodeCrypto.d.ts +11 -0
  218. package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
  219. package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
  220. package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
  221. package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
  222. package/dist/vendor/cjs/node/NodeDns.js +1 -0
  223. package/dist/vendor/cjs/node/NodeFileSystem.d.ts +11 -0
  224. package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
  225. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +303 -0
  226. package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
  227. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +64 -0
  228. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
  229. package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +38 -0
  230. package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
  231. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +131 -0
  232. package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
  233. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +32 -0
  234. package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
  235. package/dist/vendor/cjs/node/NodeMultipart.d.ts +50 -0
  236. package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
  237. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +105 -0
  238. package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
  239. package/dist/vendor/cjs/node/NodePath.d.ts +30 -0
  240. package/dist/vendor/cjs/node/NodePath.js +1 -0
  241. package/dist/vendor/cjs/node/NodeRedis.d.ts +78 -0
  242. package/dist/vendor/cjs/node/NodeRedis.js +1 -0
  243. package/dist/vendor/cjs/node/NodeRuntime.d.ts +88 -0
  244. package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
  245. package/dist/vendor/cjs/node/NodeServices.d.ts +37 -0
  246. package/dist/vendor/cjs/node/NodeServices.js +1 -0
  247. package/dist/vendor/cjs/node/NodeSink.d.ts +9 -0
  248. package/dist/vendor/cjs/node/NodeSink.js +1 -0
  249. package/dist/vendor/cjs/node/NodeSocket.d.ts +45 -0
  250. package/dist/vendor/cjs/node/NodeSocket.js +1 -0
  251. package/dist/vendor/cjs/node/NodeSocketServer.d.ts +9 -0
  252. package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
  253. package/dist/vendor/cjs/node/NodeStdio.d.ts +12 -0
  254. package/dist/vendor/cjs/node/NodeStdio.js +1 -0
  255. package/dist/vendor/cjs/node/NodeStream.d.ts +9 -0
  256. package/dist/vendor/cjs/node/NodeStream.js +1 -0
  257. package/dist/vendor/cjs/node/NodeTerminal.d.ts +24 -0
  258. package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
  259. package/dist/vendor/cjs/node/NodeWorker.d.ts +24 -0
  260. package/dist/vendor/cjs/node/NodeWorker.js +1 -0
  261. package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +13 -0
  262. package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
  263. package/dist/vendor/cjs/node/Undici.d.ts +31 -0
  264. package/dist/vendor/cjs/node/Undici.js +1 -0
  265. package/dist/vendor/cjs/node/index.d.ts +140 -0
  266. package/dist/vendor/cjs/node/index.js +1 -0
  267. package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
  268. package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
  269. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +66 -0
  270. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
  271. package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +35 -0
  272. package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
  273. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +30 -0
  274. package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
  275. package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
  276. package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
  277. package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
  278. package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
  279. package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +12 -0
  280. package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
  281. package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +40 -0
  282. package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
  283. package/dist/vendor/cjs/node-shared/NodePath.d.ts +30 -0
  284. package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
  285. package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +51 -0
  286. package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
  287. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +73 -0
  288. package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
  289. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +144 -0
  290. package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
  291. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +87 -0
  292. package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
  293. package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +13 -0
  294. package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
  295. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +194 -0
  296. package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
  297. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +24 -0
  298. package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
  299. package/dist/vendor/cjs/node-shared/index.d.ts +85 -0
  300. package/dist/vendor/cjs/node-shared/index.js +1 -0
  301. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  302. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
  303. package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
  304. package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
  305. package/dist/vendor/cjs/package.json +1 -0
  306. package/dist/vendor/cjs/platform-bun.d.ts +130 -0
  307. package/dist/vendor/cjs/platform-bun.js +1 -0
  308. package/dist/vendor/cjs/platform-node-shared.d.ts +85 -0
  309. package/dist/vendor/cjs/platform-node-shared.js +1 -0
  310. package/dist/vendor/cjs/platform-node.d.ts +140 -0
  311. package/dist/vendor/cjs/platform-node.js +1 -0
  312. package/dist/vendor/node/LICENSE +21 -0
  313. package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
  314. package/dist/vendor/node/NodeAddressResolver.js +8 -0
  315. package/dist/vendor/node/NodeChildProcessSpawner.d.ts +8 -0
  316. package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
  317. package/dist/vendor/node/NodeClusterHttp.d.ts +54 -0
  318. package/dist/vendor/node/NodeClusterHttp.js +43 -0
  319. package/dist/vendor/node/NodeClusterSocket.d.ts +85 -0
  320. package/dist/vendor/node/NodeClusterSocket.js +30 -0
  321. package/dist/vendor/node/NodeCrypto.d.ts +11 -0
  322. package/dist/vendor/node/NodeCrypto.js +8 -0
  323. package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
  324. package/dist/vendor/node/NodeDatagramSocket.js +12 -0
  325. package/dist/vendor/node/NodeDns.d.ts +51 -0
  326. package/dist/vendor/node/NodeDns.js +12 -0
  327. package/dist/vendor/node/NodeFileSystem.d.ts +11 -0
  328. package/dist/vendor/node/NodeFileSystem.js +9 -0
  329. package/dist/vendor/node/NodeHttpClient.d.ts +303 -0
  330. package/dist/vendor/node/NodeHttpClient.js +54 -0
  331. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +64 -0
  332. package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
  333. package/dist/vendor/node/NodeHttpPlatform.d.ts +38 -0
  334. package/dist/vendor/node/NodeHttpPlatform.js +16 -0
  335. package/dist/vendor/node/NodeHttpServer.d.ts +131 -0
  336. package/dist/vendor/node/NodeHttpServer.js +46 -0
  337. package/dist/vendor/node/NodeHttpServerRequest.d.ts +32 -0
  338. package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
  339. package/dist/vendor/node/NodeMultipart.d.ts +50 -0
  340. package/dist/vendor/node/NodeMultipart.js +15 -0
  341. package/dist/vendor/node/NodeMultipartParser.d.ts +105 -0
  342. package/dist/vendor/node/NodeMultipartParser.js +11 -0
  343. package/dist/vendor/node/NodePath.d.ts +30 -0
  344. package/dist/vendor/node/NodePath.js +12 -0
  345. package/dist/vendor/node/NodeRedis.d.ts +78 -0
  346. package/dist/vendor/node/NodeRedis.js +11 -0
  347. package/dist/vendor/node/NodeRuntime.d.ts +88 -0
  348. package/dist/vendor/node/NodeRuntime.js +8 -0
  349. package/dist/vendor/node/NodeServices.d.ts +37 -0
  350. package/dist/vendor/node/NodeServices.js +23 -0
  351. package/dist/vendor/node/NodeSink.d.ts +9 -0
  352. package/dist/vendor/node/NodeSink.js +12 -0
  353. package/dist/vendor/node/NodeSocket.d.ts +45 -0
  354. package/dist/vendor/node/NodeSocket.js +31 -0
  355. package/dist/vendor/node/NodeSocketServer.d.ts +9 -0
  356. package/dist/vendor/node/NodeSocketServer.js +21 -0
  357. package/dist/vendor/node/NodeStdio.d.ts +12 -0
  358. package/dist/vendor/node/NodeStdio.js +10 -0
  359. package/dist/vendor/node/NodeStream.d.ts +9 -0
  360. package/dist/vendor/node/NodeStream.js +27 -0
  361. package/dist/vendor/node/NodeTerminal.d.ts +24 -0
  362. package/dist/vendor/node/NodeTerminal.js +10 -0
  363. package/dist/vendor/node/NodeWorker.d.ts +24 -0
  364. package/dist/vendor/node/NodeWorker.js +9 -0
  365. package/dist/vendor/node/NodeWorkerRunner.d.ts +13 -0
  366. package/dist/vendor/node/NodeWorkerRunner.js +7 -0
  367. package/dist/vendor/node/Undici.d.ts +31 -0
  368. package/dist/vendor/node/Undici.js +9 -0
  369. package/dist/vendor/node/index.d.ts +140 -0
  370. package/dist/vendor/node/index.js +130 -0
  371. package/dist/vendor/node-shared/LICENSE +21 -0
  372. package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
  373. package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
  374. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +66 -0
  375. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
  376. package/dist/vendor/node-shared/NodeClusterSocket.d.ts +35 -0
  377. package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
  378. package/dist/vendor/node-shared/NodeCrypto.d.ts +30 -0
  379. package/dist/vendor/node-shared/NodeCrypto.js +9 -0
  380. package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
  381. package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
  382. package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
  383. package/dist/vendor/node-shared/NodeDns.js +31 -0
  384. package/dist/vendor/node-shared/NodeFileSystem.d.ts +12 -0
  385. package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
  386. package/dist/vendor/node-shared/NodeHttpCompression.d.ts +40 -0
  387. package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
  388. package/dist/vendor/node-shared/NodePath.d.ts +30 -0
  389. package/dist/vendor/node-shared/NodePath.js +11 -0
  390. package/dist/vendor/node-shared/NodeRuntime.d.ts +51 -0
  391. package/dist/vendor/node-shared/NodeRuntime.js +7 -0
  392. package/dist/vendor/node-shared/NodeSink.d.ts +73 -0
  393. package/dist/vendor/node-shared/NodeSink.js +11 -0
  394. package/dist/vendor/node-shared/NodeSocket.d.ts +144 -0
  395. package/dist/vendor/node-shared/NodeSocket.js +23 -0
  396. package/dist/vendor/node-shared/NodeSocketServer.d.ts +87 -0
  397. package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
  398. package/dist/vendor/node-shared/NodeStdio.d.ts +13 -0
  399. package/dist/vendor/node-shared/NodeStdio.js +9 -0
  400. package/dist/vendor/node-shared/NodeStream.d.ts +194 -0
  401. package/dist/vendor/node-shared/NodeStream.js +26 -0
  402. package/dist/vendor/node-shared/NodeTerminal.d.ts +24 -0
  403. package/dist/vendor/node-shared/NodeTerminal.js +9 -0
  404. package/dist/vendor/node-shared/index.d.ts +85 -0
  405. package/dist/vendor/node-shared/index.js +70 -0
  406. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  407. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
  408. package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
  409. package/dist/vendor/node-shared/internal/utils.js +7 -0
  410. package/dist/vendor/platform-bun.d.ts +130 -0
  411. package/dist/vendor/platform-bun.js +121 -0
  412. package/dist/vendor/platform-node-shared.d.ts +85 -0
  413. package/dist/vendor/platform-node-shared.js +70 -0
  414. package/dist/vendor/platform-node.d.ts +140 -0
  415. package/dist/vendor/platform-node.js +130 -0
  416. package/docs/README.md +135 -0
  417. package/docs/api.md +264 -0
  418. package/docs/concepts/host-surface.md +152 -0
  419. package/docs/concepts/runtime-parity.md +80 -0
  420. package/docs/guides/bind-a-repository-root.md +109 -0
  421. package/docs/guides/configure-the-filesystem-helper.md +113 -0
  422. package/docs/guides/contain-child-processes.md +178 -0
  423. package/docs/installation.md +131 -0
  424. package/docs/quickstart.md +163 -0
  425. package/docs/troubleshooting.md +163 -0
  426. package/package.json +146 -3
  427. package/src/BunFileSystem.ts +47 -0
  428. package/src/BunHost.ts +345 -0
  429. package/src/index.ts +27 -0
@@ -0,0 +1,580 @@
1
+ import {
2
+ buildSpawnOptions
3
+ } from "./chunk-TBMTA5LD.js";
4
+ import {
5
+ fromReadable
6
+ } from "./chunk-T5WDTZCE.js";
7
+ import {
8
+ fromWritable
9
+ } from "./chunk-DX4VFONH.js";
10
+ import {
11
+ handleErrnoException
12
+ } from "./chunk-3SUO3TTE.js";
13
+ import {
14
+ __export
15
+ } from "./chunk-MLKGABMK.js";
16
+
17
+ // ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.5_effect@4.0.5/node_modules/@effect/platform-node-shared/dist/NodeChildProcessSpawner.js
18
+ var NodeChildProcessSpawner_exports = {};
19
+ __export(NodeChildProcessSpawner_exports, {
20
+ flattenCommand: () => flattenCommand,
21
+ layer: () => layer
22
+ });
23
+ import * as Deferred from "effect/Deferred";
24
+ import * as Duration from "effect/Duration";
25
+ import * as Effect from "effect/Effect";
26
+ import * as Exit from "effect/Exit";
27
+ import * as FileSystem from "effect/FileSystem";
28
+ import * as Layer from "effect/Layer";
29
+ import * as Path from "effect/Path";
30
+ import * as Predicate from "effect/Predicate";
31
+ import * as ChildProcess from "effect/process/ChildProcess";
32
+ import { ChildProcessSpawner, ExitCode, make as makeSpawner, makeHandle, ProcessId } from "effect/process/ChildProcessSpawner";
33
+ import * as Sink from "effect/Sink";
34
+ import * as Stream from "effect/Stream";
35
+ import * as NodeChildProcess from "node:child_process";
36
+ import { PassThrough } from "node:stream";
37
+ var toError = (error) => error instanceof globalThis.Error ? error : new globalThis.Error(String(error));
38
+ var toPlatformError = (method, error, command) => {
39
+ const {
40
+ commands
41
+ } = flattenCommand(command);
42
+ const commandStr = commands.reduce((acc, curr) => {
43
+ const cmd = `${curr.command} ${curr.args.join(" ")}`;
44
+ return acc.length === 0 ? cmd : `${acc} | ${cmd}`;
45
+ }, "");
46
+ return handleErrnoException("ChildProcess", method)(error, [commandStr]);
47
+ };
48
+ var processGroupGraceMillis = 1e3;
49
+ var processGroupPollIntervalMillis = 10;
50
+ var handleInputErrors = (writable) => {
51
+ const onError = () => {
52
+ };
53
+ writable.on("error", onError);
54
+ writable.once("close", () => writable.off("error", onError));
55
+ };
56
+ var isProcessAlive = (childProcess, exitSignal) => {
57
+ if (!Deferred.isDoneUnsafe(exitSignal)) {
58
+ return true;
59
+ }
60
+ if (globalThis.process.platform === "win32") {
61
+ return false;
62
+ }
63
+ try {
64
+ globalThis.process.kill(-childProcess.pid, 0);
65
+ return true;
66
+ } catch {
67
+ return false;
68
+ }
69
+ };
70
+ var taskkill = (childProcess, onExit = () => {
71
+ }) => {
72
+ if (childProcess.exitCode !== null || childProcess.signalCode !== null) {
73
+ onExit(null);
74
+ return;
75
+ }
76
+ NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], {
77
+ windowsHide: true
78
+ }, onExit);
79
+ };
80
+ var make2 = /* @__PURE__ */ Effect.gen(function* () {
81
+ const fs = yield* FileSystem.FileSystem;
82
+ const path = yield* Path.Path;
83
+ const resolveWorkingDirectory = Effect.fnUntraced(function* (options) {
84
+ if (Predicate.isUndefined(options.cwd)) return void 0;
85
+ yield* fs.access(options.cwd);
86
+ return path.resolve(options.cwd);
87
+ });
88
+ const resolveEnvironment = (options) => {
89
+ return options.extendEnv ? {
90
+ ...globalThis.process.env,
91
+ ...options.env
92
+ } : options.env;
93
+ };
94
+ const inputToStdioOption = (input) => Stream.isStream(input) ? "pipe" : input;
95
+ const outputToStdioOption = (input) => Sink.isSink(input) ? "pipe" : input;
96
+ const resolveStdinOption = (options) => {
97
+ const defaultConfig = {
98
+ stream: "pipe",
99
+ encoding: "utf-8",
100
+ endOnDone: true
101
+ };
102
+ if (Predicate.isUndefined(options.stdin)) {
103
+ return defaultConfig;
104
+ }
105
+ if (typeof options.stdin === "string") {
106
+ return {
107
+ ...defaultConfig,
108
+ stream: options.stdin
109
+ };
110
+ }
111
+ if (Stream.isStream(options.stdin)) {
112
+ return {
113
+ ...defaultConfig,
114
+ stream: options.stdin
115
+ };
116
+ }
117
+ return {
118
+ stream: options.stdin.stream,
119
+ encoding: options.stdin.encoding ?? defaultConfig.encoding,
120
+ endOnDone: options.stdin.endOnDone ?? defaultConfig.endOnDone
121
+ };
122
+ };
123
+ const resolveOutputOption = (options, streamName) => {
124
+ const option = options[streamName];
125
+ if (Predicate.isUndefined(option)) {
126
+ return {
127
+ stream: "pipe"
128
+ };
129
+ }
130
+ if (typeof option === "string") {
131
+ return {
132
+ stream: option
133
+ };
134
+ }
135
+ if (Sink.isSink(option)) {
136
+ return {
137
+ stream: option
138
+ };
139
+ }
140
+ return {
141
+ stream: option.stream
142
+ };
143
+ };
144
+ const resolveAdditionalFds = (options) => {
145
+ if (Predicate.isUndefined(options.additionalFds)) {
146
+ return [];
147
+ }
148
+ const result = [];
149
+ for (const [name, config] of Object.entries(options.additionalFds)) {
150
+ const fd = ChildProcess.parseFdName(name);
151
+ if (Predicate.isNotUndefined(fd)) {
152
+ result.push({
153
+ fd,
154
+ config
155
+ });
156
+ }
157
+ }
158
+ return result.sort((a, b) => a.fd - b.fd);
159
+ };
160
+ const buildStdioArray = (stdinConfig, stdoutConfig, stderrConfig, additionalFds) => {
161
+ const stdio = [inputToStdioOption(stdinConfig.stream), outputToStdioOption(stdoutConfig.stream), outputToStdioOption(stderrConfig.stream)];
162
+ if (additionalFds.length === 0) {
163
+ return stdio;
164
+ }
165
+ const maxFd = additionalFds.reduce((max, {
166
+ fd
167
+ }) => Math.max(max, fd), 2);
168
+ for (let i = 3; i <= maxFd; i++) {
169
+ stdio[i] = "ignore";
170
+ }
171
+ for (const {
172
+ fd
173
+ } of additionalFds) {
174
+ stdio[fd] = "pipe";
175
+ }
176
+ return stdio;
177
+ };
178
+ const setupAdditionalFds = Effect.fnUntraced(function* (command, childProcess, additionalFds) {
179
+ if (additionalFds.length === 0) {
180
+ return {
181
+ getInputFd: () => Sink.drain,
182
+ getOutputFd: () => Stream.empty
183
+ };
184
+ }
185
+ const inputSinks = /* @__PURE__ */ new Map();
186
+ const outputStreams = /* @__PURE__ */ new Map();
187
+ for (const {
188
+ config,
189
+ fd
190
+ } of additionalFds) {
191
+ const nodeStream = childProcess.stdio[fd];
192
+ switch (config.type) {
193
+ case "input": {
194
+ let sink = Sink.drain;
195
+ if (nodeStream && "write" in nodeStream) {
196
+ handleInputErrors(nodeStream);
197
+ sink = fromWritable({
198
+ evaluate: () => nodeStream,
199
+ onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
200
+ });
201
+ }
202
+ if (config.stream) {
203
+ yield* Effect.forkScoped(Stream.run(config.stream, sink));
204
+ }
205
+ inputSinks.set(fd, sink);
206
+ break;
207
+ }
208
+ case "output": {
209
+ let stream = Stream.empty;
210
+ if (nodeStream && "read" in nodeStream) {
211
+ const passThrough = new PassThrough();
212
+ nodeStream.on("error", (error) => passThrough.destroy(error));
213
+ nodeStream.pipe(passThrough);
214
+ stream = fromReadable({
215
+ evaluate: () => passThrough,
216
+ onError: (error) => toPlatformError(`fromReadable(fd${fd})`, toError(error), command)
217
+ });
218
+ }
219
+ if (config.sink) {
220
+ stream = Stream.transduce(stream, config.sink);
221
+ }
222
+ outputStreams.set(fd, stream);
223
+ break;
224
+ }
225
+ }
226
+ }
227
+ return {
228
+ getInputFd: (fd) => inputSinks.get(fd) ?? Sink.drain,
229
+ getOutputFd: (fd) => outputStreams.get(fd) ?? Stream.empty
230
+ };
231
+ });
232
+ const setupChildStdin = (command, childProcess, config) => Effect.suspend(() => {
233
+ let sink = Sink.drain;
234
+ if (Predicate.isNotNull(childProcess.stdin)) {
235
+ handleInputErrors(childProcess.stdin);
236
+ sink = fromWritable({
237
+ evaluate: () => childProcess.stdin,
238
+ onError: (error) => toPlatformError("fromWritable(stdin)", toError(error), command),
239
+ endOnDone: config.endOnDone,
240
+ encoding: config.encoding
241
+ });
242
+ }
243
+ if (Stream.isStream(config.stream)) {
244
+ return Effect.as(Effect.forkScoped(Stream.run(config.stream, sink)), sink);
245
+ }
246
+ return Effect.succeed(sink);
247
+ });
248
+ const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
249
+ let stdout = childProcess.stdout ? (() => {
250
+ const passThrough = new PassThrough();
251
+ childProcess.stdout.on("error", (error) => passThrough.destroy(error));
252
+ childProcess.stdout.pipe(passThrough);
253
+ return fromReadable({
254
+ evaluate: () => passThrough,
255
+ onError: (error) => toPlatformError("fromReadable(stdout)", toError(error), command)
256
+ });
257
+ })() : Stream.empty;
258
+ let stderr = childProcess.stderr ? (() => {
259
+ const passThrough = new PassThrough();
260
+ childProcess.stderr.on("error", (error) => passThrough.destroy(error));
261
+ childProcess.stderr.pipe(passThrough);
262
+ return fromReadable({
263
+ evaluate: () => passThrough,
264
+ onError: (error) => toPlatformError("fromReadable(stderr)", toError(error), command)
265
+ });
266
+ })() : Stream.empty;
267
+ if (Sink.isSink(stdoutConfig.stream)) {
268
+ stdout = Stream.transduce(stdout, stdoutConfig.stream);
269
+ }
270
+ if (Sink.isSink(stderrConfig.stream)) {
271
+ stderr = Stream.transduce(stderr, stderrConfig.stream);
272
+ }
273
+ const all = Stream.merge(stdout, stderr);
274
+ return {
275
+ stdout,
276
+ stderr,
277
+ all
278
+ };
279
+ };
280
+ const spawn2 = (command, spawnOptions) => Effect.callback((resume) => {
281
+ const deferred = Deferred.makeUnsafe();
282
+ const handle = NodeChildProcess.spawn(command.command, command.args, spawnOptions);
283
+ handle.on("error", (error) => {
284
+ resume(Effect.fail(toPlatformError("spawn", error, command)));
285
+ });
286
+ handle.on("exit", (...args) => {
287
+ Deferred.doneUnsafe(deferred, Exit.succeed(args));
288
+ });
289
+ handle.on("spawn", () => {
290
+ resume(Effect.succeed([handle, deferred]));
291
+ });
292
+ return Effect.sync(() => {
293
+ handle.kill("SIGTERM");
294
+ });
295
+ });
296
+ const killProcessGroup = (command, childProcess, signal) => {
297
+ if (globalThis.process.platform === "win32") {
298
+ return Effect.callback((resume) => {
299
+ taskkill(childProcess, (error) => {
300
+ if (error) {
301
+ resume(Effect.fail(toPlatformError("kill", toError(error), command)));
302
+ } else {
303
+ resume(Effect.void);
304
+ }
305
+ });
306
+ });
307
+ }
308
+ return Effect.try({
309
+ try: () => {
310
+ globalThis.process.kill(-childProcess.pid, signal);
311
+ },
312
+ catch: (error) => toPlatformError("kill", toError(error), command)
313
+ });
314
+ };
315
+ const killProcessGroupOnExit = (childProcess, signal) => {
316
+ if (globalThis.process.platform === "win32") {
317
+ taskkill(childProcess);
318
+ return;
319
+ }
320
+ try {
321
+ globalThis.process.kill(-childProcess.pid, signal);
322
+ } catch {
323
+ }
324
+ };
325
+ const killProcess = (command, childProcess, signal) => Effect.suspend(() => {
326
+ const killed = childProcess.kill(signal);
327
+ if (!killed) {
328
+ const error = new globalThis.Error("Failed to kill child process");
329
+ return Effect.fail(toPlatformError("kill", error, command));
330
+ }
331
+ return Effect.void;
332
+ });
333
+ const awaitProcessExit = (childProcess, exitSignal, timeoutMillis) => Effect.callback((resume) => {
334
+ const deadline = Date.now() + timeoutMillis;
335
+ let timer;
336
+ const stop = () => {
337
+ clearTimeout(timer);
338
+ childProcess.removeListener("exit", poll);
339
+ };
340
+ const poll = () => {
341
+ clearTimeout(timer);
342
+ if (Date.now() >= deadline || !isProcessAlive(childProcess, exitSignal)) {
343
+ stop();
344
+ resume(Effect.void);
345
+ return;
346
+ }
347
+ timer = setTimeout(poll, processGroupPollIntervalMillis);
348
+ };
349
+ childProcess.on("exit", poll);
350
+ poll();
351
+ return Effect.sync(stop);
352
+ });
353
+ const terminateProcessGroup = Effect.fnUntraced(function* (command, childProcess, exitSignal, options) {
354
+ const signalGroup = (signal) => killProcessGroup(command, childProcess, signal).pipe(Effect.catch(() => killProcess(command, childProcess, signal)));
355
+ yield* signalGroup(options?.killSignal ?? "SIGTERM");
356
+ if (Predicate.isUndefined(options?.forceKillAfter)) {
357
+ yield* awaitProcessExit(childProcess, exitSignal, processGroupGraceMillis);
358
+ } else {
359
+ yield* awaitProcessExit(childProcess, exitSignal, Duration.toMillis(options.forceKillAfter));
360
+ if (isProcessAlive(childProcess, exitSignal)) {
361
+ yield* signalGroup("SIGKILL");
362
+ yield* awaitProcessExit(childProcess, exitSignal, processGroupGraceMillis);
363
+ }
364
+ }
365
+ yield* Deferred.await(exitSignal);
366
+ });
367
+ const getSourceStream = (handle, from) => {
368
+ const fromOption = from ?? "stdout";
369
+ switch (fromOption) {
370
+ case "stdout":
371
+ return handle.stdout;
372
+ case "stderr":
373
+ return handle.stderr;
374
+ case "all":
375
+ return handle.all;
376
+ default: {
377
+ const fd = ChildProcess.parseFdName(fromOption);
378
+ if (Predicate.isNotUndefined(fd)) {
379
+ return handle.getOutputFd(fd);
380
+ }
381
+ return handle.stdout;
382
+ }
383
+ }
384
+ };
385
+ const spawnCommand = Effect.fnUntraced(function* (cmd) {
386
+ switch (cmd._tag) {
387
+ case "StandardCommand": {
388
+ const stdinConfig = resolveStdinOption(cmd.options);
389
+ const stdoutConfig = resolveOutputOption(cmd.options, "stdout");
390
+ const stderrConfig = resolveOutputOption(cmd.options, "stderr");
391
+ const resolvedAdditionalFds = resolveAdditionalFds(cmd.options);
392
+ let isReferenced = true;
393
+ const cwd = yield* resolveWorkingDirectory(cmd.options);
394
+ const env = resolveEnvironment(cmd.options);
395
+ const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds);
396
+ const [childProcess, exitSignal] = yield* Effect.acquireRelease(spawn2(cmd, buildSpawnOptions(cmd.options, {
397
+ cwd,
398
+ env,
399
+ stdio
400
+ }, process.platform)), Effect.fnUntraced(function* ([childProcess2, exitSignal2]) {
401
+ const exited = yield* Deferred.isDone(exitSignal2);
402
+ if (exited) {
403
+ const [code] = yield* Deferred.await(exitSignal2);
404
+ if (code !== 0 && Predicate.isNotNull(code)) {
405
+ yield* Effect.ignore(terminateProcessGroup(cmd, childProcess2, exitSignal2, cmd.options));
406
+ } else if (isReferenced && process.platform !== "win32" && cmd.options.detached !== false) {
407
+ yield* Effect.ignore(terminateProcessGroup(cmd, childProcess2, exitSignal2, cmd.options));
408
+ }
409
+ return;
410
+ }
411
+ if (!isReferenced) {
412
+ return;
413
+ }
414
+ yield* Effect.ignore(terminateProcessGroup(cmd, childProcess2, exitSignal2, cmd.options));
415
+ }));
416
+ const pid = ProcessId(childProcess.pid);
417
+ childProcess.on("exit", (code) => {
418
+ if (code !== 0 && Predicate.isNotNull(code)) {
419
+ killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? "SIGTERM");
420
+ }
421
+ });
422
+ const reref = Effect.sync(() => {
423
+ if (!isReferenced) {
424
+ childProcess.ref();
425
+ isReferenced = true;
426
+ }
427
+ });
428
+ const unref = Effect.sync(() => {
429
+ if (isReferenced) {
430
+ childProcess.unref();
431
+ isReferenced = false;
432
+ }
433
+ return reref;
434
+ });
435
+ const stdin = yield* setupChildStdin(cmd, childProcess, stdinConfig);
436
+ const {
437
+ all,
438
+ stderr,
439
+ stdout
440
+ } = setupChildOutputStreams(cmd, childProcess, stdoutConfig, stderrConfig);
441
+ const {
442
+ getInputFd,
443
+ getOutputFd
444
+ } = yield* setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds);
445
+ const isRunning = Effect.map(Deferred.isDone(exitSignal), (done) => !done);
446
+ const exitCode = Effect.flatMap(Deferred.await(exitSignal), ([code, signal]) => {
447
+ if (Predicate.isNotNull(code)) {
448
+ return Effect.succeed(ExitCode(code));
449
+ }
450
+ const error = new globalThis.Error(`Process interrupted due to receipt of signal: '${signal}'`);
451
+ return Effect.fail(toPlatformError("exitCode", error, cmd));
452
+ });
453
+ const kill = (options) => terminateProcessGroup(cmd, childProcess, exitSignal, options);
454
+ return makeHandle({
455
+ pid,
456
+ exitCode,
457
+ isRunning,
458
+ kill,
459
+ stdin,
460
+ stdout,
461
+ stderr,
462
+ all,
463
+ getInputFd,
464
+ getOutputFd,
465
+ unref
466
+ });
467
+ }
468
+ case "PipedCommand": {
469
+ const {
470
+ commands,
471
+ pipeOptions
472
+ } = flattenCommand(cmd);
473
+ const [root, ...pipeline] = commands;
474
+ const handles = [yield* spawnCommand(root)];
475
+ for (let i = 0; i < pipeline.length; i++) {
476
+ const command = pipeline[i];
477
+ const options = pipeOptions[i] ?? {};
478
+ const stdinConfig = resolveStdinOption(command.options);
479
+ const sourceStream = Stream.unwrap(Effect.succeed(getSourceStream(handles[handles.length - 1], options.from)));
480
+ const toOption = options.to ?? "stdin";
481
+ if (toOption === "stdin") {
482
+ handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {
483
+ ...command.options,
484
+ stdin: {
485
+ ...stdinConfig,
486
+ stream: sourceStream
487
+ }
488
+ })));
489
+ } else {
490
+ const fd = ChildProcess.parseFdName(toOption);
491
+ if (Predicate.isNotUndefined(fd)) {
492
+ const fdName2 = ChildProcess.fdName(fd);
493
+ const existingFds = command.options.additionalFds ?? {};
494
+ handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {
495
+ ...command.options,
496
+ additionalFds: {
497
+ ...existingFds,
498
+ [fdName2]: {
499
+ type: "input",
500
+ stream: sourceStream
501
+ }
502
+ }
503
+ })));
504
+ } else {
505
+ handles.push(yield* spawnCommand(ChildProcess.make(command.command, command.args, {
506
+ ...command.options,
507
+ stdin: {
508
+ ...stdinConfig,
509
+ stream: sourceStream
510
+ }
511
+ })));
512
+ }
513
+ }
514
+ }
515
+ const handle = handles[handles.length - 1];
516
+ const kill = (options) => Effect.forEach([...handles].reverse(), (handle2) => Effect.ignore(handle2.kill(options)), {
517
+ discard: true
518
+ });
519
+ const unref = Effect.gen(function* () {
520
+ const rerefs = [];
521
+ for (const handle2 of handles) {
522
+ rerefs.push(yield* handle2.unref);
523
+ }
524
+ return Effect.forEach([...rerefs].reverse(), (reref) => reref, {
525
+ discard: true
526
+ });
527
+ });
528
+ return makeHandle({
529
+ pid: handle.pid,
530
+ exitCode: handle.exitCode,
531
+ isRunning: handle.isRunning,
532
+ kill,
533
+ stdin: handles[0].stdin,
534
+ stdout: handle.stdout,
535
+ stderr: handle.stderr,
536
+ all: handle.all,
537
+ getInputFd: handle.getInputFd,
538
+ getOutputFd: handle.getOutputFd,
539
+ unref
540
+ });
541
+ }
542
+ }
543
+ });
544
+ return makeSpawner(spawnCommand);
545
+ });
546
+ var layer = /* @__PURE__ */ Layer.effect(ChildProcessSpawner, make2);
547
+ var flattenCommand = (command) => {
548
+ const commands = [];
549
+ const pipeOptions = [];
550
+ const flatten = (cmd) => {
551
+ switch (cmd._tag) {
552
+ case "StandardCommand": {
553
+ commands.push(cmd);
554
+ break;
555
+ }
556
+ case "PipedCommand": {
557
+ flatten(cmd.left);
558
+ pipeOptions.push(cmd.options);
559
+ flatten(cmd.right);
560
+ break;
561
+ }
562
+ }
563
+ };
564
+ flatten(command);
565
+ if (commands.length === 0) {
566
+ throw new Error("flattenCommand produced empty commands array");
567
+ }
568
+ const [first, ...rest] = commands;
569
+ const nonEmptyCommands = [first, ...rest];
570
+ return {
571
+ commands: nonEmptyCommands,
572
+ pipeOptions
573
+ };
574
+ };
575
+
576
+ export {
577
+ layer,
578
+ flattenCommand,
579
+ NodeChildProcessSpawner_exports
580
+ };
@@ -0,0 +1,28 @@
1
+ import {
2
+ IncomingMessage,
3
+ layer,
4
+ layerTls,
5
+ layerWebSocket,
6
+ make,
7
+ makeTls,
8
+ makeWebSocket
9
+ } from "./chunk-UXIG7ALP.js";
10
+ import {
11
+ __export
12
+ } from "./chunk-MLKGABMK.js";
13
+
14
+ // ../../../../node_modules/.pnpm/@effect+platform-node@4.0.5_effect@4.0.5_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeSocketServer.js
15
+ var NodeSocketServer_exports = {};
16
+ __export(NodeSocketServer_exports, {
17
+ IncomingMessage: () => IncomingMessage,
18
+ layer: () => layer,
19
+ layerTls: () => layerTls,
20
+ layerWebSocket: () => layerWebSocket,
21
+ make: () => make,
22
+ makeTls: () => makeTls,
23
+ makeWebSocket: () => makeWebSocket
24
+ });
25
+
26
+ export {
27
+ NodeSocketServer_exports
28
+ };
@@ -0,0 +1,58 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.5_effect@4.0.5/node_modules/@effect/platform-node-shared/dist/NodePath.js
6
+ var NodePath_exports = {};
7
+ __export(NodePath_exports, {
8
+ layer: () => layer,
9
+ layerPosix: () => layerPosix,
10
+ layerWin32: () => layerWin32
11
+ });
12
+ import * as Effect from "effect/Effect";
13
+ import * as Layer from "effect/Layer";
14
+ import { make, Path } from "effect/Path";
15
+ import { BadArgument } from "effect/PlatformError";
16
+ import * as NodePath from "node:path";
17
+ import * as NodeUrl from "node:url";
18
+ var fileUrlOps = (windows) => ({
19
+ fromFileUrl: (url) => Effect.try({
20
+ try: () => NodeUrl.fileURLToPath(url, {
21
+ windows
22
+ }),
23
+ catch: (cause) => new BadArgument({
24
+ module: "Path",
25
+ method: "fromFileUrl",
26
+ cause
27
+ })
28
+ }),
29
+ toFileUrl: (path) => Effect.try({
30
+ try: () => NodeUrl.pathToFileURL(path, {
31
+ windows
32
+ }),
33
+ catch: (cause) => new BadArgument({
34
+ module: "Path",
35
+ method: "toFileUrl",
36
+ cause
37
+ })
38
+ })
39
+ });
40
+ var layerPosix = /* @__PURE__ */ Layer.succeed(Path)(/* @__PURE__ */ make({
41
+ ...NodePath.posix,
42
+ .../* @__PURE__ */ fileUrlOps(false)
43
+ }));
44
+ var layerWin32 = /* @__PURE__ */ Layer.succeed(Path)(/* @__PURE__ */ make({
45
+ ...NodePath.win32,
46
+ .../* @__PURE__ */ fileUrlOps(true)
47
+ }));
48
+ var layer = /* @__PURE__ */ Layer.succeed(Path)(/* @__PURE__ */ make({
49
+ ...NodePath,
50
+ .../* @__PURE__ */ fileUrlOps(void 0)
51
+ }));
52
+
53
+ export {
54
+ layerPosix,
55
+ layerWin32,
56
+ layer,
57
+ NodePath_exports
58
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ flattenCommand,
3
+ layer
4
+ } from "./chunk-IXI7RW3A.js";
5
+ import {
6
+ __export
7
+ } from "./chunk-MLKGABMK.js";
8
+
9
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.5_effect@4.0.5/node_modules/@effect/platform-bun/dist/BunChildProcessSpawner.js
10
+ var BunChildProcessSpawner_exports = {};
11
+ __export(BunChildProcessSpawner_exports, {
12
+ flattenCommand: () => flattenCommand,
13
+ layer: () => layer
14
+ });
15
+
16
+ export {
17
+ BunChildProcessSpawner_exports
18
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ layer
3
+ } from "./chunk-AW6WQVI7.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-MLKGABMK.js";
7
+
8
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.5_effect@4.0.5/node_modules/@effect/platform-bun/dist/BunAddressResolver.js
9
+ var BunAddressResolver_exports = {};
10
+ __export(BunAddressResolver_exports, {
11
+ layer: () => layer
12
+ });
13
+
14
+ export {
15
+ BunAddressResolver_exports
16
+ };