agentic-qe 3.15.13 → 3.15.15

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 (426) hide show
  1. package/.claude/agents/v3/templates/qx-report-template.html +1 -1
  2. package/.claude/helpers/brain-checkpoint.cjs +124 -5
  3. package/.claude/skills/skills-manifest.json +1 -1
  4. package/CHANGELOG.md +124 -0
  5. package/assets/agents/v3/templates/qx-report-template.html +1 -1
  6. package/assets/skills/skills-manifest.json +1 -1
  7. package/dist/cli/bundle.js +6 -6
  8. package/dist/cli/chunks/adapter-QU6INSKP.js +2 -0
  9. package/dist/cli/chunks/agent-booster-wasm-EUF4XVUC.js +2 -0
  10. package/dist/cli/chunks/{agent-handler-AOH6TV7W.js → agent-handler-MOX6PSIQ.js} +2 -2
  11. package/dist/cli/chunks/{agent-memory-branch-2P54SF5N.js → agent-memory-branch-AEXKIGDG.js} +2 -2
  12. package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +2 -0
  13. package/dist/cli/chunks/{arena-NSVFCAF5.js → arena-IQ5ZZDRF.js} +2 -2
  14. package/dist/cli/chunks/{arena-X6MOGQHA.js → arena-M7GA3CVG.js} +4 -4
  15. package/dist/cli/chunks/{audit-27DJLQNM.js → audit-4IPBMKWB.js} +3 -3
  16. package/dist/cli/chunks/base-OTGSN6IC.js +2 -0
  17. package/dist/cli/chunks/{better-sqlite3-BU5GXILS.js → better-sqlite3-IKDKJ2IE.js} +2 -2
  18. package/dist/cli/chunks/brain-handler-5NQUDH4W.js +95 -0
  19. package/dist/cli/chunks/{branch-enumerator-5CLULOCU.js → branch-enumerator-KSXELWRC.js} +2 -2
  20. package/dist/cli/chunks/{browser-R4DMU3LN.js → browser-6LACARWE.js} +2 -2
  21. package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +2 -0
  22. package/dist/cli/chunks/{chunk-LUZNKJE6.js → chunk-22UKJGGN.js} +3 -3
  23. package/dist/cli/chunks/{chunk-BLSLEVDI.js → chunk-27HE2BHC.js} +2 -2
  24. package/dist/cli/chunks/{chunk-K4CZA77U.js → chunk-2CKERSMB.js} +2 -2
  25. package/dist/cli/chunks/{chunk-YSZ5OE3Z.js → chunk-2IIXCEMS.js} +2 -2
  26. package/dist/cli/chunks/{chunk-F3YS57NF.js → chunk-2LUTPMBO.js} +2 -2
  27. package/dist/cli/chunks/{chunk-GHM6MQNK.js → chunk-2ZFLULL4.js} +2 -2
  28. package/dist/cli/chunks/{chunk-7CMTY45A.js → chunk-337Z52QM.js} +2 -2
  29. package/dist/cli/chunks/{chunk-W26B7ERY.js → chunk-3CYNZFKH.js} +1 -1
  30. package/dist/cli/chunks/chunk-3HVFIITW.js +2 -0
  31. package/dist/cli/chunks/{chunk-K3TLLJMX.js → chunk-3J3RNJNX.js} +1 -1
  32. package/dist/cli/chunks/{chunk-MAMQA43L.js → chunk-4ATQP3PR.js} +1 -1
  33. package/dist/cli/chunks/{chunk-YXRASAPI.js → chunk-4D4CWP72.js} +2 -2
  34. package/dist/cli/chunks/{chunk-GHY6Z6KO.js → chunk-4HKAD25N.js} +3 -3
  35. package/dist/cli/chunks/{chunk-XNBOGCF3.js → chunk-4X3SWKBA.js} +2 -2
  36. package/dist/cli/chunks/{chunk-IJUHSJ2U.js → chunk-5AFVEWMT.js} +2 -2
  37. package/dist/cli/chunks/{chunk-SE4VNN4I.js → chunk-5C62XMJR.js} +3 -3
  38. package/dist/cli/chunks/{chunk-KDNJ4F3P.js → chunk-5G4UFTV4.js} +2 -2
  39. package/dist/cli/chunks/{chunk-DVGRPK7A.js → chunk-5I7357KS.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YZWBNBTW.js → chunk-5KA5TVPR.js} +2 -2
  41. package/dist/cli/chunks/{chunk-JGZ722G3.js → chunk-5PTAFGJT.js} +2 -2
  42. package/dist/cli/chunks/{chunk-SVLQRAMF.js → chunk-6BRQPHMZ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-KDVZND5Q.js → chunk-6KCSKGVY.js} +1 -1
  44. package/dist/cli/chunks/{chunk-LWR3FV3Y.js → chunk-6LE362LZ.js} +2 -2
  45. package/dist/cli/chunks/{chunk-WKGTGOYS.js → chunk-6NBRMD25.js} +3 -3
  46. package/dist/cli/chunks/{chunk-HQZGPJYG.js → chunk-6RBTS3NF.js} +2 -2
  47. package/dist/cli/chunks/{chunk-WOCGL4QP.js → chunk-6YVMX2TC.js} +2 -2
  48. package/dist/cli/chunks/{chunk-I3C7JOXC.js → chunk-73PBAWAF.js} +2 -2
  49. package/dist/cli/chunks/{chunk-75RDHBAX.js → chunk-74YG72NQ.js} +3 -3
  50. package/dist/cli/chunks/{chunk-O6FGXMHD.js → chunk-76P32JVU.js} +1 -1
  51. package/dist/cli/chunks/{chunk-LL7LDPXS.js → chunk-7ACCBHRB.js} +1 -1
  52. package/dist/cli/chunks/{chunk-3LJ7LQMV.js → chunk-7BLZHFKD.js} +1 -1
  53. package/dist/cli/chunks/{chunk-CM4LSLKR.js → chunk-7O45RQHF.js} +2 -2
  54. package/dist/cli/chunks/{chunk-NU3W5WFT.js → chunk-7XB3FCKM.js} +2 -2
  55. package/dist/cli/chunks/{chunk-E56B6IDX.js → chunk-AHMWD6JG.js} +2 -2
  56. package/dist/cli/chunks/{chunk-G2Q66Z23.js → chunk-AJPROCDW.js} +2 -2
  57. package/dist/cli/chunks/{chunk-NW7IBHJA.js → chunk-AKZO6GGG.js} +13 -13
  58. package/dist/cli/chunks/{chunk-IC3TQEOA.js → chunk-AOKKUB5F.js} +1 -1
  59. package/dist/cli/chunks/{chunk-4OVC4RIL.js → chunk-AP2W7Z3A.js} +1 -1
  60. package/dist/cli/chunks/{chunk-PHP5UBT4.js → chunk-BBRROA3Z.js} +2 -2
  61. package/dist/cli/chunks/{chunk-5FKWCZNF.js → chunk-BDKEAGQ2.js} +2 -2
  62. package/dist/cli/chunks/{chunk-BTVEYBW2.js → chunk-BFQTLF5X.js} +2 -2
  63. package/dist/cli/chunks/{chunk-HZ5NXFXH.js → chunk-BLL2XU7A.js} +2 -2
  64. package/dist/cli/chunks/{chunk-UTRV7T2N.js → chunk-BP5T3OEV.js} +2 -2
  65. package/dist/cli/chunks/{chunk-GB6HBNH2.js → chunk-BQ47GQPK.js} +2 -2
  66. package/dist/cli/chunks/{chunk-RFNW2LGD.js → chunk-BU4UQR36.js} +2 -2
  67. package/dist/cli/chunks/{chunk-WO274FRI.js → chunk-BZULJMGH.js} +2 -2
  68. package/dist/cli/chunks/{chunk-GU5HNCWI.js → chunk-C4KLXFJP.js} +1 -1
  69. package/dist/cli/chunks/{chunk-LFJALJOA.js → chunk-C4RTAVC6.js} +2 -2
  70. package/dist/cli/chunks/{chunk-WNQS4WTS.js → chunk-C5CXL3JP.js} +2 -2
  71. package/dist/cli/chunks/{chunk-MGZ5FJUW.js → chunk-CAOUV5GZ.js} +2 -2
  72. package/dist/cli/chunks/{chunk-XPRVF4YE.js → chunk-CBK5CT6T.js} +2 -2
  73. package/dist/cli/chunks/{chunk-JRRXCODW.js → chunk-DEKR3CTS.js} +2 -2
  74. package/dist/cli/chunks/{chunk-AQSVJNEH.js → chunk-DKX4GNRU.js} +2 -2
  75. package/dist/cli/chunks/{chunk-6KATY3KS.js → chunk-DUKE27HC.js} +2 -2
  76. package/dist/cli/chunks/{chunk-W2QWSQVE.js → chunk-DURD37JZ.js} +2 -2
  77. package/dist/cli/chunks/{chunk-KCW47QR5.js → chunk-E3MRDIZF.js} +1 -1
  78. package/dist/cli/chunks/{chunk-6Z7PRBSG.js → chunk-E56PVVWC.js} +2 -2
  79. package/dist/cli/chunks/{chunk-WQL7WCIZ.js → chunk-E5G4WZ2T.js} +1 -1
  80. package/dist/cli/chunks/{chunk-PB6J6HAA.js → chunk-EBTNMQSS.js} +2 -2
  81. package/dist/cli/chunks/{chunk-KADFXPPN.js → chunk-EFUJDMNC.js} +2 -2
  82. package/dist/cli/chunks/{chunk-QPNG5ZN2.js → chunk-EKP2SC77.js} +2 -2
  83. package/dist/cli/chunks/{chunk-U2FUXDDJ.js → chunk-EMSZVUYA.js} +3 -3
  84. package/dist/cli/chunks/{chunk-XEAEYC6Y.js → chunk-ERN56H6S.js} +1 -1
  85. package/dist/cli/chunks/{chunk-DNDL7SOS.js → chunk-FOOW4JVS.js} +2 -2
  86. package/dist/cli/chunks/{chunk-HOAJUIBQ.js → chunk-FTRSS64D.js} +2 -2
  87. package/dist/cli/chunks/{chunk-TOQWL2ZF.js → chunk-G242G224.js} +2 -2
  88. package/dist/cli/chunks/{chunk-VTDFVFST.js → chunk-G6RDCCFV.js} +2 -2
  89. package/dist/cli/chunks/{chunk-TWDW32W2.js → chunk-GCHYOPRZ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-MFW5HSG4.js → chunk-GGQGCT4Y.js} +2 -2
  91. package/dist/cli/chunks/{chunk-G6WDYBLQ.js → chunk-GKSMRBHU.js} +1 -1
  92. package/dist/cli/chunks/{chunk-CCMKSHAT.js → chunk-GQABPCQE.js} +2 -2
  93. package/dist/cli/chunks/{chunk-G77ERMUD.js → chunk-GV2QE5TO.js} +1 -1
  94. package/dist/cli/chunks/{chunk-756CGMEH.js → chunk-H5DER3JY.js} +1 -1
  95. package/dist/cli/chunks/{chunk-W3PPFHI5.js → chunk-HH4ED4F7.js} +52 -50
  96. package/dist/cli/chunks/{chunk-3Y2ROSCL.js → chunk-HL2ANKN3.js} +2 -2
  97. package/dist/cli/chunks/{chunk-T3PGQFDI.js → chunk-HTZSRMHW.js} +2 -2
  98. package/dist/cli/chunks/{chunk-3QZEGE67.js → chunk-IXL5ZHWJ.js} +1 -1
  99. package/dist/cli/chunks/{chunk-5ZGM3RMH.js → chunk-J3FP5UGL.js} +1 -1
  100. package/dist/cli/chunks/{chunk-FZ76G4QJ.js → chunk-JCQGJGGZ.js} +1 -1
  101. package/dist/cli/chunks/chunk-JCZCJE6X.js +86 -0
  102. package/dist/cli/chunks/{chunk-YZEXYO4W.js → chunk-JKJOB65O.js} +1 -1
  103. package/dist/cli/chunks/{chunk-A64JFBWI.js → chunk-JUDUBQHA.js} +2 -2
  104. package/dist/cli/chunks/{chunk-PIDQVU3L.js → chunk-JW74KRBC.js} +2 -2
  105. package/dist/cli/chunks/{chunk-EXGMJFAT.js → chunk-K3WZICFA.js} +1 -1
  106. package/dist/cli/chunks/{chunk-ASQYASNV.js → chunk-K3XBQC3R.js} +1 -1
  107. package/dist/cli/chunks/{chunk-E7CLYGS7.js → chunk-KCQNFBBR.js} +1 -1
  108. package/dist/cli/chunks/chunk-KJBPB7P5.js +3 -0
  109. package/dist/cli/chunks/chunk-KLTMOXIK.js +3 -0
  110. package/dist/cli/chunks/{chunk-5MDERQH3.js → chunk-L32JNNKL.js} +1 -1
  111. package/dist/cli/chunks/{chunk-32ZMWEP3.js → chunk-LB2LGEDP.js} +2 -2
  112. package/dist/cli/chunks/{chunk-42J34YG4.js → chunk-LHMQIZ6B.js} +2 -2
  113. package/dist/cli/chunks/{chunk-NURIILUB.js → chunk-LJMYRTJ7.js} +1 -1
  114. package/dist/cli/chunks/{chunk-M6AAGIG7.js → chunk-LNX74WHQ.js} +1 -1
  115. package/dist/cli/chunks/{chunk-P7A4NKTZ.js → chunk-LTQVUAPH.js} +2 -2
  116. package/dist/cli/chunks/{chunk-3YNLWPBF.js → chunk-LVABQNRF.js} +2 -2
  117. package/dist/cli/chunks/{chunk-2G7TVT6W.js → chunk-LYJHUNBK.js} +2 -2
  118. package/dist/cli/chunks/{chunk-DLD7RUZ4.js → chunk-M4CJCPCQ.js} +2 -2
  119. package/dist/cli/chunks/{chunk-Q3UDLV5Z.js → chunk-M4WMSCAE.js} +1 -1
  120. package/dist/cli/chunks/{chunk-UDQSYWVF.js → chunk-MIA447GY.js} +1 -1
  121. package/dist/cli/chunks/{chunk-RF7HWBHN.js → chunk-MPFPWJTH.js} +2 -2
  122. package/dist/cli/chunks/{chunk-BK577VL7.js → chunk-MV55NXTD.js} +2 -2
  123. package/dist/cli/chunks/{chunk-JQGMW45H.js → chunk-NQS3BWS6.js} +1 -1
  124. package/dist/cli/chunks/{chunk-BEGR4D6N.js → chunk-NWIIYHT6.js} +2 -2
  125. package/dist/cli/chunks/{chunk-SSU73QAX.js → chunk-O6EWL5DQ.js} +2 -2
  126. package/dist/cli/chunks/chunk-OBDONJQM.js +2 -0
  127. package/dist/cli/chunks/chunk-OLZH5LRT.js +141 -0
  128. package/dist/cli/chunks/{chunk-W3INMZZ6.js → chunk-OQG3UQQ7.js} +1 -1
  129. package/dist/cli/chunks/{chunk-72ASBE35.js → chunk-PFQCV6YS.js} +3 -3
  130. package/dist/cli/chunks/{chunk-7YTGHGK4.js → chunk-PS6UMZVK.js} +2 -2
  131. package/dist/cli/chunks/{chunk-OCAEXYFA.js → chunk-PXATBHWN.js} +2 -2
  132. package/dist/cli/chunks/{chunk-ARJW4I2O.js → chunk-PYPS65P7.js} +2 -2
  133. package/dist/cli/chunks/{chunk-SYV2V3PL.js → chunk-Q6I4SIUU.js} +4 -4
  134. package/dist/cli/chunks/{chunk-H4H2YSFH.js → chunk-QFGYH6HD.js} +1 -1
  135. package/dist/cli/chunks/{chunk-526QYFJU.js → chunk-QGBGSQ2E.js} +2 -2
  136. package/dist/cli/chunks/{chunk-YBQH2VOP.js → chunk-QRKTBSZT.js} +2 -2
  137. package/dist/cli/chunks/{chunk-C7JM7CD3.js → chunk-R6LHJ7ME.js} +2 -2
  138. package/dist/cli/chunks/{chunk-TSQC2KKZ.js → chunk-RBKUU7WF.js} +2 -2
  139. package/dist/cli/chunks/{chunk-CE7B5LU7.js → chunk-RDMRY7CT.js} +1 -1
  140. package/dist/cli/chunks/chunk-RIRZHOS2.js +8 -0
  141. package/dist/cli/chunks/{chunk-CRWPZT74.js → chunk-SHRI7TKJ.js} +2 -2
  142. package/dist/cli/chunks/{chunk-KWYH3FI4.js → chunk-SJCKCSN3.js} +1 -1
  143. package/dist/cli/chunks/{chunk-DFUASIKA.js → chunk-SON6ZRH3.js} +2 -2
  144. package/dist/cli/chunks/{chunk-J2ZIFFM6.js → chunk-SZAZQZWI.js} +2 -2
  145. package/dist/cli/chunks/{chunk-HD7YIFOI.js → chunk-T4GE7MPI.js} +2 -2
  146. package/dist/cli/chunks/{chunk-3Y7TJFHU.js → chunk-T66PPF4D.js} +2 -2
  147. package/dist/cli/chunks/{chunk-3RZV5DGO.js → chunk-T67R2MUN.js} +2 -2
  148. package/dist/cli/chunks/{chunk-H4GG2NLO.js → chunk-TDQWTSBS.js} +2 -2
  149. package/dist/cli/chunks/{chunk-TWJTK4CC.js → chunk-TODNOP7C.js} +2 -2
  150. package/dist/cli/chunks/{chunk-NZ3GUMB2.js → chunk-TX2CHQD7.js} +2 -2
  151. package/dist/cli/chunks/{chunk-AL6FBH3E.js → chunk-TZIHDJZD.js} +2 -2
  152. package/dist/cli/chunks/{chunk-GII6UM3F.js → chunk-U62OUXBF.js} +1 -1
  153. package/dist/cli/chunks/{chunk-YQFLQE53.js → chunk-UAQZI6N4.js} +2 -2
  154. package/dist/cli/chunks/{chunk-R7SYRCRP.js → chunk-UE2J6MA5.js} +1 -1
  155. package/dist/cli/chunks/{chunk-VRHRBAEM.js → chunk-UGYM4U44.js} +1 -1
  156. package/dist/cli/chunks/{chunk-NT4DBXSX.js → chunk-UJABDXST.js} +2 -2
  157. package/dist/cli/chunks/{chunk-OFACHK5O.js → chunk-UORB2QDU.js} +9 -9
  158. package/dist/cli/chunks/{chunk-QDEJ4CI2.js → chunk-UQPA33UK.js} +2 -2
  159. package/dist/cli/chunks/{chunk-TCBBNUBP.js → chunk-UUBIQR6A.js} +3 -3
  160. package/dist/cli/chunks/{chunk-NZD4DPSU.js → chunk-UXIY4IAI.js} +2 -2
  161. package/dist/cli/chunks/{chunk-SG3NX7QE.js → chunk-VCXI4XC4.js} +2 -2
  162. package/dist/cli/chunks/{chunk-PSFSPGUD.js → chunk-VMAM46HQ.js} +2 -2
  163. package/dist/cli/chunks/{chunk-3AN5TNGD.js → chunk-VY4U6DPO.js} +3 -3
  164. package/dist/cli/chunks/{chunk-X7N2JF2X.js → chunk-W27AJ5B4.js} +2 -2
  165. package/dist/cli/chunks/{chunk-CT6SAVXQ.js → chunk-W5ZJG2OU.js} +2 -2
  166. package/dist/cli/chunks/{chunk-KV4T4MXK.js → chunk-W62OOK7A.js} +2 -2
  167. package/dist/cli/chunks/{chunk-5K26BEYB.js → chunk-WNTA4YKE.js} +2 -2
  168. package/dist/cli/chunks/{chunk-LZYQHVD4.js → chunk-WUOOX7UG.js} +2 -2
  169. package/dist/cli/chunks/{chunk-7NA7JXNB.js → chunk-WVXJ2QIG.js} +2 -2
  170. package/dist/cli/chunks/{chunk-KB56CPU4.js → chunk-X33CWRDF.js} +2 -2
  171. package/dist/cli/chunks/{chunk-7JUC2MVZ.js → chunk-XG4F4XH4.js} +2 -2
  172. package/dist/cli/chunks/{chunk-ZAKQLAHT.js → chunk-XH4JMX5O.js} +1 -1
  173. package/dist/cli/chunks/{chunk-X2Z7F4EU.js → chunk-XHHWABJV.js} +2 -2
  174. package/dist/cli/chunks/{chunk-7PLIEBY7.js → chunk-XHLYGXYE.js} +2 -2
  175. package/dist/cli/chunks/{chunk-UXZSUMEA.js → chunk-XIVVTYM2.js} +2 -2
  176. package/dist/cli/chunks/{chunk-MVVB7C2E.js → chunk-XM6ZVFM5.js} +156 -156
  177. package/dist/cli/chunks/{chunk-VTOBUZL6.js → chunk-XWIAZG3C.js} +2 -2
  178. package/dist/cli/chunks/{chunk-CV77DMDQ.js → chunk-Y2OX6KGN.js} +2 -2
  179. package/dist/cli/chunks/{chunk-VRVMIPTM.js → chunk-YUS6TWAL.js} +2 -2
  180. package/dist/cli/chunks/{chunk-VU5TBX2V.js → chunk-ZIPAB5J6.js} +2 -2
  181. package/dist/cli/chunks/{chunk-KUAKV3IW.js → chunk-ZSOMUTNL.js} +1 -1
  182. package/dist/cli/chunks/{chunk-UOC3O6RP.js → chunk-ZWBGYJ7K.js} +2 -2
  183. package/dist/cli/chunks/{chunk-5VMAV6T6.js → chunk-ZYJB6FML.js} +1 -1
  184. package/dist/cli/chunks/{ci-ENOASTYB.js → ci-UCUJOSBW.js} +2 -2
  185. package/dist/cli/chunks/{ci-config-B26OXHQM.js → ci-config-2XILD3XG.js} +2 -2
  186. package/dist/cli/chunks/{ci-output-JTCLLNOQ.js → ci-output-BL6KWOHW.js} +2 -2
  187. package/dist/cli/chunks/{circuit-breaker-23JMFNM5.js → circuit-breaker-5XLIOXE5.js} +2 -2
  188. package/dist/cli/chunks/{claude-flow-setup-ON6L462G.js → claude-flow-setup-4IMP6ACS.js} +2 -2
  189. package/dist/cli/chunks/client-KKRNPX4F.js +2 -0
  190. package/dist/cli/chunks/{cline-installer-OWQ4D2FQ.js → cline-installer-RYLHCDK7.js} +2 -2
  191. package/dist/cli/chunks/{code-2ZRL7SEU.js → code-WY3GJXHX.js} +3 -3
  192. package/dist/cli/chunks/{code-index-extractor-JXSQVM67.js → code-index-extractor-Y4MZBZCW.js} +2 -2
  193. package/dist/cli/chunks/{codex-installer-7LXZYBSQ.js → codex-installer-SCJ3T3DX.js} +4 -4
  194. package/dist/cli/chunks/{completions-C2LR623C.js → completions-CN2DXQFU.js} +2 -2
  195. package/dist/cli/chunks/{complexity-analyzer-TGQLHCYJ.js → complexity-analyzer-7MDPPIBH.js} +2 -2
  196. package/dist/cli/chunks/{continuedev-installer-RUGD24D2.js → continuedev-installer-GCEJRK34.js} +2 -2
  197. package/dist/cli/chunks/{copilot-installer-ZLFVLEJP.js → copilot-installer-BHPDSELY.js} +2 -2
  198. package/dist/cli/chunks/core-handlers-47MPMED7.js +2 -0
  199. package/dist/cli/chunks/{cost-tracker-RT4QL745.js → cost-tracker-VO5MFWR6.js} +2 -2
  200. package/dist/cli/chunks/coverage-LYFQYNH6.js +51 -0
  201. package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +2 -0
  202. package/dist/cli/chunks/{cursor-installer-LJKLNFF6.js → cursor-installer-KP4HA7TV.js} +2 -2
  203. package/dist/cli/chunks/{daemon-BMDXCQT5.js → daemon-7RC7TS57.js} +3 -3
  204. package/dist/cli/chunks/{daemon-FBH3IRYN.js → daemon-AXLVPKVO.js} +4 -4
  205. package/dist/cli/chunks/{dag-attention-scheduler-JGDED55I.js → dag-attention-scheduler-NKA44RSR.js} +2 -2
  206. package/dist/cli/chunks/{detect-SZIHIVCJ.js → detect-CMYAJWYF.js} +2 -2
  207. package/dist/cli/chunks/{dist-node-FV3KWXQ6.js → dist-node-EN3PYEGW.js} +2 -2
  208. package/dist/cli/chunks/{domain-handler-GI5JWQOV.js → domain-handler-EXSZCX7A.js} +2 -2
  209. package/dist/cli/chunks/{domain-plugins-BUWY36TL.js → domain-plugins-HCQFSNL7.js} +2 -2
  210. package/dist/cli/chunks/{domain-transfer-GCY7W5DA.js → domain-transfer-3LGSNTPO.js} +2 -2
  211. package/dist/cli/chunks/dream-76L6EEN7.js +2 -0
  212. package/dist/cli/chunks/{embed-and-insert-pattern-GPRR3ZGD.js → embed-and-insert-pattern-B6MNHICW.js} +2 -2
  213. package/dist/cli/chunks/{eval-XPB3IGAP.js → eval-OQELIWJK.js} +2 -2
  214. package/dist/cli/chunks/{experience-capture-middleware-2E554UB3.js → experience-capture-middleware-SUFILYPW.js} +3 -3
  215. package/dist/cli/chunks/{fast-paths-ZSMWZPUC.js → fast-paths-UV4NDEWM.js} +2 -2
  216. package/dist/cli/chunks/{feature-flags-GIWVDVVC.js → feature-flags-CKTYX67J.js} +2 -2
  217. package/dist/cli/chunks/{feature-flags-N7EOGE5P.js → feature-flags-H7H33B6C.js} +2 -2
  218. package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +2 -0
  219. package/dist/cli/chunks/{fleet-HCHDOUCX.js → fleet-ZJBCAKRG.js} +3 -3
  220. package/dist/cli/chunks/{gnn-wrapper-CZNCNXXZ.js → gnn-wrapper-RUE2QZRG.js} +2 -2
  221. package/dist/cli/chunks/{heartbeat-handler-6YUIF2YQ.js → heartbeat-handler-XRV327M7.js} +4 -4
  222. package/dist/cli/chunks/heartbeat-scheduler-NIK3KKEH.js +2 -0
  223. package/dist/cli/chunks/hnsw-adapter-WJG7LUJJ.js +2 -0
  224. package/dist/cli/chunks/hnsw-index-D6PRI5HC.js +2 -0
  225. package/dist/cli/chunks/{hnsw-legacy-bridge-J3M3IK24.js → hnsw-legacy-bridge-UJID6ZZ4.js} +2 -2
  226. package/dist/cli/chunks/{hnswlib-node-ULGTGDZW.js → hnswlib-node-WS43R4AX.js} +2 -2
  227. package/dist/cli/chunks/{hooks-C4BUGYUQ.js → hooks-YZNJKXAJ.js} +10 -10
  228. package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +2 -0
  229. package/dist/cli/chunks/{hypergraph-engine-WINGVMPG.js → hypergraph-engine-XQJSIMTS.js} +2 -2
  230. package/dist/cli/chunks/{hypergraph-handler-GADMWKAU.js → hypergraph-handler-ZD2NYXMR.js} +3 -3
  231. package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +2 -0
  232. package/dist/cli/chunks/{init-guard-K2T4QWAO.js → init-guard-DSRUAVRT.js} +2 -2
  233. package/dist/cli/chunks/{init-handler-PCZTDZYI.js → init-handler-RJU5QMAP.js} +6 -6
  234. package/dist/cli/chunks/init-wizard-JCKNGIGT.js +2 -0
  235. package/dist/cli/chunks/kernel-F7ILJTYD.js +2 -0
  236. package/dist/cli/chunks/{kilocode-installer-XENXNEIU.js → kilocode-installer-BCPOCVMC.js} +2 -2
  237. package/dist/cli/chunks/{kiro-installer-3PG2TJ67.js → kiro-installer-GFCWCB2S.js} +2 -2
  238. package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +2 -0
  239. package/dist/cli/chunks/learning-FZTD72CF.js +131 -0
  240. package/dist/cli/chunks/{llm-router-RKVDEWU2.js → llm-router-GJVKGRJL.js} +4 -4
  241. package/dist/cli/chunks/llm-router-service-TNOWQINA.js +2 -0
  242. package/dist/cli/chunks/{load-ITHC564X.js → load-YKTPOYBE.js} +2 -2
  243. package/dist/cli/chunks/load-test-FPVBK2EV.js +2 -0
  244. package/dist/cli/chunks/{mcp-TCL5UW3N.js → mcp-LT6R2IKS.js} +2 -2
  245. package/dist/cli/chunks/{memory-BKDAY2N2.js → memory-4HKKOLRY.js} +5 -5
  246. package/dist/cli/chunks/memory-backend-2QE7O67A.js +2 -0
  247. package/dist/cli/chunks/{memory-handlers-WN4FXFOA.js → memory-handlers-X4CMVBXB.js} +2 -2
  248. package/dist/cli/chunks/{multi-model-executor-VHAT7ZPF.js → multi-model-executor-2YPM2WTK.js} +2 -2
  249. package/dist/cli/chunks/{opencode-installer-E3VM3EEY.js → opencode-installer-WBAJMH5K.js} +2 -2
  250. package/dist/cli/chunks/{orchestrator-BMQ6X762.js → orchestrator-5W5WVMVJ.js} +109 -25
  251. package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +2 -0
  252. package/dist/cli/chunks/{pattern-usage-recorder-GOOR2BV5.js → pattern-usage-recorder-GXRMNPAZ.js} +2 -2
  253. package/dist/cli/chunks/{pipeline-5NSFQQIX.js → pipeline-2NA4DRDA.js} +2 -2
  254. package/dist/cli/chunks/{platform-SQM34J5G.js → platform-BGERNQ5V.js} +2 -2
  255. package/dist/cli/chunks/{plugin-UQJZRMZG.js → plugin-L4EPVENR.js} +2 -2
  256. package/dist/cli/chunks/{prime-radiant-advanced-wasm-WMDJOL4S.js → prime-radiant-advanced-wasm-RTQRTPTM.js} +2 -2
  257. package/dist/cli/chunks/project-root-S7WDFTMU.js +2 -0
  258. package/dist/cli/chunks/protocol-executor-OPANXQVB.js +2 -0
  259. package/dist/cli/chunks/{protocol-handler-OBDCVY6X.js → protocol-handler-SYQXM6JK.js} +2 -2
  260. package/dist/cli/chunks/{prove-XDC7I4XT.js → prove-5O7GPJCU.js} +2 -2
  261. package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +2 -0
  262. package/dist/cli/chunks/{quality-L4GQ6WX4.js → quality-KIIDHGNF.js} +2 -2
  263. package/dist/cli/chunks/{quality-gate-MJG66LKN.js → quality-gate-H65VECD3.js} +3 -3
  264. package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +2 -0
  265. package/dist/cli/chunks/{real-embeddings-HW4G2LWL.js → real-embeddings-DYIOLKQ3.js} +2 -2
  266. package/dist/cli/chunks/{ref-validation-FC7JOJ2C.js → ref-validation-CSBJOMZM.js} +2 -2
  267. package/dist/cli/chunks/{roocode-installer-KWS4CEIC.js → roocode-installer-G7OVYXEN.js} +2 -2
  268. package/dist/cli/chunks/router-DBBW4NC2.js +2 -0
  269. package/dist/cli/chunks/routing-feedback-W35QHCL4.js +2 -0
  270. package/dist/cli/chunks/{routing-handler-QF4WVB2S.js → routing-handler-ZNZPPI5Y.js} +2 -2
  271. package/dist/cli/chunks/{ruvector-commands-2MTCOUK6.js → ruvector-commands-C6IG3OY3.js} +2 -2
  272. package/dist/cli/chunks/rvf-dual-writer-X3NSL25Z.js +2 -0
  273. package/dist/cli/chunks/rvf-migration-adapter-TZR7GDOK.js +2 -0
  274. package/dist/cli/chunks/{rvf-migration-coordinator-BREJCXWN.js → rvf-migration-coordinator-4ATTHGHD.js} +2 -2
  275. package/dist/cli/chunks/rvf-native-adapter-HD25ZYV5.js +2 -0
  276. package/dist/cli/chunks/{rvf-store-integrity-KKC6HOJD.js → rvf-store-integrity-3G6LFLT3.js} +2 -2
  277. package/dist/cli/chunks/safe-db-ZS2QKANY.js +2 -0
  278. package/dist/cli/chunks/schedule-ZH6VNA32.js +2 -0
  279. package/dist/cli/chunks/scheduler-T6CD74B6.js +2 -0
  280. package/dist/cli/chunks/{security-OSAE7VAP.js → security-A3IMVLFM.js} +3 -3
  281. package/dist/cli/chunks/{shared-rvf-adapter-COUOS665.js → shared-rvf-adapter-VHWQ6US5.js} +2 -2
  282. package/dist/cli/chunks/{shared-rvf-dual-writer-YXMPZKQE.js → shared-rvf-dual-writer-JB3QS7IG.js} +2 -2
  283. package/dist/cli/chunks/sqlite-persistence-47WU5EKZ.js +2 -0
  284. package/dist/cli/chunks/{standalone-memory-E6JBMOIL.js → standalone-memory-DDNXCSBD.js} +2 -2
  285. package/dist/cli/chunks/{status-handler-AFTCIYIX.js → status-handler-2HK7XPEK.js} +2 -2
  286. package/dist/cli/chunks/{structural-health-2FROCEI4.js → structural-health-DSJVLEPV.js} +2 -2
  287. package/dist/cli/chunks/{sync-VAYTOWDC.js → sync-3MUV6S5E.js} +2 -2
  288. package/dist/cli/chunks/{sync-YIQYOFGW.js → sync-NTUR53PI.js} +2 -2
  289. package/dist/cli/chunks/{task-handler-KVQHDEX3.js → task-handler-74MZN2EO.js} +2 -2
  290. package/dist/cli/chunks/{task-handlers-MVVECQA6.js → task-handlers-VJR6EHRZ.js} +3 -3
  291. package/dist/cli/chunks/{test-5JSVTOMY.js → test-O6FK3FVF.js} +4 -4
  292. package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +2 -0
  293. package/dist/cli/chunks/{test-scheduling-HBOHVLI3.js → test-scheduling-Q6QEEOS6.js} +3 -3
  294. package/dist/cli/chunks/{token-bootstrap-5VEPTPFA.js → token-bootstrap-TTRCECLP.js} +2 -2
  295. package/dist/cli/chunks/{token-usage-TBJHDLY6.js → token-usage-YEEFWSSI.js} +2 -2
  296. package/dist/cli/chunks/{transformers-VAWYMHMZ.js → transformers-BZCHJJJT.js} +2 -2
  297. package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +2 -0
  298. package/dist/cli/chunks/{types-R5SDZU2E.js → types-4AOKZYOX.js} +2 -2
  299. package/dist/cli/chunks/unified-memory-FZ5K2C7W.js +2 -0
  300. package/dist/cli/chunks/unified-memory-hnsw-VREWX56M.js +2 -0
  301. package/dist/cli/chunks/unified-persistence-YZGMKX6B.js +2 -0
  302. package/dist/cli/chunks/{upgrade-K5PIHXRB.js → upgrade-2MWW6BT2.js} +2 -2
  303. package/dist/cli/chunks/{validate-RPTS7RYJ.js → validate-PAEV3GT5.js} +2 -2
  304. package/dist/cli/chunks/{validate-swarm-B2ZL556X.js → validate-swarm-ZIXACK5K.js} +2 -2
  305. package/dist/cli/chunks/visual-security-GXGSFBVA.js +2 -0
  306. package/dist/cli/chunks/{web-tree-sitter-K4DUJC32.js → web-tree-sitter-VLTXZFAB.js} +2 -2
  307. package/dist/cli/chunks/{windsurf-installer-OK2AJN35.js → windsurf-installer-VELMLOZF.js} +2 -2
  308. package/dist/cli/chunks/witness-chain-MRJKVCOW.js +2 -0
  309. package/dist/cli/chunks/witness-chain-WWHJKITG.js +2 -0
  310. package/dist/cli/chunks/{witness-chain-repair-L6Y5RFXR.js → witness-chain-repair-5SAXPETG.js} +2 -2
  311. package/dist/cli/chunks/{witness-chain-verifier-N4CW7FZX.js → witness-chain-verifier-MIDWD4JS.js} +2 -2
  312. package/dist/cli/chunks/{witness-key-manager-TDNPS3WD.js → witness-key-manager-OSVCWOB2.js} +2 -2
  313. package/dist/cli/chunks/{workflow-XRZA3YCY.js → workflow-MK7A7QCX.js} +4 -4
  314. package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +2 -0
  315. package/dist/cli/chunks/{wrappers-5JIFWKN6.js → wrappers-5QFMCKXL.js} +2 -2
  316. package/dist/cli/commands/coverage.js +6 -0
  317. package/dist/cli/commands/learning-prune.d.ts +14 -0
  318. package/dist/cli/commands/learning-prune.js +105 -0
  319. package/dist/cli/commands/learning.js +9 -0
  320. package/dist/cli/handlers/brain-handler.js +12 -1
  321. package/dist/cli/utils/coverage-verdict.js +14 -3
  322. package/dist/context/compaction/index.d.ts +7 -0
  323. package/dist/context/compaction/index.js +30 -6
  324. package/dist/coordination/handlers/coverage-evidence.d.ts +19 -0
  325. package/dist/coordination/handlers/coverage-evidence.js +31 -2
  326. package/dist/coordination/handlers/coverage-handlers.js +5 -1
  327. package/dist/coordination/handlers/coverage-target.js +8 -1
  328. package/dist/coordination/handlers/quality-handlers.js +9 -1
  329. package/dist/coordination/result-saver-adapters.js +1 -0
  330. package/dist/coordination/result-saver.js +9 -5
  331. package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +1 -0
  332. package/dist/domains/chaos-resilience/services/chaos-engineer.js +23 -45
  333. package/dist/domains/coverage-analysis/collected-metrics.d.ts +22 -6
  334. package/dist/domains/coverage-analysis/collected-metrics.js +37 -12
  335. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +2 -0
  336. package/dist/domains/defect-intelligence/services/defect-predictor.js +3 -6
  337. package/dist/domains/quality-assessment/coverage-report-event.d.ts +8 -0
  338. package/dist/domains/quality-assessment/coverage-report-event.js +22 -1
  339. package/dist/domains/quality-assessment/interfaces.d.ts +6 -0
  340. package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +4 -0
  341. package/dist/domains/quality-assessment/services/quality-analyzer.js +63 -17
  342. package/dist/domains/test-execution/interfaces.d.ts +5 -0
  343. package/dist/domains/test-execution/services/test-executor.js +6 -0
  344. package/dist/init/init-wizard-hooks.d.ts +1 -1
  345. package/dist/init/init-wizard-hooks.js +7 -8
  346. package/dist/init/phases/07-hooks.js +90 -6
  347. package/dist/init/phases/08-mcp.js +9 -0
  348. package/dist/init/settings-merge.d.ts +13 -0
  349. package/dist/init/settings-merge.js +49 -2
  350. package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
  351. package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
  352. package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
  353. package/dist/integrations/agent-booster-wasm/index.js +25 -2
  354. package/dist/integrations/agent-booster-wasm/package.json +16 -0
  355. package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +25 -0
  356. package/dist/integrations/ruvector/brain-rvf-exporter.js +154 -61
  357. package/dist/learning/dream/dream-engine.d.ts +27 -3
  358. package/dist/learning/dream/dream-engine.js +97 -28
  359. package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
  360. package/dist/learning/dream/dream-lock-retry.js +66 -0
  361. package/dist/learning/dream/speculative-dreamer.js +1 -1
  362. package/dist/learning/learning-retention.d.ts +103 -0
  363. package/dist/learning/learning-retention.js +213 -0
  364. package/dist/mcp/bundle.js +501 -496
  365. package/dist/mcp/handlers/domain-handler-configs.d.ts +9 -1
  366. package/dist/mcp/handlers/domain-handler-configs.js +24 -14
  367. package/dist/mcp/protocol-server.js +1 -1
  368. package/dist/mcp/tools/chaos-resilience/inject.d.ts +3 -4
  369. package/dist/mcp/tools/chaos-resilience/inject.js +11 -81
  370. package/dist/mcp/tools/learning-optimization/dream.d.ts +8 -0
  371. package/dist/mcp/tools/learning-optimization/dream.js +4 -0
  372. package/package.json +4 -2
  373. package/dist/cli/chunks/adapter-KCQDVYY2.js +0 -2
  374. package/dist/cli/chunks/agent-booster-wasm-6RRQWMNE.js +0 -2
  375. package/dist/cli/chunks/aqe-learning-engine-SAQOHSGN.js +0 -2
  376. package/dist/cli/chunks/base-WCACU3FN.js +0 -2
  377. package/dist/cli/chunks/brain-handler-GTQNHHZS.js +0 -94
  378. package/dist/cli/chunks/browser-workflow-G6IASEAP.js +0 -2
  379. package/dist/cli/chunks/chunk-C6JTLKG7.js +0 -141
  380. package/dist/cli/chunks/chunk-K65CGKLD.js +0 -8
  381. package/dist/cli/chunks/chunk-MB46UBGY.js +0 -3
  382. package/dist/cli/chunks/chunk-N4CYAKOX.js +0 -79
  383. package/dist/cli/chunks/chunk-PT4FMJPQ.js +0 -3
  384. package/dist/cli/chunks/chunk-S5AZCIZS.js +0 -2
  385. package/dist/cli/chunks/chunk-UT2VZ33P.js +0 -2
  386. package/dist/cli/chunks/client-TV3V2YZ5.js +0 -2
  387. package/dist/cli/chunks/core-handlers-PZT4OLWR.js +0 -2
  388. package/dist/cli/chunks/coverage-NV3C4IMM.js +0 -50
  389. package/dist/cli/chunks/cross-domain-router-QOFCZ7G4.js +0 -2
  390. package/dist/cli/chunks/dream-TRFBGDSQ.js +0 -2
  391. package/dist/cli/chunks/file-discovery-WCKGMSPZ.js +0 -2
  392. package/dist/cli/chunks/heartbeat-scheduler-P44A2OX3.js +0 -2
  393. package/dist/cli/chunks/hnsw-adapter-ZJQIQJKC.js +0 -2
  394. package/dist/cli/chunks/hnsw-index-HMG2GH3Z.js +0 -2
  395. package/dist/cli/chunks/hybrid-backend-B7M74PZG.js +0 -2
  396. package/dist/cli/chunks/impact-analyzer-PZYOVKQO.js +0 -2
  397. package/dist/cli/chunks/init-wizard-TZDJQK3U.js +0 -2
  398. package/dist/cli/chunks/kernel-Y6RRIOKW.js +0 -2
  399. package/dist/cli/chunks/knowledge-graph-BVD5Z66M.js +0 -2
  400. package/dist/cli/chunks/learning-6KDH7FK4.js +0 -122
  401. package/dist/cli/chunks/llm-router-service-KHCAMSUU.js +0 -2
  402. package/dist/cli/chunks/load-test-RUF7DZA5.js +0 -2
  403. package/dist/cli/chunks/memory-backend-7ZLFOVGG.js +0 -2
  404. package/dist/cli/chunks/pattern-null-store-RY6CVYHP.js +0 -2
  405. package/dist/cli/chunks/project-root-IO5KRNGL.js +0 -2
  406. package/dist/cli/chunks/protocol-executor-U2CUDWDE.js +0 -2
  407. package/dist/cli/chunks/qe-reasoning-bank-DQSSX2IP.js +0 -2
  408. package/dist/cli/chunks/queen-coordinator-6FN4BZIX.js +0 -2
  409. package/dist/cli/chunks/router-YUO3I7RU.js +0 -2
  410. package/dist/cli/chunks/routing-feedback-36SLQGJE.js +0 -2
  411. package/dist/cli/chunks/rvf-dual-writer-FRYZH3WZ.js +0 -2
  412. package/dist/cli/chunks/rvf-migration-adapter-XXNITL5I.js +0 -2
  413. package/dist/cli/chunks/rvf-native-adapter-D2WWKJIV.js +0 -2
  414. package/dist/cli/chunks/safe-db-4RRIGRXD.js +0 -2
  415. package/dist/cli/chunks/schedule-25RTO4DQ.js +0 -2
  416. package/dist/cli/chunks/scheduler-BPIOJZ5P.js +0 -2
  417. package/dist/cli/chunks/sqlite-persistence-EDF47DDX.js +0 -2
  418. package/dist/cli/chunks/test-runner-process-LEPF2OSS.js +0 -2
  419. package/dist/cli/chunks/tree-sitter-wasm-parser-TSZTCMFV.js +0 -2
  420. package/dist/cli/chunks/unified-memory-TLGSSLMI.js +0 -2
  421. package/dist/cli/chunks/unified-memory-hnsw-MSUR7ZOO.js +0 -2
  422. package/dist/cli/chunks/unified-persistence-VFFOTWK7.js +0 -2
  423. package/dist/cli/chunks/visual-security-6Q44XNLB.js +0 -2
  424. package/dist/cli/chunks/witness-chain-KDOMXDQX.js +0 -2
  425. package/dist/cli/chunks/witness-chain-N3OY2RMH.js +0 -2
  426. package/dist/cli/chunks/workflow-orchestrator-CVNNT2RJ.js +0 -2
@@ -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.15.13");process.exit(0)}
2
- import{a as b}from"./chunk-LL7LDPXS.js";import{a as f,e as O}from"./chunk-3Y2ROSCL.js";import"./chunk-ZAKQLAHT.js";O();import{existsSync as l,mkdirSync as h,readdirSync as v,readFileSync as k,writeFileSync as R}from"fs";import{join as o}from"path";import{parse as y,stringify as D}from"yaml";var E=new Set(["read","edit","glob","grep","list","bash","task","external_directory","todowrite","webfetch","websearch","lsp","skill","question","doom_loop"]),$={fetch:"webfetch",write:"edit"},w=class{projectRoot;options;sourceDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installAgents:!0,installSkills:!0,installTools:!1,overwrite:!1,...e},this.sourceDir=this.findSourceDir()}findSourceDir(){let e=o(this.projectRoot,".opencode"),t=b(import.meta.url),s=[];t&&s.push(o(t,".opencode")),s.push(o(this.projectRoot,"node_modules/agentic-qe/.opencode"));for(let n of s)if(n!==e&&this.isValidSourceDir(n))return n;return s[0]??o(this.projectRoot,"node_modules/agentic-qe/.opencode")}isValidSourceDir(e){return l(e)?l(o(e,"agents"))||l(o(e,"skills")):!1}async install(){let e=o(this.projectRoot,".opencode"),t={success:!0,agentsInstalled:[],skillsInstalled:[],toolsInstalled:[],permissionsInstalled:!1,errors:[],targetDir:e};try{if(!l(this.sourceDir))return t.errors.push(`Source .opencode directory not found: ${this.sourceDir}`),t.success=!1,t;let s=this.loadPermissionsYaml();if(this.options.installAgents){let n=this.installAgents(e,s);t.agentsInstalled=n.installed,t.errors.push(...n.errors),t.permissionsInstalled=t.agentsInstalled.length>0}if(this.options.installSkills){let n=this.installSkills(e);t.skillsInstalled=n.installed,t.errors.push(...n.errors)}this.generateOpenCodeConfig()}catch(s){t.success=!1,t.errors.push(`Installation failed: ${f(s)}`)}return t}loadPermissionsYaml(){let e={defaults:{},agents:{}},t=o(this.sourceDir,"permissions.yaml");if(!l(t))return e;try{let s=y(k(t,"utf-8"));return{defaults:s?.defaults??{},agents:s?.agents??{}}}catch{return e}}buildPermission(e,t,s){let n={...s.defaults,...t??{},...s.agents[e]??{}},a={};for(let[c,i]of Object.entries(n)){if(c.includes(":"))continue;let r=$[c]??c;E.has(r)&&(a[r]=i)}return a}installAgents(e,t){let s=[],n=[],a=o(this.sourceDir,"agents"),c=o(e,"agent");if(!l(a))return n.push(`Source agents directory not found: ${a}`),{installed:s,errors:n};l(c)||h(c,{recursive:!0});for(let i of v(a).filter(r=>r.endsWith(".yaml")))try{let r=y(k(o(a,i),"utf-8")),d=r.name||i.replace(/\.yaml$/,""),g=o(c,`${d}.md`);if(l(g)&&!this.options.overwrite)continue;let u={description:(r.description||d).replace(/\s+/g," ").trim(),mode:"subagent"},p=this.buildPermission(d,r.permissions,t);Object.keys(p).length>0&&(u.permission=p);let m=(r.systemPrompt||"").trimEnd()+`
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.15.15");process.exit(0)}
2
+ import{a as b}from"./chunk-7ACCBHRB.js";import{a as f,e as O}from"./chunk-HL2ANKN3.js";import"./chunk-XH4JMX5O.js";O();import{existsSync as l,mkdirSync as h,readdirSync as v,readFileSync as k,writeFileSync as R}from"fs";import{join as o}from"path";import{parse as y,stringify as D}from"yaml";var E=new Set(["read","edit","glob","grep","list","bash","task","external_directory","todowrite","webfetch","websearch","lsp","skill","question","doom_loop"]),$={fetch:"webfetch",write:"edit"},w=class{projectRoot;options;sourceDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installAgents:!0,installSkills:!0,installTools:!1,overwrite:!1,...e},this.sourceDir=this.findSourceDir()}findSourceDir(){let e=o(this.projectRoot,".opencode"),t=b(import.meta.url),s=[];t&&s.push(o(t,".opencode")),s.push(o(this.projectRoot,"node_modules/agentic-qe/.opencode"));for(let n of s)if(n!==e&&this.isValidSourceDir(n))return n;return s[0]??o(this.projectRoot,"node_modules/agentic-qe/.opencode")}isValidSourceDir(e){return l(e)?l(o(e,"agents"))||l(o(e,"skills")):!1}async install(){let e=o(this.projectRoot,".opencode"),t={success:!0,agentsInstalled:[],skillsInstalled:[],toolsInstalled:[],permissionsInstalled:!1,errors:[],targetDir:e};try{if(!l(this.sourceDir))return t.errors.push(`Source .opencode directory not found: ${this.sourceDir}`),t.success=!1,t;let s=this.loadPermissionsYaml();if(this.options.installAgents){let n=this.installAgents(e,s);t.agentsInstalled=n.installed,t.errors.push(...n.errors),t.permissionsInstalled=t.agentsInstalled.length>0}if(this.options.installSkills){let n=this.installSkills(e);t.skillsInstalled=n.installed,t.errors.push(...n.errors)}this.generateOpenCodeConfig()}catch(s){t.success=!1,t.errors.push(`Installation failed: ${f(s)}`)}return t}loadPermissionsYaml(){let e={defaults:{},agents:{}},t=o(this.sourceDir,"permissions.yaml");if(!l(t))return e;try{let s=y(k(t,"utf-8"));return{defaults:s?.defaults??{},agents:s?.agents??{}}}catch{return e}}buildPermission(e,t,s){let n={...s.defaults,...t??{},...s.agents[e]??{}},a={};for(let[c,i]of Object.entries(n)){if(c.includes(":"))continue;let r=$[c]??c;E.has(r)&&(a[r]=i)}return a}installAgents(e,t){let s=[],n=[],a=o(this.sourceDir,"agents"),c=o(e,"agent");if(!l(a))return n.push(`Source agents directory not found: ${a}`),{installed:s,errors:n};l(c)||h(c,{recursive:!0});for(let i of v(a).filter(r=>r.endsWith(".yaml")))try{let r=y(k(o(a,i),"utf-8")),d=r.name||i.replace(/\.yaml$/,""),g=o(c,`${d}.md`);if(l(g)&&!this.options.overwrite)continue;let u={description:(r.description||d).replace(/\s+/g," ").trim(),mode:"subagent"},p=this.buildPermission(d,r.permissions,t);Object.keys(p).length>0&&(u.permission=p);let m=(r.systemPrompt||"").trimEnd()+`
3
3
  `;R(g,this.renderFrontmatter(u)+`
4
4
  `+m),s.push(d)}catch(r){n.push(`Failed to convert agent ${i}: ${f(r)}`)}return{installed:s,errors:n}}installSkills(e){let t=[],s=[],n=o(this.sourceDir,"skills"),a=o(e,"skills");if(!l(n))return s.push(`Source skills directory not found: ${n}`),{installed:t,errors:s};l(a)||h(a,{recursive:!0});for(let c of v(n).filter(i=>i.endsWith(".yaml")))try{let i=y(k(o(n,c),"utf-8")),r=(i.name||c.replace(/\.yaml$/,"")).toLowerCase();if(!/^[a-z0-9]+(-[a-z0-9]+)*$/.test(r)){s.push(`Skipped skill with non-conforming name: ${r}`);continue}let d=o(a,r),g=o(d,"SKILL.md");if(l(g)&&!this.options.overwrite)continue;l(d)||h(d,{recursive:!0});let u=(i.description||r).replace(/\s+/g," ").trim();u.length>1024&&(u=u.slice(0,1021)+"...");let p="";for(let m of i.steps??[]){p+=`## ${m.name||"step"}
5
5
 
@@ -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.15.13");process.exit(0)}
2
- import{a as Qe}from"./chunk-7JUC2MVZ.js";import{a as ue,b as ve,c as Fe,d as Ne,e as We,f as Ve,g as Ge,h as He,i as Ue,j as Ke,k as ze,l as Je,m as Ye,n as be,o as Ze,p as et}from"./chunk-OFACHK5O.js";import{a as W,b as me,c as Le,e as Be,f as V}from"./chunk-WNQS4WTS.js";import{a as Xe}from"./chunk-LL7LDPXS.js";import"./chunk-5ZGM3RMH.js";import{c as Me}from"./chunk-IJUHSJ2U.js";import"./chunk-KDVZND5Q.js";import"./chunk-E7CLYGS7.js";import"./chunk-6KATY3KS.js";import"./chunk-LWR3FV3Y.js";import"./chunk-3Y7TJFHU.js";import"./chunk-7CMTY45A.js";import{b as x,d as de}from"./chunk-VTOBUZL6.js";import"./chunk-KDNJ4F3P.js";import"./chunk-JRRXCODW.js";import"./chunk-XNBOGCF3.js";import"./chunk-KV4T4MXK.js";import"./chunk-TWDW32W2.js";import"./chunk-AQSVJNEH.js";import"./chunk-OCAEXYFA.js";import"./chunk-DVGRPK7A.js";import"./chunk-NURIILUB.js";import"./chunk-TOQWL2ZF.js";import"./chunk-UT2VZ33P.js";import"./chunk-GB6HBNH2.js";import"./chunk-UOC3O6RP.js";import"./chunk-NT4DBXSX.js";import"./chunk-WOCGL4QP.js";import"./chunk-J2ZIFFM6.js";import"./chunk-RF7HWBHN.js";import{a as Te,b as Oe,c as Rt,d as D,e as ye}from"./chunk-DNDL7SOS.js";import{a as P,b as je,e as Q}from"./chunk-3Y2ROSCL.js";import"./chunk-WO274FRI.js";import{a as It}from"./chunk-ZAKQLAHT.js";Q();Q();var v=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:je(s),durationMs:Date.now()-t,message:`${this.description} failed: ${P(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}};de();ye();import{existsSync as T}from"fs";import{join as O}from"path";var G=class extends v{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=T(O(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,d=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:d,v2Detection:s}}async detectV2Installation(e){let t=O(e,".agentic-qe","memory.db"),s=O(e,".agentic-qe","config"),n=O(e,".claude","agents"),o=O(e,".agentic-qe","config","learning.json"),r=T(t),i=T(s),d=T(n),m=T(o),l=T(O(e,".agentic-qe","config.yaml")),u,p=!1;return r&&(u=this.readVersionFromDb(t),u?p=u.startsWith("3."):u="2.x.x"),{detected:!p&&r&&(!u?.startsWith("3.")||m&&!l),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:d?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:d,version:u}}readVersionFromDb(e){try{let t=D(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.15.15");process.exit(0)}
2
+ import{a as Ve}from"./chunk-XG4F4XH4.js";import{a as ue,b as ke,c as Ne,d as Le,e as We,f as He,g as Ge,h as Ue,i as Ke,j as ze,k as Je,l as Ye,m as Xe,n as Ze,o as et,p as ve,q as tt,r as nt}from"./chunk-UORB2QDU.js";import{a as V,b as pe,c as Be,e as Qe,f as W}from"./chunk-C5CXL3JP.js";import"./chunk-J3FP5UGL.js";import{a as Fe}from"./chunk-7ACCBHRB.js";import{c as Me}from"./chunk-5AFVEWMT.js";import"./chunk-6KCSKGVY.js";import"./chunk-KCQNFBBR.js";import"./chunk-DUKE27HC.js";import"./chunk-6LE362LZ.js";import"./chunk-T66PPF4D.js";import"./chunk-337Z52QM.js";import{b as x,d as de}from"./chunk-XWIAZG3C.js";import"./chunk-5G4UFTV4.js";import"./chunk-DEKR3CTS.js";import"./chunk-4X3SWKBA.js";import"./chunk-W62OOK7A.js";import"./chunk-GCHYOPRZ.js";import"./chunk-DKX4GNRU.js";import"./chunk-PXATBHWN.js";import"./chunk-5I7357KS.js";import"./chunk-LJMYRTJ7.js";import"./chunk-G242G224.js";import"./chunk-3HVFIITW.js";import"./chunk-BQ47GQPK.js";import"./chunk-ZWBGYJ7K.js";import"./chunk-UJABDXST.js";import"./chunk-6YVMX2TC.js";import"./chunk-SZAZQZWI.js";import"./chunk-MPFPWJTH.js";import{a as Oe,b as je,c as Dt,d as D,e as ye}from"./chunk-FOOW4JVS.js";import{a as S,b as qe,e as Q}from"./chunk-HL2ANKN3.js";import"./chunk-BZULJMGH.js";import{a as xt}from"./chunk-XH4JMX5O.js";Q();Q();var k=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:qe(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}};de();ye();import{existsSync as O}from"fs";import{join as j}from"path";var H=class extends k{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=O(j(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,d=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:d,v2Detection:s}}async detectV2Installation(e){let t=j(e,".agentic-qe","memory.db"),s=j(e,".agentic-qe","config"),n=j(e,".claude","agents"),o=j(e,".agentic-qe","config","learning.json"),r=O(t),i=O(s),d=O(n),p=O(o),l=O(j(e,".agentic-qe","config.yaml")),u,m=!1;return r&&(u=this.readVersionFromDb(t),u?m=u.startsWith("3."):u="2.x.x"),{detected:!m&&r&&(!u?.startsWith("3.")||p&&!l),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:d?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:d,version:u}}readVersionFromDb(e){try{let t=D(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 H=class extends v{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await Fe(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 U=class extends v{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=Ne({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 K,mkdirSync as ke}from"fs";import{join as z}from"path";Q();Rt();var J=class extends v{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async shouldRun(e){return e.options.memoryBackend!=="memory"}async run(e){let{projectRoot:t}=e,s=z(t,"vectors.db");K(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 G=class extends k{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await Ne(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 U=class extends k{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=Le({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 K,mkdirSync as be}from"fs";import{join as z}from"path";Q();Dt();var J=class extends k{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async shouldRun(e){return e.options.memoryBackend!=="memory"}async run(e){let{projectRoot:t}=e,s=z(t,"vectors.db");K(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=z(t,".agentic-qe");K(n)||ke(n,{recursive:!0});let o=z(n,"workers");K(o)||ke(o,{recursive:!0});let r=z(n,"data");K(r)||ke(r,{recursive:!0});let i=z(n,"memory.db"),d=!K(i);try{let{initializeUnifiedMemory:m,resetUnifiedMemory:l}=await import("./unified-memory-TLGSSLMI.js"),u=await m({dbPath:i,walMode:!0,busyTimeout:5e3}),y=u.getStats().tables.map(B=>B.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:ue()},"_system");let E=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return l(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${E}`),e.services.log(` Tables: ${y.length} (v3 full schema)`),{dbPath:i,created:d,tablesCreated:y,schemaVersion:E}}catch(m){throw Oe(m)?new Error(`SQLite persistence initialization FAILED: ${P(Te(m))}`,{cause:m}):new Error(`SQLite persistence initialization FAILED: ${m}
11
+ rm "${s}"`);let n=z(t,".agentic-qe");K(n)||be(n,{recursive:!0});let o=z(n,"workers");K(o)||be(o,{recursive:!0});let r=z(n,"data");K(r)||be(r,{recursive:!0});let i=z(n,"memory.db"),d=!K(i);try{let{initializeUnifiedMemory:p,resetUnifiedMemory:l}=await import("./unified-memory-FZ5K2C7W.js"),u=await p({dbPath:i,walMode:!0,busyTimeout:5e3}),y=u.getStats().tables.map(B=>B.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:ue()},"_system");let E=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return l(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${E}`),e.services.log(` Tables: ${y.length} (v3 full schema)`),{dbPath:i,created:d,tablesCreated:y,schemaVersion:E}}catch(p){throw je(p)?new Error(`SQLite persistence initialization FAILED: ${S(Oe(p))}`,{cause:p}):new Error(`SQLite persistence initialization FAILED: ${p}
12
12
  Database path: ${i}
13
- Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as pe,mkdirSync as we,writeFileSync as At}from"fs";import{join as $}from"path";var Y=class extends v{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.options.memoryBackend==="memory"?!1: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");pe(o)||we(o,{recursive:!0});let r=$(o,"hnsw");pe(r)||we(r,{recursive:!0});let i=$(o,"learning-config.json"),d={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()};V(i,d,[["initialized"]]);let m=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(m=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${m}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:m}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");pe(s)||we(s,{recursive:!0});let n=$(s,"index.json");return pe(n)||At(n,JSON.stringify({version:ue(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};de();ye();import{existsSync as _t,statSync as xt}from"fs";import{join as ge}from"path";var tt=3e4,nt=18e4,st=["**/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.*"],X=class extends v{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){if(e.options.memoryBackend==="memory")return e.services.log(" Code intelligence skipped (database-free mode)"),!1;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=ge(t,".agentic-qe","memory.db");if(!_t(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=D(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 m=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${m} entries)`),{status:"existing",entries:m}}let i=this.getKGEntryCount(n);n.close();let d=await this.findChangedFiles(t,r);return d.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${d.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,d))}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 me,mkdirSync as we,writeFileSync as $t}from"fs";import{join as $}from"path";var Y=class extends k{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.options.memoryBackend==="memory"?!1: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");me(o)||we(o,{recursive:!0});let r=$(o,"hnsw");me(r)||we(r,{recursive:!0});let i=$(o,"learning-config.json"),d={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()};W(i,d,[["initialized"]]);let p=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(p=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${p}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:p}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");me(s)||we(s,{recursive:!0});let n=$(s,"index.json");return me(n)||$t(n,JSON.stringify({version:ue(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};de();ye();import{existsSync as Tt,statSync as qt}from"fs";import{join as fe}from"path";var st=3e4,rt=18e4,ot=["**/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.*"],X=class extends k{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){if(e.options.memoryBackend==="memory")return e.services.log(" Code intelligence skipped (database-free mode)"),!1;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=fe(t,".agentic-qe","memory.db");if(!Tt(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=D(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 p=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${p} entries)`),{status:"existing",entries:p}}let i=this.getKGEntryCount(n);n.close();let d=await this.findChangedFiles(t,r);return d.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${d.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,d))}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-BVD5Z66M.js"),r=ge(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:d}=await Qe(i,!0),m=new o(d,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0,projectRoot:e});try{let l;if(n)l=n;else{let{glob:p}=await import("tinyglobby");l=(await p(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:st,expandDirectories:!1})).map(f=>ge(e,f))}t.services.log(` Scanning ${l.length} source files...`);let u=await this.runBoundedScan(m,l,s,t);if(u.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${nt/1e3}s phase cap. Indexed ${u.entries} entries before timeout. Last file: ${u.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.`),u;if(u.status==="indexed"){let p=s?"Delta indexed":"Indexed";t.services.log(` ${p} ${u.entries} entries to ${r}`),await this.buildHypergraph(r,l,t)}return u}finally{try{m.destroy()}catch{}try{await d.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,d="",m=Date.now(),l=!1;s||await e.clear();let u=n.projectRoot,p=f=>f.startsWith(u)?f.slice(u.length+1):f;for(let f of t){if(Date.now()-m>nt){l=!0;break}d=f,n.services.log(` [${i+1}/${t.length}] ${p(f)}`);try{let k=await this.withTimeout(e.index({paths:[f],incremental:!0,includeTests:!0}),tt,f);k.success&&(o+=k.value.nodesCreated,r+=k.value.edgesCreated)}catch(k){let E=k instanceof Error?k.message:String(k);E.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(f)} \u2014 indexing exceeded ${tt/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(f)}: ${E}`)}i++}let y=o+r;return l?{status:"timeout",entries:y,timeoutFile:d}:{status:"indexed",entries:y}}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-JXSQVM67.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-WINGVMPG.js"),r=D(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),d=await n(t),m=await i.buildFromIndexResult(d);r.close(),m.nodesCreated+m.edgesCreated>0&&s.services.log(` Hypergraph: ${m.nodesCreated} nodes, ${m.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-VTXDBHB2.js"),r=fe(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:d}=await Ve(i,!0),p=new o(d,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0,projectRoot:e});try{let l;if(n)l=n;else{let{glob:m}=await import("tinyglobby");l=(await m(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:ot,expandDirectories:!1})).map(g=>fe(e,g))}t.services.log(` Scanning ${l.length} source files...`);let u=await this.runBoundedScan(p,l,s,t);if(u.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${rt/1e3}s phase cap. Indexed ${u.entries} entries before timeout. Last file: ${u.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.`),u;if(u.status==="indexed"){let m=s?"Delta indexed":"Indexed";t.services.log(` ${m} ${u.entries} entries to ${r}`),await this.buildHypergraph(r,l,t)}return u}finally{try{p.destroy()}catch{}try{await d.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,d="",p=Date.now(),l=!1;s||await e.clear();let u=n.projectRoot,m=g=>g.startsWith(u)?g.slice(u.length+1):g;for(let g of t){if(Date.now()-p>rt){l=!0;break}d=g,n.services.log(` [${i+1}/${t.length}] ${m(g)}`);try{let b=await this.withTimeout(e.index({paths:[g],incremental:!0,includeTests:!0}),st,g);b.success&&(o+=b.value.nodesCreated,r+=b.value.edgesCreated)}catch(b){let E=b instanceof Error?b.message:String(b);E.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${m(g)} \u2014 indexing exceeded ${st/1e3}s`):n.services.warn(` \u26A0 Failed to index ${m(g)}: ${E}`)}i++}let y=o+r;return l?{status:"timeout",entries:y,timeoutFile:d}:{status:"indexed",entries:y}}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-Y4MZBZCW.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-XQJSIMTS.js"),r=D(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),d=await n(t),p=await i.buildFromIndexResult(d);r.close(),p.nodesCreated+p.edgesCreated>0&&s.services.log(` Hypergraph: ${p.nodesCreated} nodes, ${p.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{glob:s}=await import("tinyglobby"),n=await s(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:st,expandDirectories:!1}),o=t.getTime(),r=[];for(let i of n){let d=ge(e,i);try{xt(d).mtimeMs>o&&r.push(d)}catch{}}return r}};de();import{existsSync as w,mkdirSync as Z,readFileSync as rt,writeFileSync as M}from"fs";import{join as b,dirname as Dt}from"path";import{fileURLToPath as $t}from"url";var qt=$t(import.meta.url),ot=Dt(qt),jt=[["aqe","initialized"]],ee=class extends v{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Hooks skipped (--no-claude)"),!1):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");w(n)||Z(n,{recursive:!0});let o=b(n,"hooks");w(o)||Z(o,{recursive:!0});let r=b(n,"settings.json"),i={},d;if(w(r))try{let I=rt(r,"utf-8");i=x(I),d=x(I)}catch{i={}}let m=this.generateHooksConfig(t,s),l=Object.keys(m),u=i.hooks||{},p=this.hasExistingAqeHooks(u);p&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=Ge(u,m);let y=i.env,f={memoryBackend:e.options.memoryBackend};i.env=He(y,Ue(t,f),f);let k=ze(t,s,f);Ke(i,k,{statusLine:!e.options.noStatusLine,...f});let E=i.enabledMcpjsonServers||[];if(E=E.filter(I=>I!=="aqe"),E.includes("agentic-qe")||E.push("agentic-qe"),i.enabledMcpjsonServers=E,Be(d,i,jt)){let I=We(r);I&&e.services.log(` Backup created: ${I}`),M(r,JSON.stringify(i,null,2),"utf-8")}else e.services.log(" Settings unchanged \u2014 .claude/settings.json left as-is");this.writeHooksReadme(o,l),this.installHookAssets(o,e);try{let I=rt(r,"utf-8"),S=x(I).hooks;(!S||!this.hasExistingAqeHooks(S))&&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: ${l.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:l,existingAqeDetected:p}}writeHooksReadme(e,t){let s=b(e,"README.txt");if(w(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),this.installHookShim(s,t);let n=b(e,"cross-phase-memory.yaml");if(!w(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 d of r)if(w(d)){let{copyFileSync:m}=It("fs");m(d,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");w(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(Ve(s))return!0}return!1}installBrainCheckpoint(e,t){let s=b(e,".claude","helpers");w(s)||Z(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"),b(ot,"..","..","..",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(w(r)&&r!==n){me(r,n)&&t.services.log(" Installed brain-checkpoint.cjs (copied)");return}w(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=b(e,".claude","helpers");w(s)||Z(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(w(r)&&r!==n){me(r,n)&&t.services.log(" Installed statusline-v3.cjs (copied)");return}w(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}installHookShim(e,t){let s=b(e,".claude","hooks");w(s)||Z(s,{recursive:!0});let n=b(s,"aqe-hook.cjs"),o=[b(e,"node_modules","agentic-qe",".claude","hooks","aqe-hook.cjs"),b(ot,"..","..","..",".claude","hooks","aqe-hook.cjs")];for(let r of o)if(w(r)&&r!==n){me(r,n)&&t.services.log(" Installed aqe-hook.cjs (copied)");return}w(n)||t.services.log(" \u26A0 aqe-hook.cjs source not found \u2014 lifecycle hooks cannot run until AQE is reinstalled")}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{glob:s}=await import("tinyglobby"),n=await s(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:ot,expandDirectories:!1}),o=t.getTime(),r=[];for(let i of n){let d=fe(e,i);try{qt(d).mtimeMs>o&&r.push(d)}catch{}}return r}};de();import{existsSync as w,mkdirSync as Z,readFileSync as it,writeFileSync as M}from"fs";import{join as v,dirname as Ot}from"path";import{fileURLToPath as jt}from"url";var Mt=jt(import.meta.url),at=Ot(Mt),Ft=[["aqe","initialized"]],ee=class extends k{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Hooks skipped (--no-claude)"),!1):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=v(s,".claude");w(n)||Z(n,{recursive:!0});let o=v(n,"hooks");w(o)||Z(o,{recursive:!0});let r=v(n,"settings.json"),i={},d;if(w(r))try{let R=it(r,"utf-8");i=x(R),d=x(R)}catch{i={}}let p=this.generateHooksConfig(t,s),l=Object.keys(p),u=i.hooks||{},m=this.hasExistingAqeHooks(u);m&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=Ge(u,p);let y=i.env,g={memoryBackend:e.options.memoryBackend};i.env=Ue(y,Ke(t,g),g);let b=Xe(t,s,g);Ye(i,b,{statusLine:!e.options.noStatusLine,...g});let E=i.enabledMcpjsonServers||[];if(E=E.filter(R=>R!=="aqe"),E.includes("agentic-qe")||E.push("agentic-qe"),i.enabledMcpjsonServers=E,Qe(d,i,Ft)){let R=We(r);R&&e.services.log(` Backup created: ${R}`),M(r,JSON.stringify(i,null,2),"utf-8")}else e.services.log(" Settings unchanged \u2014 .claude/settings.json left as-is");this.writeHooksReadme(o,l),this.installHookAssets(o,e);try{let R=it(r,"utf-8"),P=x(R).hooks;(!P||!this.hasExistingAqeHooks(P))&&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: ${l.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:l,existingAqeDetected:m}}writeHooksReadme(e,t){let s=v(e,"README.txt");if(w(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),this.installHookShim(s,t);let n=v(e,"cross-phase-memory.yaml");if(!w(n)){let r=[v(s,"v3","assets","hooks","cross-phase-memory.yaml"),v(s,"assets","hooks","cross-phase-memory.yaml"),v(s,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let d of r)if(w(d)){let{copyFileSync:p}=xt("fs");p(d,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=v(e,"v3-domain-workers.json");w(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(He(s))return!0}return!1}installBrainCheckpoint(e,t){let s=v(e,".claude","helpers");w(s)||Z(s,{recursive:!0});let n=v(s,"brain-checkpoint.cjs"),o=[v(e,".claude","helpers","brain-checkpoint.cjs"),v(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs"),v(at,"..","..","..",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(w(r)&&r!==n){pe(r,n)&&t.services.log(" Installed brain-checkpoint.cjs (copied)");return}w(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=v(e,".claude","helpers");w(s)||Z(s,{recursive:!0});let n=v(s,"statusline-v3.cjs"),o=[v(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),v(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(w(r)&&r!==n){pe(r,n)&&t.services.log(" Installed statusline-v3.cjs (copied)");return}w(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}installHookShim(e,t){let s=v(e,".claude","hooks");w(s)||Z(s,{recursive:!0});let n=v(s,"aqe-hook.cjs"),o=[v(e,"node_modules","agentic-qe",".claude","hooks","aqe-hook.cjs"),v(at,"..","..","..",".claude","hooks","aqe-hook.cjs")];for(let r of o)if(w(r)&&r!==n){pe(r,n)&&t.services.log(" Installed aqe-hook.cjs (copied)");return}w(n)||t.services.log(" \u26A0 aqe-hook.cjs source not found \u2014 lifecycle hooks cannot run until AQE is reinstalled")}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
@@ -60,6 +60,7 @@ console.log(\`\\x1b[1m\\x1b[35m\u258A Agentic QE v3\\x1b[0m\${branchStr}\${patSt
60
60
  * node brain-checkpoint.cjs verify # Verify aqe.rvf exists (session-start)
61
61
  */
62
62
  const { execFileSync } = require('child_process');
63
+ const crypto = require('crypto');
63
64
  const fs = require('fs');
64
65
  const path = require('path');
65
66
 
@@ -68,6 +69,11 @@ const AQE_DIR = path.join(PROJECT_ROOT, '.agentic-qe');
68
69
  const RVF_PATH = path.join(AQE_DIR, 'aqe.rvf');
69
70
  const DB_PATH = path.join(AQE_DIR, 'memory.db');
70
71
  const MAX_AGE_HOURS = 24;
72
+ // #1238: after a too-large export, skip the Stop-hook export for a while
73
+ // unless a newer aqe.rvf shows that an export has succeeded since.
74
+ const SKIP_PATH = path.join(AQE_DIR, 'brain-checkpoint.skip.json');
75
+ const RETRY_ENV = Number.parseFloat(process.env.AQE_BRAIN_CHECKPOINT_RETRY_HOURS || '');
76
+ const TOO_LARGE_RETRY_HOURS = Number.isFinite(RETRY_ENV) && RETRY_ENV >= 0 ? RETRY_ENV : 6;
71
77
  // Windows (#872): never execFile aqe.cmd (EINVAL without a shell); reuse the
72
78
  // hook shim's resolver, which runs the AQE bundle via node instead.
73
79
  function aqeInvocation() {
@@ -88,32 +94,110 @@ function aqeInvocation() {
88
94
 
89
95
  function log(msg) { process.stderr.write('[brain-checkpoint] ' + msg + '\\n'); }
90
96
 
97
+ function activeSkip() {
98
+ let st; try { st = fs.lstatSync(SKIP_PATH); } catch { return null; }
99
+ let skip = null;
100
+ if (st.isFile()) { try { skip = JSON.parse(fs.readFileSync(SKIP_PATH, 'utf8')); } catch { /* unreadable */ } }
101
+ const at = skip ? Date.parse(skip.at) : NaN;
102
+ let rvfMtime = 0; try { rvfMtime = fs.lstatSync(RVF_PATH).mtimeMs; } catch { /* absent */ }
103
+ if (!Number.isFinite(at) || Date.now() >= at + TOO_LARGE_RETRY_HOURS * 3600000 || rvfMtime > at) {
104
+ try { fs.unlinkSync(SKIP_PATH); } catch { /* best-effort */ }
105
+ return null;
106
+ }
107
+ return skip;
108
+ }
109
+
110
+ function writeSkip(reason) {
111
+ const at = new Date();
112
+ const skip = { reason, at: at.toISOString(), retryAfter: new Date(at.getTime() + TOO_LARGE_RETRY_HOURS * 3600000).toISOString() };
113
+ // 'wx' after unlink: never write through a planted symlink (#970).
114
+ try { try { fs.unlinkSync(SKIP_PATH); } catch { /* absent */ } fs.writeFileSync(SKIP_PATH, JSON.stringify(skip) + '\\n', { flag: 'wx' }); } catch { /* best-effort */ }
115
+ return skip;
116
+ }
117
+
118
+ // Export to a temp store next to aqe.rvf; rename it over aqe.rvf only on
119
+ // success, so a failed, too-large or killed export keeps the last checkpoint.
120
+ const RVF_SIDECARS = ['.idmap.json', '.manifest.json'];
121
+ const TMP_PREFIX = path.basename(RVF_PATH) + '.tmp-';
122
+ function removeEntry(p) { try { fs.unlinkSync(p); } catch (e) { if (!e || e.code !== 'ENOENT') throw e; } }
123
+ function isPidAlive(pid) { try { process.kill(pid, 0); return true; } catch (e) { return !!e && e.code === 'EPERM'; } }
124
+ function removeByPrefix(prefix, keep) {
125
+ let entries = []; try { entries = fs.readdirSync(AQE_DIR); } catch { return; }
126
+ for (const entry of entries) {
127
+ if (!entry.startsWith(prefix) || (keep && keep(entry))) continue;
128
+ try { removeEntry(path.join(AQE_DIR, entry)); } catch { /* best-effort */ }
129
+ }
130
+ }
131
+ function sweepStaleTmp() {
132
+ removeByPrefix(TMP_PREFIX, (entry) => {
133
+ const pid = Number.parseInt(entry.slice(TMP_PREFIX.length).split('-')[0], 10);
134
+ return !Number.isInteger(pid) || pid <= 0 || isPidAlive(pid);
135
+ });
136
+ }
137
+ function lexists(p) { try { fs.lstatSync(p); return true; } catch { return false; } }
138
+ // rename() replaces a planted symlink without writing through it (#970). The
139
+ // store goes first: if that fails nothing changed. If a sidecar rename fails
140
+ // afterwards, the stale sidecar is removed, so the new store is never read
141
+ // with the previous export's idmap.
142
+ function promote(tmp) {
143
+ fs.renameSync(tmp, RVF_PATH);
144
+ for (const suffix of RVF_SIDECARS) {
145
+ try {
146
+ if (lexists(tmp + suffix)) fs.renameSync(tmp + suffix, RVF_PATH + suffix);
147
+ else removeEntry(RVF_PATH + suffix);
148
+ } catch { try { removeEntry(RVF_PATH + suffix); } catch { /* best-effort */ } }
149
+ }
150
+ }
151
+
91
152
  function exportBrain() {
92
153
  if (!fs.existsSync(DB_PATH)) { log('No memory.db, skipping'); return { exported: false }; }
93
154
  const aqe = aqeInvocation();
94
155
  if (!aqe.cmd) { log('Export skipped: ' + aqe.reason); return { exported: false, reason: aqe.reason }; }
95
- // Never write through a committed symlink: .agentic-qe must be a real dir, and
96
- // unlink (not existsSync) drops a planted aqe.rvf link, even a dangling one.
156
+ // Never write through a committed symlink: .agentic-qe must be a real dir.
97
157
  let st; try { st = fs.lstatSync(AQE_DIR); } catch { /* missing */ }
98
158
  if (!st || !st.isDirectory()) { log('Export skipped: .agentic-qe is a symlink'); return { exported: false }; }
99
- for (const f of [RVF_PATH, RVF_PATH + '.idmap.json']) { try { fs.unlinkSync(f); } catch { /* absent */ } }
159
+ const skip = activeSkip();
160
+ if (skip) {
161
+ log('Export skipped until ' + skip.retryAfter + ': ' + skip.reason);
162
+ return { exported: false, skipped: true, reason: skip.reason, retryAfter: skip.retryAfter };
163
+ }
164
+ sweepStaleTmp();
165
+ const tmp = path.join(AQE_DIR, TMP_PREFIX + process.pid + '-' + crypto.randomBytes(4).toString('hex'));
100
166
  try {
167
+ for (const suffix of ['', ...RVF_SIDECARS]) removeEntry(tmp + suffix);
101
168
  const result = execFileSync(
102
- aqe.cmd, [...aqe.args, 'brain', 'export', '-o', RVF_PATH, '--format', 'rvf'],
103
- { timeout: 60000, encoding: 'utf-8', windowsHide: true }
169
+ aqe.cmd, [...aqe.args, 'brain', 'export', '-o', tmp, '--format', 'rvf'],
170
+ { timeout: 60000, encoding: 'utf-8', windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] }
104
171
  );
172
+ // A zero exit without a store is a failure, not an empty checkpoint.
173
+ if (!lexists(tmp)) throw new Error('brain export exited 0 but wrote no store');
174
+ promote(tmp);
105
175
  const m = result.match(/Patterns:\\s+(\\d+)/);
106
176
  const p = m ? m[1] : '0';
107
177
  log('Exported ' + p + ' patterns to aqe.rvf');
108
178
  return { exported: true, patterns: parseInt(p) };
109
179
  } catch (e) {
110
- log('Export failed: ' + e.message);
180
+ const tooLarge = (String(e.stderr || '') + String(e.stdout || '')).match(/RVF_KERNEL_TOO_LARGE:[^\\n]*/);
181
+ if (tooLarge) {
182
+ const skip = writeSkip(tooLarge[0].trim());
183
+ log('Export failed: ' + skip.reason);
184
+ log('Skipping the checkpoint export until ' + skip.retryAfter + ' (AQE_BRAIN_CHECKPOINT_RETRY_HOURS sets the wait).');
185
+ return { exported: false, tooLarge: true, reason: skip.reason, retryAfter: skip.retryAfter };
186
+ }
187
+ log('Export failed: ' + e.message + ' (previous aqe.rvf kept)');
111
188
  return { exported: false, reason: e.message };
189
+ } finally {
190
+ removeByPrefix(path.basename(tmp));
112
191
  }
113
192
  }
114
193
 
115
194
  function verifyBrain() {
116
195
  if (!fs.existsSync(RVF_PATH)) {
196
+ const skip = activeSkip();
197
+ if (skip) {
198
+ log('No aqe.rvf found; checkpoint export paused until ' + skip.retryAfter + ': ' + skip.reason);
199
+ return { valid: false, reason: 'missing', skippedUntil: skip.retryAfter };
200
+ }
117
201
  log('No aqe.rvf found');
118
202
  return { valid: false, reason: 'missing' };
119
203
  }
@@ -128,10 +212,10 @@ function verifyBrain() {
128
212
  const cmd = process.argv[2] || 'verify';
129
213
  const result = cmd === 'export' ? exportBrain() : verifyBrain();
130
214
  if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
131
- `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:60,continueOnError:!0}]}]}}};import{existsSync as Tt,readFileSync as Ot}from"fs";de();import{join as Mt}from"path";var te=class extends v{constructor(t=s=>Je(s)){super();this.detectPlugin=t}detectPlugin;name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(t){let{projectRoot:s}=t;if(t.options.noClaude)return t.services.log(" MCP: skipped (--no-claude \u2014 .mcp.json is the Claude Code surface)"),{configured:!1,mcpPath:"",serverName:""};if(t.options.noMcp)return t.services.log(" MCP: skipped (--no-mcp)"),t.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};if(!t.options.withMcp){let l=this.detectPlugin(s);if(l.enabled)return t.services.log(Ye(s)),{configured:!1,mcpPath:"",serverName:"",skippedForPlugin:l.pluginKey}}let n=t.options.memoryBackend==="memory",r={command:"aqe-mcp",args:[],env:n?{AQE_MEMORY_BACKEND:"memory",AQE_LEARNING_ENABLED:"false",AQE_WORKERS_ENABLED:"false",NODE_ENV:"production"}:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},i=Mt(s,".mcp.json"),d={};if(Tt(i))try{let l=Ot(i,"utf-8");d=x(l)}catch{d={}}d.mcpServers||(d.mcpServers={});let m=d.mcpServers;return m["agentic-qe"]=r,W(i,JSON.stringify(d,null,2)),t.services.log(` MCP config: ${i}`),t.services.log(" Server: agentic-qe"),n?(t.services.log(" Memory backend: in-memory (database-free)"),t.services.log(" Learning: disabled (db-free)"),t.services.log(" Workers: disabled (db-free)")):(t.services.log(" Learning: enabled"),t.services.log(" Workers: enabled")),{configured:!0,mcpPath:i,serverName:"agentic-qe"}}};import{existsSync as A,readFileSync as Ut,readdirSync as Kt}from"fs";import{join as _}from"path";import{createHash as Ft}from"crypto";import{constants as Nt,copyFileSync as it,existsSync as Ce,lstatSync as Se,readFileSync as lt,realpathSync as ct,unlinkSync as Lt}from"fs";import{dirname as dt,join as Ee,sep as Bt}from"path";var ne=".claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery",Pe="qe-court/evals/fixtures/seeded-mutant-delivery",at=".claude/skills/testability-scoring/resources/templates",Qt="testability-scoring/resources/templates",Wt=Object.freeze([{id:"qe-court-seeded-mutant",retired:[{relPath:`${ne}/budget.test.ts`,shippedSha256:["add1ff4cb05978c136f8c2c5cc50059d920f06f409e5f6f304239b7dad3cf65d"]},{relPath:`${ne}/budget.ts`,shippedSha256:["11fc97cad19bb4fc0d31151a6d216ab99d0df0521b60be8fb19581d412147ef6"]}],replacements:[{relPath:`${ne}/budget-tests.ts.fixture`,source:`${Pe}/budget-tests.ts.fixture`},{relPath:`${ne}/budget.ts.fixture`,source:`${Pe}/budget.ts.fixture`}],refresh:[{relPath:`${ne}/README.md`,source:`${Pe}/README.md`,previousSha256:["d3988b92856d0023a7ae210dce3e0bdf76204f41d635fd29f7e243c168ff6109"]},{relPath:".claude/skills/qe-court/evals/qe-court.yaml",source:"qe-court/evals/qe-court.yaml",previousSha256:["412899013a51a099224bad04491d49dca19f2c567c5599adedabd0e1d58556c7","27c8be547dc032e2dbe488156dd7a30f79b1cc921fe92efec5b9bb0a151f0e9b"]}],advice:"3.15.6 renamed the qe-court seeded-mutant fixture to budget.ts.fixture / budget-tests.ts.fixture because budget.test.ts matches test-runner globs, so your vitest/jest collects it (#1017). The pair was left as is; delete or rename both files if you do not want your test runner to collect it"},{id:"testability-scoring-spec-template",retired:[{relPath:`${at}/testability-scoring.spec.template.js`,shippedSha256:["e85a3e25bb458f3d090834e121b02e8db83cdc589149b5cf7549853e1a067edf"]}],replacements:[{relPath:`${at}/testability-scoring-spec.template.js`,source:`${Qt}/testability-scoring-spec.template.js`}],refresh:[],advice:"3.15.6 renamed it to testability-scoring-spec.template.js because its name matches the `*.spec.*` test glob (#1017); delete or rename it if your test runner should not collect it"}]);function ut(c){return Ft("sha256").update(c).digest("hex")}function Ie(c,e){let t;try{t=ct(dt(e))}catch{return!1}return t===c||t.startsWith(c+Bt)}function Vt(c,e,t,s){let n;try{n=Se(e)}catch{return{state:"absent"}}if(!Ie(c,e))return{state:"blocked",why:`${t} resolves outside the project (symlinked directory)`};if(!n.isFile())return{state:"blocked",why:`${t} is not a regular file`};try{if(!s.includes(ut(lt(e))))return{state:"blocked",why:`${t} was modified since AQE installed it`}}catch(o){return{state:"blocked",why:`${t} is unreadable (${o instanceof Error?o.message:String(o)})`}}return{state:"removable"}}function mt(c,e={}){let t=e.groups??Wt,s={removed:[],installed:[],refreshed:[],kept:[],missingReplacements:[],replacementWarnings:[]},n;try{n=ct(c)}catch{return s}let o=r=>Ee(c,...r.split("/"));for(let r of t){let d=r.retired.map(l=>({file:l,probe:Vt(n,o(l.relPath),l.relPath.split("/").pop(),l.shippedSha256)})).filter(l=>l.probe.state!=="absent");if(d.length===0)continue;let m=d.filter(l=>l.probe.state==="blocked");if(m.length>0){s.kept.push({group:r.id,files:d.map(l=>l.file.relPath),why:m.map(l=>l.probe.why).join("; "),advice:r.advice});continue}for(let{file:l}of d)try{Lt(o(l.relPath)),s.removed.push(l.relPath)}catch(u){s.kept.push({group:r.id,files:[l.relPath],why:`could not remove (${u instanceof Error?u.message:String(u)})`,advice:r.advice})}for(let l of r.replacements){let u=o(l.relPath),p=e.sourceSkillsDir?Ee(e.sourceSkillsDir,...l.source.split("/")):void 0,y;try{y=Se(u)}catch{y=void 0}if(!y?.isFile()){if(y){s.missingReplacements.push(l.relPath),s.replacementWarnings.push(`${l.relPath} exists and is not a regular file (e.g. a symlink); not replaced`);continue}if(!p||!Ce(p)){s.missingReplacements.push(l.relPath);continue}try{if(!Ce(dt(u))||!Ie(n,u)){s.missingReplacements.push(l.relPath);continue}it(p,u,Nt.COPYFILE_EXCL),s.installed.push(l.relPath)}catch(f){s.missingReplacements.push(l.relPath),f?.code==="EEXIST"&&s.replacementWarnings.push(`${l.relPath} appeared during install; not replaced`)}}}for(let l of r.refresh){let u=o(l.relPath),p=e.sourceSkillsDir?Ee(e.sourceSkillsDir,...l.source.split("/")):void 0;if(!(!p||!Ce(p)))try{if(!Se(u).isFile()||!Ie(n,u)||!l.previousSha256.includes(ut(lt(u))))continue;it(p,u),s.refreshed.push(l.relPath)}catch{}}}return s}Q();import{spawnSync as Gt}from"node:child_process";import*as fe from"node:os";import*as gt from"node:fs";var F="vibium@^26.8.21",ft={platform:()=>fe.platform(),arch:()=>fe.arch(),existsSync:c=>gt.existsSync(c)},pt=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function Re(c=ft){if(c.platform()!=="linux"||c.arch()!=="arm64")return;let e=pt.find(t=>c.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: ${pt.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function se(c,e,t,s){return c(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var Ae=(c,e,t)=>Gt(c,e,t);function Ht(c=Ae,e=5e3){let t=se(c,"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 re(c=Ae,e=5e3){let t=Ht(c,e);if(!t)return{status:"cli-missing"};let s=/^(\d+)\.(\d+)\.(\d+)(?:\+[\w.]+)?$/.exec(t);if(!s||Number(s[1])!==26||Number(s[2])<8||Number(s[2])===8&&Number(s[3])<21)return{status:"unsupported-version",version:t,message:`Vibium ${t} is unsupported; install ${F} for the browser.start() API`};let n=se(c,"vibium",["is-installed"],e);return n.status===0?{status:"ready",version:t}:{status:"payload-missing",version:t,message:n.stderr?.trim()||n.stdout?.trim()||P(n.error)||"Vibium Chrome/chromedriver payload is missing or incomplete"}}function ht(c={}){let e=c.packageSpec||F;if(c.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=c.spawner||Ae,s=c.platformProbe||ft,n=Re(s),o=re(t);if(o.status==="ready")return{status:"already-installed",version:o.version,packageSpec:e,platformHint:n};let r=c.npmBin||"npm",i=se(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 d=c.timeoutMs||18e4,m=se(t,r,["install","-g",e],d);if(m.status!==0)return{status:"install-failed",packageSpec:e,message:m.stderr?.trim()||m.stdout?.trim()||P(m.error)||"unknown npm install failure"};let l=re(t);if(l.status==="payload-missing"){let u=se(t,"vibium",["install"],d);if(u.status!==0)return{status:"install-failed",packageSpec:e,platformHint:n,message:`Browser payload installation failed: ${u.stderr?.trim()||u.stdout?.trim()||"vibium install failed"}. Run \`vibium install\` and verify with \`vibium is-installed\`.`};l=re(t)}if(l.status!=="ready"){let u=l.message?`: ${l.message}`:"";return{status:"install-failed",packageSpec:e,platformHint:n,message:`npm completed, but Vibium readiness verification failed (${l.status})${u}. Run \`npm install -g ${e}\`, then verify with \`vibium is-installed\`.`}}return{status:"installed",version:l.version,packageSpec:e,platformHint:n}}var oe=class extends v{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,d=0,m=0,l=0,u=0,p=0,y=0,f=0,k=0,E,B,I=[],he=[];if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),!n.noClaude&&t.skills.install){let h=await be({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=h.installed.length,h.errors.length>0&&e.services.warn(`Skills warnings: ${h.errors.join(", ")}`)}if(!n.noClaude){let g=mt(s,{sourceSkillsDir:be({projectRoot:s}).getSourceSkillsDir()});I=g.removed,he=g.kept.flatMap(h=>h.files);for(let h of g.removed)e.services.log(` Removed retired asset: ${h}`);for(let h of[...g.installed,...g.refreshed])e.services.log(` Updated skill file: ${h}`);for(let h of g.kept)e.services.warn(`Kept ${h.files.join(", ")}: ${h.why}. ${h.advice}.`);for(let h of g.replacementWarnings)e.services.warn(`Skill file kept: ${h}.`);g.missingReplacements.length>0&&e.services.warn(`Could not install ${g.missingReplacements.join(", ")}; run "aqe init --upgrade" to refresh the skills.`)}if(!n.noClaude){try{let h=await Ze({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();d=h.installed.length,h.errors.length>0&&e.services.warn(`Agents warnings: ${h.errors.join(", ")}`)}catch(g){e.services.warn(`Agents install error: ${g instanceof Error?g.message:g}`)}Me(s)}let S;if(n.browserEngine===!0&&!n.minimal)try{let g=re();if(g.status==="ready")S={status:"already-installed",version:g.version,packageSpec:F,platformHint:Re()},e.services.log(` Browser engine: vibium ${S.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)\u2026"),S=ht({skip:!1}),S.status){case"installed":e.services.log(` Browser engine: vibium ${S.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 \`aqe init --browser-engine\`): ${S.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `aqe init --browser-engine` to enable qe-browser");break}S?.platformHint&&e.services.warn(` Browser engine platform hint: ${S.platformHint.message}`)}catch(g){let h=g instanceof Error?g.message:String(g);e.services.warn(`Browser engine install error: ${h}
215
+ `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:60,continueOnError:!0}]}]}}};import{existsSync as Nt,readFileSync as Lt}from"fs";de();import{join as lt}from"path";var te=class extends k{constructor(t=s=>Ze(s)){super();this.detectPlugin=t}detectPlugin;name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(t){let{projectRoot:s}=t;if(t.options.noClaude)return t.services.log(" MCP: skipped (--no-claude \u2014 .mcp.json is the Claude Code surface)"),{configured:!1,mcpPath:"",serverName:""};if(t.options.noMcp)return t.services.log(" MCP: skipped (--no-mcp)"),t.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};if(!t.options.withMcp){let l=this.detectPlugin(s);if(l.enabled)return t.services.log(et(s)),ct(t,Je(lt(s,".mcp.json"))),{configured:!1,mcpPath:"",serverName:"",skippedForPlugin:l.pluginKey}}let n=t.options.memoryBackend==="memory",r={command:"aqe-mcp",args:[],env:n?{AQE_MEMORY_BACKEND:"memory",AQE_LEARNING_ENABLED:"false",AQE_WORKERS_ENABLED:"false",NODE_ENV:"production"}:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},i=lt(s,".mcp.json"),d={};if(Nt(i))try{let l=Lt(i,"utf-8");d=x(l)}catch{d={}}d.mcpServers||(d.mcpServers={});let p=d.mcpServers;return ct(t,ze(p)),p["agentic-qe"]=r,V(i,JSON.stringify(d,null,2)),t.services.log(` MCP config: ${i}`),t.services.log(" Server: agentic-qe"),n?(t.services.log(" Memory backend: in-memory (database-free)"),t.services.log(" Learning: disabled (db-free)"),t.services.log(" Workers: disabled (db-free)")):(t.services.log(" Learning: enabled"),t.services.log(" Workers: enabled")),{configured:!0,mcpPath:i,serverName:"agentic-qe"}}};function ct(c,e){e.length>0&&c.services.log(` MCP: removed server entry launching @anthropics/agentic-qe: ${e.join(", ")}`)}import{existsSync as A,readFileSync as Jt,readdirSync as Yt}from"fs";import{join as _}from"path";import{createHash as Bt}from"crypto";import{constants as Qt,copyFileSync as dt,existsSync as Ce,lstatSync as Pe,readFileSync as pt,realpathSync as mt,unlinkSync as Vt}from"fs";import{dirname as ft,join as Ee,sep as Wt}from"path";var ne=".claude/skills/qe-court/evals/fixtures/seeded-mutant-delivery",Se="qe-court/evals/fixtures/seeded-mutant-delivery",ut=".claude/skills/testability-scoring/resources/templates",Ht="testability-scoring/resources/templates",Gt=Object.freeze([{id:"qe-court-seeded-mutant",retired:[{relPath:`${ne}/budget.test.ts`,shippedSha256:["add1ff4cb05978c136f8c2c5cc50059d920f06f409e5f6f304239b7dad3cf65d"]},{relPath:`${ne}/budget.ts`,shippedSha256:["11fc97cad19bb4fc0d31151a6d216ab99d0df0521b60be8fb19581d412147ef6"]}],replacements:[{relPath:`${ne}/budget-tests.ts.fixture`,source:`${Se}/budget-tests.ts.fixture`},{relPath:`${ne}/budget.ts.fixture`,source:`${Se}/budget.ts.fixture`}],refresh:[{relPath:`${ne}/README.md`,source:`${Se}/README.md`,previousSha256:["d3988b92856d0023a7ae210dce3e0bdf76204f41d635fd29f7e243c168ff6109"]},{relPath:".claude/skills/qe-court/evals/qe-court.yaml",source:"qe-court/evals/qe-court.yaml",previousSha256:["412899013a51a099224bad04491d49dca19f2c567c5599adedabd0e1d58556c7","27c8be547dc032e2dbe488156dd7a30f79b1cc921fe92efec5b9bb0a151f0e9b"]}],advice:"3.15.6 renamed the qe-court seeded-mutant fixture to budget.ts.fixture / budget-tests.ts.fixture because budget.test.ts matches test-runner globs, so your vitest/jest collects it (#1017). The pair was left as is; delete or rename both files if you do not want your test runner to collect it"},{id:"testability-scoring-spec-template",retired:[{relPath:`${ut}/testability-scoring.spec.template.js`,shippedSha256:["e85a3e25bb458f3d090834e121b02e8db83cdc589149b5cf7549853e1a067edf"]}],replacements:[{relPath:`${ut}/testability-scoring-spec.template.js`,source:`${Ht}/testability-scoring-spec.template.js`}],refresh:[],advice:"3.15.6 renamed it to testability-scoring-spec.template.js because its name matches the `*.spec.*` test glob (#1017); delete or rename it if your test runner should not collect it"}]);function gt(c){return Bt("sha256").update(c).digest("hex")}function Re(c,e){let t;try{t=mt(ft(e))}catch{return!1}return t===c||t.startsWith(c+Wt)}function Ut(c,e,t,s){let n;try{n=Pe(e)}catch{return{state:"absent"}}if(!Re(c,e))return{state:"blocked",why:`${t} resolves outside the project (symlinked directory)`};if(!n.isFile())return{state:"blocked",why:`${t} is not a regular file`};try{if(!s.includes(gt(pt(e))))return{state:"blocked",why:`${t} was modified since AQE installed it`}}catch(o){return{state:"blocked",why:`${t} is unreadable (${o instanceof Error?o.message:String(o)})`}}return{state:"removable"}}function ht(c,e={}){let t=e.groups??Gt,s={removed:[],installed:[],refreshed:[],kept:[],missingReplacements:[],replacementWarnings:[]},n;try{n=mt(c)}catch{return s}let o=r=>Ee(c,...r.split("/"));for(let r of t){let d=r.retired.map(l=>({file:l,probe:Ut(n,o(l.relPath),l.relPath.split("/").pop(),l.shippedSha256)})).filter(l=>l.probe.state!=="absent");if(d.length===0)continue;let p=d.filter(l=>l.probe.state==="blocked");if(p.length>0){s.kept.push({group:r.id,files:d.map(l=>l.file.relPath),why:p.map(l=>l.probe.why).join("; "),advice:r.advice});continue}for(let{file:l}of d)try{Vt(o(l.relPath)),s.removed.push(l.relPath)}catch(u){s.kept.push({group:r.id,files:[l.relPath],why:`could not remove (${u instanceof Error?u.message:String(u)})`,advice:r.advice})}for(let l of r.replacements){let u=o(l.relPath),m=e.sourceSkillsDir?Ee(e.sourceSkillsDir,...l.source.split("/")):void 0,y;try{y=Pe(u)}catch{y=void 0}if(!y?.isFile()){if(y){s.missingReplacements.push(l.relPath),s.replacementWarnings.push(`${l.relPath} exists and is not a regular file (e.g. a symlink); not replaced`);continue}if(!m||!Ce(m)){s.missingReplacements.push(l.relPath);continue}try{if(!Ce(ft(u))||!Re(n,u)){s.missingReplacements.push(l.relPath);continue}dt(m,u,Qt.COPYFILE_EXCL),s.installed.push(l.relPath)}catch(g){s.missingReplacements.push(l.relPath),g?.code==="EEXIST"&&s.replacementWarnings.push(`${l.relPath} appeared during install; not replaced`)}}}for(let l of r.refresh){let u=o(l.relPath),m=e.sourceSkillsDir?Ee(e.sourceSkillsDir,...l.source.split("/")):void 0;if(!(!m||!Ce(m)))try{if(!Pe(u).isFile()||!Re(n,u)||!l.previousSha256.includes(gt(pt(u))))continue;dt(m,u),s.refreshed.push(l.relPath)}catch{}}}return s}Q();import{spawnSync as Kt}from"node:child_process";import*as ge from"node:os";import*as kt from"node:fs";var F="vibium@^26.8.21",vt={platform:()=>ge.platform(),arch:()=>ge.arch(),existsSync:c=>kt.existsSync(c)},yt=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function Ie(c=vt){if(c.platform()!=="linux"||c.arch()!=="arm64")return;let e=yt.find(t=>c.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: ${yt.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function se(c,e,t,s){return c(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var Ae=(c,e,t)=>Kt(c,e,t);function zt(c=Ae,e=5e3){let t=se(c,"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 re(c=Ae,e=5e3){let t=zt(c,e);if(!t)return{status:"cli-missing"};let s=/^(\d+)\.(\d+)\.(\d+)(?:\+[\w.]+)?$/.exec(t);if(!s||Number(s[1])!==26||Number(s[2])<8||Number(s[2])===8&&Number(s[3])<21)return{status:"unsupported-version",version:t,message:`Vibium ${t} is unsupported; install ${F} for the browser.start() API`};let n=se(c,"vibium",["is-installed"],e);return n.status===0?{status:"ready",version:t}:{status:"payload-missing",version:t,message:n.stderr?.trim()||n.stdout?.trim()||S(n.error)||"Vibium Chrome/chromedriver payload is missing or incomplete"}}function bt(c={}){let e=c.packageSpec||F;if(c.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=c.spawner||Ae,s=c.platformProbe||vt,n=Ie(s),o=re(t);if(o.status==="ready")return{status:"already-installed",version:o.version,packageSpec:e,platformHint:n};let r=c.npmBin||"npm",i=se(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 d=c.timeoutMs||18e4,p=se(t,r,["install","-g",e],d);if(p.status!==0)return{status:"install-failed",packageSpec:e,message:p.stderr?.trim()||p.stdout?.trim()||S(p.error)||"unknown npm install failure"};let l=re(t);if(l.status==="payload-missing"){let u=se(t,"vibium",["install"],d);if(u.status!==0)return{status:"install-failed",packageSpec:e,platformHint:n,message:`Browser payload installation failed: ${u.stderr?.trim()||u.stdout?.trim()||"vibium install failed"}. Run \`vibium install\` and verify with \`vibium is-installed\`.`};l=re(t)}if(l.status!=="ready"){let u=l.message?`: ${l.message}`:"";return{status:"install-failed",packageSpec:e,platformHint:n,message:`npm completed, but Vibium readiness verification failed (${l.status})${u}. Run \`npm install -g ${e}\`, then verify with \`vibium is-installed\`.`}}return{status:"installed",version:l.version,packageSpec:e,platformHint:n}}var oe=class extends k{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,d=0,p=0,l=0,u=0,m=0,y=0,g=0,b=0,E,B,R=[],he=[];if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),!n.noClaude&&t.skills.install){let h=await ve({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=h.installed.length,h.errors.length>0&&e.services.warn(`Skills warnings: ${h.errors.join(", ")}`)}if(!n.noClaude){let f=ht(s,{sourceSkillsDir:ve({projectRoot:s}).getSourceSkillsDir()});R=f.removed,he=f.kept.flatMap(h=>h.files);for(let h of f.removed)e.services.log(` Removed retired asset: ${h}`);for(let h of[...f.installed,...f.refreshed])e.services.log(` Updated skill file: ${h}`);for(let h of f.kept)e.services.warn(`Kept ${h.files.join(", ")}: ${h.why}. ${h.advice}.`);for(let h of f.replacementWarnings)e.services.warn(`Skill file kept: ${h}.`);f.missingReplacements.length>0&&e.services.warn(`Could not install ${f.missingReplacements.join(", ")}; run "aqe init --upgrade" to refresh the skills.`)}if(!n.noClaude){try{let h=await tt({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();d=h.installed.length,h.errors.length>0&&e.services.warn(`Agents warnings: ${h.errors.join(", ")}`)}catch(f){e.services.warn(`Agents install error: ${f instanceof Error?f.message:f}`)}Me(s)}let P;if(n.browserEngine===!0&&!n.minimal)try{let f=re();if(f.status==="ready")P={status:"already-installed",version:f.version,packageSpec:F,platformHint:Ie()},e.services.log(` Browser engine: vibium ${P.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)\u2026"),P=bt({skip:!1}),P.status){case"installed":e.services.log(` Browser engine: vibium ${P.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 \`aqe init --browser-engine\`): ${P.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `aqe init --browser-engine` to enable qe-browser");break}P?.platformHint&&e.services.warn(` Browser engine platform hint: ${P.platformHint.message}`)}catch(f){let h=f instanceof Error?f.message:String(f);e.services.warn(`Browser engine install error: ${h}
132
216
  qe-browser fleet skill will be unavailable until you run:
133
217
  npm install -g ${F}
134
- Then re-run \`aqe init --browser-engine\` to verify. The rest of the AQE install will continue.`)}else S={status:"skipped",packageSpec:F,message:n.minimal?"minimal mode":"browser setup not requested; run aqe init --browser-engine"};if(n.withN8n){let h=await et({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();m=h.agentsInstalled.length,l=h.skillsInstalled.length,h.errors.length>0&&e.services.warn(`N8n warnings: ${h.errors.join(", ")}`)}let qe=n.autoMode&&A(_(s,"opencode.json"));if(n.withOpenCode||qe){let{createOpenCodeInstaller:g}=await import("./opencode-installer-E3VM3EEY.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installTools:!1,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();u=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: ${d}`),n.withN8n&&(e.services.log(` N8n agents: ${m}`),e.services.log(` N8n skills: ${l}`)),(n.withOpenCode||qe)&&(e.services.log(` OpenCode agents: ${u}`),e.services.log(` OpenCode skills: ${p}`));let St=n.autoMode&&A(_(s,".kiro"));if(n.withKiro||St){let{createKiroInstaller:g}=await import("./kiro-installer-3PG2TJ67.js"),a=await g({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();y=a.agentsInstalled.length,f=a.skillsInstalled.length,k=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${y}`),e.services.log(` Kiro skills: ${f}`),e.services.log(` Kiro hooks: ${k}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let R=[];if(n.withCopilot||n.autoMode&&A(_(s,".vscode"))){let{createCopilotInstaller:g}=await import("./copilot-installer-ZLFVLEJP.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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&&A(_(s,".cursor"))){let{createCursorInstaller:g}=await import("./cursor-installer-LJKLNFF6.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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-OWQ4D2FQ.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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&&A(_(s,".kilocode"))){let{createKiloCodeInstaller:g}=await import("./kilocode-installer-XENXNEIU.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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&&A(_(s,".roo"))){let{createRooCodeInstaller:g}=await import("./roocode-installer-KWS4CEIC.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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&&A(_(s,".codex"))){let{createCodexInstaller:g}=await import("./codex-installer-7LXZYBSQ.js"),a=await g({projectRoot:s,overwrite:r,installMcp:!n.noMcp,includeRuflo:n.withRuflo,guidancePolicy:n.codexGuidance,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();E={policy:a.guidancePolicy,ownedBytes:a.ownedGuidanceBytes},B={hooks:a.components.hooks,skills:a.components.skills},a.mcpConfigured&&R.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}`),a.hooksConfigured&&e.services.log(` Codex hooks: ${a.hooksPath}`),a.skillsInstalled>0&&e.services.log(` Codex skills: ${a.skillsInstalled} installed`),e.services.log(n.withRuflo?" Codex Ruflo integration: enabled":" Codex Ruflo integration: not installed (opt in with --with-ruflo)")}if(n.withWindsurf||n.autoMode&&A(_(s,".windsurf"))){let{createWindsurfInstaller:g}=await import("./windsurf-installer-OK2AJN35.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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&&A(_(s,".continue"))){let{createContinueDevInstaller:g}=await import("./continuedev-installer-RUGD24D2.js"),a=await g({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.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 R.length>0&&e.services.log(` Platforms configured: ${R.join(", ")}`),{skillsInstalled:i,agentsInstalled:d,n8nAgents:m,n8nSkills:l,openCodeAgents:u,openCodeSkills:p,kiroAgents:y,kiroSkills:f,kiroHooks:k,platformsConfigured:R,browserEngine:S,codexGuidance:E,codexComponents:B,retiredAssetsRemoved:I,retiredAssetsKept:he}}detectVersionUpgrade(e){let t=e.config.version,s=_(e.projectRoot,".agentic-qe","config.yaml");if(A(s))try{let i=Ut(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=_(e.projectRoot,".claude","agents","v3");try{return A(n)&&Kt(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as zt,mkdirSync as Jt}from"fs";import{join as N,dirname as Yt}from"path";import{fileURLToPath as Xt}from"url";var Zt=Xt(import.meta.url),Bs=Yt(Zt),ie=class extends v{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){if(e.options.memoryBackend==="memory")return!1;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=N(s,".agentic-qe","workers");zt(n)||Jt(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 y of t.workers.enabled)r[y]={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,lastRun:null,status:"pending"};let i=N(n,"registry.json"),d={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};V(i,d,[["createdAt"]]);for(let y of t.workers.enabled){let f=N(n,`${y}.json`),k={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,projectRoot:s,dataDir:N(s,".agentic-qe","data"),createdAt:new Date().toISOString()};V(f,k,[["createdAt"]])}let m=N(n,"start-daemon.cjs");W(m,`#!/usr/bin/env node
218
+ Then re-run \`aqe init --browser-engine\` to verify. The rest of the AQE install will continue.`)}else P={status:"skipped",packageSpec:F,message:n.minimal?"minimal mode":"browser setup not requested; run aqe init --browser-engine"};if(n.withN8n){let h=await nt({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();p=h.agentsInstalled.length,l=h.skillsInstalled.length,h.errors.length>0&&e.services.warn(`N8n warnings: ${h.errors.join(", ")}`)}let Te=n.autoMode&&A(_(s,"opencode.json"));if(n.withOpenCode||Te){let{createOpenCodeInstaller:f}=await import("./opencode-installer-WBAJMH5K.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installTools:!1,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();u=a.agentsInstalled.length,m=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${d}`),n.withN8n&&(e.services.log(` N8n agents: ${p}`),e.services.log(` N8n skills: ${l}`)),(n.withOpenCode||Te)&&(e.services.log(` OpenCode agents: ${u}`),e.services.log(` OpenCode skills: ${m}`));let _t=n.autoMode&&A(_(s,".kiro"));if(n.withKiro||_t){let{createKiroInstaller:f}=await import("./kiro-installer-GFCWCB2S.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();y=a.agentsInstalled.length,g=a.skillsInstalled.length,b=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${y}`),e.services.log(` Kiro skills: ${g}`),e.services.log(` Kiro hooks: ${b}`),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&&A(_(s,".vscode"))){let{createCopilotInstaller:f}=await import("./copilot-installer-BHPDSELY.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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&&A(_(s,".cursor"))){let{createCursorInstaller:f}=await import("./cursor-installer-KP4HA7TV.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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:f}=await import("./cline-installer-RYLHCDK7.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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&&A(_(s,".kilocode"))){let{createKiloCodeInstaller:f}=await import("./kilocode-installer-BCPOCVMC.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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&&A(_(s,".roo"))){let{createRooCodeInstaller:f}=await import("./roocode-installer-G7OVYXEN.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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&&A(_(s,".codex"))){let{createCodexInstaller:f}=await import("./codex-installer-SCJ3T3DX.js"),a=await f({projectRoot:s,overwrite:r,installMcp:!n.noMcp,includeRuflo:n.withRuflo,guidancePolicy:n.codexGuidance,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();E={policy:a.guidancePolicy,ownedBytes:a.ownedGuidanceBytes},B={hooks:a.components.hooks,skills:a.components.skills},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}`),a.hooksConfigured&&e.services.log(` Codex hooks: ${a.hooksPath}`),a.skillsInstalled>0&&e.services.log(` Codex skills: ${a.skillsInstalled} installed`),e.services.log(n.withRuflo?" Codex Ruflo integration: enabled":" Codex Ruflo integration: not installed (opt in with --with-ruflo)")}if(n.withWindsurf||n.autoMode&&A(_(s,".windsurf"))){let{createWindsurfInstaller:f}=await import("./windsurf-installer-VELMLOZF.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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&&A(_(s,".continue"))){let{createContinueDevInstaller:f}=await import("./continuedev-installer-GCEJRK34.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).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:d,n8nAgents:p,n8nSkills:l,openCodeAgents:u,openCodeSkills:m,kiroAgents:y,kiroSkills:g,kiroHooks:b,platformsConfigured:I,browserEngine:P,codexGuidance:E,codexComponents:B,retiredAssetsRemoved:R,retiredAssetsKept:he}}detectVersionUpgrade(e){let t=e.config.version,s=_(e.projectRoot,".agentic-qe","config.yaml");if(A(s))try{let i=Jt(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=_(e.projectRoot,".claude","agents","v3");try{return A(n)&&Yt(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as Xt,mkdirSync as Zt}from"fs";import{join as N,dirname as en}from"path";import{fileURLToPath as tn}from"url";var nn=tn(import.meta.url),Hs=en(nn),ie=class extends k{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){if(e.options.memoryBackend==="memory")return!1;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=N(s,".agentic-qe","workers");Xt(n)||Zt(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 y of t.workers.enabled)r[y]={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,lastRun:null,status:"pending"};let i=N(n,"registry.json"),d={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};W(i,d,[["createdAt"]]);for(let y of t.workers.enabled){let g=N(n,`${y}.json`),b={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,projectRoot:s,dataDir:N(s,".agentic-qe","data"),createdAt:new Date().toISOString()};W(g,b,[["createdAt"]])}let p=N(n,"start-daemon.cjs");V(p,`#!/usr/bin/env node
135
219
  // AQE v3 Worker Daemon Startup Script (cross-platform)
136
220
  // Generated by aqe init
137
221
  // Starts the MCP server with background workers enabled
@@ -325,7 +409,7 @@ setTimeout(() => {
325
409
  console.log('Log file: ' + logFile);
326
410
  console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs'));
327
411
  }, 3000);
328
- `);let u=N(n,"stop-daemon.cjs");return W(u,`#!/usr/bin/env node
412
+ `);let u=N(n,"stop-daemon.cjs");return V(u,`#!/usr/bin/env node
329
413
  // AQE v3 Worker Daemon Stop Script (cross-platform)
330
414
  // Generated by aqe init
331
415
 
@@ -348,7 +432,7 @@ try {
348
432
  console.log('Daemon not running (stale PID file)');
349
433
  try { unlinkSync(pidFile); } catch {}
350
434
  }
351
- `),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 en,readFileSync as tn,writeFileSync as _e}from"fs";import{join as yt}from"path";var ae=class extends v{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" CLAUDE.md skipped (--no-claude)"),!1):!0}async run(e){let t=e.config,{projectRoot:s}=e,n=yt(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(en(n)){let i=tn(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 d=yt(s,"CLAUDE.md.backup");_e(d,i,"utf-8"),r=!0,_e(n,i+`
435
+ `),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 sn,readFileSync as rn,writeFileSync as _e}from"fs";import{join as wt}from"path";var ae=class extends k{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" CLAUDE.md skipped (--no-claude)"),!1):!0}async run(e){let t=e.config,{projectRoot:s}=e,n=wt(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(sn(n)){let i=rn(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 d=wt(s,"CLAUDE.md.backup");_e(d,i,"utf-8"),r=!0,_e(n,i+`
352
436
 
353
437
  `+o,"utf-8")}else _e(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
354
438
 
@@ -512,7 +596,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
512
596
 
513
597
  ---
514
598
  *Generated by AQE v3 init - ${new Date().toISOString()}*
515
- `}};import{existsSync as q,readFileSync as nn}from"fs";import{join as L,dirname as sn}from"path";import{mkdirSync as vt}from"fs";ye();var rn=/^# \d{4}-\d{2}-\d{2}T[\d:.]+Z$/,xe=new Set(["__proto__","constructor","prototype"]),le=class extends v{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=e.options.memoryBackend==="memory",r=L(s,".agentic-qe","memory.db");n.push({name:o?"Database (in-memory mode)":"Database exists",passed:o||q(r)}),n.push({name:".agentic-qe directory",passed:q(L(s,".agentic-qe"))});let i=L(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:q(i)});let d=o?!0:await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:d});let m=["Database exists",".agentic-qe directory","Config saved"],l=n.filter(u=>m.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let p=m.includes(u.name),y=u.passed?"\u2713":p?"\u2717":"\u26A0",f=!p&&!u.passed?" (optional)":"";e.services.log(` ${y} ${u.name}${f}`)}return{verified:l,versionWritten:d,configSaved:q(i),checks:n}}async writeVersionToDb(e,t){let s=L(t,".agentic-qe","memory.db");try{let n=sn(s);q(n)||vt(n,{recursive:!0});let o=D(s);try{o.exec(`
599
+ `}};import{existsSync as T,readFileSync as on}from"fs";import{join as L,dirname as an}from"path";import{mkdirSync as Ct}from"fs";ye();var ln=/^# \d{4}-\d{2}-\d{2}T[\d:.]+Z$/,xe=new Set(["__proto__","constructor","prototype"]),le=class extends k{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=e.options.memoryBackend==="memory",r=L(s,".agentic-qe","memory.db");n.push({name:o?"Database (in-memory mode)":"Database exists",passed:o||T(r)}),n.push({name:".agentic-qe directory",passed:T(L(s,".agentic-qe"))});let i=L(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:T(i)});let d=o?!0:await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:d});let p=["Database exists",".agentic-qe directory","Config saved"],l=n.filter(u=>p.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let m=p.includes(u.name),y=u.passed?"\u2713":m?"\u2717":"\u26A0",g=!m&&!u.passed?" (optional)":"";e.services.log(` ${y} ${u.name}${g}`)}return{verified:l,versionWritten:d,configSaved:T(i),checks:n}}async writeVersionToDb(e,t){let s=L(t,".agentic-qe","memory.db");try{let n=an(s);T(n)||Ct(n,{recursive:!0});let o=D(s);try{o.exec(`
516
600
  CREATE TABLE IF NOT EXISTS kv_store (
517
601
  key TEXT NOT NULL,
518
602
  namespace TEXT NOT NULL,
@@ -527,9 +611,9 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
527
611
  `).run("aqe_version",JSON.stringify(e),r),o.prepare(`
528
612
  INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
529
613
  VALUES (?, '_system', ?, ?)
530
- `).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=L(t,".agentic-qe");q(s)||vt(s,{recursive:!0});let n=L(s,"config.yaml");if(q(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);Le(n,o,rn)}loadExistingConfig(e){try{let t=nn(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
531
- `),n="",o="";for(let i of s){if(i.trim().startsWith("#")||i.trim()==="")continue;let d=i.match(/^(\w+):\s*(.*)$/);if(d){if(n=xe.has(d[1])?"":d[1],o="",!n)continue;let p=d[2].trim();p&&!p.startsWith('"')?t[n]=this.parseValue(p):p?t[n]=this.parseValue(p):t[n]={};continue}let m=i.match(/^ {2}(\w+):\s*(.*)$/);if(m&&n){if(o=xe.has(m[1])?"":m[1],!o)continue;let p=m[2].trim();(!Object.hasOwn(t,n)||!t[n])&&(t[n]={}),p?t[n][o]=this.parseValue(p):t[n][o]={};continue}let l=i.match(/^ {4}([\w-]+):\s*(.*)$/);if(l&&n&&o){let p=l[1],y=l[2].trim();if(xe.has(p))continue;let f=t[n];(!Object.hasOwn(f,o)||!f[o])&&(f[o]={}),typeof f[o]=="object"&&!Array.isArray(f[o])&&(f[o][p]=this.parseValue(y));continue}let u=i.match(/^ {4}- "?([^"]*)"?$/);if(u&&n&&o){let p=t[n];Array.isArray(p[o])||(p[o]=[]),p[o].push(u[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,d]of r){let m=t[i];m&&d in m&&!Array.isArray(m[d])&&(m[d]=[])}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.learning?.qualityThreshold!==void 0&&(e.learning.qualityThreshold=t.learning.qualityThreshold),t.learning?.promotionThreshold!==void 0&&(e.learning.promotionThreshold=t.learning.promotionThreshold),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, qualityThreshold, and promotionThreshold","# - 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-5.5" # 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(`
532
- `)}};Q();import{existsSync as j,mkdirSync as bt,readdirSync as kt,copyFileSync as wt}from"fs";import{join as C,dirname as on}from"path";import{fileURLToPath as an}from"url";var ln=an(import.meta.url),Ct=on(ln);function cn(){let c=[C(Ct,"../../assets/governance"),C(Ct,"../assets/governance")],e=Xe(import.meta.url);e&&(c.push(C(e,"assets/governance")),c.push(C(e,"dist/assets/governance"))),c.push(C(process.cwd(),"node_modules/agentic-qe/assets/governance")),c.push(C(process.cwd(),"assets/governance"));for(let t of c)if(j(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${c.join(", ")}`)}var De=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=cn()}async install(){let e=[],t=[],s=[],n=C(this.projectRoot,".claude","guidance"),o=C(n,"shards");try{bt(n,{recursive:!0}),this.skipShards||bt(o,{recursive:!0})}catch(l){return s.push(`Failed to create governance directory: ${P(l)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=C(this.assetsPath,"constitution.md"),d=C(n,"constitution.md");if(j(i))try{!j(d)||this.overwrite?(wt(i,d),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(l){s.push(`Failed to install constitution.md: ${P(l)}`)}else s.push("constitution.md not found in assets");let m=0;if(!this.skipShards){let l=C(this.assetsPath,"shards");if(j(l))try{let u=kt(l).filter(p=>p.endsWith(".shard.md"));for(let p of u){let y=C(l,p),f=C(o,p);try{!j(f)||this.overwrite?(wt(y,f),e.push(`shards/${p}`),m++):t.push(`shards/${p}`)}catch(k){s.push(`Failed to install ${p}: ${P(k)}`)}}}catch(u){s.push(`Failed to read shards directory: ${P(u)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:m}}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 kt(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function Et(c){return new De(c)}var ce=class extends v{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Governance skipped (--no-claude)"),!1):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=Et({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 dn=new G,un=new H,mn=new U,pn=new J,gn=new Y,fn=new X,hn=new ee,yn=new te,vn=new oe,bn=new ie,kn=new ae,wn=new le,Cn=new ce;function Pt(){return[dn,un,mn,pn,gn,fn,hn,yn,vn,Cn,bn,kn,wn]}var $e=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??Pt()}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,browserEngine:e.browserEngine,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,withRuflo:e.withRuflo,codexGuidance:e.codexGuidance,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp,withMcp:e.withMcp,noClaude:e.noClaude,noStatusLine:e.noStatusLine,memoryBackend:e.memoryBackend},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(`
614
+ `).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=L(t,".agentic-qe");T(s)||Ct(s,{recursive:!0});let n=L(s,"config.yaml");if(T(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);Be(n,o,ln)}loadExistingConfig(e){try{let t=on(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
615
+ `),n="",o="";for(let i of s){if(i.trim().startsWith("#")||i.trim()==="")continue;let d=i.match(/^(\w+):\s*(.*)$/);if(d){if(n=xe.has(d[1])?"":d[1],o="",!n)continue;let m=d[2].trim();m&&!m.startsWith('"')?t[n]=this.parseValue(m):m?t[n]=this.parseValue(m):t[n]={};continue}let p=i.match(/^ {2}(\w+):\s*(.*)$/);if(p&&n){if(o=xe.has(p[1])?"":p[1],!o)continue;let m=p[2].trim();(!Object.hasOwn(t,n)||!t[n])&&(t[n]={}),m?t[n][o]=this.parseValue(m):t[n][o]={};continue}let l=i.match(/^ {4}([\w-]+):\s*(.*)$/);if(l&&n&&o){let m=l[1],y=l[2].trim();if(xe.has(m))continue;let g=t[n];(!Object.hasOwn(g,o)||!g[o])&&(g[o]={}),typeof g[o]=="object"&&!Array.isArray(g[o])&&(g[o][m]=this.parseValue(y));continue}let u=i.match(/^ {4}- "?([^"]*)"?$/);if(u&&n&&o){let m=t[n];Array.isArray(m[o])||(m[o]=[]),m[o].push(u[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,d]of r){let p=t[i];p&&d in p&&!Array.isArray(p[d])&&(p[d]=[])}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.learning?.qualityThreshold!==void 0&&(e.learning.qualityThreshold=t.learning.qualityThreshold),t.learning?.promotionThreshold!==void 0&&(e.learning.promotionThreshold=t.learning.promotionThreshold),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, qualityThreshold, and promotionThreshold","# - 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-5.5" # 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(`
616
+ `)}};Q();import{existsSync as q,mkdirSync as Et,readdirSync as St,copyFileSync as Pt}from"fs";import{join as C,dirname as cn}from"path";import{fileURLToPath as dn}from"url";var un=dn(import.meta.url),Rt=cn(un);function pn(){let c=[C(Rt,"../../assets/governance"),C(Rt,"../assets/governance")],e=Fe(import.meta.url);e&&(c.push(C(e,"assets/governance")),c.push(C(e,"dist/assets/governance"))),c.push(C(process.cwd(),"node_modules/agentic-qe/assets/governance")),c.push(C(process.cwd(),"assets/governance"));for(let t of c)if(q(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${c.join(", ")}`)}var De=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=pn()}async install(){let e=[],t=[],s=[],n=C(this.projectRoot,".claude","guidance"),o=C(n,"shards");try{Et(n,{recursive:!0}),this.skipShards||Et(o,{recursive:!0})}catch(l){return s.push(`Failed to create governance directory: ${S(l)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=C(this.assetsPath,"constitution.md"),d=C(n,"constitution.md");if(q(i))try{!q(d)||this.overwrite?(Pt(i,d),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(l){s.push(`Failed to install constitution.md: ${S(l)}`)}else s.push("constitution.md not found in assets");let p=0;if(!this.skipShards){let l=C(this.assetsPath,"shards");if(q(l))try{let u=St(l).filter(m=>m.endsWith(".shard.md"));for(let m of u){let y=C(l,m),g=C(o,m);try{!q(g)||this.overwrite?(Pt(y,g),e.push(`shards/${m}`),p++):t.push(`shards/${m}`)}catch(b){s.push(`Failed to install ${m}: ${S(b)}`)}}}catch(u){s.push(`Failed to read shards directory: ${S(u)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:p}}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 St(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function It(c){return new De(c)}var ce=class extends k{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Governance skipped (--no-claude)"),!1):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=It({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 mn=new H,fn=new G,gn=new U,hn=new J,yn=new Y,kn=new X,vn=new ee,bn=new te,wn=new oe,Cn=new ie,En=new ae,Sn=new le,Pn=new ce;function At(){return[mn,fn,gn,hn,yn,kn,vn,bn,wn,Pn,Cn,En,Sn]}var $e=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??At()}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,browserEngine:e.browserEngine,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,withRuflo:e.withRuflo,codexGuidance:e.codexGuidance,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp,withMcp:e.withMcp,noClaude:e.noClaude,noStatusLine:e.noStatusLine,memoryBackend:e.memoryBackend},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(`
533
617
  \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(`
534
- \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:P(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"),d=this.context.results.get("mcp"),m=this.context.results.get("claude-md"),l=this.context.results.get("workers");return{success:!0,config:s||ve("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:d?.data?.configured??!1,claudeMdGenerated:m?.data?.generated??!1,workersStarted:l?.data?.workersConfigured??0,codexGuidance:r?.data?.codexGuidance,codexComponents:r?.data?.codexComponents,retiredAssetsRemoved:r?.data?.retiredAssetsRemoved,retiredAssetsKept:r?.data?.retiredAssetsKept},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ve("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 En(c){return new $e(c)}async function Qr(c){return await En({projectRoot:c,autoMode:!0}).initialize()}function Wr(c){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 c.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: ${c.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${c.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(c.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(c.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(c.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(c.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(c.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${c.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${c.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${c.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=c.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(`
535
- `)}export{$e as ModularInitOrchestrator,En as createModularInitOrchestrator,Wr as formatInitResultModular,Qr as quickInitModular};
618
+ \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"),d=this.context.results.get("mcp"),p=this.context.results.get("claude-md"),l=this.context.results.get("workers");return{success:!0,config:s||ke("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:d?.data?.configured??!1,claudeMdGenerated:p?.data?.generated??!1,workersStarted:l?.data?.workersConfigured??0,codexGuidance:r?.data?.codexGuidance,codexComponents:r?.data?.codexComponents,retiredAssetsRemoved:r?.data?.retiredAssetsRemoved,retiredAssetsKept:r?.data?.retiredAssetsKept},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ke("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 Rn(c){return new $e(c)}async function Gr(c){return await Rn({projectRoot:c,autoMode:!0}).initialize()}function Ur(c){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 c.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: ${c.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${c.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(c.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(c.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(c.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(c.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(c.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${c.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${c.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${c.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=c.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(`
619
+ `)}export{$e as ModularInitOrchestrator,Rn as createModularInitOrchestrator,Ur as formatInitResultModular,Gr as quickInitModular};
@@ -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.15.15");process.exit(0)}
2
+ import{a}from"./chunk-BP5T3OEV.js";import"./chunk-DEKR3CTS.js";import"./chunk-QFGYH6HD.js";import"./chunk-XH4JMX5O.js";export{a as PatternNullStore};
@@ -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.15.13");process.exit(0)}
2
- import{a,b}from"./chunk-4OVC4RIL.js";import"./chunk-ZAKQLAHT.js";export{a as recordPatternUsage,b as recordPatternUsageBatch};
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.15.15");process.exit(0)}
2
+ import{a,b}from"./chunk-AP2W7Z3A.js";import"./chunk-XH4JMX5O.js";export{a as recordPatternUsage,b as recordPatternUsageBatch};