agentic-qe 3.15.13 → 3.15.15
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.
- package/.claude/agents/v3/templates/qx-report-template.html +1 -1
- package/.claude/helpers/brain-checkpoint.cjs +124 -5
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +124 -0
- package/assets/agents/v3/templates/qx-report-template.html +1 -1
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-QU6INSKP.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-EUF4XVUC.js +2 -0
- package/dist/cli/chunks/{agent-handler-AOH6TV7W.js → agent-handler-MOX6PSIQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-2P54SF5N.js → agent-memory-branch-AEXKIGDG.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +2 -0
- package/dist/cli/chunks/{arena-NSVFCAF5.js → arena-IQ5ZZDRF.js} +2 -2
- package/dist/cli/chunks/{arena-X6MOGQHA.js → arena-M7GA3CVG.js} +4 -4
- package/dist/cli/chunks/{audit-27DJLQNM.js → audit-4IPBMKWB.js} +3 -3
- package/dist/cli/chunks/base-OTGSN6IC.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-BU5GXILS.js → better-sqlite3-IKDKJ2IE.js} +2 -2
- package/dist/cli/chunks/brain-handler-5NQUDH4W.js +95 -0
- package/dist/cli/chunks/{branch-enumerator-5CLULOCU.js → branch-enumerator-KSXELWRC.js} +2 -2
- package/dist/cli/chunks/{browser-R4DMU3LN.js → browser-6LACARWE.js} +2 -2
- package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +2 -0
- package/dist/cli/chunks/{chunk-LUZNKJE6.js → chunk-22UKJGGN.js} +3 -3
- package/dist/cli/chunks/{chunk-BLSLEVDI.js → chunk-27HE2BHC.js} +2 -2
- package/dist/cli/chunks/{chunk-K4CZA77U.js → chunk-2CKERSMB.js} +2 -2
- package/dist/cli/chunks/{chunk-YSZ5OE3Z.js → chunk-2IIXCEMS.js} +2 -2
- package/dist/cli/chunks/{chunk-F3YS57NF.js → chunk-2LUTPMBO.js} +2 -2
- package/dist/cli/chunks/{chunk-GHM6MQNK.js → chunk-2ZFLULL4.js} +2 -2
- package/dist/cli/chunks/{chunk-7CMTY45A.js → chunk-337Z52QM.js} +2 -2
- package/dist/cli/chunks/{chunk-W26B7ERY.js → chunk-3CYNZFKH.js} +1 -1
- package/dist/cli/chunks/chunk-3HVFIITW.js +2 -0
- package/dist/cli/chunks/{chunk-K3TLLJMX.js → chunk-3J3RNJNX.js} +1 -1
- package/dist/cli/chunks/{chunk-MAMQA43L.js → chunk-4ATQP3PR.js} +1 -1
- package/dist/cli/chunks/{chunk-YXRASAPI.js → chunk-4D4CWP72.js} +2 -2
- package/dist/cli/chunks/{chunk-GHY6Z6KO.js → chunk-4HKAD25N.js} +3 -3
- package/dist/cli/chunks/{chunk-XNBOGCF3.js → chunk-4X3SWKBA.js} +2 -2
- package/dist/cli/chunks/{chunk-IJUHSJ2U.js → chunk-5AFVEWMT.js} +2 -2
- package/dist/cli/chunks/{chunk-SE4VNN4I.js → chunk-5C62XMJR.js} +3 -3
- package/dist/cli/chunks/{chunk-KDNJ4F3P.js → chunk-5G4UFTV4.js} +2 -2
- package/dist/cli/chunks/{chunk-DVGRPK7A.js → chunk-5I7357KS.js} +2 -2
- package/dist/cli/chunks/{chunk-YZWBNBTW.js → chunk-5KA5TVPR.js} +2 -2
- package/dist/cli/chunks/{chunk-JGZ722G3.js → chunk-5PTAFGJT.js} +2 -2
- package/dist/cli/chunks/{chunk-SVLQRAMF.js → chunk-6BRQPHMZ.js} +1 -1
- package/dist/cli/chunks/{chunk-KDVZND5Q.js → chunk-6KCSKGVY.js} +1 -1
- package/dist/cli/chunks/{chunk-LWR3FV3Y.js → chunk-6LE362LZ.js} +2 -2
- package/dist/cli/chunks/{chunk-WKGTGOYS.js → chunk-6NBRMD25.js} +3 -3
- package/dist/cli/chunks/{chunk-HQZGPJYG.js → chunk-6RBTS3NF.js} +2 -2
- package/dist/cli/chunks/{chunk-WOCGL4QP.js → chunk-6YVMX2TC.js} +2 -2
- package/dist/cli/chunks/{chunk-I3C7JOXC.js → chunk-73PBAWAF.js} +2 -2
- package/dist/cli/chunks/{chunk-75RDHBAX.js → chunk-74YG72NQ.js} +3 -3
- package/dist/cli/chunks/{chunk-O6FGXMHD.js → chunk-76P32JVU.js} +1 -1
- package/dist/cli/chunks/{chunk-LL7LDPXS.js → chunk-7ACCBHRB.js} +1 -1
- package/dist/cli/chunks/{chunk-3LJ7LQMV.js → chunk-7BLZHFKD.js} +1 -1
- package/dist/cli/chunks/{chunk-CM4LSLKR.js → chunk-7O45RQHF.js} +2 -2
- package/dist/cli/chunks/{chunk-NU3W5WFT.js → chunk-7XB3FCKM.js} +2 -2
- package/dist/cli/chunks/{chunk-E56B6IDX.js → chunk-AHMWD6JG.js} +2 -2
- package/dist/cli/chunks/{chunk-G2Q66Z23.js → chunk-AJPROCDW.js} +2 -2
- package/dist/cli/chunks/{chunk-NW7IBHJA.js → chunk-AKZO6GGG.js} +13 -13
- package/dist/cli/chunks/{chunk-IC3TQEOA.js → chunk-AOKKUB5F.js} +1 -1
- package/dist/cli/chunks/{chunk-4OVC4RIL.js → chunk-AP2W7Z3A.js} +1 -1
- package/dist/cli/chunks/{chunk-PHP5UBT4.js → chunk-BBRROA3Z.js} +2 -2
- package/dist/cli/chunks/{chunk-5FKWCZNF.js → chunk-BDKEAGQ2.js} +2 -2
- package/dist/cli/chunks/{chunk-BTVEYBW2.js → chunk-BFQTLF5X.js} +2 -2
- package/dist/cli/chunks/{chunk-HZ5NXFXH.js → chunk-BLL2XU7A.js} +2 -2
- package/dist/cli/chunks/{chunk-UTRV7T2N.js → chunk-BP5T3OEV.js} +2 -2
- package/dist/cli/chunks/{chunk-GB6HBNH2.js → chunk-BQ47GQPK.js} +2 -2
- package/dist/cli/chunks/{chunk-RFNW2LGD.js → chunk-BU4UQR36.js} +2 -2
- package/dist/cli/chunks/{chunk-WO274FRI.js → chunk-BZULJMGH.js} +2 -2
- package/dist/cli/chunks/{chunk-GU5HNCWI.js → chunk-C4KLXFJP.js} +1 -1
- package/dist/cli/chunks/{chunk-LFJALJOA.js → chunk-C4RTAVC6.js} +2 -2
- package/dist/cli/chunks/{chunk-WNQS4WTS.js → chunk-C5CXL3JP.js} +2 -2
- package/dist/cli/chunks/{chunk-MGZ5FJUW.js → chunk-CAOUV5GZ.js} +2 -2
- package/dist/cli/chunks/{chunk-XPRVF4YE.js → chunk-CBK5CT6T.js} +2 -2
- package/dist/cli/chunks/{chunk-JRRXCODW.js → chunk-DEKR3CTS.js} +2 -2
- package/dist/cli/chunks/{chunk-AQSVJNEH.js → chunk-DKX4GNRU.js} +2 -2
- package/dist/cli/chunks/{chunk-6KATY3KS.js → chunk-DUKE27HC.js} +2 -2
- package/dist/cli/chunks/{chunk-W2QWSQVE.js → chunk-DURD37JZ.js} +2 -2
- package/dist/cli/chunks/{chunk-KCW47QR5.js → chunk-E3MRDIZF.js} +1 -1
- package/dist/cli/chunks/{chunk-6Z7PRBSG.js → chunk-E56PVVWC.js} +2 -2
- package/dist/cli/chunks/{chunk-WQL7WCIZ.js → chunk-E5G4WZ2T.js} +1 -1
- package/dist/cli/chunks/{chunk-PB6J6HAA.js → chunk-EBTNMQSS.js} +2 -2
- package/dist/cli/chunks/{chunk-KADFXPPN.js → chunk-EFUJDMNC.js} +2 -2
- package/dist/cli/chunks/{chunk-QPNG5ZN2.js → chunk-EKP2SC77.js} +2 -2
- package/dist/cli/chunks/{chunk-U2FUXDDJ.js → chunk-EMSZVUYA.js} +3 -3
- package/dist/cli/chunks/{chunk-XEAEYC6Y.js → chunk-ERN56H6S.js} +1 -1
- package/dist/cli/chunks/{chunk-DNDL7SOS.js → chunk-FOOW4JVS.js} +2 -2
- package/dist/cli/chunks/{chunk-HOAJUIBQ.js → chunk-FTRSS64D.js} +2 -2
- package/dist/cli/chunks/{chunk-TOQWL2ZF.js → chunk-G242G224.js} +2 -2
- package/dist/cli/chunks/{chunk-VTDFVFST.js → chunk-G6RDCCFV.js} +2 -2
- package/dist/cli/chunks/{chunk-TWDW32W2.js → chunk-GCHYOPRZ.js} +2 -2
- package/dist/cli/chunks/{chunk-MFW5HSG4.js → chunk-GGQGCT4Y.js} +2 -2
- package/dist/cli/chunks/{chunk-G6WDYBLQ.js → chunk-GKSMRBHU.js} +1 -1
- package/dist/cli/chunks/{chunk-CCMKSHAT.js → chunk-GQABPCQE.js} +2 -2
- package/dist/cli/chunks/{chunk-G77ERMUD.js → chunk-GV2QE5TO.js} +1 -1
- package/dist/cli/chunks/{chunk-756CGMEH.js → chunk-H5DER3JY.js} +1 -1
- package/dist/cli/chunks/{chunk-W3PPFHI5.js → chunk-HH4ED4F7.js} +52 -50
- package/dist/cli/chunks/{chunk-3Y2ROSCL.js → chunk-HL2ANKN3.js} +2 -2
- package/dist/cli/chunks/{chunk-T3PGQFDI.js → chunk-HTZSRMHW.js} +2 -2
- package/dist/cli/chunks/{chunk-3QZEGE67.js → chunk-IXL5ZHWJ.js} +1 -1
- package/dist/cli/chunks/{chunk-5ZGM3RMH.js → chunk-J3FP5UGL.js} +1 -1
- package/dist/cli/chunks/{chunk-FZ76G4QJ.js → chunk-JCQGJGGZ.js} +1 -1
- package/dist/cli/chunks/chunk-JCZCJE6X.js +86 -0
- package/dist/cli/chunks/{chunk-YZEXYO4W.js → chunk-JKJOB65O.js} +1 -1
- package/dist/cli/chunks/{chunk-A64JFBWI.js → chunk-JUDUBQHA.js} +2 -2
- package/dist/cli/chunks/{chunk-PIDQVU3L.js → chunk-JW74KRBC.js} +2 -2
- package/dist/cli/chunks/{chunk-EXGMJFAT.js → chunk-K3WZICFA.js} +1 -1
- package/dist/cli/chunks/{chunk-ASQYASNV.js → chunk-K3XBQC3R.js} +1 -1
- package/dist/cli/chunks/{chunk-E7CLYGS7.js → chunk-KCQNFBBR.js} +1 -1
- package/dist/cli/chunks/chunk-KJBPB7P5.js +3 -0
- package/dist/cli/chunks/chunk-KLTMOXIK.js +3 -0
- package/dist/cli/chunks/{chunk-5MDERQH3.js → chunk-L32JNNKL.js} +1 -1
- package/dist/cli/chunks/{chunk-32ZMWEP3.js → chunk-LB2LGEDP.js} +2 -2
- package/dist/cli/chunks/{chunk-42J34YG4.js → chunk-LHMQIZ6B.js} +2 -2
- package/dist/cli/chunks/{chunk-NURIILUB.js → chunk-LJMYRTJ7.js} +1 -1
- package/dist/cli/chunks/{chunk-M6AAGIG7.js → chunk-LNX74WHQ.js} +1 -1
- package/dist/cli/chunks/{chunk-P7A4NKTZ.js → chunk-LTQVUAPH.js} +2 -2
- package/dist/cli/chunks/{chunk-3YNLWPBF.js → chunk-LVABQNRF.js} +2 -2
- package/dist/cli/chunks/{chunk-2G7TVT6W.js → chunk-LYJHUNBK.js} +2 -2
- package/dist/cli/chunks/{chunk-DLD7RUZ4.js → chunk-M4CJCPCQ.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3UDLV5Z.js → chunk-M4WMSCAE.js} +1 -1
- package/dist/cli/chunks/{chunk-UDQSYWVF.js → chunk-MIA447GY.js} +1 -1
- package/dist/cli/chunks/{chunk-RF7HWBHN.js → chunk-MPFPWJTH.js} +2 -2
- package/dist/cli/chunks/{chunk-BK577VL7.js → chunk-MV55NXTD.js} +2 -2
- package/dist/cli/chunks/{chunk-JQGMW45H.js → chunk-NQS3BWS6.js} +1 -1
- package/dist/cli/chunks/{chunk-BEGR4D6N.js → chunk-NWIIYHT6.js} +2 -2
- package/dist/cli/chunks/{chunk-SSU73QAX.js → chunk-O6EWL5DQ.js} +2 -2
- package/dist/cli/chunks/chunk-OBDONJQM.js +2 -0
- package/dist/cli/chunks/chunk-OLZH5LRT.js +141 -0
- package/dist/cli/chunks/{chunk-W3INMZZ6.js → chunk-OQG3UQQ7.js} +1 -1
- package/dist/cli/chunks/{chunk-72ASBE35.js → chunk-PFQCV6YS.js} +3 -3
- package/dist/cli/chunks/{chunk-7YTGHGK4.js → chunk-PS6UMZVK.js} +2 -2
- package/dist/cli/chunks/{chunk-OCAEXYFA.js → chunk-PXATBHWN.js} +2 -2
- package/dist/cli/chunks/{chunk-ARJW4I2O.js → chunk-PYPS65P7.js} +2 -2
- package/dist/cli/chunks/{chunk-SYV2V3PL.js → chunk-Q6I4SIUU.js} +4 -4
- package/dist/cli/chunks/{chunk-H4H2YSFH.js → chunk-QFGYH6HD.js} +1 -1
- package/dist/cli/chunks/{chunk-526QYFJU.js → chunk-QGBGSQ2E.js} +2 -2
- package/dist/cli/chunks/{chunk-YBQH2VOP.js → chunk-QRKTBSZT.js} +2 -2
- package/dist/cli/chunks/{chunk-C7JM7CD3.js → chunk-R6LHJ7ME.js} +2 -2
- package/dist/cli/chunks/{chunk-TSQC2KKZ.js → chunk-RBKUU7WF.js} +2 -2
- package/dist/cli/chunks/{chunk-CE7B5LU7.js → chunk-RDMRY7CT.js} +1 -1
- package/dist/cli/chunks/chunk-RIRZHOS2.js +8 -0
- package/dist/cli/chunks/{chunk-CRWPZT74.js → chunk-SHRI7TKJ.js} +2 -2
- package/dist/cli/chunks/{chunk-KWYH3FI4.js → chunk-SJCKCSN3.js} +1 -1
- package/dist/cli/chunks/{chunk-DFUASIKA.js → chunk-SON6ZRH3.js} +2 -2
- package/dist/cli/chunks/{chunk-J2ZIFFM6.js → chunk-SZAZQZWI.js} +2 -2
- package/dist/cli/chunks/{chunk-HD7YIFOI.js → chunk-T4GE7MPI.js} +2 -2
- package/dist/cli/chunks/{chunk-3Y7TJFHU.js → chunk-T66PPF4D.js} +2 -2
- package/dist/cli/chunks/{chunk-3RZV5DGO.js → chunk-T67R2MUN.js} +2 -2
- package/dist/cli/chunks/{chunk-H4GG2NLO.js → chunk-TDQWTSBS.js} +2 -2
- package/dist/cli/chunks/{chunk-TWJTK4CC.js → chunk-TODNOP7C.js} +2 -2
- package/dist/cli/chunks/{chunk-NZ3GUMB2.js → chunk-TX2CHQD7.js} +2 -2
- package/dist/cli/chunks/{chunk-AL6FBH3E.js → chunk-TZIHDJZD.js} +2 -2
- package/dist/cli/chunks/{chunk-GII6UM3F.js → chunk-U62OUXBF.js} +1 -1
- package/dist/cli/chunks/{chunk-YQFLQE53.js → chunk-UAQZI6N4.js} +2 -2
- package/dist/cli/chunks/{chunk-R7SYRCRP.js → chunk-UE2J6MA5.js} +1 -1
- package/dist/cli/chunks/{chunk-VRHRBAEM.js → chunk-UGYM4U44.js} +1 -1
- package/dist/cli/chunks/{chunk-NT4DBXSX.js → chunk-UJABDXST.js} +2 -2
- package/dist/cli/chunks/{chunk-OFACHK5O.js → chunk-UORB2QDU.js} +9 -9
- package/dist/cli/chunks/{chunk-QDEJ4CI2.js → chunk-UQPA33UK.js} +2 -2
- package/dist/cli/chunks/{chunk-TCBBNUBP.js → chunk-UUBIQR6A.js} +3 -3
- package/dist/cli/chunks/{chunk-NZD4DPSU.js → chunk-UXIY4IAI.js} +2 -2
- package/dist/cli/chunks/{chunk-SG3NX7QE.js → chunk-VCXI4XC4.js} +2 -2
- package/dist/cli/chunks/{chunk-PSFSPGUD.js → chunk-VMAM46HQ.js} +2 -2
- package/dist/cli/chunks/{chunk-3AN5TNGD.js → chunk-VY4U6DPO.js} +3 -3
- package/dist/cli/chunks/{chunk-X7N2JF2X.js → chunk-W27AJ5B4.js} +2 -2
- package/dist/cli/chunks/{chunk-CT6SAVXQ.js → chunk-W5ZJG2OU.js} +2 -2
- package/dist/cli/chunks/{chunk-KV4T4MXK.js → chunk-W62OOK7A.js} +2 -2
- package/dist/cli/chunks/{chunk-5K26BEYB.js → chunk-WNTA4YKE.js} +2 -2
- package/dist/cli/chunks/{chunk-LZYQHVD4.js → chunk-WUOOX7UG.js} +2 -2
- package/dist/cli/chunks/{chunk-7NA7JXNB.js → chunk-WVXJ2QIG.js} +2 -2
- package/dist/cli/chunks/{chunk-KB56CPU4.js → chunk-X33CWRDF.js} +2 -2
- package/dist/cli/chunks/{chunk-7JUC2MVZ.js → chunk-XG4F4XH4.js} +2 -2
- package/dist/cli/chunks/{chunk-ZAKQLAHT.js → chunk-XH4JMX5O.js} +1 -1
- package/dist/cli/chunks/{chunk-X2Z7F4EU.js → chunk-XHHWABJV.js} +2 -2
- package/dist/cli/chunks/{chunk-7PLIEBY7.js → chunk-XHLYGXYE.js} +2 -2
- package/dist/cli/chunks/{chunk-UXZSUMEA.js → chunk-XIVVTYM2.js} +2 -2
- package/dist/cli/chunks/{chunk-MVVB7C2E.js → chunk-XM6ZVFM5.js} +156 -156
- package/dist/cli/chunks/{chunk-VTOBUZL6.js → chunk-XWIAZG3C.js} +2 -2
- package/dist/cli/chunks/{chunk-CV77DMDQ.js → chunk-Y2OX6KGN.js} +2 -2
- package/dist/cli/chunks/{chunk-VRVMIPTM.js → chunk-YUS6TWAL.js} +2 -2
- package/dist/cli/chunks/{chunk-VU5TBX2V.js → chunk-ZIPAB5J6.js} +2 -2
- package/dist/cli/chunks/{chunk-KUAKV3IW.js → chunk-ZSOMUTNL.js} +1 -1
- package/dist/cli/chunks/{chunk-UOC3O6RP.js → chunk-ZWBGYJ7K.js} +2 -2
- package/dist/cli/chunks/{chunk-5VMAV6T6.js → chunk-ZYJB6FML.js} +1 -1
- package/dist/cli/chunks/{ci-ENOASTYB.js → ci-UCUJOSBW.js} +2 -2
- package/dist/cli/chunks/{ci-config-B26OXHQM.js → ci-config-2XILD3XG.js} +2 -2
- package/dist/cli/chunks/{ci-output-JTCLLNOQ.js → ci-output-BL6KWOHW.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-23JMFNM5.js → circuit-breaker-5XLIOXE5.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-ON6L462G.js → claude-flow-setup-4IMP6ACS.js} +2 -2
- package/dist/cli/chunks/client-KKRNPX4F.js +2 -0
- package/dist/cli/chunks/{cline-installer-OWQ4D2FQ.js → cline-installer-RYLHCDK7.js} +2 -2
- package/dist/cli/chunks/{code-2ZRL7SEU.js → code-WY3GJXHX.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-JXSQVM67.js → code-index-extractor-Y4MZBZCW.js} +2 -2
- package/dist/cli/chunks/{codex-installer-7LXZYBSQ.js → codex-installer-SCJ3T3DX.js} +4 -4
- package/dist/cli/chunks/{completions-C2LR623C.js → completions-CN2DXQFU.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-TGQLHCYJ.js → complexity-analyzer-7MDPPIBH.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-RUGD24D2.js → continuedev-installer-GCEJRK34.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-ZLFVLEJP.js → copilot-installer-BHPDSELY.js} +2 -2
- package/dist/cli/chunks/core-handlers-47MPMED7.js +2 -0
- package/dist/cli/chunks/{cost-tracker-RT4QL745.js → cost-tracker-VO5MFWR6.js} +2 -2
- package/dist/cli/chunks/coverage-LYFQYNH6.js +51 -0
- package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +2 -0
- package/dist/cli/chunks/{cursor-installer-LJKLNFF6.js → cursor-installer-KP4HA7TV.js} +2 -2
- package/dist/cli/chunks/{daemon-BMDXCQT5.js → daemon-7RC7TS57.js} +3 -3
- package/dist/cli/chunks/{daemon-FBH3IRYN.js → daemon-AXLVPKVO.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-JGDED55I.js → dag-attention-scheduler-NKA44RSR.js} +2 -2
- package/dist/cli/chunks/{detect-SZIHIVCJ.js → detect-CMYAJWYF.js} +2 -2
- package/dist/cli/chunks/{dist-node-FV3KWXQ6.js → dist-node-EN3PYEGW.js} +2 -2
- package/dist/cli/chunks/{domain-handler-GI5JWQOV.js → domain-handler-EXSZCX7A.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-BUWY36TL.js → domain-plugins-HCQFSNL7.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-GCY7W5DA.js → domain-transfer-3LGSNTPO.js} +2 -2
- package/dist/cli/chunks/dream-76L6EEN7.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-GPRR3ZGD.js → embed-and-insert-pattern-B6MNHICW.js} +2 -2
- package/dist/cli/chunks/{eval-XPB3IGAP.js → eval-OQELIWJK.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-2E554UB3.js → experience-capture-middleware-SUFILYPW.js} +3 -3
- package/dist/cli/chunks/{fast-paths-ZSMWZPUC.js → fast-paths-UV4NDEWM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GIWVDVVC.js → feature-flags-CKTYX67J.js} +2 -2
- package/dist/cli/chunks/{feature-flags-N7EOGE5P.js → feature-flags-H7H33B6C.js} +2 -2
- package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +2 -0
- package/dist/cli/chunks/{fleet-HCHDOUCX.js → fleet-ZJBCAKRG.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-CZNCNXXZ.js → gnn-wrapper-RUE2QZRG.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-6YUIF2YQ.js → heartbeat-handler-XRV327M7.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-NIK3KKEH.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-WJG7LUJJ.js +2 -0
- package/dist/cli/chunks/hnsw-index-D6PRI5HC.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-J3M3IK24.js → hnsw-legacy-bridge-UJID6ZZ4.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-ULGTGDZW.js → hnswlib-node-WS43R4AX.js} +2 -2
- package/dist/cli/chunks/{hooks-C4BUGYUQ.js → hooks-YZNJKXAJ.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-WINGVMPG.js → hypergraph-engine-XQJSIMTS.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-GADMWKAU.js → hypergraph-handler-ZD2NYXMR.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +2 -0
- package/dist/cli/chunks/{init-guard-K2T4QWAO.js → init-guard-DSRUAVRT.js} +2 -2
- package/dist/cli/chunks/{init-handler-PCZTDZYI.js → init-handler-RJU5QMAP.js} +6 -6
- package/dist/cli/chunks/init-wizard-JCKNGIGT.js +2 -0
- package/dist/cli/chunks/kernel-F7ILJTYD.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-XENXNEIU.js → kilocode-installer-BCPOCVMC.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-3PG2TJ67.js → kiro-installer-GFCWCB2S.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +2 -0
- package/dist/cli/chunks/learning-FZTD72CF.js +131 -0
- package/dist/cli/chunks/{llm-router-RKVDEWU2.js → llm-router-GJVKGRJL.js} +4 -4
- package/dist/cli/chunks/llm-router-service-TNOWQINA.js +2 -0
- package/dist/cli/chunks/{load-ITHC564X.js → load-YKTPOYBE.js} +2 -2
- package/dist/cli/chunks/load-test-FPVBK2EV.js +2 -0
- package/dist/cli/chunks/{mcp-TCL5UW3N.js → mcp-LT6R2IKS.js} +2 -2
- package/dist/cli/chunks/{memory-BKDAY2N2.js → memory-4HKKOLRY.js} +5 -5
- package/dist/cli/chunks/memory-backend-2QE7O67A.js +2 -0
- package/dist/cli/chunks/{memory-handlers-WN4FXFOA.js → memory-handlers-X4CMVBXB.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-VHAT7ZPF.js → multi-model-executor-2YPM2WTK.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-E3VM3EEY.js → opencode-installer-WBAJMH5K.js} +2 -2
- package/dist/cli/chunks/{orchestrator-BMQ6X762.js → orchestrator-5W5WVMVJ.js} +109 -25
- package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-GOOR2BV5.js → pattern-usage-recorder-GXRMNPAZ.js} +2 -2
- package/dist/cli/chunks/{pipeline-5NSFQQIX.js → pipeline-2NA4DRDA.js} +2 -2
- package/dist/cli/chunks/{platform-SQM34J5G.js → platform-BGERNQ5V.js} +2 -2
- package/dist/cli/chunks/{plugin-UQJZRMZG.js → plugin-L4EPVENR.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-WMDJOL4S.js → prime-radiant-advanced-wasm-RTQRTPTM.js} +2 -2
- package/dist/cli/chunks/project-root-S7WDFTMU.js +2 -0
- package/dist/cli/chunks/protocol-executor-OPANXQVB.js +2 -0
- package/dist/cli/chunks/{protocol-handler-OBDCVY6X.js → protocol-handler-SYQXM6JK.js} +2 -2
- package/dist/cli/chunks/{prove-XDC7I4XT.js → prove-5O7GPJCU.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +2 -0
- package/dist/cli/chunks/{quality-L4GQ6WX4.js → quality-KIIDHGNF.js} +2 -2
- package/dist/cli/chunks/{quality-gate-MJG66LKN.js → quality-gate-H65VECD3.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +2 -0
- package/dist/cli/chunks/{real-embeddings-HW4G2LWL.js → real-embeddings-DYIOLKQ3.js} +2 -2
- package/dist/cli/chunks/{ref-validation-FC7JOJ2C.js → ref-validation-CSBJOMZM.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-KWS4CEIC.js → roocode-installer-G7OVYXEN.js} +2 -2
- package/dist/cli/chunks/router-DBBW4NC2.js +2 -0
- package/dist/cli/chunks/routing-feedback-W35QHCL4.js +2 -0
- package/dist/cli/chunks/{routing-handler-QF4WVB2S.js → routing-handler-ZNZPPI5Y.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-2MTCOUK6.js → ruvector-commands-C6IG3OY3.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-X3NSL25Z.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-TZR7GDOK.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-BREJCXWN.js → rvf-migration-coordinator-4ATTHGHD.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-HD25ZYV5.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-KKC6HOJD.js → rvf-store-integrity-3G6LFLT3.js} +2 -2
- package/dist/cli/chunks/safe-db-ZS2QKANY.js +2 -0
- package/dist/cli/chunks/schedule-ZH6VNA32.js +2 -0
- package/dist/cli/chunks/scheduler-T6CD74B6.js +2 -0
- package/dist/cli/chunks/{security-OSAE7VAP.js → security-A3IMVLFM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-COUOS665.js → shared-rvf-adapter-VHWQ6US5.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-YXMPZKQE.js → shared-rvf-dual-writer-JB3QS7IG.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-47WU5EKZ.js +2 -0
- package/dist/cli/chunks/{standalone-memory-E6JBMOIL.js → standalone-memory-DDNXCSBD.js} +2 -2
- package/dist/cli/chunks/{status-handler-AFTCIYIX.js → status-handler-2HK7XPEK.js} +2 -2
- package/dist/cli/chunks/{structural-health-2FROCEI4.js → structural-health-DSJVLEPV.js} +2 -2
- package/dist/cli/chunks/{sync-VAYTOWDC.js → sync-3MUV6S5E.js} +2 -2
- package/dist/cli/chunks/{sync-YIQYOFGW.js → sync-NTUR53PI.js} +2 -2
- package/dist/cli/chunks/{task-handler-KVQHDEX3.js → task-handler-74MZN2EO.js} +2 -2
- package/dist/cli/chunks/{task-handlers-MVVECQA6.js → task-handlers-VJR6EHRZ.js} +3 -3
- package/dist/cli/chunks/{test-5JSVTOMY.js → test-O6FK3FVF.js} +4 -4
- package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +2 -0
- package/dist/cli/chunks/{test-scheduling-HBOHVLI3.js → test-scheduling-Q6QEEOS6.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-5VEPTPFA.js → token-bootstrap-TTRCECLP.js} +2 -2
- package/dist/cli/chunks/{token-usage-TBJHDLY6.js → token-usage-YEEFWSSI.js} +2 -2
- package/dist/cli/chunks/{transformers-VAWYMHMZ.js → transformers-BZCHJJJT.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +2 -0
- package/dist/cli/chunks/{types-R5SDZU2E.js → types-4AOKZYOX.js} +2 -2
- package/dist/cli/chunks/unified-memory-FZ5K2C7W.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-VREWX56M.js +2 -0
- package/dist/cli/chunks/unified-persistence-YZGMKX6B.js +2 -0
- package/dist/cli/chunks/{upgrade-K5PIHXRB.js → upgrade-2MWW6BT2.js} +2 -2
- package/dist/cli/chunks/{validate-RPTS7RYJ.js → validate-PAEV3GT5.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-B2ZL556X.js → validate-swarm-ZIXACK5K.js} +2 -2
- package/dist/cli/chunks/visual-security-GXGSFBVA.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-K4DUJC32.js → web-tree-sitter-VLTXZFAB.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-OK2AJN35.js → windsurf-installer-VELMLOZF.js} +2 -2
- package/dist/cli/chunks/witness-chain-MRJKVCOW.js +2 -0
- package/dist/cli/chunks/witness-chain-WWHJKITG.js +2 -0
- package/dist/cli/chunks/{witness-chain-repair-L6Y5RFXR.js → witness-chain-repair-5SAXPETG.js} +2 -2
- package/dist/cli/chunks/{witness-chain-verifier-N4CW7FZX.js → witness-chain-verifier-MIDWD4JS.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-TDNPS3WD.js → witness-key-manager-OSVCWOB2.js} +2 -2
- package/dist/cli/chunks/{workflow-XRZA3YCY.js → workflow-MK7A7QCX.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +2 -0
- package/dist/cli/chunks/{wrappers-5JIFWKN6.js → wrappers-5QFMCKXL.js} +2 -2
- package/dist/cli/commands/coverage.js +6 -0
- package/dist/cli/commands/learning-prune.d.ts +14 -0
- package/dist/cli/commands/learning-prune.js +105 -0
- package/dist/cli/commands/learning.js +9 -0
- package/dist/cli/handlers/brain-handler.js +12 -1
- package/dist/cli/utils/coverage-verdict.js +14 -3
- package/dist/context/compaction/index.d.ts +7 -0
- package/dist/context/compaction/index.js +30 -6
- package/dist/coordination/handlers/coverage-evidence.d.ts +19 -0
- package/dist/coordination/handlers/coverage-evidence.js +31 -2
- package/dist/coordination/handlers/coverage-handlers.js +5 -1
- package/dist/coordination/handlers/coverage-target.js +8 -1
- package/dist/coordination/handlers/quality-handlers.js +9 -1
- package/dist/coordination/result-saver-adapters.js +1 -0
- package/dist/coordination/result-saver.js +9 -5
- package/dist/domains/chaos-resilience/services/chaos-engineer.d.ts +1 -0
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +23 -45
- package/dist/domains/coverage-analysis/collected-metrics.d.ts +22 -6
- package/dist/domains/coverage-analysis/collected-metrics.js +37 -12
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +2 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +3 -6
- package/dist/domains/quality-assessment/coverage-report-event.d.ts +8 -0
- package/dist/domains/quality-assessment/coverage-report-event.js +22 -1
- package/dist/domains/quality-assessment/interfaces.d.ts +6 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.d.ts +4 -0
- package/dist/domains/quality-assessment/services/quality-analyzer.js +63 -17
- package/dist/domains/test-execution/interfaces.d.ts +5 -0
- package/dist/domains/test-execution/services/test-executor.js +6 -0
- package/dist/init/init-wizard-hooks.d.ts +1 -1
- package/dist/init/init-wizard-hooks.js +7 -8
- package/dist/init/phases/07-hooks.js +90 -6
- package/dist/init/phases/08-mcp.js +9 -0
- package/dist/init/settings-merge.d.ts +13 -0
- package/dist/init/settings-merge.js +49 -2
- package/dist/integrations/agent-booster-wasm/agent_booster_wasm.js +849 -0
- package/dist/integrations/agent-booster-wasm/agent_booster_wasm_bg.wasm +0 -0
- package/dist/integrations/agent-booster-wasm/index.d.ts +8 -0
- package/dist/integrations/agent-booster-wasm/index.js +25 -2
- package/dist/integrations/agent-booster-wasm/package.json +16 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +25 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +154 -61
- package/dist/learning/dream/dream-engine.d.ts +27 -3
- package/dist/learning/dream/dream-engine.js +97 -28
- package/dist/learning/dream/dream-lock-retry.d.ts +38 -0
- package/dist/learning/dream/dream-lock-retry.js +66 -0
- package/dist/learning/dream/speculative-dreamer.js +1 -1
- package/dist/learning/learning-retention.d.ts +103 -0
- package/dist/learning/learning-retention.js +213 -0
- package/dist/mcp/bundle.js +501 -496
- package/dist/mcp/handlers/domain-handler-configs.d.ts +9 -1
- package/dist/mcp/handlers/domain-handler-configs.js +24 -14
- package/dist/mcp/protocol-server.js +1 -1
- package/dist/mcp/tools/chaos-resilience/inject.d.ts +3 -4
- package/dist/mcp/tools/chaos-resilience/inject.js +11 -81
- package/dist/mcp/tools/learning-optimization/dream.d.ts +8 -0
- package/dist/mcp/tools/learning-optimization/dream.js +4 -0
- package/package.json +4 -2
- package/dist/cli/chunks/adapter-KCQDVYY2.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-6RRQWMNE.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-SAQOHSGN.js +0 -2
- package/dist/cli/chunks/base-WCACU3FN.js +0 -2
- package/dist/cli/chunks/brain-handler-GTQNHHZS.js +0 -94
- package/dist/cli/chunks/browser-workflow-G6IASEAP.js +0 -2
- package/dist/cli/chunks/chunk-C6JTLKG7.js +0 -141
- package/dist/cli/chunks/chunk-K65CGKLD.js +0 -8
- package/dist/cli/chunks/chunk-MB46UBGY.js +0 -3
- package/dist/cli/chunks/chunk-N4CYAKOX.js +0 -79
- package/dist/cli/chunks/chunk-PT4FMJPQ.js +0 -3
- package/dist/cli/chunks/chunk-S5AZCIZS.js +0 -2
- package/dist/cli/chunks/chunk-UT2VZ33P.js +0 -2
- package/dist/cli/chunks/client-TV3V2YZ5.js +0 -2
- package/dist/cli/chunks/core-handlers-PZT4OLWR.js +0 -2
- package/dist/cli/chunks/coverage-NV3C4IMM.js +0 -50
- package/dist/cli/chunks/cross-domain-router-QOFCZ7G4.js +0 -2
- package/dist/cli/chunks/dream-TRFBGDSQ.js +0 -2
- package/dist/cli/chunks/file-discovery-WCKGMSPZ.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-P44A2OX3.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-ZJQIQJKC.js +0 -2
- package/dist/cli/chunks/hnsw-index-HMG2GH3Z.js +0 -2
- package/dist/cli/chunks/hybrid-backend-B7M74PZG.js +0 -2
- package/dist/cli/chunks/impact-analyzer-PZYOVKQO.js +0 -2
- package/dist/cli/chunks/init-wizard-TZDJQK3U.js +0 -2
- package/dist/cli/chunks/kernel-Y6RRIOKW.js +0 -2
- package/dist/cli/chunks/knowledge-graph-BVD5Z66M.js +0 -2
- package/dist/cli/chunks/learning-6KDH7FK4.js +0 -122
- package/dist/cli/chunks/llm-router-service-KHCAMSUU.js +0 -2
- package/dist/cli/chunks/load-test-RUF7DZA5.js +0 -2
- package/dist/cli/chunks/memory-backend-7ZLFOVGG.js +0 -2
- package/dist/cli/chunks/pattern-null-store-RY6CVYHP.js +0 -2
- package/dist/cli/chunks/project-root-IO5KRNGL.js +0 -2
- package/dist/cli/chunks/protocol-executor-U2CUDWDE.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-DQSSX2IP.js +0 -2
- package/dist/cli/chunks/queen-coordinator-6FN4BZIX.js +0 -2
- package/dist/cli/chunks/router-YUO3I7RU.js +0 -2
- package/dist/cli/chunks/routing-feedback-36SLQGJE.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-FRYZH3WZ.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-XXNITL5I.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-D2WWKJIV.js +0 -2
- package/dist/cli/chunks/safe-db-4RRIGRXD.js +0 -2
- package/dist/cli/chunks/schedule-25RTO4DQ.js +0 -2
- package/dist/cli/chunks/scheduler-BPIOJZ5P.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-EDF47DDX.js +0 -2
- package/dist/cli/chunks/test-runner-process-LEPF2OSS.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-TSZTCMFV.js +0 -2
- package/dist/cli/chunks/unified-memory-TLGSSLMI.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-MSUR7ZOO.js +0 -2
- package/dist/cli/chunks/unified-persistence-VFFOTWK7.js +0 -2
- package/dist/cli/chunks/visual-security-6Q44XNLB.js +0 -2
- package/dist/cli/chunks/witness-chain-KDOMXDQX.js +0 -2
- package/dist/cli/chunks/witness-chain-N3OY2RMH.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-CVNNT2RJ.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{i as K}from"./chunk-TCBBNUBP.js";import{b as X,c as k,d as O,e as I,f as z}from"./chunk-Q3UDLV5Z.js";import{b as f,c as W,j as C,k as Q,o as Z,q as B,r as ee}from"./chunk-SSU73QAX.js";import{b as q,f as pe}from"./chunk-PHP5UBT4.js";import{a as L,b,c as J,d as ue,f as S,i as y,j as R,n as P}from"./chunk-P7A4NKTZ.js";import{i as Y}from"./chunk-H4H2YSFH.js";import{d as V,e as le}from"./chunk-GB6HBNH2.js";import{b as G,e as de}from"./chunk-3Y2ROSCL.js";P();var te={security:{provider:"claude",model:R,temperature:.1,maxTokens:16e3,priority:100},"test-generation":{provider:"claude",model:y,temperature:.3,maxTokens:8e3,priority:90},"code-analysis":{provider:"claude",model:y,temperature:.2,maxTokens:8e3,priority:85},performance:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:4e3,priority:70},documentation:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.4,maxTokens:4e3,priority:60},learning:{provider:"claude",model:y,temperature:.3,maxTokens:8e3,priority:80},coordination:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:2e3,priority:75},simple:{provider:"openai",model:"gpt-6-luna",temperature:.3,maxTokens:2e3,priority:50},general:{provider:"claude",model:y,temperature:.3,maxTokens:4e3,priority:60}},_={"security-auditor":"security","security-architect":"security","security-scanner":"security","v3-qe-security-scanner":"security","security-manager":"security","vulnerability-scanner":"security","penetration-tester":"security","compliance-auditor":"security","threat-analyzer":"security","test-generator":"test-generation","v3-qe-test-generator":"test-generation",tester:"test-generation","tdd-specialist":"test-generation","tdd-london-swarm":"test-generation","unit-test-generator":"test-generation","integration-test-generator":"test-generation","e2e-test-generator":"test-generation","mutation-tester":"test-generation","property-based-tester":"test-generation","contract-tester":"test-generation","v3-qe-contract-tester":"test-generation","api-tester":"test-generation","visual-tester":"test-generation","v3-qe-visual-tester":"test-generation","accessibility-tester":"test-generation","code-reviewer":"code-analysis","code-analyzer":"code-analysis",reviewer:"code-analysis","v3-qe-code-intelligence":"code-analysis","v3-qe-code-analyzer":"code-analysis","coverage-analyzer":"code-analysis","v3-qe-coverage-analyzer":"code-analysis","defect-predictor":"code-analysis","v3-qe-defect-predictor":"code-analysis","static-analyzer":"code-analysis","complexity-analyzer":"code-analysis","dependency-analyzer":"code-analysis","refactoring-advisor":"code-analysis","quality-assessor":"code-analysis","v3-qe-quality-assessor":"code-analysis","test-executor":"code-analysis","v3-qe-test-executor":"code-analysis","parallel-executor":"code-analysis","flaky-test-detector":"code-analysis","test-orchestrator":"code-analysis","performance-tester":"performance","performance-engineer":"performance","perf-analyzer":"performance","performance-benchmarker":"performance","load-tester":"performance","stress-tester":"performance","v3-qe-chaos-engineer":"performance","chaos-engineer":"performance","resilience-tester":"performance","scalability-tester":"performance","api-docs":"documentation","doc-generator":"documentation","readme-generator":"documentation","changelog-generator":"documentation","specification-writer":"documentation","v3-qe-learning-optimizer":"learning","learning-optimizer":"learning","ml-developer":"learning","pattern-learner":"learning","optimization-agent":"learning","smart-agent":"learning","requirements-validator":"code-analysis","v3-qe-requirements-validator":"code-analysis","bdd-generator":"test-generation","acceptance-tester":"test-generation",coordinator:"coordination","hierarchical-coordinator":"coordination","mesh-coordinator":"coordination","adaptive-coordinator":"coordination","collective-intelligence-coordinator":"coordination","swarm-memory-manager":"coordination","byzantine-coordinator":"coordination","raft-manager":"coordination","gossip-coordinator":"coordination","consensus-builder":"coordination","crdt-synchronizer":"coordination","quorum-manager":"coordination","task-orchestrator":"coordination","memory-coordinator":"coordination",coder:"code-analysis",planner:"code-analysis",researcher:"code-analysis","backend-dev":"code-analysis","mobile-dev":"code-analysis","cicd-engineer":"code-analysis","system-architect":"code-analysis","base-template-generator":"test-generation","github-modes":"coordination","pr-manager":"coordination","code-review-swarm":"code-analysis","issue-tracker":"coordination","release-manager":"coordination","workflow-automation":"coordination","project-board-sync":"coordination","repo-architect":"code-analysis","multi-repo-swarm":"coordination","sparc-coord":"coordination","sparc-coder":"code-analysis",specification:"documentation",pseudocode:"code-analysis",architecture:"code-analysis",refinement:"code-analysis","memory-specialist":"learning","production-validator":"code-analysis"},v={heavyweight:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!0,requiresJsonMode:!0,minContextSize:1e5,costSensitivity:"low",latencySensitivity:"low"},standard:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:5e4,costSensitivity:"medium",latencySensitivity:"medium"},lightweight:{requiresReasoning:!1,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:16e3,costSensitivity:"medium",latencySensitivity:"high"},minimal:{requiresReasoning:!1,requiresTools:!1,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!1,minContextSize:4e3,costSensitivity:"high",latencySensitivity:"medium"}},Te={security:v.heavyweight,"test-generation":v.standard,"code-analysis":v.standard,learning:v.standard,performance:{...v.lightweight,costSensitivity:"high"},coordination:v.lightweight,general:{...v.lightweight,requiresJsonMode:!1,latencySensitivity:"medium"},documentation:{...v.minimal,minContextSize:16e3},simple:v.minimal};function re(l){if(Object.hasOwn(_,l))return _[l];let e=l.toLowerCase();return e.includes("security")||e.includes("audit")||e.includes("vulnerab")||e.includes("penetration")||e.includes("threat")||e.includes("compliance")?"security":e.includes("test-gen")||e.includes("tdd")||e.includes("unit-test")||e.includes("e2e-test")||e.includes("integration-test")||e.includes("mutation")?"test-generation":e.includes("code-")||e.includes("coverage")||e.includes("defect")||e.includes("review")||e.includes("analyzer")||e.includes("quality")?"code-analysis":e.includes("perf")||e.includes("load")||e.includes("stress")||e.includes("benchmark")||e.includes("chaos")||e.includes("resilience")?"performance":e.includes("doc")||e.includes("readme")||e.includes("changelog")||e.includes("spec")?"documentation":e.includes("learn")||e.includes("ml-")||e.includes("pattern")||e.includes("optim")?"learning":e.includes("coord")||e.includes("swarm")||e.includes("orchestrat")||e.includes("consensus")||e.includes("manager")?"coordination":"general"}var F={},ie={};function oe(l,e){F={...l??{}},ie={...e??{}}}function ne(l){let e=re(l),t=te[e],r=F[l];if(!r)return t;let i=r.provider!==void 0&&r.provider!==t.provider,o=r.model??(i?ie[r.provider]:void 0);return{...t,...r.provider!==void 0?{provider:r.provider}:{},...o!==void 0?{model:o}:{},...r.temperature!==void 0?{temperature:r.temperature}:{},...r.maxTokens!==void 0?{maxTokens:r.maxTokens}:{},priority:r.priority??t.priority+100}}function se(){return Object.keys(F).map(l=>{let e=ne(l);return{id:`agent-override-${l}`,name:`User override: ${l} -> ${e.provider}/${e.model}`,description:`Per-agent routing override from .agentic-qe/llm-config.json (agentOverrides["${l}"])`,condition:{agentType:[l]},action:{provider:e.provider,model:e.model,temperature:e.temperature,maxTokens:e.maxTokens,priority:e.priority},enabled:!0,priority:e.priority}}).sort((l,e)=>e.priority-l.priority)}P();var x=class{rules=[];constructor(e=[]){this.setRules(e)}setRules(e){this.rules=[...e].filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}getRules(){return[...this.rules]}addRule(e){this.rules.push(e),this.rules=this.rules.filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}removeRule(e){let t=this.rules.findIndex(r=>r.id===e);return t>=0?(this.rules.splice(t,1),!0):!1}setRuleEnabled(e,t){let r=this.rules.find(i=>i.id===e);return r?(r.enabled=t,this.rules=this.rules.filter(i=>i.enabled).sort((i,o)=>o.priority-i.priority),!0):!1}evaluate(e){let t=0;for(let r of this.rules)if(t++,this.matchesCondition(e,r.condition))return{rule:r,rulesEvaluated:t};return null}evaluateAll(e){return this.rules.filter(t=>this.matchesCondition(e,t.condition))}matchesCondition(e,t){if(t.agentType!==void 0&&(!e.agentType||!t.agentType.includes(e.agentType))||t.requiresTools!==void 0&&!!e.requiresTools!==t.requiresTools)return!1;if(t.complexity!==void 0){let r=Array.isArray(t.complexity)?t.complexity:[t.complexity];if(!e.complexity||!r.includes(e.complexity))return!1}if(t.localOnly!==void 0&&t.localOnly){let r=["ollama","onnx"];if(e.preferredProvider&&!r.includes(e.preferredProvider))return!1}if(t.requiresReasoning!==void 0&&t.requiresReasoning&&e.complexity==="low")return!1;if(t.tokenRange!==void 0){let r=this.estimateTokens(e);if(t.tokenRange.min!==void 0&&r<t.tokenRange.min||t.tokenRange.max!==void 0&&r>t.tokenRange.max)return!1}return!(t.requiredCapabilities!==void 0&&t.requiredCapabilities.length>0&&(!e.requiredCapabilities||e.requiredCapabilities.length===0||!t.requiredCapabilities.every(i=>e.requiredCapabilities.includes(i)))||t.custom!==void 0&&!t.custom(e))}estimateTokens(e){let t=0;e.systemPrompt&&(t+=Math.ceil(e.systemPrompt.length/4));for(let r of e.messages)t+=Math.ceil(r.content.length/4);return t}},w=[{id:"security-agents-opus",name:"Security Agents to Claude Opus",description:"Route security-critical agents to Claude Opus for best security analysis",condition:{agentType:["security-auditor","security-architect","v3-qe-security-scanner"]},action:{provider:"claude",model:R,temperature:.1},enabled:!0,priority:100},{id:"test-gen-with-tools",name:"Test Generation with Tools",description:"Route test generation requests that need tools to Claude Sonnet",condition:{agentType:["v3-qe-test-generator","tester"],requiresTools:!0},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:95},{id:"high-complexity-reasoning",name:"High Complexity Reasoning",description:"Route high complexity tasks requiring reasoning to advanced models",condition:{complexity:"high",requiresReasoning:!0},action:{provider:"claude",model:R,temperature:.2},enabled:!0,priority:90},{id:"code-analysis-agents",name:"Code Analysis Agents",description:"Route code analysis to Claude Sonnet for balanced performance",condition:{agentType:["code-analyzer","v3-qe-code-intelligence","reviewer"]},action:{provider:"claude",model:y,temperature:.2},enabled:!0,priority:85},{id:"coverage-analysis",name:"Coverage Analysis Agents",description:"Route coverage analysis to efficient models",condition:{agentType:["v3-qe-coverage-analyzer"]},action:{provider:"claude",model:y,temperature:.1},enabled:!0,priority:80},{id:"defect-prediction",name:"Defect Prediction Agents",description:"Route defect prediction to capable models",condition:{agentType:["v3-qe-defect-predictor"]},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:75},{id:"medium-complexity",name:"Medium Complexity Tasks",description:"Route medium complexity to balanced Claude Sonnet",condition:{complexity:"medium"},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:60},{id:"low-complexity-haiku",name:"Low Complexity to Haiku",description:"Route low complexity tasks to Haiku for cost efficiency",condition:{complexity:"low"},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:50},{id:"local-only-ollama",name:"Local Only Requests",description:"Route local-only requests to Ollama",condition:{localOnly:!0},action:{provider:"ollama",model:"qwen3-coder:30b",temperature:.3},enabled:!0,priority:40},{id:"small-requests-haiku",name:"Small Token Requests",description:"Route small requests to Haiku for efficiency",condition:{tokenRange:{max:500}},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:30}];import{randomUUID as ge}from"crypto";var E=class{decisions=[];providerCalls=[];fallbacks=[];cacheHits=0;cacheMisses=0;startTime=new Date;maxRecords;maxCallRecords;constructor(e={}){this.maxRecords=e.maxRecords??1e4,this.maxCallRecords=e.maxCallRecords??5e3}recordRoutingDecision(e,t,r={}){let i={id:`rd-${Date.now()}-${ge().slice(0,8)}`,timestamp:new Date,provider:e.providerType,model:e.model,mode:this.inferMode(e.reason),reason:e.reason,latencyMs:t,decisionTimeMs:e.metadata.decisionTimeMs,agentType:r.agentType,success:r.success??!0,tokenUsage:r.tokenUsage,cost:r.cost,wasFallback:e.reason==="fallback",ruleId:e.matchedRule?.id};this.decisions.push(i),this.trimRecords()}recordProviderCall(e,t,r,i,o={}){let n=o.inputTokens??Math.floor(i*.7),a=o.outputTokens??i-n,s={timestamp:new Date,provider:e,model:t,latencyMs:r,inputTokens:n,outputTokens:a,totalTokens:i,success:o.success??!0,cost:o.cost,agentType:o.agentType};this.providerCalls.push(s),this.trimCallRecords()}recordFallback(e,t,r,i){let o={timestamp:new Date,fromProvider:e,toProvider:t,reason:r,agentType:i};this.fallbacks.push(o),this.fallbacks.length>1e3&&(this.fallbacks=this.fallbacks.slice(-1e3))}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(e="all"){let t=this.getWindowStart(e),r=this.filterByTime(this.decisions,t),i=this.filterByTime(this.providerCalls,t),o=this.filterByTime(this.fallbacks,t),n=this.calculateProviderMetrics(r,i),a=this.calculateAgentMetrics(r,i),s=r.map(m=>m.decisionTimeMs),c=r.length,d=this.countByMode(r),u=r.filter(m=>m.wasFallback).length,p=r.filter(m=>m.ruleId).length;return{byProvider:Object.fromEntries(n),byAgentType:a,totalDecisions:c,decisionsByMode:d,avgDecisionTimeMs:this.average(s),p95DecisionTimeMs:this.percentile(s,95),p99DecisionTimeMs:this.percentile(s,99),fallbackRate:c>0?u/c:0,ruleMatchRate:c>0?p/c:0,estimatedCostSavings:this.calculateCostSavings(r),ruleStats:{totalEvaluated:r.reduce((m,h)=>m+1,0),matched:p,avgRulesPerDecision:1},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:t,end:new Date},recentDecisions:r.slice(-50),fallbackStats:this.calculateFallbackStats(o)}}getMetricsByProvider(e){let t=this.decisions.filter(s=>s.provider===e),r=this.providerCalls.filter(s=>s.provider===e),i=r.map(s=>s.latencyMs),o=t.map(s=>s.decisionTimeMs),n=r.filter(s=>s.success),a=r.filter(s=>!s.success);return{provider:e,selectionCount:t.length,ruleMatchCount:t.filter(s=>s.ruleId).length,fallbackCount:t.filter(s=>s.wasFallback).length,avgDecisionTimeMs:this.average(o),successRate:r.length>0?n.length/r.length:1,avgLatencyMs:this.average(i),p95LatencyMs:this.percentile(i,95),p99LatencyMs:this.percentile(i,99),totalCost:r.reduce((s,c)=>s+(c.cost??0),0),totalTokens:r.reduce((s,c)=>s+c.totalTokens,0),totalInputTokens:r.reduce((s,c)=>s+c.inputTokens,0),totalOutputTokens:r.reduce((s,c)=>s+c.outputTokens,0),circuitState:"closed",latencyHistogram:i.slice(-100),decisionTimeHistogram:o.slice(-100),errorCount:a.length,lastError:a.length>0?a[a.length-1].timestamp:void 0,recentCalls:r.slice(-20)}}getMetricsByAgentType(e){let t=this.decisions.filter(c=>c.agentType===e),r=this.providerCalls.filter(c=>c.agentType===e),i=new Map,o=new Map;for(let c of t)i.set(c.provider,(i.get(c.provider)??0)+1),o.set(c.model,(o.get(c.model)??0)+1);let n=r.map(c=>c.latencyMs),a=t.filter(c=>c.wasFallback).length,s=t.filter(c=>c.success).length;return{agentType:e,totalDecisions:t.length,providerDistribution:i,modelDistribution:o,avgLatencyMs:this.average(n),totalCost:r.reduce((c,d)=>c+(d.cost??0),0),totalTokens:r.reduce((c,d)=>c+d.totalTokens,0),fallbackRate:t.length>0?a/t.length:0,successRate:t.length>0?s/t.length:1}}getAuditLog(e={}){let t=this.decisions;e.since&&(t=t.filter(i=>i.timestamp>=e.since)),e.provider&&(t=t.filter(i=>i.provider===e.provider)),e.agentType&&(t=t.filter(i=>i.agentType===e.agentType));let r=e.limit??100;return t.slice(-r).map(i=>({id:i.id,timestamp:i.timestamp,context:{agentType:i.agentType},decision:{providerType:i.provider,model:i.model,providerModelId:i.model,reason:i.reason,confidence:1,metadata:{decisionTimeMs:i.decisionTimeMs,timestamp:i.timestamp}},outcome:{success:i.success,latencyMs:i.latencyMs,tokenUsage:i.tokenUsage,cost:i.cost}}))}resetMetrics(){this.decisions=[],this.providerCalls=[],this.fallbacks=[],this.cacheHits=0,this.cacheMisses=0,this.startTime=new Date}inferMode(e){switch(e){case"manual":return"manual";case"rule-match":return"rule-based";case"cost-optimization":return"cost-optimized";case"performance-optimization":return"performance-optimized";default:return"rule-based"}}trimRecords(){this.decisions.length>this.maxRecords&&(this.decisions=this.decisions.slice(-this.maxRecords))}trimCallRecords(){this.providerCalls.length>this.maxCallRecords&&(this.providerCalls=this.providerCalls.slice(-this.maxCallRecords))}getWindowStart(e){let t=new Date;switch(e){case"1m":return new Date(t.getTime()-60*1e3);case"5m":return new Date(t.getTime()-300*1e3);case"15m":return new Date(t.getTime()-900*1e3);case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);default:return this.startTime}}filterByTime(e,t){return e.filter(r=>r.timestamp>=t)}calculateProviderMetrics(e,t){let r=new Map;for(let i of C){let o=e.filter(d=>d.provider===i),n=t.filter(d=>d.provider===i);if(o.length===0&&n.length===0)continue;let a=n.map(d=>d.latencyMs),s=o.map(d=>d.decisionTimeMs),c=n.filter(d=>d.success);r.set(i,{provider:i,selectionCount:o.length,ruleMatchCount:o.filter(d=>d.ruleId).length,fallbackCount:o.filter(d=>d.wasFallback).length,avgDecisionTimeMs:this.average(s),successRate:n.length>0?c.length/n.length:1,avgLatencyMs:this.average(a),p95LatencyMs:this.percentile(a,95),p99LatencyMs:this.percentile(a,99),totalCost:n.reduce((d,u)=>d+(u.cost??0),0),totalTokens:n.reduce((d,u)=>d+u.totalTokens,0),circuitState:"closed"})}return r}calculateAgentMetrics(e,t){let r=new Set;e.forEach(o=>o.agentType&&r.add(o.agentType)),t.forEach(o=>o.agentType&&r.add(o.agentType));let i=new Map;for(let o of r)i.set(o,this.getMetricsByAgentType(o));return i}countByMode(e){let t={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};for(let r of e)t[r.mode]++;return t}calculateFallbackStats(e){let t=new Map,r=new Map;for(let i of e)t.set(i.fromProvider,(t.get(i.fromProvider)??0)+1),r.set(i.reason,(r.get(i.reason)??0)+1);return{total:e.length,byProvider:t,byReason:r}}calculateCostSavings(e){return e.reduce((t,r)=>r.cost&&r.mode==="cost-optimized"?t+r.cost.totalCost*.2:t,0)}average(e){return e.length===0?0:e.reduce((t,r)=>t+r,0)/e.length}percentile(e,t){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),i=Math.ceil(t/100*r.length)-1;return r[Math.max(0,i)]}};function U(l){return new E(l)}pe();P();var A=class{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(e={}){this.maxRecords=e.maxRecords??1e4}recordCost(e,t,r,i,o={}){let n=this.calculateCost(t,r,i),a={timestamp:new Date,provider:e,model:t,inputTokens:r,outputTokens:i,inputCost:n.inputCost,outputCost:n.outputCost,totalCost:n.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(a),this.trimRecords(),this.checkAlerts(),a}recordCostFromInfo(e,t,r,i,o={}){let n={timestamp:new Date,provider:e,model:t,inputTokens:r.promptTokens,outputTokens:r.completionTokens,inputCost:i.inputCost,outputCost:i.outputCost,totalCost:i.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(n),this.trimRecords(),this.checkAlerts(),n}getCostByProvider(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Map;for(let o of C){let n=r.filter(c=>c.provider===o);if(n.length===0)continue;let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);i.set(o,{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return i}getCostByAgentType(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(a=>a.agentType&&i.add(a.agentType));let o=new Map;for(let a of i){let s=r.filter(u=>u.agentType===a),c=s.reduce((u,p)=>u+p.totalCost,0),d=s.reduce((u,p)=>u+p.inputTokens+p.outputTokens,0);o.set(a,{totalCost:c,totalTokens:d,totalRequests:s.length,avgCostPerRequest:s.length>0?c/s.length:0,avgCostPerToken:d>0?c/d:0})}let n=r.filter(a=>!a.agentType);if(n.length>0){let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);o.set("unknown",{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return o}getCostByModel(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(n=>i.add(n.model));let o=new Map;for(let n of i){let a=r.filter(d=>d.model===n),s=a.reduce((d,u)=>d+u.totalCost,0),c=a.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0);o.set(n,{totalCost:s,totalTokens:c,totalRequests:a.length,avgCostPerRequest:a.length>0?s/a.length:0,avgCostPerToken:c>0?s/c:0})}return o}getTotalCost(e="all"){let t=this.getPeriodStart(e);return this.filterByTime(t).reduce((i,o)=>i+o.totalCost,0)}getCostTrend(e){let t=new Date,r=[],i,o;switch(e){case"1h":i=300*1e3,o=12;break;case"24h":i=3600*1e3,o=24;break;case"7d":i=1440*60*1e3,o=7;break}for(let n=o-1;n>=0;n--){let a=new Date(t.getTime()-n*i),s=new Date(a.getTime()-i),c=this.records.filter(d=>d.timestamp>=s&&d.timestamp<a);r.push({timestamp:a,cost:c.reduce((d,u)=>d+u.totalCost,0),tokens:c.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0),requests:c.length})}return r}addBudgetAlert(e,t,r){let i={threshold:e,period:t,callback:r,active:!0};return this.alerts.push(i),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),`alert-${this.alerts.length-1}`}removeBudgetAlert(e){return e>=0&&e<this.alerts.length?(this.alerts.splice(e,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getOptimizationSuggestions(){let e=[],t=this.getCostByModel("24h");for(let[n,a]of t)q(n)&&a.totalCost>1&&(n.includes("opus")&&e.push({type:"model-switch",description:"Consider using Sonnet instead of Opus for non-critical tasks",estimatedSavings:a.totalCost*.5,currentCost:a.totalCost,suggestedModel:y}),n==="gpt-4o"&&e.push({type:"model-switch",description:"Consider using GPT-4o-mini for simpler tasks",estimatedSavings:a.totalCost*.7,currentCost:a.totalCost,suggestedModel:"gpt-4o-mini"}));let r=this.getCostByProvider("24h"),i=[...r.values()].reduce((n,a)=>n+a.totalCost,0);return i>10&&!r.has("ollama")&&e.push({type:"provider-switch",description:"Consider using Ollama for development/testing workloads",estimatedSavings:i*.3,currentCost:i,suggestedProvider:"ollama"}),[...t.values()].reduce((n,a)=>n+a.totalRequests,0)>100&&e.push({type:"caching",description:"Enable response caching to reduce redundant API calls",estimatedSavings:i*.15,currentCost:i}),e}getRecords(){return[...this.records]}clear(){this.records=[]}reset(){this.records=[],this.alerts=[],this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}calculateCost(e,t,r){let i=q(e);if(!i)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let o=t/1e6*i.input,n=r/1e6*i.output;return{inputCost:o,outputCost:n,totalCost:o+n,currency:"USD"}}trimRecords(){this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}getPeriodStart(e){let t=new Date;switch(e){case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);case"30d":return new Date(t.getTime()-720*60*60*1e3);default:return new Date(0)}}filterByTime(e){return this.records.filter(t=>t.timestamp>=e)}checkAlerts(){for(let e of this.alerts){if(!e.active)continue;let t=this.getTotalCost(e.period);if(t>=e.threshold){e.active=!1;let r=this.getPeriodStart(e.period),i=this.filterByTime(r),o=i.reduce((n,a)=>n+a.inputTokens+a.outputTokens,0);try{e.callback({totalCost:t,totalTokens:o,totalRequests:i.length,avgCostPerRequest:i.length>0?t/i.length:0,avgCostPerToken:o>0?t/o:0})}catch(n){console.error("Budget alert callback error:",n)}}}}};function $(l){return new A(l)}de();ue();P();var D=class{cache=new Map;maxSize;ttlMs;constructor(e=100,t=6e4){this.maxSize=e,this.ttlMs=t}get(e){let t=this.cache.get(e);return t?Date.now()>t.expiresAt?(this.cache.delete(e),null):t.decision:null}set(e,t){if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(e,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{hits:0,misses:0,size:this.cache.size}}},T=class{config;providerManager;ruleEngine;decisionCache;metrics;routerMetrics;costMetrics;initialized=!1;constructor(e,t){this.providerManager=e,this.config={...Q,...t};let r=this.config.rules.length>0?this.config.rules:w;this.ruleEngine=new x(r),this.decisionCache=new D(100,this.config.decisionCacheTtlMs),this.metrics=new H,this.routerMetrics=U(),this.costMetrics=$()}async initialize(){this.initialized||(await this.providerManager.initialize(),this.initialized=!0)}getMode(){return this.config.mode}setMode(e){this.config.mode=e,this.decisionCache.clear()}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e},e.rules&&this.ruleEngine.setRules(e.rules),e.decisionCacheTtlMs&&(this.decisionCache=new D(100,e.decisionCacheTtlMs))}async selectProvider(e){await this.ensureInitialized();let t=Date.now(),r=this.config.cacheDecisions&&!e.strictModel;if(r){let o=this.generateCacheKey(e),n=this.decisionCache.get(o);if(n)return this.metrics.recordCacheHit(),this.routerMetrics.recordCacheHit(),n;this.metrics.recordCacheMiss(),this.routerMetrics.recordCacheMiss()}let i;if(e.strictModel)i=this.selectStrict(e);else switch(this.config.mode){case"manual":i=await this.selectManual(e);break;case"rule-based":i=await this.selectRuleBased(e);break;case"cost-optimized":i=await this.selectCostOptimized(e);break;case"performance-optimized":i=await this.selectPerformanceOptimized(e);break;default:i=await this.selectRuleBased(e)}if(i.metadata.decisionTimeMs=Date.now()-t,r){let o=this.generateCacheKey(e);this.decisionCache.set(o,i)}return this.metrics.recordDecision(i,this.config.mode),i}async chat(e){await this.ensureInitialized();let t=Y(),r=await this.selectProvider(e),i=e.agentType??"";if(O(i)&&(k(r.model)||k(r.providerModelId))){if(e.strictModel)throw f(`Strict model request for ${r.model} conflicts with the cyber verification pin for ${i}`,"MODEL_NOT_FOUND",{provider:r.providerType,model:r.model,retryable:!1});let n=r.model,a=r.providerModelId;r.model=I(i,r.model,X),r.providerModelId=I(i,r.providerModelId,z(r.providerType)),console.warn(`[aqe] ADR-093: ${i} pinned to ${r.model} (was ${n}/${a}); set AQE_CYBER_VERIFIED=true after Cyber Verification Program approval`)}return await this.executeWithFallback(e,r,t)}async*stream(e){await this.ensureInitialized();let t=await this.selectProvider(e),r=await this.chat(e),i=100;for(let o=0;o<r.content.length;o+=i){let n=o+i>=r.content.length;yield{type:n?"done":"content",delta:r.content.slice(o,o+i),accumulated:r.content.slice(0,o+i),done:n,tokenCount:Math.ceil((o+i)/4),model:r.model,provider:t.providerType,usage:n?r.usage:void 0}}}getMetrics(){return this.metrics.getMetrics()}getEnhancedMetrics(e){return this.routerMetrics.getMetrics(e)}getProviderMetrics(e){return this.routerMetrics.getMetricsByProvider(e)}getAgentMetrics(e){return this.routerMetrics.getMetricsByAgentType(e)}getCostByProvider(e){return this.costMetrics.getCostByProvider(e)}getCostByAgentType(e){return this.costMetrics.getCostByAgentType(e)}getCostByModel(e){return this.costMetrics.getCostByModel(e)}getTotalCost(e){return this.costMetrics.getTotalCost(e)}getCostTrend(e){return this.costMetrics.getCostTrend(e)}getAuditLog(e){return this.routerMetrics.getAuditLog(e)}getOptimizationSuggestions(){return this.costMetrics.getOptimizationSuggestions()}resetMetrics(){this.metrics.reset(),this.routerMetrics.resetMetrics(),this.costMetrics.reset()}clearCache(){this.decisionCache.clear()}selectStrict(e){if(!e.model?.trim())throw f("strictModel requires an explicit nonempty model","MODEL_NOT_FOUND",{retryable:!1});let t=e.preferredProvider??this.config.defaultProvider,r=this.providerManager.getProvider(t);if(!r)throw f(`Strict model provider ${t} is unavailable`,"PROVIDER_UNAVAILABLE",{provider:t,model:e.model,retryable:!1});return this.createDecision(r,t,e.model,"manual")}async selectManual(e){let t=e.preferredProvider??this.config.defaultProvider,r=e.model??this.config.defaultModel,i=this.providerManager.getProvider(t);return i?this.createDecision(i,t,r,"manual"):this.createFallbackDecision(e,"manual")}async selectRuleBased(e){let t=this.ruleEngine.evaluate(e);if(t){let{rule:o,rulesEvaluated:n}=t,a=o.action.provider,s=this.providerManager.getProvider(a);if(s){let c=this.createDecision(s,a,o.action.model,"rule-match",o);return c.metadata.rulesEvaluated=n,c}}let r=this.config.defaultProvider,i=this.providerManager.getProvider(r);return i?this.createDecision(i,r,this.config.defaultModel,"default"):this.createFallbackDecision(e,"rule-based")}async selectCostOptimized(e){let t=this.providerManager.getAvailableProviders();if(t.length===0)return this.createFallbackDecision(e,"cost-optimized");let r=1/0,i=t[0],o,n=[];for(let a of t){let s=this.providerManager.getProvider(a);if(!s)continue;let{input:c,output:d}=s.getCostPerToken(),u=this.estimateCostValue(e,c,d);n.push({provider:a,model:s.getConfig().model,reason:`Estimated cost: $${u.toFixed(6)}`,estimatedCost:u,excluded:!1}),u<r&&(r=u,i=a,o=s)}if(o){let a=o.getConfig(),s=this.createDecision(o,i,a.model,"cost-optimization");return s.metadata.estimatedCost=this.createCostEstimate(e,o),s.metadata.alternativesConsidered=n,s}return this.createFallbackDecision(e,"cost-optimized")}async selectPerformanceOptimized(e){let t=this.providerManager.getAvailableProviders(),r=this.providerManager.getMetrics();if(t.length===0)return this.createFallbackDecision(e,"performance-optimized");let i=1/0,o=t[0],n,a=[];for(let s of t){let c=this.providerManager.getProvider(s);if(!c)continue;let u=r[s]?.avgLatencyMs??1/0;a.push({provider:s,model:c.getConfig().model,reason:`Avg latency: ${u}ms`,estimatedLatencyMs:u,excluded:!1}),u<i&&(i=u,o=s,n=c)}if(n){let s=n.getConfig(),c=this.createDecision(n,o,s.model,"performance-optimization");return c.metadata.estimatedLatencyMs=i,c.metadata.alternativesConsidered=a,c}return this.createFallbackDecision(e,"performance-optimized")}async executeWithFallback(e,t,r){let{fallbackChain:i,fallbackBehavior:o}=this.config,n,a=0,s=[{provider:t.providerType,model:t.providerModelId}],c=this.config.defaultProvider;if(!e.strictModel&&c&&c!==t.providerType&&s.push({provider:c,model:this.config.defaultModel}),!e.strictModel){for(let p of i.entries)if(p.enabled&&p.provider!==t.providerType)for(let m of p.models)s.push({provider:p.provider,model:m})}let d=e.agentType??"";if(O(d))for(let p of s)k(p.model)&&(p.model=z(p.provider));let u=s;if(e.requiresTools){let p=s.filter(m=>S(m.model));if(p.length>0&&p.length<s.length){let m=s.filter(h=>!S(h.model)).map(h=>`${h.provider}:${h.model}`);console.warn(`[llm-router] requiresTools: skipping tool-less model(s) ${m.join(", ")}`),u=p}}this.providerManager.assertWithinBudget(e.messages,{model:u[0]?.model,maxTokens:e.maxTokens});for(let{provider:p,model:m}of u){if(a>=o.maxAttempts)break;let h=this.providerManager.getProvider(p);if(!h)continue;a++;let N=Date.now();try{let g=await h.generate(e.messages,{model:m,temperature:e.temperature,maxTokens:e.maxTokens,systemPrompt:e.systemPrompt,timeoutMs:e.timeoutMs,skipCache:e.skipCache,metadata:e.metadata});if(this.providerManager.recordResponseSpend(g,e.agentType),e.strictModel){if(g.provider!==p)throw f(`Strict model provider mismatch: expected ${p}, received ${g.provider}`,"PROVIDER_UNAVAILABLE",{provider:p,model:m,retryable:!1});if(!this.isSameModel(t.model,g.model))throw f(`Strict model mismatch: expected ${t.model}, received ${g.model}`,"MODEL_NOT_FOUND",{provider:p,model:m,retryable:!1})}let M=Date.now()-N;return this.metrics.recordSuccess(p),this.routerMetrics.recordRoutingDecision(t,M,{agentType:e.agentType,success:!0,tokenUsage:g.usage,cost:g.cost}),this.routerMetrics.recordProviderCall(p,m,M,g.usage.totalTokens,{inputTokens:g.usage.promptTokens,outputTokens:g.usage.completionTokens,success:!0,cost:g.cost.totalCost,agentType:e.agentType}),this.costMetrics.recordCostFromInfo(p,m,g.usage,g.cost,{agentType:e.agentType,requestId:g.requestId}),{content:g.content,model:g.model,providerModelId:g.model,provider:g.provider,usage:g.usage,cost:g.cost,latencyMs:g.latencyMs,finishReason:g.finishReason,cached:g.cached,requestId:g.requestId,routingDecision:t}}catch(g){n=G(g);let M=Date.now()-N;if(this.metrics.recordFailure(p),this.routerMetrics.recordProviderCall(p,m,M,0,{success:!1,agentType:e.agentType}),a<s.length){let j=s[a];j&&this.routerMetrics.recordFallback(p,j.provider,n.message,e.agentType)}let ce=W(g)&&!g.retryable;!e.strictModel&&!ce&&a<o.maxAttempts&&await this.delay(o.delayMs)}}throw f(`All providers failed after ${a} attempts: ${n?.message??"Unknown error"}`,"PROVIDER_UNAVAILABLE",{retryable:!1,cause:n})}isSameModel(e,t){if(e===t)return!0;try{return b(e)===b(t)}catch{return!1}}createDecision(e,t,r,i,o){let{canonicalModel:n,providerModelId:a}=this.resolveModelIds(r,t);return{provider:e,providerType:t,model:n,providerModelId:a,reason:i,matchedRule:o,confidence:i==="rule-match"?.95:.8,metadata:{decisionTimeMs:0,timestamp:new Date}}}resolveModelIds(e,t){let i={claude:"anthropic","claude-code":"anthropic",openai:"openai",ollama:"ollama",openrouter:"openrouter",gemini:"gemini","azure-openai":"azure",bedrock:"bedrock"}[t];if(!i)return{canonicalModel:e,providerModelId:e};try{let o=b(e),n=L(o,i);return{canonicalModel:o,providerModelId:n}}catch{try{if(J(e)){let n=L(e,i);return{canonicalModel:e,providerModelId:n}}}catch{}return{canonicalModel:e,providerModelId:e}}}createFallbackDecision(e,t){for(let i of this.config.fallbackChain.entries){if(!i.enabled||!["claude","openai","ollama"].includes(i.provider))continue;let n=this.providerManager.getProvider(i.provider);if(n)return this.createDecision(n,i.provider,i.models[0],"fallback")}let r=this.providerManager.getAvailableProviders();if(r.length>0){let i=r[0],o=this.providerManager.getProvider(i);return this.createDecision(o,i,o.getConfig().model,"fallback")}throw f(`No providers available for ${t} selection`,"PROVIDER_UNAVAILABLE",{retryable:!1})}generateCacheKey(e){return[this.config.mode,e.agentType??"default",e.complexity??"medium",e.requiresTools?"tools":"no-tools",e.preferredProvider??"any"].join(":")}estimateCostValue(e,t,r){let i=0;e.systemPrompt&&(i+=Math.ceil(e.systemPrompt.length/4));for(let n of e.messages)i+=Math.ceil(n.content.length/4);let o=e.maxTokens??1e3;return i*t+o*r}createCostEstimate(e,t){let{input:r,output:i}=t.getCostPerToken(),o=0;e.systemPrompt&&(o+=Math.ceil(e.systemPrompt.length/4));for(let s of e.messages)o+=Math.ceil(s.content.length/4);let n=e.maxTokens??1e3,a=o*r+n*i;return{inputTokens:o,outputTokens:n,totalCostUsd:a,inputCostPer1M:r*1e6,outputCostPer1M:i*1e6}}delay(e){return new Promise(t=>setTimeout(t,e))}async ensureInitialized(){this.initialized||await this.initialize()}},H=class{decisions=new Map;decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};totalDecisions=0;cacheHits=0;cacheMisses=0;totalRulesEvaluated=0;rulesMatched=0;fallbackCount=0;startTime=new Date;recordDecision(e,t){this.totalDecisions++,this.decisionsByMode[t]++,e.metadata.rulesEvaluated&&(this.totalRulesEvaluated+=e.metadata.rulesEvaluated),e.matchedRule&&this.rulesMatched++,e.reason==="fallback"&&this.fallbackCount++;let r=this.decisions.get(e.providerType);r||(r=this.createEmptyMetrics(e.providerType),this.decisions.set(e.providerType,r)),r.selectionCount++,e.reason==="rule-match"&&r.ruleMatchCount++,e.reason==="fallback"&&r.fallbackCount++}recordSuccess(e){let t=this.decisions.get(e);if(t){let r=t.successRate*t.selectionCount;t.successRate=(r+1)/t.selectionCount}}recordFailure(e){}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(){let e={};for(let[r,i]of this.decisions)e[r]={...i};let t=this.totalDecisions>0?this.rulesMatched/this.totalDecisions:0;return{byProvider:e,totalDecisions:this.totalDecisions,decisionsByMode:{...this.decisionsByMode},avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:this.totalDecisions>0?this.fallbackCount/this.totalDecisions:0,ruleMatchRate:t,estimatedCostSavings:0,ruleStats:{totalEvaluated:this.totalRulesEvaluated,matched:this.rulesMatched,avgRulesPerDecision:this.totalDecisions>0?this.totalRulesEvaluated/this.totalDecisions:0},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:this.startTime,end:new Date}}}reset(){this.decisions.clear(),this.decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0},this.totalDecisions=0,this.cacheHits=0,this.cacheMisses=0,this.totalRulesEvaluated=0,this.rulesMatched=0,this.fallbackCount=0,this.startTime=new Date}createEmptyMetrics(e){return{provider:e,selectionCount:0,ruleMatchCount:0,fallbackCount:0,avgDecisionTimeMs:0,successRate:1,avgLatencyMs:0,p95LatencyMs:0,p99LatencyMs:0,totalCost:0,totalTokens:0,circuitState:"closed"}}};le();var me=V("llm/router-service");function ae(l){let e={};for(let[i,o]of Object.entries(l.providers??{}))o?.defaultModel&&(e[i]=o.defaultModel);oe(l.agentOverrides,e);let t=se();if(t.length===0)return l;let r=l.rules.length>0?l.rules:w;return{...l,rules:[...t,...r]}}var ye=["ollama","onnx","gemini","openrouter","openai","claude","azure-openai","bedrock"];async function St(l={}){if(l.providerManager){let c=ae(B({projectRoot:l.projectRoot,override:l.override,env:l.env})),d=new T(l.providerManager,c);return await d.initialize(),{router:d,resolvedConfig:c,enabledProviders:he(c)}}if(!ee({projectRoot:l.projectRoot,env:l.env}))return null;let e=ae(B({projectRoot:l.projectRoot,override:l.override,env:l.env})),t=ve(e,l.env??process.env);if(t.length===0)return null;let r=new Set(t);for(let[c,d]of Object.entries(e.agentOverrides??{}))d.provider&&!r.has(d.provider)&&me.warn(`[llm-config] agentOverrides["${c}"] routes to provider "${d.provider}", which is not enabled (no API key detected and not enabled in .agentic-qe/llm-config.json). This override will not take effect until that provider is available.`);let{primary:i,fallbacks:o}=fe(e,t),n={primary:i,fallbacks:o,providers:Ce(e,t,l.allowProjectProviderEndpoints??!0),loadBalancing:"round-robin",global:{enableCostTracking:!0,enableMetrics:!0}},a=new K(n),s=new T(a,e);return await s.initialize(),{router:s,resolvedConfig:e,enabledProviders:t}}function ve(l,e=process.env){let t=Z(e),r=[],i=o=>{r.includes(o)||!l.providers?.[o]?.enabled||t.has(o)&&r.push(o)};i(l.defaultProvider);for(let o of l.fallbackChain?.entries??[])i(o.provider);for(let o of ye)i(o);for(let o of C)i(o);return r}function he(l){let e=new Set([l.defaultProvider]);for(let t of l.fallbackChain?.entries??[])e.add(t.provider);return Array.from(e)}function fe(l,e){if(e.length===0)throw new Error("pickPrimaryAndFallbacks: no enabled providers");let t=e.includes(l.defaultProvider)?l.defaultProvider:e[0],r=e.filter(i=>i!==t);return{primary:t,fallbacks:r}}function Ce(l,e,t=!0){let r={};for(let i of e){let o=l.providers?.[i];if(o){let n={...o};(i==="codex"||i==="claude-code")&&delete n.binaryPath,t||delete n.baseUrl,r[i]=n}}return r}export{St as a,ve as b,fe as c,Ce as d};
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{i as K}from"./chunk-UUBIQR6A.js";import{b as X,c as k,d as O,e as I,f as z}from"./chunk-M4WMSCAE.js";import{b as f,c as W,j as C,k as Q,o as Z,q as B,r as ee}from"./chunk-O6EWL5DQ.js";import{b as q,f as pe}from"./chunk-BBRROA3Z.js";import{a as L,b,c as J,d as ue,f as S,i as y,j as R,n as P}from"./chunk-LTQVUAPH.js";import{i as Y}from"./chunk-QFGYH6HD.js";import{d as V,e as le}from"./chunk-BQ47GQPK.js";import{b as G,e as de}from"./chunk-HL2ANKN3.js";P();var te={security:{provider:"claude",model:R,temperature:.1,maxTokens:16e3,priority:100},"test-generation":{provider:"claude",model:y,temperature:.3,maxTokens:8e3,priority:90},"code-analysis":{provider:"claude",model:y,temperature:.2,maxTokens:8e3,priority:85},performance:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:4e3,priority:70},documentation:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.4,maxTokens:4e3,priority:60},learning:{provider:"claude",model:y,temperature:.3,maxTokens:8e3,priority:80},coordination:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:2e3,priority:75},simple:{provider:"openai",model:"gpt-6-luna",temperature:.3,maxTokens:2e3,priority:50},general:{provider:"claude",model:y,temperature:.3,maxTokens:4e3,priority:60}},_={"security-auditor":"security","security-architect":"security","security-scanner":"security","v3-qe-security-scanner":"security","security-manager":"security","vulnerability-scanner":"security","penetration-tester":"security","compliance-auditor":"security","threat-analyzer":"security","test-generator":"test-generation","v3-qe-test-generator":"test-generation",tester:"test-generation","tdd-specialist":"test-generation","tdd-london-swarm":"test-generation","unit-test-generator":"test-generation","integration-test-generator":"test-generation","e2e-test-generator":"test-generation","mutation-tester":"test-generation","property-based-tester":"test-generation","contract-tester":"test-generation","v3-qe-contract-tester":"test-generation","api-tester":"test-generation","visual-tester":"test-generation","v3-qe-visual-tester":"test-generation","accessibility-tester":"test-generation","code-reviewer":"code-analysis","code-analyzer":"code-analysis",reviewer:"code-analysis","v3-qe-code-intelligence":"code-analysis","v3-qe-code-analyzer":"code-analysis","coverage-analyzer":"code-analysis","v3-qe-coverage-analyzer":"code-analysis","defect-predictor":"code-analysis","v3-qe-defect-predictor":"code-analysis","static-analyzer":"code-analysis","complexity-analyzer":"code-analysis","dependency-analyzer":"code-analysis","refactoring-advisor":"code-analysis","quality-assessor":"code-analysis","v3-qe-quality-assessor":"code-analysis","test-executor":"code-analysis","v3-qe-test-executor":"code-analysis","parallel-executor":"code-analysis","flaky-test-detector":"code-analysis","test-orchestrator":"code-analysis","performance-tester":"performance","performance-engineer":"performance","perf-analyzer":"performance","performance-benchmarker":"performance","load-tester":"performance","stress-tester":"performance","v3-qe-chaos-engineer":"performance","chaos-engineer":"performance","resilience-tester":"performance","scalability-tester":"performance","api-docs":"documentation","doc-generator":"documentation","readme-generator":"documentation","changelog-generator":"documentation","specification-writer":"documentation","v3-qe-learning-optimizer":"learning","learning-optimizer":"learning","ml-developer":"learning","pattern-learner":"learning","optimization-agent":"learning","smart-agent":"learning","requirements-validator":"code-analysis","v3-qe-requirements-validator":"code-analysis","bdd-generator":"test-generation","acceptance-tester":"test-generation",coordinator:"coordination","hierarchical-coordinator":"coordination","mesh-coordinator":"coordination","adaptive-coordinator":"coordination","collective-intelligence-coordinator":"coordination","swarm-memory-manager":"coordination","byzantine-coordinator":"coordination","raft-manager":"coordination","gossip-coordinator":"coordination","consensus-builder":"coordination","crdt-synchronizer":"coordination","quorum-manager":"coordination","task-orchestrator":"coordination","memory-coordinator":"coordination",coder:"code-analysis",planner:"code-analysis",researcher:"code-analysis","backend-dev":"code-analysis","mobile-dev":"code-analysis","cicd-engineer":"code-analysis","system-architect":"code-analysis","base-template-generator":"test-generation","github-modes":"coordination","pr-manager":"coordination","code-review-swarm":"code-analysis","issue-tracker":"coordination","release-manager":"coordination","workflow-automation":"coordination","project-board-sync":"coordination","repo-architect":"code-analysis","multi-repo-swarm":"coordination","sparc-coord":"coordination","sparc-coder":"code-analysis",specification:"documentation",pseudocode:"code-analysis",architecture:"code-analysis",refinement:"code-analysis","memory-specialist":"learning","production-validator":"code-analysis"},v={heavyweight:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!0,requiresJsonMode:!0,minContextSize:1e5,costSensitivity:"low",latencySensitivity:"low"},standard:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:5e4,costSensitivity:"medium",latencySensitivity:"medium"},lightweight:{requiresReasoning:!1,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:16e3,costSensitivity:"medium",latencySensitivity:"high"},minimal:{requiresReasoning:!1,requiresTools:!1,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!1,minContextSize:4e3,costSensitivity:"high",latencySensitivity:"medium"}},Te={security:v.heavyweight,"test-generation":v.standard,"code-analysis":v.standard,learning:v.standard,performance:{...v.lightweight,costSensitivity:"high"},coordination:v.lightweight,general:{...v.lightweight,requiresJsonMode:!1,latencySensitivity:"medium"},documentation:{...v.minimal,minContextSize:16e3},simple:v.minimal};function re(l){if(Object.hasOwn(_,l))return _[l];let e=l.toLowerCase();return e.includes("security")||e.includes("audit")||e.includes("vulnerab")||e.includes("penetration")||e.includes("threat")||e.includes("compliance")?"security":e.includes("test-gen")||e.includes("tdd")||e.includes("unit-test")||e.includes("e2e-test")||e.includes("integration-test")||e.includes("mutation")?"test-generation":e.includes("code-")||e.includes("coverage")||e.includes("defect")||e.includes("review")||e.includes("analyzer")||e.includes("quality")?"code-analysis":e.includes("perf")||e.includes("load")||e.includes("stress")||e.includes("benchmark")||e.includes("chaos")||e.includes("resilience")?"performance":e.includes("doc")||e.includes("readme")||e.includes("changelog")||e.includes("spec")?"documentation":e.includes("learn")||e.includes("ml-")||e.includes("pattern")||e.includes("optim")?"learning":e.includes("coord")||e.includes("swarm")||e.includes("orchestrat")||e.includes("consensus")||e.includes("manager")?"coordination":"general"}var F={},ie={};function oe(l,e){F={...l??{}},ie={...e??{}}}function ne(l){let e=re(l),t=te[e],r=F[l];if(!r)return t;let i=r.provider!==void 0&&r.provider!==t.provider,o=r.model??(i?ie[r.provider]:void 0);return{...t,...r.provider!==void 0?{provider:r.provider}:{},...o!==void 0?{model:o}:{},...r.temperature!==void 0?{temperature:r.temperature}:{},...r.maxTokens!==void 0?{maxTokens:r.maxTokens}:{},priority:r.priority??t.priority+100}}function se(){return Object.keys(F).map(l=>{let e=ne(l);return{id:`agent-override-${l}`,name:`User override: ${l} -> ${e.provider}/${e.model}`,description:`Per-agent routing override from .agentic-qe/llm-config.json (agentOverrides["${l}"])`,condition:{agentType:[l]},action:{provider:e.provider,model:e.model,temperature:e.temperature,maxTokens:e.maxTokens,priority:e.priority},enabled:!0,priority:e.priority}}).sort((l,e)=>e.priority-l.priority)}P();var x=class{rules=[];constructor(e=[]){this.setRules(e)}setRules(e){this.rules=[...e].filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}getRules(){return[...this.rules]}addRule(e){this.rules.push(e),this.rules=this.rules.filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}removeRule(e){let t=this.rules.findIndex(r=>r.id===e);return t>=0?(this.rules.splice(t,1),!0):!1}setRuleEnabled(e,t){let r=this.rules.find(i=>i.id===e);return r?(r.enabled=t,this.rules=this.rules.filter(i=>i.enabled).sort((i,o)=>o.priority-i.priority),!0):!1}evaluate(e){let t=0;for(let r of this.rules)if(t++,this.matchesCondition(e,r.condition))return{rule:r,rulesEvaluated:t};return null}evaluateAll(e){return this.rules.filter(t=>this.matchesCondition(e,t.condition))}matchesCondition(e,t){if(t.agentType!==void 0&&(!e.agentType||!t.agentType.includes(e.agentType))||t.requiresTools!==void 0&&!!e.requiresTools!==t.requiresTools)return!1;if(t.complexity!==void 0){let r=Array.isArray(t.complexity)?t.complexity:[t.complexity];if(!e.complexity||!r.includes(e.complexity))return!1}if(t.localOnly!==void 0&&t.localOnly){let r=["ollama","onnx"];if(e.preferredProvider&&!r.includes(e.preferredProvider))return!1}if(t.requiresReasoning!==void 0&&t.requiresReasoning&&e.complexity==="low")return!1;if(t.tokenRange!==void 0){let r=this.estimateTokens(e);if(t.tokenRange.min!==void 0&&r<t.tokenRange.min||t.tokenRange.max!==void 0&&r>t.tokenRange.max)return!1}return!(t.requiredCapabilities!==void 0&&t.requiredCapabilities.length>0&&(!e.requiredCapabilities||e.requiredCapabilities.length===0||!t.requiredCapabilities.every(i=>e.requiredCapabilities.includes(i)))||t.custom!==void 0&&!t.custom(e))}estimateTokens(e){let t=0;e.systemPrompt&&(t+=Math.ceil(e.systemPrompt.length/4));for(let r of e.messages)t+=Math.ceil(r.content.length/4);return t}},w=[{id:"security-agents-opus",name:"Security Agents to Claude Opus",description:"Route security-critical agents to Claude Opus for best security analysis",condition:{agentType:["security-auditor","security-architect","v3-qe-security-scanner"]},action:{provider:"claude",model:R,temperature:.1},enabled:!0,priority:100},{id:"test-gen-with-tools",name:"Test Generation with Tools",description:"Route test generation requests that need tools to Claude Sonnet",condition:{agentType:["v3-qe-test-generator","tester"],requiresTools:!0},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:95},{id:"high-complexity-reasoning",name:"High Complexity Reasoning",description:"Route high complexity tasks requiring reasoning to advanced models",condition:{complexity:"high",requiresReasoning:!0},action:{provider:"claude",model:R,temperature:.2},enabled:!0,priority:90},{id:"code-analysis-agents",name:"Code Analysis Agents",description:"Route code analysis to Claude Sonnet for balanced performance",condition:{agentType:["code-analyzer","v3-qe-code-intelligence","reviewer"]},action:{provider:"claude",model:y,temperature:.2},enabled:!0,priority:85},{id:"coverage-analysis",name:"Coverage Analysis Agents",description:"Route coverage analysis to efficient models",condition:{agentType:["v3-qe-coverage-analyzer"]},action:{provider:"claude",model:y,temperature:.1},enabled:!0,priority:80},{id:"defect-prediction",name:"Defect Prediction Agents",description:"Route defect prediction to capable models",condition:{agentType:["v3-qe-defect-predictor"]},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:75},{id:"medium-complexity",name:"Medium Complexity Tasks",description:"Route medium complexity to balanced Claude Sonnet",condition:{complexity:"medium"},action:{provider:"claude",model:y,temperature:.3},enabled:!0,priority:60},{id:"low-complexity-haiku",name:"Low Complexity to Haiku",description:"Route low complexity tasks to Haiku for cost efficiency",condition:{complexity:"low"},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:50},{id:"local-only-ollama",name:"Local Only Requests",description:"Route local-only requests to Ollama",condition:{localOnly:!0},action:{provider:"ollama",model:"qwen3-coder:30b",temperature:.3},enabled:!0,priority:40},{id:"small-requests-haiku",name:"Small Token Requests",description:"Route small requests to Haiku for efficiency",condition:{tokenRange:{max:500}},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:30}];import{randomUUID as ge}from"crypto";var E=class{decisions=[];providerCalls=[];fallbacks=[];cacheHits=0;cacheMisses=0;startTime=new Date;maxRecords;maxCallRecords;constructor(e={}){this.maxRecords=e.maxRecords??1e4,this.maxCallRecords=e.maxCallRecords??5e3}recordRoutingDecision(e,t,r={}){let i={id:`rd-${Date.now()}-${ge().slice(0,8)}`,timestamp:new Date,provider:e.providerType,model:e.model,mode:this.inferMode(e.reason),reason:e.reason,latencyMs:t,decisionTimeMs:e.metadata.decisionTimeMs,agentType:r.agentType,success:r.success??!0,tokenUsage:r.tokenUsage,cost:r.cost,wasFallback:e.reason==="fallback",ruleId:e.matchedRule?.id};this.decisions.push(i),this.trimRecords()}recordProviderCall(e,t,r,i,o={}){let n=o.inputTokens??Math.floor(i*.7),a=o.outputTokens??i-n,s={timestamp:new Date,provider:e,model:t,latencyMs:r,inputTokens:n,outputTokens:a,totalTokens:i,success:o.success??!0,cost:o.cost,agentType:o.agentType};this.providerCalls.push(s),this.trimCallRecords()}recordFallback(e,t,r,i){let o={timestamp:new Date,fromProvider:e,toProvider:t,reason:r,agentType:i};this.fallbacks.push(o),this.fallbacks.length>1e3&&(this.fallbacks=this.fallbacks.slice(-1e3))}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(e="all"){let t=this.getWindowStart(e),r=this.filterByTime(this.decisions,t),i=this.filterByTime(this.providerCalls,t),o=this.filterByTime(this.fallbacks,t),n=this.calculateProviderMetrics(r,i),a=this.calculateAgentMetrics(r,i),s=r.map(m=>m.decisionTimeMs),c=r.length,d=this.countByMode(r),u=r.filter(m=>m.wasFallback).length,p=r.filter(m=>m.ruleId).length;return{byProvider:Object.fromEntries(n),byAgentType:a,totalDecisions:c,decisionsByMode:d,avgDecisionTimeMs:this.average(s),p95DecisionTimeMs:this.percentile(s,95),p99DecisionTimeMs:this.percentile(s,99),fallbackRate:c>0?u/c:0,ruleMatchRate:c>0?p/c:0,estimatedCostSavings:this.calculateCostSavings(r),ruleStats:{totalEvaluated:r.reduce((m,h)=>m+1,0),matched:p,avgRulesPerDecision:1},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:t,end:new Date},recentDecisions:r.slice(-50),fallbackStats:this.calculateFallbackStats(o)}}getMetricsByProvider(e){let t=this.decisions.filter(s=>s.provider===e),r=this.providerCalls.filter(s=>s.provider===e),i=r.map(s=>s.latencyMs),o=t.map(s=>s.decisionTimeMs),n=r.filter(s=>s.success),a=r.filter(s=>!s.success);return{provider:e,selectionCount:t.length,ruleMatchCount:t.filter(s=>s.ruleId).length,fallbackCount:t.filter(s=>s.wasFallback).length,avgDecisionTimeMs:this.average(o),successRate:r.length>0?n.length/r.length:1,avgLatencyMs:this.average(i),p95LatencyMs:this.percentile(i,95),p99LatencyMs:this.percentile(i,99),totalCost:r.reduce((s,c)=>s+(c.cost??0),0),totalTokens:r.reduce((s,c)=>s+c.totalTokens,0),totalInputTokens:r.reduce((s,c)=>s+c.inputTokens,0),totalOutputTokens:r.reduce((s,c)=>s+c.outputTokens,0),circuitState:"closed",latencyHistogram:i.slice(-100),decisionTimeHistogram:o.slice(-100),errorCount:a.length,lastError:a.length>0?a[a.length-1].timestamp:void 0,recentCalls:r.slice(-20)}}getMetricsByAgentType(e){let t=this.decisions.filter(c=>c.agentType===e),r=this.providerCalls.filter(c=>c.agentType===e),i=new Map,o=new Map;for(let c of t)i.set(c.provider,(i.get(c.provider)??0)+1),o.set(c.model,(o.get(c.model)??0)+1);let n=r.map(c=>c.latencyMs),a=t.filter(c=>c.wasFallback).length,s=t.filter(c=>c.success).length;return{agentType:e,totalDecisions:t.length,providerDistribution:i,modelDistribution:o,avgLatencyMs:this.average(n),totalCost:r.reduce((c,d)=>c+(d.cost??0),0),totalTokens:r.reduce((c,d)=>c+d.totalTokens,0),fallbackRate:t.length>0?a/t.length:0,successRate:t.length>0?s/t.length:1}}getAuditLog(e={}){let t=this.decisions;e.since&&(t=t.filter(i=>i.timestamp>=e.since)),e.provider&&(t=t.filter(i=>i.provider===e.provider)),e.agentType&&(t=t.filter(i=>i.agentType===e.agentType));let r=e.limit??100;return t.slice(-r).map(i=>({id:i.id,timestamp:i.timestamp,context:{agentType:i.agentType},decision:{providerType:i.provider,model:i.model,providerModelId:i.model,reason:i.reason,confidence:1,metadata:{decisionTimeMs:i.decisionTimeMs,timestamp:i.timestamp}},outcome:{success:i.success,latencyMs:i.latencyMs,tokenUsage:i.tokenUsage,cost:i.cost}}))}resetMetrics(){this.decisions=[],this.providerCalls=[],this.fallbacks=[],this.cacheHits=0,this.cacheMisses=0,this.startTime=new Date}inferMode(e){switch(e){case"manual":return"manual";case"rule-match":return"rule-based";case"cost-optimization":return"cost-optimized";case"performance-optimization":return"performance-optimized";default:return"rule-based"}}trimRecords(){this.decisions.length>this.maxRecords&&(this.decisions=this.decisions.slice(-this.maxRecords))}trimCallRecords(){this.providerCalls.length>this.maxCallRecords&&(this.providerCalls=this.providerCalls.slice(-this.maxCallRecords))}getWindowStart(e){let t=new Date;switch(e){case"1m":return new Date(t.getTime()-60*1e3);case"5m":return new Date(t.getTime()-300*1e3);case"15m":return new Date(t.getTime()-900*1e3);case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);default:return this.startTime}}filterByTime(e,t){return e.filter(r=>r.timestamp>=t)}calculateProviderMetrics(e,t){let r=new Map;for(let i of C){let o=e.filter(d=>d.provider===i),n=t.filter(d=>d.provider===i);if(o.length===0&&n.length===0)continue;let a=n.map(d=>d.latencyMs),s=o.map(d=>d.decisionTimeMs),c=n.filter(d=>d.success);r.set(i,{provider:i,selectionCount:o.length,ruleMatchCount:o.filter(d=>d.ruleId).length,fallbackCount:o.filter(d=>d.wasFallback).length,avgDecisionTimeMs:this.average(s),successRate:n.length>0?c.length/n.length:1,avgLatencyMs:this.average(a),p95LatencyMs:this.percentile(a,95),p99LatencyMs:this.percentile(a,99),totalCost:n.reduce((d,u)=>d+(u.cost??0),0),totalTokens:n.reduce((d,u)=>d+u.totalTokens,0),circuitState:"closed"})}return r}calculateAgentMetrics(e,t){let r=new Set;e.forEach(o=>o.agentType&&r.add(o.agentType)),t.forEach(o=>o.agentType&&r.add(o.agentType));let i=new Map;for(let o of r)i.set(o,this.getMetricsByAgentType(o));return i}countByMode(e){let t={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};for(let r of e)t[r.mode]++;return t}calculateFallbackStats(e){let t=new Map,r=new Map;for(let i of e)t.set(i.fromProvider,(t.get(i.fromProvider)??0)+1),r.set(i.reason,(r.get(i.reason)??0)+1);return{total:e.length,byProvider:t,byReason:r}}calculateCostSavings(e){return e.reduce((t,r)=>r.cost&&r.mode==="cost-optimized"?t+r.cost.totalCost*.2:t,0)}average(e){return e.length===0?0:e.reduce((t,r)=>t+r,0)/e.length}percentile(e,t){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),i=Math.ceil(t/100*r.length)-1;return r[Math.max(0,i)]}};function U(l){return new E(l)}pe();P();var A=class{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(e={}){this.maxRecords=e.maxRecords??1e4}recordCost(e,t,r,i,o={}){let n=this.calculateCost(t,r,i),a={timestamp:new Date,provider:e,model:t,inputTokens:r,outputTokens:i,inputCost:n.inputCost,outputCost:n.outputCost,totalCost:n.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(a),this.trimRecords(),this.checkAlerts(),a}recordCostFromInfo(e,t,r,i,o={}){let n={timestamp:new Date,provider:e,model:t,inputTokens:r.promptTokens,outputTokens:r.completionTokens,inputCost:i.inputCost,outputCost:i.outputCost,totalCost:i.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(n),this.trimRecords(),this.checkAlerts(),n}getCostByProvider(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Map;for(let o of C){let n=r.filter(c=>c.provider===o);if(n.length===0)continue;let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);i.set(o,{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return i}getCostByAgentType(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(a=>a.agentType&&i.add(a.agentType));let o=new Map;for(let a of i){let s=r.filter(u=>u.agentType===a),c=s.reduce((u,p)=>u+p.totalCost,0),d=s.reduce((u,p)=>u+p.inputTokens+p.outputTokens,0);o.set(a,{totalCost:c,totalTokens:d,totalRequests:s.length,avgCostPerRequest:s.length>0?c/s.length:0,avgCostPerToken:d>0?c/d:0})}let n=r.filter(a=>!a.agentType);if(n.length>0){let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);o.set("unknown",{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return o}getCostByModel(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(n=>i.add(n.model));let o=new Map;for(let n of i){let a=r.filter(d=>d.model===n),s=a.reduce((d,u)=>d+u.totalCost,0),c=a.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0);o.set(n,{totalCost:s,totalTokens:c,totalRequests:a.length,avgCostPerRequest:a.length>0?s/a.length:0,avgCostPerToken:c>0?s/c:0})}return o}getTotalCost(e="all"){let t=this.getPeriodStart(e);return this.filterByTime(t).reduce((i,o)=>i+o.totalCost,0)}getCostTrend(e){let t=new Date,r=[],i,o;switch(e){case"1h":i=300*1e3,o=12;break;case"24h":i=3600*1e3,o=24;break;case"7d":i=1440*60*1e3,o=7;break}for(let n=o-1;n>=0;n--){let a=new Date(t.getTime()-n*i),s=new Date(a.getTime()-i),c=this.records.filter(d=>d.timestamp>=s&&d.timestamp<a);r.push({timestamp:a,cost:c.reduce((d,u)=>d+u.totalCost,0),tokens:c.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0),requests:c.length})}return r}addBudgetAlert(e,t,r){let i={threshold:e,period:t,callback:r,active:!0};return this.alerts.push(i),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),`alert-${this.alerts.length-1}`}removeBudgetAlert(e){return e>=0&&e<this.alerts.length?(this.alerts.splice(e,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getOptimizationSuggestions(){let e=[],t=this.getCostByModel("24h");for(let[n,a]of t)q(n)&&a.totalCost>1&&(n.includes("opus")&&e.push({type:"model-switch",description:"Consider using Sonnet instead of Opus for non-critical tasks",estimatedSavings:a.totalCost*.5,currentCost:a.totalCost,suggestedModel:y}),n==="gpt-4o"&&e.push({type:"model-switch",description:"Consider using GPT-4o-mini for simpler tasks",estimatedSavings:a.totalCost*.7,currentCost:a.totalCost,suggestedModel:"gpt-4o-mini"}));let r=this.getCostByProvider("24h"),i=[...r.values()].reduce((n,a)=>n+a.totalCost,0);return i>10&&!r.has("ollama")&&e.push({type:"provider-switch",description:"Consider using Ollama for development/testing workloads",estimatedSavings:i*.3,currentCost:i,suggestedProvider:"ollama"}),[...t.values()].reduce((n,a)=>n+a.totalRequests,0)>100&&e.push({type:"caching",description:"Enable response caching to reduce redundant API calls",estimatedSavings:i*.15,currentCost:i}),e}getRecords(){return[...this.records]}clear(){this.records=[]}reset(){this.records=[],this.alerts=[],this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}calculateCost(e,t,r){let i=q(e);if(!i)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let o=t/1e6*i.input,n=r/1e6*i.output;return{inputCost:o,outputCost:n,totalCost:o+n,currency:"USD"}}trimRecords(){this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}getPeriodStart(e){let t=new Date;switch(e){case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);case"30d":return new Date(t.getTime()-720*60*60*1e3);default:return new Date(0)}}filterByTime(e){return this.records.filter(t=>t.timestamp>=e)}checkAlerts(){for(let e of this.alerts){if(!e.active)continue;let t=this.getTotalCost(e.period);if(t>=e.threshold){e.active=!1;let r=this.getPeriodStart(e.period),i=this.filterByTime(r),o=i.reduce((n,a)=>n+a.inputTokens+a.outputTokens,0);try{e.callback({totalCost:t,totalTokens:o,totalRequests:i.length,avgCostPerRequest:i.length>0?t/i.length:0,avgCostPerToken:o>0?t/o:0})}catch(n){console.error("Budget alert callback error:",n)}}}}};function $(l){return new A(l)}de();ue();P();var D=class{cache=new Map;maxSize;ttlMs;constructor(e=100,t=6e4){this.maxSize=e,this.ttlMs=t}get(e){let t=this.cache.get(e);return t?Date.now()>t.expiresAt?(this.cache.delete(e),null):t.decision:null}set(e,t){if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(e,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{hits:0,misses:0,size:this.cache.size}}},T=class{config;providerManager;ruleEngine;decisionCache;metrics;routerMetrics;costMetrics;initialized=!1;constructor(e,t){this.providerManager=e,this.config={...Q,...t};let r=this.config.rules.length>0?this.config.rules:w;this.ruleEngine=new x(r),this.decisionCache=new D(100,this.config.decisionCacheTtlMs),this.metrics=new H,this.routerMetrics=U(),this.costMetrics=$()}async initialize(){this.initialized||(await this.providerManager.initialize(),this.initialized=!0)}getMode(){return this.config.mode}setMode(e){this.config.mode=e,this.decisionCache.clear()}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e},e.rules&&this.ruleEngine.setRules(e.rules),e.decisionCacheTtlMs&&(this.decisionCache=new D(100,e.decisionCacheTtlMs))}async selectProvider(e){await this.ensureInitialized();let t=Date.now(),r=this.config.cacheDecisions&&!e.strictModel;if(r){let o=this.generateCacheKey(e),n=this.decisionCache.get(o);if(n)return this.metrics.recordCacheHit(),this.routerMetrics.recordCacheHit(),n;this.metrics.recordCacheMiss(),this.routerMetrics.recordCacheMiss()}let i;if(e.strictModel)i=this.selectStrict(e);else switch(this.config.mode){case"manual":i=await this.selectManual(e);break;case"rule-based":i=await this.selectRuleBased(e);break;case"cost-optimized":i=await this.selectCostOptimized(e);break;case"performance-optimized":i=await this.selectPerformanceOptimized(e);break;default:i=await this.selectRuleBased(e)}if(i.metadata.decisionTimeMs=Date.now()-t,r){let o=this.generateCacheKey(e);this.decisionCache.set(o,i)}return this.metrics.recordDecision(i,this.config.mode),i}async chat(e){await this.ensureInitialized();let t=Y(),r=await this.selectProvider(e),i=e.agentType??"";if(O(i)&&(k(r.model)||k(r.providerModelId))){if(e.strictModel)throw f(`Strict model request for ${r.model} conflicts with the cyber verification pin for ${i}`,"MODEL_NOT_FOUND",{provider:r.providerType,model:r.model,retryable:!1});let n=r.model,a=r.providerModelId;r.model=I(i,r.model,X),r.providerModelId=I(i,r.providerModelId,z(r.providerType)),console.warn(`[aqe] ADR-093: ${i} pinned to ${r.model} (was ${n}/${a}); set AQE_CYBER_VERIFIED=true after Cyber Verification Program approval`)}return await this.executeWithFallback(e,r,t)}async*stream(e){await this.ensureInitialized();let t=await this.selectProvider(e),r=await this.chat(e),i=100;for(let o=0;o<r.content.length;o+=i){let n=o+i>=r.content.length;yield{type:n?"done":"content",delta:r.content.slice(o,o+i),accumulated:r.content.slice(0,o+i),done:n,tokenCount:Math.ceil((o+i)/4),model:r.model,provider:t.providerType,usage:n?r.usage:void 0}}}getMetrics(){return this.metrics.getMetrics()}getEnhancedMetrics(e){return this.routerMetrics.getMetrics(e)}getProviderMetrics(e){return this.routerMetrics.getMetricsByProvider(e)}getAgentMetrics(e){return this.routerMetrics.getMetricsByAgentType(e)}getCostByProvider(e){return this.costMetrics.getCostByProvider(e)}getCostByAgentType(e){return this.costMetrics.getCostByAgentType(e)}getCostByModel(e){return this.costMetrics.getCostByModel(e)}getTotalCost(e){return this.costMetrics.getTotalCost(e)}getCostTrend(e){return this.costMetrics.getCostTrend(e)}getAuditLog(e){return this.routerMetrics.getAuditLog(e)}getOptimizationSuggestions(){return this.costMetrics.getOptimizationSuggestions()}resetMetrics(){this.metrics.reset(),this.routerMetrics.resetMetrics(),this.costMetrics.reset()}clearCache(){this.decisionCache.clear()}selectStrict(e){if(!e.model?.trim())throw f("strictModel requires an explicit nonempty model","MODEL_NOT_FOUND",{retryable:!1});let t=e.preferredProvider??this.config.defaultProvider,r=this.providerManager.getProvider(t);if(!r)throw f(`Strict model provider ${t} is unavailable`,"PROVIDER_UNAVAILABLE",{provider:t,model:e.model,retryable:!1});return this.createDecision(r,t,e.model,"manual")}async selectManual(e){let t=e.preferredProvider??this.config.defaultProvider,r=e.model??this.config.defaultModel,i=this.providerManager.getProvider(t);return i?this.createDecision(i,t,r,"manual"):this.createFallbackDecision(e,"manual")}async selectRuleBased(e){let t=this.ruleEngine.evaluate(e);if(t){let{rule:o,rulesEvaluated:n}=t,a=o.action.provider,s=this.providerManager.getProvider(a);if(s){let c=this.createDecision(s,a,o.action.model,"rule-match",o);return c.metadata.rulesEvaluated=n,c}}let r=this.config.defaultProvider,i=this.providerManager.getProvider(r);return i?this.createDecision(i,r,this.config.defaultModel,"default"):this.createFallbackDecision(e,"rule-based")}async selectCostOptimized(e){let t=this.providerManager.getAvailableProviders();if(t.length===0)return this.createFallbackDecision(e,"cost-optimized");let r=1/0,i=t[0],o,n=[];for(let a of t){let s=this.providerManager.getProvider(a);if(!s)continue;let{input:c,output:d}=s.getCostPerToken(),u=this.estimateCostValue(e,c,d);n.push({provider:a,model:s.getConfig().model,reason:`Estimated cost: $${u.toFixed(6)}`,estimatedCost:u,excluded:!1}),u<r&&(r=u,i=a,o=s)}if(o){let a=o.getConfig(),s=this.createDecision(o,i,a.model,"cost-optimization");return s.metadata.estimatedCost=this.createCostEstimate(e,o),s.metadata.alternativesConsidered=n,s}return this.createFallbackDecision(e,"cost-optimized")}async selectPerformanceOptimized(e){let t=this.providerManager.getAvailableProviders(),r=this.providerManager.getMetrics();if(t.length===0)return this.createFallbackDecision(e,"performance-optimized");let i=1/0,o=t[0],n,a=[];for(let s of t){let c=this.providerManager.getProvider(s);if(!c)continue;let u=r[s]?.avgLatencyMs??1/0;a.push({provider:s,model:c.getConfig().model,reason:`Avg latency: ${u}ms`,estimatedLatencyMs:u,excluded:!1}),u<i&&(i=u,o=s,n=c)}if(n){let s=n.getConfig(),c=this.createDecision(n,o,s.model,"performance-optimization");return c.metadata.estimatedLatencyMs=i,c.metadata.alternativesConsidered=a,c}return this.createFallbackDecision(e,"performance-optimized")}async executeWithFallback(e,t,r){let{fallbackChain:i,fallbackBehavior:o}=this.config,n,a=0,s=[{provider:t.providerType,model:t.providerModelId}],c=this.config.defaultProvider;if(!e.strictModel&&c&&c!==t.providerType&&s.push({provider:c,model:this.config.defaultModel}),!e.strictModel){for(let p of i.entries)if(p.enabled&&p.provider!==t.providerType)for(let m of p.models)s.push({provider:p.provider,model:m})}let d=e.agentType??"";if(O(d))for(let p of s)k(p.model)&&(p.model=z(p.provider));let u=s;if(e.requiresTools){let p=s.filter(m=>S(m.model));if(p.length>0&&p.length<s.length){let m=s.filter(h=>!S(h.model)).map(h=>`${h.provider}:${h.model}`);console.warn(`[llm-router] requiresTools: skipping tool-less model(s) ${m.join(", ")}`),u=p}}this.providerManager.assertWithinBudget(e.messages,{model:u[0]?.model,maxTokens:e.maxTokens});for(let{provider:p,model:m}of u){if(a>=o.maxAttempts)break;let h=this.providerManager.getProvider(p);if(!h)continue;a++;let N=Date.now();try{let g=await h.generate(e.messages,{model:m,temperature:e.temperature,maxTokens:e.maxTokens,systemPrompt:e.systemPrompt,timeoutMs:e.timeoutMs,skipCache:e.skipCache,metadata:e.metadata});if(this.providerManager.recordResponseSpend(g,e.agentType),e.strictModel){if(g.provider!==p)throw f(`Strict model provider mismatch: expected ${p}, received ${g.provider}`,"PROVIDER_UNAVAILABLE",{provider:p,model:m,retryable:!1});if(!this.isSameModel(t.model,g.model))throw f(`Strict model mismatch: expected ${t.model}, received ${g.model}`,"MODEL_NOT_FOUND",{provider:p,model:m,retryable:!1})}let M=Date.now()-N;return this.metrics.recordSuccess(p),this.routerMetrics.recordRoutingDecision(t,M,{agentType:e.agentType,success:!0,tokenUsage:g.usage,cost:g.cost}),this.routerMetrics.recordProviderCall(p,m,M,g.usage.totalTokens,{inputTokens:g.usage.promptTokens,outputTokens:g.usage.completionTokens,success:!0,cost:g.cost.totalCost,agentType:e.agentType}),this.costMetrics.recordCostFromInfo(p,m,g.usage,g.cost,{agentType:e.agentType,requestId:g.requestId}),{content:g.content,model:g.model,providerModelId:g.model,provider:g.provider,usage:g.usage,cost:g.cost,latencyMs:g.latencyMs,finishReason:g.finishReason,cached:g.cached,requestId:g.requestId,routingDecision:t}}catch(g){n=G(g);let M=Date.now()-N;if(this.metrics.recordFailure(p),this.routerMetrics.recordProviderCall(p,m,M,0,{success:!1,agentType:e.agentType}),a<s.length){let j=s[a];j&&this.routerMetrics.recordFallback(p,j.provider,n.message,e.agentType)}let ce=W(g)&&!g.retryable;!e.strictModel&&!ce&&a<o.maxAttempts&&await this.delay(o.delayMs)}}throw f(`All providers failed after ${a} attempts: ${n?.message??"Unknown error"}`,"PROVIDER_UNAVAILABLE",{retryable:!1,cause:n})}isSameModel(e,t){if(e===t)return!0;try{return b(e)===b(t)}catch{return!1}}createDecision(e,t,r,i,o){let{canonicalModel:n,providerModelId:a}=this.resolveModelIds(r,t);return{provider:e,providerType:t,model:n,providerModelId:a,reason:i,matchedRule:o,confidence:i==="rule-match"?.95:.8,metadata:{decisionTimeMs:0,timestamp:new Date}}}resolveModelIds(e,t){let i={claude:"anthropic","claude-code":"anthropic",openai:"openai",ollama:"ollama",openrouter:"openrouter",gemini:"gemini","azure-openai":"azure",bedrock:"bedrock"}[t];if(!i)return{canonicalModel:e,providerModelId:e};try{let o=b(e),n=L(o,i);return{canonicalModel:o,providerModelId:n}}catch{try{if(J(e)){let n=L(e,i);return{canonicalModel:e,providerModelId:n}}}catch{}return{canonicalModel:e,providerModelId:e}}}createFallbackDecision(e,t){for(let i of this.config.fallbackChain.entries){if(!i.enabled||!["claude","openai","ollama"].includes(i.provider))continue;let n=this.providerManager.getProvider(i.provider);if(n)return this.createDecision(n,i.provider,i.models[0],"fallback")}let r=this.providerManager.getAvailableProviders();if(r.length>0){let i=r[0],o=this.providerManager.getProvider(i);return this.createDecision(o,i,o.getConfig().model,"fallback")}throw f(`No providers available for ${t} selection`,"PROVIDER_UNAVAILABLE",{retryable:!1})}generateCacheKey(e){return[this.config.mode,e.agentType??"default",e.complexity??"medium",e.requiresTools?"tools":"no-tools",e.preferredProvider??"any"].join(":")}estimateCostValue(e,t,r){let i=0;e.systemPrompt&&(i+=Math.ceil(e.systemPrompt.length/4));for(let n of e.messages)i+=Math.ceil(n.content.length/4);let o=e.maxTokens??1e3;return i*t+o*r}createCostEstimate(e,t){let{input:r,output:i}=t.getCostPerToken(),o=0;e.systemPrompt&&(o+=Math.ceil(e.systemPrompt.length/4));for(let s of e.messages)o+=Math.ceil(s.content.length/4);let n=e.maxTokens??1e3,a=o*r+n*i;return{inputTokens:o,outputTokens:n,totalCostUsd:a,inputCostPer1M:r*1e6,outputCostPer1M:i*1e6}}delay(e){return new Promise(t=>setTimeout(t,e))}async ensureInitialized(){this.initialized||await this.initialize()}},H=class{decisions=new Map;decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};totalDecisions=0;cacheHits=0;cacheMisses=0;totalRulesEvaluated=0;rulesMatched=0;fallbackCount=0;startTime=new Date;recordDecision(e,t){this.totalDecisions++,this.decisionsByMode[t]++,e.metadata.rulesEvaluated&&(this.totalRulesEvaluated+=e.metadata.rulesEvaluated),e.matchedRule&&this.rulesMatched++,e.reason==="fallback"&&this.fallbackCount++;let r=this.decisions.get(e.providerType);r||(r=this.createEmptyMetrics(e.providerType),this.decisions.set(e.providerType,r)),r.selectionCount++,e.reason==="rule-match"&&r.ruleMatchCount++,e.reason==="fallback"&&r.fallbackCount++}recordSuccess(e){let t=this.decisions.get(e);if(t){let r=t.successRate*t.selectionCount;t.successRate=(r+1)/t.selectionCount}}recordFailure(e){}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(){let e={};for(let[r,i]of this.decisions)e[r]={...i};let t=this.totalDecisions>0?this.rulesMatched/this.totalDecisions:0;return{byProvider:e,totalDecisions:this.totalDecisions,decisionsByMode:{...this.decisionsByMode},avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:this.totalDecisions>0?this.fallbackCount/this.totalDecisions:0,ruleMatchRate:t,estimatedCostSavings:0,ruleStats:{totalEvaluated:this.totalRulesEvaluated,matched:this.rulesMatched,avgRulesPerDecision:this.totalDecisions>0?this.totalRulesEvaluated/this.totalDecisions:0},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:this.startTime,end:new Date}}}reset(){this.decisions.clear(),this.decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0},this.totalDecisions=0,this.cacheHits=0,this.cacheMisses=0,this.totalRulesEvaluated=0,this.rulesMatched=0,this.fallbackCount=0,this.startTime=new Date}createEmptyMetrics(e){return{provider:e,selectionCount:0,ruleMatchCount:0,fallbackCount:0,avgDecisionTimeMs:0,successRate:1,avgLatencyMs:0,p95LatencyMs:0,p99LatencyMs:0,totalCost:0,totalTokens:0,circuitState:"closed"}}};le();var me=V("llm/router-service");function ae(l){let e={};for(let[i,o]of Object.entries(l.providers??{}))o?.defaultModel&&(e[i]=o.defaultModel);oe(l.agentOverrides,e);let t=se();if(t.length===0)return l;let r=l.rules.length>0?l.rules:w;return{...l,rules:[...t,...r]}}var ye=["ollama","onnx","gemini","openrouter","openai","claude","azure-openai","bedrock"];async function St(l={}){if(l.providerManager){let c=ae(B({projectRoot:l.projectRoot,override:l.override,env:l.env})),d=new T(l.providerManager,c);return await d.initialize(),{router:d,resolvedConfig:c,enabledProviders:he(c)}}if(!ee({projectRoot:l.projectRoot,env:l.env}))return null;let e=ae(B({projectRoot:l.projectRoot,override:l.override,env:l.env})),t=ve(e,l.env??process.env);if(t.length===0)return null;let r=new Set(t);for(let[c,d]of Object.entries(e.agentOverrides??{}))d.provider&&!r.has(d.provider)&&me.warn(`[llm-config] agentOverrides["${c}"] routes to provider "${d.provider}", which is not enabled (no API key detected and not enabled in .agentic-qe/llm-config.json). This override will not take effect until that provider is available.`);let{primary:i,fallbacks:o}=fe(e,t),n={primary:i,fallbacks:o,providers:Ce(e,t,l.allowProjectProviderEndpoints??!0),loadBalancing:"round-robin",global:{enableCostTracking:!0,enableMetrics:!0}},a=new K(n),s=new T(a,e);return await s.initialize(),{router:s,resolvedConfig:e,enabledProviders:t}}function ve(l,e=process.env){let t=Z(e),r=[],i=o=>{r.includes(o)||!l.providers?.[o]?.enabled||t.has(o)&&r.push(o)};i(l.defaultProvider);for(let o of l.fallbackChain?.entries??[])i(o.provider);for(let o of ye)i(o);for(let o of C)i(o);return r}function he(l){let e=new Set([l.defaultProvider]);for(let t of l.fallbackChain?.entries??[])e.add(t.provider);return Array.from(e)}function fe(l,e){if(e.length===0)throw new Error("pickPrimaryAndFallbacks: no enabled providers");let t=e.includes(l.defaultProvider)?l.defaultProvider:e[0],r=e.filter(i=>i!==t);return{primary:t,fallbacks:r}}function Ce(l,e,t=!0){let r={};for(let i of e){let o=l.providers?.[i];if(o){let n={...o};(i==="codex"||i==="claude-code")&&delete n.binaryPath,t||delete n.baseUrl,r[i]=n}}return r}export{St as a,ve as b,fe as c,Ce as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as u,h as d,p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{b as u,h as d,p}from"./chunk-6NBRMD25.js";var o={domain:"test-generation",bestPractices:["Follow Arrange-Act-Assert (AAA) pattern for clear test structure","One logical assertion per test - test one behavior at a time","Use descriptive test names: should_returnValue_when_condition","Mock external dependencies to isolate unit under test","Test edge cases and boundary conditions, not just happy paths","Keep tests deterministic - avoid time-dependent assertions","Use test data builders or factories for complex objects","Prefer integration tests for workflows, unit tests for logic","Maintain test independence - no shared mutable state between tests","Write failing test first (TDD Red) before implementation"],antiPatterns:[{name:"God Test",description:"A single test that verifies too many behaviors",reason:"Hard to diagnose failures, brittle, slow to run",alternative:"Split into focused tests, each verifying one behavior",detection:"expect.*expect.*expect.*expect.*expect"},{name:"Mystery Guest",description:"Test relies on external data files or state not visible in test",reason:"Tests are hard to understand and maintain",alternative:"Make test data explicit within the test or use fixtures"},{name:"Eager Test",description:"Test that verifies more than needed for the current behavior",reason:"Creates unnecessary coupling, breaks easily",alternative:"Only assert what is necessary for this specific test case"},{name:"Flaky Assertion",description:"Assertions that depend on timing, order, or external state",reason:"Creates unreliable test suite, erodes trust",alternative:"Use deterministic assertions, mock time/random",detection:"setTimeout|Date\\.now|Math\\.random"},{name:"Test Code Duplication",description:"Same setup or assertion code repeated across tests",reason:"Maintenance burden, inconsistency risk",alternative:"Extract to beforeEach, helpers, or fixtures"}],frameworkGuidance:{jest:["Use describe blocks to group related tests","Prefer toEqual for deep equality, toBe for primitives","Use jest.mock() at module level for consistent mocking","Use jest.spyOn for partial mocking of objects","Enable --coverage to track test coverage"],vitest:["Use vi.mock() for module mocking","Prefer vi.fn() over jest.fn() syntax","Use vitest/ui for interactive test debugging","Enable browser mode for component tests","Use inline snapshots for small expected values"],mocha:["Use beforeEach/afterEach for setup/teardown","Combine with chai for assertions","Use sinon for spies, stubs, and mocks","Set appropriate timeouts for async tests"],pytest:["Use fixtures for reusable test setup","Use parametrize for data-driven tests","Use conftest.py for shared fixtures","Use pytest.raises for exception testing","Use pytest-cov for coverage reporting"],junit:["Use @BeforeEach and @AfterEach for setup/teardown","Use @DisplayName for readable test names","Use @ParameterizedTest for data-driven tests","Use Mockito for mocking dependencies"],testng:["Use @BeforeMethod and @AfterMethod appropriately","Use @DataProvider for parameterized tests","Configure test groups for selective execution"],playwright:["Use page.locator() for resilient element selection","Use expect(locator) for auto-waiting assertions","Use page.waitForLoadState for navigation","Use test.describe for grouping tests","Use fixtures for reusable browser contexts"],cypress:["Use cy.intercept() for API mocking","Avoid conditional testing - use deterministic state","Use data-cy attributes for stable selectors","Use cy.within() for scoped queries","Prefer cy.contains() for text-based selection"],selenium:["Use explicit waits over implicit waits","Use Page Object Model for maintainability","Handle stale element references with retry logic","Clean up browser state between tests"]},languageGuidance:{typescript:["Use type assertions in tests for better IDE support","Create typed test fixtures and builders","Use satisfies operator for test data validation","Mock types with ts-mockito or typed mocking libs"],javascript:["Use JSDoc comments for test documentation","Consider TypeScript for larger test suites","Use ESLint with testing plugins"],python:["Use type hints in test functions","Use dataclasses for test data","Follow PEP 8 naming: test_should_do_something"],java:["Use AssertJ for fluent assertions","Use Lombok for test data classes","Follow naming: shouldDoSomething_whenCondition"],go:["Use table-driven tests for multiple cases","Use testify for assertions and mocking","Place tests in _test.go files"],rust:["Use #[test] attribute for test functions","Use assert!, assert_eq!, assert_ne! macros","Place unit tests in same file with #[cfg(test)]"],csharp:["Use xUnit or NUnit for testing","Use FluentAssertions for readable assertions","Use Moq for mocking interfaces"],kotlin:["Use kotest for BDD-style testing","Use MockK for Kotlin-first mocking","Use data classes for test fixtures"]},examples:[{title:"Unit Test Template (TypeScript + Vitest)",description:"Standard AAA pattern for unit tests",content:`describe('UserService', () => {
|
|
3
3
|
describe('createUser', () => {
|
|
4
4
|
it('should create user with valid data', async () => {
|
|
5
5
|
// Arrange
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
2
|
var l=["ECONNREFUSED","ETIMEOUT","ENOMEM","ENOSPC"];var s={successRate:.1,failureRate:1,viabilityThreshold:.3,rehabilitationThreshold:10,maxQuarantineDurationMs:6048e5,domainOverrides:{"security-compliance":{successRate:.05,failureRate:1,viabilityThreshold:.5},"test-generation":{successRate:.15,failureRate:1,viabilityThreshold:.2},"quality-assessment":{successRate:.1,failureRate:1,viabilityThreshold:.4}}},a=class{config;_witnessChain=null;set witnessChain(e){this._witnessChain=e}constructor(e={}){this.config={...s,...e,domainOverrides:{...s.domainOverrides,...e.domainOverrides}}}computeConfidenceUpdate(e,r,i){let{successRate:u,failureRate:o}=this.getConfigForDomain(i),n=r==="success"?u:-o;if(r==="failure")try{this._witnessChain?.append("HEBBIAN_PENALTY",{previousConfidence:e,delta:n,domain:i},"asymmetric-learning")}catch{}return c(e+n,0,1)}shouldQuarantine(e,r){let{viabilityThreshold:i}=this.getConfigForDomain(r);return{shouldQuarantine:e<i,confidence:e,viabilityThreshold:i,domain:r}}classifyFailure(e){if(e.infrastructureHealthy===!1||e.durationMs!==void 0&&e.durationMs>3e4)return"infrastructure";if(e.errorMessage){let r=e.errorMessage.toUpperCase();for(let i of l)if(r.includes(i))return"infrastructure"}return e.failureCategory==="infrastructure"?"infrastructure":(e.failureCategory==="pattern","pattern")}checkRehabilitation(e,r){let i=this.config.rehabilitationThreshold;return{canRehabilitate:e>=i,consecutiveSuccesses:e,requiredSuccesses:i,domain:r}}getConfigForDomain(e){return e&&this.config.domainOverrides?.[e]?this.config.domainOverrides[e]:{successRate:this.config.successRate,failureRate:this.config.failureRate,viabilityThreshold:this.config.viabilityThreshold}}getAsymmetryRatio(e){let{successRate:r,failureRate:i}=this.getConfigForDomain(e);return r===0?1/0:i/r}};function c(t,e,r){return t<e?e:t>r?r:t}export{a};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{a as V,c as Y,d as q,e as R,f as K,j as H}from"./chunk-KLTMOXIK.js";import{c as B,d as C}from"./chunk-EBTNMQSS.js";import{c as P,e as Te}from"./chunk-JUDUBQHA.js";import{c as z,d as $e}from"./chunk-SZAZQZWI.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
|
+
`&&(t[a]=" ")};for(;r<n;){let o=e[r];if(o==="/"&&e[r+1]==="/"){let a=e.indexOf(`
|
|
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
|
+
`),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(`
|
|
6
|
+
`);return t[t.length-1]===""&&t.pop(),t.length}function re(e,t=6){let n=g.resolve(e);try{if(!p.existsSync(n))return null;p.statSync(n).isDirectory()||(n=g.dirname(n))}catch{return null}for(let r=0;r<=t;r++){if(p.existsSync(g.join(n,"Cargo.toml")))return p.realpathSync(n);let s=g.dirname(n);if(s===n)break;n=s}return null}function se(e,t=0){if(t>4)return!1;let n;try{n=p.readdirSync(e,{withFileTypes:!0})}catch{return!1}for(let r of n)if(r.isFile()&&g.extname(r.name)===".rs")return!0;for(let r of n)if(r.isDirectory()&&!te.has(r.name)&&se(g.join(e,r.name),t+1))return!0;return!1}function vt(e){let t=re(e);if(t===null)return!1;let n=g.resolve(e);return n===t||se(n)}async function bt(e,t={}){if(Ae())return null;let n=t.timeoutMs??3e5,r=re(e);if(!r)return null;let s=await P("cargo",["llvm-cov","--version"],{cwd:r,timeout:3e4});if(s.error||s.status!==0)return null;let o=g.join(p.mkdtempSync(g.join(ee.tmpdir(),"aqe-rust-cov-")),"lcov.info");try{let i=await P("cargo",["llvm-cov","--lcov","--output-path",o],{cwd:r,timeout:n});if(i.error||i.status!==0||!p.existsSync(o))return null;let c=R(p.readFileSync(o,"utf-8")).files.filter(h=>!E(h.path,r));if(c.length===0)return null;let u=oe(c),f=c.some(h=>h.branches.total>0);return{data:u,provenance:{method:"cargo-llvm-cov",estimated:!1,branchDataCollected:f,functionDataCollected:c.some(h=>h.functions.total>0),notes:f?[]:["cargo-llvm-cov reported no branch data (Rust branch coverage requires a nightly toolchain with -Z coverage-options=branch). Branch coverage is reported as null rather than assumed."]}}}catch{return null}finally{try{p.rmSync(g.dirname(o),{recursive:!0,force:!0})}catch{}}}var Z={".rs":{fn:/\bfn\s+\w+/g,branch:/\b(if|match|while|for)\b|\?\?|\|\||&&/g},".go":{fn:/\bfunc\s+\w*/g,branch:/\b(if|switch|case|for|select)\b|\|\||&&/g},".py":{fn:/\b(def|lambda)\b/g,branch:/\b(if|elif|for|while|except)\b|\band\b|\bor\b/g},".java":{fn:/\b(public|private|protected|static)[\w<>,\s[\]]+\w+\s*\(/g,branch:/\b(if|switch|case|for|while|catch)\b|\|\||&&/g},".rb":{fn:/\bdef\s+\w+/g,branch:/\b(if|elsif|unless|case|when|while)\b|\|\||&&/g},default:{fn:/\bfunction\b|=>|\b\w+\s*\([^)]*\)\s*\{/g,branch:/\b(if|switch|case|for|while|catch)\b|\?\?|\|\||&&/g}};function Ie(e){return Z[e]??Z.default}function Q(e,t){return(e.match(new RegExp(t.source,t.flags))||[]).length}function oe(e){let t=o=>e.reduce((i,a)=>i+o(a),0),n=(o,i)=>i>0?Math.round(o/i*100):0,r=t(o=>o.lines.total),s=t(o=>o.lines.covered);return{files:e,summary:{line:n(s,r),branch:n(t(o=>o.branches.covered),t(o=>o.branches.total)),function:n(t(o=>o.functions.covered),t(o=>o.functions.total)),statement:n(s,r),files:e.length}}}function _(e){let t=[],n=e;function r(s,o){if(o>6)return;let i;try{i=p.readdirSync(s,{withFileTypes:!0})}catch{return}for(let a of i){let c=g.join(s,a.name);if(a.isDirectory()){if(te.has(a.name)||ne.has(a.name))continue;r(c,o+1)}else if(a.isFile()){if(!De.has(g.extname(a.name))||E(c,n))continue;t.push(c)}}}return r(e,0),t}function yt(e){if(!p.existsSync(e)||!p.statSync(e).isDirectory())return null;let t=_(e);if(t.length===0)return null;let n=t.map(r=>{let s="";try{s=C(r,{outsideRoot:"allow"})}catch{}let o=g.extname(r),i=Me(s),a=Ne(s,o),c=y=>a.some(([A,D])=>y>=A&&y<=D),u=a.reduce((y,[A,D])=>y+(D-A+1),0),f=Math.max(i-u,0),h=Ie(o),b=Q(s,h.fn),Ce=a.length>0,Se=Le(r),we=Ce||Se,Ee=Q(s,h.branch),je=Math.min(Ee*.005,.15),Re=Math.min(f*1e-4,.1),ke=Math.max(.05,Math.min(.95,we?.85-je-Re:.2)),T=Math.floor(f*ke),X=[];for(let y=1;y<=i;y++)c(y)||X.push(y);let Fe=X.slice(T);return{path:r,lines:{covered:T,total:f},branches:{covered:0,total:0},functions:{covered:0,total:b},statements:{covered:T,total:f},uncoveredLines:Fe,uncoveredBranches:[]}});return{data:oe(n),provenance:{method:"static-estimation",estimated:!0,branchDataCollected:!1,functionDataCollected:!1,notes:["No instrumentation ran. These numbers are a STATIC ESTIMATE derived from source shape (file size, declaration counts, presence of a test file) \u2014 they are not measured coverage and must not be reported as such.","Branch and function coverage were not collected and are reported as null."]}}}function Le(e){let t=g.extname(e),n=e.slice(0,-t.length);return[`${n}.test${t}`,`${n}.spec${t}`,`${n}_test${t}`,`${n}.test${t}`.replace("/src/","/tests/"),`${n}.spec${t}`.replace("/src/","/tests/"),`${n}${t}`.replace("/src/","/tests/")].some(s=>{try{return p.existsSync(s)}catch{return!1}})}import*as M from"fs";import*as m from"path";var I=["ts","mts","cts","js","mjs","cjs"],Oe=[...I.map(e=>`vitest.config.${e}`),...I.map(e=>`vite.config.${e}`)],We=[...I.map(e=>`jest.config.${e}`),"jest.config.json"],Ue=[".nycrc",".nycrc.json"],Je=[".c8rc",".c8rc.json"];function Ge(e){return e.replace(/[.+^$()|[\]\\]/g,"\\$&")}function ce(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==="*"&&e[n+1]==="*")e[n+2]==="/"?(t+="(?:.*/)?",n+=2):(t+=".*",n+=1);else if(r==="*")t+="[^/]*";else if(r==="?")t+="[^/]";else if(r==="{"){let s=e.indexOf("}",n);if(s===-1){t+="\\{";continue}t+=`(?:${e.slice(n+1,s).split(",").map(ce).join("|")})`,n=s}else t+=Ge(r)}return t}function ie(e){let t=e.replace(/^<rootDir>\//,"").replace(/^\.\//,"").replace(/\/+$/,"");return new RegExp(`^${ce(t)}(?:/.*)?$`)}function le(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'||r==="'"||r==="`"){let s=n;for(n++;n<e.length&&e[n]!==r;n++)e[n]==="\\"&&n++;t+=e.slice(s,n+1)}else if(r==="/"&&e[n+1]==="/"){for(;n<e.length&&e[n]!==`
|
|
7
|
+
`;)n++;t+=`
|
|
8
|
+
`}else if(r==="/"&&e[n+1]==="*"){let s=e.indexOf("*/",n+2);n=s===-1?e.length:s+1}else t+=r}return t}function ue(e,t){let n={"[":"]","{":"}","(":")"},r=[];for(let s=t;s<e.length;s++){let o=e[s];if(o==='"'||o==="'"||o==="`")for(s++;s<e.length&&e[s]!==o;s++)e[s]==="\\"&&s++;else if(n[o])r.push(n[o]);else if(o===r[r.length-1]&&(r.pop(),r.length===0))return s+1}return-1}function Xe(e){let t=[],n=0,r=0;for(let s=0;s<e.length;s++){let o=e[s];if(o==='"'||o==="'"||o==="`")for(s++;s<e.length&&e[s]!==o;s++)e[s]==="\\"&&s++;else"[{(".includes(o)?n++:"]})".includes(o)?n--:o===","&&n===0&&(t.push(e.slice(r,s)),r=s+1)}return t.push(e.slice(r)),t.map(s=>s.trim()).filter(s=>s.length>0)}var ae=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$|^`([^`$\\]*)`$/;function $(e,t){let n=new RegExp(`(?:^|[\\s,{])['"]?${t}['"]?\\s*:\\s*`).exec(e);if(!n)return;let r=n.index+n[0].length;if(e[r]==="'"||e[r]==='"'){let i=ae.exec(e.slice(r,ze(e,r)));return i?[i[2]??i[3]]:null}if(e[r]!=="[")return null;let s=ue(e,r);if(s===-1)return null;let o=[];for(let i of Xe(e.slice(r+1,s-1))){if(/^\.\.\.[\w$.]*defaults?\b/i.test(i))continue;let a=ae.exec(i);if(!a)return null;o.push(a[2]??a[3])}return o}function ze(e,t){let n=t+1;for(;n<e.length&&e[n]!==e[t];n++)e[n]==="\\"&&n++;return n+1}function L(e){try{return C(e,{outsideRoot:"allow"})}catch{return null}}function N(e){let t=L(e);if(t===null)return null;try{let n=JSON.parse(t);return typeof n=="object"&&n!==null?n:null}catch{return null}}var k=e=>e===void 0?void 0:typeof e=="string"?[e]:Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null;function S(e,t){let n=[t.include,t.exclude,t.collectFrom,t.ignore].every(o=>o!==null),r=t.collectFrom??[],s=[];for(let o of t.ignore??[])try{s.push(new RegExp(o))}catch{}return{source:e,readable:n,ignorePatterns:s,include:[...t.include??[],...r.filter(o=>!o.startsWith("!"))],exclude:[...t.exclude??[],...r.filter(o=>o.startsWith("!")).map(o=>o.slice(1))]}}function Be(e,t){let n=le(t),r=/(?:^|[\s,{])['"]?coverage['"]?\s*(?::\s*|(?=[,}]))/.exec(n);if(!r)return null;let s=r.index+r[0].length;if(!r[0].includes(":")||n[s]!=="{")return S(e,{include:null});let o=ue(n,s),i=o===-1?"":n.slice(s,o);return S(e,{include:$(i,"include"),exclude:$(i,"exclude")})}function Ve(e,t){let n=le(t),r=$(n,"collectCoverageFrom"),s=$(n,"coveragePathIgnorePatterns");return r===void 0&&s===void 0?null:S(e,{collectFrom:r,ignore:s})}function F(e,t){return!t||typeof t!="object"?null:"collectCoverageFrom"in t||"coveragePathIgnorePatterns"in t?S(e,{collectFrom:k(t.collectCoverageFrom),ignore:k(t.coveragePathIgnorePatterns)}):"include"in t||"exclude"in t?S(e,{include:k(t.include),exclude:k(t.exclude)}):null}function fe(e){for(let r of Oe){let s=L(m.join(e,r));if(s!==null){let o=Be(r,s);if(o)return o}}for(let r of We){let s=m.join(e,r);if(!M.existsSync(s))continue;let o=r.endsWith(".json")?F(r,N(s)??void 0):Ve(r,L(s)??"");if(o)return o}let t=N(m.join(e,"package.json")),n=F('package.json "jest"',t?.jest);if(n)return n;for(let[r,s]of[[Ue,"nyc"],[Je,"c8"]]){for(let i of r){let a=N(m.join(e,i)),c=F(i,a??void 0);if(c)return c;if(!a&&M.existsSync(m.join(e,i)))return S(i,{include:null})}let o=F(`package.json "${s}"`,t?.[s]);if(o)return o}return null}function ge(e,t,n){if(!e)return!0;let r=m.relative(n,t).split(m.sep).join("/");if(e.include.length>0&&!e.include.some(i=>ie(i).test(r))||e.exclude.some(i=>ie(i).test(r)))return!1;let s=t.split(m.sep).join("/"),o=n.split(m.sep).join("/");return!e.ignorePatterns.some(i=>i.test(s)||i.test(s.replace(o,"<rootDir>")))}var Ye=[[".ts",".tsx",".js",".jsx",".mjs",".cjs"],[".py"],[".go"],[".rs"],[".java"],[".rb"]];function pe(e){let t=v.extname(e).toLowerCase();return Ye.find(n=>n.includes(t))}function qe(e){let t=v.basename(e);return t.endsWith(".d.ts")||t.startsWith(".")||/\.config\.[cm]?[jt]sx?$/.test(t)}function j(e){try{return x.realpathSync(e)}catch{return v.resolve(e)}}function de(e,t){let n=j(t);return new Set(e.map(r=>v.isAbsolute(r.path)?j(r.path):j(v.resolve(n,r.path))))}function Ke(e,t,n){let r=!1;try{r=x.statSync(n).isDirectory()}catch{}if(!r)return{targetFiles:[],unmeasured:[]};let s=j(t),o=fe(s),i=new Set(e.map(u=>pe(u.path)).filter(Boolean)),a=de(e,t),c=_(n).filter(u=>i.has(pe(u))&&!qe(u)).map(j).filter(u=>ge(o,u,s));return{targetFiles:c,unmeasured:c.filter(u=>!a.has(u)).sort(),...o?{coverageScope:{source:o.source,readable:o.readable}}:{}}}function He(e,t){let n;try{n=x.statSync(e).mtimeMs}catch{return}let r=t.filter(s=>{try{return x.statSync(s).mtimeMs>n}catch{return!1}}).sort();return r.length>0?{reportPath:e,reportModified:new Date(n).toISOString(),newerFiles:r}:void 0}function he(e,t,n,r,s={}){let{targetFiles:o,unmeasured:i,coverageScope:a}=s.checkCompleteness===!1?{targetFiles:[],unmeasured:[],coverageScope:void 0}:Ke(e.files,n,r),c=new Set([...o,...de(t,n)]),u=s.reportPath?He(s.reportPath,[...c].filter(b=>x.existsSync(b))):void 0,f=s.excluded??[],h=[...new Set(f.flatMap(b=>b.file?[b.file]:[]))].sort();return{status:i.length>0||u||h.length>0?"insufficient-evidence":"complete",unmeasuredFiles:i,targetFiles:c.size+h.filter(b=>!c.has(b)).length,...u?{stale:u}:{},...a?{coverageScope:a}:{},...f.length>0?{excludedEntries:f}:{},...h.length>0?{conflictingFiles:h}:{}}}var w=5;function O(e,t){return e.slice(0,w).map(r=>v.relative(t,r)||r).join(", ")+(e.length>w?`, \u2026 ${e.length-w} more`:"")}function jt(e,t){if(!e)return[];let n=[],r=e.unmeasuredFiles.length;if(r>0){let o=e.coverageScope,i=o&&!o.readable?` The coverage include/exclude in ${o.source} could not be read statically, so files it leaves out may be listed here; write them as literal string arrays to have them honoured.`:"";n.push(`${r} of ${e.targetFiles} source files under the target are not in the coverage report (UNMEASURED, not counted as covered): ${O(e.unmeasuredFiles,t)}. Regenerate the report with coverage for the whole target, or exclude files that are not meant to be measured in the coverage tool's include/exclude config.${i}`)}let s=e.conflictingFiles??[];if(s.length>0&&n.push(`${s.length} source file${s.length===1?" is":"s are"} listed in the coverage report under two spellings (e.g. \`./src/a.ts\` and \`src/a.ts\`), so which entry is right is unknown; they are UNMEASURED and left out of the figures: ${O(s,t)}`),e.stale){let o=e.stale.newerFiles.length;n.push(`the coverage report ${v.relative(t,e.stale.reportPath)||e.stale.reportPath} is STALE: ${o} source file${o===1?" was":"s were"} modified after it was written (${e.stale.reportModified}): ${O(e.stale.newerFiles,t)}`)}return n}var Ze={"outside-project":"outside the project root","windows-path":"a Windows path, which cannot name a file here","duplicate-spelling":"a second spelling of a file the report already lists"};function Rt(e){let t=(e?.excludedEntries??[]).filter(s=>s.reason!=="duplicate-spelling");if(t.length===0)return[];let n=t.slice(0,w).map(s=>`${s.path} (${Ze[s.reason]})`),r=t.length>w?`, \u2026 ${t.length-w} more`:"";return[`${t.length} coverage report entr${t.length===1?"y is":"ies are"} not a project file and ${t.length===1?"is":"are"} left out of the figures: ${n.join(", ")}${r}.`]}import*as d from"fs";import*as ye from"os";import*as l from"path";$e();var Qe=["package.json","pyproject.toml","setup.py","setup.cfg","go.mod","Cargo.toml","pom.xml","build.gradle","build.gradle.kts",".git"],et=["vitest.config.ts","vitest.config.js","vitest.config.mts","vitest.config.mjs","vitest.config.cts","vitest.config.cjs","vitest.workspace.ts","vitest.workspace.js","vitest.workspace.mts","vitest.workspace.mjs","vitest.workspace.json","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs","jest.config.ts","jest.config.js","jest.config.mts","jest.config.mjs","jest.config.cts","jest.config.cjs","jest.config.json"];function me(e){return et.some(t=>d.existsSync(l.join(e,t)))?!0:G(e)?.jest!==void 0}function W(e){let t=G(e);if(!t)return null;let n={...t.devDependencies,...t.dependencies};return n.jest||n["@jest/core"]?"jest":n.mocha||n.nyc?"nyc":n.vitest?"vitest":null}function tt(e){try{return d.readdirSync(e).some(t=>/^\.(mocharc|nycrc)(\.|$)/.test(t))}catch{return!1}}function nt(e,t){if(tt(e))return(W(t)??"vitest")==="nyc";let n=W(e);return n===null||n===(W(t)??"vitest")}function G(e){try{let t=JSON.parse(C(l.join(e,"package.json"),{outsideRoot:"allow"}));return typeof t=="object"&&t!==null?t:null}catch{return null}}function xe(e){let t=[],n=!1,s=G(e)?.workspaces,o=Array.isArray(s)?s:typeof s=="object"&&s!==null&&Array.isArray(s.packages)?s.packages:null;s!=null&&typeof s=="object"&&(n=!0),o&&t.push(...o.filter(i=>typeof i=="string"));try{let i=C(l.join(e,"pnpm-workspace.yaml"),{outsideRoot:"allow"});n=!0;let a=!1;for(let c of i.split(/\r?\n/)){let u=c.replace(/\s+#.*$/,"").trimEnd();if(/^packages\s*:/.test(u)){a=!0;continue}if(a){let f=/^\s+-\s+(.+)$/.exec(u);f?t.push(f[1].trim().replace(/^['"]|['"]$/g,"")):/^\S/.test(u)&&(a=!1)}}}catch{}return n?t:null}function rt(e){let r=e.replace(/^\.\//,"").replace(/\/+$/,"").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*\//g,"\0").replace(/\*\*/g,"").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]").split("\0").join("(?:.*/)?").split("").join(".*");return new RegExp(`^${r}$`)}function st(e,t){let n=xe(e);if(!n)return!1;let r=l.relative(e,t).split(l.sep).join("/");if(r===""||r.startsWith("..")||l.isAbsolute(r))return!1;let s=!1;for(let o of n){let i=o.startsWith("!"),a=i?o.slice(1):o;l.isAbsolute(a)||/^[A-Za-z]:/.test(a)||a.split(/[\\/]/).includes("..")||rt(a).test(r)&&(s=!i)}return s}function J(e,t){let n=l.relative(t,e);return n===""||!n.startsWith("..")&&!l.isAbsolute(n)}function ot(e){try{return d.realpathSync(l.resolve(z(e)))}catch{return null}}function ve(e,t=12){let n;try{let a=l.resolve(e);if(!d.existsSync(a))return null;let c=d.realpathSync(a);n=d.statSync(c).isDirectory()?c:l.dirname(c)}catch{return null}let r=null;try{r=d.realpathSync(ye.homedir())}catch{r=null}let s=n,o=null,i=null;for(let a=0;a<=t;a++){if(r!==null&&n===r&&n!==s)return o;if(!o&&Qe.some(u=>d.existsSync(l.join(n,u)))){if(o=n,me(n)||!d.existsSync(l.join(n,"package.json")))return n}else if(o&&xe(n)!==null)return i??=ot(s)??"",i&&J(n,i)&&J(o,i)&&st(n,o)&&me(n)&&nt(o,n)?n:o;if(o&&d.existsSync(l.join(n,".git")))return o;let c=l.dirname(n);if(c===n)return o;n=c}return o}function _t(e,t){try{let n=d.realpathSync(t),r=d.realpathSync(l.resolve(e)),s=d.statSync(r).isDirectory()?r:l.dirname(r);for(;s!==n&&J(s,n);){if(d.existsSync(l.join(s,"package.json")))return`${l.relative(n,s).split(l.sep).join("/")}/`;let o=l.dirname(s);if(o===s)break;s=o}}catch{}return null}var it=new Set(["lcov.info","coverage-final.json","coverage-summary.json","coverage.xml","cobertura-coverage.xml","cobertura.xml"]);function at(e){let t=l.basename(e).toLowerCase();return it.has(t)||t.endsWith(".lcov")||t.endsWith(".lcov.info")}async function ct(e){let t;try{t=await B(e,{outsideRoot:"allow"})}catch{return null}if(t.trim().length===0)return null;try{let n=l.basename(e).toLowerCase(),r;if(n.endsWith(".json")){let s=JSON.parse(t);if(ut(s))r=q(t);else if(lt(s))r=Y(t);else return null}else n.endsWith(".xml")?r=K(t):r=R(t);return r.files.length>0?r:null}catch{return null}}function lt(e){let t=Object.values(e);return t.length>0&&t.every(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof n.s=="object"&&typeof n.statementMap=="object")}function ut(e){let t=e.total;return typeof t=="object"&&t!==null&&typeof t.lines=="object"}function ft(e,t){let n=l.relative(t,e);return n===""||!n.startsWith("..")&&!l.isAbsolute(n)}function U(e){try{return d.realpathSync(e)}catch{return l.resolve(e)}}function gt(e,t,n){let r=U(t),s=U(n);return s===r?[...e.files]:e.files.filter(o=>{let i=l.isAbsolute(o.path)?U(o.path):l.resolve(r,o.path);return ft(i,s)})}function be(e,t,n,r={}){if(r.numTotalTests===0)return{status:"no-data",reason:"no-tests-ran"};let s=gt(e,t,n),{keys:o,excluded:i}=H(s.map(f=>f.path),t),a=s.filter(f=>o.has(f.path));if(a.length===0)return{status:"no-data",reason:"target-not-covered"};let c=a.filter(f=>!E(f.path,t));if(c.length===0)return{status:"no-data",reason:"test-only-report"};let u=he(e,c,t,n,{reportPath:r.reportPath,checkCompleteness:r.checkCompleteness,excluded:i.filter(f=>!f.file||!E(f.file,t))});return{status:"measured",files:c,evidence:u}}async function Nt(e){let t=l.resolve(e),n;try{n=d.statSync(t)}catch{return{status:"target-missing",target:t}}if(n.isFile()&&at(t)){let o=l.dirname(t),i=ve(o)??(l.basename(o)==="coverage"?l.dirname(o):o),a=await ct(t),c=a?be(a,i,i,{reportPath:t,checkCompleteness:!1}):{status:"no-data",reason:"unreadable-report"};return{status:"evaluated",target:t,projectRoot:i,source:"report-file",evaluation:c}}let r=ve(t)??(n.isDirectory()?t:l.dirname(t)),s=await V(r);return s?{status:"evaluated",target:t,projectRoot:r,source:"project-report",evaluation:be(s.data,r,t,{reportPath:s.path})}:{status:"no-report",target:t,projectRoot:r}}function Mt(e,t,n){let r=[e.line];n.statement!==!1&&r.push(e.statement),n.branch&&r.push(e.branch),n.function&&r.push(e.function);let s=r.reduce((o,i)=>o+i,0)/r.length;return{overall:s,meetsThreshold:s>=t}}var pt=/^Coverage is [\d.]+% below threshold/i;function It(e,t,n,r){let s=e.filter(o=>!pt.test(o)&&(r.branch||!/branch coverage/i.test(o))&&(r.function||!/function coverage/i.test(o)));return t.meetsThreshold?s:[`Coverage is ${(n-t.overall).toFixed(1)}% below threshold. Focus on high-risk files first.`,...s]}function Lt(e){return e==="target-not-covered"||e==="no-tests-ran"}function Ot(e,t,n){switch(e){case"target-missing":return`Target does not exist: ${t}`;case"unreadable-report":return`Unreadable coverage report: ${t}. It could not be parsed or lists no files. Supported: lcov.info, istanbul coverage-final.json / coverage-summary.json, Cobertura XML. Raw V8 output is not supported \u2014 convert it with c8 or your runner's istanbul reporter.`;case"test-only-report":return"The coverage report contains only test files, so there is no production coverage to report. Coverage OF a test file is not a meaningful metric. Check that your coverage tool is instrumenting your source directory.";case"target-not-covered":return`Target is UNMEASURED: the coverage data for project ${n??"?"} has no entry for any production file under ${t}. This is not 0% coverage \u2014 no measurement exists for it. Check your coverage tool's include/exclude settings, or regenerate the report.`;case"no-tests-ran":return`Target is UNMEASURED: the test runner reported running 0 tests from ${n??"?"}. This is not 0% coverage.`}}export{Ae as a,re as b,vt as c,bt as d,yt as e,jt as f,Rt as g,_t as h,ct as i,gt as j,be as k,Nt as l,Mt as m,It as n,Lt as o,Ot as p};
|
|
@@ -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.
|
|
2
|
-
import{r as T,v as H}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{r as T,v as H}from"./chunk-T66PPF4D.js";import{a as C,b as M}from"./chunk-DKX4GNRU.js";import{i as b}from"./chunk-QFGYH6HD.js";H();M();import{createRequire as U}from"node:module";var O=U(import.meta.url),x=null;function w(){if(x)return x;let E=O("hnswlib-node");if(!E.HierarchicalNSW)throw new Error("hnswlib-node module missing HierarchicalNSW export");return x=E.HierarchicalNSW,x}function W(){return!0}var _=class{indexes;config;initialized;nextId;unifiedAdapters=null;useUnified;constructor(e={}){this.config={M:e.M||16,efConstruction:e.efConstruction||200,efSearch:e.efSearch||50,dimension:e.dimension||384,metric:e.metric||"cosine",quantization:e.quantization||"none"},this.indexes=new Map,this.initialized=new Set,this.nextId=new Map,this.useUnified=W(),this.useUnified&&(this.unifiedAdapters=new Map)}initializeIndex(e){if(this.initialized.has(e))return;if(this.useUnified&&this.unifiedAdapters)try{let n=new C(`embedding-${e}`,{dimensions:this.config.dimension,M:this.config.M,efConstruction:this.config.efConstruction,efSearch:this.config.efSearch,metric:this.config.metric==="dotproduct"?"cosine":this.config.metric});this.unifiedAdapters.set(e,n),this.initialized.add(e),this.nextId.set(e,0);return}catch(n){console.warn(`[HNSWEmbeddingIndex] Unified HNSW adapter unavailable for '${e}', using the legacy index (max 10000 entries): ${n instanceof Error?n.message:String(n)}`)}let t={cosine:"cosine",euclidean:"l2",dotproduct:"ip"}[this.config.metric]||"cosine",s=w(),r=new s(t,this.config.dimension);r.initIndex({maxElements:1e4,m:this.config.M,efConstruction:this.config.efConstruction}),this.indexes.set(e,r),this.initialized.add(e),this.nextId.set(e,0)}addEmbedding(e,i){let t=e.namespace;this.initialized.has(t)||this.initializeIndex(t);let s=i??this.nextId.get(t);i===void 0&&this.nextId.set(t,s+1);let r=this.unifiedAdapters?.get(t);if(r){let o=e.vector instanceof Float32Array?e.vector:new Float32Array(this.toFloatArray(e.vector));return r.add(s,o),s}let n=this.indexes.get(t),d=this.toFloatArray(e.vector);return n.addPoint(d,s),s}addEmbeddingsBatch(e){return e.map(i=>this.addEmbedding(i.embedding,i.id))}search(e,i={}){let t=i.namespace||e.namespace;if(!this.initialized.has(t))return[];let s=i.limit||10,r=this.unifiedAdapters?.get(t);if(r){let l=e.vector instanceof Float32Array?e.vector:new Float32Array(this.toFloatArray(e.vector));return r.search(l,s).map(u=>({id:u.id,distance:1-u.score}))}let n=this.indexes.get(t),d=this.toFloatArray(e.vector),o=n.searchKnn(d,s);return o.neighbors.map((l,m)=>({id:l,distance:o.distances[m]}))}getIndexStats(e){if(!this.initialized.has(e))return null;let i=this.unifiedAdapters?.get(e);return i?{size:i.size(),maxElements:1e4,dimension:i.dimensions(),metric:this.config.metric}:{size:this.indexes.get(e).getCurrentCount(),maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}}async saveIndex(e,i){if(!this.initialized.has(e))throw new Error(`Namespace ${e} not initialized`);if(this.unifiedAdapters?.has(e)){console.warn(`[HNSWEmbeddingIndex] saveIndex() is a no-op for namespace '${e}' \u2014 unified HnswAdapter manages persistence internally.`);return}await this.indexes.get(e).writeIndex(i)}async loadIndex(e,i){if(this.useUnified){console.warn(`[HNSWEmbeddingIndex] loadIndex() is a no-op for namespace '${e}' \u2014 unified HnswAdapter manages persistence internally. Initialize via initializeIndex() instead.`);return}let s={cosine:"cosine",euclidean:"l2",dotproduct:"ip"}[this.config.metric]||"cosine",r=w(),n=new r(s,this.config.dimension);await n.readIndex(i),this.indexes.set(e,n),this.initialized.add(e)}clearIndex(e){if(this.initialized.has(e)){let i=this.unifiedAdapters?.get(e);i&&(i.clear?.(),this.unifiedAdapters.delete(e)),this.indexes.delete(e),this.initialized.delete(e),this.nextId.delete(e)}}clearAll(){if(this.unifiedAdapters){for(let e of this.unifiedAdapters.values())e.clear?.();this.unifiedAdapters.clear()}this.indexes.clear(),this.initialized.clear(),this.nextId.clear()}resizeIndex(e,i){this.initialized.has(e)&&(this.clearIndex(e),this.initializeIndex(e))}setEfSearch(e){this.config.efSearch=e}toFloatArray(e){if(Array.isArray(e))return e;if(e instanceof Float32Array)return Array.from(e);if(e instanceof Int8Array){let i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]/128;return i}if(e instanceof Uint8Array){let i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=(e[t]-128)/128;return i}throw new Error(`Unsupported vector type: ${typeof e}`)}getConfig(){return{...this.config}}isInitialized(e){return this.initialized.has(e)}getInitializedNamespaces(){return Array.from(this.initialized)}getSize(e){if(!this.initialized.has(e))return 0;let i=this.unifiedAdapters?.get(e);return i?i.size():this.nextId.get(e)||0}};var q={mergeSimilarityThreshold:.85,maxMergesPerRun:50,softThreshold:400,hardThreshold:2e3,archiveMinAgeDays:30,archiveQualityThreshold:.15,mergeQualityBoost:.02,contradictionSimilarityThreshold:.85,contradictionQualityDelta:.4},R=class{config;db=null;initialized=!1;constructor(e={}){this.config={...q,...e}}async initialize(e){if(!this.initialized){if(e)this.db=e;else{let i=T();await i.initialize(),this.db=i.getDatabase()}this.initialized=!0}}async consolidateAll(e){this.ensureInitialized();let i={merged:0,contradicted:0,qualityUpdated:0,archived:0,hardDeleted:0,activeRemaining:0,domainsProcessed:[]},t=this.db.prepare("SELECT domain, COUNT(*) as cnt FROM captured_experiences WHERE consolidated_into IS NULL GROUP BY domain").all(),s=e?t.filter(n=>e.includes(n.domain)):t.filter(n=>n.cnt>this.config.softThreshold);for(let{domain:n,cnt:d}of s){let o=await this.consolidateDomain(n,d);i.merged+=o.merged,i.contradicted+=o.contradicted,i.qualityUpdated+=o.qualityUpdated,i.archived+=o.archived,i.hardDeleted+=o.hardDeleted,i.domainsProcessed.push(n)}let r=this.db.prepare("SELECT COUNT(*) as cnt FROM captured_experiences WHERE consolidated_into IS NULL").get();return i.activeRemaining=r.cnt,(i.merged>0||i.archived>0||i.contradicted>0)&&console.log(`[ExperienceConsolidator] Consolidated: ${i.merged} merged, ${i.contradicted} contradicted, ${i.archived} archived, ${i.activeRemaining} active`),i}async consolidateDomain(e,i){this.ensureInitialized();let t={merged:0,contradicted:0,qualityUpdated:0,archived:0,hardDeleted:0,activeRemaining:0,domainsProcessed:[e]},s=await this.clusterAndMerge(e);t.merged=s.merged,t.contradicted=s.contradicted,t.qualityUpdated=this.reinforceQuality(e),t.archived=this.archiveValueless(e);let r=this.db.prepare("SELECT COUNT(*) as cnt FROM captured_experiences WHERE domain = ? AND consolidated_into IS NULL").get(e).cnt,n=0;return r>this.config.hardThreshold&&(n=this.hardDeleteExcess(e,r),t.archived+=n),t.activeRemaining=r-n,t}async bootstrapDomain(e){if(this.ensureInitialized(),this.db.prepare("SELECT value FROM kv_store WHERE key = ?").get(`consolidation_bootstrap_${e}`))return console.log(`[ExperienceConsolidator] Domain ${e} already bootstrapped`),{merged:0,contradicted:0,qualityUpdated:0,archived:0,hardDeleted:0,activeRemaining:0,domainsProcessed:[e]};let t={...this.config};this.config.mergeSimilarityThreshold=.8,this.config.maxMergesPerRun=200;let s=await this.consolidateDomain(e);Object.assign(this.config,t);try{this.db.prepare("INSERT OR REPLACE INTO kv_store (key, value, namespace) VALUES (?, ?, 'system')").run(`consolidation_bootstrap_${e}`,new Date().toISOString())}catch{}return console.log(`[ExperienceConsolidator] Bootstrap ${e}: ${s.merged} merged, ${s.archived} archived`),s}async clusterAndMerge(e){let i=this.db.prepare(`
|
|
3
3
|
SELECT id, task, domain, quality, success, application_count,
|
|
4
4
|
consolidation_count, reuse_success_count, reuse_failure_count,
|
|
5
5
|
embedding, embedding_dimension, started_at
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
2
|
var r="insufficient-evidence";function s(t,n){let e=n&&typeof n=="object"?n:null;return e&&(e.status===r||e.evidenceStatus===r)?!1:t==="coverage-analysis"?e?.measured===!0:!0}export{s as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as y}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{a as y}from"./chunk-K3XBQC3R.js";import{a as g,c as h}from"./chunk-C4KLXFJP.js";import{S as b,b as p}from"./chunk-6YVMX2TC.js";b();var m=class{calculator;constructor(){this.calculator=new h}computeLambda(t){let n=this.maybeSparsify(t),e=this.toSwarmGraph(n);return this.calculator.getMinCutValue(e)}computeRoutingTier(t,n){let e=this.buildTaskGraphFromTopology(n),o=this.toSwarmGraph(e),s=this.calculator.getMinCutValue(o),r=Math.max(n.length-1,1),a=Math.min(s/r,1),{tier:i,label:d}=this.lambdaToTier(a),c=this.computeConfidence(o,a),l=this.buildRationale(t,a,i,n.length);return{tier:i,label:d,lambda:s,normalizedLambda:a,confidence:c,rationale:l}}getStructuralHealth(t){let n=this.maybeSparsify(t),e=this.toSwarmGraph(n);if(e.isEmpty())return this.emptyHealthReport();let o=this.calculator.getMinCutValue(e),s=e.getStats(),r=Math.max(s.vertexCount-1,1),a=Math.min(o/r,1),i=this.calculator.findWeakVertices(e),d=i.map(f=>f.vertexId),c=1-a,l=a>=.4,u=this.generateHealthSuggestions(a,i.length,s);return{lambda:o,normalizedLambda:a,healthy:l,weakPoints:d,riskScore:c,componentCount:s.componentCount,isConnected:s.isConnected,suggestions:u,analyzedAt:new Date}}maybeSparsify(t){if(!p().useSpectralSparsification||t.edges.length<=100)return t;let n=new Map;t.nodes.forEach((i,d)=>n.set(i.id,d));let e=[];for(let i of t.edges){let d=n.get(i.source),c=n.get(i.target);d!==void 0&&c!==void 0&&e.push([d,c,i.weight])}let o={nodeCount:t.nodes.length,edges:e},r=new y({epsilon:.3}).sparsify(o),a=[];for(let[i,d,c]of r.edges){let l=t.nodes[i],u=t.nodes[d];l&&u&&a.push({source:l.id,target:u.id,weight:c,edgeType:"coordination"})}return{nodes:t.nodes,edges:a}}toSwarmGraph(t){let n=new g;for(let e of t.nodes){let o={id:e.id,type:e.type==="task"||e.type==="agent"?"agent":"domain",domain:e.domain,weight:e.weight,createdAt:new Date,metadata:e.metadata};n.addVertex(o)}for(let e of t.edges)if(n.hasVertex(e.source)&&n.hasVertex(e.target)){let o={source:e.source,target:e.target,weight:e.weight,type:e.edgeType==="dependency"?"dependency":e.edgeType==="communication"?"communication":e.edgeType==="workflow"?"workflow":"coordination",bidirectional:e.edgeType!=="dependency"};n.addEdge(o)}return n}buildTaskGraphFromTopology(t){let n=t.map(r=>({id:r.id,label:r.name,type:"agent",domain:r.domain,weight:r.weight})),e=[],o=new Set(t.map(r=>r.id));for(let r of t)for(let a of r.dependsOn)o.has(a)&&e.push({source:r.id,target:a,weight:1,edgeType:"dependency"});let s=new Map;for(let r of t){let a=s.get(r.domain)||[];a.push(r.id),s.set(r.domain,a)}for(let[,r]of s)for(let a=0;a<r.length;a++)for(let i=a+1;i<r.length;i++)e.push({source:r[a],target:r[i],weight:.5,edgeType:"coordination"});return{nodes:n,edges:e}}lambdaToTier(t){return t>=.8?{tier:1,label:"Haiku"}:t>=.4?{tier:2,label:"Sonnet"}:{tier:3,label:"Opus"}}computeConfidence(t,n){let e=t.getStats();if(e.vertexCount<3)return .4;let o=Math.min(Math.abs(n-.4),Math.abs(n-.8)),s=Math.min(.95,.5+o*2.25),r=Math.min(1,e.density*2);return Math.min(.99,s*(.7+.3*r))}buildRationale(t,n,e,o){let s=t.slice(0,80),r=n>=.8?"highly connected":n>=.4?"moderately connected":"fragmented";return`Task "${s}" routed to ${e===1?"Haiku":e===2?"Sonnet":"Opus"} (Tier ${e}). Fleet topology is ${r} (lambda=${n.toFixed(3)}) across ${o} agents.`}generateHealthSuggestions(t,n,e){let o=[];return e.isConnected||o.push(`Graph has ${e.componentCount} disconnected components. Add cross-domain coordination edges to improve connectivity.`),t<.2?o.push("Critical: Fleet connectivity is very low. Consider spawning coordination agents."):t<.4&&o.push("Warning: Fleet connectivity is below healthy threshold. Reinforce weak connections."),n>0&&o.push(`${n} weak point(s) detected. Add redundant connections to these agents.`),e.vertexCount<3&&o.push("Fleet has fewer than 3 agents. MinCut analysis is most useful with larger topologies."),o}emptyHealthReport(){return{lambda:0,normalizedLambda:0,healthy:!1,weakPoints:[],riskScore:1,componentCount:0,isConnected:!0,suggestions:["No agents in fleet. Spawn agents to build a topology."],analyzedAt:new Date}}};function C(){return new m}export{C as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-MPFPWJTH.js";import{b as O}from"./chunk-XH4JMX5O.js";import*as c from"fs";import*as j from"os";import*as t from"path";function k(){o=null,f=null}function v(n){let e=m(n);return R.has(e)||(R.add(e),console.error(`[AQE] No project marker found and "${n}" is a shared temp/system directory; using the private scratch root "${e}" instead of creating a shared .agentic-qe store there. Set AQE_PROJECT_ROOT to choose a root.`)),e}function T(...n){return t.join(x(),".agentic-qe",...n)}function _(n,e){let s=t.relative(e,n);return s===""||!s.startsWith("..")&&!t.isAbsolute(s)}function x(n=process.cwd()){if(process.env.AQE_PROJECT_ROOT)return process.env.AQE_PROJECT_ROOT;let e=t.resolve(n);if(o&&f===e)return o;f=e;let s=t.parse(e).root,l=null;try{l=t.resolve(j.homedir())}catch{l=null}let r=e,a=null,i=null,h=null;for(;r!==s&&!g(r);){let p=c.existsSync(t.join(r,".git")),y=!p&&d(r),P=r===l&&r!==e&&!_(e,t.join(r,".agentic-qe"));i===null&&!P&&!y&&c.existsSync(t.join(r,".agentic-qe"))&&a===null&&(a=r),p&&i===null&&(i=r),c.existsSync(t.join(r,"package.json"))&&(h=r),r=t.dirname(r)}return a?o=a:i?o=i:h?o=h:u(e)?o=v(e):o=e,o}var o,f,R,A=O(()=>{S();S();o=null,f=null;R=new Set});export{k as a,T as b,x as c,A as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as h,d as v,f as T}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{b as h,d as v,f as T}from"./chunk-XH4JMX5O.js";var y={};v(y,{DotProductAttention:()=>z,FlashAttention:()=>k,HyperbolicAttention:()=>C,LinearAttention:()=>j,MoEAttention:()=>W,MultiHeadAttention:()=>F,RuvectorLayer:()=>I,SonaEngine:()=>K,TensorCompress:()=>E,default:()=>_,differentiableSearch:()=>L,getCompressionLevel:()=>B,hierarchicalForward:()=>V,init:()=>D,pipeline:()=>q});import{createRequire as A}from"module";var O,g,_,I,E,L,V,B,D,k,z,F,C,j,W,K,q,R=h(()=>{O=A(import.meta.url),g=O("@ruvector/rvf-node"),_=g,{RuvectorLayer:I,TensorCompress:E,differentiableSearch:L,hierarchicalForward:V,getCompressionLevel:B,init:D,FlashAttention:k,DotProductAttention:z,MultiHeadAttention:F,HyperbolicAttention:C,LinearAttention:j,MoEAttention:W,SonaEngine:K,pipeline:q}=g||{}});var Z={};v(Z,{createRvfStore:()=>$,isRvfNativeAvailable:()=>X,openRvfStore:()=>G,openRvfStoreReadonly:()=>U});import{readFileSync as J,writeFileSync as H,copyFileSync as Q,existsSync as Y}from"fs";function c(){if(S)return m;S=!0;try{let s=(R(),T(y));!s.RvfDatabase&&s.default&&s.default.RvfDatabase&&(s=s.default),m=s}catch{m=null}return m}function w(s){return`${s}.idmap.json`}function N(s){let e=w(s),t=new Map,n=new Map,i=1;if(Y(e))try{let r=JSON.parse(J(e,"utf-8"));i=r.nextLabel;for(let[a,p]of r.entries)t.set(a,p),n.set(p,a)}catch{}return{strToNum:t,numToStr:n,nextLabel:i}}function b(s,e,t){let n={nextLabel:t,entries:Array.from(e.entries())};H(w(s),JSON.stringify(n),"utf-8")}function $(s,e){let t=c();if(!t)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let n=t.RvfDatabase.create(s,{dimension:e}),i=n.dimension();return new d(n,s,i,new Map,new Map,1)}function G(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.open(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function U(s){let e=c();if(!e)throw new Error("@ruvector/rvf-node is not available \u2014 install the package or check platform compatibility");let t=e.RvfDatabase.openReadonly(s),n=t.dimension(),{strToNum:i,numToStr:r,nextLabel:a}=N(s);return new d(t,s,n,i,r,a)}function X(){return process.env.AQE_MEMORY_BACKEND==="memory"?!1:c()!==null}var m,S,d,P=h(()=>{m=null,S=!1;d=class s{db;_path;_dimension;strToNum;numToStr;nextLabel;_open;constructor(e,t,n,i,r,a){this.db=e,this._path=t,this._dimension=n,this.strToNum=i,this.numToStr=r,this.nextLabel=a,this._open=!0}ingest(e){if(this.ensureOpen(),e.length===0)return{accepted:0,rejected:0};let t=this._dimension,n=new Float32Array(e.length*t),i=[],r=[];for(let o=0;o<e.length;o++){let{id:u,vector:f,metadata:x}=e[o],l=this.strToNum.get(u);l===void 0&&(l=this.nextLabel++,this.strToNum.set(u,l),this.numToStr.set(l,u)),i.push(l),r.push(x);let M=f instanceof Float32Array?f:new Float32Array(f);n.set(M.subarray(0,t),o*t)}let a;if(r.some(o=>o!==void 0)&&typeof this.db.ingestBatchWithMetadata=="function"){let o=r.map(u=>u?JSON.stringify(u):"");a=this.db.ingestBatchWithMetadata(n,i,o)}else a=this.db.ingestBatch(n,i);return this.persistIdMap(),{accepted:a.accepted,rejected:a.rejected}}has(e){return this.ensureOpen(),this.strToNum.has(e)}search(e,t){this.ensureOpen();let n=e instanceof Float32Array?e:new Float32Array(e);return this.db.query(n,t).map(r=>{let a=this.numToStr.get(r.id);return a===void 0?null:{id:a,distance:r.distance,score:1/(1+r.distance)}}).filter(r=>r!==null)}delete(e){this.ensureOpen();let t=[];for(let i of e){let r=this.strToNum.get(i);r!==void 0&&t.push(r)}if(t.length===0)return 0;let n=this.db.delete(t);for(let i of e){let r=this.strToNum.get(i);r!==void 0&&(this.strToNum.delete(i),this.numToStr.delete(r))}return this.persistIdMap(),n.deleted}fork(e){this.ensureOpen(),Q(this._path,e);let t=new Map(this.strToNum),n=new Map(this.numToStr);b(e,t,this.nextLabel);let r=c().RvfDatabase.open(e);return new s(r,e,this._dimension,t,n,this.nextLabel)}status(){this.ensureOpen();let e=this.db.status(),n=this.db.segments().filter(i=>i.segType==="witness");return{totalVectors:e.totalVectors,totalSegments:e.totalSegments,fileSizeBytes:e.fileSize,epoch:e.currentEpoch,witnessValid:n.length>0,witnessEntries:n.length,deadSpaceRatio:typeof e.deadSpaceRatio=="number"?e.deadSpaceRatio:0}}dimension(){return this._dimension}size(){return this.ensureOpen(),this.db.status().totalVectors}compact(){this.ensureOpen();try{let e=this.db.compact();return e&&typeof e=="object"?{segmentsCompacted:typeof e.segmentsCompacted=="number"?e.segmentsCompacted:0,bytesReclaimed:typeof e.bytesReclaimed=="number"?e.bytesReclaimed:0,epoch:typeof e.epoch=="number"?e.epoch:0}:{segmentsCompacted:0,bytesReclaimed:0,epoch:0}}catch{return null}}close(){this._open&&(this.db.close(),this._open=!1)}isOpen(){return this._open}path(){return this._path}embedKernel(e){return this.ensureOpen(),this.db.embedKernel(0,99,0,e,0,"")}extractKernel(){return this.ensureOpen(),this.db.extractKernel()}verifyWitness(){this.ensureOpen();let e=this.tryNative("verifyWitness");return e?{valid:e.valid??!0,totalEntries:e.totalEntries??0,errors:Array.isArray(e.errors)?e.errors:[]}:{valid:!0,totalEntries:0,errors:[]}}sign(e){this.ensureOpen();let t=this.tryNative("sign",e);return typeof t=="string"?t:null}fileId(){this.ensureOpen();let e=this.tryNative("fileId");return typeof e=="string"?e:null}parentId(){this.ensureOpen();let e=this.tryNative("parentId");return typeof e=="string"?e:null}lineageDepth(){this.ensureOpen();let e=this.tryNative("lineageDepth");return typeof e=="number"?e:0}indexStats(){let e=this.status();return{totalVectors:e.totalVectors,dimension:this._dimension,totalSegments:e.totalSegments,fileSizeBytes:e.fileSizeBytes,epoch:e.epoch,witnessValid:e.witnessValid,witnessEntries:e.witnessEntries,idMapSize:this.strToNum.size}}freeze(){this.ensureOpen();let e=this.tryNative("freeze");return typeof e=="number"?e:0}derive(e){this.ensureOpen();let t=c();if(typeof this.db.derive=="function")try{let n=this.db.derive(e),i=new Map(this.strToNum),r=new Map(this.numToStr);return b(e,i,this.nextLabel),new s(n,e,this._dimension,i,r,this.nextLabel)}catch{}return this.fork(e)}ensureOpen(){if(!this._open)throw new Error("RVF database is closed")}tryNative(e,...t){if(typeof this.db[e]!="function")return null;try{return this.db[e](...t)}catch{return null}}persistIdMap(){b(this._path,this.strToNum,this.nextLabel)}}});export{$ as a,G as b,U as c,X as d,Z as e,P as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{d as W,f as lt}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{d as W,f as lt}from"./chunk-337Z52QM.js";import{b as I,d as _e}from"./chunk-XWIAZG3C.js";import{a as K,b as $,c as V,d as he,e as pt}from"./chunk-5G4UFTV4.js";import{a as Y,c as gt}from"./chunk-DEKR3CTS.js";import{a as fe,d as x,e as Ne,f as Se}from"./chunk-4X3SWKBA.js";import{a as U,b as me,e as ut}from"./chunk-GCHYOPRZ.js";import{a as Re,c as Le,d as _t}from"./chunk-G242G224.js";import{a as Tt}from"./chunk-3HVFIITW.js";import{c as ge}from"./chunk-BQ47GQPK.js";import{a as z,c as X,d as Et}from"./chunk-SZAZQZWI.js";import{d as pe,e as dt}from"./chunk-FOOW4JVS.js";import{a as A,e as le}from"./chunk-HL2ANKN3.js";import{b as R,d as ct}from"./chunk-XH4JMX5O.js";import{createHash as Oe}from"node:crypto";function ft(n){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(n)),e}function Nt(n){return typeof n=="string"?Buffer.from(n,"utf8"):n instanceof Uint8Array?Buffer.from(n):Buffer.from(Q(n),"utf8")}function Q(n){return n===null||typeof n!="object"?JSON.stringify(n)??"null":Array.isArray(n)?`[${n.map(Q).join(",")}]`:`{${Object.keys(n).sort().map(t=>`${JSON.stringify(t)}:${Q(n[t])}`).join(",")}}`}function Ae(...n){let e=Oe("sha256");for(let t of n)e.update(t);return e.digest()}function Ce(n,e,t){return Ae(mt,n,e,ft(t))}var mt,Ie,v,ve=R(()=>{"use strict";mt=Buffer.from("ruvector:chain:"),Ie=Oe("sha256").update("ruvector-proof-gate-v1").digest();v=class n{seq=0;prev=Ie;chain=[];payloadHashes=[];admit(e){let t=Ae(Nt(e)),s=Ce(this.prev,t,this.seq);this.prev=s,this.chain.push(s),this.payloadHashes.push(t);let r={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:s.toString("hex")};return this.seq+=1,r}verifyReceipt(e){return e.sequence>=0&&e.sequence<this.chain.length&&this.chain[e.sequence].toString("hex")===e.chainCommitment}chainRoot(){return this.prev.toString("hex")}get length(){return this.seq}get isEmpty(){return this.seq===0}verifyIntegrity(){if(this.chain.length!==this.payloadHashes.length)return!1;let e=Ie;for(let t=0;t<this.chain.length;t++){if(!Ce(e,this.payloadHashes[t],t).equals(this.chain[t]))return!1;e=this.chain[t]}return e.equals(this.prev)}toJSON(){return{seq:this.seq,head:this.prev.toString("hex"),chain:this.chain.map(e=>e.toString("hex")),payloadHashes:this.payloadHashes.map(e=>e.toString("hex"))}}static fromJSON(e){let t=new n;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let s of e.chain)t.chain.push(Buffer.from(s,"hex"));for(let s of e.payloadHashes)t.payloadHashes.push(Buffer.from(s,"hex"));return t}}});function b(n){if(!J.has(n))throw new Error(`Invalid table name: "${n}" is not in the allowlist`);return n}function Ft(n){let e=n.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${n}" has too many parts (max: schema.table)`);for(let t of e)if(!be.test(t))throw new Error(`Invalid SQL identifier: "${n}" \u2014 part "${t}" does not match pattern ${be}`);return n}var J,be,Z=R(()=>{"use strict";J=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","learning_evidence_manifests","learning_evidence_segments","learning_segment_edges","learning_evidence_admissions","pattern_manifest_lineage","pattern_segment_lineage","qe_agent_co_execution"]);be=/^[a-z_][a-z0-9_]{0,62}$/});function ye(n){n.exec(De),n.exec(`
|
|
3
3
|
INSERT OR IGNORE INTO learning_evidence_manifests (
|
|
4
4
|
id, trajectory_id, trajectory_hash, manifest_hash, task_family,
|
|
5
5
|
outcome, oracle_refs_json, source_kind, process_signals_json
|
|
@@ -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.
|
|
2
|
-
import{a as O,b as j}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{a as O,b as j}from"./chunk-73PBAWAF.js";import{d as A,e as G}from"./chunk-JUDUBQHA.js";import{e as T,f as N,j as R,k as I,q as J}from"./chunk-CBK5CT6T.js";import{b as S,e as z}from"./chunk-HL2ANKN3.js";import{b as g}from"./chunk-XH4JMX5O.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 => ({
|