agentic-qe 3.15.14 → 3.15.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (513) hide show
  1. package/.claude/agents/v3/templates/qx-report-template.html +1 -1
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +136 -0
  4. package/assets/agents/v3/templates/qx-report-template.html +1 -1
  5. package/assets/skills/skills-manifest.json +1 -1
  6. package/dist/audit/witness-chain.d.ts +7 -0
  7. package/dist/audit/witness-chain.js +10 -0
  8. package/dist/cli/bundle.js +6 -6
  9. package/dist/cli/chunks/adapter-6CQ2PIP5.js +2 -0
  10. package/dist/cli/chunks/agent-booster-wasm-45NWEKVS.js +2 -0
  11. package/dist/cli/chunks/{agent-handler-P3IY7XEE.js → agent-handler-LVHMYFEF.js} +2 -2
  12. package/dist/cli/chunks/{agent-memory-branch-WWKC2H3G.js → agent-memory-branch-YDWOJFEQ.js} +2 -2
  13. package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +2 -0
  14. package/dist/cli/chunks/{arena-EIV5OALF.js → arena-CZKHXDDS.js} +2 -2
  15. package/dist/cli/chunks/{arena-4BMFF6BS.js → arena-ELDZH3CZ.js} +4 -4
  16. package/dist/cli/chunks/{audit-DNTI453H.js → audit-5MT4T47Z.js} +3 -3
  17. package/dist/cli/chunks/base-SMCMMVGP.js +2 -0
  18. package/dist/cli/chunks/{better-sqlite3-TQBQGNC6.js → better-sqlite3-6TGYPC2B.js} +2 -2
  19. package/dist/cli/chunks/{brain-handler-HY57CNAO.js → brain-handler-HQWZFO52.js} +3 -3
  20. package/dist/cli/chunks/{branch-enumerator-THPMZPHQ.js → branch-enumerator-WVILM4SO.js} +2 -2
  21. package/dist/cli/chunks/{browser-O6JJOZCK.js → browser-RX5ALU3H.js} +2 -2
  22. package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +2 -0
  23. package/dist/cli/chunks/{chunk-CIINJHOX.js → chunk-24OX5TQJ.js} +1 -1
  24. package/dist/cli/chunks/{chunk-6P4Q4RTC.js → chunk-24QHCVX6.js} +1 -1
  25. package/dist/cli/chunks/{chunk-U6IOQKCT.js → chunk-2H4XH6FT.js} +2 -2
  26. package/dist/cli/chunks/{chunk-OGEIHS76.js → chunk-2YZ4G6NW.js} +1 -1
  27. package/dist/cli/chunks/chunk-32BPDLRZ.js +27 -0
  28. package/dist/cli/chunks/{chunk-5PLBQZ5J.js → chunk-32GN3JKR.js} +1 -1
  29. package/dist/cli/chunks/{chunk-AJVLVF7V.js → chunk-3HD7E6HN.js} +2 -2
  30. package/dist/cli/chunks/{chunk-X7CUI7KH.js → chunk-4D4DENG6.js} +2 -2
  31. package/dist/cli/chunks/{chunk-E2JLAW3U.js → chunk-4LQFBY5L.js} +6 -6
  32. package/dist/cli/chunks/{chunk-E3QIQMMN.js → chunk-4NFQLP6R.js} +1 -1
  33. package/dist/cli/chunks/{chunk-7Y3LXH57.js → chunk-525CFDUE.js} +2 -2
  34. package/dist/cli/chunks/chunk-5B5QPCNU.js +65 -0
  35. package/dist/cli/chunks/{chunk-X6Q2N5S5.js → chunk-5JZRZI4S.js} +2 -2
  36. package/dist/cli/chunks/{chunk-MB4UKUBV.js → chunk-5LAVKGLH.js} +2 -2
  37. package/dist/cli/chunks/chunk-5NNNEWLS.js +755 -0
  38. package/dist/cli/chunks/{chunk-NKOLILT7.js → chunk-5PBLPQ5T.js} +2 -2
  39. package/dist/cli/chunks/chunk-5QO3R3TU.js +6 -0
  40. package/dist/cli/chunks/{chunk-7T6L3LFN.js → chunk-5SPCGMBB.js} +2 -2
  41. package/dist/cli/chunks/{chunk-2QLE6NDW.js → chunk-5V3TI2LG.js} +1 -1
  42. package/dist/cli/chunks/{chunk-A2T56XVL.js → chunk-5VZL4UVN.js} +2 -2
  43. package/dist/cli/chunks/{chunk-TWOV3I3A.js → chunk-63GMRQ25.js} +1 -1
  44. package/dist/cli/chunks/{chunk-YGOSSVY5.js → chunk-63ZKI4PX.js} +6 -6
  45. package/dist/cli/chunks/{chunk-FHPNWHY7.js → chunk-67Z5R7RJ.js} +2 -2
  46. package/dist/cli/chunks/{chunk-PCQZIAXB.js → chunk-6DPYNAOK.js} +2 -2
  47. package/dist/cli/chunks/{chunk-WCM6WE7G.js → chunk-6ICX3FEG.js} +3 -3
  48. package/dist/cli/chunks/{chunk-JB7R77SH.js → chunk-6XXZDV2C.js} +2 -2
  49. package/dist/cli/chunks/{chunk-FJOIBZUB.js → chunk-6ZBXSOX6.js} +2 -2
  50. package/dist/cli/chunks/{chunk-WZQADC5R.js → chunk-72XSEQMW.js} +2 -2
  51. package/dist/cli/chunks/{chunk-AYLEH2UF.js → chunk-7TE5ONQQ.js} +1 -1
  52. package/dist/cli/chunks/{chunk-7QUSNBAA.js → chunk-A5GBXCP5.js} +2 -2
  53. package/dist/cli/chunks/{chunk-7724KXM2.js → chunk-AAMLQ2LF.js} +3 -3
  54. package/dist/cli/chunks/chunk-AG2EWGXS.js +21 -0
  55. package/dist/cli/chunks/{chunk-2UZBLC5H.js → chunk-AGRV5B3T.js} +2 -2
  56. package/dist/cli/chunks/{chunk-V6SE2ZU2.js → chunk-AJMJNQMP.js} +1 -1
  57. package/dist/cli/chunks/{chunk-2HPNGK7A.js → chunk-AR67RJPY.js} +2 -2
  58. package/dist/cli/chunks/{chunk-G7HGUQAE.js → chunk-ASEOFRIG.js} +2 -2
  59. package/dist/cli/chunks/{chunk-7TH4PJSU.js → chunk-BEKDKVQT.js} +2 -2
  60. package/dist/cli/chunks/{chunk-M5JEA6ZY.js → chunk-BY5OF7OH.js} +2 -2
  61. package/dist/cli/chunks/{chunk-OLUOVNUF.js → chunk-C5FP5GW3.js} +2 -2
  62. package/dist/cli/chunks/{chunk-R5RRWLRI.js → chunk-C6D5AHBO.js} +2 -2
  63. package/dist/cli/chunks/{chunk-K7GFYFBO.js → chunk-CAKMOVZ6.js} +2 -2
  64. package/dist/cli/chunks/{chunk-6NIGSY5L.js → chunk-CEYSYSK5.js} +2 -2
  65. package/dist/cli/chunks/{chunk-U4TML2VD.js → chunk-CGGUM2YJ.js} +2 -2
  66. package/dist/cli/chunks/{chunk-YE54T2NQ.js → chunk-CJSHWQXP.js} +2 -2
  67. package/dist/cli/chunks/{chunk-7SQTLUEN.js → chunk-CRPIYUTJ.js} +2 -2
  68. package/dist/cli/chunks/{chunk-65EE2EST.js → chunk-D6COXLYE.js} +2 -2
  69. package/dist/cli/chunks/{chunk-4WLIOPHX.js → chunk-DTMAS2GB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-E7QTWGPI.js → chunk-DVYHMDFR.js} +470 -411
  71. package/dist/cli/chunks/chunk-DXD6K2ZP.js +3 -0
  72. package/dist/cli/chunks/{chunk-HSDWPQQY.js → chunk-E3D4GPLP.js} +3 -3
  73. package/dist/cli/chunks/{chunk-JJHLGGPP.js → chunk-EA4YQVKS.js} +1 -1
  74. package/dist/cli/chunks/{chunk-EIEEST4T.js → chunk-EGYE5UPQ.js} +2 -2
  75. package/dist/cli/chunks/{chunk-O756AOUX.js → chunk-EK7OLYOZ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-57DRT6UA.js → chunk-F742SZAX.js} +2 -2
  77. package/dist/cli/chunks/{chunk-6OI5SK7M.js → chunk-FBDVGRSC.js} +1 -1
  78. package/dist/cli/chunks/{chunk-H3C5FJRH.js → chunk-FDDC72IA.js} +2 -2
  79. package/dist/cli/chunks/{chunk-IQRPR4KB.js → chunk-FL64OUBA.js} +2 -2
  80. package/dist/cli/chunks/{chunk-BNG4J3CE.js → chunk-FLNAW7C4.js} +2 -2
  81. package/dist/cli/chunks/{chunk-C3OIBFAA.js → chunk-G5RHFBAY.js} +2 -2
  82. package/dist/cli/chunks/{chunk-NPCXGX7N.js → chunk-GAHNO6JJ.js} +2 -2
  83. package/dist/cli/chunks/{chunk-PNRPVQGI.js → chunk-GFWHUQSF.js} +2 -2
  84. package/dist/cli/chunks/{chunk-OCN53CCK.js → chunk-GJYHWYXR.js} +2 -2
  85. package/dist/cli/chunks/{chunk-5Z4MO2F3.js → chunk-GQ6TUIKY.js} +1 -1
  86. package/dist/cli/chunks/{chunk-N736GLWZ.js → chunk-GSKMOPL7.js} +2 -2
  87. package/dist/cli/chunks/{chunk-43XHGWYH.js → chunk-HCH4Y6XX.js} +2 -2
  88. package/dist/cli/chunks/{chunk-QP6GL3O5.js → chunk-HGWXF45W.js} +1 -1
  89. package/dist/cli/chunks/{chunk-PGN4TARY.js → chunk-HJ6ZGVTB.js} +2 -2
  90. package/dist/cli/chunks/{chunk-M2TG7VDK.js → chunk-HLUXXCHF.js} +1 -1
  91. package/dist/cli/chunks/{chunk-UMHFTQTR.js → chunk-HVRRLYX6.js} +4 -4
  92. package/dist/cli/chunks/{chunk-L7PC675Y.js → chunk-I7MQIM2U.js} +1 -1
  93. package/dist/cli/chunks/{chunk-JSSU4RIK.js → chunk-IESR7TNB.js} +2 -2
  94. package/dist/cli/chunks/{chunk-H4LYXLAT.js → chunk-IHRXZZQM.js} +1 -1
  95. package/dist/cli/chunks/{chunk-HV43NX4A.js → chunk-IOKYCMTJ.js} +6 -6
  96. package/dist/cli/chunks/{chunk-NZQYJCO6.js → chunk-IOQ6ZQ5W.js} +1 -1
  97. package/dist/cli/chunks/{chunk-JO26SG47.js → chunk-IOYG4VFL.js} +2 -2
  98. package/dist/cli/chunks/{chunk-6O63ZTVX.js → chunk-IUBJVHNB.js} +2 -2
  99. package/dist/cli/chunks/{chunk-XSPMLJCQ.js → chunk-J442IZLE.js} +1 -1
  100. package/dist/cli/chunks/{chunk-LTGQJYYO.js → chunk-J4ELZNLY.js} +2 -2
  101. package/dist/cli/chunks/chunk-J7I6PABJ.js +153 -0
  102. package/dist/cli/chunks/chunk-JDIYMZCQ.js +2 -0
  103. package/dist/cli/chunks/{chunk-TOJF3ZG4.js → chunk-JHQCRRJI.js} +2 -2
  104. package/dist/cli/chunks/{chunk-QUZ745UQ.js → chunk-JQ3DYUMS.js} +2 -2
  105. package/dist/cli/chunks/{chunk-P2TPH3TC.js → chunk-KITOPKRG.js} +2 -2
  106. package/dist/cli/chunks/{chunk-QNQE3EOH.js → chunk-KKU2QGSJ.js} +2 -2
  107. package/dist/cli/chunks/chunk-KL7OKSU2.js +4 -0
  108. package/dist/cli/chunks/{chunk-L5VSLPMW.js → chunk-KNSRL6NO.js} +2 -2
  109. package/dist/cli/chunks/{chunk-INGXD5IX.js → chunk-KPRCB5LT.js} +2 -2
  110. package/dist/cli/chunks/{chunk-GY4P7KAI.js → chunk-KQYJ4VQ5.js} +1 -1
  111. package/dist/cli/chunks/{chunk-Z2S7DNFP.js → chunk-KU2AUFGX.js} +2 -2
  112. package/dist/cli/chunks/{chunk-O5CEL447.js → chunk-KVF4NXGQ.js} +2 -2
  113. package/dist/cli/chunks/{chunk-2IJO3657.js → chunk-KXCLACFG.js} +2 -2
  114. package/dist/cli/chunks/{chunk-ZJGFQK27.js → chunk-L2DWPVNJ.js} +1 -1
  115. package/dist/cli/chunks/{chunk-E7OR6V3V.js → chunk-L6QSTQME.js} +2 -2
  116. package/dist/cli/chunks/{chunk-RE6JTSDM.js → chunk-LE4QJREF.js} +1 -1
  117. package/dist/cli/chunks/{chunk-DSQESXL4.js → chunk-LKTTUHLF.js} +2 -2
  118. package/dist/cli/chunks/{chunk-YGC5QKQ4.js → chunk-LQLPB2T6.js} +2 -2
  119. package/dist/cli/chunks/{chunk-VGZOPQQY.js → chunk-LRSX2FJM.js} +1 -1
  120. package/dist/cli/chunks/chunk-M4FRQ4TE.js +12 -0
  121. package/dist/cli/chunks/chunk-M7WJCTG3.js +2 -0
  122. package/dist/cli/chunks/{chunk-56NSE3LJ.js → chunk-MAFQV4U4.js} +2 -2
  123. package/dist/cli/chunks/{chunk-MKYOE7NE.js → chunk-MD43XRX5.js} +1 -1
  124. package/dist/cli/chunks/{chunk-3TF27MG5.js → chunk-MI5MFHRA.js} +2 -2
  125. package/dist/cli/chunks/{chunk-JK6PMLQQ.js → chunk-MO55CVMT.js} +32 -32
  126. package/dist/cli/chunks/{chunk-X6NJOT3V.js → chunk-N7HL5PHH.js} +1 -1
  127. package/dist/cli/chunks/chunk-NAEWCFQT.js +14 -0
  128. package/dist/cli/chunks/{chunk-WUGXXNK4.js → chunk-NDJ7P2EP.js} +1 -1
  129. package/dist/cli/chunks/{chunk-D5GB5PUU.js → chunk-NO3IV5Q5.js} +1 -1
  130. package/dist/cli/chunks/{chunk-3XACRXBY.js → chunk-NQXXI77K.js} +2 -2
  131. package/dist/cli/chunks/{chunk-EC65UZ77.js → chunk-NVEWF4JV.js} +1 -1
  132. package/dist/cli/chunks/{chunk-JI67T6Q2.js → chunk-NZU4ACBZ.js} +2 -2
  133. package/dist/cli/chunks/chunk-O5W3FIO6.js +63 -0
  134. package/dist/cli/chunks/{chunk-YEFTK4HD.js → chunk-OAEE6JWQ.js} +2 -2
  135. package/dist/cli/chunks/{chunk-JAOCHPYX.js → chunk-OCV2XEWQ.js} +2 -2
  136. package/dist/cli/chunks/{chunk-IDBA5GK2.js → chunk-P3EYRILV.js} +2 -2
  137. package/dist/cli/chunks/{chunk-4RPBODN5.js → chunk-PEQDY4BO.js} +2 -2
  138. package/dist/cli/chunks/{chunk-CPPYZYXC.js → chunk-PF7RBAYL.js} +2 -2
  139. package/dist/cli/chunks/{chunk-WCPSR4MJ.js → chunk-PHT5N7SC.js} +2 -2
  140. package/dist/cli/chunks/{chunk-O2AAYJUV.js → chunk-PINSJCM3.js} +1 -1
  141. package/dist/cli/chunks/{chunk-HEDGFKC5.js → chunk-PPUZWYUG.js} +2 -2
  142. package/dist/cli/chunks/{chunk-XMCSKYDE.js → chunk-QPEOLAAS.js} +1 -1
  143. package/dist/cli/chunks/{chunk-7MUO4DEH.js → chunk-QQWBWEJS.js} +18 -18
  144. package/dist/cli/chunks/{chunk-UFP7SN5V.js → chunk-QVDCVD5D.js} +2 -2
  145. package/dist/cli/chunks/{chunk-NHEG2DLN.js → chunk-RJIEG3NA.js} +2 -2
  146. package/dist/cli/chunks/{chunk-KJ5A54ZH.js → chunk-RV74I3YO.js} +2 -2
  147. package/dist/cli/chunks/{chunk-UDSB3XCG.js → chunk-S75SOOZL.js} +2 -2
  148. package/dist/cli/chunks/{chunk-BPDAQB3F.js → chunk-SASBO5Y5.js} +2 -2
  149. package/dist/cli/chunks/{chunk-VJBJRFUO.js → chunk-SDLWKRVL.js} +9 -9
  150. package/dist/cli/chunks/{chunk-J6ASX536.js → chunk-SHKOCGNK.js} +2 -2
  151. package/dist/cli/chunks/{chunk-J35JWDJE.js → chunk-SI6DPU5D.js} +1 -1
  152. package/dist/cli/chunks/{chunk-V3MGY76S.js → chunk-SJ6Y4725.js} +2 -2
  153. package/dist/cli/chunks/{chunk-FTYRPEJS.js → chunk-SR52XP5F.js} +1 -1
  154. package/dist/cli/chunks/{chunk-ZUE524JL.js → chunk-SSUAAX3F.js} +2 -2
  155. package/dist/cli/chunks/{chunk-VG32EEUG.js → chunk-SSYAQZXA.js} +2 -2
  156. package/dist/cli/chunks/{chunk-HTVGHHX2.js → chunk-SUDMM5SO.js} +2 -2
  157. package/dist/cli/chunks/{chunk-K2SMP4OD.js → chunk-TIUKLYAI.js} +1 -1
  158. package/dist/cli/chunks/{chunk-VCVRZD4Y.js → chunk-TVGI32MB.js} +33 -33
  159. package/dist/cli/chunks/{chunk-CAZM63TP.js → chunk-U2A7NHZA.js} +2 -2
  160. package/dist/cli/chunks/{chunk-WBC6WB32.js → chunk-UE5ZOZR2.js} +2 -2
  161. package/dist/cli/chunks/{chunk-BQJ7CV53.js → chunk-UHEOGZLX.js} +12 -12
  162. package/dist/cli/chunks/chunk-UNGBRZDK.js +12 -0
  163. package/dist/cli/chunks/{chunk-XN3KCKAM.js → chunk-V5NHZV7S.js} +2 -2
  164. package/dist/cli/chunks/{chunk-UNYTHZDZ.js → chunk-VJCIEHEF.js} +1 -1
  165. package/dist/cli/chunks/{chunk-5Y7UFHJD.js → chunk-VMDFFTCK.js} +1 -1
  166. package/dist/cli/chunks/chunk-VSIKHWZ4.js +29 -0
  167. package/dist/cli/chunks/{chunk-UPWLMIDY.js → chunk-VWPM27GU.js} +2 -2
  168. package/dist/cli/chunks/{chunk-USAKCGHC.js → chunk-VXFLJNCA.js} +2 -2
  169. package/dist/cli/chunks/{chunk-WKI46WWN.js → chunk-W5HQUIML.js} +2 -2
  170. package/dist/cli/chunks/{chunk-Z54G2YOL.js → chunk-WP4RETKG.js} +2 -2
  171. package/dist/cli/chunks/{chunk-IRPNEXOU.js → chunk-XIIQ5QTT.js} +2 -2
  172. package/dist/cli/chunks/{chunk-O32BFQV4.js → chunk-XIQW7EFL.js} +2 -2
  173. package/dist/cli/chunks/{chunk-TW6Z6W4X.js → chunk-XWUWX7BV.js} +13 -13
  174. package/dist/cli/chunks/{chunk-57FX3GP6.js → chunk-Y4PFUMOU.js} +1 -1
  175. package/dist/cli/chunks/chunk-YAPLJR7K.js +2 -0
  176. package/dist/cli/chunks/{chunk-4T7XV5KQ.js → chunk-YLMNVLDK.js} +1 -1
  177. package/dist/cli/chunks/{chunk-TSP6SU5V.js → chunk-YNMJEDN5.js} +2 -2
  178. package/dist/cli/chunks/{chunk-PWQWKYBG.js → chunk-YPBSUGMI.js} +1 -1
  179. package/dist/cli/chunks/{chunk-QP2HLKTS.js → chunk-YRAX7SFJ.js} +2 -2
  180. package/dist/cli/chunks/{chunk-O3ERGUXH.js → chunk-YTHTQPWR.js} +1 -1
  181. package/dist/cli/chunks/{chunk-MR2OPUSA.js → chunk-YU2BDRSD.js} +1 -1
  182. package/dist/cli/chunks/chunk-ZB3LEFYG.js +2 -0
  183. package/dist/cli/chunks/{chunk-2W5MQDHM.js → chunk-ZFL436FN.js} +2 -2
  184. package/dist/cli/chunks/{chunk-7MISCSL5.js → chunk-ZJH5MU2I.js} +2 -2
  185. package/dist/cli/chunks/{chunk-52KOPIMI.js → chunk-ZQ2XW3IP.js} +2 -2
  186. package/dist/cli/chunks/chunk-ZR2TKVXQ.js +14 -0
  187. package/dist/cli/chunks/{ci-UMA2SMNW.js → ci-MFUR4CWV.js} +2 -2
  188. package/dist/cli/chunks/{ci-config-UQSILJFQ.js → ci-config-PNDLQ6XV.js} +2 -2
  189. package/dist/cli/chunks/{ci-output-U6YZLLKH.js → ci-output-PFZ4M7NC.js} +2 -2
  190. package/dist/cli/chunks/{circuit-breaker-ATYQP6X2.js → circuit-breaker-5HH6NLZN.js} +2 -2
  191. package/dist/cli/chunks/{claude-flow-setup-6YHFD7AN.js → claude-flow-setup-QCKYLGLC.js} +2 -2
  192. package/dist/cli/chunks/client-MHQRTZM4.js +2 -0
  193. package/dist/cli/chunks/{cline-installer-EPE7IOZE.js → cline-installer-EASVPFXR.js} +2 -2
  194. package/dist/cli/chunks/{code-NUEJ4XYO.js → code-UJXDVYRK.js} +4 -3
  195. package/dist/cli/chunks/{code-index-extractor-D4DBT6OL.js → code-index-extractor-BZJ3UDP4.js} +2 -2
  196. package/dist/cli/chunks/{codex-installer-633SM4LR.js → codex-installer-XSQZUVOZ.js} +4 -4
  197. package/dist/cli/chunks/{completions-WUKVIW3L.js → completions-OWOOJFI2.js} +2 -2
  198. package/dist/cli/chunks/{complexity-analyzer-F73ACR5H.js → complexity-analyzer-KP5TOHDT.js} +2 -2
  199. package/dist/cli/chunks/{continuedev-installer-QH42TKMS.js → continuedev-installer-IFKQXLHM.js} +2 -2
  200. package/dist/cli/chunks/{copilot-installer-Y3XC7BTT.js → copilot-installer-IGJ6KGQY.js} +2 -2
  201. package/dist/cli/chunks/core-handlers-UAK3LLJE.js +2 -0
  202. package/dist/cli/chunks/{cost-tracker-57QPV7E3.js → cost-tracker-MMDDNKZB.js} +2 -2
  203. package/dist/cli/chunks/{coverage-IBCHMBCR.js → coverage-LUH2B7NT.js} +3 -3
  204. package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +2 -0
  205. package/dist/cli/chunks/{cursor-installer-F4UYQHIN.js → cursor-installer-4YLM5GWM.js} +2 -2
  206. package/dist/cli/chunks/daemon-CAVZ7OFV.js +18 -0
  207. package/dist/cli/chunks/{daemon-XR4Q6YZF.js → daemon-MZKVM4CJ.js} +3 -3
  208. package/dist/cli/chunks/{dag-attention-scheduler-ZR5ZD3TW.js → dag-attention-scheduler-X4CYW665.js} +2 -2
  209. package/dist/cli/chunks/{detect-GEGYURLL.js → detect-7BM2XINO.js} +2 -2
  210. package/dist/cli/chunks/{dist-node-JU3KT2JO.js → dist-node-Y5APLEYB.js} +2 -2
  211. package/dist/cli/chunks/{domain-handler-7QI3FJGE.js → domain-handler-X3ZRJNAH.js} +2 -2
  212. package/dist/cli/chunks/{domain-plugins-O2YRM2PD.js → domain-plugins-2UW5KQJB.js} +2 -2
  213. package/dist/cli/chunks/{domain-transfer-7J3S2OS6.js → domain-transfer-35W4CIBV.js} +2 -2
  214. package/dist/cli/chunks/dream-EJY24JN6.js +2 -0
  215. package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +3 -0
  216. package/dist/cli/chunks/embedding-space-SBM2MZD2.js +2 -0
  217. package/dist/cli/chunks/{eval-RVMCIUOR.js → eval-4QA2SROK.js} +2 -2
  218. package/dist/cli/chunks/experience-capture-middleware-Z6BF6KYM.js +40 -0
  219. package/dist/cli/chunks/{fast-paths-QUKPKWKZ.js → fast-paths-FIORX6GN.js} +2 -2
  220. package/dist/cli/chunks/{feature-flags-K7JXNKJI.js → feature-flags-6LYI2T4G.js} +2 -2
  221. package/dist/cli/chunks/{feature-flags-5JCSKL2P.js → feature-flags-ZOO7LMIC.js} +2 -2
  222. package/dist/cli/chunks/file-discovery-UZSFSS4V.js +2 -0
  223. package/dist/cli/chunks/{fleet-II4Q6HXK.js → fleet-7WF53H4F.js} +3 -3
  224. package/dist/cli/chunks/{gnn-wrapper-M7VO2EMS.js → gnn-wrapper-KJ6B7BRM.js} +2 -2
  225. package/dist/cli/chunks/{heartbeat-handler-ND5CY26N.js → heartbeat-handler-DEKKMOVW.js} +4 -4
  226. package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +2 -0
  227. package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +2 -0
  228. package/dist/cli/chunks/hnsw-index-POCPMVJH.js +2 -0
  229. package/dist/cli/chunks/{hnsw-legacy-bridge-N3AUUUU7.js → hnsw-legacy-bridge-L27WS27N.js} +2 -2
  230. package/dist/cli/chunks/{hnswlib-node-NZY3E5EN.js → hnswlib-node-4YOQC6L4.js} +2 -2
  231. package/dist/cli/chunks/{hooks-QVJDTII5.js → hooks-TAOKV4EJ.js} +23 -22
  232. package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +2 -0
  233. package/dist/cli/chunks/{hypergraph-engine-ZRY6MTDV.js → hypergraph-engine-BODRJLHL.js} +2 -2
  234. package/dist/cli/chunks/{hypergraph-handler-56DO4XZQ.js → hypergraph-handler-RKMYJNTU.js} +3 -3
  235. package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +2 -0
  236. package/dist/cli/chunks/{init-guard-DTF4EVUY.js → init-guard-MXHSLSB2.js} +2 -2
  237. package/dist/cli/chunks/{init-handler-M6CNQHMX.js → init-handler-HUE57IFW.js} +6 -6
  238. package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +2 -0
  239. package/dist/cli/chunks/kernel-CCDWT7KS.js +2 -0
  240. package/dist/cli/chunks/{kilocode-installer-IJN7XKBH.js → kilocode-installer-S333IKYQ.js} +2 -2
  241. package/dist/cli/chunks/{kiro-installer-UKKPGPDC.js → kiro-installer-WM5DLQWC.js} +2 -2
  242. package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +2 -0
  243. package/dist/cli/chunks/{learning-W2HETWQ4.js → learning-LNHMQLH5.js} +3 -3
  244. package/dist/cli/chunks/{llm-router-Y546K4VX.js → llm-router-EWFXYZZR.js} +4 -4
  245. package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +2 -0
  246. package/dist/cli/chunks/{load-MKAB2AXE.js → load-FGYGWVDK.js} +2 -2
  247. package/dist/cli/chunks/load-test-UNZUWY3F.js +2 -0
  248. package/dist/cli/chunks/{mcp-AZKUS6K3.js → mcp-2FHNAAOM.js} +2 -2
  249. package/dist/cli/chunks/{memory-ZDOQN2KU.js → memory-DZMQ73AB.js} +5 -5
  250. package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +2 -0
  251. package/dist/cli/chunks/memory-handlers-MP426XRJ.js +2 -0
  252. package/dist/cli/chunks/{multi-model-executor-WWVXDHG4.js → multi-model-executor-6F2UAEUW.js} +2 -2
  253. package/dist/cli/chunks/{opencode-installer-YUJNXXWS.js → opencode-installer-XY3BGOTZ.js} +2 -2
  254. package/dist/cli/chunks/{orchestrator-Z6PWPLRE.js → orchestrator-B4CNKUOS.js} +17 -17
  255. package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +2 -0
  256. package/dist/cli/chunks/{pattern-usage-recorder-TPWPX32U.js → pattern-usage-recorder-R4GUFNMD.js} +2 -2
  257. package/dist/cli/chunks/{pipeline-4BBGTE4M.js → pipeline-FG5RKVRO.js} +2 -2
  258. package/dist/cli/chunks/{platform-5GSHXCV5.js → platform-3BT4KEVJ.js} +2 -2
  259. package/dist/cli/chunks/{plugin-OFDVF5HS.js → plugin-WI4RIN7O.js} +2 -2
  260. package/dist/cli/chunks/{prime-radiant-advanced-wasm-NC6MUYGJ.js → prime-radiant-advanced-wasm-7ECDNQFS.js} +2 -2
  261. package/dist/cli/chunks/project-root-BEANNYWU.js +2 -0
  262. package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +2 -0
  263. package/dist/cli/chunks/{protocol-handler-MPOAAEPA.js → protocol-handler-WNODKPGW.js} +2 -2
  264. package/dist/cli/chunks/{prove-CDKMAIVM.js → prove-5RHAEPYZ.js} +2 -2
  265. package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +2 -0
  266. package/dist/cli/chunks/{quality-ZH4F7R7R.js → quality-WPHR7BGQ.js} +2 -2
  267. package/dist/cli/chunks/{quality-gate-IDRMW6OE.js → quality-gate-4RKTEZMX.js} +3 -3
  268. package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +2 -0
  269. package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +2 -0
  270. package/dist/cli/chunks/{ref-validation-Z5GCGVXK.js → ref-validation-TPAWHOHH.js} +2 -2
  271. package/dist/cli/chunks/{roocode-installer-IZ2S7PH2.js → roocode-installer-7AVHFNDI.js} +2 -2
  272. package/dist/cli/chunks/router-EP34O3KB.js +2 -0
  273. package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +2 -0
  274. package/dist/cli/chunks/{routing-handler-NAX35VUW.js → routing-handler-YKEDVJSH.js} +2 -2
  275. package/dist/cli/chunks/{ruvector-commands-5YW2SOFF.js → ruvector-commands-JUAMM354.js} +2 -2
  276. package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +2 -0
  277. package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +2 -0
  278. package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +2 -0
  279. package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +2 -0
  280. package/dist/cli/chunks/{rvf-store-integrity-IPGCAT6C.js → rvf-store-integrity-VJDUIRTX.js} +2 -2
  281. package/dist/cli/chunks/safe-db-TCAU4FUT.js +2 -0
  282. package/dist/cli/chunks/schedule-NB5KV435.js +2 -0
  283. package/dist/cli/chunks/scheduler-JKXGKVK6.js +2 -0
  284. package/dist/cli/chunks/{security-3IH4BO5Z.js → security-ORDN3RD2.js} +3 -3
  285. package/dist/cli/chunks/{shared-rvf-adapter-ABY7PAY2.js → shared-rvf-adapter-CF4BCIO7.js} +2 -2
  286. package/dist/cli/chunks/{shared-rvf-dual-writer-6KENLN2W.js → shared-rvf-dual-writer-C32UBR6D.js} +2 -2
  287. package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +2 -0
  288. package/dist/cli/chunks/{standalone-memory-RLFAUGOW.js → standalone-memory-OXRJYZXN.js} +2 -2
  289. package/dist/cli/chunks/{status-handler-FCOZBPE5.js → status-handler-BCX5D4HY.js} +2 -2
  290. package/dist/cli/chunks/{structural-health-4RDA5UUM.js → structural-health-LFG7RUU6.js} +2 -2
  291. package/dist/cli/chunks/sync-OSF7C2NL.js +2 -0
  292. package/dist/cli/chunks/{sync-KGEEXXCC.js → sync-YJEE2K2L.js} +2 -2
  293. package/dist/cli/chunks/task-handler-6LXKPTXJ.js +64 -0
  294. package/dist/cli/chunks/{task-handlers-6H7L2UT4.js → task-handlers-CILP36I7.js} +4 -4
  295. package/dist/cli/chunks/{test-S7IG6EIX.js → test-SD457QJ6.js} +4 -4
  296. package/dist/cli/chunks/test-runner-process-VKD65QQU.js +2 -0
  297. package/dist/cli/chunks/{test-scheduling-7XYXI4L2.js → test-scheduling-ISI2O4Q5.js} +3 -3
  298. package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +2 -0
  299. package/dist/cli/chunks/{token-usage-Y2YTPOFE.js → token-usage-XOC5KG7S.js} +2 -2
  300. package/dist/cli/chunks/{transformers-UCJ3HHHC.js → transformers-LSLQAARK.js} +2 -2
  301. package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +2 -0
  302. package/dist/cli/chunks/{types-6CMFPETH.js → types-5BLCGLCR.js} +2 -2
  303. package/dist/cli/chunks/unified-memory-GI76TXFV.js +2 -0
  304. package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +2 -0
  305. package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +2 -0
  306. package/dist/cli/chunks/{upgrade-K25DN6WU.js → upgrade-RQJYLK3J.js} +2 -2
  307. package/dist/cli/chunks/{validate-T4V3TBY3.js → validate-QBHWXXCK.js} +2 -2
  308. package/dist/cli/chunks/{validate-swarm-XSRC576T.js → validate-swarm-IKXBKFB5.js} +2 -2
  309. package/dist/cli/chunks/visual-security-GZ2MOKWB.js +2 -0
  310. package/dist/cli/chunks/{web-tree-sitter-YOZXHRTN.js → web-tree-sitter-ZF6FIE5R.js} +2 -2
  311. package/dist/cli/chunks/{windsurf-installer-ITPU2IYL.js → windsurf-installer-HQGDZT5D.js} +2 -2
  312. package/dist/cli/chunks/witness-chain-DCHCAMSQ.js +2 -0
  313. package/dist/cli/chunks/witness-chain-P3XXXA62.js +2 -0
  314. package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +2 -0
  315. package/dist/cli/chunks/{witness-chain-verifier-DTDSVKOG.js → witness-chain-verifier-PX2OQ6XT.js} +2 -2
  316. package/dist/cli/chunks/{witness-key-manager-EWACWGAW.js → witness-key-manager-RXYQNFJB.js} +2 -2
  317. package/dist/cli/chunks/{workflow-ZIQ4FV42.js → workflow-FBKCA4H6.js} +4 -4
  318. package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +2 -0
  319. package/dist/cli/chunks/wrappers-TWSKBTWD.js +2 -0
  320. package/dist/cli/commands/code.js +4 -0
  321. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +10 -2
  322. package/dist/cli/handlers/task-handler.d.ts +5 -0
  323. package/dist/cli/handlers/task-handler.js +21 -1
  324. package/dist/cli/utils/task-result.d.ts +11 -0
  325. package/dist/cli/utils/task-result.js +39 -0
  326. package/dist/coordination/handlers/test-execution-handlers.js +92 -58
  327. package/dist/coordination/mincut/mincut-persistence.js +29 -25
  328. package/dist/domains/code-intelligence/coordinator.d.ts +4 -0
  329. package/dist/domains/code-intelligence/coordinator.js +46 -13
  330. package/dist/domains/code-intelligence/interfaces.d.ts +10 -1
  331. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +32 -7
  332. package/dist/domains/code-intelligence/services/semantic-analyzer.js +112 -53
  333. package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
  334. package/dist/domains/quality-assessment/coordinator.js +2 -1
  335. package/dist/domains/test-execution/coordinator.js +10 -5
  336. package/dist/domains/test-execution/interfaces.d.ts +12 -0
  337. package/dist/domains/test-execution/plugin.js +6 -2
  338. package/dist/domains/test-execution/services/retry-handler.d.ts +2 -0
  339. package/dist/domains/test-execution/services/retry-handler.js +14 -9
  340. package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
  341. package/dist/domains/test-execution/services/test-executor.js +28 -9
  342. package/dist/domains/visual-accessibility/coordinator.d.ts +15 -7
  343. package/dist/domains/visual-accessibility/coordinator.js +15 -7
  344. package/dist/domains/visual-accessibility/interfaces.d.ts +27 -3
  345. package/dist/domains/visual-accessibility/services/accessibility-contrast.d.ts +39 -0
  346. package/dist/domains/visual-accessibility/services/accessibility-contrast.js +93 -0
  347. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +18 -3
  348. package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +50 -40
  349. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.d.ts +27 -0
  350. package/dist/domains/visual-accessibility/services/accessibility-tester-checks.js +137 -0
  351. package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +5 -0
  352. package/dist/domains/visual-accessibility/services/accessibility-tester.js +43 -24
  353. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +2 -3
  354. package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -14
  355. package/dist/feedback/coverage-learner.js +13 -9
  356. package/dist/feedback/test-outcome-tracker.js +13 -9
  357. package/dist/governance/witness-chain.d.ts +5 -0
  358. package/dist/governance/witness-chain.js +22 -6
  359. package/dist/init/init-wizard-hooks.d.ts +1 -1
  360. package/dist/init/init-wizard-hooks.js +7 -8
  361. package/dist/init/phases/08-mcp.js +9 -0
  362. package/dist/init/settings-merge.d.ts +13 -0
  363. package/dist/init/settings-merge.js +49 -2
  364. package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
  365. package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
  366. package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
  367. package/dist/integrations/agent-booster-wasm/index.js +25 -2
  368. package/dist/integrations/agent-booster-wasm/package.json +16 -0
  369. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +22 -0
  370. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +115 -45
  371. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts +6 -0
  372. package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +51 -33
  373. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +17 -9
  374. package/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +8 -0
  375. package/dist/integrations/embeddings/cache/EmbeddingCache.js +24 -10
  376. package/dist/integrations/ruvector/delta-tracker.d.ts +11 -0
  377. package/dist/integrations/ruvector/delta-tracker.js +16 -0
  378. package/dist/integrations/ruvector/sona-persistence.d.ts +10 -0
  379. package/dist/integrations/ruvector/sona-persistence.js +49 -24
  380. package/dist/kernel/unified-memory.d.ts +24 -0
  381. package/dist/kernel/unified-memory.js +63 -8
  382. package/dist/learning/aqe-learning-engine.js +1 -1
  383. package/dist/learning/dream/dream-engine.d.ts +3 -2
  384. package/dist/learning/dream/dream-engine.js +42 -24
  385. package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
  386. package/dist/learning/dream/dream-lock-retry.js +66 -0
  387. package/dist/learning/dream/speculative-dreamer.js +1 -1
  388. package/dist/learning/embed-and-insert-pattern.js +4 -2
  389. package/dist/learning/embedder-endpoint-client.d.ts +31 -0
  390. package/dist/learning/embedder-endpoint-client.js +103 -10
  391. package/dist/learning/embedding-space.d.ts +12 -0
  392. package/dist/learning/embedding-space.js +17 -0
  393. package/dist/learning/experience-capture-middleware.js +25 -13
  394. package/dist/learning/experience-capture.js +1 -1
  395. package/dist/learning/experience-consolidation.d.ts +18 -0
  396. package/dist/learning/experience-consolidation.js +55 -8
  397. package/dist/learning/experience-space-verification.d.ts +71 -0
  398. package/dist/learning/experience-space-verification.js +147 -0
  399. package/dist/learning/pattern-lifecycle.d.ts +40 -4
  400. package/dist/learning/pattern-lifecycle.js +153 -76
  401. package/dist/learning/pattern-null-store.d.ts +5 -0
  402. package/dist/learning/pattern-null-store.js +8 -0
  403. package/dist/learning/pattern-promotion.js +6 -3
  404. package/dist/learning/pattern-store.d.ts +6 -0
  405. package/dist/learning/pattern-store.js +19 -6
  406. package/dist/learning/qe-reasoning-bank.js +2 -2
  407. package/dist/learning/real-embeddings.js +3 -1
  408. package/dist/learning/real-qe-reasoning-bank.d.ts +5 -0
  409. package/dist/learning/real-qe-reasoning-bank.js +77 -47
  410. package/dist/learning/rvf-pattern-store.js +6 -2
  411. package/dist/learning/sqlite-persistence.d.ts +6 -0
  412. package/dist/learning/sqlite-persistence.js +10 -0
  413. package/dist/mcp/bundle.js +642 -571
  414. package/dist/mcp/entry.js +4 -0
  415. package/dist/mcp/handlers/domain-handler-configs.js +2 -0
  416. package/dist/mcp/handlers/trajectory-judge.js +1 -1
  417. package/dist/mcp/protocol-server.js +1 -0
  418. package/dist/mcp/tools/visual-accessibility/index.js +8 -2
  419. package/dist/mcp/types.d.ts +6 -0
  420. package/dist/optimization/session-cache.d.ts +17 -1
  421. package/dist/optimization/session-cache.js +40 -36
  422. package/dist/planning/goap-planner.d.ts +6 -0
  423. package/dist/planning/goap-planner.js +35 -19
  424. package/dist/planning/plan-executor.js +24 -15
  425. package/dist/routing/co-execution-repository.js +12 -9
  426. package/dist/routing/routing-feedback.d.ts +8 -0
  427. package/dist/routing/routing-feedback.js +46 -24
  428. package/dist/routing/routing-outcomes-migration.js +7 -2
  429. package/dist/shared/llm/spend-ledger.d.ts +9 -0
  430. package/dist/shared/llm/spend-ledger.js +64 -39
  431. package/dist/shared/sqlite-lock-wait.d.ts +27 -0
  432. package/dist/shared/sqlite-lock-wait.js +37 -0
  433. package/dist/shared/sqlite-write-queue.d.ts +28 -0
  434. package/dist/shared/sqlite-write-queue.js +38 -0
  435. package/dist/shared/test-runner-project.d.ts +69 -0
  436. package/dist/shared/test-runner-project.js +186 -0
  437. package/dist/skills/security-visual-testing/index.d.ts +3 -1
  438. package/dist/skills/security-visual-testing/index.js +49 -35
  439. package/dist/skills/security-visual-testing/types.d.ts +19 -3
  440. package/dist/workers/workers/heartbeat-scheduler.js +5 -5
  441. package/dist/workers/workers/learning-consolidation.js +8 -7
  442. package/package.json +4 -2
  443. package/dist/cli/chunks/adapter-23KA2YW7.js +0 -2
  444. package/dist/cli/chunks/agent-booster-wasm-2DLAEZK6.js +0 -2
  445. package/dist/cli/chunks/aqe-learning-engine-MUICAXW5.js +0 -2
  446. package/dist/cli/chunks/base-XPWGYDKD.js +0 -2
  447. package/dist/cli/chunks/browser-workflow-UMQVBVGK.js +0 -2
  448. package/dist/cli/chunks/chunk-3FITMWWJ.js +0 -21
  449. package/dist/cli/chunks/chunk-ARRBXCII.js +0 -4
  450. package/dist/cli/chunks/chunk-BBYJBZHG.js +0 -14
  451. package/dist/cli/chunks/chunk-BM3EJLMV.js +0 -153
  452. package/dist/cli/chunks/chunk-D3ZZ2NLL.js +0 -62
  453. package/dist/cli/chunks/chunk-DLTB5KCR.js +0 -2
  454. package/dist/cli/chunks/chunk-DRLSJJIC.js +0 -6
  455. package/dist/cli/chunks/chunk-HAYKLXCT.js +0 -744
  456. package/dist/cli/chunks/chunk-HHBF2BZC.js +0 -65
  457. package/dist/cli/chunks/chunk-K7RT6ITZ.js +0 -2
  458. package/dist/cli/chunks/chunk-L752CNG3.js +0 -13
  459. package/dist/cli/chunks/chunk-MQXWG55U.js +0 -12
  460. package/dist/cli/chunks/chunk-WM2QRIRD.js +0 -14
  461. package/dist/cli/chunks/chunk-WRC3HLUY.js +0 -29
  462. package/dist/cli/chunks/chunk-XTZGAG6P.js +0 -27
  463. package/dist/cli/chunks/chunk-YKQWIXUY.js +0 -2
  464. package/dist/cli/chunks/client-E43GWLQH.js +0 -2
  465. package/dist/cli/chunks/core-handlers-R5A3SQDY.js +0 -2
  466. package/dist/cli/chunks/cross-domain-router-LLYVPZF6.js +0 -2
  467. package/dist/cli/chunks/daemon-BYYPIJ7G.js +0 -18
  468. package/dist/cli/chunks/dream-6C4NURSE.js +0 -2
  469. package/dist/cli/chunks/embed-and-insert-pattern-URES5Q6J.js +0 -3
  470. package/dist/cli/chunks/experience-capture-middleware-SYJQSBKE.js +0 -40
  471. package/dist/cli/chunks/file-discovery-J5IE5KP7.js +0 -2
  472. package/dist/cli/chunks/heartbeat-scheduler-FC5PBTMN.js +0 -2
  473. package/dist/cli/chunks/hnsw-adapter-47UIVOBG.js +0 -2
  474. package/dist/cli/chunks/hnsw-index-3AKVLOZQ.js +0 -2
  475. package/dist/cli/chunks/hybrid-backend-YAOSNX47.js +0 -2
  476. package/dist/cli/chunks/impact-analyzer-4FMJXM4M.js +0 -2
  477. package/dist/cli/chunks/init-wizard-RTLCRWDT.js +0 -2
  478. package/dist/cli/chunks/kernel-2OWIGGGT.js +0 -2
  479. package/dist/cli/chunks/knowledge-graph-25XXKDJN.js +0 -2
  480. package/dist/cli/chunks/llm-router-service-G3EIN4UB.js +0 -2
  481. package/dist/cli/chunks/load-test-D6QYNIVT.js +0 -2
  482. package/dist/cli/chunks/memory-backend-LDFFZMEQ.js +0 -2
  483. package/dist/cli/chunks/memory-handlers-3SQVY7FE.js +0 -2
  484. package/dist/cli/chunks/pattern-null-store-KDVRM7PW.js +0 -2
  485. package/dist/cli/chunks/project-root-DDGBWDP6.js +0 -2
  486. package/dist/cli/chunks/protocol-executor-KBOLLCWA.js +0 -2
  487. package/dist/cli/chunks/qe-reasoning-bank-GRXBT7FC.js +0 -2
  488. package/dist/cli/chunks/queen-coordinator-L2QWMJ5Q.js +0 -2
  489. package/dist/cli/chunks/real-embeddings-I2UVNNB3.js +0 -2
  490. package/dist/cli/chunks/router-FT5WJPUH.js +0 -2
  491. package/dist/cli/chunks/routing-feedback-EO2MKOUX.js +0 -2
  492. package/dist/cli/chunks/rvf-dual-writer-WHBFQJVU.js +0 -2
  493. package/dist/cli/chunks/rvf-migration-adapter-YT3APF2I.js +0 -2
  494. package/dist/cli/chunks/rvf-migration-coordinator-VUIZHTVG.js +0 -2
  495. package/dist/cli/chunks/rvf-native-adapter-37PUFKQD.js +0 -2
  496. package/dist/cli/chunks/safe-db-TDZKUOZJ.js +0 -2
  497. package/dist/cli/chunks/schedule-CRKTRY2A.js +0 -2
  498. package/dist/cli/chunks/scheduler-6ZBDVQWN.js +0 -2
  499. package/dist/cli/chunks/sqlite-persistence-FFJQAIKW.js +0 -2
  500. package/dist/cli/chunks/sync-54LUAUTK.js +0 -2
  501. package/dist/cli/chunks/task-handler-K3OXHYKU.js +0 -62
  502. package/dist/cli/chunks/test-runner-process-OTQDAJLN.js +0 -2
  503. package/dist/cli/chunks/token-bootstrap-3QMABE45.js +0 -2
  504. package/dist/cli/chunks/tree-sitter-wasm-parser-D6JTTHTP.js +0 -2
  505. package/dist/cli/chunks/unified-memory-QARWQKJ2.js +0 -2
  506. package/dist/cli/chunks/unified-memory-hnsw-LHY3DXCP.js +0 -2
  507. package/dist/cli/chunks/unified-persistence-WEYYGLHM.js +0 -2
  508. package/dist/cli/chunks/visual-security-O4ALMCXQ.js +0 -2
  509. package/dist/cli/chunks/witness-chain-B3YW5NMS.js +0 -2
  510. package/dist/cli/chunks/witness-chain-PIYR72HJ.js +0 -2
  511. package/dist/cli/chunks/witness-chain-repair-YUG7E3UX.js +0 -2
  512. package/dist/cli/chunks/workflow-orchestrator-3ZN2BCGY.js +0 -2
  513. package/dist/cli/chunks/wrappers-PW2O27LL.js +0 -2
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{b as C,d as P}from"./chunk-XN3KCKAM.js";import{a as w,d as M}from"./chunk-AJVLVF7V.js";import{a as T}from"./chunk-YKQWIXUY.js";import{c as S}from"./chunk-C3OIBFAA.js";import{a as b,e as $}from"./chunk-L5VSLPMW.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{b as C,d as P}from"./chunk-V5NHZV7S.js";import{a as w,d as M}from"./chunk-3HD7E6HN.js";import{a as T}from"./chunk-YAPLJR7K.js";import{c as S}from"./chunk-G5RHFBAY.js";import{a as b,e as $}from"./chunk-KNSRL6NO.js";$();M();import{randomUUID as A}from"crypto";var x={topology:"hierarchical",maxConcurrentSkills:10,maxConcurrentModels:3,timeout:3e5,continueOnFailure:!0,retry:{maxRetries:2,retryDelayMs:1e3}},R=class{config;learner;skillValidator=null;workers=new Map;taskQueue=[];isRunning=!1;constructor(e,t){this.config={...x,...e},this.learner=t}setSkillValidator(e){this.skillValidator=e}async validateSkillsParallel(e,t,i){let s=Date.now(),a=i?.trustTier??3,n=i?.validationLevel??"eval",c=this.determineTopology(e.length,t.length),r=this.createValidationTasks(e,t,a,n),o=await this.executeTasksParallel(r,c),l=new Map;for(let u of o){let p=l.get(u.skill)||[];p.push(u),l.set(u.skill,p)}return await this.recordOutcomesToLearner(o,a,n),l}async validateSkillCrossModel(e,t,i){return(await this.validateSkillsParallel([e],t,i)).get(e)||[]}getSummary(e){let t=[],i=new Map,s=new Map;for(let[c,r]of e){i.set(c,r);for(let o of r){t.push(o);let l=s.get(o.model)||[];l.push(o),s.set(o.model,l)}}let a=t.filter(c=>c.errors.length===0&&c.evalPassRate>=.9).length,n=t.reduce((c,r)=>c+r.durationMs,0);return{totalSkills:i.size,totalModels:s.size,successCount:a,failureCount:t.length-a,overallPassRate:t.length>0?a/t.length:0,totalDurationMs:n,avgDurationMs:t.length>0?n/t.length:0,topology:this.config.topology,bySkill:i,byModel:s,results:t}}determineTopology(e,t){if(this.config.topology){let i=e*t;return i>20&&this.config.topology==="mesh"&&console.warn(`[SwarmSkillValidator] Large workload (${i} tasks) may be more efficient with hierarchical topology`),this.config.topology}return e>5||e>t*2?"hierarchical":t>5&&e<=3?"mesh":"hierarchical"}createValidationTasks(e,t,i,s){let a=[];for(let n of e)for(let c of t)a.push({id:`${n}-${c}-${Date.now()}-${A().slice(0,8)}`,skill:n,model:c,trustTier:i,validationLevel:s,timeout:this.config.timeout,retryCount:0});return a}async executeTasksParallel(e,t){this.isRunning=!0,this.taskQueue=[...e];let i=[],s=t==="hierarchical"?this.config.maxConcurrentSkills:Math.min(this.config.maxConcurrentSkills*this.config.maxConcurrentModels,e.length),a=[];for(let n=0;n<Math.min(s,e.length);n++){let c=`worker-${n}`;this.workers.set(c,{id:c,task:null,status:"idle"}),a.push(this.runWorker(c,i))}return await Promise.all(a),this.isRunning=!1,this.workers.clear(),i}async runWorker(e,t){let i=this.workers.get(e);if(i){for(;this.taskQueue.length>0&&this.isRunning;){let s=this.taskQueue.shift();if(!s)break;i.task=s,i.status="running",i.startTime=Date.now();try{let a=await this.executeValidationTask(s);t.push(a),i.result=a,i.status="completed"}catch(a){let n=this.createErrorResult(s,a);this.config.retry&&s.retryCount<this.config.retry.maxRetries&&this.config.continueOnFailure?(s.retryCount++,this.taskQueue.push(s),await this.delay(this.config.retry.retryDelayMs)):(t.push(n),i.result=n,i.status="failed")}}i.task=null,i.status="idle"}}async executeValidationTask(e){let t=Date.now();if(!this.skillValidator)return this.createSimulatedResult(e,t);let i=new Promise((n,c)=>{setTimeout(()=>c(new Error(`Validation timeout after ${e.timeout}ms`)),e.timeout)}),s=await Promise.race([this.skillValidator(e.skill,e.model,{trustTier:e.trustTier,validationLevel:e.validationLevel,timeout:e.timeout}),i]),a=Date.now()-t;return this.outcomeToResult(s,e,a)}outcomeToResult(e,t,i){let s=e.testCaseResults.filter(c=>c.passed).length,a=e.testCaseResults.length,n=a>0?s/a:e.score;return{skill:t.skill,model:t.model,schemaValid:e.validationLevel!=="schema"||e.passed,validatorPassed:e.validationLevel!=="validator"||e.passed,evalPassRate:n,durationMs:i,errors:e.passed?[]:["Validation failed"],trustTier:t.trustTier,validationLevel:t.validationLevel,retryCount:t.retryCount,timestamp:new Date}}createSimulatedResult(e,t){let i=Date.now()-t+w()*100,s=.85+w()*.15;return{skill:e.skill,model:e.model,schemaValid:!0,validatorPassed:s>.8,evalPassRate:s,durationMs:i,errors:s>.8?[]:["Simulated validation failure"],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}createErrorResult(e,t){let i=b(t);return{skill:e.skill,model:e.model,schemaValid:!1,validatorPassed:!1,evalPassRate:0,durationMs:0,errors:[i],trustTier:e.trustTier,validationLevel:e.validationLevel,retryCount:e.retryCount,timestamp:new Date}}async recordOutcomesToLearner(e,t,i){for(let s of e){let a={skillName:s.skill,trustTier:s.trustTier||t,validationLevel:s.validationLevel||i,model:s.model,passed:s.errors.length===0&&s.evalPassRate>=.9,score:s.evalPassRate,testCaseResults:this.createTestCaseResults(s),timestamp:s.timestamp,runId:`swarm-${Date.now()}`,metadata:{duration:s.durationMs,retryCount:s.retryCount}};await this.learner.recordValidationOutcome(a)}}createTestCaseResults(e){return[{testId:`${e.skill}-${e.model}-aggregate`,passed:e.errors.length===0,expectedPatterns:["valid-output"],actualPatterns:e.errors.length===0?["valid-output"]:[],reasoningQuality:e.evalPassRate,executionTimeMs:e.durationMs,category:"swarm-validation",priority:"high",error:e.errors.length>0?e.errors.join("; "):void 0}]}delay(e){return new Promise(t=>setTimeout(t,e))}getConfig(){return{...this.config}}isValidationRunning(){return this.isRunning}getWorkerStatus(){return Array.from(this.workers.values())}cancel(){this.isRunning=!1,this.taskQueue=[]}};function D(y,e){return new R(y,e)}var F=["security-testing","accessibility-testing","api-testing","performance-testing","visual-regression-testing","mutation-testing","contract-testing","chaos-testing","compliance-testing","penetration-testing"],I=["claude-sonnet","claude-haiku","claude-opus"];P();import{readFileSync as E,writeFileSync as L,existsSync as N}from"fs";var O={varianceThreshold:.04,regressionThreshold:.1,minSamples:3,autoUpdateManifest:!1},k=class{constructor(e,t,i={}){this.learner=e;this.manifestPath=t;this.config={...O,...i}}learner;manifestPath;config;async aggregateResults(e){let t=`agg-${Date.now()}`,i=new Date,s=this.buildSkillResultsMap(e),a=this.calculateSummary(s,e),n=await this.detectCrossModelAnomalies(e),c=await this.detectRegressions(e,this.config.regressionThreshold),r=this.generateRecommendations(s,n,c),o={timestamp:i,runId:t,summary:a,skillResults:s,crossModelAnalysis:n,regressions:c,recommendations:r,metadata:{version:"1.0.0",environment:e[0]?.metadata?.environment,generatedBy:"ValidationResultAggregator",inputs:{runIds:e.map(l=>l.runId),models:[...new Set(e.map(l=>l.model))]}}};return this.config.autoUpdateManifest&&await this.updateManifest(o),o}buildSkillResultsMap(e){let t=new Map;for(let i of e)for(let s of i.outcomes){let a=s.skillName;t.has(a)||t.set(a,{skill:a,trustTier:s.trustTier,passRateByModel:new Map,avgPassRate:0,schemaValid:!0,validatorPassed:!0,evalPassed:!0,issues:[],executionTimeMs:0,testCount:0,passedTests:0,failedTests:0});let n=t.get(a),c=s.testCaseResults.filter(r=>r.passed).length/(s.testCaseResults.length||1);n.passRateByModel.set(i.model,c),n.testCount+=s.testCaseResults.length,n.passedTests+=s.testCaseResults.filter(r=>r.passed).length,n.failedTests+=s.testCaseResults.filter(r=>!r.passed).length,n.executionTimeMs+=s.metadata?.duration||0,s.validationLevel==="schema"&&!s.passed&&(n.schemaValid=!1),s.validationLevel==="validator"&&!s.passed&&(n.validatorPassed=!1),s.validationLevel==="eval"&&!s.passed&&(n.evalPassed=!1);for(let r of s.testCaseResults)!r.passed&&r.error&&n.issues.push({skill:a,model:i.model,severity:r.priority==="critical"?"critical":r.priority==="high"?"high":r.priority==="medium"?"medium":"low",type:this.categorizeIssueType(s.validationLevel,r.error),message:r.error,testId:r.testId})}for(let i of t.values()){let s=Array.from(i.passRateByModel.values());i.avgPassRate=s.length>0?s.reduce((a,n)=>a+n,0)/s.length:0}return t}categorizeIssueType(e,t){return t.toLowerCase().includes("timeout")?"timeout":e==="schema"?"schema_failure":e==="validator"?"validator_failure":e==="eval"?"eval_failure":"error"}calculateSummary(e,t){let i=Array.from(e.values()),s=i.filter(n=>n.avgPassRate>=.9).length,a=i.length>0?i.reduce((n,c)=>n+c.avgPassRate,0)/i.length:0;return{totalSkills:i.length,passedSkills:s,failedSkills:i.length-s,avgPassRate:a,totalDurationMs:t.reduce((n,c)=>n+c.durationMs,0),totalTests:i.reduce((n,c)=>n+c.testCount,0),passedTests:i.reduce((n,c)=>n+c.passedTests,0),failedTests:i.reduce((n,c)=>n+c.failedTests,0),modelsUsed:[...new Set(t.map(n=>n.model))]}}async detectCrossModelAnomalies(e){let t=new Map,i=new Map,s=new Map;for(let d of e){t.has(d.model)||(t.set(d.model,[]),i.set(d.model,{totalTests:0,passedTests:0,skillCount:0}));for(let g of d.outcomes){let h=g.testCaseResults.filter(m=>m.passed).length/(g.testCaseResults.length||1);t.get(d.model).push(h);let f=i.get(d.model);f.totalTests+=g.testCaseResults.length,f.passedTests+=g.testCaseResults.filter(m=>m.passed).length,f.skillCount++,s.has(g.skillName)||s.set(g.skillName,{passRates:[],models:[]}),s.get(g.skillName).passRates.push(h),s.get(g.skillName).models.push(d.model)}}let a=[];for(let d of t.values())a.push(...d);let n=a.length>0?a.reduce((d,g)=>d+g,0)/a.length:0,c=a.length>1?a.reduce((d,g)=>d+Math.pow(g-n,2),0)/a.length:0,r=Math.sqrt(c),o=[],l=new Map;for(let[d,g]of t.entries()){let h=g.reduce((v,V)=>v+V,0)/g.length,f=h-n,m=i.get(d);l.set(d,{avgPassRate:h,skillCount:m.skillCount,totalTests:m.totalTests}),Math.abs(f)>this.config.varianceThreshold*2&&o.push({model:d,type:f<0?"low_performance":"high_variance",description:`Model ${d} has ${(f*100).toFixed(1)}% difference from average`,passRate:h,avgPassRate:n,deviation:Math.abs(f)})}let u=[],p=[];for(let[d,g]of s.entries()){if(g.passRates.length<2)continue;let h=g.passRates.reduce((m,v)=>m+v,0)/g.passRates.length;g.passRates.reduce((m,v)=>m+Math.pow(v-h,2),0)/g.passRates.length<this.config.varianceThreshold?u.push(d):p.push(d)}return{variance:c,stdDeviation:r,anomalies:o,consistentSkills:u,inconsistentSkills:p,modelPerformance:l}}async detectRegressions(e,t){let i=[],s=new Set;for(let a of e)for(let n of a.outcomes){let c=`${n.skillName}-${a.model}`;if(s.has(c))continue;s.add(c);let r=await this.learner.getValidationTrends(n.skillName);if(!r)continue;let o=n.testCaseResults.filter(p=>p.passed).length/(n.testCaseResults.length||1),l=r.recentPassRate,u=l-o;u>=t&&i.push({skill:n.skillName,model:a.model,previousPassRate:l,currentPassRate:o,regressionAmount:u,trend:r.overall,possibleCauses:this.analyzePossibleCauses(n,u),severity:this.categorizeRegressionSeverity(u)})}return i.sort((a,n)=>{let c={critical:0,high:1,medium:2,low:3},r=c[a.severity]-c[n.severity];return r!==0?r:n.regressionAmount-a.regressionAmount})}analyzePossibleCauses(e,t){let i=[],s=e.testCaseResults.filter(c=>!c.passed);if(s.length>0){let c=[...new Set(s.map(r=>r.category).filter(Boolean))];c.length>0&&i.push(`Failures in categories: ${c.join(", ")}`)}let a=s.filter(c=>c.priority==="critical");a.length>0&&i.push(`${a.length} critical test(s) failing`);let n=e.testCaseResults.reduce((c,r)=>c+r.reasoningQuality,0)/(e.testCaseResults.length||1);return n<.7&&i.push(`Low reasoning quality score: ${(n*100).toFixed(1)}%`),t>.3&&i.push("Possible model behavior change or prompt drift"),i.length===0&&i.push("No specific cause identified - review test details"),i}categorizeRegressionSeverity(e){return e>=.5?"critical":e>=.3?"high":e>=.15?"medium":"low"}generateRecommendations(e,t,i){let s=[];if(t.inconsistentSkills.length>0&&s.push(`Review ${t.inconsistentSkills.length} skills with inconsistent cross-model behavior: `+t.inconsistentSkills.slice(0,3).join(", ")+(t.inconsistentSkills.length>3?` and ${t.inconsistentSkills.length-3} more`:"")),t.anomalies.some(r=>r.type==="low_performance")){let r=t.anomalies.filter(o=>o.type==="low_performance").map(o=>o.model);s.push(`Investigate low performance on model(s): ${r.join(", ")}`)}let a=i.filter(r=>r.severity==="critical");a.length>0&&s.push(`URGENT: ${a.length} critical regression(s) detected - immediate review required`);let n=Array.from(e.values()).filter(r=>r.avgPassRate<.9);if(n.length>0){let r=n.filter(l=>!l.schemaValid),o=n.filter(l=>!l.validatorPassed);r.length>0&&s.push(`Fix schema validation for: ${r.map(l=>l.skill).slice(0,3).join(", ")}`),o.length>0&&s.push(`Review validator scripts for: ${o.map(l=>l.skill).slice(0,3).join(", ")}`)}return Array.from(e.values()).reduce((r,o)=>r+o.avgPassRate,0)/e.size<.8&&s.push("Overall pass rate below 80% - consider reviewing skill definitions and test expectations"),s.length===0&&s.push("All validations passing - no immediate action required"),s}async updateManifest(e){if(!N(this.manifestPath))throw new Error(`Manifest file not found: ${this.manifestPath}`);let t=C(E(this.manifestPath,"utf-8"));for(let[s,a]of e.skillResults.entries())if(t.skills&&t.skills[s]){let n=t.skills[s];n.validation||(n.validation={}),n.validation.passRate=a.avgPassRate,n.validation.lastValidated=e.timestamp.toISOString(),n.validation.status=a.avgPassRate>=.9?"passing":"failing",n.validation.passRateByModel=Object.fromEntries(a.passRateByModel)}let i=Array.from(e.skillResults.values());t.validationStatus={passing:i.filter(s=>s.avgPassRate>=.9).length,failing:i.filter(s=>s.avgPassRate<.9).length,unknown:0,skipped:t.summary?.tier0||0},t.generatedAt=new Date().toISOString(),t.lastValidationRun={runId:e.runId,timestamp:e.timestamp.toISOString(),avgPassRate:e.summary.avgPassRate,modelsUsed:e.summary.modelsUsed},L(this.manifestPath,JSON.stringify(t,null,2))}generateMarkdownReport(e){let{summary:t,crossModelAnalysis:i,regressions:s,recommendations:a,skillResults:n}=e,c=(t.avgPassRate>=.9||t.avgPassRate>=.7,"`"),r=[];if(r.push(`# Validation Report
3
3
 
4
4
  > ${c} Generated: ${e.timestamp.toISOString()}
5
5
  > Run ID: ${e.runId}
@@ -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.14");process.exit(0)}
2
- import{a as h}from"./chunk-MKYOE7NE.js";import{a as C,f as x}from"./chunk-JAOCHPYX.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.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(`
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};
@@ -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.14");process.exit(0)}
2
- import{d as s}from"./chunk-XN3KCKAM.js";s();
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{d as s}from"./chunk-V5NHZV7S.js";s();
@@ -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.14");process.exit(0)}
2
- import{a as p}from"./chunk-YKQWIXUY.js";import{c as g}from"./chunk-C3OIBFAA.js";p();import{format as R}from"node:util";var c=2,E={debug:0,info:1,warn:2,warning:2,error:3,silent:4,none:4,off:4},C=new Set(["1","true","yes","on"]),b=/\x1b\[[0-9;]*m/g,N=/^\[(?:\d{2}:\d{2}:\d{2}\.\d{3}|\d{4}-\d{2}-\d{2}T[^\]]+)\]\s+\[(DEBUG|INFO|WARN|ERROR)\s*\]/,O=/^\[[A-Za-z][\w./:-]*\]\s/,S={debug:0,log:1,info:1,warn:2,error:3},d=c;function s(o){if(o)return E[o.trim().toLowerCase()]}function _(o=process.env,e=c){let t=s(o.AQE_LOG_LEVEL)??s(o.LOG_LEVEL);return t!==void 0?t:o.AQE_VERBOSE&&C.has(o.AQE_VERBOSE.trim().toLowerCase())?1:e}function x(o,e){if(typeof e!="string")return null;let t=e.replace(b,""),r=N.exec(t.trimStart());return r?E[r[1].toLowerCase()]:O.test(t)?S[o]:null}function I(o=process.env){return s(o.AQE_LOG_LEVEL)!==void 0||s(o.LOG_LEVEL)!==void 0}function m(o,e=process.env){return o.verbose!==!0||I(e)||a(1)?!1:(f(1),!0)}function a(o){return o>=d&&d!==4}function f(o){d=o,g.setLevel(o)}function k(o={}){let e=o.target??console,t=o.writeStderr??(n=>{process.stderr.write(n)});f(o.level??_());let r={log:e.log.bind(e),info:e.info.bind(e),debug:e.debug.bind(e),warn:e.warn.bind(e),error:e.error.bind(e)},l=n=>t(R(...n)+`
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 p}from"./chunk-YAPLJR7K.js";import{c as g}from"./chunk-G5RHFBAY.js";p();import{format as R}from"node:util";var c=2,E={debug:0,info:1,warn:2,warning:2,error:3,silent:4,none:4,off:4},C=new Set(["1","true","yes","on"]),b=/\x1b\[[0-9;]*m/g,N=/^\[(?:\d{2}:\d{2}:\d{2}\.\d{3}|\d{4}-\d{2}-\d{2}T[^\]]+)\]\s+\[(DEBUG|INFO|WARN|ERROR)\s*\]/,O=/^\[[A-Za-z][\w./:-]*\]\s/,S={debug:0,log:1,info:1,warn:2,error:3},d=c;function s(o){if(o)return E[o.trim().toLowerCase()]}function _(o=process.env,e=c){let t=s(o.AQE_LOG_LEVEL)??s(o.LOG_LEVEL);return t!==void 0?t:o.AQE_VERBOSE&&C.has(o.AQE_VERBOSE.trim().toLowerCase())?1:e}function x(o,e){if(typeof e!="string")return null;let t=e.replace(b,""),r=N.exec(t.trimStart());return r?E[r[1].toLowerCase()]:O.test(t)?S[o]:null}function I(o=process.env){return s(o.AQE_LOG_LEVEL)!==void 0||s(o.LOG_LEVEL)!==void 0}function m(o,e=process.env){return o.verbose!==!0||I(e)||a(1)?!1:(f(1),!0)}function a(o){return o>=d&&d!==4}function f(o){d=o,g.setLevel(o)}function k(o={}){let e=o.target??console,t=o.writeStderr??(n=>{process.stderr.write(n)});f(o.level??_());let r={log:e.log.bind(e),info:e.info.bind(e),debug:e.debug.bind(e),warn:e.warn.bind(e),error:e.error.bind(e)},l=n=>t(R(...n)+`
3
3
  `),i=(n,v,w)=>(...L)=>{let u=x(n,L[0]);u===null?v(L):a(u)&&w(L)};return e.log=i("log",n=>r.log(...n),l),e.debug=i("debug",n=>r.debug(...n),l),e.info=i("info",l,l),e.warn=i("warn",n=>r.warn(...n),n=>r.warn(...n)),e.error=i("error",n=>r.error(...n),n=>r.error(...n)),()=>{e.log=r.log,e.info=r.info,e.debug=r.debug,e.warn=r.warn,e.error=r.error}}export{_ as a,m as b,a as c,f as d,k as e};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{a as O,b as j}from"./chunk-WKI46WWN.js";import{d as A,e as G}from"./chunk-43XHGWYH.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-7MISCSL5.js";import{b as S,e as z}from"./chunk-L5VSLPMW.js";import{b as g}from"./chunk-V6SE2ZU2.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.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+=`
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.14");process.exit(0)}
2
- import{i as t}from"./chunk-QP6GL3O5.js";function g(e,n,r,a){return{id:t(),type:e,timestamp:new Date,source:n,correlationId:a,payload:r}}var i={TestGenerated:"test-generation.TestGenerated",TestSuiteCreated:"test-generation.TestSuiteCreated",PatternLearned:"test-generation.PatternLearned",GenerationFailed:"test-generation.GenerationFailed"},o={TestRunStarted:"test-execution.TestRunStarted",TestRunCompleted:"test-execution.TestRunCompleted",FlakyTestDetected:"test-execution.FlakyTestDetected",RetryTriggered:"test-execution.RetryTriggered"};function y(e){return!!e&&typeof e=="object"&&e.measured===!0}var s={CoverageReportCreated:"coverage-analysis.CoverageReportCreated",CoverageGapDetected:"coverage-analysis.CoverageGapDetected",RiskZoneIdentified:"coverage-analysis.RiskZoneIdentified"},d={QualityGateEvaluated:"quality-assessment.QualityGateEvaluated",DeploymentApproved:"quality-assessment.DeploymentApproved",DeploymentBlocked:"quality-assessment.DeploymentBlocked"},l={DefectPredicted:"defect-intelligence.DefectPredicted",RootCauseIdentified:"defect-intelligence.RootCauseIdentified",RegressionRiskAnalyzed:"defect-intelligence.RegressionRiskAnalyzed"},c={KnowledgeGraphUpdated:"code-intelligence.KnowledgeGraphUpdated",ImpactAnalysisCompleted:"code-intelligence.ImpactAnalysisCompleted",SemanticSearchCompleted:"code-intelligence.SemanticSearchCompleted",C4DiagramsGenerated:"code-intelligence.C4DiagramsGenerated"},m={VulnerabilityDetected:"security-compliance.VulnerabilityDetected",ComplianceValidated:"security-compliance.ComplianceValidated",SecurityAuditCompleted:"security-compliance.SecurityAuditCompleted"},p={PatternConsolidated:"learning-optimization.PatternConsolidated",TransferCompleted:"learning-optimization.TransferCompleted",OptimizationApplied:"learning-optimization.OptimizationApplied",DreamCycleCompleted:"learning-optimization.dream.completed"},b={...i,...o,...s,...d,...l,...c,...m,...p};export{g as a,i as b,o as c,y as d,s as e,d as f,l as g,c as h,m as i,p as j};
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{i as t}from"./chunk-HGWXF45W.js";function g(e,n,r,a){return{id:t(),type:e,timestamp:new Date,source:n,correlationId:a,payload:r}}var i={TestGenerated:"test-generation.TestGenerated",TestSuiteCreated:"test-generation.TestSuiteCreated",PatternLearned:"test-generation.PatternLearned",GenerationFailed:"test-generation.GenerationFailed"},o={TestRunStarted:"test-execution.TestRunStarted",TestRunCompleted:"test-execution.TestRunCompleted",FlakyTestDetected:"test-execution.FlakyTestDetected",RetryTriggered:"test-execution.RetryTriggered"};function y(e){return!!e&&typeof e=="object"&&e.measured===!0}var s={CoverageReportCreated:"coverage-analysis.CoverageReportCreated",CoverageGapDetected:"coverage-analysis.CoverageGapDetected",RiskZoneIdentified:"coverage-analysis.RiskZoneIdentified"},d={QualityGateEvaluated:"quality-assessment.QualityGateEvaluated",DeploymentApproved:"quality-assessment.DeploymentApproved",DeploymentBlocked:"quality-assessment.DeploymentBlocked"},l={DefectPredicted:"defect-intelligence.DefectPredicted",RootCauseIdentified:"defect-intelligence.RootCauseIdentified",RegressionRiskAnalyzed:"defect-intelligence.RegressionRiskAnalyzed"},c={KnowledgeGraphUpdated:"code-intelligence.KnowledgeGraphUpdated",ImpactAnalysisCompleted:"code-intelligence.ImpactAnalysisCompleted",SemanticSearchCompleted:"code-intelligence.SemanticSearchCompleted",C4DiagramsGenerated:"code-intelligence.C4DiagramsGenerated"},m={VulnerabilityDetected:"security-compliance.VulnerabilityDetected",ComplianceValidated:"security-compliance.ComplianceValidated",SecurityAuditCompleted:"security-compliance.SecurityAuditCompleted"},p={PatternConsolidated:"learning-optimization.PatternConsolidated",TransferCompleted:"learning-optimization.TransferCompleted",OptimizationApplied:"learning-optimization.OptimizationApplied",DreamCycleCompleted:"learning-optimization.dream.completed"},b={...i,...o,...s,...d,...l,...c,...m,...p};export{g as a,i as b,o as c,y as d,s as e,d as f,l as g,c as h,m as i,p as j};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{b as t,d as o}from"./chunk-V6SE2ZU2.js";var L={};o(L,{DotProductAttention:()=>d,FlashAttention:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
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:()=>m,HyperbolicAttention:()=>f,LinearAttention:()=>h,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>g,TensorCompress:()=>c,default:()=>i,differentiableSearch:()=>l,getCompressionLevel:()=>s,hierarchicalForward:()=>p,init:()=>u,pipeline:()=>v});import{createRequire as n}from"module";var r,e,i,a,c,l,p,s,u,m,d,A,f,h,_,g,v,b=t(()=>{r=n(import.meta.url),e=r("@ruvector/gnn"),i=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:p,getCompressionLevel:s,init:u,FlashAttention:m,DotProductAttention:d,MultiHeadAttention:A,HyperbolicAttention:f,LinearAttention:h,MoEAttention:_,SonaEngine:g,pipeline:v}=e||{}});export{L as a,b};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{b as t}from"./chunk-V6SE2ZU2.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.16");process.exit(0)}
2
+ import{b as t}from"./chunk-AJMJNQMP.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,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.14");process.exit(0)}
2
- import{a as y,b as C}from"./chunk-KJ5A54ZH.js";import{b as h}from"./chunk-N736GLWZ.js";import{f as g,g as v,l as f,m as b,n as p,p as d}from"./chunk-65EE2EST.js";import D from"chalk";var E=3,R="instrumented-report",T="static-estimation";async function x(e,r=n=>console.log(n)){let n=await f(e);if(n.status==="target-missing")return{kind:"no-data",reason:"target-missing",message:d("target-missing",e,null)};if(n.status==="evaluated"){let{evaluation:a,projectRoot:t}=n;if(a.status==="measured"){let{files:u,evidence:i}=a;return{kind:"data",data:{files:u,summary:y(u),instrumented:!0,...i.unmeasuredFiles.length>0?{unmeasuredFiles:i.unmeasuredFiles}:{}},projectRoot:t,evidence:i}}return{kind:"no-data",reason:a.reason,message:d(a.reason,e,t)}}let s=h(n.target,{includeTests:!1});return s.length===0?{kind:"no-sources"}:(r(D.gray(` Analyzing ${s.length} files...
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 y,b as C}from"./chunk-RV74I3YO.js";import{b as h}from"./chunk-GSKMOPL7.js";import{f as g,g as v,l as f,m as b,n as p,p as d}from"./chunk-D6COXLYE.js";import D from"chalk";var E=3,R="instrumented-report",T="static-estimation";async function x(e,r=n=>console.log(n)){let n=await f(e);if(n.status==="target-missing")return{kind:"no-data",reason:"target-missing",message:d("target-missing",e,null)};if(n.status==="evaluated"){let{evaluation:a,projectRoot:t}=n;if(a.status==="measured"){let{files:u,evidence:i}=a;return{kind:"data",data:{files:u,summary:y(u),instrumented:!0,...i.unmeasuredFiles.length>0?{unmeasuredFiles:i.unmeasuredFiles}:{}},projectRoot:t,evidence:i}}return{kind:"no-data",reason:a.reason,message:d(a.reason,e,t)}}let s=h(n.target,{includeTests:!1});return s.length===0?{kind:"no-sources"}:(r(D.gray(` Analyzing ${s.length} files...
3
3
  `)),{kind:"data",data:C(s,n.projectRoot),projectRoot:n.projectRoot})}function w(e){return{branch:e.files.some(r=>r.branches.total>0),function:e.files.some(r=>r.functions.total>0),statement:e.files.some(r=>r.statements.total>0)}}var F=e=>e==="target-missing"||e==="unreadable-report";function N(){return"UNMEASURED: no coverage report exists for this project, so these figures are a STATIC ESTIMATE derived from source shape \u2014 not measured coverage. No threshold verdict is given and nothing is stored as evidence. Run your tests with coverage first (e.g. `npm test -- --coverage`) and re-run."}async function O(e,r,n,s){let a=await x(r,s);if(a.kind==="no-sources")return a;if(a.kind==="no-data")return F(a.reason)?{kind:"error",reason:a.reason,message:a.message}:{kind:"unmeasured",reason:a.reason,message:a.message};let t=a.data,u=t.instrumented,i=await e.analyze({coverageData:t,threshold:n,includeFileDetails:!0,measured:u,...a.projectRoot?{projectRoot:a.projectRoot}:{}});if(!i.success||!i.value)return{kind:"analysis-failed",message:i.error?.message||"Coverage analysis failed"};let o=i.value;if(!u)return{kind:"estimate",data:t,summary:{...o.summary},message:N()};let l=w(t),c=b(o.summary,n,l),m=g(a.evidence,a.projectRoot??r),k={...c,meetsThreshold:c.meetsThreshold&&m.length===0};return{kind:"measured",data:t,collected:l,verdict:k,insufficientEvidence:m,...a.evidence?{evidence:a.evidence}:{},summary:{...o.summary,branch:l.branch?o.summary.branch:null,function:l.function?o.summary.function:null,statement:l.statement?o.summary.statement:null},recommendations:p(o.recommendations??[],c,n,l)}}function U(e,r){switch(e.kind){case"measured":{if(e.insufficientEvidence.length>0)return E;let{overall:n,meetsThreshold:s}=e.verdict;return s?n<r+5?2:0:1}case"estimate":case"unmeasured":return E;case"no-sources":return 0;default:return 1}}function j(e,r){if(e.length===0&&r.length===0)return{};let n=e.length>0?`INSUFFICIENT EVIDENCE: ${e.join("; ")}`:"";return r.length===0?{warning:n}:{warning:[n&&n.replace(/\.?$/,"."),...r].filter(Boolean).join(" ")}}function _(e,r,n){let s={line:null,branch:null,function:null,statement:null};switch(e.kind){case"measured":return{summary:e.summary,meetsThreshold:e.verdict.meetsThreshold,threshold:r,recommendations:e.recommendations,measured:!0,estimated:!1,coverageMethod:R,branchDataCollected:e.collected.branch,functionDataCollected:e.collected.function,statementDataCollected:e.collected.statement,...e.data.unmeasuredFiles?.length?{unmeasuredFiles:e.data.unmeasuredFiles}:{},...e.evidence?{evidenceStatus:e.evidence.status}:{},...e.evidence?.stale?{staleReport:e.evidence.stale}:{},...e.evidence?.conflictingFiles?{conflictingFiles:e.evidence.conflictingFiles}:{},...e.evidence?.excludedEntries?{excludedReportEntries:e.evidence.excludedEntries}:{},...j(e.insufficientEvidence,v(e.evidence))};case"estimate":return{summary:e.summary,meetsThreshold:null,threshold:r,measured:!1,estimated:!0,unmeasured:!0,coverageMethod:T,reason:"no-coverage-report",target:n,warning:e.message};case"unmeasured":case"error":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,unmeasured:e.kind==="unmeasured",reason:e.reason,target:n,warning:e.message};case"analysis-failed":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,target:n,error:e.message};case"no-sources":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,target:n,warning:"No source files found"}}}export{E as a,x as b,O as c,U as d,_ as e};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{a as w}from"./chunk-R5RRWLRI.js";import{i as v}from"./chunk-QP6GL3O5.js";import{c as p,d as l}from"./chunk-RE6JTSDM.js";import{a as g,b as x,e as y}from"./chunk-L5VSLPMW.js";y();var h=class extends Error{constructor(e){super(`Action timed out after ${e}ms; outcome is unknown`),this.name="ActionTimeoutError"}},m={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolOutcomeUnknown:"coordination.ProtocolOutcomeUnknown",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed",ActionOutcomeUnknown:"coordination.ActionOutcomeUnknown"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?l(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(m.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):l(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?l(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):l(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?l(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):l(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let n=v(),a=o?.correlationId??n,i={executionId:n,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},d={execution:i,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(n,d),await this.publishEvent(m.ProtocolStarted,{executionId:n,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(d);let r=Array.from(d.actionResults.values()),s=r.filter(c=>c.status==="unknown").map(c=>c.actionId),u=r.filter(c=>c.status==="failed").map(c=>c.actionId);return d.cancelled?i.status="cancelled":s.length>0?(i.status="unknown",await this.publishEvent(m.ProtocolOutcomeUnknown,{executionId:n,protocolId:e.id,unknownActions:s,failedActions:u},a)):u.length>0?(i.status="failed",await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,failedActions:u},a)):(i.status="completed",await this.publishEvent(m.ProtocolCompleted,{executionId:n,protocolId:e.id,duration:Date.now()-i.startedAt.getTime()},a)),i.completedAt=new Date,i.results=d.actionResults,await this.storeExecutionHistory(i),p(this.toImmutableExecution(i))}catch(r){return i.status="failed",i.completedAt=new Date,await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,error:g(r)},a),l(x(r))}}async executeActions(e){let{protocol:t,actionResults:o}=e,n=new Set(t.actions.map(i=>i.id)),a=new Set;for(;n.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let i=t.actions.filter(r=>n.has(r.id)&&this.dependenciesSatisfied(r,a));if(i.length===0&&n.size>0){let r=!1;for(let s of t.actions)n.has(s.id)&&s.dependsOn?.some(u=>{let c=o.get(u)?.status;return c!==void 0&&c!=="completed"})&&(o.set(s.id,{actionId:s.id,status:"skipped"}),n.delete(s.id),r=!0);if(r)continue;throw new Error(`Deadlock detected: actions ${Array.from(n).join(", ")} cannot proceed`)}let d=await Promise.allSettled(i.map(r=>this.executeAction(r,e)));for(let r=0;r<i.length;r++){let s=i[r],u=d[r],c;u.status==="fulfilled"?c=u.value:c={actionId:s.id,status:"failed",error:u.reason instanceof Error?u.reason.message:String(u.reason)},o.set(s.id,c),n.delete(s.id),c.status==="completed"&&a.add(s.id)}}for(let i of n)o.set(i,{actionId:i,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(m.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let n=0,a=e.retry?.maxAttempts??1,i;for(;n<a;){n++;try{let r=this.getDomainAPI(e.targetDomain);if(!r)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=r[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let u={...e.params,...t.params},c=await this.executeWithTimeout(s.bind(r)(u),e.timeout??3e4),P=new Date;return await this.publishEvent(m.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:P.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:P,duration:P.getTime()-o.getTime(),result:c,retryAttempts:n>1?n-1:void 0}}catch(r){if(i=x(r),r instanceof h){let s=new Date;return await this.publishEvent(m.ActionOutcomeUnknown,{executionId:t.execution.executionId,actionId:e.id,error:r.message,attempts:n},t.execution.correlationId),{actionId:e.id,status:"unknown",startedAt:o,completedAt:s,duration:s.getTime()-o.getTime(),error:r.message,retryAttempts:n>1?n-1:void 0}}if(n<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,n-1);await this.sleep(s)}}}let d=new Date;return await this.publishEvent(m.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:i?.message??"Unknown error",attempts:n},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:d,duration:d.getTime()-o.getTime(),error:i?.message??"Unknown error",retryAttempts:n>1?n-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){let o;try{return await Promise.race([e,new Promise((n,a)=>{o=setTimeout(()=>a(new h(t)),t)})])}finally{o&&clearTimeout(o)}}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:86400})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let n=w(e,"learning-optimization",t,o);await this.eventBus.publish(n)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(f,e,t){return new E(f,e,t)}export{E as a,S as b};
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 w}from"./chunk-C6D5AHBO.js";import{i as v}from"./chunk-HGWXF45W.js";import{c as p,d as l}from"./chunk-LE4QJREF.js";import{a as g,b as x,e as y}from"./chunk-KNSRL6NO.js";y();var h=class extends Error{constructor(e){super(`Action timed out after ${e}ms; outcome is unknown`),this.name="ActionTimeoutError"}},m={ProtocolStarted:"coordination.ProtocolStarted",ProtocolCompleted:"coordination.ProtocolCompleted",ProtocolFailed:"coordination.ProtocolFailed",ProtocolOutcomeUnknown:"coordination.ProtocolOutcomeUnknown",ProtocolCancelled:"coordination.ProtocolCancelled",ActionStarted:"coordination.ActionStarted",ActionCompleted:"coordination.ActionCompleted",ActionFailed:"coordination.ActionFailed",ActionOutcomeUnknown:"coordination.ActionOutcomeUnknown"},E=class{constructor(e,t,o){this.eventBus=e;this.memory=t;this.getDomainAPI=o}eventBus;memory;getDomainAPI;protocols=new Map;executions=new Map;scheduledProtocols=new Map;schedulerRunning=!1;registerProtocol(e){this.protocols.set(e.id,e),e.schedule.type==="event"&&e.enabled&&this.setupEventTriggers(e),(e.schedule.type==="cron"||e.schedule.type==="interval")&&e.enabled&&this.scheduleProtocol(e)}unregisterProtocol(e){if(!this.protocols.get(e))return!1;let o=this.scheduledProtocols.get(e);return o?.intervalId&&clearInterval(o.intervalId),this.scheduledProtocols.delete(e),this.protocols.delete(e),!0}getProtocol(e){return this.protocols.get(e)}listProtocols(){return Array.from(this.protocols.values())}async execute(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}async executeOnEvent(e,t){let o=this.protocols.get(e);return o?o.enabled?this.executeProtocol(o,void 0,t):l(new Error(`Protocol is disabled: ${e}`)):l(new Error(`Protocol not found: ${e}`))}getExecution(e){let t=this.executions.get(e);if(t)return this.toImmutableExecution(t.execution)}listActiveExecutions(){return Array.from(this.executions.values()).filter(e=>e.execution.status==="running"||e.execution.status==="paused").map(e=>this.toImmutableExecution(e.execution))}async cancelExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"&&t.execution.status!=="paused"?l(new Error(`Cannot cancel execution in status: ${t.execution.status}`)):(t.cancelled=!0,t.execution.status="cancelled",t.execution.completedAt=new Date,await this.publishEvent(m.ProtocolCancelled,{executionId:e,protocolId:t.protocol.id}),p(void 0)):l(new Error(`Execution not found: ${e}`))}async pauseExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="running"?l(new Error(`Cannot pause execution in status: ${t.execution.status}`)):(t.paused=!0,t.execution.status="paused",p(void 0)):l(new Error(`Execution not found: ${e}`))}async resumeExecution(e){let t=this.executions.get(e);return t?t.execution.status!=="paused"?l(new Error(`Cannot resume execution in status: ${t.execution.status}`)):(t.paused=!1,t.execution.status="running",p(void 0)):l(new Error(`Execution not found: ${e}`))}startScheduler(){if(!this.schedulerRunning){this.schedulerRunning=!0;for(let e of this.protocols.values())e.enabled&&(e.schedule.type==="interval"||e.schedule.type==="cron")&&this.scheduleProtocol(e)}}stopScheduler(){this.schedulerRunning=!1;for(let e of this.scheduledProtocols.values())e.intervalId&&(clearInterval(e.intervalId),e.intervalId=void 0)}async dispose(){this.stopScheduler(),this.protocols.clear(),this.executions.clear(),this.scheduledProtocols.clear()}async executeProtocol(e,t,o){let n=v(),a=o?.correlationId??n,i={executionId:n,protocolId:e.id,status:"running",participants:[...e.participants],results:new Map,startedAt:new Date,correlationId:a,triggeredBy:o},d={execution:i,protocol:e,params:t,actionResults:new Map,cancelled:!1,paused:!1};this.executions.set(n,d),await this.publishEvent(m.ProtocolStarted,{executionId:n,protocolId:e.id,participants:e.participants},a);try{await this.executeActions(d);let r=Array.from(d.actionResults.values()),s=r.filter(c=>c.status==="unknown").map(c=>c.actionId),u=r.filter(c=>c.status==="failed").map(c=>c.actionId);return d.cancelled?i.status="cancelled":s.length>0?(i.status="unknown",await this.publishEvent(m.ProtocolOutcomeUnknown,{executionId:n,protocolId:e.id,unknownActions:s,failedActions:u},a)):u.length>0?(i.status="failed",await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,failedActions:u},a)):(i.status="completed",await this.publishEvent(m.ProtocolCompleted,{executionId:n,protocolId:e.id,duration:Date.now()-i.startedAt.getTime()},a)),i.completedAt=new Date,i.results=d.actionResults,await this.storeExecutionHistory(i),p(this.toImmutableExecution(i))}catch(r){return i.status="failed",i.completedAt=new Date,await this.publishEvent(m.ProtocolFailed,{executionId:n,protocolId:e.id,error:g(r)},a),l(x(r))}}async executeActions(e){let{protocol:t,actionResults:o}=e,n=new Set(t.actions.map(i=>i.id)),a=new Set;for(;n.size>0&&!e.cancelled;){for(;e.paused&&!e.cancelled;)await this.sleep(100);if(e.cancelled)break;let i=t.actions.filter(r=>n.has(r.id)&&this.dependenciesSatisfied(r,a));if(i.length===0&&n.size>0){let r=!1;for(let s of t.actions)n.has(s.id)&&s.dependsOn?.some(u=>{let c=o.get(u)?.status;return c!==void 0&&c!=="completed"})&&(o.set(s.id,{actionId:s.id,status:"skipped"}),n.delete(s.id),r=!0);if(r)continue;throw new Error(`Deadlock detected: actions ${Array.from(n).join(", ")} cannot proceed`)}let d=await Promise.allSettled(i.map(r=>this.executeAction(r,e)));for(let r=0;r<i.length;r++){let s=i[r],u=d[r],c;u.status==="fulfilled"?c=u.value:c={actionId:s.id,status:"failed",error:u.reason instanceof Error?u.reason.message:String(u.reason)},o.set(s.id,c),n.delete(s.id),c.status==="completed"&&a.add(s.id)}}for(let i of n)o.set(i,{actionId:i,status:e.cancelled?"cancelled":"skipped"})}async executeAction(e,t){let o=new Date;await this.publishEvent(m.ActionStarted,{executionId:t.execution.executionId,actionId:e.id,actionName:e.name,targetDomain:e.targetDomain},t.execution.correlationId);let n=0,a=e.retry?.maxAttempts??1,i;for(;n<a;){n++;try{let r=this.getDomainAPI(e.targetDomain);if(!r)throw new Error(`Domain API not available: ${e.targetDomain}`);let s=r[e.method];if(typeof s!="function")throw new Error(`Method ${e.method} not found on domain ${e.targetDomain}`);let u={...e.params,...t.params},c=await this.executeWithTimeout(s.bind(r)(u),e.timeout??3e4),P=new Date;return await this.publishEvent(m.ActionCompleted,{executionId:t.execution.executionId,actionId:e.id,duration:P.getTime()-o.getTime()},t.execution.correlationId),{actionId:e.id,status:"completed",startedAt:o,completedAt:P,duration:P.getTime()-o.getTime(),result:c,retryAttempts:n>1?n-1:void 0}}catch(r){if(i=x(r),r instanceof h){let s=new Date;return await this.publishEvent(m.ActionOutcomeUnknown,{executionId:t.execution.executionId,actionId:e.id,error:r.message,attempts:n},t.execution.correlationId),{actionId:e.id,status:"unknown",startedAt:o,completedAt:s,duration:s.getTime()-o.getTime(),error:r.message,retryAttempts:n>1?n-1:void 0}}if(n<a&&e.retry){let s=e.retry.backoffMs*Math.pow(e.retry.backoffMultiplier??2,n-1);await this.sleep(s)}}}let d=new Date;return await this.publishEvent(m.ActionFailed,{executionId:t.execution.executionId,actionId:e.id,error:i?.message??"Unknown error",attempts:n},t.execution.correlationId),{actionId:e.id,status:"failed",startedAt:o,completedAt:d,duration:d.getTime()-o.getTime(),error:i?.message??"Unknown error",retryAttempts:n>1?n-1:void 0}}dependenciesSatisfied(e,t){return!e.dependsOn||e.dependsOn.length===0?!0:e.dependsOn.every(o=>t.has(o))}async executeWithTimeout(e,t){let o;try{return await Promise.race([e,new Promise((n,a)=>{o=setTimeout(()=>a(new h(t)),t)})])}finally{o&&clearTimeout(o)}}setupEventTriggers(e){if(e.schedule.type==="event")for(let t of e.schedule.triggerEvents)this.eventBus.subscribe(t,async o=>{await this.executeOnEvent(e.id,o)})}scheduleProtocol(e){if(e.schedule.type==="interval"){let t={protocolId:e.id,schedule:e.schedule};t.intervalId=setInterval(async()=>{this.schedulerRunning&&await this.execute(e.id)},e.schedule.intervalMs),this.scheduledProtocols.set(e.id,t)}}async storeExecutionHistory(e){let t=`protocol-execution:${e.executionId}`;await this.memory.set(t,{...e,results:Object.fromEntries(e.results)},{namespace:"coordination",ttl:86400})}toImmutableExecution(e){return{executionId:e.executionId,protocolId:e.protocolId,status:e.status,participants:[...e.participants],results:new Map(e.results),startedAt:e.startedAt,completedAt:e.completedAt,correlationId:e.correlationId,triggeredBy:e.triggeredBy}}async publishEvent(e,t,o){let n=w(e,"learning-optimization",t,o);await this.eventBus.publish(n)}sleep(e){return new Promise(t=>setTimeout(t,e))}};function S(f,e,t){return new E(f,e,t)}export{E as a,S as b};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{b as T}from"./chunk-V6SE2ZU2.js";var S,E,t,N,_=T(()=>{"use strict";S={MMAP_SIZE_BYTES:67108864,CACHE_SIZE_KB:-32e3,BUSY_TIMEOUT_MS:5e3,DEFAULT_VECTOR_DIMENSIONS:384,DEFAULT_SEARCH_LIMIT:100,CLEANUP_INTERVAL_MS:6e4,TTL_MULTIPLIER_MS:1e3},E={M_CONNECTIONS:16,EF_CONSTRUCTION:200,EF_SEARCH:100,DEFAULT_K_NEIGHBORS:10,COVERAGE_VECTOR_DIMENSION:384},t={MAX_CONCURRENT_AGENTS:15,DEFAULT_AGENT_TTL_MS:36e5,DEFAULT_AGENT_TIMEOUT_MS:12e4,MAX_POOL_SIZE:10},N={MAX_HISTORY_SIZE:1e4}});export{S as a,E as b,t as c,N as d,_ as e};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.16");process.exit(0)}
2
+ import{b as T}from"./chunk-AJMJNQMP.js";var S,E,t,N,_=T(()=>{"use strict";S={MMAP_SIZE_BYTES:67108864,CACHE_SIZE_KB:-32e3,BUSY_TIMEOUT_MS:5e3,DEFAULT_VECTOR_DIMENSIONS:384,DEFAULT_SEARCH_LIMIT:100,CLEANUP_INTERVAL_MS:6e4,TTL_MULTIPLIER_MS:1e3},E={M_CONNECTIONS:16,EF_CONSTRUCTION:200,EF_SEARCH:100,DEFAULT_K_NEIGHBORS:10,COVERAGE_VECTOR_DIMENSION:384},t={MAX_CONCURRENT_AGENTS:15,DEFAULT_AGENT_TTL_MS:36e5,DEFAULT_AGENT_TIMEOUT_MS:12e4,MAX_POOL_SIZE:10},N={MAX_HISTORY_SIZE:1e4}});export{S as a,E as b,t as c,N as d,_ as e};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.14");process.exit(0)}
2
- import{a as V,c as Y,d as q,e as R,f as K,j as H}from"./chunk-6O63ZTVX.js";import{c as B,d as C}from"./chunk-JI67T6Q2.js";import{c as P,e as Te}from"./chunk-43XHGWYH.js";import{c as z,d as $e}from"./chunk-2UZBLC5H.js";import*as x from"fs";import*as v from"path";import*as p from"fs";import*as ee from"os";import*as g from"path";Te();function Ae(e=process.env){let t=(e.AQE_COVERAGE_NO_EXEC??"").trim().toLowerCase();return t?t!=="false"&&t!=="0"&&t!=="no"&&t!=="off":!1}var De=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".rb"]),te=new Set(["node_modules","dist","build","coverage",".git",".claude",".agentic-qe","__pycache__",".venv","target","vendor"]),ne=new Set(["tests","test","__tests__","benches","examples","spec"]),Pe=[/\.test\./i,/\.spec\./i,/_test\./i,/_spec\./i,/^test_/i,/^test\./i,/^conftest\./i];function E(e,t){let n=e.split(g.sep).join("/"),r=g.basename(n);if(Pe.some(o=>o.test(r)))return!0;let s=n;if(t){let o=g.resolve(t).split(g.sep).join("/"),i=g.resolve(e).split(g.sep).join("/");(i===o||i.startsWith(`${o}/`))&&(s=i.slice(o.length).replace(/^\//,""))}return s.split("/").some(o=>ne.has(o))}function _e(e){let t=e.split(""),n=e.length,r=0,s=(o,i)=>{for(let a=o;a<i&&a<n;a++)e[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.16");process.exit(0)}
2
+ import{a as V,c as Y,d as q,e as R,f as K,j as H}from"./chunk-IUBJVHNB.js";import{c as P,e as Te}from"./chunk-HCH4Y6XX.js";import{c as B,d as C}from"./chunk-NZU4ACBZ.js";import{c as z,d as $e}from"./chunk-AGRV5B3T.js";import*as x from"fs";import*as v from"path";import*as p from"fs";import*as ee from"os";import*as g from"path";Te();function Ae(e=process.env){let t=(e.AQE_COVERAGE_NO_EXEC??"").trim().toLowerCase();return t?t!=="false"&&t!=="0"&&t!=="no"&&t!=="off":!1}var De=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".rb"]),te=new Set(["node_modules","dist","build","coverage",".git",".claude",".agentic-qe","__pycache__",".venv","target","vendor"]),ne=new Set(["tests","test","__tests__","benches","examples","spec"]),Pe=[/\.test\./i,/\.spec\./i,/_test\./i,/_spec\./i,/^test_/i,/^test\./i,/^conftest\./i];function E(e,t){let n=e.split(g.sep).join("/"),r=g.basename(n);if(Pe.some(o=>o.test(r)))return!0;let s=n;if(t){let o=g.resolve(t).split(g.sep).join("/"),i=g.resolve(e).split(g.sep).join("/");(i===o||i.startsWith(`${o}/`))&&(s=i.slice(o.length).replace(/^\//,""))}return s.split("/").some(o=>ne.has(o))}function _e(e){let t=e.split(""),n=e.length,r=0,s=(o,i)=>{for(let a=o;a<i&&a<n;a++)e[a]!==`
3
3
  `&&(t[a]=" ")};for(;r<n;){let o=e[r];if(o==="/"&&e[r+1]==="/"){let a=e.indexOf(`
4
4
  `,r),c=a===-1?n:a;s(r,c),r=c;continue}if(o==="/"&&e[r+1]==="*"){let a=0,c=r;for(;r<n;){if(e[r]==="/"&&e[r+1]==="*"){a++,r+=2;continue}if(e[r]==="*"&&e[r+1]==="/"){if(a--,r+=2,a===0)break;continue}r++}s(c,r);continue}let i=/^b?r(#*)"/.exec(e.slice(r,r+300));if(i){let a=`"${i[1]}`,c=r+i[0].length,u=e.indexOf(a,c),f=u===-1?n:u+a.length;s(r,f),r=f;continue}if(o==='"'){let a=r;for(r++;r<n;){if(e[r]==="\\"){r+=2;continue}if(e[r]==='"'){r++;break}r++}s(a,r);continue}if(o==="'"){let a=-1;if(e[r+1]==="\\"){let c=e.indexOf("'",r+2);c!==-1&&c<=r+5&&(a=c+1)}else e[r+2]==="'"&&(a=r+3);if(a!==-1){s(r,a),r=a;continue}}r++}return t.join("")}function Ne(e,t){if(t!==".rs")return[];let n=_e(e).split(`
5
5
  `),r=[];for(let s=0;s<n.length;s++){if(!/#\s*\[\s*cfg\s*\(\s*test\s*\)\s*\]/.test(n[s]))continue;let o=-1;for(let c=s;c<Math.min(n.length,s+10);c++){let u=n[c],f=u.indexOf("{"),h=u.indexOf(";");if(h!==-1&&(f===-1||h<f))break;if(f!==-1){let b=n.slice(s,c+1).join(" ");/\bmod\s+\w+/.test(b)&&(o=c);break}}if(o===-1)continue;let i=0,a=-1;for(let c=o;c<n.length;c++){for(let u of n[c])u==="{"?i++:u==="}"&&i--;if(i<=0){a=c;break}}r.push([s+1,(a===-1?n.length-1:a)+1]),s=a===-1?n.length:a}return r}function Me(e){if(e.length===0)return 0;let t=e.split(`
@@ -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.14");process.exit(0)}
2
- import{i as b,l as D,n as Q}from"./chunk-52KOPIMI.js";import{v as X}from"./chunk-JK6PMLQQ.js";import{d as _,e as Y}from"./chunk-C3OIBFAA.js";import{c as w}from"./chunk-2UZBLC5H.js";var W=["claude","claude-code","codex","openai","ollama","openrouter","bedrock","azure-openai","gemini","cognitum"];function x(r){return W.includes(r)}function p(r,o,e){let t=new Error(r);return t.name="LLMError",t.code=o,t.provider=e?.provider,t.model=e?.model,t.retryable=e?.retryable??!1,t.retryAfterMs=e?.retryAfterMs,t.cause=e?.cause,t}function Te(r){return r instanceof Error&&"code"in r&&typeof r.code=="string"}var y=new Map,Z=new Set(["anthropic"]),N=/^[a-z0-9][a-z0-9-]{0,62}$/;function M(r){if(typeof r!="string"||r.trim().length===0)return"provider type must be a non-empty string";if(r!==r.toLowerCase())return`provider type "${r}" must be lowercase (AQE_LLM_PROVIDER is matched case-insensitively)`;if(!N.test(r))return`provider type "${r}" must match ${N.source} (lowercase alphanumeric and dashes)`;if(x(r))return`provider type "${r}" is built in and cannot be overridden`;if(Z.has(r))return`provider type "${r}" is reserved`}function ee(r,o,e={}){let t=M(r);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});if(typeof o!="function")throw p(`provider "${r}" must be registered with a factory function`,"INVALID_REGISTRATION",{retryable:!1});y.set(r,{...e,type:r,factory:o,source:e.source??"api"})}function F(r,o,e={}){try{ee(r,o,e);return}catch(t){return t instanceof Error?t.message:String(t)}}function B(r){return y.delete(r)}function $(r){return y.has(r)}function ke(r){return y.get(r)}function h(){return[...y.keys()]}var re=["isAvailable","healthCheck","generate","complete","getConfig","getSupportedModels","getCostPerToken","dispose"];function te(r,o){if(!o||typeof o!="object")return`provider "${r}" factory returned ${o===null?"null":typeof o}, expected an LLMProvider`;let e=o,t=re.filter(i=>typeof e[i]!="function");if(t.length>0)return`provider "${r}" is missing required LLMProvider method(s): ${t.join(", ")}`;if(typeof e.type!="string"||e.type.length===0)return`provider "${r}" must expose a non-empty \`type\``;if(e.type!==r)return`provider "${r}" reports type "${e.type}" \u2014 a provider must not claim an identity other than the one it was registered under`}function Le(r){let o=y.get(r);if(!o)throw p(`Unknown provider type: ${r}`,"PROVIDER_UNAVAILABLE",{retryable:!1});let e=o.factory(o.config),t=te(r,e);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});return e}function Ae(r){let o=y.get(r);if(o)return{mode:o.billingMode??"metered-api",source:o.source,detail:o.sourceDetail}}Q();function q(r){return r==="onnx"||x(r)}var T=["claude","claude-code","codex","openai","ollama","openrouter","gemini","azure-openai","bedrock","cognitum","onnx"];var oe={maxAttempts:3,delayMs:100,trySameProviderAlternateModel:!0,skipOpenCircuits:!0,retryableErrors:["RATE_LIMITED","TIMEOUT","NETWORK_ERROR","PROVIDER_UNAVAILABLE"]},ne=[{provider:"claude",models:[b,D[1]],enabled:!0,priority:100,maxAttempts:2,timeoutMs:3e4},{provider:"openai",models:["gpt-6-sol","gpt-6-luna"],enabled:!0,priority:90,maxAttempts:2,timeoutMs:3e4},{provider:"openrouter",models:["anthropic/claude-sonnet-5","openai/gpt-6-sol"],enabled:!0,priority:85,maxAttempts:2,timeoutMs:3e4},{provider:"ollama",models:["qwen3-coder:30b","qwen3:30b-a3b"],enabled:!0,priority:80,maxAttempts:2,timeoutMs:6e4},{provider:"onnx",models:["phi-4","all-MiniLM-L6-v2"],enabled:!0,priority:70,maxAttempts:1,timeoutMs:12e4}],ie={id:"default-fallback-chain",entries:ne,maxRetries:3,retryDelayMs:100,backoffMultiplier:2,maxDelayMs:5e3},U={mode:"rule-based",rules:[],defaultProvider:"claude",defaultModel:b,fallbackChain:ie,fallbackBehavior:oe,providers:{claude:{enabled:!0,defaultModel:b},"claude-code":{enabled:!1,defaultModel:b},openai:{enabled:!0,defaultModel:"gpt-6-sol"},ollama:{enabled:!0,defaultModel:"qwen3-coder:30b"},openrouter:{enabled:!0,defaultModel:"anthropic/claude-sonnet-5"},gemini:{enabled:!1,defaultModel:"gemini-2.5-flash"},"azure-openai":{enabled:!1},bedrock:{enabled:!1},cognitum:{enabled:!1,defaultModel:"cognitum-auto"},onnx:{enabled:!0,defaultModel:"phi-4"}},enableMetrics:!0,metricsConfig:{enabled:!0,collectionIntervalMs:6e4,retentionMs:864e5,trackPerRequest:!0},maxDecisionTimeMs:10,cacheDecisions:!0,decisionCacheTtlMs:6e4,cacheConfig:{enabled:!0,ttlMs:6e4,maxEntries:1e3,keyStrategy:"agent-domain"},auditConfig:{enabled:!0,maxEntries:1e4,logContent:!1,logResponse:!1}},Ue=[{canonicalId:"claude-opus-5",canonicalName:"Claude Opus 5",providerIds:{claude:"claude-opus-5",openrouter:"anthropic/claude-opus-5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:5,outputCostPer1M:25},{canonicalId:"claude-sonnet-5",canonicalName:"Claude Sonnet 5",providerIds:{claude:"claude-sonnet-5",openrouter:"anthropic/claude-sonnet-5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"advanced",family:"claude",inputCostPer1M:2,outputCostPer1M:10},{canonicalId:"claude-opus-5-5",canonicalName:"Claude Opus 5.5",providerIds:{claude:"claude-opus-5-5",openrouter:"anthropic/claude-opus-5.5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:4,outputCostPer1M:20},{canonicalId:"claude-opus-4-7",canonicalName:"Claude Opus 4.7",providerIds:{claude:"claude-opus-4-7",openrouter:"anthropic/claude-opus-4.7",bedrock:"anthropic.claude-opus-4-7-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:5,outputCostPer1M:25},{canonicalId:"claude-sonnet-4-6",canonicalName:"Claude Sonnet 4.6",providerIds:{claude:"claude-sonnet-4-6",openrouter:"anthropic/claude-sonnet-4.6",bedrock:"anthropic.claude-sonnet-4-6-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"advanced",family:"claude",inputCostPer1M:3,outputCostPer1M:15},{canonicalId:"claude-haiku-4-5",canonicalName:"Claude Haiku 4.5",providerIds:{claude:"claude-haiku-4-5-20251001",openrouter:"anthropic/claude-haiku-4.5",bedrock:"anthropic.claude-haiku-4-5-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:2e5,maxOutputTokens:16384},tier:"standard",family:"claude",inputCostPer1M:1,outputCostPer1M:5},{canonicalId:"gpt-4o",canonicalName:"GPT-4o",providerIds:{openai:"gpt-4o","azure-openai":"gpt-4o",openrouter:"openai/gpt-4o"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"advanced",family:"gpt",inputCostPer1M:2.5,outputCostPer1M:10},{canonicalId:"gpt-4o-mini",canonicalName:"GPT-4o Mini",providerIds:{openai:"gpt-4o-mini","azure-openai":"gpt-4o-mini",openrouter:"openai/gpt-4o-mini"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"standard",family:"gpt",inputCostPer1M:.15,outputCostPer1M:.6},{canonicalId:"gemini-pro",canonicalName:"Gemini 2.0 Pro",providerIds:{gemini:"gemini-2.0-pro",openrouter:"google/gemini-2.0-pro"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:2e6,maxOutputTokens:8192},tier:"advanced",family:"gemini",inputCostPer1M:1.25,outputCostPer1M:5},{canonicalId:"llama-3.1-70b",canonicalName:"LLaMA 3.1 70B",providerIds:{ollama:"llama3.1:70b",openrouter:"meta-llama/llama-3.1-70b",bedrock:"meta.llama3-1-70b-instruct-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:4096},tier:"advanced",family:"llama",inputCostPer1M:.9,outputCostPer1M:.9},{canonicalId:"phi-4",canonicalName:"Microsoft Phi-4",providerIds:{ollama:"phi4",onnx:"phi-4",openrouter:"microsoft/phi-4"},capabilities:{supportsStreaming:!0,supportsTools:!1,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!1,maxContextTokens:16e3,maxOutputTokens:4096,requiresNetwork:!1},tier:"efficient",family:"phi",inputCostPer1M:0,outputCostPer1M:0}];import{spawn as se}from"node:child_process";import{accessSync as ae,constants as de,statSync as le}from"node:fs";import{delimiter as ue,join as pe}from"node:path";var ce=18e4,me=2,E="default";function R(r,o){if(!o||typeof o!="object")return`externalProviders["${r}"] must be an object`;let e=o;if(e.kind!=="cli")return`externalProviders["${r}"].kind must be "cli" (got ${JSON.stringify(e.kind)})`;if(!Array.isArray(e.command)||e.command.length===0)return`externalProviders["${r}"].command must be a non-empty string array`;if(!e.command.every(t=>typeof t=="string"&&t.length>0))return`externalProviders["${r}"].command must contain only non-empty strings`;if(e.billingMode!==void 0&&!["subscription","metered-api","metered-capped","local"].includes(e.billingMode))return`externalProviders["${r}"].billingMode "${String(e.billingMode)}" is not a valid billing mode`;if(e.models!==void 0&&(!Array.isArray(e.models)||e.models.some(t=>typeof t!="string")))return`externalProviders["${r}"].models must be a string array`;if(e.timeoutMs!==void 0&&(typeof e.timeoutMs!="number"||e.timeoutMs<=0))return`externalProviders["${r}"].timeoutMs must be a positive number`;if(e.maxConcurrency!==void 0&&(typeof e.maxConcurrency!="number"||e.maxConcurrency<1))return`externalProviders["${r}"].maxConcurrency must be >= 1`;if(e.stripEnv!==void 0&&(!Array.isArray(e.stripEnv)||e.stripEnv.some(t=>typeof t!="string")))return`externalProviders["${r}"].stripEnv must be a string array`;if("apiKey"in e)return`externalProviders["${r}"] must not contain an apiKey \u2014 keys belong in the environment, not in llm-config.json`}var P=class r{type;name;billingMode;config;requestCounter=0;availabilityCache;active=0;queue=[];constructor(o,e){let t=R(o,e);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});this.type=o,this.config=e,this.name=e.displayName??o,this.billingMode=e.billingMode??"metered-api"}async isAvailable(){let o=Date.now();if(this.availabilityCache&&o-this.availabilityCache.at<6e4)return this.availabilityCache.available;let e=ge(this.config.command[0]);return this.availabilityCache={at:o,available:e},e}async healthCheck(){let o=Date.now(),e=await this.isAvailable(),t=Date.now()-o;return e?{healthy:!0,latencyMs:t,models:this.getSupportedModels(),details:{command:this.config.command[0],billing:this.billingMode,external:!0}}:{healthy:!1,latencyMs:t,error:`External provider "${this.type}" could not run "${this.config.command[0]}". Check that the host is installed and on PATH.`}}async generate(o,e){let t=e?.model??this.defaultModel(),i=`${this.type}-${++this.requestCounter}-${Date.now()}`,n=ye(o,e?.systemPrompt),s=e?.timeoutMs??this.config.timeoutMs??ce,l=[];this.config.modelFlag&&t&&t!==E&&l.push(this.config.modelFlag,t);let a=Date.now(),{code:d,stdout:u,stderr:f}=await this.withConcurrency(()=>this.spawnHost(l,n,s)),g=Date.now()-a,v=u.trim();if(d!==0&&!v)throw this.classifyError(f||`${this.type} exited with code ${d}`,t);let c=Math.ceil(n.length/4),S=Math.ceil(v.length/4),J={promptTokens:c,completionTokens:S,totalTokens:c+S};return{content:v,model:t,provider:this.type,usage:J,cost:{inputCost:0,outputCost:0,totalCost:0,currency:"USD",source:"local-estimate"},latencyMs:g,finishReason:"stop",cached:!1,requestId:i}}async embed(o,e){throw p(`External provider "${this.type}" does not support embeddings. Use a provider with an embeddings endpoint (openai, ollama, cognitum).`,"EMBEDDING_UNSUPPORTED",{provider:this.type,retryable:!1})}async complete(o,e){let t=await this.generate(o,{model:e?.model,temperature:e?.temperature,maxTokens:e?.maxTokens});return{completion:t.content,model:t.model,provider:this.type,usage:t.usage,latencyMs:t.latencyMs,cached:t.cached}}getConfig(){return{...this.config}}getSupportedModels(){return[...this.config.models??[E]]}getCostPerToken(){return{input:0,output:0}}async dispose(){}defaultModel(){return this.config.defaultModel??this.config.models?.[0]??E}static childEnv(o=[],e=process.env){let t={...e};for(let i of o)delete t[i];return t}classifyError(o,e){let t=o.toLowerCase();return t.includes("rate limit")||t.includes("usage limit")||t.includes("429")||t.includes("quota")?p(o,"RATE_LIMITED",{provider:this.type,model:e,retryable:!0,retryAfterMs:6e4}):p(o,"PROVIDER_UNAVAILABLE",{provider:this.type,model:e,retryable:!0})}spawnHost(o,e,t){let[i,...n]=this.config.command,s=[...n,...o];return new Promise((l,a)=>{let d=se(i,s,{env:r.childEnv(this.config.stripEnv),stdio:["pipe","pipe","pipe"]}),u="",f="",g=!1,v=setTimeout(()=>{g||(g=!0,d.kill("SIGKILL"),a(p(`${this.type} timed out after ${t}ms`,"TIMEOUT",{provider:this.type,retryable:!0})))},t);d.stdout.on("data",c=>u+=c.toString()),d.stderr.on("data",c=>f+=c.toString()),d.on("error",c=>{g||(g=!0,clearTimeout(v),a(p(`Failed to spawn "${i}" for provider "${this.type}": ${c.message}`,"PROVIDER_UNAVAILABLE",{provider:this.type,retryable:!1,cause:c})))}),d.on("close",c=>{g||(g=!0,clearTimeout(v),l({code:c??0,stdout:u,stderr:f}))}),d.stdin.on("error",()=>{});try{d.stdin.write(e),d.stdin.end()}catch{}})}async withConcurrency(o){let e=this.config.maxConcurrency??me;this.active>=e&&await new Promise(t=>this.queue.push(t)),this.active++;try{return await o()}finally{this.active--;let t=this.queue.shift();t&&t()}}};function ge(r,o=process.env){let e=n=>{try{return ae(n,de.X_OK),le(n).isFile()}catch{return!1}};if(r.includes("/")||r.includes("\\"))return e(r);let t=(o.PATH??"").split(ue).filter(Boolean),i=process.platform==="win32"?["",...(o.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)]:[""];return t.some(n=>i.some(s=>e(pe(n,r+s))))}function ye(r,o){if(typeof r=="string")return o?`${o}
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{i as b,l as D,n as Q}from"./chunk-ZQ2XW3IP.js";import{B as X}from"./chunk-MO55CVMT.js";import{d as _,e as Y}from"./chunk-G5RHFBAY.js";import{c as w}from"./chunk-AGRV5B3T.js";var W=["claude","claude-code","codex","openai","ollama","openrouter","bedrock","azure-openai","gemini","cognitum"];function x(r){return W.includes(r)}function p(r,o,e){let t=new Error(r);return t.name="LLMError",t.code=o,t.provider=e?.provider,t.model=e?.model,t.retryable=e?.retryable??!1,t.retryAfterMs=e?.retryAfterMs,t.cause=e?.cause,t}function Te(r){return r instanceof Error&&"code"in r&&typeof r.code=="string"}var y=new Map,Z=new Set(["anthropic"]),N=/^[a-z0-9][a-z0-9-]{0,62}$/;function M(r){if(typeof r!="string"||r.trim().length===0)return"provider type must be a non-empty string";if(r!==r.toLowerCase())return`provider type "${r}" must be lowercase (AQE_LLM_PROVIDER is matched case-insensitively)`;if(!N.test(r))return`provider type "${r}" must match ${N.source} (lowercase alphanumeric and dashes)`;if(x(r))return`provider type "${r}" is built in and cannot be overridden`;if(Z.has(r))return`provider type "${r}" is reserved`}function ee(r,o,e={}){let t=M(r);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});if(typeof o!="function")throw p(`provider "${r}" must be registered with a factory function`,"INVALID_REGISTRATION",{retryable:!1});y.set(r,{...e,type:r,factory:o,source:e.source??"api"})}function F(r,o,e={}){try{ee(r,o,e);return}catch(t){return t instanceof Error?t.message:String(t)}}function B(r){return y.delete(r)}function $(r){return y.has(r)}function ke(r){return y.get(r)}function h(){return[...y.keys()]}var re=["isAvailable","healthCheck","generate","complete","getConfig","getSupportedModels","getCostPerToken","dispose"];function te(r,o){if(!o||typeof o!="object")return`provider "${r}" factory returned ${o===null?"null":typeof o}, expected an LLMProvider`;let e=o,t=re.filter(i=>typeof e[i]!="function");if(t.length>0)return`provider "${r}" is missing required LLMProvider method(s): ${t.join(", ")}`;if(typeof e.type!="string"||e.type.length===0)return`provider "${r}" must expose a non-empty \`type\``;if(e.type!==r)return`provider "${r}" reports type "${e.type}" \u2014 a provider must not claim an identity other than the one it was registered under`}function Le(r){let o=y.get(r);if(!o)throw p(`Unknown provider type: ${r}`,"PROVIDER_UNAVAILABLE",{retryable:!1});let e=o.factory(o.config),t=te(r,e);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});return e}function Ae(r){let o=y.get(r);if(o)return{mode:o.billingMode??"metered-api",source:o.source,detail:o.sourceDetail}}Q();function q(r){return r==="onnx"||x(r)}var T=["claude","claude-code","codex","openai","ollama","openrouter","gemini","azure-openai","bedrock","cognitum","onnx"];var oe={maxAttempts:3,delayMs:100,trySameProviderAlternateModel:!0,skipOpenCircuits:!0,retryableErrors:["RATE_LIMITED","TIMEOUT","NETWORK_ERROR","PROVIDER_UNAVAILABLE"]},ne=[{provider:"claude",models:[b,D[1]],enabled:!0,priority:100,maxAttempts:2,timeoutMs:3e4},{provider:"openai",models:["gpt-6-sol","gpt-6-luna"],enabled:!0,priority:90,maxAttempts:2,timeoutMs:3e4},{provider:"openrouter",models:["anthropic/claude-sonnet-5","openai/gpt-6-sol"],enabled:!0,priority:85,maxAttempts:2,timeoutMs:3e4},{provider:"ollama",models:["qwen3-coder:30b","qwen3:30b-a3b"],enabled:!0,priority:80,maxAttempts:2,timeoutMs:6e4},{provider:"onnx",models:["phi-4","all-MiniLM-L6-v2"],enabled:!0,priority:70,maxAttempts:1,timeoutMs:12e4}],ie={id:"default-fallback-chain",entries:ne,maxRetries:3,retryDelayMs:100,backoffMultiplier:2,maxDelayMs:5e3},U={mode:"rule-based",rules:[],defaultProvider:"claude",defaultModel:b,fallbackChain:ie,fallbackBehavior:oe,providers:{claude:{enabled:!0,defaultModel:b},"claude-code":{enabled:!1,defaultModel:b},openai:{enabled:!0,defaultModel:"gpt-6-sol"},ollama:{enabled:!0,defaultModel:"qwen3-coder:30b"},openrouter:{enabled:!0,defaultModel:"anthropic/claude-sonnet-5"},gemini:{enabled:!1,defaultModel:"gemini-2.5-flash"},"azure-openai":{enabled:!1},bedrock:{enabled:!1},cognitum:{enabled:!1,defaultModel:"cognitum-auto"},onnx:{enabled:!0,defaultModel:"phi-4"}},enableMetrics:!0,metricsConfig:{enabled:!0,collectionIntervalMs:6e4,retentionMs:864e5,trackPerRequest:!0},maxDecisionTimeMs:10,cacheDecisions:!0,decisionCacheTtlMs:6e4,cacheConfig:{enabled:!0,ttlMs:6e4,maxEntries:1e3,keyStrategy:"agent-domain"},auditConfig:{enabled:!0,maxEntries:1e4,logContent:!1,logResponse:!1}},Ue=[{canonicalId:"claude-opus-5",canonicalName:"Claude Opus 5",providerIds:{claude:"claude-opus-5",openrouter:"anthropic/claude-opus-5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:5,outputCostPer1M:25},{canonicalId:"claude-sonnet-5",canonicalName:"Claude Sonnet 5",providerIds:{claude:"claude-sonnet-5",openrouter:"anthropic/claude-sonnet-5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"advanced",family:"claude",inputCostPer1M:2,outputCostPer1M:10},{canonicalId:"claude-opus-5-5",canonicalName:"Claude Opus 5.5",providerIds:{claude:"claude-opus-5-5",openrouter:"anthropic/claude-opus-5.5"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:4,outputCostPer1M:20},{canonicalId:"claude-opus-4-7",canonicalName:"Claude Opus 4.7",providerIds:{claude:"claude-opus-4-7",openrouter:"anthropic/claude-opus-4.7",bedrock:"anthropic.claude-opus-4-7-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"flagship",family:"claude",inputCostPer1M:5,outputCostPer1M:25},{canonicalId:"claude-sonnet-4-6",canonicalName:"Claude Sonnet 4.6",providerIds:{claude:"claude-sonnet-4-6",openrouter:"anthropic/claude-sonnet-4.6",bedrock:"anthropic.claude-sonnet-4-6-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!0,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:1e6,maxOutputTokens:128e3},tier:"advanced",family:"claude",inputCostPer1M:3,outputCostPer1M:15},{canonicalId:"claude-haiku-4-5",canonicalName:"Claude Haiku 4.5",providerIds:{claude:"claude-haiku-4-5-20251001",openrouter:"anthropic/claude-haiku-4.5",bedrock:"anthropic.claude-haiku-4-5-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!0,supportsJsonMode:!0,maxContextTokens:2e5,maxOutputTokens:16384},tier:"standard",family:"claude",inputCostPer1M:1,outputCostPer1M:5},{canonicalId:"gpt-4o",canonicalName:"GPT-4o",providerIds:{openai:"gpt-4o","azure-openai":"gpt-4o",openrouter:"openai/gpt-4o"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"advanced",family:"gpt",inputCostPer1M:2.5,outputCostPer1M:10},{canonicalId:"gpt-4o-mini",canonicalName:"GPT-4o Mini",providerIds:{openai:"gpt-4o-mini","azure-openai":"gpt-4o-mini",openrouter:"openai/gpt-4o-mini"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:16384},tier:"standard",family:"gpt",inputCostPer1M:.15,outputCostPer1M:.6},{canonicalId:"gemini-pro",canonicalName:"Gemini 2.0 Pro",providerIds:{gemini:"gemini-2.0-pro",openrouter:"google/gemini-2.0-pro"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!0,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:2e6,maxOutputTokens:8192},tier:"advanced",family:"gemini",inputCostPer1M:1.25,outputCostPer1M:5},{canonicalId:"llama-3.1-70b",canonicalName:"LLaMA 3.1 70B",providerIds:{ollama:"llama3.1:70b",openrouter:"meta-llama/llama-3.1-70b",bedrock:"meta.llama3-1-70b-instruct-v1:0"},capabilities:{supportsStreaming:!0,supportsTools:!0,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!0,maxContextTokens:128e3,maxOutputTokens:4096},tier:"advanced",family:"llama",inputCostPer1M:.9,outputCostPer1M:.9},{canonicalId:"phi-4",canonicalName:"Microsoft Phi-4",providerIds:{ollama:"phi4",onnx:"phi-4",openrouter:"microsoft/phi-4"},capabilities:{supportsStreaming:!0,supportsTools:!1,supportsMCP:!1,supportsVision:!1,supportsExtendedThinking:!1,supportsJsonMode:!1,maxContextTokens:16e3,maxOutputTokens:4096,requiresNetwork:!1},tier:"efficient",family:"phi",inputCostPer1M:0,outputCostPer1M:0}];import{spawn as se}from"node:child_process";import{accessSync as ae,constants as de,statSync as le}from"node:fs";import{delimiter as ue,join as pe}from"node:path";var ce=18e4,me=2,E="default";function R(r,o){if(!o||typeof o!="object")return`externalProviders["${r}"] must be an object`;let e=o;if(e.kind!=="cli")return`externalProviders["${r}"].kind must be "cli" (got ${JSON.stringify(e.kind)})`;if(!Array.isArray(e.command)||e.command.length===0)return`externalProviders["${r}"].command must be a non-empty string array`;if(!e.command.every(t=>typeof t=="string"&&t.length>0))return`externalProviders["${r}"].command must contain only non-empty strings`;if(e.billingMode!==void 0&&!["subscription","metered-api","metered-capped","local"].includes(e.billingMode))return`externalProviders["${r}"].billingMode "${String(e.billingMode)}" is not a valid billing mode`;if(e.models!==void 0&&(!Array.isArray(e.models)||e.models.some(t=>typeof t!="string")))return`externalProviders["${r}"].models must be a string array`;if(e.timeoutMs!==void 0&&(typeof e.timeoutMs!="number"||e.timeoutMs<=0))return`externalProviders["${r}"].timeoutMs must be a positive number`;if(e.maxConcurrency!==void 0&&(typeof e.maxConcurrency!="number"||e.maxConcurrency<1))return`externalProviders["${r}"].maxConcurrency must be >= 1`;if(e.stripEnv!==void 0&&(!Array.isArray(e.stripEnv)||e.stripEnv.some(t=>typeof t!="string")))return`externalProviders["${r}"].stripEnv must be a string array`;if("apiKey"in e)return`externalProviders["${r}"] must not contain an apiKey \u2014 keys belong in the environment, not in llm-config.json`}var P=class r{type;name;billingMode;config;requestCounter=0;availabilityCache;active=0;queue=[];constructor(o,e){let t=R(o,e);if(t)throw p(t,"INVALID_REGISTRATION",{retryable:!1});this.type=o,this.config=e,this.name=e.displayName??o,this.billingMode=e.billingMode??"metered-api"}async isAvailable(){let o=Date.now();if(this.availabilityCache&&o-this.availabilityCache.at<6e4)return this.availabilityCache.available;let e=ge(this.config.command[0]);return this.availabilityCache={at:o,available:e},e}async healthCheck(){let o=Date.now(),e=await this.isAvailable(),t=Date.now()-o;return e?{healthy:!0,latencyMs:t,models:this.getSupportedModels(),details:{command:this.config.command[0],billing:this.billingMode,external:!0}}:{healthy:!1,latencyMs:t,error:`External provider "${this.type}" could not run "${this.config.command[0]}". Check that the host is installed and on PATH.`}}async generate(o,e){let t=e?.model??this.defaultModel(),i=`${this.type}-${++this.requestCounter}-${Date.now()}`,n=ye(o,e?.systemPrompt),s=e?.timeoutMs??this.config.timeoutMs??ce,l=[];this.config.modelFlag&&t&&t!==E&&l.push(this.config.modelFlag,t);let a=Date.now(),{code:d,stdout:u,stderr:f}=await this.withConcurrency(()=>this.spawnHost(l,n,s)),g=Date.now()-a,v=u.trim();if(d!==0&&!v)throw this.classifyError(f||`${this.type} exited with code ${d}`,t);let c=Math.ceil(n.length/4),S=Math.ceil(v.length/4),J={promptTokens:c,completionTokens:S,totalTokens:c+S};return{content:v,model:t,provider:this.type,usage:J,cost:{inputCost:0,outputCost:0,totalCost:0,currency:"USD",source:"local-estimate"},latencyMs:g,finishReason:"stop",cached:!1,requestId:i}}async embed(o,e){throw p(`External provider "${this.type}" does not support embeddings. Use a provider with an embeddings endpoint (openai, ollama, cognitum).`,"EMBEDDING_UNSUPPORTED",{provider:this.type,retryable:!1})}async complete(o,e){let t=await this.generate(o,{model:e?.model,temperature:e?.temperature,maxTokens:e?.maxTokens});return{completion:t.content,model:t.model,provider:this.type,usage:t.usage,latencyMs:t.latencyMs,cached:t.cached}}getConfig(){return{...this.config}}getSupportedModels(){return[...this.config.models??[E]]}getCostPerToken(){return{input:0,output:0}}async dispose(){}defaultModel(){return this.config.defaultModel??this.config.models?.[0]??E}static childEnv(o=[],e=process.env){let t={...e};for(let i of o)delete t[i];return t}classifyError(o,e){let t=o.toLowerCase();return t.includes("rate limit")||t.includes("usage limit")||t.includes("429")||t.includes("quota")?p(o,"RATE_LIMITED",{provider:this.type,model:e,retryable:!0,retryAfterMs:6e4}):p(o,"PROVIDER_UNAVAILABLE",{provider:this.type,model:e,retryable:!0})}spawnHost(o,e,t){let[i,...n]=this.config.command,s=[...n,...o];return new Promise((l,a)=>{let d=se(i,s,{env:r.childEnv(this.config.stripEnv),stdio:["pipe","pipe","pipe"]}),u="",f="",g=!1,v=setTimeout(()=>{g||(g=!0,d.kill("SIGKILL"),a(p(`${this.type} timed out after ${t}ms`,"TIMEOUT",{provider:this.type,retryable:!0})))},t);d.stdout.on("data",c=>u+=c.toString()),d.stderr.on("data",c=>f+=c.toString()),d.on("error",c=>{g||(g=!0,clearTimeout(v),a(p(`Failed to spawn "${i}" for provider "${this.type}": ${c.message}`,"PROVIDER_UNAVAILABLE",{provider:this.type,retryable:!1,cause:c})))}),d.on("close",c=>{g||(g=!0,clearTimeout(v),l({code:c??0,stdout:u,stderr:f}))}),d.stdin.on("error",()=>{});try{d.stdin.write(e),d.stdin.end()}catch{}})}async withConcurrency(o){let e=this.config.maxConcurrency??me;this.active>=e&&await new Promise(t=>this.queue.push(t)),this.active++;try{return await o()}finally{this.active--;let t=this.queue.shift();t&&t()}}};function ge(r,o=process.env){let e=n=>{try{return ae(n,de.X_OK),le(n).isFile()}catch{return!1}};if(r.includes("/")||r.includes("\\"))return e(r);let t=(o.PATH??"").split(ue).filter(Boolean),i=process.platform==="win32"?["",...(o.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean)]:[""];return t.some(n=>i.some(s=>e(pe(n,r+s))))}function ye(r,o){if(typeof r=="string")return o?`${o}
3
3
 
4
4
  ${r}`:r;let e=r.filter(n=>n.role==="system").map(n=>n.content);o&&e.unshift(o);let t=r.filter(n=>n.role!=="system").map(n=>`${n.role==="assistant"?"Assistant":"User"}: ${n.content}`).join(`
5
5