agentic-qe 3.15.14 → 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/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +46 -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-P3IY7XEE.js → agent-handler-MOX6PSIQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-WWKC2H3G.js → agent-memory-branch-AEXKIGDG.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +2 -0
- package/dist/cli/chunks/{arena-EIV5OALF.js → arena-IQ5ZZDRF.js} +2 -2
- package/dist/cli/chunks/{arena-4BMFF6BS.js → arena-M7GA3CVG.js} +4 -4
- package/dist/cli/chunks/{audit-DNTI453H.js → audit-4IPBMKWB.js} +3 -3
- package/dist/cli/chunks/base-OTGSN6IC.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-TQBQGNC6.js → better-sqlite3-IKDKJ2IE.js} +2 -2
- package/dist/cli/chunks/{brain-handler-HY57CNAO.js → brain-handler-5NQUDH4W.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-THPMZPHQ.js → branch-enumerator-KSXELWRC.js} +2 -2
- package/dist/cli/chunks/{browser-O6JJOZCK.js → browser-6LACARWE.js} +2 -2
- package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +2 -0
- package/dist/cli/chunks/{chunk-7724KXM2.js → chunk-22UKJGGN.js} +3 -3
- package/dist/cli/chunks/{chunk-3XACRXBY.js → chunk-27HE2BHC.js} +2 -2
- package/dist/cli/chunks/{chunk-3TF27MG5.js → chunk-2CKERSMB.js} +2 -2
- package/dist/cli/chunks/{chunk-TOJF3ZG4.js → chunk-2IIXCEMS.js} +2 -2
- package/dist/cli/chunks/{chunk-3FITMWWJ.js → chunk-2LUTPMBO.js} +2 -2
- package/dist/cli/chunks/{chunk-MB4UKUBV.js → chunk-2ZFLULL4.js} +2 -2
- package/dist/cli/chunks/{chunk-6NIGSY5L.js → chunk-337Z52QM.js} +2 -2
- package/dist/cli/chunks/{chunk-4T7XV5KQ.js → chunk-3CYNZFKH.js} +1 -1
- package/dist/cli/chunks/chunk-3HVFIITW.js +2 -0
- package/dist/cli/chunks/{chunk-2QLE6NDW.js → chunk-3J3RNJNX.js} +1 -1
- package/dist/cli/chunks/{chunk-E3QIQMMN.js → chunk-4ATQP3PR.js} +1 -1
- package/dist/cli/chunks/{chunk-EIEEST4T.js → chunk-4D4CWP72.js} +2 -2
- package/dist/cli/chunks/{chunk-WCM6WE7G.js → chunk-4HKAD25N.js} +3 -3
- package/dist/cli/chunks/{chunk-HEDGFKC5.js → chunk-4X3SWKBA.js} +2 -2
- package/dist/cli/chunks/{chunk-IQRPR4KB.js → chunk-5AFVEWMT.js} +2 -2
- package/dist/cli/chunks/{chunk-VCVRZD4Y.js → chunk-5C62XMJR.js} +3 -3
- package/dist/cli/chunks/{chunk-UDSB3XCG.js → chunk-5G4UFTV4.js} +2 -2
- package/dist/cli/chunks/{chunk-BNG4J3CE.js → chunk-5I7357KS.js} +2 -2
- package/dist/cli/chunks/{chunk-DRLSJJIC.js → chunk-5KA5TVPR.js} +2 -2
- package/dist/cli/chunks/{chunk-WZQADC5R.js → chunk-5PTAFGJT.js} +2 -2
- package/dist/cli/chunks/{chunk-M2TG7VDK.js → chunk-6BRQPHMZ.js} +1 -1
- package/dist/cli/chunks/{chunk-J35JWDJE.js → chunk-6KCSKGVY.js} +1 -1
- package/dist/cli/chunks/{chunk-QUZ745UQ.js → chunk-6LE362LZ.js} +2 -2
- package/dist/cli/chunks/{chunk-L752CNG3.js → chunk-6NBRMD25.js} +3 -3
- package/dist/cli/chunks/{chunk-56NSE3LJ.js → chunk-6RBTS3NF.js} +2 -2
- package/dist/cli/chunks/{chunk-E7OR6V3V.js → chunk-6YVMX2TC.js} +2 -2
- package/dist/cli/chunks/{chunk-WKI46WWN.js → chunk-73PBAWAF.js} +2 -2
- package/dist/cli/chunks/{chunk-HSDWPQQY.js → chunk-74YG72NQ.js} +3 -3
- package/dist/cli/chunks/{chunk-5PLBQZ5J.js → chunk-76P32JVU.js} +1 -1
- package/dist/cli/chunks/{chunk-FTYRPEJS.js → chunk-7ACCBHRB.js} +1 -1
- package/dist/cli/chunks/{chunk-O3ERGUXH.js → chunk-7BLZHFKD.js} +1 -1
- package/dist/cli/chunks/{chunk-BM3EJLMV.js → chunk-7O45RQHF.js} +2 -2
- package/dist/cli/chunks/{chunk-JSSU4RIK.js → chunk-7XB3FCKM.js} +2 -2
- package/dist/cli/chunks/{chunk-7TH4PJSU.js → chunk-AHMWD6JG.js} +2 -2
- package/dist/cli/chunks/{chunk-X7CUI7KH.js → chunk-AJPROCDW.js} +2 -2
- package/dist/cli/chunks/{chunk-TW6Z6W4X.js → chunk-AKZO6GGG.js} +13 -13
- package/dist/cli/chunks/{chunk-L7PC675Y.js → chunk-AOKKUB5F.js} +1 -1
- package/dist/cli/chunks/{chunk-UNYTHZDZ.js → chunk-AP2W7Z3A.js} +1 -1
- package/dist/cli/chunks/{chunk-VG32EEUG.js → chunk-BBRROA3Z.js} +2 -2
- package/dist/cli/chunks/{chunk-2IJO3657.js → chunk-BDKEAGQ2.js} +2 -2
- package/dist/cli/chunks/{chunk-YEFTK4HD.js → chunk-BFQTLF5X.js} +2 -2
- package/dist/cli/chunks/{chunk-JB7R77SH.js → chunk-BLL2XU7A.js} +2 -2
- package/dist/cli/chunks/{chunk-UMHFTQTR.js → chunk-BP5T3OEV.js} +2 -2
- package/dist/cli/chunks/{chunk-C3OIBFAA.js → chunk-BQ47GQPK.js} +2 -2
- package/dist/cli/chunks/{chunk-IDBA5GK2.js → chunk-BU4UQR36.js} +2 -2
- package/dist/cli/chunks/{chunk-U6IOQKCT.js → chunk-BZULJMGH.js} +2 -2
- package/dist/cli/chunks/{chunk-X6NJOT3V.js → chunk-C4KLXFJP.js} +1 -1
- package/dist/cli/chunks/{chunk-KJ5A54ZH.js → chunk-C4RTAVC6.js} +2 -2
- package/dist/cli/chunks/{chunk-ZUE524JL.js → chunk-C5CXL3JP.js} +2 -2
- package/dist/cli/chunks/{chunk-YE54T2NQ.js → chunk-CAOUV5GZ.js} +2 -2
- package/dist/cli/chunks/{chunk-7MISCSL5.js → chunk-CBK5CT6T.js} +2 -2
- package/dist/cli/chunks/{chunk-Z54G2YOL.js → chunk-DEKR3CTS.js} +2 -2
- package/dist/cli/chunks/{chunk-57DRT6UA.js → chunk-DKX4GNRU.js} +2 -2
- package/dist/cli/chunks/{chunk-HTVGHHX2.js → chunk-DUKE27HC.js} +2 -2
- package/dist/cli/chunks/{chunk-O756AOUX.js → chunk-DURD37JZ.js} +2 -2
- package/dist/cli/chunks/{chunk-OGEIHS76.js → chunk-E3MRDIZF.js} +1 -1
- package/dist/cli/chunks/{chunk-N736GLWZ.js → chunk-E56PVVWC.js} +2 -2
- package/dist/cli/chunks/{chunk-GY4P7KAI.js → chunk-E5G4WZ2T.js} +1 -1
- package/dist/cli/chunks/{chunk-JI67T6Q2.js → chunk-EBTNMQSS.js} +2 -2
- package/dist/cli/chunks/{chunk-P2TPH3TC.js → chunk-EFUJDMNC.js} +2 -2
- package/dist/cli/chunks/{chunk-7T6L3LFN.js → chunk-EKP2SC77.js} +2 -2
- package/dist/cli/chunks/{chunk-WRC3HLUY.js → chunk-EMSZVUYA.js} +3 -3
- package/dist/cli/chunks/{chunk-NZQYJCO6.js → chunk-ERN56H6S.js} +1 -1
- package/dist/cli/chunks/{chunk-INGXD5IX.js → chunk-FOOW4JVS.js} +2 -2
- package/dist/cli/chunks/{chunk-PGN4TARY.js → chunk-FTRSS64D.js} +2 -2
- package/dist/cli/chunks/{chunk-LTGQJYYO.js → chunk-G242G224.js} +2 -2
- package/dist/cli/chunks/{chunk-ARRBXCII.js → chunk-G6RDCCFV.js} +2 -2
- package/dist/cli/chunks/{chunk-7SQTLUEN.js → chunk-GCHYOPRZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G7HGUQAE.js → chunk-GGQGCT4Y.js} +2 -2
- package/dist/cli/chunks/{chunk-AYLEH2UF.js → chunk-GKSMRBHU.js} +1 -1
- package/dist/cli/chunks/{chunk-JO26SG47.js → chunk-GQABPCQE.js} +2 -2
- package/dist/cli/chunks/{chunk-O2AAYJUV.js → chunk-GV2QE5TO.js} +1 -1
- package/dist/cli/chunks/{chunk-K2SMP4OD.js → chunk-H5DER3JY.js} +1 -1
- package/dist/cli/chunks/{chunk-HAYKLXCT.js → chunk-HH4ED4F7.js} +11 -11
- package/dist/cli/chunks/{chunk-L5VSLPMW.js → chunk-HL2ANKN3.js} +2 -2
- package/dist/cli/chunks/{chunk-USAKCGHC.js → chunk-HTZSRMHW.js} +2 -2
- package/dist/cli/chunks/{chunk-MR2OPUSA.js → chunk-IXL5ZHWJ.js} +1 -1
- package/dist/cli/chunks/{chunk-6P4Q4RTC.js → chunk-J3FP5UGL.js} +1 -1
- package/dist/cli/chunks/{chunk-6OI5SK7M.js → chunk-JCQGJGGZ.js} +1 -1
- package/dist/cli/chunks/{chunk-NKOLILT7.js → chunk-JCZCJE6X.js} +2 -2
- package/dist/cli/chunks/{chunk-VGZOPQQY.js → chunk-JKJOB65O.js} +1 -1
- package/dist/cli/chunks/{chunk-43XHGWYH.js → chunk-JUDUBQHA.js} +2 -2
- package/dist/cli/chunks/{chunk-NHEG2DLN.js → chunk-JW74KRBC.js} +2 -2
- package/dist/cli/chunks/{chunk-ZJGFQK27.js → chunk-K3WZICFA.js} +1 -1
- package/dist/cli/chunks/{chunk-5Y7UFHJD.js → chunk-K3XBQC3R.js} +1 -1
- package/dist/cli/chunks/{chunk-JJHLGGPP.js → chunk-KCQNFBBR.js} +1 -1
- package/dist/cli/chunks/{chunk-U4TML2VD.js → chunk-KJBPB7P5.js} +2 -2
- package/dist/cli/chunks/{chunk-6O63ZTVX.js → chunk-KLTMOXIK.js} +2 -2
- package/dist/cli/chunks/{chunk-XMCSKYDE.js → chunk-L32JNNKL.js} +1 -1
- package/dist/cli/chunks/{chunk-UPWLMIDY.js → chunk-LB2LGEDP.js} +2 -2
- package/dist/cli/chunks/{chunk-4RPBODN5.js → chunk-LHMQIZ6B.js} +2 -2
- package/dist/cli/chunks/{chunk-RE6JTSDM.js → chunk-LJMYRTJ7.js} +1 -1
- package/dist/cli/chunks/{chunk-57FX3GP6.js → chunk-LNX74WHQ.js} +1 -1
- package/dist/cli/chunks/{chunk-52KOPIMI.js → chunk-LTQVUAPH.js} +2 -2
- package/dist/cli/chunks/{chunk-H3C5FJRH.js → chunk-LVABQNRF.js} +2 -2
- package/dist/cli/chunks/{chunk-V3MGY76S.js → chunk-LYJHUNBK.js} +2 -2
- package/dist/cli/chunks/{chunk-QNQE3EOH.js → chunk-M4CJCPCQ.js} +2 -2
- package/dist/cli/chunks/{chunk-D5GB5PUU.js → chunk-M4WMSCAE.js} +1 -1
- package/dist/cli/chunks/{chunk-TWOV3I3A.js → chunk-MIA447GY.js} +1 -1
- package/dist/cli/chunks/{chunk-CAZM63TP.js → chunk-MPFPWJTH.js} +2 -2
- package/dist/cli/chunks/{chunk-BPDAQB3F.js → chunk-MV55NXTD.js} +2 -2
- package/dist/cli/chunks/{chunk-EC65UZ77.js → chunk-NQS3BWS6.js} +1 -1
- package/dist/cli/chunks/{chunk-DSQESXL4.js → chunk-NWIIYHT6.js} +2 -2
- package/dist/cli/chunks/{chunk-4WLIOPHX.js → chunk-O6EWL5DQ.js} +2 -2
- package/dist/cli/chunks/{chunk-QP2HLKTS.js → chunk-OBDONJQM.js} +2 -2
- package/dist/cli/chunks/{chunk-BQJ7CV53.js → chunk-OLZH5LRT.js} +12 -12
- package/dist/cli/chunks/{chunk-H4LYXLAT.js → chunk-OQG3UQQ7.js} +1 -1
- package/dist/cli/chunks/{chunk-E2JLAW3U.js → chunk-PFQCV6YS.js} +3 -3
- package/dist/cli/chunks/{chunk-JAOCHPYX.js → chunk-PS6UMZVK.js} +2 -2
- package/dist/cli/chunks/{chunk-K7GFYFBO.js → chunk-PXATBHWN.js} +2 -2
- package/dist/cli/chunks/{chunk-CPPYZYXC.js → chunk-PYPS65P7.js} +2 -2
- package/dist/cli/chunks/{chunk-HHBF2BZC.js → chunk-Q6I4SIUU.js} +4 -4
- package/dist/cli/chunks/{chunk-QP6GL3O5.js → chunk-QFGYH6HD.js} +1 -1
- package/dist/cli/chunks/{chunk-BBYJBZHG.js → chunk-QGBGSQ2E.js} +2 -2
- package/dist/cli/chunks/{chunk-XTZGAG6P.js → chunk-QRKTBSZT.js} +2 -2
- package/dist/cli/chunks/{chunk-FJOIBZUB.js → chunk-R6LHJ7ME.js} +2 -2
- package/dist/cli/chunks/{chunk-Z2S7DNFP.js → chunk-RBKUU7WF.js} +2 -2
- package/dist/cli/chunks/{chunk-PWQWKYBG.js → chunk-RDMRY7CT.js} +1 -1
- package/dist/cli/chunks/{chunk-65EE2EST.js → chunk-RIRZHOS2.js} +2 -2
- package/dist/cli/chunks/{chunk-D3ZZ2NLL.js → chunk-SHRI7TKJ.js} +2 -2
- package/dist/cli/chunks/{chunk-CIINJHOX.js → chunk-SJCKCSN3.js} +1 -1
- package/dist/cli/chunks/{chunk-X6Q2N5S5.js → chunk-SON6ZRH3.js} +2 -2
- package/dist/cli/chunks/{chunk-2UZBLC5H.js → chunk-SZAZQZWI.js} +2 -2
- package/dist/cli/chunks/{chunk-2W5MQDHM.js → chunk-T4GE7MPI.js} +2 -2
- package/dist/cli/chunks/{chunk-JK6PMLQQ.js → chunk-T66PPF4D.js} +2 -2
- package/dist/cli/chunks/{chunk-OLUOVNUF.js → chunk-T67R2MUN.js} +2 -2
- package/dist/cli/chunks/{chunk-O32BFQV4.js → chunk-TDQWTSBS.js} +2 -2
- package/dist/cli/chunks/{chunk-YGOSSVY5.js → chunk-TODNOP7C.js} +2 -2
- package/dist/cli/chunks/{chunk-WBC6WB32.js → chunk-TX2CHQD7.js} +2 -2
- package/dist/cli/chunks/{chunk-FHPNWHY7.js → chunk-TZIHDJZD.js} +2 -2
- package/dist/cli/chunks/{chunk-WUGXXNK4.js → chunk-U62OUXBF.js} +1 -1
- package/dist/cli/chunks/{chunk-A2T56XVL.js → chunk-UAQZI6N4.js} +2 -2
- package/dist/cli/chunks/{chunk-MKYOE7NE.js → chunk-UE2J6MA5.js} +1 -1
- package/dist/cli/chunks/{chunk-K7RT6ITZ.js → chunk-UGYM4U44.js} +1 -1
- package/dist/cli/chunks/{chunk-7QUSNBAA.js → chunk-UJABDXST.js} +2 -2
- package/dist/cli/chunks/{chunk-VJBJRFUO.js → chunk-UORB2QDU.js} +9 -9
- package/dist/cli/chunks/{chunk-O5CEL447.js → chunk-UQPA33UK.js} +2 -2
- package/dist/cli/chunks/{chunk-7MUO4DEH.js → chunk-UUBIQR6A.js} +3 -3
- package/dist/cli/chunks/{chunk-WCPSR4MJ.js → chunk-UXIY4IAI.js} +2 -2
- package/dist/cli/chunks/{chunk-UFP7SN5V.js → chunk-VCXI4XC4.js} +2 -2
- package/dist/cli/chunks/{chunk-OCN53CCK.js → chunk-VMAM46HQ.js} +2 -2
- package/dist/cli/chunks/{chunk-MQXWG55U.js → chunk-VY4U6DPO.js} +3 -3
- package/dist/cli/chunks/{chunk-M5JEA6ZY.js → chunk-W27AJ5B4.js} +2 -2
- package/dist/cli/chunks/{chunk-YGC5QKQ4.js → chunk-W5ZJG2OU.js} +2 -2
- package/dist/cli/chunks/{chunk-AJVLVF7V.js → chunk-W62OOK7A.js} +2 -2
- package/dist/cli/chunks/{chunk-WM2QRIRD.js → chunk-WNTA4YKE.js} +2 -2
- package/dist/cli/chunks/{chunk-7Y3LXH57.js → chunk-WUOOX7UG.js} +2 -2
- package/dist/cli/chunks/{chunk-PCQZIAXB.js → chunk-WVXJ2QIG.js} +2 -2
- package/dist/cli/chunks/{chunk-PNRPVQGI.js → chunk-X33CWRDF.js} +2 -2
- package/dist/cli/chunks/{chunk-TSP6SU5V.js → chunk-XG4F4XH4.js} +2 -2
- package/dist/cli/chunks/{chunk-V6SE2ZU2.js → chunk-XH4JMX5O.js} +1 -1
- package/dist/cli/chunks/{chunk-R5RRWLRI.js → chunk-XHHWABJV.js} +2 -2
- package/dist/cli/chunks/{chunk-DLTB5KCR.js → chunk-XHLYGXYE.js} +2 -2
- package/dist/cli/chunks/{chunk-NPCXGX7N.js → chunk-XIVVTYM2.js} +2 -2
- package/dist/cli/chunks/{chunk-E7QTWGPI.js → chunk-XM6ZVFM5.js} +10 -10
- package/dist/cli/chunks/{chunk-XN3KCKAM.js → chunk-XWIAZG3C.js} +2 -2
- package/dist/cli/chunks/{chunk-J6ASX536.js → chunk-Y2OX6KGN.js} +2 -2
- package/dist/cli/chunks/{chunk-HV43NX4A.js → chunk-YUS6TWAL.js} +2 -2
- package/dist/cli/chunks/{chunk-2HPNGK7A.js → chunk-ZIPAB5J6.js} +2 -2
- package/dist/cli/chunks/{chunk-XSPMLJCQ.js → chunk-ZSOMUTNL.js} +1 -1
- package/dist/cli/chunks/{chunk-IRPNEXOU.js → chunk-ZWBGYJ7K.js} +2 -2
- package/dist/cli/chunks/{chunk-5Z4MO2F3.js → chunk-ZYJB6FML.js} +1 -1
- package/dist/cli/chunks/{ci-UMA2SMNW.js → ci-UCUJOSBW.js} +2 -2
- package/dist/cli/chunks/{ci-config-UQSILJFQ.js → ci-config-2XILD3XG.js} +2 -2
- package/dist/cli/chunks/{ci-output-U6YZLLKH.js → ci-output-BL6KWOHW.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ATYQP6X2.js → circuit-breaker-5XLIOXE5.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-6YHFD7AN.js → claude-flow-setup-4IMP6ACS.js} +2 -2
- package/dist/cli/chunks/client-KKRNPX4F.js +2 -0
- package/dist/cli/chunks/{cline-installer-EPE7IOZE.js → cline-installer-RYLHCDK7.js} +2 -2
- package/dist/cli/chunks/{code-NUEJ4XYO.js → code-WY3GJXHX.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-D4DBT6OL.js → code-index-extractor-Y4MZBZCW.js} +2 -2
- package/dist/cli/chunks/{codex-installer-633SM4LR.js → codex-installer-SCJ3T3DX.js} +4 -4
- package/dist/cli/chunks/{completions-WUKVIW3L.js → completions-CN2DXQFU.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-F73ACR5H.js → complexity-analyzer-7MDPPIBH.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-QH42TKMS.js → continuedev-installer-GCEJRK34.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-Y3XC7BTT.js → copilot-installer-BHPDSELY.js} +2 -2
- package/dist/cli/chunks/core-handlers-47MPMED7.js +2 -0
- package/dist/cli/chunks/{cost-tracker-57QPV7E3.js → cost-tracker-VO5MFWR6.js} +2 -2
- package/dist/cli/chunks/{coverage-IBCHMBCR.js → coverage-LYFQYNH6.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +2 -0
- package/dist/cli/chunks/{cursor-installer-F4UYQHIN.js → cursor-installer-KP4HA7TV.js} +2 -2
- package/dist/cli/chunks/{daemon-XR4Q6YZF.js → daemon-7RC7TS57.js} +3 -3
- package/dist/cli/chunks/{daemon-BYYPIJ7G.js → daemon-AXLVPKVO.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-ZR5ZD3TW.js → dag-attention-scheduler-NKA44RSR.js} +2 -2
- package/dist/cli/chunks/{detect-GEGYURLL.js → detect-CMYAJWYF.js} +2 -2
- package/dist/cli/chunks/{dist-node-JU3KT2JO.js → dist-node-EN3PYEGW.js} +2 -2
- package/dist/cli/chunks/{domain-handler-7QI3FJGE.js → domain-handler-EXSZCX7A.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-O2YRM2PD.js → domain-plugins-HCQFSNL7.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-7J3S2OS6.js → domain-transfer-3LGSNTPO.js} +2 -2
- package/dist/cli/chunks/dream-76L6EEN7.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-URES5Q6J.js → embed-and-insert-pattern-B6MNHICW.js} +2 -2
- package/dist/cli/chunks/{eval-RVMCIUOR.js → eval-OQELIWJK.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-SYJQSBKE.js → experience-capture-middleware-SUFILYPW.js} +3 -3
- package/dist/cli/chunks/{fast-paths-QUKPKWKZ.js → fast-paths-UV4NDEWM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-K7JXNKJI.js → feature-flags-CKTYX67J.js} +2 -2
- package/dist/cli/chunks/{feature-flags-5JCSKL2P.js → feature-flags-H7H33B6C.js} +2 -2
- package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +2 -0
- package/dist/cli/chunks/{fleet-II4Q6HXK.js → fleet-ZJBCAKRG.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-M7VO2EMS.js → gnn-wrapper-RUE2QZRG.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ND5CY26N.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-N3AUUUU7.js → hnsw-legacy-bridge-UJID6ZZ4.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-NZY3E5EN.js → hnswlib-node-WS43R4AX.js} +2 -2
- package/dist/cli/chunks/{hooks-QVJDTII5.js → hooks-YZNJKXAJ.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-ZRY6MTDV.js → hypergraph-engine-XQJSIMTS.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-56DO4XZQ.js → hypergraph-handler-ZD2NYXMR.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +2 -0
- package/dist/cli/chunks/{init-guard-DTF4EVUY.js → init-guard-DSRUAVRT.js} +2 -2
- package/dist/cli/chunks/{init-handler-M6CNQHMX.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-IJN7XKBH.js → kilocode-installer-BCPOCVMC.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-UKKPGPDC.js → kiro-installer-GFCWCB2S.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +2 -0
- package/dist/cli/chunks/{learning-W2HETWQ4.js → learning-FZTD72CF.js} +3 -3
- package/dist/cli/chunks/{llm-router-Y546K4VX.js → llm-router-GJVKGRJL.js} +4 -4
- package/dist/cli/chunks/llm-router-service-TNOWQINA.js +2 -0
- package/dist/cli/chunks/{load-MKAB2AXE.js → load-YKTPOYBE.js} +2 -2
- package/dist/cli/chunks/load-test-FPVBK2EV.js +2 -0
- package/dist/cli/chunks/{mcp-AZKUS6K3.js → mcp-LT6R2IKS.js} +2 -2
- package/dist/cli/chunks/{memory-ZDOQN2KU.js → memory-4HKKOLRY.js} +5 -5
- package/dist/cli/chunks/memory-backend-2QE7O67A.js +2 -0
- package/dist/cli/chunks/{memory-handlers-3SQVY7FE.js → memory-handlers-X4CMVBXB.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-WWVXDHG4.js → multi-model-executor-2YPM2WTK.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-YUJNXXWS.js → opencode-installer-WBAJMH5K.js} +2 -2
- package/dist/cli/chunks/{orchestrator-Z6PWPLRE.js → orchestrator-5W5WVMVJ.js} +17 -17
- package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-TPWPX32U.js → pattern-usage-recorder-GXRMNPAZ.js} +2 -2
- package/dist/cli/chunks/{pipeline-4BBGTE4M.js → pipeline-2NA4DRDA.js} +2 -2
- package/dist/cli/chunks/{platform-5GSHXCV5.js → platform-BGERNQ5V.js} +2 -2
- package/dist/cli/chunks/{plugin-OFDVF5HS.js → plugin-L4EPVENR.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-NC6MUYGJ.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-MPOAAEPA.js → protocol-handler-SYQXM6JK.js} +2 -2
- package/dist/cli/chunks/{prove-CDKMAIVM.js → prove-5O7GPJCU.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +2 -0
- package/dist/cli/chunks/{quality-ZH4F7R7R.js → quality-KIIDHGNF.js} +2 -2
- package/dist/cli/chunks/{quality-gate-IDRMW6OE.js → quality-gate-H65VECD3.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +2 -0
- package/dist/cli/chunks/{real-embeddings-I2UVNNB3.js → real-embeddings-DYIOLKQ3.js} +2 -2
- package/dist/cli/chunks/{ref-validation-Z5GCGVXK.js → ref-validation-CSBJOMZM.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-IZ2S7PH2.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-NAX35VUW.js → routing-handler-ZNZPPI5Y.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5YW2SOFF.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-VUIZHTVG.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-IPGCAT6C.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-3IH4BO5Z.js → security-A3IMVLFM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-ABY7PAY2.js → shared-rvf-adapter-VHWQ6US5.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-6KENLN2W.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-RLFAUGOW.js → standalone-memory-DDNXCSBD.js} +2 -2
- package/dist/cli/chunks/{status-handler-FCOZBPE5.js → status-handler-2HK7XPEK.js} +2 -2
- package/dist/cli/chunks/{structural-health-4RDA5UUM.js → structural-health-DSJVLEPV.js} +2 -2
- package/dist/cli/chunks/{sync-54LUAUTK.js → sync-3MUV6S5E.js} +2 -2
- package/dist/cli/chunks/{sync-KGEEXXCC.js → sync-NTUR53PI.js} +2 -2
- package/dist/cli/chunks/{task-handler-K3OXHYKU.js → task-handler-74MZN2EO.js} +2 -2
- package/dist/cli/chunks/{task-handlers-6H7L2UT4.js → task-handlers-VJR6EHRZ.js} +3 -3
- package/dist/cli/chunks/{test-S7IG6EIX.js → test-O6FK3FVF.js} +4 -4
- package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +2 -0
- package/dist/cli/chunks/{test-scheduling-7XYXI4L2.js → test-scheduling-Q6QEEOS6.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-3QMABE45.js → token-bootstrap-TTRCECLP.js} +2 -2
- package/dist/cli/chunks/{token-usage-Y2YTPOFE.js → token-usage-YEEFWSSI.js} +2 -2
- package/dist/cli/chunks/{transformers-UCJ3HHHC.js → transformers-BZCHJJJT.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +2 -0
- package/dist/cli/chunks/{types-6CMFPETH.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-K25DN6WU.js → upgrade-2MWW6BT2.js} +2 -2
- package/dist/cli/chunks/{validate-T4V3TBY3.js → validate-PAEV3GT5.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-XSRC576T.js → validate-swarm-ZIXACK5K.js} +2 -2
- package/dist/cli/chunks/visual-security-GXGSFBVA.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-YOZXHRTN.js → web-tree-sitter-VLTXZFAB.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-ITPU2IYL.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-YUG7E3UX.js → witness-chain-repair-5SAXPETG.js} +2 -2
- package/dist/cli/chunks/{witness-chain-verifier-DTDSVKOG.js → witness-chain-verifier-MIDWD4JS.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EWACWGAW.js → witness-key-manager-OSVCWOB2.js} +2 -2
- package/dist/cli/chunks/{workflow-ZIQ4FV42.js → workflow-MK7A7QCX.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +2 -0
- package/dist/cli/chunks/{wrappers-PW2O27LL.js → wrappers-5QFMCKXL.js} +2 -2
- package/dist/init/init-wizard-hooks.d.ts +1 -1
- package/dist/init/init-wizard-hooks.js +7 -8
- 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/learning/dream/dream-engine.d.ts +3 -2
- package/dist/learning/dream/dream-engine.js +42 -24
- 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/mcp/bundle.js +419 -419
- package/package.json +4 -2
- package/dist/cli/chunks/adapter-23KA2YW7.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-2DLAEZK6.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-MUICAXW5.js +0 -2
- package/dist/cli/chunks/base-XPWGYDKD.js +0 -2
- package/dist/cli/chunks/browser-workflow-UMQVBVGK.js +0 -2
- package/dist/cli/chunks/chunk-YKQWIXUY.js +0 -2
- package/dist/cli/chunks/client-E43GWLQH.js +0 -2
- package/dist/cli/chunks/core-handlers-R5A3SQDY.js +0 -2
- package/dist/cli/chunks/cross-domain-router-LLYVPZF6.js +0 -2
- package/dist/cli/chunks/dream-6C4NURSE.js +0 -2
- package/dist/cli/chunks/file-discovery-J5IE5KP7.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-FC5PBTMN.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-47UIVOBG.js +0 -2
- package/dist/cli/chunks/hnsw-index-3AKVLOZQ.js +0 -2
- package/dist/cli/chunks/hybrid-backend-YAOSNX47.js +0 -2
- package/dist/cli/chunks/impact-analyzer-4FMJXM4M.js +0 -2
- package/dist/cli/chunks/init-wizard-RTLCRWDT.js +0 -2
- package/dist/cli/chunks/kernel-2OWIGGGT.js +0 -2
- package/dist/cli/chunks/knowledge-graph-25XXKDJN.js +0 -2
- package/dist/cli/chunks/llm-router-service-G3EIN4UB.js +0 -2
- package/dist/cli/chunks/load-test-D6QYNIVT.js +0 -2
- package/dist/cli/chunks/memory-backend-LDFFZMEQ.js +0 -2
- package/dist/cli/chunks/pattern-null-store-KDVRM7PW.js +0 -2
- package/dist/cli/chunks/project-root-DDGBWDP6.js +0 -2
- package/dist/cli/chunks/protocol-executor-KBOLLCWA.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-GRXBT7FC.js +0 -2
- package/dist/cli/chunks/queen-coordinator-L2QWMJ5Q.js +0 -2
- package/dist/cli/chunks/router-FT5WJPUH.js +0 -2
- package/dist/cli/chunks/routing-feedback-EO2MKOUX.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-WHBFQJVU.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-YT3APF2I.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-37PUFKQD.js +0 -2
- package/dist/cli/chunks/safe-db-TDZKUOZJ.js +0 -2
- package/dist/cli/chunks/schedule-CRKTRY2A.js +0 -2
- package/dist/cli/chunks/scheduler-6ZBDVQWN.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-FFJQAIKW.js +0 -2
- package/dist/cli/chunks/test-runner-process-OTQDAJLN.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-D6JTTHTP.js +0 -2
- package/dist/cli/chunks/unified-memory-QARWQKJ2.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-LHY3DXCP.js +0 -2
- package/dist/cli/chunks/unified-persistence-WEYYGLHM.js +0 -2
- package/dist/cli/chunks/visual-security-O4ALMCXQ.js +0 -2
- package/dist/cli/chunks/witness-chain-B3YW5NMS.js +0 -2
- package/dist/cli/chunks/witness-chain-PIYR72HJ.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3ZN2BCGY.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{c as g,d as 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{c as g,d as p}from"./chunk-LJMYRTJ7.js";import{c as R,d as D}from"./chunk-SZAZQZWI.js";import{c as h,e as B}from"./chunk-HL2ANKN3.js";D();import*as c from"node:fs/promises";import*as i from"node:path";B();var W=2*1024*1024;function m(r,t){let n=i.relative(r,t);return n===""||n!==".."&&!n.startsWith(`..${i.sep}`)&&!i.isAbsolute(n)}function M(r,t){return i.isAbsolute(t)?t:`${r}${i.sep}${t}`}async function _(r,t){let n=[],e=r;for(;;){n.unshift(i.basename(e));let o=i.dirname(e);if(o===e)return null;e=o;let s=await c.realpath(e).catch(()=>null);if(s)return!m(t,s)||n.some(a=>a==="..")?null:i.join(s,...n.filter(a=>a!=="."&&a!==""))}}async function $(r,t={}){let n=t.projectRoot??R(),e=t.basePath??process.cwd(),o=[],s=[],a=[],d=i.resolve(n),u=await c.realpath(n).catch(()=>d),k=await c.realpath(e).catch(()=>null),b=(l,f)=>{o.push(l),s.push(!i.isAbsolute(l)&&k?i.relative(k,f)||".":f)};for(let l of r){let f=i.resolve(e,l);if(!m(d,f)&&!m(u,f)){a.push({path:l,reason:"outside-project-root"});continue}let x=M(e,l),y;try{y=await c.realpath(x)}catch(O){let E=O.code,I=E==="ENOENT"||E==="ENOTDIR",T=await c.lstat(x).then(()=>!0,()=>!1),A=I&&!T&&t.allowMissing?await _(x,u):null;A?b(l,A):a.push({path:l,reason:I?"not-found":"unreadable"});continue}if(!m(u,y)){a.push({path:l,reason:"outside-project-root"});continue}let P=await c.stat(y).catch(()=>null);P?P.isFile()||t.allowDirectory&&P.isDirectory()?t.maxBytes!==void 0&&P.size>t.maxBytes?a.push({path:l,reason:"too-large"}):b(l,y):a.push({path:l,reason:"not-a-file"}):a.push({path:l,reason:"unreadable"})}return{accepted:o,resolved:s,skipped:a}}function w(r){return r===null?"null":Array.isArray(r)?"array":typeof r}async function Y(r,t,n,e={}){let o=`Invalid ${r} payload`;if(!Array.isArray(n))return p(new h(`${o}: '${t}' must be an array of file paths, got ${w(n)}`));for(let d=0;d<n.length;d++){let u=n[d];if(typeof u!="string"||u.trim()==="")return p(new h(`${o}: '${t}[${d}]' must be a non-empty string, got ${w(u)}`));if(u.includes("\0"))return p(new h(`${o}: '${t}[${d}]' contains a null byte`))}let{resolved:s,skipped:a}=await $(n,e);return a.length>0?p(j(o,t,a,e)):g(s)}function j(r,t,n,e){let o=e.maxBytes!==void 0?`, at most ${Math.round(e.maxBytes/1048576)} MB each`:"",s=e.allowDirectory?"regular files or directories":"regular files";return new h(`${r}: ${t} cannot be read: ${n.map(a=>`${a.path} (${a.reason})`).join(", ")}. Pass ${s} inside the project${o}.`)}async function v(r,t,n,e={}){let o=`Invalid ${r} payload`;if(typeof n!="string"||n.trim()==="")return p(new h(`${o}: '${t}' must be a non-empty path string, got ${w(n)}`));if(n.includes("\0"))return p(new h(`${o}: '${t}' contains a null byte`));let{resolved:s,skipped:a}=await $([n],e);return a.length>0?p(j(o,t,a,e)):g(s[0])}function S(r){return r===null?"null":Array.isArray(r)?"array":typeof r}var N=1e4;function C(r,t="paths",n="Invalid index payload",e=N){if(!Array.isArray(r))return p(new Error(`${n}: '${t}' must be an array of file paths, got ${S(r)}`));if(r.length>e)return p(new Error(`${n}: '${t}' has ${r.length} entries; at most ${e} paths are accepted per request - index a directory target or split the list`));for(let o=0;o<r.length;o++){let s=r[o];if(typeof s!="string"||s.trim()==="")return p(new Error(`${n}: '${t}[${o}]' must be a non-empty string, got ${S(s)}`));if(s.includes("\0"))return p(new Error(`${n}: '${t}[${o}]' contains a null byte`))}return g(r)}function K(r,t){if(r!=="index"&&r!=="index-code")return;if(t===null||typeof t!="object"||!Object.hasOwn(t,"paths"))return new Error(`Invalid index payload: '${r}' needs 'paths', the list of files to index. It does not expand a directory 'target'; use code_index (or \`aqe code index\`) with a target, or list the files in paths.`);let n=C(t.paths);if(!n.success)return n.error;if(n.value.length===0)return new Error("Invalid index payload: 'paths' is empty; list at least one file to index")}async function Q(r,t,n=process.cwd()){let{accepted:e,skipped:o}=await $(r,{projectRoot:t,basePath:n});return{accepted:e,skipped:o}}function U(r,t,n=[]){let e=[...t.map(a=>`${a.path} (${a.reason})`),...n.map(a=>`${a.file} (${a.error})`)],o=e.slice(0,5).join(", "),s=e.length>5?`, and ${e.length-5} more`:"";return new Error(`Nothing was indexed: 0 of ${r} requested path(s) indexed`+(o?` - ${o}${s}`:""))}export{W as a,$ as b,Y as c,v as d,C as e,K as f,Q as g,U as h};
|
|
@@ -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 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{a as h}from"./chunk-3HVFIITW.js";import{c as m}from"./chunk-BQ47GQPK.js";h();var g=m.create("regret-tracker"),l=50,R=.9,d=1.1;function f(o,t){let e=o.length;if(e<2)return 0;let n=0,r=0,i=0,a=0;for(let s=0;s<e;s++)n+=o[s],r+=t[s],i+=o[s]*t[s],a+=o[s]*o[s];let u=e*a-n*n;return Math.abs(u)<1e-10?0:(e*i-n*r)/u}var c=class{domains=new Map;alertCallbacks=[];alerts=[];maxAlerts;recentWindow;constructor(t){this.maxAlerts=t?.maxAlerts??100,this.recentWindow=t?.recentWindow??20}recordDecision(t,e,n){let r=this.getOrCreateDomainState(t),i=Math.max(0,n-e);if(r.cumulativeRegret+=i,r.decisionCount++,r.points.push({decisionCount:r.decisionCount,cumulativeRegret:r.cumulativeRegret,timestamp:Date.now()}),r.decisionCount>=l){let a=this.classifyGrowthRate(r.points);r.lastGrowthRate!=="insufficient_data"&&a!==r.lastGrowthRate&&this.emitAlert(t,r.lastGrowthRate,a),r.lastGrowthRate=a}}getCumulativeRegret(t){return this.domains.get(t)?.cumulativeRegret??0}getRegretCurve(t){let e=this.domains.get(t);return e?[...e.points]:[]}getRegretGrowthRate(t){let e=this.domains.get(t);return e?this.classifyGrowthRate(e.points):"insufficient_data"}detectStagnation(t){let e=this.getRegretGrowthRate(t);return e==="linear"||e==="superlinear"}getHealthSummary(){let t=[];for(let[e,n]of this.domains){let r=this.classifyGrowthRate(n.points),i=this.computeLogLogSlope(n.points),a=this.computeRecentAvgRegret(n);t.push({domain:e,totalDecisions:n.decisionCount,cumulativeRegret:n.cumulativeRegret,growthRate:r,stagnating:r==="linear"||r==="superlinear",slope:i,recentAvgRegret:a})}return t.sort((e,n)=>e.domain.localeCompare(n.domain)),t}onAlert(t){this.alertCallbacks.push(t)}getAlerts(){return[...this.alerts]}getTrackedDomains(){return[...this.domains.keys()].sort()}getTotalDecisions(){let t=0;for(let e of this.domains.values())t+=e.decisionCount;return t}reset(t){t?this.domains.delete(t):(this.domains.clear(),this.alerts=[])}getOrCreateDomainState(t){let e=this.domains.get(t);return e||(e={points:[],cumulativeRegret:0,decisionCount:0,lastGrowthRate:"insufficient_data"},this.domains.set(t,e)),e}classifyGrowthRate(t){if(t.length<l)return"insufficient_data";let e=this.computeLogLogSlope(t);return e===void 0?"insufficient_data":e<R?"sublinear":e<=d?"linear":"superlinear"}computeLogLogSlope(t){if(t.length<l)return;let e=t.filter(i=>i.cumulativeRegret>0&&i.decisionCount>0);if(e.length<2)return;let n=e.map(i=>Math.log(i.decisionCount)),r=e.map(i=>Math.log(i.cumulativeRegret));return f(n,r)}computeRecentAvgRegret(t){if(t.points.length<2)return 0;let e=Math.min(this.recentWindow,t.points.length),n=t.points.slice(-e),r=n[0],i=n[n.length-1],a=i.cumulativeRegret-r.cumulativeRegret,u=i.decisionCount-r.decisionCount;return u<=0?0:a/u}emitAlert(t,e,n){let r={domain:t,previousRate:e,newRate:n,timestamp:Date.now(),message:`Domain "${t}" regret growth changed from ${e} to ${n}`};this.alerts.push(r),this.alerts.length>this.maxAlerts&&this.alerts.shift(),g.info("Regret growth rate transition",{domain:t,previousRate:e,newRate:n});for(let i of this.alertCallbacks)try{i(r)}catch(a){g.error("Alert callback error",a instanceof Error?a:void 0)}}};function b(o){return new c(o)}export{b as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
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
|
function r(e,f){if(e==null)return e;let n={...e};for(let t of f){let o=n[t];typeof o=="string"&&(n[t]=new Date(o))}return n}export{r 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{b as E,d 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{b as E,d as S}from"./chunk-XWIAZG3C.js";import{a as D,b as Q}from"./chunk-PXATBHWN.js";import{S as M,l as A}from"./chunk-6YVMX2TC.js";import{f as C}from"./chunk-XH4JMX5O.js";S();M();var v=(1+Math.sqrt(5))/2,R=1/v;function k(t,e=0){if(t<0||!Number.isFinite(t))throw new Error(`Invalid dither sequence length: ${t}`);if(!Number.isFinite(e))throw new Error(`Invalid dither seed: ${e}`);let n=new Float32Array(t),r=(e*R%1+1)%1;for(let i=0;i<t;i++)n[i]=((r+(i+1)*v)%1+1)%1;return n}function I(t,e,n=0){if(!(t instanceof Float32Array))throw new Error("Input vector must be a Float32Array");if(t.length===0)return{quantized:new Int32Array(0),dequantized:new Float32Array(0),bitDepth:e,seed:n,stepSize:0,minValue:0,maxValue:0};if(e<1||e>32||!Number.isInteger(e))throw new Error(`Invalid bit depth: ${e}. Must be an integer in [1, 32].`);let r=t[0],i=t[0];for(let d=1;d<t.length;d++)t[d]<r&&(r=t[d]),t[d]>i&&(i=t[d]);let s=(1<<e)-1,a=i-r,o=a===0?1:a/s,m=k(t.length,n),l=new Int32Array(t.length),u=new Float32Array(t.length);for(let d=0;d<t.length;d++){if(a===0)l[d]=Math.round(s/2);else{let L=(t[d]-r)/o+(m[d]-.5);l[d]=Math.max(0,Math.min(s,Math.round(L)))}u[d]=l[d]*o+r}return{quantized:l,dequantized:u,bitDepth:e,seed:n,stepSize:o,minValue:r,maxValue:i}}var h=null,b=null,p=null,g=null,f=null,w=null,x=!1;try{let t=(Q(),C(D));h=t.RuvectorLayer,b=t.TensorCompress,p=t.differentiableSearch,g=t.hierarchicalForward,f=t.getCompressionLevel,w=t.init,x=!0}catch{}function H(){return x}function c(){if(!x)throw new Error("@ruvector/gnn native module is not available on this platform. Install the appropriate optional dependency for your platform, or use a platform where pre-built binaries are available.")}var F=!1;function V(){if(!F){c();let t=w();return F=!0,t}return"@ruvector/gnn already initialized"}var y=class{indexes;config;nextId;gnnLayers;compressor;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.nextId=new Map,this.gnnLayers=new Map,c(),this.compressor=new b,V()}initializeIndex(e){this.indexes.has(e)||(this.indexes.set(e,new Map),this.nextId.set(e,0))}addEmbedding(e,n){let r=e.namespace;this.indexes.has(r)||this.initializeIndex(r);let i=this.indexes.get(r),s=n??this.nextId.get(r);return n===void 0&&this.nextId.set(r,s+1),i.set(s,e),s}addEmbeddingsBatch(e){let n=[];for(let r of e){let i=this.addEmbedding(r.embedding,r.id);n.push(i)}return n}search(e,n={}){let r=n.namespace||e.namespace;if(!this.indexes.has(r))return[];let i=this.indexes.get(r),s=n.limit||10,a=[];for(let[u,d]of i.entries())a.push({id:u,vector:Array.from(d.vector)});if(a.length===0)return[];let o=new Float32Array(e.vector),m=a.map(u=>new Float32Array(u.vector)),l=p(o,m,Math.min(s,a.length),1);return l.indices.map((u,d)=>({id:a[u]?.id??u,distance:1-l.weights[d]}))}differentiableSearchWithWeights(e,n,r,i=1){let s=new Float32Array(e.vector),a=n.map(m=>new Float32Array(m.embedding.vector)),o=p(s,a,Math.min(r,n.length),i);return{indices:o.indices.map(m=>n[m]?.id??m),weights:o.weights}}hierarchicalForward(e,n,r){let i=r.map(l=>`${l.inputDim}-${l.hiddenDim}`).join(",");if(!this.gnnLayers.has(i)){let l=[];for(let u of r){let d=new h(u.inputDim,u.hiddenDim,u.heads,u.dropout);l.push(d)}this.gnnLayers.set(i,l[0])}let a=this.gnnLayers.get(i).toJson(),o=new Float32Array(e),m=n.map(l=>l.map(u=>new Float32Array(u)));return Array.from(g(o,m,[a]))}compressEmbedding(e,n){let r=f(n),s={none:"none",half:"half",pq8:"pq8",pq4:"pq4",binary:"binary"}[r]??"none",a=new Float32Array(e.vector),o=this.compressor.compress(a,n);return{dimension:Array.from(e.vector).length,level:s,data:o,accessFreq:n}}decompressEmbedding(e){let n=this.compressor.decompress(e.data),r={none:"none",half:"fp16",pq8:"int8",pq4:"int8",binary:"binary"};return{vector:n,dimension:e.dimension,namespace:"code",text:"",timestamp:Date.now(),quantization:r[e.level]??"none"}}getCompressionLevelForFrequency(e){return c(),f(e)}getIndexStats(e){return this.indexes.has(e)?{size:this.indexes.get(e).size,maxElements:1e4,dimension:this.config.dimension,metric:this.config.metric}:null}clearIndex(e){this.indexes.delete(e),this.nextId.delete(e)}clearAll(){this.indexes.clear(),this.nextId.clear()}resizeIndex(e){}setEfSearch(e){this.config.efSearch=e}getConfig(){return{...this.config}}isInitialized(e){return this.indexes.has(e)}getInitializedNamespaces(){return Array.from(this.indexes.keys())}getSize(e){return this.indexes.get(e)?.size??0}async saveIndex(e,n){let r=this.indexes.get(e);if(!r)throw new Error(`Namespace ${e} not initialized`);let i=Array.from(r.entries()).map(([a,o])=>({id:a,vector:Array.from(o.vector),metadata:o.metadata}));await(await import("fs/promises")).writeFile(n,JSON.stringify(i,null,2))}async loadIndex(e,n){let i=await(await import("fs/promises")).readFile(n,"utf-8"),s=E(i);this.initializeIndex(e);for(let a of s){let o={vector:a.vector,dimension:a.vector.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none",metadata:a.metadata};this.addEmbedding(o,a.id)}}},q=class{static instances=new Map;static getInstance(e,n){return this.instances.has(e)||this.instances.set(e,new y(n)),this.instances.get(e)}static closeInstance(e){let n=this.instances.get(e);n&&(n.clearAll(),this.instances.delete(e))}static closeAll(){for(let e of this.instances.values())e.clearAll();this.instances.clear()}},z=class{static layers=new Map;static getLayer(e){let n=`${e.inputDim}-${e.hiddenDim}-${e.heads}-${e.dropout}`;if(!this.layers.has(n)){c();let r=new h(e.inputDim,e.hiddenDim,e.heads,e.dropout);this.layers.set(n,r)}return this.layers.get(n)}static layerFromJson(e){return c(),h.fromJson(e)}static clearCache(){this.layers.clear()}},N=class{static _compressor=null;static get compressor(){return this._compressor||(c(),this._compressor=new b),this._compressor}static compressWithLevel(e,n){let r={levelType:n,scale:1,subvectors:n==="pq8"?8:n==="pq4"?16:void 0,centroids:n==="pq8"?256:void 0,outlierThreshold:n==="pq4"?3:void 0,threshold:n==="binary"?0:void 0},i=e instanceof Float32Array?e:new Float32Array(e);return this.compressor.compressWithLevel(i,r)}static decompress(e){return this.compressor.decompress(e)}static getLevel(e){return c(),f(e)}static compressWithDither(e,n,r){let i=e instanceof Float32Array?e:new Float32Array(e),s;if(A()){let o={none:32,half:16,pq8:8,pq4:4,binary:1},m=r?.bitDepth??o[n]??8,l=r?.seed??0;s=I(i,m,l)}return{compressed:this.compressWithLevel(s?s.dequantized:e,n),ditherResult:s}}};function G(){return c(),h}function J(){return c(),b}function O(){return c(),p}function j(){return c(),g}function B(){return c(),f}function K(){return c(),w}function U(t){return t instanceof Float32Array?t:"vector"in t?t.vector instanceof Float32Array?t.vector:new Float32Array(t.vector):new Float32Array(t)}function X(t){return"vector"in t?Array.from(t.vector):Array.from(t)}function Y(t,e="code"){return{vector:t,dimension:t.length,namespace:e,text:"",timestamp:Date.now(),quantization:"none"}}function Z(t,e,n,r=1){let i=[],s=e.map(a=>a instanceof Float32Array?a:new Float32Array(a));for(let a of t){let o=a instanceof Float32Array?a:new Float32Array(a),m=p(o,s,n,r);i.push({indices:m.indices,weights:m.weights})}return i}export{H as a,V as b,y as c,q as d,z as e,N as f,G as g,J as h,O as i,j,B as k,K as l,U as m,X as n,Y as o,Z as p};
|
|
@@ -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=["var-to-const","add-types","remove-console","promise-to-async","cjs-to-esm","func-to-arrow"],p={"var-to-const":{type:"var-to-const",name:"Var to Const/Let",description:"Convert var declarations to const (if not reassigned) or let (if reassigned)",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"add-types":{type:"add-types",name:"Add TypeScript Types",description:"Add TypeScript type annotations to function parameters and return types",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"remove-console":{type:"remove-console",name:"Remove Console Statements",description:"Remove all console.log, console.warn, console.error, etc. statements",complexity:"simple",wasmAvailable:!0,typicalLatencyMs:1},"promise-to-async":{type:"promise-to-async",name:"Promise to Async/Await",description:"Convert Promise .then()/.catch() chains to async/await syntax",complexity:"complex",wasmAvailable:!0,typicalLatencyMs:10},"cjs-to-esm":{type:"cjs-to-esm",name:"CommonJS to ES Modules",description:"Convert require() calls to import statements and module.exports to export",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:5},"func-to-arrow":{type:"func-to-arrow",name:"Function to Arrow",description:"Convert function declarations and expressions to arrow functions",complexity:"moderate",wasmAvailable:!0,typicalLatencyMs:3}},u={enabled:!0,fallbackToLLM:!0,confidenceThreshold:.7,transforms:[],maxFileSizeBytes:1024*1024,timeoutMs:5e3,cacheEnabled:!0,cacheTtlMs:300*1e3},t=class extends Error{constructor(e,s,o){super(e);this.code=s;this.cause=o;this.name="AgentBoosterError"}code;cause},a=class extends t{constructor(e,s,o){super(e,"TRANSFORM_ERROR",o);this.transformType=s;this.name="TransformError"}transformType},i=class extends t{constructor(r="WASM module is not available",e){super(r,"WASM_UNAVAILABLE",e),this.name="WasmUnavailableError"}},c=class extends t{constructor(e,s,o){super(e,"TRANSFORM_TIMEOUT");this.transformType=s;this.timeoutMs=o;this.name="TransformTimeoutError"}transformType;timeoutMs},m=class extends t{constructor(e,s,o){super(`File ${e} is too large (${s} bytes, max ${o} bytes)`,"FILE_TOO_LARGE");this.filePath=e;this.sizeBytes=s;this.maxSizeBytes=o;this.name="FileTooLargeError"}filePath;sizeBytes;maxSizeBytes};export{l as a,p as b,u as c,a as d,i as e,c as f,m as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
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 o=!1;function r(t){if(!o){for(let e of["ALTER TABLE routing_outcomes ADD COLUMN exploration INTEGER NOT NULL DEFAULT 0","ALTER TABLE routing_outcomes ADD COLUMN criticality REAL","ALTER TABLE routing_outcomes ADD COLUMN q_weight REAL"])try{t.prepare(e).run()}catch{}try{t.prepare("CREATE INDEX IF NOT EXISTS idx_routing_outcomes_exploration ON routing_outcomes(exploration)").run()}catch{}o=!0}}export{r as a};
|
|
@@ -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 _}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 _}from"./chunk-XH4JMX5O.js";function p(e){return g.has(e)}function m(e){return l.has(e)}function b(e){return/^qe-security|^qe-pentest/.test(e)}function E(e,t="strict"){if(t==="off")return{text:e,redactions:[],replacementCount:0};let r=e,n=new Set,c=0;for(let a of d){if(!a.modes.includes(t))continue;let i=new RegExp(a.regex.source,a.regex.flags),s=r.match(i);s&&s.length>0&&(n.add(a.category),c+=s.length,r=r.replace(i,a.replacement))}return{text:r,redactions:Array.from(n).sort(),replacementCount:c}}function y(e,t,r){if(b(e)&&!m(t))throw new o(`Security agent "${e}" may only use providers: ${[...l].join(", ")}. Got: "${t}". OpenRouter is excluded (third-party proxy risk).`,6);if(r==="off"&&!p(t))throw new o(`Redaction mode "off" is only allowed for self-hosted providers (${[...g].join(", ")}). Got: "${t}".`,6)}var d,g,l,o,A=_(()=>{"use strict";d=[{category:"aws_key",regex:/\b(AKIA[0-9A-Z]{16})\b/g,replacement:"<REDACTED:aws_key>",modes:["strict","balanced"]},{category:"env_value",regex:/^([A-Z][A-Z0-9_]{2,})=(.+)$/gm,replacement:"$1=<REDACTED:env_value>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(Authorization:\s*(?:Bearer|Token)\s+)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"api_key_header",regex:/(x-api-key:\s*)\S+/gi,replacement:"$1<REDACTED:api_key>",modes:["strict","balanced"]},{category:"private_key",regex:/-----BEGIN\s[\w\s]*PRIVATE KEY-----(?:[\s\S]*?-----END\s[\w\s]*PRIVATE KEY-----|[\s\S]*)/g,replacement:"<REDACTED:private_key>",modes:["strict","balanced"]},{category:"jwt",regex:/\beyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,replacement:"<REDACTED:jwt>",modes:["strict","balanced"]},{category:"github_token",regex:/\b(ghp_|gho_|ghs_|ghr_|github_pat_)[A-Za-z0-9_]{16,}\b/g,replacement:"<REDACTED:github_token>",modes:["strict","balanced"]},{category:"gitlab_token",regex:/\b(glpat-)[A-Za-z0-9_-]{20,}\b/g,replacement:"<REDACTED:gitlab_token>",modes:["strict","balanced"]},{category:"slack_token",regex:/\b(xoxb-|xoxp-|xoxs-|xoxa-)[A-Za-z0-9-]{10,}\b/g,replacement:"<REDACTED:slack_token>",modes:["strict","balanced"]},{category:"huggingface_token",regex:/\bhf_[A-Za-z0-9]{30,}\b/g,replacement:"<REDACTED:huggingface_token>",modes:["strict","balanced"]},{category:"npm_token",regex:/\bnpm_[A-Za-z0-9]{36,}\b/g,replacement:"<REDACTED:npm_token>",modes:["strict","balanced"]},{category:"cognitum_key",regex:/\bcog_[A-Za-z0-9-]{20,}(?!\w)/g,replacement:"<REDACTED:cognitum_key>",modes:["strict","balanced"]},{category:"stripe_key",regex:/\b(sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_)[A-Za-z0-9]{10,}\b/g,replacement:"<REDACTED:stripe_key>",modes:["strict","balanced"]},{category:"google_api_key",regex:/\bAIzaSy[A-Za-z0-9_-]{33}\b/g,replacement:"<REDACTED:google_api_key>",modes:["strict","balanced"]},{category:"aws_session_token",regex:/\bASIA[0-9A-Z]{16}\b/g,replacement:"<REDACTED:aws_session_token>",modes:["strict","balanced"]},{category:"connection_string",regex:/\b(mongodb(\+srv)?|postgres(ql)?|mysql|redis|amqp):\/\/[^\s"']+/gi,replacement:"<REDACTED:connection_string>",modes:["strict","balanced"]},{category:"generic_secret",regex:/\b(password|secret|token|apikey|api_key|access_key|secret_key)\s*[:=]\s*['"]?(?!ghp_|gho_|ghs_|ghr_|github_pat_|glpat-|xoxb-|xoxp-|xoxs-|xoxa-|sk_live_|pk_live_|sk_test_|pk_test_|rk_live_|rk_test_|AIzaSy|AKIA|ASIA|<REDACTED:)[^\s'"]{8,}['"]?/gi,replacement:"<REDACTED:generic_secret>",modes:["strict","balanced"]},{category:"email",regex:/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,replacement:"<REDACTED:pii_email>",modes:["strict"]},{category:"phone",regex:/\b(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g,replacement:"<REDACTED:pii_phone>",modes:["strict"]},{category:"ssn",regex:/\b\d{3}-\d{2}-\d{4}\b/g,replacement:"<REDACTED:pii_ssn>",modes:["strict"]}],g=new Set(["ollama"]),l=new Set(["claude","ollama"]);o=class extends Error{constructor(r,n){super(r);this.exitCode=n;this.name="AdvisorRedactionError"}exitCode}});export{p as a,E as b,y as c,A as d};
|
|
@@ -1,10 +1,10 @@
|
|
|
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{c as
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.15");process.exit(0)}
|
|
2
|
+
import{c as I,d as _}from"./chunk-C5CXL3JP.js";import{b as me}from"./chunk-J3FP5UGL.js";import{a as b}from"./chunk-7ACCBHRB.js";import{a as de,b as pe}from"./chunk-6KCSKGVY.js";import{e as ue,f as ge}from"./chunk-KCQNFBBR.js";import{b as S,d as le}from"./chunk-XWIAZG3C.js";import{b as ce,c as $,e as qe}from"./chunk-5G4UFTV4.js";import{a as ae}from"./chunk-LJMYRTJ7.js";import{a as k,e as L}from"./chunk-HL2ANKN3.js";var Te={M:16,efConstruction:200,efSearch:100},M={enabled:!0,pretrainedPatterns:!0,hnswConfig:Te,promotionThreshold:ue,qualityThreshold:ge,embeddingModel:"auto"},Q={mode:"hybrid",confidenceThreshold:.7,feedbackEnabled:!0,cacheEnabled:!0,cacheTTLMs:300*1e3},V={enabled:["pattern-consolidator","coverage-gap-scanner","flaky-test-detector","routing-accuracy-monitor"],intervals:{"pattern-consolidator":1800*1e3,"coverage-gap-scanner":3600*1e3,"flaky-test-detector":7200*1e3,"routing-accuracy-monitor":900*1e3},maxConcurrent:4,daemonAutoStart:!0},G={claudeCode:!0,preCommit:!1,ciIntegration:!1},W={install:!0,installV2:!0,installV3:!0,overwrite:!1},B={enabled:!0,parameters:["hnsw.efSearch","routing.confidenceThreshold","pattern.promotionThreshold","testGen.complexityLimit"],tuningIntervalMs:10080*60*1e3,evaluationPeriodMs:5e3};var q=ae.filter(r=>r!=="coordination");function U(){return"3.15.15"}function gt(r,e){return{version:U(),project:{name:r,root:e,type:"single"},learning:structuredClone(M),routing:structuredClone(Q),workers:structuredClone(V),hooks:structuredClone(G),skills:structuredClone(W),autoTuning:structuredClone(B),domains:{enabled:[...q],disabled:[]},agents:{maxConcurrent:15,defaultTimeout:6e4}}}le();import{readFileSync as w,existsSync as p,statSync as Pe,readdirSync as Ne}from"fs";import{join as d,basename as fe,extname as ye,relative as z}from"path";var Oe=[{name:"jest",detect:r=>{let e=["jest.config.js","jest.config.ts","jest.config.mjs","jest.config.cjs"];for(let n of e)if(p(d(r,n)))return{name:"jest",version:x(r,"jest"),configFile:n,confidence:1};let t=A(r);return t?.jest?{name:"jest",version:x(r,"jest"),configFile:"package.json",confidence:.9}:t?.devDependencies?.jest||t?.dependencies?.jest?{name:"jest",version:t.devDependencies?.jest||t.dependencies?.jest,confidence:.7}:null}},{name:"vitest",detect:r=>{let e=["vitest.config.ts","vitest.config.js","vitest.config.mts","vite.config.ts"];for(let n of e)if(p(d(r,n)))return{name:"vitest",version:x(r,"vitest"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.vitest||t?.dependencies?.vitest?{name:"vitest",version:t.devDependencies?.vitest,confidence:.8}:null}},{name:"mocha",detect:r=>{let e=[".mocharc.js",".mocharc.json",".mocharc.yaml",".mocharc.yml"];for(let n of e)if(p(d(r,n)))return{name:"mocha",version:x(r,"mocha"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.mocha?{name:"mocha",version:t.devDependencies?.mocha,confidence:.8}:null}},{name:"pytest",detect:r=>{let e=["pytest.ini","pyproject.toml","setup.cfg"];for(let n of e){let i=d(r,n);if(p(i))try{let s=w(i,"utf-8");if(s.includes("[pytest]")||s.includes("[tool.pytest]"))return{name:"pytest",configFile:n,confidence:1}}catch(s){console.debug("[ProjectAnalyzer] Config read failed:",s instanceof Error?s.message:s)}}let t=d(r,"requirements.txt");if(p(t))try{if(w(t,"utf-8").includes("pytest"))return{name:"pytest",configFile:"requirements.txt",confidence:.8}}catch(n){console.debug("[ProjectAnalyzer] requirements.txt read failed:",n instanceof Error?n.message:n)}return null}},{name:"playwright",detect:r=>{let e=["playwright.config.ts","playwright.config.js"];for(let n of e)if(p(d(r,n)))return{name:"playwright",version:x(r,"@playwright/test"),configFile:n,confidence:1};let t=A(r);return t?.devDependencies?.["@playwright/test"]?{name:"playwright",version:t.devDependencies["@playwright/test"],confidence:.8}:null}},{name:"cypress",detect:r=>{let e=["cypress.config.ts","cypress.config.js","cypress.json"];for(let t of e)if(p(d(r,t)))return{name:"cypress",version:x(r,"cypress"),configFile:t,confidence:1};return p(d(r,"cypress"))?{name:"cypress",configFile:"cypress/",confidence:.9}:null}}],Fe=[{name:"typescript",extensions:[".ts",".tsx",".mts",".cts"]},{name:"javascript",extensions:[".js",".jsx",".mjs",".cjs"]},{name:"python",extensions:[".py",".pyw"]},{name:"java",extensions:[".java"]},{name:"go",extensions:[".go"]},{name:"rust",extensions:[".rs"]},{name:"csharp",extensions:[".cs"]},{name:"ruby",extensions:[".rb"]},{name:"php",extensions:[".php"]},{name:"kotlin",extensions:[".kt",".kts"]},{name:"swift",extensions:[".swift"]}];function A(r){let e=d(r,"package.json");if(!p(e))return null;try{return S(w(e,"utf-8"))}catch{return null}}function x(r,e){let t=A(r);if(t)return t.devDependencies?.[e]||t.dependencies?.[e]}var Le=["node_modules",".git","dist","build","coverage",".next","__pycache__",".agentic-qe",".claude",".agents",".codex",".opencode",".kiro",".cursor",".roo",".kilocode",".windsurf",".continue",".clinerules",".swarm",".claude-flow",".hive-mind"];function H(r,e,t={}){let{maxDepth:n=10,exclude:i=Le}=t;function s(o,a){if(a>n)return;let c;try{c=Ne(o)}catch{return}for(let u of c){if(i.includes(u))continue;let l=d(o,u),j;try{j=Pe(l)}catch{continue}j.isDirectory()?s(l,a+1):j.isFile()&&e(l)}}s(r,0)}var K=class{projectRoot;constructor(e){this.projectRoot=e}async analyze(){let e=Date.now(),[t,n,i,s,o]=await Promise.all([this.detectFrameworks(),this.detectLanguages(),this.detectExistingTests(),this.analyzeComplexity(),this.measureCoverage()]);return{projectName:A(this.projectRoot)?.name||fe(this.projectRoot),projectRoot:this.projectRoot,projectType:this.detectProjectType(),frameworks:t,languages:n,existingTests:i,codeComplexity:s,coverage:o,packageManager:this.detectPackageManager(),hasTypeScript:p(d(this.projectRoot,"tsconfig.json")),hasCIConfig:this.detectCIConfig(),ciProvider:this.detectCIProvider(),analysisTimestamp:new Date,analysisDurationMs:Date.now()-e}}async detectFrameworks(){let e=[];for(let t of Oe){let n=t.detect(this.projectRoot);n&&e.push(n)}return e.sort((t,n)=>n.confidence-t.confidence)}async detectLanguages(){let e=new Map,t=0;H(this.projectRoot,i=>{let s=ye(i).toLowerCase();if(s){for(let o of Fe)if(o.extensions.includes(s)){let a=e.get(o.name)||{count:0,extensions:new Set};a.count++,a.extensions.add(s),e.set(o.name,a),t++;break}}});let n=[];for(let[i,s]of e)n.push({name:i,percentage:t>0?Math.round(s.count/t*100):0,fileCount:s.count,extensions:Array.from(s.extensions)});return n.sort((i,s)=>s.fileCount-i.fileCount)}async detectExistingTests(){let e={totalCount:0,byFramework:{},byType:{unit:0,integration:0,e2e:0,unknown:0},directories:[]},t=new Set,n=[/\.test\.[jt]sx?$/,/\.spec\.[jt]sx?$/,/_test\.[jt]sx?$/,/test_.*\.py$/,/.*_test\.py$/,/.*_test\.go$/,/.*Test\.java$/];return H(this.projectRoot,i=>{let s=fe(i);if(n.some(a=>a.test(s))){e.totalCount++;let a=z(this.projectRoot,i).toLowerCase();a.includes("e2e")||a.includes("cypress")||a.includes("playwright")?e.byType.e2e++:a.includes("integration")||a.includes("int-test")?e.byType.integration++:a.includes("unit")||a.includes("__tests__")||a.includes("test/")?e.byType.unit++:e.byType.unknown++;let c=z(this.projectRoot,d(i,".."));t.add(c)}}),e.directories=Array.from(t).slice(0,10),e}async analyzeComplexity(){let e=[],t=[],n=0,i=0;H(this.projectRoot,a=>{let c=ye(a);if([".ts",".tsx",".js",".jsx",".py",".java",".go"].includes(c))try{let u=w(a,"utf-8"),l=this.calculateFileComplexity(u,c);t.push(...l.functionComplexities),l.maxComplexity>n&&(n=l.maxComplexity),i++,l.maxComplexity>10&&e.push(z(this.projectRoot,a))}catch(u){console.debug("[ProjectAnalyzer] Complexity analysis read failed:",u instanceof Error?u.message:u)}});let s=t.reduce((a,c)=>a+c,0),o=t.length>0?s/t.length:0;return{averageCyclomatic:Math.round(o*10)/10,maxCyclomatic:n,totalFiles:i,complexFiles:e.slice(0,20),recommendation:o<5?"simple":o<15?"medium":"complex"}}calculateFileComplexity(e,t){let n=this.stripCommentsAndStrings(e,t),i=this.calculateComplexity(n);return{functionComplexities:[i],maxComplexity:i}}removeDelimitedBlocks(e,t,n){let i="",s=0;for(;s<e.length;){let o=e.indexOf(t,s);if(o===-1){i+=e.slice(s);break}i+=e.slice(s,o);let a=e.indexOf(n,o+t.length);if(a===-1)break;s=a+n.length}return i}stripCommentsAndStrings(e,t){let n=e;return[".ts",".tsx",".js",".jsx",".java",".go"].includes(t)?(n=n.split(`
|
|
3
3
|
`).map(i=>{let s=i.indexOf("//");return s>=0?i.slice(0,s):i}).join(`
|
|
4
4
|
`),n=this.removeDelimitedBlocks(n,"/*","*/"),n=this.removeDelimitedBlocks(n,"`","`"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")):t===".py"&&(n=n.split(`
|
|
5
5
|
`).map(i=>{let s=i.indexOf("#");return s>=0?i.slice(0,s):i}).join(`
|
|
6
|
-
`),n=this.removeDelimitedBlocks(n,'"""','"""'),n=this.removeDelimitedBlocks(n,"'''","'''"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")),n}calculateComplexity(e){let t=1,n=[{pattern:/(?<![a-zA-Z])if\s*\(/g,name:"if"},{pattern:/\bfor\s*\(/g,name:"for"},{pattern:/\bwhile\s*\(/g,name:"while"},{pattern:/\bcase\s+[^:]+:/g,name:"case"},{pattern:/\bcatch\s*\(/g,name:"catch"},{pattern:/&&/g,name:"&&"},{pattern:/\|\|/g,name:"||"},{pattern:/\?[^?:]+:/g,name:"ternary"},{pattern:/\belif\s+/g,name:"elif"},{pattern:/\bexcept\s*(?:\w+)?:/g,name:"except"},{pattern:/\bfor\s+\w+\s+in\s+/g,name:"for-in"},{pattern:/\bselect\s*\{/g,name:"select"}];for(let{pattern:i}of n){let s=e.match(i);s&&(t+=s.length)}return t}async measureCoverage(){let e=["coverage/lcov-report/index.html","coverage/coverage-summary.json","coverage/clover.xml","coverage/lcov.info","htmlcov/index.html"];for(let t of e){let n=d(this.projectRoot,t);if(p(n)){if(t.endsWith(".json"))try{let s=S(w(n,"utf-8")).total||{};return{lines:s.lines?.pct||0,branches:s.branches?.pct||0,functions:s.functions?.pct||0,statements:s.statements?.pct||0,hasReport:!0,reportPath:t}}catch(i){console.debug("[ProjectAnalyzer] Coverage report parse failed:",i instanceof Error?i.message:i)}return{lines:0,branches:0,functions:0,statements:0,hasReport:!0,reportPath:t}}}return{lines:0,branches:0,functions:0,statements:0,hasReport:!1}}detectProjectType(){if(p(d(this.projectRoot,"lerna.json"))||p(d(this.projectRoot,"pnpm-workspace.yaml"))||p(d(this.projectRoot,"packages")))return"monorepo";let e=A(this.projectRoot);return e?.workspaces?"monorepo":e?.main||e?.module||e?.exports?"library":"single"}detectPackageManager(){return p(d(this.projectRoot,"bun.lockb"))?"bun":p(d(this.projectRoot,"pnpm-lock.yaml"))?"pnpm":p(d(this.projectRoot,"yarn.lock"))?"yarn":p(d(this.projectRoot,"package-lock.json"))?"npm":"unknown"}detectCIConfig(){return[".github/workflows",".gitlab-ci.yml","Jenkinsfile",".circleci/config.yml",".travis.yml","azure-pipelines.yml"].some(t=>p(d(this.projectRoot,t)))}detectCIProvider(){if(p(d(this.projectRoot,".github/workflows")))return"github-actions";if(p(d(this.projectRoot,".gitlab-ci.yml")))return"gitlab-ci";if(p(d(this.projectRoot,"Jenkinsfile")))return"jenkins";if(p(d(this.projectRoot,".circleci/config.yml")))return"circleci";if(this.detectCIConfig())return"other"}};function pt(r){return new H(r)}var fe=[{name:"typescript-vitest",condition:r=>r.hasTypeScript&&r.frameworks.some(e=>e.name==="vitest"),apply:r=>{r.learning.embeddingModel="transformer",r.routing.confidenceThreshold=.75}},{name:"large-codebase",condition:r=>r.codeComplexity.totalFiles>500,apply:r=>{r.learning.hnswConfig.M=32,r.learning.hnswConfig.efConstruction=400,r.learning.hnswConfig.efSearch=200,r.agents.maxConcurrent=15}},{name:"small-project",condition:r=>r.codeComplexity.totalFiles<50,apply:r=>{r.learning.hnswConfig.M=8,r.learning.hnswConfig.efConstruction=100,r.workers.enabled=["pattern-consolidator","routing-accuracy-monitor"],r.workers.maxConcurrent=2,r.agents.maxConcurrent=5}},{name:"high-complexity",condition:r=>r.codeComplexity.recommendation==="complex",apply:r=>{r.autoTuning.parameters.push("complexity.analysisDepth"),r.domains.enabled=[..._]}},{name:"low-coverage",condition:r=>r.coverage.hasReport&&r.coverage.lines<50,apply:r=>{r.workers.enabled.push("coverage-gap-scanner"),r.workers.intervals["coverage-gap-scanner"]=1800*1e3}},{name:"monorepo",condition:r=>r.projectType==="monorepo",apply:r=>{r.agents.maxConcurrent=15,r.workers.maxConcurrent=6,r.domains.enabled=[...new Set([...r.domains.enabled,"code-intelligence"])]}},{name:"has-e2e",condition:r=>r.frameworks.some(e=>["playwright","cypress"].includes(e.name))||r.existingTests.byType.e2e>0,apply:r=>{r.domains.enabled=[...new Set([...r.domains.enabled,"visual-accessibility","chaos-resilience"])]}},{name:"has-ci",condition:r=>r.hasCIConfig,apply:r=>{r.hooks.ciIntegration=!0,r.domains.enabled=[...new Set([...r.domains.enabled,"quality-assessment"])]}},{name:"github-actions",condition:r=>r.ciProvider==="github-actions",apply:r=>{r.hooks.ciIntegration=!0,r.hooks.claudeCode=!0}},{name:"python-project",condition:r=>r.languages.some(e=>e.name==="python"&&e.percentage>30),apply:r=>{r.routing.mode="hybrid",r.domains.enabled=[...new Set([...r.domains.enabled,"security-compliance"])]}},{name:"java-project",condition:r=>r.languages.some(e=>e.name==="java"&&e.percentage>30),apply:r=>{r.agents.defaultTimeout=12e4}},{name:"no-tests",condition:r=>r.existingTests.totalCount===0,apply:r=>{r.workers.enabled=["pattern-consolidator"]}},{name:"many-tests",condition:r=>r.existingTests.totalCount>500,apply:r=>{r.workers.enabled=[...new Set([...r.workers.enabled,"flaky-test-detector"])],r.domains.enabled=[...new Set([...r.domains.enabled,"test-execution"])]}},{name:"security-focus",condition:r=>r.codeComplexity.totalFiles>100,apply:r=>{r.domains.enabled=[...new Set([...r.domains.enabled,"security-compliance"])]}}],K=class{rules;constructor(e={}){this.rules=e.minimal?fe.filter(t=>["typescript-vitest","large-codebase","small-project"].includes(t.name)):[...fe,...e.customRules||[]]}recommend(e){let t={version:B(),project:{name:e.projectName,root:e.projectRoot,type:e.projectType==="unknown"?"single":e.projectType},learning:this.recommendLearning(e),routing:this.recommendRouting(e),workers:this.recommendWorkers(e),hooks:this.recommendHooks(e),skills:this.recommendSkills(e),autoTuning:this.recommendAutoTuning(e),domains:{enabled:this.recommendDomains(e),disabled:[]},agents:{maxConcurrent:this.recommendMaxAgents(e),defaultTimeout:6e4}},n=[];for(let i of this.rules)i.condition(e)&&(i.apply(t,e),n.push(i.name));return t.domains.enabled=[...new Set(t.domains.enabled)],t.workers.enabled=[...new Set(t.workers.enabled)],t}getApplicableRules(e){return this.rules.filter(t=>t.condition(e)).map(t=>t.name)}recommendLearning(e){let t=structuredClone($);return e.codeComplexity.totalFiles>1e3?t.hnswConfig={M:32,efConstruction:400,efSearch:200}:e.codeComplexity.totalFiles<100&&(t.hnswConfig={M:8,efConstruction:100,efSearch:50}),e.languages.some(n=>["typescript","javascript"].includes(n.name))&&(t.embeddingModel="transformer"),t}recommendRouting(e){let t=structuredClone(M);return e.codeComplexity.recommendation==="simple"?t.mode="rules":e.codeComplexity.recommendation==="complex"?t.mode="ml":t.mode="hybrid",t}recommendWorkers(e){let t=structuredClone(Q),n=new Set(["pattern-consolidator","routing-accuracy-monitor"]);return(!e.coverage.hasReport||e.coverage.lines<70)&&n.add("coverage-gap-scanner"),e.existingTests.totalCount>100&&n.add("flaky-test-detector"),t.enabled=Array.from(n),e.codeComplexity.totalFiles>500?t.maxConcurrent=6:e.codeComplexity.totalFiles<50&&(t.maxConcurrent=2),t}recommendHooks(e){let t=structuredClone(V);return t.ciIntegration=e.hasCIConfig,t.preCommit=e.existingTests.totalCount>50,t}recommendSkills(e){let t=structuredClone(G);return t.install=!0,t.installV2=!0,t.installV3=!0,t}recommendAutoTuning(e){let t=structuredClone(W);return e.codeComplexity.totalFiles<20&&(t.enabled=!1),t}recommendDomains(e){return[..._]}recommendMaxAgents(e){return e.projectType==="monorepo"?15:e.codeComplexity.totalFiles>500?12:e.codeComplexity.totalFiles>100?8:5}};function yt(r){return new K(r)}Ee();import{existsSync as ye,readFileSync as Oe,writeFileSync as Fe}from"fs";function bt(r){if(!ye(r))return null;let e=`${r}.backup`;if(ye(e))return null;try{return Fe(e,Oe(r,"utf-8"),"utf-8"),e}catch{return null}}var Le=[/\baqe\b/i,/\bagentic-qe\b/i,/\bnpx\s+agentic-qe\b/i,/\bnpx\s+@anthropics\/agentic-qe\b/i,/aqe-hook\.cjs/i,/brain-checkpoint\.cjs/i,/statusline-v3\.cjs/i];function $e(r){let e=r;return!e?.hooks||!Array.isArray(e.hooks)?!1:e.hooks.some(t=>!t.command||typeof t.command!="string"?!1:Le.some(n=>n.test(t.command)))}function At(r,e){let t={};for(let[n,i]of Object.entries(e)){let s=ae(r,n)||[],o=Array.isArray(s)?s.filter(a=>!$e(a)):[];L(t,n,[...i,...o])}for(let[n,i]of Object.entries(r))Object.hasOwn(t,n)||L(t,n,i);return t}function St(r,e,t={}){let n={...e,...r||{}};if(t.memoryBackend==="memory"){for(let i of["AQE_MEMORY_PATH","AQE_V3_REASONING_BANK"])n[i]===".agentic-qe/memory.db"&&delete n[i];n.AQE_MEMORY_BACKEND="memory",n.AQE_LEARNING_ENABLED="false",n.AQE_WORKERS_ENABLED="false"}else if(r?.AQE_MEMORY_BACKEND==="memory")for(let i of["AQE_MEMORY_BACKEND","AQE_LEARNING_ENABLED","AQE_WORKERS_ENABLED"])Object.prototype.hasOwnProperty.call(e,i)?n[i]=e[i]:delete n[i];return n}function xt(r,e={}){let t=r.domains?.enabled||[],n=e.memoryBackend==="memory";return{...n?{AQE_MEMORY_BACKEND:"memory",AQE_WORKERS_ENABLED:"false"}:{AQE_MEMORY_PATH:".agentic-qe/memory.db"},AQE_MEMORY_ENABLED:"true",AQE_LEARNING_ENABLED:n?"false":r.learning?.enabled?"true":"false",AQE_V3_MODE:"true",AQE_V3_DDD_ENABLED:"true",AQE_V3_DOMAINS:t.join(","),AQE_V3_SWARM_SIZE:String(r.agents?.maxConcurrent??15),AQE_V3_TOPOLOGY:"hierarchical",AQE_V3_SUBLINEAR_ENABLED:"true",AQE_V3_HNSW_ENABLED:r.learning?.hnswConfig?"true":"false",AQE_V3_HOOKS_ENABLED:"true",AQE_V3_AISP_ENABLED:"true",...n?{}:{AQE_V3_REASONING_BANK:".agentic-qe/memory.db"},AQE_V3_PATTERN_PROMOTION_THRESHOLD:String(r.learning?.promotionThreshold??3),AQE_V3_SUCCESS_RATE_THRESHOLD:String(r.learning?.qualityThreshold??.7)}}function he(r){let e=r?.command;return typeof e=="string"&&/statusline-v3\.cjs|Agentic QE v3/.test(e)}function ke(r,e){if(!ve(r)||!ve(e))return e;let t={...r};for(let[n,i]of Object.entries(e))t[n]=ke(t[n],i);return t}function ve(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function Ct(r,e,t={}){for(let[n,i]of Object.entries(e))if(n==="_aqePermissions"){let s=r.permissions||{},o=s.allow||[],a=[...new Set([...o,...i])];r.permissions={...s,allow:a}}else if(n==="statusLine"){if(t.statusLine===!1){he(r.statusLine)&&delete r.statusLine;continue}(r.statusLine===void 0||he(r.statusLine))&&(r.statusLine=i)}else n==="includeCoAuthoredBy"?r.includeCoAuthoredBy===void 0&&(r.includeCoAuthoredBy=i):r[n]=ke(r[n],i);if(t.memoryBackend==="memory"){let n=r.v3Learning;n?.reasoningBank&&delete n.reasoningBank.dbPath}return r}function wt(r,e,t={}){let n=r.domains?.enabled||[],i=t.memoryBackend==="memory";return{aqe:{version:r.version??"3.0.0",initialized:new Date().toISOString(),hooksConfigured:!0},statusLine:{type:"command",command:`sh -c 'node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/statusline-v3.cjs" 2>/dev/null || echo "\u258A Agentic QE v3"'`},_aqePermissions:["Bash(npx agentic-qe:*)","Bash(npx @anthropics/agentic-qe:*)","mcp__agentic-qe__*"],includeCoAuthoredBy:!0,v3Configuration:{domains:{total:n.length,names:n},swarm:{totalAgents:r.agents?.maxConcurrent??15,topology:"hierarchical",coordination:"queen-led"}},v3Learning:{enabled:i?!1:r.learning?.enabled??!0,reasoningBank:{...i?{}:{dbPath:".agentic-qe/memory.db"},enableHNSW:!!r.learning?.hnswConfig},patternPromotion:{threshold:r.learning?.promotionThreshold??3,successRateMin:r.learning?.qualityThreshold??.7}}}}oe();import{readFileSync as be}from"fs";import{homedir as Me}from"os";import{join as D}from"path";var Qe="agentic-qe-fleet";function Ve(r,e={}){let t=e.env??process.env,n=t.CLAUDE_CONFIG_DIR?.trim()?t.CLAUDE_CONFIG_DIR.trim():D(e.homeDir??Me(),".claude");return[{scope:"user",path:D(n,"settings.json")},{scope:"project",path:D(r,".claude","settings.json")},{scope:"local",path:D(r,".claude","settings.local.json")}]}function Ge(r){try{let e=S(be(r,"utf-8"));if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.enabledPlugins;return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function We(r){let e=r.lastIndexOf("@");return(e===-1?r:r.slice(0,e))===Qe&&e>0&&e<r.length-1}function _t(r,e={}){try{let t=new Map;for(let{scope:n,path:i}of Ve(r,e)){let s=Ge(i);if(s)for(let[o,a]of Object.entries(s))We(o)&&t.set(o,{value:a,scope:n,path:i})}for(let[n,i]of t)if(i.value===!0)return{enabled:!0,pluginKey:n,scope:i.scope,settingsPath:i.path}}catch{}return{enabled:!1}}var Be=" MCP: skipped \u2014 the agentic-qe-fleet plugin already provides the AQE MCP server (mcp__plugin_agentic-qe-fleet_agentic-qe__* tools); run `aqe init --with-mcp` to add the project entry anyway",Ue=" MCP: kept the existing project `agentic-qe` entry in .mcp.json \u2014 it duplicates the agentic-qe-fleet plugin's AQE MCP server (mcp__plugin_agentic-qe-fleet_agentic-qe__* tools); to remove it, delete the `agentic-qe` key from .mcp.json or run `claude mcp remove agentic-qe -s project`";function ze(r){try{let e=S(be(D(r,".mcp.json"),"utf-8"));if(!e||typeof e!="object")return!1;let t=e.mcpServers;return!!t&&typeof t=="object"&&!Array.isArray(t)&&Object.prototype.hasOwnProperty.call(t,"agentic-qe")}catch{return!1}}function qt(r){return ze(r)?Ue:Be}F();import{existsSync as y,mkdirSync as q,readdirSync as T,statSync as J,readFileSync as He,copyFileSync as Ke,unlinkSync as Je,rmdirSync as Ye}from"fs";import{join as m}from"path";var Y=["qe-test-generation","qe-test-execution","qe-coverage-analysis","qe-quality-assessment","qe-defect-intelligence","qe-requirements-validation","qe-code-intelligence","qe-browser","pentest-validation","qe-visual-accessibility","qe-chaos-resilience","qe-learning-optimization","qe-court","qe-iterative-loop","strict-tdd","no-skip","coverage-guard","freeze-tests","security-watch","skill-stats","test-failure-investigator","coverage-drop-investigator","e2e-flow-verifier","test-metrics-dashboard"],X=["v3-core-implementation","v3-cli-modernization","v3-ddd-architecture","v3-integration-deep","v3-mcp-optimization","v3-memory-unification","v3-performance-optimization","v3-security-overhaul","v3-swarm-coordination","v3-qe-core-implementation","v3-qe-ddd-architecture","v3-qe-cli","v3-qe-memory-system","v3-qe-performance","v3-qe-security","v3-qe-mcp","v3-qe-mcp-optimization","v3-qe-memory-unification","v3-qe-integration","v3-qe-agentic-flow-integration","v3-qe-fleet-coordination","agentdb-advanced","agentdb-learning","agentdb-memory-patterns","agentdb-optimization","agentdb-vector-search","github-code-review","github-multi-repo","github-project-management","github-release-management","github-workflow-automation","flow-nexus-neural","flow-nexus-platform","flow-nexus-swarm","reasoningbank-agentdb","reasoningbank-intelligence","swarm-orchestration","swarm-advanced","sparc-methodology","hooks-automation","hive-mind-advanced","stream-chain","agentic-jujutsu","iterative-loop","performance-analysis","skill-builder","qe-agentic-flow-integration","release"],Xe=["qe-contract-testing","qe-security-compliance","aqe-v2-v3-migration"],Z=class{projectRoot;options;sourceSkillsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installV2Skills:!0,installV3Skills:!0,overwrite:!1,exclude:[],include:void 0,...e},this.sourceSkillsDir=this.findSourceSkillsDir()}findSourceSkillsDir(){let e=b(import.meta.url),t=[];e&&(t.push(m(e,"assets/skills")),t.push(m(e,".claude/skills"))),t.push(m(this.projectRoot,"node_modules/agentic-qe/assets/skills"));for(let n of t)if(y(n))return n;return t[0]}getSourceSkillsDir(){return this.sourceSkillsDir}async install(){let e={installed:[],skipped:[],removed:[],errors:[],totalCount:0,skillsDir:m(this.projectRoot,".claude","skills"),validationInstalled:!1};if(!y(this.sourceSkillsDir))return e.errors.push(`Source skills directory not found: ${this.sourceSkillsDir}`),e;let t=m(this.projectRoot,".claude","skills");y(t)||q(t,{recursive:!0});let n=this.getAvailableSkills();e.totalCount=n.length;let i=this.filterSkills(n);for(let s of i)try{let o=await this.installSkill(s,t);o?e.installed.push(o):e.skipped.push(s)}catch(o){e.errors.push(`Failed to install ${s}: ${k(o)}`)}return this.options.overwrite&&(e.removed=this.removeDeprecatedSkills(t)),e.validationInstalled=this.installValidationInfrastructure(t),await this.createSkillsIndex(t,e.installed),e}installValidationInfrastructure(e){let t=m(this.sourceSkillsDir,".validation"),n=m(e,".validation");if(!y(t))return console.debug("[SkillsInstaller] Validation infrastructure not found in source"),!1;if(y(n)&&!this.options.overwrite)return console.debug("[SkillsInstaller] Validation infrastructure already exists, skipping"),!0;try{return y(n)||q(n,{recursive:!0}),this.copyDirectoryRecursive(t,n),console.debug("[SkillsInstaller] Validation infrastructure installed successfully"),!0}catch(i){return console.error("[SkillsInstaller] Failed to install validation infrastructure:",i instanceof Error?i.message:i),!1}}removeDeprecatedSkills(e){let t=[];for(let n of Xe){let i=m(e,n);if(y(i))try{this.removeDirectoryRecursive(i),t.push(n)}catch(s){console.error(`[SkillsInstaller] Failed to remove deprecated skill ${n}:`,s instanceof Error?s.message:s)}}return t.length>0&&console.debug(`[SkillsInstaller] Removed ${t.length} deprecated skills: ${t.join(", ")}`),t}removeDirectoryRecursive(e){let t=T(e,{withFileTypes:!0});for(let n of t){let i=m(e,n.name);n.isDirectory()?this.removeDirectoryRecursive(i):Je(i)}Ye(e)}getAvailableSkills(){try{return T(this.sourceSkillsDir).filter(t=>{let n=m(this.sourceSkillsDir,t);return J(n).isDirectory()&&!t.startsWith(".")})}catch{return[]}}filterSkills(e){let t=e;return t=t.filter(n=>!X.includes(n)),this.options.include&&this.options.include.length>0&&(t=t.filter(n=>this.options.include.includes(n))),this.options.exclude&&this.options.exclude.length>0&&(t=t.filter(n=>!this.options.exclude.some(i=>n.includes(i)||n.match(new RegExp(i))))),this.options.installV3Skills||(t=t.filter(n=>!Y.includes(n))),this.options.installV2Skills||(t=t.filter(n=>Y.includes(n))),t}async installSkill(e,t){let n=m(this.sourceSkillsDir,e),i=m(t,e);if(y(i)&&!this.options.overwrite)return null;y(i)||q(i,{recursive:!0}),this.copyDirectoryRecursive(n,i);let s=this.getSkillType(e),o=this.getSkillDescription(i),a=y(m(i,"resources"));return{name:e,type:s,description:o,hasResources:a}}copyDirectoryRecursive(e,t){let n=T(e);for(let i of n){let s=m(e,i),o=m(t,i);J(s).isDirectory()?(y(o)||q(o,{recursive:!0}),this.copyDirectoryRecursive(s,o)):Ke(s,o)}}getSkillType(e){return Y.includes(e)?"v3-domain":"v2-methodology"}getSkillDescription(e){let t=m(e,"SKILL.md");if(y(t))try{let n=He(t,"utf-8"),i=n.match(/description:\s*["']?([^"'\n]+)["']?/i);if(i)return i[1].trim();let s=n.split(`
|
|
7
|
-
`);for(let o of s){let a=o.trim();if(a&&!a.startsWith("#")&&!a.startsWith("-")&&!a.startsWith("```"))return a.slice(0,100)+(a.length>100?"...":"")}}catch(n){console.debug("[SkillsInstaller] Failed to read skill description:",n instanceof Error?n.message:n)}}async createSkillsIndex(e,t){let n=this.scanSkillsDirectory(e),i=n.filter(l=>!
|
|
6
|
+
`),n=this.removeDelimitedBlocks(n,'"""','"""'),n=this.removeDelimitedBlocks(n,"'''","'''"),n=this.removeDelimitedBlocks(n,'"','"'),n=this.removeDelimitedBlocks(n,"'","'")),n}calculateComplexity(e){let t=1,n=[{pattern:/(?<![a-zA-Z])if\s*\(/g,name:"if"},{pattern:/\bfor\s*\(/g,name:"for"},{pattern:/\bwhile\s*\(/g,name:"while"},{pattern:/\bcase\s+[^:]+:/g,name:"case"},{pattern:/\bcatch\s*\(/g,name:"catch"},{pattern:/&&/g,name:"&&"},{pattern:/\|\|/g,name:"||"},{pattern:/\?[^?:]+:/g,name:"ternary"},{pattern:/\belif\s+/g,name:"elif"},{pattern:/\bexcept\s*(?:\w+)?:/g,name:"except"},{pattern:/\bfor\s+\w+\s+in\s+/g,name:"for-in"},{pattern:/\bselect\s*\{/g,name:"select"}];for(let{pattern:i}of n){let s=e.match(i);s&&(t+=s.length)}return t}async measureCoverage(){let e=["coverage/lcov-report/index.html","coverage/coverage-summary.json","coverage/clover.xml","coverage/lcov.info","htmlcov/index.html"];for(let t of e){let n=d(this.projectRoot,t);if(p(n)){if(t.endsWith(".json"))try{let s=S(w(n,"utf-8")).total||{};return{lines:s.lines?.pct||0,branches:s.branches?.pct||0,functions:s.functions?.pct||0,statements:s.statements?.pct||0,hasReport:!0,reportPath:t}}catch(i){console.debug("[ProjectAnalyzer] Coverage report parse failed:",i instanceof Error?i.message:i)}return{lines:0,branches:0,functions:0,statements:0,hasReport:!0,reportPath:t}}}return{lines:0,branches:0,functions:0,statements:0,hasReport:!1}}detectProjectType(){if(p(d(this.projectRoot,"lerna.json"))||p(d(this.projectRoot,"pnpm-workspace.yaml"))||p(d(this.projectRoot,"packages")))return"monorepo";let e=A(this.projectRoot);return e?.workspaces?"monorepo":e?.main||e?.module||e?.exports?"library":"single"}detectPackageManager(){return p(d(this.projectRoot,"bun.lockb"))?"bun":p(d(this.projectRoot,"pnpm-lock.yaml"))?"pnpm":p(d(this.projectRoot,"yarn.lock"))?"yarn":p(d(this.projectRoot,"package-lock.json"))?"npm":"unknown"}detectCIConfig(){return[".github/workflows",".gitlab-ci.yml","Jenkinsfile",".circleci/config.yml",".travis.yml","azure-pipelines.yml"].some(t=>p(d(this.projectRoot,t)))}detectCIProvider(){if(p(d(this.projectRoot,".github/workflows")))return"github-actions";if(p(d(this.projectRoot,".gitlab-ci.yml")))return"gitlab-ci";if(p(d(this.projectRoot,"Jenkinsfile")))return"jenkins";if(p(d(this.projectRoot,".circleci/config.yml")))return"circleci";if(this.detectCIConfig())return"other"}};function yt(r){return new K(r)}var he=[{name:"typescript-vitest",condition:r=>r.hasTypeScript&&r.frameworks.some(e=>e.name==="vitest"),apply:r=>{r.learning.embeddingModel="transformer",r.routing.confidenceThreshold=.75}},{name:"large-codebase",condition:r=>r.codeComplexity.totalFiles>500,apply:r=>{r.learning.hnswConfig.M=32,r.learning.hnswConfig.efConstruction=400,r.learning.hnswConfig.efSearch=200,r.agents.maxConcurrent=15}},{name:"small-project",condition:r=>r.codeComplexity.totalFiles<50,apply:r=>{r.learning.hnswConfig.M=8,r.learning.hnswConfig.efConstruction=100,r.workers.enabled=["pattern-consolidator","routing-accuracy-monitor"],r.workers.maxConcurrent=2,r.agents.maxConcurrent=5}},{name:"high-complexity",condition:r=>r.codeComplexity.recommendation==="complex",apply:r=>{r.autoTuning.parameters.push("complexity.analysisDepth"),r.domains.enabled=[...q]}},{name:"low-coverage",condition:r=>r.coverage.hasReport&&r.coverage.lines<50,apply:r=>{r.workers.enabled.push("coverage-gap-scanner"),r.workers.intervals["coverage-gap-scanner"]=1800*1e3}},{name:"monorepo",condition:r=>r.projectType==="monorepo",apply:r=>{r.agents.maxConcurrent=15,r.workers.maxConcurrent=6,r.domains.enabled=[...new Set([...r.domains.enabled,"code-intelligence"])]}},{name:"has-e2e",condition:r=>r.frameworks.some(e=>["playwright","cypress"].includes(e.name))||r.existingTests.byType.e2e>0,apply:r=>{r.domains.enabled=[...new Set([...r.domains.enabled,"visual-accessibility","chaos-resilience"])]}},{name:"has-ci",condition:r=>r.hasCIConfig,apply:r=>{r.hooks.ciIntegration=!0,r.domains.enabled=[...new Set([...r.domains.enabled,"quality-assessment"])]}},{name:"github-actions",condition:r=>r.ciProvider==="github-actions",apply:r=>{r.hooks.ciIntegration=!0,r.hooks.claudeCode=!0}},{name:"python-project",condition:r=>r.languages.some(e=>e.name==="python"&&e.percentage>30),apply:r=>{r.routing.mode="hybrid",r.domains.enabled=[...new Set([...r.domains.enabled,"security-compliance"])]}},{name:"java-project",condition:r=>r.languages.some(e=>e.name==="java"&&e.percentage>30),apply:r=>{r.agents.defaultTimeout=12e4}},{name:"no-tests",condition:r=>r.existingTests.totalCount===0,apply:r=>{r.workers.enabled=["pattern-consolidator"]}},{name:"many-tests",condition:r=>r.existingTests.totalCount>500,apply:r=>{r.workers.enabled=[...new Set([...r.workers.enabled,"flaky-test-detector"])],r.domains.enabled=[...new Set([...r.domains.enabled,"test-execution"])]}},{name:"security-focus",condition:r=>r.codeComplexity.totalFiles>100,apply:r=>{r.domains.enabled=[...new Set([...r.domains.enabled,"security-compliance"])]}}],J=class{rules;constructor(e={}){this.rules=e.minimal?he.filter(t=>["typescript-vitest","large-codebase","small-project"].includes(t.name)):[...he,...e.customRules||[]]}recommend(e){let t={version:U(),project:{name:e.projectName,root:e.projectRoot,type:e.projectType==="unknown"?"single":e.projectType},learning:this.recommendLearning(e),routing:this.recommendRouting(e),workers:this.recommendWorkers(e),hooks:this.recommendHooks(e),skills:this.recommendSkills(e),autoTuning:this.recommendAutoTuning(e),domains:{enabled:this.recommendDomains(e),disabled:[]},agents:{maxConcurrent:this.recommendMaxAgents(e),defaultTimeout:6e4}},n=[];for(let i of this.rules)i.condition(e)&&(i.apply(t,e),n.push(i.name));return t.domains.enabled=[...new Set(t.domains.enabled)],t.workers.enabled=[...new Set(t.workers.enabled)],t}getApplicableRules(e){return this.rules.filter(t=>t.condition(e)).map(t=>t.name)}recommendLearning(e){let t=structuredClone(M);return e.codeComplexity.totalFiles>1e3?t.hnswConfig={M:32,efConstruction:400,efSearch:200}:e.codeComplexity.totalFiles<100&&(t.hnswConfig={M:8,efConstruction:100,efSearch:50}),e.languages.some(n=>["typescript","javascript"].includes(n.name))&&(t.embeddingModel="transformer"),t}recommendRouting(e){let t=structuredClone(Q);return e.codeComplexity.recommendation==="simple"?t.mode="rules":e.codeComplexity.recommendation==="complex"?t.mode="ml":t.mode="hybrid",t}recommendWorkers(e){let t=structuredClone(V),n=new Set(["pattern-consolidator","routing-accuracy-monitor"]);return(!e.coverage.hasReport||e.coverage.lines<70)&&n.add("coverage-gap-scanner"),e.existingTests.totalCount>100&&n.add("flaky-test-detector"),t.enabled=Array.from(n),e.codeComplexity.totalFiles>500?t.maxConcurrent=6:e.codeComplexity.totalFiles<50&&(t.maxConcurrent=2),t}recommendHooks(e){let t=structuredClone(G);return t.ciIntegration=e.hasCIConfig,t.preCommit=e.existingTests.totalCount>50,t}recommendSkills(e){let t=structuredClone(W);return t.install=!0,t.installV2=!0,t.installV3=!0,t}recommendAutoTuning(e){let t=structuredClone(B);return e.codeComplexity.totalFiles<20&&(t.enabled=!1),t}recommendDomains(e){return[...q]}recommendMaxAgents(e){return e.projectType==="monorepo"?15:e.codeComplexity.totalFiles>500?12:e.codeComplexity.totalFiles>100?8:5}};function kt(r){return new J(r)}qe();import{existsSync as Y,readFileSync as ke,writeFileSync as be}from"fs";function xt(r){if(!Y(r))return null;let e=`${r}.backup`;if(Y(e))return null;try{return be(e,ke(r,"utf-8"),"utf-8"),e}catch{return null}}var $e=[/\baqe\b/i,/\bagentic-qe\b/i,/\bnpx\s+agentic-qe\b/i,/\bnpx\s+@anthropics\/agentic-qe\b/i,/aqe-hook\.cjs/i,/brain-checkpoint\.cjs/i,/statusline-v3\.cjs/i];function Me(r){let e=r;return!e?.hooks||!Array.isArray(e.hooks)?!1:e.hooks.some(t=>!t.command||typeof t.command!="string"?!1:$e.some(n=>n.test(t.command)))}function Ct(r,e){let t={};for(let[n,i]of Object.entries(e)){let s=ce(r,n)||[],o=Array.isArray(s)?s.filter(a=>!Me(a)):[];$(t,n,[...i,...o])}for(let[n,i]of Object.entries(r))Object.hasOwn(t,n)||$(t,n,i);return t}function wt(r,e,t={}){let n={...e,...r||{}};if(t.memoryBackend==="memory"){for(let i of["AQE_MEMORY_PATH","AQE_V3_REASONING_BANK"])n[i]===".agentic-qe/memory.db"&&delete n[i];n.AQE_MEMORY_BACKEND="memory",n.AQE_LEARNING_ENABLED="false",n.AQE_WORKERS_ENABLED="false"}else if(r?.AQE_MEMORY_BACKEND==="memory")for(let i of["AQE_MEMORY_BACKEND","AQE_LEARNING_ENABLED","AQE_WORKERS_ENABLED"])Object.prototype.hasOwnProperty.call(e,i)?n[i]=e[i]:delete n[i];return n}function Dt(r,e={}){let t=r.domains?.enabled||[],n=e.memoryBackend==="memory";return{...n?{AQE_MEMORY_BACKEND:"memory",AQE_WORKERS_ENABLED:"false"}:{AQE_MEMORY_PATH:".agentic-qe/memory.db"},AQE_MEMORY_ENABLED:"true",AQE_LEARNING_ENABLED:n?"false":r.learning?.enabled?"true":"false",AQE_V3_MODE:"true",AQE_V3_DDD_ENABLED:"true",AQE_V3_DOMAINS:t.join(","),AQE_V3_SWARM_SIZE:String(r.agents?.maxConcurrent??15),AQE_V3_TOPOLOGY:"hierarchical",AQE_V3_SUBLINEAR_ENABLED:"true",AQE_V3_HNSW_ENABLED:r.learning?.hnswConfig?"true":"false",AQE_V3_HOOKS_ENABLED:"true",AQE_V3_AISP_ENABLED:"true",...n?{}:{AQE_V3_REASONING_BANK:".agentic-qe/memory.db"},AQE_V3_PATTERN_PROMOTION_THRESHOLD:String(r.learning?.promotionThreshold??3),AQE_V3_SUCCESS_RATE_THRESHOLD:String(r.learning?.qualityThreshold??.7)}}function ve(r){let e=r?.command;return typeof e=="string"&&/statusline-v3\.cjs|Agentic QE v3/.test(e)}function Ae(r,e){if(!D(r)||!D(e))return e;let t={...r};for(let[n,i]of Object.entries(e))t[n]=Ae(t[n],i);return t}function D(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}var Se=/@anthropics\/agentic-qe\b/i;function Qe(r){return r.filter(e=>typeof e!="string"||!Se.test(e))}function Ve(r){let e=[];for(let[t,n]of Object.entries(r)){let{command:i,args:s}=D(n)?n:{};[i,...Array.isArray(s)?s:[]].some(a=>typeof a=="string"&&Se.test(a))&&(delete r[t],e.push(t))}return e}function Rt(r){if(!Y(r))return[];let e;try{e=JSON.parse(ke(r,"utf-8"))}catch{return[]}if(!D(e)||!D(e.mcpServers))return[];let t=Ve(e.mcpServers);return t.length>0&&be(r,JSON.stringify(e,null,2),"utf-8"),t}function Et(r,e,t={}){for(let[n,i]of Object.entries(e))if(n==="_aqePermissions"){let s=r.permissions||{},o=Qe(s.allow||[]),a=[...new Set([...o,...i])];r.permissions={...s,allow:a}}else if(n==="statusLine"){if(t.statusLine===!1){ve(r.statusLine)&&delete r.statusLine;continue}(r.statusLine===void 0||ve(r.statusLine))&&(r.statusLine=i)}else n==="includeCoAuthoredBy"?r.includeCoAuthoredBy===void 0&&(r.includeCoAuthoredBy=i):r[n]=Ae(r[n],i);if(t.memoryBackend==="memory"){let n=r.v3Learning;n?.reasoningBank&&delete n.reasoningBank.dbPath}return r}function jt(r,e,t={}){let n=r.domains?.enabled||[],i=t.memoryBackend==="memory";return{aqe:{version:r.version??"3.0.0",initialized:new Date().toISOString(),hooksConfigured:!0},statusLine:{type:"command",command:`sh -c 'node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/statusline-v3.cjs" 2>/dev/null || echo "\u258A Agentic QE v3"'`},_aqePermissions:["Bash(npx agentic-qe:*)","mcp__agentic-qe__*"],includeCoAuthoredBy:!0,v3Configuration:{domains:{total:n.length,names:n},swarm:{totalAgents:r.agents?.maxConcurrent??15,topology:"hierarchical",coordination:"queen-led"}},v3Learning:{enabled:i?!1:r.learning?.enabled??!0,reasoningBank:{...i?{}:{dbPath:".agentic-qe/memory.db"},enableHNSW:!!r.learning?.hnswConfig},patternPromotion:{threshold:r.learning?.promotionThreshold??3,successRateMin:r.learning?.qualityThreshold??.7}}}}le();import{readFileSync as xe}from"fs";import{homedir as Ge}from"os";import{join as R}from"path";var We="agentic-qe-fleet";function Be(r,e={}){let t=e.env??process.env,n=t.CLAUDE_CONFIG_DIR?.trim()?t.CLAUDE_CONFIG_DIR.trim():R(e.homeDir??Ge(),".claude");return[{scope:"user",path:R(n,"settings.json")},{scope:"project",path:R(r,".claude","settings.json")},{scope:"local",path:R(r,".claude","settings.local.json")}]}function Ue(r){try{let e=S(xe(r,"utf-8"));if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e.enabledPlugins;return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function ze(r){let e=r.lastIndexOf("@");return(e===-1?r:r.slice(0,e))===We&&e>0&&e<r.length-1}function Nt(r,e={}){try{let t=new Map;for(let{scope:n,path:i}of Be(r,e)){let s=Ue(i);if(s)for(let[o,a]of Object.entries(s))ze(o)&&t.set(o,{value:a,scope:n,path:i})}for(let[n,i]of t)if(i.value===!0)return{enabled:!0,pluginKey:n,scope:i.scope,settingsPath:i.path}}catch{}return{enabled:!1}}var He=" MCP: skipped \u2014 the agentic-qe-fleet plugin already provides the AQE MCP server (mcp__plugin_agentic-qe-fleet_agentic-qe__* tools); run `aqe init --with-mcp` to add the project entry anyway",Ke=" MCP: kept the existing project `agentic-qe` entry in .mcp.json \u2014 it duplicates the agentic-qe-fleet plugin's AQE MCP server (mcp__plugin_agentic-qe-fleet_agentic-qe__* tools); to remove it, delete the `agentic-qe` key from .mcp.json or run `claude mcp remove agentic-qe -s project`";function Je(r){try{let e=S(xe(R(r,".mcp.json"),"utf-8"));if(!e||typeof e!="object")return!1;let t=e.mcpServers;return!!t&&typeof t=="object"&&!Array.isArray(t)&&Object.prototype.hasOwnProperty.call(t,"agentic-qe")}catch{return!1}}function Ot(r){return Je(r)?Ke:He}L();import{existsSync as y,mkdirSync as T,readdirSync as P,statSync as X,readFileSync as Ye,copyFileSync as Xe,unlinkSync as Ze,rmdirSync as et}from"fs";import{join as m}from"path";var Z=["qe-test-generation","qe-test-execution","qe-coverage-analysis","qe-quality-assessment","qe-defect-intelligence","qe-requirements-validation","qe-code-intelligence","qe-browser","pentest-validation","qe-visual-accessibility","qe-chaos-resilience","qe-learning-optimization","qe-court","qe-iterative-loop","strict-tdd","no-skip","coverage-guard","freeze-tests","security-watch","skill-stats","test-failure-investigator","coverage-drop-investigator","e2e-flow-verifier","test-metrics-dashboard"],ee=["v3-core-implementation","v3-cli-modernization","v3-ddd-architecture","v3-integration-deep","v3-mcp-optimization","v3-memory-unification","v3-performance-optimization","v3-security-overhaul","v3-swarm-coordination","v3-qe-core-implementation","v3-qe-ddd-architecture","v3-qe-cli","v3-qe-memory-system","v3-qe-performance","v3-qe-security","v3-qe-mcp","v3-qe-mcp-optimization","v3-qe-memory-unification","v3-qe-integration","v3-qe-agentic-flow-integration","v3-qe-fleet-coordination","agentdb-advanced","agentdb-learning","agentdb-memory-patterns","agentdb-optimization","agentdb-vector-search","github-code-review","github-multi-repo","github-project-management","github-release-management","github-workflow-automation","flow-nexus-neural","flow-nexus-platform","flow-nexus-swarm","reasoningbank-agentdb","reasoningbank-intelligence","swarm-orchestration","swarm-advanced","sparc-methodology","hooks-automation","hive-mind-advanced","stream-chain","agentic-jujutsu","iterative-loop","performance-analysis","skill-builder","qe-agentic-flow-integration","release"],tt=["qe-contract-testing","qe-security-compliance","aqe-v2-v3-migration"],te=class{projectRoot;options;sourceSkillsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installV2Skills:!0,installV3Skills:!0,overwrite:!1,exclude:[],include:void 0,...e},this.sourceSkillsDir=this.findSourceSkillsDir()}findSourceSkillsDir(){let e=b(import.meta.url),t=[];e&&(t.push(m(e,"assets/skills")),t.push(m(e,".claude/skills"))),t.push(m(this.projectRoot,"node_modules/agentic-qe/assets/skills"));for(let n of t)if(y(n))return n;return t[0]}getSourceSkillsDir(){return this.sourceSkillsDir}async install(){let e={installed:[],skipped:[],removed:[],errors:[],totalCount:0,skillsDir:m(this.projectRoot,".claude","skills"),validationInstalled:!1};if(!y(this.sourceSkillsDir))return e.errors.push(`Source skills directory not found: ${this.sourceSkillsDir}`),e;let t=m(this.projectRoot,".claude","skills");y(t)||T(t,{recursive:!0});let n=this.getAvailableSkills();e.totalCount=n.length;let i=this.filterSkills(n);for(let s of i)try{let o=await this.installSkill(s,t);o?e.installed.push(o):e.skipped.push(s)}catch(o){e.errors.push(`Failed to install ${s}: ${k(o)}`)}return this.options.overwrite&&(e.removed=this.removeDeprecatedSkills(t)),e.validationInstalled=this.installValidationInfrastructure(t),await this.createSkillsIndex(t,e.installed),e}installValidationInfrastructure(e){let t=m(this.sourceSkillsDir,".validation"),n=m(e,".validation");if(!y(t))return console.debug("[SkillsInstaller] Validation infrastructure not found in source"),!1;if(y(n)&&!this.options.overwrite)return console.debug("[SkillsInstaller] Validation infrastructure already exists, skipping"),!0;try{return y(n)||T(n,{recursive:!0}),this.copyDirectoryRecursive(t,n),console.debug("[SkillsInstaller] Validation infrastructure installed successfully"),!0}catch(i){return console.error("[SkillsInstaller] Failed to install validation infrastructure:",i instanceof Error?i.message:i),!1}}removeDeprecatedSkills(e){let t=[];for(let n of tt){let i=m(e,n);if(y(i))try{this.removeDirectoryRecursive(i),t.push(n)}catch(s){console.error(`[SkillsInstaller] Failed to remove deprecated skill ${n}:`,s instanceof Error?s.message:s)}}return t.length>0&&console.debug(`[SkillsInstaller] Removed ${t.length} deprecated skills: ${t.join(", ")}`),t}removeDirectoryRecursive(e){let t=P(e,{withFileTypes:!0});for(let n of t){let i=m(e,n.name);n.isDirectory()?this.removeDirectoryRecursive(i):Ze(i)}et(e)}getAvailableSkills(){try{return P(this.sourceSkillsDir).filter(t=>{let n=m(this.sourceSkillsDir,t);return X(n).isDirectory()&&!t.startsWith(".")})}catch{return[]}}filterSkills(e){let t=e;return t=t.filter(n=>!ee.includes(n)),this.options.include&&this.options.include.length>0&&(t=t.filter(n=>this.options.include.includes(n))),this.options.exclude&&this.options.exclude.length>0&&(t=t.filter(n=>!this.options.exclude.some(i=>n.includes(i)||n.match(new RegExp(i))))),this.options.installV3Skills||(t=t.filter(n=>!Z.includes(n))),this.options.installV2Skills||(t=t.filter(n=>Z.includes(n))),t}async installSkill(e,t){let n=m(this.sourceSkillsDir,e),i=m(t,e);if(y(i)&&!this.options.overwrite)return null;y(i)||T(i,{recursive:!0}),this.copyDirectoryRecursive(n,i);let s=this.getSkillType(e),o=this.getSkillDescription(i),a=y(m(i,"resources"));return{name:e,type:s,description:o,hasResources:a}}copyDirectoryRecursive(e,t){let n=P(e);for(let i of n){let s=m(e,i),o=m(t,i);X(s).isDirectory()?(y(o)||T(o,{recursive:!0}),this.copyDirectoryRecursive(s,o)):Xe(s,o)}}getSkillType(e){return Z.includes(e)?"v3-domain":"v2-methodology"}getSkillDescription(e){let t=m(e,"SKILL.md");if(y(t))try{let n=Ye(t,"utf-8"),i=n.match(/description:\s*["']?([^"'\n]+)["']?/i);if(i)return i[1].trim();let s=n.split(`
|
|
7
|
+
`);for(let o of s){let a=o.trim();if(a&&!a.startsWith("#")&&!a.startsWith("-")&&!a.startsWith("```"))return a.slice(0,100)+(a.length>100?"...":"")}}catch(n){console.debug("[SkillsInstaller] Failed to read skill description:",n instanceof Error?n.message:n)}}async createSkillsIndex(e,t){let n=this.scanSkillsDirectory(e),i=n.filter(l=>!ee.includes(l.name)),s=i.filter(l=>l.type==="v2-methodology"),o=i.filter(l=>l.type==="v3-domain"),a=n.filter(l=>ee.includes(l.name)),c=y(m(e,".validation")),u=`# AQE Skills Index
|
|
8
8
|
|
|
9
9
|
This directory contains Quality Engineering skills managed by Agentic QE.
|
|
10
10
|
|
|
@@ -54,11 +54,11 @@ See \`.validation/README.md\` for usage instructions.
|
|
|
54
54
|
---
|
|
55
55
|
|
|
56
56
|
*Generated by AQE v3 init on ${new Date().toISOString()}*
|
|
57
|
-
`;
|
|
57
|
+
`;I(m(e,"README.md"),u,_)}scanSkillsDirectory(e){let t=[];try{let n=P(e);for(let i of n){if(i.startsWith("."))continue;let s=m(e,i);if(!X(s).isDirectory())continue;let o=m(s,"SKILL.md");if(!y(o))continue;let a=this.getSkillType(i),c=this.getSkillDescription(s),u=y(m(s,"resources"));t.push({name:i,type:a,description:c,hasResources:u})}}catch(n){console.debug("[SkillsInstaller] Failed to scan skills directory:",n instanceof Error?n.message:n)}return t.sort((n,i)=>n.name.localeCompare(i.name))}};function Gt(r){return new te(r)}L();import{existsSync as f,mkdirSync as E,readdirSync as ne,statSync as Ce,readFileSync as we,writeFileSync as nt,copyFileSync as re}from"fs";import{join as g}from"path";function rt(r){let e=new Date().toISOString().slice(0,10),t=r.match(/^---\n([\s\S]*?)\n---/);if(!t)return r;let n=t[1],i;return/^updated:/m.test(n)?i=n.replace(/^updated:.*$/m,`updated: ${e}`):/^created:/m.test(n)?i=n.replace(/^(created:.*$)/m,`$1
|
|
58
58
|
updated: ${e}`):i=n+`
|
|
59
59
|
updated: ${e}`,r.replace(/^---\n[\s\S]*?\n---/,`---
|
|
60
60
|
${i}
|
|
61
|
-
---`)}var
|
|
61
|
+
---`)}var it=["qe-test-architect","qe-bdd-generator","qe-property-tester","qe-mutation-tester","qe-test-idea-rewriter","qe-quality-criteria-recommender","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-code-complexity","qe-deployment-advisor","qe-risk-assessor","qe-defect-predictor","qe-regression-analyzer","qe-root-cause-analyzer","qe-impact-analyzer","qe-requirements-validator","qe-qx-partner","qe-product-factors-assessor","qe-code-intelligence","qe-kg-builder","qe-dependency-mapper","qe-security-scanner","qe-security-auditor","qe-pentest-validator","qe-contract-validator","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-chaos-engineer","qe-load-tester","qe-performance-tester","qe-learning-coordinator","qe-pattern-learner","qe-metrics-optimizer","qe-transfer-specialist","qe-soap-tester","qe-sap-rfc-tester","qe-sap-idoc-tester","qe-odata-contract-tester","qe-middleware-validator","qe-message-broker-tester","qe-sod-analyzer","qe-fleet-commander","qe-queen-coordinator","qe-tdd-specialist","qe-integration-tester","qe-integration-architect"],st=["qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer","qe-tdd-red","qe-tdd-green","qe-tdd-refactor"],ie=class{projectRoot;options;sourceAgentsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installQEAgents:!0,installSubagents:!0,overwrite:!1,exclude:[],include:void 0,...e},this.sourceAgentsDir=this.findSourceAgentsDir()}findSourceAgentsDir(){let e=b(import.meta.url),t=[];e&&(t.push(g(e,"assets/agents/v3")),t.push(g(e,".claude/agents/v3"))),t.push(g(this.projectRoot,"node_modules/agentic-qe/assets/agents/v3"));for(let n of t)if(f(n))return n;return t[0]}preserveOverridesDir(){let e=g(this.projectRoot,".claude","agent-overrides");f(e)||E(e,{recursive:!0});let t=g(e,"_example.yaml");if(!f(t))try{let n=b(import.meta.url),i=[...n?[g(n,"assets","templates","agent-override-example.yaml")]:[],g(this.projectRoot,"node_modules","agentic-qe","assets","templates","agent-override-example.yaml")];for(let s of i)if(f(s)){re(s,t);break}}catch{}}async install(){let e={installed:[],skipped:[],errors:[],totalCount:0,agentsDir:g(this.projectRoot,".claude","agents","v3"),overlaysApplied:[],overlayWarnings:[]};if(this.preserveOverridesDir(),!f(this.sourceAgentsDir))return e.errors.push(`Source agents directory not found: ${this.sourceAgentsDir}`),e;let t=g(this.projectRoot,".claude","agents","v3");f(t)||E(t,{recursive:!0});let n=g(t,"subagents");f(n)||E(n,{recursive:!0}),await this.copyHelpersDirectory(t),await this.copyTemplatesDirectory(t);let i=this.getAvailableAgents();e.totalCount=i.length;let s=this.filterAgents(i),o=[];for(let u of s)try{let l=await this.installAgent(u,t,n);l?(e.installed.push(l),o.push(l)):(e.skipped.push(u),o.push(this.describeAgent(u,t,n)))}catch(l){e.errors.push(`Failed to install ${u}: ${k(l)}`)}let a=de(this.projectRoot);if(a.warnings.length>0){e.overlayWarnings=a.warnings;for(let u of a.warnings)console.error(`[AgentsInstaller] Overlay warning: ${u}`)}if(a.errors.length>0)for(let u of a.errors)e.errors.push(`Overlay error: ${u}`);for(let u of a.overlays){let l=u.agent,N=st.includes(l)?g(n,`${l}.md`):g(t,`${l}.md`);if(!f(N)){e.overlayWarnings.push(`Overlay for "${l}" found but agent file does not exist. Skipping.`);continue}try{let O=we(N,"utf-8"),{content:je,applied:F}=pe(O,u),Ie=rt(je);nt(N,Ie,"utf-8"),e.overlaysApplied.push(l);let _e=[...F.replacedFields.map(C=>`replaced:${C}`),...F.appendedFields.map(C=>`appended:${C}`),...F.configOverrides.map(C=>`config:${C}`)];console.error(`[AgentsInstaller] Applied overlay for ${l}: ${_e.join(", ")}`)}catch(O){e.overlayWarnings.push(`Failed to apply overlay for "${l}": ${k(O)}`)}}e.overlaysApplied.length>0&&console.error(`[AgentsInstaller] Applied ${e.overlaysApplied.length} agent overlay(s): ${e.overlaysApplied.join(", ")}`);let c=me(t,this.projectRoot);if(e.mcpValidationWarnings=c.warnings,c.warnings.length>0){console.error(`[AgentsInstaller] MCP dependency warnings (${c.agentsWithMissingDeps.length} agents affected):`);for(let u of c.warnings.slice(0,10))console.error(` ${u}`);c.warnings.length>10&&console.error(` ... and ${c.warnings.length-10} more warnings`)}return await this.createAgentsIndex(t,o),e}getAvailableAgents(){let e=[];try{let t=ne(this.sourceAgentsDir);for(let n of t){let i=g(this.sourceAgentsDir,n),s=Ce(i);if(s.isFile()&&n.endsWith(".md"))e.push(n.replace(".md",""));else if(s.isDirectory()&&n==="subagents"){let o=ne(i);for(let a of o)a.endsWith(".md")&&e.push(`subagents/${a.replace(".md","")}`)}}}catch{return[]}return e}filterAgents(e){let t=e.filter(n=>(n.includes("/")?n.split("/")[1]:n).startsWith("qe-"));return this.options.include&&this.options.include.length>0&&(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return this.options.include.includes(i)})),this.options.exclude&&this.options.exclude.length>0&&(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return!this.options.exclude.some(s=>i.includes(s)||i.match(new RegExp(s)))})),this.options.installQEAgents||(t=t.filter(n=>{let i=n.includes("/")?n.split("/")[1]:n;return!it.includes(i)})),this.options.installSubagents||(t=t.filter(n=>!n.startsWith("subagents/"))),t}async installAgent(e,t,n){let i=e.startsWith("subagents/"),s=i?e.split("/")[1]:e,o=g(this.sourceAgentsDir,`${e}.md`),a=i?g(n,`${s}.md`):g(t,`${s}.md`);if(f(a)&&!this.options.overwrite)return null;if(f(o))re(o,a);else throw new Error(`Source file not found: ${o}`);return this.describeAgent(e,t,n)}describeAgent(e,t,n){let i=e.startsWith("subagents/"),s=i?e.split("/")[1]:e,o=i?g(n,`${s}.md`):g(t,`${s}.md`);return{name:s,type:this.getAgentType(s,i),description:this.getAgentDescription(o),domain:this.getAgentDomain(s)}}getAgentType(e,t){return t?"v3-subagent":"v3-qe"}copyDirectoryRecursive(e,t){if(!f(e))return;f(t)||E(t,{recursive:!0});let n=ne(e);for(let i of n){let s=g(e,i),o=g(t,i);Ce(s).isDirectory()?this.copyDirectoryRecursive(s,o):(!f(o)||this.options.overwrite)&&re(s,o)}}async copyHelpersDirectory(e){let t=g(this.sourceAgentsDir,"helpers"),n=g(this.projectRoot,".claude","helpers","v3");f(t)?this.copyDirectoryRecursive(t,n):console.error(`[AgentsInstaller] Helpers source not found: ${t}`)}async copyTemplatesDirectory(e){let t=g(this.sourceAgentsDir,"templates"),n=g(e,"templates");f(t)?this.copyDirectoryRecursive(t,n):console.error(`[AgentsInstaller] Templates source not found: ${t}`)}getAgentDescription(e){if(f(e))try{let t=we(e,"utf-8"),n=t.match(/description:\s*["']?([^"'\n]+)["']?/i);if(n)return n[1].trim();let i=t.split(`
|
|
62
62
|
`);for(let s of i){let o=s.trim();if(o&&!o.startsWith("#")&&!o.startsWith("-")&&!o.startsWith("```")&&!o.startsWith("---"))return o.slice(0,100)+(o.length>100?"...":"")}}catch(t){console.debug("[AgentsInstaller] Failed to read agent description:",t instanceof Error?t.message:t)}}getAgentDomain(e){let t={"test-architect":"test-generation","bdd-generator":"test-generation","property-tester":"test-generation","mutation-tester":"test-generation","parallel-executor":"test-execution","flaky-hunter":"test-execution","retry-handler":"test-execution","coverage-specialist":"coverage-analysis","gap-detector":"coverage-analysis","quality-gate":"quality-assessment","code-complexity":"quality-assessment","deployment-advisor":"quality-assessment","risk-assessor":"quality-assessment","defect-predictor":"defect-intelligence","regression-analyzer":"defect-intelligence","root-cause-analyzer":"defect-intelligence","impact-analyzer":"defect-intelligence","requirements-validator":"requirements-validation","qx-partner":"requirements-validation","product-factors-assessor":"requirements-validation","quality-criteria-recommender":"requirements-validation","test-idea-rewriter":"test-generation","code-intelligence":"code-intelligence","kg-builder":"code-intelligence","dependency-mapper":"code-intelligence","security-scanner":"security-compliance","security-auditor":"security-compliance","pentest-validator":"security-compliance","contract-validator":"contract-testing","graphql-tester":"contract-testing","visual-tester":"visual-accessibility","accessibility-auditor":"visual-accessibility","responsive-tester":"visual-accessibility","chaos-engineer":"chaos-resilience","load-tester":"chaos-resilience","performance-tester":"chaos-resilience","learning-coordinator":"learning-optimization","pattern-learner":"learning-optimization","metrics-optimizer":"learning-optimization","transfer-specialist":"learning-optimization","soap-tester":"enterprise-integration","sap-rfc-tester":"enterprise-integration","sap-idoc-tester":"enterprise-integration","odata-contract-tester":"enterprise-integration","middleware-validator":"enterprise-integration","message-broker-tester":"enterprise-integration","sod-analyzer":"enterprise-integration"},n=e.replace(/^(v3-)?qe-/,"");return t[n]}async createAgentsIndex(e,t){let n=t.filter(c=>c.type==="v3-qe"),i=t.filter(c=>c.type==="v3-subagent"),s=new Map;for(let c of n){let u=c.domain||"general";s.has(u)||s.set(u,[]),s.get(u).push(c)}let o=`# AQE V3 Agents Index
|
|
63
63
|
|
|
64
64
|
This directory contains V3 QE agents installed by \`aqe init\`.
|
|
@@ -105,7 +105,7 @@ ${i.map(c=>`- **${c.name}**${c.description?`: ${c.description}`:""}`).join(`
|
|
|
105
105
|
---
|
|
106
106
|
|
|
107
107
|
*Generated by AQE v3 init on ${new Date().toISOString()}*
|
|
108
|
-
`,a=g(this.projectRoot,".claude","docs");f(a)||
|
|
108
|
+
`,a=g(this.projectRoot,".claude","docs");f(a)||E(a,{recursive:!0}),I(g(a,"v3-agents-index.md"),o,_)}};function Xt(r){return new ie(r)}L();import{existsSync as v,mkdirSync as se,readdirSync as De,readFileSync as ot,writeFileSync as at,copyFileSync as Re}from"fs";import{join as h}from"path";var Ee={core:[{name:"workflow-executor",filename:"n8n-workflow-executor.md",category:"core"},{name:"node-validator",filename:"n8n-node-validator.md",category:"core"},{name:"trigger-test",filename:"n8n-trigger-test.md",category:"core"},{name:"expression-validator",filename:"n8n-expression-validator.md",category:"core"},{name:"integration-test",filename:"n8n-integration-test.md",category:"core"},{name:"security-auditor",filename:"n8n-security-auditor.md",category:"core"}],advanced:[{name:"unit-tester",filename:"n8n-unit-tester.md",category:"advanced"},{name:"performance-tester",filename:"n8n-performance-tester.md",category:"advanced"},{name:"ci-orchestrator",filename:"n8n-ci-orchestrator.md",category:"advanced"}],quality:[{name:"version-comparator",filename:"n8n-version-comparator.md",category:"quality"},{name:"bdd-scenario-tester",filename:"n8n-bdd-scenario-tester.md",category:"quality"},{name:"monitoring-validator",filename:"n8n-monitoring-validator.md",category:"quality"}],enterprise:[{name:"compliance-validator",filename:"n8n-compliance-validator.md",category:"enterprise"},{name:"chaos-tester",filename:"n8n-chaos-tester.md",category:"enterprise"}],reliability:[{name:"base-agent",filename:"n8n-base-agent.md",category:"reliability"}]},lt=["n8n-expression-testing","n8n-integration-testing-patterns","n8n-security-testing","n8n-trigger-testing-strategies","n8n-workflow-testing-fundamentals"],oe=class{projectRoot;options;sourceAgentsDir;sourceSkillsDir;constructor(e){this.projectRoot=e.projectRoot,this.options={installAgents:!0,installSkills:!0,overwrite:!1,...e},this.sourceAgentsDir=this.findSourceAgentsDir(),this.sourceSkillsDir=this.findSourceSkillsDir()}findSourceAgentsDir(){let e=b(import.meta.url),t=[];e&&t.push(h(e,".claude/agents/n8n")),t.push(h(this.projectRoot,"node_modules/agentic-qe/.claude/agents/n8n"));for(let n of t)if(v(n))return n;return t[0]}findSourceSkillsDir(){let e=b(import.meta.url),t=[];e&&(t.push(h(e,"assets/skills")),t.push(h(e,".claude/skills"))),t.push(h(this.projectRoot,"node_modules/agentic-qe/assets/skills"));for(let n of t)if(v(n))return n;return t[0]}async install(){let e={success:!0,agentsInstalled:[],skillsInstalled:[],configGenerated:!1,errors:[],agentsDir:h(this.projectRoot,".claude/agents/n8n"),skillsDir:h(this.projectRoot,".claude/skills")};try{if(this.options.installAgents){let t=await this.installAgents(e.agentsDir);e.agentsInstalled=t.installed,e.errors.push(...t.errors)}if(this.options.installSkills){let t=await this.installSkills(e.skillsDir);e.skillsInstalled=t.installed,e.errors.push(...t.errors)}this.options.n8nApiConfig&&(e.configGenerated=!0),e.agentsInstalled.length>0&&this.createAgentsIndex(e.agentsDir,e.agentsInstalled)}catch(t){e.success=!1,e.errors.push(`Installation failed: ${k(t)}`)}return e}async installAgents(e){let t=[],n=[];if(v(e)||se(e,{recursive:!0}),!v(this.sourceAgentsDir))return n.push(`Source agents directory not found: ${this.sourceAgentsDir}`),{installed:t,errors:n};let i=De(this.sourceAgentsDir).filter(s=>s.endsWith(".md"));for(let s of Object.keys(Ee))for(let o of Ee[s]){let a=h(this.sourceAgentsDir,o.filename),c=h(e,o.filename);if(i.includes(o.filename)&&!(v(c)&&!this.options.overwrite))try{Re(a,c);let l=ot(a,"utf-8").match(/description:\s*["']?(.+?)["']?\n/);o.description=l?.[1]||`n8n ${o.name} agent`,t.push(o)}catch(u){n.push(`Failed to install ${o.name}: ${k(u)}`)}}return{installed:t,errors:n}}async installSkills(e){let t=[],n=[];if(v(e)||se(e,{recursive:!0}),!v(this.sourceSkillsDir))return n.push(`Source skills directory not found: ${this.sourceSkillsDir}`),{installed:t,errors:n};for(let i of lt){let s=h(this.sourceSkillsDir,i),o=h(e,i);if(v(s)&&!(v(o)&&!this.options.overwrite))try{this.copyDirectory(s,o),t.push(i)}catch(a){n.push(`Failed to install skill ${i}: ${k(a)}`)}}return{installed:t,errors:n}}copyDirectory(e,t){v(t)||se(t,{recursive:!0});let n=De(e,{withFileTypes:!0});for(let i of n){let s=h(e,i.name),o=h(t,i.name);i.isDirectory()?this.copyDirectory(s,o):Re(s,o)}}createAgentsIndex(e,t){let n=h(e,"README.md"),i={core:t.filter(o=>o.category==="core"),advanced:t.filter(o=>o.category==="advanced"),quality:t.filter(o=>o.category==="quality"),enterprise:t.filter(o=>o.category==="enterprise"),reliability:t.filter(o=>o.category==="reliability")},s=`# N8n Testing Agents
|
|
109
109
|
|
|
110
110
|
> Auto-generated by \`aqe init --with-n8n\`
|
|
111
111
|
|
|
@@ -138,7 +138,7 @@ Task("Run security audit on workflow", "n8n-security-auditor")
|
|
|
138
138
|
`;s+=`
|
|
139
139
|
`}s+=`---
|
|
140
140
|
Generated: ${new Date().toISOString()}
|
|
141
|
-
`,
|
|
141
|
+
`,at(n,s)}generateConfigSection(){return{n8n:{enabled:!0,installAgents:this.options.installAgents,installSkills:this.options.installSkills,apiConfig:this.options.n8nApiConfig||null}}}generateClaudeMdSection(){return`
|
|
142
142
|
## N8n Workflow Testing
|
|
143
143
|
|
|
144
144
|
This project includes n8n workflow testing agents. Use them with Claude Code:
|
|
@@ -177,4 +177,4 @@ N8n agents map to v3 domains:
|
|
|
177
177
|
- Compliance agents \u2192 security-compliance domain
|
|
178
178
|
- Chaos agents \u2192 chaos-resilience domain
|
|
179
179
|
|
|
180
|
-
`}};function
|
|
180
|
+
`}};function sn(r){return new oe(r)}export{U as a,gt as b,yt as c,kt as d,xt as e,Me as f,Ct as g,wt as h,Dt as i,Ve as j,Rt as k,Et as l,jt as m,Nt as n,Ot as o,Gt as p,Xt as q,sn as r};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as c,d as 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 c,d as p}from"./chunk-XWIAZG3C.js";import{a as f}from"./chunk-XH4JMX5O.js";p();import{existsSync as l,readFileSync as i}from"node:fs";import{join as a}from"node:path";import{execSync as m}from"node:child_process";var s=null,d=0,g=6e4;function S(){s=null,d=0}function b(e){if(s&&Date.now()-d<g)return s;let n=w(e);return s=n,d=Date.now(),n}function w(e){let n=h(e);if(n)return n;let r=v(e);if(r)return r;let t=k(e);return t||{available:!1}}function h(e){let n=a(e,".mcp.json");if(l(n))try{let o=c(i(n,"utf-8"));if(o.mcpServers?.ruflo||o.mcpServers?.["claude-flow"])return{available:!0,method:"mcp-config"}}catch{}let r=a(e,".claude","mcp.json");if(l(r))try{let o=c(i(r,"utf-8"));if(o.mcpServers?.ruflo||o.mcpServers?.["claude-flow"])return{available:!0,method:"mcp-config"}}catch{}let t=a(e,".claude","settings.json");if(l(t))try{let o=c(i(t,"utf-8")),u=o.mcpServers||o.mcp?.servers||{};if(u.ruflo||u["claude-flow"]||u["@anthropic/claude-flow"])return{available:!0,method:"mcp-config"}}catch{}return null}function v(e){let n=a(e,"package.json");if(!l(n))return null;try{let r=c(i(n,"utf-8")),t={...r.dependencies,...r.devDependencies};if(t.ruflo||t["@claude-flow/cli"]||t["claude-flow"])return{available:!0,method:"npm-dependency"}}catch{}return null}function k(e){for(let n of["ruflo","@claude-flow/cli"])try{return{available:!0,method:"npx-cached",version:m(`npx --no-install ${n} --version`,{encoding:"utf-8",timeout:5e3,cwd:e,stdio:["pipe","pipe","pipe"]}).trim().match(/\d+\.\d+\.\d+[\w.-]*/)?.[0]}}catch{}return null}function x(){for(let e of["ruflo","@claude-flow/cli"])try{return f.resolve(`${e}/package.json`),e}catch{}return"ruflo"}function P(){return[" Claude Flow not found \u2014 running in standalone mode.",""," Claude Flow adds optional features:"," - SONA trajectory tracking (reinforcement learning)"," - 3-tier model routing (haiku / sonnet / opus)"," - Codebase pretrain analysis",""," To install later:"," npm install -g ruflo"," claude mcp add ruflo -- npx -y ruflo@3.5.18"," aqe init --auto --with-claude-flow"].join(`
|
|
3
3
|
`)}export{S as a,b,x as c,P 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 E}from"./chunk-O32BFQV4.js";import{a as Me,c as Le}from"./chunk-TOJF3ZG4.js";import{b as a,g as we}from"./chunk-4WLIOPHX.js";import{a as me,b as ze}from"./chunk-7T6L3LFN.js";import{b as _e,c as _,d as Ae,f as U}from"./chunk-VG32EEUG.js";import{e as H,h as Re,i as de,n as j}from"./chunk-52KOPIMI.js";import{b as z,d as Ee}from"./chunk-XN3KCKAM.js";import{a as pe,e as We}from"./chunk-UDSB3XCG.js";import{b as Ce,d as $e}from"./chunk-AJVLVF7V.js";import{a as ke,d as Ge}from"./chunk-IRPNEXOU.js";import{b as R,e as I}from"./chunk-L5VSLPMW.js";import{b as W}from"./chunk-V6SE2ZU2.js";async function A(g,t,e,r,o="absolute",s){let n=new AbortController,i=!1,l,d=()=>{i=!0;let u=r();l?.(u),n.abort(u)},h=setTimeout(d,e),c=s!==void 0&&s>0?setTimeout(d,s):void 0;c?.unref?.();let p=()=>{clearTimeout(h),c&&clearTimeout(c)},m=()=>{o==="idle"&&(clearTimeout(h),h=setTimeout(d,e),h.unref?.())};h.unref?.();try{let u=await fetch(g,{...t,signal:n.signal});if(!u.body)return p(),u;m();let f=u.body.getReader(),b=!1,y,k=()=>{b=!0,p()},v=o==="idle"?1048576:0,P=T=>{y&&T.desiredSize===v&&T.error(y)},w=new ReadableStream({start(T){l=M=>{b||(k(),y=M,P(T),f.cancel(M).catch(()=>{}).finally(()=>f.releaseLock()))}},async pull(T){if(y)return P(T);try{let M=await f.read();if(b)return;M.done?(k(),f.releaseLock(),T.close()):(m(),T.enqueue(M.value))}catch(M){if(b)return;k(),f.releaseLock(),T.error(M)}},async cancel(T){if(!b){k();try{await f.cancel(T)}finally{f.releaseLock()}}}},new ByteLengthQueuingStrategy({highWaterMark:v})),S=new Response(w,{status:u.status,statusText:u.statusText,headers:u.headers});for(let T of["url","redirected","type"])Object.defineProperty(S,T,{value:u[T]});return S}catch(u){throw p(),i||u instanceof Error&&u.name==="AbortError"?r():u}}var x=W(()=>{"use strict"});import{readFileSync as Je}from"fs";import*as Se from"path";function X(g){return typeof g=="string"&&Xe.includes(g)}function Ze(g){try{let e=Je(g,"utf8").match(/^\s*effort_level\s*:\s*['"]?([a-z]+)['"]?\s*$/m);return e&&X(e[1])?e[1]:null}catch{return null}}function xe(g={}){if(g.override&&X(g.override))return g.override;if(g.agentEffort&&X(g.agentEffort))return g.agentEffort;let e=(g.env??process.env).QE_EFFORT_LEVEL;if(e&&X(e))return e;let r=g.fleetDefaultsPath??Se.join(process.cwd(),"config","fleet-defaults.yaml");return J===void 0&&(J=Ze(r)),J||Qe}var Xe,Qe,J,Ne=W(()=>{"use strict";Xe=["low","medium","high","xhigh","max"],Qe="xhigh"});function et(g){try{let t=H(g);return{sendSampling:t.supportsSamplingParams!==!1,supportsEffort:t.supportsEffortXHigh===!0}}catch{return{sendSampling:!1,supportsEffort:!1}}}function Q(g,t,e){let r=et(t);if(r.sendSampling&&e.temperature!==void 0&&(g.temperature=e.temperature),r.supportsEffort){let o=e.effort??(tt(t)?xe():void 0);o!==void 0&&(g.output_config={effort:o})}return g}function tt(g){return Re(g)?.tier==="flagship"}var be=W(()=>{"use strict";j();Ne()});function yt(g){try{let t=H(g);return{sendSampling:t.supportsSamplingParams!==!1,maxTokensField:t.usesMaxCompletionTokens===!0?"max_completion_tokens":"max_tokens"}}catch{return ht.test(g)?{...ft}:{...gt}}}function K(g,t,e){let r=yt(t),o=g;return e.maxTokens!==void 0&&(o[r.maxTokensField]=e.maxTokens),r.sendSampling&&e.temperature!==void 0&&(o.temperature=e.temperature),g}var ht,gt,ft,ve=W(()=>{"use strict";j();ht=/^(openai\/)?(gpt-5|gpt-6|o\d)/i,gt={sendSampling:!0,maxTokensField:"max_tokens"},ft={sendSampling:!1,maxTokensField:"max_completion_tokens"}});$e();I();var Pe={failureThreshold:5,resetTimeoutMs:3e4,halfOpenSuccessThreshold:2,failureWindowMs:6e4,includeTimeouts:!0},he=class{state="closed";failures=[];successCount=0;totalRequests=0;totalSuccesses=0;totalFailures=0;rejectedCount=0;lastFailureTime;lastSuccessTime;openedAt;halfOpenSuccesses=0;config;providerType;constructor(t,e={}){this.providerType=t,this.config={...Pe,...e}}getState(){return this.state==="open"&&this.openedAt&&Date.now()-this.openedAt.getTime()>=this.config.resetTimeoutMs&&this.transitionTo("half-open"),this.state}canExecute(){let t=this.getState();return t==="closed"?!0:t!=="open"}async execute(t){if(this.totalRequests++,this.getState()==="open")throw this.rejectedCount++,a(`Circuit breaker is open for provider ${this.providerType}`,"CIRCUIT_OPEN",{provider:this.providerType,retryable:!0,retryAfterMs:this.getTimeUntilTransition()});try{let r=await t();return this.recordSuccess(),r}catch(r){throw this.recordFailure(R(r)),r}}recordSuccess(){this.successCount++,this.totalSuccesses++,this.lastSuccessTime=new Date,this.getState()==="half-open"&&(this.halfOpenSuccesses++,this.halfOpenSuccesses>=this.config.halfOpenSuccessThreshold&&this.transitionTo("closed"))}recordFailure(t){if(this.totalFailures++,this.lastFailureTime=new Date,(t.message.toLowerCase().includes("timeout")||t.name==="TimeoutError"||t.name==="AbortError")&&!this.config.includeTimeouts)return;this.failures.push({timestamp:new Date,error:t}),this.cleanOldFailures();let r=this.getState();if(r==="half-open"){this.transitionTo("open");return}r==="closed"&&this.failures.length>=this.config.failureThreshold&&this.transitionTo("open")}getStats(){return{state:this.getState(),totalRequests:this.totalRequests,successCount:this.totalSuccesses,failureCount:this.totalFailures,rejectedCount:this.rejectedCount,lastFailureTime:this.lastFailureTime,lastSuccessTime:this.lastSuccessTime,timeUntilTransitionMs:this.getTimeUntilTransition()}}reset(){this.state="closed",this.failures=[],this.successCount=0,this.halfOpenSuccesses=0,this.openedAt=void 0}forceOpen(){this.transitionTo("open")}forceHalfOpen(){this.transitionTo("half-open")}getRecentFailures(t=5){return this.failures.slice(-t).map(e=>`[${e.timestamp.toISOString()}] ${e.error.message}`)}transitionTo(t){if(this.state!==t)switch(this.state=t,t){case"open":this.openedAt=new Date,this.halfOpenSuccesses=0;break;case"half-open":this.halfOpenSuccesses=0;break;case"closed":this.failures=[],this.openedAt=void 0,this.halfOpenSuccesses=0;break}}cleanOldFailures(){let t=Date.now()-this.config.failureWindowMs;this.failures=this.failures.filter(e=>e.timestamp.getTime()>t)}getTimeUntilTransition(){if(this.state==="open"&&this.openedAt){let t=Date.now()-this.openedAt.getTime(),e=this.config.resetTimeoutMs-t;return Math.max(0,e)}}},V=class{breakers=new Map;defaultConfig;constructor(t={}){this.defaultConfig={...Pe,...t}}getBreaker(t,e){let r=this.breakers.get(t);return r||(r=new he(t,{...this.defaultConfig,...e}),this.breakers.set(t,r)),r}getAllStats(){let t={};for(let[e,r]of this.breakers)t[e]=r.getStats();return t}getAvailableProviders(){let t=[];for(let[e,r]of this.breakers)r.canExecute()&&t.push(e);return t}resetAll(){for(let t of this.breakers.values())t.reset()}reset(t){let e=this.breakers.get(t);e&&e.reset()}};import{createHash as He}from"node:crypto";var Oe={maxSize:1e3,defaultTtlMs:36e5,enableLRU:!0,cacheGenerations:!0,cacheEmbeddings:!0,cacheCompletions:!0},L=class{cache=new Map;accessOrder=[];config;hits=0;misses=0;evictions=0;constructor(t={}){this.config={...Oe,...t}}static generateKey(t,e,r){let o=[t,r?.model??"default",String(r?.temperature??.7),String(r?.maxTokens??0),r?.systemPrompt??"",e],s=[r?.stopSequences,r?.effort,r?.preferredProvider];s.some(i=>i!==void 0)&&o.push(JSON.stringify(s));let n=He("sha256").update(JSON.stringify(o)).digest("hex");return`${t}:${n}`}get(t){let e=this.cache.get(t);if(!e){this.misses++;return}if(e.ttlMs>0&&Date.now()-e.createdAt.getTime()>e.ttlMs){this.delete(t),this.misses++;return}return this.hits++,e.lastAccessedAt=new Date,e.accessCount++,this.config.enableLRU&&this.updateAccessOrder(t),e.value}set(t,e,r){this.cache.size>=this.config.maxSize&&!this.cache.has(t)&&this.evictLRU();let o={value:e,createdAt:new Date,lastAccessedAt:new Date,accessCount:1,ttlMs:r??this.config.defaultTtlMs,keyHash:t};this.cache.set(t,o),this.config.enableLRU&&this.updateAccessOrder(t)}has(t){let e=this.cache.get(t);return e?e.ttlMs>0&&Date.now()-e.createdAt.getTime()>e.ttlMs?(this.delete(t),!1):!0:!1}delete(t){let e=this.cache.delete(t);if(e){let r=this.accessOrder.indexOf(t);r!==-1&&this.accessOrder.splice(r,1)}return e}clear(){this.cache.clear(),this.accessOrder=[],this.hits=0,this.misses=0,this.evictions=0}getStats(){let t=this.hits+this.misses,e=t>0?this.hits/t:0,r=0;for(let o of this.cache.values())r+=this.estimateSize(o.value);return{size:this.cache.size,maxSize:this.config.maxSize,hits:this.hits,misses:this.misses,hitRate:e,evictions:this.evictions,memoryUsageBytes:r}}keys(){return Array.from(this.cache.keys())}entries(){return Array.from(this.cache.entries())}import(t){for(let[e,r]of t)r.createdAt=new Date(r.createdAt),r.lastAccessedAt=new Date(r.lastAccessedAt),this.cache.set(e,r),this.config.enableLRU&&this.updateAccessOrder(e);for(;this.cache.size>this.config.maxSize;)this.evictLRU()}pruneExpired(){let t=Date.now(),e=0;for(let[r,o]of this.cache.entries())o.ttlMs>0&&t-o.createdAt.getTime()>o.ttlMs&&(this.delete(r),e++);return e}updateAccessOrder(t){let e=this.accessOrder.indexOf(t);e!==-1&&this.accessOrder.splice(e,1),this.accessOrder.push(t)}evictLRU(){if(this.accessOrder.length===0){let e=this.cache.keys().next().value;e!==void 0&&(this.cache.delete(e),this.evictions++);return}let t=this.accessOrder.shift();t!==void 0&&(this.cache.delete(t),this.evictions++)}estimateSize(t){return t==null?0:JSON.stringify(t).length*2}},Y=class{generationCache;embeddingCache;completionCache;config;constructor(t={}){this.config={...Oe,...t},this.generationCache=new L(t),this.embeddingCache=new L(t),this.completionCache=new L(t)}getGeneration(t,e){if(!this.config.cacheGenerations)return;let r=L.generateKey("generation",t,e);return this.generationCache.get(r)}setGeneration(t,e,r,o){if(!this.config.cacheGenerations||e.finishReason==="content_filter")return;let s=L.generateKey("generation",t,r);this.generationCache.set(s,e,o)}getEmbedding(t,e){if(!this.config.cacheEmbeddings)return;let r=L.generateKey("embedding",t,e);return this.embeddingCache.get(r)}setEmbedding(t,e,r,o){if(!this.config.cacheEmbeddings)return;let s=L.generateKey("embedding",t,r);this.embeddingCache.set(s,e,o)}getCompletion(t,e){if(!this.config.cacheCompletions)return;let r=L.generateKey("completion",t,e);return this.completionCache.get(r)}setCompletion(t,e,r,o){if(!this.config.cacheCompletions||e.completion.length===0)return;let s=L.generateKey("completion",t,r);this.completionCache.set(s,e,o)}getStats(){let t=this.generationCache.getStats(),e=this.embeddingCache.getStats(),r=this.completionCache.getStats(),o=t.hits+e.hits+r.hits,s=t.misses+e.misses+r.misses,n=o+s;return{generation:t,embedding:e,completion:r,total:{size:t.size+e.size+r.size,maxSize:this.config.maxSize*3,hits:o,misses:s,hitRate:n>0?o/n:0,evictions:t.evictions+e.evictions+r.evictions,memoryUsageBytes:t.memoryUsageBytes+e.memoryUsageBytes+r.memoryUsageBytes}}}clear(){this.generationCache.clear(),this.embeddingCache.clear(),this.completionCache.clear()}pruneExpired(){return this.generationCache.pruneExpired()+this.embeddingCache.pruneExpired()+this.completionCache.pruneExpired()}};U();We();var ge="(unattributed)",je=`
|
|
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 E}from"./chunk-TDQWTSBS.js";import{a as Me,c as Le}from"./chunk-2IIXCEMS.js";import{b as a,g as we}from"./chunk-O6EWL5DQ.js";import{a as me,b as ze}from"./chunk-EKP2SC77.js";import{b as _e,c as _,d as Ae,f as U}from"./chunk-BBRROA3Z.js";import{e as H,h as Re,i as de,n as j}from"./chunk-LTQVUAPH.js";import{b as z,d as Ee}from"./chunk-XWIAZG3C.js";import{a as pe,e as We}from"./chunk-5G4UFTV4.js";import{b as Ce,d as $e}from"./chunk-W62OOK7A.js";import{a as ke,d as Ge}from"./chunk-ZWBGYJ7K.js";import{b as R,e as I}from"./chunk-HL2ANKN3.js";import{b as W}from"./chunk-XH4JMX5O.js";async function A(g,t,e,r,o="absolute",s){let n=new AbortController,i=!1,l,d=()=>{i=!0;let u=r();l?.(u),n.abort(u)},h=setTimeout(d,e),c=s!==void 0&&s>0?setTimeout(d,s):void 0;c?.unref?.();let p=()=>{clearTimeout(h),c&&clearTimeout(c)},m=()=>{o==="idle"&&(clearTimeout(h),h=setTimeout(d,e),h.unref?.())};h.unref?.();try{let u=await fetch(g,{...t,signal:n.signal});if(!u.body)return p(),u;m();let f=u.body.getReader(),b=!1,y,k=()=>{b=!0,p()},v=o==="idle"?1048576:0,P=T=>{y&&T.desiredSize===v&&T.error(y)},w=new ReadableStream({start(T){l=M=>{b||(k(),y=M,P(T),f.cancel(M).catch(()=>{}).finally(()=>f.releaseLock()))}},async pull(T){if(y)return P(T);try{let M=await f.read();if(b)return;M.done?(k(),f.releaseLock(),T.close()):(m(),T.enqueue(M.value))}catch(M){if(b)return;k(),f.releaseLock(),T.error(M)}},async cancel(T){if(!b){k();try{await f.cancel(T)}finally{f.releaseLock()}}}},new ByteLengthQueuingStrategy({highWaterMark:v})),S=new Response(w,{status:u.status,statusText:u.statusText,headers:u.headers});for(let T of["url","redirected","type"])Object.defineProperty(S,T,{value:u[T]});return S}catch(u){throw p(),i||u instanceof Error&&u.name==="AbortError"?r():u}}var x=W(()=>{"use strict"});import{readFileSync as Je}from"fs";import*as Se from"path";function X(g){return typeof g=="string"&&Xe.includes(g)}function Ze(g){try{let e=Je(g,"utf8").match(/^\s*effort_level\s*:\s*['"]?([a-z]+)['"]?\s*$/m);return e&&X(e[1])?e[1]:null}catch{return null}}function xe(g={}){if(g.override&&X(g.override))return g.override;if(g.agentEffort&&X(g.agentEffort))return g.agentEffort;let e=(g.env??process.env).QE_EFFORT_LEVEL;if(e&&X(e))return e;let r=g.fleetDefaultsPath??Se.join(process.cwd(),"config","fleet-defaults.yaml");return J===void 0&&(J=Ze(r)),J||Qe}var Xe,Qe,J,Ne=W(()=>{"use strict";Xe=["low","medium","high","xhigh","max"],Qe="xhigh"});function et(g){try{let t=H(g);return{sendSampling:t.supportsSamplingParams!==!1,supportsEffort:t.supportsEffortXHigh===!0}}catch{return{sendSampling:!1,supportsEffort:!1}}}function Q(g,t,e){let r=et(t);if(r.sendSampling&&e.temperature!==void 0&&(g.temperature=e.temperature),r.supportsEffort){let o=e.effort??(tt(t)?xe():void 0);o!==void 0&&(g.output_config={effort:o})}return g}function tt(g){return Re(g)?.tier==="flagship"}var be=W(()=>{"use strict";j();Ne()});function yt(g){try{let t=H(g);return{sendSampling:t.supportsSamplingParams!==!1,maxTokensField:t.usesMaxCompletionTokens===!0?"max_completion_tokens":"max_tokens"}}catch{return ht.test(g)?{...ft}:{...gt}}}function K(g,t,e){let r=yt(t),o=g;return e.maxTokens!==void 0&&(o[r.maxTokensField]=e.maxTokens),r.sendSampling&&e.temperature!==void 0&&(o.temperature=e.temperature),g}var ht,gt,ft,ve=W(()=>{"use strict";j();ht=/^(openai\/)?(gpt-5|gpt-6|o\d)/i,gt={sendSampling:!0,maxTokensField:"max_tokens"},ft={sendSampling:!1,maxTokensField:"max_completion_tokens"}});$e();I();var Pe={failureThreshold:5,resetTimeoutMs:3e4,halfOpenSuccessThreshold:2,failureWindowMs:6e4,includeTimeouts:!0},he=class{state="closed";failures=[];successCount=0;totalRequests=0;totalSuccesses=0;totalFailures=0;rejectedCount=0;lastFailureTime;lastSuccessTime;openedAt;halfOpenSuccesses=0;config;providerType;constructor(t,e={}){this.providerType=t,this.config={...Pe,...e}}getState(){return this.state==="open"&&this.openedAt&&Date.now()-this.openedAt.getTime()>=this.config.resetTimeoutMs&&this.transitionTo("half-open"),this.state}canExecute(){let t=this.getState();return t==="closed"?!0:t!=="open"}async execute(t){if(this.totalRequests++,this.getState()==="open")throw this.rejectedCount++,a(`Circuit breaker is open for provider ${this.providerType}`,"CIRCUIT_OPEN",{provider:this.providerType,retryable:!0,retryAfterMs:this.getTimeUntilTransition()});try{let r=await t();return this.recordSuccess(),r}catch(r){throw this.recordFailure(R(r)),r}}recordSuccess(){this.successCount++,this.totalSuccesses++,this.lastSuccessTime=new Date,this.getState()==="half-open"&&(this.halfOpenSuccesses++,this.halfOpenSuccesses>=this.config.halfOpenSuccessThreshold&&this.transitionTo("closed"))}recordFailure(t){if(this.totalFailures++,this.lastFailureTime=new Date,(t.message.toLowerCase().includes("timeout")||t.name==="TimeoutError"||t.name==="AbortError")&&!this.config.includeTimeouts)return;this.failures.push({timestamp:new Date,error:t}),this.cleanOldFailures();let r=this.getState();if(r==="half-open"){this.transitionTo("open");return}r==="closed"&&this.failures.length>=this.config.failureThreshold&&this.transitionTo("open")}getStats(){return{state:this.getState(),totalRequests:this.totalRequests,successCount:this.totalSuccesses,failureCount:this.totalFailures,rejectedCount:this.rejectedCount,lastFailureTime:this.lastFailureTime,lastSuccessTime:this.lastSuccessTime,timeUntilTransitionMs:this.getTimeUntilTransition()}}reset(){this.state="closed",this.failures=[],this.successCount=0,this.halfOpenSuccesses=0,this.openedAt=void 0}forceOpen(){this.transitionTo("open")}forceHalfOpen(){this.transitionTo("half-open")}getRecentFailures(t=5){return this.failures.slice(-t).map(e=>`[${e.timestamp.toISOString()}] ${e.error.message}`)}transitionTo(t){if(this.state!==t)switch(this.state=t,t){case"open":this.openedAt=new Date,this.halfOpenSuccesses=0;break;case"half-open":this.halfOpenSuccesses=0;break;case"closed":this.failures=[],this.openedAt=void 0,this.halfOpenSuccesses=0;break}}cleanOldFailures(){let t=Date.now()-this.config.failureWindowMs;this.failures=this.failures.filter(e=>e.timestamp.getTime()>t)}getTimeUntilTransition(){if(this.state==="open"&&this.openedAt){let t=Date.now()-this.openedAt.getTime(),e=this.config.resetTimeoutMs-t;return Math.max(0,e)}}},V=class{breakers=new Map;defaultConfig;constructor(t={}){this.defaultConfig={...Pe,...t}}getBreaker(t,e){let r=this.breakers.get(t);return r||(r=new he(t,{...this.defaultConfig,...e}),this.breakers.set(t,r)),r}getAllStats(){let t={};for(let[e,r]of this.breakers)t[e]=r.getStats();return t}getAvailableProviders(){let t=[];for(let[e,r]of this.breakers)r.canExecute()&&t.push(e);return t}resetAll(){for(let t of this.breakers.values())t.reset()}reset(t){let e=this.breakers.get(t);e&&e.reset()}};import{createHash as He}from"node:crypto";var Oe={maxSize:1e3,defaultTtlMs:36e5,enableLRU:!0,cacheGenerations:!0,cacheEmbeddings:!0,cacheCompletions:!0},L=class{cache=new Map;accessOrder=[];config;hits=0;misses=0;evictions=0;constructor(t={}){this.config={...Oe,...t}}static generateKey(t,e,r){let o=[t,r?.model??"default",String(r?.temperature??.7),String(r?.maxTokens??0),r?.systemPrompt??"",e],s=[r?.stopSequences,r?.effort,r?.preferredProvider];s.some(i=>i!==void 0)&&o.push(JSON.stringify(s));let n=He("sha256").update(JSON.stringify(o)).digest("hex");return`${t}:${n}`}get(t){let e=this.cache.get(t);if(!e){this.misses++;return}if(e.ttlMs>0&&Date.now()-e.createdAt.getTime()>e.ttlMs){this.delete(t),this.misses++;return}return this.hits++,e.lastAccessedAt=new Date,e.accessCount++,this.config.enableLRU&&this.updateAccessOrder(t),e.value}set(t,e,r){this.cache.size>=this.config.maxSize&&!this.cache.has(t)&&this.evictLRU();let o={value:e,createdAt:new Date,lastAccessedAt:new Date,accessCount:1,ttlMs:r??this.config.defaultTtlMs,keyHash:t};this.cache.set(t,o),this.config.enableLRU&&this.updateAccessOrder(t)}has(t){let e=this.cache.get(t);return e?e.ttlMs>0&&Date.now()-e.createdAt.getTime()>e.ttlMs?(this.delete(t),!1):!0:!1}delete(t){let e=this.cache.delete(t);if(e){let r=this.accessOrder.indexOf(t);r!==-1&&this.accessOrder.splice(r,1)}return e}clear(){this.cache.clear(),this.accessOrder=[],this.hits=0,this.misses=0,this.evictions=0}getStats(){let t=this.hits+this.misses,e=t>0?this.hits/t:0,r=0;for(let o of this.cache.values())r+=this.estimateSize(o.value);return{size:this.cache.size,maxSize:this.config.maxSize,hits:this.hits,misses:this.misses,hitRate:e,evictions:this.evictions,memoryUsageBytes:r}}keys(){return Array.from(this.cache.keys())}entries(){return Array.from(this.cache.entries())}import(t){for(let[e,r]of t)r.createdAt=new Date(r.createdAt),r.lastAccessedAt=new Date(r.lastAccessedAt),this.cache.set(e,r),this.config.enableLRU&&this.updateAccessOrder(e);for(;this.cache.size>this.config.maxSize;)this.evictLRU()}pruneExpired(){let t=Date.now(),e=0;for(let[r,o]of this.cache.entries())o.ttlMs>0&&t-o.createdAt.getTime()>o.ttlMs&&(this.delete(r),e++);return e}updateAccessOrder(t){let e=this.accessOrder.indexOf(t);e!==-1&&this.accessOrder.splice(e,1),this.accessOrder.push(t)}evictLRU(){if(this.accessOrder.length===0){let e=this.cache.keys().next().value;e!==void 0&&(this.cache.delete(e),this.evictions++);return}let t=this.accessOrder.shift();t!==void 0&&(this.cache.delete(t),this.evictions++)}estimateSize(t){return t==null?0:JSON.stringify(t).length*2}},Y=class{generationCache;embeddingCache;completionCache;config;constructor(t={}){this.config={...Oe,...t},this.generationCache=new L(t),this.embeddingCache=new L(t),this.completionCache=new L(t)}getGeneration(t,e){if(!this.config.cacheGenerations)return;let r=L.generateKey("generation",t,e);return this.generationCache.get(r)}setGeneration(t,e,r,o){if(!this.config.cacheGenerations||e.finishReason==="content_filter")return;let s=L.generateKey("generation",t,r);this.generationCache.set(s,e,o)}getEmbedding(t,e){if(!this.config.cacheEmbeddings)return;let r=L.generateKey("embedding",t,e);return this.embeddingCache.get(r)}setEmbedding(t,e,r,o){if(!this.config.cacheEmbeddings)return;let s=L.generateKey("embedding",t,r);this.embeddingCache.set(s,e,o)}getCompletion(t,e){if(!this.config.cacheCompletions)return;let r=L.generateKey("completion",t,e);return this.completionCache.get(r)}setCompletion(t,e,r,o){if(!this.config.cacheCompletions||e.completion.length===0)return;let s=L.generateKey("completion",t,r);this.completionCache.set(s,e,o)}getStats(){let t=this.generationCache.getStats(),e=this.embeddingCache.getStats(),r=this.completionCache.getStats(),o=t.hits+e.hits+r.hits,s=t.misses+e.misses+r.misses,n=o+s;return{generation:t,embedding:e,completion:r,total:{size:t.size+e.size+r.size,maxSize:this.config.maxSize*3,hits:o,misses:s,hitRate:n>0?o/n:0,evictions:t.evictions+e.evictions+r.evictions,memoryUsageBytes:t.memoryUsageBytes+e.memoryUsageBytes+r.memoryUsageBytes}}}clear(){this.generationCache.clear(),this.embeddingCache.clear(),this.completionCache.clear()}pruneExpired(){return this.generationCache.pruneExpired()+this.embeddingCache.pruneExpired()+this.completionCache.pruneExpired()}};U();We();var ge="(unattributed)",je=`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS llm_spend (
|
|
4
4
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
5
|
ts INTEGER NOT NULL,
|
|
@@ -17,7 +17,7 @@ CREATE INDEX IF NOT EXISTS idx_llm_spend_ts ON llm_spend(ts);
|
|
|
17
17
|
VALUES (@ts, @provider, @model, @cost_usd, @cost_source, @prompt_tokens, @completion_tokens, @request_id, @agent_type)`).run({ts:Date.now(),provider:t.provider,model:t.model,cost_usd:t.costUsd,cost_source:t.costSource,prompt_tokens:t.promptTokens,completion_tokens:t.completionTokens,request_id:t.requestId,agent_type:t.agent??null}):this.db.prepare(`INSERT INTO llm_spend
|
|
18
18
|
(ts, provider, model, cost_usd, cost_source, prompt_tokens, completion_tokens, request_id)
|
|
19
19
|
VALUES (@ts, @provider, @model, @cost_usd, @cost_source, @prompt_tokens, @completion_tokens, @request_id)`).run({ts:Date.now(),provider:t.provider,model:t.model,cost_usd:t.costUsd,cost_source:t.costSource,prompt_tokens:t.promptTokens,completion_tokens:t.completionTokens,request_id:t.requestId})}catch{}}spentSince(t,e=Date.now()){try{return this.db.prepare("SELECT COALESCE(SUM(cost_usd), 0) AS total FROM llm_spend WHERE ts >= ?").get(e-t)?.total??0}catch{return 0}}spentByAgentSince(t,e=Date.now()){try{let r=this.db.prepare(`SELECT COALESCE(agent_type, ?) AS agent, COALESCE(SUM(cost_usd), 0) AS total
|
|
20
|
-
FROM llm_spend WHERE ts >= ? GROUP BY COALESCE(agent_type, ?)`).all(ge,e-t,ge),o=pe();for(let s of r)o[s.agent]=s.total;return o}catch{return{}}}},F=class{entries=[];record(t){this.entries.push({ts:Date.now(),costUsd:t.costUsd,agent:t.agent??ge})}spentSince(t,e=Date.now()){let r=e-t,o=0;for(let s of this.entries)s.ts>=r&&(o+=s.costUsd);return o}spentByAgentSince(t,e=Date.now()){let r=e-t,o=pe();for(let s of this.entries)s.ts>=r&&(o[s.agent]=(o[s.agent]??0)+s.costUsd);return o}};async function Ie(){try{let t=(await import("./unified-memory-
|
|
20
|
+
FROM llm_spend WHERE ts >= ? GROUP BY COALESCE(agent_type, ?)`).all(ge,e-t,ge),o=pe();for(let s of r)o[s.agent]=s.total;return o}catch{return{}}}},F=class{entries=[];record(t){this.entries.push({ts:Date.now(),costUsd:t.costUsd,agent:t.agent??ge})}spentSince(t,e=Date.now()){let r=e-t,o=0;for(let s of this.entries)s.ts>=r&&(o+=s.costUsd);return o}spentByAgentSince(t,e=Date.now()){let r=e-t,o=pe();for(let s of this.entries)s.ts>=r&&(o[s.agent]=(o[s.agent]??0)+s.costUsd);return o}};async function Ie(){try{let t=(await import("./unified-memory-FZ5K2C7W.js")).getUnifiedMemory();return t.isInitialized()||await t.initialize(),new fe(t.getDatabase())}catch{return new F}}U();I();I();function ye(g,t,e,r){let o=Math.min(t*Math.pow(2,g),e),s=Math.random()*r*o;return o+s}var Ve=1e3,Ye=3e4;function C(g,t=Ve,e=Ye){return ye(g,t,e,0)}x();be();j();var rt={model:de,maxTokens:4096,temperature:.7,timeoutMs:6e4,maxRetries:3,anthropicVersion:"2023-06-01",enableCache:!0,enableCircuitBreaker:!0},Z=class{type="claude";name="Anthropic Claude";config;requestId=0;constructor(t={}){this.config={...rt,...t}}async isAvailable(){if(!this.getApiKey())return!1;try{return(await this.healthCheck()).healthy}catch{return!1}}async healthCheck(){if(!this.getApiKey())return{healthy:!1,error:"API key not configured. Set ANTHROPIC_API_KEY environment variable."};let e=Date.now();try{let r=await this.fetchWithTimeout(`${this.getBaseUrl()}/v1/messages`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify({model:this.config.model,max_tokens:1,messages:[{role:"user",content:"Hi"}]})},5e3),o=Date.now()-e;if(!r.ok){let s=await r.text();return{healthy:!1,latencyMs:o,error:`API error: ${r.status} - ${s}`}}return{healthy:!0,latencyMs:o,models:this.getSupportedModels(),details:{apiVersion:this.config.anthropicVersion,defaultModel:this.config.model}}}catch(r){return{healthy:!1,error:r instanceof Error?r.message:"Unknown error"}}}async generate(t,e){if(!this.getApiKey())throw a("Anthropic API key not configured","API_KEY_MISSING",{provider:"claude",retryable:!1});let o=this.formatMessages(t),s=e?.model??this.config.model,n=e?.maxTokens??this.config.maxTokens??4096,i=e?.temperature??this.config.temperature??.7,l=`claude-${++this.requestId}-${Date.now()}`,d=Date.now(),h={model:s,max_tokens:n,messages:o};Q(h,s,{temperature:i,effort:e?.effort}),e?.systemPrompt&&(h.system=this.config.enableCache!==!1?[{type:"text",text:e.systemPrompt,cache_control:{type:"ephemeral"}}]:e.systemPrompt),e?.stopSequences&&e.stopSequences.length>0&&(h.stop_sequences=e.stopSequences);try{let c=await this.fetchWithRetry(`${this.getBaseUrl()}/v1/messages`,{method:"POST",headers:this.getHeaders(),body:JSON.stringify(h)},e?.timeoutMs??this.config.timeoutMs??6e4,this.config.maxRetries??3),p=Date.now()-d;if(!c.ok){let v=await c.json().catch(()=>({error:{message:"Unknown error"}}));throw this.handleApiError(c.status,v,s)}let m=await c.json(),u=m.usage.cache_creation_input_tokens??0,f=m.usage.cache_read_input_tokens??0,b={promptTokens:m.usage.input_tokens,completionTokens:m.usage.output_tokens,totalTokens:m.usage.input_tokens+u+f+m.usage.output_tokens,cacheCreationTokens:u,cacheReadTokens:f},y=_.calculateCost(s,b);return E.recordTokenUsage(l,"claude-provider","llm","generate",{inputTokens:m.usage.input_tokens,outputTokens:m.usage.output_tokens,totalTokens:m.usage.input_tokens+m.usage.output_tokens,estimatedCostUsd:y.totalCost}),{content:m.content.filter(v=>v.type==="text").map(v=>v.text).join(""),model:m.model,provider:"claude",usage:b,cost:y,latencyMs:p,finishReason:this.mapFinishReason(m.stop_reason),cached:!1,requestId:l}}catch(c){throw c instanceof Error&&"code"in c?c:a(c instanceof Error?c.message:"Request failed","NETWORK_ERROR",{provider:"claude",model:s,retryable:!0,cause:c})}}async embed(t,e){throw a("Claude does not support native embeddings. Use OpenAI or Ollama for embeddings.","MODEL_NOT_FOUND",{provider:"claude",retryable:!1})}async complete(t,e){let r=await this.generate(t,{model:e?.model,temperature:e?.temperature??.2,maxTokens:e?.maxTokens??256,stopSequences:e?.stopSequences??[`
|
|
21
21
|
|
|
22
22
|
`,"```"]});return{completion:r.content,model:r.model,provider:"claude",usage:r.usage,latencyMs:r.latencyMs,cached:r.cached}}getConfig(){return{...this.config}}getSupportedModels(){return["claude-opus-4-7","claude-sonnet-4-6","claude-haiku-4-5-20251001","claude-3-opus-20240229","claude-3-sonnet-20240229","claude-3-haiku-20240307"]}getCostPerToken(){return _.getCostPerToken(this.config.model)}async dispose(){}getApiKey(){return this.config.apiKey??process.env.ANTHROPIC_API_KEY}getBaseUrl(){return(this.config.baseUrl??process.env.ANTHROPIC_BASE_URL??"https://api.anthropic.com").replace(/\/$/,"")}getHeaders(){return{"Content-Type":"application/json","x-api-key":this.getApiKey(),"anthropic-version":this.config.anthropicVersion??"2023-06-01"}}formatMessages(t){return typeof t=="string"?[{role:"user",content:t}]:t.filter(e=>e.role!=="system").map(e=>({role:e.role,content:e.content}))}mapFinishReason(t){switch(t){case"end_turn":return"stop";case"max_tokens":return"length";case"stop_sequence":return"stop";default:return"stop"}}handleApiError(t,e,r){let o="error"in e?e.error?.message??"Unknown API error":"Unknown API error",s="error"in e&&"type"in e.error?e.error.type:"";switch(t){case 401:throw a(o,"API_KEY_INVALID",{provider:"claude",model:r,retryable:!1});case 429:throw a(o,"RATE_LIMITED",{provider:"claude",model:r,retryable:!0,retryAfterMs:6e4});case 400:throw s==="invalid_request_error"&&o.includes("context")?a(o,"CONTEXT_LENGTH_EXCEEDED",{provider:"claude",model:r,retryable:!1}):a(o,"UNKNOWN",{provider:"claude",model:r,retryable:!1});case 500:case 502:case 503:throw a(o,"PROVIDER_UNAVAILABLE",{provider:"claude",model:r,retryable:!0,retryAfterMs:5e3});default:throw a(o,"UNKNOWN",{provider:"claude",model:r,retryable:!1})}}async fetchWithTimeout(t,e,r){return A(t,e,r,()=>a("Request timed out","TIMEOUT",{provider:"claude",retryable:!0}))}async fetchWithRetry(t,e,r,o){let s;for(let n=0;n<o;n++)try{let i=await this.fetchWithTimeout(t,e,r);if(i.status>=400&&i.status<500&&i.status!==429)return i;if((i.status>=500||i.status===429)&&n<o-1){let l=C(n);await this.sleep(l);continue}return i}catch(i){if(s=R(i),n<o-1){let l=C(n);await this.sleep(l)}}throw s??new Error("Request failed after retries")}sleep(t){return new Promise(e=>setTimeout(e,t))}};import{spawn as ot}from"node:child_process";Ge();var st=["ANTHROPIC_API_KEY","CLAUDE_API_KEY","ANTHROPIC_AUTH_TOKEN"],nt={model:"sonnet",maxTokens:4096,temperature:.7,timeoutMs:12e4,maxRetries:1,binaryPath:"claude",maxConcurrency:2,disallowedTools:["Bash","Edit","Write","NotebookEdit","WebFetch","WebSearch","Task"]},ee=class g{type="claude-code";name="Claude Code (subscription)";billingMode="subscription";config;requestId=0;availabilityCache;active=0;queue=[];constructor(t={}){this.config={...nt,...t};let e=Number.parseInt(process.env.AQE_CLAUDE_CODE_CONCURRENCY??"",10);Number.isFinite(e)&&e>0&&(this.config.maxConcurrency=e)}async isAvailable(){let t=Date.now();if(this.availabilityCache&&t-this.availabilityCache.at<6e4)return this.availabilityCache.available;let e=!1;try{let{code:r}=await this.runProcess(["--version"],void 0,5e3);e=r===0}catch{e=!1}return this.availabilityCache={at:t,available:e},e}async healthCheck(){let t=Date.now(),e=await this.isAvailable(),r=Date.now()-t;return e?{healthy:!0,latencyMs:r,models:this.getSupportedModels(),details:{binaryPath:this.config.binaryPath,billing:"subscription"}}:{healthy:!1,latencyMs:r,error:`Claude Code CLI ("${this.config.binaryPath}") not found or not runnable. Install Claude Code and log in with your Pro/Max account.`}}async generate(t,e){let r=this.toCliModel(e?.model??this.config.model),o=`claude-code-${++this.requestId}-${Date.now()}`,{prompt:s,systemPrompt:n}=this.flatten(t,e?.systemPrompt),i=["-p","--output-format","json","--model",r];n&&i.push("--append-system-prompt",n);let l=this.config.disallowedTools??[];l.length>0&&i.push("--disallowedTools",...l);let d=Date.now(),h=e?.timeoutMs??this.config.timeoutMs??12e4,{code:c,stdout:p,stderr:m}=await this.withConcurrency(()=>this.runProcess(i,s,h)),u=Date.now()-d;if(c!==0&&!p.trim())throw this.classifyError(m||`claude exited with code ${c}`,r);let f;try{f=JSON.parse(p)}catch{throw a(`Could not parse claude -p JSON output: ${ke(p,Number.POSITIVE_INFINITY).slice(0,200)}`,"PROVIDER_UNAVAILABLE",{provider:"claude-code",model:r,retryable:!0})}if(f.is_error)throw this.classifyError(f.result??f.api_error_status??"claude error",r);let b=f.usage??{},y={promptTokens:b.input_tokens??0,completionTokens:b.output_tokens??0,totalTokens:(b.input_tokens??0)+(b.output_tokens??0),cacheCreationTokens:b.cache_creation_input_tokens??0,cacheReadTokens:b.cache_read_input_tokens??0},k=f.modelUsage&&Object.keys(f.modelUsage)[0]||r;return E.recordTokenUsage(o,"claude-code-provider","llm","generate",{inputTokens:y.promptTokens,outputTokens:y.completionTokens,totalTokens:y.totalTokens,estimatedCostUsd:0}),{content:f.result??"",model:k,provider:"claude-code",usage:y,cost:{inputCost:0,outputCost:0,totalCost:0,currency:"USD",source:"provider-receipt"},latencyMs:u,finishReason:this.mapFinishReason(f.stop_reason),cached:!1,requestId:o}}async embed(t,e){throw a("Claude Code provider does not support embeddings. Use openai, ollama, or cognitum.","MODEL_NOT_FOUND",{provider:"claude-code",retryable:!1})}async complete(t,e){let r=await this.generate(t,{model:e?.model,temperature:e?.temperature??.2,maxTokens:e?.maxTokens??256});return{completion:r.content,model:r.model,provider:"claude-code",usage:r.usage,latencyMs:r.latencyMs,cached:r.cached}}getConfig(){return{...this.config}}getSupportedModels(){return["opus","sonnet","haiku"]}getCostPerToken(){return{input:0,output:0}}async dispose(){}toCliModel(t){let e=t.toLowerCase();return e.includes("opus")?"opus":e.includes("haiku")?"haiku":e.includes("sonnet")?"sonnet":t}flatten(t,e){if(typeof t=="string")return{prompt:t,systemPrompt:e};let r=t.filter(s=>s.role==="system").map(s=>s.content);return e&&r.unshift(e),{prompt:t.filter(s=>s.role!=="system").map(s=>`${s.role==="assistant"?"Assistant":"User"}: ${s.content}`).join(`
|
|
23
23
|
|