agentic-qe 3.9.21 → 3.9.23

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 (290) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +58 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-7U6GXVHU.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-55SQPP6T.js → agent-booster-wasm-QLYJEECV.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-Q2UXL73Y.js → agent-handler-2BAL4D34.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-56GIYNGH.js → agent-memory-branch-24RGSADY.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-O6ISJRDR.js +2 -0
  10. package/dist/cli/chunks/{audit-2JQ3URVN.js → audit-SUNUARKM.js} +2 -2
  11. package/dist/cli/chunks/base-B3HZTLJ2.js +2 -0
  12. package/dist/cli/chunks/{hnswlib-node-UHEP6UZZ.js → better-sqlite3-Y5RYISCI.js} +2 -2
  13. package/dist/cli/chunks/{brain-handler-TOOZFEK5.js → brain-handler-IC347IHT.js} +3 -3
  14. package/dist/cli/chunks/{branch-enumerator-2BLPN73D.js → branch-enumerator-QCWCWYOV.js} +2 -2
  15. package/dist/cli/chunks/{browser-FSVNN36N.js → browser-UQBPN73J.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-WB4O6W3A.js +2 -0
  17. package/dist/cli/chunks/{chunk-KYPN6G7T.js → chunk-2ZUNDAJ5.js} +2 -2
  18. package/dist/cli/chunks/{chunk-IM7X6BDZ.js → chunk-3MFRGZ3U.js} +2 -2
  19. package/dist/cli/chunks/{chunk-S3TU7B7D.js → chunk-3S3SLVU6.js} +2 -2
  20. package/dist/cli/chunks/{chunk-E5TGH4V3.js → chunk-3X3CAXQM.js} +2 -2
  21. package/dist/cli/chunks/{chunk-YVG4D6P3.js → chunk-4CFZIIAE.js} +1 -1
  22. package/dist/cli/chunks/{chunk-56DGV2Q3.js → chunk-4OMHXMCH.js} +1 -1
  23. package/dist/cli/chunks/{chunk-MYZ43VKA.js → chunk-4XN5XAQ4.js} +2 -2
  24. package/dist/cli/chunks/{chunk-P4Q5TMDH.js → chunk-4XOK4DHX.js} +2 -2
  25. package/dist/cli/chunks/{chunk-NKOGDRZE.js → chunk-56CT3U76.js} +2 -2
  26. package/dist/cli/chunks/{chunk-NS2ZWXUK.js → chunk-5MTGPW66.js} +3 -3
  27. package/dist/cli/chunks/{chunk-FBCLQTXO.js → chunk-67UGSBUX.js} +2 -2
  28. package/dist/cli/chunks/{chunk-XEMVYJ2Z.js → chunk-6C5ZHH74.js} +3 -3
  29. package/dist/cli/chunks/{chunk-OK5JHHXK.js → chunk-6SQTWXV4.js} +1 -1
  30. package/dist/cli/chunks/{chunk-E55MYZGP.js → chunk-6XX43MT6.js} +2 -2
  31. package/dist/cli/chunks/{chunk-V5AVC4D4.js → chunk-6YF74LZ5.js} +2 -2
  32. package/dist/cli/chunks/{chunk-GDZ6XQRI.js → chunk-72GIAZOO.js} +1 -1
  33. package/dist/cli/chunks/{chunk-PGHTRQK6.js → chunk-72XRUTMI.js} +2 -2
  34. package/dist/cli/chunks/{chunk-LYZUB3NP.js → chunk-7DUURG7X.js} +1 -1
  35. package/dist/cli/chunks/{chunk-G7ZYDJZ3.js → chunk-7SHZ5BNE.js} +2 -2
  36. package/dist/cli/chunks/{chunk-QPSPIESU.js → chunk-7TYUZ6LI.js} +2 -2
  37. package/dist/cli/chunks/{chunk-4O7YJIOS.js → chunk-AIXYKNIP.js} +2 -2
  38. package/dist/cli/chunks/{chunk-MJGMH7TW.js → chunk-AXWSB3WJ.js} +2 -2
  39. package/dist/cli/chunks/{chunk-WL5IRCU4.js → chunk-BBDC4KSK.js} +2 -2
  40. package/dist/cli/chunks/{chunk-ZUTYZIWQ.js → chunk-BX5MBOPH.js} +2 -2
  41. package/dist/cli/chunks/{chunk-VQXHHEPD.js → chunk-C2XZKYV2.js} +2 -2
  42. package/dist/cli/chunks/{chunk-4XZPDEK5.js → chunk-CBVGJMLJ.js} +1 -1
  43. package/dist/cli/chunks/{chunk-AMOCYHP3.js → chunk-CFWHICPP.js} +2 -2
  44. package/dist/cli/chunks/{chunk-SMBQERK7.js → chunk-CLMIRGMC.js} +2 -2
  45. package/dist/cli/chunks/{chunk-QREO5LNR.js → chunk-D4U3UAS3.js} +1 -1
  46. package/dist/cli/chunks/{chunk-7P4IZQVQ.js → chunk-D7MI6TUG.js} +2 -2
  47. package/dist/cli/chunks/{chunk-5FNEOJSD.js → chunk-DENKSTR5.js} +2 -2
  48. package/dist/cli/chunks/{chunk-KWPPF7O4.js → chunk-DVU4MM4I.js} +2 -2
  49. package/dist/cli/chunks/{chunk-QSLXOYPR.js → chunk-EHJKX273.js} +4 -4
  50. package/dist/cli/chunks/{chunk-FZ2SYLSK.js → chunk-EXXTHDKQ.js} +1 -1
  51. package/dist/cli/chunks/{chunk-WI5HBS3C.js → chunk-F2BTR5PL.js} +2 -2
  52. package/dist/cli/chunks/{chunk-S6FFUCVZ.js → chunk-FALKMG3G.js} +4 -4
  53. package/dist/cli/chunks/{chunk-TMKJXKY2.js → chunk-FEJMFYXZ.js} +2 -2
  54. package/dist/cli/chunks/{chunk-TOE6DKE4.js → chunk-FHBOBIXW.js} +1 -1
  55. package/dist/cli/chunks/{chunk-VGAG5TG7.js → chunk-FHFEKMXP.js} +1 -1
  56. package/dist/cli/chunks/{chunk-WY3H7VHF.js → chunk-FJPQ2ENU.js} +2 -2
  57. package/dist/cli/chunks/{chunk-IS6IES7Q.js → chunk-FYKYAIEC.js} +1 -1
  58. package/dist/cli/chunks/{chunk-DBW745QA.js → chunk-GOGDK7LQ.js} +2 -2
  59. package/dist/cli/chunks/{chunk-ADC73GLJ.js → chunk-GQZ2OOFA.js} +2 -2
  60. package/dist/cli/chunks/{chunk-YS5WV3CJ.js → chunk-HTT2AURL.js} +1 -1
  61. package/dist/cli/chunks/{chunk-4ZUXTOUG.js → chunk-I4MDD35Z.js} +1 -1
  62. package/dist/cli/chunks/{chunk-E2XIPBJ7.js → chunk-I6AEV3VJ.js} +1 -1
  63. package/dist/cli/chunks/{chunk-OEB3V633.js → chunk-IF2TA7WB.js} +2 -2
  64. package/dist/cli/chunks/{chunk-PEOTZFNZ.js → chunk-J2RELPD3.js} +2 -2
  65. package/dist/cli/chunks/{chunk-HIEP3L7H.js → chunk-J7EWOJJJ.js} +2 -2
  66. package/dist/cli/chunks/{chunk-LP52AQE2.js → chunk-JTJTFILP.js} +2 -2
  67. package/dist/cli/chunks/{chunk-V6GJ3EMZ.js → chunk-JW3FK26F.js} +1 -1
  68. package/dist/cli/chunks/{chunk-HMMJ6ZI6.js → chunk-K3IHEHKH.js} +2 -2
  69. package/dist/cli/chunks/{chunk-GB6ATLR3.js → chunk-K5YKGHRB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-D24HN6BG.js → chunk-K73MLEXW.js} +1 -1
  71. package/dist/cli/chunks/{chunk-VQLHHNOH.js → chunk-KOLE2DE4.js} +2 -2
  72. package/dist/cli/chunks/{chunk-KENZAFI2.js → chunk-KOS2AH4K.js} +2 -2
  73. package/dist/cli/chunks/{chunk-ETEV7IZI.js → chunk-LBY4ISY3.js} +1 -1
  74. package/dist/cli/chunks/chunk-LCBUXWME.js +2 -0
  75. package/dist/cli/chunks/{chunk-SMAC5IX4.js → chunk-LF5NF2KQ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-5EYQP3V3.js → chunk-LHZLX6A5.js} +2 -2
  77. package/dist/cli/chunks/{chunk-S5RNBBJ6.js → chunk-LVNRGZC5.js} +2 -2
  78. package/dist/cli/chunks/{chunk-KID7PTBZ.js → chunk-MSLVQQCR.js} +2 -2
  79. package/dist/cli/chunks/{chunk-NV6AUEIH.js → chunk-N7E2CHLQ.js} +2 -2
  80. package/dist/cli/chunks/{chunk-AEQNCDYD.js → chunk-N7PPEAND.js} +2 -2
  81. package/dist/cli/chunks/{chunk-F4VJ4PPI.js → chunk-NCQNCCFK.js} +18 -22
  82. package/dist/cli/chunks/{chunk-HRHKLRBB.js → chunk-NLW3NTNN.js} +1 -1
  83. package/dist/cli/chunks/{chunk-C4CZXAOE.js → chunk-ODWVWWYF.js} +3 -3
  84. package/dist/cli/chunks/{chunk-PAXSPZ3F.js → chunk-OJWR3I6W.js} +2 -2
  85. package/dist/cli/chunks/{chunk-ACOEV3YB.js → chunk-OSSTNUL5.js} +2 -2
  86. package/dist/cli/chunks/{chunk-6OYRNNP2.js → chunk-OZ3QFUQS.js} +1 -1
  87. package/dist/cli/chunks/{chunk-AT25VXEO.js → chunk-P6CK2HEP.js} +1 -1
  88. package/dist/cli/chunks/{chunk-ND2TFQF5.js → chunk-P75EWR76.js} +1 -1
  89. package/dist/cli/chunks/{chunk-NGT3VL66.js → chunk-PD3L4RVL.js} +2 -2
  90. package/dist/cli/chunks/{chunk-3Y7OZ2PC.js → chunk-POL7GGDS.js} +2 -2
  91. package/dist/cli/chunks/{chunk-LHXIAPKR.js → chunk-PTSQ43XG.js} +2 -2
  92. package/dist/cli/chunks/{chunk-E7J32PW2.js → chunk-PTX6ANZC.js} +2 -2
  93. package/dist/cli/chunks/{chunk-SIW4N4NE.js → chunk-PYEK56ML.js} +4 -4
  94. package/dist/cli/chunks/{chunk-QU3VFWZZ.js → chunk-QARVHXW3.js} +8 -8
  95. package/dist/cli/chunks/{chunk-RHAUASC6.js → chunk-QM7YGBAV.js} +2 -2
  96. package/dist/cli/chunks/{chunk-44BAZASI.js → chunk-QSUJ6DAT.js} +1 -1
  97. package/dist/cli/chunks/{chunk-J3GG3Q4X.js → chunk-QWHQUIPC.js} +2 -2
  98. package/dist/cli/chunks/{chunk-HC4VOQZJ.js → chunk-RA4RYX4P.js} +2 -2
  99. package/dist/cli/chunks/{chunk-TFAS5UND.js → chunk-RG6ZEBBX.js} +7 -7
  100. package/dist/cli/chunks/{chunk-6MGACOLN.js → chunk-RGSMJV6B.js} +1 -1
  101. package/dist/cli/chunks/{chunk-T5Z5LL5Y.js → chunk-RHU77EOX.js} +3 -3
  102. package/dist/cli/chunks/{chunk-OXXCWRFU.js → chunk-RUNJYWCO.js} +1 -1
  103. package/dist/cli/chunks/{chunk-DQI5ZR34.js → chunk-SNK365ZD.js} +1 -1
  104. package/dist/cli/chunks/{chunk-G276EI3G.js → chunk-T2B76Y6O.js} +2 -2
  105. package/dist/cli/chunks/{chunk-63PHZGO2.js → chunk-TFEBX3EF.js} +2 -2
  106. package/dist/cli/chunks/{chunk-YVPPR33H.js → chunk-TR7ILKUT.js} +2 -2
  107. package/dist/cli/chunks/{chunk-ICPQR533.js → chunk-TTVF2GAJ.js} +2 -2
  108. package/dist/cli/chunks/{chunk-CJKR47YY.js → chunk-UDWJPVSR.js} +1 -1
  109. package/dist/cli/chunks/{chunk-YH7BAX7S.js → chunk-UIH6O2HR.js} +1 -1
  110. package/dist/cli/chunks/{chunk-QERANESS.js → chunk-UKTYWW6X.js} +2 -2
  111. package/dist/cli/chunks/{chunk-GJGFPXWG.js → chunk-UVDETKTM.js} +2 -2
  112. package/dist/cli/chunks/{chunk-UOLIGPDW.js → chunk-UWQEPX7J.js} +2 -2
  113. package/dist/cli/chunks/{chunk-I3HLZASP.js → chunk-V2JS2SFV.js} +2 -2
  114. package/dist/cli/chunks/{chunk-EVWNZEYV.js → chunk-V5FSNDXP.js} +1 -1
  115. package/dist/cli/chunks/{chunk-NJICCYCB.js → chunk-VHDRVB2K.js} +2 -2
  116. package/dist/cli/chunks/{chunk-65U55JIH.js → chunk-VMCAEZKC.js} +3 -3
  117. package/dist/cli/chunks/{chunk-5PZG4WUA.js → chunk-VN5U55BD.js} +6 -6
  118. package/dist/cli/chunks/{chunk-HJCJWPN5.js → chunk-W47CQVJZ.js} +2 -2
  119. package/dist/cli/chunks/{chunk-ROC2SSV3.js → chunk-WGN6OBTF.js} +3 -3
  120. package/dist/cli/chunks/{chunk-GLQ6LLKC.js → chunk-WKNDFV4J.js} +1 -1
  121. package/dist/cli/chunks/{chunk-RDUIN7LO.js → chunk-WNBPFZTW.js} +1 -1
  122. package/dist/cli/chunks/{chunk-ISNDQOXC.js → chunk-WY5TVPXF.js} +2 -2
  123. package/dist/cli/chunks/{chunk-2AEWOQWU.js → chunk-WYGUFSG7.js} +2 -2
  124. package/dist/cli/chunks/{chunk-GR4RXQXV.js → chunk-XARQGJM2.js} +2 -2
  125. package/dist/cli/chunks/{chunk-KDOA7YHW.js → chunk-XI7JTYSU.js} +2 -2
  126. package/dist/cli/chunks/{chunk-4Z4C7BXV.js → chunk-XPRPADO3.js} +1 -1
  127. package/dist/cli/chunks/{chunk-KRXJ7LFP.js → chunk-YCM3F3DA.js} +1 -1
  128. package/dist/cli/chunks/{chunk-RIVX6YLS.js → chunk-YCV7GVBU.js} +2 -2
  129. package/dist/cli/chunks/{chunk-TCNJ5NGT.js → chunk-Z3FVM4RP.js} +2 -2
  130. package/dist/cli/chunks/{chunk-Y36AJ462.js → chunk-Z4VZUUAW.js} +2 -2
  131. package/dist/cli/chunks/{chunk-34BTSZ5D.js → chunk-ZXY55ZRR.js} +1 -1
  132. package/dist/cli/chunks/{ci-GU2HBK5E.js → ci-HCKL5ZLC.js} +2 -2
  133. package/dist/cli/chunks/{ci-output-FGZTTY3R.js → ci-output-EAGYFT3G.js} +2 -2
  134. package/dist/cli/chunks/{circuit-breaker-6UNLOLMW.js → circuit-breaker-HZ5H3Y63.js} +2 -2
  135. package/dist/cli/chunks/{claude-flow-setup-SCOCIDBC.js → claude-flow-setup-6XQMNEE7.js} +2 -2
  136. package/dist/cli/chunks/client-IMKYND6H.js +2 -0
  137. package/dist/cli/chunks/{cline-installer-G6PQERGI.js → cline-installer-LVFNRTXU.js} +2 -2
  138. package/dist/cli/chunks/{code-RNKTYBI4.js → code-DHZNDFYY.js} +2 -2
  139. package/dist/cli/chunks/{code-index-extractor-A6KAUQOU.js → code-index-extractor-NY46N2IA.js} +2 -2
  140. package/dist/cli/chunks/{codex-installer-ABWDMKEX.js → codex-installer-UWTC3IMP.js} +2 -2
  141. package/dist/cli/chunks/{completions-TB4E6O46.js → completions-DLOP65Q6.js} +2 -2
  142. package/dist/cli/chunks/{complexity-analyzer-XS37O7OR.js → complexity-analyzer-3XHPAD5G.js} +2 -2
  143. package/dist/cli/chunks/{continuedev-installer-WDY6O2SR.js → continuedev-installer-5HYX3CXP.js} +2 -2
  144. package/dist/cli/chunks/{copilot-installer-SDJ3GYLU.js → copilot-installer-SU77KI4W.js} +2 -2
  145. package/dist/cli/chunks/{cost-tracker-MWEXRK7F.js → cost-tracker-AZVHCJFV.js} +2 -2
  146. package/dist/cli/chunks/{coverage-Y3KDB56G.js → coverage-CFTRTQBY.js} +3 -3
  147. package/dist/cli/chunks/cross-domain-router-J7R337XD.js +2 -0
  148. package/dist/cli/chunks/{cursor-installer-4U7XENLX.js → cursor-installer-ZARQAGI2.js} +2 -2
  149. package/dist/cli/chunks/{daemon-D6R3BPBJ.js → daemon-65EXRMRZ.js} +3 -3
  150. package/dist/cli/chunks/{dag-attention-scheduler-EMVUX6ES.js → dag-attention-scheduler-R3MHZGS5.js} +2 -2
  151. package/dist/cli/chunks/{detect-QIJPCTZO.js → detect-GHLRESNH.js} +2 -2
  152. package/dist/cli/chunks/{dist-node-4ZYBZKOB.js → dist-node-GZYRURSL.js} +2 -2
  153. package/dist/cli/chunks/{domain-handler-X6CTXJQF.js → domain-handler-X45OXYAB.js} +2 -2
  154. package/dist/cli/chunks/{domain-transfer-HK4ER37F.js → domain-transfer-IEM4PLV6.js} +2 -2
  155. package/dist/cli/chunks/dream-INJHEIJG.js +2 -0
  156. package/dist/cli/chunks/{embed-and-insert-pattern-XKTD5DQ3.js → embed-and-insert-pattern-24KABHSD.js} +2 -2
  157. package/dist/cli/chunks/{eval-WEEB3CHY.js → eval-YPW5A5BY.js} +2 -2
  158. package/dist/cli/chunks/experience-capture-middleware-NFD2B3IV.js +40 -0
  159. package/dist/cli/chunks/{fast-paths-M2ENEKQX.js → fast-paths-3LLBHBSC.js} +2 -2
  160. package/dist/cli/chunks/{feature-flags-3WIZC67K.js → feature-flags-I3NCVDC6.js} +2 -2
  161. package/dist/cli/chunks/{feature-flags-CZQXGFGX.js → feature-flags-UYDE4R4H.js} +2 -2
  162. package/dist/cli/chunks/{file-discovery-ERTPM3C4.js → file-discovery-4VJNIXYH.js} +2 -2
  163. package/dist/cli/chunks/{fleet-WBEPTBQR.js → fleet-PVQG7US3.js} +3 -3
  164. package/dist/cli/chunks/{gnn-wrapper-GVRS33BK.js → gnn-wrapper-X3PEOE2D.js} +2 -2
  165. package/dist/cli/chunks/{heartbeat-handler-JQ6NSC6T.js → heartbeat-handler-XZ4374WZ.js} +4 -4
  166. package/dist/cli/chunks/{heartbeat-scheduler-7XHIE6IV.js → heartbeat-scheduler-Z2SIX564.js} +2 -2
  167. package/dist/cli/chunks/hnsw-adapter-SLHJHV7S.js +2 -0
  168. package/dist/cli/chunks/hnsw-index-EVYP3JDX.js +2 -0
  169. package/dist/cli/chunks/{hnsw-legacy-bridge-TYO6GZ6Z.js → hnsw-legacy-bridge-BNEGPQHD.js} +2 -2
  170. package/dist/cli/chunks/{better-sqlite3-XGA7Z5YL.js → hnswlib-node-7W776R32.js} +2 -2
  171. package/dist/cli/chunks/{hooks-2GU7LGNL.js → hooks-TDRFWXDT.js} +10 -10
  172. package/dist/cli/chunks/{hybrid-router-Z5V4E5SJ.js → hybrid-router-AUJSUAOQ.js} +2 -2
  173. package/dist/cli/chunks/{hypergraph-engine-F435AM7S.js → hypergraph-engine-Z22BN2OM.js} +2 -2
  174. package/dist/cli/chunks/{hypergraph-handler-DQMYDUQY.js → hypergraph-handler-6MVDLYO5.js} +3 -3
  175. package/dist/cli/chunks/impact-analyzer-QLEF4H3P.js +2 -0
  176. package/dist/cli/chunks/{init-handler-Y4NPRT2W.js → init-handler-YDJ4S37G.js} +6 -6
  177. package/dist/cli/chunks/init-wizard-VTYQYUT2.js +2 -0
  178. package/dist/cli/chunks/kernel-RA654UJZ.js +2 -0
  179. package/dist/cli/chunks/{kilocode-installer-EUTWNH4I.js → kilocode-installer-YRGX6BNB.js} +2 -2
  180. package/dist/cli/chunks/{kiro-installer-I3ECJ37F.js → kiro-installer-WJ2AYUS6.js} +2 -2
  181. package/dist/cli/chunks/knowledge-graph-6YRRWFGG.js +2 -0
  182. package/dist/cli/chunks/{learning-5FW7N6DA.js → learning-BVJQR4U6.js} +3 -3
  183. package/dist/cli/chunks/{llm-router-ZRYFNNPU.js → llm-router-HQMOD6JX.js} +4 -4
  184. package/dist/cli/chunks/{load-7BF33NMJ.js → load-WFIFPKRX.js} +2 -2
  185. package/dist/cli/chunks/load-test-MELOZIZY.js +2 -0
  186. package/dist/cli/chunks/{mcp-7K6P7FMG.js → mcp-QDCLWKZL.js} +2 -2
  187. package/dist/cli/chunks/{memory-O2DCN3GS.js → memory-VRYS37CC.js} +5 -5
  188. package/dist/cli/chunks/memory-backend-PG2HV7PE.js +2 -0
  189. package/dist/cli/chunks/{memory-handlers-WA63DMQ4.js → memory-handlers-CETDJWFQ.js} +2 -2
  190. package/dist/cli/chunks/{multi-model-executor-SJXBFOK5.js → multi-model-executor-OVS6GVH5.js} +2 -2
  191. package/dist/cli/chunks/{opencode-installer-PE7ZV6SV.js → opencode-installer-4P2L2JOC.js} +2 -2
  192. package/dist/cli/chunks/{orchestrator-N4GT5IGY.js → orchestrator-YGXY7UIG.js} +5 -5
  193. package/dist/cli/chunks/{pipeline-DUTGGNO6.js → pipeline-3O7CG7LQ.js} +2 -2
  194. package/dist/cli/chunks/{platform-EGUD7X2R.js → platform-BUSJ5IBS.js} +2 -2
  195. package/dist/cli/chunks/{plugin-6ZS3HK43.js → plugin-THNA3LPT.js} +2 -2
  196. package/dist/cli/chunks/{prime-radiant-advanced-wasm-B5S4RUJS.js → prime-radiant-advanced-wasm-YITMHWYP.js} +2 -2
  197. package/dist/cli/chunks/protocol-executor-CGA3R6RK.js +2 -0
  198. package/dist/cli/chunks/{protocol-handler-Z3QDY7O6.js → protocol-handler-LGLOHNLV.js} +2 -2
  199. package/dist/cli/chunks/{prove-TQHP2XVD.js → prove-XE5RKJRJ.js} +2 -2
  200. package/dist/cli/chunks/{provider-manager-2JFXKYMZ.js → provider-manager-TLQ7NMTR.js} +2 -2
  201. package/dist/cli/chunks/qe-reasoning-bank-PFMDQYAF.js +2 -0
  202. package/dist/cli/chunks/{quality-NXDHVPAS.js → quality-URKCSGLA.js} +2 -2
  203. package/dist/cli/chunks/queen-coordinator-5YTO7HEZ.js +2 -0
  204. package/dist/cli/chunks/{real-embeddings-P2LYDBVF.js → real-embeddings-MAYTOFAX.js} +2 -2
  205. package/dist/cli/chunks/{roocode-installer-YSRXO4W4.js → roocode-installer-4ISSCJTU.js} +2 -2
  206. package/dist/cli/chunks/router-54QWT5VU.js +2 -0
  207. package/dist/cli/chunks/routing-feedback-ZRROMF7R.js +2 -0
  208. package/dist/cli/chunks/{routing-handler-HVDQQF34.js → routing-handler-WDZBBV3U.js} +2 -2
  209. package/dist/cli/chunks/{ruvector-commands-5NJ5FQ3E.js → ruvector-commands-4U7JTAUE.js} +2 -2
  210. package/dist/cli/chunks/{rvf-dual-writer-GZ2HIIKX.js → rvf-dual-writer-PVQGHXKH.js} +2 -2
  211. package/dist/cli/chunks/{rvf-migration-adapter-QKEYGJFL.js → rvf-migration-adapter-HRCYZQLS.js} +2 -2
  212. package/dist/cli/chunks/{rvf-migration-coordinator-5RBME46Y.js → rvf-migration-coordinator-N4UXOCG7.js} +2 -2
  213. package/dist/cli/chunks/rvf-native-adapter-AF53YPR6.js +2 -0
  214. package/dist/cli/chunks/safe-db-6FQZ63GE.js +2 -0
  215. package/dist/cli/chunks/schedule-2BNTSEWS.js +2 -0
  216. package/dist/cli/chunks/scheduler-QIDIW4GS.js +2 -0
  217. package/dist/cli/chunks/{security-KB4TOOFJ.js → security-2727QJZS.js} +3 -3
  218. package/dist/cli/chunks/shared-rvf-adapter-XGHP37CT.js +2 -0
  219. package/dist/cli/chunks/{shared-rvf-dual-writer-UMDFMGVS.js → shared-rvf-dual-writer-TMTDHAJF.js} +2 -2
  220. package/dist/cli/chunks/sqlite-persistence-FTL5JKTZ.js +2 -0
  221. package/dist/cli/chunks/{status-handler-T53CO6SX.js → status-handler-PFRGF4NJ.js} +2 -2
  222. package/dist/cli/chunks/{structural-health-AVS2GE7S.js → structural-health-VLVOGQGG.js} +2 -2
  223. package/dist/cli/chunks/{sync-Q3UHMELK.js → sync-RDPRZDK4.js} +2 -2
  224. package/dist/cli/chunks/{task-handler-UAJWNRMS.js → task-handler-LSBTLJJ6.js} +2 -2
  225. package/dist/cli/chunks/{task-handlers-HYSHMTJN.js → task-handlers-JBVFH3US.js} +3 -3
  226. package/dist/cli/chunks/{test-GMXM664Y.js → test-C4J6XBVS.js} +4 -4
  227. package/dist/cli/chunks/{test-scheduling-PYU4NLDU.js → test-scheduling-DFFPSHHV.js} +3 -3
  228. package/dist/cli/chunks/{token-bootstrap-5SIETJI6.js → token-bootstrap-L6TK6LFF.js} +2 -2
  229. package/dist/cli/chunks/{token-usage-3H4KEKTT.js → token-usage-VQX5GATD.js} +2 -2
  230. package/dist/cli/chunks/{transformers-ZFPUASV4.js → transformers-FL5X2DM4.js} +2 -2
  231. package/dist/cli/chunks/{tree-sitter-wasm-parser-X72YXRIP.js → tree-sitter-wasm-parser-WPG7QDW2.js} +2 -2
  232. package/dist/cli/chunks/{types-CB2HAVZ6.js → types-ZQQGVT3N.js} +2 -2
  233. package/dist/cli/chunks/unified-memory-BR5DCUFI.js +2 -0
  234. package/dist/cli/chunks/unified-memory-hnsw-G4NG557W.js +2 -0
  235. package/dist/cli/chunks/unified-persistence-QID37TWH.js +2 -0
  236. package/dist/cli/chunks/{upgrade-BWAZTJKE.js → upgrade-3OOJENGN.js} +2 -2
  237. package/dist/cli/chunks/{validate-3OVVTWN6.js → validate-ICZRW3GO.js} +2 -2
  238. package/dist/cli/chunks/{validate-swarm-WJVG4OUQ.js → validate-swarm-XG7A34C5.js} +2 -2
  239. package/dist/cli/chunks/{vibium-IIU2F5HC.js → vibium-JCBQDZOF.js} +2 -2
  240. package/dist/cli/chunks/visual-security-2PKM5732.js +2 -0
  241. package/dist/cli/chunks/{web-tree-sitter-RO4TKGTV.js → web-tree-sitter-QY43QSVU.js} +2 -2
  242. package/dist/cli/chunks/{windsurf-installer-7N5CZTJS.js → windsurf-installer-TZHY2XD3.js} +2 -2
  243. package/dist/cli/chunks/witness-chain-BVP6OB7T.js +2 -0
  244. package/dist/cli/chunks/{witness-chain-B4CHDDS5.js → witness-chain-LPRLU35H.js} +2 -2
  245. package/dist/cli/chunks/{workflow-FKJKW36Z.js → workflow-TPS4NABZ.js} +4 -4
  246. package/dist/cli/chunks/workflow-orchestrator-27KZFXMU.js +2 -0
  247. package/dist/cli/chunks/{wrappers-HU3SB4FT.js → wrappers-Y37YFUR6.js} +2 -2
  248. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +6 -0
  249. package/dist/learning/experience-consolidation.d.ts +19 -3
  250. package/dist/learning/experience-consolidation.js +57 -27
  251. package/dist/learning/pattern-store.d.ts +3 -0
  252. package/dist/learning/qe-hooks.js +12 -2
  253. package/dist/learning/qe-reasoning-bank.js +33 -2
  254. package/dist/learning/rvf-pattern-store.js +12 -2
  255. package/dist/learning/sqlite-persistence.js +8 -1
  256. package/dist/mcp/bundle.js +123 -127
  257. package/package.json +2 -2
  258. package/dist/cli/chunks/adapter-WOEZOCHJ.js +0 -2
  259. package/dist/cli/chunks/aqe-learning-engine-5AHKLABJ.js +0 -2
  260. package/dist/cli/chunks/base-RNCRGTZJ.js +0 -2
  261. package/dist/cli/chunks/browser-workflow-MXHA63OC.js +0 -2
  262. package/dist/cli/chunks/chunk-OHR5ILR3.js +0 -2
  263. package/dist/cli/chunks/client-XU3ZUFMH.js +0 -2
  264. package/dist/cli/chunks/cross-domain-router-KKYQWQE7.js +0 -2
  265. package/dist/cli/chunks/dream-FBYASIID.js +0 -2
  266. package/dist/cli/chunks/hnsw-adapter-L7QOLNKP.js +0 -2
  267. package/dist/cli/chunks/hnsw-index-O2YO7WVU.js +0 -2
  268. package/dist/cli/chunks/impact-analyzer-37TDXM6V.js +0 -2
  269. package/dist/cli/chunks/init-wizard-ONNAHU4H.js +0 -2
  270. package/dist/cli/chunks/kernel-3S7RJ7PT.js +0 -2
  271. package/dist/cli/chunks/knowledge-graph-GNJMYFT2.js +0 -2
  272. package/dist/cli/chunks/load-test-ZHTSLJMB.js +0 -2
  273. package/dist/cli/chunks/memory-backend-LN6NWT4F.js +0 -2
  274. package/dist/cli/chunks/protocol-executor-ED36SYE4.js +0 -2
  275. package/dist/cli/chunks/qe-reasoning-bank-AC5ZWDAZ.js +0 -2
  276. package/dist/cli/chunks/queen-coordinator-IZ4RQGKV.js +0 -2
  277. package/dist/cli/chunks/router-DZVPCD7E.js +0 -2
  278. package/dist/cli/chunks/routing-feedback-3LUE56G4.js +0 -2
  279. package/dist/cli/chunks/rvf-native-adapter-UTX4WYSI.js +0 -2
  280. package/dist/cli/chunks/safe-db-PEJN42TX.js +0 -2
  281. package/dist/cli/chunks/schedule-UULIQP2J.js +0 -2
  282. package/dist/cli/chunks/scheduler-T57XAXKF.js +0 -2
  283. package/dist/cli/chunks/shared-rvf-adapter-UZVFV2RJ.js +0 -2
  284. package/dist/cli/chunks/sqlite-persistence-W7E26KF3.js +0 -2
  285. package/dist/cli/chunks/unified-memory-SAIRUPOI.js +0 -2
  286. package/dist/cli/chunks/unified-memory-hnsw-NQALAER6.js +0 -2
  287. package/dist/cli/chunks/unified-persistence-XNGQFWFS.js +0 -2
  288. package/dist/cli/chunks/visual-security-CE37LMFR.js +0 -2
  289. package/dist/cli/chunks/witness-chain-L2KM336B.js +0 -2
  290. package/dist/cli/chunks/workflow-orchestrator-BE5PCEBO.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.21");process.exit(0)}
2
- import{f as d}from"./chunk-RHAUASC6.js";import{a as u,c as g}from"./chunk-SMBQERK7.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
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.23");process.exit(0)}
2
+ import{f as d}from"./chunk-QM7YGBAV.js";import{a as u,c as g}from"./chunk-CLMIRGMC.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
@@ -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.21");process.exit(0)}
2
- import{b as d,d as L}from"./chunk-5FNEOJSD.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
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.23");process.exit(0)}
2
+ import{b as d,d as L}from"./chunk-DENKSTR5.js";import{createHash as m}from"crypto";import{existsSync as g,readFileSync as R,writeFileSync as A,openSync as X,writeSync as U,closeSync as f}from"fs";var p=[`CREATE TABLE IF NOT EXISTS qe_patterns (
3
3
  id TEXT PRIMARY KEY, pattern_type TEXT NOT NULL, qe_domain TEXT NOT NULL,
4
4
  domain TEXT NOT NULL, name TEXT NOT NULL, description TEXT,
5
5
  confidence REAL DEFAULT 0.5, usage_count INTEGER DEFAULT 0,
@@ -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.21");process.exit(0)}
2
- import{d as s}from"./chunk-PEOTZFNZ.js";s();
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.23");process.exit(0)}
2
+ import{d as s}from"./chunk-J2RELPD3.js";s();
@@ -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.21");process.exit(0)}
2
- import{a as o,e as l}from"./chunk-63PHZGO2.js";import{a,d as u}from"./chunk-ZUTYZIWQ.js";u();l();var c=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),o.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*o.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=o.DEFAULT_SEARCH_LIMIT){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(e.replace(/\*/g,".*")),n=[];for(let i of this.store.keys())if(s.test(i)&&(n.push(i),n.length>=r))break;return n}async vectorSearch(t,r){let e=[];for(let[s,n]of this.vectors.entries()){let i=a(t,n.embedding);e.push({key:s,score:i,metadata:n.metadata})}return e.sort((s,n)=>n.score-s.score).slice(0,r)}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{c as a};
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.23");process.exit(0)}
2
+ import{a as o,e as l}from"./chunk-TFEBX3EF.js";import{a,d as u}from"./chunk-BX5MBOPH.js";u();l();var c=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),o.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*o.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=o.DEFAULT_SEARCH_LIMIT){let e=t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),s=new RegExp(e.replace(/\*/g,".*")),n=[];for(let i of this.store.keys())if(s.test(i)&&(n.push(i),n.length>=r))break;return n}async vectorSearch(t,r){let e=[];for(let[s,n]of this.vectors.entries()){let i=a(t,n.embedding);e.push({key:s,score:i,metadata:n.metadata})}return e.sort((s,n)=>n.score-s.score).slice(0,r)}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{c as a};
@@ -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.21");process.exit(0)}
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.23");process.exit(0)}
2
2
  var i=class{s0;s1;s2;s3;constructor(s){this.s0=this.splitmix32(s),this.s1=this.splitmix32(this.s0),this.s2=this.splitmix32(this.s1),this.s3=this.splitmix32(this.s2)}splitmix32(s){return s=s+2654435769|0,s=Math.imul(s^s>>>16,2246822507),s=Math.imul(s^s>>>13,3266489909),(s^s>>>16)>>>0}next(){let s=this.s3,t=this.s0;return this.s3=this.s2,this.s2=this.s1,this.s1=t,t^=t<<11,t^=t>>>8,this.s0=t^s^s>>>19,this.s0>>>0}nextFloat(){return this.next()/4294967296}nextGaussian(){let s=this.nextFloat()||1e-10,t=this.nextFloat();return Math.sqrt(-2*Math.log(s))*Math.cos(2*Math.PI*t)}};export{i as a};
@@ -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.21");process.exit(0)}
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.23");process.exit(0)}
2
2
  var n=class{constructor(t){this.capacity=t;this.buffer=new Array(t)}capacity;buffer;head=0;tail=0;count=0;push(t){this.buffer[this.tail]=t,this.tail=(this.tail+1)%this.capacity,this.count<this.capacity?this.count++:this.head=(this.head+1)%this.capacity}toArray(){let t=[];for(let e=0;e<this.count;e++){let i=(this.head+e)%this.capacity;t.push(this.buffer[i])}return t}get length(){return this.count}get size(){return this.count}clear(){this.buffer=new Array(this.capacity),this.head=0,this.tail=0,this.count=0}last(t){let e=[],i=Math.max(0,this.count-t);for(let s=i;s<this.count;s++){let r=(this.head+s)%this.capacity;e.push(this.buffer[r])}return e}percentile(t){if(this.count===0)return;let e=this.toArray().sort((s,r)=>Number(s)-Number(r)),i=Math.floor(t/100*(e.length-1));return e[i]}reduce(t,e){let i=e;for(let s=0;s<this.count;s++){let r=(this.head+s)%this.capacity;i=t(i,this.buffer[r])}return i}average(){return this.count===0?0:this.reduce((e,i)=>e+i,0)/this.count}};export{n as a};
@@ -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.21");process.exit(0)}
2
- import{b as f,d as v}from"./chunk-PEOTZFNZ.js";import q,{MultiBar as F,Presets as k}from"cli-progress";import O from"ora";import o from"chalk";v();import{existsSync as w,readFileSync as y,writeFileSync as j,mkdirSync as W,unlinkSync as V}from"fs";import{join as p}from"path";import{homedir as C}from"os";var u={wizards:{enabled:!0,themes:["default","minimal","detailed"],defaultTheme:"default"},progress:{style:"multi-bar",updateIntervalMs:100,showETA:!0,colors:!0},completion:{maxSuggestions:10,historyWeight:.3,contextWeight:.7,fuzzyMatch:!0},streaming:{enabled:!0,bufferSize:100,updateIntervalMs:50}};function x(){return p(C(),".aqe")}function E(){return p(x(),"cli-config.json")}var g=null,d=0,T=5e3;function S(){return g?Date.now()-d<T:!1}function A(s){let e=[],t=s;if(typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"wizards.enabled",message:"must be a boolean"}),t.themes!==void 0)if(!Array.isArray(t.themes))e.push({path:"wizards.themes",message:"must be an array"});else{let r=["default","minimal","detailed"];for(let n of t.themes)r.includes(n)||e.push({path:"wizards.themes",message:`invalid theme: ${n}`})}return t.defaultTheme!==void 0&&(["default","minimal","detailed"].includes(t.defaultTheme)||e.push({path:"wizards.defaultTheme",message:`invalid theme: ${t.defaultTheme}`})),e}function P(s){let e=[],t=s;return t.style!==void 0&&(["multi-bar","single-bar","spinner"].includes(t.style)||e.push({path:"progress.style",message:`invalid style: ${t.style}`})),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"progress.updateIntervalMs",message:"must be a number >= 10"}),typeof t.showETA!="boolean"&&t.showETA!==void 0&&e.push({path:"progress.showETA",message:"must be a boolean"}),typeof t.colors!="boolean"&&t.colors!==void 0&&e.push({path:"progress.colors",message:"must be a boolean"}),e}function $(s){let e=[],t=s;return t.maxSuggestions!==void 0&&(typeof t.maxSuggestions!="number"||t.maxSuggestions<1)&&e.push({path:"completion.maxSuggestions",message:"must be a number >= 1"}),t.historyWeight!==void 0&&(typeof t.historyWeight!="number"||t.historyWeight<0||t.historyWeight>1)&&e.push({path:"completion.historyWeight",message:"must be a number between 0 and 1"}),t.contextWeight!==void 0&&(typeof t.contextWeight!="number"||t.contextWeight<0||t.contextWeight>1)&&e.push({path:"completion.contextWeight",message:"must be a number between 0 and 1"}),typeof t.fuzzyMatch!="boolean"&&t.fuzzyMatch!==void 0&&e.push({path:"completion.fuzzyMatch",message:"must be a boolean"}),e}function I(s){let e=[],t=s;return typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"streaming.enabled",message:"must be a boolean"}),t.bufferSize!==void 0&&(typeof t.bufferSize!="number"||t.bufferSize<1)&&e.push({path:"streaming.bufferSize",message:"must be a number >= 1"}),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"streaming.updateIntervalMs",message:"must be a number >= 10"}),e}function M(s){let e=[];if(typeof s!="object"||s===null)return{valid:!1,errors:[{path:"",message:"config must be an object"}]};let t=s;return t.wizards!==void 0&&(typeof t.wizards!="object"||t.wizards===null?e.push({path:"wizards",message:"must be an object"}):e.push(...A(t.wizards))),t.progress!==void 0&&(typeof t.progress!="object"||t.progress===null?e.push({path:"progress",message:"must be an object"}):e.push(...P(t.progress))),t.completion!==void 0&&(typeof t.completion!="object"||t.completion===null?e.push({path:"completion",message:"must be an object"}):e.push(...$(t.completion))),t.streaming!==void 0&&(typeof t.streaming!="object"||t.streaming===null?e.push({path:"streaming",message:"must be an object"}):e.push(...I(t.streaming))),{valid:e.length===0,errors:e}}var z=["__proto__","constructor","prototype"];function m(s,e){let t={...s};for(let r of Object.keys(e)){if(z.includes(r)){console.warn(`Security: Skipping forbidden key '${String(r)}' in configuration merge`);continue}let n=e[r],i=s[r];n!==void 0&&typeof n=="object"&&!Array.isArray(n)&&typeof i=="object"&&!Array.isArray(i)?t[r]=m(i,n):n!==void 0&&(t[r]=n)}return t}function D(){let s=E();if(!w(s))return{...u};try{let e=y(s,"utf-8"),t=f(e),r=M(t);return r.valid?m(u,t):(console.warn(`CLI config validation errors: ${r.errors.map(n=>`${n.path}: ${n.message}`).join(", ")}`),console.warn("Using default configuration"),{...u})}catch(e){return console.warn(`Failed to load CLI config: ${e instanceof Error?e.message:"Unknown error"}`),{...u}}}function c(){return S()||(g=D(),d=Date.now()),g}function B(){return process.stdout.isTTY===!0}function h(){let s=c();return process.env.NO_COLOR!==void 0?!1:process.env.FORCE_COLOR!==void 0?!0:s.progress.colors&&B()}var b=class{multiBar;agentBars=new Map;agentStates=new Map;fleetBar=null;startTime=Date.now();options;isActive=!1;constructor(e={}){let t=c(),r=h();this.options={title:"Fleet Progress",showEta:t.progress.showETA,showPercentage:!0,...e};let n=r?o.cyan("{bar}"):"{bar}",i=this.options.format||`{name} ${n} {percentage}% | {status} {eta}`;this.multiBar=new F({clearOnComplete:!1,hideCursor:!0,format:i,barCompleteChar:"\u2588",barIncompleteChar:"\u2591",forceRedraw:!0,fps:Math.round(1e3/t.progress.updateIntervalMs)},k.shades_classic)}start(e){this.isActive=!0,this.startTime=Date.now(),console.log(o.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.23");process.exit(0)}
2
+ import{b as f,d as v}from"./chunk-J2RELPD3.js";import q,{MultiBar as F,Presets as k}from"cli-progress";import O from"ora";import o from"chalk";v();import{existsSync as w,readFileSync as y,writeFileSync as j,mkdirSync as W,unlinkSync as V}from"fs";import{join as p}from"path";import{homedir as C}from"os";var u={wizards:{enabled:!0,themes:["default","minimal","detailed"],defaultTheme:"default"},progress:{style:"multi-bar",updateIntervalMs:100,showETA:!0,colors:!0},completion:{maxSuggestions:10,historyWeight:.3,contextWeight:.7,fuzzyMatch:!0},streaming:{enabled:!0,bufferSize:100,updateIntervalMs:50}};function x(){return p(C(),".aqe")}function E(){return p(x(),"cli-config.json")}var g=null,d=0,T=5e3;function S(){return g?Date.now()-d<T:!1}function A(s){let e=[],t=s;if(typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"wizards.enabled",message:"must be a boolean"}),t.themes!==void 0)if(!Array.isArray(t.themes))e.push({path:"wizards.themes",message:"must be an array"});else{let r=["default","minimal","detailed"];for(let n of t.themes)r.includes(n)||e.push({path:"wizards.themes",message:`invalid theme: ${n}`})}return t.defaultTheme!==void 0&&(["default","minimal","detailed"].includes(t.defaultTheme)||e.push({path:"wizards.defaultTheme",message:`invalid theme: ${t.defaultTheme}`})),e}function P(s){let e=[],t=s;return t.style!==void 0&&(["multi-bar","single-bar","spinner"].includes(t.style)||e.push({path:"progress.style",message:`invalid style: ${t.style}`})),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"progress.updateIntervalMs",message:"must be a number >= 10"}),typeof t.showETA!="boolean"&&t.showETA!==void 0&&e.push({path:"progress.showETA",message:"must be a boolean"}),typeof t.colors!="boolean"&&t.colors!==void 0&&e.push({path:"progress.colors",message:"must be a boolean"}),e}function $(s){let e=[],t=s;return t.maxSuggestions!==void 0&&(typeof t.maxSuggestions!="number"||t.maxSuggestions<1)&&e.push({path:"completion.maxSuggestions",message:"must be a number >= 1"}),t.historyWeight!==void 0&&(typeof t.historyWeight!="number"||t.historyWeight<0||t.historyWeight>1)&&e.push({path:"completion.historyWeight",message:"must be a number between 0 and 1"}),t.contextWeight!==void 0&&(typeof t.contextWeight!="number"||t.contextWeight<0||t.contextWeight>1)&&e.push({path:"completion.contextWeight",message:"must be a number between 0 and 1"}),typeof t.fuzzyMatch!="boolean"&&t.fuzzyMatch!==void 0&&e.push({path:"completion.fuzzyMatch",message:"must be a boolean"}),e}function I(s){let e=[],t=s;return typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"streaming.enabled",message:"must be a boolean"}),t.bufferSize!==void 0&&(typeof t.bufferSize!="number"||t.bufferSize<1)&&e.push({path:"streaming.bufferSize",message:"must be a number >= 1"}),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"streaming.updateIntervalMs",message:"must be a number >= 10"}),e}function M(s){let e=[];if(typeof s!="object"||s===null)return{valid:!1,errors:[{path:"",message:"config must be an object"}]};let t=s;return t.wizards!==void 0&&(typeof t.wizards!="object"||t.wizards===null?e.push({path:"wizards",message:"must be an object"}):e.push(...A(t.wizards))),t.progress!==void 0&&(typeof t.progress!="object"||t.progress===null?e.push({path:"progress",message:"must be an object"}):e.push(...P(t.progress))),t.completion!==void 0&&(typeof t.completion!="object"||t.completion===null?e.push({path:"completion",message:"must be an object"}):e.push(...$(t.completion))),t.streaming!==void 0&&(typeof t.streaming!="object"||t.streaming===null?e.push({path:"streaming",message:"must be an object"}):e.push(...I(t.streaming))),{valid:e.length===0,errors:e}}var z=["__proto__","constructor","prototype"];function m(s,e){let t={...s};for(let r of Object.keys(e)){if(z.includes(r)){console.warn(`Security: Skipping forbidden key '${String(r)}' in configuration merge`);continue}let n=e[r],i=s[r];n!==void 0&&typeof n=="object"&&!Array.isArray(n)&&typeof i=="object"&&!Array.isArray(i)?t[r]=m(i,n):n!==void 0&&(t[r]=n)}return t}function D(){let s=E();if(!w(s))return{...u};try{let e=y(s,"utf-8"),t=f(e),r=M(t);return r.valid?m(u,t):(console.warn(`CLI config validation errors: ${r.errors.map(n=>`${n.path}: ${n.message}`).join(", ")}`),console.warn("Using default configuration"),{...u})}catch(e){return console.warn(`Failed to load CLI config: ${e instanceof Error?e.message:"Unknown error"}`),{...u}}}function c(){return S()||(g=D(),d=Date.now()),g}function B(){return process.stdout.isTTY===!0}function h(){let s=c();return process.env.NO_COLOR!==void 0?!1:process.env.FORCE_COLOR!==void 0?!0:s.progress.colors&&B()}var b=class{multiBar;agentBars=new Map;agentStates=new Map;fleetBar=null;startTime=Date.now();options;isActive=!1;constructor(e={}){let t=c(),r=h();this.options={title:"Fleet Progress",showEta:t.progress.showETA,showPercentage:!0,...e};let n=r?o.cyan("{bar}"):"{bar}",i=this.options.format||`{name} ${n} {percentage}% | {status} {eta}`;this.multiBar=new F({clearOnComplete:!1,hideCursor:!0,format:i,barCompleteChar:"\u2588",barIncompleteChar:"\u2591",forceRedraw:!0,fps:Math.round(1e3/t.progress.updateIntervalMs)},k.shades_classic)}start(e){this.isActive=!0,this.startTime=Date.now(),console.log(o.blue(`
3
3
  ${this.options.title}
4
4
  `)),this.fleetBar=this.multiBar.create(100,0,{name:o.white("Fleet Progress".padEnd(30)),status:"",eta:""})}addAgent(e){if(!this.isActive)return;this.agentStates.set(e.id,e);let t=this.multiBar.create(100,e.progress,{name:o.gray(this.truncateName(e.name,30).padEnd(30)),status:this.getStatusIcon(e.status),eta:e.eta?this.formatEta(e.eta):""});this.agentBars.set(e.id,t),this.updateFleetProgress()}updateAgent(e,t,r){if(!this.isActive)return;let n=this.agentStates.get(e),i=this.agentBars.get(e);!n||!i||(n.progress=Math.min(100,Math.max(0,t)),r?.status&&(n.status=r.status),r?.message&&(n.message=r.message),r?.eta!==void 0&&(n.eta=r.eta),i.update(n.progress,{name:this.getAgentNameDisplay(n),status:this.getStatusIcon(n.status),eta:n.eta?this.formatEta(n.eta):""}),this.updateFleetProgress())}completeAgent(e,t=!0){if(!this.isActive)return;let r=this.agentStates.get(e),n=this.agentBars.get(e);!r||!n||(r.status=t?"completed":"failed",r.progress=t?100:r.progress,n.update(r.progress,{name:this.getAgentNameDisplay(r),status:this.getStatusIcon(r.status),eta:""}),this.updateFleetProgress())}stop(){if(!this.isActive)return;this.isActive=!1,this.multiBar.stop();let e=Array.from(this.agentStates.values()).filter(i=>i.status==="completed").length,t=Array.from(this.agentStates.values()).filter(i=>i.status==="failed").length,r=this.agentStates.size,n=Date.now()-this.startTime;console.log(""),console.log(t===0?o.green(`All ${e}/${r} agents completed successfully (${this.formatDuration(n)})`):o.yellow(`${e}/${r} agents completed, ${t} failed (${this.formatDuration(n)})`)),console.log("")}updateFleetProgress(){if(!this.fleetBar)return;let e=Array.from(this.agentStates.values()),t=e.reduce((a,l)=>a+l.progress,0),r=e.length>0?Math.round(t/e.length):0,n=e.filter(a=>a.status==="completed").length,i=e.filter(a=>a.status==="running").length;this.fleetBar.update(r,{status:o.gray(`${n}/${e.length} complete, ${i} running`),eta:this.options.showEta?this.estimateFleetEta(e):""})}getAgentNameDisplay(e){let t=this.truncateName(e.name,26);switch(e.status){case"completed":return o.green(t.padEnd(30));case"failed":return o.red(t.padEnd(30));case"running":return o.yellow(t.padEnd(30));default:return o.gray(t.padEnd(30))}}getStatusIcon(e){switch(e){case"completed":return o.green("\u2713");case"failed":return o.red("\u2717");case"running":return o.yellow("\u25B6");default:return o.gray("\u25CB")}}truncateName(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}formatEta(e){return e<=0?"":e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}formatDuration(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}estimateFleetEta(e){let t=e.filter(a=>a.status==="running"||a.status==="pending");if(t.length===0)return"";let r=t.map(a=>a.eta||0).filter(a=>a>0);if(r.length>0){let a=Math.max(...r);return o.gray(`ETA: ${this.formatEta(a)}`)}let n=Date.now()-this.startTime,i=t.reduce((a,l)=>a+l.progress,0)/t.length;if(i>0){let a=n/(i/100),l=Math.max(0,a-n);return o.gray(`ETA: ${this.formatEta(l)}`)}return""}};function X(s){let e=Date.now(),t=O({text:s,color:"cyan"}).start(),r=setInterval(()=>{let i=((Date.now()-e)/1e3).toFixed(1);t.text=`${s} (${i}s)`},100);r.unref?.();let n=()=>{clearInterval(r)};return{spinner:t,stop:()=>{n(),t.stop()},succeed:i=>{n();let a=((Date.now()-e)/1e3).toFixed(1);t.succeed(i||`${s} (${a}s)`)},fail:i=>{n();let a=((Date.now()-e)/1e3).toFixed(1);t.fail(i||`${s} failed (${a}s)`)}}}export{b as a,X as b};
@@ -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.21");process.exit(0)}
2
- import{k as p,o as N}from"./chunk-5FNEOJSD.js";N();import{createHash as y}from"crypto";var g="0".repeat(64);function m(s){return y("sha256").update(s,"utf-8").digest("hex")}function R(s){try{return y("shake256",{outputLength:32}).update(s,"utf-8").digest("hex")}catch{return m(s)}}function u(s,t){return s==="shake256"?R(t):m(t)}function f(s){return JSON.stringify({id:s.id,prev_hash:s.prev_hash,action_hash:s.action_hash,action_type:s.action_type,action_data:s.action_data,timestamp:s.timestamp,actor:s.actor})}var d=class{constructor(t,i){this.externalDb=t;this.keyManager=i??null}externalDb;db=null;initialized=!1;keyManager=null;async initialize(){if(!this.initialized){if(this.externalDb)this.db=this.externalDb;else{let t=p();await t.initialize(),this.db=t.getDatabase()}this.ensureTable(),this.initialized=!0}}getDatabase(){return this.db}getKeyManager(){return this.keyManager}ensureTable(){if(!this.db)throw new Error("Database not initialized");this.db.exec(`
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.23");process.exit(0)}
2
+ import{k as p,o as N}from"./chunk-DENKSTR5.js";N();import{createHash as y}from"crypto";var g="0".repeat(64);function m(s){return y("sha256").update(s,"utf-8").digest("hex")}function R(s){try{return y("shake256",{outputLength:32}).update(s,"utf-8").digest("hex")}catch{return m(s)}}function u(s,t){return s==="shake256"?R(t):m(t)}function f(s){return JSON.stringify({id:s.id,prev_hash:s.prev_hash,action_hash:s.action_hash,action_type:s.action_type,action_data:s.action_data,timestamp:s.timestamp,actor:s.actor})}var d=class{constructor(t,i){this.externalDb=t;this.keyManager=i??null}externalDb;db=null;initialized=!1;keyManager=null;async initialize(){if(!this.initialized){if(this.externalDb)this.db=this.externalDb;else{let t=p();await t.initialize(),this.db=t.getDatabase()}this.ensureTable(),this.initialized=!0}}getDatabase(){return this.db}getKeyManager(){return this.keyManager}ensureTable(){if(!this.db)throw new Error("Database not initialized");this.db.exec(`
3
3
  CREATE TABLE IF NOT EXISTS witness_chain (
4
4
  id INTEGER PRIMARY KEY AUTOINCREMENT,
5
5
  prev_hash TEXT NOT NULL, action_hash TEXT NOT NULL, action_type TEXT NOT NULL,
@@ -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.21");process.exit(0)}
2
- import{h as U}from"./chunk-J3GG3Q4X.js";import{a as v}from"./chunk-ICPQR533.js";import{c as D,d as R,e as h,g as x}from"./chunk-HRHKLRBB.js";var f=class{config;trackers;globalCostTodayUsd=0;lastGlobalReset=new Date;constructor(e){this.config=e,this.trackers=new Map;for(let t of[0,1,2,3,4])this.trackers.set(t,{tier:t,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,lastHourlyReset:new Date,lastDailyReset:new Date,requestHistory:[]})}async checkBudget(e,t){if(!this.config.enabled)return this.createAllowedDecision(e,e,t,!1,[]);this.autoReset();let r=this.config.tierBudgets[e];if(!r||!r.enabled)return this.createAllowedDecision(e,e,t,!1,["Tier budget not configured or disabled"]);let s=this.getUsage(e),i=[],c=this.config.maxDailyCostUsd-this.globalCostTodayUsd;if(this.globalCostTodayUsd+t>this.config.maxDailyCostUsd)return this.handleBudgetExceeded(e,t,s,"Global daily budget would be exceeded");if(this.globalCostTodayUsd+t>=this.config.maxDailyCostUsd*this.config.warningThreshold&&(i.push(`Approaching global daily budget limit: $${this.globalCostTodayUsd.toFixed(2)}/$${this.config.maxDailyCostUsd.toFixed(2)}`),this.config.onBudgetWarning==="downgrade"))return this.downgradeTier(e,t,s,i);let a=[{exceeded:s.costSpentTodayUsd+t>r.maxDailyCostUsd,message:`Tier ${e} daily cost limit would be exceeded: $${s.costSpentTodayUsd.toFixed(2)}/$${r.maxDailyCostUsd.toFixed(2)}`},{exceeded:s.requestsThisHour>=r.maxRequestsPerHour,message:`Tier ${e} hourly request limit reached: ${s.requestsThisHour}/${r.maxRequestsPerHour}`},{exceeded:s.requestsToday>=r.maxRequestsPerDay,message:`Tier ${e} daily request limit reached: ${s.requestsToday}/${r.maxRequestsPerDay}`},{exceeded:t>r.maxCostPerRequest,message:`Tier ${e} per-request cost limit would be exceeded: $${t.toFixed(4)}/$${r.maxCostPerRequest.toFixed(4)}`}];for(let n of a)if(n.exceeded)return this.handleBudgetExceeded(e,t,s,n.message);return s.budgetUtilization>=this.config.warningThreshold&&(i.push(`Tier ${e} at ${(s.budgetUtilization*100).toFixed(1)}% of daily budget`),this.config.onBudgetWarning==="downgrade")?this.downgradeTier(e,t,s,i):this.createAllowedDecision(e,e,t,!1,i)}async recordCost(e,t){if(!this.config.enabled)return;let r=this.trackers.get(e);r&&(this.autoReset(),r.costSpentTodayUsd+=t,r.requestsThisHour++,r.requestsToday++,this.globalCostTodayUsd+=t,r.requestHistory.push({timestamp:new Date,costUsd:t}),r.requestHistory.length>1e3&&(r.requestHistory=r.requestHistory.slice(-1e3)))}getUsage(e){this.autoReset();let t=this.trackers.get(e);if(!t)return this.createEmptyUsage(e);let r=this.config.tierBudgets[e];if(!r)return this.createEmptyUsage(e);let s=r.maxDailyCostUsd>0?t.costSpentTodayUsd/r.maxDailyCostUsd:0,i=t.costSpentTodayUsd>=r.maxDailyCostUsd||t.requestsThisHour>=r.maxRequestsPerHour||t.requestsToday>=r.maxRequestsPerDay,c=s>=this.config.warningThreshold,a=new Date,n=new Date(a);return n.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:t.costSpentTodayUsd,requestsThisHour:t.requestsThisHour,requestsToday:t.requestsToday,budgetUtilization:s,isExceeded:i,isNearLimit:c,resetTime:n,remainingBudgetUsd:Math.max(0,r.maxDailyCostUsd-t.costSpentTodayUsd),remainingRequestsThisHour:Math.max(0,r.maxRequestsPerHour-t.requestsThisHour),remainingRequestsToday:Math.max(0,r.maxRequestsPerDay-t.requestsToday)}}getAllUsage(){let e={};for(let t of[0,1,2,3,4])e[t]=this.getUsage(t);return e}reset(){let e=new Date;for(let t of this.trackers.values())t.costSpentTodayUsd=0,t.requestsThisHour=0,t.requestsToday=0,t.lastHourlyReset=e,t.lastDailyReset=e,t.requestHistory=[];this.globalCostTodayUsd=0,this.lastGlobalReset=e}handleBudgetExceeded(e,t,r,s){switch(this.config.onBudgetExceeded){case"error":throw new h(`Budget exceeded: ${s}`,e,r);case"downgrade":return this.downgradeTier(e,t,r,[s]);case"queue":throw new h(`Budget exceeded (queueing not yet implemented): ${s}`,e,r);default:throw new h(`Budget exceeded: ${s}`,e,r)}}downgradeTier(e,t,r,s){for(let i=e-1;i>=0;i--){let c=this.config.tierBudgets[i];if(!c||!c.enabled)continue;let a=this.getUsage(i);if(!a.isExceeded){let n=t*.5;if(a.costSpentTodayUsd+n<=c.maxDailyCostUsd)return this.createAllowedDecision(e,i,n,!0,[...s,`Downgraded from Tier ${e} to Tier ${i} due to budget constraints`])}}throw new h(`Budget exceeded and no lower tier available: ${s.join("; ")}`,e,r)}createAllowedDecision(e,t,r,s,i){let c=this.getUsage(t);return{allowed:!0,reason:s?`Budget enforced: downgraded to Tier ${t}`:"Budget check passed",requestedTier:e,approvedTier:t,wasDowngraded:s,estimatedCostUsd:r,currentUsage:c,warnings:i}}createEmptyUsage(e){let t=new Date,r=new Date(t);return r.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,budgetUtilization:0,isExceeded:!1,isNearLimit:!1,resetTime:r,remainingBudgetUsd:0,remainingRequestsThisHour:0,remainingRequestsToday:0}}autoReset(){let e=new Date;this.shouldResetDaily(this.lastGlobalReset,e)&&(this.globalCostTodayUsd=0,this.lastGlobalReset=e);for(let t of this.trackers.values())this.shouldResetHourly(t.lastHourlyReset,e)&&(t.requestsThisHour=0,t.lastHourlyReset=e),this.shouldResetDaily(t.lastDailyReset,e)&&(t.costSpentTodayUsd=0,t.requestsToday=0,t.requestHistory=[],t.lastDailyReset=e)}shouldResetHourly(e,t){return(t.getTime()-e.getTime())/36e5>=1}shouldResetDaily(e,t){return t.getUTCDate()!==e.getUTCDate()||t.getUTCMonth()!==e.getUTCMonth()||t.getUTCFullYear()!==e.getUTCFullYear()}getSessionCostSummary(){this.autoReset();let e=this.config.maxDailyCostUsd,t=0,r={},s={0:"AgentBooster",1:"Haiku",2:"Sonnet",3:"SonnetExtended",4:"Opus"};for(let[c,a]of this.trackers.entries()){let n=this.config.tierBudgets[c],o=s[c]??`Tier${c}`;t+=a.costSpentTodayUsd,r[o]={spent:a.costSpentTodayUsd,limit:n?.maxDailyCostUsd??0,requests:a.requestsToday}}let i=e>0?Math.round(t/e*100):0;return{totalSpentUsd:t,dailyLimitUsd:e,utilizationPercent:i,byTier:r}}};var w=class{cache=new Map;maxSize;ttlMs;enabled;constructor(e,t,r){this.enabled=e,this.maxSize=t,this.ttlMs=r}generateKey(e){return`${e.agentType||"unknown"}:${e.domain||"unknown"}:${e.task.slice(0,100)}`}get(e){if(!this.enabled)return null;let t=this.generateKey(e),r=this.cache.get(t);return r?Date.now()>r.expiresAt?(this.cache.delete(t),null):{...r.decision,metadata:{...r.decision.metadata,fromCache:!0,decisionTimeMs:0}}:null}set(e,t){if(!this.enabled)return;let r=this.generateKey(e);if(this.cache.size>=this.maxSize){let s=this.cache.keys().next().value;s&&this.cache.delete(s)}this.cache.set(r,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,hitRate:0}}},M=class{events=[];enabled;maxEvents=1e4;constructor(e){this.enabled=e}record(e){this.enabled&&(this.events.push(e),this.events.length>this.maxEvents&&(this.events=this.events.slice(-this.maxEvents)))}getMetrics(){if(this.events.length===0)return this.createEmptyMetrics();let e=new Date,t={};for(let o of[0,1,2,3,4]){let d=this.events.filter(l=>l.tier===o);if(d.length===0)continue;let T=d.filter(l=>l.success),m=d.filter(l=>!l.wasManualOverride),b=d.filter(l=>l.wasDowngraded),y=d.map(l=>l.latencyMs).sort((l,g)=>l-g),B=Math.floor(y.length*.95);t[o]={tier:o,selectionCount:d.length,autoRouteCount:m.length,manualOverrideCount:d.length-m.length,budgetDowngradeCount:b.length,successRate:T.length/d.length,avgComplexity:d.reduce((l,g)=>l+g.complexity,0)/d.length,totalCostUsd:d.reduce((l,g)=>l+g.costUsd,0),avgLatencyMs:d.reduce((l,g)=>l+g.latencyMs,0)/d.length,p95LatencyMs:y[B]||0,budgetUtilization:0}}let r=this.events.map(o=>o.latencyMs).sort((o,d)=>o-d),s=Math.floor(r.length*.95),i=Math.floor(r.length*.99),c=this.events.filter(o=>o.agentBoosterEligible).length,a=this.events.filter(o=>o.tier===0).length,n=this.events.filter(o=>o.tier===0&&o.success).length;return{byTier:t,totalDecisions:this.events.length,avgDecisionTimeMs:this.events.reduce((o,d)=>o+d.latencyMs,0)/this.events.length,p95DecisionTimeMs:r[s]||0,p99DecisionTimeMs:r[i]||0,fallbackRate:this.events.filter(o=>o.wasDowngraded).length/this.events.length,ruleMatchRate:this.events.filter(o=>!o.wasManualOverride).length/this.events.length,estimatedCostSavings:0,agentBoosterStats:{eligible:c,used:a,fallbackToLLM:Math.max(0,c-a),successRate:a>0?n/a:0},budgetStats:{totalSpentUsd:this.events.reduce((o,d)=>o+d.costUsd,0),budgetUtilization:0,downgradeCount:this.events.filter(o=>o.wasDowngraded).length,overrideCount:this.events.filter(o=>o.wasManualOverride).length},period:{start:this.events[0]?.timestamp||e,end:this.events[this.events.length-1]?.timestamp||e}}}reset(){this.events=[]}createEmptyMetrics(){let e=new Date;return{byTier:{},totalDecisions:0,avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:0,ruleMatchRate:0,estimatedCostSavings:0,agentBoosterStats:{eligible:0,used:0,fallbackToLLM:0,successRate:0},budgetStats:{totalSpentUsd:0,budgetUtilization:0,downgradeCount:0,overrideCount:0},period:{start:e,end:e}}}},p=class{config;complexityAnalyzer;budgetEnforcer;agentBoosterAdapter;cache;metrics;persistentMetricsTracker;patternsLoaded=!1;tierHierarchyFromPatterns=null;constructor(e={},t,r){this.config={...D,...e},this.agentBoosterAdapter=t,this.persistentMetricsTracker=r,this.complexityAnalyzer=U(this.config,t),this.budgetEnforcer=new f(this.config.budgetConfig),this.cache=new w(this.config.enableDecisionCache,1e3,this.config.decisionCacheTtlMs),this.metrics=new M(this.config.enableMetrics)}setPersistentMetricsTracker(e){this.persistentMetricsTracker=e}async loadPatternsFromLoader(){try{let t=await v().getTierHierarchy();if(t){this.tierHierarchyFromPatterns=t,this.patternsLoaded=!0,console.info("[ModelRouter] Loaded tier hierarchy from PatternLoader",{tiers:Object.keys(t)});return}console.debug("[ModelRouter] PatternLoader returned no tier hierarchy, using defaults")}catch(e){console.warn("[ModelRouter] Failed to load patterns from PatternLoader, using defaults",{error:e instanceof Error?e.message:"Unknown error"})}this.patternsLoaded=!1}getPatternsLoaded(){return this.patternsLoaded}getTierHierarchyFromPatterns(){return this.tierHierarchyFromPatterns}async route(e){let t=Date.now(),r=e.metadata?.correlationId;try{let s=this.cache.get(e);if(s)return s;let i=await Promise.race([this.routeInternal(e,t,r),new Promise((c,a)=>setTimeout(()=>a(new x("Routing decision timed out",this.config.maxDecisionTimeMs)),this.config.maxDecisionTimeMs))]);return this.cache.set(e,i),this.recordMetrics(i,!0),i}catch(s){let i=await this.createFallbackDecision(e,t,r,s instanceof Error?s:new Error("Unknown error"));return this.recordMetrics(i,!1),i}}getMetrics(){return this.metrics.getMetrics()}async getAgentBoosterHealth(){if(!this.agentBoosterAdapter)throw new R("Agent Booster adapter not available","AGENT_BOOSTER_UNAVAILABLE");return this.agentBoosterAdapter.getHealth()}resetMetrics(){this.metrics.reset()}async dispose(){this.cache.clear(),this.metrics.reset(),this.agentBoosterAdapter&&await this.agentBoosterAdapter.dispose()}async routeInternal(e,t,r){let s=[];if(e.manualTier!==void 0&&this.config.allowManualOverrides)return this.handleManualOverride(e,e.manualTier,t,r);let i=await this.complexityAnalyzer.analyze(e),c=i.recommendedTier,a=this.estimateCost(c,e.task.length),n=await this.budgetEnforcer.checkBudget(c,a),o=n.approvedTier;s.push(...n.warnings);let d=o===0&&i.signals.isMechanicalTransform,T=this.getModelIdForTier(o),m=this.buildRationale(i,n,o),b=this.buildAlternatives(i,o),y=Date.now()-t;return{tier:o,modelId:T,complexityAnalysis:i,budgetDecision:n,confidence:i.confidence,rationale:m,agentBoosterEligible:d,agentBoosterTransform:d?i.signals.detectedTransformType:void 0,alternativeTiers:b,metadata:{timestamp:new Date,decisionTimeMs:y,fromCache:!1,correlationId:r},warnings:s}}async handleManualOverride(e,t,r,s){let i=await this.complexityAnalyzer.analyze(e),c=this.estimateCost(t,e.task.length),a=await this.budgetEnforcer.checkBudget(t,c);!a.allowed&&e.isCritical&&this.config.budgetConfig.allowCriticalOverrides&&(a={...a,allowed:!0,reason:"Critical task override",warnings:[...a.warnings,"Budget exceeded but allowed due to critical task override"]});let n=a.approvedTier,o=this.getModelIdForTier(n),d=Date.now()-r;return{tier:n,modelId:o,complexityAnalysis:i,budgetDecision:a,confidence:1,rationale:`Manual override to Tier ${n}${a.wasDowngraded?" (downgraded due to budget)":""}`,agentBoosterEligible:n===0,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:d,fromCache:!1,correlationId:s},warnings:a.warnings}}async createFallbackDecision(e,t,r,s){let i=this.config.fallbackTier,c=this.getModelIdForTier(i),a={overall:50,codeComplexity:50,reasoningComplexity:50,scopeComplexity:50,confidence:.3,signals:{hasArchitectureScope:!1,hasSecurityScope:!1,requiresMultiStepReasoning:!1,requiresCrossDomainCoordination:!1,isMechanicalTransform:!1,requiresCreativity:!1,keywordMatches:{simple:[],moderate:[],complex:[],critical:[]}},recommendedTier:i,alternateTiers:[],explanation:`Fallback to Tier ${i} due to routing error`},n={allowed:!0,reason:"Fallback routing",requestedTier:i,approvedTier:i,wasDowngraded:!1,estimatedCostUsd:0,currentUsage:this.budgetEnforcer.getUsage(i),warnings:[]},o=Date.now()-t;return{tier:i,modelId:c,complexityAnalysis:a,budgetDecision:n,confidence:.3,rationale:`Fallback to Tier ${i} due to error: ${s.message}`,agentBoosterEligible:!1,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:o,fromCache:!1,correlationId:r},warnings:[`Routing error: ${s.message}`,"Using fallback tier"]}}estimateCost(e,t){let r=[0,.001,.01,.05,.2],s=Math.max(1,t/1e3);return r[e]*s}getModelIdForTier(e){return this.config.tierModels[e]||`tier-${e}-default`}buildRationale(e,t,r){let s=[];return s.push(`Complexity: ${e.overall}/100`),s.push(`Tier ${r} selected`),t.wasDowngraded&&s.push(`Downgraded due to budget: ${t.reason}`),s.push(e.explanation),s.join(". ")}buildAlternatives(e,t){return e.alternateTiers.filter(r=>r!==t).map(r=>({tier:r,modelId:this.getModelIdForTier(r),reason:`Alternative tier ${r}`}))}recordMetrics(e,t){this.metrics.record({timestamp:e.metadata.timestamp,tier:e.tier,complexity:e.complexityAnalysis.overall,costUsd:e.budgetDecision.estimatedCostUsd,latencyMs:e.metadata.decisionTimeMs,wasDowngraded:e.budgetDecision.wasDowngraded,wasManualOverride:!1,agentBoosterEligible:e.agentBoosterEligible,success:t}),this.recordPersistentMetrics(e,t).catch(console.error)}async recordPersistentMetrics(e,t){if(this.persistentMetricsTracker)try{let r=`router-tier${e.tier}-${Date.now()}`;await this.persistentMetricsTracker.recordOutcome("router",r,t,e.metadata.decisionTimeMs,{subType:`tier-${e.tier}`,confidence:e.confidence,usedFallback:e.budgetDecision.wasDowngraded})}catch(r){console.warn("[ModelRouter] Failed to record persistent metrics:",r)}}};function $(u={},e,t){return new p(u,e,t)}async function I(u={},e){let{createAgentBoosterAdapter:t}=await import("./adapter-WOEZOCHJ.js"),r=await t({enabled:!0}),s=new p(u,r,e);return await s.loadPatternsFromLoader(),s}export{p as a,$ as b,I as c};
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.23");process.exit(0)}
2
+ import{h as U}from"./chunk-QWHQUIPC.js";import{c as D,d as R,e as h,g as x}from"./chunk-NLW3NTNN.js";import{a as v}from"./chunk-TTVF2GAJ.js";var f=class{config;trackers;globalCostTodayUsd=0;lastGlobalReset=new Date;constructor(e){this.config=e,this.trackers=new Map;for(let t of[0,1,2,3,4])this.trackers.set(t,{tier:t,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,lastHourlyReset:new Date,lastDailyReset:new Date,requestHistory:[]})}async checkBudget(e,t){if(!this.config.enabled)return this.createAllowedDecision(e,e,t,!1,[]);this.autoReset();let r=this.config.tierBudgets[e];if(!r||!r.enabled)return this.createAllowedDecision(e,e,t,!1,["Tier budget not configured or disabled"]);let s=this.getUsage(e),i=[],c=this.config.maxDailyCostUsd-this.globalCostTodayUsd;if(this.globalCostTodayUsd+t>this.config.maxDailyCostUsd)return this.handleBudgetExceeded(e,t,s,"Global daily budget would be exceeded");if(this.globalCostTodayUsd+t>=this.config.maxDailyCostUsd*this.config.warningThreshold&&(i.push(`Approaching global daily budget limit: $${this.globalCostTodayUsd.toFixed(2)}/$${this.config.maxDailyCostUsd.toFixed(2)}`),this.config.onBudgetWarning==="downgrade"))return this.downgradeTier(e,t,s,i);let a=[{exceeded:s.costSpentTodayUsd+t>r.maxDailyCostUsd,message:`Tier ${e} daily cost limit would be exceeded: $${s.costSpentTodayUsd.toFixed(2)}/$${r.maxDailyCostUsd.toFixed(2)}`},{exceeded:s.requestsThisHour>=r.maxRequestsPerHour,message:`Tier ${e} hourly request limit reached: ${s.requestsThisHour}/${r.maxRequestsPerHour}`},{exceeded:s.requestsToday>=r.maxRequestsPerDay,message:`Tier ${e} daily request limit reached: ${s.requestsToday}/${r.maxRequestsPerDay}`},{exceeded:t>r.maxCostPerRequest,message:`Tier ${e} per-request cost limit would be exceeded: $${t.toFixed(4)}/$${r.maxCostPerRequest.toFixed(4)}`}];for(let n of a)if(n.exceeded)return this.handleBudgetExceeded(e,t,s,n.message);return s.budgetUtilization>=this.config.warningThreshold&&(i.push(`Tier ${e} at ${(s.budgetUtilization*100).toFixed(1)}% of daily budget`),this.config.onBudgetWarning==="downgrade")?this.downgradeTier(e,t,s,i):this.createAllowedDecision(e,e,t,!1,i)}async recordCost(e,t){if(!this.config.enabled)return;let r=this.trackers.get(e);r&&(this.autoReset(),r.costSpentTodayUsd+=t,r.requestsThisHour++,r.requestsToday++,this.globalCostTodayUsd+=t,r.requestHistory.push({timestamp:new Date,costUsd:t}),r.requestHistory.length>1e3&&(r.requestHistory=r.requestHistory.slice(-1e3)))}getUsage(e){this.autoReset();let t=this.trackers.get(e);if(!t)return this.createEmptyUsage(e);let r=this.config.tierBudgets[e];if(!r)return this.createEmptyUsage(e);let s=r.maxDailyCostUsd>0?t.costSpentTodayUsd/r.maxDailyCostUsd:0,i=t.costSpentTodayUsd>=r.maxDailyCostUsd||t.requestsThisHour>=r.maxRequestsPerHour||t.requestsToday>=r.maxRequestsPerDay,c=s>=this.config.warningThreshold,a=new Date,n=new Date(a);return n.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:t.costSpentTodayUsd,requestsThisHour:t.requestsThisHour,requestsToday:t.requestsToday,budgetUtilization:s,isExceeded:i,isNearLimit:c,resetTime:n,remainingBudgetUsd:Math.max(0,r.maxDailyCostUsd-t.costSpentTodayUsd),remainingRequestsThisHour:Math.max(0,r.maxRequestsPerHour-t.requestsThisHour),remainingRequestsToday:Math.max(0,r.maxRequestsPerDay-t.requestsToday)}}getAllUsage(){let e={};for(let t of[0,1,2,3,4])e[t]=this.getUsage(t);return e}reset(){let e=new Date;for(let t of this.trackers.values())t.costSpentTodayUsd=0,t.requestsThisHour=0,t.requestsToday=0,t.lastHourlyReset=e,t.lastDailyReset=e,t.requestHistory=[];this.globalCostTodayUsd=0,this.lastGlobalReset=e}handleBudgetExceeded(e,t,r,s){switch(this.config.onBudgetExceeded){case"error":throw new h(`Budget exceeded: ${s}`,e,r);case"downgrade":return this.downgradeTier(e,t,r,[s]);case"queue":throw new h(`Budget exceeded (queueing not yet implemented): ${s}`,e,r);default:throw new h(`Budget exceeded: ${s}`,e,r)}}downgradeTier(e,t,r,s){for(let i=e-1;i>=0;i--){let c=this.config.tierBudgets[i];if(!c||!c.enabled)continue;let a=this.getUsage(i);if(!a.isExceeded){let n=t*.5;if(a.costSpentTodayUsd+n<=c.maxDailyCostUsd)return this.createAllowedDecision(e,i,n,!0,[...s,`Downgraded from Tier ${e} to Tier ${i} due to budget constraints`])}}throw new h(`Budget exceeded and no lower tier available: ${s.join("; ")}`,e,r)}createAllowedDecision(e,t,r,s,i){let c=this.getUsage(t);return{allowed:!0,reason:s?`Budget enforced: downgraded to Tier ${t}`:"Budget check passed",requestedTier:e,approvedTier:t,wasDowngraded:s,estimatedCostUsd:r,currentUsage:c,warnings:i}}createEmptyUsage(e){let t=new Date,r=new Date(t);return r.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,budgetUtilization:0,isExceeded:!1,isNearLimit:!1,resetTime:r,remainingBudgetUsd:0,remainingRequestsThisHour:0,remainingRequestsToday:0}}autoReset(){let e=new Date;this.shouldResetDaily(this.lastGlobalReset,e)&&(this.globalCostTodayUsd=0,this.lastGlobalReset=e);for(let t of this.trackers.values())this.shouldResetHourly(t.lastHourlyReset,e)&&(t.requestsThisHour=0,t.lastHourlyReset=e),this.shouldResetDaily(t.lastDailyReset,e)&&(t.costSpentTodayUsd=0,t.requestsToday=0,t.requestHistory=[],t.lastDailyReset=e)}shouldResetHourly(e,t){return(t.getTime()-e.getTime())/36e5>=1}shouldResetDaily(e,t){return t.getUTCDate()!==e.getUTCDate()||t.getUTCMonth()!==e.getUTCMonth()||t.getUTCFullYear()!==e.getUTCFullYear()}getSessionCostSummary(){this.autoReset();let e=this.config.maxDailyCostUsd,t=0,r={},s={0:"AgentBooster",1:"Haiku",2:"Sonnet",3:"SonnetExtended",4:"Opus"};for(let[c,a]of this.trackers.entries()){let n=this.config.tierBudgets[c],o=s[c]??`Tier${c}`;t+=a.costSpentTodayUsd,r[o]={spent:a.costSpentTodayUsd,limit:n?.maxDailyCostUsd??0,requests:a.requestsToday}}let i=e>0?Math.round(t/e*100):0;return{totalSpentUsd:t,dailyLimitUsd:e,utilizationPercent:i,byTier:r}}};var w=class{cache=new Map;maxSize;ttlMs;enabled;constructor(e,t,r){this.enabled=e,this.maxSize=t,this.ttlMs=r}generateKey(e){return`${e.agentType||"unknown"}:${e.domain||"unknown"}:${e.task.slice(0,100)}`}get(e){if(!this.enabled)return null;let t=this.generateKey(e),r=this.cache.get(t);return r?Date.now()>r.expiresAt?(this.cache.delete(t),null):{...r.decision,metadata:{...r.decision.metadata,fromCache:!0,decisionTimeMs:0}}:null}set(e,t){if(!this.enabled)return;let r=this.generateKey(e);if(this.cache.size>=this.maxSize){let s=this.cache.keys().next().value;s&&this.cache.delete(s)}this.cache.set(r,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,hitRate:0}}},M=class{events=[];enabled;maxEvents=1e4;constructor(e){this.enabled=e}record(e){this.enabled&&(this.events.push(e),this.events.length>this.maxEvents&&(this.events=this.events.slice(-this.maxEvents)))}getMetrics(){if(this.events.length===0)return this.createEmptyMetrics();let e=new Date,t={};for(let o of[0,1,2,3,4]){let d=this.events.filter(l=>l.tier===o);if(d.length===0)continue;let T=d.filter(l=>l.success),m=d.filter(l=>!l.wasManualOverride),b=d.filter(l=>l.wasDowngraded),y=d.map(l=>l.latencyMs).sort((l,g)=>l-g),B=Math.floor(y.length*.95);t[o]={tier:o,selectionCount:d.length,autoRouteCount:m.length,manualOverrideCount:d.length-m.length,budgetDowngradeCount:b.length,successRate:T.length/d.length,avgComplexity:d.reduce((l,g)=>l+g.complexity,0)/d.length,totalCostUsd:d.reduce((l,g)=>l+g.costUsd,0),avgLatencyMs:d.reduce((l,g)=>l+g.latencyMs,0)/d.length,p95LatencyMs:y[B]||0,budgetUtilization:0}}let r=this.events.map(o=>o.latencyMs).sort((o,d)=>o-d),s=Math.floor(r.length*.95),i=Math.floor(r.length*.99),c=this.events.filter(o=>o.agentBoosterEligible).length,a=this.events.filter(o=>o.tier===0).length,n=this.events.filter(o=>o.tier===0&&o.success).length;return{byTier:t,totalDecisions:this.events.length,avgDecisionTimeMs:this.events.reduce((o,d)=>o+d.latencyMs,0)/this.events.length,p95DecisionTimeMs:r[s]||0,p99DecisionTimeMs:r[i]||0,fallbackRate:this.events.filter(o=>o.wasDowngraded).length/this.events.length,ruleMatchRate:this.events.filter(o=>!o.wasManualOverride).length/this.events.length,estimatedCostSavings:0,agentBoosterStats:{eligible:c,used:a,fallbackToLLM:Math.max(0,c-a),successRate:a>0?n/a:0},budgetStats:{totalSpentUsd:this.events.reduce((o,d)=>o+d.costUsd,0),budgetUtilization:0,downgradeCount:this.events.filter(o=>o.wasDowngraded).length,overrideCount:this.events.filter(o=>o.wasManualOverride).length},period:{start:this.events[0]?.timestamp||e,end:this.events[this.events.length-1]?.timestamp||e}}}reset(){this.events=[]}createEmptyMetrics(){let e=new Date;return{byTier:{},totalDecisions:0,avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:0,ruleMatchRate:0,estimatedCostSavings:0,agentBoosterStats:{eligible:0,used:0,fallbackToLLM:0,successRate:0},budgetStats:{totalSpentUsd:0,budgetUtilization:0,downgradeCount:0,overrideCount:0},period:{start:e,end:e}}}},p=class{config;complexityAnalyzer;budgetEnforcer;agentBoosterAdapter;cache;metrics;persistentMetricsTracker;patternsLoaded=!1;tierHierarchyFromPatterns=null;constructor(e={},t,r){this.config={...D,...e},this.agentBoosterAdapter=t,this.persistentMetricsTracker=r,this.complexityAnalyzer=U(this.config,t),this.budgetEnforcer=new f(this.config.budgetConfig),this.cache=new w(this.config.enableDecisionCache,1e3,this.config.decisionCacheTtlMs),this.metrics=new M(this.config.enableMetrics)}setPersistentMetricsTracker(e){this.persistentMetricsTracker=e}async loadPatternsFromLoader(){try{let t=await v().getTierHierarchy();if(t){this.tierHierarchyFromPatterns=t,this.patternsLoaded=!0,console.info("[ModelRouter] Loaded tier hierarchy from PatternLoader",{tiers:Object.keys(t)});return}console.debug("[ModelRouter] PatternLoader returned no tier hierarchy, using defaults")}catch(e){console.warn("[ModelRouter] Failed to load patterns from PatternLoader, using defaults",{error:e instanceof Error?e.message:"Unknown error"})}this.patternsLoaded=!1}getPatternsLoaded(){return this.patternsLoaded}getTierHierarchyFromPatterns(){return this.tierHierarchyFromPatterns}async route(e){let t=Date.now(),r=e.metadata?.correlationId;try{let s=this.cache.get(e);if(s)return s;let i=await Promise.race([this.routeInternal(e,t,r),new Promise((c,a)=>setTimeout(()=>a(new x("Routing decision timed out",this.config.maxDecisionTimeMs)),this.config.maxDecisionTimeMs))]);return this.cache.set(e,i),this.recordMetrics(i,!0),i}catch(s){let i=await this.createFallbackDecision(e,t,r,s instanceof Error?s:new Error("Unknown error"));return this.recordMetrics(i,!1),i}}getMetrics(){return this.metrics.getMetrics()}async getAgentBoosterHealth(){if(!this.agentBoosterAdapter)throw new R("Agent Booster adapter not available","AGENT_BOOSTER_UNAVAILABLE");return this.agentBoosterAdapter.getHealth()}resetMetrics(){this.metrics.reset()}async dispose(){this.cache.clear(),this.metrics.reset(),this.agentBoosterAdapter&&await this.agentBoosterAdapter.dispose()}async routeInternal(e,t,r){let s=[];if(e.manualTier!==void 0&&this.config.allowManualOverrides)return this.handleManualOverride(e,e.manualTier,t,r);let i=await this.complexityAnalyzer.analyze(e),c=i.recommendedTier,a=this.estimateCost(c,e.task.length),n=await this.budgetEnforcer.checkBudget(c,a),o=n.approvedTier;s.push(...n.warnings);let d=o===0&&i.signals.isMechanicalTransform,T=this.getModelIdForTier(o),m=this.buildRationale(i,n,o),b=this.buildAlternatives(i,o),y=Date.now()-t;return{tier:o,modelId:T,complexityAnalysis:i,budgetDecision:n,confidence:i.confidence,rationale:m,agentBoosterEligible:d,agentBoosterTransform:d?i.signals.detectedTransformType:void 0,alternativeTiers:b,metadata:{timestamp:new Date,decisionTimeMs:y,fromCache:!1,correlationId:r},warnings:s}}async handleManualOverride(e,t,r,s){let i=await this.complexityAnalyzer.analyze(e),c=this.estimateCost(t,e.task.length),a=await this.budgetEnforcer.checkBudget(t,c);!a.allowed&&e.isCritical&&this.config.budgetConfig.allowCriticalOverrides&&(a={...a,allowed:!0,reason:"Critical task override",warnings:[...a.warnings,"Budget exceeded but allowed due to critical task override"]});let n=a.approvedTier,o=this.getModelIdForTier(n),d=Date.now()-r;return{tier:n,modelId:o,complexityAnalysis:i,budgetDecision:a,confidence:1,rationale:`Manual override to Tier ${n}${a.wasDowngraded?" (downgraded due to budget)":""}`,agentBoosterEligible:n===0,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:d,fromCache:!1,correlationId:s},warnings:a.warnings}}async createFallbackDecision(e,t,r,s){let i=this.config.fallbackTier,c=this.getModelIdForTier(i),a={overall:50,codeComplexity:50,reasoningComplexity:50,scopeComplexity:50,confidence:.3,signals:{hasArchitectureScope:!1,hasSecurityScope:!1,requiresMultiStepReasoning:!1,requiresCrossDomainCoordination:!1,isMechanicalTransform:!1,requiresCreativity:!1,keywordMatches:{simple:[],moderate:[],complex:[],critical:[]}},recommendedTier:i,alternateTiers:[],explanation:`Fallback to Tier ${i} due to routing error`},n={allowed:!0,reason:"Fallback routing",requestedTier:i,approvedTier:i,wasDowngraded:!1,estimatedCostUsd:0,currentUsage:this.budgetEnforcer.getUsage(i),warnings:[]},o=Date.now()-t;return{tier:i,modelId:c,complexityAnalysis:a,budgetDecision:n,confidence:.3,rationale:`Fallback to Tier ${i} due to error: ${s.message}`,agentBoosterEligible:!1,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:o,fromCache:!1,correlationId:r},warnings:[`Routing error: ${s.message}`,"Using fallback tier"]}}estimateCost(e,t){let r=[0,.001,.01,.05,.2],s=Math.max(1,t/1e3);return r[e]*s}getModelIdForTier(e){return this.config.tierModels[e]||`tier-${e}-default`}buildRationale(e,t,r){let s=[];return s.push(`Complexity: ${e.overall}/100`),s.push(`Tier ${r} selected`),t.wasDowngraded&&s.push(`Downgraded due to budget: ${t.reason}`),s.push(e.explanation),s.join(". ")}buildAlternatives(e,t){return e.alternateTiers.filter(r=>r!==t).map(r=>({tier:r,modelId:this.getModelIdForTier(r),reason:`Alternative tier ${r}`}))}recordMetrics(e,t){this.metrics.record({timestamp:e.metadata.timestamp,tier:e.tier,complexity:e.complexityAnalysis.overall,costUsd:e.budgetDecision.estimatedCostUsd,latencyMs:e.metadata.decisionTimeMs,wasDowngraded:e.budgetDecision.wasDowngraded,wasManualOverride:!1,agentBoosterEligible:e.agentBoosterEligible,success:t}),this.recordPersistentMetrics(e,t).catch(console.error)}async recordPersistentMetrics(e,t){if(this.persistentMetricsTracker)try{let r=`router-tier${e.tier}-${Date.now()}`;await this.persistentMetricsTracker.recordOutcome("router",r,t,e.metadata.decisionTimeMs,{subType:`tier-${e.tier}`,confidence:e.confidence,usedFallback:e.budgetDecision.wasDowngraded})}catch(r){console.warn("[ModelRouter] Failed to record persistent metrics:",r)}}};function $(u={},e,t){return new p(u,e,t)}async function I(u={},e){let{createAgentBoosterAdapter:t}=await import("./adapter-7U6GXVHU.js"),r=await t({enabled:!0}),s=new p(u,r,e);return await s.loadPatternsFromLoader(),s}export{p as a,$ as b,I as c};
@@ -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.21");process.exit(0)}
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.23");process.exit(0)}
2
2
  var t=["claude","openai","ollama","openrouter","gemini","azure-openai","bedrock","onnx"];var e={maxAttempts:3,delayMs:100,trySameProviderAlternateModel:!0,skipOpenCircuits:!0,retryableErrors:["RATE_LIMITED","TIMEOUT","NETWORK_ERROR","PROVIDER_UNAVAILABLE"]},r=[{provider:"claude",models:["claude-sonnet-4-6","claude-haiku-4-5-20251001"],enabled:!0,priority:100,maxAttempts:2,timeoutMs:3e4},{provider:"openai",models:["gpt-4o","gpt-4o-mini"],enabled:!0,priority:90,maxAttempts:2,timeoutMs:3e4},{provider:"openrouter",models:["anthropic/claude-sonnet-4","openai/gpt-4o"],enabled:!0,priority:85,maxAttempts:2,timeoutMs:3e4},{provider:"ollama",models:["llama3.1","mistral"],enabled:!0,priority:80,maxAttempts:2,timeoutMs:6e4},{provider:"onnx",models:["phi-4","all-MiniLM-L6-v2"],enabled:!0,priority:70,maxAttempts:1,timeoutMs:12e4}],o={id:"default-fallback-chain",entries:r,maxRetries:3,retryDelayMs:100,backoffMultiplier:2,maxDelayMs:5e3},n={mode:"rule-based",rules:[],defaultProvider:"claude",defaultModel:"claude-sonnet-4-6",fallbackChain:o,fallbackBehavior:e,providers:{claude:{enabled:!0,defaultModel:"claude-sonnet-4-6"},openai:{enabled:!0,defaultModel:"gpt-4o"},ollama:{enabled:!0,defaultModel:"llama3.1"},openrouter:{enabled:!0,defaultModel:"anthropic/claude-sonnet-4"},gemini:{enabled:!1,defaultModel:"gemini-pro"},"azure-openai":{enabled:!1},bedrock:{enabled:!1},onnx:{enabled:!0,defaultModel:"phi-4"}},enableMetrics:!0,metricsConfig:{enabled:!0,collectionIntervalMs:6e4,retentionMs:864e5,trackPerRequest:!0},maxDecisionTimeMs:10,cacheDecisions:!0,decisionCacheTtlMs:6e4,cacheConfig:{enabled:!0,ttlMs:6e4,maxEntries:1e3,keyStrategy:"agent-domain"},auditConfig:{enabled:!0,maxEntries:1e4,logContent:!1,logResponse:!1}},a=[{canonicalId:"claude-opus-4-7",canonicalName:"Claude Opus 4.7",providerIds:{claude:"claude-opus-4-7",openrouter:"anthropic/claude-opus-4.7",bedrock:"anthropic.claude-opus-4-7-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:5,outputCostPer1M:25},{canonicalId:"claude-sonnet-4-6",canonicalName:"Claude Sonnet 4.6",providerIds:{claude:"claude-sonnet-4-6",openrouter:"anthropic/claude-sonnet-4.6",bedrock:"anthropic.claude-sonnet-4-6-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:2e5,maxOutputTokens:64e3},tier:"advanced",family:"claude",inputCostPer1M:3,outputCostPer1M:15},{canonicalId:"claude-haiku-4-5",canonicalName:"Claude Haiku 4.5",providerIds:{claude:"claude-haiku-4-5-20251001",openrouter:"anthropic/claude-haiku-4.5",bedrock:"anthropic.claude-haiku-4-5-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:2e5,maxOutputTokens:16384},tier:"standard",family:"claude",inputCostPer1M:1,outputCostPer1M:5},{canonicalId:"gpt-4o",canonicalName:"GPT-4o",providerIds:{openai:"gpt-4o","azure-openai":"gpt-4o",openrouter:"openai/gpt-4o"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"advanced",family:"gpt",inputCostPer1M:2.5,outputCostPer1M:10},{canonicalId:"gpt-4o-mini",canonicalName:"GPT-4o Mini",providerIds:{openai:"gpt-4o-mini","azure-openai":"gpt-4o-mini",openrouter:"openai/gpt-4o-mini"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"standard",family:"gpt",inputCostPer1M:.15,outputCostPer1M:.6},{canonicalId:"gemini-pro",canonicalName:"Gemini 2.0 Pro",providerIds:{gemini:"gemini-2.0-pro",openrouter:"google/gemini-2.0-pro"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:2e6,maxOutputTokens:8192},tier:"advanced",family:"gemini",inputCostPer1M:1.25,outputCostPer1M:5},{canonicalId:"llama-3.1-70b",canonicalName:"LLaMA 3.1 70B",providerIds:{ollama:"llama3.1:70b",openrouter:"meta-llama/llama-3.1-70b",bedrock:"meta.llama3-1-70b-instruct-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:4096},tier:"advanced",family:"llama",inputCostPer1M:.9,outputCostPer1M:.9},{canonicalId:"phi-4",canonicalName:"Microsoft Phi-4",providerIds:{ollama:"phi4",onnx:"phi-4",openrouter:"microsoft/phi-4"},capabilities:{supportsStreaming:!0,supportsTools:!1,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!1,maxContextTokens:16e3,maxOutputTokens:4096,requiresNetwork:!1},tier:"efficient",family:"phi",inputCostPer1M:0,outputCostPer1M:0}];export{t as a,n as b,a as c};
@@ -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.21");process.exit(0)}
2
- import{a as D}from"./chunk-QREO5LNR.js";import{c as x,d as $}from"./chunk-ETEV7IZI.js";import{a as j}from"./chunk-HJCJWPN5.js";import"./chunk-OK5JHHXK.js";import"./chunk-4ZUXTOUG.js";import{Command as U}from"commander";import o from"chalk";import*as I from"fs";import*as p from"path";import*as F from"fs";import*as R from"path";var P={version:"1",name:"aqe-ci",phases:[{name:"Test Generation",type:"test",enabled:!0,config:{target:".",framework:"vitest",type:"unit"},continueOnFailure:!1,timeout:300},{name:"Coverage Analysis",type:"coverage",enabled:!0,config:{target:".",threshold:80},continueOnFailure:!0,timeout:300},{name:"Security Scan",type:"security",enabled:!0,config:{sast:!0},continueOnFailure:!0,timeout:300},{name:"Quality Gate",type:"quality-gate",enabled:!0,config:{},continueOnFailure:!1,timeout:60}],output:{format:"json",directory:".aqe-ci-output",combinedReport:!0},qualityGate:{enforced:!0,thresholds:{coverage:80,security:"medium",quality:70}}},Q=[".aqe-ci.yml",".aqe-ci.yaml","aqe-ci.yml","aqe-ci.yaml"];function G(s=process.cwd()){let n=R.resolve(s);for(let r=0;r<10;r++){for(let a of Q){let e=R.join(n,a);if(F.existsSync(e))return e}let l=R.dirname(n);if(l===n)break;n=l}return null}function T(s){if(!F.existsSync(s))return{success:!1,errors:[`Config file not found: ${s}`]};let n;try{n=F.readFileSync(s,"utf-8")}catch(r){return{success:!1,errors:[`Failed to read config: ${r}`]}}return N(n,s)}function N(s,n){let r=[],l;try{l=j(s)}catch(e){return{success:!1,errors:[`Invalid YAML: ${e}`]}}let a={version:l.version||P.version,name:l.name||P.name,phases:[],output:{...P.output},qualityGate:{...P.qualityGate,thresholds:{...P.qualityGate.thresholds}}};if(l.output&&typeof l.output=="object"){let e=l.output;e.format&&(a.output.format=e.format),e.directory&&(a.output.directory=e.directory),e.combined_report!==void 0&&(a.output.combinedReport=e.combined_report)}if(l.quality_gate&&typeof l.quality_gate=="object"){let e=l.quality_gate;if(e.enforced!==void 0&&(a.qualityGate.enforced=e.enforced),e.thresholds&&typeof e.thresholds=="object"){let t=e.thresholds;t.coverage!==void 0&&(a.qualityGate.thresholds.coverage=t.coverage),t.security!==void 0&&(a.qualityGate.thresholds.security=t.security),t.quality!==void 0&&(a.qualityGate.thresholds.quality=t.quality)}}if(l.phases&&Array.isArray(l.phases))for(let e=0;e<l.phases.length;e++){let t=l.phases[e];if(!t.name){r.push(`Phase ${e+1} must have a "name" field`);continue}if(!t.type){r.push(`Phase "${t.name}" must have a "type" field`);continue}let i=["test","coverage","security","quality-gate","code-intelligence","custom"];if(!i.includes(t.type)){r.push(`Phase "${t.name}" has invalid type "${t.type}". Valid: ${i.join(", ")}`);continue}let h={name:t.name,type:t.type,enabled:t.enabled!==!1,config:t.config||{},continueOnFailure:t.continue_on_failure||!1,timeout:t.timeout||300};a.phases.push(h)}else a.phases=[...P.phases];return a.phases.length===0&&r.push("Config must have at least one phase"),r.length>0?{success:!1,config:a,errors:r}:{success:!0,config:a,errors:[],configPath:n}}function E(){return{...P,phases:P.phases.map(s=>({...s,config:{...s.config}})),output:{...P.output},qualityGate:{...P.qualityGate,thresholds:{...P.qualityGate.thresholds}}}}async function W(s,n,r,l){let a=Date.now(),e=[];if(!s.enabled)return{phase:s.name,type:s.type,status:"skipped",duration:0,exitCode:0,summary:"Phase disabled",artifacts:[]};try{let t={},i="passed",h="";switch(s.type){case"test":{let f=await n.kernel.getDomainAPIAsync("test-generation");if(!f)return A(s,a,"failed",1,"Test generation domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-ERTPM3C4.js"),w=p.resolve(C),v=m(w,{includeTests:!1}),y=await f.generateTests({sourceFiles:v,testType:s.config.type||"unit",framework:s.config.framework||"vitest",coverageTarget:80});if(y.success&&y.value){let g=y.value;t={testsGenerated:g.tests.length,coverageEstimate:g.coverageEstimate},h=`Generated ${g.tests.length} tests (est. ${g.coverageEstimate}% coverage)`;let d=p.join(r,"test-generation.json");I.writeFileSync(d,$(g),"utf-8"),e.push(d)}else i="failed",h=y.error?.message||"Test generation failed";break}case"coverage":{let f=await n.kernel.getDomainAPIAsync("coverage-analysis");if(!f)return A(s,a,"failed",1,"Coverage analysis domain not available",e);let C=s.config.target||".",m=s.config.threshold||80,{walkSourceFiles:w}=await import("./file-discovery-ERTPM3C4.js"),v=p.resolve(C),y=w(v,{includeTests:!1}),g=D(y),d=await f.analyze({coverageData:g,threshold:m,includeFileDetails:!0});if(d.success&&d.value){let b=d.value;t={...b.summary,meetsThreshold:b.meetsThreshold,threshold:m},i=b.meetsThreshold?"passed":"warning",h=`Line: ${b.summary.line}%, Branch: ${b.summary.branch}% \u2014 ${b.meetsThreshold?"meets":"below"} ${m}% threshold`;let q=p.join(r,"coverage.json");I.writeFileSync(q,$(d.value),"utf-8"),e.push(q)}else i="failed",h=d.error?.message||"Coverage analysis failed";break}case"security":{let f=await n.kernel.getDomainAPIAsync("security-compliance");if(!f)return A(s,a,"failed",1,"Security domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-ERTPM3C4.js"),w=p.resolve(C),v=m(w,{includeTests:!0}),y=await f.runSASTScan(v);if(y.success&&y.value){let g=y.value,d=g.vulnerabilities||[],b=d.filter(S=>S.severity==="high"||S.severity==="critical").length;t={vulnerabilities:d.length,high:b},i=b>0?"failed":d.length>0?"warning":"passed",h=d.length===0?"No vulnerabilities found":`${d.length} vulnerabilities (${b} high/critical)`;let{toSARIF:q}=await import("./ci-output-FGZTTY3R.js"),c=p.join(r,"security.sarif");I.writeFileSync(c,q({vulnerabilities:d,target:C,scanType:"SAST"}),"utf-8"),e.push(c);let u=p.join(r,"security.json");I.writeFileSync(u,$(g),"utf-8"),e.push(u)}else i="failed",h=y.error?.message||"Security scan failed";break}case"quality-gate":{let f=await n.kernel.getDomainAPIAsync("quality-assessment");if(!f)return A(s,a,"failed",1,"Quality assessment domain not available",e);let C=await f.evaluate({runGate:!0,includeAdvice:!0});if(C.success&&C.value){let m=C.value,w=m.passed??m.meetsThreshold??!0;t={passed:w,score:m.score||m.grade,checks:m.checks},i=w?"passed":"failed",h=`Quality gate: ${w?"PASSED":"FAILED"} (score: ${m.score||m.grade||"N/A"})`;let v=p.join(r,"quality-gate.json");I.writeFileSync(v,$(m),"utf-8"),e.push(v)}else i="failed",h=C.error?.message||"Quality gate evaluation failed";break}case"code-intelligence":{let f=await n.kernel.getDomainAPIAsync("code-intelligence");if(!f)return A(s,a,"failed",1,"Code intelligence domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-ERTPM3C4.js"),w=p.resolve(C),v=m(w,{includeTests:!1}),y=await f.index({paths:v,incremental:!0});if(y.success&&y.value){let g=y.value;t=g,h=`Indexed ${g.filesIndexed} files, ${g.nodesCreated} nodes`;let d=p.join(r,"code-intelligence.json");I.writeFileSync(d,$(g),"utf-8"),e.push(d)}else i="warning",h=y.error?.message||"Code intelligence indexing incomplete";break}default:h=`Custom phase "${s.name}" \u2014 no built-in handler`,i="warning"}let k=Date.now()-a;return{phase:s.name,type:s.type,status:i,duration:k,exitCode:i==="failed"?1:0,summary:h,artifacts:e,details:t}}catch(t){let i=Date.now()-a;return{phase:s.name,type:s.type,status:"failed",duration:i,exitCode:1,summary:`Error: ${t instanceof Error?t.message:String(t)}`,artifacts:e}}}function A(s,n,r,l,a,e){return{phase:s.name,type:s.type,status:r,duration:Date.now()-n,exitCode:l,summary:a,artifacts:e}}function _(s){let n=`# AQE CI/CD Report
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.23");process.exit(0)}
2
+ import{a as D}from"./chunk-D4U3UAS3.js";import{c as x,d as $}from"./chunk-LBY4ISY3.js";import{a as j}from"./chunk-W47CQVJZ.js";import"./chunk-6SQTWXV4.js";import"./chunk-I4MDD35Z.js";import{Command as U}from"commander";import o from"chalk";import*as I from"fs";import*as p from"path";import*as F from"fs";import*as R from"path";var P={version:"1",name:"aqe-ci",phases:[{name:"Test Generation",type:"test",enabled:!0,config:{target:".",framework:"vitest",type:"unit"},continueOnFailure:!1,timeout:300},{name:"Coverage Analysis",type:"coverage",enabled:!0,config:{target:".",threshold:80},continueOnFailure:!0,timeout:300},{name:"Security Scan",type:"security",enabled:!0,config:{sast:!0},continueOnFailure:!0,timeout:300},{name:"Quality Gate",type:"quality-gate",enabled:!0,config:{},continueOnFailure:!1,timeout:60}],output:{format:"json",directory:".aqe-ci-output",combinedReport:!0},qualityGate:{enforced:!0,thresholds:{coverage:80,security:"medium",quality:70}}},Q=[".aqe-ci.yml",".aqe-ci.yaml","aqe-ci.yml","aqe-ci.yaml"];function G(s=process.cwd()){let n=R.resolve(s);for(let r=0;r<10;r++){for(let a of Q){let e=R.join(n,a);if(F.existsSync(e))return e}let l=R.dirname(n);if(l===n)break;n=l}return null}function T(s){if(!F.existsSync(s))return{success:!1,errors:[`Config file not found: ${s}`]};let n;try{n=F.readFileSync(s,"utf-8")}catch(r){return{success:!1,errors:[`Failed to read config: ${r}`]}}return N(n,s)}function N(s,n){let r=[],l;try{l=j(s)}catch(e){return{success:!1,errors:[`Invalid YAML: ${e}`]}}let a={version:l.version||P.version,name:l.name||P.name,phases:[],output:{...P.output},qualityGate:{...P.qualityGate,thresholds:{...P.qualityGate.thresholds}}};if(l.output&&typeof l.output=="object"){let e=l.output;e.format&&(a.output.format=e.format),e.directory&&(a.output.directory=e.directory),e.combined_report!==void 0&&(a.output.combinedReport=e.combined_report)}if(l.quality_gate&&typeof l.quality_gate=="object"){let e=l.quality_gate;if(e.enforced!==void 0&&(a.qualityGate.enforced=e.enforced),e.thresholds&&typeof e.thresholds=="object"){let t=e.thresholds;t.coverage!==void 0&&(a.qualityGate.thresholds.coverage=t.coverage),t.security!==void 0&&(a.qualityGate.thresholds.security=t.security),t.quality!==void 0&&(a.qualityGate.thresholds.quality=t.quality)}}if(l.phases&&Array.isArray(l.phases))for(let e=0;e<l.phases.length;e++){let t=l.phases[e];if(!t.name){r.push(`Phase ${e+1} must have a "name" field`);continue}if(!t.type){r.push(`Phase "${t.name}" must have a "type" field`);continue}let i=["test","coverage","security","quality-gate","code-intelligence","custom"];if(!i.includes(t.type)){r.push(`Phase "${t.name}" has invalid type "${t.type}". Valid: ${i.join(", ")}`);continue}let h={name:t.name,type:t.type,enabled:t.enabled!==!1,config:t.config||{},continueOnFailure:t.continue_on_failure||!1,timeout:t.timeout||300};a.phases.push(h)}else a.phases=[...P.phases];return a.phases.length===0&&r.push("Config must have at least one phase"),r.length>0?{success:!1,config:a,errors:r}:{success:!0,config:a,errors:[],configPath:n}}function E(){return{...P,phases:P.phases.map(s=>({...s,config:{...s.config}})),output:{...P.output},qualityGate:{...P.qualityGate,thresholds:{...P.qualityGate.thresholds}}}}async function W(s,n,r,l){let a=Date.now(),e=[];if(!s.enabled)return{phase:s.name,type:s.type,status:"skipped",duration:0,exitCode:0,summary:"Phase disabled",artifacts:[]};try{let t={},i="passed",h="";switch(s.type){case"test":{let f=await n.kernel.getDomainAPIAsync("test-generation");if(!f)return A(s,a,"failed",1,"Test generation domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-4VJNIXYH.js"),w=p.resolve(C),v=m(w,{includeTests:!1}),y=await f.generateTests({sourceFiles:v,testType:s.config.type||"unit",framework:s.config.framework||"vitest",coverageTarget:80});if(y.success&&y.value){let g=y.value;t={testsGenerated:g.tests.length,coverageEstimate:g.coverageEstimate},h=`Generated ${g.tests.length} tests (est. ${g.coverageEstimate}% coverage)`;let d=p.join(r,"test-generation.json");I.writeFileSync(d,$(g),"utf-8"),e.push(d)}else i="failed",h=y.error?.message||"Test generation failed";break}case"coverage":{let f=await n.kernel.getDomainAPIAsync("coverage-analysis");if(!f)return A(s,a,"failed",1,"Coverage analysis domain not available",e);let C=s.config.target||".",m=s.config.threshold||80,{walkSourceFiles:w}=await import("./file-discovery-4VJNIXYH.js"),v=p.resolve(C),y=w(v,{includeTests:!1}),g=D(y),d=await f.analyze({coverageData:g,threshold:m,includeFileDetails:!0});if(d.success&&d.value){let b=d.value;t={...b.summary,meetsThreshold:b.meetsThreshold,threshold:m},i=b.meetsThreshold?"passed":"warning",h=`Line: ${b.summary.line}%, Branch: ${b.summary.branch}% \u2014 ${b.meetsThreshold?"meets":"below"} ${m}% threshold`;let q=p.join(r,"coverage.json");I.writeFileSync(q,$(d.value),"utf-8"),e.push(q)}else i="failed",h=d.error?.message||"Coverage analysis failed";break}case"security":{let f=await n.kernel.getDomainAPIAsync("security-compliance");if(!f)return A(s,a,"failed",1,"Security domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-4VJNIXYH.js"),w=p.resolve(C),v=m(w,{includeTests:!0}),y=await f.runSASTScan(v);if(y.success&&y.value){let g=y.value,d=g.vulnerabilities||[],b=d.filter(S=>S.severity==="high"||S.severity==="critical").length;t={vulnerabilities:d.length,high:b},i=b>0?"failed":d.length>0?"warning":"passed",h=d.length===0?"No vulnerabilities found":`${d.length} vulnerabilities (${b} high/critical)`;let{toSARIF:q}=await import("./ci-output-EAGYFT3G.js"),c=p.join(r,"security.sarif");I.writeFileSync(c,q({vulnerabilities:d,target:C,scanType:"SAST"}),"utf-8"),e.push(c);let u=p.join(r,"security.json");I.writeFileSync(u,$(g),"utf-8"),e.push(u)}else i="failed",h=y.error?.message||"Security scan failed";break}case"quality-gate":{let f=await n.kernel.getDomainAPIAsync("quality-assessment");if(!f)return A(s,a,"failed",1,"Quality assessment domain not available",e);let C=await f.evaluate({runGate:!0,includeAdvice:!0});if(C.success&&C.value){let m=C.value,w=m.passed??m.meetsThreshold??!0;t={passed:w,score:m.score||m.grade,checks:m.checks},i=w?"passed":"failed",h=`Quality gate: ${w?"PASSED":"FAILED"} (score: ${m.score||m.grade||"N/A"})`;let v=p.join(r,"quality-gate.json");I.writeFileSync(v,$(m),"utf-8"),e.push(v)}else i="failed",h=C.error?.message||"Quality gate evaluation failed";break}case"code-intelligence":{let f=await n.kernel.getDomainAPIAsync("code-intelligence");if(!f)return A(s,a,"failed",1,"Code intelligence domain not available",e);let C=s.config.target||".",{walkSourceFiles:m}=await import("./file-discovery-4VJNIXYH.js"),w=p.resolve(C),v=m(w,{includeTests:!1}),y=await f.index({paths:v,incremental:!0});if(y.success&&y.value){let g=y.value;t=g,h=`Indexed ${g.filesIndexed} files, ${g.nodesCreated} nodes`;let d=p.join(r,"code-intelligence.json");I.writeFileSync(d,$(g),"utf-8"),e.push(d)}else i="warning",h=y.error?.message||"Code intelligence indexing incomplete";break}default:h=`Custom phase "${s.name}" \u2014 no built-in handler`,i="warning"}let k=Date.now()-a;return{phase:s.name,type:s.type,status:i,duration:k,exitCode:i==="failed"?1:0,summary:h,artifacts:e,details:t}}catch(t){let i=Date.now()-a;return{phase:s.name,type:s.type,status:"failed",duration:i,exitCode:1,summary:`Error: ${t instanceof Error?t.message:String(t)}`,artifacts:e}}}function A(s,n,r,l,a,e){return{phase:s.name,type:s.type,status:r,duration:Date.now()-n,exitCode:l,summary:a,artifacts:e}}function _(s){let n=`# AQE CI/CD Report
3
3
 
4
4
  `;n+=`**Status:** ${s.overallStatus==="passed"?"PASSED":s.overallStatus==="warning"?"WARNING":"FAILED"}
5
5
  `,n+=`**Duration:** ${(s.duration/1e3).toFixed(1)}s
@@ -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.21");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-ETEV7IZI.js";import"./chunk-4ZUXTOUG.js";export{a as FORMAT_OPTION,b as OUTPUT_OPTION,g as coverageToMarkdown,h as qualityGateToMarkdown,i as securityToMarkdown,j as testRunToMarkdown,d as toJSON,f as toJUnit,e as toSARIF,c as writeOutput};
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.23");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-LBY4ISY3.js";import"./chunk-I4MDD35Z.js";export{a as FORMAT_OPTION,b as OUTPUT_OPTION,g as coverageToMarkdown,h as qualityGateToMarkdown,i as securityToMarkdown,j as testRunToMarkdown,d as toJSON,f as toJUnit,e as toSARIF,c as writeOutput};
@@ -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.21");process.exit(0)}
2
- import{a,b}from"./chunk-4XZPDEK5.js";import"./chunk-4ZUXTOUG.js";export{a as AdvisorCircuitBreaker,b as AdvisorCircuitBreakerError};
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.23");process.exit(0)}
2
+ import{a,b}from"./chunk-CBVGJMLJ.js";import"./chunk-I4MDD35Z.js";export{a as AdvisorCircuitBreaker,b as AdvisorCircuitBreakerError};
@@ -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.21");process.exit(0)}
2
- import{b as g}from"./chunk-G7ZYDJZ3.js";import{b as f,d as h}from"./chunk-PEOTZFNZ.js";import{a as d,c as v}from"./chunk-SMBQERK7.js";import{a as b}from"./chunk-4ZUXTOUG.js";h();v();import{existsSync as c,writeFileSync as p,readFileSync as m}from"node:fs";import{join as a}from"node:path";async function C(t,e){let o=g(t);if(e&&o.available&&console.log(`[ClaudeFlow] Detected via ${o.method}${o.version?`: v${o.version}`:""}`),!o.available)return{available:!1};let r={"mcp-config":"mcp","local-binary":"cli","npx-cached":"cli","npm-dependency":"npm"};return{available:!0,version:o.version,method:o.method?r[o.method]:void 0}}async function F(t){return{trajectories:!0,modelRouting:!0,pretrain:!0,workers:!0,patternSearch:!0}}function S(t,e){return{version:"1.0",projectRoot:t,integration:{enabled:!0,features:{trajectories:e.trajectories,modelRouting:e.modelRouting,pretrain:e.pretrain,workers:e.workers}},learning:{trajectoryStorage:e.trajectories?"claude-flow":"local",patternSearch:e.patternSearch?"claude-flow":"local"},routing:{modelRouting:e.modelRouting?"claude-flow":"rule-based",preferences:{simple:"haiku",standard:"sonnet",complex:"opus"}},pretrain:{enabled:e.pretrain,depth:"medium",autoRun:!0},workers:{enabled:e.workers,autoDispatch:["optimize","consolidate"]}}}function y(t){let e=a(t,".claude","settings.json"),o={};if(c(e))try{o=f(m(e,"utf-8"))}catch{}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;!r.ruflo&&!r["claude-flow"]&&(r.ruflo={command:"npx",args:["ruflo@3.5.18","mcp"],env:{}}),p(e,JSON.stringify(o,null,2))}async function O(t){let{projectRoot:e,force:o,checkOnly:r,debug:s}=t,n=await C(e,s);if(!n.available&&!o)return{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,workers:!1,patternSearch:!1}};let l=await F(e);if(r)return{available:n.available,version:n.version,features:l};let w=a(e,".agentic-qe"),u=a(w,"claude-flow-integration.json");try{let i=S(e,l);p(u,JSON.stringify(i,null,2)),s&&console.log(`[ClaudeFlow] Config written to: ${u}`)}catch(i){return{available:n.available,version:n.version,features:l,error:`Failed to write config: ${d(i)}`}}try{y(e)}catch(i){s&&console.log("[ClaudeFlow] MCP config update failed:",d(i))}return{available:!0,version:n.version,features:l,configPath:u}}function M(t){let e=a(t,".agentic-qe","claude-flow-integration.json");return c(e)}function $(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(!c(e))return null;try{return f(m(e,"utf-8"))}catch{return null}}function D(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(c(e))try{return b("node:fs").rmSync(e),!0}catch{return!1}return!0}export{$ as getClaudeFlowConfig,M as isClaudeFlowConfigured,D as removeClaudeFlowIntegration,O as setupClaudeFlowIntegration};
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.23");process.exit(0)}
2
+ import{b as g}from"./chunk-7SHZ5BNE.js";import{b as f,d as h}from"./chunk-J2RELPD3.js";import{a as d,c as v}from"./chunk-CLMIRGMC.js";import{a as b}from"./chunk-I4MDD35Z.js";h();v();import{existsSync as c,writeFileSync as p,readFileSync as m}from"node:fs";import{join as a}from"node:path";async function C(t,e){let o=g(t);if(e&&o.available&&console.log(`[ClaudeFlow] Detected via ${o.method}${o.version?`: v${o.version}`:""}`),!o.available)return{available:!1};let r={"mcp-config":"mcp","local-binary":"cli","npx-cached":"cli","npm-dependency":"npm"};return{available:!0,version:o.version,method:o.method?r[o.method]:void 0}}async function F(t){return{trajectories:!0,modelRouting:!0,pretrain:!0,workers:!0,patternSearch:!0}}function S(t,e){return{version:"1.0",projectRoot:t,integration:{enabled:!0,features:{trajectories:e.trajectories,modelRouting:e.modelRouting,pretrain:e.pretrain,workers:e.workers}},learning:{trajectoryStorage:e.trajectories?"claude-flow":"local",patternSearch:e.patternSearch?"claude-flow":"local"},routing:{modelRouting:e.modelRouting?"claude-flow":"rule-based",preferences:{simple:"haiku",standard:"sonnet",complex:"opus"}},pretrain:{enabled:e.pretrain,depth:"medium",autoRun:!0},workers:{enabled:e.workers,autoDispatch:["optimize","consolidate"]}}}function y(t){let e=a(t,".claude","settings.json"),o={};if(c(e))try{o=f(m(e,"utf-8"))}catch{}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;!r.ruflo&&!r["claude-flow"]&&(r.ruflo={command:"npx",args:["ruflo@3.5.18","mcp"],env:{}}),p(e,JSON.stringify(o,null,2))}async function O(t){let{projectRoot:e,force:o,checkOnly:r,debug:s}=t,n=await C(e,s);if(!n.available&&!o)return{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,workers:!1,patternSearch:!1}};let l=await F(e);if(r)return{available:n.available,version:n.version,features:l};let w=a(e,".agentic-qe"),u=a(w,"claude-flow-integration.json");try{let i=S(e,l);p(u,JSON.stringify(i,null,2)),s&&console.log(`[ClaudeFlow] Config written to: ${u}`)}catch(i){return{available:n.available,version:n.version,features:l,error:`Failed to write config: ${d(i)}`}}try{y(e)}catch(i){s&&console.log("[ClaudeFlow] MCP config update failed:",d(i))}return{available:!0,version:n.version,features:l,configPath:u}}function M(t){let e=a(t,".agentic-qe","claude-flow-integration.json");return c(e)}function $(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(!c(e))return null;try{return f(m(e,"utf-8"))}catch{return null}}function D(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(c(e))try{return b("node:fs").rmSync(e),!0}catch{return!1}return!0}export{$ as getClaudeFlowConfig,M as isClaudeFlowConfigured,D as removeClaudeFlowIntegration,O as setupClaudeFlowIntegration};
@@ -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.23");process.exit(0)}
2
+ import{c as a,d as b,e as c}from"./chunk-RHU77EOX.js";import"./chunk-6YF74LZ5.js";import"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};
@@ -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.21");process.exit(0)}
2
- import{b as p}from"./chunk-EVWNZEYV.js";import{a as f,c as v}from"./chunk-SMBQERK7.js";import"./chunk-4ZUXTOUG.js";v();import{existsSync as s,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as h,dirname as d}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("cline"),e=h(this.projectRoot,t.path);if(r.configPath=e,!s(e)||this.overwrite){let o=d(e);if(s(o)||m(o,{recursive:!0}),s(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let n=this.generator.generateBehavioralRules("cline"),i=h(this.projectRoot,n.path);if(r.modePath=i,!s(i)||this.overwrite){let o=d(i);if(s(o)||m(o,{recursive:!0}),s(i)&&this.overwrite){let c=this.mergeExistingModes(i,n.content);a(i,c)}else a(i,n.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Cline installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),n=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,n.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.23");process.exit(0)}
2
+ import{b as p}from"./chunk-V5FSNDXP.js";import{a as f,c as v}from"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";v();import{existsSync as s,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as h,dirname as d}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("cline"),e=h(this.projectRoot,t.path);if(r.configPath=e,!s(e)||this.overwrite){let o=d(e);if(s(o)||m(o,{recursive:!0}),s(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let n=this.generator.generateBehavioralRules("cline"),i=h(this.projectRoot,n.path);if(r.modePath=i,!s(i)||this.overwrite){let o=d(i);if(s(o)||m(o,{recursive:!0}),s(i)&&this.overwrite){let c=this.mergeExistingModes(i,n.content);a(i,c)}else a(i,n.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Cline installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),n=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,n.mcpServers),JSON.stringify(e,null,2)+`
3
3
  `}catch{return t}}mergeExistingModes(r,t){try{let e=JSON.parse(u(r,"utf-8")),n=JSON.parse(t);if(!Array.isArray(e))return t;let i=e.filter(o=>o.slug!=="qe-engineer");return i.push(...n),JSON.stringify(i,null,2)+`
4
4
  `}catch{return t}}};function x(g){return new l(g)}export{l as ClineInstaller,x as createClineInstaller};
@@ -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.21");process.exit(0)}
2
- import{a as A,b as $}from"./chunk-GLQ6LLKC.js";import{c as b,d as x}from"./chunk-ETEV7IZI.js";import"./chunk-4ZUXTOUG.js";import{Command as z}from"commander";import e from"chalk";function j(S,w,P){return new z("code").description("Code intelligence analysis").argument("<action>","Action (index|search|impact|deps|complexity)").argument("[target]","Target path or query").option("--depth <depth>","Analysis depth","3").option("--include-tests","Include test files").option("--incremental","Incremental indexing (index action only)").option("--git-since <ref>","Index changes since git ref (index action only)").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").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.23");process.exit(0)}
2
+ import{a as A,b as $}from"./chunk-WKNDFV4J.js";import{c as b,d as x}from"./chunk-LBY4ISY3.js";import"./chunk-I4MDD35Z.js";import{Command as z}from"commander";import e from"chalk";function j(S,w,P){return new z("code").description("Code intelligence analysis").argument("<action>","Action (index|search|impact|deps|complexity)").argument("[target]","Target path or query").option("--depth <depth>","Analysis depth","3").option("--include-tests","Include test files").option("--incremental","Incremental indexing (index action only)").option("--git-since <ref>","Index changes since git ref (index action only)").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").addHelpText("after",`
3
3
  Examples:
4
4
  aqe code index src/ Index source files into knowledge graph
5
5
  aqe code index src/ --incremental Incremental index (only changed files)
@@ -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.21");process.exit(0)}
2
- import"./chunk-4ZUXTOUG.js";import{readFile as m}from"fs/promises";var d=new Set(["if","for","while","switch","catch","return","new","throw","import","export","constructor"]),h=50;function x(o,c){let n=c.split(`
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.23");process.exit(0)}
2
+ import"./chunk-I4MDD35Z.js";import{readFile as m}from"fs/promises";var d=new Set(["if","for","while","switch","catch","return","new","throw","import","export","constructor"]),h=50;function x(o,c){let n=c.split(`
3
3
  `),e=[],i=[];for(let t=0;t<n.length;t++){let s=n[t],a=s.match(/(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s+(\w+)/);if(a){e.push({type:"function",name:a[1],lineStart:t+1});continue}let l=s.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?(?:\([^)]*\)|[a-zA-Z_]\w*)\s*(?::\s*[^=]+)?\s*=>/);if(l){e.push({type:"function",name:l[1],lineStart:t+1});continue}let u=s.match(/(?:export\s+)?(?:default\s+)?(?:abstract\s+)?class\s+(\w+)/);if(u){e.push({type:"class",name:u[1],lineStart:t+1});continue}let f=s.match(/(?:export\s+)?interface\s+(\w+)/);if(f){e.push({type:"interface",name:f[1],lineStart:t+1});continue}let r=s.match(/^\s+(?:(?:public|private|protected|static|readonly|override|abstract|async)\s+)*(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*(?::\s*[^{]+)?\s*\{?\s*$/);if(r&&!d.has(r[1])){e.push({type:"function",name:r[1],lineStart:t+1});continue}let p=s.match(/(?:import|from)\s+['"](\.[^'"]+)['"]/);p&&i.push(p[1])}return{path:o,entities:e,imports:i}}async function y(o){let c=[];for(let n=0;n<o.length;n+=h){let e=o.slice(n,n+h),i=await Promise.allSettled(e.map(async t=>{let s=await m(t,"utf-8");return x(t,s)}));for(let t of i)t.status==="fulfilled"&&c.push(t.value)}return{files:c}}export{y as extractCodeIndex};
@@ -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.21");process.exit(0)}
2
- import{b as f}from"./chunk-EVWNZEYV.js";import{a as l,c as m}from"./chunk-SMBQERK7.js";import"./chunk-4ZUXTOUG.js";m();import{existsSync as o,mkdirSync as h,readFileSync as d,writeFileSync as s}from"fs";import{join as u,dirname as x}from"path";var c=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=f()}async install(){let t={success:!0,mcpConfigured:!1,agentsMdInstalled:!1,errors:[],configPath:"",agentsMdPath:""};try{let r=this.generator.generateMcpConfig("codex"),e=u(this.projectRoot,r.path);if(t.configPath=e,!o(e)||this.overwrite){let i=x(e);if(o(i)||h(i,{recursive:!0}),o(e)&&this.overwrite){let p=this.mergeExistingTomlConfig(e,r.content);s(e,p)}else s(e,r.content);t.mcpConfigured=!0}let a=this.generator.generateBehavioralRules("codex"),n=u(this.projectRoot,a.path);if(t.agentsMdPath=n,!o(n)||this.overwrite){if(o(n)&&this.overwrite){let i=this.mergeExistingAgentsMd(n,a.content);s(n,i)}else s(n,a.content);t.agentsMdInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Codex installation failed: ${l(r)}`)}return t}mergeExistingTomlConfig(t,r){try{let e=d(t,"utf-8");return e.includes("[mcp_servers.agentic-qe]")?e:e.trimEnd()+`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.23");process.exit(0)}
2
+ import{b as f}from"./chunk-V5FSNDXP.js";import{a as l,c as m}from"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";m();import{existsSync as o,mkdirSync as h,readFileSync as d,writeFileSync as s}from"fs";import{join as u,dirname as x}from"path";var c=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=f()}async install(){let t={success:!0,mcpConfigured:!1,agentsMdInstalled:!1,errors:[],configPath:"",agentsMdPath:""};try{let r=this.generator.generateMcpConfig("codex"),e=u(this.projectRoot,r.path);if(t.configPath=e,!o(e)||this.overwrite){let i=x(e);if(o(i)||h(i,{recursive:!0}),o(e)&&this.overwrite){let p=this.mergeExistingTomlConfig(e,r.content);s(e,p)}else s(e,r.content);t.mcpConfigured=!0}let a=this.generator.generateBehavioralRules("codex"),n=u(this.projectRoot,a.path);if(t.agentsMdPath=n,!o(n)||this.overwrite){if(o(n)&&this.overwrite){let i=this.mergeExistingAgentsMd(n,a.content);s(n,i)}else s(n,a.content);t.agentsMdInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Codex installation failed: ${l(r)}`)}return t}mergeExistingTomlConfig(t,r){try{let e=d(t,"utf-8");return e.includes("[mcp_servers.agentic-qe]")?e:e.trimEnd()+`
3
3
 
4
4
  `+r}catch{return r}}mergeExistingAgentsMd(t,r){try{let e=d(t,"utf-8");return e.includes("Agentic QE")||e.includes("fleet_init")?e:e.trimEnd()+`
5
5
 
@@ -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.21");process.exit(0)}
2
- import"./chunk-4ZUXTOUG.js";import{Command as x}from"commander";import o from"chalk";var c=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization"],a=["qe-tdd-specialist","qe-test-architect","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-deployment-advisor","qe-code-complexity","qe-qx-partner","qe-security-scanner","qe-security-auditor","qe-contract-validator","qe-integration-tester","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-performance-tester","qe-load-tester","qe-chaos-engineer","qe-code-intelligence","qe-dependency-mapper","qe-kg-builder","qe-requirements-validator","qe-bdd-generator","qe-defect-predictor","qe-root-cause-analyzer","qe-regression-analyzer","qe-impact-analyzer","qe-risk-assessor","qe-learning-coordinator","qe-pattern-learner","qe-transfer-specialist","qe-metrics-optimizer","qe-fleet-commander","qe-queen-coordinator","qe-property-tester","qe-mutation-tester","qe-tdd-red","qe-tdd-green","qe-tdd-refactor","qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer"],i=["tester","reviewer","security-auditor","security-architect","performance-engineer","code-analyzer","cicd-engineer","reasoningbank-learner","adr-architect","ddd-domain-expert","v3-integration-architect","memory-specialist","claims-authorizer","sparc-orchestrator","sona-learning-optimizer","safla-neural","production-validator","tdd-london-swarm","queen-coordinator","swarm-memory-manager","worker-specialist","collective-intelligence-coordinator","scout-explorer","adaptive-coordinator","mesh-coordinator","hierarchical-coordinator","consensus-coordinator","byzantine-coordinator","raft-manager","crdt-synchronizer","n8n-workflow-executor","n8n-unit-tester","n8n-integration-test","n8n-trigger-test","n8n-security-auditor"],P=[...a,...i];var p=["generate-tests","execute-tests","analyze-coverage","assess-quality","predict-defects","validate-requirements","analyze-code","scan-security","validate-contracts","test-accessibility","chaos-test","optimize-learning"],b=["p0","p1","p2","p3"],y=["pending","running","completed","failed","cancelled"],d=["jest","vitest","pytest","junit","playwright","cypress","go-test","node-test"],w=["unit","integration","e2e"],C=["sqlite","agentdb","hybrid"];function q(){return`#!/bin/bash
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.23");process.exit(0)}
2
+ import"./chunk-I4MDD35Z.js";import{Command as x}from"commander";import o from"chalk";var c=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization"],a=["qe-tdd-specialist","qe-test-architect","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-deployment-advisor","qe-code-complexity","qe-qx-partner","qe-security-scanner","qe-security-auditor","qe-contract-validator","qe-integration-tester","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-performance-tester","qe-load-tester","qe-chaos-engineer","qe-code-intelligence","qe-dependency-mapper","qe-kg-builder","qe-requirements-validator","qe-bdd-generator","qe-defect-predictor","qe-root-cause-analyzer","qe-regression-analyzer","qe-impact-analyzer","qe-risk-assessor","qe-learning-coordinator","qe-pattern-learner","qe-transfer-specialist","qe-metrics-optimizer","qe-fleet-commander","qe-queen-coordinator","qe-property-tester","qe-mutation-tester","qe-tdd-red","qe-tdd-green","qe-tdd-refactor","qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer"],i=["tester","reviewer","security-auditor","security-architect","performance-engineer","code-analyzer","cicd-engineer","reasoningbank-learner","adr-architect","ddd-domain-expert","v3-integration-architect","memory-specialist","claims-authorizer","sparc-orchestrator","sona-learning-optimizer","safla-neural","production-validator","tdd-london-swarm","queen-coordinator","swarm-memory-manager","worker-specialist","collective-intelligence-coordinator","scout-explorer","adaptive-coordinator","mesh-coordinator","hierarchical-coordinator","consensus-coordinator","byzantine-coordinator","raft-manager","crdt-synchronizer","n8n-workflow-executor","n8n-unit-tester","n8n-integration-test","n8n-trigger-test","n8n-security-auditor"],P=[...a,...i];var p=["generate-tests","execute-tests","analyze-coverage","assess-quality","predict-defects","validate-requirements","analyze-code","scan-security","validate-contracts","test-accessibility","chaos-test","optimize-learning"],b=["p0","p1","p2","p3"],y=["pending","running","completed","failed","cancelled"],d=["jest","vitest","pytest","junit","playwright","cypress","go-test","node-test"],w=["unit","integration","e2e"],C=["sqlite","agentdb","hybrid"];function q(){return`#!/bin/bash
3
3
  # AQE CLI Bash Completion Script
4
4
  # Generated by aqe completions bash
5
5
  # ADR-041: Shell Completions for Enhanced Developer Experience
@@ -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.21");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i}from"./chunk-J3GG3Q4X.js";import"./chunk-AT25VXEO.js";import"./chunk-HRHKLRBB.js";import"./chunk-4ZUXTOUG.js";export{g as ComplexityAnalyzer,c as ScoreCalculator,a as SignalCollector,e as TierRecommender,h as createComplexityAnalyzer,i as createComplexityAnalyzerWithDependencies,d as createScoreCalculator,b as createSignalCollector,f as createTierRecommender};
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.23");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i}from"./chunk-QWHQUIPC.js";import"./chunk-NLW3NTNN.js";import"./chunk-P6CK2HEP.js";import"./chunk-I4MDD35Z.js";export{g as ComplexityAnalyzer,c as ScoreCalculator,a as SignalCollector,e as TierRecommender,h as createComplexityAnalyzer,i as createComplexityAnalyzerWithDependencies,d as createScoreCalculator,b as createSignalCollector,f as createTierRecommender};
@@ -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.21");process.exit(0)}
2
- import{b as g}from"./chunk-EVWNZEYV.js";import{a as u,c as h}from"./chunk-SMBQERK7.js";import"./chunk-4ZUXTOUG.js";h();import{existsSync as o,mkdirSync as f,readFileSync as d,writeFileSync as a}from"fs";import{join as m,dirname as p}from"path";var c=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("continuedev"),e=m(this.projectRoot,r.path);if(t.configPath=e,!o(e)||this.overwrite){let n=p(e);if(o(n)||f(n,{recursive:!0}),o(e)&&this.overwrite){let v=this.mergeExistingYamlConfig(e,r.content);a(e,v)}else a(e,r.content);t.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("continuedev"),i=m(this.projectRoot,s.path);if(t.rulesPath=i,!o(i)||this.overwrite){let n=p(i);o(n)||f(n,{recursive:!0}),a(i,s.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Continue.dev installation failed: ${u(r)}`)}return t}mergeExistingYamlConfig(t,r){try{let e=d(t,"utf-8");return e.includes("agentic-qe")?e:e.includes("mcpServers:")?e.trimEnd()+`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.23");process.exit(0)}
2
+ import{b as g}from"./chunk-V5FSNDXP.js";import{a as u,c as h}from"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";h();import{existsSync as o,mkdirSync as f,readFileSync as d,writeFileSync as a}from"fs";import{join as m,dirname as p}from"path";var c=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("continuedev"),e=m(this.projectRoot,r.path);if(t.configPath=e,!o(e)||this.overwrite){let n=p(e);if(o(n)||f(n,{recursive:!0}),o(e)&&this.overwrite){let v=this.mergeExistingYamlConfig(e,r.content);a(e,v)}else a(e,r.content);t.mcpConfigured=!0}let s=this.generator.generateBehavioralRules("continuedev"),i=m(this.projectRoot,s.path);if(t.rulesPath=i,!o(i)||this.overwrite){let n=p(i);o(n)||f(n,{recursive:!0}),a(i,s.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Continue.dev installation failed: ${u(r)}`)}return t}mergeExistingYamlConfig(t,r){try{let e=d(t,"utf-8");return e.includes("agentic-qe")?e:e.includes("mcpServers:")?e.trimEnd()+`
3
3
  `+` - name: agentic-qe
4
4
  command: npx
5
5
  args:
@@ -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.21");process.exit(0)}
2
- import{b as g}from"./chunk-EVWNZEYV.js";import{a as p,c as v}from"./chunk-SMBQERK7.js";import"./chunk-4ZUXTOUG.js";v();import{existsSync as s,mkdirSync as f,readFileSync as C,writeFileSync as l}from"fs";import{join as u,dirname as h}from"path";var a=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("copilot"),e=u(this.projectRoot,r.path);if(t.configPath=e,!s(e)||this.overwrite){let o=h(e);if(s(o)||f(o,{recursive:!0}),s(e)&&this.overwrite){let m=this.mergeExistingConfig(e,r.content);l(e,m)}else l(e,r.content);t.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("copilot"),n=u(this.projectRoot,i.path);if(t.rulesPath=n,!s(n)||this.overwrite){let o=h(n);s(o)||f(o,{recursive:!0}),l(n,i.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Copilot installation failed: ${p(r)}`)}return t}mergeExistingConfig(t,r){try{let e=JSON.parse(C(t,"utf-8")),i=JSON.parse(r);return e.servers||(e.servers={}),Object.assign(e.servers,i.servers),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.23");process.exit(0)}
2
+ import{b as g}from"./chunk-V5FSNDXP.js";import{a as p,c as v}from"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";v();import{existsSync as s,mkdirSync as f,readFileSync as C,writeFileSync as l}from"fs";import{join as u,dirname as h}from"path";var a=class{projectRoot;overwrite;generator;constructor(t){this.projectRoot=t.projectRoot,this.overwrite=t.overwrite??!1,this.generator=g()}async install(){let t={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let r=this.generator.generateMcpConfig("copilot"),e=u(this.projectRoot,r.path);if(t.configPath=e,!s(e)||this.overwrite){let o=h(e);if(s(o)||f(o,{recursive:!0}),s(e)&&this.overwrite){let m=this.mergeExistingConfig(e,r.content);l(e,m)}else l(e,r.content);t.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("copilot"),n=u(this.projectRoot,i.path);if(t.rulesPath=n,!s(n)||this.overwrite){let o=h(n);s(o)||f(o,{recursive:!0}),l(n,i.content),t.rulesInstalled=!0}}catch(r){t.success=!1,t.errors.push(`Copilot installation failed: ${p(r)}`)}return t}mergeExistingConfig(t,r){try{let e=JSON.parse(C(t,"utf-8")),i=JSON.parse(r);return e.servers||(e.servers={}),Object.assign(e.servers,i.servers),JSON.stringify(e,null,2)+`
3
3
  `}catch{return r}}};function y(c){return new a(c)}export{a as CopilotInstaller,y as createCopilotInstaller};
@@ -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.21");process.exit(0)}
2
- import{a,b,c,d}from"./chunk-TOE6DKE4.js";import"./chunk-4ZUXTOUG.js";export{b as CostTracker,a as MODEL_PRICING,c as getGlobalCostTracker,d as resetGlobalCostTracker};
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.23");process.exit(0)}
2
+ import{a,b,c,d}from"./chunk-FHBOBIXW.js";import"./chunk-I4MDD35Z.js";export{b as CostTracker,a as MODEL_PRICING,c as getGlobalCostTracker,d as resetGlobalCostTracker};
@@ -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.21");process.exit(0)}
2
- import{a as V}from"./chunk-QREO5LNR.js";import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}from"./chunk-CJKR47YY.js";import{b as I}from"./chunk-GLQ6LLKC.js";import{c as P,d as W,g as G}from"./chunk-ETEV7IZI.js";import"./chunk-4ZUXTOUG.js";import{Command as q}from"commander";import e from"chalk";var R={low:{minRisk:.7,maxGaps:10,description:"Only critical gaps with high risk scores"},medium:{minRisk:.5,maxGaps:20,description:"Moderate gaps including medium risk items"},high:{minRisk:.3,maxGaps:50,description:"All gaps including low risk items"}},$=class extends M{constructor(t={}){super(t)}getTitle(){return"Coverage Analysis Wizard"}getSubtitle(){return"Analyze code coverage with O(log n) gap detection"}getConfirmationPrompt(){return"Proceed with coverage analysis?"}isNonInteractive(){return this.options.nonInteractive??!1}getCommands(){return[new D({id:"target",stepNumber:"1/7",title:"Target Directory",description:"Enter the directory or file to analyze for coverage",examples:"src/, ./lib, coverage/lcov.info",defaultValue:this.options.defaultTarget||".",suggestionsProvider:j.getCoverageTargets,validatePath:!0}),new x({id:"sensitivity",stepNumber:"2/7",title:"Gap Detection Sensitivity",description:"Select how sensitive the gap detection should be",options:[{key:"1",value:"low",label:"low",description:R.low.description},{key:"2",value:"medium",label:"medium",description:R.medium.description},{key:"3",value:"high",label:"high",description:R.high.description}],defaultValue:this.options.defaultSensitivity||"medium",validValues:["low","medium","high"]}),new x({id:"format",stepNumber:"3/7",title:"Report Format",description:"Select the output format for the coverage report",options:[{key:"1",value:"json",label:"json",description:"JSON - Machine-readable, good for CI/CD pipelines"},{key:"2",value:"html",label:"html",description:"HTML - Interactive, visual report with charts"},{key:"3",value:"markdown",label:"markdown",description:"Markdown - Documentation-friendly format"},{key:"4",value:"text",label:"text",description:"Text - Simple console output"}],defaultValue:this.options.defaultFormat||"json",validValues:["json","html","markdown","text"]}),new N({id:"priorityFocus",stepNumber:"4/7",title:"Priority Focus Areas",description:"Select coverage metrics to prioritize (comma-separated or numbers)",instructions:"Example: 1,2 or functions,branches",options:[{key:"1",value:"functions",label:"functions",description:"Functions - Focus on function coverage"},{key:"2",value:"branches",label:"branches",description:"Branches - Focus on branch/decision coverage"},{key:"3",value:"lines",label:"lines",description:"Lines - Focus on line coverage"},{key:"4",value:"statements",label:"statements",description:"Statements - Focus on statement coverage"}],defaultValue:this.options.defaultPriorityFocus||["functions","branches"],validValues:["functions","branches","lines","statements"]}),new O({id:"riskScoring",stepNumber:"5/7",title:"Enable risk scoring",description:"Enable risk scoring to prioritize coverage gaps by potential impact",additionalInfo:"Risk scores consider code complexity, change frequency, and criticality",defaultValue:this.options.defaultRiskScoring??!0}),new L({id:"threshold",stepNumber:"6/7",title:"Coverage threshold %",description:"Set the minimum coverage percentage required. Files below this threshold will be flagged.",presets:[{key:"1",value:60,label:"60% - Legacy/maintenance projects"},{key:"2",value:70,label:"70% - Standard projects"},{key:"3",value:80,label:"80% - Quality-focused projects"},{key:"4",value:90,label:"90% - Critical/high-reliability projects"}],defaultValue:this.options.defaultThreshold||80,min:0,max:100}),new B({id:"patterns",stepNumber:"7/7",title:"File Patterns (Optional)",description:"Specify patterns to include or exclude from analysis. Leave blank to analyze all files."})]}buildResult(t){let h=t.patterns;return{target:t.target,sensitivity:t.sensitivity,format:t.format,priorityFocus:t.priorityFocus,riskScoring:t.riskScoring,threshold:t.threshold,includePatterns:h?.include,excludePatterns:h?.exclude,cancelled:!1}}printSummary(t){u.printSummaryHeader();let h=F.relativePath(t.target,this.cwd);u.printSummaryField("Target",h),u.printSummaryField("Sensitivity",t.sensitivity),u.printSummaryField("Report Format",t.format),u.printSummaryField("Priority Focus",t.priorityFocus.join(", ")),u.printSummaryField("Risk Scoring",F.enabledDisabled(t.riskScoring)),u.printSummaryField("Threshold",F.percentage(t.threshold)),t.includePatterns&&t.includePatterns.length>0&&u.printSummaryField("Include",t.includePatterns.join(", ")),t.excludePatterns&&t.excludePatterns.length>0&&u.printSummaryField("Exclude",t.excludePatterns.join(", "));let b=R[t.sensitivity];u.printDerivedSettings({"Min risk score":String(b.minRisk),"Max gaps shown":String(b.maxGaps)})}getDefaults(){return{target:this.options.defaultTarget||this.cwd,sensitivity:this.options.defaultSensitivity||"medium",format:this.options.defaultFormat||"json",priorityFocus:this.options.defaultPriorityFocus||["functions","branches"],riskScoring:this.options.defaultRiskScoring??!0,threshold:this.options.defaultThreshold||80,cancelled:!1}}getCancelled(){return{target:".",sensitivity:"medium",format:"json",priorityFocus:["functions","branches"],riskScoring:!0,threshold:80,cancelled:!0}}};async function E(p={}){return new $(p).run()}function z(p){return p>=80?e.green:p>=50?e.yellow:e.red}function te(p,t,h){let b=new q("coverage").description("Coverage analysis shortcut").argument("[target]","Target file or directory",".").option("--risk","Include risk scoring").option("--gaps","Detect coverage gaps").option("--threshold <percent>","Coverage threshold percentage","80").option("--sensitivity <level>","Gap detection sensitivity (low|medium|high)","medium").option("--wizard","Run interactive coverage analysis wizard").option("--ghost","Include ghost intent coverage analysis (detect untested behavioral intents)").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async(y,i)=>{let g=y,w=i.risk,k=i.gaps,d=parseInt(i.threshold,10);if(i.wizard)try{let s=await E({defaultTarget:y!=="."?y:void 0,defaultThreshold:i.threshold!=="80"?parseInt(i.threshold,10):void 0,defaultRiskScoring:i.risk,defaultSensitivity:i.sensitivity!=="medium"?i.sensitivity:void 0});s.cancelled&&(console.log(e.yellow(`
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.23");process.exit(0)}
2
+ import{a as V}from"./chunk-D4U3UAS3.js";import{a as u,b as j,c as F,d as x,e as N,f as O,g as L,h as D,i as B,j as M}from"./chunk-UDWJPVSR.js";import{b as I}from"./chunk-WKNDFV4J.js";import{c as P,d as W,g as G}from"./chunk-LBY4ISY3.js";import"./chunk-I4MDD35Z.js";import{Command as q}from"commander";import e from"chalk";var R={low:{minRisk:.7,maxGaps:10,description:"Only critical gaps with high risk scores"},medium:{minRisk:.5,maxGaps:20,description:"Moderate gaps including medium risk items"},high:{minRisk:.3,maxGaps:50,description:"All gaps including low risk items"}},$=class extends M{constructor(t={}){super(t)}getTitle(){return"Coverage Analysis Wizard"}getSubtitle(){return"Analyze code coverage with O(log n) gap detection"}getConfirmationPrompt(){return"Proceed with coverage analysis?"}isNonInteractive(){return this.options.nonInteractive??!1}getCommands(){return[new D({id:"target",stepNumber:"1/7",title:"Target Directory",description:"Enter the directory or file to analyze for coverage",examples:"src/, ./lib, coverage/lcov.info",defaultValue:this.options.defaultTarget||".",suggestionsProvider:j.getCoverageTargets,validatePath:!0}),new x({id:"sensitivity",stepNumber:"2/7",title:"Gap Detection Sensitivity",description:"Select how sensitive the gap detection should be",options:[{key:"1",value:"low",label:"low",description:R.low.description},{key:"2",value:"medium",label:"medium",description:R.medium.description},{key:"3",value:"high",label:"high",description:R.high.description}],defaultValue:this.options.defaultSensitivity||"medium",validValues:["low","medium","high"]}),new x({id:"format",stepNumber:"3/7",title:"Report Format",description:"Select the output format for the coverage report",options:[{key:"1",value:"json",label:"json",description:"JSON - Machine-readable, good for CI/CD pipelines"},{key:"2",value:"html",label:"html",description:"HTML - Interactive, visual report with charts"},{key:"3",value:"markdown",label:"markdown",description:"Markdown - Documentation-friendly format"},{key:"4",value:"text",label:"text",description:"Text - Simple console output"}],defaultValue:this.options.defaultFormat||"json",validValues:["json","html","markdown","text"]}),new N({id:"priorityFocus",stepNumber:"4/7",title:"Priority Focus Areas",description:"Select coverage metrics to prioritize (comma-separated or numbers)",instructions:"Example: 1,2 or functions,branches",options:[{key:"1",value:"functions",label:"functions",description:"Functions - Focus on function coverage"},{key:"2",value:"branches",label:"branches",description:"Branches - Focus on branch/decision coverage"},{key:"3",value:"lines",label:"lines",description:"Lines - Focus on line coverage"},{key:"4",value:"statements",label:"statements",description:"Statements - Focus on statement coverage"}],defaultValue:this.options.defaultPriorityFocus||["functions","branches"],validValues:["functions","branches","lines","statements"]}),new O({id:"riskScoring",stepNumber:"5/7",title:"Enable risk scoring",description:"Enable risk scoring to prioritize coverage gaps by potential impact",additionalInfo:"Risk scores consider code complexity, change frequency, and criticality",defaultValue:this.options.defaultRiskScoring??!0}),new L({id:"threshold",stepNumber:"6/7",title:"Coverage threshold %",description:"Set the minimum coverage percentage required. Files below this threshold will be flagged.",presets:[{key:"1",value:60,label:"60% - Legacy/maintenance projects"},{key:"2",value:70,label:"70% - Standard projects"},{key:"3",value:80,label:"80% - Quality-focused projects"},{key:"4",value:90,label:"90% - Critical/high-reliability projects"}],defaultValue:this.options.defaultThreshold||80,min:0,max:100}),new B({id:"patterns",stepNumber:"7/7",title:"File Patterns (Optional)",description:"Specify patterns to include or exclude from analysis. Leave blank to analyze all files."})]}buildResult(t){let h=t.patterns;return{target:t.target,sensitivity:t.sensitivity,format:t.format,priorityFocus:t.priorityFocus,riskScoring:t.riskScoring,threshold:t.threshold,includePatterns:h?.include,excludePatterns:h?.exclude,cancelled:!1}}printSummary(t){u.printSummaryHeader();let h=F.relativePath(t.target,this.cwd);u.printSummaryField("Target",h),u.printSummaryField("Sensitivity",t.sensitivity),u.printSummaryField("Report Format",t.format),u.printSummaryField("Priority Focus",t.priorityFocus.join(", ")),u.printSummaryField("Risk Scoring",F.enabledDisabled(t.riskScoring)),u.printSummaryField("Threshold",F.percentage(t.threshold)),t.includePatterns&&t.includePatterns.length>0&&u.printSummaryField("Include",t.includePatterns.join(", ")),t.excludePatterns&&t.excludePatterns.length>0&&u.printSummaryField("Exclude",t.excludePatterns.join(", "));let b=R[t.sensitivity];u.printDerivedSettings({"Min risk score":String(b.minRisk),"Max gaps shown":String(b.maxGaps)})}getDefaults(){return{target:this.options.defaultTarget||this.cwd,sensitivity:this.options.defaultSensitivity||"medium",format:this.options.defaultFormat||"json",priorityFocus:this.options.defaultPriorityFocus||["functions","branches"],riskScoring:this.options.defaultRiskScoring??!0,threshold:this.options.defaultThreshold||80,cancelled:!1}}getCancelled(){return{target:".",sensitivity:"medium",format:"json",priorityFocus:["functions","branches"],riskScoring:!0,threshold:80,cancelled:!0}}};async function E(p={}){return new $(p).run()}function z(p){return p>=80?e.green:p>=50?e.yellow:e.red}function te(p,t,h){let b=new q("coverage").description("Coverage analysis shortcut").argument("[target]","Target file or directory",".").option("--risk","Include risk scoring").option("--gaps","Detect coverage gaps").option("--threshold <percent>","Coverage threshold percentage","80").option("--sensitivity <level>","Gap detection sensitivity (low|medium|high)","medium").option("--wizard","Run interactive coverage analysis wizard").option("--ghost","Include ghost intent coverage analysis (detect untested behavioral intents)").option("-F, --format <format>","Output format (text|json|markdown)","text").option("-o, --output <path>","Write output to file").action(async(y,i)=>{let g=y,w=i.risk,k=i.gaps,d=parseInt(i.threshold,10);if(i.wizard)try{let s=await E({defaultTarget:y!=="."?y:void 0,defaultThreshold:i.threshold!=="80"?parseInt(i.threshold,10):void 0,defaultRiskScoring:i.risk,defaultSensitivity:i.sensitivity!=="medium"?i.sensitivity:void 0});s.cancelled&&(console.log(e.yellow(`
3
3
  Coverage analysis cancelled.
4
4
  `)),await t(0)),g=s.target,w=s.riskScoring,k=!0,d=s.threshold,console.log(e.green(`
5
5
  Starting coverage analysis...
@@ -19,7 +19,7 @@ import{a as V}from"./chunk-QREO5LNR.js";import{a as u,b as j,c as F,d as x,e as
19
19
  Risk Analysis:`));let o=[...c.files].sort((n,r)=>n.lines.covered/n.lines.total-r.lines.covered/r.lines.total).slice(0,5);for(let n of o){let r=await s.calculateRisk({file:n.path,uncoveredLines:n.uncoveredLines});if(r.success&&r.value){let l=r.value,C=l.riskLevel==="high"?e.red:l.riskLevel==="medium"?e.yellow:e.green,A=n.path.replace(process.cwd()+"/","");console.log(` ${C(`[${l.riskLevel}]`)} ${e.white(A)}`),console.log(e.gray(` Risk: ${(l.overallRisk*100).toFixed(0)}%, Coverage: ${Math.round(n.lines.covered/n.lines.total*100)}%`))}}}if(a&&f==="json"?P(W(a),i.output):a&&f==="markdown"?P(G(a),i.output):f==="text"&&console.log(e.green(`
20
20
  Coverage analysis complete
21
21
  `)),a&&!a.meetsThreshold&&await t(1),a){let o=(a.summary.line+a.summary.branch+a.summary.function+a.summary.statement)/4;o<d+5&&o>=d&&await t(2)}await t(0)}catch(s){console.error(e.red(`
22
- Failed:`),s),await t(1)}});return b.command("gaps").description("Enumerate unhandled branches in source files").argument("<file>","Source file to analyze").option("--mechanical","Exhaustive mode: report all branches without filtering").option("--json","Output as JSON").option("--markdown","Output as markdown report").action(async(y,i)=>{try{let{readFileSync:g,existsSync:w}=await import("fs"),k=await import("path"),{enumerateBranches:d,formatBranchReport:s,formatBranchJSON:T}=await import("./branch-enumerator-2BLPN73D.js"),v=k.resolve(y);w(v)||(console.error(e.red(`
22
+ Failed:`),s),await t(1)}});return b.command("gaps").description("Enumerate unhandled branches in source files").argument("<file>","Source file to analyze").option("--mechanical","Exhaustive mode: report all branches without filtering").option("--json","Output as JSON").option("--markdown","Output as markdown report").action(async(y,i)=>{try{let{readFileSync:g,existsSync:w}=await import("fs"),k=await import("path"),{enumerateBranches:d,formatBranchReport:s,formatBranchJSON:T}=await import("./branch-enumerator-QCWCWYOV.js"),v=k.resolve(y);w(v)||(console.error(e.red(`
23
23
  File not found: ${v}
24
24
  `)),await t(1));let S=g(v,"utf-8"),c=d(S,v);if(i.json)console.log(T(c));else if(i.markdown)console.log(s(c));else{if(console.log(`
25
25
  ${e.cyan("Branch Enumeration:")} ${e.white(y)}`),console.log(e.gray(`Found ${c.unhandledCount} unhandled branches (${c.duration}ms)
@@ -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.23");process.exit(0)}
2
+ import{a,b}from"./chunk-UKTYWW6X.js";import"./chunk-YCM3F3DA.js";import"./chunk-6SQTWXV4.js";import"./chunk-72GIAZOO.js";import"./chunk-I4MDD35Z.js";export{a as CrossDomainEventRouter,b as createCrossDomainRouter};
@@ -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.21");process.exit(0)}
2
- import{b as g}from"./chunk-EVWNZEYV.js";import{a as u,c as m}from"./chunk-SMBQERK7.js";import"./chunk-4ZUXTOUG.js";m();import{existsSync as s,mkdirSync as h,readFileSync as v,writeFileSync as i}from"fs";import{join as f,dirname as C}from"path";var a=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=g()}async install(){let r={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let t=this.generator.generateMcpConfig("cursor"),e=f(this.projectRoot,t.path);if(r.configPath=e,!s(e)||this.overwrite){let l=C(e);if(s(l)||h(l,{recursive:!0}),s(e)&&this.overwrite){let p=this.mergeExistingConfig(e,t.content);i(e,p)}else i(e,t.content);r.mcpConfigured=!0}let o=this.generator.generateBehavioralRules("cursor"),n=f(this.projectRoot,o.path);r.rulesPath=n,(!s(n)||this.overwrite)&&(i(n,o.content),r.rulesInstalled=!0)}catch(t){r.success=!1,r.errors.push(`Cursor installation failed: ${u(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(v(r,"utf-8")),o=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,o.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.23");process.exit(0)}
2
+ import{b as g}from"./chunk-V5FSNDXP.js";import{a as u,c as m}from"./chunk-CLMIRGMC.js";import"./chunk-I4MDD35Z.js";m();import{existsSync as s,mkdirSync as h,readFileSync as v,writeFileSync as i}from"fs";import{join as f,dirname as C}from"path";var a=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=g()}async install(){let r={success:!0,mcpConfigured:!1,rulesInstalled:!1,errors:[],configPath:"",rulesPath:""};try{let t=this.generator.generateMcpConfig("cursor"),e=f(this.projectRoot,t.path);if(r.configPath=e,!s(e)||this.overwrite){let l=C(e);if(s(l)||h(l,{recursive:!0}),s(e)&&this.overwrite){let p=this.mergeExistingConfig(e,t.content);i(e,p)}else i(e,t.content);r.mcpConfigured=!0}let o=this.generator.generateBehavioralRules("cursor"),n=f(this.projectRoot,o.path);r.rulesPath=n,(!s(n)||this.overwrite)&&(i(n,o.content),r.rulesInstalled=!0)}catch(t){r.success=!1,r.errors.push(`Cursor installation failed: ${u(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(v(r,"utf-8")),o=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,o.mcpServers),JSON.stringify(e,null,2)+`
3
3
  `}catch{return t}}};function R(c){return new a(c)}export{a as CursorInstaller,R as createCursorInstaller};