@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,131 @@
1
+ ---
2
+ title: "Installation"
3
+ description: "Install @smthrs/platform-bun from npm with its required peers, the smithers-jj-export helper @smthrs/platform-node ships for the filesystem slot, the jj executable the Jj slot probes on first use, and the import forms for each entry point."
4
+ sidebar:
5
+ order: 1
6
+ ---
7
+
8
+ ## Install the package and its peers
9
+
10
+ The package is on npm under the `next` tag, which carries the 1.0 release
11
+ candidates. Install the current candidate with Bun:
12
+
13
+ ```bash
14
+ bun add @smthrs/platform-bun@1.0.0-rc.13 effect @smthrs/kernel@1.0.0-rc.13
15
+ ```
16
+
17
+ `@smthrs/kernel` is on the line because the [Quickstart](./quickstart.md)'s
18
+ `contained.ts` imports its `ProcessLedger`, which the contained bundles require.
19
+ Bun's isolated linker and pnpm link only the packages a project declares.
20
+
21
+ The manifest declares two required peers, neither optional:
22
+
23
+ | Peer | Version | Why |
24
+ | ----------------------- | ------------------------------ | --------------------------------------------------------- |
25
+ | `effect` | `4.0.5` | The runtime every service tag belongs to. |
26
+ | `@smthrs/platform-node` | exactly this package's version | The atomic filesystem slot and the containment machinery. |
27
+
28
+ Bun installs required peers, so the line above also installs
29
+ `@smthrs/platform-node` at the matching version. Install one `effect` in the
30
+ peer range so the host shares one Effect runtime. `@effect/platform-bun`,
31
+ `@effect/platform-node` and `@effect/platform-node-shared` are bundled
32
+ privately, built from `effect@4.0.5`, so your project installs none of them.
33
+
34
+ ## Supported runtimes
35
+
36
+ Bun 1.4.0 or later, and Node.js 26.4.0 or later. Both are declared in
37
+ `engines`, and both are real: the bundle falls back to the
38
+ `@effect/platform-node` adapters off Bun, so it runs unchanged under Node. See
39
+ [Runtime parity with Node](./concepts/runtime-parity.md) for what that does and
40
+ does not buy you.
41
+
42
+ ## The filesystem helper
43
+
44
+ The filesystem slot is `@smthrs/platform-node`'s `AtomicFileSystem`, which
45
+ carries the kernel's atomic host extension. That extension does not run
46
+ in-process: it executes each guarded path operation through the
47
+ `smithers-jj-export` helper so the operation is descriptor-relative and
48
+ no-follow.
49
+
50
+ `@smthrs/platform-node` ships the helper prebuilt for macOS (arm64, x64), Linux
51
+ (arm64, x64), and Windows (x64), so installing the package installs it; there
52
+ is nothing to build. `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` only overrides the
53
+ packaged helper with another absolute path; see
54
+ [Configure the filesystem helper](./guides/configure-the-filesystem-helper.md).
55
+
56
+ Windows is unsupported for this slot.
57
+
58
+ ## Install Jujutsu for the Jj slot
59
+
60
+ Every bundle, `BunHost.layer`, `layerAt`, `layerContained`, and
61
+ `layerContainedAt`, builds without jj, so a program that never calls `Jj` runs
62
+ on a host without it. The `Jj` slot requires jj 0.39.0 or later: its first
63
+ operation runs one `jj --version` probe, and on a host without the executable,
64
+ or with an older one, that operation fails with `JjError` carrying
65
+ `not_installed` or `unsupported_version`. The slot selects the executable when
66
+ the layer is built, so restart the program after installing jj.
67
+
68
+ Install [Jujutsu](https://jj-vcs.github.io), a version-control system that
69
+ works on a Git repository, and confirm the version:
70
+
71
+ ```bash
72
+ jj --version
73
+ ```
74
+
75
+ This package vendors no binaries. [`@smthrs/jj`](/api/jj) documents the
76
+ resolution order and the `SMITHERS_JJ_PATH` override for an executable that is
77
+ not on `PATH`.
78
+
79
+ A program that wants only some of the services composes the individual service
80
+ layers instead of a complete bundle: `BunFileSystem.layer`, `Path.layer`, and
81
+ the spawner and HTTP client layers. See
82
+ [The Host surface on Bun](./concepts/host-surface.md) for taking one service
83
+ without the other four.
84
+
85
+ ## Import forms
86
+
87
+ The root entry point re-exports both modules as namespaces:
88
+
89
+ ```ts
90
+ import { BunFileSystem, BunHost } from "@smthrs/platform-bun"
91
+ ```
92
+
93
+ Each module is also importable from its own subpath, which is the form the
94
+ [API reference](./api.md) uses:
95
+
96
+ ```ts
97
+ import * as BunFileSystem from "@smthrs/platform-bun/BunFileSystem"
98
+ import * as BunHost from "@smthrs/platform-bun/BunHost"
99
+ ```
100
+
101
+ Two subpath forms are blocked in the export map and are not public:
102
+ `@smthrs/platform-bun/internal/*` and `@smthrs/platform-bun/*/index`.
103
+ `@smthrs/platform-bun/package.json` is exported.
104
+
105
+ The bundle resolves `node:` built-ins, so it does not bundle for a browser. A
106
+ page composes [`@smthrs/platform-browser`](/api/platform-browser) instead.
107
+
108
+ ## What a real composition adds
109
+
110
+ `BunHost.layer` provides the raw host. Two additions are common:
111
+
112
+ - [`@smthrs/kernel`](/api/kernel) guards it. Its `FileSystem.layer`,
113
+ `ChildProcessSpawner.layer`, `HttpClient.layer`, `Jj.layer`, and `Path.layer`
114
+ decorate the very tags this bundle provides, in place, so a capability check
115
+ runs before every host call. The guarded filesystem is also where the atomic
116
+ extension earns its keep, and it needs a `Workspace` root and a `GrantStore`.
117
+ - A `ProcessLedger`, from `@smthrs/kernel/ProcessLedger`, is required by
118
+ `BunHost.layerContained` and `BunHost.layerContainedAt`. It is a requirement
119
+ rather than a default because only your program knows whether it has a
120
+ durable journal to write to. See
121
+ [Contain and reap child processes](./guides/contain-child-processes.md).
122
+
123
+ The `Jj` slot spawns the `jj` command that
124
+ [Install Jujutsu for the Jj slot](#install-jujutsu-for-the-jj-slot) covers. The
125
+ slot probes it on its first operation, so jj is a requirement of the programs
126
+ that call `Jj`, not of every host.
127
+
128
+ ## Next step
129
+
130
+ Run a command and a file operation through the host in the
131
+ [Quickstart](./quickstart.md).
@@ -0,0 +1,163 @@
1
+ ---
2
+ title: "Quickstart"
3
+ description: "Run a file operation and a command through BunHost.layer, then turn containment on and watch a spawned child enter and leave the process ledger."
4
+ sidebar:
5
+ order: 2
6
+ ---
7
+
8
+ This quickstart runs one program against the Bun host twice: first on the plain
9
+ bundle, then with process containment turned on. By the end you will have
10
+ executed a real child process through the host surface and seen its record
11
+ appear in, and disappear from, the process ledger.
12
+
13
+ ## Prerequisites
14
+
15
+ - Bun 1.4.0 or later, or Node.js 26.4.0 or later.
16
+ - A project with the packages installed:
17
+ `bun add @smthrs/platform-bun@1.0.0-rc.13 effect @smthrs/kernel@1.0.0-rc.13`.
18
+ That also installs the required peer `@smthrs/platform-node`, which ships the
19
+ `smithers-jj-export` helper the filesystem slot runs. `@smthrs/kernel` is on
20
+ the line because `contained.ts` imports its `ProcessLedger`, and Bun's
21
+ isolated linker and pnpm link only the packages a project declares. See
22
+ [Installation](./installation.md).
23
+ - [Jujutsu](https://jj-vcs.github.io) at jj 0.39.0 or later on `PATH`, only for
24
+ a program that calls `Jj`. Neither program below does, and every bundle
25
+ builds without jj; a `Jj` operation on a host without it fails with
26
+ `JjError` `not_installed`. See [Installation](./installation.md) for
27
+ `SMITHERS_JJ_PATH`.
28
+
29
+ ## Run a file operation and a command
30
+
31
+ Create `quickstart.ts`. The program asks for two of the five host services by
32
+ tag, and names Bun nowhere:
33
+
34
+ ```ts
35
+ import { BunHost } from "@smthrs/platform-bun"
36
+ import * as Effect from "effect/Effect"
37
+ import * as FileSystem from "effect/FileSystem"
38
+ import * as ChildProcess from "effect/process/ChildProcess"
39
+ import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
40
+
41
+ const program = Effect.gen(function*() {
42
+ const fs = yield* FileSystem.FileSystem
43
+ const spawner = yield* ChildProcessSpawner
44
+
45
+ yield* fs.writeFileString("report.txt", "written through the host filesystem\n")
46
+ const readBack = yield* fs.readFileString("report.txt")
47
+ const listed = yield* spawner.string(ChildProcess.make("ls", ["report.txt"]))
48
+
49
+ return { listed: listed.trim(), readBack: readBack.trim() }
50
+ })
51
+
52
+ Effect.runPromise(Effect.provide(program, BunHost.layer)).then(console.log)
53
+ ```
54
+
55
+ Run it:
56
+
57
+ ```bash
58
+ bun run quickstart.ts
59
+ ```
60
+
61
+ ```text
62
+ {
63
+ listed: "report.txt",
64
+ readBack: "written through the host filesystem",
65
+ }
66
+ ```
67
+
68
+ `BunHost.layer` provided all five slots; the program used two of them. The
69
+ other three were built and never asked for. Building `Jj` spawned nothing: its
70
+ jj version probe runs on the first `Jj` operation, which this program never
71
+ makes.
72
+
73
+ ## Turn containment on
74
+
75
+ The plain bundle signals its target when the scope closes. A target that exits
76
+ first can leave background descendants holding output open, and a crashed
77
+ host cannot run that finalizer.
78
+
79
+ `BunHost.layerContained` prepares a supervisor for each command, records its
80
+ identity before target execution, and keeps a `SIGTERM`-then-`SIGKILL` deadline
81
+ for the owned process group even after the target exits. The supervisor's
82
+ private host connection also initiates cleanup on host loss. The required
83
+ `ProcessLedger` lets a later host reconcile cleanup that was not confirmed;
84
+ the memory ledger below deliberately has no persistence across restarts.
85
+
86
+ Create `contained.ts`:
87
+
88
+ ```ts
89
+ import * as ProcessLedger from "@smthrs/kernel/ProcessLedger"
90
+ import { BunHost } from "@smthrs/platform-bun"
91
+ import * as Effect from "effect/Effect"
92
+ import * as Layer from "effect/Layer"
93
+ import * as ChildProcess from "effect/process/ChildProcess"
94
+ import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
95
+
96
+ const program = Effect.gen(function*() {
97
+ const ledger = yield* ProcessLedger.makeMemory({
98
+ hostId: "quickstart",
99
+ ownerPid: process.pid
100
+ })
101
+
102
+ const host = BunHost.layerContained({ graceMs: 500 }).pipe(
103
+ Layer.provide(Layer.succeed(ProcessLedger.ProcessLedger)(ledger))
104
+ )
105
+
106
+ const duringScope = yield* Effect.gen(function*() {
107
+ const spawner = yield* ChildProcessSpawner
108
+ yield* spawner.spawn(ChildProcess.make("sleep", ["30"]))
109
+ return yield* ledger.live
110
+ }).pipe(Effect.provide(host), Effect.scoped)
111
+
112
+ return { afterScope: yield* ledger.live, duringScope }
113
+ })
114
+
115
+ Effect.runPromise(program).then((result) => console.log(JSON.stringify(result, null, 2)))
116
+ ```
117
+
118
+ Run it:
119
+
120
+ ```bash
121
+ bun run contained.ts
122
+ ```
123
+
124
+ ```text
125
+ {
126
+ "afterScope": [],
127
+ "duringScope": [
128
+ {
129
+ "pid": 51234,
130
+ "pgid": 51234,
131
+ "hostId": "quickstart",
132
+ "ownerPid": 51230,
133
+ "startedAtMs": 1756900000000,
134
+ "commandDigest": "sleep"
135
+ }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ The recorded pid is the live supervisor, which leads the owned process group;
141
+ it is not the native `sleep` target's pid. `commandDigest` names the executable
142
+ and never its arguments: journal entries are permanent, and arguments carry
143
+ credentials. A returned handle's `exitCode`
144
+ describes the target. The record also names the host incarnation that started
145
+ it, and it is gone after verified scope cleanup. See
146
+ [Contain and reap child processes](./guides/contain-child-processes.md) for
147
+ the `detached: false`, escaped-session, and unsupported-platform boundaries.
148
+
149
+ Give it a durable half by swapping `ProcessLedger.makeMemory` for
150
+ `ProcessLedger.layer`, which writes through a [`@smthrs/journal`](/api/journal)
151
+ `Journal`. Then a crashed host's records survive, and the next incarnation
152
+ kills what the last one abandoned while its layer is built.
153
+
154
+ ## Where to go next
155
+
156
+ - [Contain and reap child processes](./guides/contain-child-processes.md):
157
+ the escalation deadline, the reaper, and the options both contained
158
+ factories take.
159
+ - [Bind the host to a repository root](./guides/bind-a-repository-root.md):
160
+ `layerAt` and `layerContainedAt`, so `Jj` does not inherit the process
161
+ working directory.
162
+ - [The Host surface on Bun](./concepts/host-surface.md): what each of the five
163
+ slots is, and how to take one service without the other four.
@@ -0,0 +1,163 @@
1
+ ---
2
+ title: "Troubleshooting"
3
+ description: "The failures @smthrs/platform-bun produces: a refused repository root, a filesystem guard that fails closed, an unfollowed redirect, a missing process ledger, and a browser bundle that will not resolve."
4
+ ---
5
+
6
+ Find the symptom, read the cause, apply the fix. Every failure here is one this
7
+ package or its slots actually produce; the signatures behind them are on the
8
+ [API reference](./api.md).
9
+
10
+ ## BunHostError: requires an absolute repository root
11
+
12
+ **Symptom.** `BunHost.layerAt` or `BunHost.layerContainedAt` throws while your
13
+ program is still composing its layers:
14
+
15
+ ```text
16
+ BunHostError: BunHost.layerAt requires an absolute repository root, got "repositories/app"
17
+ BunHostError: BunHost.layerAt requires a repository root without NUL, got "/repo\u0000"
18
+ ```
19
+
20
+ **Cause.** The root is not absolute, or it contains NUL, which no filesystem
21
+ or process API can represent. The empty string is not absolute, and neither is
22
+ a path that looks absolute only after the process working directory is applied.
23
+
24
+ **Fix.** Resolve the root before you hand it over, and branch on
25
+ `error.code === "invalid_repository_root"` rather than on the message text. The
26
+ message names the Bun factory that refused and repeats at most 64 code points
27
+ of the root, so a root taken from input cannot flood a log line. See
28
+ [Bind the host to a repository root](./guides/bind-a-repository-root.md).
29
+
30
+ ## PermissionDenied: descriptor-relative filesystem isolation failed closed
31
+
32
+ **Symptom.** A guarded filesystem operation fails, naming the helper it
33
+ could not find:
34
+
35
+ ```text
36
+ PlatformError: PermissionDenied: AtomicFileSystem.writeFileString (/tmp/work/x.txt):
37
+ descriptor-relative filesystem isolation failed closed:
38
+ Error: smithers-jj-export is missing; install @smthrs/platform-node with its native helper, ...
39
+ ```
40
+
41
+ **Cause.** The filesystem slot's no-follow extension executes its syscalls
42
+ through the `smithers-jj-export` helper, and no usable helper was found, or
43
+ the one it was told to spawn is missing or not executable. The guard fails closed rather than falling back to a path-based
44
+ operation, because a path-based fallback is exactly the symlink race the
45
+ extension exists to prevent.
46
+
47
+ **Fix.** Install `@smthrs/platform-node`, the required peer that ships the
48
+ helper for macOS, Linux, and Windows, at this package's version. If
49
+ `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` is set, it overrides the packaged helper:
50
+ point it at an executable helper or unset it. A source checkout of the
51
+ repository has no packaged helper; build one there with
52
+ `cargo build --locked --release -p smithers-ffi --bin smithers-jj-export`. See
53
+ [Configure the filesystem helper](./guides/configure-the-filesystem-helper.md).
54
+
55
+ This failure is unguarded-path-safe: it appears only under
56
+ [`@smthrs/kernel`](/api/kernel)'s `FileSystem.layer`. A program that uses
57
+ `BunFileSystem.layer` without the kernel's guard never starts the helper, so a
58
+ missing helper goes unnoticed until the guard is composed.
59
+
60
+ ## BadResource: Not a directory, on a path that exists
61
+
62
+ **Symptom.** Reading a file through a directory symlink fails with a
63
+ `BadResource` reason, and the same path opens fine from a shell:
64
+
65
+ ```text
66
+ { "_tag": "BadResource", "syscall": "open", "description": "[Errno 20] Not a directory: 'escape'" }
67
+ ```
68
+
69
+ **Cause.** This is the guard working. The component named a symlink pointing
70
+ outside the workspace boundary, and the descriptor-relative helper refuses to
71
+ traverse it rather than following it. A path-based filesystem would have
72
+ followed the link and returned the bytes.
73
+
74
+ **Fix.** Nothing, if the boundary is the one you meant. If the target is
75
+ legitimately part of the workspace, move it inside the boundary root rather
76
+ than reaching it through a link.
77
+
78
+ ## A 302 comes back instead of the redirected response
79
+
80
+ **Symptom.** `HttpClient.execute` returns status `302` with a `location`
81
+ header, and the destination never receives a request.
82
+
83
+ **Cause.** The bundle uses the shared egress client without automatic redirects. A client that follows a
84
+ redirect on its own reaches a second origin the capability kernel never
85
+ authorized.
86
+
87
+ **Fix.** Compose [`@smthrs/kernel`](/api/kernel)'s guarded `HttpClient.layer`,
88
+ which follows redirects and rechecks the capability on every hop. Handling the
89
+ `302` yourself is the other option, and it puts the authorization decision in
90
+ your code.
91
+
92
+ ## layerContained will not compose without a ProcessLedger
93
+
94
+ **Symptom.** `BunHost.layerContained(...)` does not satisfy a
95
+ `Layer.Layer<BunHost>`, and the type error names
96
+ `@smthrs/kernel/ProcessLedger`.
97
+
98
+ **Cause.** Both contained factories return
99
+ `Layer.Layer<BunHost | Crypto.Crypto, never, ProcessLedger.ProcessLedger>`.
100
+ The ledger is a
101
+ requirement rather than a built-in default, because the durable half is only as
102
+ good as the journal underneath it, and only your program knows whether it has
103
+ one.
104
+
105
+ **Fix.** Provide a ledger. `ProcessLedger.layerMemory({ hostId, ownerPid })`
106
+ contains this incarnation's children and inherits nothing;
107
+ `ProcessLedger.layer` writes through a [`@smthrs/journal`](/api/journal)
108
+ `Journal` and is what makes the cross-incarnation sweep real. See
109
+ [Contain and reap child processes](./guides/contain-child-processes.md).
110
+
111
+ ## A contained child outlives the host
112
+
113
+ **Symptom.** After a crash, a `sleep`, a `jj`, or a build tool the host started
114
+ is still running, and the next incarnation does not kill it.
115
+
116
+ **Cause, and what to check in order.**
117
+
118
+ 1. **The ledger was in-memory.** `ProcessLedger.layerMemory` records nothing
119
+ durably, so the next incarnation inherits an empty orphan set. Use
120
+ `ProcessLedger.layer`.
121
+ 2. **The `hostId` changed.** Inheritance is keyed on it. Two incarnations of
122
+ the same host must pass the same string.
123
+ 3. **The reaper declined.** `ProcessReaper.reap` refuses to signal a record
124
+ whose numbers do not clearly name an abandoned process: the owning
125
+ incarnation is alive, the pid is gone, the pid exists but did not start when
126
+ the record says it did, the record predates the machine's boot, or the
127
+ record names this host's own group. Three of those refusals leave the record
128
+ inherited so a later incarnation can try again.
129
+ 4. **The child was started around the host.** A process spawned with
130
+ `node:child_process` directly, rather than through the host's
131
+ `ChildProcessSpawner`, is in no ledger and no reaper can find it. Under
132
+ `BunHost.layer` that includes `jj`, which is why the contained factories
133
+ build `Jj` over the contained spawner.
134
+
135
+ ## A bundler cannot resolve node:fs
136
+
137
+ **Symptom.** Bundling for a browser fails on `node:fs`, `node:path`, or
138
+ `node:child_process` reached from `@smthrs/platform-bun`.
139
+
140
+ **Cause.** The bundle falls back to the `@effect/platform-node` adapters off
141
+ Bun, so it resolves `node:` built-ins by design. That is what makes one bundle
142
+ run on both runtimes, and it is exactly what a browser bundler cannot resolve.
143
+
144
+ **Fix.** Compose [`@smthrs/platform-browser`](/api/platform-browser) in the
145
+ page. It fills the same five slots from browser primitives, so the program
146
+ between them does not change. See
147
+ [Runtime parity with Node](./concepts/runtime-parity.md).
148
+
149
+ ## Jj fails with not_installed
150
+
151
+ **Symptom.** A `Jj` operation fails with a `JjError` whose code is
152
+ `not_installed` or `unsupported_version` and whose method is `version`. The
153
+ host built and every other service works.
154
+
155
+ **Cause.** No usable `jj` executable, or one older than 0.39.0. The `Jj` slot
156
+ probes `jj --version` on its first operation, and the operation that triggered
157
+ the probe did not run. This package vendors no binaries and installs nothing on
158
+ your behalf.
159
+
160
+ **Fix.** Install [Jujutsu](https://jj-vcs.github.io), which provides the `jj`
161
+ command, or set `SMITHERS_JJ_PATH` to the executable you want spawned, then
162
+ restart the program: the slot selects the executable when the layer is built.
163
+ [`@smthrs/jj`](/api/jj) documents the resolution order and the failure codes.
package/package.json CHANGED
@@ -1,6 +1,149 @@
1
1
  {
2
2
  "name": "@smthrs/platform-bun",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "type": "module",
4
+ "version": "1.0.0-rc.13",
5
+ "license": "MIT",
6
+ "smthrs": {
7
+ "group": "engine",
8
+ "privateEffectAdapters": [
9
+ "@effect/platform-bun",
10
+ "@effect/platform-node",
11
+ "@effect/platform-node-shared"
12
+ ]
13
+ },
14
+ "description": "Bun Host bundle for flows: Effect's Bun platform services composed into the closed Host surface",
15
+ "homepage": "https://github.com/smithersai/smithers",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/smithersai/smithers.git",
19
+ "directory": "packages/smithers/flows/platform-bun"
20
+ },
21
+ "bugs": {
22
+ "url": "https://github.com/smithersai/smithers/issues"
23
+ },
24
+ "tags": [
25
+ "typescript",
26
+ "effect",
27
+ "bun",
28
+ "platform"
29
+ ],
30
+ "keywords": [
31
+ "typescript",
32
+ "effect",
33
+ "bun",
34
+ "platform"
35
+ ],
36
+ "engines": {
37
+ "bun": ">=1.4.0",
38
+ "node": ">=26.4.0"
39
+ },
40
+ "sideEffects": [],
41
+ "exports": {
42
+ "./package.json": "./package.json",
43
+ ".": {
44
+ "import": {
45
+ "types": "./dist/esm/index.d.ts",
46
+ "default": "./dist/esm/index.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/cjs/index.d.ts",
50
+ "default": "./dist/cjs/index.js"
51
+ }
52
+ },
53
+ "./internal/*": null,
54
+ "./*/index": null,
55
+ "./BunFileSystem": {
56
+ "import": {
57
+ "types": "./dist/esm/BunFileSystem.d.ts",
58
+ "default": "./dist/esm/BunFileSystem.js"
59
+ },
60
+ "require": {
61
+ "types": "./dist/cjs/BunFileSystem.d.ts",
62
+ "default": "./dist/cjs/BunFileSystem.js"
63
+ }
64
+ },
65
+ "./BunHost": {
66
+ "import": {
67
+ "types": "./dist/esm/BunHost.d.ts",
68
+ "default": "./dist/esm/BunHost.js"
69
+ },
70
+ "require": {
71
+ "types": "./dist/cjs/BunHost.d.ts",
72
+ "default": "./dist/cjs/BunHost.js"
73
+ }
74
+ },
75
+ "./index": {
76
+ "import": {
77
+ "types": "./dist/esm/index.d.ts",
78
+ "default": "./dist/esm/index.js"
79
+ },
80
+ "require": {
81
+ "types": "./dist/cjs/index.d.ts",
82
+ "default": "./dist/cjs/index.js"
83
+ }
84
+ }
85
+ },
86
+ "files": [
87
+ "src/**/*.ts",
88
+ "dist/**/*.js",
89
+ "dist/**/*.js.map",
90
+ "dist/**/*.d.ts",
91
+ "dist/**/*.d.ts.map",
92
+ "dist/**/package.json",
93
+ "LICENSE",
94
+ "README.md",
95
+ "CHANGELOG.md",
96
+ "dist/vendor/**",
97
+ "docs/"
98
+ ],
99
+ "publishConfig": {
100
+ "access": "public",
101
+ "provenance": true,
102
+ "tag": "next"
103
+ },
104
+ "dependencies": {
105
+ "@smthrs/jj": "1.0.0-rc.13",
106
+ "@smthrs/kernel": "1.0.0-rc.13",
107
+ "undici": "8.11.2",
108
+ "redis": "6.2.1",
109
+ "@types/ws": "8.18.2",
110
+ "ws": "8.22.0"
111
+ },
112
+ "peerDependencies": {
113
+ "@smthrs/platform-node": "1.0.0-rc.13",
114
+ "effect": "4.0.5"
115
+ },
116
+ "devDependencies": {
117
+ "@effect/language-service": "0.87.2",
118
+ "@effect/platform-bun": "4.0.5",
119
+ "@effect/platform-node": "4.0.5",
120
+ "@effect/platform-node-shared": "4.0.5",
121
+ "@effect/vitest": "4.0.5",
122
+ "@eslint/js": "9.39.5",
123
+ "@smthrs/platform-node": "1.0.0-rc.13",
124
+ "@types/node": "26.4.1",
125
+ "@vitest/coverage-v8": "5.0.0",
126
+ "dprint": "0.57.1",
127
+ "effect": "4.0.5",
128
+ "esbuild": "0.28.2",
129
+ "eslint": "9.39.5",
130
+ "eslint-import-resolver-typescript": "4.4.5",
131
+ "eslint-plugin-import": "2.32.0",
132
+ "eslint-plugin-jsdoc": "64.3.4",
133
+ "eslint-plugin-unicorn": "65.0.0",
134
+ "madge": "8.0.0",
135
+ "typescript": "5.9.3",
136
+ "typescript-eslint": "8.69.0",
137
+ "vitest": "5.0.0",
138
+ "@smthrs/artifacts": "1.0.0-rc.13"
139
+ },
140
+ "scripts": {
141
+ "lint": "eslint src --max-warnings=0 && dprint check",
142
+ "format": "dprint fmt",
143
+ "build": "node scripts/build.mjs",
144
+ "check": "tsc -b tsconfig.json && tsc -p tsconfig.test.json --noEmit",
145
+ "circular": "node scripts/circular.mjs",
146
+ "test": "vitest",
147
+ "coverage": "vitest --coverage"
148
+ }
6
149
  }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Bun layer for Effect's `FileSystem` service.
3
+ *
4
+ * This is `@smthrs/platform-node`'s `AtomicFileSystem.layer`, the same
5
+ * implementation the Node bundle puts in its filesystem slot. It carries the
6
+ * kernel's atomic host extension, so `@smthrs/kernel`'s `FileSystem.layer`
7
+ * performs every guarded path operation descriptor-relative and no-follow
8
+ * instead of failing closed.
9
+ *
10
+ * The extension uses the packaged `smithers-jj-export --atomic-fs` helper.
11
+ * `layerWith` accepts another absolute executable path. Windows is unsupported.
12
+ *
13
+ * @since 1.0.0-rc.0
14
+ */
15
+
16
+ import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem"
17
+ import type { FileSystem } from "effect/FileSystem"
18
+ import type * as Layer from "effect/Layer"
19
+
20
+ /**
21
+ * Provides Bun's filesystem implementation, carrying the kernel's atomic host
22
+ * extension.
23
+ *
24
+ * @category layers
25
+ * @since 1.0.0-rc.0
26
+ * @slop
27
+ */
28
+ export const layer: Layer.Layer<FileSystem> = AtomicFileSystem.layer
29
+
30
+ /**
31
+ * Provides the same filesystem against an explicitly configured helper and
32
+ * set of byte limits.
33
+ *
34
+ * This is the escape hatch for a host with a different packaged helper path.
35
+ *
36
+ * @category layers
37
+ * @since 1.0.0-rc.0
38
+ */
39
+ export const layerWith: (options: AtomicFileSystem.Options) => Layer.Layer<FileSystem> = AtomicFileSystem.layerWith
40
+
41
+ /**
42
+ * The helper path and byte limits {@link layerWith} accepts.
43
+ *
44
+ * @category models
45
+ * @since 1.0.0-rc.0
46
+ */
47
+ export type Options = AtomicFileSystem.Options