@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,503 @@
1
+ import {
2
+ handleErrnoException
3
+ } from "./chunk-3SUO3TTE.js";
4
+ import {
5
+ __export
6
+ } from "./chunk-MLKGABMK.js";
7
+
8
+ // ../../../../node_modules/.pnpm/@effect+platform-node-shared@4.0.5_effect@4.0.5/node_modules/@effect/platform-node-shared/dist/NodeFileSystem.js
9
+ var NodeFileSystem_exports = {};
10
+ __export(NodeFileSystem_exports, {
11
+ layer: () => layer
12
+ });
13
+ import * as BI from "effect/BigInt";
14
+ import * as ByteSize from "effect/ByteSize";
15
+ import * as Cause from "effect/Cause";
16
+ import * as Effect from "effect/Effect";
17
+ import { effectify } from "effect/Effect";
18
+ import * as FileSystem from "effect/FileSystem";
19
+ import { pipe } from "effect/Function";
20
+ import * as Layer from "effect/Layer";
21
+ import * as Option from "effect/Option";
22
+ import * as Error from "effect/PlatformError";
23
+ import * as Queue from "effect/Queue";
24
+ import * as Stream from "effect/Stream";
25
+ import * as Crypto from "node:crypto";
26
+ import * as NFS from "node:fs";
27
+ import * as OS from "node:os";
28
+ import * as Path from "node:path";
29
+ var handleBadArgument = (method) => (err) => Error.badArgument({
30
+ module: "FileSystem",
31
+ method,
32
+ description: err.message ?? String(err)
33
+ });
34
+ var bigintToNumber = (value, field) => {
35
+ const number = Number(value);
36
+ if (!Number.isSafeInteger(number)) {
37
+ throw new RangeError(`${field} exceeds the safe integer range: ${value}`);
38
+ }
39
+ return number;
40
+ };
41
+ var bigintToNumberOption = (value) => Option.flatMap(Option.fromNullishOr(value), BI.toNumber);
42
+ var toUint64 = (value) => BigInt.asUintN(64, value);
43
+ var toUint64Option = (value) => Option.map(Option.fromNullishOr(value), toUint64);
44
+ var positionToNumber = (position, method) => Effect.try({
45
+ try: () => bigintToNumber(position, "position"),
46
+ catch: handleBadArgument(method)
47
+ });
48
+ var access2 = /* @__PURE__ */ (() => {
49
+ const nodeAccess = /* @__PURE__ */ effectify(NFS.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
50
+ return (path, options) => {
51
+ let mode = NFS.constants.F_OK;
52
+ if (options?.readable) {
53
+ mode |= NFS.constants.R_OK;
54
+ }
55
+ if (options?.writable) {
56
+ mode |= NFS.constants.W_OK;
57
+ }
58
+ return nodeAccess(path, mode);
59
+ };
60
+ })();
61
+ var copy = /* @__PURE__ */ (() => {
62
+ const nodeCp = /* @__PURE__ */ effectify(NFS.cp, /* @__PURE__ */ handleErrnoException("FileSystem", "copy"), /* @__PURE__ */ handleBadArgument("copy"));
63
+ return (fromPath, toPath, options) => nodeCp(fromPath, toPath, {
64
+ force: options?.overwrite ?? false,
65
+ preserveTimestamps: options?.preserveTimestamps ?? false,
66
+ recursive: true
67
+ });
68
+ })();
69
+ var copyFile2 = /* @__PURE__ */ (() => {
70
+ const nodeCopyFile = /* @__PURE__ */ effectify(NFS.copyFile, /* @__PURE__ */ handleErrnoException("FileSystem", "copyFile"), /* @__PURE__ */ handleBadArgument("copyFile"));
71
+ return (fromPath, toPath) => nodeCopyFile(fromPath, toPath);
72
+ })();
73
+ var chmod2 = /* @__PURE__ */ (() => {
74
+ const nodeChmod = /* @__PURE__ */ effectify(NFS.chmod, /* @__PURE__ */ handleErrnoException("FileSystem", "chmod"), /* @__PURE__ */ handleBadArgument("chmod"));
75
+ return (path, mode) => nodeChmod(path, mode);
76
+ })();
77
+ var chown2 = /* @__PURE__ */ (() => {
78
+ const nodeChown = /* @__PURE__ */ effectify(NFS.chown, /* @__PURE__ */ handleErrnoException("FileSystem", "chown"), /* @__PURE__ */ handleBadArgument("chown"));
79
+ return (path, uid, gid) => nodeChown(path, uid, gid);
80
+ })();
81
+ var glob2 = /* @__PURE__ */ (() => {
82
+ const nodeGlob = /* @__PURE__ */ effectify(NFS.glob, /* @__PURE__ */ handleErrnoException("FileSystem", "glob"), /* @__PURE__ */ handleBadArgument("glob"));
83
+ return (pattern, options) => nodeGlob(pattern, {
84
+ cwd: options?.root,
85
+ exclude: options?.exclude
86
+ });
87
+ })();
88
+ var link2 = /* @__PURE__ */ (() => {
89
+ const nodeLink = /* @__PURE__ */ effectify(NFS.link, /* @__PURE__ */ handleErrnoException("FileSystem", "link"), /* @__PURE__ */ handleBadArgument("link"));
90
+ return (existingPath, newPath) => nodeLink(existingPath, newPath);
91
+ })();
92
+ var makeDirectory = /* @__PURE__ */ (() => {
93
+ const nodeMkdir = /* @__PURE__ */ effectify(NFS.mkdir, /* @__PURE__ */ handleErrnoException("FileSystem", "makeDirectory"), /* @__PURE__ */ handleBadArgument("makeDirectory"));
94
+ return (path, options) => nodeMkdir(path, {
95
+ recursive: options?.recursive ?? false,
96
+ mode: options?.mode
97
+ });
98
+ })();
99
+ var makeTempDirectoryFactory = (method) => {
100
+ const nodeMkdtemp = effectify(NFS.mkdtemp, handleErrnoException("FileSystem", method), handleBadArgument(method));
101
+ return (options) => Effect.suspend(() => {
102
+ const prefix = options?.prefix ?? "";
103
+ const directory = typeof options?.directory === "string" ? Path.join(options.directory, ".") : OS.tmpdir();
104
+ return nodeMkdtemp(prefix ? Path.join(directory, prefix) : directory + "/");
105
+ });
106
+ };
107
+ var makeTempDirectory = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectory");
108
+ var removeFactory = (method) => {
109
+ const nodeRm = effectify(NFS.rm, handleErrnoException("FileSystem", method), handleBadArgument(method));
110
+ return (path, options) => nodeRm(path, {
111
+ recursive: options?.recursive ?? false,
112
+ force: options?.force ?? false
113
+ });
114
+ };
115
+ var remove = /* @__PURE__ */ removeFactory("remove");
116
+ var makeTempDirectoryScoped = /* @__PURE__ */ (() => {
117
+ const makeDirectory2 = /* @__PURE__ */ makeTempDirectoryFactory("makeTempDirectoryScoped");
118
+ const removeDirectory = /* @__PURE__ */ removeFactory("makeTempDirectoryScoped");
119
+ return (options) => Effect.acquireRelease(makeDirectory2(options), (directory) => Effect.orDie(removeDirectory(directory, {
120
+ recursive: true
121
+ })));
122
+ })();
123
+ var openFlagBits = (flag) => {
124
+ const {
125
+ O_APPEND,
126
+ O_CREAT,
127
+ O_EXCL,
128
+ O_RDONLY,
129
+ O_RDWR,
130
+ O_TRUNC,
131
+ O_WRONLY
132
+ } = NFS.constants;
133
+ switch (flag) {
134
+ case "r":
135
+ return O_RDONLY;
136
+ case "r+":
137
+ return O_RDWR;
138
+ case "w":
139
+ return O_TRUNC | O_CREAT | O_WRONLY;
140
+ case "wx":
141
+ return O_TRUNC | O_CREAT | O_WRONLY | O_EXCL;
142
+ case "w+":
143
+ return O_TRUNC | O_CREAT | O_RDWR;
144
+ case "wx+":
145
+ return O_TRUNC | O_CREAT | O_RDWR | O_EXCL;
146
+ case "a":
147
+ return O_APPEND | O_CREAT | O_WRONLY;
148
+ case "ax":
149
+ return O_APPEND | O_CREAT | O_WRONLY | O_EXCL;
150
+ case "a+":
151
+ return O_APPEND | O_CREAT | O_RDWR;
152
+ case "ax+":
153
+ return O_APPEND | O_CREAT | O_RDWR | O_EXCL;
154
+ }
155
+ };
156
+ var noFollowFlags = (method, flag) => Effect.suspend(() => {
157
+ const {
158
+ O_NOFOLLOW
159
+ } = NFS.constants;
160
+ if (process.platform === "win32" || typeof O_NOFOLLOW !== "number" || O_NOFOLLOW === 0) {
161
+ return Effect.fail(Error.badArgument({
162
+ module: "FileSystem",
163
+ method,
164
+ description: "noFollow is not supported on this platform"
165
+ }));
166
+ }
167
+ return Effect.succeed(openFlagBits(flag) | O_NOFOLLOW);
168
+ });
169
+ var openFactory = (method) => {
170
+ const nodeOpen = effectify(NFS.open, handleErrnoException("FileSystem", method), handleBadArgument(method));
171
+ const nodeClose = effectify(NFS.close, handleErrnoException("FileSystem", method), handleBadArgument(method));
172
+ return (path, options) => pipe(Effect.acquireRelease(options?.noFollow === true ? Effect.flatMap(noFollowFlags(method, options.flag ?? "r"), (flags) => nodeOpen(path, flags, options.mode)) : nodeOpen(path, options?.flag ?? "r", options?.mode), (fd) => Effect.orDie(nodeClose(fd))), Effect.map((fd) => makeFile(fd, options?.flag?.startsWith("a") ?? false)));
173
+ };
174
+ var open2 = /* @__PURE__ */ openFactory("open");
175
+ var negativePosition = (method) => Error.badArgument({
176
+ module: "FileSystem",
177
+ method,
178
+ description: "Cannot read before the start of the file"
179
+ });
180
+ var makeFile = /* @__PURE__ */ (() => {
181
+ const nodeReadFactory = (method) => effectify(NFS.read, handleErrnoException("FileSystem", method), handleBadArgument(method));
182
+ const nodeRead = /* @__PURE__ */ nodeReadFactory("read");
183
+ const nodeReadAlloc = /* @__PURE__ */ nodeReadFactory("readAlloc");
184
+ const nodeStat = /* @__PURE__ */ effectify(NFS.fstat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
185
+ const nodeTruncate = /* @__PURE__ */ effectify(NFS.ftruncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
186
+ const nodeSync = /* @__PURE__ */ effectify(NFS.fsync, /* @__PURE__ */ handleErrnoException("FileSystem", "sync"), /* @__PURE__ */ handleBadArgument("sync"));
187
+ const nodeWriteFactory = (method) => effectify(NFS.write, handleErrnoException("FileSystem", method), handleBadArgument(method));
188
+ const nodeWrite = /* @__PURE__ */ nodeWriteFactory("write");
189
+ const nodeWriteAll = /* @__PURE__ */ nodeWriteFactory("writeAll");
190
+ class FileImpl {
191
+ [FileSystem.FileTypeId];
192
+ fd;
193
+ append;
194
+ position = /* @__PURE__ */ BigInt(0);
195
+ constructor(fd, append) {
196
+ this[FileSystem.FileTypeId] = FileSystem.FileTypeId;
197
+ this.fd = fd;
198
+ this.append = append;
199
+ }
200
+ get stat() {
201
+ return Effect.flatMap(nodeStat(this.fd, {
202
+ bigint: true
203
+ }), makeFileInfo);
204
+ }
205
+ get sync() {
206
+ return nodeSync(this.fd);
207
+ }
208
+ seek(offset, from) {
209
+ return Effect.suspend(() => {
210
+ const position = from === "start" ? offset : this.position + offset;
211
+ if (position < BigInt(0)) {
212
+ return Effect.fail(Error.badArgument({
213
+ module: "FileSystem",
214
+ method: "seek",
215
+ description: "Cannot seek before the start of the file"
216
+ }));
217
+ }
218
+ this.position = position;
219
+ return Effect.succeed(position);
220
+ });
221
+ }
222
+ read(buffer, options) {
223
+ return Effect.suspend(() => {
224
+ const explicit = options?.position;
225
+ if (explicit !== void 0) {
226
+ return explicit < BigInt(0) ? Effect.fail(negativePosition("read")) : nodeRead(this.fd, {
227
+ buffer,
228
+ position: explicit
229
+ });
230
+ }
231
+ const position = this.position;
232
+ return Effect.map(nodeRead(this.fd, {
233
+ buffer,
234
+ position
235
+ }), (bytesRead) => {
236
+ this.position = position + BigInt(bytesRead);
237
+ return bytesRead;
238
+ });
239
+ });
240
+ }
241
+ readAlloc(size, options) {
242
+ return Effect.suspend(() => {
243
+ try {
244
+ if (!Number.isInteger(size) || size < 0) {
245
+ throw new RangeError("size must be a non-negative integer");
246
+ }
247
+ const explicit = options?.position;
248
+ if (explicit !== void 0 && explicit < BigInt(0)) {
249
+ return Effect.fail(negativePosition("readAlloc"));
250
+ }
251
+ const buffer = Buffer.allocUnsafeSlow(size);
252
+ const position = explicit ?? this.position;
253
+ return Effect.map(nodeReadAlloc(this.fd, {
254
+ buffer,
255
+ position
256
+ }), (bytesRead) => {
257
+ if (bytesRead === 0) {
258
+ return Option.none();
259
+ }
260
+ if (explicit === void 0) {
261
+ this.position = position + BigInt(bytesRead);
262
+ }
263
+ if (bytesRead === size) {
264
+ return Option.some(buffer);
265
+ }
266
+ const dst = Buffer.allocUnsafeSlow(bytesRead);
267
+ buffer.copy(dst, 0, 0, bytesRead);
268
+ return Option.some(dst);
269
+ });
270
+ } catch (cause) {
271
+ return Effect.fail(handleBadArgument("readAlloc")(cause));
272
+ }
273
+ });
274
+ }
275
+ truncate(length) {
276
+ return Effect.map(nodeTruncate(this.fd, length || void 0), () => {
277
+ if (!this.append) {
278
+ const len = BigInt(length ?? 0);
279
+ if (this.position > len) {
280
+ this.position = len;
281
+ }
282
+ }
283
+ });
284
+ }
285
+ write(buffer) {
286
+ return Effect.suspend(() => {
287
+ const position = this.position;
288
+ return Effect.flatMap(this.append ? Effect.succeed(void 0) : positionToNumber(position, "write"), (nodePosition) => Effect.map(nodeWrite(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
289
+ if (!this.append) {
290
+ this.position = position + BigInt(bytesWritten);
291
+ }
292
+ return bytesWritten;
293
+ }));
294
+ });
295
+ }
296
+ writeAllChunk(buffer) {
297
+ return Effect.suspend(() => {
298
+ const position = this.position;
299
+ return Effect.flatMap(this.append ? Effect.succeed(void 0) : positionToNumber(position, "writeAll"), (nodePosition) => Effect.flatMap(nodeWriteAll(this.fd, buffer, void 0, void 0, nodePosition), (bytesWritten) => {
300
+ if (bytesWritten === 0) {
301
+ return Effect.fail(Error.systemError({
302
+ module: "FileSystem",
303
+ method: "writeAll",
304
+ _tag: "WriteZero",
305
+ pathOrDescriptor: this.fd,
306
+ description: "write returned 0 bytes written"
307
+ }));
308
+ }
309
+ if (!this.append) {
310
+ this.position = position + BigInt(bytesWritten);
311
+ }
312
+ return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.void;
313
+ }));
314
+ });
315
+ }
316
+ writeAll(buffer) {
317
+ return buffer.length === 0 ? Effect.void : this.writeAllChunk(buffer);
318
+ }
319
+ }
320
+ return (fd, append) => new FileImpl(fd, append);
321
+ })();
322
+ var makeTempFileFactory = (method) => {
323
+ const makeDirectory2 = makeTempDirectoryFactory(method);
324
+ return Effect.fnUntraced(function* (options) {
325
+ const directory = yield* makeDirectory2(options);
326
+ const random = Crypto.randomBytes(6).toString("hex");
327
+ const name = Path.join(directory, options?.suffix ? `${random}${options.suffix}` : random);
328
+ yield* writeFile2(name, new Uint8Array(0));
329
+ return name;
330
+ });
331
+ };
332
+ var makeTempFile = /* @__PURE__ */ makeTempFileFactory("makeTempFile");
333
+ var makeTempFileScoped = /* @__PURE__ */ (() => {
334
+ const makeFile2 = /* @__PURE__ */ makeTempFileFactory("makeTempFileScoped");
335
+ const removeDirectory = /* @__PURE__ */ removeFactory("makeTempFileScoped");
336
+ return (options) => Effect.acquireRelease(makeFile2(options), (file) => Effect.orDie(removeDirectory(Path.dirname(file), {
337
+ recursive: true
338
+ })));
339
+ })();
340
+ var readDirectory = (path, options) => Effect.tryPromise({
341
+ try: () => NFS.promises.readdir(path, options),
342
+ catch: (err) => handleErrnoException("FileSystem", "readDirectory")(err, [path])
343
+ });
344
+ var readFile2 = (path) => Effect.callback((resume, signal) => {
345
+ try {
346
+ NFS.readFile(path, {
347
+ signal
348
+ }, (err, data) => {
349
+ if (err) {
350
+ resume(Effect.fail(handleErrnoException("FileSystem", "readFile")(err, [path])));
351
+ } else {
352
+ resume(Effect.succeed(data));
353
+ }
354
+ });
355
+ } catch (err) {
356
+ resume(Effect.fail(handleBadArgument("readFile")(err)));
357
+ }
358
+ });
359
+ var readLink = /* @__PURE__ */ (() => {
360
+ const nodeReadLink = /* @__PURE__ */ effectify(NFS.readlink, /* @__PURE__ */ handleErrnoException("FileSystem", "readLink"), /* @__PURE__ */ handleBadArgument("readLink"));
361
+ return (path) => nodeReadLink(path);
362
+ })();
363
+ var realPath = /* @__PURE__ */ (() => {
364
+ const nodeRealPath = /* @__PURE__ */ effectify(NFS.realpath, /* @__PURE__ */ handleErrnoException("FileSystem", "realPath"), /* @__PURE__ */ handleBadArgument("realPath"));
365
+ return (path) => nodeRealPath(path);
366
+ })();
367
+ var rename2 = /* @__PURE__ */ (() => {
368
+ const nodeRename = /* @__PURE__ */ effectify(NFS.rename, /* @__PURE__ */ handleErrnoException("FileSystem", "rename"), /* @__PURE__ */ handleBadArgument("rename"));
369
+ return (oldPath, newPath) => nodeRename(oldPath, newPath);
370
+ })();
371
+ var makeFileInfo = (stat3) => Effect.try({
372
+ try: () => ({
373
+ type: stat3.isFile() ? "File" : stat3.isDirectory() ? "Directory" : stat3.isSymbolicLink() ? "SymbolicLink" : stat3.isBlockDevice() ? "BlockDevice" : stat3.isCharacterDevice() ? "CharacterDevice" : stat3.isFIFO() ? "FIFO" : stat3.isSocket() ? "Socket" : "Unknown",
374
+ mtime: Option.fromNullishOr(stat3.mtime),
375
+ atime: Option.fromNullishOr(stat3.atime),
376
+ birthtime: Option.fromNullishOr(stat3.birthtime),
377
+ dev: toUint64(stat3.dev),
378
+ rdev: toUint64Option(stat3.rdev),
379
+ ino: toUint64Option(stat3.ino),
380
+ mode: bigintToNumber(stat3.mode, "mode"),
381
+ nlink: toUint64Option(stat3.nlink),
382
+ uid: bigintToNumberOption(stat3.uid),
383
+ gid: bigintToNumberOption(stat3.gid),
384
+ size: ByteSize.bytes(stat3.size),
385
+ blksize: stat3.blksize !== void 0 ? Option.some(ByteSize.bytes(stat3.blksize)) : Option.none(),
386
+ blocks: Option.fromNullishOr(stat3.blocks)
387
+ }),
388
+ catch: handleBadArgument("stat")
389
+ });
390
+ var stat2 = /* @__PURE__ */ (() => {
391
+ const nodeStat = /* @__PURE__ */ effectify(NFS.stat, /* @__PURE__ */ handleErrnoException("FileSystem", "stat"), /* @__PURE__ */ handleBadArgument("stat"));
392
+ return (path) => Effect.flatMap(nodeStat(path, {
393
+ bigint: true
394
+ }), makeFileInfo);
395
+ })();
396
+ var symlink2 = /* @__PURE__ */ (() => {
397
+ const nodeSymlink = /* @__PURE__ */ effectify(NFS.symlink, /* @__PURE__ */ handleErrnoException("FileSystem", "symlink"), /* @__PURE__ */ handleBadArgument("symlink"));
398
+ return (target, path) => nodeSymlink(target, path);
399
+ })();
400
+ var truncate2 = /* @__PURE__ */ (() => {
401
+ const nodeTruncate = /* @__PURE__ */ effectify(NFS.truncate, /* @__PURE__ */ handleErrnoException("FileSystem", "truncate"), /* @__PURE__ */ handleBadArgument("truncate"));
402
+ return (path, length) => nodeTruncate(path, length);
403
+ })();
404
+ var utimes2 = /* @__PURE__ */ (() => {
405
+ const nodeUtimes = /* @__PURE__ */ effectify(NFS.utimes, /* @__PURE__ */ handleErrnoException("FileSystem", "utime"), /* @__PURE__ */ handleBadArgument("utime"));
406
+ return (path, atime, mtime) => nodeUtimes(path, atime, mtime);
407
+ })();
408
+ var watchNode = (path, info, options) => Stream.callback((queue) => Effect.acquireRelease(Effect.sync(() => {
409
+ const directory = info.type === "Directory" ? path : Path.dirname(path);
410
+ const watcher = NFS.watch(path, {
411
+ recursive: options?.recursive ?? false
412
+ }, (event, path2) => {
413
+ if (!path2) return;
414
+ switch (event) {
415
+ case "rename": {
416
+ Effect.runFork(Effect.matchEffect(stat2(Path.resolve(directory, path2)), {
417
+ onSuccess: (_) => Queue.offer(queue, {
418
+ _tag: "Create",
419
+ path: path2
420
+ }),
421
+ onFailure: (_) => Queue.offer(queue, {
422
+ _tag: "Remove",
423
+ path: path2
424
+ })
425
+ }));
426
+ return;
427
+ }
428
+ case "change": {
429
+ Queue.offerUnsafe(queue, {
430
+ _tag: "Update",
431
+ path: path2
432
+ });
433
+ return;
434
+ }
435
+ }
436
+ });
437
+ watcher.on("error", (error) => {
438
+ Queue.failCauseUnsafe(queue, Cause.fail(Error.systemError({
439
+ module: "FileSystem",
440
+ _tag: "Unknown",
441
+ method: "watch",
442
+ pathOrDescriptor: path,
443
+ cause: error
444
+ })));
445
+ });
446
+ watcher.on("close", () => {
447
+ Queue.endUnsafe(queue);
448
+ });
449
+ return watcher;
450
+ }), (watcher) => Effect.sync(() => watcher.close())).pipe(Effect.tap(() => Effect.sync(() => options?.onReady?.()))));
451
+ var watch2 = (backend, path, options) => Effect.all([stat2(path), Effect.serviceOption(FileSystem.WatchBackend)]).pipe(Effect.map(([stat3, callerBackend]) => Option.orElse(callerBackend, () => backend).pipe(Option.flatMap((_) => _.register(path, stat3, options)), Option.getOrElse(() => watchNode(path, stat3, options)))), Stream.unwrap);
452
+ var writeFile2 = (path, data, options) => Effect.callback((resume, signal) => {
453
+ try {
454
+ NFS.writeFile(path, data, {
455
+ signal,
456
+ flag: options?.flag,
457
+ mode: options?.mode
458
+ }, (err) => {
459
+ if (err) {
460
+ resume(Effect.fail(handleErrnoException("FileSystem", "writeFile")(err, [path])));
461
+ } else {
462
+ resume(Effect.void);
463
+ }
464
+ });
465
+ } catch (err) {
466
+ resume(Effect.fail(handleBadArgument("writeFile")(err)));
467
+ }
468
+ });
469
+ var makeFileSystem = /* @__PURE__ */ Effect.map(/* @__PURE__ */ Effect.serviceOption(FileSystem.WatchBackend), (backend) => FileSystem.make({
470
+ access: access2,
471
+ chmod: chmod2,
472
+ chown: chown2,
473
+ copy,
474
+ copyFile: copyFile2,
475
+ glob: glob2,
476
+ link: link2,
477
+ makeDirectory,
478
+ makeTempDirectory,
479
+ makeTempDirectoryScoped,
480
+ makeTempFile,
481
+ makeTempFileScoped,
482
+ open: open2,
483
+ readDirectory,
484
+ readFile: readFile2,
485
+ readLink,
486
+ realPath,
487
+ remove,
488
+ rename: rename2,
489
+ stat: stat2,
490
+ symlink: symlink2,
491
+ truncate: truncate2,
492
+ utimes: utimes2,
493
+ watch(path, options) {
494
+ return watch2(backend, path, options);
495
+ },
496
+ writeFile: writeFile2
497
+ }));
498
+ var layer = /* @__PURE__ */ Layer.effect(FileSystem.FileSystem)(makeFileSystem);
499
+
500
+ export {
501
+ layer,
502
+ NodeFileSystem_exports
503
+ };
@@ -0,0 +1,63 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.5_effect@4.0.5/node_modules/@effect/platform-bun/dist/BunWorker.js
6
+ var BunWorker_exports = {};
7
+ __export(BunWorker_exports, {
8
+ layer: () => layer,
9
+ layerPlatform: () => layerPlatform
10
+ });
11
+ import * as Deferred from "effect/Deferred";
12
+ import * as Effect from "effect/Effect";
13
+ import * as Exit from "effect/Exit";
14
+ import * as Layer from "effect/Layer";
15
+ import * as Scope from "effect/Scope";
16
+ import * as Worker from "effect/workers/Worker";
17
+ import { WorkerError, WorkerUnknownError } from "effect/workers/WorkerError";
18
+ var layer = (spawn) => Layer.merge(layerPlatform, Layer.succeed(Worker.Spawner)(spawn));
19
+ var layerPlatform = /* @__PURE__ */ Layer.succeed(Worker.WorkerPlatform)(/* @__PURE__ */ Worker.makePlatform()({
20
+ setup({
21
+ scope,
22
+ worker
23
+ }) {
24
+ const closeDeferred = Deferred.makeUnsafe();
25
+ worker.addEventListener("close", () => {
26
+ Deferred.doneUnsafe(closeDeferred, Exit.void);
27
+ });
28
+ return Effect.as(Scope.addFinalizer(scope, Effect.suspend(() => {
29
+ worker.postMessage([1]);
30
+ return Deferred.await(closeDeferred);
31
+ }).pipe(Effect.interruptible, Effect.timeout(5e3), Effect.catchCause(() => Effect.sync(() => worker.terminate())))), worker);
32
+ },
33
+ listen({
34
+ deferred,
35
+ emit,
36
+ port,
37
+ scope
38
+ }) {
39
+ function onMessage(event) {
40
+ emit(event.data);
41
+ }
42
+ function onError(event) {
43
+ Deferred.doneUnsafe(deferred, new WorkerError({
44
+ reason: new WorkerUnknownError({
45
+ message: "An error event was emitted",
46
+ cause: event.error ?? event.message
47
+ })
48
+ }));
49
+ }
50
+ port.addEventListener("message", onMessage);
51
+ port.addEventListener("error", onError);
52
+ return Scope.addFinalizer(scope, Effect.sync(() => {
53
+ port.removeEventListener("message", onMessage);
54
+ port.removeEventListener("error", onError);
55
+ }));
56
+ }
57
+ }));
58
+
59
+ export {
60
+ layer,
61
+ layerPlatform,
62
+ BunWorker_exports
63
+ };
@@ -0,0 +1,26 @@
1
+ import {
2
+ layer,
3
+ layerPosix,
4
+ layerWin32
5
+ } from "./chunk-JTST2Z7N.js";
6
+ import {
7
+ __export
8
+ } from "./chunk-MLKGABMK.js";
9
+
10
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.5_effect@4.0.5/node_modules/@effect/platform-bun/dist/BunPath.js
11
+ var BunPath_exports = {};
12
+ __export(BunPath_exports, {
13
+ layer: () => layer2,
14
+ layerPosix: () => layerPosix2,
15
+ layerWin32: () => layerWin322
16
+ });
17
+ var layer2 = layer;
18
+ var layerPosix2 = layerPosix;
19
+ var layerWin322 = layerWin32;
20
+
21
+ export {
22
+ layer2 as layer,
23
+ layerPosix2 as layerPosix,
24
+ layerWin322 as layerWin32,
25
+ BunPath_exports
26
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-MLKGABMK.js";
4
+
5
+ // ../../../../node_modules/.pnpm/@effect+platform-bun@4.0.5_effect@4.0.5/node_modules/@effect/platform-bun/dist/BunHttpServerRequest.js
6
+ var BunHttpServerRequest_exports = {};
7
+ __export(BunHttpServerRequest_exports, {
8
+ toBunServerRequest: () => toBunServerRequest
9
+ });
10
+ var toBunServerRequest = (self) => self.source;
11
+
12
+ export {
13
+ toBunServerRequest,
14
+ BunHttpServerRequest_exports
15
+ };