agentic-qe 3.3.4 → 3.4.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 (457) hide show
  1. package/.claude/agents/v3/qe-queen-coordinator.md +332 -166
  2. package/.claude/helpers/statusline-v3.cjs +85 -42
  3. package/.claude/skills/qcsd-ideation-swarm/SKILL.md +7 -4
  4. package/README.md +71 -2
  5. package/package.json +1 -1
  6. package/scripts/cloud-db-config.json +10 -5
  7. package/scripts/merge-v3-to-root.sql +48 -0
  8. package/v3/CHANGELOG.md +156 -0
  9. package/v3/README.md +118 -1
  10. package/v3/assets/agents/v3/qe-queen-coordinator.md +332 -166
  11. package/v3/assets/skills/qcsd-ideation-swarm/SKILL.md +7 -4
  12. package/v3/dist/adapters/a2a/agent-cards/generator.d.ts +153 -0
  13. package/v3/dist/adapters/a2a/agent-cards/generator.d.ts.map +1 -0
  14. package/v3/dist/adapters/a2a/agent-cards/generator.js +478 -0
  15. package/v3/dist/adapters/a2a/agent-cards/generator.js.map +1 -0
  16. package/v3/dist/adapters/a2a/agent-cards/schema.d.ts +274 -0
  17. package/v3/dist/adapters/a2a/agent-cards/schema.d.ts.map +1 -0
  18. package/v3/dist/adapters/a2a/agent-cards/schema.js +135 -0
  19. package/v3/dist/adapters/a2a/agent-cards/schema.js.map +1 -0
  20. package/v3/dist/adapters/a2a/agent-cards/validator.d.ts +514 -0
  21. package/v3/dist/adapters/a2a/agent-cards/validator.d.ts.map +1 -0
  22. package/v3/dist/adapters/a2a/agent-cards/validator.js +555 -0
  23. package/v3/dist/adapters/a2a/agent-cards/validator.js.map +1 -0
  24. package/v3/dist/adapters/a2a/auth/index.d.ts +23 -0
  25. package/v3/dist/adapters/a2a/auth/index.d.ts.map +1 -0
  26. package/v3/dist/adapters/a2a/auth/index.js +85 -0
  27. package/v3/dist/adapters/a2a/auth/index.js.map +1 -0
  28. package/v3/dist/adapters/a2a/auth/jwt-utils.d.ts +215 -0
  29. package/v3/dist/adapters/a2a/auth/jwt-utils.d.ts.map +1 -0
  30. package/v3/dist/adapters/a2a/auth/jwt-utils.js +314 -0
  31. package/v3/dist/adapters/a2a/auth/jwt-utils.js.map +1 -0
  32. package/v3/dist/adapters/a2a/auth/middleware.d.ts +173 -0
  33. package/v3/dist/adapters/a2a/auth/middleware.d.ts.map +1 -0
  34. package/v3/dist/adapters/a2a/auth/middleware.js +300 -0
  35. package/v3/dist/adapters/a2a/auth/middleware.js.map +1 -0
  36. package/v3/dist/adapters/a2a/auth/oauth-provider.d.ts +308 -0
  37. package/v3/dist/adapters/a2a/auth/oauth-provider.d.ts.map +1 -0
  38. package/v3/dist/adapters/a2a/auth/oauth-provider.js +573 -0
  39. package/v3/dist/adapters/a2a/auth/oauth-provider.js.map +1 -0
  40. package/v3/dist/adapters/a2a/auth/routes.d.ts +244 -0
  41. package/v3/dist/adapters/a2a/auth/routes.d.ts.map +1 -0
  42. package/v3/dist/adapters/a2a/auth/routes.js +496 -0
  43. package/v3/dist/adapters/a2a/auth/routes.js.map +1 -0
  44. package/v3/dist/adapters/a2a/auth/scopes.d.ts +219 -0
  45. package/v3/dist/adapters/a2a/auth/scopes.d.ts.map +1 -0
  46. package/v3/dist/adapters/a2a/auth/scopes.js +292 -0
  47. package/v3/dist/adapters/a2a/auth/scopes.js.map +1 -0
  48. package/v3/dist/adapters/a2a/auth/token-store.d.ts +278 -0
  49. package/v3/dist/adapters/a2a/auth/token-store.d.ts.map +1 -0
  50. package/v3/dist/adapters/a2a/auth/token-store.js +453 -0
  51. package/v3/dist/adapters/a2a/auth/token-store.js.map +1 -0
  52. package/v3/dist/adapters/a2a/discovery/agent-health.d.ts +226 -0
  53. package/v3/dist/adapters/a2a/discovery/agent-health.d.ts.map +1 -0
  54. package/v3/dist/adapters/a2a/discovery/agent-health.js +426 -0
  55. package/v3/dist/adapters/a2a/discovery/agent-health.js.map +1 -0
  56. package/v3/dist/adapters/a2a/discovery/discovery-service.d.ts +296 -0
  57. package/v3/dist/adapters/a2a/discovery/discovery-service.d.ts.map +1 -0
  58. package/v3/dist/adapters/a2a/discovery/discovery-service.js +520 -0
  59. package/v3/dist/adapters/a2a/discovery/discovery-service.js.map +1 -0
  60. package/v3/dist/adapters/a2a/discovery/file-watcher.d.ts +166 -0
  61. package/v3/dist/adapters/a2a/discovery/file-watcher.d.ts.map +1 -0
  62. package/v3/dist/adapters/a2a/discovery/file-watcher.js +385 -0
  63. package/v3/dist/adapters/a2a/discovery/file-watcher.js.map +1 -0
  64. package/v3/dist/adapters/a2a/discovery/hot-reload-service.d.ts +226 -0
  65. package/v3/dist/adapters/a2a/discovery/hot-reload-service.d.ts.map +1 -0
  66. package/v3/dist/adapters/a2a/discovery/hot-reload-service.js +433 -0
  67. package/v3/dist/adapters/a2a/discovery/hot-reload-service.js.map +1 -0
  68. package/v3/dist/adapters/a2a/discovery/index.d.ts +18 -0
  69. package/v3/dist/adapters/a2a/discovery/index.d.ts.map +1 -0
  70. package/v3/dist/adapters/a2a/discovery/index.js +54 -0
  71. package/v3/dist/adapters/a2a/discovery/index.js.map +1 -0
  72. package/v3/dist/adapters/a2a/discovery/metrics.d.ts +200 -0
  73. package/v3/dist/adapters/a2a/discovery/metrics.d.ts.map +1 -0
  74. package/v3/dist/adapters/a2a/discovery/metrics.js +371 -0
  75. package/v3/dist/adapters/a2a/discovery/metrics.js.map +1 -0
  76. package/v3/dist/adapters/a2a/discovery/routes.d.ts +184 -0
  77. package/v3/dist/adapters/a2a/discovery/routes.d.ts.map +1 -0
  78. package/v3/dist/adapters/a2a/discovery/routes.js +453 -0
  79. package/v3/dist/adapters/a2a/discovery/routes.js.map +1 -0
  80. package/v3/dist/adapters/a2a/index.d.ts +18 -0
  81. package/v3/dist/adapters/a2a/index.d.ts.map +1 -0
  82. package/v3/dist/adapters/a2a/index.js +139 -0
  83. package/v3/dist/adapters/a2a/index.js.map +1 -0
  84. package/v3/dist/adapters/a2a/jsonrpc/envelope.d.ts +312 -0
  85. package/v3/dist/adapters/a2a/jsonrpc/envelope.d.ts.map +1 -0
  86. package/v3/dist/adapters/a2a/jsonrpc/envelope.js +554 -0
  87. package/v3/dist/adapters/a2a/jsonrpc/envelope.js.map +1 -0
  88. package/v3/dist/adapters/a2a/jsonrpc/errors.d.ts +244 -0
  89. package/v3/dist/adapters/a2a/jsonrpc/errors.d.ts.map +1 -0
  90. package/v3/dist/adapters/a2a/jsonrpc/errors.js +365 -0
  91. package/v3/dist/adapters/a2a/jsonrpc/errors.js.map +1 -0
  92. package/v3/dist/adapters/a2a/jsonrpc/index.d.ts +14 -0
  93. package/v3/dist/adapters/a2a/jsonrpc/index.d.ts.map +1 -0
  94. package/v3/dist/adapters/a2a/jsonrpc/index.js +59 -0
  95. package/v3/dist/adapters/a2a/jsonrpc/index.js.map +1 -0
  96. package/v3/dist/adapters/a2a/jsonrpc/methods.d.ts +400 -0
  97. package/v3/dist/adapters/a2a/jsonrpc/methods.d.ts.map +1 -0
  98. package/v3/dist/adapters/a2a/jsonrpc/methods.js +249 -0
  99. package/v3/dist/adapters/a2a/jsonrpc/methods.js.map +1 -0
  100. package/v3/dist/adapters/a2a/notifications/index.d.ts +60 -0
  101. package/v3/dist/adapters/a2a/notifications/index.d.ts.map +1 -0
  102. package/v3/dist/adapters/a2a/notifications/index.js +99 -0
  103. package/v3/dist/adapters/a2a/notifications/index.js.map +1 -0
  104. package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts +225 -0
  105. package/v3/dist/adapters/a2a/notifications/retry-queue.d.ts.map +1 -0
  106. package/v3/dist/adapters/a2a/notifications/retry-queue.js +449 -0
  107. package/v3/dist/adapters/a2a/notifications/retry-queue.js.map +1 -0
  108. package/v3/dist/adapters/a2a/notifications/signature.d.ts +133 -0
  109. package/v3/dist/adapters/a2a/notifications/signature.d.ts.map +1 -0
  110. package/v3/dist/adapters/a2a/notifications/signature.js +244 -0
  111. package/v3/dist/adapters/a2a/notifications/signature.js.map +1 -0
  112. package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts +243 -0
  113. package/v3/dist/adapters/a2a/notifications/subscription-store.d.ts.map +1 -0
  114. package/v3/dist/adapters/a2a/notifications/subscription-store.js +486 -0
  115. package/v3/dist/adapters/a2a/notifications/subscription-store.js.map +1 -0
  116. package/v3/dist/adapters/a2a/notifications/webhook-service.d.ts +257 -0
  117. package/v3/dist/adapters/a2a/notifications/webhook-service.d.ts.map +1 -0
  118. package/v3/dist/adapters/a2a/notifications/webhook-service.js +542 -0
  119. package/v3/dist/adapters/a2a/notifications/webhook-service.js.map +1 -0
  120. package/v3/dist/adapters/a2a/tasks/index.d.ts +16 -0
  121. package/v3/dist/adapters/a2a/tasks/index.d.ts.map +1 -0
  122. package/v3/dist/adapters/a2a/tasks/index.js +33 -0
  123. package/v3/dist/adapters/a2a/tasks/index.js.map +1 -0
  124. package/v3/dist/adapters/a2a/tasks/task-manager.d.ts +306 -0
  125. package/v3/dist/adapters/a2a/tasks/task-manager.d.ts.map +1 -0
  126. package/v3/dist/adapters/a2a/tasks/task-manager.js +562 -0
  127. package/v3/dist/adapters/a2a/tasks/task-manager.js.map +1 -0
  128. package/v3/dist/adapters/a2a/tasks/task-router.d.ts +270 -0
  129. package/v3/dist/adapters/a2a/tasks/task-router.d.ts.map +1 -0
  130. package/v3/dist/adapters/a2a/tasks/task-router.js +574 -0
  131. package/v3/dist/adapters/a2a/tasks/task-router.js.map +1 -0
  132. package/v3/dist/adapters/a2a/tasks/task-store.d.ts +251 -0
  133. package/v3/dist/adapters/a2a/tasks/task-store.d.ts.map +1 -0
  134. package/v3/dist/adapters/a2a/tasks/task-store.js +468 -0
  135. package/v3/dist/adapters/a2a/tasks/task-store.js.map +1 -0
  136. package/v3/dist/adapters/a2ui/accessibility/aria-attributes.d.ts +294 -0
  137. package/v3/dist/adapters/a2ui/accessibility/aria-attributes.d.ts.map +1 -0
  138. package/v3/dist/adapters/a2ui/accessibility/aria-attributes.js +447 -0
  139. package/v3/dist/adapters/a2ui/accessibility/aria-attributes.js.map +1 -0
  140. package/v3/dist/adapters/a2ui/accessibility/index.d.ts +83 -0
  141. package/v3/dist/adapters/a2ui/accessibility/index.d.ts.map +1 -0
  142. package/v3/dist/adapters/a2ui/accessibility/index.js +155 -0
  143. package/v3/dist/adapters/a2ui/accessibility/index.js.map +1 -0
  144. package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.d.ts +177 -0
  145. package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.d.ts.map +1 -0
  146. package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.js +638 -0
  147. package/v3/dist/adapters/a2ui/accessibility/keyboard-nav.js.map +1 -0
  148. package/v3/dist/adapters/a2ui/accessibility/wcag-validator.d.ts +186 -0
  149. package/v3/dist/adapters/a2ui/accessibility/wcag-validator.d.ts.map +1 -0
  150. package/v3/dist/adapters/a2ui/accessibility/wcag-validator.js +816 -0
  151. package/v3/dist/adapters/a2ui/accessibility/wcag-validator.js.map +1 -0
  152. package/v3/dist/adapters/a2ui/catalog/component-schemas.d.ts +227 -0
  153. package/v3/dist/adapters/a2ui/catalog/component-schemas.d.ts.map +1 -0
  154. package/v3/dist/adapters/a2ui/catalog/component-schemas.js +1090 -0
  155. package/v3/dist/adapters/a2ui/catalog/component-schemas.js.map +1 -0
  156. package/v3/dist/adapters/a2ui/catalog/index.d.ts +55 -0
  157. package/v3/dist/adapters/a2ui/catalog/index.d.ts.map +1 -0
  158. package/v3/dist/adapters/a2ui/catalog/index.js +100 -0
  159. package/v3/dist/adapters/a2ui/catalog/index.js.map +1 -0
  160. package/v3/dist/adapters/a2ui/catalog/qe-catalog.d.ts +456 -0
  161. package/v3/dist/adapters/a2ui/catalog/qe-catalog.d.ts.map +1 -0
  162. package/v3/dist/adapters/a2ui/catalog/qe-catalog.js +413 -0
  163. package/v3/dist/adapters/a2ui/catalog/qe-catalog.js.map +1 -0
  164. package/v3/dist/adapters/a2ui/catalog/standard-catalog.d.ts +581 -0
  165. package/v3/dist/adapters/a2ui/catalog/standard-catalog.d.ts.map +1 -0
  166. package/v3/dist/adapters/a2ui/catalog/standard-catalog.js +409 -0
  167. package/v3/dist/adapters/a2ui/catalog/standard-catalog.js.map +1 -0
  168. package/v3/dist/adapters/a2ui/data/bound-value.d.ts +252 -0
  169. package/v3/dist/adapters/a2ui/data/bound-value.d.ts.map +1 -0
  170. package/v3/dist/adapters/a2ui/data/bound-value.js +403 -0
  171. package/v3/dist/adapters/a2ui/data/bound-value.js.map +1 -0
  172. package/v3/dist/adapters/a2ui/data/index.d.ts +14 -0
  173. package/v3/dist/adapters/a2ui/data/index.d.ts.map +1 -0
  174. package/v3/dist/adapters/a2ui/data/index.js +41 -0
  175. package/v3/dist/adapters/a2ui/data/index.js.map +1 -0
  176. package/v3/dist/adapters/a2ui/data/json-pointer-resolver.d.ts +187 -0
  177. package/v3/dist/adapters/a2ui/data/json-pointer-resolver.d.ts.map +1 -0
  178. package/v3/dist/adapters/a2ui/data/json-pointer-resolver.js +425 -0
  179. package/v3/dist/adapters/a2ui/data/json-pointer-resolver.js.map +1 -0
  180. package/v3/dist/adapters/a2ui/data/reactive-store.d.ts +241 -0
  181. package/v3/dist/adapters/a2ui/data/reactive-store.d.ts.map +1 -0
  182. package/v3/dist/adapters/a2ui/data/reactive-store.js +461 -0
  183. package/v3/dist/adapters/a2ui/data/reactive-store.js.map +1 -0
  184. package/v3/dist/adapters/a2ui/index.d.ts +17 -0
  185. package/v3/dist/adapters/a2ui/index.d.ts.map +1 -0
  186. package/v3/dist/adapters/a2ui/index.js +119 -0
  187. package/v3/dist/adapters/a2ui/index.js.map +1 -0
  188. package/v3/dist/adapters/a2ui/integration/agui-sync.d.ts +259 -0
  189. package/v3/dist/adapters/a2ui/integration/agui-sync.d.ts.map +1 -0
  190. package/v3/dist/adapters/a2ui/integration/agui-sync.js +559 -0
  191. package/v3/dist/adapters/a2ui/integration/agui-sync.js.map +1 -0
  192. package/v3/dist/adapters/a2ui/integration/index.d.ts +11 -0
  193. package/v3/dist/adapters/a2ui/integration/index.d.ts.map +1 -0
  194. package/v3/dist/adapters/a2ui/integration/index.js +23 -0
  195. package/v3/dist/adapters/a2ui/integration/index.js.map +1 -0
  196. package/v3/dist/adapters/a2ui/integration/surface-state-bridge.d.ts +209 -0
  197. package/v3/dist/adapters/a2ui/integration/surface-state-bridge.d.ts.map +1 -0
  198. package/v3/dist/adapters/a2ui/integration/surface-state-bridge.js +545 -0
  199. package/v3/dist/adapters/a2ui/integration/surface-state-bridge.js.map +1 -0
  200. package/v3/dist/adapters/a2ui/renderer/component-builder.d.ts +227 -0
  201. package/v3/dist/adapters/a2ui/renderer/component-builder.d.ts.map +1 -0
  202. package/v3/dist/adapters/a2ui/renderer/component-builder.js +488 -0
  203. package/v3/dist/adapters/a2ui/renderer/component-builder.js.map +1 -0
  204. package/v3/dist/adapters/a2ui/renderer/index.d.ts +16 -0
  205. package/v3/dist/adapters/a2ui/renderer/index.d.ts.map +1 -0
  206. package/v3/dist/adapters/a2ui/renderer/index.js +50 -0
  207. package/v3/dist/adapters/a2ui/renderer/index.js.map +1 -0
  208. package/v3/dist/adapters/a2ui/renderer/message-types.d.ts +299 -0
  209. package/v3/dist/adapters/a2ui/renderer/message-types.d.ts.map +1 -0
  210. package/v3/dist/adapters/a2ui/renderer/message-types.js +187 -0
  211. package/v3/dist/adapters/a2ui/renderer/message-types.js.map +1 -0
  212. package/v3/dist/adapters/a2ui/renderer/surface-generator.d.ts +210 -0
  213. package/v3/dist/adapters/a2ui/renderer/surface-generator.d.ts.map +1 -0
  214. package/v3/dist/adapters/a2ui/renderer/surface-generator.js +586 -0
  215. package/v3/dist/adapters/a2ui/renderer/surface-generator.js.map +1 -0
  216. package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.d.ts +149 -0
  217. package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.d.ts.map +1 -0
  218. package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.js +414 -0
  219. package/v3/dist/adapters/a2ui/renderer/templates/accessibility-surface.js.map +1 -0
  220. package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.d.ts +95 -0
  221. package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.d.ts.map +1 -0
  222. package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.js +231 -0
  223. package/v3/dist/adapters/a2ui/renderer/templates/coverage-surface.js.map +1 -0
  224. package/v3/dist/adapters/a2ui/renderer/templates/index.d.ts +12 -0
  225. package/v3/dist/adapters/a2ui/renderer/templates/index.d.ts.map +1 -0
  226. package/v3/dist/adapters/a2ui/renderer/templates/index.js +16 -0
  227. package/v3/dist/adapters/a2ui/renderer/templates/index.js.map +1 -0
  228. package/v3/dist/adapters/a2ui/renderer/templates/security-surface.d.ts +121 -0
  229. package/v3/dist/adapters/a2ui/renderer/templates/security-surface.d.ts.map +1 -0
  230. package/v3/dist/adapters/a2ui/renderer/templates/security-surface.js +367 -0
  231. package/v3/dist/adapters/a2ui/renderer/templates/security-surface.js.map +1 -0
  232. package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.d.ts +104 -0
  233. package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.d.ts.map +1 -0
  234. package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.js +294 -0
  235. package/v3/dist/adapters/a2ui/renderer/templates/test-results-surface.js.map +1 -0
  236. package/v3/dist/adapters/ag-ui/backpressure-handler.d.ts +201 -0
  237. package/v3/dist/adapters/ag-ui/backpressure-handler.d.ts.map +1 -0
  238. package/v3/dist/adapters/ag-ui/backpressure-handler.js +399 -0
  239. package/v3/dist/adapters/ag-ui/backpressure-handler.js.map +1 -0
  240. package/v3/dist/adapters/ag-ui/event-adapter.d.ts +360 -0
  241. package/v3/dist/adapters/ag-ui/event-adapter.d.ts.map +1 -0
  242. package/v3/dist/adapters/ag-ui/event-adapter.js +1083 -0
  243. package/v3/dist/adapters/ag-ui/event-adapter.js.map +1 -0
  244. package/v3/dist/adapters/ag-ui/event-batcher.d.ts +242 -0
  245. package/v3/dist/adapters/ag-ui/event-batcher.d.ts.map +1 -0
  246. package/v3/dist/adapters/ag-ui/event-batcher.js +444 -0
  247. package/v3/dist/adapters/ag-ui/event-batcher.js.map +1 -0
  248. package/v3/dist/adapters/ag-ui/event-types.d.ts +450 -0
  249. package/v3/dist/adapters/ag-ui/event-types.d.ts.map +1 -0
  250. package/v3/dist/adapters/ag-ui/event-types.js +173 -0
  251. package/v3/dist/adapters/ag-ui/event-types.js.map +1 -0
  252. package/v3/dist/adapters/ag-ui/index.d.ts +17 -0
  253. package/v3/dist/adapters/ag-ui/index.d.ts.map +1 -0
  254. package/v3/dist/adapters/ag-ui/index.js +47 -0
  255. package/v3/dist/adapters/ag-ui/index.js.map +1 -0
  256. package/v3/dist/adapters/ag-ui/json-patch-utils.d.ts +136 -0
  257. package/v3/dist/adapters/ag-ui/json-patch-utils.d.ts.map +1 -0
  258. package/v3/dist/adapters/ag-ui/json-patch-utils.js +574 -0
  259. package/v3/dist/adapters/ag-ui/json-patch-utils.js.map +1 -0
  260. package/v3/dist/adapters/ag-ui/json-patch.d.ts +241 -0
  261. package/v3/dist/adapters/ag-ui/json-patch.d.ts.map +1 -0
  262. package/v3/dist/adapters/ag-ui/json-patch.js +726 -0
  263. package/v3/dist/adapters/ag-ui/json-patch.js.map +1 -0
  264. package/v3/dist/adapters/ag-ui/state-delta-cache.d.ts +218 -0
  265. package/v3/dist/adapters/ag-ui/state-delta-cache.d.ts.map +1 -0
  266. package/v3/dist/adapters/ag-ui/state-delta-cache.js +422 -0
  267. package/v3/dist/adapters/ag-ui/state-delta-cache.js.map +1 -0
  268. package/v3/dist/adapters/ag-ui/state-manager.d.ts +249 -0
  269. package/v3/dist/adapters/ag-ui/state-manager.d.ts.map +1 -0
  270. package/v3/dist/adapters/ag-ui/state-manager.js +511 -0
  271. package/v3/dist/adapters/ag-ui/state-manager.js.map +1 -0
  272. package/v3/dist/adapters/ag-ui/stream-controller.d.ts +195 -0
  273. package/v3/dist/adapters/ag-ui/stream-controller.d.ts.map +1 -0
  274. package/v3/dist/adapters/ag-ui/stream-controller.js +481 -0
  275. package/v3/dist/adapters/ag-ui/stream-controller.js.map +1 -0
  276. package/v3/dist/adapters/index.d.ts +4 -0
  277. package/v3/dist/adapters/index.d.ts.map +1 -1
  278. package/v3/dist/adapters/index.js +89 -0
  279. package/v3/dist/adapters/index.js.map +1 -1
  280. package/v3/dist/cli/bundle.js +1507 -425
  281. package/v3/dist/coordination/consensus/providers/claude-provider.js +1 -1
  282. package/v3/dist/coordination/consensus/providers/gemini-provider.js +1 -1
  283. package/v3/dist/coordination/consensus/providers/openai-provider.js +1 -1
  284. package/v3/dist/init/init-wizard.d.ts.map +1 -1
  285. package/v3/dist/init/init-wizard.js +19 -4
  286. package/v3/dist/init/init-wizard.js.map +1 -1
  287. package/v3/dist/init/migration/config-migrator.d.ts.map +1 -1
  288. package/v3/dist/init/migration/config-migrator.js +15 -1
  289. package/v3/dist/init/migration/config-migrator.js.map +1 -1
  290. package/v3/dist/init/phases/05-learning.js +1 -1
  291. package/v3/dist/init/phases/05-learning.js.map +1 -1
  292. package/v3/dist/init/self-configurator.d.ts +7 -0
  293. package/v3/dist/init/self-configurator.d.ts.map +1 -1
  294. package/v3/dist/init/self-configurator.js +23 -27
  295. package/v3/dist/init/self-configurator.js.map +1 -1
  296. package/v3/dist/integrations/ruvector/interfaces.js +1 -1
  297. package/v3/dist/integrations/ruvector/interfaces.js.map +1 -1
  298. package/v3/dist/kernel/index.d.ts +1 -1
  299. package/v3/dist/kernel/index.d.ts.map +1 -1
  300. package/v3/dist/kernel/index.js +3 -1
  301. package/v3/dist/kernel/index.js.map +1 -1
  302. package/v3/dist/kernel/plugin-loader.d.ts.map +1 -1
  303. package/v3/dist/kernel/plugin-loader.js +6 -1
  304. package/v3/dist/kernel/plugin-loader.js.map +1 -1
  305. package/v3/dist/kernel/unified-memory.d.ts +123 -0
  306. package/v3/dist/kernel/unified-memory.d.ts.map +1 -1
  307. package/v3/dist/kernel/unified-memory.js +258 -2
  308. package/v3/dist/kernel/unified-memory.js.map +1 -1
  309. package/v3/dist/learning/qe-unified-memory.js +1 -1
  310. package/v3/dist/learning/qe-unified-memory.js.map +1 -1
  311. package/v3/dist/learning/real-qe-reasoning-bank.js +2 -2
  312. package/v3/dist/learning/real-qe-reasoning-bank.js.map +1 -1
  313. package/v3/dist/learning/sqlite-persistence.d.ts +1 -1
  314. package/v3/dist/learning/sqlite-persistence.js +1 -1
  315. package/v3/dist/learning/sqlite-persistence.js.map +1 -1
  316. package/v3/dist/learning/v2-to-v3-migration.d.ts +2 -2
  317. package/v3/dist/learning/v2-to-v3-migration.d.ts.map +1 -1
  318. package/v3/dist/learning/v2-to-v3-migration.js +2 -2
  319. package/v3/dist/learning/v2-to-v3-migration.js.map +1 -1
  320. package/v3/dist/mcp/bundle.js +63075 -53304
  321. package/v3/dist/mcp/entry.d.ts +5 -0
  322. package/v3/dist/mcp/entry.d.ts.map +1 -1
  323. package/v3/dist/mcp/entry.js +36 -0
  324. package/v3/dist/mcp/entry.js.map +1 -1
  325. package/v3/dist/mcp/http-server.d.ts +95 -0
  326. package/v3/dist/mcp/http-server.d.ts.map +1 -0
  327. package/v3/dist/mcp/http-server.js +833 -0
  328. package/v3/dist/mcp/http-server.js.map +1 -0
  329. package/v3/dist/mcp/protocol-server.d.ts +6 -0
  330. package/v3/dist/mcp/protocol-server.d.ts.map +1 -1
  331. package/v3/dist/mcp/protocol-server.js +40 -0
  332. package/v3/dist/mcp/protocol-server.js.map +1 -1
  333. package/v3/dist/mcp/transport/index.d.ts +25 -3
  334. package/v3/dist/mcp/transport/index.d.ts.map +1 -1
  335. package/v3/dist/mcp/transport/index.js +22 -4
  336. package/v3/dist/mcp/transport/index.js.map +1 -1
  337. package/v3/dist/mcp/transport/sse/connection-manager.d.ts +84 -0
  338. package/v3/dist/mcp/transport/sse/connection-manager.d.ts.map +1 -0
  339. package/v3/dist/mcp/transport/sse/connection-manager.js +271 -0
  340. package/v3/dist/mcp/transport/sse/connection-manager.js.map +1 -0
  341. package/v3/dist/mcp/transport/sse/index.d.ts +10 -0
  342. package/v3/dist/mcp/transport/sse/index.d.ts.map +1 -0
  343. package/v3/dist/mcp/transport/sse/index.js +15 -0
  344. package/v3/dist/mcp/transport/sse/index.js.map +1 -0
  345. package/v3/dist/mcp/transport/sse/sse-transport.d.ts +56 -0
  346. package/v3/dist/mcp/transport/sse/sse-transport.d.ts.map +1 -0
  347. package/v3/dist/mcp/transport/sse/sse-transport.js +381 -0
  348. package/v3/dist/mcp/transport/sse/sse-transport.js.map +1 -0
  349. package/v3/dist/mcp/transport/sse/types.d.ts +237 -0
  350. package/v3/dist/mcp/transport/sse/types.d.ts.map +1 -0
  351. package/v3/dist/mcp/transport/sse/types.js +37 -0
  352. package/v3/dist/mcp/transport/sse/types.js.map +1 -0
  353. package/v3/dist/mcp/transport/websocket/connection-manager.d.ts +143 -0
  354. package/v3/dist/mcp/transport/websocket/connection-manager.d.ts.map +1 -0
  355. package/v3/dist/mcp/transport/websocket/connection-manager.js +522 -0
  356. package/v3/dist/mcp/transport/websocket/connection-manager.js.map +1 -0
  357. package/v3/dist/mcp/transport/websocket/index.d.ts +10 -0
  358. package/v3/dist/mcp/transport/websocket/index.d.ts.map +1 -0
  359. package/v3/dist/mcp/transport/websocket/index.js +19 -0
  360. package/v3/dist/mcp/transport/websocket/index.js.map +1 -0
  361. package/v3/dist/mcp/transport/websocket/types.d.ts +354 -0
  362. package/v3/dist/mcp/transport/websocket/types.d.ts.map +1 -0
  363. package/v3/dist/mcp/transport/websocket/types.js +49 -0
  364. package/v3/dist/mcp/transport/websocket/types.js.map +1 -0
  365. package/v3/dist/mcp/transport/websocket/websocket-transport.d.ts +77 -0
  366. package/v3/dist/mcp/transport/websocket/websocket-transport.d.ts.map +1 -0
  367. package/v3/dist/mcp/transport/websocket/websocket-transport.js +622 -0
  368. package/v3/dist/mcp/transport/websocket/websocket-transport.js.map +1 -0
  369. package/v3/dist/memory/crdt/convergence-tracker.d.ts +59 -0
  370. package/v3/dist/memory/crdt/convergence-tracker.d.ts.map +1 -0
  371. package/v3/dist/memory/crdt/convergence-tracker.js +325 -0
  372. package/v3/dist/memory/crdt/convergence-tracker.js.map +1 -0
  373. package/v3/dist/memory/crdt/crdt-store.d.ts +55 -0
  374. package/v3/dist/memory/crdt/crdt-store.d.ts.map +1 -0
  375. package/v3/dist/memory/crdt/crdt-store.js +582 -0
  376. package/v3/dist/memory/crdt/crdt-store.js.map +1 -0
  377. package/v3/dist/memory/crdt/g-counter.d.ts +47 -0
  378. package/v3/dist/memory/crdt/g-counter.d.ts.map +1 -0
  379. package/v3/dist/memory/crdt/g-counter.js +134 -0
  380. package/v3/dist/memory/crdt/g-counter.js.map +1 -0
  381. package/v3/dist/memory/crdt/index.d.ts +52 -0
  382. package/v3/dist/memory/crdt/index.d.ts.map +1 -0
  383. package/v3/dist/memory/crdt/index.js +66 -0
  384. package/v3/dist/memory/crdt/index.js.map +1 -0
  385. package/v3/dist/memory/crdt/lww-register.d.ts +40 -0
  386. package/v3/dist/memory/crdt/lww-register.d.ts.map +1 -0
  387. package/v3/dist/memory/crdt/lww-register.js +133 -0
  388. package/v3/dist/memory/crdt/lww-register.js.map +1 -0
  389. package/v3/dist/memory/crdt/or-set.d.ts +62 -0
  390. package/v3/dist/memory/crdt/or-set.d.ts.map +1 -0
  391. package/v3/dist/memory/crdt/or-set.js +336 -0
  392. package/v3/dist/memory/crdt/or-set.js.map +1 -0
  393. package/v3/dist/memory/crdt/pn-counter.d.ts +53 -0
  394. package/v3/dist/memory/crdt/pn-counter.d.ts.map +1 -0
  395. package/v3/dist/memory/crdt/pn-counter.js +147 -0
  396. package/v3/dist/memory/crdt/pn-counter.js.map +1 -0
  397. package/v3/dist/memory/crdt/types.d.ts +397 -0
  398. package/v3/dist/memory/crdt/types.d.ts.map +1 -0
  399. package/v3/dist/memory/crdt/types.js +12 -0
  400. package/v3/dist/memory/crdt/types.js.map +1 -0
  401. package/v3/dist/memory/index.d.ts +5 -2
  402. package/v3/dist/memory/index.d.ts.map +1 -1
  403. package/v3/dist/memory/index.js +5 -2
  404. package/v3/dist/memory/index.js.map +1 -1
  405. package/v3/dist/performance/benchmarks.d.ts +215 -0
  406. package/v3/dist/performance/benchmarks.d.ts.map +1 -0
  407. package/v3/dist/performance/benchmarks.js +516 -0
  408. package/v3/dist/performance/benchmarks.js.map +1 -0
  409. package/v3/dist/performance/ci-gates.d.ts +149 -0
  410. package/v3/dist/performance/ci-gates.d.ts.map +1 -0
  411. package/v3/dist/performance/ci-gates.js +425 -0
  412. package/v3/dist/performance/ci-gates.js.map +1 -0
  413. package/v3/dist/performance/index.d.ts +18 -0
  414. package/v3/dist/performance/index.d.ts.map +1 -0
  415. package/v3/dist/performance/index.js +26 -0
  416. package/v3/dist/performance/index.js.map +1 -0
  417. package/v3/dist/performance/optimizer.d.ts +323 -0
  418. package/v3/dist/performance/optimizer.d.ts.map +1 -0
  419. package/v3/dist/performance/optimizer.js +592 -0
  420. package/v3/dist/performance/optimizer.js.map +1 -0
  421. package/v3/dist/performance/profiler.d.ts +195 -0
  422. package/v3/dist/performance/profiler.d.ts.map +1 -0
  423. package/v3/dist/performance/profiler.js +369 -0
  424. package/v3/dist/performance/profiler.js.map +1 -0
  425. package/v3/dist/performance/run-gates.d.ts +23 -0
  426. package/v3/dist/performance/run-gates.d.ts.map +1 -0
  427. package/v3/dist/performance/run-gates.js +122 -0
  428. package/v3/dist/performance/run-gates.js.map +1 -0
  429. package/v3/dist/sync/claude-flow-bridge.d.ts +1 -1
  430. package/v3/dist/sync/claude-flow-bridge.js +1 -1
  431. package/v3/dist/sync/interfaces.d.ts +6 -0
  432. package/v3/dist/sync/interfaces.d.ts.map +1 -1
  433. package/v3/dist/sync/interfaces.js +34 -47
  434. package/v3/dist/sync/interfaces.js.map +1 -1
  435. package/v3/dist/sync/readers/sqlite-reader.d.ts +1 -1
  436. package/v3/dist/sync/readers/sqlite-reader.js +1 -1
  437. package/v3/dist/testing/index.d.ts +6 -0
  438. package/v3/dist/testing/index.d.ts.map +1 -0
  439. package/v3/dist/testing/index.js +7 -0
  440. package/v3/dist/testing/index.js.map +1 -0
  441. package/v3/dist/testing/load/agent-load-tester.d.ts +221 -0
  442. package/v3/dist/testing/load/agent-load-tester.d.ts.map +1 -0
  443. package/v3/dist/testing/load/agent-load-tester.js +566 -0
  444. package/v3/dist/testing/load/agent-load-tester.js.map +1 -0
  445. package/v3/dist/testing/load/bottleneck-analyzer.d.ts +150 -0
  446. package/v3/dist/testing/load/bottleneck-analyzer.d.ts.map +1 -0
  447. package/v3/dist/testing/load/bottleneck-analyzer.js +442 -0
  448. package/v3/dist/testing/load/bottleneck-analyzer.js.map +1 -0
  449. package/v3/dist/testing/load/index.d.ts +17 -0
  450. package/v3/dist/testing/load/index.d.ts.map +1 -0
  451. package/v3/dist/testing/load/index.js +23 -0
  452. package/v3/dist/testing/load/index.js.map +1 -0
  453. package/v3/dist/testing/load/metrics-collector.d.ts +275 -0
  454. package/v3/dist/testing/load/metrics-collector.d.ts.map +1 -0
  455. package/v3/dist/testing/load/metrics-collector.js +475 -0
  456. package/v3/dist/testing/load/metrics-collector.js.map +1 -0
  457. package/v3/package.json +5 -1
@@ -0,0 +1,486 @@
1
+ /**
2
+ * A2A Webhook Subscription Store
3
+ *
4
+ * Manages webhook subscriptions for task notifications with CRUD operations,
5
+ * statistics tracking, and automatic cleanup of expired subscriptions.
6
+ *
7
+ * @module adapters/a2a/notifications/subscription-store
8
+ * @see https://a2a-protocol.org/latest/specification/
9
+ */
10
+ // ============================================================================
11
+ // Default Configuration
12
+ // ============================================================================
13
+ export const DEFAULT_SUBSCRIPTION_STORE_CONFIG = {
14
+ maxSubscriptionsPerTask: 10,
15
+ maxTotalSubscriptions: 10000,
16
+ defaultTtlMs: 24 * 60 * 60 * 1000, // 24 hours
17
+ maxConsecutiveFailures: 10,
18
+ enableAutoCleanup: true,
19
+ cleanupIntervalMs: 60 * 60 * 1000, // 1 hour
20
+ };
21
+ // ============================================================================
22
+ // Subscription Store Implementation
23
+ // ============================================================================
24
+ /**
25
+ * In-memory subscription store with indexing and automatic cleanup
26
+ */
27
+ export class SubscriptionStore {
28
+ config;
29
+ subscriptions = new Map();
30
+ taskIndex = new Map();
31
+ contextIndex = new Map();
32
+ statusIndex = new Map();
33
+ cleanupTimer;
34
+ constructor(config = {}) {
35
+ this.config = { ...DEFAULT_SUBSCRIPTION_STORE_CONFIG, ...config };
36
+ // Initialize status index
37
+ const statuses = ['active', 'paused', 'failed', 'expired'];
38
+ for (const status of statuses) {
39
+ this.statusIndex.set(status, new Set());
40
+ }
41
+ // Start cleanup timer if enabled
42
+ if (this.config.enableAutoCleanup && this.config.cleanupIntervalMs > 0) {
43
+ this.startCleanupTimer();
44
+ }
45
+ }
46
+ // ============================================================================
47
+ // CRUD Operations
48
+ // ============================================================================
49
+ /**
50
+ * Create a new subscription
51
+ */
52
+ create(taskId, webhookConfig, options = {}) {
53
+ // Check capacity
54
+ if (this.subscriptions.size >= this.config.maxTotalSubscriptions) {
55
+ throw new Error(`Maximum subscription limit reached: ${this.config.maxTotalSubscriptions}`);
56
+ }
57
+ // Check per-task limit
58
+ const taskSubs = this.taskIndex.get(taskId);
59
+ if (taskSubs && taskSubs.size >= this.config.maxSubscriptionsPerTask) {
60
+ throw new Error(`Maximum subscriptions per task reached: ${this.config.maxSubscriptionsPerTask}`);
61
+ }
62
+ const now = new Date();
63
+ const id = options.id ?? this.generateId();
64
+ // Check for duplicate
65
+ if (this.subscriptions.has(id)) {
66
+ throw new Error(`Subscription with ID ${id} already exists`);
67
+ }
68
+ const subscription = {
69
+ id,
70
+ taskId,
71
+ contextId: options.contextId,
72
+ webhookConfig,
73
+ status: 'active',
74
+ createdAt: now,
75
+ deliveryCount: 0,
76
+ failureCount: 0,
77
+ consecutiveFailures: 0,
78
+ expiresAt: options.expiresAt ?? new Date(now.getTime() + this.config.defaultTtlMs),
79
+ metadata: options.metadata,
80
+ };
81
+ // Store subscription
82
+ this.subscriptions.set(id, subscription);
83
+ // Update indices
84
+ this.addToTaskIndex(taskId, id);
85
+ if (options.contextId) {
86
+ this.addToContextIndex(options.contextId, id);
87
+ }
88
+ this.statusIndex.get('active')?.add(id);
89
+ return subscription;
90
+ }
91
+ /**
92
+ * Get a subscription by ID
93
+ */
94
+ get(subscriptionId) {
95
+ return this.subscriptions.get(subscriptionId) ?? null;
96
+ }
97
+ /**
98
+ * Get a subscription for a specific task (first active one)
99
+ */
100
+ getForTask(taskId) {
101
+ const subIds = this.taskIndex.get(taskId);
102
+ if (!subIds) {
103
+ return null;
104
+ }
105
+ // Return first active subscription
106
+ for (const id of subIds) {
107
+ const sub = this.subscriptions.get(id);
108
+ if (sub && sub.status === 'active') {
109
+ return sub;
110
+ }
111
+ }
112
+ return null;
113
+ }
114
+ /**
115
+ * Check if a subscription exists
116
+ */
117
+ has(subscriptionId) {
118
+ return this.subscriptions.has(subscriptionId);
119
+ }
120
+ /**
121
+ * Update a subscription
122
+ */
123
+ update(subscriptionId, updates) {
124
+ const subscription = this.subscriptions.get(subscriptionId);
125
+ if (!subscription) {
126
+ return null;
127
+ }
128
+ const oldStatus = subscription.status;
129
+ // Apply updates
130
+ if (updates.status !== undefined) {
131
+ subscription.status = updates.status;
132
+ }
133
+ if (updates.webhookConfig) {
134
+ Object.assign(subscription.webhookConfig, updates.webhookConfig);
135
+ }
136
+ if (updates.lastDeliveryAt !== undefined) {
137
+ subscription.lastDeliveryAt = updates.lastDeliveryAt;
138
+ }
139
+ if (updates.lastSuccessAt !== undefined) {
140
+ subscription.lastSuccessAt = updates.lastSuccessAt;
141
+ }
142
+ if (updates.incrementDeliveryCount) {
143
+ subscription.deliveryCount++;
144
+ }
145
+ if (updates.incrementFailureCount) {
146
+ subscription.failureCount++;
147
+ }
148
+ if (updates.consecutiveFailures !== undefined) {
149
+ subscription.consecutiveFailures = updates.consecutiveFailures;
150
+ }
151
+ if (updates.lastError !== undefined) {
152
+ subscription.lastError = updates.lastError ?? undefined;
153
+ }
154
+ if (updates.expiresAt !== undefined) {
155
+ subscription.expiresAt = updates.expiresAt ?? undefined;
156
+ }
157
+ if (updates.metadata) {
158
+ subscription.metadata = { ...subscription.metadata, ...updates.metadata };
159
+ }
160
+ // Update status index if changed
161
+ if (updates.status !== undefined && oldStatus !== updates.status) {
162
+ this.statusIndex.get(oldStatus)?.delete(subscriptionId);
163
+ this.statusIndex.get(updates.status)?.add(subscriptionId);
164
+ }
165
+ // Check for auto-fail on consecutive failures
166
+ if (subscription.consecutiveFailures >= this.config.maxConsecutiveFailures &&
167
+ subscription.status === 'active') {
168
+ subscription.status = 'failed';
169
+ this.statusIndex.get('active')?.delete(subscriptionId);
170
+ this.statusIndex.get('failed')?.add(subscriptionId);
171
+ }
172
+ return subscription;
173
+ }
174
+ /**
175
+ * Record a successful delivery
176
+ */
177
+ recordSuccess(subscriptionId) {
178
+ const now = new Date();
179
+ return this.update(subscriptionId, {
180
+ lastDeliveryAt: now,
181
+ lastSuccessAt: now,
182
+ incrementDeliveryCount: true,
183
+ consecutiveFailures: 0,
184
+ lastError: null,
185
+ });
186
+ }
187
+ /**
188
+ * Record a failed delivery
189
+ */
190
+ recordFailure(subscriptionId, error) {
191
+ const subscription = this.subscriptions.get(subscriptionId);
192
+ if (!subscription) {
193
+ return null;
194
+ }
195
+ return this.update(subscriptionId, {
196
+ lastDeliveryAt: new Date(),
197
+ incrementDeliveryCount: true,
198
+ incrementFailureCount: true,
199
+ consecutiveFailures: subscription.consecutiveFailures + 1,
200
+ lastError: error,
201
+ });
202
+ }
203
+ /**
204
+ * Delete a subscription
205
+ */
206
+ delete(subscriptionId) {
207
+ const subscription = this.subscriptions.get(subscriptionId);
208
+ if (!subscription) {
209
+ return false;
210
+ }
211
+ // Remove from indices
212
+ this.removeFromTaskIndex(subscription.taskId, subscriptionId);
213
+ if (subscription.contextId) {
214
+ this.removeFromContextIndex(subscription.contextId, subscriptionId);
215
+ }
216
+ this.statusIndex.get(subscription.status)?.delete(subscriptionId);
217
+ // Remove subscription
218
+ this.subscriptions.delete(subscriptionId);
219
+ return true;
220
+ }
221
+ /**
222
+ * Delete all subscriptions for a task
223
+ */
224
+ deleteForTask(taskId) {
225
+ const subIds = this.taskIndex.get(taskId);
226
+ if (!subIds) {
227
+ return 0;
228
+ }
229
+ let deleted = 0;
230
+ for (const id of [...subIds]) {
231
+ if (this.delete(id)) {
232
+ deleted++;
233
+ }
234
+ }
235
+ return deleted;
236
+ }
237
+ // ============================================================================
238
+ // Query Operations
239
+ // ============================================================================
240
+ /**
241
+ * List subscriptions for a task
242
+ */
243
+ listByTask(taskId) {
244
+ const subIds = this.taskIndex.get(taskId);
245
+ if (!subIds) {
246
+ return [];
247
+ }
248
+ return [...subIds]
249
+ .map((id) => this.subscriptions.get(id))
250
+ .filter(Boolean)
251
+ .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
252
+ }
253
+ /**
254
+ * List subscriptions for a context
255
+ */
256
+ listByContext(contextId) {
257
+ const subIds = this.contextIndex.get(contextId);
258
+ if (!subIds) {
259
+ return [];
260
+ }
261
+ return [...subIds]
262
+ .map((id) => this.subscriptions.get(id))
263
+ .filter(Boolean)
264
+ .sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
265
+ }
266
+ /**
267
+ * List active subscriptions for a task
268
+ */
269
+ listActiveByTask(taskId) {
270
+ return this.listByTask(taskId).filter((s) => s.status === 'active');
271
+ }
272
+ /**
273
+ * Query subscriptions with filtering
274
+ */
275
+ query(options = {}) {
276
+ let results = [...this.subscriptions.values()];
277
+ // Filter by task
278
+ if (options.taskId) {
279
+ const taskSubIds = this.taskIndex.get(options.taskId);
280
+ if (!taskSubIds) {
281
+ return [];
282
+ }
283
+ results = results.filter((s) => taskSubIds.has(s.id));
284
+ }
285
+ // Filter by context
286
+ if (options.contextId) {
287
+ const contextSubIds = this.contextIndex.get(options.contextId);
288
+ if (!contextSubIds) {
289
+ return [];
290
+ }
291
+ results = results.filter((s) => contextSubIds.has(s.id));
292
+ }
293
+ // Filter by status
294
+ if (options.status) {
295
+ const statuses = Array.isArray(options.status) ? options.status : [options.status];
296
+ results = results.filter((s) => statuses.includes(s.status));
297
+ }
298
+ // Filter by event
299
+ if (options.event) {
300
+ results = results.filter((s) => s.webhookConfig.events.includes(options.event));
301
+ }
302
+ // Filter expired unless explicitly included
303
+ if (!options.includeExpired) {
304
+ const now = new Date();
305
+ results = results.filter((s) => !s.expiresAt || s.expiresAt > now);
306
+ }
307
+ // Sort by creation time (newest first)
308
+ results.sort((a, b) => b.createdAt.getTime() - a.createdAt.getTime());
309
+ // Apply pagination
310
+ const offset = options.offset ?? 0;
311
+ const limit = options.limit ?? 100;
312
+ return results.slice(offset, offset + limit);
313
+ }
314
+ /**
315
+ * Get all active subscriptions that should receive a specific event
316
+ */
317
+ getSubscribersForEvent(taskId, event) {
318
+ const subs = this.listActiveByTask(taskId);
319
+ const now = new Date();
320
+ return subs.filter((s) => {
321
+ // Check expiration
322
+ if (s.expiresAt && s.expiresAt <= now) {
323
+ return false;
324
+ }
325
+ // Check if subscribed to this event
326
+ return s.webhookConfig.events.includes(event);
327
+ });
328
+ }
329
+ // ============================================================================
330
+ // Statistics
331
+ // ============================================================================
332
+ /**
333
+ * Get subscription statistics
334
+ */
335
+ getStats() {
336
+ const byStatus = {
337
+ active: 0,
338
+ paused: 0,
339
+ failed: 0,
340
+ expired: 0,
341
+ };
342
+ let totalDeliveries = 0;
343
+ let totalFailures = 0;
344
+ for (const [status, ids] of this.statusIndex) {
345
+ byStatus[status] = ids.size;
346
+ }
347
+ for (const sub of this.subscriptions.values()) {
348
+ totalDeliveries += sub.deliveryCount;
349
+ totalFailures += sub.failureCount;
350
+ }
351
+ return {
352
+ total: this.subscriptions.size,
353
+ byStatus,
354
+ totalDeliveries,
355
+ totalFailures,
356
+ uniqueTasks: this.taskIndex.size,
357
+ uniqueContexts: this.contextIndex.size,
358
+ };
359
+ }
360
+ /**
361
+ * Get total subscription count
362
+ */
363
+ get size() {
364
+ return this.subscriptions.size;
365
+ }
366
+ // ============================================================================
367
+ // Cleanup
368
+ // ============================================================================
369
+ /**
370
+ * Clean up expired subscriptions
371
+ */
372
+ cleanupExpired() {
373
+ const now = new Date();
374
+ const expiredIds = [];
375
+ for (const [id, sub] of this.subscriptions) {
376
+ if (sub.expiresAt && sub.expiresAt <= now) {
377
+ expiredIds.push(id);
378
+ }
379
+ }
380
+ for (const id of expiredIds) {
381
+ const sub = this.subscriptions.get(id);
382
+ if (sub) {
383
+ sub.status = 'expired';
384
+ this.statusIndex.get('active')?.delete(id);
385
+ this.statusIndex.get('expired')?.add(id);
386
+ }
387
+ this.delete(id);
388
+ }
389
+ return expiredIds.length;
390
+ }
391
+ /**
392
+ * Clean up failed subscriptions
393
+ */
394
+ cleanupFailed() {
395
+ const failedIds = [...(this.statusIndex.get('failed') ?? [])];
396
+ let deleted = 0;
397
+ for (const id of failedIds) {
398
+ if (this.delete(id)) {
399
+ deleted++;
400
+ }
401
+ }
402
+ return deleted;
403
+ }
404
+ /**
405
+ * Clear all subscriptions
406
+ */
407
+ clear() {
408
+ this.subscriptions.clear();
409
+ this.taskIndex.clear();
410
+ this.contextIndex.clear();
411
+ for (const ids of this.statusIndex.values()) {
412
+ ids.clear();
413
+ }
414
+ }
415
+ /**
416
+ * Destroy the store
417
+ */
418
+ destroy() {
419
+ this.stopCleanupTimer();
420
+ this.clear();
421
+ }
422
+ // ============================================================================
423
+ // Private Helpers
424
+ // ============================================================================
425
+ generateId() {
426
+ return `sub-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
427
+ }
428
+ addToTaskIndex(taskId, subscriptionId) {
429
+ let taskSubs = this.taskIndex.get(taskId);
430
+ if (!taskSubs) {
431
+ taskSubs = new Set();
432
+ this.taskIndex.set(taskId, taskSubs);
433
+ }
434
+ taskSubs.add(subscriptionId);
435
+ }
436
+ removeFromTaskIndex(taskId, subscriptionId) {
437
+ const taskSubs = this.taskIndex.get(taskId);
438
+ if (taskSubs) {
439
+ taskSubs.delete(subscriptionId);
440
+ if (taskSubs.size === 0) {
441
+ this.taskIndex.delete(taskId);
442
+ }
443
+ }
444
+ }
445
+ addToContextIndex(contextId, subscriptionId) {
446
+ let contextSubs = this.contextIndex.get(contextId);
447
+ if (!contextSubs) {
448
+ contextSubs = new Set();
449
+ this.contextIndex.set(contextId, contextSubs);
450
+ }
451
+ contextSubs.add(subscriptionId);
452
+ }
453
+ removeFromContextIndex(contextId, subscriptionId) {
454
+ const contextSubs = this.contextIndex.get(contextId);
455
+ if (contextSubs) {
456
+ contextSubs.delete(subscriptionId);
457
+ if (contextSubs.size === 0) {
458
+ this.contextIndex.delete(contextId);
459
+ }
460
+ }
461
+ }
462
+ startCleanupTimer() {
463
+ this.cleanupTimer = setInterval(() => {
464
+ this.cleanupExpired();
465
+ }, this.config.cleanupIntervalMs);
466
+ if (typeof this.cleanupTimer.unref === 'function') {
467
+ this.cleanupTimer.unref();
468
+ }
469
+ }
470
+ stopCleanupTimer() {
471
+ if (this.cleanupTimer) {
472
+ clearInterval(this.cleanupTimer);
473
+ this.cleanupTimer = undefined;
474
+ }
475
+ }
476
+ }
477
+ // ============================================================================
478
+ // Factory Function
479
+ // ============================================================================
480
+ /**
481
+ * Create a new subscription store
482
+ */
483
+ export function createSubscriptionStore(config = {}) {
484
+ return new SubscriptionStore(config);
485
+ }
486
+ //# sourceMappingURL=subscription-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription-store.js","sourceRoot":"","sources":["../../../../src/adapters/a2a/notifications/subscription-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+IH,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,iCAAiC,GAAsC;IAClF,uBAAuB,EAAE,EAAE;IAC3B,qBAAqB,EAAE,KAAK;IAC5B,YAAY,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,WAAW;IAC9C,sBAAsB,EAAE,EAAE;IAC1B,iBAAiB,EAAE,IAAI;IACvB,i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