agentic-qe 3.15.15 → 3.15.16

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 (495) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +90 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/audit/witness-chain.d.ts +7 -0
  5. package/dist/audit/witness-chain.js +10 -0
  6. package/dist/cli/bundle.js +6 -6
  7. package/dist/cli/chunks/adapter-6CQ2PIP5.js +2 -0
  8. package/dist/cli/chunks/{agent-booster-wasm-EUF4XVUC.js → agent-booster-wasm-45NWEKVS.js} +2 -2
  9. package/dist/cli/chunks/{agent-handler-MOX6PSIQ.js → agent-handler-LVHMYFEF.js} +2 -2
  10. package/dist/cli/chunks/{agent-memory-branch-AEXKIGDG.js → agent-memory-branch-YDWOJFEQ.js} +2 -2
  11. package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +2 -0
  12. package/dist/cli/chunks/{arena-IQ5ZZDRF.js → arena-CZKHXDDS.js} +2 -2
  13. package/dist/cli/chunks/{arena-M7GA3CVG.js → arena-ELDZH3CZ.js} +4 -4
  14. package/dist/cli/chunks/{audit-4IPBMKWB.js → audit-5MT4T47Z.js} +3 -3
  15. package/dist/cli/chunks/base-SMCMMVGP.js +2 -0
  16. package/dist/cli/chunks/{better-sqlite3-IKDKJ2IE.js → better-sqlite3-6TGYPC2B.js} +2 -2
  17. package/dist/cli/chunks/{brain-handler-5NQUDH4W.js → brain-handler-HQWZFO52.js} +3 -3
  18. package/dist/cli/chunks/{branch-enumerator-KSXELWRC.js → branch-enumerator-WVILM4SO.js} +2 -2
  19. package/dist/cli/chunks/{browser-6LACARWE.js → browser-RX5ALU3H.js} +2 -2
  20. package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +2 -0
  21. package/dist/cli/chunks/{chunk-SJCKCSN3.js → chunk-24OX5TQJ.js} +1 -1
  22. package/dist/cli/chunks/{chunk-J3FP5UGL.js → chunk-24QHCVX6.js} +1 -1
  23. package/dist/cli/chunks/{chunk-BZULJMGH.js → chunk-2H4XH6FT.js} +2 -2
  24. package/dist/cli/chunks/{chunk-E3MRDIZF.js → chunk-2YZ4G6NW.js} +1 -1
  25. package/dist/cli/chunks/chunk-32BPDLRZ.js +27 -0
  26. package/dist/cli/chunks/{chunk-76P32JVU.js → chunk-32GN3JKR.js} +1 -1
  27. package/dist/cli/chunks/{chunk-W62OOK7A.js → chunk-3HD7E6HN.js} +2 -2
  28. package/dist/cli/chunks/{chunk-AJPROCDW.js → chunk-4D4DENG6.js} +2 -2
  29. package/dist/cli/chunks/{chunk-PFQCV6YS.js → chunk-4LQFBY5L.js} +6 -6
  30. package/dist/cli/chunks/{chunk-4ATQP3PR.js → chunk-4NFQLP6R.js} +1 -1
  31. package/dist/cli/chunks/{chunk-WUOOX7UG.js → chunk-525CFDUE.js} +2 -2
  32. package/dist/cli/chunks/chunk-5B5QPCNU.js +65 -0
  33. package/dist/cli/chunks/{chunk-SON6ZRH3.js → chunk-5JZRZI4S.js} +2 -2
  34. package/dist/cli/chunks/{chunk-2ZFLULL4.js → chunk-5LAVKGLH.js} +2 -2
  35. package/dist/cli/chunks/chunk-5NNNEWLS.js +755 -0
  36. package/dist/cli/chunks/{chunk-JCZCJE6X.js → chunk-5PBLPQ5T.js} +2 -2
  37. package/dist/cli/chunks/chunk-5QO3R3TU.js +6 -0
  38. package/dist/cli/chunks/{chunk-EKP2SC77.js → chunk-5SPCGMBB.js} +2 -2
  39. package/dist/cli/chunks/{chunk-3J3RNJNX.js → chunk-5V3TI2LG.js} +1 -1
  40. package/dist/cli/chunks/{chunk-UAQZI6N4.js → chunk-5VZL4UVN.js} +2 -2
  41. package/dist/cli/chunks/{chunk-MIA447GY.js → chunk-63GMRQ25.js} +1 -1
  42. package/dist/cli/chunks/{chunk-TODNOP7C.js → chunk-63ZKI4PX.js} +6 -6
  43. package/dist/cli/chunks/{chunk-TZIHDJZD.js → chunk-67Z5R7RJ.js} +2 -2
  44. package/dist/cli/chunks/{chunk-WVXJ2QIG.js → chunk-6DPYNAOK.js} +2 -2
  45. package/dist/cli/chunks/{chunk-4HKAD25N.js → chunk-6ICX3FEG.js} +3 -3
  46. package/dist/cli/chunks/{chunk-BLL2XU7A.js → chunk-6XXZDV2C.js} +2 -2
  47. package/dist/cli/chunks/{chunk-R6LHJ7ME.js → chunk-6ZBXSOX6.js} +2 -2
  48. package/dist/cli/chunks/{chunk-5PTAFGJT.js → chunk-72XSEQMW.js} +2 -2
  49. package/dist/cli/chunks/{chunk-GKSMRBHU.js → chunk-7TE5ONQQ.js} +1 -1
  50. package/dist/cli/chunks/{chunk-UJABDXST.js → chunk-A5GBXCP5.js} +2 -2
  51. package/dist/cli/chunks/{chunk-22UKJGGN.js → chunk-AAMLQ2LF.js} +3 -3
  52. package/dist/cli/chunks/chunk-AG2EWGXS.js +21 -0
  53. package/dist/cli/chunks/{chunk-SZAZQZWI.js → chunk-AGRV5B3T.js} +2 -2
  54. package/dist/cli/chunks/{chunk-XH4JMX5O.js → chunk-AJMJNQMP.js} +1 -1
  55. package/dist/cli/chunks/{chunk-ZIPAB5J6.js → chunk-AR67RJPY.js} +2 -2
  56. package/dist/cli/chunks/{chunk-GGQGCT4Y.js → chunk-ASEOFRIG.js} +2 -2
  57. package/dist/cli/chunks/{chunk-AHMWD6JG.js → chunk-BEKDKVQT.js} +2 -2
  58. package/dist/cli/chunks/{chunk-W27AJ5B4.js → chunk-BY5OF7OH.js} +2 -2
  59. package/dist/cli/chunks/{chunk-T67R2MUN.js → chunk-C5FP5GW3.js} +2 -2
  60. package/dist/cli/chunks/{chunk-XHHWABJV.js → chunk-C6D5AHBO.js} +2 -2
  61. package/dist/cli/chunks/{chunk-PXATBHWN.js → chunk-CAKMOVZ6.js} +2 -2
  62. package/dist/cli/chunks/{chunk-337Z52QM.js → chunk-CEYSYSK5.js} +2 -2
  63. package/dist/cli/chunks/{chunk-KJBPB7P5.js → chunk-CGGUM2YJ.js} +2 -2
  64. package/dist/cli/chunks/{chunk-CAOUV5GZ.js → chunk-CJSHWQXP.js} +2 -2
  65. package/dist/cli/chunks/{chunk-GCHYOPRZ.js → chunk-CRPIYUTJ.js} +2 -2
  66. package/dist/cli/chunks/{chunk-RIRZHOS2.js → chunk-D6COXLYE.js} +2 -2
  67. package/dist/cli/chunks/{chunk-O6EWL5DQ.js → chunk-DTMAS2GB.js} +2 -2
  68. package/dist/cli/chunks/{chunk-XM6ZVFM5.js → chunk-DVYHMDFR.js} +470 -411
  69. package/dist/cli/chunks/chunk-DXD6K2ZP.js +3 -0
  70. package/dist/cli/chunks/{chunk-74YG72NQ.js → chunk-E3D4GPLP.js} +3 -3
  71. package/dist/cli/chunks/{chunk-KCQNFBBR.js → chunk-EA4YQVKS.js} +1 -1
  72. package/dist/cli/chunks/{chunk-4D4CWP72.js → chunk-EGYE5UPQ.js} +2 -2
  73. package/dist/cli/chunks/{chunk-DURD37JZ.js → chunk-EK7OLYOZ.js} +2 -2
  74. package/dist/cli/chunks/{chunk-DKX4GNRU.js → chunk-F742SZAX.js} +2 -2
  75. package/dist/cli/chunks/{chunk-JCQGJGGZ.js → chunk-FBDVGRSC.js} +1 -1
  76. package/dist/cli/chunks/{chunk-LVABQNRF.js → chunk-FDDC72IA.js} +2 -2
  77. package/dist/cli/chunks/{chunk-5AFVEWMT.js → chunk-FL64OUBA.js} +2 -2
  78. package/dist/cli/chunks/{chunk-5I7357KS.js → chunk-FLNAW7C4.js} +2 -2
  79. package/dist/cli/chunks/{chunk-BQ47GQPK.js → chunk-G5RHFBAY.js} +2 -2
  80. package/dist/cli/chunks/{chunk-XIVVTYM2.js → chunk-GAHNO6JJ.js} +2 -2
  81. package/dist/cli/chunks/{chunk-X33CWRDF.js → chunk-GFWHUQSF.js} +2 -2
  82. package/dist/cli/chunks/{chunk-VMAM46HQ.js → chunk-GJYHWYXR.js} +2 -2
  83. package/dist/cli/chunks/{chunk-ZYJB6FML.js → chunk-GQ6TUIKY.js} +1 -1
  84. package/dist/cli/chunks/{chunk-E56PVVWC.js → chunk-GSKMOPL7.js} +2 -2
  85. package/dist/cli/chunks/{chunk-JUDUBQHA.js → chunk-HCH4Y6XX.js} +2 -2
  86. package/dist/cli/chunks/{chunk-QFGYH6HD.js → chunk-HGWXF45W.js} +1 -1
  87. package/dist/cli/chunks/{chunk-FTRSS64D.js → chunk-HJ6ZGVTB.js} +2 -2
  88. package/dist/cli/chunks/{chunk-6BRQPHMZ.js → chunk-HLUXXCHF.js} +1 -1
  89. package/dist/cli/chunks/{chunk-BP5T3OEV.js → chunk-HVRRLYX6.js} +4 -4
  90. package/dist/cli/chunks/{chunk-AOKKUB5F.js → chunk-I7MQIM2U.js} +1 -1
  91. package/dist/cli/chunks/{chunk-7XB3FCKM.js → chunk-IESR7TNB.js} +2 -2
  92. package/dist/cli/chunks/{chunk-OQG3UQQ7.js → chunk-IHRXZZQM.js} +1 -1
  93. package/dist/cli/chunks/{chunk-YUS6TWAL.js → chunk-IOKYCMTJ.js} +6 -6
  94. package/dist/cli/chunks/{chunk-ERN56H6S.js → chunk-IOQ6ZQ5W.js} +1 -1
  95. package/dist/cli/chunks/{chunk-GQABPCQE.js → chunk-IOYG4VFL.js} +2 -2
  96. package/dist/cli/chunks/{chunk-KLTMOXIK.js → chunk-IUBJVHNB.js} +2 -2
  97. package/dist/cli/chunks/{chunk-ZSOMUTNL.js → chunk-J442IZLE.js} +1 -1
  98. package/dist/cli/chunks/{chunk-G242G224.js → chunk-J4ELZNLY.js} +2 -2
  99. package/dist/cli/chunks/chunk-J7I6PABJ.js +153 -0
  100. package/dist/cli/chunks/chunk-JDIYMZCQ.js +2 -0
  101. package/dist/cli/chunks/{chunk-2IIXCEMS.js → chunk-JHQCRRJI.js} +2 -2
  102. package/dist/cli/chunks/{chunk-6LE362LZ.js → chunk-JQ3DYUMS.js} +2 -2
  103. package/dist/cli/chunks/{chunk-EFUJDMNC.js → chunk-KITOPKRG.js} +2 -2
  104. package/dist/cli/chunks/{chunk-M4CJCPCQ.js → chunk-KKU2QGSJ.js} +2 -2
  105. package/dist/cli/chunks/chunk-KL7OKSU2.js +4 -0
  106. package/dist/cli/chunks/{chunk-HL2ANKN3.js → chunk-KNSRL6NO.js} +2 -2
  107. package/dist/cli/chunks/{chunk-FOOW4JVS.js → chunk-KPRCB5LT.js} +2 -2
  108. package/dist/cli/chunks/{chunk-E5G4WZ2T.js → chunk-KQYJ4VQ5.js} +1 -1
  109. package/dist/cli/chunks/{chunk-RBKUU7WF.js → chunk-KU2AUFGX.js} +2 -2
  110. package/dist/cli/chunks/{chunk-UQPA33UK.js → chunk-KVF4NXGQ.js} +2 -2
  111. package/dist/cli/chunks/{chunk-BDKEAGQ2.js → chunk-KXCLACFG.js} +2 -2
  112. package/dist/cli/chunks/{chunk-K3WZICFA.js → chunk-L2DWPVNJ.js} +1 -1
  113. package/dist/cli/chunks/{chunk-6YVMX2TC.js → chunk-L6QSTQME.js} +2 -2
  114. package/dist/cli/chunks/{chunk-LJMYRTJ7.js → chunk-LE4QJREF.js} +1 -1
  115. package/dist/cli/chunks/{chunk-NWIIYHT6.js → chunk-LKTTUHLF.js} +2 -2
  116. package/dist/cli/chunks/{chunk-W5ZJG2OU.js → chunk-LQLPB2T6.js} +2 -2
  117. package/dist/cli/chunks/{chunk-JKJOB65O.js → chunk-LRSX2FJM.js} +1 -1
  118. package/dist/cli/chunks/chunk-M4FRQ4TE.js +12 -0
  119. package/dist/cli/chunks/chunk-M7WJCTG3.js +2 -0
  120. package/dist/cli/chunks/{chunk-6RBTS3NF.js → chunk-MAFQV4U4.js} +2 -2
  121. package/dist/cli/chunks/{chunk-UE2J6MA5.js → chunk-MD43XRX5.js} +1 -1
  122. package/dist/cli/chunks/{chunk-2CKERSMB.js → chunk-MI5MFHRA.js} +2 -2
  123. package/dist/cli/chunks/{chunk-T66PPF4D.js → chunk-MO55CVMT.js} +32 -32
  124. package/dist/cli/chunks/{chunk-C4KLXFJP.js → chunk-N7HL5PHH.js} +1 -1
  125. package/dist/cli/chunks/chunk-NAEWCFQT.js +14 -0
  126. package/dist/cli/chunks/{chunk-U62OUXBF.js → chunk-NDJ7P2EP.js} +1 -1
  127. package/dist/cli/chunks/{chunk-M4WMSCAE.js → chunk-NO3IV5Q5.js} +1 -1
  128. package/dist/cli/chunks/{chunk-27HE2BHC.js → chunk-NQXXI77K.js} +2 -2
  129. package/dist/cli/chunks/{chunk-NQS3BWS6.js → chunk-NVEWF4JV.js} +1 -1
  130. package/dist/cli/chunks/{chunk-EBTNMQSS.js → chunk-NZU4ACBZ.js} +2 -2
  131. package/dist/cli/chunks/chunk-O5W3FIO6.js +63 -0
  132. package/dist/cli/chunks/{chunk-BFQTLF5X.js → chunk-OAEE6JWQ.js} +2 -2
  133. package/dist/cli/chunks/{chunk-PS6UMZVK.js → chunk-OCV2XEWQ.js} +2 -2
  134. package/dist/cli/chunks/{chunk-BU4UQR36.js → chunk-P3EYRILV.js} +2 -2
  135. package/dist/cli/chunks/{chunk-LHMQIZ6B.js → chunk-PEQDY4BO.js} +2 -2
  136. package/dist/cli/chunks/{chunk-PYPS65P7.js → chunk-PF7RBAYL.js} +2 -2
  137. package/dist/cli/chunks/{chunk-UXIY4IAI.js → chunk-PHT5N7SC.js} +2 -2
  138. package/dist/cli/chunks/{chunk-GV2QE5TO.js → chunk-PINSJCM3.js} +1 -1
  139. package/dist/cli/chunks/{chunk-4X3SWKBA.js → chunk-PPUZWYUG.js} +2 -2
  140. package/dist/cli/chunks/{chunk-L32JNNKL.js → chunk-QPEOLAAS.js} +1 -1
  141. package/dist/cli/chunks/{chunk-UUBIQR6A.js → chunk-QQWBWEJS.js} +18 -18
  142. package/dist/cli/chunks/{chunk-VCXI4XC4.js → chunk-QVDCVD5D.js} +2 -2
  143. package/dist/cli/chunks/{chunk-JW74KRBC.js → chunk-RJIEG3NA.js} +2 -2
  144. package/dist/cli/chunks/{chunk-C4RTAVC6.js → chunk-RV74I3YO.js} +2 -2
  145. package/dist/cli/chunks/{chunk-5G4UFTV4.js → chunk-S75SOOZL.js} +2 -2
  146. package/dist/cli/chunks/{chunk-MV55NXTD.js → chunk-SASBO5Y5.js} +2 -2
  147. package/dist/cli/chunks/{chunk-UORB2QDU.js → chunk-SDLWKRVL.js} +2 -2
  148. package/dist/cli/chunks/{chunk-Y2OX6KGN.js → chunk-SHKOCGNK.js} +2 -2
  149. package/dist/cli/chunks/{chunk-6KCSKGVY.js → chunk-SI6DPU5D.js} +1 -1
  150. package/dist/cli/chunks/{chunk-LYJHUNBK.js → chunk-SJ6Y4725.js} +2 -2
  151. package/dist/cli/chunks/{chunk-7ACCBHRB.js → chunk-SR52XP5F.js} +1 -1
  152. package/dist/cli/chunks/{chunk-C5CXL3JP.js → chunk-SSUAAX3F.js} +2 -2
  153. package/dist/cli/chunks/{chunk-BBRROA3Z.js → chunk-SSYAQZXA.js} +2 -2
  154. package/dist/cli/chunks/{chunk-DUKE27HC.js → chunk-SUDMM5SO.js} +2 -2
  155. package/dist/cli/chunks/{chunk-H5DER3JY.js → chunk-TIUKLYAI.js} +1 -1
  156. package/dist/cli/chunks/{chunk-5C62XMJR.js → chunk-TVGI32MB.js} +33 -33
  157. package/dist/cli/chunks/{chunk-MPFPWJTH.js → chunk-U2A7NHZA.js} +2 -2
  158. package/dist/cli/chunks/{chunk-TX2CHQD7.js → chunk-UE5ZOZR2.js} +2 -2
  159. package/dist/cli/chunks/{chunk-OLZH5LRT.js → chunk-UHEOGZLX.js} +11 -11
  160. package/dist/cli/chunks/chunk-UNGBRZDK.js +12 -0
  161. package/dist/cli/chunks/{chunk-XWIAZG3C.js → chunk-V5NHZV7S.js} +2 -2
  162. package/dist/cli/chunks/{chunk-AP2W7Z3A.js → chunk-VJCIEHEF.js} +1 -1
  163. package/dist/cli/chunks/{chunk-K3XBQC3R.js → chunk-VMDFFTCK.js} +1 -1
  164. package/dist/cli/chunks/chunk-VSIKHWZ4.js +29 -0
  165. package/dist/cli/chunks/{chunk-LB2LGEDP.js → chunk-VWPM27GU.js} +2 -2
  166. package/dist/cli/chunks/{chunk-HTZSRMHW.js → chunk-VXFLJNCA.js} +2 -2
  167. package/dist/cli/chunks/{chunk-73PBAWAF.js → chunk-W5HQUIML.js} +2 -2
  168. package/dist/cli/chunks/{chunk-DEKR3CTS.js → chunk-WP4RETKG.js} +2 -2
  169. package/dist/cli/chunks/{chunk-ZWBGYJ7K.js → chunk-XIIQ5QTT.js} +2 -2
  170. package/dist/cli/chunks/{chunk-TDQWTSBS.js → chunk-XIQW7EFL.js} +2 -2
  171. package/dist/cli/chunks/{chunk-AKZO6GGG.js → chunk-XWUWX7BV.js} +4 -4
  172. package/dist/cli/chunks/{chunk-LNX74WHQ.js → chunk-Y4PFUMOU.js} +1 -1
  173. package/dist/cli/chunks/chunk-YAPLJR7K.js +2 -0
  174. package/dist/cli/chunks/{chunk-3CYNZFKH.js → chunk-YLMNVLDK.js} +1 -1
  175. package/dist/cli/chunks/{chunk-XG4F4XH4.js → chunk-YNMJEDN5.js} +2 -2
  176. package/dist/cli/chunks/{chunk-RDMRY7CT.js → chunk-YPBSUGMI.js} +1 -1
  177. package/dist/cli/chunks/{chunk-OBDONJQM.js → chunk-YRAX7SFJ.js} +2 -2
  178. package/dist/cli/chunks/{chunk-7BLZHFKD.js → chunk-YTHTQPWR.js} +1 -1
  179. package/dist/cli/chunks/{chunk-IXL5ZHWJ.js → chunk-YU2BDRSD.js} +1 -1
  180. package/dist/cli/chunks/chunk-ZB3LEFYG.js +2 -0
  181. package/dist/cli/chunks/{chunk-T4GE7MPI.js → chunk-ZFL436FN.js} +2 -2
  182. package/dist/cli/chunks/{chunk-CBK5CT6T.js → chunk-ZJH5MU2I.js} +2 -2
  183. package/dist/cli/chunks/{chunk-LTQVUAPH.js → chunk-ZQ2XW3IP.js} +2 -2
  184. package/dist/cli/chunks/chunk-ZR2TKVXQ.js +14 -0
  185. package/dist/cli/chunks/{ci-UCUJOSBW.js → ci-MFUR4CWV.js} +2 -2
  186. package/dist/cli/chunks/{ci-config-2XILD3XG.js → ci-config-PNDLQ6XV.js} +2 -2
  187. package/dist/cli/chunks/{ci-output-BL6KWOHW.js → ci-output-PFZ4M7NC.js} +2 -2
  188. package/dist/cli/chunks/{circuit-breaker-5XLIOXE5.js → circuit-breaker-5HH6NLZN.js} +2 -2
  189. package/dist/cli/chunks/{claude-flow-setup-4IMP6ACS.js → claude-flow-setup-QCKYLGLC.js} +2 -2
  190. package/dist/cli/chunks/client-MHQRTZM4.js +2 -0
  191. package/dist/cli/chunks/{cline-installer-RYLHCDK7.js → cline-installer-EASVPFXR.js} +2 -2
  192. package/dist/cli/chunks/{code-WY3GJXHX.js → code-UJXDVYRK.js} +4 -3
  193. package/dist/cli/chunks/{code-index-extractor-Y4MZBZCW.js → code-index-extractor-BZJ3UDP4.js} +2 -2
  194. package/dist/cli/chunks/{codex-installer-SCJ3T3DX.js → codex-installer-XSQZUVOZ.js} +2 -2
  195. package/dist/cli/chunks/{completions-CN2DXQFU.js → completions-OWOOJFI2.js} +2 -2
  196. package/dist/cli/chunks/{complexity-analyzer-7MDPPIBH.js → complexity-analyzer-KP5TOHDT.js} +2 -2
  197. package/dist/cli/chunks/{continuedev-installer-GCEJRK34.js → continuedev-installer-IFKQXLHM.js} +2 -2
  198. package/dist/cli/chunks/{copilot-installer-BHPDSELY.js → copilot-installer-IGJ6KGQY.js} +2 -2
  199. package/dist/cli/chunks/core-handlers-UAK3LLJE.js +2 -0
  200. package/dist/cli/chunks/{cost-tracker-VO5MFWR6.js → cost-tracker-MMDDNKZB.js} +2 -2
  201. package/dist/cli/chunks/{coverage-LYFQYNH6.js → coverage-LUH2B7NT.js} +3 -3
  202. package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +2 -0
  203. package/dist/cli/chunks/{cursor-installer-KP4HA7TV.js → cursor-installer-4YLM5GWM.js} +2 -2
  204. package/dist/cli/chunks/daemon-CAVZ7OFV.js +18 -0
  205. package/dist/cli/chunks/{daemon-7RC7TS57.js → daemon-MZKVM4CJ.js} +3 -3
  206. package/dist/cli/chunks/{dag-attention-scheduler-NKA44RSR.js → dag-attention-scheduler-X4CYW665.js} +2 -2
  207. package/dist/cli/chunks/{detect-CMYAJWYF.js → detect-7BM2XINO.js} +2 -2
  208. package/dist/cli/chunks/{dist-node-EN3PYEGW.js → dist-node-Y5APLEYB.js} +2 -2
  209. package/dist/cli/chunks/{domain-handler-EXSZCX7A.js → domain-handler-X3ZRJNAH.js} +2 -2
  210. package/dist/cli/chunks/{domain-plugins-HCQFSNL7.js → domain-plugins-2UW5KQJB.js} +2 -2
  211. package/dist/cli/chunks/{domain-transfer-3LGSNTPO.js → domain-transfer-35W4CIBV.js} +2 -2
  212. package/dist/cli/chunks/dream-EJY24JN6.js +2 -0
  213. package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +3 -0
  214. package/dist/cli/chunks/embedding-space-SBM2MZD2.js +2 -0
  215. package/dist/cli/chunks/{eval-OQELIWJK.js → eval-4QA2SROK.js} +2 -2
  216. package/dist/cli/chunks/experience-capture-middleware-Z6BF6KYM.js +40 -0
  217. package/dist/cli/chunks/{fast-paths-UV4NDEWM.js → fast-paths-FIORX6GN.js} +2 -2
  218. package/dist/cli/chunks/{feature-flags-CKTYX67J.js → feature-flags-6LYI2T4G.js} +2 -2
  219. package/dist/cli/chunks/{feature-flags-H7H33B6C.js → feature-flags-ZOO7LMIC.js} +2 -2
  220. package/dist/cli/chunks/file-discovery-UZSFSS4V.js +2 -0
  221. package/dist/cli/chunks/{fleet-ZJBCAKRG.js → fleet-7WF53H4F.js} +3 -3
  222. package/dist/cli/chunks/{gnn-wrapper-RUE2QZRG.js → gnn-wrapper-KJ6B7BRM.js} +2 -2
  223. package/dist/cli/chunks/{heartbeat-handler-XRV327M7.js → heartbeat-handler-DEKKMOVW.js} +4 -4
  224. package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +2 -0
  225. package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +2 -0
  226. package/dist/cli/chunks/hnsw-index-POCPMVJH.js +2 -0
  227. package/dist/cli/chunks/{hnsw-legacy-bridge-UJID6ZZ4.js → hnsw-legacy-bridge-L27WS27N.js} +2 -2
  228. package/dist/cli/chunks/{hnswlib-node-WS43R4AX.js → hnswlib-node-4YOQC6L4.js} +2 -2
  229. package/dist/cli/chunks/{hooks-YZNJKXAJ.js → hooks-TAOKV4EJ.js} +23 -22
  230. package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +2 -0
  231. package/dist/cli/chunks/{hypergraph-engine-XQJSIMTS.js → hypergraph-engine-BODRJLHL.js} +2 -2
  232. package/dist/cli/chunks/{hypergraph-handler-ZD2NYXMR.js → hypergraph-handler-RKMYJNTU.js} +3 -3
  233. package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +2 -0
  234. package/dist/cli/chunks/{init-guard-DSRUAVRT.js → init-guard-MXHSLSB2.js} +2 -2
  235. package/dist/cli/chunks/{init-handler-RJU5QMAP.js → init-handler-HUE57IFW.js} +6 -6
  236. package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +2 -0
  237. package/dist/cli/chunks/kernel-CCDWT7KS.js +2 -0
  238. package/dist/cli/chunks/{kilocode-installer-BCPOCVMC.js → kilocode-installer-S333IKYQ.js} +2 -2
  239. package/dist/cli/chunks/{kiro-installer-GFCWCB2S.js → kiro-installer-WM5DLQWC.js} +2 -2
  240. package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +2 -0
  241. package/dist/cli/chunks/{learning-FZTD72CF.js → learning-LNHMQLH5.js} +3 -3
  242. package/dist/cli/chunks/{llm-router-GJVKGRJL.js → llm-router-EWFXYZZR.js} +4 -4
  243. package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +2 -0
  244. package/dist/cli/chunks/{load-YKTPOYBE.js → load-FGYGWVDK.js} +2 -2
  245. package/dist/cli/chunks/load-test-UNZUWY3F.js +2 -0
  246. package/dist/cli/chunks/{mcp-LT6R2IKS.js → mcp-2FHNAAOM.js} +2 -2
  247. package/dist/cli/chunks/{memory-4HKKOLRY.js → memory-DZMQ73AB.js} +5 -5
  248. package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +2 -0
  249. package/dist/cli/chunks/memory-handlers-MP426XRJ.js +2 -0
  250. package/dist/cli/chunks/{multi-model-executor-2YPM2WTK.js → multi-model-executor-6F2UAEUW.js} +2 -2
  251. package/dist/cli/chunks/{opencode-installer-WBAJMH5K.js → opencode-installer-XY3BGOTZ.js} +2 -2
  252. package/dist/cli/chunks/{orchestrator-5W5WVMVJ.js → orchestrator-B4CNKUOS.js} +5 -5
  253. package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +2 -0
  254. package/dist/cli/chunks/{pattern-usage-recorder-GXRMNPAZ.js → pattern-usage-recorder-R4GUFNMD.js} +2 -2
  255. package/dist/cli/chunks/{pipeline-2NA4DRDA.js → pipeline-FG5RKVRO.js} +2 -2
  256. package/dist/cli/chunks/{platform-BGERNQ5V.js → platform-3BT4KEVJ.js} +2 -2
  257. package/dist/cli/chunks/{plugin-L4EPVENR.js → plugin-WI4RIN7O.js} +2 -2
  258. package/dist/cli/chunks/{prime-radiant-advanced-wasm-RTQRTPTM.js → prime-radiant-advanced-wasm-7ECDNQFS.js} +2 -2
  259. package/dist/cli/chunks/project-root-BEANNYWU.js +2 -0
  260. package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +2 -0
  261. package/dist/cli/chunks/{protocol-handler-SYQXM6JK.js → protocol-handler-WNODKPGW.js} +2 -2
  262. package/dist/cli/chunks/{prove-5O7GPJCU.js → prove-5RHAEPYZ.js} +2 -2
  263. package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +2 -0
  264. package/dist/cli/chunks/{quality-KIIDHGNF.js → quality-WPHR7BGQ.js} +2 -2
  265. package/dist/cli/chunks/{quality-gate-H65VECD3.js → quality-gate-4RKTEZMX.js} +3 -3
  266. package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +2 -0
  267. package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +2 -0
  268. package/dist/cli/chunks/{ref-validation-CSBJOMZM.js → ref-validation-TPAWHOHH.js} +2 -2
  269. package/dist/cli/chunks/{roocode-installer-G7OVYXEN.js → roocode-installer-7AVHFNDI.js} +2 -2
  270. package/dist/cli/chunks/router-EP34O3KB.js +2 -0
  271. package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +2 -0
  272. package/dist/cli/chunks/{routing-handler-ZNZPPI5Y.js → routing-handler-YKEDVJSH.js} +2 -2
  273. package/dist/cli/chunks/{ruvector-commands-C6IG3OY3.js → ruvector-commands-JUAMM354.js} +2 -2
  274. package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +2 -0
  275. package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +2 -0
  276. package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +2 -0
  277. package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +2 -0
  278. package/dist/cli/chunks/{rvf-store-integrity-3G6LFLT3.js → rvf-store-integrity-VJDUIRTX.js} +2 -2
  279. package/dist/cli/chunks/safe-db-TCAU4FUT.js +2 -0
  280. package/dist/cli/chunks/schedule-NB5KV435.js +2 -0
  281. package/dist/cli/chunks/scheduler-JKXGKVK6.js +2 -0
  282. package/dist/cli/chunks/{security-A3IMVLFM.js → security-ORDN3RD2.js} +3 -3
  283. package/dist/cli/chunks/{shared-rvf-adapter-VHWQ6US5.js → shared-rvf-adapter-CF4BCIO7.js} +2 -2
  284. package/dist/cli/chunks/{shared-rvf-dual-writer-JB3QS7IG.js → shared-rvf-dual-writer-C32UBR6D.js} +2 -2
  285. package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +2 -0
  286. package/dist/cli/chunks/{standalone-memory-DDNXCSBD.js → standalone-memory-OXRJYZXN.js} +2 -2
  287. package/dist/cli/chunks/{status-handler-2HK7XPEK.js → status-handler-BCX5D4HY.js} +2 -2
  288. package/dist/cli/chunks/{structural-health-DSJVLEPV.js → structural-health-LFG7RUU6.js} +2 -2
  289. package/dist/cli/chunks/sync-OSF7C2NL.js +2 -0
  290. package/dist/cli/chunks/{sync-NTUR53PI.js → sync-YJEE2K2L.js} +2 -2
  291. package/dist/cli/chunks/task-handler-6LXKPTXJ.js +64 -0
  292. package/dist/cli/chunks/{task-handlers-VJR6EHRZ.js → task-handlers-CILP36I7.js} +4 -4
  293. package/dist/cli/chunks/{test-O6FK3FVF.js → test-SD457QJ6.js} +4 -4
  294. package/dist/cli/chunks/test-runner-process-VKD65QQU.js +2 -0
  295. package/dist/cli/chunks/{test-scheduling-Q6QEEOS6.js → test-scheduling-ISI2O4Q5.js} +3 -3
  296. package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +2 -0
  297. package/dist/cli/chunks/{token-usage-YEEFWSSI.js → token-usage-XOC5KG7S.js} +2 -2
  298. package/dist/cli/chunks/{transformers-BZCHJJJT.js → transformers-LSLQAARK.js} +2 -2
  299. package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +2 -0
  300. package/dist/cli/chunks/{types-4AOKZYOX.js → types-5BLCGLCR.js} +2 -2
  301. package/dist/cli/chunks/unified-memory-GI76TXFV.js +2 -0
  302. package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +2 -0
  303. package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +2 -0
  304. package/dist/cli/chunks/{upgrade-2MWW6BT2.js → upgrade-RQJYLK3J.js} +2 -2
  305. package/dist/cli/chunks/{validate-PAEV3GT5.js → validate-QBHWXXCK.js} +2 -2
  306. package/dist/cli/chunks/{validate-swarm-ZIXACK5K.js → validate-swarm-IKXBKFB5.js} +2 -2
  307. package/dist/cli/chunks/visual-security-GZ2MOKWB.js +2 -0
  308. package/dist/cli/chunks/{web-tree-sitter-VLTXZFAB.js → web-tree-sitter-ZF6FIE5R.js} +2 -2
  309. package/dist/cli/chunks/{windsurf-installer-VELMLOZF.js → windsurf-installer-HQGDZT5D.js} +2 -2
  310. package/dist/cli/chunks/witness-chain-DCHCAMSQ.js +2 -0
  311. package/dist/cli/chunks/witness-chain-P3XXXA62.js +2 -0
  312. package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +2 -0
  313. package/dist/cli/chunks/{witness-chain-verifier-MIDWD4JS.js → witness-chain-verifier-PX2OQ6XT.js} +2 -2
  314. package/dist/cli/chunks/{witness-key-manager-OSVCWOB2.js → witness-key-manager-RXYQNFJB.js} +2 -2
  315. package/dist/cli/chunks/{workflow-MK7A7QCX.js → workflow-FBKCA4H6.js} +4 -4
  316. package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +2 -0
  317. package/dist/cli/chunks/wrappers-TWSKBTWD.js +2 -0
  318. package/dist/cli/commands/code.js +4 -0
  319. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +10 -2
  320. package/dist/cli/handlers/task-handler.d.ts +5 -0
  321. package/dist/cli/handlers/task-handler.js +21 -1
  322. package/dist/cli/utils/task-result.d.ts +11 -0
  323. package/dist/cli/utils/task-result.js +39 -0
  324. package/dist/coordination/handlers/test-execution-handlers.js +92 -58
  325. package/dist/coordination/mincut/mincut-persistence.js +29 -25
  326. package/dist/domains/code-intelligence/coordinator.d.ts +4 -0
  327. package/dist/domains/code-intelligence/coordinator.js +46 -13
  328. package/dist/domains/code-intelligence/interfaces.d.ts +10 -1
  329. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +32 -7
  330. package/dist/domains/code-intelligence/services/semantic-analyzer.js +112 -53
  331. package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
  332. package/dist/domains/quality-assessment/coordinator.js +2 -1
  333. package/dist/domains/test-execution/coordinator.js +10 -5
  334. package/dist/domains/test-execution/interfaces.d.ts +12 -0
  335. package/dist/domains/test-execution/plugin.js +6 -2
  336. package/dist/domains/test-execution/services/retry-handler.d.ts +2 -0
  337. package/dist/domains/test-execution/services/retry-handler.js +14 -9
  338. package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
  339. package/dist/domains/test-execution/services/test-executor.js +28 -9
  340. package/dist/domains/visual-accessibility/coordinator.d.ts +15 -7
  341. package/dist/domains/visual-accessibility/coordinator.js +15 -7
  342. package/dist/domains/visual-accessibility/interfaces.d.ts +27 -3
  343. package/dist/domains/visual-accessibility/services/accessibility-contrast.d.ts +39 -0
  344. package/dist/domains/visual-accessibility/services/accessibility-contrast.js +93 -0
  345. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +18 -3
  346. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +50 -40
  347. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.d.ts +27 -0
  348. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.js +137 -0
  349. package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +5 -0
  350. package/dist/domains/visual-accessibility/services/accessibility-tester.js +43 -24
  351. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +2 -3
  352. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -14
  353. package/dist/feedback/coverage-learner.js +13 -9
  354. package/dist/feedback/test-outcome-tracker.js +13 -9
  355. package/dist/governance/witness-chain.d.ts +5 -0
  356. package/dist/governance/witness-chain.js +22 -6
  357. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +22 -0
  358. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +115 -45
  359. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts +6 -0
  360. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +51 -33
  361. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +17 -9
  362. package/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +8 -0
  363. package/dist/integrations/embeddings/cache/EmbeddingCache.js +24 -10
  364. package/dist/integrations/ruvector/delta-tracker.d.ts +11 -0
  365. package/dist/integrations/ruvector/delta-tracker.js +16 -0
  366. package/dist/integrations/ruvector/sona-persistence.d.ts +10 -0
  367. package/dist/integrations/ruvector/sona-persistence.js +49 -24
  368. package/dist/kernel/unified-memory.d.ts +24 -0
  369. package/dist/kernel/unified-memory.js +63 -8
  370. package/dist/learning/aqe-learning-engine.js +1 -1
  371. package/dist/learning/embed-and-insert-pattern.js +4 -2
  372. package/dist/learning/embedder-endpoint-client.d.ts +31 -0
  373. package/dist/learning/embedder-endpoint-client.js +103 -10
  374. package/dist/learning/embedding-space.d.ts +12 -0
  375. package/dist/learning/embedding-space.js +17 -0
  376. package/dist/learning/experience-capture-middleware.js +25 -13
  377. package/dist/learning/experience-capture.js +1 -1
  378. package/dist/learning/experience-consolidation.d.ts +18 -0
  379. package/dist/learning/experience-consolidation.js +55 -8
  380. package/dist/learning/experience-space-verification.d.ts +71 -0
  381. package/dist/learning/experience-space-verification.js +147 -0
  382. package/dist/learning/pattern-lifecycle.d.ts +40 -4
  383. package/dist/learning/pattern-lifecycle.js +153 -76
  384. package/dist/learning/pattern-null-store.d.ts +5 -0
  385. package/dist/learning/pattern-null-store.js +8 -0
  386. package/dist/learning/pattern-promotion.js +6 -3
  387. package/dist/learning/pattern-store.d.ts +6 -0
  388. package/dist/learning/pattern-store.js +19 -6
  389. package/dist/learning/qe-reasoning-bank.js +2 -2
  390. package/dist/learning/real-embeddings.js +3 -1
  391. package/dist/learning/real-qe-reasoning-bank.d.ts +5 -0
  392. package/dist/learning/real-qe-reasoning-bank.js +77 -47
  393. package/dist/learning/rvf-pattern-store.js +6 -2
  394. package/dist/learning/sqlite-persistence.d.ts +6 -0
  395. package/dist/learning/sqlite-persistence.js +10 -0
  396. package/dist/mcp/bundle.js +641 -570
  397. package/dist/mcp/entry.js +4 -0
  398. package/dist/mcp/handlers/domain-handler-configs.js +2 -0
  399. package/dist/mcp/handlers/trajectory-judge.js +1 -1
  400. package/dist/mcp/protocol-server.js +1 -0
  401. package/dist/mcp/tools/visual-accessibility/index.js +8 -2
  402. package/dist/mcp/types.d.ts +6 -0
  403. package/dist/optimization/session-cache.d.ts +17 -1
  404. package/dist/optimization/session-cache.js +40 -36
  405. package/dist/planning/goap-planner.d.ts +6 -0
  406. package/dist/planning/goap-planner.js +35 -19
  407. package/dist/planning/plan-executor.js +24 -15
  408. package/dist/routing/co-execution-repository.js +12 -9
  409. package/dist/routing/routing-feedback.d.ts +8 -0
  410. package/dist/routing/routing-feedback.js +46 -24
  411. package/dist/routing/routing-outcomes-migration.js +7 -2
  412. package/dist/shared/llm/spend-ledger.d.ts +9 -0
  413. package/dist/shared/llm/spend-ledger.js +64 -39
  414. package/dist/shared/sqlite-lock-wait.d.ts +27 -0
  415. package/dist/shared/sqlite-lock-wait.js +37 -0
  416. package/dist/shared/sqlite-write-queue.d.ts +28 -0
  417. package/dist/shared/sqlite-write-queue.js +38 -0
  418. package/dist/shared/test-runner-project.d.ts +69 -0
  419. package/dist/shared/test-runner-project.js +186 -0
  420. package/dist/skills/security-visual-testing/index.d.ts +3 -1
  421. package/dist/skills/security-visual-testing/index.js +49 -35
  422. package/dist/skills/security-visual-testing/types.d.ts +19 -3
  423. package/dist/workers/workers/heartbeat-scheduler.js +5 -5
  424. package/dist/workers/workers/learning-consolidation.js +8 -7
  425. package/package.json +1 -1
  426. package/dist/cli/chunks/adapter-QU6INSKP.js +0 -2
  427. package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +0 -2
  428. package/dist/cli/chunks/base-OTGSN6IC.js +0 -2
  429. package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +0 -2
  430. package/dist/cli/chunks/chunk-2LUTPMBO.js +0 -21
  431. package/dist/cli/chunks/chunk-3HVFIITW.js +0 -2
  432. package/dist/cli/chunks/chunk-5KA5TVPR.js +0 -6
  433. package/dist/cli/chunks/chunk-6NBRMD25.js +0 -13
  434. package/dist/cli/chunks/chunk-7O45RQHF.js +0 -153
  435. package/dist/cli/chunks/chunk-EMSZVUYA.js +0 -29
  436. package/dist/cli/chunks/chunk-G6RDCCFV.js +0 -4
  437. package/dist/cli/chunks/chunk-HH4ED4F7.js +0 -744
  438. package/dist/cli/chunks/chunk-Q6I4SIUU.js +0 -65
  439. package/dist/cli/chunks/chunk-QGBGSQ2E.js +0 -14
  440. package/dist/cli/chunks/chunk-QRKTBSZT.js +0 -27
  441. package/dist/cli/chunks/chunk-SHRI7TKJ.js +0 -62
  442. package/dist/cli/chunks/chunk-UGYM4U44.js +0 -2
  443. package/dist/cli/chunks/chunk-VY4U6DPO.js +0 -12
  444. package/dist/cli/chunks/chunk-WNTA4YKE.js +0 -14
  445. package/dist/cli/chunks/chunk-XHLYGXYE.js +0 -2
  446. package/dist/cli/chunks/client-KKRNPX4F.js +0 -2
  447. package/dist/cli/chunks/core-handlers-47MPMED7.js +0 -2
  448. package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +0 -2
  449. package/dist/cli/chunks/daemon-AXLVPKVO.js +0 -18
  450. package/dist/cli/chunks/dream-76L6EEN7.js +0 -2
  451. package/dist/cli/chunks/embed-and-insert-pattern-B6MNHICW.js +0 -3
  452. package/dist/cli/chunks/experience-capture-middleware-SUFILYPW.js +0 -40
  453. package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +0 -2
  454. package/dist/cli/chunks/heartbeat-scheduler-NIK3KKEH.js +0 -2
  455. package/dist/cli/chunks/hnsw-adapter-WJG7LUJJ.js +0 -2
  456. package/dist/cli/chunks/hnsw-index-D6PRI5HC.js +0 -2
  457. package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +0 -2
  458. package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +0 -2
  459. package/dist/cli/chunks/init-wizard-JCKNGIGT.js +0 -2
  460. package/dist/cli/chunks/kernel-F7ILJTYD.js +0 -2
  461. package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +0 -2
  462. package/dist/cli/chunks/llm-router-service-TNOWQINA.js +0 -2
  463. package/dist/cli/chunks/load-test-FPVBK2EV.js +0 -2
  464. package/dist/cli/chunks/memory-backend-2QE7O67A.js +0 -2
  465. package/dist/cli/chunks/memory-handlers-X4CMVBXB.js +0 -2
  466. package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +0 -2
  467. package/dist/cli/chunks/project-root-S7WDFTMU.js +0 -2
  468. package/dist/cli/chunks/protocol-executor-OPANXQVB.js +0 -2
  469. package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +0 -2
  470. package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +0 -2
  471. package/dist/cli/chunks/real-embeddings-DYIOLKQ3.js +0 -2
  472. package/dist/cli/chunks/router-DBBW4NC2.js +0 -2
  473. package/dist/cli/chunks/routing-feedback-W35QHCL4.js +0 -2
  474. package/dist/cli/chunks/rvf-dual-writer-X3NSL25Z.js +0 -2
  475. package/dist/cli/chunks/rvf-migration-adapter-TZR7GDOK.js +0 -2
  476. package/dist/cli/chunks/rvf-migration-coordinator-4ATTHGHD.js +0 -2
  477. package/dist/cli/chunks/rvf-native-adapter-HD25ZYV5.js +0 -2
  478. package/dist/cli/chunks/safe-db-ZS2QKANY.js +0 -2
  479. package/dist/cli/chunks/schedule-ZH6VNA32.js +0 -2
  480. package/dist/cli/chunks/scheduler-T6CD74B6.js +0 -2
  481. package/dist/cli/chunks/sqlite-persistence-47WU5EKZ.js +0 -2
  482. package/dist/cli/chunks/sync-3MUV6S5E.js +0 -2
  483. package/dist/cli/chunks/task-handler-74MZN2EO.js +0 -62
  484. package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +0 -2
  485. package/dist/cli/chunks/token-bootstrap-TTRCECLP.js +0 -2
  486. package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +0 -2
  487. package/dist/cli/chunks/unified-memory-FZ5K2C7W.js +0 -2
  488. package/dist/cli/chunks/unified-memory-hnsw-VREWX56M.js +0 -2
  489. package/dist/cli/chunks/unified-persistence-YZGMKX6B.js +0 -2
  490. package/dist/cli/chunks/visual-security-GXGSFBVA.js +0 -2
  491. package/dist/cli/chunks/witness-chain-MRJKVCOW.js +0 -2
  492. package/dist/cli/chunks/witness-chain-WWHJKITG.js +0 -2
  493. package/dist/cli/chunks/witness-chain-repair-5SAXPETG.js +0 -2
  494. package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +0 -2
  495. package/dist/cli/chunks/wrappers-5QFMCKXL.js +0 -2
@@ -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.15");process.exit(0)}
2
- import{c as p}from"./chunk-KLTMOXIK.js";import*as u from"fs";import*as m from"path";var y=["coverage/coverage-final.json","coverage/coverage-summary.json",".coverage/coverage-final.json"];function F(r){for(let o of y){let s=m.join(r,o);if(u.existsSync(s))try{let t=u.readFileSync(s,"utf-8"),c=JSON.parse(t);if(c.total&&c.total.lines)return x(c,r);let n=new Map;for(let e of p(t).files)n.set(e.path,e);return n.size>0?n:null}catch{continue}}return null}function x(r,o){let s=new Map;for(let[t,c]of Object.entries(r)){if(t==="total")continue;let n=c;s.set(t,{path:t,lines:{covered:n.lines.covered,total:n.lines.total},branches:{covered:n.branches.covered,total:n.branches.total},functions:{covered:n.functions.covered,total:n.functions.total},statements:{covered:n.statements.covered,total:n.statements.total},uncoveredLines:[],uncoveredBranches:[]})}return s.size>0?s:null}function S(r,o){let t=o.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.16");process.exit(0)}
2
+ import{c as p}from"./chunk-IUBJVHNB.js";import*as u from"fs";import*as m from"path";var y=["coverage/coverage-final.json","coverage/coverage-summary.json",".coverage/coverage-final.json"];function F(r){for(let o of y){let s=m.join(r,o);if(u.existsSync(s))try{let t=u.readFileSync(s,"utf-8"),c=JSON.parse(t);if(c.total&&c.total.lines)return x(c,r);let n=new Map;for(let e of p(t).files)n.set(e.path,e);return n.size>0?n:null}catch{continue}}return null}function x(r,o){let s=new Map;for(let[t,c]of Object.entries(r)){if(t==="total")continue;let n=c;s.set(t,{path:t,lines:{covered:n.lines.covered,total:n.lines.total},branches:{covered:n.branches.covered,total:n.branches.total},functions:{covered:n.functions.covered,total:n.functions.total},statements:{covered:n.statements.covered,total:n.statements.total},uncoveredLines:[],uncoveredBranches:[]})}return s.size>0?s:null}function S(r,o){let t=o.split(`
3
3
  `).length,n=[r.replace(".ts",".test.ts").replace("/src/","/tests/"),r.replace(".ts",".spec.ts").replace("/src/","/tests/"),r.replace(".ts",".test.ts"),r.replace("/src/","/test/").replace(".ts",".test.ts")].some(f=>u.existsSync(f)),e=(o.match(/\bexport\b/g)||[]).length,a=(o.match(/\b(function|=>)\b/g)||[]).length,i=(o.match(/\b(if|switch|case|\?\?|\|\|)\b/g)||[]).length,l;if(n){let f=Math.min(i*.005,.15),b=Math.min(t*1e-4,.1);l=.85-f-b}else l=.2+(e>5?.1:0);l=Math.max(.05,Math.min(.95,l));let v=Math.floor(t*l),g=Math.max(a,1),d=Math.max(i,1),C=Math.floor(v*.7),M=Math.floor(g*l*.9),h=Array.from({length:t-v},(f,b)=>b+v+1);return{path:r,lines:{covered:v,total:t},branches:{covered:Math.min(C,d),total:d},functions:{covered:Math.min(M,g),total:g},statements:{covered:v,total:t},uncoveredLines:h,uncoveredBranches:h.slice(0,Math.floor(h.length/2))}}function L(r){let o=e=>r.reduce((a,i)=>a+e(i),0),s=(e,a)=>a>0?Math.round(e/a*100):0,t=o(e=>e.lines.total),c=o(e=>e.lines.covered),n=o(e=>e.statements.total);return{line:s(c,t),branch:s(o(e=>e.branches.covered),o(e=>e.branches.total)),function:s(o(e=>e.functions.covered),o(e=>e.functions.total)),statement:n>0?s(o(e=>e.statements.covered),n):s(c,t),files:r.length}}function B(r,o){let s=o||process.cwd(),t=F(s),c=[],n=[],e=!1;if(t&&t.size>0){e=!0;for(let a of r){let i=m.resolve(a),l=t.get(i)||t.get(a)||t.get(m.relative(s,i));l?c.push({...l,path:a}):n.push(a)}}else for(let a of r){let i=u.existsSync(a)?u.readFileSync(a,"utf-8"):"";c.push(S(a,i))}return{files:c,summary:L(c),instrumented:e,...n.length>0?{unmeasuredFiles:n}:{}}}export{L as a,B as b};
@@ -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.15");process.exit(0)}
2
- import{b as i}from"./chunk-XH4JMX5O.js";function d(){return Object.create(null)}function o(e,n){return Object.hasOwn(e,n)?e[n]:void 0}function u(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function s(e,n,t=1){let r=(o(e,n)??0)+t;return u(e,n,r),r}var c=i(()=>{"use strict"});export{d as a,o as b,u as c,s as d,c as e};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{b as i}from"./chunk-AJMJNQMP.js";function d(){return Object.create(null)}function o(e,n){return Object.hasOwn(e,n)?e[n]:void 0}function u(e,n,t){Object.defineProperty(e,n,{value:t,writable:!0,enumerable:!0,configurable:!0})}function s(e,n,t=1){let r=(o(e,n)??0)+t;return u(e,n,r),r}var c=i(()=>{"use strict"});export{d as a,o as b,u as c,s as d,c as e};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
2
- import{b as c,d as f,e as g,f as X}from"./chunk-T66PPF4D.js";import{createHash as I}from"crypto";import{existsSync as O,readFileSync as b,writeFileSync as D,openSync as F,writeSync as y,closeSync as S}from"fs";X();var U=[`CREATE TABLE IF NOT EXISTS qe_patterns (
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{g as c,i as f,j as g,k as X}from"./chunk-MO55CVMT.js";import{createHash as I}from"crypto";import{existsSync as O,readFileSync as b,writeFileSync as D,openSync as F,writeSync as y,closeSync as S}from"fs";X();var U=[`CREATE TABLE IF NOT EXISTS qe_patterns (
3
3
  id TEXT PRIMARY KEY, pattern_type TEXT NOT NULL, qe_domain TEXT NOT NULL,
4
4
  domain TEXT NOT NULL, name TEXT NOT NULL, description TEXT,
5
5
  confidence REAL DEFAULT 0.5, usage_count INTEGER DEFAULT 0,
@@ -1,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.15");process.exit(0)}
2
- import{c as I,d as _}from"./chunk-C5CXL3JP.js";import{b as me}from"./chunk-J3FP5UGL.js";import{a as b}from"./chunk-7ACCBHRB.js";import{a as de,b as pe}from"./chunk-6KCSKGVY.js";import{e as ue,f as ge}from"./chunk-KCQNFBBR.js";import{b as S,d as le}from"./chunk-XWIAZG3C.js";import{b as ce,c as $,e as qe}from"./chunk-5G4UFTV4.js";import{a as ae}from"./chunk-LJMYRTJ7.js";import{a as k,e as L}from"./chunk-HL2ANKN3.js";var Te={M:16,efConstruction:200,efSearch:100},M={enabled:!0,pretrainedPatterns:!0,hnswConfig:Te,promotionThreshold:ue,qualityThreshold:ge,embeddingModel:"auto"},Q={mode:"hybrid",confidenceThreshold:.7,feedbackEnabled:!0,cacheEnabled:!0,cacheTTLMs:300*1e3},V={enabled:["pattern-consolidator","coverage-gap-scanner","flaky-test-detector","routing-accuracy-monitor"],intervals:{"pattern-consolidator":1800*1e3,"coverage-gap-scanner":3600*1e3,"flaky-test-detector":7200*1e3,"routing-accuracy-monitor":900*1e3},maxConcurrent:4,daemonAutoStart:!0},G={claudeCode:!0,preCommit:!1,ciIntegration:!1},W={install:!0,installV2:!0,installV3:!0,overwrite:!1},B={enabled:!0,parameters:["hnsw.efSearch","routing.confidenceThreshold","pattern.promotionThreshold","testGen.complexityLimit"],tuningIntervalMs:10080*60*1e3,evaluationPeriodMs:5e3};var q=ae.filter(r=>r!=="coordination");function U(){return"3.15.15"}function gt(r,e){return{version:U(),project:{name:r,root:e,type:"single"},learning:structuredClone(M),routing:structuredClone(Q),workers:structuredClone(V),hooks:structuredClone(G),skills:structuredClone(W),autoTuning:structuredClone(B),domains:{enabled:[...q],disabled:[]},agents:{maxConcurrent:15,defaultTimeout:6e4}}}le();import{readFileSync as w,existsSync as p,statSync as Pe,readdirSync as Ne}from"fs";import{join as d,basename as fe,extname as ye,relative as z}from"path";var Oe=[{name:"jest",detect:r=>{let e=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs"];for(let n of e)if(p(d(r,n)))return{name:"jest",version:x(r,"jest"),configFile:n,confidence:1};let t=A(r);return t?.jest?{name:"jest",version:x(r,"jest"),configFile:"package.json",confidence:.9}:t?.devDependencies?.jest||t?.dependencies?.jest?{name:"jest",version:t.devDependencies?.jest||t.dependencies?.jest,confidence:.7}:null}},{name:"vitest",detect:r=>{let e=["vitest.config.ts","vitest.config.js","vitest.config.mts","vite.config.ts"];for(let n of e)if(p(d(r,n)))return{name:"vitest",version:x(r,"vitest"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.vitest||t?.dependencies?.vitest?{name:"vitest",version:t.devDependencies?.vitest,confidence:.8}:null}},{name:"mocha",detect:r=>{let e=[".mocharc.js",".mocharc.json",".mocharc.yaml",".mocharc.yml"];for(let n of e)if(p(d(r,n)))return{name:"mocha",version:x(r,"mocha"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.mocha?{name:"mocha",version:t.devDependencies?.mocha,confidence:.8}:null}},{name:"pytest",detect:r=>{let e=["pytest.ini","pyproject.toml","setup.cfg"];for(let n of e){let i=d(r,n);if(p(i))try{let s=w(i,"utf-8");if(s.includes("[pytest]")||s.includes("[tool.pytest]"))return{name:"pytest",configFile:n,confidence:1}}catch(s){console.debug("[ProjectAnalyzer] Config read failed:",s instanceof Error?s.message:s)}}let t=d(r,"requirements.txt");if(p(t))try{if(w(t,"utf-8").includes("pytest"))return{name:"pytest",configFile:"requirements.txt",confidence:.8}}catch(n){console.debug("[ProjectAnalyzer] requirements.txt read failed:",n instanceof Error?n.message:n)}return null}},{name:"playwright",detect:r=>{let e=["playwright.config.ts","playwright.config.js"];for(let n of e)if(p(d(r,n)))return{name:"playwright",version:x(r,"@playwright/test"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.["@playwright/test"]?{name:"playwright",version:t.devDependencies["@playwright/test"],confidence:.8}:null}},{name:"cypress",detect:r=>{let e=["cypress.config.ts","cypress.config.js","cypress.json"];for(let t of e)if(p(d(r,t)))return{name:"cypress",version:x(r,"cypress"),configFile:t,confidence:1};return p(d(r,"cypress"))?{name:"cypress",configFile:"cypress/",confidence:.9}:null}}],Fe=[{name:"typescript",extensions:[".ts",".tsx",".mts",".cts"]},{name:"javascript",extensions:[".js",".jsx",".mjs",".cjs"]},{name:"python",extensions:[".py",".pyw"]},{name:"java",extensions:[".java"]},{name:"go",extensions:[".go"]},{name:"rust",extensions:[".rs"]},{name:"csharp",extensions:[".cs"]},{name:"ruby",extensions:[".rb"]},{name:"php",extensions:[".php"]},{name:"kotlin",extensions:[".kt",".kts"]},{name:"swift",extensions:[".swift"]}];function A(r){let e=d(r,"package.json");if(!p(e))return null;try{return S(w(e,"utf-8"))}catch{return null}}function x(r,e){let t=A(r);if(t)return t.devDependencies?.[e]||t.dependencies?.[e]}var Le=["node_modules",".git","dist","build","coverage",".next","__pycache__",".agentic-qe",".claude",".agents",".codex",".opencode",".kiro",".cursor",".roo",".kilocode",".windsurf",".continue",".clinerules",".swarm",".claude-flow",".hive-mind"];function H(r,e,t={}){let{maxDepth:n=10,exclude:i=Le}=t;function s(o,a){if(a>n)return;let c;try{c=Ne(o)}catch{return}for(let u of c){if(i.includes(u))continue;let l=d(o,u),j;try{j=Pe(l)}catch{continue}j.isDirectory()?s(l,a+1):j.isFile()&&e(l)}}s(r,0)}var K=class{projectRoot;constructor(e){this.projectRoot=e}async analyze(){let e=Date.now(),[t,n,i,s,o]=await Promise.all([this.detectFrameworks(),this.detectLanguages(),this.detectExistingTests(),this.analyzeComplexity(),this.measureCoverage()]);return{projectName:A(this.projectRoot)?.name||fe(this.projectRoot),projectRoot:this.projectRoot,projectType:this.detectProjectType(),frameworks:t,languages:n,existingTests:i,codeComplexity:s,coverage:o,packageManager:this.detectPackageManager(),hasTypeScript:p(d(this.projectRoot,"tsconfig.json")),hasCIConfig:this.detectCIConfig(),ciProvider:this.detectCIProvider(),analysisTimestamp:new Date,analysisDurationMs:Date.now()-e}}async detectFrameworks(){let e=[];for(let t of Oe){let n=t.detect(this.projectRoot);n&&e.push(n)}return e.sort((t,n)=>n.confidence-t.confidence)}async detectLanguages(){let e=new Map,t=0;H(this.projectRoot,i=>{let s=ye(i).toLowerCase();if(s){for(let o of Fe)if(o.extensions.includes(s)){let a=e.get(o.name)||{count:0,extensions:new Set};a.count++,a.extensions.add(s),e.set(o.name,a),t++;break}}});let n=[];for(let[i,s]of e)n.push({name:i,percentage:t>0?Math.round(s.count/t*100):0,fileCount:s.count,extensions:Array.from(s.extensions)});return n.sort((i,s)=>s.fileCount-i.fileCount)}async detectExistingTests(){let e={totalCount:0,byFramework:{},byType:{unit:0,integration:0,e2e:0,unknown:0},directories:[]},t=new Set,n=[/\.test\.[jt]sx?$/,/\.spec\.[jt]sx?$/,/_test\.[jt]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/,/.*Test\.java$/];return H(this.projectRoot,i=>{let s=fe(i);if(n.some(a=>a.test(s))){e.totalCount++;let a=z(this.projectRoot,i).toLowerCase();a.includes("e2e")||a.includes("cypress")||a.includes("playwright")?e.byType.e2e++:a.includes("integration")||a.includes("int-test")?e.byType.integration++:a.includes("unit")||a.includes("__tests__")||a.includes("test/")?e.byType.unit++:e.byType.unknown++;let c=z(this.projectRoot,d(i,".."));t.add(c)}}),e.directories=Array.from(t).slice(0,10),e}async analyzeComplexity(){let e=[],t=[],n=0,i=0;H(this.projectRoot,a=>{let c=ye(a);if([".ts",".tsx",".js",".jsx",".py",".java",".go"].includes(c))try{let u=w(a,"utf-8"),l=this.calculateFileComplexity(u,c);t.push(...l.functionComplexities),l.maxComplexity>n&&(n=l.maxComplexity),i++,l.maxComplexity>10&&e.push(z(this.projectRoot,a))}catch(u){console.debug("[ProjectAnalyzer] Complexity analysis read failed:",u instanceof Error?u.message:u)}});let s=t.reduce((a,c)=>a+c,0),o=t.length>0?s/t.length:0;return{averageCyclomatic:Math.round(o*10)/10,maxCyclomatic:n,totalFiles:i,complexFiles:e.slice(0,20),recommendation:o<5?"simple":o<15?"medium":"complex"}}calculateFileComplexity(e,t){let n=this.stripCommentsAndStrings(e,t),i=this.calculateComplexity(n);return{functionComplexities:[i],maxComplexity:i}}removeDelimitedBlocks(e,t,n){let i="",s=0;for(;s<e.length;){let o=e.indexOf(t,s);if(o===-1){i+=e.slice(s);break}i+=e.slice(s,o);let a=e.indexOf(n,o+t.length);if(a===-1)break;s=a+n.length}return i}stripCommentsAndStrings(e,t){let n=e;return[".ts",".tsx",".js",".jsx",".java",".go"].includes(t)?(n=n.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.16");process.exit(0)}
2
+ import{c as I,d as _}from"./chunk-SSUAAX3F.js";import{a as b}from"./chunk-SR52XP5F.js";import{b as me}from"./chunk-24QHCVX6.js";import{a as de,b as pe}from"./chunk-SI6DPU5D.js";import{e as ue,f as ge}from"./chunk-EA4YQVKS.js";import{b as S,d as le}from"./chunk-V5NHZV7S.js";import{b as ce,c as $,e as qe}from"./chunk-S75SOOZL.js";import{a as ae}from"./chunk-LE4QJREF.js";import{a as k,e as L}from"./chunk-KNSRL6NO.js";var Te={M:16,efConstruction:200,efSearch:100},M={enabled:!0,pretrainedPatterns:!0,hnswConfig:Te,promotionThreshold:ue,qualityThreshold:ge,embeddingModel:"auto"},Q={mode:"hybrid",confidenceThreshold:.7,feedbackEnabled:!0,cacheEnabled:!0,cacheTTLMs:300*1e3},V={enabled:["pattern-consolidator","coverage-gap-scanner","flaky-test-detector","routing-accuracy-monitor"],intervals:{"pattern-consolidator":1800*1e3,"coverage-gap-scanner":3600*1e3,"flaky-test-detector":7200*1e3,"routing-accuracy-monitor":900*1e3},maxConcurrent:4,daemonAutoStart:!0},G={claudeCode:!0,preCommit:!1,ciIntegration:!1},W={install:!0,installV2:!0,installV3:!0,overwrite:!1},B={enabled:!0,parameters:["hnsw.efSearch","routing.confidenceThreshold","pattern.promotionThreshold","testGen.complexityLimit"],tuningIntervalMs:10080*60*1e3,evaluationPeriodMs:5e3};var q=ae.filter(r=>r!=="coordination");function U(){return"3.15.16"}function gt(r,e){return{version:U(),project:{name:r,root:e,type:"single"},learning:structuredClone(M),routing:structuredClone(Q),workers:structuredClone(V),hooks:structuredClone(G),skills:structuredClone(W),autoTuning:structuredClone(B),domains:{enabled:[...q],disabled:[]},agents:{maxConcurrent:15,defaultTimeout:6e4}}}le();import{readFileSync as w,existsSync as p,statSync as Pe,readdirSync as Ne}from"fs";import{join as d,basename as fe,extname as ye,relative as z}from"path";var Oe=[{name:"jest",detect:r=>{let e=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs"];for(let n of e)if(p(d(r,n)))return{name:"jest",version:x(r,"jest"),configFile:n,confidence:1};let t=A(r);return t?.jest?{name:"jest",version:x(r,"jest"),configFile:"package.json",confidence:.9}:t?.devDependencies?.jest||t?.dependencies?.jest?{name:"jest",version:t.devDependencies?.jest||t.dependencies?.jest,confidence:.7}:null}},{name:"vitest",detect:r=>{let e=["vitest.config.ts","vitest.config.js","vitest.config.mts","vite.config.ts"];for(let n of e)if(p(d(r,n)))return{name:"vitest",version:x(r,"vitest"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.vitest||t?.dependencies?.vitest?{name:"vitest",version:t.devDependencies?.vitest,confidence:.8}:null}},{name:"mocha",detect:r=>{let e=[".mocharc.js",".mocharc.json",".mocharc.yaml",".mocharc.yml"];for(let n of e)if(p(d(r,n)))return{name:"mocha",version:x(r,"mocha"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.mocha?{name:"mocha",version:t.devDependencies?.mocha,confidence:.8}:null}},{name:"pytest",detect:r=>{let e=["pytest.ini","pyproject.toml","setup.cfg"];for(let n of e){let i=d(r,n);if(p(i))try{let s=w(i,"utf-8");if(s.includes("[pytest]")||s.includes("[tool.pytest]"))return{name:"pytest",configFile:n,confidence:1}}catch(s){console.debug("[ProjectAnalyzer] Config read failed:",s instanceof Error?s.message:s)}}let t=d(r,"requirements.txt");if(p(t))try{if(w(t,"utf-8").includes("pytest"))return{name:"pytest",configFile:"requirements.txt",confidence:.8}}catch(n){console.debug("[ProjectAnalyzer] requirements.txt read failed:",n instanceof Error?n.message:n)}return null}},{name:"playwright",detect:r=>{let e=["playwright.config.ts","playwright.config.js"];for(let n of e)if(p(d(r,n)))return{name:"playwright",version:x(r,"@playwright/test"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.["@playwright/test"]?{name:"playwright",version:t.devDependencies["@playwright/test"],confidence:.8}:null}},{name:"cypress",detect:r=>{let e=["cypress.config.ts","cypress.config.js","cypress.json"];for(let t of e)if(p(d(r,t)))return{name:"cypress",version:x(r,"cypress"),configFile:t,confidence:1};return p(d(r,"cypress"))?{name:"cypress",configFile:"cypress/",confidence:.9}:null}}],Fe=[{name:"typescript",extensions:[".ts",".tsx",".mts",".cts"]},{name:"javascript",extensions:[".js",".jsx",".mjs",".cjs"]},{name:"python",extensions:[".py",".pyw"]},{name:"java",extensions:[".java"]},{name:"go",extensions:[".go"]},{name:"rust",extensions:[".rs"]},{name:"csharp",extensions:[".cs"]},{name:"ruby",extensions:[".rb"]},{name:"php",extensions:[".php"]},{name:"kotlin",extensions:[".kt",".kts"]},{name:"swift",extensions:[".swift"]}];function A(r){let e=d(r,"package.json");if(!p(e))return null;try{return S(w(e,"utf-8"))}catch{return null}}function x(r,e){let t=A(r);if(t)return t.devDependencies?.[e]||t.dependencies?.[e]}var Le=["node_modules",".git","dist","build","coverage",".next","__pycache__",".agentic-qe",".claude",".agents",".codex",".opencode",".kiro",".cursor",".roo",".kilocode",".windsurf",".continue",".clinerules",".swarm",".claude-flow",".hive-mind"];function H(r,e,t={}){let{maxDepth:n=10,exclude:i=Le}=t;function s(o,a){if(a>n)return;let c;try{c=Ne(o)}catch{return}for(let u of c){if(i.includes(u))continue;let l=d(o,u),j;try{j=Pe(l)}catch{continue}j.isDirectory()?s(l,a+1):j.isFile()&&e(l)}}s(r,0)}var K=class{projectRoot;constructor(e){this.projectRoot=e}async analyze(){let e=Date.now(),[t,n,i,s,o]=await Promise.all([this.detectFrameworks(),this.detectLanguages(),this.detectExistingTests(),this.analyzeComplexity(),this.measureCoverage()]);return{projectName:A(this.projectRoot)?.name||fe(this.projectRoot),projectRoot:this.projectRoot,projectType:this.detectProjectType(),frameworks:t,languages:n,existingTests:i,codeComplexity:s,coverage:o,packageManager:this.detectPackageManager(),hasTypeScript:p(d(this.projectRoot,"tsconfig.json")),hasCIConfig:this.detectCIConfig(),ciProvider:this.detectCIProvider(),analysisTimestamp:new Date,analysisDurationMs:Date.now()-e}}async detectFrameworks(){let e=[];for(let t of Oe){let n=t.detect(this.projectRoot);n&&e.push(n)}return e.sort((t,n)=>n.confidence-t.confidence)}async detectLanguages(){let e=new Map,t=0;H(this.projectRoot,i=>{let s=ye(i).toLowerCase();if(s){for(let o of Fe)if(o.extensions.includes(s)){let a=e.get(o.name)||{count:0,extensions:new Set};a.count++,a.extensions.add(s),e.set(o.name,a),t++;break}}});let n=[];for(let[i,s]of e)n.push({name:i,percentage:t>0?Math.round(s.count/t*100):0,fileCount:s.count,extensions:Array.from(s.extensions)});return n.sort((i,s)=>s.fileCount-i.fileCount)}async detectExistingTests(){let e={totalCount:0,byFramework:{},byType:{unit:0,integration:0,e2e:0,unknown:0},directories:[]},t=new Set,n=[/\.test\.[jt]sx?$/,/\.spec\.[jt]sx?$/,/_test\.[jt]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/,/.*Test\.java$/];return H(this.projectRoot,i=>{let s=fe(i);if(n.some(a=>a.test(s))){e.totalCount++;let a=z(this.projectRoot,i).toLowerCase();a.includes("e2e")||a.includes("cypress")||a.includes("playwright")?e.byType.e2e++:a.includes("integration")||a.includes("int-test")?e.byType.integration++:a.includes("unit")||a.includes("__tests__")||a.includes("test/")?e.byType.unit++:e.byType.unknown++;let c=z(this.projectRoot,d(i,".."));t.add(c)}}),e.directories=Array.from(t).slice(0,10),e}async analyzeComplexity(){let e=[],t=[],n=0,i=0;H(this.projectRoot,a=>{let c=ye(a);if([".ts",".tsx",".js",".jsx",".py",".java",".go"].includes(c))try{let u=w(a,"utf-8"),l=this.calculateFileComplexity(u,c);t.push(...l.functionComplexities),l.maxComplexity>n&&(n=l.maxComplexity),i++,l.maxComplexity>10&&e.push(z(this.projectRoot,a))}catch(u){console.debug("[ProjectAnalyzer] Complexity analysis read failed:",u instanceof Error?u.message:u)}});let s=t.reduce((a,c)=>a+c,0),o=t.length>0?s/t.length:0;return{averageCyclomatic:Math.round(o*10)/10,maxCyclomatic:n,totalFiles:i,complexFiles:e.slice(0,20),recommendation:o<5?"simple":o<15?"medium":"complex"}}calculateFileComplexity(e,t){let n=this.stripCommentsAndStrings(e,t),i=this.calculateComplexity(n);return{functionComplexities:[i],maxComplexity:i}}removeDelimitedBlocks(e,t,n){let i="",s=0;for(;s<e.length;){let o=e.indexOf(t,s);if(o===-1){i+=e.slice(s);break}i+=e.slice(s,o);let a=e.indexOf(n,o+t.length);if(a===-1)break;s=a+n.length}return i}stripCommentsAndStrings(e,t){let n=e;return[".ts",".tsx",".js",".jsx",".java",".go"].includes(t)?(n=n.split(`
3
3
  `).map(i=>{let s=i.indexOf("//");return s>=0?i.slice(0,s):i}).join(`
4
4
  `),n=this.removeDelimitedBlocks(n,"/*","*/"),n=this.removeDelimitedBlocks(n,"`","`"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")):t===".py"&&(n=n.split(`
5
5
  `).map(i=>{let s=i.indexOf("#");return s>=0?i.slice(0,s):i}).join(`
@@ -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.15");process.exit(0)}
2
- import{a as b}from"./chunk-3HVFIITW.js";import{c as g}from"./chunk-BQ47GQPK.js";import{C as B,S as v,b as p}from"./chunk-6YVMX2TC.js";import{a as I}from"./chunk-XH4JMX5O.js";b();v();b();v();import{createHash as ue,randomUUID as me}from"crypto";b();function Z(o){let e=2166136261;for(let t=0;t<o.length;t++)e^=o.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0)%64}function W(o){let e=new Array(64).fill(0),t=o.toLowerCase().split(/[\s,;:.!?()[\]{}"']+/).filter(n=>n.length>0);for(let n of t){let s=Z(n);e[s]++}let r=0;for(let n=0;n<64;n++)r+=e[n]*e[n];if(r=Math.sqrt(r),r>1e-10)for(let n=0;n<64;n++)e[n]/=r;return e}function _(o,e){let t=0,r=0,n=0,s=Math.min(o.length,e.length);for(let a=0;a<s;a++)t+=o[a]*e[a],r+=o[a]*o[a],n+=e[a]*e[a];let i=Math.sqrt(r)*Math.sqrt(n);return i>1e-10?t/i:0}b();import{createRequire as ee}from"module";var S=ee(import.meta.url),V=g.create("coherence-gate-cohomology"),C=null,k=!1;function H(){if(k)return C;k=!0;try{let o=S("prime-radiant-advanced-wasm"),e=S("fs"),t=S("path"),r=t.join(t.dirname(I.resolve("prime-radiant-advanced-wasm")),"prime_radiant_advanced_wasm_bg.wasm");o.initSync({module:e.readFileSync(r)}),C=new o.CohomologyEngine,V.info("CohomologyEngine loaded from prime-radiant-advanced-wasm")}catch(o){V.debug("CohomologyEngine unavailable, using word-frequency fallback",{error:String(o)}),C=null}return C}var te={threshold:5,slack:.5,resetOnAlarm:!0,warmupSamples:20},d=class{config;states=new Map;constructor(e={}){this.config={...te,...e}}update(e,t){let r=this.getOrCreateState(e);if(r.samplesSinceReset++,r.mu===null)return r.warmupSum+=t,r.warmupCount++,r.warmupCount>=this.config.warmupSamples&&(r.mu=r.warmupSum/r.warmupCount),{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:r.samplesSinceReset};r.sPlus=Math.max(0,r.sPlus+(t-r.mu-this.config.slack)),r.sMinus=Math.max(0,r.sMinus+(-t+r.mu-this.config.slack));let n=Math.max(r.sPlus,r.sMinus),s=!1,i="none";r.sPlus>this.config.threshold?(s=!0,i="positive"):r.sMinus>this.config.threshold&&(s=!0,i="negative");let a={driftDetected:s,cumulativeSum:n,direction:i,samplesSinceReset:r.samplesSinceReset};return s&&this.config.resetOnAlarm&&(r.sPlus=0,r.sMinus=0,r.samplesSinceReset=0),a}reset(e){e?this.states.delete(e):this.states.clear()}getState(e){let t=this.states.get(e);if(!t)return{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:0};let r=Math.max(t.sPlus,t.sMinus),n="none";return t.sPlus>this.config.threshold?n="positive":t.sMinus>this.config.threshold&&(n="negative"),{driftDetected:t.sPlus>this.config.threshold||t.sMinus>this.config.threshold,cumulativeSum:r,direction:n,samplesSinceReset:t.samplesSinceReset}}getOrCreateState(e){let t=this.states.get(e);return t||(t={sPlus:0,sMinus:0,samplesSinceReset:0,warmupSum:0,warmupCount:0,mu:null},this.states.set(e,t)),t}};v();var x=g.create("coherence-gate-energy"),D=null,re=[],P=[],ne=100;function oe(){return D||(B()?(D=new d,x.debug("CUSUM drift detector auto-created via feature flag"),D):null)}function O(o,e){let t=oe();if(!t)return;let r=t.update(o,e);if(r.driftDetected){let n={gateType:o,energy:e,cusumResult:r,timestamp:Date.now()};x.warn("CUSUM drift detected",{gateType:o,energy:e,direction:r.direction,cumulativeSum:r.cumulativeSum}),P.push(n),P.length>ne&&P.shift();for(let s of re)try{s(n)}catch(i){x.debug("Drift listener error",{error:String(i)})}}}var f={assertionCoverage:.4,codeCoverage:.3,confidencePenalty:.3,contradictionWeight:.2,laplacianWeight:.15},N=1;function U(o){if(o.assertions.length===0)return 0;let e=o.observedBehavior.length/o.assertions.length;return Math.max(0,Math.min(1-e,1))}function $(o){return Math.max(0,Math.min(1-o.coverage,1))}function j(o){return Math.max(0,Math.min(1-o.confidence,1))}function se(o){if(o.assertions.length===0||o.observedBehavior.length===0)return 0;let e=0,t=["not","never","false","undefined","null","error","fail"];for(let r of o.assertions){let n=r.toLowerCase();for(let s of o.observedBehavior){let i=s.toLowerCase();for(let a of t){let c=n.includes(a),u=i.includes(a);if(c!==u){let m=new Set(n.split(/\s+/)),l=new Set(i.split(/\s+/)),h=0;for(let L of m)l.has(L)&&L.length>3&&h++;if(h>0){e++;break}}}}}return Math.min(e/o.assertions.length,1)}function ie(o,e,t){let r=t[0]?.length??64,n=t.map((c,u)=>({id:u,label:e.assertions[u]?.slice(0,50)??`assertion-${u}`,section:c,weight:e.confidence})),s=[];for(let c=0;c<t.length;c++)for(let u=c+1;u<t.length;u++){let m=[];for(let l=0;l<r;l++)for(let h=0;h<r;h++)m.push(l===h?1:0);s.push({source:c,target:u,weight:1,restriction_map:m,source_dim:r,target_dim:r})}let i=o.consistencyEnergy({nodes:n,edges:s}),a=i/(i+1);return Math.max(0,Math.min(a,1))}function ae(o){let e=0,t=0;for(let n=0;n<o.length;n++)for(let s=n+1;s<o.length;s++)e+=_(o[n],o[s]),t++;if(t===0)return 0;let r=e/t;return Math.max(0,Math.min(1-r,1))}function ce(o){if(o.assertions.length<2)return 0;let e=o.assertions.map(r=>W(r)),t=H();if(t)try{return ie(t,o,e)}catch(r){x.debug("CohomologyEngine.consistencyEnergy failed, using fallback",{error:String(r)})}return ae(e)}function K(o,e="act"){let t=U(o),r=$(o),n=j(o),s=Math.min(t*f.assertionCoverage+r*f.codeCoverage+n*f.confidencePenalty,1);return O(e,s),{energy:s,components:{assertionCoverage:t,codeCoverage:r,confidencePenalty:n,contradictionScore:0,laplacianDeviation:0}}}function q(o,e="retrieve"){let t=U(o),r=$(o),n=j(o),s=se(o),i=ce(o),a=t*f.assertionCoverage+r*f.codeCoverage+n*f.confidencePenalty,c=s*f.contradictionWeight+i*f.laplacianWeight,u=f.assertionCoverage+f.codeCoverage+f.confidencePenalty+f.contradictionWeight+f.laplacianWeight,m=Math.min((a+c)/u,1);return O(e,m),{energy:m,components:{assertionCoverage:t,codeCoverage:r,confidencePenalty:n,contradictionScore:s,laplacianDeviation:i}}}var z=g.create("coherence-gate"),le=.4,T=class{threshold;decisionLog=[];witnessChain=[];lastWitnessHash="0".repeat(64);nativeAvailable=null;governanceChain=null;constructor(e=le){this.threshold=e}setGovernanceChain(e){this.governanceChain=e}computeEnergy(e,t=!1,r="retrieve"){let n=performance.now();if(!t){let a=K(e,r),c=performance.now()-n;if(c<=N)return{energy:a.energy,tier:"reflex",components:a.components,latencyMs:c}}let s=q(e,r),i=performance.now()-n;return{energy:s.energy,tier:"retrieval",components:s.components,latencyMs:i}}validate(e,t,r="retrieve"){let n=t??this.threshold,s=this.computeEnergy(e,!1,r),i=s.energy<=n,a;i||(a=this.buildFailureReason(s,n));let c=this.createWitnessRecord(e,s.energy,n,i);return this.logDecision({id:c.id,timestamp:c.timestamp,domain:e.domain,energy:s.energy,tier:s.tier,passed:i,threshold:n}),{passed:i,energy:s.energy,threshold:n,reason:a,witness:c}}getDecisionLog(){return[...this.decisionLog]}getWitnessChain(){return[...this.witnessChain]}getThreshold(){return this.threshold}clearDecisionLog(){this.decisionLog=[]}validateTransfer(e,t){if(!p().useCoherenceGate)return{approved:!0};let n={assertions:this.extractAssertions(e),observedBehavior:this.extractObservedBehavior(e),coverage:typeof e.coverage=="number"?e.coverage:.5,domain:t,confidence:e.confidence??.5},s=this.validate(n,void 0,"write");return{approved:s.passed,energy:s.energy,rejectionReason:s.reason}}buildFailureReason(e,t){let r=[];r.push(`Coherence energy ${e.energy.toFixed(3)} exceeds threshold ${t.toFixed(3)}.`);let n=e.components;return n.assertionCoverage>.5&&r.push("High assertion-observation mismatch (possible hallucination)."),n.codeCoverage>.5&&r.push("Low code coverage."),n.confidencePenalty>.5&&r.push("Low generator confidence."),n.contradictionScore>.3&&r.push("Contradictions detected between assertions and observed behavior."),n.laplacianDeviation>.5&&r.push("Inconsistent assertion structure (high Laplacian deviation)."),r.join(" ")}createWitnessRecord(e,t,r,n){let s=me(),i=Date.now(),a=this.hashContent(JSON.stringify(e)),c={id:s,timestamp:i,artifactHash:a,energy:t,threshold:r,passed:n,previousHash:this.lastWitnessHash,recordHash:""},u=`${s}|${i}|${a}|${t}|${r}|${n}|${this.lastWitnessHash}`;if(c.recordHash=this.hashContent(u),p().useWitnessChain&&(this.witnessChain.push(c),this.lastWitnessHash=c.recordHash,this.governanceChain))try{let l={type:"coherence-gate",decision:n?"PASS":"FAIL",context:{energy:t,threshold:r,artifactHash:c.artifactHash}};this.governanceChain.appendWitness(l)}catch(l){z.debug("Failed to persist to governance chain",{error:String(l)})}return c}hashContent(e){return ue("sha256").update(e).digest("hex")}logDecision(e){this.decisionLog.push(e);let t=1e3;this.decisionLog.length>t&&(this.decisionLog=this.decisionLog.slice(-t)),z.debug("Coherence decision",{domain:e.domain,energy:e.energy,tier:e.tier,passed:e.passed})}extractAssertions(e){return Array.isArray(e.assertions)?e.assertions.map(String):typeof e.description=="string"?[e.description]:["transfer-pattern"]}extractObservedBehavior(e){return Array.isArray(e.observedBehavior)?e.observedBehavior.map(String):typeof e.evidence=="string"?[e.evidence]:["observed"]}};var R=class{validateTransfer(e,t){return{approved:!0}}};function X(){return p().useCoherenceGate?new T:new R}b();var Y=g.create("transfer-verification"),fe={maxSourceRegression:.05,minTargetImprovement:0,maxSourceConfidenceRegression:.1},w=class{config;constructor(e={}){this.config={...fe,...e}}verifyTransfer(e){let t=e.sourcePerformanceAfter.successRate-e.sourcePerformanceBefore.successRate,r=e.targetPerformanceAfter.successRate-e.targetPerformanceBefore.successRate,n=e.sourcePerformanceAfter.avgConfidence-e.sourcePerformanceBefore.avgConfidence,s=e.targetPerformanceAfter.avgConfidence-e.targetPerformanceBefore.avgConfidence,i=t>=-this.config.maxSourceRegression&&n>=-this.config.maxSourceConfidenceRegression,a=r>=this.config.minTargetImprovement,c=i&&a,u;if(!c){let m=[];i||m.push(`source domain regressed: successRate delta=${t.toFixed(4)}, confidence delta=${n.toFixed(4)}`),a||m.push(`target domain did not improve: successRate delta=${r.toFixed(4)}`),u=m.join("; ")}return c?Y.debug("Transfer verification passed",{transferId:e.transferId,sourceDelta:t,targetDelta:r}):Y.warn("Transfer verification failed",{transferId:e.transferId,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourceDelta:t,targetDelta:r,failureReason:u}),{passed:c,sourceStable:i,targetImproved:a,sourceDelta:t,targetDelta:r,sourceConfidenceDelta:n,targetConfidenceDelta:s,failureReason:u}}getConfig(){return{...this.config}}};function J(o){return new w(o)}v();var y=class{alphas=new Map;betas=new Map;sample(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return this.sampleBeta(t,r)}update(e,t){t?this.alphas.set(e,(this.alphas.get(e)??1)+1):this.betas.set(e,(this.betas.get(e)??1)+1)}getMean(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t/(t+r)}getObservationCount(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t-1+(r-1)}getAlpha(e){return this.alphas.get(e)??1}getBeta(e){return this.betas.get(e)??1}sampleBeta(e,t){let r=this.sampleGamma(e),n=this.sampleGamma(t);return r+n===0?.5:r/(r+n)}sampleGamma(e){if(e<1){let n=Math.random();return this.sampleGamma(e+1)*Math.pow(n,1/e)}let t=e-1/3,r=1/Math.sqrt(9*t);for(;;){let n,s;do n=this.standardNormal(),s=1+r*n;while(s<=0);s=s*s*s;let i=Math.random();if(i<1-.0331*n*n*n*n||Math.log(i)<.5*n*n+t*(1-s+Math.log(s)))return t*s}}standardNormal(){let e=Math.random(),t=Math.random();return Math.sqrt(-2*Math.log(e||1e-10))*Math.cos(2*Math.PI*t)}};var Q=g.create("domain-transfer"),ge={minTransferProbability:.3,explorationWarmup:5,verification:{},maxHistorySize:1e3,useMetaLearningEnhancements:!0},M=class{constructor(e=100){this.decayThreshold=e}decayThreshold;getDecayMultiplier(e){return e<=0?1:Math.pow(.5,e/this.decayThreshold)}applyDecay(e,t,r){return t+(e-t)*this.getDecayMultiplier(r)}},E=class{cusum;outcomes=[];windowSize;constructor(e=20){this.windowSize=e,this.cusum=new d({threshold:3,slack:.1,resetOnAlarm:!1,warmupSamples:Math.min(10,Math.floor(e/2))})}record(e){this.outcomes.push(e),this.outcomes.length>this.windowSize*2&&this.outcomes.splice(0,this.outcomes.length-this.windowSize*2);let t=this.getCurrentRate();this.cusum.update("learn",t)}isPlateaued(){return this.outcomes.length<this.windowSize?!1:!this.cusum.getState("learn").driftDetected}getCurrentRate(){if(this.outcomes.length===0)return 0;let e=this.outcomes.slice(-this.windowSize);return e.filter(Boolean).length/e.length}getOutcomeCount(){return this.outcomes.length}getCusumState(){return this.cusum.getState("learn")}},A=class{front=[];dominates(e,t){let r=e.successRate>=t.successRate&&e.speed>=t.speed&&e.confidence>=t.confidence,n=e.successRate>t.successRate||e.speed>t.speed||e.confidence>t.confidence;return r&&n}add(e){for(let t=this.front.length-1;t>=0;t--)this.dominates(e,this.front[t])&&this.front.splice(t,1);this.front.some(t=>this.dominates(t,e))||this.front.push(e)}getFront(){return[...this.front]}isNonDominated(e){return!this.front.some(t=>this.dominates(t,e))}},F=class{constructor(e=.2){this.bonusScale=e}bonusScale;triedPairs=new Set;markTried(e){this.triedPairs.add(e)}isTried(e){return this.triedPairs.has(e)}getBonus(e){return this.triedPairs.has(e)?0:this.bonusScale}apply(e,t){return Math.min(1,e+this.getBonus(t))}getTriedCount(){return this.triedPairs.size}},G=class{config;sampler;verifier;coherenceGate;transferHistory=[];affinityScores=new Map;performanceProvider=null;transferExecutor=null;nativeModule=null;decayingBeta;plateauDetector;paretoFront;curiosityBonus;constructor(e={}){this.config={...ge,...e},this.sampler=new y,this.verifier=J(this.config.verification),this.coherenceGate=X(),this.decayingBeta=new M,this.plateauDetector=new E,this.paretoFront=new A,this.curiosityBonus=new F,this.tryLoadNativeModule()}evaluateTransfer(e,t){if(!this.isEnabled())return this.createRejectedCandidate(e,t);let r=this.makePairKey(e,t),n=this.sampler.sample(r),i=this.sampler.getObservationCount(r)<this.config.explorationWarmup,a=this.getAffinityScore(e,t);if(this.isMetaLearningEnabled()){let c=this.sampler.getMean(r),u=this.sampler.getAlpha(r)-1;n=this.decayingBeta.applyDecay(n,c,u),n=this.curiosityBonus.apply(n,r)}return{sourceDomain:e,targetDomain:t,sampledProbability:n,affinityScore:a,isExploration:i,pairKey:r}}executeTransfer(e){let t=`transfer-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=this.coherenceGate.validateTransfer({domain:e.sourceDomain},e.targetDomain);if(!r.approved)return Q.info("Transfer blocked by coherence gate",{transferId:t,source:e.sourceDomain,target:e.targetDomain,reason:r.rejectionReason}),this.createBlockedResult(t,e,r);let n=this.getPerformanceSnapshot(e.sourceDomain),s=this.getPerformanceSnapshot(e.targetDomain),i=this.computeSqrtDampening(e),a=this.doTransfer(e.sourceDomain,e.targetDomain,i),c=this.getPerformanceSnapshot(e.sourceDomain),u=this.getPerformanceSnapshot(e.targetDomain),m=this.verifier.verifyTransfer({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourcePerformanceBefore:n,sourcePerformanceAfter:c,targetPerformanceBefore:s,targetPerformanceAfter:u}),l=a&&m.passed;if(this.sampler.update(e.pairKey,l),this.updateAffinityScore(e.pairKey,l),this.isMetaLearningEnabled()){this.plateauDetector.record(l),this.curiosityBonus.markTried(e.pairKey);let h=this.sampler.getMean(e.pairKey);this.paretoFront.add({pairKey:e.pairKey,successRate:h,speed:1/(1+i),confidence:this.getAffinityScore(e.sourceDomain,e.targetDomain)})}return this.addToHistory({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,success:l,sampledProbability:e.sampledProbability,dampeningFactor:i,sourceDelta:m.sourceDelta,targetDelta:m.targetDelta,timestamp:Date.now()}),Q.info("Transfer completed",{transferId:t,source:e.sourceDomain,target:e.targetDomain,success:l,dampeningFactor:i.toFixed(4),sourceDelta:m.sourceDelta.toFixed(4),targetDelta:m.targetDelta.toFixed(4)}),{transferId:t,candidate:e,success:l,dampeningFactor:i,verification:m,coherenceResult:r,sourcePerformanceBefore:n,sourcePerformanceAfter:c,targetPerformanceBefore:s,targetPerformanceAfter:u,timestamp:Date.now()}}getAffinityScore(e,t){return this.affinityScores.get(this.makePairKey(e,t))??.5}getTransferHistory(){return[...this.transferHistory]}getExpectedSuccessRate(e,t){return this.sampler.getMean(this.makePairKey(e,t))}getObservationCount(e,t){return this.sampler.getObservationCount(this.makePairKey(e,t))}setPerformanceProvider(e){this.performanceProvider=e}setTransferExecutor(e){this.transferExecutor=e}getSampler(){return this.sampler}getCoherenceGate(){return this.coherenceGate}getDecayingBeta(){return this.decayingBeta}getPlateauDetector(){return this.plateauDetector}getParetoFront(){return this.paretoFront}getCuriosityBonus(){return this.curiosityBonus}isLearningPlateaued(){return this.plateauDetector.isPlateaued()}isEnabled(){return p().useCrossDomainTransfer===!0}isMetaLearningEnabled(){return this.config.useMetaLearningEnhancements===!0&&p().useMetaLearningEnhancements!==!1}makePairKey(e,t){return`${e}->${t}`}computeSqrtDampening(e){let t=this.sampler.getObservationCount(e.pairKey);return Math.sqrt(t/(t+this.config.explorationWarmup))}doTransfer(e,t,r){return this.transferExecutor?this.transferExecutor(e,t,r):!0}getPerformanceSnapshot(e){return this.performanceProvider?this.performanceProvider(e):{domain:e,successRate:.5,avgConfidence:.5,patternCount:0,timestamp:Date.now()}}updateAffinityScore(e,t){let r=this.affinityScores.get(e)??.5;this.affinityScores.set(e,.2*(t?1:0)+.8*r)}addToHistory(e){for(this.transferHistory.push(e);this.transferHistory.length>this.config.maxHistorySize;)this.transferHistory.shift()}createBlockedResult(e,t,r){let n={domain:"",successRate:0,avgConfidence:0,patternCount:0,timestamp:Date.now()};return{transferId:e,candidate:t,success:!1,dampeningFactor:0,verification:{passed:!1,sourceStable:!1,targetImproved:!1,sourceDelta:0,targetDelta:0,sourceConfidenceDelta:0,targetConfidenceDelta:0,failureReason:`Coherence gate rejected: ${r.rejectionReason??"unknown"}`},coherenceResult:r,sourcePerformanceBefore:{...n,domain:t.sourceDomain},sourcePerformanceAfter:{...n,domain:t.sourceDomain},targetPerformanceBefore:{...n,domain:t.targetDomain},targetPerformanceAfter:{...n,domain:t.targetDomain},timestamp:Date.now()}}createRejectedCandidate(e,t){return{sourceDomain:e,targetDomain:t,sampledProbability:0,affinityScore:0,isExploration:!1,pairKey:this.makePairKey(e,t)}}tryLoadNativeModule(){this.nativeModule=null}};function $e(o){return new G(o)}export{d as a,y as b,ge as c,M as d,E as e,A as f,F as g,G as h,$e as i};
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.16");process.exit(0)}
2
+ import{a as b}from"./chunk-YAPLJR7K.js";import{c as g}from"./chunk-G5RHFBAY.js";import{C as B,S as v,b as p}from"./chunk-L6QSTQME.js";import{a as I}from"./chunk-AJMJNQMP.js";b();v();b();v();import{createHash as ue,randomUUID as me}from"crypto";b();function Z(o){let e=2166136261;for(let t=0;t<o.length;t++)e^=o.charCodeAt(t),e=Math.imul(e,16777619);return(e>>>0)%64}function W(o){let e=new Array(64).fill(0),t=o.toLowerCase().split(/[\s,;:.!?()[\]{}"']+/).filter(n=>n.length>0);for(let n of t){let s=Z(n);e[s]++}let r=0;for(let n=0;n<64;n++)r+=e[n]*e[n];if(r=Math.sqrt(r),r>1e-10)for(let n=0;n<64;n++)e[n]/=r;return e}function _(o,e){let t=0,r=0,n=0,s=Math.min(o.length,e.length);for(let a=0;a<s;a++)t+=o[a]*e[a],r+=o[a]*o[a],n+=e[a]*e[a];let i=Math.sqrt(r)*Math.sqrt(n);return i>1e-10?t/i:0}b();import{createRequire as ee}from"module";var S=ee(import.meta.url),V=g.create("coherence-gate-cohomology"),C=null,k=!1;function H(){if(k)return C;k=!0;try{let o=S("prime-radiant-advanced-wasm"),e=S("fs"),t=S("path"),r=t.join(t.dirname(I.resolve("prime-radiant-advanced-wasm")),"prime_radiant_advanced_wasm_bg.wasm");o.initSync({module:e.readFileSync(r)}),C=new o.CohomologyEngine,V.info("CohomologyEngine loaded from prime-radiant-advanced-wasm")}catch(o){V.debug("CohomologyEngine unavailable, using word-frequency fallback",{error:String(o)}),C=null}return C}var te={threshold:5,slack:.5,resetOnAlarm:!0,warmupSamples:20},d=class{config;states=new Map;constructor(e={}){this.config={...te,...e}}update(e,t){let r=this.getOrCreateState(e);if(r.samplesSinceReset++,r.mu===null)return r.warmupSum+=t,r.warmupCount++,r.warmupCount>=this.config.warmupSamples&&(r.mu=r.warmupSum/r.warmupCount),{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:r.samplesSinceReset};r.sPlus=Math.max(0,r.sPlus+(t-r.mu-this.config.slack)),r.sMinus=Math.max(0,r.sMinus+(-t+r.mu-this.config.slack));let n=Math.max(r.sPlus,r.sMinus),s=!1,i="none";r.sPlus>this.config.threshold?(s=!0,i="positive"):r.sMinus>this.config.threshold&&(s=!0,i="negative");let a={driftDetected:s,cumulativeSum:n,direction:i,samplesSinceReset:r.samplesSinceReset};return s&&this.config.resetOnAlarm&&(r.sPlus=0,r.sMinus=0,r.samplesSinceReset=0),a}reset(e){e?this.states.delete(e):this.states.clear()}getState(e){let t=this.states.get(e);if(!t)return{driftDetected:!1,cumulativeSum:0,direction:"none",samplesSinceReset:0};let r=Math.max(t.sPlus,t.sMinus),n="none";return t.sPlus>this.config.threshold?n="positive":t.sMinus>this.config.threshold&&(n="negative"),{driftDetected:t.sPlus>this.config.threshold||t.sMinus>this.config.threshold,cumulativeSum:r,direction:n,samplesSinceReset:t.samplesSinceReset}}getOrCreateState(e){let t=this.states.get(e);return t||(t={sPlus:0,sMinus:0,samplesSinceReset:0,warmupSum:0,warmupCount:0,mu:null},this.states.set(e,t)),t}};v();var x=g.create("coherence-gate-energy"),D=null,re=[],P=[],ne=100;function oe(){return D||(B()?(D=new d,x.debug("CUSUM drift detector auto-created via feature flag"),D):null)}function O(o,e){let t=oe();if(!t)return;let r=t.update(o,e);if(r.driftDetected){let n={gateType:o,energy:e,cusumResult:r,timestamp:Date.now()};x.warn("CUSUM drift detected",{gateType:o,energy:e,direction:r.direction,cumulativeSum:r.cumulativeSum}),P.push(n),P.length>ne&&P.shift();for(let s of re)try{s(n)}catch(i){x.debug("Drift listener error",{error:String(i)})}}}var f={assertionCoverage:.4,codeCoverage:.3,confidencePenalty:.3,contradictionWeight:.2,laplacianWeight:.15},N=1;function U(o){if(o.assertions.length===0)return 0;let e=o.observedBehavior.length/o.assertions.length;return Math.max(0,Math.min(1-e,1))}function $(o){return Math.max(0,Math.min(1-o.coverage,1))}function j(o){return Math.max(0,Math.min(1-o.confidence,1))}function se(o){if(o.assertions.length===0||o.observedBehavior.length===0)return 0;let e=0,t=["not","never","false","undefined","null","error","fail"];for(let r of o.assertions){let n=r.toLowerCase();for(let s of o.observedBehavior){let i=s.toLowerCase();for(let a of t){let c=n.includes(a),u=i.includes(a);if(c!==u){let m=new Set(n.split(/\s+/)),l=new Set(i.split(/\s+/)),h=0;for(let L of m)l.has(L)&&L.length>3&&h++;if(h>0){e++;break}}}}}return Math.min(e/o.assertions.length,1)}function ie(o,e,t){let r=t[0]?.length??64,n=t.map((c,u)=>({id:u,label:e.assertions[u]?.slice(0,50)??`assertion-${u}`,section:c,weight:e.confidence})),s=[];for(let c=0;c<t.length;c++)for(let u=c+1;u<t.length;u++){let m=[];for(let l=0;l<r;l++)for(let h=0;h<r;h++)m.push(l===h?1:0);s.push({source:c,target:u,weight:1,restriction_map:m,source_dim:r,target_dim:r})}let i=o.consistencyEnergy({nodes:n,edges:s}),a=i/(i+1);return Math.max(0,Math.min(a,1))}function ae(o){let e=0,t=0;for(let n=0;n<o.length;n++)for(let s=n+1;s<o.length;s++)e+=_(o[n],o[s]),t++;if(t===0)return 0;let r=e/t;return Math.max(0,Math.min(1-r,1))}function ce(o){if(o.assertions.length<2)return 0;let e=o.assertions.map(r=>W(r)),t=H();if(t)try{return ie(t,o,e)}catch(r){x.debug("CohomologyEngine.consistencyEnergy failed, using fallback",{error:String(r)})}return ae(e)}function K(o,e="act"){let t=U(o),r=$(o),n=j(o),s=Math.min(t*f.assertionCoverage+r*f.codeCoverage+n*f.confidencePenalty,1);return O(e,s),{energy:s,components:{assertionCoverage:t,codeCoverage:r,confidencePenalty:n,contradictionScore:0,laplacianDeviation:0}}}function q(o,e="retrieve"){let t=U(o),r=$(o),n=j(o),s=se(o),i=ce(o),a=t*f.assertionCoverage+r*f.codeCoverage+n*f.confidencePenalty,c=s*f.contradictionWeight+i*f.laplacianWeight,u=f.assertionCoverage+f.codeCoverage+f.confidencePenalty+f.contradictionWeight+f.laplacianWeight,m=Math.min((a+c)/u,1);return O(e,m),{energy:m,components:{assertionCoverage:t,codeCoverage:r,confidencePenalty:n,contradictionScore:s,laplacianDeviation:i}}}var z=g.create("coherence-gate"),le=.4,T=class{threshold;decisionLog=[];witnessChain=[];lastWitnessHash="0".repeat(64);nativeAvailable=null;governanceChain=null;constructor(e=le){this.threshold=e}setGovernanceChain(e){this.governanceChain=e}computeEnergy(e,t=!1,r="retrieve"){let n=performance.now();if(!t){let a=K(e,r),c=performance.now()-n;if(c<=N)return{energy:a.energy,tier:"reflex",components:a.components,latencyMs:c}}let s=q(e,r),i=performance.now()-n;return{energy:s.energy,tier:"retrieval",components:s.components,latencyMs:i}}validate(e,t,r="retrieve"){let n=t??this.threshold,s=this.computeEnergy(e,!1,r),i=s.energy<=n,a;i||(a=this.buildFailureReason(s,n));let c=this.createWitnessRecord(e,s.energy,n,i);return this.logDecision({id:c.id,timestamp:c.timestamp,domain:e.domain,energy:s.energy,tier:s.tier,passed:i,threshold:n}),{passed:i,energy:s.energy,threshold:n,reason:a,witness:c}}getDecisionLog(){return[...this.decisionLog]}getWitnessChain(){return[...this.witnessChain]}getThreshold(){return this.threshold}clearDecisionLog(){this.decisionLog=[]}validateTransfer(e,t){if(!p().useCoherenceGate)return{approved:!0};let n={assertions:this.extractAssertions(e),observedBehavior:this.extractObservedBehavior(e),coverage:typeof e.coverage=="number"?e.coverage:.5,domain:t,confidence:e.confidence??.5},s=this.validate(n,void 0,"write");return{approved:s.passed,energy:s.energy,rejectionReason:s.reason}}buildFailureReason(e,t){let r=[];r.push(`Coherence energy ${e.energy.toFixed(3)} exceeds threshold ${t.toFixed(3)}.`);let n=e.components;return n.assertionCoverage>.5&&r.push("High assertion-observation mismatch (possible hallucination)."),n.codeCoverage>.5&&r.push("Low code coverage."),n.confidencePenalty>.5&&r.push("Low generator confidence."),n.contradictionScore>.3&&r.push("Contradictions detected between assertions and observed behavior."),n.laplacianDeviation>.5&&r.push("Inconsistent assertion structure (high Laplacian deviation)."),r.join(" ")}createWitnessRecord(e,t,r,n){let s=me(),i=Date.now(),a=this.hashContent(JSON.stringify(e)),c={id:s,timestamp:i,artifactHash:a,energy:t,threshold:r,passed:n,previousHash:this.lastWitnessHash,recordHash:""},u=`${s}|${i}|${a}|${t}|${r}|${n}|${this.lastWitnessHash}`;if(c.recordHash=this.hashContent(u),p().useWitnessChain&&(this.witnessChain.push(c),this.lastWitnessHash=c.recordHash,this.governanceChain))try{let l={type:"coherence-gate",decision:n?"PASS":"FAIL",context:{energy:t,threshold:r,artifactHash:c.artifactHash}};this.governanceChain.appendWitness(l)}catch(l){z.debug("Failed to persist to governance chain",{error:String(l)})}return c}hashContent(e){return ue("sha256").update(e).digest("hex")}logDecision(e){this.decisionLog.push(e);let t=1e3;this.decisionLog.length>t&&(this.decisionLog=this.decisionLog.slice(-t)),z.debug("Coherence decision",{domain:e.domain,energy:e.energy,tier:e.tier,passed:e.passed})}extractAssertions(e){return Array.isArray(e.assertions)?e.assertions.map(String):typeof e.description=="string"?[e.description]:["transfer-pattern"]}extractObservedBehavior(e){return Array.isArray(e.observedBehavior)?e.observedBehavior.map(String):typeof e.evidence=="string"?[e.evidence]:["observed"]}};var R=class{validateTransfer(e,t){return{approved:!0}}};function X(){return p().useCoherenceGate?new T:new R}b();var Y=g.create("transfer-verification"),fe={maxSourceRegression:.05,minTargetImprovement:0,maxSourceConfidenceRegression:.1},w=class{config;constructor(e={}){this.config={...fe,...e}}verifyTransfer(e){let t=e.sourcePerformanceAfter.successRate-e.sourcePerformanceBefore.successRate,r=e.targetPerformanceAfter.successRate-e.targetPerformanceBefore.successRate,n=e.sourcePerformanceAfter.avgConfidence-e.sourcePerformanceBefore.avgConfidence,s=e.targetPerformanceAfter.avgConfidence-e.targetPerformanceBefore.avgConfidence,i=t>=-this.config.maxSourceRegression&&n>=-this.config.maxSourceConfidenceRegression,a=r>=this.config.minTargetImprovement,c=i&&a,u;if(!c){let m=[];i||m.push(`source domain regressed: successRate delta=${t.toFixed(4)}, confidence delta=${n.toFixed(4)}`),a||m.push(`target domain did not improve: successRate delta=${r.toFixed(4)}`),u=m.join("; ")}return c?Y.debug("Transfer verification passed",{transferId:e.transferId,sourceDelta:t,targetDelta:r}):Y.warn("Transfer verification failed",{transferId:e.transferId,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourceDelta:t,targetDelta:r,failureReason:u}),{passed:c,sourceStable:i,targetImproved:a,sourceDelta:t,targetDelta:r,sourceConfidenceDelta:n,targetConfidenceDelta:s,failureReason:u}}getConfig(){return{...this.config}}};function J(o){return new w(o)}v();var y=class{alphas=new Map;betas=new Map;sample(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return this.sampleBeta(t,r)}update(e,t){t?this.alphas.set(e,(this.alphas.get(e)??1)+1):this.betas.set(e,(this.betas.get(e)??1)+1)}getMean(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t/(t+r)}getObservationCount(e){let t=this.alphas.get(e)??1,r=this.betas.get(e)??1;return t-1+(r-1)}getAlpha(e){return this.alphas.get(e)??1}getBeta(e){return this.betas.get(e)??1}sampleBeta(e,t){let r=this.sampleGamma(e),n=this.sampleGamma(t);return r+n===0?.5:r/(r+n)}sampleGamma(e){if(e<1){let n=Math.random();return this.sampleGamma(e+1)*Math.pow(n,1/e)}let t=e-1/3,r=1/Math.sqrt(9*t);for(;;){let n,s;do n=this.standardNormal(),s=1+r*n;while(s<=0);s=s*s*s;let i=Math.random();if(i<1-.0331*n*n*n*n||Math.log(i)<.5*n*n+t*(1-s+Math.log(s)))return t*s}}standardNormal(){let e=Math.random(),t=Math.random();return Math.sqrt(-2*Math.log(e||1e-10))*Math.cos(2*Math.PI*t)}};var Q=g.create("domain-transfer"),ge={minTransferProbability:.3,explorationWarmup:5,verification:{},maxHistorySize:1e3,useMetaLearningEnhancements:!0},M=class{constructor(e=100){this.decayThreshold=e}decayThreshold;getDecayMultiplier(e){return e<=0?1:Math.pow(.5,e/this.decayThreshold)}applyDecay(e,t,r){return t+(e-t)*this.getDecayMultiplier(r)}},E=class{cusum;outcomes=[];windowSize;constructor(e=20){this.windowSize=e,this.cusum=new d({threshold:3,slack:.1,resetOnAlarm:!1,warmupSamples:Math.min(10,Math.floor(e/2))})}record(e){this.outcomes.push(e),this.outcomes.length>this.windowSize*2&&this.outcomes.splice(0,this.outcomes.length-this.windowSize*2);let t=this.getCurrentRate();this.cusum.update("learn",t)}isPlateaued(){return this.outcomes.length<this.windowSize?!1:!this.cusum.getState("learn").driftDetected}getCurrentRate(){if(this.outcomes.length===0)return 0;let e=this.outcomes.slice(-this.windowSize);return e.filter(Boolean).length/e.length}getOutcomeCount(){return this.outcomes.length}getCusumState(){return this.cusum.getState("learn")}},A=class{front=[];dominates(e,t){let r=e.successRate>=t.successRate&&e.speed>=t.speed&&e.confidence>=t.confidence,n=e.successRate>t.successRate||e.speed>t.speed||e.confidence>t.confidence;return r&&n}add(e){for(let t=this.front.length-1;t>=0;t--)this.dominates(e,this.front[t])&&this.front.splice(t,1);this.front.some(t=>this.dominates(t,e))||this.front.push(e)}getFront(){return[...this.front]}isNonDominated(e){return!this.front.some(t=>this.dominates(t,e))}},F=class{constructor(e=.2){this.bonusScale=e}bonusScale;triedPairs=new Set;markTried(e){this.triedPairs.add(e)}isTried(e){return this.triedPairs.has(e)}getBonus(e){return this.triedPairs.has(e)?0:this.bonusScale}apply(e,t){return Math.min(1,e+this.getBonus(t))}getTriedCount(){return this.triedPairs.size}},G=class{config;sampler;verifier;coherenceGate;transferHistory=[];affinityScores=new Map;performanceProvider=null;transferExecutor=null;nativeModule=null;decayingBeta;plateauDetector;paretoFront;curiosityBonus;constructor(e={}){this.config={...ge,...e},this.sampler=new y,this.verifier=J(this.config.verification),this.coherenceGate=X(),this.decayingBeta=new M,this.plateauDetector=new E,this.paretoFront=new A,this.curiosityBonus=new F,this.tryLoadNativeModule()}evaluateTransfer(e,t){if(!this.isEnabled())return this.createRejectedCandidate(e,t);let r=this.makePairKey(e,t),n=this.sampler.sample(r),i=this.sampler.getObservationCount(r)<this.config.explorationWarmup,a=this.getAffinityScore(e,t);if(this.isMetaLearningEnabled()){let c=this.sampler.getMean(r),u=this.sampler.getAlpha(r)-1;n=this.decayingBeta.applyDecay(n,c,u),n=this.curiosityBonus.apply(n,r)}return{sourceDomain:e,targetDomain:t,sampledProbability:n,affinityScore:a,isExploration:i,pairKey:r}}executeTransfer(e){let t=`transfer-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,r=this.coherenceGate.validateTransfer({domain:e.sourceDomain},e.targetDomain);if(!r.approved)return Q.info("Transfer blocked by coherence gate",{transferId:t,source:e.sourceDomain,target:e.targetDomain,reason:r.rejectionReason}),this.createBlockedResult(t,e,r);let n=this.getPerformanceSnapshot(e.sourceDomain),s=this.getPerformanceSnapshot(e.targetDomain),i=this.computeSqrtDampening(e),a=this.doTransfer(e.sourceDomain,e.targetDomain,i),c=this.getPerformanceSnapshot(e.sourceDomain),u=this.getPerformanceSnapshot(e.targetDomain),m=this.verifier.verifyTransfer({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,sourcePerformanceBefore:n,sourcePerformanceAfter:c,targetPerformanceBefore:s,targetPerformanceAfter:u}),l=a&&m.passed;if(this.sampler.update(e.pairKey,l),this.updateAffinityScore(e.pairKey,l),this.isMetaLearningEnabled()){this.plateauDetector.record(l),this.curiosityBonus.markTried(e.pairKey);let h=this.sampler.getMean(e.pairKey);this.paretoFront.add({pairKey:e.pairKey,successRate:h,speed:1/(1+i),confidence:this.getAffinityScore(e.sourceDomain,e.targetDomain)})}return this.addToHistory({transferId:t,sourceDomain:e.sourceDomain,targetDomain:e.targetDomain,success:l,sampledProbability:e.sampledProbability,dampeningFactor:i,sourceDelta:m.sourceDelta,targetDelta:m.targetDelta,timestamp:Date.now()}),Q.info("Transfer completed",{transferId:t,source:e.sourceDomain,target:e.targetDomain,success:l,dampeningFactor:i.toFixed(4),sourceDelta:m.sourceDelta.toFixed(4),targetDelta:m.targetDelta.toFixed(4)}),{transferId:t,candidate:e,success:l,dampeningFactor:i,verification:m,coherenceResult:r,sourcePerformanceBefore:n,sourcePerformanceAfter:c,targetPerformanceBefore:s,targetPerformanceAfter:u,timestamp:Date.now()}}getAffinityScore(e,t){return this.affinityScores.get(this.makePairKey(e,t))??.5}getTransferHistory(){return[...this.transferHistory]}getExpectedSuccessRate(e,t){return this.sampler.getMean(this.makePairKey(e,t))}getObservationCount(e,t){return this.sampler.getObservationCount(this.makePairKey(e,t))}setPerformanceProvider(e){this.performanceProvider=e}setTransferExecutor(e){this.transferExecutor=e}getSampler(){return this.sampler}getCoherenceGate(){return this.coherenceGate}getDecayingBeta(){return this.decayingBeta}getPlateauDetector(){return this.plateauDetector}getParetoFront(){return this.paretoFront}getCuriosityBonus(){return this.curiosityBonus}isLearningPlateaued(){return this.plateauDetector.isPlateaued()}isEnabled(){return p().useCrossDomainTransfer===!0}isMetaLearningEnabled(){return this.config.useMetaLearningEnhancements===!0&&p().useMetaLearningEnhancements!==!1}makePairKey(e,t){return`${e}->${t}`}computeSqrtDampening(e){let t=this.sampler.getObservationCount(e.pairKey);return Math.sqrt(t/(t+this.config.explorationWarmup))}doTransfer(e,t,r){return this.transferExecutor?this.transferExecutor(e,t,r):!0}getPerformanceSnapshot(e){return this.performanceProvider?this.performanceProvider(e):{domain:e,successRate:.5,avgConfidence:.5,patternCount:0,timestamp:Date.now()}}updateAffinityScore(e,t){let r=this.affinityScores.get(e)??.5;this.affinityScores.set(e,.2*(t?1:0)+.8*r)}addToHistory(e){for(this.transferHistory.push(e);this.transferHistory.length>this.config.maxHistorySize;)this.transferHistory.shift()}createBlockedResult(e,t,r){let n={domain:"",successRate:0,avgConfidence:0,patternCount:0,timestamp:Date.now()};return{transferId:e,candidate:t,success:!1,dampeningFactor:0,verification:{passed:!1,sourceStable:!1,targetImproved:!1,sourceDelta:0,targetDelta:0,sourceConfidenceDelta:0,targetConfidenceDelta:0,failureReason:`Coherence gate rejected: ${r.rejectionReason??"unknown"}`},coherenceResult:r,sourcePerformanceBefore:{...n,domain:t.sourceDomain},sourcePerformanceAfter:{...n,domain:t.sourceDomain},targetPerformanceBefore:{...n,domain:t.targetDomain},targetPerformanceAfter:{...n,domain:t.targetDomain},timestamp:Date.now()}}createRejectedCandidate(e,t){return{sourceDomain:e,targetDomain:t,sampledProbability:0,affinityScore:0,isExploration:!1,pairKey:this.makePairKey(e,t)}}tryLoadNativeModule(){this.nativeModule=null}};function $e(o){return new G(o)}export{d as a,y as b,ge as c,M as d,E as e,A as f,F as g,G as h,$e as i};
@@ -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.15");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.16");process.exit(0)}
2
2
  import{readFileSync as O,existsSync as x,readdirSync as A}from"fs";import{join as m,basename as w}from"path";function f(r){let e=[];if(!r||typeof r!="object")return e.push("Overlay must be a non-null object"),e;let n=r;if((!n.agent||typeof n.agent!="string")&&e.push('Overlay must have a string "agent" field'),n.replace!==void 0)if(typeof n.replace!="object"||n.replace===null)e.push('"replace" must be an object');else{let t=n.replace;t.description!==void 0&&typeof t.description!="string"&&e.push('"replace.description" must be a string'),t.domains!==void 0&&!Array.isArray(t.domains)&&e.push('"replace.domains" must be an array'),t.complexity!==void 0&&typeof t.complexity!="string"&&e.push('"replace.complexity" must be a string')}if(n.append!==void 0)if(typeof n.append!="object"||n.append===null)e.push('"append" must be an object');else{let t=n.append;t.instructions!==void 0&&typeof t.instructions!="string"&&e.push('"append.instructions" must be a string'),t.capabilities!==void 0&&!Array.isArray(t.capabilities)&&e.push('"append.capabilities" must be an array'),t.tags!==void 0&&!Array.isArray(t.tags)&&e.push('"append.tags" must be an array')}if(n.config!==void 0)if(typeof n.config!="object"||n.config===null)e.push('"config" must be an object');else{let t=n.config;t.minimumFindings!==void 0&&typeof t.minimumFindings!="number"&&e.push('"config.minimumFindings" must be a number'),t.maxParallelAgents!==void 0&&typeof t.maxParallelAgents!="number"&&e.push('"config.maxParallelAgents" must be a number'),t.preferredFrameworks!==void 0&&!Array.isArray(t.preferredFrameworks)&&e.push('"config.preferredFrameworks" must be an array'),t.needsContext!==void 0&&typeof t.needsContext!="boolean"&&e.push('"config.needsContext" must be a boolean')}return e}var v=".claude/agent-overrides",F=new Set(["__proto__","constructor","prototype"]);function $(r){let e={},n=p=>{let a=Object.hasOwn(e,p)?e[p]:void 0;if(a!==null&&typeof a=="object")return a;let l={};return e[p]=l,l},t=r.split(`
3
3
  `),i=null,s=null,o=null;for(let p of t){let a=p.replace(/\r$/,"");if(a.trim().startsWith("#")||a.trim()==="")continue;let l=a.length-a.trimStart().length,u=a.trim();if(u.startsWith("- ")){let b=u.slice(2).trim().replace(/^["']|["']$/g,"");s&&s.push(b);continue}s&&o&&(i&&(n(i)[o]=s),s=null,o=null);let g=u.match(/^(\w[\w.-]*)\s*:\s*(.*)$/);if(!g)continue;let[,c,h]=g,d=h.trim().replace(/^["']|["']$/g,"");if(F.has(c)){l===0&&(i=null);continue}l===0?d===""||d===void 0?(i=c,n(c)):(e[c]=y(d),i=null):l<=4&&i&&(d===""||d===void 0?(s=[],o=c):n(i)[c]=y(d))}return s&&o&&i&&(n(i)[o]=s),e}function y(r){if(r==="true")return!0;if(r==="false")return!1;if(r==="null")return null;let e=Number(r);return!isNaN(e)&&r!==""?e:r}function _(r){let e=m(r,v),n={overlays:[],warnings:[],errors:[]};if(!x(e))return n;let t;try{t=A(e).filter(i=>(i.endsWith(".yaml")||i.endsWith(".yml"))&&!i.startsWith("_"))}catch(i){return n.errors.push(`Failed to read overrides directory: ${i.message}`),n}for(let i of t){let s=m(e,i);try{let o=O(s,"utf-8"),p=$(o);if(!p.agent){let l=w(i).replace(/\.(override|customize)\.(yaml|yml)$/,"");p.agent=l}let a=f(p);if(a.length>0){n.warnings.push(`Overlay ${i} has validation issues: ${a.join("; ")}. Loading without overlay.`);continue}n.overlays.push(p)}catch(o){n.warnings.push(`Failed to parse overlay ${i}: ${o.message}. Agent loads without overlay.`)}}return n}function L(r,e){let n=r,t={agentName:e.agent,overlayFile:`${e.agent}.override.yaml`,replacedFields:[],appendedFields:[],configOverrides:[]};if(e.replace){if(e.replace.description){let i=/^(description:\s*).+$/m;i.test(n)&&(n=n.replace(i,`$1${e.replace.description}`),t.replacedFields.push("description"))}if(e.replace.domains){let i=/^(domain:\s*).+$/m;i.test(n)&&(n=n.replace(i,`$1${e.replace.domains.join(", ")}`),t.replacedFields.push("domains"))}if(e.replace.complexity){let i=/^(complexity:\s*).+$/m;i.test(n)&&(n=n.replace(i,`$1${e.replace.complexity}`),t.replacedFields.push("complexity"))}}if(e.append){if(e.append.instructions&&(n+=`
4
4
 
@@ -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.15");process.exit(0)}
2
- import{a as F,d as C}from"./chunk-OBDONJQM.js";import{a as E}from"./chunk-NQS3BWS6.js";import{a as O,b as P,c as x,e as J}from"./chunk-5G4UFTV4.js";import{b as W,d as B}from"./chunk-SZAZQZWI.js";var Q=new Set(["false","0","off","no"]),K=new Set([...Q,"disabled","disable","none","never"]),V=30,G=36500;function pe(l=process.env){let e=l.AQE_WORKERS_ENABLED;return e===void 0?!0:!Q.has(e.trim().toLowerCase())}function ge(l=process.env){let e=l.AQE_DISABLED_WORKERS;if(!e)return[];let t=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>i.length>0);return Array.from(new Set(t))}function fe(l=process.env){let e=l.AQE_DREAM_INSIGHTS_RETENTION_DAYS;if(e===void 0||e.trim()==="")return{retentionDays:V};let t=e.trim().toLowerCase();if(K.has(t))return{retentionDays:null};if(/^\d+$/.test(t)){let i=Number(t);if(i>=1&&i<=G)return{retentionDays:i}}return{retentionDays:null,warning:`Invalid AQE_DREAM_INSIGHTS_RETENTION_DAYS=${JSON.stringify(e)}; expected a whole number of days (1-${G}), 0 or "off". The dream_insights retention sweep is off until this is fixed; nothing is deleted.`}}var I="quality-daemon",R=class{constructor(e){this.backend=e}backend;async get(e,t){return this.backend.kvGet(e,t?.namespace??I)}async set(e,t){await this.backend.kvSet(e,t,I)}async search(e,t,i){return this.backend.kvSearch(e,i?.namespace??I,t)}};import{cpus as ce,freemem as de,totalmem as he,loadavg as me}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize&&(this.pruneExpired(),this.size>=this._maxSize)?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let r=i.shift();if(!(r.ttlMs&&e-r.createdAt>r.ttlMs))return r}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let r of i)if(!r.ttlMs||e-r.createdAt<=r.ttlMs)return r}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(r=>!r.ttlMs||i-r.createdAt<=r.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let r=this.queues[i].length;this.queues[i]=this.queues[i].filter(o=>!o.ttlMs||t-o.createdAt<=o.ttlMs),e+=r-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as Y}from"fs";import{resolve as $,join as X}from"path";import{existsSync as Z,readFileSync as ee}from"fs";var M=1e4,te={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...te,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=$(this.options.repoRoot,".git","refs","heads");if(!Z(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=Y(e,{recursive:!0},(i,r)=>{r&&this.handleRefChange(r)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let t=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let i of t.trim().split(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{a as F,d as C}from"./chunk-YRAX7SFJ.js";import{a as E}from"./chunk-NVEWF4JV.js";import{a as O,b as P,c as x,e as J}from"./chunk-S75SOOZL.js";import{b as W,d as B}from"./chunk-AGRV5B3T.js";var Q=new Set(["false","0","off","no"]),K=new Set([...Q,"disabled","disable","none","never"]),V=30,G=36500;function pe(l=process.env){let e=l.AQE_WORKERS_ENABLED;return e===void 0?!0:!Q.has(e.trim().toLowerCase())}function ge(l=process.env){let e=l.AQE_DISABLED_WORKERS;if(!e)return[];let t=e.split(",").map(i=>i.trim().toLowerCase()).filter(i=>i.length>0);return Array.from(new Set(t))}function fe(l=process.env){let e=l.AQE_DREAM_INSIGHTS_RETENTION_DAYS;if(e===void 0||e.trim()==="")return{retentionDays:V};let t=e.trim().toLowerCase();if(K.has(t))return{retentionDays:null};if(/^\d+$/.test(t)){let i=Number(t);if(i>=1&&i<=G)return{retentionDays:i}}return{retentionDays:null,warning:`Invalid AQE_DREAM_INSIGHTS_RETENTION_DAYS=${JSON.stringify(e)}; expected a whole number of days (1-${G}), 0 or "off". The dream_insights retention sweep is off until this is fixed; nothing is deleted.`}}var I="quality-daemon",R=class{constructor(e){this.backend=e}backend;async get(e,t){return this.backend.kvGet(e,t?.namespace??I)}async set(e,t){await this.backend.kvSet(e,t,I)}async search(e,t,i){return this.backend.kvSearch(e,i?.namespace??I,t)}};import{cpus as ce,freemem as de,totalmem as he,loadavg as me}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize&&(this.pruneExpired(),this.size>=this._maxSize)?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let r=i.shift();if(!(r.ttlMs&&e-r.createdAt>r.ttlMs))return r}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let r of i)if(!r.ttlMs||e-r.createdAt<=r.ttlMs)return r}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(r=>!r.ttlMs||i-r.createdAt<=r.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let r=this.queues[i].length;this.queues[i]=this.queues[i].filter(o=>!o.ttlMs||t-o.createdAt<=o.ttlMs),e+=r-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as Y}from"fs";import{resolve as $,join as X}from"path";import{existsSync as Z,readFileSync as ee}from"fs";var M=1e4,te={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...te,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=$(this.options.repoRoot,".git","refs","heads");if(!Z(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=Y(e,{recursive:!0},(i,r)=>{r&&this.handleRefChange(r)}):(this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this.pollTimer.unref?.()),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let t=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let i of t.trim().split(`
3
3
  `)){if(!i)continue;let[r,o]=i.split(" "),n=this.lastKnownHeads.get(r);n&&n!==o&&(e.push(r),await this.enqueueCommitAnalysis(r,o)),this.lastKnownHeads.set(r,o)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),i=$(this.options.repoRoot,".git","refs","heads"),r=X(i,e),o;try{o=ee(r,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==o&&(this.lastKnownHeads.set(t,o),await this.enqueueCommitAnalysis(t,o))}async enqueueCommitAnalysis(e,t){if(E(t,"commit hash"))return;let i=[];try{i=(await C(["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot,timeout:M})).trim().split(`
4
4
  `).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let r={type:"git_commit",branch:e,commitHash:t,changedFiles:i},o={id:`git-${t}-${Date.now()}`,priority:"next",payload:r,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(o)}async snapshotHeads(){try{let e=await C(["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot,timeout:M});for(let t of e.trim().split(`
5
5
  `)){if(!t)continue;let[i,r]=t.split(" ");this.lastKnownHeads.set(i,r)}}catch{}}};function A(l,e){return l===null||e===null?0:l-e}var ie={regressionThreshold:2,gapThreshold:60,memoryPrefix:"quality-daemon:coverage"},f=class{constructor(e,t){this.queue=e;this.options={...ie,...t}}queue;options;async analyze(e,t,i){let r=await t.get(`${this.options.memoryPrefix}:snapshot`);if(await t.set(`${this.options.memoryPrefix}:snapshot`,e),!r)return{regressionDetected:!1,overallDelta:{line:0,branch:0,function:0,statement:0},affectedFiles:[],newGaps:[]};let o=r,n={line:e.overall.line-o.overall.line,branch:A(e.overall.branch,o.overall.branch??null),function:A(e.overall.function,o.overall.function??null),statement:A(e.overall.statement,o.overall.statement??null)},s=n.line<-this.options.regressionThreshold||(n.branch??0)<-this.options.regressionThreshold,a=i??Object.keys(e.files),c=[],d=[];for(let h of a){let u=e.files[h],m=o.files[h];if(!u)continue;let q=m?u.line-m.line:0,N=m?u.branch-m.branch:0,T=m?u.uncoveredLines.filter(_=>!m.uncoveredLines.includes(_)):u.uncoveredLines;if((q!==0||N!==0||T.length>0)&&c.push({file:h,lineDelta:q,branchDelta:N,newUncoveredLines:T}),u.line<this.options.gapThreshold){let _=this.computeRiskScore(u,T.length);d.push({file:h,uncoveredLines:u.uncoveredLines,currentCoverage:u.line,riskScore:_})}}return(s||d.length>0)&&this.enqueueTestSuggestion(e,o,d),await t.set(`${this.options.memoryPrefix}:delta`,{timestamp:Date.now(),overallDelta:n,regressionDetected:s,affectedFileCount:c.length,gapCount:d.length}),{regressionDetected:s,overallDelta:n,affectedFiles:c,newGaps:d}}async buildSnapshot(e){let t=await e.get("coverage:latest"),i=F(t);if(i)return{timestamp:Date.now(),overall:{line:i.line,branch:i.branch,function:i.function,statement:i.statement},files:t&&typeof t.files=="object"?t.files:{}}}computeRiskScore(e,t){let r=1-Math.min(100,Math.max(0,e.line))/100,o=Math.min(t/50,1);return Math.min(1,r*.6+o*.4)}enqueueTestSuggestion(e,t,i){let r={type:"coverage_delta",previousSnapshot:`snapshot-${t.timestamp}`,currentSnapshot:`snapshot-${e.timestamp}`},o={id:`coverage-delta-${Date.now()}`,priority:i.some(n=>n.riskScore>.8)?"now":"next",payload:r,createdAt:Date.now(),source:"coverage-delta",ttlMs:600*1e3};this.queue.enqueue(o)}};J();import{execFile as re}from"child_process";import{promisify as oe}from"util";var ne=oe(re),se={runsPerWorkflow:10,flakyThreshold:3,repo:""},y=class{constructor(e,t){this.queue=e;this.options={...se,...t}}queue;options;async check(){let e=await this.fetchRecentRuns(),t=this.groupByWorkflow(e),i=[],r=[],o=0;for(let[s,a]of Object.entries(t)){let c=a.filter(m=>m.conclusion==="failure").length,d=a.length>0?(a.length-c)/a.length*100:100,h=this.countConsecutiveFailures(a),u=a[0]?.conclusion??"unknown";u==="failure"&&o++,h>=this.options.flakyThreshold&&(r.push(s),this.enqueueFailureAlert(s,a[0])),i.push({name:s,recentRuns:a.length,failedRuns:c,successRate:Math.round(d*10)/10,lastConclusion:u,consecutiveFailures:h})}let n=this.calculateHealthScore(i);return{timestamp:Date.now(),workflows:i,failingWorkflows:o,flakyWorkflows:r,healthScore:n}}async fetchRecentRuns(){try{let e=["run","list","--limit",String(this.options.runsPerWorkflow*5),"--json","name,status,conclusion,headBranch,number,databaseId,createdAt"];this.options.repo&&e.push("--repo",this.options.repo);let{stdout:t}=await ne("gh",e,{timeout:15e3});return JSON.parse(t).map(r=>({name:r.name,status:r.status,conclusion:r.conclusion??"pending",headBranch:r.headBranch,runNumber:r.number,databaseId:r.databaseId,createdAt:r.createdAt}))}catch{return[]}}groupByWorkflow(e){let t=O();for(let i of e){let r=P(t,i.name);r||(r=[],x(t,i.name,r)),r.push(i)}for(let i of Object.keys(t))x(t,i,P(t,i).slice(0,this.options.runsPerWorkflow));return t}countConsecutiveFailures(e){let t=0;for(let i of e)if(i.conclusion==="failure")t++;else break;return t}calculateHealthScore(e){if(e.length===0)return 100;let t=e.reduce((i,r)=>i+r.successRate,0)/e.length;return Math.round(t)}enqueueFailureAlert(e,t){let i={type:"ci_failure",workflowName:e,runId:t.databaseId,conclusion:t.conclusion},r={id:`ci-failure-${e}-${Date.now()}`,priority:"now",payload:i,createdAt:Date.now(),source:"ci-monitor",ttlMs:1800*1e3};this.queue.enqueue(r)}};var ae={memoryPrefix:"quality-daemon:suggestions",maxSuggestions:100,minRiskScore:.3},v=class{options;constructor(e){this.options={...ae,...e}}async suggest(e,t,i){let r=[],o=e.filter(s=>s.riskScore>=this.options.minRiskScore);for(let s of o){let a=t.includes(s.file),c=this.determinePriority(s,a),d=this.determineTestType(s.file),h=this.estimateEffort(s);r.push({id:`suggestion-${Date.now()}-${r.length}`,file:s.file,uncoveredLines:s.uncoveredLines.slice(0,50),suggestedTestType:d,description:this.generateDescription(s,d),priority:c,estimatedEffort:h,createdAt:Date.now(),status:"pending"})}r.sort((s,a)=>{let c={high:0,medium:1,low:2};return c[s.priority]-c[a.priority]});let n=r.slice(0,this.options.maxSuggestions);return await this.storeSuggestions(n,i),n}async getPending(e){return(await e.get(`${this.options.memoryPrefix}:list`)??[]).filter(i=>i.status==="pending")}async updateStatus(e,t,i){let r=await i.get(`${this.options.memoryPrefix}:list`);if(!r)return!1;let o=r.findIndex(s=>s.id===e);if(o===-1)return!1;let n=r.map((s,a)=>a===o?{...s,status:t}:s);return await i.set(`${this.options.memoryPrefix}:list`,n),!0}determinePriority(e,t){return e.riskScore>.8?"high":t||e.riskScore>.5?"medium":"low"}determineTestType(e){return e.includes("/api/")||e.includes("/routes/")||e.includes("/handlers/")?"integration":e.includes("/e2e/")||e.includes("/pages/")||e.includes("/views/")?"e2e":"unit"}estimateEffort(e){return e.uncoveredLines.length<=10?"small":e.uncoveredLines.length<=50?"medium":"large"}generateDescription(e,t){let i=e.uncoveredLines.length,r=Math.round(e.currentCoverage);return`Add ${t} tests for ${e.file} (${i} uncovered lines, ${r}% coverage, risk ${(e.riskScore*100).toFixed(0)}%)`}async storeSuggestions(e,t){let o=[...(await t.get(`${this.options.memoryPrefix}:list`)??[]).filter(n=>n.status!=="pending"),...e].slice(-this.options.maxSuggestions);await t.set(`${this.options.memoryPrefix}:list`,o),await t.set(`${this.options.memoryPrefix}:count`,{pending:e.length,total:o.length,lastUpdated:Date.now()})}};var le={memoryPrefix:"quality-daemon:nightly",maxEntryAge:6048e5,nightlyHour:2},w=class{constructor(e,t){this.queue=e;this.options={...le,...t}}queue;options;lastRunDate;shouldRun(){let e=new Date,t=e.toISOString().split("T")[0];return this.lastRunDate===t?!1:e.getHours()>=this.options.nightlyHour}scheduleIfDue(){if(!this.shouldRun())return!1;let e={type:"nightly",tasks:["consolidate_patterns","prune_expired","generate_report"]},t={id:`nightly-${Date.now()}`,priority:"later",payload:e,createdAt:Date.now(),source:"nightly-consolidation",ttlMs:720*60*1e3};return this.queue.enqueue(t)}async execute(e,t){let i=Date.now(),r=new Date().toISOString().split("T")[0],o=await this.consolidatePatterns(e),n=await this.pruneExpired(e),s=this.generateReport(r,t);await e.set(`${this.options.memoryPrefix}:report:${r}`,s),this.lastRunDate=r;let a={timestamp:Date.now(),patternsConsolidated:o,entriesPruned:n,reportGenerated:!0,durationMs:Date.now()-i};return await e.set(`${this.options.memoryPrefix}:last-result`,a),a}async getLastResult(e){return e.get(`${this.options.memoryPrefix}:last-result`)}async consolidatePatterns(e){let t=await e.search("quality-daemon:*"),i=0;return await e.get("quality-daemon:suggestions:count")&&i++,await e.get("quality-daemon:coverage:delta")&&i++,i}async pruneExpired(e){let t=await e.search("quality-daemon:*"),i=0,r=Date.now();for(let o of t){if(o.endsWith(":snapshot")||o.endsWith(":list"))continue;let n=await e.get(o);n&&typeof n.timestamp=="number"&&r-n.timestamp>this.options.maxEntryAge&&(await e.set(o,{pruned:!0,prunedAt:r}),i++)}return i}generateReport(e,t){return{date:e,coverageHealth:t.coverageHealth??0,ciHealth:t.ciHealth??0,commitsAnalyzed:t.commitsAnalyzed??0,suggestionsGenerated:t.suggestionsGenerated??0,notificationsSent:t.notificationsSent??0,queueDepthAvg:t.queueDepthAvg??0,daemonUptime:t.uptimeSeconds??0}}};B();import{writeFileSync as H,mkdirSync as L,readdirSync as D,readFileSync as U,unlinkSync as z}from"fs";import{join as b}from"path";var ue={maxNotifications:200},k=class{notificationsDir;maxNotifications;webhookUrl;urlValidator;_sentCount=0;constructor(e){this.notificationsDir=e?.notificationsDir??W("notifications"),this.maxNotifications=e?.maxNotifications??ue.maxNotifications,this.webhookUrl=e?.webhookUrl,this.urlValidator=e?.urlValidator}get sentCount(){return this._sentCount}initialize(){L(this.notificationsDir,{recursive:!0})}async send(e){let t={...e,id:`notif-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1};return this.writeToFile(t),this.webhookUrl&&await this.sendWebhook(t),this._sentCount++,this.pruneOldNotifications(),t}list(e){let t=e?.limit??50;try{let i=D(this.notificationsDir).filter(o=>o.endsWith(".json")).sort().reverse(),r=[];for(let o of i){if(r.length>=t)break;try{let n=U(b(this.notificationsDir,o),"utf-8"),s=JSON.parse(n);if(e?.unreadOnly&&s.read||e?.type&&s.type!==e.type)continue;r.push(s)}catch{}}return r}catch{return[]}}markRead(e){try{let t=D(this.notificationsDir).filter(n=>n.endsWith(`-${e}.json`));if(t.length===0)return!1;let i=b(this.notificationsDir,t[0]),o={...JSON.parse(U(i,"utf-8")),read:!0};return H(i,JSON.stringify(o,null,2)),!0}catch{return!1}}clear(){try{let e=D(this.notificationsDir).filter(t=>t.endsWith(".json"));for(let t of e)z(b(this.notificationsDir,t));return e.length}catch{return 0}}writeToFile(e){try{L(this.notificationsDir,{recursive:!0});let t=`${e.timestamp}-${e.id}.json`,i=b(this.notificationsDir,t);H(i,JSON.stringify(e,null,2))}catch(t){console.debug("[NotificationService] Failed to write notification:",t)}}async sendWebhook(e){if(this.webhookUrl){if(this.urlValidator&&!this.urlValidator(this.webhookUrl)){console.warn("[NotificationService] Webhook URL blocked by SSRF guard:",this.webhookUrl);return}try{let t=await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)});t.ok||console.debug(`[NotificationService] Webhook returned ${t.status}`)}catch(t){console.debug("[NotificationService] Webhook delivery failed:",t)}}}pruneOldNotifications(){try{let e=D(this.notificationsDir).filter(i=>i.endsWith(".json")).sort();if(e.length<=this.maxNotifications)return;let t=e.slice(0,e.length-this.maxNotifications);for(let i of t)z(b(this.notificationsDir,i))}catch{}}};var S={tickIntervalMs:3e4,ciPollIntervalMs:5*6e4,coverageCheckIntervalMs:2*6e4,cpuThreshold:.7,memoryThreshold:.8},j=class{queue;gitWatcher;coverageDelta;ciMonitor;testSuggester;nightlyConsolidation;notificationService;tickTimer;_running=!1;_startedAt=0;_tickCount=0;_lastTickAt;_throttled=!1;_commitsAnalyzed=0;_suggestionsGenerated=0;_ciHealth=100;_coverageHealth=100;_lastCICheck;_lastCoverageCheck;_memory;config;constructor(e){this.config={tickIntervalMs:e?.tickIntervalMs??S.tickIntervalMs,ciPollIntervalMs:e?.ciPollIntervalMs??S.ciPollIntervalMs,coverageCheckIntervalMs:e?.coverageCheckIntervalMs??S.coverageCheckIntervalMs,cpuThreshold:e?.cpuThreshold??S.cpuThreshold,memoryThreshold:e?.memoryThreshold??S.memoryThreshold},this.queue=new p,this.gitWatcher=new g(this.queue,e?.git),this.coverageDelta=new f(this.queue,e?.coverage),this.ciMonitor=new y(this.queue,e?.ci),this.testSuggester=new v(e?.suggestions),this.nightlyConsolidation=new w(this.queue,e?.nightly),this.notificationService=new k(e?.notifications)}get running(){return this._running}async start(e){this._running||(this._memory=e,this._running=!0,this._startedAt=Date.now(),this.notificationService.initialize(),await this.gitWatcher.start().catch(t=>{console.debug("[QualityDaemon] Git watcher failed to start:",t)}),this.scheduleTick())}async stop(){this._running&&(this._running=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=void 0),this.gitWatcher.stop(),this._memory&&await this._memory.set("quality-daemon:state",{stoppedAt:Date.now(),tickCount:this._tickCount,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated}))}getStatus(){return{running:this._running,uptimeSeconds:this._running?Math.floor((Date.now()-this._startedAt)/1e3):0,tickCount:this._tickCount,queueDepth:this.queue.depths,lastTickAt:this._lastTickAt,throttled:this._throttled,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,ciHealth:this._ciHealth,coverageHealth:this._coverageHealth,lastCICheck:this._lastCICheck,lastCoverageCheck:this._lastCoverageCheck}}scheduleTick(){this._running&&(this.tickTimer=setTimeout(()=>this.tick(),this.config.tickIntervalMs),this.tickTimer.unref?.())}async tick(){if(!(!this._running||!this._memory)){if(this._tickCount++,this._lastTickAt=Date.now(),this._throttled=this.isResourceConstrained(),this._throttled){await this.processNowItems(this._memory),this.scheduleTick();return}await this.processQueue(this._memory),await this.runPeriodicChecks(this._memory),this.nightlyConsolidation.scheduleIfDue(),this.queue.pruneExpired(),this.scheduleTick()}}async processQueue(e){let t=0,i=10;for(;t<i&&!this.queue.isEmpty;){let r=this.queue.dequeue();if(!r)break;await this.handleQueueItem(r,e),t++}}async processNowItems(e){let t=this.queue.drainPriority("now");for(let i of t)await this.handleQueueItem(i,e)}async handleQueueItem(e,t){let i=e.payload;switch(i.type){case"git_commit":{this._commitsAnalyzed++;let r=await this.coverageDelta.buildSnapshot(t);if(r){let o=await this.coverageDelta.analyze(r,t,i.changedFiles);if(o.regressionDetected&&await this.notificationService.send({type:"coverage_drop",title:"Coverage Regression Detected",message:`Line coverage delta: ${o.overallDelta.line.toFixed(1)}% (${o.affectedFiles.length} files affected)`,severity:"high",metadata:{delta:o.overallDelta,commit:i.commitHash}}),o.newGaps.length>0){let n=await this.testSuggester.suggest(o.newGaps,i.changedFiles,t);this._suggestionsGenerated+=n.length,n.length>0&&await this.notificationService.send({type:"suggestion_available",title:"New Test Suggestions Available",message:`${n.length} test suggestions generated for uncovered code`,severity:"info",metadata:{count:n.length}})}}break}case"coverage_delta":{let r=await this.testSuggester.getPending(t);r.length>0&&await this.notificationService.send({type:"suggestion_available",title:"Test Suggestions Pending",message:`${r.length} test suggestions awaiting review`,severity:"info",metadata:{count:r.length}});break}case"gate_failure":await this.notificationService.send({type:"gate_failure",title:`Quality Gate Failed: ${i.gateName}`,message:`Score ${i.score} below threshold ${i.threshold}`,severity:"critical",metadata:{gate:i.gateName,score:i.score,threshold:i.threshold}});break;case"ci_failure":await this.notificationService.send({type:"ci_failure",title:`CI Failure: ${i.workflowName}`,message:`Workflow ${i.workflowName} run #${i.runId} concluded: ${i.conclusion}`,severity:"high",metadata:{workflow:i.workflowName,runId:i.runId}});break;case"nightly":{let r={coverageHealth:this._coverageHealth,ciHealth:this._ciHealth,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,queueDepthAvg:this.queue.size,uptimeSeconds:Math.floor((Date.now()-this._startedAt)/1e3)};await this.nightlyConsolidation.execute(t,r);break}default:console.warn("[QualityDaemon] Unhandled payload type:",i.type)}}async runPeriodicChecks(e){let t=Date.now();if(!this._lastCICheck||t-this._lastCICheck>=this.config.ciPollIntervalMs)try{let i=await this.ciMonitor.check();this._ciHealth=i.healthScore,this._lastCICheck=t,i.flakyWorkflows.length>0&&await this.notificationService.send({type:"flaky_detected",title:"Flaky Workflows Detected",message:`${i.flakyWorkflows.length} workflows showing repeated failures: ${i.flakyWorkflows.join(", ")}`,severity:"medium",metadata:{workflows:i.flakyWorkflows}})}catch{}if(!this._lastCoverageCheck||t-this._lastCoverageCheck>=this.config.coverageCheckIntervalMs)try{let i=await this.coverageDelta.buildSnapshot(e);if(i){let r=[i.overall.line,i.overall.branch,i.overall.function,i.overall.statement].filter(o=>typeof o=="number");this._coverageHealth=Math.round(r.reduce((o,n)=>o+n,0)/r.length),this._lastCoverageCheck=t}}catch{}}isResourceConstrained(){if(1-de()/he()>this.config.memoryThreshold)return!0;let t=ce().length;return(t>0?me()[0]/t:0)>this.config.cpuThreshold}};export{pe as a,ge as b,fe as c,R as d,j as e};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");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.16");process.exit(0)}
2
2
  import{existsSync as c,readFileSync as f}from"fs";import{join as p,dirname as i}from"path";import{fileURLToPath as s}from"url";function u(o,a=10){let t=i(s(o));for(let r=0;r<a;r++){let n=p(t,"package.json");if(c(n))try{if(JSON.parse(f(n,"utf-8")).name==="agentic-qe")return t}catch{}let e=i(t);if(e===t)break;t=e}return null}export{u as a};
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
2
- import{b as l,d as y}from"./chunk-XWIAZG3C.js";y();import{copyFileSync as k,existsSync as c,readFileSync as u,writeFileSync as s}from"fs";function J(n,r){let e=typeof r=="string"?Buffer.from(r,"utf-8"):r;try{if(c(n)&&u(n).equals(e))return!1}catch{}return typeof r=="string"?s(n,r,"utf-8"):s(n,r),!0}function S(n,r){try{if(c(r)&&u(r).equals(u(n)))return!1}catch{}return k(n,r),!0}function E(n,r,e){try{if(c(n)){let t=o=>o.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.16");process.exit(0)}
2
+ import{b as l,d as y}from"./chunk-V5NHZV7S.js";y();import{copyFileSync as k,existsSync as c,readFileSync as u,writeFileSync as s}from"fs";function J(n,r){let e=typeof r=="string"?Buffer.from(r,"utf-8"):r;try{if(c(n)&&u(n).equals(e))return!1}catch{}return typeof r=="string"?s(n,r,"utf-8"):s(n,r),!0}function S(n,r){try{if(c(r)&&u(r).equals(u(n)))return!1}catch{}return k(n,r),!0}function E(n,r,e){try{if(c(n)){let t=o=>o.split(`
3
3
  `).filter(i=>!e.test(i)).join(`
4
4
  `);if(t(u(n,"utf-8"))===t(r))return!1}}catch{}return s(n,r,"utf-8"),!0}var I=/^\*Generated by AQE v3 init on [^*]+\*$/;function a(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}function d(n){return JSON.stringify(n,(r,e)=>{if(!a(e))return e;let t={};for(let o of Object.keys(e).sort())t[o]=e[o];return t})}function w(n,r){return d(n)===d(r)}function f(n,r){let e=n;for(let t of r){if(!a(e))return;e=e[t]}return e}function g(n,r,e){let t=n;for(let i of r.slice(0,-1)){if(!a(t[i]))return;t=t[i]}let o=r[r.length-1];o in t&&(t[o]=e)}function p(n,r,e){if(!a(n))return!0;let t=JSON.parse(JSON.stringify(r));for(let o of e){let i=f(n,o);i!==void 0&&f(t,o)!==void 0&&g(t,o,i)}if(!w(n,t))return!0;for(let o of e){let i=f(n,o);i!==void 0&&f(r,o)!==void 0&&g(r,o,i)}return!1}function R(n){if(c(n))try{return l(u(n,"utf-8"))}catch{return}}function N(n,r,e=[]){let t=R(n);return t!==void 0&&!p(t,r,e)?!1:(s(n,JSON.stringify(r,null,2),"utf-8"),!0)}export{J as a,S as b,E as c,I as d,p as e,N 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.15");process.exit(0)}
2
- import{g,n as f}from"./chunk-LTQVUAPH.js";import{a as l,d as c,e as k}from"./chunk-5G4UFTV4.js";import{b as C}from"./chunk-XH4JMX5O.js";import{randomUUID as T}from"crypto";function b(s){let t=Object.hasOwn(h,s)?h[s]:void 0;if(t)return{input:t.input,output:t.output};let e=g(s);if(e.inputCostPerMillion>0||e.outputCostPerMillion>0)return{input:e.inputCostPerMillion,output:e.outputCostPerMillion}}function w(){return d||(d=new m),d}function x(){d&&(d.dispose(),d=void 0)}var h,m,d,R=C(()=>{f();k();h={"claude-sonnet-5":{input:2,output:10,provider:"claude"},"claude-opus-5":{input:5,output:25,provider:"claude"},"claude-opus-5-5":{input:4,output:20,provider:"claude"},"claude-fable-5-1":{input:10,output:50,provider:"claude"},"claude-fable-5":{input:10,output:50,provider:"claude"},"claude-opus-4-8":{input:5,output:25,provider:"claude"},"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-haiku-4-5":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:5,output:25,provider:"claude"},"claude-opus-4-6":{input:5,output:25,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-6-astra":{input:10,output:50,provider:"openai"},"gpt-6-sol":{input:2,output:10,provider:"openai"},"gpt-6-luna":{input:.1,output:.5,provider:"openai"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-sonnet-5":{input:2,output:10,provider:"openrouter"},"anthropic/claude-opus-5":{input:5,output:25,provider:"openrouter"},"anthropic/claude-opus-5.5":{input:4,output:20,provider:"openrouter"},"anthropic/claude-haiku-4.5":{input:1,output:5,provider:"openrouter"},"openai/gpt-6-sol":{input:2,output:10,provider:"openrouter"},"openai/gpt-6-luna":{input:.1,output:.5,provider:"openrouter"},"google/gemini-3.8-flash":{input:.75,output:3.75,provider:"openrouter"},"meta-llama/llama-4-maverick":{input:.1875,output:.6525,provider:"openrouter"},"openai/gpt-oss-120b":{input:.15,output:.6,provider:"openrouter"},"qwen/qwen3-coder":{input:.3,output:1,provider:"openrouter"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-3.8-flash":{input:.75,output:3.75,provider:"gemini"},"gemini-3.5-flash":{input:1.5,output:9,provider:"gemini"},"gemini-3.1-pro-preview":{input:2,output:12,provider:"gemini"},"gemini-2.5-flash":{input:.3,output:2.5,provider:"gemini"},"gemini-2.5-pro":{input:1.25,output:10,provider:"gemini"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}};m=class s{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,e){let o=b(t);if(!o)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=e.promptTokens/1e6*o.input+(e.cacheReadTokens??0)/1e6*o.input*.1+(e.cacheCreationTokens??0)/1e6*o.input*1.25,r=e.completionTokens/1e6*o.output;return{inputCost:i,outputCost:r,totalCost:i+r,currency:"USD"}}static getCostPerToken(t){let e=b(t);return e?{input:e.input/1e6,output:e.output/1e6}:{input:0,output:0}}recordUsage(t,e,o,i,r){let p=s.calculateCost(e,o),n={timestamp:new Date,provider:t,model:e,usage:o,cost:p,requestId:i,metadata:r};return this.records.push(n),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),p}getSummary(t){let e=new Date,o=this.getPeriodStart(e,t),i=e,r=this.records.filter(a=>a.timestamp>=o&&a.timestamp<=i),p={claude:0,"claude-code":0,codex:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0,cognitum:0},n=l(),u=0,v=0;for(let a of r)u+=a.cost.totalCost,v+=a.usage.totalTokens,c(p,a.provider,a.cost.totalCost),c(n,a.model,a.cost.totalCost);return{period:t,periodStart:o,periodEnd:i,totalCost:u,byProvider:p,byModel:n,totalTokens:v,totalRequests:r.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,e="all"){let o=this.getPeriodStart(new Date,e),i=this.records.filter(u=>u.provider===t&&u.timestamp>=o),r=l(),p=0,n=0;for(let u of i)p+=u.cost.totalCost,n+=u.usage.totalTokens,r[u.model]||(r[u.model]={cost:0,tokens:0,requests:0}),r[u.model].cost+=u.cost.totalCost,r[u.model].tokens+=u.usage.totalTokens,r[u.model].requests+=1;return{totalCost:p,totalTokens:n,totalRequests:i.length,models:r}}addAlert(t,e,o){let i=`alert-${Date.now()}-${T().slice(0,12)}`;return this.alerts.push({threshold:t,period:e,onThreshold:o,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let e of t)e.timestamp=new Date(e.timestamp),this.records.push(e);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,e,o){return s.calculateCost(t,{promptTokens:e,completionTokens:o,totalTokens:e+o})}wouldExceedLimit(t,e,o,i,r){let p=this.getCurrentCost(r),n=this.estimateCost(t,e,o);return p+n.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,e){let o=new Date(t);switch(e){case"minute":o.setSeconds(0,0),o.setMinutes(o.getMinutes()-1);break;case"hour":o.setMinutes(0,0,0),o.setHours(o.getHours()-1);break;case"day":o.setHours(0,0,0,0);break;case"week":o.setHours(0,0,0,0),o.setDate(o.getDate()-7);break;case"month":o.setHours(0,0,0,0),o.setDate(1);break;case"all":return new Date(0)}return o}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let e=this.getSummary(t.period);if(e.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(e)}catch(o){console.error("Cost alert callback error:",o)}}}}}});export{h as a,b,m as c,w as d,x as e,R 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.16");process.exit(0)}
2
+ import{g,n as f}from"./chunk-ZQ2XW3IP.js";import{a as l,d as c,e as k}from"./chunk-S75SOOZL.js";import{b as C}from"./chunk-AJMJNQMP.js";import{randomUUID as T}from"crypto";function b(s){let t=Object.hasOwn(h,s)?h[s]:void 0;if(t)return{input:t.input,output:t.output};let e=g(s);if(e.inputCostPerMillion>0||e.outputCostPerMillion>0)return{input:e.inputCostPerMillion,output:e.outputCostPerMillion}}function w(){return d||(d=new m),d}function x(){d&&(d.dispose(),d=void 0)}var h,m,d,R=C(()=>{f();k();h={"claude-sonnet-5":{input:2,output:10,provider:"claude"},"claude-opus-5":{input:5,output:25,provider:"claude"},"claude-opus-5-5":{input:4,output:20,provider:"claude"},"claude-fable-5-1":{input:10,output:50,provider:"claude"},"claude-fable-5":{input:10,output:50,provider:"claude"},"claude-opus-4-8":{input:5,output:25,provider:"claude"},"claude-opus-4-7":{input:5,output:25,provider:"claude"},"claude-sonnet-4-6":{input:3,output:15,provider:"claude"},"claude-haiku-4-5-20251001":{input:1,output:5,provider:"claude"},"claude-haiku-4-5":{input:1,output:5,provider:"claude"},"claude-opus-4-5-20251101":{input:5,output:25,provider:"claude"},"claude-opus-4-6":{input:5,output:25,provider:"claude"},"claude-sonnet-4-20250514":{input:3,output:15,provider:"claude"},"claude-3-5-haiku-20241022":{input:1,output:5,provider:"claude"},"claude-3-opus-20240229":{input:15,output:75,provider:"claude"},"claude-3-sonnet-20240229":{input:3,output:15,provider:"claude"},"claude-3-haiku-20240307":{input:.25,output:1.25,provider:"claude"},"gpt-6-astra":{input:10,output:50,provider:"openai"},"gpt-6-sol":{input:2,output:10,provider:"openai"},"gpt-6-luna":{input:.1,output:.5,provider:"openai"},"gpt-4o":{input:5,output:15,provider:"openai"},"gpt-4o-mini":{input:.15,output:.6,provider:"openai"},"gpt-4-turbo":{input:10,output:30,provider:"openai"},"gpt-4":{input:30,output:60,provider:"openai"},"gpt-3.5-turbo":{input:.5,output:1.5,provider:"openai"},llama3:{input:0,output:0,provider:"ollama"},"llama3.1":{input:0,output:0,provider:"ollama"},codellama:{input:0,output:0,provider:"ollama"},mistral:{input:0,output:0,provider:"ollama"},mixtral:{input:0,output:0,provider:"ollama"},phi3:{input:0,output:0,provider:"ollama"},qwen2:{input:0,output:0,provider:"ollama"},"anthropic/claude-sonnet-5":{input:2,output:10,provider:"openrouter"},"anthropic/claude-opus-5":{input:5,output:25,provider:"openrouter"},"anthropic/claude-opus-5.5":{input:4,output:20,provider:"openrouter"},"anthropic/claude-haiku-4.5":{input:1,output:5,provider:"openrouter"},"openai/gpt-6-sol":{input:2,output:10,provider:"openrouter"},"openai/gpt-6-luna":{input:.1,output:.5,provider:"openrouter"},"google/gemini-3.8-flash":{input:.75,output:3.75,provider:"openrouter"},"meta-llama/llama-4-maverick":{input:.1875,output:.6525,provider:"openrouter"},"openai/gpt-oss-120b":{input:.15,output:.6,provider:"openrouter"},"qwen/qwen3-coder":{input:.3,output:1,provider:"openrouter"},"anthropic/claude-3.5-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3.5-sonnet:beta":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-opus":{input:15,output:75,provider:"openrouter"},"anthropic/claude-3-sonnet":{input:3,output:15,provider:"openrouter"},"anthropic/claude-3-haiku":{input:.25,output:1.25,provider:"openrouter"},"openai/gpt-4o":{input:5,output:15,provider:"openrouter"},"openai/gpt-4o-mini":{input:.15,output:.6,provider:"openrouter"},"openai/gpt-4-turbo":{input:10,output:30,provider:"openrouter"},"openai/gpt-3.5-turbo":{input:.5,output:1.5,provider:"openrouter"},"google/gemini-pro":{input:.125,output:.375,provider:"openrouter"},"google/gemini-pro-1.5":{input:3.5,output:10.5,provider:"openrouter"},"meta-llama/llama-3.1-70b-instruct":{input:.59,output:.79,provider:"openrouter"},"meta-llama/llama-3.1-8b-instruct":{input:.06,output:.06,provider:"openrouter"},"mistralai/mistral-large":{input:2,output:6,provider:"openrouter"},"mistralai/mixtral-8x7b-instruct":{input:.24,output:.24,provider:"openrouter"},"mistralai/mistral-7b-instruct":{input:.06,output:.06,provider:"openrouter"},"anthropic.claude-opus-4-5-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-opus-4-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-sonnet-4-5-v2:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-sonnet-4-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-5-haiku-v1:0":{input:1,output:5,provider:"bedrock"},"anthropic.claude-3-opus-20240229-v1:0":{input:15,output:75,provider:"bedrock"},"anthropic.claude-3-sonnet-20240229-v1:0":{input:3,output:15,provider:"bedrock"},"anthropic.claude-3-haiku-20240307-v1:0":{input:.25,output:1.25,provider:"bedrock"},"anthropic.claude-3-5-sonnet-20241022-v2:0":{input:3,output:15,provider:"bedrock"},"azure/gpt-4o":{input:5,output:15,provider:"azure-openai"},"azure/gpt-4o-mini":{input:.15,output:.6,provider:"azure-openai"},"azure/gpt-4-turbo":{input:10,output:30,provider:"azure-openai"},"azure/gpt-4":{input:30,output:60,provider:"azure-openai"},"azure/gpt-35-turbo":{input:.5,output:1.5,provider:"azure-openai"},"azure/text-embedding-ada-002":{input:.1,output:0,provider:"azure-openai"},"azure/text-embedding-3-small":{input:.02,output:0,provider:"azure-openai"},"azure/text-embedding-3-large":{input:.13,output:0,provider:"azure-openai"},"gemini-3.8-flash":{input:.75,output:3.75,provider:"gemini"},"gemini-3.5-flash":{input:1.5,output:9,provider:"gemini"},"gemini-3.1-pro-preview":{input:2,output:12,provider:"gemini"},"gemini-2.5-flash":{input:.3,output:2.5,provider:"gemini"},"gemini-2.5-pro":{input:1.25,output:10,provider:"gemini"},"gemini-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.0-pro":{input:.5,output:1.5,provider:"gemini"},"gemini-1.5-pro":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-pro-latest":{input:3.5,output:10.5,provider:"gemini"},"gemini-1.5-flash":{input:.075,output:.3,provider:"gemini"},"gemini-1.5-flash-latest":{input:.075,output:.3,provider:"gemini"},"gemini-2.0-flash-exp":{input:.075,output:.3,provider:"gemini"},"gemini-ultra":{input:7,output:21,provider:"gemini"},"gemini-1.0-ultra":{input:7,output:21,provider:"gemini"},"text-embedding-004":{input:.025,output:0,provider:"gemini"}};m=class s{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(t=1e4){this.maxRecords=t}static calculateCost(t,e){let o=b(t);if(!o)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let i=e.promptTokens/1e6*o.input+(e.cacheReadTokens??0)/1e6*o.input*.1+(e.cacheCreationTokens??0)/1e6*o.input*1.25,r=e.completionTokens/1e6*o.output;return{inputCost:i,outputCost:r,totalCost:i+r,currency:"USD"}}static getCostPerToken(t){let e=b(t);return e?{input:e.input/1e6,output:e.output/1e6}:{input:0,output:0}}recordUsage(t,e,o,i,r){let p=s.calculateCost(e,o),n={timestamp:new Date,provider:t,model:e,usage:o,cost:p,requestId:i,metadata:r};return this.records.push(n),this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords)),this.checkAlerts(),p}getSummary(t){let e=new Date,o=this.getPeriodStart(e,t),i=e,r=this.records.filter(a=>a.timestamp>=o&&a.timestamp<=i),p={claude:0,"claude-code":0,codex:0,openai:0,ollama:0,openrouter:0,bedrock:0,"azure-openai":0,gemini:0,cognitum:0},n=l(),u=0,v=0;for(let a of r)u+=a.cost.totalCost,v+=a.usage.totalTokens,c(p,a.provider,a.cost.totalCost),c(n,a.model,a.cost.totalCost);return{period:t,periodStart:o,periodEnd:i,totalCost:u,byProvider:p,byModel:n,totalTokens:v,totalRequests:r.length}}getCurrentCost(t){return this.getSummary(t).totalCost}getTotalTokens(t){return this.getSummary(t).totalTokens}getUsageByProvider(t,e="all"){let o=this.getPeriodStart(new Date,e),i=this.records.filter(u=>u.provider===t&&u.timestamp>=o),r=l(),p=0,n=0;for(let u of i)p+=u.cost.totalCost,n+=u.usage.totalTokens,r[u.model]||(r[u.model]={cost:0,tokens:0,requests:0}),r[u.model].cost+=u.cost.totalCost,r[u.model].tokens+=u.usage.totalTokens,r[u.model].requests+=1;return{totalCost:p,totalTokens:n,totalRequests:i.length,models:r}}addAlert(t,e,o){let i=`alert-${Date.now()}-${T().slice(0,12)}`;return this.alerts.push({threshold:t,period:e,onThreshold:o,active:!0}),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),i}removeAlert(t){return t>=0&&t<this.alerts.length?(this.alerts.splice(t,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getRecords(){return[...this.records]}importRecords(t){for(let e of t)e.timestamp=new Date(e.timestamp),this.records.push(e);this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}clear(){this.records=[]}getRecentRequests(t=10){return this.records.slice(-t)}estimateCost(t,e,o){return s.calculateCost(t,{promptTokens:e,completionTokens:o,totalTokens:e+o})}wouldExceedLimit(t,e,o,i,r){let p=this.getCurrentCost(r),n=this.estimateCost(t,e,o);return p+n.totalCost>i}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}getPeriodStart(t,e){let o=new Date(t);switch(e){case"minute":o.setSeconds(0,0),o.setMinutes(o.getMinutes()-1);break;case"hour":o.setMinutes(0,0,0),o.setHours(o.getHours()-1);break;case"day":o.setHours(0,0,0,0);break;case"week":o.setHours(0,0,0,0),o.setDate(o.getDate()-7);break;case"month":o.setHours(0,0,0,0),o.setDate(1);break;case"all":return new Date(0)}return o}checkAlerts(){for(let t of this.alerts){if(!t.active)continue;let e=this.getSummary(t.period);if(e.totalCost>=t.threshold){t.active=!1;try{t.onThreshold(e)}catch(o){console.error("Cost alert callback error:",o)}}}}}});export{h as a,b,m as c,w as d,x as e,R as f};
@@ -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.15");process.exit(0)}
2
- import{o as c,r as d,v as f}from"./chunk-T66PPF4D.js";import{a as r,e as p}from"./chunk-GCHYOPRZ.js";import{a as h}from"./chunk-3HVFIITW.js";import{c as l}from"./chunk-BQ47GQPK.js";f();p();h();import*as m from"path";var u=l.create("hybrid-backend"),s=class{unifiedMemory=null;config;cleanupInterval;cleanupCount=0;initialized=!1;constructor(e){this.config={sqlite:{path:e?.sqlite?.path??".agentic-qe/memory.db",walMode:e?.sqlite?.walMode??!0,poolSize:e?.sqlite?.poolSize??5,busyTimeout:e?.sqlite?.busyTimeout??r.BUSY_TIMEOUT_MS,...e?.sqlite},agentdb:{path:e?.agentdb?.path??".agentic-qe/memory.db",...e?.agentdb},enableFallback:e?.enableFallback??!0,defaultNamespace:e?.defaultNamespace??"default",cleanupInterval:e?.cleanupInterval??r.CLEANUP_INTERVAL_MS}}async initialize(e){if(this.initialized)return;let i=e?.signal;i?.throwIfAborted();let t={dbPath:this.config.sqlite.path??c.dbPath,walMode:this.config.sqlite.walMode??!0,busyTimeout:this.config.sqlite.busyTimeout??r.BUSY_TIMEOUT_MS};this.unifiedMemory=d(t),i?.throwIfAborted(),await this.unifiedMemory.initialize({signal:i}),i?.throwIfAborted(),this.cleanupInterval=setInterval(()=>this.cleanup(),this.config.cleanupInterval),this.cleanupInterval.unref&&this.cleanupInterval.unref(),this.initialized=!0,console.log(`[HybridBackend] Initialized with unified memory: ${this.unifiedMemory.getDbPath()}`)}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.initialized=!1}async set(e,i,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;await this.unifiedMemory.kvSet(e,i,n,t?.ttl)}async get(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvGet(e,t)}async delete(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace,n=await this.unifiedMemory.kvDelete(e,t),a=await this.unifiedMemory.vectorDelete(e);return n||a}async has(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvExists(e,t)}async search(e,i=100,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvSearch(e,n,i)}async vectorSearch(e,i,t){return this.ensureInitialized(),(await this.unifiedMemory.vectorSearch(e,i,void 0,t)).map(a=>({key:a.id,score:a.score,metadata:a.metadata}))}getVectorSearchProvenance(){return this.ensureInitialized(),this.unifiedMemory.getVectorSearchProvenance()}async storeVector(e,i,t){this.ensureInitialized(),await this.unifiedMemory.vectorStore(e,i,this.config.defaultNamespace,t)}getHealth(){return{sqlite:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",sqlitePersistent:!0,agentdb:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",fallback:"inactive"}}isPersistent(){return this.unifiedMemory?.isInitialized()??!1}getConfig(){return{...this.config}}async setWithBackend(e,i,t,n){await this.set(e,i,n)}async getVectorStats(){if(!this.unifiedMemory?.isInitialized())return null;let e=await this.unifiedMemory.vectorCount(),i=this.unifiedMemory.getStats();return{vectorCount:e,indexSize:i.vectorIndexSize}}getUnifiedMemory(){return this.unifiedMemory}async count(e){return this.ensureInitialized(),this.unifiedMemory.getDatabase().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.16");process.exit(0)}
2
+ import{B as f,t as c,w as d}from"./chunk-MO55CVMT.js";import{a as r,e as p}from"./chunk-CRPIYUTJ.js";import{a as h}from"./chunk-YAPLJR7K.js";import{c as l}from"./chunk-G5RHFBAY.js";f();p();h();import*as m from"path";var u=l.create("hybrid-backend"),s=class{unifiedMemory=null;config;cleanupInterval;cleanupCount=0;initialized=!1;constructor(e){this.config={sqlite:{path:e?.sqlite?.path??".agentic-qe/memory.db",walMode:e?.sqlite?.walMode??!0,poolSize:e?.sqlite?.poolSize??5,busyTimeout:e?.sqlite?.busyTimeout??r.BUSY_TIMEOUT_MS,...e?.sqlite},agentdb:{path:e?.agentdb?.path??".agentic-qe/memory.db",...e?.agentdb},enableFallback:e?.enableFallback??!0,defaultNamespace:e?.defaultNamespace??"default",cleanupInterval:e?.cleanupInterval??r.CLEANUP_INTERVAL_MS}}async initialize(e){if(this.initialized)return;let i=e?.signal;i?.throwIfAborted();let t={dbPath:this.config.sqlite.path??c.dbPath,walMode:this.config.sqlite.walMode??!0,busyTimeout:this.config.sqlite.busyTimeout??r.BUSY_TIMEOUT_MS};this.unifiedMemory=d(t),i?.throwIfAborted(),await this.unifiedMemory.initialize({signal:i}),i?.throwIfAborted(),this.cleanupInterval=setInterval(()=>this.cleanup(),this.config.cleanupInterval),this.cleanupInterval.unref&&this.cleanupInterval.unref(),this.initialized=!0,console.log(`[HybridBackend] Initialized with unified memory: ${this.unifiedMemory.getDbPath()}`)}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.initialized=!1}async set(e,i,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;await this.unifiedMemory.kvSet(e,i,n,t?.ttl)}async get(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvGet(e,t)}async delete(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace,n=await this.unifiedMemory.kvDelete(e,t),a=await this.unifiedMemory.vectorDelete(e);return n||a}async has(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvExists(e,t)}async search(e,i=100,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvSearch(e,n,i)}async vectorSearch(e,i,t){return this.ensureInitialized(),(await this.unifiedMemory.vectorSearch(e,i,void 0,t)).map(a=>({key:a.id,score:a.score,metadata:a.metadata}))}getVectorSearchProvenance(){return this.ensureInitialized(),this.unifiedMemory.getVectorSearchProvenance()}async storeVector(e,i,t){this.ensureInitialized(),await this.unifiedMemory.vectorStore(e,i,this.config.defaultNamespace,t)}getHealth(){return{sqlite:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",sqlitePersistent:!0,agentdb:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",fallback:"inactive"}}isPersistent(){return this.unifiedMemory?.isInitialized()??!1}getConfig(){return{...this.config}}async setWithBackend(e,i,t,n){await this.set(e,i,n)}async getVectorStats(){if(!this.unifiedMemory?.isInitialized())return null;let e=await this.unifiedMemory.vectorCount(),i=this.unifiedMemory.getStats();return{vectorCount:e,indexSize:i.vectorIndexSize}}getUnifiedMemory(){return this.unifiedMemory}async count(e){return this.ensureInitialized(),this.unifiedMemory.getDatabase().prepare(`
3
3
  SELECT COUNT(*) as count FROM kv_store
4
4
  WHERE namespace LIKE ?
5
5
  AND (expires_at IS NULL OR expires_at > ?)
@@ -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.15");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.16");process.exit(0)}
2
2
  var i=class r{constructor(e){this._value=e;if(!e||e.trim()==="")throw new Error("FilePath cannot be empty")}_value;get value(){return this._value}get extension(){let e=this._value.split(".");return e.length>1?e[e.length-1]:""}get directory(){let e=this._value.lastIndexOf("/");return e>0?this._value.substring(0,e):""}get filename(){let e=this._value.lastIndexOf("/");return e>=0?this._value.substring(e+1):this._value}equals(e){return this._value===e._value}static create(e){return new r(e)}};var s=class r{constructor(e){this._value=e;if(e<0||e>1)throw new Error("RiskScore must be between 0 and 1")}_value;get value(){return this._value}get percentage(){return this._value*100}get level(){return this._value>=.8?"critical":this._value>=.6?"high":this._value>=.3?"medium":"low"}isHigherThan(e){return this._value>e._value}equals(e){return this._value===e._value}static create(e){return new r(e)}static fromPercentage(e){return new r(e/100)}},u=class r{constructor(e,t){this._start=e;this._end=t;if(e>t)throw new Error("Start date cannot be after end date")}_start;_end;get start(){return this._start}get end(){return this._end}get durationMs(){return this._end.getTime()-this._start.getTime()}get durationSeconds(){return this.durationMs/1e3}contains(e){return e>=this._start&&e<=this._end}overlaps(e){return this._start<=e._end&&e._start<=this._end}equals(e){return this._start.getTime()===e._start.getTime()&&this._end.getTime()===e._end.getTime()}static create(e,t){return new r(e,t)}static lastNDays(e){let t=new Date,n=new Date(t.getTime()-e*24*60*60*1e3);return new r(n,t)}},o=class r{constructor(e,t,n,a){this._major=e;this._minor=t;this._patch=n;this._prerelease=a}_major;_minor;_patch;_prerelease;get major(){return this._major}get minor(){return this._minor}get patch(){return this._patch}get prerelease(){return this._prerelease}toString(){let e=`${this._major}.${this._minor}.${this._patch}`;return this._prerelease?`${e}-${this._prerelease}`:e}isNewerThan(e){return this._major!==e._major?this._major>e._major:this._minor!==e._minor?this._minor>e._minor:this._patch>e._patch}equals(e){return this._major===e._major&&this._minor===e._minor&&this._patch===e._patch&&this._prerelease===e._prerelease}static create(e,t,n,a){return new r(e,t,n,a)}static parse(e){let t=e.match(/^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/);if(!t)throw new Error(`Invalid version format: ${e}`);return new r(parseInt(t[1]),parseInt(t[2]),parseInt(t[3]),t[4])}};export{i as a,s as b,u as c,o as d};