@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.
Files changed (605) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/LICENSE +1 -1
  3. package/README.md +92 -0
  4. package/dist/cjs/Diagnosis.d.ts +275 -0
  5. package/dist/cjs/Diagnosis.d.ts.map +1 -0
  6. package/dist/cjs/Diagnosis.js +476 -0
  7. package/dist/cjs/Diagnosis.js.map +7 -0
  8. package/dist/cjs/EngineTrace.d.ts +76 -0
  9. package/dist/cjs/EngineTrace.d.ts.map +1 -0
  10. package/dist/cjs/EngineTrace.js +509 -0
  11. package/dist/cjs/EngineTrace.js.map +7 -0
  12. package/dist/cjs/GatewayError.d.ts +54 -0
  13. package/dist/cjs/GatewayError.d.ts.map +1 -0
  14. package/dist/cjs/GatewayError.js +51 -0
  15. package/dist/cjs/GatewayError.js.map +7 -0
  16. package/dist/cjs/GatewayProjection.d.ts +480 -0
  17. package/dist/cjs/GatewayProjection.d.ts.map +1 -0
  18. package/dist/cjs/GatewayProjection.js +471 -0
  19. package/dist/cjs/GatewayProjection.js.map +7 -0
  20. package/dist/cjs/GatewayRpcs.d.ts +1886 -0
  21. package/dist/cjs/GatewayRpcs.d.ts.map +1 -0
  22. package/dist/cjs/GatewayRpcs.js +121 -0
  23. package/dist/cjs/GatewayRpcs.js.map +7 -0
  24. package/dist/cjs/GatewaySchema.d.ts +3274 -0
  25. package/dist/cjs/GatewaySchema.d.ts.map +1 -0
  26. package/dist/cjs/GatewaySchema.js +141 -0
  27. package/dist/cjs/GatewaySchema.js.map +7 -0
  28. package/dist/cjs/GatewayServer.d.ts +427 -0
  29. package/dist/cjs/GatewayServer.d.ts.map +1 -0
  30. package/dist/cjs/GatewayServer.js +428 -0
  31. package/dist/cjs/GatewayServer.js.map +7 -0
  32. package/dist/cjs/HostBranchPresence.d.ts +19 -0
  33. package/dist/cjs/HostBranchPresence.d.ts.map +1 -0
  34. package/dist/cjs/HostBranchPresence.js +82 -0
  35. package/dist/cjs/HostBranchPresence.js.map +7 -0
  36. package/dist/cjs/Projections.d.ts +209 -0
  37. package/dist/cjs/Projections.d.ts.map +1 -0
  38. package/dist/cjs/Projections.js +906 -0
  39. package/dist/cjs/Projections.js.map +7 -0
  40. package/dist/cjs/RunDevTools.d.ts +181 -0
  41. package/dist/cjs/RunDevTools.d.ts.map +1 -0
  42. package/dist/cjs/RunDevTools.js +195 -0
  43. package/dist/cjs/RunDevTools.js.map +7 -0
  44. package/dist/cjs/RunHistory.d.ts +185 -0
  45. package/dist/cjs/RunHistory.d.ts.map +1 -0
  46. package/dist/cjs/RunHistory.js +68 -0
  47. package/dist/cjs/RunHistory.js.map +7 -0
  48. package/dist/cjs/RunTrace.d.ts +753 -0
  49. package/dist/cjs/RunTrace.d.ts.map +1 -0
  50. package/dist/cjs/RunTrace.js +1595 -0
  51. package/dist/cjs/RunTrace.js.map +7 -0
  52. package/dist/cjs/RuntimeBridge.d.ts +1386 -0
  53. package/dist/cjs/RuntimeBridge.d.ts.map +1 -0
  54. package/dist/cjs/RuntimeBridge.js +598 -0
  55. package/dist/cjs/RuntimeBridge.js.map +7 -0
  56. package/dist/cjs/bun/BunGateway.d.ts +20 -0
  57. package/dist/cjs/bun/BunGateway.d.ts.map +1 -0
  58. package/dist/cjs/bun/BunGateway.js +62 -0
  59. package/dist/cjs/bun/BunGateway.js.map +7 -0
  60. package/dist/cjs/index.d.ts +65 -0
  61. package/dist/cjs/index.d.ts.map +1 -0
  62. package/dist/cjs/index.js +59 -0
  63. package/dist/cjs/index.js.map +7 -0
  64. package/dist/cjs/internal/NativeGateway.d.ts +176 -0
  65. package/dist/cjs/internal/NativeGateway.d.ts.map +1 -0
  66. package/dist/cjs/internal/NativeGateway.js +187 -0
  67. package/dist/cjs/internal/NativeGateway.js.map +7 -0
  68. package/dist/cjs/internal/actionRenderings.d.ts +12 -0
  69. package/dist/cjs/internal/actionRenderings.d.ts.map +1 -0
  70. package/dist/cjs/internal/actionRenderings.js +224 -0
  71. package/dist/cjs/internal/actionRenderings.js.map +7 -0
  72. package/dist/cjs/internal/callEvents.d.ts +97 -0
  73. package/dist/cjs/internal/callEvents.d.ts.map +1 -0
  74. package/dist/cjs/internal/callEvents.js +169 -0
  75. package/dist/cjs/internal/callEvents.js.map +7 -0
  76. package/dist/cjs/internal/digestIndex.d.ts +31 -0
  77. package/dist/cjs/internal/digestIndex.d.ts.map +1 -0
  78. package/dist/cjs/internal/digestIndex.js +105 -0
  79. package/dist/cjs/internal/digestIndex.js.map +7 -0
  80. package/dist/cjs/internal/digestMemory.d.ts +19 -0
  81. package/dist/cjs/internal/digestMemory.d.ts.map +1 -0
  82. package/dist/cjs/internal/digestMemory.js +33 -0
  83. package/dist/cjs/internal/digestMemory.js.map +7 -0
  84. package/dist/cjs/internal/inspectLabels.d.ts +13 -0
  85. package/dist/cjs/internal/inspectLabels.d.ts.map +1 -0
  86. package/dist/cjs/internal/inspectLabels.js +29 -0
  87. package/dist/cjs/internal/inspectLabels.js.map +7 -0
  88. package/dist/cjs/internal/nativeResolution.d.ts +41 -0
  89. package/dist/cjs/internal/nativeResolution.d.ts.map +1 -0
  90. package/dist/cjs/internal/nativeResolution.js +62 -0
  91. package/dist/cjs/internal/nativeResolution.js.map +7 -0
  92. package/dist/cjs/internal/nodeEvents.d.ts +47 -0
  93. package/dist/cjs/internal/nodeEvents.d.ts.map +1 -0
  94. package/dist/cjs/internal/nodeEvents.js +60 -0
  95. package/dist/cjs/internal/nodeEvents.js.map +7 -0
  96. package/dist/cjs/node/NodeGateway.d.ts +16 -0
  97. package/dist/cjs/node/NodeGateway.d.ts.map +1 -0
  98. package/dist/cjs/node/NodeGateway.js +48 -0
  99. package/dist/cjs/node/NodeGateway.js.map +7 -0
  100. package/dist/cjs/package.json +1 -0
  101. package/dist/esm/Diagnosis.d.ts +275 -0
  102. package/dist/esm/Diagnosis.d.ts.map +1 -0
  103. package/dist/esm/Diagnosis.js +697 -0
  104. package/dist/esm/Diagnosis.js.map +1 -0
  105. package/dist/esm/EngineTrace.d.ts +76 -0
  106. package/dist/esm/EngineTrace.d.ts.map +1 -0
  107. package/dist/esm/EngineTrace.js +557 -0
  108. package/dist/esm/EngineTrace.js.map +1 -0
  109. package/dist/esm/GatewayError.d.ts +54 -0
  110. package/dist/esm/GatewayError.d.ts.map +1 -0
  111. package/dist/esm/GatewayError.js +60 -0
  112. package/dist/esm/GatewayError.js.map +1 -0
  113. package/dist/esm/GatewayProjection.d.ts +480 -0
  114. package/dist/esm/GatewayProjection.d.ts.map +1 -0
  115. package/dist/esm/GatewayProjection.js +799 -0
  116. package/dist/esm/GatewayProjection.js.map +1 -0
  117. package/dist/esm/GatewayRpcs.d.ts +1886 -0
  118. package/dist/esm/GatewayRpcs.d.ts.map +1 -0
  119. package/dist/esm/GatewayRpcs.js +145 -0
  120. package/dist/esm/GatewayRpcs.js.map +1 -0
  121. package/dist/esm/GatewaySchema.d.ts +3274 -0
  122. package/dist/esm/GatewaySchema.d.ts.map +1 -0
  123. package/dist/esm/GatewaySchema.js +244 -0
  124. package/dist/esm/GatewaySchema.js.map +1 -0
  125. package/dist/esm/GatewayServer.d.ts +427 -0
  126. package/dist/esm/GatewayServer.d.ts.map +1 -0
  127. package/dist/esm/GatewayServer.js +725 -0
  128. package/dist/esm/GatewayServer.js.map +1 -0
  129. package/dist/esm/HostBranchPresence.d.ts +19 -0
  130. package/dist/esm/HostBranchPresence.d.ts.map +1 -0
  131. package/dist/esm/HostBranchPresence.js +57 -0
  132. package/dist/esm/HostBranchPresence.js.map +1 -0
  133. package/dist/esm/Projections.d.ts +209 -0
  134. package/dist/esm/Projections.d.ts.map +1 -0
  135. package/dist/esm/Projections.js +1254 -0
  136. package/dist/esm/Projections.js.map +1 -0
  137. package/dist/esm/RunDevTools.d.ts +181 -0
  138. package/dist/esm/RunDevTools.d.ts.map +1 -0
  139. package/dist/esm/RunDevTools.js +281 -0
  140. package/dist/esm/RunDevTools.js.map +1 -0
  141. package/dist/esm/RunHistory.d.ts +185 -0
  142. package/dist/esm/RunHistory.d.ts.map +1 -0
  143. package/dist/esm/RunHistory.js +109 -0
  144. package/dist/esm/RunHistory.js.map +1 -0
  145. package/dist/esm/RunTrace.d.ts +753 -0
  146. package/dist/esm/RunTrace.d.ts.map +1 -0
  147. package/dist/esm/RunTrace.js +2106 -0
  148. package/dist/esm/RunTrace.js.map +1 -0
  149. package/dist/esm/RuntimeBridge.d.ts +1386 -0
  150. package/dist/esm/RuntimeBridge.d.ts.map +1 -0
  151. package/dist/esm/RuntimeBridge.js +659 -0
  152. package/dist/esm/RuntimeBridge.js.map +1 -0
  153. package/dist/esm/bun/BunGateway.d.ts +20 -0
  154. package/dist/esm/bun/BunGateway.d.ts.map +1 -0
  155. package/dist/esm/bun/BunGateway.js +32 -0
  156. package/dist/esm/bun/BunGateway.js.map +1 -0
  157. package/dist/esm/index.d.ts +65 -0
  158. package/dist/esm/index.d.ts.map +1 -0
  159. package/dist/esm/index.js +65 -0
  160. package/dist/esm/index.js.map +1 -0
  161. package/dist/esm/internal/NativeGateway.d.ts +176 -0
  162. package/dist/esm/internal/NativeGateway.d.ts.map +1 -0
  163. package/dist/esm/internal/NativeGateway.js +268 -0
  164. package/dist/esm/internal/NativeGateway.js.map +1 -0
  165. package/dist/esm/internal/actionRenderings.d.ts +12 -0
  166. package/dist/esm/internal/actionRenderings.d.ts.map +1 -0
  167. package/dist/esm/internal/actionRenderings.js +212 -0
  168. package/dist/esm/internal/actionRenderings.js.map +1 -0
  169. package/dist/esm/internal/callEvents.d.ts +97 -0
  170. package/dist/esm/internal/callEvents.d.ts.map +1 -0
  171. package/dist/esm/internal/callEvents.js +206 -0
  172. package/dist/esm/internal/callEvents.js.map +1 -0
  173. package/dist/esm/internal/digestIndex.d.ts +31 -0
  174. package/dist/esm/internal/digestIndex.d.ts.map +1 -0
  175. package/dist/esm/internal/digestIndex.js +87 -0
  176. package/dist/esm/internal/digestIndex.js.map +1 -0
  177. package/dist/esm/internal/digestMemory.d.ts +19 -0
  178. package/dist/esm/internal/digestMemory.d.ts.map +1 -0
  179. package/dist/esm/internal/digestMemory.js +23 -0
  180. package/dist/esm/internal/digestMemory.js.map +1 -0
  181. package/dist/esm/internal/inspectLabels.d.ts +13 -0
  182. package/dist/esm/internal/inspectLabels.d.ts.map +1 -0
  183. package/dist/esm/internal/inspectLabels.js +17 -0
  184. package/dist/esm/internal/inspectLabels.js.map +1 -0
  185. package/dist/esm/internal/nativeResolution.d.ts +41 -0
  186. package/dist/esm/internal/nativeResolution.d.ts.map +1 -0
  187. package/dist/esm/internal/nativeResolution.js +78 -0
  188. package/dist/esm/internal/nativeResolution.js.map +1 -0
  189. package/dist/esm/internal/nodeEvents.d.ts +47 -0
  190. package/dist/esm/internal/nodeEvents.d.ts.map +1 -0
  191. package/dist/esm/internal/nodeEvents.js +60 -0
  192. package/dist/esm/internal/nodeEvents.js.map +1 -0
  193. package/dist/esm/node/NodeGateway.d.ts +16 -0
  194. package/dist/esm/node/NodeGateway.d.ts.map +1 -0
  195. package/dist/esm/node/NodeGateway.js +13 -0
  196. package/dist/esm/node/NodeGateway.js.map +1 -0
  197. package/dist/vendor/adapters.json +2707 -0
  198. package/dist/vendor/bun/BunChildProcessSpawner.d.ts +7 -0
  199. package/dist/vendor/bun/BunChildProcessSpawner.js +14 -0
  200. package/dist/vendor/bun/BunClusterHttp.d.ts +83 -0
  201. package/dist/vendor/bun/BunClusterHttp.js +39 -0
  202. package/dist/vendor/bun/BunClusterSocket.d.ts +65 -0
  203. package/dist/vendor/bun/BunClusterSocket.js +22 -0
  204. package/dist/vendor/bun/BunCrypto.d.ts +10 -0
  205. package/dist/vendor/bun/BunCrypto.js +8 -0
  206. package/dist/vendor/bun/BunFileSystem.d.ts +10 -0
  207. package/dist/vendor/bun/BunFileSystem.js +9 -0
  208. package/dist/vendor/bun/BunHttpClient.d.ts +9 -0
  209. package/dist/vendor/bun/BunHttpClient.js +1 -0
  210. package/dist/vendor/bun/BunHttpPlatform.d.ts +10 -0
  211. package/dist/vendor/bun/BunHttpPlatform.js +11 -0
  212. package/dist/vendor/bun/BunHttpServer.d.ts +142 -0
  213. package/dist/vendor/bun/BunHttpServer.js +38 -0
  214. package/dist/vendor/bun/BunHttpServerRequest.d.ts +18 -0
  215. package/dist/vendor/bun/BunHttpServerRequest.js +7 -0
  216. package/dist/vendor/bun/BunMultipart.d.ts +31 -0
  217. package/dist/vendor/bun/BunMultipart.js +12 -0
  218. package/dist/vendor/bun/BunPath.d.ts +24 -0
  219. package/dist/vendor/bun/BunPath.js +12 -0
  220. package/dist/vendor/bun/BunRedis.d.ts +49 -0
  221. package/dist/vendor/bun/BunRedis.js +11 -0
  222. package/dist/vendor/bun/BunRuntime.d.ts +85 -0
  223. package/dist/vendor/bun/BunRuntime.js +8 -0
  224. package/dist/vendor/bun/BunServices.d.ts +34 -0
  225. package/dist/vendor/bun/BunServices.js +23 -0
  226. package/dist/vendor/bun/BunSink.d.ts +8 -0
  227. package/dist/vendor/bun/BunSink.js +12 -0
  228. package/dist/vendor/bun/BunSocket.d.ts +40 -0
  229. package/dist/vendor/bun/BunSocket.js +29 -0
  230. package/dist/vendor/bun/BunSocketServer.d.ts +8 -0
  231. package/dist/vendor/bun/BunSocketServer.js +21 -0
  232. package/dist/vendor/bun/BunStdio.d.ts +11 -0
  233. package/dist/vendor/bun/BunStdio.js +10 -0
  234. package/dist/vendor/bun/BunStream.d.ts +19 -0
  235. package/dist/vendor/bun/BunStream.js +30 -0
  236. package/dist/vendor/bun/BunTerminal.d.ts +21 -0
  237. package/dist/vendor/bun/BunTerminal.js +10 -0
  238. package/dist/vendor/bun/BunWorker.d.ts +20 -0
  239. package/dist/vendor/bun/BunWorker.js +9 -0
  240. package/dist/vendor/bun/BunWorkerRunner.d.ts +12 -0
  241. package/dist/vendor/bun/BunWorkerRunner.js +7 -0
  242. package/dist/vendor/bun/LICENSE +21 -0
  243. package/dist/vendor/bun/index.d.ts +92 -0
  244. package/dist/vendor/bun/index.js +107 -0
  245. package/dist/vendor/chunk-2GCOZTTW.js +48 -0
  246. package/dist/vendor/chunk-37CUR3PO.js +81 -0
  247. package/dist/vendor/chunk-3ARKKENZ.js +45 -0
  248. package/dist/vendor/chunk-3NV2UDBI.js +7 -0
  249. package/dist/vendor/chunk-3OSW7CT7.js +143 -0
  250. package/dist/vendor/chunk-62R63L74.js +62 -0
  251. package/dist/vendor/chunk-6AQLBC2I.js +118 -0
  252. package/dist/vendor/chunk-6C5H7S6B.js +18 -0
  253. package/dist/vendor/chunk-6DY5RBZD.js +85 -0
  254. package/dist/vendor/chunk-6UPBD47P.js +53 -0
  255. package/dist/vendor/chunk-AVVVN75Z.js +96 -0
  256. package/dist/vendor/chunk-B4DHEMBB.js +14 -0
  257. package/dist/vendor/chunk-BCK3NJOX.js +15 -0
  258. package/dist/vendor/chunk-BFBIHJ6X.js +0 -0
  259. package/dist/vendor/chunk-CES4OUM4.js +63 -0
  260. package/dist/vendor/chunk-D64L6YND.js +59 -0
  261. package/dist/vendor/chunk-DS2R6WOM.js +18 -0
  262. package/dist/vendor/chunk-DX4Z23DM.js +65 -0
  263. package/dist/vendor/chunk-DZ2VOUDP.js +564 -0
  264. package/dist/vendor/chunk-FOXN6JPJ.js +61 -0
  265. package/dist/vendor/chunk-FPQF7CR5.js +55 -0
  266. package/dist/vendor/chunk-FUTCTCEG.js +20 -0
  267. package/dist/vendor/chunk-GUPAV2YZ.js +18 -0
  268. package/dist/vendor/chunk-H2Z2Y4QH.js +70 -0
  269. package/dist/vendor/chunk-HAEDVSSM.js +129 -0
  270. package/dist/vendor/chunk-HY7BBL3K.js +93 -0
  271. package/dist/vendor/chunk-IFTTT6D5.js +31 -0
  272. package/dist/vendor/chunk-KQDSNB7M.js +26 -0
  273. package/dist/vendor/chunk-LIHLXXGQ.js +26 -0
  274. package/dist/vendor/chunk-LKCGQEE5.js +28 -0
  275. package/dist/vendor/chunk-MH2J3BYB.js +0 -0
  276. package/dist/vendor/chunk-ML2NAFH2.js +131 -0
  277. package/dist/vendor/chunk-MLFIZ5O2.js +0 -0
  278. package/dist/vendor/chunk-MLKGABMK.js +9 -0
  279. package/dist/vendor/chunk-MSCLEMYX.js +71 -0
  280. package/dist/vendor/chunk-OBWXQKVP.js +57 -0
  281. package/dist/vendor/chunk-QR557K66.js +20 -0
  282. package/dist/vendor/chunk-R4QUY7DH.js +18 -0
  283. package/dist/vendor/chunk-RGECXXJS.js +18 -0
  284. package/dist/vendor/chunk-TFY7W6D4.js +36 -0
  285. package/dist/vendor/chunk-TGPIVY4A.js +104 -0
  286. package/dist/vendor/chunk-TGXCX6W3.js +398 -0
  287. package/dist/vendor/chunk-TOHSFXMV.js +437 -0
  288. package/dist/vendor/chunk-UHIDPUFF.js +34 -0
  289. package/dist/vendor/chunk-ULT6CWUI.js +109 -0
  290. package/dist/vendor/chunk-UXBGYQR3.js +18 -0
  291. package/dist/vendor/chunk-V6LUGQ7O.js +21 -0
  292. package/dist/vendor/chunk-W4OASVX6.js +92 -0
  293. package/dist/vendor/chunk-WAII54GA.js +18 -0
  294. package/dist/vendor/chunk-WECQDT36.js +426 -0
  295. package/dist/vendor/chunk-WHKMOC7Z.js +28 -0
  296. package/dist/vendor/chunk-WVFOZ2UL.js +40 -0
  297. package/dist/vendor/chunk-X73E2UPI.js +18 -0
  298. package/dist/vendor/chunk-XCYARUII.js +63 -0
  299. package/dist/vendor/chunk-XFEVTDVD.js +34 -0
  300. package/dist/vendor/chunk-XFZZYSJ4.js +22 -0
  301. package/dist/vendor/chunk-XJWJXLXJ.js +18 -0
  302. package/dist/vendor/chunk-XY3Q62EO.js +18 -0
  303. package/dist/vendor/chunk-YDASSC75.js +394 -0
  304. package/dist/vendor/chunk-Z6C7SO5Z.js +507 -0
  305. package/dist/vendor/chunk-Z7QNPJEB.js +229 -0
  306. package/dist/vendor/chunk-Z7QPP4YH.js +249 -0
  307. package/dist/vendor/chunk-ZCHYLHJH.js +86 -0
  308. package/dist/vendor/chunk-ZIQVYVMA.js +22 -0
  309. package/dist/vendor/chunk-ZPIG2CUA.js +34 -0
  310. package/dist/vendor/cjs/bun/BunChildProcessSpawner.d.ts +7 -0
  311. package/dist/vendor/cjs/bun/BunChildProcessSpawner.js +1 -0
  312. package/dist/vendor/cjs/bun/BunClusterHttp.d.ts +83 -0
  313. package/dist/vendor/cjs/bun/BunClusterHttp.js +1 -0
  314. package/dist/vendor/cjs/bun/BunClusterSocket.d.ts +65 -0
  315. package/dist/vendor/cjs/bun/BunClusterSocket.js +1 -0
  316. package/dist/vendor/cjs/bun/BunCrypto.d.ts +10 -0
  317. package/dist/vendor/cjs/bun/BunCrypto.js +1 -0
  318. package/dist/vendor/cjs/bun/BunFileSystem.d.ts +10 -0
  319. package/dist/vendor/cjs/bun/BunFileSystem.js +1 -0
  320. package/dist/vendor/cjs/bun/BunHttpClient.d.ts +9 -0
  321. package/dist/vendor/cjs/bun/BunHttpClient.js +1 -0
  322. package/dist/vendor/cjs/bun/BunHttpPlatform.d.ts +10 -0
  323. package/dist/vendor/cjs/bun/BunHttpPlatform.js +1 -0
  324. package/dist/vendor/cjs/bun/BunHttpServer.d.ts +142 -0
  325. package/dist/vendor/cjs/bun/BunHttpServer.js +1 -0
  326. package/dist/vendor/cjs/bun/BunHttpServerRequest.d.ts +18 -0
  327. package/dist/vendor/cjs/bun/BunHttpServerRequest.js +1 -0
  328. package/dist/vendor/cjs/bun/BunMultipart.d.ts +31 -0
  329. package/dist/vendor/cjs/bun/BunMultipart.js +1 -0
  330. package/dist/vendor/cjs/bun/BunPath.d.ts +24 -0
  331. package/dist/vendor/cjs/bun/BunPath.js +1 -0
  332. package/dist/vendor/cjs/bun/BunRedis.d.ts +49 -0
  333. package/dist/vendor/cjs/bun/BunRedis.js +1 -0
  334. package/dist/vendor/cjs/bun/BunRuntime.d.ts +85 -0
  335. package/dist/vendor/cjs/bun/BunRuntime.js +1 -0
  336. package/dist/vendor/cjs/bun/BunServices.d.ts +34 -0
  337. package/dist/vendor/cjs/bun/BunServices.js +1 -0
  338. package/dist/vendor/cjs/bun/BunSink.d.ts +8 -0
  339. package/dist/vendor/cjs/bun/BunSink.js +1 -0
  340. package/dist/vendor/cjs/bun/BunSocket.d.ts +40 -0
  341. package/dist/vendor/cjs/bun/BunSocket.js +1 -0
  342. package/dist/vendor/cjs/bun/BunSocketServer.d.ts +8 -0
  343. package/dist/vendor/cjs/bun/BunSocketServer.js +1 -0
  344. package/dist/vendor/cjs/bun/BunStdio.d.ts +11 -0
  345. package/dist/vendor/cjs/bun/BunStdio.js +1 -0
  346. package/dist/vendor/cjs/bun/BunStream.d.ts +19 -0
  347. package/dist/vendor/cjs/bun/BunStream.js +1 -0
  348. package/dist/vendor/cjs/bun/BunTerminal.d.ts +21 -0
  349. package/dist/vendor/cjs/bun/BunTerminal.js +1 -0
  350. package/dist/vendor/cjs/bun/BunWorker.d.ts +20 -0
  351. package/dist/vendor/cjs/bun/BunWorker.js +1 -0
  352. package/dist/vendor/cjs/bun/BunWorkerRunner.d.ts +12 -0
  353. package/dist/vendor/cjs/bun/BunWorkerRunner.js +1 -0
  354. package/dist/vendor/cjs/bun/index.d.ts +92 -0
  355. package/dist/vendor/cjs/bun/index.js +1 -0
  356. package/dist/vendor/cjs/node/NodeChildProcessSpawner.d.ts +7 -0
  357. package/dist/vendor/cjs/node/NodeChildProcessSpawner.js +1 -0
  358. package/dist/vendor/cjs/node/NodeClusterHttp.d.ts +63 -0
  359. package/dist/vendor/cjs/node/NodeClusterHttp.js +1 -0
  360. package/dist/vendor/cjs/node/NodeClusterSocket.d.ts +79 -0
  361. package/dist/vendor/cjs/node/NodeClusterSocket.js +1 -0
  362. package/dist/vendor/cjs/node/NodeCrypto.d.ts +10 -0
  363. package/dist/vendor/cjs/node/NodeCrypto.js +1 -0
  364. package/dist/vendor/cjs/node/NodeFileSystem.d.ts +10 -0
  365. package/dist/vendor/cjs/node/NodeFileSystem.js +1 -0
  366. package/dist/vendor/cjs/node/NodeHttpClient.d.ts +179 -0
  367. package/dist/vendor/cjs/node/NodeHttpClient.js +1 -0
  368. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.d.ts +62 -0
  369. package/dist/vendor/cjs/node/NodeHttpIncomingMessage.js +1 -0
  370. package/dist/vendor/cjs/node/NodeHttpPlatform.d.ts +36 -0
  371. package/dist/vendor/cjs/node/NodeHttpPlatform.js +1 -0
  372. package/dist/vendor/cjs/node/NodeHttpServer.d.ts +120 -0
  373. package/dist/vendor/cjs/node/NodeHttpServer.js +1 -0
  374. package/dist/vendor/cjs/node/NodeHttpServerRequest.d.ts +29 -0
  375. package/dist/vendor/cjs/node/NodeHttpServerRequest.js +1 -0
  376. package/dist/vendor/cjs/node/NodeMultipart.d.ts +46 -0
  377. package/dist/vendor/cjs/node/NodeMultipart.js +1 -0
  378. package/dist/vendor/cjs/node/NodeMultipartParser.d.ts +97 -0
  379. package/dist/vendor/cjs/node/NodeMultipartParser.js +1 -0
  380. package/dist/vendor/cjs/node/NodePath.d.ts +27 -0
  381. package/dist/vendor/cjs/node/NodePath.js +1 -0
  382. package/dist/vendor/cjs/node/NodeRedis.d.ts +74 -0
  383. package/dist/vendor/cjs/node/NodeRedis.js +1 -0
  384. package/dist/vendor/cjs/node/NodeRuntime.d.ts +85 -0
  385. package/dist/vendor/cjs/node/NodeRuntime.js +1 -0
  386. package/dist/vendor/cjs/node/NodeServices.d.ts +34 -0
  387. package/dist/vendor/cjs/node/NodeServices.js +1 -0
  388. package/dist/vendor/cjs/node/NodeSink.d.ts +8 -0
  389. package/dist/vendor/cjs/node/NodeSink.js +1 -0
  390. package/dist/vendor/cjs/node/NodeSocket.d.ts +38 -0
  391. package/dist/vendor/cjs/node/NodeSocket.js +1 -0
  392. package/dist/vendor/cjs/node/NodeSocketServer.d.ts +8 -0
  393. package/dist/vendor/cjs/node/NodeSocketServer.js +1 -0
  394. package/dist/vendor/cjs/node/NodeStdio.d.ts +11 -0
  395. package/dist/vendor/cjs/node/NodeStdio.js +1 -0
  396. package/dist/vendor/cjs/node/NodeStream.d.ts +8 -0
  397. package/dist/vendor/cjs/node/NodeStream.js +1 -0
  398. package/dist/vendor/cjs/node/NodeTerminal.d.ts +21 -0
  399. package/dist/vendor/cjs/node/NodeTerminal.js +1 -0
  400. package/dist/vendor/cjs/node/NodeWorker.d.ts +22 -0
  401. package/dist/vendor/cjs/node/NodeWorker.js +1 -0
  402. package/dist/vendor/cjs/node/NodeWorkerRunner.d.ts +12 -0
  403. package/dist/vendor/cjs/node/NodeWorkerRunner.js +1 -0
  404. package/dist/vendor/cjs/node/Undici.d.ts +28 -0
  405. package/dist/vendor/cjs/node/Undici.js +1 -0
  406. package/dist/vendor/cjs/node/index.d.ts +100 -0
  407. package/dist/vendor/cjs/node/index.js +1 -0
  408. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  409. package/dist/vendor/cjs/node-shared/NodeChildProcessSpawner.js +1 -0
  410. package/dist/vendor/cjs/node-shared/NodeClusterSocket.d.ts +22 -0
  411. package/dist/vendor/cjs/node-shared/NodeClusterSocket.js +1 -0
  412. package/dist/vendor/cjs/node-shared/NodeCrypto.d.ts +27 -0
  413. package/dist/vendor/cjs/node-shared/NodeCrypto.js +1 -0
  414. package/dist/vendor/cjs/node-shared/NodeFileSystem.d.ts +11 -0
  415. package/dist/vendor/cjs/node-shared/NodeFileSystem.js +1 -0
  416. package/dist/vendor/cjs/node-shared/NodeHttpCompression.d.ts +36 -0
  417. package/dist/vendor/cjs/node-shared/NodeHttpCompression.js +1 -0
  418. package/dist/vendor/cjs/node-shared/NodePath.d.ts +27 -0
  419. package/dist/vendor/cjs/node-shared/NodePath.js +1 -0
  420. package/dist/vendor/cjs/node-shared/NodeRuntime.d.ts +47 -0
  421. package/dist/vendor/cjs/node-shared/NodeRuntime.js +1 -0
  422. package/dist/vendor/cjs/node-shared/NodeSink.d.ts +69 -0
  423. package/dist/vendor/cjs/node-shared/NodeSink.js +1 -0
  424. package/dist/vendor/cjs/node-shared/NodeSocket.d.ts +134 -0
  425. package/dist/vendor/cjs/node-shared/NodeSocket.js +1 -0
  426. package/dist/vendor/cjs/node-shared/NodeSocketServer.d.ts +80 -0
  427. package/dist/vendor/cjs/node-shared/NodeSocketServer.js +1 -0
  428. package/dist/vendor/cjs/node-shared/NodeStdio.d.ts +12 -0
  429. package/dist/vendor/cjs/node-shared/NodeStdio.js +1 -0
  430. package/dist/vendor/cjs/node-shared/NodeStream.d.ts +179 -0
  431. package/dist/vendor/cjs/node-shared/NodeStream.js +1 -0
  432. package/dist/vendor/cjs/node-shared/NodeTerminal.d.ts +22 -0
  433. package/dist/vendor/cjs/node-shared/NodeTerminal.js +1 -0
  434. package/dist/vendor/cjs/node-shared/index.d.ts +56 -0
  435. package/dist/vendor/cjs/node-shared/index.js +1 -0
  436. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  437. package/dist/vendor/cjs/node-shared/internal/nodeChildProcessSpawner.js +1 -0
  438. package/dist/vendor/cjs/node-shared/internal/utils.d.ts +2 -0
  439. package/dist/vendor/cjs/node-shared/internal/utils.js +1 -0
  440. package/dist/vendor/cjs/package.json +1 -0
  441. package/dist/vendor/cjs/platform-bun.d.ts +92 -0
  442. package/dist/vendor/cjs/platform-bun.js +1 -0
  443. package/dist/vendor/cjs/platform-node-shared.d.ts +56 -0
  444. package/dist/vendor/cjs/platform-node-shared.js +1 -0
  445. package/dist/vendor/cjs/platform-node.d.ts +100 -0
  446. package/dist/vendor/cjs/platform-node.js +1 -0
  447. package/dist/vendor/node/LICENSE +21 -0
  448. package/dist/vendor/node/NodeChildProcessSpawner.d.ts +7 -0
  449. package/dist/vendor/node/NodeChildProcessSpawner.js +14 -0
  450. package/dist/vendor/node/NodeClusterHttp.d.ts +63 -0
  451. package/dist/vendor/node/NodeClusterHttp.js +43 -0
  452. package/dist/vendor/node/NodeClusterSocket.d.ts +79 -0
  453. package/dist/vendor/node/NodeClusterSocket.js +30 -0
  454. package/dist/vendor/node/NodeCrypto.d.ts +10 -0
  455. package/dist/vendor/node/NodeCrypto.js +8 -0
  456. package/dist/vendor/node/NodeFileSystem.d.ts +10 -0
  457. package/dist/vendor/node/NodeFileSystem.js +9 -0
  458. package/dist/vendor/node/NodeHttpClient.d.ts +179 -0
  459. package/dist/vendor/node/NodeHttpClient.js +46 -0
  460. package/dist/vendor/node/NodeHttpIncomingMessage.d.ts +62 -0
  461. package/dist/vendor/node/NodeHttpIncomingMessage.js +10 -0
  462. package/dist/vendor/node/NodeHttpPlatform.d.ts +36 -0
  463. package/dist/vendor/node/NodeHttpPlatform.js +16 -0
  464. package/dist/vendor/node/NodeHttpServer.d.ts +120 -0
  465. package/dist/vendor/node/NodeHttpServer.js +46 -0
  466. package/dist/vendor/node/NodeHttpServerRequest.d.ts +29 -0
  467. package/dist/vendor/node/NodeHttpServerRequest.js +9 -0
  468. package/dist/vendor/node/NodeMultipart.d.ts +46 -0
  469. package/dist/vendor/node/NodeMultipart.js +15 -0
  470. package/dist/vendor/node/NodeMultipartParser.d.ts +97 -0
  471. package/dist/vendor/node/NodeMultipartParser.js +11 -0
  472. package/dist/vendor/node/NodePath.d.ts +27 -0
  473. package/dist/vendor/node/NodePath.js +12 -0
  474. package/dist/vendor/node/NodeRedis.d.ts +74 -0
  475. package/dist/vendor/node/NodeRedis.js +11 -0
  476. package/dist/vendor/node/NodeRuntime.d.ts +85 -0
  477. package/dist/vendor/node/NodeRuntime.js +8 -0
  478. package/dist/vendor/node/NodeServices.d.ts +34 -0
  479. package/dist/vendor/node/NodeServices.js +23 -0
  480. package/dist/vendor/node/NodeSink.d.ts +8 -0
  481. package/dist/vendor/node/NodeSink.js +12 -0
  482. package/dist/vendor/node/NodeSocket.d.ts +38 -0
  483. package/dist/vendor/node/NodeSocket.js +31 -0
  484. package/dist/vendor/node/NodeSocketServer.d.ts +8 -0
  485. package/dist/vendor/node/NodeSocketServer.js +21 -0
  486. package/dist/vendor/node/NodeStdio.d.ts +11 -0
  487. package/dist/vendor/node/NodeStdio.js +10 -0
  488. package/dist/vendor/node/NodeStream.d.ts +8 -0
  489. package/dist/vendor/node/NodeStream.js +27 -0
  490. package/dist/vendor/node/NodeTerminal.d.ts +21 -0
  491. package/dist/vendor/node/NodeTerminal.js +10 -0
  492. package/dist/vendor/node/NodeWorker.d.ts +22 -0
  493. package/dist/vendor/node/NodeWorker.js +9 -0
  494. package/dist/vendor/node/NodeWorkerRunner.d.ts +12 -0
  495. package/dist/vendor/node/NodeWorkerRunner.js +7 -0
  496. package/dist/vendor/node/Undici.d.ts +28 -0
  497. package/dist/vendor/node/Undici.js +9 -0
  498. package/dist/vendor/node/index.d.ts +100 -0
  499. package/dist/vendor/node/index.js +115 -0
  500. package/dist/vendor/node-shared/LICENSE +21 -0
  501. package/dist/vendor/node-shared/NodeChildProcessSpawner.d.ts +57 -0
  502. package/dist/vendor/node-shared/NodeChildProcessSpawner.js +13 -0
  503. package/dist/vendor/node-shared/NodeClusterSocket.d.ts +22 -0
  504. package/dist/vendor/node-shared/NodeClusterSocket.js +11 -0
  505. package/dist/vendor/node-shared/NodeCrypto.d.ts +27 -0
  506. package/dist/vendor/node-shared/NodeCrypto.js +9 -0
  507. package/dist/vendor/node-shared/NodeFileSystem.d.ts +11 -0
  508. package/dist/vendor/node-shared/NodeFileSystem.js +8 -0
  509. package/dist/vendor/node-shared/NodeHttpCompression.d.ts +36 -0
  510. package/dist/vendor/node-shared/NodeHttpCompression.js +13 -0
  511. package/dist/vendor/node-shared/NodePath.d.ts +27 -0
  512. package/dist/vendor/node-shared/NodePath.js +11 -0
  513. package/dist/vendor/node-shared/NodeRuntime.d.ts +47 -0
  514. package/dist/vendor/node-shared/NodeRuntime.js +7 -0
  515. package/dist/vendor/node-shared/NodeSink.d.ts +69 -0
  516. package/dist/vendor/node-shared/NodeSink.js +11 -0
  517. package/dist/vendor/node-shared/NodeSocket.d.ts +134 -0
  518. package/dist/vendor/node-shared/NodeSocket.js +23 -0
  519. package/dist/vendor/node-shared/NodeSocketServer.d.ts +80 -0
  520. package/dist/vendor/node-shared/NodeSocketServer.js +20 -0
  521. package/dist/vendor/node-shared/NodeStdio.d.ts +12 -0
  522. package/dist/vendor/node-shared/NodeStdio.js +9 -0
  523. package/dist/vendor/node-shared/NodeStream.d.ts +179 -0
  524. package/dist/vendor/node-shared/NodeStream.js +26 -0
  525. package/dist/vendor/node-shared/NodeTerminal.d.ts +22 -0
  526. package/dist/vendor/node-shared/NodeTerminal.js +9 -0
  527. package/dist/vendor/node-shared/index.d.ts +56 -0
  528. package/dist/vendor/node-shared/index.js +58 -0
  529. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.d.ts +4 -0
  530. package/dist/vendor/node-shared/internal/nodeChildProcessSpawner.js +7 -0
  531. package/dist/vendor/node-shared/internal/utils.d.ts +2 -0
  532. package/dist/vendor/node-shared/internal/utils.js +7 -0
  533. package/dist/vendor/platform-bun.d.ts +92 -0
  534. package/dist/vendor/platform-bun.js +107 -0
  535. package/dist/vendor/platform-node-shared.d.ts +56 -0
  536. package/dist/vendor/platform-node-shared.js +58 -0
  537. package/dist/vendor/platform-node.d.ts +100 -0
  538. package/dist/vendor/platform-node.js +115 -0
  539. package/docs/README.md +158 -0
  540. package/docs/api.md +601 -0
  541. package/docs/concepts/projections.md +250 -0
  542. package/docs/concepts/subscriptions.md +204 -0
  543. package/docs/concepts/trust-boundary.md +256 -0
  544. package/docs/guides/diagnose-a-run.md +115 -0
  545. package/docs/guides/follow-a-run.md +150 -0
  546. package/docs/guides/host-the-gateway.md +153 -0
  547. package/docs/guides/read-a-projection.md +138 -0
  548. package/docs/guides/serve-beyond-loopback.md +166 -0
  549. package/docs/guides/submit-an-approval.md +187 -0
  550. package/docs/guides/testing.md +148 -0
  551. package/docs/installation.md +89 -0
  552. package/docs/quickstart.md +200 -0
  553. package/docs/troubleshooting.md +355 -0
  554. package/package.json +264 -32
  555. package/src/Diagnosis.ts +892 -0
  556. package/src/EngineTrace.ts +627 -0
  557. package/src/GatewayError.ts +71 -0
  558. package/src/GatewayProjection.ts +959 -0
  559. package/src/GatewayRpcs.ts +179 -0
  560. package/src/GatewaySchema.ts +516 -0
  561. package/src/GatewayServer.ts +932 -0
  562. package/src/HostBranchPresence.ts +76 -0
  563. package/src/Projections.ts +1735 -0
  564. package/src/RunDevTools.ts +394 -0
  565. package/src/RunHistory.ts +174 -0
  566. package/src/RunTrace.ts +2796 -0
  567. package/src/RuntimeBridge.ts +835 -0
  568. package/src/bun/BunGateway.ts +52 -0
  569. package/src/index.ts +77 -0
  570. package/src/internal/NativeGateway.ts +360 -0
  571. package/src/internal/actionRenderings.ts +212 -0
  572. package/src/internal/callEvents.ts +257 -0
  573. package/src/internal/digestIndex.ts +134 -0
  574. package/src/internal/digestMemory.ts +27 -0
  575. package/src/internal/inspectLabels.ts +18 -0
  576. package/src/internal/nativeResolution.ts +103 -0
  577. package/src/internal/nodeEvents.ts +100 -0
  578. package/src/node/NodeGateway.ts +30 -0
  579. package/openapi.yaml +0 -29945
  580. package/src/README.md +0 -39
  581. package/src/api/README.md +0 -23
  582. package/src/api/apiCollectionNames.js +0 -10
  583. package/src/api/index.d.ts +0 -126
  584. package/src/api/index.js +0 -14
  585. package/src/api/normalizeApiRow.js +0 -36
  586. package/src/api/serializeAccountRow.js +0 -10
  587. package/src/api/serializeApprovalRow.js +0 -53
  588. package/src/api/serializeComparisonScoreRow.js +0 -18
  589. package/src/api/serializeCronRow.js +0 -30
  590. package/src/api/serializeDocRow.js +0 -20
  591. package/src/api/serializeMemoryFactRow.js +0 -21
  592. package/src/api/serializePromptRow.js +0 -10
  593. package/src/api/serializeRunEventRow.js +0 -28
  594. package/src/api/serializeRunRow.js +0 -93
  595. package/src/api/serializeScoreDetailRow.js +0 -25
  596. package/src/api/serializeScoreRow.js +0 -26
  597. package/src/api/serializeTicketRow.js +0 -20
  598. package/src/api/serializeWorkflowRow.js +0 -10
  599. package/src/auth/scopes.d.ts +0 -19
  600. package/src/auth/scopes.js +0 -164
  601. package/src/index.d.ts +0 -316
  602. package/src/index.js +0 -108
  603. package/src/rpc/gatewayRpcTypes.ts +0 -186
  604. package/src/rpc/index.d.ts +0 -223
  605. package/src/rpc/index.js +0 -2527
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/RuntimeBridge.ts"],
4
+ "sourcesContent": ["/**\n * Versioned JSON boundary between the Go product backend and the canonical\n * TypeScript Flow/Control host.\n *\n * This module adapts HTTP-shaped commands to `Control`. It owns no graph,\n * scheduler, journal, or lifecycle state of its own.\n *\n * @since 1.0.0\n */\n\nimport { Control } from \"@smthrs/control/Control\"\nimport * as ControlError from \"@smthrs/control/ControlError\"\nimport { ControlExecutor, type Service as ControlExecutorService } from \"@smthrs/control/ControlExecutor\"\nimport type { Principal, WatchCursor } from \"@smthrs/control/ControlSchema\"\nimport {\n ApprovalPayload,\n ControlEvent,\n MessageSteer,\n Receipt,\n RunSummary,\n SignalPayload\n} from \"@smthrs/control/ControlSchema\"\nimport * as Fault from \"@smthrs/flow/Fault\"\nimport { Effect, Layer, Schema, Stream } from \"effect\"\nimport { HttpRouter, HttpServerRequest, HttpServerResponse } from \"effect/unstable/http\"\nimport { RunSummaryRow } from \"./GatewayProjection.ts\"\nimport * as Projections from \"./Projections.ts\"\nimport { monitorFromJournal } from \"./RunTrace.ts\"\n\n/**\n * The only protocol version accepted by this host.\n * @since 1.0.0\n * @category constants\n */\nexport const protocol = \"smithers.flow-runtime/v1\" as const\n\nconst Sha256 = Schema.String.check(Schema.isPattern(/^[0-9a-f]{64}$/))\nconst SourceRevision = Schema.String.check(Schema.isPattern(/^[0-9a-f]{40}$/))\nconst PositiveSafeInteger = Schema.Int.check(\n Schema.isGreaterThan(0),\n Schema.isLessThanOrEqualTo(Number.MAX_SAFE_INTEGER)\n)\nconst RequestId = Schema.NonEmptyString.check(Schema.isMaxLength(1024))\n// A decimal consumes a whole journal entry. v1 preserves an expansion offset;\n// the empty seed consumes nothing, including sequence zero.\nconst observationCursorPattern = /^(?:(0|[1-9][0-9]*)|v1:(0|[1-9][0-9]*):(0|[1-9][0-9]*))?(?![\\s\\S])/\n\n/**\n * Non-secret identity published by readiness for startup compatibility.\n * @since 1.0.0\n * @category models\n */\nexport const Identity = Schema.Struct({\n protocol: Schema.Literal(protocol),\n runtimeArtifactDigest: Sha256,\n sourceRevision: SourceRevision,\n ownerGeneration: PositiveSafeInteger\n})\n\n/**\n * Non-secret identity published by readiness for startup compatibility.\n * @since 1.0.0\n * @category models\n */\nexport type Identity = typeof Identity.Type\nconst common = {\n protocol: Schema.Literal(protocol),\n applicationRequestId: RequestId,\n ownerGeneration: PositiveSafeInteger\n}\n\n// The version a launch must run: a flow, the source commit it was chosen\n// from and that flow's execution digest. A pinned launch runs only a plan\n// with that exact identity.\nconst LaunchPin = Schema.Struct({\n flow: Schema.NonEmptyString,\n sourceCommit: SourceRevision,\n executionDigest: Sha256\n})\n\n/**\n * Launches one immutable named flow. Planning and running stay in Control.\n * @since 1.0.0\n * @category models\n */\nexport const LaunchCommand = Schema.Struct({\n ...common,\n operation: Schema.Literal(\"launch\"),\n attempt: PositiveSafeInteger,\n runId: Schema.optional(Schema.NonEmptyString),\n runtimeArtifactDigest: Sha256,\n sourceRevision: SourceRevision,\n flowId: Schema.NonEmptyString,\n payload: Schema.Json,\n pin: Schema.optional(LaunchPin)\n})\n\n/**\n * Submits an approval or denial payload produced by the same Control host.\n * @since 1.0.0\n * @category models\n */\nexport const DecisionCommand = Schema.Struct({\n ...common,\n operation: Schema.Literals([\"approve\", \"deny\"]),\n approval: ApprovalPayload\n})\n\n/**\n * Delivers one durable named signal.\n * @since 1.0.0\n * @category models\n */\nexport const SignalCommand = Schema.Struct({\n ...common,\n operation: Schema.Literal(\"signal\"),\n runId: Schema.NonEmptyString,\n signal: SignalPayload\n})\n\nconst Steer = Schema.Union([\n Schema.Struct({ kind: Schema.Literal(\"Message\"), body: Schema.String }),\n Schema.Struct({ kind: Schema.Literal(\"Seat\"), seat: Schema.NonEmptyString }),\n Schema.Struct({\n kind: Schema.Literal(\"Thinking\"),\n thinking: Schema.Literals([\"none\", \"minimal\", \"low\", \"medium\", \"high\", \"xhigh\"])\n }),\n Schema.Struct({ kind: Schema.Literal(\"Tools\"), toolNames: Schema.NonEmptyArray(Schema.NonEmptyString) })\n])\n\n/**\n * Enqueues one steer for the runtime's next turn boundary.\n * @since 1.0.0\n * @category models\n */\nexport const SteerCommand = Schema.Struct({\n version: Schema.optional(Schema.Number),\n ...common,\n operation: Schema.Literal(\"steer\"),\n runId: Schema.NonEmptyString,\n messageId: Schema.NonEmptyString,\n createdAt: Schema.Number,\n attribution: MessageSteer.fields.attribution,\n steer: Steer\n})\n\n/**\n * Requests cancellation, explicit resume, or completion of a retained run.\n * @since 1.0.0\n * @category models\n */\nexport const LifecycleCommand = Schema.Struct({\n ...common,\n /** Completion is a host-only lifecycle operation. @since 1.0.0 */\n operation: Schema.Literals([\"cancel\", \"resume\", \"complete\"]),\n runId: Schema.NonEmptyString,\n reason: Schema.optional(Schema.String)\n})\n\n/**\n * Every mutating operation accepted by the bridge.\n * @since 1.0.0\n * @category models\n */\nexport const Command = Schema.Union([\n LaunchCommand,\n DecisionCommand,\n SignalCommand,\n SteerCommand,\n LifecycleCommand\n])\n\n/**\n * Every mutating operation accepted by the bridge.\n * @since 1.0.0\n * @category models\n */\nexport type Command = typeof Command.Type\n\n/**\n * A bounded, reconnectable read of one canonical runtime execution.\n * @since 1.0.0\n * @category models\n */\nexport const ObserveRequest = Schema.Struct({\n protocol: Schema.Literal(protocol),\n runId: Schema.NonEmptyString,\n afterCursor: Schema.optional(Schema.String.check(Schema.isPattern(observationCursorPattern))),\n limit: Schema.optional(PositiveSafeInteger)\n})\n\n/**\n * A bounded, reconnectable read of one canonical runtime execution.\n * @since 1.0.0\n * @category models\n */\nexport type ObserveRequest = typeof ObserveRequest.Type\n\n/**\n * A process result recorded by installed host equipment, never by a flow result.\n * @since 1.0.0\n * @category models\n */\nexport const CommandReceipt = Schema.Struct({\n runId: Schema.NonEmptyString,\n operationId: Schema.NonEmptyString,\n status: Schema.Literals([\"running\", \"completed\"]),\n argv: Schema.NonEmptyArray(Schema.String),\n exitCode: Schema.optionalKey(Schema.Int),\n stderr: Schema.optionalKey(Schema.String),\n fault: Schema.optionalKey(Schema.Literals([\"factory\", \"infra\"]))\n})\n/**\n * A process result recorded by installed host equipment.\n * @since 1.0.0\n * @category models\n */\nexport type CommandReceipt = typeof CommandReceipt.Type\n\n/**\n * Host identity fixed for the lifetime of one owning process.\n * @since 1.0.0\n * @category models\n */\nexport interface Config {\n readonly runtimeArtifactDigest: string\n readonly sourceRevision: string\n /** Captured and verified by native catalog registration, never decoded from a request or environment. */\n readonly verifiedCatalogSourceRevision?: string | undefined\n readonly ownerGeneration: number\n /**\n * Private installed-host receipt reader; never accepted on the command wire.\n * @since 1.0.0\n */\n readonly commandReceipt?: ((runId: string) => Effect.Effect<CommandReceipt | undefined, unknown>) | undefined\n /**\n * Native host completion port, captured from the executor rather than from a request.\n * @since 1.0.0\n */\n readonly requestComplete?: ControlExecutorService[\"requestComplete\"]\n readonly authenticate: (\n headers: Readonly<Record<string, string>>\n ) => Effect.Effect<Principal, ControlError.Unauthorized>\n}\n\n/**\n * Stable bridge-only failures. Control failures retain their own code.\n * @since 1.0.0\n * @category errors\n */\nexport class BridgeError extends Schema.TaggedError<BridgeError>()(\"@smthrs/gateway/RuntimeBridgeError\", {\n code: Schema.Literals([\n \"invalid_request\",\n \"artifact_mismatch\",\n \"source_mismatch\",\n \"stale_owner\",\n \"run_not_found\",\n \"resource_limit\",\n \"unavailable\",\n \"internal\"\n ]),\n message: Schema.String,\n retryable: Schema.Boolean\n}) {}\n\nconst decodeCommand = Schema.decodeUnknownEffect(Command)\nconst decodeObserve = Schema.decodeUnknownEffect(ObserveRequest)\nconst terminal = new Set([\"completed\", \"failed\", \"cancelled\"])\nconst retryableCodes = new Set([\"transport_error\", \"unavailable\", \"persistence_failed\", \"launch_failed\"])\nconst notFoundCodes = new Set([\"run_not_found\", \"flow_not_found\", \"plan_not_found\"])\nconst conflictCodes = new Set([\"stale_owner\", \"artifact_mismatch\", \"source_mismatch\", \"conflict\"])\nconst defaultEventLimit = 250\nconst maximumEventLimit = 1_000\n\n// Host generation fences who may execute a delivery, but it is not part of\n// the durable product request identity. A replacement owner must reconcile a\n// lost acknowledgement against the same Control command keys.\nconst idempotencyKey = (input: Pick<Command, \"applicationRequestId\">, suffix: string) =>\n `bridge:v1:${input.applicationRequestId}:${suffix}`\n\nconst validateOwner = (config: Config, input: Pick<Command, \"ownerGeneration\">) =>\n input.ownerGeneration === config.ownerGeneration\n ? Effect.void\n : Effect.fail(\n new BridgeError({ code: \"stale_owner\", message: \"Runtime owner generation is stale\", retryable: true })\n )\n\n/**\n * Executes one decoded command exclusively through the canonical Control API.\n * @since 1.0.0\n * @category constructors\n */\nexport const execute = (\n config: Config,\n control: Control[\"Service\"],\n principal: Principal,\n input: Command\n) =>\n Effect.gen(function*() {\n yield* validateOwner(config, input)\n switch (input.operation) {\n case \"launch\": {\n if (input.runtimeArtifactDigest !== config.runtimeArtifactDigest) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"artifact_mismatch\",\n message: \"Runtime artifact digest does not match the owning host\",\n retryable: false\n })\n )\n }\n if (input.sourceRevision !== config.sourceRevision) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"source_mismatch\",\n message: \"Flow source revision does not match the owning host\",\n retryable: false\n })\n )\n }\n // Every launch of a pinned attempt (its composition and the engine's\n // launches) runs from the pinned source commit: a host serving any\n // other source refuses before planning imports anything.\n if (input.pin !== undefined && input.pin.sourceCommit !== config.sourceRevision) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"source_mismatch\",\n message: \"Flow source revision does not match the pinned launch\",\n retryable: false\n })\n )\n }\n const plan = yield* control.plan({\n flowId: input.flowId,\n input: input.payload,\n idempotencyKey: idempotencyKey(input, \"plan\")\n })\n // Graphs are optional for valid Flow declarations. Only a verified\n // native catalog snapshot can supply the missing provenance; the\n // configured/wire identity by itself cannot stand in for that proof.\n const plannedSource = plan.graph?.sourceRevision ?? config.verifiedCatalogSourceRevision\n if (plannedSource !== input.sourceRevision) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"source_mismatch\",\n message: \"Flow source revision does not match the immutable request\",\n retryable: false\n })\n )\n }\n // A pinned launch runs nothing but its pin: a plan with no execution\n // identity, or the pinned flow planned as other code, never starts.\n if (\n input.pin !== undefined &&\n (plan.executionDigest === undefined ||\n (input.pin.flow === input.flowId && plan.executionDigest !== input.pin.executionDigest))\n ) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"source_mismatch\",\n message: \"Flow execution digest does not match the pinned launch\",\n retryable: false\n })\n )\n }\n const receipt = yield* control.run({\n _tag: \"Plan\",\n planId: plan.planId,\n digest: plan.digest,\n envelope: plan.envelope,\n idempotencyKey: idempotencyKey(input, `run:${input.runId ?? input.attempt}`),\n principal,\n ...(input.runId === undefined ? {} : { reservedRunId: input.runId })\n })\n return {\n operation: input.operation,\n applicationRequestId: input.applicationRequestId,\n ownerGeneration: input.ownerGeneration,\n runtimeArtifactDigest: config.runtimeArtifactDigest,\n sourceRevision: input.sourceRevision,\n planId: plan.planId,\n planDigest: plan.digest,\n ...(plan.executionDigest === undefined ? {} : { executionDigest: plan.executionDigest }),\n envelope: plan.envelope,\n approval: plan.approval,\n receipt\n } as const\n }\n case \"approve\":\n case \"deny\": {\n const request = {\n ...input.approval,\n idempotencyKey: idempotencyKey(input, input.operation),\n principal\n }\n const receipt = yield* input.operation === \"approve\" ? control.approve(request) : control.deny(request)\n return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt } as const\n }\n case \"signal\": {\n const receipt = yield* control.signal({\n runId: input.runId,\n signal: input.signal,\n idempotencyKey: idempotencyKey(input, \"signal\"),\n principal\n })\n return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt } as const\n }\n case \"steer\": {\n const receipt = yield* control.steer({\n runId: input.runId,\n idempotencyKey: idempotencyKey(input, \"steer\"),\n ...(input.version === undefined ? {} : { version: input.version }),\n message: {\n ...input.steer,\n runId: input.runId,\n messageId: input.messageId,\n createdAt: input.createdAt,\n ...(input.attribution === undefined ? {} : { attribution: input.attribution }),\n principal\n }\n })\n return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt } as const\n }\n // This authenticated host bridge is not a catalog or public Control\n // verb. The executor validates the completed native child and resumes\n // its retained parent to settle from that child's committed result.\n case \"complete\": {\n const executor = yield* Effect.serviceOption(ControlExecutor)\n const complete = config.requestComplete ??\n (executor._tag === \"Some\" ? executor.value.requestComplete : undefined)\n if (complete === undefined) {\n return yield* Effect.fail(\n new BridgeError({\n code: \"unavailable\",\n message: \"Completed-module settlement is unavailable\",\n retryable: true\n })\n )\n }\n const receipt = yield* complete({ runId: input.runId, receiptId: idempotencyKey(input, \"complete\") })\n return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt } as const\n }\n case \"cancel\":\n case \"resume\": {\n const request = {\n runId: input.runId,\n idempotencyKey: idempotencyKey(input, input.operation),\n ...(input.reason === undefined ? {} : { reason: input.reason }),\n principal\n }\n const receipt = yield* input.operation === \"cancel\" ? control.cancel(request) : control.resume(request)\n return { operation: input.operation, applicationRequestId: input.applicationRequestId, receipt } as const\n }\n }\n })\n\nconst cursorPosition = (cursor: string | undefined): Effect.Effect<WatchCursor | undefined, BridgeError> => {\n if (cursor === undefined || cursor === \"\") return Effect.succeed(undefined)\n const match = observationCursorPattern.exec(cursor)\n const sequence = Number(match?.[1] ?? match?.[2])\n const offset = match?.[3] === undefined ? undefined : Number(match[3])\n const valid = (value: number) => Number.isSafeInteger(value) && value >= 0 && value < Number.MAX_SAFE_INTEGER\n return match !== null && valid(sequence) && (offset === undefined || valid(offset))\n ? Effect.succeed({ sequence, ...(offset === undefined ? {} : { offset }) })\n : Effect.fail(\n new BridgeError({\n code: \"invalid_request\",\n message: \"Observation cursor is invalid or out of range\",\n retryable: false\n })\n )\n}\n\nconst encodedCursor = (cursor: WatchCursor): string =>\n cursor.offset === undefined ? String(cursor.sequence) : `v1:${cursor.sequence}:${cursor.offset}`\n\n/**\n * Reads a bounded event replay and current canonical run projection.\n * @since 1.0.0\n * @category constructors\n */\nexport const observe = (control: Control[\"Service\"], input: ObserveRequest, receipts?: Config[\"commandReceipt\"]) =>\n Effect.gen(function*() {\n const after = yield* cursorPosition(input.afterCursor)\n const limit = Math.min(input.limit ?? defaultEventLimit, maximumEventLimit)\n const listed = yield* control.list({ _tag: \"runs\", filters: { runId: input.runId }, limit: 1 })\n const summary = listed._tag === \"runs\" ? listed.items[0] : undefined\n if (summary === undefined) {\n return yield* Effect.fail(\n new BridgeError({ code: \"run_not_found\", message: \"Runtime execution was not found\", retryable: true })\n )\n }\n const events = Array.from(\n yield* Stream.runCollect(Stream.take(\n control.watch({\n runId: input.runId,\n ...(after === undefined\n ? {}\n : after.offset === undefined\n ? { afterSequence: after.sequence }\n : { afterCursor: after }),\n follow: false\n }),\n limit + 1\n ))\n )\n const page = events.slice(0, limit)\n const last = page.at(-1)\n // Typed Flow results use the same committed root projection as the app.\n // A terminal status alone never supplies a result, and a bounded event\n // page cannot reconstruct a root result that precedes its cursor.\n let finalOutput: string | undefined\n let failure: { readonly failureFault?: Fault.Class; readonly failureTag?: string } = {}\n if (terminal.has(summary.status)) {\n const projections = yield* Projections.make(control)\n const snapshot = yield* projections.snapshot({ _tag: \"run-summary\", runId: input.runId })\n const row = snapshot.rows.find(Schema.is(RunSummaryRow))\n if (\n row === undefined || row.runId !== summary.runId || row.flowId !== summary.flowId ||\n row.status !== summary.status || row.planId !== summary.planId || row.planDigest !== summary.planDigest\n ) {\n return yield* Effect.fail(\n new BridgeError({ code: \"internal\", message: \"Terminal result observation changed\", retryable: true })\n )\n }\n finalOutput = row.finalOutput\n failure = {\n ...(row.failureFault === undefined ? {} : { failureFault: row.failureFault }),\n ...(row.failureTag === undefined ? {} : { failureTag: row.failureTag })\n }\n }\n // Keep the private receipt out of every repository-controlled projection.\n const hostSummary = yield* Schema.decodeUnknownEffect(RunSummary)(summary)\n const commandReceipt = receipts === undefined ? undefined : yield* receipts(input.runId)\n if (commandReceipt !== undefined && commandReceipt.runId !== input.runId) {\n return yield* Effect.fail(\n new BridgeError({ code: \"internal\", message: \"Host command receipt names another run\", retryable: false })\n )\n }\n return {\n run: {\n ...hostSummary,\n ...(commandReceipt === undefined ? {} : { commandReceipt }),\n ...(finalOutput === undefined ? {} : { finalOutput }),\n ...failure\n },\n events: page,\n nextCursor: last === undefined\n ? input.afterCursor ?? \"\"\n : encodedCursor(last.cursor ?? { sequence: last.sequence }),\n hasMore: events.length > limit,\n terminal: terminal.has(summary.status)\n }\n })\n\n// Disposable raw journal prefixes for Inspect. This stores no run state: the\n// existing monitor fold still derives every answer from journal records. Bound\n// retention across all runs of one control service, and rebuild after eviction.\nconst monitorJournals = new WeakMap<\n Control[\"Service\"],\n Map<string, {\n readonly records: ReadonlyArray<ControlEvent>\n readonly bytes: number\n }>\n>()\nconst monitorJournalBytes = 64 * 1024 * 1024\n\n/** Read an existing run and its committed journal without invoking any execution door.\n * @since 1.0.0\n * @category constructors\n */\nexport const monitor = (control: Control[\"Service\"], runId: string, at?: number) =>\n Effect.gen(function*() {\n const listed = yield* control.list({ _tag: \"runs\", filters: { runId }, limit: 1 })\n const run = listed._tag === \"runs\" ? listed.items[0] : undefined\n if (run === undefined || run.runId !== runId) {\n return yield* new BridgeError({\n code: \"run_not_found\",\n message: \"Runtime execution was not found\",\n retryable: false\n })\n }\n const cache = monitorJournals.get(control) ??\n new Map<string, { readonly records: ReadonlyArray<ControlEvent>; readonly bytes: number }>()\n monitorJournals.set(control, cache)\n const cached = cache.get(runId)\n const last = cached?.records.at(-1)?.sequence\n // Replay the final entry because one entry may expand into several events.\n const consumed = last === undefined ? 0 : cached!.records.filter((row) => row.sequence === last).length\n let skipped = 0\n const suffix = Array.from(\n yield* Stream.runCollect(\n control.watch({\n runId,\n follow: false,\n ...(last === undefined || last === 0 ? {} : { afterSequence: last - 1 })\n }).pipe(\n Stream.filter((row) =>\n last === undefined || row.sequence > last || row.sequence === last && skipped++ >= consumed\n ),\n Stream.take(Projections.maxEventsScanned + 1)\n )\n )\n )\n const records = [...(cached?.records ?? []), ...suffix]\n if (records.length > Projections.maxEventsScanned) {\n return yield* new BridgeError({\n code: \"resource_limit\",\n message: \"Run journal exceeds the inspection limit\",\n retryable: false\n })\n }\n const bytes = (cached?.bytes ?? 0) +\n suffix.reduce((sum, row) => sum + new TextEncoder().encode(JSON.stringify(row)).byteLength, 0)\n const current = cache.get(runId)\n // A slower reader cannot overwrite a longer committed prefix.\n if (bytes <= monitorJournalBytes && (current === undefined || current.records.length <= records.length)) {\n cache.delete(runId)\n cache.set(runId, { records, bytes })\n let total = [...cache.values()].reduce((sum, entry) => sum + entry.bytes, 0)\n while (cache.size > 32 || total > monitorJournalBytes) {\n const oldest = cache.keys().next().value!\n total -= cache.get(oldest)!.bytes\n cache.delete(oldest)\n }\n }\n const folded = monitorFromJournal({ runId, flowId: run.flowId, status: run.status }, records, at)\n // The journal is read page by page when its tab opens (run-events). Only a\n // replay frame carries its own journal prefix. The extent bounds the run.\n let start = Infinity\n let end = 0\n for (const row of records) {\n if (row.occurredAt > 0) {\n start = Math.min(start, row.occurredAt)\n end = Math.max(end, row.occurredAt)\n }\n }\n const value: Partial<typeof folded> & Omit<typeof folded, \"journal\"> & { extent?: { start: string; end: string } } =\n {\n ...folded,\n ...(end === 0 ? {} : { extent: { start: new Date(start).toISOString(), end: new Date(end).toISOString() } })\n }\n if (at === undefined) delete value.journal\n if (new TextEncoder().encode(JSON.stringify(value)).byteLength > Projections.maxProjectionBytes) {\n return yield* new BridgeError({\n code: \"resource_limit\",\n message: \"Run monitor exceeds the inspection limit\",\n retryable: false\n })\n }\n return value\n })\n\n/**\n * Successful command response on the JSON wire.\n * @since 1.0.0\n * @category models\n */\nexport const CommandResponse = Schema.Struct({\n protocol: Schema.Literal(protocol),\n ok: Schema.Literal(true),\n value: Schema.Struct({\n operation: Schema.String,\n applicationRequestId: Schema.String,\n ownerGeneration: Schema.optional(PositiveSafeInteger),\n runtimeArtifactDigest: Schema.optional(Sha256),\n sourceRevision: Schema.optional(SourceRevision),\n planId: Schema.optional(Schema.String),\n planDigest: Schema.optional(Sha256),\n executionDigest: Schema.optional(Sha256),\n envelope: Schema.optional(Schema.Json),\n approval: Schema.optional(ApprovalPayload),\n receipt: Receipt\n })\n})\n\n/**\n * Successful observation response on the JSON wire.\n * @since 1.0.0\n * @category models\n */\nexport const ObserveResponse = Schema.Struct({\n protocol: Schema.Literal(protocol),\n ok: Schema.Literal(true),\n value: Schema.Struct({\n run: Schema.Struct({\n ...RunSummary.fields,\n finalOutput: Schema.optional(Schema.String),\n failureFault: Schema.optional(Fault.Class),\n failureTag: Schema.optional(Schema.String),\n commandReceipt: Schema.optionalKey(CommandReceipt)\n }),\n events: Schema.Array(ControlEvent),\n nextCursor: Schema.String,\n hasMore: Schema.Boolean,\n terminal: Schema.Boolean\n })\n})\n\n/**\n * Stable sanitized failure response on the JSON wire.\n * @since 1.0.0\n * @category models\n */\nexport const ErrorResponse = Schema.Struct({\n protocol: Schema.Literal(protocol),\n ok: Schema.Literal(false),\n error: Schema.Struct({ code: Schema.String, message: Schema.String, retryable: Schema.Boolean })\n})\n\nconst errorResponse = (cause: unknown) => {\n const known = Schema.is(ControlError.ControlErrorSchema)(cause)\n const code = cause instanceof BridgeError || known ? cause.code : \"internal\"\n const retryable = cause instanceof BridgeError\n ? cause.retryable\n : cause instanceof ControlError.TransportError\n ? cause.retryable\n : retryableCodes.has(code)\n // Control errors can contain storage paths, SQL diagnostics, or executor\n // output. The bridge publishes their stable code, never that backend text.\n const message = cause instanceof BridgeError ? cause.message : \"Runtime bridge failed\"\n const status = code === \"unauthorized\" ?\n 401\n : notFoundCodes.has(code) ?\n 404\n : conflictCodes.has(code) ?\n 409\n : retryable ?\n 503\n : code === \"internal\" ?\n 500\n : 400\n return HttpServerResponse.jsonUnsafe({ protocol, ok: false, error: { code, message, retryable } }, { status })\n}\n\n/**\n * Answers a failed bridge request with its sanitized response, logging it first.\n *\n * The wire carries only the stable code. The operator log carries the full\n * cause of every failure the caller did not cause, so a launch that failed in\n * storage or in the executor can be diagnosed from the host.\n */\nconst respondToFailure = (operation: \"runtime-bridge.command\" | \"runtime-bridge.observe\") => (cause: unknown) => {\n const response = errorResponse(cause)\n if (cause instanceof BridgeError) return Effect.succeed(response)\n const code = Schema.is(ControlError.ControlErrorSchema)(cause) ? cause.code : \"internal\"\n return Effect.logError({ message: \"Runtime bridge request failed\", operation, code, cause }).pipe(\n Effect.as(response)\n )\n}\n\nconst readJson = Effect.gen(function*() {\n const request = yield* HttpServerRequest.HttpServerRequest\n const text = yield* request.text\n return yield* Effect.try({\n try: () => JSON.parse(text) as unknown,\n catch: () => new BridgeError({ code: \"invalid_request\", message: \"Request body must be JSON\", retryable: false })\n })\n})\n\nconst authenticated = <A, E, R>(\n config: Config,\n effect: (principal: Principal) => Effect.Effect<A, E, R>\n) =>\n Effect.gen(function*() {\n const request = yield* HttpServerRequest.HttpServerRequest\n const principal = yield* config.authenticate(request.headers)\n return yield* effect(principal)\n })\n\n/**\n * Mounts the authenticated JSON bridge beside the existing gateway RPCs.\n * @since 1.0.0\n * @category layers\n */\nexport const layer = (config: Config) => {\n const command = authenticated(config, (principal) =>\n Effect.gen(function*() {\n const body = yield* readJson\n const input = yield* decodeCommand(body).pipe(Effect.mapError(() =>\n new BridgeError({\n code: \"invalid_request\",\n message: \"Request does not match the runtime bridge contract\",\n retryable: false\n })\n ))\n const control = yield* Control\n const value = yield* execute(config, control, principal, input)\n return HttpServerResponse.jsonUnsafe({ protocol, ok: true, value })\n })).pipe(\n Effect.catch(respondToFailure(\"runtime-bridge.command\")),\n Effect.withSpan(\"runtime-bridge.command\")\n )\n\n const observation = authenticated(config, () =>\n Effect.gen(function*() {\n const body = yield* readJson\n const input = yield* decodeObserve(body).pipe(Effect.mapError(() =>\n new BridgeError({\n code: \"invalid_request\",\n message: \"Request does not match the observation contract\",\n retryable: false\n })\n ))\n const control = yield* Control\n const value = yield* observe(control, input, config.commandReceipt)\n return HttpServerResponse.jsonUnsafe({ protocol, ok: true, value })\n })).pipe(\n Effect.catch(respondToFailure(\"runtime-bridge.observe\")),\n Effect.withSpan(\"runtime-bridge.observe\")\n )\n\n const inspection = authenticated(config, () =>\n Effect.gen(function*() {\n const body = yield* readJson\n const input = yield* Schema.decodeUnknownEffect(Schema.Struct({\n protocol: Schema.Literal(protocol),\n runId: Schema.NonEmptyString,\n at: Schema.optional(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)))\n }))(body).pipe(Effect.mapError(() =>\n new BridgeError({ code: \"invalid_request\", message: \"Invalid monitor request\", retryable: false })\n ))\n const control = yield* Control\n return HttpServerResponse.jsonUnsafe({\n protocol,\n ok: true,\n value: yield* monitor(control, input.runId, input.at)\n })\n })).pipe(Effect.catch(respondToFailure(\"runtime-bridge.observe\")))\n\n return HttpRouter.add(\"POST\", \"/runtime/v1/command\", command).pipe(\n Layer.merge(HttpRouter.add(\"POST\", \"/runtime/v1/monitor\", inspection)),\n Layer.merge(HttpRouter.add(\"POST\", \"/runtime/v1/observe\", observation))\n )\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,qBAAwB;AACxB,mBAA8B;AAC9B,6BAAwE;AAExE,2BAOO;AACP,YAAuB;AACvB,oBAA8C;AAC9C,kBAAkE;AAClE,+BAA8B;AAC9B,kBAA6B;AAC7B,sBAAmC;AAO5B,MAAM,WAAW;AAExB,MAAM,SAAS,qBAAO,OAAO,MAAM,qBAAO,UAAU,gBAAgB,CAAC;AACrE,MAAM,iBAAiB,qBAAO,OAAO,MAAM,qBAAO,UAAU,gBAAgB,CAAC;AAC7E,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AAA,MAC5D,UAAU,qBAAO,QAAQ,QAAQ;AAAA,MACjC,OAAO,qBAAO;AAAA,MACd,IAAI,qBAAO,SAAS,qBAAO,IAAI,MAAM,qBAAO,uBAAuB,CAAC,CAAC,CAAC;AAAA,IACxE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,qBAAO;AAAA,MAAS,MAC7B,IAAI,YAAY,EAAE,MAAM,mBAAmB,SAAS,2BAA2B,WAAW,MAAM,CAAC;AAAA,IACnG,CAAC;AACD,UAAM,UAAU,OAAO;AACvB,WAAO,+BAAmB,WAAW;AAAA,MACnC;AAAA,MACA,IAAI;AAAA,MACJ,OAAO,OAAO,QAAQ,SAAS,MAAM,OAAO,MAAM,EAAE;AAAA,IACtD,CAAC;AAAA,EACH,CAAC,CAAC,EAAE,KAAK,qBAAO,MAAM,iBAAiB,wBAAwB,CAAC,CAAC;AAEnE,SAAO,uBAAW,IAAI,QAAQ,uBAAuB,OAAO,EAAE;AAAA,IAC5D,oBAAM,MAAM,uBAAW,IAAI,QAAQ,uBAAuB,UAAU,CAAC;AAAA,IACrE,oBAAM,MAAM,uBAAW,IAAI,QAAQ,uBAAuB,WAAW,CAAC;AAAA,EACxE;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,20 @@
1
+ /** Bun HTTP adapter for the same authenticated workspace gateway protocol.
2
+ * @since 1.0.0
3
+ */
4
+ import { Layer } from "effect";
5
+ import type { HttpServer } from "effect/unstable/http/HttpServer";
6
+ import { GatewayError } from "../GatewayError.ts";
7
+ import type * as GatewayServer from "../GatewayServer.ts";
8
+ import * as NativeGateway from "../internal/NativeGateway.ts";
9
+ export { bearerPrincipal, scopedPrincipal } from "../internal/NativeGateway.ts";
10
+ /** TCP bind and existing gateway policy options supported by the Bun host.
11
+ * @since 1.0.0
12
+ * @category models
13
+ */
14
+ export type ServerOptions = Pick<NativeGateway.ServerOptions, "host" | "port" | "allowedHosts" | "listen" | "credential" | "heartbeatMillis" | "maxRequestBodyBytes">;
15
+ /** Serves the existing HTTP/WebSocket gateway using Bun.serve in the caller's scope.
16
+ * @since 1.0.0
17
+ * @category layers
18
+ */
19
+ export declare const layer: (health: GatewayServer.Health, options?: ServerOptions) => Layer.Layer<HttpServer, GatewayError | import("@smthrs/sync/SyncError").SyncError, import("@smthrs/control/Control").Control | import("@smthrs/sync/SyncRpcs").SyncAuth | import("@smthrs/sync/SyncServer").SyncServer | import("../Projections.ts").Projections>;
20
+ //# sourceMappingURL=BunGateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BunGateway.d.ts","sourceRoot":"","sources":["../../../src/bun/BunGateway.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAiB,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAA;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,KAAK,aAAa,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,aAAa,MAAM,8BAA8B,CAAA;AAE7D,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAE/E;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAC9B,aAAa,CAAC,aAAa,EAC3B,MAAM,GAAG,MAAM,GAAG,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,iBAAiB,GAAG,qBAAqB,CACvG,CAAA;AAyBD;;;GAGG;AACH,eAAO,MAAM,KAAK,GAAI,QAAQ,aAAa,CAAC,MAAM,EAAE,UAAS,aAAkD,sQACtF,CAAA"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var BunGateway_exports = {};
30
+ __export(BunGateway_exports, {
31
+ bearerPrincipal: () => import_NativeGateway.bearerPrincipal,
32
+ layer: () => layer,
33
+ scopedPrincipal: () => import_NativeGateway.scopedPrincipal
34
+ });
35
+ module.exports = __toCommonJS(BunGateway_exports);
36
+ var BunHttpServer = __toESM(require("../../vendor/cjs/bun/BunHttpServer.js"), 1);
37
+ var import_effect = require("effect");
38
+ var import_GatewayError = require("../GatewayError.js");
39
+ var NativeGateway = __toESM(require("../internal/NativeGateway.js"), 1);
40
+ var import_NativeGateway = require("../internal/NativeGateway.js");
41
+ const native = NativeGateway.makeLayer(
42
+ (options) => BunHttpServer.layerServer({
43
+ // Shared listenOptions has already supplied and admitted the bind host.
44
+ hostname: options.host,
45
+ port: options.port ?? 7331
46
+ }).pipe(import_effect.Layer.catchCause((cause) => {
47
+ const failure = import_effect.Cause.squash(cause);
48
+ const code = typeof failure === "object" && failure !== null && "code" in failure ? failure.code : void 0;
49
+ if (import_effect.Cause.hasInterruptsOnly(cause) || !["EADDRINUSE", "EACCES", "EADDRNOTAVAIL"].includes(String(code))) {
50
+ return import_effect.Layer.effectContext(import_effect.Effect.failCause(cause));
51
+ }
52
+ return import_effect.Layer.effectContext(import_effect.Effect.fail(
53
+ new import_GatewayError.GatewayError({
54
+ code: "bind_failed",
55
+ message: "The gateway socket could not be bound",
56
+ cause: { _tag: "BunServeError", code: String(code) }
57
+ })
58
+ ));
59
+ }))
60
+ );
61
+ const layer = (health, options = NativeGateway.defaultServerOptions) => native(health, options);
62
+ //# sourceMappingURL=BunGateway.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/bun/BunGateway.ts"],
4
+ "sourcesContent": ["/** Bun HTTP adapter for the same authenticated workspace gateway protocol.\n * @since 1.0.0\n */\n\nimport * as BunHttpServer from \"@effect/platform-bun/BunHttpServer\"\nimport { Cause, Effect, Layer } from \"effect\"\nimport type { HttpServer } from \"effect/unstable/http/HttpServer\"\nimport type { ServeError } from \"effect/unstable/http/HttpServerError\"\nimport { GatewayError } from \"../GatewayError.ts\"\nimport type * as GatewayServer from \"../GatewayServer.ts\"\nimport * as NativeGateway from \"../internal/NativeGateway.ts\"\n\nexport { bearerPrincipal, scopedPrincipal } from \"../internal/NativeGateway.ts\"\n\n/** TCP bind and existing gateway policy options supported by the Bun host.\n * @since 1.0.0\n * @category models\n */\nexport type ServerOptions = Pick<\n NativeGateway.ServerOptions,\n \"host\" | \"port\" | \"allowedHosts\" | \"listen\" | \"credential\" | \"heartbeatMillis\" | \"maxRequestBodyBytes\"\n>\n\nconst native = NativeGateway.makeLayer((options) =>\n BunHttpServer.layerServer({\n // Shared listenOptions has already supplied and admitted the bind host.\n hostname: options.host!,\n port: options.port ?? 7331\n }).pipe(Layer.catchCause((cause): Layer.Layer<HttpServer, ServeError | GatewayError> => {\n const failure = Cause.squash(cause)\n const code = typeof failure === \"object\" && failure !== null && \"code\" in failure ? failure.code : undefined\n if (Cause.hasInterruptsOnly(cause) || ![\"EADDRINUSE\", \"EACCES\", \"EADDRNOTAVAIL\"].includes(String(code))) {\n return Layer.effectContext<HttpServer, ServeError | GatewayError, never>(Effect.failCause(cause))\n }\n // The errno is safe to keep: NativeGateway logs it for the operator and\n // strips it from the refusal every bearer holder sees.\n return Layer.effectContext<HttpServer, ServeError | GatewayError, never>(Effect.fail(\n new GatewayError({\n code: \"bind_failed\",\n message: \"The gateway socket could not be bound\",\n cause: { _tag: \"BunServeError\", code: String(code) }\n })\n ))\n }))\n)\n\n/** Serves the existing HTTP/WebSocket gateway using Bun.serve in the caller's scope.\n * @since 1.0.0\n * @category layers\n */\nexport const layer = (health: GatewayServer.Health, options: ServerOptions = NativeGateway.defaultServerOptions) =>\n native(health, options)\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAA+B;AAC/B,oBAAqC;AAGrC,0BAA6B;AAE7B,oBAA+B;AAE/B,2BAAiD;AAWjD,MAAM,SAAS,cAAc;AAAA,EAAU,CAAC,YACtC,cAAc,YAAY;AAAA;AAAA,IAExB,UAAU,QAAQ;AAAA,IAClB,MAAM,QAAQ,QAAQ;AAAA,EACxB,CAAC,EAAE,KAAK,oBAAM,WAAW,CAAC,UAA8D;AACtF,UAAM,UAAU,oBAAM,OAAO,KAAK;AAClC,UAAM,OAAO,OAAO,YAAY,YAAY,YAAY,QAAQ,UAAU,UAAU,QAAQ,OAAO;AACnG,QAAI,oBAAM,kBAAkB,KAAK,KAAK,CAAC,CAAC,cAAc,UAAU,eAAe,EAAE,SAAS,OAAO,IAAI,CAAC,GAAG;AACvG,aAAO,oBAAM,cAA4D,qBAAO,UAAU,KAAK,CAAC;AAAA,IAClG;AAGA,WAAO,oBAAM,cAA4D,qBAAO;AAAA,MAC9E,IAAI,iCAAa;AAAA,QACf,MAAM;AAAA,QACN,SAAS;AAAA,QACT,OAAO,EAAE,MAAM,iBAAiB,MAAM,OAAO,IAAI,EAAE;AAAA,MACrD,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC,CAAC;AACJ;AAMO,MAAM,QAAQ,CAAC,QAA8B,UAAyB,cAAc,yBACzF,OAAO,QAAQ,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The assembled workspace gateway: one HTTP surface carrying the control
3
+ * plane, the sync read path, the served projections, and a health probe.
4
+ *
5
+ * The package also declares the wire schemas those mounts speak and the pure
6
+ * folds that compute every served row from control-plane facts.
7
+ *
8
+ * @since 0.1.0
9
+ */
10
+ /**
11
+ * @since 0.1.0 @category errors
12
+ */
13
+ export * as GatewayError from "./GatewayError.ts";
14
+ /**
15
+ * @since 0.1.0 @category models
16
+ */
17
+ export * as GatewaySchema from "./GatewaySchema.ts";
18
+ /**
19
+ * @since 1.0.0 @category projections
20
+ */
21
+ export * as Diagnosis from "./Diagnosis.ts";
22
+ /**
23
+ * @since 1.0.0 @category projections
24
+ */
25
+ export * as RunTrace from "./RunTrace.ts";
26
+ /**
27
+ * @since 1.0.0 @category projections
28
+ */
29
+ export * as EngineTrace from "./EngineTrace.ts";
30
+ /**
31
+ * @since 1.0.0 @category projections
32
+ */
33
+ export * as RunDevTools from "./RunDevTools.ts";
34
+ /**
35
+ * @since 1.0.0 @category projections
36
+ */
37
+ export * as GatewayProjection from "./GatewayProjection.ts";
38
+ /**
39
+ * @since 1.0.0 @category rpc
40
+ */
41
+ export * as GatewayRpcs from "./GatewayRpcs.ts";
42
+ /**
43
+ * @since 1.0.0 @category layers
44
+ */
45
+ export * as GatewayServer from "./GatewayServer.ts";
46
+ /**
47
+ * @since 1.0.0 @category services
48
+ */
49
+ export * as Projections from "./Projections.ts";
50
+ /**
51
+ * @since 1.0.0 @category rpc
52
+ */
53
+ export * as RunHistory from "./RunHistory.ts";
54
+ /**
55
+ * @since 1.0.0 @category runtime bridge
56
+ */
57
+ export * as RuntimeBridge from "./RuntimeBridge.ts";
58
+ /**
59
+ * The canonical durable journal synchronization package.
60
+ *
61
+ * @since 0.1.0
62
+ * @category services
63
+ */
64
+ export * as Sync from "@smthrs/sync";
65
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,OAAO,KAAK,YAAY,MAAM,mBAAmB,CAAA;AAEjD;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAA;AAE3C;;GAEG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,iBAAiB,MAAM,wBAAwB,CAAA;AAE3D;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;GAEG;AACH,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAE/C;;GAEG;AACH,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAA;AAE7C;;GAEG;AACH,OAAO,KAAK,aAAa,MAAM,oBAAoB,CAAA;AAEnD;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,cAAc,CAAA"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
+ Diagnosis: () => Diagnosis,
32
+ EngineTrace: () => EngineTrace,
33
+ GatewayError: () => GatewayError,
34
+ GatewayProjection: () => GatewayProjection,
35
+ GatewayRpcs: () => GatewayRpcs,
36
+ GatewaySchema: () => GatewaySchema,
37
+ GatewayServer: () => GatewayServer,
38
+ Projections: () => Projections,
39
+ RunDevTools: () => RunDevTools,
40
+ RunHistory: () => RunHistory,
41
+ RunTrace: () => RunTrace,
42
+ RuntimeBridge: () => RuntimeBridge,
43
+ Sync: () => Sync
44
+ });
45
+ module.exports = __toCommonJS(index_exports);
46
+ var GatewayError = __toESM(require("./GatewayError.js"), 1);
47
+ var GatewaySchema = __toESM(require("./GatewaySchema.js"), 1);
48
+ var Diagnosis = __toESM(require("./Diagnosis.js"), 1);
49
+ var RunTrace = __toESM(require("./RunTrace.js"), 1);
50
+ var EngineTrace = __toESM(require("./EngineTrace.js"), 1);
51
+ var RunDevTools = __toESM(require("./RunDevTools.js"), 1);
52
+ var GatewayProjection = __toESM(require("./GatewayProjection.js"), 1);
53
+ var GatewayRpcs = __toESM(require("./GatewayRpcs.js"), 1);
54
+ var GatewayServer = __toESM(require("./GatewayServer.js"), 1);
55
+ var Projections = __toESM(require("./Projections.js"), 1);
56
+ var RunHistory = __toESM(require("./RunHistory.js"), 1);
57
+ var RuntimeBridge = __toESM(require("./RuntimeBridge.js"), 1);
58
+ var Sync = __toESM(require("@smthrs/sync"), 1);
59
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/index.ts"],
4
+ "sourcesContent": ["/**\n * The assembled workspace gateway: one HTTP surface carrying the control\n * plane, the sync read path, the served projections, and a health probe.\n *\n * The package also declares the wire schemas those mounts speak and the pure\n * folds that compute every served row from control-plane facts.\n *\n * @since 0.1.0\n */\n\n/**\n * @since 0.1.0 @category errors\n */\nexport * as GatewayError from \"./GatewayError.ts\"\n\n/**\n * @since 0.1.0 @category models\n */\nexport * as GatewaySchema from \"./GatewaySchema.ts\"\n\n/**\n * @since 1.0.0 @category projections\n */\nexport * as Diagnosis from \"./Diagnosis.ts\"\n\n/**\n * @since 1.0.0 @category projections\n */\nexport * as RunTrace from \"./RunTrace.ts\"\n\n/**\n * @since 1.0.0 @category projections\n */\nexport * as EngineTrace from \"./EngineTrace.ts\"\n\n/**\n * @since 1.0.0 @category projections\n */\nexport * as RunDevTools from \"./RunDevTools.ts\"\n\n/**\n * @since 1.0.0 @category projections\n */\nexport * as GatewayProjection from \"./GatewayProjection.ts\"\n\n/**\n * @since 1.0.0 @category rpc\n */\nexport * as GatewayRpcs from \"./GatewayRpcs.ts\"\n\n/**\n * @since 1.0.0 @category layers\n */\nexport * as GatewayServer from \"./GatewayServer.ts\"\n\n/**\n * @since 1.0.0 @category services\n */\nexport * as Projections from \"./Projections.ts\"\n\n/**\n * @since 1.0.0 @category rpc\n */\nexport * as RunHistory from \"./RunHistory.ts\"\n\n/**\n * @since 1.0.0 @category runtime bridge\n */\nexport * as RuntimeBridge from \"./RuntimeBridge.ts\"\n\n/**\n * The canonical durable journal synchronization package.\n *\n * @since 0.1.0\n * @category services\n */\nexport * as Sync from \"@smthrs/sync\"\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,mBAA8B;AAK9B,oBAA+B;AAK/B,gBAA2B;AAK3B,eAA0B;AAK1B,kBAA6B;AAK7B,kBAA6B;AAK7B,wBAAmC;AAKnC,kBAA6B;AAK7B,oBAA+B;AAK/B,kBAA6B;AAK7B,iBAA4B;AAK5B,oBAA+B;AAQ/B,WAAsB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,176 @@
1
+ /**
2
+ * Shared native gateway bind policy, credential policy,
3
+ * and the one composition a `smithers serve` verb hosts.
4
+ *
5
+ * Two rules decide whether a bind is allowed, and both fail closed:
6
+ *
7
+ * 1. A non-loopback host requires an explicit `listen` opt-in. Binding
8
+ * `0.0.0.0` because a port was free is how a workspace gateway ends up on
9
+ * a shared network by accident.
10
+ * 2. A non-loopback bind requires a bearer credential. The control plane can
11
+ * launch runs, cancel them, and approve capability grants; reachable from
12
+ * another machine, an unauthenticated one is a remote execution service.
13
+ *
14
+ * A loopback bind with no network credential allows anonymous reads; approval
15
+ * decisions require the session operator token. Ingress still checks Host and
16
+ * Origin so a web page cannot exercise the loopback endpoint.
17
+ *
18
+ * @since 1.0.0
19
+ */
20
+ import { ControlRpcs } from "@smthrs/control";
21
+ import { Effect, Layer } from "effect";
22
+ import type { HttpServer } from "effect/unstable/http/HttpServer";
23
+ import type { ServeError } from "effect/unstable/http/HttpServerError";
24
+ import type { ListenOptions } from "node:net";
25
+ import { GatewayError } from "../GatewayError.ts";
26
+ import * as GatewayServer from "../GatewayServer.ts";
27
+ import type * as RuntimeBridge from "../RuntimeBridge.ts";
28
+ /**
29
+ * Where the gateway binds, and whether a non-loopback bind was asked for.
30
+ *
31
+ * @since 1.0.0
32
+ * @category models
33
+ */
34
+ export interface ServerOptions extends ListenOptions {
35
+ /** Additional accepted Host header names (without ports), for network or proxy access. */
36
+ readonly allowedHosts?: ReadonlyArray<string> | undefined;
37
+ /** The `--listen` opt-in required for a non-loopback host. */
38
+ readonly listen?: boolean | undefined;
39
+ /** The shared bearer credential, required for a non-loopback bind. */
40
+ readonly credential?: string | undefined;
41
+ /** Per-session approval token on credential-free loopback. Read calls remain anonymous. */
42
+ readonly operatorToken?: string | undefined;
43
+ /**
44
+ * How often an idle followed `Watch` on `/rpc/ws` and an idle followed
45
+ * `Projection.Subscribe` on `/projections/ws` emit a keepalive frame. Unset,
46
+ * both run at `Projections.heartbeatIntervalMillis` unless the supplied
47
+ * `Projections` service was built with its own cadence. A relay with an idle
48
+ * cut shorter than that one needs a shorter cadence here.
49
+ */
50
+ readonly heartbeatMillis?: number | undefined;
51
+ /** Maximum bytes accepted on one HTTP RPC request. Default one MiB. */
52
+ readonly maxRequestBodyBytes?: number | undefined;
53
+ /** Immutable identity of an opt-in packaged Flow runtime bridge. */
54
+ readonly runtimeBridge?: Omit<RuntimeBridge.Config, "authenticate"> | undefined;
55
+ }
56
+ /**
57
+ * The default bind: loopback, port 7331, no credential.
58
+ *
59
+ * @since 1.0.0
60
+ * @category models
61
+ */
62
+ export declare const defaultServerOptions: ServerOptions;
63
+ /**
64
+ * Whether a host names this machine only.
65
+ *
66
+ * @param host the host to classify
67
+ * @since 1.0.0
68
+ * @category predicates
69
+ */
70
+ export declare const isLoopbackHost: (host: string) => boolean;
71
+ /**
72
+ * The typed refusal a requested bind earns, or `undefined` when it is allowed.
73
+ *
74
+ * Every start-time rule this module enforces answers here as a `bind_failed`
75
+ * `GatewayError`, so a host that wants to report a refusal rather than crash on
76
+ * one asks this before it composes a layer. {@link listenOptions} and
77
+ * {@link layer} fail with exactly what this returns.
78
+ *
79
+ * @param options the requested bind
80
+ * @since 1.0.0
81
+ * @category constructors
82
+ */
83
+ export declare const bindRefusal: (options: ServerOptions) => GatewayError | undefined;
84
+ /**
85
+ * Applies the bind policy, returning the admitted Node options or a typed
86
+ * `bind_failed` refusal.
87
+ *
88
+ * @param options the requested bind
89
+ * @since 1.0.0
90
+ * @category constructors
91
+ */
92
+ export declare const listenOptions: (options: ServerOptions) => Effect.Effect<ListenOptions, GatewayError>;
93
+ /**
94
+ * The authentication both RPC mounts run under.
95
+ *
96
+ * A configured credential authenticates every request that presents it and
97
+ * stamps the same server-owned principal. A scoped token minted under that
98
+ * credential (`@smthrs/control` `ScopedToken`) authenticates only the
99
+ * procedures, run, or flow it names, until it expires, and stamps
100
+ * {@link scopedPrincipal}. With no credential the composition is
101
+ * loopback-only (see {@link listenOptions}) and every request runs as the
102
+ * anonymous read principal. A session operator token alone stamps the local
103
+ * operator for approval decisions; without it approvals are unauthorized.
104
+ *
105
+ * @param options the requested bind
106
+ * @since 1.0.0
107
+ * @category layers
108
+ */
109
+ export declare const layerAuth: (options: ServerOptions) => Layer.Layer<ControlRpcs.ControlAuth>;
110
+ /**
111
+ * The identity stamped only after this gateway verifies its configured token.
112
+ * Hosts may explicitly delegate operator decisions to this exact identity.
113
+ * @category constants
114
+ * @since 1.0.0
115
+ */
116
+ export declare const bearerPrincipal: Readonly<{
117
+ id: "gateway";
118
+ kind: "bearer";
119
+ }>;
120
+ /**
121
+ * The protected mounts a scoped token may reach: those guarded in band by
122
+ * `ControlAuth`, which checks each frame's procedure against the token, and
123
+ * the ticket exchange that opens their sockets.
124
+ * @category constants
125
+ * @since 1.0.0
126
+ */
127
+ export declare const scopedTokenPaths: ReadonlyArray<string>;
128
+ /**
129
+ * The identity stamped after this gateway verifies a scoped token minted
130
+ * under its configured credential. It is its own kind so that delegating
131
+ * approval to {@link bearerPrincipal} does not delegate it to every token
132
+ * minted from the bearer; a host that wants a scoped `approve:runs` token to
133
+ * decide delegates to this identity explicitly.
134
+ * @category constants
135
+ * @since 1.0.0
136
+ */
137
+ export declare const scopedPrincipal: Readonly<{
138
+ id: "gateway";
139
+ kind: "scoped";
140
+ }>;
141
+ /**
142
+ * The ingress policy a requested bind runs behind.
143
+ *
144
+ * The accepted Host names are the loopback names, the operator's
145
+ * `allowedHosts`, and the concrete bind host itself, so `--host 192.168.1.10`
146
+ * is reachable at that address without naming it twice. A wildcard bind
147
+ * (`0.0.0.0` or `::`) adds nothing: every interface is not a Host name, and
148
+ * the operator names the reachable ones. Protected paths are authenticated
149
+ * before any request body is read.
150
+ *
151
+ * @param options the requested bind
152
+ * @since 1.0.0
153
+ * @category constructors
154
+ */
155
+ export declare const ingressOptions: (options: ServerOptions) => GatewayServer.IngressOptions;
156
+ /**
157
+ * Hosts the assembled gateway on an injected native HTTP server.
158
+ *
159
+ * Supplies the bind policy, the shared-credential authentication both RPC
160
+ * mounts run under, and newline-delimited JSON as the wire serialization. The
161
+ * caller supplies what the mounts read through: `Control`, `Projections`,
162
+ * `SyncServer`, and the `SyncAuth` middleware.
163
+ *
164
+ * The returned layer retains the concrete `HttpServer` service, so a caller
165
+ * that bound port 0 can read the ephemeral address it got.
166
+ *
167
+ * Policy refusals and operating-system listen failures both fail the layer as
168
+ * sanitized `bind_failed` `GatewayError` values.
169
+ *
170
+ * @param health the identity `GET /health` answers with
171
+ * @param options the requested bind
172
+ * @since 1.0.0
173
+ * @category layers
174
+ */
175
+ export declare const makeLayer: (server: (options: ListenOptions) => Layer.Layer<HttpServer, ServeError | GatewayError>) => (health: GatewayServer.Health, options?: ServerOptions) => Layer.Layer<HttpServer, GatewayError | import("@smthrs/sync/SyncError").SyncError, import("@smthrs/control/Control").Control | import("@smthrs/sync/SyncRpcs").SyncAuth | import("@smthrs/sync/SyncServer").SyncServer | import("../Projections.ts").Projections>;
176
+ //# sourceMappingURL=NativeGateway.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeGateway.d.ts","sourceRoot":"","sources":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