@smthrs/gateway 0.35.0 → 1.0.0-rc.3
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 +198 -0
- package/LICENSE +1 -1
- package/README.md +92 -0
- package/dist/cjs/Diagnosis.d.ts +275 -0
- package/dist/cjs/Diagnosis.d.ts.map +1 -0
- package/dist/cjs/Diagnosis.js +476 -0
- package/dist/cjs/Diagnosis.js.map +7 -0
- package/dist/cjs/EngineTrace.d.ts +76 -0
- package/dist/cjs/EngineTrace.d.ts.map +1 -0
- package/dist/cjs/EngineTrace.js +501 -0
- package/dist/cjs/EngineTrace.js.map +7 -0
- package/dist/cjs/GatewayError.d.ts +54 -0
- package/dist/cjs/GatewayError.d.ts.map +1 -0
- package/dist/cjs/GatewayError.js +51 -0
- package/dist/cjs/GatewayError.js.map +7 -0
- package/dist/cjs/GatewayProjection.d.ts +480 -0
- package/dist/cjs/GatewayProjection.d.ts.map +1 -0
- package/dist/cjs/GatewayProjection.js +462 -0
- package/dist/cjs/GatewayProjection.js.map +7 -0
- package/dist/cjs/GatewayRpcs.d.ts +1886 -0
- package/dist/cjs/GatewayRpcs.d.ts.map +1 -0
- package/dist/cjs/GatewayRpcs.js +121 -0
- package/dist/cjs/GatewayRpcs.js.map +7 -0
- package/dist/cjs/GatewaySchema.d.ts +3274 -0
- package/dist/cjs/GatewaySchema.d.ts.map +1 -0
- package/dist/cjs/GatewaySchema.js +141 -0
- package/dist/cjs/GatewaySchema.js.map +7 -0
- package/dist/cjs/GatewayServer.d.ts +427 -0
- package/dist/cjs/GatewayServer.d.ts.map +1 -0
- package/dist/cjs/GatewayServer.js +428 -0
- package/dist/cjs/GatewayServer.js.map +7 -0
- package/dist/cjs/HostBranchPresence.d.ts +12 -0
- package/dist/cjs/HostBranchPresence.d.ts.map +1 -0
- package/dist/cjs/HostBranchPresence.js +82 -0
- package/dist/cjs/HostBranchPresence.js.map +7 -0
- package/dist/cjs/Projections.d.ts +209 -0
- package/dist/cjs/Projections.d.ts.map +1 -0
- package/dist/cjs/Projections.js +906 -0
- package/dist/cjs/Projections.js.map +7 -0
- package/dist/cjs/RunDevTools.d.ts +181 -0
- package/dist/cjs/RunDevTools.d.ts.map +1 -0
- package/dist/cjs/RunDevTools.js +195 -0
- package/dist/cjs/RunDevTools.js.map +7 -0
- package/dist/cjs/RunHistory.d.ts +185 -0
- package/dist/cjs/RunHistory.d.ts.map +1 -0
- package/dist/cjs/RunHistory.js +68 -0
- package/dist/cjs/RunHistory.js.map +7 -0
- package/dist/cjs/RunTrace.d.ts +753 -0
- package/dist/cjs/RunTrace.d.ts.map +1 -0
- package/dist/cjs/RunTrace.js +1593 -0
- package/dist/cjs/RunTrace.js.map +7 -0
- package/dist/cjs/RuntimeBridge.d.ts +1386 -0
- package/dist/cjs/RuntimeBridge.d.ts.map +1 -0
- package/dist/cjs/RuntimeBridge.js +598 -0
- package/dist/cjs/RuntimeBridge.js.map +7 -0
- package/dist/cjs/bun/BunGateway.d.ts +20 -0
- package/dist/cjs/bun/BunGateway.d.ts.map +1 -0
- package/dist/cjs/bun/BunGateway.js +62 -0
- package/dist/cjs/bun/BunGateway.js.map +7 -0
- package/dist/cjs/index.d.ts +65 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +59 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/internal/NativeGateway.d.ts +176 -0
- package/dist/cjs/internal/NativeGateway.d.ts.map +1 -0
- package/dist/cjs/internal/NativeGateway.js +187 -0
- package/dist/cjs/internal/NativeGateway.js.map +7 -0
- package/dist/cjs/internal/actionRenderings.d.ts +2 -0
- package/dist/cjs/internal/actionRenderings.d.ts.map +1 -0
- package/dist/cjs/internal/actionRenderings.js +224 -0
- package/dist/cjs/internal/actionRenderings.js.map +7 -0
- package/dist/cjs/internal/callEvents.d.ts +97 -0
- package/dist/cjs/internal/callEvents.d.ts.map +1 -0
- package/dist/cjs/internal/callEvents.js +169 -0
- package/dist/cjs/internal/callEvents.js.map +7 -0
- package/dist/cjs/internal/digestIndex.d.ts +31 -0
- package/dist/cjs/internal/digestIndex.d.ts.map +1 -0
- package/dist/cjs/internal/digestIndex.js +105 -0
- package/dist/cjs/internal/digestIndex.js.map +7 -0
- package/dist/cjs/internal/digestMemory.d.ts +19 -0
- package/dist/cjs/internal/digestMemory.d.ts.map +1 -0
- package/dist/cjs/internal/digestMemory.js +33 -0
- package/dist/cjs/internal/digestMemory.js.map +7 -0
- package/dist/cjs/internal/inspectLabels.d.ts +8 -0
- package/dist/cjs/internal/inspectLabels.d.ts.map +1 -0
- package/dist/cjs/internal/inspectLabels.js +29 -0
- package/dist/cjs/internal/inspectLabels.js.map +7 -0
- package/dist/cjs/internal/nativeResolution.d.ts +41 -0
- package/dist/cjs/internal/nativeResolution.d.ts.map +1 -0
- package/dist/cjs/internal/nativeResolution.js +62 -0
- package/dist/cjs/internal/nativeResolution.js.map +7 -0
- package/dist/cjs/internal/nodeEvents.d.ts +47 -0
- package/dist/cjs/internal/nodeEvents.d.ts.map +1 -0
- package/dist/cjs/internal/nodeEvents.js +60 -0
- package/dist/cjs/internal/nodeEvents.js.map +7 -0
- package/dist/cjs/node/NodeGateway.d.ts +16 -0
- package/dist/cjs/node/NodeGateway.d.ts.map +1 -0
- package/dist/cjs/node/NodeGateway.js +48 -0
- package/dist/cjs/node/NodeGateway.js.map +7 -0
- package/dist/cjs/package.json +1 -0
- package/dist/esm/Diagnosis.d.ts +275 -0
- package/dist/esm/Diagnosis.d.ts.map +1 -0
- package/dist/esm/Diagnosis.js +697 -0
- package/dist/esm/Diagnosis.js.map +1 -0
- package/dist/esm/EngineTrace.d.ts +76 -0
- package/dist/esm/EngineTrace.d.ts.map +1 -0
- package/dist/esm/EngineTrace.js +548 -0
- package/dist/esm/EngineTrace.js.map +1 -0
- package/dist/esm/GatewayError.d.ts +54 -0
- package/dist/esm/GatewayError.d.ts.map +1 -0
- package/dist/esm/GatewayError.js +60 -0
- package/dist/esm/GatewayError.js.map +1 -0
- package/dist/esm/GatewayProjection.d.ts +480 -0
- package/dist/esm/GatewayProjection.d.ts.map +1 -0
- package/dist/esm/GatewayProjection.js +792 -0
- package/dist/esm/GatewayProjection.js.map +1 -0
- package/dist/esm/GatewayRpcs.d.ts +1886 -0
- package/dist/esm/GatewayRpcs.d.ts.map +1 -0
- package/dist/esm/GatewayRpcs.js +145 -0
- package/dist/esm/GatewayRpcs.js.map +1 -0
- package/dist/esm/GatewaySchema.d.ts +3274 -0
- package/dist/esm/GatewaySchema.d.ts.map +1 -0
- package/dist/esm/GatewaySchema.js +244 -0
- package/dist/esm/GatewaySchema.js.map +1 -0
- package/dist/esm/GatewayServer.d.ts +427 -0
- package/dist/esm/GatewayServer.d.ts.map +1 -0
- package/dist/esm/GatewayServer.js +725 -0
- package/dist/esm/GatewayServer.js.map +1 -0
- package/dist/esm/HostBranchPresence.d.ts +12 -0
- package/dist/esm/HostBranchPresence.d.ts.map +1 -0
- package/dist/esm/HostBranchPresence.js +54 -0
- package/dist/esm/HostBranchPresence.js.map +1 -0
- package/dist/esm/Projections.d.ts +209 -0
- package/dist/esm/Projections.d.ts.map +1 -0
- package/dist/esm/Projections.js +1254 -0
- package/dist/esm/Projections.js.map +1 -0
- package/dist/esm/RunDevTools.d.ts +181 -0
- package/dist/esm/RunDevTools.d.ts.map +1 -0
- package/dist/esm/RunDevTools.js +281 -0
- package/dist/esm/RunDevTools.js.map +1 -0
- package/dist/esm/RunHistory.d.ts +185 -0
- package/dist/esm/RunHistory.d.ts.map +1 -0
- package/dist/esm/RunHistory.js +109 -0
- package/dist/esm/RunHistory.js.map +1 -0
- package/dist/esm/RunTrace.d.ts +753 -0
- package/dist/esm/RunTrace.d.ts.map +1 -0
- package/dist/esm/RunTrace.js +2105 -0
- package/dist/esm/RunTrace.js.map +1 -0
- package/dist/esm/RuntimeBridge.d.ts +1386 -0
- package/dist/esm/RuntimeBridge.d.ts.map +1 -0
- package/dist/esm/RuntimeBridge.js +659 -0
- package/dist/esm/RuntimeBridge.js.map +1 -0
- package/dist/esm/bun/BunGateway.d.ts +20 -0
- package/dist/esm/bun/BunGateway.d.ts.map +1 -0
- package/dist/esm/bun/BunGateway.js +32 -0
- package/dist/esm/bun/BunGateway.js.map +1 -0
- package/dist/esm/index.d.ts +65 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +65 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/NativeGateway.d.ts +176 -0
- package/dist/esm/internal/NativeGateway.d.ts.map +1 -0
- package/dist/esm/internal/NativeGateway.js +268 -0
- package/dist/esm/internal/NativeGateway.js.map +1 -0
- package/dist/esm/internal/actionRenderings.d.ts +2 -0
- package/dist/esm/internal/actionRenderings.d.ts.map +1 -0
- package/dist/esm/internal/actionRenderings.js +202 -0
- package/dist/esm/internal/actionRenderings.js.map +1 -0
- package/dist/esm/internal/callEvents.d.ts +97 -0
- package/dist/esm/internal/callEvents.d.ts.map +1 -0
- package/dist/esm/internal/callEvents.js +206 -0
- package/dist/esm/internal/callEvents.js.map +1 -0
- package/dist/esm/internal/digestIndex.d.ts +31 -0
- package/dist/esm/internal/digestIndex.d.ts.map +1 -0
- package/dist/esm/internal/digestIndex.js +87 -0
- package/dist/esm/internal/digestIndex.js.map +1 -0
- package/dist/esm/internal/digestMemory.d.ts +19 -0
- package/dist/esm/internal/digestMemory.d.ts.map +1 -0
- package/dist/esm/internal/digestMemory.js +23 -0
- package/dist/esm/internal/digestMemory.js.map +1 -0
- package/dist/esm/internal/inspectLabels.d.ts +8 -0
- package/dist/esm/internal/inspectLabels.d.ts.map +1 -0
- package/dist/esm/internal/inspectLabels.js +12 -0
- package/dist/esm/internal/inspectLabels.js.map +1 -0
- package/dist/esm/internal/nativeResolution.d.ts +41 -0
- package/dist/esm/internal/nativeResolution.d.ts.map +1 -0
- package/dist/esm/internal/nativeResolution.js +78 -0
- package/dist/esm/internal/nativeResolution.js.map +1 -0
- package/dist/esm/internal/nodeEvents.d.ts +47 -0
- package/dist/esm/internal/nodeEvents.d.ts.map +1 -0
- package/dist/esm/internal/nodeEvents.js +60 -0
- package/dist/esm/internal/nodeEvents.js.map +1 -0
- package/dist/esm/node/NodeGateway.d.ts +16 -0
- package/dist/esm/node/NodeGateway.d.ts.map +1 -0
- package/dist/esm/node/NodeGateway.js +13 -0
- package/dist/esm/node/NodeGateway.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-2GCOZTTW.js +48 -0
- package/dist/vendor/chunk-37CUR3PO.js +81 -0
- package/dist/vendor/chunk-3ARKKENZ.js +45 -0
- package/dist/vendor/chunk-3NV2UDBI.js +7 -0
- package/dist/vendor/chunk-3OSW7CT7.js +143 -0
- package/dist/vendor/chunk-62R63L74.js +62 -0
- package/dist/vendor/chunk-6AQLBC2I.js +118 -0
- package/dist/vendor/chunk-6C5H7S6B.js +18 -0
- package/dist/vendor/chunk-6DY5RBZD.js +85 -0
- package/dist/vendor/chunk-6UPBD47P.js +53 -0
- package/dist/vendor/chunk-AVVVN75Z.js +96 -0
- package/dist/vendor/chunk-B4DHEMBB.js +14 -0
- package/dist/vendor/chunk-BCK3NJOX.js +15 -0
- package/dist/vendor/chunk-BFBIHJ6X.js +0 -0
- package/dist/vendor/chunk-CES4OUM4.js +63 -0
- package/dist/vendor/chunk-D64L6YND.js +59 -0
- package/dist/vendor/chunk-DS2R6WOM.js +18 -0
- package/dist/vendor/chunk-DX4Z23DM.js +65 -0
- package/dist/vendor/chunk-DZ2VOUDP.js +564 -0
- package/dist/vendor/chunk-FOXN6JPJ.js +61 -0
- package/dist/vendor/chunk-FPQF7CR5.js +55 -0
- package/dist/vendor/chunk-FUTCTCEG.js +20 -0
- package/dist/vendor/chunk-GUPAV2YZ.js +18 -0
- package/dist/vendor/chunk-H2Z2Y4QH.js +70 -0
- package/dist/vendor/chunk-HAEDVSSM.js +129 -0
- package/dist/vendor/chunk-HY7BBL3K.js +93 -0
- package/dist/vendor/chunk-IFTTT6D5.js +31 -0
- package/dist/vendor/chunk-KQDSNB7M.js +26 -0
- package/dist/vendor/chunk-LIHLXXGQ.js +26 -0
- package/dist/vendor/chunk-LKCGQEE5.js +28 -0
- package/dist/vendor/chunk-MH2J3BYB.js +0 -0
- package/dist/vendor/chunk-ML2NAFH2.js +131 -0
- package/dist/vendor/chunk-MLFIZ5O2.js +0 -0
- package/dist/vendor/chunk-MLKGABMK.js +9 -0
- package/dist/vendor/chunk-MSCLEMYX.js +71 -0
- package/dist/vendor/chunk-OBWXQKVP.js +57 -0
- package/dist/vendor/chunk-QR557K66.js +20 -0
- package/dist/vendor/chunk-R4QUY7DH.js +18 -0
- package/dist/vendor/chunk-RGECXXJS.js +18 -0
- package/dist/vendor/chunk-TFY7W6D4.js +36 -0
- package/dist/vendor/chunk-TGPIVY4A.js +104 -0
- package/dist/vendor/chunk-TGXCX6W3.js +398 -0
- package/dist/vendor/chunk-TOHSFXMV.js +437 -0
- package/dist/vendor/chunk-UHIDPUFF.js +34 -0
- package/dist/vendor/chunk-ULT6CWUI.js +109 -0
- package/dist/vendor/chunk-UXBGYQR3.js +18 -0
- package/dist/vendor/chunk-V6LUGQ7O.js +21 -0
- package/dist/vendor/chunk-W4OASVX6.js +92 -0
- package/dist/vendor/chunk-WAII54GA.js +18 -0
- package/dist/vendor/chunk-WECQDT36.js +426 -0
- package/dist/vendor/chunk-WHKMOC7Z.js +28 -0
- package/dist/vendor/chunk-WVFOZ2UL.js +40 -0
- package/dist/vendor/chunk-X73E2UPI.js +18 -0
- package/dist/vendor/chunk-XCYARUII.js +63 -0
- package/dist/vendor/chunk-XFEVTDVD.js +34 -0
- package/dist/vendor/chunk-XFZZYSJ4.js +22 -0
- package/dist/vendor/chunk-XJWJXLXJ.js +18 -0
- package/dist/vendor/chunk-XY3Q62EO.js +18 -0
- package/dist/vendor/chunk-YDASSC75.js +394 -0
- package/dist/vendor/chunk-Z6C7SO5Z.js +507 -0
- package/dist/vendor/chunk-Z7QNPJEB.js +229 -0
- package/dist/vendor/chunk-Z7QPP4YH.js +249 -0
- package/dist/vendor/chunk-ZCHYLHJH.js +86 -0
- package/dist/vendor/chunk-ZIQVYVMA.js +22 -0
- package/dist/vendor/chunk-ZPIG2CUA.js +34 -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 +158 -0
- package/docs/api.md +601 -0
- package/docs/concepts/projections.md +250 -0
- package/docs/concepts/subscriptions.md +204 -0
- package/docs/concepts/trust-boundary.md +256 -0
- package/docs/guides/diagnose-a-run.md +115 -0
- package/docs/guides/follow-a-run.md +150 -0
- package/docs/guides/host-the-gateway.md +153 -0
- package/docs/guides/read-a-projection.md +138 -0
- package/docs/guides/serve-beyond-loopback.md +166 -0
- package/docs/guides/submit-an-approval.md +187 -0
- package/docs/guides/testing.md +148 -0
- package/docs/installation.md +89 -0
- package/docs/quickstart.md +200 -0
- package/docs/troubleshooting.md +355 -0
- package/package.json +264 -32
- package/src/Diagnosis.ts +892 -0
- package/src/EngineTrace.ts +605 -0
- package/src/GatewayError.ts +71 -0
- package/src/GatewayProjection.ts +948 -0
- package/src/GatewayRpcs.ts +179 -0
- package/src/GatewaySchema.ts +516 -0
- package/src/GatewayServer.ts +932 -0
- package/src/HostBranchPresence.ts +72 -0
- package/src/Projections.ts +1735 -0
- package/src/RunDevTools.ts +394 -0
- package/src/RunHistory.ts +174 -0
- package/src/RunTrace.ts +2793 -0
- package/src/RuntimeBridge.ts +835 -0
- package/src/bun/BunGateway.ts +52 -0
- package/src/index.ts +77 -0
- package/src/internal/NativeGateway.ts +360 -0
- package/src/internal/actionRenderings.ts +201 -0
- package/src/internal/callEvents.ts +257 -0
- package/src/internal/digestIndex.ts +134 -0
- package/src/internal/digestMemory.ts +27 -0
- package/src/internal/inspectLabels.ts +13 -0
- package/src/internal/nativeResolution.ts +103 -0
- package/src/internal/nodeEvents.ts +100 -0
- package/src/node/NodeGateway.ts +30 -0
- package/openapi.yaml +0 -29945
- package/src/README.md +0 -39
- package/src/api/README.md +0 -23
- package/src/api/apiCollectionNames.js +0 -10
- package/src/api/index.d.ts +0 -126
- package/src/api/index.js +0 -14
- package/src/api/normalizeApiRow.js +0 -36
- package/src/api/serializeAccountRow.js +0 -10
- package/src/api/serializeApprovalRow.js +0 -53
- package/src/api/serializeComparisonScoreRow.js +0 -18
- package/src/api/serializeCronRow.js +0 -30
- package/src/api/serializeDocRow.js +0 -20
- package/src/api/serializeMemoryFactRow.js +0 -21
- package/src/api/serializePromptRow.js +0 -10
- package/src/api/serializeRunEventRow.js +0 -28
- package/src/api/serializeRunRow.js +0 -93
- package/src/api/serializeScoreDetailRow.js +0 -25
- package/src/api/serializeScoreRow.js +0 -26
- package/src/api/serializeTicketRow.js +0 -20
- package/src/api/serializeWorkflowRow.js +0 -10
- package/src/auth/scopes.d.ts +0 -19
- package/src/auth/scopes.js +0 -164
- package/src/index.d.ts +0 -316
- package/src/index.js +0 -108
- package/src/rpc/gatewayRpcTypes.ts +0 -186
- package/src/rpc/index.d.ts +0 -223
- package/src/rpc/index.js +0 -2527
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RuntimeBridge.d.ts","sourceRoot":"","sources":["../../src/RuntimeBridge.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,598 @@
|
|
|
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 RuntimeBridge_exports = {};
|
|
30
|
+
__export(RuntimeBridge_exports, {
|
|
31
|
+
BridgeError: () => BridgeError,
|
|
32
|
+
Command: () => Command,
|
|
33
|
+
CommandReceipt: () => CommandReceipt,
|
|
34
|
+
CommandResponse: () => CommandResponse,
|
|
35
|
+
DecisionCommand: () => DecisionCommand,
|
|
36
|
+
ErrorResponse: () => ErrorResponse,
|
|
37
|
+
Identity: () => Identity,
|
|
38
|
+
LaunchCommand: () => LaunchCommand,
|
|
39
|
+
LifecycleCommand: () => LifecycleCommand,
|
|
40
|
+
ObserveRequest: () => ObserveRequest,
|
|
41
|
+
ObserveResponse: () => ObserveResponse,
|
|
42
|
+
SignalCommand: () => SignalCommand,
|
|
43
|
+
SteerCommand: () => SteerCommand,
|
|
44
|
+
execute: () => execute,
|
|
45
|
+
layer: () => layer,
|
|
46
|
+
monitor: () => monitor,
|
|
47
|
+
observe: () => observe,
|
|
48
|
+
protocol: () => protocol
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(RuntimeBridge_exports);
|
|
51
|
+
var import_Control = require("@smthrs/control/Control");
|
|
52
|
+
var ControlError = __toESM(require("@smthrs/control/ControlError"), 1);
|
|
53
|
+
var import_ControlExecutor = require("@smthrs/control/ControlExecutor");
|
|
54
|
+
var import_ControlSchema = require("@smthrs/control/ControlSchema");
|
|
55
|
+
var Fault = __toESM(require("@smthrs/flow/Fault"), 1);
|
|
56
|
+
var import_effect = require("effect");
|
|
57
|
+
var import_http = require("effect/unstable/http");
|
|
58
|
+
var import_GatewayProjection = require("./GatewayProjection.js");
|
|
59
|
+
var Projections = __toESM(require("./Projections.js"), 1);
|
|
60
|
+
var import_RunTrace = require("./RunTrace.js");
|
|
61
|
+
const protocol = "smithers.flow-runtime/v1";
|
|
62
|
+
const Sha256 = import_effect.Schema.String.check(import_effect.Schema.isPattern(/^[0-9a-f]{64}$/));
|
|
63
|
+
const SourceRevision = import_effect.Schema.String.check(import_effect.Schema.isPattern(/^[0-9a-f]{40}$/));
|
|
64
|
+
const PositiveSafeInteger = import_effect.Schema.Int.check(
|
|
65
|
+
import_effect.Schema.isGreaterThan(0),
|
|
66
|
+
import_effect.Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)
|
|
67
|
+
);
|
|
68
|
+
const RequestId = import_effect.Schema.NonEmptyString.check(import_effect.Schema.isMaxLength(1024));
|
|
69
|
+
const observationCursorPattern = /^(?:(0|[1-9][0-9]*)|v1:(0|[1-9][0-9]*):(0|[1-9][0-9]*))?(?![\s\S])/;
|
|
70
|
+
const Identity = import_effect.Schema.Struct({
|
|
71
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
72
|
+
runtimeArtifactDigest: Sha256,
|
|
73
|
+
sourceRevision: SourceRevision,
|
|
74
|
+
ownerGeneration: PositiveSafeInteger
|
|
75
|
+
});
|
|
76
|
+
const common = {
|
|
77
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
78
|
+
applicationRequestId: RequestId,
|
|
79
|
+
ownerGeneration: PositiveSafeInteger
|
|
80
|
+
};
|
|
81
|
+
const LaunchPin = import_effect.Schema.Struct({
|
|
82
|
+
flow: import_effect.Schema.NonEmptyString,
|
|
83
|
+
sourceCommit: SourceRevision,
|
|
84
|
+
executionDigest: Sha256
|
|
85
|
+
});
|
|
86
|
+
const LaunchCommand = import_effect.Schema.Struct({
|
|
87
|
+
...common,
|
|
88
|
+
operation: import_effect.Schema.Literal("launch"),
|
|
89
|
+
attempt: PositiveSafeInteger,
|
|
90
|
+
runId: import_effect.Schema.optional(import_effect.Schema.NonEmptyString),
|
|
91
|
+
runtimeArtifactDigest: Sha256,
|
|
92
|
+
sourceRevision: SourceRevision,
|
|
93
|
+
flowId: import_effect.Schema.NonEmptyString,
|
|
94
|
+
payload: import_effect.Schema.Json,
|
|
95
|
+
pin: import_effect.Schema.optional(LaunchPin)
|
|
96
|
+
});
|
|
97
|
+
const DecisionCommand = import_effect.Schema.Struct({
|
|
98
|
+
...common,
|
|
99
|
+
operation: import_effect.Schema.Literals(["approve", "deny"]),
|
|
100
|
+
approval: import_ControlSchema.ApprovalPayload
|
|
101
|
+
});
|
|
102
|
+
const SignalCommand = import_effect.Schema.Struct({
|
|
103
|
+
...common,
|
|
104
|
+
operation: import_effect.Schema.Literal("signal"),
|
|
105
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
106
|
+
signal: import_ControlSchema.SignalPayload
|
|
107
|
+
});
|
|
108
|
+
const Steer = import_effect.Schema.Union([
|
|
109
|
+
import_effect.Schema.Struct({ kind: import_effect.Schema.Literal("Message"), body: import_effect.Schema.String }),
|
|
110
|
+
import_effect.Schema.Struct({ kind: import_effect.Schema.Literal("Seat"), seat: import_effect.Schema.NonEmptyString }),
|
|
111
|
+
import_effect.Schema.Struct({
|
|
112
|
+
kind: import_effect.Schema.Literal("Thinking"),
|
|
113
|
+
thinking: import_effect.Schema.Literals(["none", "minimal", "low", "medium", "high", "xhigh"])
|
|
114
|
+
}),
|
|
115
|
+
import_effect.Schema.Struct({ kind: import_effect.Schema.Literal("Tools"), toolNames: import_effect.Schema.NonEmptyArray(import_effect.Schema.NonEmptyString) })
|
|
116
|
+
]);
|
|
117
|
+
const SteerCommand = import_effect.Schema.Struct({
|
|
118
|
+
version: import_effect.Schema.optional(import_effect.Schema.Number),
|
|
119
|
+
...common,
|
|
120
|
+
operation: import_effect.Schema.Literal("steer"),
|
|
121
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
122
|
+
messageId: import_effect.Schema.NonEmptyString,
|
|
123
|
+
createdAt: import_effect.Schema.Number,
|
|
124
|
+
attribution: import_ControlSchema.MessageSteer.fields.attribution,
|
|
125
|
+
steer: Steer
|
|
126
|
+
});
|
|
127
|
+
const LifecycleCommand = import_effect.Schema.Struct({
|
|
128
|
+
...common,
|
|
129
|
+
/** Completion is a host-only lifecycle operation. @since 1.0.0 */
|
|
130
|
+
operation: import_effect.Schema.Literals(["cancel", "resume", "complete"]),
|
|
131
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
132
|
+
reason: import_effect.Schema.optional(import_effect.Schema.String)
|
|
133
|
+
});
|
|
134
|
+
const Command = import_effect.Schema.Union([
|
|
135
|
+
LaunchCommand,
|
|
136
|
+
DecisionCommand,
|
|
137
|
+
SignalCommand,
|
|
138
|
+
SteerCommand,
|
|
139
|
+
LifecycleCommand
|
|
140
|
+
]);
|
|
141
|
+
const ObserveRequest = import_effect.Schema.Struct({
|
|
142
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
143
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
144
|
+
afterCursor: import_effect.Schema.optional(import_effect.Schema.String.check(import_effect.Schema.isPattern(observationCursorPattern))),
|
|
145
|
+
limit: import_effect.Schema.optional(PositiveSafeInteger)
|
|
146
|
+
});
|
|
147
|
+
const CommandReceipt = import_effect.Schema.Struct({
|
|
148
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
149
|
+
operationId: import_effect.Schema.NonEmptyString,
|
|
150
|
+
status: import_effect.Schema.Literals(["running", "completed"]),
|
|
151
|
+
argv: import_effect.Schema.NonEmptyArray(import_effect.Schema.String),
|
|
152
|
+
exitCode: import_effect.Schema.optionalKey(import_effect.Schema.Int),
|
|
153
|
+
stderr: import_effect.Schema.optionalKey(import_effect.Schema.String),
|
|
154
|
+
fault: import_effect.Schema.optionalKey(import_effect.Schema.Literals(["factory", "infra"]))
|
|
155
|
+
});
|
|
156
|
+
class BridgeError extends import_effect.Schema.TaggedError()("@smthrs/gateway/RuntimeBridgeError", {
|
|
157
|
+
code: import_effect.Schema.Literals([
|
|
158
|
+
"invalid_request",
|
|
159
|
+
"artifact_mismatch",
|
|
160
|
+
"source_mismatch",
|
|
161
|
+
"stale_owner",
|
|
162
|
+
"run_not_found",
|
|
163
|
+
"resource_limit",
|
|
164
|
+
"unavailable",
|
|
165
|
+
"internal"
|
|
166
|
+
]),
|
|
167
|
+
message: import_effect.Schema.String,
|
|
168
|
+
retryable: import_effect.Schema.Boolean
|
|
169
|
+
}) {
|
|
170
|
+
}
|
|
171
|
+
const decodeCommand = import_effect.Schema.decodeUnknownEffect(Command);
|
|
172
|
+
const decodeObserve = import_effect.Schema.decodeUnknownEffect(ObserveRequest);
|
|
173
|
+
const terminal = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
174
|
+
const retryableCodes = /* @__PURE__ */ new Set(["transport_error", "unavailable", "persistence_failed", "launch_failed"]);
|
|
175
|
+
const notFoundCodes = /* @__PURE__ */ new Set(["run_not_found", "flow_not_found", "plan_not_found"]);
|
|
176
|
+
const conflictCodes = /* @__PURE__ */ new Set(["stale_owner", "artifact_mismatch", "source_mismatch", "conflict"]);
|
|
177
|
+
const defaultEventLimit = 250;
|
|
178
|
+
const maximumEventLimit = 1e3;
|
|
179
|
+
const idempotencyKey = (input, suffix) => `bridge:v1:${input.applicationRequestId}:${suffix}`;
|
|
180
|
+
const validateOwner = (config, input) => input.ownerGeneration === config.ownerGeneration ? import_effect.Effect.void : import_effect.Effect.fail(
|
|
181
|
+
new BridgeError({ code: "stale_owner", message: "Runtime owner generation is stale", retryable: true })
|
|
182
|
+
);
|
|
183
|
+
const execute = (config, control, principal, input) => import_effect.Effect.gen(function* () {
|
|
184
|
+
yield* validateOwner(config, input);
|
|
185
|
+
switch (input.operation) {
|
|
186
|
+
case "launch": {
|
|
187
|
+
if (input.runtimeArtifactDigest !== config.runtimeArtifactDigest) {
|
|
188
|
+
return yield* import_effect.Effect.fail(
|
|
189
|
+
new BridgeError({
|
|
190
|
+
code: "artifact_mismatch",
|
|
191
|
+
message: "Runtime artifact digest does not match the owning host",
|
|
192
|
+
retryable: false
|
|
193
|
+
})
|
|
194
|
+
);
|
|
195
|
+
}
|
|
196
|
+
if (input.sourceRevision !== config.sourceRevision) {
|
|
197
|
+
return yield* import_effect.Effect.fail(
|
|
198
|
+
new BridgeError({
|
|
199
|
+
code: "source_mismatch",
|
|
200
|
+
message: "Flow source revision does not match the owning host",
|
|
201
|
+
retryable: false
|
|
202
|
+
})
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
if (input.pin !== void 0 && input.pin.sourceCommit !== config.sourceRevision) {
|
|
206
|
+
return yield* import_effect.Effect.fail(
|
|
207
|
+
new BridgeError({
|
|
208
|
+
code: "source_mismatch",
|
|
209
|
+
message: "Flow source revision does not match the pinned launch",
|
|
210
|
+
retryable: false
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
const plan = yield* control.plan({
|
|
215
|
+
flowId: input.flowId,
|
|
216
|
+
input: input.payload,
|
|
217
|
+
idempotencyKey: idempotencyKey(input, "plan")
|
|
218
|
+
});
|
|
219
|
+
const plannedSource = plan.graph?.sourceRevision ?? config.verifiedCatalogSourceRevision;
|
|
220
|
+
if (plannedSource !== input.sourceRevision) {
|
|
221
|
+
return yield* import_effect.Effect.fail(
|
|
222
|
+
new BridgeError({
|
|
223
|
+
code: "source_mismatch",
|
|
224
|
+
message: "Flow source revision does not match the immutable request",
|
|
225
|
+
retryable: false
|
|
226
|
+
})
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (input.pin !== void 0 && (plan.executionDigest === void 0 || input.pin.flow === input.flowId && plan.executionDigest !== input.pin.executionDigest)) {
|
|
230
|
+
return yield* import_effect.Effect.fail(
|
|
231
|
+
new BridgeError({
|
|
232
|
+
code: "source_mismatch",
|
|
233
|
+
message: "Flow execution digest does not match the pinned launch",
|
|
234
|
+
retryable: false
|
|
235
|
+
})
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
const receipt = yield* control.run({
|
|
239
|
+
_tag: "Plan",
|
|
240
|
+
planId: plan.planId,
|
|
241
|
+
digest: plan.digest,
|
|
242
|
+
envelope: plan.envelope,
|
|
243
|
+
idempotencyKey: idempotencyKey(input, `run:${input.runId ?? input.attempt}`),
|
|
244
|
+
principal,
|
|
245
|
+
...input.runId === void 0 ? {} : { reservedRunId: input.runId }
|
|
246
|
+
});
|
|
247
|
+
return {
|
|
248
|
+
operation: input.operation,
|
|
249
|
+
applicationRequestId: input.applicationRequestId,
|
|
250
|
+
ownerGeneration: input.ownerGeneration,
|
|
251
|
+
runtimeArtifactDigest: config.runtimeArtifactDigest,
|
|
252
|
+
sourceRevision: input.sourceRevision,
|
|
253
|
+
planId: plan.planId,
|
|
254
|
+
planDigest: plan.digest,
|
|
255
|
+
...plan.executionDigest === void 0 ? {} : { executionDigest: plan.executionDigest },
|
|
256
|
+
envelope: plan.envelope,
|
|
257
|
+
approval: plan.approval,
|
|
258
|
+
receipt
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
case "approve":
|
|
262
|
+
case "deny": {
|
|
263
|
+
const request = {
|
|
264
|
+
...input.approval,
|
|
265
|
+
idempotencyKey: idempotencyKey(input, input.operation),
|
|
266
|
+
principal
|
|
267
|
+
};
|
|
268
|
+
const receipt = yield* input.operation === "approve" ? control.approve(request) : control.deny(request);
|
|
269
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
270
|
+
}
|
|
271
|
+
case "signal": {
|
|
272
|
+
const receipt = yield* control.signal({
|
|
273
|
+
runId: input.runId,
|
|
274
|
+
signal: input.signal,
|
|
275
|
+
idempotencyKey: idempotencyKey(input, "signal"),
|
|
276
|
+
principal
|
|
277
|
+
});
|
|
278
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
279
|
+
}
|
|
280
|
+
case "steer": {
|
|
281
|
+
const receipt = yield* control.steer({
|
|
282
|
+
runId: input.runId,
|
|
283
|
+
idempotencyKey: idempotencyKey(input, "steer"),
|
|
284
|
+
...input.version === void 0 ? {} : { version: input.version },
|
|
285
|
+
message: {
|
|
286
|
+
...input.steer,
|
|
287
|
+
runId: input.runId,
|
|
288
|
+
messageId: input.messageId,
|
|
289
|
+
createdAt: input.createdAt,
|
|
290
|
+
...input.attribution === void 0 ? {} : { attribution: input.attribution },
|
|
291
|
+
principal
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
295
|
+
}
|
|
296
|
+
// This authenticated host bridge is not a catalog or public Control
|
|
297
|
+
// verb. The executor validates the completed native child and resumes
|
|
298
|
+
// its retained parent to settle from that child's committed result.
|
|
299
|
+
case "complete": {
|
|
300
|
+
const executor = yield* import_effect.Effect.serviceOption(import_ControlExecutor.ControlExecutor);
|
|
301
|
+
const complete = config.requestComplete ?? (executor._tag === "Some" ? executor.value.requestComplete : void 0);
|
|
302
|
+
if (complete === void 0) {
|
|
303
|
+
return yield* import_effect.Effect.fail(
|
|
304
|
+
new BridgeError({
|
|
305
|
+
code: "unavailable",
|
|
306
|
+
message: "Completed-module settlement is unavailable",
|
|
307
|
+
retryable: true
|
|
308
|
+
})
|
|
309
|
+
);
|
|
310
|
+
}
|
|
311
|
+
const receipt = yield* complete({ runId: input.runId, receiptId: idempotencyKey(input, "complete") });
|
|
312
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
313
|
+
}
|
|
314
|
+
case "cancel":
|
|
315
|
+
case "resume": {
|
|
316
|
+
const request = {
|
|
317
|
+
runId: input.runId,
|
|
318
|
+
idempotencyKey: idempotencyKey(input, input.operation),
|
|
319
|
+
...input.reason === void 0 ? {} : { reason: input.reason },
|
|
320
|
+
principal
|
|
321
|
+
};
|
|
322
|
+
const receipt = yield* input.operation === "cancel" ? control.cancel(request) : control.resume(request);
|
|
323
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
const cursorPosition = (cursor) => {
|
|
328
|
+
if (cursor === void 0 || cursor === "") return import_effect.Effect.succeed(void 0);
|
|
329
|
+
const match = observationCursorPattern.exec(cursor);
|
|
330
|
+
const sequence = Number(match?.[1] ?? match?.[2]);
|
|
331
|
+
const offset = match?.[3] === void 0 ? void 0 : Number(match[3]);
|
|
332
|
+
const valid = (value) => Number.isSafeInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
333
|
+
return match !== null && valid(sequence) && (offset === void 0 || valid(offset)) ? import_effect.Effect.succeed({ sequence, ...offset === void 0 ? {} : { offset } }) : import_effect.Effect.fail(
|
|
334
|
+
new BridgeError({
|
|
335
|
+
code: "invalid_request",
|
|
336
|
+
message: "Observation cursor is invalid or out of range",
|
|
337
|
+
retryable: false
|
|
338
|
+
})
|
|
339
|
+
);
|
|
340
|
+
};
|
|
341
|
+
const encodedCursor = (cursor) => cursor.offset === void 0 ? String(cursor.sequence) : `v1:${cursor.sequence}:${cursor.offset}`;
|
|
342
|
+
const observe = (control, input, receipts) => import_effect.Effect.gen(function* () {
|
|
343
|
+
const after = yield* cursorPosition(input.afterCursor);
|
|
344
|
+
const limit = Math.min(input.limit ?? defaultEventLimit, maximumEventLimit);
|
|
345
|
+
const listed = yield* control.list({ _tag: "runs", filters: { runId: input.runId }, limit: 1 });
|
|
346
|
+
const summary = listed._tag === "runs" ? listed.items[0] : void 0;
|
|
347
|
+
if (summary === void 0) {
|
|
348
|
+
return yield* import_effect.Effect.fail(
|
|
349
|
+
new BridgeError({ code: "run_not_found", message: "Runtime execution was not found", retryable: true })
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
const events = Array.from(
|
|
353
|
+
yield* import_effect.Stream.runCollect(import_effect.Stream.take(
|
|
354
|
+
control.watch({
|
|
355
|
+
runId: input.runId,
|
|
356
|
+
...after === void 0 ? {} : after.offset === void 0 ? { afterSequence: after.sequence } : { afterCursor: after },
|
|
357
|
+
follow: false
|
|
358
|
+
}),
|
|
359
|
+
limit + 1
|
|
360
|
+
))
|
|
361
|
+
);
|
|
362
|
+
const page = events.slice(0, limit);
|
|
363
|
+
const last = page.at(-1);
|
|
364
|
+
let finalOutput;
|
|
365
|
+
let failure = {};
|
|
366
|
+
if (terminal.has(summary.status)) {
|
|
367
|
+
const projections = yield* Projections.make(control);
|
|
368
|
+
const snapshot = yield* projections.snapshot({ _tag: "run-summary", runId: input.runId });
|
|
369
|
+
const row = snapshot.rows.find(import_effect.Schema.is(import_GatewayProjection.RunSummaryRow));
|
|
370
|
+
if (row === void 0 || row.runId !== summary.runId || row.flowId !== summary.flowId || row.status !== summary.status || row.planId !== summary.planId || row.planDigest !== summary.planDigest) {
|
|
371
|
+
return yield* import_effect.Effect.fail(
|
|
372
|
+
new BridgeError({ code: "internal", message: "Terminal result observation changed", retryable: true })
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
finalOutput = row.finalOutput;
|
|
376
|
+
failure = {
|
|
377
|
+
...row.failureFault === void 0 ? {} : { failureFault: row.failureFault },
|
|
378
|
+
...row.failureTag === void 0 ? {} : { failureTag: row.failureTag }
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
const hostSummary = yield* import_effect.Schema.decodeUnknownEffect(import_ControlSchema.RunSummary)(summary);
|
|
382
|
+
const commandReceipt = receipts === void 0 ? void 0 : yield* receipts(input.runId);
|
|
383
|
+
if (commandReceipt !== void 0 && commandReceipt.runId !== input.runId) {
|
|
384
|
+
return yield* import_effect.Effect.fail(
|
|
385
|
+
new BridgeError({ code: "internal", message: "Host command receipt names another run", retryable: false })
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
run: {
|
|
390
|
+
...hostSummary,
|
|
391
|
+
...commandReceipt === void 0 ? {} : { commandReceipt },
|
|
392
|
+
...finalOutput === void 0 ? {} : { finalOutput },
|
|
393
|
+
...failure
|
|
394
|
+
},
|
|
395
|
+
events: page,
|
|
396
|
+
nextCursor: last === void 0 ? input.afterCursor ?? "" : encodedCursor(last.cursor ?? { sequence: last.sequence }),
|
|
397
|
+
hasMore: events.length > limit,
|
|
398
|
+
terminal: terminal.has(summary.status)
|
|
399
|
+
};
|
|
400
|
+
});
|
|
401
|
+
const monitorJournals = /* @__PURE__ */ new WeakMap();
|
|
402
|
+
const monitorJournalBytes = 64 * 1024 * 1024;
|
|
403
|
+
const monitor = (control, runId, at) => import_effect.Effect.gen(function* () {
|
|
404
|
+
const listed = yield* control.list({ _tag: "runs", filters: { runId }, limit: 1 });
|
|
405
|
+
const run = listed._tag === "runs" ? listed.items[0] : void 0;
|
|
406
|
+
if (run === void 0 || run.runId !== runId) {
|
|
407
|
+
return yield* new BridgeError({
|
|
408
|
+
code: "run_not_found",
|
|
409
|
+
message: "Runtime execution was not found",
|
|
410
|
+
retryable: false
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
const cache = monitorJournals.get(control) ?? /* @__PURE__ */ new Map();
|
|
414
|
+
monitorJournals.set(control, cache);
|
|
415
|
+
const cached = cache.get(runId);
|
|
416
|
+
const last = cached?.records.at(-1)?.sequence;
|
|
417
|
+
const consumed = last === void 0 ? 0 : cached.records.filter((row) => row.sequence === last).length;
|
|
418
|
+
let skipped = 0;
|
|
419
|
+
const suffix = Array.from(
|
|
420
|
+
yield* import_effect.Stream.runCollect(
|
|
421
|
+
control.watch({
|
|
422
|
+
runId,
|
|
423
|
+
follow: false,
|
|
424
|
+
...last === void 0 || last === 0 ? {} : { afterSequence: last - 1 }
|
|
425
|
+
}).pipe(
|
|
426
|
+
import_effect.Stream.filter(
|
|
427
|
+
(row) => last === void 0 || row.sequence > last || row.sequence === last && skipped++ >= consumed
|
|
428
|
+
),
|
|
429
|
+
import_effect.Stream.take(Projections.maxEventsScanned + 1)
|
|
430
|
+
)
|
|
431
|
+
)
|
|
432
|
+
);
|
|
433
|
+
const records = [...cached?.records ?? [], ...suffix];
|
|
434
|
+
if (records.length > Projections.maxEventsScanned) {
|
|
435
|
+
return yield* new BridgeError({
|
|
436
|
+
code: "resource_limit",
|
|
437
|
+
message: "Run journal exceeds the inspection limit",
|
|
438
|
+
retryable: false
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
const bytes = (cached?.bytes ?? 0) + suffix.reduce((sum, row) => sum + new TextEncoder().encode(JSON.stringify(row)).byteLength, 0);
|
|
442
|
+
const current = cache.get(runId);
|
|
443
|
+
if (bytes <= monitorJournalBytes && (current === void 0 || current.records.length <= records.length)) {
|
|
444
|
+
cache.delete(runId);
|
|
445
|
+
cache.set(runId, { records, bytes });
|
|
446
|
+
let total = [...cache.values()].reduce((sum, entry) => sum + entry.bytes, 0);
|
|
447
|
+
while (cache.size > 32 || total > monitorJournalBytes) {
|
|
448
|
+
const oldest = cache.keys().next().value;
|
|
449
|
+
total -= cache.get(oldest).bytes;
|
|
450
|
+
cache.delete(oldest);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
const folded = (0, import_RunTrace.monitorFromJournal)({ runId, flowId: run.flowId, status: run.status }, records, at);
|
|
454
|
+
let start = Infinity;
|
|
455
|
+
let end = 0;
|
|
456
|
+
for (const row of records) {
|
|
457
|
+
if (row.occurredAt > 0) {
|
|
458
|
+
start = Math.min(start, row.occurredAt);
|
|
459
|
+
end = Math.max(end, row.occurredAt);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
const value = {
|
|
463
|
+
...folded,
|
|
464
|
+
...end === 0 ? {} : { extent: { start: new Date(start).toISOString(), end: new Date(end).toISOString() } }
|
|
465
|
+
};
|
|
466
|
+
if (at === void 0) delete value.journal;
|
|
467
|
+
if (new TextEncoder().encode(JSON.stringify(value)).byteLength > Projections.maxProjectionBytes) {
|
|
468
|
+
return yield* new BridgeError({
|
|
469
|
+
code: "resource_limit",
|
|
470
|
+
message: "Run monitor exceeds the inspection limit",
|
|
471
|
+
retryable: false
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
return value;
|
|
475
|
+
});
|
|
476
|
+
const CommandResponse = import_effect.Schema.Struct({
|
|
477
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
478
|
+
ok: import_effect.Schema.Literal(true),
|
|
479
|
+
value: import_effect.Schema.Struct({
|
|
480
|
+
operation: import_effect.Schema.String,
|
|
481
|
+
applicationRequestId: import_effect.Schema.String,
|
|
482
|
+
ownerGeneration: import_effect.Schema.optional(PositiveSafeInteger),
|
|
483
|
+
runtimeArtifactDigest: import_effect.Schema.optional(Sha256),
|
|
484
|
+
sourceRevision: import_effect.Schema.optional(SourceRevision),
|
|
485
|
+
planId: import_effect.Schema.optional(import_effect.Schema.String),
|
|
486
|
+
planDigest: import_effect.Schema.optional(Sha256),
|
|
487
|
+
executionDigest: import_effect.Schema.optional(Sha256),
|
|
488
|
+
envelope: import_effect.Schema.optional(import_effect.Schema.Json),
|
|
489
|
+
approval: import_effect.Schema.optional(import_ControlSchema.ApprovalPayload),
|
|
490
|
+
receipt: import_ControlSchema.Receipt
|
|
491
|
+
})
|
|
492
|
+
});
|
|
493
|
+
const ObserveResponse = import_effect.Schema.Struct({
|
|
494
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
495
|
+
ok: import_effect.Schema.Literal(true),
|
|
496
|
+
value: import_effect.Schema.Struct({
|
|
497
|
+
run: import_effect.Schema.Struct({
|
|
498
|
+
...import_ControlSchema.RunSummary.fields,
|
|
499
|
+
finalOutput: import_effect.Schema.optional(import_effect.Schema.String),
|
|
500
|
+
failureFault: import_effect.Schema.optional(Fault.Class),
|
|
501
|
+
failureTag: import_effect.Schema.optional(import_effect.Schema.String),
|
|
502
|
+
commandReceipt: import_effect.Schema.optionalKey(CommandReceipt)
|
|
503
|
+
}),
|
|
504
|
+
events: import_effect.Schema.Array(import_ControlSchema.ControlEvent),
|
|
505
|
+
nextCursor: import_effect.Schema.String,
|
|
506
|
+
hasMore: import_effect.Schema.Boolean,
|
|
507
|
+
terminal: import_effect.Schema.Boolean
|
|
508
|
+
})
|
|
509
|
+
});
|
|
510
|
+
const ErrorResponse = import_effect.Schema.Struct({
|
|
511
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
512
|
+
ok: import_effect.Schema.Literal(false),
|
|
513
|
+
error: import_effect.Schema.Struct({ code: import_effect.Schema.String, message: import_effect.Schema.String, retryable: import_effect.Schema.Boolean })
|
|
514
|
+
});
|
|
515
|
+
const errorResponse = (cause) => {
|
|
516
|
+
const known = import_effect.Schema.is(ControlError.ControlErrorSchema)(cause);
|
|
517
|
+
const code = cause instanceof BridgeError || known ? cause.code : "internal";
|
|
518
|
+
const retryable = cause instanceof BridgeError ? cause.retryable : cause instanceof ControlError.TransportError ? cause.retryable : retryableCodes.has(code);
|
|
519
|
+
const message = cause instanceof BridgeError ? cause.message : "Runtime bridge failed";
|
|
520
|
+
const status = code === "unauthorized" ? 401 : notFoundCodes.has(code) ? 404 : conflictCodes.has(code) ? 409 : retryable ? 503 : code === "internal" ? 500 : 400;
|
|
521
|
+
return import_http.HttpServerResponse.jsonUnsafe({ protocol, ok: false, error: { code, message, retryable } }, { status });
|
|
522
|
+
};
|
|
523
|
+
const respondToFailure = (operation) => (cause) => {
|
|
524
|
+
const response = errorResponse(cause);
|
|
525
|
+
if (cause instanceof BridgeError) return import_effect.Effect.succeed(response);
|
|
526
|
+
const code = import_effect.Schema.is(ControlError.ControlErrorSchema)(cause) ? cause.code : "internal";
|
|
527
|
+
return import_effect.Effect.logError({ message: "Runtime bridge request failed", operation, code, cause }).pipe(
|
|
528
|
+
import_effect.Effect.as(response)
|
|
529
|
+
);
|
|
530
|
+
};
|
|
531
|
+
const readJson = import_effect.Effect.gen(function* () {
|
|
532
|
+
const request = yield* import_http.HttpServerRequest.HttpServerRequest;
|
|
533
|
+
const text = yield* request.text;
|
|
534
|
+
return yield* import_effect.Effect.try({
|
|
535
|
+
try: () => JSON.parse(text),
|
|
536
|
+
catch: () => new BridgeError({ code: "invalid_request", message: "Request body must be JSON", retryable: false })
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
const authenticated = (config, effect) => import_effect.Effect.gen(function* () {
|
|
540
|
+
const request = yield* import_http.HttpServerRequest.HttpServerRequest;
|
|
541
|
+
const principal = yield* config.authenticate(request.headers);
|
|
542
|
+
return yield* effect(principal);
|
|
543
|
+
});
|
|
544
|
+
const layer = (config) => {
|
|
545
|
+
const command = authenticated(config, (principal) => import_effect.Effect.gen(function* () {
|
|
546
|
+
const body = yield* readJson;
|
|
547
|
+
const input = yield* decodeCommand(body).pipe(import_effect.Effect.mapError(
|
|
548
|
+
() => new BridgeError({
|
|
549
|
+
code: "invalid_request",
|
|
550
|
+
message: "Request does not match the runtime bridge contract",
|
|
551
|
+
retryable: false
|
|
552
|
+
})
|
|
553
|
+
));
|
|
554
|
+
const control = yield* import_Control.Control;
|
|
555
|
+
const value = yield* execute(config, control, principal, input);
|
|
556
|
+
return import_http.HttpServerResponse.jsonUnsafe({ protocol, ok: true, value });
|
|
557
|
+
})).pipe(
|
|
558
|
+
import_effect.Effect.catch(respondToFailure("runtime-bridge.command")),
|
|
559
|
+
import_effect.Effect.withSpan("runtime-bridge.command")
|
|
560
|
+
);
|
|
561
|
+
const observation = authenticated(config, () => import_effect.Effect.gen(function* () {
|
|
562
|
+
const body = yield* readJson;
|
|
563
|
+
const input = yield* decodeObserve(body).pipe(import_effect.Effect.mapError(
|
|
564
|
+
() => new BridgeError({
|
|
565
|
+
code: "invalid_request",
|
|
566
|
+
message: "Request does not match the observation contract",
|
|
567
|
+
retryable: false
|
|
568
|
+
})
|
|
569
|
+
));
|
|
570
|
+
const control = yield* import_Control.Control;
|
|
571
|
+
const value = yield* observe(control, input, config.commandReceipt);
|
|
572
|
+
return import_http.HttpServerResponse.jsonUnsafe({ protocol, ok: true, value });
|
|
573
|
+
})).pipe(
|
|
574
|
+
import_effect.Effect.catch(respondToFailure("runtime-bridge.observe")),
|
|
575
|
+
import_effect.Effect.withSpan("runtime-bridge.observe")
|
|
576
|
+
);
|
|
577
|
+
const inspection = authenticated(config, () => import_effect.Effect.gen(function* () {
|
|
578
|
+
const body = yield* readJson;
|
|
579
|
+
const input = yield* import_effect.Schema.decodeUnknownEffect(import_effect.Schema.Struct({
|
|
580
|
+
protocol: import_effect.Schema.Literal(protocol),
|
|
581
|
+
runId: import_effect.Schema.NonEmptyString,
|
|
582
|
+
at: import_effect.Schema.optional(import_effect.Schema.Int.check(import_effect.Schema.isGreaterThanOrEqualTo(0)))
|
|
583
|
+
}))(body).pipe(import_effect.Effect.mapError(
|
|
584
|
+
() => new BridgeError({ code: "invalid_request", message: "Invalid monitor request", retryable: false })
|
|
585
|
+
));
|
|
586
|
+
const control = yield* import_Control.Control;
|
|
587
|
+
return import_http.HttpServerResponse.jsonUnsafe({
|
|
588
|
+
protocol,
|
|
589
|
+
ok: true,
|
|
590
|
+
value: yield* monitor(control, input.runId, input.at)
|
|
591
|
+
});
|
|
592
|
+
})).pipe(import_effect.Effect.catch(respondToFailure("runtime-bridge.observe")));
|
|
593
|
+
return import_http.HttpRouter.add("POST", "/runtime/v1/command", command).pipe(
|
|
594
|
+
import_effect.Layer.merge(import_http.HttpRouter.add("POST", "/runtime/v1/monitor", inspection)),
|
|
595
|
+
import_effect.Layer.merge(import_http.HttpRouter.add("POST", "/runtime/v1/observe", observation))
|
|
596
|
+
);
|
|
597
|
+
};
|
|
598
|
+
//# sourceMappingURL=RuntimeBridge.js.map
|