@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,414 @@
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/NodeSocket.js
6
+ var NodeSocket_exports = {};
7
+ __export(NodeSocket_exports, {
8
+ NetSocket: () => NetSocket,
9
+ NodeWS: () => NodeWS,
10
+ fromDuplex: () => fromDuplex,
11
+ layerNet: () => layerNet,
12
+ layerTls: () => layerTls,
13
+ makeNet: () => makeNet,
14
+ makeNetChannel: () => makeNetChannel,
15
+ makeTls: () => makeTls,
16
+ makeTlsChannel: () => makeTlsChannel
17
+ });
18
+ import * as Arr from "effect/Array";
19
+ import * as Channel from "effect/Channel";
20
+ import * as Context from "effect/Context";
21
+ import * as Effect from "effect/Effect";
22
+ import * as Function from "effect/Function";
23
+ import { identity } from "effect/Function";
24
+ import * as Latch from "effect/Latch";
25
+ import * as Layer from "effect/Layer";
26
+ import * as Redacted from "effect/Redacted";
27
+ import * as Scope from "effect/Scope";
28
+ import * as Socket from "effect/socket/Socket";
29
+ import { Buffer } from "node:buffer";
30
+ import * as Net from "node:net";
31
+ import * as Tls from "node:tls";
32
+ import * as NodeWS from "ws";
33
+ var isDeno = "Deno" in globalThis;
34
+ var NetSocket = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-node/NodeSocket/NetSocket")) {
35
+ };
36
+ var readAvailable = (conn) => {
37
+ const first = conn.read();
38
+ if (first === null) return void 0;
39
+ const second = conn.read();
40
+ if (second === null) return [first];
41
+ const out = [first, second];
42
+ let chunk;
43
+ while ((chunk = conn.read()) !== null) {
44
+ out.push(chunk);
45
+ }
46
+ return out;
47
+ };
48
+ var toBuffers = (input) => Arr.map(Arr.ensure(input), (value2) => Buffer.from(value2));
49
+ var closeSocket = (conn, isOpen) => {
50
+ if (conn.closed !== false) return;
51
+ if (!isOpen || !("destroySoon" in conn)) {
52
+ conn.destroy();
53
+ } else {
54
+ conn.destroySoon();
55
+ }
56
+ };
57
+ var makeNet = (options) => fromDuplex(Effect.contextWith((context) => {
58
+ let conn;
59
+ let isOpen = false;
60
+ return Effect.flatMap(Scope.addFinalizer(Context.get(context, Scope.Scope), Effect.sync(() => {
61
+ if (!conn) return;
62
+ closeSocket(conn, isOpen);
63
+ })), () => Effect.callback((resume) => {
64
+ conn = Net.createConnection(options);
65
+ conn.once("connect", () => {
66
+ isOpen = true;
67
+ resume(Effect.succeed(conn));
68
+ });
69
+ conn.on("error", (cause) => {
70
+ resume(Effect.fail(new Socket.SocketError({
71
+ reason: new Socket.SocketOpenError({
72
+ kind: "Unknown",
73
+ cause
74
+ })
75
+ })));
76
+ });
77
+ }));
78
+ }), options);
79
+ var fromDuplex = (open, options) => Effect.withFiber((fiber) => {
80
+ let currentSocket;
81
+ const latch = Latch.makeUnsafe(false);
82
+ const openServices = fiber.context;
83
+ const isServer = options?.tlsServer === true;
84
+ const secureEvent = isServer ? "secure" : "secureConnect";
85
+ const reader = Effect.gen(function* () {
86
+ const scope2 = yield* Effect.scope;
87
+ let conn = yield* Scope.provide(open, scope2).pipe(options?.openTimeout !== void 0 ? Effect.timeoutOrElse({
88
+ duration: options.openTimeout,
89
+ orElse: () => Effect.fail(new Socket.SocketError({
90
+ reason: new Socket.SocketOpenError({
91
+ kind: "Timeout",
92
+ cause: new Error("Connection timed out")
93
+ })
94
+ }))
95
+ }) : identity);
96
+ let error;
97
+ let waiter;
98
+ let pending;
99
+ let reading = false;
100
+ let closed = false;
101
+ let upgradeAvailable = true;
102
+ function drain() {
103
+ if (waiter === void 0 || reading) return;
104
+ let chunk = pending;
105
+ pending = void 0;
106
+ if (chunk === void 0 && !closed) {
107
+ reading = true;
108
+ try {
109
+ chunk = readAvailable(conn);
110
+ } finally {
111
+ reading = false;
112
+ }
113
+ }
114
+ if (closed) chunk = void 0;
115
+ if (waiter === void 0) {
116
+ pending = chunk;
117
+ return;
118
+ }
119
+ const result = chunk !== void 0 ? Effect.succeed(chunk) : error !== void 0 ? Effect.fail(error) : void 0;
120
+ if (result === void 0) return;
121
+ const resume = waiter;
122
+ waiter = void 0;
123
+ resume(result);
124
+ }
125
+ function end(err) {
126
+ error ??= err;
127
+ drain();
128
+ }
129
+ function close(err) {
130
+ error ??= err;
131
+ closed = true;
132
+ pending = void 0;
133
+ drain();
134
+ }
135
+ function onEnd() {
136
+ end(new Socket.SocketError({
137
+ reason: new Socket.SocketCloseError({
138
+ code: 1e3
139
+ })
140
+ }));
141
+ }
142
+ function onError(cause) {
143
+ close(new Socket.SocketError({
144
+ reason: new Socket.SocketReadError({
145
+ cause
146
+ })
147
+ }));
148
+ }
149
+ function onClose(hadError) {
150
+ const err = new Socket.SocketError({
151
+ reason: new Socket.SocketCloseError({
152
+ code: hadError ? 1006 : 1e3
153
+ })
154
+ });
155
+ if (hadError) close(err);
156
+ else end(err);
157
+ }
158
+ function attachReadListeners(conn2) {
159
+ conn2.on("readable", drain);
160
+ conn2.on("end", onEnd);
161
+ conn2.on("error", onError);
162
+ conn2.on("close", onClose);
163
+ }
164
+ function detachReadListeners(conn2) {
165
+ conn2.off("readable", drain);
166
+ conn2.off("end", onEnd);
167
+ conn2.off("error", onError);
168
+ conn2.off("close", onClose);
169
+ }
170
+ if (!isDeno) conn.pause();
171
+ attachReadListeners(conn);
172
+ yield* Scope.addFinalizer(scope2, Effect.sync(() => {
173
+ close(new Socket.SocketError({
174
+ reason: new Socket.SocketCloseError({
175
+ code: 1006
176
+ })
177
+ }));
178
+ detachReadListeners(conn);
179
+ latch.closeUnsafe();
180
+ currentSocket = void 0;
181
+ upgradeAvailable = false;
182
+ }));
183
+ currentSocket = conn;
184
+ latch.openUnsafe();
185
+ const pull = Effect.callback((resume) => {
186
+ waiter = resume;
187
+ drain();
188
+ if (waiter !== resume) return;
189
+ return Effect.sync(() => {
190
+ if (waiter === resume) waiter = void 0;
191
+ });
192
+ });
193
+ const upgrade = (upgradeOptions = {}) => Effect.suspend(() => {
194
+ if (!upgradeAvailable) {
195
+ return Effect.fail(new Socket.SocketError({
196
+ reason: new Socket.SocketUpgradeError({
197
+ cause: new Error("socket is already upgraded or closed")
198
+ })
199
+ }));
200
+ }
201
+ const hasKey = upgradeOptions.key !== void 0;
202
+ const hasCert = upgradeOptions.cert !== void 0;
203
+ if (isServer && (!hasKey || !hasCert) || hasKey !== hasCert) {
204
+ return Effect.fail(new Socket.SocketError({
205
+ reason: new Socket.SocketUpgradeError({
206
+ cause: new Error(isServer ? "server TLS upgrade requires both key and cert" : "TLS upgrade credentials must include both key and cert")
207
+ })
208
+ }));
209
+ }
210
+ return Effect.callback((resume) => {
211
+ const raw = conn;
212
+ detachReadListeners(raw);
213
+ let tls;
214
+ try {
215
+ const secureContext = Tls.createSecureContext({
216
+ key: upgradeOptions.key === void 0 ? void 0 : Arr.map(Arr.ensure(upgradeOptions.key), (value2) => Buffer.from(Redacted.value(value2))),
217
+ cert: upgradeOptions.cert === void 0 ? void 0 : toBuffers(upgradeOptions.cert),
218
+ ca: upgradeOptions.ca === void 0 ? void 0 : toBuffers(upgradeOptions.ca),
219
+ passphrase: upgradeOptions.passphrase === void 0 ? void 0 : Redacted.value(upgradeOptions.passphrase)
220
+ });
221
+ const tlsOptions = {
222
+ secureContext,
223
+ ALPNProtocols: upgradeOptions.alpnProtocols === void 0 ? void 0 : [...upgradeOptions.alpnProtocols],
224
+ requestCert: upgradeOptions.requestCert,
225
+ rejectUnauthorized: upgradeOptions.rejectUnauthorized
226
+ };
227
+ tls = isServer ? new Tls.TLSSocket(raw, {
228
+ ...tlsOptions,
229
+ isServer: true
230
+ }) : Tls.connect({
231
+ ...tlsOptions,
232
+ servername: upgradeOptions.servername,
233
+ socket: raw
234
+ });
235
+ } catch (cause) {
236
+ attachReadListeners(raw);
237
+ resume(Effect.fail(new Socket.SocketError({
238
+ reason: new Socket.SocketUpgradeError({
239
+ cause
240
+ })
241
+ })));
242
+ return;
243
+ }
244
+ conn = tls;
245
+ currentSocket = tls;
246
+ tls.pause();
247
+ function cleanup() {
248
+ tls.off(secureEvent, succeed2);
249
+ tls.off("error", failUpgrade);
250
+ tls.off("close", onUpgradeClose);
251
+ }
252
+ function succeed2() {
253
+ cleanup();
254
+ upgradeAvailable = false;
255
+ attachReadListeners(tls);
256
+ resume(Effect.void);
257
+ }
258
+ function failUpgrade(cause) {
259
+ cleanup();
260
+ const upgradeError = new Socket.SocketError({
261
+ reason: new Socket.SocketUpgradeError({
262
+ cause
263
+ })
264
+ });
265
+ close(upgradeError);
266
+ resume(Effect.fail(upgradeError));
267
+ }
268
+ function onUpgradeClose() {
269
+ failUpgrade(new Error("socket closed during TLS upgrade"));
270
+ }
271
+ tls.once(secureEvent, succeed2);
272
+ tls.once("error", failUpgrade);
273
+ tls.once("close", onUpgradeClose);
274
+ return Effect.sync(() => {
275
+ cleanup();
276
+ close(new Socket.SocketError({
277
+ reason: new Socket.SocketCloseError({
278
+ code: 1006
279
+ })
280
+ }));
281
+ tls.destroy();
282
+ });
283
+ });
284
+ });
285
+ return {
286
+ pull,
287
+ upgrade
288
+ };
289
+ }).pipe(Effect.updateContext((input) => Context.merge(openServices, input)));
290
+ const awaitDrain = (conn) => Effect.callback((resume) => {
291
+ function cleanup() {
292
+ conn.off("drain", onDrain);
293
+ conn.off("error", onError);
294
+ conn.off("close", onClose);
295
+ }
296
+ function onDrain() {
297
+ cleanup();
298
+ resume(Effect.void);
299
+ }
300
+ function onError(cause) {
301
+ cleanup();
302
+ resume(Effect.fail(new Socket.SocketError({
303
+ reason: new Socket.SocketWriteError({
304
+ cause
305
+ })
306
+ })));
307
+ }
308
+ function onClose() {
309
+ cleanup();
310
+ resume(Effect.fail(new Socket.SocketError({
311
+ reason: new Socket.SocketWriteError({
312
+ cause: new Error("socket closed")
313
+ })
314
+ })));
315
+ }
316
+ conn.on("drain", onDrain);
317
+ conn.on("error", onError);
318
+ conn.on("close", onClose);
319
+ return Effect.sync(cleanup);
320
+ });
321
+ const write = (chunk) => Effect.suspend(() => {
322
+ const conn = currentSocket;
323
+ if (conn === void 0) return latch.whenOpen(write(chunk));
324
+ if (Socket.isCloseEvent(chunk)) {
325
+ conn.destroy(chunk.code > 1e3 ? new Error(`closed with code ${chunk.code}`) : void 0);
326
+ return Effect.void;
327
+ }
328
+ try {
329
+ return conn.write(chunk) ? Effect.void : awaitDrain(conn);
330
+ } catch (cause) {
331
+ return Effect.fail(new Socket.SocketError({
332
+ reason: new Socket.SocketWriteError({
333
+ cause
334
+ })
335
+ }));
336
+ }
337
+ });
338
+ const writeAll = (chunks) => Effect.suspend(() => {
339
+ const conn = currentSocket;
340
+ if (conn === void 0) return latch.whenOpen(writeAll(chunks));
341
+ let needsDrain = false;
342
+ try {
343
+ if (chunks.length === 1) {
344
+ needsDrain = !conn.write(chunks[0]);
345
+ } else {
346
+ conn.cork();
347
+ try {
348
+ for (let i = 0; i < chunks.length; i++) {
349
+ needsDrain = !conn.write(chunks[i]) || needsDrain;
350
+ }
351
+ } finally {
352
+ conn.uncork();
353
+ }
354
+ }
355
+ } catch (cause) {
356
+ return Effect.fail(new Socket.SocketError({
357
+ reason: new Socket.SocketWriteError({
358
+ cause
359
+ })
360
+ }));
361
+ }
362
+ return needsDrain ? awaitDrain(conn) : Effect.void;
363
+ });
364
+ const writer = Effect.acquireRelease(Effect.succeed({
365
+ write,
366
+ writeAll
367
+ }), () => Effect.sync(() => {
368
+ if (!currentSocket || currentSocket.writableEnded) return;
369
+ currentSocket.end();
370
+ }));
371
+ return Effect.succeed(Socket.make({
372
+ reader,
373
+ writer
374
+ }));
375
+ });
376
+ var makeNetChannel = (options) => Channel.unwrap(Effect.map(makeNet(options), Socket.toChannelWith()));
377
+ var layerNet = /* @__PURE__ */ Function.flow(makeNet, /* @__PURE__ */ Layer.effect(Socket.Socket));
378
+ var makeTls = (options) => fromDuplex(Effect.contextWith((context) => {
379
+ let conn;
380
+ let isOpen = false;
381
+ return Effect.flatMap(Scope.addFinalizer(Context.get(context, Scope.Scope), Effect.sync(() => {
382
+ if (!conn) return;
383
+ closeSocket(conn, isOpen);
384
+ })), () => Effect.callback((resume) => {
385
+ conn = Tls.connect(options);
386
+ conn.once("secureConnect", () => {
387
+ isOpen = true;
388
+ resume(Effect.succeed(conn));
389
+ });
390
+ conn.on("error", (cause) => {
391
+ resume(Effect.fail(new Socket.SocketError({
392
+ reason: new Socket.SocketOpenError({
393
+ kind: "Unknown",
394
+ cause
395
+ })
396
+ })));
397
+ });
398
+ }));
399
+ }), options);
400
+ var makeTlsChannel = (options) => Channel.unwrap(Effect.map(makeTls(options), Socket.toChannelWith()));
401
+ var layerTls = /* @__PURE__ */ Function.flow(makeTls, /* @__PURE__ */ Layer.effect(Socket.Socket));
402
+
403
+ export {
404
+ NetSocket,
405
+ makeNet,
406
+ fromDuplex,
407
+ makeNetChannel,
408
+ layerNet,
409
+ makeTls,
410
+ makeTlsChannel,
411
+ layerTls,
412
+ NodeSocket_exports,
413
+ NodeWS
414
+ };
@@ -0,0 +1,131 @@
1
+ import {
2
+ make
3
+ } from "./chunk-X6FYP2EH.js";
4
+ import {
5
+ fromReadable,
6
+ toUint8Array
7
+ } from "./chunk-T5WDTZCE.js";
8
+ import {
9
+ __export
10
+ } from "./chunk-MLKGABMK.js";
11
+
12
+ // ../../../../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/NodeMultipart.js
13
+ var NodeMultipart_exports = {};
14
+ __export(NodeMultipart_exports, {
15
+ fileToReadable: () => fileToReadable,
16
+ persisted: () => persisted,
17
+ stream: () => stream
18
+ });
19
+ import * as Effect from "effect/Effect";
20
+ import * as Multipart from "effect/http/Multipart";
21
+ import * as MultipartParser from "effect/http/MultipartParser";
22
+ import * as Inspectable from "effect/Inspectable";
23
+ import * as Stream from "effect/Stream";
24
+ import * as NFS from "node:fs";
25
+ import * as NodeStreamP from "node:stream/promises";
26
+ var stream = (source, headers) => Multipart.makeConfig(headers).pipe(Effect.map((config) => fromReadable({
27
+ evaluate() {
28
+ const parser = make(config);
29
+ source.pipe(parser);
30
+ return parser;
31
+ },
32
+ onError: (error) => convertError(error)
33
+ })), Stream.unwrap, Stream.map(convertPart));
34
+ var persisted = (source, headers) => Multipart.toPersisted(stream(source, headers), (path, file) => Effect.tryPromise({
35
+ try: (signal) => NodeStreamP.pipeline(file.file, NFS.createWriteStream(path), {
36
+ signal
37
+ }),
38
+ catch: (cause) => Multipart.MultipartError.fromReason("InternalError", cause)
39
+ }));
40
+ var fileToReadable = (file) => file.file;
41
+ var convertPart = (part) => part._tag === "Field" ? new FieldImpl(part.info, part.value) : new FileImpl(part);
42
+ var PartBase = class extends Inspectable.Class {
43
+ [Multipart.TypeId];
44
+ constructor() {
45
+ super();
46
+ this[Multipart.TypeId] = Multipart.TypeId;
47
+ }
48
+ };
49
+ var FieldImpl = class extends PartBase {
50
+ _tag = "Field";
51
+ key;
52
+ contentType;
53
+ value;
54
+ constructor(info, value) {
55
+ super();
56
+ this.key = info.name;
57
+ this.contentType = info.contentType;
58
+ this.value = MultipartParser.decodeField(info, value);
59
+ }
60
+ toJSON() {
61
+ return {
62
+ _id: "@effect/platform/Multipart/Part",
63
+ _tag: "Field",
64
+ key: this.key,
65
+ value: this.value,
66
+ contentType: this.contentType
67
+ };
68
+ }
69
+ };
70
+ var FileImpl = class extends PartBase {
71
+ _tag = "File";
72
+ key;
73
+ name;
74
+ contentType;
75
+ content;
76
+ contentEffect;
77
+ file;
78
+ constructor(file) {
79
+ super();
80
+ this.file = file;
81
+ this.key = file.info.name;
82
+ this.name = file.filename ?? file.info.name;
83
+ this.contentType = file.info.contentType;
84
+ this.content = fromReadable({
85
+ evaluate: () => file,
86
+ onError: (cause) => Multipart.MultipartError.fromReason("InternalError", cause)
87
+ });
88
+ this.contentEffect = toUint8Array(() => file, {
89
+ onError: (cause) => Multipart.MultipartError.fromReason("InternalError", cause)
90
+ });
91
+ }
92
+ toJSON() {
93
+ return {
94
+ _id: "@effect/platform/Multipart/Part",
95
+ _tag: "File",
96
+ key: this.key,
97
+ name: this.name,
98
+ contentType: this.contentType
99
+ };
100
+ }
101
+ };
102
+ function convertError(cause) {
103
+ switch (cause._tag) {
104
+ case "ReachedLimit": {
105
+ switch (cause.limit) {
106
+ case "MaxParts": {
107
+ return Multipart.MultipartError.fromReason("TooManyParts", cause);
108
+ }
109
+ case "MaxFieldSize": {
110
+ return Multipart.MultipartError.fromReason("FieldTooLarge", cause);
111
+ }
112
+ case "MaxPartSize": {
113
+ return Multipart.MultipartError.fromReason("FileTooLarge", cause);
114
+ }
115
+ case "MaxTotalSize": {
116
+ return Multipart.MultipartError.fromReason("BodyTooLarge", cause);
117
+ }
118
+ }
119
+ }
120
+ default: {
121
+ return Multipart.MultipartError.fromReason("Parse", cause);
122
+ }
123
+ }
124
+ }
125
+
126
+ export {
127
+ stream,
128
+ persisted,
129
+ fileToReadable,
130
+ NodeMultipart_exports
131
+ };
@@ -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-node@4.0.5_effect@4.0.5_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeChildProcessSpawner.js
10
+ var NodeChildProcessSpawner_exports = {};
11
+ __export(NodeChildProcessSpawner_exports, {
12
+ flattenCommand: () => flattenCommand,
13
+ layer: () => layer
14
+ });
15
+
16
+ export {
17
+ NodeChildProcessSpawner_exports
18
+ };
@@ -0,0 +1,18 @@
1
+ import {
2
+ layer
3
+ } from "./chunk-7JOAEKDV.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/BunFileSystem.js
9
+ var BunFileSystem_exports = {};
10
+ __export(BunFileSystem_exports, {
11
+ layer: () => layer2
12
+ });
13
+ var layer2 = layer;
14
+
15
+ export {
16
+ layer2 as layer,
17
+ BunFileSystem_exports
18
+ };