@pellux/goodvibes-sdk 0.38.0 → 1.1.0

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 (559) hide show
  1. package/dist/contracts/artifacts/operator-contract.json +4468 -916
  2. package/dist/daemon.d.ts +2 -0
  3. package/dist/daemon.d.ts.map +1 -1
  4. package/dist/daemon.js +4 -0
  5. package/dist/events/communication.d.ts +1 -1
  6. package/dist/events/surfaces.d.ts +25 -3
  7. package/dist/events/surfaces.d.ts.map +1 -1
  8. package/dist/events/surfaces.js +22 -1
  9. package/dist/events/workflows.d.ts +7 -6
  10. package/dist/events/workflows.d.ts.map +1 -1
  11. package/dist/index.d.ts +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/platform/agents/archetypes.d.ts.map +1 -1
  14. package/dist/platform/agents/archetypes.js +7 -0
  15. package/dist/platform/agents/index.d.ts +1 -0
  16. package/dist/platform/agents/index.d.ts.map +1 -1
  17. package/dist/platform/agents/index.js +1 -0
  18. package/dist/platform/agents/orchestrator-runner.d.ts +16 -3
  19. package/dist/platform/agents/orchestrator-runner.d.ts.map +1 -1
  20. package/dist/platform/agents/orchestrator-runner.js +20 -6
  21. package/dist/platform/agents/orchestrator.d.ts +42 -10
  22. package/dist/platform/agents/orchestrator.d.ts.map +1 -1
  23. package/dist/platform/agents/orchestrator.js +68 -20
  24. package/dist/platform/agents/planner-decomposition-runner.d.ts +38 -0
  25. package/dist/platform/agents/planner-decomposition-runner.d.ts.map +1 -0
  26. package/dist/platform/agents/planner-decomposition-runner.js +113 -0
  27. package/dist/platform/agents/turn-knowledge-injection.d.ts +88 -3
  28. package/dist/platform/agents/turn-knowledge-injection.d.ts.map +1 -1
  29. package/dist/platform/agents/turn-knowledge-injection.js +147 -30
  30. package/dist/platform/agents/worktree.d.ts +126 -8
  31. package/dist/platform/agents/worktree.d.ts.map +1 -1
  32. package/dist/platform/agents/worktree.js +240 -19
  33. package/dist/platform/agents/wrfc-controller.d.ts +24 -1
  34. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  35. package/dist/platform/agents/wrfc-controller.js +161 -35
  36. package/dist/platform/agents/wrfc-gate-runtime.d.ts +9 -0
  37. package/dist/platform/agents/wrfc-gate-runtime.d.ts.map +1 -1
  38. package/dist/platform/agents/wrfc-gate-runtime.js +7 -3
  39. package/dist/platform/agents/wrfc-gates.d.ts +1 -1
  40. package/dist/platform/agents/wrfc-gates.d.ts.map +1 -1
  41. package/dist/platform/agents/wrfc-gates.js +7 -1
  42. package/dist/platform/agents/wrfc-types.d.ts +23 -3
  43. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  44. package/dist/platform/automation/types.d.ts +9 -1
  45. package/dist/platform/automation/types.d.ts.map +1 -1
  46. package/dist/platform/calendar/calendar-api-shared.d.ts +25 -0
  47. package/dist/platform/calendar/calendar-api-shared.d.ts.map +1 -0
  48. package/dist/platform/calendar/calendar-api-shared.js +100 -0
  49. package/dist/platform/calendar/calendar-connector.d.ts +79 -0
  50. package/dist/platform/calendar/calendar-connector.d.ts.map +1 -0
  51. package/dist/platform/calendar/calendar-connector.js +155 -0
  52. package/dist/platform/calendar/google-calendar-api.d.ts +25 -0
  53. package/dist/platform/calendar/google-calendar-api.d.ts.map +1 -0
  54. package/dist/platform/calendar/google-calendar-api.js +89 -0
  55. package/dist/platform/calendar/http-fetch-adapter.d.ts +25 -0
  56. package/dist/platform/calendar/http-fetch-adapter.d.ts.map +1 -0
  57. package/dist/platform/calendar/http-fetch-adapter.js +25 -0
  58. package/dist/platform/calendar/ics-parser.d.ts +35 -0
  59. package/dist/platform/calendar/ics-parser.d.ts.map +1 -0
  60. package/dist/platform/calendar/ics-parser.js +236 -0
  61. package/dist/platform/calendar/index.d.ts +41 -0
  62. package/dist/platform/calendar/index.d.ts.map +1 -0
  63. package/dist/platform/calendar/index.js +49 -0
  64. package/dist/platform/calendar/merged-calendar-model.d.ts +67 -0
  65. package/dist/platform/calendar/merged-calendar-model.d.ts.map +1 -0
  66. package/dist/platform/calendar/merged-calendar-model.js +181 -0
  67. package/dist/platform/calendar/microsoft-graph-api.d.ts +25 -0
  68. package/dist/platform/calendar/microsoft-graph-api.d.ts.map +1 -0
  69. package/dist/platform/calendar/microsoft-graph-api.js +95 -0
  70. package/dist/platform/calendar/oauth-flow.d.ts +62 -0
  71. package/dist/platform/calendar/oauth-flow.d.ts.map +1 -0
  72. package/dist/platform/calendar/oauth-flow.js +305 -0
  73. package/dist/platform/calendar/oauth-providers.d.ts +43 -0
  74. package/dist/platform/calendar/oauth-providers.d.ts.map +1 -0
  75. package/dist/platform/calendar/oauth-providers.js +120 -0
  76. package/dist/platform/calendar/oauth-token-store.d.ts +72 -0
  77. package/dist/platform/calendar/oauth-token-store.d.ts.map +1 -0
  78. package/dist/platform/calendar/oauth-token-store.js +189 -0
  79. package/dist/platform/calendar/oauth-types.d.ts +274 -0
  80. package/dist/platform/calendar/oauth-types.d.ts.map +1 -0
  81. package/dist/platform/calendar/oauth-types.js +22 -0
  82. package/dist/platform/calendar/rrule.d.ts +39 -0
  83. package/dist/platform/calendar/rrule.d.ts.map +1 -0
  84. package/dist/platform/calendar/rrule.js +261 -0
  85. package/dist/platform/calendar/subscription-store.d.ts +118 -0
  86. package/dist/platform/calendar/subscription-store.d.ts.map +1 -0
  87. package/dist/platform/calendar/subscription-store.js +293 -0
  88. package/dist/platform/calendar/types.d.ts +170 -0
  89. package/dist/platform/calendar/types.d.ts.map +1 -0
  90. package/dist/platform/calendar/types.js +21 -0
  91. package/dist/platform/companion/companion-chat-attachments.d.ts +29 -0
  92. package/dist/platform/companion/companion-chat-attachments.d.ts.map +1 -0
  93. package/dist/platform/companion/companion-chat-attachments.js +121 -0
  94. package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
  95. package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
  96. package/dist/platform/companion/companion-chat-branching.js +142 -0
  97. package/dist/platform/companion/companion-chat-broker-bridge.d.ts +40 -0
  98. package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -0
  99. package/dist/platform/companion/companion-chat-broker-bridge.js +14 -0
  100. package/dist/platform/companion/companion-chat-broker-sync.d.ts +38 -0
  101. package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -0
  102. package/dist/platform/companion/companion-chat-broker-sync.js +80 -0
  103. package/dist/platform/companion/companion-chat-gc.d.ts +63 -0
  104. package/dist/platform/companion/companion-chat-gc.d.ts.map +1 -0
  105. package/dist/platform/companion/companion-chat-gc.js +38 -0
  106. package/dist/platform/companion/companion-chat-manager.d.ts +91 -23
  107. package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
  108. package/dist/platform/companion/companion-chat-manager.js +195 -223
  109. package/dist/platform/companion/companion-chat-persistence.d.ts +9 -1
  110. package/dist/platform/companion/companion-chat-persistence.d.ts.map +1 -1
  111. package/dist/platform/companion/companion-chat-persistence.js +10 -2
  112. package/dist/platform/companion/companion-chat-routes.d.ts +2 -1
  113. package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
  114. package/dist/platform/companion/companion-chat-routes.js +113 -4
  115. package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
  116. package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
  117. package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
  118. package/dist/platform/companion/companion-chat-types.d.ts +67 -0
  119. package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
  120. package/dist/platform/config/credential-status.d.ts +28 -0
  121. package/dist/platform/config/credential-status.d.ts.map +1 -0
  122. package/dist/platform/config/credential-status.js +75 -0
  123. package/dist/platform/config/index.d.ts +25 -0
  124. package/dist/platform/config/index.d.ts.map +1 -1
  125. package/dist/platform/config/index.js +18 -0
  126. package/dist/platform/config/manager.d.ts +9 -0
  127. package/dist/platform/config/manager.d.ts.map +1 -1
  128. package/dist/platform/config/manager.js +21 -2
  129. package/dist/platform/config/migrations.d.ts +48 -0
  130. package/dist/platform/config/migrations.d.ts.map +1 -0
  131. package/dist/platform/config/migrations.js +54 -0
  132. package/dist/platform/config/schema-domain-core.d.ts +10 -1
  133. package/dist/platform/config/schema-domain-core.d.ts.map +1 -1
  134. package/dist/platform/config/schema-domain-core.js +46 -3
  135. package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
  136. package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
  137. package/dist/platform/config/schema-domain-runtime.js +32 -0
  138. package/dist/platform/config/schema-types.d.ts +21 -7
  139. package/dist/platform/config/schema-types.d.ts.map +1 -1
  140. package/dist/platform/config/schema.d.ts.map +1 -1
  141. package/dist/platform/config/schema.js +2 -0
  142. package/dist/platform/control-plane/approval-broker.d.ts +11 -0
  143. package/dist/platform/control-plane/approval-broker.d.ts.map +1 -1
  144. package/dist/platform/control-plane/approval-broker.js +17 -1
  145. package/dist/platform/control-plane/approval-hunk-apply.d.ts +77 -0
  146. package/dist/platform/control-plane/approval-hunk-apply.d.ts.map +1 -0
  147. package/dist/platform/control-plane/approval-hunk-apply.js +80 -0
  148. package/dist/platform/control-plane/gateway-disabled-response.d.ts +20 -0
  149. package/dist/platform/control-plane/gateway-disabled-response.d.ts.map +1 -0
  150. package/dist/platform/control-plane/gateway-disabled-response.js +24 -0
  151. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts +68 -0
  152. package/dist/platform/control-plane/gateway-scope-enforcement.d.ts.map +1 -0
  153. package/dist/platform/control-plane/gateway-scope-enforcement.js +91 -0
  154. package/dist/platform/control-plane/gateway-utils.d.ts +17 -0
  155. package/dist/platform/control-plane/gateway-utils.d.ts.map +1 -1
  156. package/dist/platform/control-plane/gateway-utils.js +30 -0
  157. package/dist/platform/control-plane/gateway.d.ts +12 -2
  158. package/dist/platform/control-plane/gateway.d.ts.map +1 -1
  159. package/dist/platform/control-plane/gateway.js +27 -31
  160. package/dist/platform/control-plane/index.d.ts +8 -1
  161. package/dist/platform/control-plane/index.d.ts.map +1 -1
  162. package/dist/platform/control-plane/index.js +8 -0
  163. package/dist/platform/control-plane/invoke-input-validation.d.ts +56 -0
  164. package/dist/platform/control-plane/invoke-input-validation.d.ts.map +1 -0
  165. package/dist/platform/control-plane/invoke-input-validation.js +163 -0
  166. package/dist/platform/control-plane/method-catalog-admin.d.ts.map +1 -1
  167. package/dist/platform/control-plane/method-catalog-admin.js +12 -1
  168. package/dist/platform/control-plane/method-catalog-calendar.d.ts +16 -0
  169. package/dist/platform/control-plane/method-catalog-calendar.d.ts.map +1 -1
  170. package/dist/platform/control-plane/method-catalog-calendar.js +21 -0
  171. package/dist/platform/control-plane/method-catalog-channels.d.ts.map +1 -1
  172. package/dist/platform/control-plane/method-catalog-channels.js +32 -3
  173. package/dist/platform/control-plane/method-catalog-control-automation.d.ts.map +1 -1
  174. package/dist/platform/control-plane/method-catalog-control-automation.js +19 -34
  175. package/dist/platform/control-plane/method-catalog-control-companion.d.ts +15 -0
  176. package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -0
  177. package/dist/platform/control-plane/method-catalog-control-companion.js +176 -0
  178. package/dist/platform/control-plane/method-catalog-control-core.d.ts.map +1 -1
  179. package/dist/platform/control-plane/method-catalog-control-core.js +104 -122
  180. package/dist/platform/control-plane/method-catalog-control.d.ts.map +1 -1
  181. package/dist/platform/control-plane/method-catalog-control.js +4 -0
  182. package/dist/platform/control-plane/method-catalog-email.d.ts +17 -0
  183. package/dist/platform/control-plane/method-catalog-email.d.ts.map +1 -1
  184. package/dist/platform/control-plane/method-catalog-email.js +21 -0
  185. package/dist/platform/control-plane/method-catalog-events.d.ts +28 -0
  186. package/dist/platform/control-plane/method-catalog-events.d.ts.map +1 -1
  187. package/dist/platform/control-plane/method-catalog-events.js +74 -1
  188. package/dist/platform/control-plane/method-catalog-fleet.d.ts +24 -0
  189. package/dist/platform/control-plane/method-catalog-fleet.d.ts.map +1 -0
  190. package/dist/platform/control-plane/method-catalog-fleet.js +65 -0
  191. package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
  192. package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
  193. package/dist/platform/control-plane/method-catalog-push.js +80 -0
  194. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +84 -0
  195. package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts.map +1 -0
  196. package/dist/platform/control-plane/method-catalog-route-reconcile.js +103 -0
  197. package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
  198. package/dist/platform/control-plane/method-catalog-runtime.js +83 -1
  199. package/dist/platform/control-plane/method-catalog-shared.d.ts +29 -0
  200. package/dist/platform/control-plane/method-catalog-shared.d.ts.map +1 -1
  201. package/dist/platform/control-plane/method-catalog.d.ts +9 -0
  202. package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
  203. package/dist/platform/control-plane/method-catalog.js +34 -3
  204. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts +8 -0
  205. package/dist/platform/control-plane/operator-contract-schemas-admin.d.ts.map +1 -1
  206. package/dist/platform/control-plane/operator-contract-schemas-admin.js +22 -1
  207. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts +18 -0
  208. package/dist/platform/control-plane/operator-contract-schemas-fleet.d.ts.map +1 -0
  209. package/dist/platform/control-plane/operator-contract-schemas-fleet.js +182 -0
  210. package/dist/platform/control-plane/operator-contract-schemas-permissions.d.ts.map +1 -1
  211. package/dist/platform/control-plane/operator-contract-schemas-permissions.js +5 -0
  212. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +37 -0
  213. package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
  214. package/dist/platform/control-plane/operator-contract-schemas-runtime.js +100 -3
  215. package/dist/platform/control-plane/operator-contract-schemas.d.ts +1 -0
  216. package/dist/platform/control-plane/operator-contract-schemas.d.ts.map +1 -1
  217. package/dist/platform/control-plane/operator-contract-schemas.js +1 -0
  218. package/dist/platform/control-plane/operator-contract.d.ts.map +1 -1
  219. package/dist/platform/control-plane/operator-contract.js +8 -0
  220. package/dist/platform/control-plane/routes/checkpoints.d.ts +39 -0
  221. package/dist/platform/control-plane/routes/checkpoints.d.ts.map +1 -0
  222. package/dist/platform/control-plane/routes/checkpoints.js +166 -0
  223. package/dist/platform/control-plane/routes/fleet.d.ts +53 -0
  224. package/dist/platform/control-plane/routes/fleet.d.ts.map +1 -0
  225. package/dist/platform/control-plane/routes/fleet.js +153 -0
  226. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +30 -0
  227. package/dist/platform/control-plane/routes/gateway-verb-error.d.ts.map +1 -0
  228. package/dist/platform/control-plane/routes/gateway-verb-error.js +36 -0
  229. package/dist/platform/control-plane/routes/index.d.ts +0 -6
  230. package/dist/platform/control-plane/routes/index.d.ts.map +1 -1
  231. package/dist/platform/control-plane/routes/index.js +5 -5
  232. package/dist/platform/control-plane/routes/invocation-params.d.ts +23 -0
  233. package/dist/platform/control-plane/routes/invocation-params.d.ts.map +1 -0
  234. package/dist/platform/control-plane/routes/invocation-params.js +9 -0
  235. package/dist/platform/control-plane/routes/push.d.ts +26 -0
  236. package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
  237. package/dist/platform/control-plane/routes/push.js +104 -0
  238. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
  239. package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
  240. package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
  241. package/dist/platform/control-plane/routes/register-w3-s2.d.ts +26 -0
  242. package/dist/platform/control-plane/routes/register-w3-s2.d.ts.map +1 -0
  243. package/dist/platform/control-plane/routes/register-w3-s2.js +8 -0
  244. package/dist/platform/control-plane/routes/session-search.d.ts +37 -0
  245. package/dist/platform/control-plane/routes/session-search.d.ts.map +1 -0
  246. package/dist/platform/control-plane/routes/session-search.js +113 -0
  247. package/dist/platform/control-plane/session-broker-gc.d.ts +16 -0
  248. package/dist/platform/control-plane/session-broker-gc.d.ts.map +1 -1
  249. package/dist/platform/control-plane/session-broker-gc.js +23 -6
  250. package/dist/platform/control-plane/session-broker-helpers.d.ts +3 -3
  251. package/dist/platform/control-plane/session-broker-helpers.d.ts.map +1 -1
  252. package/dist/platform/control-plane/session-broker-inputs.d.ts +18 -0
  253. package/dist/platform/control-plane/session-broker-inputs.d.ts.map +1 -1
  254. package/dist/platform/control-plane/session-broker-inputs.js +34 -0
  255. package/dist/platform/control-plane/session-broker-sessions.d.ts +102 -3
  256. package/dist/platform/control-plane/session-broker-sessions.d.ts.map +1 -1
  257. package/dist/platform/control-plane/session-broker-sessions.js +179 -5
  258. package/dist/platform/control-plane/session-broker-state.d.ts +20 -1
  259. package/dist/platform/control-plane/session-broker-state.d.ts.map +1 -1
  260. package/dist/platform/control-plane/session-broker-state.js +67 -5
  261. package/dist/platform/control-plane/session-broker.d.ts +51 -38
  262. package/dist/platform/control-plane/session-broker.d.ts.map +1 -1
  263. package/dist/platform/control-plane/session-broker.js +183 -75
  264. package/dist/platform/control-plane/session-store-importer.d.ts +57 -0
  265. package/dist/platform/control-plane/session-store-importer.d.ts.map +1 -0
  266. package/dist/platform/control-plane/session-store-importer.js +227 -0
  267. package/dist/platform/control-plane/session-types.d.ts +142 -7
  268. package/dist/platform/control-plane/session-types.d.ts.map +1 -1
  269. package/dist/platform/core/execution-plan.d.ts +43 -1
  270. package/dist/platform/core/execution-plan.d.ts.map +1 -1
  271. package/dist/platform/core/execution-plan.js +46 -10
  272. package/dist/platform/core/index.d.ts +1 -0
  273. package/dist/platform/core/index.d.ts.map +1 -1
  274. package/dist/platform/core/index.js +1 -0
  275. package/dist/platform/core/orchestrator-runtime.d.ts +23 -3
  276. package/dist/platform/core/orchestrator-runtime.d.ts.map +1 -1
  277. package/dist/platform/core/orchestrator-tool-runtime.d.ts +7 -0
  278. package/dist/platform/core/orchestrator-tool-runtime.d.ts.map +1 -1
  279. package/dist/platform/core/orchestrator-tool-runtime.js +10 -0
  280. package/dist/platform/core/orchestrator-turn-loop.d.ts +13 -6
  281. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  282. package/dist/platform/core/orchestrator-turn-loop.js +29 -22
  283. package/dist/platform/core/orchestrator.d.ts +16 -10
  284. package/dist/platform/core/orchestrator.d.ts.map +1 -1
  285. package/dist/platform/core/orchestrator.js +23 -8
  286. package/dist/platform/core/plan-decomposition.d.ts +196 -0
  287. package/dist/platform/core/plan-decomposition.d.ts.map +1 -0
  288. package/dist/platform/core/plan-decomposition.js +417 -0
  289. package/dist/platform/core/plan-proposal.d.ts +39 -0
  290. package/dist/platform/core/plan-proposal.d.ts.map +1 -1
  291. package/dist/platform/core/wrfc-routing.d.ts +1 -0
  292. package/dist/platform/core/wrfc-routing.d.ts.map +1 -1
  293. package/dist/platform/core/wrfc-routing.js +51 -1
  294. package/dist/platform/daemon/boot.d.ts +69 -0
  295. package/dist/platform/daemon/boot.d.ts.map +1 -0
  296. package/dist/platform/daemon/boot.js +61 -0
  297. package/dist/platform/daemon/cli.js +2 -1
  298. package/dist/platform/daemon/control-plane.d.ts.map +1 -1
  299. package/dist/platform/daemon/control-plane.js +50 -1
  300. package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
  301. package/dist/platform/daemon/facade-composition.js +6 -0
  302. package/dist/platform/daemon/facade.d.ts +15 -6
  303. package/dist/platform/daemon/facade.d.ts.map +1 -1
  304. package/dist/platform/daemon/facade.js +48 -43
  305. package/dist/platform/daemon/http/router-route-contexts.d.ts +1 -0
  306. package/dist/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
  307. package/dist/platform/daemon/http/router-route-contexts.js +1 -0
  308. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +13 -0
  309. package/dist/platform/daemon/http/router-session-broker-adapter.d.ts.map +1 -0
  310. package/dist/platform/daemon/http/router-session-broker-adapter.js +27 -0
  311. package/dist/platform/daemon/http/router.d.ts +2 -1
  312. package/dist/platform/daemon/http/router.d.ts.map +1 -1
  313. package/dist/platform/daemon/http/router.js +42 -40
  314. package/dist/platform/daemon/http/runtime-route-types.d.ts +42 -4
  315. package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
  316. package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
  317. package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
  318. package/dist/platform/daemon/http/webui-serving.js +230 -0
  319. package/dist/platform/daemon/index.d.ts +2 -0
  320. package/dist/platform/daemon/index.d.ts.map +1 -1
  321. package/dist/platform/daemon/index.js +1 -0
  322. package/dist/platform/daemon/service-manager.d.ts +16 -0
  323. package/dist/platform/daemon/service-manager.d.ts.map +1 -1
  324. package/dist/platform/daemon/service-manager.js +79 -15
  325. package/dist/platform/intelligence/tree-sitter/service.d.ts.map +1 -1
  326. package/dist/platform/intelligence/tree-sitter/service.js +16 -2
  327. package/dist/platform/knowledge/browser-history/readers.d.ts.map +1 -1
  328. package/dist/platform/knowledge/browser-history/readers.js +15 -5
  329. package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
  330. package/dist/platform/knowledge/project-planning/service.d.ts +14 -1
  331. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  332. package/dist/platform/knowledge/project-planning/service.js +77 -0
  333. package/dist/platform/knowledge/project-planning/types.d.ts +32 -0
  334. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  335. package/dist/platform/orchestration/bookkeeping.d.ts +12 -0
  336. package/dist/platform/orchestration/bookkeeping.d.ts.map +1 -0
  337. package/dist/platform/orchestration/bookkeeping.js +91 -0
  338. package/dist/platform/orchestration/budget.d.ts +2 -2
  339. package/dist/platform/orchestration/cancellation.d.ts +2 -2
  340. package/dist/platform/orchestration/controller-compat.d.ts +16 -3
  341. package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
  342. package/dist/platform/orchestration/controller-compat.js +18 -4
  343. package/dist/platform/orchestration/dirty-guard.js +1 -1
  344. package/dist/platform/orchestration/engine.d.ts +26 -1
  345. package/dist/platform/orchestration/engine.d.ts.map +1 -1
  346. package/dist/platform/orchestration/engine.js +229 -25
  347. package/dist/platform/orchestration/index.d.ts +6 -4
  348. package/dist/platform/orchestration/index.d.ts.map +1 -1
  349. package/dist/platform/orchestration/index.js +3 -2
  350. package/dist/platform/orchestration/persistence.d.ts.map +1 -1
  351. package/dist/platform/orchestration/persistence.js +6 -3
  352. package/dist/platform/orchestration/phase-runner.d.ts +33 -6
  353. package/dist/platform/orchestration/phase-runner.d.ts.map +1 -1
  354. package/dist/platform/orchestration/phase-runner.js +98 -25
  355. package/dist/platform/orchestration/proposal-workstream.d.ts +56 -0
  356. package/dist/platform/orchestration/proposal-workstream.d.ts.map +1 -0
  357. package/dist/platform/orchestration/proposal-workstream.js +76 -0
  358. package/dist/platform/orchestration/scheduler.d.ts +20 -1
  359. package/dist/platform/orchestration/scheduler.d.ts.map +1 -1
  360. package/dist/platform/orchestration/scheduler.js +16 -0
  361. package/dist/platform/orchestration/types.d.ts +289 -4
  362. package/dist/platform/orchestration/types.d.ts.map +1 -1
  363. package/dist/platform/orchestration/types.js +32 -0
  364. package/dist/platform/orchestration/worktree-isolation.d.ts +33 -0
  365. package/dist/platform/orchestration/worktree-isolation.d.ts.map +1 -0
  366. package/dist/platform/orchestration/worktree-isolation.js +248 -0
  367. package/dist/platform/presentation/glyphs.d.ts +91 -0
  368. package/dist/platform/presentation/glyphs.d.ts.map +1 -0
  369. package/dist/platform/presentation/glyphs.js +93 -0
  370. package/dist/platform/presentation/index.d.ts +28 -0
  371. package/dist/platform/presentation/index.d.ts.map +1 -0
  372. package/dist/platform/presentation/index.js +27 -0
  373. package/dist/platform/presentation/thinking-phrases.d.ts +12 -0
  374. package/dist/platform/presentation/thinking-phrases.d.ts.map +1 -0
  375. package/dist/platform/presentation/thinking-phrases.js +32 -0
  376. package/dist/platform/presentation/tones.d.ts +121 -0
  377. package/dist/platform/presentation/tones.d.ts.map +1 -0
  378. package/dist/platform/presentation/tones.js +145 -0
  379. package/dist/platform/presentation/waiting-wording.d.ts +54 -0
  380. package/dist/platform/presentation/waiting-wording.d.ts.map +1 -0
  381. package/dist/platform/presentation/waiting-wording.js +51 -0
  382. package/dist/platform/providers/runtime-snapshot.d.ts.map +1 -1
  383. package/dist/platform/providers/runtime-snapshot.js +12 -2
  384. package/dist/platform/push/delivery.d.ts +48 -0
  385. package/dist/platform/push/delivery.d.ts.map +1 -0
  386. package/dist/platform/push/delivery.js +117 -0
  387. package/dist/platform/push/encryption.d.ts +41 -0
  388. package/dist/platform/push/encryption.d.ts.map +1 -0
  389. package/dist/platform/push/encryption.js +82 -0
  390. package/dist/platform/push/index.d.ts +17 -0
  391. package/dist/platform/push/index.d.ts.map +1 -0
  392. package/dist/platform/push/index.js +10 -0
  393. package/dist/platform/push/service.d.ts +75 -0
  394. package/dist/platform/push/service.d.ts.map +1 -0
  395. package/dist/platform/push/service.js +95 -0
  396. package/dist/platform/push/subscription-store.d.ts +50 -0
  397. package/dist/platform/push/subscription-store.d.ts.map +1 -0
  398. package/dist/platform/push/subscription-store.js +123 -0
  399. package/dist/platform/push/types.d.ts +68 -0
  400. package/dist/platform/push/types.d.ts.map +1 -0
  401. package/dist/platform/push/types.js +13 -0
  402. package/dist/platform/push/vapid.d.ts +54 -0
  403. package/dist/platform/push/vapid.d.ts.map +1 -0
  404. package/dist/platform/push/vapid.js +113 -0
  405. package/dist/platform/runtime/bootstrap-services.d.ts +62 -2
  406. package/dist/platform/runtime/bootstrap-services.d.ts.map +1 -1
  407. package/dist/platform/runtime/bootstrap-services.js +217 -50
  408. package/dist/platform/runtime/daemon-version-compat.d.ts +39 -0
  409. package/dist/platform/runtime/daemon-version-compat.d.ts.map +1 -0
  410. package/dist/platform/runtime/daemon-version-compat.js +75 -0
  411. package/dist/platform/runtime/detached-daemon-runtime.d.ts +26 -0
  412. package/dist/platform/runtime/detached-daemon-runtime.d.ts.map +1 -0
  413. package/dist/platform/runtime/detached-daemon-runtime.js +49 -0
  414. package/dist/platform/runtime/emitters/workflows.d.ts +1 -1
  415. package/dist/platform/runtime/emitters/workflows.d.ts.map +1 -1
  416. package/dist/platform/runtime/events/index.d.ts +13 -0
  417. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  418. package/dist/platform/runtime/events/index.js +13 -0
  419. package/dist/platform/runtime/feature-flags/flags.d.ts.map +1 -1
  420. package/dist/platform/runtime/feature-flags/flags.js +39 -1
  421. package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
  422. package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
  423. package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
  424. package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
  425. package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
  426. package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
  427. package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
  428. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts +40 -18
  429. package/dist/platform/runtime/fleet/adapters/orchestration.d.ts.map +1 -1
  430. package/dist/platform/runtime/fleet/adapters/orchestration.js +138 -34
  431. package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
  432. package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
  433. package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
  434. package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
  435. package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
  436. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts +13 -0
  437. package/dist/platform/runtime/fleet/adapters/wrfc.d.ts.map +1 -1
  438. package/dist/platform/runtime/fleet/adapters/wrfc.js +49 -2
  439. package/dist/platform/runtime/fleet/registry.d.ts +7 -7
  440. package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
  441. package/dist/platform/runtime/fleet/registry.js +41 -7
  442. package/dist/platform/runtime/fleet/types.d.ts +9 -9
  443. package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
  444. package/dist/platform/runtime/memory-spine/client.d.ts +127 -0
  445. package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
  446. package/dist/platform/runtime/memory-spine/client.js +113 -0
  447. package/dist/platform/runtime/memory-spine/index.d.ts +11 -0
  448. package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
  449. package/dist/platform/runtime/memory-spine/index.js +10 -0
  450. package/dist/platform/runtime/operator-client.d.ts +20 -2
  451. package/dist/platform/runtime/operator-client.d.ts.map +1 -1
  452. package/dist/platform/runtime/operator-client.js +11 -1
  453. package/dist/platform/runtime/provider-accounts/registry.d.ts.map +1 -1
  454. package/dist/platform/runtime/provider-accounts/registry.js +11 -1
  455. package/dist/platform/runtime/services.d.ts +11 -9
  456. package/dist/platform/runtime/services.d.ts.map +1 -1
  457. package/dist/platform/runtime/services.js +24 -9
  458. package/dist/platform/runtime/session-spine/client.d.ts +234 -0
  459. package/dist/platform/runtime/session-spine/client.d.ts.map +1 -0
  460. package/dist/platform/runtime/session-spine/client.js +449 -0
  461. package/dist/platform/runtime/session-spine/index.d.ts +12 -0
  462. package/dist/platform/runtime/session-spine/index.d.ts.map +1 -0
  463. package/dist/platform/runtime/session-spine/index.js +11 -0
  464. package/dist/platform/runtime/session-spine/union-cache.d.ts +225 -0
  465. package/dist/platform/runtime/session-spine/union-cache.d.ts.map +1 -0
  466. package/dist/platform/runtime/session-spine/union-cache.js +333 -0
  467. package/dist/platform/runtime/shell-command-ops.d.ts +3 -1
  468. package/dist/platform/runtime/shell-command-ops.d.ts.map +1 -1
  469. package/dist/platform/runtime/transports/daemon-http-client-validators.d.ts.map +1 -1
  470. package/dist/platform/runtime/transports/daemon-http-client-validators.js +22 -0
  471. package/dist/platform/runtime/transports/daemon-http-client.d.ts.map +1 -1
  472. package/dist/platform/runtime/transports/daemon-http-client.js +25 -2
  473. package/dist/platform/runtime/transports/http-types.d.ts +9 -2
  474. package/dist/platform/runtime/transports/http-types.d.ts.map +1 -1
  475. package/dist/platform/state/canonical-memory.d.ts +95 -0
  476. package/dist/platform/state/canonical-memory.d.ts.map +1 -0
  477. package/dist/platform/state/canonical-memory.js +155 -0
  478. package/dist/platform/state/code-index-chunking.js +1 -1
  479. package/dist/platform/state/code-index-db.d.ts +1 -1
  480. package/dist/platform/state/code-index-reindex.d.ts +73 -0
  481. package/dist/platform/state/code-index-reindex.d.ts.map +1 -0
  482. package/dist/platform/state/code-index-reindex.js +156 -0
  483. package/dist/platform/state/code-index-store.d.ts.map +1 -1
  484. package/dist/platform/state/code-index-store.js +11 -3
  485. package/dist/platform/state/index.d.ts +8 -0
  486. package/dist/platform/state/index.d.ts.map +1 -1
  487. package/dist/platform/state/index.js +4 -0
  488. package/dist/platform/state/memory-recall-contract.d.ts +118 -0
  489. package/dist/platform/state/memory-recall-contract.d.ts.map +1 -0
  490. package/dist/platform/state/memory-recall-contract.js +170 -0
  491. package/dist/platform/state/memory-registry.d.ts +8 -0
  492. package/dist/platform/state/memory-registry.d.ts.map +1 -1
  493. package/dist/platform/state/memory-registry.js +10 -0
  494. package/dist/platform/state/memory-store.d.ts +2 -0
  495. package/dist/platform/state/memory-store.d.ts.map +1 -1
  496. package/dist/platform/state/memory-store.js +4 -0
  497. package/dist/platform/state/memory-vector-store.d.ts.map +1 -1
  498. package/dist/platform/state/memory-vector-store.js +14 -3
  499. package/dist/platform/state/sqlite-store.d.ts +2 -0
  500. package/dist/platform/state/sqlite-store.d.ts.map +1 -1
  501. package/dist/platform/state/sqlite-store.js +4 -0
  502. package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
  503. package/dist/platform/state/sqlite-vec-loader.js +1 -1
  504. package/dist/platform/state/vibe-projection.d.ts +67 -0
  505. package/dist/platform/state/vibe-projection.d.ts.map +1 -0
  506. package/dist/platform/state/vibe-projection.js +115 -0
  507. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  508. package/dist/platform/tools/agent/index.js +8 -0
  509. package/dist/platform/tools/agent/manager.d.ts +22 -10
  510. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  511. package/dist/platform/tools/agent/manager.js +13 -7
  512. package/dist/platform/tools/agent/schema.d.ts +26 -0
  513. package/dist/platform/tools/agent/schema.d.ts.map +1 -1
  514. package/dist/platform/tools/agent/schema.js +2 -2
  515. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts +13 -0
  516. package/dist/platform/tools/agent/wrfc-batch-policy.d.ts.map +1 -1
  517. package/dist/platform/tools/agent/wrfc-batch-policy.js +60 -0
  518. package/dist/platform/tools/exec/runtime.d.ts +10 -0
  519. package/dist/platform/tools/exec/runtime.d.ts.map +1 -1
  520. package/dist/platform/tools/exec/runtime.js +27 -10
  521. package/dist/platform/tools/exec/schema.d.ts +2 -2
  522. package/dist/platform/tools/exec/schema.d.ts.map +1 -1
  523. package/dist/platform/tools/exec/schema.js +2 -1
  524. package/dist/platform/tools/fetch/runtime.d.ts +1 -1
  525. package/dist/platform/tools/index.d.ts +2 -0
  526. package/dist/platform/tools/index.d.ts.map +1 -1
  527. package/dist/platform/tools/index.js +2 -0
  528. package/dist/platform/tools/registry.d.ts +1 -1
  529. package/dist/platform/tools/registry.js +1 -1
  530. package/dist/platform/tools/state/index.d.ts +9 -0
  531. package/dist/platform/tools/state/index.d.ts.map +1 -1
  532. package/dist/platform/tools/state/index.js +60 -3
  533. package/dist/platform/types/foundation-contract.d.ts +1 -1
  534. package/dist/platform/types/foundation-contract.d.ts.map +1 -1
  535. package/dist/platform/types/index.d.ts +1 -1
  536. package/dist/platform/types/index.d.ts.map +1 -1
  537. package/dist/platform/types/tools.d.ts +1 -1
  538. package/dist/platform/utils/request-body.d.ts.map +1 -1
  539. package/dist/platform/utils/request-body.js +50 -5
  540. package/dist/platform/version.js +1 -1
  541. package/package.json +25 -9
  542. package/dist/platform/control-plane/routes/automation.d.ts +0 -3
  543. package/dist/platform/control-plane/routes/automation.d.ts.map +0 -1
  544. package/dist/platform/control-plane/routes/automation.js +0 -63
  545. package/dist/platform/control-plane/routes/context.d.ts +0 -2
  546. package/dist/platform/control-plane/routes/context.d.ts.map +0 -1
  547. package/dist/platform/control-plane/routes/context.js +0 -1
  548. package/dist/platform/control-plane/routes/operator.d.ts +0 -8
  549. package/dist/platform/control-plane/routes/operator.d.ts.map +0 -1
  550. package/dist/platform/control-plane/routes/operator.js +0 -415
  551. package/dist/platform/control-plane/routes/remote.d.ts +0 -3
  552. package/dist/platform/control-plane/routes/remote.d.ts.map +0 -1
  553. package/dist/platform/control-plane/routes/remote.js +0 -35
  554. package/dist/platform/control-plane/routes/sessions.d.ts +0 -3
  555. package/dist/platform/control-plane/routes/sessions.d.ts.map +0 -1
  556. package/dist/platform/control-plane/routes/sessions.js +0 -43
  557. package/dist/platform/control-plane/routes/tasks.d.ts +0 -3
  558. package/dist/platform/control-plane/routes/tasks.d.ts.map +0 -1
  559. package/dist/platform/control-plane/routes/tasks.js +0 -22
@@ -1 +1 @@
1
- {"version":3,"file":"gateway-utils.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/gateway-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAE5G,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,qBAAqB,EAAE,wBAMnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,kBAAkB,EAexD,CAAC;AAEF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE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CAAC,EAAE,MAAM,KAAK,IAAI,EAC5D,OAAO,EAAE,+BAA+B,EACxC,aAAa,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,IAAI,EACrD,OAAO,CAAC,EAAE,MAAM,GACf,IAAI,CAUN"}
@@ -1,4 +1,5 @@
1
1
  import { isRuntimeEventDomain } from '../runtime/events/index.js';
2
+ import { clientMayReceiveEventDomain } from './gateway-scope-enforcement.js';
2
3
  export const DEFAULT_SERVER_CONFIG = {
3
4
  enabled: false,
4
5
  host: '127.0.0.1',
@@ -95,3 +96,32 @@ export function pruneDisconnectedClientRecords(clients, now = Date.now()) {
95
96
  clients.delete(client.id);
96
97
  }
97
98
  }
99
+ /**
100
+ * Replay recent traffic to a freshly-connected client. Mirrors live delivery:
101
+ * canReplayEventToClient applies the kind/route/surface/domain-name filters, and
102
+ * the EVENT_DOMAIN broadcast-domain filter is applied on top so a domain-narrowed
103
+ * client is not handed a replayed broadcast (e.g. session-update) for a domain it
104
+ * did not subscribe to.
105
+ *
106
+ * `replayDomains` MUST be the same null-or-set value the caller registered on the
107
+ * live client (`LiveControlPlaneClient.domains`) — null when the client did NOT
108
+ * opt into narrowing (deliver-all, matching live), a `Set` when it did. Do NOT
109
+ * derive this from `options.domains` here: by the time options reaches this
110
+ * function it has already been normalized (empty/undefined domains fall back to
111
+ * DEFAULT_DOMAINS, which excludes e.g. 'permissions'), so re-deriving from it
112
+ * would always look "explicit" and silently narrow every default consumer's
113
+ * replay — the bug this parameter exists to prevent.
114
+ */
115
+ export function replayRecentTraffic(recentEvents, send, options, replayDomains, sinceId) {
116
+ const sinceIndex = sinceId ? recentEvents.findIndex((event) => event.id === sinceId) : -1;
117
+ const window = sinceIndex >= 0
118
+ ? recentEvents.slice(0, sinceIndex).reverse()
119
+ : recentEvents.slice(0, 20).reverse();
120
+ for (const recentEvent of window) {
121
+ if (!canReplayEventToClient(recentEvent, options))
122
+ continue;
123
+ if (!clientMayReceiveEventDomain(replayDomains, recentEvent.event))
124
+ continue;
125
+ send(recentEvent.event, recentEvent.payload, recentEvent.id);
126
+ }
127
+ }
@@ -1,7 +1,7 @@
1
1
  import type { RuntimeStore } from '../runtime/store/index.js';
2
2
  import type { RuntimeEventBus, RuntimeEventDomain } from '../runtime/events/index.js';
3
3
  import type { ControlPlaneClientDescriptor, ControlPlaneServerConfig, ControlPlaneSurfaceMessage } from './types.js';
4
- import type { FeatureFlagReader } from '../runtime/feature-flags/index.js';
4
+ import { type FeatureFlagReader } from '../runtime/feature-flags/index.js';
5
5
  import { DEFAULT_DOMAINS, type ControlPlaneRecentEvent } from './gateway-utils.js';
6
6
  export type { ControlPlaneRecentEvent } from './gateway-utils.js';
7
7
  export interface ControlPlaneGatewayConfig {
@@ -19,6 +19,8 @@ export interface ControlPlaneEventStreamOptions {
19
19
  readonly principalId?: string | undefined;
20
20
  readonly principalKind?: 'user' | 'bot' | 'service' | 'token' | undefined;
21
21
  readonly scopes?: readonly string[] | undefined;
22
+ /** Admin token — scopes collapse; sees all channels. */
23
+ readonly admin?: boolean | undefined;
22
24
  readonly sessionId?: string | undefined;
23
25
  readonly routeId?: string | undefined;
24
26
  readonly surfaceId?: string | undefined;
@@ -30,6 +32,15 @@ interface LiveControlPlaneClient {
30
32
  readonly kind: 'tui' | 'web' | 'slack' | 'discord' | 'ntfy' | 'webhook' | 'homeassistant' | 'telegram' | 'google-chat' | 'signal' | 'whatsapp' | 'telephony' | 'imessage' | 'msteams' | 'bluebubbles' | 'mattermost' | 'matrix' | 'daemon';
31
33
  readonly surfaceId?: string | undefined;
32
34
  readonly routeId?: string | undefined;
35
+ /** Principal scopes (SSE/WS); `admin` collapses scopes (sees every channel). */
36
+ readonly scopes?: readonly string[] | undefined;
37
+ readonly admin?: boolean | undefined;
38
+ /**
39
+ * Subscribed domains for the broadcast (`publishEvent`) fan-out. `null` =
40
+ * deliver-all (client did not opt into narrowing); a non-null set narrows to
41
+ * tagged events in the set. For WS this is a live ref to the subscription set.
42
+ */
43
+ readonly domains: ReadonlySet<RuntimeEventDomain> | null;
33
44
  readonly send: (event: string, payload: unknown, id?: string) => void;
34
45
  }
35
46
  export declare class ControlPlaneGateway {
@@ -93,7 +104,6 @@ export declare class ControlPlaneGateway {
93
104
  subscribeWebSocketClient(clientId: string, domains: readonly RuntimeEventDomain[]): void;
94
105
  unsubscribeWebSocketClient(clientId: string, domains?: readonly RuntimeEventDomain[]): void;
95
106
  closeWebSocketClient(clientId: string, reason?: string): void;
96
- private replayRecentTraffic;
97
107
  createEventStream(request: Request, options?: ControlPlaneEventStreamOptions): Response;
98
108
  renderWebUi(authTokenHint?: string): Response;
99
109
  private _scheduleControlPlaneSync;
@@ -1 +1 @@
1
- {"version":3,"file":"gateway.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/gateway.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAYtF,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAE3E,OAAO,EACL,eAAe,EAUf,KAAK,uBAAuB,EAE7B,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IACzD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IACxD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,YAAY,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACvD;AAED,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OzC,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,aAAa;CAmBtB;AAGD,OAAO,EAAE,eAAe,IAAI,2BAA2B,EAAE,CAAC"}
@@ -3,8 +3,10 @@ import { logger } from '../utils/logger.js';
3
3
  import { createDomainDispatch } from '../runtime/store/index.js';
4
4
  import { emitControlPlaneAuthGranted, emitControlPlaneClientConnected, emitControlPlaneClientDisconnected, emitControlPlaneSubscriptionCreated, emitControlPlaneSubscriptionDropped, emitStreamSubscriberConnected, emitStreamSubscriberDisconnected, } from '../runtime/emitters/index.js';
5
5
  import { renderControlPlaneGatewayWebUi } from './gateway-web-ui.js';
6
+ import { buildGatewayDisabledResponseBody } from './gateway-disabled-response.js';
7
+ import { CHANNEL_REQUIRED_SCOPE, clientMayReceiveEventDomain, clientMaySeeScopedChannel } from './gateway-scope-enforcement.js';
6
8
  import { isFeatureGateEnabled, requireFeatureGate } from '../runtime/feature-flags/index.js';
7
- import { DEFAULT_DOMAINS, DEFAULT_SERVER_CONFIG, canReplayEventToClient, hasReplayScope, normalizeRuntimeDomains, pruneDisconnectedClientRecords, serializeEnvelope, stripReplayScope, toClientDescriptor, } from './gateway-utils.js';
9
+ import { DEFAULT_DOMAINS, DEFAULT_SERVER_CONFIG, hasReplayScope, normalizeRuntimeDomains, pruneDisconnectedClientRecords, replayRecentTraffic, serializeEnvelope, stripReplayScope, toClientDescriptor, } from './gateway-utils.js';
8
10
  export class ControlPlaneGateway {
9
11
  runtimeBus;
10
12
  dispatch;
@@ -14,7 +16,6 @@ export class ControlPlaneGateway {
14
16
  liveClients = new Map();
15
17
  websocketClients = new Map();
16
18
  recentMessages = [];
17
- // Circular ring buffer for O(1) insert instead of O(n) unshift.
18
19
  _recentEventsRing;
19
20
  _recentEventsHead = 0;
20
21
  _recentEventsCount = 0;
@@ -31,7 +32,6 @@ export class ControlPlaneGateway {
31
32
  out.push(entry);
32
33
  }
33
34
  else if (process.env.NODE_ENV !== 'production') {
34
- // Dev-only: undefined slot despite valid count — ring buffer accounting bug.
35
35
  logger.error('[ControlPlaneGateway] recentEvents: undefined slot at ring index', { head: this._recentEventsHead, count: this._recentEventsCount, index: idx, offset: i });
36
36
  }
37
37
  }
@@ -170,6 +170,7 @@ export class ControlPlaneGateway {
170
170
  if (!this.isEnabled())
171
171
  return;
172
172
  const record = this.rememberEvent(event, payload, filter);
173
+ const requiredScope = CHANNEL_REQUIRED_SCOPE[event];
173
174
  for (const client of this.liveClients.values()) {
174
175
  if (filter?.clientKind && client.kind !== filter.clientKind)
175
176
  continue;
@@ -179,6 +180,11 @@ export class ControlPlaneGateway {
179
180
  continue;
180
181
  if (filter?.surfaceId && client.surfaceId !== filter.surfaceId)
181
182
  continue;
183
+ if (requiredScope && !clientMaySeeScopedChannel(client, requiredScope))
184
+ continue;
185
+ // Domain filter, AND-ed with scope (null = deliver-all; untagged = delivered).
186
+ if (!clientMayReceiveEventDomain(client.domains, event))
187
+ continue;
182
188
  client.send(event, payload, record.id);
183
189
  }
184
190
  }
@@ -256,18 +262,24 @@ export class ControlPlaneGateway {
256
262
  },
257
263
  };
258
264
  const traceId = `control-plane:${clientId}`;
265
+ // Live ref to the WS subscription set, shared with the liveClient (null = deliver-all).
266
+ const wsDomains = new Set();
267
+ const explicitDomains = (options.domains?.length ?? 0) > 0;
259
268
  this.clients.set(clientId, clientRecord);
260
269
  this.liveClients.set(clientId, {
261
270
  clientId,
262
271
  kind: options.clientKind ?? 'web',
263
272
  surfaceId: options.surfaceId,
264
273
  routeId: options.routeId,
274
+ scopes: options.scopes,
275
+ admin: options.admin,
276
+ domains: explicitDomains ? wsDomains : null,
265
277
  send,
266
278
  });
267
279
  this.websocketClients.set(clientId, {
268
280
  clientId,
269
281
  traceId,
270
- domains: new Set(),
282
+ domains: wsDomains,
271
283
  unsubscribers: new Map(),
272
284
  });
273
285
  this.dispatch?.syncControlPlaneState({
@@ -309,7 +321,7 @@ export class ControlPlaneGateway {
309
321
  }
310
322
  this.subscribeWebSocketClient(clientId, selectedDomains);
311
323
  send('ready', { clientId, domains: selectedDomains, transport: 'websocket' });
312
- this.replayRecentTraffic(send, { ...options, clientId, domains: selectedDomains });
324
+ replayRecentTraffic(this.recentEvents, send, { ...options, clientId, domains: selectedDomains }, explicitDomains ? wsDomains : null);
313
325
  return { clientId, domains: selectedDomains };
314
326
  }
315
327
  touchWebSocketClient(clientId, metadata = {}) {
@@ -443,20 +455,9 @@ export class ControlPlaneGateway {
443
455
  connectionState: [...this.clients.values()].some((client) => client.connected) ? 'connected' : 'disconnected',
444
456
  }, 'control-plane.gateway.ws-disconnect');
445
457
  }
446
- replayRecentTraffic(send, options, sinceId) {
447
- const sinceIndex = sinceId ? this.recentEvents.findIndex((event) => event.id === sinceId) : -1;
448
- const recentEvents = sinceIndex >= 0
449
- ? this.recentEvents.slice(0, sinceIndex).reverse()
450
- : this.recentEvents.slice(0, 20).reverse();
451
- for (const recentEvent of recentEvents) {
452
- if (!canReplayEventToClient(recentEvent, options))
453
- continue;
454
- send(recentEvent.event, recentEvent.payload, recentEvent.id);
455
- }
456
- }
457
458
  createEventStream(request, options = {}) {
458
459
  if (!this.isEnabled()) {
459
- return Response.json({ error: 'control-plane-gateway feature flag is disabled' }, { status: 503 });
460
+ return Response.json(buildGatewayDisabledResponseBody(), { status: 503 });
460
461
  }
461
462
  if (!this.runtimeBus) {
462
463
  return Response.json({ error: 'Runtime event bus unavailable' }, { status: 503 });
@@ -527,16 +528,11 @@ export class ControlPlaneGateway {
527
528
  });
528
529
  }
529
530
  let teardown = () => { };
530
- // ReadableStream default HWM is 1, which causes startup `ready` + replay
531
- // enqueues to drop subsequent chunks before any consumer has pulled. Raise HWM to
532
- // 256 chunks so initial handshake + recent-traffic replay + live events fit without
533
- // tripping the backpressure guard for a healthy consumer.
531
+ // HWM 256 (default 1 drops handshake/replay chunks before the consumer pulls).
534
532
  const stream = new ReadableStream({
535
533
  start: (controller) => {
536
534
  const send = (event, payload, id) => {
537
- // Drop event if the stream's internal queue is full (backpressure guard).
538
- // desiredSize <= 0 means the consumer is falling behind; dropping prevents
539
- // unbounded memory growth from enqueued-but-unread chunks.
535
+ // Backpressure guard: drop when the consumer is falling behind (desiredSize<=0).
540
536
  if ((controller.desiredSize ?? 1) <= 0)
541
537
  return;
542
538
  controller.enqueue(encoder.encode(`${id ? `id: ${id}\n` : ''}event: ${event}\ndata: ${JSON.stringify(payload)}\n\n`));
@@ -556,14 +552,18 @@ export class ControlPlaneGateway {
556
552
  const record = this.rememberEvent(domain, serialized);
557
553
  send(domain, serialized, record.id);
558
554
  }));
555
+ // Opt-in narrowing (null=deliver-all, never the DEFAULT_DOMAINS fallback); reused below for replay.
556
+ const sseLiveDomains = (options.domains?.length ?? 0) > 0 ? new Set(selectedDomains) : null;
559
557
  this.liveClients.set(clientId, {
560
558
  clientId,
561
559
  kind: options.clientKind ?? 'web',
562
560
  surfaceId: options.surfaceId,
563
561
  routeId: options.routeId,
562
+ scopes: options.scopes,
563
+ admin: options.admin,
564
+ domains: sseLiveDomains,
564
565
  send,
565
566
  });
566
- // emit STREAM_SUBSCRIBER_CONNECTED when the SSE client is registered.
567
567
  emitStreamSubscriberConnected(this.runtimeBus, {
568
568
  sessionId: options.sessionId ?? 'control-plane',
569
569
  source: 'control-plane.gateway',
@@ -576,7 +576,6 @@ export class ControlPlaneGateway {
576
576
  const heartbeat = setInterval(() => {
577
577
  send('heartbeat', { clientId, ts: Date.now() });
578
578
  }, 15_000);
579
- // Don't block clean process exit.
580
579
  heartbeat.unref?.();
581
580
  teardown = () => {
582
581
  clearInterval(heartbeat);
@@ -615,7 +614,6 @@ export class ControlPlaneGateway {
615
614
  clientId,
616
615
  reason: 'stream-closed',
617
616
  });
618
- // emit STREAM_SUBSCRIBER_DISCONNECTED when the SSE client tears down.
619
617
  emitStreamSubscriberDisconnected(this.runtimeBus, {
620
618
  sessionId: options.sessionId ?? 'control-plane',
621
619
  source: 'control-plane.gateway',
@@ -633,7 +631,7 @@ export class ControlPlaneGateway {
633
631
  controller.close();
634
632
  }, { once: true });
635
633
  send('ready', { clientId, domains: selectedDomains });
636
- this.replayRecentTraffic(send, { ...options, clientId, domains: selectedDomains }, lastEventId);
634
+ replayRecentTraffic(this.recentEvents, send, { ...options, clientId, domains: selectedDomains }, sseLiveDomains, lastEventId);
637
635
  },
638
636
  cancel: () => {
639
637
  teardown();
@@ -649,7 +647,7 @@ export class ControlPlaneGateway {
649
647
  }
650
648
  renderWebUi(authTokenHint = '') {
651
649
  if (!this.isEnabled()) {
652
- return Response.json({ error: 'control-plane-gateway feature flag is disabled' }, { status: 503 });
650
+ return Response.json(buildGatewayDisabledResponseBody(), { status: 503 });
653
651
  }
654
652
  return renderControlPlaneGatewayWebUi(authTokenHint);
655
653
  }
@@ -675,13 +673,11 @@ export class ControlPlaneGateway {
675
673
  payload,
676
674
  ...(replayScope && hasReplayScope(replayScope) ? { replayScope } : {}),
677
675
  };
678
- // O(1) circular ring buffer write — no array shifting.
679
676
  this._recentEventsRing[this._recentEventsHead] = record;
680
677
  this._recentEventsHead = (this._recentEventsHead + 1) % this._recentEventsCapacity;
681
678
  if (this._recentEventsCount < this._recentEventsCapacity)
682
679
  this._recentEventsCount++;
683
680
  this._lastEventAt = record.createdAt;
684
- // Debounced: coalesce N events/frame into 1 store sync.
685
681
  this._scheduleControlPlaneSync();
686
682
  return record;
687
683
  }
@@ -3,11 +3,15 @@ export type { ControlPlaneGatewayConfig, ControlPlaneEventStreamOptions, Control
3
3
  export { ControlPlaneGateway } from './gateway.js';
4
4
  export { GatewayMethodCatalog, } from './method-catalog.js';
5
5
  export type { GatewayEventDescriptor, GatewayEventListOptions, GatewayEventTransport, GatewayHttpBinding, GatewayMethodAccess, GatewayMethodDescriptor, GatewayMethodHandler, GatewayMethodInvocation, GatewayMethodInvocationContext, GatewayMethodListOptions, GatewayMethodSource, GatewayMethodTransport, } from './method-catalog.js';
6
- export type { FindSharedSessionOptions, SharedSessionMessage, SharedSessionParticipant, SharedSessionRecord, SharedSessionSubmission, SteerSharedSessionMessageInput, SubmitSharedSessionMessageInput, } from './session-types.js';
6
+ export type { CreateSharedSessionInput, EnsureSharedSessionInput, FindSharedSessionOptions, ListSharedSessionsOptions, ParticipantRouteAttachInput, RegisterSharedSessionInput, SharedSessionRegisterResult, SharedSessionKind, SharedSessionMessage, SharedSessionParticipant, SharedSessionRecord, SharedSessionStatus, SharedSessionSubmission, SteerSharedSessionMessageInput, SubmitSharedSessionMessageInput, } from './session-types.js';
7
7
  export type { SharedSessionCompletion, SharedSessionContinuationRequest, SharedSessionContinuationResult, SharedSessionHelperModelOverride, SharedSessionInputIntent, SharedSessionInputRecord, SharedSessionInputState, SharedSessionRoutingIntent, } from './session-intents.js';
8
8
  export { SharedSessionBroker } from './session-broker.js';
9
+ export { discoverLegacySessionSources, importLegacySessionStores, } from './session-store-importer.js';
10
+ export type { LegacySessionSource, ImportLegacySessionsResult, } from './session-store-importer.js';
9
11
  export type { SharedApprovalRecord, SharedApprovalAuditRecord, SharedApprovalStatus, RequestSharedApprovalInput, } from './approval-broker.js';
10
12
  export { ApprovalBroker } from './approval-broker.js';
13
+ export { buildModifiedEditArgs, readApprovalEditHunks, resolveApprovalHunkSelection, } from './approval-hunk-apply.js';
14
+ export type { EditHunkLike, ApprovalHunkSelectionResolution } from './approval-hunk-apply.js';
11
15
  export type { ControlPlaneAuthMode, ControlPlaneAuthSnapshot } from '../../client-auth/control-plane-auth-snapshot.js';
12
16
  export type { MessageSource, ConversationMessageEnvelope } from './conversation-message.js';
13
17
  export { buildOperatorContract } from './operator-contract.js';
@@ -17,4 +21,7 @@ export { ARTIFACT_ATTACHMENT_SCHEMA, ARTIFACT_DESCRIPTOR_SCHEMA, } from './opera
17
21
  export { AUTOMATION_RUN_SCHEMA, ROUTE_BINDING_SCHEMA, } from './operator-contract-schemas-admin.js';
18
22
  export { SHARED_SESSION_INPUT_RECORD_SCHEMA, SHARED_SESSION_ROUTING_INTENT_SCHEMA, } from './operator-contract-schemas-runtime.js';
19
23
  export { KNOWLEDGE_INJECTION_PROMPT_SCHEMA, KNOWLEDGE_INJECTION_SCHEMA, } from './operator-contract-schemas-knowledge.js';
24
+ export { registerW3S2GatewayMethods } from './routes/register-w3-s2.js';
25
+ export { registerGatewayVerbGroups } from './routes/register-gateway-verb-groups.js';
26
+ export type { GatewayVerbGroupDeps } from './routes/register-gateway-verb-groups.js';
20
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,8BAA8B,EAC9B,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,wBAAwB,EACxB,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,EACnB,uBAAuB,EACvB,8BAA8B,EAC9B,+BAA+B,GAChC,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,uBAAuB,EACvB,gCAAgC,EAChC,+BAA+B,EAC/B,gCAAgC,EAChC,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,YAAY,EACV,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,kDAAkD,CAAC;AACvH,YAAY,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EACL,gCAAgC,EAChC,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,EAC5B,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EACL,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,8BAA8B,EAC9B,wBAAwB,EACxB,mBAAmB,EACnB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M,6BAA6B,CAAC;AACrC,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EACL,kCAAkC,EAClC,oCAAoC,GACrC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,iCAAiC,EACjC,0BAA0B,GAC3B,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAIxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,YAAY,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC"}
@@ -1,7 +1,9 @@
1
1
  export { ControlPlaneGateway } from './gateway.js';
2
2
  export { GatewayMethodCatalog, } from './method-catalog.js';
3
3
  export { SharedSessionBroker } from './session-broker.js';
4
+ export { discoverLegacySessionSources, importLegacySessionStores, } from './session-store-importer.js';
4
5
  export { ApprovalBroker } from './approval-broker.js';
6
+ export { buildModifiedEditArgs, readApprovalEditHunks, resolveApprovalHunkSelection, } from './approval-hunk-apply.js';
5
7
  export { buildOperatorContract } from './operator-contract.js';
6
8
  export { dispatchDaemonApiRoutes } from './routes/index.js';
7
9
  export { ARTIFACT_ACQUISITION_MODE_SCHEMA, ARTIFACT_FETCH_MODE_SCHEMA, } from './media-contract-schemas.js';
@@ -9,3 +11,9 @@ export { ARTIFACT_ATTACHMENT_SCHEMA, ARTIFACT_DESCRIPTOR_SCHEMA, } from './opera
9
11
  export { AUTOMATION_RUN_SCHEMA, ROUTE_BINDING_SCHEMA, } from './operator-contract-schemas-admin.js';
10
12
  export { SHARED_SESSION_INPUT_RECORD_SCHEMA, SHARED_SESSION_ROUTING_INTENT_SCHEMA, } from './operator-contract-schemas-runtime.js';
11
13
  export { KNOWLEDGE_INJECTION_PROMPT_SCHEMA, KNOWLEDGE_INJECTION_SCHEMA, } from './operator-contract-schemas-knowledge.js';
14
+ // fleet.*/checkpoints.*/sessions.search verb registration (see routes/register-w3-s2.ts).
15
+ export { registerW3S2GatewayMethods } from './routes/register-w3-s2.js';
16
+ // The single verb-group registrar the runtime-services composition root calls:
17
+ // folds in the fleet/checkpoints group above and constructs + wires the
18
+ // browser-push group (see routes/register-gateway-verb-groups.ts).
19
+ export { registerGatewayVerbGroups } from './routes/register-gateway-verb-groups.js';
@@ -0,0 +1,56 @@
1
+ /**
2
+ * invoke-input-validation.ts (see CHANGELOG 1.0.0, Part B)
3
+ *
4
+ * A central, catalog-driven input gate for the gateway invoke layer. Before a
5
+ * resolved verb's handler (or its HTTP delegate) runs, the invocation's params
6
+ * are validated against the method catalog's `inputSchema`, returning an honest
7
+ * 400 instead of letting a wrong-typed or missing-required field reach a handler
8
+ * that would silently coerce or misbehave.
9
+ *
10
+ * Scope is deliberately the TYPED subset only:
11
+ * - Object schemas that declare `properties` are structurally validated.
12
+ * - Generic object schemas (object with no `properties`, e.g. an
13
+ * additionalProperties-only "any JSON object") pass through unchanged — the
14
+ * status quo — so no verb is falsely rejected for extra fields.
15
+ * - A verb with no `inputSchema` is untyped and passes through.
16
+ *
17
+ * The validator is lenient on unknown keys (does NOT enforce
18
+ * `additionalProperties: false`): the goal is to reject provable type/shape
19
+ * mismatches, not to tighten every loose handler that historically tolerated
20
+ * extra fields. It reports the first violation it finds.
21
+ */
22
+ import type { GatewayMethodDescriptor } from './method-catalog-shared.js';
23
+ /** Structured result of a rejected invocation — same 400 shape the router uses. */
24
+ export interface InvokeValidationError {
25
+ readonly code: 'INVALID_INPUT';
26
+ readonly detail: string;
27
+ }
28
+ /** How a descriptor's inputSchema is treated by the validate gate. */
29
+ export type InvokeValidationDisposition = 'validated' | 'generic' | 'untyped';
30
+ /**
31
+ * Classify an inputSchema for both the validate gate and coverage accounting:
32
+ * - 'validated' — an object schema with declared properties (structurally checked)
33
+ * - 'generic' — an object schema with no properties (skipped)
34
+ * - 'untyped' — absent, or a non-object root we do not structurally validate (skipped)
35
+ */
36
+ export declare function classifyInputSchema(schema: Record<string, unknown> | undefined): InvokeValidationDisposition;
37
+ /**
38
+ * Validate an invocation's params against a verb's inputSchema. Returns an
39
+ * `InvokeValidationError` when a typed schema is violated, or null when the
40
+ * params conform, the schema is generic/untyped, or there is nothing to check.
41
+ *
42
+ * `params` is the request payload the verb receives (the invoke body for
43
+ * body-carrying verbs). `undefined` is treated as an empty object so a schema
44
+ * with required fields honestly reports them missing.
45
+ */
46
+ export declare function validateInvocationInput(descriptor: GatewayMethodDescriptor, params: unknown): InvokeValidationError | null;
47
+ /** Coverage tallies for the operator contract manifest: how many cataloged verbs
48
+ * the invoke input gate structurally validates vs skips (generic/untyped). */
49
+ export interface InvokeValidationCoverage {
50
+ readonly methods: number;
51
+ readonly validated: number;
52
+ readonly skippedGeneric: number;
53
+ readonly skippedUntyped: number;
54
+ }
55
+ export declare function summarizeInvokeValidationCoverage(methods: readonly GatewayMethodDescriptor[]): InvokeValidationCoverage;
56
+ //# sourceMappingURL=invoke-input-validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invoke-input-validation.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/invoke-input-validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,mFAAmF;AACnF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,sEAAsE;AACtE,MAAM,MAAM,2BAA2B,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;AAY9E;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAAG,2BAA2B,CAK5G;AAsFD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,uBAAuB,EACnC,MAAM,EAAE,OAAO,GACd,qBAAqB,GAAG,IAAI,CAM9B;AAED;+EAC+E;AAC/E,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,SAAS,uBAAuB,EAAE,GAC1C,wBAAwB,CAY1B"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * invoke-input-validation.ts (see CHANGELOG 1.0.0, Part B)
3
+ *
4
+ * A central, catalog-driven input gate for the gateway invoke layer. Before a
5
+ * resolved verb's handler (or its HTTP delegate) runs, the invocation's params
6
+ * are validated against the method catalog's `inputSchema`, returning an honest
7
+ * 400 instead of letting a wrong-typed or missing-required field reach a handler
8
+ * that would silently coerce or misbehave.
9
+ *
10
+ * Scope is deliberately the TYPED subset only:
11
+ * - Object schemas that declare `properties` are structurally validated.
12
+ * - Generic object schemas (object with no `properties`, e.g. an
13
+ * additionalProperties-only "any JSON object") pass through unchanged — the
14
+ * status quo — so no verb is falsely rejected for extra fields.
15
+ * - A verb with no `inputSchema` is untyped and passes through.
16
+ *
17
+ * The validator is lenient on unknown keys (does NOT enforce
18
+ * `additionalProperties: false`): the goal is to reject provable type/shape
19
+ * mismatches, not to tighten every loose handler that historically tolerated
20
+ * extra fields. It reports the first violation it finds.
21
+ */
22
+ /**
23
+ * A "generic" object schema declares `type: 'object'` but no `properties` map
24
+ * (e.g. JSON_OBJECT_SCHEMA / an additionalProperties-only bag). Mirrors
25
+ * operator-contract.ts:isGenericObjectSchema so coverage accounting and the gate
26
+ * agree on what counts as typed.
27
+ */
28
+ function isGenericObjectSchema(schema) {
29
+ return Boolean(schema && schema.type === 'object' && !Object.hasOwn(schema, 'properties'));
30
+ }
31
+ /**
32
+ * Classify an inputSchema for both the validate gate and coverage accounting:
33
+ * - 'validated' — an object schema with declared properties (structurally checked)
34
+ * - 'generic' — an object schema with no properties (skipped)
35
+ * - 'untyped' — absent, or a non-object root we do not structurally validate (skipped)
36
+ */
37
+ export function classifyInputSchema(schema) {
38
+ if (schema === undefined)
39
+ return 'untyped';
40
+ if (isGenericObjectSchema(schema))
41
+ return 'generic';
42
+ if (schema.type === 'object' && Object.hasOwn(schema, 'properties'))
43
+ return 'validated';
44
+ return 'untyped';
45
+ }
46
+ function schemaLabel(path) {
47
+ return path === '' ? 'value' : path;
48
+ }
49
+ function childPath(path, key) {
50
+ return path === '' ? key : `${path}.${key}`;
51
+ }
52
+ /**
53
+ * Validate `value` against a JSON-schema-like `schema`. Returns a human-readable
54
+ * detail string for the first violation, or null when the value conforms. Schema
55
+ * forms without a `type` keyword (e.g. the empty "any JSON value" schema), or
56
+ * with an unrecognized `type`, are treated as permissive (accept).
57
+ */
58
+ function validateValue(value, schema, path) {
59
+ if (Array.isArray(schema.anyOf)) {
60
+ for (const branch of schema.anyOf) {
61
+ if (branch && typeof branch === 'object' && validateValue(value, branch, path) === null) {
62
+ return null;
63
+ }
64
+ }
65
+ return `${schemaLabel(path)} did not match any of the allowed types`;
66
+ }
67
+ if (Array.isArray(schema.enum) && !schema.enum.includes(value)) {
68
+ return `${schemaLabel(path)} must be one of ${JSON.stringify(schema.enum)}`;
69
+ }
70
+ const type = schema.type;
71
+ if (typeof type !== 'string')
72
+ return null; // no type constraint → accept
73
+ switch (type) {
74
+ case 'string':
75
+ return typeof value === 'string' ? null : `${schemaLabel(path)} must be a string`;
76
+ case 'number':
77
+ case 'integer':
78
+ return typeof value === 'number' && !Number.isNaN(value)
79
+ ? null
80
+ : `${schemaLabel(path)} must be a number`;
81
+ case 'boolean':
82
+ return typeof value === 'boolean' ? null : `${schemaLabel(path)} must be a boolean`;
83
+ case 'null':
84
+ return value === null ? null : `${schemaLabel(path)} must be null`;
85
+ case 'array': {
86
+ if (!Array.isArray(value))
87
+ return `${schemaLabel(path)} must be an array`;
88
+ const items = schema.items;
89
+ if (items && typeof items === 'object' && !Array.isArray(items)) {
90
+ for (let i = 0; i < value.length; i++) {
91
+ const detail = validateValue(value[i], items, `${schemaLabel(path)}[${i}]`);
92
+ if (detail)
93
+ return detail;
94
+ }
95
+ }
96
+ return null;
97
+ }
98
+ case 'object': {
99
+ if (typeof value !== 'object' || value === null || Array.isArray(value)) {
100
+ return `${schemaLabel(path)} must be an object`;
101
+ }
102
+ const record = value;
103
+ const required = Array.isArray(schema.required) ? schema.required : [];
104
+ for (const key of required) {
105
+ if (typeof key === 'string' && (!(key in record) || record[key] === undefined)) {
106
+ return `${childPath(path, key)} is required`;
107
+ }
108
+ }
109
+ const properties = (schema.properties && typeof schema.properties === 'object')
110
+ ? schema.properties
111
+ : {};
112
+ for (const [key, propValue] of Object.entries(record)) {
113
+ const propSchema = properties[key];
114
+ if (propSchema && typeof propSchema === 'object' && !Array.isArray(propSchema)) {
115
+ const detail = validateValue(propValue, propSchema, childPath(path, key));
116
+ if (detail)
117
+ return detail;
118
+ }
119
+ // Unknown keys are tolerated (lenient on additionalProperties) so loose
120
+ // handlers that historically accepted extra fields are not broken.
121
+ }
122
+ return null;
123
+ }
124
+ default:
125
+ return null; // unrecognized type keyword → accept
126
+ }
127
+ }
128
+ /**
129
+ * Validate an invocation's params against a verb's inputSchema. Returns an
130
+ * `InvokeValidationError` when a typed schema is violated, or null when the
131
+ * params conform, the schema is generic/untyped, or there is nothing to check.
132
+ *
133
+ * `params` is the request payload the verb receives (the invoke body for
134
+ * body-carrying verbs). `undefined` is treated as an empty object so a schema
135
+ * with required fields honestly reports them missing.
136
+ */
137
+ export function validateInvocationInput(descriptor, params) {
138
+ const schema = descriptor.inputSchema;
139
+ if (classifyInputSchema(schema) !== 'validated')
140
+ return null;
141
+ const value = params === undefined ? {} : params;
142
+ const detail = validateValue(value, schema, '');
143
+ return detail ? { code: 'INVALID_INPUT', detail } : null;
144
+ }
145
+ export function summarizeInvokeValidationCoverage(methods) {
146
+ let validated = 0;
147
+ let skippedGeneric = 0;
148
+ let skippedUntyped = 0;
149
+ for (const method of methods) {
150
+ switch (classifyInputSchema(method.inputSchema)) {
151
+ case 'validated':
152
+ validated += 1;
153
+ break;
154
+ case 'generic':
155
+ skippedGeneric += 1;
156
+ break;
157
+ case 'untyped':
158
+ skippedUntyped += 1;
159
+ break;
160
+ }
161
+ }
162
+ return { methods: methods.length, validated, skippedGeneric, skippedUntyped };
163
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"method-catalog-admin.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/method-catalog-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAe1E,eAAO,MAAM,oCAAoC,EAAE,SAAS,uBAAuB,EAwHlF,CAAC"}
1
+ {"version":3,"file":"method-catalog-admin.d.ts","sourceRoot":"","sources":["../../../src/platform/control-plane/method-catalog-admin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAgB1E,eAAO,MAAM,oCAAoC,EAAE,SAAS,uBAAuB,EAmIlF,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { EMPTY_OBJECT_SCHEMA, STRING_SCHEMA, objectSchema, listOutputSchema, entityOutputSchema, bodyEnvelopeSchema, methodDescriptor } from './method-catalog-shared.js';
2
- import { CONFIG_SET_OUTPUT_SCHEMA, CONFIG_SNAPSHOT_SCHEMA, LOCAL_AUTH_USER_SCHEMA, LOCAL_AUTH_BOOTSTRAP_DELETE_OUTPUT_SCHEMA, LOCAL_AUTH_DELETE_OUTPUT_SCHEMA, LOCAL_AUTH_SESSION_REVOKE_OUTPUT_SCHEMA, LOCAL_AUTH_STATUS_SCHEMA, LOCAL_AUTH_ROTATE_PASSWORD_OUTPUT_SCHEMA, PANEL_OPEN_OUTPUT_SCHEMA, PANEL_SNAPSHOT_SCHEMA, } from './operator-contract-schemas.js';
2
+ import { CONFIG_SET_OUTPUT_SCHEMA, CONFIG_SNAPSHOT_SCHEMA, CREDENTIALS_SNAPSHOT_SCHEMA, LOCAL_AUTH_USER_SCHEMA, LOCAL_AUTH_BOOTSTRAP_DELETE_OUTPUT_SCHEMA, LOCAL_AUTH_DELETE_OUTPUT_SCHEMA, LOCAL_AUTH_SESSION_REVOKE_OUTPUT_SCHEMA, LOCAL_AUTH_STATUS_SCHEMA, LOCAL_AUTH_ROTATE_PASSWORD_OUTPUT_SCHEMA, PANEL_OPEN_OUTPUT_SCHEMA, PANEL_SNAPSHOT_SCHEMA, } from './operator-contract-schemas.js';
3
3
  export const builtinGatewayAdminMethodDescriptors = [
4
4
  methodDescriptor({
5
5
  id: 'local_auth.status',
@@ -107,6 +107,17 @@ export const builtinGatewayAdminMethodDescriptors = [
107
107
  inputSchema: EMPTY_OBJECT_SCHEMA,
108
108
  outputSchema: CONFIG_SNAPSHOT_SCHEMA,
109
109
  }),
110
+ methodDescriptor({
111
+ id: 'credentials.get',
112
+ title: 'Get Credential Status',
113
+ description: 'Return secret-free credential status (configured/usable) for the shared store. Never returns raw secret bytes. Optional ?key= narrows to one credential.',
114
+ category: 'config',
115
+ scopes: ['read:config'],
116
+ access: 'admin',
117
+ http: { method: 'GET', path: '/config/credentials' },
118
+ inputSchema: objectSchema({ key: STRING_SCHEMA }, []),
119
+ outputSchema: CREDENTIALS_SNAPSHOT_SCHEMA,
120
+ }),
110
121
  methodDescriptor({
111
122
  id: 'config.set',
112
123
  title: 'Set Config Value',