@smthrs/gateway 0.35.0 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +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 +509 -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 +471 -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 +19 -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 +1595 -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 +12 -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 +13 -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 +557 -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 +799 -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 +19 -0
- package/dist/esm/HostBranchPresence.d.ts.map +1 -0
- package/dist/esm/HostBranchPresence.js +57 -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 +2106 -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 +12 -0
- package/dist/esm/internal/actionRenderings.d.ts.map +1 -0
- package/dist/esm/internal/actionRenderings.js +212 -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 +13 -0
- package/dist/esm/internal/inspectLabels.d.ts.map +1 -0
- package/dist/esm/internal/inspectLabels.js +17 -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 +627 -0
- package/src/GatewayError.ts +71 -0
- package/src/GatewayProjection.ts +959 -0
- package/src/GatewayRpcs.ts +179 -0
- package/src/GatewaySchema.ts +516 -0
- package/src/GatewayServer.ts +932 -0
- package/src/HostBranchPresence.ts +76 -0
- package/src/Projections.ts +1735 -0
- package/src/RunDevTools.ts +394 -0
- package/src/RunHistory.ts +174 -0
- package/src/RunTrace.ts +2796 -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 +212 -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 +18 -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,659 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Versioned JSON boundary between the Go product backend and the canonical
|
|
3
|
+
* TypeScript Flow/Control host.
|
|
4
|
+
*
|
|
5
|
+
* This module adapts HTTP-shaped commands to `Control`. It owns no graph,
|
|
6
|
+
* scheduler, journal, or lifecycle state of its own.
|
|
7
|
+
*
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
import { Control } from "@smthrs/control/Control";
|
|
11
|
+
import * as ControlError from "@smthrs/control/ControlError";
|
|
12
|
+
import { ControlExecutor } from "@smthrs/control/ControlExecutor";
|
|
13
|
+
import { ApprovalPayload, ControlEvent, MessageSteer, Receipt, RunSummary, SignalPayload } from "@smthrs/control/ControlSchema";
|
|
14
|
+
import * as Fault from "@smthrs/flow/Fault";
|
|
15
|
+
import { Effect, Layer, Schema, Stream } from "effect";
|
|
16
|
+
import { HttpRouter, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
17
|
+
import { RunSummaryRow } from "./GatewayProjection.js";
|
|
18
|
+
import * as Projections from "./Projections.js";
|
|
19
|
+
import { monitorFromJournal } from "./RunTrace.js";
|
|
20
|
+
/**
|
|
21
|
+
* The only protocol version accepted by this host.
|
|
22
|
+
* @since 1.0.0
|
|
23
|
+
* @category constants
|
|
24
|
+
*/
|
|
25
|
+
export const protocol = "smithers.flow-runtime/v1";
|
|
26
|
+
const Sha256 = Schema.String.check(Schema.isPattern(/^[0-9a-f]{64}$/));
|
|
27
|
+
const SourceRevision = Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/));
|
|
28
|
+
const PositiveSafeInteger = Schema.Int.check(Schema.isGreaterThan(0), Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER));
|
|
29
|
+
const RequestId = Schema.NonEmptyString.check(Schema.isMaxLength(1024));
|
|
30
|
+
// A decimal consumes a whole journal entry. v1 preserves an expansion offset;
|
|
31
|
+
// the empty seed consumes nothing, including sequence zero.
|
|
32
|
+
const observationCursorPattern = /^(?:(0|[1-9][0-9]*)|v1:(0|[1-9][0-9]*):(0|[1-9][0-9]*))?(?![\s\S])/;
|
|
33
|
+
/**
|
|
34
|
+
* Non-secret identity published by readiness for startup compatibility.
|
|
35
|
+
* @since 1.0.0
|
|
36
|
+
* @category models
|
|
37
|
+
*/
|
|
38
|
+
export const Identity = Schema.Struct({
|
|
39
|
+
protocol: Schema.Literal(protocol),
|
|
40
|
+
runtimeArtifactDigest: Sha256,
|
|
41
|
+
sourceRevision: SourceRevision,
|
|
42
|
+
ownerGeneration: PositiveSafeInteger
|
|
43
|
+
});
|
|
44
|
+
const common = {
|
|
45
|
+
protocol: Schema.Literal(protocol),
|
|
46
|
+
applicationRequestId: RequestId,
|
|
47
|
+
ownerGeneration: PositiveSafeInteger
|
|
48
|
+
};
|
|
49
|
+
// The version a launch must run: a flow, the source commit it was chosen
|
|
50
|
+
// from and that flow's execution digest. A pinned launch runs only a plan
|
|
51
|
+
// with that exact identity.
|
|
52
|
+
const LaunchPin = Schema.Struct({
|
|
53
|
+
flow: Schema.NonEmptyString,
|
|
54
|
+
sourceCommit: SourceRevision,
|
|
55
|
+
executionDigest: Sha256
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Launches one immutable named flow. Planning and running stay in Control.
|
|
59
|
+
* @since 1.0.0
|
|
60
|
+
* @category models
|
|
61
|
+
*/
|
|
62
|
+
export const LaunchCommand = Schema.Struct({
|
|
63
|
+
...common,
|
|
64
|
+
operation: Schema.Literal("launch"),
|
|
65
|
+
attempt: PositiveSafeInteger,
|
|
66
|
+
runId: Schema.optional(Schema.NonEmptyString),
|
|
67
|
+
runtimeArtifactDigest: Sha256,
|
|
68
|
+
sourceRevision: SourceRevision,
|
|
69
|
+
flowId: Schema.NonEmptyString,
|
|
70
|
+
payload: Schema.Json,
|
|
71
|
+
pin: Schema.optional(LaunchPin)
|
|
72
|
+
});
|
|
73
|
+
/**
|
|
74
|
+
* Submits an approval or denial payload produced by the same Control host.
|
|
75
|
+
* @since 1.0.0
|
|
76
|
+
* @category models
|
|
77
|
+
*/
|
|
78
|
+
export const DecisionCommand = Schema.Struct({
|
|
79
|
+
...common,
|
|
80
|
+
operation: Schema.Literals(["approve", "deny"]),
|
|
81
|
+
approval: ApprovalPayload
|
|
82
|
+
});
|
|
83
|
+
/**
|
|
84
|
+
* Delivers one durable named signal.
|
|
85
|
+
* @since 1.0.0
|
|
86
|
+
* @category models
|
|
87
|
+
*/
|
|
88
|
+
export const SignalCommand = Schema.Struct({
|
|
89
|
+
...common,
|
|
90
|
+
operation: Schema.Literal("signal"),
|
|
91
|
+
runId: Schema.NonEmptyString,
|
|
92
|
+
signal: SignalPayload
|
|
93
|
+
});
|
|
94
|
+
const Steer = Schema.Union([
|
|
95
|
+
Schema.Struct({ kind: Schema.Literal("Message"), body: Schema.String }),
|
|
96
|
+
Schema.Struct({ kind: Schema.Literal("Seat"), seat: Schema.NonEmptyString }),
|
|
97
|
+
Schema.Struct({
|
|
98
|
+
kind: Schema.Literal("Thinking"),
|
|
99
|
+
thinking: Schema.Literals(["none", "minimal", "low", "medium", "high", "xhigh"])
|
|
100
|
+
}),
|
|
101
|
+
Schema.Struct({ kind: Schema.Literal("Tools"), toolNames: Schema.NonEmptyArray(Schema.NonEmptyString) })
|
|
102
|
+
]);
|
|
103
|
+
/**
|
|
104
|
+
* Enqueues one steer for the runtime's next turn boundary.
|
|
105
|
+
* @since 1.0.0
|
|
106
|
+
* @category models
|
|
107
|
+
*/
|
|
108
|
+
export const SteerCommand = Schema.Struct({
|
|
109
|
+
version: Schema.optional(Schema.Number),
|
|
110
|
+
...common,
|
|
111
|
+
operation: Schema.Literal("steer"),
|
|
112
|
+
runId: Schema.NonEmptyString,
|
|
113
|
+
messageId: Schema.NonEmptyString,
|
|
114
|
+
createdAt: Schema.Number,
|
|
115
|
+
attribution: MessageSteer.fields.attribution,
|
|
116
|
+
steer: Steer
|
|
117
|
+
});
|
|
118
|
+
/**
|
|
119
|
+
* Requests cancellation, explicit resume, or completion of a retained run.
|
|
120
|
+
* @since 1.0.0
|
|
121
|
+
* @category models
|
|
122
|
+
*/
|
|
123
|
+
export const LifecycleCommand = Schema.Struct({
|
|
124
|
+
...common,
|
|
125
|
+
/** Completion is a host-only lifecycle operation. @since 1.0.0 */
|
|
126
|
+
operation: Schema.Literals(["cancel", "resume", "complete"]),
|
|
127
|
+
runId: Schema.NonEmptyString,
|
|
128
|
+
reason: Schema.optional(Schema.String)
|
|
129
|
+
});
|
|
130
|
+
/**
|
|
131
|
+
* Every mutating operation accepted by the bridge.
|
|
132
|
+
* @since 1.0.0
|
|
133
|
+
* @category models
|
|
134
|
+
*/
|
|
135
|
+
export const Command = Schema.Union([
|
|
136
|
+
LaunchCommand,
|
|
137
|
+
DecisionCommand,
|
|
138
|
+
SignalCommand,
|
|
139
|
+
SteerCommand,
|
|
140
|
+
LifecycleCommand
|
|
141
|
+
]);
|
|
142
|
+
/**
|
|
143
|
+
* A bounded, reconnectable read of one canonical runtime execution.
|
|
144
|
+
* @since 1.0.0
|
|
145
|
+
* @category models
|
|
146
|
+
*/
|
|
147
|
+
export const ObserveRequest = Schema.Struct({
|
|
148
|
+
protocol: Schema.Literal(protocol),
|
|
149
|
+
runId: Schema.NonEmptyString,
|
|
150
|
+
afterCursor: Schema.optional(Schema.String.check(Schema.isPattern(observationCursorPattern))),
|
|
151
|
+
limit: Schema.optional(PositiveSafeInteger)
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* A process result recorded by installed host equipment, never by a flow result.
|
|
155
|
+
* @since 1.0.0
|
|
156
|
+
* @category models
|
|
157
|
+
*/
|
|
158
|
+
export const CommandReceipt = Schema.Struct({
|
|
159
|
+
runId: Schema.NonEmptyString,
|
|
160
|
+
operationId: Schema.NonEmptyString,
|
|
161
|
+
status: Schema.Literals(["running", "completed"]),
|
|
162
|
+
argv: Schema.NonEmptyArray(Schema.String),
|
|
163
|
+
exitCode: Schema.optionalKey(Schema.Int),
|
|
164
|
+
stderr: Schema.optionalKey(Schema.String),
|
|
165
|
+
fault: Schema.optionalKey(Schema.Literals(["factory", "infra"]))
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* Stable bridge-only failures. Control failures retain their own code.
|
|
169
|
+
* @since 1.0.0
|
|
170
|
+
* @category errors
|
|
171
|
+
*/
|
|
172
|
+
export class BridgeError extends Schema.TaggedError()("@smthrs/gateway/RuntimeBridgeError", {
|
|
173
|
+
code: Schema.Literals([
|
|
174
|
+
"invalid_request",
|
|
175
|
+
"artifact_mismatch",
|
|
176
|
+
"source_mismatch",
|
|
177
|
+
"stale_owner",
|
|
178
|
+
"run_not_found",
|
|
179
|
+
"resource_limit",
|
|
180
|
+
"unavailable",
|
|
181
|
+
"internal"
|
|
182
|
+
]),
|
|
183
|
+
message: Schema.String,
|
|
184
|
+
retryable: Schema.Boolean
|
|
185
|
+
}) {
|
|
186
|
+
}
|
|
187
|
+
const decodeCommand = Schema.decodeUnknownEffect(Command);
|
|
188
|
+
const decodeObserve = Schema.decodeUnknownEffect(ObserveRequest);
|
|
189
|
+
const terminal = new Set(["completed", "failed", "cancelled"]);
|
|
190
|
+
const retryableCodes = new Set(["transport_error", "unavailable", "persistence_failed", "launch_failed"]);
|
|
191
|
+
const notFoundCodes = new Set(["run_not_found", "flow_not_found", "plan_not_found"]);
|
|
192
|
+
const conflictCodes = new Set(["stale_owner", "artifact_mismatch", "source_mismatch", "conflict"]);
|
|
193
|
+
const defaultEventLimit = 250;
|
|
194
|
+
const maximumEventLimit = 1_000;
|
|
195
|
+
// Host generation fences who may execute a delivery, but it is not part of
|
|
196
|
+
// the durable product request identity. A replacement owner must reconcile a
|
|
197
|
+
// lost acknowledgement against the same Control command keys.
|
|
198
|
+
const idempotencyKey = (input, suffix) => `bridge:v1:${input.applicationRequestId}:${suffix}`;
|
|
199
|
+
const validateOwner = (config, input) => input.ownerGeneration === config.ownerGeneration
|
|
200
|
+
? Effect.void
|
|
201
|
+
: Effect.fail(new BridgeError({ code: "stale_owner", message: "Runtime owner generation is stale", retryable: true }));
|
|
202
|
+
/**
|
|
203
|
+
* Executes one decoded command exclusively through the canonical Control API.
|
|
204
|
+
* @since 1.0.0
|
|
205
|
+
* @category constructors
|
|
206
|
+
*/
|
|
207
|
+
export const execute = (config, control, principal, input) => Effect.gen(function* () {
|
|
208
|
+
yield* validateOwner(config, input);
|
|
209
|
+
switch (input.operation) {
|
|
210
|
+
case "launch": {
|
|
211
|
+
if (input.runtimeArtifactDigest !== config.runtimeArtifactDigest) {
|
|
212
|
+
return yield* Effect.fail(new BridgeError({
|
|
213
|
+
code: "artifact_mismatch",
|
|
214
|
+
message: "Runtime artifact digest does not match the owning host",
|
|
215
|
+
retryable: false
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
if (input.sourceRevision !== config.sourceRevision) {
|
|
219
|
+
return yield* Effect.fail(new BridgeError({
|
|
220
|
+
code: "source_mismatch",
|
|
221
|
+
message: "Flow source revision does not match the owning host",
|
|
222
|
+
retryable: false
|
|
223
|
+
}));
|
|
224
|
+
}
|
|
225
|
+
// Every launch of a pinned attempt (its composition and the engine's
|
|
226
|
+
// launches) runs from the pinned source commit: a host serving any
|
|
227
|
+
// other source refuses before planning imports anything.
|
|
228
|
+
if (input.pin !== undefined && input.pin.sourceCommit !== config.sourceRevision) {
|
|
229
|
+
return yield* Effect.fail(new BridgeError({
|
|
230
|
+
code: "source_mismatch",
|
|
231
|
+
message: "Flow source revision does not match the pinned launch",
|
|
232
|
+
retryable: false
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
const plan = yield* control.plan({
|
|
236
|
+
flowId: input.flowId,
|
|
237
|
+
input: input.payload,
|
|
238
|
+
idempotencyKey: idempotencyKey(input, "plan")
|
|
239
|
+
});
|
|
240
|
+
// Graphs are optional for valid Flow declarations. Only a verified
|
|
241
|
+
// native catalog snapshot can supply the missing provenance; the
|
|
242
|
+
// configured/wire identity by itself cannot stand in for that proof.
|
|
243
|
+
const plannedSource = plan.graph?.sourceRevision ?? config.verifiedCatalogSourceRevision;
|
|
244
|
+
if (plannedSource !== input.sourceRevision) {
|
|
245
|
+
return yield* Effect.fail(new BridgeError({
|
|
246
|
+
code: "source_mismatch",
|
|
247
|
+
message: "Flow source revision does not match the immutable request",
|
|
248
|
+
retryable: false
|
|
249
|
+
}));
|
|
250
|
+
}
|
|
251
|
+
// A pinned launch runs nothing but its pin: a plan with no execution
|
|
252
|
+
// identity, or the pinned flow planned as other code, never starts.
|
|
253
|
+
if (input.pin !== undefined &&
|
|
254
|
+
(plan.executionDigest === undefined ||
|
|
255
|
+
(input.pin.flow === input.flowId && plan.executionDigest !== input.pin.executionDigest))) {
|
|
256
|
+
return yield* Effect.fail(new BridgeError({
|
|
257
|
+
code: "source_mismatch",
|
|
258
|
+
message: "Flow execution digest does not match the pinned launch",
|
|
259
|
+
retryable: false
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
const receipt = yield* control.run({
|
|
263
|
+
_tag: "Plan",
|
|
264
|
+
planId: plan.planId,
|
|
265
|
+
digest: plan.digest,
|
|
266
|
+
envelope: plan.envelope,
|
|
267
|
+
idempotencyKey: idempotencyKey(input, `run:${input.runId ?? input.attempt}`),
|
|
268
|
+
principal,
|
|
269
|
+
...(input.runId === undefined ? {} : { reservedRunId: input.runId })
|
|
270
|
+
});
|
|
271
|
+
return {
|
|
272
|
+
operation: input.operation,
|
|
273
|
+
applicationRequestId: input.applicationRequestId,
|
|
274
|
+
ownerGeneration: input.ownerGeneration,
|
|
275
|
+
runtimeArtifactDigest: config.runtimeArtifactDigest,
|
|
276
|
+
sourceRevision: input.sourceRevision,
|
|
277
|
+
planId: plan.planId,
|
|
278
|
+
planDigest: plan.digest,
|
|
279
|
+
...(plan.executionDigest === undefined ? {} : { executionDigest: plan.executionDigest }),
|
|
280
|
+
envelope: plan.envelope,
|
|
281
|
+
approval: plan.approval,
|
|
282
|
+
receipt
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
case "approve":
|
|
286
|
+
case "deny": {
|
|
287
|
+
const request = {
|
|
288
|
+
...input.approval,
|
|
289
|
+
idempotencyKey: idempotencyKey(input, input.operation),
|
|
290
|
+
principal
|
|
291
|
+
};
|
|
292
|
+
const receipt = yield* input.operation === "approve" ? control.approve(request) : control.deny(request);
|
|
293
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
294
|
+
}
|
|
295
|
+
case "signal": {
|
|
296
|
+
const receipt = yield* control.signal({
|
|
297
|
+
runId: input.runId,
|
|
298
|
+
signal: input.signal,
|
|
299
|
+
idempotencyKey: idempotencyKey(input, "signal"),
|
|
300
|
+
principal
|
|
301
|
+
});
|
|
302
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
303
|
+
}
|
|
304
|
+
case "steer": {
|
|
305
|
+
const receipt = yield* control.steer({
|
|
306
|
+
runId: input.runId,
|
|
307
|
+
idempotencyKey: idempotencyKey(input, "steer"),
|
|
308
|
+
...(input.version === undefined ? {} : { version: input.version }),
|
|
309
|
+
message: {
|
|
310
|
+
...input.steer,
|
|
311
|
+
runId: input.runId,
|
|
312
|
+
messageId: input.messageId,
|
|
313
|
+
createdAt: input.createdAt,
|
|
314
|
+
...(input.attribution === undefined ? {} : { attribution: input.attribution }),
|
|
315
|
+
principal
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
319
|
+
}
|
|
320
|
+
// This authenticated host bridge is not a catalog or public Control
|
|
321
|
+
// verb. The executor validates the completed native child and resumes
|
|
322
|
+
// its retained parent to settle from that child's committed result.
|
|
323
|
+
case "complete": {
|
|
324
|
+
const executor = yield* Effect.serviceOption(ControlExecutor);
|
|
325
|
+
const complete = config.requestComplete ??
|
|
326
|
+
(executor._tag === "Some" ? executor.value.requestComplete : undefined);
|
|
327
|
+
if (complete === undefined) {
|
|
328
|
+
return yield* Effect.fail(new BridgeError({
|
|
329
|
+
code: "unavailable",
|
|
330
|
+
message: "Completed-module settlement is unavailable",
|
|
331
|
+
retryable: true
|
|
332
|
+
}));
|
|
333
|
+
}
|
|
334
|
+
const receipt = yield* complete({ runId: input.runId, receiptId: idempotencyKey(input, "complete") });
|
|
335
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
336
|
+
}
|
|
337
|
+
case "cancel":
|
|
338
|
+
case "resume": {
|
|
339
|
+
const request = {
|
|
340
|
+
runId: input.runId,
|
|
341
|
+
idempotencyKey: idempotencyKey(input, input.operation),
|
|
342
|
+
...(input.reason === undefined ? {} : { reason: input.reason }),
|
|
343
|
+
principal
|
|
344
|
+
};
|
|
345
|
+
const receipt = yield* input.operation === "cancel" ? control.cancel(request) : control.resume(request);
|
|
346
|
+
return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt };
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
const cursorPosition = (cursor) => {
|
|
351
|
+
if (cursor === undefined || cursor === "")
|
|
352
|
+
return Effect.succeed(undefined);
|
|
353
|
+
const match = observationCursorPattern.exec(cursor);
|
|
354
|
+
const sequence = Number(match?.[1] ?? match?.[2]);
|
|
355
|
+
const offset = match?.[3] === undefined ? undefined : Number(match[3]);
|
|
356
|
+
const valid = (value) => Number.isSafeInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER;
|
|
357
|
+
return match !== null && valid(sequence) && (offset === undefined || valid(offset))
|
|
358
|
+
? Effect.succeed({ sequence, ...(offset === undefined ? {} : { offset }) })
|
|
359
|
+
: Effect.fail(new BridgeError({
|
|
360
|
+
code: "invalid_request",
|
|
361
|
+
message: "Observation cursor is invalid or out of range",
|
|
362
|
+
retryable: false
|
|
363
|
+
}));
|
|
364
|
+
};
|
|
365
|
+
const encodedCursor = (cursor) => cursor.offset === undefined ? String(cursor.sequence) : `v1:${cursor.sequence}:${cursor.offset}`;
|
|
366
|
+
/**
|
|
367
|
+
* Reads a bounded event replay and current canonical run projection.
|
|
368
|
+
* @since 1.0.0
|
|
369
|
+
* @category constructors
|
|
370
|
+
*/
|
|
371
|
+
export const observe = (control, input, receipts) => Effect.gen(function* () {
|
|
372
|
+
const after = yield* cursorPosition(input.afterCursor);
|
|
373
|
+
const limit = Math.min(input.limit ?? defaultEventLimit, maximumEventLimit);
|
|
374
|
+
const listed = yield* control.list({ _tag: "runs", filters: { runId: input.runId }, limit: 1 });
|
|
375
|
+
const summary = listed._tag === "runs" ? listed.items[0] : undefined;
|
|
376
|
+
if (summary === undefined) {
|
|
377
|
+
return yield* Effect.fail(new BridgeError({ code: "run_not_found", message: "Runtime execution was not found", retryable: true }));
|
|
378
|
+
}
|
|
379
|
+
const events = Array.from(yield* Stream.runCollect(Stream.take(control.watch({
|
|
380
|
+
runId: input.runId,
|
|
381
|
+
...(after === undefined
|
|
382
|
+
? {}
|
|
383
|
+
: after.offset === undefined
|
|
384
|
+
? { afterSequence: after.sequence }
|
|
385
|
+
: { afterCursor: after }),
|
|
386
|
+
follow: false
|
|
387
|
+
}), limit + 1)));
|
|
388
|
+
const page = events.slice(0, limit);
|
|
389
|
+
const last = page.at(-1);
|
|
390
|
+
// Typed Flow results use the same committed root projection as the app.
|
|
391
|
+
// A terminal status alone never supplies a result, and a bounded event
|
|
392
|
+
// page cannot reconstruct a root result that precedes its cursor.
|
|
393
|
+
let finalOutput;
|
|
394
|
+
let failure = {};
|
|
395
|
+
if (terminal.has(summary.status)) {
|
|
396
|
+
const projections = yield* Projections.make(control);
|
|
397
|
+
const snapshot = yield* projections.snapshot({ _tag: "run-summary", runId: input.runId });
|
|
398
|
+
const row = snapshot.rows.find(Schema.is(RunSummaryRow));
|
|
399
|
+
if (row === undefined || row.runId !== summary.runId || row.flowId !== summary.flowId ||
|
|
400
|
+
row.status !== summary.status || row.planId !== summary.planId || row.planDigest !== summary.planDigest) {
|
|
401
|
+
return yield* Effect.fail(new BridgeError({ code: "internal", message: "Terminal result observation changed", retryable: true }));
|
|
402
|
+
}
|
|
403
|
+
finalOutput = row.finalOutput;
|
|
404
|
+
failure = {
|
|
405
|
+
...(row.failureFault === undefined ? {} : { failureFault: row.failureFault }),
|
|
406
|
+
...(row.failureTag === undefined ? {} : { failureTag: row.failureTag })
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
// Keep the private receipt out of every repository-controlled projection.
|
|
410
|
+
const hostSummary = yield* Schema.decodeUnknownEffect(RunSummary)(summary);
|
|
411
|
+
const commandReceipt = receipts === undefined ? undefined : yield* receipts(input.runId);
|
|
412
|
+
if (commandReceipt !== undefined && commandReceipt.runId !== input.runId) {
|
|
413
|
+
return yield* Effect.fail(new BridgeError({ code: "internal", message: "Host command receipt names another run", retryable: false }));
|
|
414
|
+
}
|
|
415
|
+
return {
|
|
416
|
+
run: {
|
|
417
|
+
...hostSummary,
|
|
418
|
+
...(commandReceipt === undefined ? {} : { commandReceipt }),
|
|
419
|
+
...(finalOutput === undefined ? {} : { finalOutput }),
|
|
420
|
+
...failure
|
|
421
|
+
},
|
|
422
|
+
events: page,
|
|
423
|
+
nextCursor: last === undefined
|
|
424
|
+
? input.afterCursor ?? ""
|
|
425
|
+
: encodedCursor(last.cursor ?? { sequence: last.sequence }),
|
|
426
|
+
hasMore: events.length > limit,
|
|
427
|
+
terminal: terminal.has(summary.status)
|
|
428
|
+
};
|
|
429
|
+
});
|
|
430
|
+
// Disposable raw journal prefixes for Inspect. This stores no run state: the
|
|
431
|
+
// existing monitor fold still derives every answer from journal records. Bound
|
|
432
|
+
// retention across all runs of one control service, and rebuild after eviction.
|
|
433
|
+
const monitorJournals = new WeakMap();
|
|
434
|
+
const monitorJournalBytes = 64 * 1024 * 1024;
|
|
435
|
+
/** Read an existing run and its committed journal without invoking any execution door.
|
|
436
|
+
* @since 1.0.0
|
|
437
|
+
* @category constructors
|
|
438
|
+
*/
|
|
439
|
+
export const monitor = (control, runId, at) => Effect.gen(function* () {
|
|
440
|
+
const listed = yield* control.list({ _tag: "runs", filters: { runId }, limit: 1 });
|
|
441
|
+
const run = listed._tag === "runs" ? listed.items[0] : undefined;
|
|
442
|
+
if (run === undefined || run.runId !== runId) {
|
|
443
|
+
return yield* new BridgeError({
|
|
444
|
+
code: "run_not_found",
|
|
445
|
+
message: "Runtime execution was not found",
|
|
446
|
+
retryable: false
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
const cache = monitorJournals.get(control) ??
|
|
450
|
+
new Map();
|
|
451
|
+
monitorJournals.set(control, cache);
|
|
452
|
+
const cached = cache.get(runId);
|
|
453
|
+
const last = cached?.records.at(-1)?.sequence;
|
|
454
|
+
// Replay the final entry because one entry may expand into several events.
|
|
455
|
+
const consumed = last === undefined ? 0 : cached.records.filter((row) => row.sequence === last).length;
|
|
456
|
+
let skipped = 0;
|
|
457
|
+
const suffix = Array.from(yield* Stream.runCollect(control.watch({
|
|
458
|
+
runId,
|
|
459
|
+
follow: false,
|
|
460
|
+
...(last === undefined || last === 0 ? {} : { afterSequence: last - 1 })
|
|
461
|
+
}).pipe(Stream.filter((row) => last === undefined || row.sequence > last || row.sequence === last && skipped++ >= consumed), Stream.take(Projections.maxEventsScanned + 1))));
|
|
462
|
+
const records = [...(cached?.records ?? []), ...suffix];
|
|
463
|
+
if (records.length > Projections.maxEventsScanned) {
|
|
464
|
+
return yield* new BridgeError({
|
|
465
|
+
code: "resource_limit",
|
|
466
|
+
message: "Run journal exceeds the inspection limit",
|
|
467
|
+
retryable: false
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
const bytes = (cached?.bytes ?? 0) +
|
|
471
|
+
suffix.reduce((sum, row) => sum + new TextEncoder().encode(JSON.stringify(row)).byteLength, 0);
|
|
472
|
+
const current = cache.get(runId);
|
|
473
|
+
// A slower reader cannot overwrite a longer committed prefix.
|
|
474
|
+
if (bytes <= monitorJournalBytes && (current === undefined || current.records.length <= records.length)) {
|
|
475
|
+
cache.delete(runId);
|
|
476
|
+
cache.set(runId, { records, bytes });
|
|
477
|
+
let total = [...cache.values()].reduce((sum, entry) => sum + entry.bytes, 0);
|
|
478
|
+
while (cache.size > 32 || total > monitorJournalBytes) {
|
|
479
|
+
const oldest = cache.keys().next().value;
|
|
480
|
+
total -= cache.get(oldest).bytes;
|
|
481
|
+
cache.delete(oldest);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
const folded = monitorFromJournal({ runId, flowId: run.flowId, status: run.status }, records, at);
|
|
485
|
+
// The journal is read page by page when its tab opens (run-events). Only a
|
|
486
|
+
// replay frame carries its own journal prefix. The extent bounds the run.
|
|
487
|
+
let start = Infinity;
|
|
488
|
+
let end = 0;
|
|
489
|
+
for (const row of records) {
|
|
490
|
+
if (row.occurredAt > 0) {
|
|
491
|
+
start = Math.min(start, row.occurredAt);
|
|
492
|
+
end = Math.max(end, row.occurredAt);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const value = {
|
|
496
|
+
...folded,
|
|
497
|
+
...(end === 0 ? {} : { extent: { start: new Date(start).toISOString(), end: new Date(end).toISOString() } })
|
|
498
|
+
};
|
|
499
|
+
if (at === undefined)
|
|
500
|
+
delete value.journal;
|
|
501
|
+
if (new TextEncoder().encode(JSON.stringify(value)).byteLength > Projections.maxProjectionBytes) {
|
|
502
|
+
return yield* new BridgeError({
|
|
503
|
+
code: "resource_limit",
|
|
504
|
+
message: "Run monitor exceeds the inspection limit",
|
|
505
|
+
retryable: false
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
return value;
|
|
509
|
+
});
|
|
510
|
+
/**
|
|
511
|
+
* Successful command response on the JSON wire.
|
|
512
|
+
* @since 1.0.0
|
|
513
|
+
* @category models
|
|
514
|
+
*/
|
|
515
|
+
export const CommandResponse = Schema.Struct({
|
|
516
|
+
protocol: Schema.Literal(protocol),
|
|
517
|
+
ok: Schema.Literal(true),
|
|
518
|
+
value: Schema.Struct({
|
|
519
|
+
operation: Schema.String,
|
|
520
|
+
applicationRequestId: Schema.String,
|
|
521
|
+
ownerGeneration: Schema.optional(PositiveSafeInteger),
|
|
522
|
+
runtimeArtifactDigest: Schema.optional(Sha256),
|
|
523
|
+
sourceRevision: Schema.optional(SourceRevision),
|
|
524
|
+
planId: Schema.optional(Schema.String),
|
|
525
|
+
planDigest: Schema.optional(Sha256),
|
|
526
|
+
executionDigest: Schema.optional(Sha256),
|
|
527
|
+
envelope: Schema.optional(Schema.Json),
|
|
528
|
+
approval: Schema.optional(ApprovalPayload),
|
|
529
|
+
receipt: Receipt
|
|
530
|
+
})
|
|
531
|
+
});
|
|
532
|
+
/**
|
|
533
|
+
* Successful observation response on the JSON wire.
|
|
534
|
+
* @since 1.0.0
|
|
535
|
+
* @category models
|
|
536
|
+
*/
|
|
537
|
+
export const ObserveResponse = Schema.Struct({
|
|
538
|
+
protocol: Schema.Literal(protocol),
|
|
539
|
+
ok: Schema.Literal(true),
|
|
540
|
+
value: Schema.Struct({
|
|
541
|
+
run: Schema.Struct({
|
|
542
|
+
...RunSummary.fields,
|
|
543
|
+
finalOutput: Schema.optional(Schema.String),
|
|
544
|
+
failureFault: Schema.optional(Fault.Class),
|
|
545
|
+
failureTag: Schema.optional(Schema.String),
|
|
546
|
+
commandReceipt: Schema.optionalKey(CommandReceipt)
|
|
547
|
+
}),
|
|
548
|
+
events: Schema.Array(ControlEvent),
|
|
549
|
+
nextCursor: Schema.String,
|
|
550
|
+
hasMore: Schema.Boolean,
|
|
551
|
+
terminal: Schema.Boolean
|
|
552
|
+
})
|
|
553
|
+
});
|
|
554
|
+
/**
|
|
555
|
+
* Stable sanitized failure response on the JSON wire.
|
|
556
|
+
* @since 1.0.0
|
|
557
|
+
* @category models
|
|
558
|
+
*/
|
|
559
|
+
export const ErrorResponse = Schema.Struct({
|
|
560
|
+
protocol: Schema.Literal(protocol),
|
|
561
|
+
ok: Schema.Literal(false),
|
|
562
|
+
error: Schema.Struct({ code: Schema.String, message: Schema.String, retryable: Schema.Boolean })
|
|
563
|
+
});
|
|
564
|
+
const errorResponse = (cause) => {
|
|
565
|
+
const known = Schema.is(ControlError.ControlErrorSchema)(cause);
|
|
566
|
+
const code = cause instanceof BridgeError || known ? cause.code : "internal";
|
|
567
|
+
const retryable = cause instanceof BridgeError
|
|
568
|
+
? cause.retryable
|
|
569
|
+
: cause instanceof ControlError.TransportError
|
|
570
|
+
? cause.retryable
|
|
571
|
+
: retryableCodes.has(code);
|
|
572
|
+
// Control errors can contain storage paths, SQL diagnostics, or executor
|
|
573
|
+
// output. The bridge publishes their stable code, never that backend text.
|
|
574
|
+
const message = cause instanceof BridgeError ? cause.message : "Runtime bridge failed";
|
|
575
|
+
const status = code === "unauthorized" ?
|
|
576
|
+
401
|
|
577
|
+
: notFoundCodes.has(code) ?
|
|
578
|
+
404
|
|
579
|
+
: conflictCodes.has(code) ?
|
|
580
|
+
409
|
|
581
|
+
: retryable ?
|
|
582
|
+
503
|
|
583
|
+
: code === "internal" ?
|
|
584
|
+
500
|
|
585
|
+
: 400;
|
|
586
|
+
return HttpServerResponse.jsonUnsafe({ protocol, ok: false, error: { code, message, retryable } }, { status });
|
|
587
|
+
};
|
|
588
|
+
/**
|
|
589
|
+
* Answers a failed bridge request with its sanitized response, logging it first.
|
|
590
|
+
*
|
|
591
|
+
* The wire carries only the stable code. The operator log carries the full
|
|
592
|
+
* cause of every failure the caller did not cause, so a launch that failed in
|
|
593
|
+
* storage or in the executor can be diagnosed from the host.
|
|
594
|
+
*/
|
|
595
|
+
const respondToFailure = (operation) => (cause) => {
|
|
596
|
+
const response = errorResponse(cause);
|
|
597
|
+
if (cause instanceof BridgeError)
|
|
598
|
+
return Effect.succeed(response);
|
|
599
|
+
const code = Schema.is(ControlError.ControlErrorSchema)(cause) ? cause.code : "internal";
|
|
600
|
+
return Effect.logError({ message: "Runtime bridge request failed", operation, code, cause }).pipe(Effect.as(response));
|
|
601
|
+
};
|
|
602
|
+
const readJson = Effect.gen(function* () {
|
|
603
|
+
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
604
|
+
const text = yield* request.text;
|
|
605
|
+
return yield* Effect.try({
|
|
606
|
+
try: () => JSON.parse(text),
|
|
607
|
+
catch: () => new BridgeError({ code: "invalid_request", message: "Request body must be JSON", retryable: false })
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
const authenticated = (config, effect) => Effect.gen(function* () {
|
|
611
|
+
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
612
|
+
const principal = yield* config.authenticate(request.headers);
|
|
613
|
+
return yield* effect(principal);
|
|
614
|
+
});
|
|
615
|
+
/**
|
|
616
|
+
* Mounts the authenticated JSON bridge beside the existing gateway RPCs.
|
|
617
|
+
* @since 1.0.0
|
|
618
|
+
* @category layers
|
|
619
|
+
*/
|
|
620
|
+
export const layer = (config) => {
|
|
621
|
+
const command = authenticated(config, (principal) => Effect.gen(function* () {
|
|
622
|
+
const body = yield* readJson;
|
|
623
|
+
const input = yield* decodeCommand(body).pipe(Effect.mapError(() => new BridgeError({
|
|
624
|
+
code: "invalid_request",
|
|
625
|
+
message: "Request does not match the runtime bridge contract",
|
|
626
|
+
retryable: false
|
|
627
|
+
})));
|
|
628
|
+
const control = yield* Control;
|
|
629
|
+
const value = yield* execute(config, control, principal, input);
|
|
630
|
+
return HttpServerResponse.jsonUnsafe({ protocol, ok: true, value });
|
|
631
|
+
})).pipe(Effect.catch(respondToFailure("runtime-bridge.command")), Effect.withSpan("runtime-bridge.command"));
|
|
632
|
+
const observation = authenticated(config, () => Effect.gen(function* () {
|
|
633
|
+
const body = yield* readJson;
|
|
634
|
+
const input = yield* decodeObserve(body).pipe(Effect.mapError(() => new BridgeError({
|
|
635
|
+
code: "invalid_request",
|
|
636
|
+
message: "Request does not match the observation contract",
|
|
637
|
+
retryable: false
|
|
638
|
+
})));
|
|
639
|
+
const control = yield* Control;
|
|
640
|
+
const value = yield* observe(control, input, config.commandReceipt);
|
|
641
|
+
return HttpServerResponse.jsonUnsafe({ protocol, ok: true, value });
|
|
642
|
+
})).pipe(Effect.catch(respondToFailure("runtime-bridge.observe")), Effect.withSpan("runtime-bridge.observe"));
|
|
643
|
+
const inspection = authenticated(config, () => Effect.gen(function* () {
|
|
644
|
+
const body = yield* readJson;
|
|
645
|
+
const input = yield* Schema.decodeUnknownEffect(Schema.Struct({
|
|
646
|
+
protocol: Schema.Literal(protocol),
|
|
647
|
+
runId: Schema.NonEmptyString,
|
|
648
|
+
at: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))
|
|
649
|
+
}))(body).pipe(Effect.mapError(() => new BridgeError({ code: "invalid_request", message: "Invalid monitor request", retryable: false })));
|
|
650
|
+
const control = yield* Control;
|
|
651
|
+
return HttpServerResponse.jsonUnsafe({
|
|
652
|
+
protocol,
|
|
653
|
+
ok: true,
|
|
654
|
+
value: yield* monitor(control, input.runId, input.at)
|
|
655
|
+
});
|
|
656
|
+
})).pipe(Effect.catch(respondToFailure("runtime-bridge.observe")));
|
|
657
|
+
return HttpRouter.add("POST", "/runtime/v1/command", command).pipe(Layer.merge(HttpRouter.add("POST", "/runtime/v1/monitor", inspection)), Layer.merge(HttpRouter.add("POST", "/runtime/v1/observe", observation)));
|
|
658
|
+
};
|
|
659
|
+
//# sourceMappingURL=RuntimeBridge.js.map
|