agentic-qe 3.9.6 → 3.9.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +38 -0
  3. package/dist/cli/bundle.js +5 -5
  4. package/dist/cli/chunks/adapter-GE3RSG32.js +2 -0
  5. package/dist/cli/chunks/{agent-booster-wasm-ID2COJCQ.js → agent-booster-wasm-MXTWTD4D.js} +2 -2
  6. package/dist/cli/chunks/{agent-handler-EWK6FHKU.js → agent-handler-6NEP2BOA.js} +2 -2
  7. package/dist/cli/chunks/{agent-memory-branch-BDKB7HER.js → agent-memory-branch-SAPEIGE2.js} +2 -2
  8. package/dist/cli/chunks/aqe-learning-engine-IYL6TK6E.js +2 -0
  9. package/dist/cli/chunks/{audit-EB62PPY4.js → audit-53LCI6R3.js} +2 -2
  10. package/dist/cli/chunks/base-L3G3GEZY.js +2 -0
  11. package/dist/cli/chunks/{better-sqlite3-C4HK6YT3.js → better-sqlite3-UZSKFGCK.js} +2 -2
  12. package/dist/cli/chunks/{brain-handler-QLIHJDGD.js → brain-handler-67NDDXVO.js} +3 -3
  13. package/dist/cli/chunks/{branch-enumerator-HWWHSETZ.js → branch-enumerator-IUIGYEK5.js} +2 -2
  14. package/dist/cli/chunks/{browser-PEMYUQ6B.js → browser-UFUF65LQ.js} +2 -2
  15. package/dist/cli/chunks/browser-workflow-7KTCY5FI.js +2 -0
  16. package/dist/cli/chunks/{chunk-H3KGRTY2.js → chunk-2SJQ3CYN.js} +9 -9
  17. package/dist/cli/chunks/{chunk-G3VIZON2.js → chunk-2TRWUJWG.js} +2 -2
  18. package/dist/cli/chunks/{chunk-L6HQVZQL.js → chunk-3DXO5CWI.js} +1 -1
  19. package/dist/cli/chunks/{chunk-ARRJKSDK.js → chunk-3KX7CQEM.js} +1 -1
  20. package/dist/cli/chunks/{chunk-VMDSTKVR.js → chunk-426OO3RH.js} +2 -2
  21. package/dist/cli/chunks/{chunk-GXVUDSYW.js → chunk-4B5IYFKE.js} +2 -2
  22. package/dist/cli/chunks/{chunk-67WBMX7K.js → chunk-4NHE7AJE.js} +1 -1
  23. package/dist/cli/chunks/{chunk-C723FDLL.js → chunk-52MUZGZF.js} +2 -2
  24. package/dist/cli/chunks/{chunk-4NYVSHN3.js → chunk-5EOM3W6Q.js} +2 -2
  25. package/dist/cli/chunks/{chunk-WQ76RMU3.js → chunk-6MMRZYYS.js} +3 -3
  26. package/dist/cli/chunks/{chunk-BHOJLQLF.js → chunk-6OKXGDT3.js} +2 -2
  27. package/dist/cli/chunks/{chunk-TSZ6VMCF.js → chunk-6ULPQTIE.js} +2 -2
  28. package/dist/cli/chunks/{chunk-6X6NWAVQ.js → chunk-7GPYOMVY.js} +1 -1
  29. package/dist/cli/chunks/{chunk-NA5ZOZIF.js → chunk-7OPVTN5W.js} +2 -2
  30. package/dist/cli/chunks/{chunk-H4J456F2.js → chunk-7TKZ6LK6.js} +1 -1
  31. package/dist/cli/chunks/{chunk-Z4UUJUZO.js → chunk-A5VULTCD.js} +1 -1
  32. package/dist/cli/chunks/{chunk-MRDXDXPW.js → chunk-AHB2F42G.js} +1 -1
  33. package/dist/cli/chunks/{chunk-O65ZAUG3.js → chunk-APPVAGD5.js} +1 -1
  34. package/dist/cli/chunks/{chunk-ESFKNND3.js → chunk-AT6LBLUV.js} +2 -2
  35. package/dist/cli/chunks/{chunk-AFOGTLSY.js → chunk-BJKRAFS2.js} +2 -2
  36. package/dist/cli/chunks/{chunk-3BAC7NLV.js → chunk-BPYWDM2Y.js} +3 -3
  37. package/dist/cli/chunks/{chunk-ZV6CCRP2.js → chunk-BTZEKSWH.js} +2 -2
  38. package/dist/cli/chunks/{chunk-H7OP3RI2.js → chunk-BWNH22V2.js} +1 -1
  39. package/dist/cli/chunks/{chunk-JEF3S4ER.js → chunk-CDFYF33M.js} +2 -2
  40. package/dist/cli/chunks/{chunk-4H3YCKAI.js → chunk-D2C4XNF5.js} +4 -4
  41. package/dist/cli/chunks/{chunk-3U3NUFII.js → chunk-D3KORDD5.js} +1 -1
  42. package/dist/cli/chunks/{chunk-K5RE6ODJ.js → chunk-DKBXIBRS.js} +2 -2
  43. package/dist/cli/chunks/{chunk-AJX44TJ7.js → chunk-DL46KSFX.js} +2 -2
  44. package/dist/cli/chunks/{chunk-EMKI4ZV5.js → chunk-DS3XAGGL.js} +2 -2
  45. package/dist/cli/chunks/{chunk-YV34KLBV.js → chunk-ECRYU5XG.js} +2 -2
  46. package/dist/cli/chunks/{chunk-RZLRPLRC.js → chunk-EFHR7LML.js} +2 -2
  47. package/dist/cli/chunks/{chunk-VJKIPTA2.js → chunk-EIGXGMOR.js} +1 -1
  48. package/dist/cli/chunks/{chunk-H5OYJKPR.js → chunk-EL2WLSUI.js} +2 -2
  49. package/dist/cli/chunks/{chunk-7CSZCRSS.js → chunk-FBVEHGNE.js} +3 -3
  50. package/dist/cli/chunks/{chunk-NOK2ICQT.js → chunk-FHBIJBZ3.js} +2 -2
  51. package/dist/cli/chunks/{chunk-7EDVNITA.js → chunk-FJEIX3IS.js} +2 -2
  52. package/dist/cli/chunks/{chunk-BKCIW3O2.js → chunk-FKJ4XZ6E.js} +2 -2
  53. package/dist/cli/chunks/{chunk-WFWVSI2W.js → chunk-FOCGOVIM.js} +2 -2
  54. package/dist/cli/chunks/{chunk-V2IUGAJ7.js → chunk-GGPGY5QT.js} +2 -2
  55. package/dist/cli/chunks/{chunk-MX3ORXM3.js → chunk-GOG6L2F7.js} +2 -2
  56. package/dist/cli/chunks/{chunk-SYYGXU7I.js → chunk-HE5VY2BI.js} +2 -2
  57. package/dist/cli/chunks/{chunk-K52WNOTU.js → chunk-HEENVPYF.js} +3 -3
  58. package/dist/cli/chunks/{chunk-46442R6Q.js → chunk-HFPT7QXQ.js} +2 -2
  59. package/dist/cli/chunks/{chunk-QE255FHS.js → chunk-HVJXXGB4.js} +4 -4
  60. package/dist/cli/chunks/{chunk-HZSYBKRI.js → chunk-HWDE4RB3.js} +2 -2
  61. package/dist/cli/chunks/{chunk-Y65KKN4T.js → chunk-INJPS7RF.js} +1 -1
  62. package/dist/cli/chunks/{chunk-2FTTRGRS.js → chunk-IQLFWO5U.js} +2 -2
  63. package/dist/cli/chunks/{chunk-YI54PU4P.js → chunk-JJSJSQNJ.js} +1 -1
  64. package/dist/cli/chunks/{chunk-XQAZHVHD.js → chunk-JNEG6DKU.js} +1 -1
  65. package/dist/cli/chunks/{chunk-SQCNABS4.js → chunk-JRHKFRUB.js} +2 -2
  66. package/dist/cli/chunks/{chunk-EJSRKZ5M.js → chunk-JZYCZMHN.js} +2 -2
  67. package/dist/cli/chunks/{chunk-AMLREU5W.js → chunk-KHEAWN23.js} +2 -2
  68. package/dist/cli/chunks/{chunk-NPNGSE7X.js → chunk-KHH5UJXY.js} +2 -2
  69. package/dist/cli/chunks/{chunk-7B46Q5OU.js → chunk-KLLHSXIC.js} +2 -2
  70. package/dist/cli/chunks/{chunk-MAZWSPEQ.js → chunk-KO5HO6MY.js} +2 -2
  71. package/dist/cli/chunks/{chunk-E5J3GKCP.js → chunk-KZSZHP32.js} +2 -2
  72. package/dist/cli/chunks/{chunk-JB3G5ZLL.js → chunk-LHGZRKPO.js} +2 -2
  73. package/dist/cli/chunks/{chunk-JDGUTBC3.js → chunk-LP6EQI2P.js} +2 -2
  74. package/dist/cli/chunks/{chunk-TPXS5KEC.js → chunk-LPLCT2HH.js} +2 -2
  75. package/dist/cli/chunks/{chunk-5AXU6KCI.js → chunk-LZ34CKYE.js} +2 -2
  76. package/dist/cli/chunks/{chunk-Z5IOTEQI.js → chunk-MR7V7QVL.js} +2 -2
  77. package/dist/cli/chunks/{chunk-K6XC52U3.js → chunk-MUEFXLGX.js} +1 -1
  78. package/dist/cli/chunks/chunk-N5SLJOBK.js +2 -0
  79. package/dist/cli/chunks/{chunk-MV52OH7P.js → chunk-NJ5IC6ZR.js} +1 -1
  80. package/dist/cli/chunks/{chunk-XKU2LJIM.js → chunk-NKX2Z546.js} +1 -1
  81. package/dist/cli/chunks/{chunk-QGEZJKVO.js → chunk-OURDPRGM.js} +1 -1
  82. package/dist/cli/chunks/{chunk-HUPIHL55.js → chunk-PFTR6XAO.js} +2 -2
  83. package/dist/cli/chunks/{chunk-7B3IZBNN.js → chunk-PHBE2VBN.js} +2 -2
  84. package/dist/cli/chunks/{chunk-KIEXP4F3.js → chunk-PMZJ54WX.js} +3 -3
  85. package/dist/cli/chunks/{chunk-64SU2UFL.js → chunk-QI5VGEKC.js} +2 -2
  86. package/dist/cli/chunks/{chunk-YQ7X6LKA.js → chunk-QKJ4LUAM.js} +2 -2
  87. package/dist/cli/chunks/{chunk-P4X6YTOY.js → chunk-RGJ4RMUR.js} +8 -8
  88. package/dist/cli/chunks/{chunk-XOTBE543.js → chunk-SIIYQLKH.js} +2 -2
  89. package/dist/cli/chunks/{chunk-3VBPPW7H.js → chunk-SMKRBNO7.js} +1 -1
  90. package/dist/cli/chunks/{chunk-UB53OWSL.js → chunk-SP3X35XC.js} +1 -1
  91. package/dist/cli/chunks/{chunk-EVRJS6CN.js → chunk-SQQ57TSJ.js} +2 -2
  92. package/dist/cli/chunks/{chunk-Y2BEI3DL.js → chunk-SQZ3H6WR.js} +3 -3
  93. package/dist/cli/chunks/{chunk-775KESYW.js → chunk-STASZVMY.js} +2 -2
  94. package/dist/cli/chunks/{chunk-YWWQRNKI.js → chunk-SURZYSSL.js} +1 -1
  95. package/dist/cli/chunks/{chunk-TG7PATSN.js → chunk-T7R5NXJW.js} +2 -2
  96. package/dist/cli/chunks/{chunk-CU3LGMOK.js → chunk-TD2WOW75.js} +2 -2
  97. package/dist/cli/chunks/{chunk-7MD7PQYH.js → chunk-TLTRL32T.js} +1 -1
  98. package/dist/cli/chunks/{chunk-3WQ7MLAJ.js → chunk-TT2YXNHH.js} +4 -4
  99. package/dist/cli/chunks/{chunk-DAWI2HRN.js → chunk-UDBSEFUT.js} +2 -2
  100. package/dist/cli/chunks/{chunk-N5CEEWWJ.js → chunk-UEFAPTBV.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5A5ECZCN.js → chunk-URBXUDY3.js} +2 -2
  102. package/dist/cli/chunks/{chunk-LFTQYU65.js → chunk-UXCEJ3AV.js} +2 -2
  103. package/dist/cli/chunks/{chunk-2DGTT6D2.js → chunk-VAKJOTGU.js} +2 -2
  104. package/dist/cli/chunks/{chunk-RD5N2722.js → chunk-VMWLVRJO.js} +2 -2
  105. package/dist/cli/chunks/{chunk-FZ77DJFC.js → chunk-W4HUWBPK.js} +2 -2
  106. package/dist/cli/chunks/{chunk-T4L6MHRW.js → chunk-W4Y4GFRB.js} +1 -1
  107. package/dist/cli/chunks/{chunk-CLVHHUZB.js → chunk-WAP7ROO5.js} +2 -2
  108. package/dist/cli/chunks/{chunk-MROCXAXJ.js → chunk-WLYSZV5U.js} +2 -2
  109. package/dist/cli/chunks/{chunk-CQNNNR53.js → chunk-WS4OVAWU.js} +2 -2
  110. package/dist/cli/chunks/{chunk-NSRIYP76.js → chunk-WV3R5JFE.js} +2 -2
  111. package/dist/cli/chunks/{chunk-PKD6LEQZ.js → chunk-XB2GVTY6.js} +1 -1
  112. package/dist/cli/chunks/{chunk-LZ5LS4LF.js → chunk-XD4UFF2Y.js} +1 -1
  113. package/dist/cli/chunks/{chunk-QYGI32T4.js → chunk-XOHRM3M7.js} +3 -3
  114. package/dist/cli/chunks/{chunk-QBQ52YUU.js → chunk-XY5FMZRA.js} +2 -2
  115. package/dist/cli/chunks/{chunk-QWVILMUX.js → chunk-YHZWNT45.js} +2 -2
  116. package/dist/cli/chunks/{chunk-3TAJSNCZ.js → chunk-YIVZ5Z4V.js} +1 -1
  117. package/dist/cli/chunks/{chunk-5CKG46BM.js → chunk-YR5ZNQT2.js} +2 -2
  118. package/dist/cli/chunks/{chunk-CJ6GN5QT.js → chunk-YTF5G3RQ.js} +2 -2
  119. package/dist/cli/chunks/{chunk-V3D6AA2P.js → chunk-YV2PVXJE.js} +1 -1
  120. package/dist/cli/chunks/{chunk-6T6TPZCK.js → chunk-ZEFDSMF4.js} +2 -2
  121. package/dist/cli/chunks/{chunk-YOLOT7MX.js → chunk-ZETZATNY.js} +2 -2
  122. package/dist/cli/chunks/{chunk-JRPYXCDT.js → chunk-ZLQYGO6N.js} +1 -1
  123. package/dist/cli/chunks/{chunk-KI4W6CVC.js → chunk-ZSXSUUBS.js} +1 -1
  124. package/dist/cli/chunks/{chunk-WOR67NKR.js → chunk-ZV7FGZNJ.js} +2 -2
  125. package/dist/cli/chunks/{chunk-LSFJKCAQ.js → chunk-ZWAJV4SN.js} +2 -2
  126. package/dist/cli/chunks/{ci-6L22RUNC.js → ci-F4F3SDHP.js} +2 -2
  127. package/dist/cli/chunks/{ci-output-C2PAMUXM.js → ci-output-4SUMOQGO.js} +2 -2
  128. package/dist/cli/chunks/{claude-flow-setup-S3HHSSIM.js → claude-flow-setup-NKXPDFMJ.js} +2 -2
  129. package/dist/cli/chunks/client-3DPPDO2H.js +2 -0
  130. package/dist/cli/chunks/{cline-installer-YIXOIHBL.js → cline-installer-3FMNXEKM.js} +2 -2
  131. package/dist/cli/chunks/{code-QVFF72Z4.js → code-5QEDZNKI.js} +2 -2
  132. package/dist/cli/chunks/{code-index-extractor-BRNK2X4M.js → code-index-extractor-RD5EAOLE.js} +2 -2
  133. package/dist/cli/chunks/{codex-installer-TLRH3SG7.js → codex-installer-UU4O2FIE.js} +2 -2
  134. package/dist/cli/chunks/{completions-A46MED6L.js → completions-CS6RJLYZ.js} +2 -2
  135. package/dist/cli/chunks/{complexity-analyzer-FJSG676O.js → complexity-analyzer-U4DE2QTP.js} +2 -2
  136. package/dist/cli/chunks/{continuedev-installer-7HHND63H.js → continuedev-installer-E55EG2TB.js} +2 -2
  137. package/dist/cli/chunks/{copilot-installer-UQ4IEG4H.js → copilot-installer-TVJUX3AZ.js} +2 -2
  138. package/dist/cli/chunks/{cost-tracker-R6FXO2MO.js → cost-tracker-IAKDLDJH.js} +2 -2
  139. package/dist/cli/chunks/{coverage-3AGGT36D.js → coverage-LX7UIEKV.js} +3 -3
  140. package/dist/cli/chunks/cross-domain-router-JOYTUBFT.js +2 -0
  141. package/dist/cli/chunks/{cursor-installer-7PABDYDI.js → cursor-installer-2NJ7MK23.js} +2 -2
  142. package/dist/cli/chunks/{daemon-YTCKYJB4.js → daemon-T4CPOFHM.js} +3 -3
  143. package/dist/cli/chunks/{dag-attention-scheduler-LZZ4O2PT.js → dag-attention-scheduler-GAPYYUHZ.js} +2 -2
  144. package/dist/cli/chunks/{detect-OBCGJIYW.js → detect-RU5LBCCI.js} +2 -2
  145. package/dist/cli/chunks/{domain-handler-5PHN6YQM.js → domain-handler-LKPDVPF6.js} +2 -2
  146. package/dist/cli/chunks/{domain-transfer-K6YSBC2L.js → domain-transfer-Q76ITWBK.js} +2 -2
  147. package/dist/cli/chunks/dream-IF2HCRW4.js +2 -0
  148. package/dist/cli/chunks/esm-node-LNRP5BNU.js +2 -0
  149. package/dist/cli/chunks/{eval-UAAFW3YU.js → eval-TFFIZGTW.js} +2 -2
  150. package/dist/cli/chunks/{fast-paths-7IFG4BYW.js → fast-paths-V6KA3VWH.js} +2 -2
  151. package/dist/cli/chunks/{feature-flags-AEO5C73R.js → feature-flags-DWS4XL2P.js} +2 -2
  152. package/dist/cli/chunks/{feature-flags-TVJAGLLH.js → feature-flags-MYSY53UU.js} +2 -2
  153. package/dist/cli/chunks/{file-discovery-STTTDBN3.js → file-discovery-AMKZRFLT.js} +2 -2
  154. package/dist/cli/chunks/{fleet-L6RVZQ2B.js → fleet-B2BJFKEV.js} +3 -3
  155. package/dist/cli/chunks/{gnn-wrapper-W4QHVBUD.js → gnn-wrapper-SOJHQ7VC.js} +2 -2
  156. package/dist/cli/chunks/{heartbeat-handler-3KZOB7MZ.js → heartbeat-handler-O7FF6NRE.js} +4 -4
  157. package/dist/cli/chunks/{heartbeat-scheduler-IR57JOZR.js → heartbeat-scheduler-WOGW5R7J.js} +2 -2
  158. package/dist/cli/chunks/hnsw-adapter-UPX4AXOQ.js +2 -0
  159. package/dist/cli/chunks/hnsw-index-CSI2EXXR.js +2 -0
  160. package/dist/cli/chunks/{hnsw-legacy-bridge-5BYAJDVC.js → hnsw-legacy-bridge-CC5YS47X.js} +2 -2
  161. package/dist/cli/chunks/{hnswlib-node-MUXAWCUE.js → hnswlib-node-FTWYRETS.js} +2 -2
  162. package/dist/cli/chunks/{hooks-QT4NVEDG.js → hooks-ETOFFBMV.js} +6 -6
  163. package/dist/cli/chunks/{hypergraph-engine-MLLU5WQB.js → hypergraph-engine-FGAHFWFO.js} +2 -2
  164. package/dist/cli/chunks/{hypergraph-handler-LJWRQ2WW.js → hypergraph-handler-GNWJD7E3.js} +3 -3
  165. package/dist/cli/chunks/impact-analyzer-2YVBHMES.js +2 -0
  166. package/dist/cli/chunks/init-handler-BEYOLKQO.js +69 -0
  167. package/dist/cli/chunks/init-wizard-V6GZQMMR.js +2 -0
  168. package/dist/cli/chunks/kernel-EHJ4SP2Y.js +2 -0
  169. package/dist/cli/chunks/{kilocode-installer-5MAYAROV.js → kilocode-installer-ED6LYSEM.js} +2 -2
  170. package/dist/cli/chunks/{kiro-installer-3JJ7TSXH.js → kiro-installer-NG77T5YR.js} +2 -2
  171. package/dist/cli/chunks/knowledge-graph-ZYXBWGKL.js +2 -0
  172. package/dist/cli/chunks/{learning-G7MWQMRY.js → learning-P3WY3LTI.js} +3 -3
  173. package/dist/cli/chunks/{llm-router-HYK5VS4A.js → llm-router-ETSFMOWS.js} +2 -2
  174. package/dist/cli/chunks/{load-YVN3F5ZP.js → load-PP3GVQT7.js} +2 -2
  175. package/dist/cli/chunks/load-test-VDZEYGKV.js +2 -0
  176. package/dist/cli/chunks/{mcp-I43GRN5E.js → mcp-B2VX7EKL.js} +2 -2
  177. package/dist/cli/chunks/{memory-TMKTUI37.js → memory-SBZQ6MZ4.js} +5 -5
  178. package/dist/cli/chunks/memory-backend-IB3BU4VM.js +2 -0
  179. package/dist/cli/chunks/{memory-handlers-YFJOLCGN.js → memory-handlers-5RMGG2CR.js} +2 -2
  180. package/dist/cli/chunks/{opencode-installer-KYDQUOAW.js → opencode-installer-PIDIFO2L.js} +2 -2
  181. package/dist/cli/chunks/{orchestrator-C6XRSC6Z.js → orchestrator-FSGUODZI.js} +5 -5
  182. package/dist/cli/chunks/{pipeline-IULH5B62.js → pipeline-BQ5MWZPT.js} +2 -2
  183. package/dist/cli/chunks/{platform-CACMGVB3.js → platform-6EJK4QMD.js} +2 -2
  184. package/dist/cli/chunks/{plugin-6VSTK54C.js → plugin-EDGOMUJY.js} +2 -2
  185. package/dist/cli/chunks/{prime-radiant-advanced-wasm-UA6FGPKX.js → prime-radiant-advanced-wasm-4S6FYKPP.js} +2 -2
  186. package/dist/cli/chunks/protocol-executor-H2ZG7JBJ.js +2 -0
  187. package/dist/cli/chunks/{protocol-handler-UYJISQUT.js → protocol-handler-ETM7PMQU.js} +2 -2
  188. package/dist/cli/chunks/{prove-H7PAIHGE.js → prove-YUBORZAP.js} +2 -2
  189. package/dist/cli/chunks/qe-reasoning-bank-ZCSHSKZU.js +2 -0
  190. package/dist/cli/chunks/{quality-NT3N4UDM.js → quality-XPZDC5FJ.js} +2 -2
  191. package/dist/cli/chunks/queen-coordinator-NEC373VS.js +2 -0
  192. package/dist/cli/chunks/{real-embeddings-K46PTHOR.js → real-embeddings-KTDUTUJL.js} +2 -2
  193. package/dist/cli/chunks/{roocode-installer-K47KSTXW.js → roocode-installer-WADVKI3P.js} +2 -2
  194. package/dist/cli/chunks/router-3PP5XRTD.js +2 -0
  195. package/dist/cli/chunks/routing-feedback-JNUFV2X3.js +2 -0
  196. package/dist/cli/chunks/{routing-handler-5RXV3FRV.js → routing-handler-OOPOYHEV.js} +2 -2
  197. package/dist/cli/chunks/{ruvector-commands-V46KRNUZ.js → ruvector-commands-UPEZL4OK.js} +2 -2
  198. package/dist/cli/chunks/{rvf-dual-writer-YX5K3XO7.js → rvf-dual-writer-TOBBCJ7K.js} +2 -2
  199. package/dist/cli/chunks/{rvf-migration-adapter-SURDRXWQ.js → rvf-migration-adapter-U7UM2U36.js} +2 -2
  200. package/dist/cli/chunks/{rvf-migration-coordinator-FMUHUWTB.js → rvf-migration-coordinator-CUX3EU2X.js} +2 -2
  201. package/dist/cli/chunks/rvf-native-adapter-PTOZXG4W.js +2 -0
  202. package/dist/cli/chunks/safe-db-CGYNYUES.js +2 -0
  203. package/dist/cli/chunks/schedule-NRN4WOHX.js +2 -0
  204. package/dist/cli/chunks/scheduler-DRAQGYLL.js +2 -0
  205. package/dist/cli/chunks/{security-ENEWXTNE.js → security-AQ4N5YKV.js} +3 -3
  206. package/dist/cli/chunks/shared-rvf-adapter-6UVVDOHK.js +2 -0
  207. package/dist/cli/chunks/{shared-rvf-dual-writer-KJ67FATL.js → shared-rvf-dual-writer-OKRIHVSY.js} +2 -2
  208. package/dist/cli/chunks/sqlite-persistence-3WG7PBPL.js +2 -0
  209. package/dist/cli/chunks/{status-handler-CEMWQKE6.js → status-handler-HSJLJPNG.js} +2 -2
  210. package/dist/cli/chunks/{structural-health-B4VGYG4F.js → structural-health-KWZAS7ON.js} +2 -2
  211. package/dist/cli/chunks/{sync-P7PLECMB.js → sync-6L5Z4IWH.js} +2 -2
  212. package/dist/cli/chunks/{task-handler-YGKMS5E2.js → task-handler-KEAIPB6G.js} +2 -2
  213. package/dist/cli/chunks/{task-handlers-LKTBRIPS.js → task-handlers-BPDN6OSM.js} +2 -2
  214. package/dist/cli/chunks/{test-ZWWGVM5X.js → test-PICO6RLU.js} +4 -4
  215. package/dist/cli/chunks/{test-scheduling-HTFVIWWL.js → test-scheduling-BI3R3DX5.js} +3 -3
  216. package/dist/cli/chunks/{token-bootstrap-7VYNREQH.js → token-bootstrap-KMQC6ALU.js} +2 -2
  217. package/dist/cli/chunks/{token-usage-D67GP7FV.js → token-usage-QGDX7MLB.js} +2 -2
  218. package/dist/cli/chunks/{transformers-CI3CZC2C.js → transformers-UNRYJSIU.js} +2 -2
  219. package/dist/cli/chunks/{tree-sitter-wasm-parser-BMRWIP7P.js → tree-sitter-wasm-parser-U22JYPOG.js} +2 -2
  220. package/dist/cli/chunks/{types-SAPPKMCS.js → types-CYXAGOY5.js} +2 -2
  221. package/dist/cli/chunks/unified-memory-EXRANFUS.js +2 -0
  222. package/dist/cli/chunks/unified-memory-hnsw-GB752D44.js +2 -0
  223. package/dist/cli/chunks/unified-persistence-V2B3YWFD.js +2 -0
  224. package/dist/cli/chunks/{validate-UZL2Y3GR.js → validate-IUY5BWAV.js} +2 -2
  225. package/dist/cli/chunks/{validate-swarm-ILNS64DZ.js → validate-swarm-FXFKSEOI.js} +2 -2
  226. package/dist/cli/chunks/{vibium-CJMPXUAU.js → vibium-DKZ64NR3.js} +2 -2
  227. package/dist/cli/chunks/visual-security-YMPI7X7V.js +2 -0
  228. package/dist/cli/chunks/{web-tree-sitter-HO5UYPPH.js → web-tree-sitter-WQDTN5CV.js} +2 -2
  229. package/dist/cli/chunks/{windsurf-installer-TEXMCEBB.js → windsurf-installer-O5WOBFOQ.js} +2 -2
  230. package/dist/cli/chunks/witness-chain-7LIPUVMI.js +2 -0
  231. package/dist/cli/chunks/{witness-chain-TF35D7QS.js → witness-chain-F7WXEVJA.js} +2 -2
  232. package/dist/cli/chunks/{workflow-APRDB3SB.js → workflow-47524I5G.js} +4 -4
  233. package/dist/cli/chunks/workflow-orchestrator-QPIAR4LI.js +2 -0
  234. package/dist/cli/chunks/{wrappers-VGV5RU5Q.js → wrappers-MP2HWQD7.js} +2 -2
  235. package/dist/cli/commands/init.js +1 -1
  236. package/dist/cli/handlers/init-handler.d.ts +53 -0
  237. package/dist/cli/handlers/init-handler.js +53 -3
  238. package/dist/init/phases/06-code-intelligence.d.ts +14 -9
  239. package/dist/init/phases/06-code-intelligence.js +63 -28
  240. package/dist/init/phases/phase-interface.d.ts +16 -4
  241. package/dist/mcp/bundle.js +1 -1
  242. package/package.json +1 -1
  243. package/dist/cli/chunks/adapter-XV7RUOO7.js +0 -2
  244. package/dist/cli/chunks/aqe-learning-engine-Q5CC43GW.js +0 -2
  245. package/dist/cli/chunks/base-UL4PX45P.js +0 -2
  246. package/dist/cli/chunks/browser-workflow-K77KPDRF.js +0 -2
  247. package/dist/cli/chunks/chunk-MA7OLK56.js +0 -2
  248. package/dist/cli/chunks/client-KXLRKXSG.js +0 -2
  249. package/dist/cli/chunks/cross-domain-router-I2WPLKVN.js +0 -2
  250. package/dist/cli/chunks/dream-BH35JQRS.js +0 -2
  251. package/dist/cli/chunks/esm-node-VI5DSKCM.js +0 -2
  252. package/dist/cli/chunks/hnsw-adapter-2SFTC2VH.js +0 -2
  253. package/dist/cli/chunks/hnsw-index-OBEYJRMU.js +0 -2
  254. package/dist/cli/chunks/impact-analyzer-C5SKESHG.js +0 -2
  255. package/dist/cli/chunks/init-handler-MKAZHZJS.js +0 -68
  256. package/dist/cli/chunks/init-wizard-DV34KMTN.js +0 -2
  257. package/dist/cli/chunks/kernel-3HL4J5WJ.js +0 -2
  258. package/dist/cli/chunks/knowledge-graph-XPFESDWZ.js +0 -2
  259. package/dist/cli/chunks/load-test-EF3BRFGO.js +0 -2
  260. package/dist/cli/chunks/memory-backend-FJDNXX6N.js +0 -2
  261. package/dist/cli/chunks/protocol-executor-OFL7H2VR.js +0 -2
  262. package/dist/cli/chunks/qe-reasoning-bank-4NWLHIEM.js +0 -2
  263. package/dist/cli/chunks/queen-coordinator-I7YDKGZD.js +0 -2
  264. package/dist/cli/chunks/router-LNGYBIC4.js +0 -2
  265. package/dist/cli/chunks/routing-feedback-4RFHNTYV.js +0 -2
  266. package/dist/cli/chunks/rvf-native-adapter-7REIX6DO.js +0 -2
  267. package/dist/cli/chunks/safe-db-SVN2BQFW.js +0 -2
  268. package/dist/cli/chunks/schedule-S6Z3DNRK.js +0 -2
  269. package/dist/cli/chunks/scheduler-BE5RHB4R.js +0 -2
  270. package/dist/cli/chunks/shared-rvf-adapter-PNVIYEDK.js +0 -2
  271. package/dist/cli/chunks/sqlite-persistence-XBTALZ2S.js +0 -2
  272. package/dist/cli/chunks/unified-memory-OYIJOZ2E.js +0 -2
  273. package/dist/cli/chunks/unified-memory-hnsw-JRWF6EEB.js +0 -2
  274. package/dist/cli/chunks/unified-persistence-OOUATKAN.js +0 -2
  275. package/dist/cli/chunks/visual-security-77T3APRH.js +0 -2
  276. package/dist/cli/chunks/witness-chain-QIARNA6D.js +0 -2
  277. package/dist/cli/chunks/workflow-orchestrator-IRZVM4MZ.js +0 -2
@@ -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.6");process.exit(0)}
2
- import{c as a,d as c}from"./chunk-H3KGRTY2.js";import"./chunk-7CSZCRSS.js";import"./chunk-YOLOT7MX.js";import"./chunk-H5OYJKPR.js";import"./chunk-JEF3S4ER.js";import"./chunk-XQAZHVHD.js";import"./chunk-V3D6AA2P.js";import"./chunk-CQNNNR53.js";import"./chunk-NA5ZOZIF.js";import"./chunk-ZV6CCRP2.js";import"./chunk-FZ77DJFC.js";import"./chunk-Y65KKN4T.js";import"./chunk-TSZ6VMCF.js";import"./chunk-XOTBE543.js";import"./chunk-WFWVSI2W.js";import"./chunk-CJ6GN5QT.js";import"./chunk-AFOGTLSY.js";import"./chunk-PKD6LEQZ.js";import"./chunk-64SU2UFL.js";import"./chunk-LFTQYU65.js";import"./chunk-3U3NUFII.js";import"./chunk-RZLRPLRC.js";import"./chunk-QGEZJKVO.js";import"./chunk-P4X6YTOY.js";import"./chunk-XKU2LJIM.js";import"./chunk-Z4UUJUZO.js";import"./chunk-Y2BEI3DL.js";import"./chunk-MRDXDXPW.js";import"./chunk-JDGUTBC3.js";import"./chunk-6T6TPZCK.js";import"./chunk-MAZWSPEQ.js";import"./chunk-HZSYBKRI.js";import"./chunk-6X6NWAVQ.js";import"./chunk-QBQ52YUU.js";import"./chunk-K52WNOTU.js";import"./chunk-7MD7PQYH.js";import"./chunk-HUPIHL55.js";import"./chunk-H7OP3RI2.js";import"./chunk-EVRJS6CN.js";import"./chunk-K6XC52U3.js";import{a as m,b as R,d as $,e as y,f as g,i as b}from"./chunk-WOR67NKR.js";import"./chunk-MV52OH7P.js";import"./chunk-QYGI32T4.js";import"./chunk-3WQ7MLAJ.js";import"./chunk-AMLREU5W.js";import"./chunk-3BAC7NLV.js";import"./chunk-DAWI2HRN.js";import"./chunk-WQ76RMU3.js";import"./chunk-4H3YCKAI.js";import"./chunk-L6HQVZQL.js";import"./chunk-O65ZAUG3.js";import"./chunk-H4J456F2.js";import"./chunk-MX3ORXM3.js";import"./chunk-NOK2ICQT.js";import"./chunk-TPXS5KEC.js";import"./chunk-AJX44TJ7.js";import"./chunk-K5RE6ODJ.js";import"./chunk-NPNGSE7X.js";import"./chunk-7B46Q5OU.js";import"./chunk-E5J3GKCP.js";import"./chunk-5A5ECZCN.js";import"./chunk-ESFKNND3.js";import"./chunk-BKCIW3O2.js";import"./chunk-7B3IZBNN.js";import"./chunk-KIEXP4F3.js";import"./chunk-G3VIZON2.js";import"./chunk-4NYVSHN3.js";import"./chunk-EMKI4ZV5.js";import{b as w}from"./chunk-VMDSTKVR.js";import"./chunk-C723FDLL.js";import"./chunk-SQCNABS4.js";import"./chunk-YV34KLBV.js";import"./chunk-7EDVNITA.js";import"./chunk-MA7OLK56.js";import"./chunk-BHOJLQLF.js";import"./chunk-LSFJKCAQ.js";import"./chunk-MROCXAXJ.js";import"./chunk-KI4W6CVC.js";import{a as i,c as S}from"./chunk-Z5IOTEQI.js";import"./chunk-3VBPPW7H.js";import"./chunk-RD5N2722.js";import"./chunk-CU3LGMOK.js";import"./chunk-775KESYW.js";import"./chunk-5AXU6KCI.js";import"./chunk-YQ7X6LKA.js";import"./chunk-5CKG46BM.js";import"./chunk-EJSRKZ5M.js";import"./chunk-SYYGXU7I.js";import"./chunk-V2IUGAJ7.js";import"./chunk-NSRIYP76.js";import"./chunk-N5CEEWWJ.js";S();async function T(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=`${t}:${e.key}`;if(m()){let r=g(e.key,e.value,t,{tags:e.metadata?.tags}),o=await y.evaluateWrite(r);if(!o.allowed){if(R()&&b.recordViolation({type:"contradiction",severity:"medium",gate:"memoryWriteGate",description:`Memory write blocked for key ${e.key}: ${o.reason}`,context:{key:e.key,namespace:t,reason:o.reason,conflictingPatterns:o.conflictingPatterns}}),$())return{success:!1,error:`Memory write blocked by governance: ${o.reason}`};console.warn(`[MemoryHandler] Write allowed with warning: ${o.reason}`)}}await s.memory.set(n,e.value,{ttl:e.ttl});try{let r=`${e.key} ${JSON.stringify(e.value)}`,o=await w(r);await s.memory.storeVector(n,o,{key:e.key,namespace:t,storedAt:Date.now()})}catch(r){console.warn(`[MemoryHandler] Vector indexing failed for ${e.key}: ${i(r)}`)}return m()&&y.registerPattern(g(e.key,e.value,t)),{success:!0,data:{stored:!0,key:e.key,namespace:t,timestamp:new Date().toISOString(),persisted:!0}}}catch(t){return{success:!1,error:`Failed to store memory: ${i(t)}`}}}async function z(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let n=`${e.namespace||"default"}:${e.key}`,r=await s.memory.get(n);if(r===void 0)return{success:!0,data:{found:!1,key:e.key}};let o={found:!0,key:e.key,value:r,timestamp:new Date().toISOString()};return e.includeMetadata&&(o.metadata={}),{success:!0,data:o}}catch(t){return{success:!1,error:`Failed to retrieve memory: ${i(t)}`}}}function v(e){return e.includes(" ")&&!e.includes("*")&&!e.includes("?")}async function E(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=e.limit||100,r=e.offset||0;if((e.semantic===!0||e.semantic!==!1&&e.pattern&&v(e.pattern))&&e.pattern)try{let l=await w(e.pattern),u=await s.memory.vectorSearch(l,n+r),M=t!=="default"?u.filter(d=>d.key.startsWith(`${t}:`)):u;return{success:!0,data:{entries:M.slice(r,r+n).map(d=>{let k=d.key.split(":");return{key:k.length>1?k.slice(1).join(":"):d.key,namespace:k.length>1?k[0]:t,score:d.score}}),total:M.length,hasMore:r+n<M.length,searchType:"semantic"}}}catch(l){console.error(`[MemoryHandler] Semantic search failed, falling back to pattern: ${i(l)}`)}let f=e.pattern?`${t}:${e.pattern}`:`${t}:*`,h=await s.memory.search(f,n+r);return{success:!0,data:{entries:h.slice(r,r+n).map(l=>{let u=l.split(":");return{key:u.slice(1).join(":"),namespace:u[0]}}),total:h.length,hasMore:r+n<h.length,searchType:"pattern"}}}catch(t){return{success:!1,error:`Failed to query memory: ${i(t)}`}}}async function K(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=`${t}:${e.key}`;return{success:!0,data:{deleted:await s.memory.delete(n),key:e.key,namespace:t}}}catch(t){return{success:!1,error:`Failed to delete memory: ${i(t)}`}}}async function W(){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:e}=a();try{let s=await e.memory.search("*",1e4),t=0,n=1;try{let r=e.memory;r.getVectorStats&&(t=(await r.getVectorStats())?.vectorCount??0);let o=new Set(s.map(f=>f.split(":")[0]).filter(Boolean));n=Math.max(1,o.size)}catch{}return{success:!0,data:{entries:s.length,vectors:t,namespaces:n,size:{current:s.length,limit:Number.MAX_SAFE_INTEGER,unit:"entries"}}}}catch(s){return{success:!1,error:`Failed to get memory usage: ${i(s)}`}}}async function _(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=`shared:${e.knowledgeDomain}:${Date.now()}`,n={source:e.sourceAgentId,targets:e.targetAgentIds,domain:e.knowledgeDomain,content:e.knowledgeContent,timestamp:new Date().toISOString()};if(m()){let r=g(t,n,e.knowledgeDomain,{agentId:e.sourceAgentId}),o=await y.evaluateWrite(r);if(!o.allowed&&(R()&&b.recordViolation({type:"contradiction",severity:"medium",agentId:e.sourceAgentId,gate:"memoryWriteGate",description:`Shared knowledge blocked for domain ${e.knowledgeDomain}: ${o.reason}`,context:{sourceAgent:e.sourceAgentId,targetAgents:e.targetAgentIds,domain:e.knowledgeDomain,reason:o.reason}}),$()))return{success:!1,error:`Knowledge sharing blocked by governance: ${o.reason}`}}return await s.memory.set(t,n,{namespace:"agent-knowledge"}),m()&&y.registerPattern(g(t,n,e.knowledgeDomain)),{success:!0,data:{shared:!0,sourceAgent:e.sourceAgentId,targetAgents:e.targetAgentIds,domain:e.knowledgeDomain}}}catch(t){return{success:!1,error:`Failed to share memory: ${i(t)}`}}}export{K as handleMemoryDelete,E as handleMemoryQuery,z as handleMemoryRetrieve,_ as handleMemoryShare,T as handleMemoryStore,W as handleMemoryUsage};
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.7");process.exit(0)}
2
+ import{c as a,d as c}from"./chunk-2SJQ3CYN.js";import"./chunk-FBVEHGNE.js";import"./chunk-ZETZATNY.js";import"./chunk-EL2WLSUI.js";import"./chunk-CDFYF33M.js";import"./chunk-JNEG6DKU.js";import"./chunk-YV2PVXJE.js";import"./chunk-WS4OVAWU.js";import"./chunk-7OPVTN5W.js";import"./chunk-BTZEKSWH.js";import"./chunk-W4HUWBPK.js";import"./chunk-INJPS7RF.js";import"./chunk-6ULPQTIE.js";import"./chunk-SIIYQLKH.js";import"./chunk-FOCGOVIM.js";import"./chunk-YTF5G3RQ.js";import"./chunk-BJKRAFS2.js";import"./chunk-XB2GVTY6.js";import"./chunk-QI5VGEKC.js";import"./chunk-UXCEJ3AV.js";import"./chunk-D3KORDD5.js";import"./chunk-EFHR7LML.js";import"./chunk-OURDPRGM.js";import"./chunk-RGJ4RMUR.js";import"./chunk-NKX2Z546.js";import"./chunk-A5VULTCD.js";import"./chunk-SQZ3H6WR.js";import"./chunk-AHB2F42G.js";import"./chunk-LP6EQI2P.js";import"./chunk-ZEFDSMF4.js";import"./chunk-KO5HO6MY.js";import"./chunk-HWDE4RB3.js";import"./chunk-7GPYOMVY.js";import"./chunk-XY5FMZRA.js";import"./chunk-HEENVPYF.js";import"./chunk-TLTRL32T.js";import"./chunk-PFTR6XAO.js";import"./chunk-BWNH22V2.js";import"./chunk-SQQ57TSJ.js";import"./chunk-MUEFXLGX.js";import{a as m,b as R,d as $,e as y,f as g,i as b}from"./chunk-ZV7FGZNJ.js";import"./chunk-NJ5IC6ZR.js";import"./chunk-XOHRM3M7.js";import"./chunk-TT2YXNHH.js";import"./chunk-KHEAWN23.js";import"./chunk-BPYWDM2Y.js";import"./chunk-UDBSEFUT.js";import"./chunk-6MMRZYYS.js";import"./chunk-D2C4XNF5.js";import"./chunk-3DXO5CWI.js";import"./chunk-APPVAGD5.js";import"./chunk-7TKZ6LK6.js";import"./chunk-GOG6L2F7.js";import"./chunk-FHBIJBZ3.js";import"./chunk-LPLCT2HH.js";import"./chunk-DL46KSFX.js";import"./chunk-DKBXIBRS.js";import"./chunk-KHH5UJXY.js";import"./chunk-KLLHSXIC.js";import"./chunk-KZSZHP32.js";import"./chunk-URBXUDY3.js";import"./chunk-AT6LBLUV.js";import"./chunk-FKJ4XZ6E.js";import"./chunk-PHBE2VBN.js";import"./chunk-PMZJ54WX.js";import"./chunk-2TRWUJWG.js";import"./chunk-5EOM3W6Q.js";import"./chunk-DS3XAGGL.js";import{b as w}from"./chunk-426OO3RH.js";import"./chunk-52MUZGZF.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-FJEIX3IS.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import"./chunk-ZWAJV4SN.js";import"./chunk-WLYSZV5U.js";import"./chunk-ZSXSUUBS.js";import{a as i,c as S}from"./chunk-MR7V7QVL.js";import"./chunk-SMKRBNO7.js";import"./chunk-VMWLVRJO.js";import"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import"./chunk-UEFAPTBV.js";S();async function T(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=`${t}:${e.key}`;if(m()){let r=g(e.key,e.value,t,{tags:e.metadata?.tags}),o=await y.evaluateWrite(r);if(!o.allowed){if(R()&&b.recordViolation({type:"contradiction",severity:"medium",gate:"memoryWriteGate",description:`Memory write blocked for key ${e.key}: ${o.reason}`,context:{key:e.key,namespace:t,reason:o.reason,conflictingPatterns:o.conflictingPatterns}}),$())return{success:!1,error:`Memory write blocked by governance: ${o.reason}`};console.warn(`[MemoryHandler] Write allowed with warning: ${o.reason}`)}}await s.memory.set(n,e.value,{ttl:e.ttl});try{let r=`${e.key} ${JSON.stringify(e.value)}`,o=await w(r);await s.memory.storeVector(n,o,{key:e.key,namespace:t,storedAt:Date.now()})}catch(r){console.warn(`[MemoryHandler] Vector indexing failed for ${e.key}: ${i(r)}`)}return m()&&y.registerPattern(g(e.key,e.value,t)),{success:!0,data:{stored:!0,key:e.key,namespace:t,timestamp:new Date().toISOString(),persisted:!0}}}catch(t){return{success:!1,error:`Failed to store memory: ${i(t)}`}}}async function z(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let n=`${e.namespace||"default"}:${e.key}`,r=await s.memory.get(n);if(r===void 0)return{success:!0,data:{found:!1,key:e.key}};let o={found:!0,key:e.key,value:r,timestamp:new Date().toISOString()};return e.includeMetadata&&(o.metadata={}),{success:!0,data:o}}catch(t){return{success:!1,error:`Failed to retrieve memory: ${i(t)}`}}}function v(e){return e.includes(" ")&&!e.includes("*")&&!e.includes("?")}async function E(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=e.limit||100,r=e.offset||0;if((e.semantic===!0||e.semantic!==!1&&e.pattern&&v(e.pattern))&&e.pattern)try{let l=await w(e.pattern),u=await s.memory.vectorSearch(l,n+r),M=t!=="default"?u.filter(d=>d.key.startsWith(`${t}:`)):u;return{success:!0,data:{entries:M.slice(r,r+n).map(d=>{let k=d.key.split(":");return{key:k.length>1?k.slice(1).join(":"):d.key,namespace:k.length>1?k[0]:t,score:d.score}}),total:M.length,hasMore:r+n<M.length,searchType:"semantic"}}}catch(l){console.error(`[MemoryHandler] Semantic search failed, falling back to pattern: ${i(l)}`)}let f=e.pattern?`${t}:${e.pattern}`:`${t}:*`,h=await s.memory.search(f,n+r);return{success:!0,data:{entries:h.slice(r,r+n).map(l=>{let u=l.split(":");return{key:u.slice(1).join(":"),namespace:u[0]}}),total:h.length,hasMore:r+n<h.length,searchType:"pattern"}}}catch(t){return{success:!1,error:`Failed to query memory: ${i(t)}`}}}async function K(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=e.namespace||"default",n=`${t}:${e.key}`;return{success:!0,data:{deleted:await s.memory.delete(n),key:e.key,namespace:t}}}catch(t){return{success:!1,error:`Failed to delete memory: ${i(t)}`}}}async function W(){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:e}=a();try{let s=await e.memory.search("*",1e4),t=0,n=1;try{let r=e.memory;r.getVectorStats&&(t=(await r.getVectorStats())?.vectorCount??0);let o=new Set(s.map(f=>f.split(":")[0]).filter(Boolean));n=Math.max(1,o.size)}catch{}return{success:!0,data:{entries:s.length,vectors:t,namespaces:n,size:{current:s.length,limit:Number.MAX_SAFE_INTEGER,unit:"entries"}}}}catch(s){return{success:!1,error:`Failed to get memory usage: ${i(s)}`}}}async function _(e){if(!c())return{success:!1,error:"Fleet not initialized. Call fleet_init first."};let{kernel:s}=a();try{let t=`shared:${e.knowledgeDomain}:${Date.now()}`,n={source:e.sourceAgentId,targets:e.targetAgentIds,domain:e.knowledgeDomain,content:e.knowledgeContent,timestamp:new Date().toISOString()};if(m()){let r=g(t,n,e.knowledgeDomain,{agentId:e.sourceAgentId}),o=await y.evaluateWrite(r);if(!o.allowed&&(R()&&b.recordViolation({type:"contradiction",severity:"medium",agentId:e.sourceAgentId,gate:"memoryWriteGate",description:`Shared knowledge blocked for domain ${e.knowledgeDomain}: ${o.reason}`,context:{sourceAgent:e.sourceAgentId,targetAgents:e.targetAgentIds,domain:e.knowledgeDomain,reason:o.reason}}),$()))return{success:!1,error:`Knowledge sharing blocked by governance: ${o.reason}`}}return await s.memory.set(t,n,{namespace:"agent-knowledge"}),m()&&y.registerPattern(g(t,n,e.knowledgeDomain)),{success:!0,data:{shared:!0,sourceAgent:e.sourceAgentId,targetAgents:e.targetAgentIds,domain:e.knowledgeDomain}}}catch(t){return{success:!1,error:`Failed to share memory: ${i(t)}`}}}export{K as handleMemoryDelete,E as handleMemoryQuery,z as handleMemoryRetrieve,_ as handleMemoryShare,T as handleMemoryStore,W as handleMemoryUsage};
@@ -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.6");process.exit(0)}
2
- import{a as v}from"./chunk-T4L6MHRW.js";import{a as c,c as S}from"./chunk-Z5IOTEQI.js";import"./chunk-N5CEEWWJ.js";S();import{existsSync as n,mkdirSync as g,readdirSync as h,writeFileSync as I,copyFileSync as f}from"fs";import{join as o}from"path";var m=class{projectRoot;options;sourceDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installAgents:!0,installSkills:!0,installTools:!0,overwrite:!1,...e},this.sourceDir=this.findSourceDir()}findSourceDir(){let e=o(this.projectRoot,".opencode"),s=v(import.meta.url),r=[];s&&r.push(o(s,".opencode")),r.push(o(this.projectRoot,"node_modules/agentic-qe/.opencode"));for(let t of r)if(t!==e&&this.isValidSourceDir(t))return t;return r[0]??o(this.projectRoot,"node_modules/agentic-qe/.opencode")}isValidSourceDir(e){return n(e)?n(o(e,"agents"))||n(o(e,"skills")):!1}async install(){let e=o(this.projectRoot,".opencode"),s={success:!0,agentsInstalled:[],skillsInstalled:[],toolsInstalled:[],permissionsInstalled:!1,errors:[],targetDir:e};try{if(!n(this.sourceDir))return s.errors.push(`Source .opencode directory not found: ${this.sourceDir}`),s.success=!1,s;if(this.options.installAgents){let t=this.installAgents(e);s.agentsInstalled=t.installed,s.errors.push(...t.errors)}if(this.options.installSkills){let t=this.installSkills(e);s.skillsInstalled=t.installed,s.errors.push(...t.errors)}if(this.options.installTools){let t=this.installTools(e);s.toolsInstalled=t.installed,s.errors.push(...t.errors)}let r=this.installPermissions(e);s.permissionsInstalled=r.installed,s.errors.push(...r.errors),this.generateOpenCodeConfig()}catch(r){s.success=!1,s.errors.push(`Installation failed: ${c(r)}`)}return s}installAgents(e){let s=[],r=[],t=o(this.sourceDir,"agents"),l=o(e,"agents");if(!n(t))return r.push(`Source agents directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".yaml"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".yaml",""))}catch(d){r.push(`Failed to install agent ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installSkills(e){let s=[],r=[],t=o(this.sourceDir,"skills"),l=o(e,"skills");if(!n(t))return r.push(`Source skills directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".yaml"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".yaml",""))}catch(d){r.push(`Failed to install skill ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installTools(e){let s=[],r=[],t=o(this.sourceDir,"tools"),l=o(e,"tools");if(!n(t))return r.push(`Source tools directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".ts"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".ts",""))}catch(d){r.push(`Failed to install tool ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installPermissions(e){let s=[],r=o(this.sourceDir,"permissions.yaml"),t=o(e,"permissions.yaml");if(!n(r))return{installed:!1,errors:[]};if(n(t)&&!this.options.overwrite)return{installed:!1,errors:[]};try{return n(e)||g(e,{recursive:!0}),f(r,t),{installed:!0,errors:[]}}catch(l){return s.push(`Failed to install permissions.yaml: ${c(l)}`),{installed:!1,errors:s}}}generateOpenCodeConfig(){let e=o(this.projectRoot,"opencode.json");if(n(e))return;I(e,JSON.stringify({mcp:{"agentic-qe":{type:"local",command:["npx","agentic-qe","mcp"],environment:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"}}}},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.7");process.exit(0)}
2
+ import{a as v}from"./chunk-W4Y4GFRB.js";import{a as c,c as S}from"./chunk-MR7V7QVL.js";import"./chunk-UEFAPTBV.js";S();import{existsSync as n,mkdirSync as g,readdirSync as h,writeFileSync as I,copyFileSync as f}from"fs";import{join as o}from"path";var m=class{projectRoot;options;sourceDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installAgents:!0,installSkills:!0,installTools:!0,overwrite:!1,...e},this.sourceDir=this.findSourceDir()}findSourceDir(){let e=o(this.projectRoot,".opencode"),s=v(import.meta.url),r=[];s&&r.push(o(s,".opencode")),r.push(o(this.projectRoot,"node_modules/agentic-qe/.opencode"));for(let t of r)if(t!==e&&this.isValidSourceDir(t))return t;return r[0]??o(this.projectRoot,"node_modules/agentic-qe/.opencode")}isValidSourceDir(e){return n(e)?n(o(e,"agents"))||n(o(e,"skills")):!1}async install(){let e=o(this.projectRoot,".opencode"),s={success:!0,agentsInstalled:[],skillsInstalled:[],toolsInstalled:[],permissionsInstalled:!1,errors:[],targetDir:e};try{if(!n(this.sourceDir))return s.errors.push(`Source .opencode directory not found: ${this.sourceDir}`),s.success=!1,s;if(this.options.installAgents){let t=this.installAgents(e);s.agentsInstalled=t.installed,s.errors.push(...t.errors)}if(this.options.installSkills){let t=this.installSkills(e);s.skillsInstalled=t.installed,s.errors.push(...t.errors)}if(this.options.installTools){let t=this.installTools(e);s.toolsInstalled=t.installed,s.errors.push(...t.errors)}let r=this.installPermissions(e);s.permissionsInstalled=r.installed,s.errors.push(...r.errors),this.generateOpenCodeConfig()}catch(r){s.success=!1,s.errors.push(`Installation failed: ${c(r)}`)}return s}installAgents(e){let s=[],r=[],t=o(this.sourceDir,"agents"),l=o(e,"agents");if(!n(t))return r.push(`Source agents directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".yaml"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".yaml",""))}catch(d){r.push(`Failed to install agent ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installSkills(e){let s=[],r=[],t=o(this.sourceDir,"skills"),l=o(e,"skills");if(!n(t))return r.push(`Source skills directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".yaml"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".yaml",""))}catch(d){r.push(`Failed to install skill ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installTools(e){let s=[],r=[],t=o(this.sourceDir,"tools"),l=o(e,"tools");if(!n(t))return r.push(`Source tools directory not found: ${t}`),{installed:s,errors:r};n(l)||g(l,{recursive:!0});let u=h(t).filter(i=>i.endsWith(".ts"));for(let i of u){let p=o(t,i),a=o(l,i);if(!(n(a)&&!this.options.overwrite))try{f(p,a),s.push(i.replace(".ts",""))}catch(d){r.push(`Failed to install tool ${i}: ${c(d)}`)}}return{installed:s,errors:r}}installPermissions(e){let s=[],r=o(this.sourceDir,"permissions.yaml"),t=o(e,"permissions.yaml");if(!n(r))return{installed:!1,errors:[]};if(n(t)&&!this.options.overwrite)return{installed:!1,errors:[]};try{return n(e)||g(e,{recursive:!0}),f(r,t),{installed:!0,errors:[]}}catch(l){return s.push(`Failed to install permissions.yaml: ${c(l)}`),{installed:!1,errors:s}}}generateOpenCodeConfig(){let e=o(this.projectRoot,"opencode.json");if(n(e))return;I(e,JSON.stringify({mcp:{"agentic-qe":{type:"local",command:["npx","agentic-qe","mcp"],environment:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"}}}},null,2)+`
3
3
  `)}};function C(y){return new m(y)}export{m as OpenCodeInstaller,C as createOpenCodeInstaller};
@@ -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.6");process.exit(0)}
2
- import{a as ve}from"./chunk-GXVUDSYW.js";import{c as Re}from"./chunk-RZLRPLRC.js";import{a as te,b as ce,c as he,d as ye,e as ke,f as be,g as we,h as Ce,i as Pe,j as Se,k as Ee}from"./chunk-TG7PATSN.js";import"./chunk-QGEZJKVO.js";import{a as Ie}from"./chunk-T4L6MHRW.js";import"./chunk-H7OP3RI2.js";import"./chunk-NPNGSE7X.js";import"./chunk-SQCNABS4.js";import"./chunk-YV34KLBV.js";import"./chunk-MA7OLK56.js";import"./chunk-BHOJLQLF.js";import{b as x,d as ee}from"./chunk-MROCXAXJ.js";import{a as A,b as fe,c as ae}from"./chunk-Z5IOTEQI.js";import"./chunk-RD5N2722.js";import{a as _,b as le}from"./chunk-CU3LGMOK.js";import"./chunk-775KESYW.js";import"./chunk-5AXU6KCI.js";import"./chunk-YQ7X6LKA.js";import"./chunk-5CKG46BM.js";import"./chunk-EJSRKZ5M.js";import"./chunk-SYYGXU7I.js";import"./chunk-V2IUGAJ7.js";import"./chunk-NSRIYP76.js";import{a as ie}from"./chunk-N5CEEWWJ.js";ae();ae();var h=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:fe(s),durationMs:Date.now()-t,message:`${this.description} failed: ${A(s)}`}}}checkDependencies(e){if(!this.requiresPhases?.length)return!0;for(let t of this.requiresPhases)if(!e.results.get(t)?.success)return e.services.warn(`Phase ${this.name} requires ${t} which has not completed`),!1;return!0}checkEnhancements(e){if(!this.requiresEnhancements?.length)return!0;for(let t of this.requiresEnhancements)if(!(t==="claudeFlow"?e.enhancements.claudeFlow:t==="ruvector"?e.enhancements.ruvector:!1))return e.services.warn(`Phase ${this.name} requires ${t} which is not available`),!1;return!0}};ee();le();import{existsSync as q}from"fs";import{join as T}from"path";var N=class extends h{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=q(T(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,l=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:l,v2Detection:s}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),s=T(e,".agentic-qe","config"),n=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=q(t),i=q(s),l=q(n),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?s:void 0,agentsPath:l?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:l,version:g}}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.7");process.exit(0)}
2
+ import{a as ve}from"./chunk-4B5IYFKE.js";import{c as Re}from"./chunk-EFHR7LML.js";import{a as te,b as ce,c as he,d as ye,e as ke,f as be,g as we,h as Ce,i as Pe,j as Se,k as Ee}from"./chunk-T7R5NXJW.js";import"./chunk-OURDPRGM.js";import{a as Ie}from"./chunk-W4Y4GFRB.js";import"./chunk-BWNH22V2.js";import"./chunk-KHH5UJXY.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import{b as x,d as ee}from"./chunk-WLYSZV5U.js";import{a as A,b as fe,c as ae}from"./chunk-MR7V7QVL.js";import"./chunk-VMWLVRJO.js";import{a as _,b as le}from"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import{a as ie}from"./chunk-UEFAPTBV.js";ae();ae();var h=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:fe(s),durationMs:Date.now()-t,message:`${this.description} failed: ${A(s)}`}}}checkDependencies(e){if(!this.requiresPhases?.length)return!0;for(let t of this.requiresPhases)if(!e.results.get(t)?.success)return e.services.warn(`Phase ${this.name} requires ${t} which has not completed`),!1;return!0}checkEnhancements(e){if(!this.requiresEnhancements?.length)return!0;for(let t of this.requiresEnhancements)if(!(t==="claudeFlow"?e.enhancements.claudeFlow:t==="ruvector"?e.enhancements.ruvector:!1))return e.services.warn(`Phase ${this.name} requires ${t} which is not available`),!1;return!0}};ee();le();import{existsSync as q}from"fs";import{join as T}from"path";var N=class extends h{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=q(T(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,l=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:l,v2Detection:s}}async detectV2Installation(e){let t=T(e,".agentic-qe","memory.db"),s=T(e,".agentic-qe","config"),n=T(e,".claude","agents"),o=T(e,".agentic-qe","config","learning.json"),r=q(t),i=q(s),l=q(n),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?s:void 0,agentsPath:l?n: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 n=t.prepare(`
@@ -8,7 +8,7 @@ import{a as ve}from"./chunk-GXVUDSYW.js";import{c as Re}from"./chunk-RZLRPLRC.js
8
8
  `).get();return t.close(),n?x(n.value):void 0}catch{t.close();return}}catch{return}}};var Q=class extends h{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await he(e.projectRoot).analyze();return e.analysis=s,e.services.log(` Project: ${s.projectName}`),e.services.log(` Languages: ${s.languages.map(n=>n.name).join(", ")}`),e.services.log(` Frameworks: ${s.frameworks.map(n=>n.name).join(", ")}`),s}};var L=class extends h{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=ye({minimal:e.options.minimal}).recommend(e.analysis);return s=this.applyOptions(s,e),e.config=s,e.services.log(` Version: ${s.version}`),e.services.log(` Learning: ${s.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${s.workers.enabled.length}`),s}applyOptions(e,t){let{options:s}=t;return s.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),s.skipPatterns&&(e.learning.pretrainedPatterns=!1),s.wizardAnswers&&(e=this.applyWizardAnswers(e,s.wizardAnswers)),e}applyWizardAnswers(e,t){switch(t["project-type"]&&t["project-type"]!=="auto"&&(e.project.type=t["project-type"]),t["learning-mode"]){case"full":e.learning.enabled=!0,e.learning.embeddingModel="transformer";break;case"basic":e.learning.enabled=!0,e.learning.embeddingModel="hash";break;case"disabled":e.learning.enabled=!1;break}return t["load-patterns"]===!1&&(e.learning.pretrainedPatterns=!1),t.hooks===!1&&(e.hooks.claudeCode=!1),t.workers===!1&&(e.workers.daemonAutoStart=!1),t.skills===!1&&(e.skills.install=!1),e}};import{existsSync as V,mkdirSync as de}from"fs";import{join as W}from"path";var H=class extends h{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async run(e){let{projectRoot:t}=e,s=W(t,"vectors.db");V(s)&&e.services.log(` \u26A0 Stale vectors.db detected at ${s}
9
9
  This file is left over from @ruvector/router (pre-v3.9.6).
10
10
  It is no longer read or written by AQE. Safe to delete:
11
- rm "${s}"`);let n=W(t,".agentic-qe");V(n)||de(n,{recursive:!0});let o=W(n,"workers");V(o)||de(o,{recursive:!0});let r=W(n,"data");V(r)||de(r,{recursive:!0});let i=W(n,"memory.db"),l=!V(i);try{let{initializeUnifiedMemory:c,resetUnifiedMemory:d}=await import("./unified-memory-OYIJOZ2E.js"),g=await c({dbPath:i,walMode:!0,busyTimeout:5e3}),f=g.getStats().tables.map(R=>R.name);await g.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:te()},"_system");let P=g.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return d(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${P}`),e.services.log(` Tables: ${f.length} (v3 full schema)`),{dbPath:i,created:l,tablesCreated:f,schemaVersion:P}}catch(c){throw new Error(`SQLite persistence initialization FAILED: ${c}
11
+ rm "${s}"`);let n=W(t,".agentic-qe");V(n)||de(n,{recursive:!0});let o=W(n,"workers");V(o)||de(o,{recursive:!0});let r=W(n,"data");V(r)||de(r,{recursive:!0});let i=W(n,"memory.db"),l=!V(i);try{let{initializeUnifiedMemory:c,resetUnifiedMemory:d}=await import("./unified-memory-EXRANFUS.js"),g=await c({dbPath:i,walMode:!0,busyTimeout:5e3}),f=g.getStats().tables.map(R=>R.name);await g.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:te()},"_system");let P=g.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return d(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${P}`),e.services.log(` Tables: ${f.length} (v3 full schema)`),{dbPath:i,created:l,tablesCreated:f,schemaVersion:P}}catch(c){throw new Error(`SQLite persistence initialization FAILED: ${c}
12
12
  Database path: ${i}
13
13
  Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as ne,mkdirSync as ue,writeFileSync as Ae}from"fs";import{join as $}from"path";var G=class extends h{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:s,options:n}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=$(s,".agentic-qe","data");ne(o)||ue(o,{recursive:!0});let r=$(o,"hnsw");ne(r)||ue(r,{recursive:!0});let i=$(o,"learning-config.json"),l={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:$(o,"memory.db"),hnswIndexPath:$(r,"index.bin"),initialized:new Date().toISOString()};Ae(i,JSON.stringify(l,null,2),"utf-8");let c=0;return t.learning.pretrainedPatterns&&!n.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 s=$(e,"patterns");ne(s)||ue(s,{recursive:!0});let n=$(s,"index.json");return ne(n)||Ae(n,JSON.stringify({version:te(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};ee();le();import{existsSync as Le,statSync as Ve}from"fs";import{join as se}from"path";var xe=3e4,_e=18e4,$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.*"],U=class extends h{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){let t=process.env.AQE_SKIP_CODE_INDEX;return t==="1"||t==="true"?(e.services.log(" Code intelligence skipped (AQE_SKIP_CODE_INDEX=1)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):e.options.skipCodeIndex?(e.services.log(" Code intelligence skipped (--skip-code-index)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):!0}async run(e){let{projectRoot:t}=e,s=se(t,".agentic-qe","memory.db");if(!Le(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=_(s);try{if(!this.checkCodeIntelligenceIndex(n))return n.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(n);if(!r){let c=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${c} entries)`),{status:"existing",entries:c}}let i=this.getKGEntryCount(n);n.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{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
14
14
  SELECT COUNT(*) as count FROM kv_store
@@ -16,7 +16,7 @@ Ensure the directory is writable and has sufficient disk space.`)}}};import{exis
16
16
  `).get().count>0}catch{return!1}}getKGEntryCount(e){try{return e.prepare(`
17
17
  SELECT COUNT(*) as count FROM kv_store
18
18
  WHERE namespace LIKE 'code-intelligence:kg%'
19
- `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){try{let{KnowledgeGraphService:o}=await import("./knowledge-graph-XPFESDWZ.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;n?d=n:d=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:$e})).map(m=>se(e,m)),t.services.log(` Scanning ${d.length} source files...`);let g=await this.runBoundedScan(c,d,s,t);if(c.destroy(),await l.dispose(),g.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${_e/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=s?"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,s,n){let o=0,r=0,i=0,l="",c=Date.now(),d=!1;s||await e.clear();let g=n.projectRoot,u=m=>m.startsWith(g)?m.slice(g.length+1):m;for(let m of t){if(Date.now()-c>_e){d=!0;break}l=m,n.services.log(` [${i+1}/${t.length}] ${u(m)}`);try{let v=await this.withTimeout(e.index({paths:[m],incremental:!0,includeTests:!0}),xe,m);v.success&&(o+=v.value.nodesCreated,r+=v.value.edgesCreated)}catch(v){let P=v instanceof Error?v.message:String(v);P.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${u(m)} \u2014 indexing exceeded ${xe/1e3}s`):n.services.warn(` \u26A0 Failed to index ${u(m)}: ${P}`)}i++}let f=o+r;return d?{status:"timeout",entries:f,timeoutFile:l}:{status:"indexed",entries:f}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-BRNK2X4M.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-MLLU5WQB.js"),r=_(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),l=await n(t),c=await i.buildFromIndexResult(l);r.close(),c.nodesCreated+c.edgesCreated>0&&s.services.log(` Hypergraph: ${c.nodesCreated} nodes, ${c.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
19
+ `).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-ZYXBWGKL.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});try{let d;n?d=n:d=(await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:$e})).map(m=>se(e,m)),t.services.log(` Scanning ${d.length} source files...`);let g=await this.runBoundedScan(c,d,s,t);if(g.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${_e/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=s?"Delta indexed":"Indexed";t.services.log(` ${u} ${g.entries} entries to ${r}`),await this.buildHypergraph(r,d,t)}return g}finally{try{c.destroy()}catch{}try{await l.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,l="",c=Date.now(),d=!1;s||await e.clear();let g=n.projectRoot,u=m=>m.startsWith(g)?m.slice(g.length+1):m;for(let m of t){if(Date.now()-c>_e){d=!0;break}l=m,n.services.log(` [${i+1}/${t.length}] ${u(m)}`);try{let v=await this.withTimeout(e.index({paths:[m],incremental:!0,includeTests:!0}),xe,m);v.success&&(o+=v.value.nodesCreated,r+=v.value.edgesCreated)}catch(v){let P=v instanceof Error?v.message:String(v);P.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${u(m)} \u2014 indexing exceeded ${xe/1e3}s`):n.services.warn(` \u26A0 Failed to index ${u(m)}: ${P}`)}i++}let f=o+r;return d?{status:"timeout",entries:f,timeoutFile:l}:{status:"indexed",entries:f}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-RD5EAOLE.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-FGAHFWFO.js"),r=_(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),l=await n(t),c=await i.buildFromIndexResult(l);r.close(),c.nodesCreated+c.edgesCreated>0&&s.services.log(` Hypergraph: ${c.nodesCreated} nodes, ${c.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
20
20
  SELECT value FROM kv_store
21
21
  WHERE namespace = 'code-intelligence:kg'
22
22
  AND key = 'metadata:index'
@@ -107,7 +107,7 @@ function verifyBrain() {
107
107
  const cmd = process.argv[2] || 'verify';
108
108
  const result = cmd === 'export' ? exportBrain() : verifyBrain();
109
109
  if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
110
- `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^Task$",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 We,readFileSync as He,writeFileSync as Ge}from"fs";import{join as Ue}from"path";var z=class extends h{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},n=Ue(t,".mcp.json"),o={};if(We(n))try{let i=He(n,"utf-8");o=x(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=s,Ge(n,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${n}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:n,serverName:"agentic-qe"}}};import{existsSync as S,readFileSync as Be}from"fs";import{join as E}from"path";var K=class extends h{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,l=0,c=0,d=0,g=0,u=0,f=0,m=0,v=0;if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let k=await Pe({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=k.installed.length,k.errors.length>0&&e.services.warn(`Skills warnings: ${k.errors.join(", ")}`)}try{let k=await Se({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();l=k.installed.length,k.errors.length>0&&e.services.warn(`Agents warnings: ${k.errors.join(", ")}`)}catch(y){e.services.warn(`Agents install error: ${y instanceof Error?y.message:y}`)}if(Re(s),n.withN8n){let k=await Ee({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();c=k.agentsInstalled.length,d=k.skillsInstalled.length,k.errors.length>0&&e.services.warn(`N8n warnings: ${k.errors.join(", ")}`)}let P=n.autoMode&&S(E(s,"opencode.json"));if(n.withOpenCode||P){let{createOpenCodeInstaller:y}=await import("./opencode-installer-KYDQUOAW.js"),a=await y({projectRoot:s,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}`),n.withN8n&&(e.services.log(` N8n agents: ${c}`),e.services.log(` N8n skills: ${d}`)),(n.withOpenCode||P)&&(e.services.log(` OpenCode agents: ${g}`),e.services.log(` OpenCode skills: ${u}`));let R=n.autoMode&&S(E(s,".kiro"));if(n.withKiro||R){let{createKiroInstaller:y}=await import("./kiro-installer-3JJ7TSXH.js"),a=await y({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();f=a.agentsInstalled.length,m=a.skillsInstalled.length,v=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${f}`),e.services.log(` Kiro skills: ${m}`),e.services.log(` Kiro hooks: ${v}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let C=[];if(n.withCopilot||n.autoMode&&S(E(s,".vscode"))){let{createCopilotInstaller:y}=await import("./copilot-installer-UQ4IEG4H.js"),a=await y({projectRoot:s,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(n.withCursor||n.autoMode&&S(E(s,".cursor"))){let{createCursorInstaller:y}=await import("./cursor-installer-7PABDYDI.js"),a=await y({projectRoot:s,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(n.withCline){let{createClineInstaller:y}=await import("./cline-installer-YIXOIHBL.js"),a=await y({projectRoot:s,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(n.withKiloCode||n.autoMode&&S(E(s,".kilocode"))){let{createKiloCodeInstaller:y}=await import("./kilocode-installer-5MAYAROV.js"),a=await y({projectRoot:s,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(n.withRooCode||n.autoMode&&S(E(s,".roo"))){let{createRooCodeInstaller:y}=await import("./roocode-installer-K47KSTXW.js"),a=await y({projectRoot:s,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(n.withCodex||n.autoMode&&S(E(s,".codex"))){let{createCodexInstaller:y}=await import("./codex-installer-TLRH3SG7.js"),a=await y({projectRoot:s,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(n.withWindsurf||n.autoMode&&S(E(s,".windsurf"))){let{createWindsurfInstaller:y}=await import("./windsurf-installer-TEXMCEBB.js"),a=await y({projectRoot:s,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(n.withContinueDev||n.autoMode&&S(E(s,".continue"))){let{createContinueDevInstaller:y}=await import("./continuedev-installer-7HHND63H.js"),a=await y({projectRoot:s,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:d,openCodeAgents:g,openCodeSkills:u,kiroAgents:f,kiroSkills:m,kiroHooks:v,platformsConfigured:C}}detectVersionUpgrade(e){let t=E(e.projectRoot,".agentic-qe","config.yaml");if(!S(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 Y=class extends h{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let n=O(s,".agentic-qe","workers");ze(n)||Ke(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let f of t.workers.enabled)r[f]={name:f,enabled:!0,interval:t.workers.intervals[f]||o[f]||6e4,lastRun:null,status:"pending"};let i=O(n,"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 f of t.workers.enabled){let m=O(n,`${f}.json`),v={name:f,enabled:!0,interval:t.workers.intervals[f]||o[f]||6e4,projectRoot:s,dataDir:O(s,".agentic-qe","data"),createdAt:new Date().toISOString()};oe(m,JSON.stringify(v,null,2),"utf-8")}let c=O(n,"start-daemon.cjs");oe(c,`#!/usr/bin/env node
110
+ `}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5e3,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',timeout:3e3,continueOnError:!0}]},{matcher:"^Task$",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 We,readFileSync as He,writeFileSync as Ge}from"fs";import{join as Ue}from"path";var z=class extends h{name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(e){let{projectRoot:t}=e;if(e.options.noMcp)return e.services.log(" MCP: skipped (--no-mcp)"),e.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};let s={command:"aqe-mcp",args:[],env:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},n=Ue(t,".mcp.json"),o={};if(We(n))try{let i=He(n,"utf-8");o=x(i)}catch{o={}}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;return r["agentic-qe"]=s,Ge(n,JSON.stringify(o,null,2),"utf-8"),e.services.log(` MCP config: ${n}`),e.services.log(" Server: agentic-qe"),e.services.log(" Learning: enabled"),e.services.log(" Workers: enabled"),{configured:!0,mcpPath:n,serverName:"agentic-qe"}}};import{existsSync as S,readFileSync as Be}from"fs";import{join as E}from"path";var K=class extends h{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,l=0,c=0,d=0,g=0,u=0,f=0,m=0,v=0;if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),t.skills.install){let k=await Pe({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=k.installed.length,k.errors.length>0&&e.services.warn(`Skills warnings: ${k.errors.join(", ")}`)}try{let k=await Se({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();l=k.installed.length,k.errors.length>0&&e.services.warn(`Agents warnings: ${k.errors.join(", ")}`)}catch(y){e.services.warn(`Agents install error: ${y instanceof Error?y.message:y}`)}if(Re(s),n.withN8n){let k=await Ee({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();c=k.agentsInstalled.length,d=k.skillsInstalled.length,k.errors.length>0&&e.services.warn(`N8n warnings: ${k.errors.join(", ")}`)}let P=n.autoMode&&S(E(s,"opencode.json"));if(n.withOpenCode||P){let{createOpenCodeInstaller:y}=await import("./opencode-installer-PIDIFO2L.js"),a=await y({projectRoot:s,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}`),n.withN8n&&(e.services.log(` N8n agents: ${c}`),e.services.log(` N8n skills: ${d}`)),(n.withOpenCode||P)&&(e.services.log(` OpenCode agents: ${g}`),e.services.log(` OpenCode skills: ${u}`));let R=n.autoMode&&S(E(s,".kiro"));if(n.withKiro||R){let{createKiroInstaller:y}=await import("./kiro-installer-NG77T5YR.js"),a=await y({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r}).install();f=a.agentsInstalled.length,m=a.skillsInstalled.length,v=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${f}`),e.services.log(` Kiro skills: ${m}`),e.services.log(` Kiro hooks: ${v}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let C=[];if(n.withCopilot||n.autoMode&&S(E(s,".vscode"))){let{createCopilotInstaller:y}=await import("./copilot-installer-TVJUX3AZ.js"),a=await y({projectRoot:s,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(n.withCursor||n.autoMode&&S(E(s,".cursor"))){let{createCursorInstaller:y}=await import("./cursor-installer-2NJ7MK23.js"),a=await y({projectRoot:s,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(n.withCline){let{createClineInstaller:y}=await import("./cline-installer-3FMNXEKM.js"),a=await y({projectRoot:s,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(n.withKiloCode||n.autoMode&&S(E(s,".kilocode"))){let{createKiloCodeInstaller:y}=await import("./kilocode-installer-ED6LYSEM.js"),a=await y({projectRoot:s,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(n.withRooCode||n.autoMode&&S(E(s,".roo"))){let{createRooCodeInstaller:y}=await import("./roocode-installer-WADVKI3P.js"),a=await y({projectRoot:s,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(n.withCodex||n.autoMode&&S(E(s,".codex"))){let{createCodexInstaller:y}=await import("./codex-installer-UU4O2FIE.js"),a=await y({projectRoot:s,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(n.withWindsurf||n.autoMode&&S(E(s,".windsurf"))){let{createWindsurfInstaller:y}=await import("./windsurf-installer-O5WOBFOQ.js"),a=await y({projectRoot:s,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(n.withContinueDev||n.autoMode&&S(E(s,".continue"))){let{createContinueDevInstaller:y}=await import("./continuedev-installer-E55EG2TB.js"),a=await y({projectRoot:s,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:d,openCodeAgents:g,openCodeSkills:u,kiroAgents:f,kiroSkills:m,kiroHooks:v,platformsConfigured:C}}detectVersionUpgrade(e){let t=E(e.projectRoot,".agentic-qe","config.yaml");if(!S(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 Y=class extends h{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let n=O(s,".agentic-qe","workers");ze(n)||Ke(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let f of t.workers.enabled)r[f]={name:f,enabled:!0,interval:t.workers.intervals[f]||o[f]||6e4,lastRun:null,status:"pending"};let i=O(n,"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 f of t.workers.enabled){let m=O(n,`${f}.json`),v={name:f,enabled:!0,interval:t.workers.intervals[f]||o[f]||6e4,projectRoot:s,dataDir:O(s,".agentic-qe","data"),createdAt:new Date().toISOString()};oe(m,JSON.stringify(v,null,2),"utf-8")}let c=O(n,"start-daemon.cjs");oe(c,`#!/usr/bin/env node
111
111
  // AQE v3 Worker Daemon Startup Script (cross-platform)
112
112
  // Generated by aqe init
113
113
  // Starts the MCP server with background workers enabled
@@ -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.6");process.exit(0)}
2
- import{a as y,b as w,c as u}from"./chunk-KI4W6CVC.js";import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import{a as y,b as w,c as u}from"./chunk-ZSXSUUBS.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import{a as u}from"./chunk-LZ5LS4LF.js";import{a as y,c as w}from"./chunk-Z5IOTEQI.js";import{b as $}from"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import{a as u}from"./chunk-XD4UFF2Y.js";import{a as y,c as w}from"./chunk-MR7V7QVL.js";import{b as $}from"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import{a as p,b as d,c as h}from"./chunk-XKU2LJIM.js";import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import{a as p,b as d,c as h}from"./chunk-NKX2Z546.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import"./chunk-UEFAPTBV.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.7");process.exit(0)}
2
+ import{a,b}from"./chunk-HWDE4RB3.js";import"./chunk-7GPYOMVY.js";import"./chunk-XY5FMZRA.js";import"./chunk-ZSXSUUBS.js";import"./chunk-MR7V7QVL.js";import"./chunk-SMKRBNO7.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import"./chunk-2DGTT6D2.js";import{c as i}from"./chunk-MROCXAXJ.js";import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import"./chunk-VAKJOTGU.js";import{c as i}from"./chunk-WLYSZV5U.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import"./chunk-UEFAPTBV.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.7");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-6MMRZYYS.js";import"./chunk-D2C4XNF5.js";import{a as e,b as f,d as g}from"./chunk-3DXO5CWI.js";import"./chunk-APPVAGD5.js";import{a,b,c,h as d}from"./chunk-7TKZ6LK6.js";import"./chunk-GOG6L2F7.js";import"./chunk-DL46KSFX.js";import"./chunk-FKJ4XZ6E.js";import"./chunk-DS3XAGGL.js";import"./chunk-426OO3RH.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import"./chunk-WLYSZV5U.js";import"./chunk-ZSXSUUBS.js";import"./chunk-MR7V7QVL.js";import"./chunk-SMKRBNO7.js";import"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import{c as l,d as u,h as d}from"./chunk-ARRJKSDK.js";import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import{c as l,d as u,h as d}from"./chunk-3KX7CQEM.js";import"./chunk-UEFAPTBV.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.7");process.exit(0)}
2
+ import{c as a,d as b,e as c,f as d}from"./chunk-HEENVPYF.js";import"./chunk-TLTRL32T.js";import"./chunk-PFTR6XAO.js";import"./chunk-BWNH22V2.js";import"./chunk-SQQ57TSJ.js";import"./chunk-MUEFXLGX.js";import"./chunk-ZV7FGZNJ.js";import"./chunk-NJ5IC6ZR.js";import"./chunk-APPVAGD5.js";import"./chunk-7TKZ6LK6.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-FJEIX3IS.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import"./chunk-WLYSZV5U.js";import"./chunk-ZSXSUUBS.js";import"./chunk-MR7V7QVL.js";import"./chunk-SMKRBNO7.js";import"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import"./chunk-UEFAPTBV.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.6");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-VMDSTKVR.js";import"./chunk-Z5IOTEQI.js";import{a}from"./chunk-EJSRKZ5M.js";import"./chunk-N5CEEWWJ.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.7");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-426OO3RH.js";import"./chunk-MR7V7QVL.js";import{a}from"./chunk-JZYCZMHN.js";import"./chunk-UEFAPTBV.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.6");process.exit(0)}
2
- import{b as p}from"./chunk-LZ5LS4LF.js";import{a as f,c as v}from"./chunk-Z5IOTEQI.js";import"./chunk-N5CEEWWJ.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.7");process.exit(0)}
2
+ import{b as p}from"./chunk-XD4UFF2Y.js";import{a as f,c as v}from"./chunk-MR7V7QVL.js";import"./chunk-UEFAPTBV.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.7");process.exit(0)}
2
+ import{a,b,c}from"./chunk-ZETZATNY.js";import"./chunk-EL2WLSUI.js";import"./chunk-CDFYF33M.js";import"./chunk-JNEG6DKU.js";import"./chunk-YV2PVXJE.js";import"./chunk-WLYSZV5U.js";import"./chunk-MR7V7QVL.js";import"./chunk-UEFAPTBV.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.7");process.exit(0)}
2
+ import{a,b}from"./chunk-BJKRAFS2.js";import"./chunk-XB2GVTY6.js";import"./chunk-EFHR7LML.js";import"./chunk-OURDPRGM.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import"./chunk-WLYSZV5U.js";import"./chunk-MR7V7QVL.js";import"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import"./chunk-UEFAPTBV.js";export{a as RoutingFeedbackCollector,b as createRoutingFeedbackCollector};
@@ -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.6");process.exit(0)}
2
- import{b as u}from"./chunk-AFOGTLSY.js";import{c as m}from"./chunk-PKD6LEQZ.js";import"./chunk-RZLRPLRC.js";import"./chunk-QGEZJKVO.js";import"./chunk-SQCNABS4.js";import"./chunk-YV34KLBV.js";import"./chunk-MA7OLK56.js";import"./chunk-BHOJLQLF.js";import"./chunk-MROCXAXJ.js";import{a as l,c as f}from"./chunk-Z5IOTEQI.js";import"./chunk-CU3LGMOK.js";import"./chunk-775KESYW.js";import"./chunk-5AXU6KCI.js";import"./chunk-YQ7X6LKA.js";import"./chunk-5CKG46BM.js";import"./chunk-EJSRKZ5M.js";import"./chunk-SYYGXU7I.js";import"./chunk-V2IUGAJ7.js";import"./chunk-NSRIYP76.js";import"./chunk-N5CEEWWJ.js";f();import o from"chalk";var d=class{name="routing";description="View routing performance, economics, and accuracy";cleanupAndExit;constructor(n){this.cleanupAndExit=n}getHelp(){return["aqe routing economics [--complexity <0-1>] [--json] Show tier efficiency & budget","aqe routing accuracy [--json] Show routing accuracy analysis","aqe routing metrics [--json] Show per-agent performance"].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.7");process.exit(0)}
2
+ import{b as u}from"./chunk-BJKRAFS2.js";import{c as m}from"./chunk-XB2GVTY6.js";import"./chunk-EFHR7LML.js";import"./chunk-OURDPRGM.js";import"./chunk-JRHKFRUB.js";import"./chunk-ECRYU5XG.js";import"./chunk-N5SLJOBK.js";import"./chunk-6OKXGDT3.js";import"./chunk-WLYSZV5U.js";import{a as l,c as f}from"./chunk-MR7V7QVL.js";import"./chunk-TD2WOW75.js";import"./chunk-STASZVMY.js";import"./chunk-LZ34CKYE.js";import"./chunk-QKJ4LUAM.js";import"./chunk-YR5ZNQT2.js";import"./chunk-JZYCZMHN.js";import"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import"./chunk-WV3R5JFE.js";import"./chunk-UEFAPTBV.js";f();import o from"chalk";var d=class{name="routing";description="View routing performance, economics, and accuracy";cleanupAndExit;constructor(n){this.cleanupAndExit=n}getHelp(){return["aqe routing economics [--complexity <0-1>] [--json] Show tier efficiency & budget","aqe routing accuracy [--json] Show routing accuracy analysis","aqe routing metrics [--json] Show per-agent performance"].join(`
3
3
  `)}register(n,r){let t=n.command("routing").description(this.description);t.command("economics").description("Show economic routing report: tier efficiency, budget, savings").option("-c, --complexity <value>","Task complexity for scoring (0-1)","0.5").option("--json","Output as JSON").action(async e=>{await this.executeEconomics(parseFloat(e.complexity)||.5,!!e.json)}),t.command("accuracy").description("Show routing accuracy analysis").option("--json","Output as JSON").action(async e=>{await this.executeAccuracy(!!e.json)}),t.command("metrics").description("Show per-agent performance metrics").option("--json","Output as JSON").action(async e=>{await this.executeMetrics(!!e.json)})}async executeEconomics(n,r){try{let t=u(100);await t.initialize(),t.enableEconomicRouting({},m());let e=t.getEconomicReport();if(!e){console.error(o.red(`
4
4
  Economic routing is not available.
5
5
  `)),await this.cleanupAndExit(1);return}if(r){console.log(JSON.stringify(e,(a,s)=>s===1/0?"Infinity":s,2)),await this.cleanupAndExit(0);return}console.log(o.blue(`
@@ -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.6");process.exit(0)}
2
- import{a as p,c as h}from"./chunk-SYYGXU7I.js";import"./chunk-V2IUGAJ7.js";import{S as A,a as u,b as f,c as d}from"./chunk-NSRIYP76.js";import{a as y}from"./chunk-N5CEEWWJ.js";A();h();import{Command as S}from"commander";import e from"chalk";var F=[{name:"hnswlib-node",flag:"useNativeHNSW",fallback:"ProgressiveHnswBackend"},{name:"prime-radiant-advanced-wasm",flag:"useCoherenceGate",fallback:"Word-frequency heuristics"},{name:"@ruvector/sona",flag:"useSONAThreeLoop",fallback:"TypeScript MicroLoRA/EWC++"}],D={useQESONA:"Self-Optimizing Neural Architecture",useQEFlashAttention:"SIMD-accelerated attention computation",useQEGNNIndex:"Differentiable search and HNSW indexing",logMigrationMetrics:"Log migration metrics during rollout",useNativeHNSW:"Native HNSW backend (hnswlib-node, C++ Hnswlib reference)",useTemporalCompression:"Temporal tensor compression (ADR-085)",useMetadataFiltering:"SIMD-accelerated metadata filtering",useDeterministicDither:"Cross-platform deterministic dithering",useNeuralRouting:"Neural model routing via FastGRNN (ADR-082)",useSONAThreeLoop:"SONA Three-Loop Engine (Task 2.2)",useCrossDomainTransfer:"Cross-domain transfer learning (ADR-084)",useHnswHealthMonitor:"HNSW health monitor (Task 3.4)",useRegretTracking:"Regret tracking & learning health (Task 2.4)",useCoherenceGate:"Sheaf-gated coherence validation (ADR-083, Task 3.1)",useWitnessChain:"SHA-256 hash-chained witness records (Task 3.1)",useCNNVisualRegression:"CNN visual regression testing (Task 4.3)",useDAGAttention:"DAG attention for test scheduling (Task 4.2)",useCoherenceActionGate:"Coherence-gated agent actions (ADR-083, Task 3.2)",useReasoningQEC:"Reasoning QEC error correction (Task 4.5)",useRVFPatternStore:"RVF-backed PatternStore with persistent HNSW (ADR-066)",useAgentMemoryBranching:"Agent memory branching via RVF COW (ADR-067)",useUnifiedHnsw:"Unified HNSW provider replacing 3 legacy impls (ADR-071)",rvfMigrationStage:"RVF migration stage 0-4: sqlite\u2192hybrid\u2192dual\u2192rvf-primary (ADR-072)",useHDCFingerprinting:"HDC pattern fingerprinting (R1, ADR-087)",useCusumDriftDetection:"CUSUM drift detection (R2, ADR-087)",useDeltaEventSourcing:"Delta event sourcing (R3, ADR-087)",useEwcPlusPlusRegularization:"EWC++ regularization (ADR-087)",useGraphMAEEmbeddings:"GraphMAE self-supervised embeddings (R4, ADR-087)",useHopfieldMemory:"Modern Hopfield memory (R5, ADR-087)",useColdTierGNN:"Cold-tier GNN training (R6, ADR-087)",useMetaLearningEnhancements:"Meta-learning enhancements (R7, ADR-087)",useSublinearSolver:"Sublinear PageRank solver (R8, ADR-087)",useSpectralSparsification:"Spectral graph sparsification (R9, ADR-087)",useReservoirReplay:"Reservoir replay with coherence gating (R10, ADR-087)",useEpropOnlineLearning:"E-prop online learning, RL algorithm #10 (R11, ADR-087)",useGrangerCausality:"Granger causality for test failure prediction (R12, ADR-087)",useCognitiveRouting:"Cognitive routing with predictive delta compression (R13, ADR-087)",useHyperbolicHnsw:"Hyperbolic HNSW with Poincare ball embeddings (R14, ADR-087)"},m={performance:{useNativeHNSW:!0,useTemporalCompression:!0,useDeterministicDither:!0},experimental:{useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!0,useTemporalCompression:!0,useMetadataFiltering:!0,useDeterministicDither:!0,useNeuralRouting:!0},safe:{useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!1,useTemporalCompression:!1,useMetadataFiltering:!1,useDeterministicDither:!1,useNeuralRouting:!1}},g=Object.keys(u);function b(o){try{return y.resolve(o),!0}catch{return!1}}function v(o,s){return u[o]===s}function i(o,s){return o.padEnd(s)}function N(o){return o<1024?`${o}B`:o<1024*1024?`${(o/1024).toFixed(1)}KB`:o<1024*1024*1024?`${(o/(1024*1024)).toFixed(1)}MB`:`${(o/(1024*1024*1024)).toFixed(2)}GB`}function k(o){return g.includes(o)}function C(o){return o in m}function T(){let o=f();console.log(""),console.log(e.bold.blue("RuVector Integration Status:")),console.log(e.cyan(" Native Packages:"));for(let t of F){let a=b(t.name)?e.green("installed"):e.gray(`not installed (fallback: ${t.fallback})`);console.log(` ${i(t.name+":",30)} ${a}`)}console.log(""),console.log(e.cyan(" Feature Flags:"));for(let t of g){let r=o[t],a=v(t,r),n=typeof r=="number"?e.cyan(String(r)):r?e.green("true"):e.gray("false"),l=a?e.gray(" (default)"):e.yellow(" (modified)");console.log(` ${i(t+":",30)} ${n}${l}`)}let s=p.listIndexes();if(s.length>0){console.log(""),console.log(e.cyan(" HNSW Memory Usage:"));let t=0,r=0;for(let a of s){let n=p.get(a);if(n){let l=n.size(),c=n.dimensions(),R=l*c*4*3;t+=l,r+=R,console.log(` ${i(a+":",20)} ${e.white(String(l))} vectors, ${e.white(c)}d, ~${e.white(N(R))}`)}}console.log(e.gray(` ${"\u2500".repeat(50)}`)),console.log(` ${i("Total:",20)} ${e.bold.white(String(t))} vectors, ~${e.bold.white(N(r))}`)}else console.log(""),console.log(e.cyan(" HNSW Memory Usage:")),console.log(e.gray(" No active indexes (indexes are created on first use)"));o.useTemporalCompression&&(console.log(""),console.log(e.cyan(" Temporal Compression:")),console.log(e.gray(" Hot tier: 8-bit quantization (frequently accessed patterns)")),console.log(e.gray(" Warm tier: 5-bit quantization (moderately accessed patterns)")),console.log(e.gray(" Cold tier: 3-bit quantization (rarely accessed patterns)")),console.log(e.gray(" Estimated memory savings: 40-60% for cold patterns"))),console.log("")}function x(o){if(o.profile){if(!C(o.profile)){console.log(""),console.log(e.red(` Unknown profile: ${o.profile}`)),console.log(e.gray(` Valid profiles: ${Object.keys(m).join(", ")}`)),console.log(""),process.exit(1);return}let t=m[o.profile];d(t),console.log(""),console.log(e.bold.blue(`Setting ${o.profile} profile:`));for(let[r,a]of Object.entries(t)){let n=a?e.green("true"):e.gray("false");console.log(` ${i(r+":",30)} ${n}`)}console.log("");return}if(o.set){let t=o.set.indexOf("=");if(t<=0){console.log(""),console.log(e.red(" Invalid format. Use: --set flagName=true|false")),console.log(""),process.exit(1);return}let r=o.set.substring(0,t),a=o.set.substring(t+1);if(!k(r)){console.log(""),console.log(e.red(` Unknown flag: ${r}`)),console.log(e.gray(` Valid flags: ${g.join(", ")}`)),console.log(""),process.exit(1);return}if(a!=="true"&&a!=="false"){console.log(""),console.log(e.red(` Invalid value: ${a}. Use true or false.`)),console.log(""),process.exit(1);return}let n=a==="true";d({[r]:n});let l=n?e.green("true"):e.gray("false");console.log(""),console.log(e.green(` Set ${r} = ${l}`)),console.log("");return}let s=f();console.log(""),console.log(e.bold.blue("RuVector Feature Flags:")),console.log(""),console.log(e.bold(" "+i("Flag",28)+i("Value",10)+"Description")),console.log(e.gray(" "+"-".repeat(78)));for(let t of g){let r=s[t],a=v(t,r),n=typeof r=="number"?e.cyan(String(r)):r?e.green("true"):e.gray("false"),l=a?"":e.yellow(" *"),c=D[t];console.log(" "+i(t,28)+i(String(r),10)+e.gray(c)+l)}console.log(""),console.log(e.gray(" * = modified from default")),console.log(""),console.log(e.gray(" Profiles: performance, experimental, safe")),console.log(e.gray(" Usage:")),console.log(e.gray(" aqe ruvector flags --set useNativeHNSW=true")),console.log(e.gray(" aqe ruvector flags --profile=performance")),console.log("")}function E(){let o=new S("ruvector").description("RuVector integration management").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.7");process.exit(0)}
2
+ import{a as p,c as h}from"./chunk-HE5VY2BI.js";import"./chunk-GGPGY5QT.js";import{S as A,a as u,b as f,c as d}from"./chunk-WV3R5JFE.js";import{a as y}from"./chunk-UEFAPTBV.js";A();h();import{Command as S}from"commander";import e from"chalk";var F=[{name:"hnswlib-node",flag:"useNativeHNSW",fallback:"ProgressiveHnswBackend"},{name:"prime-radiant-advanced-wasm",flag:"useCoherenceGate",fallback:"Word-frequency heuristics"},{name:"@ruvector/sona",flag:"useSONAThreeLoop",fallback:"TypeScript MicroLoRA/EWC++"}],D={useQESONA:"Self-Optimizing Neural Architecture",useQEFlashAttention:"SIMD-accelerated attention computation",useQEGNNIndex:"Differentiable search and HNSW indexing",logMigrationMetrics:"Log migration metrics during rollout",useNativeHNSW:"Native HNSW backend (hnswlib-node, C++ Hnswlib reference)",useTemporalCompression:"Temporal tensor compression (ADR-085)",useMetadataFiltering:"SIMD-accelerated metadata filtering",useDeterministicDither:"Cross-platform deterministic dithering",useNeuralRouting:"Neural model routing via FastGRNN (ADR-082)",useSONAThreeLoop:"SONA Three-Loop Engine (Task 2.2)",useCrossDomainTransfer:"Cross-domain transfer learning (ADR-084)",useHnswHealthMonitor:"HNSW health monitor (Task 3.4)",useRegretTracking:"Regret tracking & learning health (Task 2.4)",useCoherenceGate:"Sheaf-gated coherence validation (ADR-083, Task 3.1)",useWitnessChain:"SHA-256 hash-chained witness records (Task 3.1)",useCNNVisualRegression:"CNN visual regression testing (Task 4.3)",useDAGAttention:"DAG attention for test scheduling (Task 4.2)",useCoherenceActionGate:"Coherence-gated agent actions (ADR-083, Task 3.2)",useReasoningQEC:"Reasoning QEC error correction (Task 4.5)",useRVFPatternStore:"RVF-backed PatternStore with persistent HNSW (ADR-066)",useAgentMemoryBranching:"Agent memory branching via RVF COW (ADR-067)",useUnifiedHnsw:"Unified HNSW provider replacing 3 legacy impls (ADR-071)",rvfMigrationStage:"RVF migration stage 0-4: sqlite\u2192hybrid\u2192dual\u2192rvf-primary (ADR-072)",useHDCFingerprinting:"HDC pattern fingerprinting (R1, ADR-087)",useCusumDriftDetection:"CUSUM drift detection (R2, ADR-087)",useDeltaEventSourcing:"Delta event sourcing (R3, ADR-087)",useEwcPlusPlusRegularization:"EWC++ regularization (ADR-087)",useGraphMAEEmbeddings:"GraphMAE self-supervised embeddings (R4, ADR-087)",useHopfieldMemory:"Modern Hopfield memory (R5, ADR-087)",useColdTierGNN:"Cold-tier GNN training (R6, ADR-087)",useMetaLearningEnhancements:"Meta-learning enhancements (R7, ADR-087)",useSublinearSolver:"Sublinear PageRank solver (R8, ADR-087)",useSpectralSparsification:"Spectral graph sparsification (R9, ADR-087)",useReservoirReplay:"Reservoir replay with coherence gating (R10, ADR-087)",useEpropOnlineLearning:"E-prop online learning, RL algorithm #10 (R11, ADR-087)",useGrangerCausality:"Granger causality for test failure prediction (R12, ADR-087)",useCognitiveRouting:"Cognitive routing with predictive delta compression (R13, ADR-087)",useHyperbolicHnsw:"Hyperbolic HNSW with Poincare ball embeddings (R14, ADR-087)"},m={performance:{useNativeHNSW:!0,useTemporalCompression:!0,useDeterministicDither:!0},experimental:{useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!0,useTemporalCompression:!0,useMetadataFiltering:!0,useDeterministicDither:!0,useNeuralRouting:!0},safe:{useQESONA:!0,useQEFlashAttention:!0,useQEGNNIndex:!0,logMigrationMetrics:!0,useNativeHNSW:!1,useTemporalCompression:!1,useMetadataFiltering:!1,useDeterministicDither:!1,useNeuralRouting:!1}},g=Object.keys(u);function b(o){try{return y.resolve(o),!0}catch{return!1}}function v(o,s){return u[o]===s}function i(o,s){return o.padEnd(s)}function N(o){return o<1024?`${o}B`:o<1024*1024?`${(o/1024).toFixed(1)}KB`:o<1024*1024*1024?`${(o/(1024*1024)).toFixed(1)}MB`:`${(o/(1024*1024*1024)).toFixed(2)}GB`}function k(o){return g.includes(o)}function C(o){return o in m}function T(){let o=f();console.log(""),console.log(e.bold.blue("RuVector Integration Status:")),console.log(e.cyan(" Native Packages:"));for(let t of F){let a=b(t.name)?e.green("installed"):e.gray(`not installed (fallback: ${t.fallback})`);console.log(` ${i(t.name+":",30)} ${a}`)}console.log(""),console.log(e.cyan(" Feature Flags:"));for(let t of g){let r=o[t],a=v(t,r),n=typeof r=="number"?e.cyan(String(r)):r?e.green("true"):e.gray("false"),l=a?e.gray(" (default)"):e.yellow(" (modified)");console.log(` ${i(t+":",30)} ${n}${l}`)}let s=p.listIndexes();if(s.length>0){console.log(""),console.log(e.cyan(" HNSW Memory Usage:"));let t=0,r=0;for(let a of s){let n=p.get(a);if(n){let l=n.size(),c=n.dimensions(),R=l*c*4*3;t+=l,r+=R,console.log(` ${i(a+":",20)} ${e.white(String(l))} vectors, ${e.white(c)}d, ~${e.white(N(R))}`)}}console.log(e.gray(` ${"\u2500".repeat(50)}`)),console.log(` ${i("Total:",20)} ${e.bold.white(String(t))} vectors, ~${e.bold.white(N(r))}`)}else console.log(""),console.log(e.cyan(" HNSW Memory Usage:")),console.log(e.gray(" No active indexes (indexes are created on first use)"));o.useTemporalCompression&&(console.log(""),console.log(e.cyan(" Temporal Compression:")),console.log(e.gray(" Hot tier: 8-bit quantization (frequently accessed patterns)")),console.log(e.gray(" Warm tier: 5-bit quantization (moderately accessed patterns)")),console.log(e.gray(" Cold tier: 3-bit quantization (rarely accessed patterns)")),console.log(e.gray(" Estimated memory savings: 40-60% for cold patterns"))),console.log("")}function x(o){if(o.profile){if(!C(o.profile)){console.log(""),console.log(e.red(` Unknown profile: ${o.profile}`)),console.log(e.gray(` Valid profiles: ${Object.keys(m).join(", ")}`)),console.log(""),process.exit(1);return}let t=m[o.profile];d(t),console.log(""),console.log(e.bold.blue(`Setting ${o.profile} profile:`));for(let[r,a]of Object.entries(t)){let n=a?e.green("true"):e.gray("false");console.log(` ${i(r+":",30)} ${n}`)}console.log("");return}if(o.set){let t=o.set.indexOf("=");if(t<=0){console.log(""),console.log(e.red(" Invalid format. Use: --set flagName=true|false")),console.log(""),process.exit(1);return}let r=o.set.substring(0,t),a=o.set.substring(t+1);if(!k(r)){console.log(""),console.log(e.red(` Unknown flag: ${r}`)),console.log(e.gray(` Valid flags: ${g.join(", ")}`)),console.log(""),process.exit(1);return}if(a!=="true"&&a!=="false"){console.log(""),console.log(e.red(` Invalid value: ${a}. Use true or false.`)),console.log(""),process.exit(1);return}let n=a==="true";d({[r]:n});let l=n?e.green("true"):e.gray("false");console.log(""),console.log(e.green(` Set ${r} = ${l}`)),console.log("");return}let s=f();console.log(""),console.log(e.bold.blue("RuVector Feature Flags:")),console.log(""),console.log(e.bold(" "+i("Flag",28)+i("Value",10)+"Description")),console.log(e.gray(" "+"-".repeat(78)));for(let t of g){let r=s[t],a=v(t,r),n=typeof r=="number"?e.cyan(String(r)):r?e.green("true"):e.gray("false"),l=a?"":e.yellow(" *"),c=D[t];console.log(" "+i(t,28)+i(String(r),10)+e.gray(c)+l)}console.log(""),console.log(e.gray(" * = modified from default")),console.log(""),console.log(e.gray(" Profiles: performance, experimental, safe")),console.log(e.gray(" Usage:")),console.log(e.gray(" aqe ruvector flags --set useNativeHNSW=true")),console.log(e.gray(" aqe ruvector flags --profile=performance")),console.log("")}function E(){let o=new S("ruvector").description("RuVector integration management").addHelpText("after",`
3
3
  Examples:
4
4
  $ aqe ruvector status Show native packages and flags
5
5
  $ aqe ruvector flags List all feature flags
@@ -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.6");process.exit(0)}
2
- import{a,b}from"./chunk-TPXS5KEC.js";import"./chunk-N5CEEWWJ.js";export{a as RvfDualWriter,b as createDualWriter};
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.7");process.exit(0)}
2
+ import{a,b}from"./chunk-LPLCT2HH.js";import"./chunk-UEFAPTBV.js";export{a as RvfDualWriter,b as createDualWriter};
@@ -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.6");process.exit(0)}
2
- import{a,b}from"./chunk-YWWQRNKI.js";import"./chunk-N5CEEWWJ.js";export{b as RvfMigrationAdapter,a as STAGE_NAMES};
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.7");process.exit(0)}
2
+ import{a,b}from"./chunk-SURZYSSL.js";import"./chunk-UEFAPTBV.js";export{b as RvfMigrationAdapter,a as STAGE_NAMES};
@@ -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.6");process.exit(0)}
2
- import{a as m,b as p}from"./chunk-YWWQRNKI.js";import"./chunk-N5CEEWWJ.js";var v={sampleSize:50,windowDurationMs:6048e5,compactionThreshold:.3,scoreTolerance:.05},l=class{config;db=null;rvfStore=null;history=[];constructor(t){this.config={...v,...t}}setSqliteDb(t){this.db=t}setRvfStore(t){this.rvfStore=t}runCheck(){let t={timestamp:Date.now(),samplesChecked:0,divergences:0,divergenceRate:0,details:[],deadSpaceRatio:null,compactionTriggered:!1};if(!this.db||!this.rvfStore)return this.history.push(t),t;let e=this.getSampleIds(this.config.sampleSize);if(t.samplesChecked=e.length,e.length===0)return this.history.push(t),t;for(let a of e){let n=this.getSqliteEmbedding(a);if(!n){t.divergences++,t.details.push({patternId:a,issue:"missing-in-sqlite"});continue}try{let i=this.rvfStore.search(n,1);i.length===0?(t.divergences++,t.details.push({patternId:a,issue:"missing-in-rvf"})):i[0].id!==a&&i[0].score<.99&&(t.divergences++,t.details.push({patternId:a,issue:"score-mismatch",rvfScore:i[0].score}))}catch{t.divergences++,t.details.push({patternId:a,issue:"missing-in-rvf"})}}t.divergenceRate=t.samplesChecked>0?t.divergences/t.samplesChecked:0;try{let n=this.rvfStore.status().deadSpaceRatio;t.deadSpaceRatio=n??null,n!=null&&n>this.config.compactionThreshold&&(this.triggerCompaction(),t.compactionTriggered=!0)}catch{}return this.history.push(t),this.pruneHistory(),t}getRollingDivergenceRate(){let t=Date.now()-this.config.windowDurationMs,e=this.history.filter(i=>i.timestamp>=t);if(e.length===0)return 0;let a=e.reduce((i,r)=>i+r.samplesChecked,0),n=e.reduce((i,r)=>i+r.divergences,0);return a>0?n/a:0}getCheckCount(){let t=Date.now()-this.config.windowDurationMs;return this.history.filter(e=>e.timestamp>=t).length}getHistory(){let t=Date.now()-this.config.windowDurationMs;return this.history.filter(e=>e.timestamp>=t)}getSampleIds(t){if(!this.db)return[];try{return this.db.prepare("SELECT pattern_id FROM qe_pattern_embeddings ORDER BY RANDOM() LIMIT ?").all(t).map(a=>a.pattern_id)}catch{return[]}}getSqliteEmbedding(t){if(!this.db)return null;try{let e=this.db.prepare("SELECT embedding, dimension FROM qe_pattern_embeddings WHERE pattern_id = ?").get(t);return e?new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension):null}catch{return null}}triggerCompaction(){try{this.rvfStore.compact?.()}catch{}}pruneHistory(){let t=Date.now()-this.config.windowDurationMs;this.history=this.history.filter(e=>e.timestamp>=t)}};var S={maxDivergenceRate2to3:1e-4,maxReadLatencyRatio2to3:2,maxFallbacks3to4:0,maxWriteLatencyRatio3to4:1.5,minChecksRequired:10},g=class{config;witnessChain=null;constructor(t){this.config={...S,...t}}setWitnessChain(t){this.witnessChain=t}evaluate(t,e,a){let n=Math.min(t+1,4);if(t>=4)return{canPromote:!1,currentStage:t,targetStage:4,checks:[],summary:"Already at maximum stage (4: RVF primary)"};if(t<2)return{canPromote:!0,currentStage:t,targetStage:n,checks:[],summary:`Stage ${t}\u2192${n} has no automated gates \u2014 manual promotion allowed`};let i=[];if(t===2){let s=e.getRollingDivergenceRate(),o=e.getCheckCount();i.push({name:"consistency-checks-count",passed:o>=this.config.minChecksRequired,actual:`${o} checks`,threshold:`>= ${this.config.minChecksRequired} checks`}),i.push({name:"divergence-rate",passed:s<=this.config.maxDivergenceRate2to3,actual:`${(s*100).toFixed(4)}%`,threshold:`<= ${(this.config.maxDivergenceRate2to3*100).toFixed(4)}%`});let c=a.sqliteReadLatencyAvgMs>0?a.rvfReadLatencyAvgMs/a.sqliteReadLatencyAvgMs:0;i.push({name:"read-latency-ratio",passed:c<=this.config.maxReadLatencyRatio2to3||a.rvfReadLatencyAvgMs===0,actual:`${c.toFixed(2)}x`,threshold:`<= ${this.config.maxReadLatencyRatio2to3}x`})}if(t===3){i.push({name:"fallback-count",passed:a.fallbacksUsed<=this.config.maxFallbacks3to4,actual:`${a.fallbacksUsed} fallbacks`,threshold:`<= ${this.config.maxFallbacks3to4} fallbacks`});let s=a.sqliteWriteLatencyAvgMs??a.sqliteReadLatencyAvgMs,o=a.rvfWriteLatencyAvgMs??a.rvfReadLatencyAvgMs,c=s>0?o/s:0;i.push({name:"write-latency-ratio",passed:c<=this.config.maxWriteLatencyRatio3to4||o===0,actual:`${c.toFixed(2)}x`,threshold:`<= ${this.config.maxWriteLatencyRatio3to4}x`})}let r=i.length>0&&i.every(s=>s.passed),u=i.filter(s=>!s.passed).map(s=>s.name);return{canPromote:r,currentStage:t,targetStage:n,checks:i,summary:r?`All gates passed \u2014 safe to promote to stage ${n}`:`Blocked: ${u.join(", ")} failed`}}promote(t,e,a,n=!1){let i=this.evaluate(t,e,a);if(!i.canPromote&&!n)return this.recordWitness("QUALITY_GATE_FAIL",{action:"stage-promotion-blocked",from:t,to:i.targetStage,failedChecks:i.checks.filter(u=>!u.passed),summary:i.summary}),{promoted:!1,newStage:t,result:i};let r=i.targetStage;return this.recordWitness("QUALITY_GATE_PASS",{action:n?"stage-promotion-forced":"stage-promotion-approved",from:t,to:r,checks:i.checks,forced:n,summary:i.summary}),{promoted:!0,newStage:r,result:i}}recordWitness(t,e){try{this.witnessChain?.append(t,e,"rvf-stage-gate")}catch{}}};var d=null,f=class h{adapter;validator;gate;currentStage;initialized=!1;constructor(t){this.currentStage=t?.stage??1,this.adapter=new p({stage:this.currentStage,rvfPath:t?.rvfPath??".agentic-qe/patterns.rvf",dimensions:t?.dimensions??384,enableFallback:!0}),this.validator=new l({sampleSize:50,windowDurationMs:10080*60*1e3,compactionThreshold:.3,scoreTolerance:.05}),this.gate=new g({minChecksRequired:10})}attachSqliteDb(t){this.adapter.setSqliteDb(t),this.validator.setSqliteDb(t)}attachRvfStore(t){this.adapter.setRvfStore(t),this.validator.setRvfStore(t)}attachWitnessChain(t){this.gate.setWitnessChain(t)}async initialize(){if(!this.initialized){if(this.currentStage===1)try{let{getRvfMigrationStage:t}=await import("./feature-flags-AEO5C73R.js"),e=t();this.currentStage=e,this.adapter.setStage(e)}catch{}try{let{UnifiedMemoryManager:t}=await import("./unified-memory-OYIJOZ2E.js"),e=t.getInstance();await e.initialize();let a=e.getDatabase();a&&this.attachSqliteDb(a)}catch{}try{let{getSharedRvfAdapter:t}=await import("./shared-rvf-adapter-PNVIYEDK.js"),e=t();e&&this.attachRvfStore(e)}catch{}try{let{WitnessChain:t}=await import("./witness-chain-QIARNA6D.js"),e=new t;await e.initialize(),this.attachWitnessChain(e)}catch{}this.initialized=!0}}getStatus(){let t=this.adapter.getMetrics(),e=this.adapter.status(),a=this.validator.getHistory(),n=this.gate.evaluate(this.currentStage,this.validator,t);return{stage:this.currentStage,stageName:m[this.currentStage],metrics:t,consistencyHistory:{totalChecks:this.validator.getCheckCount(),rollingDivergenceRate:this.validator.getRollingDivergenceRate(),lastCheck:a.length>0?a[a.length-1]:null},gateEvaluation:n,engineStatus:{sqliteVectorCount:e.sqlite.vectorCount,rvfAvailable:e.rvf!==null,rvfVectorCount:e.rvf?.totalVectors??null,rvfDeadSpaceRatio:e.rvf?.deadSpaceRatio??null}}}runConsistencyCheck(){return this.validator.runCheck()}evaluateGate(){return this.gate.evaluate(this.currentStage,this.validator,this.adapter.getMetrics())}promote(t=!1){let e=this.currentStage,{promoted:a,newStage:n,result:i}=this.gate.promote(this.currentStage,this.validator,this.adapter.getMetrics(),t);return a&&(this.currentStage=n,this.adapter.setStage(n)),{promoted:a,previousStage:e,newStage:n,result:i}}write(t,e){return this.adapter.write(t,e)}search(t,e){return this.adapter.search(t,e)}getAdapter(){return this.adapter}static getInstance(t){return d||(d=new h(t)),d}static resetInstance(){d=null}};export{f as RvfMigrationCoordinator};
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.7");process.exit(0)}
2
+ import{a as m,b as p}from"./chunk-SURZYSSL.js";import"./chunk-UEFAPTBV.js";var v={sampleSize:50,windowDurationMs:6048e5,compactionThreshold:.3,scoreTolerance:.05},l=class{config;db=null;rvfStore=null;history=[];constructor(t){this.config={...v,...t}}setSqliteDb(t){this.db=t}setRvfStore(t){this.rvfStore=t}runCheck(){let t={timestamp:Date.now(),samplesChecked:0,divergences:0,divergenceRate:0,details:[],deadSpaceRatio:null,compactionTriggered:!1};if(!this.db||!this.rvfStore)return this.history.push(t),t;let e=this.getSampleIds(this.config.sampleSize);if(t.samplesChecked=e.length,e.length===0)return this.history.push(t),t;for(let a of e){let n=this.getSqliteEmbedding(a);if(!n){t.divergences++,t.details.push({patternId:a,issue:"missing-in-sqlite"});continue}try{let i=this.rvfStore.search(n,1);i.length===0?(t.divergences++,t.details.push({patternId:a,issue:"missing-in-rvf"})):i[0].id!==a&&i[0].score<.99&&(t.divergences++,t.details.push({patternId:a,issue:"score-mismatch",rvfScore:i[0].score}))}catch{t.divergences++,t.details.push({patternId:a,issue:"missing-in-rvf"})}}t.divergenceRate=t.samplesChecked>0?t.divergences/t.samplesChecked:0;try{let n=this.rvfStore.status().deadSpaceRatio;t.deadSpaceRatio=n??null,n!=null&&n>this.config.compactionThreshold&&(this.triggerCompaction(),t.compactionTriggered=!0)}catch{}return this.history.push(t),this.pruneHistory(),t}getRollingDivergenceRate(){let t=Date.now()-this.config.windowDurationMs,e=this.history.filter(i=>i.timestamp>=t);if(e.length===0)return 0;let a=e.reduce((i,r)=>i+r.samplesChecked,0),n=e.reduce((i,r)=>i+r.divergences,0);return a>0?n/a:0}getCheckCount(){let t=Date.now()-this.config.windowDurationMs;return this.history.filter(e=>e.timestamp>=t).length}getHistory(){let t=Date.now()-this.config.windowDurationMs;return this.history.filter(e=>e.timestamp>=t)}getSampleIds(t){if(!this.db)return[];try{return this.db.prepare("SELECT pattern_id FROM qe_pattern_embeddings ORDER BY RANDOM() LIMIT ?").all(t).map(a=>a.pattern_id)}catch{return[]}}getSqliteEmbedding(t){if(!this.db)return null;try{let e=this.db.prepare("SELECT embedding, dimension FROM qe_pattern_embeddings WHERE pattern_id = ?").get(t);return e?new Float32Array(e.embedding.buffer,e.embedding.byteOffset,e.dimension):null}catch{return null}}triggerCompaction(){try{this.rvfStore.compact?.()}catch{}}pruneHistory(){let t=Date.now()-this.config.windowDurationMs;this.history=this.history.filter(e=>e.timestamp>=t)}};var S={maxDivergenceRate2to3:1e-4,maxReadLatencyRatio2to3:2,maxFallbacks3to4:0,maxWriteLatencyRatio3to4:1.5,minChecksRequired:10},g=class{config;witnessChain=null;constructor(t){this.config={...S,...t}}setWitnessChain(t){this.witnessChain=t}evaluate(t,e,a){let n=Math.min(t+1,4);if(t>=4)return{canPromote:!1,currentStage:t,targetStage:4,checks:[],summary:"Already at maximum stage (4: RVF primary)"};if(t<2)return{canPromote:!0,currentStage:t,targetStage:n,checks:[],summary:`Stage ${t}\u2192${n} has no automated gates \u2014 manual promotion allowed`};let i=[];if(t===2){let s=e.getRollingDivergenceRate(),o=e.getCheckCount();i.push({name:"consistency-checks-count",passed:o>=this.config.minChecksRequired,actual:`${o} checks`,threshold:`>= ${this.config.minChecksRequired} checks`}),i.push({name:"divergence-rate",passed:s<=this.config.maxDivergenceRate2to3,actual:`${(s*100).toFixed(4)}%`,threshold:`<= ${(this.config.maxDivergenceRate2to3*100).toFixed(4)}%`});let c=a.sqliteReadLatencyAvgMs>0?a.rvfReadLatencyAvgMs/a.sqliteReadLatencyAvgMs:0;i.push({name:"read-latency-ratio",passed:c<=this.config.maxReadLatencyRatio2to3||a.rvfReadLatencyAvgMs===0,actual:`${c.toFixed(2)}x`,threshold:`<= ${this.config.maxReadLatencyRatio2to3}x`})}if(t===3){i.push({name:"fallback-count",passed:a.fallbacksUsed<=this.config.maxFallbacks3to4,actual:`${a.fallbacksUsed} fallbacks`,threshold:`<= ${this.config.maxFallbacks3to4} fallbacks`});let s=a.sqliteWriteLatencyAvgMs??a.sqliteReadLatencyAvgMs,o=a.rvfWriteLatencyAvgMs??a.rvfReadLatencyAvgMs,c=s>0?o/s:0;i.push({name:"write-latency-ratio",passed:c<=this.config.maxWriteLatencyRatio3to4||o===0,actual:`${c.toFixed(2)}x`,threshold:`<= ${this.config.maxWriteLatencyRatio3to4}x`})}let r=i.length>0&&i.every(s=>s.passed),u=i.filter(s=>!s.passed).map(s=>s.name);return{canPromote:r,currentStage:t,targetStage:n,checks:i,summary:r?`All gates passed \u2014 safe to promote to stage ${n}`:`Blocked: ${u.join(", ")} failed`}}promote(t,e,a,n=!1){let i=this.evaluate(t,e,a);if(!i.canPromote&&!n)return this.recordWitness("QUALITY_GATE_FAIL",{action:"stage-promotion-blocked",from:t,to:i.targetStage,failedChecks:i.checks.filter(u=>!u.passed),summary:i.summary}),{promoted:!1,newStage:t,result:i};let r=i.targetStage;return this.recordWitness("QUALITY_GATE_PASS",{action:n?"stage-promotion-forced":"stage-promotion-approved",from:t,to:r,checks:i.checks,forced:n,summary:i.summary}),{promoted:!0,newStage:r,result:i}}recordWitness(t,e){try{this.witnessChain?.append(t,e,"rvf-stage-gate")}catch{}}};var d=null,f=class h{adapter;validator;gate;currentStage;initialized=!1;constructor(t){this.currentStage=t?.stage??1,this.adapter=new p({stage:this.currentStage,rvfPath:t?.rvfPath??".agentic-qe/patterns.rvf",dimensions:t?.dimensions??384,enableFallback:!0}),this.validator=new l({sampleSize:50,windowDurationMs:10080*60*1e3,compactionThreshold:.3,scoreTolerance:.05}),this.gate=new g({minChecksRequired:10})}attachSqliteDb(t){this.adapter.setSqliteDb(t),this.validator.setSqliteDb(t)}attachRvfStore(t){this.adapter.setRvfStore(t),this.validator.setRvfStore(t)}attachWitnessChain(t){this.gate.setWitnessChain(t)}async initialize(){if(!this.initialized){if(this.currentStage===1)try{let{getRvfMigrationStage:t}=await import("./feature-flags-DWS4XL2P.js"),e=t();this.currentStage=e,this.adapter.setStage(e)}catch{}try{let{UnifiedMemoryManager:t}=await import("./unified-memory-EXRANFUS.js"),e=t.getInstance();await e.initialize();let a=e.getDatabase();a&&this.attachSqliteDb(a)}catch{}try{let{getSharedRvfAdapter:t}=await import("./shared-rvf-adapter-6UVVDOHK.js"),e=t();e&&this.attachRvfStore(e)}catch{}try{let{WitnessChain:t}=await import("./witness-chain-7LIPUVMI.js"),e=new t;await e.initialize(),this.attachWitnessChain(e)}catch{}this.initialized=!0}}getStatus(){let t=this.adapter.getMetrics(),e=this.adapter.status(),a=this.validator.getHistory(),n=this.gate.evaluate(this.currentStage,this.validator,t);return{stage:this.currentStage,stageName:m[this.currentStage],metrics:t,consistencyHistory:{totalChecks:this.validator.getCheckCount(),rollingDivergenceRate:this.validator.getRollingDivergenceRate(),lastCheck:a.length>0?a[a.length-1]:null},gateEvaluation:n,engineStatus:{sqliteVectorCount:e.sqlite.vectorCount,rvfAvailable:e.rvf!==null,rvfVectorCount:e.rvf?.totalVectors??null,rvfDeadSpaceRatio:e.rvf?.deadSpaceRatio??null}}}runConsistencyCheck(){return this.validator.runCheck()}evaluateGate(){return this.gate.evaluate(this.currentStage,this.validator,this.adapter.getMetrics())}promote(t=!1){let e=this.currentStage,{promoted:a,newStage:n,result:i}=this.gate.promote(this.currentStage,this.validator,this.adapter.getMetrics(),t);return a&&(this.currentStage=n,this.adapter.setStage(n)),{promoted:a,previousStage:e,newStage:n,result:i}}write(t,e){return this.adapter.write(t,e)}search(t,e){return this.adapter.search(t,e)}getAdapter(){return this.adapter}static getInstance(t){return d||(d=new h(t)),d}static resetInstance(){d=null}};export{f as RvfMigrationCoordinator};