agentic-qe 3.15.16 → 3.15.17

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 (415) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +78 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/cli/bundle.js +6 -6
  5. package/dist/cli/chunks/adapter-OMILP6KH.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-45NWEKVS.js → agent-booster-wasm-6BUOFQZA.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-LVHMYFEF.js → agent-handler-HPDK3JI3.js} +2 -2
  8. package/dist/cli/chunks/{agent-memory-branch-YDWOJFEQ.js → agent-memory-branch-5QKUTWK5.js} +2 -2
  9. package/dist/cli/chunks/aqe-learning-engine-OXH5CCOS.js +2 -0
  10. package/dist/cli/chunks/{arena-CZKHXDDS.js → arena-7OKPMNHD.js} +2 -2
  11. package/dist/cli/chunks/{arena-ELDZH3CZ.js → arena-HZ35LESR.js} +4 -4
  12. package/dist/cli/chunks/{audit-5MT4T47Z.js → audit-XI575SVK.js} +3 -3
  13. package/dist/cli/chunks/base-MAK2BLTG.js +2 -0
  14. package/dist/cli/chunks/{better-sqlite3-6TGYPC2B.js → better-sqlite3-YO5X7ZJS.js} +2 -2
  15. package/dist/cli/chunks/{brain-handler-HQWZFO52.js → brain-handler-GCQZFZGQ.js} +3 -3
  16. package/dist/cli/chunks/{branch-enumerator-WVILM4SO.js → branch-enumerator-N6G44UU2.js} +2 -2
  17. package/dist/cli/chunks/{browser-RX5ALU3H.js → browser-EVKPTLOI.js} +2 -2
  18. package/dist/cli/chunks/browser-workflow-IR3VF2TL.js +2 -0
  19. package/dist/cli/chunks/{chunk-F742SZAX.js → chunk-2EQK7B5L.js} +2 -2
  20. package/dist/cli/chunks/{chunk-5NNNEWLS.js → chunk-2PCEMDIX.js} +67 -65
  21. package/dist/cli/chunks/{chunk-FBDVGRSC.js → chunk-2UUZCQSD.js} +7 -7
  22. package/dist/cli/chunks/{chunk-AG2EWGXS.js → chunk-2YWYW7NU.js} +2 -2
  23. package/dist/cli/chunks/{chunk-4LQFBY5L.js → chunk-45223KK6.js} +3 -3
  24. package/dist/cli/chunks/chunk-4EJLHNER.js +12 -0
  25. package/dist/cli/chunks/{chunk-KQYJ4VQ5.js → chunk-4L6WX5KC.js} +1 -1
  26. package/dist/cli/chunks/{chunk-KVF4NXGQ.js → chunk-4NKZU2JZ.js} +2 -2
  27. package/dist/cli/chunks/{chunk-YRAX7SFJ.js → chunk-4UKTIQDT.js} +2 -2
  28. package/dist/cli/chunks/{chunk-YTHTQPWR.js → chunk-4YM45Z5B.js} +1 -1
  29. package/dist/cli/chunks/{chunk-XIIQ5QTT.js → chunk-5FSPELOG.js} +2 -2
  30. package/dist/cli/chunks/{chunk-LKTTUHLF.js → chunk-5WATBVU6.js} +2 -2
  31. package/dist/cli/chunks/{chunk-SR52XP5F.js → chunk-5WYZVSL2.js} +1 -1
  32. package/dist/cli/chunks/{chunk-GQ6TUIKY.js → chunk-6LSZCEW2.js} +1 -1
  33. package/dist/cli/chunks/{chunk-NDJ7P2EP.js → chunk-6V6BD6PH.js} +1 -1
  34. package/dist/cli/chunks/{chunk-63GMRQ25.js → chunk-74MDUIAZ.js} +1 -1
  35. package/dist/cli/chunks/{chunk-4D4DENG6.js → chunk-776K4ZLE.js} +2 -2
  36. package/dist/cli/chunks/{chunk-ZJH5MU2I.js → chunk-7BSOO3CY.js} +2 -2
  37. package/dist/cli/chunks/{chunk-IOQ6ZQ5W.js → chunk-7SNSI4VY.js} +1 -1
  38. package/dist/cli/chunks/{chunk-LRSX2FJM.js → chunk-A4BVDYIL.js} +1 -1
  39. package/dist/cli/chunks/{chunk-SASBO5Y5.js → chunk-AGCS5GSO.js} +2 -2
  40. package/dist/cli/chunks/{chunk-GAHNO6JJ.js → chunk-AVHYJ3XP.js} +2 -2
  41. package/dist/cli/chunks/{chunk-CGGUM2YJ.js → chunk-BE7ZHM34.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7TE5ONQQ.js → chunk-BHQ2DLJU.js} +1 -1
  43. package/dist/cli/chunks/{chunk-IESR7TNB.js → chunk-BKHEQIRZ.js} +2 -2
  44. package/dist/cli/chunks/{chunk-J4ELZNLY.js → chunk-BSIWI4ES.js} +2 -2
  45. package/dist/cli/chunks/{chunk-NVEWF4JV.js → chunk-C7QLLMYI.js} +1 -1
  46. package/dist/cli/chunks/{chunk-V5NHZV7S.js → chunk-CMN7PU2H.js} +2 -2
  47. package/dist/cli/chunks/{chunk-PPUZWYUG.js → chunk-COTQ44YO.js} +2 -2
  48. package/dist/cli/chunks/{chunk-5V3TI2LG.js → chunk-CQER6IJ5.js} +1 -1
  49. package/dist/cli/chunks/{chunk-SI6DPU5D.js → chunk-CVPXHDQU.js} +1 -1
  50. package/dist/cli/chunks/{chunk-6ZBXSOX6.js → chunk-CVYPMGUM.js} +2 -2
  51. package/dist/cli/chunks/{chunk-DXD6K2ZP.js → chunk-CXCMATZ6.js} +2 -2
  52. package/dist/cli/chunks/{chunk-PF7RBAYL.js → chunk-D75GLKEL.js} +2 -2
  53. package/dist/cli/chunks/chunk-DCDSN67A.js +2 -0
  54. package/dist/cli/chunks/{chunk-MAFQV4U4.js → chunk-DHKSPOUQ.js} +2 -2
  55. package/dist/cli/chunks/{chunk-RJIEG3NA.js → chunk-DJDVD6RM.js} +2 -2
  56. package/dist/cli/chunks/{chunk-GFWHUQSF.js → chunk-DNVRTJKB.js} +2 -2
  57. package/dist/cli/chunks/{chunk-G5RHFBAY.js → chunk-DS5IFRY6.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BEKDKVQT.js → chunk-E7XIMOKW.js} +2 -2
  59. package/dist/cli/chunks/{chunk-5JZRZI4S.js → chunk-ECKHDHR2.js} +2 -2
  60. package/dist/cli/chunks/chunk-EPVPXHL7.js +2 -0
  61. package/dist/cli/chunks/{chunk-HVRRLYX6.js → chunk-ERYADKMZ.js} +2 -2
  62. package/dist/cli/chunks/{chunk-SUDMM5SO.js → chunk-EUWG2JG4.js} +2 -2
  63. package/dist/cli/chunks/{chunk-VSIKHWZ4.js → chunk-FAQ24UHB.js} +3 -3
  64. package/dist/cli/chunks/{chunk-YNMJEDN5.js → chunk-FBBPRVNF.js} +2 -2
  65. package/dist/cli/chunks/{chunk-72XSEQMW.js → chunk-FBSBXCZS.js} +2 -2
  66. package/dist/cli/chunks/{chunk-J7I6PABJ.js → chunk-G2X3OLMN.js} +2 -2
  67. package/dist/cli/chunks/{chunk-YU2BDRSD.js → chunk-GG7PMTHD.js} +1 -1
  68. package/dist/cli/chunks/{chunk-HLUXXCHF.js → chunk-GN6OE3JT.js} +1 -1
  69. package/dist/cli/chunks/{chunk-AGRV5B3T.js → chunk-GPPTRKEM.js} +2 -2
  70. package/dist/cli/chunks/{chunk-ZQ2XW3IP.js → chunk-H2LHWZRE.js} +2 -2
  71. package/dist/cli/chunks/{chunk-6DPYNAOK.js → chunk-HAQJFUAQ.js} +2 -2
  72. package/dist/cli/chunks/{chunk-SSUAAX3F.js → chunk-HD6W6PHV.js} +2 -2
  73. package/dist/cli/chunks/{chunk-L2DWPVNJ.js → chunk-HFZD5KLR.js} +1 -1
  74. package/dist/cli/chunks/{chunk-QVDCVD5D.js → chunk-HRUHHHVR.js} +2 -2
  75. package/dist/cli/chunks/{chunk-PINSJCM3.js → chunk-HVT7RMGV.js} +1 -1
  76. package/dist/cli/chunks/chunk-HWQPMUSN.js +2 -0
  77. package/dist/cli/chunks/{chunk-4NFQLP6R.js → chunk-HZ5O7G2P.js} +1 -1
  78. package/dist/cli/chunks/{chunk-C6D5AHBO.js → chunk-IHQGNDMX.js} +2 -2
  79. package/dist/cli/chunks/{chunk-QQWBWEJS.js → chunk-IJSROBM6.js} +3 -3
  80. package/dist/cli/chunks/{chunk-OCV2XEWQ.js → chunk-IJZFJPHS.js} +2 -2
  81. package/dist/cli/chunks/{chunk-N7HL5PHH.js → chunk-IKB3M7OF.js} +1 -1
  82. package/dist/cli/chunks/{chunk-24OX5TQJ.js → chunk-INI3Q4CN.js} +1 -1
  83. package/dist/cli/chunks/{chunk-SJ6Y4725.js → chunk-IOWEBPXJ.js} +2 -2
  84. package/dist/cli/chunks/{chunk-VXFLJNCA.js → chunk-IQL6XRF5.js} +2 -2
  85. package/dist/cli/chunks/{chunk-WP4RETKG.js → chunk-IRHXGCQR.js} +2 -2
  86. package/dist/cli/chunks/{chunk-63ZKI4PX.js → chunk-J3QFJI2Y.js} +2 -2
  87. package/dist/cli/chunks/{chunk-UHEOGZLX.js → chunk-J6QRNQJF.js} +5 -5
  88. package/dist/cli/chunks/{chunk-KNSRL6NO.js → chunk-J7Q5TXFZ.js} +2 -2
  89. package/dist/cli/chunks/{chunk-L6QSTQME.js → chunk-JHKKIJT2.js} +2 -2
  90. package/dist/cli/chunks/{chunk-VMDFFTCK.js → chunk-JI33PMPZ.js} +1 -1
  91. package/dist/cli/chunks/{chunk-E3D4GPLP.js → chunk-JRIJM4LE.js} +3 -3
  92. package/dist/cli/chunks/{chunk-XIQW7EFL.js → chunk-JVWZAE2H.js} +2 -2
  93. package/dist/cli/chunks/{chunk-YPBSUGMI.js → chunk-K7WAI662.js} +1 -1
  94. package/dist/cli/chunks/{chunk-RV74I3YO.js → chunk-KB34MTFZ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-MI5MFHRA.js → chunk-KPIPVSIP.js} +2 -2
  96. package/dist/cli/chunks/{chunk-Y4PFUMOU.js → chunk-KR2TAAF6.js} +1 -1
  97. package/dist/cli/chunks/{chunk-W5HQUIML.js → chunk-KT2QCXO6.js} +2 -2
  98. package/dist/cli/chunks/{chunk-SSYAQZXA.js → chunk-KTORRIX3.js} +2 -2
  99. package/dist/cli/chunks/{chunk-CRPIYUTJ.js → chunk-LCWEQRZI.js} +2 -2
  100. package/dist/cli/chunks/{chunk-NO3IV5Q5.js → chunk-LG5PPJT7.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5VZL4UVN.js → chunk-LIF6UWHV.js} +2 -2
  102. package/dist/cli/chunks/{chunk-32BPDLRZ.js → chunk-LN7NKE3N.js} +2 -2
  103. package/dist/cli/chunks/{chunk-ZB3LEFYG.js → chunk-LOLSZG5J.js} +2 -2
  104. package/dist/cli/chunks/{chunk-6XXZDV2C.js → chunk-LOMT4UC2.js} +2 -2
  105. package/dist/cli/chunks/{chunk-JDIYMZCQ.js → chunk-LRKLATSH.js} +2 -2
  106. package/dist/cli/chunks/{chunk-5SPCGMBB.js → chunk-LRY6UIRI.js} +2 -2
  107. package/dist/cli/chunks/{chunk-5PBLPQ5T.js → chunk-LV7UIK4Q.js} +2 -2
  108. package/dist/cli/chunks/{chunk-FDDC72IA.js → chunk-M2YI5YUR.js} +2 -2
  109. package/dist/cli/chunks/{chunk-D6COXLYE.js → chunk-MCXW3DKE.js} +2 -2
  110. package/dist/cli/chunks/{chunk-J442IZLE.js → chunk-MGZ6XZHU.js} +1 -1
  111. package/dist/cli/chunks/{chunk-TIUKLYAI.js → chunk-MLMD3I75.js} +1 -1
  112. package/dist/cli/chunks/{chunk-PHT5N7SC.js → chunk-MVVVGQJ6.js} +2 -2
  113. package/dist/cli/chunks/{chunk-525CFDUE.js → chunk-ND72UDVH.js} +2 -2
  114. package/dist/cli/chunks/{chunk-XWUWX7BV.js → chunk-NE3LRUNC.js} +4 -4
  115. package/dist/cli/chunks/{chunk-DTMAS2GB.js → chunk-NKUHMA4T.js} +2 -2
  116. package/dist/cli/chunks/{chunk-QPEOLAAS.js → chunk-NQFDJ6BT.js} +1 -1
  117. package/dist/cli/chunks/{chunk-MO55CVMT.js → chunk-NZJVDOUN.js} +14 -14
  118. package/dist/cli/chunks/{chunk-NZU4ACBZ.js → chunk-O7VJ3VKD.js} +2 -2
  119. package/dist/cli/chunks/{chunk-32GN3JKR.js → chunk-OJIUIEI4.js} +1 -1
  120. package/dist/cli/chunks/{chunk-UNGBRZDK.js → chunk-OO2M2QUV.js} +3 -3
  121. package/dist/cli/chunks/{chunk-CJSHWQXP.js → chunk-ORQ2YBRR.js} +2 -2
  122. package/dist/cli/chunks/chunk-OWIQR6N2.js +4 -0
  123. package/dist/cli/chunks/{chunk-NAEWCFQT.js → chunk-OWIZBZLN.js} +2 -2
  124. package/dist/cli/chunks/{chunk-24QHCVX6.js → chunk-P3D7SEHW.js} +1 -1
  125. package/dist/cli/chunks/{chunk-YLMNVLDK.js → chunk-P4OB6WDJ.js} +1 -1
  126. package/dist/cli/chunks/{chunk-PEQDY4BO.js → chunk-PCL5JRKN.js} +2 -2
  127. package/dist/cli/chunks/{chunk-IUBJVHNB.js → chunk-PIWGKGWP.js} +2 -2
  128. package/dist/cli/chunks/{chunk-GJYHWYXR.js → chunk-PK34KJH7.js} +2 -2
  129. package/dist/cli/chunks/{chunk-5B5QPCNU.js → chunk-POPSZDI2.js} +4 -4
  130. package/dist/cli/chunks/{chunk-HCH4Y6XX.js → chunk-Q6F3DYZN.js} +2 -2
  131. package/dist/cli/chunks/{chunk-SHKOCGNK.js → chunk-QJSSUBO3.js} +2 -2
  132. package/dist/cli/chunks/{chunk-DVYHMDFR.js → chunk-QN7HP2UW.js} +421 -418
  133. package/dist/cli/chunks/{chunk-ZFL436FN.js → chunk-QSQNXBD2.js} +2 -2
  134. package/dist/cli/chunks/{chunk-TVGI32MB.js → chunk-QTQDX4TZ.js} +3 -3
  135. package/dist/cli/chunks/{chunk-EK7OLYOZ.js → chunk-R3KBOQ3O.js} +2 -2
  136. package/dist/cli/chunks/{chunk-LE4QJREF.js → chunk-REY52O7J.js} +1 -1
  137. package/dist/cli/chunks/{chunk-LQLPB2T6.js → chunk-RKCN4B26.js} +2 -2
  138. package/dist/cli/chunks/{chunk-ZR2TKVXQ.js → chunk-S3DT5TPR.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6ICX3FEG.js → chunk-S3TBOKAZ.js} +22 -22
  140. package/dist/cli/chunks/{chunk-JHQCRRJI.js → chunk-SAEECT23.js} +2 -2
  141. package/dist/cli/chunks/{chunk-VWPM27GU.js → chunk-SAZ4PJBR.js} +2 -2
  142. package/dist/cli/chunks/{chunk-KPRCB5LT.js → chunk-SFITYZLV.js} +2 -2
  143. package/dist/cli/chunks/{chunk-5LAVKGLH.js → chunk-SRBCBVSI.js} +2 -2
  144. package/dist/cli/chunks/{chunk-O5W3FIO6.js → chunk-SUAZ5Z47.js} +2 -2
  145. package/dist/cli/chunks/{chunk-KU2AUFGX.js → chunk-TDZ6N43D.js} +2 -2
  146. package/dist/cli/chunks/{chunk-YAPLJR7K.js → chunk-TIVKDIF7.js} +2 -2
  147. package/dist/cli/chunks/{chunk-U2A7NHZA.js → chunk-TM75GAXG.js} +2 -2
  148. package/dist/cli/chunks/{chunk-A5GBXCP5.js → chunk-TWBZONKT.js} +2 -2
  149. package/dist/cli/chunks/{chunk-I7MQIM2U.js → chunk-U4S74IIZ.js} +1 -1
  150. package/dist/cli/chunks/{chunk-3HD7E6HN.js → chunk-U5SMBJ6F.js} +2 -2
  151. package/dist/cli/chunks/{chunk-JQ3DYUMS.js → chunk-UHJVZEQA.js} +2 -2
  152. package/dist/cli/chunks/{chunk-C5FP5GW3.js → chunk-UOVCTK5L.js} +2 -2
  153. package/dist/cli/chunks/{chunk-HJ6ZGVTB.js → chunk-VDEKVIP5.js} +2 -2
  154. package/dist/cli/chunks/{chunk-KXCLACFG.js → chunk-VITV7AEC.js} +2 -2
  155. package/dist/cli/chunks/{chunk-P3EYRILV.js → chunk-VKREKVFI.js} +2 -2
  156. package/dist/cli/chunks/{chunk-2H4XH6FT.js → chunk-VLTDW7XJ.js} +2 -2
  157. package/dist/cli/chunks/{chunk-MD43XRX5.js → chunk-VQFV2IPV.js} +1 -1
  158. package/dist/cli/chunks/{chunk-67Z5R7RJ.js → chunk-VYPVU3JF.js} +2 -2
  159. package/dist/cli/chunks/{chunk-SDLWKRVL.js → chunk-WAOEQA3W.js} +2 -2
  160. package/dist/cli/chunks/{chunk-IOYG4VFL.js → chunk-WBDWHHKP.js} +2 -2
  161. package/dist/cli/chunks/{chunk-ASEOFRIG.js → chunk-WX4PO65Q.js} +2 -2
  162. package/dist/cli/chunks/chunk-X2DWHGCC.js +6 -0
  163. package/dist/cli/chunks/{chunk-CEYSYSK5.js → chunk-X5QD76IU.js} +2 -2
  164. package/dist/cli/chunks/{chunk-GSKMOPL7.js → chunk-XBTGEYED.js} +2 -2
  165. package/dist/cli/chunks/{chunk-FL64OUBA.js → chunk-XEMCHGAJ.js} +2 -2
  166. package/dist/cli/chunks/{chunk-2YZ4G6NW.js → chunk-XEYFZLIT.js} +1 -1
  167. package/dist/cli/chunks/{chunk-EA4YQVKS.js → chunk-XFTX3KLE.js} +1 -1
  168. package/dist/cli/chunks/{chunk-HGWXF45W.js → chunk-XPTCQKVE.js} +1 -1
  169. package/dist/cli/chunks/{chunk-CAKMOVZ6.js → chunk-YAJOBZE5.js} +2 -2
  170. package/dist/cli/chunks/{chunk-NQXXI77K.js → chunk-YCVLKU6H.js} +2 -2
  171. package/dist/cli/chunks/{chunk-AR67RJPY.js → chunk-YD2C6EPN.js} +2 -2
  172. package/dist/cli/chunks/{chunk-S75SOOZL.js → chunk-YKRLUTK7.js} +2 -2
  173. package/dist/cli/chunks/{chunk-IOKYCMTJ.js → chunk-YMUY3TES.js} +2 -2
  174. package/dist/cli/chunks/{chunk-5QO3R3TU.js → chunk-YR5QBUHZ.js} +2 -2
  175. package/dist/cli/chunks/{chunk-AJMJNQMP.js → chunk-Z7SKUC6P.js} +1 -1
  176. package/dist/cli/chunks/{chunk-KITOPKRG.js → chunk-ZAQMRFBB.js} +2 -2
  177. package/dist/cli/chunks/{chunk-AAMLQ2LF.js → chunk-ZC3KDNJW.js} +3 -3
  178. package/dist/cli/chunks/{chunk-VJCIEHEF.js → chunk-ZGV7L4MW.js} +1 -1
  179. package/dist/cli/chunks/{chunk-BY5OF7OH.js → chunk-ZN35XSKF.js} +2 -2
  180. package/dist/cli/chunks/{chunk-KKU2QGSJ.js → chunk-ZNXM6WVL.js} +2 -2
  181. package/dist/cli/chunks/{chunk-FLNAW7C4.js → chunk-ZP5AWQRO.js} +2 -2
  182. package/dist/cli/chunks/{chunk-IHRXZZQM.js → chunk-ZTP3DQ5M.js} +1 -1
  183. package/dist/cli/chunks/{chunk-OAEE6JWQ.js → chunk-ZVMSSCTH.js} +2 -2
  184. package/dist/cli/chunks/{chunk-M7WJCTG3.js → chunk-ZWUF27P4.js} +2 -2
  185. package/dist/cli/chunks/{ci-MFUR4CWV.js → ci-3RTTTS2D.js} +2 -2
  186. package/dist/cli/chunks/{ci-config-PNDLQ6XV.js → ci-config-XRUR3I4K.js} +2 -2
  187. package/dist/cli/chunks/{ci-output-PFZ4M7NC.js → ci-output-E5IAMU2U.js} +2 -2
  188. package/dist/cli/chunks/{circuit-breaker-5HH6NLZN.js → circuit-breaker-SHR2P44P.js} +2 -2
  189. package/dist/cli/chunks/{claude-flow-setup-QCKYLGLC.js → claude-flow-setup-ZDDILFMF.js} +2 -2
  190. package/dist/cli/chunks/client-NO5FOWT4.js +2 -0
  191. package/dist/cli/chunks/{cline-installer-EASVPFXR.js → cline-installer-BGYVUM6G.js} +2 -2
  192. package/dist/cli/chunks/{code-UJXDVYRK.js → code-PJ4MC3MC.js} +3 -3
  193. package/dist/cli/chunks/{code-index-extractor-BZJ3UDP4.js → code-index-extractor-IW2P22YG.js} +2 -2
  194. package/dist/cli/chunks/{codex-installer-XSQZUVOZ.js → codex-installer-A7WZ6OGL.js} +2 -2
  195. package/dist/cli/chunks/{completions-OWOOJFI2.js → completions-KS23WD5J.js} +2 -2
  196. package/dist/cli/chunks/{complexity-analyzer-KP5TOHDT.js → complexity-analyzer-Q7GLSR2E.js} +2 -2
  197. package/dist/cli/chunks/{continuedev-installer-IFKQXLHM.js → continuedev-installer-SK55BFW2.js} +2 -2
  198. package/dist/cli/chunks/copilot-installer-3N5J3WTM.js +3 -0
  199. package/dist/cli/chunks/core-handlers-JNAZPXE2.js +2 -0
  200. package/dist/cli/chunks/{cost-tracker-MMDDNKZB.js → cost-tracker-NENVSO4A.js} +2 -2
  201. package/dist/cli/chunks/{coverage-LUH2B7NT.js → coverage-5L7UQWDH.js} +3 -3
  202. package/dist/cli/chunks/cross-domain-router-HEBM767Z.js +2 -0
  203. package/dist/cli/chunks/{cursor-installer-4YLM5GWM.js → cursor-installer-XXBO2ZE6.js} +2 -2
  204. package/dist/cli/chunks/{daemon-MZKVM4CJ.js → daemon-CDCQU3LR.js} +3 -3
  205. package/dist/cli/chunks/{daemon-CAVZ7OFV.js → daemon-JEBJGEUK.js} +4 -4
  206. package/dist/cli/chunks/{dag-attention-scheduler-X4CYW665.js → dag-attention-scheduler-HOMMF7FA.js} +2 -2
  207. package/dist/cli/chunks/{detect-7BM2XINO.js → detect-FXCOUG6X.js} +2 -2
  208. package/dist/cli/chunks/{dist-node-Y5APLEYB.js → dist-node-GXQ7FMTY.js} +2 -2
  209. package/dist/cli/chunks/{domain-handler-X3ZRJNAH.js → domain-handler-TI3JBAPC.js} +2 -2
  210. package/dist/cli/chunks/{domain-plugins-2UW5KQJB.js → domain-plugins-R7LTUM32.js} +2 -2
  211. package/dist/cli/chunks/{domain-transfer-35W4CIBV.js → domain-transfer-LBIAFHIQ.js} +2 -2
  212. package/dist/cli/chunks/dream-GQDCEJMS.js +2 -0
  213. package/dist/cli/chunks/embed-and-insert-pattern-33KLHDD5.js +3 -0
  214. package/dist/cli/chunks/{embedding-space-SBM2MZD2.js → embedding-space-HHLWTBF5.js} +2 -2
  215. package/dist/cli/chunks/{eval-4QA2SROK.js → eval-KDOZMAXJ.js} +2 -2
  216. package/dist/cli/chunks/{experience-capture-middleware-Z6BF6KYM.js → experience-capture-middleware-X45PECQN.js} +3 -3
  217. package/dist/cli/chunks/{fast-paths-FIORX6GN.js → fast-paths-462V6UUB.js} +2 -2
  218. package/dist/cli/chunks/{feature-flags-ZOO7LMIC.js → feature-flags-G66OT3AS.js} +2 -2
  219. package/dist/cli/chunks/{feature-flags-6LYI2T4G.js → feature-flags-NIRQ4YDM.js} +2 -2
  220. package/dist/cli/chunks/file-discovery-33USPLB5.js +2 -0
  221. package/dist/cli/chunks/{fleet-7WF53H4F.js → fleet-PXWGB7CU.js} +3 -3
  222. package/dist/cli/chunks/{gnn-wrapper-KJ6B7BRM.js → gnn-wrapper-7MUW3M5M.js} +2 -2
  223. package/dist/cli/chunks/{heartbeat-handler-DEKKMOVW.js → heartbeat-handler-5237PB35.js} +4 -4
  224. package/dist/cli/chunks/heartbeat-scheduler-LIXLC5IH.js +2 -0
  225. package/dist/cli/chunks/hnsw-adapter-62D5UH27.js +2 -0
  226. package/dist/cli/chunks/hnsw-index-GSGUMQQC.js +2 -0
  227. package/dist/cli/chunks/{hnsw-legacy-bridge-L27WS27N.js → hnsw-legacy-bridge-OSQPW7JP.js} +2 -2
  228. package/dist/cli/chunks/{hnswlib-node-4YOQC6L4.js → hnswlib-node-GX6WG2GB.js} +2 -2
  229. package/dist/cli/chunks/{hooks-TAOKV4EJ.js → hooks-GUWHL7VC.js} +10 -10
  230. package/dist/cli/chunks/hybrid-backend-FRWP4BOY.js +2 -0
  231. package/dist/cli/chunks/{hypergraph-engine-BODRJLHL.js → hypergraph-engine-SRWLLCU3.js} +2 -2
  232. package/dist/cli/chunks/{hypergraph-handler-RKMYJNTU.js → hypergraph-handler-AVOPRHHO.js} +3 -3
  233. package/dist/cli/chunks/impact-analyzer-7KF3AQXV.js +2 -0
  234. package/dist/cli/chunks/{init-guard-MXHSLSB2.js → init-guard-P4N6EVZS.js} +2 -2
  235. package/dist/cli/chunks/{init-handler-HUE57IFW.js → init-handler-LRGWOJMD.js} +6 -6
  236. package/dist/cli/chunks/init-wizard-XWWAXY25.js +2 -0
  237. package/dist/cli/chunks/kernel-ZEJPNDBW.js +2 -0
  238. package/dist/cli/chunks/{kilocode-installer-S333IKYQ.js → kilocode-installer-7R2EPOQ6.js} +2 -2
  239. package/dist/cli/chunks/{kiro-installer-WM5DLQWC.js → kiro-installer-QNM7DPOB.js} +2 -2
  240. package/dist/cli/chunks/knowledge-graph-RRZQS7KY.js +2 -0
  241. package/dist/cli/chunks/{learning-LNHMQLH5.js → learning-7OIZBPXZ.js} +3 -3
  242. package/dist/cli/chunks/{llm-router-EWFXYZZR.js → llm-router-SIDXES23.js} +4 -4
  243. package/dist/cli/chunks/llm-router-service-3OSW67LC.js +2 -0
  244. package/dist/cli/chunks/{load-FGYGWVDK.js → load-EI2E2C3S.js} +2 -2
  245. package/dist/cli/chunks/load-test-7TRIH2WJ.js +2 -0
  246. package/dist/cli/chunks/{mcp-2FHNAAOM.js → mcp-IOE5WOCS.js} +2 -2
  247. package/dist/cli/chunks/{memory-DZMQ73AB.js → memory-DLYGJAP7.js} +5 -5
  248. package/dist/cli/chunks/memory-backend-G7ZW6Q2B.js +2 -0
  249. package/dist/cli/chunks/memory-handlers-TPF3KCO5.js +2 -0
  250. package/dist/cli/chunks/{multi-model-executor-6F2UAEUW.js → multi-model-executor-WHH4YCHM.js} +2 -2
  251. package/dist/cli/chunks/{opencode-installer-XY3BGOTZ.js → opencode-installer-63FDZAMS.js} +2 -2
  252. package/dist/cli/chunks/{orchestrator-B4CNKUOS.js → orchestrator-3LA776KK.js} +5 -5
  253. package/dist/cli/chunks/pattern-null-store-OU3ZC3NR.js +2 -0
  254. package/dist/cli/chunks/{pattern-usage-recorder-R4GUFNMD.js → pattern-usage-recorder-NW54QUGI.js} +2 -2
  255. package/dist/cli/chunks/{pipeline-FG5RKVRO.js → pipeline-P3TYX6J6.js} +2 -2
  256. package/dist/cli/chunks/{platform-3BT4KEVJ.js → platform-FNA2WLI6.js} +2 -2
  257. package/dist/cli/chunks/{plugin-WI4RIN7O.js → plugin-NJS7BC2S.js} +2 -2
  258. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7ECDNQFS.js → prime-radiant-advanced-wasm-NIAVL2OT.js} +2 -2
  259. package/dist/cli/chunks/project-root-GMOFJEKD.js +2 -0
  260. package/dist/cli/chunks/protocol-executor-AD345XRO.js +2 -0
  261. package/dist/cli/chunks/{protocol-handler-WNODKPGW.js → protocol-handler-JU5C4JHY.js} +2 -2
  262. package/dist/cli/chunks/{prove-5RHAEPYZ.js → prove-35VOSLYP.js} +2 -2
  263. package/dist/cli/chunks/qe-reasoning-bank-NLTP26RC.js +2 -0
  264. package/dist/cli/chunks/{quality-WPHR7BGQ.js → quality-ET74X7HN.js} +2 -2
  265. package/dist/cli/chunks/{quality-gate-4RKTEZMX.js → quality-gate-FEDQISNB.js} +3 -3
  266. package/dist/cli/chunks/queen-coordinator-2TB4FWS6.js +2 -0
  267. package/dist/cli/chunks/real-embeddings-II6CXTCI.js +2 -0
  268. package/dist/cli/chunks/{ref-validation-TPAWHOHH.js → ref-validation-DTBPYCEB.js} +2 -2
  269. package/dist/cli/chunks/{roocode-installer-7AVHFNDI.js → roocode-installer-LYQEMR4J.js} +2 -2
  270. package/dist/cli/chunks/router-PLM3MWME.js +2 -0
  271. package/dist/cli/chunks/routing-feedback-I7VOX2HU.js +2 -0
  272. package/dist/cli/chunks/{routing-handler-YKEDVJSH.js → routing-handler-DJOJFPII.js} +2 -2
  273. package/dist/cli/chunks/{ruvector-commands-JUAMM354.js → ruvector-commands-VXYGJDPW.js} +2 -2
  274. package/dist/cli/chunks/rvf-dual-writer-GQZHFWO2.js +2 -0
  275. package/dist/cli/chunks/rvf-migration-adapter-3TVKBCAM.js +2 -0
  276. package/dist/cli/chunks/rvf-migration-coordinator-XUHKLMT6.js +2 -0
  277. package/dist/cli/chunks/rvf-native-adapter-5GUTYOWS.js +2 -0
  278. package/dist/cli/chunks/{rvf-store-integrity-VJDUIRTX.js → rvf-store-integrity-GA2ZYOEG.js} +2 -2
  279. package/dist/cli/chunks/safe-db-RZPQGLGQ.js +2 -0
  280. package/dist/cli/chunks/schedule-G7JMQDUX.js +2 -0
  281. package/dist/cli/chunks/scheduler-4SEGPCKD.js +2 -0
  282. package/dist/cli/chunks/{security-ORDN3RD2.js → security-MM6YOECX.js} +3 -3
  283. package/dist/cli/chunks/{shared-rvf-adapter-CF4BCIO7.js → shared-rvf-adapter-6AHPA3V5.js} +2 -2
  284. package/dist/cli/chunks/{shared-rvf-dual-writer-C32UBR6D.js → shared-rvf-dual-writer-EYAVY2GZ.js} +2 -2
  285. package/dist/cli/chunks/sqlite-persistence-IVE4SQXR.js +2 -0
  286. package/dist/cli/chunks/{standalone-memory-OXRJYZXN.js → standalone-memory-A3PLB4CZ.js} +2 -2
  287. package/dist/cli/chunks/{status-handler-BCX5D4HY.js → status-handler-OSSFAP4Z.js} +2 -2
  288. package/dist/cli/chunks/{structural-health-LFG7RUU6.js → structural-health-PGY5XUNO.js} +2 -2
  289. package/dist/cli/chunks/{sync-YJEE2K2L.js → sync-CWEHYGNN.js} +2 -2
  290. package/dist/cli/chunks/sync-PM6D7EQF.js +2 -0
  291. package/dist/cli/chunks/{task-handler-6LXKPTXJ.js → task-handler-LHMQ75W4.js} +2 -2
  292. package/dist/cli/chunks/{task-handlers-CILP36I7.js → task-handlers-S2TX5FTR.js} +3 -3
  293. package/dist/cli/chunks/test-4EGZZ6NJ.js +34 -0
  294. package/dist/cli/chunks/test-runner-process-72YACW6M.js +2 -0
  295. package/dist/cli/chunks/{test-scheduling-ISI2O4Q5.js → test-scheduling-YJQHH3XE.js} +3 -3
  296. package/dist/cli/chunks/{token-bootstrap-VUELSBOS.js → token-bootstrap-DJNETMVW.js} +2 -2
  297. package/dist/cli/chunks/{token-usage-XOC5KG7S.js → token-usage-WPNOJR6H.js} +2 -2
  298. package/dist/cli/chunks/{transformers-LSLQAARK.js → transformers-4MRPXCPU.js} +2 -2
  299. package/dist/cli/chunks/tree-sitter-wasm-parser-UVWSDXFR.js +2 -0
  300. package/dist/cli/chunks/{types-5BLCGLCR.js → types-6P5FB4EB.js} +2 -2
  301. package/dist/cli/chunks/unified-memory-2VMGSGQL.js +2 -0
  302. package/dist/cli/chunks/unified-memory-hnsw-3KULVD3N.js +2 -0
  303. package/dist/cli/chunks/unified-persistence-QCSLU2SV.js +2 -0
  304. package/dist/cli/chunks/{upgrade-RQJYLK3J.js → upgrade-4ICTN63Y.js} +2 -2
  305. package/dist/cli/chunks/{validate-QBHWXXCK.js → validate-HQF5GZ7L.js} +2 -2
  306. package/dist/cli/chunks/{validate-swarm-IKXBKFB5.js → validate-swarm-45JYG7VW.js} +2 -2
  307. package/dist/cli/chunks/visual-security-ZYP2KPH7.js +2 -0
  308. package/dist/cli/chunks/{web-tree-sitter-ZF6FIE5R.js → web-tree-sitter-UOTWZLNH.js} +2 -2
  309. package/dist/cli/chunks/{windsurf-installer-HQGDZT5D.js → windsurf-installer-WDWSBXGN.js} +2 -2
  310. package/dist/cli/chunks/witness-chain-5QRT7EMX.js +2 -0
  311. package/dist/cli/chunks/{witness-chain-DCHCAMSQ.js → witness-chain-DOYMNPC7.js} +2 -2
  312. package/dist/cli/chunks/{witness-chain-repair-PUX2NFDL.js → witness-chain-repair-CUF2AFQB.js} +2 -2
  313. package/dist/cli/chunks/{witness-chain-verifier-PX2OQ6XT.js → witness-chain-verifier-JB42X62J.js} +2 -2
  314. package/dist/cli/chunks/{witness-key-manager-RXYQNFJB.js → witness-key-manager-LXXO6L2G.js} +2 -2
  315. package/dist/cli/chunks/{workflow-FBKCA4H6.js → workflow-6ARK47NF.js} +4 -4
  316. package/dist/cli/chunks/workflow-orchestrator-RYDDWIXN.js +2 -0
  317. package/dist/cli/chunks/{wrappers-TWSKBTWD.js → wrappers-CYQBOMPL.js} +2 -2
  318. package/dist/cli/commands/test.js +26 -4
  319. package/dist/coordination/handlers/test-execution-handlers.js +64 -20
  320. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +8 -3
  321. package/dist/domains/code-intelligence/services/semantic-analyzer.js +39 -25
  322. package/dist/domains/code-intelligence/services/text-relevance.d.ts +32 -0
  323. package/dist/domains/code-intelligence/services/text-relevance.js +63 -0
  324. package/dist/domains/test-execution/coordinator.d.ts +3 -1
  325. package/dist/domains/test-execution/coordinator.js +13 -4
  326. package/dist/domains/test-execution/interfaces.d.ts +5 -0
  327. package/dist/domains/test-execution/plugin.js +2 -0
  328. package/dist/domains/test-execution/services/flaky-detector.d.ts +9 -1
  329. package/dist/domains/test-execution/services/flaky-detector.js +26 -8
  330. package/dist/domains/test-execution/services/retry-handler.d.ts +7 -1
  331. package/dist/domains/test-execution/services/retry-handler.js +44 -5
  332. package/dist/domains/test-execution/services/runner-test-cases.d.ts +2 -0
  333. package/dist/domains/test-execution/services/runner-test-cases.js +7 -3
  334. package/dist/domains/test-execution/services/test-executor.d.ts +5 -1
  335. package/dist/domains/test-execution/services/test-executor.js +79 -15
  336. package/dist/init/copilot-installer.d.ts +6 -0
  337. package/dist/init/copilot-installer.js +37 -17
  338. package/dist/init/platform-config-generator.d.ts +10 -0
  339. package/dist/init/platform-config-generator.js +26 -1
  340. package/dist/kernel/unified-memory.d.ts +8 -0
  341. package/dist/kernel/unified-memory.js +13 -0
  342. package/dist/learning/embedder-endpoint-client.d.ts +45 -0
  343. package/dist/learning/embedder-endpoint-client.js +98 -3
  344. package/dist/learning/embedding-space-registry.d.ts +75 -0
  345. package/dist/learning/embedding-space-registry.js +142 -0
  346. package/dist/learning/real-embeddings.d.ts +3 -0
  347. package/dist/learning/real-embeddings.js +49 -11
  348. package/dist/mcp/bundle.js +564 -555
  349. package/dist/mcp/protocol-server.js +1 -1
  350. package/dist/shared/embeddings/index.d.ts +2 -2
  351. package/dist/shared/embeddings/index.js +1 -1
  352. package/dist/shared/embeddings/nomic-embedder.d.ts +8 -2
  353. package/dist/shared/embeddings/nomic-embedder.js +19 -11
  354. package/dist/shared/embeddings/ollama-client.d.ts +28 -2
  355. package/dist/shared/embeddings/ollama-client.js +84 -22
  356. package/dist/shared/embeddings/types.d.ts +15 -0
  357. package/dist/shared/embeddings/types.js +4 -0
  358. package/dist/shared/pytest-junit-report.d.ts +93 -0
  359. package/dist/shared/pytest-junit-report.js +241 -0
  360. package/dist/shared/test-runner-project.d.ts +51 -1
  361. package/dist/shared/test-runner-project.js +140 -25
  362. package/package.json +1 -1
  363. package/dist/cli/chunks/adapter-6CQ2PIP5.js +0 -2
  364. package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +0 -2
  365. package/dist/cli/chunks/base-SMCMMVGP.js +0 -2
  366. package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +0 -2
  367. package/dist/cli/chunks/chunk-EGYE5UPQ.js +0 -2
  368. package/dist/cli/chunks/chunk-KL7OKSU2.js +0 -4
  369. package/dist/cli/chunks/chunk-M4FRQ4TE.js +0 -12
  370. package/dist/cli/chunks/chunk-UE5ZOZR2.js +0 -2
  371. package/dist/cli/chunks/client-MHQRTZM4.js +0 -2
  372. package/dist/cli/chunks/copilot-installer-IGJ6KGQY.js +0 -3
  373. package/dist/cli/chunks/core-handlers-UAK3LLJE.js +0 -2
  374. package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +0 -2
  375. package/dist/cli/chunks/dream-EJY24JN6.js +0 -2
  376. package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +0 -3
  377. package/dist/cli/chunks/file-discovery-UZSFSS4V.js +0 -2
  378. package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +0 -2
  379. package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +0 -2
  380. package/dist/cli/chunks/hnsw-index-POCPMVJH.js +0 -2
  381. package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +0 -2
  382. package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +0 -2
  383. package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +0 -2
  384. package/dist/cli/chunks/kernel-CCDWT7KS.js +0 -2
  385. package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +0 -2
  386. package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +0 -2
  387. package/dist/cli/chunks/load-test-UNZUWY3F.js +0 -2
  388. package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +0 -2
  389. package/dist/cli/chunks/memory-handlers-MP426XRJ.js +0 -2
  390. package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +0 -2
  391. package/dist/cli/chunks/project-root-BEANNYWU.js +0 -2
  392. package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +0 -2
  393. package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +0 -2
  394. package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +0 -2
  395. package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +0 -2
  396. package/dist/cli/chunks/router-EP34O3KB.js +0 -2
  397. package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +0 -2
  398. package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +0 -2
  399. package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +0 -2
  400. package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +0 -2
  401. package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +0 -2
  402. package/dist/cli/chunks/safe-db-TCAU4FUT.js +0 -2
  403. package/dist/cli/chunks/schedule-NB5KV435.js +0 -2
  404. package/dist/cli/chunks/scheduler-JKXGKVK6.js +0 -2
  405. package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +0 -2
  406. package/dist/cli/chunks/sync-OSF7C2NL.js +0 -2
  407. package/dist/cli/chunks/test-SD457QJ6.js +0 -34
  408. package/dist/cli/chunks/test-runner-process-VKD65QQU.js +0 -2
  409. package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +0 -2
  410. package/dist/cli/chunks/unified-memory-GI76TXFV.js +0 -2
  411. package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +0 -2
  412. package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +0 -2
  413. package/dist/cli/chunks/visual-security-GZ2MOKWB.js +0 -2
  414. package/dist/cli/chunks/witness-chain-P3XXXA62.js +0 -2
  415. package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +0 -2
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
- import{a as e,b as g,e as t}from"./chunk-G5RHFBAY.js";import{d as r}from"./chunk-XIIQ5QTT.js";import{b as o}from"./chunk-AJMJNQMP.js";var L=o(()=>{"use strict";e();g();t();r()});export{L as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{a as e,b as g,e as t}from"./chunk-DS5IFRY6.js";import{d as r}from"./chunk-5FSPELOG.js";import{b as o}from"./chunk-Z7SKUC6P.js";var L=o(()=>{"use strict";e();g();t();r()});export{L as a};
@@ -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.16");process.exit(0)}
2
- import{b as S}from"./chunk-AJMJNQMP.js";import{createHash as C}from"crypto";import*as a from"fs";import*as c from"os";import*as n from"path";function P(t){try{return a.realpathSync.native(t)}catch{return t}}function i(){let t="",r="";try{t=c.tmpdir()}catch{}try{r=c.homedir()}catch{}return{platform:process.platform,tmpdir:t,homedir:r,env:process.env,realpath:P}}function m(t){return t==="win32"?n.win32:n.posix}function l(t,r=i()){let e=m(r.platform),o=e.resolve(r.realpath(e.resolve(t))),s=e.parse(o).root.length;for(;o.length>s&&/[\\/]$/.test(o);)o=o.slice(0,-1);return r.platform==="win32"?o.toLowerCase():o}function w(t,r=i()){let e=m(r.platform),o=l(t,r);if(r.tmpdir&&o===l(r.tmpdir,r))return!0;if(r.platform==="win32")return o===e.parse(o).root.toLowerCase();let s=e.resolve(t);return y.some(p=>p===s||l(p,r)===o)}function b(t,r=i()){if(r.platform==="win32")return!1;try{return(a.statSync(t).mode&514)===514}catch{return!1}}function k(t,r=i()){return w(t,r)||b(t,r)}function A(t=i()){let r=m(t.platform),e;if(t.platform==="win32")e=t.env.LOCALAPPDATA||r.join(t.homedir,"AppData","Local");else if(t.platform==="darwin")e=r.join(t.homedir,"Library","Caches");else{let o=t.env.XDG_CACHE_HOME;e=o&&r.isAbsolute(o)?o:r.join(t.homedir,".cache")}return r.join(e,"agentic-qe","scratch")}function E(t,r=i()){let e=C("sha256").update(l(t,r)).digest("hex").slice(0,16);return m(r.platform).join(A(r),e)}function u(t){a.mkdirSync(t,{recursive:!0,mode:448}),process.platform!=="win32"&&a.chmodSync(t,448)}function R(t,r=i()){let e=E(t,r);try{return u(e),d(e,t),e}catch(o){let s=typeof process.getuid=="function"?String(process.getuid()):"user",p=n.join(r.tmpdir||c.tmpdir(),`agentic-qe-scratch-${s}`),f=n.join(p,n.basename(e));try{return u(p),u(f),d(f,t),f}catch(v){let g=h=>h instanceof Error?h.message:String(h);throw new Error(`Cannot create a private AQE scratch root for "${t}". User cache "${e}" failed: ${g(o)}. Temporary fallback "${f}" failed: ${g(v)}. Set AQE_PROJECT_ROOT to a project directory or make the user cache writable.`)}}}function d(t,r){let e=n.join(t,"SCRATCH_ROOT_FOR");try{a.existsSync(e)||a.writeFileSync(e,`${n.resolve(r)}
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{b as S}from"./chunk-Z7SKUC6P.js";import{createHash as C}from"crypto";import*as a from"fs";import*as c from"os";import*as n from"path";function P(t){try{return a.realpathSync.native(t)}catch{return t}}function i(){let t="",r="";try{t=c.tmpdir()}catch{}try{r=c.homedir()}catch{}return{platform:process.platform,tmpdir:t,homedir:r,env:process.env,realpath:P}}function m(t){return t==="win32"?n.win32:n.posix}function l(t,r=i()){let e=m(r.platform),o=e.resolve(r.realpath(e.resolve(t))),s=e.parse(o).root.length;for(;o.length>s&&/[\\/]$/.test(o);)o=o.slice(0,-1);return r.platform==="win32"?o.toLowerCase():o}function w(t,r=i()){let e=m(r.platform),o=l(t,r);if(r.tmpdir&&o===l(r.tmpdir,r))return!0;if(r.platform==="win32")return o===e.parse(o).root.toLowerCase();let s=e.resolve(t);return y.some(p=>p===s||l(p,r)===o)}function b(t,r=i()){if(r.platform==="win32")return!1;try{return(a.statSync(t).mode&514)===514}catch{return!1}}function k(t,r=i()){return w(t,r)||b(t,r)}function A(t=i()){let r=m(t.platform),e;if(t.platform==="win32")e=t.env.LOCALAPPDATA||r.join(t.homedir,"AppData","Local");else if(t.platform==="darwin")e=r.join(t.homedir,"Library","Caches");else{let o=t.env.XDG_CACHE_HOME;e=o&&r.isAbsolute(o)?o:r.join(t.homedir,".cache")}return r.join(e,"agentic-qe","scratch")}function E(t,r=i()){let e=C("sha256").update(l(t,r)).digest("hex").slice(0,16);return m(r.platform).join(A(r),e)}function u(t){a.mkdirSync(t,{recursive:!0,mode:448}),process.platform!=="win32"&&a.chmodSync(t,448)}function R(t,r=i()){let e=E(t,r);try{return u(e),d(e,t),e}catch(o){let s=typeof process.getuid=="function"?String(process.getuid()):"user",p=n.join(r.tmpdir||c.tmpdir(),`agentic-qe-scratch-${s}`),f=n.join(p,n.basename(e));try{return u(p),u(f),d(f,t),f}catch(v){let g=h=>h instanceof Error?h.message:String(h);throw new Error(`Cannot create a private AQE scratch root for "${t}". User cache "${e}" failed: ${g(o)}. Temporary fallback "${f}" failed: ${g(v)}. Set AQE_PROJECT_ROOT to a project directory or make the user cache writable.`)}}}function d(t,r){let e=n.join(t,"SCRATCH_ROOT_FOR");try{a.existsSync(e)||a.writeFileSync(e,`${n.resolve(r)}
3
3
  `,{mode:384})}catch{}}var y,O=S(()=>{"use strict";y=["/","/tmp","/var/tmp","/usr/tmp","/dev/shm","/run/shm","/private","/private/tmp","/private/var","/private/var/tmp","/var","/usr","/etc","/opt","/srv","/mnt","/media","/run","/home","/Users","/Volumes"]});export{w as a,b,k as c,E as d,R as e,O 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.16");process.exit(0)}
2
- import{b as _}from"./chunk-AJMJNQMP.js";function p(e){return g.has(e)}function m(e){return l.has(e)}function b(e){return/^qe-security|^qe-pentest/.test(e)}function E(e,t="strict"){if(t==="off")return{text:e,redactions:[],replacementCount:0};let r=e,n=new Set,c=0;for(let a of d){if(!a.modes.includes(t))continue;let i=new RegExp(a.regex.source,a.regex.flags),s=r.match(i);s&&s.length>0&&(n.add(a.category),c+=s.length,r=r.replace(i,a.replacement))}return{text:r,redactions:Array.from(n).sort(),replacementCount:c}}function y(e,t,r){if(b(e)&&!m(t))throw new o(`Security agent "${e}" may only use providers: ${[...l].join(", ")}. Got: "${t}". OpenRouter is excluded (third-party proxy risk).`,6);if(r==="off"&&!p(t))throw new o(`Redaction mode "off" is only allowed for self-hosted providers (${[...g].join(", ")}). Got: "${t}".`,6)}var d,g,l,o,A=_(()=>{"use strict";d=[{category:"aws_key",regex:/\b(AKIA[0-9A-Z]{16})\b/g,replacement:"<REDACTED:aws_key>",modes:["strict","balanced"]},{category:"env_value",regex:/^([A-Z][A-Z0-9_]{2,})=(.+)$/gm,replacement:"$1=<REDACTED:env_value>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(Authorization:\s*(?:Bearer|Token)\s+)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(x-api-key:\s*)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"private_key",regex:/-----BEGIN\s[\w\s]*PRIVATE KEY-----(?:[\s\S]*?-----END\s[\w\s]*PRIVATE KEY-----|[\s\S]*)/g,replacement:"<REDACTED:private_key>",modes:["strict","balanced"]},{category:"jwt",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,replacement:"<REDACTED:jwt>",modes:["strict","balanced"]},{category:"github_token",regex:/\b(ghp_|gho_|ghs_|ghr_|github_pat_)[A-Za-z0-9_]{16,}\b/g,replacement:"<REDACTED:github_token>",modes:["strict","balanced"]},{category:"gitlab_token",regex:/\b(glpat-)[A-Za-z0-9_-]{20,}\b/g,replacement:"<REDACTED:gitlab_token>",modes:["strict","balanced"]},{category:"slack_token",regex:/\b(xoxb-|xoxp-|xoxs-|xoxa-)[A-Za-z0-9-]{10,}\b/g,replacement:"<REDACTED:slack_token>",modes:["strict","balanced"]},{category:"huggingface_token",regex:/\bhf_[A-Za-z0-9]{30,}\b/g,replacement:"<REDACTED:huggingface_token>",modes:["strict","balanced"]},{category:"npm_token",regex:/\bnpm_[A-Za-z0-9]{36,}\b/g,replacement:"<REDACTED:npm_token>",modes:["strict","balanced"]},{category:"cognitum_key",regex:/\bcog_[A-Za-z0-9-]{20,}(?!\w)/g,replacement:"<REDACTED:cognitum_key>",modes:["strict","balanced"]},{category:"stripe_key",regex:/\b(sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_)[A-Za-z0-9]{10,}\b/g,replacement:"<REDACTED:stripe_key>",modes:["strict","balanced"]},{category:"google_api_key",regex:/\bAIzaSy[A-Za-z0-9_-]{33}\b/g,replacement:"<REDACTED:google_api_key>",modes:["strict","balanced"]},{category:"aws_session_token",regex:/\bASIA[0-9A-Z]{16}\b/g,replacement:"<REDACTED:aws_session_token>",modes:["strict","balanced"]},{category:"connection_string",regex:/\b(mongodb(\+srv)?|postgres(ql)?|mysql|redis|amqp):\/\/[^\s"']+/gi,replacement:"<REDACTED:connection_string>",modes:["strict","balanced"]},{category:"generic_secret",regex:/\b(password|secret|token|apikey|api_key|access_key|secret_key)\s*[:=]\s*['"]?(?!ghp_|gho_|ghs_|ghr_|github_pat_|glpat-|xoxb-|xoxp-|xoxs-|xoxa-|sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_|AIzaSy|AKIA|ASIA|<REDACTED:)[^\s'"]{8,}['"]?/gi,replacement:"<REDACTED:generic_secret>",modes:["strict","balanced"]},{category:"email",regex:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,replacement:"<REDACTED:pii_email>",modes:["strict"]},{category:"phone",regex:/\b(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g,replacement:"<REDACTED:pii_phone>",modes:["strict"]},{category:"ssn",regex:/\b\d{3}-\d{2}-\d{4}\b/g,replacement:"<REDACTED:pii_ssn>",modes:["strict"]}],g=new Set(["ollama"]),l=new Set(["claude","ollama"]);o=class extends Error{constructor(r,n){super(r);this.exitCode=n;this.name="AdvisorRedactionError"}exitCode}});export{p as a,E as b,y as c,A as d};
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.17");process.exit(0)}
2
+ import{b as _}from"./chunk-Z7SKUC6P.js";function p(e){return g.has(e)}function m(e){return l.has(e)}function b(e){return/^qe-security|^qe-pentest/.test(e)}function E(e,t="strict"){if(t==="off")return{text:e,redactions:[],replacementCount:0};let r=e,n=new Set,c=0;for(let a of d){if(!a.modes.includes(t))continue;let i=new RegExp(a.regex.source,a.regex.flags),s=r.match(i);s&&s.length>0&&(n.add(a.category),c+=s.length,r=r.replace(i,a.replacement))}return{text:r,redactions:Array.from(n).sort(),replacementCount:c}}function y(e,t,r){if(b(e)&&!m(t))throw new o(`Security agent "${e}" may only use providers: ${[...l].join(", ")}. Got: "${t}". OpenRouter is excluded (third-party proxy risk).`,6);if(r==="off"&&!p(t))throw new o(`Redaction mode "off" is only allowed for self-hosted providers (${[...g].join(", ")}). Got: "${t}".`,6)}var d,g,l,o,A=_(()=>{"use strict";d=[{category:"aws_key",regex:/\b(AKIA[0-9A-Z]{16})\b/g,replacement:"<REDACTED:aws_key>",modes:["strict","balanced"]},{category:"env_value",regex:/^([A-Z][A-Z0-9_]{2,})=(.+)$/gm,replacement:"$1=<REDACTED:env_value>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(Authorization:\s*(?:Bearer|Token)\s+)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(x-api-key:\s*)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"private_key",regex:/-----BEGIN\s[\w\s]*PRIVATE KEY-----(?:[\s\S]*?-----END\s[\w\s]*PRIVATE KEY-----|[\s\S]*)/g,replacement:"<REDACTED:private_key>",modes:["strict","balanced"]},{category:"jwt",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,replacement:"<REDACTED:jwt>",modes:["strict","balanced"]},{category:"github_token",regex:/\b(ghp_|gho_|ghs_|ghr_|github_pat_)[A-Za-z0-9_]{16,}\b/g,replacement:"<REDACTED:github_token>",modes:["strict","balanced"]},{category:"gitlab_token",regex:/\b(glpat-)[A-Za-z0-9_-]{20,}\b/g,replacement:"<REDACTED:gitlab_token>",modes:["strict","balanced"]},{category:"slack_token",regex:/\b(xoxb-|xoxp-|xoxs-|xoxa-)[A-Za-z0-9-]{10,}\b/g,replacement:"<REDACTED:slack_token>",modes:["strict","balanced"]},{category:"huggingface_token",regex:/\bhf_[A-Za-z0-9]{30,}\b/g,replacement:"<REDACTED:huggingface_token>",modes:["strict","balanced"]},{category:"npm_token",regex:/\bnpm_[A-Za-z0-9]{36,}\b/g,replacement:"<REDACTED:npm_token>",modes:["strict","balanced"]},{category:"cognitum_key",regex:/\bcog_[A-Za-z0-9-]{20,}(?!\w)/g,replacement:"<REDACTED:cognitum_key>",modes:["strict","balanced"]},{category:"stripe_key",regex:/\b(sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_)[A-Za-z0-9]{10,}\b/g,replacement:"<REDACTED:stripe_key>",modes:["strict","balanced"]},{category:"google_api_key",regex:/\bAIzaSy[A-Za-z0-9_-]{33}\b/g,replacement:"<REDACTED:google_api_key>",modes:["strict","balanced"]},{category:"aws_session_token",regex:/\bASIA[0-9A-Z]{16}\b/g,replacement:"<REDACTED:aws_session_token>",modes:["strict","balanced"]},{category:"connection_string",regex:/\b(mongodb(\+srv)?|postgres(ql)?|mysql|redis|amqp):\/\/[^\s"']+/gi,replacement:"<REDACTED:connection_string>",modes:["strict","balanced"]},{category:"generic_secret",regex:/\b(password|secret|token|apikey|api_key|access_key|secret_key)\s*[:=]\s*['"]?(?!ghp_|gho_|ghs_|ghr_|github_pat_|glpat-|xoxb-|xoxp-|xoxs-|xoxa-|sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_|AIzaSy|AKIA|ASIA|<REDACTED:)[^\s'"]{8,}['"]?/gi,replacement:"<REDACTED:generic_secret>",modes:["strict","balanced"]},{category:"email",regex:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,replacement:"<REDACTED:pii_email>",modes:["strict"]},{category:"phone",regex:/\b(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g,replacement:"<REDACTED:pii_phone>",modes:["strict"]},{category:"ssn",regex:/\b\d{3}-\d{2}-\d{4}\b/g,replacement:"<REDACTED:pii_ssn>",modes:["strict"]}],g=new Set(["ollama"]),l=new Set(["claude","ollama"]);o=class extends Error{constructor(r,n){super(r);this.exitCode=n;this.name="AdvisorRedactionError"}exitCode}});export{p as a,E as b,y as c,A as d};
@@ -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.16");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.17");process.exit(0)}
2
2
  import{existsSync as o,openSync as d,readSync as f,closeSync as p,renameSync as S,unlinkSync as l}from"fs";var b="FLVR",c=4,g=["",".idmap.json",".manifest.json",".space.json"];function m(n,e){let r;try{r=d(n,"r");let t=Buffer.alloc(e);return f(r,t,0,e,0)<e?null:t}catch{return null}finally{if(r!==void 0)try{p(r)}catch{}}}function a(n){try{return process.kill(n,0),!0}catch(e){return e.code==="EPERM"}}function i(n){let e=m(`${n}.lock`,c+4);if(!e||e.subarray(0,4).toString("latin1")!==b)return null;let r=e.readUInt32LE(c);return r>0?r:null}function k(n){let e=i(n);return e===null?!1:a(e)}function E(n){let e=n instanceof Error?n.message:String(n);return e.includes("LockHeld")||e.includes("0x0300")}function y(n){let e=n instanceof Error?n.message:String(n);return/ManifestNotFound|InvalidMagic|ChecksumMismatch|CorruptStore/i.test(e)}function L(n){let e=i(n);if(e===null||a(e))return!1;try{return i(n)!==e?!1:(l(`${n}.lock`),!0)}catch{return!1}}function x(n,e,r){if(!o(n)||!y(r))return null;if(k(n))return console.warn(`[RVF] ${n} is unusable but its lock is held by a live process \u2014 leaving it alone and degrading to SQLite for this run.`),null;let t=`${n}.corrupt-${process.pid}`;for(let s of g){let u=`${n}${s}`;if(o(u))try{S(u,`${t}${s}`)}catch{}}try{o(`${n}.lock`)&&l(`${n}.lock`)}catch{}return console.warn(`[RVF] Quarantined unusable store ${n} \u2192 ${t} (${e}). It is a derived cache and will be rebuilt from the unified DB. Please report a recurrence with the quarantined files (issue #563).`),t}export{i as a,k as b,E as c,y as d,L as e,x 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.16");process.exit(0)}
2
- import{b as t}from"./chunk-AJMJNQMP.js";import{randomInt as o}from"node:crypto";function a(){return Math.random()}function m(n,e){return o(n,e)}function c(n,e){return n+Math.random()*(e-n)}var r=t(()=>{"use strict"});export{a,m as b,c,r as d};
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.17");process.exit(0)}
2
+ import{b as t}from"./chunk-Z7SKUC6P.js";import{randomInt as o}from"node:crypto";function a(){return Math.random()}function m(n,e){return o(n,e)}function c(n,e){return n+Math.random()*(e-n)}var r=t(()=>{"use strict"});export{a,m as b,c,r as d};
@@ -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.16");process.exit(0)}
2
- import{a as c,e as h}from"./chunk-CRPIYUTJ.js";import{a as l,d}from"./chunk-FLNAW7C4.js";d();h();var u=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),c.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*c.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r?.namespace),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r?.namespace);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=c.DEFAULT_SEARCH_LIMIT,e){let s=t.replace(/[.+^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${s.replace(/\*/g,".*").replace(/\?/g,".")}$`,"su"),i=[],o=e?.namespace?`${e.namespace}:`:void 0;for(let a of this.store.keys()){if(o&&!a.startsWith(o))continue;let p=o?a.slice(o.length):a;if(n.test(p)&&(i.push(a),i.length>=r))break}return i}async vectorSearch(t,r,e){let s=[];for(let[n,i]of this.vectors.entries()){if(e&&!n.startsWith(e))continue;let o=l(t,i.embedding);s.push({key:n,score:o,metadata:i.metadata})}return s.sort((n,i)=>i.score-n.score).slice(0,r)}getVectorSearchProvenance(){return{backend:"in-memory",indexType:"flat",approximate:!1,estimatedRecall:1}}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{u as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{a as c,e as h}from"./chunk-LCWEQRZI.js";import{a as l,d}from"./chunk-ZP5AWQRO.js";d();h();var u=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),c.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*c.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r?.namespace),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r?.namespace);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=c.DEFAULT_SEARCH_LIMIT,e){let s=t.replace(/[.+^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${s.replace(/\*/g,".*").replace(/\?/g,".")}$`,"su"),i=[],o=e?.namespace?`${e.namespace}:`:void 0;for(let a of this.store.keys()){if(o&&!a.startsWith(o))continue;let p=o?a.slice(o.length):a;if(n.test(p)&&(i.push(a),i.length>=r))break}return i}async vectorSearch(t,r,e){let s=[];for(let[n,i]of this.vectors.entries()){if(e&&!n.startsWith(e))continue;let o=l(t,i.embedding);s.push({key:n,score:o,metadata:i.metadata})}return s.sort((n,i)=>i.score-n.score).slice(0,r)}getVectorSearchProvenance(){return{backend:"in-memory",indexType:"flat",approximate:!1,estimatedRecall:1}}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{u as a};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
- import{a as O,b as j}from"./chunk-W5HQUIML.js";import{d as A,e as G}from"./chunk-HCH4Y6XX.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-ZJH5MU2I.js";import{b as S,e as z}from"./chunk-KNSRL6NO.js";import{b as g}from"./chunk-AJMJNQMP.js";import{createRequire as k}from"node:module";import{existsSync as W}from"node:fs";import{dirname as K,join as V}from"node:path";function B(i,e){return A(i,e,{cwd:process.cwd(),timeout:5e3})}function X(i=process.platform,e=process.execPath,t=W){return O("npm",i,e,t)??["npm",[]]}async function F(){try{return x.resolve("vibium")}catch{try{return k(V(process.cwd(),"package.json")).resolve("vibium")}catch{}let[i,e]=X(),t=(await B(i,[...e,"root","-g"])).trim();return x.resolve(V(t,"vibium"))}}function Y(i){return typeof i?.browser?.start=="function"?i:typeof i?.default?.browser?.start=="function"?i.default:null}async function _(){let i;try{i=await import("vibium")}catch(t){if(t.code!=="ERR_MODULE_NOT_FOUND"&&t.code!=="MODULE_NOT_FOUND")throw t;let r;try{r=await F()}catch(s){throw new Error(`Vibium is not installed; run ${l}`,{cause:s})}i=x(r)}let e=Y(i);if(!e)throw new Error(`Unsupported Vibium API: the installed package exposes no browser.start() (neither as a named nor a default export); run ${l}`);return e}async function P(){try{let i=V(K(await F()),"..","bin","cli.js");return await B(process.execPath,[i,"is-installed"]),!0}catch{return!1}}var l,x,M=g(()=>{"use strict";j();G();l="aqe init --browser-engine (or npm install vibium@^26.8.21)",x=k(import.meta.url)});var U,$=g(()=>{"use strict";U={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function Q(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return Q(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,m,p,v,b,w,d,f,D=g(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{a as O,b as j}from"./chunk-KT2QCXO6.js";import{d as A,e as G}from"./chunk-Q6F3DYZN.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-7BSOO3CY.js";import{b as S,e as z}from"./chunk-J7Q5TXFZ.js";import{b as g}from"./chunk-Z7SKUC6P.js";import{createRequire as k}from"node:module";import{existsSync as W}from"node:fs";import{dirname as K,join as V}from"node:path";function B(i,e){return A(i,e,{cwd:process.cwd(),timeout:5e3})}function X(i=process.platform,e=process.execPath,t=W){return O("npm",i,e,t)??["npm",[]]}async function F(){try{return x.resolve("vibium")}catch{try{return k(V(process.cwd(),"package.json")).resolve("vibium")}catch{}let[i,e]=X(),t=(await B(i,[...e,"root","-g"])).trim();return x.resolve(V(t,"vibium"))}}function Y(i){return typeof i?.browser?.start=="function"?i:typeof i?.default?.browser?.start=="function"?i.default:null}async function _(){let i;try{i=await import("vibium")}catch(t){if(t.code!=="ERR_MODULE_NOT_FOUND"&&t.code!=="MODULE_NOT_FOUND")throw t;let r;try{r=await F()}catch(s){throw new Error(`Vibium is not installed; run ${l}`,{cause:s})}i=x(r)}let e=Y(i);if(!e)throw new Error(`Unsupported Vibium API: the installed package exposes no browser.start() (neither as a named nor a default export); run ${l}`);return e}async function P(){try{let i=V(K(await F()),"..","bin","cli.js");return await B(process.execPath,[i,"is-installed"]),!0}catch{return!1}}var l,x,M=g(()=>{"use strict";j();G();l="aqe init --browser-engine (or npm install vibium@^26.8.21)",x=k(import.meta.url)});var U,$=g(()=>{"use strict";U={enabled:!0,headless:!0,timeout:3e4,retryAttempts:3,fallbackEnabled:!0,browserType:"chromium",viewport:{width:1280,height:720},userAgent:"",devtools:!1,slowMo:0,screenshotDir:".agentic-qe/screenshots"}});function Q(i){return i instanceof o}function a(i,e="Unknown Vibium error"){return Q(i)?i:i instanceof Error?new o(i.message||e,"UNKNOWN_ERROR",i):new o(typeof i=="string"?i:e,"UNKNOWN_ERROR")}var o,m,p,v,b,w,d,f,D=g(()=>{"use strict";o=class i extends Error{constructor(t,r,s){super(t);this.code=r;this.cause=s;this.name="VibiumError",Error.captureStackTrace&&Error.captureStackTrace(this,i),s?.stack&&(this.stack+=`
3
3
  Caused by: ${s.stack}`)}code;cause},m=class extends o{constructor(e="Vibium MCP server is unavailable",t){super(e,"VIBIUM_UNAVAILABLE",t),this.name="VibiumUnavailableError"}},p=class extends o{constructor(e="Browser operation timed out",t){super(e,"VIBIUM_TIMEOUT",t),this.name="VibiumTimeoutError"}},v=class extends o{selector;constructor(e,t){super(`Element not found: ${e}`,"ELEMENT_NOT_FOUND",t),this.name="VibiumElementNotFoundError",this.selector=e}},b=class extends o{constructor(e="Failed to connect to browser",t){super(e,"CONNECTION_ERROR",t),this.name="VibiumConnectionError"}},w=class extends o{url;statusCode;constructor(e,t,r){let s=t?`Navigation failed: ${e} (HTTP ${t})`:`Navigation failed: ${e}`;super(s,"NAVIGATION_ERROR",r),this.name="VibiumNavigationError",this.url=e,this.statusCode=t}},d=class extends o{constructor(e="Failed to capture screenshot",t){super(e,"SCREENSHOT_ERROR",t),this.name="VibiumScreenshotError"}},f=class extends o{action;selector;constructor(e,t,r){super(`Failed to ${e} element: ${t}`,"INTERACTION_ERROR",r),this.name="VibiumInteractionError",this.action=e,this.selector=t}}});import{randomUUID as Z}from"crypto";async function C(){if(E!==null)return E;try{return E=(await _()).browser,L=!0,E}catch(i){return console.warn("[Vibium] Failed to load vibium package:",i),L=!1,null}}async function H(i,e,t){let r;for(let s=1;s<=e;s++)try{return await i()}catch(n){if(r=S(n),s<e){let u=Math.min(100*Math.pow(2,s-1),2e3);await new Promise(c=>setTimeout(c,u))}}throw new o(`${t} failed after ${e} attempts`,"RETRY_EXHAUSTED",r)}async function h(i,e){let t=Date.now();try{let r=await i();return I()&&console.log(`[Vibium] ${e}: ${Date.now()-t}ms`),r}catch(r){throw I()&&console.log(`[Vibium] ${e} failed: ${Date.now()-t}ms`,r),r}}var E,L,y,q,ee=g(()=>{M();$();D();z();J();E=null,L=!1;y=class{config;currentSession=null;lastHealthCheck=null;_initialized=!1;_available=null;vibeInstance=null;browserInstance=null;constructor(e={}){this.config={...U,...e}}async isAvailable(){if(!this.config.enabled)return!1;if(this._available!==null)return this._available;try{let e=await C();return this._available=e!==null&&await P(),this._available}catch{return this._available=!1,!1}}async getHealth(){let e=new Date;if(!this.config.enabled)return{status:"unavailable",features:["fallback-only"],lastChecked:e,error:"Vibium is disabled by configuration",sessionActive:!1};try{await this.isAvailable()?this.lastHealthCheck={status:this.vibeInstance?"connected":"disconnected",browserType:this.config.browserType,features:["browser-launch","navigation","element-interaction","screenshots","script-evaluation","accessibility-testing"],latencyMs:10,lastChecked:e,sessionActive:this.vibeInstance!==null}:this.lastHealthCheck={status:"unavailable",features:["fallback-only"],lastChecked:e,error:`Vibium runtime or browser payload unavailable; run ${l}`,sessionActive:!1}}catch(t){this.lastHealthCheck={status:"error",features:["fallback-only"],lastChecked:e,error:t instanceof Error?t.message:"Unknown error",sessionActive:!1}}return this.lastHealthCheck}async getSession(){return this.currentSession}async launch(e){if(!T())return{success:!1,error:new m("Browser mode is disabled by feature flags")};let t=async()=>{let r=await C();if(!r)throw new m(`Vibium runtime unavailable; run ${l}`);let s=e?.headless??this.config.headless;if(!await P())throw new m(`Vibium browser payload unavailable; run ${l}`);let n=await r.start({headless:s});try{this.vibeInstance=await n.page(),this.browserInstance=n}catch(c){throw await n.stop(),c}let u={id:this.generateSessionId(),browserType:this.config.browserType,launchedAt:new Date,status:"connected",viewport:e?.viewport??this.config.viewport,headless:s};return this.currentSession=u,u};try{return{success:!0,value:R()?await H(()=>h(t,"browser_launch"),this.config.retryAttempts,"browser_launch"):await h(t,"browser_launch")}}catch(r){return{success:!1,error:a(r,"Failed to launch browser")}}}async quit(){if(!this.vibeInstance)return{success:!1,error:new b("No active browser session")};let e=async()=>{this.vibeInstance&&(await this.browserInstance?.stop(),this.vibeInstance=null,this.browserInstance=null),this.currentSession=null};try{return await h(e,"browser_quit"),{success:!0,value:void 0}}catch(t){return{success:!1,error:a(t,"Failed to quit browser")}}}async navigate(e){this.ensureSession();let t=async()=>{let r=Date.now();await this.vibeInstance.go(e.url);let s="";try{s=await this.vibeInstance.evaluate("document.title")}catch{s="Unknown"}let n={url:e.url,statusCode:200,title:s,durationMs:Date.now()-r,success:!0};return this.currentSession&&(this.currentSession.currentUrl=e.url),n};try{return{success:!0,value:R()?await H(()=>h(t,"page_navigate"),this.config.retryAttempts,"page_navigate"):await h(t,"page_navigate")}}catch(r){return{success:!1,error:new w(e.url,void 0,r instanceof Error?r:void 0)}}}async getPageInfo(){this.ensureSession();try{let e=await this.vibeInstance.evaluate("window.location.href"),t=await this.vibeInstance.evaluate("document.title");return{success:!0,value:{url:e,title:t,viewport:this.config.viewport,loadState:"loaded"}}}catch(e){return{success:!1,error:a(e,"Failed to get page info")}}}async goBack(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.back()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go back")}}}async goForward(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.history.forward()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to go forward")}}}async reload(){this.ensureSession();try{return await this.vibeInstance.evaluate("window.location.reload()"),{success:!0,value:void 0}}catch(e){return{success:!1,error:a(e,"Failed to reload page")}}}async findElement(e){this.ensureSession();try{let t=await this.vibeInstance.find(e.selector,{timeout:e.timeout??this.config.timeout});return{success:!0,value:{selector:e.selector,tagName:t.info.tag,textContent:t.info.text,attributes:{},boundingBox:t.info.box,visible:!0,enabled:!0}}}catch(t){return{success:!1,error:new v(e.selector,t instanceof Error?t:void 0)}}}async findElements(e){this.ensureSession();try{let t=e.selector.replace(/\\/g,"\\\\").replace(/'/g,"\\'");return{success:!0,value:(await this.vibeInstance.evaluate(`
4
4
  Array.from(document.querySelectorAll('${t}'))
5
5
  .map(el => ({
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
- import{l as d}from"./chunk-GAHNO6JJ.js";import{a as u,e as g}from"./chunk-KNSRL6NO.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{l as d}from"./chunk-AVHYJ3XP.js";import{a as u,e as g}from"./chunk-J7Q5TXFZ.js";g();var m=[{type:"email",pattern:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,mask:n=>n[0]+"***@"+n.split("@")[1]},{type:"ssn",pattern:/\b\d{3}-\d{2}-\d{4}\b/g,mask:()=>"***-**-****"},{type:"credit-card",pattern:/\b(?:\d[ -]*?){13,19}\b/g,mask:n=>"****-****-****-"+n.replace(/\D/g,"").slice(-4)},{type:"phone",pattern:/\b(?:\+?1[-.\s]?)?(?:\(?\d{3}\)?[-.\s]?)?\d{3}[-.\s]?\d{4}\b/g,mask:n=>n.slice(0,3)+"***"+n.slice(-2)},{type:"api-key",pattern:/(?:key|token|api_key|apikey|secret|password|passwd|auth)=([A-Za-z0-9_\-]{16,})/gi,mask:()=>"***REDACTED***"}],y=class extends d{config={name:"qe/security/url-validate",description:"Validate URL security: checks for XSS/injection patterns, unsafe protocols, and scans URL query parameters for PII exposure (emails, SSNs, credit cards, API keys).",domain:"security-compliance",schema:this.buildSchema()};buildSchema(){return{type:"object",properties:{url:{type:"string",description:"URL to validate for security threats and PII exposure"},enablePII:{type:"boolean",description:"Enable PII exposure scanning in URL and query parameters",default:!0}},required:["url"]}}async execute(s,r){try{let e=this.validateURLSecurity(s.url),t=s.enablePII!==!1?this.scanForPII(s.url):{scanned:!1,found:!1,types:[],details:[]},c=e.issues.length+(t.found?t.types.length:0)===0?`URL passed all checks (security: clean, PII: ${t.scanned?"none found":"not scanned"})`:`URL has ${e.issues.length} security issue(s)${t.found?` and ${t.types.length} PII type(s) exposed in URL`:""}`;return{success:!0,data:{url:s.url,urlSecurity:e,piiExposure:t,summary:c}}}catch(e){return{success:!1,error:u(e)}}}validateURLSecurity(s){let r=[],e="none";try{let t=new URL(s);["http:","https:"].includes(t.protocol)||(r.push({type:"unsafe-protocol",description:`Protocol ${t.protocol} is not allowed`,severity:"high"}),e="high");let o=[/<script/i,/javascript:/i,/on\w+=/i,/data:text\/html/i];for(let i of o)if(i.test(s)){r.push({type:"xss",description:"Potential XSS pattern detected in URL",severity:"critical"}),e="critical";break}let c=[/'.*or.*'/i,/union.*select/i,/drop.*table/i,/;\s*--/i];for(let i of c)if(i.test(s)){r.push({type:"sql-injection",description:"Potential SQL injection pattern detected in URL",severity:"critical"}),e="critical";break}/\.\.[/\\]/.test(s)&&(r.push({type:"path-traversal",description:"Potential path traversal pattern (../) detected",severity:"high"}),e!=="critical"&&(e="high"));let a=["redirect","url","next","return","returnUrl","goto"];for(let i of a){let l=t.searchParams.get(i);l&&/^https?:\/\//.test(l)&&(r.push({type:"open-redirect",description:`Query parameter "${i}" contains an external URL \u2014 potential open redirect`,severity:"medium"}),e==="none"&&(e="medium"))}}catch{r.push({type:"invalid-url",description:"URL could not be parsed",severity:"critical"}),e="critical"}return{valid:r.length===0,riskLevel:e,issues:r}}scanForPII(s){let r=[],e=new Set,t;try{t=decodeURIComponent(s)}catch{t=s}let o="",c="";try{let a=new URL(t);o=a.search,c=a.pathname}catch{o=t}for(let{type:a,pattern:i,mask:l}of m){i.lastIndex=0;let p;for(;(p=i.exec(t))!==null;){e.add(a);let h=o.includes(p[0])?"query-parameter":c.includes(p[0])?"path":"url";r.push({type:a,location:h,masked:l(p[0])})}}return{scanned:!0,found:e.size>0,types:Array.from(e),details:r}}};export{y as a};
@@ -1,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.16");process.exit(0)}
2
- var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-7YFW6S4Y.js");if(!d())return null;let{getUnifiedMemory:v,findProjectRoot:p}=await import("./unified-memory-GI76TXFV.js"),o=v().getDatabase();if(!o)return null;let{join:m}=await import("node:path"),g=m(process.env.AQE_PROJECT_ROOT??p(),".agentic-qe","brain.rvf"),{RvfDualWriter:R}=await import("./rvf-dual-writer-ILITJSFG.js"),l=new R(o,{rvfPath:g,mode:"dual-write",dimensions:384});await l.initialize(),e=l;try{let{getRvfMigrationStage:y}=await import("./feature-flags-ZOO7LMIC.js"),a=y();if(a>=2){let{RvfMigrationAdapter:A}=await import("./rvf-migration-adapter-XF6W4C2N.js"),s=new A({stage:a});s.setSqliteDb(o);let{getSharedRvfAdapter:D}=await import("./shared-rvf-adapter-CF4BCIO7.js"),i=D();if(i){let h={ingest:n=>i.ingest(n),search:(n,M)=>i.search(n,M).map(c=>({id:c.id,score:c.score})),delete:n=>i.delete(n),status:()=>i.status(),close:()=>{}};s.setRvfStore(h)}f=s,console.log(`[RVF] Migration adapter active at stage ${a} (${["sqlite-only","hybrid","dual-sqlite","dual-rvf","rvf-primary"][a]})`)}}catch{}return l}catch(r){return(process.env.DEBUG||process.env.AQE_VERBOSE)&&console.debug("[RVF] Dual-writer init failed, degrading to sqlite-only:",r instanceof Error?r.message:r),null}finally{u=!0,t=null,import("./base-SMCMMVGP.js").then(({registerRvfResetFn:r})=>r(w)).catch(()=>{})}})(),t)}function S(){return e}function b(){return f}function w(){if(e){try{e.close()}catch{}e=null}f=null,t=null,u=!1}export{W as a,S as b,b as c,w as d};
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.17");process.exit(0)}
2
+ var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-5GUTYOWS.js");if(!d())return null;let{getUnifiedMemory:v,findProjectRoot:p}=await import("./unified-memory-2VMGSGQL.js"),o=v().getDatabase();if(!o)return null;let{join:m}=await import("node:path"),g=m(process.env.AQE_PROJECT_ROOT??p(),".agentic-qe","brain.rvf"),{RvfDualWriter:R}=await import("./rvf-dual-writer-GQZHFWO2.js"),l=new R(o,{rvfPath:g,mode:"dual-write",dimensions:384});await l.initialize(),e=l;try{let{getRvfMigrationStage:y}=await import("./feature-flags-G66OT3AS.js"),a=y();if(a>=2){let{RvfMigrationAdapter:A}=await import("./rvf-migration-adapter-3TVKBCAM.js"),s=new A({stage:a});s.setSqliteDb(o);let{getSharedRvfAdapter:D}=await import("./shared-rvf-adapter-6AHPA3V5.js"),i=D();if(i){let h={ingest:n=>i.ingest(n),search:(n,M)=>i.search(n,M).map(c=>({id:c.id,score:c.score})),delete:n=>i.delete(n),status:()=>i.status(),close:()=>{}};s.setRvfStore(h)}f=s,console.log(`[RVF] Migration adapter active at stage ${a} (${["sqlite-only","hybrid","dual-sqlite","dual-rvf","rvf-primary"][a]})`)}}catch{}return l}catch(r){return(process.env.DEBUG||process.env.AQE_VERBOSE)&&console.debug("[RVF] Dual-writer init failed, degrading to sqlite-only:",r instanceof Error?r.message:r),null}finally{u=!0,t=null,import("./base-MAK2BLTG.js").then(({registerRvfResetFn:r})=>r(w)).catch(()=>{})}})(),t)}function S(){return e}function b(){return f}function w(){if(e){try{e.close()}catch{}e=null}f=null,t=null,u=!1}export{W as a,S as b,b as c,w as d};
@@ -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.16");process.exit(0)}
2
- import{a as v}from"./chunk-VWPM27GU.js";import{h as U}from"./chunk-ASEOFRIG.js";import{c as D,d as R,e as h,g as x}from"./chunk-OCV2XEWQ.js";var f=class{config;trackers;globalCostTodayUsd=0;lastGlobalReset=new Date;constructor(e){this.config=e,this.trackers=new Map;for(let t of[0,1,2,3,4])this.trackers.set(t,{tier:t,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,lastHourlyReset:new Date,lastDailyReset:new Date,requestHistory:[]})}async checkBudget(e,t){if(!this.config.enabled)return this.createAllowedDecision(e,e,t,!1,[]);this.autoReset();let r=this.config.tierBudgets[e];if(!r||!r.enabled)return this.createAllowedDecision(e,e,t,!1,["Tier budget not configured or disabled"]);let s=this.getUsage(e),i=[],c=this.config.maxDailyCostUsd-this.globalCostTodayUsd;if(this.globalCostTodayUsd+t>this.config.maxDailyCostUsd)return this.handleBudgetExceeded(e,t,s,"Global daily budget would be exceeded");if(this.globalCostTodayUsd+t>=this.config.maxDailyCostUsd*this.config.warningThreshold&&(i.push(`Approaching global daily budget limit: $${this.globalCostTodayUsd.toFixed(2)}/$${this.config.maxDailyCostUsd.toFixed(2)}`),this.config.onBudgetWarning==="downgrade"))return this.downgradeTier(e,t,s,i);let a=[{exceeded:s.costSpentTodayUsd+t>r.maxDailyCostUsd,message:`Tier ${e} daily cost limit would be exceeded: $${s.costSpentTodayUsd.toFixed(2)}/$${r.maxDailyCostUsd.toFixed(2)}`},{exceeded:s.requestsThisHour>=r.maxRequestsPerHour,message:`Tier ${e} hourly request limit reached: ${s.requestsThisHour}/${r.maxRequestsPerHour}`},{exceeded:s.requestsToday>=r.maxRequestsPerDay,message:`Tier ${e} daily request limit reached: ${s.requestsToday}/${r.maxRequestsPerDay}`},{exceeded:t>r.maxCostPerRequest,message:`Tier ${e} per-request cost limit would be exceeded: $${t.toFixed(4)}/$${r.maxCostPerRequest.toFixed(4)}`}];for(let n of a)if(n.exceeded)return this.handleBudgetExceeded(e,t,s,n.message);return s.budgetUtilization>=this.config.warningThreshold&&(i.push(`Tier ${e} at ${(s.budgetUtilization*100).toFixed(1)}% of daily budget`),this.config.onBudgetWarning==="downgrade")?this.downgradeTier(e,t,s,i):this.createAllowedDecision(e,e,t,!1,i)}async recordCost(e,t){if(!this.config.enabled)return;let r=this.trackers.get(e);r&&(this.autoReset(),r.costSpentTodayUsd+=t,r.requestsThisHour++,r.requestsToday++,this.globalCostTodayUsd+=t,r.requestHistory.push({timestamp:new Date,costUsd:t}),r.requestHistory.length>1e3&&(r.requestHistory=r.requestHistory.slice(-1e3)))}getUsage(e){this.autoReset();let t=this.trackers.get(e);if(!t)return this.createEmptyUsage(e);let r=this.config.tierBudgets[e];if(!r)return this.createEmptyUsage(e);let s=r.maxDailyCostUsd>0?t.costSpentTodayUsd/r.maxDailyCostUsd:0,i=t.costSpentTodayUsd>=r.maxDailyCostUsd||t.requestsThisHour>=r.maxRequestsPerHour||t.requestsToday>=r.maxRequestsPerDay,c=s>=this.config.warningThreshold,a=new Date,n=new Date(a);return n.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:t.costSpentTodayUsd,requestsThisHour:t.requestsThisHour,requestsToday:t.requestsToday,budgetUtilization:s,isExceeded:i,isNearLimit:c,resetTime:n,remainingBudgetUsd:Math.max(0,r.maxDailyCostUsd-t.costSpentTodayUsd),remainingRequestsThisHour:Math.max(0,r.maxRequestsPerHour-t.requestsThisHour),remainingRequestsToday:Math.max(0,r.maxRequestsPerDay-t.requestsToday)}}getAllUsage(){let e={};for(let t of[0,1,2,3,4])e[t]=this.getUsage(t);return e}reset(){let e=new Date;for(let t of this.trackers.values())t.costSpentTodayUsd=0,t.requestsThisHour=0,t.requestsToday=0,t.lastHourlyReset=e,t.lastDailyReset=e,t.requestHistory=[];this.globalCostTodayUsd=0,this.lastGlobalReset=e}handleBudgetExceeded(e,t,r,s){switch(this.config.onBudgetExceeded){case"error":throw new h(`Budget exceeded: ${s}`,e,r);case"downgrade":return this.downgradeTier(e,t,r,[s]);case"queue":throw new h(`Budget exceeded (queueing not yet implemented): ${s}`,e,r);default:throw new h(`Budget exceeded: ${s}`,e,r)}}downgradeTier(e,t,r,s){for(let i=e-1;i>=0;i--){let c=this.config.tierBudgets[i];if(!c||!c.enabled)continue;let a=this.getUsage(i);if(!a.isExceeded){let n=t*.5;if(a.costSpentTodayUsd+n<=c.maxDailyCostUsd)return this.createAllowedDecision(e,i,n,!0,[...s,`Downgraded from Tier ${e} to Tier ${i} due to budget constraints`])}}throw new h(`Budget exceeded and no lower tier available: ${s.join("; ")}`,e,r)}createAllowedDecision(e,t,r,s,i){let c=this.getUsage(t);return{allowed:!0,reason:s?`Budget enforced: downgraded to Tier ${t}`:"Budget check passed",requestedTier:e,approvedTier:t,wasDowngraded:s,estimatedCostUsd:r,currentUsage:c,warnings:i}}createEmptyUsage(e){let t=new Date,r=new Date(t);return r.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,budgetUtilization:0,isExceeded:!1,isNearLimit:!1,resetTime:r,remainingBudgetUsd:0,remainingRequestsThisHour:0,remainingRequestsToday:0}}autoReset(){let e=new Date;this.shouldResetDaily(this.lastGlobalReset,e)&&(this.globalCostTodayUsd=0,this.lastGlobalReset=e);for(let t of this.trackers.values())this.shouldResetHourly(t.lastHourlyReset,e)&&(t.requestsThisHour=0,t.lastHourlyReset=e),this.shouldResetDaily(t.lastDailyReset,e)&&(t.costSpentTodayUsd=0,t.requestsToday=0,t.requestHistory=[],t.lastDailyReset=e)}shouldResetHourly(e,t){return(t.getTime()-e.getTime())/36e5>=1}shouldResetDaily(e,t){return t.getUTCDate()!==e.getUTCDate()||t.getUTCMonth()!==e.getUTCMonth()||t.getUTCFullYear()!==e.getUTCFullYear()}getSessionCostSummary(){this.autoReset();let e=this.config.maxDailyCostUsd,t=0,r={},s={0:"AgentBooster",1:"Haiku",2:"Sonnet",3:"SonnetExtended",4:"Opus"};for(let[c,a]of this.trackers.entries()){let n=this.config.tierBudgets[c],o=s[c]??`Tier${c}`;t+=a.costSpentTodayUsd,r[o]={spent:a.costSpentTodayUsd,limit:n?.maxDailyCostUsd??0,requests:a.requestsToday}}let i=e>0?Math.round(t/e*100):0;return{totalSpentUsd:t,dailyLimitUsd:e,utilizationPercent:i,byTier:r}}};var w=class{cache=new Map;maxSize;ttlMs;enabled;constructor(e,t,r){this.enabled=e,this.maxSize=t,this.ttlMs=r}generateKey(e){return`${e.agentType||"unknown"}:${e.domain||"unknown"}:${e.task.slice(0,100)}`}get(e){if(!this.enabled)return null;let t=this.generateKey(e),r=this.cache.get(t);return r?Date.now()>r.expiresAt?(this.cache.delete(t),null):{...r.decision,metadata:{...r.decision.metadata,fromCache:!0,decisionTimeMs:0}}:null}set(e,t){if(!this.enabled)return;let r=this.generateKey(e);if(this.cache.size>=this.maxSize){let s=this.cache.keys().next().value;s&&this.cache.delete(s)}this.cache.set(r,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,hitRate:0}}},M=class{events=[];enabled;maxEvents=1e4;constructor(e){this.enabled=e}record(e){this.enabled&&(this.events.push(e),this.events.length>this.maxEvents&&(this.events=this.events.slice(-this.maxEvents)))}getMetrics(){if(this.events.length===0)return this.createEmptyMetrics();let e=new Date,t={};for(let o of[0,1,2,3,4]){let d=this.events.filter(l=>l.tier===o);if(d.length===0)continue;let T=d.filter(l=>l.success),m=d.filter(l=>!l.wasManualOverride),b=d.filter(l=>l.wasDowngraded),y=d.map(l=>l.latencyMs).sort((l,g)=>l-g),B=Math.floor(y.length*.95);t[o]={tier:o,selectionCount:d.length,autoRouteCount:m.length,manualOverrideCount:d.length-m.length,budgetDowngradeCount:b.length,successRate:T.length/d.length,avgComplexity:d.reduce((l,g)=>l+g.complexity,0)/d.length,totalCostUsd:d.reduce((l,g)=>l+g.costUsd,0),avgLatencyMs:d.reduce((l,g)=>l+g.latencyMs,0)/d.length,p95LatencyMs:y[B]||0,budgetUtilization:0}}let r=this.events.map(o=>o.latencyMs).sort((o,d)=>o-d),s=Math.floor(r.length*.95),i=Math.floor(r.length*.99),c=this.events.filter(o=>o.agentBoosterEligible).length,a=this.events.filter(o=>o.tier===0).length,n=this.events.filter(o=>o.tier===0&&o.success).length;return{byTier:t,totalDecisions:this.events.length,avgDecisionTimeMs:this.events.reduce((o,d)=>o+d.latencyMs,0)/this.events.length,p95DecisionTimeMs:r[s]||0,p99DecisionTimeMs:r[i]||0,fallbackRate:this.events.filter(o=>o.wasDowngraded).length/this.events.length,ruleMatchRate:this.events.filter(o=>!o.wasManualOverride).length/this.events.length,estimatedCostSavings:0,agentBoosterStats:{eligible:c,used:a,fallbackToLLM:Math.max(0,c-a),successRate:a>0?n/a:0},budgetStats:{totalSpentUsd:this.events.reduce((o,d)=>o+d.costUsd,0),budgetUtilization:0,downgradeCount:this.events.filter(o=>o.wasDowngraded).length,overrideCount:this.events.filter(o=>o.wasManualOverride).length},period:{start:this.events[0]?.timestamp||e,end:this.events[this.events.length-1]?.timestamp||e}}}reset(){this.events=[]}createEmptyMetrics(){let e=new Date;return{byTier:{},totalDecisions:0,avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:0,ruleMatchRate:0,estimatedCostSavings:0,agentBoosterStats:{eligible:0,used:0,fallbackToLLM:0,successRate:0},budgetStats:{totalSpentUsd:0,budgetUtilization:0,downgradeCount:0,overrideCount:0},period:{start:e,end:e}}}},p=class{config;complexityAnalyzer;budgetEnforcer;agentBoosterAdapter;cache;metrics;persistentMetricsTracker;patternsLoaded=!1;tierHierarchyFromPatterns=null;constructor(e={},t,r){this.config={...D,...e},this.agentBoosterAdapter=t,this.persistentMetricsTracker=r,this.complexityAnalyzer=U(this.config,t),this.budgetEnforcer=new f(this.config.budgetConfig),this.cache=new w(this.config.enableDecisionCache,1e3,this.config.decisionCacheTtlMs),this.metrics=new M(this.config.enableMetrics)}setPersistentMetricsTracker(e){this.persistentMetricsTracker=e}async loadPatternsFromLoader(){try{let t=await v().getTierHierarchy();if(t){this.tierHierarchyFromPatterns=t,this.patternsLoaded=!0,console.info("[ModelRouter] Loaded tier hierarchy from PatternLoader",{tiers:Object.keys(t)});return}console.debug("[ModelRouter] PatternLoader returned no tier hierarchy, using defaults")}catch(e){console.warn("[ModelRouter] Failed to load patterns from PatternLoader, using defaults",{error:e instanceof Error?e.message:"Unknown error"})}this.patternsLoaded=!1}getPatternsLoaded(){return this.patternsLoaded}getTierHierarchyFromPatterns(){return this.tierHierarchyFromPatterns}async route(e){let t=Date.now(),r=e.metadata?.correlationId;try{let s=this.cache.get(e);if(s)return s;let i=await Promise.race([this.routeInternal(e,t,r),new Promise((c,a)=>setTimeout(()=>a(new x("Routing decision timed out",this.config.maxDecisionTimeMs)),this.config.maxDecisionTimeMs))]);return this.cache.set(e,i),this.recordMetrics(i,!0),i}catch(s){let i=await this.createFallbackDecision(e,t,r,s instanceof Error?s:new Error("Unknown error"));return this.recordMetrics(i,!1),i}}getMetrics(){return this.metrics.getMetrics()}async getAgentBoosterHealth(){if(!this.agentBoosterAdapter)throw new R("Agent Booster adapter not available","AGENT_BOOSTER_UNAVAILABLE");return this.agentBoosterAdapter.getHealth()}resetMetrics(){this.metrics.reset()}async dispose(){this.cache.clear(),this.metrics.reset(),this.agentBoosterAdapter&&await this.agentBoosterAdapter.dispose()}async routeInternal(e,t,r){let s=[];if(e.manualTier!==void 0&&this.config.allowManualOverrides)return this.handleManualOverride(e,e.manualTier,t,r);let i=await this.complexityAnalyzer.analyze(e),c=i.recommendedTier,a=this.estimateCost(c,e.task.length),n=await this.budgetEnforcer.checkBudget(c,a),o=n.approvedTier;s.push(...n.warnings);let d=o===0&&i.signals.isMechanicalTransform,T=this.getModelIdForTier(o),m=this.buildRationale(i,n,o),b=this.buildAlternatives(i,o),y=Date.now()-t;return{tier:o,modelId:T,complexityAnalysis:i,budgetDecision:n,confidence:i.confidence,rationale:m,agentBoosterEligible:d,agentBoosterTransform:d?i.signals.detectedTransformType:void 0,alternativeTiers:b,metadata:{timestamp:new Date,decisionTimeMs:y,fromCache:!1,correlationId:r},warnings:s}}async handleManualOverride(e,t,r,s){let i=await this.complexityAnalyzer.analyze(e),c=this.estimateCost(t,e.task.length),a=await this.budgetEnforcer.checkBudget(t,c);!a.allowed&&e.isCritical&&this.config.budgetConfig.allowCriticalOverrides&&(a={...a,allowed:!0,reason:"Critical task override",warnings:[...a.warnings,"Budget exceeded but allowed due to critical task override"]});let n=a.approvedTier,o=this.getModelIdForTier(n),d=Date.now()-r;return{tier:n,modelId:o,complexityAnalysis:i,budgetDecision:a,confidence:1,rationale:`Manual override to Tier ${n}${a.wasDowngraded?" (downgraded due to budget)":""}`,agentBoosterEligible:n===0,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:d,fromCache:!1,correlationId:s},warnings:a.warnings}}async createFallbackDecision(e,t,r,s){let i=this.config.fallbackTier,c=this.getModelIdForTier(i),a={overall:50,codeComplexity:50,reasoningComplexity:50,scopeComplexity:50,confidence:.3,signals:{hasArchitectureScope:!1,hasSecurityScope:!1,requiresMultiStepReasoning:!1,requiresCrossDomainCoordination:!1,isMechanicalTransform:!1,requiresCreativity:!1,keywordMatches:{simple:[],moderate:[],complex:[],critical:[]}},recommendedTier:i,alternateTiers:[],explanation:`Fallback to Tier ${i} due to routing error`},n={allowed:!0,reason:"Fallback routing",requestedTier:i,approvedTier:i,wasDowngraded:!1,estimatedCostUsd:0,currentUsage:this.budgetEnforcer.getUsage(i),warnings:[]},o=Date.now()-t;return{tier:i,modelId:c,complexityAnalysis:a,budgetDecision:n,confidence:.3,rationale:`Fallback to Tier ${i} due to error: ${s.message}`,agentBoosterEligible:!1,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:o,fromCache:!1,correlationId:r},warnings:[`Routing error: ${s.message}`,"Using fallback tier"]}}estimateCost(e,t){let r=[0,.001,.01,.05,.2],s=Math.max(1,t/1e3);return r[e]*s}getModelIdForTier(e){return this.config.tierModels[e]||`tier-${e}-default`}buildRationale(e,t,r){let s=[];return s.push(`Complexity: ${e.overall}/100`),s.push(`Tier ${r} selected`),t.wasDowngraded&&s.push(`Downgraded due to budget: ${t.reason}`),s.push(e.explanation),s.join(". ")}buildAlternatives(e,t){return e.alternateTiers.filter(r=>r!==t).map(r=>({tier:r,modelId:this.getModelIdForTier(r),reason:`Alternative tier ${r}`}))}recordMetrics(e,t){this.metrics.record({timestamp:e.metadata.timestamp,tier:e.tier,complexity:e.complexityAnalysis.overall,costUsd:e.budgetDecision.estimatedCostUsd,latencyMs:e.metadata.decisionTimeMs,wasDowngraded:e.budgetDecision.wasDowngraded,wasManualOverride:!1,agentBoosterEligible:e.agentBoosterEligible,success:t}),this.recordPersistentMetrics(e,t).catch(console.error)}async recordPersistentMetrics(e,t){if(this.persistentMetricsTracker)try{let r=`router-tier${e.tier}-${Date.now()}`;await this.persistentMetricsTracker.recordOutcome("router",r,t,e.metadata.decisionTimeMs,{subType:`tier-${e.tier}`,confidence:e.confidence,usedFallback:e.budgetDecision.wasDowngraded})}catch(r){console.warn("[ModelRouter] Failed to record persistent metrics:",r)}}};function H(u={},e,t){return new p(u,e,t)}async function $(u={},e){let{createAgentBoosterAdapter:t}=await import("./adapter-6CQ2PIP5.js"),r=await t({enabled:!0}),s=new p(u,r,e);return await s.loadPatternsFromLoader(),s}export{p as a,H as b,$ as c};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{a as v}from"./chunk-SAZ4PJBR.js";import{h as U}from"./chunk-WX4PO65Q.js";import{c as D,d as R,e as h,g as x}from"./chunk-IJZFJPHS.js";var f=class{config;trackers;globalCostTodayUsd=0;lastGlobalReset=new Date;constructor(e){this.config=e,this.trackers=new Map;for(let t of[0,1,2,3,4])this.trackers.set(t,{tier:t,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,lastHourlyReset:new Date,lastDailyReset:new Date,requestHistory:[]})}async checkBudget(e,t){if(!this.config.enabled)return this.createAllowedDecision(e,e,t,!1,[]);this.autoReset();let r=this.config.tierBudgets[e];if(!r||!r.enabled)return this.createAllowedDecision(e,e,t,!1,["Tier budget not configured or disabled"]);let s=this.getUsage(e),i=[],c=this.config.maxDailyCostUsd-this.globalCostTodayUsd;if(this.globalCostTodayUsd+t>this.config.maxDailyCostUsd)return this.handleBudgetExceeded(e,t,s,"Global daily budget would be exceeded");if(this.globalCostTodayUsd+t>=this.config.maxDailyCostUsd*this.config.warningThreshold&&(i.push(`Approaching global daily budget limit: $${this.globalCostTodayUsd.toFixed(2)}/$${this.config.maxDailyCostUsd.toFixed(2)}`),this.config.onBudgetWarning==="downgrade"))return this.downgradeTier(e,t,s,i);let a=[{exceeded:s.costSpentTodayUsd+t>r.maxDailyCostUsd,message:`Tier ${e} daily cost limit would be exceeded: $${s.costSpentTodayUsd.toFixed(2)}/$${r.maxDailyCostUsd.toFixed(2)}`},{exceeded:s.requestsThisHour>=r.maxRequestsPerHour,message:`Tier ${e} hourly request limit reached: ${s.requestsThisHour}/${r.maxRequestsPerHour}`},{exceeded:s.requestsToday>=r.maxRequestsPerDay,message:`Tier ${e} daily request limit reached: ${s.requestsToday}/${r.maxRequestsPerDay}`},{exceeded:t>r.maxCostPerRequest,message:`Tier ${e} per-request cost limit would be exceeded: $${t.toFixed(4)}/$${r.maxCostPerRequest.toFixed(4)}`}];for(let n of a)if(n.exceeded)return this.handleBudgetExceeded(e,t,s,n.message);return s.budgetUtilization>=this.config.warningThreshold&&(i.push(`Tier ${e} at ${(s.budgetUtilization*100).toFixed(1)}% of daily budget`),this.config.onBudgetWarning==="downgrade")?this.downgradeTier(e,t,s,i):this.createAllowedDecision(e,e,t,!1,i)}async recordCost(e,t){if(!this.config.enabled)return;let r=this.trackers.get(e);r&&(this.autoReset(),r.costSpentTodayUsd+=t,r.requestsThisHour++,r.requestsToday++,this.globalCostTodayUsd+=t,r.requestHistory.push({timestamp:new Date,costUsd:t}),r.requestHistory.length>1e3&&(r.requestHistory=r.requestHistory.slice(-1e3)))}getUsage(e){this.autoReset();let t=this.trackers.get(e);if(!t)return this.createEmptyUsage(e);let r=this.config.tierBudgets[e];if(!r)return this.createEmptyUsage(e);let s=r.maxDailyCostUsd>0?t.costSpentTodayUsd/r.maxDailyCostUsd:0,i=t.costSpentTodayUsd>=r.maxDailyCostUsd||t.requestsThisHour>=r.maxRequestsPerHour||t.requestsToday>=r.maxRequestsPerDay,c=s>=this.config.warningThreshold,a=new Date,n=new Date(a);return n.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:t.costSpentTodayUsd,requestsThisHour:t.requestsThisHour,requestsToday:t.requestsToday,budgetUtilization:s,isExceeded:i,isNearLimit:c,resetTime:n,remainingBudgetUsd:Math.max(0,r.maxDailyCostUsd-t.costSpentTodayUsd),remainingRequestsThisHour:Math.max(0,r.maxRequestsPerHour-t.requestsThisHour),remainingRequestsToday:Math.max(0,r.maxRequestsPerDay-t.requestsToday)}}getAllUsage(){let e={};for(let t of[0,1,2,3,4])e[t]=this.getUsage(t);return e}reset(){let e=new Date;for(let t of this.trackers.values())t.costSpentTodayUsd=0,t.requestsThisHour=0,t.requestsToday=0,t.lastHourlyReset=e,t.lastDailyReset=e,t.requestHistory=[];this.globalCostTodayUsd=0,this.lastGlobalReset=e}handleBudgetExceeded(e,t,r,s){switch(this.config.onBudgetExceeded){case"error":throw new h(`Budget exceeded: ${s}`,e,r);case"downgrade":return this.downgradeTier(e,t,r,[s]);case"queue":throw new h(`Budget exceeded (queueing not yet implemented): ${s}`,e,r);default:throw new h(`Budget exceeded: ${s}`,e,r)}}downgradeTier(e,t,r,s){for(let i=e-1;i>=0;i--){let c=this.config.tierBudgets[i];if(!c||!c.enabled)continue;let a=this.getUsage(i);if(!a.isExceeded){let n=t*.5;if(a.costSpentTodayUsd+n<=c.maxDailyCostUsd)return this.createAllowedDecision(e,i,n,!0,[...s,`Downgraded from Tier ${e} to Tier ${i} due to budget constraints`])}}throw new h(`Budget exceeded and no lower tier available: ${s.join("; ")}`,e,r)}createAllowedDecision(e,t,r,s,i){let c=this.getUsage(t);return{allowed:!0,reason:s?`Budget enforced: downgraded to Tier ${t}`:"Budget check passed",requestedTier:e,approvedTier:t,wasDowngraded:s,estimatedCostUsd:r,currentUsage:c,warnings:i}}createEmptyUsage(e){let t=new Date,r=new Date(t);return r.setUTCHours(24,0,0,0),{tier:e,costSpentTodayUsd:0,requestsThisHour:0,requestsToday:0,budgetUtilization:0,isExceeded:!1,isNearLimit:!1,resetTime:r,remainingBudgetUsd:0,remainingRequestsThisHour:0,remainingRequestsToday:0}}autoReset(){let e=new Date;this.shouldResetDaily(this.lastGlobalReset,e)&&(this.globalCostTodayUsd=0,this.lastGlobalReset=e);for(let t of this.trackers.values())this.shouldResetHourly(t.lastHourlyReset,e)&&(t.requestsThisHour=0,t.lastHourlyReset=e),this.shouldResetDaily(t.lastDailyReset,e)&&(t.costSpentTodayUsd=0,t.requestsToday=0,t.requestHistory=[],t.lastDailyReset=e)}shouldResetHourly(e,t){return(t.getTime()-e.getTime())/36e5>=1}shouldResetDaily(e,t){return t.getUTCDate()!==e.getUTCDate()||t.getUTCMonth()!==e.getUTCMonth()||t.getUTCFullYear()!==e.getUTCFullYear()}getSessionCostSummary(){this.autoReset();let e=this.config.maxDailyCostUsd,t=0,r={},s={0:"AgentBooster",1:"Haiku",2:"Sonnet",3:"SonnetExtended",4:"Opus"};for(let[c,a]of this.trackers.entries()){let n=this.config.tierBudgets[c],o=s[c]??`Tier${c}`;t+=a.costSpentTodayUsd,r[o]={spent:a.costSpentTodayUsd,limit:n?.maxDailyCostUsd??0,requests:a.requestsToday}}let i=e>0?Math.round(t/e*100):0;return{totalSpentUsd:t,dailyLimitUsd:e,utilizationPercent:i,byTier:r}}};var w=class{cache=new Map;maxSize;ttlMs;enabled;constructor(e,t,r){this.enabled=e,this.maxSize=t,this.ttlMs=r}generateKey(e){return`${e.agentType||"unknown"}:${e.domain||"unknown"}:${e.task.slice(0,100)}`}get(e){if(!this.enabled)return null;let t=this.generateKey(e),r=this.cache.get(t);return r?Date.now()>r.expiresAt?(this.cache.delete(t),null):{...r.decision,metadata:{...r.decision.metadata,fromCache:!0,decisionTimeMs:0}}:null}set(e,t){if(!this.enabled)return;let r=this.generateKey(e);if(this.cache.size>=this.maxSize){let s=this.cache.keys().next().value;s&&this.cache.delete(s)}this.cache.set(r,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,hitRate:0}}},M=class{events=[];enabled;maxEvents=1e4;constructor(e){this.enabled=e}record(e){this.enabled&&(this.events.push(e),this.events.length>this.maxEvents&&(this.events=this.events.slice(-this.maxEvents)))}getMetrics(){if(this.events.length===0)return this.createEmptyMetrics();let e=new Date,t={};for(let o of[0,1,2,3,4]){let d=this.events.filter(l=>l.tier===o);if(d.length===0)continue;let T=d.filter(l=>l.success),m=d.filter(l=>!l.wasManualOverride),b=d.filter(l=>l.wasDowngraded),y=d.map(l=>l.latencyMs).sort((l,g)=>l-g),B=Math.floor(y.length*.95);t[o]={tier:o,selectionCount:d.length,autoRouteCount:m.length,manualOverrideCount:d.length-m.length,budgetDowngradeCount:b.length,successRate:T.length/d.length,avgComplexity:d.reduce((l,g)=>l+g.complexity,0)/d.length,totalCostUsd:d.reduce((l,g)=>l+g.costUsd,0),avgLatencyMs:d.reduce((l,g)=>l+g.latencyMs,0)/d.length,p95LatencyMs:y[B]||0,budgetUtilization:0}}let r=this.events.map(o=>o.latencyMs).sort((o,d)=>o-d),s=Math.floor(r.length*.95),i=Math.floor(r.length*.99),c=this.events.filter(o=>o.agentBoosterEligible).length,a=this.events.filter(o=>o.tier===0).length,n=this.events.filter(o=>o.tier===0&&o.success).length;return{byTier:t,totalDecisions:this.events.length,avgDecisionTimeMs:this.events.reduce((o,d)=>o+d.latencyMs,0)/this.events.length,p95DecisionTimeMs:r[s]||0,p99DecisionTimeMs:r[i]||0,fallbackRate:this.events.filter(o=>o.wasDowngraded).length/this.events.length,ruleMatchRate:this.events.filter(o=>!o.wasManualOverride).length/this.events.length,estimatedCostSavings:0,agentBoosterStats:{eligible:c,used:a,fallbackToLLM:Math.max(0,c-a),successRate:a>0?n/a:0},budgetStats:{totalSpentUsd:this.events.reduce((o,d)=>o+d.costUsd,0),budgetUtilization:0,downgradeCount:this.events.filter(o=>o.wasDowngraded).length,overrideCount:this.events.filter(o=>o.wasManualOverride).length},period:{start:this.events[0]?.timestamp||e,end:this.events[this.events.length-1]?.timestamp||e}}}reset(){this.events=[]}createEmptyMetrics(){let e=new Date;return{byTier:{},totalDecisions:0,avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:0,ruleMatchRate:0,estimatedCostSavings:0,agentBoosterStats:{eligible:0,used:0,fallbackToLLM:0,successRate:0},budgetStats:{totalSpentUsd:0,budgetUtilization:0,downgradeCount:0,overrideCount:0},period:{start:e,end:e}}}},p=class{config;complexityAnalyzer;budgetEnforcer;agentBoosterAdapter;cache;metrics;persistentMetricsTracker;patternsLoaded=!1;tierHierarchyFromPatterns=null;constructor(e={},t,r){this.config={...D,...e},this.agentBoosterAdapter=t,this.persistentMetricsTracker=r,this.complexityAnalyzer=U(this.config,t),this.budgetEnforcer=new f(this.config.budgetConfig),this.cache=new w(this.config.enableDecisionCache,1e3,this.config.decisionCacheTtlMs),this.metrics=new M(this.config.enableMetrics)}setPersistentMetricsTracker(e){this.persistentMetricsTracker=e}async loadPatternsFromLoader(){try{let t=await v().getTierHierarchy();if(t){this.tierHierarchyFromPatterns=t,this.patternsLoaded=!0,console.info("[ModelRouter] Loaded tier hierarchy from PatternLoader",{tiers:Object.keys(t)});return}console.debug("[ModelRouter] PatternLoader returned no tier hierarchy, using defaults")}catch(e){console.warn("[ModelRouter] Failed to load patterns from PatternLoader, using defaults",{error:e instanceof Error?e.message:"Unknown error"})}this.patternsLoaded=!1}getPatternsLoaded(){return this.patternsLoaded}getTierHierarchyFromPatterns(){return this.tierHierarchyFromPatterns}async route(e){let t=Date.now(),r=e.metadata?.correlationId;try{let s=this.cache.get(e);if(s)return s;let i=await Promise.race([this.routeInternal(e,t,r),new Promise((c,a)=>setTimeout(()=>a(new x("Routing decision timed out",this.config.maxDecisionTimeMs)),this.config.maxDecisionTimeMs))]);return this.cache.set(e,i),this.recordMetrics(i,!0),i}catch(s){let i=await this.createFallbackDecision(e,t,r,s instanceof Error?s:new Error("Unknown error"));return this.recordMetrics(i,!1),i}}getMetrics(){return this.metrics.getMetrics()}async getAgentBoosterHealth(){if(!this.agentBoosterAdapter)throw new R("Agent Booster adapter not available","AGENT_BOOSTER_UNAVAILABLE");return this.agentBoosterAdapter.getHealth()}resetMetrics(){this.metrics.reset()}async dispose(){this.cache.clear(),this.metrics.reset(),this.agentBoosterAdapter&&await this.agentBoosterAdapter.dispose()}async routeInternal(e,t,r){let s=[];if(e.manualTier!==void 0&&this.config.allowManualOverrides)return this.handleManualOverride(e,e.manualTier,t,r);let i=await this.complexityAnalyzer.analyze(e),c=i.recommendedTier,a=this.estimateCost(c,e.task.length),n=await this.budgetEnforcer.checkBudget(c,a),o=n.approvedTier;s.push(...n.warnings);let d=o===0&&i.signals.isMechanicalTransform,T=this.getModelIdForTier(o),m=this.buildRationale(i,n,o),b=this.buildAlternatives(i,o),y=Date.now()-t;return{tier:o,modelId:T,complexityAnalysis:i,budgetDecision:n,confidence:i.confidence,rationale:m,agentBoosterEligible:d,agentBoosterTransform:d?i.signals.detectedTransformType:void 0,alternativeTiers:b,metadata:{timestamp:new Date,decisionTimeMs:y,fromCache:!1,correlationId:r},warnings:s}}async handleManualOverride(e,t,r,s){let i=await this.complexityAnalyzer.analyze(e),c=this.estimateCost(t,e.task.length),a=await this.budgetEnforcer.checkBudget(t,c);!a.allowed&&e.isCritical&&this.config.budgetConfig.allowCriticalOverrides&&(a={...a,allowed:!0,reason:"Critical task override",warnings:[...a.warnings,"Budget exceeded but allowed due to critical task override"]});let n=a.approvedTier,o=this.getModelIdForTier(n),d=Date.now()-r;return{tier:n,modelId:o,complexityAnalysis:i,budgetDecision:a,confidence:1,rationale:`Manual override to Tier ${n}${a.wasDowngraded?" (downgraded due to budget)":""}`,agentBoosterEligible:n===0,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:d,fromCache:!1,correlationId:s},warnings:a.warnings}}async createFallbackDecision(e,t,r,s){let i=this.config.fallbackTier,c=this.getModelIdForTier(i),a={overall:50,codeComplexity:50,reasoningComplexity:50,scopeComplexity:50,confidence:.3,signals:{hasArchitectureScope:!1,hasSecurityScope:!1,requiresMultiStepReasoning:!1,requiresCrossDomainCoordination:!1,isMechanicalTransform:!1,requiresCreativity:!1,keywordMatches:{simple:[],moderate:[],complex:[],critical:[]}},recommendedTier:i,alternateTiers:[],explanation:`Fallback to Tier ${i} due to routing error`},n={allowed:!0,reason:"Fallback routing",requestedTier:i,approvedTier:i,wasDowngraded:!1,estimatedCostUsd:0,currentUsage:this.budgetEnforcer.getUsage(i),warnings:[]},o=Date.now()-t;return{tier:i,modelId:c,complexityAnalysis:a,budgetDecision:n,confidence:.3,rationale:`Fallback to Tier ${i} due to error: ${s.message}`,agentBoosterEligible:!1,alternativeTiers:[],metadata:{timestamp:new Date,decisionTimeMs:o,fromCache:!1,correlationId:r},warnings:[`Routing error: ${s.message}`,"Using fallback tier"]}}estimateCost(e,t){let r=[0,.001,.01,.05,.2],s=Math.max(1,t/1e3);return r[e]*s}getModelIdForTier(e){return this.config.tierModels[e]||`tier-${e}-default`}buildRationale(e,t,r){let s=[];return s.push(`Complexity: ${e.overall}/100`),s.push(`Tier ${r} selected`),t.wasDowngraded&&s.push(`Downgraded due to budget: ${t.reason}`),s.push(e.explanation),s.join(". ")}buildAlternatives(e,t){return e.alternateTiers.filter(r=>r!==t).map(r=>({tier:r,modelId:this.getModelIdForTier(r),reason:`Alternative tier ${r}`}))}recordMetrics(e,t){this.metrics.record({timestamp:e.metadata.timestamp,tier:e.tier,complexity:e.complexityAnalysis.overall,costUsd:e.budgetDecision.estimatedCostUsd,latencyMs:e.metadata.decisionTimeMs,wasDowngraded:e.budgetDecision.wasDowngraded,wasManualOverride:!1,agentBoosterEligible:e.agentBoosterEligible,success:t}),this.recordPersistentMetrics(e,t).catch(console.error)}async recordPersistentMetrics(e,t){if(this.persistentMetricsTracker)try{let r=`router-tier${e.tier}-${Date.now()}`;await this.persistentMetricsTracker.recordOutcome("router",r,t,e.metadata.decisionTimeMs,{subType:`tier-${e.tier}`,confidence:e.confidence,usedFallback:e.budgetDecision.wasDowngraded})}catch(r){console.warn("[ModelRouter] Failed to record persistent metrics:",r)}}};function H(u={},e,t){return new p(u,e,t)}async function $(u={},e){let{createAgentBoosterAdapter:t}=await import("./adapter-OMILP6KH.js"),r=await t({enabled:!0}),s=new p(u,r,e);return await s.loadPatternsFromLoader(),s}export{p as a,H as b,$ as c};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
- import{b as t,d as o}from"./chunk-AJMJNQMP.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>u,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>n,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>m,pipeline:()=>q});import{createRequire as r}from"module";var i,e,n,a,c,l,s,p,m,u,d,A,f,h,_,b,q,g=t(()=>{i=r(import.meta.url),e=i("better-sqlite3"),n=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:m,FlashAttention:u,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:b,pipeline:q}=e||{}});export{n as a,a as b,c,l as d,s as e,p as f,m as g,u as h,d as i,A as j,f as k,h as l,_ as m,b as n,q as o,L as p,g as q};
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.17");process.exit(0)}
2
+ import{b as t,d as o}from"./chunk-Z7SKUC6P.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>u,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>n,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>m,pipeline:()=>q});import{createRequire as r}from"module";var i,e,n,a,c,l,s,p,m,u,d,A,f,h,_,b,q,g=t(()=>{i=r(import.meta.url),e=i("better-sqlite3"),n=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:m,FlashAttention:u,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:b,pipeline:q}=e||{}});export{n as a,a as b,c,l as d,s as e,p as f,m as g,u as h,d as i,A as j,f as k,h as l,_ as m,b as n,q as o,L as p,g as q};
@@ -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.16");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.17");process.exit(0)}
2
2
  var l=["var-to-const","add-types","remove-console","promise-to-async","cjs-to-esm","func-to-arrow"],p={"var-to-const":{type:"var-to-const",name:"Var to Const/Let",description:"Convert var declarations to const (if not reassigned) or let (if reassigned)",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"add-types":{type:"add-types",name:"Add TypeScript Types",description:"Add TypeScript type annotations to function parameters and return types",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"remove-console":{type:"remove-console",name:"Remove Console Statements",description:"Remove all console.log, console.warn, console.error, etc. statements",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"promise-to-async":{type:"promise-to-async",name:"Promise to Async/Await",description:"Convert Promise .then()/.catch() chains to async/await syntax",complexity:"complex",wasmAvailable:!0,typicalLatencyMs:10},"cjs-to-esm":{type:"cjs-to-esm",name:"CommonJS to ES Modules",description:"Convert require() calls to import statements and module.exports to export",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"func-to-arrow":{type:"func-to-arrow",name:"Function to Arrow",description:"Convert function declarations and expressions to arrow functions",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:3}},u={enabled:!0,fallbackToLLM:!0,confidenceThreshold:.7,transforms:[],maxFileSizeBytes:1024*1024,timeoutMs:5e3,cacheEnabled:!0,cacheTtlMs:300*1e3},t=class extends Error{constructor(e,s,o){super(e);this.code=s;this.cause=o;this.name="AgentBoosterError"}code;cause},a=class extends t{constructor(e,s,o){super(e,"TRANSFORM_ERROR",o);this.transformType=s;this.name="TransformError"}transformType},i=class extends t{constructor(r="WASM module is not available",e){super(r,"WASM_UNAVAILABLE",e),this.name="WasmUnavailableError"}},c=class extends t{constructor(e,s,o){super(e,"TRANSFORM_TIMEOUT");this.transformType=s;this.timeoutMs=o;this.name="TransformTimeoutError"}transformType;timeoutMs},m=class extends t{constructor(e,s,o){super(`File ${e} is too large (${s} bytes, max ${o} bytes)`,"FILE_TOO_LARGE");this.filePath=e;this.sizeBytes=s;this.maxSizeBytes=o;this.name="FileTooLargeError"}filePath;sizeBytes;maxSizeBytes};export{l as a,p as b,u as c,a as d,i as e,c as f,m as g};
@@ -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.16");process.exit(0)}
2
- import{a as h}from"./chunk-YAPLJR7K.js";import{c as m}from"./chunk-G5RHFBAY.js";h();var g=m.create("regret-tracker"),l=50,R=.9,d=1.1;function f(o,t){let e=o.length;if(e<2)return 0;let n=0,r=0,i=0,a=0;for(let s=0;s<e;s++)n+=o[s],r+=t[s],i+=o[s]*t[s],a+=o[s]*o[s];let u=e*a-n*n;return Math.abs(u)<1e-10?0:(e*i-n*r)/u}var c=class{domains=new Map;alertCallbacks=[];alerts=[];maxAlerts;recentWindow;constructor(t){this.maxAlerts=t?.maxAlerts??100,this.recentWindow=t?.recentWindow??20}recordDecision(t,e,n){let r=this.getOrCreateDomainState(t),i=Math.max(0,n-e);if(r.cumulativeRegret+=i,r.decisionCount++,r.points.push({decisionCount:r.decisionCount,cumulativeRegret:r.cumulativeRegret,timestamp:Date.now()}),r.decisionCount>=l){let a=this.classifyGrowthRate(r.points);r.lastGrowthRate!=="insufficient_data"&&a!==r.lastGrowthRate&&this.emitAlert(t,r.lastGrowthRate,a),r.lastGrowthRate=a}}getCumulativeRegret(t){return this.domains.get(t)?.cumulativeRegret??0}getRegretCurve(t){let e=this.domains.get(t);return e?[...e.points]:[]}getRegretGrowthRate(t){let e=this.domains.get(t);return e?this.classifyGrowthRate(e.points):"insufficient_data"}detectStagnation(t){let e=this.getRegretGrowthRate(t);return e==="linear"||e==="superlinear"}getHealthSummary(){let t=[];for(let[e,n]of this.domains){let r=this.classifyGrowthRate(n.points),i=this.computeLogLogSlope(n.points),a=this.computeRecentAvgRegret(n);t.push({domain:e,totalDecisions:n.decisionCount,cumulativeRegret:n.cumulativeRegret,growthRate:r,stagnating:r==="linear"||r==="superlinear",slope:i,recentAvgRegret:a})}return t.sort((e,n)=>e.domain.localeCompare(n.domain)),t}onAlert(t){this.alertCallbacks.push(t)}getAlerts(){return[...this.alerts]}getTrackedDomains(){return[...this.domains.keys()].sort()}getTotalDecisions(){let t=0;for(let e of this.domains.values())t+=e.decisionCount;return t}reset(t){t?this.domains.delete(t):(this.domains.clear(),this.alerts=[])}getOrCreateDomainState(t){let e=this.domains.get(t);return e||(e={points:[],cumulativeRegret:0,decisionCount:0,lastGrowthRate:"insufficient_data"},this.domains.set(t,e)),e}classifyGrowthRate(t){if(t.length<l)return"insufficient_data";let e=this.computeLogLogSlope(t);return e===void 0?"insufficient_data":e<R?"sublinear":e<=d?"linear":"superlinear"}computeLogLogSlope(t){if(t.length<l)return;let e=t.filter(i=>i.cumulativeRegret>0&&i.decisionCount>0);if(e.length<2)return;let n=e.map(i=>Math.log(i.decisionCount)),r=e.map(i=>Math.log(i.cumulativeRegret));return f(n,r)}computeRecentAvgRegret(t){if(t.points.length<2)return 0;let e=Math.min(this.recentWindow,t.points.length),n=t.points.slice(-e),r=n[0],i=n[n.length-1],a=i.cumulativeRegret-r.cumulativeRegret,u=i.decisionCount-r.decisionCount;return u<=0?0:a/u}emitAlert(t,e,n){let r={domain:t,previousRate:e,newRate:n,timestamp:Date.now(),message:`Domain "${t}" regret growth changed from ${e} to ${n}`};this.alerts.push(r),this.alerts.length>this.maxAlerts&&this.alerts.shift(),g.info("Regret growth rate transition",{domain:t,previousRate:e,newRate:n});for(let i of this.alertCallbacks)try{i(r)}catch(a){g.error("Alert callback error",a instanceof Error?a:void 0)}}};function b(o){return new c(o)}export{b as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{a as h}from"./chunk-TIVKDIF7.js";import{c as m}from"./chunk-DS5IFRY6.js";h();var g=m.create("regret-tracker"),l=50,R=.9,d=1.1;function f(o,t){let e=o.length;if(e<2)return 0;let n=0,r=0,i=0,a=0;for(let s=0;s<e;s++)n+=o[s],r+=t[s],i+=o[s]*t[s],a+=o[s]*o[s];let u=e*a-n*n;return Math.abs(u)<1e-10?0:(e*i-n*r)/u}var c=class{domains=new Map;alertCallbacks=[];alerts=[];maxAlerts;recentWindow;constructor(t){this.maxAlerts=t?.maxAlerts??100,this.recentWindow=t?.recentWindow??20}recordDecision(t,e,n){let r=this.getOrCreateDomainState(t),i=Math.max(0,n-e);if(r.cumulativeRegret+=i,r.decisionCount++,r.points.push({decisionCount:r.decisionCount,cumulativeRegret:r.cumulativeRegret,timestamp:Date.now()}),r.decisionCount>=l){let a=this.classifyGrowthRate(r.points);r.lastGrowthRate!=="insufficient_data"&&a!==r.lastGrowthRate&&this.emitAlert(t,r.lastGrowthRate,a),r.lastGrowthRate=a}}getCumulativeRegret(t){return this.domains.get(t)?.cumulativeRegret??0}getRegretCurve(t){let e=this.domains.get(t);return e?[...e.points]:[]}getRegretGrowthRate(t){let e=this.domains.get(t);return e?this.classifyGrowthRate(e.points):"insufficient_data"}detectStagnation(t){let e=this.getRegretGrowthRate(t);return e==="linear"||e==="superlinear"}getHealthSummary(){let t=[];for(let[e,n]of this.domains){let r=this.classifyGrowthRate(n.points),i=this.computeLogLogSlope(n.points),a=this.computeRecentAvgRegret(n);t.push({domain:e,totalDecisions:n.decisionCount,cumulativeRegret:n.cumulativeRegret,growthRate:r,stagnating:r==="linear"||r==="superlinear",slope:i,recentAvgRegret:a})}return t.sort((e,n)=>e.domain.localeCompare(n.domain)),t}onAlert(t){this.alertCallbacks.push(t)}getAlerts(){return[...this.alerts]}getTrackedDomains(){return[...this.domains.keys()].sort()}getTotalDecisions(){let t=0;for(let e of this.domains.values())t+=e.decisionCount;return t}reset(t){t?this.domains.delete(t):(this.domains.clear(),this.alerts=[])}getOrCreateDomainState(t){let e=this.domains.get(t);return e||(e={points:[],cumulativeRegret:0,decisionCount:0,lastGrowthRate:"insufficient_data"},this.domains.set(t,e)),e}classifyGrowthRate(t){if(t.length<l)return"insufficient_data";let e=this.computeLogLogSlope(t);return e===void 0?"insufficient_data":e<R?"sublinear":e<=d?"linear":"superlinear"}computeLogLogSlope(t){if(t.length<l)return;let e=t.filter(i=>i.cumulativeRegret>0&&i.decisionCount>0);if(e.length<2)return;let n=e.map(i=>Math.log(i.decisionCount)),r=e.map(i=>Math.log(i.cumulativeRegret));return f(n,r)}computeRecentAvgRegret(t){if(t.points.length<2)return 0;let e=Math.min(this.recentWindow,t.points.length),n=t.points.slice(-e),r=n[0],i=n[n.length-1],a=i.cumulativeRegret-r.cumulativeRegret,u=i.decisionCount-r.decisionCount;return u<=0?0:a/u}emitAlert(t,e,n){let r={domain:t,previousRate:e,newRate:n,timestamp:Date.now(),message:`Domain "${t}" regret growth changed from ${e} to ${n}`};this.alerts.push(r),this.alerts.length>this.maxAlerts&&this.alerts.shift(),g.info("Regret growth rate transition",{domain:t,previousRate:e,newRate:n});for(let i of this.alertCallbacks)try{i(r)}catch(a){g.error("Alert callback error",a instanceof Error?a:void 0)}}};function b(o){return new c(o)}export{b as a};
@@ -1,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.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(`
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.17");process.exit(0)}
2
+ import{c as I,d as _}from"./chunk-HD6W6PHV.js";import{a as b}from"./chunk-5WYZVSL2.js";import{b as me}from"./chunk-P3D7SEHW.js";import{a as de,b as pe}from"./chunk-CVPXHDQU.js";import{e as ue,f as ge}from"./chunk-XFTX3KLE.js";import{b as S,d as le}from"./chunk-CMN7PU2H.js";import{b as ce,c as $,e as qe}from"./chunk-YKRLUTK7.js";import{a as ae}from"./chunk-REY52O7J.js";import{a as k,e as L}from"./chunk-J7Q5TXFZ.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.17"}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.16");process.exit(0)}
2
- import{b as m,d as A}from"./chunk-V5NHZV7S.js";import{a as u,b as C,c as R,e as S}from"./chunk-S75SOOZL.js";import{a as P}from"./chunk-YAPLJR7K.js";import{c as b}from"./chunk-G5RHFBAY.js";A();S();P();var g=b.create("skill-validation-learner"),y=class{constructor(e){this.reasoningBank=e}reasoningBank;memoryNamespace="skill-validation";feedbackLoop=null;connectFeedbackLoop(e){this.feedbackLoop=e}async recordValidationOutcome(e){await this.reasoningBank.storeQEPattern({patternType:"test-template",name:`${e.skillName}-validation-${e.validationLevel}`,description:`Validation outcome for ${e.skillName} at level ${e.validationLevel}`,context:{tags:["skill-validation",e.skillName,e.model,e.validationLevel],testType:"integration"},template:{type:"config",content:JSON.stringify({outcome:{skillName:e.skillName,trustTier:e.trustTier,validationLevel:e.validationLevel,model:e.model,passed:e.passed,score:e.score,testCaseCount:e.testCaseResults.length,passedTests:e.testCaseResults.filter(a=>a.passed).length,avgReasoningQuality:this.calculateAvgReasoningQuality(e.testCaseResults),timestamp:e.timestamp.toISOString(),runId:e.runId,metadata:e.metadata}}),variables:[]}}),await this.updateSkillConfidence(e),e.validationLevel==="eval"&&await this.trackCrossModelBehavior(e),this.feedbackLoop&&e.runId&&await this.recordToFeedbackLoop(e)}async updateSkillConfidence(e){let a=`skill-confidence-${e.skillName}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1}),t;if(s.success&&s.value.length>0)try{let i=s.value[0].pattern.template?.content;if(i){let r=m(i);r&&typeof r=="object"&&Array.isArray(r.outcomes)?t=r:t=this.createEmptyConfidence(e.skillName)}else t=this.createEmptyConfidence(e.skillName)}catch(n){g.debug("Confidence history parse failed",{skill:e.skillName,error:n instanceof Error?n.message:String(n)}),t=this.createEmptyConfidence(e.skillName)}else t=this.createEmptyConfidence(e.skillName);t.outcomes.push({score:e.score,timestamp:e.timestamp,model:e.model,validationLevel:e.validationLevel,passed:e.passed}),t.outcomes.length>100&&(t.outcomes=t.outcomes.slice(-100)),t.avgScore=t.outcomes.reduce((n,i)=>n+i.score,0)/t.outcomes.length,t.lastUpdated=new Date,t.trend=this.calculateTrend(t.outcomes),t.byLevel=this.calculateConfidenceByLevel(t.outcomes),await this.reasoningBank.storeQEPattern({patternType:"test-template",name:a,description:`Skill confidence tracking for ${e.skillName}`,context:{tags:["skill-confidence",e.skillName]},template:{type:"config",content:JSON.stringify(t),variables:[]}})}async trackCrossModelBehavior(e){let a=`cross-model-${e.skillName}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1}),t;if(s.success&&s.value.length>0)try{let l=s.value[0].pattern.template?.content;l?t=this.parseCrossModelAnalysis(l)??this.createEmptyCrossModelAnalysis():t=this.createEmptyCrossModelAnalysis()}catch(o){g.debug("Cross-model analysis parse failed",{error:o instanceof Error?o.message:String(o)}),t=this.createEmptyCrossModelAnalysis()}else t=this.createEmptyCrossModelAnalysis();t.models||(t.models=u());let n=C(t.models,e.model)??{scores:[],passRate:0,avgReasoningQuality:0,sampleCount:0};R(t.models,e.model,n),n.scores.push(e.score),n.sampleCount++,n.scores.length>50&&(n.scores=n.scores.slice(-50));let i=this.calculateAvgReasoningQuality(e.testCaseResults);n.passRate=n.scores.filter(o=>o>=.9).length/n.scores.length,n.avgReasoningQuality=(n.avgReasoningQuality*(n.sampleCount-1)+i)/n.sampleCount;let r=Object.values(t.models).map(o=>o.passRate);if(r.length>1){let o=r.reduce((d,c)=>d+c,0)/r.length,l=r.reduce((d,c)=>d+Math.pow(c-o,2),0)/r.length;t.variance=l,t.hasAnomalies=l>.04,t.anomalies=[];for(let[d,c]of Object.entries(t.models))Math.abs(c.passRate-o)>.2&&t.anomalies.push({model:d,type:c.passRate<o?"low_performance":"high_variance",description:`Model ${d} has ${((c.passRate-o)*100).toFixed(1)}% difference from average`})}t.lastUpdated=new Date,await this.reasoningBank.storeQEPattern({patternType:"test-template",name:a,description:`Cross-model behavior tracking for ${e.skillName}`,context:{tags:["cross-model",e.skillName]},template:{type:"config",content:JSON.stringify(t),variables:[]}})}async recordToFeedbackLoop(e){if(!this.feedbackLoop)return;let a={taskId:e.runId,taskDescription:`Skill validation: ${e.skillName} (${e.validationLevel})`,recommendedAgent:"skill-validator",usedAgent:"skill-validator",followedRecommendation:!0,success:e.passed,qualityScore:e.score,durationMs:e.metadata?.duration||0,timestamp:e.timestamp};await this.feedbackLoop.recordRoutingOutcome(a)}async getSkillConfidence(e){let a=`skill-confidence-${e}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1});if(s.success&&s.value.length>0)try{let t=s.value[0].pattern.template?.content;if(t)return m(t)}catch(t){g.debug("Skill confidence pattern content invalid",{skill:e,error:t instanceof Error?t.message:String(t)})}return null}async getCrossModelAnalysis(e){let a=`cross-model-${e}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1});if(s.success&&s.value.length>0)try{let t=s.value[0].pattern.template?.content;if(t)return this.parseCrossModelAnalysis(t)}catch(t){g.debug("Cross-model pattern content invalid",{skill:e,error:t instanceof Error?t.message:String(t)})}return null}async queryValidationPatterns(e,a=10){let s=await this.reasoningBank.searchQEPatterns(`${e} validation`,{limit:a});return s.success?s.value.filter(t=>t.pattern.context?.tags?.includes("skill-validation")).map(t=>t.pattern):[]}async getValidationTrends(e){let a=await this.getSkillConfidence(e),s=await this.getCrossModelAnalysis(e);if(!a)return null;let t=u();if(s)for(let r of Object.keys(s.models)){let o=a.outcomes.filter(l=>l.model===r).map(l=>({score:l.score}));t[r]=this.calculateTrend(o)}let n=a.outcomes.slice(-20),i=n.filter(r=>r.passed).length/n.length;return{overall:a.trend||"stable",byModel:t,recentPassRate:i}}async extractLearnedPatterns(e){let a=await this.queryValidationPatterns(e,50),s=[],t=new Map;for(let n of a)try{let r=m(n.template?.content||"{}").outcome?.metadata?.category||"general";t.has(r)||t.set(r,[]),t.get(r).push(n)}catch(i){g.debug("Invalid pattern during category grouping",{error:i instanceof Error?i.message:String(i)})}for(let[n,i]of Array.from(t.entries())){let r=new Set,o=new Set,l=new Set,d=0;for(let c of i)try{let v=m(c.template?.content||"{}").outcome;if(!v)continue;l.add(v.model),d+=v.score;let k=c.context?.tags||[];v.passed?k.filter(p=>!["skill-validation",e].includes(p)).forEach(p=>r.add(p)):k.filter(p=>!["skill-validation",e].includes(p)).forEach(p=>o.add(p))}catch(f){g.debug("Invalid pattern during category extraction",{error:f instanceof Error?f.message:String(f)})}i.length>0&&s.push({id:`${e}-${n}`,skillName:e,category:n,successIndicators:Array.from(r),failureIndicators:Array.from(o),models:Array.from(l),confidence:d/i.length,observationCount:i.length})}return s}createEmptyConfidence(e){return{skillName:e,avgScore:0,outcomes:[],lastUpdated:new Date}}parseCrossModelAnalysis(e){let a=JSON.parse(e,(s,t)=>t!==null&&typeof t=="object"&&!Array.isArray(t)?Object.assign(u(),t):t);return a&&typeof a=="object"&&a.models&&typeof a.models=="object"&&!Array.isArray(a.models)?a:null}createEmptyCrossModelAnalysis(){return{models:u(),variance:0,hasAnomalies:!1,lastUpdated:new Date}}calculateAvgReasoningQuality(e){return e.length===0?0:e.reduce((a,s)=>a+s.reasoningQuality,0)/e.length}calculateTrend(e){if(e.length<5)return"stable";let a=e.slice(-10),s=e.slice(-20,-10);if(s.length===0)return"stable";let t=a.reduce((r,o)=>r+o.score,0)/a.length,n=s.reduce((r,o)=>r+o.score,0)/s.length,i=t-n;return i>.05?"improving":i<-.05?"declining":"stable"}calculateConfidenceByLevel(e){let a={schema:[],validator:[],eval:[]};for(let t of e)t.validationLevel&&a[t.validationLevel].push(t.score);let s={};for(let[t,n]of Object.entries(a))n.length>0&&(s[t]=n.reduce((i,r)=>i+r,0)/n.length);return s}};function Q(h){return new y(h)}export{Q as a};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{b as m,d as A}from"./chunk-CMN7PU2H.js";import{a as u,b as C,c as R,e as S}from"./chunk-YKRLUTK7.js";import{a as P}from"./chunk-TIVKDIF7.js";import{c as b}from"./chunk-DS5IFRY6.js";A();S();P();var g=b.create("skill-validation-learner"),y=class{constructor(e){this.reasoningBank=e}reasoningBank;memoryNamespace="skill-validation";feedbackLoop=null;connectFeedbackLoop(e){this.feedbackLoop=e}async recordValidationOutcome(e){await this.reasoningBank.storeQEPattern({patternType:"test-template",name:`${e.skillName}-validation-${e.validationLevel}`,description:`Validation outcome for ${e.skillName} at level ${e.validationLevel}`,context:{tags:["skill-validation",e.skillName,e.model,e.validationLevel],testType:"integration"},template:{type:"config",content:JSON.stringify({outcome:{skillName:e.skillName,trustTier:e.trustTier,validationLevel:e.validationLevel,model:e.model,passed:e.passed,score:e.score,testCaseCount:e.testCaseResults.length,passedTests:e.testCaseResults.filter(a=>a.passed).length,avgReasoningQuality:this.calculateAvgReasoningQuality(e.testCaseResults),timestamp:e.timestamp.toISOString(),runId:e.runId,metadata:e.metadata}}),variables:[]}}),await this.updateSkillConfidence(e),e.validationLevel==="eval"&&await this.trackCrossModelBehavior(e),this.feedbackLoop&&e.runId&&await this.recordToFeedbackLoop(e)}async updateSkillConfidence(e){let a=`skill-confidence-${e.skillName}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1}),t;if(s.success&&s.value.length>0)try{let i=s.value[0].pattern.template?.content;if(i){let r=m(i);r&&typeof r=="object"&&Array.isArray(r.outcomes)?t=r:t=this.createEmptyConfidence(e.skillName)}else t=this.createEmptyConfidence(e.skillName)}catch(n){g.debug("Confidence history parse failed",{skill:e.skillName,error:n instanceof Error?n.message:String(n)}),t=this.createEmptyConfidence(e.skillName)}else t=this.createEmptyConfidence(e.skillName);t.outcomes.push({score:e.score,timestamp:e.timestamp,model:e.model,validationLevel:e.validationLevel,passed:e.passed}),t.outcomes.length>100&&(t.outcomes=t.outcomes.slice(-100)),t.avgScore=t.outcomes.reduce((n,i)=>n+i.score,0)/t.outcomes.length,t.lastUpdated=new Date,t.trend=this.calculateTrend(t.outcomes),t.byLevel=this.calculateConfidenceByLevel(t.outcomes),await this.reasoningBank.storeQEPattern({patternType:"test-template",name:a,description:`Skill confidence tracking for ${e.skillName}`,context:{tags:["skill-confidence",e.skillName]},template:{type:"config",content:JSON.stringify(t),variables:[]}})}async trackCrossModelBehavior(e){let a=`cross-model-${e.skillName}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1}),t;if(s.success&&s.value.length>0)try{let l=s.value[0].pattern.template?.content;l?t=this.parseCrossModelAnalysis(l)??this.createEmptyCrossModelAnalysis():t=this.createEmptyCrossModelAnalysis()}catch(o){g.debug("Cross-model analysis parse failed",{error:o instanceof Error?o.message:String(o)}),t=this.createEmptyCrossModelAnalysis()}else t=this.createEmptyCrossModelAnalysis();t.models||(t.models=u());let n=C(t.models,e.model)??{scores:[],passRate:0,avgReasoningQuality:0,sampleCount:0};R(t.models,e.model,n),n.scores.push(e.score),n.sampleCount++,n.scores.length>50&&(n.scores=n.scores.slice(-50));let i=this.calculateAvgReasoningQuality(e.testCaseResults);n.passRate=n.scores.filter(o=>o>=.9).length/n.scores.length,n.avgReasoningQuality=(n.avgReasoningQuality*(n.sampleCount-1)+i)/n.sampleCount;let r=Object.values(t.models).map(o=>o.passRate);if(r.length>1){let o=r.reduce((d,c)=>d+c,0)/r.length,l=r.reduce((d,c)=>d+Math.pow(c-o,2),0)/r.length;t.variance=l,t.hasAnomalies=l>.04,t.anomalies=[];for(let[d,c]of Object.entries(t.models))Math.abs(c.passRate-o)>.2&&t.anomalies.push({model:d,type:c.passRate<o?"low_performance":"high_variance",description:`Model ${d} has ${((c.passRate-o)*100).toFixed(1)}% difference from average`})}t.lastUpdated=new Date,await this.reasoningBank.storeQEPattern({patternType:"test-template",name:a,description:`Cross-model behavior tracking for ${e.skillName}`,context:{tags:["cross-model",e.skillName]},template:{type:"config",content:JSON.stringify(t),variables:[]}})}async recordToFeedbackLoop(e){if(!this.feedbackLoop)return;let a={taskId:e.runId,taskDescription:`Skill validation: ${e.skillName} (${e.validationLevel})`,recommendedAgent:"skill-validator",usedAgent:"skill-validator",followedRecommendation:!0,success:e.passed,qualityScore:e.score,durationMs:e.metadata?.duration||0,timestamp:e.timestamp};await this.feedbackLoop.recordRoutingOutcome(a)}async getSkillConfidence(e){let a=`skill-confidence-${e}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1});if(s.success&&s.value.length>0)try{let t=s.value[0].pattern.template?.content;if(t)return m(t)}catch(t){g.debug("Skill confidence pattern content invalid",{skill:e,error:t instanceof Error?t.message:String(t)})}return null}async getCrossModelAnalysis(e){let a=`cross-model-${e}`,s=await this.reasoningBank.searchQEPatterns(a,{limit:1});if(s.success&&s.value.length>0)try{let t=s.value[0].pattern.template?.content;if(t)return this.parseCrossModelAnalysis(t)}catch(t){g.debug("Cross-model pattern content invalid",{skill:e,error:t instanceof Error?t.message:String(t)})}return null}async queryValidationPatterns(e,a=10){let s=await this.reasoningBank.searchQEPatterns(`${e} validation`,{limit:a});return s.success?s.value.filter(t=>t.pattern.context?.tags?.includes("skill-validation")).map(t=>t.pattern):[]}async getValidationTrends(e){let a=await this.getSkillConfidence(e),s=await this.getCrossModelAnalysis(e);if(!a)return null;let t=u();if(s)for(let r of Object.keys(s.models)){let o=a.outcomes.filter(l=>l.model===r).map(l=>({score:l.score}));t[r]=this.calculateTrend(o)}let n=a.outcomes.slice(-20),i=n.filter(r=>r.passed).length/n.length;return{overall:a.trend||"stable",byModel:t,recentPassRate:i}}async extractLearnedPatterns(e){let a=await this.queryValidationPatterns(e,50),s=[],t=new Map;for(let n of a)try{let r=m(n.template?.content||"{}").outcome?.metadata?.category||"general";t.has(r)||t.set(r,[]),t.get(r).push(n)}catch(i){g.debug("Invalid pattern during category grouping",{error:i instanceof Error?i.message:String(i)})}for(let[n,i]of Array.from(t.entries())){let r=new Set,o=new Set,l=new Set,d=0;for(let c of i)try{let v=m(c.template?.content||"{}").outcome;if(!v)continue;l.add(v.model),d+=v.score;let k=c.context?.tags||[];v.passed?k.filter(p=>!["skill-validation",e].includes(p)).forEach(p=>r.add(p)):k.filter(p=>!["skill-validation",e].includes(p)).forEach(p=>o.add(p))}catch(f){g.debug("Invalid pattern during category extraction",{error:f instanceof Error?f.message:String(f)})}i.length>0&&s.push({id:`${e}-${n}`,skillName:e,category:n,successIndicators:Array.from(r),failureIndicators:Array.from(o),models:Array.from(l),confidence:d/i.length,observationCount:i.length})}return s}createEmptyConfidence(e){return{skillName:e,avgScore:0,outcomes:[],lastUpdated:new Date}}parseCrossModelAnalysis(e){let a=JSON.parse(e,(s,t)=>t!==null&&typeof t=="object"&&!Array.isArray(t)?Object.assign(u(),t):t);return a&&typeof a=="object"&&a.models&&typeof a.models=="object"&&!Array.isArray(a.models)?a:null}createEmptyCrossModelAnalysis(){return{models:u(),variance:0,hasAnomalies:!1,lastUpdated:new Date}}calculateAvgReasoningQuality(e){return e.length===0?0:e.reduce((a,s)=>a+s.reasoningQuality,0)/e.length}calculateTrend(e){if(e.length<5)return"stable";let a=e.slice(-10),s=e.slice(-20,-10);if(s.length===0)return"stable";let t=a.reduce((r,o)=>r+o.score,0)/a.length,n=s.reduce((r,o)=>r+o.score,0)/s.length,i=t-n;return i>.05?"improving":i<-.05?"declining":"stable"}calculateConfidenceByLevel(e){let a={schema:[],validator:[],eval:[]};for(let t of e)t.validationLevel&&a[t.validationLevel].push(t.score);let s={};for(let[t,n]of Object.entries(a))n.length>0&&(s[t]=n.reduce((i,r)=>i+r,0)/n.length);return s}};function Q(h){return new y(h)}export{Q as a};
@@ -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.16");process.exit(0)}
2
- import{a as h}from"./chunk-MD43XRX5.js";import{a as C,f as x}from"./chunk-OCV2XEWQ.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.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.17");process.exit(0)}
2
+ import{a as h}from"./chunk-VQFV2IPV.js";import{a as C,f as x}from"./chunk-IJZFJPHS.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
3
3
  `).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
@@ -0,0 +1,6 @@
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.17");process.exit(0)}
2
+ import{a as P,b as k,c as J,d as M}from"./chunk-OWIQR6N2.js";import{c as S,d as _}from"./chunk-EPVPXHL7.js";import{b as A,d as z}from"./chunk-CMN7PU2H.js";import{c as y,d as g}from"./chunk-REY52O7J.js";import{c as j,d as X}from"./chunk-GPPTRKEM.js";import{c as d,e as v}from"./chunk-J7Q5TXFZ.js";v();var B='expected [{ "functionName": "add", "args": [2, 3], "expected": 5 }]',Pt={type:"object",description:"One caller-owned specification example",properties:{functionName:{type:"string",description:"Named export of the source file to call"},args:{type:"array",description:"Positional JSON arguments; length must equal the function arity",items:{}},expected:{description:"Expected JSON return value (use null for a null result)"}},required:["functionName","args","expected"]};function q(t,n="Behavior example value"){let r=(e,s)=>{if(!(e===null||typeof e=="string"||typeof e=="boolean")&&!(typeof e=="number"&&Number.isFinite(e)&&!Object.is(e,-0))){if(typeof e!="object"||s.has(e))throw new d(`${n} must be finite JSON data (no undefined, functions, NaN/Infinity, cycles, or negative zero)`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new d(`${n} must contain only plain JSON objects`);s.add(e);for(let o of Array.isArray(e)?Array.from(e):Object.values(e))r(o,s);s.delete(e)}};r(t,new Set)}function xt(t){if(t!==void 0){if(!Array.isArray(t))throw new d(`behaviorExamples must be an array; ${B}`);return t.forEach((n,r)=>{let e=`behaviorExamples[${r}]`;if(typeof n!="object"||n===null||Array.isArray(n))throw new d(`${e} must be an object; ${B}`);let s=n;if(typeof s.functionName!="string"||s.functionName.trim()==="")throw new d(`${e}.functionName must be a non-empty string`);if(!Array.isArray(s.args))throw new d(`${e}.args must be an array of arguments`);if(!Object.prototype.hasOwnProperty.call(s,"expected"))throw new d(`${e}.expected is required (use null for a null result)`);q(s.args,`${e}.args`),q(s.expected,`${e}.expected`)}),t}}X();v();import{existsSync as $,readFileSync as it,realpathSync as at,statSync as G}from"node:fs";import*as f from"node:path";import{existsSync as V,mkdtempSync as W,readFileSync as Q,rmSync as K,statSync as Z}from"node:fs";import{tmpdir as tt}from"node:os";import*as h from"node:path";function T(t){return/\.py$/i.test(t)}function D(t,n){let r=process.platform==="win32"?[`${t}.exe`,`${t}.cmd`,t]:[t];for(let e of(n.PATH??n.Path??"").split(h.delimiter))if(e)for(let s of r)try{if(Z(h.join(e,s)).isFile())return!0}catch{}return!1}function C(t=process.env){let n=t.AQE_PYTHON?.trim();return n||(D("python",t)?"python":D("python3",t)?"python3":"python")}var $t={PY_COLORS:"0"};function Nt(t,n,r=process.env){return{command:C(r),args:["-m","pytest",...t,`--junitxml=${n}`,"--color=no"]}}function Ft(){let t=W(h.join(tt(),"aqe-pytest-report-")),n=h.join(t,"junit.xml"),r=!1;return{path:n,args:[],read:()=>{if(!V(n))return;let e=Q(n,"utf-8");if(!/<testsuite\b/.test(e))throw new P("The current pytest JUnit report is malformed.");return e},cleanup:()=>{if(!r){r=!0;try{K(t,{recursive:!0,force:!0})}catch{}}}}}function H(t){return t.replace(/&(#x[0-9a-f]+|#\d+|lt|gt|amp|quot|apos);/gi,(n,r)=>{let e=r.toLowerCase();if(e==="lt")return"<";if(e==="gt")return">";if(e==="amp")return"&";if(e==="quot")return'"';if(e==="apos")return"'";let s=e.startsWith("#x")?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Number.isFinite(s)&&s>=0&&s<=1114111?String.fromCodePoint(s):""})}function Y(t){let n={};for(let r of t.matchAll(/([\w:.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g))n[r[1]]=H(r[2]??r[3]??"");return n}function et(t){if(!/<testsuite\b/.test(t))throw new Error("Not a JUnit XML report: no <testsuite> element.");let n=[],r=/<testcase\b((?:[^>"']|"[^"]*"|'[^']*')*?)(?:\/>|>([\s\S]*?)<\/testcase>)/g;for(let e of t.matchAll(r)){let s=Y(e[1]),o=e[2]??"",a=m=>o.match(new RegExp(`<${m}\\b((?:[^>"']|"[^"]*"|'[^']*')*?)(?:\\/>|>([\\s\\S]*?)<\\/${m}>)`)),i=a("error"),u=a("failure"),l=a("skipped"),p=i??u??l,b=i?"error":u?"failed":l?"skipped":"passed",w=Number.parseFloat(s.time??""),R=p?Y(p[1]).message:void 0,c=p?.[2]!==void 0?H(p[2]).trim():void 0;n.push({classname:s.classname??"",name:s.name??"",status:b,...Number.isFinite(w)?{duration:Math.round(w*1e3)}:{},...R?{message:R}:{},...c?{details:c}:{}})}return n}function nt(t){return t.status==="error"&&(t.classname===""||t.message==="collection failure")}function rt(t){return t.replace(/\.py$/i,"").split(/[\\/]+/).filter(Boolean)}function st(t,n){let r=t.classname?t.classname.split("."):[],e;for(let s of n){let o=rt(s);for(let a=Math.min(r.length,o.length);a>0;a--)if(o.slice(o.length-a).every((u,l)=>u===r[l])){(!e||a>e.matched)&&(e={file:s,matched:a});break}}return e?{file:e.file,name:[...r.slice(e.matched),t.name].join("::")}:{file:n.length===1?n[0]:n.join(", "),name:t.classname?`${t.classname}::${t.name}`:t.name}}var ot={2:"was interrupted (for example by a collection error)",3:"hit an internal error",4:"rejected its command line",5:"collected no tests"};function Ot(t,n,r,e,s=C()){let o=n.join(", ");if(t===void 0){let c=/No module named pytest/.test(e);return g(new P(`pytest wrote no JUnit report for ${o} (exit code ${r??"unknown"}).`+(c?` pytest is not installed for '${s}'; install it, or set AQE_PYTHON to an interpreter that has it.`:` Check that '${s} -m pytest' runs; set AQE_PYTHON to choose the interpreter.`)+(e.trim()?`
3
+ ${k(e.trim())}`:"")))}let a;try{a=et(t)}catch(c){return g(new P(`Could not read the pytest JUnit report for ${o}: ${c instanceof Error?c.message:String(c)}`))}let i=a.filter(nt),u=r!==null?ot[r]:void 0;if(u||i.length>0){let c=i.map(m=>`${m.name}: ${m.details??m.message??"collection failure"}`);return g(new P(`pytest ${u??"reported a collection error"} for ${o} (exit code ${r??"unknown"}).
4
+ ${k([...c,e.trim()].filter(Boolean).join(`
5
+ `))}`))}let l=a.map(c=>{let{file:m,name:U}=st(c,n),O=c.status==="failed"||c.status==="error",I=O?[c.message,c.details].filter(Boolean).join(`
6
+ `)||"Test failed":void 0;return{name:U,file:m,status:O?"failed":c.status==="skipped"?"skipped":"passed",...c.duration!==void 0?{duration:c.duration}:{},...I?{failureMessage:I}:{}}}),p=l.filter(c=>c.status==="passed").length,b=l.filter(c=>c.status==="failed").length,w=l.filter(c=>c.status==="skipped").length,R=J("pytest",o,r,{passed:p,failed:b,skipped:w},e);return R?g(R):y({total:l.length,passed:p,failed:b,skipped:w,tests:l})}z();var E=["ts","mts","cts","js","mjs","cjs"],ct=[...E.map(t=>`vitest.config.${t}`),...[...E,"json"].map(t=>`vitest.workspace.${t}`),...E.map(t=>`jest.config.${t}`),"jest.config.json"],ut=E.map(t=>`vite.config.${t}`),ft=1024*1024;function x(t){try{return at(t)}catch{return f.resolve(t)}}function N(t,n){let r=f.relative(t,n);return r===""||r!==".."&&!r.startsWith(`..${f.sep}`)&&!f.isAbsolute(r)}function F(t){try{let n=G(t);return!n.isFile()||n.size>ft?void 0:it(t,"utf-8")}catch{return}}function lt(t){let n=F(f.join(t,"package.json"));if(n===void 0)return[];let r;try{r=A(n)}catch{return[]}return!r||typeof r!="object"?[]:["vitest","jest"].filter(e=>r[e]!==void 0)}function pt(t){return ut.some(n=>{let r=F(f.join(t,n));return r!==void 0&&/\btest\s*:/.test(r)})}function L(t){let n=new Set(lt(t));for(let r of ct)$(f.join(t,r))&&n.add(r.startsWith("jest.")?"jest":"vitest");return!n.has("vitest")&&pt(t)&&n.add("vitest"),n}function dt(t){return L(t).size>0}var mt=[["pytest.ini",void 0],["pyproject.toml",/^\s*\[tool\.pytest(?:\.ini_options)?\]/m],["tox.ini",/^\s*\[pytest\]/m],["setup.cfg",/^\s*\[tool:pytest\]/m]];function gt(t,n=!1){return n&&$(f.join(t,"conftest.py"))?!0:mt.some(([r,e])=>{if(!e)return $(f.join(t,r));let s=F(f.join(t,r));return s!==void 0&&e.test(s)})}function Ct(t,n=j()){let r=x(n),e=x(t),s=N(r,e);for(;;){let o=L(e);if(o.size>0)return o.size===1?[...o][0]:void 0;if(!s||e===r)return;let a=f.dirname(e);if(a===e)return;e=a}}function yt(t,n,r=process.cwd(),e=new Map){let s=x(n),o=f.dirname(M(t,r));if(!N(s,o))return;let a=T(t);for(;;){let i=a?`pytest:${o}`:o,u=e.get(i);if(u===void 0&&(u=a?gt(o):dt(o),e.set(i,u)),u)return o;if(o===s)return;let l=f.dirname(o);if(l===o)return;o=l}}function ht(t,n={}){let r=n.cwd??process.cwd(),e=yt(t,n.boundary??j(),r,n.checked);return!e||N(e,x(r))?r:e}function Ht(t,n={}){let r={cwd:n.cwd??process.cwd(),boundary:n.boundary??j(),checked:n.checked??new Map},e=new Map;for(let s of t){let o=ht(s,r),a=`${T(s)?"py":"js"}\0${o}`,i=e.get(a);i?i.files.push(s):e.set(a,{cwd:o,files:[s]})}return[...e.values()]}async function Gt(t,n,r){let e={allowMissing:!0,allowDirectory:!0};if(r===void 0){let i=await S(t,"testFiles",n,e);return i.success?y({testFiles:i.value}):i}let s=await wt(t,r);if(!s.success)return s;let o=s.value,a=await S(t,"testFiles",n,{...e,basePath:o});return a.success?y({testFiles:a.value.map(i=>f.resolve(o,i)),projectRoot:o}):a}async function wt(t,n){let r=await _(t,"projectRoot",n,{allowDirectory:!0});if(!r.success)return r;let e=f.resolve(x(process.cwd()),r.value),s=!1;try{s=G(e).isDirectory()}catch{}return s?y(e):g(new d(`Invalid ${t} payload: 'projectRoot' must be a directory inside the project.`))}function Ut(t,n){let r=new Map(t.failedTests.map(i=>[i.testId,i])),e=n.tests??[],s={totalRetries:n.retried,nowPassing:n.nowPassing,stillFailing:n.stillFailing,tests:e.map(({testId:i,...u})=>({name:r.get(i)?.testName??i,file:r.get(i)?.file??"",...u}))};t.retries=s;let o=new Set(e.filter(i=>i.passed&&!i.unmatched).map(i=>i.testId)),a=t.failedTests.filter(i=>o.has(i.testId));if(a.length!==0&&(t.failedTests=t.failedTests.filter(i=>!o.has(i.testId)),t.failed=Math.max(0,t.failed-a.length),t.passed+=a.length,t.flaky=(t.flaky??0)+a.length,t.failed===0&&t.status==="failed"&&(t.status="passed"),t.testCases)){let i=[...a];t.testCases=t.testCases.map(u=>{if(u.status!=="failed")return u;let l=i.findIndex(p=>p.testName===u.name&&p.file===u.file);return l<0?u:(i.splice(l,1),{...u,status:"passed",flaky:!0})})}}export{Pt as a,q as b,xt as c,T as d,$t as e,Nt as f,Ft as g,et as h,Ot as i,Ct as j,ht as k,Ht as l,Gt as m,wt as n,Ut as o};
@@ -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.16");process.exit(0)}
2
- import{b as t}from"./chunk-AJMJNQMP.js";function o(e){try{return e.prepare(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{b as t}from"./chunk-Z7SKUC6P.js";function o(e){try{return e.prepare(`
3
3
  SELECT COUNT(*) as count FROM sqlite_master
4
4
  WHERE type='table' AND name IN ('hypergraph_nodes', 'hypergraph_edges')
5
5
  `).get().count===2}catch{return!1}}var r,a,E,n,p=t(()=>{"use strict";r=`
@@ -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.16");process.exit(0)}
2
- import{c as m}from"./chunk-QPEOLAAS.js";import{existsSync as g,readFileSync as _,readdirSync as w,statSync as T}from"fs";import{join as c,extname as E}from"path";var v=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"]),F=[".test.",".spec.","_test.","_spec."],b=new Set(["node_modules","dist","build","coverage",".git","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".next",".nuxt",".output"]);function W(s,n={}){let{maxDepth:r=6,includeTests:x=!1,testsOnly:y=!1,extraExtensions:S=[]}=n;if(!g(s))return[];let a=T(s);if(a.isFile())return[s];if(!a.isDirectory())return[];let h=new Set(S.map(e=>e.startsWith(".")?e:`.${e}`)),i=[];function u(e,o){if(o>r)return;let l;try{l=w(e,{withFileTypes:!0})}catch{return}for(let t of l)if(t.isDirectory()){if(b.has(t.name)||m(e,t.name,o===0))continue;u(c(e,t.name),o+1)}else if(t.isFile()){let f=E(t.name).toLowerCase();if(!(v.has(f)||h.has(f))||t.name.endsWith(".d.ts"))continue;let p=F.some(d=>t.name.includes(d))||t.name.startsWith("test_");y?p&&i.push(c(e,t.name)):(x||!p)&&i.push(c(e,t.name))}}return u(s,0),i}function I(s,n){return n!=="node"&&n!=="node-test"?s:s.filter(r=>{try{return!/@playwright\/test|require\(\s*['"]playwright['"]\s*\)/.test(_(r,"utf8"))}catch{return!0}})}export{v as a,W as b,I as c};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.17");process.exit(0)}
2
+ import{c as m}from"./chunk-NQFDJ6BT.js";import{existsSync as g,readFileSync as _,readdirSync as w,statSync as T}from"fs";import{join as c,extname as E}from"path";var v=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"]),F=[".test.",".spec.","_test.","_spec."],b=new Set(["node_modules","dist","build","coverage",".git","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".next",".nuxt",".output"]);function W(s,n={}){let{maxDepth:r=6,includeTests:x=!1,testsOnly:y=!1,extraExtensions:S=[]}=n;if(!g(s))return[];let a=T(s);if(a.isFile())return[s];if(!a.isDirectory())return[];let h=new Set(S.map(e=>e.startsWith(".")?e:`.${e}`)),i=[];function u(e,o){if(o>r)return;let l;try{l=w(e,{withFileTypes:!0})}catch{return}for(let t of l)if(t.isDirectory()){if(b.has(t.name)||m(e,t.name,o===0))continue;u(c(e,t.name),o+1)}else if(t.isFile()){let f=E(t.name).toLowerCase();if(!(v.has(f)||h.has(f))||t.name.endsWith(".d.ts"))continue;let p=F.some(d=>t.name.includes(d))||t.name.startsWith("test_");y?p&&i.push(c(e,t.name)):(x||!p)&&i.push(c(e,t.name))}}return u(s,0),i}function I(s,n){return n!=="node"&&n!=="node-test"?s:s.filter(r=>{try{return!/@playwright\/test|require\(\s*['"]playwright['"]\s*\)/.test(_(r,"utf8"))}catch{return!0}})}export{v as a,W as b,I as c};