@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,140 @@
1
+ /**
2
+ * @stability unstable
3
+ * @since 4.0.0
4
+ */
5
+ /**
6
+ * @stability experimental
7
+ * @since 4.0.0
8
+ */
9
+ export * as NodeAddressResolver from "./node/NodeAddressResolver.ts";
10
+ /**
11
+ * @stability unstable
12
+ * @since 4.0.0
13
+ */
14
+ export * as NodeChildProcessSpawner from "./node/NodeChildProcessSpawner.ts";
15
+ /**
16
+ * @stability unstable
17
+ * @since 4.0.0
18
+ */
19
+ export * as NodeClusterHttp from "./node/NodeClusterHttp.ts";
20
+ /**
21
+ * @stability unstable
22
+ * @since 4.0.0
23
+ */
24
+ export * as NodeClusterSocket from "./node/NodeClusterSocket.ts";
25
+ /**
26
+ * @stability unstable
27
+ * @since 1.0.0
28
+ */
29
+ export * as NodeCrypto from "./node/NodeCrypto.ts";
30
+ /**
31
+ * @stability experimental
32
+ * @since 4.0.0
33
+ */
34
+ export * as NodeDatagramSocket from "./node/NodeDatagramSocket.ts";
35
+ /**
36
+ * @stability experimental
37
+ * @since 4.0.0
38
+ */
39
+ export * as NodeDns from "./node/NodeDns.ts";
40
+ /**
41
+ * @stability unstable
42
+ * @since 4.0.0
43
+ */
44
+ export * as NodeFileSystem from "./node/NodeFileSystem.ts";
45
+ /**
46
+ * @stability unstable
47
+ * @since 4.0.0
48
+ */
49
+ export * as NodeHttpClient from "./node/NodeHttpClient.ts";
50
+ /**
51
+ * @stability unstable
52
+ * @since 4.0.0
53
+ */
54
+ export * as NodeHttpIncomingMessage from "./node/NodeHttpIncomingMessage.ts";
55
+ /**
56
+ * @stability unstable
57
+ * @since 4.0.0
58
+ */
59
+ export * as NodeHttpPlatform from "./node/NodeHttpPlatform.ts";
60
+ /**
61
+ * @stability unstable
62
+ * @since 4.0.0
63
+ */
64
+ export * as NodeHttpServer from "./node/NodeHttpServer.ts";
65
+ /**
66
+ * @stability unstable
67
+ * @since 4.0.0
68
+ */
69
+ export * as NodeHttpServerRequest from "./node/NodeHttpServerRequest.ts";
70
+ /**
71
+ * @stability unstable
72
+ * @since 4.0.0
73
+ */
74
+ export * as NodeMultipart from "./node/NodeMultipart.ts";
75
+ /**
76
+ * @stability unstable
77
+ * @since 4.0.0
78
+ */
79
+ export * as NodeMultipartParser from "./node/NodeMultipartParser.ts";
80
+ /**
81
+ * @stability unstable
82
+ * @since 4.0.0
83
+ */
84
+ export * as NodePath from "./node/NodePath.ts";
85
+ /**
86
+ * @stability unstable
87
+ * @since 4.0.0
88
+ */
89
+ export * as NodeRedis from "./node/NodeRedis.ts";
90
+ /**
91
+ * @stability unstable
92
+ * @since 4.0.0
93
+ */
94
+ export * as NodeRuntime from "./node/NodeRuntime.ts";
95
+ /**
96
+ * @stability unstable
97
+ * @since 4.0.0
98
+ */
99
+ export * as NodeServices from "./node/NodeServices.ts";
100
+ /**
101
+ * @stability unstable
102
+ * @since 4.0.0
103
+ */
104
+ export * as NodeSink from "./node/NodeSink.ts";
105
+ /**
106
+ * @stability unstable
107
+ * @since 4.0.0
108
+ */
109
+ export * as NodeSocket from "./node/NodeSocket.ts";
110
+ /**
111
+ * @stability unstable
112
+ * @since 4.0.0
113
+ */
114
+ export * as NodeSocketServer from "./node/NodeSocketServer.ts";
115
+ /**
116
+ * @stability unstable
117
+ * @since 4.0.0
118
+ */
119
+ export * as NodeStdio from "./node/NodeStdio.ts";
120
+ /**
121
+ * @stability unstable
122
+ * @since 4.0.0
123
+ */
124
+ export * as NodeStream from "./node/NodeStream.ts";
125
+ /**
126
+ * @stability unstable
127
+ * @since 4.0.0
128
+ */
129
+ export * as NodeTerminal from "./node/NodeTerminal.ts";
130
+ /**
131
+ * @stability unstable
132
+ * @since 4.0.0
133
+ */
134
+ export * as NodeWorker from "./node/NodeWorker.ts";
135
+ /**
136
+ * @stability unstable
137
+ * @since 4.0.0
138
+ */
139
+ export * as NodeWorkerRunner from "./node/NodeWorkerRunner.ts";
140
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,130 @@
1
+ import "./chunk-6QPSLCUZ.js";
2
+ import {
3
+ NodeSocketServer_exports
4
+ } from "./chunk-J43O5GFH.js";
5
+ import {
6
+ NodeWorker_exports
7
+ } from "./chunk-YJGNV6EV.js";
8
+ import {
9
+ NodeWorkerRunner_exports
10
+ } from "./chunk-6R444NFO.js";
11
+ import {
12
+ NodeRedis_exports
13
+ } from "./chunk-XDPP24MG.js";
14
+ import {
15
+ NodeRuntime_exports
16
+ } from "./chunk-DWSNOBD4.js";
17
+ import {
18
+ NodeDatagramSocket_exports
19
+ } from "./chunk-4YK2MHSO.js";
20
+ import "./chunk-TCKM3JXD.js";
21
+ import {
22
+ NodeDns_exports
23
+ } from "./chunk-2LGUVSNM.js";
24
+ import {
25
+ NodeHttpServerRequest_exports
26
+ } from "./chunk-NNTJGFLB.js";
27
+ import {
28
+ NodeAddressResolver_exports
29
+ } from "./chunk-OV2KKGBA.js";
30
+ import {
31
+ NodeClusterHttp_exports
32
+ } from "./chunk-KANNAI65.js";
33
+ import {
34
+ NodeHttpServer_exports
35
+ } from "./chunk-6KYVM2ZC.js";
36
+ import {
37
+ NodeMultipart_exports
38
+ } from "./chunk-QKYYD3AZ.js";
39
+ import {
40
+ NodeMultipartParser_exports
41
+ } from "./chunk-X6FYP2EH.js";
42
+ import {
43
+ NodeServices_exports
44
+ } from "./chunk-DHTPLWAP.js";
45
+ import {
46
+ NodeStdio_exports
47
+ } from "./chunk-WGUQHMX2.js";
48
+ import {
49
+ NodeTerminal_exports
50
+ } from "./chunk-GITB76ZP.js";
51
+ import {
52
+ NodePath_exports
53
+ } from "./chunk-XF3WZCMZ.js";
54
+ import {
55
+ NodeSocket_exports
56
+ } from "./chunk-GMORYZG4.js";
57
+ import {
58
+ NodeHttpPlatform_exports
59
+ } from "./chunk-KEMBVIRS.js";
60
+ import {
61
+ NodeChildProcessSpawner_exports
62
+ } from "./chunk-QLI7T34M.js";
63
+ import {
64
+ NodeClusterSocket_exports
65
+ } from "./chunk-2AP6TO77.js";
66
+ import {
67
+ NodeHttpClient_exports
68
+ } from "./chunk-V577GRCI.js";
69
+ import {
70
+ NodeSink_exports
71
+ } from "./chunk-XAVBQY4D.js";
72
+ import {
73
+ NodeHttpIncomingMessage_exports
74
+ } from "./chunk-AMAL6TRE.js";
75
+ import {
76
+ NodeFileSystem_exports
77
+ } from "./chunk-WNS3OER2.js";
78
+ import {
79
+ NodeStream_exports
80
+ } from "./chunk-S3MN5OXB.js";
81
+ import {
82
+ NodeCrypto_exports
83
+ } from "./chunk-ZJEHEPDQ.js";
84
+ import "./chunk-BHV44Z6K.js";
85
+ import "./chunk-AW6WQVI7.js";
86
+ import "./chunk-226TYKP6.js";
87
+ import "./chunk-FIPFWLCV.js";
88
+ import "./chunk-PBM2HJOX.js";
89
+ import "./chunk-JTST2Z7N.js";
90
+ import "./chunk-IXI7RW3A.js";
91
+ import "./chunk-TBMTA5LD.js";
92
+ import "./chunk-T5WDTZCE.js";
93
+ import "./chunk-DX4VFONH.js";
94
+ import "./chunk-M2QOSF47.js";
95
+ import "./chunk-UXIG7ALP.js";
96
+ import "./chunk-Q7YXUH7M.js";
97
+ import "./chunk-4O4Z52A2.js";
98
+ import "./chunk-R2PFJKSP.js";
99
+ import "./chunk-7JOAEKDV.js";
100
+ import "./chunk-3SUO3TTE.js";
101
+ import "./chunk-MLKGABMK.js";
102
+ export {
103
+ NodeAddressResolver_exports as NodeAddressResolver,
104
+ NodeChildProcessSpawner_exports as NodeChildProcessSpawner,
105
+ NodeClusterHttp_exports as NodeClusterHttp,
106
+ NodeClusterSocket_exports as NodeClusterSocket,
107
+ NodeCrypto_exports as NodeCrypto,
108
+ NodeDatagramSocket_exports as NodeDatagramSocket,
109
+ NodeDns_exports as NodeDns,
110
+ NodeFileSystem_exports as NodeFileSystem,
111
+ NodeHttpClient_exports as NodeHttpClient,
112
+ NodeHttpIncomingMessage_exports as NodeHttpIncomingMessage,
113
+ NodeHttpPlatform_exports as NodeHttpPlatform,
114
+ NodeHttpServer_exports as NodeHttpServer,
115
+ NodeHttpServerRequest_exports as NodeHttpServerRequest,
116
+ NodeMultipart_exports as NodeMultipart,
117
+ NodeMultipartParser_exports as NodeMultipartParser,
118
+ NodePath_exports as NodePath,
119
+ NodeRedis_exports as NodeRedis,
120
+ NodeRuntime_exports as NodeRuntime,
121
+ NodeServices_exports as NodeServices,
122
+ NodeSink_exports as NodeSink,
123
+ NodeSocket_exports as NodeSocket,
124
+ NodeSocketServer_exports as NodeSocketServer,
125
+ NodeStdio_exports as NodeStdio,
126
+ NodeStream_exports as NodeStream,
127
+ NodeTerminal_exports as NodeTerminal,
128
+ NodeWorker_exports as NodeWorker,
129
+ NodeWorkerRunner_exports as NodeWorkerRunner
130
+ };
package/docs/README.md ADDED
@@ -0,0 +1,135 @@
1
+ ---
2
+ title: "@smthrs/platform-bun"
3
+ description: "The Bun host bundle for Smithers: one Effect layer that fills the five services a program reaches the outside world through, with optional containment for the processes it spawns."
4
+ ---
5
+
6
+ `@smthrs/platform-bun` is the Bun host bundle for Smithers, which runs long jobs
7
+ as durable flows: each step is recorded, so a restart resumes what did not
8
+ finish instead of starting over. `BunHost.layer` is a single Effect layer that
9
+ fills the five services a program reaches the outside world through: the
10
+ filesystem, path handling, child processes, version control, and HTTP.
11
+
12
+ ## What it solves
13
+
14
+ A program that calls `node:fs`, `Bun.spawn`, or a global `fetch` directly cannot
15
+ be permission checked, denied, audited, or replayed, because nothing sits
16
+ between it and the runtime. Smithers closes the outside world behind five Effect
17
+ service tags instead, and a host bundle is the object that fills them. This
18
+ package is that object for a process running on Bun.
19
+
20
+ Composing the same five slots by hand costs you two properties this bundle
21
+ already has:
22
+
23
+ - **A filesystem that survives a symlink race.** The filesystem slot carries
24
+ [`@smthrs/platform-node`](/api/platform-node)'s `AtomicFileSystem`, so under
25
+ [`@smthrs/kernel`](/api/kernel)'s guard an authorized path operation runs
26
+ against file descriptors and refuses to follow a link, rather than failing
27
+ closed. A symlink swapped in after authorization cannot redirect the write.
28
+ - **An HTTP client that stops at a redirect.** The bundle configures Effect's
29
+ egress client without automatic redirects, so a `302`
30
+ comes back to you as a `302` and the second origin is never contacted. A
31
+ client that follows redirects on its own reaches a host nobody authorized.
32
+
33
+ The bundle also runs on Node.js 26.4.0 or later. The raw child-process spawner
34
+ is Effect's Node spawner re-exported; contained POSIX variants use
35
+ `ProcessReaper.layerSpawner` and its prepared native adapter. See
36
+ [Runtime parity with Node](./concepts/runtime-parity.md).
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ bun add @smthrs/platform-bun@1.0.0-rc.13 effect
42
+ ```
43
+
44
+ `effect` is a required peer at exactly `4.0.5`. `@effect/platform-bun` is
45
+ bundled privately, built from `effect@4.0.5`. The filesystem slot runs the
46
+ `smithers-jj-export` helper that the required peer `@smthrs/platform-node`
47
+ ships. The `Jj` slot needs jj 0.39.0 or later, checked on its first operation;
48
+ every bundle builds without jj. [Installation](./installation.md) covers all
49
+ three and the import forms.
50
+
51
+ ## Run a command and a file operation through the host
52
+
53
+ This program names Bun nowhere. It asks for two service tags, and the layer
54
+ decides what fills them:
55
+
56
+ ```ts
57
+ import { BunHost } from "@smthrs/platform-bun"
58
+ import * as Effect from "effect/Effect"
59
+ import * as FileSystem from "effect/FileSystem"
60
+ import * as ChildProcess from "effect/process/ChildProcess"
61
+ import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
62
+
63
+ const program = Effect.gen(function*() {
64
+ const fs = yield* FileSystem.FileSystem
65
+ const spawner = yield* ChildProcessSpawner
66
+
67
+ yield* fs.writeFileString("report.txt", "written through the host filesystem\n")
68
+ return yield* spawner.string(ChildProcess.make("wc", ["-c", "report.txt"]))
69
+ })
70
+
71
+ Effect.runPromise(Effect.provide(program, BunHost.layer)).then(console.log)
72
+ ```
73
+
74
+ Replace `BunHost.layer` with `NodeHost.layer` from
75
+ [`@smthrs/platform-node`](/api/platform-node) and the program above does not
76
+ change a character. That portability is what the five tags buy.
77
+
78
+ Two variants change one slot each. `BunHost.layerAt(root)` binds version control
79
+ to one absolute repository root instead of the process working directory, which
80
+ a long-lived host wants because the working directory is ambient state anything
81
+ can change. `BunHost.layerContained(options)` routes every spawn through a
82
+ prepared supervisor with a `SIGTERM`-then-`SIGKILL` deadline. The owner is
83
+ recorded before target activation; each pipeline leg has its own record. The
84
+ handle's `pid` names the supervisor, and `exitCode` describes the target. A
85
+ natural target exit still cleans up its owned group, and only verified cleanup
86
+ retires the record. The durable ledger lets a later incarnation reconcile any
87
+ retained records.
88
+
89
+ ## How this relates to @smthrs/flows
90
+
91
+ [`@smthrs/flows`](/api/flows) is the durable flow engine: it records each step of
92
+ a long job in a journal, so a restart replays what finished and resumes at what
93
+ did not. Steps still have to read files and spawn processes, and this package is
94
+ one of the three bundles that let them.
95
+
96
+ `@smthrs/flows` re-exports no platform bundle on purpose, for the same reason
97
+ `effect`'s own index does not re-export `@effect/platform-node`: a platform is
98
+ chosen by the program that runs, not by the library it depends on. Its
99
+ `NodeRuntime` helper builds a Node host for you, so a program that calls
100
+ `NodeRuntime.layerHost` never imports a platform package. A program that runs on
101
+ Bun composes this package instead and provides `BunHost.layer` itself.
102
+ [`@smthrs/platform-node`](/api/platform-node) and
103
+ [`@smthrs/platform-browser`](/api/platform-browser) are the sibling bundles that
104
+ fill the same five slots on their own runtimes.
105
+
106
+ Above both sits [`@smthrs/cli`](/api/cli), the `smithers` command that finds the
107
+ flows in a project, plans them, runs them, and reads their events back. Install
108
+ the CLI to run flows from a shell or a CI job, `@smthrs/flows` when the program
109
+ that runs them is yours, and this package when that program runs on Bun.
110
+
111
+ ## Where to go next
112
+
113
+ - [Installation](./installation.md): the install line, the peer dependencies,
114
+ the `smithers-jj-export` helper, the supported runtimes, and the import forms.
115
+ - [Quickstart](./quickstart.md): the program above, run twice, the second time
116
+ with containment on and a child visible in the ledger.
117
+ - [The Host surface on Bun](./concepts/host-surface.md): what each of the five
118
+ slots is, whose code fills it, and how to take one service without the other
119
+ four.
120
+ - [Contain and reap child processes](./guides/contain-child-processes.md): the
121
+ escalation deadline, the ledger, and the sweep that kills what a crashed host
122
+ abandoned.
123
+ - [Bind the host to a repository root](./guides/bind-a-repository-root.md):
124
+ `layerAt`, `layerContainedAt`, and the refusal they throw.
125
+ - [API reference](./api.md): every export, with its signature.
126
+ - [Troubleshooting](./troubleshooting.md): the failures these modules produce,
127
+ and what to change.
128
+
129
+ The host exports `implementationIds` for its five service slots. Its rooted
130
+ factories reject invalid roots before constructing a layer, using the host's
131
+ own error with code `invalid_repository_root`.
132
+
133
+ BunHost includes BunCrypto in every bundle, so ArtifactStore.put composes
134
+ with BunHost alone. Crypto remains separate from the five capability slots.
135
+ BunHost also re-exports ProcessReaper and HostLiveness from platform-node.
package/docs/api.md ADDED
@@ -0,0 +1,264 @@
1
+ ---
2
+ title: "API reference"
3
+ description: "Every export of @smthrs/platform-bun: the BunHost layers and their refusal, the containment options, the implementation identities, and the BunFileSystem escape hatch."
4
+ ---
5
+
6
+ ```ts
7
+ import { BunHost } from "@smthrs/platform-bun"
8
+ import * as Effect from "effect/Effect"
9
+ import * as ChildProcess from "effect/process/ChildProcess"
10
+ import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
11
+
12
+ const program = Effect.gen(function*() {
13
+ const spawner = yield* ChildProcessSpawner
14
+ return yield* spawner.string(ChildProcess.make("printf", ["hello"]))
15
+ }).pipe(Effect.provide(BunHost.layer))
16
+ ```
17
+
18
+ This barrel and `BunHost` import `@effect/platform-bun` at module load. It
19
+ and the Effect Node platform packages are bundled privately, built from
20
+ `effect@4.0.5`. `effect` is a required peer at exactly `4.0.5`.
21
+
22
+ :::warning
23
+ This entry point is Node-only in the browser-bundle sense: it falls back to the
24
+ `@effect/platform-node` adapters off Bun, so it resolves `node:fs` and the other
25
+ `node:` built-ins. It runs on Bun and on Node. What it does not do is bundle for
26
+ a browser; a page composes
27
+ [`@smthrs/platform-browser`](/api/platform-browser) instead.
28
+ :::
29
+
30
+ Every host bundle builds without jj. The `Jj` slot requires jj 0.39.0 or newer
31
+ and checks its executable on its first operation, which fails with `JjError`
32
+ `not_installed` or `unsupported_version` when jj is missing or older. The
33
+ contained bundles route that probe through their process spawner and retire its
34
+ ledger entry when it exits. Probe results are cached per resolved absolute
35
+ executable path and runner; contained spawners share a result only within the
36
+ same spawner instance.
37
+
38
+ ## Entry points
39
+
40
+ | Import | Source | Platform |
41
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | --------- |
42
+ | `@smthrs/platform-bun` | [src/index.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-bun/src/index.ts) | Bun, Node |
43
+ | `@smthrs/platform-bun/BunHost` | [src/BunHost.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-bun/src/BunHost.ts) | Bun, Node |
44
+ | `@smthrs/platform-bun/BunFileSystem` | [src/BunFileSystem.ts](https://github.com/smithersai/smithers/blob/main/packages/smithers/flows/platform-bun/src/BunFileSystem.ts) | Bun, Node |
45
+
46
+ The root entry point exports exactly two names, `BunHost` and `BunFileSystem`,
47
+ each the namespace of the module above. `@smthrs/platform-bun/internal/*` and
48
+ `@smthrs/platform-bun/*/index` are blocked in the export map;
49
+ `@smthrs/platform-bun/package.json` is exported.
50
+
51
+ Supported runtimes are Bun >=1.4.0 and Node.js >=26.4.0.
52
+
53
+ ## BunHost
54
+
55
+ The complete closed Host bundle: layers, root errors, models,
56
+ implementation identities, and platform module re-exports.
57
+
58
+ ### Layers
59
+
60
+ | Export | Signature |
61
+ | ------------------ | ----------------------------------------------------------------------------------------------------------- |
62
+ | `layer` | `Layer.Layer<BunHost \| Crypto.Crypto>` |
63
+ | `layerAt` | `(root: string) => Layer.Layer<BunHost \| Crypto.Crypto>` |
64
+ | `layerContained` | `(options?: ContainedOptions) => Layer.Layer<BunHost \| Crypto.Crypto, never, ProcessLedger>` |
65
+ | `layerContainedAt` | `(root: string, options?: ContainedOptions) => Layer.Layer<BunHost \| Crypto.Crypto, never, ProcessLedger>` |
66
+ | `layerHttpClient` | `Layer.Layer<HttpClient>` |
67
+
68
+ `layer` provides all five Host services, including the runtime-independent
69
+ `Path`. `Jj` is bound to the process working directory.
70
+
71
+ `layerAt` is `layer` with `Jj` bound to `root` instead. `root` must be an
72
+ absolute path without NUL; see [BunHostError](#bunhosterror).
73
+
74
+ `layerContained` is `layer` with process containment turned on: every child is
75
+ spawned through `@smthrs/kernel`'s `ContainedSpawner` with
76
+ `ProcessReaper.layerSpawner`, including its native adapter and
77
+ `ProcessReaper.processLifecycle`. Each pipeline leg prepares a supervisor,
78
+ records its identity, and then activates the target with a
79
+ `SIGTERM`-then-`SIGKILL` deadline. The ledger retires a record only after
80
+ verified cleanup, and `@smthrs/platform-node`'s `ProcessReaper` sweeps the records a
81
+ crashed incarnation left behind while the layer is built. `Jj` is built over
82
+ that same spawner (`BunJj.layerSpawner`), so a `jj` a dead host left running is
83
+ a ledger record like any other. The `ProcessLedger` requirement is deliberate:
84
+ only the program knows whether it has a durable one.
85
+
86
+ On POSIX, `handle.pid` names the supervisor; `exitCode` and `isRunning`
87
+ describe the target. Natural target exit still cleans up children in its owned
88
+ group, including children holding output open. `detached: false` retains the
89
+ supervisor but opts out of group cleanup, signalling only the target. Use the
90
+ handle's `kill` rather than signalling its numeric pid yourself. Explicit
91
+ stopping while a grouped target is alive attempts a best-effort ancestry sweep
92
+ for escaped descendants; natural exit does not reclaim deliberately escaped
93
+ sessions. Failed cleanup fails scope close and retains its record. Ordinary
94
+ Bun runtimes are supported; compiled Bun applications are refused before
95
+ activation because they cannot launch the runtime supervisor.
96
+
97
+ `layerContainedAt` is `layerContained` with `Jj` bound to `root`
98
+ (`BunJj.layerSpawnerAt`). It refuses a root exactly as `layerAt` does.
99
+
100
+ `layerHttpClient` is the network slot every factory above installs, on its
101
+ own: `EgressHttpClient.layer(process.env)` from `@smthrs/platform-node`. A `3xx`
102
+ comes back with its `location` header intact and the second origin is never
103
+ contacted. Following a redirect is `@smthrs/kernel`'s guarded
104
+ `HttpClient.layer`, which rechecks the capability on every hop.
105
+
106
+ ### BunHostError
107
+
108
+ ```ts
109
+ class BunHostError extends Schema.TaggedError<BunHostError>()("@smthrs/platform-bun/BunHostError", {
110
+ code: Schema.Literal("invalid_repository_root"),
111
+ message: Schema.String
112
+ }) {
113
+ readonly name: "BunHostError"
114
+ }
115
+
116
+ type BunHostErrorCode = "invalid_repository_root"
117
+ ```
118
+
119
+ The refusal `layerAt` and `layerContainedAt` throw when `root` is not absolute,
120
+ the empty string included, or contains NUL. It is thrown rather than failed
121
+ because a factory runs while a program composes its layers, where there is no
122
+ fiber to fail into and a wrong root is a composition mistake, not a runtime
123
+ outcome. The check runs when the factory is called, before any layer exists.
124
+
125
+ It is this package's class rather than the `Jj` adapter's: a Bun caller
126
+ composed `BunHost` and should learn nothing about the adapter behind the `Jj`
127
+ slot from an error message. The message names the Bun factory that refused,
128
+ never `NodeJj`, and repeats at most 64 code points of the root before reporting
129
+ its true length, so a root taken from input cannot flood a log line. Branch on
130
+ `code`; the message is for a person.
131
+
132
+ ### Models
133
+
134
+ | Export | Type | Meaning |
135
+ | ------------------- | ------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
136
+ | `BunHost` | `FileSystem \| Path \| ChildProcessSpawner \| Jj \| HttpClient \| ProcessConfinement` | The Host services and native confinement this bundle provides. |
137
+ | `BunHostErrorCode` | `"invalid_repository_root"` | The stable codes a factory refuses with. |
138
+ | `ContainedOptions` | `ProcessReaper.SpawnerOptions & ProcessReaper.Options` | What a caller may configure about containment. |
139
+ | `implementationIds` | `Readonly<Record<HostServiceIds[number], string>>` | The module behind each raw bundle Host slot. |
140
+
141
+ All four factories supply the shared native
142
+ [`ProcessConfinement.layer()`](/api/platform-node#processconfinement).
143
+ Guarded commands use the same OS confinement on Node and Bun.
144
+
145
+ `ContainedOptions` carries three fields:
146
+
147
+ | Field | Meaning |
148
+ | ---------- | --------------------------------------------------------------------------------------------------------------------- |
149
+ | `graceMs` | Milliseconds between the `SIGTERM` that asks a child to stop and the `SIGKILL` that makes it. Default 2000. |
150
+ | `ownerPid` | The pid the reaper must never signal a group for. Default `process.pid`. |
151
+ | `system` | The operating-system seam the reaper reads liveness and start times through. Default: chosen from `process.platform`. |
152
+
153
+ `platform` is deliberately not part of it. The factory uses the real
154
+ `process.platform`, so the native process-group behavior and recorded identity
155
+ agree. A caller cannot describe a Windows record for an owner that actually
156
+ leads a POSIX group. For a smaller Bun composition, use
157
+ `ProcessReaper.layerSpawner` with a ledger and an underlying runtime spawner.
158
+
159
+ Each factory reads its options when it is called and splits them into the
160
+ spawner half and the reaper half, so a field meant for one can never be read by
161
+ the other and mutating the object afterwards changes neither layer.
162
+
163
+ `implementationIds` names the raw bundle implementation behind each slot rather than the
164
+ specifier you import it through, which is why the filesystem entry is
165
+ `@smthrs/platform-node/AtomicFileSystem`. Contained factories replace the
166
+ process runner with `ProcessReaper.layerSpawner`; this static table does not
167
+ describe that substitution:
168
+
169
+ ```ts
170
+ {
171
+ "effect/FileSystem": "@smthrs/platform-node/AtomicFileSystem",
172
+ "effect/Path": "@effect/platform-bun/BunPath",
173
+ "effect/process/ChildProcessSpawner": "@effect/platform-bun/BunChildProcessSpawner",
174
+ "@smthrs/jj/Jj": "@smthrs/jj/bun/BunJj",
175
+ "effect/HttpClient": "@smthrs/platform-node/EgressHttpClient"
176
+ }
177
+ ```
178
+
179
+ A key is the slot's stable identity in [`@smthrs/kernel`](/api/kernel)'s closed
180
+ list, which is not always the specifier the tag is imported from: the spawner
181
+ slot is `effect/process/ChildProcessSpawner` while its tag comes from
182
+ `effect/process/ChildProcessSpawner`. The keys are written as literals
183
+ rather than positions in that list, so reordering it cannot silently pair a slot
184
+ with another slot's implementation. Nothing digests the record yet:
185
+ [`@smthrs/plan`](/api/plan)'s step key carries a `layers` component these values
186
+ are meant to feed, but no planner derives it from a host bundle today, so
187
+ changing one invalidates no cached step.
188
+
189
+ ### Re-exports
190
+
191
+ `BunHost` re-exports these modules so a program that should reach only part of
192
+ the host has one place to take it from:
193
+
194
+ | Export | What it is |
195
+ | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
196
+ | `AtomicFileSystem` | `@smthrs/platform-node/AtomicFileSystem`, the filesystem implementation itself. |
197
+ | `BunChildProcessSpawner` | `@effect/platform-bun/BunChildProcessSpawner`. |
198
+ | `BunCrypto` | `@effect/platform-bun/BunCrypto`, the [Effect Crypto service](https://github.com/Effect-TS/effect/blob/main/packages/platform/bun/src/BunCrypto.ts) layer. |
199
+ | `BunFileSystem` | This package's `BunFileSystem` module. |
200
+ | `HostLiveness` | `@smthrs/platform-node/HostLiveness`, the [host liveness probe](/api/platform-node#liveness-and-reaping). |
201
+ | `ProcessReaper` | `@smthrs/platform-node/ProcessReaper`, the [contained spawner](/api/platform-node#processreaperlayerspawner) and [orphan sweep](/api/platform-node#liveness-and-reaping). |
202
+
203
+ `AtomicFileSystem` is in the set for the same reason `NodeHost` re-exports it:
204
+ it owns the only configuration escape hatch the filesystem slot has, and a Bun
205
+ program whose helper is elsewhere must reach
206
+ `AtomicFileSystem.layerWith` without adding
207
+ [`@smthrs/platform-node`](/api/platform-node) as a second dependency.
208
+
209
+ `BunJj` is deliberately absent. It belongs to [`@smthrs/jj`](/api/jj) and is
210
+ imported from there, never re-exported here.
211
+
212
+ `@effect/platform-bun/BunHttpClient` is deliberately absent too: its `layer`
213
+ follows redirects to origins the capability kernel never authorized. Take the
214
+ network slot on its own from `layerHttpClient`.
215
+
216
+ ## BunFileSystem
217
+
218
+ The filesystem slot on its own.
219
+
220
+ | Export | Signature | Meaning |
221
+ | ----------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------- |
222
+ | `layer` | `Layer<FileSystem>` | The filesystem slot, carrying the kernel's atomic host extension. Is `AtomicFileSystem.layer`. |
223
+ | `layerWith` | `(options: Options) => Layer<FileSystem>` | The same filesystem against an explicitly configured helper and byte limits. |
224
+ | `Options` | `AtomicFileSystem.Options` | The helper, concurrency ceiling, timeout, and byte limits `layerWith` accepts. |
225
+
226
+ `layer` is `@smthrs/platform-node`'s `AtomicFileSystem.layer`, the same value
227
+ behind `NodeHost`'s filesystem slot, by identity and not by resemblance. It
228
+ carries the kernel's atomic host extension, so under
229
+ [@smthrs/kernel](/api/kernel)'s `FileSystem.layer` a guarded path operation runs
230
+ descriptor-relative and no-follow instead of failing closed, and a symlink
231
+ swapped in after authorization cannot redirect it.
232
+
233
+ That extension executes its syscalls through the `smithers-jj-export` helper,
234
+ a host prerequisite. Windows is unsupported.
235
+
236
+ `layerWith` is the escape hatch for a host whose helper is outside the default
237
+ search; `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` does the same without code. `BunHost` re-exports the
238
+ same escape hatch as `AtomicFileSystem`, for parity with `NodeHost`.
239
+ `executable` is re-validated per request, because the file it names can be
240
+ replaced while the host runs; everything else is snapshotted when the layer is
241
+ built.
242
+
243
+ ## Two services the bundle does not wrap
244
+
245
+ There is no shell service, and no runtime detection either, because Bun's
246
+ spawner _is_ the Node one. Running a command is Effect's `ChildProcess` and
247
+ `ChildProcessSpawner`, and there is nothing for a detection branch to choose
248
+ between.
249
+
250
+ There is no HTTP service either. `BunHost` provides the shared `EgressHttpClient.layer(process.env)`, so the
251
+ runtime never walks to a second origin behind the capability kernel's back.
252
+ Following a redirect is [@smthrs/kernel](/api/kernel)'s guarded
253
+ `HttpClient.layer`, which rechecks the capability on every hop.
254
+
255
+ ## Reading next
256
+
257
+ [@smthrs/kernel](/api/kernel) owns the closed list and decorates these same tags
258
+ with capability checks. [@smthrs/platform-node](/api/platform-node) and
259
+ [@smthrs/platform-browser](/api/platform-browser) are the sibling bundles.
260
+ [The Host surface on Bun](./concepts/host-surface.md) explains what each slot
261
+ buys, [Runtime parity with Node](./concepts/runtime-parity.md) explains how far
262
+ the two runtimes are interchangeable, and
263
+ [Troubleshooting](./troubleshooting.md) lists the failures these exports
264
+ produce.