@smthrs/platform-bun 1.0.0-rc.15 → 1.0.0-rc.18

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 (346) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +6 -5
  3. package/dist/cjs/BunDesktop.d.ts +49 -0
  4. package/dist/cjs/BunDesktop.d.ts.map +1 -0
  5. package/dist/cjs/BunDesktop.js +119 -0
  6. package/dist/cjs/BunDesktop.js.map +7 -0
  7. package/dist/cjs/BunFileReplacement.d.ts +10 -0
  8. package/dist/cjs/BunFileReplacement.d.ts.map +1 -0
  9. package/dist/cjs/BunFileReplacement.js +111 -0
  10. package/dist/cjs/BunFileReplacement.js.map +7 -0
  11. package/dist/cjs/BunFileSystem.d.ts +2 -0
  12. package/dist/cjs/BunFileSystem.d.ts.map +1 -1
  13. package/dist/cjs/BunFileSystem.js +4 -1
  14. package/dist/cjs/BunFileSystem.js.map +2 -2
  15. package/dist/cjs/BunGarbageCollector.d.ts +28 -0
  16. package/dist/cjs/BunGarbageCollector.d.ts.map +1 -0
  17. package/dist/cjs/BunGarbageCollector.js +44 -0
  18. package/dist/cjs/BunGarbageCollector.js.map +7 -0
  19. package/dist/cjs/BunHost.d.ts +6 -5
  20. package/dist/cjs/BunHost.d.ts.map +1 -1
  21. package/dist/cjs/BunHost.js +11 -31
  22. package/dist/cjs/BunHost.js.map +2 -2
  23. package/dist/cjs/BunRuntime.d.ts +55 -0
  24. package/dist/cjs/BunRuntime.d.ts.map +1 -0
  25. package/dist/cjs/BunRuntime.js +67 -0
  26. package/dist/cjs/BunRuntime.js.map +7 -0
  27. package/dist/cjs/BunServer.d.ts +4 -0
  28. package/dist/cjs/BunServer.d.ts.map +1 -0
  29. package/dist/cjs/BunServer.js +43 -0
  30. package/dist/cjs/BunServer.js.map +7 -0
  31. package/dist/cjs/Electrobun.d.ts +51 -0
  32. package/dist/cjs/index.d.ts +11 -0
  33. package/dist/cjs/index.d.ts.map +1 -1
  34. package/dist/cjs/index.js +9 -1
  35. package/dist/cjs/index.js.map +2 -2
  36. package/dist/cjs/internal/ElectrobunUnavailable.d.ts +12 -0
  37. package/dist/cjs/internal/ElectrobunUnavailable.d.ts.map +1 -0
  38. package/dist/cjs/internal/ElectrobunUnavailable.js +4 -0
  39. package/dist/cjs/internal/ElectrobunUnavailable.js.map +7 -0
  40. package/dist/cjs/package.json +1 -1
  41. package/dist/esm/BunDesktop.d.ts +49 -0
  42. package/dist/esm/BunDesktop.d.ts.map +1 -0
  43. package/dist/esm/BunDesktop.js +86 -0
  44. package/dist/esm/BunDesktop.js.map +1 -0
  45. package/dist/esm/BunFileReplacement.d.ts +10 -0
  46. package/dist/esm/BunFileReplacement.d.ts.map +1 -0
  47. package/dist/esm/BunFileReplacement.js +88 -0
  48. package/dist/esm/BunFileReplacement.js.map +1 -0
  49. package/dist/esm/BunFileSystem.d.ts +2 -0
  50. package/dist/esm/BunFileSystem.d.ts.map +1 -1
  51. package/dist/esm/BunFileSystem.js +2 -0
  52. package/dist/esm/BunFileSystem.js.map +1 -1
  53. package/dist/esm/BunGarbageCollector.d.ts +28 -0
  54. package/dist/esm/BunGarbageCollector.d.ts.map +1 -0
  55. package/dist/esm/BunGarbageCollector.js +33 -0
  56. package/dist/esm/BunGarbageCollector.js.map +1 -0
  57. package/dist/esm/BunHost.d.ts +6 -5
  58. package/dist/esm/BunHost.d.ts.map +1 -1
  59. package/dist/esm/BunHost.js.map +1 -1
  60. package/dist/esm/BunRuntime.d.ts +55 -0
  61. package/dist/esm/BunRuntime.d.ts.map +1 -0
  62. package/dist/esm/BunRuntime.js +64 -0
  63. package/dist/esm/BunRuntime.js.map +1 -0
  64. package/dist/esm/BunServer.d.ts +4 -0
  65. package/dist/esm/BunServer.d.ts.map +1 -0
  66. package/dist/esm/BunServer.js +12 -0
  67. package/dist/esm/BunServer.js.map +1 -0
  68. package/dist/esm/Electrobun.d.ts +51 -0
  69. package/dist/esm/index.d.ts +11 -0
  70. package/dist/esm/index.d.ts.map +1 -1
  71. package/dist/esm/index.js +11 -0
  72. package/dist/esm/index.js.map +1 -1
  73. package/dist/esm/internal/ElectrobunUnavailable.d.ts +12 -0
  74. package/dist/esm/internal/ElectrobunUnavailable.d.ts.map +1 -0
  75. package/dist/esm/internal/ElectrobunUnavailable.js +13 -0
  76. package/dist/esm/internal/ElectrobunUnavailable.js.map +1 -0
  77. package/dist/vendor/adapters.json +595 -391
  78. package/dist/vendor/bun/BunAddressResolver.js +2 -2
  79. package/dist/vendor/bun/BunChildProcessSpawner.js +7 -6
  80. package/dist/vendor/bun/BunClusterHttp.js +30 -28
  81. package/dist/vendor/bun/BunClusterSocket.js +10 -9
  82. package/dist/vendor/bun/BunCrypto.d.ts +20 -5
  83. package/dist/vendor/bun/BunCrypto.js +22 -4
  84. package/dist/vendor/bun/BunDatagramSocket.js +1 -1
  85. package/dist/vendor/bun/BunDns.js +2 -2
  86. package/dist/vendor/bun/BunFileSystem.js +3 -3
  87. package/dist/vendor/bun/BunHttpClient.d.ts +69 -4
  88. package/dist/vendor/bun/BunHttpClient.js +7 -1
  89. package/dist/vendor/bun/BunHttpPlatform.js +5 -5
  90. package/dist/vendor/bun/BunHttpServer.d.ts +23 -3
  91. package/dist/vendor/bun/BunHttpServer.js +21 -22
  92. package/dist/vendor/bun/BunHttpServerRequest.js +1 -1
  93. package/dist/vendor/bun/BunMultipart.js +5 -4
  94. package/dist/vendor/bun/BunPath.js +2 -2
  95. package/dist/vendor/bun/BunRedis.d.ts +8 -8
  96. package/dist/vendor/bun/BunRedis.js +1 -1
  97. package/dist/vendor/bun/BunRuntime.js +2 -2
  98. package/dist/vendor/bun/BunServices.d.ts +2 -3
  99. package/dist/vendor/bun/BunServices.js +16 -17
  100. package/dist/vendor/bun/BunSink.js +3 -2
  101. package/dist/vendor/bun/BunSocket.js +2 -4
  102. package/dist/vendor/bun/BunSocketServer.js +4 -3
  103. package/dist/vendor/bun/BunStdio.js +5 -4
  104. package/dist/vendor/bun/BunStream.js +6 -3
  105. package/dist/vendor/bun/BunTerminal.js +2 -2
  106. package/dist/vendor/bun/BunWorker.js +1 -1
  107. package/dist/vendor/bun/BunWorkerRunner.js +1 -1
  108. package/dist/vendor/bun/index.js +47 -45
  109. package/dist/vendor/chunk-247EE36J.js +131 -0
  110. package/dist/vendor/{chunk-2AP6TO77.js → chunk-2Q5VXM4T.js} +14 -14
  111. package/dist/vendor/chunk-2QFVW3BY.js +18 -0
  112. package/dist/vendor/{chunk-Q7YXUH7M.js → chunk-2TAKH4LZ.js} +8 -11
  113. package/dist/vendor/chunk-34FRQZPM.js +31 -0
  114. package/dist/vendor/{chunk-226TYKP6.js → chunk-3HVWTM7M.js} +3 -3
  115. package/dist/vendor/{chunk-BIR74JJK.js → chunk-4RLL7U2M.js} +44 -8
  116. package/dist/vendor/{chunk-OAY4MA3I.js → chunk-4Z4AEV2K.js} +2 -2
  117. package/dist/vendor/{chunk-EIO7BKW3.js → chunk-54JWTRQK.js} +19 -17
  118. package/dist/vendor/{chunk-S3MN5OXB.js → chunk-5BYAOVLW.js} +4 -2
  119. package/dist/vendor/{chunk-XAZH2ZEU.js → chunk-6OMXBDTL.js} +2 -2
  120. package/dist/vendor/chunk-6QQ3SUXB.js +158 -0
  121. package/dist/vendor/{chunk-NNTJGFLB.js → chunk-6QSRJFVA.js} +1 -1
  122. package/dist/vendor/{chunk-7VJC3PHX.js → chunk-6W6EO7I4.js} +1 -1
  123. package/dist/vendor/{chunk-M2QOSF47.js → chunk-6WHXJMO2.js} +3 -3
  124. package/dist/vendor/{chunk-JYD572EF.js → chunk-7PMWMPOD.js} +2 -2
  125. package/dist/vendor/chunk-7YVLVGO4.js +753 -0
  126. package/dist/vendor/{chunk-6R444NFO.js → chunk-AAEXZQSU.js} +1 -1
  127. package/dist/vendor/{chunk-6B775XB2.js → chunk-ABVAXOEY.js} +1 -1
  128. package/dist/vendor/{chunk-RX5TKFP7.js → chunk-AC3M3777.js} +2 -4
  129. package/dist/vendor/{chunk-BVV46N3V.js → chunk-BCG523GQ.js} +79 -42
  130. package/dist/vendor/{chunk-YJGNV6EV.js → chunk-BZ7TO5VD.js} +2 -2
  131. package/dist/vendor/chunk-CI6SGVLG.js +16 -0
  132. package/dist/vendor/chunk-CUN3ZMYJ.js +10 -0
  133. package/dist/vendor/chunk-DSADVUXF.js +16 -0
  134. package/dist/vendor/chunk-DSY3TYB7.js +18 -0
  135. package/dist/vendor/{chunk-QLI7T34M.js → chunk-E7EXD4C2.js} +2 -2
  136. package/dist/vendor/{chunk-2LGUVSNM.js → chunk-FKSZC2RQ.js} +2 -2
  137. package/dist/vendor/{chunk-ABPRHPJP.js → chunk-GR24JP5B.js} +1 -1
  138. package/dist/vendor/chunk-HC2MFJOJ.js +31 -0
  139. package/dist/vendor/{chunk-X6FYP2EH.js → chunk-HF7CVDZF.js} +24 -6
  140. package/dist/vendor/{chunk-C7UMBJO6.js → chunk-HFPZNE3Y.js} +2 -2
  141. package/dist/vendor/{chunk-JTST2Z7N.js → chunk-HJ7STH54.js} +1 -1
  142. package/dist/vendor/{chunk-4YK2MHSO.js → chunk-HL63XGXV.js} +2 -2
  143. package/dist/vendor/{chunk-Q5UCOQNO.js → chunk-ILHISGEV.js} +4 -2
  144. package/dist/vendor/{chunk-HYPKWCVW.js → chunk-IYDTMNPA.js} +1 -1
  145. package/dist/vendor/{chunk-R2PFJKSP.js → chunk-JADMK4IH.js} +1 -1
  146. package/dist/vendor/{chunk-GITB76ZP.js → chunk-JEN66X7H.js} +2 -2
  147. package/dist/vendor/{chunk-NGGMPIWR.js → chunk-JP2QNJPA.js} +16 -16
  148. package/dist/vendor/{chunk-V577GRCI.js → chunk-JT25M26P.js} +300 -76
  149. package/dist/vendor/chunk-K4AFNRCK.js +42 -0
  150. package/dist/vendor/chunk-LHDLLNNM.js +34 -0
  151. package/dist/vendor/{chunk-XAVBQY4D.js → chunk-M37BSX7S.js} +2 -2
  152. package/dist/vendor/chunk-MFFOXR32.js +18 -0
  153. package/dist/vendor/{chunk-AMAL6TRE.js → chunk-N2ZI2O5G.js} +22 -7
  154. package/dist/vendor/{chunk-DWSNOBD4.js → chunk-NLVIDXLS.js} +2 -2
  155. package/dist/vendor/chunk-O3BAZ7K4.js +190 -0
  156. package/dist/vendor/{chunk-TBMTA5LD.js → chunk-O4LP4KM7.js} +1 -1
  157. package/dist/vendor/{chunk-GMORYZG4.js → chunk-ODG4WEI7.js} +8 -23
  158. package/dist/vendor/chunk-OV7ZSS47.js +108 -0
  159. package/dist/vendor/{chunk-NU53DHQR.js → chunk-PHQJCWLW.js} +2 -2
  160. package/dist/vendor/chunk-Q4NLVQCK.js +18 -0
  161. package/dist/vendor/{chunk-J43O5GFH.js → chunk-QF5PXUU3.js} +2 -2
  162. package/dist/vendor/{chunk-3SUO3TTE.js → chunk-QKLWUKYV.js} +2 -1
  163. package/dist/vendor/{chunk-HXGVOKHF.js → chunk-QMH7TQLU.js} +2 -2
  164. package/dist/vendor/{chunk-T5WDTZCE.js → chunk-QXHYMXAQ.js} +96 -54
  165. package/dist/vendor/{chunk-QKYYD3AZ.js → chunk-RKZQKTIY.js} +11 -3
  166. package/dist/vendor/{chunk-XF3WZCMZ.js → chunk-ROM7FNBB.js} +2 -2
  167. package/dist/vendor/{chunk-UXIG7ALP.js → chunk-SX32IFZW.js} +14 -14
  168. package/dist/vendor/chunk-TNAS2DA6.js +31 -0
  169. package/dist/vendor/{chunk-VS6VBUH6.js → chunk-TS3H5I34.js} +3 -3
  170. package/dist/vendor/{chunk-PBM2HJOX.js → chunk-TT4Q3V47.js} +1 -1
  171. package/dist/vendor/chunk-ULICRQML.js +34 -0
  172. package/dist/vendor/{chunk-KANNAI65.js → chunk-UN7WT5SA.js} +17 -15
  173. package/dist/vendor/{chunk-IXI7RW3A.js → chunk-UVEVKOUH.js} +148 -67
  174. package/dist/vendor/{chunk-FIPFWLCV.js → chunk-V3L7KC7B.js} +24 -7
  175. package/dist/vendor/{chunk-AW6WQVI7.js → chunk-VATPWTNX.js} +1 -1
  176. package/dist/vendor/chunk-VEBJSD2W.js +28 -0
  177. package/dist/vendor/{chunk-7ZKNPDTP.js → chunk-VKXJAUEE.js} +2 -2
  178. package/dist/vendor/{chunk-BHV44Z6K.js → chunk-WBIXKLPV.js} +1 -1
  179. package/dist/vendor/{chunk-CN4K2U6M.js → chunk-WJIDMZQD.js} +2 -2
  180. package/dist/vendor/{chunk-KEMBVIRS.js → chunk-X764RJZ6.js} +4 -4
  181. package/dist/vendor/{chunk-TCKM3JXD.js → chunk-Y4NFA7FZ.js} +1 -1
  182. package/dist/vendor/chunk-YSBKSW5I.js +34 -0
  183. package/dist/vendor/{chunk-7JOAEKDV.js → chunk-Z5XEIUMX.js} +28 -20
  184. package/dist/vendor/cjs/bun/BunCrypto.d.ts +20 -5
  185. package/dist/vendor/cjs/bun/BunHttpClient.d.ts +69 -4
  186. package/dist/vendor/cjs/bun/BunHttpServer.d.ts +23 -3
  187. package/dist/vendor/cjs/bun/BunRedis.d.ts +8 -8
  188. package/dist/vendor/cjs/bun/BunServices.d.ts +2 -3
  189. package/dist/vendor/cjs/node/NodeCrypto.d.ts +13 -5
  190. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +2 -2
  191. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +8 -0
  192. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +64 -13
  193. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +11 -7
  194. package/dist/vendor/cjs/node/NodeMultipart.d.ts +1 -1
  195. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +3 -6
  196. package/dist/vendor/cjs/node/NodeRedis.d.ts +19 -7
  197. package/dist/vendor/cjs/node/NodeServices.d.ts +2 -3
  198. package/dist/vendor/cjs/node/NodeSocket.d.ts +27 -14
  199. package/dist/vendor/cjs/node/NodeWS.d.ts +21 -0
  200. package/dist/vendor/cjs/node/NodeWS.js +1 -0
  201. package/dist/vendor/cjs/node/index.d.ts +5 -0
  202. package/dist/vendor/cjs/node/internal/http.d.ts +5 -0
  203. package/dist/vendor/cjs/node/internal/http.js +1 -0
  204. package/dist/vendor/cjs/node/internal/upgrade.d.ts +2 -0
  205. package/dist/vendor/cjs/node/internal/upgrade.js +1 -0
  206. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +3 -1
  207. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +172 -13
  208. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +7 -5
  209. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +24 -14
  210. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +16 -3
  211. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +64 -2
  212. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +3 -3
  213. package/dist/vendor/cjs/node-shared/NodeWS.d.ts +14 -0
  214. package/dist/vendor/cjs/node-shared/NodeWS.js +1 -0
  215. package/dist/vendor/cjs/node-shared/index.d.ts +5 -0
  216. package/dist/vendor/cjs/node-shared/internal/stream.d.ts +3 -0
  217. package/dist/vendor/cjs/node-shared/internal/stream.js +1 -0
  218. package/dist/vendor/cjs/platform-node-shared.d.ts +5 -0
  219. package/dist/vendor/cjs/platform-node.d.ts +5 -0
  220. package/dist/vendor/node/NodeAddressResolver.js +2 -2
  221. package/dist/vendor/node/NodeChildProcessSpawner.js +7 -6
  222. package/dist/vendor/node/NodeClusterHttp.js +37 -32
  223. package/dist/vendor/node/NodeClusterSocket.js +18 -15
  224. package/dist/vendor/node/NodeCrypto.d.ts +13 -5
  225. package/dist/vendor/node/NodeCrypto.js +22 -4
  226. package/dist/vendor/node/NodeDatagramSocket.js +2 -2
  227. package/dist/vendor/node/NodeDns.js +2 -2
  228. package/dist/vendor/node/NodeFileSystem.js +3 -3
  229. package/dist/vendor/node/NodeHttpClient.d.ts +2 -2
  230. package/dist/vendor/node/NodeHttpClient.js +8 -6
  231. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +8 -0
  232. package/dist/vendor/node/NodeHttpIncomingMessage.js +5 -4
  233. package/dist/vendor/node/NodeHttpPlatform.js +9 -8
  234. package/dist/vendor/node/NodeHttpServer.d.ts +64 -13
  235. package/dist/vendor/node/NodeHttpServer.js +29 -26
  236. package/dist/vendor/node/NodeHttpServerRequest.d.ts +11 -7
  237. package/dist/vendor/node/NodeHttpServerRequest.js +1 -1
  238. package/dist/vendor/node/NodeMultipart.d.ts +1 -1
  239. package/dist/vendor/node/NodeMultipart.js +6 -5
  240. package/dist/vendor/node/NodeMultipartParser.d.ts +3 -6
  241. package/dist/vendor/node/NodeMultipartParser.js +1 -1
  242. package/dist/vendor/node/NodePath.js +2 -2
  243. package/dist/vendor/node/NodeRedis.d.ts +19 -7
  244. package/dist/vendor/node/NodeRedis.js +1 -1
  245. package/dist/vendor/node/NodeRuntime.js +2 -2
  246. package/dist/vendor/node/NodeServices.d.ts +2 -3
  247. package/dist/vendor/node/NodeServices.js +16 -17
  248. package/dist/vendor/node/NodeSink.js +3 -2
  249. package/dist/vendor/node/NodeSocket.d.ts +27 -14
  250. package/dist/vendor/node/NodeSocket.js +3 -7
  251. package/dist/vendor/node/NodeSocketServer.js +4 -3
  252. package/dist/vendor/node/NodeStdio.js +5 -4
  253. package/dist/vendor/node/NodeStream.js +6 -3
  254. package/dist/vendor/node/NodeTerminal.js +2 -2
  255. package/dist/vendor/node/NodeWS.d.ts +21 -0
  256. package/dist/vendor/node/NodeWS.js +25 -0
  257. package/dist/vendor/node/NodeWorker.js +1 -1
  258. package/dist/vendor/node/NodeWorkerRunner.js +1 -1
  259. package/dist/vendor/node/Undici.js +1 -1
  260. package/dist/vendor/node/index.d.ts +5 -0
  261. package/dist/vendor/node/index.js +54 -46
  262. package/dist/vendor/node/internal/http.d.ts +5 -0
  263. package/dist/vendor/node/internal/http.js +9 -0
  264. package/dist/vendor/node/internal/upgrade.d.ts +2 -0
  265. package/dist/vendor/node/internal/upgrade.js +13 -0
  266. package/dist/vendor/node-shared/NodeAddressResolver.js +1 -1
  267. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +3 -1
  268. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +6 -5
  269. package/dist/vendor/node-shared/NodeClusterSocket.js +4 -3
  270. package/dist/vendor/node-shared/NodeCrypto.d.ts +172 -13
  271. package/dist/vendor/node-shared/NodeCrypto.js +19 -3
  272. package/dist/vendor/node-shared/NodeDatagramSocket.js +1 -1
  273. package/dist/vendor/node-shared/NodeDns.js +1 -1
  274. package/dist/vendor/node-shared/NodeFileSystem.js +2 -2
  275. package/dist/vendor/node-shared/NodeHttpCompression.js +1 -1
  276. package/dist/vendor/node-shared/NodePath.js +1 -1
  277. package/dist/vendor/node-shared/NodeRuntime.js +1 -1
  278. package/dist/vendor/node-shared/NodeSink.d.ts +7 -5
  279. package/dist/vendor/node-shared/NodeSink.js +2 -1
  280. package/dist/vendor/node-shared/NodeSocket.d.ts +24 -14
  281. package/dist/vendor/node-shared/NodeSocket.js +1 -3
  282. package/dist/vendor/node-shared/NodeSocketServer.d.ts +16 -3
  283. package/dist/vendor/node-shared/NodeSocketServer.js +3 -2
  284. package/dist/vendor/node-shared/NodeStdio.js +4 -3
  285. package/dist/vendor/node-shared/NodeStream.d.ts +64 -2
  286. package/dist/vendor/node-shared/NodeStream.js +5 -2
  287. package/dist/vendor/node-shared/NodeTerminal.d.ts +3 -3
  288. package/dist/vendor/node-shared/NodeTerminal.js +1 -1
  289. package/dist/vendor/node-shared/NodeWS.d.ts +14 -0
  290. package/dist/vendor/node-shared/NodeWS.js +21 -0
  291. package/dist/vendor/node-shared/index.d.ts +5 -0
  292. package/dist/vendor/node-shared/index.js +25 -20
  293. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +1 -1
  294. package/dist/vendor/node-shared/internal/stream.d.ts +3 -0
  295. package/dist/vendor/node-shared/internal/stream.js +7 -0
  296. package/dist/vendor/node-shared/internal/utils.js +1 -1
  297. package/dist/vendor/platform-bun.js +47 -45
  298. package/dist/vendor/platform-node-shared.d.ts +5 -0
  299. package/dist/vendor/platform-node-shared.js +25 -20
  300. package/dist/vendor/platform-node.d.ts +5 -0
  301. package/dist/vendor/platform-node.js +54 -46
  302. package/dist/vendor/ws.d.mts +1 -0
  303. package/docs/README.md +8 -8
  304. package/docs/api.md +124 -12
  305. package/docs/concepts/host-surface.md +9 -2
  306. package/docs/concepts/runtime-parity.md +5 -3
  307. package/docs/guides/configure-the-filesystem-helper.md +4 -3
  308. package/docs/installation.md +7 -6
  309. package/docs/quickstart.md +50 -3
  310. package/docs/troubleshooting.md +1 -1
  311. package/package.json +43 -19
  312. package/patches/electrobun@1.18.1.patch +160 -0
  313. package/src/BunDesktop.d.ts +1 -0
  314. package/src/BunDesktop.d.vibe.ts +48 -0
  315. package/src/BunDesktop.vibe +83 -0
  316. package/src/BunFileReplacement.d.ts +1 -0
  317. package/src/BunFileReplacement.d.vibe.ts +9 -0
  318. package/src/BunFileReplacement.vibe +62 -0
  319. package/src/BunFileSystem.ts +3 -0
  320. package/src/BunGarbageCollector.ts +40 -0
  321. package/src/BunHost.ts +6 -5
  322. package/src/BunRuntime.ts +88 -0
  323. package/src/BunServer.d.ts +1 -0
  324. package/src/BunServer.d.vibe.ts +3 -0
  325. package/src/BunServer.vibe +8 -0
  326. package/src/Electrobun.d.ts +51 -0
  327. package/src/index.ts +15 -0
  328. package/src/internal/ElectrobunUnavailable.ts +14 -0
  329. package/dist/vendor/chunk-2ADOI6ZN.js +0 -18
  330. package/dist/vendor/chunk-4O4Z52A2.js +0 -48
  331. package/dist/vendor/chunk-6KYVM2ZC.js +0 -419
  332. package/dist/vendor/chunk-BTXZUHUI.js +0 -7
  333. package/dist/vendor/chunk-D6XNHJPW.js +0 -18
  334. package/dist/vendor/chunk-DHTPLWAP.js +0 -34
  335. package/dist/vendor/chunk-DX4VFONH.js +0 -81
  336. package/dist/vendor/chunk-IJON5WTO.js +0 -34
  337. package/dist/vendor/chunk-K6GWBGJM.js +0 -16
  338. package/dist/vendor/chunk-OV2KKGBA.js +0 -16
  339. package/dist/vendor/chunk-QR2ZOVOL.js +0 -18
  340. package/dist/vendor/chunk-WGUQHMX2.js +0 -18
  341. package/dist/vendor/chunk-WNS3OER2.js +0 -18
  342. package/dist/vendor/chunk-XDPP24MG.js +0 -129
  343. package/dist/vendor/chunk-ZJEHEPDQ.js +0 -18
  344. /package/dist/vendor/{chunk-6QPSLCUZ.js → chunk-LCVIQ46E.js} +0 -0
  345. /package/dist/vendor/{chunk-LOB26XOO.js → chunk-VX2SMMVZ.js} +0 -0
  346. /package/dist/vendor/{chunk-XXVMTKX5.js → chunk-YGZPEHOY.js} +0 -0
@@ -67,20 +67,23 @@ const previewLimit = 64;
67
67
  const preview = (root, budget) => {
68
68
  const points = Array.from(root);
69
69
  const whole = JSON.stringify(root);
70
- if (points.length <= previewLimit && whole.length <= budget) return whole;
70
+ if (points.length <= previewLimit && whole.length <= budget)
71
+ return whole;
71
72
  const suffix = `... (${points.length} characters)`;
72
73
  const room = budget - suffix.length - 2;
73
74
  let excerpt = "";
74
75
  for (const point of points.slice(0, previewLimit)) {
75
76
  const encoded = JSON.stringify(point).slice(1, -1);
76
- if (excerpt.length + encoded.length > room) break;
77
+ if (excerpt.length + encoded.length > room)
78
+ break;
77
79
  excerpt += encoded;
78
80
  }
79
81
  return `"${excerpt}"${suffix}`;
80
82
  };
81
83
  const absoluteRoot = (factory, root) => {
82
84
  const requirement = !(0, import_node_path.isAbsolute)(root) ? "an absolute repository root" : root.includes("\0") ? "a repository root without NUL" : void 0;
83
- if (requirement === void 0) return root;
85
+ if (requirement === void 0)
86
+ return root;
84
87
  const prefix = `BunHost.${factory} requires ${requirement}, got `;
85
88
  throw new BunHostError({
86
89
  code: "invalid_repository_root",
@@ -100,28 +103,13 @@ const reaping = (options) => ({
100
103
  });
101
104
  const platform = Layer.mergeAll(BunFileSystem.layer, BunPath.layer, BunCrypto.layer);
102
105
  const layerHttpClient = EgressHttpClient.layer(process.env);
103
- const layer = Layer.mergeAll(
104
- ProcessConfinement.layer(),
105
- platform,
106
- Layer.provide(BunChildProcessSpawner.layer, platform),
107
- BunJj.layer,
108
- layerHttpClient
109
- );
106
+ const layer = Layer.mergeAll(ProcessConfinement.layer(), platform, Layer.provide(BunChildProcessSpawner.layer, platform), BunJj.layer, layerHttpClient);
110
107
  const layerAt = (root) => {
111
108
  const repositoryRoot = absoluteRoot("layerAt", root);
112
- return Layer.mergeAll(
113
- ProcessConfinement.layer(),
114
- platform,
115
- Layer.provide(BunChildProcessSpawner.layer, platform),
116
- BunJj.layerAt(repositoryRoot),
117
- layerHttpClient
118
- );
109
+ return Layer.mergeAll(ProcessConfinement.layer(), platform, Layer.provide(BunChildProcessSpawner.layer, platform), BunJj.layerAt(repositoryRoot), layerHttpClient);
119
110
  };
120
111
  const layerContained = (options) => {
121
- const spawner = Layer.provide(
122
- ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),
123
- Layer.provide(BunChildProcessSpawner.layer, platform)
124
- );
112
+ const spawner = Layer.provide(ProcessReaper.layerSpawner({ graceMs: options?.graceMs }), Layer.provide(BunChildProcessSpawner.layer, platform));
125
113
  return Layer.mergeAll(
126
114
  ProcessConfinement.layer(),
127
115
  platform,
@@ -134,15 +122,7 @@ const layerContained = (options) => {
134
122
  };
135
123
  const layerContainedAt = (root, options) => {
136
124
  const repositoryRoot = absoluteRoot("layerContainedAt", root);
137
- const spawner = Layer.provide(
138
- ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),
139
- Layer.provide(BunChildProcessSpawner.layer, platform)
140
- );
141
- return Layer.mergeAll(
142
- ProcessConfinement.layer(),
143
- platform,
144
- layerHttpClient,
145
- Layer.provideMerge(BunJj.layerSpawnerAt(repositoryRoot), spawner)
146
- ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
125
+ const spawner = Layer.provide(ProcessReaper.layerSpawner({ graceMs: options?.graceMs }), Layer.provide(BunChildProcessSpawner.layer, platform));
126
+ return Layer.mergeAll(ProcessConfinement.layer(), platform, layerHttpClient, Layer.provideMerge(BunJj.layerSpawnerAt(repositoryRoot), spawner)).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
147
127
  };
148
128
  //# sourceMappingURL=BunHost.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/BunHost.ts"],
4
- "sourcesContent": ["/**\n * Aggregate Bun Host bundle.\n *\n * Runtime-specific dependencies stay inside this package; callers get the same\n * closed five-service Host surface every other bundle provides, plus native\n * `ProcessConfinement` for guarded commands.\n *\n * There is no Bun shell module: running a command is Effect's\n * `ChildProcessSpawner`, and `@effect/platform-bun`'s implementation is\n * `@effect/platform-node-shared`'s re-exported: the same code on both\n * runtimes, so no runtime detection is needed here.\n *\n * Outgoing HTTP uses the shared EgressHttpClient on both runtimes. Web\n * requests pin approved addresses; ordinary requests retain the shared pool.\n * Redirects remain visible to the capability kernel, and proxy routing follows\n * the host environment.\n *\n * The filesystem slot is `@smthrs/platform-node`'s `AtomicFileSystem`, byte for\n * byte the layer `NodeHost` uses, so a guarded path operation is\n * descriptor-relative and no-follow on both runtimes.\n *\n * @since 1.0.0-rc.0\n */\n\nimport * as BunChildProcessSpawner from \"@effect/platform-bun/BunChildProcessSpawner\"\nimport * as BunCrypto from \"@effect/platform-bun/BunCrypto\"\nimport * as BunPath from \"@effect/platform-bun/BunPath\"\nimport type { Jj } from \"@smthrs/jj\"\nimport * as BunJj from \"@smthrs/jj/bun/BunJj\"\nimport type { HostServiceIds } from \"@smthrs/kernel/HostServices\"\nimport type * as KernelProcessConfinement from \"@smthrs/kernel/ProcessConfinement\"\nimport type * as ProcessLedger from \"@smthrs/kernel/ProcessLedger\"\nimport * as AtomicFileSystem from \"@smthrs/platform-node/AtomicFileSystem\"\nimport * as EgressHttpClient from \"@smthrs/platform-node/EgressHttpClient\"\nimport * as HostLiveness from \"@smthrs/platform-node/HostLiveness\"\nimport * as ProcessConfinement from \"@smthrs/platform-node/ProcessConfinement\"\nimport * as ProcessReaper from \"@smthrs/platform-node/ProcessReaper\"\nimport type * as Crypto from \"effect/Crypto\"\nimport type { FileSystem } from \"effect/FileSystem\"\nimport type { HttpClient } from \"effect/http/HttpClient\"\nimport * as Layer from \"effect/Layer\"\nimport type * as Path from \"effect/Path\"\nimport type { ChildProcessSpawner } from \"effect/process/ChildProcessSpawner\"\nimport * as Schema from \"effect/Schema\"\nimport { isAbsolute } from \"node:path\"\nimport * as BunFileSystem from \"./BunFileSystem.ts\"\n\n/**\n * Bun platform modules for selectively providing individual services.\n *\n * `AtomicFileSystem` is here for the same reason `NodeHost` re-exports it: it\n * owns the only configuration escape hatch the filesystem slot has, and a Bun\n * program with a different packaged helper path needs to reach\n * `AtomicFileSystem.layerWith` without hand-composing the other four tags.\n *\n * `BunJj` is deliberately absent: it belongs to `@smthrs/jj` and is imported\n * from there, never re-exported here. So is `@effect/platform-bun/BunHttpClient`:\n * its `layer` follows redirects to origins the capability kernel never\n * authorized. The network slot on its own is {@link layerHttpClient}.\n *\n * @category re-exports\n * @since 1.0.0-rc.0\n * @slop\n */\nexport { AtomicFileSystem, BunChildProcessSpawner, BunCrypto, BunFileSystem, HostLiveness, ProcessReaper }\n\n/**\n * The complete closed Host service union provided by Bun.\n *\n * @category models\n * @since 1.0.0-rc.0\n * @slop\n */\nexport type BunHost =\n | FileSystem\n | Path.Path\n | ChildProcessSpawner\n | Jj\n | HttpClient\n | KernelProcessConfinement.ProcessConfinement\n\n/**\n * The stable codes a `BunHost` factory refuses with.\n *\n * A code is the contract a caller branches on; the message beside it is for a\n * person. `invalid_repository_root` is the root handed to {@link layerAt} or\n * {@link layerContainedAt} not being absolute or containing NUL, the empty\n * string included.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type BunHostErrorCode = \"invalid_repository_root\"\n\n/**\n * The refusal a `BunHost` factory throws before it builds a layer.\n *\n * It is thrown rather than failed because a factory is called while a program\n * composes its layers, where there is no fiber to fail yet and a wrong root is\n * a composition mistake, not a runtime outcome. It is this package's class,\n * not the `Jj` adapter's, because a Bun caller composes `BunHost` and should\n * learn nothing about the adapter behind the `Jj` slot from an error message.\n *\n * @category errors\n * @since 1.0.0-rc.0\n */\nexport class BunHostError extends Schema.TaggedError<BunHostError>()(\"@smthrs/platform-bun/BunHostError\", {\n code: Schema.Literal(\"invalid_repository_root\"),\n message: Schema.String\n}) {\n override readonly name = \"BunHostError\"\n}\n\n/** The longest message a factory refuses with, in UTF-16 code units. */\nconst messageLimit = 255\n\n/** How many code points of a refused root the message repeats at most. */\nconst previewLimit = 64\n\n/**\n * A bounded, quoted excerpt of a refused root that fits in `budget` code\n * units of the message.\n *\n * Counted in code points rather than UTF-16 units so a cut never splits a\n * surrogate pair, and passed through `JSON.stringify` so a newline in the root\n * cannot break the log line the message lands on. Each code point is encoded\n * on its own and admitted only while the quoted excerpt plus the length\n * suffix still fit, so a control character that widens to a `\\u0001` escape\n * shortens the excerpt instead of lengthening the message, and a cut never\n * lands inside an escape.\n */\nconst preview = (root: string, budget: number): string => {\n const points = Array.from(root)\n const whole = JSON.stringify(root)\n if (points.length <= previewLimit && whole.length <= budget) return whole\n const suffix = `... (${points.length} characters)`\n const room = budget - suffix.length - 2\n let excerpt = \"\"\n for (const point of points.slice(0, previewLimit)) {\n const encoded = JSON.stringify(point).slice(1, -1)\n if (excerpt.length + encoded.length > room) break\n excerpt += encoded\n }\n return `\"${excerpt}\"${suffix}`\n}\n\n/**\n * Refuses a root the `Jj` adapter underneath would refuse, here and in this\n * package's name.\n *\n * `BunJj.layerAt` and `BunJj.layerSpawnerAt` are `NodeJj`'s, and those throw a\n * bare `TypeError` that names `NodeJj`, carries no code, and echoes the whole\n * string. The predicate includes the same `isAbsolute` the adapter applies, so\n * a root that passes this check cannot reach that throw. An absolute root\n * containing NUL is refused too: no filesystem or process API can represent it.\n */\nconst absoluteRoot = (factory: \"layerAt\" | \"layerContainedAt\", root: string): string => {\n // An absolute root with NUL names that defect, not absoluteness it already has.\n const requirement = !isAbsolute(root)\n ? \"an absolute repository root\"\n : root.includes(\"\\0\")\n ? \"a repository root without NUL\"\n : undefined\n if (requirement === undefined) return root\n const prefix = `BunHost.${factory} requires ${requirement}, got `\n throw new BunHostError({\n code: \"invalid_repository_root\",\n message: `${prefix}${preview(root, messageLimit - prefix.length)}`\n })\n}\n\n/**\n * Stable implementation identities keyed by the closed Host service slots.\n *\n * Each value names the module behind that slot in the raw host bundle.\n * Contained POSIX factories replace the spawner with {@link ProcessReaper.layerSpawner}.\n * These are identity\n * tokens rather than import specifiers: the filesystem entry is\n * `@smthrs/platform-node/AtomicFileSystem` because that is the implementation,\n * even though a consumer reaches it through `@smthrs/platform-bun`.\n *\n * Nothing digests them yet. `@smthrs/plan`'s step key carries a `layers`\n * component these values are meant to feed, but no planner derives it from a\n * host bundle today, so changing one invalidates no cached step.\n *\n * The keys are written as literals rather than `HostServiceIds` positions so\n * that reordering the closed list cannot silently pair a slot with another\n * slot's implementation.\n *\n * @category models\n * @since 1.0.0-rc.0\n * @slop\n */\nexport const implementationIds: Readonly<Record<(typeof HostServiceIds)[number], string>> = {\n \"effect/FileSystem\": \"@smthrs/platform-node/AtomicFileSystem\",\n \"effect/Path\": \"@effect/platform-bun/BunPath\",\n \"effect/process/ChildProcessSpawner\": \"@effect/platform-bun/BunChildProcessSpawner\",\n \"@smthrs/jj/Jj\": \"@smthrs/jj/bun/BunJj\",\n \"effect/HttpClient\": \"@smthrs/platform-node/EgressHttpClient\"\n}\n\n/**\n * What a caller may configure about containment.\n *\n * `ContainedSpawner.Options.platform` is deliberately not part of it. It\n * decides one thing, whether a command that names no `detached` option gets a\n * process group of its own, and this native host detaches by `process.platform`\n * whatever a record claims. A\n * caller-supplied `\"win32\"` on a POSIX host would therefore record\n * `pgid: null` for a child that really does lead a group, and\n * {@link ProcessReaper.reap} would retire that record as `no-group` and leave\n * the orphan running forever: a durable lie rather than a compile error.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type ContainedOptions = ProcessReaper.SpawnerOptions & ProcessReaper.Options\n\n/** The reaper half of {@link ContainedOptions}. */\nconst reaping = (options?: ContainedOptions): ProcessReaper.Options => ({\n ownerPid: options?.ownerPid,\n system: options?.system\n})\n\n/** The two services `BunChildProcessSpawner` resolves paths and files with. */\nconst platform = Layer.mergeAll(BunFileSystem.layer, BunPath.layer, BunCrypto.layer)\n\n/**\n * The network slot on its own: the shared egress client, which never follows a\n * redirect. A `3xx` comes back to the caller with its `location` intact and the\n * second origin uncontacted; following a redirect is `@smthrs/kernel`'s guarded\n * `HttpClient.layer`, which rechecks every hop.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerHttpClient: Layer.Layer<HttpClient> = EgressHttpClient.layer(process.env)\n\n/**\n * Provides all five Bun Host services, including the runtime-independent Path\n * service.\n *\n * Builds on a host without jj. The `Jj` slot probes `jj --version` on its\n * first operation and fails that operation with `JjError` carrying\n * `not_installed` or `unsupported_version`; a program that never calls `Jj`\n * runs without jj. `Jj` requires jj 0.39.0 or later.\n *\n * @category layers\n * @since 1.0.0-rc.0\n * @slop\n */\nexport const layer: Layer.Layer<BunHost | Crypto.Crypto> = Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(BunChildProcessSpawner.layer, platform),\n BunJj.layer,\n layerHttpClient\n)\n\n/**\n * Provides all five Bun Host services bound to one absolute repository root.\n *\n * Throws {@link BunHostError} with code `invalid_repository_root` when `root`\n * is not absolute or contains NUL; the empty string counts. The check runs\n * when the factory is called, before any layer exists.\n *\n * Builds without jj exactly as {@link layer} does: the `Jj` slot probes\n * `jj --version` on its first operation.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerAt = (root: string): Layer.Layer<BunHost | Crypto.Crypto> => {\n const repositoryRoot = absoluteRoot(\"layerAt\", root)\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(BunChildProcessSpawner.layer, platform),\n BunJj.layerAt(repositoryRoot),\n layerHttpClient\n )\n}\n\n/**\n * Provides the Bun host with process containment turned on.\n *\n * Bun uses the same prepared native process lifecycle as Node on POSIX, while\n * preserving its underlying runtime spawner on Windows. `ContainedSpawner` gives\n * every child an escalation deadline and a ledger entry, and\n * `ProcessReaper` sweeps the entries a crashed incarnation of this host left\n * behind. The reaper module lives in `@smthrs/platform-node` because the calls\n * it makes, `process.kill` and `taskkill`, are Node's, and Bun implements\n * them unchanged.\n *\n * Builds without jj exactly as {@link layer} does; here the first\n * operation's `jj --version` probe runs through the contained spawner, so its\n * record enters and leaves the ledger like any other child.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerContained = (\n options?: ContainedOptions\n): Layer.Layer<BunHost | Crypto.Crypto, never, ProcessLedger.ProcessLedger> => {\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(BunChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n layerHttpClient,\n // jj goes through the CONTAINED spawner here, not around it, exactly as in\n // `NodeHost.layerContained`: a jj child that starts its own process leads\n // no recorded group, is in no ledger, and outlives the host that ran it.\n Layer.provideMerge(BunJj.layerSpawner, spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n\n/**\n * Provides the contained Bun host bound to one absolute repository root.\n *\n * Refuses a root exactly as {@link layerAt} does: {@link BunHostError} with\n * code `invalid_repository_root`, thrown when the factory is called.\n * Builds without jj exactly as {@link layerContained} does.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerContainedAt = (\n root: string,\n options?: ContainedOptions\n): Layer.Layer<BunHost | Crypto.Crypto, never, ProcessLedger.ProcessLedger> => {\n const repositoryRoot = absoluteRoot(\"layerContainedAt\", root)\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(BunChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n layerHttpClient,\n Layer.provideMerge(BunJj.layerSpawnerAt(repositoryRoot), spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["/**\n * Aggregate Bun Host bundle.\n *\n * Runtime-specific dependencies stay inside this package; callers get the same\n * closed five-service Host surface every other bundle provides, plus native\n * `ProcessConfinement` for guarded commands.\n *\n * There is no Bun shell module: running a command is Effect's\n * `ChildProcessSpawner`, and `@effect/platform-bun`'s implementation is\n * `@effect/platform-node-shared`'s re-exported: the same code on both\n * runtimes, so no runtime detection is needed here.\n *\n * Outgoing HTTP uses the shared EgressHttpClient on both runtimes. Web\n * requests pin approved addresses; ordinary requests retain the shared pool.\n * Redirects remain visible to the capability kernel, and proxy routing follows\n * the host environment.\n *\n * The filesystem slot is `@smthrs/platform-node`'s `AtomicFileSystem`, byte for\n * byte the layer `NodeHost` uses, so a guarded path operation is\n * descriptor-relative and no-follow on both runtimes.\n *\n * @since 1.0.0-rc.0\n */\n\nimport * as BunChildProcessSpawner from \"@effect/platform-bun/BunChildProcessSpawner\"\nimport * as BunCrypto from \"@effect/platform-bun/BunCrypto\"\nimport * as BunPath from \"@effect/platform-bun/BunPath\"\nimport type { Jj } from \"@smthrs/jj\"\nimport * as BunJj from \"@smthrs/jj/bun/BunJj\"\nimport type { HostServiceIds } from \"@smthrs/kernel/HostServices\"\nimport type * as KernelProcessConfinement from \"@smthrs/kernel/ProcessConfinement\"\nimport type * as ProcessLedger from \"@smthrs/kernel/ProcessLedger\"\nimport * as AtomicFileSystem from \"@smthrs/platform-node/AtomicFileSystem\"\nimport * as EgressHttpClient from \"@smthrs/platform-node/EgressHttpClient\"\nimport * as HostLiveness from \"@smthrs/platform-node/HostLiveness\"\nimport * as ProcessConfinement from \"@smthrs/platform-node/ProcessConfinement\"\nimport * as ProcessReaper from \"@smthrs/platform-node/ProcessReaper\"\nimport type * as EffectDigest from \"effect/crypto/Digest\"\nimport type * as SecureRandom from \"effect/crypto/SecureRandom\"\nimport type { FileSystem } from \"effect/FileSystem\"\nimport type { HttpClient } from \"effect/http/HttpClient\"\nimport * as Layer from \"effect/Layer\"\nimport type * as Path from \"effect/Path\"\nimport type { ChildProcessSpawner } from \"effect/process/ChildProcessSpawner\"\nimport * as Schema from \"effect/Schema\"\nimport { isAbsolute } from \"node:path\"\nimport * as BunFileSystem from \"./BunFileSystem.ts\"\n\n/**\n * Bun platform modules for selectively providing individual services.\n *\n * `AtomicFileSystem` is here for the same reason `NodeHost` re-exports it: it\n * owns the only configuration escape hatch the filesystem slot has, and a Bun\n * program with a different packaged helper path needs to reach\n * `AtomicFileSystem.layerWith` without hand-composing the other four tags.\n *\n * `BunJj` is deliberately absent: it belongs to `@smthrs/jj` and is imported\n * from there, never re-exported here. So is `@effect/platform-bun/BunHttpClient`:\n * its `layer` follows redirects to origins the capability kernel never\n * authorized. The network slot on its own is {@link layerHttpClient}.\n *\n * @category re-exports\n * @since 1.0.0-rc.0\n * @slop\n */\nexport { AtomicFileSystem, BunChildProcessSpawner, BunCrypto, BunFileSystem, HostLiveness, ProcessReaper }\n\n/**\n * The complete closed Host service union provided by Bun.\n *\n * @category models\n * @since 1.0.0-rc.0\n * @slop\n */\nexport type BunHost =\n | FileSystem\n | Path.Path\n | ChildProcessSpawner\n | Jj\n | HttpClient\n | KernelProcessConfinement.ProcessConfinement\n\n/**\n * The stable codes a `BunHost` factory refuses with.\n *\n * A code is the contract a caller branches on; the message beside it is for a\n * person. `invalid_repository_root` is the root handed to {@link layerAt} or\n * {@link layerContainedAt} not being absolute or containing NUL, the empty\n * string included.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type BunHostErrorCode = \"invalid_repository_root\"\n\n/**\n * The refusal a `BunHost` factory throws before it builds a layer.\n *\n * It is thrown rather than failed because a factory is called while a program\n * composes its layers, where there is no fiber to fail yet and a wrong root is\n * a composition mistake, not a runtime outcome. It is this package's class,\n * not the `Jj` adapter's, because a Bun caller composes `BunHost` and should\n * learn nothing about the adapter behind the `Jj` slot from an error message.\n *\n * @category errors\n * @since 1.0.0-rc.0\n */\nexport class BunHostError extends Schema.TaggedError<BunHostError>()(\"@smthrs/platform-bun/BunHostError\", {\n code: Schema.Literal(\"invalid_repository_root\"),\n message: Schema.String\n}) {\n override readonly name = \"BunHostError\"\n}\n\n/** The longest message a factory refuses with, in UTF-16 code units. */\nconst messageLimit = 255\n\n/** How many code points of a refused root the message repeats at most. */\nconst previewLimit = 64\n\n/**\n * A bounded, quoted excerpt of a refused root that fits in `budget` code\n * units of the message.\n *\n * Counted in code points rather than UTF-16 units so a cut never splits a\n * surrogate pair, and passed through `JSON.stringify` so a newline in the root\n * cannot break the log line the message lands on. Each code point is encoded\n * on its own and admitted only while the quoted excerpt plus the length\n * suffix still fit, so a control character that widens to a `\\u0001` escape\n * shortens the excerpt instead of lengthening the message, and a cut never\n * lands inside an escape.\n */\nconst preview = (root: string, budget: number): string => {\n const points = Array.from(root)\n const whole = JSON.stringify(root)\n if (points.length <= previewLimit && whole.length <= budget) return whole\n const suffix = `... (${points.length} characters)`\n const room = budget - suffix.length - 2\n let excerpt = \"\"\n for (const point of points.slice(0, previewLimit)) {\n const encoded = JSON.stringify(point).slice(1, -1)\n if (excerpt.length + encoded.length > room) break\n excerpt += encoded\n }\n return `\"${excerpt}\"${suffix}`\n}\n\n/**\n * Refuses a root the `Jj` adapter underneath would refuse, here and in this\n * package's name.\n *\n * `BunJj.layerAt` and `BunJj.layerSpawnerAt` are `NodeJj`'s, and those throw a\n * bare `TypeError` that names `NodeJj`, carries no code, and echoes the whole\n * string. The predicate includes the same `isAbsolute` the adapter applies, so\n * a root that passes this check cannot reach that throw. An absolute root\n * containing NUL is refused too: no filesystem or process API can represent it.\n */\nconst absoluteRoot = (factory: \"layerAt\" | \"layerContainedAt\", root: string): string => {\n // An absolute root with NUL names that defect, not absoluteness it already has.\n const requirement = !isAbsolute(root)\n ? \"an absolute repository root\"\n : root.includes(\"\\0\")\n ? \"a repository root without NUL\"\n : undefined\n if (requirement === undefined) return root\n const prefix = `BunHost.${factory} requires ${requirement}, got `\n throw new BunHostError({\n code: \"invalid_repository_root\",\n message: `${prefix}${preview(root, messageLimit - prefix.length)}`\n })\n}\n\n/**\n * Stable implementation identities keyed by the closed Host service slots.\n *\n * Each value names the module behind that slot in the raw host bundle.\n * Contained POSIX factories replace the spawner with {@link ProcessReaper.layerSpawner}.\n * These are identity\n * tokens rather than import specifiers: the filesystem entry is\n * `@smthrs/platform-node/AtomicFileSystem` because that is the implementation,\n * even though a consumer reaches it through `@smthrs/platform-bun`.\n *\n * Nothing digests them yet. `@smthrs/plan`'s step key carries a `layers`\n * component these values are meant to feed, but no planner derives it from a\n * host bundle today, so changing one invalidates no cached step.\n *\n * The keys are written as literals rather than `HostServiceIds` positions so\n * that reordering the closed list cannot silently pair a slot with another\n * slot's implementation.\n *\n * @category models\n * @since 1.0.0-rc.0\n * @slop\n */\nexport const implementationIds: Readonly<Record<(typeof HostServiceIds)[number], string>> = {\n \"effect/FileSystem\": \"@smthrs/platform-node/AtomicFileSystem\",\n \"effect/Path\": \"@effect/platform-bun/BunPath\",\n \"effect/process/ChildProcessSpawner\": \"@effect/platform-bun/BunChildProcessSpawner\",\n \"@smthrs/jj/Jj\": \"@smthrs/jj/bun/BunJj\",\n \"effect/HttpClient\": \"@smthrs/platform-node/EgressHttpClient\"\n}\n\n/**\n * What a caller may configure about containment.\n *\n * `ContainedSpawner.Options.platform` is deliberately not part of it. It\n * decides one thing, whether a command that names no `detached` option gets a\n * process group of its own, and this native host detaches by `process.platform`\n * whatever a record claims. A\n * caller-supplied `\"win32\"` on a POSIX host would therefore record\n * `pgid: null` for a child that really does lead a group, and\n * {@link ProcessReaper.reap} would retire that record as `no-group` and leave\n * the orphan running forever: a durable lie rather than a compile error.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type ContainedOptions = ProcessReaper.SpawnerOptions & ProcessReaper.Options\n\n/** The reaper half of {@link ContainedOptions}. */\nconst reaping = (options?: ContainedOptions): ProcessReaper.Options => ({\n ownerPid: options?.ownerPid,\n system: options?.system\n})\n\n/** The two services `BunChildProcessSpawner` resolves paths and files with. */\nconst platform = Layer.mergeAll(BunFileSystem.layer, BunPath.layer, BunCrypto.layer)\n\n/**\n * The network slot on its own: the shared egress client, which never follows a\n * redirect. A `3xx` comes back to the caller with its `location` intact and the\n * second origin uncontacted; following a redirect is `@smthrs/kernel`'s guarded\n * `HttpClient.layer`, which rechecks every hop.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerHttpClient: Layer.Layer<HttpClient> = EgressHttpClient.layer(process.env)\n\n/**\n * Provides all five Bun Host services, including the runtime-independent Path\n * service.\n *\n * Builds on a host without jj. The `Jj` slot probes `jj --version` on its\n * first operation and fails that operation with `JjError` carrying\n * `not_installed` or `unsupported_version`; a program that never calls `Jj`\n * runs without jj. `Jj` requires jj 0.39.0 or later.\n *\n * @category layers\n * @since 1.0.0-rc.0\n * @slop\n */\nexport const layer: Layer.Layer<BunHost | (EffectDigest.Digest | SecureRandom.SecureRandom)> = Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(BunChildProcessSpawner.layer, platform),\n BunJj.layer,\n layerHttpClient\n)\n\n/**\n * Provides all five Bun Host services bound to one absolute repository root.\n *\n * Throws {@link BunHostError} with code `invalid_repository_root` when `root`\n * is not absolute or contains NUL; the empty string counts. The check runs\n * when the factory is called, before any layer exists.\n *\n * Builds without jj exactly as {@link layer} does: the `Jj` slot probes\n * `jj --version` on its first operation.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerAt = (root: string): Layer.Layer<BunHost | (EffectDigest.Digest | SecureRandom.SecureRandom)> => {\n const repositoryRoot = absoluteRoot(\"layerAt\", root)\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n Layer.provide(BunChildProcessSpawner.layer, platform),\n BunJj.layerAt(repositoryRoot),\n layerHttpClient\n )\n}\n\n/**\n * Provides the Bun host with process containment turned on.\n *\n * Bun uses the same prepared native process lifecycle as Node on POSIX, while\n * preserving its underlying runtime spawner on Windows. `ContainedSpawner` gives\n * every child an escalation deadline and a ledger entry, and\n * `ProcessReaper` sweeps the entries a crashed incarnation of this host left\n * behind. The reaper module lives in `@smthrs/platform-node` because the calls\n * it makes, `process.kill` and `taskkill`, are Node's, and Bun implements\n * them unchanged.\n *\n * Builds without jj exactly as {@link layer} does; here the first\n * operation's `jj --version` probe runs through the contained spawner, so its\n * record enters and leaves the ledger like any other child.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerContained = (\n options?: ContainedOptions\n): Layer.Layer<BunHost | (EffectDigest.Digest | SecureRandom.SecureRandom), never, ProcessLedger.ProcessLedger> => {\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(BunChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n layerHttpClient,\n // jj goes through the CONTAINED spawner here, not around it, exactly as in\n // `NodeHost.layerContained`: a jj child that starts its own process leads\n // no recorded group, is in no ledger, and outlives the host that ran it.\n Layer.provideMerge(BunJj.layerSpawner, spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n\n/**\n * Provides the contained Bun host bound to one absolute repository root.\n *\n * Refuses a root exactly as {@link layerAt} does: {@link BunHostError} with\n * code `invalid_repository_root`, thrown when the factory is called.\n * Builds without jj exactly as {@link layerContained} does.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerContainedAt = (\n root: string,\n options?: ContainedOptions\n): Layer.Layer<BunHost | (EffectDigest.Digest | SecureRandom.SecureRandom), never, ProcessLedger.ProcessLedger> => {\n const repositoryRoot = absoluteRoot(\"layerContainedAt\", root)\n const spawner = Layer.provide(\n ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),\n Layer.provide(BunChildProcessSpawner.layer, platform)\n )\n return Layer.mergeAll(\n ProcessConfinement.layer(),\n platform,\n layerHttpClient,\n Layer.provideMerge(BunJj.layerSpawnerAt(repositoryRoot), spawner)\n ).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))))\n}\n"],
5
+ "mappings": "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",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,55 @@
1
+ /** Bun host composition over the shared, injected durable runtime.
2
+ *
3
+ * The same lifecycle as `@smthrs/platform-node` `NodeRuntime`, bound to Bun's
4
+ * SQLite driver and host bundle. Invalid options raise
5
+ * `Runtime.RuntimeConfigurationError` from `@smthrs/flows`.
6
+ *
7
+ * @since 1.0.0
8
+ */
9
+ import { NativeRuntime } from "@smthrs/platform-node";
10
+ /** Native process and host configuration for `layerHost`.
11
+ * @since 1.0.0
12
+ * @category models
13
+ */
14
+ export type HostOptions = NativeRuntime.HostOptions;
15
+ /** The injected runtime's options plus the database file and workspace root.
16
+ * @since 1.0.0
17
+ * @category models
18
+ */
19
+ export type Options = NativeRuntime.Options;
20
+ /** Provides the migrated stores over the native SQL driver.
21
+ * @since 1.0.0
22
+ * @category layers
23
+ */
24
+ export declare const storage: NativeRuntime.Api["storage"];
25
+ /** Builds the shared durable runtime in the caller’s Effect scope.
26
+ * @since 1.0.0
27
+ * @category layers
28
+ */
29
+ export declare const make: NativeRuntime.Api["make"];
30
+ /** Provides the shared runtime with an explicitly supplied execution boundary.
31
+ * @since 1.0.0
32
+ * @category layers
33
+ */
34
+ export declare const layer: NativeRuntime.Api["layer"];
35
+ /** Provides the native host, guarded services, database and registered flows.
36
+ * @since 1.0.0
37
+ * @category layers
38
+ */
39
+ export declare const layerHost: NativeRuntime.Api["layerHost"];
40
+ /** Returns the conventional exit code for a native shutdown signal.
41
+ * @since 1.0.0
42
+ * @category layers
43
+ */
44
+ export declare const signalExitCode: NativeRuntime.Api["signalExitCode"];
45
+ /** Default graceful-shutdown deadline in milliseconds.
46
+ * @since 1.0.0
47
+ * @category layers
48
+ */
49
+ export declare const defaultShutdownTimeoutMs: NativeRuntime.Api["defaultShutdownTimeoutMs"];
50
+ /** Largest supported native shutdown timer delay.
51
+ * @since 1.0.0
52
+ * @category layers
53
+ */
54
+ export declare const maximumShutdownTimeoutMs: NativeRuntime.Api["maximumShutdownTimeoutMs"];
55
+ //# sourceMappingURL=BunRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BunRuntime.d.ts","sources":["../../src/BunRuntime.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,aAAa,EAAe,MAAM,uBAAuB,CAAA;AAKlE;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC,WAAW,CAAA;AACnD;;;GAGG;AACH,MAAM,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAA;AA6B3C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,aAAa,CAAC,GAAG,CAAC,SAAS,CAAmB,CAAA;AACpE;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAgB,CAAA;AAC3D;;;GAGG;AACH,eAAO,MAAM,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,OAAO,CAAiB,CAAA;AAC9D;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,aAAa,CAAC,GAAG,CAAC,WAAW,CAAqB,CAAA;AAC1E;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,GAAG,CAAC,gBAAgB,CAA0B,CAAA;AACzF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAAC,GAAG,CAAC,0BAA0B,CAAoC,CAAA;AACvH;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,aAAa,CAAC,GAAG,CAAC,0BAA0B,CAAoC,CAAA"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var BunRuntime_exports = {};
30
+ __export(BunRuntime_exports, {
31
+ defaultShutdownTimeoutMs: () => defaultShutdownTimeoutMs,
32
+ layer: () => layer,
33
+ layerHost: () => layerHost,
34
+ make: () => make,
35
+ maximumShutdownTimeoutMs: () => maximumShutdownTimeoutMs,
36
+ signalExitCode: () => signalExitCode,
37
+ storage: () => storage
38
+ });
39
+ module.exports = __toCommonJS(BunRuntime_exports);
40
+ var Runtime = __toESM(require("@smthrs/flows/Runtime"), 1);
41
+ var import_platform_node = require("@smthrs/platform-node");
42
+ var Effect = __toESM(require("effect/Effect"), 1);
43
+ var Layer = __toESM(require("effect/Layer"), 1);
44
+ var Host = __toESM(require("./BunHost.js"), 1);
45
+ const runtime = import_platform_node.NativeRuntime.make({
46
+ name: "BunRuntime",
47
+ // Loaded when a database opens: its driver imports `bun:sqlite`, which only
48
+ // Bun resolves, and this package's root must still load wherever its other
49
+ // modules are read.
50
+ // A fresh SQLite file is initialized privately and published whole, as on
51
+ // Node: a host killed during first start never leaves a partial store at
52
+ // the published name, and concurrent creators converge on one winner.
53
+ // Only the native Bun lane executes this driver factory; Node cannot import bun:sqlite.
54
+ /* v8 ignore start */
55
+ database: (filename) => import_platform_node.NodeRuntime.publishFreshDatabase(filename, (file) => Layer.unwrap(Effect.map(Effect.promise(() => import("@smthrs/database/bun/BunDatabase")), (Database) => Database.layer({ filename: file }))), Runtime.storage),
56
+ /* v8 ignore stop */
57
+ host: Host,
58
+ crypto: Host.BunCrypto.layer
59
+ });
60
+ const storage = runtime.storage;
61
+ const make = runtime.make;
62
+ const layer = runtime.layer;
63
+ const layerHost = runtime.layerHost;
64
+ const signalExitCode = runtime.signalExitCode;
65
+ const defaultShutdownTimeoutMs = runtime.defaultShutdownTimeoutMs;
66
+ const maximumShutdownTimeoutMs = runtime.maximumShutdownTimeoutMs;
67
+ //# sourceMappingURL=BunRuntime.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/BunRuntime.ts"],
4
+ "sourcesContent": ["/** Bun host composition over the shared, injected durable runtime.\n *\n * The same lifecycle as `@smthrs/platform-node` `NodeRuntime`, bound to Bun's\n * SQLite driver and host bundle. Invalid options raise\n * `Runtime.RuntimeConfigurationError` from `@smthrs/flows`.\n *\n * @since 1.0.0\n */\n\nimport * as Runtime from \"@smthrs/flows/Runtime\"\nimport { NativeRuntime, NodeRuntime } from \"@smthrs/platform-node\"\nimport * as Effect from \"effect/Effect\"\nimport * as Layer from \"effect/Layer\"\nimport * as Host from \"./BunHost.ts\"\n\n/** Native process and host configuration for `layerHost`.\n * @since 1.0.0\n * @category models\n */\nexport type HostOptions = NativeRuntime.HostOptions\n/** The injected runtime's options plus the database file and workspace root.\n * @since 1.0.0\n * @category models\n */\nexport type Options = NativeRuntime.Options\n\nconst runtime = NativeRuntime.make({\n name: \"BunRuntime\",\n // Loaded when a database opens: its driver imports `bun:sqlite`, which only\n // Bun resolves, and this package's root must still load wherever its other\n // modules are read.\n // A fresh SQLite file is initialized privately and published whole, as on\n // Node: a host killed during first start never leaves a partial store at\n // the published name, and concurrent creators converge on one winner.\n // Only the native Bun lane executes this driver factory; Node cannot import bun:sqlite.\n /* v8 ignore start */\n database: (filename) =>\n NodeRuntime.publishFreshDatabase(\n filename,\n (file) =>\n Layer.unwrap(\n Effect.map(\n Effect.promise(() => import(\"@smthrs/database/bun/BunDatabase\")),\n (Database) => Database.layer({ filename: file })\n )\n ),\n Runtime.storage\n ),\n /* v8 ignore stop */\n host: Host,\n crypto: Host.BunCrypto.layer\n})\n\n/** Provides the migrated stores over the native SQL driver.\n * @since 1.0.0\n * @category layers\n */\nexport const storage: NativeRuntime.Api[\"storage\"] = runtime.storage\n/** Builds the shared durable runtime in the caller’s Effect scope.\n * @since 1.0.0\n * @category layers\n */\nexport const make: NativeRuntime.Api[\"make\"] = runtime.make\n/** Provides the shared runtime with an explicitly supplied execution boundary.\n * @since 1.0.0\n * @category layers\n */\nexport const layer: NativeRuntime.Api[\"layer\"] = runtime.layer\n/** Provides the native host, guarded services, database and registered flows.\n * @since 1.0.0\n * @category layers\n */\nexport const layerHost: NativeRuntime.Api[\"layerHost\"] = runtime.layerHost\n/** Returns the conventional exit code for a native shutdown signal.\n * @since 1.0.0\n * @category layers\n */\nexport const signalExitCode: NativeRuntime.Api[\"signalExitCode\"] = runtime.signalExitCode\n/** Default graceful-shutdown deadline in milliseconds.\n * @since 1.0.0\n * @category layers\n */\nexport const defaultShutdownTimeoutMs: NativeRuntime.Api[\"defaultShutdownTimeoutMs\"] = runtime.defaultShutdownTimeoutMs\n/** Largest supported native shutdown timer delay.\n * @since 1.0.0\n * @category layers\n */\nexport const maximumShutdownTimeoutMs: NativeRuntime.Api[\"maximumShutdownTimeoutMs\"] = runtime.maximumShutdownTimeoutMs\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AASA,cAAyB;AACzB,2BAA2C;AAC3C,aAAwB;AACxB,YAAuB;AACvB,WAAsB;AAatB,MAAM,UAAU,mCAAc,KAAK;EACjC,MAAM;;;;;;;;;EASN,UAAU,CAAC,aACT,iCAAY,qBACV,UACA,CAAC,SACC,MAAM,OACJ,OAAO,IACL,OAAO,QAAQ,MAAM,OAAO,kCAAkC,CAAC,GAC/D,CAAC,aAAa,SAAS,MAAM,EAAE,UAAU,KAAI,CAAE,CAAC,CACjD,GAEL,QAAQ,OAAO;;EAGnB,MAAM;EACN,QAAQ,KAAK,UAAU;CACxB;AAMM,MAAM,UAAwC,QAAQ;AAKtD,MAAM,OAAkC,QAAQ;AAKhD,MAAM,QAAoC,QAAQ;AAKlD,MAAM,YAA4C,QAAQ;AAK1D,MAAM,iBAAsD,QAAQ;AAKpE,MAAM,2BAA0E,QAAQ;AAKxF,MAAM,2BAA0E,QAAQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Layer } from "effect";
2
+ /** Provides an Effect HTTP server on loopback. Zero chooses a free port. Only the host loads Bun's adapter. */
3
+ export declare function layer(port?: number): Layer.Layer<import("effect/http/Etag").Generator | import("effect/http/HttpPlatform").HttpPlatform | import("effect/http/HttpServer").HttpServer | import("../vendor/cjs/bun/BunServices.js").BunServices, import("effect/http/HttpServerError").ServeError, never>;
4
+ //# sourceMappingURL=BunServer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BunServer.d.ts","sources":["../../src/BunServer.vibe"],"names":[],"mappings":";AACA,+GAA+G;AAC/G,wBAAgB,KAAK,CAAC,IAAI,SAAI,uQAK7B"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var BunServer_exports = {};
30
+ __export(BunServer_exports, {
31
+ layer: () => layer
32
+ });
33
+ module.exports = __toCommonJS(BunServer_exports);
34
+ var Layer = __toESM(require("effect/Layer"), 1);
35
+ var import_Effect = require("effect/Effect");
36
+ var Effect = __toESM(require("effect/Effect"), 1);
37
+ function layer(port = 0) {
38
+ return Layer.unwrap(Effect.gen(function* () {
39
+ const server = yield* (0, import_Effect.promise)(() => import("../vendor/cjs/bun/BunHttpServer.js"));
40
+ return server.layer({ hostname: "127.0.0.1", port });
41
+ }));
42
+ }
43
+ //# sourceMappingURL=BunServer.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/BunServer.vibe"],
4
+ "sourcesContent": ["// Bun's HTTP server is a host capability; consumers never reach Bun.serve or native sockets.\n/** Provides an Effect HTTP server on loopback. Zero chooses a free port. Only the host loads Bun's adapter. */\nexport function layer(port = 0) {\n return Layer.unwrap(effect {\n const server = try promise(() => import(\"@effect/platform-bun/BunHttpServer\"))\n return server.layer({ hostname: \"127.0.0.1\", port })\n })\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEM,SAAU,MAAM,OAAO,GAAC;AAC5B,SAAO,MAAM,OAAO,OAAA,IAAA,aAAA;AAClB,UAAM,SAAM,WAAO,uBAAQ,MAAM,OAAO,oCAAoC,CAAC;AAC7E,WAAO,OAAO,MAAM,EAAE,UAAU,aAAa,KAAI,CAAE;EACrD,CAAC,CAAA;AACH;",
6
+ "names": []
7
+ }
@@ -0,0 +1,51 @@
1
+ // Stays .d.ts: TypeScript's resolver reads foreign-module declarations only from TypeScript declaration files.
2
+ /**
3
+ * The checked foreign native port. Electrobun ships implementation TypeScript rather than declarations.
4
+ * @since 1.0.0-rc.16
5
+ */
6
+
7
+ /**
8
+ * Native CEF window.
9
+ * @category native
10
+ * @since 1.0.0-rc.16
11
+ */
12
+ export declare class BrowserWindow {
13
+ constructor(
14
+ options: {
15
+ title?: string
16
+ url: string
17
+ frame?: { x: number; y: number; width: number; height: number }
18
+ titleBarStyle: "hiddenInset"
19
+ renderer: "cef"
20
+ sandbox: boolean
21
+ navigationRules: string
22
+ }
23
+ )
24
+ readonly webview: { setNavigationRules(rules: Array<string>): void }
25
+ close(): void
26
+ }
27
+ /**
28
+ * System browser and directory chooser.
29
+ * @category native
30
+ * @since 1.0.0-rc.16
31
+ */
32
+ export declare const Utils: {
33
+ openExternal(url: string): boolean
34
+ openFileDialog(
35
+ options: { canChooseFiles: boolean; canChooseDirectory: boolean; allowsMultipleSelection: boolean }
36
+ ): Promise<Array<string>>
37
+ }
38
+
39
+ /**
40
+ * Packaged resource location.
41
+ * @category native
42
+ * @since 1.0.0-rc.16
43
+ */
44
+ export declare const PATHS: { readonly RESOURCES_FOLDER: string }
45
+
46
+ /**
47
+ * Compatibility marker supplied by the distributed native runtime, opener and chooser patch.
48
+ * @category native
49
+ * @since 1.0.0-rc.16
50
+ */
51
+ export declare const SMITHERS_BUN14_COMPAT: unknown
@@ -18,9 +18,20 @@
18
18
  * @slop
19
19
  */
20
20
  export * as BunFileSystem from "./BunFileSystem.ts";
21
+ /** Bun's full garbage collection, for `@smthrs/sandbox`'s Microsandbox provider. */
22
+ export * as BunGarbageCollector from "./BunGarbageCollector.ts";
21
23
  /**
22
24
  * The complete closed Host bundle for Bun.
23
25
  * @slop
24
26
  */
25
27
  export * as BunHost from "./BunHost.ts";
28
+ /**
29
+ * The durable flow runtime on Bun: the shared native lifecycle bound to Bun's
30
+ * SQLite driver and this package's Host bundle.
31
+ */
32
+ export * as BunRuntime from "./BunRuntime.ts";
33
+ /** Electrobun window and native folder-picker services; FFI is loaded only when its layer is built. */
34
+ export * as BunDesktop from "./BunDesktop.ts";
35
+ /** Scoped Effect HTTP server for a Bun host's loopback API. */
36
+ export * as BunServer from "./BunServer.ts";
26
37
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;GAGG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD,oFAAoF;AACpF,OAAO,KAAK,mBAAmB,MAAM,0BAA0B,CAAA;AAE/D;;;GAGG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC;;;GAGG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C,uGAAuG;AACvG,OAAO,KAAK,UAAU,MAAM,iBAAmB,CAAA;AAE/C,+DAA+D;AAC/D,OAAO,KAAK,SAAS,MAAM,gBAAkB,CAAA"}
package/dist/cjs/index.js CHANGED
@@ -28,10 +28,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var index_exports = {};
30
30
  __export(index_exports, {
31
+ BunDesktop: () => BunDesktop,
31
32
  BunFileSystem: () => BunFileSystem,
32
- BunHost: () => BunHost
33
+ BunGarbageCollector: () => BunGarbageCollector,
34
+ BunHost: () => BunHost,
35
+ BunRuntime: () => BunRuntime,
36
+ BunServer: () => BunServer
33
37
  });
34
38
  module.exports = __toCommonJS(index_exports);
35
39
  var BunFileSystem = __toESM(require("./BunFileSystem.js"), 1);
40
+ var BunGarbageCollector = __toESM(require("./BunGarbageCollector.js"), 1);
36
41
  var BunHost = __toESM(require("./BunHost.js"), 1);
42
+ var BunRuntime = __toESM(require("./BunRuntime.js"), 1);
43
+ var BunDesktop = __toESM(require("./BunDesktop.js"), 1);
44
+ var BunServer = __toESM(require("./BunServer.js"), 1);
37
45
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/index.ts"],
4
- "sourcesContent": ["/**\n * `@smthrs/platform-bun`, the Bun Host bundle.\n *\n * `BunHost.layer` composes the closed five-tag Host surface for Bun out of\n * `@effect/platform-bun`'s child-process spawner and the shared egress `HttpClient`,\n * Effect's runtime-independent `Path`, the Bun `Jj` adapter from\n * `@smthrs/jj`, and `@smthrs/platform-node`'s `AtomicFileSystem`, which is the\n * very layer the Node bundle puts in its own filesystem slot.\n *\n * Two host prerequisites come with it: `@effect/platform-bun`, which both this\n * barrel and `@smthrs/platform-bun/BunHost` import at module load, and the\n * `smithers-jj-export` native helper for the filesystem slot.\n *\n * @since 1.0.0-rc.0\n */\n\n/**\n * Bun's `FileSystem`, which is `@smthrs/platform-node`'s atomic filesystem.\n * @slop\n */\nexport * as BunFileSystem from \"./BunFileSystem.ts\"\n\n/**\n * The complete closed Host bundle for Bun.\n * @slop\n */\nexport * as BunHost from \"./BunHost.ts\"\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,oBAA+B;AAM/B,cAAyB;",
4
+ "sourcesContent": ["/**\n * `@smthrs/platform-bun`, the Bun Host bundle.\n *\n * `BunHost.layer` composes the closed five-tag Host surface for Bun out of\n * `@effect/platform-bun`'s child-process spawner and the shared egress `HttpClient`,\n * Effect's runtime-independent `Path`, the Bun `Jj` adapter from\n * `@smthrs/jj`, and `@smthrs/platform-node`'s `AtomicFileSystem`, which is the\n * very layer the Node bundle puts in its own filesystem slot.\n *\n * Two host prerequisites come with it: `@effect/platform-bun`, which both this\n * barrel and `@smthrs/platform-bun/BunHost` import at module load, and the\n * `smithers-jj-export` native helper for the filesystem slot.\n *\n * @since 1.0.0-rc.0\n */\n\n/**\n * Bun's `FileSystem`, which is `@smthrs/platform-node`'s atomic filesystem.\n * @slop\n */\nexport * as BunFileSystem from \"./BunFileSystem.ts\"\n\n/** Bun's full garbage collection, for `@smthrs/sandbox`'s Microsandbox provider. */\nexport * as BunGarbageCollector from \"./BunGarbageCollector.ts\"\n\n/**\n * The complete closed Host bundle for Bun.\n * @slop\n */\nexport * as BunHost from \"./BunHost.ts\"\n\n/**\n * The durable flow runtime on Bun: the shared native lifecycle bound to Bun's\n * SQLite driver and this package's Host bundle.\n */\nexport * as BunRuntime from \"./BunRuntime.ts\"\n\n/** Electrobun window and native folder-picker services; FFI is loaded only when its layer is built. */\nexport * as BunDesktop from \"./BunDesktop.vibe\"\n\n/** Scoped Effect HTTP server for a Bun host's loopback API. */\nexport * as BunServer from \"./BunServer.vibe\"\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;AAoBA,oBAA+B;AAG/B,0BAAqC;AAMrC,cAAyB;AAMzB,iBAA4B;AAG5B,iBAA4B;AAG5B,gBAA2B;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `#electrobun` under the `browser` condition.
3
+ *
4
+ * Electrobun drives native windows through Bun's FFI and Node built-ins, and a
5
+ * browser has neither. A browser bundle resolves the private native import to
6
+ * this module instead of bundling Electrobun, and loading it fails, so
7
+ * `BunDesktop.layer` reports `DesktopUnavailable` there as it does on Node.
8
+ *
9
+ * @since 1.0.0-rc.18
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=ElectrobunUnavailable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElectrobunUnavailable.d.ts","sources":["../../../src/internal/ElectrobunUnavailable.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ var import_BunDesktop = require("../BunDesktop.js");
3
+ throw new import_BunDesktop.DesktopUnavailable();
4
+ //# sourceMappingURL=ElectrobunUnavailable.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/internal/ElectrobunUnavailable.ts"],
4
+ "sourcesContent": ["/**\n * `#electrobun` under the `browser` condition.\n *\n * Electrobun drives native windows through Bun's FFI and Node built-ins, and a\n * browser has neither. A browser bundle resolves the private native import to\n * this module instead of bundling Electrobun, and loading it fails, so\n * `BunDesktop.layer` reports `DesktopUnavailable` there as it does on Node.\n *\n * @since 1.0.0-rc.18\n */\n\nimport { DesktopUnavailable } from \"../BunDesktop.vibe\"\n\nthrow new DesktopUnavailable()\n"],
5
+ "mappings": ";AAWA,wBAAmC;AAEnC,MAAM,IAAI,qCAAkB;",
6
+ "names": []
7
+ }
@@ -1 +1 @@
1
- {"type":"commonjs"}
1
+ {"type":"commonjs","imports":{"#electrobun":{"types":"./Electrobun.d.ts","browser":"./internal/ElectrobunUnavailable.js","default":"electrobun/bun"}}}
@@ -0,0 +1,49 @@
1
+ import { Context, Effect, Layer, Schema } from "effect";
2
+ import type * as Electrobun from "#electrobun";
3
+ declare const DesktopUnavailable_base: Schema.Class<DesktopUnavailable, Schema.TaggedStruct<"DesktopUnavailable", {}>, import("effect/Cause").YieldableError>;
4
+ /** Failure to open a native window or dialog, without OS messages or paths in diagnostics. */
5
+ export declare class DesktopUnavailable extends DesktopUnavailable_base {
6
+ }
7
+ /**
8
+ * Presentation chosen by the application; omitted options use Electrobun's defaults.
9
+ * @category models
10
+ * @since 0.1.0
11
+ */
12
+ export interface WindowOptions {
13
+ readonly title: string;
14
+ readonly frame?: {
15
+ readonly x: number;
16
+ readonly y: number;
17
+ readonly width: number;
18
+ readonly height: number;
19
+ };
20
+ }
21
+ type DesktopWindow_shape = {
22
+ readonly resources: string;
23
+ openExternal(url: string): Effect.Effect<void, DesktopUnavailable>;
24
+ open(url: string, options?: WindowOptions): Effect.Effect<void, DesktopUnavailable>;
25
+ chooseDirectory(): Effect.Effect<string | null, DesktopUnavailable>;
26
+ };
27
+ declare const DesktopWindow_base: Context.ServiceClass<DesktopWindow, "@smthrs/platform-bun/src/BunDesktop#DesktopWindow", DesktopWindow_shape>;
28
+ /** The native desktop seam; dialogs are selected by the person, never by web content. */
29
+ export declare class DesktopWindow extends DesktopWindow_base {
30
+ }
31
+ export declare namespace DesktopWindow {
32
+ type Shape = DesktopWindow_shape;
33
+ }
34
+ type NativeLoader_shape = {
35
+ readonly load: Effect.Effect<typeof Electrobun, DesktopUnavailable>;
36
+ };
37
+ declare const NativeLoader_base: Context.ServiceClass<NativeLoader, "@smthrs/platform-bun/src/BunDesktop#NativeLoader", NativeLoader_shape>;
38
+ /** The foreign native dependency, injectable as a real host port or a faulty Effect service. */
39
+ export declare class NativeLoader extends NativeLoader_base {
40
+ }
41
+ export declare namespace NativeLoader {
42
+ type Shape = NativeLoader_shape;
43
+ }
44
+ /** Compose the native seam with an explicit external binding service. */
45
+ export declare const layerWith: (loader: NativeLoader.Shape) => Layer.Layer<DesktopWindow, DesktopUnavailable, never>;
46
+ /** Load the supported Electrobun peer lazily at the host boundary. */
47
+ export declare const layer: Layer.Layer<DesktopWindow, DesktopUnavailable, never>;
48
+ export {};
49
+ //# sourceMappingURL=BunDesktop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BunDesktop.d.ts","sources":["../../src/BunDesktop.vibe"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,UAAU,MAAM,aAAa,CAAA;;AAG9C,8FAA8F;AAC9F,qBAAoB,kBAAmB,SAAA,uBAAE;CAAA;AAEzC;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC7G;;wBAIqB,MAAM;iBACb,GAAG,EAAE,MAAM,GAAO,MAAC,CAAD,MAAC,CAAL,IAAI,EAAC,kBAAkB,CAAA;SAC7C,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAO,MAAC,CAAD,MAAC,CAAL,IAAI,EAAC,kBAAkB,CAAA;uBACjC,MAAC,CAAD,MAAC,CAAf,MAAM,GAAG,IAAI,EAAE,kBAAkB,CAAA;;;AALvD,yFAAyF;AACzF,qBAAe,aAAa;CAK3B;;;;;mBAa6D,MAAC,CAAD,MAAC,CAAlB,OAAO,UAAU,EAAC,kBAAkB,CAAA;;;AADjF,gGAAgG;AAChG,qBAAe,YAAY;CAAwD;;;;AA2CnF,yEAAyE;AACzE,eAAO,MAAM,SAAS,WAAY,kBAAkB,0DAA4E,CAAA;AAEhI,sEAAsE;AACtE,eAAO,MAAM,KAAK,uDAAiI,CAAA"}