agentic-qe 3.9.29 → 3.9.31

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 (341) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +176 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/bridge/captured-experience-bridge.js +31 -2
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-CI2GZYME.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-EPRGXS5D.js → agent-booster-wasm-AQXZYWZY.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-LF6D64UE.js → agent-handler-7N4ZPXCY.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-XD3UQD6Y.js → agent-memory-branch-FLKF2JVX.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-KNQKALLI.js +2 -0
  11. package/dist/cli/chunks/{audit-MNJONFOL.js → audit-B4V4IKTA.js} +2 -2
  12. package/dist/cli/chunks/base-P7PRMQWY.js +2 -0
  13. package/dist/cli/chunks/{hnswlib-node-PSQJ3C65.js → better-sqlite3-NYOVLWBG.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-SA2G3FDO.js → brain-handler-OOXJ2KYY.js} +4 -4
  15. package/dist/cli/chunks/{branch-enumerator-T7SZZTMH.js → branch-enumerator-LFKFW3A4.js} +2 -2
  16. package/dist/cli/chunks/{browser-OH5HUVOG.js → browser-F72IES2I.js} +3 -3
  17. package/dist/cli/chunks/browser-workflow-QUP4A763.js +2 -0
  18. package/dist/cli/chunks/{chunk-K7CFDRVW.js → chunk-2NLZXG6V.js} +1 -1
  19. package/dist/cli/chunks/{chunk-5Q26UGSU.js → chunk-35SFAIXE.js} +2 -2
  20. package/dist/cli/chunks/{chunk-UI6KM5PK.js → chunk-3VKB4HVT.js} +2 -2
  21. package/dist/cli/chunks/{chunk-UKYPDNQR.js → chunk-462MZLJB.js} +1 -1
  22. package/dist/cli/chunks/{chunk-WUKSEOUO.js → chunk-47QIAHUJ.js} +2 -2
  23. package/dist/cli/chunks/{chunk-R55RXPHB.js → chunk-4N736EES.js} +2 -2
  24. package/dist/cli/chunks/{chunk-5XRNUFEG.js → chunk-52D3CYE5.js} +2 -2
  25. package/dist/cli/chunks/{chunk-5MUYYPPW.js → chunk-5AMAJCZS.js} +3 -3
  26. package/dist/cli/chunks/{chunk-2JK43GR4.js → chunk-5G2L4XRU.js} +2 -2
  27. package/dist/cli/chunks/{chunk-C7MWQ4BI.js → chunk-5M4F3PAL.js} +1 -1
  28. package/dist/cli/chunks/{chunk-PYAITX6B.js → chunk-5WWQLPB4.js} +2 -2
  29. package/dist/cli/chunks/chunk-5Z6PYYWK.js +2 -0
  30. package/dist/cli/chunks/{chunk-VHJRWMZ5.js → chunk-62KYX5NH.js} +2 -2
  31. package/dist/cli/chunks/{chunk-667A24A4.js → chunk-7MXQV7RB.js} +12 -6
  32. package/dist/cli/chunks/{chunk-N5SS5YIS.js → chunk-7OVVBBOZ.js} +2 -2
  33. package/dist/cli/chunks/{chunk-TESFXE2W.js → chunk-7RPEBKQZ.js} +2 -2
  34. package/dist/cli/chunks/{chunk-3T4Q5V4B.js → chunk-7UHRT5AX.js} +2 -2
  35. package/dist/cli/chunks/{chunk-7PYHCYLJ.js → chunk-7V7TP242.js} +1 -1
  36. package/dist/cli/chunks/{chunk-IBSTVSKT.js → chunk-A424Z7LA.js} +1 -1
  37. package/dist/cli/chunks/{chunk-IX5LUHCN.js → chunk-AKFRM4IO.js} +2 -2
  38. package/dist/cli/chunks/{chunk-UGXYKPM4.js → chunk-AKJWBJDK.js} +2 -2
  39. package/dist/cli/chunks/{chunk-MBNFD2C3.js → chunk-AQN6PDHI.js} +1 -1
  40. package/dist/cli/chunks/{chunk-YCK464TF.js → chunk-BMS7WFDB.js} +1 -1
  41. package/dist/cli/chunks/{chunk-C7G7TA2H.js → chunk-BYHUGO73.js} +3 -3
  42. package/dist/cli/chunks/{chunk-ZZAZQKOA.js → chunk-CFLA2GBS.js} +2 -2
  43. package/dist/cli/chunks/{chunk-7AIVTUMM.js → chunk-CNKOIHF6.js} +2 -2
  44. package/dist/cli/chunks/{chunk-23B7TDPN.js → chunk-CQWZNVIM.js} +2 -2
  45. package/dist/cli/chunks/{chunk-REFFJUYT.js → chunk-CUSLB7MB.js} +2 -2
  46. package/dist/cli/chunks/chunk-CYUGE5ZQ.js +2 -0
  47. package/dist/cli/chunks/{chunk-BZ4OMPVJ.js → chunk-DMF4Z2M6.js} +2 -2
  48. package/dist/cli/chunks/{chunk-HEUAPPKE.js → chunk-DUF733Z7.js} +1 -1
  49. package/dist/cli/chunks/{chunk-VKJLHKLY.js → chunk-EAIPJSKH.js} +2 -2
  50. package/dist/cli/chunks/{chunk-GHBQVPJT.js → chunk-EJXRBAQF.js} +2 -2
  51. package/dist/cli/chunks/{chunk-N6A4XFUM.js → chunk-EKYPQ5DX.js} +1 -1
  52. package/dist/cli/chunks/{chunk-ZPFBEZV5.js → chunk-ENCFLC44.js} +2 -2
  53. package/dist/cli/chunks/{chunk-WQX2Q42U.js → chunk-FOAWHNOP.js} +2 -2
  54. package/dist/cli/chunks/{chunk-GBLW4QDV.js → chunk-FUHPLXJX.js} +1 -1
  55. package/dist/cli/chunks/{chunk-3E4VPGNW.js → chunk-G2U7Q6V6.js} +2 -2
  56. package/dist/cli/chunks/{chunk-7WRIYQG7.js → chunk-G3YKCZWQ.js} +3 -3
  57. package/dist/cli/chunks/{chunk-OLJLSLCY.js → chunk-GJSH4UZ3.js} +3 -3
  58. package/dist/cli/chunks/{chunk-XP5OUB2X.js → chunk-GN7FUCJH.js} +1 -1
  59. package/dist/cli/chunks/{chunk-UO3QSXYD.js → chunk-GQFAVT2I.js} +1 -1
  60. package/dist/cli/chunks/{chunk-AUE4QOT7.js → chunk-HHEIQHLQ.js} +2 -2
  61. package/dist/cli/chunks/{chunk-LRWREDZU.js → chunk-I3TFGMOQ.js} +1 -1
  62. package/dist/cli/chunks/{chunk-BUMNLVMC.js → chunk-IRRGUXAU.js} +1 -1
  63. package/dist/cli/chunks/{chunk-ZMZS6NKQ.js → chunk-IY4P35N3.js} +2 -2
  64. package/dist/cli/chunks/{chunk-SKIG6EOQ.js → chunk-JF3U456G.js} +2 -2
  65. package/dist/cli/chunks/{chunk-YEXQMYOM.js → chunk-JJRZOLDY.js} +2 -2
  66. package/dist/cli/chunks/{chunk-G426VZ5K.js → chunk-JKKV5KKS.js} +2 -2
  67. package/dist/cli/chunks/{chunk-I6PVI7R5.js → chunk-JMLOEW7Y.js} +2 -2
  68. package/dist/cli/chunks/chunk-JRIDPOEZ.js +95 -0
  69. package/dist/cli/chunks/{chunk-MCJRIW7M.js → chunk-K37CNLQZ.js} +1 -1
  70. package/dist/cli/chunks/{chunk-LIEKDXTS.js → chunk-K6MFAVXK.js} +2 -2
  71. package/dist/cli/chunks/{chunk-OPPASGEB.js → chunk-KJAIE7SL.js} +4 -4
  72. package/dist/cli/chunks/{chunk-ZWI5Z2SI.js → chunk-KXRDQQGN.js} +2 -2
  73. package/dist/cli/chunks/{chunk-Y7VPSAWH.js → chunk-L4JTTPU7.js} +2 -2
  74. package/dist/cli/chunks/{chunk-RXAJBMM7.js → chunk-L63KB63A.js} +2 -2
  75. package/dist/cli/chunks/{chunk-KX3XTWNR.js → chunk-L7DNPOAQ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-LJDPZC6Q.js → chunk-LF5RO6WO.js} +1 -1
  77. package/dist/cli/chunks/{chunk-GWBI5IMK.js → chunk-LRWRFKQH.js} +1 -1
  78. package/dist/cli/chunks/{chunk-JXWZZTPN.js → chunk-M6RVKGIP.js} +2 -2
  79. package/dist/cli/chunks/{chunk-IQXDL7BX.js → chunk-MAJ5QFVY.js} +1 -1
  80. package/dist/cli/chunks/chunk-MYCVU3D3.js +14 -0
  81. package/dist/cli/chunks/{chunk-C7SJS5E4.js → chunk-N6P7ENG7.js} +2 -2
  82. package/dist/cli/chunks/{chunk-KQYKPEY6.js → chunk-N6SIKSCO.js} +2 -2
  83. package/dist/cli/chunks/{chunk-BP3KVVEM.js → chunk-NBKM7NKX.js} +2 -2
  84. package/dist/cli/chunks/{chunk-TZG7TJD5.js → chunk-NLUBN642.js} +2 -2
  85. package/dist/cli/chunks/{chunk-HCVIUAF2.js → chunk-NNF3GCGF.js} +2 -2
  86. package/dist/cli/chunks/{chunk-AYESXBSX.js → chunk-NTVJKQ5S.js} +2 -2
  87. package/dist/cli/chunks/{chunk-LPSIKIE2.js → chunk-NZQYNUGM.js} +2 -2
  88. package/dist/cli/chunks/{chunk-JX2AS6QZ.js → chunk-ONMJJ2C3.js} +1 -1
  89. package/dist/cli/chunks/{chunk-AOZ3JGJQ.js → chunk-OXOXNAEZ.js} +2 -2
  90. package/dist/cli/chunks/chunk-PSF6YQQM.js +180 -0
  91. package/dist/cli/chunks/{chunk-OW47RQEW.js → chunk-PTOTOBOU.js} +1 -1
  92. package/dist/cli/chunks/{chunk-FIMBLHR5.js → chunk-PUSZ4NBY.js} +2 -2
  93. package/dist/cli/chunks/chunk-PYYNY7RJ.js +2 -0
  94. package/dist/cli/chunks/{chunk-JXWJ6BLR.js → chunk-QEJBJST4.js} +1 -1
  95. package/dist/cli/chunks/{chunk-AQ4ZSM4D.js → chunk-QGLWFZVQ.js} +2 -2
  96. package/dist/cli/chunks/{chunk-ONFODTGV.js → chunk-QITO7E7Y.js} +1 -1
  97. package/dist/cli/chunks/{chunk-YWW6YPT5.js → chunk-QMSDKKYG.js} +1 -1
  98. package/dist/cli/chunks/{chunk-DCZV4QTP.js → chunk-RBDAHW2M.js} +2 -2
  99. package/dist/cli/chunks/{chunk-TLPIUYN3.js → chunk-RDJWUKIR.js} +2 -2
  100. package/dist/cli/chunks/{chunk-FDETLFX4.js → chunk-REJEFTWX.js} +1 -1
  101. package/dist/cli/chunks/{chunk-BVHLZ3TP.js → chunk-ROEIR3OD.js} +1 -1
  102. package/dist/cli/chunks/{chunk-GTJNB5B4.js → chunk-RTGNWRQI.js} +2 -2
  103. package/dist/cli/chunks/{chunk-XJJQZULZ.js → chunk-SL4TAJOE.js} +2 -2
  104. package/dist/cli/chunks/{chunk-ENJBAK7Y.js → chunk-T4DDCMKG.js} +113 -113
  105. package/dist/cli/chunks/{chunk-ZIX5MU4Q.js → chunk-TJGIIGKL.js} +2 -2
  106. package/dist/cli/chunks/{chunk-ZOORGOLY.js → chunk-TLCCM2AF.js} +1 -1
  107. package/dist/cli/chunks/{chunk-RBHWBTKA.js → chunk-TVHWI77X.js} +1 -1
  108. package/dist/cli/chunks/{chunk-P7HWW3VH.js → chunk-TYUIQSSF.js} +2 -2
  109. package/dist/cli/chunks/{chunk-YXMKMUQX.js → chunk-UIIEZMSM.js} +1 -1
  110. package/dist/cli/chunks/{chunk-VWDVQFEV.js → chunk-UIRTXM7C.js} +71 -71
  111. package/dist/cli/chunks/{chunk-2HUYG6Q6.js → chunk-UNXUSYRL.js} +3 -3
  112. package/dist/cli/chunks/chunk-VA45HLBF.js +2 -0
  113. package/dist/cli/chunks/{chunk-BMMXCDTH.js → chunk-VAIOZDG5.js} +1 -1
  114. package/dist/cli/chunks/{chunk-3YS4ZLL2.js → chunk-VLAGWLHF.js} +2 -2
  115. package/dist/cli/chunks/{chunk-SCXRYZ3U.js → chunk-VOOJDHLI.js} +14 -8
  116. package/dist/cli/chunks/{chunk-RRQH5BMQ.js → chunk-VSKABN3B.js} +29 -17
  117. package/dist/cli/chunks/{chunk-HHDPHHTX.js → chunk-VUL5HIKR.js} +2 -2
  118. package/dist/cli/chunks/{chunk-ZXWHKLZN.js → chunk-W7XVEWKQ.js} +1 -1
  119. package/dist/cli/chunks/{chunk-CZEQFAKE.js → chunk-WB6TI6Q3.js} +2 -2
  120. package/dist/cli/chunks/{chunk-YDBBXRH7.js → chunk-X2FLWV5C.js} +2 -2
  121. package/dist/cli/chunks/{chunk-G7LVJXZR.js → chunk-XE4YKDIM.js} +2 -2
  122. package/dist/cli/chunks/{chunk-A7ZCJ2XN.js → chunk-XGBIXRKD.js} +2 -2
  123. package/dist/cli/chunks/{chunk-B23E53WF.js → chunk-XMMWYQJK.js} +2 -2
  124. package/dist/cli/chunks/{chunk-3MFAU2JA.js → chunk-XNJ6DIEW.js} +2 -2
  125. package/dist/cli/chunks/{chunk-VJR2JIYP.js → chunk-XTWYCMAM.js} +2 -2
  126. package/dist/cli/chunks/{chunk-POV6V35B.js → chunk-XY3WUGD3.js} +2 -2
  127. package/dist/cli/chunks/{chunk-OU2FFOML.js → chunk-YEZJE2ZW.js} +4 -4
  128. package/dist/cli/chunks/{chunk-HDKXJMRS.js → chunk-YLEMSN46.js} +1 -1
  129. package/dist/cli/chunks/{chunk-SH7N3Y63.js → chunk-YMN4C32S.js} +3 -3
  130. package/dist/cli/chunks/{chunk-KIUJ4EI5.js → chunk-YN7HCVUP.js} +2 -2
  131. package/dist/cli/chunks/{chunk-WYSM5565.js → chunk-YQJBE6NX.js} +2 -2
  132. package/dist/cli/chunks/{chunk-QNIOQ4AR.js → chunk-ZBJRNCWX.js} +2 -2
  133. package/dist/cli/chunks/{chunk-NZIU2SEI.js → chunk-ZG4EKPGV.js} +1 -1
  134. package/dist/cli/chunks/{chunk-4ZAX5A6E.js → chunk-ZWSRIJ2T.js} +2 -2
  135. package/dist/cli/chunks/{ci-5BS5ALBZ.js → ci-LRTJSZHT.js} +2 -2
  136. package/dist/cli/chunks/{ci-output-I7CGW62R.js → ci-output-LISCHUKD.js} +2 -2
  137. package/dist/cli/chunks/{circuit-breaker-7P2V65XX.js → circuit-breaker-7PMP25KZ.js} +2 -2
  138. package/dist/cli/chunks/{claude-flow-setup-EKRLBRCE.js → claude-flow-setup-DOW4QVMC.js} +2 -2
  139. package/dist/cli/chunks/client-XF6SJO2C.js +2 -0
  140. package/dist/cli/chunks/{cline-installer-U6KRJJHQ.js → cline-installer-2NXQGW73.js} +2 -2
  141. package/dist/cli/chunks/{code-I6PB6YM7.js → code-3X6RWAS7.js} +2 -2
  142. package/dist/cli/chunks/{code-index-extractor-NP7JW32L.js → code-index-extractor-4ABP5WCP.js} +2 -2
  143. package/dist/cli/chunks/{codex-installer-52W4TK27.js → codex-installer-V7PII6GL.js} +2 -2
  144. package/dist/cli/chunks/{completions-LTOAC3Y5.js → completions-Y7LNQ63I.js} +2 -2
  145. package/dist/cli/chunks/{complexity-analyzer-RXAF5SX3.js → complexity-analyzer-XLYMAM6I.js} +2 -2
  146. package/dist/cli/chunks/{continuedev-installer-BNUOLW2M.js → continuedev-installer-GOT4TKNT.js} +2 -2
  147. package/dist/cli/chunks/{copilot-installer-YXANWEVX.js → copilot-installer-D6BAQVIO.js} +2 -2
  148. package/dist/cli/chunks/{cost-tracker-EBAHKAGL.js → cost-tracker-VT7C5Q52.js} +2 -2
  149. package/dist/cli/chunks/{coverage-SWVKYJ6V.js → coverage-C62MRP4M.js} +3 -3
  150. package/dist/cli/chunks/cross-domain-router-J2OFPM6R.js +2 -0
  151. package/dist/cli/chunks/{cursor-installer-QIZPJ5YQ.js → cursor-installer-WAWSS2K2.js} +2 -2
  152. package/dist/cli/chunks/{daemon-YPL4BMZX.js → daemon-CP2ETHRF.js} +3 -3
  153. package/dist/cli/chunks/{dag-attention-scheduler-6XXECMF2.js → dag-attention-scheduler-SZIZWPV7.js} +2 -2
  154. package/dist/cli/chunks/{detect-GGTJLBM6.js → detect-AJX6NJEP.js} +2 -2
  155. package/dist/cli/chunks/{dist-node-B6P2AD27.js → dist-node-E5X47QTY.js} +2 -2
  156. package/dist/cli/chunks/{domain-handler-TSZJEND7.js → domain-handler-FN3PIP45.js} +2 -2
  157. package/dist/cli/chunks/{domain-transfer-EBKK2ZKV.js → domain-transfer-N3TOJEMT.js} +2 -2
  158. package/dist/cli/chunks/dream-D5LD5SOZ.js +2 -0
  159. package/dist/cli/chunks/{embed-and-insert-pattern-OMRWRS6V.js → embed-and-insert-pattern-PJI5TZKR.js} +2 -2
  160. package/dist/cli/chunks/{eval-Q5PAQA5O.js → eval-OS54TDQU.js} +2 -2
  161. package/dist/cli/chunks/{experience-capture-middleware-5MOUWAON.js → experience-capture-middleware-FBM4ANZW.js} +3 -3
  162. package/dist/cli/chunks/{fast-paths-32E3N4KU.js → fast-paths-2CVAAPQO.js} +2 -2
  163. package/dist/cli/chunks/{feature-flags-WRIWP5VL.js → feature-flags-A5KFWVFC.js} +2 -2
  164. package/dist/cli/chunks/{feature-flags-VERJA5SQ.js → feature-flags-GEXTW6OT.js} +2 -2
  165. package/dist/cli/chunks/{file-discovery-2X6CZSTB.js → file-discovery-KWLVC7KN.js} +2 -2
  166. package/dist/cli/chunks/{fleet-VB2JTP7P.js → fleet-MNKH356S.js} +3 -3
  167. package/dist/cli/chunks/{gnn-wrapper-HNKBFKUD.js → gnn-wrapper-ALTWYFVZ.js} +2 -2
  168. package/dist/cli/chunks/{heartbeat-handler-Y5GIRQNS.js → heartbeat-handler-MBMEPEGW.js} +4 -4
  169. package/dist/cli/chunks/{heartbeat-scheduler-UGB57DTJ.js → heartbeat-scheduler-OH3SS7MH.js} +2 -2
  170. package/dist/cli/chunks/hnsw-adapter-M2MMM3N6.js +2 -0
  171. package/dist/cli/chunks/hnsw-index-JO7KNF7M.js +2 -0
  172. package/dist/cli/chunks/{hnsw-legacy-bridge-A6G6GPMS.js → hnsw-legacy-bridge-WTD5PR5V.js} +2 -2
  173. package/dist/cli/chunks/{better-sqlite3-XT27JRMH.js → hnswlib-node-WENGW3YX.js} +2 -2
  174. package/dist/cli/chunks/hooks-ELHGEBFK.js +248 -0
  175. package/dist/cli/chunks/{hybrid-router-LTAQGTNR.js → hybrid-router-D6ZMIZCE.js} +2 -2
  176. package/dist/cli/chunks/{hypergraph-engine-IRTPRX6K.js → hypergraph-engine-JOQ6TERZ.js} +2 -2
  177. package/dist/cli/chunks/{hypergraph-handler-6IVDHP2K.js → hypergraph-handler-HX45YWWN.js} +3 -3
  178. package/dist/cli/chunks/impact-analyzer-ROQL4J7P.js +2 -0
  179. package/dist/cli/chunks/{init-handler-NNLOQN2F.js → init-handler-TNVU6NQ6.js} +6 -6
  180. package/dist/cli/chunks/init-wizard-4BDFZX4M.js +2 -0
  181. package/dist/cli/chunks/kernel-37Y63WKR.js +2 -0
  182. package/dist/cli/chunks/{kilocode-installer-Q5A6WBX2.js → kilocode-installer-YC5RJIY4.js} +2 -2
  183. package/dist/cli/chunks/{kiro-installer-ZVOLX6AX.js → kiro-installer-EAB26M55.js} +2 -2
  184. package/dist/cli/chunks/knowledge-graph-V3DX6ZCX.js +2 -0
  185. package/dist/cli/chunks/learning-A2OB7D2B.js +117 -0
  186. package/dist/cli/chunks/{llm-router-EFIOXD3E.js → llm-router-KEG6PA7C.js} +4 -4
  187. package/dist/cli/chunks/{load-7HYD5K5T.js → load-D6ZDLVA3.js} +2 -2
  188. package/dist/cli/chunks/load-test-HPBA2CMT.js +2 -0
  189. package/dist/cli/chunks/{mcp-TQEPJY5L.js → mcp-ERJHZ6FN.js} +2 -2
  190. package/dist/cli/chunks/{memory-2P5KRDUP.js → memory-GSRIJIVR.js} +5 -5
  191. package/dist/cli/chunks/memory-backend-DODDBB46.js +2 -0
  192. package/dist/cli/chunks/memory-handlers-MFLCRS7V.js +2 -0
  193. package/dist/cli/chunks/{multi-model-executor-Z74ALKIH.js → multi-model-executor-GK3V7ERC.js} +2 -2
  194. package/dist/cli/chunks/{opencode-installer-2NICPXQZ.js → opencode-installer-6TTN26RG.js} +2 -2
  195. package/dist/cli/chunks/{orchestrator-ZPVU3M4M.js → orchestrator-YVTSM6QW.js} +37 -18
  196. package/dist/cli/chunks/{pipeline-B55E7S5P.js → pipeline-EWLJCY5G.js} +2 -2
  197. package/dist/cli/chunks/{platform-6FY6335Y.js → platform-2ULHQQME.js} +2 -2
  198. package/dist/cli/chunks/{plugin-F23VOSIL.js → plugin-PYN2KOXA.js} +2 -2
  199. package/dist/cli/chunks/{prime-radiant-advanced-wasm-LL7WPCNW.js → prime-radiant-advanced-wasm-IULCTOGZ.js} +2 -2
  200. package/dist/cli/chunks/protocol-executor-D56OYMCJ.js +2 -0
  201. package/dist/cli/chunks/{protocol-handler-JWPPGEUR.js → protocol-handler-FZYI2SBP.js} +2 -2
  202. package/dist/cli/chunks/{prove-S4PD63BK.js → prove-DN7S74SP.js} +2 -2
  203. package/dist/cli/chunks/{provider-manager-R7YYUTO3.js → provider-manager-FT3MCROB.js} +2 -2
  204. package/dist/cli/chunks/qe-reasoning-bank-KXROIEK7.js +2 -0
  205. package/dist/cli/chunks/{quality-UIG6G2BR.js → quality-ITBU6LGC.js} +2 -2
  206. package/dist/cli/chunks/queen-coordinator-XOGATERL.js +2 -0
  207. package/dist/cli/chunks/{real-embeddings-7GJEWY4C.js → real-embeddings-PZUZ5RXJ.js} +2 -2
  208. package/dist/cli/chunks/{roocode-installer-Y5YVCVVS.js → roocode-installer-2LMVZOUZ.js} +2 -2
  209. package/dist/cli/chunks/router-3EHNUCOM.js +2 -0
  210. package/dist/cli/chunks/routing-feedback-ZHKGET22.js +2 -0
  211. package/dist/cli/chunks/{routing-handler-YFBT7LZH.js → routing-handler-5RB73UCF.js} +2 -2
  212. package/dist/cli/chunks/{ruvector-commands-7WCRMBWZ.js → ruvector-commands-VBN4APMG.js} +2 -2
  213. package/dist/cli/chunks/{rvf-dual-writer-PPZ5AVFW.js → rvf-dual-writer-BNY4AUWT.js} +2 -2
  214. package/dist/cli/chunks/{rvf-migration-adapter-SVW4AKVC.js → rvf-migration-adapter-73MKPBGV.js} +2 -2
  215. package/dist/cli/chunks/{rvf-migration-coordinator-TNCPU743.js → rvf-migration-coordinator-SGVB7ZAZ.js} +2 -2
  216. package/dist/cli/chunks/rvf-native-adapter-4YC5IQUW.js +2 -0
  217. package/dist/cli/chunks/safe-db-PLJRHQIC.js +2 -0
  218. package/dist/cli/chunks/schedule-7DGELVJE.js +2 -0
  219. package/dist/cli/chunks/scheduler-VWASEC2J.js +2 -0
  220. package/dist/cli/chunks/{security-22YXZGU3.js → security-XUH4H7R3.js} +3 -3
  221. package/dist/cli/chunks/shared-rvf-adapter-DCVDY2XW.js +2 -0
  222. package/dist/cli/chunks/{shared-rvf-dual-writer-Q5OSQNW5.js → shared-rvf-dual-writer-GML4EDYF.js} +2 -2
  223. package/dist/cli/chunks/sqlite-persistence-CTEBGVOW.js +2 -0
  224. package/dist/cli/chunks/{status-handler-CTEEZTVQ.js → status-handler-XI7GJF6Z.js} +2 -2
  225. package/dist/cli/chunks/{structural-health-S72DLFPZ.js → structural-health-WPCYKOXV.js} +2 -2
  226. package/dist/cli/chunks/{sync-2AJ5S27F.js → sync-SFKTCRZC.js} +10 -10
  227. package/dist/cli/chunks/{task-handler-XQCQAUM3.js → task-handler-FZB55IEG.js} +2 -2
  228. package/dist/cli/chunks/{task-handlers-U6DXLSYJ.js → task-handlers-EXZGFH7F.js} +3 -3
  229. package/dist/cli/chunks/{test-K7C4CWFH.js → test-XYRN4OVU.js} +4 -4
  230. package/dist/cli/chunks/{test-scheduling-WQBR6C3V.js → test-scheduling-FLVOPGOT.js} +5 -5
  231. package/dist/cli/chunks/{token-bootstrap-IRZHAD7N.js → token-bootstrap-FDCFVRHM.js} +2 -2
  232. package/dist/cli/chunks/{token-usage-DIK6QRD5.js → token-usage-MHNZF3DM.js} +2 -2
  233. package/dist/cli/chunks/{transformers-RPUPJLSR.js → transformers-4CRVTMWY.js} +2 -2
  234. package/dist/cli/chunks/{tree-sitter-wasm-parser-A45KH4YZ.js → tree-sitter-wasm-parser-CI3V4AND.js} +2 -2
  235. package/dist/cli/chunks/{types-LO5DGIJC.js → types-RKCD4BNL.js} +2 -2
  236. package/dist/cli/chunks/unified-memory-YDKXKW3D.js +2 -0
  237. package/dist/cli/chunks/unified-memory-hnsw-6N7YZCLR.js +2 -0
  238. package/dist/cli/chunks/unified-persistence-UTWLPUQI.js +2 -0
  239. package/dist/cli/chunks/{upgrade-QZNMQOBY.js → upgrade-463W7VKH.js} +2 -2
  240. package/dist/cli/chunks/{validate-675K5FDZ.js → validate-LENSMEAY.js} +2 -2
  241. package/dist/cli/chunks/{validate-swarm-TJXJFTT4.js → validate-swarm-4FEBNAWA.js} +2 -2
  242. package/dist/cli/chunks/{vibium-2FFU5KPE.js → vibium-TXNVIVWJ.js} +2 -2
  243. package/dist/cli/chunks/visual-security-DGXSOFKD.js +2 -0
  244. package/dist/cli/chunks/{web-tree-sitter-VX55VO25.js → web-tree-sitter-BZEGWID4.js} +2 -2
  245. package/dist/cli/chunks/{windsurf-installer-A7FNN7RB.js → windsurf-installer-7AFXJTPU.js} +2 -2
  246. package/dist/cli/chunks/{witness-chain-QLIBCLCH.js → witness-chain-G6SUZOZG.js} +2 -2
  247. package/dist/cli/chunks/witness-chain-VP4MF6EU.js +2 -0
  248. package/dist/cli/chunks/{workflow-LQDA5VYM.js → workflow-EVQPO6FH.js} +4 -4
  249. package/dist/cli/chunks/workflow-orchestrator-VXSYAKQY.js +2 -0
  250. package/dist/cli/chunks/{wrappers-KE6AZMO6.js → wrappers-HR6RUDI2.js} +2 -2
  251. package/dist/cli/commands/hooks-handlers/editing-hooks.js +9 -3
  252. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -24
  253. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +1 -1
  254. package/dist/cli/commands/hooks-handlers/hooks-shared.js +8 -1
  255. package/dist/cli/commands/hooks-handlers/routing-hooks.js +15 -3
  256. package/dist/cli/commands/hooks-handlers/task-hooks.js +37 -46
  257. package/dist/cli/commands/learning.js +194 -0
  258. package/dist/cli/commands/sync.js +3 -0
  259. package/dist/domains/requirements-validation/services/quality-criteria/quality-criteria-service.js +4 -1
  260. package/dist/init/phases/07-hooks.js +4 -1
  261. package/dist/init/phases/10-workers.js +24 -2
  262. package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.js +15 -12
  263. package/dist/integrations/n8n/agent-factory.js +4 -1
  264. package/dist/integrations/n8n/n8n-adapter.js +4 -1
  265. package/dist/kernel/interfaces.d.ts +12 -0
  266. package/dist/kernel/kernel.d.ts +1 -0
  267. package/dist/kernel/kernel.js +57 -0
  268. package/dist/kernel/unified-memory-schemas.d.ts +1 -1
  269. package/dist/kernel/unified-memory-schemas.js +7 -1
  270. package/dist/learning/agent-routing.d.ts +134 -1
  271. package/dist/learning/agent-routing.js +185 -2
  272. package/dist/learning/dream/dream-insights-pruner.d.ts +49 -0
  273. package/dist/learning/dream/dream-insights-pruner.js +53 -0
  274. package/dist/learning/dream/dream-scheduler.js +17 -0
  275. package/dist/learning/loop-health.d.ts +84 -0
  276. package/dist/learning/loop-health.js +91 -0
  277. package/dist/learning/pattern-usage-recorder.d.ts +58 -0
  278. package/dist/learning/pattern-usage-recorder.js +72 -0
  279. package/dist/learning/qe-reasoning-bank-types.d.ts +11 -0
  280. package/dist/learning/qe-reasoning-bank.d.ts +11 -0
  281. package/dist/learning/qe-reasoning-bank.js +86 -3
  282. package/dist/learning/routing-topology-gate.d.ts +40 -0
  283. package/dist/learning/routing-topology-gate.js +55 -0
  284. package/dist/learning/sqlite-persistence.d.ts +6 -1
  285. package/dist/learning/sqlite-persistence.js +14 -20
  286. package/dist/mcp/bundle.js +3833 -3807
  287. package/dist/mcp/handlers/domain-handler-configs.js +72 -13
  288. package/dist/mcp/protocol-server.d.ts +6 -0
  289. package/dist/mcp/protocol-server.js +91 -2
  290. package/dist/mcp/tools/coherence/collapse.d.ts +4 -0
  291. package/dist/mcp/tools/coherence/collapse.js +48 -21
  292. package/dist/mcp/tools/embeddings/embedding.js +5 -2
  293. package/dist/routing/routing-feedback.js +7 -3
  294. package/dist/routing/routing-outcomes-migration.d.ts +31 -0
  295. package/dist/routing/routing-outcomes-migration.js +60 -0
  296. package/dist/test-scheduling/pipeline.d.ts +1 -1
  297. package/dist/test-scheduling/pipeline.js +8 -2
  298. package/dist/workers/workers/learning-consolidation.d.ts +28 -0
  299. package/dist/workers/workers/learning-consolidation.js +204 -0
  300. package/dist/workflows/browser/workflow-loader.js +4 -1
  301. package/package.json +1 -1
  302. package/dist/cli/chunks/adapter-4NVP2SYD.js +0 -2
  303. package/dist/cli/chunks/aqe-learning-engine-ZTR5KIGB.js +0 -2
  304. package/dist/cli/chunks/base-2M65XYDE.js +0 -2
  305. package/dist/cli/chunks/browser-workflow-7EXB6DUF.js +0 -2
  306. package/dist/cli/chunks/chunk-6ZJROHI3.js +0 -2
  307. package/dist/cli/chunks/chunk-J3CLEYJP.js +0 -14
  308. package/dist/cli/chunks/chunk-SRSL5OFF.js +0 -180
  309. package/dist/cli/chunks/chunk-WLPP7V3W.js +0 -95
  310. package/dist/cli/chunks/chunk-YXS6SHB2.js +0 -2
  311. package/dist/cli/chunks/client-KTEVHNVO.js +0 -2
  312. package/dist/cli/chunks/cross-domain-router-23RTLMQL.js +0 -2
  313. package/dist/cli/chunks/dream-KNO2ZF24.js +0 -2
  314. package/dist/cli/chunks/hnsw-adapter-JQHOAYXA.js +0 -2
  315. package/dist/cli/chunks/hnsw-index-AIUQDZLY.js +0 -2
  316. package/dist/cli/chunks/hooks-Z4U7DCTP.js +0 -259
  317. package/dist/cli/chunks/impact-analyzer-ULJRGNBM.js +0 -2
  318. package/dist/cli/chunks/init-wizard-R2WC5V2W.js +0 -2
  319. package/dist/cli/chunks/kernel-ZDQG4UWQ.js +0 -2
  320. package/dist/cli/chunks/knowledge-graph-RLCAQW6I.js +0 -2
  321. package/dist/cli/chunks/learning-NZLHSX4F.js +0 -107
  322. package/dist/cli/chunks/load-test-KH35UZSW.js +0 -2
  323. package/dist/cli/chunks/memory-backend-NOYRJTBH.js +0 -2
  324. package/dist/cli/chunks/memory-handlers-YEQ4LSIX.js +0 -2
  325. package/dist/cli/chunks/protocol-executor-OL36TRHK.js +0 -2
  326. package/dist/cli/chunks/qe-reasoning-bank-C4QW56VE.js +0 -2
  327. package/dist/cli/chunks/queen-coordinator-FDDIA6BW.js +0 -2
  328. package/dist/cli/chunks/router-RRKX62UE.js +0 -2
  329. package/dist/cli/chunks/routing-feedback-NRJJVC35.js +0 -2
  330. package/dist/cli/chunks/rvf-native-adapter-TQLQYN7Y.js +0 -2
  331. package/dist/cli/chunks/safe-db-COFZGOYL.js +0 -2
  332. package/dist/cli/chunks/schedule-QAMKOCVJ.js +0 -2
  333. package/dist/cli/chunks/scheduler-RFETEEGY.js +0 -2
  334. package/dist/cli/chunks/shared-rvf-adapter-QNA66NKB.js +0 -2
  335. package/dist/cli/chunks/sqlite-persistence-43TV2RI3.js +0 -2
  336. package/dist/cli/chunks/unified-memory-VSSMXGHP.js +0 -2
  337. package/dist/cli/chunks/unified-memory-hnsw-ZV324XYA.js +0 -2
  338. package/dist/cli/chunks/unified-persistence-EE2UVIXW.js +0 -2
  339. package/dist/cli/chunks/visual-security-LWH7LME7.js +0 -2
  340. package/dist/cli/chunks/witness-chain-3YAV5SLZ.js +0 -2
  341. package/dist/cli/chunks/workflow-orchestrator-4UG2CNYN.js +0 -2
@@ -1,28 +1,28 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as Ie}from"./chunk-G7LVJXZR.js";import{c as De}from"./chunk-WQX2Q42U.js";import{a as ne,b as ue,c as be,d as Ce,e as Pe,f as Se,g as Ee,h as Re,i as xe,j as _e,k as $e}from"./chunk-WYSM5565.js";import"./chunk-ZXWHKLZN.js";import{a as Ae}from"./chunk-HEUAPPKE.js";import"./chunk-RBHWBTKA.js";import"./chunk-VKJLHKLY.js";import"./chunk-667A24A4.js";import"./chunk-YDBBXRH7.js";import"./chunk-6ZJROHI3.js";import"./chunk-LPSIKIE2.js";import{b as x,d as te}from"./chunk-CZEQFAKE.js";import{a as S,b as we,c as ee}from"./chunk-LIEKDXTS.js";import"./chunk-DCZV4QTP.js";import{a as _,b as de}from"./chunk-ZZAZQKOA.js";import"./chunk-GHBQVPJT.js";import"./chunk-KQYKPEY6.js";import"./chunk-PYAITX6B.js";import"./chunk-N5SS5YIS.js";import"./chunk-3E4VPGNW.js";import"./chunk-REFFJUYT.js";import"./chunk-BZ4OMPVJ.js";import"./chunk-IX5LUHCN.js";import{a as ce}from"./chunk-YCK464TF.js";ee();ee();var y=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:we(s),durationMs:Date.now()-t,message:`${this.description} failed: ${S(s)}`}}}checkDependencies(e){if(!this.requiresPhases?.length)return!0;for(let t of this.requiresPhases)if(!e.results.get(t)?.success)return e.services.warn(`Phase ${this.name} requires ${t} which has not completed`),!1;return!0}checkEnhancements(e){if(!this.requiresEnhancements?.length)return!0;for(let t of this.requiresEnhancements)if(!(t==="claudeFlow"?e.enhancements.claudeFlow:t==="ruvector"?e.enhancements.ruvector:!1))return e.services.warn(`Phase ${this.name} requires ${t} which is not available`),!1;return!0}};te();de();import{existsSync as q}from"fs";import{join as T}from"path";var N=class extends y{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=q(T(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,c=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:c,v2Detection:s}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),s=T(e,".agentic-qe","config"),n=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=q(t),i=q(s),c=q(n),d=q(o),u=q(T(e,".agentic-qe","config.yaml")),m,p=!1;return r&&(m=this.readVersionFromDb(t),m?p=m.startsWith("3."):m="2.x.x"),{detected:!p&&r&&(!m?.startsWith("3.")||d&&!u),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:c?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:c,version:m}}readVersionFromDb(e){try{let t=_(e,{readonly:!0,fileMustExist:!0});try{if(!t.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as Ie}from"./chunk-XE4YKDIM.js";import{c as De}from"./chunk-FOAWHNOP.js";import{a as ne,b as ue,c as we,d as Ce,e as Pe,f as Se,g as Ee,h as Re,i as xe,j as _e,k as $e}from"./chunk-YQJBE6NX.js";import"./chunk-W7XVEWKQ.js";import{a as Ae}from"./chunk-DUF733Z7.js";import"./chunk-TVHWI77X.js";import"./chunk-EAIPJSKH.js";import"./chunk-7MXQV7RB.js";import"./chunk-X2FLWV5C.js";import{b as x,d as te}from"./chunk-WB6TI6Q3.js";import"./chunk-5Z6PYYWK.js";import"./chunk-NZQYNUGM.js";import{a as S,b as ke,c as ee}from"./chunk-K6MFAVXK.js";import"./chunk-RBDAHW2M.js";import{a as _,b as de}from"./chunk-CFLA2GBS.js";import"./chunk-EJXRBAQF.js";import"./chunk-N6SIKSCO.js";import"./chunk-5WWQLPB4.js";import"./chunk-7OVVBBOZ.js";import"./chunk-G2U7Q6V6.js";import"./chunk-CUSLB7MB.js";import"./chunk-DMF4Z2M6.js";import"./chunk-AKFRM4IO.js";import{a as ce}from"./chunk-BMS7WFDB.js";ee();ee();var y=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:ke(s),durationMs:Date.now()-t,message:`${this.description} failed: ${S(s)}`}}}checkDependencies(e){if(!this.requiresPhases?.length)return!0;for(let t of this.requiresPhases)if(!e.results.get(t)?.success)return e.services.warn(`Phase ${this.name} requires ${t} which has not completed`),!1;return!0}checkEnhancements(e){if(!this.requiresEnhancements?.length)return!0;for(let t of this.requiresEnhancements)if(!(t==="claudeFlow"?e.enhancements.claudeFlow:t==="ruvector"?e.enhancements.ruvector:!1))return e.services.warn(`Phase ${this.name} requires ${t} which is not available`),!1;return!0}};te();de();import{existsSync as j}from"fs";import{join as T}from"path";var N=class extends y{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=j(T(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,c=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:c,v2Detection:s}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),s=T(e,".agentic-qe","config"),n=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=j(t),i=j(s),c=j(n),d=j(o),u=j(T(e,".agentic-qe","config.yaml")),m,p=!1;return r&&(m=this.readVersionFromDb(t),m?p=m.startsWith("3."):m="2.x.x"),{detected:!p&&r&&(!m?.startsWith("3.")||d&&!u),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:c?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:c,version:m}}readVersionFromDb(e){try{let t=_(e,{readonly:!0,fileMustExist:!0});try{if(!t.prepare(`
3
3
  SELECT name FROM sqlite_master
4
4
  WHERE type='table' AND name='kv_store'
5
5
  `).get()){t.close();return}let n=t.prepare(`
6
6
  SELECT value FROM kv_store
7
7
  WHERE key = 'aqe_version' AND namespace = '_system'
8
- `).get();return t.close(),n?x(n.value):void 0}catch{t.close();return}}catch{return}}};var Q=class extends y{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await be(e.projectRoot).analyze();return e.analysis=s,e.services.log(` Project: ${s.projectName}`),e.services.log(` Languages: ${s.languages.map(n=>n.name).join(", ")}`),e.services.log(` Frameworks: ${s.frameworks.map(n=>n.name).join(", ")}`),s}};var L=class extends y{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=Ce({minimal:e.options.minimal}).recommend(e.analysis);return s=this.applyOptions(s,e),e.config=s,e.services.log(` Version: ${s.version}`),e.services.log(` Learning: ${s.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${s.workers.enabled.length}`),s}applyOptions(e,t){let{options:s}=t;return s.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),s.skipPatterns&&(e.learning.pretrainedPatterns=!1),s.wizardAnswers&&(e=this.applyWizardAnswers(e,s.wizardAnswers)),e}applyWizardAnswers(e,t){switch(t["project-type"]&&t["project-type"]!=="auto"&&(e.project.type=t["project-type"]),t["learning-mode"]){case"full":e.learning.enabled=!0,e.learning.embeddingModel="transformer";break;case"basic":e.learning.enabled=!0,e.learning.embeddingModel="hash";break;case"disabled":e.learning.enabled=!1;break}return t["load-patterns"]===!1&&(e.learning.pretrainedPatterns=!1),t.hooks===!1&&(e.hooks.claudeCode=!1),t.workers===!1&&(e.workers.daemonAutoStart=!1),t.skills===!1&&(e.skills.install=!1),e}};import{existsSync as V,mkdirSync as pe}from"fs";import{join as B}from"path";var H=class extends y{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async run(e){let{projectRoot:t}=e,s=B(t,"vectors.db");V(s)&&e.services.log(` \u26A0 Stale vectors.db detected at ${s}
8
+ `).get();return t.close(),n?x(n.value):void 0}catch{t.close();return}}catch{return}}};var Q=class extends y{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await we(e.projectRoot).analyze();return e.analysis=s,e.services.log(` Project: ${s.projectName}`),e.services.log(` Languages: ${s.languages.map(n=>n.name).join(", ")}`),e.services.log(` Frameworks: ${s.frameworks.map(n=>n.name).join(", ")}`),s}};var L=class extends y{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=Ce({minimal:e.options.minimal}).recommend(e.analysis);return s=this.applyOptions(s,e),e.config=s,e.services.log(` Version: ${s.version}`),e.services.log(` Learning: ${s.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${s.workers.enabled.length}`),s}applyOptions(e,t){let{options:s}=t;return s.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),s.skipPatterns&&(e.learning.pretrainedPatterns=!1),s.wizardAnswers&&(e=this.applyWizardAnswers(e,s.wizardAnswers)),e}applyWizardAnswers(e,t){switch(t["project-type"]&&t["project-type"]!=="auto"&&(e.project.type=t["project-type"]),t["learning-mode"]){case"full":e.learning.enabled=!0,e.learning.embeddingModel="transformer";break;case"basic":e.learning.enabled=!0,e.learning.embeddingModel="hash";break;case"disabled":e.learning.enabled=!1;break}return t["load-patterns"]===!1&&(e.learning.pretrainedPatterns=!1),t.hooks===!1&&(e.hooks.claudeCode=!1),t.workers===!1&&(e.workers.daemonAutoStart=!1),t.skills===!1&&(e.skills.install=!1),e}};import{existsSync as B,mkdirSync as pe}from"fs";import{join as V}from"path";var H=class extends y{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async run(e){let{projectRoot:t}=e,s=V(t,"vectors.db");B(s)&&e.services.log(` \u26A0 Stale vectors.db detected at ${s}
9
9
  This file is left over from @ruvector/router (pre-v3.9.6).
10
10
  It is no longer read or written by AQE. Safe to delete:
11
- rm "${s}"`);let n=B(t,".agentic-qe");V(n)||pe(n,{recursive:!0});let o=B(n,"workers");V(o)||pe(o,{recursive:!0});let r=B(n,"data");V(r)||pe(r,{recursive:!0});let i=B(n,"memory.db"),c=!V(i);try{let{initializeUnifiedMemory:d,resetUnifiedMemory:u}=await import("./unified-memory-VSSMXGHP.js"),m=await d({dbPath:i,walMode:!0,busyTimeout:5e3}),h=m.getStats().tables.map(A=>A.name);await m.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:ne()},"_system");let w=m.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return u(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${w}`),e.services.log(` Tables: ${h.length} (v3 full schema)`),{dbPath:i,created:c,tablesCreated:h,schemaVersion:w}}catch(d){throw new Error(`SQLite persistence initialization FAILED: ${d}
11
+ rm "${s}"`);let n=V(t,".agentic-qe");B(n)||pe(n,{recursive:!0});let o=V(n,"workers");B(o)||pe(o,{recursive:!0});let r=V(n,"data");B(r)||pe(r,{recursive:!0});let i=V(n,"memory.db"),c=!B(i);try{let{initializeUnifiedMemory:d,resetUnifiedMemory:u}=await import("./unified-memory-YDKXKW3D.js"),m=await d({dbPath:i,walMode:!0,busyTimeout:5e3}),h=m.getStats().tables.map(A=>A.name);await m.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:ne()},"_system");let k=m.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return u(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${k}`),e.services.log(` Tables: ${h.length} (v3 full schema)`),{dbPath:i,created:c,tablesCreated:h,schemaVersion:k}}catch(d){throw new Error(`SQLite persistence initialization FAILED: ${d}
12
12
  Database path: ${i}
13
- Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as se,mkdirSync as me,writeFileSync as je}from"fs";import{join as $}from"path";var W=class extends y{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:s,options:n}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=$(s,".agentic-qe","data");se(o)||me(o,{recursive:!0});let r=$(o,"hnsw");se(r)||me(r,{recursive:!0});let i=$(o,"learning-config.json"),c={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:$(o,"memory.db"),hnswIndexPath:$(r,"index.bin"),initialized:new Date().toISOString()};je(i,JSON.stringify(c,null,2),"utf-8");let d=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(d=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${d}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:d}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");se(s)||me(s,{recursive:!0});let n=$(s,"index.json");return se(n)||je(n,JSON.stringify({version:ne(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};te();de();import{existsSync as Je,statSync as Xe}from"fs";import{join as re}from"path";var qe=3e4,Te=18e4,Me=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.agentic-qe/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/__pycache__/**","**/.pytest_cache/**","**/target/**","**/vendor/**","**/.venv/**","**/venv/**","**/.tox/**","**/*.min.js","**/*.min.css","**/*.bundle.js","**/*.map","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/Pipfile.lock","**/poetry.lock","**/.env","**/.env.*"],G=class extends y{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){let t=process.env.AQE_SKIP_CODE_INDEX;return t==="1"||t==="true"?(e.services.log(" Code intelligence skipped (AQE_SKIP_CODE_INDEX=1)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):e.options.skipCodeIndex?(e.services.log(" Code intelligence skipped (--skip-code-index)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):!0}async run(e){let{projectRoot:t}=e,s=re(t,".agentic-qe","memory.db");if(!Je(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=_(s);try{if(!this.checkCodeIntelligenceIndex(n))return n.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(n);if(!r){let d=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${d} entries)`),{status:"existing",entries:d}}let i=this.getKGEntryCount(n);n.close();let c=await this.findChangedFiles(t,r);return c.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${c.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,c))}catch(o){try{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
13
+ Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as se,mkdirSync as me,writeFileSync as qe}from"fs";import{join as $}from"path";var W=class extends y{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:s,options:n}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=$(s,".agentic-qe","data");se(o)||me(o,{recursive:!0});let r=$(o,"hnsw");se(r)||me(r,{recursive:!0});let i=$(o,"learning-config.json"),c={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:$(o,"memory.db"),hnswIndexPath:$(r,"index.bin"),initialized:new Date().toISOString()};qe(i,JSON.stringify(c,null,2),"utf-8");let d=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(d=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${d}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:d}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");se(s)||me(s,{recursive:!0});let n=$(s,"index.json");return se(n)||qe(n,JSON.stringify({version:ne(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};te();de();import{existsSync as Je,statSync as Xe}from"fs";import{join as re}from"path";var je=3e4,Te=18e4,Me=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.agentic-qe/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/__pycache__/**","**/.pytest_cache/**","**/target/**","**/vendor/**","**/.venv/**","**/venv/**","**/.tox/**","**/*.min.js","**/*.min.css","**/*.bundle.js","**/*.map","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/Pipfile.lock","**/poetry.lock","**/.env","**/.env.*"],U=class extends y{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){let t=process.env.AQE_SKIP_CODE_INDEX;return t==="1"||t==="true"?(e.services.log(" Code intelligence skipped (AQE_SKIP_CODE_INDEX=1)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):e.options.skipCodeIndex?(e.services.log(" Code intelligence skipped (--skip-code-index)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):!0}async run(e){let{projectRoot:t}=e,s=re(t,".agentic-qe","memory.db");if(!Je(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=_(s);try{if(!this.checkCodeIntelligenceIndex(n))return n.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(n);if(!r){let d=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${d} entries)`),{status:"existing",entries:d}}let i=this.getKGEntryCount(n);n.close();let c=await this.findChangedFiles(t,r);return c.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${c.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,c))}catch(o){try{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
14
14
  SELECT COUNT(*) as count FROM kv_store
15
15
  WHERE namespace = 'code-intelligence:kg'
16
16
  `).get().count>0}catch{return!1}}getKGEntryCount(e){try{return e.prepare(`
17
17
  SELECT COUNT(*) as count FROM kv_store
18
18
  WHERE namespace LIKE 'code-intelligence:kg%'
19
- `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-RLCAQW6I.js"),r=re(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:c}=await Ie(i,!0),d=new o(c,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0});try{let u;n?u=n:u=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Me})).map(f=>re(e,f)),t.services.log(` Scanning ${u.length} source files...`);let m=await this.runBoundedScan(d,u,s,t);if(m.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${Te/1e3}s phase cap. Indexed ${m.entries} entries before timeout. Last file: ${m.timeoutFile??"(unknown)"}. Init is continuing \u2014 re-run 'aqe code index' later, or report this file to https://github.com/proffesor-for-testing/agentic-qe/issues.`),m;if(m.status==="indexed"){let p=s?"Delta indexed":"Indexed";t.services.log(` ${p} ${m.entries} entries to ${r}`),await this.buildHypergraph(r,u,t)}return m}finally{try{d.destroy()}catch{}try{await c.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,c="",d=Date.now(),u=!1;s||await e.clear();let m=n.projectRoot,p=f=>f.startsWith(m)?f.slice(m.length+1):f;for(let f of t){if(Date.now()-d>Te){u=!0;break}c=f,n.services.log(` [${i+1}/${t.length}] ${p(f)}`);try{let v=await this.withTimeout(e.index({paths:[f],incremental:!0,includeTests:!0}),qe,f);v.success&&(o+=v.value.nodesCreated,r+=v.value.edgesCreated)}catch(v){let w=v instanceof Error?v.message:String(v);w.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(f)} \u2014 indexing exceeded ${qe/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(f)}: ${w}`)}i++}let h=o+r;return u?{status:"timeout",entries:h,timeoutFile:c}:{status:"indexed",entries:h}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-NP7JW32L.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-IRTPRX6K.js"),r=_(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),c=await n(t),d=await i.buildFromIndexResult(c);r.close(),d.nodesCreated+d.edgesCreated>0&&s.services.log(` Hypergraph: ${d.nodesCreated} nodes, ${d.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
19
+ `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-V3DX6ZCX.js"),r=re(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:c}=await Ie(i,!0),d=new o(c,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0});try{let u;n?u=n:u=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Me})).map(f=>re(e,f)),t.services.log(` Scanning ${u.length} source files...`);let m=await this.runBoundedScan(d,u,s,t);if(m.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${Te/1e3}s phase cap. Indexed ${m.entries} entries before timeout. Last file: ${m.timeoutFile??"(unknown)"}. Init is continuing \u2014 re-run 'aqe code index' later, or report this file to https://github.com/proffesor-for-testing/agentic-qe/issues.`),m;if(m.status==="indexed"){let p=s?"Delta indexed":"Indexed";t.services.log(` ${p} ${m.entries} entries to ${r}`),await this.buildHypergraph(r,u,t)}return m}finally{try{d.destroy()}catch{}try{await c.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,c="",d=Date.now(),u=!1;s||await e.clear();let m=n.projectRoot,p=f=>f.startsWith(m)?f.slice(m.length+1):f;for(let f of t){if(Date.now()-d>Te){u=!0;break}c=f,n.services.log(` [${i+1}/${t.length}] ${p(f)}`);try{let v=await this.withTimeout(e.index({paths:[f],incremental:!0,includeTests:!0}),je,f);v.success&&(o+=v.value.nodesCreated,r+=v.value.edgesCreated)}catch(v){let k=v instanceof Error?v.message:String(v);k.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(f)} \u2014 indexing exceeded ${je/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(f)}: ${k}`)}i++}let h=o+r;return u?{status:"timeout",entries:h,timeoutFile:c}:{status:"indexed",entries:h}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-4ABP5WCP.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-JOQ6TERZ.js"),r=_(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),c=await n(t),d=await i.buildFromIndexResult(c);r.close(),d.nodesCreated+d.edgesCreated>0&&s.services.log(` Hypergraph: ${d.nodesCreated} nodes, ${d.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
20
20
  SELECT value FROM kv_store
21
21
  WHERE namespace = 'code-intelligence:kg'
22
22
  AND key = 'metadata:index'
23
- `).get();if(!t)return null;let s=x(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let n=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Me}),o=t.getTime(),r=[];for(let i of n){let c=re(e,i);try{Xe(c).mtimeMs>o&&r.push(c)}catch{}}return r}};te();import{existsSync as P,mkdirSync as oe,readFileSync as Oe,writeFileSync as M}from"fs";import{join as b}from"path";var U=class extends y{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.config?.hooks?.claudeCode??!0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.hooks.claudeCode)return{configured:!1,settingsPath:"",hookTypes:[],existingAqeDetected:!1};let n=b(s,".claude");P(n)||oe(n,{recursive:!0});let o=b(n,"hooks");P(o)||oe(o,{recursive:!0});let r=b(n,"settings.json"),i={};if(P(r))try{let v=Oe(r,"utf-8");i=x(v)}catch{i={}}let c=this.generateHooksConfig(t,s),d=Object.keys(c),u=i.hooks||{},m=this.hasExistingAqeHooks(u);m&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=Se(u,c);let p=i.env||{};i.env={...p,...Ee(t)};let h=Re(t,s);for(let[v,w]of Object.entries(h))if(v==="_aqePermissions"){let A=i.permissions||{},le=A.allow||[],I=w,g=[...new Set([...le,...I])];i.permissions={...A,allow:g}}else i[v]=w;let f=i.enabledMcpjsonServers||[];f=f.filter(v=>v!=="aqe"),f.includes("agentic-qe")||f.push("agentic-qe"),i.enabledMcpjsonServers=f,M(r,JSON.stringify(i,null,2),"utf-8"),this.writeHooksReadme(o,d),this.installHookAssets(o,e);try{let v=Oe(r,"utf-8"),A=x(v).hooks;(!A||!this.hasExistingAqeHooks(A))&&e.services.log(" WARNING: settings.json written but AQE hooks not detected \u2014 check settings-merge logic")}catch{e.services.log(" WARNING: Could not verify settings.json after write")}return e.services.log(` Settings: ${r}`),e.services.log(` Hooks dir: ${o}`),e.services.log(` Hook types: ${d.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:d,existingAqeDetected:m}}writeHooksReadme(e,t){let s=b(e,"README.txt");if(P(s))return;let n=["AQE Hooks Directory","====================","","Claude Code hooks are configured in .claude/settings.json (not as files here).","This directory contains supporting infrastructure for the learning system.","","Configured hook types: "+t.join(", "),"","Files:"," settings.json \u2014 Hook definitions (in parent .claude/ directory)"," helpers/brain-checkpoint.cjs \u2014 Auto-exports brain to aqe.rvf on session end"," cross-phase-memory.yaml \u2014 QCSD feedback loop configuration","","Manual testing:"," npx agentic-qe hooks session-start --session-id test --json",' npx agentic-qe hooks route --task "generate tests" --json'," npx agentic-qe hooks post-edit --file src/example.ts --success --json",""].join(`
24
- `);M(s,n,"utf-8")}installHookAssets(e,t){let{projectRoot:s}=t;this.installBrainCheckpoint(s,t),this.installStatusline(s,t);let n=b(e,"cross-phase-memory.yaml");if(!P(n)){let r=[b(s,"v3","assets","hooks","cross-phase-memory.yaml"),b(s,"assets","hooks","cross-phase-memory.yaml"),b(s,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let c of r)if(P(c)){let{copyFileSync:d}=ce("fs");d(c,n),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||M(n,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
25
- `),"utf-8")}let o=b(e,"v3-domain-workers.json");P(o)||M(o,JSON.stringify({version:"3.0",workers:[{name:"pattern-consolidator",interval:"5m",enabled:!0},{name:"routing-accuracy-monitor",interval:"10m",enabled:!0},{name:"coverage-gap-scanner",interval:"15m",enabled:!0},{name:"flaky-test-detector",interval:"30m",enabled:!0}]},null,2),"utf-8")}hasExistingAqeHooks(e){for(let t of Object.values(e))if(Array.isArray(t)){for(let s of t)if(Pe(s))return!0}return!1}installBrainCheckpoint(e,t){let s=b(e,".claude","helpers");P(s)||oe(s,{recursive:!0});let n=b(s,"brain-checkpoint.cjs"),o=[b(e,".claude","helpers","brain-checkpoint.cjs"),b(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(P(r)&&r!==n){let{copyFileSync:i}=ce("fs");i(r,n),t.services.log(" Installed brain-checkpoint.cjs (copied)");return}P(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=b(e,".claude","helpers");P(s)||oe(s,{recursive:!0});let n=b(s,"statusline-v3.cjs"),o=[b(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),b(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(P(r)&&r!==n){let{copyFileSync:i}=ce("fs");i(r,n),t.services.log(" Installed statusline-v3.cjs (copied)");return}P(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}generateMinimalStatuslineScript(){return`#!/usr/bin/env node
23
+ `).get();if(!t)return null;let s=x(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let n=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Me}),o=t.getTime(),r=[];for(let i of n){let c=re(e,i);try{Xe(c).mtimeMs>o&&r.push(c)}catch{}}return r}};te();import{existsSync as P,mkdirSync as oe,readFileSync as Oe,writeFileSync as M}from"fs";import{join as w,dirname as Ze}from"path";import{fileURLToPath as et}from"url";var tt=et(import.meta.url),kn=Ze(tt),G=class extends y{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.config?.hooks?.claudeCode??!0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.hooks.claudeCode)return{configured:!1,settingsPath:"",hookTypes:[],existingAqeDetected:!1};let n=w(s,".claude");P(n)||oe(n,{recursive:!0});let o=w(n,"hooks");P(o)||oe(o,{recursive:!0});let r=w(n,"settings.json"),i={};if(P(r))try{let v=Oe(r,"utf-8");i=x(v)}catch{i={}}let c=this.generateHooksConfig(t,s),d=Object.keys(c),u=i.hooks||{},m=this.hasExistingAqeHooks(u);m&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=Se(u,c);let p=i.env||{};i.env={...p,...Ee(t)};let h=Re(t,s);for(let[v,k]of Object.entries(h))if(v==="_aqePermissions"){let A=i.permissions||{},le=A.allow||[],I=k,g=[...new Set([...le,...I])];i.permissions={...A,allow:g}}else i[v]=k;let f=i.enabledMcpjsonServers||[];f=f.filter(v=>v!=="aqe"),f.includes("agentic-qe")||f.push("agentic-qe"),i.enabledMcpjsonServers=f,M(r,JSON.stringify(i,null,2),"utf-8"),this.writeHooksReadme(o,d),this.installHookAssets(o,e);try{let v=Oe(r,"utf-8"),A=x(v).hooks;(!A||!this.hasExistingAqeHooks(A))&&e.services.log(" WARNING: settings.json written but AQE hooks not detected \u2014 check settings-merge logic")}catch{e.services.log(" WARNING: Could not verify settings.json after write")}return e.services.log(` Settings: ${r}`),e.services.log(` Hooks dir: ${o}`),e.services.log(` Hook types: ${d.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:d,existingAqeDetected:m}}writeHooksReadme(e,t){let s=w(e,"README.txt");if(P(s))return;let n=["AQE Hooks Directory","====================","","Claude Code hooks are configured in .claude/settings.json (not as files here).","This directory contains supporting infrastructure for the learning system.","","Configured hook types: "+t.join(", "),"","Files:"," settings.json \u2014 Hook definitions (in parent .claude/ directory)"," helpers/brain-checkpoint.cjs \u2014 Auto-exports brain to aqe.rvf on session end"," cross-phase-memory.yaml \u2014 QCSD feedback loop configuration","","Manual testing:"," npx agentic-qe hooks session-start --session-id test --json",' npx agentic-qe hooks route --task "generate tests" --json'," npx agentic-qe hooks post-edit --file src/example.ts --success --json",""].join(`
24
+ `);M(s,n,"utf-8")}installHookAssets(e,t){let{projectRoot:s}=t;this.installBrainCheckpoint(s,t),this.installStatusline(s,t);let n=w(e,"cross-phase-memory.yaml");if(!P(n)){let r=[w(s,"v3","assets","hooks","cross-phase-memory.yaml"),w(s,"assets","hooks","cross-phase-memory.yaml"),w(s,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let c of r)if(P(c)){let{copyFileSync:d}=ce("fs");d(c,n),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||M(n,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
25
+ `),"utf-8")}let o=w(e,"v3-domain-workers.json");P(o)||M(o,JSON.stringify({version:"3.0",workers:[{name:"pattern-consolidator",interval:"5m",enabled:!0},{name:"routing-accuracy-monitor",interval:"10m",enabled:!0},{name:"coverage-gap-scanner",interval:"15m",enabled:!0},{name:"flaky-test-detector",interval:"30m",enabled:!0}]},null,2),"utf-8")}hasExistingAqeHooks(e){for(let t of Object.values(e))if(Array.isArray(t)){for(let s of t)if(Pe(s))return!0}return!1}installBrainCheckpoint(e,t){let s=w(e,".claude","helpers");P(s)||oe(s,{recursive:!0});let n=w(s,"brain-checkpoint.cjs"),o=[w(e,".claude","helpers","brain-checkpoint.cjs"),w(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(P(r)&&r!==n){let{copyFileSync:i}=ce("fs");i(r,n),t.services.log(" Installed brain-checkpoint.cjs (copied)");return}P(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=w(e,".claude","helpers");P(s)||oe(s,{recursive:!0});let n=w(s,"statusline-v3.cjs"),o=[w(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),w(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(P(r)&&r!==n){let{copyFileSync:i}=ce("fs");i(r,n),t.services.log(" Installed statusline-v3.cjs (copied)");return}P(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}generateMinimalStatuslineScript(){return`#!/usr/bin/env node
26
26
  /**
27
27
  * Agentic QE v3 Statusline (minimal fallback, generated by aqe init)
28
28
  * For the full statusline, reinstall: npx agentic-qe init --auto
@@ -107,10 +107,10 @@ function verifyBrain() {
107
107
  const cmd = process.argv[2] || 'verify';
108
108
  const result = cmd === 'export' ? exportBrain() : verifyBrain();
109
109
  if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
110
- `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5e3,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',timeout:5e3,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:"npx agentic-qe hooks route --json",timeout:5e3,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',timeout:1e4,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5e3,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:"npx agentic-qe hooks session-end --save-state --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:"npx agentic-qe hooks post-route --success true --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:6e4,continueOnError:!0}]}]}}};te();import{existsSync as Ze,readFileSync as et,writeFileSync as tt}from"fs";import{join as nt}from"path";var z=class extends y{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},n=nt(t,".mcp.json"),o={};if(Ze(n))try{let i=et(n,"utf-8");o=x(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=s,tt(n,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${n}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:n,serverName:"agentic-qe"}}};import{existsSync as E,readFileSync as ot,readdirSync as it}from"fs";import{join as R}from"path";ee();import{spawnSync as st}from"node:child_process";import*as ie from"node:os";import*as Qe from"node:fs";var fe="vibium@^26.3.18",Le={platform:()=>ie.platform(),arch:()=>ie.arch(),existsSync:l=>Qe.existsSync(l)},Fe=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function rt(l=Le){if(l.platform()!=="linux"||l.arch()!=="arm64")return;let e=Fe.find(t=>l.existsSync(t));return e?{code:"linux-arm64-system-chromium-found",browserPath:e,message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. Found system browser at ${e}. Export VIBIUM_BROWSER_PATH=${e} before running vibium.`}:{code:"linux-arm64-no-system-chromium",message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system chromium was found on PATH (checked: ${Fe.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function ge(l,e,t,s){return l(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var Ve=(l,e,t)=>st(l,e,t);function Ne(l=Ve,e=5e3){let t=ge(l,"vibium",["--version"],e);if(t.status!==0)return null;let s=(t.stdout||"").trim(),n=(t.stderr||"").trim(),o=s||n;if(!o)return"unknown";let r=o.match(/v?(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);return r?r[1]:o.split(/\s+/)[0]||"unknown"}function he(l={}){let e=l.packageSpec||fe;if(l.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=l.spawner||Ve,s=l.platformProbe||Le,n=rt(s),o=Ne(t);if(o)return{status:"already-installed",version:o,packageSpec:e,platformHint:n};let r=l.npmBin||"npm",i=ge(t,r,["--version"],5e3);if(i.error||i.status!==0)return{status:"npm-unavailable",packageSpec:e,message:`npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${e}\`.`};let c=l.timeoutMs||18e4,d=ge(t,r,["install","-g",e],c);return d.status!==0?{status:"install-failed",packageSpec:e,message:d.stderr?.trim()||d.stdout?.trim()||S(d.error)||"unknown npm install failure"}:{status:"installed",version:Ne(t)||"unknown",packageSpec:e,platformHint:n}}var K=class extends y{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,c=0,d=0,u=0,m=0,p=0,h=0,f=0,v=0;if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let k=await xe({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=k.installed.length,k.errors.length>0&&e.services.warn(`Skills warnings: ${k.errors.join(", ")}`)}try{let k=await _e({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();c=k.installed.length,k.errors.length>0&&e.services.warn(`Agents warnings: ${k.errors.join(", ")}`)}catch(g){e.services.warn(`Agents install error: ${g instanceof Error?g.message:g}`)}De(s);let w;if(n.minimal)w={status:"skipped",packageSpec:fe,message:"minimal mode"};else try{let g=he({skip:!1,timeoutMs:5e3});if(g.status==="already-installed")w=g,e.services.log(` Browser engine: vibium ${w.version} (already installed)`);else switch(e.services.log(" Browser engine: installing vibium via npm (this can take 1\u20133 minutes on first run; downloads Chrome for Testing lazily)\u2026"),w=he({skip:!1}),w.status){case"installed":e.services.log(` Browser engine: vibium ${w.version} installed`);break;case"skipped":e.services.log(" Browser engine: skipped");break;case"install-failed":e.services.warn(`Browser engine install failed (qe-browser skill will be unavailable until you run \`npm install -g vibium\`): ${w.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `npm install -g vibium` to enable qe-browser");break}w?.platformHint&&e.services.warn(` Browser engine platform hint: ${w.platformHint.message}`)}catch(g){let k=g instanceof Error?g.message:String(g);e.services.warn(`Browser engine install error: ${k}
110
+ `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5e3,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',timeout:5e3,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:"npx agentic-qe hooks route --json",timeout:5e3,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',timeout:1e4,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5e3,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:"npx agentic-qe hooks session-end --save-state --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:"npx agentic-qe hooks post-route --success true --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:6e4,continueOnError:!0}]}]}}};te();import{existsSync as nt,readFileSync as st,writeFileSync as rt}from"fs";import{join as ot}from"path";var z=class extends y{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},n=ot(t,".mcp.json"),o={};if(nt(n))try{let i=st(n,"utf-8");o=x(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=s,rt(n,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${n}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:n,serverName:"agentic-qe"}}};import{existsSync as E,readFileSync as lt,readdirSync as ct}from"fs";import{join as R}from"path";ee();import{spawnSync as it}from"node:child_process";import*as ie from"node:os";import*as Qe from"node:fs";var fe="vibium@^26.3.18",Le={platform:()=>ie.platform(),arch:()=>ie.arch(),existsSync:l=>Qe.existsSync(l)},Fe=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function at(l=Le){if(l.platform()!=="linux"||l.arch()!=="arm64")return;let e=Fe.find(t=>l.existsSync(t));return e?{code:"linux-arm64-system-chromium-found",browserPath:e,message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. Found system browser at ${e}. Export VIBIUM_BROWSER_PATH=${e} before running vibium.`}:{code:"linux-arm64-no-system-chromium",message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system chromium was found on PATH (checked: ${Fe.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function ge(l,e,t,s){return l(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var Be=(l,e,t)=>it(l,e,t);function Ne(l=Be,e=5e3){let t=ge(l,"vibium",["--version"],e);if(t.status!==0)return null;let s=(t.stdout||"").trim(),n=(t.stderr||"").trim(),o=s||n;if(!o)return"unknown";let r=o.match(/v?(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);return r?r[1]:o.split(/\s+/)[0]||"unknown"}function he(l={}){let e=l.packageSpec||fe;if(l.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=l.spawner||Be,s=l.platformProbe||Le,n=at(s),o=Ne(t);if(o)return{status:"already-installed",version:o,packageSpec:e,platformHint:n};let r=l.npmBin||"npm",i=ge(t,r,["--version"],5e3);if(i.error||i.status!==0)return{status:"npm-unavailable",packageSpec:e,message:`npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${e}\`.`};let c=l.timeoutMs||18e4,d=ge(t,r,["install","-g",e],c);return d.status!==0?{status:"install-failed",packageSpec:e,message:d.stderr?.trim()||d.stdout?.trim()||S(d.error)||"unknown npm install failure"}:{status:"installed",version:Ne(t)||"unknown",packageSpec:e,platformHint:n}}var K=class extends y{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,c=0,d=0,u=0,m=0,p=0,h=0,f=0,v=0;if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let b=await xe({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=b.installed.length,b.errors.length>0&&e.services.warn(`Skills warnings: ${b.errors.join(", ")}`)}try{let b=await _e({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();c=b.installed.length,b.errors.length>0&&e.services.warn(`Agents warnings: ${b.errors.join(", ")}`)}catch(g){e.services.warn(`Agents install error: ${g instanceof Error?g.message:g}`)}De(s);let k;if(n.minimal)k={status:"skipped",packageSpec:fe,message:"minimal mode"};else try{let g=he({skip:!1,timeoutMs:5e3});if(g.status==="already-installed")k=g,e.services.log(` Browser engine: vibium ${k.version} (already installed)`);else switch(e.services.log(" Browser engine: installing vibium via npm (this can take 1\u20133 minutes on first run; downloads Chrome for Testing lazily)\u2026"),k=he({skip:!1}),k.status){case"installed":e.services.log(` Browser engine: vibium ${k.version} installed`);break;case"skipped":e.services.log(" Browser engine: skipped");break;case"install-failed":e.services.warn(`Browser engine install failed (qe-browser skill will be unavailable until you run \`npm install -g vibium\`): ${k.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `npm install -g vibium` to enable qe-browser");break}k?.platformHint&&e.services.warn(` Browser engine platform hint: ${k.platformHint.message}`)}catch(g){let b=g instanceof Error?g.message:String(g);e.services.warn(`Browser engine install error: ${b}
111
111
  qe-browser fleet skill will be unavailable until you run:
112
112
  npm install -g vibium
113
- Then re-run \`aqe init\` to verify. The rest of the AQE install will continue.`)}if(n.withN8n){let k=await $e({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();d=k.agentsInstalled.length,u=k.skillsInstalled.length,k.errors.length>0&&e.services.warn(`N8n warnings: ${k.errors.join(", ")}`)}let A=n.autoMode&&E(R(s,"opencode.json"));if(n.withOpenCode||A){let{createOpenCodeInstaller:g}=await import("./opencode-installer-2NICPXQZ.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installTools:!0,overwrite:r}).install();m=a.agentsInstalled.length,p=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${c}`),n.withN8n&&(e.services.log(` N8n agents: ${d}`),e.services.log(` N8n skills: ${u}`)),(n.withOpenCode||A)&&(e.services.log(` OpenCode agents: ${m}`),e.services.log(` OpenCode skills: ${p}`));let le=n.autoMode&&E(R(s,".kiro"));if(n.withKiro||le){let{createKiroInstaller:g}=await import("./kiro-installer-ZVOLX6AX.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();h=a.agentsInstalled.length,f=a.skillsInstalled.length,v=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${h}`),e.services.log(` Kiro skills: ${f}`),e.services.log(` Kiro hooks: ${v}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let I=[];if(n.withCopilot||n.autoMode&&E(R(s,".vscode"))){let{createCopilotInstaller:g}=await import("./copilot-installer-YXANWEVX.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("copilot"),a.errors.length>0&&e.services.warn(`Copilot warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Copilot MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Copilot rules: ${a.rulesPath}`)}if(n.withCursor||n.autoMode&&E(R(s,".cursor"))){let{createCursorInstaller:g}=await import("./cursor-installer-QIZPJ5YQ.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("cursor"),a.errors.length>0&&e.services.warn(`Cursor warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cursor MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Cursor rules: ${a.rulesPath}`)}if(n.withCline){let{createClineInstaller:g}=await import("./cline-installer-U6KRJJHQ.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("cline"),a.errors.length>0&&e.services.warn(`Cline warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cline MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Cline mode: ${a.modePath}`)}if(n.withKiloCode||n.autoMode&&E(R(s,".kilocode"))){let{createKiloCodeInstaller:g}=await import("./kilocode-installer-Q5A6WBX2.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("kilocode"),a.errors.length>0&&e.services.warn(`Kilo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Kilo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Kilo Code mode: ${a.modePath}`)}if(n.withRooCode||n.autoMode&&E(R(s,".roo"))){let{createRooCodeInstaller:g}=await import("./roocode-installer-Y5YVCVVS.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("roocode"),a.errors.length>0&&e.services.warn(`Roo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Roo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Roo Code mode: ${a.modePath}`)}if(n.withCodex||n.autoMode&&E(R(s,".codex"))){let{createCodexInstaller:g}=await import("./codex-installer-52W4TK27.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("codex"),a.errors.length>0&&e.services.warn(`Codex warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Codex MCP: ${a.configPath}`),a.agentsMdInstalled&&e.services.log(` Codex AGENTS.md: ${a.agentsMdPath}`)}if(n.withWindsurf||n.autoMode&&E(R(s,".windsurf"))){let{createWindsurfInstaller:g}=await import("./windsurf-installer-A7FNN7RB.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("windsurf"),a.errors.length>0&&e.services.warn(`Windsurf warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Windsurf MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Windsurf rules: ${a.rulesPath}`)}if(n.withContinueDev||n.autoMode&&E(R(s,".continue"))){let{createContinueDevInstaller:g}=await import("./continuedev-installer-BNUOLW2M.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("continuedev"),a.errors.length>0&&e.services.warn(`Continue.dev warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Continue.dev MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Continue.dev rules: ${a.rulesPath}`)}return I.length>0&&e.services.log(` Platforms configured: ${I.join(", ")}`),{skillsInstalled:i,agentsInstalled:c,n8nAgents:d,n8nSkills:u,openCodeAgents:m,openCodeSkills:p,kiroAgents:h,kiroSkills:f,kiroHooks:v,platformsConfigured:I,browserEngine:w}}detectVersionUpgrade(e){let t=e.config.version,s=R(e.projectRoot,".agentic-qe","config.yaml");if(E(s))try{let i=ot(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=R(e.projectRoot,".claude","agents","v3");try{return E(n)&&it(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as at,mkdirSync as lt,writeFileSync as ae}from"fs";import{join as O}from"path";var Y=class extends y{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let n=O(s,".agentic-qe","workers");at(n)||lt(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let h of t.workers.enabled)r[h]={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,lastRun:null,status:"pending"};let i=O(n,"registry.json"),c={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};ae(i,JSON.stringify(c,null,2),"utf-8");for(let h of t.workers.enabled){let f=O(n,`${h}.json`),v={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,projectRoot:s,dataDir:O(s,".agentic-qe","data"),createdAt:new Date().toISOString()};ae(f,JSON.stringify(v,null,2),"utf-8")}let d=O(n,"start-daemon.cjs");ae(d,`#!/usr/bin/env node
113
+ Then re-run \`aqe init\` to verify. The rest of the AQE install will continue.`)}if(n.withN8n){let b=await $e({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();d=b.agentsInstalled.length,u=b.skillsInstalled.length,b.errors.length>0&&e.services.warn(`N8n warnings: ${b.errors.join(", ")}`)}let A=n.autoMode&&E(R(s,"opencode.json"));if(n.withOpenCode||A){let{createOpenCodeInstaller:g}=await import("./opencode-installer-6TTN26RG.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installTools:!0,overwrite:r}).install();m=a.agentsInstalled.length,p=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${c}`),n.withN8n&&(e.services.log(` N8n agents: ${d}`),e.services.log(` N8n skills: ${u}`)),(n.withOpenCode||A)&&(e.services.log(` OpenCode agents: ${m}`),e.services.log(` OpenCode skills: ${p}`));let le=n.autoMode&&E(R(s,".kiro"));if(n.withKiro||le){let{createKiroInstaller:g}=await import("./kiro-installer-EAB26M55.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();h=a.agentsInstalled.length,f=a.skillsInstalled.length,v=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${h}`),e.services.log(` Kiro skills: ${f}`),e.services.log(` Kiro hooks: ${v}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let I=[];if(n.withCopilot||n.autoMode&&E(R(s,".vscode"))){let{createCopilotInstaller:g}=await import("./copilot-installer-D6BAQVIO.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("copilot"),a.errors.length>0&&e.services.warn(`Copilot warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Copilot MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Copilot rules: ${a.rulesPath}`)}if(n.withCursor||n.autoMode&&E(R(s,".cursor"))){let{createCursorInstaller:g}=await import("./cursor-installer-WAWSS2K2.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("cursor"),a.errors.length>0&&e.services.warn(`Cursor warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cursor MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Cursor rules: ${a.rulesPath}`)}if(n.withCline){let{createClineInstaller:g}=await import("./cline-installer-2NXQGW73.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("cline"),a.errors.length>0&&e.services.warn(`Cline warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cline MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Cline mode: ${a.modePath}`)}if(n.withKiloCode||n.autoMode&&E(R(s,".kilocode"))){let{createKiloCodeInstaller:g}=await import("./kilocode-installer-YC5RJIY4.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("kilocode"),a.errors.length>0&&e.services.warn(`Kilo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Kilo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Kilo Code mode: ${a.modePath}`)}if(n.withRooCode||n.autoMode&&E(R(s,".roo"))){let{createRooCodeInstaller:g}=await import("./roocode-installer-2LMVZOUZ.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("roocode"),a.errors.length>0&&e.services.warn(`Roo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Roo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Roo Code mode: ${a.modePath}`)}if(n.withCodex||n.autoMode&&E(R(s,".codex"))){let{createCodexInstaller:g}=await import("./codex-installer-V7PII6GL.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("codex"),a.errors.length>0&&e.services.warn(`Codex warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Codex MCP: ${a.configPath}`),a.agentsMdInstalled&&e.services.log(` Codex AGENTS.md: ${a.agentsMdPath}`)}if(n.withWindsurf||n.autoMode&&E(R(s,".windsurf"))){let{createWindsurfInstaller:g}=await import("./windsurf-installer-7AFXJTPU.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("windsurf"),a.errors.length>0&&e.services.warn(`Windsurf warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Windsurf MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Windsurf rules: ${a.rulesPath}`)}if(n.withContinueDev||n.autoMode&&E(R(s,".continue"))){let{createContinueDevInstaller:g}=await import("./continuedev-installer-GOT4TKNT.js"),a=await g({projectRoot:s,overwrite:r}).install();a.mcpConfigured&&I.push("continuedev"),a.errors.length>0&&e.services.warn(`Continue.dev warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Continue.dev MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Continue.dev rules: ${a.rulesPath}`)}return I.length>0&&e.services.log(` Platforms configured: ${I.join(", ")}`),{skillsInstalled:i,agentsInstalled:c,n8nAgents:d,n8nSkills:u,openCodeAgents:m,openCodeSkills:p,kiroAgents:h,kiroSkills:f,kiroHooks:v,platformsConfigured:I,browserEngine:k}}detectVersionUpgrade(e){let t=e.config.version,s=R(e.projectRoot,".agentic-qe","config.yaml");if(E(s))try{let i=lt(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=R(e.projectRoot,".claude","agents","v3");try{return E(n)&&ct(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as dt,mkdirSync as ut,writeFileSync as ae}from"fs";import{join as O,dirname as pt}from"path";import{fileURLToPath as mt}from"url";var gt=mt(import.meta.url),Wn=pt(gt),Y=class extends y{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let n=O(s,".agentic-qe","workers");dt(n)||ut(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let h of t.workers.enabled)r[h]={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,lastRun:null,status:"pending"};let i=O(n,"registry.json"),c={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};ae(i,JSON.stringify(c,null,2),"utf-8");for(let h of t.workers.enabled){let f=O(n,`${h}.json`),v={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,projectRoot:s,dataDir:O(s,".agentic-qe","data"),createdAt:new Date().toISOString()};ae(f,JSON.stringify(v,null,2),"utf-8")}let d=O(n,"start-daemon.cjs");ae(d,`#!/usr/bin/env node
114
114
  // AQE v3 Worker Daemon Startup Script (cross-platform)
115
115
  // Generated by aqe init
116
116
  // Starts the MCP server with background workers enabled
@@ -133,12 +133,30 @@ if (existsSync(pidFile)) {
133
133
  const ts = new Date().toISOString();
134
134
  appendFileSync(logFile, '[' + ts + '] Starting AQE v3 Worker Daemon...\\n');
135
135
 
136
- // Find the best way to run aqe-mcp
136
+ // Find the best way to run aqe-mcp.
137
+ //
138
+ // #488 B.1: candidate ordering matters for the pidfile contract. When we
139
+ // spawn the real MCP binary directly, child.pid is the long-lived process
140
+ // \u2014 \`process.kill(pid, 0)\` against the pidfile correctly reports liveness.
141
+ // When we fall back to \`npx --yes agentic-qe mcp\`, child.pid is the npx
142
+ // wrapper PID, which exits as soon as it has forked the real bundle. The
143
+ // pidfile then points at a dead process and idempotency checks misbehave.
144
+ //
145
+ // We try in order: local .bin \u2192 local node_modules bundle \u2192 global install
146
+ // via require.resolve \u2192 npx wrapper (last resort, with the caveat above).
137
147
  const candidates = [
138
148
  join(projectRoot, 'node_modules', '.bin', 'aqe-mcp'),
139
149
  join(projectRoot, 'node_modules', 'agentic-qe', 'dist', 'mcp', 'bundle.js'),
140
150
  ];
141
151
 
152
+ // Probe globally-installed agentic-qe (npm install -g) via require.resolve.
153
+ // This is the case the npx fallback used to silently cover with a bad PID.
154
+ try {
155
+ candidates.push(require.resolve('agentic-qe/dist/mcp/bundle.js'));
156
+ } catch {
157
+ // Not globally installed \u2014 fall through to npx fallback below.
158
+ }
159
+
142
160
  let mcpCmd, mcpArgs;
143
161
  const binCandidate = candidates.find(c => existsSync(c));
144
162
 
@@ -151,6 +169,7 @@ if (binCandidate && binCandidate.endsWith('bundle.js')) {
151
169
  } else {
152
170
  mcpCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
153
171
  mcpArgs = ['--yes', 'agentic-qe', 'mcp'];
172
+ appendFileSync(logFile, '[' + ts + '] WARNING: using npx fallback \u2014 daemon.pid will point at the npx wrapper, not the MCP server. \`aqe daemon status\` may misreport liveness after the wrapper exits.\\n');
154
173
  }
155
174
 
156
175
  appendFileSync(logFile, '[' + ts + '] Using: ' + mcpCmd + ' ' + mcpArgs.join(' ') + '\\n');
@@ -189,7 +208,7 @@ try {
189
208
  console.log('Daemon not running (stale PID file)');
190
209
  try { unlinkSync(pidFile); } catch {}
191
210
  }
192
- `),e.services.log(` Workers dir: ${n}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`),e.services.log(` Registry: ${i}`),{workersDir:n,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:!1,daemonPid:null}}};import{existsSync as ct,readFileSync as dt,writeFileSync as ye}from"fs";import{join as Be}from"path";var J=class extends y{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=Be(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(ct(n)){let i=dt(n,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:n,backupCreated:!1};let c=Be(s,"CLAUDE.md.backup");ye(c,i,"utf-8"),r=!0,ye(n,i+`
211
+ `),e.services.log(` Workers dir: ${n}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`),e.services.log(` Registry: ${i}`),{workersDir:n,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:!1,daemonPid:null}}};import{existsSync as ft,readFileSync as ht,writeFileSync as ye}from"fs";import{join as Ve}from"path";var J=class extends y{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=Ve(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(ft(n)){let i=ht(n,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:n,backupCreated:!1};let c=Ve(s,"CLAUDE.md.backup");ye(c,i,"utf-8"),r=!0,ye(n,i+`
193
212
 
194
213
  `+o,"utf-8")}else ye(n,o,"utf-8");return e.services.log(` Path: ${n}`),r&&e.services.log(" Backup created"),{generated:!0,path:n,backupCreated:r}}generateContent(e){let t=e.domains.enabled.slice(0,6).join(", "),s=Math.max(0,e.domains.enabled.length-6);return`## Agentic QE v3
195
214
 
@@ -353,7 +372,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
353
372
 
354
373
  ---
355
374
  *Generated by AQE v3 init - ${new Date().toISOString()}*
356
- `}};import{existsSync as D,readFileSync as ut}from"fs";import{join as F,dirname as pt}from"path";import{mkdirSync as He,writeFileSync as mt}from"fs";de();var X=class extends y{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=F(s,".agentic-qe","memory.db");n.push({name:"Database exists",passed:D(o)}),n.push({name:".agentic-qe directory",passed:D(F(s,".agentic-qe"))});let r=F(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:D(r)});let i=await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:i});let c=["Database exists",".agentic-qe directory","Config saved"],d=n.filter(u=>c.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let m=c.includes(u.name),p=u.passed?"\u2713":m?"\u2717":"\u26A0",h=!m&&!u.passed?" (optional)":"";e.services.log(` ${p} ${u.name}${h}`)}return{verified:d,versionWritten:i,configSaved:D(r),checks:n}}async writeVersionToDb(e,t){let s=F(t,".agentic-qe","memory.db");try{let n=pt(s);D(n)||He(n,{recursive:!0});let o=_(s);try{o.exec(`
375
+ `}};import{existsSync as D,readFileSync as yt}from"fs";import{join as F,dirname as vt}from"path";import{mkdirSync as He,writeFileSync as bt}from"fs";de();var X=class extends y{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=F(s,".agentic-qe","memory.db");n.push({name:"Database exists",passed:D(o)}),n.push({name:".agentic-qe directory",passed:D(F(s,".agentic-qe"))});let r=F(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:D(r)});let i=await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:i});let c=["Database exists",".agentic-qe directory","Config saved"],d=n.filter(u=>c.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let m=c.includes(u.name),p=u.passed?"\u2713":m?"\u2717":"\u26A0",h=!m&&!u.passed?" (optional)":"";e.services.log(` ${p} ${u.name}${h}`)}return{verified:d,versionWritten:i,configSaved:D(r),checks:n}}async writeVersionToDb(e,t){let s=F(t,".agentic-qe","memory.db");try{let n=vt(s);D(n)||He(n,{recursive:!0});let o=_(s);try{o.exec(`
357
376
  CREATE TABLE IF NOT EXISTS kv_store (
358
377
  key TEXT NOT NULL,
359
378
  namespace TEXT NOT NULL,
@@ -368,9 +387,9 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
368
387
  `).run("aqe_version",JSON.stringify(e),r),o.prepare(`
369
388
  INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
370
389
  VALUES (?, '_system', ?, ?)
371
- `).run("init_timestamp",JSON.stringify(new Date().toISOString()),r),o.close(),!0}catch{return o.close(),!1}}catch{return!1}}async saveConfig(e,t){let s=F(t,".agentic-qe");D(s)||He(s,{recursive:!0});let n=F(s,"config.yaml");if(D(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);mt(n,o,"utf-8")}loadExistingConfig(e){try{let t=ut(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
390
+ `).run("init_timestamp",JSON.stringify(new Date().toISOString()),r),o.close(),!0}catch{return o.close(),!1}}catch{return!1}}async saveConfig(e,t){let s=F(t,".agentic-qe");D(s)||He(s,{recursive:!0});let n=F(s,"config.yaml");if(D(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);bt(n,o,"utf-8")}loadExistingConfig(e){try{let t=yt(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
372
391
  `),n="",o="";for(let i of s){if(i.trim().startsWith("#")||i.trim()==="")continue;let c=i.match(/^(\w+):\s*(.*)$/);if(c){n=c[1],o="";let p=c[2].trim();p&&!p.startsWith('"')?t[n]=this.parseValue(p):p?t[n]=this.parseValue(p):t[n]={};continue}let d=i.match(/^ (\w+):\s*(.*)$/);if(d&&n){o=d[1];let p=d[2].trim();t[n]||(t[n]={}),p?t[n][o]=this.parseValue(p):t[n][o]={};continue}let u=i.match(/^ ([\w-]+):\s*(.*)$/);if(u&&n&&o){let p=u[1],h=u[2].trim(),f=t[n];f[o]||(f[o]={}),typeof f[o]=="object"&&!Array.isArray(f[o])&&(f[o][p]=this.parseValue(h));continue}let m=i.match(/^ - "?([^"]*)"?$/);if(m&&n&&o){let p=t[n];Array.isArray(p[o])||(p[o]=[]),p[o].push(m[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,c]of r){let d=t[i];d&&c in d&&!Array.isArray(d[c])&&(d[c]=[])}return t}catch{return null}}parseValue(e){return e==="true"?!0:e==="false"?!1:/^\d+$/.test(e)?parseInt(e,10):/^\d+\.\d+$/.test(e)?parseFloat(e):e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}mergeConfigs(e,t){if(t.domains?.enabled&&Array.isArray(t.domains.enabled)){let s=new Set(t.domains.enabled),n=new Set(e.domains.enabled);for(let r of n)s.add(r);let o=new Set(Array.isArray(t.domains?.disabled)?t.domains.disabled:[]);e.domains.enabled=Array.from(s).filter(r=>!o.has(r))}return t.domains?.disabled&&Array.isArray(t.domains.disabled)&&(e.domains.disabled=t.domains.disabled),t.learning?.enabled!==void 0&&(e.learning.enabled=t.learning.enabled),t.hooks?.claudeCode!==void 0&&(e.hooks.claudeCode=t.hooks.claudeCode),t.hooks?.preCommit!==void 0&&(e.hooks.preCommit=t.hooks.preCommit),t.hooks?.ciIntegration!==void 0&&(e.hooks.ciIntegration=t.hooks.ciIntegration),t.workers?.enabled&&Array.isArray(t.workers.enabled)&&(e.workers.enabled=t.workers.enabled),t.workers?.daemonAutoStart!==void 0&&(e.workers.daemonAutoStart=t.workers.daemonAutoStart),t.agents?.maxConcurrent!==void 0&&(e.agents.maxConcurrent=t.agents.maxConcurrent),t.agents?.defaultTimeout!==void 0&&(e.agents.defaultTimeout=t.agents.defaultTimeout),e}configToYAML(e){return["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,"#",'# NOTE: Your customizations are PRESERVED when you run "aqe init" again.','# You do NOT need to re-run "aqe init" after editing this file - changes',"# take effect immediately. The following settings are merged on reinstall:","# - domains.enabled (custom domains like visual-accessibility)","# - domains.disabled","# - learning.enabled","# - hooks.* preferences","# - workers.enabled","# - agents.maxConcurrent and defaultTimeout","",`version: "${e.version}"`,"","project:",` name: "${e.project.name}"`,` root: "${e.project.root}"`,` type: "${e.project.type}"`,"","learning:",` enabled: ${e.learning.enabled}`,` embeddingModel: "${e.learning.embeddingModel}"`," hnswConfig:",` M: ${e.learning.hnswConfig.M}`,` efConstruction: ${e.learning.hnswConfig.efConstruction}`,` efSearch: ${e.learning.hnswConfig.efSearch}`,` qualityThreshold: ${e.learning.qualityThreshold}`,` promotionThreshold: ${e.learning.promotionThreshold}`,` pretrainedPatterns: ${e.learning.pretrainedPatterns}`,"","routing:",` mode: "${e.routing.mode}"`,` confidenceThreshold: ${e.routing.confidenceThreshold}`,` feedbackEnabled: ${e.routing.feedbackEnabled}`,"","# ADR-092: Advisor Strategy \u2014 agents consult a stronger model for strategic guidance","# Set provider/model to override auto-detection from environment API keys","advisor:",' # provider: "openrouter" # openrouter | claude | ollama (auto-detected if not set)',' # model: "anthropic/claude-opus-4.7" # provider-specific model ID',' # maxUses: "3" # per-task advisor call cap',' redact: "strict" # strict | balanced | off',"","workers:"," enabled:",...e.workers.enabled.map(s=>` - "${s}"`)," intervals:",...Object.entries(e.workers.intervals).map(([s,n])=>` ${s}: ${n}`),` maxConcurrent: ${e.workers.maxConcurrent}`,` daemonAutoStart: ${e.workers.daemonAutoStart}`,"","hooks:",` claudeCode: ${e.hooks.claudeCode}`,` preCommit: ${e.hooks.preCommit}`,` ciIntegration: ${e.hooks.ciIntegration}`,"","skills:",` install: ${e.skills.install}`,` installV2: ${e.skills.installV2}`,` installV3: ${e.skills.installV3}`,` overwrite: ${e.skills.overwrite}`,"","domains:"," enabled:",...e.domains.enabled.map(s=>` - "${s}"`)," disabled:",...e.domains.disabled.map(s=>` - "${s}"`),"","agents:",` maxConcurrent: ${e.agents.maxConcurrent}`,` defaultTimeout: ${e.agents.defaultTimeout}`,""].join(`
373
- `)}};ee();import{existsSync as j,mkdirSync as We,readdirSync as Ge,copyFileSync as Ue}from"fs";import{join as C,dirname as gt}from"path";import{fileURLToPath as ft}from"url";var ht=ft(import.meta.url),ze=gt(ht);function yt(){let l=[C(ze,"../../assets/governance"),C(ze,"../assets/governance")],e=Ae(import.meta.url);e&&(l.push(C(e,"assets/governance")),l.push(C(e,"dist/assets/governance"))),l.push(C(process.cwd(),"node_modules/agentic-qe/assets/governance")),l.push(C(process.cwd(),"assets/governance"));for(let t of l)if(j(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${l.join(", ")}`)}var ve=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=yt()}async install(){let e=[],t=[],s=[],n=C(this.projectRoot,".claude","guidance"),o=C(n,"shards");try{We(n,{recursive:!0}),this.skipShards||We(o,{recursive:!0})}catch(u){return s.push(`Failed to create governance directory: ${S(u)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=C(this.assetsPath,"constitution.md"),c=C(n,"constitution.md");if(j(i))try{!j(c)||this.overwrite?(Ue(i,c),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(u){s.push(`Failed to install constitution.md: ${S(u)}`)}else s.push("constitution.md not found in assets");let d=0;if(!this.skipShards){let u=C(this.assetsPath,"shards");if(j(u))try{let m=Ge(u).filter(p=>p.endsWith(".shard.md"));for(let p of m){let h=C(u,p),f=C(o,p);try{!j(f)||this.overwrite?(Ue(h,f),e.push(`shards/${p}`),d++):t.push(`shards/${p}`)}catch(v){s.push(`Failed to install ${p}: ${S(v)}`)}}}catch(m){s.push(`Failed to read shards directory: ${S(m)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:d}}isInstalled(){let e=C(this.projectRoot,".claude","guidance","constitution.md");return j(e)}getInstalledShards(){let e=C(this.projectRoot,".claude","guidance","shards");if(!j(e))return[];try{return Ge(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function Ke(l){return new ve(l)}var Z=class extends y{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noGovernance?(e.services.log(" Governance skipped (--no-governance flag)"),!1):e.options.minimal?(e.services.log(" Governance skipped (minimal mode)"),!1):!0}async run(e){let{projectRoot:t,options:s}=e,n=s.upgrade,o=Ke({projectRoot:t,overwrite:n});if(o.isInstalled()&&!n){let i=o.getInstalledShards();return e.services.log(` Governance already installed (${i.length} shards)`),e.services.log(" Use --upgrade to overwrite existing files"),{filesInstalled:0,filesSkipped:1+i.length,constitutionInstalled:!1,shardsInstalled:0,governanceDir:`${t}/.claude/guidance`,skippedByFlag:!1}}let r=await o.install();if(r.errors.length>0)for(let i of r.errors)e.services.warn(` ${i}`);return e.services.log(` Constitution: ${r.constitutionInstalled?"installed":"skipped"}`),e.services.log(` Shards: ${r.shardsInstalled} installed, ${r.skipped.filter(i=>i.startsWith("shards/")).length} skipped`),r.installed.length>0&&(e.services.log(" Governance enabled (non-strict mode by default)"),e.services.log(" Set GOVERNANCE_STRICT_MODE=true for strict enforcement")),{filesInstalled:r.installed.length,filesSkipped:r.skipped.length,constitutionInstalled:r.constitutionInstalled,shardsInstalled:r.shardsInstalled,governanceDir:r.governanceDir,skippedByFlag:!1}}};var vt=new N,kt=new Q,wt=new L,bt=new H,Ct=new W,It=new G,Pt=new U,St=new z,Et=new K,Rt=new Y,At=new J,xt=new X,_t=new Z;function Ye(){return[vt,kt,wt,bt,Ct,It,Pt,St,Et,_t,Rt,At,xt]}var ke=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??Ye()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,minimal:e.minimal,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp},config:{},enhancements:{claudeFlow:!1,ruvector:!1},results:new Map,services:{log:s=>console.log(s),warn:s=>console.warn(s),error:s=>console.error(s)}}}async initialize(){let e=Date.now(),t=[];try{let s=[...this.phases].sort((n,o)=>n.order-o.order);for(let n of s){if(!await n.shouldRun(this.context))continue;console.log(`
392
+ `)}};ee();import{existsSync as q,mkdirSync as We,readdirSync as Ue,copyFileSync as Ge}from"fs";import{join as C,dirname as kt}from"path";import{fileURLToPath as wt}from"url";var Ct=wt(import.meta.url),ze=kt(Ct);function It(){let l=[C(ze,"../../assets/governance"),C(ze,"../assets/governance")],e=Ae(import.meta.url);e&&(l.push(C(e,"assets/governance")),l.push(C(e,"dist/assets/governance"))),l.push(C(process.cwd(),"node_modules/agentic-qe/assets/governance")),l.push(C(process.cwd(),"assets/governance"));for(let t of l)if(q(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${l.join(", ")}`)}var ve=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=It()}async install(){let e=[],t=[],s=[],n=C(this.projectRoot,".claude","guidance"),o=C(n,"shards");try{We(n,{recursive:!0}),this.skipShards||We(o,{recursive:!0})}catch(u){return s.push(`Failed to create governance directory: ${S(u)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=C(this.assetsPath,"constitution.md"),c=C(n,"constitution.md");if(q(i))try{!q(c)||this.overwrite?(Ge(i,c),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(u){s.push(`Failed to install constitution.md: ${S(u)}`)}else s.push("constitution.md not found in assets");let d=0;if(!this.skipShards){let u=C(this.assetsPath,"shards");if(q(u))try{let m=Ue(u).filter(p=>p.endsWith(".shard.md"));for(let p of m){let h=C(u,p),f=C(o,p);try{!q(f)||this.overwrite?(Ge(h,f),e.push(`shards/${p}`),d++):t.push(`shards/${p}`)}catch(v){s.push(`Failed to install ${p}: ${S(v)}`)}}}catch(m){s.push(`Failed to read shards directory: ${S(m)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:d}}isInstalled(){let e=C(this.projectRoot,".claude","guidance","constitution.md");return q(e)}getInstalledShards(){let e=C(this.projectRoot,".claude","guidance","shards");if(!q(e))return[];try{return Ue(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function Ke(l){return new ve(l)}var Z=class extends y{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noGovernance?(e.services.log(" Governance skipped (--no-governance flag)"),!1):e.options.minimal?(e.services.log(" Governance skipped (minimal mode)"),!1):!0}async run(e){let{projectRoot:t,options:s}=e,n=s.upgrade,o=Ke({projectRoot:t,overwrite:n});if(o.isInstalled()&&!n){let i=o.getInstalledShards();return e.services.log(` Governance already installed (${i.length} shards)`),e.services.log(" Use --upgrade to overwrite existing files"),{filesInstalled:0,filesSkipped:1+i.length,constitutionInstalled:!1,shardsInstalled:0,governanceDir:`${t}/.claude/guidance`,skippedByFlag:!1}}let r=await o.install();if(r.errors.length>0)for(let i of r.errors)e.services.warn(` ${i}`);return e.services.log(` Constitution: ${r.constitutionInstalled?"installed":"skipped"}`),e.services.log(` Shards: ${r.shardsInstalled} installed, ${r.skipped.filter(i=>i.startsWith("shards/")).length} skipped`),r.installed.length>0&&(e.services.log(" Governance enabled (non-strict mode by default)"),e.services.log(" Set GOVERNANCE_STRICT_MODE=true for strict enforcement")),{filesInstalled:r.installed.length,filesSkipped:r.skipped.length,constitutionInstalled:r.constitutionInstalled,shardsInstalled:r.shardsInstalled,governanceDir:r.governanceDir,skippedByFlag:!1}}};var Pt=new N,St=new Q,Et=new L,Rt=new H,At=new W,xt=new U,_t=new G,$t=new z,Dt=new K,qt=new Y,jt=new J,Tt=new X,Mt=new Z;function Ye(){return[Pt,St,Et,Rt,At,xt,_t,$t,Dt,Mt,qt,jt,Tt]}var be=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??Ye()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,minimal:e.minimal,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp},config:{},enhancements:{claudeFlow:!1,ruvector:!1},results:new Map,services:{log:s=>console.log(s),warn:s=>console.warn(s),error:s=>console.error(s)}}}async initialize(){let e=Date.now(),t=[];try{let s=[...this.phases].sort((n,o)=>n.order-o.order);for(let n of s){if(!await n.shouldRun(this.context))continue;console.log(`
374
393
  \u{1F4CB} ${n.description}...`);let r=await n.execute(this.context);if(this.context.results.set(n.name,r),t.push({step:n.description,status:r.success?"success":"error",message:r.message||"",durationMs:r.durationMs}),!r.success&&n.critical){if(console.error(`
375
- \u274C Critical phase failed: ${n.name}`),n.rollback)try{await n.rollback(this.context)}catch(i){console.error(`Rollback failed: ${i}`)}return this.createFailureResult(t,e)}if(r.skipRemaining)break}return this.createSuccessResult(t,e)}catch(s){return t.push({step:"Initialization Failed",status:"error",message:S(s),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let s=this.context.config,n=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),c=this.context.results.get("mcp"),d=this.context.results.get("claude-md"),u=this.context.results.get("workers");return{success:!0,config:s||ue("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:this.context.results.has("analysis"),configGenerated:this.context.results.has("configuration"),codeIntelligenceIndexed:o?.data?.entries??0,patternsLoaded:n?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:c?.data?.configured??!1,claudeMdGenerated:d?.data?.generated??!1,workersStarted:u?.data?.workersConfigured??0},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ue("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:!1,configGenerated:!1,codeIntelligenceIndexed:0,patternsLoaded:0,skillsInstalled:0,agentsInstalled:0,hooksConfigured:!1,mcpConfigured:!1,claudeMdGenerated:!1,workersStarted:0},totalDurationMs:Date.now()-t,timestamp:new Date}}getPhase(e){return this.phases.find(t=>t.name===e)}getPhases(){return[...this.phases]}getContext(){return this.context}};function $t(l){return new ke(l)}async function Os(l){return await $t({projectRoot:l,autoMode:!0}).initialize()}function Fs(l){let e=[];e.push(""),e.push("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),e.push("\u2502 AQE v3 Initialization \u2502"),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let s of l.steps){let n=s.status==="success"?"\u2713":s.status==="error"?"\u2717":"\u25CB",o=s.step.substring(0,48).padEnd(48);e.push(`\u2502 ${n} ${o} ${String(s.durationMs).padStart(4)}ms \u2502`)}e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),e.push(`\u2502 Project: ${l.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${l.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(l.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(l.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(l.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(l.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(l.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${l.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${l.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${l.summary.claudeMdGenerated?"Yes":"No".padEnd(44)} \u2502`),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let t=l.success?"\u2713 AQE v3 initialized successfully":"\u2717 Initialization failed";return e.push(`\u2502 ${t.padEnd(57)} \u2502`),e.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),e.push(""),e.join(`
376
- `)}export{ke as ModularInitOrchestrator,$t as createModularInitOrchestrator,Fs as formatInitResultModular,Os as quickInitModular};
394
+ \u274C Critical phase failed: ${n.name}`),n.rollback)try{await n.rollback(this.context)}catch(i){console.error(`Rollback failed: ${i}`)}return this.createFailureResult(t,e)}if(r.skipRemaining)break}return this.createSuccessResult(t,e)}catch(s){return t.push({step:"Initialization Failed",status:"error",message:S(s),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let s=this.context.config,n=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),c=this.context.results.get("mcp"),d=this.context.results.get("claude-md"),u=this.context.results.get("workers");return{success:!0,config:s||ue("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:this.context.results.has("analysis"),configGenerated:this.context.results.has("configuration"),codeIntelligenceIndexed:o?.data?.entries??0,patternsLoaded:n?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:c?.data?.configured??!1,claudeMdGenerated:d?.data?.generated??!1,workersStarted:u?.data?.workersConfigured??0},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ue("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:!1,configGenerated:!1,codeIntelligenceIndexed:0,patternsLoaded:0,skillsInstalled:0,agentsInstalled:0,hooksConfigured:!1,mcpConfigured:!1,claudeMdGenerated:!1,workersStarted:0},totalDurationMs:Date.now()-t,timestamp:new Date}}getPhase(e){return this.phases.find(t=>t.name===e)}getPhases(){return[...this.phases]}getContext(){return this.context}};function Ot(l){return new be(l)}async function Gs(l){return await Ot({projectRoot:l,autoMode:!0}).initialize()}function zs(l){let e=[];e.push(""),e.push("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),e.push("\u2502 AQE v3 Initialization \u2502"),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let s of l.steps){let n=s.status==="success"?"\u2713":s.status==="error"?"\u2717":"\u25CB",o=s.step.substring(0,48).padEnd(48);e.push(`\u2502 ${n} ${o} ${String(s.durationMs).padStart(4)}ms \u2502`)}e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),e.push(`\u2502 Project: ${l.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${l.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(l.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(l.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(l.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(l.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(l.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${l.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${l.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${l.summary.claudeMdGenerated?"Yes":"No".padEnd(44)} \u2502`),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let t=l.success?"\u2713 AQE v3 initialized successfully":"\u2717 Initialization failed";return e.push(`\u2502 ${t.padEnd(57)} \u2502`),e.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),e.push(""),e.join(`
395
+ `)}export{be as ModularInitOrchestrator,Ot as createModularInitOrchestrator,zs as formatInitResultModular,Gs as quickInitModular};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as y,b as w,c as u}from"./chunk-BUMNLVMC.js";import"./chunk-YCK464TF.js";import{Command as O}from"commander";import{resolve as A}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return u(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return u(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return u(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return u(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return u(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return u(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return u(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,l=this.validateSteps(t.steps);if(!l.success)return l;let d;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return u(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;d=g.value}let p=this.detectCircularDependencies(l.value);if(p)return u(new Error(`Circular dependency detected: ${p}`));let c={id:t.id,name:t.name,description:n,version:a,steps:l.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...d!==void 0&&{triggers:d}};return w(c)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return u(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return u(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return u(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return u(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return u(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!y.includes(e.domain))return u(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${y.join(", ")}`));if(!e.action||typeof e.action!="string")return u(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return u(i);let l=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(l!==void 0&&l instanceof Error)return u(l);let d;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(f=>typeof f=="string"))return u(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let f of e.dependsOn)if(!r.some(j=>j.id===f))return u(new Error(`Step '${e.id}' depends on unknown step: ${f}`));d=e.dependsOn}let p;if(e.condition!==void 0){let f=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!f.success)return f;p=f.value}let c;if(e.skipCondition!==void 0){let f=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!f.success)return f;c=f.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return u(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let f=this.validateRetry(e.retry,e.id);if(!f.success)return f;$=f.value}let b;if(e.rollback!==void 0){let f=this.validateRollback(e.rollback,e.id);if(!f.success)return f;b=f.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let f=this.validateApproval(e.approval,e.id);if(!f.success)return f;S=f.value}let C={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...l!==void 0&&{outputMapping:l},...d!==void 0&&{dependsOn:d},...p!==void 0&&{condition:p},...c!==void 0&&{skipCondition:c},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(C)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?u(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?u(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?u(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):u(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return u(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return u(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!y.includes(o.sourceDomain))return u(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let d=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!d.success)return d;i=d.value}let l=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(l!==void 0&&l instanceof Error)return u(l);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...l!==void 0&&{inputMapping:l}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?u(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?u(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!y.includes(n.domain)?u(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?u(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.autoApproveAfter!==void 0){if(typeof n.autoApproveAfter!="number"||n.autoApproveAfter<0)return u(new Error(`Step '${t}': approval.autoApproveAfter must be a non-negative number`));a.autoApproveAfter=n.autoApproveAfter}if(n.message!==void 0){if(typeof n.message!="string")return u(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(l=>l.id===o);if(i?.dependsOn)for(let l of i.dependsOn){let d=a(l,[...e,o]);if(d)return d}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function v(m){return m.workflowOrchestrator}function X(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=v(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let l=A(o),d=e.vars?h(e.vars):void 0;console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as y,b as w,c as u}from"./chunk-IRRGUXAU.js";import"./chunk-BMS7WFDB.js";import{Command as O}from"commander";import{resolve as A}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return u(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return u(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return u(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return u(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return u(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return u(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return u(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,l=this.validateSteps(t.steps);if(!l.success)return l;let d;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return u(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;d=g.value}let p=this.detectCircularDependencies(l.value);if(p)return u(new Error(`Circular dependency detected: ${p}`));let c={id:t.id,name:t.name,description:n,version:a,steps:l.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...d!==void 0&&{triggers:d}};return w(c)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return u(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return u(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return u(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return u(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return u(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!y.includes(e.domain))return u(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${y.join(", ")}`));if(!e.action||typeof e.action!="string")return u(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return u(i);let l=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(l!==void 0&&l instanceof Error)return u(l);let d;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(f=>typeof f=="string"))return u(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let f of e.dependsOn)if(!r.some(j=>j.id===f))return u(new Error(`Step '${e.id}' depends on unknown step: ${f}`));d=e.dependsOn}let p;if(e.condition!==void 0){let f=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!f.success)return f;p=f.value}let c;if(e.skipCondition!==void 0){let f=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!f.success)return f;c=f.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return u(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let f=this.validateRetry(e.retry,e.id);if(!f.success)return f;$=f.value}let b;if(e.rollback!==void 0){let f=this.validateRollback(e.rollback,e.id);if(!f.success)return f;b=f.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let f=this.validateApproval(e.approval,e.id);if(!f.success)return f;S=f.value}let C={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...l!==void 0&&{outputMapping:l},...d!==void 0&&{dependsOn:d},...p!==void 0&&{condition:p},...c!==void 0&&{skipCondition:c},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(C)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?u(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?u(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?u(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):u(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return u(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return u(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!y.includes(o.sourceDomain))return u(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let d=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!d.success)return d;i=d.value}let l=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(l!==void 0&&l instanceof Error)return u(l);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...l!==void 0&&{inputMapping:l}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?u(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?u(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!y.includes(n.domain)?u(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?u(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.autoApproveAfter!==void 0){if(typeof n.autoApproveAfter!="number"||n.autoApproveAfter<0)return u(new Error(`Step '${t}': approval.autoApproveAfter must be a non-negative number`));a.autoApproveAfter=n.autoApproveAfter}if(n.message!==void 0){if(typeof n.message!="string")return u(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(l=>l.id===o);if(i?.dependsOn)for(let l of i.dependsOn){let d=a(l,[...e,o]);if(d)return d}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function v(m){return m.workflowOrchestrator}function X(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=v(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let l=A(o),d=e.vars?h(e.vars):void 0;console.log(s.blue(`
3
3
  Loading pipeline from: ${o}
4
4
  `));let p=await n.loadFromFile(l,d);if(!p.success){console.error(s.red(` Parse error: ${p.error.message}`)),await r(1);return}let c=p.value,g=i.registerWorkflow(c);if(!g.success){console.error(s.red(` Registration error: ${g.error.message}`)),await r(1);return}console.log(s.green(" Pipeline loaded successfully.")),console.log(` ID: ${s.cyan(c.id)}`),console.log(` Name: ${s.cyan(c.name)}`),console.log(` Steps: ${s.cyan(c.steps.length)}`),console.log(` Version: ${s.cyan(c.version)}`),c.tags?.length&&console.log(` Tags: ${s.cyan(c.tags.join(", "))}`),console.log(""),await r(0)}),a.command("validate <file>").description("Validate a YAML pipeline without registering it").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{let i=A(o),l=e.vars?h(e.vars):void 0;console.log(s.blue(`
5
5
  Validating pipeline: ${o}
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as u}from"./chunk-GWBI5IMK.js";import{a as y,c as w}from"./chunk-LIEKDXTS.js";import{b as $}from"./chunk-YCK464TF.js";import{Command as v}from"commander";import o from"chalk";import{existsSync as d,readFileSync as P}from"node:fs";import m from"node:path";w();var C=$({});var p=Object.keys(u);function h(s){return p.includes(s)}function x(s,e){let t=m.join(s,e.configPath),n=m.join(s,e.rulesPath);return{configExists:d(t),rulesExists:d(n)}}function E(s,e){try{let t=P(s,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:y(t)}}}function I(s,e){try{return P(s,"utf-8").includes("agentic-qe")}catch{return!1}}function j(){let s=new v("platform").description("Manage coding agent platform configurations");return s.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,n=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(n)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+n+r)}`));for(let l of p){let f=u[l],{configExists:c,rulesExists:a}=x(e,f),i=c&&a?o.green("configured"):c||a?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(f.name.padEnd(t))}${o.gray(f.configPath.padEnd(n))}${i}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),s.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").action(async(e,t)=>{let n=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let r=u[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let l=await C(`../../init/${e}-installer.js`),c=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${R(e)}Installer`],a;for(let i of c)if(typeof l[i]=="function"){a=l[i];break}if(!a){for(let i of Object.keys(l))if(i.startsWith("create")&&i.endsWith("Installer")&&typeof l[i]=="function"){a=l[i];break}}a||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let g=await a({projectRoot:n,overwrite:t.overwrite}).install();if(g.success)console.log(o.green(` ${r.name} configured successfully`)),g.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),g.rulesInstalled&&console.log(o.gray(` Rules: ${r.rulesPath}`));else if(console.log(o.red(` ${r.name} setup failed`)),g.errors)for(let i of g.errors)console.log(o.red(` ${i}`))}catch(l){console.log(o.red(` Failed to set up ${r.name}: ${y(l)}`))}console.log("")}),s.command("verify <name>").description("Verify a platform configuration is correct").action(async e=>{let t=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let n=u[e];console.log(""),console.log(o.bold.blue(` Verifying ${n.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let r=!0,l=m.join(t,n.configPath);if(d(l)?console.log(o.green(` [pass] Config file exists: ${n.configPath}`)):(console.log(o.red(` [fail] Config file missing: ${n.configPath}`)),r=!1),d(l)){let c=E(l,n.configFormat);c.valid?console.log(o.green(` [pass] Config file is valid ${n.configFormat.toUpperCase()}`)):(console.log(o.red(` [fail] Config file is invalid: ${c.error}`)),r=!1),I(l,n)?console.log(o.green(" [pass] Config contains agentic-qe entry")):(console.log(o.red(" [fail] Config does not contain agentic-qe entry")),r=!1)}let f=m.join(t,n.rulesPath);d(f)?console.log(o.green(` [pass] Rules file exists: ${n.rulesPath}`)):(console.log(o.red(` [fail] Rules file missing: ${n.rulesPath}`)),r=!1),console.log(""),r?console.log(o.green(` ${n.name} configuration is valid`)):(console.log(o.yellow(` ${n.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`))),console.log("")}),s}function R(s){return s.charAt(0).toUpperCase()+s.slice(1)}var V=j;export{j as createPlatformCommand,V as default};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as u}from"./chunk-LRWRFKQH.js";import{a as y,c as w}from"./chunk-K6MFAVXK.js";import{b as $}from"./chunk-BMS7WFDB.js";import{Command as v}from"commander";import o from"chalk";import{existsSync as d,readFileSync as P}from"node:fs";import m from"node:path";w();var C=$({});var p=Object.keys(u);function h(s){return p.includes(s)}function x(s,e){let t=m.join(s,e.configPath),n=m.join(s,e.rulesPath);return{configExists:d(t),rulesExists:d(n)}}function E(s,e){try{let t=P(s,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:y(t)}}}function I(s,e){try{return P(s,"utf-8").includes("agentic-qe")}catch{return!1}}function j(){let s=new v("platform").description("Manage coding agent platform configurations");return s.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,n=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(n)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+n+r)}`));for(let l of p){let f=u[l],{configExists:c,rulesExists:a}=x(e,f),i=c&&a?o.green("configured"):c||a?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(f.name.padEnd(t))}${o.gray(f.configPath.padEnd(n))}${i}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),s.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").action(async(e,t)=>{let n=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let r=u[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let l=await C(`../../init/${e}-installer.js`),c=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${R(e)}Installer`],a;for(let i of c)if(typeof l[i]=="function"){a=l[i];break}if(!a){for(let i of Object.keys(l))if(i.startsWith("create")&&i.endsWith("Installer")&&typeof l[i]=="function"){a=l[i];break}}a||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let g=await a({projectRoot:n,overwrite:t.overwrite}).install();if(g.success)console.log(o.green(` ${r.name} configured successfully`)),g.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),g.rulesInstalled&&console.log(o.gray(` Rules: ${r.rulesPath}`));else if(console.log(o.red(` ${r.name} setup failed`)),g.errors)for(let i of g.errors)console.log(o.red(` ${i}`))}catch(l){console.log(o.red(` Failed to set up ${r.name}: ${y(l)}`))}console.log("")}),s.command("verify <name>").description("Verify a platform configuration is correct").action(async e=>{let t=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let n=u[e];console.log(""),console.log(o.bold.blue(` Verifying ${n.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let r=!0,l=m.join(t,n.configPath);if(d(l)?console.log(o.green(` [pass] Config file exists: ${n.configPath}`)):(console.log(o.red(` [fail] Config file missing: ${n.configPath}`)),r=!1),d(l)){let c=E(l,n.configFormat);c.valid?console.log(o.green(` [pass] Config file is valid ${n.configFormat.toUpperCase()}`)):(console.log(o.red(` [fail] Config file is invalid: ${c.error}`)),r=!1),I(l,n)?console.log(o.green(" [pass] Config contains agentic-qe entry")):(console.log(o.red(" [fail] Config does not contain agentic-qe entry")),r=!1)}let f=m.join(t,n.rulesPath);d(f)?console.log(o.green(` [pass] Rules file exists: ${n.rulesPath}`)):(console.log(o.red(` [fail] Rules file missing: ${n.rulesPath}`)),r=!1),console.log(""),r?console.log(o.green(` ${n.name} configuration is valid`)):(console.log(o.yellow(` ${n.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`))),console.log("")}),s}function R(s){return s.charAt(0).toUpperCase()+s.slice(1)}var V=j;export{j as createPlatformCommand,V as default};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import{a as p,b as d,c as h}from"./chunk-UKYPDNQR.js";import"./chunk-YCK464TF.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a as p,b as d,c as h}from"./chunk-462MZLJB.js";import"./chunk-BMS7WFDB.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
3
3
  Examples:
4
4
  aqe plugin install ./my-plugin Install from local directory
5
5
  aqe plugin install owner/repo --source github Install from GitHub
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import"./chunk-YCK464TF.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import"./chunk-BMS7WFDB.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import{a,b}from"./chunk-35SFAIXE.js";import"./chunk-7V7TP242.js";import"./chunk-52D3CYE5.js";import"./chunk-IRRGUXAU.js";import"./chunk-K6MFAVXK.js";import"./chunk-GQFAVT2I.js";import"./chunk-BMS7WFDB.js";export{a as DefaultProtocolExecutor,b as createProtocolExecutor};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import"./chunk-HHDPHHTX.js";import{c as i}from"./chunk-CZEQFAKE.js";import"./chunk-YCK464TF.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import"./chunk-VUL5HIKR.js";import{c as i}from"./chunk-WB6TI6Q3.js";import"./chunk-BMS7WFDB.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
3
3
  Executing protocol: ${o}
4
4
  `));let t=await c.queen.executeProtocol(o,r);t.success?(console.log(n.green(" Protocol execution started")),console.log(n.cyan(` Execution ID: ${t.value}`))):console.log(n.red(` Failed to execute protocol: ${t.error.message}`)),console.log("")}catch(r){console.error(n.red(`
5
5
  Failed to execute protocol:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.29");process.exit(0)}
2
- import"./chunk-YCK464TF.js";import{Command as l}from"commander";import*as c from"crypto";import*as n from"fs";import*as r from"path";function m(t){let e=JSON.stringify(t,null,0);return c.createHash("sha256").update(e).digest("hex")}async function d(t){let e={testCount:0,passRate:0,coveragePercent:0,vulnerabilities:0,qualityScore:0,patternsUsed:0};try{let a=r.join(t,"junit.xml");if(n.existsSync(a)){let o=n.readFileSync(a,"utf-8"),s=o.match(/tests="(\d+)"/),i=o.match(/failures="(\d+)"/);if(s){e.testCount=parseInt(s[1],10);let u=i?parseInt(i[1],10):0;e.passRate=e.testCount>0?(e.testCount-u)/e.testCount*100:0}}}catch{}try{let a=r.join(t,"coverage","coverage-summary.json");if(n.existsSync(a)){let o=JSON.parse(n.readFileSync(a,"utf-8"));e.coveragePercent=o?.total?.lines?.pct??0}}catch{}try{let a=r.join(t,".agentic-qe","memory.db");n.existsSync(a)&&(e.patternsUsed=1)}catch{}return e.qualityScore=Math.round(e.passRate*.4+e.coveragePercent*.3+(e.vulnerabilities===0?100:Math.max(0,100-e.vulnerabilities*10))*.3),e}function y(t,e){let a={version:"1.0.0",timestamp:new Date().toISOString(),projectRoot:t,attestation:{testsExecuted:e.testCount>0,coverageChecked:e.coveragePercent>0,securityScanned:e.vulnerabilities===0,qualityGatePassed:e.qualityScore>=70},metrics:e,generatedBy:"agentic-qe prove"},o=m(a);return{...a,hash:o}}function f(t){return["# Proof of Quality","",`**Generated:** ${t.timestamp}`,`**Project:** ${t.projectRoot}`,`**Hash:** \`${t.hash}\``,"","## Attestation","","| Check | Status |","|-------|--------|",`| Tests Executed | ${t.attestation.testsExecuted?"PASS":"FAIL"} |`,`| Coverage Checked | ${t.attestation.coverageChecked?"PASS":"FAIL"} |`,`| Security Scanned | ${t.attestation.securityScanned?"PASS":"FAIL"} |`,`| Quality Gate | ${t.attestation.qualityGatePassed?"PASSED":"FAILED"} |`,"","## Metrics","","| Metric | Value |","|--------|-------|",`| Tests | ${t.metrics.testCount} |`,`| Pass Rate | ${t.metrics.passRate.toFixed(1)}% |`,`| Coverage | ${t.metrics.coveragePercent.toFixed(1)}% |`,`| Vulnerabilities | ${t.metrics.vulnerabilities} |`,`| Quality Score | ${t.metrics.qualityScore}/100 |`,"","---",`*${t.generatedBy}*`].join(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.31");process.exit(0)}
2
+ import"./chunk-BMS7WFDB.js";import{Command as l}from"commander";import*as c from"crypto";import*as n from"fs";import*as r from"path";function m(t){let e=JSON.stringify(t,null,0);return c.createHash("sha256").update(e).digest("hex")}async function d(t){let e={testCount:0,passRate:0,coveragePercent:0,vulnerabilities:0,qualityScore:0,patternsUsed:0};try{let a=r.join(t,"junit.xml");if(n.existsSync(a)){let o=n.readFileSync(a,"utf-8"),s=o.match(/tests="(\d+)"/),i=o.match(/failures="(\d+)"/);if(s){e.testCount=parseInt(s[1],10);let u=i?parseInt(i[1],10):0;e.passRate=e.testCount>0?(e.testCount-u)/e.testCount*100:0}}}catch{}try{let a=r.join(t,"coverage","coverage-summary.json");if(n.existsSync(a)){let o=JSON.parse(n.readFileSync(a,"utf-8"));e.coveragePercent=o?.total?.lines?.pct??0}}catch{}try{let a=r.join(t,".agentic-qe","memory.db");n.existsSync(a)&&(e.patternsUsed=1)}catch{}return e.qualityScore=Math.round(e.passRate*.4+e.coveragePercent*.3+(e.vulnerabilities===0?100:Math.max(0,100-e.vulnerabilities*10))*.3),e}function y(t,e){let a={version:"1.0.0",timestamp:new Date().toISOString(),projectRoot:t,attestation:{testsExecuted:e.testCount>0,coverageChecked:e.coveragePercent>0,securityScanned:e.vulnerabilities===0,qualityGatePassed:e.qualityScore>=70},metrics:e,generatedBy:"agentic-qe prove"},o=m(a);return{...a,hash:o}}function f(t){return["# Proof of Quality","",`**Generated:** ${t.timestamp}`,`**Project:** ${t.projectRoot}`,`**Hash:** \`${t.hash}\``,"","## Attestation","","| Check | Status |","|-------|--------|",`| Tests Executed | ${t.attestation.testsExecuted?"PASS":"FAIL"} |`,`| Coverage Checked | ${t.attestation.coverageChecked?"PASS":"FAIL"} |`,`| Security Scanned | ${t.attestation.securityScanned?"PASS":"FAIL"} |`,`| Quality Gate | ${t.attestation.qualityGatePassed?"PASSED":"FAILED"} |`,"","## Metrics","","| Metric | Value |","|--------|-------|",`| Tests | ${t.metrics.testCount} |`,`| Pass Rate | ${t.metrics.passRate.toFixed(1)}% |`,`| Coverage | ${t.metrics.coveragePercent.toFixed(1)}% |`,`| Vulnerabilities | ${t.metrics.vulnerabilities} |`,`| Quality Score | ${t.metrics.qualityScore}/100 |`,"","---",`*${t.generatedBy}*`].join(`
3
3
  `)}async function p(t){let e=t.projectRoot??process.cwd(),a=await d(e),o=y(e,a),s=t.format==="markdown"?f(o):JSON.stringify(o,null,2);return t.output?(n.writeFileSync(t.output,s),console.log(`Quality attestation written to ${t.output}`)):console.log(s),o}function g(t,e,a){return new l("prove").description("Generate a verifiable Proof-of-Quality attestation").option("-F, --format <format>","Output format (json|markdown)","json").option("-o, --output <path>","Write attestation to file").action(async o=>{try{await p({format:o.format,output:o.output}),await e(0)}catch(s){console.error("Failed to generate proof-of-quality:",s),await e(1)}})}export{y as buildAttestation,d as collectMetrics,g as createProveCommand,f as formatMarkdown,p as handleProve,m as hashAttestation};