agentic-qe 3.8.13 → 3.9.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 (359) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/dist/adapters/a2ui/integration/agui-sync.js +2 -1
  4. package/dist/audit/witness-chain.js +15 -3
  5. package/dist/boot/fast-paths.d.ts +24 -0
  6. package/dist/boot/fast-paths.js +43 -0
  7. package/dist/boot/parallel-prefetch.d.ts +26 -0
  8. package/dist/boot/parallel-prefetch.js +36 -0
  9. package/dist/cli/bundle.js +12 -9431
  10. package/dist/cli/chunks/adapter-WBR5NXS3.js +2 -0
  11. package/dist/cli/chunks/agent-booster-wasm-PQYB7VRU.js +2 -0
  12. package/dist/cli/chunks/agent-handler-QDAB5NQS.js +33 -0
  13. package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +2 -0
  14. package/dist/cli/chunks/audit-S7JUYYVP.js +3 -0
  15. package/dist/cli/chunks/base-2WXOSMBQ.js +2 -0
  16. package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +2 -0
  17. package/dist/cli/chunks/brain-handler-PPEGDCN4.js +68 -0
  18. package/dist/cli/chunks/branch-enumerator-XK4V5W7L.js +7 -0
  19. package/dist/cli/chunks/browser-PALA5PL3.js +4 -0
  20. package/dist/cli/chunks/browser-workflow-42F7GK5T.js +2 -0
  21. package/dist/cli/chunks/chunk-24FKIJNC.js +15 -0
  22. package/dist/cli/chunks/chunk-263XS447.js +2 -0
  23. package/dist/cli/chunks/chunk-2BZFNEN2.js +4 -0
  24. package/dist/cli/chunks/chunk-2E5NQNSU.js +180 -0
  25. package/dist/cli/chunks/chunk-2I7J3O6V.js +2 -0
  26. package/dist/cli/chunks/chunk-3ADGXLTM.js +14 -0
  27. package/dist/cli/chunks/chunk-3IHG3WOY.js +12 -0
  28. package/dist/cli/chunks/chunk-3IUNFTIF.js +2 -0
  29. package/dist/cli/chunks/chunk-3JPRUND5.js +2 -0
  30. package/dist/cli/chunks/chunk-3NZLZHJI.js +2 -0
  31. package/dist/cli/chunks/chunk-3THRQEZ2.js +95 -0
  32. package/dist/cli/chunks/chunk-3ZOONQG6.js +2 -0
  33. package/dist/cli/chunks/chunk-4B6NCELM.js +2 -0
  34. package/dist/cli/chunks/chunk-4I2IOUS4.js +2 -0
  35. package/dist/cli/chunks/chunk-4VBTXZRM.js +2 -0
  36. package/dist/cli/chunks/chunk-4VUPRTVX.js +3 -0
  37. package/dist/cli/chunks/chunk-4YOMLWEK.js +70 -0
  38. package/dist/cli/chunks/chunk-4YS3IJ45.js +2 -0
  39. package/dist/cli/chunks/chunk-5SKGFSKD.js +2 -0
  40. package/dist/cli/chunks/chunk-5T2ZQWKF.js +27 -0
  41. package/dist/cli/chunks/chunk-62ADTHV7.js +2 -0
  42. package/dist/cli/chunks/chunk-6EOS7KX2.js +2 -0
  43. package/dist/cli/chunks/chunk-6SVX4DJC.js +6 -0
  44. package/dist/cli/chunks/chunk-72WOAVK6.js +2 -0
  45. package/dist/cli/chunks/chunk-7R6YMLVS.js +3 -0
  46. package/dist/cli/chunks/chunk-7VDBAVTY.js +2 -0
  47. package/dist/cli/chunks/chunk-AFLLQ5PP.js +15 -0
  48. package/dist/cli/chunks/chunk-AKE543X2.js +2 -0
  49. package/dist/cli/chunks/chunk-B36CDR4U.js +2 -0
  50. package/dist/cli/chunks/chunk-B6LLWYQ6.js +2 -0
  51. package/dist/cli/chunks/chunk-BDIEMZ22.js +91 -0
  52. package/dist/cli/chunks/chunk-BGXNSCXX.js +4 -0
  53. package/dist/cli/chunks/chunk-BLBRY5UD.js +2 -0
  54. package/dist/cli/chunks/chunk-BPWXXEH2.js +3029 -0
  55. package/dist/cli/chunks/chunk-BR26T7ZS.js +180 -0
  56. package/dist/cli/chunks/chunk-BTREG4IW.js +2 -0
  57. package/dist/cli/chunks/chunk-BULKFVYX.js +2 -0
  58. package/dist/cli/chunks/chunk-BXAXGEFC.js +24 -0
  59. package/dist/cli/chunks/chunk-CL6POIX4.js +2 -0
  60. package/dist/cli/chunks/chunk-CS2KS7LP.js +2 -0
  61. package/dist/cli/chunks/chunk-CWFB6BSA.js +316 -0
  62. package/dist/cli/chunks/chunk-DRT3WKQW.js +2 -0
  63. package/dist/cli/chunks/chunk-EHDQJQ6Y.js +27 -0
  64. package/dist/cli/chunks/chunk-ESVQ6MEB.js +2 -0
  65. package/dist/cli/chunks/chunk-FEKY7T6Q.js +2 -0
  66. package/dist/cli/chunks/chunk-FGA7VIFR.js +7 -0
  67. package/dist/cli/chunks/chunk-FIA6X7UL.js +2 -0
  68. package/dist/cli/chunks/chunk-GAOJV3OX.js +2 -0
  69. package/dist/cli/chunks/chunk-GKNNSCLC.js +5 -0
  70. package/dist/cli/chunks/chunk-GPQ57KA4.js +2 -0
  71. package/dist/cli/chunks/chunk-GRUUQAR6.js +2 -0
  72. package/dist/cli/chunks/chunk-HRO6OZQD.js +2 -0
  73. package/dist/cli/chunks/chunk-HY6PMO5W.js +66 -0
  74. package/dist/cli/chunks/chunk-IAV2JMIX.js +167 -0
  75. package/dist/cli/chunks/chunk-IFNIIK34.js +21 -0
  76. package/dist/cli/chunks/chunk-IGJPMN4I.js +3 -0
  77. package/dist/cli/chunks/chunk-J3KWWR6Z.js +1 -0
  78. package/dist/cli/chunks/chunk-JBANAPWG.js +2 -0
  79. package/dist/cli/chunks/chunk-JJO7Y4H3.js +604 -0
  80. package/dist/cli/chunks/chunk-JRYGQO2W.js +2 -0
  81. package/dist/cli/chunks/chunk-JXM26HEE.js +2 -0
  82. package/dist/cli/chunks/chunk-JZSDOIXA.js +2 -0
  83. package/dist/cli/chunks/chunk-KP5NUODU.js +3 -0
  84. package/dist/cli/chunks/chunk-LHJQD2VU.js +750 -0
  85. package/dist/cli/chunks/chunk-LNQIY6BP.js +2 -0
  86. package/dist/cli/chunks/chunk-MDUHYUHF.js +2 -0
  87. package/dist/cli/chunks/chunk-MV6CMOJQ.js +65 -0
  88. package/dist/cli/chunks/chunk-MZOFWJTM.js +2 -0
  89. package/dist/cli/chunks/chunk-N2NS2PHA.js +45 -0
  90. package/dist/cli/chunks/chunk-N4TL73TH.js +314 -0
  91. package/dist/cli/chunks/chunk-N5UXCLFI.js +2 -0
  92. package/dist/cli/chunks/chunk-NZ2VCPN4.js +2 -0
  93. package/dist/cli/chunks/chunk-OF4D7MYI.js +2 -0
  94. package/dist/cli/chunks/chunk-OI5NGQO2.js +2 -0
  95. package/dist/cli/chunks/chunk-OLHKGP35.js +2 -0
  96. package/dist/cli/chunks/chunk-QOVHWZEP.js +1 -0
  97. package/dist/cli/chunks/chunk-RFSN6IDA.js +79 -0
  98. package/dist/cli/chunks/chunk-RTGGL7D7.js +4 -0
  99. package/dist/cli/chunks/chunk-RU5WAHB7.js +3 -0
  100. package/dist/cli/chunks/chunk-SUSEVMZT.js +2 -0
  101. package/dist/cli/chunks/chunk-TLHP5EII.js +2 -0
  102. package/dist/cli/chunks/chunk-TWUWL5EJ.js +2 -0
  103. package/dist/cli/chunks/chunk-U5RN7YQW.js +2 -0
  104. package/dist/cli/chunks/chunk-UFUVUO3J.js +2 -0
  105. package/dist/cli/chunks/chunk-UQHYFOBX.js +16 -0
  106. package/dist/cli/chunks/chunk-VOS4NQSF.js +2 -0
  107. package/dist/cli/chunks/chunk-VSVXUTJN.js +256 -0
  108. package/dist/cli/chunks/chunk-WBQSXPBI.js +2 -0
  109. package/dist/cli/chunks/chunk-WGMPEW2T.js +2 -0
  110. package/dist/cli/chunks/chunk-WIEC7VKK.js +2 -0
  111. package/dist/cli/chunks/chunk-WJ3DLOXF.js +14 -0
  112. package/dist/cli/chunks/chunk-X3KI6JOY.js +9 -0
  113. package/dist/cli/chunks/chunk-X5IJGWYG.js +2 -0
  114. package/dist/cli/chunks/chunk-XIBDETCS.js +146 -0
  115. package/dist/cli/chunks/chunk-XLRQYLWW.js +2 -0
  116. package/dist/cli/chunks/chunk-XO6PVK2P.js +3 -0
  117. package/dist/cli/chunks/chunk-XRE2HCWG.js +3 -0
  118. package/dist/cli/chunks/chunk-XT2V2322.js +2 -0
  119. package/dist/cli/chunks/chunk-Y7BHKZFJ.js +18 -0
  120. package/dist/cli/chunks/chunk-YAGODYIG.js +59 -0
  121. package/dist/cli/chunks/chunk-YANUP2RO.js +2 -0
  122. package/dist/cli/chunks/chunk-YPFOCNOE.js +30 -0
  123. package/dist/cli/chunks/chunk-YR6ZZGH7.js +81 -0
  124. package/dist/cli/chunks/chunk-YVA65UZL.js +2 -0
  125. package/dist/cli/chunks/chunk-YW2THB5Q.js +2 -0
  126. package/dist/cli/chunks/chunk-ZAPS3UGQ.js +20 -0
  127. package/dist/cli/chunks/chunk-ZDATDCYN.js +2 -0
  128. package/dist/cli/chunks/ci-J374KDLI.js +81 -0
  129. package/dist/cli/chunks/ci-output-7JN7F6CI.js +2 -0
  130. package/dist/cli/chunks/claude-flow-setup-245JLJCN.js +2 -0
  131. package/dist/cli/chunks/client-MCSNSH2C.js +2 -0
  132. package/dist/cli/chunks/cline-installer-LBA2M5N3.js +4 -0
  133. package/dist/cli/chunks/code-U4N4WONM.js +38 -0
  134. package/dist/cli/chunks/code-index-extractor-A57Z6BO4.js +3 -0
  135. package/dist/cli/chunks/codex-installer-UXMK2N4T.js +8 -0
  136. package/dist/cli/chunks/completions-W66BSCOE.js +1364 -0
  137. package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +2 -0
  138. package/dist/cli/chunks/continuedev-installer-LRFZ2SJM.js +14 -0
  139. package/dist/cli/chunks/copilot-installer-CQ3JYBIB.js +3 -0
  140. package/dist/cli/chunks/cost-tracker-4F723RB6.js +2 -0
  141. package/dist/cli/chunks/coverage-4PUEQXAY.js +27 -0
  142. package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +2 -0
  143. package/dist/cli/chunks/cursor-installer-JZEDEDHA.js +3 -0
  144. package/dist/cli/chunks/daemon-B7TWGHXQ.js +19 -0
  145. package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +2 -0
  146. package/dist/cli/chunks/detect-L6ZZHUSX.js +2 -0
  147. package/dist/cli/chunks/domain-handler-FT5FLZWL.js +25 -0
  148. package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +2 -0
  149. package/dist/cli/chunks/dream-4TDBIYED.js +2 -0
  150. package/dist/cli/chunks/esm-node-2PKHKOTS.js +2 -0
  151. package/dist/cli/chunks/eval-GHMPFGWV.js +15 -0
  152. package/dist/cli/chunks/fast-paths-B3R647KN.js +2 -0
  153. package/dist/cli/chunks/feature-flags-DWS7ARSX.js +2 -0
  154. package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +2 -0
  155. package/dist/cli/chunks/file-discovery-QFPA6GMV.js +2 -0
  156. package/dist/cli/chunks/fleet-EKOKMOMW.js +43 -0
  157. package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +2 -0
  158. package/dist/cli/chunks/heartbeat-handler-MBBS4IBU.js +48 -0
  159. package/dist/cli/chunks/heartbeat-scheduler-XDGMOT7X.js +2 -0
  160. package/dist/cli/chunks/hnsw-index-YO7CT23I.js +2 -0
  161. package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +2 -0
  162. package/dist/cli/chunks/hooks-L5VLZGEK.js +101 -0
  163. package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +2 -0
  164. package/dist/cli/chunks/hypergraph-handler-3HDGB5SZ.js +35 -0
  165. package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +2 -0
  166. package/dist/cli/chunks/init-handler-JDET6WUN.js +68 -0
  167. package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +2 -0
  168. package/dist/cli/chunks/kernel-YNDTVKIW.js +2 -0
  169. package/dist/cli/chunks/kilocode-installer-GZZG5AFW.js +4 -0
  170. package/dist/cli/chunks/kiro-installer-IWNY5TKH.js +74 -0
  171. package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +2 -0
  172. package/dist/cli/chunks/learning-722ZNSZ6.js +107 -0
  173. package/dist/cli/chunks/llm-router-DNAV746L.js +30 -0
  174. package/dist/cli/chunks/load-Y3GCUFM4.js +2 -0
  175. package/dist/cli/chunks/load-test-GZUBXFF3.js +2 -0
  176. package/dist/cli/chunks/mcp-LKPIBZ3W.js +2 -0
  177. package/dist/cli/chunks/memory-L57MLFOP.js +32 -0
  178. package/dist/cli/chunks/memory-backend-3NQIZUXE.js +2 -0
  179. package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +2 -0
  180. package/dist/cli/chunks/opencode-installer-4HUB36H5.js +3 -0
  181. package/dist/cli/chunks/orchestrator-QHSBB2UC.js +371 -0
  182. package/dist/cli/chunks/pipeline-D3QER35Z.js +19 -0
  183. package/dist/cli/chunks/platform-T4E7Q3RD.js +2 -0
  184. package/dist/cli/chunks/plugin-JHW2YPRC.js +27 -0
  185. package/dist/cli/chunks/prime-radiant-advanced-wasm-G7CFNNQV.js +2 -0
  186. package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +2 -0
  187. package/dist/cli/chunks/protocol-handler-2BQQ4HDM.js +20 -0
  188. package/dist/cli/chunks/prove-UQ6JFT73.js +3 -0
  189. package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +2 -0
  190. package/dist/cli/chunks/quality-JRZYMC77.js +7 -0
  191. package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +2 -0
  192. package/dist/cli/chunks/real-embeddings-GK63VF35.js +2 -0
  193. package/dist/cli/chunks/roocode-installer-F4E2LAYR.js +4 -0
  194. package/dist/cli/chunks/router-RJGHWDQ3.js +2 -0
  195. package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +2 -0
  196. package/dist/cli/chunks/routing-handler-VNKFUUGB.js +20 -0
  197. package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +8 -0
  198. package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +2 -0
  199. package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +2 -0
  200. package/dist/cli/chunks/safe-db-G22E5ROA.js +2 -0
  201. package/dist/cli/chunks/schedule-Y7VVCPYV.js +2 -0
  202. package/dist/cli/chunks/scheduler-AUQIFQB7.js +2 -0
  203. package/dist/cli/chunks/security-EBEG2OPU.js +14 -0
  204. package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +2 -0
  205. package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +2 -0
  206. package/dist/cli/chunks/status-handler-VZ32M4G4.js +45 -0
  207. package/dist/cli/chunks/structural-health-K6LRCKV6.js +2 -0
  208. package/dist/cli/chunks/sync-MHSHNLIM.js +23 -0
  209. package/dist/cli/chunks/task-handler-JNOIBZ2G.js +49 -0
  210. package/dist/cli/chunks/task-handlers-P5DSUKND.js +2 -0
  211. package/dist/cli/chunks/test-DO22BNIL.js +33 -0
  212. package/dist/cli/chunks/test-scheduling-VLRQZEFL.js +15 -0
  213. package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +2 -0
  214. package/dist/cli/chunks/token-usage-LG3PXRXH.js +25 -0
  215. package/dist/cli/chunks/transformers-GY7SIKEU.js +2 -0
  216. package/dist/cli/chunks/tree-sitter-wasm-parser-FT2KB66N.js +2 -0
  217. package/dist/cli/chunks/types-QJGNBKP2.js +2 -0
  218. package/dist/cli/chunks/unified-memory-XYGENQUT.js +2 -0
  219. package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +2 -0
  220. package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +2 -0
  221. package/dist/cli/chunks/validate-VQCRSVNQ.js +21 -0
  222. package/dist/cli/chunks/validate-swarm-A5DHAWTP.js +14 -0
  223. package/dist/cli/chunks/vibium-RZBSL4EB.js +2 -0
  224. package/dist/cli/chunks/visual-security-V47BLGJM.js +2 -0
  225. package/dist/cli/chunks/web-tree-sitter-7C4NXEOF.js +2 -0
  226. package/dist/cli/chunks/windsurf-installer-ES3KPQG3.js +7 -0
  227. package/dist/cli/chunks/witness-chain-BR63P4A7.js +2 -0
  228. package/dist/cli/chunks/workflow-JETHX4ML.js +51 -0
  229. package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +2 -0
  230. package/dist/cli/chunks/wrappers-WP5RH745.js +2 -0
  231. package/dist/cli/commands/daemon.d.ts +13 -0
  232. package/dist/cli/commands/daemon.js +224 -0
  233. package/dist/cli/commands/hooks-handlers/hooks-shared.js +2 -1
  234. package/dist/cli/commands/plugin.d.ts +12 -0
  235. package/dist/cli/commands/plugin.js +135 -0
  236. package/dist/cli/commands/workflow.d.ts +10 -0
  237. package/dist/cli/commands/workflow.js +587 -0
  238. package/dist/cli/handlers/brain-handler.js +13 -8
  239. package/dist/cli/handlers/heartbeat-handler.d.ts +1 -0
  240. package/dist/cli/handlers/heartbeat-handler.js +20 -10
  241. package/dist/cli/handlers/hypergraph-handler.js +3 -3
  242. package/dist/cli/handlers/init-handler.js +10 -9
  243. package/dist/cli/handlers/interfaces.d.ts +4 -4
  244. package/dist/cli/index.js +159 -638
  245. package/dist/cli/lazy-registry.d.ts +27 -0
  246. package/dist/cli/lazy-registry.js +70 -0
  247. package/dist/context/compaction/context-budget.d.ts +71 -0
  248. package/dist/context/compaction/context-budget.js +120 -0
  249. package/dist/context/compaction/index.d.ts +96 -0
  250. package/dist/context/compaction/index.js +259 -0
  251. package/dist/context/compaction/llm-caller-adapter.d.ts +14 -0
  252. package/dist/context/compaction/llm-caller-adapter.js +47 -0
  253. package/dist/context/compaction/tier1-microcompact.d.ts +33 -0
  254. package/dist/context/compaction/tier1-microcompact.js +47 -0
  255. package/dist/context/compaction/tier2-session-summary.d.ts +72 -0
  256. package/dist/context/compaction/tier2-session-summary.js +172 -0
  257. package/dist/context/compaction/tier3-llm-compact.d.ts +65 -0
  258. package/dist/context/compaction/tier3-llm-compact.js +166 -0
  259. package/dist/context/compaction/tier4-reactive.d.ts +54 -0
  260. package/dist/context/compaction/tier4-reactive.js +129 -0
  261. package/dist/coordination/consensus/providers/claude-provider.d.ts +1 -0
  262. package/dist/coordination/consensus/providers/claude-provider.js +23 -3
  263. package/dist/domains/test-generation/generators/base-test-generator.d.ts +1 -1
  264. package/dist/domains/test-generation/generators/base-test-generator.js +11 -11
  265. package/dist/domains/test-generation/generators/go-test-generator.js +12 -12
  266. package/dist/domains/test-generation/generators/junit5-generator.js +9 -9
  267. package/dist/domains/test-generation/generators/kotlin-junit-generator.js +10 -10
  268. package/dist/domains/test-generation/generators/pytest-generator.js +8 -8
  269. package/dist/domains/test-generation/generators/swift-testing-generator.js +8 -8
  270. package/dist/domains/test-generation/generators/test-value-helpers.d.ts +20 -0
  271. package/dist/domains/test-generation/generators/test-value-helpers.js +48 -0
  272. package/dist/domains/test-generation/generators/xunit-generator.js +11 -11
  273. package/dist/hooks/cross-phase-hooks.d.ts +11 -0
  274. package/dist/hooks/cross-phase-hooks.js +73 -9
  275. package/dist/hooks/security/config-snapshot.d.ts +21 -0
  276. package/dist/hooks/security/config-snapshot.js +33 -0
  277. package/dist/hooks/security/exit-codes.d.ts +28 -0
  278. package/dist/hooks/security/exit-codes.js +33 -0
  279. package/dist/hooks/security/index.d.ts +15 -0
  280. package/dist/hooks/security/index.js +15 -0
  281. package/dist/hooks/security/ssrf-guard.d.ts +25 -0
  282. package/dist/hooks/security/ssrf-guard.js +69 -0
  283. package/dist/index.d.ts +1 -1
  284. package/dist/index.js +1 -2
  285. package/dist/init/init-wizard-hooks.js +15 -1
  286. package/dist/init/phases/07-hooks.js +2 -2
  287. package/dist/init/settings-merge.js +3 -7
  288. package/dist/kernel/kernel.js +35 -0
  289. package/dist/kernel/memory-backend.js +3 -1
  290. package/dist/mcp/bundle.js +416 -362
  291. package/dist/mcp/entry.js +132 -77
  292. package/dist/mcp/http-server.js +4 -1
  293. package/dist/mcp/index.d.ts +2 -2
  294. package/dist/mcp/index.js +5 -4
  295. package/dist/mcp/middleware/batch-executor.d.ts +46 -0
  296. package/dist/mcp/middleware/batch-executor.js +150 -0
  297. package/dist/mcp/middleware/microcompact.d.ts +97 -0
  298. package/dist/mcp/middleware/microcompact.js +179 -0
  299. package/dist/mcp/middleware/middleware-chain.d.ts +37 -0
  300. package/dist/mcp/middleware/middleware-chain.js +60 -0
  301. package/dist/mcp/protocol-server.d.ts +16 -0
  302. package/dist/mcp/protocol-server.js +140 -36
  303. package/dist/mcp/services/session-durability-middleware.d.ts +22 -0
  304. package/dist/mcp/services/session-durability-middleware.js +64 -0
  305. package/dist/mcp/services/session-resume.d.ts +29 -0
  306. package/dist/mcp/services/session-resume.js +221 -0
  307. package/dist/mcp/services/session-store.d.ts +84 -0
  308. package/dist/mcp/services/session-store.js +163 -0
  309. package/dist/mcp/tool-registry.d.ts +9 -0
  310. package/dist/mcp/tool-registry.js +30 -1
  311. package/dist/mcp/types.d.ts +1 -0
  312. package/dist/plugins/cache.d.ts +44 -0
  313. package/dist/plugins/cache.js +149 -0
  314. package/dist/plugins/index.d.ts +15 -0
  315. package/dist/plugins/index.js +15 -0
  316. package/dist/plugins/lifecycle.d.ts +67 -0
  317. package/dist/plugins/lifecycle.js +175 -0
  318. package/dist/plugins/manifest.d.ts +45 -0
  319. package/dist/plugins/manifest.js +173 -0
  320. package/dist/plugins/resolver.d.ts +37 -0
  321. package/dist/plugins/resolver.js +80 -0
  322. package/dist/plugins/security.d.ts +23 -0
  323. package/dist/plugins/security.js +125 -0
  324. package/dist/plugins/sources/github.d.ts +17 -0
  325. package/dist/plugins/sources/github.js +77 -0
  326. package/dist/plugins/sources/local.d.ts +20 -0
  327. package/dist/plugins/sources/local.js +32 -0
  328. package/dist/plugins/sources/npm.d.ts +18 -0
  329. package/dist/plugins/sources/npm.js +82 -0
  330. package/dist/shared/llm/retry.d.ts +5 -2
  331. package/dist/shared/llm/retry.js +7 -3
  332. package/dist/shared/prompt-cache-latch.d.ts +41 -0
  333. package/dist/shared/prompt-cache-latch.js +63 -0
  334. package/dist/shared/retry-engine.d.ts +77 -0
  335. package/dist/shared/retry-engine.js +194 -0
  336. package/dist/workers/daemon.d.ts +8 -0
  337. package/dist/workers/daemon.js +13 -0
  338. package/dist/workers/quality-daemon/ci-monitor.d.ts +55 -0
  339. package/dist/workers/quality-daemon/ci-monitor.js +147 -0
  340. package/dist/workers/quality-daemon/coverage-delta.d.ts +72 -0
  341. package/dist/workers/quality-daemon/coverage-delta.js +135 -0
  342. package/dist/workers/quality-daemon/git-watcher.d.ts +51 -0
  343. package/dist/workers/quality-daemon/git-watcher.js +209 -0
  344. package/dist/workers/quality-daemon/index.d.ts +119 -0
  345. package/dist/workers/quality-daemon/index.js +343 -0
  346. package/dist/workers/quality-daemon/nightly-consolidation.d.ts +74 -0
  347. package/dist/workers/quality-daemon/nightly-consolidation.js +136 -0
  348. package/dist/workers/quality-daemon/notification-service.d.ts +67 -0
  349. package/dist/workers/quality-daemon/notification-service.js +178 -0
  350. package/dist/workers/quality-daemon/persistent-memory.d.ts +31 -0
  351. package/dist/workers/quality-daemon/persistent-memory.js +30 -0
  352. package/dist/workers/quality-daemon/priority-queue.d.ts +97 -0
  353. package/dist/workers/quality-daemon/priority-queue.js +126 -0
  354. package/dist/workers/quality-daemon/test-suggester.d.ts +50 -0
  355. package/dist/workers/quality-daemon/test-suggester.js +121 -0
  356. package/dist/workers/worker-manager.js +2 -1
  357. package/package.json +1 -1
  358. package/dist/mcp/server.d.ts +0 -46
  359. package/dist/mcp/server.js +0 -802
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-7R6YMLVS.js";import"./chunk-72WOAVK6.js";import"./chunk-HRO6OZQD.js";import"./chunk-4I2IOUS4.js";export{g as ComplexityAnalyzer,c as ScoreCalculator,a as SignalCollector,e as TierRecommender,h as createComplexityAnalyzer,i as createComplexityAnalyzerWithDependencies,d as createScoreCalculator,b as createSignalCollector,f as createTierRecommender};
@@ -0,0 +1,14 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{b as g}from"./chunk-4YOMLWEK.js";import{a as u,c as h}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";h();import{existsSync as o,mkdirSync as f,readFileSync as d,writeFileSync as a}from"fs";import{join as m,dirname as p}from"path";var c=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("continuedev"),e=m(this.projectRoot,r.path);if(t.configPath=e,!o(e)||this.overwrite){let n=p(e);if(o(n)||f(n,{recursive:!0}),o(e)&&this.overwrite){let v=this.mergeExistingYamlConfig(e,r.content);a(e,v)}else a(e,r.content);t.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("continuedev"),i=m(this.projectRoot,s.path);if(t.rulesPath=i,!o(i)||this.overwrite){let n=p(i);o(n)||f(n,{recursive:!0}),a(i,s.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Continue.dev installation failed: ${u(r)}`)}return t}mergeExistingYamlConfig(t,r){try{let e=d(t,"utf-8");return e.includes("agentic-qe")?e:e.includes("mcpServers:")?e.trimEnd()+`
3
+ `+` - name: agentic-qe
4
+ command: npx
5
+ args:
6
+ - "-y"
7
+ - agentic-qe@latest
8
+ - mcp
9
+ env:
10
+ AQE_MEMORY_PATH: .agentic-qe/memory.db
11
+ AQE_V3_MODE: "true"`+`
12
+ `:e.trimEnd()+`
13
+
14
+ `+r}catch{return r}}};function R(l){return new c(l)}export{c as ContinueDevInstaller,R as createContinueDevInstaller};
@@ -0,0 +1,3 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{b as g}from"./chunk-4YOMLWEK.js";import{a as p,c as v}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";v();import{existsSync as s,mkdirSync as f,readFileSync as C,writeFileSync as l}from"fs";import{join as u,dirname as h}from"path";var a=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("copilot"),e=u(this.projectRoot,r.path);if(t.configPath=e,!s(e)||this.overwrite){let o=h(e);if(s(o)||f(o,{recursive:!0}),s(e)&&this.overwrite){let m=this.mergeExistingConfig(e,r.content);l(e,m)}else l(e,r.content);t.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("copilot"),n=u(this.projectRoot,i.path);if(t.rulesPath=n,!s(n)||this.overwrite){let o=h(n);s(o)||f(o,{recursive:!0}),l(n,i.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Copilot installation failed: ${p(r)}`)}return t}mergeExistingConfig(t,r){try{let e=JSON.parse(C(t,"utf-8")),i=JSON.parse(r);return e.servers||(e.servers={}),Object.assign(e.servers,i.servers),JSON.stringify(e,null,2)+`
3
+ `}catch{return r}}};function y(c){return new a(c)}export{a as CopilotInstaller,y as createCopilotInstaller};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d}from"./chunk-YVA65UZL.js";import"./chunk-4I2IOUS4.js";export{b as CostTracker,a as MODEL_PRICING,c as getGlobalCostTracker,d as resetGlobalCostTracker};
@@ -0,0 +1,27 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as V}from"./chunk-BGXNSCXX.js";import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}from"./chunk-XRE2HCWG.js";import{b as I}from"./chunk-JBANAPWG.js";import{c as P,d as W,g as G}from"./chunk-YR6ZZGH7.js";import"./chunk-4I2IOUS4.js";import{Command as q}from"commander";import e from"chalk";var R={low:{minRisk:.7,maxGaps:10,description:"Only critical gaps with high risk scores"},medium:{minRisk:.5,maxGaps:20,description:"Moderate gaps including medium risk items"},high:{minRisk:.3,maxGaps:50,description:"All gaps including low risk items"}},$=class extends M{constructor(t={}){super(t)}getTitle(){return"Coverage Analysis Wizard"}getSubtitle(){return"Analyze code coverage with O(log n) gap detection"}getConfirmationPrompt(){return"Proceed with coverage analysis?"}isNonInteractive(){return this.options.nonInteractive??!1}getCommands(){return[new D({id:"target",stepNumber:"1/7",title:"Target Directory",description:"Enter the directory or file to analyze for coverage",examples:"src/, ./lib, coverage/lcov.info",defaultValue:this.options.defaultTarget||".",suggestionsProvider:j.getCoverageTargets,validatePath:!0}),new x({id:"sensitivity",stepNumber:"2/7",title:"Gap Detection Sensitivity",description:"Select how sensitive the gap detection should be",options:[{key:"1",value:"low",label:"low",description:R.low.description},{key:"2",value:"medium",label:"medium",description:R.medium.description},{key:"3",value:"high",label:"high",description:R.high.description}],defaultValue:this.options.defaultSensitivity||"medium",validValues:["low","medium","high"]}),new x({id:"format",stepNumber:"3/7",title:"Report Format",description:"Select the output format for the coverage report",options:[{key:"1",value:"json",label:"json",description:"JSON - Machine-readable, good for CI/CD pipelines"},{key:"2",value:"html",label:"html",description:"HTML - Interactive, visual report with charts"},{key:"3",value:"markdown",label:"markdown",description:"Markdown - Documentation-friendly format"},{key:"4",value:"text",label:"text",description:"Text - Simple console output"}],defaultValue:this.options.defaultFormat||"json",validValues:["json","html","markdown","text"]}),new N({id:"priorityFocus",stepNumber:"4/7",title:"Priority Focus Areas",description:"Select coverage metrics to prioritize (comma-separated or numbers)",instructions:"Example: 1,2 or functions,branches",options:[{key:"1",value:"functions",label:"functions",description:"Functions - Focus on function coverage"},{key:"2",value:"branches",label:"branches",description:"Branches - Focus on branch/decision coverage"},{key:"3",value:"lines",label:"lines",description:"Lines - Focus on line coverage"},{key:"4",value:"statements",label:"statements",description:"Statements - Focus on statement coverage"}],defaultValue:this.options.defaultPriorityFocus||["functions","branches"],validValues:["functions","branches","lines","statements"]}),new O({id:"riskScoring",stepNumber:"5/7",title:"Enable risk scoring",description:"Enable risk scoring to prioritize coverage gaps by potential impact",additionalInfo:"Risk scores consider code complexity, change frequency, and criticality",defaultValue:this.options.defaultRiskScoring??!0}),new L({id:"threshold",stepNumber:"6/7",title:"Coverage threshold %",description:"Set the minimum coverage percentage required. Files below this threshold will be flagged.",presets:[{key:"1",value:60,label:"60% - Legacy/maintenance projects"},{key:"2",value:70,label:"70% - Standard projects"},{key:"3",value:80,label:"80% - Quality-focused projects"},{key:"4",value:90,label:"90% - Critical/high-reliability projects"}],defaultValue:this.options.defaultThreshold||80,min:0,max:100}),new B({id:"patterns",stepNumber:"7/7",title:"File Patterns (Optional)",description:"Specify patterns to include or exclude from analysis. Leave blank to analyze all files."})]}buildResult(t){let h=t.patterns;return{target:t.target,sensitivity:t.sensitivity,format:t.format,priorityFocus:t.priorityFocus,riskScoring:t.riskScoring,threshold:t.threshold,includePatterns:h?.include,excludePatterns:h?.exclude,cancelled:!1}}printSummary(t){u.printSummaryHeader();let h=F.relativePath(t.target,this.cwd);u.printSummaryField("Target",h),u.printSummaryField("Sensitivity",t.sensitivity),u.printSummaryField("Report Format",t.format),u.printSummaryField("Priority Focus",t.priorityFocus.join(", ")),u.printSummaryField("Risk Scoring",F.enabledDisabled(t.riskScoring)),u.printSummaryField("Threshold",F.percentage(t.threshold)),t.includePatterns&&t.includePatterns.length>0&&u.printSummaryField("Include",t.includePatterns.join(", ")),t.excludePatterns&&t.excludePatterns.length>0&&u.printSummaryField("Exclude",t.excludePatterns.join(", "));let b=R[t.sensitivity];u.printDerivedSettings({"Min risk score":String(b.minRisk),"Max gaps shown":String(b.maxGaps)})}getDefaults(){return{target:this.options.defaultTarget||this.cwd,sensitivity:this.options.defaultSensitivity||"medium",format:this.options.defaultFormat||"json",priorityFocus:this.options.defaultPriorityFocus||["functions","branches"],riskScoring:this.options.defaultRiskScoring??!0,threshold:this.options.defaultThreshold||80,cancelled:!1}}getCancelled(){return{target:".",sensitivity:"medium",format:"json",priorityFocus:["functions","branches"],riskScoring:!0,threshold:80,cancelled:!0}}};async function E(p={}){return new $(p).run()}function z(p){return p>=80?e.green:p>=50?e.yellow:e.red}function te(p,t,h){let b=new q("coverage").description("Coverage analysis shortcut").argument("[target]","Target file or directory",".").option("--risk","Include risk scoring").option("--gaps","Detect coverage gaps").option("--threshold <percent>","Coverage threshold percentage","80").option("--sensitivity <level>","Gap detection sensitivity (low|medium|high)","medium").option("--wizard","Run interactive coverage analysis wizard").option("--ghost","Include ghost intent coverage analysis (detect untested behavioral intents)").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async(y,i)=>{let g=y,w=i.risk,k=i.gaps,d=parseInt(i.threshold,10);if(i.wizard)try{let s=await E({defaultTarget:y!=="."?y:void 0,defaultThreshold:i.threshold!=="80"?parseInt(i.threshold,10):void 0,defaultRiskScoring:i.risk,defaultSensitivity:i.sensitivity!=="medium"?i.sensitivity:void 0});s.cancelled&&(console.log(e.yellow(`
3
+ Coverage analysis cancelled.
4
+ `)),await t(0)),g=s.target,w=s.riskScoring,k=!0,d=s.threshold,console.log(e.green(`
5
+ Starting coverage analysis...
6
+ `))}catch(s){console.error(e.red(`
7
+ Wizard error:`),s),await t(1)}if(await h())try{console.log(e.blue(`
8
+ Analyzing coverage for ${g}...
9
+ `));let s=await p.kernel.getDomainAPIAsync("coverage-analysis");if(!s){console.log(e.red("Coverage analysis domain not available"));return}let v=(await import("path")).resolve(g),S=I(v,{includeTests:!1});if(S.length===0){console.log(e.yellow("No source files found"));return}console.log(e.gray(` Analyzing ${S.length} files...
10
+ `));let c=V(S);c.instrumented?console.log(e.green(` Using instrumented coverage data (V8/istanbul)
11
+ `)):(console.log(e.yellow(" No instrumented coverage found \u2014 using heuristic estimation")),console.log(e.gray(` Run tests with coverage first: npm test -- --coverage
12
+ `)));let m=await s.analyze({coverageData:c,threshold:d,includeFileDetails:!0}),f=i.format,a;if(m.success&&m.value){let o=m.value;if(a={summary:o.summary,meetsThreshold:o.meetsThreshold,threshold:d,recommendations:o.recommendations},f==="text"){let n=r=>typeof r=="number"?r.toFixed(1):r;if(console.log(e.cyan(" Coverage Summary:")),console.log(` Lines: ${z(o.summary.line)(n(o.summary.line)+"%")}`),console.log(` Branches: ${z(o.summary.branch)(n(o.summary.branch)+"%")}`),console.log(` Functions: ${z(o.summary.function)(n(o.summary.function)+"%")}`),console.log(` Statements: ${z(o.summary.statement)(n(o.summary.statement)+"%")}`),console.log(`
13
+ Threshold: ${o.meetsThreshold?e.green(`Met (${d}%)`):e.red(`Not met (${d}%)`)}`),o.recommendations.length>0){console.log(e.cyan(`
14
+ Recommendations:`));for(let r of o.recommendations)console.log(e.gray(` - ${r}`))}}}if(k){console.log(e.cyan(`
15
+ Coverage Gaps:`));let o=await s.detectGaps({coverageData:c,minCoverage:d,prioritize:w?"risk":"size"});if(o.success&&o.value){let n=o.value;a&&(a.gaps=n.gaps.map(r=>({file:r.file.replace(process.cwd()+"/",""),lines:r.lines,riskScore:r.riskScore,severity:r.severity}))),console.log(e.gray(` Total uncovered lines: ${n.totalUncoveredLines}`)),console.log(e.gray(` Estimated effort: ${n.estimatedEffort} hours
16
+ `));for(let r of n.gaps.slice(0,8)){let l=r.severity==="high"?e.red:r.severity==="medium"?e.yellow:e.gray,C=r.file.replace(process.cwd()+"/","");console.log(` ${l(`[${r.severity}]`)} ${e.white(C)}`),console.log(e.gray(` ${r.lines.length} uncovered lines, Risk: ${(r.riskScore*100).toFixed(0)}%`))}n.gaps.length>8&&console.log(e.gray(` ... and ${n.gaps.length-8} more gaps`))}}if(i.ghost||k){console.log(e.cyan(`
17
+ Ghost Intent Coverage (ADR-059):`));try{let o=c.files.map(r=>r.path),n=await s.analyzeGhostCoverage(o,g);if(n.success&&n.value){let r=n.value;console.log(e.gray(` Phantom gaps detected: ${r.gaps.length}`)),console.log(e.gray(` Ghost score: ${(r.totalGhostScore*100).toFixed(1)}%`)),console.log(e.gray(` Coverage completeness: ${(r.coverageCompleteness*100).toFixed(1)}%
18
+ `));for(let l of r.gaps.slice(0,8)){let C=l.severity==="critical"?e.red:l.severity==="high"?e.red:l.severity==="medium"?e.yellow:e.gray;console.log(` ${C(`[${l.severity}]`)} ${e.white(l.category)}`),console.log(e.gray(` ${l.description}`))}r.gaps.length>8&&console.log(e.gray(` ... and ${r.gaps.length-8} more phantom gaps`))}else console.log(e.dim(" Ghost analysis not available (requires HNSW index)"))}catch{console.log(e.dim(" Ghost analysis skipped (analyzer not initialized)"))}}if(w){console.log(e.cyan(`
19
+ Risk Analysis:`));let o=[...c.files].sort((n,r)=>n.lines.covered/n.lines.total-r.lines.covered/r.lines.total).slice(0,5);for(let n of o){let r=await s.calculateRisk({file:n.path,uncoveredLines:n.uncoveredLines});if(r.success&&r.value){let l=r.value,C=l.riskLevel==="high"?e.red:l.riskLevel==="medium"?e.yellow:e.green,A=n.path.replace(process.cwd()+"/","");console.log(` ${C(`[${l.riskLevel}]`)} ${e.white(A)}`),console.log(e.gray(` Risk: ${(l.overallRisk*100).toFixed(0)}%, Coverage: ${Math.round(n.lines.covered/n.lines.total*100)}%`))}}}if(a&&f==="json"?P(W(a),i.output):a&&f==="markdown"?P(G(a),i.output):f==="text"&&console.log(e.green(`
20
+ Coverage analysis complete
21
+ `)),a&&!a.meetsThreshold&&await t(1),a){let o=(a.summary.line+a.summary.branch+a.summary.function+a.summary.statement)/4;o<d+5&&o>=d&&await t(2)}await t(0)}catch(s){console.error(e.red(`
22
+ Failed:`),s),await t(1)}});return b.command("gaps").description("Enumerate unhandled branches in source files").argument("<file>","Source file to analyze").option("--mechanical","Exhaustive mode: report all branches without filtering").option("--json","Output as JSON").option("--markdown","Output as markdown report").action(async(y,i)=>{try{let{readFileSync:g,existsSync:w}=await import("fs"),k=await import("path"),{enumerateBranches:d,formatBranchReport:s,formatBranchJSON:T}=await import("./branch-enumerator-XK4V5W7L.js"),v=k.resolve(y);w(v)||(console.error(e.red(`
23
+ File not found: ${v}
24
+ `)),await t(1));let S=g(v,"utf-8"),c=d(S,v);if(i.json)console.log(T(c));else if(i.markdown)console.log(s(c));else{if(console.log(`
25
+ ${e.cyan("Branch Enumeration:")} ${e.white(y)}`),console.log(e.gray(`Found ${c.unhandledCount} unhandled branches (${c.duration}ms)
26
+ `)),c.branches.length>0){console.log(e.dim("Line | Severity | Construct | Trigger")),console.log(e.dim("-----|----------|---------------------------|--------"));for(let m of c.branches){let f=m.severity==="high"?e.red:m.severity==="medium"?e.yellow:e.gray;console.log(`${String(m.line).padStart(4)} | ${f(m.severity.padEnd(8))} | ${m.construct.padEnd(25)} | ${m.triggerCondition}`)}}else console.log(e.green("No unhandled branches detected."));console.log("")}await t(0)}catch(g){console.error(e.red(`
27
+ Branch enumeration failed:`),g),await t(1)}}),b}export{te as createCoverageCommand};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b}from"./chunk-JXM26HEE.js";import"./chunk-TLHP5EII.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-4I2IOUS4.js";export{a as CrossDomainEventRouter,b as createCrossDomainRouter};
@@ -0,0 +1,3 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{b as g}from"./chunk-4YOMLWEK.js";import{a as u,c as m}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";m();import{existsSync as s,mkdirSync as h,readFileSync as v,writeFileSync as i}from"fs";import{join as f,dirname as C}from"path";var a=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=g()}async install(){let r={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let t=this.generator.generateMcpConfig("cursor"),e=f(this.projectRoot,t.path);if(r.configPath=e,!s(e)||this.overwrite){let l=C(e);if(s(l)||h(l,{recursive:!0}),s(e)&&this.overwrite){let p=this.mergeExistingConfig(e,t.content);i(e,p)}else i(e,t.content);r.mcpConfigured=!0}let o=this.generator.generateBehavioralRules("cursor"),n=f(this.projectRoot,o.path);r.rulesPath=n,(!s(n)||this.overwrite)&&(i(n,o.content),r.rulesInstalled=!0)}catch(t){r.success=!1,r.errors.push(`Cursor installation failed: ${u(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(v(r,"utf-8")),o=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,o.mcpServers),JSON.stringify(e,null,2)+`
3
+ `}catch{return t}}};function R(c){return new a(c)}export{a as CursorInstaller,R as createCursorInstaller};
@@ -0,0 +1,19 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as N}from"./chunk-BULKFVYX.js";import"./chunk-4I2IOUS4.js";import{Command as ae}from"commander";import s from"chalk";import{cpus as ne,freemem as ie,totalmem as re,loadavg as se}from"os";var f=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let o=this.queues[t];for(;o.length>0;){let n=o.shift();if(!(n.ttlMs&&e-n.createdAt>n.ttlMs))return n}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let o=this.queues[t];for(let n of o)if(!n.ttlMs||e-n.createdAt<=n.ttlMs)return n}}drainPriority(e){let t=this.queues[e].splice(0),o=Date.now();return t.filter(n=>!n.ttlMs||o-n.createdAt<=n.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let o of["now","next","later"]){let n=this.queues[o].length;this.queues[o]=this.queues[o].filter(i=>!i.ttlMs||t-i.createdAt<=i.ttlMs),e+=n-this.queues[o].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as E}from"fs";import{execFile as L}from"child_process";import{promisify as U}from"util";import{resolve as W,join as z}from"path";import{existsSync as j,readFileSync as B}from"fs";var M=U(L),J={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},y=class{constructor(e,t){this.queue=e;this.options={...J,...t}}watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=W(this.options.repoRoot,".git","refs","heads");if(!j(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=E(e,{recursive:!0},(o,n)=>{n&&this.handleRefChange(n)}):this.pollTimer=setInterval(()=>{this.poll().catch(o=>{console.debug("[GitWatcher] Poll error:",o)})},this.options.pollIntervalMs),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let{stdout:t}=await M("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let o of t.trim().split(`
3
+ `)){if(!o)continue;let[n,i]=o.split(" "),r=this.lastKnownHeads.get(n);r&&r!==i&&(e.push(n),await this.enqueueCommitAnalysis(n,i)),this.lastKnownHeads.set(n,i)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),o=W(this.options.repoRoot,".git","refs","heads"),n=z(o,e),i;try{i=B(n,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==i&&(this.lastKnownHeads.set(t,i),await this.enqueueCommitAnalysis(t,i))}async enqueueCommitAnalysis(e,t){let o=[];try{let{stdout:r}=await M("git",["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot});o=r.trim().split(`
4
+ `).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let n={type:"git_commit",branch:e,commitHash:t,changedFiles:o},i={id:`git-${t}-${Date.now()}`,priority:"next",payload:n,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(i)}async snapshotHeads(){try{let{stdout:e}=await M("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let t of e.trim().split(`
5
+ `)){if(!t)continue;let[o,n]=t.split(" ");this.lastKnownHeads.set(o,n)}}catch{}}};var V={regressionThreshold:2,gapThreshold:60,memoryPrefix:"quality-daemon:coverage"},v=class{constructor(e,t){this.queue=e;this.options={...V,...t}}options;async analyze(e,t,o){let n=await t.get(`${this.options.memoryPrefix}:snapshot`);if(await t.set(`${this.options.memoryPrefix}:snapshot`,e),!n)return{regressionDetected:!1,overallDelta:{line:0,branch:0,function:0,statement:0},affectedFiles:[],newGaps:[]};let i=n,r={line:e.overall.line-i.overall.line,branch:e.overall.branch-i.overall.branch,function:e.overall.function-i.overall.function,statement:e.overall.statement-i.overall.statement},a=r.line<-this.options.regressionThreshold||r.branch<-this.options.regressionThreshold,c=o??Object.keys(e.files),d=[],h=[];for(let g of c){let m=e.files[g],p=i.files[g];if(!m)continue;let R=p?m.line-p.line:0,$=p?m.branch-p.branch:0,I=p?m.uncoveredLines.filter(_=>!p.uncoveredLines.includes(_)):m.uncoveredLines;if((R!==0||$!==0||I.length>0)&&d.push({file:g,lineDelta:R,branchDelta:$,newUncoveredLines:I}),m.line<this.options.gapThreshold){let _=this.computeRiskScore(m,I.length);h.push({file:g,uncoveredLines:m.uncoveredLines,currentCoverage:m.line,riskScore:_})}}return(a||h.length>0)&&this.enqueueTestSuggestion(e,i,h),await t.set(`${this.options.memoryPrefix}:delta`,{timestamp:Date.now(),overallDelta:r,regressionDetected:a,affectedFileCount:d.length,gapCount:h.length}),{regressionDetected:a,overallDelta:r,affectedFiles:d,newGaps:h}}async buildSnapshot(e){let t=await e.get("coverage:latest");if(t)return{timestamp:Date.now(),overall:{line:t.line,branch:t.branch,function:t.function,statement:t.statement},files:t.files??{}}}computeRiskScore(e,t){let n=1-Math.min(100,Math.max(0,e.line))/100,i=Math.min(t/50,1);return Math.min(1,n*.6+i*.4)}enqueueTestSuggestion(e,t,o){let n={type:"coverage_delta",previousSnapshot:`snapshot-${t.timestamp}`,currentSnapshot:`snapshot-${e.timestamp}`},i={id:`coverage-delta-${Date.now()}`,priority:o.some(r=>r.riskScore>.8)?"now":"next",payload:n,createdAt:Date.now(),source:"coverage-delta",ttlMs:600*1e3};this.queue.enqueue(i)}};import{execFile as K}from"child_process";import{promisify as Y}from"util";var X=Y(K),Z={runsPerWorkflow:10,flakyThreshold:3,repo:""},w=class{constructor(e,t){this.queue=e;this.options={...Z,...t}}options;async check(){let e=await this.fetchRecentRuns(),t=this.groupByWorkflow(e),o=[],n=[],i=0;for(let[a,c]of Object.entries(t)){let d=c.filter(p=>p.conclusion==="failure").length,h=c.length>0?(c.length-d)/c.length*100:100,g=this.countConsecutiveFailures(c),m=c[0]?.conclusion??"unknown";m==="failure"&&i++,g>=this.options.flakyThreshold&&(n.push(a),this.enqueueFailureAlert(a,c[0])),o.push({name:a,recentRuns:c.length,failedRuns:d,successRate:Math.round(h*10)/10,lastConclusion:m,consecutiveFailures:g})}let r=this.calculateHealthScore(o);return{timestamp:Date.now(),workflows:o,failingWorkflows:i,flakyWorkflows:n,healthScore:r}}async fetchRecentRuns(){try{let e=["run","list","--limit",String(this.options.runsPerWorkflow*5),"--json","name,status,conclusion,headBranch,number,databaseId,createdAt"];this.options.repo&&e.push("--repo",this.options.repo);let{stdout:t}=await X("gh",e,{timeout:15e3});return JSON.parse(t).map(n=>({name:n.name,status:n.status,conclusion:n.conclusion??"pending",headBranch:n.headBranch,runNumber:n.number,databaseId:n.databaseId,createdAt:n.createdAt}))}catch{return[]}}groupByWorkflow(e){let t={};for(let o of e)t[o.name]||(t[o.name]=[]),t[o.name].push(o);for(let o of Object.keys(t))t[o]=t[o].slice(0,this.options.runsPerWorkflow);return t}countConsecutiveFailures(e){let t=0;for(let o of e)if(o.conclusion==="failure")t++;else break;return t}calculateHealthScore(e){if(e.length===0)return 100;let t=e.reduce((o,n)=>o+n.successRate,0)/e.length;return Math.round(t)}enqueueFailureAlert(e,t){let o={type:"ci_failure",workflowName:e,runId:t.databaseId,conclusion:t.conclusion},n={id:`ci-failure-${e}-${Date.now()}`,priority:"now",payload:o,createdAt:Date.now(),source:"ci-monitor",ttlMs:1800*1e3};this.queue.enqueue(n)}};var ee={memoryPrefix:"quality-daemon:suggestions",maxSuggestions:100,minRiskScore:.3},b=class{options;constructor(e){this.options={...ee,...e}}async suggest(e,t,o){let n=[],i=e.filter(a=>a.riskScore>=this.options.minRiskScore);for(let a of i){let c=t.includes(a.file),d=this.determinePriority(a,c),h=this.determineTestType(a.file),g=this.estimateEffort(a);n.push({id:`suggestion-${Date.now()}-${n.length}`,file:a.file,uncoveredLines:a.uncoveredLines.slice(0,50),suggestedTestType:h,description:this.generateDescription(a,h),priority:d,estimatedEffort:g,createdAt:Date.now(),status:"pending"})}n.sort((a,c)=>{let d={high:0,medium:1,low:2};return d[a.priority]-d[c.priority]});let r=n.slice(0,this.options.maxSuggestions);return await this.storeSuggestions(r,o),r}async getPending(e){return(await e.get(`${this.options.memoryPrefix}:list`)??[]).filter(o=>o.status==="pending")}async updateStatus(e,t,o){let n=await o.get(`${this.options.memoryPrefix}:list`);if(!n)return!1;let i=n.findIndex(a=>a.id===e);if(i===-1)return!1;let r=n.map((a,c)=>c===i?{...a,status:t}:a);return await o.set(`${this.options.memoryPrefix}:list`,r),!0}determinePriority(e,t){return e.riskScore>.8?"high":t||e.riskScore>.5?"medium":"low"}determineTestType(e){return e.includes("/api/")||e.includes("/routes/")||e.includes("/handlers/")?"integration":e.includes("/e2e/")||e.includes("/pages/")||e.includes("/views/")?"e2e":"unit"}estimateEffort(e){return e.uncoveredLines.length<=10?"small":e.uncoveredLines.length<=50?"medium":"large"}generateDescription(e,t){let o=e.uncoveredLines.length,n=Math.round(e.currentCoverage);return`Add ${t} tests for ${e.file} (${o} uncovered lines, ${n}% coverage, risk ${(e.riskScore*100).toFixed(0)}%)`}async storeSuggestions(e,t){let i=[...(await t.get(`${this.options.memoryPrefix}:list`)??[]).filter(r=>r.status!=="pending"),...e].slice(-this.options.maxSuggestions);await t.set(`${this.options.memoryPrefix}:list`,i),await t.set(`${this.options.memoryPrefix}:count`,{pending:e.length,total:i.length,lastUpdated:Date.now()})}};var te={memoryPrefix:"quality-daemon:nightly",maxEntryAge:6048e5,nightlyHour:2},k=class{constructor(e,t){this.queue=e;this.options={...te,...t}}options;lastRunDate;shouldRun(){let e=new Date,t=e.toISOString().split("T")[0];return this.lastRunDate===t?!1:e.getHours()>=this.options.nightlyHour}scheduleIfDue(){if(!this.shouldRun())return!1;let e={type:"nightly",tasks:["consolidate_patterns","prune_expired","generate_report"]},t={id:`nightly-${Date.now()}`,priority:"later",payload:e,createdAt:Date.now(),source:"nightly-consolidation",ttlMs:720*60*1e3};return this.queue.enqueue(t)}async execute(e,t){let o=Date.now(),n=new Date().toISOString().split("T")[0],i=await this.consolidatePatterns(e),r=await this.pruneExpired(e),a=this.generateReport(n,t);await e.set(`${this.options.memoryPrefix}:report:${n}`,a),this.lastRunDate=n;let c={timestamp:Date.now(),patternsConsolidated:i,entriesPruned:r,reportGenerated:!0,durationMs:Date.now()-o};return await e.set(`${this.options.memoryPrefix}:last-result`,c),c}async getLastResult(e){return e.get(`${this.options.memoryPrefix}:last-result`)}async consolidatePatterns(e){let t=await e.search("quality-daemon:*"),o=0;return await e.get("quality-daemon:suggestions:count")&&o++,await e.get("quality-daemon:coverage:delta")&&o++,o}async pruneExpired(e){let t=await e.search("quality-daemon:*"),o=0,n=Date.now();for(let i of t){if(i.endsWith(":snapshot")||i.endsWith(":list"))continue;let r=await e.get(i);r&&typeof r.timestamp=="number"&&n-r.timestamp>this.options.maxEntryAge&&(await e.set(i,{pruned:!0,prunedAt:n}),o++)}return o}generateReport(e,t){return{date:e,coverageHealth:t.coverageHealth??0,ciHealth:t.ciHealth??0,commitsAnalyzed:t.commitsAnalyzed??0,suggestionsGenerated:t.suggestionsGenerated??0,notificationsSent:t.notificationsSent??0,queueDepthAvg:t.queueDepthAvg??0,daemonUptime:t.uptimeSeconds??0}}};import{writeFileSync as A,mkdirSync as Q,readdirSync as P,readFileSync as F,unlinkSync as G}from"fs";import{join as C,resolve as oe}from"path";var O={notificationsDir:oe(process.cwd(),".agentic-qe","notifications"),maxNotifications:200},S=class{notificationsDir;maxNotifications;webhookUrl;urlValidator;_sentCount=0;constructor(e){this.notificationsDir=e?.notificationsDir??O.notificationsDir,this.maxNotifications=e?.maxNotifications??O.maxNotifications,this.webhookUrl=e?.webhookUrl,this.urlValidator=e?.urlValidator}get sentCount(){return this._sentCount}initialize(){Q(this.notificationsDir,{recursive:!0})}async send(e){let t={...e,id:`notif-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1};return this.writeToFile(t),this.webhookUrl&&await this.sendWebhook(t),this._sentCount++,this.pruneOldNotifications(),t}list(e){let t=e?.limit??50;try{let o=P(this.notificationsDir).filter(i=>i.endsWith(".json")).sort().reverse(),n=[];for(let i of o){if(n.length>=t)break;try{let r=F(C(this.notificationsDir,i),"utf-8"),a=JSON.parse(r);if(e?.unreadOnly&&a.read||e?.type&&a.type!==e.type)continue;n.push(a)}catch{}}return n}catch{return[]}}markRead(e){try{let t=P(this.notificationsDir).filter(r=>r.endsWith(`-${e}.json`));if(t.length===0)return!1;let o=C(this.notificationsDir,t[0]),i={...JSON.parse(F(o,"utf-8")),read:!0};return A(o,JSON.stringify(i,null,2)),!0}catch{return!1}}clear(){try{let e=P(this.notificationsDir).filter(t=>t.endsWith(".json"));for(let t of e)G(C(this.notificationsDir,t));return e.length}catch{return 0}}writeToFile(e){try{Q(this.notificationsDir,{recursive:!0});let t=`${e.timestamp}-${e.id}.json`,o=C(this.notificationsDir,t);A(o,JSON.stringify(e,null,2))}catch(t){console.debug("[NotificationService] Failed to write notification:",t)}}async sendWebhook(e){if(this.webhookUrl){if(this.urlValidator&&!this.urlValidator(this.webhookUrl)){console.warn("[NotificationService] Webhook URL blocked by SSRF guard:",this.webhookUrl);return}try{let t=await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)});t.ok||console.debug(`[NotificationService] Webhook returned ${t.status}`)}catch(t){console.debug("[NotificationService] Webhook delivery failed:",t)}}}pruneOldNotifications(){try{let e=P(this.notificationsDir).filter(o=>o.endsWith(".json")).sort();if(e.length<=this.maxNotifications)return;let t=e.slice(0,e.length-this.maxNotifications);for(let o of t)G(C(this.notificationsDir,o))}catch{}}};var q="quality-daemon",D=class{constructor(e){this.backend=e}async get(e){return this.backend.kvGet(e,q)}async set(e,t){await this.backend.kvSet(e,t,q)}async search(e){return this.backend.kvSearch(e,q)}};var T={tickIntervalMs:3e4,ciPollIntervalMs:5*6e4,coverageCheckIntervalMs:2*6e4,cpuThreshold:.7,memoryThreshold:.8},x=class{queue;gitWatcher;coverageDelta;ciMonitor;testSuggester;nightlyConsolidation;notificationService;tickTimer;_running=!1;_startedAt=0;_tickCount=0;_lastTickAt;_throttled=!1;_commitsAnalyzed=0;_suggestionsGenerated=0;_ciHealth=100;_coverageHealth=100;_lastCICheck;_lastCoverageCheck;_memory;config;constructor(e){this.config={tickIntervalMs:e?.tickIntervalMs??T.tickIntervalMs,ciPollIntervalMs:e?.ciPollIntervalMs??T.ciPollIntervalMs,coverageCheckIntervalMs:e?.coverageCheckIntervalMs??T.coverageCheckIntervalMs,cpuThreshold:e?.cpuThreshold??T.cpuThreshold,memoryThreshold:e?.memoryThreshold??T.memoryThreshold},this.queue=new f,this.gitWatcher=new y(this.queue,e?.git),this.coverageDelta=new v(this.queue,e?.coverage),this.ciMonitor=new w(this.queue,e?.ci),this.testSuggester=new b(e?.suggestions),this.nightlyConsolidation=new k(this.queue,e?.nightly),this.notificationService=new S(e?.notifications)}get running(){return this._running}async start(e){this._running||(this._memory=e,this._running=!0,this._startedAt=Date.now(),this.notificationService.initialize(),await this.gitWatcher.start().catch(t=>{console.debug("[QualityDaemon] Git watcher failed to start:",t)}),this.scheduleTick())}async stop(){this._running&&(this._running=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=void 0),this.gitWatcher.stop(),this._memory&&await this._memory.set("quality-daemon:state",{stoppedAt:Date.now(),tickCount:this._tickCount,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated}))}getStatus(){return{running:this._running,uptimeSeconds:this._running?Math.floor((Date.now()-this._startedAt)/1e3):0,tickCount:this._tickCount,queueDepth:this.queue.depths,lastTickAt:this._lastTickAt,throttled:this._throttled,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,ciHealth:this._ciHealth,coverageHealth:this._coverageHealth,lastCICheck:this._lastCICheck,lastCoverageCheck:this._lastCoverageCheck}}scheduleTick(){this._running&&(this.tickTimer=setTimeout(()=>this.tick(),this.config.tickIntervalMs))}async tick(){if(!(!this._running||!this._memory)){if(this._tickCount++,this._lastTickAt=Date.now(),this._throttled=this.isResourceConstrained(),this._throttled){await this.processNowItems(this._memory),this.scheduleTick();return}await this.processQueue(this._memory),await this.runPeriodicChecks(this._memory),this.nightlyConsolidation.scheduleIfDue(),this.queue.pruneExpired(),this.scheduleTick()}}async processQueue(e){let t=0,o=10;for(;t<o&&!this.queue.isEmpty;){let n=this.queue.dequeue();if(!n)break;await this.handleQueueItem(n,e),t++}}async processNowItems(e){let t=this.queue.drainPriority("now");for(let o of t)await this.handleQueueItem(o,e)}async handleQueueItem(e,t){let o=e.payload;switch(o.type){case"git_commit":this._commitsAnalyzed++;let n=await this.coverageDelta.buildSnapshot(t);if(n){let i=await this.coverageDelta.analyze(n,t,o.changedFiles);if(i.regressionDetected&&await this.notificationService.send({type:"coverage_drop",title:"Coverage Regression Detected",message:`Line coverage delta: ${i.overallDelta.line.toFixed(1)}% (${i.affectedFiles.length} files affected)`,severity:"high",metadata:{delta:i.overallDelta,commit:o.commitHash}}),i.newGaps.length>0){let r=await this.testSuggester.suggest(i.newGaps,o.changedFiles,t);this._suggestionsGenerated+=r.length,r.length>0&&await this.notificationService.send({type:"suggestion_available",title:"New Test Suggestions Available",message:`${r.length} test suggestions generated for uncovered code`,severity:"info",metadata:{count:r.length}})}}break;case"coverage_delta":{let i=await this.testSuggester.getPending(t);i.length>0&&await this.notificationService.send({type:"suggestion_available",title:"Test Suggestions Pending",message:`${i.length} test suggestions awaiting review`,severity:"info",metadata:{count:i.length}});break}case"gate_failure":await this.notificationService.send({type:"gate_failure",title:`Quality Gate Failed: ${o.gateName}`,message:`Score ${o.score} below threshold ${o.threshold}`,severity:"critical",metadata:{gate:o.gateName,score:o.score,threshold:o.threshold}});break;case"ci_failure":await this.notificationService.send({type:"ci_failure",title:`CI Failure: ${o.workflowName}`,message:`Workflow ${o.workflowName} run #${o.runId} concluded: ${o.conclusion}`,severity:"high",metadata:{workflow:o.workflowName,runId:o.runId}});break;case"nightly":{let i={coverageHealth:this._coverageHealth,ciHealth:this._ciHealth,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,queueDepthAvg:this.queue.size,uptimeSeconds:Math.floor((Date.now()-this._startedAt)/1e3)};await this.nightlyConsolidation.execute(t,i);break}default:console.warn("[QualityDaemon] Unhandled payload type:",o.type)}}async runPeriodicChecks(e){let t=Date.now();if(!this._lastCICheck||t-this._lastCICheck>=this.config.ciPollIntervalMs)try{let o=await this.ciMonitor.check();this._ciHealth=o.healthScore,this._lastCICheck=t,o.flakyWorkflows.length>0&&await this.notificationService.send({type:"flaky_detected",title:"Flaky Workflows Detected",message:`${o.flakyWorkflows.length} workflows showing repeated failures: ${o.flakyWorkflows.join(", ")}`,severity:"medium",metadata:{workflows:o.flakyWorkflows}})}catch{}if(!this._lastCoverageCheck||t-this._lastCoverageCheck>=this.config.coverageCheckIntervalMs)try{let o=await this.coverageDelta.buildSnapshot(e);o&&(this._coverageHealth=Math.round((o.overall.line+o.overall.branch+o.overall.function+o.overall.statement)/4),this._lastCoverageCheck=t)}catch{}}isResourceConstrained(){if(1-ie()/re()>this.config.memoryThreshold)return!0;let t=ne().length;return(t>0?se()[0]/t:0)>this.config.cpuThreshold}};var u;function Ke(){let l=new ae("daemon").description("Manage the QE Quality Daemon").addHelpText("after",`
6
+ Examples:
7
+ aqe daemon start Start daemon in foreground
8
+ aqe daemon stop Stop running daemon
9
+ aqe daemon status Show daemon health and queue depth
10
+ aqe daemon notifications List recent notifications
11
+ aqe daemon clear-notifications Clear all notifications
12
+ `);return l.command("start").description("Start the QE Quality Daemon").option("--tick-interval <ms>","Tick interval in milliseconds","30000").option("--ci-interval <ms>","CI poll interval in milliseconds","300000").action(async e=>{if(u?.running){console.log(s.yellow("Daemon is already running"));let r=u.getStatus();console.log(s.gray(` Uptime: ${r.uptimeSeconds}s, Ticks: ${r.tickCount}`));return}let t={tickIntervalMs:parseInt(e.tickInterval,10),ciPollIntervalMs:parseInt(e.ciInterval,10),notifications:{urlValidator:r=>{try{let c=new URL(r).hostname.replace(/^\[|\]$/g,"");return!N(c)}catch{return!1}}}};u=new x(t);let o;try{let{UnifiedMemoryManager:r}=await import("./unified-memory-XYGENQUT.js"),a=await r.getInstanceAsync();o=new D(a),console.log(s.gray(" Storage: SQLite (persistent)"))}catch{let r=new Map;o={async get(a){return r.get(a)},async set(a,c){r.set(a,c)},async search(a){let c=a.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(c.replace(/\*/g,".*"));return Array.from(r.keys()).filter(h=>d.test(h))}},console.log(s.yellow(" Storage: in-memory (no SQLite available, state will not persist)"))}console.log(s.green("Starting QE Quality Daemon...")),await u.start(o),console.log(s.green("QE Quality Daemon started")),console.log(s.gray(` Tick interval: ${t.tickIntervalMs}ms`)),console.log(s.gray(` CI poll interval: ${t.ciPollIntervalMs}ms`)),console.log(s.gray(` PID: ${process.pid}`)),console.log(s.gray(`
13
+ Press Ctrl+C to stop`));let n=setInterval(()=>{u?.running||clearInterval(n)},5e3),i=async()=>{console.log(s.yellow(`
14
+ Stopping QE Quality Daemon...`)),await u?.stop(),clearInterval(n),console.log(s.green("Daemon stopped")),process.exit(0)};process.once("SIGINT",i),process.once("SIGTERM",i)}),l.command("stop").description("Stop the QE Quality Daemon").action(async()=>{if(!u?.running){console.log(s.yellow("No running daemon found"));return}await u.stop(),console.log(s.green("Daemon stopped")),u=void 0}),l.command("status").description("Show daemon health and queue status").action(()=>{if(!u){console.log(s.yellow("No daemon instance (start with: aqe daemon start)"));return}let e=u.getStatus();console.log(s.bold(`
15
+ QE Quality Daemon Status`)),console.log(s.gray("\u2500".repeat(40))),console.log(` Running: ${e.running?s.green("yes"):s.red("no")}`),console.log(` Uptime: ${le(e.uptimeSeconds)}`),console.log(` Ticks: ${e.tickCount}`),console.log(` Throttled: ${e.throttled?s.yellow("yes"):s.green("no")}`),console.log(s.bold(`
16
+ Queue Depth`)),console.log(` Now: ${e.queueDepth.now}`),console.log(` Next: ${e.queueDepth.next}`),console.log(` Later: ${e.queueDepth.later}`),console.log(s.bold(`
17
+ Health`)),console.log(` CI: ${H(e.ciHealth)}${e.ciHealth}%${s.reset("")}`),console.log(` Coverage: ${H(e.coverageHealth)}${e.coverageHealth}%${s.reset("")}`),console.log(s.bold(`
18
+ Activity`)),console.log(` Commits: ${e.commitsAnalyzed}`),console.log(` Suggestions: ${e.suggestionsGenerated}`),console.log(` Notifications: ${e.notificationsSent}`),console.log()}),l.command("notifications").description("List recent notifications").option("--unread","Show only unread notifications").option("--limit <n>","Maximum notifications to show","20").option("--type <type>","Filter by type (gate_failure, coverage_drop, flaky_detected, etc.)").action(e=>{if(!u){console.log(s.yellow("No daemon instance"));return}let t=u.notificationService.list({unreadOnly:e.unread,limit:parseInt(e.limit,10),type:e.type});if(t.length===0){console.log(s.gray("No notifications"));return}console.log(s.bold(`
19
+ Notifications (${t.length})`)),console.log(s.gray("\u2500".repeat(60)));for(let o of t){let n=ce(o.severity),i=new Date(o.timestamp).toLocaleString(),r=o.read?s.gray("\u2713"):s.yellow("\u25CF");console.log(`${r} ${n} ${s.bold(o.title)}`),console.log(` ${o.message}`),console.log(s.gray(` ${i} [${o.type}]`)),console.log()}}),l.command("clear-notifications").description("Clear all notifications").action(()=>{if(!u){console.log(s.yellow("No daemon instance"));return}let e=u.notificationService.clear();console.log(s.green(`Cleared ${e} notifications`))}),l}function le(l){if(l<60)return`${l}s`;if(l<3600)return`${Math.floor(l/60)}m ${l%60}s`;let e=Math.floor(l/3600),t=Math.floor(l%3600/60);return`${e}h ${t}m`}function H(l){return l>=80?s.green(""):l>=60?s.yellow(""):s.red("")}function ce(l){switch(l){case"critical":return s.red("!!");case"high":return s.red("!");case"medium":return s.yellow("~");case"low":return s.blue("-");case"info":return s.gray("i");default:return" "}}export{Ke as createDaemonCommand};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b}from"./chunk-CS2KS7LP.js";import"./chunk-4I2IOUS4.js";export{a as DAGAttentionScheduler,b as createDAGAttentionScheduler};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d}from"./chunk-XO6PVK2P.js";import"./chunk-WGMPEW2T.js";import"./chunk-4I2IOUS4.js";export{a as clearDetectionCache,b as detectClaudeFlow,d as getClaudeFlowNotFoundMessage,c as resolveCliPackage};
@@ -0,0 +1,25 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as i}from"./chunk-YANUP2RO.js";import{a as r}from"./chunk-3ZOONQG6.js";import"./chunk-4I2IOUS4.js";import n from"chalk";var s=class{name="domain";description="Domain operations";cleanupAndExit;ensureInitialized;constructor(o,t){this.cleanupAndExit=o,this.ensureInitialized=t}register(o,t){let e=o.command("domain").description(this.description);e.command("list").description("List all domains").action(async()=>{await this.executeList(t)}),e.command("health <domain>").description("Get domain health").action(async a=>{await this.executeHealth(a,t)})}async executeList(o){if(await this.ensureInitialized())try{console.log(n.blue(`
3
+ Domains
4
+ `));for(let t of r){let e=o.queen.getDomainHealth(t),a=o.queen.getDomainLoad(t);console.log(` ${n.cyan(t)}`),console.log(` Status: ${i(e?.status||"unknown")}`),console.log(` Load: ${a} tasks`),e&&console.log(` Agents: ${e.agents.active}/${e.agents.total}`),console.log("")}}catch(t){console.error(n.red(`
5
+ Failed to list domains:`),t),await this.cleanupAndExit(1)}}async executeHealth(o,t){if(await this.ensureInitialized())try{let e=t.queen.getDomainHealth(o);if(!e){console.log(n.red(`
6
+ Domain not found: ${o}
7
+ `));return}console.log(n.blue(`
8
+ ${o} Health
9
+ `)),console.log(` Status: ${i(e.status)}`),console.log(` Agents Total: ${e.agents.total}`),console.log(` Agents Active: ${n.green(e.agents.active)}`),console.log(` Agents Idle: ${n.yellow(e.agents.idle)}`),console.log(` Agents Failed: ${n.red(e.agents.failed)}`),e.lastActivity&&console.log(` Last Activity: ${e.lastActivity.toISOString()}`),e.errors.length>0&&(console.log(n.red(`
10
+ Errors:`)),e.errors.forEach(a=>console.log(n.red(` - ${a}`)))),console.log("")}catch(e){console.error(n.red(`
11
+ Failed to get domain health:`),e),await this.cleanupAndExit(1)}}getHelp(){return`
12
+ Manage domain operations including listing and health checks.
13
+
14
+ Usage:
15
+ aqe domain <command> [options]
16
+
17
+ Commands:
18
+ list List all domains with status
19
+ health <domain> Get detailed domain health
20
+
21
+ Examples:
22
+ aqe domain list
23
+ aqe domain health test-generation
24
+ aqe domain health coverage-analysis
25
+ `}};function p(l,o){return new s(l,o)}export{s as DomainHandler,p as createDomainHandler};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,c as b,d as c,e as d,f as e,g as f,h as g,i as h}from"./chunk-ESVQ6MEB.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{f as CuriosityBonus,b as DEFAULT_DOMAIN_TRANSFER_CONFIG,c as DecayingBeta,g as DomainTransferEngine,e as ParetoFront,d as PlateauDetector,a as ThompsonSampler,h as createDomainTransferEngine};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u}from"./chunk-3THRQEZ2.js";import"./chunk-GRUUQAR6.js";import"./chunk-SUSEVMZT.js";import"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{t as BUILT_IN_STRATEGIES,b as ConceptGraph,g as DEFAULT_ACTIVATION_CONFIG,a as DEFAULT_CONCEPT_GRAPH_CONFIG,m as DEFAULT_DREAM_CONFIG,q as DEFAULT_DREAM_SCHEDULER_CONFIG,i as DEFAULT_INSIGHT_CONFIG,k as DEFAULT_VALIDATION_THRESHOLDS,n as DreamEngine,r as DreamScheduler,f as HISTORY_TRIM_TARGET_RATIO,j as InsightGenerator,d as MAX_ACTIVATION_HISTORY_ENTRIES,e as MAX_COACTIVATION_ENTRIES,l as RVCOWBranchManager,u as SpeculativeDreamer,h as SpreadingActivation,c as createConceptGraph,o as createDreamEngine,s as createDreamScheduler,p as default};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-SUSEVMZT.js";import"./chunk-4I2IOUS4.js";export{h as NIL,d as parse,b as stringify,c as v1,e as v3,f as v4,g as v5,a as validate,i as version};
@@ -0,0 +1,15 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as S}from"./chunk-IFNIIK34.js";import"./chunk-YPFOCNOE.js";import"./chunk-VSVXUTJN.js";import{a as w,b as g}from"./chunk-Y7BHKZFJ.js";import{a as y}from"./chunk-TWUWL5EJ.js";import"./chunk-3NZLZHJI.js";import"./chunk-AFLLQ5PP.js";import"./chunk-TLHP5EII.js";import"./chunk-4YS3IJ45.js";import"./chunk-YW2THB5Q.js";import"./chunk-5T2ZQWKF.js";import"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";import{Command as E}from"commander";import s from"chalk";import*as d from"fs";import*as p from"path";var f=["accessibility-testing","security-testing","performance-testing","chaos-engineering-resilience","contract-testing"],b=["risk-based-testing","test-design-techniques","regression-testing","test-data-management","localization-testing"],T=["quality-metrics","refactoring-patterns","iterative-loop","stream-chain"];function x(t){switch(t){case 3:return f;case 2:return[...f,...b];case 1:return[...f,...b,...T];default:return f}}var h="";function F(t){let e=Math.round(t.completedTasks/t.totalTasks*100),o=k(t.elapsedMs),l=k(t.estimatedRemainingMs),a=O(e,30),i=`${s.cyan("Progress:")} ${a} ${e}% | ${s.green(t.completedTasks)}/${t.totalTasks} tasks | ${s.yellow(t.failedTasks)} failed | ${s.blue(t.activeWorkers)} workers | ${o} elapsed, ~${l} remaining`;h&&process.stdout.write("\r"+" ".repeat(h.length)+"\r"),process.stdout.write(i),h=i}function O(t,e){let o=Math.round(t/100*e),l=e-o;return s.green("=".repeat(o))+s.gray("-".repeat(l))}function k(t){if(t<1e3)return`${t}ms`;if(t<6e4)return`${(t/1e3).toFixed(1)}s`;let e=Math.floor(t/6e4),o=Math.round(t%6e4/1e3);return`${e}m ${o}s`}function L(t){let e=[];e.push(""),e.push(s.bold(`Eval Results: ${t.skill}`)+s.dim(` (${t.model})`)),e.push("=".repeat(60));let o=t.passed?s.green("PASSED"):s.red("FAILED");e.push(`Status: ${o}`),e.push(""),e.push(s.bold("Metrics:")),e.push(` Total Tests: ${t.totalTests}`),e.push(` Passed: ${s.green(t.passedTests)}`),e.push(` Failed: ${s.red(t.failedTests)}`),e.push(` Skipped: ${s.yellow(t.skippedTests)}`),e.push(` Pass Rate: ${(t.passRate*100).toFixed(1)}%`),e.push(` Reasoning Avg: ${(t.avgReasoningQuality*100).toFixed(1)}%`),e.push(""),e.push(s.bold("Performance:")),e.push(` Duration: ${k(t.totalDurationMs)}`),e.push(` Workers Used: ${t.workersUsed}`),e.push(` Parallel Speedup: ${s.cyan(t.parallelSpeedup.toFixed(2)+"x")}`),e.push("");let l=t.testResults.filter(a=>!a.passed);if(l.length>0){e.push(s.bold.red("Failed Tests:"));for(let a of l.slice(0,5))e.push(` ${s.red("x")} ${a.testId}`),a.error&&e.push(` ${s.dim(a.error)}`);l.length>5&&e.push(` ... and ${l.length-5} more`),e.push("")}return e.join(`
3
+ `)}function M(t){let e=[];e.push("# Skill Evaluation Report"),e.push(""),e.push(`Generated: ${new Date().toISOString()}`),e.push(""),e.push("## Summary"),e.push(""),e.push("| Skill | Model | Pass Rate | Duration | Speedup | Status |"),e.push("|-------|-------|-----------|----------|---------|--------|");for(let o of t){let l=o.passed?"PASSED":"FAILED";e.push(`| ${o.skill} | ${o.model} | ${(o.passRate*100).toFixed(1)}% | ${k(o.totalDurationMs)} | ${o.parallelSpeedup.toFixed(2)}x | ${l} |`)}e.push(""),e.push("## Detailed Results"),e.push("");for(let o of t){e.push(`### ${o.skill} (${o.model})`),e.push(""),e.push(`- **Total Tests:** ${o.totalTests}`),e.push(`- **Passed:** ${o.passedTests}`),e.push(`- **Failed:** ${o.failedTests}`),e.push(`- **Pass Rate:** ${(o.passRate*100).toFixed(1)}%`),e.push(`- **Avg Reasoning Quality:** ${(o.avgReasoningQuality*100).toFixed(1)}%`),e.push("");let l=o.testResults.filter(a=>!a.passed);if(l.length>0){e.push("**Failed Tests:**"),e.push("");for(let a of l)e.push(`- \`${a.testId}\`: ${a.error||"No error message"}`);e.push("")}}return e.join(`
4
+ `)}async function $(){let t=await S({sqlite:{dbPath:".agentic-qe/eval-runner.db"},hnsw:{M:16,efConstruction:100,efSearch:50}});await t.initialize();let e=y(t);return{runner:g(e),learner:e,reasoningBank:t}}async function C(t){console.log(s.bold(`
5
+ AQE Parallel Eval Runner`)),console.log(s.dim(`ADR-056 Phase 5: Worker Pool Pattern
6
+ `));let{runner:e,reasoningBank:o}=await $();try{let l={...w,maxWorkers:t.parallel?t.workers:1,batchSize:t.batchSize,timeout:t.timeout,retryFailedTests:t.retry},a=g(y(o),l);t.verbose&&a.onProgress(F),console.log(s.cyan(`Running eval suite: ${t.skill}`)),console.log(s.cyan(`Model: ${t.model}`)),console.log(s.cyan(`Mode: ${t.parallel?`Parallel (${t.workers} workers)`:"Sequential"}`)),console.log("");let i=await a.runEvalParallel(t.skill,t.model);if(h&&console.log(""),console.log(L(i)),t.output){let r=p.resolve(t.output);d.writeFileSync(r,JSON.stringify(i,null,2)),console.log(s.green(`Results saved to: ${r}`))}process.exit(i.passed?0:1)}finally{await o.dispose()}}async function A(t){console.log(s.bold(`
7
+ AQE Parallel Eval Runner - Multi-Skill`)),console.log(s.dim(`ADR-056 Phase 5: Worker Pool Pattern
8
+ `));let{runner:e,learner:o,reasoningBank:l}=await $();try{let a=x(t.skillsTier),i=t.models.split(",").map(u=>u.trim());console.log(s.cyan(`Running evals for ${a.length} skills`)),console.log(s.cyan(`Models: ${i.join(", ")}`)),console.log(s.cyan(`Mode: ${t.parallel?`Parallel (${t.workers} workers)`:"Sequential"}`)),console.log("");let r={...w,maxWorkers:t.parallel?t.workers:1},m=await g(o,r).runMultipleEvalsParallel(a,i),c=[];for(let u of m.values())c.push(...u);console.log(s.bold(`
9
+ Eval Summary`)),console.log("=".repeat(60));let R=0,v=0;for(let u of c){let P=u.passed?s.green("v"):s.red("x");console.log(`${P} ${u.skill} (${u.model}): ${(u.passRate*100).toFixed(1)}% (${u.parallelSpeedup.toFixed(2)}x speedup)`),u.passed?R++:v++}if(console.log(""),console.log(`Total: ${s.green(R)} passed, ${s.red(v)} failed`),t.output){let u=p.resolve(t.output);(u.endsWith(".md")?"markdown":"json")==="markdown"?d.writeFileSync(u,M(c)):d.writeFileSync(u,JSON.stringify(c,null,2)),console.log(s.green(`
10
+ Report saved to: ${u}`))}process.exit(v===0?0:1)}finally{await l.dispose()}}async function D(t){let{learner:e,reasoningBank:o}=await $();try{let l=await e.getSkillConfidence(t);if(!l){console.log(s.yellow(`No validation history found for skill: ${t}`));return}if(console.log(s.bold(`
11
+ Skill Validation Status: ${t}`)),console.log("=".repeat(50)),console.log(`Average Score: ${(l.avgScore*100).toFixed(1)}%`),console.log(`Trend: ${l.trend}`),console.log(`Validation Count: ${l.outcomes.length}`),console.log(`Last Updated: ${l.lastUpdated}`),l.byLevel){console.log(`
12
+ By Validation Level:`);for(let[i,r]of Object.entries(l.byLevel))r!==void 0&&console.log(` ${i}: ${(r*100).toFixed(1)}%`)}let a=await e.getCrossModelAnalysis(t);if(a&&(console.log(`
13
+ Cross-Model Analysis:`),console.log(` Variance: ${(a.variance*100).toFixed(2)}%`),console.log(` Has Anomalies: ${a.hasAnomalies}`),a.models)){console.log(`
14
+ Model Performance:`);for(let[i,r]of Object.entries(a.models))console.log(` ${i}: ${(r.passRate*100).toFixed(1)}% pass rate (${r.sampleCount} samples)`)}}finally{await o.dispose()}}async function I(t){let{learner:e,reasoningBank:o}=await $();try{let l=await e.queryValidationPatterns(t.skill,50);if(l.length===0){console.log(s.yellow(`No validation patterns found for skill: ${t.skill}`));return}let a=await e.extractLearnedPatterns(t.skill),i=await e.getValidationTrends(t.skill),r={skill:t.skill,generated:new Date().toISOString(),patternCount:l.length,learnedPatterns:a,trends:i};if(t.format==="json"){let n=JSON.stringify(r,null,2);t.output?(d.writeFileSync(p.resolve(t.output),n),console.log(s.green(`Report saved to: ${t.output}`))):console.log(n)}else{let n=[];if(n.push(`# Validation Report: ${t.skill}`),n.push(""),n.push(`Generated: ${r.generated}`),n.push(""),n.push("## Overview"),n.push(`- Patterns Collected: ${r.patternCount}`),n.push(`- Learned Patterns: ${r.learnedPatterns.length}`),n.push(""),r.trends&&(n.push("## Trends"),n.push(`- Overall: ${r.trends.overall}`),n.push(`- Recent Pass Rate: ${(r.trends.recentPassRate*100).toFixed(1)}%`),n.push("")),r.learnedPatterns.length>0){n.push("## Learned Patterns"),n.push("");for(let c of r.learnedPatterns)n.push(`### ${c.category}`),n.push(`- Confidence: ${(c.confidence*100).toFixed(1)}%`),n.push(`- Observations: ${c.observationCount}`),n.push(`- Models: ${c.models.join(", ")}`),n.push("")}let m=n.join(`
15
+ `);t.output?(d.writeFileSync(p.resolve(t.output),m),console.log(s.green(`Report saved to: ${t.output}`))):console.log(m)}}finally{await o.dispose()}}function G(){let t=new E("eval").description("Run skill evaluation suites in parallel");return t.command("run").description("Run eval suite for a single skill").requiredOption("-s, --skill <skill>","Skill name to evaluate").requiredOption("-m, --model <model>","Model to use (e.g., claude-3.5-sonnet)").option("-p, --parallel","Enable parallel execution",!1).option("-w, --workers <n>","Number of parallel workers",parseInt,5).option("-b, --batch-size <n>","Test cases per batch",parseInt,4).option("-t, --timeout <ms>","Timeout per test case (ms)",parseInt,3e4).option("--no-retry","Disable retry of failed tests").option("-o, --output <path>","Output file path for results").option("-v, --verbose","Show progress during execution",!1).action(async e=>{await C({skill:e.skill,model:e.model,parallel:e.parallel,workers:e.workers,batchSize:e.batchSize,timeout:e.timeout,retry:e.retry!==!1,output:e.output,verbose:e.verbose})}),t.command("run-all").description("Run eval suites for multiple skills").option("--skills-tier <tier>","Skill tier (1=all, 2=P0+P1, 3=P0 only)",parseInt,3).option("--models <models>","Comma-separated models to test","claude-3.5-sonnet").option("-p, --parallel","Enable parallel execution",!0).option("-w, --workers <n>","Number of parallel workers",parseInt,5).option("-o, --output <path>","Output file path for report").option("-v, --verbose","Show progress during execution",!1).action(async e=>{await A({skillsTier:e.skillsTier,models:e.models,parallel:e.parallel,workers:e.workers,output:e.output,verbose:e.verbose})}),t.command("status").description("Show validation status for a skill").requiredOption("-s, --skill <skill>","Skill name").action(async e=>{await D(e.skill)}),t.command("report").description("Generate validation report for a skill").requiredOption("-s, --skill <skill>","Skill name").option("-f, --format <format>","Output format (json|markdown)","markdown").option("-o, --output <path>","Output file path").action(async e=>{await I({skill:e.skill,format:e.format,output:e.output})}),t}export{G as createEvalCommand};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import"./chunk-4I2IOUS4.js";function n(e){return e.includes("--version")||e.includes("-v")?"cli-version":e[2]==="health"?"cli-health":process.env.AQE_MCP==="1"||process.env.AQE_MCP_MODE==="1"?"mcp":process.env.AQE_HTTP_PORT?"http":"cli-full"}function o(e){return process.env.AQE_FAST_PATHS==="false"?!1:e.includes("--version")||e.includes("-v")}function r(e){return e[2]==="health"}export{n as detectBootMode,r as isHealthFastPath,o as isVersionFastPath};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-OI5NGQO2.js";import"./chunk-4I2IOUS4.js";q();export{a as DEFAULT_FEATURE_FLAGS,n as configureForCI,o as configureForDevelopment,p as configureForHeuristicMode,b as getVibiumFeatureFlags,m as initVibiumFeatureFlagsFromEnv,j as isAutoRetryEnabled,l as isAxeCoreEnabled,e as isBrowserModeEnabled,i as isDefaultHeadless,h as isE2EExecutionEnabled,f as isScreenshotCaptureEnabled,g as isVisualRegressionEnabled,d as resetVibiumFeatureFlags,c as setVibiumFeatureFlags,k as shouldLogPerformanceMetrics};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{A,B,C,D,E,F,G,H,I,J,K,M as L,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";L();export{a as DEFAULT_FEATURE_FLAGS,b as getRuVectorFeatureFlags,K as initFeatureFlagsFromEnv,t as isCNNVisualRegressionEnabled,v as isCoherenceActionGateEnabled,r as isCoherenceGateEnabled,D as isColdTierGNNEnabled,o as isCrossDomainTransferEnabled,y as isCusumDriftDetectionEnabled,u as isDAGAttentionEnabled,z as isDeltaEventSourcingEnabled,l as isDeterministicDitherEnabled,I as isEpropOnlineLearningEnabled,A as isEwcPlusPlusEnabled,f as isFlashAttentionEnabled,g as isGNNIndexEnabled,J as isGrangerCausalityEnabled,B as isGraphMAEEnabled,x as isHDCFingerprintingEnabled,p as isHnswHealthMonitorEnabled,C as isHopfieldMemoryEnabled,E as isMetaLearningEnabled,k as isMetadataFilteringEnabled,i as isNativeHNSWEnabled,m as isNeuralRoutingEnabled,w as isReasoningQECEnabled,q as isRegretTrackingEnabled,H as isReservoirReplayEnabled,e as isSONAEnabled,n as isSONAThreeLoopEnabled,G as isSpectralSparsificationEnabled,F as isSublinearSolverEnabled,j as isTemporalCompressionEnabled,s as isWitnessChainEnabled,d as resetRuVectorFeatureFlags,c as setRuVectorFeatureFlags,h as shouldLogMigrationMetrics};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b}from"./chunk-JBANAPWG.js";import"./chunk-4I2IOUS4.js";export{a as SOURCE_EXTENSIONS,b as walkSourceFiles};
@@ -0,0 +1,43 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as k,b as K,c as x,d as T,e as H,f as F,g as Q,j as _}from"./chunk-XRE2HCWG.js";import{a as G}from"./chunk-CWFB6BSA.js";import{c as C,d as S}from"./chunk-YR6ZZGH7.js";import{a as v,b as V}from"./chunk-RTGGL7D7.js";import"./chunk-BR26T7ZS.js";import"./chunk-3ADGXLTM.js";import{a as W}from"./chunk-JXM26HEE.js";import{a as E}from"./chunk-WIEC7VKK.js";import{f as j}from"./chunk-2E5NQNSU.js";import"./chunk-BULKFVYX.js";import"./chunk-4B6NCELM.js";import"./chunk-KP5NUODU.js";import{b as N}from"./chunk-OLHKGP35.js";import"./chunk-RU5WAHB7.js";import{v as q}from"./chunk-BPWXXEH2.js";import"./chunk-2BZFNEN2.js";import"./chunk-3IUNFTIF.js";import"./chunk-ZAPS3UGQ.js";import"./chunk-J3KWWR6Z.js";import"./chunk-IGJPMN4I.js";import"./chunk-IAV2JMIX.js";import"./chunk-EHDQJQ6Y.js";import"./chunk-QOVHWZEP.js";import"./chunk-ZDATDCYN.js";import"./chunk-AFLLQ5PP.js";import"./chunk-TLHP5EII.js";import"./chunk-MV6CMOJQ.js";import"./chunk-JRYGQO2W.js";import"./chunk-4YS3IJ45.js";import"./chunk-OF4D7MYI.js";import"./chunk-3IHG3WOY.js";import"./chunk-OI5NGQO2.js";import"./chunk-3THRQEZ2.js";import{c as L}from"./chunk-UQHYFOBX.js";import"./chunk-5SKGFSKD.js";import"./chunk-FEKY7T6Q.js";import"./chunk-LNQIY6BP.js";import"./chunk-YAGODYIG.js";import"./chunk-HY6PMO5W.js";import"./chunk-ESVQ6MEB.js";import"./chunk-FIA6X7UL.js";import"./chunk-X3KI6JOY.js";import"./chunk-24FKIJNC.js";import"./chunk-GRUUQAR6.js";import"./chunk-5T2ZQWKF.js";import"./chunk-XT2V2322.js";import"./chunk-WBQSXPBI.js";import{a as I}from"./chunk-3ZOONQG6.js";import"./chunk-SUSEVMZT.js";import"./chunk-AKE543X2.js";import"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import{a as B,c as ee}from"./chunk-JZSDOIXA.js";import{a as z,b as te}from"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import{c as $,d as ne}from"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";ne();import{Command as ie}from"commander";import t from"chalk";ee();te();import h from"chalk";import{existsSync as oe}from"fs";import{join as P}from"path";var R=class{projectRoot;options;orchestrator;constructor(e){this.options=e,this.projectRoot=e.projectRoot}async checkCodeIntelligence(){if(this.options.skipCodeScan)return console.log(h.yellow(" Code intelligence scan skipped (--skip-code-scan flag)")),{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!1,scanRequested:!1},shouldProceed:!0,skipReason:"skip-flag"};if(await this.hasCodeIntelligenceIndex()){let i=await this.getKGEntryCount();return console.log(h.green(` \u2713 Code intelligence index found (${i} entries)`)),{codeIntelligence:{hasIndex:!0,entryCount:i,wasPrompted:!1,scanRequested:!1},shouldProceed:!0}}return!this.options.nonInteractive&&(console.log(h.yellow(`
3
+ \u26A0 No code intelligence index found`)),console.log(h.gray(" Building a knowledge graph improves agent accuracy by 80%")),console.log(h.gray(" This is a one-time operation and can be run later with:")),console.log(h.cyan(` aqe code-intelligence index
4
+ `)),await this.promptScan())?{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!0,scanRequested:!0},shouldProceed:!1,skipReason:"scan-requested"}:(console.log(h.gray(" Continuing without code intelligence index")),{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!this.options.nonInteractive,scanRequested:!1},shouldProceed:!0})}async runCodeIntelligenceScan(){try{if(console.log(h.blue(`
5
+ Building code intelligence knowledge graph...`)),this.orchestrator||(this.orchestrator=new G({projectRoot:this.projectRoot,autoMode:!0,...this.options.initOptions})),await this.hasCodeIntelligenceIndex()){let s=await this.getKGEntryCount();return console.log(h.green(` \u2713 Index already exists (${s} entries)`)),{success:!0,entries:s}}let{KnowledgeGraphService:i}=await import("./knowledge-graph-NGJKFTSN.js"),{InMemoryBackend:c}=await import("./memory-backend-3NQIZUXE.js"),m=new c;await m.initialize();let n=new i(m,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),g=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:this.projectRoot,ignore:["node_modules/**","dist/**","coverage/**",".agentic-qe/**"]});console.log(h.gray(` Indexing ${g.length} files...`));let o=await n.index({paths:g.map(s=>P(this.projectRoot,s)),incremental:!1,includeTests:!0});if(n.destroy(),o.success){let s=o.value.nodesCreated+o.value.edgesCreated;return console.log(h.green(` \u2713 Indexed ${s} knowledge graph entries`)),{success:!0,entries:s}}return console.log(h.yellow(" \u26A0 Code intelligence scan completed with warnings")),{success:!1,entries:0}}catch(e){return console.error(h.red(" \u2717 Code intelligence scan failed:"),B(e)),{success:!1,entries:0}}}async getStatusForAgents(){let e=await this.hasCodeIntelligenceIndex(),i=e?await this.getKGEntryCount():0;return{codeIntelligenceAvailable:e,knowledgeGraphSize:i,recommendedCapabilities:e?["semantic-search","code-analysis","context-aware"]:["basic-analysis"]}}async hasCodeIntelligenceIndex(){let e=P(this.projectRoot,".agentic-qe","memory.db");if(!oe(e))return!1;try{let i=z(e),c=i.prepare(`
6
+ SELECT COUNT(*) as count FROM kv_store
7
+ WHERE namespace = 'code-intelligence:kg'
8
+ `).get();return i.close(),c.count>0}catch{return!1}}async getKGEntryCount(){let e=P(this.projectRoot,".agentic-qe","memory.db");try{let i=z(e),c=i.prepare(`
9
+ SELECT COUNT(*) as count FROM kv_store
10
+ WHERE namespace LIKE 'code-intelligence:kg%'
11
+ `).get();return i.close(),c.count}catch{return 0}}async promptScan(){let i=(await import("readline")).createInterface({input:process.stdin,output:process.stdout});return new Promise(c=>{i.question(h.white(" Run code intelligence scan now? [Y/n]: "),m=>{i.close();let n=m.trim().toLowerCase();c(n===""||n==="y"||n==="yes")})})}};function ae(a){return new R(a)}async function U(a,e={}){return await ae({projectRoot:a,...e}).checkCodeIntelligence()}var A={"test-generation":{description:"AI-powered test creation and generation",agentTypes:["test-generator","mutation-tester"]},"test-execution":{description:"Parallel execution, retry, flaky detection",agentTypes:["test-executor","flaky-detector"]},"coverage-analysis":{description:"Sublinear O(log n) gap detection",agentTypes:["coverage-analyzer","gap-detector"]},"quality-assessment":{description:"Quality gates and deployment decisions",agentTypes:["quality-gate","deployment-validator"]},"defect-intelligence":{description:"Prediction and root cause analysis",agentTypes:["defect-predictor","rca-analyst"]},"requirements-validation":{description:"BDD scenarios and testability scoring",agentTypes:["requirements-validator","bdd-generator"]},"code-intelligence":{description:"Knowledge graph and semantic search",agentTypes:["code-indexer","semantic-searcher"]},"security-compliance":{description:"SAST/DAST and compliance scanning",agentTypes:["security-scanner","compliance-auditor"]},"contract-testing":{description:"API contracts and GraphQL validation",agentTypes:["contract-validator","api-tester"]},"visual-accessibility":{description:"Visual regression and a11y testing",agentTypes:["visual-tester","a11y-scanner"]},"chaos-resilience":{description:"Chaos engineering and load testing",agentTypes:["chaos-engineer","load-tester"]},"learning-optimization":{description:"Cross-domain learning and optimization",agentTypes:["learning-optimizer","pattern-recognizer"]}},Y={hierarchical:{description:"Queen-led hierarchy with direct worker control",recommended:"Large teams, clear task delegation"},mesh:{description:"Fully connected peer network for collaboration",recommended:"Small teams, equal peer collaboration"},ring:{description:"Sequential message passing in a ring",recommended:"Pipeline workflows, sequential processing"},adaptive:{description:"Dynamic topology based on workload",recommended:"Variable workloads, auto-scaling needs"},"hierarchical-mesh":{description:"Hybrid combining hierarchy with peer connections",recommended:"Most projects (best of both worlds)"}},J={sqlite:{description:"SQLite-based persistent storage",features:["Cross-platform","No setup required","Good for development"]},agentdb:{description:"AgentDB with HNSW vector indexing",features:["150x-12,500x faster search","Vector embeddings","Semantic queries"]},hybrid:{description:"Combined SQLite + AgentDB",features:["Best of both","Fallback support","Production recommended"]}},O=class extends H{constructor(e){let i=Object.keys(A);super({id:"domains",stepNumber:"3/6",title:"Domain Focus",description:'Select which DDD domains to enable (comma-separated numbers or "all")',instructions:"Each domain brings specialized agents and capabilities",options:[{key:"0",value:"all",label:"all",description:"Enable all 12 domains"},...i.map((c,m)=>({key:String(m+1),value:c,label:c,description:A[c].description,isDefaultSelected:e.includes(c)||e.includes("all")}))],defaultValue:e,validValues:["all",...i],allowEmpty:!1})}async execute(e){let i=await super.execute(e);return i.value.includes("all")?{value:["all"],continue:!0}:i}},M=class extends _{constructor(e={}){super(e)}getTitle(){return"Fleet Initialization Wizard"}getSubtitle(){return"Configure your AQE v3 multi-agent fleet"}getConfirmationPrompt(){return"Initialize fleet with these settings?"}isNonInteractive(){return this.options.nonInteractive??!1}getCommands(){let e=K.checkPatternsExist(this.cwd);return[new T({id:"topology",stepNumber:"1/6",title:"Topology Type",description:"Select the coordination topology for your agent fleet",options:Object.entries(Y).map(([i,c],m)=>({key:String(m+1),value:i,label:i,description:`${c.description}
12
+ Best for: ${c.recommended}`,isRecommended:i==="hierarchical-mesh"})),defaultValue:this.options.defaultTopology||"hierarchical-mesh",validValues:["hierarchical","mesh","ring","adaptive","hierarchical-mesh"]}),new Q({id:"maxAgents",stepNumber:"2/6",title:"Max agents",description:"Set the maximum number of agents in your fleet (5-50). More agents = more parallelism, but higher resource usage.",presets:[{key:"1",value:5,label:"5 agents - Minimal (development/testing)"},{key:"2",value:10,label:"10 agents - Small team"},{key:"3",value:15,label:"15 agents - Standard (recommended)"},{key:"4",value:25,label:"25 agents - Large team"},{key:"5",value:50,label:"50 agents - Maximum capacity"}],defaultValue:this.options.defaultMaxAgents||15,min:5,max:50}),new O(this.options.defaultDomains||["all"]),new T({id:"memoryBackend",stepNumber:"4/6",title:"Memory Backend",description:"Select the memory storage backend for agent coordination",options:Object.entries(J).map(([i,c],m)=>({key:String(m+1),value:i,label:i,description:`${c.description}
13
+ Features: ${c.features.join(", ")}`,isRecommended:i==="hybrid"})),defaultValue:this.options.defaultMemoryBackend||"hybrid",validValues:["sqlite","agentdb","hybrid"]}),new F({id:"lazyLoading",stepNumber:"5/6",title:"Enable lazy loading",description:"Enable lazy loading for agents and domains",additionalInfo:"Reduces startup time by loading components on-demand",defaultValue:this.options.defaultLazyLoading??!0}),new F({id:"loadPatterns",stepNumber:"6/6",title:"Load pre-trained patterns",description:"Load pre-trained intelligence patterns from repository",additionalInfo:e?"Pre-trained patterns detected in project":"No pre-trained patterns found (will start fresh)",defaultValue:this.options.defaultLoadPatterns??e})]}buildResult(e){return{topology:e.topology,maxAgents:e.maxAgents,domains:e.domains,memoryBackend:e.memoryBackend,lazyLoading:e.lazyLoading,loadPatterns:e.loadPatterns,cancelled:!1}}printSummary(e){k.printSummaryHeader(),k.printSummaryField("Topology",e.topology),k.printSummaryField("Max Agents",String(e.maxAgents));let i=e.domains.includes("all")?"all (12 domains)":e.domains.join(", ");k.printSummaryField("Domains",i),k.printSummaryField("Memory Backend",e.memoryBackend),k.printSummaryField("Lazy Loading",x.enabledDisabled(e.lazyLoading)),k.printSummaryField("Load Patterns",x.yesNo(e.loadPatterns));let c=Y[e.topology],m=J[e.memoryBackend],n={"Topology style":c.description,"Memory features":m.features.slice(0,2).join(", ")};if(!e.domains.includes("all")){let l=new Set;for(let o of e.domains)if(o!=="all"){let s=A[o];s&&s.agentTypes.forEach(d=>l.add(d))}let g=Array.from(l);n["Agent types"]=g.slice(0,4).join(", ")+(g.length>4?"...":"")}k.printDerivedSettings(n)}getDefaults(){return{topology:this.options.defaultTopology||"hierarchical-mesh",maxAgents:this.options.defaultMaxAgents||15,domains:this.options.defaultDomains||["all"],memoryBackend:this.options.defaultMemoryBackend||"hybrid",lazyLoading:this.options.defaultLazyLoading??!0,loadPatterns:this.options.defaultLoadPatterns??!1,cancelled:!1}}getCancelled(){return{topology:"hierarchical-mesh",maxAgents:15,domains:["all"],memoryBackend:"hybrid",lazyLoading:!0,loadPatterns:!1,cancelled:!0}}};async function X(a={}){return new M(a).run()}function Oe(a,e,i,c){let m=new ie("fleet").description("Fleet operations with multi-agent progress tracking");return m.command("init").description("Initialize fleet with interactive wizard").option("--wizard","Run interactive fleet initialization wizard").option("-t, --topology <type>","Fleet topology (hierarchical|mesh|ring|adaptive|hierarchical-mesh)","hierarchical-mesh").option("-m, --max-agents <count>","Maximum agent count (5-50)","15").option("-d, --domains <domains>",'Domains to enable (comma-separated or "all")',"all").option("--memory <backend>","Memory backend (sqlite|agentdb|hybrid)","hybrid").option("--lazy","Enable lazy loading",!0).option("--skip-patterns","Skip loading pre-trained patterns").option("--skip-code-scan","Skip code intelligence index check").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").action(async n=>{try{let l=n.topology,g=parseInt(n.maxAgents,10),o=n.domains,s=n.memory,d=n.lazy,f=!n.skipPatterns;if(console.log(t.blue(`
14
+ Code Intelligence Check
15
+ `)),!(await U(process.cwd(),{skipCodeScan:n.skipCodeScan,nonInteractive:!n.wizard})).shouldProceed){console.log(t.blue(`
16
+ Please run the code intelligence scan first:`)),console.log(t.cyan(` aqe code-intelligence index
17
+ `)),console.log(t.gray(` Then re-run fleet init when ready.
18
+ `)),await e(0);return}if(n.wizard){console.log(t.blue(`
19
+ Fleet Initialization Wizard
20
+ `));let r=await X({defaultTopology:n.topology!=="hierarchical-mesh"?n.topology:void 0,defaultMaxAgents:n.maxAgents!=="15"?parseInt(n.maxAgents,10):void 0,defaultDomains:n.domains!=="all"?n.domains.split(","):void 0,defaultMemoryBackend:n.memory!=="hybrid"?n.memory:void 0});r.cancelled&&(console.log(t.yellow(`
21
+ Fleet initialization cancelled.
22
+ `)),await e(0)),l=r.topology,g=r.maxAgents,o=r.domains.join(","),s=r.memoryBackend,d=r.lazyLoading,f=r.loadPatterns,console.log(t.green(`
23
+ Starting fleet initialization...
24
+ `))}let w=o==="all"?[...I]:o.split(",").filter(r=>I.includes(r));if(console.log(t.blue(`
25
+ Fleet Configuration
26
+ `)),console.log(t.gray(` Topology: ${l}`)),console.log(t.gray(` Max Agents: ${g}`)),console.log(t.gray(` Domains: ${w.length}`)),console.log(t.gray(` Memory: ${s}`)),console.log(t.gray(` Lazy Loading: ${d?"enabled":"disabled"}`)),console.log(t.gray(` Pre-trained Patterns: ${f?"load":"skip"}
27
+ `)),!a.initialized){a.kernel=new q({maxConcurrentAgents:g,memoryBackend:s,hnswEnabled:!0,lazyLoading:d,enabledDomains:w}),await a.kernel.initialize(),console.log(t.green(" * Kernel initialized")),a.router=new W(a.kernel.eventBus),await a.router.initialize(),console.log(t.green(" * Cross-domain router initialized")),a.workflowOrchestrator=new L(a.kernel.eventBus,a.kernel.memory,a.kernel.coordinator),await a.workflowOrchestrator.initialize(),c(a.kernel,a.workflowOrchestrator),console.log(t.green(" * Workflow orchestrator initialized")),a.persistentScheduler=N(),console.log(t.green(" * Persistent scheduler initialized"));let r=u=>a.kernel.getDomainAPI(u),b=new E(a.kernel.eventBus,a.kernel.memory,r);a.queen=j(a.kernel,a.router,b,void 0),await a.queen.initialize(),console.log(t.green(" * Queen coordinator initialized")),a.initialized=!0}(n.format||"text")==="json"?C(S({status:"initialized",topology:l,maxAgents:g,domains:w,memoryBackend:s,lazyLoading:d,loadPatterns:f}),n.output):(console.log(t.green(`
28
+ Fleet initialized successfully!
29
+ `)),console.log(t.white("Next steps:")),console.log(t.gray(" 1. Spawn agents: aqe fleet spawn --domains test-generation")),console.log(t.gray(" 2. Run operation: aqe fleet run test --target ./src")),console.log(t.gray(` 3. Check status: aqe fleet status
30
+ `))),await e(0)}catch(l){console.error(t.red(`
31
+ Fleet initialization failed:`),l),await e(1)}}),m.command("spawn").description("Spawn multiple agents with progress tracking").option("-d, --domains <domains>","Comma-separated domains","test-generation,coverage-analysis").option("-t, --type <type>","Agent type for all","worker").option("-c, --count <count>","Number of agents per domain","1").action(async n=>{if(await i())try{let l=n.domains.split(","),g=parseInt(n.count,10);console.log(t.blue(`
32
+ Fleet Spawn Operation
33
+ `));let o=new v({title:"Agent Spawn Progress",showEta:!0}),s=l.length*g;o.start(s);let d=[],f=0;for(let p of l)for(let r=0;r<g;r++){let b=`${p}-${n.type}-${r+1}`,u=`agent-${f++}`;o.addAgent({id:u,name:b,status:"pending",progress:0}),o.updateAgent(u,10,{status:"running"});try{o.updateAgent(u,30,{message:"Initializing..."});let D=await a.queen.requestAgentSpawn(p,n.type,["general"]);o.updateAgent(u,80,{message:"Configuring..."}),D.success?(o.completeAgent(u,!0),d.push({id:D.value,domain:p,success:!0})):(o.completeAgent(u,!1),d.push({id:u,domain:p,success:!1}))}catch{o.completeAgent(u,!1),d.push({id:u,domain:p,success:!1})}}o.stop();let y=d.filter(p=>p.success).length,w=d.filter(p=>!p.success).length;console.log(t.blue(`
34
+ Fleet Summary:`)),console.log(t.gray(` Domains: ${l.join(", ")}`)),console.log(t.green(` Successful: ${y}`)),w>0&&console.log(t.red(` Failed: ${w}`)),console.log(""),await e(w>0?1:0)}catch(l){console.error(t.red(`
35
+ Fleet spawn failed:`),l),await e(1)}}),m.command("run").description("Run a coordinated fleet operation").argument("<operation>","Operation type (test|analyze|scan)").option("-t, --target <path>","Target path",".").option("--parallel <count>","Number of parallel agents","4").action(async(n,l)=>{if(await i())try{let g=parseInt(l.parallel,10);console.log(t.blue(`
36
+ Fleet Operation: ${n}
37
+ `));let o=new v({title:`${n.charAt(0).toUpperCase()+n.slice(1)} Progress`,showEta:!0});o.start(g);let d={test:"test-generation",analyze:"coverage-analysis",scan:"security-compliance"}[n]||"test-generation",f=Array.from({length:g},(r,b)=>({id:`${n}-agent-${b+1}`,name:`${n}-worker-${b+1}`,domain:d}));for(let r of f)o.addAgent({id:r.id,name:r.name,status:"pending",progress:0});let y=await Promise.all(f.map(async(r,b)=>{await new Promise(u=>setTimeout(u,b*200)),o.updateAgent(r.id,0,{status:"running"});try{for(let D=10;D<=90;D+=20)await new Promise(Z=>setTimeout(Z,$(300,500))),o.updateAgent(r.id,D,{eta:Math.round((100-D)*50)});let u=await a.queen.submitTask({type:n==="test"?"generate-tests":n==="analyze"?"analyze-coverage":"scan-security",priority:"p1",targetDomains:[d],payload:{target:l.target,workerId:r.id},timeout:6e4});return o.completeAgent(r.id,u.success),{id:r.id,success:u.success}}catch{return o.completeAgent(r.id,!1),{id:r.id,success:!1}}}));o.stop();let w=y.filter(r=>r.success).length,p=y.filter(r=>!r.success).length;console.log(t.blue(`
38
+ Operation Summary:`)),console.log(t.gray(` Operation: ${n}`)),console.log(t.gray(` Target: ${l.target}`)),console.log(t.green(` Successful: ${w}`)),p>0&&console.log(t.red(` Failed: ${p}`)),console.log(""),await e(p>0?1:0)}catch(g){console.error(t.red(`
39
+ Fleet operation failed:`),g),await e(1)}}),m.command("status").description("Show fleet status with agent progress").option("-w, --watch","Watch mode with live updates").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").action(async n=>{if(await i())try{let l=async()=>{let o=a.queen.getHealth(),s=a.queen.getMetrics();console.log(t.blue(`
40
+ Fleet Status
41
+ `));let d="\u2588".repeat(Math.min(Math.round(s.agentUtilization*20),20))+"\u2591".repeat(Math.max(20-Math.round(s.agentUtilization*20),0));console.log(t.white(`Fleet Utilization ${t.cyan(d)} ${(s.agentUtilization*100).toFixed(0)}%`)),console.log(""),console.log(t.white("Agent Progress:"));for(let[f,y]of o.domainHealth){let w=y.agents.active,p=y.agents.total,r=p>0?Math.round(w/p*100):0,b=y.status==="healthy"?t.green("\u2713"):y.status==="degraded"?t.yellow("\u25B6"):t.red("\u2717"),u="\u2588".repeat(Math.round(r/5))+"\u2591".repeat(20-Math.round(r/5));console.log(` ${f.padEnd(28)} ${t.cyan(u)} ${r.toString().padStart(3)}% ${b}`)}console.log(""),console.log(t.gray(` Active: ${o.activeAgents}/${o.totalAgents} agents`)),console.log(t.gray(` Tasks: ${o.runningTasks} running, ${o.pendingTasks} pending`)),console.log("")};if((n.format||"text")==="json"){let o=a.queen.getHealth(),s=a.queen.getMetrics(),d={};for(let[f,y]of o.domainHealth)d[f]={status:y.status,agents:y.agents,errors:y.errors.length};C(S({status:o.status,utilization:s.agentUtilization,activeAgents:o.activeAgents,totalAgents:o.totalAgents,runningTasks:o.runningTasks,pendingTasks:o.pendingTasks,domains:d}),n.output),await e(0);return}if(n.watch){V("Watching fleet status (Ctrl+C to exit)").spinner.stop(),await l();let s=setInterval(async()=>{console.clear(),await l()},2e3);s.unref?.(),process.once("SIGINT",async()=>{clearInterval(s),console.log(t.yellow(`
42
+ Stopped watching.`)),await e(0)})}else await l(),await e(0)}catch(l){console.error(t.red(`
43
+ Failed to get fleet status:`),l),await e(1)}}),m}export{Oe as createFleetCommand};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-WBQSXPBI.js";import"./chunk-WGMPEW2T.js";import"./chunk-UFUVUO3J.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{e as GNNLayerFactory,c as QEGNNEmbeddingIndex,d as QEGNNIndexFactory,f as TensorCompressionFactory,p as batchDifferentiableSearch,i as getDifferentiableSearch,k as getGetCompressionLevel,j as getHierarchicalForward,l as getInit,g as getRuvectorLayer,h as getTensorCompress,b as initGNN,a as isGNNAvailable,m as toFloat32Array,o as toIEmbedding,n as toNumberArray};
@@ -0,0 +1,48 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{b as d}from"./chunk-YANUP2RO.js";import{a as c,c as f}from"./chunk-JZSDOIXA.js";import"./chunk-4I2IOUS4.js";import*as s from"fs";import*as l from"path";import e from"chalk";f();var h=class{name="heartbeat";description="Manage the token-free heartbeat scheduler";cleanupAndExit;worker;constructor(t){this.cleanupAndExit=t}async getWorker(){if(!this.worker){let{HeartbeatSchedulerWorker:t}=await import("./heartbeat-scheduler-XDGMOT7X.js");this.worker=new t}return this.worker}register(t,o){let a=t.command("heartbeat").description(this.description);a.command("status").description("Show heartbeat worker status, health, and schedule").action(async()=>{await this.executeStatus()}),a.command("run-now").description("Trigger an immediate heartbeat cycle").option("-t, --timeout <ms>","Timeout in milliseconds (default: worker built-in 60s)").action(async n=>{let i=n.timeout?parseInt(n.timeout,10):void 0;await this.executeRunNow(i)}),a.command("history").description("Show recent heartbeat results").option("-n, --count <count>","Number of entries to show","10").action(async n=>{await this.executeHistory(parseInt(n.count,10)||10)}),a.command("log").description("Show today's daily log entries").option("-d, --date <date>","Show log for specific date (YYYY-MM-DD)").action(async n=>{await this.executeLog(n.date)}),a.command("pause").description("Pause the heartbeat worker").action(async()=>{await this.executePause()}),a.command("resume").description("Resume the heartbeat worker").action(async()=>{await this.executeResume()})}async executeStatus(){try{this.worker=await this.getWorker(),await this.worker.initialize();let t=this.worker.getHealth(),o=this.worker.lastResult;if(console.log(e.blue(`
3
+ Heartbeat Scheduler Status`)),console.log(e.gray(" "+"\u2500".repeat(35))),console.log(` Status: ${x(t.status)}`),console.log(` Health Score: ${y(t.healthScore)}${e.gray("/100")}`),this.worker.lastRunAt){let n=p(this.worker.lastRunAt);console.log(` Last Run: ${e.cyan(this.worker.lastRunAt.toISOString().replace("T"," ").slice(0,19))} ${e.gray(`(${n})`)}`)}else console.log(` Last Run: ${e.gray("never")}`);if(this.worker.nextRunAt){let n=p(this.worker.nextRunAt,!0);console.log(` Next Run: ${e.cyan(this.worker.nextRunAt.toISOString().replace("T"," ").slice(0,19))} ${e.gray(`(${n})`)}`)}console.log(` Total Runs: ${e.cyan(String(t.totalExecutions))}`);let a=t.totalExecutions>0?(t.successfulExecutions/t.totalExecutions*100).toFixed(1):"100.0";if(console.log(` Success Rate: ${e.cyan(a+"%")}`),o?.metrics?.domainMetrics){let n=o.metrics.domainMetrics;console.log(""),console.log(e.blue(" Last Result:")),console.log(` Promoted: ${e.cyan(String(n.promoted??0))} patterns`),console.log(` Deprecated: ${e.cyan(String(n.deprecated??0))} patterns`),console.log(` Decayed: ${e.cyan(String(n.decayed??0))} patterns`),console.log(` Pending Exp: ${e.cyan(String(n.pendingExperiences??0))}`),console.log(` Avg Conf: ${e.cyan(String(n.avgConfidence??0))}`)}console.log(""),await this.cleanupAndExit(0)}catch(t){console.error(e.red(`
4
+ Failed to get heartbeat status:`),c(t)),await this.cleanupAndExit(1)}}async executeRunNow(t){try{this.worker=await this.getWorker(),console.log(e.blue(`
5
+ Triggering heartbeat cycle...
6
+ `)),await this.worker.initialize();let o=new AbortController,a=t&&t>0?setTimeout(()=>o.abort(),t):null,n=await this.worker.execute({eventBus:{publish:async()=>{}},memory:{get:async()=>{},set:async()=>{},search:async()=>[]},logger:{debug:()=>{},info:(...i)=>console.log(e.gray(" [heartbeat]"),...i),warn:(...i)=>console.warn(e.yellow(" [heartbeat]"),...i),error:(...i)=>console.error(e.red(" [heartbeat]"),...i)},domains:{getDomainAPI:()=>{},getDomainHealth:()=>({status:"healthy",errors:[]})},signal:o.signal});if(a&&clearTimeout(a),n.success){let i=n.metrics.domainMetrics;console.log(e.green(" Heartbeat cycle complete.")),console.log(` Duration: ${e.cyan(d(n.durationMs))}`),console.log(` Health Score: ${y(n.metrics.healthScore)}${e.gray("/100")}`),console.log(` Trend: ${k(n.metrics.trend)}`),console.log(` Promoted: ${e.cyan(String(i.promoted??0))}`),console.log(` Deprecated: ${e.cyan(String(i.deprecated??0))}`),console.log(` Decayed: ${e.cyan(String(i.decayed??0))}`),console.log(` Findings: ${e.cyan(String(n.findings.length))}`)}else console.error(e.red(" Heartbeat cycle failed:"),n.error);await b(n),console.log(""),await this.cleanupAndExit(n.success?0:1)}catch(o){console.error(e.red(`
7
+ Failed to run heartbeat:`),c(o)),await this.cleanupAndExit(1)}}async executeHistory(t){try{let o=await S(t);if(o.length===0){console.log(e.yellow("\n No heartbeat history found. Run `aqe heartbeat run-now` first.\n")),await this.cleanupAndExit(0);return}console.log(e.blue(`
8
+ Heartbeat History (last ${o.length})`)),console.log(e.gray(" "+"\u2500".repeat(60)));for(let a of o){let n=a.success?e.green("OK"):e.red("FAIL"),i=a.timestamp.slice(0,19).replace("T"," "),u=a.domainMetrics||{};console.log(` ${e.gray(i)} ${n} score:${e.cyan(String(a.healthScore))} +${u.promoted??0}/-${u.deprecated??0} ${e.gray(d(a.durationMs))}`)}console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(e.red(`
9
+ Failed to load history:`),c(o)),await this.cleanupAndExit(1)}}async executeLog(t){try{let o=t||new Date().toISOString().split("T")[0];if(!/^\d{4}-\d{2}-\d{2}$/.test(o)){console.error(e.red(`
10
+ Invalid date format: "${o}". Use YYYY-MM-DD.
11
+ `)),await this.cleanupAndExit(1);return}let{findProjectRoot:a}=await import("./unified-memory-XYGENQUT.js"),n=l.join(a(),".agentic-qe","logs"),i=l.join(n,`${o}.md`);if(!s.existsSync(i)){console.log(e.yellow(`
12
+ No daily log found for ${o}.
13
+ `)),await this.cleanupAndExit(0);return}let u=s.readFileSync(i,"utf-8");console.log(e.blue(`
14
+ Daily Log \u2014 ${o}`)),console.log(e.gray(" "+"\u2500".repeat(40)));for(let g of u.split(`
15
+ `))g.trim()&&console.log(` ${g}`);console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(e.red(`
16
+ Failed to read daily log:`),c(o)),await this.cleanupAndExit(1)}}async executePause(){try{this.worker=await this.getWorker(),this.worker.pause(),console.log(e.yellow(`
17
+ Heartbeat worker paused.
18
+ `)),await this.cleanupAndExit(0)}catch(t){console.error(e.red(`
19
+ Failed to pause heartbeat:`),c(t)),await this.cleanupAndExit(1)}}async executeResume(){try{this.worker=await this.getWorker(),this.worker.resume(),console.log(e.green(`
20
+ Heartbeat worker resumed.
21
+ `)),await this.cleanupAndExit(0)}catch(t){console.error(e.red(`
22
+ Failed to resume heartbeat:`),c(t)),await this.cleanupAndExit(1)}}getHelp(){return`
23
+ Manage the token-free heartbeat scheduler (Imp-10).
24
+
25
+ The heartbeat runs every 30 minutes performing SQL-only maintenance:
26
+ - Pattern promotion checks
27
+ - Stale pattern deprecation
28
+ - Confidence decay application
29
+ - Experience buffer monitoring
30
+ - Daily Markdown log entries
31
+
32
+ Subcommands:
33
+ status Show heartbeat worker status, health, and schedule
34
+ run-now Trigger an immediate heartbeat cycle
35
+ history Show recent heartbeat results (last 10)
36
+ log Show today's daily log entries
37
+ pause Pause the heartbeat worker
38
+ resume Resume the heartbeat worker
39
+
40
+ Examples:
41
+ aqe heartbeat status
42
+ aqe heartbeat run-now
43
+ aqe heartbeat history -n 5
44
+ aqe heartbeat log
45
+ aqe heartbeat log --date 2026-03-25
46
+ aqe heartbeat pause
47
+ aqe heartbeat resume
48
+ `}},m=100;async function w(){let{findProjectRoot:r}=await import("./unified-memory-XYGENQUT.js");return l.join(r(),".agentic-qe","heartbeat-history.json")}async function b(r){try{let t=await w(),o=l.dirname(t);s.existsSync(o)||s.mkdirSync(o,{recursive:!0});let a=[];if(s.existsSync(t))try{a=JSON.parse(s.readFileSync(t,"utf-8"))}catch{a=[]}a.unshift({timestamp:r.timestamp.toISOString(),success:r.success,durationMs:r.durationMs,healthScore:r.metrics.healthScore,domainMetrics:r.metrics.domainMetrics}),a.length>m&&(a=a.slice(0,m)),s.writeFileSync(t,JSON.stringify(a,null,2))}catch{}}async function S(r){try{let t=await w();return s.existsSync(t)?JSON.parse(s.readFileSync(t,"utf-8")).slice(0,r):[]}catch{return[]}}function x(r){switch(r){case"idle":return e.cyan(r);case"running":return e.yellow(r);case"paused":return e.yellow(r);case"stopped":return e.gray(r);case"error":return e.red(r);default:return e.white(r)}}function y(r){return r>=80?e.green(String(r)):r>=50?e.yellow(String(r)):e.red(String(r))}function k(r){switch(r){case"improving":return e.green(r);case"stable":return e.cyan(r);case"degrading":return e.red(r);default:return e.gray(r)}}function p(r,t=!1){let o=t?r.getTime()-Date.now():Date.now()-r.getTime();return o<0?t?"now":"just now":o<6e4?`${Math.floor(o/1e3)}s ${t?"from now":"ago"}`:o<36e5?`${Math.floor(o/6e4)}m ${t?"from now":"ago"}`:`${Math.floor(o/36e5)}h ${t?"from now":"ago"}`}function A(r){return new h(r)}export{h as HeartbeatHandler,A as createHeartbeatHandler};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a as v,b as k}from"./chunk-XIBDETCS.js";import"./chunk-3NZLZHJI.js";import"./chunk-4YS3IJ45.js";import{k as g,o as P}from"./chunk-JJO7Y4H3.js";import"./chunk-N2NS2PHA.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-WGMPEW2T.js";import{a as d,b as y,c as R}from"./chunk-JZSDOIXA.js";import"./chunk-263XS447.js";import"./chunk-MDUHYUHF.js";import"./chunk-GAOJV3OX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-7VDBAVTY.js";import"./chunk-B36CDR4U.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";R();import{randomUUID as M}from"crypto";var p=class{constructor(e){this.config=e}_status="idle";_lastResult;_lastRunAt;_nextRunAt;_totalExecutions=0;_successfulExecutions=0;_failedExecutions=0;_executionDurations=[];_recentResults=[];get status(){return this._status}get lastResult(){return this._lastResult}get lastRunAt(){return this._lastRunAt}get nextRunAt(){return this._nextRunAt}async initialize(){this._status="idle",this._nextRunAt=new Date(Date.now()+this.config.intervalMs)}async execute(e){let r=Date.now();this._status="running",this._lastRunAt=new Date,this._totalExecutions++;let n,t;for(let a=0;a<=this.config.retryCount;a++)try{if(e.signal.aborted)throw new Error("Worker execution aborted");t=await this.executeWithTimeout(()=>this.doExecute(e),this.config.timeoutMs,e.signal);break}catch(u){n=y(u),e.logger.warn(`Worker ${this.config.id} attempt ${a+1} failed: ${n.message}`),a<this.config.retryCount&&await this.delay(this.config.retryDelayMs)}let o=Date.now()-r;return t?(this._successfulExecutions++,this._lastResult=t):(this._failedExecutions++,t=this.createErrorResult(n,o),this._lastResult=t),this._executionDurations.push(o),this._executionDurations.length>100&&this._executionDurations.shift(),this._recentResults.push({timestamp:new Date,success:t.success,durationMs:o}),this._recentResults.length>5&&this._recentResults.shift(),this._nextRunAt=new Date(Date.now()+this.config.intervalMs),this._status=t.success?"idle":"error",await e.eventBus.publish({type:"worker.executed",workerId:this.config.id,timestamp:new Date,payload:{success:t.success,durationMs:o,findingsCount:t.findings.length,healthScore:t.metrics.healthScore}}),t}pause(){this._status!=="stopped"&&(this._status="paused")}resume(){this._status==="paused"&&(this._status="idle")}async stop(){this._status="stopped"}getHealth(){let e=this._executionDurations.length>0?this._executionDurations.reduce((n,t)=>n+t,0)/this._executionDurations.length:0,r=this._totalExecutions>0?this._successfulExecutions/this._totalExecutions:1;return{status:this._status,healthScore:Math.round(r*100),totalExecutions:this._totalExecutions,successfulExecutions:this._successfulExecutions,failedExecutions:this._failedExecutions,avgDurationMs:Math.round(e),recentResults:[...this._recentResults]}}async executeWithTimeout(e,r,n){return new Promise((t,o)=>{let a=setTimeout(()=>{o(new Error(`Worker execution timed out after ${r}ms`))},r),u=()=>{clearTimeout(a),o(new Error("Worker execution aborted"))};n.addEventListener("abort",u,{once:!0}),e().then(c=>{clearTimeout(a),n.removeEventListener("abort",u),t(c)}).catch(c=>{clearTimeout(a),n.removeEventListener("abort",u),o(c)})})}createErrorResult(e,r){return{workerId:this.config.id,timestamp:new Date,durationMs:r,success:!1,error:e.message,metrics:{itemsAnalyzed:0,issuesFound:0,healthScore:0,trend:"degrading",domainMetrics:{}},findings:[],recommendations:[]}}createResult(e,r,n,t){return{workerId:this.config.id,timestamp:new Date,durationMs:e,success:!0,metrics:r,findings:n,recommendations:t}}delay(e){return new Promise(r=>setTimeout(r,e))}generateId(){return`${Date.now()}-${M().slice(0,9)}`}};P();R();var W={id:"heartbeat-scheduler",name:"Heartbeat Scheduler",description:"Token-free maintenance: pattern promotion, stale detection, experience buffer monitoring",intervalMs:1800*1e3,priority:"normal",targetDomains:["learning-optimization"],enabled:!0,timeoutMs:6e4,retryCount:1,retryDelayMs:5e3},b=class extends p{lifecycleManager=null;dailyLogger;lastRunTimestamp=0;constructor(){super(W),this.dailyLogger=new k}async getLifecycleManager(){if(this.lifecycleManager)return this.lifecycleManager;try{let e=g();await e.initialize();let r=e.getDatabase();return this.lifecycleManager=v(r,{promotionRewardThreshold:.7,promotionMinOccurrences:2,promotionMinSuccessRate:.7,deprecationFailureThreshold:3,staleDaysThreshold:30,confidenceDecayRate:.01,minActiveConfidence:.3}),this.lifecycleManager}catch{return null}}getPendingExperienceCount(){try{return g().getDatabase().prepare("SELECT COUNT(*) as pending FROM qe_pattern_usage WHERE created_at > datetime('now', '-1 day')").get()?.pending??0}catch{return 0}}async doExecute(e){let r=Date.now();e.logger.info("Heartbeat scheduler running (token-free maintenance)");let n=[],t=[],o=await this.getLifecycleManager();if(!o)return e.logger.warn("Unified memory unavailable \u2014 returning zero-metric heartbeat"),this.createResult(Date.now()-r,{itemsAnalyzed:0,issuesFound:0,healthScore:50,trend:"stable",domainMetrics:{promoted:0,deprecated:0,decayed:0,stalePatterns:0,pendingExperiences:0,avgConfidence:0,avgSuccessRate:0}},[],[]);let a=0,u=0;try{let s=o.promoteEligiblePatterns();a=s.promoted,u=s.checked,a>0&&n.push({type:"heartbeat-promotion",severity:"info",domain:"learning-optimization",title:"Patterns Promoted",description:`${a} of ${u} short-term patterns promoted to long-term`})}catch(s){e.logger.warn("Pattern promotion failed",{error:d(s)})}let c=0,h=0;try{let s=o.deprecateStalePatterns();c=s.deprecated,h=s.checked,c>0&&n.push({type:"heartbeat-deprecation",severity:"low",domain:"learning-optimization",title:"Stale Patterns Deprecated",description:`${c} of ${h} patterns deprecated (stale, failed, or low confidence)`})}catch(s){e.logger.warn("Stale pattern detection failed",{error:d(s)})}let l=0;try{let s=this.lastRunTimestamp>0?(Date.now()-this.lastRunTimestamp)/864e5:1;l=o.applyConfidenceDecay(Math.min(s,7)).decayed}catch(s){e.logger.warn("Confidence decay failed",{error:d(s)})}let m=this.getPendingExperienceCount(),i={totalPatterns:0,activePatterns:0,deprecatedPatterns:0,promotedPatterns:0,shortTermPatterns:0,longTermPatterns:0,avgConfidence:0,avgSuccessRate:0,patternsNearDeprecation:0};try{i=o.getStats()}catch(s){e.logger.warn("Stats retrieval failed",{error:d(s)})}try{this.dailyLogger.log({timestamp:new Date,type:"pattern-promoted",summary:`Heartbeat: ${a} promoted, ${c} deprecated, ${l} decayed, ${m} pending exp, ${i.activePatterns} active patterns (avg conf: ${i.avgConfidence.toFixed(2)})`,details:{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,totalPatterns:i.totalPatterns,activePatterns:i.activePatterns,avgConfidence:i.avgConfidence,avgSuccessRate:i.avgSuccessRate}}),this.dailyLogger.flush()}catch(s){e.logger.warn("Daily log write failed",{error:d(s)})}this.lastRunTimestamp=Date.now(),i.activePatterns>0&&i.patternsNearDeprecation/i.activePatterns>.5&&t.push({priority:"p2",domain:"learning-optimization",action:"Review At-Risk Patterns",description:`${i.patternsNearDeprecation} of ${i.activePatterns} active patterns are near deprecation. Manual review recommended.`,estimatedImpact:"medium",effort:"low",autoFixable:!1});let f=this.calculateHealthScore(i,a,c),D=this.determineTrend(a,c,i.activePatterns),_=Math.max(u,h),x=a+c+i.patternsNearDeprecation;return e.logger.info("Heartbeat complete",{promoted:a,deprecated:c,decayed:l,pendingExperiences:m,healthScore:f}),this.createResult(Date.now()-r,{itemsAnalyzed:_,issuesFound:x,healthScore:f,trend:D,domainMetrics:{promoted:a,deprecated:c,decayed:l,stalePatterns:i.patternsNearDeprecation,pendingExperiences:m,avgConfidence:Number(i.avgConfidence.toFixed(3)),avgSuccessRate:Number(i.avgSuccessRate.toFixed(3))}},n,t)}calculateHealthScore(e,r,n){let t=70;if(t+=Math.min(15,r*5),e.avgConfidence>0&&(t+=Math.round((e.avgConfidence-.5)*30)),e.activePatterns>0){let o=n/e.activePatterns;t-=Math.round(o*20)}return e.activePatterns>0&&e.patternsNearDeprecation/e.activePatterns>.5&&(t-=10),Math.max(0,Math.min(100,Math.round(t)))}determineTrend(e,r,n){return n===0?"stable":e>r?"improving":r>e&&r/n>.1?"degrading":"stable"}};export{b as HeartbeatSchedulerWorker};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d}from"./chunk-FEKY7T6Q.js";import"./chunk-3JPRUND5.js";import"./chunk-4VUPRTVX.js";import"./chunk-62ADTHV7.js";import"./chunk-DRT3WKQW.js";import"./chunk-UFUVUO3J.js";import"./chunk-2I7J3O6V.js";import"./chunk-4I2IOUS4.js";export{a as DEFAULT_HNSW_CONFIG,b as HNSWIndex,d as benchmarkHNSW,c as createHNSWIndex};
@@ -0,0 +1,2 @@
1
+ if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.0");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-XLRQYLWW.js";import"./chunk-4I2IOUS4.js";export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};