agentic-qe 3.14.2 → 3.14.3
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/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +72 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-AKQYU6UH.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-SD5N32MX.js → agent-booster-wasm-TQOMLWWX.js} +2 -2
- package/dist/cli/chunks/{agent-handler-OZRSJM7F.js → agent-handler-Q3SEMMI2.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-NYTRANRN.js → agent-memory-branch-SJXAQSZI.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-MICRPL3N.js +2 -0
- package/dist/cli/chunks/{arena-EX3SC2DP.js → arena-7RC7TBGW.js} +4 -4
- package/dist/cli/chunks/{arena-FOTVSRK4.js → arena-UPB7TKUY.js} +2 -2
- package/dist/cli/chunks/{audit-Q5GHSUQY.js → audit-IXN5R4WB.js} +3 -3
- package/dist/cli/chunks/base-DZK36ITB.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-S7M5R2HS.js → better-sqlite3-RP4DEGK3.js} +2 -2
- package/dist/cli/chunks/{brain-handler-5FSA46R5.js → brain-handler-H5OVZ22L.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-RWAXTGEU.js → branch-enumerator-VPRWDGFJ.js} +2 -2
- package/dist/cli/chunks/{browser-IGDESJGF.js → browser-B6E7JPPJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-ADK54DOE.js +2 -0
- package/dist/cli/chunks/{chunk-E3Q7WNJD.js → chunk-26GM5CWD.js} +3 -3
- package/dist/cli/chunks/{chunk-BWRHOIYC.js → chunk-2GNRW3OD.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCDXJ27H.js → chunk-2IGT5WNQ.js} +1 -1
- package/dist/cli/chunks/{chunk-7SK6IMGZ.js → chunk-2WT7AKKK.js} +2 -2
- package/dist/cli/chunks/{chunk-DVHWLAEO.js → chunk-33VPWGCM.js} +3 -3
- package/dist/cli/chunks/{chunk-NAZVPZJS.js → chunk-37BASGWC.js} +2 -2
- package/dist/cli/chunks/{chunk-Q335R4MR.js → chunk-3ABRGG3C.js} +2 -2
- package/dist/cli/chunks/{chunk-IWFL6EFI.js → chunk-3P6NCFI2.js} +2 -2
- package/dist/cli/chunks/{chunk-4AKGBUYD.js → chunk-42VSQ2MX.js} +3 -3
- package/dist/cli/chunks/{chunk-2LKAMMMI.js → chunk-44WISFTU.js} +2 -2
- package/dist/cli/chunks/{chunk-RFNEHNJV.js → chunk-4C6UJIHB.js} +1 -1
- package/dist/cli/chunks/{chunk-CTCQOYBS.js → chunk-4JBFJTHJ.js} +1 -1
- package/dist/cli/chunks/{chunk-GJAWEUIN.js → chunk-4OUPCTBS.js} +2 -2
- package/dist/cli/chunks/{chunk-2EHFEMRU.js → chunk-4Q35TI6Z.js} +2 -2
- package/dist/cli/chunks/{chunk-N3RN4QTC.js → chunk-4RP5VUBI.js} +2 -2
- package/dist/cli/chunks/{chunk-ZYLSOBOR.js → chunk-4TXAP3YH.js} +1 -1
- package/dist/cli/chunks/{chunk-KZOBLLXW.js → chunk-4UDZLD42.js} +2 -2
- package/dist/cli/chunks/{chunk-UYTWDS2R.js → chunk-4W7QVUNO.js} +2 -2
- package/dist/cli/chunks/{chunk-4ZUZDFAA.js → chunk-4XPPMADQ.js} +2 -2
- package/dist/cli/chunks/{chunk-TENYL5TI.js → chunk-527HQAY7.js} +2 -2
- package/dist/cli/chunks/chunk-5BLFXQEB.js +96 -0
- package/dist/cli/chunks/{chunk-OX6T26CD.js → chunk-5DFHE4H5.js} +3 -3
- package/dist/cli/chunks/{chunk-T46LOLW3.js → chunk-5F6DWHQG.js} +2 -2
- package/dist/cli/chunks/{chunk-FVGTINVR.js → chunk-5FOZO7KM.js} +81 -65
- package/dist/cli/chunks/{chunk-T4C56HBW.js → chunk-5IAB5NRZ.js} +2 -2
- package/dist/cli/chunks/{chunk-4MH22236.js → chunk-5P3G6ZW4.js} +1 -1
- package/dist/cli/chunks/{chunk-7AFBNU6K.js → chunk-5Y5TC6BY.js} +2 -2
- package/dist/cli/chunks/{chunk-VSYBMNIR.js → chunk-6F2RM6X2.js} +1 -1
- package/dist/cli/chunks/{chunk-ICKLBATY.js → chunk-72UJXEKQ.js} +2 -2
- package/dist/cli/chunks/{chunk-A7N3YUDJ.js → chunk-74PK3NEW.js} +2 -2
- package/dist/cli/chunks/{chunk-PMUBG2RU.js → chunk-7BUERZYL.js} +2 -2
- package/dist/cli/chunks/{chunk-HZMLNM2T.js → chunk-7FYMDKQH.js} +174 -169
- package/dist/cli/chunks/{chunk-67A6PEZM.js → chunk-7G6UX2QN.js} +2 -2
- package/dist/cli/chunks/{chunk-G2CLZVYI.js → chunk-7JQHPANT.js} +3 -3
- package/dist/cli/chunks/{chunk-TLPL3EQY.js → chunk-7SLAZAVU.js} +2 -2
- package/dist/cli/chunks/{chunk-4UCMTYFQ.js → chunk-7Y2CEXRS.js} +4 -4
- package/dist/cli/chunks/{chunk-2H5YJ5ZK.js → chunk-AB4U6ZNI.js} +2 -2
- package/dist/cli/chunks/chunk-AWNYEAGB.js +2 -0
- package/dist/cli/chunks/chunk-B2ZONZPZ.js +5 -0
- package/dist/cli/chunks/{chunk-6F4WHN7D.js → chunk-B5XFDFBT.js} +1 -1
- package/dist/cli/chunks/{chunk-5EHLGOWW.js → chunk-B7SWW5A6.js} +2 -2
- package/dist/cli/chunks/{chunk-P64DMQ2C.js → chunk-BN7DKW5D.js} +1 -1
- package/dist/cli/chunks/{chunk-CIESXO73.js → chunk-C46DMCWF.js} +1 -1
- package/dist/cli/chunks/{chunk-HZ6NEJMO.js → chunk-CB5JPRIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-SEHCX4NH.js → chunk-CBOPBYPU.js} +1 -1
- package/dist/cli/chunks/{chunk-LWUJQGCS.js → chunk-CR3QGHVN.js} +2 -2
- package/dist/cli/chunks/{chunk-NHHWLJQF.js → chunk-D4Z2N74A.js} +1 -1
- package/dist/cli/chunks/{chunk-4K27ESCA.js → chunk-DBA3N742.js} +1 -1
- package/dist/cli/chunks/{chunk-2TG24LYQ.js → chunk-DX3C5HPN.js} +1 -1
- package/dist/cli/chunks/{chunk-S4MR6RTE.js → chunk-E3FBW6G2.js} +1 -1
- package/dist/cli/chunks/{chunk-GHUPID5E.js → chunk-ELU4IC3I.js} +1 -1
- package/dist/cli/chunks/{chunk-C7AXRI7E.js → chunk-EY4OQHU3.js} +1 -1
- package/dist/cli/chunks/{chunk-6LMLN5R2.js → chunk-F67AV5P2.js} +2 -2
- package/dist/cli/chunks/chunk-FD2JFEQC.js +2 -0
- package/dist/cli/chunks/chunk-FKG5OQFT.js +2 -0
- package/dist/cli/chunks/{chunk-UIGEUEBT.js → chunk-FUE6LL72.js} +2 -2
- package/dist/cli/chunks/{chunk-4RT7I7PI.js → chunk-G5C2XVZC.js} +1 -1
- package/dist/cli/chunks/{chunk-WVY22NHZ.js → chunk-G6DCESPU.js} +2 -2
- package/dist/cli/chunks/{chunk-3DFFFXXO.js → chunk-G6ZHTF42.js} +2 -2
- package/dist/cli/chunks/{chunk-CH2TQCV5.js → chunk-GNTVFN7D.js} +1 -1
- package/dist/cli/chunks/{chunk-WMW47QMR.js → chunk-H5ZRV5K5.js} +2 -2
- package/dist/cli/chunks/{chunk-4M6A3PVJ.js → chunk-H6XBM2LY.js} +2 -2
- package/dist/cli/chunks/{chunk-4N44UJGI.js → chunk-HOQQCY2K.js} +2 -2
- package/dist/cli/chunks/{chunk-D4RCV4LY.js → chunk-HRUU7E3D.js} +2 -2
- package/dist/cli/chunks/{chunk-EAJK25IS.js → chunk-HXE5NBJG.js} +1 -1
- package/dist/cli/chunks/{chunk-IUNMW454.js → chunk-I4NDQGKP.js} +2 -2
- package/dist/cli/chunks/{chunk-CJHVOBJY.js → chunk-IFFZR6GY.js} +1 -1
- package/dist/cli/chunks/{chunk-YN6W2XIT.js → chunk-IKIITGU5.js} +3 -3
- package/dist/cli/chunks/{chunk-JIUF6NV6.js → chunk-IP7NSFQQ.js} +2 -2
- package/dist/cli/chunks/{chunk-3C2K4YMS.js → chunk-IQEJGZV6.js} +3 -3
- package/dist/cli/chunks/{chunk-RGH3WGWD.js → chunk-IU4EBTA2.js} +3 -3
- package/dist/cli/chunks/{chunk-QW4LN5NK.js → chunk-JBB7E26R.js} +2 -2
- package/dist/cli/chunks/{chunk-RYJHREYS.js → chunk-JRYZKBY2.js} +2 -2
- package/dist/cli/chunks/{chunk-6EHN7Q2Q.js → chunk-JV4FZUE7.js} +2 -2
- package/dist/cli/chunks/{chunk-PZKZY6PB.js → chunk-KF63AYXD.js} +2 -2
- package/dist/cli/chunks/{chunk-ZFGND4QK.js → chunk-KPMGTVB4.js} +1 -1
- package/dist/cli/chunks/chunk-L2GKMBDP.js +2 -0
- package/dist/cli/chunks/{chunk-7FWP7CZY.js → chunk-LHGNNZ76.js} +3 -3
- package/dist/cli/chunks/{chunk-HSJ5FQCF.js → chunk-LKN7JQTW.js} +2 -2
- package/dist/cli/chunks/{chunk-EH5OCHAJ.js → chunk-LLVGTEHU.js} +1 -1
- package/dist/cli/chunks/{chunk-TYVQNYXX.js → chunk-LS3EUMBP.js} +6 -6
- package/dist/cli/chunks/{chunk-F2KRT2II.js → chunk-LTBCAFTZ.js} +3 -3
- package/dist/cli/chunks/{chunk-PVHO6KLB.js → chunk-LVLBIKJD.js} +1 -1
- package/dist/cli/chunks/{chunk-5WJUNRTY.js → chunk-MDZ6RRLX.js} +2 -2
- package/dist/cli/chunks/{chunk-W4OQYLYO.js → chunk-MWWAMDHI.js} +1 -1
- package/dist/cli/chunks/{chunk-N5ZRUOMR.js → chunk-MXMFGSWR.js} +2 -2
- package/dist/cli/chunks/{chunk-L2F7FVIU.js → chunk-N4H2QOT5.js} +2 -2
- package/dist/cli/chunks/{chunk-R5RNOLHI.js → chunk-NBWQBQO5.js} +1 -1
- package/dist/cli/chunks/{chunk-IVGVOGIZ.js → chunk-NN76NTOX.js} +1 -1
- package/dist/cli/chunks/{chunk-OBCKP3G4.js → chunk-NTSXHZTC.js} +2 -2
- package/dist/cli/chunks/{chunk-YF5OP6CR.js → chunk-OV5EZO3U.js} +2 -2
- package/dist/cli/chunks/{chunk-JQ2ZD3WO.js → chunk-OVDKWCD7.js} +2 -2
- package/dist/cli/chunks/{chunk-WBH4C4BG.js → chunk-OVPJQWHW.js} +2 -2
- package/dist/cli/chunks/{chunk-6SZKLWZT.js → chunk-OY7MLMEX.js} +5 -5
- package/dist/cli/chunks/{chunk-NG2UVPTW.js → chunk-OYMLHX2B.js} +1 -1
- package/dist/cli/chunks/{chunk-RVCWSAXI.js → chunk-PI74GOE4.js} +2 -2
- package/dist/cli/chunks/{chunk-42WUDDUU.js → chunk-PZTVH2AS.js} +2 -2
- package/dist/cli/chunks/{chunk-4PH7O5ZH.js → chunk-QLWNXBRU.js} +2 -2
- package/dist/cli/chunks/{chunk-FPHPP5TQ.js → chunk-R2AFVFRF.js} +1 -1
- package/dist/cli/chunks/{chunk-MWQTACNA.js → chunk-RKJZWWB7.js} +2 -2
- package/dist/cli/chunks/{chunk-FREF6Y4L.js → chunk-ROX7NLS4.js} +2 -2
- package/dist/cli/chunks/{chunk-K574FLVB.js → chunk-RTJ2M6V6.js} +2 -2
- package/dist/cli/chunks/{chunk-NWFIJNEB.js → chunk-SG47AXJG.js} +1 -1
- package/dist/cli/chunks/{chunk-UHTAI4ZB.js → chunk-SGXSB7YO.js} +1 -1
- package/dist/cli/chunks/{chunk-PWEIDHT7.js → chunk-SHGKY3QB.js} +2 -2
- package/dist/cli/chunks/{chunk-MH73D5TN.js → chunk-SJPZSCZP.js} +2 -2
- package/dist/cli/chunks/{chunk-3WV4H33V.js → chunk-SQ3PPISY.js} +1 -1
- package/dist/cli/chunks/{chunk-RCI64RIJ.js → chunk-STRDSVH3.js} +2 -2
- package/dist/cli/chunks/{chunk-GHQ5PUOV.js → chunk-T35GZXTU.js} +2 -2
- package/dist/cli/chunks/{chunk-DRO5NJZA.js → chunk-T62DH4GG.js} +2 -2
- package/dist/cli/chunks/{chunk-W2FLULF4.js → chunk-TFHQE6NK.js} +2 -2
- package/dist/cli/chunks/{chunk-LML5VTFK.js → chunk-TGLAWI62.js} +1 -1
- package/dist/cli/chunks/{chunk-KFXZDQ5J.js → chunk-TISSZFHO.js} +1 -1
- package/dist/cli/chunks/{chunk-KPFG4OIM.js → chunk-TJEIOE7F.js} +1 -1
- package/dist/cli/chunks/{chunk-57TNBR2P.js → chunk-TTMHIOQ3.js} +2 -2
- package/dist/cli/chunks/{chunk-ARMZYHYL.js → chunk-UHQY3GK7.js} +2 -2
- package/dist/cli/chunks/{chunk-ADK7DF3G.js → chunk-UMENRGHK.js} +2 -2
- package/dist/cli/chunks/{chunk-ZWRQ5VAU.js → chunk-UMNYF5EZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G6AV2HGY.js → chunk-UTVRQEZM.js} +3 -3
- package/dist/cli/chunks/{chunk-VOYJJ3KA.js → chunk-UYJHYMEQ.js} +2 -2
- package/dist/cli/chunks/{chunk-KEEBUVGV.js → chunk-V4AOVDCJ.js} +2 -2
- package/dist/cli/chunks/{chunk-HBTC4L53.js → chunk-VIDBBB6F.js} +2 -2
- package/dist/cli/chunks/{chunk-PFXX5Q32.js → chunk-VWNHKYK7.js} +2 -2
- package/dist/cli/chunks/{chunk-DW6ZMNMR.js → chunk-WYMGK5DX.js} +2 -2
- package/dist/cli/chunks/{chunk-CJCT452S.js → chunk-XA7CG3LH.js} +2 -2
- package/dist/cli/chunks/{chunk-QFUX7ELG.js → chunk-XX7HUSX2.js} +2 -2
- package/dist/cli/chunks/{chunk-WXMSRBQF.js → chunk-XXCYQXK3.js} +2 -2
- package/dist/cli/chunks/{chunk-6VKJAMZY.js → chunk-Y2DVFVGI.js} +1 -1
- package/dist/cli/chunks/{chunk-JDXLCNKV.js → chunk-Y5SQBI2F.js} +2 -2
- package/dist/cli/chunks/{chunk-QXTW7XCS.js → chunk-YAKS3CAB.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3JHS3UD.js → chunk-YCBDE2N7.js} +2 -2
- package/dist/cli/chunks/{chunk-VNAKBHJI.js → chunk-YDNSLLBS.js} +2 -2
- package/dist/cli/chunks/{chunk-S7N4BKI3.js → chunk-YEXPFHV6.js} +2 -2
- package/dist/cli/chunks/{chunk-CG2MUD7U.js → chunk-YGB6R5DW.js} +1 -1
- package/dist/cli/chunks/{chunk-NNOMDM4N.js → chunk-YL7T3VV7.js} +2 -2
- package/dist/cli/chunks/{chunk-U54OOA24.js → chunk-ZHXWGNYM.js} +1 -1
- package/dist/cli/chunks/{chunk-NRR23SJV.js → chunk-ZK5JKHP4.js} +1 -1
- package/dist/cli/chunks/{chunk-XPLSLHRB.js → chunk-ZN3J6TZD.js} +1 -1
- package/dist/cli/chunks/{chunk-RHJVDCLV.js → chunk-ZUG5MOUB.js} +2 -2
- package/dist/cli/chunks/{ci-NTRH7PAW.js → ci-YVKDQWIX.js} +2 -2
- package/dist/cli/chunks/ci-output-LK3MBXLZ.js +2 -0
- package/dist/cli/chunks/{circuit-breaker-4WST3QSA.js → circuit-breaker-7AIXACR7.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-KB4TKMYI.js → claude-flow-setup-UA7EO6VN.js} +2 -2
- package/dist/cli/chunks/client-M72GXFVQ.js +2 -0
- package/dist/cli/chunks/{cline-installer-W2ZHQ6WM.js → cline-installer-YDDCKKEV.js} +2 -2
- package/dist/cli/chunks/{code-TF2AVR5D.js → code-URB7UAKW.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-RMDRUVQJ.js → code-index-extractor-BL6HWH4Q.js} +2 -2
- package/dist/cli/chunks/{codex-installer-VSTRHJHV.js → codex-installer-2AVEO4EA.js} +2 -2
- package/dist/cli/chunks/{completions-3Q37QVFR.js → completions-RCKBSSSS.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-3FNFLACD.js → complexity-analyzer-LEDG62YK.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-VTEXM455.js → continuedev-installer-VOTCEBFH.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-AGY7DQUS.js → copilot-installer-NVTGLZX3.js} +2 -2
- package/dist/cli/chunks/core-handlers-C32RAMVI.js +2 -0
- package/dist/cli/chunks/{cost-tracker-LTZAQBX7.js → cost-tracker-GJIFB2BM.js} +2 -2
- package/dist/cli/chunks/{coverage-TT64IOS4.js → coverage-ZTPJWXWE.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-UGFUCPKC.js +2 -0
- package/dist/cli/chunks/{cursor-installer-OVOJIOHN.js → cursor-installer-CMGJQMHX.js} +2 -2
- package/dist/cli/chunks/{daemon-DMFZMXKA.js → daemon-V456IWR3.js} +3 -3
- package/dist/cli/chunks/{daemon-XCULEHWY.js → daemon-Y2I3YVIU.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-WW2RX4B5.js → dag-attention-scheduler-ZCBBOD3D.js} +2 -2
- package/dist/cli/chunks/{detect-QNWIM232.js → detect-2GHEA4A3.js} +2 -2
- package/dist/cli/chunks/{dist-node-6GQIY3CG.js → dist-node-44AGYJCH.js} +2 -2
- package/dist/cli/chunks/{domain-handler-6RJPDELX.js → domain-handler-IDLIEP6X.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-WK524LBS.js → domain-transfer-KLEXGIRF.js} +2 -2
- package/dist/cli/chunks/dream-UFBBXY5W.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-SO6GWJW7.js → embed-and-insert-pattern-DUW6K35A.js} +2 -2
- package/dist/cli/chunks/{eval-GL544IPO.js → eval-PR6YWDFM.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-BCCJ35OX.js → experience-capture-middleware-CJJJN7CF.js} +3 -3
- package/dist/cli/chunks/{fast-paths-CATDDBEU.js → fast-paths-LGLLKX6P.js} +2 -2
- package/dist/cli/chunks/{feature-flags-BUXNAORY.js → feature-flags-33D3I4DD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-KNNWWP5G.js → feature-flags-QL4NCEGW.js} +2 -2
- package/dist/cli/chunks/{file-discovery-S4HF3O7D.js → file-discovery-GKCYJPFZ.js} +2 -2
- package/dist/cli/chunks/{fleet-DQVQQONW.js → fleet-QNT6X2YI.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-G7ABZUG7.js → gnn-wrapper-ELSGT67Z.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-UFMELIWT.js → heartbeat-handler-ZUI3DOOP.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-VQWHSGTY.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-BS3NXWGU.js +2 -0
- package/dist/cli/chunks/hnsw-index-JP26B4HW.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-YIILSRXI.js → hnsw-legacy-bridge-EZMM5JWL.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-TSVRMXDH.js → hnswlib-node-G4CE3EOS.js} +2 -2
- package/dist/cli/chunks/{hooks-OHQPNK74.js → hooks-LCVXXA55.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-LY7PJDSL.js → hypergraph-engine-6Z7RQ3HI.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-YGDYZO6H.js → hypergraph-handler-PLI2GYPK.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-WRE4CWPJ.js +2 -0
- package/dist/cli/chunks/{init-handler-MTK65LI3.js → init-handler-7VH3QJ5Y.js} +6 -6
- package/dist/cli/chunks/init-wizard-OFOEYB75.js +2 -0
- package/dist/cli/chunks/kernel-MXNFWNUD.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-3IICU4RS.js → kilocode-installer-U3MW62DE.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-MXOVQYQA.js → kiro-installer-PPEAC44T.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-7JE2TVKJ.js +2 -0
- package/dist/cli/chunks/{learning-EV5LSOOM.js → learning-7B5NITDV.js} +3 -3
- package/dist/cli/chunks/{llm-router-7LYDJUOT.js → llm-router-BNEPT5OB.js} +4 -4
- package/dist/cli/chunks/llm-router-service-GTDVDKSU.js +2 -0
- package/dist/cli/chunks/{load-F4PVAMXQ.js → load-VO7ABNHV.js} +2 -2
- package/dist/cli/chunks/load-test-JZ4CLSBF.js +2 -0
- package/dist/cli/chunks/{mcp-DUYJUEME.js → mcp-THXEINCL.js} +2 -2
- package/dist/cli/chunks/{memory-XTTYORAS.js → memory-FZTT7ADM.js} +5 -5
- package/dist/cli/chunks/memory-backend-Q54CC5A5.js +2 -0
- package/dist/cli/chunks/memory-handlers-IIBJXKHZ.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-R6XCTMCF.js → multi-model-executor-HEDVOZ6X.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-33ULBU2F.js → opencode-installer-GQ7J5SBG.js} +2 -2
- package/dist/cli/chunks/{orchestrator-34ZJEKTJ.js → orchestrator-66JK2OS5.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-W33O7FYO.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-GZ2M3F2E.js → pattern-usage-recorder-O6XHM2G5.js} +2 -2
- package/dist/cli/chunks/{pipeline-SR5OTY45.js → pipeline-UOG6UO6D.js} +2 -2
- package/dist/cli/chunks/{platform-VKJFJIAW.js → platform-Q7UH7FZQ.js} +2 -2
- package/dist/cli/chunks/{plugin-5C5UBQUQ.js → plugin-7OFLNGOS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-KO2PQI3D.js → prime-radiant-advanced-wasm-OSRDK2FW.js} +2 -2
- package/dist/cli/chunks/protocol-executor-VGN4M7XY.js +2 -0
- package/dist/cli/chunks/{protocol-handler-ZF74NIKA.js → protocol-handler-WLYTX6FS.js} +2 -2
- package/dist/cli/chunks/{prove-MO5TQQU4.js → prove-QVNE4V3J.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-7VB5LJGS.js +2 -0
- package/dist/cli/chunks/{quality-EYIN6AER.js → quality-DNE2RKE5.js} +2 -2
- package/dist/cli/chunks/{quality-gate-V6OQM57O.js → quality-gate-2K35GCSI.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-HIDMJMMG.js +2 -0
- package/dist/cli/chunks/{real-embeddings-AR7TZX7U.js → real-embeddings-SF42ML7G.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-46E626VZ.js → roocode-installer-NCEZPF5L.js} +2 -2
- package/dist/cli/chunks/router-CTIJS4D7.js +2 -0
- package/dist/cli/chunks/routing-feedback-LFYYZS5J.js +2 -0
- package/dist/cli/chunks/{routing-handler-ZNRVW6QW.js → routing-handler-4MXXZRYP.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-4L2CQMWS.js → ruvector-commands-WDFMMCMK.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-MNPMIWVM.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-DXOKSSNW.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-H4RVGBIA.js → rvf-migration-coordinator-JT7ZCJY7.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-PZKUKA7R.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-OJGWWPLL.js → rvf-store-integrity-Q3FGYKFT.js} +2 -2
- package/dist/cli/chunks/safe-db-73BLFV2C.js +2 -0
- package/dist/cli/chunks/schedule-YVTGTTI4.js +2 -0
- package/dist/cli/chunks/scheduler-5DSAFIRQ.js +2 -0
- package/dist/cli/chunks/security-CJJ3WJSB.js +13 -0
- package/dist/cli/chunks/{shared-rvf-adapter-M6NNIZ5W.js → shared-rvf-adapter-6RGCTLHD.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-LHMFCYVE.js → shared-rvf-dual-writer-KIA6Q6MT.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-LRG4IPCU.js +2 -0
- package/dist/cli/chunks/{status-handler-GMIOXQIE.js → status-handler-BADQV2KA.js} +2 -2
- package/dist/cli/chunks/{structural-health-YZXHVHM6.js → structural-health-VMYEYRZG.js} +2 -2
- package/dist/cli/chunks/{sync-GMPCPV5L.js → sync-PXLROLHB.js} +2 -2
- package/dist/cli/chunks/{sync-N56UQGCS.js → sync-ULY7T5II.js} +2 -2
- package/dist/cli/chunks/{task-handler-VTNRGAXP.js → task-handler-L7E2I267.js} +2 -2
- package/dist/cli/chunks/{task-handlers-FYSDH55N.js → task-handlers-6DPKE4AK.js} +3 -3
- package/dist/cli/chunks/{test-GQNCKRSP.js → test-WCLURQUT.js} +11 -11
- package/dist/cli/chunks/test-scheduling-4CNJA6TW.js +15 -0
- package/dist/cli/chunks/{token-bootstrap-76SRNXGG.js → token-bootstrap-GTI24JAL.js} +2 -2
- package/dist/cli/chunks/{token-usage-O7CZDP5Q.js → token-usage-DRVG6PKO.js} +2 -2
- package/dist/cli/chunks/{transformers-LTU4LSSC.js → transformers-IMDDAMYQ.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-NQSQCMBM.js → tree-sitter-wasm-parser-WBZIHVFA.js} +2 -2
- package/dist/cli/chunks/{types-OP6IWE6N.js → types-TXMY5M2K.js} +2 -2
- package/dist/cli/chunks/unified-memory-VBQ572X4.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-J3L74ZRY.js +2 -0
- package/dist/cli/chunks/unified-persistence-EM2VYRTQ.js +2 -0
- package/dist/cli/chunks/{upgrade-OQWRBZ3R.js → upgrade-6ALSDWDD.js} +2 -2
- package/dist/cli/chunks/{validate-TH5SRP3E.js → validate-XF4ZG3LC.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-UITL2JUS.js → validate-swarm-P5TAFRDA.js} +2 -2
- package/dist/cli/chunks/{vibium-O6PRAG4J.js → vibium-2XDXKNKZ.js} +2 -2
- package/dist/cli/chunks/visual-security-GX4S7K6O.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-XBFBY4OF.js → web-tree-sitter-4JVRQPX5.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DVT5NRNY.js → windsurf-installer-WYJXVDO5.js} +2 -2
- package/dist/cli/chunks/witness-chain-QGKMHCNW.js +2 -0
- package/dist/cli/chunks/{witness-chain-VRSH2F36.js → witness-chain-RPZ2SE2V.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-GFHRDKQ4.js → witness-key-manager-LXG2VBQQ.js} +2 -2
- package/dist/cli/chunks/{workflow-HAZ6YKOG.js → workflow-2OYNO7UU.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-KWHIJMFV.js +2 -0
- package/dist/cli/chunks/{wrappers-5LLLT7GM.js → wrappers-DIJNNFU6.js} +2 -2
- package/dist/cli/commands/security.js +167 -100
- package/dist/cli/commands/test.js +1 -0
- package/dist/cli/utils/ci-output.d.ts +17 -0
- package/dist/cli/utils/ci-output.js +34 -2
- package/dist/coordination/handlers/handler-types.d.ts +3 -0
- package/dist/coordination/handlers/quality-handlers.js +10 -0
- package/dist/coordination/handlers/security-handlers.js +168 -72
- package/dist/coordination/handlers/test-execution-handlers.js +37 -43
- package/dist/coordination/protocols/security-audit.d.ts +3 -0
- package/dist/coordination/protocols/security-audit.js +61 -39
- package/dist/coordination/result-saver.js +36 -5
- package/dist/coordination/task-executor.d.ts +3 -1
- package/dist/coordination/task-executor.js +4 -0
- package/dist/domains/security-compliance/interfaces.d.ts +5 -0
- package/dist/domains/security-compliance/interfaces.js +0 -6
- package/dist/domains/security-compliance/scan-discovery.d.ts +12 -0
- package/dist/domains/security-compliance/scan-discovery.js +105 -0
- package/dist/domains/security-compliance/scan-evidence.d.ts +57 -0
- package/dist/domains/security-compliance/scan-evidence.js +2 -0
- package/dist/domains/security-compliance/services/scanners/sast-scanner.d.ts +3 -2
- package/dist/domains/security-compliance/services/scanners/sast-scanner.js +109 -65
- package/dist/domains/security-compliance/services/semgrep-integration.d.ts +9 -2
- package/dist/domains/security-compliance/services/semgrep-integration.js +68 -20
- package/dist/domains/test-execution/services/flaky-detector.js +14 -3
- package/dist/domains/test-execution/services/retry-handler.js +18 -8
- package/dist/domains/test-execution/services/test-executor.js +46 -12
- package/dist/init/init-wizard-hooks.js +2 -2
- package/dist/integrations/agentic-flow/reasoning-bank/index.js +3 -20
- package/dist/integrations/coherence/engines/cohomology-adapter.js +100 -30
- package/dist/mcp/bundle.js +499 -478
- package/dist/mcp/handlers/domain-handler-configs.d.ts +22 -1
- package/dist/mcp/handlers/domain-handler-configs.js +50 -19
- package/dist/mcp/handlers/domain-handlers.d.ts +7 -5
- package/dist/mcp/handlers/domain-handlers.js +7 -5
- package/dist/mcp/protocol-server.js +9 -5
- package/dist/mcp/types.d.ts +5 -0
- package/dist/shared/llm/router/hybrid-router.d.ts +4 -0
- package/dist/shared/llm/router/hybrid-router.js +74 -26
- package/dist/shared/llm/router/types.d.ts +9 -2
- package/dist/shared/test-runner-verdict.d.ts +29 -0
- package/dist/shared/test-runner-verdict.js +43 -0
- package/dist/shared/vitest-json-report.d.ts +45 -0
- package/dist/shared/vitest-json-report.js +71 -0
- package/dist/test-scheduling/executors/vitest-executor.js +18 -6
- package/dist/validation/frontier-judge.d.ts +7 -4
- package/dist/validation/frontier-judge.js +11 -6
- package/package.json +6 -6
- package/dist/cli/chunks/adapter-OJF6LAJV.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-FGT474XB.js +0 -2
- package/dist/cli/chunks/base-HH765JFV.js +0 -2
- package/dist/cli/chunks/browser-workflow-NPM4FUPI.js +0 -2
- package/dist/cli/chunks/chunk-OC2CKU7I.js +0 -2
- package/dist/cli/chunks/chunk-PHHXHG2W.js +0 -2
- package/dist/cli/chunks/chunk-U2AY57XZ.js +0 -5
- package/dist/cli/chunks/chunk-WBMRADQP.js +0 -81
- package/dist/cli/chunks/ci-output-F57RSD35.js +0 -2
- package/dist/cli/chunks/client-GPZEC54E.js +0 -2
- package/dist/cli/chunks/core-handlers-YMGHYIBR.js +0 -2
- package/dist/cli/chunks/cross-domain-router-ECBNTGYJ.js +0 -2
- package/dist/cli/chunks/dream-EHGKCFWH.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-UFEL2CBW.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-BLSD45CX.js +0 -2
- package/dist/cli/chunks/hnsw-index-A3RZODEN.js +0 -2
- package/dist/cli/chunks/impact-analyzer-OXHD3FOH.js +0 -2
- package/dist/cli/chunks/init-wizard-PKZL7QBU.js +0 -2
- package/dist/cli/chunks/kernel-XWPM72UJ.js +0 -2
- package/dist/cli/chunks/knowledge-graph-FRKR5XWI.js +0 -2
- package/dist/cli/chunks/llm-router-service-R7A5HHDM.js +0 -2
- package/dist/cli/chunks/load-test-5IKDWSYL.js +0 -2
- package/dist/cli/chunks/memory-backend-7VW5QCMO.js +0 -2
- package/dist/cli/chunks/memory-handlers-VZH3R2TQ.js +0 -2
- package/dist/cli/chunks/pattern-null-store-BU6LCB2W.js +0 -2
- package/dist/cli/chunks/protocol-executor-BSP5LWJN.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-J2RC7P25.js +0 -2
- package/dist/cli/chunks/queen-coordinator-XI5AJV2V.js +0 -2
- package/dist/cli/chunks/router-VXQYYA3D.js +0 -2
- package/dist/cli/chunks/routing-feedback-HZQTASFF.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-BDTLLJER.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-IB343MDN.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-Y7SN7LHU.js +0 -2
- package/dist/cli/chunks/safe-db-2VTKKBJU.js +0 -2
- package/dist/cli/chunks/schedule-QJ4CFGJY.js +0 -2
- package/dist/cli/chunks/scheduler-2NHDQPC3.js +0 -2
- package/dist/cli/chunks/security-JF3BVNRO.js +0 -14
- package/dist/cli/chunks/sqlite-persistence-NVVAPZN3.js +0 -2
- package/dist/cli/chunks/test-scheduling-GPRXSIRP.js +0 -15
- package/dist/cli/chunks/unified-memory-DSTIEDSH.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-KBV3P4OS.js +0 -2
- package/dist/cli/chunks/unified-persistence-XKCOUBKY.js +0 -2
- package/dist/cli/chunks/visual-security-TTWSPZTZ.js +0 -2
- package/dist/cli/chunks/witness-chain-2KY73HPN.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UK56AVOT.js +0 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest JSON report handling that works on Vitest 4 and 5.
|
|
3
|
+
*
|
|
4
|
+
* Vitest 5 no longer prints the `--reporter=json` document to stdout; it
|
|
5
|
+
* writes `.vitest/json/output.json` and prints only
|
|
6
|
+
* `JSON report written to <path>`. Vitest 4 prints the document to stdout
|
|
7
|
+
* unless `--outputFile` is given, in which case it behaves like Vitest 5.
|
|
8
|
+
*
|
|
9
|
+
* Passing an explicit `--outputFile` therefore gives one contract on both
|
|
10
|
+
* majors: the report is always in a file we own. Every runner integration
|
|
11
|
+
* that spawns `vitest run --reporter=json` must go through this module
|
|
12
|
+
* instead of parsing stdout directly.
|
|
13
|
+
*/
|
|
14
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs';
|
|
15
|
+
import { tmpdir } from 'node:os';
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
/**
|
|
18
|
+
* Resolve the JSON document text for a finished Vitest run.
|
|
19
|
+
* Exported separately so the precedence rule is unit-testable without spawning.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveVitestJsonOutput(stdout, reportPath) {
|
|
22
|
+
if (reportPath && existsSync(reportPath)) {
|
|
23
|
+
try {
|
|
24
|
+
const content = readFileSync(reportPath, 'utf-8');
|
|
25
|
+
if (content.trim().length > 0)
|
|
26
|
+
return content;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// Unreadable report: fall back to stdout below.
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return stdout;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a per-run report location. The directory is unique per call so
|
|
36
|
+
* concurrent runs never read each other's output.
|
|
37
|
+
*/
|
|
38
|
+
export function createVitestJsonReport() {
|
|
39
|
+
const dir = mkdtempSync(join(tmpdir(), 'aqe-vitest-report-'));
|
|
40
|
+
const path = join(dir, 'report.json');
|
|
41
|
+
let cleaned = false;
|
|
42
|
+
return {
|
|
43
|
+
path,
|
|
44
|
+
args: [`--outputFile=${path}`],
|
|
45
|
+
read: (stdout) => resolveVitestJsonOutput(stdout, path),
|
|
46
|
+
cleanup: () => {
|
|
47
|
+
if (cleaned)
|
|
48
|
+
return;
|
|
49
|
+
cleaned = true;
|
|
50
|
+
try {
|
|
51
|
+
rmSync(dir, { recursive: true, force: true });
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Best effort: a leftover temp dir is not worth failing a test run over.
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* True when a command vector (runner command plus arguments) is a
|
|
61
|
+
* `vitest ... --reporter=json` invocation that has not already been given an
|
|
62
|
+
* output file. Pass the runner command as the first element when the caller
|
|
63
|
+
* configures it separately (for example `testRunner: 'vitest'`).
|
|
64
|
+
*/
|
|
65
|
+
export function needsVitestJsonReportFile(args) {
|
|
66
|
+
const isVitest = args.some(arg => /(^|[\\/])vitest(\.cmd|\.js|\.mjs)?$/i.test(arg));
|
|
67
|
+
const jsonReporter = args.some((arg, i) => arg === '--reporter=json' || (arg === '--reporter' && args[i + 1] === 'json'));
|
|
68
|
+
const hasOutputFile = args.some(arg => arg.startsWith('--outputFile'));
|
|
69
|
+
return isVitest && jsonReporter && !hasOutputFile;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=vitest-json-report.js.map
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { spawn } from 'child_process';
|
|
8
8
|
import { safeJsonParse } from '../../shared/safe-json.js';
|
|
9
|
+
import { createVitestJsonReport } from '../../shared/vitest-json-report.js';
|
|
9
10
|
// ============================================================================
|
|
10
11
|
// Vitest Executor Implementation
|
|
11
12
|
// ============================================================================
|
|
@@ -95,16 +96,27 @@ export class VitestPhaseExecutor {
|
|
|
95
96
|
return args;
|
|
96
97
|
}
|
|
97
98
|
async runVitest(args, timeoutMs) {
|
|
98
|
-
|
|
99
|
-
//
|
|
99
|
+
// Vitest 5 writes --reporter=json output to a file instead of stdout; an
|
|
100
|
+
// explicit --outputFile gives Vitest 4 and 5 the same contract.
|
|
101
|
+
const report = createVitestJsonReport();
|
|
102
|
+
let document;
|
|
103
|
+
let exitCode;
|
|
100
104
|
try {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
105
|
+
const run = await this.runCommand(this.config.vitestPath || 'npx', [...args, ...report.args], timeoutMs);
|
|
106
|
+
exitCode = run.exitCode;
|
|
107
|
+
document = report.read(run.stdout);
|
|
108
|
+
}
|
|
109
|
+
finally {
|
|
110
|
+
report.cleanup();
|
|
111
|
+
}
|
|
112
|
+
// Parse JSON report from Vitest
|
|
113
|
+
try {
|
|
114
|
+
const jsonStart = document.indexOf('{');
|
|
115
|
+
const jsonEnd = document.lastIndexOf('}');
|
|
104
116
|
if (jsonStart === -1 || jsonEnd === -1) {
|
|
105
117
|
throw new Error('No JSON output from Vitest');
|
|
106
118
|
}
|
|
107
|
-
const jsonStr =
|
|
119
|
+
const jsonStr = document.slice(jsonStart, jsonEnd + 1);
|
|
108
120
|
return safeJsonParse(jsonStr);
|
|
109
121
|
}
|
|
110
122
|
catch (parseError) {
|
|
@@ -53,8 +53,10 @@ export declare function createFrontierJudge(opts: FrontierJudgeOptions): Judge;
|
|
|
53
53
|
/**
|
|
54
54
|
* Build a `complete()` seam backed by the shared HybridRouter, pinned to a
|
|
55
55
|
* frontier model. This is where the ADR-111 "never economize the oracle" rule is
|
|
56
|
-
* enforced: `model` defaults to a frontier Opus and
|
|
57
|
-
*
|
|
56
|
+
* enforced: `model` defaults to a frontier Opus and strict per-request routing
|
|
57
|
+
* prevents shared routing rules or fallback from substituting another model.
|
|
58
|
+
* `preferredProvider` selects a provider explicitly; otherwise the configured
|
|
59
|
+
* default is used. An unavailable or mismatched judge stays inconclusive.
|
|
58
60
|
*/
|
|
59
61
|
export declare function routerComplete(router: HybridRouter, opts?: {
|
|
60
62
|
model?: string;
|
|
@@ -90,8 +92,9 @@ export declare function buildGradePrompt(artifact: string, checklist: Requiremen
|
|
|
90
92
|
/**
|
|
91
93
|
* Parse the model response into a set of 0-based unmet requirement indices.
|
|
92
94
|
* Returns `null` when the response cannot be parsed into the strict contract
|
|
93
|
-
* (so the caller treats it as a non-real opinion).
|
|
94
|
-
*
|
|
95
|
+
* (so the caller treats it as a non-real opinion). Invalid and duplicate entries
|
|
96
|
+
* are ignored when valid indices remain. A nonempty list with no valid indices
|
|
97
|
+
* is unparseable, not evidence that every requirement is met.
|
|
95
98
|
*/
|
|
96
99
|
export declare function parseUnmetIndices(raw: string, total: number): Set<number> | null;
|
|
97
100
|
/** Reject with a timeout error if `p` does not settle within `ms`. */
|
|
@@ -80,8 +80,10 @@ export function createFrontierJudge(opts) {
|
|
|
80
80
|
/**
|
|
81
81
|
* Build a `complete()` seam backed by the shared HybridRouter, pinned to a
|
|
82
82
|
* frontier model. This is where the ADR-111 "never economize the oracle" rule is
|
|
83
|
-
* enforced: `model` defaults to a frontier Opus and
|
|
84
|
-
*
|
|
83
|
+
* enforced: `model` defaults to a frontier Opus and strict per-request routing
|
|
84
|
+
* prevents shared routing rules or fallback from substituting another model.
|
|
85
|
+
* `preferredProvider` selects a provider explicitly; otherwise the configured
|
|
86
|
+
* default is used. An unavailable or mismatched judge stays inconclusive.
|
|
85
87
|
*/
|
|
86
88
|
export function routerComplete(router, opts = {}) {
|
|
87
89
|
const model = opts.model ?? DEFAULT_OPUS_MODEL;
|
|
@@ -89,6 +91,7 @@ export function routerComplete(router, opts = {}) {
|
|
|
89
91
|
const res = await router.chat({
|
|
90
92
|
messages: [{ role: 'user', content: prompt }],
|
|
91
93
|
model,
|
|
94
|
+
strictModel: true,
|
|
92
95
|
preferredProvider: opts.preferredProvider,
|
|
93
96
|
temperature: opts.temperature ?? 0,
|
|
94
97
|
maxTokens: opts.maxTokens ?? 1024,
|
|
@@ -154,16 +157,18 @@ export function buildGradePrompt(artifact, checklist) {
|
|
|
154
157
|
/**
|
|
155
158
|
* Parse the model response into a set of 0-based unmet requirement indices.
|
|
156
159
|
* Returns `null` when the response cannot be parsed into the strict contract
|
|
157
|
-
* (so the caller treats it as a non-real opinion).
|
|
158
|
-
*
|
|
160
|
+
* (so the caller treats it as a non-real opinion). Invalid and duplicate entries
|
|
161
|
+
* are ignored when valid indices remain. A nonempty list with no valid indices
|
|
162
|
+
* is unparseable, not evidence that every requirement is met.
|
|
159
163
|
*/
|
|
160
164
|
export function parseUnmetIndices(raw, total) {
|
|
161
165
|
const obj = extractJsonObject(raw);
|
|
162
166
|
if (obj == null || !Array.isArray(obj.unmet)) {
|
|
163
167
|
return null;
|
|
164
168
|
}
|
|
169
|
+
const unmet = obj.unmet;
|
|
165
170
|
const out = new Set();
|
|
166
|
-
for (const v of
|
|
171
|
+
for (const v of unmet) {
|
|
167
172
|
const n = typeof v === 'number' ? v : typeof v === 'string' ? Number(v.trim()) : NaN;
|
|
168
173
|
if (!Number.isInteger(n))
|
|
169
174
|
continue;
|
|
@@ -171,7 +176,7 @@ export function parseUnmetIndices(raw, total) {
|
|
|
171
176
|
if (idx >= 0 && idx < total)
|
|
172
177
|
out.add(idx);
|
|
173
178
|
}
|
|
174
|
-
return out;
|
|
179
|
+
return unmet.length > 0 && out.size === 0 ? null : out;
|
|
175
180
|
}
|
|
176
181
|
/** Extract the first balanced top-level JSON object from arbitrary model text. */
|
|
177
182
|
function extractJsonObject(raw) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-qe",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.3",
|
|
4
4
|
"description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"test:unit:mcp": "vitest run tests/unit/mcp --exclude='**/mcp/handlers/domain-handlers.test.ts' --fileParallelism=false",
|
|
84
84
|
"test:ci": "vitest run --exclude='**/browser/**' --exclude='**/*.e2e.test.ts' --exclude='**/vibium/**' --exclude='**/integration/browser/**' --exclude='**/browser-swarm-coordinator.test.ts' --exclude='**/mcp/handlers/domain-handlers.test.ts' --exclude='**/fixtures/init-corpus/**'",
|
|
85
85
|
"test:e2e": "vitest run tests/integration/browser --testTimeout=120000",
|
|
86
|
-
"test:safe": "NODE_OPTIONS='--max-old-space-size=768 --expose-gc' vitest run --
|
|
86
|
+
"test:safe": "NODE_OPTIONS='--max-old-space-size=768 --expose-gc' vitest run --maxWorkers=1",
|
|
87
87
|
"test:dev": "npm run test:unit:fast",
|
|
88
88
|
"test:all": "npm test -- --run",
|
|
89
89
|
"test:mcp": "npm run test:unit:mcp",
|
|
@@ -229,7 +229,7 @@
|
|
|
229
229
|
"rvlite": "^0.2.4"
|
|
230
230
|
},
|
|
231
231
|
"resolutions": {
|
|
232
|
-
"adm-zip": ">=0.6.
|
|
232
|
+
"adm-zip": ">=0.6.1",
|
|
233
233
|
"graceful-fs": "^4.2.11",
|
|
234
234
|
"stack-utils": "^2.0.6",
|
|
235
235
|
"tar": ">=7.5.7",
|
|
@@ -238,7 +238,7 @@
|
|
|
238
238
|
"ws": "^8.21.0"
|
|
239
239
|
},
|
|
240
240
|
"overrides": {
|
|
241
|
-
"adm-zip": ">=0.6.
|
|
241
|
+
"adm-zip": ">=0.6.1",
|
|
242
242
|
"@ruvector/gnn-linux-x64-musl": "npm:@ruvector/gnn-linux-x64-gnu@0.1.25",
|
|
243
243
|
"@ruvector/gnn-linux-arm64-musl": "npm:@ruvector/gnn-linux-arm64-gnu@0.1.25",
|
|
244
244
|
"tar": ">=7.5.7",
|
|
@@ -265,7 +265,7 @@
|
|
|
265
265
|
"@types/ws": "^8.18.1",
|
|
266
266
|
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
267
267
|
"@typescript-eslint/parser": "^8.59.3",
|
|
268
|
-
"@vitest/coverage-v8": "^
|
|
268
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
269
269
|
"ajv": "^8.20.0",
|
|
270
270
|
"ajv-formats": "^3.0.1",
|
|
271
271
|
"dotenv": "^17.2.3",
|
|
@@ -275,7 +275,7 @@
|
|
|
275
275
|
"glob": "^13.0.0",
|
|
276
276
|
"msw": "^2.12.7",
|
|
277
277
|
"tsx": "^4.21.0",
|
|
278
|
-
"vitest": "^
|
|
278
|
+
"vitest": "^5.0.1"
|
|
279
279
|
},
|
|
280
280
|
"engines": {
|
|
281
281
|
"node": ">=22.13.0",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a,b,c}from"./chunk-F2KRT2II.js";import"./chunk-LWUJQGCS.js";import"./chunk-UHTAI4ZB.js";import"./chunk-QXTW7XCS.js";import"./chunk-D4RCV4LY.js";import"./chunk-6VKJAMZY.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-3C2K4YMS.js";import"./chunk-U2AY57XZ.js";import"./chunk-RGH3WGWD.js";import"./chunk-CJHVOBJY.js";import"./chunk-4UCMTYFQ.js";import"./chunk-PMUBG2RU.js";import"./chunk-EAJK25IS.js";import"./chunk-C7AXRI7E.js";import"./chunk-R5RNOLHI.js";import"./chunk-IUNMW454.js";import"./chunk-Q335R4MR.js";import"./chunk-MH73D5TN.js";import"./chunk-YF5OP6CR.js";import"./chunk-PFXX5Q32.js";import"./chunk-42WUDDUU.js";import"./chunk-E3Q7WNJD.js";import"./chunk-W2FLULF4.js";import"./chunk-N3RN4QTC.js";import"./chunk-T46LOLW3.js";import"./chunk-PHHXHG2W.js";import"./chunk-ICKLBATY.js";import"./chunk-JDXLCNKV.js";import"./chunk-QXTW7XCS.js";import"./chunk-CTCQOYBS.js";import"./chunk-HSJ5FQCF.js";import"./chunk-VSYBMNIR.js";import"./chunk-CIESXO73.js";import"./chunk-D4RCV4LY.js";import"./chunk-NG2UVPTW.js";import"./chunk-N5ZRUOMR.js";import"./chunk-HBTC4L53.js";import"./chunk-RVCWSAXI.js";import"./chunk-T4C56HBW.js";import"./chunk-JQ2ZD3WO.js";import"./chunk-CJCT452S.js";import"./chunk-S7N4BKI3.js";import"./chunk-JIUF6NV6.js";import"./chunk-GHQ5PUOV.js";import"./chunk-6VKJAMZY.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-2LKAMMMI.js";import"./chunk-A7N3YUDJ.js";import"./chunk-W2FLULF4.js";import"./chunk-N3RN4QTC.js";import"./chunk-T46LOLW3.js";import"./chunk-PHHXHG2W.js";import"./chunk-ICKLBATY.js";import"./chunk-JDXLCNKV.js";import"./chunk-QXTW7XCS.js";import"./chunk-D4RCV4LY.js";import"./chunk-NG2UVPTW.js";import"./chunk-7AFBNU6K.js";import"./chunk-N5ZRUOMR.js";import"./chunk-HBTC4L53.js";import"./chunk-RVCWSAXI.js";import"./chunk-T4C56HBW.js";import"./chunk-JQ2ZD3WO.js";import"./chunk-CJCT452S.js";import"./chunk-S7N4BKI3.js";import"./chunk-JIUF6NV6.js";import"./chunk-GHQ5PUOV.js";import"./chunk-6VKJAMZY.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a}from"./chunk-4M6A3PVJ.js";import"./chunk-2LKAMMMI.js";import"./chunk-A7N3YUDJ.js";import"./chunk-W2FLULF4.js";import"./chunk-N3RN4QTC.js";import"./chunk-T46LOLW3.js";import"./chunk-PHHXHG2W.js";import"./chunk-ICKLBATY.js";import"./chunk-JDXLCNKV.js";import"./chunk-QXTW7XCS.js";import"./chunk-D4RCV4LY.js";import"./chunk-NG2UVPTW.js";import"./chunk-7AFBNU6K.js";import"./chunk-N5ZRUOMR.js";import"./chunk-HBTC4L53.js";import"./chunk-RVCWSAXI.js";import"./chunk-T4C56HBW.js";import"./chunk-JQ2ZD3WO.js";import"./chunk-CJCT452S.js";import"./chunk-S7N4BKI3.js";import"./chunk-JIUF6NV6.js";import"./chunk-GHQ5PUOV.js";import"./chunk-6VKJAMZY.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{b as E,c as D,d as Y,e as q}from"./chunk-SEHCX4NH.js";import{c as V}from"./chunk-G6AV2HGY.js";import{a as w,b as j,c as G,e as A}from"./chunk-FPHPP5TQ.js";import{b as k,c as H,j as v,k as N,o as W,q as S,r as J}from"./chunk-DRO5NJZA.js";import{a as x}from"./chunk-ZYLSOBOR.js";import{d as $,e as oe}from"./chunk-ICKLBATY.js";import{b as _,c as ie}from"./chunk-D4RCV4LY.js";import{i as U}from"./chunk-NG2UVPTW.js";var K={security:{provider:"claude",model:"claude-opus-4-7",temperature:.1,maxTokens:16e3,priority:100},"test-generation":{provider:"claude",model:"claude-sonnet-4-6",temperature:.3,maxTokens:8e3,priority:90},"code-analysis":{provider:"claude",model:"claude-sonnet-4-6",temperature:.2,maxTokens:8e3,priority:85},performance:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:4e3,priority:70},documentation:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.4,maxTokens:4e3,priority:60},learning:{provider:"claude",model:"claude-sonnet-4-6",temperature:.3,maxTokens:8e3,priority:80},coordination:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.2,maxTokens:2e3,priority:75},simple:{provider:"openai",model:"gpt-4o-mini",temperature:.3,maxTokens:2e3,priority:50},general:{provider:"claude",model:"claude-sonnet-4-6",temperature:.3,maxTokens:4e3,priority:60}},L={"security-auditor":"security","security-architect":"security","security-scanner":"security","v3-qe-security-scanner":"security","security-manager":"security","vulnerability-scanner":"security","penetration-tester":"security","compliance-auditor":"security","threat-analyzer":"security","test-generator":"test-generation","v3-qe-test-generator":"test-generation",tester:"test-generation","tdd-specialist":"test-generation","tdd-london-swarm":"test-generation","unit-test-generator":"test-generation","integration-test-generator":"test-generation","e2e-test-generator":"test-generation","mutation-tester":"test-generation","property-based-tester":"test-generation","contract-tester":"test-generation","v3-qe-contract-tester":"test-generation","api-tester":"test-generation","visual-tester":"test-generation","v3-qe-visual-tester":"test-generation","accessibility-tester":"test-generation","code-reviewer":"code-analysis","code-analyzer":"code-analysis",reviewer:"code-analysis","v3-qe-code-intelligence":"code-analysis","v3-qe-code-analyzer":"code-analysis","coverage-analyzer":"code-analysis","v3-qe-coverage-analyzer":"code-analysis","defect-predictor":"code-analysis","v3-qe-defect-predictor":"code-analysis","static-analyzer":"code-analysis","complexity-analyzer":"code-analysis","dependency-analyzer":"code-analysis","refactoring-advisor":"code-analysis","quality-assessor":"code-analysis","v3-qe-quality-assessor":"code-analysis","test-executor":"code-analysis","v3-qe-test-executor":"code-analysis","parallel-executor":"code-analysis","flaky-test-detector":"code-analysis","test-orchestrator":"code-analysis","performance-tester":"performance","performance-engineer":"performance","perf-analyzer":"performance","performance-benchmarker":"performance","load-tester":"performance","stress-tester":"performance","v3-qe-chaos-engineer":"performance","chaos-engineer":"performance","resilience-tester":"performance","scalability-tester":"performance","api-docs":"documentation","doc-generator":"documentation","readme-generator":"documentation","changelog-generator":"documentation","specification-writer":"documentation","v3-qe-learning-optimizer":"learning","learning-optimizer":"learning","ml-developer":"learning","pattern-learner":"learning","optimization-agent":"learning","smart-agent":"learning","requirements-validator":"code-analysis","v3-qe-requirements-validator":"code-analysis","bdd-generator":"test-generation","acceptance-tester":"test-generation",coordinator:"coordination","hierarchical-coordinator":"coordination","mesh-coordinator":"coordination","adaptive-coordinator":"coordination","collective-intelligence-coordinator":"coordination","swarm-memory-manager":"coordination","byzantine-coordinator":"coordination","raft-manager":"coordination","gossip-coordinator":"coordination","consensus-builder":"coordination","crdt-synchronizer":"coordination","quorum-manager":"coordination","task-orchestrator":"coordination","memory-coordinator":"coordination",coder:"code-analysis",planner:"code-analysis",researcher:"code-analysis","backend-dev":"code-analysis","mobile-dev":"code-analysis","cicd-engineer":"code-analysis","system-architect":"code-analysis","base-template-generator":"test-generation","github-modes":"coordination","pr-manager":"coordination","code-review-swarm":"code-analysis","issue-tracker":"coordination","release-manager":"coordination","workflow-automation":"coordination","project-board-sync":"coordination","repo-architect":"code-analysis","multi-repo-swarm":"coordination","sparc-coord":"coordination","sparc-coder":"code-analysis",specification:"documentation",pseudocode:"code-analysis",architecture:"code-analysis",refinement:"code-analysis","memory-specialist":"learning","production-validator":"code-analysis"},y={heavyweight:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!0,requiresJsonMode:!0,minContextSize:1e5,costSensitivity:"low",latencySensitivity:"low"},standard:{requiresReasoning:!0,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:5e4,costSensitivity:"medium",latencySensitivity:"medium"},lightweight:{requiresReasoning:!1,requiresTools:!0,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!0,minContextSize:16e3,costSensitivity:"medium",latencySensitivity:"high"},minimal:{requiresReasoning:!1,requiresTools:!1,requiresVision:!1,requiresExtendedThinking:!1,requiresJsonMode:!1,minContextSize:4e3,costSensitivity:"high",latencySensitivity:"medium"}},ge={security:y.heavyweight,"test-generation":y.standard,"code-analysis":y.standard,learning:y.standard,performance:{...y.lightweight,costSensitivity:"high"},coordination:y.lightweight,general:{...y.lightweight,requiresJsonMode:!1,latencySensitivity:"medium"},documentation:{...y.minimal,minContextSize:16e3},simple:y.minimal};function Q(l){if(l in L)return L[l];let e=l.toLowerCase();return e.includes("security")||e.includes("audit")||e.includes("vulnerab")||e.includes("penetration")||e.includes("threat")||e.includes("compliance")?"security":e.includes("test-gen")||e.includes("tdd")||e.includes("unit-test")||e.includes("e2e-test")||e.includes("integration-test")||e.includes("mutation")?"test-generation":e.includes("code-")||e.includes("coverage")||e.includes("defect")||e.includes("review")||e.includes("analyzer")||e.includes("quality")?"code-analysis":e.includes("perf")||e.includes("load")||e.includes("stress")||e.includes("benchmark")||e.includes("chaos")||e.includes("resilience")?"performance":e.includes("doc")||e.includes("readme")||e.includes("changelog")||e.includes("spec")?"documentation":e.includes("learn")||e.includes("ml-")||e.includes("pattern")||e.includes("optim")?"learning":e.includes("coord")||e.includes("swarm")||e.includes("orchestrat")||e.includes("consensus")||e.includes("manager")?"coordination":"general"}var I={},X={};function Z(l,e){I={...l??{}},X={...e??{}}}function ee(l){let e=Q(l),t=K[e],r=I[l];if(!r)return t;let i=r.provider!==void 0&&r.provider!==t.provider,o=r.model??(i?X[r.provider]:void 0);return{...t,...r.provider!==void 0?{provider:r.provider}:{},...o!==void 0?{model:o}:{},...r.temperature!==void 0?{temperature:r.temperature}:{},...r.maxTokens!==void 0?{maxTokens:r.maxTokens}:{},priority:r.priority??t.priority+100}}function te(){return Object.keys(I).map(l=>{let e=ee(l);return{id:`agent-override-${l}`,name:`User override: ${l} -> ${e.provider}/${e.model}`,description:`Per-agent routing override from .agentic-qe/llm-config.json (agentOverrides["${l}"])`,condition:{agentType:[l]},action:{provider:e.provider,model:e.model,temperature:e.temperature,maxTokens:e.maxTokens,priority:e.priority},enabled:!0,priority:e.priority}}).sort((l,e)=>e.priority-l.priority)}var C=class{rules=[];constructor(e=[]){this.setRules(e)}setRules(e){this.rules=[...e].filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}getRules(){return[...this.rules]}addRule(e){this.rules.push(e),this.rules=this.rules.filter(t=>t.enabled).sort((t,r)=>r.priority-t.priority)}removeRule(e){let t=this.rules.findIndex(r=>r.id===e);return t>=0?(this.rules.splice(t,1),!0):!1}setRuleEnabled(e,t){let r=this.rules.find(i=>i.id===e);return r?(r.enabled=t,this.rules=this.rules.filter(i=>i.enabled).sort((i,o)=>o.priority-i.priority),!0):!1}evaluate(e){let t=0;for(let r of this.rules)if(t++,this.matchesCondition(e,r.condition))return{rule:r,rulesEvaluated:t};return null}evaluateAll(e){return this.rules.filter(t=>this.matchesCondition(e,t.condition))}matchesCondition(e,t){if(t.agentType!==void 0&&(!e.agentType||!t.agentType.includes(e.agentType))||t.requiresTools!==void 0&&!!e.requiresTools!==t.requiresTools)return!1;if(t.complexity!==void 0){let r=Array.isArray(t.complexity)?t.complexity:[t.complexity];if(!e.complexity||!r.includes(e.complexity))return!1}if(t.localOnly!==void 0&&t.localOnly){let r=["ollama","onnx"];if(e.preferredProvider&&!r.includes(e.preferredProvider))return!1}if(t.requiresReasoning!==void 0&&t.requiresReasoning&&e.complexity==="low")return!1;if(t.tokenRange!==void 0){let r=this.estimateTokens(e);if(t.tokenRange.min!==void 0&&r<t.tokenRange.min||t.tokenRange.max!==void 0&&r>t.tokenRange.max)return!1}return!(t.requiredCapabilities!==void 0&&t.requiredCapabilities.length>0&&(!e.requiredCapabilities||e.requiredCapabilities.length===0||!t.requiredCapabilities.every(i=>e.requiredCapabilities.includes(i)))||t.custom!==void 0&&!t.custom(e))}estimateTokens(e){let t=0;e.systemPrompt&&(t+=Math.ceil(e.systemPrompt.length/4));for(let r of e.messages)t+=Math.ceil(r.content.length/4);return t}},R=[{id:"security-agents-opus",name:"Security Agents to Claude Opus",description:"Route security-critical agents to Claude Opus for best security analysis",condition:{agentType:["security-auditor","security-architect","v3-qe-security-scanner"]},action:{provider:"claude",model:"claude-opus-4-7",temperature:.1},enabled:!0,priority:100},{id:"test-gen-with-tools",name:"Test Generation with Tools",description:"Route test generation requests that need tools to Claude Sonnet",condition:{agentType:["v3-qe-test-generator","tester"],requiresTools:!0},action:{provider:"claude",model:"claude-sonnet-4-6",temperature:.3},enabled:!0,priority:95},{id:"high-complexity-reasoning",name:"High Complexity Reasoning",description:"Route high complexity tasks requiring reasoning to advanced models",condition:{complexity:"high",requiresReasoning:!0},action:{provider:"claude",model:"claude-opus-4-7",temperature:.2},enabled:!0,priority:90},{id:"code-analysis-agents",name:"Code Analysis Agents",description:"Route code analysis to Claude Sonnet for balanced performance",condition:{agentType:["code-analyzer","v3-qe-code-intelligence","reviewer"]},action:{provider:"claude",model:"claude-sonnet-4-6",temperature:.2},enabled:!0,priority:85},{id:"coverage-analysis",name:"Coverage Analysis Agents",description:"Route coverage analysis to efficient models",condition:{agentType:["v3-qe-coverage-analyzer"]},action:{provider:"claude",model:"claude-sonnet-4-6",temperature:.1},enabled:!0,priority:80},{id:"defect-prediction",name:"Defect Prediction Agents",description:"Route defect prediction to capable models",condition:{agentType:["v3-qe-defect-predictor"]},action:{provider:"claude",model:"claude-sonnet-4-6",temperature:.3},enabled:!0,priority:75},{id:"medium-complexity",name:"Medium Complexity Tasks",description:"Route medium complexity to balanced Claude Sonnet",condition:{complexity:"medium"},action:{provider:"claude",model:"claude-sonnet-4-6",temperature:.3},enabled:!0,priority:60},{id:"low-complexity-haiku",name:"Low Complexity to Haiku",description:"Route low complexity tasks to Haiku for cost efficiency",condition:{complexity:"low"},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:50},{id:"local-only-ollama",name:"Local Only Requests",description:"Route local-only requests to Ollama",condition:{localOnly:!0},action:{provider:"ollama",model:"llama3.1",temperature:.3},enabled:!0,priority:40},{id:"small-requests-haiku",name:"Small Token Requests",description:"Route small requests to Haiku for efficiency",condition:{tokenRange:{max:500}},action:{provider:"claude",model:"claude-haiku-4-5-20251001",temperature:.3},enabled:!0,priority:30}];import{randomUUID as ne}from"crypto";var T=class{decisions=[];providerCalls=[];fallbacks=[];cacheHits=0;cacheMisses=0;startTime=new Date;maxRecords;maxCallRecords;constructor(e={}){this.maxRecords=e.maxRecords??1e4,this.maxCallRecords=e.maxCallRecords??5e3}recordRoutingDecision(e,t,r={}){let i={id:`rd-${Date.now()}-${ne().slice(0,8)}`,timestamp:new Date,provider:e.providerType,model:e.model,mode:this.inferMode(e.reason),reason:e.reason,latencyMs:t,decisionTimeMs:e.metadata.decisionTimeMs,agentType:r.agentType,success:r.success??!0,tokenUsage:r.tokenUsage,cost:r.cost,wasFallback:e.reason==="fallback",ruleId:e.matchedRule?.id};this.decisions.push(i),this.trimRecords()}recordProviderCall(e,t,r,i,o={}){let n=o.inputTokens??Math.floor(i*.7),a=o.outputTokens??i-n,s={timestamp:new Date,provider:e,model:t,latencyMs:r,inputTokens:n,outputTokens:a,totalTokens:i,success:o.success??!0,cost:o.cost,agentType:o.agentType};this.providerCalls.push(s),this.trimCallRecords()}recordFallback(e,t,r,i){let o={timestamp:new Date,fromProvider:e,toProvider:t,reason:r,agentType:i};this.fallbacks.push(o),this.fallbacks.length>1e3&&(this.fallbacks=this.fallbacks.slice(-1e3))}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(e="all"){let t=this.getWindowStart(e),r=this.filterByTime(this.decisions,t),i=this.filterByTime(this.providerCalls,t),o=this.filterByTime(this.fallbacks,t),n=this.calculateProviderMetrics(r,i),a=this.calculateAgentMetrics(r,i),s=r.map(m=>m.decisionTimeMs),c=r.length,d=this.countByMode(r),u=r.filter(m=>m.wasFallback).length,g=r.filter(m=>m.ruleId).length;return{byProvider:Object.fromEntries(n),byAgentType:a,totalDecisions:c,decisionsByMode:d,avgDecisionTimeMs:this.average(s),p95DecisionTimeMs:this.percentile(s,95),p99DecisionTimeMs:this.percentile(s,99),fallbackRate:c>0?u/c:0,ruleMatchRate:c>0?g/c:0,estimatedCostSavings:this.calculateCostSavings(r),ruleStats:{totalEvaluated:r.reduce((m,P)=>m+1,0),matched:g,avgRulesPerDecision:1},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:t,end:new Date},recentDecisions:r.slice(-50),fallbackStats:this.calculateFallbackStats(o)}}getMetricsByProvider(e){let t=this.decisions.filter(s=>s.provider===e),r=this.providerCalls.filter(s=>s.provider===e),i=r.map(s=>s.latencyMs),o=t.map(s=>s.decisionTimeMs),n=r.filter(s=>s.success),a=r.filter(s=>!s.success);return{provider:e,selectionCount:t.length,ruleMatchCount:t.filter(s=>s.ruleId).length,fallbackCount:t.filter(s=>s.wasFallback).length,avgDecisionTimeMs:this.average(o),successRate:r.length>0?n.length/r.length:1,avgLatencyMs:this.average(i),p95LatencyMs:this.percentile(i,95),p99LatencyMs:this.percentile(i,99),totalCost:r.reduce((s,c)=>s+(c.cost??0),0),totalTokens:r.reduce((s,c)=>s+c.totalTokens,0),totalInputTokens:r.reduce((s,c)=>s+c.inputTokens,0),totalOutputTokens:r.reduce((s,c)=>s+c.outputTokens,0),circuitState:"closed",latencyHistogram:i.slice(-100),decisionTimeHistogram:o.slice(-100),errorCount:a.length,lastError:a.length>0?a[a.length-1].timestamp:void 0,recentCalls:r.slice(-20)}}getMetricsByAgentType(e){let t=this.decisions.filter(c=>c.agentType===e),r=this.providerCalls.filter(c=>c.agentType===e),i=new Map,o=new Map;for(let c of t)i.set(c.provider,(i.get(c.provider)??0)+1),o.set(c.model,(o.get(c.model)??0)+1);let n=r.map(c=>c.latencyMs),a=t.filter(c=>c.wasFallback).length,s=t.filter(c=>c.success).length;return{agentType:e,totalDecisions:t.length,providerDistribution:i,modelDistribution:o,avgLatencyMs:this.average(n),totalCost:r.reduce((c,d)=>c+(d.cost??0),0),totalTokens:r.reduce((c,d)=>c+d.totalTokens,0),fallbackRate:t.length>0?a/t.length:0,successRate:t.length>0?s/t.length:1}}getAuditLog(e={}){let t=this.decisions;e.since&&(t=t.filter(i=>i.timestamp>=e.since)),e.provider&&(t=t.filter(i=>i.provider===e.provider)),e.agentType&&(t=t.filter(i=>i.agentType===e.agentType));let r=e.limit??100;return t.slice(-r).map(i=>({id:i.id,timestamp:i.timestamp,context:{agentType:i.agentType},decision:{providerType:i.provider,model:i.model,providerModelId:i.model,reason:i.reason,confidence:1,metadata:{decisionTimeMs:i.decisionTimeMs,timestamp:i.timestamp}},outcome:{success:i.success,latencyMs:i.latencyMs,tokenUsage:i.tokenUsage,cost:i.cost}}))}resetMetrics(){this.decisions=[],this.providerCalls=[],this.fallbacks=[],this.cacheHits=0,this.cacheMisses=0,this.startTime=new Date}inferMode(e){switch(e){case"manual":return"manual";case"rule-match":return"rule-based";case"cost-optimization":return"cost-optimized";case"performance-optimization":return"performance-optimized";default:return"rule-based"}}trimRecords(){this.decisions.length>this.maxRecords&&(this.decisions=this.decisions.slice(-this.maxRecords))}trimCallRecords(){this.providerCalls.length>this.maxCallRecords&&(this.providerCalls=this.providerCalls.slice(-this.maxCallRecords))}getWindowStart(e){let t=new Date;switch(e){case"1m":return new Date(t.getTime()-60*1e3);case"5m":return new Date(t.getTime()-300*1e3);case"15m":return new Date(t.getTime()-900*1e3);case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);default:return this.startTime}}filterByTime(e,t){return e.filter(r=>r.timestamp>=t)}calculateProviderMetrics(e,t){let r=new Map;for(let i of v){let o=e.filter(d=>d.provider===i),n=t.filter(d=>d.provider===i);if(o.length===0&&n.length===0)continue;let a=n.map(d=>d.latencyMs),s=o.map(d=>d.decisionTimeMs),c=n.filter(d=>d.success);r.set(i,{provider:i,selectionCount:o.length,ruleMatchCount:o.filter(d=>d.ruleId).length,fallbackCount:o.filter(d=>d.wasFallback).length,avgDecisionTimeMs:this.average(s),successRate:n.length>0?c.length/n.length:1,avgLatencyMs:this.average(a),p95LatencyMs:this.percentile(a,95),p99LatencyMs:this.percentile(a,99),totalCost:n.reduce((d,u)=>d+(u.cost??0),0),totalTokens:n.reduce((d,u)=>d+u.totalTokens,0),circuitState:"closed"})}return r}calculateAgentMetrics(e,t){let r=new Set;e.forEach(o=>o.agentType&&r.add(o.agentType)),t.forEach(o=>o.agentType&&r.add(o.agentType));let i=new Map;for(let o of r)i.set(o,this.getMetricsByAgentType(o));return i}countByMode(e){let t={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};for(let r of e)t[r.mode]++;return t}calculateFallbackStats(e){let t=new Map,r=new Map;for(let i of e)t.set(i.fromProvider,(t.get(i.fromProvider)??0)+1),r.set(i.reason,(r.get(i.reason)??0)+1);return{total:e.length,byProvider:t,byReason:r}}calculateCostSavings(e){return e.reduce((t,r)=>r.cost&&r.mode==="cost-optimized"?t+r.cost.totalCost*.2:t,0)}average(e){return e.length===0?0:e.reduce((t,r)=>t+r,0)/e.length}percentile(e,t){if(e.length===0)return 0;let r=[...e].sort((o,n)=>o-n),i=Math.ceil(t/100*r.length)-1;return r[Math.max(0,i)]}};function O(l){return new T(l)}var b=class{records=[];alerts=[];maxRecords;alertCheckInterval;constructor(e={}){this.maxRecords=e.maxRecords??1e4}recordCost(e,t,r,i,o={}){let n=this.calculateCost(t,r,i),a={timestamp:new Date,provider:e,model:t,inputTokens:r,outputTokens:i,inputCost:n.inputCost,outputCost:n.outputCost,totalCost:n.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(a),this.trimRecords(),this.checkAlerts(),a}recordCostFromInfo(e,t,r,i,o={}){let n={timestamp:new Date,provider:e,model:t,inputTokens:r.promptTokens,outputTokens:r.completionTokens,inputCost:i.inputCost,outputCost:i.outputCost,totalCost:i.totalCost,agentType:o.agentType,requestId:o.requestId};return this.records.push(n),this.trimRecords(),this.checkAlerts(),n}getCostByProvider(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Map;for(let o of v){let n=r.filter(c=>c.provider===o);if(n.length===0)continue;let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);i.set(o,{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return i}getCostByAgentType(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(a=>a.agentType&&i.add(a.agentType));let o=new Map;for(let a of i){let s=r.filter(u=>u.agentType===a),c=s.reduce((u,g)=>u+g.totalCost,0),d=s.reduce((u,g)=>u+g.inputTokens+g.outputTokens,0);o.set(a,{totalCost:c,totalTokens:d,totalRequests:s.length,avgCostPerRequest:s.length>0?c/s.length:0,avgCostPerToken:d>0?c/d:0})}let n=r.filter(a=>!a.agentType);if(n.length>0){let a=n.reduce((c,d)=>c+d.totalCost,0),s=n.reduce((c,d)=>c+d.inputTokens+d.outputTokens,0);o.set("unknown",{totalCost:a,totalTokens:s,totalRequests:n.length,avgCostPerRequest:a/n.length,avgCostPerToken:s>0?a/s:0})}return o}getCostByModel(e="all"){let t=this.getPeriodStart(e),r=this.filterByTime(t),i=new Set;r.forEach(n=>i.add(n.model));let o=new Map;for(let n of i){let a=r.filter(d=>d.model===n),s=a.reduce((d,u)=>d+u.totalCost,0),c=a.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0);o.set(n,{totalCost:s,totalTokens:c,totalRequests:a.length,avgCostPerRequest:a.length>0?s/a.length:0,avgCostPerToken:c>0?s/c:0})}return o}getTotalCost(e="all"){let t=this.getPeriodStart(e);return this.filterByTime(t).reduce((i,o)=>i+o.totalCost,0)}getCostTrend(e){let t=new Date,r=[],i,o;switch(e){case"1h":i=300*1e3,o=12;break;case"24h":i=3600*1e3,o=24;break;case"7d":i=1440*60*1e3,o=7;break}for(let n=o-1;n>=0;n--){let a=new Date(t.getTime()-n*i),s=new Date(a.getTime()-i),c=this.records.filter(d=>d.timestamp>=s&&d.timestamp<a);r.push({timestamp:a,cost:c.reduce((d,u)=>d+u.totalCost,0),tokens:c.reduce((d,u)=>d+u.inputTokens+u.outputTokens,0),requests:c.length})}return r}addBudgetAlert(e,t,r){let i={threshold:e,period:t,callback:r,active:!0};return this.alerts.push(i),this.alertCheckInterval||(this.alertCheckInterval=setInterval(()=>this.checkAlerts(),6e4)),`alert-${this.alerts.length-1}`}removeBudgetAlert(e){return e>=0&&e<this.alerts.length?(this.alerts.splice(e,1),this.alerts.length===0&&this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0),!0):!1}getOptimizationSuggestions(){let e=[],t=this.getCostByModel("24h");for(let[n,a]of t)x[n]&&a.totalCost>1&&(n.includes("opus")&&e.push({type:"model-switch",description:"Consider using Sonnet instead of Opus for non-critical tasks",estimatedSavings:a.totalCost*.5,currentCost:a.totalCost,suggestedModel:"claude-sonnet-4-6"}),n==="gpt-4o"&&e.push({type:"model-switch",description:"Consider using GPT-4o-mini for simpler tasks",estimatedSavings:a.totalCost*.7,currentCost:a.totalCost,suggestedModel:"gpt-4o-mini"}));let r=this.getCostByProvider("24h"),i=[...r.values()].reduce((n,a)=>n+a.totalCost,0);return i>10&&!r.has("ollama")&&e.push({type:"provider-switch",description:"Consider using Ollama for development/testing workloads",estimatedSavings:i*.3,currentCost:i,suggestedProvider:"ollama"}),[...t.values()].reduce((n,a)=>n+a.totalRequests,0)>100&&e.push({type:"caching",description:"Enable response caching to reduce redundant API calls",estimatedSavings:i*.15,currentCost:i}),e}getRecords(){return[...this.records]}clear(){this.records=[]}reset(){this.records=[],this.alerts=[],this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}dispose(){this.alertCheckInterval&&(clearInterval(this.alertCheckInterval),this.alertCheckInterval=void 0)}calculateCost(e,t,r){let i=x[e];if(!i)return{inputCost:0,outputCost:0,totalCost:0,currency:"USD"};let o=t/1e6*i.input,n=r/1e6*i.output;return{inputCost:o,outputCost:n,totalCost:o+n,currency:"USD"}}trimRecords(){this.records.length>this.maxRecords&&(this.records=this.records.slice(-this.maxRecords))}getPeriodStart(e){let t=new Date;switch(e){case"1h":return new Date(t.getTime()-3600*1e3);case"24h":return new Date(t.getTime()-1440*60*1e3);case"7d":return new Date(t.getTime()-10080*60*1e3);case"30d":return new Date(t.getTime()-720*60*60*1e3);default:return new Date(0)}}filterByTime(e){return this.records.filter(t=>t.timestamp>=e)}checkAlerts(){for(let e of this.alerts){if(!e.active)continue;let t=this.getTotalCost(e.period);if(t>=e.threshold){e.active=!1;let r=this.getPeriodStart(e.period),i=this.filterByTime(r),o=i.reduce((n,a)=>n+a.inputTokens+a.outputTokens,0);try{e.callback({totalCost:t,totalTokens:o,totalRequests:i.length,avgCostPerRequest:i.length>0?t/i.length:0,avgCostPerToken:o>0?t/o:0})}catch(n){console.error("Budget alert callback error:",n)}}}}};function z(l){return new b(l)}ie();var M=class{cache=new Map;maxSize;ttlMs;constructor(e=100,t=6e4){this.maxSize=e,this.ttlMs=t}get(e){let t=this.cache.get(e);return t?Date.now()>t.expiresAt?(this.cache.delete(e),null):t.decision:null}set(e,t){if(this.cache.size>=this.maxSize){let r=this.cache.keys().next().value;r&&this.cache.delete(r)}this.cache.set(e,{decision:t,expiresAt:Date.now()+this.ttlMs})}clear(){this.cache.clear()}getStats(){return{hits:0,misses:0,size:this.cache.size}}},h=class{config;providerManager;ruleEngine;decisionCache;metrics;routerMetrics;costMetrics;initialized=!1;constructor(e,t){this.providerManager=e,this.config={...N,...t};let r=this.config.rules.length>0?this.config.rules:R;this.ruleEngine=new C(r),this.decisionCache=new M(100,this.config.decisionCacheTtlMs),this.metrics=new B,this.routerMetrics=O(),this.costMetrics=z()}async initialize(){this.initialized||(await this.providerManager.initialize(),this.initialized=!0)}getMode(){return this.config.mode}setMode(e){this.config.mode=e,this.decisionCache.clear()}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e},e.rules&&this.ruleEngine.setRules(e.rules),e.decisionCacheTtlMs&&(this.decisionCache=new M(100,e.decisionCacheTtlMs))}async selectProvider(e){await this.ensureInitialized();let t=Date.now();if(this.config.cacheDecisions){let i=this.generateCacheKey(e),o=this.decisionCache.get(i);if(o)return this.metrics.recordCacheHit(),this.routerMetrics.recordCacheHit(),o;this.metrics.recordCacheMiss(),this.routerMetrics.recordCacheMiss()}let r;switch(this.config.mode){case"manual":r=await this.selectManual(e);break;case"rule-based":r=await this.selectRuleBased(e);break;case"cost-optimized":r=await this.selectCostOptimized(e);break;case"performance-optimized":r=await this.selectPerformanceOptimized(e);break;default:r=await this.selectRuleBased(e)}if(r.metadata.decisionTimeMs=Date.now()-t,this.config.cacheDecisions){let i=this.generateCacheKey(e);this.decisionCache.set(i,r)}return this.metrics.recordDecision(r,this.config.mode),r}async chat(e){await this.ensureInitialized();let t=U(),r=await this.selectProvider(e),i=e.agentType??"";if(Y(i)&&(D(r.model)||D(r.providerModelId))){let n=r.model,a=r.providerModelId;r.model=q(i,r.model,E),r.providerModelId=q(i,r.providerModelId,E),console.warn(`[aqe] ADR-093: ${i} pinned to ${r.model} (was ${n}/${a}); set AQE_CYBER_VERIFIED=true after Cyber Verification Program approval`)}return await this.executeWithFallback(e,r,t)}async*stream(e){await this.ensureInitialized();let t=await this.selectProvider(e),r=await this.chat(e),i=100;for(let o=0;o<r.content.length;o+=i){let n=o+i>=r.content.length;yield{type:n?"done":"content",delta:r.content.slice(o,o+i),accumulated:r.content.slice(0,o+i),done:n,tokenCount:Math.ceil((o+i)/4),model:r.model,provider:t.providerType,usage:n?r.usage:void 0}}}getMetrics(){return this.metrics.getMetrics()}getEnhancedMetrics(e){return this.routerMetrics.getMetrics(e)}getProviderMetrics(e){return this.routerMetrics.getMetricsByProvider(e)}getAgentMetrics(e){return this.routerMetrics.getMetricsByAgentType(e)}getCostByProvider(e){return this.costMetrics.getCostByProvider(e)}getCostByAgentType(e){return this.costMetrics.getCostByAgentType(e)}getCostByModel(e){return this.costMetrics.getCostByModel(e)}getTotalCost(e){return this.costMetrics.getTotalCost(e)}getCostTrend(e){return this.costMetrics.getCostTrend(e)}getAuditLog(e){return this.routerMetrics.getAuditLog(e)}getOptimizationSuggestions(){return this.costMetrics.getOptimizationSuggestions()}resetMetrics(){this.metrics.reset(),this.routerMetrics.resetMetrics(),this.costMetrics.reset()}clearCache(){this.decisionCache.clear()}async selectManual(e){let t=e.preferredProvider??this.config.defaultProvider,r=e.model??this.config.defaultModel,i=this.providerManager.getProvider(t);return i?this.createDecision(i,t,r,"manual"):this.createFallbackDecision(e,"manual")}async selectRuleBased(e){let t=this.ruleEngine.evaluate(e);if(t){let{rule:o,rulesEvaluated:n}=t,a=o.action.provider,s=this.providerManager.getProvider(a);if(s){let c=this.createDecision(s,a,o.action.model,"rule-match",o);return c.metadata.rulesEvaluated=n,c}}let r=this.config.defaultProvider,i=this.providerManager.getProvider(r);return i?this.createDecision(i,r,this.config.defaultModel,"default"):this.createFallbackDecision(e,"rule-based")}async selectCostOptimized(e){let t=this.providerManager.getAvailableProviders();if(t.length===0)return this.createFallbackDecision(e,"cost-optimized");let r=1/0,i=t[0],o,n=[];for(let a of t){let s=this.providerManager.getProvider(a);if(!s)continue;let{input:c,output:d}=s.getCostPerToken(),u=this.estimateCostValue(e,c,d);n.push({provider:a,model:s.getConfig().model,reason:`Estimated cost: $${u.toFixed(6)}`,estimatedCost:u,excluded:!1}),u<r&&(r=u,i=a,o=s)}if(o){let a=o.getConfig(),s=this.createDecision(o,i,a.model,"cost-optimization");return s.metadata.estimatedCost=this.createCostEstimate(e,o),s.metadata.alternativesConsidered=n,s}return this.createFallbackDecision(e,"cost-optimized")}async selectPerformanceOptimized(e){let t=this.providerManager.getAvailableProviders(),r=this.providerManager.getMetrics();if(t.length===0)return this.createFallbackDecision(e,"performance-optimized");let i=1/0,o=t[0],n,a=[];for(let s of t){let c=this.providerManager.getProvider(s);if(!c)continue;let u=r[s]?.avgLatencyMs??1/0;a.push({provider:s,model:c.getConfig().model,reason:`Avg latency: ${u}ms`,estimatedLatencyMs:u,excluded:!1}),u<i&&(i=u,o=s,n=c)}if(n){let s=n.getConfig(),c=this.createDecision(n,o,s.model,"performance-optimization");return c.metadata.estimatedLatencyMs=i,c.metadata.alternativesConsidered=a,c}return this.createFallbackDecision(e,"performance-optimized")}async executeWithFallback(e,t,r){let{fallbackChain:i,fallbackBehavior:o}=this.config,n,a=0,s=[{provider:t.providerType,model:t.providerModelId}],c=this.config.defaultProvider;c&&c!==t.providerType&&s.push({provider:c,model:this.config.defaultModel});for(let u of i.entries)if(u.enabled&&u.provider!==t.providerType)for(let g of u.models)s.push({provider:u.provider,model:g});let d=s;if(e.requiresTools){let u=s.filter(g=>A(g.model));if(u.length>0&&u.length<s.length){let g=s.filter(m=>!A(m.model)).map(m=>`${m.provider}:${m.model}`);console.warn(`[llm-router] requiresTools: skipping tool-less model(s) ${g.join(", ")}`),d=u}}this.providerManager.assertWithinBudget(e.messages,{model:d[0]?.model,maxTokens:e.maxTokens});for(let{provider:u,model:g}of d){if(a>=o.maxAttempts)break;let m=this.providerManager.getProvider(u);if(!m)continue;a++;let P=Date.now();try{let p=await m.generate(e.messages,{model:g,temperature:e.temperature,maxTokens:e.maxTokens,systemPrompt:e.systemPrompt,timeoutMs:e.timeoutMs,skipCache:e.skipCache,metadata:e.metadata});this.providerManager.recordResponseSpend(p,e.agentType);let f=Date.now()-P;return this.metrics.recordSuccess(u),this.routerMetrics.recordRoutingDecision(t,f,{agentType:e.agentType,success:!0,tokenUsage:p.usage,cost:p.cost}),this.routerMetrics.recordProviderCall(u,g,f,p.usage.totalTokens,{inputTokens:p.usage.promptTokens,outputTokens:p.usage.completionTokens,success:!0,cost:p.cost.totalCost,agentType:e.agentType}),this.costMetrics.recordCostFromInfo(u,g,p.usage,p.cost,{agentType:e.agentType,requestId:p.requestId}),{content:p.content,model:p.model,providerModelId:p.model,provider:p.provider,usage:p.usage,cost:p.cost,latencyMs:p.latencyMs,finishReason:p.finishReason,cached:p.cached,requestId:p.requestId,routingDecision:t}}catch(p){n=_(p);let f=Date.now()-P;if(this.metrics.recordFailure(u),this.routerMetrics.recordProviderCall(u,g,f,0,{success:!1,agentType:e.agentType}),a<s.length){let F=s[a];F&&this.routerMetrics.recordFallback(u,F.provider,n.message,e.agentType)}!(H(p)&&!p.retryable)&&a<o.maxAttempts&&await this.delay(o.delayMs)}}throw k(`All providers failed after ${a} attempts: ${n?.message??"Unknown error"}`,"PROVIDER_UNAVAILABLE",{retryable:!1,cause:n})}createDecision(e,t,r,i,o){let{canonicalModel:n,providerModelId:a}=this.resolveModelIds(r,t);return{provider:e,providerType:t,model:n,providerModelId:a,reason:i,matchedRule:o,confidence:i==="rule-match"?.95:.8,metadata:{decisionTimeMs:0,timestamp:new Date}}}resolveModelIds(e,t){let i={claude:"anthropic","claude-code":"anthropic",openai:"openai",ollama:"ollama",openrouter:"openrouter",gemini:"gemini","azure-openai":"azure",bedrock:"bedrock"}[t];if(!i)return{canonicalModel:e,providerModelId:e};try{let o=j(e),n=w(o,i);return{canonicalModel:o,providerModelId:n}}catch{try{if(G(e)){let n=w(e,i);return{canonicalModel:e,providerModelId:n}}}catch{}return{canonicalModel:e,providerModelId:e}}}createFallbackDecision(e,t){for(let i of this.config.fallbackChain.entries){if(!i.enabled||!["claude","openai","ollama"].includes(i.provider))continue;let n=this.providerManager.getProvider(i.provider);if(n)return this.createDecision(n,i.provider,i.models[0],"fallback")}let r=this.providerManager.getAvailableProviders();if(r.length>0){let i=r[0],o=this.providerManager.getProvider(i);return this.createDecision(o,i,o.getConfig().model,"fallback")}throw k(`No providers available for ${t} selection`,"PROVIDER_UNAVAILABLE",{retryable:!1})}generateCacheKey(e){return[this.config.mode,e.agentType??"default",e.complexity??"medium",e.requiresTools?"tools":"no-tools",e.preferredProvider??"any"].join(":")}estimateCostValue(e,t,r){let i=0;e.systemPrompt&&(i+=Math.ceil(e.systemPrompt.length/4));for(let n of e.messages)i+=Math.ceil(n.content.length/4);let o=e.maxTokens??1e3;return i*t+o*r}createCostEstimate(e,t){let{input:r,output:i}=t.getCostPerToken(),o=0;e.systemPrompt&&(o+=Math.ceil(e.systemPrompt.length/4));for(let s of e.messages)o+=Math.ceil(s.content.length/4);let n=e.maxTokens??1e3,a=o*r+n*i;return{inputTokens:o,outputTokens:n,totalCostUsd:a,inputCostPer1M:r*1e6,outputCostPer1M:i*1e6}}delay(e){return new Promise(t=>setTimeout(t,e))}async ensureInitialized(){this.initialized||await this.initialize()}},B=class{decisions=new Map;decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0};totalDecisions=0;cacheHits=0;cacheMisses=0;totalRulesEvaluated=0;rulesMatched=0;fallbackCount=0;startTime=new Date;recordDecision(e,t){this.totalDecisions++,this.decisionsByMode[t]++,e.metadata.rulesEvaluated&&(this.totalRulesEvaluated+=e.metadata.rulesEvaluated),e.matchedRule&&this.rulesMatched++,e.reason==="fallback"&&this.fallbackCount++;let r=this.decisions.get(e.providerType);r||(r=this.createEmptyMetrics(e.providerType),this.decisions.set(e.providerType,r)),r.selectionCount++,e.reason==="rule-match"&&r.ruleMatchCount++,e.reason==="fallback"&&r.fallbackCount++}recordSuccess(e){let t=this.decisions.get(e);if(t){let r=t.successRate*t.selectionCount;t.successRate=(r+1)/t.selectionCount}}recordFailure(e){}recordCacheHit(){this.cacheHits++}recordCacheMiss(){this.cacheMisses++}getMetrics(){let e={};for(let[r,i]of this.decisions)e[r]={...i};let t=this.totalDecisions>0?this.rulesMatched/this.totalDecisions:0;return{byProvider:e,totalDecisions:this.totalDecisions,decisionsByMode:{...this.decisionsByMode},avgDecisionTimeMs:0,p95DecisionTimeMs:0,p99DecisionTimeMs:0,fallbackRate:this.totalDecisions>0?this.fallbackCount/this.totalDecisions:0,ruleMatchRate:t,estimatedCostSavings:0,ruleStats:{totalEvaluated:this.totalRulesEvaluated,matched:this.rulesMatched,avgRulesPerDecision:this.totalDecisions>0?this.totalRulesEvaluated/this.totalDecisions:0},cacheStats:{hits:this.cacheHits,misses:this.cacheMisses,hitRate:this.cacheHits+this.cacheMisses>0?this.cacheHits/(this.cacheHits+this.cacheMisses):0},period:{start:this.startTime,end:new Date}}}reset(){this.decisions.clear(),this.decisionsByMode={manual:0,"rule-based":0,"cost-optimized":0,"performance-optimized":0},this.totalDecisions=0,this.cacheHits=0,this.cacheMisses=0,this.totalRulesEvaluated=0,this.rulesMatched=0,this.fallbackCount=0,this.startTime=new Date}createEmptyMetrics(e){return{provider:e,selectionCount:0,ruleMatchCount:0,fallbackCount:0,avgDecisionTimeMs:0,successRate:1,avgLatencyMs:0,p95LatencyMs:0,p99LatencyMs:0,totalCost:0,totalTokens:0,circuitState:"closed"}}};oe();var se=$("llm/router-service");function re(l){let e={};for(let[i,o]of Object.entries(l.providers??{}))o?.defaultModel&&(e[i]=o.defaultModel);Z(l.agentOverrides,e);let t=te();if(t.length===0)return l;let r=l.rules.length>0?l.rules:R;return{...l,rules:[...t,...r]}}var ae=["ollama","onnx","gemini","openrouter","openai","claude","azure-openai","bedrock"];async function bt(l={}){if(l.providerManager){let c=re(S({projectRoot:l.projectRoot,override:l.override,env:l.env})),d=new h(l.providerManager,c);return await d.initialize(),{router:d,resolvedConfig:c,enabledProviders:de(c)}}if(!J({projectRoot:l.projectRoot,env:l.env}))return null;let e=re(S({projectRoot:l.projectRoot,override:l.override,env:l.env})),t=ce(e,l.env??process.env);if(t.length===0)return null;let r=new Set(t);for(let[c,d]of Object.entries(e.agentOverrides??{}))d.provider&&!r.has(d.provider)&&se.warn(`[llm-config] agentOverrides["${c}"] routes to provider "${d.provider}", which is not enabled (no API key detected and not enabled in .agentic-qe/llm-config.json). This override will not take effect until that provider is available.`);let{primary:i,fallbacks:o}=le(e,t),n={primary:i,fallbacks:o,providers:ue(e,t,l.allowProjectProviderEndpoints??!0),loadBalancing:"round-robin",global:{enableCostTracking:!0,enableMetrics:!0}},a=new V(n),s=new h(a,e);return await s.initialize(),{router:s,resolvedConfig:e,enabledProviders:t}}function ce(l,e=process.env){let t=W(e),r=[],i=o=>{r.includes(o)||!l.providers?.[o]?.enabled||t.has(o)&&r.push(o)};i(l.defaultProvider);for(let o of l.fallbackChain?.entries??[])i(o.provider);for(let o of ae)i(o);for(let o of v)i(o);return r}function de(l){let e=new Set([l.defaultProvider]);for(let t of l.fallbackChain?.entries??[])e.add(t.provider);return Array.from(e)}function le(l,e){if(e.length===0)throw new Error("pickPrimaryAndFallbacks: no enabled providers");let t=e.includes(l.defaultProvider)?l.defaultProvider:e[0],r=e.filter(i=>i!==t);return{primary:t,fallbacks:r}}function ue(l,e,t=!0){let r={};for(let i of e){let o=l.providers?.[i];if(o){let n={...o};(i==="codex"||i==="claude-code")&&delete n.binaryPath,t||delete n.baseUrl,r[i]=n}}return r}export{bt as a,ce as b,le as c,ue as d};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a as e,b as g,e as r}from"./chunk-ICKLBATY.js";import{c as o}from"./chunk-6VKJAMZY.js";var L=o(()=>{"use strict";e();g();r()});export{L as a};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a as p,b as A,c as L}from"./chunk-D4RCV4LY.js";var R={reflexThreshold:.1,retrievalThreshold:.4,heavyThreshold:.7},M={enabled:!0,laneConfig:R,coherenceThreshold:.1,fallbackEnabled:!0,timeoutMs:5e3,cacheEnabled:!0,cacheTtlMs:300*1e3},m={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},f=class extends Error{constructor(t,i,n){super(t);this.code=i;this.cause=n;this.name="CoherenceError"}code;cause},h=class extends f{constructor(e="WASM module is not loaded",t){super(e,"WASM_NOT_LOADED",t),this.name="WasmNotLoadedError"}};var T=class extends f{constructor(t,i,n){super(t,"WASM_LOAD_FAILED",n);this.attempts=i;this.name="WasmLoadError"}attempts},z={maxAttempts:3,baseDelayMs:100,maxDelayMs:5e3,timeoutMs:1e4};L();function D(u){let e=new Map,t=[],i=new Map,n=new Map,r=0,a=s=>{let l=i.get(s);return l===void 0&&(l=r++,i.set(s,l),n.set(l,s)),l},o=s=>n.get(s)??`unknown-${s}`,d=()=>({nodes:Array.from(e.entries()).map(([s,l])=>({id:a(s),label:s,section:Array.from(l.embedding),weight:1})),edges:t.map(s=>({source:a(s.source),target:a(s.target),weight:s.weight}))});return{add_node(s,l){e.set(s,{embedding:l}),a(s)},add_edge(s,l,c){t.push({source:s,target:l,weight:c}),a(s),a(l)},remove_node(s){e.delete(s);for(let l=t.length-1;l>=0;l--)(t[l].source===s||t[l].target===s)&&t.splice(l,1)},remove_edge(s,l){let c=t.findIndex(g=>g.source===s&&g.target===l);c>=0&&t.splice(c,1)},sheaf_laplacian_energy(){let s=d();return u.consistencyEnergy(s)},detect_contradictions(s){let l=d(),c=u.detectObstructions(l);return c?c.filter(g=>g.energy>s).map(g=>({node1:o(g.node1),node2:o(g.node2),severity:g.energy,distance:g.energy})):[]},clear(){e.clear(),t.length=0,i.clear(),n.clear(),r=0}}}var y=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;nodes=new Map;edges=[];async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing CohomologyAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize CohomologyAdapter.");let t=await this.wasmLoader.load(),i=new t.CohomologyEngine;this.engine=D(i),this.initialized=!0,this.logger.info("CohomologyAdapter initialized successfully")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("CohomologyAdapter not initialized. Call initialize() first.")}addNode(e){this.ensureInitialized(),this.nodes.set(e.id,e);let t=new Float64Array(e.embedding);this.engine.add_node(e.id,t),this.logger.debug("Added node to cohomology graph",{nodeId:e.id,embeddingDim:e.embedding.length})}addEdge(e){this.ensureInitialized(),this.edges.push(e),this.engine.add_edge(e.source,e.target,e.weight),this.logger.debug("Added edge to cohomology graph",{source:e.source,target:e.target,weight:e.weight})}removeNode(e){this.ensureInitialized(),this.nodes.delete(e),this.engine.remove_node(e);let t=[];this.edges.forEach((i,n)=>{(i.source===e||i.target===e)&&t.push(n)}),t.reverse().forEach(i=>this.edges.splice(i,1)),this.logger.debug("Removed node from cohomology graph",{nodeId:e})}removeEdge(e,t){this.ensureInitialized();let i=this.edges.findIndex(n=>n.source===e&&n.target===t);i>=0&&this.edges.splice(i,1),this.engine.remove_edge(e,t),this.logger.debug("Removed edge from cohomology graph",{source:e,target:t})}computeEnergy(){this.ensureInitialized();let e=this.engine.sheaf_laplacian_energy();return this.logger.debug("Computed sheaf Laplacian energy",{energy:e}),e}detectContradictions(e=.1){this.ensureInitialized();let i=this.engine.detect_contradictions(e).map(n=>this.transformContradiction(n));return this.logger.debug("Detected contradictions",{count:i.length,threshold:e}),i}transformContradiction(e){return{nodeIds:[e.node1,e.node2],severity:this.severityFromDistance(e.severity),description:this.generateContradictionDescription(e),confidence:1-e.distance,resolution:this.suggestResolution(e)}}severityFromDistance(e){return e>=.9?"critical":e>=.7?"high":e>=.4?"medium":e>=.2?"low":"info"}generateContradictionDescription(e){let t=this.nodes.get(e.node1),i=this.nodes.get(e.node2);return t?.metadata?.statement&&i?.metadata?.statement?`Contradiction detected between "${t.metadata.statement}" and "${i.metadata.statement}"`:`Contradiction detected between nodes '${e.node1}' and '${e.node2}' with distance ${e.distance.toFixed(3)}`}suggestResolution(e){return e.severity>=.9?"Critical contradiction requires manual review. Consider removing one of the conflicting beliefs.":e.severity>=.7?"High-severity contradiction. Recommend gathering additional evidence to determine which belief is correct.":e.severity>=.4?"Moderate contradiction. Consider adding context or constraints to differentiate the beliefs.":"Low-severity contradiction. May be resolved with additional context or can be safely ignored."}clear(){this.ensureInitialized(),this.nodes.clear(),this.edges.length=0,this.engine.clear(),this.logger.debug("Cleared cohomology graph")}dispose(){this.engine&&(this.engine.clear(),this.engine=null),this.nodes.clear(),this.edges.length=0,this.initialized=!1,this.logger.info("CohomologyAdapter disposed")}getNodeCount(){return this.nodes.size}getEdgeCount(){return this.edges.length}getNode(e){return this.nodes.get(e)}};L();function N(u){let e=new Set,t=[],i=new Map,n=new Map,r=0,a=s=>{let l=i.get(s);return l===void 0&&(l=r++,i.set(s,l),n.set(l,s)),l},o=s=>n.get(s)??`unknown-${s}`,d=()=>({n:e.size,edges:t.map(s=>[a(s.source),a(s.target),s.weight])});return{add_node(s){e.add(s),a(s)},add_edge(s,l,c){t.push({source:s,target:l,weight:c}),a(s),a(l)},remove_node(s){e.delete(s);for(let l=t.length-1;l>=0;l--)(t[l].source===s||t[l].target===s)&&t.splice(l,1)},compute_fiedler_value(){if(e.size<2||t.length===0)return 0;try{let s=d(),l=u.algebraicConnectivity(s);return Number.isFinite(l)&&l>=0?l:0}catch(s){return console.warn("[SpectralAdapter] algebraicConnectivity failed:",s),0}},predict_collapse_risk(){if(e.size<2)return 0;if(t.length===0)return 1;try{let s=d(),l=u.algebraicConnectivity(s),c=Number.isFinite(l)&&l>=0?l:0;return Math.max(0,Math.min(1,1-c))}catch(s){return console.warn("[SpectralAdapter] predict_collapse_risk failed:",s),.8}},get_weak_vertices(s){if(e.size===0)return[];if(t.length===0)return Array.from(e).slice(0,s);try{let l=d(),c=u.predictMinCut(l);return c?.vertices?c.vertices.slice(0,s).map(g=>o(g)):Array.from(e).slice(0,s)}catch(l){return console.warn("[SpectralAdapter] predictMinCut failed:",l),Array.from(e).slice(0,s)}},clear(){e.clear(),t.length=0,i.clear(),n.clear(),r=0}}}var v=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;nodes=new Set;edges=[];async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing SpectralAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize SpectralAdapter.");let t=await this.wasmLoader.load(),i=new t.SpectralEngine;this.engine=N(i),this.initialized=!0,this.logger.info("SpectralAdapter initialized successfully")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("SpectralAdapter not initialized. Call initialize() first.")}addNode(e){if(this.ensureInitialized(),this.nodes.has(e)){this.logger.debug("Node already exists",{nodeId:e});return}this.nodes.add(e),this.engine.add_node(e),this.logger.debug("Added node to spectral graph",{nodeId:e})}addEdge(e,t,i){this.ensureInitialized(),this.nodes.has(e)||this.addNode(e),this.nodes.has(t)||this.addNode(t),this.edges.push({source:e,target:t,weight:i}),this.engine.add_edge(e,t,i),this.logger.debug("Added edge to spectral graph",{source:e,target:t,weight:i})}removeNode(e){this.ensureInitialized(),this.nodes.delete(e),this.engine.remove_node(e);for(let t=this.edges.length-1;t>=0;t--){let i=this.edges[t];(i.source===e||i.target===e)&&this.edges.splice(t,1)}this.logger.debug("Removed node from spectral graph",{nodeId:e})}computeFiedlerValue(){if(this.ensureInitialized(),this.nodes.size<2||this.edges.length===0)return 0;try{let e=this.engine.compute_fiedler_value();return this.logger.debug("Computed Fiedler value",{fiedlerValue:e}),e}catch(e){return this.logger.warn("Failed to compute Fiedler value",{error:p(e),nodeCount:this.nodes.size,edgeCount:this.edges.length}),0}}predictCollapseRisk(){if(this.ensureInitialized(),this.nodes.size<2)return 0;if(this.edges.length===0)return 1;try{let e=this.engine.predict_collapse_risk();return this.logger.debug("Predicted collapse risk",{risk:e}),e}catch(e){return this.logger.warn("Failed to predict collapse risk",{error:p(e),nodeCount:this.nodes.size,edgeCount:this.edges.length}),.8}}getWeakVertices(e){if(this.ensureInitialized(),this.nodes.size===0)return[];if(this.edges.length===0)return Array.from(this.nodes).slice(0,e);let t=Math.min(e,this.nodes.size);try{let i=this.engine.get_weak_vertices(t);return this.logger.debug("Retrieved weak vertices",{requested:e,returned:i.length}),i}catch(i){return this.logger.warn("Failed to get weak vertices",{error:p(i),nodeCount:this.nodes.size,edgeCount:this.edges.length}),Array.from(this.nodes).slice(0,e)}}analyzeSwarmState(e){let t=Date.now();this.clear();for(let d of e.agents)this.addNode(d.agentId);this.buildEdgesFromAgents(e.agents);let i=this.predictCollapseRisk(),n=this.computeFiedlerValue(),r=this.getWeakVertices(5),a=Date.now()-t,o={risk:i,fiedlerValue:n,collapseImminent:i>.7,weakVertices:r,recommendations:this.generateRecommendations(i,n,r),durationMs:a,usedFallback:!1};return this.logger.info("Analyzed swarm state",{agentCount:e.agents.length,risk:i,fiedlerValue:n,durationMs:a}),o}buildEdgesFromAgents(e){for(let t=0;t<e.length;t++)for(let i=t+1;i<e.length;i++){let n=this.computeAgentSimilarity(e[t],e[i]);n>.3&&this.addEdge(e[t].agentId,e[i].agentId,n)}}computeAgentSimilarity(e,t){let i=1-Math.abs(e.health-t.health),n=1-Math.abs(e.successRate-t.successRate),r=e.agentType===t.agentType?.2:0,a=0,o=e.beliefs??[],d=t.beliefs??[];return o.length>0&&d.length>0&&(a=this.computeBeliefOverlap(o,d)),i*.3+n*.3+r+a*.2}computeBeliefOverlap(e,t){if(e.length===0||t.length===0)return 0;let i=0,n=0;for(let r of e)for(let a of t)i+=this.cosineSimilarity(r.embedding,a.embedding),n++;return n>0?i/n:0}cosineSimilarity(e,t){if(e.length!==t.length||e.length===0)return 0;let i=0,n=0,r=0;for(let o=0;o<e.length;o++)i+=e[o]*t[o],n+=e[o]*e[o],r+=t[o]*t[o];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:i/a}generateRecommendations(e,t,i){let n=[];return e>.7?(n.push("CRITICAL: Immediate action required to prevent swarm collapse."),n.push("Consider spawning additional coordination agents to strengthen connectivity.")):e>.5&&n.push("WARNING: Elevated collapse risk detected. Monitor closely."),t<.1&&n.push("Network connectivity is weak. Consider adding redundant communication channels."),t<.05&&(n.push("ALERT: Near-zero Fiedler value indicates potential false consensus."),n.push("Recommend spawning an independent reviewer to verify decisions.")),i.length>0&&n.push(`At-risk agents: ${i.join(", ")}. Consider reassigning critical tasks.`),n.length===0&&n.push("Swarm health is good. No immediate action required."),n}clear(){this.ensureInitialized(),this.nodes.clear(),this.edges.length=0,this.engine.clear(),this.logger.debug("Cleared spectral graph")}dispose(){this.engine&&(this.engine.clear(),this.engine=null),this.nodes.clear(),this.edges.length=0,this.initialized=!1,this.logger.info("SpectralAdapter disposed")}getNodeCount(){return this.nodes.size}getEdgeCount(){return this.edges.length}};function O(u){let e=null,t=null,i=new Map,n=()=>({cause:e?Array.from(e):[],effect:t?Array.from(t):[],confounders:Object.fromEntries(Array.from(i.entries()).map(([r,a])=>[r,Array.from(a)]))});return{set_data(r,a){e=r,t=a},add_confounder(r,a){i.set(r,a)},compute_causal_effect(){let r=n();return u.computeCausalEffect(r,"cause","effect",1)?.effect??0},detect_spurious_correlation(){let r=n();return(u.findConfounders(r,"cause","effect")?.length??0)>0},get_confounders(){let r=n();return u.findConfounders(r,"cause","effect")??Array.from(i.keys())},clear(){e=null,t=null,i.clear()}}}var b=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;currentCause="";currentEffect="";async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing CausalAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize CausalAdapter.");let t=await this.wasmLoader.load(),i=new t.CausalEngine;this.engine=O(i),this.initialized=!0,this.logger.info("CausalAdapter initialized successfully")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("CausalAdapter not initialized. Call initialize() first.")}verifyCausality(e,t,i){this.ensureInitialized();let n=Date.now();if(this.clear(),this.currentCause=e,this.currentEffect=t,this.setData(i.causeValues,i.effectValues),i.confounders)for(let[g,F]of Object.entries(i.confounders))this.addConfounder(g,F);let r=this.computeCausalEffect(),a=this.detectSpuriousCorrelation(),o=this.getConfounders(),d=this.determineRelationshipType(r,a,o.length>0),s=this.computeConfidence(i.sampleSize,r,a),l=Date.now()-n,c={isCausal:d==="causal",effectStrength:r,relationshipType:d,confidence:s,confounders:o,explanation:this.generateExplanation(e,t,d,r,o),durationMs:l,usedFallback:!1};return this.logger.info("Verified causality",{cause:e,effect:t,isCausal:c.isCausal,relationshipType:d,effectStrength:r,durationMs:l}),c}setData(e,t){if(this.ensureInitialized(),e.length!==t.length)throw new Error(`Cause and effect arrays must have same length. Got ${e.length} and ${t.length}.`);let i=new Float64Array(e),n=new Float64Array(t);this.engine.set_data(i,n),this.logger.debug("Set causal data",{sampleSize:e.length})}addConfounder(e,t){this.ensureInitialized();let i=new Float64Array(t);this.engine.add_confounder(e,i),this.logger.debug("Added confounder",{name:e,valueCount:t.length})}computeCausalEffect(){this.ensureInitialized();let e=this.engine.compute_causal_effect();return this.logger.debug("Computed causal effect",{effect:e}),e}detectSpuriousCorrelation(){this.ensureInitialized();let e=this.engine.detect_spurious_correlation();return this.logger.debug("Detected spurious correlation",{isSpurious:e}),e}getConfounders(){return this.ensureInitialized(),this.engine.get_confounders()}determineRelationshipType(e,t,i){return e<.1?"none":t?"spurious":i?"confounded":e<0?"reverse":"causal"}computeConfidence(e,t,i){let n=Math.min(1,e/100)*.5;return n+=Math.abs(t)*.3,i&&(n+=.15),Math.min(.95,n)}generateExplanation(e,t,i,n,r){switch(i){case"causal":return`Analysis indicates a true causal relationship between '${e}' and '${t}'. Effect strength: ${(n*100).toFixed(1)}%. Changes in '${e}' are likely to cause changes in '${t}'.`;case"spurious":return`The correlation between '${e}' and '${t}' appears to be spurious. No true causal mechanism detected. This may be coincidental or due to a hidden common cause.`;case"reverse":return`Analysis suggests reverse causation: '${t}' may cause '${e}', not the other way around. Consider swapping the direction of your hypothesis.`;case"confounded":return`The relationship between '${e}' and '${t}' is confounded by: ${r.join(", ")}. These variables may explain the observed correlation without direct causation.`;case"none":return`No significant relationship detected between '${e}' and '${t}'. Effect strength is below the detection threshold.`;default:return`Analysis complete for '${e}' -> '${t}'.`}}clear(){this.ensureInitialized(),this.engine.clear(),this.currentCause="",this.currentEffect="",this.logger.debug("Cleared causal engine state")}dispose(){this.engine&&(this.engine.clear(),this.engine=null),this.initialized=!1,this.logger.info("CausalAdapter disposed")}};function H(u){let e=new Map,t=[],i=()=>({objects:Array.from(e.entries()).map(([n,r])=>({name:n,schema:r})),morphisms:t.map(n=>({source:n.source,target:n.target,name:n.name}))});return{add_type(n,r){e.set(n,r)},add_morphism(n,r,a){t.push({source:n,target:r,name:a})},verify_composition(n){if(n.length<2)return!0;for(let a=0;a<n.length-1;a++){let o=n[a],d=n[a+1];if(!t.some(l=>l.source===o&&l.target===d))return!1}let r=i();return u.verifyCategoryLaws(r)},check_type_consistency(){let n=[];for(let r of t)e.has(r.source)||n.push({location:r.name,expected:"defined type",actual:`undefined type '${r.source}'`}),e.has(r.target)||n.push({location:r.name,expected:"defined type",actual:`undefined type '${r.target}'`});return n},clear(){e.clear(),t.length=0}}}var C=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;types=new Map;morphisms=[];async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing CategoryAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize CategoryAdapter.");let t=await this.wasmLoader.load(),i=new t.CategoryEngine;this.engine=H(i),this.initialized=!0,this.logger.info("CategoryAdapter initialized successfully")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("CategoryAdapter not initialized. Call initialize() first.")}addType(e,t){this.ensureInitialized(),this.types.set(e,t),this.engine.add_type(e,t),this.logger.debug("Added type to category",{name:e})}addMorphism(e,t,i){this.ensureInitialized(),this.morphisms.push({source:e,target:t,name:i}),this.engine.add_morphism(e,t,i),this.logger.debug("Added morphism to category",{source:e,target:t,name:i})}verifyComposition(e){if(this.ensureInitialized(),e.length<2)return!0;let t=this.engine.verify_composition(e);return this.logger.debug("Verified composition",{path:e,isValid:t}),t}checkTypeConsistency(){this.ensureInitialized();let t=this.engine.check_type_consistency().map(i=>this.transformMismatch(i));return this.logger.debug("Checked type consistency",{mismatchCount:t.length}),t}verifyPipeline(e){let t=Date.now();this.clear(),this.addType(e.inputType,this.inferSchema(e.inputType)),this.addType(e.outputType,this.inferSchema(e.outputType));for(let s of e.elements)this.addType(s.inputType,this.inferSchema(s.inputType)),this.addType(s.outputType,this.inferSchema(s.outputType));for(let s of e.elements)this.addMorphism(s.inputType,s.outputType,s.name);let i=this.buildCompositionPath(e),n=this.verifyComposition(i),r=this.checkTypeConsistency(),a=this.generateWarnings(e,n,r),o=Date.now()-t,d={isValid:n&&r.length===0,mismatches:r,warnings:a,durationMs:o,usedFallback:!1};return this.logger.info("Verified pipeline",{pipelineId:e.id,isValid:d.isValid,mismatchCount:r.length,warningCount:a.length,durationMs:o}),d}buildCompositionPath(e){let t=[e.inputType];for(let i of e.elements)i.inputType!==t[t.length-1]&&t.push(i.inputType),t.push(i.outputType);return t[t.length-1]!==e.outputType&&t.push(e.outputType),t}inferSchema(e){return e.endsWith("[]")?`{ items: ${e.slice(0,-2)}[] }`:e.includes("|")?`{ union: [${e.split("|").map(t=>`"${t.trim()}"`).join(", ")}] }`:`{ type: "${e}" }`}transformMismatch(e){return{location:e.location,expected:e.expected,actual:e.actual,severity:this.determineMismatchSeverity(e)}}determineMismatchSeverity(e){return e.expected==="never"||e.actual==="never"?"critical":e.actual==="any"||e.actual==="unknown"?"high":e.expected.includes(e.actual)||e.actual.includes(e.expected)?"medium":"low"}generateWarnings(e,t,i){let n=[];t||n.push(`Pipeline '${e.id}' has an invalid composition chain. Types do not connect properly from input to output.`);for(let a of e.elements)(a.inputType==="any"||a.outputType==="any")&&n.push(`Element '${a.name}' uses 'any' type, which bypasses type safety.`);for(let a of e.elements)(a.inputType.includes("<T>")||a.outputType.includes("<T>"))&&n.push(`Element '${a.name}' has unconstrained generic types.`);let r=i.filter(a=>a.severity==="critical");return r.length>0&&n.push(`Found ${r.length} critical type mismatch(es) that will cause runtime errors.`),n}clear(){this.ensureInitialized(),this.types.clear(),this.morphisms.length=0,this.engine.clear(),this.logger.debug("Cleared category")}dispose(){this.engine&&(this.engine.clear(),this.engine=null),this.types.clear(),this.morphisms.length=0,this.initialized=!1,this.logger.info("CategoryAdapter disposed")}getTypeCount(){return this.types.size}getMorphismCount(){return this.morphisms.length}};function V(u){let e=new Map,t=new Map;return{add_proposition(i,n){e.set(i,{formula:n,proven:!1})},add_proof(i,n){let r=e.get(i);if(!r)return!1;let a={id:i,proof:n},o={formula:r.formula};return u.typeCheck(a,o)?.valid?(r.proven=!0,t.set(i,n),!0):!1},verify_path_equivalence(i,n){let r={steps:i},a={steps:n};return u.checkTypeEquivalence(r,a)},get_unproven_propositions(){let i=[];return e.forEach((n,r)=>{n.proven||i.push(r)}),i},clear(){e.clear(),t.clear()}}}var w=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;propositions=new Map;async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing HomotopyAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize HomotopyAdapter.");let t=await this.wasmLoader.load(),i=new t.HoTTEngine;this.engine=V(i),this.initialized=!0,this.logger.info("HomotopyAdapter initialized successfully")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("HomotopyAdapter not initialized. Call initialize() first.")}addProposition(e,t){this.ensureInitialized();let i={id:e,formula:t,proven:!1};this.propositions.set(e,i),this.engine.add_proposition(e,t),this.logger.debug("Added proposition",{id:e,formula:t})}addProof(e,t){this.ensureInitialized();let i=this.propositions.get(e);if(!i)return this.logger.warn("Proposition not found",{propositionId:e}),!1;let n=this.engine.add_proof(e,t);return n?(i.proven=!0,this.logger.info("Proposition proven",{propositionId:e})):this.logger.warn("Proof rejected",{propositionId:e}),n}verifyPathEquivalence(e,t){this.ensureInitialized();let i=this.engine.verify_path_equivalence(e,t),n=this.generateEquivalenceExplanation(e,t,i),r={equivalent:i,path1:e,path2:t,explanation:n};return this.logger.debug("Verified path equivalence",{path1Length:e.length,path2Length:t.length,equivalent:i}),r}generateEquivalenceExplanation(e,t,i){if(i)return e.length===t.length?"The execution paths are homotopically equivalent. Both paths traverse the same abstract structure and will produce equivalent results.":`The execution paths are equivalent despite different lengths. The ${e.length>t.length?"first":"second"} path contains redundant steps that can be contracted without changing the result (homotopy contraction).`;{let n=0,r=Math.min(e.length,t.length);for(;n<r&&e[n]===t[n];)n++;return n===0?`The execution paths diverge immediately. Path 1 starts with '${e[0]}' while Path 2 starts with '${t[0]}'. These lead to fundamentally different computation spaces.`:`The execution paths diverge at step ${n+1}. After '${e[n-1]}', Path 1 proceeds to '${e[n]}' while Path 2 proceeds to '${t[n]}'. No homotopy exists between these paths.`}}getUnprovenPropositions(){return this.ensureInitialized(),this.engine.get_unproven_propositions()}getVerificationStatus(){let e=this.propositions.size,t=Array.from(this.propositions.values()).filter(n=>n.proven).length,i=this.getUnprovenPropositions();return{totalPropositions:e,provenCount:t,unprovenIds:i,verificationPercentage:e>0?t/e*100:100}}getProposition(e){return this.propositions.get(e)}clear(){this.ensureInitialized(),this.propositions.clear(),this.engine.clear(),this.logger.debug("Cleared homotopy engine")}dispose(){this.engine&&(this.engine.clear(),this.engine=null),this.propositions.clear(),this.initialized=!1,this.logger.info("HomotopyAdapter disposed")}getPropositionCount(){return this.propositions.size}};import{createHash as $}from"crypto";var E=class{constructor(e,t=m){this.wasmLoader=e;this.logger=t}wasmLoader;logger;engine=null;initialized=!1;witnesses=new Map;decisions=new Map;witnessCounter=0;async initialize(){if(this.initialized)return;if(this.logger.debug("Initializing WitnessAdapter"),!await this.wasmLoader.isAvailable())throw new h("WASM module is not available. Cannot initialize WitnessAdapter.");let t=await this.wasmLoader.load();this.engine=this.createWitnessEngine(t),this.initialized=!0,this.logger.info("WitnessAdapter initialized successfully")}createWitnessEngine(e){return this.createFallbackEngine()}createFallbackEngine(){let e=[];return{create_witness:(t,i)=>{let r={hash:this.computeHash(t,i),previousHash:i,position:e.length,timestamp:Date.now()};return e.push(r),r},verify_witness:(t,i)=>{let n=e.find(a=>a.hash===i);return this.computeHash(t,n?.previousHash)===i},verify_chain:t=>{if(t.length===0)return!0;if(t[0].previousHash!==void 0)return!1;for(let i=1;i<t.length;i++)if(t[i].previousHash!==t[i-1].hash)return!1;return!0},get_chain_length:()=>e.length}}computeHash(e,t){let i=$("sha256");return i.update(e),t&&i.update(t,"utf-8"),i.digest("hex")}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized||!this.engine)throw new h("WitnessAdapter not initialized. Call initialize() first.")}createWitness(e){this.ensureInitialized();let t=this.serializeDecision(e),i=this.getLastWitness(),n=i?.hash,r=this.engine.create_witness(t,n),a=`witness-${++this.witnessCounter}-${Date.now()}`,o={witnessId:a,decisionId:e.id,hash:r.hash,previousWitnessId:i?.witnessId,chainPosition:r.position,timestamp:new Date(r.timestamp)};return this.witnesses.set(a,o),this.decisions.set(e.id,e),this.logger.info("Created witness",{witnessId:a,decisionId:e.id,chainPosition:o.chainPosition}),o}verifyWitness(e,t){this.ensureInitialized();let i=this.serializeDecision(e),n=this.engine.verify_witness(i,t);return this.logger.debug("Verified witness",{decisionId:e.id,hash:t,isValid:n}),n}verifyChain(e){if(this.ensureInitialized(),e.length===0)return!0;let t=e.map(n=>({hash:n.hash,previousHash:n.previousWitnessId?this.witnesses.get(n.previousWitnessId)?.hash:void 0,position:n.chainPosition,timestamp:n.timestamp.getTime()})),i=this.engine.verify_chain(t);return this.logger.info("Verified witness chain",{chainLength:e.length,isValid:i}),i}replayFromWitness(e){let t=Date.now(),i=this.witnesses.get(e);if(!i)return{success:!1,decision:this.createEmptyDecision(),matchesOriginal:!1,differences:[`Witness not found: ${e}`],durationMs:Date.now()-t};let n=this.decisions.get(i.decisionId);if(!n)return{success:!1,decision:this.createEmptyDecision(),matchesOriginal:!1,differences:[`Decision not found: ${i.decisionId}`],durationMs:Date.now()-t};let r=this.verifyWitness(n,i.hash),a=Date.now()-t,o={success:!0,decision:n,matchesOriginal:r,differences:r?void 0:["Hash mismatch detected"],durationMs:a};return this.logger.info("Replayed from witness",{witnessId:e,decisionId:n.id,matchesOriginal:r,durationMs:a}),o}getChainLength(){return this.ensureInitialized(),this.engine.get_chain_length()}getWitnessChain(){return Array.from(this.witnesses.values()).sort((e,t)=>e.chainPosition-t.chainPosition)}getWitness(e){return this.witnesses.get(e)}getLastWitness(){let e=this.getWitnessChain();return e[e.length-1]}serializeDecision(e){let t=JSON.stringify({id:e.id,type:e.type,inputs:e.inputs,output:e.output,agents:e.agents,timestamp:e.timestamp.toISOString(),reasoning:e.reasoning});return new TextEncoder().encode(t)}createEmptyDecision(){return{id:"",type:"routing",inputs:{},output:null,agents:[],timestamp:new Date}}dispose(){this.witnesses.clear(),this.decisions.clear(),this.witnessCounter=0,this.engine=null,this.initialized=!1,this.logger.info("WitnessAdapter disposed")}};var I=class{constructor(e,t={},i){this.wasmLoader=e;this.config={...M,...t},this.logger=i||m}wasmLoader;config;logger;cohomologyAdapter=null;spectralAdapter=null;causalAdapter=null;categoryAdapter=null;homotopyAdapter=null;witnessAdapter=null;initialized=!1;stats={totalChecks:0,coherentCount:0,incoherentCount:0,averageEnergy:0,averageDurationMs:0,totalContradictions:0,laneDistribution:{reflex:0,retrieval:0,heavy:0,human:0},fallbackCount:0,wasmAvailable:!1};totalEnergySum=0;totalDurationSum=0;async initialize(){if(this.initialized)return;this.logger.info("Initializing CoherenceService");let e=await this.wasmLoader.isAvailable();if(!e&&!this.config.fallbackEnabled)throw new h("WASM module is not available and fallback is disabled. Enable fallbackEnabled in config to use TypeScript fallback.");if(this.stats.wasmAvailable=e,e)try{this.cohomologyAdapter=new y(this.wasmLoader,this.logger),this.spectralAdapter=new v(this.wasmLoader,this.logger),this.causalAdapter=new b(this.wasmLoader,this.logger),this.categoryAdapter=new C(this.wasmLoader,this.logger),this.homotopyAdapter=new w(this.wasmLoader,this.logger),this.witnessAdapter=new E(this.wasmLoader,this.logger),await Promise.all([this.cohomologyAdapter.initialize(),this.spectralAdapter.initialize(),this.causalAdapter.initialize(),this.categoryAdapter.initialize(),this.homotopyAdapter.initialize(),this.witnessAdapter.initialize()]),this.logger.info("All coherence engine adapters initialized")}catch(t){if(!this.config.fallbackEnabled)throw t;this.logger.warn("WASM initialization failed, using fallback",{error:t instanceof Error?t.message:"Unknown error"}),this.stats.wasmAvailable=!1}else this.logger.info("WASM not available, using TypeScript fallback");this.initialized=!0,this.logger.info("CoherenceService initialized",{wasmAvailable:this.stats.wasmAvailable,fallbackEnabled:this.config.fallbackEnabled})}isInitialized(){return this.initialized}ensureInitialized(){if(!this.initialized)throw new f("CoherenceService not initialized. Call initialize() first.","NOT_INITIALIZED")}async checkCoherence(e){this.ensureInitialized();let t=Date.now();try{return this.cohomologyAdapter?.isInitialized()?await this.checkCoherenceWithWasm(e,t):this.checkCoherenceWithFallback(e,t)}catch(i){return this.logger.error("Coherence check failed",A(i)),{energy:1,isCoherent:!1,lane:"human",contradictions:[],recommendations:["Coherence check failed. Manual review recommended."],durationMs:Date.now()-t,usedFallback:!0}}}async checkCoherenceWithWasm(e,t){this.cohomologyAdapter.clear();for(let o of e)this.cohomologyAdapter.addNode(o);this.buildEdgesFromNodes(e);let i=this.cohomologyAdapter.computeEnergy(),n=this.cohomologyAdapter.detectContradictions(this.config.coherenceThreshold),r=this.computeLane(i),a=Date.now()-t;return this.updateStats(i,a,n.length,r,!1),{energy:i,isCoherent:i<this.config.coherenceThreshold,lane:r,contradictions:n,recommendations:this.generateRecommendations(i,r,n),durationMs:a,usedFallback:!1}}checkCoherenceWithFallback(e,t){this.stats.fallbackCount++;let i=0,n=0,r=[];for(let s=0;s<e.length;s++)for(let l=s+1;l<e.length;l++){let c=this.euclideanDistance(e[s].embedding,e[l].embedding);i+=c,n++,c>1.5&&r.push({nodeIds:[e[s].id,e[l].id],severity:c>2?"critical":"high",description:`High distance (${c.toFixed(2)}) between nodes`,confidence:Math.min(1,c/2)})}let a=n>0?i/n:0,o=this.computeLane(a),d=Date.now()-t;return this.updateStats(a,d,r.length,o,!0),{energy:a,isCoherent:a<this.config.coherenceThreshold,lane:o,contradictions:r,recommendations:this.generateRecommendations(a,o,r),durationMs:d,usedFallback:!0}}buildEdgesFromNodes(e){for(let t=0;t<e.length;t++)for(let i=t+1;i<e.length;i++){let n=this.cosineSimilarity(e[t].embedding,e[i].embedding);n>.3&&this.cohomologyAdapter.addEdge({source:e[t].id,target:e[i].id,weight:n})}}async detectContradictions(e){this.ensureInitialized();let t=e.map(n=>({id:n.id,embedding:n.embedding,weight:n.confidence,metadata:{statement:n.statement,source:n.source}}));return(await this.checkCoherence(t)).contradictions}async predictCollapse(e){if(this.ensureInitialized(),!e.agents||e.agents.length===0)return{risk:0,fiedlerValue:0,collapseImminent:!1,weakVertices:[],recommendations:["No agents to analyze"],durationMs:0,usedFallback:!0};if(this.spectralAdapter?.isInitialized())try{return this.spectralAdapter.analyzeSwarmState(e)}catch(t){return this.logger.warn("Spectral collapse prediction failed, using fallback",{error:p(t),agentCount:e.agents.length}),this.predictCollapseWithFallback(e)}return this.predictCollapseWithFallback(e)}predictCollapseWithFallback(e){let t=Date.now(),i=e.agents.reduce((o,d)=>o+d.health,0)/Math.max(e.agents.length,1),n=e.agents.reduce((o,d)=>o+d.successRate,0)/Math.max(e.agents.length,1),r=0;r+=(1-i)*.3,r+=(1-n)*.3,r+=e.errorRate*.2,r+=e.utilization>.9?.2:e.utilization*.1;let a=e.agents.filter(o=>o.health<.5||o.successRate<.5).map(o=>o.agentId);return{risk:Math.min(1,r),fiedlerValue:i*n,collapseImminent:r>.7,weakVertices:a,recommendations:r>.5?["System health degraded. Consider spawning additional agents."]:["System health is acceptable."],durationMs:Date.now()-t,usedFallback:!0}}async verifyCausality(e,t,i){return this.ensureInitialized(),this.causalAdapter?.isInitialized()?this.causalAdapter.verifyCausality(e,t,i):this.verifyCausalityWithFallback(e,t,i)}verifyCausalityWithFallback(e,t,i){let n=Date.now(),r=this.computeCorrelation(i.causeValues,i.effectValues),a=Math.abs(r);return{isCausal:a>.5,effectStrength:a,relationshipType:a<.2?"none":a>.5?"causal":"spurious",confidence:Math.min(.7,i.sampleSize/100),confounders:[],explanation:`Correlation-based analysis: r=${r.toFixed(3)}. Note: Correlation does not imply causation. This is a fallback analysis without full causal inference.`,durationMs:Date.now()-n,usedFallback:!0}}async verifyTypes(e){return this.ensureInitialized(),this.categoryAdapter?.isInitialized()?this.categoryAdapter.verifyPipeline(e):this.verifyTypesWithFallback(e)}verifyTypesWithFallback(e){let t=Date.now(),i=[],n=e.inputType;for(let r of e.elements)r.inputType!==n&&n!=="any"&&i.push({location:r.name,expected:n,actual:r.inputType,severity:"high"}),n=r.outputType;return n!==e.outputType&&n!=="any"&&i.push({location:"pipeline output",expected:e.outputType,actual:n,severity:"critical"}),{isValid:i.length===0,mismatches:i,warnings:["Using fallback type verification. Full categorical analysis unavailable."],durationMs:Date.now()-t,usedFallback:!0}}async createWitness(e){return this.ensureInitialized(),this.witnessAdapter?.isInitialized()?this.witnessAdapter.createWitness(e):{witnessId:`witness-fallback-${Date.now()}`,decisionId:e.id,hash:this.simpleHash(JSON.stringify(e)),chainPosition:0,timestamp:new Date}}async replayFromWitness(e){return this.ensureInitialized(),this.witnessAdapter?.isInitialized()?this.witnessAdapter.replayFromWitness(e):{success:!1,decision:{id:"",type:"routing",inputs:{},output:null,agents:[],timestamp:new Date},matchesOriginal:!1,differences:["Replay not available in fallback mode"],durationMs:0}}async checkSwarmCoherence(e){this.ensureInitialized();let t=[];return e.forEach((i,n)=>{let r=this.agentHealthToEmbedding(i);t.push({id:n,embedding:r,weight:i.health,metadata:{agentType:i.agentType,successRate:i.successRate,errorCount:i.errorCount}})}),this.checkCoherence(t)}async verifyConsensus(e){this.ensureInitialized();let t=Date.now();if(e.length<2)return{isValid:e.length===1,confidence:e.length===1?e[0].confidence:0,isFalseConsensus:!1,fiedlerValue:e.length===1?1:0,collapseRisk:0,recommendation:e.length===0?"No votes to analyze":"Single vote - consensus trivially achieved",durationMs:Date.now()-t,usedFallback:!0};if(this.spectralAdapter?.isInitialized())try{this.spectralAdapter.clear();for(let a of e)this.spectralAdapter.addNode(a.agentId);let i=0;for(let a=0;a<e.length;a++)for(let o=a+1;o<e.length;o++)e[a].verdict===e[o].verdict&&(this.spectralAdapter.addEdge(e[a].agentId,e[o].agentId,Math.min(e[a].confidence,e[o].confidence)),i++);if(i===0)return this.logger.debug("No agreement edges, using fallback consensus"),this.verifyConsensusWithFallback(e,t);let n=this.spectralAdapter.predictCollapseRisk(),r=this.spectralAdapter.computeFiedlerValue();return{isValid:n<.3&&r>.1,confidence:1-n,isFalseConsensus:r<.05,fiedlerValue:r,collapseRisk:n,recommendation:n>.3?"Spawn independent reviewer":"Consensus verified",durationMs:Date.now()-t,usedFallback:!1}}catch(i){return this.logger.warn("Spectral consensus verification failed, using fallback",{error:p(i),voteCount:e.length}),this.verifyConsensusWithFallback(e,t)}return this.verifyConsensusWithFallback(e,t)}verifyConsensusWithFallback(e,t){let i=new Map;for(let o of e){let d=String(o.verdict);i.set(d,(i.get(d)||0)+1)}let n=0;i.forEach(o=>{n=Math.max(n,o)});let r=n/e.length,a=e.reduce((o,d)=>o+d.confidence,0)/e.length;return{isValid:r>.6,confidence:r*a,isFalseConsensus:i.size===1&&e.length>2,fiedlerValue:r,collapseRisk:1-r,recommendation:r<.6?"No clear majority. Consider spawning additional agents.":r===1&&i.size===1?"Unanimous consensus may indicate false consensus. Consider adding diversity.":"Majority consensus achieved.",durationMs:Date.now()-t,usedFallback:!0}}async filterCoherent(e,t){if(this.ensureInitialized(),e.length===0)return[];if(e.length===1)return e;let i=e.map(a=>({id:a.id,embedding:a.embedding})),n=await this.checkCoherence(i);if(n.isCoherent)return e;let r=new Set;for(let a of n.contradictions)a.nodeIds.forEach(o=>r.add(o));return e.filter(a=>!r.has(a.id))}getStats(){return{...this.stats,averageEnergy:this.stats.totalChecks>0?this.totalEnergySum/this.stats.totalChecks:0,averageDurationMs:this.stats.totalChecks>0?this.totalDurationSum/this.stats.totalChecks:0,lastCheckAt:this.stats.lastCheckAt}}async dispose(){this.cohomologyAdapter?.dispose(),this.spectralAdapter?.dispose(),this.causalAdapter?.dispose(),this.categoryAdapter?.dispose(),this.homotopyAdapter?.dispose(),this.witnessAdapter?.dispose(),this.cohomologyAdapter=null,this.spectralAdapter=null,this.causalAdapter=null,this.categoryAdapter=null,this.homotopyAdapter=null,this.witnessAdapter=null,this.initialized=!1,this.logger.info("CoherenceService disposed")}computeLane(e){let{laneConfig:t}=this.config;return e<t.reflexThreshold?"reflex":e<t.retrievalThreshold?"retrieval":e<t.heavyThreshold?"heavy":"human"}updateStats(e,t,i,n,r){this.stats.totalChecks++,this.totalEnergySum+=e,this.totalDurationSum+=t,this.stats.totalContradictions+=i,this.stats.laneDistribution[n]++,this.stats.lastCheckAt=new Date,e<this.config.coherenceThreshold?this.stats.coherentCount++:this.stats.incoherentCount++,r&&this.stats.fallbackCount++}generateRecommendations(e,t,i){let n=[];if(t==="reflex"?n.push("Low energy detected. Safe to proceed with immediate execution."):t==="retrieval"?n.push("Moderate energy detected. Consider fetching additional context before proceeding."):t==="heavy"?n.push("High energy detected. Deep analysis recommended before proceeding."):n.push("Critical energy level. Escalate to human review (Queen agent)."),i.length>0){let r=i.filter(a=>a.severity==="critical");r.length>0&&n.push(`Found ${r.length} critical contradiction(s) that must be resolved.`)}return n}agentHealthToEmbedding(e){let t=e.beliefs??[];return[e.health,e.successRate,Math.min(1,e.errorCount/10),this.agentTypeToNumber(e.agentType),t.length/10,...t[0]?.embedding.slice(0,5)||[0,0,0,0,0],...t[1]?.embedding.slice(0,5)||[0,0,0,0,0],...t[2]?.embedding.slice(0,5)||[0,0,0,0,0]]}agentTypeToNumber(e){let t=["coordinator","specialist","analyzer","generator","validator","tester","reviewer","optimizer"],i=t.indexOf(e);return i>=0?i/t.length:.5}euclideanDistance(e,t){if(e.length!==t.length)return 1/0;let i=0;for(let n=0;n<e.length;n++)i+=(e[n]-t[n])**2;return Math.sqrt(i)}cosineSimilarity(e,t){if(e.length!==t.length||e.length===0)return 0;let i=0,n=0,r=0;for(let o=0;o<e.length;o++)i+=e[o]*t[o],n+=e[o]*e[o],r+=t[o]*t[o];let a=Math.sqrt(n)*Math.sqrt(r);return a===0?0:i/a}computeCorrelation(e,t){if(e.length!==t.length||e.length<2)return 0;let i=e.length,n=e.reduce((l,c)=>l+c,0)/i,r=t.reduce((l,c)=>l+c,0)/i,a=0,o=0,d=0;for(let l=0;l<i;l++){let c=e[l]-n,g=t[l]-r;a+=c*g,o+=c*c,d+=g*g}let s=Math.sqrt(o*d);return s===0?0:a/s}simpleHash(e){let t=0;for(let i=0;i<e.length;i++){let n=e.charCodeAt(i);t=(t<<5)-t+n,t=t&t}return(t>>>0).toString(16).padStart(8,"0")}};async function Q(u,e,t){let i=new I(u,e,t);return await i.initialize(),i}L();import{createRequire as _}from"node:module";import{fileURLToPath as K}from"node:url";import{dirname as x,join as S}from"node:path";import{readFileSync as X,existsSync as P}from"node:fs";var W=[1e3,2e3,4e3],k=class{state="unloaded";wasmModule=null;engines=null;loadPromise=null;lastError=null;config;version="";fallbackState={mode:"wasm",consecutiveFailures:0,totalActivations:0,nextRetryAt:void 0,lastSuccessfulLoad:void 0};retryTimer=null;degradedModeStartTime=null;eventListeners;constructor(e={}){this.config={...z,...e},this.eventListeners=new Map,this.eventListeners.set("loaded",new Set),this.eventListeners.set("error",new Set),this.eventListeners.set("retry",new Set),this.eventListeners.set("degraded_mode",new Set),this.eventListeners.set("recovered",new Set)}isLoaded(){return this.state==="loaded"&&this.engines!==null}getState(){return this.state}getVersion(){return this.version}getLastError(){return this.lastError}isInDegradedMode(){return this.state==="degraded"||this.fallbackState.mode==="fallback"}getFallbackState(){return{...this.fallbackState}}getFallbackResult(){return{usedFallback:!0,confidence:.5,retryCount:this.fallbackState.consecutiveFailures,lastError:this.lastError?.message,activatedAt:this.degradedModeStartTime??new Date}}async getEngines(){if(this.state==="loaded"&&this.engines)return this.engines;if(this.state==="loading"&&this.loadPromise)return this.loadPromise;this.state="loading",this.loadPromise=this.loadWithRetry();try{return this.engines=await this.loadPromise,this.state="loaded",(this.fallbackState.mode==="fallback"||this.fallbackState.mode==="recovering")&&this.emitRecoveryEvent(),this.fallbackState.mode="wasm",this.fallbackState.consecutiveFailures=0,this.fallbackState.lastSuccessfulLoad=new Date,this.engines}catch(e){throw this.state="failed",this.lastError=A(e),this.enterDegradedMode(this.lastError),e}finally{this.loadPromise=null}}async getEnginesWithFallback(){if(this.state==="loaded"&&this.engines)return{engines:this.engines,fallback:{usedFallback:!1,confidence:1,retryCount:0}};if(this.state==="degraded")return{engines:null,fallback:this.getFallbackResult()};try{return{engines:await this.getEngines(),fallback:{usedFallback:!1,confidence:1,retryCount:0}}}catch{return{engines:null,fallback:this.getFallbackResult()}}}getEnginesSync(){if(!this.engines)throw new h("WASM module is not loaded. Call getEngines() first.");return this.engines}async isAvailable(){if(this.state==="loaded"&&this.wasmModule)return!0;if(this.state==="failed")return!1;try{let e=_(import.meta.url),t=[(()=>{try{let i=e.resolve("prime-radiant-advanced-wasm");return S(x(i),"prime_radiant_advanced_wasm_bg.wasm")}catch{return null}})(),S(process.cwd(),"node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")].filter(i=>i!==null);for(let i of t)if(P(i))return!0;return!1}catch{return!1}}async load(){if(await this.getEngines(),!this.wasmModule)throw new h("WASM module failed to load");return this.wasmModule}getModule(){if(!this.wasmModule)throw new h("WASM module is not loaded. Call load() first.");return this.wasmModule}on(e,t){let i=this.eventListeners.get(e);return i&&i.add(t),()=>{i?.delete(t)}}off(e,t){let i=this.eventListeners.get(e);i&&i.delete(t)}reset(){if(this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.engines)try{this.engines.cohomology.free(),this.engines.spectral.free(),this.engines.causal.free(),this.engines.category.free(),this.engines.hott.free(),this.engines.quantum.free()}catch(e){console.debug("[WASMLoader] Cleanup error during unload:",e instanceof Error?e.message:e)}this.state="unloaded",this.wasmModule=null,this.engines=null,this.loadPromise=null,this.lastError=null,this.version="",this.fallbackState={mode:"wasm",consecutiveFailures:0,totalActivations:0,nextRetryAt:void 0,lastSuccessfulLoad:void 0},this.degradedModeStartTime=null}async forceRetry(){this.retryTimer&&(clearTimeout(this.retryTimer),this.retryTimer=null),(this.state==="failed"||this.state==="degraded")&&(this.state="unloaded",this.fallbackState.mode="recovering");try{return await this.getEngines(),!0}catch{return!1}}async loadWithRetry(){let{maxAttempts:e,baseDelayMs:t,maxDelayMs:i}=this.config,n=new Error("Unknown error");for(let r=1;r<=e;r++)try{let a=performance.now(),o=await this.attemptLoad(),d=performance.now()-a;return this.emit("loaded",{version:this.version,loadTimeMs:Math.round(d*100)/100}),o}catch(a){if(n=A(a),this.emit("error",{error:n,fatal:r>=e,attempt:r}),r<e){let o=Math.min(t*Math.pow(2,r-1),i);this.emit("retry",{attempt:r+1,maxAttempts:e,delayMs:o,previousError:n}),await this.sleep(o)}}throw new T(`Failed to load WASM module after ${e} attempts: ${n.message}`,e,n)}async attemptLoad(){let e;try{e=_(import.meta.url)}catch{e=globalThis.require||(await import("module")).createRequire(__filename)}let t;try{t=await import("./prime-radiant-advanced-wasm-KO2PQI3D.js")}catch(r){try{t=e("prime-radiant-advanced-wasm")}catch{throw new Error(`Failed to import prime-radiant-advanced-wasm: ${p(r)}`)}}if(typeof process<"u"&&process.versions!=null&&process.versions.node!=null?await this.initializeForNodeJs(t,e):t.default&&typeof t.default=="function"&&await t.default(),t.initModule&&typeof t.initModule=="function")try{t.initModule()}catch{}return t.getVersion&&typeof t.getVersion=="function"&&(this.version=t.getVersion()),this.wasmModule=t,{cohomology:new t.CohomologyEngine,spectral:new t.SpectralEngine,causal:new t.CausalEngine,category:new t.CategoryEngine,hott:new t.HoTTEngine,quantum:new t.QuantumEngine}}async initializeForNodeJs(e,t){let i=[(()=>{try{let a=t.resolve("prime-radiant-advanced-wasm");return S(x(a),"prime_radiant_advanced_wasm_bg.wasm")}catch{return null}})(),S(x(K(import.meta.url)),"../../../../node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm"),S(process.cwd(),"node_modules/prime-radiant-advanced-wasm/prime_radiant_advanced_wasm_bg.wasm")].filter(a=>a!==null),n=null;for(let a of i)if(P(a)){n=a;break}if(!n)throw new Error(`Could not find WASM binary. Searched paths:
|
|
3
|
-
${i.join(`
|
|
4
|
-
`)}
|
|
5
|
-
Ensure prime-radiant-advanced-wasm is installed.`);let r=X(n);if(e.initSync&&typeof e.initSync=="function")e.initSync({module:r});else throw new Error("WASM module does not export initSync function")}emit(e,t){let i=this.eventListeners.get(e);if(i){let n=Array.from(i);for(let r=0;r<n.length;r++)try{n[r](t)}catch{}}}sleep(e){return new Promise(t=>setTimeout(t,e))}enterDegradedMode(e){this.state="degraded",this.fallbackState.mode="fallback",this.fallbackState.consecutiveFailures++,this.fallbackState.totalActivations++,this.degradedModeStartTime||(this.degradedModeStartTime=new Date);let t=Math.min(this.fallbackState.consecutiveFailures-1,W.length-1),i=W[t],n=new Date(Date.now()+i);this.fallbackState.nextRetryAt=n,console.warn(`[WasmLoader] WASM load failed, entering degraded mode. Retry ${this.fallbackState.consecutiveFailures}/3 in ${i}ms. Error: ${e.message}`),this.emit("degraded_mode",{reason:"WASM load failed after retries",retryCount:this.fallbackState.consecutiveFailures,lastError:e.message,activatedAt:this.degradedModeStartTime,nextRetryAt:n}),this.fallbackState.consecutiveFailures<W.length&&this.scheduleBackgroundRetry(i)}scheduleBackgroundRetry(e){this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.fallbackState.mode="recovering",this.attemptBackgroundRecovery()},e)}async attemptBackgroundRecovery(){this.state="unloaded",this.loadPromise=null;try{await this.getEngines()}catch{}}emitRecoveryEvent(){if(!this.degradedModeStartTime)return;let e=Date.now()-this.degradedModeStartTime.getTime();console.info(`[WasmLoader] WASM recovered after ${e}ms in degraded mode. Retry count: ${this.fallbackState.consecutiveFailures}`),this.emit("recovered",{degradedDurationMs:e,retryCount:this.fallbackState.consecutiveFailures,version:this.version}),this.degradedModeStartTime=null}},J=new k;var Z={emaAlpha:.1,minSamplesForCalibration:10,maxHistorySize:1e3,targetFalsePositiveRate:.05,targetFalseNegativeRate:.02,maxAdjustmentPerCycle:.05,autoCalibrate:!1,autoCalibrateInterval:100,defaultThresholds:{...R}};export{Q as a,J as b};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{writeFileSync as p,readFileSync as m}from"node:fs";import{resolve as f,dirname as c,join as d}from"node:path";import{mkdirSync as g}from"node:fs";import{fileURLToPath as h}from"node:url";function $(){try{let e=typeof __dirname<"u"?__dirname:c(h(import.meta.url));for(let t=0;t<5;t++){let n=d(e,"package.json");try{let r=JSON.parse(m(n,"utf-8"));if(r.version)return r.version}catch{}e=c(e)}}catch{}return"unknown"}var T=["-F, --format <format>","Output format (text|json|sarif|junit|markdown)","text"],x=["-o, --output <path>","Write output to file instead of stdout"];function C(e,t,n){if(t){let r=f(t);g(c(r),{recursive:!0}),p(r,e,"utf-8"),n&&console.log(n),console.log(`Output written to: ${r}`)}else console.log(e)}function R(e){return JSON.stringify(e,null,2)}var v="https://raw.githubusercontent.com/oasis-tcs/sarif-spec/main/sarif-2.1/schema/sarif-schema-2.1.0.json";function w(e){let t=i=>{switch(i.toLowerCase()){case"critical":case"high":return"error";case"medium":return"warning";case"low":case"info":return"note";default:return"warning"}},n=new Map,r=[];for(let i of e.vulnerabilities){let o=i.ruleId||`AQE/${i.type.replace(/\s+/g,"-").toLowerCase()}`;n.has(o)||n.set(o,{id:o,name:i.type,shortDescription:i.type,...i.cweId?{helpUri:`https://cwe.mitre.org/data/definitions/${i.cweId.replace("CWE-","")}.html`}:{}}),r.push({ruleId:o,level:t(i.severity),message:{text:i.message},locations:[{physicalLocation:{artifactLocation:{uri:i.file,uriBaseId:"%SRCROOT%"},region:{startLine:i.line,startColumn:1}}}],...i.cweId?{taxa:[{id:i.cweId,toolComponent:{name:"CWE"}}]}:{}})}let s={$schema:v,version:"2.1.0",runs:[{tool:{driver:{name:"agentic-qe",version:$(),informationUri:"https://github.com/proffesor-for-testing/agentic-qe",rules:Array.from(n.values()).map(i=>({id:i.id,name:i.name,shortDescription:{text:i.shortDescription},...i.helpUri?{helpUri:i.helpUri}:{},defaultConfiguration:{level:"warning"}}))}},results:r,invocations:[{executionSuccessful:!0,commandLine:`aqe security --sast --format sarif -t ${e.target}`}]}]};return JSON.stringify(s,null,2)}function a(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function I(e){let t=e.tests||[],n=e.passed+e.failed+e.skipped,r=(e.duration/1e3).toFixed(3),s=`<?xml version="1.0" encoding="UTF-8"?>
|
|
3
|
-
`;if(s+=`<testsuites tests="${n}" failures="${e.failed}" errors="0" time="${r}">
|
|
4
|
-
`,s+=` <testsuite name="aqe-test-run" tests="${n}" failures="${e.failed}" errors="0" skipped="${e.skipped}" time="${r}" id="${a(e.runId)}">
|
|
5
|
-
`,t.length>0)for(let i of t){let o=(i.duration/1e3).toFixed(3),l=a(i.suite||i.file||"aqe"),u=a(i.name);s+=` <testcase classname="${l}" name="${u}" time="${o}"`,!i.passed&&i.error?(s+=`>
|
|
6
|
-
`,s+=` <failure message="${a(i.error)}">${a(i.error)}</failure>
|
|
7
|
-
`,s+=` </testcase>
|
|
8
|
-
`):s+=` />
|
|
9
|
-
`}else{for(let i=0;i<e.passed;i++)s+=` <testcase classname="aqe" name="test-${i+1}" time="0" />
|
|
10
|
-
`;for(let i=0;i<e.failed;i++)s+=` <testcase classname="aqe" name="failed-test-${i+1}" time="0">
|
|
11
|
-
`,s+=` <failure message="Test failed">Test failed</failure>
|
|
12
|
-
`,s+=` </testcase>
|
|
13
|
-
`;for(let i=0;i<e.skipped;i++)s+=` <testcase classname="aqe" name="skipped-test-${i+1}" time="0">
|
|
14
|
-
`,s+=` <skipped />
|
|
15
|
-
`,s+=` </testcase>
|
|
16
|
-
`}return s+=` </testsuite>
|
|
17
|
-
`,s+=`</testsuites>
|
|
18
|
-
`,s}function O(e){let t=`# Coverage Report
|
|
19
|
-
|
|
20
|
-
`;if(t+=`| Metric | Value | Status |
|
|
21
|
-
`,t+=`|--------|-------|--------|
|
|
22
|
-
`,t+=`| Lines | ${e.summary.line}% | ${e.summary.line>=e.threshold?"\u2705":"\u274C"} |
|
|
23
|
-
`,t+=`| Branches | ${e.summary.branch}% | ${e.summary.branch>=e.threshold?"\u2705":"\u274C"} |
|
|
24
|
-
`,t+=`| Functions | ${e.summary.function}% | ${e.summary.function>=e.threshold?"\u2705":"\u274C"} |
|
|
25
|
-
`,t+=`| Statements | ${e.summary.statement}% | ${e.summary.statement>=e.threshold?"\u2705":"\u274C"} |
|
|
26
|
-
`,t+=`
|
|
27
|
-
**Threshold:** ${e.threshold}% \u2014 ${e.meetsThreshold?"\u2705 Met":"\u274C Not met"}
|
|
28
|
-
`,e.gaps&&e.gaps.length>0){t+=`
|
|
29
|
-
## Coverage Gaps
|
|
30
|
-
|
|
31
|
-
`,t+=`| File | Uncovered Lines | Risk | Severity |
|
|
32
|
-
`,t+=`|------|----------------|------|----------|
|
|
33
|
-
`;for(let n of e.gaps.slice(0,20))t+=`| ${n.file} | ${n.lines.length} | ${(n.riskScore*100).toFixed(0)}% | ${n.severity} |
|
|
34
|
-
`}if(e.recommendations&&e.recommendations.length>0){t+=`
|
|
35
|
-
## Recommendations
|
|
36
|
-
|
|
37
|
-
`;for(let n of e.recommendations)t+=`- ${n}
|
|
38
|
-
`}return t}function F(e){let t=`# Quality Gate Report
|
|
39
|
-
|
|
40
|
-
`;t+=`**Result:** ${e.passed?"\u2705 PASSED":"\u274C FAILED"}
|
|
41
|
-
`,t+=`**Score:** ${e.score}
|
|
42
|
-
|
|
43
|
-
`,t+=`## Checks
|
|
44
|
-
|
|
45
|
-
`,t+=`| Check | Value | Threshold | Status |
|
|
46
|
-
`,t+=`|-------|-------|-----------|--------|
|
|
47
|
-
`;for(let n of e.checks)t+=`| ${n.name} | ${n.value} | ${n.threshold} | ${n.passed?"\u2705":"\u274C"} |
|
|
48
|
-
`;if(e.recommendations&&e.recommendations.length>0){t+=`
|
|
49
|
-
## Recommendations
|
|
50
|
-
|
|
51
|
-
`;for(let n of e.recommendations)t+=`- ${n}
|
|
52
|
-
`}return t}function A(e){let t=`# Security Scan Report
|
|
53
|
-
|
|
54
|
-
`;if(t+=`**Target:** ${e.target}
|
|
55
|
-
`,t+=`**Scan Type:** ${e.scanType}
|
|
56
|
-
`,t+=`**Vulnerabilities Found:** ${e.vulnerabilities.length}
|
|
57
|
-
|
|
58
|
-
`,e.vulnerabilities.length>0){t+=`## Vulnerabilities
|
|
59
|
-
|
|
60
|
-
`,t+=`| Severity | Type | File | Line | Message |
|
|
61
|
-
`,t+=`|----------|------|------|------|---------|
|
|
62
|
-
`;for(let n of e.vulnerabilities)t+=`| ${n.severity} | ${n.type} | ${n.file} | ${n.line} | ${n.message} |
|
|
63
|
-
`}if(e.compliance&&(t+=`
|
|
64
|
-
## Compliance
|
|
65
|
-
|
|
66
|
-
`,t+=`**Status:** ${e.compliance.compliant?"\u2705 Compliant":"\u274C Non-compliant"}
|
|
67
|
-
`,e.compliance.issues))for(let n of e.compliance.issues)t+=`- **${n.framework}:** ${n.issue}
|
|
68
|
-
`;return t}function L(e){let t=e.passed+e.failed+e.skipped,n=`# Test Run Report
|
|
69
|
-
|
|
70
|
-
`;return n+=`**Run ID:** ${e.runId}
|
|
71
|
-
`,n+=`**Duration:** ${e.duration}ms
|
|
72
|
-
|
|
73
|
-
`,n+=`| Metric | Count |
|
|
74
|
-
`,n+=`|--------|-------|
|
|
75
|
-
`,n+=`| Total | ${t} |
|
|
76
|
-
`,n+=`| Passed | ${e.passed} |
|
|
77
|
-
`,n+=`| Failed | ${e.failed} |
|
|
78
|
-
`,n+=`| Skipped | ${e.skipped} |
|
|
79
|
-
`,n+=`
|
|
80
|
-
**Result:** ${e.failed===0?"\u2705 All tests passed":"\u274C Some tests failed"}
|
|
81
|
-
`,n}export{T as a,x as b,C as c,R as d,w as e,I as f,O as g,F as h,A as i,L as j};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-WBMRADQP.js";import"./chunk-6VKJAMZY.js";export{a as FORMAT_OPTION,b as OUTPUT_OPTION,g as coverageToMarkdown,h as qualityGateToMarkdown,i as securityToMarkdown,j as testRunToMarkdown,d as toJSON,f as toJUnit,e as toSARIF,c as writeOutput};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.2");process.exit(0)}
|
|
2
|
-
import{c as a,d as b,e as c}from"./chunk-7FWP7CZY.js";import"./chunk-67A6PEZM.js";import"./chunk-D4RCV4LY.js";import"./chunk-6VKJAMZY.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};
|