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

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-2ZAGBWTH.js +40 -0
  84. package/dist/vendor/chunk-3SL3HKQA.js +118 -0
  85. package/dist/vendor/chunk-3WUGYBFU.js +0 -0
  86. package/dist/vendor/chunk-4WIQ2XN7.js +28 -0
  87. package/dist/vendor/chunk-5ET7NHI7.js +15 -0
  88. package/dist/vendor/chunk-6FSJ2PMW.js +53 -0
  89. package/dist/vendor/chunk-6L2NJEOV.js +62 -0
  90. package/dist/vendor/chunk-72X6VEVD.js +62 -0
  91. package/dist/vendor/chunk-7NMJM44J.js +26 -0
  92. package/dist/vendor/chunk-A7AY2JP7.js +71 -0
  93. package/dist/vendor/chunk-A7UXCEJA.js +81 -0
  94. package/dist/vendor/chunk-ADP5LRUF.js +274 -0
  95. package/dist/vendor/chunk-ASGOJ3XA.js +0 -0
  96. package/dist/vendor/chunk-AWNTTSHL.js +34 -0
  97. package/dist/vendor/chunk-BUKVIAEM.js +20 -0
  98. package/dist/vendor/chunk-BY3SDXID.js +501 -0
  99. package/dist/vendor/chunk-C3PGUWW5.js +414 -0
  100. package/dist/vendor/chunk-CL4EIDIY.js +7 -0
  101. package/dist/vendor/chunk-D2ZL4PLZ.js +93 -0
  102. package/dist/vendor/chunk-D4HEMNGU.js +22 -0
  103. package/dist/vendor/chunk-F4V5TRY7.js +85 -0
  104. package/dist/vendor/chunk-F772LLZ5.js +31 -0
  105. package/dist/vendor/chunk-FFD6R5JZ.js +104 -0
  106. package/dist/vendor/chunk-G4HOH7GK.js +65 -0
  107. package/dist/vendor/chunk-GJN7MEBF.js +18 -0
  108. package/dist/vendor/chunk-HDV6VIRM.js +48 -0
  109. package/dist/vendor/chunk-IHV7Z4SW.js +34 -0
  110. package/dist/vendor/chunk-IWSDM4CG.js +16 -0
  111. package/dist/vendor/chunk-JOQDB2HC.js +26 -0
  112. package/dist/vendor/chunk-KABHKTVG.js +18 -0
  113. package/dist/vendor/chunk-KFDBU6RR.js +60 -0
  114. package/dist/vendor/chunk-KHPN5DWT.js +20 -0
  115. package/dist/vendor/chunk-LNWGIDIG.js +20 -0
  116. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  117. package/dist/vendor/chunk-MUEED3C3.js +144 -0
  118. package/dist/vendor/chunk-N6TK35N5.js +18 -0
  119. package/dist/vendor/chunk-NQO6V4KI.js +580 -0
  120. package/dist/vendor/chunk-NUJQMLJP.js +325 -0
  121. package/dist/vendor/chunk-OF3N2FN4.js +61 -0
  122. package/dist/vendor/chunk-OGZJACUS.js +57 -0
  123. package/dist/vendor/chunk-PCEVZYXO.js +63 -0
  124. package/dist/vendor/chunk-PECOFLCU.js +85 -0
  125. package/dist/vendor/chunk-PU7QVYND.js +18 -0
  126. package/dist/vendor/chunk-QGPZPULA.js +51 -0
  127. package/dist/vendor/chunk-QHR2RC5M.js +109 -0
  128. package/dist/vendor/chunk-R2YON4A6.js +28 -0
  129. package/dist/vendor/chunk-R327POEZ.js +18 -0
  130. package/dist/vendor/chunk-REFJNBQR.js +18 -0
  131. package/dist/vendor/chunk-RHJ6LV32.js +43 -0
  132. package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
  133. package/dist/vendor/chunk-RP3EWS4C.js +0 -0
  134. package/dist/vendor/chunk-RQH5DSBA.js +249 -0
  135. package/dist/vendor/chunk-RQQ5TSCD.js +374 -0
  136. package/dist/vendor/chunk-S6QUQLBV.js +229 -0
  137. package/dist/vendor/chunk-SCXQLSNW.js +34 -0
  138. package/dist/vendor/chunk-SD4X5NGU.js +515 -0
  139. package/dist/vendor/chunk-T332WJRS.js +128 -0
  140. package/dist/vendor/chunk-T5FQGISI.js +18 -0
  141. package/dist/vendor/chunk-TBPDCAMH.js +70 -0
  142. package/dist/vendor/chunk-UFWLKG4I.js +16 -0
  143. package/dist/vendor/chunk-UPIQ52FQ.js +426 -0
  144. package/dist/vendor/chunk-UUQXJRMK.js +14 -0
  145. package/dist/vendor/chunk-UUYTTEDH.js +36 -0
  146. package/dist/vendor/chunk-V2EB7FHY.js +129 -0
  147. package/dist/vendor/chunk-VIWU4EBF.js +18 -0
  148. package/dist/vendor/chunk-WPZDL2D7.js +21 -0
  149. package/dist/vendor/chunk-X4YPHWAE.js +22 -0
  150. package/dist/vendor/chunk-XACFQJY7.js +93 -0
  151. package/dist/vendor/chunk-Y7V6ISZS.js +418 -0
  152. package/dist/vendor/chunk-YDY5P7GL.js +20 -0
  153. package/dist/vendor/chunk-ZNKZXDUD.js +18 -0
  154. package/dist/vendor/chunk-ZS3VW5QR.js +63 -0
  155. package/dist/vendor/chunk-ZUUCLHBP.js +18 -0
  156. package/dist/vendor/chunk-ZVJCBTJG.js +131 -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 +198 -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 +198 -0
  330. package/dist/vendor/node/NodeHttpClient.js +46 -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,70 @@
1
+ import {
2
+ fromDuplex,
3
+ fromReadable,
4
+ fromReadableChannel,
5
+ pipeThroughDuplex,
6
+ pipeThroughSimple,
7
+ toArrayBuffer,
8
+ toReadable,
9
+ toReadableNever,
10
+ toString,
11
+ toUint8Array
12
+ } from "./chunk-RQH5DSBA.js";
13
+ import {
14
+ __export
15
+ } from "./chunk-MLKGABMK.js";
16
+
17
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/node_modules/@effect/platform-bun/dist/BunStream.js
18
+ var BunStream_exports = {};
19
+ __export(BunStream_exports, {
20
+ fromDuplex: () => fromDuplex,
21
+ fromReadable: () => fromReadable,
22
+ fromReadableChannel: () => fromReadableChannel,
23
+ fromReadableStream: () => fromReadableStream,
24
+ pipeThroughDuplex: () => pipeThroughDuplex,
25
+ pipeThroughSimple: () => pipeThroughSimple,
26
+ toArrayBuffer: () => toArrayBuffer,
27
+ toReadable: () => toReadable,
28
+ toReadableNever: () => toReadableNever,
29
+ toString: () => toString,
30
+ toUint8Array: () => toUint8Array
31
+ });
32
+ import * as Arr from "effect/Array";
33
+ import * as Cause from "effect/Cause";
34
+ import * as Channel from "effect/Channel";
35
+ import * as Effect from "effect/Effect";
36
+ import { constVoid } from "effect/Function";
37
+ import * as Scope from "effect/Scope";
38
+ import * as Stream from "effect/Stream";
39
+ var fromReadableStream = (options) => Stream.fromChannel(Channel.fromTransform(Effect.fnUntraced(function* (_, scope) {
40
+ const reader = options.evaluate().getReader();
41
+ yield* Scope.addFinalizer(scope, options.releaseLockOnEnd ? Effect.sync(() => reader.releaseLock()) : Effect.promise(() => reader.cancel().catch(constVoid)));
42
+ function readMany() {
43
+ let result;
44
+ try {
45
+ result = reader.readMany();
46
+ } catch (error) {
47
+ return Effect.fail(options.onError(error));
48
+ }
49
+ if ("then" in result) {
50
+ return Effect.callback((resume) => {
51
+ result.then((_2) => resume(handleResult(_2)), (e) => resume(Effect.fail(options.onError(e))));
52
+ });
53
+ }
54
+ return handleResult(result);
55
+ }
56
+ function handleResult(result) {
57
+ if (result.done) {
58
+ return Cause.done();
59
+ } else if (!Arr.isReadonlyArrayNonEmpty(result.value)) {
60
+ return readMany();
61
+ }
62
+ return Effect.succeed(result.value);
63
+ }
64
+ return Effect.suspend(readMany);
65
+ })));
66
+
67
+ export {
68
+ fromReadableStream,
69
+ BunStream_exports
70
+ };
@@ -0,0 +1,16 @@
1
+ import {
2
+ layer
3
+ } from "./chunk-RKVXYKHJ.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-MLKGABMK.js";
7
+
8
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.4_effect@4.0.4/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
+ };
@@ -0,0 +1,426 @@
1
+ import {
2
+ NodeHttpIncomingMessage
3
+ } from "./chunk-D2ZL4PLZ.js";
4
+ import {
5
+ fromReadable,
6
+ toReadable
7
+ } from "./chunk-RQH5DSBA.js";
8
+ import {
9
+ fromWritable
10
+ } from "./chunk-A7UXCEJA.js";
11
+ import {
12
+ __export
13
+ } from "./chunk-MLKGABMK.js";
14
+
15
+ // ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeHttpClient.js
16
+ var NodeHttpClient_exports = {};
17
+ __export(NodeHttpClient_exports, {
18
+ Dispatcher: () => Dispatcher,
19
+ Fetch: () => Fetch,
20
+ HttpAgent: () => HttpAgent,
21
+ RequestInit: () => RequestInit,
22
+ UndiciOptions: () => UndiciOptions,
23
+ dispatcherLayerGlobal: () => dispatcherLayerGlobal,
24
+ layerAgent: () => layerAgent,
25
+ layerAgentOptions: () => layerAgentOptions,
26
+ layerDispatcher: () => layerDispatcher,
27
+ layerFetch: () => layer,
28
+ layerNodeHttp: () => layerNodeHttp,
29
+ layerNodeHttpNoAgent: () => layerNodeHttpNoAgent,
30
+ layerUndici: () => layerUndici,
31
+ layerUndiciNoDispatcher: () => layerUndiciNoDispatcher,
32
+ makeAgent: () => makeAgent,
33
+ makeDispatcher: () => makeDispatcher,
34
+ makeNodeHttp: () => makeNodeHttp,
35
+ makeUndici: () => makeUndici
36
+ });
37
+ import * as Context from "effect/Context";
38
+ import * as Effect from "effect/Effect";
39
+ import { flow } from "effect/Function";
40
+ import * as Cookies from "effect/http/Cookies";
41
+ import * as Headers from "effect/http/Headers";
42
+ import * as Client from "effect/http/HttpClient";
43
+ import * as Error from "effect/http/HttpClientError";
44
+ import * as Response from "effect/http/HttpClientResponse";
45
+ import * as IncomingMessage from "effect/http/HttpIncomingMessage";
46
+ import * as UrlParams from "effect/http/UrlParams";
47
+ import * as Inspectable from "effect/Inspectable";
48
+ import * as Layer from "effect/Layer";
49
+ import * as Option from "effect/Option";
50
+ import { pipeArguments } from "effect/Pipeable";
51
+ import * as Stream from "effect/Stream";
52
+ import * as Http from "node:http";
53
+ import * as Https from "node:https";
54
+ import { Readable } from "node:stream";
55
+ import { pipeline } from "node:stream/promises";
56
+ import {
57
+ Fetch,
58
+ layer,
59
+ RequestInit
60
+ } from "effect/http/FetchHttpClient";
61
+ var Dispatcher = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-node/NodeHttpClient/Dispatcher")) {
62
+ };
63
+ var loadUndici = /* @__PURE__ */ Effect.promise(() => import("./node/Undici.js"));
64
+ var makeDispatcher = /* @__PURE__ */ Effect.acquireRelease(/* @__PURE__ */ Effect.map(loadUndici, (_) => new _.Agent()), (dispatcher) => Effect.promise(() => dispatcher.destroy()));
65
+ var layerDispatcher = /* @__PURE__ */ Layer.effect(Dispatcher)(makeDispatcher);
66
+ var dispatcherLayerGlobal = /* @__PURE__ */ Layer.effect(Dispatcher)(/* @__PURE__ */ Effect.map(loadUndici, (_) => _.getGlobalDispatcher()));
67
+ var UndiciOptions = /* @__PURE__ */ Context.Reference("@effect/platform-node/NodeHttpClient/UndiciOptions", {
68
+ defaultValue: () => ({})
69
+ });
70
+ var makeUndici = /* @__PURE__ */ Effect.gen(function* () {
71
+ const dispatcher = yield* Dispatcher;
72
+ return Client.make((request3, url, signal, fiber) => convertBody(request3.body).pipe(Effect.flatMap((body) => Effect.tryPromise({
73
+ try: () => dispatcher.request({
74
+ ...fiber.getRef(UndiciOptions),
75
+ signal,
76
+ method: request3.method,
77
+ headers: request3.headers,
78
+ origin: url.origin,
79
+ path: url.pathname + url.search,
80
+ body,
81
+ // leave timeouts to Effect.timeout etc
82
+ headersTimeout: 60 * 60 * 1e3,
83
+ bodyTimeout: 0
84
+ }),
85
+ catch: (cause) => new Error.HttpClientError({
86
+ reason: new Error.TransportError({
87
+ request: request3,
88
+ cause
89
+ })
90
+ })
91
+ })), Effect.map((response) => new UndiciResponse(request3, response, url.href.split("#")[0]))));
92
+ });
93
+ function convertBody(body) {
94
+ switch (body._tag) {
95
+ case "Empty": {
96
+ return Effect.succeed(null);
97
+ }
98
+ case "Uint8Array":
99
+ case "Raw": {
100
+ return Effect.succeed(body.body);
101
+ }
102
+ case "FormData": {
103
+ return Effect.succeed(body.formData);
104
+ }
105
+ case "Stream": {
106
+ return toReadable(body.stream);
107
+ }
108
+ }
109
+ }
110
+ function noopErrorHandler(_) {
111
+ }
112
+ var UndiciResponse = class extends Inspectable.Class {
113
+ [IncomingMessage.TypeId];
114
+ [Response.TypeId];
115
+ request;
116
+ source;
117
+ url;
118
+ constructor(request3, source, url) {
119
+ super();
120
+ this[IncomingMessage.TypeId] = IncomingMessage.TypeId;
121
+ this[Response.TypeId] = Response.TypeId;
122
+ this.request = request3;
123
+ this.source = source;
124
+ this.url = url;
125
+ source.body.on("error", noopErrorHandler);
126
+ }
127
+ get status() {
128
+ return this.source.statusCode;
129
+ }
130
+ get statusText() {
131
+ return void 0;
132
+ }
133
+ get headers() {
134
+ return Headers.fromInput(this.source.headers);
135
+ }
136
+ cachedCookies;
137
+ get cookies() {
138
+ if (this.cachedCookies !== void 0) {
139
+ return this.cachedCookies;
140
+ }
141
+ const header = this.source.headers["set-cookie"];
142
+ return this.cachedCookies = header ? Cookies.fromSetCookie(header) : Cookies.empty;
143
+ }
144
+ get remoteAddress() {
145
+ return Option.none();
146
+ }
147
+ get stream() {
148
+ return fromReadable({
149
+ evaluate: () => this.source.body,
150
+ onError: (cause) => new Error.HttpClientError({
151
+ reason: new Error.DecodeError({
152
+ request: this.request,
153
+ response: this,
154
+ cause
155
+ })
156
+ })
157
+ });
158
+ }
159
+ get json() {
160
+ return Effect.flatMap(this.text, (text) => Effect.try({
161
+ try: () => text === "" ? null : JSON.parse(text),
162
+ catch: (cause) => new Error.HttpClientError({
163
+ reason: new Error.DecodeError({
164
+ request: this.request,
165
+ response: this,
166
+ cause
167
+ })
168
+ })
169
+ }));
170
+ }
171
+ textBody;
172
+ get text() {
173
+ if (this.textBody) {
174
+ return this.textBody;
175
+ }
176
+ this.textBody = Effect.map(this.arrayBuffer, (_) => new TextDecoder().decode(_));
177
+ return this.textBody;
178
+ }
179
+ get urlParamsBody() {
180
+ return Effect.flatMap(this.text, (_) => Effect.try({
181
+ try: () => UrlParams.fromInput(new URLSearchParams(_)),
182
+ catch: (cause) => new Error.HttpClientError({
183
+ reason: new Error.DecodeError({
184
+ request: this.request,
185
+ response: this,
186
+ cause
187
+ })
188
+ })
189
+ }));
190
+ }
191
+ formDataBody;
192
+ get formData() {
193
+ return this.formDataBody ??= Effect.flatMap(this.arrayBuffer, (body) => Effect.tryPromise({
194
+ try: () => new globalThis.Response(body, {
195
+ headers: this.headers
196
+ }).formData(),
197
+ catch: (cause) => new Error.HttpClientError({
198
+ reason: new Error.DecodeError({
199
+ request: this.request,
200
+ response: this,
201
+ cause
202
+ })
203
+ })
204
+ })).pipe(Effect.cached, Effect.runSync);
205
+ }
206
+ arrayBufferBody;
207
+ get arrayBuffer() {
208
+ if (this.arrayBufferBody) {
209
+ return this.arrayBufferBody;
210
+ }
211
+ this.arrayBufferBody = Effect.tryPromise({
212
+ try: () => this.source.body.arrayBuffer(),
213
+ catch: (cause) => new Error.HttpClientError({
214
+ reason: new Error.DecodeError({
215
+ request: this.request,
216
+ response: this,
217
+ cause
218
+ })
219
+ })
220
+ }).pipe(Effect.cached, Effect.runSync);
221
+ this.textBody = Effect.map(this.arrayBufferBody, (_) => new TextDecoder().decode(_));
222
+ return this.arrayBufferBody;
223
+ }
224
+ toJSON() {
225
+ return IncomingMessage.inspect(this, {
226
+ _id: "effect/http/HttpClientResponse",
227
+ request: this.request.toJSON(),
228
+ status: this.status
229
+ });
230
+ }
231
+ pipe() {
232
+ return pipeArguments(this, arguments);
233
+ }
234
+ };
235
+ var layerUndiciNoDispatcher = /* @__PURE__ */ Client.layerMergedContext(makeUndici);
236
+ var layerUndici = /* @__PURE__ */ Layer.provide(layerUndiciNoDispatcher, layerDispatcher);
237
+ var HttpAgent = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-node/NodeHttpClient/HttpAgent")) {
238
+ };
239
+ var makeAgent = (options) => Effect.zipWith(Effect.acquireRelease(Effect.sync(() => new Http.Agent(options)), (agent) => Effect.sync(() => agent.destroy())), Effect.acquireRelease(Effect.sync(() => new Https.Agent(options)), (agent) => Effect.sync(() => agent.destroy())), (http, https) => ({
240
+ http,
241
+ https
242
+ }));
243
+ var layerAgentOptions = /* @__PURE__ */ flow(makeAgent, /* @__PURE__ */ Layer.effect(HttpAgent));
244
+ var layerAgent = /* @__PURE__ */ layerAgentOptions();
245
+ var makeNodeHttp = /* @__PURE__ */ Effect.gen(function* () {
246
+ const agent = yield* HttpAgent;
247
+ return Client.make((request3, url, signal) => {
248
+ const nodeRequest = url.protocol === "https:" ? Https.request(url, {
249
+ agent: agent.https,
250
+ method: request3.method,
251
+ headers: request3.headers,
252
+ signal
253
+ }) : Http.request(url, {
254
+ agent: agent.http,
255
+ method: request3.method,
256
+ headers: request3.headers,
257
+ signal
258
+ });
259
+ return Effect.raceFirst(waitForResponse(nodeRequest, request3), sendBody(nodeRequest, request3, request3.body).pipe(Effect.andThen(Effect.never))).pipe(Effect.onError(() => Effect.sync(() => nodeRequest.destroy())), Effect.map((_) => new NodeHttpResponse(request3, _, url.href.split("#")[0])));
260
+ });
261
+ });
262
+ var sendBody = (nodeRequest, request3, body) => Effect.suspend(() => {
263
+ switch (body._tag) {
264
+ case "Empty": {
265
+ nodeRequest.end();
266
+ return waitForFinish(nodeRequest, request3);
267
+ }
268
+ case "Uint8Array":
269
+ case "Raw": {
270
+ nodeRequest.end(body.body);
271
+ return waitForFinish(nodeRequest, request3);
272
+ }
273
+ case "FormData": {
274
+ const response = new globalThis.Response(body.formData);
275
+ response.headers.forEach((value, key) => {
276
+ nodeRequest.setHeader(key, value);
277
+ });
278
+ return Effect.tryPromise({
279
+ try: () => pipeline(Readable.fromWeb(response.body), nodeRequest),
280
+ catch: (cause) => new Error.HttpClientError({
281
+ reason: new Error.TransportError({
282
+ request: request3,
283
+ cause
284
+ })
285
+ })
286
+ });
287
+ }
288
+ case "Stream": {
289
+ return Stream.run(Stream.mapError(body.stream, (cause) => new Error.HttpClientError({
290
+ reason: new Error.EncodeError({
291
+ request: request3,
292
+ cause
293
+ })
294
+ })), fromWritable({
295
+ evaluate: () => nodeRequest,
296
+ onError: (cause) => new Error.HttpClientError({
297
+ reason: new Error.TransportError({
298
+ request: request3,
299
+ cause
300
+ })
301
+ })
302
+ }));
303
+ }
304
+ }
305
+ });
306
+ var waitForResponse = (nodeRequest, request3) => Effect.callback((resume) => {
307
+ function onError2(cause) {
308
+ resume(Effect.fail(new Error.HttpClientError({
309
+ reason: new Error.TransportError({
310
+ request: request3,
311
+ cause
312
+ })
313
+ })));
314
+ }
315
+ nodeRequest.on("error", onError2);
316
+ function onResponse(response) {
317
+ nodeRequest.off("error", onError2);
318
+ resume(Effect.succeed(response));
319
+ }
320
+ nodeRequest.on("upgrade", onResponse);
321
+ nodeRequest.on("response", onResponse);
322
+ return Effect.sync(() => {
323
+ nodeRequest.off("error", onError2);
324
+ nodeRequest.off("upgrade", onResponse);
325
+ nodeRequest.off("response", onResponse);
326
+ });
327
+ });
328
+ var waitForFinish = (nodeRequest, request3) => Effect.callback((resume) => {
329
+ function onError2(cause) {
330
+ resume(Effect.fail(new Error.HttpClientError({
331
+ reason: new Error.TransportError({
332
+ request: request3,
333
+ cause
334
+ })
335
+ })));
336
+ }
337
+ nodeRequest.once("error", onError2);
338
+ function onFinish() {
339
+ nodeRequest.off("error", onError2);
340
+ resume(Effect.void);
341
+ }
342
+ nodeRequest.once("finish", onFinish);
343
+ return Effect.sync(() => {
344
+ nodeRequest.off("error", onError2);
345
+ nodeRequest.off("finish", onFinish);
346
+ });
347
+ });
348
+ var NodeHttpResponse = class extends NodeHttpIncomingMessage {
349
+ [Response.TypeId];
350
+ request;
351
+ url;
352
+ constructor(request3, source, url) {
353
+ super(source, (cause) => new Error.HttpClientError({
354
+ reason: new Error.DecodeError({
355
+ request: request3,
356
+ response: this,
357
+ cause
358
+ })
359
+ }));
360
+ this[Response.TypeId] = Response.TypeId;
361
+ this.request = request3;
362
+ this.url = url;
363
+ }
364
+ get status() {
365
+ return this.source.statusCode;
366
+ }
367
+ cachedCookies;
368
+ get cookies() {
369
+ if (this.cachedCookies !== void 0) {
370
+ return this.cachedCookies;
371
+ }
372
+ const header = this.source.headers["set-cookie"];
373
+ return this.cachedCookies = header ? Cookies.fromSetCookie(header) : Cookies.empty;
374
+ }
375
+ get formData() {
376
+ return Effect.tryPromise({
377
+ try: () => {
378
+ const init = {
379
+ headers: new globalThis.Headers(this.source.headers)
380
+ };
381
+ if (this.source.statusCode) {
382
+ init.status = this.source.statusCode;
383
+ }
384
+ if (this.source.statusMessage) {
385
+ init.statusText = this.source.statusMessage;
386
+ }
387
+ return new globalThis.Response(Readable.toWeb(this.source), init).formData();
388
+ },
389
+ catch: this.onError
390
+ });
391
+ }
392
+ toJSON() {
393
+ return IncomingMessage.inspect(this, {
394
+ _id: "effect/http/HttpClientResponse",
395
+ request: this.request.toJSON(),
396
+ status: this.status
397
+ });
398
+ }
399
+ pipe() {
400
+ return pipeArguments(this, arguments);
401
+ }
402
+ };
403
+ var layerNodeHttpNoAgent = /* @__PURE__ */ Client.layerMergedContext(makeNodeHttp);
404
+ var layerNodeHttp = /* @__PURE__ */ Layer.provide(layerNodeHttpNoAgent, layerAgent);
405
+
406
+ export {
407
+ Dispatcher,
408
+ makeDispatcher,
409
+ layerDispatcher,
410
+ dispatcherLayerGlobal,
411
+ UndiciOptions,
412
+ makeUndici,
413
+ layerUndiciNoDispatcher,
414
+ layerUndici,
415
+ HttpAgent,
416
+ makeAgent,
417
+ layerAgentOptions,
418
+ layerAgent,
419
+ makeNodeHttp,
420
+ layerNodeHttpNoAgent,
421
+ layerNodeHttp,
422
+ NodeHttpClient_exports,
423
+ Fetch,
424
+ layer,
425
+ RequestInit
426
+ };
@@ -0,0 +1,14 @@
1
+ // ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/internal/nodeChildProcessSpawner.js
2
+ var buildSpawnOptions = (options, base, platform) => {
3
+ const detached = options.detached ?? platform !== "win32";
4
+ return {
5
+ ...base,
6
+ detached,
7
+ shell: options.shell,
8
+ windowsHide: options.windowsHide ?? !detached
9
+ };
10
+ };
11
+
12
+ export {
13
+ buildSpawnOptions
14
+ };
@@ -0,0 +1,36 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.4_effect@4.0.4/node_modules/@effect/platform-node-shared/dist/NodeRuntime.js
6
+ var NodeRuntime_exports = {};
7
+ __export(NodeRuntime_exports, {
8
+ runMain: () => runMain
9
+ });
10
+ import * as Runtime from "effect/Runtime";
11
+ var runMain = /* @__PURE__ */ Runtime.makeRunMain(({
12
+ fiber,
13
+ teardown
14
+ }) => {
15
+ let receivedSignal = false;
16
+ fiber.addObserver((exit) => {
17
+ process.removeListener("SIGINT", onSigint);
18
+ process.removeListener("SIGTERM", onSigint);
19
+ teardown(exit, (code) => {
20
+ if (receivedSignal || code !== 0) {
21
+ process.exit(code);
22
+ }
23
+ });
24
+ });
25
+ function onSigint() {
26
+ receivedSignal = true;
27
+ fiber.interruptUnsafe(fiber.id);
28
+ }
29
+ process.on("SIGINT", onSigint);
30
+ process.on("SIGTERM", onSigint);
31
+ });
32
+
33
+ export {
34
+ runMain,
35
+ NodeRuntime_exports
36
+ };
@@ -0,0 +1,129 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // ../../../../node_modules/.pnpm/@effect+platform-node@4.0.4_effect@4.0.4_redis@6.2.1_@opentelemetry+api@1.9.1_/node_modules/@effect/platform-node/dist/NodeRedis.js
6
+ var NodeRedis_exports = {};
7
+ __export(NodeRedis_exports, {
8
+ NodeRedis: () => NodeRedis,
9
+ layer: () => layer,
10
+ layerConfig: () => layerConfig
11
+ });
12
+ import * as Config from "effect/Config";
13
+ import * as Context from "effect/Context";
14
+ import * as Deferred from "effect/Deferred";
15
+ import * as Effect from "effect/Effect";
16
+ import * as Fn from "effect/Function";
17
+ import * as Layer from "effect/Layer";
18
+ import * as Redis from "effect/persistence/Redis";
19
+ import { createClient, SocketTimeoutError } from "redis";
20
+ var NodeRedis = class extends (/* @__PURE__ */ Context.Service()("@effect/platform-node/NodeRedis")) {
21
+ };
22
+ var make4 = /* @__PURE__ */ Effect.fnUntraced(function* (options) {
23
+ let ready = false;
24
+ const socket = options?.socket;
25
+ const client = yield* Effect.acquireRelease(Effect.sync(() => createClient({
26
+ ...options,
27
+ socket: socket?.reconnectStrategy === void 0 ? {
28
+ ...socket,
29
+ reconnectStrategy: (retries, cause) => {
30
+ if (!ready) return cause;
31
+ if (cause instanceof SocketTimeoutError) return false;
32
+ const jitter = Math.floor(Math.random() * 200);
33
+ const delay = Math.min(2 ** retries * 50, 2e3);
34
+ return delay + jitter;
35
+ }
36
+ } : socket
37
+ })), (client2) => Effect.ignoreCause(Effect.promise(() => client2.close())));
38
+ client.once("ready", () => {
39
+ ready = true;
40
+ });
41
+ const runSync = Effect.runSyncWith(yield* Effect.context());
42
+ client.on("error", (cause) => {
43
+ runSync(Effect.logWarning("NodeRedis client error", cause));
44
+ });
45
+ yield* Effect.tryPromise({
46
+ try: () => client.connect(),
47
+ catch: (cause) => new Redis.RedisError({
48
+ cause
49
+ })
50
+ });
51
+ const use = (f) => Effect.tryPromise({
52
+ try: () => f(client),
53
+ catch: (cause) => new Redis.RedisError({
54
+ cause
55
+ })
56
+ });
57
+ const redis = yield* Redis.make({
58
+ send: (command, ...args) => Effect.tryPromise({
59
+ try: () => client.sendCommand([command, ...args]),
60
+ catch: (cause) => new Redis.RedisError({
61
+ cause
62
+ })
63
+ }),
64
+ subscribe: (channel, onMessage) => Effect.gen(function* () {
65
+ const terminal = yield* Deferred.make();
66
+ yield* Effect.acquireRelease(Effect.tryPromise({
67
+ try: async () => {
68
+ let subscriberReady = false;
69
+ const subscriber = client.duplicate(socket?.reconnectStrategy === void 0 ? {
70
+ socket: {
71
+ ...socket,
72
+ reconnectStrategy: (retries, cause) => {
73
+ if (!subscriberReady) return cause;
74
+ if (cause instanceof SocketTimeoutError) return false;
75
+ const jitter = Math.floor(Math.random() * 200);
76
+ const delay = Math.min(2 ** retries * 50, 2e3);
77
+ return delay + jitter;
78
+ }
79
+ }
80
+ } : {});
81
+ subscriber.once("ready", () => {
82
+ subscriberReady = true;
83
+ });
84
+ subscriber.on("error", (cause) => {
85
+ runSync(Effect.logWarning("NodeRedis subscriber error", cause));
86
+ if (!subscriber.isOpen) {
87
+ runSync(Deferred.fail(terminal, new Redis.RedisError({
88
+ cause
89
+ })));
90
+ }
91
+ });
92
+ try {
93
+ await subscriber.connect();
94
+ await subscriber.subscribe(channel, (message, channel2) => {
95
+ onMessage({
96
+ channel: channel2,
97
+ message
98
+ });
99
+ });
100
+ return subscriber;
101
+ } catch (cause) {
102
+ if (subscriber.isOpen) subscriber.destroy();
103
+ throw cause;
104
+ }
105
+ },
106
+ catch: (cause) => new Redis.RedisError({
107
+ cause
108
+ })
109
+ }), (subscriber) => Effect.sync(() => {
110
+ if (subscriber.isOpen) subscriber.destroy();
111
+ }));
112
+ return Deferred.await(terminal);
113
+ })
114
+ });
115
+ const nodeRedis = Fn.identity({
116
+ client,
117
+ use
118
+ });
119
+ return Context.make(NodeRedis, nodeRedis).pipe(Context.add(Redis.Redis, redis));
120
+ });
121
+ var layer = (options) => Layer.effectContext(make4(options));
122
+ var layerConfig = (options) => Layer.effectContext(Config.unwrap(options).pipe(Effect.flatMap(make4)));
123
+
124
+ export {
125
+ NodeRedis,
126
+ layer,
127
+ layerConfig,
128
+ NodeRedis_exports
129
+ };