agentic-qe 3.15.1 → 3.15.2

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 (359) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +43 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +5 -5
  5. package/dist/cli/chunks/adapter-EUIELRLI.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-XUHRLKWP.js → agent-booster-wasm-664M7426.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-CL7MJP5W.js → agent-handler-E47ITH45.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-F7RV72FC.js → agent-memory-branch-CFWVOJX3.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-LXRKHASR.js +2 -0
  10. package/dist/cli/chunks/{arena-GRRNK7IN.js → arena-JM3OY263.js} +4 -4
  11. package/dist/cli/chunks/{arena-LHLVOQHW.js → arena-ZU5CGBGH.js} +2 -2
  12. package/dist/cli/chunks/{audit-EOP2K34L.js → audit-HVBRC5AS.js} +3 -3
  13. package/dist/cli/chunks/base-4DSLX33Y.js +2 -0
  14. package/dist/cli/chunks/{better-sqlite3-YERQ5DOL.js → better-sqlite3-45JLBQX3.js} +2 -2
  15. package/dist/cli/chunks/{brain-handler-FBXBM5XE.js → brain-handler-FKDONZYA.js} +3 -3
  16. package/dist/cli/chunks/{branch-enumerator-NWO6LNHB.js → branch-enumerator-M3DPS3D5.js} +2 -2
  17. package/dist/cli/chunks/{browser-EDCG7TNF.js → browser-TG2TV6NR.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-AWCQLQZK.js +2 -0
  19. package/dist/cli/chunks/{chunk-WYE3ICSL.js → chunk-2AOAEMJG.js} +2 -2
  20. package/dist/cli/chunks/{chunk-PZDI7WQ3.js → chunk-2AWU2E6R.js} +1 -1
  21. package/dist/cli/chunks/{chunk-VLL7ASGH.js → chunk-2B2MGJ2W.js} +2 -2
  22. package/dist/cli/chunks/{chunk-GAKVCN3C.js → chunk-2JEPRQMT.js} +1 -1
  23. package/dist/cli/chunks/{chunk-53HWWWFZ.js → chunk-2Q4Y3VQ6.js} +2 -2
  24. package/dist/cli/chunks/{chunk-NS4RIZ4F.js → chunk-326V7N25.js} +1 -1
  25. package/dist/cli/chunks/{chunk-HU4QGCIJ.js → chunk-3DCRAW43.js} +2 -2
  26. package/dist/cli/chunks/{chunk-ARWSPV2C.js → chunk-3KTAMNKI.js} +2 -2
  27. package/dist/cli/chunks/{chunk-NF6SLLE6.js → chunk-3KXKJSKS.js} +2 -2
  28. package/dist/cli/chunks/{chunk-SRXXPZVT.js → chunk-3RC5UMRJ.js} +2 -2
  29. package/dist/cli/chunks/{chunk-LDDIYDIP.js → chunk-3XF7YTQC.js} +48 -48
  30. package/dist/cli/chunks/{chunk-4KSCJ462.js → chunk-4MCO43NX.js} +1 -1
  31. package/dist/cli/chunks/{chunk-6MGJMGAD.js → chunk-55T7PDYP.js} +2 -2
  32. package/dist/cli/chunks/{chunk-J2WALRWR.js → chunk-56CE7UO4.js} +2 -2
  33. package/dist/cli/chunks/{chunk-X6W35QXO.js → chunk-5DFPAJ5O.js} +2 -2
  34. package/dist/cli/chunks/{chunk-46DUU44C.js → chunk-5TEPPW4J.js} +2 -2
  35. package/dist/cli/chunks/{chunk-5TEDVUEB.js → chunk-5YS2DF5G.js} +2 -2
  36. package/dist/cli/chunks/chunk-6KEYA4EH.js +316 -0
  37. package/dist/cli/chunks/{chunk-FRGNM6SW.js → chunk-6O4KVU4K.js} +2 -2
  38. package/dist/cli/chunks/{chunk-54JYUOSR.js → chunk-6OL2WES5.js} +1 -1
  39. package/dist/cli/chunks/{chunk-DREYYJ7A.js → chunk-6UO5YSNN.js} +2 -2
  40. package/dist/cli/chunks/{chunk-4P7CGSRL.js → chunk-6WVEICL2.js} +3 -3
  41. package/dist/cli/chunks/{chunk-GUKBN3BS.js → chunk-6XLCFDIB.js} +2 -2
  42. package/dist/cli/chunks/{chunk-VGYLV6VD.js → chunk-7UA7SMM4.js} +1 -1
  43. package/dist/cli/chunks/{chunk-JYF3QF4C.js → chunk-A6L2OCMO.js} +2 -2
  44. package/dist/cli/chunks/{chunk-KTBA2HJC.js → chunk-ANI3KPB7.js} +2 -2
  45. package/dist/cli/chunks/{chunk-YTMWPGVR.js → chunk-AR5V7VNC.js} +1 -1
  46. package/dist/cli/chunks/{chunk-T5K6ZCA6.js → chunk-AS27JP67.js} +1 -1
  47. package/dist/cli/chunks/{chunk-C3BW3Q27.js → chunk-ATGIGJSL.js} +1 -1
  48. package/dist/cli/chunks/{chunk-CTLHNFPM.js → chunk-AXJ75X6I.js} +1 -1
  49. package/dist/cli/chunks/{chunk-TBCQWD5A.js → chunk-B4H66LPR.js} +1 -1
  50. package/dist/cli/chunks/{chunk-PGARKOE6.js → chunk-BKZSTZDB.js} +1 -1
  51. package/dist/cli/chunks/{chunk-4THIRDBL.js → chunk-BT6TZTCL.js} +2 -2
  52. package/dist/cli/chunks/{chunk-2IPBCXTT.js → chunk-CFDIYZGA.js} +2 -2
  53. package/dist/cli/chunks/{chunk-HVAYG54D.js → chunk-CRYZXTSQ.js} +2 -2
  54. package/dist/cli/chunks/{chunk-7FGSX4UD.js → chunk-CV7E627D.js} +2 -2
  55. package/dist/cli/chunks/{chunk-PNK5KHSI.js → chunk-D75HDHX3.js} +1 -1
  56. package/dist/cli/chunks/{chunk-N5OSH5JO.js → chunk-DGKPGRBT.js} +2 -2
  57. package/dist/cli/chunks/{chunk-4KHSWNFW.js → chunk-DHSGCI6H.js} +4 -4
  58. package/dist/cli/chunks/{chunk-UOHZRR5C.js → chunk-DNS37AHW.js} +1 -1
  59. package/dist/cli/chunks/{chunk-R2ICZKQA.js → chunk-E2QHUMCR.js} +2 -2
  60. package/dist/cli/chunks/{chunk-V3ISBQ5Q.js → chunk-E6GANSLP.js} +2 -2
  61. package/dist/cli/chunks/{chunk-7B3XVVYP.js → chunk-EATZW5T2.js} +2 -2
  62. package/dist/cli/chunks/{chunk-JHKMUY4W.js → chunk-EDRIROCG.js} +2 -2
  63. package/dist/cli/chunks/{chunk-REGPCPEJ.js → chunk-EQG3JYSV.js} +2 -2
  64. package/dist/cli/chunks/{chunk-35XRY6ZW.js → chunk-FCMCQ6OX.js} +9 -9
  65. package/dist/cli/chunks/{chunk-UE33MZOC.js → chunk-FH6N2LKG.js} +2 -2
  66. package/dist/cli/chunks/{chunk-D3LREV4P.js → chunk-FNPZINHV.js} +1 -1
  67. package/dist/cli/chunks/{chunk-OPBPFNBO.js → chunk-FRZVLRVR.js} +2 -2
  68. package/dist/cli/chunks/{chunk-PBWR2SKH.js → chunk-GDSLQTJC.js} +2 -2
  69. package/dist/cli/chunks/{chunk-OABFAREV.js → chunk-GHXNRF63.js} +2 -2
  70. package/dist/cli/chunks/{chunk-3TZRJ5QD.js → chunk-GJ7DON5S.js} +3 -3
  71. package/dist/cli/chunks/{chunk-PZBYZV5M.js → chunk-GJTH6VBH.js} +1 -1
  72. package/dist/cli/chunks/{chunk-6AVVC7Y3.js → chunk-GSC6JXDE.js} +1 -1
  73. package/dist/cli/chunks/{chunk-6WW6A6JM.js → chunk-HADOG2PT.js} +2 -2
  74. package/dist/cli/chunks/{chunk-6DF6X3SZ.js → chunk-HBMBO4FD.js} +2 -2
  75. package/dist/cli/chunks/{chunk-WONHFDWF.js → chunk-HFF5ERIE.js} +2 -2
  76. package/dist/cli/chunks/{chunk-QVTV47TM.js → chunk-HMDSBWF6.js} +2 -2
  77. package/dist/cli/chunks/{chunk-5JJWVFUV.js → chunk-HOBBYORR.js} +1 -1
  78. package/dist/cli/chunks/{chunk-JSHASVQ2.js → chunk-HS3O763N.js} +3 -3
  79. package/dist/cli/chunks/{chunk-SUFXUM6W.js → chunk-HSXLHNSS.js} +2 -2
  80. package/dist/cli/chunks/{chunk-FIIHSEXP.js → chunk-HXT4XDQO.js} +2 -2
  81. package/dist/cli/chunks/{chunk-PDLVO3ZR.js → chunk-HYWW4A2E.js} +2 -2
  82. package/dist/cli/chunks/chunk-I7ECEOFV.js +2 -0
  83. package/dist/cli/chunks/{chunk-JEXPSOT2.js → chunk-I7J2ESGR.js} +2 -2
  84. package/dist/cli/chunks/{chunk-IUGY6Z4Q.js → chunk-IAOB2G3X.js} +2 -2
  85. package/dist/cli/chunks/{chunk-A5LOELVV.js → chunk-IBAXNCR2.js} +2 -2
  86. package/dist/cli/chunks/{chunk-NTLWHLAY.js → chunk-IHKRKRAV.js} +1 -1
  87. package/dist/cli/chunks/{chunk-W5NHBYYS.js → chunk-IM67YHDK.js} +2 -2
  88. package/dist/cli/chunks/{chunk-RXKOZ6VS.js → chunk-IQB5ZBYO.js} +3 -3
  89. package/dist/cli/chunks/{chunk-NGDRSF6Y.js → chunk-IT753IPZ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-WPG6SW7C.js → chunk-ITM26I6O.js} +2 -2
  91. package/dist/cli/chunks/{chunk-W5HQQTVH.js → chunk-J4EJMAH3.js} +1 -1
  92. package/dist/cli/chunks/{chunk-5QEXDXHQ.js → chunk-JCB6K24D.js} +2 -2
  93. package/dist/cli/chunks/{chunk-XZGRHJGC.js → chunk-JFFVYCTV.js} +2 -2
  94. package/dist/cli/chunks/{chunk-WHBDSJUE.js → chunk-JIRX6KUR.js} +3 -3
  95. package/dist/cli/chunks/{chunk-TCJ65NPY.js → chunk-JSTKSPYT.js} +1 -1
  96. package/dist/cli/chunks/{chunk-NK2BR4QZ.js → chunk-KQMCCHPO.js} +2 -2
  97. package/dist/cli/chunks/{chunk-FQYXPSWD.js → chunk-KTLYL3BS.js} +2 -2
  98. package/dist/cli/chunks/{chunk-K4NB3MYN.js → chunk-L77Z3Q6L.js} +2 -2
  99. package/dist/cli/chunks/{chunk-BW7S6LIJ.js → chunk-LH3H4V7C.js} +2 -2
  100. package/dist/cli/chunks/{chunk-Q7ONRZBD.js → chunk-LRVR56PD.js} +1 -1
  101. package/dist/cli/chunks/{chunk-P24ZBDZY.js → chunk-LVDZ25VX.js} +2 -2
  102. package/dist/cli/chunks/{chunk-TR37Q7A6.js → chunk-LW4BCFIV.js} +2 -2
  103. package/dist/cli/chunks/{chunk-RDI3W4H6.js → chunk-M36DAETL.js} +2 -2
  104. package/dist/cli/chunks/{chunk-KP6LNSDO.js → chunk-MDDECCAC.js} +10 -10
  105. package/dist/cli/chunks/{chunk-ZX4I7IND.js → chunk-MEUJWTOX.js} +2 -2
  106. package/dist/cli/chunks/{chunk-QMHWJBD3.js → chunk-MOSXT6AO.js} +2 -2
  107. package/dist/cli/chunks/{chunk-WTFVYFRZ.js → chunk-MY2XZHW3.js} +1 -1
  108. package/dist/cli/chunks/{chunk-25IWHVMW.js → chunk-MYDZBABD.js} +2 -2
  109. package/dist/cli/chunks/{chunk-DKWB4ERY.js → chunk-N4MNSEKY.js} +1 -1
  110. package/dist/cli/chunks/{chunk-YM3GAJMN.js → chunk-N653RGT3.js} +2 -2
  111. package/dist/cli/chunks/{chunk-5B5TA3X4.js → chunk-NBV37CEK.js} +2 -2
  112. package/dist/cli/chunks/{chunk-OKS25EGZ.js → chunk-NKWMTXBL.js} +3 -3
  113. package/dist/cli/chunks/{chunk-L5GEWKR3.js → chunk-NL6HKEPR.js} +3 -3
  114. package/dist/cli/chunks/{chunk-FTHXV7N7.js → chunk-NLY5NUHZ.js} +2 -2
  115. package/dist/cli/chunks/{chunk-LI7N45GM.js → chunk-NP2WWIZ3.js} +1 -1
  116. package/dist/cli/chunks/{chunk-V5RP2SU3.js → chunk-NWYAV2UG.js} +2 -2
  117. package/dist/cli/chunks/{chunk-MEOAKMKF.js → chunk-O6QTCUSL.js} +1 -1
  118. package/dist/cli/chunks/{chunk-GDSYJHVB.js → chunk-OWZ3F7DJ.js} +1 -1
  119. package/dist/cli/chunks/{chunk-OH4SKOAM.js → chunk-PZK7O445.js} +2 -2
  120. package/dist/cli/chunks/{chunk-6U6JQS4Z.js → chunk-Q32UGPWK.js} +2 -2
  121. package/dist/cli/chunks/{chunk-X4PGLEPQ.js → chunk-QB7H62A4.js} +2 -2
  122. package/dist/cli/chunks/{chunk-KHVWIUAF.js → chunk-QGCFMACF.js} +2 -2
  123. package/dist/cli/chunks/{chunk-J4ULR4QR.js → chunk-QJGKL67W.js} +3 -3
  124. package/dist/cli/chunks/{chunk-YWX7KLNG.js → chunk-QJN5RW2U.js} +3 -3
  125. package/dist/cli/chunks/{chunk-KBK4GBJQ.js → chunk-QR5ILM34.js} +2 -2
  126. package/dist/cli/chunks/{chunk-3NOSMJS4.js → chunk-QZNFZ5IQ.js} +2 -2
  127. package/dist/cli/chunks/{chunk-ALLABEUK.js → chunk-RIAKRZCZ.js} +2 -2
  128. package/dist/cli/chunks/{chunk-27S47AYK.js → chunk-RLQ4MYB6.js} +2 -2
  129. package/dist/cli/chunks/{chunk-JY6HWYC4.js → chunk-RO6HAZLV.js} +1 -1
  130. package/dist/cli/chunks/{chunk-VEKRK3R6.js → chunk-SKQTRYE7.js} +2 -2
  131. package/dist/cli/chunks/{chunk-N4HQ6FE2.js → chunk-SVHFSOGT.js} +1 -1
  132. package/dist/cli/chunks/{chunk-4AEFJEZH.js → chunk-SZYK5JL7.js} +1 -1
  133. package/dist/cli/chunks/{chunk-NWNZMXNO.js → chunk-T5N2PIPS.js} +2 -2
  134. package/dist/cli/chunks/{chunk-TLUMENRZ.js → chunk-T75PWWK4.js} +2 -2
  135. package/dist/cli/chunks/{chunk-XCVD57GW.js → chunk-TC4B5D4Z.js} +1 -1
  136. package/dist/cli/chunks/{chunk-CFZJEOCD.js → chunk-TMYGGYRY.js} +1 -1
  137. package/dist/cli/chunks/{chunk-CTK7NMSJ.js → chunk-TZH2QAFZ.js} +2 -2
  138. package/dist/cli/chunks/{chunk-66HKJJFH.js → chunk-UKRK3IE3.js} +2 -2
  139. package/dist/cli/chunks/{chunk-5C4UYXQL.js → chunk-URWT3EQT.js} +2 -2
  140. package/dist/cli/chunks/{chunk-JQVECGYL.js → chunk-UX4BOI6K.js} +1 -1
  141. package/dist/cli/chunks/{chunk-GUHJWBPN.js → chunk-UZL4JYVW.js} +2 -2
  142. package/dist/cli/chunks/{chunk-QOOADAT7.js → chunk-V67UQRQN.js} +2 -2
  143. package/dist/cli/chunks/{chunk-TJCMG3QE.js → chunk-VTGAPHJE.js} +2 -2
  144. package/dist/cli/chunks/{chunk-JW2HNT3J.js → chunk-W5EKSBS4.js} +2 -2
  145. package/dist/cli/chunks/{chunk-ZZV6GR46.js → chunk-W6PLBRRS.js} +1 -1
  146. package/dist/cli/chunks/{chunk-ARGMYSDY.js → chunk-W7P7EOJ4.js} +1 -1
  147. package/dist/cli/chunks/{chunk-W6K77PQR.js → chunk-WBCE6V2N.js} +1 -1
  148. package/dist/cli/chunks/{chunk-WQZR6DS6.js → chunk-WBZIOTY6.js} +2 -2
  149. package/dist/cli/chunks/{chunk-UTFNHITI.js → chunk-WJ7657IX.js} +2 -2
  150. package/dist/cli/chunks/{chunk-4XEZ562Q.js → chunk-WMNVFCKY.js} +2 -2
  151. package/dist/cli/chunks/{chunk-AVOYMVD6.js → chunk-WUSSZ2S6.js} +2 -2
  152. package/dist/cli/chunks/{chunk-YDMPTCJ3.js → chunk-X43HA3RF.js} +2 -2
  153. package/dist/cli/chunks/{chunk-ZE6WJDXM.js → chunk-X4CADOSD.js} +2 -2
  154. package/dist/cli/chunks/{chunk-6Q7PWKWV.js → chunk-XQBH3366.js} +2 -2
  155. package/dist/cli/chunks/{chunk-CHX65QXY.js → chunk-Y5VPLOA7.js} +1 -1
  156. package/dist/cli/chunks/{chunk-UGUZFUQG.js → chunk-YH7VOLBP.js} +2 -2
  157. package/dist/cli/chunks/{chunk-B3DWOR5R.js → chunk-YJSKT6G6.js} +1 -1
  158. package/dist/cli/chunks/{chunk-YDM2DPUU.js → chunk-YYVLMW65.js} +2 -2
  159. package/dist/cli/chunks/{chunk-53C7TGC4.js → chunk-Z3K4JZXQ.js} +1 -1
  160. package/dist/cli/chunks/{chunk-LQI5GVH7.js → chunk-Z3PANQUT.js} +1 -1
  161. package/dist/cli/chunks/{chunk-DV7I6CRH.js → chunk-Z7XCXHEB.js} +2 -2
  162. package/dist/cli/chunks/{chunk-ADEYBXAS.js → chunk-ZIKH7U5A.js} +2 -2
  163. package/dist/cli/chunks/{chunk-EQ3BJS37.js → chunk-ZSKQPXRW.js} +1 -1
  164. package/dist/cli/chunks/{chunk-WFDDWRWY.js → chunk-ZVQSIH7Y.js} +5 -5
  165. package/dist/cli/chunks/{ci-K7DG4GSO.js → ci-JNBOR6FP.js} +3 -3
  166. package/dist/cli/chunks/{ci-output-EBSUG6HP.js → ci-output-FYNKONEQ.js} +2 -2
  167. package/dist/cli/chunks/{circuit-breaker-P6N6YIRZ.js → circuit-breaker-KOIXRDAD.js} +2 -2
  168. package/dist/cli/chunks/{claude-flow-setup-P6EZPQZT.js → claude-flow-setup-4CO7KHRN.js} +2 -2
  169. package/dist/cli/chunks/client-UJVHZXNQ.js +2 -0
  170. package/dist/cli/chunks/{cline-installer-EVZZ3EFY.js → cline-installer-CMYAPKK5.js} +2 -2
  171. package/dist/cli/chunks/{code-3WLBG2XK.js → code-WFIAEP3H.js} +3 -3
  172. package/dist/cli/chunks/{code-index-extractor-ZP6D4WL2.js → code-index-extractor-IYM6HWJN.js} +2 -2
  173. package/dist/cli/chunks/{codex-installer-XAUI4SB7.js → codex-installer-DORVWRSU.js} +2 -2
  174. package/dist/cli/chunks/{completions-RHFNDDG3.js → completions-54VM2MX2.js} +2 -2
  175. package/dist/cli/chunks/{complexity-analyzer-DCW7Q3OR.js → complexity-analyzer-EGZDP5N4.js} +2 -2
  176. package/dist/cli/chunks/{continuedev-installer-53SQA5T6.js → continuedev-installer-4SDVDD4T.js} +2 -2
  177. package/dist/cli/chunks/{copilot-installer-SXXMFB6T.js → copilot-installer-7FJQ7PCL.js} +2 -2
  178. package/dist/cli/chunks/core-handlers-AFXZOSH3.js +2 -0
  179. package/dist/cli/chunks/{cost-tracker-CKLDQ5AZ.js → cost-tracker-D6YSKTQC.js} +2 -2
  180. package/dist/cli/chunks/{coverage-AWCS2SP7.js → coverage-DI5LDRJ7.js} +3 -3
  181. package/dist/cli/chunks/cross-domain-router-ZLNVKLIR.js +2 -0
  182. package/dist/cli/chunks/{cursor-installer-4TYF5V5J.js → cursor-installer-RTSZP5YD.js} +2 -2
  183. package/dist/cli/chunks/{daemon-CTZXGN5V.js → daemon-LM7LETPV.js} +4 -4
  184. package/dist/cli/chunks/{daemon-OOY4H6RJ.js → daemon-SP3APEZY.js} +3 -3
  185. package/dist/cli/chunks/{dag-attention-scheduler-3WG24Q33.js → dag-attention-scheduler-C3QBODFE.js} +2 -2
  186. package/dist/cli/chunks/{detect-O7MUZ6NX.js → detect-I4RBUFFJ.js} +2 -2
  187. package/dist/cli/chunks/{dist-node-H4XI7BAF.js → dist-node-PT6TCBCO.js} +2 -2
  188. package/dist/cli/chunks/{domain-handler-FU4WZ23B.js → domain-handler-MJMTMB5X.js} +2 -2
  189. package/dist/cli/chunks/{domain-plugins-XK26KYNJ.js → domain-plugins-Y4A2WYJW.js} +2 -2
  190. package/dist/cli/chunks/{domain-transfer-6B5NOVH6.js → domain-transfer-DUO42TLA.js} +2 -2
  191. package/dist/cli/chunks/dream-4OPJXXEG.js +2 -0
  192. package/dist/cli/chunks/{embed-and-insert-pattern-XNZXPZNL.js → embed-and-insert-pattern-66ZQK4AI.js} +2 -2
  193. package/dist/cli/chunks/{eval-J3Q5TTI7.js → eval-NQ7H27UF.js} +2 -2
  194. package/dist/cli/chunks/{experience-capture-middleware-COKIGMXW.js → experience-capture-middleware-MHEYPTIG.js} +3 -3
  195. package/dist/cli/chunks/{fast-paths-IHWPJI6I.js → fast-paths-YYDGN6ZC.js} +2 -2
  196. package/dist/cli/chunks/{feature-flags-G7ONDNTT.js → feature-flags-FY4DOYS2.js} +2 -2
  197. package/dist/cli/chunks/{feature-flags-WUXFWZLR.js → feature-flags-YFGUORHY.js} +2 -2
  198. package/dist/cli/chunks/{file-discovery-JN3YMBOJ.js → file-discovery-TOMDY7TK.js} +2 -2
  199. package/dist/cli/chunks/{fleet-OUHUZJE4.js → fleet-MO3UCWB4.js} +3 -3
  200. package/dist/cli/chunks/{gnn-wrapper-PRH55ZT6.js → gnn-wrapper-SLW4PPXQ.js} +2 -2
  201. package/dist/cli/chunks/{heartbeat-handler-6YF35AQS.js → heartbeat-handler-36RFCP4E.js} +4 -4
  202. package/dist/cli/chunks/heartbeat-scheduler-J5KLHO6C.js +2 -0
  203. package/dist/cli/chunks/hnsw-adapter-56P6XSFR.js +2 -0
  204. package/dist/cli/chunks/hnsw-index-GFZ6XCEW.js +2 -0
  205. package/dist/cli/chunks/{hnsw-legacy-bridge-7PAFSTJO.js → hnsw-legacy-bridge-BJLWBKHE.js} +2 -2
  206. package/dist/cli/chunks/{hnswlib-node-UETDZNNN.js → hnswlib-node-RAYNVJCJ.js} +2 -2
  207. package/dist/cli/chunks/{hooks-QQNUKQAS.js → hooks-JMHFWVEQ.js} +10 -10
  208. package/dist/cli/chunks/hybrid-backend-TUBWJDDN.js +2 -0
  209. package/dist/cli/chunks/{hypergraph-engine-5GDGE3ET.js → hypergraph-engine-JUDBKPOX.js} +2 -2
  210. package/dist/cli/chunks/{hypergraph-handler-C3F2OJYA.js → hypergraph-handler-AXTWXOZU.js} +3 -3
  211. package/dist/cli/chunks/impact-analyzer-FXVGKS6B.js +2 -0
  212. package/dist/cli/chunks/init-handler-PARJNZFF.js +86 -0
  213. package/dist/cli/chunks/init-wizard-LK73HQ7W.js +2 -0
  214. package/dist/cli/chunks/kernel-TCZDKRSI.js +2 -0
  215. package/dist/cli/chunks/{kilocode-installer-VLJENC76.js → kilocode-installer-22HX2E4V.js} +2 -2
  216. package/dist/cli/chunks/{kiro-installer-UYPYM6LA.js → kiro-installer-OVPBLY7J.js} +2 -2
  217. package/dist/cli/chunks/knowledge-graph-TWMB2GH2.js +2 -0
  218. package/dist/cli/chunks/{learning-SFIWIG6Z.js → learning-DWXPJ3R6.js} +3 -3
  219. package/dist/cli/chunks/{llm-router-V633KAS5.js → llm-router-7PPVVKNG.js} +4 -4
  220. package/dist/cli/chunks/llm-router-service-HPDH3P77.js +2 -0
  221. package/dist/cli/chunks/{load-UWZV4JRA.js → load-VI5XHNZA.js} +2 -2
  222. package/dist/cli/chunks/load-test-HTYOUYSN.js +2 -0
  223. package/dist/cli/chunks/{mcp-XVFHUKCP.js → mcp-UW4Z3Z64.js} +2 -2
  224. package/dist/cli/chunks/{memory-BQ5652VK.js → memory-UD2KCB5M.js} +5 -5
  225. package/dist/cli/chunks/memory-backend-X5BE2MPK.js +2 -0
  226. package/dist/cli/chunks/{memory-handlers-PWI3G4P4.js → memory-handlers-SQXMFX5X.js} +2 -2
  227. package/dist/cli/chunks/{multi-model-executor-X6AQ7VVR.js → multi-model-executor-5O4WWU5Z.js} +2 -2
  228. package/dist/cli/chunks/{opencode-installer-N3V2Z4EF.js → opencode-installer-DTRFDGM7.js} +2 -2
  229. package/dist/cli/chunks/{orchestrator-KNEKS4F7.js → orchestrator-ENJIKV6Z.js} +18 -18
  230. package/dist/cli/chunks/pattern-null-store-OCQGQZU6.js +2 -0
  231. package/dist/cli/chunks/{pattern-usage-recorder-MZIM6XWU.js → pattern-usage-recorder-QPNIU5PD.js} +2 -2
  232. package/dist/cli/chunks/{pipeline-LNLBKSXR.js → pipeline-G3JYDNPE.js} +2 -2
  233. package/dist/cli/chunks/{platform-OMUDXHD3.js → platform-P4WR6N3D.js} +2 -2
  234. package/dist/cli/chunks/{plugin-HGY6KKZW.js → plugin-C7763Q5W.js} +2 -2
  235. package/dist/cli/chunks/{prime-radiant-advanced-wasm-LZBHLQYN.js → prime-radiant-advanced-wasm-DH6R3XSZ.js} +2 -2
  236. package/dist/cli/chunks/{project-root-VPSCDBMD.js → project-root-7DTXDLEG.js} +2 -2
  237. package/dist/cli/chunks/protocol-executor-CYEQHQCL.js +2 -0
  238. package/dist/cli/chunks/{protocol-handler-LZXT3TXU.js → protocol-handler-EODULGOZ.js} +2 -2
  239. package/dist/cli/chunks/{prove-I4VKQEYQ.js → prove-A7G3SIOF.js} +2 -2
  240. package/dist/cli/chunks/qe-reasoning-bank-GSTA5WJ4.js +2 -0
  241. package/dist/cli/chunks/{quality-VVAWK2DD.js → quality-JTURFUX3.js} +2 -2
  242. package/dist/cli/chunks/{quality-gate-RGXLWYT6.js → quality-gate-M2EI754V.js} +3 -3
  243. package/dist/cli/chunks/queen-coordinator-Y2Q5RQL7.js +2 -0
  244. package/dist/cli/chunks/{real-embeddings-WM66PMQ6.js → real-embeddings-DI7JMCG7.js} +2 -2
  245. package/dist/cli/chunks/{ref-validation-ZIWJNI6M.js → ref-validation-MSFMNKDR.js} +2 -2
  246. package/dist/cli/chunks/{roocode-installer-QYSI3STC.js → roocode-installer-XIMFFHOH.js} +2 -2
  247. package/dist/cli/chunks/router-4QB5L4IW.js +2 -0
  248. package/dist/cli/chunks/routing-feedback-YBVHJY5L.js +2 -0
  249. package/dist/cli/chunks/{routing-handler-BID3EOLE.js → routing-handler-MCDKNBQW.js} +2 -2
  250. package/dist/cli/chunks/{ruvector-commands-DXIFMF4W.js → ruvector-commands-OBSYAK2X.js} +2 -2
  251. package/dist/cli/chunks/rvf-dual-writer-T5B456SW.js +2 -0
  252. package/dist/cli/chunks/rvf-migration-adapter-2O2NL7ZF.js +2 -0
  253. package/dist/cli/chunks/{rvf-migration-coordinator-EV5E6SAO.js → rvf-migration-coordinator-4DTRIHY6.js} +2 -2
  254. package/dist/cli/chunks/rvf-native-adapter-RDB3GWTW.js +2 -0
  255. package/dist/cli/chunks/{rvf-store-integrity-IT6DCCJK.js → rvf-store-integrity-CWAVMRC4.js} +2 -2
  256. package/dist/cli/chunks/safe-db-YXVMLFU4.js +2 -0
  257. package/dist/cli/chunks/schedule-K6XWCCSK.js +2 -0
  258. package/dist/cli/chunks/scheduler-4MW22D6Q.js +2 -0
  259. package/dist/cli/chunks/{security-AAFAEATQ.js → security-74TWSO74.js} +3 -3
  260. package/dist/cli/chunks/{shared-rvf-adapter-QIHSYHAF.js → shared-rvf-adapter-ZHNAGE5H.js} +2 -2
  261. package/dist/cli/chunks/{shared-rvf-dual-writer-V7OZ6TBR.js → shared-rvf-dual-writer-BS5WAVCC.js} +2 -2
  262. package/dist/cli/chunks/sqlite-persistence-UVDHUSAU.js +2 -0
  263. package/dist/cli/chunks/{standalone-memory-ALZI6VPX.js → standalone-memory-3HGHTE7S.js} +2 -2
  264. package/dist/cli/chunks/{status-handler-DED5A3OW.js → status-handler-XWEEGNGH.js} +2 -2
  265. package/dist/cli/chunks/{structural-health-CB7L3NWH.js → structural-health-TB5JGMVS.js} +2 -2
  266. package/dist/cli/chunks/{sync-S6Z2U46T.js → sync-LSPNSVDI.js} +2 -2
  267. package/dist/cli/chunks/{sync-QNPGETIO.js → sync-T4VLBURM.js} +2 -2
  268. package/dist/cli/chunks/{task-handler-CGHXYFIF.js → task-handler-RQ65QKXX.js} +2 -2
  269. package/dist/cli/chunks/{task-handlers-A6BGQJIB.js → task-handlers-USYWJ4H2.js} +3 -3
  270. package/dist/cli/chunks/test-M2XTKD62.js +33 -0
  271. package/dist/cli/chunks/{test-scheduling-FKYX4OLF.js → test-scheduling-GYXJQHJL.js} +3 -3
  272. package/dist/cli/chunks/{token-bootstrap-OKO3JEKT.js → token-bootstrap-OTEMRUFR.js} +2 -2
  273. package/dist/cli/chunks/{token-usage-25BRFKJ5.js → token-usage-CISTB5K5.js} +2 -2
  274. package/dist/cli/chunks/{transformers-TBVVSZMF.js → transformers-C7LV763N.js} +2 -2
  275. package/dist/cli/chunks/{tree-sitter-wasm-parser-N7KCOQT4.js → tree-sitter-wasm-parser-P26JC3YV.js} +2 -2
  276. package/dist/cli/chunks/{types-TFHWJGRK.js → types-YMVMKIWB.js} +2 -2
  277. package/dist/cli/chunks/unified-memory-UUK77NSE.js +2 -0
  278. package/dist/cli/chunks/unified-memory-hnsw-JOUE6WNF.js +2 -0
  279. package/dist/cli/chunks/unified-persistence-3DRJGNQE.js +2 -0
  280. package/dist/cli/chunks/{upgrade-4VWQU7RD.js → upgrade-U2REOPAW.js} +2 -2
  281. package/dist/cli/chunks/{validate-FF7WVXMP.js → validate-NDTCKN7P.js} +2 -2
  282. package/dist/cli/chunks/{validate-swarm-NRLH4EDC.js → validate-swarm-OJUGVH5Q.js} +2 -2
  283. package/dist/cli/chunks/visual-security-EM7FQG5X.js +2 -0
  284. package/dist/cli/chunks/{web-tree-sitter-VVU3LULW.js → web-tree-sitter-2CLRSA7K.js} +2 -2
  285. package/dist/cli/chunks/{windsurf-installer-Q2ZNWG2D.js → windsurf-installer-DSUJJ4PG.js} +2 -2
  286. package/dist/cli/chunks/witness-chain-7NZ6IIUN.js +2 -0
  287. package/dist/cli/chunks/{witness-chain-FP3D4PQL.js → witness-chain-TEGL4ZWB.js} +2 -2
  288. package/dist/cli/chunks/{witness-chain-repair-3LG4BF7C.js → witness-chain-repair-ZWS5WXFL.js} +2 -2
  289. package/dist/cli/chunks/{witness-chain-verifier-LACGL6BK.js → witness-chain-verifier-SPXKFC67.js} +2 -2
  290. package/dist/cli/chunks/{witness-key-manager-GQZIB5ZE.js → witness-key-manager-EALOV4OV.js} +2 -2
  291. package/dist/cli/chunks/{workflow-JPA5Y7L6.js → workflow-PYI6HCAG.js} +4 -4
  292. package/dist/cli/chunks/workflow-orchestrator-3C3S5FIM.js +2 -0
  293. package/dist/cli/chunks/{wrappers-2B5NHICD.js → wrappers-NXJHGK3W.js} +2 -2
  294. package/dist/cli/commands/test.js +17 -2
  295. package/dist/cli/handlers/init-flags.d.ts +45 -0
  296. package/dist/cli/handlers/init-flags.js +35 -0
  297. package/dist/cli/handlers/init-handler.d.ts +6 -0
  298. package/dist/cli/handlers/init-handler.js +24 -10
  299. package/dist/coordination/task-executor.js +4 -2
  300. package/dist/init/claude-plugin-detection.d.ts +63 -0
  301. package/dist/init/claude-plugin-detection.js +118 -0
  302. package/dist/init/init-wizard-hooks.d.ts +6 -1
  303. package/dist/init/init-wizard-hooks.js +9 -1
  304. package/dist/init/init-wizard.d.ts +4 -0
  305. package/dist/init/init-wizard.js +3 -1
  306. package/dist/init/orchestrator.js +1 -0
  307. package/dist/init/phases/08-mcp.d.ts +7 -0
  308. package/dist/init/phases/08-mcp.js +22 -0
  309. package/dist/init/phases/phase-interface.d.ts +5 -1
  310. package/dist/mcp/bundle.js +298 -298
  311. package/dist/mcp/handlers/domain-handler-configs.js +3 -1
  312. package/dist/mcp/handlers/handler-factory.js +5 -0
  313. package/dist/mcp/handlers/save-results-option.d.ts +35 -0
  314. package/dist/mcp/handlers/save-results-option.js +59 -0
  315. package/dist/mcp/protocol-server.js +2 -1
  316. package/dist/mcp/types.d.ts +9 -0
  317. package/package.json +1 -1
  318. package/dist/cli/chunks/adapter-Q6RPGMUE.js +0 -2
  319. package/dist/cli/chunks/aqe-learning-engine-JQPXIU7C.js +0 -2
  320. package/dist/cli/chunks/base-5SK64NXB.js +0 -2
  321. package/dist/cli/chunks/browser-workflow-WN7XNTCJ.js +0 -2
  322. package/dist/cli/chunks/chunk-2K3QFLX2.js +0 -2
  323. package/dist/cli/chunks/chunk-XYZUBAR6.js +0 -316
  324. package/dist/cli/chunks/client-ZYH66YRI.js +0 -2
  325. package/dist/cli/chunks/core-handlers-XKSPHEHE.js +0 -2
  326. package/dist/cli/chunks/cross-domain-router-6VYNFQZA.js +0 -2
  327. package/dist/cli/chunks/dream-DRSSIHPP.js +0 -2
  328. package/dist/cli/chunks/heartbeat-scheduler-FMICCNWK.js +0 -2
  329. package/dist/cli/chunks/hnsw-adapter-4TGBNJEZ.js +0 -2
  330. package/dist/cli/chunks/hnsw-index-J4NSCPAZ.js +0 -2
  331. package/dist/cli/chunks/hybrid-backend-NKPA3QE7.js +0 -2
  332. package/dist/cli/chunks/impact-analyzer-MWX7XY7X.js +0 -2
  333. package/dist/cli/chunks/init-handler-C7ZBDAC5.js +0 -81
  334. package/dist/cli/chunks/init-wizard-EX5N5Q7X.js +0 -2
  335. package/dist/cli/chunks/kernel-EQLZDHDD.js +0 -2
  336. package/dist/cli/chunks/knowledge-graph-A3WSMQ6U.js +0 -2
  337. package/dist/cli/chunks/llm-router-service-A6XYWTL6.js +0 -2
  338. package/dist/cli/chunks/load-test-WF2PCXLI.js +0 -2
  339. package/dist/cli/chunks/memory-backend-BKGLI2RF.js +0 -2
  340. package/dist/cli/chunks/pattern-null-store-YTBLEH7D.js +0 -2
  341. package/dist/cli/chunks/protocol-executor-HFR2D54O.js +0 -2
  342. package/dist/cli/chunks/qe-reasoning-bank-MYFBQUYV.js +0 -2
  343. package/dist/cli/chunks/queen-coordinator-CQQMOTIW.js +0 -2
  344. package/dist/cli/chunks/router-GKWLPA3N.js +0 -2
  345. package/dist/cli/chunks/routing-feedback-WA4D5JRF.js +0 -2
  346. package/dist/cli/chunks/rvf-dual-writer-H3ZXS5MA.js +0 -2
  347. package/dist/cli/chunks/rvf-migration-adapter-J7MTCOQA.js +0 -2
  348. package/dist/cli/chunks/rvf-native-adapter-HXBY4VYI.js +0 -2
  349. package/dist/cli/chunks/safe-db-INVJ5LHR.js +0 -2
  350. package/dist/cli/chunks/schedule-XRIPPL52.js +0 -2
  351. package/dist/cli/chunks/scheduler-HBN3KPRW.js +0 -2
  352. package/dist/cli/chunks/sqlite-persistence-6KNLT5Q2.js +0 -2
  353. package/dist/cli/chunks/test-IISTF5W6.js +0 -33
  354. package/dist/cli/chunks/unified-memory-WVELSL6T.js +0 -2
  355. package/dist/cli/chunks/unified-memory-hnsw-7P5MVKXD.js +0 -2
  356. package/dist/cli/chunks/unified-persistence-YLFCEWYY.js +0 -2
  357. package/dist/cli/chunks/visual-security-T5OM742H.js +0 -2
  358. package/dist/cli/chunks/witness-chain-D6X4OZP5.js +0 -2
  359. package/dist/cli/chunks/workflow-orchestrator-OORDDKT3.js +0 -2
@@ -940,7 +940,7 @@
940
940
  },
941
941
  "metadata": {
942
942
  "generatedBy": "Agentic QE Fleet",
943
- "fleetVersion": "3.15.1",
943
+ "fleetVersion": "3.15.2",
944
944
  "manifestVersion": "1.4.0",
945
945
  "lastUpdated": "2026-04-13T00:00:00.000Z",
946
946
  "contributors": [
package/CHANGELOG.md CHANGED
@@ -5,6 +5,49 @@ All notable changes to the Agentic QE project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.15.2] - 2026-10-10
9
+
10
+ This hardening patch fixes problems found by installing the
11
+ `agentic-qe-fleet` plugin from the marketplace into a fresh project and
12
+ using it end to end.
13
+
14
+ ### Fixed
15
+
16
+ - **No duplicate AQE MCP server.** When the `agentic-qe-fleet` plugin is
17
+ enabled, `aqe init` no longer also adds its own `agentic-qe` server to the
18
+ project's `.mcp.json`, so AQE is registered only once. If your project
19
+ already has that entry, init keeps it and tells you how to remove it. Use
20
+ `aqe init --with-mcp` to add the project entry anyway ([#922]).
21
+ - **`aqe init --no-mcp` and `--no-governance` now work.** Both flags were
22
+ ignored before: init still wrote the MCP entry and the governance files.
23
+ Combining `--no-mcp` with `--with-mcp` now stops with a clear error
24
+ ([#931], [#935]).
25
+ - **aqe-mod reports its real version.** The status file and the ruflo
26
+ console now show the plugin version instead of `0.1.0` ([#923]).
27
+ - **aqe-mod remembers past refusals.** `/aqe-mod status` now shows totals
28
+ across sessions and the most recent refusal, not just the current
29
+ session's counts. The command text is never stored ([#924]).
30
+ - **aqe-mod status file handling is hardened.** The mod no longer follows
31
+ symbolic links when reading or writing its status file, and it validates
32
+ what it reads back ([#930]).
33
+ - **Test generation can skip saving results.** `test_generate_enhanced` (and
34
+ the other MCP tools that save results) accept `saveResults: false` to skip
35
+ writing reports under `.agentic-qe/results/`. The tool description now says
36
+ results are saved by default. `aqe test generate --no-save` prints the
37
+ generated tests instead of writing files ([#925]).
38
+ - **No broken `ruflo` plugin entry in this repository.** The vendored `ruflo`
39
+ skill is now just its `SKILL.md`, so Claude Code no longer lists a broken
40
+ skills-directory plugin when you work in this repo ([#926]).
41
+
42
+ [#922]: https://github.com/proffesor-for-testing/agentic-qe/issues/922
43
+ [#923]: https://github.com/proffesor-for-testing/agentic-qe/issues/923
44
+ [#924]: https://github.com/proffesor-for-testing/agentic-qe/issues/924
45
+ [#925]: https://github.com/proffesor-for-testing/agentic-qe/issues/925
46
+ [#926]: https://github.com/proffesor-for-testing/agentic-qe/issues/926
47
+ [#930]: https://github.com/proffesor-for-testing/agentic-qe/pull/930
48
+ [#931]: https://github.com/proffesor-for-testing/agentic-qe/issues/931
49
+ [#935]: https://github.com/proffesor-for-testing/agentic-qe/issues/935
50
+
8
51
  ## [3.15.1] - 2026-10-10
9
52
 
10
53
  This patch hardens the aqe-mod guard that ships with the `agentic-qe-fleet`
@@ -940,7 +940,7 @@
940
940
  },
941
941
  "metadata": {
942
942
  "generatedBy": "Agentic QE Fleet",
943
- "fleetVersion": "3.15.1",
943
+ "fleetVersion": "3.15.2",
944
944
  "manifestVersion": "1.4.0",
945
945
  "lastUpdated": "2026-04-13T00:00:00.000Z",
946
946
  "contributors": [
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env node
2
- 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.1");process.exit(0)}
3
- import{b}from"./chunks/chunk-W5HQQTVH.js";import{b as v,c as E,e as A}from"./chunks/chunk-IUGY6Z4Q.js";import{d as P}from"./chunks/chunk-WONHFDWF.js";import{a as C}from"./chunks/chunk-PZDI7WQ3.js";import{b as L,c as y,d as I}from"./chunks/chunk-UGUZFUQG.js";import{a as W}from"./chunks/chunk-2K3QFLX2.js";import{b as k,c as F}from"./chunks/chunk-7FGSX4UD.js";import"./chunks/chunk-46DUU44C.js";import{a as g,e as T}from"./chunks/chunk-ARWSPV2C.js";import{Q as w,S as H}from"./chunks/chunk-HU4QGCIJ.js";import{h as S}from"./chunks/chunk-OABFAREV.js";import"./chunks/chunk-25IWHVMW.js";import"./chunks/chunk-TCJ65NPY.js";import"./chunks/chunk-YM3GAJMN.js";import"./chunks/chunk-PNK5KHSI.js";T();H();import{createRequire as G}from"node:module";import{Command as j}from"commander";import l from"chalk";W();F();I();var x=!1;function h(){if(!x){x=!0;try{P()}catch{}try{S()}catch{}try{L()}catch{}}}function D(e,a,c,i){let m=e.command(a).description(c);if(i)for(let u of i)m.alias(u);return m.helpOption(!1),m.allowUnknownOption(!0),m.allowExcessArguments(!0),m}function R(e,a){let c=e.commands,i=c.indexOf(a);i>=0&&c.splice(i,1)}function n(e,a){let c=D(e,a.name,a.description,a.aliases);c.action(async()=>{try{let i=await a.factory();R(e,c),e.addCommand(i),await e.parseAsync(process.argv)}catch(i){console.error(`Failed to load command '${a.name}':`,i instanceof Error?i.message:i),process.exit(1)}})}function d(e,a,c,i,m,u){let f=D(e,a,c,u);f.action(async()=>{try{let p=await i();R(e,f),p.register(e,m),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${a}':`,p instanceof Error?p.message:p),process.exit(1)}})}I();A();process.on("exit",h);var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function q(e,a){let c=e.getDomainAPI("visual-accessibility");if(c?.registerWorkflowActions)try{c.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register visual-accessibility workflow actions: ${g(m)}`))}let i=e.getDomainAPI("requirements-validation");if(i?.registerWorkflowActions)try{i.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register requirements-validation workflow actions: ${g(m)}`))}}async function B(){let{QEKernelImpl:e}=await import("./chunks/kernel-EQLZDHDD.js"),{CrossDomainEventRouter:a}=await import("./chunks/cross-domain-router-6VYNFQZA.js"),{DefaultProtocolExecutor:c}=await import("./chunks/protocol-executor-HFR2D54O.js"),{WorkflowOrchestrator:i}=await import("./chunks/workflow-orchestrator-OORDDKT3.js"),{createQueenCoordinator:m}=await import("./chunks/queen-coordinator-CQQMOTIW.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-HBN3KPRW.js"),{loadCLIDomainPlugins:f}=await import("./chunks/domain-plugins-XK26KYNJ.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...C],enableExperienceBridge:!1}),await t.kernel.initialize();let p=await f(t.kernel.plugins);t.router=new a(t.kernel.eventBus),await t.router.initialize();let O=_=>t.kernel.getDomainAPI(_),V=new c(t.kernel.eventBus,t.kernel.memory,O);t.workflowOrchestrator=new i(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),q(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=m(t.kernel,t.router,V,void 0,p),await t.queen.initialize();let{adoptExternalFleet:M}=await import("./chunks/core-handlers-XKSPHEHE.js");M({kernel:t.kernel,queen:t.queen,router:t.router,workflowOrchestrator:t.workflowOrchestrator}),t.initialized=!0}async function Q(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),a=await import("path"),{findProjectRoot:c}=await import("./chunks/project-root-VPSCDBMD.js"),i=a.join(c(),".agentic-qe");return e.existsSync(i)?s():(console.error(l.red(`
2
+ 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.2");process.exit(0)}
3
+ import{b}from"./chunks/chunk-J4EJMAH3.js";import{b as v,c as E,e as A}from"./chunks/chunk-IAOB2G3X.js";import{d as P}from"./chunks/chunk-HFF5ERIE.js";import{a as C}from"./chunks/chunk-2AWU2E6R.js";import{b as L,c as y,d as I}from"./chunks/chunk-YH7VOLBP.js";import{a as W}from"./chunks/chunk-I7ECEOFV.js";import{b as k,c as F}from"./chunks/chunk-CV7E627D.js";import"./chunks/chunk-5TEPPW4J.js";import{a as g,e as T}from"./chunks/chunk-3KTAMNKI.js";import{Q as w,S as H}from"./chunks/chunk-3DCRAW43.js";import{h as S}from"./chunks/chunk-GHXNRF63.js";import"./chunks/chunk-MYDZBABD.js";import"./chunks/chunk-JSTKSPYT.js";import"./chunks/chunk-N653RGT3.js";import"./chunks/chunk-D75HDHX3.js";T();H();import{createRequire as G}from"node:module";import{Command as j}from"commander";import l from"chalk";W();F();I();var x=!1;function h(){if(!x){x=!0;try{P()}catch{}try{S()}catch{}try{L()}catch{}}}function D(e,a,c,i){let m=e.command(a).description(c);if(i)for(let u of i)m.alias(u);return m.helpOption(!1),m.allowUnknownOption(!0),m.allowExcessArguments(!0),m}function R(e,a){let c=e.commands,i=c.indexOf(a);i>=0&&c.splice(i,1)}function n(e,a){let c=D(e,a.name,a.description,a.aliases);c.action(async()=>{try{let i=await a.factory();R(e,c),e.addCommand(i),await e.parseAsync(process.argv)}catch(i){console.error(`Failed to load command '${a.name}':`,i instanceof Error?i.message:i),process.exit(1)}})}function d(e,a,c,i,m,u){let f=D(e,a,c,u);f.action(async()=>{try{let p=await i();R(e,f),p.register(e,m),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${a}':`,p instanceof Error?p.message:p),process.exit(1)}})}I();A();process.on("exit",h);var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function q(e,a){let c=e.getDomainAPI("visual-accessibility");if(c?.registerWorkflowActions)try{c.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register visual-accessibility workflow actions: ${g(m)}`))}let i=e.getDomainAPI("requirements-validation");if(i?.registerWorkflowActions)try{i.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register requirements-validation workflow actions: ${g(m)}`))}}async function B(){let{QEKernelImpl:e}=await import("./chunks/kernel-TCZDKRSI.js"),{CrossDomainEventRouter:a}=await import("./chunks/cross-domain-router-ZLNVKLIR.js"),{DefaultProtocolExecutor:c}=await import("./chunks/protocol-executor-CYEQHQCL.js"),{WorkflowOrchestrator:i}=await import("./chunks/workflow-orchestrator-3C3S5FIM.js"),{createQueenCoordinator:m}=await import("./chunks/queen-coordinator-Y2Q5RQL7.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-4MW22D6Q.js"),{loadCLIDomainPlugins:f}=await import("./chunks/domain-plugins-Y4A2WYJW.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...C],enableExperienceBridge:!1}),await t.kernel.initialize();let p=await f(t.kernel.plugins);t.router=new a(t.kernel.eventBus),await t.router.initialize();let O=_=>t.kernel.getDomainAPI(_),V=new c(t.kernel.eventBus,t.kernel.memory,O);t.workflowOrchestrator=new i(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),q(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=m(t.kernel,t.router,V,void 0,p),await t.queen.initialize();let{adoptExternalFleet:M}=await import("./chunks/core-handlers-AFXZOSH3.js");M({kernel:t.kernel,queen:t.queen,router:t.router,workflowOrchestrator:t.workflowOrchestrator}),t.initialized=!0}async function Q(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),a=await import("path"),{findProjectRoot:c}=await import("./chunks/project-root-7DTXDLEG.js"),i=a.join(c(),".agentic-qe");return e.existsSync(i)?s():(console.error(l.red(`
4
4
  Error: AQE system not initialized in this directory.`)),console.log(l.yellow("Run `aqe init` first to set up this project.\n")),process.exitCode=1,!1)}async function s(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=E(1);e&&process.stderr.write(l.gray("Auto-initializing v3 system...")+`
5
5
  `);let a=3e4,c=new Promise((i,m)=>{setTimeout(()=>m(new Error("Initialization timeout after 30 seconds")),a)});try{return await Promise.race([B(),c]),e&&process.stderr.write(l.green("System ready")+`
6
6
 
7
- `),!0}catch(i){return i.message.includes("timeout")?(console.error(l.red("Initialization timed out after 30 seconds.")),console.log(l.yellow("Try running `aqe init` manually."))):(console.error(l.red("Failed to auto-initialize:"),i),console.log(l.yellow("Try running `aqe init` manually."))),process.exitCode=1,!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}h(),process.exit(e)}var r=new j,N=G(import.meta.url),de=N("../../package.json").version,z="3.15.1";r.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(z).addHelpText("after",`
7
+ `),!0}catch(i){return i.message.includes("timeout")?(console.error(l.red("Initialization timed out after 30 seconds.")),console.log(l.yellow("Try running `aqe init` manually."))):(console.error(l.red("Failed to auto-initialize:"),i),console.log(l.yellow("Try running `aqe init` manually."))),process.exitCode=1,!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}h(),process.exit(e)}var r=new j,N=G(import.meta.url),de=N("../../package.json").version,z="3.15.2";r.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(z).addHelpText("after",`
8
8
  Environment:
9
9
  AQE_LOG_LEVEL Internal log level: debug | info | warn | error | silent (default: warn)
10
10
  LOG_LEVEL Same as AQE_LOG_LEVEL; AQE_LOG_LEVEL takes precedence
11
11
  AQE_VERBOSE=1 Shorthand for info-level logging (full system-init output)
12
- Diagnostics are written to stderr; stdout carries command output only.`);r.hook("preAction",(e,a)=>{v(a.opts())});d(r,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-C7ZBDAC5.js").then(e=>e.createInitHandler(o)),t);d(r,"status","Show system status",()=>import("./chunks/status-handler-DED5A3OW.js").then(e=>e.createStatusHandler(o,Q)),t);d(r,"health","Check system health",()=>import("./chunks/status-handler-DED5A3OW.js").then(e=>e.createHealthHandler(o,Q)),t);d(r,"task","Manage QE tasks",()=>import("./chunks/task-handler-CGHXYFIF.js").then(e=>e.createTaskHandler(o,s)),t);d(r,"agent","Manage QE agents",()=>import("./chunks/agent-handler-CL7MJP5W.js").then(e=>e.createAgentHandler(o,s)),t);d(r,"domain","Domain operations",()=>import("./chunks/domain-handler-FU4WZ23B.js").then(e=>e.createDomainHandler(o,s)),t);d(r,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-LZXT3TXU.js").then(e=>e.createProtocolHandler(o,s)),t);d(r,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-FBXBM5XE.js").then(e=>e.createBrainHandler(o,s)),t);d(r,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-C3F2OJYA.js").then(e=>e.createHypergraphHandler(o,s)),t,["hg"]);d(r,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-6YF35AQS.js").then(e=>e.createHeartbeatHandler(o)),t);d(r,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-BID3EOLE.js").then(e=>e.createRoutingHandler(o)),t);n(r,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-JPA5Y7L6.js").then(e=>e.createWorkflowCommand(t,o,s))});n(r,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-IISTF5W6.js").then(e=>e.createTestCommand(t,o,s))});n(r,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-AWCS2SP7.js").then(e=>e.createCoverageCommand(t,o,s))});n(r,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-VVAWK2DD.js").then(e=>e.createQualityCommand(t,o,s))});n(r,{name:"quality-gate",description:"Two-gate, three-valued quality verdict against a pinned checklist (ADR-119)",factory:()=>import("./chunks/quality-gate-RGXLWYT6.js").then(e=>e.createQualityGateCommand(t,o,s))});n(r,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-AAFAEATQ.js").then(e=>e.createSecurityCommand(t,o,s))});n(r,{name:"arena",description:"Competitive test-strategy tournaments (ADR-104)",factory:()=>import("./chunks/arena-GRRNK7IN.js").then(e=>e.createArenaCommand(t,o,s))});n(r,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-3WLBG2XK.js").then(e=>e.createCodeCommand(t,o,s))});n(r,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-RHFNDDG3.js").then(e=>e.createCompletionsCommand(o))});n(r,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-4VWQU7RD.js").then(e=>e.createUpgradeCommand(o))});n(r,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-OUHUZJE4.js").then(e=>e.createFleetCommand(t,o,s,q))});n(r,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-NRLH4EDC.js").then(e=>e.createValidateSwarmCommand(t,o,s))});n(r,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-FF7WVXMP.js").then(e=>e.createValidateCommand(t,o,s))});n(r,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-J3Q5TTI7.js").then(e=>e.createEvalCommand())});n(r,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-K7DG4GSO.js").then(e=>e.createCICommand(t,o,s))});n(r,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-25BRFKJ5.js").then(e=>e.createTokenUsageCommand())});n(r,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-V633KAS5.js").then(e=>e.createLLMRouterCommand())});n(r,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-QNPGETIO.js").then(e=>e.createSyncCommands())});n(r,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-QQNUKQAS.js").then(e=>e.createHooksCommand())});n(r,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-SFIWIG6Z.js").then(e=>e.createLearningCommand())});n(r,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>Promise.all([import("./chunks/memory-BQ5652VK.js"),import("./chunks/standalone-memory-ALZI6VPX.js")]).then(([e,a])=>e.createMemoryCommand(t,o,a.createEnsureMemoryBackend(t)))});n(r,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-XVFHUKCP.js").then(e=>e.createMcpCommand())});n(r,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-OMUDXHD3.js").then(e=>e.createPlatformCommand())});n(r,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-I4VKQEYQ.js").then(e=>e.createProveCommand(t,o,s))});n(r,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-DXIFMF4W.js").then(e=>e.createRuVectorCommand())});n(r,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-EOP2K34L.js").then(e=>e.createAuditCommand(t,o,s))});n(r,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-LNLBKSXR.js").then(e=>e.createPipelineCommand(t,o,s))});n(r,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-HGY6KKZW.js").then(e=>e.createPluginCommand())});n(r,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-OOY4H6RJ.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{y("SIGINT")||(console.log(l.yellow(`
12
+ Diagnostics are written to stderr; stdout carries command output only.`);r.hook("preAction",(e,a)=>{v(a.opts())});d(r,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-PARJNZFF.js").then(e=>e.createInitHandler(o)),t);d(r,"status","Show system status",()=>import("./chunks/status-handler-XWEEGNGH.js").then(e=>e.createStatusHandler(o,Q)),t);d(r,"health","Check system health",()=>import("./chunks/status-handler-XWEEGNGH.js").then(e=>e.createHealthHandler(o,Q)),t);d(r,"task","Manage QE tasks",()=>import("./chunks/task-handler-RQ65QKXX.js").then(e=>e.createTaskHandler(o,s)),t);d(r,"agent","Manage QE agents",()=>import("./chunks/agent-handler-E47ITH45.js").then(e=>e.createAgentHandler(o,s)),t);d(r,"domain","Domain operations",()=>import("./chunks/domain-handler-MJMTMB5X.js").then(e=>e.createDomainHandler(o,s)),t);d(r,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-EODULGOZ.js").then(e=>e.createProtocolHandler(o,s)),t);d(r,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-FKDONZYA.js").then(e=>e.createBrainHandler(o,s)),t);d(r,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-AXTWXOZU.js").then(e=>e.createHypergraphHandler(o,s)),t,["hg"]);d(r,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-36RFCP4E.js").then(e=>e.createHeartbeatHandler(o)),t);d(r,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-MCDKNBQW.js").then(e=>e.createRoutingHandler(o)),t);n(r,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-PYI6HCAG.js").then(e=>e.createWorkflowCommand(t,o,s))});n(r,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-M2XTKD62.js").then(e=>e.createTestCommand(t,o,s))});n(r,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-DI5LDRJ7.js").then(e=>e.createCoverageCommand(t,o,s))});n(r,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-JTURFUX3.js").then(e=>e.createQualityCommand(t,o,s))});n(r,{name:"quality-gate",description:"Two-gate, three-valued quality verdict against a pinned checklist (ADR-119)",factory:()=>import("./chunks/quality-gate-M2EI754V.js").then(e=>e.createQualityGateCommand(t,o,s))});n(r,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-74TWSO74.js").then(e=>e.createSecurityCommand(t,o,s))});n(r,{name:"arena",description:"Competitive test-strategy tournaments (ADR-104)",factory:()=>import("./chunks/arena-JM3OY263.js").then(e=>e.createArenaCommand(t,o,s))});n(r,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-WFIAEP3H.js").then(e=>e.createCodeCommand(t,o,s))});n(r,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-54VM2MX2.js").then(e=>e.createCompletionsCommand(o))});n(r,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-U2REOPAW.js").then(e=>e.createUpgradeCommand(o))});n(r,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-MO3UCWB4.js").then(e=>e.createFleetCommand(t,o,s,q))});n(r,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-OJUGVH5Q.js").then(e=>e.createValidateSwarmCommand(t,o,s))});n(r,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-NDTCKN7P.js").then(e=>e.createValidateCommand(t,o,s))});n(r,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-NQ7H27UF.js").then(e=>e.createEvalCommand())});n(r,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-JNBOR6FP.js").then(e=>e.createCICommand(t,o,s))});n(r,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-CISTB5K5.js").then(e=>e.createTokenUsageCommand())});n(r,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-7PPVVKNG.js").then(e=>e.createLLMRouterCommand())});n(r,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-T4VLBURM.js").then(e=>e.createSyncCommands())});n(r,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-JMHFWVEQ.js").then(e=>e.createHooksCommand())});n(r,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-DWXPJ3R6.js").then(e=>e.createLearningCommand())});n(r,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>Promise.all([import("./chunks/memory-UD2KCB5M.js"),import("./chunks/standalone-memory-3HGHTE7S.js")]).then(([e,a])=>e.createMemoryCommand(t,o,a.createEnsureMemoryBackend(t)))});n(r,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-UW4Z3Z64.js").then(e=>e.createMcpCommand())});n(r,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-P4WR6N3D.js").then(e=>e.createPlatformCommand())});n(r,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-A7G3SIOF.js").then(e=>e.createProveCommand(t,o,s))});n(r,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-OBSYAK2X.js").then(e=>e.createRuVectorCommand())});n(r,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-HVBRC5AS.js").then(e=>e.createAuditCommand(t,o,s))});n(r,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-G3JYDNPE.js").then(e=>e.createPipelineCommand(t,o,s))});n(r,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-C7763Q5W.js").then(e=>e.createPluginCommand())});n(r,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-SP3APEZY.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{y("SIGINT")||(console.log(l.yellow(`
13
13
 
14
14
  Shutting down...`)),console.log(l.green(`Shutdown complete
15
15
  `)),await o(0))});process.on("SIGTERM",async()=>{y("SIGTERM")||(console.log(l.yellow(`
16
- Received SIGTERM, shutting down gracefully...`)),await o(0))});async function U(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-IHWPJI6I.js");e(process.argv)&&(console.log(z),process.exit(0)),w();let a=process.argv.slice(2).filter(i=>i!=="--");if(!(a[0]==="learning"&&(a[1]==="backup"||a[1]==="restore"))){let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-OKO3JEKT.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"})}await r.parseAsync(),!b()&&await o(process.exitCode??0)}U().catch(async e=>{console.error(l.red("Fatal error:"),k(e)),await o(1)});
16
+ Received SIGTERM, shutting down gracefully...`)),await o(0))});async function U(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-YYDGN6ZC.js");e(process.argv)&&(console.log(z),process.exit(0)),w();let a=process.argv.slice(2).filter(i=>i!=="--");if(!(a[0]==="learning"&&(a[1]==="backup"||a[1]==="restore"))){let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-OTEMRUFR.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"})}await r.parseAsync(),!b()&&await o(process.exitCode??0)}U().catch(async e=>{console.error(l.red("Fatal error:"),k(e)),await o(1)});
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a,b,c}from"./chunk-NL6HKEPR.js";import"./chunk-WMNVFCKY.js";import"./chunk-GJTH6VBH.js";import"./chunk-URWT3EQT.js";import"./chunk-3KTAMNKI.js";import"./chunk-D75HDHX3.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -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.1");process.exit(0)}
2
- import{a as x}from"./chunk-2K3QFLX2.js";import{e as f}from"./chunk-7FGSX4UD.js";import"./chunk-46DUU44C.js";import"./chunk-PNK5KHSI.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
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.2");process.exit(0)}
2
+ import{a as x}from"./chunk-I7ECEOFV.js";import{e as f}from"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-D75HDHX3.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
@@ -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.1");process.exit(0)}
2
- import{b as p}from"./chunk-6MGJMGAD.js";import{a as g}from"./chunk-C3BW3Q27.js";import"./chunk-5C4UYXQL.js";import"./chunk-PNK5KHSI.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{b as p}from"./chunk-55T7PDYP.js";import{a as g}from"./chunk-ATGIGJSL.js";import"./chunk-URWT3EQT.js";import"./chunk-D75HDHX3.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
3
3
  Agents (${a.length})
4
4
  `)),a.length===0)console.log(s.gray(" No agents found"));else{let e=new Map;for(let i of a)e.has(i.domain)||e.set(i.domain,[]),e.get(i.domain).push(i);let o=Array.from(e.entries());for(let[i,m]of o){console.log(s.cyan(` ${i}:`));for(let r of m)console.log(` ${r.id}`),console.log(` Type: ${r.type}`),console.log(` Status: ${g(r.status)}`),r.startedAt&&console.log(s.gray(` Started: ${r.startedAt.toISOString()}`));console.log("")}}}catch(a){console.error(s.red(`
5
5
  Failed to list agents:`),a),await this.cleanupAndExit(1)}}async executeSpawn(n,t,a){if(await this.ensureInitialized())try{let e=t.capabilities.split(",");console.log(s.blue(`
@@ -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.1");process.exit(0)}
2
- import"./chunk-PNK5KHSI.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
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.2");process.exit(0)}
2
+ import"./chunk-D75HDHX3.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a,b,c,d,e,f}from"./chunk-GJ7DON5S.js";import"./chunk-HSXLHNSS.js";import"./chunk-NKWMTXBL.js";import"./chunk-Y5VPLOA7.js";import"./chunk-DHSGCI6H.js";import"./chunk-M36DAETL.js";import"./chunk-YJSKT6G6.js";import"./chunk-BKZSTZDB.js";import"./chunk-TC4B5D4Z.js";import"./chunk-JCB6K24D.js";import"./chunk-DGKPGRBT.js";import"./chunk-ZSKQPXRW.js";import"./chunk-CRYZXTSQ.js";import"./chunk-UKRK3IE3.js";import"./chunk-WBCE6V2N.js";import"./chunk-L77Z3Q6L.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-6WVEICL2.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-2AWU2E6R.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-GHXNRF63.js";import"./chunk-MYDZBABD.js";import"./chunk-JSTKSPYT.js";import"./chunk-N653RGT3.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
@@ -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.1");process.exit(0)}
2
- import{a as c,e as f}from"./chunk-ARWSPV2C.js";import"./chunk-PNK5KHSI.js";f();import{Command as $}from"commander";import r from"chalk";function x(v,g,p){let m=new $("arena").description("Competitive test-strategy tournaments (ADR-104)").addHelpText("after",`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a as c,e as f}from"./chunk-3KTAMNKI.js";import"./chunk-D75HDHX3.js";f();import{Command as $}from"commander";import r from"chalk";function x(v,g,p){let m=new $("arena").description("Competitive test-strategy tournaments (ADR-104)").addHelpText("after",`
3
3
  Examples:
4
4
  # Run a 4-strategy tournament against the demo fixture (reproducible under --seed)
5
5
  aqe arena run --strategies 4 --target fixtures/arena-demo --seed 42
@@ -9,10 +9,10 @@ Examples:
9
9
 
10
10
  # List persisted runs
11
11
  aqe arena list
12
- `);return m.command("run").description("Run a seeded strategy tournament against an arena fixture").requiredOption("--target <dir>","Arena fixture directory (src/*.mjs + tests/*.test.mjs)").option("--strategies <n>","Number of strategies","4").option("--seed <n>","RNG seed (same seed = same tournament)","42").option("--max-mutants <n>","Mutant sample cap","24").option("--evolve <steps>","Hill-climb steps from the winner","0").option("--json","Output the full arena-result@1 envelope as JSON").action(async a=>{try{let{runArena:i}=await import("./arena-LHLVOQHW.js"),t=i({target:a.target,strategies:parseInt(a.strategies,10),seed:parseInt(a.seed,10),maxMutants:parseInt(a.maxMutants,10),evolveSteps:parseInt(a.evolve,10),log:a.json?()=>{}:e=>console.error(r.dim(` ${e}`))});try{let{getUnifiedMemory:e}=await import("./unified-memory-WVELSL6T.js"),s=e();s.isInitialized()||await s.initialize(),s.getDatabase().prepare("INSERT OR REPLACE INTO kv_store (namespace, key, value) VALUES ('arena', ?, ?)").run(`run:${t.seed}:${t.target}`,JSON.stringify(t))}catch(e){console.error(r.dim(` note: run not persisted (${c(e)})`))}if(a.json){console.log(JSON.stringify(t,null,2));return}let d=new Map(t.strategies.map(e=>[e.id,e]));console.log(r.blue(`
12
+ `);return m.command("run").description("Run a seeded strategy tournament against an arena fixture").requiredOption("--target <dir>","Arena fixture directory (src/*.mjs + tests/*.test.mjs)").option("--strategies <n>","Number of strategies","4").option("--seed <n>","RNG seed (same seed = same tournament)","42").option("--max-mutants <n>","Mutant sample cap","24").option("--evolve <steps>","Hill-climb steps from the winner","0").option("--json","Output the full arena-result@1 envelope as JSON").action(async a=>{try{let{runArena:i}=await import("./arena-ZU5CGBGH.js"),t=i({target:a.target,strategies:parseInt(a.strategies,10),seed:parseInt(a.seed,10),maxMutants:parseInt(a.maxMutants,10),evolveSteps:parseInt(a.evolve,10),log:a.json?()=>{}:e=>console.error(r.dim(` ${e}`))});try{let{getUnifiedMemory:e}=await import("./unified-memory-UUK77NSE.js"),s=e();s.isInitialized()||await s.initialize(),s.getDatabase().prepare("INSERT OR REPLACE INTO kv_store (namespace, key, value) VALUES ('arena', ?, ?)").run(`run:${t.seed}:${t.target}`,JSON.stringify(t))}catch(e){console.error(r.dim(` note: run not persisted (${c(e)})`))}if(a.json){console.log(JSON.stringify(t,null,2));return}let d=new Map(t.strategies.map(e=>[e.id,e]));console.log(r.blue(`
13
13
  Arena: ${t.target} \xB7 seed ${t.seed} \xB7 ${t.mutantsTotal} mutants
14
14
  `)),console.log(" rank id kill-rate coverage cost fitness groups"),t.ranking.forEach((e,s)=>{let n=d.get(e),u=n.coveragePct===null?" n/a":`${n.coveragePct.toFixed(2)}%`.padStart(7);console.log(` ${String(s+1).padEnd(5)}${n.id.padEnd(5)}${(n.killRate*100).toFixed(1).padStart(6)}% ${u} ${n.suiteCostRatio.toFixed(2).padEnd(6)}${n.fitness.toFixed(4).padEnd(9)}${n.name}`+(n.baselinePassed?"":r.red(" [baseline FAILED]")))}),console.log(`
15
15
  competitive array (row beats column = 1):`);let o=t.strategies.map(e=>e.id);if(console.log(` ${o.map(e=>e.padEnd(4)).join("")}`),t.competitiveArray.forEach((e,s)=>{console.log(` ${o[s].padEnd(4)}${e.map(n=>String(n).padStart(2).padEnd(4)).join("")}`)}),t.evolution.length>0){console.log(`
16
16
  evolution:`);for(let e of t.evolution)console.log(` step ${e.step}: [${e.groups.join("+")}] fitness ${e.fitness.toFixed(4)} ${e.accepted?r.green("accepted"):"rejected"}`)}let l=d.get(t.ranking[0]);console.log(r.green(`
17
17
  winner: ${l.id} [${l.name}] \u2014 kill ${(l.killRate*100).toFixed(1)}%, fitness ${l.fitness.toFixed(4)}
18
- `))}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m.command("list").description("List persisted arena runs").option("--json","Output as JSON").action(async a=>{if(await p())try{let{getUnifiedMemory:i}=await import("./unified-memory-WVELSL6T.js"),t=i();t.isInitialized()||await t.initialize();let d=t.getDatabase().prepare("SELECT key, value FROM kv_store WHERE namespace = 'arena' ORDER BY key").all();if(a.json){console.log(JSON.stringify(d.map(o=>({key:o.key,result:JSON.parse(o.value)})),null,2));return}if(d.length===0){console.log(r.yellow(" no persisted arena runs"));return}for(let o of d){let l=JSON.parse(o.value),e=l.strategies.find(s=>s.id===l.ranking[0]);console.log(` ${r.green(o.key)} \u2014 winner ${e?.id} [${e?.name}] fitness ${e?.fitness}`)}}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m}export{x as createArenaCommand};
18
+ `))}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m.command("list").description("List persisted arena runs").option("--json","Output as JSON").action(async a=>{if(await p())try{let{getUnifiedMemory:i}=await import("./unified-memory-UUK77NSE.js"),t=i();t.isInitialized()||await t.initialize();let d=t.getDatabase().prepare("SELECT key, value FROM kv_store WHERE namespace = 'arena' ORDER BY key").all();if(a.json){console.log(JSON.stringify(d.map(o=>({key:o.key,result:JSON.parse(o.value)})),null,2));return}if(d.length===0){console.log(r.yellow(" no persisted arena runs"));return}for(let o of d){let l=JSON.parse(o.value),e=l.strategies.find(s=>s.id===l.ranking[0]);console.log(` ${r.green(o.key)} \u2014 winner ${e?.id} [${e?.name}] fitness ${e?.fitness}`)}}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m}export{x as createArenaCommand};
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.1");process.exit(0)}
2
- import"./chunk-PNK5KHSI.js";import*as K from"fs";import*as M from"path";function G(t){let r=t>>>0;return function(){r|=0,r=r+1831565813|0;let n=Math.imul(r^r>>>15,1|r);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function w(t,r){return Math.floor(t()*r)}var z=[["===","!=="],["!==","==="],["<=","<"],[">=",">"],["&&","||"],["||","&&"],["<","<="],[">",">="],["+","-"],["*","+"]];function H(t){let r=new Array(t.length).fill(!1),n=0,e="code";for(;n<t.length;){let s=t[n],i=t[n+1];e==="code"?(s==="'"?e="single":s==='"'?e="double":s==="`"?e="template":s==="/"&&i==="/"?e="line-comment":s==="/"&&i==="*"&&(e="block-comment"),e!=="code"&&(r[n]=!0)):(r[n]=!0,e==="single"&&s==="'"&&t[n-1]!=="\\"||e==="double"&&s==='"'&&t[n-1]!=="\\"||e==="template"&&s==="`"&&t[n-1]!=="\\"||e==="line-comment"&&s===`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import"./chunk-D75HDHX3.js";import*as K from"fs";import*as M from"path";function G(t){let r=t>>>0;return function(){r|=0,r=r+1831565813|0;let n=Math.imul(r^r>>>15,1|r);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function w(t,r){return Math.floor(t()*r)}var z=[["===","!=="],["!==","==="],["<=","<"],[">=",">"],["&&","||"],["||","&&"],["<","<="],[">",">="],["+","-"],["*","+"]];function H(t){let r=new Array(t.length).fill(!1),n=0,e="code";for(;n<t.length;){let s=t[n],i=t[n+1];e==="code"?(s==="'"?e="single":s==='"'?e="double":s==="`"?e="template":s==="/"&&i==="/"?e="line-comment":s==="/"&&i==="*"&&(e="block-comment"),e!=="code"&&(r[n]=!0)):(r[n]=!0,e==="single"&&s==="'"&&t[n-1]!=="\\"||e==="double"&&s==='"'&&t[n-1]!=="\\"||e==="template"&&s==="`"&&t[n-1]!=="\\"||e==="line-comment"&&s===`
3
3
  `?e="code":e==="block-comment"&&s==="*"&&i==="/"&&(r[n+1]=!0,n++,e="code")),n++}return r}function E(t,r){let n=1;for(let e=0;e<r;e++)t[e]===`
4
4
  `&&n++;return n}function A(t,r){let n=H(t),e=new Array(t.length).fill(!1),s=[];for(let[i,c]of z){let a=t.indexOf(i);for(;a!==-1;){let u=a+i.length,y=e.slice(a,u).some(Boolean),h=n.slice(a,u).some(Boolean),v=i===">"&&t[a-1]==="=",S=(i==="<"||i===">")&&(t[u]==="="||t[a-1]==="<"||t[a-1]===">");if(!y&&!h&&!v&&!S){for(let d=a;d<u;d++)e[d]=!0;s.push({id:`${r}:${E(t,a)}:${a}:${i}->${c}`,index:a,from:i,to:c,line:E(t,a)})}a=t.indexOf(i,a+1)}}return s.sort((i,c)=>i.index-c.index)}function W(t,r){return t.slice(0,r.index)+r.to+t.slice(r.index+r.from.length)}import*as m from"fs";import*as f from"path";import*as L from"os";import{spawnSync as J}from"child_process";function I(t){let r=f.resolve(t),n=f.join(r,"src"),e=f.join(r,"tests");if(!m.existsSync(n)||!m.existsSync(e))throw new Error(`not an arena fixture (expected src/ and tests/): ${r}`);let s=m.readdirSync(n).filter(c=>c.endsWith(".mjs")).sort().map(c=>f.join("src",c)),i={};for(let c of m.readdirSync(e).filter(a=>a.endsWith(".test.mjs")).sort())i[c.replace(".test.mjs","")]=f.join("tests",c);if(s.length===0||Object.keys(i).length===0)throw new Error(`fixture has no src/*.mjs or tests/*.test.mjs: ${r}`);return{root:r,sourceFiles:s,testGroups:i}}function T(t,r){let n=m.mkdtempSync(f.join(r,"arena-ws-"));m.mkdirSync(f.join(n,"src"),{recursive:!0}),m.mkdirSync(f.join(n,"tests"),{recursive:!0});for(let e of t.layout.sourceFiles){let s=t.mutatedFile&&t.mutatedFile.relPath===e?t.mutatedFile.content:m.readFileSync(f.join(t.layout.root,e),"utf8");m.writeFileSync(f.join(n,e),s)}for(let e of t.groups){let s=t.layout.testGroups[e];m.copyFileSync(f.join(t.layout.root,s),f.join(n,s))}return n}function $(t,r={}){let n=["--test"];r.coverage&&n.push("--experimental-test-coverage");let e=m.readdirSync(f.join(t,"tests")).filter(u=>u.endsWith(".test.mjs")).sort().map(u=>f.join("tests",u));n.push(...e);let s=process.hrtime.bigint(),i=J(process.execPath,n,{cwd:t,timeout:r.timeoutMs??12e4,encoding:"utf8"}),c=Number(process.hrtime.bigint()-s)/1e6,a=null;if(r.coverage){let u=/all files\s*\|\s*([\d.]+)/.exec(i.stdout??"");a=u?Number(u[1]):null}return{ok:i.status===0,durationMs:Math.round(c),coveragePct:a}}function N(){return m.mkdtempSync(f.join(L.tmpdir(),"qe-arena-"))}function B(t){m.rmSync(t,{recursive:!0,force:!0})}var k={kill:.6,coverage:.3,runtimePenalty:.1};function Q(t,r,n){let e=[...t].sort(),s=new Set([e.join("+")]),i=[{id:"s1",name:`all(${e.join("+")})`,groups:e}],c=0;for(;i.length<r&&c++<200;){let a=e.filter(()=>n()<.5);if(a.length===0)continue;let u=a.join("+");s.has(u)||(s.add(u),i.push({id:`s${i.length+1}`,name:u,groups:a}))}return i}function C(t,r,n){let e=r===null?0:r/100,s=k.kill*t+k.coverage*e-k.runtimePenalty*n;return Math.round(s*1e4)/1e4}function D(t,r,n,e){let s=T({layout:t,groups:r.groups},e),i=$(s,{coverage:!0});if(!i.ok)return{baselinePassed:!1,killed:0,total:0,coveragePct:i.coveragePct,runtimeMs:i.durationMs};let c=0,a=0;for(let u of n)for(let y of u.mutants){a++;let h=T({layout:t,groups:r.groups,mutatedFile:{relPath:u.relPath,content:W(u.source,y)}},e);$(h).ok||c++}return{baselinePassed:!0,killed:c,total:a,coveragePct:i.coveragePct,runtimeMs:i.durationMs}}function rt(t){let r=t.seed??42,n=t.log??(()=>{}),e=G(r),s=I(t.target),i=N();try{let c=t.maxMutants??24,a=s.sourceFiles.map(l=>{let o=K.readFileSync(M.join(s.root,l),"utf8");return{relPath:l,source:o,mutants:A(o,l)}}),u=a.flatMap(l=>l.mutants.map(o=>({file:l.relPath,m:o})));if(u.length>c){let l=new Set;for(;l.size<c;)l.add(u[w(e,u.length)].m.id);for(let o of a)o.mutants=o.mutants.filter(p=>l.has(p.id));u=a.flatMap(o=>o.mutants.map(p=>({file:o.relPath,m:p})))}n(`mutants: ${u.length} (of ${a.reduce((l,o)=>l+A(o.source,o.relPath).length,0)} enumerated)`);let y=Q(Object.keys(s.testGroups),t.strategies??4,e),h={},v=y.map(l=>{n(`evaluating ${l.id} [${l.name}] ...`);let o=D(s,l,a,i);return h[l.id]=o.runtimeMs,{s:l,e:o}}),S=Object.keys(s.testGroups).length,d=v.map(({s:l,e:o})=>{let p=o.total>0?Math.round(o.killed/o.total*1e4)/1e4:0,g=Math.round(l.groups.length/S*1e4)/1e4;return{...l,baselinePassed:o.baselinePassed,mutantsKilled:o.killed,mutantsTotal:o.total,killRate:p,coveragePct:o.coveragePct,suiteCostRatio:g,fitness:o.baselinePassed?C(p,o.coveragePct,g):0}}),P=[...d].sort((l,o)=>o.fitness-l.fitness||l.id.localeCompare(o.id)).map(l=>l.id),U=d.map(l=>d.map(o=>l.fitness>o.fitness?1:l.fitness<o.fitness?-1:0)),j=[];if(t.evolveSteps&&t.evolveSteps>0){let l=Object.keys(s.testGroups).sort(),o=d.find(g=>g.id===P[0]).groups,p=d.find(g=>g.id===P[0]).fitness;for(let g=1;g<=t.evolveSteps;g++){let R=l[w(e,l.length)],b=o.includes(R)?o.filter(q=>q!==R):[...o,R].sort();if(b.length===0){j.push({step:g,groups:b,fitness:0,accepted:!1});continue}let x=D(s,{id:`evo${g}`,name:b.join("+"),groups:b},a,i),_=x.total>0?x.killed/x.total:0,F=x.baselinePassed?C(_,x.coveragePct,b.length/l.length):0,O=F>p;j.push({step:g,groups:b,fitness:F,accepted:O}),O&&(o=b,p=F)}}return{contract:"arena-result@1",seed:r,target:M.relative(process.cwd(),s.root)||".",weights:{...k},mutantsTotal:u.length,strategies:d,ranking:P,competitiveArray:U,evolution:j,informational:{runtimesMs:h}}}finally{B(i)}}export{Q as buildStrategies,rt as runArena};
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.1");process.exit(0)}
2
- import{d as g,e as y,f as k,g as w}from"./chunk-VLL7ASGH.js";import{s as x}from"./chunk-NF6SLLE6.js";import"./chunk-3NOSMJS4.js";import"./chunk-5C4UYXQL.js";import"./chunk-W5NHBYYS.js";import"./chunk-53HWWWFZ.js";import"./chunk-UE33MZOC.js";import"./chunk-ADEYBXAS.js";import"./chunk-WQZR6DS6.js";import"./chunk-WPG6SW7C.js";import"./chunk-SRXXPZVT.js";import"./chunk-UGUZFUQG.js";import"./chunk-2K3QFLX2.js";import"./chunk-7FGSX4UD.js";import"./chunk-46DUU44C.js";import"./chunk-ARWSPV2C.js";import"./chunk-HU4QGCIJ.js";import{b as l}from"./chunk-25IWHVMW.js";import"./chunk-JW2HNT3J.js";import{p as F,q as j}from"./chunk-OH4SKOAM.js";import{f as v}from"./chunk-PNK5KHSI.js";import{Command as E}from"commander";import s from"chalk";x();import{existsSync as f}from"node:fs";import p from"node:path";function b(e,a,n){let t=[];t.push(s.bold("Witness Chain Audit Verification")),t.push("");let r=a?s.green("ENABLED"):s.yellow("DISABLED");t.push(` Feature Flag: ${r}`),t.push(` Chain Length: ${e.length} receipts`);let o=n?.status==="forked"?s.yellow("FORKED (no tampering detected)"):e.valid?s.green(n?.status==="valid-with-forks"?"VALID (forks re-anchored)":"VALID"):s.red(n?.status==="tampered"?"BROKEN (tampering detected)":"BROKEN");t.push(` Integrity: ${o}`),e.length>0&&t.push(` Last Hash: ${e.lastHash.slice(0,16)}...`);let i=n?.forks?.length??0;if(i>0){let d=n?.acknowledgedForks?.length??0;t.push(` Forks: ${i} accidental (pre-3.14.5 concurrent writes, #753), ${d} re-anchored`)}if(n?.status==="forked")t.push(""),t.push(s.yellow(` ${e.message}`));else if(!e.valid&&e.brokenAt>=0){t.push("");let d=n?.status==="tampered"&&n.tamperedAt!==void 0?n.tamperedAt:e.brokenAt;t.push(s.red(` Break detected at index ${d}${n?.tamperReason?` (${n.tamperReason})`:""}`)),t.push(s.red(` ${e.message}`))}else e.valid&&i>0&&(t.push(""),t.push(s.green(` ${e.message}`)));return t.push(""),t.join(`
3
- `)}function O(){try{let e=l(),a=p.join(e,".agentic-qe","memory.db");if(!f(a))return null;let n=(j(),v(F)),t=new n(a),r=g(t),o=k(r);return t.close(),o}catch{return null}}async function P(e){let a=w(),t=(O()??y()).verifyChain(),r={featureEnabled:a,chainLength:t.length,integrity:t.valid,brokenAt:t.brokenAt,lastHash:t.lastHash,message:t.message};return e.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(b(t,a)),r}async function L(e){let{WitnessChain:a,hashWith:n,serializeEntry:t}=await import("./witness-chain-D6X4OZP5.js"),{dbPath:r,keyDir:o}=R(),i;if(!f(r))i={featureEnabled:!0,chainLength:0,integrity:!0,brokenAt:-1,lastHash:"",message:`No database found at ${r} \u2014 nothing to verify`};else{let{default:d}=await import("./better-sqlite3-YERQ5DOL.js"),u=new d(r,{readonly:!0});try{let m=new a(u,await A(o)??void 0);await m.initialize();let c=m.verify({includeArchive:!0,checkSignatures:!1}),{tableExists:C}=await import("./witness-chain-verifier-LACGL6BK.js"),h=C(u,"witness_chain")?u.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get():void 0,$=h?n(h.hash_algo||"sha256",t(h)):"";i={featureEnabled:!0,chainLength:c.entriesChecked,integrity:c.valid,brokenAt:c.brokenAt??-1,lastHash:$,message:V(c),status:c.status,tampered:c.tampered,...c.tamperedAt!==void 0?{tamperedAt:c.tamperedAt}:{},...c.tamperReason?{tamperReason:c.tamperReason}:{},forks:c.forks,acknowledgedForks:c.acknowledgedForks}}finally{u.close()}}return e.format==="json"?console.log(JSON.stringify(i,null,2)):console.log(b({valid:i.integrity,length:i.chainLength,brokenAt:i.brokenAt,lastHash:i.lastHash,message:i.message},i.featureEnabled,i)),i}function R(){let e=l();return{dbPath:p.join(e,".agentic-qe","memory.db"),keyDir:p.join(e,".agentic-qe","witness-keys")}}async function A(e){if(!f(e))return null;let{WitnessKeyManager:a}=await import("./witness-key-manager-GQZIB5ZE.js");return new a({keyDir:e,autoGenerate:!1})}function V(e){let a=e.entriesChecked,n=e.forks.length,t=n-e.acknowledgedForks.length;switch(e.status){case"valid":return`Audit chain verified: ${a} entries checked, ${e.signatureFailures??0} signature failures`;case"valid-with-forks":return`Audit chain verified: ${a} entries checked; ${n} accidental fork(s) from pre-3.14.5 concurrent writes are re-anchored by CHAIN_REANCHOR, no tampering detected`;case"forked":return`${t} accidental fork(s) (pre-3.14.5 concurrent writes, #753), no tampering detected \u2014 ${a} entries checked, first fork at id=${e.brokenAt}. Run \`aqe audit repair --chain audit\` to back up the store and re-anchor.`;default:return`Audit chain BROKEN: tampering detected at id=${e.tamperedAt} (${e.tamperReason}); ${a} entries checked`+(n>0?`, ${n} accidental fork(s) found before it`:"")}}function W(e){return e.action==="refused"?!0:e.action==="reanchored"&&!(e.after?.status==="valid"||e.after?.status==="valid-with-forks")}async function D(e){let{repairWitnessChainForks:a}=await import("./witness-chain-repair-3LG4BF7C.js"),{dbPath:n,keyDir:t}=R(),r=e.dryRun===!0,o;if(f(n)){let{openDatabase:i}=await import("./safe-db-INVJ5LHR.js"),d=i(n,{readonly:r,fileMustExist:!0});try{let u=r?await A(t):(await import("./witness-key-manager-GQZIB5ZE.js")).getDefaultWitnessKeyManager();o=await a(d,{dbPath:n,dryRun:r,keyManager:u})}finally{d.close()}}else{let i={status:"valid",entriesChecked:0,forks:0,unacknowledgedForks:0};o={action:"none",dryRun:r,message:`No database found at ${n} \u2014 nothing to repair`,before:i,rowsBefore:{live:0,archive:0},rowsAfter:{live:0,archive:0},forksAcknowledged:[]}}return e.format==="json"?console.log(JSON.stringify(o,null,2)):console.log(S(o)),o}function S(e){let a=e.action==="refused"?s.red:e.action==="reanchored"?s.green:s.yellow,n=[s.bold("Witness Chain Audit Repair"),"",` Action: ${a(e.action.toUpperCase())}${e.dryRun?" (dry run)":""}`,` Before: ${e.before.status}, ${e.before.forks} fork(s), ${e.before.unacknowledgedForks} unacknowledged`,` Rows: live ${e.rowsBefore.live} -> ${e.rowsAfter.live}, archive ${e.rowsBefore.archive} -> ${e.rowsAfter.archive}`];return e.after&&n.push(` After: ${e.after.status}`),e.backupPath&&n.push(` Backup: ${e.backupPath}`),n.push("",` ${a(e.message)}`,""),n.join(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{d as g,e as y,f as k,g as w}from"./chunk-2B2MGJ2W.js";import{s as x}from"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import{b as l}from"./chunk-MYDZBABD.js";import"./chunk-W5EKSBS4.js";import{p as F,q as j}from"./chunk-PZK7O445.js";import{f as v}from"./chunk-D75HDHX3.js";import{Command as E}from"commander";import s from"chalk";x();import{existsSync as f}from"node:fs";import p from"node:path";function b(e,a,n){let t=[];t.push(s.bold("Witness Chain Audit Verification")),t.push("");let r=a?s.green("ENABLED"):s.yellow("DISABLED");t.push(` Feature Flag: ${r}`),t.push(` Chain Length: ${e.length} receipts`);let o=n?.status==="forked"?s.yellow("FORKED (no tampering detected)"):e.valid?s.green(n?.status==="valid-with-forks"?"VALID (forks re-anchored)":"VALID"):s.red(n?.status==="tampered"?"BROKEN (tampering detected)":"BROKEN");t.push(` Integrity: ${o}`),e.length>0&&t.push(` Last Hash: ${e.lastHash.slice(0,16)}...`);let i=n?.forks?.length??0;if(i>0){let d=n?.acknowledgedForks?.length??0;t.push(` Forks: ${i} accidental (pre-3.14.5 concurrent writes, #753), ${d} re-anchored`)}if(n?.status==="forked")t.push(""),t.push(s.yellow(` ${e.message}`));else if(!e.valid&&e.brokenAt>=0){t.push("");let d=n?.status==="tampered"&&n.tamperedAt!==void 0?n.tamperedAt:e.brokenAt;t.push(s.red(` Break detected at index ${d}${n?.tamperReason?` (${n.tamperReason})`:""}`)),t.push(s.red(` ${e.message}`))}else e.valid&&i>0&&(t.push(""),t.push(s.green(` ${e.message}`)));return t.push(""),t.join(`
3
+ `)}function O(){try{let e=l(),a=p.join(e,".agentic-qe","memory.db");if(!f(a))return null;let n=(j(),v(F)),t=new n(a),r=g(t),o=k(r);return t.close(),o}catch{return null}}async function P(e){let a=w(),t=(O()??y()).verifyChain(),r={featureEnabled:a,chainLength:t.length,integrity:t.valid,brokenAt:t.brokenAt,lastHash:t.lastHash,message:t.message};return e.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(b(t,a)),r}async function L(e){let{WitnessChain:a,hashWith:n,serializeEntry:t}=await import("./witness-chain-7NZ6IIUN.js"),{dbPath:r,keyDir:o}=R(),i;if(!f(r))i={featureEnabled:!0,chainLength:0,integrity:!0,brokenAt:-1,lastHash:"",message:`No database found at ${r} \u2014 nothing to verify`};else{let{default:d}=await import("./better-sqlite3-45JLBQX3.js"),u=new d(r,{readonly:!0});try{let m=new a(u,await A(o)??void 0);await m.initialize();let c=m.verify({includeArchive:!0,checkSignatures:!1}),{tableExists:C}=await import("./witness-chain-verifier-SPXKFC67.js"),h=C(u,"witness_chain")?u.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get():void 0,$=h?n(h.hash_algo||"sha256",t(h)):"";i={featureEnabled:!0,chainLength:c.entriesChecked,integrity:c.valid,brokenAt:c.brokenAt??-1,lastHash:$,message:V(c),status:c.status,tampered:c.tampered,...c.tamperedAt!==void 0?{tamperedAt:c.tamperedAt}:{},...c.tamperReason?{tamperReason:c.tamperReason}:{},forks:c.forks,acknowledgedForks:c.acknowledgedForks}}finally{u.close()}}return e.format==="json"?console.log(JSON.stringify(i,null,2)):console.log(b({valid:i.integrity,length:i.chainLength,brokenAt:i.brokenAt,lastHash:i.lastHash,message:i.message},i.featureEnabled,i)),i}function R(){let e=l();return{dbPath:p.join(e,".agentic-qe","memory.db"),keyDir:p.join(e,".agentic-qe","witness-keys")}}async function A(e){if(!f(e))return null;let{WitnessKeyManager:a}=await import("./witness-key-manager-EALOV4OV.js");return new a({keyDir:e,autoGenerate:!1})}function V(e){let a=e.entriesChecked,n=e.forks.length,t=n-e.acknowledgedForks.length;switch(e.status){case"valid":return`Audit chain verified: ${a} entries checked, ${e.signatureFailures??0} signature failures`;case"valid-with-forks":return`Audit chain verified: ${a} entries checked; ${n} accidental fork(s) from pre-3.14.5 concurrent writes are re-anchored by CHAIN_REANCHOR, no tampering detected`;case"forked":return`${t} accidental fork(s) (pre-3.14.5 concurrent writes, #753), no tampering detected \u2014 ${a} entries checked, first fork at id=${e.brokenAt}. Run \`aqe audit repair --chain audit\` to back up the store and re-anchor.`;default:return`Audit chain BROKEN: tampering detected at id=${e.tamperedAt} (${e.tamperReason}); ${a} entries checked`+(n>0?`, ${n} accidental fork(s) found before it`:"")}}function W(e){return e.action==="refused"?!0:e.action==="reanchored"&&!(e.after?.status==="valid"||e.after?.status==="valid-with-forks")}async function D(e){let{repairWitnessChainForks:a}=await import("./witness-chain-repair-ZWS5WXFL.js"),{dbPath:n,keyDir:t}=R(),r=e.dryRun===!0,o;if(f(n)){let{openDatabase:i}=await import("./safe-db-YXVMLFU4.js"),d=i(n,{readonly:r,fileMustExist:!0});try{let u=r?await A(t):(await import("./witness-key-manager-EALOV4OV.js")).getDefaultWitnessKeyManager();o=await a(d,{dbPath:n,dryRun:r,keyManager:u})}finally{d.close()}}else{let i={status:"valid",entriesChecked:0,forks:0,unacknowledgedForks:0};o={action:"none",dryRun:r,message:`No database found at ${n} \u2014 nothing to repair`,before:i,rowsBefore:{live:0,archive:0},rowsAfter:{live:0,archive:0},forksAcknowledged:[]}}return e.format==="json"?console.log(JSON.stringify(o,null,2)):console.log(S(o)),o}function S(e){let a=e.action==="refused"?s.red:e.action==="reanchored"?s.green:s.yellow,n=[s.bold("Witness Chain Audit Repair"),"",` Action: ${a(e.action.toUpperCase())}${e.dryRun?" (dry run)":""}`,` Before: ${e.before.status}, ${e.before.forks} fork(s), ${e.before.unacknowledgedForks} unacknowledged`,` Rows: live ${e.rowsBefore.live} -> ${e.rowsAfter.live}, archive ${e.rowsBefore.archive} -> ${e.rowsAfter.archive}`];return e.after&&n.push(` After: ${e.after.status}`),e.backupPath&&n.push(` Backup: ${e.backupPath}`),n.push("",` ${a(e.message)}`,""),n.join(`
4
4
  `)}function q(e,a,n){let t=new E("audit").description("Witness chain audit trail management");return t.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").option("-C, --chain <chain>","Which chain to verify: governance (29 decision receipts) or audit (full QE audit trail)","governance").action(async r=>{try{let o=r.format,i=r.chain==="audit"?await L({format:o}):await P({format:o});await a(i.integrity?0:1)}catch(o){console.error("Failed to verify witness chain:",o),await a(1)}}),t.command("repair").description("Re-anchor accidental pre-3.14.5 forks in the audit chain (#753); backs up first, refuses on tampering").option("-C, --chain <chain>",'Chain to repair (only "audit" is supported)',"audit").option("--dry-run","Report what would be done without writing anything",!1).option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{if(r.chain!=="audit"){console.error(`aqe audit repair supports only --chain audit (got "${r.chain}")`),await a(1);return}let o=await D({format:r.format,dryRun:r.dryRun===!0});await a(W(o)?1:0)}catch(o){console.error("Failed to repair witness chain:",o),await a(1)}}),t}export{q as createAuditCommand,b as formatVerificationText,D as handleAuditChainRepair,L as handleAuditChainVerify,P as handleAuditVerify};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-GDSLQTJC.js";import"./chunk-XQBH3366.js";import"./chunk-6UO5YSNN.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-MYDZBABD.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
@@ -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.1");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-OH4SKOAM.js";import"./chunk-PNK5KHSI.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
@@ -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.1");process.exit(0)}
2
- import{a as L,b as z,c as K,d as _,e as ie,f as W,g as G,h as A,i as Ce,j as se,k as Q,l as xe,m as J,n as le,o as Ie,p as P,q as Y,r as X,s as Z,t as ee}from"./chunk-5B5TA3X4.js";import{c as Ee}from"./chunk-5QEXDXHQ.js";import{b as ve}from"./chunk-N5OSH5JO.js";import{a as Se,d as ae,e as _e}from"./chunk-EQ3BJS37.js";import"./chunk-NF6SLLE6.js";import"./chunk-3NOSMJS4.js";import{b as k,d as oe}from"./chunk-5C4UYXQL.js";import"./chunk-W5NHBYYS.js";import"./chunk-53HWWWFZ.js";import"./chunk-UE33MZOC.js";import"./chunk-ADEYBXAS.js";import"./chunk-WQZR6DS6.js";import"./chunk-WPG6SW7C.js";import"./chunk-SRXXPZVT.js";import"./chunk-UGUZFUQG.js";import"./chunk-2K3QFLX2.js";import"./chunk-7FGSX4UD.js";import"./chunk-46DUU44C.js";import"./chunk-ARWSPV2C.js";import"./chunk-HU4QGCIJ.js";import"./chunk-25IWHVMW.js";import{a as we,b as Re,c as H,d as V,f as nn}from"./chunk-YM3GAJMN.js";import{a as F,b as tn}from"./chunk-JW2HNT3J.js";import"./chunk-OH4SKOAM.js";import"./chunk-PNK5KHSI.js";import $ from"path";import o from"chalk";tn();oe();import{existsSync as te,mkdirSync as rn,writeFileSync as on,readFileSync as ce}from"fs";import{join as D,resolve as de}from"path";function ne(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?ae(r,_e(a)):Se;e.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.2");process.exit(0)}
2
+ import{a as L,b as z,c as K,d as _,e as ie,f as W,g as G,h as A,i as Ce,j as se,k as Q,l as xe,m as J,n as le,o as Ie,p as P,q as Y,r as X,s as Z,t as ee}from"./chunk-NBV37CEK.js";import{c as Ee}from"./chunk-JCB6K24D.js";import{b as ve}from"./chunk-DGKPGRBT.js";import{a as Se,d as ae,e as _e}from"./chunk-ZSKQPXRW.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import{b as k,d as oe}from"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-MYDZBABD.js";import{a as we,b as Re,c as H,d as V,f as nn}from"./chunk-N653RGT3.js";import{a as F,b as tn}from"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";import $ from"path";import o from"chalk";tn();oe();import{existsSync as te,mkdirSync as rn,writeFileSync as on,readFileSync as ce}from"fs";import{join as D,resolve as de}from"path";function ne(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?ae(r,_e(a)):Se;e.prepare(`
3
3
  INSERT INTO witness_chain
4
4
  (prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo)
5
5
  VALUES (?, ?, 'BRAIN_IMPORT', ?, ?, 'brain-import', ?)
@@ -79,7 +79,7 @@ Examples:
79
79
  aqe brain diff ./brain-a ./brain-b --verbose
80
80
  aqe brain search -i ./brain-export --query oauth --domain test-generation
81
81
  aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
82
- `}};async function ye(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-WVELSL6T.js");return $.join(n(),".agentic-qe","memory.db")}function Ze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Wn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function Jn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function Un(e,n){console.log(o.blue(`
82
+ `}};async function ye(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-UUK77NSE.js");return $.join(n(),".agentic-qe","memory.db")}function Ze(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Wn(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function Jn(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function Un(e,n){console.log(o.blue(`
83
83
  Brain Diff
84
84
  `)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+en(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
85
85
  Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
@@ -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.1");process.exit(0)}
2
- import"./chunk-PNK5KHSI.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.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.2");process.exit(0)}
2
+ import"./chunk-D75HDHX3.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
3
3
  `),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
4
4
  `).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
5
5
  `)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.1");process.exit(0)}
2
- import{a as p}from"./chunk-GAKVCN3C.js";import"./chunk-PNK5KHSI.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y,dirname as W}from"path";import{fileURLToPath as v}from"url";import{parse as d}from"yaml";var b=v(import.meta.url),E=W(b),l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(E,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
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.2");process.exit(0)}
2
+ import{a as p}from"./chunk-2JEPRQMT.js";import"./chunk-D75HDHX3.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y,dirname as W}from"path";import{fileURLToPath as v}from"url";import{parse as d}from"yaml";var b=v(import.meta.url),E=W(b),l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(E,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
3
3
  ${i.errors.join(`
4
4
  `)}`);return this.cache.set(r,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}async list(){try{return(await k(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>y(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(r){if(r.code==="ENOENT")return[];throw r}}async validate(r){let e=[],n=[];if(r.name||e.push("Workflow must have a name"),r.version||e.push("Workflow must have a version"),r.description||n.push("Workflow should have a description"),Array.isArray(r.variables)?r.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(r.steps))e.push("Workflow must have a steps array");else if(r.steps.length===0)e.push("Workflow must have at least one step");else{r.steps.forEach((t,s)=>{t.name||e.push(`Step at index ${s} must have a name`),t.action||e.push(`Step ${t.name||s} must have an action`),(!t.config||typeof t.config!="object")&&e.push(`Step ${t.name||s} must have a config object`),t.assertions&&Array.isArray(t.assertions)&&t.assertions.forEach((f,u)=>{f.condition||e.push(`Assertion ${u} in step ${t.name||s} must have a condition`),f.message||n.push(`Assertion ${u} in step ${t.name||s} should have a message`)})});let o=r.steps.map(t=>t.name),i=o.filter((t,s)=>o.indexOf(t)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(r,e){let n=await this.load(r),o=n.variables.filter(t=>t.required&&!(t.name in e)).map(t=>t.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(t=>{t.name in e?i[t.name]=e[t.name]:"default"in t&&(i[t.name]=t.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:r}}}async getMetadata(r){try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}clearCache(){this.cache.clear()}async reload(r){return this.cache.delete(r),this.load(r)}},x=new l;function w(a,r){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),t=r;for(let s of i)if(t&&typeof t=="object"&&s in t)t=t[s];else return e;return t!=null?String(t):e})}function T(a,r){let e={...r.variables,result:r.results.get("__last_result__")},n=w(a,e);return p(n,e,!1)}var g=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],A={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},h={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function _(a){return h[a]}function P(a){return g.includes(a)}function L(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:A[a],category:r}})}export{h as WORKFLOW_CATEGORIES,A as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,x as defaultWorkflowLoader,T as evaluateCondition,L as getAllWorkflowTemplates,_ as getWorkflowsByCategory,w as interpolateVariables,P as isValidWorkflowTemplate};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.2");process.exit(0)}
2
+ import{a}from"./chunk-QGCFMACF.js";import"./chunk-GDSLQTJC.js";import"./chunk-XQBH3366.js";import"./chunk-6UO5YSNN.js";import"./chunk-3KXKJSKS.js";import"./chunk-QZNFZ5IQ.js";import"./chunk-URWT3EQT.js";import"./chunk-IM67YHDK.js";import"./chunk-2Q4Y3VQ6.js";import"./chunk-FH6N2LKG.js";import"./chunk-ZIKH7U5A.js";import"./chunk-WBZIOTY6.js";import"./chunk-ITM26I6O.js";import"./chunk-3RC5UMRJ.js";import"./chunk-Z3PANQUT.js";import"./chunk-YH7VOLBP.js";import"./chunk-I7ECEOFV.js";import"./chunk-CV7E627D.js";import"./chunk-5TEPPW4J.js";import"./chunk-3KTAMNKI.js";import"./chunk-3DCRAW43.js";import"./chunk-MYDZBABD.js";import"./chunk-W5EKSBS4.js";import"./chunk-PZK7O445.js";import"./chunk-D75HDHX3.js";export{a as BrowserWorkflowTool};
@@ -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.1");process.exit(0)}
2
- import{a as h}from"./chunk-2K3QFLX2.js";import{e as m}from"./chunk-7FGSX4UD.js";h();var g=m.create("regret-tracker"),l=50,R=.9,d=1.1;function f(o,t){let e=o.length;if(e<2)return 0;let n=0,r=0,i=0,a=0;for(let s=0;s<e;s++)n+=o[s],r+=t[s],i+=o[s]*t[s],a+=o[s]*o[s];let u=e*a-n*n;return Math.abs(u)<1e-10?0:(e*i-n*r)/u}var c=class{domains=new Map;alertCallbacks=[];alerts=[];maxAlerts;recentWindow;constructor(t){this.maxAlerts=t?.maxAlerts??100,this.recentWindow=t?.recentWindow??20}recordDecision(t,e,n){let r=this.getOrCreateDomainState(t),i=Math.max(0,n-e);if(r.cumulativeRegret+=i,r.decisionCount++,r.points.push({decisionCount:r.decisionCount,cumulativeRegret:r.cumulativeRegret,timestamp:Date.now()}),r.decisionCount>=l){let a=this.classifyGrowthRate(r.points);r.lastGrowthRate!=="insufficient_data"&&a!==r.lastGrowthRate&&this.emitAlert(t,r.lastGrowthRate,a),r.lastGrowthRate=a}}getCumulativeRegret(t){return this.domains.get(t)?.cumulativeRegret??0}getRegretCurve(t){let e=this.domains.get(t);return e?[...e.points]:[]}getRegretGrowthRate(t){let e=this.domains.get(t);return e?this.classifyGrowthRate(e.points):"insufficient_data"}detectStagnation(t){let e=this.getRegretGrowthRate(t);return e==="linear"||e==="superlinear"}getHealthSummary(){let t=[];for(let[e,n]of this.domains){let r=this.classifyGrowthRate(n.points),i=this.computeLogLogSlope(n.points),a=this.computeRecentAvgRegret(n);t.push({domain:e,totalDecisions:n.decisionCount,cumulativeRegret:n.cumulativeRegret,growthRate:r,stagnating:r==="linear"||r==="superlinear",slope:i,recentAvgRegret:a})}return t.sort((e,n)=>e.domain.localeCompare(n.domain)),t}onAlert(t){this.alertCallbacks.push(t)}getAlerts(){return[...this.alerts]}getTrackedDomains(){return[...this.domains.keys()].sort()}getTotalDecisions(){let t=0;for(let e of this.domains.values())t+=e.decisionCount;return t}reset(t){t?this.domains.delete(t):(this.domains.clear(),this.alerts=[])}getOrCreateDomainState(t){let e=this.domains.get(t);return e||(e={points:[],cumulativeRegret:0,decisionCount:0,lastGrowthRate:"insufficient_data"},this.domains.set(t,e)),e}classifyGrowthRate(t){if(t.length<l)return"insufficient_data";let e=this.computeLogLogSlope(t);return e===void 0?"insufficient_data":e<R?"sublinear":e<=d?"linear":"superlinear"}computeLogLogSlope(t){if(t.length<l)return;let e=t.filter(i=>i.cumulativeRegret>0&&i.decisionCount>0);if(e.length<2)return;let n=e.map(i=>Math.log(i.decisionCount)),r=e.map(i=>Math.log(i.cumulativeRegret));return f(n,r)}computeRecentAvgRegret(t){if(t.points.length<2)return 0;let e=Math.min(this.recentWindow,t.points.length),n=t.points.slice(-e),r=n[0],i=n[n.length-1],a=i.cumulativeRegret-r.cumulativeRegret,u=i.decisionCount-r.decisionCount;return u<=0?0:a/u}emitAlert(t,e,n){let r={domain:t,previousRate:e,newRate:n,timestamp:Date.now(),message:`Domain "${t}" regret growth changed from ${e} to ${n}`};this.alerts.push(r),this.alerts.length>this.maxAlerts&&this.alerts.shift(),g.info("Regret growth rate transition",{domain:t,previousRate:e,newRate:n});for(let i of this.alertCallbacks)try{i(r)}catch(a){g.error("Alert callback error",a instanceof Error?a:void 0)}}};function b(o){return new c(o)}export{b 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.2");process.exit(0)}
2
+ import{a as h}from"./chunk-I7ECEOFV.js";import{e as m}from"./chunk-CV7E627D.js";h();var g=m.create("regret-tracker"),l=50,R=.9,d=1.1;function f(o,t){let e=o.length;if(e<2)return 0;let n=0,r=0,i=0,a=0;for(let s=0;s<e;s++)n+=o[s],r+=t[s],i+=o[s]*t[s],a+=o[s]*o[s];let u=e*a-n*n;return Math.abs(u)<1e-10?0:(e*i-n*r)/u}var c=class{domains=new Map;alertCallbacks=[];alerts=[];maxAlerts;recentWindow;constructor(t){this.maxAlerts=t?.maxAlerts??100,this.recentWindow=t?.recentWindow??20}recordDecision(t,e,n){let r=this.getOrCreateDomainState(t),i=Math.max(0,n-e);if(r.cumulativeRegret+=i,r.decisionCount++,r.points.push({decisionCount:r.decisionCount,cumulativeRegret:r.cumulativeRegret,timestamp:Date.now()}),r.decisionCount>=l){let a=this.classifyGrowthRate(r.points);r.lastGrowthRate!=="insufficient_data"&&a!==r.lastGrowthRate&&this.emitAlert(t,r.lastGrowthRate,a),r.lastGrowthRate=a}}getCumulativeRegret(t){return this.domains.get(t)?.cumulativeRegret??0}getRegretCurve(t){let e=this.domains.get(t);return e?[...e.points]:[]}getRegretGrowthRate(t){let e=this.domains.get(t);return e?this.classifyGrowthRate(e.points):"insufficient_data"}detectStagnation(t){let e=this.getRegretGrowthRate(t);return e==="linear"||e==="superlinear"}getHealthSummary(){let t=[];for(let[e,n]of this.domains){let r=this.classifyGrowthRate(n.points),i=this.computeLogLogSlope(n.points),a=this.computeRecentAvgRegret(n);t.push({domain:e,totalDecisions:n.decisionCount,cumulativeRegret:n.cumulativeRegret,growthRate:r,stagnating:r==="linear"||r==="superlinear",slope:i,recentAvgRegret:a})}return t.sort((e,n)=>e.domain.localeCompare(n.domain)),t}onAlert(t){this.alertCallbacks.push(t)}getAlerts(){return[...this.alerts]}getTrackedDomains(){return[...this.domains.keys()].sort()}getTotalDecisions(){let t=0;for(let e of this.domains.values())t+=e.decisionCount;return t}reset(t){t?this.domains.delete(t):(this.domains.clear(),this.alerts=[])}getOrCreateDomainState(t){let e=this.domains.get(t);return e||(e={points:[],cumulativeRegret:0,decisionCount:0,lastGrowthRate:"insufficient_data"},this.domains.set(t,e)),e}classifyGrowthRate(t){if(t.length<l)return"insufficient_data";let e=this.computeLogLogSlope(t);return e===void 0?"insufficient_data":e<R?"sublinear":e<=d?"linear":"superlinear"}computeLogLogSlope(t){if(t.length<l)return;let e=t.filter(i=>i.cumulativeRegret>0&&i.decisionCount>0);if(e.length<2)return;let n=e.map(i=>Math.log(i.decisionCount)),r=e.map(i=>Math.log(i.cumulativeRegret));return f(n,r)}computeRecentAvgRegret(t){if(t.points.length<2)return 0;let e=Math.min(this.recentWindow,t.points.length),n=t.points.slice(-e),r=n[0],i=n[n.length-1],a=i.cumulativeRegret-r.cumulativeRegret,u=i.decisionCount-r.decisionCount;return u<=0?0:a/u}emitAlert(t,e,n){let r={domain:t,previousRate:e,newRate:n,timestamp:Date.now(),message:`Domain "${t}" regret growth changed from ${e} to ${n}`};this.alerts.push(r),this.alerts.length>this.maxAlerts&&this.alerts.shift(),g.info("Regret growth rate transition",{domain:t,previousRate:e,newRate:n});for(let i of this.alertCallbacks)try{i(r)}catch(a){g.error("Alert callback error",a instanceof Error?a:void 0)}}};function b(o){return new c(o)}export{b as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.1");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.2");process.exit(0)}
2
2
  var n=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization","enterprise-integration","coordination"];function t(e){return typeof e=="string"&&n.includes(e)}function r(e){return{success:!0,value:e}}function i(e){return{success:!1,error:e}}export{n as a,t as b,r as c,i as d};
@@ -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.1");process.exit(0)}
2
- import{a as R}from"./chunk-2K3QFLX2.js";import{e as g}from"./chunk-7FGSX4UD.js";import{S as v,b as l}from"./chunk-HU4QGCIJ.js";R();v();import{createHash as m,randomUUID as f}from"crypto";var a=g.create("witness-chain"),p=class{logLikelihoodRatio=0;upperBound;lowerBound;observations=0;constructor(t=.05,e=.05){this.upperBound=Math.log(1/t),this.lowerBound=Math.log(e)}addWeightedEvidence(t,e){return this.logLikelihoodRatio+=t?e:-e,this.observations++,this.logLikelihoodRatio>=this.upperBound?"PASS":this.logLikelihoodRatio<=this.lowerBound?"FAIL":"INCONCLUSIVE"}addEvidence(t){return this.addWeightedEvidence(t,.5)}getRatio(){return this.logLikelihoodRatio}getObservations(){return this.observations}getBounds(){return{upper:this.upperBound,lower:this.lowerBound}}reset(){this.logLikelihoodRatio=0,this.observations=0}},c="0".repeat(64),h=class{receipts=[];lastHash=c;sprtAccumulators=new Map;appendWitness(t){let e=f(),i=Date.now(),s=this.receipts.length,n=this.lastHash+JSON.stringify(t)+i,o=m("sha256").update(n).digest("hex"),u={id:e,timestamp:i,previousHash:this.lastHash,hash:o,decision:t,chainIndex:s};return this.receipts.push(u),this.lastHash=o,this.updateSPRT(t),a.debug("Witness appended",{chainIndex:s,type:t.type,decision:t.decision,hash:o.slice(0,16)+"..."}),u}verifyChain(){if(this.receipts.length===0)return{valid:!0,length:0,brokenAt:-1,message:"Chain is empty (valid)",lastHash:c};let t=c;for(let e=0;e<this.receipts.length;e++){let i=this.receipts[e];if(i.previousHash!==t)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: previousHash mismatch`,lastHash:this.lastHash};let s=i.previousHash+JSON.stringify(i.decision)+i.timestamp,n=m("sha256").update(s).digest("hex");if(i.hash!==n)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: hash mismatch (tamper detected)`,lastHash:this.lastHash};t=i.hash}return{valid:!0,length:this.receipts.length,brokenAt:-1,message:`Chain valid (${this.receipts.length} receipts)`,lastHash:this.lastHash}}getChain(t){return t!==void 0&&t>0?[...this.receipts.slice(-t)]:[...this.receipts]}getChainLength(){return this.receipts.length}getLastHash(){return this.lastHash}exportChain(){let t={version:"1.0.0",exportedAt:Date.now(),length:this.receipts.length,receipts:this.receipts};return JSON.stringify(t,null,2)}importChain(t){try{let e=JSON.parse(t);if(!e||e.version!=="1.0.0"||!Array.isArray(e.receipts))return a.warn("Import failed: invalid format"),!1;let i=this.receipts,s=this.lastHash;this.receipts=e.receipts,this.lastHash=e.receipts.length>0?e.receipts[e.receipts.length-1].hash:c;let n=this.verifyChain();return n.valid?(a.info("Chain imported successfully",{length:e.receipts.length}),!0):(this.receipts=i,this.lastHash=s,a.warn("Import failed: chain integrity check failed",{message:n.message}),!1)}catch(e){return a.warn("Import failed: parse error",{error:e instanceof Error?e.message:String(e)}),!1}}getSPRT(t,e,i){return this.sprtAccumulators.has(t)||this.sprtAccumulators.set(t,new p(e,i)),this.sprtAccumulators.get(t)}getReceipt(t){return this.receipts[t]}updateSPRT(t){let e=t.decision==="PASS"||t.decision==="PERMIT";this.getSPRT(t.type).addEvidence(e)}},d=class extends h{persistence;constructor(t){super(),this.persistence=t;let e=t.loadAllReceipts();if(e.length>0){let i={version:"1.0.0",exportedAt:Date.now(),length:e.length,receipts:e};this.importChain(JSON.stringify(i))?a.info("Witness chain restored from SQLite",{receipts:e.length}):a.warn("Failed to restore witness chain from SQLite \u2014 starting fresh")}}appendWitness(t){let e=super.appendWitness(t);try{this.persistence.insertReceipt(e)}catch(i){a.warn("Failed to persist witness receipt to SQLite",{chainIndex:e.chainIndex,error:i instanceof Error?i.message:String(i)})}return e}};function C(r){r.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.2");process.exit(0)}
2
+ import{a as R}from"./chunk-I7ECEOFV.js";import{e as g}from"./chunk-CV7E627D.js";import{S as v,b as l}from"./chunk-3DCRAW43.js";R();v();import{createHash as m,randomUUID as f}from"crypto";var a=g.create("witness-chain"),p=class{logLikelihoodRatio=0;upperBound;lowerBound;observations=0;constructor(t=.05,e=.05){this.upperBound=Math.log(1/t),this.lowerBound=Math.log(e)}addWeightedEvidence(t,e){return this.logLikelihoodRatio+=t?e:-e,this.observations++,this.logLikelihoodRatio>=this.upperBound?"PASS":this.logLikelihoodRatio<=this.lowerBound?"FAIL":"INCONCLUSIVE"}addEvidence(t){return this.addWeightedEvidence(t,.5)}getRatio(){return this.logLikelihoodRatio}getObservations(){return this.observations}getBounds(){return{upper:this.upperBound,lower:this.lowerBound}}reset(){this.logLikelihoodRatio=0,this.observations=0}},c="0".repeat(64),h=class{receipts=[];lastHash=c;sprtAccumulators=new Map;appendWitness(t){let e=f(),i=Date.now(),s=this.receipts.length,n=this.lastHash+JSON.stringify(t)+i,o=m("sha256").update(n).digest("hex"),u={id:e,timestamp:i,previousHash:this.lastHash,hash:o,decision:t,chainIndex:s};return this.receipts.push(u),this.lastHash=o,this.updateSPRT(t),a.debug("Witness appended",{chainIndex:s,type:t.type,decision:t.decision,hash:o.slice(0,16)+"..."}),u}verifyChain(){if(this.receipts.length===0)return{valid:!0,length:0,brokenAt:-1,message:"Chain is empty (valid)",lastHash:c};let t=c;for(let e=0;e<this.receipts.length;e++){let i=this.receipts[e];if(i.previousHash!==t)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: previousHash mismatch`,lastHash:this.lastHash};let s=i.previousHash+JSON.stringify(i.decision)+i.timestamp,n=m("sha256").update(s).digest("hex");if(i.hash!==n)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: hash mismatch (tamper detected)`,lastHash:this.lastHash};t=i.hash}return{valid:!0,length:this.receipts.length,brokenAt:-1,message:`Chain valid (${this.receipts.length} receipts)`,lastHash:this.lastHash}}getChain(t){return t!==void 0&&t>0?[...this.receipts.slice(-t)]:[...this.receipts]}getChainLength(){return this.receipts.length}getLastHash(){return this.lastHash}exportChain(){let t={version:"1.0.0",exportedAt:Date.now(),length:this.receipts.length,receipts:this.receipts};return JSON.stringify(t,null,2)}importChain(t){try{let e=JSON.parse(t);if(!e||e.version!=="1.0.0"||!Array.isArray(e.receipts))return a.warn("Import failed: invalid format"),!1;let i=this.receipts,s=this.lastHash;this.receipts=e.receipts,this.lastHash=e.receipts.length>0?e.receipts[e.receipts.length-1].hash:c;let n=this.verifyChain();return n.valid?(a.info("Chain imported successfully",{length:e.receipts.length}),!0):(this.receipts=i,this.lastHash=s,a.warn("Import failed: chain integrity check failed",{message:n.message}),!1)}catch(e){return a.warn("Import failed: parse error",{error:e instanceof Error?e.message:String(e)}),!1}}getSPRT(t,e,i){return this.sprtAccumulators.has(t)||this.sprtAccumulators.set(t,new p(e,i)),this.sprtAccumulators.get(t)}getReceipt(t){return this.receipts[t]}updateSPRT(t){let e=t.decision==="PASS"||t.decision==="PERMIT";this.getSPRT(t.type).addEvidence(e)}},d=class extends h{persistence;constructor(t){super(),this.persistence=t;let e=t.loadAllReceipts();if(e.length>0){let i={version:"1.0.0",exportedAt:Date.now(),length:e.length,receipts:e};this.importChain(JSON.stringify(i))?a.info("Witness chain restored from SQLite",{receipts:e.length}):a.warn("Failed to restore witness chain from SQLite \u2014 starting fresh")}}appendWitness(t){let e=super.appendWitness(t);try{this.persistence.insertReceipt(e)}catch(i){a.warn("Failed to persist witness receipt to SQLite",{chainIndex:e.chainIndex,error:i instanceof Error?i.message:String(i)})}return e}};function C(r){r.exec(`
3
3
  CREATE TABLE IF NOT EXISTS witness_chain_receipts (
4
4
  id TEXT PRIMARY KEY,
5
5
  chain_index INTEGER NOT NULL,
@@ -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.1");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.2");process.exit(0)}
2
2
  var p={"||":1,"&&":2,"===":3,"!==":3,"==":3,"!=":3,"<":4,">":4,"<=":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6},l=new Set(Object.keys(p)),w=new Set(["!","-","+"]);function h(r){let n=[],e=0;for(;e<r.length;){let t=r[e];if(/\s/.test(t)){e++;continue}if(/\d/.test(t)||t==="."&&/\d/.test(r[e+1])){let s="";for(;e<r.length&&/[\d.]/.test(r[e]);)s+=r[e++];n.push({type:"NUMBER",value:parseFloat(s),raw:s});continue}if(t==='"'||t==="'"){let s=t,u="";for(e++;e<r.length&&r[e]!==s;){if(r[e]==="\\"&&e+1<r.length){e++;let c=r[e];switch(c){case"n":u+=`
3
3
  `;break;case"t":u+=" ";break;case"r":u+="\r";break;default:u+=c}}else u+=r[e];e++}e++,n.push({type:"STRING",value:u,raw:`${s}${u}${s}`});continue}if(/[a-zA-Z_$]/.test(t)){let s="";for(;e<r.length&&/[a-zA-Z0-9_$]/.test(r[e]);)s+=r[e++];s==="true"?n.push({type:"BOOLEAN",value:!0,raw:s}):s==="false"?n.push({type:"BOOLEAN",value:!1,raw:s}):s==="null"?n.push({type:"NULL",value:null,raw:s}):s==="undefined"?n.push({type:"UNDEFINED",value:void 0,raw:s}):n.push({type:"IDENTIFIER",value:s,raw:s});continue}let a=r.slice(e,e+2),o=r.slice(e,e+3);if(o==="==="||o==="!=="){n.push({type:"OPERATOR",value:o,raw:o}),e+=3;continue}if(a==="=="||a==="!="||a==="<="||a===">="||a==="&&"||a==="||"){n.push({type:"OPERATOR",value:a,raw:a}),e+=2;continue}if(t==="("){n.push({type:"LPAREN",value:"(",raw:"("}),e++;continue}if(t===")"){n.push({type:"RPAREN",value:")",raw:")"}),e++;continue}if(t==="."){n.push({type:"DOT",value:".",raw:"."}),e++;continue}if("+-*/%<>!".includes(t)){n.push({type:"OPERATOR",value:t,raw:t}),e++;continue}throw new Error(`Unexpected character at position ${e}: ${t}`)}return n.push({type:"EOF",value:"",raw:""}),n}var i=class{tokens;pos=0;context;constructor(n,e){this.tokens=n,this.context=e}current(){return this.tokens[this.pos]}advance(){return this.tokens[this.pos++]}expect(n){let e=this.current();if(e.type!==n)throw new Error(`Expected ${n}, got ${e.type}`);return this.advance()}parse(){let n=this.parseExpression(0);if(this.current().type!=="EOF")throw new Error(`Unexpected token: ${this.current().raw}`);return n}parseExpression(n){let e=this.parseUnary();for(;;){let t=this.current();if(t.type!=="OPERATOR"||!l.has(t.value))break;let a=p[t.value];if(a<n)break;let o=this.advance().value,s=this.parseExpression(a+1);e=this.applyBinaryOperator(o,e,s)}return e}parseUnary(){let n=this.current();if(n.type==="OPERATOR"&&w.has(n.value)){let e=this.advance().value,t=this.parseUnary();return this.applyUnaryOperator(e,t)}return this.parsePrimary()}parsePrimary(){let n=this.current();switch(n.type){case"NUMBER":case"STRING":case"BOOLEAN":case"NULL":case"UNDEFINED":return this.advance(),n.value;case"IDENTIFIER":return this.parseIdentifier();case"LPAREN":{this.advance();let e=this.parseExpression(0);return this.expect("RPAREN"),e}default:throw new Error(`Unexpected token: ${n.raw}`)}}parseIdentifier(){let n=this.context,e=this.advance().value;for(typeof n=="object"&&n!==null&&(e in n)?n=n[e]:n=void 0;this.current().type==="DOT";){this.advance();let t=this.expect("IDENTIFIER").value;n!=null&&typeof n=="object"?n=n[t]:n=void 0}return n}applyBinaryOperator(n,e,t){switch(n){case"===":return e===t;case"!==":return e!==t;case"==":return e==t;case"!=":return e!=t;case"<":return e<t;case">":return e>t;case"<=":return e<=t;case">=":return e>=t;case"&&":return e&&t;case"||":return e||t;case"+":return e+t;case"-":return e-t;case"*":return e*t;case"/":return e/t;case"%":return e%t;default:throw new Error(`Unknown operator: ${n}`)}}applyUnaryOperator(n,e){switch(n){case"!":return!e;case"-":return-e;case"+":return+e;default:throw new Error(`Unknown unary operator: ${n}`)}}};function E(r,n={}){if(!r||typeof r!="string")throw new Error("Expression must be a non-empty string");let e=[/\beval\b/i,/\bFunction\b/,/\bconstructor\b/,/\b__proto__\b/,/\bprototype\b/,/\bimport\b/,/\brequire\b/,/\bprocess\b/,/\bglobal\b/,/\bwindow\b/,/\bdocument\b/,/\[\s*['"`]/,/\[.*\]/];for(let o of e)if(o.test(r))throw new Error(`Expression contains potentially dangerous pattern: ${r}`);let t=h(r.trim());return new i(t,n).parse()}function b(r,n={},e=!1){try{return!!E(r,n)}catch(t){return console.warn(`[SafeEvaluator] Failed to evaluate expression: ${r}`,t),e}}export{b as a};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.1");process.exit(0)}
2
- import{a as N,d as P}from"./chunk-UE33MZOC.js";import{b,e as k}from"./chunk-ADEYBXAS.js";import{a as T,b as E}from"./chunk-WQZR6DS6.js";import{a as H,b as O}from"./chunk-WPG6SW7C.js";import{a as p,d as F}from"./chunk-SRXXPZVT.js";import{b as z,f as S}from"./chunk-PNK5KHSI.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
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.2");process.exit(0)}
2
+ import{a as N,d as P}from"./chunk-FH6N2LKG.js";import{b,e as k}from"./chunk-ZIKH7U5A.js";import{a as T,b as E}from"./chunk-WBZIOTY6.js";import{a as H,b as O}from"./chunk-ITM26I6O.js";import{a as p,d as F}from"./chunk-3RC5UMRJ.js";import{b as z,f as S}from"./chunk-D75HDHX3.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
@@ -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.1");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.2");process.exit(0)}
2
2
  var o=!1;function r(t){if(!o){for(let e of["ALTER TABLE routing_outcomes ADD COLUMN exploration INTEGER NOT NULL DEFAULT 0","ALTER TABLE routing_outcomes ADD COLUMN criticality REAL","ALTER TABLE routing_outcomes ADD COLUMN q_weight REAL"])try{t.prepare(e).run()}catch{}try{t.prepare("CREATE INDEX IF NOT EXISTS idx_routing_outcomes_exploration ON routing_outcomes(exploration)").run()}catch{}o=!0}}export{r as a};