agentic-qe 3.15.12 → 3.15.13

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 (467) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +118 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +6 -6
  5. package/dist/cli/chunks/adapter-KCQDVYY2.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-5VZCKTIJ.js → agent-booster-wasm-6RRQWMNE.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-K3C6CQCD.js → agent-handler-AOH6TV7W.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-NVFQ25WS.js → agent-memory-branch-2P54SF5N.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-SAQOHSGN.js +2 -0
  10. package/dist/cli/chunks/{arena-QGWIJADQ.js → arena-NSVFCAF5.js} +2 -2
  11. package/dist/cli/chunks/{arena-TSZVDSXS.js → arena-X6MOGQHA.js} +4 -4
  12. package/dist/cli/chunks/{audit-KIEE2SHJ.js → audit-27DJLQNM.js} +3 -3
  13. package/dist/cli/chunks/base-WCACU3FN.js +2 -0
  14. package/dist/cli/chunks/{better-sqlite3-BNB32NW3.js → better-sqlite3-BU5GXILS.js} +2 -2
  15. package/dist/cli/chunks/{brain-handler-MPC5SPYI.js → brain-handler-GTQNHHZS.js} +3 -3
  16. package/dist/cli/chunks/{branch-enumerator-LZ7UXKAY.js → branch-enumerator-5CLULOCU.js} +2 -2
  17. package/dist/cli/chunks/{browser-VDHAW4RK.js → browser-R4DMU3LN.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-G6IASEAP.js +2 -0
  19. package/dist/cli/chunks/{chunk-QUJJYTJH.js → chunk-2G7TVT6W.js} +2 -2
  20. package/dist/cli/chunks/{chunk-FAGKBOX2.js → chunk-32ZMWEP3.js} +2 -2
  21. package/dist/cli/chunks/{chunk-FNUFTWEO.js → chunk-3AN5TNGD.js} +3 -3
  22. package/dist/cli/chunks/{chunk-JOWUS2X5.js → chunk-3LJ7LQMV.js} +1 -1
  23. package/dist/cli/chunks/{chunk-O4QJMANM.js → chunk-3QZEGE67.js} +1 -1
  24. package/dist/cli/chunks/{chunk-ICKUINKD.js → chunk-3RZV5DGO.js} +2 -2
  25. package/dist/cli/chunks/{chunk-W4II6SIH.js → chunk-3Y2ROSCL.js} +2 -2
  26. package/dist/cli/chunks/{chunk-L7NGKANW.js → chunk-3Y7TJFHU.js} +2 -2
  27. package/dist/cli/chunks/{chunk-UUZZXHUF.js → chunk-3YNLWPBF.js} +2 -2
  28. package/dist/cli/chunks/{chunk-JR6CUKAI.js → chunk-42J34YG4.js} +2 -2
  29. package/dist/cli/chunks/{chunk-65TH6RPD.js → chunk-4OVC4RIL.js} +1 -1
  30. package/dist/cli/chunks/{chunk-DRCBRUGN.js → chunk-526QYFJU.js} +2 -2
  31. package/dist/cli/chunks/{chunk-MCPXNUDK.js → chunk-5FKWCZNF.js} +2 -2
  32. package/dist/cli/chunks/{chunk-NX4BCSOZ.js → chunk-5K26BEYB.js} +2 -2
  33. package/dist/cli/chunks/{chunk-MCPEC6OO.js → chunk-5MDERQH3.js} +1 -1
  34. package/dist/cli/chunks/{chunk-7JFDLL2F.js → chunk-5VMAV6T6.js} +1 -1
  35. package/dist/cli/chunks/{chunk-5TAEW5OV.js → chunk-5ZGM3RMH.js} +1 -1
  36. package/dist/cli/chunks/{chunk-SG2TX72G.js → chunk-6KATY3KS.js} +2 -2
  37. package/dist/cli/chunks/{chunk-KA5SHLMW.js → chunk-6Z7PRBSG.js} +2 -2
  38. package/dist/cli/chunks/{chunk-LFBA735S.js → chunk-72ASBE35.js} +3 -3
  39. package/dist/cli/chunks/{chunk-TOWOJGEI.js → chunk-756CGMEH.js} +1 -1
  40. package/dist/cli/chunks/{chunk-IVTQF55W.js → chunk-75RDHBAX.js} +3 -3
  41. package/dist/cli/chunks/{chunk-66PXR3NI.js → chunk-7CMTY45A.js} +2 -2
  42. package/dist/cli/chunks/{chunk-WLRU6ESI.js → chunk-7JUC2MVZ.js} +2 -2
  43. package/dist/cli/chunks/{chunk-SBHM5X2S.js → chunk-7NA7JXNB.js} +2 -2
  44. package/dist/cli/chunks/{chunk-HZBXJFGN.js → chunk-7PLIEBY7.js} +2 -2
  45. package/dist/cli/chunks/{chunk-2ASQRBK2.js → chunk-7YTGHGK4.js} +2 -2
  46. package/dist/cli/chunks/{chunk-SQVZ3TRU.js → chunk-A64JFBWI.js} +2 -2
  47. package/dist/cli/chunks/{chunk-2PPSS4JD.js → chunk-AL6FBH3E.js} +2 -2
  48. package/dist/cli/chunks/{chunk-3IU4LDZR.js → chunk-AQSVJNEH.js} +2 -2
  49. package/dist/cli/chunks/{chunk-C74M4WUI.js → chunk-ARJW4I2O.js} +2 -2
  50. package/dist/cli/chunks/{chunk-VF7FTD64.js → chunk-ASQYASNV.js} +1 -1
  51. package/dist/cli/chunks/{chunk-HLGFHHWV.js → chunk-BEGR4D6N.js} +2 -2
  52. package/dist/cli/chunks/{chunk-EN7GRVEQ.js → chunk-BK577VL7.js} +2 -2
  53. package/dist/cli/chunks/{chunk-KGA7VAI4.js → chunk-BLSLEVDI.js} +2 -2
  54. package/dist/cli/chunks/{chunk-HM3LSFTY.js → chunk-BTVEYBW2.js} +2 -2
  55. package/dist/cli/chunks/{chunk-J7Y7ZBIT.js → chunk-C6JTLKG7.js} +5 -5
  56. package/dist/cli/chunks/{chunk-PTBOLBM4.js → chunk-C7JM7CD3.js} +2 -2
  57. package/dist/cli/chunks/{chunk-IL7GQNNE.js → chunk-CCMKSHAT.js} +2 -2
  58. package/dist/cli/chunks/{chunk-23PQF7NN.js → chunk-CE7B5LU7.js} +1 -1
  59. package/dist/cli/chunks/{chunk-BMG2JLSQ.js → chunk-CM4LSLKR.js} +2 -2
  60. package/dist/cli/chunks/chunk-CRWPZT74.js +62 -0
  61. package/dist/cli/chunks/{chunk-4HWUECVD.js → chunk-CT6SAVXQ.js} +2 -2
  62. package/dist/cli/chunks/chunk-CV77DMDQ.js +2 -0
  63. package/dist/cli/chunks/{chunk-CU36D7TN.js → chunk-DFUASIKA.js} +2 -2
  64. package/dist/cli/chunks/{chunk-T4EN5VVK.js → chunk-DLD7RUZ4.js} +2 -2
  65. package/dist/cli/chunks/{chunk-IA55PFLG.js → chunk-DNDL7SOS.js} +2 -2
  66. package/dist/cli/chunks/{chunk-6QRI3JVE.js → chunk-DVGRPK7A.js} +2 -2
  67. package/dist/cli/chunks/{chunk-UREDS662.js → chunk-E56B6IDX.js} +2 -2
  68. package/dist/cli/chunks/{chunk-ZGROHCOW.js → chunk-E7CLYGS7.js} +1 -1
  69. package/dist/cli/chunks/{chunk-YNVEDFPQ.js → chunk-EXGMJFAT.js} +1 -1
  70. package/dist/cli/chunks/{chunk-JRYWLOBD.js → chunk-F3YS57NF.js} +2 -2
  71. package/dist/cli/chunks/{chunk-ZYOYR3UR.js → chunk-FZ76G4QJ.js} +1 -1
  72. package/dist/cli/chunks/{chunk-UIKQPO4Y.js → chunk-G2Q66Z23.js} +2 -2
  73. package/dist/cli/chunks/{chunk-5S4UIDFK.js → chunk-G6WDYBLQ.js} +1 -1
  74. package/dist/cli/chunks/{chunk-4SA7M34P.js → chunk-G77ERMUD.js} +1 -1
  75. package/dist/cli/chunks/{chunk-ADUAJIAU.js → chunk-GB6HBNH2.js} +2 -2
  76. package/dist/cli/chunks/{chunk-IETBWYHW.js → chunk-GHM6MQNK.js} +2 -2
  77. package/dist/cli/chunks/{chunk-QWG3SILX.js → chunk-GHY6Z6KO.js} +5 -5
  78. package/dist/cli/chunks/{chunk-AJEXPFAB.js → chunk-GII6UM3F.js} +1 -1
  79. package/dist/cli/chunks/{chunk-SDRJJUPO.js → chunk-GU5HNCWI.js} +1 -1
  80. package/dist/cli/chunks/{chunk-ULCW6IVQ.js → chunk-H4GG2NLO.js} +2 -2
  81. package/dist/cli/chunks/{chunk-7TA5MUPW.js → chunk-H4H2YSFH.js} +1 -1
  82. package/dist/cli/chunks/{chunk-5A66EGEW.js → chunk-HD7YIFOI.js} +2 -2
  83. package/dist/cli/chunks/{chunk-CDA5Z74H.js → chunk-HOAJUIBQ.js} +2 -2
  84. package/dist/cli/chunks/{chunk-4KUOYDY2.js → chunk-HQZGPJYG.js} +2 -2
  85. package/dist/cli/chunks/{chunk-G3AABG4Q.js → chunk-HZ5NXFXH.js} +2 -2
  86. package/dist/cli/chunks/{chunk-U6IXYQO4.js → chunk-I3C7JOXC.js} +2 -2
  87. package/dist/cli/chunks/{chunk-MAJXZYGK.js → chunk-IC3TQEOA.js} +1 -1
  88. package/dist/cli/chunks/{chunk-RYHG3I7J.js → chunk-IJUHSJ2U.js} +2 -2
  89. package/dist/cli/chunks/{chunk-DZGPUGUG.js → chunk-J2ZIFFM6.js} +2 -2
  90. package/dist/cli/chunks/{chunk-NA3F6FEO.js → chunk-JGZ722G3.js} +2 -2
  91. package/dist/cli/chunks/{chunk-PX5OPXY6.js → chunk-JQGMW45H.js} +1 -1
  92. package/dist/cli/chunks/{chunk-WGTEZT7G.js → chunk-JRRXCODW.js} +2 -2
  93. package/dist/cli/chunks/{chunk-4Y6OEBJZ.js → chunk-K3TLLJMX.js} +1 -1
  94. package/dist/cli/chunks/{chunk-RCOLPF3B.js → chunk-K4CZA77U.js} +2 -2
  95. package/dist/cli/chunks/{chunk-YIDAXOUX.js → chunk-K65CGKLD.js} +2 -2
  96. package/dist/cli/chunks/{chunk-5ADXFUMO.js → chunk-KADFXPPN.js} +2 -2
  97. package/dist/cli/chunks/{chunk-P5E26N2X.js → chunk-KB56CPU4.js} +2 -2
  98. package/dist/cli/chunks/{chunk-YLKIXEPP.js → chunk-KCW47QR5.js} +1 -1
  99. package/dist/cli/chunks/{chunk-SPC4RBLF.js → chunk-KDNJ4F3P.js} +2 -2
  100. package/dist/cli/chunks/{chunk-P7UFJ6DO.js → chunk-KDVZND5Q.js} +1 -1
  101. package/dist/cli/chunks/{chunk-TLRHAMX5.js → chunk-KUAKV3IW.js} +1 -1
  102. package/dist/cli/chunks/{chunk-ZROAMFX2.js → chunk-KV4T4MXK.js} +2 -2
  103. package/dist/cli/chunks/{chunk-UZED4YZ5.js → chunk-KWYH3FI4.js} +1 -1
  104. package/dist/cli/chunks/{chunk-33I2ZP6E.js → chunk-LFJALJOA.js} +2 -2
  105. package/dist/cli/chunks/{chunk-TXEUVUMO.js → chunk-LL7LDPXS.js} +1 -1
  106. package/dist/cli/chunks/{chunk-W5HQIYQU.js → chunk-LUZNKJE6.js} +3 -3
  107. package/dist/cli/chunks/{chunk-GKFV6CUD.js → chunk-LWR3FV3Y.js} +2 -2
  108. package/dist/cli/chunks/{chunk-TVA5GRIU.js → chunk-LZYQHVD4.js} +2 -2
  109. package/dist/cli/chunks/{chunk-2JYUA27M.js → chunk-M6AAGIG7.js} +1 -1
  110. package/dist/cli/chunks/{chunk-PT2NXS43.js → chunk-MAMQA43L.js} +1 -1
  111. package/dist/cli/chunks/chunk-MB46UBGY.js +3 -0
  112. package/dist/cli/chunks/{chunk-ZPVGX4DI.js → chunk-MFW5HSG4.js} +2 -2
  113. package/dist/cli/chunks/{chunk-47RMGDG4.js → chunk-MGZ5FJUW.js} +2 -2
  114. package/dist/cli/chunks/{chunk-G24SWTAX.js → chunk-MVVB7C2E.js} +410 -410
  115. package/dist/cli/chunks/{chunk-XZOYKB22.js → chunk-N4CYAKOX.js} +2 -2
  116. package/dist/cli/chunks/{chunk-QCPVUNN3.js → chunk-NT4DBXSX.js} +2 -2
  117. package/dist/cli/chunks/{chunk-3EWQN37E.js → chunk-NU3W5WFT.js} +2 -2
  118. package/dist/cli/chunks/{chunk-VZBC6DP7.js → chunk-NURIILUB.js} +1 -1
  119. package/dist/cli/chunks/{chunk-6E6HB4N4.js → chunk-NW7IBHJA.js} +4 -4
  120. package/dist/cli/chunks/{chunk-K3A3NWT3.js → chunk-NZ3GUMB2.js} +2 -2
  121. package/dist/cli/chunks/{chunk-GJKZ7UQO.js → chunk-NZD4DPSU.js} +2 -2
  122. package/dist/cli/chunks/{chunk-7QEUHNKO.js → chunk-O6FGXMHD.js} +1 -1
  123. package/dist/cli/chunks/{chunk-YVJEUX3I.js → chunk-OCAEXYFA.js} +2 -2
  124. package/dist/cli/chunks/{chunk-BOSMELJX.js → chunk-OFACHK5O.js} +2 -2
  125. package/dist/cli/chunks/{chunk-PGSJBXTD.js → chunk-P7A4NKTZ.js} +2 -2
  126. package/dist/cli/chunks/{chunk-HSA5IGGW.js → chunk-PB6J6HAA.js} +2 -2
  127. package/dist/cli/chunks/{chunk-TGMXUZZC.js → chunk-PHP5UBT4.js} +2 -2
  128. package/dist/cli/chunks/{chunk-NV74SICL.js → chunk-PIDQVU3L.js} +2 -2
  129. package/dist/cli/chunks/{chunk-TSOQ2QLT.js → chunk-PSFSPGUD.js} +2 -2
  130. package/dist/cli/chunks/{chunk-4A76VPU4.js → chunk-PT4FMJPQ.js} +2 -2
  131. package/dist/cli/chunks/{chunk-U7ZHDGXG.js → chunk-Q3UDLV5Z.js} +1 -1
  132. package/dist/cli/chunks/{chunk-BYRCB5JT.js → chunk-QDEJ4CI2.js} +2 -2
  133. package/dist/cli/chunks/{chunk-CA5UNWQF.js → chunk-QPNG5ZN2.js} +2 -2
  134. package/dist/cli/chunks/{chunk-W7H55PY4.js → chunk-R7SYRCRP.js} +1 -1
  135. package/dist/cli/chunks/{chunk-4LWMAAWK.js → chunk-RF7HWBHN.js} +2 -2
  136. package/dist/cli/chunks/{chunk-MMEALJ4D.js → chunk-RFNW2LGD.js} +2 -2
  137. package/dist/cli/chunks/{chunk-UCSK2RMI.js → chunk-S5AZCIZS.js} +2 -2
  138. package/dist/cli/chunks/{chunk-JW5PDJ5O.js → chunk-SE4VNN4I.js} +3 -3
  139. package/dist/cli/chunks/{chunk-URSTP3WI.js → chunk-SG3NX7QE.js} +2 -2
  140. package/dist/cli/chunks/{chunk-N7O3PF6Y.js → chunk-SSU73QAX.js} +2 -2
  141. package/dist/cli/chunks/{chunk-7DNR4KKR.js → chunk-SVLQRAMF.js} +1 -1
  142. package/dist/cli/chunks/{chunk-BC4T6SCV.js → chunk-SYV2V3PL.js} +4 -4
  143. package/dist/cli/chunks/{chunk-4CB3QPZM.js → chunk-T3PGQFDI.js} +2 -2
  144. package/dist/cli/chunks/{chunk-OHVYINGM.js → chunk-TCBBNUBP.js} +3 -3
  145. package/dist/cli/chunks/{chunk-YWWMNTBF.js → chunk-TOQWL2ZF.js} +2 -2
  146. package/dist/cli/chunks/{chunk-SITL5YZV.js → chunk-TSQC2KKZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-YUA6ZKKY.js → chunk-TWDW32W2.js} +2 -2
  148. package/dist/cli/chunks/{chunk-SUX5XB2Z.js → chunk-TWJTK4CC.js} +2 -2
  149. package/dist/cli/chunks/{chunk-32UTHIY5.js → chunk-U2FUXDDJ.js} +3 -3
  150. package/dist/cli/chunks/{chunk-ENGL7FIJ.js → chunk-UDQSYWVF.js} +1 -1
  151. package/dist/cli/chunks/{chunk-7OEFBWAG.js → chunk-UOC3O6RP.js} +2 -2
  152. package/dist/cli/chunks/chunk-UT2VZ33P.js +2 -0
  153. package/dist/cli/chunks/{chunk-MYF5CNGV.js → chunk-UTRV7T2N.js} +2 -2
  154. package/dist/cli/chunks/{chunk-KJDI5CHX.js → chunk-UXZSUMEA.js} +2 -2
  155. package/dist/cli/chunks/{chunk-DAUEK66C.js → chunk-VRHRBAEM.js} +1 -1
  156. package/dist/cli/chunks/{chunk-FZJCBSN4.js → chunk-VRVMIPTM.js} +2 -2
  157. package/dist/cli/chunks/{chunk-26672ISV.js → chunk-VTDFVFST.js} +2 -2
  158. package/dist/cli/chunks/{chunk-WTAUF6O4.js → chunk-VTOBUZL6.js} +2 -2
  159. package/dist/cli/chunks/{chunk-4PU5GTZW.js → chunk-VU5TBX2V.js} +2 -2
  160. package/dist/cli/chunks/{chunk-C3YOVASQ.js → chunk-W26B7ERY.js} +1 -1
  161. package/dist/cli/chunks/{chunk-CPIBIR3X.js → chunk-W2QWSQVE.js} +2 -2
  162. package/dist/cli/chunks/{chunk-L3PV7VXK.js → chunk-W3INMZZ6.js} +1 -1
  163. package/dist/cli/chunks/{chunk-5Z23ZMXZ.js → chunk-W3PPFHI5.js} +54 -54
  164. package/dist/cli/chunks/{chunk-NVRYELCY.js → chunk-WKGTGOYS.js} +3 -3
  165. package/dist/cli/chunks/{chunk-35NW676P.js → chunk-WNQS4WTS.js} +2 -2
  166. package/dist/cli/chunks/{chunk-O3IM4WRZ.js → chunk-WO274FRI.js} +2 -2
  167. package/dist/cli/chunks/{chunk-35MIUSXQ.js → chunk-WOCGL4QP.js} +2 -2
  168. package/dist/cli/chunks/{chunk-EF6OERRR.js → chunk-WQL7WCIZ.js} +1 -1
  169. package/dist/cli/chunks/{chunk-INZARYUD.js → chunk-X2Z7F4EU.js} +2 -2
  170. package/dist/cli/chunks/{chunk-2E2QO44T.js → chunk-X7N2JF2X.js} +2 -2
  171. package/dist/cli/chunks/{chunk-2IVE5AR3.js → chunk-XEAEYC6Y.js} +1 -1
  172. package/dist/cli/chunks/{chunk-IPA7K556.js → chunk-XNBOGCF3.js} +2 -2
  173. package/dist/cli/chunks/{chunk-A2JCRXTK.js → chunk-XPRVF4YE.js} +2 -2
  174. package/dist/cli/chunks/{chunk-VUR5THML.js → chunk-YBQH2VOP.js} +2 -2
  175. package/dist/cli/chunks/{chunk-A5Y7DAVQ.js → chunk-YQFLQE53.js} +2 -2
  176. package/dist/cli/chunks/{chunk-JGIJPDGD.js → chunk-YSZ5OE3Z.js} +2 -2
  177. package/dist/cli/chunks/{chunk-JNXK47OL.js → chunk-YXRASAPI.js} +2 -2
  178. package/dist/cli/chunks/{chunk-MYUMJ2ZI.js → chunk-YZEXYO4W.js} +1 -1
  179. package/dist/cli/chunks/{chunk-NNBQZR73.js → chunk-YZWBNBTW.js} +2 -2
  180. package/dist/cli/chunks/{chunk-WDEXOLK2.js → chunk-ZAKQLAHT.js} +1 -1
  181. package/dist/cli/chunks/{ci-BZNWW3I3.js → ci-ENOASTYB.js} +2 -2
  182. package/dist/cli/chunks/{ci-config-LOHNXOKV.js → ci-config-B26OXHQM.js} +2 -2
  183. package/dist/cli/chunks/{ci-output-LCOQBSJL.js → ci-output-JTCLLNOQ.js} +2 -2
  184. package/dist/cli/chunks/{circuit-breaker-7LRXTLFE.js → circuit-breaker-23JMFNM5.js} +2 -2
  185. package/dist/cli/chunks/{claude-flow-setup-HBU4VWC3.js → claude-flow-setup-ON6L462G.js} +2 -2
  186. package/dist/cli/chunks/client-TV3V2YZ5.js +2 -0
  187. package/dist/cli/chunks/{cline-installer-CO6MLH6X.js → cline-installer-OWQ4D2FQ.js} +2 -2
  188. package/dist/cli/chunks/{code-SIXBS6JM.js → code-2ZRL7SEU.js} +19 -18
  189. package/dist/cli/chunks/{code-index-extractor-GWJKZ2IQ.js → code-index-extractor-JXSQVM67.js} +2 -2
  190. package/dist/cli/chunks/{codex-installer-6NINVWXJ.js → codex-installer-7LXZYBSQ.js} +2 -2
  191. package/dist/cli/chunks/{completions-7VIX3GML.js → completions-C2LR623C.js} +2 -2
  192. package/dist/cli/chunks/{complexity-analyzer-FBQR6ZP2.js → complexity-analyzer-TGQLHCYJ.js} +2 -2
  193. package/dist/cli/chunks/{continuedev-installer-VA7RIXW5.js → continuedev-installer-RUGD24D2.js} +2 -2
  194. package/dist/cli/chunks/{copilot-installer-4QEBC4MU.js → copilot-installer-ZLFVLEJP.js} +2 -2
  195. package/dist/cli/chunks/core-handlers-PZT4OLWR.js +2 -0
  196. package/dist/cli/chunks/{cost-tracker-GRYKHPWL.js → cost-tracker-RT4QL745.js} +2 -2
  197. package/dist/cli/chunks/{coverage-USPMNKOU.js → coverage-NV3C4IMM.js} +3 -3
  198. package/dist/cli/chunks/cross-domain-router-QOFCZ7G4.js +2 -0
  199. package/dist/cli/chunks/{cursor-installer-ZXIPSZVH.js → cursor-installer-LJKLNFF6.js} +2 -2
  200. package/dist/cli/chunks/{daemon-D7F3RGI5.js → daemon-BMDXCQT5.js} +3 -3
  201. package/dist/cli/chunks/{daemon-N2VRHPSJ.js → daemon-FBH3IRYN.js} +4 -4
  202. package/dist/cli/chunks/{dag-attention-scheduler-NL6BA7BY.js → dag-attention-scheduler-JGDED55I.js} +2 -2
  203. package/dist/cli/chunks/{detect-XC2HCIIT.js → detect-SZIHIVCJ.js} +2 -2
  204. package/dist/cli/chunks/{dist-node-A3Y26MEI.js → dist-node-FV3KWXQ6.js} +2 -2
  205. package/dist/cli/chunks/{domain-handler-WV6SFXRB.js → domain-handler-GI5JWQOV.js} +2 -2
  206. package/dist/cli/chunks/{domain-plugins-KJIF6Z2B.js → domain-plugins-BUWY36TL.js} +2 -2
  207. package/dist/cli/chunks/domain-transfer-GCY7W5DA.js +2 -0
  208. package/dist/cli/chunks/dream-TRFBGDSQ.js +2 -0
  209. package/dist/cli/chunks/{embed-and-insert-pattern-PA3Y4KGO.js → embed-and-insert-pattern-GPRR3ZGD.js} +2 -2
  210. package/dist/cli/chunks/{eval-YGEZNUVE.js → eval-XPB3IGAP.js} +2 -2
  211. package/dist/cli/chunks/{experience-capture-middleware-D4T7NW6B.js → experience-capture-middleware-2E554UB3.js} +3 -3
  212. package/dist/cli/chunks/{fast-paths-6JYK7RYQ.js → fast-paths-ZSMWZPUC.js} +2 -2
  213. package/dist/cli/chunks/{feature-flags-RBH2GDSR.js → feature-flags-GIWVDVVC.js} +2 -2
  214. package/dist/cli/chunks/{feature-flags-DKXMDVPE.js → feature-flags-N7EOGE5P.js} +2 -2
  215. package/dist/cli/chunks/file-discovery-WCKGMSPZ.js +2 -0
  216. package/dist/cli/chunks/fleet-HCHDOUCX.js +44 -0
  217. package/dist/cli/chunks/{gnn-wrapper-MV54UC4C.js → gnn-wrapper-CZNCNXXZ.js} +2 -2
  218. package/dist/cli/chunks/{heartbeat-handler-7DKMVQQH.js → heartbeat-handler-6YUIF2YQ.js} +4 -4
  219. package/dist/cli/chunks/heartbeat-scheduler-P44A2OX3.js +2 -0
  220. package/dist/cli/chunks/hnsw-adapter-ZJQIQJKC.js +2 -0
  221. package/dist/cli/chunks/hnsw-index-HMG2GH3Z.js +2 -0
  222. package/dist/cli/chunks/{hnsw-legacy-bridge-6IWREDQC.js → hnsw-legacy-bridge-J3M3IK24.js} +2 -2
  223. package/dist/cli/chunks/{hnswlib-node-5BIESSCK.js → hnswlib-node-ULGTGDZW.js} +2 -2
  224. package/dist/cli/chunks/{hooks-3EETRM62.js → hooks-C4BUGYUQ.js} +10 -10
  225. package/dist/cli/chunks/hybrid-backend-B7M74PZG.js +2 -0
  226. package/dist/cli/chunks/{hypergraph-engine-RSWCB2D3.js → hypergraph-engine-WINGVMPG.js} +2 -2
  227. package/dist/cli/chunks/{hypergraph-handler-552LXKL3.js → hypergraph-handler-GADMWKAU.js} +3 -3
  228. package/dist/cli/chunks/impact-analyzer-PZYOVKQO.js +2 -0
  229. package/dist/cli/chunks/{init-guard-OTDBJ5HD.js → init-guard-K2T4QWAO.js} +2 -2
  230. package/dist/cli/chunks/{init-handler-3FK3TKEA.js → init-handler-PCZTDZYI.js} +6 -6
  231. package/dist/cli/chunks/init-wizard-TZDJQK3U.js +2 -0
  232. package/dist/cli/chunks/kernel-Y6RRIOKW.js +2 -0
  233. package/dist/cli/chunks/{kilocode-installer-KZ2O4LF3.js → kilocode-installer-XENXNEIU.js} +2 -2
  234. package/dist/cli/chunks/{kiro-installer-MLCCXRF7.js → kiro-installer-3PG2TJ67.js} +2 -2
  235. package/dist/cli/chunks/knowledge-graph-BVD5Z66M.js +2 -0
  236. package/dist/cli/chunks/{learning-QUCMBD77.js → learning-6KDH7FK4.js} +3 -3
  237. package/dist/cli/chunks/{llm-router-PDEV3UP2.js → llm-router-RKVDEWU2.js} +4 -4
  238. package/dist/cli/chunks/llm-router-service-KHCAMSUU.js +2 -0
  239. package/dist/cli/chunks/{load-XFVVLO7E.js → load-ITHC564X.js} +2 -2
  240. package/dist/cli/chunks/load-test-RUF7DZA5.js +2 -0
  241. package/dist/cli/chunks/{mcp-74G3CL2S.js → mcp-TCL5UW3N.js} +2 -2
  242. package/dist/cli/chunks/{memory-XIFM6JNX.js → memory-BKDAY2N2.js} +5 -5
  243. package/dist/cli/chunks/memory-backend-7ZLFOVGG.js +2 -0
  244. package/dist/cli/chunks/{memory-handlers-ZCKURV6S.js → memory-handlers-WN4FXFOA.js} +2 -2
  245. package/dist/cli/chunks/{multi-model-executor-7L4W3O2Q.js → multi-model-executor-VHAT7ZPF.js} +2 -2
  246. package/dist/cli/chunks/{opencode-installer-BPG422LF.js → opencode-installer-E3VM3EEY.js} +2 -2
  247. package/dist/cli/chunks/{orchestrator-OEAFLAEV.js → orchestrator-BMQ6X762.js} +5 -5
  248. package/dist/cli/chunks/pattern-null-store-RY6CVYHP.js +2 -0
  249. package/dist/cli/chunks/{pattern-usage-recorder-LOPNCULT.js → pattern-usage-recorder-GOOR2BV5.js} +2 -2
  250. package/dist/cli/chunks/{pipeline-VWTYUZB7.js → pipeline-5NSFQQIX.js} +2 -2
  251. package/dist/cli/chunks/{platform-WFJJ3X2E.js → platform-SQM34J5G.js} +2 -2
  252. package/dist/cli/chunks/{plugin-744TPUSG.js → plugin-UQJZRMZG.js} +2 -2
  253. package/dist/cli/chunks/{prime-radiant-advanced-wasm-BD5BLNDR.js → prime-radiant-advanced-wasm-WMDJOL4S.js} +2 -2
  254. package/dist/cli/chunks/project-root-IO5KRNGL.js +2 -0
  255. package/dist/cli/chunks/protocol-executor-U2CUDWDE.js +2 -0
  256. package/dist/cli/chunks/{protocol-handler-JIBILI74.js → protocol-handler-OBDCVY6X.js} +2 -2
  257. package/dist/cli/chunks/{prove-MNOL5FYW.js → prove-XDC7I4XT.js} +2 -2
  258. package/dist/cli/chunks/qe-reasoning-bank-DQSSX2IP.js +2 -0
  259. package/dist/cli/chunks/{quality-JEGBDGGX.js → quality-L4GQ6WX4.js} +2 -2
  260. package/dist/cli/chunks/{quality-gate-SYJ6ROMI.js → quality-gate-MJG66LKN.js} +3 -3
  261. package/dist/cli/chunks/queen-coordinator-6FN4BZIX.js +2 -0
  262. package/dist/cli/chunks/{real-embeddings-ZWXS5ZFV.js → real-embeddings-HW4G2LWL.js} +2 -2
  263. package/dist/cli/chunks/{ref-validation-RRHUFW2N.js → ref-validation-FC7JOJ2C.js} +2 -2
  264. package/dist/cli/chunks/{roocode-installer-XFO6JSVN.js → roocode-installer-KWS4CEIC.js} +2 -2
  265. package/dist/cli/chunks/router-YUO3I7RU.js +2 -0
  266. package/dist/cli/chunks/routing-feedback-36SLQGJE.js +2 -0
  267. package/dist/cli/chunks/{routing-handler-L2K3JASE.js → routing-handler-QF4WVB2S.js} +2 -2
  268. package/dist/cli/chunks/{ruvector-commands-A6CINHGM.js → ruvector-commands-2MTCOUK6.js} +2 -2
  269. package/dist/cli/chunks/rvf-dual-writer-FRYZH3WZ.js +2 -0
  270. package/dist/cli/chunks/rvf-migration-adapter-XXNITL5I.js +2 -0
  271. package/dist/cli/chunks/{rvf-migration-coordinator-T4RY7L53.js → rvf-migration-coordinator-BREJCXWN.js} +2 -2
  272. package/dist/cli/chunks/rvf-native-adapter-D2WWKJIV.js +2 -0
  273. package/dist/cli/chunks/{rvf-store-integrity-IR33TGQS.js → rvf-store-integrity-KKC6HOJD.js} +2 -2
  274. package/dist/cli/chunks/safe-db-4RRIGRXD.js +2 -0
  275. package/dist/cli/chunks/schedule-25RTO4DQ.js +2 -0
  276. package/dist/cli/chunks/scheduler-BPIOJZ5P.js +2 -0
  277. package/dist/cli/chunks/{security-Z5GDE2IH.js → security-OSAE7VAP.js} +3 -3
  278. package/dist/cli/chunks/{shared-rvf-adapter-SIZMEHPM.js → shared-rvf-adapter-COUOS665.js} +2 -2
  279. package/dist/cli/chunks/{shared-rvf-dual-writer-HLM65RDS.js → shared-rvf-dual-writer-YXMPZKQE.js} +2 -2
  280. package/dist/cli/chunks/sqlite-persistence-EDF47DDX.js +2 -0
  281. package/dist/cli/chunks/{standalone-memory-SKSZG7P5.js → standalone-memory-E6JBMOIL.js} +2 -2
  282. package/dist/cli/chunks/{status-handler-766YOOMJ.js → status-handler-AFTCIYIX.js} +2 -2
  283. package/dist/cli/chunks/{structural-health-M45FNOLT.js → structural-health-2FROCEI4.js} +2 -2
  284. package/dist/cli/chunks/{sync-B2U366I3.js → sync-VAYTOWDC.js} +2 -2
  285. package/dist/cli/chunks/{sync-6CJ24B5T.js → sync-YIQYOFGW.js} +2 -2
  286. package/dist/cli/chunks/task-handler-KVQHDEX3.js +62 -0
  287. package/dist/cli/chunks/task-handlers-MVVECQA6.js +9 -0
  288. package/dist/cli/chunks/{test-TODH7KRF.js → test-5JSVTOMY.js} +4 -4
  289. package/dist/cli/chunks/test-runner-process-LEPF2OSS.js +2 -0
  290. package/dist/cli/chunks/{test-scheduling-VMVMVRHT.js → test-scheduling-HBOHVLI3.js} +3 -3
  291. package/dist/cli/chunks/{token-bootstrap-XQW7BMCK.js → token-bootstrap-5VEPTPFA.js} +2 -2
  292. package/dist/cli/chunks/{token-usage-JCZEIRKO.js → token-usage-TBJHDLY6.js} +2 -2
  293. package/dist/cli/chunks/{transformers-U2ML3OHE.js → transformers-VAWYMHMZ.js} +2 -2
  294. package/dist/cli/chunks/tree-sitter-wasm-parser-TSZTCMFV.js +2 -0
  295. package/dist/cli/chunks/{types-GGEPCHP6.js → types-R5SDZU2E.js} +2 -2
  296. package/dist/cli/chunks/unified-memory-TLGSSLMI.js +2 -0
  297. package/dist/cli/chunks/unified-memory-hnsw-MSUR7ZOO.js +2 -0
  298. package/dist/cli/chunks/unified-persistence-VFFOTWK7.js +2 -0
  299. package/dist/cli/chunks/{upgrade-T5GRM7HS.js → upgrade-K5PIHXRB.js} +2 -2
  300. package/dist/cli/chunks/{validate-XMUJPLP3.js → validate-RPTS7RYJ.js} +2 -2
  301. package/dist/cli/chunks/{validate-swarm-KJLF7JEH.js → validate-swarm-B2ZL556X.js} +2 -2
  302. package/dist/cli/chunks/visual-security-6Q44XNLB.js +2 -0
  303. package/dist/cli/chunks/{web-tree-sitter-LOHVZ7G5.js → web-tree-sitter-K4DUJC32.js} +2 -2
  304. package/dist/cli/chunks/{windsurf-installer-33FBTXJU.js → windsurf-installer-OK2AJN35.js} +2 -2
  305. package/dist/cli/chunks/witness-chain-KDOMXDQX.js +2 -0
  306. package/dist/cli/chunks/witness-chain-N3OY2RMH.js +2 -0
  307. package/dist/cli/chunks/{witness-chain-repair-VWBO4NXE.js → witness-chain-repair-L6Y5RFXR.js} +2 -2
  308. package/dist/cli/chunks/{witness-chain-verifier-BHJ3ZAEK.js → witness-chain-verifier-N4CW7FZX.js} +2 -2
  309. package/dist/cli/chunks/{witness-key-manager-WNVPH2Z3.js → witness-key-manager-TDNPS3WD.js} +2 -2
  310. package/dist/cli/chunks/{workflow-6QR5MQTO.js → workflow-XRZA3YCY.js} +4 -4
  311. package/dist/cli/chunks/workflow-orchestrator-CVNNT2RJ.js +2 -0
  312. package/dist/cli/chunks/{wrappers-EHOL62TS.js → wrappers-5JIFWKN6.js} +2 -2
  313. package/dist/cli/commands/code.js +6 -0
  314. package/dist/cli/commands/fleet-run.d.ts +12 -0
  315. package/dist/cli/commands/fleet-run.js +175 -0
  316. package/dist/cli/commands/fleet.js +2 -117
  317. package/dist/cli/handlers/task-handler.d.ts +5 -0
  318. package/dist/cli/handlers/task-handler.js +20 -0
  319. package/dist/cli/utils/fleet-operation.d.ts +5 -2
  320. package/dist/cli/utils/fleet-operation.js +13 -2
  321. package/dist/cli/utils/fleet-result.d.ts +16 -2
  322. package/dist/cli/utils/fleet-result.js +26 -21
  323. package/dist/cli/utils/fleet-shard.d.ts +36 -0
  324. package/dist/cli/utils/fleet-shard.js +110 -0
  325. package/dist/coordination/handlers/code-intelligence-handlers.js +21 -1
  326. package/dist/coordination/handlers/handler-types.d.ts +2 -2
  327. package/dist/coordination/handlers/handler-utils.d.ts +6 -0
  328. package/dist/coordination/handlers/handler-utils.js +14 -4
  329. package/dist/coordination/handlers/misc-handlers.js +5 -2
  330. package/dist/coordination/handlers/quality-handlers.js +2 -2
  331. package/dist/coordination/handlers/security-handlers.js +12 -2
  332. package/dist/coordination/protocols/security-audit.js +11 -1
  333. package/dist/coordination/task-executor.js +7 -2
  334. package/dist/domains/code-intelligence/coordinator-gnn.d.ts +2 -16
  335. package/dist/domains/code-intelligence/coordinator-gnn.js +1 -62
  336. package/dist/domains/code-intelligence/coordinator.d.ts +12 -6
  337. package/dist/domains/code-intelligence/coordinator.js +24 -27
  338. package/dist/domains/code-intelligence/interfaces.d.ts +9 -0
  339. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +43 -5
  340. package/dist/domains/code-intelligence/services/semantic-analyzer.js +134 -71
  341. package/dist/domains/coverage-analysis/collected-metrics.d.ts +10 -0
  342. package/dist/domains/coverage-analysis/collected-metrics.js +29 -0
  343. package/dist/domains/coverage-analysis/services/coverage-analyzer.js +11 -3
  344. package/dist/domains/coverage-analysis/services/coverage-parser.d.ts +2 -0
  345. package/dist/domains/coverage-analysis/services/coverage-parser.js +18 -2
  346. package/dist/domains/quality-assessment/coherence/gate-controller.js +16 -4
  347. package/dist/domains/quality-assessment/coherence/lambda-calculator.d.ts +8 -0
  348. package/dist/domains/quality-assessment/coherence/lambda-calculator.js +57 -14
  349. package/dist/domains/quality-assessment/coherence/types.d.ts +12 -7
  350. package/dist/domains/quality-assessment/coordinator-gate-evaluation.js +3 -1
  351. package/dist/domains/quality-assessment/coordinator-reports.d.ts +30 -10
  352. package/dist/domains/quality-assessment/coordinator-reports.js +93 -57
  353. package/dist/domains/quality-assessment/coordinator.d.ts +14 -40
  354. package/dist/domains/quality-assessment/coordinator.js +10 -4
  355. package/dist/domains/quality-assessment/interfaces.d.ts +2 -0
  356. package/dist/domains/quality-assessment/services/coherence-gate.js +15 -2
  357. package/dist/domains/quality-assessment/services/quality-gate.js +6 -4
  358. package/dist/domains/security-compliance/index.d.ts +1 -1
  359. package/dist/domains/security-compliance/interfaces.d.ts +46 -5
  360. package/dist/domains/security-compliance/services/scanners/dast-auth-testing.d.ts +3 -3
  361. package/dist/domains/security-compliance/services/scanners/dast-auth-testing.js +15 -14
  362. package/dist/domains/security-compliance/services/scanners/dast-helpers.d.ts +8 -9
  363. package/dist/domains/security-compliance/services/scanners/dast-helpers.js +19 -44
  364. package/dist/domains/security-compliance/services/scanners/dast-injection-testing.d.ts +3 -3
  365. package/dist/domains/security-compliance/services/scanners/dast-injection-testing.js +13 -9
  366. package/dist/domains/security-compliance/services/scanners/dast-requests.d.ts +54 -0
  367. package/dist/domains/security-compliance/services/scanners/dast-requests.js +125 -0
  368. package/dist/domains/security-compliance/services/scanners/dast-scanner.d.ts +5 -1
  369. package/dist/domains/security-compliance/services/scanners/dast-scanner.js +125 -155
  370. package/dist/domains/security-compliance/services/scanners/index.d.ts +1 -1
  371. package/dist/domains/security-compliance/services/scanners/index.js +1 -1
  372. package/dist/domains/security-compliance/services/scanners/scanner-types.d.ts +2 -2
  373. package/dist/domains/security-compliance/services/security-auditor-dast.js +183 -212
  374. package/dist/domains/security-compliance/services/security-auditor-reports.js +5 -1
  375. package/dist/domains/security-compliance/services/security-auditor.d.ts +11 -3
  376. package/dist/domains/security-compliance/services/security-auditor.js +106 -65
  377. package/dist/domains/test-execution/coordinator.d.ts +2 -1
  378. package/dist/domains/test-execution/coordinator.js +33 -27
  379. package/dist/domains/test-execution/interfaces.d.ts +5 -0
  380. package/dist/domains/test-execution/services/test-executor.d.ts +6 -0
  381. package/dist/domains/test-execution/services/test-executor.js +16 -4
  382. package/dist/domains/visual-accessibility/coordinator.js +34 -9
  383. package/dist/domains/visual-accessibility/interfaces.d.ts +27 -0
  384. package/dist/domains/visual-accessibility/plugin.js +5 -0
  385. package/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.d.ts +13 -21
  386. package/dist/domains/visual-accessibility/services/accessibility-tester-heuristics.js +13 -297
  387. package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +13 -5
  388. package/dist/domains/visual-accessibility/services/accessibility-tester.js +96 -73
  389. package/dist/integrations/embeddings/index/HNSWIndex.js +8 -4
  390. package/dist/integrations/ruvector/transfer-coherence-stub.js +5 -10
  391. package/dist/mcp/bundle.js +480 -480
  392. package/dist/mcp/handlers/domain-handler-configs.d.ts +8 -0
  393. package/dist/mcp/handlers/domain-handler-configs.js +9 -2
  394. package/dist/mcp/handlers/handler-factory.js +3 -0
  395. package/dist/mcp/handlers/model-route-handlers.d.ts +107 -0
  396. package/dist/mcp/handlers/model-route-handlers.js +139 -0
  397. package/dist/mcp/handlers/orchestrate-routes.js +41 -3
  398. package/dist/mcp/handlers/task-handlers.d.ts +3 -251
  399. package/dist/mcp/handlers/task-handlers.js +6 -828
  400. package/dist/mcp/handlers/task-inference.d.ts +26 -0
  401. package/dist/mcp/handlers/task-inference.js +156 -0
  402. package/dist/mcp/handlers/task-learning-handlers.d.ts +92 -0
  403. package/dist/mcp/handlers/task-learning-handlers.js +230 -0
  404. package/dist/mcp/handlers/task-orchestrate-handler.d.ts +73 -0
  405. package/dist/mcp/handlers/task-orchestrate-handler.js +361 -0
  406. package/dist/mcp/protocol-server.js +12 -2
  407. package/dist/mcp/tools/code-intelligence/analyze.js +3 -6
  408. package/dist/mcp/tools/coverage-analysis/index.d.ts +4 -0
  409. package/dist/mcp/tools/coverage-analysis/index.js +8 -2
  410. package/dist/mcp/tools/visual-accessibility/index.d.ts +7 -0
  411. package/dist/mcp/tools/visual-accessibility/index.js +29 -13
  412. package/dist/shared/events/domain-events.d.ts +2 -0
  413. package/dist/shared/metrics/code-metrics.js +21 -3
  414. package/dist/shared/parsers/typescript-parser.d.ts +6 -0
  415. package/dist/shared/parsers/typescript-parser.js +13 -1
  416. package/package.json +1 -1
  417. package/dist/cli/chunks/adapter-HL7MOCQN.js +0 -2
  418. package/dist/cli/chunks/aqe-learning-engine-OZ2DXB4G.js +0 -2
  419. package/dist/cli/chunks/base-WIM7G3HC.js +0 -2
  420. package/dist/cli/chunks/browser-workflow-QRKCFVR3.js +0 -2
  421. package/dist/cli/chunks/chunk-QSGEBCDB.js +0 -62
  422. package/dist/cli/chunks/chunk-UJNGGFGX.js +0 -2
  423. package/dist/cli/chunks/chunk-VXVTFKRA.js +0 -2
  424. package/dist/cli/chunks/chunk-XCNSGSKV.js +0 -3
  425. package/dist/cli/chunks/client-4PNYDFYS.js +0 -2
  426. package/dist/cli/chunks/core-handlers-ODO6LUWQ.js +0 -2
  427. package/dist/cli/chunks/cross-domain-router-DT4MHJKK.js +0 -2
  428. package/dist/cli/chunks/domain-transfer-L3F6AES2.js +0 -2
  429. package/dist/cli/chunks/dream-QOB3JCOM.js +0 -2
  430. package/dist/cli/chunks/file-discovery-BN76S2PR.js +0 -2
  431. package/dist/cli/chunks/fleet-43YMXACN.js +0 -46
  432. package/dist/cli/chunks/heartbeat-scheduler-3NNP4WCP.js +0 -2
  433. package/dist/cli/chunks/hnsw-adapter-MZR7Y4WF.js +0 -2
  434. package/dist/cli/chunks/hnsw-index-HE4AX22U.js +0 -2
  435. package/dist/cli/chunks/hybrid-backend-IHUHB3Y2.js +0 -2
  436. package/dist/cli/chunks/impact-analyzer-FI6GI6PD.js +0 -2
  437. package/dist/cli/chunks/init-wizard-WLQKH5Y5.js +0 -2
  438. package/dist/cli/chunks/kernel-2WZOQEZS.js +0 -2
  439. package/dist/cli/chunks/knowledge-graph-G3LVKK6P.js +0 -2
  440. package/dist/cli/chunks/llm-router-service-MM75HKWJ.js +0 -2
  441. package/dist/cli/chunks/load-test-BEWEE44J.js +0 -2
  442. package/dist/cli/chunks/memory-backend-NYKBBKZR.js +0 -2
  443. package/dist/cli/chunks/pattern-null-store-QGPUIV6M.js +0 -2
  444. package/dist/cli/chunks/project-root-C7ELXZRK.js +0 -2
  445. package/dist/cli/chunks/protocol-executor-SUVE33BM.js +0 -2
  446. package/dist/cli/chunks/qe-reasoning-bank-YWZMMGJB.js +0 -2
  447. package/dist/cli/chunks/queen-coordinator-ZFAKXRN7.js +0 -2
  448. package/dist/cli/chunks/router-4FTAVYLJ.js +0 -2
  449. package/dist/cli/chunks/routing-feedback-IO2KOWMJ.js +0 -2
  450. package/dist/cli/chunks/rvf-dual-writer-KCIRNE7C.js +0 -2
  451. package/dist/cli/chunks/rvf-migration-adapter-MFC5WTJU.js +0 -2
  452. package/dist/cli/chunks/rvf-native-adapter-I3KWHE7X.js +0 -2
  453. package/dist/cli/chunks/safe-db-QXDZ6QY3.js +0 -2
  454. package/dist/cli/chunks/schedule-CZKD6RIY.js +0 -2
  455. package/dist/cli/chunks/scheduler-BLA3Q4CH.js +0 -2
  456. package/dist/cli/chunks/sqlite-persistence-XIUYDJC4.js +0 -2
  457. package/dist/cli/chunks/task-handler-P6IFLCKP.js +0 -62
  458. package/dist/cli/chunks/task-handlers-DPWMUKFC.js +0 -9
  459. package/dist/cli/chunks/test-runner-process-46IPK3GH.js +0 -2
  460. package/dist/cli/chunks/tree-sitter-wasm-parser-MOI2WWNJ.js +0 -2
  461. package/dist/cli/chunks/unified-memory-FL26RTV3.js +0 -2
  462. package/dist/cli/chunks/unified-memory-hnsw-E2BPTH3U.js +0 -2
  463. package/dist/cli/chunks/unified-persistence-5ZOUPKHF.js +0 -2
  464. package/dist/cli/chunks/visual-security-IJVPO5FA.js +0 -2
  465. package/dist/cli/chunks/witness-chain-5FAFCQKP.js +0 -2
  466. package/dist/cli/chunks/witness-chain-V2M32W5D.js +0 -2
  467. package/dist/cli/chunks/workflow-orchestrator-3JLF3IX7.js +0 -2
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.12");process.exit(0)}
2
- import{a as F,d as C}from"./chunk-UCSK2RMI.js";import{a as E}from"./chunk-PX5OPXY6.js";import{a as O,b as P,c as x,e as J}from"./chunk-SPC4RBLF.js";import{b as W,d as B}from"./chunk-DZGPUGUG.js";var Q=new Set(["false","0","off","no"]),K=new Set([...Q,"disabled","disable","none","never"]),V=30,G=36500;function pe(l=process.env){let e=l.AQE_WORKERS_ENABLED;return e===void 0?!0:!Q.has(e.trim().toLowerCase())}function ge(l=process.env){let e=l.AQE_DISABLED_WORKERS;if(!e)return[];let t=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>i.length>0);return Array.from(new Set(t))}function fe(l=process.env){let e=l.AQE_DREAM_INSIGHTS_RETENTION_DAYS;if(e===void 0||e.trim()==="")return{retentionDays:V};let t=e.trim().toLowerCase();if(K.has(t))return{retentionDays:null};if(/^\d+$/.test(t)){let i=Number(t);if(i>=1&&i<=G)return{retentionDays:i}}return{retentionDays:null,warning:`Invalid AQE_DREAM_INSIGHTS_RETENTION_DAYS=${JSON.stringify(e)}; expected a whole number of days (1-${G}), 0 or "off". The dream_insights retention sweep is off until this is fixed; nothing is deleted.`}}var I="quality-daemon",R=class{constructor(e){this.backend=e}backend;async get(e,t){return this.backend.kvGet(e,t?.namespace??I)}async set(e,t){await this.backend.kvSet(e,t,I)}async search(e,t,i){return this.backend.kvSearch(e,i?.namespace??I,t)}};import{cpus as ce,freemem as de,totalmem as he,loadavg as me}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize&&(this.pruneExpired(),this.size>=this._maxSize)?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let r=i.shift();if(!(r.ttlMs&&e-r.createdAt>r.ttlMs))return r}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let r of i)if(!r.ttlMs||e-r.createdAt<=r.ttlMs)return r}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(r=>!r.ttlMs||i-r.createdAt<=r.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let r=this.queues[i].length;this.queues[i]=this.queues[i].filter(o=>!o.ttlMs||t-o.createdAt<=o.ttlMs),e+=r-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as Y}from"fs";import{resolve as $,join as X}from"path";import{existsSync as Z,readFileSync as ee}from"fs";var M=1e4,te={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...te,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=$(this.options.repoRoot,".git","refs","heads");if(!Z(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=Y(e,{recursive:!0},(i,r)=>{r&&this.handleRefChange(r)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let t=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let i of t.trim().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.15.13");process.exit(0)}
2
+ import{a as F,d as C}from"./chunk-S5AZCIZS.js";import{a as E}from"./chunk-JQGMW45H.js";import{a as O,b as P,c as x,e as J}from"./chunk-KDNJ4F3P.js";import{b as W,d as B}from"./chunk-J2ZIFFM6.js";var Q=new Set(["false","0","off","no"]),K=new Set([...Q,"disabled","disable","none","never"]),V=30,G=36500;function pe(l=process.env){let e=l.AQE_WORKERS_ENABLED;return e===void 0?!0:!Q.has(e.trim().toLowerCase())}function ge(l=process.env){let e=l.AQE_DISABLED_WORKERS;if(!e)return[];let t=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>i.length>0);return Array.from(new Set(t))}function fe(l=process.env){let e=l.AQE_DREAM_INSIGHTS_RETENTION_DAYS;if(e===void 0||e.trim()==="")return{retentionDays:V};let t=e.trim().toLowerCase();if(K.has(t))return{retentionDays:null};if(/^\d+$/.test(t)){let i=Number(t);if(i>=1&&i<=G)return{retentionDays:i}}return{retentionDays:null,warning:`Invalid AQE_DREAM_INSIGHTS_RETENTION_DAYS=${JSON.stringify(e)}; expected a whole number of days (1-${G}), 0 or "off". The dream_insights retention sweep is off until this is fixed; nothing is deleted.`}}var I="quality-daemon",R=class{constructor(e){this.backend=e}backend;async get(e,t){return this.backend.kvGet(e,t?.namespace??I)}async set(e,t){await this.backend.kvSet(e,t,I)}async search(e,t,i){return this.backend.kvSearch(e,i?.namespace??I,t)}};import{cpus as ce,freemem as de,totalmem as he,loadavg as me}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize&&(this.pruneExpired(),this.size>=this._maxSize)?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let r=i.shift();if(!(r.ttlMs&&e-r.createdAt>r.ttlMs))return r}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let r of i)if(!r.ttlMs||e-r.createdAt<=r.ttlMs)return r}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(r=>!r.ttlMs||i-r.createdAt<=r.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let r=this.queues[i].length;this.queues[i]=this.queues[i].filter(o=>!o.ttlMs||t-o.createdAt<=o.ttlMs),e+=r-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as Y}from"fs";import{resolve as $,join as X}from"path";import{existsSync as Z,readFileSync as ee}from"fs";var M=1e4,te={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...te,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=$(this.options.repoRoot,".git","refs","heads");if(!Z(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=Y(e,{recursive:!0},(i,r)=>{r&&this.handleRefChange(r)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let t=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let i of t.trim().split(`
3
3
  `)){if(!i)continue;let[r,o]=i.split(" "),n=this.lastKnownHeads.get(r);n&&n!==o&&(e.push(r),await this.enqueueCommitAnalysis(r,o)),this.lastKnownHeads.set(r,o)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),i=$(this.options.repoRoot,".git","refs","heads"),r=X(i,e),o;try{o=ee(r,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==o&&(this.lastKnownHeads.set(t,o),await this.enqueueCommitAnalysis(t,o))}async enqueueCommitAnalysis(e,t){if(E(t,"commit hash"))return;let i=[];try{i=(await C(["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot,timeout:M})).trim().split(`
4
4
  `).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let r={type:"git_commit",branch:e,commitHash:t,changedFiles:i},o={id:`git-${t}-${Date.now()}`,priority:"next",payload:r,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(o)}async snapshotHeads(){try{let e=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let t of e.trim().split(`
5
5
  `)){if(!t)continue;let[i,r]=t.split(" ");this.lastKnownHeads.set(i,r)}}catch{}}};function A(l,e){return l===null||e===null?0:l-e}var ie={regressionThreshold:2,gapThreshold:60,memoryPrefix:"quality-daemon:coverage"},f=class{constructor(e,t){this.queue=e;this.options={...ie,...t}}queue;options;async analyze(e,t,i){let r=await t.get(`${this.options.memoryPrefix}:snapshot`);if(await t.set(`${this.options.memoryPrefix}:snapshot`,e),!r)return{regressionDetected:!1,overallDelta:{line:0,branch:0,function:0,statement:0},affectedFiles:[],newGaps:[]};let o=r,n={line:e.overall.line-o.overall.line,branch:A(e.overall.branch,o.overall.branch??null),function:A(e.overall.function,o.overall.function??null),statement:A(e.overall.statement,o.overall.statement??null)},s=n.line<-this.options.regressionThreshold||(n.branch??0)<-this.options.regressionThreshold,a=i??Object.keys(e.files),c=[],d=[];for(let h of a){let u=e.files[h],m=o.files[h];if(!u)continue;let q=m?u.line-m.line:0,N=m?u.branch-m.branch:0,T=m?u.uncoveredLines.filter(_=>!m.uncoveredLines.includes(_)):u.uncoveredLines;if((q!==0||N!==0||T.length>0)&&c.push({file:h,lineDelta:q,branchDelta:N,newUncoveredLines:T}),u.line<this.options.gapThreshold){let _=this.computeRiskScore(u,T.length);d.push({file:h,uncoveredLines:u.uncoveredLines,currentCoverage:u.line,riskScore:_})}}return(s||d.length>0)&&this.enqueueTestSuggestion(e,o,d),await t.set(`${this.options.memoryPrefix}:delta`,{timestamp:Date.now(),overallDelta:n,regressionDetected:s,affectedFileCount:c.length,gapCount:d.length}),{regressionDetected:s,overallDelta:n,affectedFiles:c,newGaps:d}}async buildSnapshot(e){let t=await e.get("coverage:latest"),i=F(t);if(i)return{timestamp:Date.now(),overall:{line:i.line,branch:i.branch,function:i.function,statement:i.statement},files:t&&typeof t.files=="object"?t.files:{}}}computeRiskScore(e,t){let r=1-Math.min(100,Math.max(0,e.line))/100,o=Math.min(t/50,1);return Math.min(1,r*.6+o*.4)}enqueueTestSuggestion(e,t,i){let r={type:"coverage_delta",previousSnapshot:`snapshot-${t.timestamp}`,currentSnapshot:`snapshot-${e.timestamp}`},o={id:`coverage-delta-${Date.now()}`,priority:i.some(n=>n.riskScore>.8)?"now":"next",payload:r,createdAt:Date.now(),source:"coverage-delta",ttlMs:600*1e3};this.queue.enqueue(o)}};J();import{execFile as re}from"child_process";import{promisify as oe}from"util";var ne=oe(re),se={runsPerWorkflow:10,flakyThreshold:3,repo:""},y=class{constructor(e,t){this.queue=e;this.options={...se,...t}}queue;options;async check(){let e=await this.fetchRecentRuns(),t=this.groupByWorkflow(e),i=[],r=[],o=0;for(let[s,a]of Object.entries(t)){let c=a.filter(m=>m.conclusion==="failure").length,d=a.length>0?(a.length-c)/a.length*100:100,h=this.countConsecutiveFailures(a),u=a[0]?.conclusion??"unknown";u==="failure"&&o++,h>=this.options.flakyThreshold&&(r.push(s),this.enqueueFailureAlert(s,a[0])),i.push({name:s,recentRuns:a.length,failedRuns:c,successRate:Math.round(d*10)/10,lastConclusion:u,consecutiveFailures:h})}let n=this.calculateHealthScore(i);return{timestamp:Date.now(),workflows:i,failingWorkflows:o,flakyWorkflows:r,healthScore:n}}async fetchRecentRuns(){try{let e=["run","list","--limit",String(this.options.runsPerWorkflow*5),"--json","name,status,conclusion,headBranch,number,databaseId,createdAt"];this.options.repo&&e.push("--repo",this.options.repo);let{stdout:t}=await ne("gh",e,{timeout:15e3});return JSON.parse(t).map(r=>({name:r.name,status:r.status,conclusion:r.conclusion??"pending",headBranch:r.headBranch,runNumber:r.number,databaseId:r.databaseId,createdAt:r.createdAt}))}catch{return[]}}groupByWorkflow(e){let t=O();for(let i of e){let r=P(t,i.name);r||(r=[],x(t,i.name,r)),r.push(i)}for(let i of Object.keys(t))x(t,i,P(t,i).slice(0,this.options.runsPerWorkflow));return t}countConsecutiveFailures(e){let t=0;for(let i of e)if(i.conclusion==="failure")t++;else break;return t}calculateHealthScore(e){if(e.length===0)return 100;let t=e.reduce((i,r)=>i+r.successRate,0)/e.length;return Math.round(t)}enqueueFailureAlert(e,t){let i={type:"ci_failure",workflowName:e,runId:t.databaseId,conclusion:t.conclusion},r={id:`ci-failure-${e}-${Date.now()}`,priority:"now",payload:i,createdAt:Date.now(),source:"ci-monitor",ttlMs:1800*1e3};this.queue.enqueue(r)}};var ae={memoryPrefix:"quality-daemon:suggestions",maxSuggestions:100,minRiskScore:.3},v=class{options;constructor(e){this.options={...ae,...e}}async suggest(e,t,i){let r=[],o=e.filter(s=>s.riskScore>=this.options.minRiskScore);for(let s of o){let a=t.includes(s.file),c=this.determinePriority(s,a),d=this.determineTestType(s.file),h=this.estimateEffort(s);r.push({id:`suggestion-${Date.now()}-${r.length}`,file:s.file,uncoveredLines:s.uncoveredLines.slice(0,50),suggestedTestType:d,description:this.generateDescription(s,d),priority:c,estimatedEffort:h,createdAt:Date.now(),status:"pending"})}r.sort((s,a)=>{let c={high:0,medium:1,low:2};return c[s.priority]-c[a.priority]});let n=r.slice(0,this.options.maxSuggestions);return await this.storeSuggestions(n,i),n}async getPending(e){return(await e.get(`${this.options.memoryPrefix}:list`)??[]).filter(i=>i.status==="pending")}async updateStatus(e,t,i){let r=await i.get(`${this.options.memoryPrefix}:list`);if(!r)return!1;let o=r.findIndex(s=>s.id===e);if(o===-1)return!1;let n=r.map((s,a)=>a===o?{...s,status:t}:s);return await i.set(`${this.options.memoryPrefix}:list`,n),!0}determinePriority(e,t){return e.riskScore>.8?"high":t||e.riskScore>.5?"medium":"low"}determineTestType(e){return e.includes("/api/")||e.includes("/routes/")||e.includes("/handlers/")?"integration":e.includes("/e2e/")||e.includes("/pages/")||e.includes("/views/")?"e2e":"unit"}estimateEffort(e){return e.uncoveredLines.length<=10?"small":e.uncoveredLines.length<=50?"medium":"large"}generateDescription(e,t){let i=e.uncoveredLines.length,r=Math.round(e.currentCoverage);return`Add ${t} tests for ${e.file} (${i} uncovered lines, ${r}% coverage, risk ${(e.riskScore*100).toFixed(0)}%)`}async storeSuggestions(e,t){let o=[...(await t.get(`${this.options.memoryPrefix}:list`)??[]).filter(n=>n.status!=="pending"),...e].slice(-this.options.maxSuggestions);await t.set(`${this.options.memoryPrefix}:list`,o),await t.set(`${this.options.memoryPrefix}:count`,{pending:e.length,total:o.length,lastUpdated:Date.now()})}};var le={memoryPrefix:"quality-daemon:nightly",maxEntryAge:6048e5,nightlyHour:2},w=class{constructor(e,t){this.queue=e;this.options={...le,...t}}queue;options;lastRunDate;shouldRun(){let e=new Date,t=e.toISOString().split("T")[0];return this.lastRunDate===t?!1:e.getHours()>=this.options.nightlyHour}scheduleIfDue(){if(!this.shouldRun())return!1;let e={type:"nightly",tasks:["consolidate_patterns","prune_expired","generate_report"]},t={id:`nightly-${Date.now()}`,priority:"later",payload:e,createdAt:Date.now(),source:"nightly-consolidation",ttlMs:720*60*1e3};return this.queue.enqueue(t)}async execute(e,t){let i=Date.now(),r=new Date().toISOString().split("T")[0],o=await this.consolidatePatterns(e),n=await this.pruneExpired(e),s=this.generateReport(r,t);await e.set(`${this.options.memoryPrefix}:report:${r}`,s),this.lastRunDate=r;let a={timestamp:Date.now(),patternsConsolidated:o,entriesPruned:n,reportGenerated:!0,durationMs:Date.now()-i};return await e.set(`${this.options.memoryPrefix}:last-result`,a),a}async getLastResult(e){return e.get(`${this.options.memoryPrefix}:last-result`)}async consolidatePatterns(e){let t=await e.search("quality-daemon:*"),i=0;return await e.get("quality-daemon:suggestions:count")&&i++,await e.get("quality-daemon:coverage:delta")&&i++,i}async pruneExpired(e){let t=await e.search("quality-daemon:*"),i=0,r=Date.now();for(let o of t){if(o.endsWith(":snapshot")||o.endsWith(":list"))continue;let n=await e.get(o);n&&typeof n.timestamp=="number"&&r-n.timestamp>this.options.maxEntryAge&&(await e.set(o,{pruned:!0,prunedAt:r}),i++)}return i}generateReport(e,t){return{date:e,coverageHealth:t.coverageHealth??0,ciHealth:t.ciHealth??0,commitsAnalyzed:t.commitsAnalyzed??0,suggestionsGenerated:t.suggestionsGenerated??0,notificationsSent:t.notificationsSent??0,queueDepthAvg:t.queueDepthAvg??0,daemonUptime:t.uptimeSeconds??0}}};B();import{writeFileSync as H,mkdirSync as L,readdirSync as D,readFileSync as U,unlinkSync as z}from"fs";import{join as b}from"path";var ue={maxNotifications:200},k=class{notificationsDir;maxNotifications;webhookUrl;urlValidator;_sentCount=0;constructor(e){this.notificationsDir=e?.notificationsDir??W("notifications"),this.maxNotifications=e?.maxNotifications??ue.maxNotifications,this.webhookUrl=e?.webhookUrl,this.urlValidator=e?.urlValidator}get sentCount(){return this._sentCount}initialize(){L(this.notificationsDir,{recursive:!0})}async send(e){let t={...e,id:`notif-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1};return this.writeToFile(t),this.webhookUrl&&await this.sendWebhook(t),this._sentCount++,this.pruneOldNotifications(),t}list(e){let t=e?.limit??50;try{let i=D(this.notificationsDir).filter(o=>o.endsWith(".json")).sort().reverse(),r=[];for(let o of i){if(r.length>=t)break;try{let n=U(b(this.notificationsDir,o),"utf-8"),s=JSON.parse(n);if(e?.unreadOnly&&s.read||e?.type&&s.type!==e.type)continue;r.push(s)}catch{}}return r}catch{return[]}}markRead(e){try{let t=D(this.notificationsDir).filter(n=>n.endsWith(`-${e}.json`));if(t.length===0)return!1;let i=b(this.notificationsDir,t[0]),o={...JSON.parse(U(i,"utf-8")),read:!0};return H(i,JSON.stringify(o,null,2)),!0}catch{return!1}}clear(){try{let e=D(this.notificationsDir).filter(t=>t.endsWith(".json"));for(let t of e)z(b(this.notificationsDir,t));return e.length}catch{return 0}}writeToFile(e){try{L(this.notificationsDir,{recursive:!0});let t=`${e.timestamp}-${e.id}.json`,i=b(this.notificationsDir,t);H(i,JSON.stringify(e,null,2))}catch(t){console.debug("[NotificationService] Failed to write notification:",t)}}async sendWebhook(e){if(this.webhookUrl){if(this.urlValidator&&!this.urlValidator(this.webhookUrl)){console.warn("[NotificationService] Webhook URL blocked by SSRF guard:",this.webhookUrl);return}try{let t=await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)});t.ok||console.debug(`[NotificationService] Webhook returned ${t.status}`)}catch(t){console.debug("[NotificationService] Webhook delivery failed:",t)}}}pruneOldNotifications(){try{let e=D(this.notificationsDir).filter(i=>i.endsWith(".json")).sort();if(e.length<=this.maxNotifications)return;let t=e.slice(0,e.length-this.maxNotifications);for(let i of t)z(b(this.notificationsDir,i))}catch{}}};var S={tickIntervalMs:3e4,ciPollIntervalMs:5*6e4,coverageCheckIntervalMs:2*6e4,cpuThreshold:.7,memoryThreshold:.8},j=class{queue;gitWatcher;coverageDelta;ciMonitor;testSuggester;nightlyConsolidation;notificationService;tickTimer;_running=!1;_startedAt=0;_tickCount=0;_lastTickAt;_throttled=!1;_commitsAnalyzed=0;_suggestionsGenerated=0;_ciHealth=100;_coverageHealth=100;_lastCICheck;_lastCoverageCheck;_memory;config;constructor(e){this.config={tickIntervalMs:e?.tickIntervalMs??S.tickIntervalMs,ciPollIntervalMs:e?.ciPollIntervalMs??S.ciPollIntervalMs,coverageCheckIntervalMs:e?.coverageCheckIntervalMs??S.coverageCheckIntervalMs,cpuThreshold:e?.cpuThreshold??S.cpuThreshold,memoryThreshold:e?.memoryThreshold??S.memoryThreshold},this.queue=new p,this.gitWatcher=new g(this.queue,e?.git),this.coverageDelta=new f(this.queue,e?.coverage),this.ciMonitor=new y(this.queue,e?.ci),this.testSuggester=new v(e?.suggestions),this.nightlyConsolidation=new w(this.queue,e?.nightly),this.notificationService=new k(e?.notifications)}get running(){return this._running}async start(e){this._running||(this._memory=e,this._running=!0,this._startedAt=Date.now(),this.notificationService.initialize(),await this.gitWatcher.start().catch(t=>{console.debug("[QualityDaemon] Git watcher failed to start:",t)}),this.scheduleTick())}async stop(){this._running&&(this._running=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=void 0),this.gitWatcher.stop(),this._memory&&await this._memory.set("quality-daemon:state",{stoppedAt:Date.now(),tickCount:this._tickCount,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated}))}getStatus(){return{running:this._running,uptimeSeconds:this._running?Math.floor((Date.now()-this._startedAt)/1e3):0,tickCount:this._tickCount,queueDepth:this.queue.depths,lastTickAt:this._lastTickAt,throttled:this._throttled,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,ciHealth:this._ciHealth,coverageHealth:this._coverageHealth,lastCICheck:this._lastCICheck,lastCoverageCheck:this._lastCoverageCheck}}scheduleTick(){this._running&&(this.tickTimer=setTimeout(()=>this.tick(),this.config.tickIntervalMs),this.tickTimer.unref?.())}async tick(){if(!(!this._running||!this._memory)){if(this._tickCount++,this._lastTickAt=Date.now(),this._throttled=this.isResourceConstrained(),this._throttled){await this.processNowItems(this._memory),this.scheduleTick();return}await this.processQueue(this._memory),await this.runPeriodicChecks(this._memory),this.nightlyConsolidation.scheduleIfDue(),this.queue.pruneExpired(),this.scheduleTick()}}async processQueue(e){let t=0,i=10;for(;t<i&&!this.queue.isEmpty;){let r=this.queue.dequeue();if(!r)break;await this.handleQueueItem(r,e),t++}}async processNowItems(e){let t=this.queue.drainPriority("now");for(let i of t)await this.handleQueueItem(i,e)}async handleQueueItem(e,t){let i=e.payload;switch(i.type){case"git_commit":{this._commitsAnalyzed++;let r=await this.coverageDelta.buildSnapshot(t);if(r){let o=await this.coverageDelta.analyze(r,t,i.changedFiles);if(o.regressionDetected&&await this.notificationService.send({type:"coverage_drop",title:"Coverage Regression Detected",message:`Line coverage delta: ${o.overallDelta.line.toFixed(1)}% (${o.affectedFiles.length} files affected)`,severity:"high",metadata:{delta:o.overallDelta,commit:i.commitHash}}),o.newGaps.length>0){let n=await this.testSuggester.suggest(o.newGaps,i.changedFiles,t);this._suggestionsGenerated+=n.length,n.length>0&&await this.notificationService.send({type:"suggestion_available",title:"New Test Suggestions Available",message:`${n.length} test suggestions generated for uncovered code`,severity:"info",metadata:{count:n.length}})}}break}case"coverage_delta":{let r=await this.testSuggester.getPending(t);r.length>0&&await this.notificationService.send({type:"suggestion_available",title:"Test Suggestions Pending",message:`${r.length} test suggestions awaiting review`,severity:"info",metadata:{count:r.length}});break}case"gate_failure":await this.notificationService.send({type:"gate_failure",title:`Quality Gate Failed: ${i.gateName}`,message:`Score ${i.score} below threshold ${i.threshold}`,severity:"critical",metadata:{gate:i.gateName,score:i.score,threshold:i.threshold}});break;case"ci_failure":await this.notificationService.send({type:"ci_failure",title:`CI Failure: ${i.workflowName}`,message:`Workflow ${i.workflowName} run #${i.runId} concluded: ${i.conclusion}`,severity:"high",metadata:{workflow:i.workflowName,runId:i.runId}});break;case"nightly":{let r={coverageHealth:this._coverageHealth,ciHealth:this._ciHealth,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,queueDepthAvg:this.queue.size,uptimeSeconds:Math.floor((Date.now()-this._startedAt)/1e3)};await this.nightlyConsolidation.execute(t,r);break}default:console.warn("[QualityDaemon] Unhandled payload type:",i.type)}}async runPeriodicChecks(e){let t=Date.now();if(!this._lastCICheck||t-this._lastCICheck>=this.config.ciPollIntervalMs)try{let i=await this.ciMonitor.check();this._ciHealth=i.healthScore,this._lastCICheck=t,i.flakyWorkflows.length>0&&await this.notificationService.send({type:"flaky_detected",title:"Flaky Workflows Detected",message:`${i.flakyWorkflows.length} workflows showing repeated failures: ${i.flakyWorkflows.join(", ")}`,severity:"medium",metadata:{workflows:i.flakyWorkflows}})}catch{}if(!this._lastCoverageCheck||t-this._lastCoverageCheck>=this.config.coverageCheckIntervalMs)try{let i=await this.coverageDelta.buildSnapshot(e);if(i){let r=[i.overall.line,i.overall.branch,i.overall.function,i.overall.statement].filter(o=>typeof o=="number");this._coverageHealth=Math.round(r.reduce((o,n)=>o+n,0)/r.length),this._lastCoverageCheck=t}}catch{}}isResourceConstrained(){if(1-de()/he()>this.config.memoryThreshold)return!0;let t=ce().length;return(t>0?me()[0]/t:0)>this.config.cpuThreshold}};export{pe as a,ge as b,fe as c,R as d,j as e};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.12");process.exit(0)}
2
- import{b as d,d as c}from"./chunk-WTAUF6O4.js";import{a as l,e as g}from"./chunk-W4II6SIH.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x 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.15.13");process.exit(0)}
2
+ import{b as d,d as c}from"./chunk-VTOBUZL6.js";import{a as l,e as g}from"./chunk-3Y2ROSCL.js";g();c();import{existsSync as y,readFileSync as p}from"node:fs";import{join as o,dirname as u}from"node:path";import{fileURLToPath as m}from"node:url";var i=class extends Error{constructor(t,n,r){super(t);this.code=n;this.cause=r;this.name="PatternLoaderError"}code;cause},s=class a{static instance=null;config;patterns;isLoading=!1;constructor(e={}){this.config={basePath:e.basePath??this.getDefaultBasePath(),throwOnMissing:e.throwOnMissing??!1,validatePatterns:e.validatePatterns??!0},this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]}}static getInstance(e){return a.instance||(a.instance=new a(e)),a.instance}static resetInstance(){a.instance=null}getDefaultBasePath(){try{let e=import.meta.url,t=m(e),n=u(t),r=o(n,"..","..","..");return o(r,"assets","patterns")}catch{return o(process.cwd(),"assets","patterns")}}async loadPatterns(){if(!this.isLoading){this.isLoading=!0,this.patterns.errors=[];try{this.patterns.index=this.loadJsonFile("index.json");let[e,t,n,r]=await Promise.all([Promise.resolve(this.loadJsonFile("adr-051-booster-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-router-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-embedding-patterns.json")),Promise.resolve(this.loadJsonFile("adr-051-reasoning-patterns.json"))]);this.patterns.booster=e,this.patterns.router=t,this.patterns.embedding=n,this.patterns.reasoning=r,this.patterns.loadedAt=new Date,this.config.validatePatterns&&this.validateLoadedPatterns()}finally{this.isLoading=!1}}}loadJsonFile(e){let t=o(this.config.basePath,e);try{if(!y(t)){let r=`Pattern file not found: ${t}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"FILE_NOT_FOUND");return null}let n=p(t,"utf-8");return d(n)}catch(n){if(n instanceof i)throw n;let r=`Failed to load pattern file ${e}: ${l(n)}`;if(this.patterns.errors.push(r),this.config.throwOnMissing)throw new i(r,"PARSE_ERROR",n instanceof Error?n:void 0);return null}}validateLoadedPatterns(){this.patterns.booster&&(Array.isArray(this.patterns.booster.patterns)||this.patterns.errors.push("Booster patterns file missing patterns array")),this.patterns.router&&(Array.isArray(this.patterns.router.patterns)||this.patterns.errors.push("Router patterns file missing patterns array")),this.patterns.embedding&&(Array.isArray(this.patterns.embedding.patterns)||this.patterns.errors.push("Embedding patterns file missing patterns array")),this.patterns.reasoning&&(Array.isArray(this.patterns.reasoning.patterns)||this.patterns.errors.push("Reasoning patterns file missing patterns array"))}async ensureLoaded(){this.patterns.loadedAt||await this.loadPatterns()}async getIndex(){return await this.ensureLoaded(),this.patterns.index}async getBoosterPatterns(){return await this.ensureLoaded(),this.patterns.booster}async getRouterPatterns(){return await this.ensureLoaded(),this.patterns.router}async getEmbeddingPatterns(){return await this.ensureLoaded(),this.patterns.embedding}async getReasoningPatterns(){return await this.ensureLoaded(),this.patterns.reasoning}async getBoosterPatternByKey(e){let t=await this.getBoosterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getRouterPatternByKey(e){let t=await this.getRouterPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEmbeddingPatternByKey(e){let t=await this.getEmbeddingPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getReasoningPatternByKey(e){let t=await this.getReasoningPatterns();return t?t.patterns.find(r=>r.key===e)??null:null}async getEligibleBoosterTransforms(){let e=await this.getBoosterPatternByKey("booster-transform-eligibility");return e?e.eligibility_criteria.simple_transforms:[]}async getTierHierarchy(){let e=await this.getRouterPatternByKey("router-5tier-complexity");return e?e.tier_hierarchy:null}async getQualityGateThresholds(){let e=await this.getReasoningPatternByKey("reasoning-pattern-quality-gates");return e?e.gate_thresholds:null}isLoaded(){return this.patterns.loadedAt!==null}getLoadedAt(){return this.patterns.loadedAt}getErrors(){return[...this.patterns.errors]}async getStatistics(){let e=await this.getIndex();return e?e.pattern_statistics:null}async reload(){this.patterns={index:null,booster:null,router:null,embedding:null,reasoning:null,loadedAt:null,errors:[]},await this.loadPatterns()}async getAllPatterns(){return await this.ensureLoaded(),{...this.patterns}}};function x(){return s.getInstance()}export{x 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.15.12");process.exit(0)}
2
- import{c as H,d as J}from"./chunk-UUZZXHUF.js";import{h as G}from"./chunk-LFBA735S.js";import{g as U}from"./chunk-SITL5YZV.js";import{e as N}from"./chunk-BC4T6SCV.js";import{e as T}from"./chunk-ZGROHCOW.js";import{b as v,c as C}from"./chunk-BYRCB5JT.js";import{b as B}from"./chunk-FZJCBSN4.js";import{b,d as _}from"./chunk-WTAUF6O4.js";import{i as W}from"./chunk-7TA5MUPW.js";import{c as k,d as E}from"./chunk-VZBC6DP7.js";import{a as oe}from"./chunk-UJNGGFGX.js";import{c as q}from"./chunk-ADUAJIAU.js";import{S as se,b as z}from"./chunk-35MIUSXQ.js";import{a as y,e as $}from"./chunk-W4II6SIH.js";import{randomUUID as te}from"crypto";$();_();import{randomUUID as ce}from"node:crypto";var D=C(),P=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;localTrajectories=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async startTrajectory(e,t){let i=`trajectory-${ce()}`;if(this.claudeFlowAvailable)try{let{execFileSync:n}=await import("child_process"),r=["--no-install",D,"hooks","intelligence","trajectory-start","--task",e];t&&r.push("--agent",t);let s=n("npx",r,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}).match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);if(s?.[1])return s[1]}catch(n){console.debug("[TrajectoryBridge] Claude Flow trajectory start failed:",n instanceof Error?n.message:n)}return this.localTrajectories.set(i,{id:i,task:e,agent:t,steps:[],startedAt:Date.now()}),i}async recordStep(e,t,i,n){if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=["--no-install",D,"hooks","intelligence","trajectory-step","--trajectory-id",e,"--action",t];i&&s.push("--result",i),n!==void 0&&s.push("--quality",String(n)),a("npx",s,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot});return}catch(a){console.debug("[TrajectoryBridge] Claude Flow trajectory step failed:",a instanceof Error?a.message:a)}let r=this.localTrajectories.get(e);r&&r.steps.push({id:`step-${r.steps.length+1}`,action:t,result:i,quality:n,timestamp:Date.now()})}async endTrajectory(e,t,i){if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),a=["--no-install",D,"hooks","intelligence","trajectory-end","--trajectory-id",e,"--success",String(t)];i&&a.push("--feedback",i),r("npx",a,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch{}let n=this.localTrajectories.get(e);if(n)return n.success=t,n.feedback=i,n.completedAt=Date.now(),await this.persistTrajectory(n),n}getTrajectory(e){return this.localTrajectories.get(e)}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async persistTrajectory(e){try{let{getUnifiedMemory:t}=await import("./unified-memory-FL26RTV3.js"),i=t();i.isInitialized()||await i.initialize();let n=i.getDatabase();try{n.prepare("PRAGMA table_info(qe_trajectories)").all().some(o=>o.name==="feedback")||n.exec("ALTER TABLE qe_trajectories ADD COLUMN feedback TEXT")}catch{}let r=new Date(e.startedAt).toISOString(),a=e.completedAt?new Date(e.completedAt).toISOString():null;n.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
+ import{c as H,d as J}from"./chunk-3YNLWPBF.js";import{h as G}from"./chunk-72ASBE35.js";import{g as U}from"./chunk-TSQC2KKZ.js";import{e as N}from"./chunk-SYV2V3PL.js";import{e as T}from"./chunk-E7CLYGS7.js";import{b as v,c as C}from"./chunk-QDEJ4CI2.js";import{b as B}from"./chunk-VRVMIPTM.js";import{b,d as _}from"./chunk-VTOBUZL6.js";import{i as W}from"./chunk-H4H2YSFH.js";import{c as k,d as E}from"./chunk-NURIILUB.js";import{a as oe}from"./chunk-UT2VZ33P.js";import{c as q}from"./chunk-GB6HBNH2.js";import{S as se,b as z}from"./chunk-WOCGL4QP.js";import{a as y,e as $}from"./chunk-3Y2ROSCL.js";import{randomUUID as te}from"crypto";$();_();import{randomUUID as ce}from"node:crypto";var D=C(),P=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;localTrajectories=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async startTrajectory(e,t){let i=`trajectory-${ce()}`;if(this.claudeFlowAvailable)try{let{execFileSync:n}=await import("child_process"),r=["--no-install",D,"hooks","intelligence","trajectory-start","--task",e];t&&r.push("--agent",t);let s=n("npx",r,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}).match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);if(s?.[1])return s[1]}catch(n){console.debug("[TrajectoryBridge] Claude Flow trajectory start failed:",n instanceof Error?n.message:n)}return this.localTrajectories.set(i,{id:i,task:e,agent:t,steps:[],startedAt:Date.now()}),i}async recordStep(e,t,i,n){if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=["--no-install",D,"hooks","intelligence","trajectory-step","--trajectory-id",e,"--action",t];i&&s.push("--result",i),n!==void 0&&s.push("--quality",String(n)),a("npx",s,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot});return}catch(a){console.debug("[TrajectoryBridge] Claude Flow trajectory step failed:",a instanceof Error?a.message:a)}let r=this.localTrajectories.get(e);r&&r.steps.push({id:`step-${r.steps.length+1}`,action:t,result:i,quality:n,timestamp:Date.now()})}async endTrajectory(e,t,i){if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),a=["--no-install",D,"hooks","intelligence","trajectory-end","--trajectory-id",e,"--success",String(t)];i&&a.push("--feedback",i),r("npx",a,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch{}let n=this.localTrajectories.get(e);if(n)return n.success=t,n.feedback=i,n.completedAt=Date.now(),await this.persistTrajectory(n),n}getTrajectory(e){return this.localTrajectories.get(e)}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async persistTrajectory(e){try{let{getUnifiedMemory:t}=await import("./unified-memory-TLGSSLMI.js"),i=t();i.isInitialized()||await i.initialize();let n=i.getDatabase();try{n.prepare("PRAGMA table_info(qe_trajectories)").all().some(o=>o.name==="feedback")||n.exec("ALTER TABLE qe_trajectories ADD COLUMN feedback TEXT")}catch{}let r=new Date(e.startedAt).toISOString(),a=e.completedAt?new Date(e.completedAt).toISOString():null;n.prepare(`
3
3
  INSERT OR REPLACE INTO qe_trajectories
4
4
  (id, task, agent, domain, started_at, ended_at, success, steps_json, feedback)
5
5
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
@@ -9,4 +9,4 @@ Steps:
9
9
  ${e.steps.map((r,a)=>`${a+1}. ${r.action}${r.result?` \u2192 ${r.result}`:""}`).join(`
10
10
  `)}
11
11
 
12
- Duration: ${e.durationMs}ms`;return{patternType:t,qeDomain:e.domain,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:[...this.extractTags(e),this.experienceIdentity(e)],experienceOrigin:{task:e.task,domain:e.domain??null,patternType:t},testType:this.detectTestType(e.task)},template:{type:"workflow",content:n,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}experienceIdentity(e){return le("sha256").update(JSON.stringify([e.task,e.domain??null,this.detectPatternType(e.task)])).digest("hex")}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t} ${this.experienceIdentity(e)}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),n=["unit","integration","e2e","api","mock","coverage","security"];for(let r of n)i.some(a=>a.includes(r))&&t.push(r);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){F.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function ee(u,e,t,i){return new L(u,e,t,i)}var ge={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:T},I=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ge,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await H(J),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=N(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=G(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-HLM65RDS.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=ee(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-V2M32W5D.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-V2M32W5D.js"),{getUnifiedPersistence:n}=await import("./unified-persistence-5ZOUPKHF.js"),r=n();if(r.isInitialized()){let a=r.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-5ZOUPKHF.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-QGPUIV6M.js"),n=new i(t.getDatabase());this.experienceCapture.setNullRecorder(r=>n.recordNull(r))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-DKXMDVPE.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-L3F6AES2.js"),i=t(),n=this.patternStore,r=await n.getStats();this._domainTransferInterval=setInterval(async()=>{try{r=await n.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=r.byDomain?.[a]??0,o=r.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:r.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=K({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let n=U(i.value,t.value);return k(n)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return k([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),k([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(n=>n.pattern.id),avgSimilarity:t.length>0?t.reduce((n,r)=>n+r.similarity,0)/t.length:0};try{let n=`pattern-usage:search:${Date.now()}-${te().slice(0,8)}`;await this.memory.set(n,i,{persist:!0,ttl:10080*60})}catch(n){console.debug("[AQELearningEngine] Failed to track pattern search:",y(n))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let r of i)if(r.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let n=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let r of n)if(r.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let n=`task-${Date.now()}-${te().slice(0,8)}`,r=n;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{r=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(c){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(c))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let c=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});c.success&&c.value.length>0&&(s=c.value.map(g=>g.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:r!==n?r:void 0,appliedPatterns:s}));let d={id:o||r,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(d.id,d),d.id}async recordStep(e,t,i,n){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,n)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:n});let r=this.activeTasks.get(e);r&&r.steps.push({action:t,result:i,quality:n,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(r){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(r))}let n=this.activeTasks.get(e);if(n)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(n),n}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(n){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",n instanceof Error?n.message:n)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((n,r)=>n+(r.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),d=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),c=new Set,g=new Set;for(let m of d.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&c.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&c.add("javascript"),m.endsWith(".py")&&c.add("python"),m.endsWith(".go")&&c.add("go"),m.endsWith(".rs")&&c.add("rust");let w=a(e,"package.json");if(n(w))try{let m=b(r(w,"utf-8")),p={...m.dependencies,...m.devDependencies};p.react&&g.add("react"),p.vue&&g.add("vue"),p.vitest&&g.add("vitest"),p.jest&&g.add("jest"),p.playwright&&g.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(c),frameworks:Array.from(g),patterns:[],complexity:d.length>500?3:d.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},me={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ie=class{config;constructor(e){this.config={...me,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),n=e.slice(t),r=[],a=Date.now(),s=h(i.map(l=>l.tokenMetrics.costUsd)),o=h(n.map(l=>l.tokenMetrics.costUsd)),d=h(i.map(l=>l.tokenMetrics.savingsUsd)),c=h(n.map(l=>l.tokenMetrics.savingsUsd));if(o>s*1.1&&c<=d*1.05){let l=Math.min(1,(o-s)/(s||1));r.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(l),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(l=>l.qualityMetrics.gatePassRate)),w=h(n.map(l=>l.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&r.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let p=h(i.map(l=>l.learningMetrics.patternCount)),f=h(n.map(l=>l.learningMetrics.patternCount)),ne=h(i.map(l=>l.learningMetrics.averageConfidence)),O=h(n.map(l=>l.learningMetrics.averageConfidence)),re=Math.abs(f-p),ae=Math.abs(O-ne);re<1&&ae<.02&&r.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${O.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let x=h(i.map(l=>l.performanceMetrics.p95LatencyMs)),j=h(n.map(l=>l.performanceMetrics.p95LatencyMs));if(j>x*1.2&&x>0){let l=Math.min(1,(j-x)/(x||1));r.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${x.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(l),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return r}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(u){return u.length===0?0:u.reduce((e,t)=>e+t,0)/u.length}function A(u){return Math.max(0,Math.min(1,u))}function he(u,e,t){return new I(u,e,t)}function st(u,e,t){return he(u,{projectRoot:e},t)}export{ge as a,I as b,me as c,ie as d,he as e,st as f};
12
+ Duration: ${e.durationMs}ms`;return{patternType:t,qeDomain:e.domain,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:[...this.extractTags(e),this.experienceIdentity(e)],experienceOrigin:{task:e.task,domain:e.domain??null,patternType:t},testType:this.detectTestType(e.task)},template:{type:"workflow",content:n,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}experienceIdentity(e){return le("sha256").update(JSON.stringify([e.task,e.domain??null,this.detectPatternType(e.task)])).digest("hex")}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t} ${this.experienceIdentity(e)}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),n=["unit","integration","e2e","api","mock","coverage","security"];for(let r of n)i.some(a=>a.includes(r))&&t.push(r);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){F.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function ee(u,e,t,i){return new L(u,e,t,i)}var ge={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:T},I=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ge,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await H(J),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=N(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=G(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-YXMPZKQE.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=ee(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-KDOMXDQX.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-KDOMXDQX.js"),{getUnifiedPersistence:n}=await import("./unified-persistence-VFFOTWK7.js"),r=n();if(r.isInitialized()){let a=r.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-VFFOTWK7.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-RY6CVYHP.js"),n=new i(t.getDatabase());this.experienceCapture.setNullRecorder(r=>n.recordNull(r))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-N7EOGE5P.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-GCY7W5DA.js"),i=t(),n=this.patternStore,r=await n.getStats();this._domainTransferInterval=setInterval(async()=>{try{r=await n.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=r.byDomain?.[a]??0,o=r.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:r.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=K({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let n=U(i.value,t.value);return k(n)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return k([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),k([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(n=>n.pattern.id),avgSimilarity:t.length>0?t.reduce((n,r)=>n+r.similarity,0)/t.length:0};try{let n=`pattern-usage:search:${Date.now()}-${te().slice(0,8)}`;await this.memory.set(n,i,{persist:!0,ttl:10080*60})}catch(n){console.debug("[AQELearningEngine] Failed to track pattern search:",y(n))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let r of i)if(r.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let n=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let r of n)if(r.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let n=`task-${Date.now()}-${te().slice(0,8)}`,r=n;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{r=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(c){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(c))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let c=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});c.success&&c.value.length>0&&(s=c.value.map(g=>g.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:r!==n?r:void 0,appliedPatterns:s}));let d={id:o||r,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(d.id,d),d.id}async recordStep(e,t,i,n){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,n)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:n});let r=this.activeTasks.get(e);r&&r.steps.push({action:t,result:i,quality:n,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(r){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(r))}let n=this.activeTasks.get(e);if(n)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(n),n}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(n){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",n instanceof Error?n.message:n)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((n,r)=>n+(r.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),d=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),c=new Set,g=new Set;for(let m of d.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&c.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&c.add("javascript"),m.endsWith(".py")&&c.add("python"),m.endsWith(".go")&&c.add("go"),m.endsWith(".rs")&&c.add("rust");let w=a(e,"package.json");if(n(w))try{let m=b(r(w,"utf-8")),p={...m.dependencies,...m.devDependencies};p.react&&g.add("react"),p.vue&&g.add("vue"),p.vitest&&g.add("vitest"),p.jest&&g.add("jest"),p.playwright&&g.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(c),frameworks:Array.from(g),patterns:[],complexity:d.length>500?3:d.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},me={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ie=class{config;constructor(e){this.config={...me,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),n=e.slice(t),r=[],a=Date.now(),s=h(i.map(l=>l.tokenMetrics.costUsd)),o=h(n.map(l=>l.tokenMetrics.costUsd)),d=h(i.map(l=>l.tokenMetrics.savingsUsd)),c=h(n.map(l=>l.tokenMetrics.savingsUsd));if(o>s*1.1&&c<=d*1.05){let l=Math.min(1,(o-s)/(s||1));r.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(l),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(l=>l.qualityMetrics.gatePassRate)),w=h(n.map(l=>l.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&r.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let p=h(i.map(l=>l.learningMetrics.patternCount)),f=h(n.map(l=>l.learningMetrics.patternCount)),ne=h(i.map(l=>l.learningMetrics.averageConfidence)),O=h(n.map(l=>l.learningMetrics.averageConfidence)),re=Math.abs(f-p),ae=Math.abs(O-ne);re<1&&ae<.02&&r.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${O.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let x=h(i.map(l=>l.performanceMetrics.p95LatencyMs)),j=h(n.map(l=>l.performanceMetrics.p95LatencyMs));if(j>x*1.2&&x>0){let l=Math.min(1,(j-x)/(x||1));r.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${x.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(l),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return r}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(u){return u.length===0?0:u.reduce((e,t)=>e+t,0)/u.length}function A(u){return Math.max(0,Math.min(1,u))}function he(u,e,t){return new I(u,e,t)}function st(u,e,t){return he(u,{projectRoot:e},t)}export{ge as a,I as b,me as c,ie as d,he as e,st as f};
@@ -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.15.12");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.15.13");process.exit(0)}
2
2
  import a from"chalk";import{existsSync as m,statSync as S}from"fs";import{join as p,relative as P}from"path";var l=class{static prompt(t,e){return new Promise(r=>{t.question(e,s=>{r(s)})})}static printStepHeader(t,e,r){console.log(""),console.log(a.cyan(`Step ${t}: ${e}`)),r&&console.log(a.gray(r)),console.log("")}static printWizardHeader(t,e){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(` ${t}`)),console.log(a.blue("========================================")),e&&console.log(a.gray(e)),console.log(a.gray("Press Ctrl+C to cancel at any time")),console.log("")}static printSummaryHeader(){console.log(""),console.log(a.blue("========================================")),console.log(a.blue.bold(" Configuration Summary")),console.log(a.blue("========================================")),console.log("")}static printSummaryField(t,e,r){let s=r?.indent??" ",i=r?.maxItems??5,c=r?.formatValue??(o=>a.cyan(o));if(Array.isArray(e))e.length===0?console.log(a.white(`${s}${t}: ${a.gray("(none)")}`)):e.length<=i?console.log(a.white(`${s}${t}: ${c(e.join(", "))}`)):(console.log(a.white(`${s}${t}:`)),e.slice(0,i).forEach(o=>{console.log(a.gray(`${s} - ${o}`))}),console.log(a.gray(`${s} ... and ${e.length-i} more`)));else{let o=t.padEnd(16);console.log(a.white(`${s}${o}${c(e)}`))}}static printDerivedSettings(t,e=" "){console.log(""),console.log(a.gray(`${e}Derived settings:`));for(let[r,s]of Object.entries(t))console.log(a.gray(`${e} ${r}: ${s}`));console.log("")}};var h=class u{static getSourceDirectories(t){let e=[],r=["src","lib","app","packages","api"];for(let s of r){let i=p(t,s);m(i)&&S(i).isDirectory()&&e.push(s)}return e}static getCoverageTargets(t){let e=u.getSourceDirectories(t),r=["coverage","coverage/lcov.info","coverage/coverage-final.json",".nyc_output"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getSecurityTargets(t){let e=u.getSourceDirectories(t),r=["package.json","package-lock.json","yarn.lock","pnpm-lock.yaml",".env",".env.example","docker-compose.yml","Dockerfile"];for(let s of r){let i=p(t,s);m(i)&&e.push(s)}return e}static getTestSourceFiles(t){let e=[],r=["src","lib","app","packages"];for(let s of r){let i=p(t,s);m(i)&&S(i).isDirectory()&&(e.push(`${s}/**/*.ts`),e.push(s))}return m(p(t,"src"))&&(e.push("src/services/**/*.ts"),e.push("src/utils/**/*.ts"),e.push("src/components/**/*.tsx")),e}static checkPatternsExist(t){return[p(t,".agentic-qe","patterns"),p(t,".agentic-qe","memory.db"),p(t,".aqe","patterns"),p(t,"data","patterns")].some(r=>m(r))}},f=class{static relativePath(t,e){return P(e,t)||"."}static yesNo(t){return t?"Yes":"No"}static enabledDisabled(t){return t?"Enabled":"Disabled"}static percentage(t){return`${t}%`}static truncatedList(t,e=5){return t.length===0?"(none)":t.length<=e?t.join(", "):`${t.slice(0,e).join(", ")}... and ${t.length-e} more`}};import n from"chalk";import{existsSync as w}from"fs";import{resolve as I}from"path";var d=class{constructor(t){this.defaultValue=t}defaultValue;description;getDefaultValue(){return this.defaultValue}success(t){return{value:t,continue:!0}}cancelled(){return{value:this.defaultValue,continue:!1}}error(t){return{value:this.defaultValue,continue:!1,error:t}}};var y=class extends d{id;stepNumber;title;description;options;validValues;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.options.forEach(i=>{let c=[];i.isRecommended?c.push(n.green(" (recommended)")):(i.isDefault||i.value===this.defaultValue)&&c.push(n.green(" (default)")),console.log(n.white(` ${i.key}. ${i.label||i.value}${c.join("")}`)),i.description&&console.log(n.gray(` ${i.description}`))}),console.log("");let r=(await l.prompt(t.rl,`Select ${this.title.toLowerCase()} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);return s>=1&&s<=this.options.length?this.success(this.options[s-1].value):this.validValues.includes(r)?this.success(r):(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue))}},b=class extends d{id;stepNumber;title;description;options;validValues;instructions;allowEmpty;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.options=t.options,this.validValues=t.validValues,this.instructions=t.instructions,this.allowEmpty=t.allowEmpty??!1}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.instructions&&(console.log(n.gray(this.instructions)),console.log("")),this.options.forEach(o=>{let N=o.isDefaultSelected||this.defaultValue.includes(o.value)?n.green(" *"):"";console.log(n.white(` ${o.key}. ${o.label||o.value}${N}`)),o.description&&console.log(n.gray(` ${o.description}`))}),console.log(""),console.log(n.gray(" * = included in default selection")),console.log("");let e=this.defaultValue.join(","),s=(await l.prompt(t.rl,`Select options [${n.gray(e)}]: `)).trim();if(!s)return this.success(this.defaultValue);let i=s.split(",").map(o=>o.trim().toLowerCase()).filter(o=>o.length>0),c=[];for(let o of i){let g=parseInt(o,10);g>=1&&g<=this.options.length?c.push(this.options[g-1].value):this.validValues.includes(o)&&c.push(o)}return c.length===0?this.allowEmpty?this.success([]):(console.log(n.yellow(` Invalid input, using default: ${e}`)),this.success(this.defaultValue)):this.success([...new Set(c)])}},v=class extends d{id;stepNumber;title;description;additionalInfo;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.additionalInfo=t.additionalInfo}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.additionalInfo&&(console.log(n.gray(this.additionalInfo)),console.log(""));let e=this.defaultValue?"Y/n":"y/N",s=(await l.prompt(t.rl,`${this.title}? [${n.gray(e)}]: `)).trim().toLowerCase();return s===""?this.success(this.defaultValue):s==="n"||s==="no"?this.success(!1):s==="y"||s==="yes"?this.success(!0):this.success(this.defaultValue)}},x=class extends d{id;stepNumber;title;description;presets;min;max;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.presets=t.presets,this.min=t.min,this.max=t.max}async execute(t){if(t.nonInteractive)return this.success(this.defaultValue);l.printStepHeader(this.stepNumber,this.title,this.description),this.presets&&this.presets.length>0&&(this.presets.forEach(i=>{let c=i.value===this.defaultValue?n.green(" (default)"):"";console.log(n.gray(` ${i.key}. ${i.label}${c}`))}),this.min!==void 0&&this.max!==void 0&&console.log(n.gray(` Or enter a custom number (${this.min}-${this.max})`)),console.log(""));let r=(await l.prompt(t.rl,`${this.title} [${n.gray(String(this.defaultValue))}]: `)).trim();if(!r)return this.success(this.defaultValue);let s=parseInt(r,10);if(this.presets){let i=s;if(i>=1&&i<=this.presets.length)return this.success(this.presets[i-1].value)}return isNaN(s)?(console.log(n.yellow(` Invalid input, using default: ${this.defaultValue}`)),this.success(this.defaultValue)):this.min!==void 0&&s<this.min?(console.log(n.yellow(` Value too low, using minimum: ${this.min}`)),this.success(this.min)):this.max!==void 0&&s>this.max?(console.log(n.yellow(` Value too high, using maximum: ${this.max}`)),this.success(this.max)):this.success(s)}},C=class extends d{id;stepNumber;title;description;examples;suggestionsProvider;validatePath;constructor(t){super(t.defaultValue),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description,this.examples=t.examples,this.suggestionsProvider=t.suggestionsProvider,this.validatePath=t.validatePath??!0}async execute(t){if(t.nonInteractive){let i=I(t.cwd,this.defaultValue);return this.success(w(i)?i:t.cwd)}if(l.printStepHeader(this.stepNumber,this.title,this.description),this.examples&&(console.log(n.gray(`Examples: ${this.examples}`)),console.log("")),this.suggestionsProvider){let i=this.suggestionsProvider(t.cwd);i.length>0&&(console.log(n.yellow("Detected directories:")),i.slice(0,5).forEach((c,o)=>{console.log(n.gray(` ${o+1}. ${c}`))}),console.log(""))}let r=(await l.prompt(t.rl,`${this.title} [${n.gray(this.defaultValue)}]: `)).trim()||this.defaultValue,s=I(t.cwd,r);return this.validatePath&&!w(s)?(console.log(n.yellow(` Warning: '${r}' does not exist, using current directory.`)),this.success(t.cwd)):this.success(s)}};var T=class extends d{id;stepNumber;title;description;constructor(t){super({}),this.id=t.id,this.stepNumber=t.stepNumber,this.title=t.title,this.description=t.description}async execute(t){if(t.nonInteractive)return this.success({});l.printStepHeader(this.stepNumber,this.title,this.description);let e=await l.prompt(t.rl,`Include patterns [${n.gray("e.g., src/**/*.ts")}]: `),r=await l.prompt(t.rl,`Exclude patterns [${n.gray("e.g., **/*.test.ts,dist/**")}]: `),s={};return e.trim()&&(s.include=e.split(",").map(i=>i.trim()).filter(i=>i.length>0)),r.trim()&&(s.exclude=r.split(",").map(i=>i.trim()).filter(i=>i.length>0)),this.success(s)}};import{createInterface as R}from"readline";import $ from"chalk";var V=class{options;cwd;constructor(t){this.options=t,this.cwd=process.cwd()}async run(){if(this.isNonInteractive())return this.getDefaults();let t=R({input:process.stdin,output:process.stdout});try{this.printHeader();let e={},r=this.getCommands();for(let c of r){let o={rl:t,cwd:this.cwd,results:e,nonInteractive:!1},g=await c.execute(o);if(!g.continue)return this.getCancelled();e[c.id]=g.value}let s=this.buildResult(e);return this.printSummary(s),await this.promptConfirmation(t)?s:this.getCancelled()}finally{t.close()}}printHeader(){l.printWizardHeader(this.getTitle(),this.getSubtitle())}async promptConfirmation(t){console.log("");let r=(await l.prompt(t,`${$.green(this.getConfirmationPrompt())} [${$.gray("Y/n")}]: `)).trim().toLowerCase();return r==="n"||r==="no"?(console.log($.yellow(`
3
3
  Wizard cancelled.`)),!1):!0}};export{l as a,h as b,f as c,y as d,b as e,v as f,x as g,C as h,T as i,V as j};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.12");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.15.13");process.exit(0)}
2
2
  var h=class{executionHistory=[];learnedDurations=new Map;runCount=0;lastPrunedCount=0;learningRate;maxHistorySize;constructor(t){this.learningRate=t?.learningRate??.3,this.maxHistorySize=t?.maxHistorySize??1e4}buildTestDAG(t){let e=new Map,n=new Map;for(let i of t){let s=this.applyLearnedDuration(i);e.set(s.id,s),n.set(s.id,[])}for(let i of t)for(let s of i.dependencies){if(!e.has(s))throw new Error(`Test '${i.id}' depends on '${s}' which does not exist in the test set`);n.get(s).push(i.id)}let o=this.computeCriticalPath(e,n),a=this.computeParallelGroups(e,n);return{nodes:e,edges:n,criticalPath:o,parallelGroups:a}}findCriticalPath(t){return t.criticalPath.map(e=>t.nodes.get(e)).filter(e=>e!==void 0)}findParallelBranches(t){return t.parallelGroups.map(e=>e.map(n=>t.nodes.get(n)).filter(n=>n!==void 0))}pruneByMinCut(t,e){let n=this.sumDurations(t.nodes);if(n<=e)return this.lastPrunedCount=0,t;let o=this.computeAttentionScores(t),a=Array.from(o.entries()).sort((r,l)=>r[1]-l[1]),i=new Set(t.criticalPath),s=new Set,c=n;for(let[r]of a){if(c<=e)break;if(i.has(r)||(t.edges.get(r)??[]).some(p=>!s.has(p)))continue;let d=t.nodes.get(r);d&&(s.add(r),c-=d.estimatedDuration)}this.lastPrunedCount=s.size;let u=Array.from(t.nodes.values()).filter(r=>!s.has(r.id));return this.buildTestDAG(u)}schedule(t){if(t.length===0)return{phases:[],totalEstimatedTime:0,criticalPathTime:0,parallelism:0};let e=this.buildTestDAG(t),o=this.findParallelBranches(e).map(u=>({tests:u,canRunInParallel:u.length>1})),a=this.computeCriticalPathDuration(e),i=this.sumDurations(e.nodes),s=o.reduce((u,r)=>r.canRunInParallel?u+Math.max(...r.tests.map(l=>l.estimatedDuration)):u+r.tests.reduce((l,d)=>l+d.estimatedDuration,0),0),c=s>0?i/s:1;return this.runCount++,{phases:o,totalEstimatedTime:s,criticalPathTime:a,parallelism:c}}getOptimizationStats(){return{totalTests:0,criticalPathLength:0,parallelGroupCount:0,prunedTests:this.lastPrunedCount,estimatedTimeSaved:0,historicalRuns:this.runCount,usingNativeBackend:!1}}recordExecution(t,e,n){this.executionHistory.push({testId:t,actualDuration:e,result:n,timestamp:Date.now()}),this.executionHistory.length>this.maxHistorySize&&(this.executionHistory=this.executionHistory.slice(-this.maxHistorySize));let o=this.learnedDurations.get(t);o!==void 0?this.learnedDurations.set(t,o*(1-this.learningRate)+e*this.learningRate):this.learnedDurations.set(t,e)}getLearnedDuration(t){return this.learnedDurations.get(t)}isNativeBackendAvailable(){return!1}computeCriticalPath(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map,a=new Map;for(let r of n)o.set(r,t.get(r).estimatedDuration),a.set(r,null);for(let r of n){let l=o.get(r);for(let d of e.get(r)??[]){let p=t.get(d);if(!p)continue;let g=l+p.estimatedDuration;g>(o.get(d)??0)&&(o.set(d,g),a.set(d,r))}}let i=0,s=null;for(let[r,l]of o)l>i&&(i=l,s=r);if(!s)return[];let c=[],u=s;for(;u!==null;)c.unshift(u),u=a.get(u)??null;return c}computeCriticalPathDuration(t){return t.criticalPath.reduce((e,n)=>e+(t.nodes.get(n)?.estimatedDuration??0),0)}computeParallelGroups(t,e){let n=this.topologicalSort(t,e);if(n.length===0)return[];let o=new Map;for(let[u,r]of t)o.set(u,new Set(r.dependencies));let a=new Map;for(let u of n){let r=-1;for(let l of o.get(u)??new Set){let d=a.get(l);d!==void 0&&d>r&&(r=d)}a.set(u,r+1)}let i=new Map;for(let u of n){let r=a.get(u)??0;i.has(r)||i.set(r,[]),i.get(r).push(u)}let s=Math.max(...Array.from(i.keys()),-1),c=[];for(let u=0;u<=s;u++){let r=i.get(u);r&&r.length>0&&c.push(r)}return c}computeAttentionScores(t){let e=new Map,n=this.countTransitiveDependents(t);for(let[o,a]of t.nodes){let i=a.lastResult==="fail"?2:1,s=n.get(o)??0;e.set(o,a.priority*i*(1+s))}return e}countTransitiveDependents(t){let e=new Map,n=new Map,o=a=>{if(n.has(a))return n.get(a);let i=new Set;for(let s of t.edges.get(a)??[]){i.add(s);for(let c of o(s))i.add(c)}return n.set(a,i),i};for(let a of t.nodes.keys())e.set(a,o(a).size);return e}topologicalSort(t,e){let n=new Map;for(let i of t.keys())n.set(i,0);for(let i of e.values())for(let s of i)n.has(s)&&n.set(s,(n.get(s)??0)+1);let o=[];for(let[i,s]of n)s===0&&o.push(i);let a=[];for(;o.length>0;){let i=o.shift();a.push(i);for(let s of e.get(i)??[]){let c=(n.get(s)??0)-1;n.set(s,c),c===0&&o.push(s)}}if(a.length!==t.size)throw new Error(`Cycle detected in test DAG: sorted ${a.length} of ${t.size} nodes`);return a}applyLearnedDuration(t){let e=this.learnedDurations.get(t.id);return e!==void 0?{...t,estimatedDuration:Math.round(e)}:t}sumDurations(t){let e=0;for(let n of t.values())e+=n.estimatedDuration;return e}};function m(f){return new h(f)}export{h as a,m 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.15.12");process.exit(0)}
2
- import{a as O,b as j}from"./chunk-U6IXYQO4.js";import{d as A,e as G}from"./chunk-SQVZ3TRU.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-A2JCRXTK.js";import{b as S,e as z}from"./chunk-W4II6SIH.js";import{b as g}from"./chunk-WDEXOLK2.js";import{createRequire as k}from"node:module";import{existsSync as W}from"node:fs";import{dirname as K,join as V}from"node:path";function B(i,e){return A(i,e,{cwd:process.cwd(),timeout:5e3})}function X(i=process.platform,e=process.execPath,t=W){return O("npm",i,e,t)??["npm",[]]}async function F(){try{return x.resolve("vibium")}catch{try{return k(V(process.cwd(),"package.json")).resolve("vibium")}catch{}let[i,e]=X(),t=(await B(i,[...e,"root","-g"])).trim();return x.resolve(V(t,"vibium"))}}function Y(i){return typeof i?.browser?.start=="function"?i:typeof i?.default?.browser?.start=="function"?i.default:null}async function _(){let i;try{i=await import("vibium")}catch(t){if(t.code!=="ERR_MODULE_NOT_FOUND"&&t.code!=="MODULE_NOT_FOUND")throw t;let r;try{r=await F()}catch(s){throw new Error(`Vibium is not installed; run ${l}`,{cause:s})}i=x(r)}let e=Y(i);if(!e)throw new Error(`Unsupported Vibium API: the installed package exposes no browser.start() (neither as a named nor a default export); run ${l}`);return e}async function P(){try{let i=V(K(await F()),"..","bin","cli.js");return await B(process.execPath,[i,"is-installed"]),!0}catch{return!1}}var l,x,M=g(()=>{"use strict";j();G();l="aqe init --browser-engine (or npm install vibium@^26.8.21)",x=k(import.meta.url)});var U,$=g(()=>{"use strict";U={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function Q(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return Q(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,m,p,v,b,w,d,f,D=g(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
+ import{a as O,b as j}from"./chunk-I3C7JOXC.js";import{d as A,e as G}from"./chunk-A64JFBWI.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-XPRVF4YE.js";import{b as S,e as z}from"./chunk-3Y2ROSCL.js";import{b as g}from"./chunk-ZAKQLAHT.js";import{createRequire as k}from"node:module";import{existsSync as W}from"node:fs";import{dirname as K,join as V}from"node:path";function B(i,e){return A(i,e,{cwd:process.cwd(),timeout:5e3})}function X(i=process.platform,e=process.execPath,t=W){return O("npm",i,e,t)??["npm",[]]}async function F(){try{return x.resolve("vibium")}catch{try{return k(V(process.cwd(),"package.json")).resolve("vibium")}catch{}let[i,e]=X(),t=(await B(i,[...e,"root","-g"])).trim();return x.resolve(V(t,"vibium"))}}function Y(i){return typeof i?.browser?.start=="function"?i:typeof i?.default?.browser?.start=="function"?i.default:null}async function _(){let i;try{i=await import("vibium")}catch(t){if(t.code!=="ERR_MODULE_NOT_FOUND"&&t.code!=="MODULE_NOT_FOUND")throw t;let r;try{r=await F()}catch(s){throw new Error(`Vibium is not installed; run ${l}`,{cause:s})}i=x(r)}let e=Y(i);if(!e)throw new Error(`Unsupported Vibium API: the installed package exposes no browser.start() (neither as a named nor a default export); run ${l}`);return e}async function P(){try{let i=V(K(await F()),"..","bin","cli.js");return await B(process.execPath,[i,"is-installed"]),!0}catch{return!1}}var l,x,M=g(()=>{"use strict";j();G();l="aqe init --browser-engine (or npm install vibium@^26.8.21)",x=k(import.meta.url)});var U,$=g(()=>{"use strict";U={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function Q(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return Q(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,m,p,v,b,w,d,f,D=g(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
3
3
  Caused by: ${s.stack}`)}code;cause},m=class extends o{constructor(e="Vibium MCP server is unavailable",t){super(e,"VIBIUM_UNAVAILABLE",t),this.name="VibiumUnavailableError"}},p=class extends o{constructor(e="Browser operation timed out",t){super(e,"VIBIUM_TIMEOUT",t),this.name="VibiumTimeoutError"}},v=class extends o{selector;constructor(e,t){super(`Element not found: ${e}`,"ELEMENT_NOT_FOUND",t),this.name="VibiumElementNotFoundError",this.selector=e}},b=class extends o{constructor(e="Failed to connect to browser",t){super(e,"CONNECTION_ERROR",t),this.name="VibiumConnectionError"}},w=class extends o{url;statusCode;constructor(e,t,r){let s=t?`Navigation failed: ${e} (HTTP ${t})`:`Navigation failed: ${e}`;super(s,"NAVIGATION_ERROR",r),this.name="VibiumNavigationError",this.url=e,this.statusCode=t}},d=class extends o{constructor(e="Failed to capture screenshot",t){super(e,"SCREENSHOT_ERROR",t),this.name="VibiumScreenshotError"}},f=class extends o{action;selector;constructor(e,t,r){super(`Failed to ${e} element: ${t}`,"INTERACTION_ERROR",r),this.name="VibiumInteractionError",this.action=e,this.selector=t}}});import{randomUUID as Z}from"crypto";async function C(){if(E!==null)return E;try{return E=(await _()).browser,L=!0,E}catch(i){return console.warn("[Vibium] Failed to load vibium package:",i),L=!1,null}}async function H(i,e,t){let r;for(let s=1;s<=e;s++)try{return await i()}catch(n){if(r=S(n),s<e){let u=Math.min(100*Math.pow(2,s-1),2e3);await new Promise(c=>setTimeout(c,u))}}throw new o(`${t} failed after ${e} attempts`,"RETRY_EXHAUSTED",r)}async function h(i,e){let t=Date.now();try{let r=await i();return I()&&console.log(`[Vibium] ${e}: ${Date.now()-t}ms`),r}catch(r){throw I()&&console.log(`[Vibium] ${e} failed: ${Date.now()-t}ms`,r),r}}var E,L,y,q,ee=g(()=>{M();$();D();z();J();E=null,L=!1;y=class{config;currentSession=null;lastHealthCheck=null;_initialized=!1;_available=null;vibeInstance=null;browserInstance=null;constructor(e={}){this.config={...U,...e}}async isAvailable(){if(!this.config.enabled)return!1;if(this._available!==null)return this._available;try{let e=await C();return this._available=e!==null&&await P(),this._available}catch{return this._available=!1,!1}}async getHealth(){let e=new Date;if(!this.config.enabled)return{status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium is disabled by configuration",sessionActive:!1};try{await this.isAvailable()?this.lastHealthCheck={status:this.vibeInstance?"connected":"disconnected",browserType:this.config.browserType,features:["browser-launch","navigation","element-interaction","screenshots","script-evaluation","accessibility-testing"],latencyMs:10,lastChecked:e,sessionActive:this.vibeInstance!==null}:this.lastHealthCheck={status:"unavailable",features:["fallback-only"],lastChecked:e,error:`Vibium runtime or browser payload unavailable; run ${l}`,sessionActive:!1}}catch(t){this.lastHealthCheck={status:"error",features:["fallback-only"],lastChecked:e,error:t instanceof Error?t.message:"Unknown error",sessionActive:!1}}return this.lastHealthCheck}async getSession(){return this.currentSession}async launch(e){if(!T())return{success:!1,error:new m("Browser mode is disabled by feature flags")};let t=async()=>{let r=await C();if(!r)throw new m(`Vibium runtime unavailable; run ${l}`);let s=e?.headless??this.config.headless;if(!await P())throw new m(`Vibium browser payload unavailable; run ${l}`);let n=await r.start({headless:s});try{this.vibeInstance=await n.page(),this.browserInstance=n}catch(c){throw await n.stop(),c}let u={id:this.generateSessionId(),browserType:this.config.browserType,launchedAt:new Date,status:"connected",viewport:e?.viewport??this.config.viewport,headless:s};return this.currentSession=u,u};try{return{success:!0,value:R()?await H(()=>h(t,"browser_launch"),this.config.retryAttempts,"browser_launch"):await h(t,"browser_launch")}}catch(r){return{success:!1,error:a(r,"Failed to launch browser")}}}async quit(){if(!this.vibeInstance)return{success:!1,error:new b("No active browser session")};let e=async()=>{this.vibeInstance&&(await this.browserInstance?.stop(),this.vibeInstance=null,this.browserInstance=null),this.currentSession=null};try{return await h(e,"browser_quit"),{success:!0,value:void 0}}catch(t){return{success:!1,error:a(t,"Failed to quit browser")}}}async navigate(e){this.ensureSession();let t=async()=>{let r=Date.now();await this.vibeInstance.go(e.url);let s="";try{s=await this.vibeInstance.evaluate("document.title")}catch{s="Unknown"}let n={url:e.url,statusCode:200,title:s,durationMs:Date.now()-r,success:!0};return this.currentSession&&(this.currentSession.currentUrl=e.url),n};try{return{success:!0,value:R()?await H(()=>h(t,"page_navigate"),this.config.retryAttempts,"page_navigate"):await h(t,"page_navigate")}}catch(r){return{success:!1,error:new w(e.url,void 0,r instanceof Error?r:void 0)}}}async getPageInfo(){this.ensureSession();try{let e=await this.vibeInstance.evaluate("window.location.href"),t=await this.vibeInstance.evaluate("document.title");return{success:!0,value:{url:e,title:t,viewport:this.config.viewport,loadState:"loaded"}}}catch(e){return{success:!1,error:a(e,"Failed to get page info")}}}async goBack(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.back()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go back")}}}async goForward(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.forward()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go forward")}}}async reload(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.location.reload()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to reload page")}}}async findElement(e){this.ensureSession();try{let t=await this.vibeInstance.find(e.selector,{timeout:e.timeout??this.config.timeout});return{success:!0,value:{selector:e.selector,tagName:t.info.tag,textContent:t.info.text,attributes:{},boundingBox:t.info.box,visible:!0,enabled:!0}}}catch(t){return{success:!1,error:new v(e.selector,t instanceof Error?t:void 0)}}}async findElements(e){this.ensureSession();try{let t=e.selector.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return{success:!0,value:(await this.vibeInstance.evaluate(`
4
4
  Array.from(document.querySelectorAll('${t}'))
5
5
  .map(el => ({
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.12");process.exit(0)}
2
- import{b as o}from"./chunk-WDEXOLK2.js";function s(n){return n instanceof Error?n.message:String(n)}function u(n){return n instanceof Error?n:new Error(String(n))}function a(n){return n instanceof r||typeof n=="object"&&n!==null&&n.callerError===!0}var r,e=o(()=>{"use strict";r=class extends Error{callerError=!0;constructor(t){super(t),this.name="CallerInputError"}}});export{s as a,u as b,r as c,a as d,e};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.13");process.exit(0)}
2
+ import{b as o}from"./chunk-ZAKQLAHT.js";function s(n){return n instanceof Error?n.message:String(n)}function u(n){return n instanceof Error?n:new Error(String(n))}function a(n){return n instanceof r||typeof n=="object"&&n!==null&&n.callerError===!0}var r,e=o(()=>{"use strict";r=class extends Error{callerError=!0;constructor(t){super(t),this.name="CallerInputError"}}});export{s as a,u as b,r as c,a as d,e};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.12");process.exit(0)}
2
- import{d as W,f as lt}from"./chunk-66PXR3NI.js";import{b as I,d as _e}from"./chunk-WTAUF6O4.js";import{a as K,b as $,c as V,d as he,e as pt}from"./chunk-SPC4RBLF.js";import{a as Y,c as gt}from"./chunk-WGTEZT7G.js";import{a as fe,d as x,e as Ne,f as Se}from"./chunk-IPA7K556.js";import{a as U,b as me,e as ut}from"./chunk-YUA6ZKKY.js";import{a as Re,c as Le,d as _t}from"./chunk-YWWMNTBF.js";import{a as Tt}from"./chunk-UJNGGFGX.js";import{c as ge}from"./chunk-ADUAJIAU.js";import{a as z,c as X,d as Et}from"./chunk-DZGPUGUG.js";import{d as pe,e as dt}from"./chunk-IA55PFLG.js";import{a as A,e as le}from"./chunk-W4II6SIH.js";import{b as R,d as ct}from"./chunk-WDEXOLK2.js";import{createHash as Oe}from"node:crypto";function ft(n){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(n)),e}function Nt(n){return typeof n=="string"?Buffer.from(n,"utf8"):n instanceof Uint8Array?Buffer.from(n):Buffer.from(Q(n),"utf8")}function Q(n){return n===null||typeof n!="object"?JSON.stringify(n)??"null":Array.isArray(n)?`[${n.map(Q).join(",")}]`:`{${Object.keys(n).sort().map(t=>`${JSON.stringify(t)}:${Q(n[t])}`).join(",")}}`}function Ae(...n){let e=Oe("sha256");for(let t of n)e.update(t);return e.digest()}function Ce(n,e,t){return Ae(mt,n,e,ft(t))}var mt,Ie,v,ve=R(()=>{"use strict";mt=Buffer.from("ruvector:chain:"),Ie=Oe("sha256").update("ruvector-proof-gate-v1").digest();v=class n{seq=0;prev=Ie;chain=[];payloadHashes=[];admit(e){let t=Ae(Nt(e)),s=Ce(this.prev,t,this.seq);this.prev=s,this.chain.push(s),this.payloadHashes.push(t);let r={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:s.toString("hex")};return this.seq+=1,r}verifyReceipt(e){return e.sequence>=0&&e.sequence<this.chain.length&&this.chain[e.sequence].toString("hex")===e.chainCommitment}chainRoot(){return this.prev.toString("hex")}get length(){return this.seq}get isEmpty(){return this.seq===0}verifyIntegrity(){if(this.chain.length!==this.payloadHashes.length)return!1;let e=Ie;for(let t=0;t<this.chain.length;t++){if(!Ce(e,this.payloadHashes[t],t).equals(this.chain[t]))return!1;e=this.chain[t]}return e.equals(this.prev)}toJSON(){return{seq:this.seq,head:this.prev.toString("hex"),chain:this.chain.map(e=>e.toString("hex")),payloadHashes:this.payloadHashes.map(e=>e.toString("hex"))}}static fromJSON(e){let t=new n;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let s of e.chain)t.chain.push(Buffer.from(s,"hex"));for(let s of e.payloadHashes)t.payloadHashes.push(Buffer.from(s,"hex"));return t}}});function b(n){if(!J.has(n))throw new Error(`Invalid table name: "${n}" is not in the allowlist`);return n}function Ft(n){let e=n.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${n}" has too many parts (max: schema.table)`);for(let t of e)if(!be.test(t))throw new Error(`Invalid SQL identifier: "${n}" \u2014 part "${t}" does not match pattern ${be}`);return n}var J,be,Z=R(()=>{"use strict";J=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","learning_evidence_manifests","learning_evidence_segments","learning_segment_edges","learning_evidence_admissions","pattern_manifest_lineage","pattern_segment_lineage","qe_agent_co_execution"]);be=/^[a-z_][a-z0-9_]{0,62}$/});function ye(n){n.exec(De),n.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.15.13");process.exit(0)}
2
+ import{d as W,f as lt}from"./chunk-7CMTY45A.js";import{b as I,d as _e}from"./chunk-VTOBUZL6.js";import{a as K,b as $,c as V,d as he,e as pt}from"./chunk-KDNJ4F3P.js";import{a as Y,c as gt}from"./chunk-JRRXCODW.js";import{a as fe,d as x,e as Ne,f as Se}from"./chunk-XNBOGCF3.js";import{a as U,b as me,e as ut}from"./chunk-TWDW32W2.js";import{a as Re,c as Le,d as _t}from"./chunk-TOQWL2ZF.js";import{a as Tt}from"./chunk-UT2VZ33P.js";import{c as ge}from"./chunk-GB6HBNH2.js";import{a as z,c as X,d as Et}from"./chunk-J2ZIFFM6.js";import{d as pe,e as dt}from"./chunk-DNDL7SOS.js";import{a as A,e as le}from"./chunk-3Y2ROSCL.js";import{b as R,d as ct}from"./chunk-ZAKQLAHT.js";import{createHash as Oe}from"node:crypto";function ft(n){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(n)),e}function Nt(n){return typeof n=="string"?Buffer.from(n,"utf8"):n instanceof Uint8Array?Buffer.from(n):Buffer.from(Q(n),"utf8")}function Q(n){return n===null||typeof n!="object"?JSON.stringify(n)??"null":Array.isArray(n)?`[${n.map(Q).join(",")}]`:`{${Object.keys(n).sort().map(t=>`${JSON.stringify(t)}:${Q(n[t])}`).join(",")}}`}function Ae(...n){let e=Oe("sha256");for(let t of n)e.update(t);return e.digest()}function Ce(n,e,t){return Ae(mt,n,e,ft(t))}var mt,Ie,v,ve=R(()=>{"use strict";mt=Buffer.from("ruvector:chain:"),Ie=Oe("sha256").update("ruvector-proof-gate-v1").digest();v=class n{seq=0;prev=Ie;chain=[];payloadHashes=[];admit(e){let t=Ae(Nt(e)),s=Ce(this.prev,t,this.seq);this.prev=s,this.chain.push(s),this.payloadHashes.push(t);let r={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:s.toString("hex")};return this.seq+=1,r}verifyReceipt(e){return e.sequence>=0&&e.sequence<this.chain.length&&this.chain[e.sequence].toString("hex")===e.chainCommitment}chainRoot(){return this.prev.toString("hex")}get length(){return this.seq}get isEmpty(){return this.seq===0}verifyIntegrity(){if(this.chain.length!==this.payloadHashes.length)return!1;let e=Ie;for(let t=0;t<this.chain.length;t++){if(!Ce(e,this.payloadHashes[t],t).equals(this.chain[t]))return!1;e=this.chain[t]}return e.equals(this.prev)}toJSON(){return{seq:this.seq,head:this.prev.toString("hex"),chain:this.chain.map(e=>e.toString("hex")),payloadHashes:this.payloadHashes.map(e=>e.toString("hex"))}}static fromJSON(e){let t=new n;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let s of e.chain)t.chain.push(Buffer.from(s,"hex"));for(let s of e.payloadHashes)t.payloadHashes.push(Buffer.from(s,"hex"));return t}}});function b(n){if(!J.has(n))throw new Error(`Invalid table name: "${n}" is not in the allowlist`);return n}function Ft(n){let e=n.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${n}" has too many parts (max: schema.table)`);for(let t of e)if(!be.test(t))throw new Error(`Invalid SQL identifier: "${n}" \u2014 part "${t}" does not match pattern ${be}`);return n}var J,be,Z=R(()=>{"use strict";J=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","learning_evidence_manifests","learning_evidence_segments","learning_segment_edges","learning_evidence_admissions","pattern_manifest_lineage","pattern_segment_lineage","qe_agent_co_execution"]);be=/^[a-z_][a-z0-9_]{0,62}$/});function ye(n){n.exec(De),n.exec(`
3
3
  INSERT OR IGNORE INTO learning_evidence_manifests (
4
4
  id, trajectory_id, trajectory_hash, manifest_hash, task_family,
5
5
  outcome, oracle_refs_json, source_kind, process_signals_json