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