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