agentic-qe 3.14.6 → 3.14.7

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 (416) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +74 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +8 -8
  5. package/dist/cli/chunks/adapter-TVQKH65T.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-2YGML6OU.js → agent-booster-wasm-AK2W76RG.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-D5SSQYNU.js → agent-handler-MGZCWHIY.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-YHPLTITV.js → agent-memory-branch-JZ54MCSP.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +2 -0
  10. package/dist/cli/chunks/{arena-7BGOXGXO.js → arena-CUVH3V7H.js} +2 -2
  11. package/dist/cli/chunks/{arena-MCE6EU7K.js → arena-YSWTKBCL.js} +4 -4
  12. package/dist/cli/chunks/{audit-BMWTQECB.js → audit-LVU76QGA.js} +3 -3
  13. package/dist/cli/chunks/base-W42BURDL.js +2 -0
  14. package/dist/cli/chunks/{better-sqlite3-PMUNGASU.js → better-sqlite3-DB3LOJQU.js} +2 -2
  15. package/dist/cli/chunks/{brain-handler-QPUFYX7F.js → brain-handler-SD63KOQ6.js} +3 -3
  16. package/dist/cli/chunks/{branch-enumerator-WKFDGRN4.js → branch-enumerator-4MNOPUC7.js} +2 -2
  17. package/dist/cli/chunks/{browser-VY5HKH5X.js → browser-OLPNTWQE.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +2 -0
  19. package/dist/cli/chunks/{chunk-62N4NUJH.js → chunk-23CX7JNL.js} +2 -2
  20. package/dist/cli/chunks/{chunk-MW2GGZZ5.js → chunk-25P6JA6V.js} +1 -1
  21. package/dist/cli/chunks/{chunk-RSXXCL4A.js → chunk-2G63VIJE.js} +1 -1
  22. package/dist/cli/chunks/{chunk-3NIG7S5W.js → chunk-2IMSJ7IO.js} +1 -1
  23. package/dist/cli/chunks/{chunk-I33ERSGB.js → chunk-36VKMAMN.js} +2 -2
  24. package/dist/cli/chunks/{chunk-2TMWAQQ3.js → chunk-3M7J4U74.js} +3 -3
  25. package/dist/cli/chunks/{chunk-CM7U6TAX.js → chunk-3QJU4Q4R.js} +2 -2
  26. package/dist/cli/chunks/{chunk-H5BS5VH7.js → chunk-4EKV7PHB.js} +2 -2
  27. package/dist/cli/chunks/{chunk-IG5GNEC6.js → chunk-4INST4ZL.js} +1 -1
  28. package/dist/cli/chunks/{chunk-YHKEDEAA.js → chunk-53BXTTRO.js} +3 -3
  29. package/dist/cli/chunks/{chunk-ENGZ4D5V.js → chunk-5D7ZFWDS.js} +2 -2
  30. package/dist/cli/chunks/{chunk-DZ3AUAAB.js → chunk-5FSLMYAC.js} +2 -2
  31. package/dist/cli/chunks/{chunk-FBMN7B46.js → chunk-5GFKTJ65.js} +2 -2
  32. package/dist/cli/chunks/{chunk-NMAIY4PX.js → chunk-5U6N4V5M.js} +11 -11
  33. package/dist/cli/chunks/{chunk-B6D2CHEH.js → chunk-6EGS77BB.js} +1 -1
  34. package/dist/cli/chunks/{chunk-NQZ5AR3D.js → chunk-6PJPQGF4.js} +2 -2
  35. package/dist/cli/chunks/{chunk-ICTXTNQZ.js → chunk-6RD44SCE.js} +1 -1
  36. package/dist/cli/chunks/{chunk-2NPKIBAZ.js → chunk-74IOEOMH.js} +2 -2
  37. package/dist/cli/chunks/{chunk-RTFO5UQH.js → chunk-77QZHIVX.js} +2 -2
  38. package/dist/cli/chunks/{chunk-D45SG6CP.js → chunk-7EZ2Z2CK.js} +1 -1
  39. package/dist/cli/chunks/{chunk-UNFFDHER.js → chunk-7MIOK72I.js} +10 -32
  40. package/dist/cli/chunks/{chunk-HNFVJP4I.js → chunk-7QYOTUOX.js} +2 -2
  41. package/dist/cli/chunks/{chunk-Q7EAGKAE.js → chunk-A2VUCUTT.js} +2 -2
  42. package/dist/cli/chunks/{chunk-TVYY3OCX.js → chunk-A3DK3XNZ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-RETBYIAC.js → chunk-A5MA7A23.js} +4 -4
  44. package/dist/cli/chunks/{chunk-DUYOVM5I.js → chunk-AEUEMVJK.js} +2 -2
  45. package/dist/cli/chunks/{chunk-6U7LNMWZ.js → chunk-AJUBT4NP.js} +2 -2
  46. package/dist/cli/chunks/{chunk-7CUQCCMD.js → chunk-B2YGVSOP.js} +2 -2
  47. package/dist/cli/chunks/{chunk-SNOBH4AZ.js → chunk-B4I43GE2.js} +2 -2
  48. package/dist/cli/chunks/{chunk-VMNWDJIZ.js → chunk-BD7FEUN3.js} +2 -2
  49. package/dist/cli/chunks/{chunk-HM6ZSCPI.js → chunk-BE4KALTE.js} +1 -1
  50. package/dist/cli/chunks/{chunk-WGM35YWL.js → chunk-BEFTQVEW.js} +2 -2
  51. package/dist/cli/chunks/{chunk-SMDN3BQZ.js → chunk-BLG7SH4A.js} +1 -1
  52. package/dist/cli/chunks/{chunk-AJRUJAAK.js → chunk-C3FXFU2T.js} +1 -1
  53. package/dist/cli/chunks/{chunk-IQO7UCFR.js → chunk-CBONQM5D.js} +2 -2
  54. package/dist/cli/chunks/{chunk-L4RUBPLR.js → chunk-CQNMGK6Y.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NHWGMJAP.js → chunk-CVOQ6ESD.js} +2 -2
  56. package/dist/cli/chunks/{chunk-P6OYS755.js → chunk-DOBKEXMJ.js} +1 -1
  57. package/dist/cli/chunks/{chunk-QZANMBIT.js → chunk-DYTQHRUS.js} +1 -1
  58. package/dist/cli/chunks/{chunk-FZOBD67M.js → chunk-EADSQN5T.js} +1 -1
  59. package/dist/cli/chunks/{chunk-DHVX5UB2.js → chunk-EGOIIUBD.js} +2 -2
  60. package/dist/cli/chunks/{chunk-6OS76PHI.js → chunk-EIGRV3J6.js} +2 -2
  61. package/dist/cli/chunks/{chunk-CD542DNJ.js → chunk-EJ6MMYLK.js} +1 -1
  62. package/dist/cli/chunks/{chunk-ELLBS5RP.js → chunk-ENK44A6Q.js} +2 -2
  63. package/dist/cli/chunks/{chunk-VGFFFKGK.js → chunk-EYXE2XKP.js} +2 -2
  64. package/dist/cli/chunks/{chunk-72KXSMWI.js → chunk-F2OPFVQH.js} +1 -1
  65. package/dist/cli/chunks/{chunk-DK4XN4CU.js → chunk-FBZC4IGB.js} +2 -2
  66. package/dist/cli/chunks/{chunk-MUOG6QXR.js → chunk-FSSR6WBE.js} +2 -2
  67. package/dist/cli/chunks/{chunk-DPYSUDAO.js → chunk-FW4DJ4FJ.js} +1 -1
  68. package/dist/cli/chunks/{chunk-ZVWVV4EX.js → chunk-FYPX5WBJ.js} +1 -1
  69. package/dist/cli/chunks/{chunk-7J6QC567.js → chunk-G367W7XR.js} +3 -3
  70. package/dist/cli/chunks/{chunk-IAF6T27S.js → chunk-GLGKQX2V.js} +2 -2
  71. package/dist/cli/chunks/{chunk-JXGFRBUO.js → chunk-GV4DYPJP.js} +2 -2
  72. package/dist/cli/chunks/{chunk-BPEDWS6O.js → chunk-GVVFTFMB.js} +2 -2
  73. package/dist/cli/chunks/{chunk-CF2ISEOJ.js → chunk-H5RQPO3X.js} +2 -2
  74. package/dist/cli/chunks/{chunk-GSF6MB64.js → chunk-HPWWYT67.js} +2 -2
  75. package/dist/cli/chunks/{chunk-RG52OKAM.js → chunk-HXXHMLJ5.js} +1 -1
  76. package/dist/cli/chunks/{chunk-SESK3ARK.js → chunk-HYFQUWNB.js} +2 -2
  77. package/dist/cli/chunks/{chunk-7D3V65N5.js → chunk-HYOPJHHW.js} +1 -1
  78. package/dist/cli/chunks/{chunk-7LPR6HJG.js → chunk-HZY42OVU.js} +2 -2
  79. package/dist/cli/chunks/{chunk-SDRHUMJB.js → chunk-IAENZ2DR.js} +2 -2
  80. package/dist/cli/chunks/{chunk-B6MOJC3X.js → chunk-IEJ7ZV3M.js} +1 -1
  81. package/dist/cli/chunks/{chunk-UCFQALXO.js → chunk-IWFFO6VT.js} +2 -2
  82. package/dist/cli/chunks/chunk-J7AQZLIH.js +21 -0
  83. package/dist/cli/chunks/{chunk-H52HZ67P.js → chunk-JHJUSSAU.js} +2 -2
  84. package/dist/cli/chunks/{chunk-2YXGBZWV.js → chunk-JOZ47MV6.js} +1 -1
  85. package/dist/cli/chunks/{chunk-EAY2JMZG.js → chunk-JZT7BU44.js} +2 -2
  86. package/dist/cli/chunks/{chunk-BVR7RMC5.js → chunk-KD2BLA5Y.js} +1 -1
  87. package/dist/cli/chunks/{chunk-BAMN2CHI.js → chunk-KUHLTVWC.js} +1 -1
  88. package/dist/cli/chunks/{chunk-5QQSIGUA.js → chunk-LU2EDWQK.js} +2 -2
  89. package/dist/cli/chunks/{chunk-D6CJIGRU.js → chunk-LXZMP3VX.js} +54 -54
  90. package/dist/cli/chunks/{chunk-GPYVDFB3.js → chunk-LY7MFGBD.js} +196 -187
  91. package/dist/cli/chunks/{chunk-W6HXLH5G.js → chunk-MM56VPNE.js} +2 -2
  92. package/dist/cli/chunks/{chunk-E6G2RD5H.js → chunk-MNQN7UZX.js} +2 -2
  93. package/dist/cli/chunks/{chunk-ZCRTRYXK.js → chunk-MQZ53OR3.js} +2 -2
  94. package/dist/cli/chunks/{chunk-3HZS4M3O.js → chunk-MT7UNBZ7.js} +2 -2
  95. package/dist/cli/chunks/{chunk-XAS3XRYM.js → chunk-MZB2UV2O.js} +1 -1
  96. package/dist/cli/chunks/{chunk-GDSXITFH.js → chunk-MZMG6CUJ.js} +2 -2
  97. package/dist/cli/chunks/{chunk-6SQM2MUX.js → chunk-N5XOXPHZ.js} +2 -2
  98. package/dist/cli/chunks/{chunk-5OOMJGFN.js → chunk-NBLDBVAW.js} +1 -1
  99. package/dist/cli/chunks/{chunk-PI7TJS62.js → chunk-ND4QTZOL.js} +2 -2
  100. package/dist/cli/chunks/{chunk-H6ZM3PUT.js → chunk-NHUGHAY6.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5VFPCSK7.js → chunk-NOHWJOBS.js} +1 -1
  102. package/dist/cli/chunks/{chunk-DBDPRORT.js → chunk-O5V7RHVG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-UQ32JHES.js → chunk-O6MO5KMR.js} +2 -2
  104. package/dist/cli/chunks/{chunk-WO4QMXIG.js → chunk-OAZX6WFU.js} +2 -2
  105. package/dist/cli/chunks/{chunk-GGRHV6D7.js → chunk-OEPNNLR4.js} +1 -1
  106. package/dist/cli/chunks/{chunk-AIRGNL55.js → chunk-OIDWDGLG.js} +2 -2
  107. package/dist/cli/chunks/{chunk-V4DM6ELU.js → chunk-ON2UTP2U.js} +2 -2
  108. package/dist/cli/chunks/{chunk-MBRHSU6W.js → chunk-ONR2NXXD.js} +10 -10
  109. package/dist/cli/chunks/{chunk-WCJBU2KI.js → chunk-OXHF3L2T.js} +2 -2
  110. package/dist/cli/chunks/{chunk-AVBJYI5I.js → chunk-OZGIOKEA.js} +1 -1
  111. package/dist/cli/chunks/{chunk-YFBSPLJG.js → chunk-P2UPYSDJ.js} +1 -1
  112. package/dist/cli/chunks/{chunk-C6KWXUFJ.js → chunk-P7XSPP5D.js} +2 -2
  113. package/dist/cli/chunks/{chunk-QDFTT3RF.js → chunk-PCJQCEBA.js} +2 -2
  114. package/dist/cli/chunks/chunk-PELENDDQ.js +2 -0
  115. package/dist/cli/chunks/{chunk-257E2A5M.js → chunk-PYKY22GC.js} +5 -5
  116. package/dist/cli/chunks/{chunk-LL3IGZBI.js → chunk-Q3NSU24F.js} +2 -2
  117. package/dist/cli/chunks/{chunk-Y3LZ35OG.js → chunk-Q6NTEICT.js} +2 -2
  118. package/dist/cli/chunks/chunk-QFETNCNN.js +12 -0
  119. package/dist/cli/chunks/{chunk-SE4WIB26.js → chunk-QGOWNVVG.js} +1 -1
  120. package/dist/cli/chunks/{chunk-6RE3X4V5.js → chunk-QPLSYEWJ.js} +2 -2
  121. package/dist/cli/chunks/{chunk-FWASDOT2.js → chunk-QQFQDEUE.js} +2 -2
  122. package/dist/cli/chunks/{chunk-2JVWITNK.js → chunk-QUORH2MG.js} +55 -79
  123. package/dist/cli/chunks/{chunk-5J6W7SIA.js → chunk-QVH5Y7AP.js} +1 -1
  124. package/dist/cli/chunks/{chunk-YSLL6VSL.js → chunk-RC2A4JZ5.js} +2 -2
  125. package/dist/cli/chunks/{chunk-IB27QACC.js → chunk-RDGPXENG.js} +2 -2
  126. package/dist/cli/chunks/{chunk-PX5YDCRH.js → chunk-RKI3IQKQ.js} +2 -2
  127. package/dist/cli/chunks/{chunk-BMAPORJ7.js → chunk-RKUAWQOF.js} +2 -2
  128. package/dist/cli/chunks/chunk-RLW25X66.js +2 -0
  129. package/dist/cli/chunks/{chunk-RFNPJK6N.js → chunk-ROVZSZCS.js} +3 -3
  130. package/dist/cli/chunks/{chunk-MQROI74N.js → chunk-RT6O2HW2.js} +2 -2
  131. package/dist/cli/chunks/{chunk-Y3UOUNHM.js → chunk-SM2YJ2AL.js} +2 -2
  132. package/dist/cli/chunks/{chunk-BBT64TII.js → chunk-SRPLERER.js} +3 -3
  133. package/dist/cli/chunks/{chunk-YS4FCTWF.js → chunk-T77GZF4B.js} +1 -1
  134. package/dist/cli/chunks/{chunk-IV5UZOHH.js → chunk-TFK2AYIN.js} +2 -2
  135. package/dist/cli/chunks/chunk-TW3SR4TS.js +2 -0
  136. package/dist/cli/chunks/{chunk-7Z5LHRC3.js → chunk-TXSPBLBT.js} +2 -2
  137. package/dist/cli/chunks/chunk-UA7TDVL7.js +12 -0
  138. package/dist/cli/chunks/{chunk-3EZOZN25.js → chunk-UBJG3IHT.js} +2 -2
  139. package/dist/cli/chunks/{chunk-QW6VMTBR.js → chunk-UFSVUBTR.js} +2 -2
  140. package/dist/cli/chunks/{chunk-ZEV3YTO7.js → chunk-UOI6ULCH.js} +2 -2
  141. package/dist/cli/chunks/{chunk-JZOS5FCX.js → chunk-UYUJT6QO.js} +2 -2
  142. package/dist/cli/chunks/{chunk-3EA536JF.js → chunk-V5AK56DA.js} +2 -2
  143. package/dist/cli/chunks/{chunk-UKA2KOXE.js → chunk-V6RE4YRQ.js} +2 -2
  144. package/dist/cli/chunks/{chunk-RZZCUIAI.js → chunk-VW6FRMLW.js} +2 -2
  145. package/dist/cli/chunks/chunk-VXKWNRGA.js +2 -0
  146. package/dist/cli/chunks/{chunk-6SH5VZUD.js → chunk-VYDVI6FZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-BJTJLJRZ.js → chunk-WF6UISKW.js} +3 -3
  148. package/dist/cli/chunks/{chunk-ZL6SYKUK.js → chunk-WIH522AP.js} +1 -1
  149. package/dist/cli/chunks/{chunk-JIXUMYKZ.js → chunk-WOV6XI3A.js} +1 -1
  150. package/dist/cli/chunks/{chunk-JBTPOIAC.js → chunk-X7ADKL7T.js} +2 -2
  151. package/dist/cli/chunks/{chunk-JVNTSNWU.js → chunk-XBYQ2BS4.js} +2 -2
  152. package/dist/cli/chunks/{chunk-Z7WODOTH.js → chunk-XL5KIYE3.js} +2 -2
  153. package/dist/cli/chunks/{chunk-JMONHE4B.js → chunk-XWYELBZS.js} +1 -1
  154. package/dist/cli/chunks/{chunk-SJUXE4IC.js → chunk-XYLQZWF6.js} +2 -2
  155. package/dist/cli/chunks/{chunk-KNNISEDY.js → chunk-Y6AKKQIQ.js} +1 -1
  156. package/dist/cli/chunks/{chunk-CCK4BF76.js → chunk-YMW57PEL.js} +1 -1
  157. package/dist/cli/chunks/{chunk-64VGZQLB.js → chunk-YO4ESCB4.js} +1 -1
  158. package/dist/cli/chunks/{chunk-ZSPU4MOS.js → chunk-YRHTQZU4.js} +2 -2
  159. package/dist/cli/chunks/chunk-Z4Q5PCRZ.js +65 -0
  160. package/dist/cli/chunks/{chunk-Q5XTSMWR.js → chunk-ZELWDJXT.js} +2 -2
  161. package/dist/cli/chunks/{chunk-SPV2VKC5.js → chunk-ZQZD55MN.js} +2 -2
  162. package/dist/cli/chunks/{chunk-66VWCR67.js → chunk-ZS4XVJGV.js} +2 -2
  163. package/dist/cli/chunks/{chunk-6LIHFV7O.js → chunk-ZUB5YOCM.js} +2 -2
  164. package/dist/cli/chunks/chunk-ZUOVNFXK.js +2 -0
  165. package/dist/cli/chunks/{chunk-7NITCZWD.js → chunk-ZWEKAEEV.js} +1 -1
  166. package/dist/cli/chunks/{ci-W6K6G2KZ.js → ci-J3TDK5RA.js} +8 -8
  167. package/dist/cli/chunks/{ci-output-LDT24TS3.js → ci-output-RLS32FUY.js} +2 -2
  168. package/dist/cli/chunks/{circuit-breaker-F5V4KITU.js → circuit-breaker-MRCC7WCM.js} +2 -2
  169. package/dist/cli/chunks/{claude-flow-setup-DT6WQQVD.js → claude-flow-setup-LIZCEKDF.js} +2 -2
  170. package/dist/cli/chunks/client-3BD2DI4N.js +2 -0
  171. package/dist/cli/chunks/{cline-installer-G7TJOAEX.js → cline-installer-T7H6R2RC.js} +2 -2
  172. package/dist/cli/chunks/{code-PGE6A42V.js → code-XMBLI7OF.js} +3 -3
  173. package/dist/cli/chunks/{code-index-extractor-RNITH372.js → code-index-extractor-QS7BYLEX.js} +2 -2
  174. package/dist/cli/chunks/{codex-installer-LBX77AI3.js → codex-installer-6PGT5FM6.js} +2 -2
  175. package/dist/cli/chunks/{completions-4AWLAARX.js → completions-2A3WRXY2.js} +2 -2
  176. package/dist/cli/chunks/{complexity-analyzer-ZPNSS476.js → complexity-analyzer-23HOOGJ7.js} +2 -2
  177. package/dist/cli/chunks/{continuedev-installer-UAPWX6OA.js → continuedev-installer-4FSF7B3N.js} +2 -2
  178. package/dist/cli/chunks/{copilot-installer-BJN2YJGI.js → copilot-installer-A5GRQQUU.js} +2 -2
  179. package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +2 -0
  180. package/dist/cli/chunks/{cost-tracker-MHP2VJ63.js → cost-tracker-Z4STQ5VB.js} +2 -2
  181. package/dist/cli/chunks/{coverage-PQB4IEFG.js → coverage-NUPP6KZZ.js} +3 -3
  182. package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +2 -0
  183. package/dist/cli/chunks/{cursor-installer-ZXBWYAS3.js → cursor-installer-FVJ7ROPJ.js} +2 -2
  184. package/dist/cli/chunks/{daemon-N2BEGEFY.js → daemon-7ZZA2MMN.js} +4 -4
  185. package/dist/cli/chunks/{daemon-64C7R6OJ.js → daemon-D662EX5N.js} +3 -3
  186. package/dist/cli/chunks/{dag-attention-scheduler-SPZDAPNL.js → dag-attention-scheduler-IB4TQ2KA.js} +2 -2
  187. package/dist/cli/chunks/{detect-LXJBSSZW.js → detect-LGLBZN4I.js} +2 -2
  188. package/dist/cli/chunks/{dist-node-U3TKZ2IZ.js → dist-node-Z3OL42YE.js} +2 -2
  189. package/dist/cli/chunks/{domain-handler-3DDWUVSR.js → domain-handler-L3CLNL7U.js} +2 -2
  190. package/dist/cli/chunks/{domain-plugins-JJVWI4OQ.js → domain-plugins-GQ3V5X6L.js} +2 -2
  191. package/dist/cli/chunks/{domain-transfer-M36KUJ2U.js → domain-transfer-MFCI76IY.js} +2 -2
  192. package/dist/cli/chunks/dream-FTP33IJB.js +2 -0
  193. package/dist/cli/chunks/{embed-and-insert-pattern-JPAR7TXX.js → embed-and-insert-pattern-UGD6USYH.js} +2 -2
  194. package/dist/cli/chunks/{eval-SOLG23EA.js → eval-3B7UIYGY.js} +2 -2
  195. package/dist/cli/chunks/{experience-capture-middleware-T7G2VOOD.js → experience-capture-middleware-3RQ4NYY3.js} +3 -3
  196. package/dist/cli/chunks/{fast-paths-32N3ELI4.js → fast-paths-QOSAEPYD.js} +2 -2
  197. package/dist/cli/chunks/{feature-flags-NAHKLDRN.js → feature-flags-3S5TH6P4.js} +2 -2
  198. package/dist/cli/chunks/{feature-flags-APJDQ4N7.js → feature-flags-TLF4NKOH.js} +2 -2
  199. package/dist/cli/chunks/{file-discovery-YKVM3MDB.js → file-discovery-AEVMJRNB.js} +2 -2
  200. package/dist/cli/chunks/{fleet-55M5CJS4.js → fleet-E6WTXWFL.js} +3 -3
  201. package/dist/cli/chunks/{gnn-wrapper-UD6E6S6Z.js → gnn-wrapper-MCKH3AUU.js} +2 -2
  202. package/dist/cli/chunks/{heartbeat-handler-OYVW3VSC.js → heartbeat-handler-U7XENHRR.js} +4 -4
  203. package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +2 -0
  204. package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +2 -0
  205. package/dist/cli/chunks/hnsw-index-MS5KODD7.js +2 -0
  206. package/dist/cli/chunks/{hnsw-legacy-bridge-HBYIS3ZW.js → hnsw-legacy-bridge-5GW4SAEI.js} +2 -2
  207. package/dist/cli/chunks/{hnswlib-node-EQPM42OU.js → hnswlib-node-7BLZBK5T.js} +2 -2
  208. package/dist/cli/chunks/{hooks-5ZSSJWO6.js → hooks-F3O2SB6H.js} +10 -10
  209. package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +2 -0
  210. package/dist/cli/chunks/{hypergraph-engine-XBGVQ4PD.js → hypergraph-engine-PV4EKXHB.js} +2 -2
  211. package/dist/cli/chunks/{hypergraph-handler-CAWAQ673.js → hypergraph-handler-VOWO5ZTW.js} +3 -3
  212. package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +2 -0
  213. package/dist/cli/chunks/{init-handler-PRHXSARK.js → init-handler-ENJ5ONJX.js} +16 -14
  214. package/dist/cli/chunks/init-wizard-I5DFZUQL.js +2 -0
  215. package/dist/cli/chunks/kernel-MISPSPPA.js +2 -0
  216. package/dist/cli/chunks/{kilocode-installer-F7LXBM7I.js → kilocode-installer-HNNJOOPE.js} +2 -2
  217. package/dist/cli/chunks/{kiro-installer-NM723ZRG.js → kiro-installer-UZBIQ3IC.js} +2 -2
  218. package/dist/cli/chunks/knowledge-graph-L26JESGE.js +2 -0
  219. package/dist/cli/chunks/{learning-5QYIDHH3.js → learning-YMLCVFUT.js} +3 -3
  220. package/dist/cli/chunks/{llm-router-43HKWPSX.js → llm-router-YWTARCCT.js} +4 -4
  221. package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +2 -0
  222. package/dist/cli/chunks/{load-5YDBWSCS.js → load-DKE3F3IP.js} +2 -2
  223. package/dist/cli/chunks/load-test-H5ISNNM5.js +2 -0
  224. package/dist/cli/chunks/{mcp-UMAPMNMY.js → mcp-5PSGIUCW.js} +2 -2
  225. package/dist/cli/chunks/{memory-FWCPCQFP.js → memory-3L3O6JMM.js} +5 -5
  226. package/dist/cli/chunks/memory-backend-HWDNOBKW.js +2 -0
  227. package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +2 -0
  228. package/dist/cli/chunks/{multi-model-executor-2XTBGLE4.js → multi-model-executor-AEEO7IA4.js} +2 -2
  229. package/dist/cli/chunks/{opencode-installer-GIXOJ6NS.js → opencode-installer-ABBO355U.js} +2 -2
  230. package/dist/cli/chunks/{orchestrator-VW6BKHLI.js → orchestrator-E36Q7MKE.js} +17 -17
  231. package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +2 -0
  232. package/dist/cli/chunks/{pattern-usage-recorder-7CEUC3J7.js → pattern-usage-recorder-H4XKSID4.js} +2 -2
  233. package/dist/cli/chunks/{pipeline-IGUQPPPO.js → pipeline-BGFEHXIN.js} +2 -2
  234. package/dist/cli/chunks/{platform-2P636I7B.js → platform-GK7ZVDJI.js} +2 -2
  235. package/dist/cli/chunks/{plugin-NY6SWDPE.js → plugin-CAH2CKI6.js} +2 -2
  236. package/dist/cli/chunks/{prime-radiant-advanced-wasm-2UUDTIO2.js → prime-radiant-advanced-wasm-M5EYRONA.js} +2 -2
  237. package/dist/cli/chunks/{project-root-IOISG5KX.js → project-root-BSNZC243.js} +2 -2
  238. package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +2 -0
  239. package/dist/cli/chunks/{protocol-handler-ZTPCRQ5W.js → protocol-handler-JDSSC2SF.js} +2 -2
  240. package/dist/cli/chunks/{prove-SQX5A3IG.js → prove-ANPTOZJE.js} +2 -2
  241. package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +2 -0
  242. package/dist/cli/chunks/{quality-DROILKRY.js → quality-SXWGYRQR.js} +2 -2
  243. package/dist/cli/chunks/{quality-gate-PWKWDJY2.js → quality-gate-GYNCA4ZY.js} +3 -3
  244. package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +2 -0
  245. package/dist/cli/chunks/{real-embeddings-P5U3MGYC.js → real-embeddings-WSRYAOZM.js} +2 -2
  246. package/dist/cli/chunks/{ref-validation-KY73NQXD.js → ref-validation-AZ3LRWEK.js} +2 -2
  247. package/dist/cli/chunks/{roocode-installer-6JPPRB3W.js → roocode-installer-2QKGFIEU.js} +2 -2
  248. package/dist/cli/chunks/router-MTP5LH4H.js +2 -0
  249. package/dist/cli/chunks/routing-feedback-GWETVB4L.js +2 -0
  250. package/dist/cli/chunks/{routing-handler-VTJIVFUO.js → routing-handler-UYDC5MMD.js} +2 -2
  251. package/dist/cli/chunks/{ruvector-commands-C6RPSJJO.js → ruvector-commands-QXADPVEY.js} +2 -2
  252. package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +2 -0
  253. package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +2 -0
  254. package/dist/cli/chunks/{rvf-migration-coordinator-R53URRIO.js → rvf-migration-coordinator-GD4NBFKT.js} +2 -2
  255. package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +2 -0
  256. package/dist/cli/chunks/{rvf-store-integrity-MMXN5TEJ.js → rvf-store-integrity-7SXG66IL.js} +2 -2
  257. package/dist/cli/chunks/safe-db-FWWGAPVE.js +2 -0
  258. package/dist/cli/chunks/schedule-TPA4V4D5.js +2 -0
  259. package/dist/cli/chunks/scheduler-5ZTEPNDD.js +2 -0
  260. package/dist/cli/chunks/{security-3B3R2NL4.js → security-YKB622PK.js} +3 -3
  261. package/dist/cli/chunks/{shared-rvf-adapter-VIJB7JUS.js → shared-rvf-adapter-KMLAV7JK.js} +2 -2
  262. package/dist/cli/chunks/{shared-rvf-dual-writer-UVWGDUWC.js → shared-rvf-dual-writer-OYY27DFV.js} +2 -2
  263. package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +2 -0
  264. package/dist/cli/chunks/{standalone-memory-M4LWAAYZ.js → standalone-memory-2DOABVLC.js} +2 -2
  265. package/dist/cli/chunks/{status-handler-YYFV6OZL.js → status-handler-EXRKETV7.js} +2 -2
  266. package/dist/cli/chunks/{structural-health-27E6LLKB.js → structural-health-2SKK6DU6.js} +2 -2
  267. package/dist/cli/chunks/sync-DQ2YUNI6.js +2 -0
  268. package/dist/cli/chunks/{sync-J3LJ56WN.js → sync-UW7SX7GO.js} +2 -2
  269. package/dist/cli/chunks/{task-handler-4MCEBQZL.js → task-handler-LYQ6WYUY.js} +2 -2
  270. package/dist/cli/chunks/task-handlers-DIJO232S.js +9 -0
  271. package/dist/cli/chunks/test-WRHZMUCW.js +33 -0
  272. package/dist/cli/chunks/{test-scheduling-ZJBFRZ3J.js → test-scheduling-HI23RXFK.js} +3 -3
  273. package/dist/cli/chunks/token-bootstrap-23SA6SWZ.js +2 -0
  274. package/dist/cli/chunks/{token-usage-3X5WMTG2.js → token-usage-M7RRDPXO.js} +2 -2
  275. package/dist/cli/chunks/{transformers-MVL4C5IX.js → transformers-4TC35KKS.js} +2 -2
  276. package/dist/cli/chunks/{tree-sitter-wasm-parser-SLW65ZFO.js → tree-sitter-wasm-parser-F4LTKAWD.js} +2 -2
  277. package/dist/cli/chunks/{types-TG5P3CRS.js → types-NBXV6LXQ.js} +2 -2
  278. package/dist/cli/chunks/unified-memory-OVFEPRPS.js +2 -0
  279. package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +2 -0
  280. package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +2 -0
  281. package/dist/cli/chunks/{upgrade-ETBHDEPY.js → upgrade-4BGOU5RM.js} +2 -2
  282. package/dist/cli/chunks/{validate-C2A73LZK.js → validate-EDWAR63H.js} +2 -2
  283. package/dist/cli/chunks/{validate-swarm-67XN42ML.js → validate-swarm-VI72CPR7.js} +2 -2
  284. package/dist/cli/chunks/visual-security-2FUM5GLI.js +2 -0
  285. package/dist/cli/chunks/{web-tree-sitter-USJN77P4.js → web-tree-sitter-Y5XBRQXF.js} +2 -2
  286. package/dist/cli/chunks/{windsurf-installer-5GGZXGJW.js → windsurf-installer-VEX23WAF.js} +2 -2
  287. package/dist/cli/chunks/{witness-chain-IWS5ZHHL.js → witness-chain-3YNL6YGY.js} +2 -2
  288. package/dist/cli/chunks/witness-chain-MH6GA5L6.js +2 -0
  289. package/dist/cli/chunks/witness-chain-repair-MJZGZRWT.js +2 -0
  290. package/dist/cli/chunks/{witness-chain-verifier-3GEADWPE.js → witness-chain-verifier-TTJYXTBE.js} +2 -2
  291. package/dist/cli/chunks/{witness-key-manager-ZWEIK3VJ.js → witness-key-manager-EM6YXYOY.js} +2 -2
  292. package/dist/cli/chunks/{workflow-KHMVVBBA.js → workflow-2RBDOM7V.js} +4 -4
  293. package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +2 -0
  294. package/dist/cli/chunks/wrappers-5OTAVVOV.js +2 -0
  295. package/dist/cli/commands/ci.js +1 -1
  296. package/dist/cli/commands/test.js +18 -3
  297. package/dist/cli/handlers/init-handler.d.ts +2 -0
  298. package/dist/cli/handlers/init-handler.js +8 -2
  299. package/dist/cli/index.js +8 -0
  300. package/dist/coordination/handlers/test-execution-handlers.js +13 -8
  301. package/dist/coordination/index.d.ts +1 -1
  302. package/dist/coordination/queen-event-handlers.js +9 -6
  303. package/dist/coordination/result-saver.js +1 -1
  304. package/dist/coordination/services/index.d.ts +1 -1
  305. package/dist/coordination/services/task-audit-logger.d.ts +38 -13
  306. package/dist/coordination/services/task-audit-logger.js +33 -5
  307. package/dist/coordination/task-executor.d.ts +5 -0
  308. package/dist/coordination/task-executor.js +10 -5
  309. package/dist/domains/test-generation/coordinator.js +6 -5
  310. package/dist/domains/test-generation/interfaces.d.ts +11 -1
  311. package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
  312. package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
  313. package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
  314. package/dist/domains/test-generation/services/behavior-examples.js +65 -0
  315. package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
  316. package/dist/domains/test-generation/services/test-generator.js +59 -30
  317. package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
  318. package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
  319. package/dist/init/browser-engine-installer.d.ts +5 -5
  320. package/dist/init/browser-engine-installer.js +28 -6
  321. package/dist/init/init-wizard.d.ts +2 -0
  322. package/dist/init/orchestrator.js +1 -0
  323. package/dist/init/phases/09-assets.js +8 -18
  324. package/dist/init/phases/phase-interface.d.ts +2 -0
  325. package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
  326. package/dist/integrations/vibium/client.d.ts +1 -0
  327. package/dist/integrations/vibium/client.js +24 -11
  328. package/dist/integrations/vibium/runtime.d.ts +14 -0
  329. package/dist/integrations/vibium/runtime.js +94 -0
  330. package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
  331. package/dist/kernel/pattern-fts-self-heal.js +193 -0
  332. package/dist/kernel/process-lifecycle.d.ts +60 -0
  333. package/dist/kernel/process-lifecycle.js +91 -0
  334. package/dist/kernel/unified-memory-schemas.d.ts +15 -1
  335. package/dist/kernel/unified-memory-schemas.js +53 -25
  336. package/dist/kernel/unified-memory.js +31 -34
  337. package/dist/kernel/unified-persistence.js +12 -6
  338. package/dist/learning/experience-capture.d.ts +2 -1
  339. package/dist/learning/experience-capture.js +23 -8
  340. package/dist/learning/pattern-store.d.ts +1 -1
  341. package/dist/learning/pattern-store.js +27 -30
  342. package/dist/learning/qe-patterns.d.ts +6 -0
  343. package/dist/learning/qe-reasoning-bank.d.ts +1 -0
  344. package/dist/learning/qe-reasoning-bank.js +14 -4
  345. package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
  346. package/dist/learning/real-qe-reasoning-bank.js +28 -4
  347. package/dist/learning/rvf-pattern-store.js +19 -19
  348. package/dist/learning/sqlite-persistence.js +9 -24
  349. package/dist/mcp/bundle.js +508 -545
  350. package/dist/mcp/entry.js +52 -6
  351. package/dist/mcp/handlers/domain-handler-configs.js +12 -4
  352. package/dist/mcp/handlers/task-handlers.js +11 -7
  353. package/dist/mcp/protocol-server.js +18 -3
  354. package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
  355. package/dist/mcp/services/reasoning-bank-service.js +5 -1
  356. package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
  357. package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
  358. package/dist/mcp/tools/test-generation/generate.js +8 -0
  359. package/dist/mcp/types.d.ts +6 -2
  360. package/dist/shared/error-utils.d.ts +15 -0
  361. package/dist/shared/error-utils.js +21 -0
  362. package/dist/shared/events/domain-events.d.ts +2 -1
  363. package/package.json +10 -6
  364. package/dist/cli/chunks/adapter-UYOJPTOX.js +0 -2
  365. package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +0 -2
  366. package/dist/cli/chunks/base-DRZ2LS6X.js +0 -2
  367. package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +0 -2
  368. package/dist/cli/chunks/chunk-4N23RFDU.js +0 -2
  369. package/dist/cli/chunks/chunk-AHKELLIO.js +0 -12
  370. package/dist/cli/chunks/chunk-MJS53PRX.js +0 -2
  371. package/dist/cli/chunks/chunk-PZPWRQ2M.js +0 -21
  372. package/dist/cli/chunks/chunk-QGA55PFM.js +0 -12
  373. package/dist/cli/chunks/chunk-TCHGOB2N.js +0 -2
  374. package/dist/cli/chunks/chunk-Z6GGIRQQ.js +0 -65
  375. package/dist/cli/chunks/client-KHWJT6FB.js +0 -2
  376. package/dist/cli/chunks/core-handlers-HING5RRG.js +0 -2
  377. package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +0 -2
  378. package/dist/cli/chunks/dream-WUGRSNCV.js +0 -2
  379. package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +0 -2
  380. package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +0 -2
  381. package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +0 -2
  382. package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +0 -2
  383. package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +0 -2
  384. package/dist/cli/chunks/init-wizard-72MFBI3G.js +0 -2
  385. package/dist/cli/chunks/kernel-BRCBVMSK.js +0 -2
  386. package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +0 -2
  387. package/dist/cli/chunks/llm-router-service-24KXFX32.js +0 -2
  388. package/dist/cli/chunks/load-test-N4TAYJY3.js +0 -2
  389. package/dist/cli/chunks/memory-backend-NVYFYVAU.js +0 -2
  390. package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +0 -2
  391. package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +0 -2
  392. package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +0 -2
  393. package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +0 -2
  394. package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +0 -2
  395. package/dist/cli/chunks/router-SRSO3IHF.js +0 -2
  396. package/dist/cli/chunks/routing-feedback-PASRE5HY.js +0 -2
  397. package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +0 -2
  398. package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +0 -2
  399. package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +0 -2
  400. package/dist/cli/chunks/safe-db-QJLFO33B.js +0 -2
  401. package/dist/cli/chunks/schedule-YIVXW5O2.js +0 -2
  402. package/dist/cli/chunks/scheduler-AON7DWSJ.js +0 -2
  403. package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +0 -2
  404. package/dist/cli/chunks/sync-26CEGSTC.js +0 -2
  405. package/dist/cli/chunks/task-handlers-GYBAWKE2.js +0 -9
  406. package/dist/cli/chunks/test-MPC5HRH5.js +0 -33
  407. package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +0 -2
  408. package/dist/cli/chunks/unified-memory-UCQ6AB32.js +0 -2
  409. package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +0 -2
  410. package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +0 -2
  411. package/dist/cli/chunks/vibium-NILGKHLN.js +0 -2
  412. package/dist/cli/chunks/visual-security-4VZXPEVG.js +0 -2
  413. package/dist/cli/chunks/witness-chain-JQA2VPZI.js +0 -2
  414. package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +0 -2
  415. package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +0 -2
  416. package/dist/cli/chunks/wrappers-N6XIK5PT.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.14.6");process.exit(0)}
2
- import{a as b}from"./chunk-5VFPCSK7.js";import{a as f,c as O}from"./chunk-MJS53PRX.js";import"./chunk-64VGZQLB.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.14.7");process.exit(0)}
2
+ import{a as b}from"./chunk-NOHWJOBS.js";import{a as f,e as O}from"./chunk-ZUOVNFXK.js";import"./chunk-YO4ESCB4.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.14.6");process.exit(0)}
2
- import{a as $e}from"./chunk-DBDPRORT.js";import{a as ae,b as ye,c as Re,d as Ae,e as xe,f as Te,g as je,h as qe,i as Me,j as Oe,k as Be,l as Ne,m as Fe,n as Qe}from"./chunk-W6HXLH5G.js";import{a as N,b as le,c as _e,e as De,f as F}from"./chunk-6SQM2MUX.js";import{a as Le}from"./chunk-5VFPCSK7.js";import{c as Se}from"./chunk-V4DM6ELU.js";import"./chunk-JIXUMYKZ.js";import"./chunk-TVYY3OCX.js";import"./chunk-7D3V65N5.js";import"./chunk-BMAPORJ7.js";import"./chunk-2JVWITNK.js";import"./chunk-Q5XTSMWR.js";import{b as _,d as ie}from"./chunk-AIRGNL55.js";import"./chunk-QW6VMTBR.js";import"./chunk-SDRHUMJB.js";import"./chunk-KNNISEDY.js";import"./chunk-TCHGOB2N.js";import"./chunk-FBMN7B46.js";import"./chunk-ENGZ4D5V.js";import{a as E,b as Ee,c as oe}from"./chunk-MJS53PRX.js";import"./chunk-WCJBU2KI.js";import{a as D,b as he}from"./chunk-PI7TJS62.js";import"./chunk-EAY2JMZG.js";import"./chunk-C6KWXUFJ.js";import"./chunk-IB27QACC.js";import"./chunk-6SH5VZUD.js";import"./chunk-SESK3ARK.js";import"./chunk-SNOBH4AZ.js";import"./chunk-IQO7UCFR.js";import"./chunk-DUYOVM5I.js";import{a as ot}from"./chunk-64VGZQLB.js";oe();oe();var y=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:Ee(s),durationMs:Date.now()-t,message:`${this.description} failed: ${E(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}};ie();he();import{existsSync as j}from"fs";import{join as q}from"path";var Q=class extends y{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=j(q(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,c=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:c,v2Detection:s}}async detectV2Installation(e){let t=q(e,".agentic-qe","memory.db"),s=q(e,".agentic-qe","config"),n=q(e,".claude","agents"),o=q(e,".agentic-qe","config","learning.json"),r=j(t),i=j(s),c=j(n),d=j(o),m=j(q(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.")||d&&!m),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:c?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:c,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.14.7");process.exit(0)}
2
+ import{a as $e}from"./chunk-O5V7RHVG.js";import{a as de,b as ye,c as Re,d as Ae,e as xe,f as Te,g as qe,h as je,i as Me,j as Oe,k as Be,l as Le,m as Fe,n as Qe}from"./chunk-MM56VPNE.js";import{a as F,b as ue,c as _e,e as De,f as Q}from"./chunk-N5XOXPHZ.js";import{a as Ne}from"./chunk-NOHWJOBS.js";import{c as Se}from"./chunk-ON2UTP2U.js";import"./chunk-WOV6XI3A.js";import"./chunk-A3DK3XNZ.js";import"./chunk-HYOPJHHW.js";import"./chunk-RKUAWQOF.js";import"./chunk-QUORH2MG.js";import"./chunk-ZELWDJXT.js";import{b as _,d as ce}from"./chunk-OIDWDGLG.js";import"./chunk-UFSVUBTR.js";import"./chunk-IAENZ2DR.js";import"./chunk-Y6AKKQIQ.js";import"./chunk-PELENDDQ.js";import"./chunk-TW3SR4TS.js";import"./chunk-5GFKTJ65.js";import"./chunk-5D7ZFWDS.js";import{a as E,b as Ee,e as le}from"./chunk-ZUOVNFXK.js";import"./chunk-OXHF3L2T.js";import{a as D,b as he}from"./chunk-ND4QTZOL.js";import"./chunk-JZT7BU44.js";import"./chunk-P7XSPP5D.js";import"./chunk-RDGPXENG.js";import"./chunk-VYDVI6FZ.js";import"./chunk-HYFQUWNB.js";import"./chunk-B4I43GE2.js";import"./chunk-CBONQM5D.js";import"./chunk-AEUEMVJK.js";import{a as ot}from"./chunk-YO4ESCB4.js";le();le();var y=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:Ee(s),durationMs:Date.now()-t,message:`${this.description} failed: ${E(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}};ce();he();import{existsSync as q}from"fs";import{join as j}from"path";var V=class extends y{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=q(j(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,c=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:c,v2Detection:s}}async detectV2Installation(e){let t=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=q(t),i=q(s),c=q(n),d=q(o),m=q(j(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.")||d&&!m),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:c?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:c,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?_(n.value):void 0}catch{t.close();return}}catch{return}}};var V=class extends y{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await Re(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 H=class extends y{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=Ae({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 G,mkdirSync as ke}from"fs";import{join as U}from"path";var W=class extends y{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=U(t,"vectors.db");G(s)&&e.services.log(` \u26A0 Stale vectors.db detected at ${s}
8
+ `).get();return t.close(),n?_(n.value):void 0}catch{t.close();return}}catch{return}}};var H=class extends y{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await Re(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 G=class extends y{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=Ae({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 U,mkdirSync as ve}from"fs";import{join as W}from"path";var z=class extends y{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=W(t,"vectors.db");U(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=U(t,".agentic-qe");G(n)||ke(n,{recursive:!0});let o=U(n,"workers");G(o)||ke(o,{recursive:!0});let r=U(n,"data");G(r)||ke(r,{recursive:!0});let i=U(n,"memory.db"),c=!G(i);try{let{initializeUnifiedMemory:d,resetUnifiedMemory:m}=await import("./unified-memory-UCQ6AB32.js"),u=await d({dbPath:i,walMode:!0,busyTimeout:5e3}),h=u.getStats().tables.map(L=>L.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:ae()},"_system");let P=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return m(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${P}`),e.services.log(` Tables: ${h.length} (v3 full schema)`),{dbPath:i,created:c,tablesCreated:h,schemaVersion:P}}catch(d){throw new Error(`SQLite persistence initialization FAILED: ${d}
11
+ rm "${s}"`);let n=W(t,".agentic-qe");U(n)||ve(n,{recursive:!0});let o=W(n,"workers");U(o)||ve(o,{recursive:!0});let r=W(n,"data");U(r)||ve(r,{recursive:!0});let i=W(n,"memory.db"),c=!U(i);try{let{initializeUnifiedMemory:d,resetUnifiedMemory:m}=await import("./unified-memory-OVFEPRPS.js"),u=await d({dbPath:i,walMode:!0,busyTimeout:5e3}),h=u.getStats().tables.map(L=>L.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:de()},"_system");let P=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return m(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${P}`),e.services.log(` Tables: ${h.length} (v3 full schema)`),{dbPath:i,created:c,tablesCreated:h,schemaVersion:P}}catch(d){throw new Error(`SQLite persistence initialization FAILED: ${d}
12
12
  Database path: ${i}
13
- Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as ce,mkdirSync as ve,writeFileSync as it}from"fs";import{join as $}from"path";var z=class extends y{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");ce(o)||ve(o,{recursive:!0});let r=$(o,"hnsw");ce(r)||ve(r,{recursive:!0});let i=$(o,"learning-config.json"),c={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:$(o,"memory.db"),hnswIndexPath:$(r,"index.bin"),initialized:new Date().toISOString()};F(i,c,[["initialized"]]);let d=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(d=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${d}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:d}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");ce(s)||ve(s,{recursive:!0});let n=$(s,"index.json");return ce(n)||it(n,JSON.stringify({version:ae(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};ie();he();import{existsSync as at,statSync as lt}from"fs";import{join as de}from"path";var Ve=3e4,He=18e4,Ge=["**/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.*"],K=class extends y{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=de(t,".agentic-qe","memory.db");if(!at(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 d=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${d} entries)`),{status:"existing",entries:d}}let i=this.getKGEntryCount(n);n.close();let c=await this.findChangedFiles(t,r);return c.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${c.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,c))}catch(o){try{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
13
+ Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as me,mkdirSync as ke,writeFileSync as it}from"fs";import{join as $}from"path";var K=class extends y{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)||ke(o,{recursive:!0});let r=$(o,"hnsw");me(r)||ke(r,{recursive:!0});let i=$(o,"learning-config.json"),c={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:$(o,"memory.db"),hnswIndexPath:$(r,"index.bin"),initialized:new Date().toISOString()};Q(i,c,[["initialized"]]);let d=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(d=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${d}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:d}}async loadPretrainedPatterns(e,t){try{let s=$(e,"patterns");me(s)||ke(s,{recursive:!0});let n=$(s,"index.json");return me(n)||it(n,JSON.stringify({version:de(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};ce();he();import{existsSync as at,statSync as lt}from"fs";import{join as pe}from"path";var Ve=3e4,He=18e4,Ge=["**/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.*"],J=class extends y{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=pe(t,".agentic-qe","memory.db");if(!at(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 d=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${d} entries)`),{status:"existing",entries:d}}let i=this.getKGEntryCount(n);n.close();let c=await this.findChangedFiles(t,r);return c.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${c.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,c))}catch(o){try{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
14
14
  SELECT COUNT(*) as count FROM kv_store
15
15
  WHERE namespace = 'code-intelligence:kg'
16
16
  `).get().count>0}catch{return!1}}getKGEntryCount(e){try{return e.prepare(`
17
17
  SELECT COUNT(*) as count FROM kv_store
18
18
  WHERE namespace LIKE 'code-intelligence:kg%'
19
- `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-DG44IPEI.js"),r=de(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:c}=await $e(i,!0),d=new o(c,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0});try{let m;n?m=n:m=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ge})).map(g=>de(e,g)),t.services.log(` Scanning ${m.length} source files...`);let u=await this.runBoundedScan(d,m,s,t);if(u.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${He/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,m,t)}return u}finally{try{d.destroy()}catch{}try{await c.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,c="",d=Date.now(),m=!1;s||await e.clear();let u=n.projectRoot,p=g=>g.startsWith(u)?g.slice(u.length+1):g;for(let g of t){if(Date.now()-d>He){m=!0;break}c=g,n.services.log(` [${i+1}/${t.length}] ${p(g)}`);try{let w=await this.withTimeout(e.index({paths:[g],incremental:!0,includeTests:!0}),Ve,g);w.success&&(o+=w.value.nodesCreated,r+=w.value.edgesCreated)}catch(w){let P=w instanceof Error?w.message:String(w);P.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(g)} \u2014 indexing exceeded ${Ve/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(g)}: ${P}`)}i++}let h=o+r;return m?{status:"timeout",entries:h,timeoutFile:c}:{status:"indexed",entries:h}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-RNITH372.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-XBGVQ4PD.js"),r=D(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),c=await n(t),d=await i.buildFromIndexResult(c);r.close(),d.nodesCreated+d.edgesCreated>0&&s.services.log(` Hypergraph: ${d.nodesCreated} nodes, ${d.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
19
+ `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-L26JESGE.js"),r=pe(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:c}=await $e(i,!0),d=new o(c,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0});try{let m;n?m=n:m=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ge})).map(g=>pe(e,g)),t.services.log(` Scanning ${m.length} source files...`);let u=await this.runBoundedScan(d,m,s,t);if(u.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${He/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,m,t)}return u}finally{try{d.destroy()}catch{}try{await c.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,c="",d=Date.now(),m=!1;s||await e.clear();let u=n.projectRoot,p=g=>g.startsWith(u)?g.slice(u.length+1):g;for(let g of t){if(Date.now()-d>He){m=!0;break}c=g,n.services.log(` [${i+1}/${t.length}] ${p(g)}`);try{let w=await this.withTimeout(e.index({paths:[g],incremental:!0,includeTests:!0}),Ve,g);w.success&&(o+=w.value.nodesCreated,r+=w.value.edgesCreated)}catch(w){let P=w instanceof Error?w.message:String(w);P.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(g)} \u2014 indexing exceeded ${Ve/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(g)}: ${P}`)}i++}let h=o+r;return m?{status:"timeout",entries:h,timeoutFile:c}:{status:"indexed",entries:h}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-QS7BYLEX.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-PV4EKXHB.js"),r=D(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),c=await n(t),d=await i.buildFromIndexResult(c);r.close(),d.nodesCreated+d.edgesCreated>0&&s.services.log(` Hypergraph: ${d.nodesCreated} nodes, ${d.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
20
20
  SELECT value FROM kv_store
21
21
  WHERE namespace = 'code-intelligence:kg'
22
22
  AND key = 'metadata:index'
23
- `).get();if(!t)return null;let s=_(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let n=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ge}),o=t.getTime(),r=[];for(let i of n){let c=de(e,i);try{lt(c).mtimeMs>o&&r.push(c)}catch{}}return r}};ie();import{existsSync as C,mkdirSync as J,readFileSync as Ue,writeFileSync as M}from"fs";import{join as v,dirname as ct}from"path";import{fileURLToPath as dt}from"url";var ut=dt(import.meta.url),mt=ct(ut),pt=[["aqe","initialized"]],Y=class extends y{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");C(n)||J(n,{recursive:!0});let o=v(n,"hooks");C(o)||J(o,{recursive:!0});let r=v(n,"settings.json"),i={},c;if(C(r))try{let b=Ue(r,"utf-8");i=_(b),c=_(b)}catch{i={}}let d=this.generateHooksConfig(t,s),m=Object.keys(d),u=i.hooks||{},p=this.hasExistingAqeHooks(u);p&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=je(u,d);let h=i.env,g={memoryBackend:e.options.memoryBackend};i.env=qe(h,Me(t,g),g);let w=Be(t,s,g);Oe(i,w,{statusLine:!e.options.noStatusLine,...g});let P=i.enabledMcpjsonServers||[];if(P=P.filter(b=>b!=="aqe"),P.includes("agentic-qe")||P.push("agentic-qe"),i.enabledMcpjsonServers=P,De(c,i,pt)){let b=xe(r);b&&e.services.log(` Backup created: ${b}`),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,m),this.installHookAssets(o,e);try{let b=Ue(r,"utf-8"),re=_(b).hooks;(!re||!this.hasExistingAqeHooks(re))&&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: ${m.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:m,existingAqeDetected:p}}writeHooksReadme(e,t){let s=v(e,"README.txt");if(C(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(!C(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 c of r)if(C(c)){let{copyFileSync:d}=ot("fs");d(c,n),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||M(n,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
25
- `),"utf-8")}let o=v(e,"v3-domain-workers.json");C(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(Te(s))return!0}return!1}installBrainCheckpoint(e,t){let s=v(e,".claude","helpers");C(s)||J(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")];for(let r of o)if(C(r)&&r!==n){le(r,n)&&t.services.log(" Installed brain-checkpoint.cjs (copied)");return}C(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=v(e,".claude","helpers");C(s)||J(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(C(r)&&r!==n){le(r,n)&&t.services.log(" Installed statusline-v3.cjs (copied)");return}C(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}installHookShim(e,t){let s=v(e,".claude","hooks");C(s)||J(s,{recursive:!0});let n=v(s,"aqe-hook.cjs"),o=[v(e,"node_modules","agentic-qe",".claude","hooks","aqe-hook.cjs"),v(mt,"..","..","..",".claude","hooks","aqe-hook.cjs")];for(let r of o)if(C(r)&&r!==n){le(r,n)&&t.services.log(" Installed aqe-hook.cjs (copied)");return}C(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=_(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let n=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ge}),o=t.getTime(),r=[];for(let i of n){let c=pe(e,i);try{lt(c).mtimeMs>o&&r.push(c)}catch{}}return r}};ce();import{existsSync as C,mkdirSync as Y,readFileSync as Ue,writeFileSync as M}from"fs";import{join as k,dirname as ct}from"path";import{fileURLToPath as dt}from"url";var ut=dt(import.meta.url),mt=ct(ut),pt=[["aqe","initialized"]],X=class extends y{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=k(s,".claude");C(n)||Y(n,{recursive:!0});let o=k(n,"hooks");C(o)||Y(o,{recursive:!0});let r=k(n,"settings.json"),i={},c;if(C(r))try{let b=Ue(r,"utf-8");i=_(b),c=_(b)}catch{i={}}let d=this.generateHooksConfig(t,s),m=Object.keys(d),u=i.hooks||{},p=this.hasExistingAqeHooks(u);p&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=qe(u,d);let h=i.env,g={memoryBackend:e.options.memoryBackend};i.env=je(h,Me(t,g),g);let w=Be(t,s,g);Oe(i,w,{statusLine:!e.options.noStatusLine,...g});let P=i.enabledMcpjsonServers||[];if(P=P.filter(b=>b!=="aqe"),P.includes("agentic-qe")||P.push("agentic-qe"),i.enabledMcpjsonServers=P,De(c,i,pt)){let b=xe(r);b&&e.services.log(` Backup created: ${b}`),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,m),this.installHookAssets(o,e);try{let b=Ue(r,"utf-8"),ae=_(b).hooks;(!ae||!this.hasExistingAqeHooks(ae))&&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: ${m.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:m,existingAqeDetected:p}}writeHooksReadme(e,t){let s=k(e,"README.txt");if(C(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=k(e,"cross-phase-memory.yaml");if(!C(n)){let r=[k(s,"v3","assets","hooks","cross-phase-memory.yaml"),k(s,"assets","hooks","cross-phase-memory.yaml"),k(s,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let c of r)if(C(c)){let{copyFileSync:d}=ot("fs");d(c,n),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||M(n,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
25
+ `),"utf-8")}let o=k(e,"v3-domain-workers.json");C(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(Te(s))return!0}return!1}installBrainCheckpoint(e,t){let s=k(e,".claude","helpers");C(s)||Y(s,{recursive:!0});let n=k(s,"brain-checkpoint.cjs"),o=[k(e,".claude","helpers","brain-checkpoint.cjs"),k(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed brain-checkpoint.cjs (copied)");return}C(n)||(M(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=k(e,".claude","helpers");C(s)||Y(s,{recursive:!0});let n=k(s,"statusline-v3.cjs"),o=[k(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),k(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed statusline-v3.cjs (copied)");return}C(n)||(M(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}installHookShim(e,t){let s=k(e,".claude","hooks");C(s)||Y(s,{recursive:!0});let n=k(s,"aqe-hook.cjs"),o=[k(e,"node_modules","agentic-qe",".claude","hooks","aqe-hook.cjs"),k(mt,"..","..","..",".claude","hooks","aqe-hook.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed aqe-hook.cjs (copied)");return}C(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
@@ -105,10 +105,10 @@ function verifyBrain() {
105
105
  const cmd = process.argv[2] || 'verify';
106
106
  const result = cmd === 'export' ? exportBrain() : verifyBrain();
107
107
  if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
108
- `}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 gt,readFileSync as ft}from"fs";ie();import{join as ht}from"path";var X=class extends y{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noClaude)return e.services.log(" MCP: skipped (--no-claude \u2014 .mcp.json is the Claude Code surface)"),{configured:!1,mcpPath:"",serverName:""};if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s=e.options.memoryBackend==="memory",o={command:"aqe-mcp",args:[],env:s?{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"}},r=ht(t,".mcp.json"),i={};if(gt(r))try{let d=ft(r,"utf-8");i=_(d)}catch{i={}}i.mcpServers||(i.mcpServers={});let c=i.mcpServers;return c["agentic-qe"]=o,N(r,JSON.stringify(i,null,2)),e.services.log(` MCP config: ${r}`),e.services.log(" Server: agentic-qe"),s?(e.services.log(" Memory backend: in-memory (database-free)"),e.services.log(" Learning: disabled (db-free)"),e.services.log(" Workers: disabled (db-free)")):(e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled")),{configured:!0,mcpPath:r,serverName:"agentic-qe"}}};import{existsSync as R,readFileSync as vt,readdirSync as bt}from"fs";import{join as A}from"path";oe();import{spawnSync as yt}from"node:child_process";import*as pe from"node:os";import*as ze from"node:fs";var ge="vibium@^26.3.18",Ke={platform:()=>pe.platform(),arch:()=>pe.arch(),existsSync:l=>ze.existsSync(l)},We=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function be(l=Ke){if(l.platform()!=="linux"||l.arch()!=="arm64")return;let e=We.find(t=>l.existsSync(t));return e?{code:"linux-arm64-system-chromium-found",browserPath:e,message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. Found system browser at ${e}. Export VIBIUM_BROWSER_PATH=${e} before running vibium.`}:{code:"linux-arm64-no-system-chromium",message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system chromium was found on PATH (checked: ${We.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function ue(l,e,t,s){return l(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var we=(l,e,t)=>yt(l,e,t);function kt(l=we,e=5e3){let t=ue(l,"vibium",["--version"],e);if(t.status!==0)return null;let s=(t.stdout||"").trim(),n=(t.stderr||"").trim(),o=s||n;if(!o)return"unknown";let r=o.match(/v?(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);return r?r[1]:o.split(/\s+/)[0]||"unknown"}function me(l=we,e=5e3){let t=kt(l,e);if(!t)return{status:"cli-missing"};let s=ue(l,"vibium",["is-installed"],e);return s.status===0?{status:"ready",version:t}:{status:"payload-missing",version:t,message:s.stderr?.trim()||s.stdout?.trim()||E(s.error)||"Vibium Chrome/chromedriver payload is missing or incomplete"}}function Je(l={}){let e=l.packageSpec||ge;if(l.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=l.spawner||we,s=l.platformProbe||Ke,n=be(s),o=me(t);if(o.status==="ready")return{status:"already-installed",version:o.version,packageSpec:e,platformHint:n};let r=l.npmBin||"npm",i=ue(t,r,["--version"],5e3);if(i.error||i.status!==0)return{status:"npm-unavailable",packageSpec:e,message:`npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${e}\`.`};let c=l.timeoutMs||18e4,d=ue(t,r,["install","-g",e],c);if(d.status!==0)return{status:"install-failed",packageSpec:e,message:d.stderr?.trim()||d.stdout?.trim()||E(d.error)||"unknown npm install failure"};let m=me(t);if(m.status!=="ready"){let u=m.message?`: ${m.message}`:"";return{status:"install-failed",packageSpec:e,platformHint:n,message:`npm completed, but Vibium readiness verification failed (${m.status})${u}. Run \`npm install -g ${e}\`, then verify with \`vibium is-installed\`.`}}return{status:"installed",version:m.version,packageSpec:e,platformHint:n}}var Z=class extends y{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,c=0,d=0,m=0,u=0,p=0,h=0,g=0,w=0,P,L;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 k=await Ne({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=k.installed.length,k.errors.length>0&&e.services.warn(`Skills warnings: ${k.errors.join(", ")}`)}if(!n.noClaude){try{let k=await Fe({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();c=k.installed.length,k.errors.length>0&&e.services.warn(`Agents warnings: ${k.errors.join(", ")}`)}catch(f){e.services.warn(`Agents install error: ${f instanceof Error?f.message:f}`)}Se(s)}let b;if(n.minimal)b={status:"skipped",packageSpec:ge,message:"minimal mode"};else try{let f=me();if(f.status==="ready")b={status:"already-installed",version:f.version,packageSpec:ge,platformHint:be()},e.services.log(` Browser engine: vibium ${b.version} (already installed)`);else switch(e.services.log(" Browser engine: installing vibium via npm (this can take 1\u20133 minutes on first run; downloads Chrome for Testing lazily)\u2026"),b=Je({skip:!1}),b.status){case"installed":e.services.log(` Browser engine: vibium ${b.version} installed`);break;case"skipped":e.services.log(" Browser engine: skipped");break;case"install-failed":e.services.warn(`Browser engine install failed (qe-browser skill will be unavailable until you run \`npm install -g vibium\`): ${b.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `npm install -g vibium` to enable qe-browser");break}b?.platformHint&&e.services.warn(` Browser engine platform hint: ${b.platformHint.message}`)}catch(f){let k=f instanceof Error?f.message:String(f);e.services.warn(`Browser engine install error: ${k}
108
+ `}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 gt,readFileSync as ft}from"fs";ce();import{join as ht}from"path";var Z=class extends y{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noClaude)return e.services.log(" MCP: skipped (--no-claude \u2014 .mcp.json is the Claude Code surface)"),{configured:!1,mcpPath:"",serverName:""};if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s=e.options.memoryBackend==="memory",o={command:"aqe-mcp",args:[],env:s?{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"}},r=ht(t,".mcp.json"),i={};if(gt(r))try{let d=ft(r,"utf-8");i=_(d)}catch{i={}}i.mcpServers||(i.mcpServers={});let c=i.mcpServers;return c["agentic-qe"]=o,F(r,JSON.stringify(i,null,2)),e.services.log(` MCP config: ${r}`),e.services.log(" Server: agentic-qe"),s?(e.services.log(" Memory backend: in-memory (database-free)"),e.services.log(" Learning: disabled (db-free)"),e.services.log(" Workers: disabled (db-free)")):(e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled")),{configured:!0,mcpPath:r,serverName:"agentic-qe"}}};import{existsSync as R,readFileSync as kt,readdirSync as bt}from"fs";import{join as A}from"path";le();import{spawnSync as yt}from"node:child_process";import*as ge from"node:os";import*as ze from"node:fs";var O="vibium@^26.8.21",Ke={platform:()=>ge.platform(),arch:()=>ge.arch(),existsSync:l=>ze.existsSync(l)},We=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function be(l=Ke){if(l.platform()!=="linux"||l.arch()!=="arm64")return;let e=We.find(t=>l.existsSync(t));return e?{code:"linux-arm64-system-chromium-found",browserPath:e,message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. Found system browser at ${e}. Export VIBIUM_BROWSER_PATH=${e} before running vibium.`}:{code:"linux-arm64-no-system-chromium",message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system chromium was found on PATH (checked: ${We.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function ee(l,e,t,s){return l(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var we=(l,e,t)=>yt(l,e,t);function vt(l=we,e=5e3){let t=ee(l,"vibium",["--version"],e);if(t.status!==0)return null;let s=(t.stdout||"").trim(),n=(t.stderr||"").trim(),o=s||n;if(!o)return"unknown";let r=o.match(/v?(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);return r?r[1]:o.split(/\s+/)[0]||"unknown"}function te(l=we,e=5e3){let t=vt(l,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 ${O} for the browser.start() API`};let n=ee(l,"vibium",["is-installed"],e);return n.status===0?{status:"ready",version:t}:{status:"payload-missing",version:t,message:n.stderr?.trim()||n.stdout?.trim()||E(n.error)||"Vibium Chrome/chromedriver payload is missing or incomplete"}}function Je(l={}){let e=l.packageSpec||O;if(l.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=l.spawner||we,s=l.platformProbe||Ke,n=be(s),o=te(t);if(o.status==="ready")return{status:"already-installed",version:o.version,packageSpec:e,platformHint:n};let r=l.npmBin||"npm",i=ee(t,r,["--version"],5e3);if(i.error||i.status!==0)return{status:"npm-unavailable",packageSpec:e,message:`npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${e}\`.`};let c=l.timeoutMs||18e4,d=ee(t,r,["install","-g",e],c);if(d.status!==0)return{status:"install-failed",packageSpec:e,message:d.stderr?.trim()||d.stdout?.trim()||E(d.error)||"unknown npm install failure"};let m=te(t);if(m.status==="payload-missing"){let u=ee(t,"vibium",["install"],c);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\`.`};m=te(t)}if(m.status!=="ready"){let u=m.message?`: ${m.message}`:"";return{status:"install-failed",packageSpec:e,platformHint:n,message:`npm completed, but Vibium readiness verification failed (${m.status})${u}. Run \`npm install -g ${e}\`, then verify with \`vibium is-installed\`.`}}return{status:"installed",version:m.version,packageSpec:e,platformHint:n}}var ne=class extends y{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,c=0,d=0,m=0,u=0,p=0,h=0,g=0,w=0,P,L;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 v=await Le({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=v.installed.length,v.errors.length>0&&e.services.warn(`Skills warnings: ${v.errors.join(", ")}`)}if(!n.noClaude){try{let v=await Fe({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();c=v.installed.length,v.errors.length>0&&e.services.warn(`Agents warnings: ${v.errors.join(", ")}`)}catch(f){e.services.warn(`Agents install error: ${f instanceof Error?f.message:f}`)}Se(s)}let b;if(n.browserEngine===!0&&!n.minimal)try{let f=te();if(f.status==="ready")b={status:"already-installed",version:f.version,packageSpec:O,platformHint:be()},e.services.log(` Browser engine: vibium ${b.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"),b=Je({skip:!1}),b.status){case"installed":e.services.log(` Browser engine: vibium ${b.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\`): ${b.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}b?.platformHint&&e.services.warn(` Browser engine platform hint: ${b.platformHint.message}`)}catch(f){let v=f instanceof Error?f.message:String(f);e.services.warn(`Browser engine install error: ${v}
109
109
  qe-browser fleet skill will be unavailable until you run:
110
- npm install -g vibium
111
- Then re-run \`aqe init\` to verify. The rest of the AQE install will continue.`)}if(n.withN8n){let k=await Qe({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();d=k.agentsInstalled.length,m=k.skillsInstalled.length,k.errors.length>0&&e.services.warn(`N8n warnings: ${k.errors.join(", ")}`)}let fe=n.autoMode&&R(A(s,"opencode.json"));if(n.withOpenCode||fe){let{createOpenCodeInstaller:f}=await import("./opencode-installer-GIXOJ6NS.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,p=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${c}`),n.withN8n&&(e.services.log(` N8n agents: ${d}`),e.services.log(` N8n skills: ${m}`)),(n.withOpenCode||fe)&&(e.services.log(` OpenCode agents: ${u}`),e.services.log(` OpenCode skills: ${p}`));let re=n.autoMode&&R(A(s,".kiro"));if(n.withKiro||re){let{createKiroInstaller:f}=await import("./kiro-installer-NM723ZRG.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();h=a.agentsInstalled.length,g=a.skillsInstalled.length,w=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${h}`),e.services.log(` Kiro skills: ${g}`),e.services.log(` Kiro hooks: ${w}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let S=[];if(n.withCopilot||n.autoMode&&R(A(s,".vscode"))){let{createCopilotInstaller:f}=await import("./copilot-installer-BJN2YJGI.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".cursor"))){let{createCursorInstaller:f}=await import("./cursor-installer-ZXBWYAS3.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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-G7TJOAEX.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".kilocode"))){let{createKiloCodeInstaller:f}=await import("./kilocode-installer-F7LXBM7I.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".roo"))){let{createRooCodeInstaller:f}=await import("./roocode-installer-6JPPRB3W.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".codex"))){let{createCodexInstaller:f}=await import("./codex-installer-LBX77AI3.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();P={policy:a.guidancePolicy,ownedBytes:a.ownedGuidanceBytes},L={hooks:a.components.hooks,skills:a.components.skills},a.mcpConfigured&&S.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&&R(A(s,".windsurf"))){let{createWindsurfInstaller:f}=await import("./windsurf-installer-5GGZXGJW.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".continue"))){let{createContinueDevInstaller:f}=await import("./continuedev-installer-UAPWX6OA.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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 S.length>0&&e.services.log(` Platforms configured: ${S.join(", ")}`),{skillsInstalled:i,agentsInstalled:c,n8nAgents:d,n8nSkills:m,openCodeAgents:u,openCodeSkills:p,kiroAgents:h,kiroSkills:g,kiroHooks:w,platformsConfigured:S,browserEngine:b,codexGuidance:P,codexComponents:L}}detectVersionUpgrade(e){let t=e.config.version,s=A(e.projectRoot,".agentic-qe","config.yaml");if(R(s))try{let i=vt(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=A(e.projectRoot,".claude","agents","v3");try{return R(n)&&bt(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as wt,mkdirSync as Ct}from"fs";import{join as O,dirname as It}from"path";import{fileURLToPath as Pt}from"url";var Et=Pt(import.meta.url),os=It(Et),ee=class extends y{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=O(s,".agentic-qe","workers");wt(n)||Ct(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let h of t.workers.enabled)r[h]={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,lastRun:null,status:"pending"};let i=O(n,"registry.json"),c={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};F(i,c,[["createdAt"]]);for(let h of t.workers.enabled){let g=O(n,`${h}.json`),w={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,projectRoot:s,dataDir:O(s,".agentic-qe","data"),createdAt:new Date().toISOString()};F(g,w,[["createdAt"]])}let d=O(n,"start-daemon.cjs");N(d,`#!/usr/bin/env node
110
+ npm install -g ${O}
111
+ Then re-run \`aqe init --browser-engine\` to verify. The rest of the AQE install will continue.`)}else b={status:"skipped",packageSpec:O,message:n.minimal?"minimal mode":"browser setup not requested; run aqe init --browser-engine"};if(n.withN8n){let v=await Qe({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();d=v.agentsInstalled.length,m=v.skillsInstalled.length,v.errors.length>0&&e.services.warn(`N8n warnings: ${v.errors.join(", ")}`)}let fe=n.autoMode&&R(A(s,"opencode.json"));if(n.withOpenCode||fe){let{createOpenCodeInstaller:f}=await import("./opencode-installer-ABBO355U.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,p=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${c}`),n.withN8n&&(e.services.log(` N8n agents: ${d}`),e.services.log(` N8n skills: ${m}`)),(n.withOpenCode||fe)&&(e.services.log(` OpenCode agents: ${u}`),e.services.log(` OpenCode skills: ${p}`));let ae=n.autoMode&&R(A(s,".kiro"));if(n.withKiro||ae){let{createKiroInstaller:f}=await import("./kiro-installer-UZBIQ3IC.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();h=a.agentsInstalled.length,g=a.skillsInstalled.length,w=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${h}`),e.services.log(` Kiro skills: ${g}`),e.services.log(` Kiro hooks: ${w}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let S=[];if(n.withCopilot||n.autoMode&&R(A(s,".vscode"))){let{createCopilotInstaller:f}=await import("./copilot-installer-A5GRQQUU.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".cursor"))){let{createCursorInstaller:f}=await import("./cursor-installer-FVJ7ROPJ.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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-T7H6R2RC.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".kilocode"))){let{createKiloCodeInstaller:f}=await import("./kilocode-installer-HNNJOOPE.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".roo"))){let{createRooCodeInstaller:f}=await import("./roocode-installer-2QKGFIEU.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".codex"))){let{createCodexInstaller:f}=await import("./codex-installer-6PGT5FM6.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();P={policy:a.guidancePolicy,ownedBytes:a.ownedGuidanceBytes},L={hooks:a.components.hooks,skills:a.components.skills},a.mcpConfigured&&S.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&&R(A(s,".windsurf"))){let{createWindsurfInstaller:f}=await import("./windsurf-installer-VEX23WAF.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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&&R(A(s,".continue"))){let{createContinueDevInstaller:f}=await import("./continuedev-installer-4FSF7B3N.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&S.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 S.length>0&&e.services.log(` Platforms configured: ${S.join(", ")}`),{skillsInstalled:i,agentsInstalled:c,n8nAgents:d,n8nSkills:m,openCodeAgents:u,openCodeSkills:p,kiroAgents:h,kiroSkills:g,kiroHooks:w,platformsConfigured:S,browserEngine:b,codexGuidance:P,codexComponents:L}}detectVersionUpgrade(e){let t=e.config.version,s=A(e.projectRoot,".agentic-qe","config.yaml");if(R(s))try{let i=kt(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=A(e.projectRoot,".claude","agents","v3");try{return R(n)&&bt(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as wt,mkdirSync as Ct}from"fs";import{join as B,dirname as It}from"path";import{fileURLToPath as Pt}from"url";var Et=Pt(import.meta.url),os=It(Et),se=class extends y{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=B(s,".agentic-qe","workers");wt(n)||Ct(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let h of t.workers.enabled)r[h]={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,lastRun:null,status:"pending"};let i=B(n,"registry.json"),c={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};Q(i,c,[["createdAt"]]);for(let h of t.workers.enabled){let g=B(n,`${h}.json`),w={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,projectRoot:s,dataDir:B(s,".agentic-qe","data"),createdAt:new Date().toISOString()};Q(g,w,[["createdAt"]])}let d=B(n,"start-daemon.cjs");F(d,`#!/usr/bin/env node
112
112
  // AQE v3 Worker Daemon Startup Script (cross-platform)
113
113
  // Generated by aqe init
114
114
  // Starts the MCP server with background workers enabled
@@ -183,7 +183,7 @@ appendFileSync(logFile, '[' + ts + '] Daemon started with PID: ' + child.pid + '
183
183
  console.log('AQE v3 Worker Daemon started (PID: ' + child.pid + ')');
184
184
  console.log('Log file: ' + logFile);
185
185
  console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs'));
186
- `);let u=O(n,"stop-daemon.cjs");return N(u,`#!/usr/bin/env node
186
+ `);let u=B(n,"stop-daemon.cjs");return F(u,`#!/usr/bin/env node
187
187
  // AQE v3 Worker Daemon Stop Script (cross-platform)
188
188
  // Generated by aqe init
189
189
 
@@ -206,7 +206,7 @@ try {
206
206
  console.log('Daemon not running (stale PID file)');
207
207
  try { unlinkSync(pidFile); } catch {}
208
208
  }
209
- `),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 St,readFileSync as Rt,writeFileSync as Ce}from"fs";import{join as Ye}from"path";var te=class extends y{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=Ye(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(St(n)){let i=Rt(n,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:n,backupCreated:!1};let c=Ye(s,"CLAUDE.md.backup");Ce(c,i,"utf-8"),r=!0,Ce(n,i+`
209
+ `),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 St,readFileSync as Rt,writeFileSync as Ce}from"fs";import{join as Ye}from"path";var re=class extends y{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=Ye(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(St(n)){let i=Rt(n,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:n,backupCreated:!1};let c=Ye(s,"CLAUDE.md.backup");Ce(c,i,"utf-8"),r=!0,Ce(n,i+`
210
210
 
211
211
  `+o,"utf-8")}else Ce(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
212
212
 
@@ -370,7 +370,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
370
370
 
371
371
  ---
372
372
  *Generated by AQE v3 init - ${new Date().toISOString()}*
373
- `}};import{existsSync as x,readFileSync as At}from"fs";import{join as B,dirname as _t}from"path";import{mkdirSync as Xe}from"fs";he();var Dt=/^# \d{4}-\d{2}-\d{2}T[\d:.]+Z$/,ne=class extends y{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=e.options.memoryBackend==="memory",r=B(s,".agentic-qe","memory.db");n.push({name:o?"Database (in-memory mode)":"Database exists",passed:o||x(r)}),n.push({name:".agentic-qe directory",passed:x(B(s,".agentic-qe"))});let i=B(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:x(i)});let c=o?!0:await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:c});let d=["Database exists",".agentic-qe directory","Config saved"],m=n.filter(u=>d.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let p=d.includes(u.name),h=u.passed?"\u2713":p?"\u2717":"\u26A0",g=!p&&!u.passed?" (optional)":"";e.services.log(` ${h} ${u.name}${g}`)}return{verified:m,versionWritten:c,configSaved:x(i),checks:n}}async writeVersionToDb(e,t){let s=B(t,".agentic-qe","memory.db");try{let n=_t(s);x(n)||Xe(n,{recursive:!0});let o=D(s);try{o.exec(`
373
+ `}};import{existsSync as x,readFileSync as At}from"fs";import{join as N,dirname as _t}from"path";import{mkdirSync as Xe}from"fs";he();var Dt=/^# \d{4}-\d{2}-\d{2}T[\d:.]+Z$/,oe=class extends y{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=e.options.memoryBackend==="memory",r=N(s,".agentic-qe","memory.db");n.push({name:o?"Database (in-memory mode)":"Database exists",passed:o||x(r)}),n.push({name:".agentic-qe directory",passed:x(N(s,".agentic-qe"))});let i=N(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:x(i)});let c=o?!0:await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:c});let d=["Database exists",".agentic-qe directory","Config saved"],m=n.filter(u=>d.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let p=d.includes(u.name),h=u.passed?"\u2713":p?"\u2717":"\u26A0",g=!p&&!u.passed?" (optional)":"";e.services.log(` ${h} ${u.name}${g}`)}return{verified:m,versionWritten:c,configSaved:x(i),checks:n}}async writeVersionToDb(e,t){let s=N(t,".agentic-qe","memory.db");try{let n=_t(s);x(n)||Xe(n,{recursive:!0});let o=D(s);try{o.exec(`
374
374
  CREATE TABLE IF NOT EXISTS kv_store (
375
375
  key TEXT NOT NULL,
376
376
  namespace TEXT NOT NULL,
@@ -385,9 +385,9 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
385
385
  `).run("aqe_version",JSON.stringify(e),r),o.prepare(`
386
386
  INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
387
387
  VALUES (?, '_system', ?, ?)
388
- `).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=B(t,".agentic-qe");x(s)||Xe(s,{recursive:!0});let n=B(s,"config.yaml");if(x(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);_e(n,o,Dt)}loadExistingConfig(e){try{let t=At(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
388
+ `).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=N(t,".agentic-qe");x(s)||Xe(s,{recursive:!0});let n=N(s,"config.yaml");if(x(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);_e(n,o,Dt)}loadExistingConfig(e){try{let t=At(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
389
389
  `),n="",o="";for(let i of s){if(i.trim().startsWith("#")||i.trim()==="")continue;let c=i.match(/^(\w+):\s*(.*)$/);if(c){n=c[1],o="";let p=c[2].trim();p&&!p.startsWith('"')?t[n]=this.parseValue(p):p?t[n]=this.parseValue(p):t[n]={};continue}let d=i.match(/^ {2}(\w+):\s*(.*)$/);if(d&&n){o=d[1];let p=d[2].trim();t[n]||(t[n]={}),p?t[n][o]=this.parseValue(p):t[n][o]={};continue}let m=i.match(/^ {4}([\w-]+):\s*(.*)$/);if(m&&n&&o){let p=m[1],h=m[2].trim(),g=t[n];g[o]||(g[o]={}),typeof g[o]=="object"&&!Array.isArray(g[o])&&(g[o][p]=this.parseValue(h));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,c]of r){let d=t[i];d&&c in d&&!Array.isArray(d[c])&&(d[c]=[])}return t}catch{return null}}parseValue(e){return e==="true"?!0:e==="false"?!1:/^\d+$/.test(e)?parseInt(e,10):/^\d+\.\d+$/.test(e)?parseFloat(e):e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}mergeConfigs(e,t){if(t.domains?.enabled&&Array.isArray(t.domains.enabled)){let s=new Set(t.domains.enabled),n=new Set(e.domains.enabled);for(let r of n)s.add(r);let o=new Set(Array.isArray(t.domains?.disabled)?t.domains.disabled:[]);e.domains.enabled=Array.from(s).filter(r=>!o.has(r))}return t.domains?.disabled&&Array.isArray(t.domains.disabled)&&(e.domains.disabled=t.domains.disabled),t.learning?.enabled!==void 0&&(e.learning.enabled=t.learning.enabled),t.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(`
390
- `)}};oe();import{existsSync as T,mkdirSync as Ze,readdirSync as et,copyFileSync as tt}from"fs";import{join as I,dirname as $t}from"path";import{fileURLToPath as xt}from"url";var Tt=xt(import.meta.url),nt=$t(Tt);function jt(){let l=[I(nt,"../../assets/governance"),I(nt,"../assets/governance")],e=Le(import.meta.url);e&&(l.push(I(e,"assets/governance")),l.push(I(e,"dist/assets/governance"))),l.push(I(process.cwd(),"node_modules/agentic-qe/assets/governance")),l.push(I(process.cwd(),"assets/governance"));for(let t of l)if(T(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${l.join(", ")}`)}var Ie=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=jt()}async install(){let e=[],t=[],s=[],n=I(this.projectRoot,".claude","guidance"),o=I(n,"shards");try{Ze(n,{recursive:!0}),this.skipShards||Ze(o,{recursive:!0})}catch(m){return s.push(`Failed to create governance directory: ${E(m)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=I(this.assetsPath,"constitution.md"),c=I(n,"constitution.md");if(T(i))try{!T(c)||this.overwrite?(tt(i,c),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(m){s.push(`Failed to install constitution.md: ${E(m)}`)}else s.push("constitution.md not found in assets");let d=0;if(!this.skipShards){let m=I(this.assetsPath,"shards");if(T(m))try{let u=et(m).filter(p=>p.endsWith(".shard.md"));for(let p of u){let h=I(m,p),g=I(o,p);try{!T(g)||this.overwrite?(tt(h,g),e.push(`shards/${p}`),d++):t.push(`shards/${p}`)}catch(w){s.push(`Failed to install ${p}: ${E(w)}`)}}}catch(u){s.push(`Failed to read shards directory: ${E(u)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:d}}isInstalled(){let e=I(this.projectRoot,".claude","guidance","constitution.md");return T(e)}getInstalledShards(){let e=I(this.projectRoot,".claude","guidance","shards");if(!T(e))return[];try{return et(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function st(l){return new Ie(l)}var se=class extends y{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=st({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 qt=new Q,Mt=new V,Ot=new H,Bt=new W,Lt=new z,Nt=new K,Ft=new Y,Qt=new X,Vt=new Z,Ht=new ee,Gt=new te,Ut=new ne,Wt=new se;function rt(){return[qt,Mt,Ot,Bt,Lt,Nt,Ft,Qt,Vt,Wt,Ht,Gt,Ut]}var Pe=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??rt()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,minimal:e.minimal,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,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,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(`
390
+ `)}};le();import{existsSync as T,mkdirSync as Ze,readdirSync as et,copyFileSync as tt}from"fs";import{join as I,dirname as $t}from"path";import{fileURLToPath as xt}from"url";var Tt=xt(import.meta.url),nt=$t(Tt);function qt(){let l=[I(nt,"../../assets/governance"),I(nt,"../assets/governance")],e=Ne(import.meta.url);e&&(l.push(I(e,"assets/governance")),l.push(I(e,"dist/assets/governance"))),l.push(I(process.cwd(),"node_modules/agentic-qe/assets/governance")),l.push(I(process.cwd(),"assets/governance"));for(let t of l)if(T(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${l.join(", ")}`)}var Ie=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=qt()}async install(){let e=[],t=[],s=[],n=I(this.projectRoot,".claude","guidance"),o=I(n,"shards");try{Ze(n,{recursive:!0}),this.skipShards||Ze(o,{recursive:!0})}catch(m){return s.push(`Failed to create governance directory: ${E(m)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=I(this.assetsPath,"constitution.md"),c=I(n,"constitution.md");if(T(i))try{!T(c)||this.overwrite?(tt(i,c),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(m){s.push(`Failed to install constitution.md: ${E(m)}`)}else s.push("constitution.md not found in assets");let d=0;if(!this.skipShards){let m=I(this.assetsPath,"shards");if(T(m))try{let u=et(m).filter(p=>p.endsWith(".shard.md"));for(let p of u){let h=I(m,p),g=I(o,p);try{!T(g)||this.overwrite?(tt(h,g),e.push(`shards/${p}`),d++):t.push(`shards/${p}`)}catch(w){s.push(`Failed to install ${p}: ${E(w)}`)}}}catch(u){s.push(`Failed to read shards directory: ${E(u)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:d}}isInstalled(){let e=I(this.projectRoot,".claude","guidance","constitution.md");return T(e)}getInstalledShards(){let e=I(this.projectRoot,".claude","guidance","shards");if(!T(e))return[];try{return et(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function st(l){return new Ie(l)}var ie=class extends y{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=st({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 jt=new V,Mt=new H,Ot=new G,Bt=new z,Nt=new K,Lt=new J,Ft=new X,Qt=new Z,Vt=new ne,Ht=new se,Gt=new re,Ut=new oe,Wt=new ie;function rt(){return[jt,Mt,Ot,Bt,Nt,Lt,Ft,Qt,Vt,Wt,Ht,Gt,Ut]}var Pe=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??rt()}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,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(`
391
391
  \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(`
392
392
  \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:E(s),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let s=this.context.config,n=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),c=this.context.results.get("mcp"),d=this.context.results.get("claude-md"),m=this.context.results.get("workers");return{success:!0,config:s||ye("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:this.context.results.has("analysis"),configGenerated:this.context.results.has("configuration"),codeIntelligenceIndexed:o?.data?.entries??0,patternsLoaded:n?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:c?.data?.configured??!1,claudeMdGenerated:d?.data?.generated??!1,workersStarted:m?.data?.workersConfigured??0,codexGuidance:r?.data?.codexGuidance,codexComponents:r?.data?.codexComponents},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ye("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 zt(l){return new Pe(l)}async function ir(l){return await zt({projectRoot:l,autoMode:!0}).initialize()}function ar(l){let e=[];e.push(""),e.push("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),e.push("\u2502 AQE v3 Initialization \u2502"),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let s of l.steps){let n=s.status==="success"?"\u2713":s.status==="error"?"\u2717":"\u25CB",o=s.step.substring(0,48).padEnd(48);e.push(`\u2502 ${n} ${o} ${String(s.durationMs).padStart(4)}ms \u2502`)}e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),e.push(`\u2502 Project: ${l.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${l.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(l.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(l.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(l.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(l.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(l.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${l.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${l.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${l.summary.claudeMdGenerated?"Yes":"No".padEnd(44)} \u2502`),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let t=l.success?"\u2713 AQE v3 initialized successfully":"\u2717 Initialization failed";return e.push(`\u2502 ${t.padEnd(57)} \u2502`),e.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),e.push(""),e.join(`
393
393
  `)}export{Pe as ModularInitOrchestrator,zt as createModularInitOrchestrator,ar as formatInitResultModular,ir 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.14.7");process.exit(0)}
2
+ import{a}from"./chunk-AJUBT4NP.js";import"./chunk-UFSVUBTR.js";import"./chunk-FW4DJ4FJ.js";import"./chunk-YO4ESCB4.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.14.6");process.exit(0)}
2
- import{a,b}from"./chunk-5J6W7SIA.js";import"./chunk-64VGZQLB.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.14.7");process.exit(0)}
2
+ import{a,b}from"./chunk-QVH5Y7AP.js";import"./chunk-YO4ESCB4.js";export{a as recordPatternUsage,b as recordPatternUsageBatch};
@@ -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.14.6");process.exit(0)}
2
- import{a as v,c as w,d as l}from"./chunk-KNNISEDY.js";import"./chunk-64VGZQLB.js";import{Command as O}from"commander";import{resolve as C}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return l(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return l(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return l(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return l(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return l(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return l(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return l(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,u=this.validateSteps(t.steps);if(!u.success)return u;let c;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return l(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;c=g.value}let f=this.detectCircularDependencies(u.value);if(f)return l(new Error(`Circular dependency detected: ${f}`));let d={id:t.id,name:t.name,description:n,version:a,steps:u.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...c!==void 0&&{triggers:c}};return w(d)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return l(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return l(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return l(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return l(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return l(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!v.includes(e.domain))return l(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${v.join(", ")}`));if(!e.action||typeof e.action!="string")return l(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return l(i);let u=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(u!==void 0&&u instanceof Error)return l(u);let c;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(p=>typeof p=="string"))return l(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let p of e.dependsOn)if(!r.some(j=>j.id===p))return l(new Error(`Step '${e.id}' depends on unknown step: ${p}`));c=e.dependsOn}let f;if(e.condition!==void 0){let p=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!p.success)return p;f=p.value}let d;if(e.skipCondition!==void 0){let p=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!p.success)return p;d=p.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return l(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let p=this.validateRetry(e.retry,e.id);if(!p.success)return p;$=p.value}let b;if(e.rollback!==void 0){let p=this.validateRollback(e.rollback,e.id);if(!p.success)return p;b=p.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let p=this.validateApproval(e.approval,e.id);if(!p.success)return p;S=p.value}let A={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...u!==void 0&&{outputMapping:u},...c!==void 0&&{dependsOn:c},...f!==void 0&&{condition:f},...d!==void 0&&{skipCondition:d},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(A)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?l(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?l(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?l(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):l(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return l(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return l(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!v.includes(o.sourceDomain))return l(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let c=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!c.success)return c;i=c.value}let u=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(u!==void 0&&u instanceof Error)return l(u);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...u!==void 0&&{inputMapping:u}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?l(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?l(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!v.includes(n.domain)?l(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?l(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.expiresAfter!==void 0&&n.autoApproveAfter!==void 0)return l(new Error(`Step '${t}': set only one approval expiry field`));let o=n.expiresAfter??n.autoApproveAfter;if(o!==void 0){if(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>2147483647)return l(new Error(`Step '${t}': approval expiry must be an integer from 0 to 2147483647 milliseconds`));a.expiresAfter=o}if(n.message!==void 0){if(typeof n.message!="string")return l(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(u=>u.id===o);if(i?.dependsOn)for(let u of i.dependsOn){let c=a(u,[...e,o]);if(c)return c}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function y(m){return m.workflowOrchestrator}function U(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=y(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let u=C(o),c=e.vars?h(e.vars):void 0;console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.7");process.exit(0)}
2
+ import{a as v,c as w,d as l}from"./chunk-Y6AKKQIQ.js";import"./chunk-YO4ESCB4.js";import{Command as O}from"commander";import{resolve as C}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return l(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return l(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return l(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return l(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return l(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return l(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return l(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,u=this.validateSteps(t.steps);if(!u.success)return u;let c;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return l(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;c=g.value}let f=this.detectCircularDependencies(u.value);if(f)return l(new Error(`Circular dependency detected: ${f}`));let d={id:t.id,name:t.name,description:n,version:a,steps:u.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...c!==void 0&&{triggers:c}};return w(d)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return l(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return l(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return l(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return l(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return l(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!v.includes(e.domain))return l(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${v.join(", ")}`));if(!e.action||typeof e.action!="string")return l(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return l(i);let u=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(u!==void 0&&u instanceof Error)return l(u);let c;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(p=>typeof p=="string"))return l(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let p of e.dependsOn)if(!r.some(j=>j.id===p))return l(new Error(`Step '${e.id}' depends on unknown step: ${p}`));c=e.dependsOn}let f;if(e.condition!==void 0){let p=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!p.success)return p;f=p.value}let d;if(e.skipCondition!==void 0){let p=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!p.success)return p;d=p.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return l(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let p=this.validateRetry(e.retry,e.id);if(!p.success)return p;$=p.value}let b;if(e.rollback!==void 0){let p=this.validateRollback(e.rollback,e.id);if(!p.success)return p;b=p.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let p=this.validateApproval(e.approval,e.id);if(!p.success)return p;S=p.value}let A={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...u!==void 0&&{outputMapping:u},...c!==void 0&&{dependsOn:c},...f!==void 0&&{condition:f},...d!==void 0&&{skipCondition:d},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(A)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?l(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?l(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?l(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):l(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return l(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return l(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!v.includes(o.sourceDomain))return l(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let c=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!c.success)return c;i=c.value}let u=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(u!==void 0&&u instanceof Error)return l(u);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...u!==void 0&&{inputMapping:u}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?l(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?l(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!v.includes(n.domain)?l(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?l(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.expiresAfter!==void 0&&n.autoApproveAfter!==void 0)return l(new Error(`Step '${t}': set only one approval expiry field`));let o=n.expiresAfter??n.autoApproveAfter;if(o!==void 0){if(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>2147483647)return l(new Error(`Step '${t}': approval expiry must be an integer from 0 to 2147483647 milliseconds`));a.expiresAfter=o}if(n.message!==void 0){if(typeof n.message!="string")return l(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(u=>u.id===o);if(i?.dependsOn)for(let u of i.dependsOn){let c=a(u,[...e,o]);if(c)return c}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function y(m){return m.workflowOrchestrator}function U(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=y(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let u=C(o),c=e.vars?h(e.vars):void 0;console.log(s.blue(`
3
3
  Loading pipeline from: ${o}
4
4
  `));let f=await n.loadFromFile(u,c);if(!f.success){console.error(s.red(` Parse error: ${f.error.message}`)),await r(1);return}let d=f.value,g=i.registerWorkflow(d);if(!g.success){console.error(s.red(` Registration error: ${g.error.message}`)),await r(1);return}console.log(s.green(" Pipeline loaded successfully.")),console.log(` ID: ${s.cyan(d.id)}`),console.log(` Name: ${s.cyan(d.name)}`),console.log(` Steps: ${s.cyan(d.steps.length)}`),console.log(` Version: ${s.cyan(d.version)}`),d.tags?.length&&console.log(` Tags: ${s.cyan(d.tags.join(", "))}`),console.log(""),await r(0)}),a.command("validate <file>").description("Validate a YAML pipeline without registering it").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{let i=C(o),u=e.vars?h(e.vars):void 0;console.log(s.blue(`
5
5
  Validating pipeline: ${o}
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
- import{a as R}from"./chunk-BAMN2CHI.js";import{a as y}from"./chunk-GGRHV6D7.js";import{a as E,c as A}from"./chunk-MJS53PRX.js";import"./chunk-64VGZQLB.js";import{Command as O,Option as I}from"commander";import o from"chalk";import{existsSync as p,readFileSync as $}from"node:fs";import g from"node:path";A();var k=Object.keys(y),M={copilot:()=>import("./copilot-installer-BJN2YJGI.js"),cursor:()=>import("./cursor-installer-ZXBWYAS3.js"),cline:()=>import("./cline-installer-G7TJOAEX.js"),kilocode:()=>import("./kilocode-installer-F7LXBM7I.js"),roocode:()=>import("./roocode-installer-6JPPRB3W.js"),codex:()=>import("./codex-installer-LBX77AI3.js"),windsurf:()=>import("./windsurf-installer-5GGZXGJW.js"),continuedev:()=>import("./continuedev-installer-UAPWX6OA.js")};function j(n){return k.includes(n)}function V(n,e){let t=g.join(n,e.configPath),s=g.join(n,e.rulesPath);return{configExists:p(t),rulesExists:p(s)}}function G(n,e){try{let t=$(n,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:E(t)}}}function D(n,e){try{return $(n,"utf-8").includes("agentic-qe")}catch{return!1}}function T(n){let e="<!-- BEGIN AGENTIC-QE CODEX -->",t="<!-- END AGENTIC-QE CODEX -->",s=n.match(/<!-- BEGIN AGENTIC-QE CODEX -->[\s\S]*?<!-- END AGENTIC-QE CODEX -->/g)||[];return s.length===0?n.includes(e)||n.includes(t)?"malformed":"none":s[0].includes("Discover AQE tools and skills from their live schemas")?"compact":"full"}function q(n,e,t={}){let s=y[e],r=[],i=(l,m,h)=>{r.push({label:l,passed:m,detail:h})},d=t.expectMcp!==!1,u=g.join(n,s.configPath),c=p(u);if(d?i("Config file",c,c?s.configPath:`missing: ${s.configPath}`):i("MCP configuration",!0,c?`${s.configPath} preserved`:"intentionally disabled"),c&&d){let l=G(u,s.configFormat);i("Config syntax",l.valid,l.valid?`valid ${s.configFormat.toUpperCase()}`:l.error||"invalid configuration"),i("AQE MCP entry",D(u,s),"agentic-qe server entry")}let P=g.join(n,s.rulesPath),a=p(P);if(e==="codex"){let l=t.guidancePolicy??"full",m=a?T($(P,"utf-8")):"none";i("Behavioral rules",l==="none"||a,l==="none"?"intentionally disabled":a?s.rulesPath:`missing: ${s.rulesPath}`),i("Codex guidance",m===l,`selected=${l}, detected=${m}`)}else i("Behavioral rules",a,a?s.rulesPath:`missing: ${s.rulesPath}`);if(e==="codex"){let l=g.join(n,".codex","hooks.json"),m=[],h=!1;if(p(l))try{let f=JSON.parse($(l,"utf-8"));h=!!(f.hooks&&typeof f.hooks=="object"),m=JSON.stringify(f).match(/\.codex\/hooks\/[a-z0-9-]+\.cjs/gi)||[]}catch{h=!1}i("Lifecycle hooks",h,h?".codex/hooks.json is valid":"missing or invalid .codex/hooks.json");let x=[...new Set(m.map(f=>f.split("/").pop()))],S=x.length>0&&x.every(f=>p(g.join(n,".codex","hooks",f)));i("Hook adapters",S,x.length>0?`${x.length} referenced adapter(s)`:"no Codex hook adapters referenced");let w=["aqe-runtime.cjs",...x.includes("ruflo-codex-hook.cjs")?["ruflo-runtime.cjs"]:[]],C=w.filter(f=>!p(g.join(n,".codex","hooks",f)));i("Hook runtimes",C.length===0,C.length===0?`${w.length} runtime(s) present`:`missing: ${C.join(", ")}`);let N=g.join(n,".agents","skills"),v=R({includeRuflo:t.expectRuflo===!0}),b=v.filter(f=>!p(g.join(N,f.name,"SKILL.md"))).map(f=>f.name);i("QE skills",b.length===0,b.length===0?`${v.length} required AQE skill(s) present`:`missing: ${b.join(", ")}`)}return{platform:e,passed:r.every(l=>l.passed),checks:r}}function F(){let n=new O("platform").description("Manage coding agent platform configurations");return n.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,s=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(s)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+s+r)}`));for(let i of k){let d=y[i],{configExists:u,rulesExists:c}=V(e,d),l=u&&c?o.green("configured"):u||c?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(d.name.padEnd(t))}${o.gray(d.configPath.padEnd(s))}${l}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),n.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").option("--with-ruflo","Add optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let i=await M[e](),u=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${L(e)}Installer`],c;for(let l of u)if(typeof i[l]=="function"){c=i[l];break}if(!c){for(let l of Object.keys(i))if(l.startsWith("create")&&l.endsWith("Installer")&&typeof i[l]=="function"){c=i[l];break}}c||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let a=await c({projectRoot:s,overwrite:t.overwrite,...e==="codex"?{includeRuflo:t.withRuflo,guidancePolicy:t.codexGuidance}:{}}).install();if(a.success)console.log(o.green(` ${r.name} configured successfully`)),a.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),(a.rulesInstalled||a.agentsMdInstalled)&&console.log(o.gray(` Rules: ${r.rulesPath}`)),e==="codex"&&(a.hooksConfigured&&console.log(o.gray(" Hooks: .codex/hooks.json")),console.log(o.gray(` QE skills: ${a.skillsInstalled??0} installed`)),console.log(t.withRuflo?o.green(" Ruflo integration: enabled"):o.gray(" Ruflo integration: not installed (opt in with --with-ruflo)")));else{if(console.log(o.red(` ${r.name} setup failed`)),a.errors)for(let l of a.errors)console.log(o.red(` ${l}`));process.exit(1)}}catch(i){console.log(o.red(` Failed to set up ${r.name}: ${E(i)}`)),process.exit(1)}console.log("")}),n.command("verify <name>").description("Verify a platform configuration is correct").option("--no-mcp","Verify a deliberately MCP-free platform installation").option("--with-ruflo","Require optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Expected Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Verifying ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let i=q(s,e,{expectMcp:t.mcp!==!1,expectRuflo:t.withRuflo,guidancePolicy:t.codexGuidance});for(let d of i.checks){let u=` [${d.passed?"pass":"fail"}] ${d.label}: ${d.detail}`;console.log(d.passed?o.green(u):o.red(u))}console.log(""),i.passed?console.log(o.green(` ${r.name} configuration is valid`)):(console.log(o.yellow(` ${r.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`)),process.exitCode=1),console.log("")}),n}function L(n){return n.charAt(0).toUpperCase()+n.slice(1)}var H=F;export{F as createPlatformCommand,H as default,q as verifyPlatformConfiguration};
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.14.7");process.exit(0)}
2
+ import{a as R}from"./chunk-KUHLTVWC.js";import{a as y}from"./chunk-OEPNNLR4.js";import{a as E,e as A}from"./chunk-ZUOVNFXK.js";import"./chunk-YO4ESCB4.js";import{Command as O,Option as I}from"commander";import o from"chalk";import{existsSync as p,readFileSync as $}from"node:fs";import g from"node:path";A();var k=Object.keys(y),M={copilot:()=>import("./copilot-installer-A5GRQQUU.js"),cursor:()=>import("./cursor-installer-FVJ7ROPJ.js"),cline:()=>import("./cline-installer-T7H6R2RC.js"),kilocode:()=>import("./kilocode-installer-HNNJOOPE.js"),roocode:()=>import("./roocode-installer-2QKGFIEU.js"),codex:()=>import("./codex-installer-6PGT5FM6.js"),windsurf:()=>import("./windsurf-installer-VEX23WAF.js"),continuedev:()=>import("./continuedev-installer-4FSF7B3N.js")};function j(n){return k.includes(n)}function V(n,e){let t=g.join(n,e.configPath),s=g.join(n,e.rulesPath);return{configExists:p(t),rulesExists:p(s)}}function G(n,e){try{let t=$(n,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:E(t)}}}function D(n,e){try{return $(n,"utf-8").includes("agentic-qe")}catch{return!1}}function T(n){let e="<!-- BEGIN AGENTIC-QE CODEX -->",t="<!-- END AGENTIC-QE CODEX -->",s=n.match(/<!-- BEGIN AGENTIC-QE CODEX -->[\s\S]*?<!-- END AGENTIC-QE CODEX -->/g)||[];return s.length===0?n.includes(e)||n.includes(t)?"malformed":"none":s[0].includes("Discover AQE tools and skills from their live schemas")?"compact":"full"}function q(n,e,t={}){let s=y[e],r=[],i=(l,m,h)=>{r.push({label:l,passed:m,detail:h})},d=t.expectMcp!==!1,u=g.join(n,s.configPath),c=p(u);if(d?i("Config file",c,c?s.configPath:`missing: ${s.configPath}`):i("MCP configuration",!0,c?`${s.configPath} preserved`:"intentionally disabled"),c&&d){let l=G(u,s.configFormat);i("Config syntax",l.valid,l.valid?`valid ${s.configFormat.toUpperCase()}`:l.error||"invalid configuration"),i("AQE MCP entry",D(u,s),"agentic-qe server entry")}let P=g.join(n,s.rulesPath),a=p(P);if(e==="codex"){let l=t.guidancePolicy??"full",m=a?T($(P,"utf-8")):"none";i("Behavioral rules",l==="none"||a,l==="none"?"intentionally disabled":a?s.rulesPath:`missing: ${s.rulesPath}`),i("Codex guidance",m===l,`selected=${l}, detected=${m}`)}else i("Behavioral rules",a,a?s.rulesPath:`missing: ${s.rulesPath}`);if(e==="codex"){let l=g.join(n,".codex","hooks.json"),m=[],h=!1;if(p(l))try{let f=JSON.parse($(l,"utf-8"));h=!!(f.hooks&&typeof f.hooks=="object"),m=JSON.stringify(f).match(/\.codex\/hooks\/[a-z0-9-]+\.cjs/gi)||[]}catch{h=!1}i("Lifecycle hooks",h,h?".codex/hooks.json is valid":"missing or invalid .codex/hooks.json");let x=[...new Set(m.map(f=>f.split("/").pop()))],S=x.length>0&&x.every(f=>p(g.join(n,".codex","hooks",f)));i("Hook adapters",S,x.length>0?`${x.length} referenced adapter(s)`:"no Codex hook adapters referenced");let w=["aqe-runtime.cjs",...x.includes("ruflo-codex-hook.cjs")?["ruflo-runtime.cjs"]:[]],C=w.filter(f=>!p(g.join(n,".codex","hooks",f)));i("Hook runtimes",C.length===0,C.length===0?`${w.length} runtime(s) present`:`missing: ${C.join(", ")}`);let N=g.join(n,".agents","skills"),v=R({includeRuflo:t.expectRuflo===!0}),b=v.filter(f=>!p(g.join(N,f.name,"SKILL.md"))).map(f=>f.name);i("QE skills",b.length===0,b.length===0?`${v.length} required AQE skill(s) present`:`missing: ${b.join(", ")}`)}return{platform:e,passed:r.every(l=>l.passed),checks:r}}function F(){let n=new O("platform").description("Manage coding agent platform configurations");return n.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,s=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(s)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+s+r)}`));for(let i of k){let d=y[i],{configExists:u,rulesExists:c}=V(e,d),l=u&&c?o.green("configured"):u||c?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(d.name.padEnd(t))}${o.gray(d.configPath.padEnd(s))}${l}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),n.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").option("--with-ruflo","Add optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let i=await M[e](),u=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${L(e)}Installer`],c;for(let l of u)if(typeof i[l]=="function"){c=i[l];break}if(!c){for(let l of Object.keys(i))if(l.startsWith("create")&&l.endsWith("Installer")&&typeof i[l]=="function"){c=i[l];break}}c||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let a=await c({projectRoot:s,overwrite:t.overwrite,...e==="codex"?{includeRuflo:t.withRuflo,guidancePolicy:t.codexGuidance}:{}}).install();if(a.success)console.log(o.green(` ${r.name} configured successfully`)),a.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),(a.rulesInstalled||a.agentsMdInstalled)&&console.log(o.gray(` Rules: ${r.rulesPath}`)),e==="codex"&&(a.hooksConfigured&&console.log(o.gray(" Hooks: .codex/hooks.json")),console.log(o.gray(` QE skills: ${a.skillsInstalled??0} installed`)),console.log(t.withRuflo?o.green(" Ruflo integration: enabled"):o.gray(" Ruflo integration: not installed (opt in with --with-ruflo)")));else{if(console.log(o.red(` ${r.name} setup failed`)),a.errors)for(let l of a.errors)console.log(o.red(` ${l}`));process.exit(1)}}catch(i){console.log(o.red(` Failed to set up ${r.name}: ${E(i)}`)),process.exit(1)}console.log("")}),n.command("verify <name>").description("Verify a platform configuration is correct").option("--no-mcp","Verify a deliberately MCP-free platform installation").option("--with-ruflo","Require optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Expected Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Verifying ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let i=q(s,e,{expectMcp:t.mcp!==!1,expectRuflo:t.withRuflo,guidancePolicy:t.codexGuidance});for(let d of i.checks){let u=` [${d.passed?"pass":"fail"}] ${d.label}: ${d.detail}`;console.log(d.passed?o.green(u):o.red(u))}console.log(""),i.passed?console.log(o.green(` ${r.name} configuration is valid`)):(console.log(o.yellow(` ${r.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`)),process.exitCode=1),console.log("")}),n}function L(n){return n.charAt(0).toUpperCase()+n.slice(1)}var H=F;export{F as createPlatformCommand,H as default,q as verifyPlatformConfiguration};
@@ -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.14.6");process.exit(0)}
2
- import{a as p,b as d,c as h}from"./chunk-PX5YDCRH.js";import"./chunk-64VGZQLB.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.7");process.exit(0)}
2
+ import{a as p,b as d,c as h}from"./chunk-RKI3IQKQ.js";import"./chunk-YO4ESCB4.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
3
3
  Examples:
4
4
  aqe plugin install ./my-plugin Install from local directory
5
5
  aqe plugin install owner/repo --source github Install from GitHub
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
- import"./chunk-64VGZQLB.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.7");process.exit(0)}
2
+ import"./chunk-YO4ESCB4.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
@@ -1,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.14.6");process.exit(0)}
2
- import{a,b,c}from"./chunk-SDRHUMJB.js";import"./chunk-64VGZQLB.js";c();export{a as clearProjectRootCache,b as findProjectRoot};
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.14.7");process.exit(0)}
2
+ import{a,b,c}from"./chunk-IAENZ2DR.js";import"./chunk-YO4ESCB4.js";c();export{a as clearProjectRootCache,b as findProjectRoot};
@@ -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.14.7");process.exit(0)}
2
+ import{a,b}from"./chunk-X7ADKL7T.js";import"./chunk-ZWEKAEEV.js";import"./chunk-EGOIIUBD.js";import"./chunk-Y6AKKQIQ.js";import"./chunk-ZUOVNFXK.js";import"./chunk-FW4DJ4FJ.js";import"./chunk-YO4ESCB4.js";export{a as DefaultProtocolExecutor,b as createProtocolExecutor};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
- import"./chunk-L4RUBPLR.js";import{c as i}from"./chunk-AIRGNL55.js";import"./chunk-64VGZQLB.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.7");process.exit(0)}
2
+ import"./chunk-CQNMGK6Y.js";import{c as i}from"./chunk-OIDWDGLG.js";import"./chunk-YO4ESCB4.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
3
3
  Executing protocol: ${o}
4
4
  `));let t=await c.queen.executeProtocol(o,r);t.success?(console.log(n.green(" Protocol execution started")),console.log(n.cyan(` Execution ID: ${t.value}`))):console.log(n.red(` Failed to execute protocol: ${t.error.message}`)),console.log("")}catch(r){console.error(n.red(`
5
5
  Failed to execute protocol:`),r),await this.cleanupAndExit(1)}}getHelp(){return`