@smthrs/platform-bun 0.0.0-stage → 1.0.0-rc.12
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 +110 -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 +148 -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 +248 -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 +3067 -0
- package/dist/vendor/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/bun/BunAddressResolver.js +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
- package/dist/vendor/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/bun/BunClusterHttp.js +39 -0
- package/dist/vendor/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/bun/BunClusterSocket.js +22 -0
- package/dist/vendor/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/bun/BunCrypto.js +8 -0
- package/dist/vendor/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/bun/BunDatagramSocket.js +11 -0
- package/dist/vendor/bun/BunDns.d.ts +72 -0
- package/dist/vendor/bun/BunDns.js +12 -0
- package/dist/vendor/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/bun/BunFileSystem.js +9 -0
- package/dist/vendor/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/bun/BunHttpClient.js +1 -0
- package/dist/vendor/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/bun/BunHttpPlatform.js +11 -0
- package/dist/vendor/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/bun/BunHttpServer.js +38 -0
- package/dist/vendor/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
- package/dist/vendor/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/bun/BunMultipart.js +12 -0
- package/dist/vendor/bun/BunPath.d.ts +27 -0
- package/dist/vendor/bun/BunPath.js +12 -0
- package/dist/vendor/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/bun/BunRedis.js +11 -0
- package/dist/vendor/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/bun/BunRuntime.js +8 -0
- package/dist/vendor/bun/BunServices.d.ts +37 -0
- package/dist/vendor/bun/BunServices.js +23 -0
- package/dist/vendor/bun/BunSink.d.ts +9 -0
- package/dist/vendor/bun/BunSink.js +12 -0
- package/dist/vendor/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/bun/BunSocket.js +29 -0
- package/dist/vendor/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/bun/BunSocketServer.js +21 -0
- package/dist/vendor/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/bun/BunStdio.js +10 -0
- package/dist/vendor/bun/BunStream.d.ts +20 -0
- package/dist/vendor/bun/BunStream.js +30 -0
- package/dist/vendor/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/bun/BunTerminal.js +10 -0
- package/dist/vendor/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/bun/BunWorker.js +9 -0
- package/dist/vendor/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/bun/BunWorkerRunner.js +7 -0
- package/dist/vendor/bun/LICENSE +21 -0
- package/dist/vendor/bun/index.d.ts +130 -0
- package/dist/vendor/bun/index.js +121 -0
- package/dist/vendor/chunk-2ZAGBWTH.js +40 -0
- package/dist/vendor/chunk-3SL3HKQA.js +118 -0
- package/dist/vendor/chunk-3WUGYBFU.js +0 -0
- package/dist/vendor/chunk-4WIQ2XN7.js +28 -0
- package/dist/vendor/chunk-5ET7NHI7.js +15 -0
- package/dist/vendor/chunk-6FSJ2PMW.js +53 -0
- package/dist/vendor/chunk-6L2NJEOV.js +62 -0
- package/dist/vendor/chunk-72X6VEVD.js +62 -0
- package/dist/vendor/chunk-7NMJM44J.js +26 -0
- package/dist/vendor/chunk-A7AY2JP7.js +71 -0
- package/dist/vendor/chunk-A7UXCEJA.js +81 -0
- package/dist/vendor/chunk-ADP5LRUF.js +274 -0
- package/dist/vendor/chunk-ASGOJ3XA.js +0 -0
- package/dist/vendor/chunk-AWNTTSHL.js +34 -0
- package/dist/vendor/chunk-BUKVIAEM.js +20 -0
- package/dist/vendor/chunk-BY3SDXID.js +501 -0
- package/dist/vendor/chunk-C3PGUWW5.js +414 -0
- package/dist/vendor/chunk-CL4EIDIY.js +7 -0
- package/dist/vendor/chunk-D2ZL4PLZ.js +93 -0
- package/dist/vendor/chunk-D4HEMNGU.js +22 -0
- package/dist/vendor/chunk-F4V5TRY7.js +85 -0
- package/dist/vendor/chunk-F772LLZ5.js +31 -0
- package/dist/vendor/chunk-FFD6R5JZ.js +104 -0
- package/dist/vendor/chunk-G4HOH7GK.js +65 -0
- package/dist/vendor/chunk-GJN7MEBF.js +18 -0
- package/dist/vendor/chunk-HDV6VIRM.js +48 -0
- package/dist/vendor/chunk-IHV7Z4SW.js +34 -0
- package/dist/vendor/chunk-IWSDM4CG.js +16 -0
- package/dist/vendor/chunk-JOQDB2HC.js +26 -0
- package/dist/vendor/chunk-KABHKTVG.js +18 -0
- package/dist/vendor/chunk-KFDBU6RR.js +60 -0
- package/dist/vendor/chunk-KHPN5DWT.js +20 -0
- package/dist/vendor/chunk-LNWGIDIG.js +20 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-MUEED3C3.js +144 -0
- package/dist/vendor/chunk-N6TK35N5.js +18 -0
- package/dist/vendor/chunk-NQO6V4KI.js +580 -0
- package/dist/vendor/chunk-NUJQMLJP.js +325 -0
- package/dist/vendor/chunk-OF3N2FN4.js +61 -0
- package/dist/vendor/chunk-OGZJACUS.js +57 -0
- package/dist/vendor/chunk-PCEVZYXO.js +63 -0
- package/dist/vendor/chunk-PECOFLCU.js +85 -0
- package/dist/vendor/chunk-PU7QVYND.js +18 -0
- package/dist/vendor/chunk-QGPZPULA.js +51 -0
- package/dist/vendor/chunk-QHR2RC5M.js +109 -0
- package/dist/vendor/chunk-R2YON4A6.js +28 -0
- package/dist/vendor/chunk-R327POEZ.js +18 -0
- package/dist/vendor/chunk-REFJNBQR.js +18 -0
- package/dist/vendor/chunk-RHJ6LV32.js +43 -0
- package/dist/vendor/chunk-RKVXYKHJ.js +29 -0
- package/dist/vendor/chunk-RP3EWS4C.js +0 -0
- package/dist/vendor/chunk-RQH5DSBA.js +249 -0
- package/dist/vendor/chunk-RQQ5TSCD.js +374 -0
- package/dist/vendor/chunk-S6QUQLBV.js +229 -0
- package/dist/vendor/chunk-SCXQLSNW.js +34 -0
- package/dist/vendor/chunk-SD4X5NGU.js +515 -0
- package/dist/vendor/chunk-T332WJRS.js +128 -0
- package/dist/vendor/chunk-T5FQGISI.js +18 -0
- package/dist/vendor/chunk-TBPDCAMH.js +70 -0
- package/dist/vendor/chunk-UFWLKG4I.js +16 -0
- package/dist/vendor/chunk-UPIQ52FQ.js +426 -0
- package/dist/vendor/chunk-UUQXJRMK.js +14 -0
- package/dist/vendor/chunk-UUYTTEDH.js +36 -0
- package/dist/vendor/chunk-V2EB7FHY.js +129 -0
- package/dist/vendor/chunk-VIWU4EBF.js +18 -0
- package/dist/vendor/chunk-WPZDL2D7.js +21 -0
- package/dist/vendor/chunk-X4YPHWAE.js +22 -0
- package/dist/vendor/chunk-XACFQJY7.js +93 -0
- package/dist/vendor/chunk-Y7V6ISZS.js +418 -0
- package/dist/vendor/chunk-YDY5P7GL.js +20 -0
- package/dist/vendor/chunk-ZNKZXDUD.js +18 -0
- package/dist/vendor/chunk-ZS3VW5QR.js +63 -0
- package/dist/vendor/chunk-ZUUCLHBP.js +18 -0
- package/dist/vendor/chunk-ZVJCBTJG.js +131 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.d.ts +15 -0
- package/dist/vendor/cjs/bun/BunAddressResolver.js +1 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +76 -0
- package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +70 -0
- package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunCrypto.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.d.ts +227 -0
- package/dist/vendor/cjs/bun/BunDatagramSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunDns.d.ts +72 -0
- package/dist/vendor/cjs/bun/BunDns.js +1 -0
- package/dist/vendor/cjs/bun/BunFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpClient.d.ts +10 -0
- package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +11 -0
- package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServer.d.ts +151 -0
- package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/bun/BunMultipart.d.ts +34 -0
- package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
- package/dist/vendor/cjs/bun/BunPath.d.ts +27 -0
- package/dist/vendor/cjs/bun/BunPath.js +1 -0
- package/dist/vendor/cjs/bun/BunRedis.d.ts +53 -0
- package/dist/vendor/cjs/bun/BunRedis.js +1 -0
- package/dist/vendor/cjs/bun/BunRuntime.d.ts +88 -0
- package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
- package/dist/vendor/cjs/bun/BunServices.d.ts +37 -0
- package/dist/vendor/cjs/bun/BunServices.js +1 -0
- package/dist/vendor/cjs/bun/BunSink.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSink.js +1 -0
- package/dist/vendor/cjs/bun/BunSocket.d.ts +45 -0
- package/dist/vendor/cjs/bun/BunSocket.js +1 -0
- package/dist/vendor/cjs/bun/BunSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
- package/dist/vendor/cjs/bun/BunStdio.d.ts +12 -0
- package/dist/vendor/cjs/bun/BunStdio.js +1 -0
- package/dist/vendor/cjs/bun/BunStream.d.ts +20 -0
- package/dist/vendor/cjs/bun/BunStream.js +1 -0
- package/dist/vendor/cjs/bun/BunTerminal.d.ts +24 -0
- package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
- package/dist/vendor/cjs/bun/BunWorker.d.ts +22 -0
- package/dist/vendor/cjs/bun/BunWorker.js +1 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
- package/dist/vendor/cjs/bun/index.d.ts +130 -0
- package/dist/vendor/cjs/bun/index.js +1 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/cjs/node/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/cjs/node/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeDns.d.ts +51 -0
- package/dist/vendor/cjs/node/NodeDns.js +1 -0
- package/dist/vendor/cjs/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
- package/dist/vendor/cjs/node/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node/NodePath.js +1 -0
- package/dist/vendor/cjs/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/cjs/node/NodeRedis.js +1 -0
- package/dist/vendor/cjs/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node/NodeServices.d.ts +37 -0
- package/dist/vendor/cjs/node/NodeServices.js +1 -0
- package/dist/vendor/cjs/node/NodeSink.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSink.js +1 -0
- package/dist/vendor/cjs/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/cjs/node/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/cjs/node/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node/NodeStream.d.ts +9 -0
- package/dist/vendor/cjs/node/NodeStream.js +1 -0
- package/dist/vendor/cjs/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/cjs/node/NodeWorker.js +1 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
- package/dist/vendor/cjs/node/Undici.d.ts +31 -0
- package/dist/vendor/cjs/node/Undici.js +1 -0
- package/dist/vendor/cjs/node/index.d.ts +140 -0
- package/dist/vendor/cjs/node/index.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeAddressResolver.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/cjs/node-shared/NodeDatagramSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/cjs/node-shared/NodeDns.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
- package/dist/vendor/cjs/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
- package/dist/vendor/cjs/node-shared/index.d.ts +85 -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 +130 -0
- package/dist/vendor/cjs/platform-bun.js +1 -0
- package/dist/vendor/cjs/platform-node-shared.d.ts +85 -0
- package/dist/vendor/cjs/platform-node-shared.js +1 -0
- package/dist/vendor/cjs/platform-node.d.ts +140 -0
- package/dist/vendor/cjs/platform-node.js +1 -0
- package/dist/vendor/node/LICENSE +21 -0
- package/dist/vendor/node/NodeAddressResolver.d.ts +16 -0
- package/dist/vendor/node/NodeAddressResolver.js +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.d.ts +8 -0
- package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
- package/dist/vendor/node/NodeClusterHttp.d.ts +54 -0
- package/dist/vendor/node/NodeClusterHttp.js +43 -0
- package/dist/vendor/node/NodeClusterSocket.d.ts +85 -0
- package/dist/vendor/node/NodeClusterSocket.js +30 -0
- package/dist/vendor/node/NodeCrypto.d.ts +11 -0
- package/dist/vendor/node/NodeCrypto.js +8 -0
- package/dist/vendor/node/NodeDatagramSocket.d.ts +10 -0
- package/dist/vendor/node/NodeDatagramSocket.js +12 -0
- package/dist/vendor/node/NodeDns.d.ts +51 -0
- package/dist/vendor/node/NodeDns.js +12 -0
- package/dist/vendor/node/NodeFileSystem.d.ts +11 -0
- package/dist/vendor/node/NodeFileSystem.js +9 -0
- package/dist/vendor/node/NodeHttpClient.d.ts +198 -0
- package/dist/vendor/node/NodeHttpClient.js +46 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +64 -0
- package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
- package/dist/vendor/node/NodeHttpPlatform.d.ts +38 -0
- package/dist/vendor/node/NodeHttpPlatform.js +16 -0
- package/dist/vendor/node/NodeHttpServer.d.ts +131 -0
- package/dist/vendor/node/NodeHttpServer.js +46 -0
- package/dist/vendor/node/NodeHttpServerRequest.d.ts +32 -0
- package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
- package/dist/vendor/node/NodeMultipart.d.ts +50 -0
- package/dist/vendor/node/NodeMultipart.js +15 -0
- package/dist/vendor/node/NodeMultipartParser.d.ts +105 -0
- package/dist/vendor/node/NodeMultipartParser.js +11 -0
- package/dist/vendor/node/NodePath.d.ts +30 -0
- package/dist/vendor/node/NodePath.js +12 -0
- package/dist/vendor/node/NodeRedis.d.ts +78 -0
- package/dist/vendor/node/NodeRedis.js +11 -0
- package/dist/vendor/node/NodeRuntime.d.ts +88 -0
- package/dist/vendor/node/NodeRuntime.js +8 -0
- package/dist/vendor/node/NodeServices.d.ts +37 -0
- package/dist/vendor/node/NodeServices.js +23 -0
- package/dist/vendor/node/NodeSink.d.ts +9 -0
- package/dist/vendor/node/NodeSink.js +12 -0
- package/dist/vendor/node/NodeSocket.d.ts +45 -0
- package/dist/vendor/node/NodeSocket.js +31 -0
- package/dist/vendor/node/NodeSocketServer.d.ts +9 -0
- package/dist/vendor/node/NodeSocketServer.js +21 -0
- package/dist/vendor/node/NodeStdio.d.ts +12 -0
- package/dist/vendor/node/NodeStdio.js +10 -0
- package/dist/vendor/node/NodeStream.d.ts +9 -0
- package/dist/vendor/node/NodeStream.js +27 -0
- package/dist/vendor/node/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node/NodeTerminal.js +10 -0
- package/dist/vendor/node/NodeWorker.d.ts +24 -0
- package/dist/vendor/node/NodeWorker.js +9 -0
- package/dist/vendor/node/NodeWorkerRunner.d.ts +13 -0
- package/dist/vendor/node/NodeWorkerRunner.js +7 -0
- package/dist/vendor/node/Undici.d.ts +31 -0
- package/dist/vendor/node/Undici.js +9 -0
- package/dist/vendor/node/index.d.ts +140 -0
- package/dist/vendor/node/index.js +130 -0
- package/dist/vendor/node-shared/LICENSE +21 -0
- package/dist/vendor/node-shared/NodeAddressResolver.d.ts +13 -0
- package/dist/vendor/node-shared/NodeAddressResolver.js +7 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +66 -0
- package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
- package/dist/vendor/node-shared/NodeClusterSocket.d.ts +35 -0
- package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
- package/dist/vendor/node-shared/NodeCrypto.d.ts +30 -0
- package/dist/vendor/node-shared/NodeCrypto.js +9 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.d.ts +246 -0
- package/dist/vendor/node-shared/NodeDatagramSocket.js +11 -0
- package/dist/vendor/node-shared/NodeDns.d.ts +221 -0
- package/dist/vendor/node-shared/NodeDns.js +31 -0
- package/dist/vendor/node-shared/NodeFileSystem.d.ts +12 -0
- package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
- package/dist/vendor/node-shared/NodeHttpCompression.d.ts +40 -0
- package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
- package/dist/vendor/node-shared/NodePath.d.ts +30 -0
- package/dist/vendor/node-shared/NodePath.js +11 -0
- package/dist/vendor/node-shared/NodeRuntime.d.ts +51 -0
- package/dist/vendor/node-shared/NodeRuntime.js +7 -0
- package/dist/vendor/node-shared/NodeSink.d.ts +73 -0
- package/dist/vendor/node-shared/NodeSink.js +11 -0
- package/dist/vendor/node-shared/NodeSocket.d.ts +144 -0
- package/dist/vendor/node-shared/NodeSocket.js +23 -0
- package/dist/vendor/node-shared/NodeSocketServer.d.ts +87 -0
- package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
- package/dist/vendor/node-shared/NodeStdio.d.ts +13 -0
- package/dist/vendor/node-shared/NodeStdio.js +9 -0
- package/dist/vendor/node-shared/NodeStream.d.ts +194 -0
- package/dist/vendor/node-shared/NodeStream.js +26 -0
- package/dist/vendor/node-shared/NodeTerminal.d.ts +24 -0
- package/dist/vendor/node-shared/NodeTerminal.js +9 -0
- package/dist/vendor/node-shared/index.d.ts +85 -0
- package/dist/vendor/node-shared/index.js +70 -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 +130 -0
- package/dist/vendor/platform-bun.js +121 -0
- package/dist/vendor/platform-node-shared.d.ts +85 -0
- package/dist/vendor/platform-node-shared.js +70 -0
- package/dist/vendor/platform-node.d.ts +140 -0
- package/dist/vendor/platform-node.js +130 -0
- package/docs/README.md +135 -0
- package/docs/api.md +264 -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 +113 -0
- package/docs/guides/contain-child-processes.md +178 -0
- package/docs/installation.md +131 -0
- package/docs/quickstart.md +163 -0
- package/docs/troubleshooting.md +163 -0
- package/package.json +146 -3
- package/src/BunFileSystem.ts +47 -0
- package/src/BunHost.ts +345 -0
- package/src/index.ts +27 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# @smthrs/platform-bun
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- `BunHost.BunHostError`, the refusal `BunHost.layerAt` and
|
|
8
|
+
`BunHost.layerContainedAt` throw for a root that is not absolute, the empty
|
|
9
|
+
string included. It carries the stable code `invalid_repository_root`
|
|
10
|
+
(`BunHost.BunHostErrorCode`), names the Bun factory that refused, and repeats
|
|
11
|
+
at most 64 characters of the root. Both factories used to hand the root
|
|
12
|
+
straight to the `Jj` adapter, which threw a bare `TypeError` naming
|
|
13
|
+
`NodeJj.layerAt` or `NodeJj.layerSpawnerAt`, carried no code, and echoed the
|
|
14
|
+
whole string.
|
|
15
|
+
- `BunHost.layerHttpClient`, the network slot on its own: the fetch client with
|
|
16
|
+
`redirect: "manual"` that every `BunHost` factory installs.
|
|
17
|
+
|
|
18
|
+
### Removed
|
|
19
|
+
|
|
20
|
+
- The `BunHost.BunHttpClient` re-export. Its `layer` follows redirects, so a
|
|
21
|
+
program that composed it instead of `BunHost.layer` reached origins the
|
|
22
|
+
capability kernel never authorized. Use `BunHost.layerHttpClient`.
|
|
23
|
+
|
|
24
|
+
## [1.0.0-rc.0] - 2026-09-01
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- Initial extraction from the dissolved `@smthrs/host`. `BunHost` and
|
|
29
|
+
`BunFileSystem` moved here unchanged in behaviour; `BunJj` had already moved
|
|
30
|
+
to `@smthrs/jj` and is composed from there.
|
|
31
|
+
- `BunHost.layerAt` and `BunHost.layerContainedAt` bind `Jj` to one absolute
|
|
32
|
+
repository root, so a host does not inherit the process working directory.
|
|
33
|
+
- `BunFileSystem.layer` is `@smthrs/platform-node`'s `AtomicFileSystem.layer`,
|
|
34
|
+
the same implementation behind `NodeHost`'s filesystem slot. Guarded path
|
|
35
|
+
operations under `@smthrs/kernel`'s `FileSystem.layer` are therefore
|
|
36
|
+
descriptor-relative and no-follow on Bun, not failing closed. The host needs a
|
|
37
|
+
CPython 3 interpreter at `/usr/bin/python3`; `BunFileSystem.layerWith` names a
|
|
38
|
+
different one, and `BunHost` re-exports `AtomicFileSystem` for parity with
|
|
39
|
+
`NodeHost`.
|
|
40
|
+
- `engines.bun` declares the supported Bun floor, `>=1.3.0`.
|
|
41
|
+
|
|
42
|
+
### Changed
|
|
43
|
+
|
|
44
|
+
- `BunHost.layerContained` and `BunHost.layerContainedAt` take
|
|
45
|
+
`BunHost.ContainedOptions`, which is `ContainedSpawner.Options` without
|
|
46
|
+
`platform`, plus `ProcessReaper.Options`. The spawner always gets the real
|
|
47
|
+
`process.platform`: a caller-supplied `"win32"` on a POSIX host used to win
|
|
48
|
+
the spread and record `pgid: null` for a child that genuinely leads a process
|
|
49
|
+
group, and `ProcessReaper.reap` retires such a record as `no-group` without
|
|
50
|
+
signalling anything, so the orphan outlived every incarnation. Both halves are
|
|
51
|
+
now read when the factory is called rather than when the layer is built, so
|
|
52
|
+
mutating the object afterwards cannot change what either layer was built with.
|
|
53
|
+
- `BunHost.implementationIds` names `@smthrs/platform-node/AtomicFileSystem` for
|
|
54
|
+
the filesystem slot, which is the module actually behind it, and writes every
|
|
55
|
+
key as a literal so reordering `HostServiceIds` cannot mis-pair a slot with
|
|
56
|
+
another slot's implementation. No planner reads the record yet, so the change
|
|
57
|
+
invalidates no cached step.
|
|
58
|
+
|
|
59
|
+
### Removed
|
|
60
|
+
|
|
61
|
+
- `BunHttpTransport` is gone, and with it the dependency on
|
|
62
|
+
`@smthrs/platform-browser` that existed only to borrow a `fetch`-backed
|
|
63
|
+
transport. An outgoing request is Effect's `HttpClient`, and `BunHost.layer`
|
|
64
|
+
now provides `@effect/platform-bun`'s own `BunHttpClient.layer` with
|
|
65
|
+
`RequestInit { redirect: "manual" }`, so nothing follows a redirect behind
|
|
66
|
+
the capability kernel's back. `BunHost.implementationIds` names
|
|
67
|
+
`@effect/platform-bun/BunHttpClient` for the network slot.
|
|
68
|
+
|
|
69
|
+
- `BunShell` is gone, and with it the hand-rolled runtime detection that chose
|
|
70
|
+
between `Bun.spawn` and `node:child_process`. `BunHost.layer` provides
|
|
71
|
+
`@effect/platform-bun`'s `ChildProcessSpawner`, which is
|
|
72
|
+
`@effect/platform-node-shared`'s implementation re-exported, the same code on
|
|
73
|
+
both runtimes, so there is nothing left to detect.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 William Cory and the Smithers Flows contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @smthrs/platform-bun
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Release candidate scope, host requirements and compatibility review are defined in the [library support policy](https://github.com/smithersai/smithers/blob/main/RELEASE_SUPPORT.md).
|
|
4
|
+
|
|
5
|
+
This package declares `effect` as a `^4.0.4` peer dependency. Install one
|
|
6
|
+
`effect` release in that range so all Smithers packages share one Effect
|
|
7
|
+
runtime.
|
|
8
|
+
|
|
9
|
+
**Documentation:** https://github.com/smithersai/smithers/tree/main/packages/smithers/flows/platform-bun/docs
|
|
10
|
+
|
|
11
|
+
The Bun host bundle for Smithers, which runs long jobs as durable flows: each
|
|
12
|
+
step is recorded, so a restart resumes what did not finish instead of starting
|
|
13
|
+
over. `BunHost.layer` is a single Effect layer that fills the five services a
|
|
14
|
+
program reaches the outside world through: the filesystem, path handling, child
|
|
15
|
+
processes, version control, and HTTP.
|
|
16
|
+
|
|
17
|
+
A program that calls `node:fs`, `Bun.spawn`, or a global `fetch` directly cannot
|
|
18
|
+
be permission checked, denied, audited, or replayed, because nothing sits
|
|
19
|
+
between it and the runtime. Smithers closes the outside world behind five Effect
|
|
20
|
+
service tags instead, and a host bundle is the object that fills them. This
|
|
21
|
+
package is that object for a process running on Bun.
|
|
22
|
+
|
|
23
|
+
## Install
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun add @smthrs/platform-bun@1.0.0-rc.12 effect
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`@smthrs/platform-node` and `effect` are required peers, as `package.json`
|
|
30
|
+
declares them, with `effect` in the range `^4.0.4`. Package managers that
|
|
31
|
+
resolve required peers install both automatically. `@effect/platform-bun`,
|
|
32
|
+
`@effect/platform-node` and `@effect/platform-node-shared` are bundled
|
|
33
|
+
privately, built from `effect@4.0.4`.
|
|
34
|
+
|
|
35
|
+
The filesystem slot spawns the `smithers-jj-export` native helper, which
|
|
36
|
+
`@smthrs/platform-node` ships for macOS, Linux, and Windows. To use another
|
|
37
|
+
helper, set `SMITHERS_WORKSPACE_JJ_EXPORT_BINARY` to its absolute path, or
|
|
38
|
+
build the layer with `BunFileSystem.layerWith({ executable })`. `PATH` is never
|
|
39
|
+
searched. Windows is unsupported.
|
|
40
|
+
|
|
41
|
+
## Example
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { BunHost } from "@smthrs/platform-bun"
|
|
45
|
+
import { Effect } from "effect"
|
|
46
|
+
import * as ChildProcess from "effect/process/ChildProcess"
|
|
47
|
+
import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"
|
|
48
|
+
|
|
49
|
+
const program = Effect.gen(function*() {
|
|
50
|
+
const spawner = yield* ChildProcessSpawner
|
|
51
|
+
return yield* spawner.string(ChildProcess.make("git", ["status", "--short"]))
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
Effect.runPromise(Effect.provide(program, BunHost.layer))
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The program names Bun nowhere. It asks for a service tag, and the layer decides
|
|
58
|
+
what fills it, so swapping `BunHost.layer` for `NodeHost.layer` from
|
|
59
|
+
`@smthrs/platform-node` does not change a character of it.
|
|
60
|
+
|
|
61
|
+
Every host bundle builds without jj. The `Jj` slot needs jj 0.39.0 or newer: its
|
|
62
|
+
first operation runs one version probe and fails with `JjError` `not_installed`
|
|
63
|
+
or `unsupported_version` when jj is missing or older. The version probe and
|
|
64
|
+
repository commands use the selected process runner. Contained bundles record
|
|
65
|
+
and retire the probe in the host process ledger. Probe results are cached per
|
|
66
|
+
resolved absolute executable path and runner, with a separate cache for each
|
|
67
|
+
spawner instance.
|
|
68
|
+
|
|
69
|
+
## Modules
|
|
70
|
+
|
|
71
|
+
| Module | What it provides |
|
|
72
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
73
|
+
| `BunHost` | The closed Host bundle: `layer`, `layerAt`, `layerContained`, `layerContainedAt`, and the `BunHostError` those two root-bound factories throw; `layerHttpClient`, the network slot with redirects stopped; re-exports `AtomicFileSystem`, `BunChildProcessSpawner`, and `BunFileSystem` |
|
|
74
|
+
| `BunFileSystem` | `@smthrs/platform-node`'s atomic `FileSystem`, plus `layerWith` for a host whose helper lives elsewhere |
|
|
75
|
+
|
|
76
|
+
Three variants change one slot each. `BunHost.layerAt(root)` binds version
|
|
77
|
+
control to one absolute repository root instead of the process working
|
|
78
|
+
directory. `BunHost.layerContained(options)` prepares and records a supervisor
|
|
79
|
+
before each target starts, then keeps its cleanup deadline after target exit.
|
|
80
|
+
The private host connection also initiates group cleanup on host loss;
|
|
81
|
+
unverified cleanup retains its `ProcessLedger` record for restart
|
|
82
|
+
reconciliation. `BunHost.layerContainedAt` combines both variants. On POSIX,
|
|
83
|
+
handle `pid` names the supervisor while status describes the target; use
|
|
84
|
+
`handle.kill` to stop it. See the [containment guide](./docs/guides/contain-child-processes.md)
|
|
85
|
+
for detached commands, escaped sessions, and unsupported-platform limits.
|
|
86
|
+
|
|
87
|
+
Two properties are worth knowing before you compose the five slots by hand. The
|
|
88
|
+
filesystem slot carries `@smthrs/platform-node`'s `AtomicFileSystem`, so under
|
|
89
|
+
`@smthrs/kernel`'s guard an authorized path operation runs against file
|
|
90
|
+
descriptors and refuses to follow a link: a symlink swapped in after
|
|
91
|
+
authorization cannot redirect the write. And the HTTP slot is Effect's
|
|
92
|
+
shared egress client without automatic redirects, so a
|
|
93
|
+
`302` comes back to you as a `302` and the second origin is never contacted.
|
|
94
|
+
|
|
95
|
+
## Runtimes
|
|
96
|
+
|
|
97
|
+
Bun >=1.4.0 and Node.js >=26.4.0. The raw bundle's child-process spawner is
|
|
98
|
+
Effect's Node spawner re-exported. Contained POSIX bundles use the prepared
|
|
99
|
+
native adapter from `@smthrs/platform-node/ProcessReaper`. The bundle falls back to the
|
|
100
|
+
`@effect/platform-node` adapters off Bun and so resolves `node:` built-ins,
|
|
101
|
+
which is what stops it bundling for a browser. A page composes
|
|
102
|
+
`@smthrs/platform-browser` instead.
|
|
103
|
+
|
|
104
|
+
The host exports `implementationIds` for its five raw bundle service slots;
|
|
105
|
+
contained factories replace the process runner. Its rooted
|
|
106
|
+
factories reject invalid roots before constructing a layer, using the host's
|
|
107
|
+
own error with code `invalid_repository_root`.
|
|
108
|
+
|
|
109
|
+
BunHost includes BunCrypto in every bundle, so ArtifactStore.put composes
|
|
110
|
+
with BunHost alone. Crypto remains separate from the five capability slots.
|
|
111
|
+
BunHost also re-exports ProcessReaper and HostLiveness from platform-node.
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem";
|
|
16
|
+
import type { FileSystem } from "effect/FileSystem";
|
|
17
|
+
import type * as Layer from "effect/Layer";
|
|
18
|
+
/**
|
|
19
|
+
* Provides Bun's filesystem implementation, carrying the kernel's atomic host
|
|
20
|
+
* extension.
|
|
21
|
+
*
|
|
22
|
+
* @category layers
|
|
23
|
+
* @since 1.0.0-rc.0
|
|
24
|
+
* @slop
|
|
25
|
+
*/
|
|
26
|
+
export declare const layer: Layer.Layer<FileSystem>;
|
|
27
|
+
/**
|
|
28
|
+
* Provides the same filesystem against an explicitly configured helper and
|
|
29
|
+
* set of byte limits.
|
|
30
|
+
*
|
|
31
|
+
* This is the escape hatch for a host with a different packaged helper path.
|
|
32
|
+
*
|
|
33
|
+
* @category layers
|
|
34
|
+
* @since 1.0.0-rc.0
|
|
35
|
+
*/
|
|
36
|
+
export declare const layerWith: (options: AtomicFileSystem.Options) => Layer.Layer<FileSystem>;
|
|
37
|
+
/**
|
|
38
|
+
* The helper path and byte limits {@link layerWith} accepts.
|
|
39
|
+
*
|
|
40
|
+
* @category models
|
|
41
|
+
* @since 1.0.0-rc.0
|
|
42
|
+
*/
|
|
43
|
+
export type Options = AtomicFileSystem.Options;
|
|
44
|
+
//# sourceMappingURL=BunFileSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BunFileSystem.d.ts","sourceRoot":"","sources":["../../src/BunFileSystem.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,KAAK,KAAK,MAAM,cAAc,CAAA;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAA0B,CAAA;AAEpE;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,CAAC,OAAO,KAAK,KAAK,CAAC,KAAK,CAAC,UAAU,CAA8B,CAAA;AAEnH;;;;;GAKG;AACH,MAAM,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var BunFileSystem_exports = {};
|
|
30
|
+
__export(BunFileSystem_exports, {
|
|
31
|
+
layer: () => layer,
|
|
32
|
+
layerWith: () => layerWith
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(BunFileSystem_exports);
|
|
35
|
+
var AtomicFileSystem = __toESM(require("@smthrs/platform-node/AtomicFileSystem"), 1);
|
|
36
|
+
const layer = AtomicFileSystem.layer;
|
|
37
|
+
const layerWith = AtomicFileSystem.layerWith;
|
|
38
|
+
//# sourceMappingURL=BunFileSystem.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/BunFileSystem.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Bun layer for Effect's `FileSystem` service.\n *\n * This is `@smthrs/platform-node`'s `AtomicFileSystem.layer`, the same\n * implementation the Node bundle puts in its filesystem slot. It carries the\n * kernel's atomic host extension, so `@smthrs/kernel`'s `FileSystem.layer`\n * performs every guarded path operation descriptor-relative and no-follow\n * instead of failing closed.\n *\n * The extension uses the packaged `smithers-jj-export --atomic-fs` helper.\n * `layerWith` accepts another absolute executable path. Windows is unsupported.\n *\n * @since 1.0.0-rc.0\n */\n\nimport * as AtomicFileSystem from \"@smthrs/platform-node/AtomicFileSystem\"\nimport type { FileSystem } from \"effect/FileSystem\"\nimport type * as Layer from \"effect/Layer\"\n\n/**\n * Provides Bun's filesystem implementation, carrying the kernel's atomic host\n * extension.\n *\n * @category layers\n * @since 1.0.0-rc.0\n * @slop\n */\nexport const layer: Layer.Layer<FileSystem> = AtomicFileSystem.layer\n\n/**\n * Provides the same filesystem against an explicitly configured helper and\n * set of byte limits.\n *\n * This is the escape hatch for a host with a different packaged helper path.\n *\n * @category layers\n * @since 1.0.0-rc.0\n */\nexport const layerWith: (options: AtomicFileSystem.Options) => Layer.Layer<FileSystem> = AtomicFileSystem.layerWith\n\n/**\n * The helper path and byte limits {@link layerWith} accepts.\n *\n * @category models\n * @since 1.0.0-rc.0\n */\nexport type Options = AtomicFileSystem.Options\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,uBAAkC;AAY3B,MAAM,QAAiC,iBAAiB;AAWxD,MAAM,YAA4E,iBAAiB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aggregate Bun Host bundle.
|
|
3
|
+
*
|
|
4
|
+
* Runtime-specific dependencies stay inside this package; callers get the same
|
|
5
|
+
* closed five-service Host surface every other bundle provides, plus native
|
|
6
|
+
* `ProcessConfinement` for guarded commands.
|
|
7
|
+
*
|
|
8
|
+
* There is no Bun shell module: running a command is Effect's
|
|
9
|
+
* `ChildProcessSpawner`, and `@effect/platform-bun`'s implementation is
|
|
10
|
+
* `@effect/platform-node-shared`'s re-exported: the same code on both
|
|
11
|
+
* runtimes, so no runtime detection is needed here.
|
|
12
|
+
*
|
|
13
|
+
* Outgoing HTTP uses the shared EgressHttpClient on both runtimes. Web
|
|
14
|
+
* requests pin approved addresses; ordinary requests retain the shared pool.
|
|
15
|
+
* Redirects remain visible to the capability kernel, and proxy routing follows
|
|
16
|
+
* the host environment.
|
|
17
|
+
*
|
|
18
|
+
* The filesystem slot is `@smthrs/platform-node`'s `AtomicFileSystem`, byte for
|
|
19
|
+
* byte the layer `NodeHost` uses, so a guarded path operation is
|
|
20
|
+
* descriptor-relative and no-follow on both runtimes.
|
|
21
|
+
*
|
|
22
|
+
* @since 1.0.0-rc.0
|
|
23
|
+
*/
|
|
24
|
+
import * as BunChildProcessSpawner from "../vendor/cjs/bun/BunChildProcessSpawner.js";
|
|
25
|
+
import * as BunCrypto from "../vendor/cjs/bun/BunCrypto.js";
|
|
26
|
+
import type { Jj } from "@smthrs/jj";
|
|
27
|
+
import type { HostServiceIds } from "@smthrs/kernel/HostServices";
|
|
28
|
+
import type * as KernelProcessConfinement from "@smthrs/kernel/ProcessConfinement";
|
|
29
|
+
import type * as ProcessLedger from "@smthrs/kernel/ProcessLedger";
|
|
30
|
+
import * as AtomicFileSystem from "@smthrs/platform-node/AtomicFileSystem";
|
|
31
|
+
import * as HostLiveness from "@smthrs/platform-node/HostLiveness";
|
|
32
|
+
import * as ProcessReaper from "@smthrs/platform-node/ProcessReaper";
|
|
33
|
+
import type * as Crypto from "effect/Crypto";
|
|
34
|
+
import type { FileSystem } from "effect/FileSystem";
|
|
35
|
+
import type { HttpClient } from "effect/http/HttpClient";
|
|
36
|
+
import * as Layer from "effect/Layer";
|
|
37
|
+
import type * as Path from "effect/Path";
|
|
38
|
+
import type { ChildProcessSpawner } from "effect/process/ChildProcessSpawner";
|
|
39
|
+
import * as Schema from "effect/Schema";
|
|
40
|
+
import * as BunFileSystem from "./BunFileSystem.ts";
|
|
41
|
+
/**
|
|
42
|
+
* Bun platform modules for selectively providing individual services.
|
|
43
|
+
*
|
|
44
|
+
* `AtomicFileSystem` is here for the same reason `NodeHost` re-exports it: it
|
|
45
|
+
* owns the only configuration escape hatch the filesystem slot has, and a Bun
|
|
46
|
+
* program with a different packaged helper path needs to reach
|
|
47
|
+
* `AtomicFileSystem.layerWith` without hand-composing the other four tags.
|
|
48
|
+
*
|
|
49
|
+
* `BunJj` is deliberately absent: it belongs to `@smthrs/jj` and is imported
|
|
50
|
+
* from there, never re-exported here. So is `@effect/platform-bun/BunHttpClient`:
|
|
51
|
+
* its `layer` follows redirects to origins the capability kernel never
|
|
52
|
+
* authorized. The network slot on its own is {@link layerHttpClient}.
|
|
53
|
+
*
|
|
54
|
+
* @category re-exports
|
|
55
|
+
* @since 1.0.0-rc.0
|
|
56
|
+
* @slop
|
|
57
|
+
*/
|
|
58
|
+
export { AtomicFileSystem, BunChildProcessSpawner, BunCrypto, BunFileSystem, HostLiveness, ProcessReaper };
|
|
59
|
+
/**
|
|
60
|
+
* The complete closed Host service union provided by Bun.
|
|
61
|
+
*
|
|
62
|
+
* @category models
|
|
63
|
+
* @since 1.0.0-rc.0
|
|
64
|
+
* @slop
|
|
65
|
+
*/
|
|
66
|
+
export type BunHost = FileSystem | Path.Path | ChildProcessSpawner | Jj | HttpClient | KernelProcessConfinement.ProcessConfinement;
|
|
67
|
+
/**
|
|
68
|
+
* The stable codes a `BunHost` factory refuses with.
|
|
69
|
+
*
|
|
70
|
+
* A code is the contract a caller branches on; the message beside it is for a
|
|
71
|
+
* person. `invalid_repository_root` is the root handed to {@link layerAt} or
|
|
72
|
+
* {@link layerContainedAt} not being absolute or containing NUL, the empty
|
|
73
|
+
* string included.
|
|
74
|
+
*
|
|
75
|
+
* @category models
|
|
76
|
+
* @since 1.0.0-rc.0
|
|
77
|
+
*/
|
|
78
|
+
export type BunHostErrorCode = "invalid_repository_root";
|
|
79
|
+
declare const BunHostError_base: Schema.Class<BunHostError, Schema.TaggedStruct<"@smthrs/platform-bun/BunHostError", {
|
|
80
|
+
readonly code: Schema.Literal<"invalid_repository_root">;
|
|
81
|
+
readonly message: Schema.String;
|
|
82
|
+
}>, import("effect/Cause").YieldableError>;
|
|
83
|
+
/**
|
|
84
|
+
* The refusal a `BunHost` factory throws before it builds a layer.
|
|
85
|
+
*
|
|
86
|
+
* It is thrown rather than failed because a factory is called while a program
|
|
87
|
+
* composes its layers, where there is no fiber to fail yet and a wrong root is
|
|
88
|
+
* a composition mistake, not a runtime outcome. It is this package's class,
|
|
89
|
+
* not the `Jj` adapter's, because a Bun caller composes `BunHost` and should
|
|
90
|
+
* learn nothing about the adapter behind the `Jj` slot from an error message.
|
|
91
|
+
*
|
|
92
|
+
* @category errors
|
|
93
|
+
* @since 1.0.0-rc.0
|
|
94
|
+
*/
|
|
95
|
+
export declare class BunHostError extends BunHostError_base {
|
|
96
|
+
readonly name = "BunHostError";
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Stable implementation identities keyed by the closed Host service slots.
|
|
100
|
+
*
|
|
101
|
+
* Each value names the module behind that slot in the raw host bundle.
|
|
102
|
+
* Contained POSIX factories replace the spawner with {@link ProcessReaper.layerSpawner}.
|
|
103
|
+
* These are identity
|
|
104
|
+
* tokens rather than import specifiers: the filesystem entry is
|
|
105
|
+
* `@smthrs/platform-node/AtomicFileSystem` because that is the implementation,
|
|
106
|
+
* even though a consumer reaches it through `@smthrs/platform-bun`.
|
|
107
|
+
*
|
|
108
|
+
* Nothing digests them yet. `@smthrs/plan`'s step key carries a `layers`
|
|
109
|
+
* component these values are meant to feed, but no planner derives it from a
|
|
110
|
+
* host bundle today, so changing one invalidates no cached step.
|
|
111
|
+
*
|
|
112
|
+
* The keys are written as literals rather than `HostServiceIds` positions so
|
|
113
|
+
* that reordering the closed list cannot silently pair a slot with another
|
|
114
|
+
* slot's implementation.
|
|
115
|
+
*
|
|
116
|
+
* @category models
|
|
117
|
+
* @since 1.0.0-rc.0
|
|
118
|
+
* @slop
|
|
119
|
+
*/
|
|
120
|
+
export declare const implementationIds: Readonly<Record<(typeof HostServiceIds)[number], string>>;
|
|
121
|
+
/**
|
|
122
|
+
* What a caller may configure about containment.
|
|
123
|
+
*
|
|
124
|
+
* `ContainedSpawner.Options.platform` is deliberately not part of it. It
|
|
125
|
+
* decides one thing, whether a command that names no `detached` option gets a
|
|
126
|
+
* process group of its own, and this native host detaches by `process.platform`
|
|
127
|
+
* whatever a record claims. A
|
|
128
|
+
* caller-supplied `"win32"` on a POSIX host would therefore record
|
|
129
|
+
* `pgid: null` for a child that really does lead a group, and
|
|
130
|
+
* {@link ProcessReaper.reap} would retire that record as `no-group` and leave
|
|
131
|
+
* the orphan running forever: a durable lie rather than a compile error.
|
|
132
|
+
*
|
|
133
|
+
* @category models
|
|
134
|
+
* @since 1.0.0-rc.0
|
|
135
|
+
*/
|
|
136
|
+
export type ContainedOptions = ProcessReaper.SpawnerOptions & ProcessReaper.Options;
|
|
137
|
+
/**
|
|
138
|
+
* The network slot on its own: the shared egress client, which never follows a
|
|
139
|
+
* redirect. A `3xx` comes back to the caller with its `location` intact and the
|
|
140
|
+
* second origin uncontacted; following a redirect is `@smthrs/kernel`'s guarded
|
|
141
|
+
* `HttpClient.layer`, which rechecks every hop.
|
|
142
|
+
*
|
|
143
|
+
* @category layers
|
|
144
|
+
* @since 1.0.0-rc.0
|
|
145
|
+
*/
|
|
146
|
+
export declare const layerHttpClient: Layer.Layer<HttpClient>;
|
|
147
|
+
/**
|
|
148
|
+
* Provides all five Bun Host services, including the runtime-independent Path
|
|
149
|
+
* service.
|
|
150
|
+
*
|
|
151
|
+
* Builds on a host without jj. The `Jj` slot probes `jj --version` on its
|
|
152
|
+
* first operation and fails that operation with `JjError` carrying
|
|
153
|
+
* `not_installed` or `unsupported_version`; a program that never calls `Jj`
|
|
154
|
+
* runs without jj. `Jj` requires jj 0.39.0 or later.
|
|
155
|
+
*
|
|
156
|
+
* @category layers
|
|
157
|
+
* @since 1.0.0-rc.0
|
|
158
|
+
* @slop
|
|
159
|
+
*/
|
|
160
|
+
export declare const layer: Layer.Layer<BunHost | Crypto.Crypto>;
|
|
161
|
+
/**
|
|
162
|
+
* Provides all five Bun Host services bound to one absolute repository root.
|
|
163
|
+
*
|
|
164
|
+
* Throws {@link BunHostError} with code `invalid_repository_root` when `root`
|
|
165
|
+
* is not absolute or contains NUL; the empty string counts. The check runs
|
|
166
|
+
* when the factory is called, before any layer exists.
|
|
167
|
+
*
|
|
168
|
+
* Builds without jj exactly as {@link layer} does: the `Jj` slot probes
|
|
169
|
+
* `jj --version` on its first operation.
|
|
170
|
+
*
|
|
171
|
+
* @category layers
|
|
172
|
+
* @since 1.0.0-rc.0
|
|
173
|
+
*/
|
|
174
|
+
export declare const layerAt: (root: string) => Layer.Layer<BunHost | Crypto.Crypto>;
|
|
175
|
+
/**
|
|
176
|
+
* Provides the Bun host with process containment turned on.
|
|
177
|
+
*
|
|
178
|
+
* Bun uses the same prepared native process lifecycle as Node on POSIX, while
|
|
179
|
+
* preserving its underlying runtime spawner on Windows. `ContainedSpawner` gives
|
|
180
|
+
* every child an escalation deadline and a ledger entry, and
|
|
181
|
+
* `ProcessReaper` sweeps the entries a crashed incarnation of this host left
|
|
182
|
+
* behind. The reaper module lives in `@smthrs/platform-node` because the calls
|
|
183
|
+
* it makes, `process.kill` and `taskkill`, are Node's, and Bun implements
|
|
184
|
+
* them unchanged.
|
|
185
|
+
*
|
|
186
|
+
* Builds without jj exactly as {@link layer} does; here the first
|
|
187
|
+
* operation's `jj --version` probe runs through the contained spawner, so its
|
|
188
|
+
* record enters and leaves the ledger like any other child.
|
|
189
|
+
*
|
|
190
|
+
* @category layers
|
|
191
|
+
* @since 1.0.0-rc.0
|
|
192
|
+
*/
|
|
193
|
+
export declare const layerContained: (options?: ContainedOptions) => Layer.Layer<BunHost | Crypto.Crypto, never, ProcessLedger.ProcessLedger>;
|
|
194
|
+
/**
|
|
195
|
+
* Provides the contained Bun host bound to one absolute repository root.
|
|
196
|
+
*
|
|
197
|
+
* Refuses a root exactly as {@link layerAt} does: {@link BunHostError} with
|
|
198
|
+
* code `invalid_repository_root`, thrown when the factory is called.
|
|
199
|
+
* Builds without jj exactly as {@link layerContained} does.
|
|
200
|
+
*
|
|
201
|
+
* @category layers
|
|
202
|
+
* @since 1.0.0-rc.0
|
|
203
|
+
*/
|
|
204
|
+
export declare const layerContainedAt: (root: string, options?: ContainedOptions) => Layer.Layer<BunHost | Crypto.Crypto, never, ProcessLedger.ProcessLedger>;
|
|
205
|
+
//# sourceMappingURL=BunHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BunHost.d.ts","sourceRoot":"","sources":["../../src/BunHost.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,sBAAsB,MAAM,6CAA6C,CAAA;AACrF,OAAO,KAAK,SAAS,MAAM,gCAAgC,CAAA;AAE3D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA;AAEpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,KAAK,KAAK,wBAAwB,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAClE,OAAO,KAAK,gBAAgB,MAAM,wCAAwC,CAAA;AAE1E,OAAO,KAAK,YAAY,MAAM,oCAAoC,CAAA;AAElE,OAAO,KAAK,aAAa,MAAM,qCAAqC,CAAA;AACpE,OAAO,KAAK,KAAK,MAAM,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,KAAK,MAAM,cAAc,CAAA;AACrC,OAAO,KAAK,KAAK,IAAI,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,CAAA;AAE1G;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GACf,UAAU,GACV,IAAI,CAAC,IAAI,GACT,mBAAmB,GACnB,EAAE,GACF,UAAU,GACV,wBAAwB,CAAC,kBAAkB,CAAA;AAE/C;;;;;;;;;;GAUG;AACH,MAAM,MAAM,gBAAgB,GAAG,yBAAyB,CAAA;;;;;AAExD;;;;;;;;;;;GAWG;AACH,qBAAa,YAAa,SAAQ,iBAGhC;IACA,SAAkB,IAAI,kBAAiB;CACxC;AA4DD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAMvF,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC,cAAc,GAAG,aAAa,CAAC,OAAO,CAAA;AAWnF;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,UAAU,CAAuC,CAAA;AAE3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAMtD,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,KAAG,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CASzE,CAAA;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,GACzB,UAAU,gBAAgB,KACzB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,aAAa,CAczE,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC3B,MAAM,MAAM,EACZ,UAAU,gBAAgB,KACzB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,aAAa,CAYzE,CAAA"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var BunHost_exports = {};
|
|
30
|
+
__export(BunHost_exports, {
|
|
31
|
+
AtomicFileSystem: () => AtomicFileSystem,
|
|
32
|
+
BunChildProcessSpawner: () => BunChildProcessSpawner,
|
|
33
|
+
BunCrypto: () => BunCrypto,
|
|
34
|
+
BunFileSystem: () => BunFileSystem,
|
|
35
|
+
BunHostError: () => BunHostError,
|
|
36
|
+
HostLiveness: () => HostLiveness,
|
|
37
|
+
ProcessReaper: () => ProcessReaper,
|
|
38
|
+
implementationIds: () => implementationIds,
|
|
39
|
+
layer: () => layer,
|
|
40
|
+
layerAt: () => layerAt,
|
|
41
|
+
layerContained: () => layerContained,
|
|
42
|
+
layerContainedAt: () => layerContainedAt,
|
|
43
|
+
layerHttpClient: () => layerHttpClient
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(BunHost_exports);
|
|
46
|
+
var BunChildProcessSpawner = __toESM(require("../vendor/cjs/bun/BunChildProcessSpawner.js"), 1);
|
|
47
|
+
var BunCrypto = __toESM(require("../vendor/cjs/bun/BunCrypto.js"), 1);
|
|
48
|
+
var BunPath = __toESM(require("../vendor/cjs/bun/BunPath.js"), 1);
|
|
49
|
+
var BunJj = __toESM(require("@smthrs/jj/bun/BunJj"), 1);
|
|
50
|
+
var AtomicFileSystem = __toESM(require("@smthrs/platform-node/AtomicFileSystem"), 1);
|
|
51
|
+
var EgressHttpClient = __toESM(require("@smthrs/platform-node/EgressHttpClient"), 1);
|
|
52
|
+
var HostLiveness = __toESM(require("@smthrs/platform-node/HostLiveness"), 1);
|
|
53
|
+
var ProcessConfinement = __toESM(require("@smthrs/platform-node/ProcessConfinement"), 1);
|
|
54
|
+
var ProcessReaper = __toESM(require("@smthrs/platform-node/ProcessReaper"), 1);
|
|
55
|
+
var Layer = __toESM(require("effect/Layer"), 1);
|
|
56
|
+
var Schema = __toESM(require("effect/Schema"), 1);
|
|
57
|
+
var import_node_path = require("node:path");
|
|
58
|
+
var BunFileSystem = __toESM(require("./BunFileSystem.js"), 1);
|
|
59
|
+
class BunHostError extends Schema.TaggedError()("@smthrs/platform-bun/BunHostError", {
|
|
60
|
+
code: Schema.Literal("invalid_repository_root"),
|
|
61
|
+
message: Schema.String
|
|
62
|
+
}) {
|
|
63
|
+
name = "BunHostError";
|
|
64
|
+
}
|
|
65
|
+
const messageLimit = 255;
|
|
66
|
+
const previewLimit = 64;
|
|
67
|
+
const preview = (root, budget) => {
|
|
68
|
+
const points = Array.from(root);
|
|
69
|
+
const whole = JSON.stringify(root);
|
|
70
|
+
if (points.length <= previewLimit && whole.length <= budget) return whole;
|
|
71
|
+
const suffix = `... (${points.length} characters)`;
|
|
72
|
+
const room = budget - suffix.length - 2;
|
|
73
|
+
let excerpt = "";
|
|
74
|
+
for (const point of points.slice(0, previewLimit)) {
|
|
75
|
+
const encoded = JSON.stringify(point).slice(1, -1);
|
|
76
|
+
if (excerpt.length + encoded.length > room) break;
|
|
77
|
+
excerpt += encoded;
|
|
78
|
+
}
|
|
79
|
+
return `"${excerpt}"${suffix}`;
|
|
80
|
+
};
|
|
81
|
+
const absoluteRoot = (factory, root) => {
|
|
82
|
+
const requirement = !(0, import_node_path.isAbsolute)(root) ? "an absolute repository root" : root.includes("\0") ? "a repository root without NUL" : void 0;
|
|
83
|
+
if (requirement === void 0) return root;
|
|
84
|
+
const prefix = `BunHost.${factory} requires ${requirement}, got `;
|
|
85
|
+
throw new BunHostError({
|
|
86
|
+
code: "invalid_repository_root",
|
|
87
|
+
message: `${prefix}${preview(root, messageLimit - prefix.length)}`
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
const implementationIds = {
|
|
91
|
+
"effect/FileSystem": "@smthrs/platform-node/AtomicFileSystem",
|
|
92
|
+
"effect/Path": "@effect/platform-bun/BunPath",
|
|
93
|
+
"effect/process/ChildProcessSpawner": "@effect/platform-bun/BunChildProcessSpawner",
|
|
94
|
+
"@smthrs/jj/Jj": "@smthrs/jj/bun/BunJj",
|
|
95
|
+
"effect/HttpClient": "@smthrs/platform-node/EgressHttpClient"
|
|
96
|
+
};
|
|
97
|
+
const reaping = (options) => ({
|
|
98
|
+
ownerPid: options?.ownerPid,
|
|
99
|
+
system: options?.system
|
|
100
|
+
});
|
|
101
|
+
const platform = Layer.mergeAll(BunFileSystem.layer, BunPath.layer, BunCrypto.layer);
|
|
102
|
+
const layerHttpClient = EgressHttpClient.layer(process.env);
|
|
103
|
+
const layer = Layer.mergeAll(
|
|
104
|
+
ProcessConfinement.layer(),
|
|
105
|
+
platform,
|
|
106
|
+
Layer.provide(BunChildProcessSpawner.layer, platform),
|
|
107
|
+
BunJj.layer,
|
|
108
|
+
layerHttpClient
|
|
109
|
+
);
|
|
110
|
+
const layerAt = (root) => {
|
|
111
|
+
const repositoryRoot = absoluteRoot("layerAt", root);
|
|
112
|
+
return Layer.mergeAll(
|
|
113
|
+
ProcessConfinement.layer(),
|
|
114
|
+
platform,
|
|
115
|
+
Layer.provide(BunChildProcessSpawner.layer, platform),
|
|
116
|
+
BunJj.layerAt(repositoryRoot),
|
|
117
|
+
layerHttpClient
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
const layerContained = (options) => {
|
|
121
|
+
const spawner = Layer.provide(
|
|
122
|
+
ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),
|
|
123
|
+
Layer.provide(BunChildProcessSpawner.layer, platform)
|
|
124
|
+
);
|
|
125
|
+
return Layer.mergeAll(
|
|
126
|
+
ProcessConfinement.layer(),
|
|
127
|
+
platform,
|
|
128
|
+
layerHttpClient,
|
|
129
|
+
// jj goes through the CONTAINED spawner here, not around it, exactly as in
|
|
130
|
+
// `NodeHost.layerContained`: a jj child that starts its own process leads
|
|
131
|
+
// no recorded group, is in no ledger, and outlives the host that ran it.
|
|
132
|
+
Layer.provideMerge(BunJj.layerSpawner, spawner)
|
|
133
|
+
).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
|
|
134
|
+
};
|
|
135
|
+
const layerContainedAt = (root, options) => {
|
|
136
|
+
const repositoryRoot = absoluteRoot("layerContainedAt", root);
|
|
137
|
+
const spawner = Layer.provide(
|
|
138
|
+
ProcessReaper.layerSpawner({ graceMs: options?.graceMs }),
|
|
139
|
+
Layer.provide(BunChildProcessSpawner.layer, platform)
|
|
140
|
+
);
|
|
141
|
+
return Layer.mergeAll(
|
|
142
|
+
ProcessConfinement.layer(),
|
|
143
|
+
platform,
|
|
144
|
+
layerHttpClient,
|
|
145
|
+
Layer.provideMerge(BunJj.layerSpawnerAt(repositoryRoot), spawner)
|
|
146
|
+
).pipe(Layer.provideMerge(ProcessReaper.layer(reaping(options))));
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=BunHost.js.map
|