agentic-qe 3.9.13 → 3.9.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/accessibility-testing/SKILL.md +18 -0
- package/.claude/skills/enterprise-integration-testing/SKILL.md +1 -1
- package/.claude/skills/pentest-validation/SKILL.md +1 -1
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +46 -63
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +16 -4
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +51 -0
- package/assets/skills/accessibility-testing/SKILL.md +18 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +46 -63
- package/assets/skills/qe-browser/scripts/smoke-test.sh +16 -4
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-P2EPBJLF.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-3RBPTJAU.js → agent-booster-wasm-NA2VN5U2.js} +2 -2
- package/dist/cli/chunks/{agent-handler-XV45GCWC.js → agent-handler-NRIF5IOC.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-V6EXWWMY.js → agent-memory-branch-NW3UB2UW.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-6UITO3NJ.js +2 -0
- package/dist/cli/chunks/{audit-WXFI4AC4.js → audit-5CSEDVJR.js} +2 -2
- package/dist/cli/chunks/base-JHBJXVGP.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-23MIVVHF.js → better-sqlite3-FZ32SHZ6.js} +2 -2
- package/dist/cli/chunks/{brain-handler-LQUMAACV.js → brain-handler-ISVST4MR.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-HE37VX7G.js → branch-enumerator-IUHWHIMV.js} +2 -2
- package/dist/cli/chunks/{browser-3VG5M7WM.js → browser-D4F3327X.js} +2 -2
- package/dist/cli/chunks/browser-workflow-U4OON5DZ.js +2 -0
- package/dist/cli/chunks/{chunk-ZS5BM2EE.js → chunk-2BBKAX7X.js} +2 -2
- package/dist/cli/chunks/{chunk-6GYMFSPA.js → chunk-2CN2NPJQ.js} +2 -2
- package/dist/cli/chunks/{chunk-OGHIQCJU.js → chunk-2L5ZFBHP.js} +2 -2
- package/dist/cli/chunks/{chunk-VCJP7HQG.js → chunk-2XW36KDQ.js} +2 -2
- package/dist/cli/chunks/{chunk-AOTEEGQA.js → chunk-37ZSWRRP.js} +2 -2
- package/dist/cli/chunks/chunk-3BA2FGSA.js +2 -0
- package/dist/cli/chunks/{chunk-54A2LVKM.js → chunk-3FUKJT4S.js} +2 -2
- package/dist/cli/chunks/chunk-3NIHJIWP.js +2 -0
- package/dist/cli/chunks/{chunk-LHZLH6I4.js → chunk-3RSPEFU3.js} +2 -2
- package/dist/cli/chunks/{chunk-I6O4MVEY.js → chunk-3Y4YZDHJ.js} +4 -4
- package/dist/cli/chunks/{chunk-AEKTVLLF.js → chunk-4M7RBSW6.js} +2 -2
- package/dist/cli/chunks/{chunk-LRHJOYKY.js → chunk-4T36OQUK.js} +3 -3
- package/dist/cli/chunks/{chunk-XV42SKJD.js → chunk-56YHSI6R.js} +2 -2
- package/dist/cli/chunks/{chunk-OBDM6OJL.js → chunk-62MVVEGH.js} +1 -1
- package/dist/cli/chunks/chunk-65QA7MYW.js +2 -0
- package/dist/cli/chunks/{chunk-RYPUA6E2.js → chunk-6AMD4PZB.js} +2 -2
- package/dist/cli/chunks/{chunk-OUNZPHTA.js → chunk-6BHAGCZD.js} +1 -1
- package/dist/cli/chunks/{chunk-YBKSENTJ.js → chunk-6F3H2C5H.js} +5 -5
- package/dist/cli/chunks/{chunk-OM7A3YC3.js → chunk-6OEGZSRK.js} +2 -2
- package/dist/cli/chunks/{chunk-Q3MQYATA.js → chunk-6TOUMCSE.js} +2 -2
- package/dist/cli/chunks/chunk-6Z7LYE2B.js +2 -0
- package/dist/cli/chunks/{chunk-TRJRRJV3.js → chunk-7J5KWUC2.js} +1 -1
- package/dist/cli/chunks/{chunk-VWEGO7BY.js → chunk-7ZPNQ3T6.js} +1 -1
- package/dist/cli/chunks/{chunk-6LDRSG7C.js → chunk-AE65B2ZE.js} +3 -3
- package/dist/cli/chunks/{chunk-D22MEX2U.js → chunk-AVKUFN3C.js} +2 -2
- package/dist/cli/chunks/{chunk-4VETZICF.js → chunk-B4BOOOYM.js} +1 -1
- package/dist/cli/chunks/{chunk-Y7YSJD4I.js → chunk-BGUCXJEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-JV7HKHQS.js → chunk-C5BRTU4V.js} +2 -2
- package/dist/cli/chunks/{chunk-FEGITTAE.js → chunk-CF3W34BA.js} +1 -1
- package/dist/cli/chunks/chunk-CSB2M7IX.js +2 -0
- package/dist/cli/chunks/{chunk-ERGY45RL.js → chunk-CUQBOVRP.js} +1 -1
- package/dist/cli/chunks/{chunk-W6LEOFA4.js → chunk-CWWUBZNX.js} +2 -2
- package/dist/cli/chunks/{chunk-GKRKCJ6D.js → chunk-D32YCVCA.js} +2 -2
- package/dist/cli/chunks/{chunk-E7P6GAD7.js → chunk-D3FV5NNA.js} +2 -2
- package/dist/cli/chunks/{chunk-YYQVSVBO.js → chunk-D3ZUSXFY.js} +2 -2
- package/dist/cli/chunks/{chunk-6HSHLSGU.js → chunk-DATFN5DG.js} +2 -2
- package/dist/cli/chunks/{chunk-UCCNB75R.js → chunk-DPEG44BS.js} +2 -2
- package/dist/cli/chunks/chunk-DYQ7HTEU.js +12 -0
- package/dist/cli/chunks/{chunk-SL66MHDM.js → chunk-E3EDVRB5.js} +1 -1
- package/dist/cli/chunks/chunk-ELLNKP3I.js +24 -0
- package/dist/cli/chunks/{chunk-3RM2VNYG.js → chunk-EORSYD66.js} +2 -2
- package/dist/cli/chunks/{chunk-OHG6SNIA.js → chunk-ESQSX37W.js} +2 -2
- package/dist/cli/chunks/{chunk-H53V7GI3.js → chunk-EY2DGYQX.js} +1 -1
- package/dist/cli/chunks/chunk-FEVTMHO6.js +2 -0
- package/dist/cli/chunks/{chunk-Q7TWE55T.js → chunk-FSOY2XB4.js} +4 -4
- package/dist/cli/chunks/{chunk-QIE76ERL.js → chunk-FW6QBTPE.js} +1 -1
- package/dist/cli/chunks/{chunk-5TDHUYYF.js → chunk-G3FUOFXA.js} +2 -2
- package/dist/cli/chunks/{chunk-BUIMIUJA.js → chunk-GHEO5YVA.js} +1 -1
- package/dist/cli/chunks/chunk-GLJ6CJNY.js +5 -0
- package/dist/cli/chunks/{chunk-V6UODTBP.js → chunk-GWUO3RY5.js} +1 -1
- package/dist/cli/chunks/{chunk-3IJ4NRJF.js → chunk-H6DAP4KS.js} +2 -2
- package/dist/cli/chunks/chunk-HJNFBJT5.js +3021 -0
- package/dist/cli/chunks/{chunk-KULWZMVC.js → chunk-HNAQNAGI.js} +4 -4
- package/dist/cli/chunks/{chunk-VU7ENCSU.js → chunk-HPY7HGVQ.js} +2 -2
- package/dist/cli/chunks/{chunk-4PCHU2X7.js → chunk-HWK27KJK.js} +1 -1
- package/dist/cli/chunks/chunk-ICXWXO5P.js +2 -0
- package/dist/cli/chunks/{chunk-OKCI6BNZ.js → chunk-IHDW4HW7.js} +2 -2
- package/dist/cli/chunks/chunk-II5KTTIS.js +65 -0
- package/dist/cli/chunks/{chunk-OP54A7C6.js → chunk-IMLH32AG.js} +2 -2
- package/dist/cli/chunks/{chunk-TNQBHQFH.js → chunk-IPTGPCEL.js} +2 -2
- package/dist/cli/chunks/{chunk-V2CV6J2A.js → chunk-IPVKVPAF.js} +2 -2
- package/dist/cli/chunks/{chunk-AV23XNRL.js → chunk-ISNXE6TP.js} +2 -2
- package/dist/cli/chunks/{chunk-CF5EJGOV.js → chunk-JAIIPEE6.js} +2 -2
- package/dist/cli/chunks/{chunk-3AOWTHLS.js → chunk-JJDHD7SC.js} +2 -2
- package/dist/cli/chunks/{chunk-HXLAXSEM.js → chunk-JQRR37YY.js} +2 -2
- package/dist/cli/chunks/chunk-KJTXY3DW.js +3 -0
- package/dist/cli/chunks/{chunk-XXQYSDLV.js → chunk-KKBSX43Q.js} +2 -2
- package/dist/cli/chunks/{chunk-EBQUXPIG.js → chunk-LLVS3UYZ.js} +2 -2
- package/dist/cli/chunks/{chunk-VJN7NQGI.js → chunk-LNUWNRRJ.js} +10 -10
- package/dist/cli/chunks/{chunk-IQGVQBVS.js → chunk-MBDX4OHD.js} +1 -1
- package/dist/cli/chunks/{chunk-ZXJNX5D2.js → chunk-MHL6CPGY.js} +1 -1
- package/dist/cli/chunks/{chunk-YCQ2GHFH.js → chunk-MO4Q5ZGE.js} +2 -2
- package/dist/cli/chunks/{chunk-AZPDX4KS.js → chunk-MS6T4VCU.js} +2 -2
- package/dist/cli/chunks/chunk-N2RPLPVG.js +18 -0
- package/dist/cli/chunks/chunk-NL2PQLRD.js +2 -0
- package/dist/cli/chunks/{chunk-GHAEDZDE.js → chunk-NWMYV7KG.js} +2 -2
- package/dist/cli/chunks/{chunk-ZUW3KVML.js → chunk-O6CHLZYT.js} +2 -2
- package/dist/cli/chunks/{chunk-EC2CI3ZC.js → chunk-O6J7MKRV.js} +2 -2
- package/dist/cli/chunks/{chunk-SSZMISGC.js → chunk-OBZMQFWG.js} +3 -3
- package/dist/cli/chunks/{chunk-TU3JIH3U.js → chunk-OHESV6I3.js} +4 -4
- package/dist/cli/chunks/{chunk-X3UVXJIK.js → chunk-OMTYOIOS.js} +2 -2
- package/dist/cli/chunks/{chunk-TPTKR5ZO.js → chunk-ORKGVVXK.js} +1 -1
- package/dist/cli/chunks/{chunk-QHCOAG7D.js → chunk-OUP2X3LT.js} +1 -1
- package/dist/cli/chunks/{chunk-DY5JRJXV.js → chunk-PSOIVDD2.js} +3 -3
- package/dist/cli/chunks/{chunk-UDIRBCZW.js → chunk-Q3E6Z2RQ.js} +1 -1
- package/dist/cli/chunks/{chunk-RMNZSGTE.js → chunk-Q3GDSFGA.js} +2 -2
- package/dist/cli/chunks/{chunk-FLML5IT7.js → chunk-QNLZKD7E.js} +2 -2
- package/dist/cli/chunks/{chunk-WVWB7K6H.js → chunk-R4G64UH3.js} +2 -2
- package/dist/cli/chunks/{chunk-ES6CEZG2.js → chunk-REUGPZIA.js} +1 -1
- package/dist/cli/chunks/{chunk-FS4TPAAA.js → chunk-RODJK6G6.js} +1 -1
- package/dist/cli/chunks/{chunk-4MZZMWF6.js → chunk-RPOW5LWO.js} +1 -1
- package/dist/cli/chunks/{chunk-BE2DYHUB.js → chunk-RSOOENGE.js} +2 -2
- package/dist/cli/chunks/{chunk-RURYOWWU.js → chunk-RTVD7SZQ.js} +1 -1
- package/dist/cli/chunks/{chunk-Z6F4GRXY.js → chunk-RWVFOXYM.js} +2 -2
- package/dist/cli/chunks/{chunk-2RTGP76Y.js → chunk-SSQ42GI7.js} +2 -2
- package/dist/cli/chunks/{chunk-AXDGBI4Y.js → chunk-SXUX6PTE.js} +1 -1
- package/dist/cli/chunks/{chunk-MXT7YUOZ.js → chunk-TJDAXI6E.js} +2 -2
- package/dist/cli/chunks/{chunk-ZN7KPIJW.js → chunk-TZWCVGG2.js} +1 -1
- package/dist/cli/chunks/{chunk-TWRGM5TY.js → chunk-U4WDJPRL.js} +2 -2
- package/dist/cli/chunks/chunk-UZOFXYNC.js +2 -0
- package/dist/cli/chunks/{chunk-TOS3PI5Q.js → chunk-V65DK6ZZ.js} +1 -1
- package/dist/cli/chunks/{chunk-7HX2PMBB.js → chunk-V6QARSVQ.js} +2 -2
- package/dist/cli/chunks/{chunk-VHSDZEYF.js → chunk-V775NJOM.js} +1 -1
- package/dist/cli/chunks/{chunk-QNUVC6OX.js → chunk-VBEVZUQW.js} +1 -1
- package/dist/cli/chunks/{chunk-OJGR56BP.js → chunk-VDDQSW4L.js} +2 -2
- package/dist/cli/chunks/{chunk-DHYJMGKC.js → chunk-W4PUKTBF.js} +1 -1
- package/dist/cli/chunks/{chunk-CPRYUCPC.js → chunk-WAQ3U4FC.js} +1 -1
- package/dist/cli/chunks/{chunk-HJHFGPGP.js → chunk-WCOJGDGO.js} +2 -2
- package/dist/cli/chunks/{chunk-77GZ7LXL.js → chunk-WI6UA5HV.js} +2 -2
- package/dist/cli/chunks/{chunk-HHRUXDLT.js → chunk-XALB3KRR.js} +2 -2
- package/dist/cli/chunks/{chunk-W2YCNX4O.js → chunk-XXRDI53H.js} +2 -2
- package/dist/cli/chunks/{chunk-JOCR5TWI.js → chunk-YCYFUYCE.js} +2 -2
- package/dist/cli/chunks/{chunk-WQIB5ERQ.js → chunk-ZHTCZGML.js} +2 -2
- package/dist/cli/chunks/{chunk-WQGP5ULD.js → chunk-ZOAPOVYW.js} +2 -2
- package/dist/cli/chunks/{chunk-VVVIRGO7.js → chunk-ZSC7NHK3.js} +2 -2
- package/dist/cli/chunks/{ci-FEEIAOQN.js → ci-BGUUHDUS.js} +2 -2
- package/dist/cli/chunks/{ci-output-2WMUTORB.js → ci-output-CDFRGBNU.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-MFEE23XA.js → circuit-breaker-S3NFX6RQ.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-6D655INK.js → claude-flow-setup-AJIPJFMC.js} +2 -2
- package/dist/cli/chunks/client-UHHMKUPF.js +2 -0
- package/dist/cli/chunks/{cline-installer-5PIYMPAG.js → cline-installer-6O4KZ5UH.js} +2 -2
- package/dist/cli/chunks/{code-ACS453WG.js → code-IZALXUL5.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-5SERI6TM.js → code-index-extractor-N7VDH4XF.js} +2 -2
- package/dist/cli/chunks/{codex-installer-WCUUWHP5.js → codex-installer-35GTWCFJ.js} +2 -2
- package/dist/cli/chunks/{completions-6WFG3FPJ.js → completions-XPJFHGG2.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-IFZEFCB6.js → complexity-analyzer-DNLCJGUJ.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-RW6FEEND.js → continuedev-installer-PXAIKNYO.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-UZPE65RL.js → copilot-installer-2TQ5IZNY.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-2R4FT6TY.js → cost-tracker-A5XH4W6S.js} +2 -2
- package/dist/cli/chunks/{coverage-ZUC5U47P.js → coverage-EPIMXTLW.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-GEBXTPZW.js +2 -0
- package/dist/cli/chunks/{cursor-installer-7JBZT7JZ.js → cursor-installer-WMMRPW44.js} +2 -2
- package/dist/cli/chunks/daemon-55DSODOH.js +19 -0
- package/dist/cli/chunks/{dag-attention-scheduler-MS7D2NFM.js → dag-attention-scheduler-5DSWXMMK.js} +2 -2
- package/dist/cli/chunks/{detect-UHOSHYVB.js → detect-NOS46AWN.js} +2 -2
- package/dist/cli/chunks/{domain-handler-BVW4AX7O.js → domain-handler-BFRNU6S3.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-PA2ENF3D.js → domain-transfer-BPSA4HFR.js} +2 -2
- package/dist/cli/chunks/dream-XBRGYPBC.js +2 -0
- package/dist/cli/chunks/esm-node-EV4HOHTZ.js +2 -0
- package/dist/cli/chunks/eval-YDLM23FB.js +15 -0
- package/dist/cli/chunks/{fast-paths-DYQ5NC4Y.js → fast-paths-GISZ7HBO.js} +2 -2
- package/dist/cli/chunks/{feature-flags-V34UZPHG.js → feature-flags-3FLJF6CQ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YMMGYWT3.js → feature-flags-5WGZLUPQ.js} +2 -2
- package/dist/cli/chunks/{file-discovery-75ZHSK4G.js → file-discovery-PPHUMFSI.js} +2 -2
- package/dist/cli/chunks/{fleet-DD2CFGJL.js → fleet-LHFZ53FS.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-UXM3L5LV.js → gnn-wrapper-Z45DRWGI.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-ANHRYXNS.js → heartbeat-handler-VMLJ5PDH.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-GUWYDHEY.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-BG73YVXI.js +2 -0
- package/dist/cli/chunks/hnsw-index-K73ZTLJN.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-IFUEUOVF.js → hnsw-legacy-bridge-S7UZWDUP.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-GYVDPTWU.js → hnswlib-node-MIAAS7OI.js} +2 -2
- package/dist/cli/chunks/{hooks-R3DQNG2F.js → hooks-ZN4FV5XS.js} +6 -6
- package/dist/cli/chunks/{hybrid-router-MSCQ2XGU.js → hybrid-router-Y6LBFPL7.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-3TKB5O7T.js → hypergraph-engine-KK73LZYZ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-4APYID2S.js → hypergraph-handler-OBGDPIWG.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-GWIUYYCQ.js +2 -0
- package/dist/cli/chunks/{init-handler-E7B2GKH3.js → init-handler-JJJ7VHM4.js} +6 -6
- package/dist/cli/chunks/init-wizard-RIJJAKE3.js +2 -0
- package/dist/cli/chunks/kernel-SIPBCRGL.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-WY6VTFSA.js → kilocode-installer-EF6DPX2D.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-SCNF3JXD.js → kiro-installer-SG74CEVO.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-NOYZXHIG.js +2 -0
- package/dist/cli/chunks/learning-LVWYMHF6.js +107 -0
- package/dist/cli/chunks/{llm-router-RBKYYHBJ.js → llm-router-QFK7MNPY.js} +4 -4
- package/dist/cli/chunks/{load-FY64UGHV.js → load-6XPV4WA2.js} +2 -2
- package/dist/cli/chunks/load-test-DIMUH75F.js +2 -0
- package/dist/cli/chunks/{mcp-6VMQOWMX.js → mcp-GZXOPYMH.js} +2 -2
- package/dist/cli/chunks/{memory-Y5RO4PGM.js → memory-QTE2Z5HU.js} +5 -5
- package/dist/cli/chunks/memory-backend-IWOGO4BV.js +2 -0
- package/dist/cli/chunks/{memory-handlers-CMMVHHPG.js → memory-handlers-PC4P4YEF.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-JO3MNMPZ.js → multi-model-executor-FZOPSUOT.js} +3 -3
- package/dist/cli/chunks/{opencode-installer-WQBTY6JT.js → opencode-installer-CITDTCUQ.js} +2 -2
- package/dist/cli/chunks/{orchestrator-4J7OSNSG.js → orchestrator-ZTG7MFHQ.js} +20 -20
- package/dist/cli/chunks/{pipeline-63T6HN72.js → pipeline-QXO4EJP4.js} +2 -2
- package/dist/cli/chunks/{platform-UJMD4EPZ.js → platform-JJEDYCAK.js} +2 -2
- package/dist/cli/chunks/{plugin-NDOZ63JW.js → plugin-ZEKRM6F7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-ELGHVIFI.js → prime-radiant-advanced-wasm-GRS4T6LR.js} +2 -2
- package/dist/cli/chunks/protocol-executor-NT4TILJW.js +2 -0
- package/dist/cli/chunks/{protocol-handler-KYERIMVF.js → protocol-handler-KWI2T6OR.js} +2 -2
- package/dist/cli/chunks/{prove-ATSSBP4Z.js → prove-7FJN2HEH.js} +2 -2
- package/dist/cli/chunks/{provider-manager-YYMIF23V.js → provider-manager-QYYZZLLO.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-VDROHXFS.js +2 -0
- package/dist/cli/chunks/{quality-2AGJSJW6.js → quality-4NHO2NY5.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-7LO73IV3.js +2 -0
- package/dist/cli/chunks/{real-embeddings-H36GVXMI.js → real-embeddings-SIELAOWX.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-PMRBAY7O.js → roocode-installer-ANYXH3NR.js} +2 -2
- package/dist/cli/chunks/router-SFVOLN2W.js +2 -0
- package/dist/cli/chunks/routing-feedback-MRFV7WUZ.js +2 -0
- package/dist/cli/chunks/{routing-handler-Z7VZSDXW.js → routing-handler-6QQHK4KV.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-N3FZ3ZEE.js → ruvector-commands-YEUA3MZB.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-L5DQHUF3.js → rvf-dual-writer-UJFRHPVE.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-NPGFA3SL.js → rvf-migration-adapter-CSDFG7UA.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-MCJDNKXG.js → rvf-migration-coordinator-QO7OENQF.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-6L7FZZC7.js +2 -0
- package/dist/cli/chunks/safe-db-PYWBVGOV.js +2 -0
- package/dist/cli/chunks/schedule-BUQU75HY.js +2 -0
- package/dist/cli/chunks/scheduler-XOSKWZO2.js +2 -0
- package/dist/cli/chunks/{security-TX7TXUGI.js → security-QCIUC5FX.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-OZ7S4ZQL.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-6K3ZAG7P.js → shared-rvf-dual-writer-LVJJS3PD.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-7UXQZ5Y6.js +2 -0
- package/dist/cli/chunks/{status-handler-MIRLQRNN.js → status-handler-O77A4JWM.js} +2 -2
- package/dist/cli/chunks/{structural-health-CIHASLUE.js → structural-health-WIIBIIQI.js} +2 -2
- package/dist/cli/chunks/{sync-FGLAP7EK.js → sync-UN6D6OF2.js} +2 -2
- package/dist/cli/chunks/{task-handler-7HMPRCHY.js → task-handler-RBOSMJCK.js} +2 -2
- package/dist/cli/chunks/{task-handlers-DQLQCLCT.js → task-handlers-VWMXQKAT.js} +2 -2
- package/dist/cli/chunks/{test-JKDO5ZHU.js → test-XK5M3PGT.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-2YKZ7PVZ.js → test-scheduling-CTQ3JJ7G.js} +4 -4
- package/dist/cli/chunks/{token-bootstrap-C7UUPMQN.js → token-bootstrap-D5CQ3I5M.js} +2 -2
- package/dist/cli/chunks/{token-usage-2RVIPCY4.js → token-usage-L4QSLWQ5.js} +2 -2
- package/dist/cli/chunks/{transformers-UEMAGHQ5.js → transformers-SRPJDBKA.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-MELABICK.js → tree-sitter-wasm-parser-DOU5ITWB.js} +2 -2
- package/dist/cli/chunks/{types-5B4RD7ZV.js → types-LECYZUBN.js} +2 -2
- package/dist/cli/chunks/unified-memory-L6735TFM.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-7TZNEDGY.js +2 -0
- package/dist/cli/chunks/unified-persistence-FNYZ3C2B.js +2 -0
- package/dist/cli/chunks/{validate-CHDG7SC3.js → validate-SIKNIS6B.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-LB7GORKE.js → validate-swarm-EHAMMILJ.js} +2 -2
- package/dist/cli/chunks/{vibium-ZMC4G2YA.js → vibium-LJ4NYXMZ.js} +2 -2
- package/dist/cli/chunks/visual-security-SMPZPDY4.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-THNO6S2V.js → web-tree-sitter-DZQ3T4JD.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-LRB43BPX.js → windsurf-installer-U6Z73O6J.js} +2 -2
- package/dist/cli/chunks/witness-chain-FNCOTWFA.js +2 -0
- package/dist/cli/chunks/{witness-chain-JC5UBXPM.js → witness-chain-JE3QU4YP.js} +2 -2
- package/dist/cli/chunks/{workflow-Q4IYQ6F2.js → workflow-62QXGZQO.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RCR4N7OA.js +2 -0
- package/dist/cli/chunks/{wrappers-WSSLMFSE.js → wrappers-CAX5EZSH.js} +2 -2
- package/dist/cli/commands/eval.js +86 -0
- package/dist/cli/commands/learning.js +28 -8
- package/dist/domains/chaos-resilience/services/chaos-engineer.js +1 -1
- package/dist/domains/constants.d.ts +1 -1
- package/dist/domains/constants.js +1 -1
- package/dist/domains/contract-testing/services/contract-validator.js +1 -1
- package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
- package/dist/domains/test-execution/services/test-executor.js +1 -1
- package/dist/domains/test-generation/services/test-data-generator.d.ts +1 -0
- package/dist/domains/test-generation/services/test-data-generator.js +17 -3
- package/dist/domains/visual-accessibility/services/visual-tester.js +1 -1
- package/dist/init/browser-engine-installer.d.ts +60 -1
- package/dist/init/browser-engine-installer.js +73 -3
- package/dist/init/phases/09-assets.js +9 -2
- package/dist/mcp/bundle.js +1782 -1790
- package/dist/mcp/protocol-server.js +20 -10
- package/dist/validation/command-eval-runner.d.ts +154 -0
- package/dist/validation/command-eval-runner.js +293 -0
- package/dist/validation/index.d.ts +2 -0
- package/dist/validation/index.js +4 -0
- package/package.json +7 -5
- package/dist/cli/chunks/adapter-VP3WBXE5.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-ASPPEOKQ.js +0 -2
- package/dist/cli/chunks/base-SIAOYPTD.js +0 -2
- package/dist/cli/chunks/browser-workflow-BG3M3RZU.js +0 -2
- package/dist/cli/chunks/chunk-3I6KWFJT.js +0 -2
- package/dist/cli/chunks/chunk-4WJ3BHCN.js +0 -24
- package/dist/cli/chunks/chunk-67TMNSO3.js +0 -3
- package/dist/cli/chunks/chunk-APQYMAKG.js +0 -65
- package/dist/cli/chunks/chunk-BSTCXDVH.js +0 -2
- package/dist/cli/chunks/chunk-F74IVEON.js +0 -2
- package/dist/cli/chunks/chunk-FHWDVN65.js +0 -18
- package/dist/cli/chunks/chunk-HEHGQM2H.js +0 -3029
- package/dist/cli/chunks/chunk-HRD7LL7Q.js +0 -2
- package/dist/cli/chunks/chunk-QKTB5FZP.js +0 -2
- package/dist/cli/chunks/chunk-R4B2B6MZ.js +0 -5
- package/dist/cli/chunks/chunk-SI7AQK7I.js +0 -2
- package/dist/cli/chunks/chunk-TVASP2E6.js +0 -2
- package/dist/cli/chunks/chunk-VLZBQ3XN.js +0 -2
- package/dist/cli/chunks/chunk-Y2ONHWXI.js +0 -2
- package/dist/cli/chunks/chunk-YCTGWMCP.js +0 -12
- package/dist/cli/chunks/client-LMOHUGOA.js +0 -2
- package/dist/cli/chunks/cross-domain-router-IZB5ZMXO.js +0 -2
- package/dist/cli/chunks/daemon-YNF54UYB.js +0 -19
- package/dist/cli/chunks/dream-SAPSS25B.js +0 -2
- package/dist/cli/chunks/esm-node-FTBUMV4L.js +0 -2
- package/dist/cli/chunks/eval-Y3ODM7JU.js +0 -15
- package/dist/cli/chunks/heartbeat-scheduler-HYVMXCXT.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-CBDRZLXX.js +0 -2
- package/dist/cli/chunks/hnsw-index-EOJG4VF4.js +0 -2
- package/dist/cli/chunks/impact-analyzer-C2TXXYPC.js +0 -2
- package/dist/cli/chunks/init-wizard-IQV7SBMW.js +0 -2
- package/dist/cli/chunks/kernel-NJOPFGK7.js +0 -2
- package/dist/cli/chunks/knowledge-graph-EUMGCQPH.js +0 -2
- package/dist/cli/chunks/learning-Y4OZJFBV.js +0 -107
- package/dist/cli/chunks/load-test-LBYVVG35.js +0 -2
- package/dist/cli/chunks/memory-backend-NQMJKHCQ.js +0 -2
- package/dist/cli/chunks/protocol-executor-ZSWPG5SU.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-4RLPRCGF.js +0 -2
- package/dist/cli/chunks/queen-coordinator-KQ673NYE.js +0 -2
- package/dist/cli/chunks/router-UBNV4H5S.js +0 -2
- package/dist/cli/chunks/routing-feedback-BMMGZ346.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LXBCTTVF.js +0 -2
- package/dist/cli/chunks/safe-db-FFSPBUAK.js +0 -2
- package/dist/cli/chunks/schedule-2MOMNZ6B.js +0 -2
- package/dist/cli/chunks/scheduler-5VGVANFG.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-6JWYF7WV.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-LCOAORK7.js +0 -2
- package/dist/cli/chunks/unified-memory-CZCWZUFP.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-QEOXVSOZ.js +0 -2
- package/dist/cli/chunks/unified-persistence-HGZAYZGP.js +0 -2
- package/dist/cli/chunks/visual-security-ITKF4E4Z.js +0 -2
- package/dist/cli/chunks/witness-chain-SYFYXQD3.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-GZS2O3KW.js +0 -2
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as m}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a as m}from"./chunk-FW6QBTPE.js";import{a as g,c as f}from"./chunk-JJDHD7SC.js";import"./chunk-CUQBOVRP.js";import o from"chalk";f();var p=class{name="init";description="Initialize the AQE v3 system";cleanupAndExit;originalStdoutWrite=null;constructor(e){this.cleanupAndExit=e}register(e,t){e.command("init").description(this.description).option("-d, --domains <domains>","Comma-separated list of domains to enable","all").option("-m, --max-agents <number>","Maximum concurrent agents","15").option("--memory <backend>","Memory backend (sqlite|agentdb|hybrid)","hybrid").option("--lazy","Enable lazy loading of domains").option("--wizard","Run interactive setup wizard").option("--auto","Auto-configure based on project analysis").option("-u, --upgrade","Upgrade existing installation (overwrite skills, agents, validation)").option("--minimal","Minimal configuration (skip optional features)").option("--skip-patterns","Skip loading pre-trained patterns").option("--skip-code-index","Skip code intelligence pre-scan (supported escape hatch \u2014 KG can be built later via `aqe code index`, also via env AQE_SKIP_CODE_INDEX=1)").option("--json","Emit machine-readable JSON result on stdout (suppresses banners; phase progress goes to stderr). Used by the release-gate corpus and CI tooling. See InitJsonOutput in init-handler.ts for the schema.").option("--with-n8n","Install n8n workflow testing agents and skills").option("--with-opencode","Include OpenCode agent/skill provisioning").option("--with-kiro","Include AWS Kiro IDE integration (agents, skills, hooks, steering)").option("--with-copilot","Include GitHub Copilot MCP config and instructions").option("--with-cursor","Include Cursor MCP config and rules").option("--with-cline","Include Cline MCP config and custom QE mode").option("--with-kilocode","Include Kilo Code MCP config and custom QE mode").option("--with-roocode","Include Roo Code MCP config and custom QE mode").option("--with-codex","Include OpenAI Codex CLI MCP config and AGENTS.md").option("--with-windsurf","Include Windsurf MCP config and rules").option("--with-continuedev","Include Continue.dev MCP config and rules").option("--no-mcp","Skip MCP server config (MCP is enabled by default)").option("--with-mcp","Enable MCP server config (default \u2014 kept for backward compatibility)").option("--with-all-platforms","Include all coding agent platform configurations").option("--auto-migrate","Automatically migrate from v2 if detected").option("--with-claude-flow","Force Claude Flow integration setup").option("--skip-claude-flow","Skip Claude Flow integration").option("--no-governance","Skip governance configuration (ADR-058)").option("--modular","Use new modular init system (default for --auto)").action(async r=>{await this.execute(r,t)})}async execute(e,t){if(e.json===!0){this.originalStdoutWrite=process.stdout.write.bind(process.stdout);let r=process.stderr.write.bind(process.stderr);process.stdout.write=((...s)=>r(...s))}try{if(e.withAllPlatforms&&(e.withCopilot=!0,e.withCursor=!0,e.withCline=!0,e.withKilocode=!0,e.withRoocode=!0,e.withCodex=!0,e.withWindsurf=!0,e.withContinuedev=!0),e.upgrade&&!e.auto&&!e.wizard&&(e.auto=!0),e.wizard||e.auto){if(console.log(o.blue(`
|
|
3
3
|
Agentic QE v3 Initialization
|
|
4
4
|
`)),e.auto||e.modular){await this.runModularInit(e,t);return}await this.runLegacyWizard(e,t);return}await this.runStandardInit(e,t)}catch(r){console.error(o.red(`
|
|
5
|
-
Failed to initialize:`),r),await this.cleanupAndExit(1)}}async runModularInit(e,t){let r=e.json===!0,{createModularInitOrchestrator:s}=await import("./orchestrator-
|
|
5
|
+
Failed to initialize:`),r),await this.cleanupAndExit(1)}}async runModularInit(e,t){let r=e.json===!0,{createModularInitOrchestrator:s}=await import("./orchestrator-ZTG7MFHQ.js"),l=s({projectRoot:process.cwd(),autoMode:e.auto,upgrade:e.upgrade,minimal:e.minimal,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,withN8n:e.withN8n,withOpenCode:e.withOpencode,withKiro:e.withKiro,withCopilot:e.withCopilot,withCursor:e.withCursor,withCline:e.withCline,withKiloCode:e.withKilocode,withRooCode:e.withRoocode,withCodex:e.withCodex,withWindsurf:e.withWindsurf,withContinueDev:e.withContinuedev,noMcp:e.noMcp&&!e.withMcp,noGovernance:e.noGovernance});console.log(o.white(` Analyzing project...
|
|
6
6
|
`));let n=await l.initialize();if(r){this.originalStdoutWrite&&(process.stdout.write=this.originalStdoutWrite);let i={schemaVersion:1,success:n.success,steps:n.steps.map(c=>({step:c.step,status:c.status,message:c.message,durationMs:c.durationMs})),summary:n.summary,totalDurationMs:n.totalDurationMs,timestamp:n.timestamp.toISOString()};process.stdout.write(JSON.stringify(i,null,2)+`
|
|
7
|
-
`);let d=n.steps.some(c=>c.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let i of n.steps){let d=i.status==="success"?"*":i.status==="error"?"x":"!",c=i.status==="success"?o.green:i.status==="error"?o.red:o.yellow;console.log(c(` ${d} ${i.step} (${i.durationMs}ms)`))}console.log("");let a;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:i}=await import("./claude-flow-setup-
|
|
7
|
+
`);let d=n.steps.some(c=>c.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let i of n.steps){let d=i.status==="success"?"*":i.status==="error"?"x":"!",c=i.status==="success"?o.green:i.status==="error"?o.red:o.yellow;console.log(c(` ${d} ${i.step} (${i.durationMs}ms)`))}console.log("");let a;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:i}=await import("./claude-flow-setup-AJIPJFMC.js");if(a=await i({projectRoot:process.cwd(),force:e.withClaudeFlow}),a.available)console.log(o.green(" * Claude Flow integration enabled")),a.features.trajectories&&console.log(o.gray(" - SONA trajectory tracking")),a.features.modelRouting&&console.log(o.gray(" - 3-tier model routing (haiku/sonnet/opus)")),a.features.pretrain&&console.log(o.gray(" - Codebase pretrain analysis")),console.log("");else{let{getClaudeFlowNotFoundMessage:d}=await import("./detect-NOS46AWN.js");console.log(o.gray(d())),console.log("")}}catch{let{getClaudeFlowNotFoundMessage:i}=await import("./detect-NOS46AWN.js");console.log(o.gray(i())),console.log("")}n.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
8
8
|
`)),console.log(o.blue(" Summary:")),console.log(o.gray(` - Patterns loaded: ${n.summary.patternsLoaded}`)),console.log(o.gray(` - Skills installed: ${n.summary.skillsInstalled}`)),console.log(o.gray(` - Agents installed: ${n.summary.agentsInstalled}`)),console.log(o.gray(` - Hooks configured: ${n.summary.hooksConfigured?"Yes":"No"}`)),console.log(o.gray(` - Workers started: ${n.summary.workersStarted}`)),console.log(o.gray(` - Claude Flow: ${a?.available?"Enabled":"Standalone mode"}`)),console.log(o.gray(` - Total time: ${n.totalDurationMs}ms
|
|
9
9
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),n.summary.mcpConfigured&&(console.log(o.gray(`
|
|
10
10
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
11
11
|
`)))):(console.log(o.red(` Initialization failed. Check errors above.
|
|
12
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:r}=await import("./init-wizard-
|
|
12
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:r}=await import("./init-wizard-RIJJAKE3.js"),s={projectRoot:process.cwd(),autoMode:e.auto,minimal:e.minimal,skipPatterns:e.skipPatterns,withN8n:e.withN8n},l=new r(s);if(e.wizard){console.log(o.white(` Setup Wizard Steps:
|
|
13
13
|
`));let a=l.getWizardSteps();for(let i=0;i<a.length;i++)console.log(o.gray(` ${i+1}. ${a[i].title}`)),console.log(o.gray(` ${a[i].description}
|
|
14
14
|
`))}console.log(o.white(` Analyzing project...
|
|
15
15
|
`));let n=await l.initialize();for(let a of n.steps){let i=a.status==="success"?"*":a.status==="error"?"x":"!",d=a.status==="success"?o.green:a.status==="error"?o.red:o.yellow;console.log(d(` ${i} ${a.step} (${a.durationMs}ms)`))}console.log(""),n.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
@@ -17,7 +17,7 @@ import{a as m}from"./chunk-QIE76ERL.js";import{a as g,c as f}from"./chunk-3AOWTH
|
|
|
17
17
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),n.summary.mcpConfigured&&(console.log(o.gray(`
|
|
18
18
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
19
19
|
`)))):(console.log(o.red(` Initialization failed. Check errors above.
|
|
20
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:r}=await import("./kernel-
|
|
20
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:r}=await import("./kernel-SIPBCRGL.js"),{CrossDomainEventRouter:s}=await import("./cross-domain-router-GEBXTPZW.js"),{DefaultProtocolExecutor:l}=await import("./protocol-executor-NT4TILJW.js"),{WorkflowOrchestrator:n}=await import("./workflow-orchestrator-RCR4N7OA.js"),{createQueenCoordinator:a}=await import("./queen-coordinator-7LO73IV3.js");console.log(o.blue(`
|
|
21
21
|
Initializing Agentic QE v3...
|
|
22
22
|
`));let i=e.domains==="all"?[...m]:e.domains.split(",").filter(u=>m.includes(u));console.log(o.gray(` Domains: ${i.length}`)),console.log(o.gray(` Max Agents: ${e.maxAgents}`)),console.log(o.gray(` Memory: ${e.memory}`)),console.log(o.gray(` Lazy Loading: ${e.lazy?"enabled":"disabled"}
|
|
23
23
|
`)),t.kernel=new r({maxConcurrentAgents:parseInt(e.maxAgents,10),memoryBackend:e.memory,hnswEnabled:!0,lazyLoading:e.lazy||!1,enabledDomains:i}),await t.kernel.initialize(),console.log(o.green(" * Kernel initialized")),t.router=new s(t.kernel.eventBus),await t.router.initialize(),console.log(o.green(" * Cross-domain router initialized"));let d=u=>t.kernel.getDomainAPI(u),c=new l(t.kernel.eventBus,t.kernel.memory,d);console.log(o.green(" * Protocol executor initialized")),t.workflowOrchestrator=new n(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),this.registerDomainWorkflowActions(t.kernel,t.workflowOrchestrator),console.log(o.green(" * Workflow orchestrator initialized")),t.queen=a(t.kernel,t.router,c,void 0),await t.queen.initialize(),console.log(o.green(" * Queen Coordinator initialized")),t.initialized=!0,console.log(o.green(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-OHESV6I3.js";import"./chunk-37ZSWRRP.js";import"./chunk-CF3W34BA.js";import"./chunk-WAQ3U4FC.js";import"./chunk-GWUO3RY5.js";import"./chunk-2XW36KDQ.js";import"./chunk-JJDHD7SC.js";import"./chunk-JAIIPEE6.js";import"./chunk-6OEGZSRK.js";import"./chunk-CUQBOVRP.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{v as a,w as b}from"./chunk-HJNFBJT5.js";import"./chunk-GHEO5YVA.js";import"./chunk-6BHAGCZD.js";import"./chunk-HNAQNAGI.js";import"./chunk-OUP2X3LT.js";import"./chunk-O6CHLZYT.js";import"./chunk-AE65B2ZE.js";import"./chunk-ORKGVVXK.js";import"./chunk-ZOAPOVYW.js";import"./chunk-JQRR37YY.js";import"./chunk-RODJK6G6.js";import"./chunk-ISNXE6TP.js";import"./chunk-ICXWXO5P.js";import"./chunk-DYQ7HTEU.js";import"./chunk-3Y4YZDHJ.js";import"./chunk-TJDAXI6E.js";import"./chunk-ELLNKP3I.js";import"./chunk-GLJ6CJNY.js";import"./chunk-FSOY2XB4.js";import"./chunk-II5KTTIS.js";import"./chunk-7J5KWUC2.js";import"./chunk-62MVVEGH.js";import"./chunk-V65DK6ZZ.js";import"./chunk-ZSC7NHK3.js";import"./chunk-DPEG44BS.js";import"./chunk-SSQ42GI7.js";import"./chunk-QNLZKD7E.js";import"./chunk-MO4Q5ZGE.js";import"./chunk-IHDW4HW7.js";import"./chunk-56YHSI6R.js";import"./chunk-6TOUMCSE.js";import"./chunk-CSB2M7IX.js";import"./chunk-6AMD4PZB.js";import"./chunk-UZOFXYNC.js";import"./chunk-PSOIVDD2.js";import"./chunk-G3FUOFXA.js";import"./chunk-3BA2FGSA.js";import"./chunk-V6QARSVQ.js";import"./chunk-U4WDJPRL.js";import"./chunk-CWWUBZNX.js";import"./chunk-LLVS3UYZ.js";import"./chunk-KKBSX43Q.js";import"./chunk-ZHTCZGML.js";import"./chunk-FEVTMHO6.js";import"./chunk-XALB3KRR.js";import"./chunk-O6J7MKRV.js";import"./chunk-2XW36KDQ.js";import"./chunk-FW6QBTPE.js";import"./chunk-JJDHD7SC.js";import"./chunk-MBDX4OHD.js";import"./chunk-BGUCXJEJ.js";import"./chunk-JAIIPEE6.js";import"./chunk-6OEGZSRK.js";import"./chunk-WI6UA5HV.js";import"./chunk-D3ZUSXFY.js";import"./chunk-2BBKAX7X.js";import"./chunk-MS6T4VCU.js";import"./chunk-IPVKVPAF.js";import"./chunk-YCYFUYCE.js";import"./chunk-XXRDI53H.js";import"./chunk-CUQBOVRP.js";export{a as QEKernelImpl,b as createKernel};
|
|
@@ -1,4 +1,4 @@
|
|
|
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.9.
|
|
2
|
-
import{b as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{b as p}from"./chunk-RPOW5LWO.js";import{a as f,c as v}from"./chunk-JJDHD7SC.js";import"./chunk-CUQBOVRP.js";v();import{existsSync as n,mkdirSync as m,readFileSync as u,writeFileSync as a}from"fs";import{join as d,dirname as h}from"path";var l=class{projectRoot;overwrite;generator;constructor(r){this.projectRoot=r.projectRoot,this.overwrite=r.overwrite??!1,this.generator=p()}async install(){let r={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("kilocode"),e=d(this.projectRoot,t.path);if(r.configPath=e,!n(e)||this.overwrite){let s=h(e);if(n(s)||m(s,{recursive:!0}),n(e)&&this.overwrite){let c=this.mergeExistingConfig(e,t.content);a(e,c)}else a(e,t.content);r.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("kilocode"),o=d(this.projectRoot,i.path);if(r.modePath=o,!n(o)||this.overwrite){let s=h(o);if(n(s)||m(s,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,i.content);a(o,c)}else a(o,i.content);r.modeInstalled=!0}}catch(t){r.success=!1,r.errors.push(`Kilo Code installation failed: ${f(t)}`)}return r}mergeExistingConfig(r,t){try{let e=JSON.parse(u(r,"utf-8")),i=JSON.parse(t);return e.mcpServers||(e.mcpServers={}),Object.assign(e.mcpServers,i.mcpServers),JSON.stringify(e,null,2)+`
|
|
3
3
|
`}catch{return t}}mergeExistingModes(r,t){try{let e=JSON.parse(u(r,"utf-8")),i=JSON.parse(t);if(!Array.isArray(e))return t;let o=e.filter(s=>s.slug!=="qe-engineer");return o.push(...i),JSON.stringify(o,null,2)+`
|
|
4
4
|
`}catch{return t}}};function x(g){return new l(g)}export{l as KiloCodeInstaller,x as createKiloCodeInstaller};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as b}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a as b}from"./chunk-WAQ3U4FC.js";import{a as k,c as $}from"./chunk-JJDHD7SC.js";import"./chunk-CUQBOVRP.js";$();import{existsSync as u,mkdirSync as y,readdirSync as S,readFileSync as q,writeFileSync as v}from"fs";import{join as o,dirname as E}from"path";import{fileURLToPath as P}from"url";var R=P(import.meta.url),M=E(R),A=class{projectRoot;options;openCodeDir;constructor(t){this.projectRoot=t.projectRoot,this.options={installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:!1,...t},this.openCodeDir=this.findOpenCodeDir()}findOpenCodeDir(){let t=[o(M,"../../.opencode"),o(M,"../../assets/opencode")],e=b(import.meta.url);e&&(t.push(o(e,".opencode")),t.push(o(e,"assets/opencode"))),t.push(o(process.cwd(),"node_modules/agentic-qe/assets/opencode"),o(process.cwd(),"node_modules/agentic-qe/.opencode"));for(let n of t)if(u(n)&&(u(o(n,"agents"))||u(o(n,"skills"))))return n;let s=o(process.cwd(),".opencode");return u(s)&&(u(o(s,"agents"))||u(o(s,"skills")))?s:t[0]}async install(){let t=o(this.projectRoot,".kiro"),e={success:!0,agentsInstalled:[],skillsInstalled:[],hooksInstalled:[],steeringInstalled:[],mcpConfigured:!1,errors:[],targetDir:t};try{if(e.mcpConfigured=this.installMcpConfig(t),this.options.installAgents){let s=this.installAgents(t);e.agentsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSkills){let s=this.installSkills(t);e.skillsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installHooks){let s=this.installHooks(t);e.hooksInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSteering){let s=this.installSteering(t);e.steeringInstalled=s.installed,e.errors.push(...s.errors)}}catch(s){e.success=!1,e.errors.push(`Kiro installation failed: ${k(s)}`)}return e}installMcpConfig(t){let e=o(t,"settings"),s=o(e,"mcp.json");return u(s)&&!this.options.overwrite?!1:(y(e,{recursive:!0}),v(s,JSON.stringify({mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"],env:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"},disabled:!1,autoApprove:["fleet_init","fleet_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","memory_store","memory_query"]}}},null,2)+`
|
|
3
3
|
`),!0)}installAgents(t){let e=[],s=[],n=o(this.openCodeDir,"agents"),l=o(t,"agents");if(!u(n))return y(l,{recursive:!0}),this.writeDefaultQEAgent(l),e.push("qe-specialist"),{installed:e,errors:s};y(l,{recursive:!0});let i=S(n).filter(r=>r.endsWith(".yaml"));for(let r of i){let c=r.replace(".yaml",""),a=o(l,`${c}.json`);if(!(u(a)&&!this.options.overwrite))try{let p=q(o(n,r),"utf-8"),m=this.parseYamlAgent(p),d=this.convertToKiroAgent(m);v(a,JSON.stringify(d,null,2)+`
|
|
4
4
|
`),e.push(c)}catch(p){s.push(`Failed to convert agent ${r}: ${k(p)}`)}}let g=o(this.options.projectRoot,".claude","agents");if(u(g)){let r=["subagents","n8n","testing","analysis"];for(let c of r){let a=o(g,c);if(!u(a))continue;let p=S(a,{recursive:!1}).filter(m=>typeof m=="string"&&m.endsWith(".md")&&m!=="README.md");for(let m of p){let d=m.replace(".md",""),h=o(l,`${d}.json`);if(!(u(h)&&!this.options.overwrite))try{let f=q(o(a,m),"utf-8"),w=this.convertMdAgentToKiro(f,d);w&&(v(h,JSON.stringify(w,null,2)+`
|
|
5
5
|
`),e.push(d))}catch(f){s.push(`Failed to convert subagent ${m}: ${k(f)}`)}}}}return{installed:e,errors:s}}convertMdAgentToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return null;let n=s[1],l=s[2].trim(),i=d=>{let h=new RegExp(`^${d}:\\s*"?([^"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{g as a}from"./chunk-PSOIVDD2.js";import"./chunk-FEVTMHO6.js";import"./chunk-XALB3KRR.js";import"./chunk-2XW36KDQ.js";import"./chunk-FW6QBTPE.js";import"./chunk-JJDHD7SC.js";import"./chunk-CUQBOVRP.js";export{a as KnowledgeGraphService};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
3
|
+
import{a as ee}from"./chunk-ESQSX37W.js";import{b as Z}from"./chunk-TJDAXI6E.js";import{g as X}from"./chunk-FSOY2XB4.js";import"./chunk-II5KTTIS.js";import"./chunk-7J5KWUC2.js";import"./chunk-62MVVEGH.js";import{i as q}from"./chunk-V65DK6ZZ.js";import"./chunk-ZSC7NHK3.js";import"./chunk-QNLZKD7E.js";import{a as Y}from"./chunk-MO4Q5ZGE.js";import"./chunk-6AMD4PZB.js";import"./chunk-V6QARSVQ.js";import"./chunk-U4WDJPRL.js";import{f as T,o as K}from"./chunk-LLVS3UYZ.js";import"./chunk-KKBSX43Q.js";import"./chunk-FEVTMHO6.js";import"./chunk-XALB3KRR.js";import{b as z,d as de}from"./chunk-2XW36KDQ.js";import"./chunk-FW6QBTPE.js";import"./chunk-JJDHD7SC.js";import"./chunk-MBDX4OHD.js";import{a as C,b as J}from"./chunk-JAIIPEE6.js";import"./chunk-6OEGZSRK.js";import"./chunk-WI6UA5HV.js";import"./chunk-D3ZUSXFY.js";import"./chunk-2BBKAX7X.js";import"./chunk-MS6T4VCU.js";import"./chunk-IPVKVPAF.js";import"./chunk-YCYFUYCE.js";import"./chunk-XXRDI53H.js";import"./chunk-CUQBOVRP.js";K();de();import{Command as fe}from"commander";import o from"chalk";import S from"node:path";import{existsSync as w,writeFileSync as ce,readFileSync as W,mkdirSync as le,copyFileSync as B,renameSync as ie}from"node:fs";import{stat as M,unlink as E}from"node:fs/promises";J();K();import x from"chalk";import U from"node:path";import{createReadStream as te,createWriteStream as ne}from"node:fs";import{createGzip as pe,createGunzip as ge}from"node:zlib";import{pipeline as oe}from"node:stream/promises";J();var A={reasoningBank:null,initialized:!1};async function O(){if(A.initialized&&A.reasoningBank)return A.reasoningBank;let s=T(),t=U.join(s,".agentic-qe"),e=new Y({sqlite:{path:U.join(t,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"qe-patterns"});await e.initialize(),A.reasoningBank=X(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0}),await A.reasoningBank.initialize();try{let{getSharedRvfDualWriter:n}=await import("./shared-rvf-dual-writer-LVJJS3PD.js"),l=await n();l&&A.reasoningBank.setRvfDualWriter(l)}catch(n){process.env.DEBUG&&console.debug("[learning] RVF wiring skipped:",n instanceof Error?n.message:n)}return A.initialized=!0,A.reasoningBank}function v(s){console.log(JSON.stringify(s,null,2))}function P(s){console.log(x.green("\u2713"),s)}function R(s){console.error(x.red("\u2717"),s)}function I(s){console.log(x.blue("\u2139"),s)}function ae(s){let{current:t,topDomains:e}=s,n={tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502",ml:"\u251C",mr:"\u2524"},l=55,i=n.h.repeat(l-2);console.log(""),console.log(`${n.tl}${i}${n.tr}`),console.log(`${n.v}${me("AQE LEARNING DASHBOARD",l-2)}${n.v}`),console.log(`${n.ml}${i}${n.mr}`);let m=t.patternsCreatedToday>0?x.green(` (+${t.patternsCreatedToday} today)`):"";console.log(`${n.v} Patterns: ${D(String(t.totalPatterns)+m,32)}${n.v}`);let p=t.experiencesToday>0?x.green(` (+${t.experiencesToday} today)`):"";console.log(`${n.v} Experiences: ${D(String(t.totalExperiences)+p,32)}${n.v}`),console.log(`${n.v} Q-Values: ${D(String(t.totalQValues),32)}${n.v}`);let d=t.avgReward.toFixed(2),g=t.avgRewardDelta>=0?x.green(`(\u2191 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`):x.red(`(\u2193 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`);console.log(`${n.v} Avg Reward: ${D(`${d} ${g}`,32)}${n.v}`);let r=(t.successRate*100).toFixed(1);if(console.log(`${n.v} Success Rate: ${D(`${r}%`,32)}${n.v}`),console.log(`${n.v} Short-term: ${D(String(t.shortTermPatterns),32)}${n.v}`),console.log(`${n.v} Long-term: ${D(String(t.longTermPatterns),32)}${n.v}`),console.log(`${n.v}${" ".repeat(l-2)}${n.v}`),console.log(`${n.v} ${x.bold("Domain Coverage:")}${" ".repeat(l-19)}${n.v}`),e.length===0)console.log(`${n.v} ${x.dim("No patterns yet")}${" ".repeat(l-19)}${n.v}`);else{let c=Math.max(...e.map(f=>f.count),1),u=14;for(let{domain:f,count:h}of e){let $=Math.round(h/c*u),b=u-$,k=x.green("\u2588".repeat($))+x.dim("\u2591".repeat(b)),F=D(f,20),L=ue(String(h),3);console.log(`${n.v} ${F} ${k} ${L} patterns ${n.v}`)}let a=new Set(e.map(f=>f.domain)),y=q.filter(f=>!a.has(f)).slice(0,3);for(let f of y){let h=x.dim("\u2591".repeat(u)),$=D(f,20);console.log(`${n.v} ${$} ${h} 0 patterns ${n.v}`)}}console.log(`${n.bl}${i}${n.br}`),console.log("")}function me(s,t){let e=G(s),n=Math.max(0,t-e.length),l=Math.floor(n/2),i=n-l;return" ".repeat(l)+s+" ".repeat(i)}function D(s,t){let e=G(s),n=Math.max(0,t-e.length);return s+" ".repeat(n)}function ue(s,t){let e=G(s),n=Math.max(0,t-e.length);return" ".repeat(n)+s}function G(s){return s.replace(/\x1b\[[0-9;]*m/g,"")}function j(){let s=T();return U.join(s,".agentic-qe","memory.db")}async function Q(s,t){let e=t||`${s}.gz`;return await oe(te(s),pe(),ne(e)),e}async function V(s,t){await oe(te(s),ge(),ne(t))}async function _(s){try{let t=C(s,{readonly:!0}),e=t.prepare("PRAGMA integrity_check").get();return t.close(),e.integrity_check==="ok"?{valid:!0,message:"Database integrity verified"}:{valid:!1,message:`Integrity check failed: ${e.integrity_check}`}}catch(t){return{valid:!1,message:`Failed to verify: ${t instanceof Error?t.message:"unknown error"}`}}}async function N(s){try{let t=C(s,{readonly:!0});if(!t.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='schema_version'").get())return t.close(),0;let n=t.prepare("SELECT version FROM schema_version WHERE id = 1").get();return t.close(),n?.version??0}catch{return 0}}var H="3.1.0",re={generate:"test-generation","test-generation":"test-generation",analyze:"coverage-analysis",coverage:"coverage-analysis","coverage-analysis":"coverage-analysis",run:"test-execution","test-execution":"test-execution",report:"quality-assessment",quality:"quality-assessment","quality-analysis":"quality-assessment",security:"security-compliance",sast:"security-compliance",owasp:"security-compliance",secrets:"security-compliance",audit:"security-compliance",recommend:"defect-intelligence",predict:"defect-intelligence","complexity-analysis":"code-intelligence","code-analysis":"code-intelligence",stabilize:"chaos-resilience",flaky:"chaos-resilience",quarantine:"chaos-resilience",retry:"chaos-resilience",stress:"chaos-resilience",load:"chaos-resilience",endurance:"chaos-resilience",baseline:"chaos-resilience"},se={generate:"test-template","test-generation":"test-template",analyze:"coverage-strategy",coverage:"coverage-strategy","coverage-analysis":"coverage-strategy",run:"test-template","test-execution":"test-template",report:"assertion-pattern",quality:"assertion-pattern","quality-analysis":"assertion-pattern",security:"assertion-pattern",sast:"assertion-pattern",owasp:"assertion-pattern",secrets:"assertion-pattern",audit:"assertion-pattern",recommend:"assertion-pattern",predict:"assertion-pattern","complexity-analysis":"assertion-pattern","code-analysis":"assertion-pattern",stabilize:"flaky-fix",flaky:"flaky-fix",quarantine:"flaky-fix",retry:"flaky-fix",stress:"perf-benchmark",load:"perf-benchmark",endurance:"perf-benchmark",baseline:"perf-benchmark",mock:"mock-pattern",dependency:"mock-pattern"};function at(){let s=new fe("learning").description("AQE self-learning system management (standalone, no claude-flow required)").addHelpText("after",`
|
|
4
|
+
Examples:
|
|
5
|
+
# Check learning system status
|
|
6
|
+
aqe learning stats
|
|
7
|
+
|
|
8
|
+
# Consolidate patterns (promote successful patterns to long-term memory)
|
|
9
|
+
aqe learning consolidate
|
|
10
|
+
|
|
11
|
+
# Export learned patterns for sharing
|
|
12
|
+
aqe learning export --output patterns.json
|
|
13
|
+
|
|
14
|
+
# Import patterns from another project
|
|
15
|
+
aqe learning import --input patterns.json
|
|
16
|
+
|
|
17
|
+
# Run background learning consolidation
|
|
18
|
+
aqe learning daemon --interval 3600
|
|
19
|
+
`);return ye(s),he(s),we(s),$e(s),be(s),Se(s),ve(s),Re(s),Ee(s),ke(s),xe(s),De(s),Ce(s),Oe(s),Pe(s),Ae(s),s}function ye(s){s.command("stats").description("Display learning system statistics").option("--json","Output as JSON").option("--detailed","Show detailed breakdown").action(async t=>{try{let n=await(await O()).getStats();if(t.json)v(n);else{console.log(o.bold(`
|
|
20
|
+
\u{1F4CA} AQE Learning System Statistics
|
|
21
|
+
`)),console.log(o.bold("Patterns:")),console.log(` Total: ${o.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(` Avg Confidence: ${(n.patternStoreStats.avgConfidence*100).toFixed(1)}%`),console.log(` Avg Quality: ${(n.patternStoreStats.avgQualityScore*100).toFixed(1)}%`),console.log(o.bold(`
|
|
22
|
+
By Domain:`));let l=Object.entries(n.byDomain).filter(([m,p])=>p>0).sort((m,p)=>p[1]-m[1]);if(l.length===0)console.log(o.dim(" No patterns yet"));else for(let[m,p]of l)console.log(` ${m}: ${p}`);console.log(o.bold(`
|
|
23
|
+
Learning:`)),console.log(` Routing Requests: ${n.routingRequests}`),console.log(` Avg Routing Confidence: ${(n.avgRoutingConfidence*100).toFixed(1)}%`),console.log(` Learning Outcomes: ${n.learningOutcomes}`),console.log(` Pattern Success Rate: ${(n.patternSuccessRate*100).toFixed(1)}%`),console.log(o.bold(`
|
|
24
|
+
Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${n.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${n.patternStoreStats.hnswStats.nativeAvailable?o.green("\u2713"):o.dim("\u25CB")}`),console.log(` Vector Count: ${n.patternStoreStats.hnswStats.vectorCount}`);let i=n.asymmetricLearning;if(i&&(console.log(o.bold(`
|
|
25
|
+
Asymmetric Learning (ADR-061):`)),console.log(` Failure Penalty Ratio: ${i.failurePenaltyRatio||"10:1"}`),console.log(` Quarantined Patterns: ${i.quarantinedPatterns||0}`),console.log(` Rehabilitated: ${i.rehabilitatedPatterns||0}`),console.log(` Avg Confidence Delta: ${((i.avgConfidenceDelta||0)*100).toFixed(1)}%`)),t.detailed){console.log(o.bold(`
|
|
26
|
+
By Pattern Type:`));for(let[m,p]of Object.entries(n.patternStoreStats.byType))p>0&&console.log(` ${m}: ${p}`)}console.log("")}return}catch(e){throw R(`stats failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function he(s){s.command("consolidate").description("Consolidate patterns - promote successful patterns to long-term memory").option("--dry-run","Show what would be promoted without making changes").option("--threshold <n>","Minimum successful uses for promotion","3").option("--success-rate <n>","Minimum success rate for promotion (0-1)","0.7").option("--json","Output as JSON").action(async t=>{try{let e=await O(),n=parseInt(t.threshold,10),l=parseFloat(t.successRate),i=[],m=await e.searchPatterns("*",{limit:1e3});if(m.success)for(let p of m.value){let d=p.pattern;d.tier==="short-term"&&d.successfulUses>=n&&d.successRate>=l&&i.push({id:d.id,name:d.name,domain:d.qeDomain,successfulUses:d.successfulUses,successRate:d.successRate,currentTier:d.tier})}if(t.json)v({dryRun:t.dryRun||!1,eligibleCount:i.length,threshold:n,successRateMin:l,patterns:i});else{if(console.log(o.bold(`
|
|
27
|
+
\u{1F504} Pattern Consolidation
|
|
28
|
+
`)),console.log(` Promotion threshold: ${n} successful uses`),console.log(` Minimum success rate: ${(l*100).toFixed(0)}%`),console.log(` Eligible patterns: ${i.length}
|
|
29
|
+
`),i.length===0)console.log(o.dim(" No patterns eligible for promotion yet."));else{console.log(o.bold(" Patterns to promote:"));for(let p of i)console.log(` ${o.cyan(p.name)}`),console.log(o.dim(` Domain: ${p.domain}, Uses: ${p.successfulUses}, Rate: ${(p.successRate*100).toFixed(0)}%`));t.dryRun?console.log(o.yellow(`
|
|
30
|
+
Dry run - no changes made`)):console.log(o.yellow(`
|
|
31
|
+
Promotion would happen here (not yet implemented)`))}console.log("")}return}catch(e){throw R(`consolidate failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function we(s){s.command("export").description("Export learned patterns for sharing").option("-o, --output <file>","Output file path","aqe-patterns.json").option("-d, --domain <domain>","Filter by domain").option("--long-term-only","Only export long-term patterns").option("--json","Output as JSON (to stdout)").action(async t=>{try{let n=await(await O()).searchPatterns("*",{limit:1e4,domain:t.domain});if(!n.success)throw new Error(n.error.message);let l=n.value.map(m=>m.pattern).filter(m=>!t.longTermOnly||m.tier==="long-term"),i={version:"3.0.0",exportedAt:new Date().toISOString(),source:process.cwd(),patternCount:l.length,patterns:l.map(m=>({id:m.id,name:m.name,description:m.description,patternType:m.patternType,qeDomain:m.qeDomain,tier:m.tier,confidence:m.confidence,successRate:m.successRate,successfulUses:m.successfulUses,qualityScore:m.qualityScore,template:m.template,context:m.context}))};if(t.json)v(i);else{let m=S.resolve(t.output);ce(m,JSON.stringify(i,null,2),"utf-8"),P(`Exported ${l.length} patterns to ${m}`)}return}catch(e){throw R(`export failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function $e(s){s.command("import").description("Import patterns from file").requiredOption("-i, --input <file>","Input file path").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input);if(!w(e))throw new Error(`File not found: ${e}`);let n=W(e,"utf-8"),l=z(n);if(!l.patterns||!Array.isArray(l.patterns))throw new Error("Invalid pattern file format");let i=await O(),m=0,p=0,d=[];if(!t.dryRun)for(let g of l.patterns)try{let r=await i.storePattern({patternType:g.patternType,name:g.name,description:g.description,template:g.template,context:g.context});r.success?m++:(p++,d.push(`${g.name}: ${r.error.message}`))}catch(r){p++,d.push(`${g.name}: ${r instanceof Error?r.message:"unknown"}`)}t.json?v({dryRun:t.dryRun||!1,totalPatterns:l.patterns.length,imported:m,skipped:p,errors:d}):(console.log(o.bold(`
|
|
32
|
+
\u{1F4E5} Pattern Import
|
|
33
|
+
`)),console.log(` Source: ${e}`),console.log(` Total patterns: ${l.patterns.length}`),t.dryRun?(console.log(o.yellow(`
|
|
34
|
+
Dry run - no changes made`)),console.log(` Would import: ${l.patterns.length} patterns`)):(console.log(o.green(`
|
|
35
|
+
Imported: ${m}`)),p>0&&console.log(o.yellow(` Skipped: ${p}`))),console.log(""));return}catch(e){throw R(`import failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function be(s){s.command("reset").description("Reset learning data (patterns and metrics)").option("--confirm","Confirm reset without prompting").option("--patterns-only","Only reset patterns, keep metrics").action(async t=>{try{if(!t.confirm){console.log(o.yellow(`
|
|
36
|
+
\u26A0\uFE0F This will reset your learning data.`)),console.log(o.gray(` Use --confirm to proceed
|
|
37
|
+
`));return}let e=T(),n=S.join(e,".agentic-qe"),l=[S.join(n,"data","patterns"),S.join(n,"data","hnsw")];t.patternsOnly||l.push(S.join(n,"data","learning-config.json")),console.log(o.bold(`
|
|
38
|
+
\u{1F5D1}\uFE0F Resetting Learning Data
|
|
39
|
+
`));for(let i of l)w(i)&&console.log(o.dim(` Removing: ${S.relative(e,i)}`));P(`Learning data reset. Run "aqe init --auto" to reinitialize.
|
|
40
|
+
`);return}catch(e){throw R(`reset failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Se(s){s.command("extract").description("Extract QE patterns from existing learning experiences").option("--min-reward <n>","Minimum reward threshold for pattern extraction","0.7").option("--min-count <n>","Minimum occurrences to form a pattern","3").option("--dry-run","Show what would be extracted without saving").option("--json","Output as JSON").action(async t=>{try{let e=T(),n=S.join(e,".agentic-qe","memory.db");if(!w(n))throw new Error('No memory database found. Run "aqe init --auto" first.');let l=parseFloat(t.minReward),i=parseInt(t.minCount,10);console.log(o.bold(`
|
|
41
|
+
\u{1F52C} Pattern Extraction from Learning Experiences
|
|
42
|
+
`)),console.log(` Min reward threshold: ${l}`),console.log(` Min occurrences: ${i}
|
|
43
|
+
`);let m=C(n,{readonly:!0}),p=m.prepare(`
|
|
44
|
+
SELECT domain as task_type, COUNT(*) as count, AVG(quality) as avg_reward, MAX(quality) as max_reward,
|
|
45
|
+
MIN(quality) as min_reward, GROUP_CONCAT(DISTINCT agent) as actions
|
|
46
|
+
FROM captured_experiences WHERE quality >= ? AND agent != 'cli-hook' GROUP BY domain HAVING COUNT(*) >= ? ORDER BY avg_reward DESC
|
|
47
|
+
`).all(l,i),d=[];try{d=m.prepare(`
|
|
48
|
+
SELECT substr(key, 1, 40) as key_prefix, COUNT(*) as count
|
|
49
|
+
FROM memory_entries WHERE key LIKE 'phase2/learning/%'
|
|
50
|
+
GROUP BY substr(key, 1, 40) HAVING COUNT(*) >= ? ORDER BY COUNT(*) DESC LIMIT 20
|
|
51
|
+
`).all(i)}catch{}m.close();let g=[];for(let r of p){let c=re[r.task_type]||"code-intelligence",u=se[r.task_type]||"test-template",a=r.actions?r.actions.split(",").slice(0,5):[];g.push({name:`${r.task_type}-success-pattern`,domain:c,patternType:u,confidence:Math.min(.95,r.avg_reward/2),sourceCount:r.count,avgReward:r.avg_reward,actions:a})}if(t.json)v({minReward:l,minCount:i,dryRun:t.dryRun||!1,experienceGroups:p.length,memoryPatterns:d.length,extractedPatterns:g});else{if(console.log(o.bold("Learning Experience Groups:")),p.length===0)console.log(o.dim(" No qualifying experience groups found"));else for(let r of p){let c=r.avg_reward>=1?o.green:r.avg_reward>=.5?o.yellow:o.red;console.log(` ${o.cyan(r.task_type)}`),console.log(` Count: ${r.count}, Avg Reward: ${c(r.avg_reward.toFixed(2))}`)}console.log(o.bold(`
|
|
52
|
+
Memory Pattern Sources:`));for(let r of d.slice(0,10))console.log(` ${r.key_prefix}... (${r.count})`);if(console.log(o.bold(`
|
|
53
|
+
Extracted Patterns:`)),g.length===0)console.log(o.dim(" No patterns extracted"));else for(let r of g)console.log(` ${o.green("+")} ${o.cyan(r.name)}`),console.log(o.dim(` Domain: ${r.domain}, Type: ${r.patternType}`)),console.log(o.dim(` Confidence: ${(r.confidence*100).toFixed(0)}%, Sources: ${r.sourceCount}`));if(!t.dryRun&&g.length>0){let r=await O(),c=0,u=[];for(let a of g)try{let y=a.actions.length>0?`// ${a.name}
|
|
54
|
+
// Steps: ${a.actions.join(" -> ")}
|
|
55
|
+
|
|
56
|
+
{{implementation}}`:`// ${a.name}
|
|
57
|
+
// Extracted pattern with ${a.sourceCount} successful uses
|
|
58
|
+
|
|
59
|
+
{{implementation}}`,f=await r.storePattern({patternType:a.patternType,name:a.name,description:`Extracted from ${a.sourceCount} learning experiences with avg reward ${a.avgReward.toFixed(2)}`,template:{type:"code",content:y,variables:[{name:"implementation",type:"code",required:!0,description:"Implementation code for this pattern"}]},context:{tags:[a.domain,a.patternType,`sources:${a.sourceCount}`,`reward:${a.avgReward.toFixed(2)}`]}});f.success?c++:u.push(`${a.name}: ${f.error.message}`)}catch(y){u.push(`${a.name}: ${y instanceof Error?y.message:"unknown"}`)}console.log(o.green(`
|
|
60
|
+
\u2713 Stored ${c} new patterns`)),u.length>0&&u.length<=5&&console.log(o.yellow(` Errors: ${u.slice(0,3).join(", ")}${u.length>3?"...":""}`))}else t.dryRun&&console.log(o.yellow(`
|
|
61
|
+
Dry run - no patterns stored`));console.log("")}return}catch(e){throw R(`extract failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function ve(s){s.command("dashboard").description("Display learning system dashboard with metrics and trends").option("--json","Output as JSON").option("--save-snapshot","Save a daily metrics snapshot").action(async t=>{try{let e=T(),n=Z(e);await n.initialize(),t.saveSnapshot&&(await n.saveSnapshot(),P("Daily snapshot saved"));let l=await n.getDashboardData();n.close(),t.json?v(l):ae(l);return}catch(e){throw R(`dashboard failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Re(s){s.command("info").description("Show learning system configuration and paths").action(async()=>{try{let t=T(),e=S.join(t,".agentic-qe");console.log(o.bold(`
|
|
62
|
+
\u{1F4CB} AQE Learning System Info
|
|
63
|
+
`)),console.log(o.bold("Paths:")),console.log(` Data directory: ${e}`),console.log(` Memory database: ${S.join(e,"memory.db")}`),console.log(` HNSW index: ${S.join(e,"data","hnsw")}`),console.log(` Patterns: ${S.join(e,"data","patterns")}`),console.log(o.bold(`
|
|
64
|
+
Configuration:`)),console.log(` Learning enabled: ${process.env.AQE_LEARNING_ENABLED!=="false"?o.green("yes"):o.red("no")}`),console.log(` V3 mode: ${process.env.AQE_V3_MODE==="true"?o.green("yes"):o.dim("no")}`),console.log(` Promotion threshold: ${process.env.AQE_V3_PATTERN_PROMOTION_THRESHOLD||"3"} uses`),console.log(` Success rate threshold: ${process.env.AQE_V3_SUCCESS_RATE_THRESHOLD||"0.7"}`),console.log(o.bold(`
|
|
65
|
+
Domains:`)),console.log(` ${q.join(", ")}`),console.log(o.bold(`
|
|
66
|
+
Hooks:`)),console.log(" Configure in .claude/settings.json"),console.log(` Events: pre-edit, post-edit, pre-task, post-task, route
|
|
67
|
+
`);return}catch(t){throw R(`info failed: ${t instanceof Error?t.message:"unknown"}`),t}})}function Ee(s){s.command("backup").description("Backup learning database to a file").option("-o, --output <path>","Output file path").option("--compress","Compress backup with gzip").option("--verify","Verify backup integrity after creation").option("--json","Output as JSON").action(async t=>{try{let e=j();if(!w(e))throw new Error(`No learning database found at: ${e}`);let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,19),l=S.join(process.cwd(),"backups",`learning-${n}.db`),i=t.output?S.resolve(t.output):l,m=S.dirname(i);w(m)||le(m,{recursive:!0});let p=await M(e),d=(p.size/1024).toFixed(2);B(e,i);let g=`${e}-wal`;w(g)&&B(g,`${i}-wal`);let r=i;t.compress&&(r=await Q(i),await E(i),w(`${i}-wal`)&&await E(`${i}-wal`));let c=await M(r),u=(c.size/1024).toFixed(2),a;t.verify&&!t.compress&&(a=await _(i));let y=await N(e);if(t.json)v({success:!0,sourcePath:e,backupPath:r,sourceSizeKB:parseFloat(d),backupSizeKB:parseFloat(u),compressed:t.compress||!1,schemaVersion:y,verification:a,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
68
|
+
\u{1F4BE} Learning Database Backup
|
|
69
|
+
`)),console.log(` Source: ${e}`),console.log(` Source size: ${d} KB`),console.log(` Backup: ${r}`),console.log(` Backup size: ${u} KB`),console.log(` Schema version: ${y}`),t.compress){let f=((1-c.size/p.size)*100).toFixed(1);console.log(` Compression: ${f}% reduction`)}a&&console.log(a.valid?o.green(` Verification: ${a.message}`):o.red(` Verification: ${a.message}`)),P(`Backup saved to: ${r}
|
|
70
|
+
`)}return}catch(e){throw R(`backup failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function ke(s){s.command("restore").description("Restore learning database from backup").requiredOption("-i, --input <path>","Backup file path to restore from").option("--verify","Verify backup integrity before restore").option("--force","Overwrite existing database without confirmation").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input),n=j();if(!w(e))throw new Error(`Backup file not found: ${e}`);let l=e.endsWith(".gz"),i=e;if(l){let g=e.replace(".gz",".tmp");await V(e,g),i=g}if(t.verify){let g=await _(i);if(!g.valid)throw l&&w(i)&&await E(i),new Error(`Backup verification failed: ${g.message}`)}if(w(n)&&!t.force)throw l&&w(i)&&await E(i),new Error(`Database already exists at: ${n}. Use --force to overwrite`);let m=S.dirname(n);w(m)||le(m,{recursive:!0}),w(n)&&await E(n),w(`${n}-wal`)&&await E(`${n}-wal`),w(`${n}-shm`)&&await E(`${n}-shm`),B(i,n),l&&w(i)&&await E(i);let p=await M(n),d=await N(n);t.json?v({success:!0,backupPath:e,restoredPath:n,sizeKB:parseFloat((p.size/1024).toFixed(2)),schemaVersion:d,wasCompressed:l,timestamp:new Date().toISOString()}):(console.log(o.bold(`
|
|
71
|
+
\u{1F504} Learning Database Restore
|
|
72
|
+
`)),console.log(` Backup: ${e}`),console.log(` Restored to: ${n}`),console.log(` Size: ${(p.size/1024).toFixed(2)} KB`),console.log(` Schema version: ${d}`),P(`Database restored successfully
|
|
73
|
+
`));return}catch(e){throw R(`restore failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function xe(s){s.command("verify").description("Verify learning database integrity").option("-f, --file <path>","Database file to verify (defaults to current)").option("--json","Output as JSON").action(async t=>{try{let e=t.file?S.resolve(t.file):j();if(!w(e))throw new Error(`Database file not found: ${e}`);let n=await _(e),l=await N(e),i=await M(e),m={};try{let p=C(e,{readonly:!0});for(let d of["qe_patterns","qe_trajectories","captured_experiences","kv_store","vectors"])try{let g=p.prepare(`SELECT COUNT(*) as count FROM ${d}`).get();m[d]=g.count}catch{}p.close()}catch{}if(t.json)v({valid:n.valid,message:n.message,path:e,sizeKB:parseFloat((i.size/1024).toFixed(2)),schemaVersion:l,tableCounts:m,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
74
|
+
\u{1F50D} Database Verification
|
|
75
|
+
`)),console.log(` Path: ${e}`),console.log(` Size: ${(i.size/1024).toFixed(2)} KB`),console.log(` Schema version: ${l}`),console.log(n.valid?o.green(` Status: ${n.message}`):o.red(` Status: ${n.message}`)),Object.keys(m).length>0){console.log(o.bold(`
|
|
76
|
+
Table Counts:`));for(let[p,d]of Object.entries(m))console.log(` ${p}: ${d}`)}console.log("")}if(!n.valid)throw new Error(`Database verification failed: ${n.message}`);return}catch(e){throw R(`verify failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function De(s){s.command("export-full").description("Export all learning data including patterns, trajectories, and experiences").option("-o, --output <file>","Output file path","aqe-learning-export.json").option("--compress","Compress output with gzip").option("--include-trajectories","Include learning trajectories").option("--include-experiences","Include learning experiences").option("--json","Output as JSON (to stdout)").action(async t=>{try{let e=j();if(!w(e))throw new Error('No learning database found. Run "aqe init --auto" first.');let n=await O(),l=await N(e),i=await n.searchPatterns("*",{limit:1e4});if(!i.success)throw new Error(i.error.message);let m=i.value.map(d=>({id:d.pattern.id,name:d.pattern.name,description:d.pattern.description,patternType:d.pattern.patternType,qeDomain:d.pattern.qeDomain,tier:d.pattern.tier,confidence:d.pattern.confidence,successRate:d.pattern.successRate,successfulUses:d.pattern.successfulUses,qualityScore:d.pattern.qualityScore,template:d.pattern.template,context:d.pattern.context,createdAt:d.pattern.createdAt instanceof Date?d.pattern.createdAt.toISOString():d.pattern.createdAt||void 0,lastUsedAt:d.pattern.lastUsedAt instanceof Date?d.pattern.lastUsedAt.toISOString():d.pattern.lastUsedAt||void 0})),p={version:H,exportedAt:new Date().toISOString(),source:process.cwd(),schemaVersion:l,patternCount:m.length,patterns:m};if(t.includeTrajectories)try{let d=C(e,{readonly:!0}),g=d.prepare("SELECT id, task, agent, domain, success, steps_json FROM qe_trajectories ORDER BY started_at DESC LIMIT 1000").all();p.trajectories=g.map(r=>({id:r.id,task:r.task,agent:r.agent,domain:r.domain,success:r.success,stepsJson:r.steps_json})),d.close()}catch{}if(t.includeExperiences)try{let d=C(e,{readonly:!0}),g=d.prepare("SELECT domain as task_type, agent as action, AVG(quality) as avg_reward, COUNT(*) as count FROM captured_experiences WHERE agent != 'cli-hook' GROUP BY domain, agent ORDER BY count DESC LIMIT 500").all();p.experiences=g.map(c=>({taskType:c.task_type,action:c.action,reward:c.avg_reward,count:c.count}));let r=d.prepare("SELECT COUNT(*) as total, AVG(quality) as avg_reward FROM captured_experiences WHERE agent != 'cli-hook'").get();p.metadata={totalExperiences:r.total,avgReward:r.avg_reward},d.close()}catch{}if(t.json)v(p);else{let d=S.resolve(t.output);if(ce(d,JSON.stringify(p,null,2),"utf-8"),t.compress){let g=await Q(d);await E(d),d=g}console.log(o.bold(`
|
|
77
|
+
\u{1F4E4} Learning Data Export
|
|
78
|
+
`)),console.log(` Patterns: ${m.length}`),p.trajectories&&console.log(` Trajectories: ${p.trajectories.length}`),p.experiences&&console.log(` Experience groups: ${p.experiences.length}`),console.log(` Schema version: ${l}`),console.log(` Export format: ${H}`),P(`Exported to: ${d}
|
|
79
|
+
`)}return}catch(e){throw R(`export-full failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Ce(s){s.command("import-merge").description("Import and merge patterns from export file (preserves existing data)").requiredOption("-i, --input <file>","Input file path").option("--skip-duplicates","Skip patterns with matching names (default: update)").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input);if(!w(e))throw new Error(`File not found: ${e}`);let n;if(e.endsWith(".gz")){let f=e.replace(".gz",".tmp.json");await V(e,f),n=W(f,"utf-8"),await E(f)}else n=W(e,"utf-8");let l=z(n);if(!l.patterns||!Array.isArray(l.patterns))throw new Error("Invalid import file format: missing patterns array");let i=await O(),m=await i.searchPatterns("*",{limit:1e4}),p=new Set;if(m.success)for(let f of m.value)p.add(f.pattern.name);let d=0,g=0,r=0,c=[];if(!t.dryRun)for(let f of l.patterns){let h=p.has(f.name);if(h&&t.skipDuplicates){g++;continue}try{let $=await i.storePattern({patternType:f.patternType,name:f.name,description:f.description,template:f.template,context:f.context});$.success?h?r++:d++:(g++,c.push(`${f.name}: ${$.error.message}`))}catch($){g++,c.push(`${f.name}: ${$ instanceof Error?$.message:"unknown"}`)}}let u=0,a=0,y=0;if(t.dryRun)for(let f of l.patterns){let h=p.has(f.name);h&&t.skipDuplicates?a++:h?y++:u++}t.json?v({dryRun:t.dryRun||!1,importVersion:l.version,totalPatterns:l.patterns.length,imported:t.dryRun?u:d,updated:t.dryRun?y:r,skipped:t.dryRun?a:g,errors:c.slice(0,10)}):(console.log(o.bold(`
|
|
80
|
+
\u{1F4E5} Learning Data Import (Merge)
|
|
81
|
+
`)),console.log(` Source: ${e}`),console.log(` Export version: ${l.version||"unknown"}`),console.log(` Total patterns: ${l.patterns.length}`),console.log(` Existing patterns: ${p.size}`),t.dryRun?(console.log(o.yellow(`
|
|
82
|
+
Dry run - no changes made`)),console.log(` Would import: ${u}
|
|
83
|
+
Would update: ${y}
|
|
84
|
+
Would skip: ${a}`)):(console.log(o.green(`
|
|
85
|
+
Imported: ${d}`)),console.log(o.blue(` Updated: ${r}`)),g>0&&console.log(o.yellow(` Skipped: ${g}`)),c.length>0&&console.log(o.red(` Errors: ${c.length}`))),console.log(""));return}catch(e){throw R(`import-merge failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Oe(s){s.command("dream").description("Run dream cycles for pattern discovery via spreading activation").option("--duration <ms>","Duration of dream cycle in milliseconds","30000").option("--quick","Run a quick 5-second dream cycle").option("--full","Run a full 30-second dream cycle").option("--status","Show dream system status").option("--history","Show past dream cycles").option("--insights","Show pending insights from previous cycles").option("--apply <id>","Apply a specific insight by ID").option("--limit <n>","Maximum results for history/insights","20").option("--min-patterns <n>","Minimum patterns required to dream","10").option("--json","Output as JSON").action(async t=>{try{let{createDreamEngine:e}=await import("./dream-XBRGYPBC.js");if(t.status){let r=e();await r.initialize();let c=r.isDreaming(),u=await r.getDreamHistory(100),a=await r.getPendingInsights(100),y=u.reduce((h,$)=>h+$.insightsGenerated,0),f=u[0];if(t.json)v({isDreaming:c,totalCycles:u.length,totalInsights:y,pendingInsights:a.length,lastDreamTime:f?.startTime.toISOString()||null});else{if(console.log(o.bold(`
|
|
86
|
+
\u{1F319} Dream System Status
|
|
87
|
+
`)),console.log(` Currently dreaming: ${c?o.green("Yes"):o.dim("No")}`),console.log(` Total dream cycles: ${u.length}`),console.log(` Total insights generated: ${y}`),console.log(` Pending insights: ${a.length}`),console.log(` Last dream: ${f?f.startTime.toISOString():o.dim("never")}`),u.length>0){console.log(o.bold(`
|
|
88
|
+
Recent cycles:`));for(let h of u.slice(0,3)){let $=h.status==="completed"?o.green(h.status):o.yellow(h.status);console.log(` ${h.id.slice(0,8)} | ${$} | ${h.durationMs||0}ms | ${h.insightsGenerated} insights`)}}console.log("")}await r.close();return}if(t.history){let r=parseInt(t.limit,10),c=e();await c.initialize();let u=await c.getDreamHistory(r);if(t.json)v(u.map(a=>({id:a.id,startTime:a.startTime.toISOString(),endTime:a.endTime?.toISOString(),durationMs:a.durationMs,status:a.status,conceptsProcessed:a.conceptsProcessed,associationsFound:a.associationsFound,insightsGenerated:a.insightsGenerated})));else{if(console.log(o.bold(`
|
|
89
|
+
\u{1F319} Dream Cycle History (${u.length} cycles)
|
|
90
|
+
`)),u.length===0)console.log(o.dim(" No dream cycles found. Run: aqe learning dream"));else for(let a of u){let y=a.status==="completed"?o.green("\u2713"):a.status==="failed"?o.red("\u2717"):o.yellow("\u22EF");console.log(` ${y} ${a.id.slice(0,8)} | ${a.startTime.toISOString()}`),console.log(o.dim(` Duration: ${a.durationMs||0}ms | Concepts: ${a.conceptsProcessed} | Associations: ${a.associationsFound} | Insights: ${a.insightsGenerated}`))}console.log("")}await c.close();return}if(t.insights){let r=parseInt(t.limit,10),c=e();await c.initialize();let u=await c.getPendingInsights(r);if(t.json)v(u.map(a=>({id:a.id,type:a.type,description:a.description,noveltyScore:a.noveltyScore,confidenceScore:a.confidenceScore,actionable:a.actionable,applied:a.applied||!1,suggestedAction:a.suggestedAction,createdAt:a.createdAt?.toISOString()})));else{if(console.log(o.bold(`
|
|
91
|
+
\u{1F4A1} Pending Dream Insights (${u.length})
|
|
92
|
+
`)),u.length===0)console.log(o.dim(" No pending insights. Run a dream cycle first: aqe learning dream"));else for(let a of u){let y=a.noveltyScore>=.7?o.green(`${(a.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(a.noveltyScore*100).toFixed(0)}%`),f=a.confidenceScore>=.7?o.green(`${(a.confidenceScore*100).toFixed(0)}%`):o.yellow(`${(a.confidenceScore*100).toFixed(0)}%`);console.log(` ${o.cyan(a.id.slice(0,8))} [${a.type}] ${a.actionable?"\u26A1":" "}`),console.log(` ${a.description}`),console.log(o.dim(` Novelty: ${y} | Confidence: ${f}`)),a.suggestedAction&&console.log(o.dim(` Action: ${a.suggestedAction}`))}console.log("")}await c.close();return}if(t.apply){let r=t.apply,c=e();await c.initialize();let a=(await c.getPendingInsights(100)).find($=>$.id===r||$.id.startsWith(r));if(!a)throw await c.close(),new Error(`Insight not found: ${r}`);if(!a.actionable)throw await c.close(),new Error(`Insight ${r} is not actionable`);let y=await c.applyInsight(a.id),h=await(await O()).storePattern({patternType:"test-template",name:`Dream Insight: ${a.type}`,description:`${a.description} (confidence: ${a.confidenceScore.toFixed(2)})`,template:{type:"workflow",content:a.suggestedAction||a.description,variables:[]},context:{tags:["dream-generated",a.type,...a.sourceConcepts.slice(0,3)],complexity:"medium"}});if(t.json?v({insightId:a.id,applied:y.success,patternId:h.success?h.value.id:null,error:y.error||(h.success?null:h.error?.message)}):y.success?(P(`Applied insight ${a.id.slice(0,8)}`),h.success&&P(`Created pattern ${h.value.id} in ReasoningBank`)):R(`Failed to apply insight: ${y.error}`),await c.close(),!y.success)throw new Error(`Failed to apply insight: ${y.error}`);return}let n=parseInt(t.duration,10);t.quick&&(n=5e3),t.full&&(n=3e4),n=Math.min(n,6e4);let l=parseInt(t.minPatterns,10);I(`Starting dream cycle (${n}ms, min ${l} patterns)...`);let i=e({maxDurationMs:n,minConceptsRequired:l});await i.initialize();let p=await(await O()).searchPatterns("",{limit:100,minConfidence:.3}),d=0;if(p.success&&p.value.length>0){let r=p.value.map(c=>({id:c.pattern.id,name:c.pattern.name,description:c.pattern.description||`${c.pattern.patternType} pattern`,domain:c.pattern.qeDomain||"learning-optimization",patternType:c.pattern.patternType,confidence:c.pattern.confidence,successRate:c.pattern.successRate||.5}));d=await i.loadPatternsAsConcepts(r),I(`Loaded ${d} patterns from ReasoningBank as concepts`)}else I("No patterns found in ReasoningBank \u2014 dreaming with existing concepts");let g=await i.dream(n);if(t.json)v({cycleId:g.cycle.id,status:g.cycle.status,durationMs:g.cycle.durationMs||0,conceptsProcessed:g.cycle.conceptsProcessed,associationsFound:g.cycle.associationsFound,insightsGenerated:g.cycle.insightsGenerated,activationStats:g.activationStats,patternsCreated:g.patternsCreated,insights:g.insights.map(r=>({id:r.id,type:r.type,description:r.description,noveltyScore:r.noveltyScore,confidenceScore:r.confidenceScore,actionable:r.actionable}))});else{if(console.log(o.bold(`
|
|
93
|
+
\u{1F319} Dream Cycle Complete
|
|
94
|
+
`)),console.log(` Cycle ID: ${g.cycle.id.slice(0,8)}`),console.log(` Status: ${g.cycle.status==="completed"?o.green("completed"):o.yellow(g.cycle.status)}`),console.log(` Duration: ${g.cycle.durationMs||0}ms`),console.log(` Concepts: ${g.cycle.conceptsProcessed}`),console.log(` Associations: ${g.cycle.associationsFound}`),console.log(` Insights: ${g.cycle.insightsGenerated}`),g.activationStats&&(console.log(o.bold(`
|
|
95
|
+
Activation Stats:`)),console.log(` Iterations: ${g.activationStats.totalIterations}`),console.log(` Peak level: ${g.activationStats.peakActivation.toFixed(3)}`),console.log(` Nodes active: ${g.activationStats.nodesActivated}`)),g.insights.length>0){console.log(o.bold(`
|
|
96
|
+
Generated Insights:`));for(let r of g.insights){let c=r.noveltyScore>=.7?o.green(`${(r.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(r.noveltyScore*100).toFixed(0)}%`);console.log(` ${o.cyan(r.id.slice(0,8))} [${r.type}] ${r.actionable?"\u26A1 actionable":""}`),console.log(` ${r.description}`),console.log(o.dim(` Novelty: ${c} | Confidence: ${(r.confidenceScore*100).toFixed(0)}%`))}console.log(o.dim(`
|
|
97
|
+
Apply insights with: aqe learning dream --apply <insight-id>`))}else console.log(o.dim(`
|
|
98
|
+
No insights generated this cycle.`)),console.log(o.dim(" Try loading more patterns or running a longer cycle."));console.log("")}await i.close();return}catch(e){throw R(`dream failed: ${e instanceof Error?e.message:"unknown"}`),e instanceof Error&&e.stack&&console.error(o.dim(e.stack)),e}})}function Pe(s){s.command("repair").description("Repair a corrupted learning database (dump + reimport to rebuild indexes)").option("-f, --file <path>","Database file to repair (defaults to current project)").option("--dry-run","Show what would be done without modifying files").option("--json","Output as JSON").action(async t=>{try{let e=t.file?S.resolve(t.file):j();if(!w(e))throw new Error(`Database file not found: ${e}`);let n=await _(e);if(n.valid){t.json?v({status:"healthy",message:"Database is already healthy, no repair needed",path:e}):P("Database integrity check passed \u2014 no repair needed.");return}I(`Corruption detected: ${n.message}`);let l={};try{let b=C(e,{readonly:!0}),k=b.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let F of k)try{let L=b.prepare(`SELECT COUNT(*) as count FROM "${F.name}"`).get();l[F.name]=L.count}catch{}b.close()}catch{}let i=Object.values(l).reduce((b,k)=>b+k,0);if(I(`Found ${Object.keys(l).length} tables, ~${i} total rows`),t.dryRun){t.json?v({status:"dry-run",corruptionDetected:!0,message:n.message,tables:l,totalRows:i}):(console.log(o.bold(`
|
|
99
|
+
Dry run \u2014 would perform these steps:`)),console.log(" 1. Backup corrupted DB"),console.log(" 2. Dump all data via .dump"),console.log(" 3. Reimport into fresh DB (rebuilds all indexes)"),console.log(" 4. Verify integrity of repaired DB"),console.log(" 5. Verify row counts match"),console.log(" 6. Swap repaired DB into place"),console.log(""));return}let m=`${e}.bak-${Date.now()}`;B(e,m),I(`Backup created: ${m}`);for(let b of["-wal","-shm"]){let k=e+b;w(k)&&await E(k)}let{execFileSync:p}=await import("node:child_process"),{openSync:d,closeSync:g,readFileSync:r}=await import("node:fs"),c=`${e}.repaired`,u=`${e}.dump.sql`;try{let b=d(u,"w");try{p("sqlite3",[e,".dump"],{stdio:["ignore",b,"pipe"],timeout:12e4})}finally{g(b)}p("sqlite3",[c],{input:r(u),stdio:["pipe","pipe","pipe"],timeout:12e4}),p("sqlite3",[c,"PRAGMA journal_mode=WAL;"],{stdio:"pipe"})}catch(b){throw w(c)&&await E(c),w(u)&&await E(u),new Error(`sqlite3 dump/reimport failed: ${b instanceof Error?b.message:"unknown"}. Is sqlite3 installed?`)}let a=await _(c);if(!a.valid)throw w(u)&&await E(u),new Error(`Repaired DB still has integrity issues: ${a.message}. Backup preserved at ${m}`);let y={},f=C(c,{readonly:!0}),h=f.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let b of h)try{let k=f.prepare(`SELECT COUNT(*) as count FROM "${b.name}"`).get();y[b.name]=k.count}catch{}f.close();let $=Object.values(y).reduce((b,k)=>b+k,0);ie(e,`${e}.pre-repair`),ie(c,e),w(u)&&await E(u),t.json?v({status:"repaired",backupPath:m,rowsBefore:i,rowsAfter:$,tablesRepaired:Object.keys(y).length,rowCounts:y}):(P("Database repaired successfully!"),console.log(` Backup: ${m}`),console.log(` Rows before: ${i}`),console.log(` Rows after: ${$}`),$<i&&console.log(o.yellow(` Warning: ${i-$} rows may have been lost due to data page corruption`)),console.log(` Tables: ${Object.keys(y).length}`),console.log(` Integrity: ${o.green("OK")}`),console.log(""));return}catch(e){throw R(`repair failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Te(s){switch(s){case"sublinear":return{arrow:"\u25B2",label:"Sublinear (learning)",color:o.green};case"linear":return{arrow:"\u2192",label:"Linear (stagnating)",color:o.yellow};case"superlinear":return{arrow:"\u25BC",label:"Superlinear (degrading)",color:o.red};default:return{arrow:"?",label:"Insufficient data",color:o.dim}}}function Ae(s){s.command("health").description("Display per-domain learning health based on regret tracking").option("--json","Output as JSON").option("--domain <domain>","Filter to a specific domain").action(async t=>{try{let e=T(),n=S.join(e,".agentic-qe","memory.db");if(!w(n))throw new Error('Database not found. Run "aqe init --auto" first.');let l=ee(),i=C(n,{readonly:!0});if(i.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='captured_experiences'").get()){let c=t.domain?"AND domain = ?":"",u=[];t.domain&&u.push(t.domain);let a=i.prepare(`
|
|
100
|
+
SELECT domain, quality, success, started_at
|
|
101
|
+
FROM captured_experiences
|
|
102
|
+
WHERE agent != 'cli-hook'
|
|
103
|
+
AND domain IS NOT NULL
|
|
104
|
+
AND domain != ''
|
|
105
|
+
${c}
|
|
106
|
+
ORDER BY started_at ASC
|
|
107
|
+
`).all(...u);for(let y of a){let f=y.quality??(y.success?1:0);l.recordDecision(y.domain,f,1)}}i.close();let p=l.getHealthSummary();if(t.json){v(p);return}if(console.log(""),console.log(o.bold("Learning Health Dashboard:")),p.length===0){console.log(o.dim(" No domain data available. Run some QE tasks to generate learning data.")),console.log("");return}let d=Math.max(...p.map(c=>c.domain.length),20);for(let c of p){let{arrow:u,label:a,color:y}=Te(c.growthRate),f=D(c.domain+":",d+1),h=y(`${u} ${D(a,26)}`),$=`regret: ${c.cumulativeRegret.toFixed(1)}`,b=`decisions: ${c.totalDecisions}`;console.log(` ${f} ${h} ${$} ${b}`)}let g=p.filter(c=>c.stagnating);g.length>0&&(console.log(""),console.log(o.yellow(` Warning: ${g.length} domain(s) showing stagnation: ${g.map(c=>c.domain).join(", ")}`)));let r=p.filter(c=>c.growthRate==="sublinear");r.length>0&&console.log(o.green(` ${r.length} domain(s) actively learning`)),console.log("");return}catch(e){throw R(`health check failed: ${e instanceof Error?e.message:"unknown"}`),e}})}export{at as createLearningCommand,O as initializeLearningSystem};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as P,b as w,c as M}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a as P,b as w,c as M}from"./chunk-MHL6CPGY.js";import{b as k,d as E}from"./chunk-D3ZUSXFY.js";import"./chunk-CUQBOVRP.js";E();import{Command as A}from"commander";import n from"chalk";var c={...w};function B(){let o=new A("llm").description("LLM Router management (ADR-043)").addHelpText("after",`
|
|
3
3
|
Examples:
|
|
4
4
|
$ aqe llm providers List available providers
|
|
5
5
|
$ aqe llm models --provider claude List Claude models
|
|
@@ -30,7 +30,7 @@ Cost Estimate
|
|
|
30
30
|
`)),console.log(n.gray(`Model: ${s.canonicalName} (${s.canonicalId})`)),console.log(n.gray(`Tokens: ${t.toLocaleString()}
|
|
31
31
|
`)),console.log(n.bold("Pricing (per 1M tokens):")),console.log(` Input: ${$(s.inputCostPer1M)}`),console.log(` Output: ${$(s.outputCostPer1M)}`),console.log(n.bold(`
|
|
32
32
|
Estimated Cost:`)),console.log(` Input: ${n.yellow("$"+r.toFixed(6))}`),console.log(` Output: ${n.yellow("$"+i.toFixed(6))}`),console.log(` Total: ${n.green("$"+d.toFixed(6))}`),console.log("")}function l(o,e){return o.padEnd(e)}function _(o,e){return o.length<=e?o:o.slice(0,e-1)+"..."}function $(o){return o==null?"-":o===0?"$0 (free)":`$${o.toFixed(2)}`}function j(o){return{claude:"claude-sonnet-4-6",openai:"gpt-4o",ollama:"llama3.1",openrouter:"anthropic/claude-sonnet-4",gemini:"gemini-2.0-pro","azure-openai":"gpt-4o",bedrock:"anthropic.claude-sonnet-4-v1:0",onnx:"phi-4"}[o]||""}function x(o){let e=t=>!!process.env[t];switch(o){case"claude":return e("ANTHROPIC_API_KEY")?"available":"configured";case"openai":return e("OPENAI_API_KEY")?"available":"configured";case"ollama":return"configured";case"openrouter":return e("OPENROUTER_API_KEY")?"available":"not configured";case"gemini":return e("GOOGLE_API_KEY")?"available":"not configured";case"azure-openai":return e("AZURE_OPENAI_API_KEY")?"available":"not configured";case"bedrock":return e("AWS_ACCESS_KEY_ID")?"available":"not configured";case"onnx":return"configured";default:return"not configured"}}function J(o,e){let{mode:t,complexity:s,agentType:r}=e;return r?.includes("security")||o.toLowerCase().includes("security")?{provider:"claude",model:"claude-sonnet-4-6",reason:"Security tasks require advanced reasoning (rule-match)",confidence:.95,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.021}}:t==="cost-optimized"||s==="trivial"||s==="low"?{provider:"openai",model:"gpt-4o-mini",reason:"Cost optimization selected efficient model",confidence:.85,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:9e-4}}:t==="performance-optimized"||s==="expert"?{provider:"claude",model:"claude-opus-4-7",reason:"Complex task requires flagship model",confidence:.92,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.105}}:{provider:c.defaultProvider,model:c.defaultModel,reason:"Default provider selected",confidence:.8,estimatedCost:{inputTokens:2e3,outputTokens:1e3,totalCostUsd:.021}}}function L(o,e){switch(o){case"mode":if(["manual","rule-based","cost-optimized","performance-optimized"].includes(e))c.mode=e;else throw new Error(`Invalid mode: ${e}`);break;case"defaultProvider":if(P.includes(e))c.defaultProvider=e;else throw new Error(`Invalid provider: ${e}`);break;case"enableMetrics":c.enableMetrics=e==="true";break;case"cacheDecisions":c.cacheDecisions=e==="true";break;default:throw new Error(`Unknown config key: ${o}`)}}async function q(o){return P.map(e=>{let t=x(e);return{provider:e,healthy:t==="available"||e==="ollama"||e==="onnx",latencyMs:t!=="not configured"?k(50,250):void 0,message:t==="available"?"OK":t==="configured"?"API key not verified":"Not configured"}})}function F(o){let e=M.find(t=>t.canonicalId===o);if(e)return e;for(let t of M)for(let s of Object.values(t.providerIds))if(s===o)return t}async function U(o){let{readFile:e}=await import("fs/promises");if(o.transcript){let t=await e(o.transcript,"utf-8"),s=JSON.parse(t);if(!s.messages||!Array.isArray(s.messages))throw new Error(`Transcript file must contain a 'messages' array: ${o.transcript}`);return{systemPrompt:s.systemPrompt,taskDescription:s.taskDescription,messages:s.messages}}if(o.stdin){let t=[];for await(let i of process.stdin)t.push(Buffer.from(i));let s=Buffer.concat(t).toString("utf-8"),r=JSON.parse(s);if(!r.messages||!Array.isArray(r.messages))throw new Error("Transcript from stdin must contain a `messages` array");return{systemPrompt:r.systemPrompt,taskDescription:r.taskDescription,messages:r.messages}}if(o.session){let{readFile:t,readdir:s}=await import("fs/promises"),{join:r}=await import("path"),i=await import("os"),d=r(i.homedir(),".claude","projects"),g=null;try{let h=await s(d);for(let m of h){let f=r(d,m),a=(await s(f).catch(()=>[])).find(u=>u.includes(o.session)&&u.endsWith(".jsonl"));if(a){g=r(f,a);break}}}catch{}if(!g)throw new Error(`Could not find session JSONL for session ID "${o.session}" in ~/.claude/projects/. Use --transcript <path> as fallback.`);let y=(await t(g,"utf-8")).trim().split(`
|
|
33
|
-
`).filter(Boolean),p=[];for(let h of y)try{let m=JSON.parse(h),f=m.type,v=m.message;if(!v)continue;let a=v.role,u=v.content;if(f==="user"&&a==="user"){let b=typeof u=="string"?u:Array.isArray(u)?u.map(C=>C.text??"").join(""):"";b.trim()&&p.push({role:"user",content:b})}else if(f==="assistant"&&a==="assistant"){let b=typeof u=="string"?u:Array.isArray(u)?u.filter(C=>C.type==="text").map(C=>C.text??"").join(""):"";b.trim()&&p.push({role:"assistant",content:b})}}catch{}if(p.length===0)throw new Error(`Session JSONL at ${g} contained no parseable messages.`);return{messages:p}}throw new Error("aqe llm advise requires one of: --transcript <path>, --stdin, --session <id>")}async function H(o){let e=o.json!==!1,t=o.quiet??!1;try{let s=await U(o);!t&&!e&&console.log(n.gray("Consulting advisor..."));let{createProviderManager:r}=await import("./provider-manager-
|
|
33
|
+
`).filter(Boolean),p=[];for(let h of y)try{let m=JSON.parse(h),f=m.type,v=m.message;if(!v)continue;let a=v.role,u=v.content;if(f==="user"&&a==="user"){let b=typeof u=="string"?u:Array.isArray(u)?u.map(C=>C.text??"").join(""):"";b.trim()&&p.push({role:"user",content:b})}else if(f==="assistant"&&a==="assistant"){let b=typeof u=="string"?u:Array.isArray(u)?u.filter(C=>C.type==="text").map(C=>C.text??"").join(""):"";b.trim()&&p.push({role:"assistant",content:b})}}catch{}if(p.length===0)throw new Error(`Session JSONL at ${g} contained no parseable messages.`);return{messages:p}}throw new Error("aqe llm advise requires one of: --transcript <path>, --stdin, --session <id>")}async function H(o){let e=o.json!==!1,t=o.quiet??!1;try{let s=await U(o);!t&&!e&&console.log(n.gray("Consulting advisor..."));let{createProviderManager:r}=await import("./provider-manager-QYYZZLLO.js"),{createHybridRouter:i}=await import("./hybrid-router-Y6LBFPL7.js"),{MultiModelExecutor:d,DEFAULT_ADVISOR_PROVIDER:g,DEFAULT_ADVISOR_MODEL:O}=await import("./multi-model-executor-FZOPSUOT.js"),y=o.provider??g,p=o.model??O,h=r({primary:y==="openrouter"?"openrouter":y,providers:{openrouter:{apiKey:process.env.OPENROUTER_API_KEY,model:p}}}),m=i(h,{mode:"manual",defaultProvider:y,defaultModel:p});await m.initialize();let f=new d(m),v=o.redact??"strict",a=await f.consult(s,{provider:y,model:p,maxWords:o.maxWords?parseInt(o.maxWords,10):void 0,agentName:o.agent,triggerReason:o.triggerReason??"cli",sessionId:o.session??"cli-"+Date.now(),redact:v,advisorSystemPrompt:o.advisorPrompt});e?console.log(JSON.stringify({advice:a.advice,model:a.model,provider:a.provider,tokens_in:a.tokensIn,tokens_out:a.tokensOut,latency_ms:a.latencyMs,cost_usd:a.costUsd,advice_hash:a.adviceHash,trigger_reason:a.triggerReason,cache_hit:a.cacheHit,redaction_applied:a.redactionsApplied.length>0,redactions:a.redactionsApplied,circuit_breaker_remaining:a.circuitBreakerRemaining},null,2)):(console.log(n.bold.cyan(`
|
|
34
34
|
Advisor Response
|
|
35
|
-
`)),console.log(a.advice),console.log(),console.log(n.gray(`(${a.provider}/${a.model}, ${a.tokensIn}\u2192${a.tokensOut} tokens, ${a.latencyMs}ms, $${a.costUsd.toFixed(4)})`))),process.exit(0)}catch(s){let r=s instanceof Error?s.message:String(s),i=s?.exitCode??1;console.error(e?JSON.stringify({error:r,exit_code:i},null,2):n.red(`Error: ${r}`)),process.exit(i)}}async function z(o){let e=o.json??!1,t=parseInt(o.minCalls??"1",10);try{let{AdvisorCircuitBreaker:s}=await import("./circuit-breaker-
|
|
35
|
+
`)),console.log(a.advice),console.log(),console.log(n.gray(`(${a.provider}/${a.model}, ${a.tokensIn}\u2192${a.tokensOut} tokens, ${a.latencyMs}ms, $${a.costUsd.toFixed(4)})`))),process.exit(0)}catch(s){let r=s instanceof Error?s.message:String(s),i=s?.exitCode??1;console.error(e?JSON.stringify({error:r,exit_code:i},null,2):n.red(`Error: ${r}`)),process.exit(i)}}async function z(o){let e=o.json??!1,t=parseInt(o.minCalls??"1",10);try{let{AdvisorCircuitBreaker:s}=await import("./circuit-breaker-S3NFX6RQ.js"),i=new s().getState(o.session),d=i.callCount>=t,g={session:o.session,advisor_calls:i.callCount,required:t,gate:d?"PASS":"FAIL"};if(e)console.log(JSON.stringify(g,null,2));else{let O=d?n.green("PASS"):n.red("FAIL");console.log(`
|
|
36
36
|
Advisor Quality Gate: ${O}`),console.log(` Session: ${o.session}`),console.log(` Advisor calls: ${i.callCount}`),console.log(` Required: \u2265${t}`)}process.exit(d?0:7)}catch(s){let r=s instanceof Error?s.message:String(s);console.error(e?JSON.stringify({error:r},null,2):n.red(`Error: ${r}`)),process.exit(1)}}export{B as createLLMRouterCommand};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-LHZLH6I4.js";import{a as d}from"./chunk-BSTCXDVH.js";import"./chunk-OBDM6OJL.js";import{a as v,c as P}from"./chunk-3AOWTHLS.js";import{f as C}from"./chunk-IQGVQBVS.js";import"./chunk-YYQVSVBO.js";import"./chunk-AZPDX4KS.js";import"./chunk-ERGY45RL.js";var L={maxEvents:1e5,memorySampleInterval:1e3,enableTimeline:!0,timelineSampleInterval:1e3},u=class{config;activeAgents=new Map;peakAgentCount=0;totalAgentsSpawned=0;activeTasks=new Map;totalTasksStarted=0;totalTasksCompleted=0;coordinationLatencies;taskDurations;memorySnapshots;peakMemoryUsed=0;memorySum=0;memorySamples=0;agentTimeline=[];latencyTimeline=[];memoryTimeline=[];startTime=0;endTime=0;running=!1;memorySamplerTimer=null;timelineSamplerTimer=null;issues=[];constructor(t={}){this.config={...L,...t},this.coordinationLatencies=new d(this.config.maxEvents),this.taskDurations=new d(this.config.maxEvents),this.memorySnapshots=new d(1e4)}start(){this.running||(this.running=!0,this.startTime=Date.now(),this.memorySamplerTimer=setInterval(()=>{this.sampleMemory()},this.config.memorySampleInterval),this.config.enableTimeline&&(this.timelineSamplerTimer=setInterval(()=>{this.sampleTimeline()},this.config.timelineSampleInterval)))}stop(){this.running&&(this.running=!1,this.endTime=Date.now(),this.memorySamplerTimer&&(clearInterval(this.memorySamplerTimer),this.memorySamplerTimer=null),this.timelineSamplerTimer&&(clearInterval(this.timelineSamplerTimer),this.timelineSamplerTimer=null))}reset(){this.stop(),this.activeAgents.clear(),this.peakAgentCount=0,this.totalAgentsSpawned=0,this.activeTasks.clear(),this.totalTasksStarted=0,this.totalTasksCompleted=0,this.coordinationLatencies.clear(),this.taskDurations.clear(),this.memorySnapshots.clear(),this.peakMemoryUsed=0,this.memorySum=0,this.memorySamples=0,this.agentTimeline.length=0,this.latencyTimeline.length=0,this.memoryTimeline.length=0,this.startTime=0,this.endTime=0,this.issues.length=0}recordAgentSpawn(t,e=Date.now()){this.activeAgents.set(t,e),this.totalAgentsSpawned++;let r=this.activeAgents.size;r>this.peakAgentCount&&(this.peakAgentCount=r)}recordAgentTerminate(t,e=Date.now()){this.activeAgents.delete(t)}recordTaskStart(t,e,r=Date.now()){this.activeTasks.set(e,{agentId:t,startTime:r}),this.totalTasksStarted++}recordTaskComplete(t,e,r,n=Date.now()){let o=this.activeTasks.get(e);o&&o.agentId===t&&(this.activeTasks.delete(e),this.taskDurations.push(r),this.totalTasksCompleted++)}recordCoordination(t,e,r=Date.now()){this.coordinationLatencies.push(e),e>100&&this.issues.push(`High coordination latency for agent ${t}: ${e}ms`)}recordMemoryUsage(t,e){let r={timestamp:Date.now(),heapUsed:t,heapTotal:e,external:0,rss:0};this.memorySnapshots.push(r),this.memorySum+=t,this.memorySamples++,t>this.peakMemoryUsed&&(this.peakMemoryUsed=t);let n=4*1024*1024*1024;t>n&&this.issues.push(`Memory exceeded 4GB limit: ${(t/1024/1024/1024).toFixed(2)}GB`)}recordIssue(t){this.issues.push(t)}getAgentCount(){return this.activeAgents.size}getPeakAgentCount(){return this.peakAgentCount}getTotalAgentsSpawned(){return this.totalAgentsSpawned}getP95CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.95)}getP99CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.99)}getCoordinationLatencyPercentiles(){return this.calculatePercentiles(this.coordinationLatencies.toArray())}getTaskLatencyPercentiles(){return this.calculatePercentiles(this.taskDurations.toArray())}getMaxMemoryUsage(){return this.peakMemoryUsed}getAverageMemoryUsage(){return this.memorySamples>0?this.memorySum/this.memorySamples:0}getThroughput(){let e=this.getDuration()/1e3;return{tasks:this.totalTasksCompleted,tasksPerSecond:e>0?this.totalTasksCompleted/e:0,agents:this.totalAgentsSpawned,agentsPerSecond:e>0?this.totalAgentsSpawned/e:0}}getDuration(){return this.startTime===0?0:(this.endTime>0?this.endTime:Date.now())-this.startTime}hasAgentStarvation(){let t=this.activeAgents.size,e=this.activeTasks.size;return t>0&&e===0&&this.totalTasksCompleted>0}hasDeadlocks(){let t=Date.now(),e=6e4,r=Array.from(this.activeTasks.values());for(let n of r)if(t-n.startTime>e)return!0;return!1}exportReport(){let t=this.getDuration(),e=this.getCoordinationLatencyPercentiles(),r=this.getTaskLatencyPercentiles(),n=this.getThroughput(),o=100,a=4*1024*1024*1024,c={agentCount:this.peakAgentCount>=o,memoryLimit:this.peakMemoryUsed<a,coordinationLatency:e.p95<=100,noDeadlocks:!this.hasDeadlocks(),noStarvation:!this.hasAgentStarvation()},y=Object.values(c).every(Boolean),p=this.generateRecommendations(e,this.peakMemoryUsed,n);return{summary:{totalAgents:this.totalAgentsSpawned,peakAgents:this.peakAgentCount,totalTasks:this.totalTasksCompleted,duration:t,success:y,successCriteria:c},performance:{coordinationLatency:e,taskLatency:r,throughput:n},resources:{memoryPeak:this.peakMemoryUsed,memoryAverage:this.getAverageMemoryUsage(),cpuPeak:0,cpuAverage:0},timeline:{agentCounts:[...this.agentTimeline],latencies:[...this.latencyTimeline],memoryUsage:[...this.memoryTimeline]},issues:[...this.issues],recommendations:p}}sampleMemory(){let t=process.memoryUsage();this.recordMemoryUsage(t.heapUsed,t.heapTotal)}sampleTimeline(){let t=Date.now();this.agentTimeline.push({timestamp:t,count:this.activeAgents.size});let e=this.coordinationLatencies.toArray();e.length>0&&this.latencyTimeline.push({timestamp:t,p95:this.calculatePercentile(e,.95)});let r=process.memoryUsage();this.memoryTimeline.push({timestamp:t,heapUsed:r.heapUsed});let n=1e3;this.agentTimeline.length>n&&this.agentTimeline.shift(),this.latencyTimeline.length>n&&this.latencyTimeline.shift(),this.memoryTimeline.length>n&&this.memoryTimeline.shift()}calculatePercentile(t,e){if(t.length===0)return 0;let r=[...t].sort((o,a)=>o-a),n=Math.ceil(r.length*e)-1;return r[Math.max(0,n)]}calculatePercentiles(t){if(t.length===0)return{p50:0,p95:0,p99:0,max:0,min:0,avg:0,count:0};let e=[...t].sort((n,o)=>n-o),r=e.reduce((n,o)=>n+o,0);return{p50:this.calculatePercentile(e,.5),p95:this.calculatePercentile(e,.95),p99:this.calculatePercentile(e,.99),max:e[e.length-1],min:e[0],avg:r/e.length,count:e.length}}generateRecommendations(t,e,r){let n=[];t.p95>100&&n.push(`P95 coordination latency (${t.p95.toFixed(1)}ms) exceeds 100ms target. Consider optimizing gossip protocol or reducing agent count.`),t.p99>t.p95*2&&n.push("High P99/P95 ratio indicates latency outliers. Investigate specific agents or network conditions.");let o=e/1024/1024/1024;return o>3&&n.push(`Memory usage (${o.toFixed(2)}GB) approaching 4GB limit. Consider implementing agent pooling or reducing per-agent memory.`),r.tasksPerSecond<10&&n.push(`Task throughput (${r.tasksPerSecond.toFixed(1)}/s) is low. Consider parallelizing task execution or reducing task complexity.`),this.issues.length>10&&n.push(`${this.issues.length} issues recorded. Review issue log for patterns and prioritize fixes.`),n}};function k(s){return new u(s)}P();var h={memoryWarning:3*1024*1024*1024,memoryCritical:4*1024*1024*1024,latencyP95Warning:75,latencyP95Critical:100,latencyP99Warning:150,latencyP99Critical:200,agentStarvationTime:3e4,deadlockTimeout:6e4,minTasksPerSecond:5,minAgentUtilization:.5,gossipConvergenceTime:5e3,gossipMaxPartitions:0},b={thresholds:h,enableDetailedAnalysis:!0},l=class{config;constructor(t={}){this.config={...b,...t,thresholds:{...h,...t.thresholds}}}analyze(t){let e=[];e.push(this.checkMemoryPressure(t)),e.push(this.checkCoordinationLatencyP95(t)),e.push(this.checkCoordinationLatencyP99(t)),e.push(this.checkAgentStarvation(t)),e.push(this.checkDeadlocks(t)),e.push(this.checkThroughput(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}analyzeReport(t){let e=[];e.push(this.checkMemoryFromReport(t)),e.push(this.checkLatencyP95FromReport(t)),e.push(this.checkLatencyP99FromReport(t)),e.push(this.checkThroughputFromReport(t)),e.push(this.checkSuccessCriteria(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}checkMemoryPressure(t){let e=t?.getMaxMemoryUsage()??process.memoryUsage().heapUsed,{memoryWarning:r,memoryCritical:n}=this.config.thresholds,o=e>=r,a="low",i="Memory usage is within acceptable limits.";return e>=n?(a="critical",i="Memory usage exceeds 4GB limit. Implement agent pooling, reduce per-agent state, or decrease concurrent agent count."):e>=r&&(a="high",i="Memory usage approaching critical threshold. Consider optimizing agent memory footprint or implementing memory pressure relief mechanisms."),{detected:o,severity:a,metric:"memory_pressure",threshold:n,actual:e,recommendation:i,context:{usedGB:e/1024/1024/1024,warningThresholdGB:r/1024/1024/1024,criticalThresholdGB:n/1024/1024/1024}}}checkCoordinationLatency(){return this.checkCoordinationLatencyP95()}checkCoordinationLatencyP95(t){let e=t?.getP95CoordinationLatency()??0,{latencyP95Warning:r,latencyP95Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P95 coordination latency is within acceptable limits.";return e>=n?(a="critical",i="P95 coordination latency exceeds 100ms target. Optimize gossip protocol, reduce message size, or implement batching."):e>=r&&(a="medium",i="P95 coordination latency approaching target. Monitor closely and consider proactive optimization."),{detected:o,severity:a,metric:"coordination_latency_p95",threshold:n,actual:e,recommendation:i}}checkCoordinationLatencyP99(t){let e=t?.getP99CoordinationLatency()??0,{latencyP99Warning:r,latencyP99Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P99 coordination latency is within acceptable limits.";return e>=n?(a="high",i="P99 coordination latency indicates outliers. Investigate specific agents or network conditions causing delays."):e>=r&&(a="medium",i="P99 coordination latency elevated. Some agents may be experiencing delays."),{detected:o,severity:a,metric:"coordination_latency_p99",threshold:n,actual:e,recommendation:i}}checkAgentStarvation(t){let e=t?.hasAgentStarvation()??!1;return{detected:e,severity:e?"high":"low",metric:"agent_starvation",threshold:this.config.thresholds.agentStarvationTime,actual:e?1:0,recommendation:e?"Agent starvation detected. Agents are idle without tasks. Review task distribution algorithm and work stealing configuration.":"No agent starvation detected."}}checkDeadlocks(t){let e=t?.hasDeadlocks()??!1;return{detected:e,severity:e?"critical":"low",metric:"deadlock_detection",threshold:this.config.thresholds.deadlockTimeout,actual:e?1:0,recommendation:e?"Potential deadlock detected. Tasks running for extended period. Review lock ordering and add timeout mechanisms.":"No deadlocks detected."}}checkGossipStability(){return{detected:!1,severity:"low",metric:"gossip_stability",threshold:this.config.thresholds.gossipMaxPartitions,actual:0,recommendation:"Gossip protocol stability check requires integration with gossip metrics."}}checkThroughput(t){let r=t?.getThroughput()?.tasksPerSecond??0,n=this.config.thresholds.minTasksPerSecond,o=r<n&&r>0;return{detected:o,severity:o?"medium":"low",metric:"throughput",threshold:n,actual:r,recommendation:o?`Task throughput (${r.toFixed(1)}/s) below minimum (${n}/s). Consider parallelizing task execution or optimizing task handlers.`:"Task throughput is acceptable."}}checkMemoryFromReport(t){let e=t.resources.memoryPeak,{memoryCritical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"memory_pressure",threshold:r,actual:e,recommendation:e>=r?"Memory exceeded 4GB limit during test.":"Memory usage within limits."}}checkLatencyP95FromReport(t){let e=t.performance.coordinationLatency.p95,{latencyP95Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"coordination_latency_p95",threshold:r,actual:e,recommendation:e>=r?"P95 coordination latency exceeded 100ms target.":"P95 latency within target."}}checkLatencyP99FromReport(t){let e=t.performance.coordinationLatency.p99,{latencyP99Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"high":"low",metric:"coordination_latency_p99",threshold:r,actual:e,recommendation:e>=r?"P99 coordination latency indicates significant outliers.":"P99 latency acceptable."}}checkThroughputFromReport(t){let e=t.performance.throughput.tasksPerSecond,r=this.config.thresholds.minTasksPerSecond;return{detected:e<r&&e>0,severity:e<r?"medium":"low",metric:"throughput",threshold:r,actual:e,recommendation:e<r?"Throughput below minimum target.":"Throughput acceptable."}}checkSuccessCriteria(t){let e=t.summary.successCriteria,r=Object.entries(e).filter(([n,o])=>!o).map(([n])=>n);return{detected:r.length>0,severity:r.length>0?"high":"low",metric:"success_criteria",threshold:0,actual:r.length,recommendation:r.length>0?`Failed criteria: ${r.join(", ")}`:"All success criteria met.",context:{failedCriteria:r}}}generatePrioritizedRecommendations(t){let e={critical:0,high:1,medium:2,low:3},r=[...t].sort((a,i)=>e[a.severity]-e[i.severity]),n=new Set,o=[];for(let a of r)n.has(a.recommendation)||(n.add(a.recommendation),o.push(`[${a.severity.toUpperCase()}] ${a.metric}: ${a.recommendation}`));return o}};function T(s){return new l(s)}function f(s){return new l({thresholds:{...h,...s}})}var A={maxAgents:100,memoryLimit:4*1024*1024*1024,coordinationTimeout:100,workloadProfile:"medium",mockMode:!0},S={agentCount:100,memoryLimit:4*1024*1024*1024,coordinationLatency:100,noAgentStarvation:!0,noDeadlocks:!0,gossipStable:!0},g={light:{taskCount:5,taskDuration:50,memoryUsage:5*1024*1024,coordinationFrequency:2,durationVariance:.1},medium:{taskCount:10,taskDuration:100,memoryUsage:10*1024*1024,coordinationFrequency:5,durationVariance:.2},heavy:{taskCount:20,taskDuration:200,memoryUsage:20*1024*1024,coordinationFrequency:10,durationVariance:.3}},M={name:"ramp-up-100",description:"Gradually add agents until reaching 100",steps:[{agents:25,holdTime:3e4},{agents:50,holdTime:3e4},{agents:75,holdTime:3e4},{agents:100,holdTime:6e4}],workload:g.medium},R={name:"burst-100",description:"Instantly spawn 100 agents",steps:[{agents:100,holdTime:12e4}],workload:{taskCount:20,taskDuration:50,memoryUsage:10*1024*1024,coordinationFrequency:5}},x={name:"churn-100",description:"Maintain 100 agents with continuous spawn/terminate",steps:[{agents:100,holdTime:18e4,churnRate:.1}],workload:{taskCount:15,taskDuration:75,memoryUsage:10*1024*1024,coordinationFrequency:5}},D={name:"stress-150",description:"Push beyond 100 agents to find limits",steps:[{agents:100,holdTime:3e4},{agents:125,holdTime:3e4},{agents:150,holdTime:6e4}],workload:g.heavy,criteria:{agentCount:150}},m=class{config;metrics;analyzer;running=!1;stopRequested=!1;mockAgents=new Map;mockTaskTimers=new Map;mockCoordinationTimers=new Map;churnTimer=null;random;constructor(t={},e,r){this.config={...A,...t},this.metrics=k(e),this.analyzer=r?f(r):T(),this.random=this.config.seed!==void 0?this.seededRandom(this.config.seed):Math.random.bind(Math)}async runTest(t,e){let r={name:"custom",description:`Custom test with ${t} agents for ${e}ms`,steps:[{agents:t,holdTime:e}],workload:this.getWorkload()};return this.runScenario(r)}async runScenario(t){if(this.running)throw new Error("Load test already running");this.running=!0,this.stopRequested=!1;let e=Date.now();try{this.metrics.reset(),this.metrics.start();for(let i of t.steps){if(this.stopRequested)break;await this.executeStep(i,t.workload)}this.metrics.stop();let r=this.metrics.exportReport(),n=this.analyzer.analyzeReport(r),o={...S,...t.criteria};return{success:this.evaluateSuccess(r,o),report:r,bottlenecks:n,config:this.config,duration:Date.now()-e}}catch(r){return this.metrics.stop(),{success:!1,report:this.metrics.exportReport(),bottlenecks:this.analyzer.analyze(this.metrics),config:this.config,duration:Date.now()-e,error:v(r)}}finally{await this.cleanup(),this.running=!1}}async rampUp(t,e){let r=this.mockAgents.size,n=t-r;if(n<=0)return;let o=e/n,a=this.getWorkload();for(let i=0;i<n&&!this.stopRequested;i++)await this.spawnMockAgent(a),await this.delay(o)}async simulateAgent(t,e){let r=Date.now(),n=0,o=0;for(let a=0;a<e.taskCount&&!this.stopRequested;a++){let i=`${t}_task_${a}`,c=Date.now();this.metrics.recordTaskStart(t,i,c);let y=e.durationVariance??.2,p=e.taskDuration*(1+(this.random()-.5)*2*y);await this.delay(p),this.metrics.recordTaskComplete(t,i,Date.now()-c),n++;let w=this.simulateCoordinationLatency();this.metrics.recordCoordination(t,w),o++}return{agentId:t,tasksCompleted:n,totalDuration:Date.now()-r,coordinationEvents:o}}async stop(){this.stopRequested=!0,await this.delay(100),await this.cleanup()}getMetrics(){return this.metrics}getAgentCount(){return this.mockAgents.size}isRunning(){return this.running}async executeStep(t,e){let r=t.agents,n=this.mockAgents.size;r>n?await this.spawnAgents(r-n,e):r<n&&await this.terminateAgents(n-r),t.churnRate&&t.churnRate>0&&this.startChurn(t.churnRate,r,e),await this.hold(t.holdTime),this.stopChurn()}async spawnAgents(t,e){let r=[];for(let n=0;n<t&&!this.stopRequested;n++)r.push(this.spawnMockAgent(e)),r.length>=10&&(await Promise.all(r),r.length=0,await this.delay(10));r.length>0&&await Promise.all(r)}async terminateAgents(t){let e=Array.from(this.mockAgents.keys()).slice(0,t);for(let r of e)await this.terminateMockAgent(r)}async hold(t){let r=0;for(;r<t&&!this.stopRequested;)await this.delay(100),r+=100}startChurn(t,e,r){let o=6e4/Math.ceil(e*t);this.churnTimer=setInterval(async()=>{if(this.random()<.5){let a=Array.from(this.mockAgents.keys());if(a.length>0){let i=a[Math.floor(this.random()*a.length)];await this.terminateMockAgent(i)}}this.mockAgents.size<e&&await this.spawnMockAgent(r)},o)}stopChurn(){this.churnTimer&&(clearInterval(this.churnTimer),this.churnTimer=null)}async spawnMockAgent(t){let e=`agent_${C().slice(0,8)}`,r=Date.now(),n={id:e,domain:this.getRandomDomain(),spawnedAt:r,workload:t,activeTasks:0,totalTasks:0,terminated:!1};this.mockAgents.set(e,n),this.metrics.recordAgentSpawn(e,r),this.startAgentTasks(n),this.startAgentCoordination(n),this.simulateMemoryUsage()}async terminateMockAgent(t){let e=this.mockAgents.get(t);if(!e)return;e.terminated=!0;let r=this.mockTaskTimers.get(t);r&&(clearInterval(r),this.mockTaskTimers.delete(t));let n=this.mockCoordinationTimers.get(t);n&&(clearInterval(n),this.mockCoordinationTimers.delete(t)),this.mockAgents.delete(t),this.metrics.recordAgentTerminate(t,Date.now())}startAgentTasks(t){let e=t.workload.taskDuration*1.5,r=setInterval(()=>{if(t.terminated||t.totalTasks>=t.workload.taskCount){clearInterval(r),this.mockTaskTimers.delete(t.id);return}let n=`${t.id}_task_${t.totalTasks}`,o=Date.now();t.activeTasks++,t.totalTasks++,this.metrics.recordTaskStart(t.id,n,o);let a=t.workload.durationVariance??.2,i=t.workload.taskDuration*(1+(this.random()-.5)*2*a);setTimeout(()=>{t.terminated||(t.activeTasks--,this.metrics.recordTaskComplete(t.id,n,Date.now()-o))},i)},e);this.mockTaskTimers.set(t.id,r)}startAgentCoordination(t){let e=1e3/t.workload.coordinationFrequency,r=setInterval(()=>{if(t.terminated){clearInterval(r),this.mockCoordinationTimers.delete(t.id);return}let n=this.simulateCoordinationLatency();this.metrics.recordCoordination(t.id,n)},e);this.mockCoordinationTimers.set(t.id,r)}simulateCoordinationLatency(){let e=this.random()*30,r=this.random()<.05?this.random()*100:0,o=Math.min(this.mockAgents.size/100,2)*10;return 5+e+r+o}simulateMemoryUsage(){let t=this.mockAgents.size,e=this.getWorkload().memoryUsage,r=50*1024*1024,n=t*e,o=t*1024*100,a=r+n+o,i=a*1.5;this.metrics.recordMemoryUsage(a,i)}getRandomDomain(){let t=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","security-compliance"];return t[Math.floor(this.random()*t.length)]}getWorkload(){return this.config.customWorkload?this.config.customWorkload:g[this.config.workloadProfile]}evaluateSuccess(t,e){let{summary:r,performance:n}=t;return!(r.peakAgents<e.agentCount||t.resources.memoryPeak>=e.memoryLimit||n.coordinationLatency.p95>e.coordinationLatency||e.noAgentStarvation&&!r.successCriteria.noStarvation||e.noDeadlocks&&!r.successCriteria.noDeadlocks)}async cleanup(){this.stopChurn();let t=Array.from(this.mockAgents.keys());for(let e of t)await this.terminateMockAgent(e);this.mockTaskTimers.forEach(e=>{clearInterval(e)}),this.mockTaskTimers.clear(),this.mockCoordinationTimers.forEach(e=>{clearInterval(e)}),this.mockCoordinationTimers.clear()}delay(t){return new Promise(e=>setTimeout(e,t))}seededRandom(t){return function(){let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}};function B(s,t,e){return new m(s,t,e)}function _(s,t="medium"){return new m({maxAgents:s,workloadProfile:t,mockMode:!0})}export{m as AgentLoadTester,l as BottleneckAnalyzer,b as DEFAULT_ANALYZER_CONFIG,A as DEFAULT_LOAD_TEST_CONFIG,S as DEFAULT_SUCCESS_CRITERIA,h as DEFAULT_THRESHOLDS,u as MetricsCollector,R as SCENARIO_BURST_100,x as SCENARIO_CHURN_100,M as SCENARIO_RAMP_UP_100,D as SCENARIO_STRESS_150,g as WORKLOAD_PROFILES,B as createAgentLoadTester,T as createBottleneckAnalyzer,f as createBottleneckAnalyzerWithThresholds,_ as createLoadTesterForTarget,k as createMetricsCollector};
|
|
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.9.15");process.exit(0)}
|
|
2
|
+
import"./chunk-3RSPEFU3.js";import{a as d}from"./chunk-ICXWXO5P.js";import"./chunk-62MVVEGH.js";import{a as v,c as P}from"./chunk-JJDHD7SC.js";import{f as C}from"./chunk-MBDX4OHD.js";import"./chunk-D3ZUSXFY.js";import"./chunk-MS6T4VCU.js";import"./chunk-CUQBOVRP.js";var L={maxEvents:1e5,memorySampleInterval:1e3,enableTimeline:!0,timelineSampleInterval:1e3},u=class{config;activeAgents=new Map;peakAgentCount=0;totalAgentsSpawned=0;activeTasks=new Map;totalTasksStarted=0;totalTasksCompleted=0;coordinationLatencies;taskDurations;memorySnapshots;peakMemoryUsed=0;memorySum=0;memorySamples=0;agentTimeline=[];latencyTimeline=[];memoryTimeline=[];startTime=0;endTime=0;running=!1;memorySamplerTimer=null;timelineSamplerTimer=null;issues=[];constructor(t={}){this.config={...L,...t},this.coordinationLatencies=new d(this.config.maxEvents),this.taskDurations=new d(this.config.maxEvents),this.memorySnapshots=new d(1e4)}start(){this.running||(this.running=!0,this.startTime=Date.now(),this.memorySamplerTimer=setInterval(()=>{this.sampleMemory()},this.config.memorySampleInterval),this.config.enableTimeline&&(this.timelineSamplerTimer=setInterval(()=>{this.sampleTimeline()},this.config.timelineSampleInterval)))}stop(){this.running&&(this.running=!1,this.endTime=Date.now(),this.memorySamplerTimer&&(clearInterval(this.memorySamplerTimer),this.memorySamplerTimer=null),this.timelineSamplerTimer&&(clearInterval(this.timelineSamplerTimer),this.timelineSamplerTimer=null))}reset(){this.stop(),this.activeAgents.clear(),this.peakAgentCount=0,this.totalAgentsSpawned=0,this.activeTasks.clear(),this.totalTasksStarted=0,this.totalTasksCompleted=0,this.coordinationLatencies.clear(),this.taskDurations.clear(),this.memorySnapshots.clear(),this.peakMemoryUsed=0,this.memorySum=0,this.memorySamples=0,this.agentTimeline.length=0,this.latencyTimeline.length=0,this.memoryTimeline.length=0,this.startTime=0,this.endTime=0,this.issues.length=0}recordAgentSpawn(t,e=Date.now()){this.activeAgents.set(t,e),this.totalAgentsSpawned++;let r=this.activeAgents.size;r>this.peakAgentCount&&(this.peakAgentCount=r)}recordAgentTerminate(t,e=Date.now()){this.activeAgents.delete(t)}recordTaskStart(t,e,r=Date.now()){this.activeTasks.set(e,{agentId:t,startTime:r}),this.totalTasksStarted++}recordTaskComplete(t,e,r,n=Date.now()){let o=this.activeTasks.get(e);o&&o.agentId===t&&(this.activeTasks.delete(e),this.taskDurations.push(r),this.totalTasksCompleted++)}recordCoordination(t,e,r=Date.now()){this.coordinationLatencies.push(e),e>100&&this.issues.push(`High coordination latency for agent ${t}: ${e}ms`)}recordMemoryUsage(t,e){let r={timestamp:Date.now(),heapUsed:t,heapTotal:e,external:0,rss:0};this.memorySnapshots.push(r),this.memorySum+=t,this.memorySamples++,t>this.peakMemoryUsed&&(this.peakMemoryUsed=t);let n=4*1024*1024*1024;t>n&&this.issues.push(`Memory exceeded 4GB limit: ${(t/1024/1024/1024).toFixed(2)}GB`)}recordIssue(t){this.issues.push(t)}getAgentCount(){return this.activeAgents.size}getPeakAgentCount(){return this.peakAgentCount}getTotalAgentsSpawned(){return this.totalAgentsSpawned}getP95CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.95)}getP99CoordinationLatency(){return this.calculatePercentile(this.coordinationLatencies.toArray(),.99)}getCoordinationLatencyPercentiles(){return this.calculatePercentiles(this.coordinationLatencies.toArray())}getTaskLatencyPercentiles(){return this.calculatePercentiles(this.taskDurations.toArray())}getMaxMemoryUsage(){return this.peakMemoryUsed}getAverageMemoryUsage(){return this.memorySamples>0?this.memorySum/this.memorySamples:0}getThroughput(){let e=this.getDuration()/1e3;return{tasks:this.totalTasksCompleted,tasksPerSecond:e>0?this.totalTasksCompleted/e:0,agents:this.totalAgentsSpawned,agentsPerSecond:e>0?this.totalAgentsSpawned/e:0}}getDuration(){return this.startTime===0?0:(this.endTime>0?this.endTime:Date.now())-this.startTime}hasAgentStarvation(){let t=this.activeAgents.size,e=this.activeTasks.size;return t>0&&e===0&&this.totalTasksCompleted>0}hasDeadlocks(){let t=Date.now(),e=6e4,r=Array.from(this.activeTasks.values());for(let n of r)if(t-n.startTime>e)return!0;return!1}exportReport(){let t=this.getDuration(),e=this.getCoordinationLatencyPercentiles(),r=this.getTaskLatencyPercentiles(),n=this.getThroughput(),o=100,a=4*1024*1024*1024,c={agentCount:this.peakAgentCount>=o,memoryLimit:this.peakMemoryUsed<a,coordinationLatency:e.p95<=100,noDeadlocks:!this.hasDeadlocks(),noStarvation:!this.hasAgentStarvation()},y=Object.values(c).every(Boolean),p=this.generateRecommendations(e,this.peakMemoryUsed,n);return{summary:{totalAgents:this.totalAgentsSpawned,peakAgents:this.peakAgentCount,totalTasks:this.totalTasksCompleted,duration:t,success:y,successCriteria:c},performance:{coordinationLatency:e,taskLatency:r,throughput:n},resources:{memoryPeak:this.peakMemoryUsed,memoryAverage:this.getAverageMemoryUsage(),cpuPeak:0,cpuAverage:0},timeline:{agentCounts:[...this.agentTimeline],latencies:[...this.latencyTimeline],memoryUsage:[...this.memoryTimeline]},issues:[...this.issues],recommendations:p}}sampleMemory(){let t=process.memoryUsage();this.recordMemoryUsage(t.heapUsed,t.heapTotal)}sampleTimeline(){let t=Date.now();this.agentTimeline.push({timestamp:t,count:this.activeAgents.size});let e=this.coordinationLatencies.toArray();e.length>0&&this.latencyTimeline.push({timestamp:t,p95:this.calculatePercentile(e,.95)});let r=process.memoryUsage();this.memoryTimeline.push({timestamp:t,heapUsed:r.heapUsed});let n=1e3;this.agentTimeline.length>n&&this.agentTimeline.shift(),this.latencyTimeline.length>n&&this.latencyTimeline.shift(),this.memoryTimeline.length>n&&this.memoryTimeline.shift()}calculatePercentile(t,e){if(t.length===0)return 0;let r=[...t].sort((o,a)=>o-a),n=Math.ceil(r.length*e)-1;return r[Math.max(0,n)]}calculatePercentiles(t){if(t.length===0)return{p50:0,p95:0,p99:0,max:0,min:0,avg:0,count:0};let e=[...t].sort((n,o)=>n-o),r=e.reduce((n,o)=>n+o,0);return{p50:this.calculatePercentile(e,.5),p95:this.calculatePercentile(e,.95),p99:this.calculatePercentile(e,.99),max:e[e.length-1],min:e[0],avg:r/e.length,count:e.length}}generateRecommendations(t,e,r){let n=[];t.p95>100&&n.push(`P95 coordination latency (${t.p95.toFixed(1)}ms) exceeds 100ms target. Consider optimizing gossip protocol or reducing agent count.`),t.p99>t.p95*2&&n.push("High P99/P95 ratio indicates latency outliers. Investigate specific agents or network conditions.");let o=e/1024/1024/1024;return o>3&&n.push(`Memory usage (${o.toFixed(2)}GB) approaching 4GB limit. Consider implementing agent pooling or reducing per-agent memory.`),r.tasksPerSecond<10&&n.push(`Task throughput (${r.tasksPerSecond.toFixed(1)}/s) is low. Consider parallelizing task execution or reducing task complexity.`),this.issues.length>10&&n.push(`${this.issues.length} issues recorded. Review issue log for patterns and prioritize fixes.`),n}};function k(s){return new u(s)}P();var h={memoryWarning:3*1024*1024*1024,memoryCritical:4*1024*1024*1024,latencyP95Warning:75,latencyP95Critical:100,latencyP99Warning:150,latencyP99Critical:200,agentStarvationTime:3e4,deadlockTimeout:6e4,minTasksPerSecond:5,minAgentUtilization:.5,gossipConvergenceTime:5e3,gossipMaxPartitions:0},b={thresholds:h,enableDetailedAnalysis:!0},l=class{config;constructor(t={}){this.config={...b,...t,thresholds:{...h,...t.thresholds}}}analyze(t){let e=[];e.push(this.checkMemoryPressure(t)),e.push(this.checkCoordinationLatencyP95(t)),e.push(this.checkCoordinationLatencyP99(t)),e.push(this.checkAgentStarvation(t)),e.push(this.checkDeadlocks(t)),e.push(this.checkThroughput(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}analyzeReport(t){let e=[];e.push(this.checkMemoryFromReport(t)),e.push(this.checkLatencyP95FromReport(t)),e.push(this.checkLatencyP99FromReport(t)),e.push(this.checkThroughputFromReport(t)),e.push(this.checkSuccessCriteria(t));let r=e.filter(i=>i.detected),n={totalChecks:e.length,detected:r.length,critical:r.filter(i=>i.severity==="critical").length,high:r.filter(i=>i.severity==="high").length,medium:r.filter(i=>i.severity==="medium").length,low:r.filter(i=>i.severity==="low").length},o="low";n.critical>0?o="critical":n.high>0?o="high":n.medium>0&&(o="medium");let a=this.generatePrioritizedRecommendations(r);return{overallSeverity:o,hasCritical:n.critical>0,bottlenecks:e,summary:n,recommendations:a,timestamp:new Date}}checkMemoryPressure(t){let e=t?.getMaxMemoryUsage()??process.memoryUsage().heapUsed,{memoryWarning:r,memoryCritical:n}=this.config.thresholds,o=e>=r,a="low",i="Memory usage is within acceptable limits.";return e>=n?(a="critical",i="Memory usage exceeds 4GB limit. Implement agent pooling, reduce per-agent state, or decrease concurrent agent count."):e>=r&&(a="high",i="Memory usage approaching critical threshold. Consider optimizing agent memory footprint or implementing memory pressure relief mechanisms."),{detected:o,severity:a,metric:"memory_pressure",threshold:n,actual:e,recommendation:i,context:{usedGB:e/1024/1024/1024,warningThresholdGB:r/1024/1024/1024,criticalThresholdGB:n/1024/1024/1024}}}checkCoordinationLatency(){return this.checkCoordinationLatencyP95()}checkCoordinationLatencyP95(t){let e=t?.getP95CoordinationLatency()??0,{latencyP95Warning:r,latencyP95Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P95 coordination latency is within acceptable limits.";return e>=n?(a="critical",i="P95 coordination latency exceeds 100ms target. Optimize gossip protocol, reduce message size, or implement batching."):e>=r&&(a="medium",i="P95 coordination latency approaching target. Monitor closely and consider proactive optimization."),{detected:o,severity:a,metric:"coordination_latency_p95",threshold:n,actual:e,recommendation:i}}checkCoordinationLatencyP99(t){let e=t?.getP99CoordinationLatency()??0,{latencyP99Warning:r,latencyP99Critical:n}=this.config.thresholds,o=e>=r,a="low",i="P99 coordination latency is within acceptable limits.";return e>=n?(a="high",i="P99 coordination latency indicates outliers. Investigate specific agents or network conditions causing delays."):e>=r&&(a="medium",i="P99 coordination latency elevated. Some agents may be experiencing delays."),{detected:o,severity:a,metric:"coordination_latency_p99",threshold:n,actual:e,recommendation:i}}checkAgentStarvation(t){let e=t?.hasAgentStarvation()??!1;return{detected:e,severity:e?"high":"low",metric:"agent_starvation",threshold:this.config.thresholds.agentStarvationTime,actual:e?1:0,recommendation:e?"Agent starvation detected. Agents are idle without tasks. Review task distribution algorithm and work stealing configuration.":"No agent starvation detected."}}checkDeadlocks(t){let e=t?.hasDeadlocks()??!1;return{detected:e,severity:e?"critical":"low",metric:"deadlock_detection",threshold:this.config.thresholds.deadlockTimeout,actual:e?1:0,recommendation:e?"Potential deadlock detected. Tasks running for extended period. Review lock ordering and add timeout mechanisms.":"No deadlocks detected."}}checkGossipStability(){return{detected:!1,severity:"low",metric:"gossip_stability",threshold:this.config.thresholds.gossipMaxPartitions,actual:0,recommendation:"Gossip protocol stability check requires integration with gossip metrics."}}checkThroughput(t){let r=t?.getThroughput()?.tasksPerSecond??0,n=this.config.thresholds.minTasksPerSecond,o=r<n&&r>0;return{detected:o,severity:o?"medium":"low",metric:"throughput",threshold:n,actual:r,recommendation:o?`Task throughput (${r.toFixed(1)}/s) below minimum (${n}/s). Consider parallelizing task execution or optimizing task handlers.`:"Task throughput is acceptable."}}checkMemoryFromReport(t){let e=t.resources.memoryPeak,{memoryCritical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"memory_pressure",threshold:r,actual:e,recommendation:e>=r?"Memory exceeded 4GB limit during test.":"Memory usage within limits."}}checkLatencyP95FromReport(t){let e=t.performance.coordinationLatency.p95,{latencyP95Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"critical":"low",metric:"coordination_latency_p95",threshold:r,actual:e,recommendation:e>=r?"P95 coordination latency exceeded 100ms target.":"P95 latency within target."}}checkLatencyP99FromReport(t){let e=t.performance.coordinationLatency.p99,{latencyP99Critical:r}=this.config.thresholds;return{detected:e>=r,severity:e>=r?"high":"low",metric:"coordination_latency_p99",threshold:r,actual:e,recommendation:e>=r?"P99 coordination latency indicates significant outliers.":"P99 latency acceptable."}}checkThroughputFromReport(t){let e=t.performance.throughput.tasksPerSecond,r=this.config.thresholds.minTasksPerSecond;return{detected:e<r&&e>0,severity:e<r?"medium":"low",metric:"throughput",threshold:r,actual:e,recommendation:e<r?"Throughput below minimum target.":"Throughput acceptable."}}checkSuccessCriteria(t){let e=t.summary.successCriteria,r=Object.entries(e).filter(([n,o])=>!o).map(([n])=>n);return{detected:r.length>0,severity:r.length>0?"high":"low",metric:"success_criteria",threshold:0,actual:r.length,recommendation:r.length>0?`Failed criteria: ${r.join(", ")}`:"All success criteria met.",context:{failedCriteria:r}}}generatePrioritizedRecommendations(t){let e={critical:0,high:1,medium:2,low:3},r=[...t].sort((a,i)=>e[a.severity]-e[i.severity]),n=new Set,o=[];for(let a of r)n.has(a.recommendation)||(n.add(a.recommendation),o.push(`[${a.severity.toUpperCase()}] ${a.metric}: ${a.recommendation}`));return o}};function T(s){return new l(s)}function f(s){return new l({thresholds:{...h,...s}})}var A={maxAgents:100,memoryLimit:4*1024*1024*1024,coordinationTimeout:100,workloadProfile:"medium",mockMode:!0},S={agentCount:100,memoryLimit:4*1024*1024*1024,coordinationLatency:100,noAgentStarvation:!0,noDeadlocks:!0,gossipStable:!0},g={light:{taskCount:5,taskDuration:50,memoryUsage:5*1024*1024,coordinationFrequency:2,durationVariance:.1},medium:{taskCount:10,taskDuration:100,memoryUsage:10*1024*1024,coordinationFrequency:5,durationVariance:.2},heavy:{taskCount:20,taskDuration:200,memoryUsage:20*1024*1024,coordinationFrequency:10,durationVariance:.3}},M={name:"ramp-up-100",description:"Gradually add agents until reaching 100",steps:[{agents:25,holdTime:3e4},{agents:50,holdTime:3e4},{agents:75,holdTime:3e4},{agents:100,holdTime:6e4}],workload:g.medium},R={name:"burst-100",description:"Instantly spawn 100 agents",steps:[{agents:100,holdTime:12e4}],workload:{taskCount:20,taskDuration:50,memoryUsage:10*1024*1024,coordinationFrequency:5}},x={name:"churn-100",description:"Maintain 100 agents with continuous spawn/terminate",steps:[{agents:100,holdTime:18e4,churnRate:.1}],workload:{taskCount:15,taskDuration:75,memoryUsage:10*1024*1024,coordinationFrequency:5}},D={name:"stress-150",description:"Push beyond 100 agents to find limits",steps:[{agents:100,holdTime:3e4},{agents:125,holdTime:3e4},{agents:150,holdTime:6e4}],workload:g.heavy,criteria:{agentCount:150}},m=class{config;metrics;analyzer;running=!1;stopRequested=!1;mockAgents=new Map;mockTaskTimers=new Map;mockCoordinationTimers=new Map;churnTimer=null;random;constructor(t={},e,r){this.config={...A,...t},this.metrics=k(e),this.analyzer=r?f(r):T(),this.random=this.config.seed!==void 0?this.seededRandom(this.config.seed):Math.random.bind(Math)}async runTest(t,e){let r={name:"custom",description:`Custom test with ${t} agents for ${e}ms`,steps:[{agents:t,holdTime:e}],workload:this.getWorkload()};return this.runScenario(r)}async runScenario(t){if(this.running)throw new Error("Load test already running");this.running=!0,this.stopRequested=!1;let e=Date.now();try{this.metrics.reset(),this.metrics.start();for(let i of t.steps){if(this.stopRequested)break;await this.executeStep(i,t.workload)}this.metrics.stop();let r=this.metrics.exportReport(),n=this.analyzer.analyzeReport(r),o={...S,...t.criteria};return{success:this.evaluateSuccess(r,o),report:r,bottlenecks:n,config:this.config,duration:Date.now()-e}}catch(r){return this.metrics.stop(),{success:!1,report:this.metrics.exportReport(),bottlenecks:this.analyzer.analyze(this.metrics),config:this.config,duration:Date.now()-e,error:v(r)}}finally{await this.cleanup(),this.running=!1}}async rampUp(t,e){let r=this.mockAgents.size,n=t-r;if(n<=0)return;let o=e/n,a=this.getWorkload();for(let i=0;i<n&&!this.stopRequested;i++)await this.spawnMockAgent(a),await this.delay(o)}async simulateAgent(t,e){let r=Date.now(),n=0,o=0;for(let a=0;a<e.taskCount&&!this.stopRequested;a++){let i=`${t}_task_${a}`,c=Date.now();this.metrics.recordTaskStart(t,i,c);let y=e.durationVariance??.2,p=e.taskDuration*(1+(this.random()-.5)*2*y);await this.delay(p),this.metrics.recordTaskComplete(t,i,Date.now()-c),n++;let w=this.simulateCoordinationLatency();this.metrics.recordCoordination(t,w),o++}return{agentId:t,tasksCompleted:n,totalDuration:Date.now()-r,coordinationEvents:o}}async stop(){this.stopRequested=!0,await this.delay(100),await this.cleanup()}getMetrics(){return this.metrics}getAgentCount(){return this.mockAgents.size}isRunning(){return this.running}async executeStep(t,e){let r=t.agents,n=this.mockAgents.size;r>n?await this.spawnAgents(r-n,e):r<n&&await this.terminateAgents(n-r),t.churnRate&&t.churnRate>0&&this.startChurn(t.churnRate,r,e),await this.hold(t.holdTime),this.stopChurn()}async spawnAgents(t,e){let r=[];for(let n=0;n<t&&!this.stopRequested;n++)r.push(this.spawnMockAgent(e)),r.length>=10&&(await Promise.all(r),r.length=0,await this.delay(10));r.length>0&&await Promise.all(r)}async terminateAgents(t){let e=Array.from(this.mockAgents.keys()).slice(0,t);for(let r of e)await this.terminateMockAgent(r)}async hold(t){let r=0;for(;r<t&&!this.stopRequested;)await this.delay(100),r+=100}startChurn(t,e,r){let o=6e4/Math.ceil(e*t);this.churnTimer=setInterval(async()=>{if(this.random()<.5){let a=Array.from(this.mockAgents.keys());if(a.length>0){let i=a[Math.floor(this.random()*a.length)];await this.terminateMockAgent(i)}}this.mockAgents.size<e&&await this.spawnMockAgent(r)},o)}stopChurn(){this.churnTimer&&(clearInterval(this.churnTimer),this.churnTimer=null)}async spawnMockAgent(t){let e=`agent_${C().slice(0,8)}`,r=Date.now(),n={id:e,domain:this.getRandomDomain(),spawnedAt:r,workload:t,activeTasks:0,totalTasks:0,terminated:!1};this.mockAgents.set(e,n),this.metrics.recordAgentSpawn(e,r),this.startAgentTasks(n),this.startAgentCoordination(n),this.simulateMemoryUsage()}async terminateMockAgent(t){let e=this.mockAgents.get(t);if(!e)return;e.terminated=!0;let r=this.mockTaskTimers.get(t);r&&(clearInterval(r),this.mockTaskTimers.delete(t));let n=this.mockCoordinationTimers.get(t);n&&(clearInterval(n),this.mockCoordinationTimers.delete(t)),this.mockAgents.delete(t),this.metrics.recordAgentTerminate(t,Date.now())}startAgentTasks(t){let e=t.workload.taskDuration*1.5,r=setInterval(()=>{if(t.terminated||t.totalTasks>=t.workload.taskCount){clearInterval(r),this.mockTaskTimers.delete(t.id);return}let n=`${t.id}_task_${t.totalTasks}`,o=Date.now();t.activeTasks++,t.totalTasks++,this.metrics.recordTaskStart(t.id,n,o);let a=t.workload.durationVariance??.2,i=t.workload.taskDuration*(1+(this.random()-.5)*2*a);setTimeout(()=>{t.terminated||(t.activeTasks--,this.metrics.recordTaskComplete(t.id,n,Date.now()-o))},i)},e);this.mockTaskTimers.set(t.id,r)}startAgentCoordination(t){let e=1e3/t.workload.coordinationFrequency,r=setInterval(()=>{if(t.terminated){clearInterval(r),this.mockCoordinationTimers.delete(t.id);return}let n=this.simulateCoordinationLatency();this.metrics.recordCoordination(t.id,n)},e);this.mockCoordinationTimers.set(t.id,r)}simulateCoordinationLatency(){let e=this.random()*30,r=this.random()<.05?this.random()*100:0,o=Math.min(this.mockAgents.size/100,2)*10;return 5+e+r+o}simulateMemoryUsage(){let t=this.mockAgents.size,e=this.getWorkload().memoryUsage,r=50*1024*1024,n=t*e,o=t*1024*100,a=r+n+o,i=a*1.5;this.metrics.recordMemoryUsage(a,i)}getRandomDomain(){let t=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","security-compliance"];return t[Math.floor(this.random()*t.length)]}getWorkload(){return this.config.customWorkload?this.config.customWorkload:g[this.config.workloadProfile]}evaluateSuccess(t,e){let{summary:r,performance:n}=t;return!(r.peakAgents<e.agentCount||t.resources.memoryPeak>=e.memoryLimit||n.coordinationLatency.p95>e.coordinationLatency||e.noAgentStarvation&&!r.successCriteria.noStarvation||e.noDeadlocks&&!r.successCriteria.noDeadlocks)}async cleanup(){this.stopChurn();let t=Array.from(this.mockAgents.keys());for(let e of t)await this.terminateMockAgent(e);this.mockTaskTimers.forEach(e=>{clearInterval(e)}),this.mockTaskTimers.clear(),this.mockCoordinationTimers.forEach(e=>{clearInterval(e)}),this.mockCoordinationTimers.clear()}delay(t){return new Promise(e=>setTimeout(e,t))}seededRandom(t){return function(){let e=t+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}}};function B(s,t,e){return new m(s,t,e)}function _(s,t="medium"){return new m({maxAgents:s,workloadProfile:t,mockMode:!0})}export{m as AgentLoadTester,l as BottleneckAnalyzer,b as DEFAULT_ANALYZER_CONFIG,A as DEFAULT_LOAD_TEST_CONFIG,S as DEFAULT_SUCCESS_CRITERIA,h as DEFAULT_THRESHOLDS,u as MetricsCollector,R as SCENARIO_BURST_100,x as SCENARIO_CHURN_100,M as SCENARIO_RAMP_UP_100,D as SCENARIO_STRESS_150,g as WORKLOAD_PROFILES,B as createAgentLoadTester,T as createBottleneckAnalyzer,f as createBottleneckAnalyzerWithThresholds,_ as createLoadTesterForTarget,k as createMetricsCollector};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-4M7RBSW6.js";import"./chunk-AVKUFN3C.js";import"./chunk-MO4Q5ZGE.js";import"./chunk-LLVS3UYZ.js";import"./chunk-KKBSX43Q.js";import"./chunk-FEVTMHO6.js";import"./chunk-XALB3KRR.js";import"./chunk-2XW36KDQ.js";import"./chunk-JJDHD7SC.js";import"./chunk-MBDX4OHD.js";import"./chunk-JAIIPEE6.js";import"./chunk-6OEGZSRK.js";import"./chunk-WI6UA5HV.js";import"./chunk-D3ZUSXFY.js";import"./chunk-2BBKAX7X.js";import"./chunk-MS6T4VCU.js";import"./chunk-IPVKVPAF.js";import"./chunk-YCYFUYCE.js";import"./chunk-XXRDI53H.js";import"./chunk-CUQBOVRP.js";export{a as LoadTestTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a as p}from"./chunk-WAQ3U4FC.js";import"./chunk-CUQBOVRP.js";import{Command as d}from"commander";import{spawn as m}from"child_process";import{join as e,dirname as a}from"path";import{existsSync as l}from"fs";import{fileURLToPath as u}from"url";function f(){return new d("mcp").description("Start the MCP protocol server for Claude Code integration").option("--http <port>","Also start HTTP server for AG-UI/A2A protocols","0").option("--verbose","Enable verbose logging").action(async r=>{let s={...process.env,AQE_HTTP_PORT:r.http||"0"};r.verbose&&(s.AQE_VERBOSE="true");let o=g();o||(console.error("Error: Could not find MCP server entry point"),console.error("Make sure agentic-qe is properly installed"),process.exit(1));let n=o.endsWith(".js"),c=m("node",n?[o]:["--import","tsx",o],{env:s,stdio:"inherit",cwd:process.cwd()});c.on("error",i=>{console.error("Failed to start MCP server:",i.message),process.exit(1)}),c.on("exit",i=>{process.exit(i??0)}),process.on("SIGINT",()=>c.kill("SIGINT")),process.on("SIGTERM",()=>c.kill("SIGTERM"))})}function g(){let t=[],r=p(import.meta.url);r&&t.push(e(r,"dist","mcp","bundle.js"),e(r,"dist","mcp","entry.js"),e(r,"src","mcp","entry.ts"));let s=u(import.meta.url),o=a(s);t.push(e(o,"..","mcp","bundle.js"),e(o,"..","mcp","entry.js"),e(o,"..","mcp","entry.ts"),e(o,"..","..","mcp","bundle.js")),t.push(e(process.cwd(),"node_modules","agentic-qe","dist","mcp","bundle.js"),e(process.cwd(),"node_modules","agentic-qe","dist","mcp","entry.js"));for(let n of t)if(l(n))return n;return null}var R=f;export{f as createMcpCommand,R as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as i,c as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a as i,c as p}from"./chunk-JJDHD7SC.js";import"./chunk-CUQBOVRP.js";p();import{Command as f}from"commander";import r from"chalk";function S(w,o,l){let c=new f("memory").description("Memory store, retrieve, search, and delete operations").addHelpText("after",`
|
|
3
3
|
Examples:
|
|
4
4
|
# Store a value
|
|
5
5
|
aqe memory store --key "auth-pattern" --value "JWT with refresh tokens" --namespace patterns
|
|
@@ -24,9 +24,9 @@ Examples:
|
|
|
24
24
|
|
|
25
25
|
# Show usage stats
|
|
26
26
|
aqe memory usage
|
|
27
|
-
`);return c.command("store").description("Store a key-value pair in memory").requiredOption("--key <key>","Memory key").requiredOption("--value <value>","Value to store (string or JSON)").option("--namespace <ns>","Namespace for grouping","default").option("--ttl <seconds>","Time-to-live in seconds").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryStore:t}=await import("./memory-handlers-
|
|
27
|
+
`);return c.command("store").description("Store a key-value pair in memory").requiredOption("--key <key>","Memory key").requiredOption("--value <value>","Value to store (string or JSON)").option("--namespace <ns>","Namespace for grouping","default").option("--ttl <seconds>","Time-to-live in seconds").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryStore:t}=await import("./memory-handlers-PC4P4YEF.js"),a=e.value;try{a=JSON.parse(e.value)}catch{}let s=await t({key:e.key,value:a,namespace:e.namespace,ttl:e.ttl?parseInt(e.ttl,10):void 0});e.json?console.log(JSON.stringify(s,null,2)):s.success?console.log(r.green(` \u2713 Stored "${e.key}" in namespace "${e.namespace}"`)):(console.error(r.red(` \u2717 ${s.error}`)),await o(1))}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("get").description("Retrieve a value by key").requiredOption("--key <key>","Memory key to retrieve").option("--namespace <ns>","Namespace","default").option("--include-metadata","Include metadata in response").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryRetrieve:t}=await import("./memory-handlers-PC4P4YEF.js"),a=await t({key:e.key,namespace:e.namespace,includeMetadata:e.includeMetadata});if(e.json)console.log(JSON.stringify(a,null,2));else if(a.success&&a.data)if(a.data.found){let s=typeof a.data.value=="string"?a.data.value:JSON.stringify(a.data.value,null,2);console.log(r.green(` ${e.key}`)+r.gray(` [${e.namespace}]`)),console.log(` ${s}`)}else console.log(r.yellow(` Key "${e.key}" not found in namespace "${e.namespace}"`));else console.error(r.red(` \u2717 ${a.error}`)),await o(1)}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("search").description("Search memory by pattern (glob) or semantic query").option("--pattern <glob>",'Glob pattern to match keys (e.g., "auth*")').option("--query <text>","Natural language query (implies --semantic)").option("--semantic","Use HNSW vector search for semantic matching").option("--namespace <ns>","Namespace to search in","default").option("--limit <n>","Maximum results","20").option("--offset <n>","Skip first N results","0").option("--json","Output as JSON").action(async e=>{if(!e.pattern&&!e.query&&(console.error(r.red(" Either --pattern or --query is required")),await o(1)),!!await l())try{let{handleMemoryQuery:t}=await import("./memory-handlers-PC4P4YEF.js"),a=e.query||e.pattern,s=e.semantic||!!e.query,n=await t({pattern:a,namespace:e.namespace,limit:parseInt(e.limit,10),offset:parseInt(e.offset,10),semantic:s});if(e.json)console.log(JSON.stringify(n,null,2));else if(n.success&&n.data){let{entries:y,total:d,searchType:u}=n.data;console.log(r.blue(` ${d} result(s) via ${u} search
|
|
28
28
|
`));for(let m of y){let g=m.score!==void 0?r.gray(` (score: ${m.score.toFixed(3)})`):"";console.log(` ${r.green(m.key)} ${r.gray(`[${m.namespace}]`)}${g}`)}n.data.hasMore&&console.log(r.gray(`
|
|
29
|
-
... and more. Use --offset ${parseInt(e.offset,10)+parseInt(e.limit,10)} to see next page`))}else console.error(r.red(` \u2717 ${n.error}`)),await o(1)}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("list").description("List all memory entries in a namespace").option("--namespace <ns>","Namespace to list","default").option("--limit <n>","Maximum results","50").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryQuery:t}=await import("./memory-handlers-
|
|
29
|
+
... and more. Use --offset ${parseInt(e.offset,10)+parseInt(e.limit,10)} to see next page`))}else console.error(r.red(` \u2717 ${n.error}`)),await o(1)}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("list").description("List all memory entries in a namespace").option("--namespace <ns>","Namespace to list","default").option("--limit <n>","Maximum results","50").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryQuery:t}=await import("./memory-handlers-PC4P4YEF.js"),a=await t({pattern:"*",namespace:e.namespace,limit:parseInt(e.limit,10)});if(e.json)console.log(JSON.stringify(a,null,2));else if(a.success&&a.data){console.log(r.blue(` ${a.data.total} entries in namespace "${e.namespace}"
|
|
30
30
|
`));for(let s of a.data.entries)console.log(` ${r.green(s.key)}`);a.data.hasMore&&console.log(r.gray(`
|
|
31
|
-
... more entries exist. Use --limit to see more.`))}else console.error(r.red(` \u2717 ${a.error}`)),await o(1)}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("delete").description("Delete a memory entry by key").requiredOption("--key <key>","Memory key to delete").option("--namespace <ns>","Namespace","default").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryDelete:t}=await import("./memory-handlers-
|
|
31
|
+
... more entries exist. Use --limit to see more.`))}else console.error(r.red(` \u2717 ${a.error}`)),await o(1)}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("delete").description("Delete a memory entry by key").requiredOption("--key <key>","Memory key to delete").option("--namespace <ns>","Namespace","default").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryDelete:t}=await import("./memory-handlers-PC4P4YEF.js"),a=await t({key:e.key,namespace:e.namespace});e.json?console.log(JSON.stringify(a,null,2)):a.success&&a.data?a.data.deleted?console.log(r.green(` \u2713 Deleted "${e.key}" from namespace "${e.namespace}"`)):console.log(r.yellow(` Key "${e.key}" not found in namespace "${e.namespace}"`)):(console.error(r.red(` \u2717 ${a.error}`)),await o(1))}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("share").description("Share knowledge between agents").requiredOption("--from <agentId>","Source agent ID").requiredOption("--to <agentIds>","Comma-separated target agent IDs").requiredOption("--domain <domain>","Knowledge domain").requiredOption("--content <json>","JSON content to share").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryShare:t}=await import("./memory-handlers-PC4P4YEF.js"),a;try{a=JSON.parse(e.content)}catch{console.error(r.red(" --content must be valid JSON")),await o(1);return}let s=e.to.split(",").map(y=>y.trim()),n=await t({sourceAgentId:e.from,targetAgentIds:s,knowledgeDomain:e.domain,knowledgeContent:a});e.json?console.log(JSON.stringify(n,null,2)):n.success&&n.data?(console.log(r.green(` \u2713 Shared knowledge from ${n.data.sourceAgent} to ${n.data.targetAgents.join(", ")}`)),console.log(r.gray(` Domain: ${n.data.domain}`))):(console.error(r.red(` \u2717 ${n.error}`)),await o(1))}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c.command("usage").description("Show memory usage statistics").option("--json","Output as JSON").action(async e=>{if(await l())try{let{handleMemoryUsage:t}=await import("./memory-handlers-PC4P4YEF.js"),a=await t();e.json?console.log(JSON.stringify(a,null,2)):a.success&&a.data?(console.log(r.blue(` Memory Usage
|
|
32
32
|
`)),console.log(` Entries: ${r.green(String(a.data.entries))}`),console.log(` Vectors: ${r.green(String(a.data.vectors))}`),console.log(` Namespaces: ${r.green(String(a.data.namespaces))}`)):(console.error(r.red(` \u2717 ${a.error}`)),await o(1))}catch(t){console.error(r.red(` Error: ${i(t)}`)),await o(1)}}),c}export{S as createMemoryCommand};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.15");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-BGUCXJEJ.js";import"./chunk-2BBKAX7X.js";import"./chunk-MS6T4VCU.js";import"./chunk-CUQBOVRP.js";export{a as InMemoryBackend};
|