@smthrs/gateway 0.34.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 -29182
- 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 -61
- 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 -183
- package/src/rpc/index.d.ts +0 -221
- package/src/rpc/index.js +0 -2431
package/docs/api.md
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "API reference"
|
|
3
|
+
description: "Every public export of @smthrs/gateway: the assembled server and its Node host, the served read path, the wire schemas and folds, the RPC group, the diagnosis renderer, and the failure vocabulary."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The gateway requires `effect` at `4.0.0-rc.115` as its only peer. Node and Bun adapters are bundled privately at the same version; hosts need no separate adapter install.
|
|
7
|
+
|
|
8
|
+
The root entry point exports one namespace per module, and every local module is
|
|
9
|
+
also importable from `@smthrs/gateway/<Module>`.
|
|
10
|
+
|
|
11
|
+
A UI depends on this package and on [`@smthrs/control`](/api/control). It never
|
|
12
|
+
depends on [`@smthrs/engine-store`](/api/engine-store), and it never reads a
|
|
13
|
+
store table: a projection is the contract, and a store row is an implementation
|
|
14
|
+
detail. [`smthrs serve`](/cli/serve) composes the assembly with
|
|
15
|
+
`@smthrs/control` and [`@smthrs/sync`](/api/smithers-sync) to host it.
|
|
16
|
+
|
|
17
|
+
The model behind these signatures is in [Projections](./concepts/projections.md),
|
|
18
|
+
[Subscriptions and cursors](./concepts/subscriptions.md), and
|
|
19
|
+
[The trust boundary](./concepts/trust-boundary.md).
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import * as NodeGateway from "@smthrs/gateway/node/NodeGateway"
|
|
25
|
+
import * as Projections from "@smthrs/gateway/Projections"
|
|
26
|
+
import { Layer } from "effect"
|
|
27
|
+
|
|
28
|
+
const health = { workspaceHash: "8f4b2c1d", gatewayId: "host-1", protocolVersion: "1", version: "1.0.0-rc.0" }
|
|
29
|
+
const gateway = NodeGateway.layer(health, NodeGateway.defaultServerOptions).pipe(Layer.provide(Projections.layer))
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## `GatewayServer`
|
|
33
|
+
|
|
34
|
+
The whole HTTP surface as one application layer a host serves.
|
|
35
|
+
|
|
36
|
+
### Mounts
|
|
37
|
+
|
|
38
|
+
`GatewayServer.layer` mounts seven base routes, and `NodeGateway.layer` binds
|
|
39
|
+
them to a socket. A host that supplies `runtimeBridge` adds three authenticated
|
|
40
|
+
JSON routes.
|
|
41
|
+
|
|
42
|
+
| Path | Protocol | Serves |
|
|
43
|
+
| -------------------------- | ------------------ | ----------------------------------------------------- |
|
|
44
|
+
| `POST /rpc` | RPC over HTTP | `@smthrs/control` `ControlRpcs` |
|
|
45
|
+
| `/rpc/ws` | RPC over WebSocket | `ControlRpcs`, including a kept-alive `Watch` |
|
|
46
|
+
| `POST /projections` | RPC over HTTP | `GatewayRpcs` |
|
|
47
|
+
| `/projections/ws` | RPC over WebSocket | `GatewayRpcs`, including `Projection.Subscribe` |
|
|
48
|
+
| `POST /sync` | RPC over HTTP | `@smthrs/sync` `SyncRpcs` |
|
|
49
|
+
| `/sync/ws` | RPC over WebSocket | `SyncRpcs` |
|
|
50
|
+
| `GET /health` | JSON | `GatewayServer.Health` |
|
|
51
|
+
| `POST /runtime/v1/command` | JSON | Versioned launch and Control mutations (optional) |
|
|
52
|
+
| `POST /runtime/v1/observe` | JSON | Bounded journal replay and run projection (optional) |
|
|
53
|
+
| `POST /runtime/v1/monitor` | JSON | Read-only existing-run monitor and journal (optional) |
|
|
54
|
+
|
|
55
|
+
### Scoped tokens
|
|
56
|
+
|
|
57
|
+
A credentialed gateway also accepts a token minted under its credential with
|
|
58
|
+
`@smthrs/control` `ScopedToken` (`smthrs token mint`). The edge admits it on
|
|
59
|
+
its signature and expiry alone, and only toward `NodeGateway.scopedTokenPaths`
|
|
60
|
+
(`/rpc`, `/projections`, their sockets, and `/auth/ticket`); every RPC frame is
|
|
61
|
+
then judged in band against the procedures, run, or flow it names, and it
|
|
62
|
+
stamps `NodeGateway.scopedPrincipal` (`gateway/scoped`), which no delegation to
|
|
63
|
+
`gateway/bearer` covers. Journal sync and the runtime bridge accept the bearer
|
|
64
|
+
alone, and a ticket issued against a scoped token opens only what the token
|
|
65
|
+
could open.
|
|
66
|
+
|
|
67
|
+
### Runtime completion
|
|
68
|
+
|
|
69
|
+
`RuntimeBridge.LifecycleCommand.operation` also accepts `complete` (since
|
|
70
|
+
1.0.0). `RuntimeBridge.Config.requestComplete?:
|
|
71
|
+
ControlExecutor.Service["requestComplete"]` (since 1.0.0) supplies the host port;
|
|
72
|
+
when absent, the bridge uses the installed executor's port. A host without
|
|
73
|
+
either refuses completion as unavailable.
|
|
74
|
+
|
|
75
|
+
### Runtime observation cursors
|
|
76
|
+
|
|
77
|
+
`POST /runtime/v1/observe` returns `nextCursor`; pass it back unchanged as
|
|
78
|
+
`afterCursor` with the same `runId`. An empty cursor consumes no events. A
|
|
79
|
+
decimal cursor, such as `"42"`, consumes the whole journal entry. A versioned
|
|
80
|
+
cursor, such as `"v1:42:0"`, consumes only members through that zero-based
|
|
81
|
+
expansion offset. Both numeric components are canonical nonnegative integers
|
|
82
|
+
below `Number.MAX_SAFE_INTEGER`. Existing decimal cursors remain accepted.
|
|
83
|
+
|
|
84
|
+
`hasMore` indicates another event page; `terminal` independently reports the
|
|
85
|
+
run's current lifecycle. Backend failures retain their stable Control code and
|
|
86
|
+
retryability without exposing backend message text.
|
|
87
|
+
|
|
88
|
+
### Runtime monitor
|
|
89
|
+
|
|
90
|
+
`RuntimeBridge.monitor(control, runId, at?)` reads an existing run through
|
|
91
|
+
`Control.list` and its committed journal through `Control.watch` with
|
|
92
|
+
`follow: false`. It never launches, resumes, signals, or evaluates a flow.
|
|
93
|
+
The authenticated `POST /runtime/v1/monitor` door accepts
|
|
94
|
+
`{ protocol: "smithers.flow-runtime/v1", runId, at? }`; `at` is a nonnegative
|
|
95
|
+
journal sequence. Its response is `{ protocol, ok: true, value }`, or the
|
|
96
|
+
bridge's typed error envelope. Unknown runs return `run_not_found`; bounded
|
|
97
|
+
journal and projection overflow return `resource_limit`.
|
|
98
|
+
|
|
99
|
+
Spend is priced where model calls are metered. A run with journaled model
|
|
100
|
+
tokens returns no `cost_usd`; its steps carry `meter`, the
|
|
101
|
+
`<execution id>:<step key digest>` dispatches each settled node drove, and the
|
|
102
|
+
install prices them from its metered proxy rows. A returned `cost_usd` of zero
|
|
103
|
+
therefore only ever means a run with no model tokens.
|
|
104
|
+
|
|
105
|
+
The current monitor omits the raw journal, which its reader pages from the
|
|
106
|
+
`run-events` projection when the journal tab opens, and carries the run's
|
|
107
|
+
`extent: { start, end }`. A replay frame (`at`) carries its own journal prefix.
|
|
108
|
+
|
|
109
|
+
### Types and constants
|
|
110
|
+
|
|
111
|
+
| Export | Signature | Meaning |
|
|
112
|
+
| ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `Health` | `Schema.Struct` and its type | What `GET /health` answers: gateway identity, package version, and optional non-secret runtime bridge identity. |
|
|
114
|
+
| `LayerOptions` | `{ heartbeatMillis?; ingress?; runtimeBridge? }` | How an assembled gateway is configured. `runtimeBridge` opts into the versioned Go adapter. |
|
|
115
|
+
| `IngressOptions` | `{ maxRequestBodyBytes?: number; loopbackOnly?: boolean; authorize?: (headers, path) => Effect<boolean>; ticketMillis?: number }` | The ingress policy the RPC mounts run behind. |
|
|
116
|
+
| `Ticket` | `Schema.Struct` and its type | What `POST /auth/ticket` answers: `{ ticket, expiresInMs }`, a single-use key that opens one protected socket. |
|
|
117
|
+
| `ticketPath` | `"/auth/ticket"` | Exchanges an accepted bearer for a `Ticket`. Served only when `authorize` is set. |
|
|
118
|
+
| `ticketPaths` | `ReadonlyArray<string>` | `["/rpc/ws", "/projections/ws", "/sync/ws"]`: the sockets a ticket opens as `<mount>?ticket=<ticket>`. |
|
|
119
|
+
| `defaultTicketMillis` | `number` | 30,000. How long an unredeemed ticket stays valid. |
|
|
120
|
+
| `rpcPaths` | `ReadonlyArray<string>` | `["/rpc", "/projections", "/sync"]`: the `POST` mounts that carry RPC request messages. |
|
|
121
|
+
| `boundedPostPaths` | `ReadonlyArray<string>` | RPC mounts plus both runtime bridge routes; every body is bounded before a handler reads it. |
|
|
122
|
+
| `protectedPaths` | `ReadonlyArray<string>` | Projection, sync, WebSocket, and runtime bridge paths that pass edge authentication. |
|
|
123
|
+
| `defaultMaxRequestBodyBytes` | `number` | 1,048,576. The default maximum request body accepted by an RPC mount. |
|
|
124
|
+
| `loopbackHostNames` | `ReadonlyArray<string>` | `["127.0.0.1", "localhost", "::1"]`: the names that mean this machine only, as a bind address is spelled. |
|
|
125
|
+
| `loopbackHostHeaderNames` | `ReadonlyArray<string>` | `["127.0.0.1", "localhost", "[::1]"]`: the same names as a Host header spells them; the default `allowedHosts`. |
|
|
126
|
+
| `watchHeartbeatKind` | `"control.gateway.heartbeat"` | The `ControlEvent` kind a `Watch` keepalive carries. |
|
|
127
|
+
|
|
128
|
+
`POST /rpc` is deliberately not in `protectedPaths`, and `GET /health` is
|
|
129
|
+
deliberately unauthenticated. Both decisions, and the alias handling behind
|
|
130
|
+
`routedPath`, are explained in
|
|
131
|
+
[the trust boundary](./concepts/trust-boundary.md).
|
|
132
|
+
|
|
133
|
+
### Layers
|
|
134
|
+
|
|
135
|
+
| Export | Signature | Provides |
|
|
136
|
+
| --------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
137
|
+
| `layer` | `(health: Health, options?: LayerOptions) => Layer<..., GatewayError, ...>` | The whole surface. Fails with `bind_failed` for a non-positive cadence or body limit. |
|
|
138
|
+
| `layerHealth` | `(health: Health) => Layer<never, never, HttpRouter>` | The unauthenticated `GET /health` probe. |
|
|
139
|
+
| `layerHandlers` | `Layer<Handler<...>, never, Control \| Projections>` | The gateway's own RPC handlers over the read path and the approval mutation. |
|
|
140
|
+
| `layerControlHttp` | `(millis?: number) => Layer<RpcServer.Protocol, never, ...>` | `/rpc` and `/rpc/ws`, with the keepalive merged into `watch`. |
|
|
141
|
+
| `layerProjectionsHttp` | `Layer<RpcServer.Protocol, never, ...>` | `/projections` and `/projections/ws`. Both protocols mount together so they cannot disagree. |
|
|
142
|
+
| `layerSyncHttp` | `Layer<RpcServer.Protocol, never, ...>` | `/sync` and `/sync/ws`. |
|
|
143
|
+
| `layerIngress` | `(options?: IngressOptions) => Layer<...>` | The global middleware: local Host/Origin policy, edge authentication, body limit, and RPC-message check. |
|
|
144
|
+
| `layerKeepAlive` | `(millis?: number) => Layer<Control, never, Control>` | Wraps the ambient `Control` so `watch` emits a keepalive when idle. |
|
|
145
|
+
| `layerProjectionsKeepAlive` | `(millis: number) => Layer<Projections, never, Projections>` | Wraps the ambient `Projections` so a followed subscription beats at the bind's cadence. |
|
|
146
|
+
|
|
147
|
+
`layerKeepAlive` wraps the service rather than re-declaring handlers, which
|
|
148
|
+
keeps `@smthrs/control` `ControlServer` the single definition of what every
|
|
149
|
+
procedure does, including the principal it stamps on mutations.
|
|
150
|
+
|
|
151
|
+
### Functions
|
|
152
|
+
|
|
153
|
+
| Export | Signature | Answers |
|
|
154
|
+
| ------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
155
|
+
| `routedPath` | `(url: string) => string` | The mount a request target reaches, spelled the way `rpcPaths` and `protectedPaths` spell it. |
|
|
156
|
+
| `exceededBodyLimit` | `(error: unknown) => boolean` | Whether a failed body read hit the configured size limit rather than failing for another reason. |
|
|
157
|
+
| `bodyRefusal` | `(path: string, maxBytes: number, error: unknown) => { error: GatewayError; status: number }` | 413 `request_too_large` for an overflow, 400 `malformed_request` for every other read failure. |
|
|
158
|
+
| `carriesRpcRequest` | `(serialization: RpcSerialization["Service"], body: string) => boolean` | Whether a body carries at least one RPC message the server can act on. A binary framing is always yes. |
|
|
159
|
+
|
|
160
|
+
## `node/NodeGateway`
|
|
161
|
+
|
|
162
|
+
The Node host: bind policy, credential policy, and the socket.
|
|
163
|
+
|
|
164
|
+
| Export | Signature | Meaning |
|
|
165
|
+
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
166
|
+
| `ServerOptions` | `ListenOptions & { allowedHosts?: readonly string[]; listen?: boolean; credential?: string; heartbeatMillis?: number; maxRequestBodyBytes?: number }` | Bind address, explicitly admitted Host names, authentication, and request limits. |
|
|
167
|
+
| `defaultServerOptions` | `ServerOptions` | `{ host: "127.0.0.1", port: 7331 }`: loopback, no credential. |
|
|
168
|
+
| `isLoopbackHost` | `(host: string) => boolean` | True for `127.0.0.1`, `::1`, and `localhost`, and nothing else. |
|
|
169
|
+
| `bindRefusal` | `(options: ServerOptions) => GatewayError \| undefined` | The typed `bind_failed` refusal a requested bind earns, or `undefined` when it is allowed. |
|
|
170
|
+
| `listenOptions` | `(options: ServerOptions) => Effect<ListenOptions, GatewayError>` | The admitted `node:net` options, with this module's own fields removed, or that refusal in the error channel. |
|
|
171
|
+
| `ingressOptions` | `(options: ServerOptions) => GatewayServer.IngressOptions` | The Host policy for a bind: the loopback names, `allowedHosts`, and the concrete bind host; a wildcard bind adds nothing. |
|
|
172
|
+
| `layerAuth` | `(options: ServerOptions) => Layer<ControlRpcs.ControlAuth>` | The bearer or a scoped token minted under it when a credential is configured; the loopback-only local operator otherwise. |
|
|
173
|
+
| `bearerPrincipal` | `Readonly<{ id: string; kind: string }>` | The frozen `{ id: "gateway", kind: "bearer" }` identity stamped by shared-bearer authentication. |
|
|
174
|
+
| `scopedPrincipal` | `Readonly<{ id: string; kind: string }>` | The frozen `{ id: "gateway", kind: "scoped" }` identity a verified scoped token stamps. |
|
|
175
|
+
| `scopedTokenPaths` | `ReadonlyArray<string>` | The protected mounts a scoped token may reach at the edge: `/rpc`, `/projections`, their sockets, and `/auth/ticket`. |
|
|
176
|
+
| `layer` | `(health: GatewayServer.Health, options?: ServerOptions) => Layer<..., GatewayError, Control \| SyncAuth \| SyncServer \| Projections>` | The assembled gateway on a Node HTTP server. |
|
|
177
|
+
|
|
178
|
+
`layer` supplies the bind policy, the shared-credential authentication both RPC
|
|
179
|
+
mounts run under, and newline-delimited JSON as the wire serialization. The
|
|
180
|
+
caller supplies `Control`, `Projections`, `SyncServer`, and `SyncAuth`. The
|
|
181
|
+
returned layer retains the concrete `HttpServer` service, so a caller that
|
|
182
|
+
bound port 0 can read the ephemeral address it got. Policy refusals and
|
|
183
|
+
operating-system listen failures both fail the layer as sanitized `bind_failed`
|
|
184
|
+
values.
|
|
185
|
+
|
|
186
|
+
### Bind and credential policy
|
|
187
|
+
|
|
188
|
+
Two rules decide whether a bind is allowed, and both fail closed.
|
|
189
|
+
|
|
190
|
+
1. A non-loopback host requires an explicit `listen` opt-in.
|
|
191
|
+
2. A non-loopback bind requires a bearer credential.
|
|
192
|
+
|
|
193
|
+
A loopback bind with no credential is allowed and is the local default. One
|
|
194
|
+
shared bearer authenticates every mount as `bearerPrincipal`. This does not
|
|
195
|
+
grant approval authority. The owning Control runtime must explicitly delegate
|
|
196
|
+
the allowed approval target kinds and scopes through `ApprovalAuthority`;
|
|
197
|
+
without that delegation, bearer approve and deny requests are unauthorized.
|
|
198
|
+
Every holder of the shared credential has the same delegated authority. See
|
|
199
|
+
[Serve beyond loopback](./guides/serve-beyond-loopback.md).
|
|
200
|
+
|
|
201
|
+
Without that bearer, `NodeGateway.layer` enables `loopbackOnly`: every request
|
|
202
|
+
must carry a loopback `Host`. With or without a bearer, a supplied browser
|
|
203
|
+
`Origin` must be a canonical HTTP(S) origin whose host and port equal the
|
|
204
|
+
request's `Host`; serve a browser client from the gateway's origin or through a
|
|
205
|
+
same-origin proxy. An Origin-less CLI request remains accepted. The same guard runs on HTTP and WebSocket
|
|
206
|
+
upgrades before any mount handles them.
|
|
207
|
+
|
|
208
|
+
## `Projections`
|
|
209
|
+
|
|
210
|
+
The read path, served as bounded snapshots and followed deltas.
|
|
211
|
+
|
|
212
|
+
| Export | Signature | Meaning |
|
|
213
|
+
| ------------------------- | -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
|
214
|
+
| `Projections` | `Context.Service` tagged `@smthrs/gateway/Projections` | The service tag the mounts read through. |
|
|
215
|
+
| `Service` | `{ snapshot; subscribe }` | Read-path operations served by the gateway. |
|
|
216
|
+
| `Service.snapshot` | `<S extends ProjectionSelector>(selector: S, after?: ProjectionCursor) => Effect<SnapshotOf<S>, GatewayError>` | Current rows, or the run-events suffix after `after`, with the current cursor. |
|
|
217
|
+
| `Service.subscribe` | `<S extends ProjectionSelector>(selector: S, after?: ProjectionCursor) => Stream<FrameOf<S>, GatewayError>` | A snapshot followed by deltas and keepalives, or, with `after`, the deltas after that cursor alone. |
|
|
218
|
+
| `make` | `(control: ControlService, options?: { heartbeatMillis?: number }) => Effect<Service, GatewayError>` | Builds the read path over a control plane. Invalid settings are `bind_failed` failures; construction never throws. |
|
|
219
|
+
| `layer` | `Layer<Projections, GatewayError, Control>` | The read path over the ambient control plane, at the default cadence. |
|
|
220
|
+
| `layerWith` | `(options: { heartbeatMillis?: number }) => Layer<Projections, GatewayError, Control>` | The same under an explicit keepalive cadence. |
|
|
221
|
+
| `heartbeatIntervalMillis` | `30_000` | How often an idle subscription emits a keepalive frame. |
|
|
222
|
+
| `maxWorkspaceRuns` | `500` | The most runs one workspace projection folds, newest first. Equals `ControlSchema.maxPageSize`. |
|
|
223
|
+
| `maxEventsPerRun` | `10_000` | The most journal events retained per run; older events enter the carried digest. |
|
|
224
|
+
| `maxEventsPerPage` | `1_000` | The most events one `run-events` page returns. |
|
|
225
|
+
| `maxEventBytes` | `16 * 1024` | Retained event size before clipping. Native engine events on `run-events` pages are exempt. |
|
|
226
|
+
| `maxProjectionBytes` | `4 * 1024 * 1024` | The encoded byte budget for retained events plus digest identity state, an event page, or a projected row set. |
|
|
227
|
+
|
|
228
|
+
`ControlService` is `@smthrs/control` `Control`'s service interface, the shape
|
|
229
|
+
the tag carries.
|
|
230
|
+
|
|
231
|
+
`run-events` pages return complete `control.engine.event` payloads so clients
|
|
232
|
+
can decode native result contracts. Other oversized events are clipped. A
|
|
233
|
+
single encoded event plus its array brackets exceeding `maxProjectionBytes`
|
|
234
|
+
fails with `GatewayError` code `resource_limit`; a full page ends at its cursor.
|
|
235
|
+
|
|
236
|
+
## `GatewaySchema`
|
|
237
|
+
|
|
238
|
+
The wire schemas the read path and its subscriptions speak. Every entry is an
|
|
239
|
+
`effect` `Schema` with a same-named type. Every schema here is served: the
|
|
240
|
+
gateway mints, reads, or answers with each one.
|
|
241
|
+
|
|
242
|
+
### Identity
|
|
243
|
+
|
|
244
|
+
| Export | Fields |
|
|
245
|
+
| --------------- | ----------------------------------------------- |
|
|
246
|
+
| `GatewayHealth` | `workspaceHash`, `gatewayId`, `protocolVersion` |
|
|
247
|
+
|
|
248
|
+
### Selectors
|
|
249
|
+
|
|
250
|
+
| Export | Shape |
|
|
251
|
+
| ----------------------- | ---------------------------------------- |
|
|
252
|
+
| `ProjectionName` | the eight served projection names |
|
|
253
|
+
| `WorkspaceRunsSelector` | `{ _tag: "workspace-runs" }` |
|
|
254
|
+
| `RunSummarySelector` | `{ _tag: "run-summary", runId }` |
|
|
255
|
+
| `RunEventsSelector` | `{ _tag: "run-events", runId }` |
|
|
256
|
+
| `TranscriptSelector` | `{ _tag: "transcript", runId }` |
|
|
257
|
+
| `RunTreeSelector` | `{ _tag: "run-tree", runId }` |
|
|
258
|
+
| `ApprovalsSelector` | `{ _tag: "approvals", runId? }` |
|
|
259
|
+
| `NodeOutputSelector` | `{ _tag: "node-output", runId, nodeId }` |
|
|
260
|
+
| `FlowDurationsSelector` | `{ _tag: "flow-durations", flowId }` |
|
|
261
|
+
| `ProjectionSelector` | the union of the eight |
|
|
262
|
+
|
|
263
|
+
`ApprovalsSelector` without `runId` lists the workspace's pending gates, which
|
|
264
|
+
is the approvals inbox. With one it lists that run's gates including the decided
|
|
265
|
+
ones, which is what a run card renders.
|
|
266
|
+
|
|
267
|
+
`FlowDurationsSelector` is the one selector scoped to a flow rather than to a
|
|
268
|
+
run. It ranks the durations the flow's newest finished runs measured, so a
|
|
269
|
+
client reads it once when it opens a card and again when a run finishes, never
|
|
270
|
+
inside a poll loop.
|
|
271
|
+
|
|
272
|
+
`rowSchemaFor<S extends ProjectionSelector>(selector: S)` answers the schema of
|
|
273
|
+
the rows that selector projects, so a client decodes a snapshot instead of
|
|
274
|
+
casting it. A literal selector keeps its own row: `rowSchemaFor({ _tag:
|
|
275
|
+
"approvals" })` is `ApprovalRow`, not the union of every row. `RowOf<S>` is that
|
|
276
|
+
row's type.
|
|
277
|
+
|
|
278
|
+
### Cursors, snapshots, and frames
|
|
279
|
+
|
|
280
|
+
`Projection.Snapshot` accepts optional `after: ProjectionCursor` for
|
|
281
|
+
`run-events` only. It returns rows strictly after that sequence and offset,
|
|
282
|
+
with the cursor the read reached. An unchanged journal returns no rows, and so
|
|
283
|
+
does a cursor at or past the journal's head. The cursor must belong to the same
|
|
284
|
+
selector and run; other selectors with `after` return `malformed_request`.
|
|
285
|
+
Omit `after` for the first page: the empty cursor `0:0` also names the first
|
|
286
|
+
sequence-zero event.
|
|
287
|
+
|
|
288
|
+
A `run-events` snapshot is a PAGE, not the whole journal. It carries at most
|
|
289
|
+
`maxEventsPerPage` events and `maxProjectionBytes`, whichever binds first, and
|
|
290
|
+
the cursor it answers with names the last event it carried. A reader pages by
|
|
291
|
+
passing that cursor back until a page comes back empty. Every other selector
|
|
292
|
+
answers rows whose size the selector bounds, so it reads the reconciled source
|
|
293
|
+
and needs no paging.
|
|
294
|
+
|
|
295
|
+
| Export | Shape |
|
|
296
|
+
| -------------------- | -------------------------------------------------------------------------- |
|
|
297
|
+
| `ProjectionCursor` | `{ selector, projection, runId: string \| null, value: int, offset: int }` |
|
|
298
|
+
| `ProjectionSnapshot` | `{ selector, cursor, rows }`, correlated on the selector |
|
|
299
|
+
| `SnapshotStartFrame` | `{ _tag: "snapshot-start", selector, cursor }` |
|
|
300
|
+
| `RowFrame` | `{ _tag: "row", selector, cursor, row }` |
|
|
301
|
+
| `SnapshotEndFrame` | `{ _tag: "snapshot-end", selector, cursor }` |
|
|
302
|
+
| `DeltaFrame` | `{ _tag: "delta", selector, cursor, delta }` |
|
|
303
|
+
| `HeartbeatFrame` | `{ _tag: "heartbeat", atMs }` |
|
|
304
|
+
| `GatewayFrame` | the union of all five frame kinds |
|
|
305
|
+
|
|
306
|
+
`ProjectionSnapshot`, `RowFrame`, and `DeltaFrame` are unions correlated on the
|
|
307
|
+
selector, so a payload whose rows do not belong to its selector does not decode.
|
|
308
|
+
One table in `GatewaySchema` pairs each selector with its row, and those three
|
|
309
|
+
unions, `ProjectionName`, and `rowSchemaFor` all derive from it.
|
|
310
|
+
`runId` is `null` for a workspace cursor, whose `value` is always 0, because
|
|
311
|
+
control journal sequences belong to per-run partitions and no workspace-wide
|
|
312
|
+
sequence exists.
|
|
313
|
+
|
|
314
|
+
`SnapshotOf<S>` is the snapshot one selector answers with and `FrameOf<S>` the
|
|
315
|
+
frames its subscription emits, so a literal selector keeps its own rows. A
|
|
316
|
+
selector chosen at runtime maps to the full `ProjectionSnapshot` and
|
|
317
|
+
`GatewayFrame` unions, which is what it can be answered with.
|
|
318
|
+
|
|
319
|
+
## `GatewayProjection`
|
|
320
|
+
|
|
321
|
+
The stable wire rows and the pure folds that compute them. Nothing here exposes
|
|
322
|
+
a store row, a database column, or an engine type.
|
|
323
|
+
|
|
324
|
+
### Rows
|
|
325
|
+
|
|
326
|
+
| Export | Carries |
|
|
327
|
+
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
328
|
+
| `RunSummaryRow` | `runId`, `flowId`, `status`, `statusRollup` (the `@smthrs/control` `Health.StatusRollup` a status surface renders; optional on the wire, folded on every row the gateway serves), `createdAt`, `updatedAt`, the optional plan, lineage, waiting, steering, cancellation, and seat fields, the activity and token counters, `verdict`, `diagnosis`, and `finalOutput`. |
|
|
329
|
+
| `RunTreeRow` | `runId`, `nodeId`, `label`, `status` (`running`, `completed`, `failed`), `seat?`, `startedAt`, `endedAt?`, `parentRunId?`. |
|
|
330
|
+
| `ApprovalRow` | `runId`, `requestId`, `title`, `request`, `payload` (the `ControlSchema.ApprovalPayload` a client submits back), `requestedAt`, `status`. |
|
|
331
|
+
| `NodeOutputRow` | `runId`, `nodeId`, `outcome` (`success` or `failure`), `output`, `settledAt`. |
|
|
332
|
+
| `TranscriptRow` | `runId`, `sequence`, `turn`, `at`, `kind`, `text`. Each `text` is one display line. |
|
|
333
|
+
|
|
334
|
+
### Folds
|
|
335
|
+
|
|
336
|
+
| Export | Signature | Notes |
|
|
337
|
+
| -------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
338
|
+
| `runSummary` | `(run: ControlSchema.RunSummary, events, now?) => RunSummaryRow` | Status comes from the run row, everything else from the events. `now` expires the health reading; it defaults to the later of the row's `updatedAt` and the last event. |
|
|
339
|
+
| `statusRollup` | `(run: ControlSchema.RunSummary, events, now) => Health.StatusRollup` | Lifecycle from the run row; activity and observed health from the current incarnation's highest evidence sequence, with durable sequence breaking ties. Freshness also requires a successful reading whose evidence covers later progress and whose lifetime includes `now`. Stale readings retain provenance but cannot establish activity. A malformed observation or one from a former owner colors nothing. |
|
|
340
|
+
| `runTree` | `(run: ControlSchema.RunSummary, events) => ReadonlyArray<RunTreeRow>` | Keys each call by the ordinal it opened on; pairs a settlement with the oldest open call of that flow name. |
|
|
341
|
+
| `approvals` | `(events) => ReadonlyArray<ApprovalRow>` | A decision closes the gate its `tokenId` names; one naming neither field closes the oldest pending gate. |
|
|
342
|
+
| `nodeOutput` | `(events) => ReadonlyArray<NodeOutputRow>` | Keyed the way `runTree` keys its rows, so both agree on a node id. |
|
|
343
|
+
| `transcript` | `(events) => ReadonlyArray<TranscriptRow>` | One row per `control.run.*`, `control.agent.*`, and approval-request event, numbered by turn. |
|
|
344
|
+
|
|
345
|
+
`statusRollup` is an additive optional wire field. Existing Effect decoders
|
|
346
|
+
strip unknown properties by default, and current clients still decode older
|
|
347
|
+
rows without it. The app validates the subject and lifecycle, expires stale
|
|
348
|
+
activity, and falls back to the existing status when the field is absent.
|
|
349
|
+
Clients configured to reject unknown properties must admit this field before
|
|
350
|
+
reading the newer wire shape.
|
|
351
|
+
|
|
352
|
+
Every fold takes `ReadonlyArray<ControlSchema.ControlEvent>` in run order and is
|
|
353
|
+
total: an unknown kind contributes nothing.
|
|
354
|
+
|
|
355
|
+
## `GatewayRpcs`
|
|
356
|
+
|
|
357
|
+
The gateway's own remote procedures. Control mutations are not re-declared here:
|
|
358
|
+
`@smthrs/control` `ControlRpcs` is the mutation contract, and the gateway mounts
|
|
359
|
+
it unchanged on `/rpc`. The group shares `ControlRpcs.ControlAuth`, so one
|
|
360
|
+
bearer credential authenticates both mounts.
|
|
361
|
+
|
|
362
|
+
| Procedure | Payload | Success | Error |
|
|
363
|
+
| ---------------------- | --------------------------------- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
364
|
+
| `Projection.Snapshot` | `{ selector }` | `ProjectionSnapshot` | `GatewayError` |
|
|
365
|
+
| `Projection.Subscribe` | `{ selector, after? }`, streaming | `GatewayFrame` | `GatewayError` |
|
|
366
|
+
| `Approval.Submit` | `SubmitApprovalInput` | `SubmitApprovalOutput` | `PlanDigestMismatch`, `EnvelopeMismatch`, `AlreadyResolved`, `PlanNotFound`, `RunNotFound`, `InvalidInput`, `Unauthorized`, `PersistenceError`, `Unavailable`, `TransportError` |
|
|
367
|
+
| `Run.Fork` | `RunHistory.ForkInput` | `RunHistory.ForkOutput` | `HistoryRefused`, `Unauthorized`, `Unavailable` |
|
|
368
|
+
| `Run.Verify` | `RunHistory.VerifyInput` | `RunHistory.VerifyReport` | `HistoryRefused`, `Unauthorized`, `Unavailable` |
|
|
369
|
+
|
|
370
|
+
| Export | Shape |
|
|
371
|
+
| ---------------------- | --------------------------------------------------------- |
|
|
372
|
+
| `Decision` | `"approve" \| "deny"` |
|
|
373
|
+
| `SubmitApprovalInput` | `ControlSchema.ApprovalPayload` fields plus `decision` |
|
|
374
|
+
| `SubmitApprovalOutput` | `{ decision: ControlSchema.Receipt }` |
|
|
375
|
+
| `GatewayRpcs` | the `RpcGroup`, with `ControlRpcs.ControlAuth` middleware |
|
|
376
|
+
|
|
377
|
+
`Approval.Submit` is the transport form of Control's single decision command.
|
|
378
|
+
Control records the decision and its durable resume delegation as one domain
|
|
379
|
+
command; the gateway never composes a second mutation, and its error union is
|
|
380
|
+
exactly the one `Control.approve` and `Control.deny` declare. See
|
|
381
|
+
[Submit an approval from a client](./guides/submit-an-approval.md).
|
|
382
|
+
|
|
383
|
+
`Run.Fork` and `Run.Verify` are served by the host that owns the project's
|
|
384
|
+
stores, through `RunHistory`; see below.
|
|
385
|
+
|
|
386
|
+
## `RunHistory`
|
|
387
|
+
|
|
388
|
+
A run's recorded history as the gateway serves it. `Run.Fork` branches a run at
|
|
389
|
+
the exact journal sequence `at` into a parked child, optionally with one step's
|
|
390
|
+
recorded result replaced; `Run.Verify` reports what resuming a run under the
|
|
391
|
+
current flow code would replay and what it would execute again. They answer
|
|
392
|
+
exactly what `smthrs runs fork` and `smthrs runs verify` print, because
|
|
393
|
+
`smthrs serve` implements the service over the same history library. A gateway
|
|
394
|
+
composed without the service answers both `Unavailable`. Both procedures are
|
|
395
|
+
in the `write:runs` token scope, and an anonymous loopback caller is
|
|
396
|
+
`Unauthorized`: a fork writes a durable run and a verification drives the
|
|
397
|
+
project's flow code.
|
|
398
|
+
|
|
399
|
+
| Export | Shape |
|
|
400
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
401
|
+
| `Step` | `{ stepKeyDigest, action?, node? }` |
|
|
402
|
+
| `VerifyInput` | `{ runId }` |
|
|
403
|
+
| `VerifyReport` | `{ runId, verdict: "consistent" \| "divergent", replayed, resumes?, executes?, notReplayed }` |
|
|
404
|
+
| `StepEdit` | `{ stepKeyDigest, result }` |
|
|
405
|
+
| `ForkInput` | `{ runId, at, lineage?, step?: StepEdit }` |
|
|
406
|
+
| `ForkOutput` | `{ runId, parentRunId, status: "parked" }` |
|
|
407
|
+
| `HistoryRefused` | the host's refusal: the CLI's stable `code` and sentence (`history_missing`, `history_frame_missing`, `run_active`, ...) |
|
|
408
|
+
| `Service` | `{ fork(input), verify(input) }` |
|
|
409
|
+
| `RunHistory` | the service tag a host provides |
|
|
410
|
+
|
|
411
|
+
A divergent report is an answer, not a failure: the CLI exits 1 with
|
|
412
|
+
`run_divergent` for it, while `Run.Verify` returns the report so a client can
|
|
413
|
+
show which recorded steps would not replay.
|
|
414
|
+
|
|
415
|
+
## `Diagnosis`
|
|
416
|
+
|
|
417
|
+
What happened to a run, computed from that run's own control events. This is
|
|
418
|
+
the one fold both surfaces read: `@smthrs/cli` `Forensics` calls `digest` and
|
|
419
|
+
adds what a terminal card needs on top of it, so the served row and
|
|
420
|
+
[`smthrs runs show`](/cli/runs) cannot disagree about a run's counts, refusals,
|
|
421
|
+
or clipping.
|
|
422
|
+
|
|
423
|
+
| Export | Signature | Answers |
|
|
424
|
+
| ---------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
425
|
+
| `Digest` | interface | Status, cause, seat, turn and call counts, edits, refusals, tokens, final output, pending question, and the span the events cover. |
|
|
426
|
+
| `Refusal` | `{ message: string; count: number }` | One refused flow call, aggregated by its message. |
|
|
427
|
+
| `Subject` | `{ runId: string; flowId?: string }` | The identity a diagnosis is rendered for. |
|
|
428
|
+
| `RunStatus` | `ControlSchema.RunStatus` | The run statuses a digest may report. |
|
|
429
|
+
| `digest` | `(events, runId?) => Digest` | The facts. Total: an unknown kind contributes nothing, including its timestamp. With `runId`, a `control.run.*` verdict stamped with another run's id is skipped. |
|
|
430
|
+
| `resolvedOutput` | `(value: Pick<Digest, "finalOutput" \| "nativeResolution">) => string \| undefined` | Assistant output first, otherwise a committed native result matching the host's root binding. |
|
|
431
|
+
| `verdict` | `(value: Digest) => string` | One line: the status plus the reason that most explains it. |
|
|
432
|
+
| `duration` | `(span: Pick<Digest, "startedAt" \| "endedAt">) => string` | The wall-clock span the handled events cover, as `12s` or `3m 04s`. |
|
|
433
|
+
| `usd` | `(value: number) => string` | A USD amount: `$12.34` from one dollar, `$0.0042` below it. |
|
|
434
|
+
| `render` | `(subject: Subject, value: Digest) => string` | The whole card: verdict, activity evidence, tokens, cost, refusals, cause, and output. |
|
|
435
|
+
| `asRecord` | `(value: unknown) => Record<string, unknown>` | A wire payload as a record, or an empty record when it is not one. |
|
|
436
|
+
| `asString` | `(value: unknown) => string \| undefined` | A payload field as a string, or nothing. |
|
|
437
|
+
| `asNumber` | `(value: unknown) => number \| undefined` | A payload field as a number, or nothing. |
|
|
438
|
+
| `timeOf` | `(event) => number` | When an event occurred: its payload's own stamp, else journal admission time. |
|
|
439
|
+
| `firstLine` | `(text: string) => string` | The first line, whichever line ending produced it, so a CRLF cause loses its carriage return. |
|
|
440
|
+
| `clip` | `(text: string, width: number) => string` | Truncation on code points, never on UTF-16 code units, marking the cut with an ellipsis. |
|
|
441
|
+
|
|
442
|
+
`RunSummaryRow.verdict` and `RunSummaryRow.diagnosis` are `verdict` and `render`
|
|
443
|
+
already applied, so a client rendering a run card calls neither. See
|
|
444
|
+
[Diagnose what happened to a run](./guides/diagnose-a-run.md).
|
|
445
|
+
|
|
446
|
+
`emptyDigest()` is the identity for `combine(earlier, later)`. Digests retain
|
|
447
|
+
private in-memory scalar identity contributions so adjacent ranges deduplicate
|
|
448
|
+
replayed calls and checkpoints and prefer native facts over telemetry. Keep the
|
|
449
|
+
returned digest objects when combining ranges; serialized or spread copies
|
|
450
|
+
retain only aggregate facts, not this reconciliation state. Gateway projection
|
|
451
|
+
retention charges this state to the existing byte budget and returns
|
|
452
|
+
`resource_limit` if exact state cannot fit.
|
|
453
|
+
|
|
454
|
+
`Digest.nativeResolution` optionally retains `binding: { runId, executionId }`,
|
|
455
|
+
`result: { runId, executionId, text }`, and `conflict: true` across bounded
|
|
456
|
+
journal windows. `combine` preserves this evidence. `resolvedOutput` accepts
|
|
457
|
+
only an unambiguous committed success for the bound `agent/run` root, ignoring
|
|
458
|
+
child results and telemetry. String results remain strings; other JSON values
|
|
459
|
+
are serialized. `RunSummaryRow.finalOutput`, `verdict`, and `diagnosis` use
|
|
460
|
+
this resolved output.
|
|
461
|
+
|
|
462
|
+
## `GatewayError`
|
|
463
|
+
|
|
464
|
+
| Export | Signature | Meaning |
|
|
465
|
+
| ------------------ | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
466
|
+
| `GatewayErrorCode` | nine literals | The whole failure vocabulary. |
|
|
467
|
+
| `GatewayError` | `Schema.TaggedError` tagged `@smthrs/gateway/GatewayError` | `{ code, message, cause? }`, where `cause` is a `{ _tag, code? }` summary and nothing more. |
|
|
468
|
+
| `settingRefusal` | `(name: string, value: number \| undefined) => GatewayError \| undefined` | The refusal a numeric setting earns when it is not a positive safe integer. |
|
|
469
|
+
|
|
470
|
+
Every code is constructed by a real path, and the declared vocabulary is exactly
|
|
471
|
+
the set those paths produce.
|
|
472
|
+
|
|
473
|
+
| Code | Status | Produced by |
|
|
474
|
+
| ------------------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
475
|
+
| `bind_failed` | none | `NodeGateway.bindRefusal`, `NodeGateway.listenOptions`, `GatewayServer.layer`, `GatewayServer.layerIngress`, and `Projections.make`, at composition time |
|
|
476
|
+
| `invalid_host` | 421 | the ingress guard, when `Host` is not in `allowedHosts`, or under `loopbackOnly` does not name `localhost`, `127.0.0.1`, or `[::1]` |
|
|
477
|
+
| `invalid_origin` | 403 | the ingress guard, when a supplied browser `Origin` is not a canonical HTTP(S) origin whose host and port equal the request's `Host` |
|
|
478
|
+
| `unauthorized` | 401 | the ingress guard, on any protected path without the configured credential |
|
|
479
|
+
| `malformed_request` | 400 | the ingress guard, for a `POST` body carrying no RPC request message or a body it could not read, and the read path, for an invalid resume cursor |
|
|
480
|
+
| `request_too_large` | 413 | the ingress guard, for a body over the configured limit |
|
|
481
|
+
| `resource_limit` | none | the read path, when one run or projected row set exceeds its event or encoded-byte allowance |
|
|
482
|
+
| `run_unavailable` | none | the read path, when listing runs, reading a run's events, or following a run or the workspace failed |
|
|
483
|
+
| `run_not_found` | none | the read path, for a run the control plane does not have, identically for every run-scoped selector |
|
|
484
|
+
|
|
485
|
+
`GatewayError.cause` carries only a redacted summary of an internal failure: its
|
|
486
|
+
tag and its stable code. Projection warnings log an allowlisted operation
|
|
487
|
+
identifier and known control error tag/code pairs. Backend messages, nested
|
|
488
|
+
causes, SQL, and file paths are omitted from projection logs.
|
|
489
|
+
|
|
490
|
+
## `Sync`
|
|
491
|
+
|
|
492
|
+
The root entry re-exports [`@smthrs/sync`](/api/smithers-sync) whole, so a gateway host
|
|
493
|
+
gets the read-only journal replication protocol from the same import:
|
|
494
|
+
`SyncClient`, `SyncServer`, `SyncProtocol`, `SyncRpcs`, `SyncError`,
|
|
495
|
+
`RunCatalog`, and the rest of that package's namespaces.
|
|
496
|
+
|
|
497
|
+
Sync is read-only in both senses: a follower cannot mutate a run, and it cannot
|
|
498
|
+
resume one. See [Sync and read-only followers](/docs/concepts/sync/).
|
|
499
|
+
|
|
500
|
+
## `RunTrace`
|
|
501
|
+
|
|
502
|
+
The pure journal projection shared by the app and terminal monitors. Import
|
|
503
|
+
`@smthrs/gateway/RunTrace`; it requires no server or filesystem. Records without
|
|
504
|
+
evidence do not acquire invented phases, successful checks, or file changes.
|
|
505
|
+
|
|
506
|
+
- `traceFromJournal(run, records, options?)` builds a `TraceModel`: nested
|
|
507
|
+
spans, frame summaries, phase bands, milestone pins, and discipline notes.
|
|
508
|
+
- `monitorFromJournal(run, records, at?)` adapts that same fold to the install
|
|
509
|
+
monitor: recorded step instances, deterministic phases, approval, sleep and deferred signal waits,
|
|
510
|
+
bookkeeping and the raw journal. Steps are the nodes that dispatched an
|
|
511
|
+
action; plan structure (`AndThen`, `Branch`, `Map` and the rest) and
|
|
512
|
+
child-flow calls, whose own nodes are the steps, are not steps. A phase's
|
|
513
|
+
title is its label plus the failures its recorded check receipts report
|
|
514
|
+
("Ran checks · 1 failed"). Bookkeeping nodes appear only in the Engine row;
|
|
515
|
+
graph edges through them retain the visible dependency order. Declared native graph pages retain
|
|
516
|
+
unreached nodes and dependency edges; recorded node instances supply their
|
|
517
|
+
live states. Rescheduled native nodes retain separate instance keys. A replay
|
|
518
|
+
folds only records through `at`, derives terminal
|
|
519
|
+
state from that prefix, and returns `replay: { at, last }`. It does not fetch
|
|
520
|
+
a registry or execute presentation code. Each settled native step lists the
|
|
521
|
+
dispatches it drove (`meter`), its journaled model calls and tokens, and its
|
|
522
|
+
agent transcript as phase cells: model replies, cells with what they printed,
|
|
523
|
+
and tool calls labelled by their recorded presentation ("Read t5.md"). The
|
|
524
|
+
current adapter does not yet reconstruct all native wait kinds;
|
|
525
|
+
Clock and deferred waits use typed native lifecycle observations, clock
|
|
526
|
+
registrations and explicit deferred settlements. Deferred identities have no
|
|
527
|
+
recorded question, pause or external-job classification and remain signals.
|
|
528
|
+
Running or completed execution status alone never settles a wait. Repeated registrations retain the opening timestamp, generations
|
|
529
|
+
have separate identities, and replay hides settlements beyond its cursor;
|
|
530
|
+
callers price `meter` dispatches as described above.
|
|
531
|
+
- `inspectLabel(tag)` reads the build-generated Appendix C Inspect rendering.
|
|
532
|
+
Coding call and native execution spans use the same labels. Dynamic
|
|
533
|
+
`<cell-call:flow>` wrappers use the wrapped action's rendering; unknown
|
|
534
|
+
historical tags keep their recorded id. Inspection and replay read data only.
|
|
535
|
+
- `traceFold(run, records?)` holds the same fold open. `traceFoldStep(fold,
|
|
536
|
+
record)` adds one record at the cost of that record; `traceFoldSync(fold, run,
|
|
537
|
+
records)` steps only what a grown journal appended; `traceFoldModel(fold,
|
|
538
|
+
status)` returns the model `traceFromJournal` would build for the same records.
|
|
539
|
+
A record out of sequence order, or a native fact that supersedes earlier
|
|
540
|
+
telemetry, refolds the journal. `TraceFold` types the handle.
|
|
541
|
+
- `runMemoryOf(records)` folds the `relevance-settled` rows into the memory a
|
|
542
|
+
run was brought and the memory Jev withheld, by id and relevance, most
|
|
543
|
+
relevant first; undefined when Jev never read. `RunMemory` and `MemoryItem`
|
|
544
|
+
type it. `smthrs status` prints the same fold.
|
|
545
|
+
- `turnNarratives(model)` derives concise recorded turn text. `spanPath(model,
|
|
546
|
+
id)` finds recorded ancestry. `durationWords(ms)` formats elapsed time.
|
|
547
|
+
- `waterfallGeometry`, `phaseExtent`, and `phaseBandGeometry` calculate layout
|
|
548
|
+
from recorded time. Historical inspection folds a journal prefix while the
|
|
549
|
+
full trace supplies stable geometry.
|
|
550
|
+
- `callSubject` and `callSemantics` interpret captured flow descriptors, with
|
|
551
|
+
compatibility for older records. `CallMetadata` names their descriptor fields.
|
|
552
|
+
- `spanMatches`, `traceFiltersFor`, `isTraceFilter`, and `TRACE_FILTER_IDS` own
|
|
553
|
+
the shared filter vocabulary (`all`, `running`, `failed`, `model`, `flow`,
|
|
554
|
+
`messages`). Historical fork spans remain readable without a fork filter. `TraceFilter` and `TraceView` type that state.
|
|
555
|
+
- `JournalRecord`, `TraceRun`, `TraceOptions`, `TraceSpan`, `TranscriptCell`, `SpanKind`,
|
|
556
|
+
`SpanStatus`, `SpanDetail`, `TraceExtent`, `PhaseId`, `PhaseBand`, `Milestone`,
|
|
557
|
+
`TraceOwner`, `FrameLine`, `TraceNote`, and `TurnNarrative` describe the
|
|
558
|
+
projection. `TranscriptCell` records one agent action inside a native step:
|
|
559
|
+
its kind, label, optional code or output, model tokens, duration, and tone.
|
|
560
|
+
`TraceBuilder` is the mutable draft used while folding, never a
|
|
561
|
+
persisted graph or a second execution model.
|
|
562
|
+
|
|
563
|
+
The install monitor folds `flows.run.presentation` records from the machine's
|
|
564
|
+
native journal. A machine declares its custom view with `{ "kind": "text", "text":
|
|
565
|
+
"Hello, Ada" }` (at most 65,536 characters). The shipped Run Container renders
|
|
566
|
+
that text as an escaped custom slot beside the graph. Unsupported kinds and
|
|
567
|
+
extra fields are refused; repository modules and HTML are never loaded. Replay
|
|
568
|
+
uses the last declaration in its selected journal prefix, and a run without a
|
|
569
|
+
declaration has no custom slot. Host-priced `steps[].usage` supplies dollar
|
|
570
|
+
costs; repeated instances of a step are summed, while unpriced steps omit cost.
|
|
571
|
+
|
|
572
|
+
## `RunDevTools`
|
|
573
|
+
|
|
574
|
+
`@smthrs/gateway/RunDevTools` is the DevTools projection: a run inspected
|
|
575
|
+
like a component tree, as a view over the `RunTrace` model the run card, the
|
|
576
|
+
terminal and `smthrs runs devtools` already fold. `devTools(model)` is the tree
|
|
577
|
+
(`DevToolsModel`: one `DevToolsNode` per span with its measured timing, the
|
|
578
|
+
run's counts and wall time); `inspect(model, id?, options?)` is one node's
|
|
579
|
+
`DevToolsInspection` (recorded input, output, script, printed text, failure,
|
|
580
|
+
seat, tokens, child run, opening event, remaining fields, and the newest
|
|
581
|
+
`DevToolsFrame` records written while it was open, bounded by
|
|
582
|
+
`DevToolsOptions.frames`, `defaultFrameLimit` by default); `framesOf(model,
|
|
583
|
+
span)` is that frame rule alone; `lines(model, selected?, options?)` renders
|
|
584
|
+
the tree and the inspection as text for a terminal. Pure: no server, no
|
|
585
|
+
filesystem, no clock.
|
|
586
|
+
|
|
587
|
+
## `EngineTrace`
|
|
588
|
+
|
|
589
|
+
`@smthrs/gateway/EngineTrace` decodes native journal envelopes through the
|
|
590
|
+
contracts that wrote them. `engineTraceFromJournal(records)` produces spans;
|
|
591
|
+
`engineExecutionEvidence(records)` returns typed `EngineExecutionEvidence` for
|
|
592
|
+
result projections. `engineRunEvidence(records, rootId, cursorSeq?)` limits
|
|
593
|
+
facts to recorded ancestry and the inspection cursor. `engineProjectionPending`
|
|
594
|
+
reports unfinished observation independently of the run's terminal verdict.
|
|
595
|
+
|
|
596
|
+
## Host branch presence
|
|
597
|
+
|
|
598
|
+
`HostBranchPresence.layer(config)` composes the authenticated native host's
|
|
599
|
+
`/branch` presence RPCs and lease roster. It requires `RuntimeBridge.Config`
|
|
600
|
+
authentication on every RPC and refuses non-presence operations as `unsupported`.
|
|
601
|
+
This is a host adapter used by `GatewayServer`, rather than a package export path.
|