agentic-qe 3.9.2 → 3.9.3

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 (286) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cli/bundle.js +5 -5
  3. package/dist/cli/chunks/adapter-WKI55MLS.js +2 -0
  4. package/dist/cli/chunks/{agent-booster-wasm-AKAOHSCX.js → agent-booster-wasm-W6GGSB43.js} +2 -2
  5. package/dist/cli/chunks/{agent-handler-MTGPOUVP.js → agent-handler-3IRN5WBS.js} +2 -2
  6. package/dist/cli/chunks/{agent-memory-branch-UFPKWUFK.js → agent-memory-branch-SO63CIPJ.js} +2 -2
  7. package/dist/cli/chunks/aqe-learning-engine-QQHHH3ZL.js +2 -0
  8. package/dist/cli/chunks/{audit-VBEZHNHO.js → audit-TONGHW5H.js} +2 -2
  9. package/dist/cli/chunks/base-3ENVJTIL.js +2 -0
  10. package/dist/cli/chunks/{better-sqlite3-IRPHIXRU.js → better-sqlite3-OK5DP5FC.js} +2 -2
  11. package/dist/cli/chunks/{brain-handler-7EO3FFRZ.js → brain-handler-MC2S3UHL.js} +3 -3
  12. package/dist/cli/chunks/{branch-enumerator-MZRGP35N.js → branch-enumerator-PRKJKPAE.js} +2 -2
  13. package/dist/cli/chunks/{browser-VSIWQE7J.js → browser-WTMMBSU3.js} +2 -2
  14. package/dist/cli/chunks/browser-workflow-QVT343YP.js +2 -0
  15. package/dist/cli/chunks/{chunk-563PJBDM.js → chunk-2CPNZVGL.js} +2 -2
  16. package/dist/cli/chunks/{chunk-XFMKJ3UD.js → chunk-2GZ4EG3L.js} +1 -1
  17. package/dist/cli/chunks/{chunk-X6LCMOGC.js → chunk-2IU6WK32.js} +2 -2
  18. package/dist/cli/chunks/{chunk-PNL5G6TE.js → chunk-3GMN3PNP.js} +2 -2
  19. package/dist/cli/chunks/{chunk-56IWS2KY.js → chunk-3Q5FG6M3.js} +2 -2
  20. package/dist/cli/chunks/{chunk-WXWY2GAF.js → chunk-53YFAERL.js} +2 -2
  21. package/dist/cli/chunks/{chunk-LMMEUVE5.js → chunk-5B2KXDWF.js} +1 -1
  22. package/dist/cli/chunks/{chunk-TTOE336G.js → chunk-5OL6UOBM.js} +3 -3
  23. package/dist/cli/chunks/{chunk-XH53ARZD.js → chunk-5UMSMRJC.js} +2 -2
  24. package/dist/cli/chunks/{chunk-NRCKGXJJ.js → chunk-5YUNMBIH.js} +1 -1
  25. package/dist/cli/chunks/{chunk-QNBQBSAI.js → chunk-66RCUQCI.js} +2 -2
  26. package/dist/cli/chunks/{chunk-MY4LMIG7.js → chunk-6B4CTO5D.js} +2 -2
  27. package/dist/cli/chunks/{chunk-JOVINE23.js → chunk-6N26CWST.js} +2 -2
  28. package/dist/cli/chunks/{chunk-YXCU4CJX.js → chunk-7ASGPJWU.js} +1 -1
  29. package/dist/cli/chunks/{chunk-2Z2TFEOL.js → chunk-7HTSXZ77.js} +2 -2
  30. package/dist/cli/chunks/{chunk-QIH3E775.js → chunk-7JBIDAXT.js} +2 -2
  31. package/dist/cli/chunks/{chunk-4PKXIBX2.js → chunk-AS5WPUDR.js} +1 -1
  32. package/dist/cli/chunks/{chunk-GITD7SRQ.js → chunk-AWSYGQEB.js} +2 -2
  33. package/dist/cli/chunks/{chunk-AA33R5U4.js → chunk-BK445WWE.js} +2 -2
  34. package/dist/cli/chunks/{chunk-4LA7IW3V.js → chunk-BRCCPQXN.js} +1 -1
  35. package/dist/cli/chunks/{chunk-SRRFWTNF.js → chunk-CF4T4YSL.js} +2 -2
  36. package/dist/cli/chunks/{chunk-AKSJQ6B3.js → chunk-COIFERYS.js} +2 -2
  37. package/dist/cli/chunks/{chunk-N3F3CX4V.js → chunk-CU36MONI.js} +2 -2
  38. package/dist/cli/chunks/{chunk-65M7C6SH.js → chunk-D5AQDGTS.js} +1 -1
  39. package/dist/cli/chunks/{chunk-4D2ZG2QO.js → chunk-D5GIV6O7.js} +1 -1
  40. package/dist/cli/chunks/{chunk-XYJL6DKI.js → chunk-DBEU5ISS.js} +2 -2
  41. package/dist/cli/chunks/{chunk-DNLMZTE2.js → chunk-DBSVEWWL.js} +1 -1
  42. package/dist/cli/chunks/{chunk-5AUKULWO.js → chunk-DGRO6LSI.js} +2 -2
  43. package/dist/cli/chunks/{chunk-KTYUCZEM.js → chunk-DKOOKULB.js} +5 -5
  44. package/dist/cli/chunks/{chunk-V6XBAZNH.js → chunk-DTNXHRUF.js} +1 -1
  45. package/dist/cli/chunks/{chunk-UKDOMLBI.js → chunk-ELU576GE.js} +3 -3
  46. package/dist/cli/chunks/{chunk-NM6TIEJ3.js → chunk-ERWNQ6NC.js} +3 -3
  47. package/dist/cli/chunks/{chunk-E25S5E2D.js → chunk-EVIXQR4O.js} +1 -1
  48. package/dist/cli/chunks/{chunk-7SLN2JGP.js → chunk-EXTVDKH7.js} +3 -3
  49. package/dist/cli/chunks/{chunk-DSE57A5N.js → chunk-F6O5XLIE.js} +1 -1
  50. package/dist/cli/chunks/{chunk-7NOIIC7G.js → chunk-FIQ62VOQ.js} +1 -1
  51. package/dist/cli/chunks/chunk-FONTSK2O.js +2 -0
  52. package/dist/cli/chunks/{chunk-RITN3XR4.js → chunk-FR26EINS.js} +2 -2
  53. package/dist/cli/chunks/{chunk-Y6O7CDLI.js → chunk-FSUS5TV6.js} +2 -2
  54. package/dist/cli/chunks/{chunk-WG4GHAML.js → chunk-GBLX5XOH.js} +2 -2
  55. package/dist/cli/chunks/{chunk-KZUJBZ7B.js → chunk-GGEVILIS.js} +2 -2
  56. package/dist/cli/chunks/{chunk-L5YEPSDU.js → chunk-GGKV5IQR.js} +2 -2
  57. package/dist/cli/chunks/{chunk-BY47GV4T.js → chunk-GGQCAQM4.js} +2 -2
  58. package/dist/cli/chunks/{chunk-2VVV73PW.js → chunk-HJEWQD2B.js} +1 -1
  59. package/dist/cli/chunks/{chunk-VUAO4VFC.js → chunk-HVOOYPW6.js} +2 -2
  60. package/dist/cli/chunks/{chunk-Z54EO6E6.js → chunk-IOW7QTYT.js} +2 -2
  61. package/dist/cli/chunks/{chunk-CQP7ZFME.js → chunk-ITFNPXZL.js} +2 -2
  62. package/dist/cli/chunks/{chunk-25LFUL2K.js → chunk-J7QGH6PG.js} +2 -2
  63. package/dist/cli/chunks/{chunk-KQTJ2YLI.js → chunk-JF6AXXAL.js} +4 -4
  64. package/dist/cli/chunks/{chunk-J4BS6IWE.js → chunk-JI5MNJSU.js} +1 -1
  65. package/dist/cli/chunks/{chunk-4UH25U4O.js → chunk-JTIWAUWW.js} +1 -1
  66. package/dist/cli/chunks/{chunk-X35GP7TR.js → chunk-JXE2DFXM.js} +1 -1
  67. package/dist/cli/chunks/{chunk-L5WZUPZF.js → chunk-JZXSKPQB.js} +2 -2
  68. package/dist/cli/chunks/{chunk-2WBCYSUN.js → chunk-K2DDNM4V.js} +8 -8
  69. package/dist/cli/chunks/{chunk-TKF447CW.js → chunk-KV32LAKU.js} +1 -1
  70. package/dist/cli/chunks/{chunk-GCMVJS5X.js → chunk-LDLLHLKE.js} +2 -2
  71. package/dist/cli/chunks/{chunk-QODE4LM6.js → chunk-LHDR6E6F.js} +2 -2
  72. package/dist/cli/chunks/{chunk-DHE66JRR.js → chunk-LMN72H3V.js} +1 -1
  73. package/dist/cli/chunks/{chunk-GK72GUHA.js → chunk-LQDAH47F.js} +2 -2
  74. package/dist/cli/chunks/{chunk-FRJLP7IB.js → chunk-LRE4A464.js} +2 -2
  75. package/dist/cli/chunks/{chunk-HW4ISY5B.js → chunk-M3EFT3XR.js} +3 -3
  76. package/dist/cli/chunks/chunk-M7PGW5Z5.js +2 -0
  77. package/dist/cli/chunks/{chunk-3GZKAORV.js → chunk-MNZ2HHKI.js} +2 -2
  78. package/dist/cli/chunks/{chunk-KBA7FBK3.js → chunk-MSKVWOND.js} +3 -3
  79. package/dist/cli/chunks/{chunk-RC5CPXON.js → chunk-NZLJWXXM.js} +2 -2
  80. package/dist/cli/chunks/{chunk-RJROC5M3.js → chunk-O2O5RO4H.js} +2 -2
  81. package/dist/cli/chunks/{chunk-6SOJVEU7.js → chunk-OBOCKH47.js} +2 -2
  82. package/dist/cli/chunks/{chunk-DBE34QES.js → chunk-OJKGRB6D.js} +2 -2
  83. package/dist/cli/chunks/{chunk-4DAOZQ3V.js → chunk-OV6H3TRU.js} +2 -2
  84. package/dist/cli/chunks/{chunk-SDTVHR63.js → chunk-OXR2FPHK.js} +2 -2
  85. package/dist/cli/chunks/{chunk-T5GV6UIO.js → chunk-OZNJZMQL.js} +2 -2
  86. package/dist/cli/chunks/{chunk-Q4A72ZTV.js → chunk-P4RYVWIR.js} +2 -2
  87. package/dist/cli/chunks/{chunk-VL7YOOC2.js → chunk-P6OZKWNK.js} +2 -2
  88. package/dist/cli/chunks/{chunk-SGAW2WLI.js → chunk-PD5YPC2A.js} +4 -4
  89. package/dist/cli/chunks/{chunk-BKCTNRC5.js → chunk-PKIBG7OJ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-CQBSGYRA.js → chunk-PRIWFNVU.js} +2 -2
  91. package/dist/cli/chunks/{chunk-RQGYJK7H.js → chunk-PS6KLLLQ.js} +2 -2
  92. package/dist/cli/chunks/{chunk-NJY7ZA77.js → chunk-QAXJOCTW.js} +1 -1
  93. package/dist/cli/chunks/{chunk-PJFLO37I.js → chunk-QB2LOM5O.js} +2 -2
  94. package/dist/cli/chunks/{chunk-SNVM4YJS.js → chunk-RRELDHZY.js} +2 -2
  95. package/dist/cli/chunks/{chunk-VHVWAXCF.js → chunk-S23UV7FV.js} +1 -1
  96. package/dist/cli/chunks/{chunk-KZTO5EVM.js → chunk-SDHZLA45.js} +2 -2
  97. package/dist/cli/chunks/{chunk-5L6AU3QK.js → chunk-SFFI3MDN.js} +2 -2
  98. package/dist/cli/chunks/{chunk-BOH22AKC.js → chunk-SJLDTV5B.js} +2 -2
  99. package/dist/cli/chunks/{chunk-QEQTC4WQ.js → chunk-SVXIAQRW.js} +2 -2
  100. package/dist/cli/chunks/{chunk-CL3K5EJK.js → chunk-T4GTFSB2.js} +2 -2
  101. package/dist/cli/chunks/{chunk-Z5HXGVXZ.js → chunk-T4RR4YMH.js} +1 -1
  102. package/dist/cli/chunks/{chunk-STE42EMB.js → chunk-T5MWENBA.js} +2 -2
  103. package/dist/cli/chunks/{chunk-BIVIPF4O.js → chunk-TA454OEB.js} +1 -1
  104. package/dist/cli/chunks/{chunk-MN742FIH.js → chunk-TPFE3BAI.js} +2 -2
  105. package/dist/cli/chunks/{chunk-CCYMJKWX.js → chunk-TSS6LXJ6.js} +1 -1
  106. package/dist/cli/chunks/{chunk-5RL66XSH.js → chunk-TTEXJW2U.js} +2 -2
  107. package/dist/cli/chunks/{chunk-S3RDH5CI.js → chunk-TUHIFT65.js} +2 -2
  108. package/dist/cli/chunks/{chunk-QPRVX4H2.js → chunk-U6QQS5Z3.js} +2 -2
  109. package/dist/cli/chunks/{chunk-727BDQ3K.js → chunk-UC3RA5LW.js} +2 -2
  110. package/dist/cli/chunks/{chunk-4FT3PND7.js → chunk-UVWKIP3U.js} +3 -3
  111. package/dist/cli/chunks/{chunk-FAXVVLPL.js → chunk-VNSRA5PY.js} +2 -2
  112. package/dist/cli/chunks/{chunk-ICDXWIFZ.js → chunk-WAWCNUIJ.js} +1 -1
  113. package/dist/cli/chunks/{chunk-FUIHWBVF.js → chunk-WDTFG5AG.js} +1 -1
  114. package/dist/cli/chunks/{chunk-2EC5Z2J4.js → chunk-WIY3V5VQ.js} +9 -9
  115. package/dist/cli/chunks/{chunk-PFNFC43Q.js → chunk-WLK5UVRJ.js} +1 -1
  116. package/dist/cli/chunks/{chunk-34U7JDCN.js → chunk-WSVWVIVR.js} +2 -2
  117. package/dist/cli/chunks/{chunk-KDDZYXP4.js → chunk-X5C73DW5.js} +2 -2
  118. package/dist/cli/chunks/{chunk-SCF7NRVE.js → chunk-XJII5WMD.js} +1 -1
  119. package/dist/cli/chunks/{chunk-JV7LX6OT.js → chunk-YTBE2MEW.js} +4 -4
  120. package/dist/cli/chunks/{chunk-GPLERTZU.js → chunk-Z4V3XV7E.js} +2 -2
  121. package/dist/cli/chunks/{chunk-KNVAAVHH.js → chunk-ZMUVSL5Q.js} +2 -2
  122. package/dist/cli/chunks/{chunk-4Z27TRQF.js → chunk-ZQCU62JJ.js} +2 -2
  123. package/dist/cli/chunks/{chunk-4FMHBBG5.js → chunk-ZTIPMKUS.js} +1 -1
  124. package/dist/cli/chunks/{chunk-Z2IKNC5M.js → chunk-ZVMAE5JD.js} +1 -1
  125. package/dist/cli/chunks/{ci-2BCOBWFG.js → ci-XQEZTRJN.js} +2 -2
  126. package/dist/cli/chunks/{ci-output-FB4OJHAC.js → ci-output-ZWGXOIUD.js} +2 -2
  127. package/dist/cli/chunks/{claude-flow-setup-NEEFZTMB.js → claude-flow-setup-PFJFHZSD.js} +2 -2
  128. package/dist/cli/chunks/client-VUKA3X4R.js +2 -0
  129. package/dist/cli/chunks/{cline-installer-ODO2PS4K.js → cline-installer-L3WC4KUM.js} +2 -2
  130. package/dist/cli/chunks/{code-NSOF62VE.js → code-QMDXXY6C.js} +2 -2
  131. package/dist/cli/chunks/{code-index-extractor-YQL5XN52.js → code-index-extractor-YTPMAZPU.js} +2 -2
  132. package/dist/cli/chunks/{codex-installer-SPEY6VYT.js → codex-installer-KO5G7LHQ.js} +2 -2
  133. package/dist/cli/chunks/{completions-OWKBUMBE.js → completions-KVDPIXMY.js} +2 -2
  134. package/dist/cli/chunks/{complexity-analyzer-PGTXKP73.js → complexity-analyzer-KNIBPEC3.js} +2 -2
  135. package/dist/cli/chunks/{continuedev-installer-KGOXAC7L.js → continuedev-installer-N2GWI5PC.js} +2 -2
  136. package/dist/cli/chunks/{copilot-installer-BF3UA3TG.js → copilot-installer-EX3UTDQN.js} +2 -2
  137. package/dist/cli/chunks/{cost-tracker-2HDJ66E2.js → cost-tracker-XX6OMP37.js} +2 -2
  138. package/dist/cli/chunks/{coverage-KPA2PHIN.js → coverage-FHDDNCPO.js} +3 -3
  139. package/dist/cli/chunks/cross-domain-router-5SUV5AP6.js +2 -0
  140. package/dist/cli/chunks/{cursor-installer-7CDZFHTV.js → cursor-installer-M47YCQU7.js} +2 -2
  141. package/dist/cli/chunks/{daemon-4BPGCKDJ.js → daemon-EV3RXWAG.js} +3 -3
  142. package/dist/cli/chunks/{dag-attention-scheduler-2MAVGSBB.js → dag-attention-scheduler-J7JDWG5J.js} +2 -2
  143. package/dist/cli/chunks/{detect-WRPWTGP5.js → detect-4P5RKV5J.js} +2 -2
  144. package/dist/cli/chunks/{domain-handler-JZVSJ7AG.js → domain-handler-Q35TYDGA.js} +2 -2
  145. package/dist/cli/chunks/{domain-transfer-XGIZOR2X.js → domain-transfer-XC34MV5U.js} +2 -2
  146. package/dist/cli/chunks/dream-2UNEPNI2.js +2 -0
  147. package/dist/cli/chunks/esm-node-TPR2KU6L.js +2 -0
  148. package/dist/cli/chunks/{eval-T7YPAS4G.js → eval-QZGRW7XD.js} +2 -2
  149. package/dist/cli/chunks/{fast-paths-QECJTKCQ.js → fast-paths-O42GG56B.js} +2 -2
  150. package/dist/cli/chunks/{feature-flags-LIFURSFZ.js → feature-flags-G6SJTDVO.js} +2 -2
  151. package/dist/cli/chunks/{feature-flags-R4QZYTIW.js → feature-flags-GIGWUPEX.js} +2 -2
  152. package/dist/cli/chunks/{file-discovery-4W3K3W4C.js → file-discovery-D4NXB3JP.js} +2 -2
  153. package/dist/cli/chunks/{fleet-NLLQWCI5.js → fleet-ZXZ5AAPW.js} +3 -3
  154. package/dist/cli/chunks/{gnn-wrapper-XEII72LN.js → gnn-wrapper-YK6NAPJV.js} +2 -2
  155. package/dist/cli/chunks/{heartbeat-handler-DJ65RE5D.js → heartbeat-handler-DD4T6U36.js} +4 -4
  156. package/dist/cli/chunks/{heartbeat-scheduler-H664265Q.js → heartbeat-scheduler-CBPO5KUB.js} +2 -2
  157. package/dist/cli/chunks/hnsw-adapter-BLMGBVDE.js +2 -0
  158. package/dist/cli/chunks/hnsw-index-UWMXU7RN.js +2 -0
  159. package/dist/cli/chunks/{hnsw-legacy-bridge-SQIDTWAA.js → hnsw-legacy-bridge-REKPPJ75.js} +2 -2
  160. package/dist/cli/chunks/{hnswlib-node-WICYCU5U.js → hnswlib-node-PMWK24KT.js} +2 -2
  161. package/dist/cli/chunks/{hooks-GZUHUD63.js → hooks-UDKFTCJ7.js} +6 -6
  162. package/dist/cli/chunks/{hypergraph-engine-MLCDZ6BL.js → hypergraph-engine-FIAZJD7K.js} +2 -2
  163. package/dist/cli/chunks/{hypergraph-handler-NNDDI4R3.js → hypergraph-handler-NN2EBNBW.js} +3 -3
  164. package/dist/cli/chunks/impact-analyzer-RK2VPRRL.js +2 -0
  165. package/dist/cli/chunks/{init-handler-IJ6BHE6A.js → init-handler-RK256F2M.js} +6 -6
  166. package/dist/cli/chunks/init-wizard-HA2VADPV.js +2 -0
  167. package/dist/cli/chunks/kernel-QMZBPOWP.js +2 -0
  168. package/dist/cli/chunks/{kilocode-installer-EPZFFPFE.js → kilocode-installer-6XPW7IAO.js} +2 -2
  169. package/dist/cli/chunks/{kiro-installer-5VACG3HU.js → kiro-installer-DOHZGTBZ.js} +2 -2
  170. package/dist/cli/chunks/knowledge-graph-INYQCVMS.js +2 -0
  171. package/dist/cli/chunks/{learning-6FITK6XY.js → learning-GRSMZRPZ.js} +3 -3
  172. package/dist/cli/chunks/{llm-router-4DDC6AKJ.js → llm-router-MTZPLM7A.js} +2 -2
  173. package/dist/cli/chunks/{load-KGDNVUBX.js → load-CQXXMUR7.js} +2 -2
  174. package/dist/cli/chunks/load-test-YSEU2TUL.js +2 -0
  175. package/dist/cli/chunks/mcp-IIPV4IWF.js +2 -0
  176. package/dist/cli/chunks/{memory-II4I4QMO.js → memory-GIODHUAL.js} +5 -5
  177. package/dist/cli/chunks/memory-backend-MNSPY44E.js +2 -0
  178. package/dist/cli/chunks/{memory-handlers-TQXTOJGQ.js → memory-handlers-O6UVJSAG.js} +2 -2
  179. package/dist/cli/chunks/{opencode-installer-EU6JCWBW.js → opencode-installer-DDIIEIKL.js} +2 -2
  180. package/dist/cli/chunks/{orchestrator-YLMGJVSP.js → orchestrator-PAQTJDA3.js} +18 -19
  181. package/dist/cli/chunks/{pipeline-MPZJWYKK.js → pipeline-6HFLH75G.js} +2 -2
  182. package/dist/cli/chunks/{platform-YH35ZZFZ.js → platform-UKK776G2.js} +2 -2
  183. package/dist/cli/chunks/{plugin-B7JYZFNQ.js → plugin-ERW5YBXU.js} +2 -2
  184. package/dist/cli/chunks/{prime-radiant-advanced-wasm-KTUK6UE2.js → prime-radiant-advanced-wasm-WB5A4ULB.js} +2 -2
  185. package/dist/cli/chunks/protocol-executor-CBKER6RL.js +2 -0
  186. package/dist/cli/chunks/{protocol-handler-3NXMVU34.js → protocol-handler-AKDFZI6G.js} +2 -2
  187. package/dist/cli/chunks/{prove-H5LMGSUC.js → prove-GT5XEWVF.js} +2 -2
  188. package/dist/cli/chunks/qe-reasoning-bank-C3J4RA2M.js +2 -0
  189. package/dist/cli/chunks/{quality-RCWHY6GO.js → quality-VZAG6B54.js} +2 -2
  190. package/dist/cli/chunks/queen-coordinator-ZXTNAEYV.js +2 -0
  191. package/dist/cli/chunks/{real-embeddings-NKH4VURF.js → real-embeddings-KOOT5MTA.js} +2 -2
  192. package/dist/cli/chunks/{roocode-installer-SB7QJYM3.js → roocode-installer-KHGDU6QK.js} +2 -2
  193. package/dist/cli/chunks/router-YMQF6M2D.js +2 -0
  194. package/dist/cli/chunks/routing-feedback-MM7LNDS7.js +2 -0
  195. package/dist/cli/chunks/{routing-handler-SY7GKG2W.js → routing-handler-HVCNYSJM.js} +2 -2
  196. package/dist/cli/chunks/{ruvector-commands-HATTO3UQ.js → ruvector-commands-D46MOJ32.js} +2 -2
  197. package/dist/cli/chunks/{rvf-dual-writer-D57EXQUD.js → rvf-dual-writer-WASNBBMN.js} +2 -2
  198. package/dist/cli/chunks/{rvf-migration-adapter-OWDYN6KD.js → rvf-migration-adapter-ESLGEE5X.js} +2 -2
  199. package/dist/cli/chunks/{rvf-migration-coordinator-SIQVJB5S.js → rvf-migration-coordinator-S5NAMHTP.js} +2 -2
  200. package/dist/cli/chunks/rvf-native-adapter-3EEWPK4C.js +2 -0
  201. package/dist/cli/chunks/safe-db-5P6ABYNG.js +2 -0
  202. package/dist/cli/chunks/schedule-ZGESH3FK.js +2 -0
  203. package/dist/cli/chunks/scheduler-AC4AA2BD.js +2 -0
  204. package/dist/cli/chunks/{security-DS3XLZWN.js → security-4AHBDCJJ.js} +3 -3
  205. package/dist/cli/chunks/shared-rvf-adapter-UQQUEC52.js +2 -0
  206. package/dist/cli/chunks/{shared-rvf-dual-writer-YB7AH6XJ.js → shared-rvf-dual-writer-ZFNW4C3N.js} +2 -2
  207. package/dist/cli/chunks/sqlite-persistence-KXDW2Q66.js +2 -0
  208. package/dist/cli/chunks/{status-handler-TUYHE4FT.js → status-handler-ZVC4HX5J.js} +2 -2
  209. package/dist/cli/chunks/{structural-health-XNGBNRRD.js → structural-health-DPFQ4GEF.js} +2 -2
  210. package/dist/cli/chunks/{sync-K6CIRKBB.js → sync-7A5JMQNB.js} +2 -2
  211. package/dist/cli/chunks/{task-handler-7PJY67DR.js → task-handler-OFZ5YMXH.js} +2 -2
  212. package/dist/cli/chunks/{task-handlers-WB5CDWUR.js → task-handlers-IRSHSFQW.js} +2 -2
  213. package/dist/cli/chunks/{test-WV5ALEBB.js → test-F6XPB2DN.js} +4 -4
  214. package/dist/cli/chunks/{test-scheduling-N55ZGGA2.js → test-scheduling-CPHQ7DBP.js} +3 -3
  215. package/dist/cli/chunks/{token-bootstrap-SINWHAKR.js → token-bootstrap-5YD6K4LL.js} +2 -2
  216. package/dist/cli/chunks/{token-usage-R7TGEVGL.js → token-usage-KQYGQAEK.js} +2 -2
  217. package/dist/cli/chunks/{transformers-6DBLXPV7.js → transformers-P7TT2MJB.js} +2 -2
  218. package/dist/cli/chunks/{tree-sitter-wasm-parser-7C7FKMQW.js → tree-sitter-wasm-parser-SUSDXGOP.js} +2 -2
  219. package/dist/cli/chunks/{types-VNPMOKQT.js → types-OEGMO7AH.js} +2 -2
  220. package/dist/cli/chunks/unified-memory-MNW25PVU.js +2 -0
  221. package/dist/cli/chunks/unified-memory-hnsw-4RZRP37O.js +2 -0
  222. package/dist/cli/chunks/unified-persistence-6UBNXF25.js +2 -0
  223. package/dist/cli/chunks/{validate-53MNIRAF.js → validate-XI4GTLQR.js} +2 -2
  224. package/dist/cli/chunks/{validate-swarm-ZY4RGUFO.js → validate-swarm-UZQR6AWZ.js} +2 -2
  225. package/dist/cli/chunks/{vibium-PBADBIV6.js → vibium-VPJH2KD5.js} +2 -2
  226. package/dist/cli/chunks/visual-security-7742DBSK.js +2 -0
  227. package/dist/cli/chunks/{web-tree-sitter-O7VI6RLB.js → web-tree-sitter-LUNFY67E.js} +2 -2
  228. package/dist/cli/chunks/{windsurf-installer-HV3C3TAD.js → windsurf-installer-LTJCP7AT.js} +2 -2
  229. package/dist/cli/chunks/witness-chain-QVPNOHDC.js +2 -0
  230. package/dist/cli/chunks/{witness-chain-4WIMYP4X.js → witness-chain-YWBIN5MQ.js} +2 -2
  231. package/dist/cli/chunks/{workflow-5RVAQ4TM.js → workflow-UGXLNO36.js} +4 -4
  232. package/dist/cli/chunks/workflow-orchestrator-K3Q2GOEG.js +2 -0
  233. package/dist/cli/chunks/{wrappers-RRHCCA3E.js → wrappers-LUJRP2YI.js} +2 -2
  234. package/dist/cli/commands/mcp.js +27 -17
  235. package/dist/init/phases/06-code-intelligence.d.ts +33 -1
  236. package/dist/init/phases/06-code-intelligence.js +125 -10
  237. package/dist/init/phases/10-workers.d.ts +0 -14
  238. package/dist/init/phases/10-workers.js +19 -164
  239. package/dist/kernel/hnsw-adapter.d.ts +14 -0
  240. package/dist/kernel/hnsw-adapter.js +25 -1
  241. package/dist/kernel/hnsw-index-provider.d.ts +16 -0
  242. package/dist/kernel/native-hnsw-backend.d.ts +11 -0
  243. package/dist/kernel/native-hnsw-backend.js +20 -0
  244. package/dist/kernel/progressive-hnsw-backend.d.ts +9 -0
  245. package/dist/kernel/progressive-hnsw-backend.js +41 -12
  246. package/dist/kernel/unified-memory.js +10 -0
  247. package/dist/mcp/bundle.js +216 -216
  248. package/dist/optimization/token-optimizer-service.d.ts +31 -2
  249. package/dist/optimization/token-optimizer-service.js +85 -23
  250. package/package.json +1 -1
  251. package/dist/cli/chunks/adapter-53WBPKXU.js +0 -2
  252. package/dist/cli/chunks/aqe-learning-engine-MV7NGY24.js +0 -2
  253. package/dist/cli/chunks/base-DZVGMQN2.js +0 -2
  254. package/dist/cli/chunks/browser-workflow-3J5YNMEI.js +0 -2
  255. package/dist/cli/chunks/chunk-LCAA6H4J.js +0 -2
  256. package/dist/cli/chunks/chunk-XIBVVZGB.js +0 -2
  257. package/dist/cli/chunks/client-EF555KYW.js +0 -2
  258. package/dist/cli/chunks/cross-domain-router-GXFNK5TS.js +0 -2
  259. package/dist/cli/chunks/dream-3IKF5XH4.js +0 -2
  260. package/dist/cli/chunks/esm-node-DHAE52OW.js +0 -2
  261. package/dist/cli/chunks/hnsw-adapter-DML5KXQR.js +0 -2
  262. package/dist/cli/chunks/hnsw-index-BUPPGVR6.js +0 -2
  263. package/dist/cli/chunks/impact-analyzer-DPTMJRYS.js +0 -2
  264. package/dist/cli/chunks/init-wizard-35PUDJPW.js +0 -2
  265. package/dist/cli/chunks/kernel-2HZ44ZJ4.js +0 -2
  266. package/dist/cli/chunks/knowledge-graph-JL62G72U.js +0 -2
  267. package/dist/cli/chunks/load-test-LN245SSD.js +0 -2
  268. package/dist/cli/chunks/mcp-4LETGVIV.js +0 -2
  269. package/dist/cli/chunks/memory-backend-SVM7YRIE.js +0 -2
  270. package/dist/cli/chunks/protocol-executor-IEN2XB4L.js +0 -2
  271. package/dist/cli/chunks/qe-reasoning-bank-Q3ZV3JRG.js +0 -2
  272. package/dist/cli/chunks/queen-coordinator-E6ON3JUR.js +0 -2
  273. package/dist/cli/chunks/router-WMC3LZ3C.js +0 -2
  274. package/dist/cli/chunks/routing-feedback-VKCZRCE3.js +0 -2
  275. package/dist/cli/chunks/rvf-native-adapter-C7NBH5UN.js +0 -2
  276. package/dist/cli/chunks/safe-db-5KLXCNXN.js +0 -2
  277. package/dist/cli/chunks/schedule-HAWWOXWB.js +0 -2
  278. package/dist/cli/chunks/scheduler-HTRDY5BC.js +0 -2
  279. package/dist/cli/chunks/shared-rvf-adapter-6I2Z5UGL.js +0 -2
  280. package/dist/cli/chunks/sqlite-persistence-WNNRGTGG.js +0 -2
  281. package/dist/cli/chunks/unified-memory-72SKVZ7Y.js +0 -2
  282. package/dist/cli/chunks/unified-memory-hnsw-TMN2L77W.js +0 -2
  283. package/dist/cli/chunks/unified-persistence-MDN3SRCR.js +0 -2
  284. package/dist/cli/chunks/visual-security-TRBCXPIB.js +0 -2
  285. package/dist/cli/chunks/witness-chain-JOI2YYGK.js +0 -2
  286. package/dist/cli/chunks/workflow-orchestrator-2NQ72S3C.js +0 -2
@@ -1,25 +1,25 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{a as ke}from"./chunk-GPLERTZU.js";import{c as Re}from"./chunk-WXWY2GAF.js";import{a as te,b as de,c as ye,d as ve,e as we,f as be,g as Ce,h as Pe,i as Ie,j as Se,k as Ee}from"./chunk-MY4LMIG7.js";import"./chunk-PFNFC43Q.js";import"./chunk-CCYMJKWX.js";import"./chunk-NRCKGXJJ.js";import"./chunk-3GZKAORV.js";import"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import{b as _,d as ee}from"./chunk-N3F3CX4V.js";import{a as x,b as he,c as le}from"./chunk-SDTVHR63.js";import"./chunk-VUAO4VFC.js";import{a as $,b as ce}from"./chunk-XYJL6DKI.js";import"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import{a as ae}from"./chunk-YXCU4CJX.js";le();le();var g=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(n){return{success:!1,error:he(n),durationMs:Date.now()-t,message:`${this.description} failed: ${x(n)}`}}}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}};ee();ce();import{existsSync as M}from"fs";import{join as T}from"path";var Q=class extends g{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,n=await this.detectV2Installation(t),s=M(T(t,".agentic-qe","config.yaml")),o=n.version?.startsWith("3."),r=n.detected,i=s||o||!1,l=!r&&!i;return e.v2Detection=n,{v2Detected:r,v3Detected:i,freshInstall:l,v2Detection:n}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),n=T(e,".agentic-qe","config"),s=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=M(t),i=M(n),l=M(s),c=M(o),u=M(T(e,".agentic-qe","config.yaml")),m,d=!1;return r&&(m=this.readVersionFromDb(t),m?d=m.startsWith("3."):m="2.x.x"),{detected:!d&&r&&(!m?.startsWith("3.")||c&&!u),memoryDbPath:r?t:void 0,configPath:i?n:void 0,agentsPath:l?s:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:l,version:m}}readVersionFromDb(e){try{let t=$(e,{readonly:!0,fileMustExist:!0});try{if(!t.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as ve}from"./chunk-Z4V3XV7E.js";import{c as Re}from"./chunk-53YFAERL.js";import{a as Z,b as ce,c as he,d as ye,e as ke,f as we,g as be,h as Ce,i as Ie,j as Pe,k as Se}from"./chunk-6B4CTO5D.js";import"./chunk-WLK5UVRJ.js";import"./chunk-TSS6LXJ6.js";import"./chunk-5YUNMBIH.js";import"./chunk-MNZ2HHKI.js";import"./chunk-LQDAH47F.js";import"./chunk-RRELDHZY.js";import"./chunk-FONTSK2O.js";import"./chunk-6N26CWST.js";import{b as E,d as X}from"./chunk-CU36MONI.js";import{a as R,b as fe,c as ae}from"./chunk-OXR2FPHK.js";import"./chunk-HVOOYPW6.js";import{a as $,b as le}from"./chunk-DBEU5ISS.js";import"./chunk-GGKV5IQR.js";import"./chunk-ZMUVSL5Q.js";import"./chunk-WSVWVIVR.js";import"./chunk-TPFE3BAI.js";import"./chunk-OV6H3TRU.js";import"./chunk-M7PGW5Z5.js";import"./chunk-UC3RA5LW.js";import"./chunk-OJKGRB6D.js";import{a as ie}from"./chunk-7ASGPJWU.js";ae();ae();var f=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(n){return{success:!1,error:fe(n),durationMs:Date.now()-t,message:`${this.description} failed: ${R(n)}`}}}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}};X();le();import{existsSync as q}from"fs";import{join as T}from"path";var N=class extends f{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,n=await this.detectV2Installation(t),s=q(T(t,".agentic-qe","config.yaml")),o=n.version?.startsWith("3."),r=n.detected,i=s||o||!1,l=!r&&!i;return e.v2Detection=n,{v2Detected:r,v3Detected:i,freshInstall:l,v2Detection:n}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),n=T(e,".agentic-qe","config"),s=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=q(t),i=q(n),l=q(s),c=q(o),d=q(T(e,".agentic-qe","config.yaml")),g,u=!1;return r&&(g=this.readVersionFromDb(t),g?u=g.startsWith("3."):g="2.x.x"),{detected:!u&&r&&(!g?.startsWith("3.")||c&&!d),memoryDbPath:r?t:void 0,configPath:i?n:void 0,agentsPath:l?s:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:l,version:g}}readVersionFromDb(e){try{let t=$(e,{readonly:!0,fileMustExist:!0});try{if(!t.prepare(`
3
3
  SELECT name FROM sqlite_master
4
4
  WHERE type='table' AND name='kv_store'
5
5
  `).get()){t.close();return}let s=t.prepare(`
6
6
  SELECT value FROM kv_store
7
7
  WHERE key = 'aqe_version' AND namespace = '_system'
8
- `).get();return t.close(),s?_(s.value):void 0}catch{t.close();return}}catch{return}}};var L=class extends g{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let n=await ye(e.projectRoot).analyze();return e.analysis=n,e.services.log(` Project: ${n.projectName}`),e.services.log(` Languages: ${n.languages.map(s=>s.name).join(", ")}`),e.services.log(` Frameworks: ${n.frameworks.map(s=>s.name).join(", ")}`),n}};var V=class extends g{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 n=ve({minimal:e.options.minimal}).recommend(e.analysis);return n=this.applyOptions(n,e),e.config=n,e.services.log(` Version: ${n.version}`),e.services.log(` Learning: ${n.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${n.workers.enabled.length}`),n}applyOptions(e,t){let{options:n}=t;return n.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),n.skipPatterns&&(e.learning.pretrainedPatterns=!1),n.wizardAnswers&&(e=this.applyWizardAnswers(e,n.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 ne,mkdirSync as ue}from"fs";import{join as se}from"path";var W=class extends g{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async run(e){let{projectRoot:t}=e,n=se(t,".agentic-qe");ne(n)||ue(n,{recursive:!0});let s=se(n,"workers");ne(s)||ue(s,{recursive:!0});let o=se(n,"data");ne(o)||ue(o,{recursive:!0});let r=se(n,"memory.db"),i=!ne(r);try{let{initializeUnifiedMemory:l,resetUnifiedMemory:c}=await import("./unified-memory-72SKVZ7Y.js"),u=await l({dbPath:r,walMode:!0,busyTimeout:5e3}),d=u.getStats().tables.map(y=>y.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:te()},"_system");let k=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return c(),e.services.log(` Database: ${r}`),e.services.log(` Schema version: v${k}`),e.services.log(` Tables: ${d.length} (v3 full schema)`),{dbPath:r,created:i,tablesCreated:d,schemaVersion:k}}catch(l){throw new Error(`SQLite persistence initialization FAILED: ${l}
8
+ `).get();return t.close(),s?E(s.value):void 0}catch{t.close();return}}catch{return}}};var Q=class extends f{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let n=await he(e.projectRoot).analyze();return e.analysis=n,e.services.log(` Project: ${n.projectName}`),e.services.log(` Languages: ${n.languages.map(s=>s.name).join(", ")}`),e.services.log(` Frameworks: ${n.frameworks.map(s=>s.name).join(", ")}`),n}};var L=class extends f{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 n=ye({minimal:e.options.minimal}).recommend(e.analysis);return n=this.applyOptions(n,e),e.config=n,e.services.log(` Version: ${n.version}`),e.services.log(` Learning: ${n.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${n.workers.enabled.length}`),n}applyOptions(e,t){let{options:n}=t;return n.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),n.skipPatterns&&(e.learning.pretrainedPatterns=!1),n.wizardAnswers&&(e=this.applyWizardAnswers(e,n.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 ee,mkdirSync as de}from"fs";import{join as te}from"path";var V=class extends f{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async run(e){let{projectRoot:t}=e,n=te(t,".agentic-qe");ee(n)||de(n,{recursive:!0});let s=te(n,"workers");ee(s)||de(s,{recursive:!0});let o=te(n,"data");ee(o)||de(o,{recursive:!0});let r=te(n,"memory.db"),i=!ee(r);try{let{initializeUnifiedMemory:l,resetUnifiedMemory:c}=await import("./unified-memory-MNW25PVU.js"),d=await l({dbPath:r,walMode:!0,busyTimeout:5e3}),u=d.getStats().tables.map(x=>x.name);await d.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:Z()},"_system");let k=d.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return c(),e.services.log(` Database: ${r}`),e.services.log(` Schema version: v${k}`),e.services.log(` Tables: ${u.length} (v3 full schema)`),{dbPath:r,created:i,tablesCreated:u,schemaVersion:k}}catch(l){throw new Error(`SQLite persistence initialization FAILED: ${l}
9
9
  Database path: ${r}
10
- Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as re,mkdirSync as pe,writeFileSync as Ae}from"fs";import{join as q}from"path";var H=class extends g{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:n,options:s}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=q(n,".agentic-qe","data");re(o)||pe(o,{recursive:!0});let r=q(o,"hnsw");re(r)||pe(r,{recursive:!0});let i=q(o,"learning-config.json"),l={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:q(o,"memory.db"),hnswIndexPath:q(r,"index.bin"),initialized:new Date().toISOString()};Ae(i,JSON.stringify(l,null,2),"utf-8");let c=0;return t.learning.pretrainedPatterns&&!s.skipPatterns&&(c=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${c}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:c}}async loadPretrainedPatterns(e,t){try{let n=q(e,"patterns");re(n)||pe(n,{recursive:!0});let s=q(n,"index.json");return re(s)||Ae(s,JSON.stringify({version:te(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(n){return t.services.warn(`Could not load pre-trained patterns: ${n}`),0}}};ee();ce();import{existsSync as Ne,statSync as Qe}from"fs";import{join as oe}from"path";var xe=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.agentic-qe/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/__pycache__/**","**/.pytest_cache/**","**/target/**","**/vendor/**","**/.venv/**","**/venv/**","**/.tox/**","**/*.min.js","**/*.min.css","**/*.bundle.js","**/*.map","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/Pipfile.lock","**/poetry.lock","**/.env","**/.env.*"],G=class extends g{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async run(e){let{projectRoot:t}=e,n=oe(t,".agentic-qe","memory.db");if(!Ne(n))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let s=$(n);try{if(!this.checkCodeIntelligenceIndex(s))return s.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(s);if(!r){let c=this.getKGEntryCount(s);return s.close(),e.services.log(` Using existing index (${c} entries)`),{status:"existing",entries:c}}let i=this.getKGEntryCount(s);s.close();let l=await this.findChangedFiles(t,r);return l.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${l.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,l))}catch(o){try{s.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
10
+ Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as ne,mkdirSync as ue,writeFileSync as Ee}from"fs";import{join as D}from"path";var W=class extends f{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:n,options:s}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=D(n,".agentic-qe","data");ne(o)||ue(o,{recursive:!0});let r=D(o,"hnsw");ne(r)||ue(r,{recursive:!0});let i=D(o,"learning-config.json"),l={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:D(o,"memory.db"),hnswIndexPath:D(r,"index.bin"),initialized:new Date().toISOString()};Ee(i,JSON.stringify(l,null,2),"utf-8");let c=0;return t.learning.pretrainedPatterns&&!s.skipPatterns&&(c=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${c}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:c}}async loadPretrainedPatterns(e,t){try{let n=D(e,"patterns");ne(n)||ue(n,{recursive:!0});let s=D(n,"index.json");return ne(s)||Ee(s,JSON.stringify({version:Z(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(n){return t.services.warn(`Could not load pre-trained patterns: ${n}`),0}}};X();le();import{existsSync as Qe,statSync as Le}from"fs";import{join as se}from"path";var Ae=3e4,xe=18e4,Ve=100,_e=["**/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.*"],H=class extends f{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async run(e){let{projectRoot:t}=e,n=se(t,".agentic-qe","memory.db");if(!Qe(n))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let s=$(n);try{if(!this.checkCodeIntelligenceIndex(s))return s.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(s);if(!r){let c=this.getKGEntryCount(s);return s.close(),e.services.log(` Using existing index (${c} entries)`),{status:"existing",entries:c}}let i=this.getKGEntryCount(s);s.close();let l=await this.findChangedFiles(t,r);return l.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${l.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,l))}catch(o){try{s.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
11
11
  SELECT COUNT(*) as count FROM kv_store
12
12
  WHERE namespace = 'code-intelligence:kg'
13
13
  `).get().count>0}catch{return!1}}getKGEntryCount(e){try{return e.prepare(`
14
14
  SELECT COUNT(*) as count FROM kv_store
15
15
  WHERE namespace LIKE 'code-intelligence:kg%'
16
- `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,n,s){try{let{KnowledgeGraphService:o}=await import("./knowledge-graph-JL62G72U.js"),r=oe(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:l}=await ke(i,!0),c=new o(l,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),u;s?u=s:u=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:xe})).map(h=>oe(e,h));let m=await c.index({paths:u,incremental:n,includeTests:!0});if(c.destroy(),await l.dispose(),m.success){let d=m.value.nodesCreated+m.value.edgesCreated,w=n?"Delta indexed":"Indexed";return t.services.log(` ${w} ${d} entries to ${r}`),await this.buildHypergraph(r,u,t),{status:"indexed",entries:d}}return{status:"error",entries:0}}catch(o){return t.services.warn(`Code intelligence scan warning: ${o}`),{status:"skipped",entries:0}}}async buildHypergraph(e,t,n){try{let{extractCodeIndex:s}=await import("./code-index-extractor-YQL5XN52.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-MLCDZ6BL.js"),r=$(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),l=await s(t),c=await i.buildFromIndexResult(l);r.close(),c.nodesCreated+c.edgesCreated>0&&n.services.log(` Hypergraph: ${c.nodesCreated} nodes, ${c.edgesCreated} edges`)}catch(s){n.services.warn?.(` Hypergraph build skipped: ${s}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
16
+ `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,n,s){try{let{KnowledgeGraphService:o}=await import("./knowledge-graph-INYQCVMS.js"),r=se(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:l}=await ve(i,!0),c=new o(l,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),d;s?d=s:d=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:_e})).map(y=>se(e,y)),t.services.log(` Scanning ${d.length} source files...`);let g=await this.runBoundedScan(c,d,n,t);if(c.destroy(),await l.dispose(),g.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${xe/1e3}s phase cap. Indexed ${g.entries} entries before timeout. Last file: ${g.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.`),g;if(g.status==="indexed"){let u=n?"Delta indexed":"Indexed";t.services.log(` ${u} ${g.entries} entries to ${r}`),await this.buildHypergraph(r,d,t)}return g}catch(o){return t.services.warn(`Code intelligence scan warning: ${o}`),{status:"skipped",entries:0}}}async runBoundedScan(e,t,n,s){let o=0,r=0,i=0,l="",c=Date.now(),d=!1;n||await e.clear();for(let u of t){if(Date.now()-c>xe){d=!0;break}l=u;try{let m=await this.withTimeout(e.index({paths:[u],incremental:!0,includeTests:!0}),Ae,u);m.success&&(o+=m.value.nodesCreated,r+=m.value.edgesCreated)}catch(m){let y=m instanceof Error?m.message:String(m);y.startsWith("AQE_PER_FILE_TIMEOUT")?s.services.warn(` \u26A0 Skipped ${u} \u2014 indexing exceeded ${Ae/1e3}s`):s.services.warn(` \u26A0 Failed to index ${u}: ${y}`)}i++,(i%Ve===0||i===t.length)&&s.services.log(` Indexed ${i}/${t.length} files`)}let g=o+r;return d?{status:"timeout",entries:g,timeoutFile:l}:{status:"indexed",entries:g}}withTimeout(e,t,n){return new Promise((s,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${n}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),s(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,n){try{let{extractCodeIndex:s}=await import("./code-index-extractor-YTPMAZPU.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-FIAZJD7K.js"),r=$(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),l=await s(t),c=await i.buildFromIndexResult(l);r.close(),c.nodesCreated+c.edgesCreated>0&&n.services.log(` Hypergraph: ${c.nodesCreated} nodes, ${c.edgesCreated} edges`)}catch(s){n.services.warn?.(` Hypergraph build skipped: ${s}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
17
17
  SELECT value FROM kv_store
18
18
  WHERE namespace = 'code-intelligence:kg'
19
19
  AND key = 'metadata:index'
20
- `).get();if(!t)return null;let n=_(t.value);if(!n.indexedAt)return null;let s=new Date(n.indexedAt);return isNaN(s.getTime())?null:s}catch{return null}}async findChangedFiles(e,t){let s=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:xe}),o=t.getTime(),r=[];for(let i of s){let l=oe(e,i);try{Qe(l).mtimeMs>o&&r.push(l)}catch{}}return r}};ee();import{existsSync as P,mkdirSync as ie,readFileSync as _e,writeFileSync as O}from"fs";import{join as b}from"path";var B=class extends g{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.config?.hooks?.claudeCode??!0}async run(e){let t=e.config,{projectRoot:n}=e;if(!t.hooks.claudeCode)return{configured:!1,settingsPath:"",hookTypes:[],existingAqeDetected:!1};let s=b(n,".claude");P(s)||ie(s,{recursive:!0});let o=b(s,"hooks");P(o)||ie(o,{recursive:!0});let r=b(s,"settings.json"),i={};if(P(r))try{let k=_e(r,"utf-8");i=_(k)}catch{i={}}let l=this.generateHooksConfig(t,n),c=Object.keys(l),u=i.hooks||{},m=this.hasExistingAqeHooks(u);m&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=be(u,l);let d=i.env||{};i.env={...d,...Ce(t)};let w=Pe(t,n);for(let[k,y]of Object.entries(w))if(k==="_aqePermissions"){let A=i.permissions||{},C=A.allow||[],f=y,v=[...new Set([...C,...f])];i.permissions={...A,allow:v}}else i[k]=y;let h=i.enabledMcpjsonServers||[];h=h.filter(k=>k!=="aqe"),h.includes("agentic-qe")||h.push("agentic-qe"),i.enabledMcpjsonServers=h,O(r,JSON.stringify(i,null,2),"utf-8"),this.writeHooksReadme(o,c),this.installHookAssets(o,e);try{let k=_e(r,"utf-8"),A=_(k).hooks;(!A||!this.hasExistingAqeHooks(A))&&e.services.log(" WARNING: settings.json written but AQE hooks not detected \u2014 check settings-merge logic")}catch{e.services.log(" WARNING: Could not verify settings.json after write")}return e.services.log(` Settings: ${r}`),e.services.log(` Hooks dir: ${o}`),e.services.log(` Hook types: ${c.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:c,existingAqeDetected:m}}writeHooksReadme(e,t){let n=b(e,"README.txt");if(P(n))return;let s=["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(`
21
- `);O(n,s,"utf-8")}installHookAssets(e,t){let{projectRoot:n}=t;this.installBrainCheckpoint(n,t),this.installStatusline(n,t);let s=b(e,"cross-phase-memory.yaml");if(!P(s)){let r=[b(n,"v3","assets","hooks","cross-phase-memory.yaml"),b(n,"assets","hooks","cross-phase-memory.yaml"),b(n,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let l of r)if(P(l)){let{copyFileSync:c}=ae("fs");c(l,s),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||O(s,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
22
- `),"utf-8")}let o=b(e,"v3-domain-workers.json");P(o)||O(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 n of t)if(we(n))return!0}return!1}installBrainCheckpoint(e,t){let n=b(e,".claude","helpers");P(n)||ie(n,{recursive:!0});let s=b(n,"brain-checkpoint.cjs"),o=[b(e,".claude","helpers","brain-checkpoint.cjs"),b(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(P(r)&&r!==s){let{copyFileSync:i}=ae("fs");i(r,s),t.services.log(" Installed brain-checkpoint.cjs (copied)");return}P(s)||(O(s,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let n=b(e,".claude","helpers");P(n)||ie(n,{recursive:!0});let s=b(n,"statusline-v3.cjs"),o=[b(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),b(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(P(r)&&r!==s){let{copyFileSync:i}=ae("fs");i(r,s),t.services.log(" Installed statusline-v3.cjs (copied)");return}P(s)||(O(s,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}generateMinimalStatuslineScript(){return`#!/usr/bin/env node
20
+ `).get();if(!t)return null;let n=E(t.value);if(!n.indexedAt)return null;let s=new Date(n.indexedAt);return isNaN(s.getTime())?null:s}catch{return null}}async findChangedFiles(e,t){let s=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:_e}),o=t.getTime(),r=[];for(let i of s){let l=se(e,i);try{Le(l).mtimeMs>o&&r.push(l)}catch{}}return r}};X();import{existsSync as C,mkdirSync as re,readFileSync as $e,writeFileSync as M}from"fs";import{join as w}from"path";var G=class extends f{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.config?.hooks?.claudeCode??!0}async run(e){let t=e.config,{projectRoot:n}=e;if(!t.hooks.claudeCode)return{configured:!1,settingsPath:"",hookTypes:[],existingAqeDetected:!1};let s=w(n,".claude");C(s)||re(s,{recursive:!0});let o=w(s,"hooks");C(o)||re(o,{recursive:!0});let r=w(s,"settings.json"),i={};if(C(r))try{let k=$e(r,"utf-8");i=E(k)}catch{i={}}let l=this.generateHooksConfig(t,n),c=Object.keys(l),d=i.hooks||{},g=this.hasExistingAqeHooks(d);g&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=we(d,l);let u=i.env||{};i.env={...u,...be(t)};let m=Ce(t,n);for(let[k,x]of Object.entries(m))if(k==="_aqePermissions"){let _=i.permissions||{},b=_.allow||[],h=x,v=[...new Set([...b,...h])];i.permissions={..._,allow:v}}else i[k]=x;let y=i.enabledMcpjsonServers||[];y=y.filter(k=>k!=="aqe"),y.includes("agentic-qe")||y.push("agentic-qe"),i.enabledMcpjsonServers=y,M(r,JSON.stringify(i,null,2),"utf-8"),this.writeHooksReadme(o,c),this.installHookAssets(o,e);try{let k=$e(r,"utf-8"),_=E(k).hooks;(!_||!this.hasExistingAqeHooks(_))&&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: ${c.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:c,existingAqeDetected:g}}writeHooksReadme(e,t){let n=w(e,"README.txt");if(C(n))return;let s=["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(`
21
+ `);M(n,s,"utf-8")}installHookAssets(e,t){let{projectRoot:n}=t;this.installBrainCheckpoint(n,t),this.installStatusline(n,t);let s=w(e,"cross-phase-memory.yaml");if(!C(s)){let r=[w(n,"v3","assets","hooks","cross-phase-memory.yaml"),w(n,"assets","hooks","cross-phase-memory.yaml"),w(n,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let l of r)if(C(l)){let{copyFileSync:c}=ie("fs");c(l,s),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||M(s,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
22
+ `),"utf-8")}let o=w(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 n of t)if(ke(n))return!0}return!1}installBrainCheckpoint(e,t){let n=w(e,".claude","helpers");C(n)||re(n,{recursive:!0});let s=w(n,"brain-checkpoint.cjs"),o=[w(e,".claude","helpers","brain-checkpoint.cjs"),w(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(C(r)&&r!==s){let{copyFileSync:i}=ie("fs");i(r,s),t.services.log(" Installed brain-checkpoint.cjs (copied)");return}C(s)||(M(s,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let n=w(e,".claude","helpers");C(n)||re(n,{recursive:!0});let s=w(n,"statusline-v3.cjs"),o=[w(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),w(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(C(r)&&r!==s){let{copyFileSync:i}=ie("fs");i(r,s),t.services.log(" Installed statusline-v3.cjs (copied)");return}C(s)||(M(s,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}generateMinimalStatuslineScript(){return`#!/usr/bin/env node
23
23
  /**
24
24
  * Agentic QE v3 Statusline (minimal fallback, generated by aqe init)
25
25
  * For the full statusline, reinstall: npx agentic-qe init --auto
@@ -104,7 +104,7 @@ function verifyBrain() {
104
104
  const cmd = process.argv[2] || 'verify';
105
105
  const result = cmd === 'export' ? exportBrain() : verifyBrain();
106
106
  if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
107
- `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5e3,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',timeout:5e3,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'npx agentic-qe hooks route --task "$PROMPT" --json',timeout:5e3,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',timeout:1e4,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5e3,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:"npx agentic-qe hooks session-end --save-state --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:6e4,continueOnError:!0}]}]}}};ee();import{existsSync as Le,readFileSync as Ve,writeFileSync as We}from"fs";import{join as He}from"path";var U=class extends g{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let n={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},s=He(t,".mcp.json"),o={};if(Le(s))try{let i=Ve(s,"utf-8");o=_(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=n,We(s,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${s}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:s,serverName:"agentic-qe"}}};import{existsSync as E,readFileSync as Ge}from"fs";import{join as R}from"path";var z=class extends g{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:n,options:s}=e,o=this.detectVersionUpgrade(e),r=s.upgrade||t.skills.overwrite||s.autoMode&&o,i=0,l=0,c=0,u=0,m=0,d=0,w=0,h=0,k=0;if(s.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):s.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let v=await Ie({projectRoot:n,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(", ")}`)}try{let v=await Se({projectRoot:n,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();l=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}`)}if(Re(n),s.withN8n){let v=await Ee({projectRoot:n,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:s.n8nApiConfig}).install();c=v.agentsInstalled.length,u=v.skillsInstalled.length,v.errors.length>0&&e.services.warn(`N8n warnings: ${v.errors.join(", ")}`)}let y=s.autoMode&&E(R(n,"opencode.json"));if(s.withOpenCode||y){let{createOpenCodeInstaller:f}=await import("./opencode-installer-EU6JCWBW.js"),a=await f({projectRoot:n,installAgents:!0,installSkills:!0,installTools:!0,overwrite:r}).install();m=a.agentsInstalled.length,d=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${l}`),s.withN8n&&(e.services.log(` N8n agents: ${c}`),e.services.log(` N8n skills: ${u}`)),(s.withOpenCode||y)&&(e.services.log(` OpenCode agents: ${m}`),e.services.log(` OpenCode skills: ${d}`));let A=s.autoMode&&E(R(n,".kiro"));if(s.withKiro||A){let{createKiroInstaller:f}=await import("./kiro-installer-5VACG3HU.js"),a=await f({projectRoot:n,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();w=a.agentsInstalled.length,h=a.skillsInstalled.length,k=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${w}`),e.services.log(` Kiro skills: ${h}`),e.services.log(` Kiro hooks: ${k}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let C=[];if(s.withCopilot||s.autoMode&&E(R(n,".vscode"))){let{createCopilotInstaller:f}=await import("./copilot-installer-BF3UA3TG.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withCursor||s.autoMode&&E(R(n,".cursor"))){let{createCursorInstaller:f}=await import("./cursor-installer-7CDZFHTV.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withCline){let{createClineInstaller:f}=await import("./cline-installer-ODO2PS4K.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withKiloCode||s.autoMode&&E(R(n,".kilocode"))){let{createKiloCodeInstaller:f}=await import("./kilocode-installer-EPZFFPFE.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withRooCode||s.autoMode&&E(R(n,".roo"))){let{createRooCodeInstaller:f}=await import("./roocode-installer-SB7QJYM3.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withCodex||s.autoMode&&E(R(n,".codex"))){let{createCodexInstaller:f}=await import("./codex-installer-SPEY6VYT.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.push("codex"),a.errors.length>0&&e.services.warn(`Codex warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Codex MCP: ${a.configPath}`),a.agentsMdInstalled&&e.services.log(` Codex AGENTS.md: ${a.agentsMdPath}`)}if(s.withWindsurf||s.autoMode&&E(R(n,".windsurf"))){let{createWindsurfInstaller:f}=await import("./windsurf-installer-HV3C3TAD.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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(s.withContinueDev||s.autoMode&&E(R(n,".continue"))){let{createContinueDevInstaller:f}=await import("./continuedev-installer-KGOXAC7L.js"),a=await f({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&C.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 C.length>0&&e.services.log(` Platforms configured: ${C.join(", ")}`),{skillsInstalled:i,agentsInstalled:l,n8nAgents:c,n8nSkills:u,openCodeAgents:m,openCodeSkills:d,kiroAgents:w,kiroSkills:h,kiroHooks:k,platformsConfigured:C}}detectVersionUpgrade(e){let t=R(e.projectRoot,".agentic-qe","config.yaml");if(!E(t))return!1;try{let o=Ge(t,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1],r=e.config.version;return o!==void 0&&o!==r}catch{return!1}}};import{existsSync as K,mkdirSync as Be,writeFileSync as F,readFileSync as Ue}from"fs";import{join as S}from"path";import{spawn as ze}from"child_process";var Y=class extends g{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:n}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let s=S(n,".agentic-qe","workers");K(s)||Be(s,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let y of t.workers.enabled)r[y]={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,lastRun:null,status:"pending"};let i=S(s,"registry.json"),l={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};F(i,JSON.stringify(l,null,2),"utf-8");for(let y of t.workers.enabled){let A=S(s,`${y}.json`),C={name:y,enabled:!0,interval:t.workers.intervals[y]||o[y]||6e4,projectRoot:n,dataDir:S(n,".agentic-qe","data"),createdAt:new Date().toISOString()};F(A,JSON.stringify(C,null,2),"utf-8")}let c=S(s,"start-daemon.cjs");F(c,`#!/usr/bin/env node
107
+ `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5e3,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Task$",hooks:[{type:"command",command:'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',timeout:5e3,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'npx agentic-qe hooks route --task "$PROMPT" --json',timeout:5e3,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',timeout:1e4,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5e3,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:"npx agentic-qe hooks session-end --save-state --json",timeout:5e3,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:6e4,continueOnError:!0}]}]}}};X();import{existsSync as We,readFileSync as He,writeFileSync as Ge}from"fs";import{join as Ue}from"path";var U=class extends f{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let n={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},s=Ue(t,".mcp.json"),o={};if(We(s))try{let i=He(s,"utf-8");o=E(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=n,Ge(s,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${s}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:s,serverName:"agentic-qe"}}};import{existsSync as P,readFileSync as Be}from"fs";import{join as S}from"path";var B=class extends f{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:n,options:s}=e,o=this.detectVersionUpgrade(e),r=s.upgrade||t.skills.overwrite||s.autoMode&&o,i=0,l=0,c=0,d=0,g=0,u=0,m=0,y=0,k=0;if(s.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):s.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let v=await Ie({projectRoot:n,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(", ")}`)}try{let v=await Pe({projectRoot:n,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();l=v.installed.length,v.errors.length>0&&e.services.warn(`Agents warnings: ${v.errors.join(", ")}`)}catch(h){e.services.warn(`Agents install error: ${h instanceof Error?h.message:h}`)}if(Re(n),s.withN8n){let v=await Se({projectRoot:n,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:s.n8nApiConfig}).install();c=v.agentsInstalled.length,d=v.skillsInstalled.length,v.errors.length>0&&e.services.warn(`N8n warnings: ${v.errors.join(", ")}`)}let x=s.autoMode&&P(S(n,"opencode.json"));if(s.withOpenCode||x){let{createOpenCodeInstaller:h}=await import("./opencode-installer-DDIIEIKL.js"),a=await h({projectRoot:n,installAgents:!0,installSkills:!0,installTools:!0,overwrite:r}).install();g=a.agentsInstalled.length,u=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${l}`),s.withN8n&&(e.services.log(` N8n agents: ${c}`),e.services.log(` N8n skills: ${d}`)),(s.withOpenCode||x)&&(e.services.log(` OpenCode agents: ${g}`),e.services.log(` OpenCode skills: ${u}`));let _=s.autoMode&&P(S(n,".kiro"));if(s.withKiro||_){let{createKiroInstaller:h}=await import("./kiro-installer-DOHZGTBZ.js"),a=await h({projectRoot:n,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();m=a.agentsInstalled.length,y=a.skillsInstalled.length,k=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${m}`),e.services.log(` Kiro skills: ${y}`),e.services.log(` Kiro hooks: ${k}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let b=[];if(s.withCopilot||s.autoMode&&P(S(n,".vscode"))){let{createCopilotInstaller:h}=await import("./copilot-installer-EX3UTDQN.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withCursor||s.autoMode&&P(S(n,".cursor"))){let{createCursorInstaller:h}=await import("./cursor-installer-M47YCQU7.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withCline){let{createClineInstaller:h}=await import("./cline-installer-L3WC4KUM.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withKiloCode||s.autoMode&&P(S(n,".kilocode"))){let{createKiloCodeInstaller:h}=await import("./kilocode-installer-6XPW7IAO.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withRooCode||s.autoMode&&P(S(n,".roo"))){let{createRooCodeInstaller:h}=await import("./roocode-installer-KHGDU6QK.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withCodex||s.autoMode&&P(S(n,".codex"))){let{createCodexInstaller:h}=await import("./codex-installer-KO5G7LHQ.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.push("codex"),a.errors.length>0&&e.services.warn(`Codex warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Codex MCP: ${a.configPath}`),a.agentsMdInstalled&&e.services.log(` Codex AGENTS.md: ${a.agentsMdPath}`)}if(s.withWindsurf||s.autoMode&&P(S(n,".windsurf"))){let{createWindsurfInstaller:h}=await import("./windsurf-installer-LTJCP7AT.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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(s.withContinueDev||s.autoMode&&P(S(n,".continue"))){let{createContinueDevInstaller:h}=await import("./continuedev-installer-N2GWI5PC.js"),a=await h({projectRoot:n,overwrite:r}).install();a.mcpConfigured&&b.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 b.length>0&&e.services.log(` Platforms configured: ${b.join(", ")}`),{skillsInstalled:i,agentsInstalled:l,n8nAgents:c,n8nSkills:d,openCodeAgents:g,openCodeSkills:u,kiroAgents:m,kiroSkills:y,kiroHooks:k,platformsConfigured:b}}detectVersionUpgrade(e){let t=S(e.projectRoot,".agentic-qe","config.yaml");if(!P(t))return!1;try{let o=Be(t,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1],r=e.config.version;return o!==void 0&&o!==r}catch{return!1}}};import{existsSync as ze,mkdirSync as Ke,writeFileSync as oe}from"fs";import{join as O}from"path";var z=class extends f{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:n}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let s=O(n,".agentic-qe","workers");ze(s)||Ke(s,{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 m of t.workers.enabled)r[m]={name:m,enabled:!0,interval:t.workers.intervals[m]||o[m]||6e4,lastRun:null,status:"pending"};let i=O(s,"registry.json"),l={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};oe(i,JSON.stringify(l,null,2),"utf-8");for(let m of t.workers.enabled){let y=O(s,`${m}.json`),k={name:m,enabled:!0,interval:t.workers.intervals[m]||o[m]||6e4,projectRoot:n,dataDir:O(n,".agentic-qe","data"),createdAt:new Date().toISOString()};oe(y,JSON.stringify(k,null,2),"utf-8")}let c=O(s,"start-daemon.cjs");oe(c,`#!/usr/bin/env node
108
108
  // AQE v3 Worker Daemon Startup Script (cross-platform)
109
109
  // Generated by aqe init
110
110
  // Starts the MCP server with background workers enabled
@@ -160,7 +160,7 @@ appendFileSync(logFile, '[' + ts + '] Daemon started with PID: ' + child.pid + '
160
160
  console.log('AQE v3 Worker Daemon started (PID: ' + child.pid + ')');
161
161
  console.log('Log file: ' + logFile);
162
162
  console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs'));
163
- `);let m=S(s,"stop-daemon.cjs");F(m,`#!/usr/bin/env node
163
+ `);let g=O(s,"stop-daemon.cjs");return oe(g,`#!/usr/bin/env node
164
164
  // AQE v3 Worker Daemon Stop Script (cross-platform)
165
165
  // Generated by aqe init
166
166
 
@@ -183,10 +183,9 @@ try {
183
183
  console.log('Daemon not running (stale PID file)');
184
184
  try { unlinkSync(pidFile); } catch {}
185
185
  }
186
- `),e.services.log(` Workers dir: ${s}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`);let w=!1,h=null,k;if(t.workers.daemonAutoStart)try{let y=await this.startDaemon(s,n,e);w=y.started,h=y.pid,k=y.error,w?e.services.log(` MCP daemon started (PID: ${h})`):k&&(e.services.log(" MCP daemon: skipped (will start via Claude Code)"),e.services.log(` Note: ${k}`))}catch(y){k=y instanceof Error?y.message:"Unknown error",e.services.log(" MCP daemon: skipped (Claude Code will start it)")}return{workersDir:s,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:w,daemonPid:h,daemonError:k}}async startDaemon(e,t,n){let s=S(e,"daemon.pid"),o=S(e,"daemon.log");if(K(s))try{let i=parseInt(Ue(s,"utf-8").trim(),10);return process.kill(i,0),{started:!0,pid:i,error:"Already running"}}catch{}let r=await this.findMcpCommand(t);return r?new Promise(i=>{try{let l={...process.env,AQE_STORAGE_PATH:".agentic-qe",AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",AQE_HTTP_PORT:"0"},c=ze(r.command,r.args,{cwd:t,env:l,detached:!0,stdio:["ignore","pipe","pipe"]}),u=!1,m="";c.stderr?.on("data",d=>{m+=d.toString()}),c.on("error",d=>{i({started:!1,pid:null,error:d.message})}),setTimeout(()=>{try{if(c.pid){process.kill(c.pid,0),F(s,c.pid.toString(),"utf-8");let d=`[${new Date().toISOString()}] MCP daemon started with PID: ${c.pid}
187
- `;F(o,d,{flag:"a"}),c.unref(),i({started:!0,pid:c.pid})}else i({started:!1,pid:null,error:m||"No PID assigned"})}catch{let d=m.includes("ERR_MODULE_NOT_FOUND")?"Missing dependencies. Run: npm install agentic-qe":m||"Process exited immediately";i({started:!1,pid:null,error:d})}},1500)}catch(l){i({started:!1,pid:null,error:l instanceof Error?l.message:"Spawn failed"})}}):{started:!1,pid:null,error:"aqe-mcp not found. Install globally with: npm install -g agentic-qe"}}async findMcpCommand(e){let t=S(e,"node_modules",".bin","aqe-mcp");if(K(t))return{command:t,args:[]};let n=S(e,"node_modules","agentic-qe","dist","mcp","bundle.js");if(K(n))return{command:"node",args:[n]};let s=S(e,"node_modules",".bin","aqe");return K(s)?{command:s,args:["mcp"]}:{command:"npx",args:["--yes","agentic-qe","mcp"]}}};import{existsSync as Ke,readFileSync as Ye,writeFileSync as me}from"fs";import{join as De}from"path";var J=class extends g{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:n}=e,s=De(n,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(Ke(s)){let i=Ye(s,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:s,backupCreated:!1};let l=De(n,"CLAUDE.md.backup");me(l,i,"utf-8"),r=!0,me(s,i+`
186
+ `),e.services.log(` Workers dir: ${s}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`),e.services.log(` Registry: ${i}`),{workersDir:s,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:!1,daemonPid:null}}};import{existsSync as Ye,readFileSync as Je,writeFileSync as pe}from"fs";import{join as De}from"path";var K=class extends f{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:n}=e,s=De(n,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(Ye(s)){let i=Je(s,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:s,backupCreated:!1};let l=De(n,"CLAUDE.md.backup");pe(l,i,"utf-8"),r=!0,pe(s,i+`
188
187
 
189
- `+o,"utf-8")}else me(s,o,"utf-8");return e.services.log(` Path: ${s}`),r&&e.services.log(" Backup created"),{generated:!0,path:s,backupCreated:r}}generateContent(e){let t=e.domains.enabled.slice(0,6).join(", "),n=Math.max(0,e.domains.enabled.length-6);return`## Agentic QE v3
188
+ `+o,"utf-8")}else pe(s,o,"utf-8");return e.services.log(` Path: ${s}`),r&&e.services.log(" Backup created"),{generated:!0,path:s,backupCreated:r}}generateContent(e){let t=e.domains.enabled.slice(0,6).join(", "),n=Math.max(0,e.domains.enabled.length-6);return`## Agentic QE v3
190
189
 
191
190
  This project uses **Agentic QE v3** - a Domain-Driven Quality Engineering platform with 13 bounded contexts, ReasoningBank learning, HNSW vector search, and Agent Teams coordination (ADR-064).
192
191
 
@@ -348,7 +347,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
348
347
 
349
348
  ---
350
349
  *Generated by AQE v3 init - ${new Date().toISOString()}*
351
- `}};import{existsSync as j,readFileSync as Je}from"fs";import{join as N,dirname as Xe}from"path";import{mkdirSync as $e,writeFileSync as Ze}from"fs";ce();var X=class extends g{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:n}=e,s=[],o=N(n,".agentic-qe","memory.db");s.push({name:"Database exists",passed:j(o)}),s.push({name:".agentic-qe directory",passed:j(N(n,".agentic-qe"))});let r=N(n,".agentic-qe","config.yaml");await this.saveConfig(t,n),s.push({name:"Config saved",passed:j(r)});let i=await this.writeVersionToDb(t.version,n);s.push({name:"Version marker",passed:i});let l=["Database exists",".agentic-qe directory","Config saved"],c=s.filter(u=>l.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of s){let m=l.includes(u.name),d=u.passed?"\u2713":m?"\u2717":"\u26A0",w=!m&&!u.passed?" (optional)":"";e.services.log(` ${d} ${u.name}${w}`)}return{verified:c,versionWritten:i,configSaved:j(r),checks:s}}async writeVersionToDb(e,t){let n=N(t,".agentic-qe","memory.db");try{let s=Xe(n);j(s)||$e(s,{recursive:!0});let o=$(n);try{o.exec(`
350
+ `}};import{existsSync as j,readFileSync as Xe}from"fs";import{join as F,dirname as Ze}from"path";import{mkdirSync as je,writeFileSync as et}from"fs";le();var Y=class extends f{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:n}=e,s=[],o=F(n,".agentic-qe","memory.db");s.push({name:"Database exists",passed:j(o)}),s.push({name:".agentic-qe directory",passed:j(F(n,".agentic-qe"))});let r=F(n,".agentic-qe","config.yaml");await this.saveConfig(t,n),s.push({name:"Config saved",passed:j(r)});let i=await this.writeVersionToDb(t.version,n);s.push({name:"Version marker",passed:i});let l=["Database exists",".agentic-qe directory","Config saved"],c=s.filter(d=>l.includes(d.name)).every(d=>d.passed);e.services.log(" Verification checks:");for(let d of s){let g=l.includes(d.name),u=d.passed?"\u2713":g?"\u2717":"\u26A0",m=!g&&!d.passed?" (optional)":"";e.services.log(` ${u} ${d.name}${m}`)}return{verified:c,versionWritten:i,configSaved:j(r),checks:s}}async writeVersionToDb(e,t){let n=F(t,".agentic-qe","memory.db");try{let s=Ze(n);j(s)||je(s,{recursive:!0});let o=$(n);try{o.exec(`
352
351
  CREATE TABLE IF NOT EXISTS kv_store (
353
352
  key TEXT NOT NULL,
354
353
  namespace TEXT NOT NULL,
@@ -363,9 +362,9 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
363
362
  `).run("aqe_version",JSON.stringify(e),r),o.prepare(`
364
363
  INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
365
364
  VALUES (?, '_system', ?, ?)
366
- `).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 n=N(t,".agentic-qe");j(n)||$e(n,{recursive:!0});let s=N(n,"config.yaml");if(j(s)){let r=this.loadExistingConfig(s);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);Ze(s,o,"utf-8")}loadExistingConfig(e){try{let t=Je(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},n=e.split(`
367
- `),s="",o="";for(let i of n){if(i.trim().startsWith("#")||i.trim()==="")continue;let l=i.match(/^(\w+):\s*(.*)$/);if(l){s=l[1],o="";let d=l[2].trim();d&&!d.startsWith('"')?t[s]=this.parseValue(d):d?t[s]=this.parseValue(d):t[s]={};continue}let c=i.match(/^ (\w+):\s*(.*)$/);if(c&&s){o=c[1];let d=c[2].trim();t[s]||(t[s]={}),d?t[s][o]=this.parseValue(d):t[s][o]={};continue}let u=i.match(/^ ([\w-]+):\s*(.*)$/);if(u&&s&&o){let d=u[1],w=u[2].trim(),h=t[s];h[o]||(h[o]={}),typeof h[o]=="object"&&!Array.isArray(h[o])&&(h[o][d]=this.parseValue(w));continue}let m=i.match(/^ - "?([^"]*)"?$/);if(m&&s&&o){let d=t[s];Array.isArray(d[o])||(d[o]=[]),d[o].push(m[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,l]of r){let c=t[i];c&&l in c&&!Array.isArray(c[l])&&(c[l]=[])}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 n=new Set(t.domains.enabled),s=new Set(e.domains.enabled);for(let r of s)n.add(r);let o=new Set(Array.isArray(t.domains?.disabled)?t.domains.disabled:[]);e.domains.enabled=Array.from(n).filter(r=>!o.has(r))}return t.domains?.disabled&&Array.isArray(t.domains.disabled)&&(e.domains.disabled=t.domains.disabled),t.learning?.enabled!==void 0&&(e.learning.enabled=t.learning.enabled),t.hooks?.claudeCode!==void 0&&(e.hooks.claudeCode=t.hooks.claudeCode),t.hooks?.preCommit!==void 0&&(e.hooks.preCommit=t.hooks.preCommit),t.hooks?.ciIntegration!==void 0&&(e.hooks.ciIntegration=t.hooks.ciIntegration),t.workers?.enabled&&Array.isArray(t.workers.enabled)&&(e.workers.enabled=t.workers.enabled),t.workers?.daemonAutoStart!==void 0&&(e.workers.daemonAutoStart=t.workers.daemonAutoStart),t.agents?.maxConcurrent!==void 0&&(e.agents.maxConcurrent=t.agents.maxConcurrent),t.agents?.defaultTimeout!==void 0&&(e.agents.defaultTimeout=t.agents.defaultTimeout),e}configToYAML(e){return["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,"#",'# NOTE: Your customizations are PRESERVED when you run "aqe init" again.','# You do NOT need to re-run "aqe init" after editing this file - changes',"# take effect immediately. The following settings are merged on reinstall:","# - domains.enabled (custom domains like visual-accessibility)","# - domains.disabled","# - learning.enabled","# - hooks.* preferences","# - workers.enabled","# - agents.maxConcurrent and defaultTimeout","",`version: "${e.version}"`,"","project:",` name: "${e.project.name}"`,` root: "${e.project.root}"`,` type: "${e.project.type}"`,"","learning:",` enabled: ${e.learning.enabled}`,` embeddingModel: "${e.learning.embeddingModel}"`," hnswConfig:",` M: ${e.learning.hnswConfig.M}`,` efConstruction: ${e.learning.hnswConfig.efConstruction}`,` efSearch: ${e.learning.hnswConfig.efSearch}`,` qualityThreshold: ${e.learning.qualityThreshold}`,` promotionThreshold: ${e.learning.promotionThreshold}`,` pretrainedPatterns: ${e.learning.pretrainedPatterns}`,"","routing:",` mode: "${e.routing.mode}"`,` confidenceThreshold: ${e.routing.confidenceThreshold}`,` feedbackEnabled: ${e.routing.feedbackEnabled}`,"","workers:"," enabled:",...e.workers.enabled.map(n=>` - "${n}"`)," intervals:",...Object.entries(e.workers.intervals).map(([n,s])=>` ${n}: ${s}`),` 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(n=>` - "${n}"`)," disabled:",...e.domains.disabled.map(n=>` - "${n}"`),"","agents:",` maxConcurrent: ${e.agents.maxConcurrent}`,` defaultTimeout: ${e.agents.defaultTimeout}`,""].join(`
368
- `)}};le();import{existsSync as D,mkdirSync as qe,readdirSync as je,copyFileSync as Me}from"fs";import{join as I,dirname as et}from"path";import{fileURLToPath as tt}from"url";var nt=tt(import.meta.url),Te=et(nt);function st(){let p=I(Te,"../../assets/governance"),e=I(Te,"../assets/governance");if(D(p))return p;if(D(e))return e;let t=I(process.cwd(),"assets/governance");if(D(t))return t;throw new Error("Governance assets not found. Package may be corrupted.")}var ge=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=st()}async install(){let e=[],t=[],n=[],s=I(this.projectRoot,".claude","guidance"),o=I(s,"shards");try{qe(s,{recursive:!0}),this.skipShards||qe(o,{recursive:!0})}catch(u){return n.push(`Failed to create governance directory: ${x(u)}`),{installed:e,skipped:t,errors:n,governanceDir:s,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=I(this.assetsPath,"constitution.md"),l=I(s,"constitution.md");if(D(i))try{!D(l)||this.overwrite?(Me(i,l),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(u){n.push(`Failed to install constitution.md: ${x(u)}`)}else n.push("constitution.md not found in assets");let c=0;if(!this.skipShards){let u=I(this.assetsPath,"shards");if(D(u))try{let m=je(u).filter(d=>d.endsWith(".shard.md"));for(let d of m){let w=I(u,d),h=I(o,d);try{!D(h)||this.overwrite?(Me(w,h),e.push(`shards/${d}`),c++):t.push(`shards/${d}`)}catch(k){n.push(`Failed to install ${d}: ${x(k)}`)}}}catch(m){n.push(`Failed to read shards directory: ${x(m)}`)}else n.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:n,governanceDir:s,constitutionInstalled:r,shardsInstalled:c}}isInstalled(){let e=I(this.projectRoot,".claude","guidance","constitution.md");return D(e)}getInstalledShards(){let e=I(this.projectRoot,".claude","guidance","shards");if(!D(e))return[];try{return je(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function Oe(p){return new ge(p)}var Z=class extends g{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noGovernance?(e.services.log(" Governance skipped (--no-governance flag)"),!1):e.options.minimal?(e.services.log(" Governance skipped (minimal mode)"),!1):!0}async run(e){let{projectRoot:t,options:n}=e,s=n.upgrade,o=Oe({projectRoot:t,overwrite:s});if(o.isInstalled()&&!s){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 rt=new Q,ot=new L,it=new V,at=new W,lt=new H,ct=new G,dt=new B,ut=new U,pt=new z,mt=new Y,gt=new J,ft=new X,ht=new Z;function Fe(){return[rt,ot,it,at,lt,ct,dt,ut,pt,ht,mt,gt,ft]}var fe=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??Fe()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,minimal:e.minimal,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp},config:{},enhancements:{claudeFlow:!1,ruvector:!1},results:new Map,services:{log:n=>console.log(n),warn:n=>console.warn(n),error:n=>console.error(n)}}}async initialize(){let e=Date.now(),t=[];try{let n=[...this.phases].sort((s,o)=>s.order-o.order);for(let s of n){if(!await s.shouldRun(this.context))continue;console.log(`
365
+ `).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 n=F(t,".agentic-qe");j(n)||je(n,{recursive:!0});let s=F(n,"config.yaml");if(j(s)){let r=this.loadExistingConfig(s);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);et(s,o,"utf-8")}loadExistingConfig(e){try{let t=Xe(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},n=e.split(`
366
+ `),s="",o="";for(let i of n){if(i.trim().startsWith("#")||i.trim()==="")continue;let l=i.match(/^(\w+):\s*(.*)$/);if(l){s=l[1],o="";let u=l[2].trim();u&&!u.startsWith('"')?t[s]=this.parseValue(u):u?t[s]=this.parseValue(u):t[s]={};continue}let c=i.match(/^ (\w+):\s*(.*)$/);if(c&&s){o=c[1];let u=c[2].trim();t[s]||(t[s]={}),u?t[s][o]=this.parseValue(u):t[s][o]={};continue}let d=i.match(/^ ([\w-]+):\s*(.*)$/);if(d&&s&&o){let u=d[1],m=d[2].trim(),y=t[s];y[o]||(y[o]={}),typeof y[o]=="object"&&!Array.isArray(y[o])&&(y[o][u]=this.parseValue(m));continue}let g=i.match(/^ - "?([^"]*)"?$/);if(g&&s&&o){let u=t[s];Array.isArray(u[o])||(u[o]=[]),u[o].push(g[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,l]of r){let c=t[i];c&&l in c&&!Array.isArray(c[l])&&(c[l]=[])}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 n=new Set(t.domains.enabled),s=new Set(e.domains.enabled);for(let r of s)n.add(r);let o=new Set(Array.isArray(t.domains?.disabled)?t.domains.disabled:[]);e.domains.enabled=Array.from(n).filter(r=>!o.has(r))}return t.domains?.disabled&&Array.isArray(t.domains.disabled)&&(e.domains.disabled=t.domains.disabled),t.learning?.enabled!==void 0&&(e.learning.enabled=t.learning.enabled),t.hooks?.claudeCode!==void 0&&(e.hooks.claudeCode=t.hooks.claudeCode),t.hooks?.preCommit!==void 0&&(e.hooks.preCommit=t.hooks.preCommit),t.hooks?.ciIntegration!==void 0&&(e.hooks.ciIntegration=t.hooks.ciIntegration),t.workers?.enabled&&Array.isArray(t.workers.enabled)&&(e.workers.enabled=t.workers.enabled),t.workers?.daemonAutoStart!==void 0&&(e.workers.daemonAutoStart=t.workers.daemonAutoStart),t.agents?.maxConcurrent!==void 0&&(e.agents.maxConcurrent=t.agents.maxConcurrent),t.agents?.defaultTimeout!==void 0&&(e.agents.defaultTimeout=t.agents.defaultTimeout),e}configToYAML(e){return["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,"#",'# NOTE: Your customizations are PRESERVED when you run "aqe init" again.','# You do NOT need to re-run "aqe init" after editing this file - changes',"# take effect immediately. The following settings are merged on reinstall:","# - domains.enabled (custom domains like visual-accessibility)","# - domains.disabled","# - learning.enabled","# - hooks.* preferences","# - workers.enabled","# - agents.maxConcurrent and defaultTimeout","",`version: "${e.version}"`,"","project:",` name: "${e.project.name}"`,` root: "${e.project.root}"`,` type: "${e.project.type}"`,"","learning:",` enabled: ${e.learning.enabled}`,` embeddingModel: "${e.learning.embeddingModel}"`," hnswConfig:",` M: ${e.learning.hnswConfig.M}`,` efConstruction: ${e.learning.hnswConfig.efConstruction}`,` efSearch: ${e.learning.hnswConfig.efSearch}`,` qualityThreshold: ${e.learning.qualityThreshold}`,` promotionThreshold: ${e.learning.promotionThreshold}`,` pretrainedPatterns: ${e.learning.pretrainedPatterns}`,"","routing:",` mode: "${e.routing.mode}"`,` confidenceThreshold: ${e.routing.confidenceThreshold}`,` feedbackEnabled: ${e.routing.feedbackEnabled}`,"","workers:"," enabled:",...e.workers.enabled.map(n=>` - "${n}"`)," intervals:",...Object.entries(e.workers.intervals).map(([n,s])=>` ${n}: ${s}`),` 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(n=>` - "${n}"`)," disabled:",...e.domains.disabled.map(n=>` - "${n}"`),"","agents:",` maxConcurrent: ${e.agents.maxConcurrent}`,` defaultTimeout: ${e.agents.defaultTimeout}`,""].join(`
367
+ `)}};ae();import{existsSync as A,mkdirSync as qe,readdirSync as Te,copyFileSync as Me}from"fs";import{join as I,dirname as tt}from"path";import{fileURLToPath as nt}from"url";var st=nt(import.meta.url),Oe=tt(st);function rt(){let p=I(Oe,"../../assets/governance"),e=I(Oe,"../assets/governance");if(A(p))return p;if(A(e))return e;let t=I(process.cwd(),"assets/governance");if(A(t))return t;throw new Error("Governance assets not found. Package may be corrupted.")}var ge=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=rt()}async install(){let e=[],t=[],n=[],s=I(this.projectRoot,".claude","guidance"),o=I(s,"shards");try{qe(s,{recursive:!0}),this.skipShards||qe(o,{recursive:!0})}catch(d){return n.push(`Failed to create governance directory: ${R(d)}`),{installed:e,skipped:t,errors:n,governanceDir:s,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=I(this.assetsPath,"constitution.md"),l=I(s,"constitution.md");if(A(i))try{!A(l)||this.overwrite?(Me(i,l),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(d){n.push(`Failed to install constitution.md: ${R(d)}`)}else n.push("constitution.md not found in assets");let c=0;if(!this.skipShards){let d=I(this.assetsPath,"shards");if(A(d))try{let g=Te(d).filter(u=>u.endsWith(".shard.md"));for(let u of g){let m=I(d,u),y=I(o,u);try{!A(y)||this.overwrite?(Me(m,y),e.push(`shards/${u}`),c++):t.push(`shards/${u}`)}catch(k){n.push(`Failed to install ${u}: ${R(k)}`)}}}catch(g){n.push(`Failed to read shards directory: ${R(g)}`)}else n.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:n,governanceDir:s,constitutionInstalled:r,shardsInstalled:c}}isInstalled(){let e=I(this.projectRoot,".claude","guidance","constitution.md");return A(e)}getInstalledShards(){let e=I(this.projectRoot,".claude","guidance","shards");if(!A(e))return[];try{return Te(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function Fe(p){return new ge(p)}var J=class extends f{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noGovernance?(e.services.log(" Governance skipped (--no-governance flag)"),!1):e.options.minimal?(e.services.log(" Governance skipped (minimal mode)"),!1):!0}async run(e){let{projectRoot:t,options:n}=e,s=n.upgrade,o=Fe({projectRoot:t,overwrite:s});if(o.isInstalled()&&!s){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 ot=new N,it=new Q,at=new L,lt=new V,ct=new W,dt=new H,ut=new G,pt=new U,gt=new B,mt=new z,ft=new K,ht=new Y,yt=new J;function Ne(){return[ot,it,at,lt,ct,dt,ut,pt,gt,yt,mt,ft,ht]}var me=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??Ne()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,minimal:e.minimal,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp},config:{},enhancements:{claudeFlow:!1,ruvector:!1},results:new Map,services:{log:n=>console.log(n),warn:n=>console.warn(n),error:n=>console.error(n)}}}async initialize(){let e=Date.now(),t=[];try{let n=[...this.phases].sort((s,o)=>s.order-o.order);for(let s of n){if(!await s.shouldRun(this.context))continue;console.log(`
369
368
  \u{1F4CB} ${s.description}...`);let r=await s.execute(this.context);if(this.context.results.set(s.name,r),t.push({step:s.description,status:r.success?"success":"error",message:r.message||"",durationMs:r.durationMs}),!r.success&&s.critical){if(console.error(`
370
- \u274C Critical phase failed: ${s.name}`),s.rollback)try{await s.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(n){return t.push({step:"Initialization Failed",status:"error",message:x(n),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let n=this.context.config,s=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),l=this.context.results.get("mcp"),c=this.context.results.get("claude-md"),u=this.context.results.get("workers");return{success:!0,config:n||de("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:s?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:l?.data?.configured??!1,claudeMdGenerated:c?.data?.generated??!1,workersStarted:u?.data?.workersConfigured??0},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:de("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 yt(p){return new fe(p)}async function ks(p){return await yt({projectRoot:p,autoMode:!0}).initialize()}function ws(p){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 n of p.steps){let s=n.status==="success"?"\u2713":n.status==="error"?"\u2717":"\u25CB",o=n.step.substring(0,48).padEnd(48);e.push(`\u2502 ${s} ${o} ${String(n.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: ${p.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${p.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(p.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(p.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(p.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(p.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(p.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${p.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${p.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${p.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=p.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(`
371
- `)}export{fe as ModularInitOrchestrator,yt as createModularInitOrchestrator,ws as formatInitResultModular,ks as quickInitModular};
369
+ \u274C Critical phase failed: ${s.name}`),s.rollback)try{await s.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(n){return t.push({step:"Initialization Failed",status:"error",message:R(n),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let n=this.context.config,s=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),l=this.context.results.get("mcp"),c=this.context.results.get("claude-md"),d=this.context.results.get("workers");return{success:!0,config:n||ce("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:s?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:l?.data?.configured??!1,claudeMdGenerated:c?.data?.generated??!1,workersStarted:d?.data?.workersConfigured??0},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ce("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 vt(p){return new me(p)}async function ks(p){return await vt({projectRoot:p,autoMode:!0}).initialize()}function ws(p){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 n of p.steps){let s=n.status==="success"?"\u2713":n.status==="error"?"\u2717":"\u25CB",o=n.step.substring(0,48).padEnd(48);e.push(`\u2502 ${s} ${o} ${String(n.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: ${p.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${p.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(p.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(p.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(p.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(p.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(p.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${p.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${p.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${p.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=p.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(`
370
+ `)}export{me as ModularInitOrchestrator,vt as createModularInitOrchestrator,ws as formatInitResultModular,ks as quickInitModular};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{a as y,b as w,c as u}from"./chunk-BIVIPF4O.js";import"./chunk-YXCU4CJX.js";import{Command as O}from"commander";import{resolve as A}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return u(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return u(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return u(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return u(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return u(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return u(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return u(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,l=this.validateSteps(t.steps);if(!l.success)return l;let d;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return u(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;d=g.value}let p=this.detectCircularDependencies(l.value);if(p)return u(new Error(`Circular dependency detected: ${p}`));let c={id:t.id,name:t.name,description:n,version:a,steps:l.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...d!==void 0&&{triggers:d}};return w(c)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return u(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return u(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return u(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return u(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return u(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!y.includes(e.domain))return u(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${y.join(", ")}`));if(!e.action||typeof e.action!="string")return u(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return u(i);let l=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(l!==void 0&&l instanceof Error)return u(l);let d;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(f=>typeof f=="string"))return u(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let f of e.dependsOn)if(!r.some(j=>j.id===f))return u(new Error(`Step '${e.id}' depends on unknown step: ${f}`));d=e.dependsOn}let p;if(e.condition!==void 0){let f=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!f.success)return f;p=f.value}let c;if(e.skipCondition!==void 0){let f=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!f.success)return f;c=f.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return u(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let f=this.validateRetry(e.retry,e.id);if(!f.success)return f;$=f.value}let b;if(e.rollback!==void 0){let f=this.validateRollback(e.rollback,e.id);if(!f.success)return f;b=f.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let f=this.validateApproval(e.approval,e.id);if(!f.success)return f;S=f.value}let C={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...l!==void 0&&{outputMapping:l},...d!==void 0&&{dependsOn:d},...p!==void 0&&{condition:p},...c!==void 0&&{skipCondition:c},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(C)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?u(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?u(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?u(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):u(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return u(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return u(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!y.includes(o.sourceDomain))return u(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let d=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!d.success)return d;i=d.value}let l=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(l!==void 0&&l instanceof Error)return u(l);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...l!==void 0&&{inputMapping:l}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?u(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?u(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!y.includes(n.domain)?u(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?u(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.autoApproveAfter!==void 0){if(typeof n.autoApproveAfter!="number"||n.autoApproveAfter<0)return u(new Error(`Step '${t}': approval.autoApproveAfter must be a non-negative number`));a.autoApproveAfter=n.autoApproveAfter}if(n.message!==void 0){if(typeof n.message!="string")return u(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(l=>l.id===o);if(i?.dependsOn)for(let l of i.dependsOn){let d=a(l,[...e,o]);if(d)return d}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function v(m){return m.workflowOrchestrator}function X(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=v(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let l=A(o),d=e.vars?h(e.vars):void 0;console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as y,b as w,c as u}from"./chunk-TA454OEB.js";import"./chunk-7ASGPJWU.js";import{Command as O}from"commander";import{resolve as A}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return u(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return u(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return u(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return u(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return u(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return u(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return u(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,l=this.validateSteps(t.steps);if(!l.success)return l;let d;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return u(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;d=g.value}let p=this.detectCircularDependencies(l.value);if(p)return u(new Error(`Circular dependency detected: ${p}`));let c={id:t.id,name:t.name,description:n,version:a,steps:l.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...d!==void 0&&{triggers:d}};return w(c)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return u(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return u(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return u(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return u(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return u(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!y.includes(e.domain))return u(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${y.join(", ")}`));if(!e.action||typeof e.action!="string")return u(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return u(i);let l=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(l!==void 0&&l instanceof Error)return u(l);let d;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(f=>typeof f=="string"))return u(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let f of e.dependsOn)if(!r.some(j=>j.id===f))return u(new Error(`Step '${e.id}' depends on unknown step: ${f}`));d=e.dependsOn}let p;if(e.condition!==void 0){let f=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!f.success)return f;p=f.value}let c;if(e.skipCondition!==void 0){let f=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!f.success)return f;c=f.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return u(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let f=this.validateRetry(e.retry,e.id);if(!f.success)return f;$=f.value}let b;if(e.rollback!==void 0){let f=this.validateRollback(e.rollback,e.id);if(!f.success)return f;b=f.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let f=this.validateApproval(e.approval,e.id);if(!f.success)return f;S=f.value}let C={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...l!==void 0&&{outputMapping:l},...d!==void 0&&{dependsOn:d},...p!==void 0&&{condition:p},...c!==void 0&&{skipCondition:c},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(C)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?u(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?u(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?u(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):u(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return u(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return u(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!y.includes(o.sourceDomain))return u(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let d=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!d.success)return d;i=d.value}let l=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(l!==void 0&&l instanceof Error)return u(l);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...l!==void 0&&{inputMapping:l}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?u(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?u(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!y.includes(n.domain)?u(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?u(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return u(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.autoApproveAfter!==void 0){if(typeof n.autoApproveAfter!="number"||n.autoApproveAfter<0)return u(new Error(`Step '${t}': approval.autoApproveAfter must be a non-negative number`));a.autoApproveAfter=n.autoApproveAfter}if(n.message!==void 0){if(typeof n.message!="string")return u(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(l=>l.id===o);if(i?.dependsOn)for(let l of i.dependsOn){let d=a(l,[...e,o]);if(d)return d}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function v(m){return m.workflowOrchestrator}function X(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=v(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let l=A(o),d=e.vars?h(e.vars):void 0;console.log(s.blue(`
3
3
  Loading pipeline from: ${o}
4
4
  `));let p=await n.loadFromFile(l,d);if(!p.success){console.error(s.red(` Parse error: ${p.error.message}`)),await r(1);return}let c=p.value,g=i.registerWorkflow(c);if(!g.success){console.error(s.red(` Registration error: ${g.error.message}`)),await r(1);return}console.log(s.green(" Pipeline loaded successfully.")),console.log(` ID: ${s.cyan(c.id)}`),console.log(` Name: ${s.cyan(c.name)}`),console.log(` Steps: ${s.cyan(c.steps.length)}`),console.log(` Version: ${s.cyan(c.version)}`),c.tags?.length&&console.log(` Tags: ${s.cyan(c.tags.join(", "))}`),console.log(""),await r(0)}),a.command("validate <file>").description("Validate a YAML pipeline without registering it").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{let i=A(o),l=e.vars?h(e.vars):void 0;console.log(s.blue(`
5
5
  Validating pipeline: ${o}
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{a as u}from"./chunk-2VVV73PW.js";import{a as y,c as w}from"./chunk-SDTVHR63.js";import{b as $}from"./chunk-YXCU4CJX.js";import{Command as v}from"commander";import o from"chalk";import{existsSync as d,readFileSync as P}from"node:fs";import m from"node:path";w();var C=$({});var p=Object.keys(u);function h(s){return p.includes(s)}function x(s,e){let t=m.join(s,e.configPath),n=m.join(s,e.rulesPath);return{configExists:d(t),rulesExists:d(n)}}function E(s,e){try{let t=P(s,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:y(t)}}}function I(s,e){try{return P(s,"utf-8").includes("agentic-qe")}catch{return!1}}function j(){let s=new v("platform").description("Manage coding agent platform configurations");return s.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,n=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(n)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+n+r)}`));for(let l of p){let f=u[l],{configExists:c,rulesExists:a}=x(e,f),i=c&&a?o.green("configured"):c||a?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(f.name.padEnd(t))}${o.gray(f.configPath.padEnd(n))}${i}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),s.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").action(async(e,t)=>{let n=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let r=u[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let l=await C(`../../init/${e}-installer.js`),c=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${R(e)}Installer`],a;for(let i of c)if(typeof l[i]=="function"){a=l[i];break}if(!a){for(let i of Object.keys(l))if(i.startsWith("create")&&i.endsWith("Installer")&&typeof l[i]=="function"){a=l[i];break}}a||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let g=await a({projectRoot:n,overwrite:t.overwrite}).install();if(g.success)console.log(o.green(` ${r.name} configured successfully`)),g.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),g.rulesInstalled&&console.log(o.gray(` Rules: ${r.rulesPath}`));else if(console.log(o.red(` ${r.name} setup failed`)),g.errors)for(let i of g.errors)console.log(o.red(` ${i}`))}catch(l){console.log(o.red(` Failed to set up ${r.name}: ${y(l)}`))}console.log("")}),s.command("verify <name>").description("Verify a platform configuration is correct").action(async e=>{let t=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let n=u[e];console.log(""),console.log(o.bold.blue(` Verifying ${n.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let r=!0,l=m.join(t,n.configPath);if(d(l)?console.log(o.green(` [pass] Config file exists: ${n.configPath}`)):(console.log(o.red(` [fail] Config file missing: ${n.configPath}`)),r=!1),d(l)){let c=E(l,n.configFormat);c.valid?console.log(o.green(` [pass] Config file is valid ${n.configFormat.toUpperCase()}`)):(console.log(o.red(` [fail] Config file is invalid: ${c.error}`)),r=!1),I(l,n)?console.log(o.green(" [pass] Config contains agentic-qe entry")):(console.log(o.red(" [fail] Config does not contain agentic-qe entry")),r=!1)}let f=m.join(t,n.rulesPath);d(f)?console.log(o.green(` [pass] Rules file exists: ${n.rulesPath}`)):(console.log(o.red(` [fail] Rules file missing: ${n.rulesPath}`)),r=!1),console.log(""),r?console.log(o.green(` ${n.name} configuration is valid`)):(console.log(o.yellow(` ${n.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`))),console.log("")}),s}function R(s){return s.charAt(0).toUpperCase()+s.slice(1)}var V=j;export{j as createPlatformCommand,V as default};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as u}from"./chunk-HJEWQD2B.js";import{a as y,c as w}from"./chunk-OXR2FPHK.js";import{b as $}from"./chunk-7ASGPJWU.js";import{Command as v}from"commander";import o from"chalk";import{existsSync as d,readFileSync as P}from"node:fs";import m from"node:path";w();var C=$({});var p=Object.keys(u);function h(s){return p.includes(s)}function x(s,e){let t=m.join(s,e.configPath),n=m.join(s,e.rulesPath);return{configExists:d(t),rulesExists:d(n)}}function E(s,e){try{let t=P(s,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:y(t)}}}function I(s,e){try{return P(s,"utf-8").includes("agentic-qe")}catch{return!1}}function j(){let s=new v("platform").description("Manage coding agent platform configurations");return s.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,n=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(n)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+n+r)}`));for(let l of p){let f=u[l],{configExists:c,rulesExists:a}=x(e,f),i=c&&a?o.green("configured"):c||a?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(f.name.padEnd(t))}${o.gray(f.configPath.padEnd(n))}${i}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),s.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").action(async(e,t)=>{let n=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let r=u[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let l=await C(`../../init/${e}-installer.js`),c=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${R(e)}Installer`],a;for(let i of c)if(typeof l[i]=="function"){a=l[i];break}if(!a){for(let i of Object.keys(l))if(i.startsWith("create")&&i.endsWith("Installer")&&typeof l[i]=="function"){a=l[i];break}}a||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let g=await a({projectRoot:n,overwrite:t.overwrite}).install();if(g.success)console.log(o.green(` ${r.name} configured successfully`)),g.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),g.rulesInstalled&&console.log(o.gray(` Rules: ${r.rulesPath}`));else if(console.log(o.red(` ${r.name} setup failed`)),g.errors)for(let i of g.errors)console.log(o.red(` ${i}`))}catch(l){console.log(o.red(` Failed to set up ${r.name}: ${y(l)}`))}console.log("")}),s.command("verify <name>").description("Verify a platform configuration is correct").action(async e=>{let t=process.cwd();h(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${p.join(", ")}`)),console.log(""),process.exit(1));let n=u[e];console.log(""),console.log(o.bold.blue(` Verifying ${n.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let r=!0,l=m.join(t,n.configPath);if(d(l)?console.log(o.green(` [pass] Config file exists: ${n.configPath}`)):(console.log(o.red(` [fail] Config file missing: ${n.configPath}`)),r=!1),d(l)){let c=E(l,n.configFormat);c.valid?console.log(o.green(` [pass] Config file is valid ${n.configFormat.toUpperCase()}`)):(console.log(o.red(` [fail] Config file is invalid: ${c.error}`)),r=!1),I(l,n)?console.log(o.green(" [pass] Config contains agentic-qe entry")):(console.log(o.red(" [fail] Config does not contain agentic-qe entry")),r=!1)}let f=m.join(t,n.rulesPath);d(f)?console.log(o.green(` [pass] Rules file exists: ${n.rulesPath}`)):(console.log(o.red(` [fail] Rules file missing: ${n.rulesPath}`)),r=!1),console.log(""),r?console.log(o.green(` ${n.name} configuration is valid`)):(console.log(o.yellow(` ${n.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`))),console.log("")}),s}function R(s){return s.charAt(0).toUpperCase()+s.slice(1)}var V=j;export{j as createPlatformCommand,V as default};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{a as p,b as d,c as h}from"./chunk-DNLMZTE2.js";import"./chunk-YXCU4CJX.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as p,b as d,c as h}from"./chunk-DBSVEWWL.js";import"./chunk-7ASGPJWU.js";import{Command as _}from"commander";import*as g from"path";import{execFileSync as v}from"child_process";var $=/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/,w=/^[a-zA-Z0-9._\-/]+$/;function E(i,n){if(!$.test(i))throw new Error(`Invalid GitHub repo "${i}": must be owner/repo with alphanumeric, dots, hyphens, underscores only`);if(n&&!w.test(n))throw new Error(`Invalid tag "${n}": must be alphanumeric with dots, hyphens, underscores, slashes only`)}var u=class{type="github";cacheDir;constructor(n){this.cacheDir=n??g.join(process.cwd(),".agentic-qe","plugins-cache")}async resolve(n){let e=await this.getPluginPath(n),t=g.join(e,"qe-plugin.json"),o=await import("fs");if(!o.existsSync(t))throw new Error(`No qe-plugin.json found in ${n}`);let r=o.readFileSync(t,"utf-8");return p(r)}async getPluginPath(n){let{repo:e,tag:t}=this.parseLocation(n);E(e,t);let o=g.join(this.cacheDir,e.replace("/","__"),t||"latest"),r=await import("fs");if(r.existsSync(o))return o;r.mkdirSync(o,{recursive:!0});try{let a=`https://github.com/${e}.git`,c=["clone","--depth","1"];t&&c.push("--branch",t),c.push(a,o),v("git",c,{stdio:"pipe",timeout:6e4})}catch(a){throw r.rmSync(o,{recursive:!0,force:!0}),new Error(`Failed to clone ${e}: ${a instanceof Error?a.message:String(a)}`)}return o}parseLocation(n){let[e,t]=n.split("@");if(!e||!e.includes("/"))throw new Error(`Invalid GitHub location "${n}". Expected "owner/repo" or "owner/repo@tag"`);return{repo:e,tag:t}}};import*as l from"path";import*as s from"fs";import{execFileSync as y}from"child_process";var P=/^(@[a-zA-Z0-9._-]+\/)?[a-zA-Z0-9._-]+$/,S=/^[a-zA-Z0-9._\-+]+$/;function x(i,n){if(!P.test(i))throw new Error(`Invalid npm package name "${i}": contains unsafe characters`);if(n&&!S.test(n))throw new Error(`Invalid version "${n}": contains unsafe characters`)}var m=class{type="npm";cacheDir;constructor(n){this.cacheDir=n??l.join(process.cwd(),".agentic-qe","plugins-cache","npm")}async resolve(n){let e=await this.getPluginPath(n),t=l.join(e,"qe-plugin.json");if(!s.existsSync(t))throw new Error(`No qe-plugin.json found in npm package ${n}`);let o=s.readFileSync(t,"utf-8");return p(o)}async getPluginPath(n){let{name:e,version:t}=this.parseLocation(n);x(e,t);let o=e.replace(/\//g,"__"),r=l.join(this.cacheDir,`${o}@${t||"latest"}`);if(s.existsSync(r)&&s.readdirSync(r).length>0)return r;s.mkdirSync(r,{recursive:!0});try{let a=t?`${e}@${t}`:e,c=y("npm",["pack",a,"--pack-destination",r],{stdio:"pipe",timeout:6e4}).toString().trim(),f=l.join(r,c);y("tar",["-xzf",f,"-C",r,"--strip-components=1"],{stdio:"pipe"}),s.existsSync(f)&&s.unlinkSync(f)}catch(a){throw s.rmSync(r,{recursive:!0,force:!0}),new Error(`Failed to fetch npm package ${n}: ${a instanceof Error?a.message:String(a)}`)}return r}parseLocation(n){let e=n.lastIndexOf("@");return e>0?{name:n.slice(0,e),version:n.slice(e+1)||void 0}:{name:n}}};function N(){let i=I(),n=new _("plugin").description("Manage external QE domain plugins").addHelpText("after",`
3
3
  Examples:
4
4
  aqe plugin install ./my-plugin Install from local directory
5
5
  aqe plugin install owner/repo --source github Install from GitHub
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import"./chunk-YXCU4CJX.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import"./chunk-7ASGPJWU.js";import{createRequire as t}from"module";var n=t(import.meta.url),e=n("prime-radiant-advanced-wasm"),r=e,{RuvectorLayer:i,TensorCompress:a,differentiableSearch:c,hierarchicalForward:p,getCompressionLevel:s,init:d,FlashAttention:l,DotProductAttention:m,MultiHeadAttention:u,HyperbolicAttention:A,LinearAttention:f,MoEAttention:h,SonaEngine:_,pipeline:v}=e||{};export{m as DotProductAttention,l as FlashAttention,A as HyperbolicAttention,f as LinearAttention,h as MoEAttention,u as MultiHeadAttention,i as RuvectorLayer,_ as SonaEngine,a as TensorCompress,r as default,c as differentiableSearch,s as getCompressionLevel,p as hierarchicalForward,d as init,v as pipeline};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a,b}from"./chunk-LHDR6E6F.js";import"./chunk-JXE2DFXM.js";import"./chunk-P6OZKWNK.js";import"./chunk-TA454OEB.js";import"./chunk-OXR2FPHK.js";import"./chunk-EVIXQR4O.js";import"./chunk-7ASGPJWU.js";export{a as DefaultProtocolExecutor,b as createProtocolExecutor};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import"./chunk-5AUKULWO.js";import{c as i}from"./chunk-N3F3CX4V.js";import"./chunk-YXCU4CJX.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import"./chunk-DGRO6LSI.js";import{c as i}from"./chunk-CU36MONI.js";import"./chunk-7ASGPJWU.js";import n from"chalk";var a=class{name="protocol";description="Execute coordination protocols";cleanupAndExit;ensureInitialized;constructor(o,e){this.cleanupAndExit=o,this.ensureInitialized=e}register(o,e){o.command("protocol").description(this.description).command("run <protocolId>").description("Execute a protocol").option("--params <json>","Protocol parameters as JSON","{}").action(async(r,t)=>{await this.executeRun(r,t,e)})}async executeRun(o,e,c){if(await this.ensureInitialized())try{let r=i(e.params,"params");console.log(n.blue(`
3
3
  Executing protocol: ${o}
4
4
  `));let t=await c.queen.executeProtocol(o,r);t.success?(console.log(n.green(" Protocol execution started")),console.log(n.cyan(` Execution ID: ${t.value}`))):console.log(n.red(` Failed to execute protocol: ${t.error.message}`)),console.log("")}catch(r){console.error(n.red(`
5
5
  Failed to execute protocol:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
@@ -1,3 +1,3 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import"./chunk-YXCU4CJX.js";import{Command as l}from"commander";import*as c from"crypto";import*as n from"fs";import*as r from"path";function m(t){let e=JSON.stringify(t,null,0);return c.createHash("sha256").update(e).digest("hex")}async function d(t){let e={testCount:0,passRate:0,coveragePercent:0,vulnerabilities:0,qualityScore:0,patternsUsed:0};try{let a=r.join(t,"junit.xml");if(n.existsSync(a)){let o=n.readFileSync(a,"utf-8"),s=o.match(/tests="(\d+)"/),i=o.match(/failures="(\d+)"/);if(s){e.testCount=parseInt(s[1],10);let u=i?parseInt(i[1],10):0;e.passRate=e.testCount>0?(e.testCount-u)/e.testCount*100:0}}}catch{}try{let a=r.join(t,"coverage","coverage-summary.json");if(n.existsSync(a)){let o=JSON.parse(n.readFileSync(a,"utf-8"));e.coveragePercent=o?.total?.lines?.pct??0}}catch{}try{let a=r.join(t,".agentic-qe","memory.db");n.existsSync(a)&&(e.patternsUsed=1)}catch{}return e.qualityScore=Math.round(e.passRate*.4+e.coveragePercent*.3+(e.vulnerabilities===0?100:Math.max(0,100-e.vulnerabilities*10))*.3),e}function y(t,e){let a={version:"1.0.0",timestamp:new Date().toISOString(),projectRoot:t,attestation:{testsExecuted:e.testCount>0,coverageChecked:e.coveragePercent>0,securityScanned:e.vulnerabilities===0,qualityGatePassed:e.qualityScore>=70},metrics:e,generatedBy:"agentic-qe prove"},o=m(a);return{...a,hash:o}}function f(t){return["# Proof of Quality","",`**Generated:** ${t.timestamp}`,`**Project:** ${t.projectRoot}`,`**Hash:** \`${t.hash}\``,"","## Attestation","","| Check | Status |","|-------|--------|",`| Tests Executed | ${t.attestation.testsExecuted?"PASS":"FAIL"} |`,`| Coverage Checked | ${t.attestation.coverageChecked?"PASS":"FAIL"} |`,`| Security Scanned | ${t.attestation.securityScanned?"PASS":"FAIL"} |`,`| Quality Gate | ${t.attestation.qualityGatePassed?"PASSED":"FAILED"} |`,"","## Metrics","","| Metric | Value |","|--------|-------|",`| Tests | ${t.metrics.testCount} |`,`| Pass Rate | ${t.metrics.passRate.toFixed(1)}% |`,`| Coverage | ${t.metrics.coveragePercent.toFixed(1)}% |`,`| Vulnerabilities | ${t.metrics.vulnerabilities} |`,`| Quality Score | ${t.metrics.qualityScore}/100 |`,"","---",`*${t.generatedBy}*`].join(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import"./chunk-7ASGPJWU.js";import{Command as l}from"commander";import*as c from"crypto";import*as n from"fs";import*as r from"path";function m(t){let e=JSON.stringify(t,null,0);return c.createHash("sha256").update(e).digest("hex")}async function d(t){let e={testCount:0,passRate:0,coveragePercent:0,vulnerabilities:0,qualityScore:0,patternsUsed:0};try{let a=r.join(t,"junit.xml");if(n.existsSync(a)){let o=n.readFileSync(a,"utf-8"),s=o.match(/tests="(\d+)"/),i=o.match(/failures="(\d+)"/);if(s){e.testCount=parseInt(s[1],10);let u=i?parseInt(i[1],10):0;e.passRate=e.testCount>0?(e.testCount-u)/e.testCount*100:0}}}catch{}try{let a=r.join(t,"coverage","coverage-summary.json");if(n.existsSync(a)){let o=JSON.parse(n.readFileSync(a,"utf-8"));e.coveragePercent=o?.total?.lines?.pct??0}}catch{}try{let a=r.join(t,".agentic-qe","memory.db");n.existsSync(a)&&(e.patternsUsed=1)}catch{}return e.qualityScore=Math.round(e.passRate*.4+e.coveragePercent*.3+(e.vulnerabilities===0?100:Math.max(0,100-e.vulnerabilities*10))*.3),e}function y(t,e){let a={version:"1.0.0",timestamp:new Date().toISOString(),projectRoot:t,attestation:{testsExecuted:e.testCount>0,coverageChecked:e.coveragePercent>0,securityScanned:e.vulnerabilities===0,qualityGatePassed:e.qualityScore>=70},metrics:e,generatedBy:"agentic-qe prove"},o=m(a);return{...a,hash:o}}function f(t){return["# Proof of Quality","",`**Generated:** ${t.timestamp}`,`**Project:** ${t.projectRoot}`,`**Hash:** \`${t.hash}\``,"","## Attestation","","| Check | Status |","|-------|--------|",`| Tests Executed | ${t.attestation.testsExecuted?"PASS":"FAIL"} |`,`| Coverage Checked | ${t.attestation.coverageChecked?"PASS":"FAIL"} |`,`| Security Scanned | ${t.attestation.securityScanned?"PASS":"FAIL"} |`,`| Quality Gate | ${t.attestation.qualityGatePassed?"PASSED":"FAILED"} |`,"","## Metrics","","| Metric | Value |","|--------|-------|",`| Tests | ${t.metrics.testCount} |`,`| Pass Rate | ${t.metrics.passRate.toFixed(1)}% |`,`| Coverage | ${t.metrics.coveragePercent.toFixed(1)}% |`,`| Vulnerabilities | ${t.metrics.vulnerabilities} |`,`| Quality Score | ${t.metrics.qualityScore}/100 |`,"","---",`*${t.generatedBy}*`].join(`
3
3
  `)}async function p(t){let e=t.projectRoot??process.cwd(),a=await d(e),o=y(e,a),s=t.format==="markdown"?f(o):JSON.stringify(o,null,2);return t.output?(n.writeFileSync(t.output,s),console.log(`Quality attestation written to ${t.output}`)):console.log(s),o}function g(t,e,a){return new l("prove").description("Generate a verifiable Proof-of-Quality attestation").option("-F, --format <format>","Output format (json|markdown)","json").option("-o, --output <path>","Write attestation to file").action(async o=>{try{await p({format:o.format,output:o.output}),await e(0)}catch(s){console.error("Failed to generate proof-of-quality:",s),await e(1)}})}export{y as buildAttestation,d as collectMetrics,g as createProveCommand,f as formatMarkdown,p as handleProve,m as hashAttestation};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as h,b as i,c as j,d as k,e as l,f as m,g as n}from"./chunk-EXTVDKH7.js";import"./chunk-PD5YPC2A.js";import{a as e,b as f,d as g}from"./chunk-JTIWAUWW.js";import"./chunk-AS5WPUDR.js";import{a,b,c,h as d}from"./chunk-KV32LAKU.js";import"./chunk-SFFI3MDN.js";import"./chunk-LRE4A464.js";import"./chunk-SVXIAQRW.js";import"./chunk-PS6KLLLQ.js";import"./chunk-2CPNZVGL.js";import"./chunk-LQDAH47F.js";import"./chunk-RRELDHZY.js";import"./chunk-FONTSK2O.js";import"./chunk-6N26CWST.js";import"./chunk-CU36MONI.js";import"./chunk-TA454OEB.js";import"./chunk-OXR2FPHK.js";import"./chunk-EVIXQR4O.js";import"./chunk-DBEU5ISS.js";import"./chunk-GGKV5IQR.js";import"./chunk-ZMUVSL5Q.js";import"./chunk-WSVWVIVR.js";import"./chunk-TPFE3BAI.js";import"./chunk-OV6H3TRU.js";import"./chunk-M7PGW5Z5.js";import"./chunk-UC3RA5LW.js";import"./chunk-OJKGRB6D.js";import"./chunk-7ASGPJWU.js";export{j as AGENT_CAPABILITIES,h as DEFAULT_QE_REASONING_BANK_CONFIG,i as PRETRAINED_PATTERNS,m as QEReasoningBank,l as RELATED_DOMAINS,d as applyPatternTemplate,k as calculateAgentScores,n as createQEReasoningBank,a as detectQEDomain,b as detectQEDomains,g as generateGuidanceContext,f as getCombinedGuidance,e as getGuidance,c as mapQEDomainToAQE};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{c as l,d as u,h as d}from"./chunk-Z2IKNC5M.js";import"./chunk-YXCU4CJX.js";import{Command as w}from"commander";import e from"chalk";function P(g,o,h){return new w("quality").description("Quality assessment shortcut").option("--gate","Run quality gate evaluation").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async i=>{if(await h())try{let r=i.format;{r==="text"&&console.log(e.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{c as l,d as u,h as d}from"./chunk-ZVMAE5JD.js";import"./chunk-7ASGPJWU.js";import{Command as w}from"commander";import e from"chalk";function P(g,o,h){return new w("quality").description("Quality assessment shortcut").option("--gate","Run quality gate evaluation").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async i=>{if(await h())try{let r=i.format;{r==="text"&&console.log(e.blue(`
3
3
  Running quality gate evaluation...
4
4
  `));let m=await g.kernel.getDomainAPIAsync("quality-assessment");m||(console.log(e.red("Quality assessment domain not available")),await o(1));let f={coverage:0,testsPassing:0,criticalBugs:0,codeSmells:0,securityVulnerabilities:0,technicalDebt:0,duplications:0},y={coverage:{min:80},testsPassing:{min:95},criticalBugs:{max:0},codeSmells:{max:20},securityVulnerabilities:{max:0},technicalDebt:{max:5},duplications:{max:5}},n=await m.evaluateGate({gateName:"standard",metrics:f,thresholds:y});if(n.success&&n.value){let s=n.value,t={passed:s.passed??s.meetsThreshold??!0,score:s.score??s.grade??"N/A",checks:s.checks||[],recommendations:s.recommendations||[]};if(r==="json")l(u(t),i.output);else if(r==="markdown")l(d(t),i.output);else{let p=t.passed?e.green("\u2713 PASSED"):e.red("\u2717 FAILED");if(console.log(` Quality Gate: ${p}`),console.log(` Score: ${e.cyan(t.score)}
5
5
  `),t.checks.length>0){console.log(e.cyan(" Checks:"));for(let a of t.checks){let b=a.passed?e.green("\u2713"):e.red("\u2717");console.log(` ${b} ${a.name}: ${a.value} (threshold: ${a.threshold})`)}}if(t.recommendations&&t.recommendations.length>0){console.log(e.cyan(`
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{c as a,d as b,e as c,f as d}from"./chunk-M3EFT3XR.js";import"./chunk-S23UV7FV.js";import"./chunk-NZLJWXXM.js";import"./chunk-5YUNMBIH.js";import"./chunk-X5C73DW5.js";import"./chunk-T4RR4YMH.js";import"./chunk-P4RYVWIR.js";import"./chunk-FIQ62VOQ.js";import"./chunk-AS5WPUDR.js";import"./chunk-KV32LAKU.js";import"./chunk-LQDAH47F.js";import"./chunk-RRELDHZY.js";import"./chunk-FSUS5TV6.js";import"./chunk-FONTSK2O.js";import"./chunk-6N26CWST.js";import"./chunk-CU36MONI.js";import"./chunk-TA454OEB.js";import"./chunk-OXR2FPHK.js";import"./chunk-EVIXQR4O.js";import"./chunk-DBEU5ISS.js";import"./chunk-GGKV5IQR.js";import"./chunk-ZMUVSL5Q.js";import"./chunk-WSVWVIVR.js";import"./chunk-TPFE3BAI.js";import"./chunk-OV6H3TRU.js";import"./chunk-M7PGW5Z5.js";import"./chunk-UC3RA5LW.js";import"./chunk-OJKGRB6D.js";import"./chunk-7ASGPJWU.js";export{a as DOMAIN_GROUPS,c as QueenCoordinator,b as TASK_DOMAIN_MAP,d as createQueenCoordinator};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i}from"./chunk-563PJBDM.js";import"./chunk-SDTVHR63.js";import{a}from"./chunk-4DAOZQ3V.js";import"./chunk-YXCU4CJX.js";export{b as DEFAULT_EMBEDDING_CONFIG,e as clearEmbeddingCache,d as computeBatchEmbeddings,c as computeRealEmbedding,a as cosineSimilarity,f as getCacheStats,h as getEmbeddingDimension,g as isTransformerAvailable,i as resetInitialization};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a as b,b as c,c as d,d as e,e as f,f as g,g as h,h as i}from"./chunk-2CPNZVGL.js";import"./chunk-OXR2FPHK.js";import{a}from"./chunk-OV6H3TRU.js";import"./chunk-7ASGPJWU.js";export{b as DEFAULT_EMBEDDING_CONFIG,e as clearEmbeddingCache,d as computeBatchEmbeddings,c as computeRealEmbedding,a as cosineSimilarity,f as getCacheStats,h as getEmbeddingDimension,g as isTransformerAvailable,i as resetInitialization};
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
2
- import{b as p}from"./chunk-2VVV73PW.js";import{a as f,c as v}from"./chunk-SDTVHR63.js";import"./chunk-YXCU4CJX.js";v();import{existsSync as n,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as d,dirname as h}from"path";var l=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=p()}async install(){let r={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("roocode"),e=d(this.projectRoot,t.path);if(r.configPath=e,!n(e)||this.overwrite){let i=h(e);if(n(i)||m(i,{recursive:!0}),n(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("roocode"),o=d(this.projectRoot,s.path);if(r.modePath=o,!n(o)||this.overwrite){let i=h(o);if(n(i)||m(i,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,s.content);a(o,c)}else a(o,s.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Roo Code installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),s=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,s.mcpServers),JSON.stringify(e,null,2)+`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{b as p}from"./chunk-HJEWQD2B.js";import{a as f,c as v}from"./chunk-OXR2FPHK.js";import"./chunk-7ASGPJWU.js";v();import{existsSync as n,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as d,dirname as h}from"path";var l=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=p()}async install(){let r={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("roocode"),e=d(this.projectRoot,t.path);if(r.configPath=e,!n(e)||this.overwrite){let i=h(e);if(n(i)||m(i,{recursive:!0}),n(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("roocode"),o=d(this.projectRoot,s.path);if(r.modePath=o,!n(o)||this.overwrite){let i=h(o);if(n(i)||m(i,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,s.content);a(o,c)}else a(o,s.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Roo Code installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),s=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,s.mcpServers),JSON.stringify(e,null,2)+`
3
3
  `}catch{return t}}mergeExistingModes(r,t){try{let e=JSON.parse(u(r,"utf-8")),s=JSON.parse(t);if(!Array.isArray(e))return t;let o=e.filter(i=>i.slug!=="qe-engineer");return o.push(...s),JSON.stringify(o,null,2)+`
4
4
  `}catch{return t}}};function P(g){return new l(g)}export{l as RooCodeInstaller,P as createRooCodeInstaller};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a,b,c}from"./chunk-PRIWFNVU.js";import"./chunk-SJLDTV5B.js";import"./chunk-GBLX5XOH.js";import"./chunk-D5GIV6O7.js";import"./chunk-WAWCNUIJ.js";import"./chunk-CU36MONI.js";import"./chunk-OXR2FPHK.js";import"./chunk-7ASGPJWU.js";export{a as ModelRouter,b as createModelRouter,c as createModelRouterWithAgentBooster};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.3");process.exit(0)}
2
+ import{a,b}from"./chunk-OZNJZMQL.js";import"./chunk-QAXJOCTW.js";import"./chunk-53YFAERL.js";import"./chunk-WLK5UVRJ.js";import"./chunk-LQDAH47F.js";import"./chunk-RRELDHZY.js";import"./chunk-FONTSK2O.js";import"./chunk-6N26CWST.js";import"./chunk-CU36MONI.js";import"./chunk-OXR2FPHK.js";import"./chunk-DBEU5ISS.js";import"./chunk-GGKV5IQR.js";import"./chunk-ZMUVSL5Q.js";import"./chunk-WSVWVIVR.js";import"./chunk-TPFE3BAI.js";import"./chunk-OV6H3TRU.js";import"./chunk-M7PGW5Z5.js";import"./chunk-UC3RA5LW.js";import"./chunk-OJKGRB6D.js";import"./chunk-7ASGPJWU.js";export{a as RoutingFeedbackCollector,b as createRoutingFeedbackCollector};