agentic-qe 3.15.16 → 3.15.18
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/helpers/brain-checkpoint.cjs +107 -10
- package/.claude/skills/agentic-quality-engineering/SKILL.md +67 -44
- package/.claude/skills/brutal-honesty-review/SKILL.md +12 -7
- package/.claude/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
- package/.claude/skills/brutal-honesty-review/schemas/output.json +9 -3
- package/.claude/skills/code-review-quality/SKILL.md +2 -2
- package/.claude/skills/holistic-testing-pact/SKILL.md +11 -11
- package/.claude/skills/sherlock-review/SKILL.md +4 -2
- package/.claude/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/technical-writing/SKILL.md +12 -6
- package/.claude/skills/technical-writing/evals/technical-writing.yaml +96 -0
- package/.opencode/skills/qe-agentic-quality-engineering.yaml +2 -2
- package/.opencode/skills/qe-holistic-testing-pact.yaml +2 -2
- package/CHANGELOG.md +201 -0
- package/assets/skills/agentic-quality-engineering/SKILL.md +67 -44
- package/assets/skills/brutal-honesty-review/SKILL.md +12 -8
- package/assets/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
- package/assets/skills/brutal-honesty-review/schemas/output.json +9 -3
- package/assets/skills/code-review-quality/SKILL.md +2 -2
- package/assets/skills/holistic-testing-pact/SKILL.md +11 -11
- package/assets/skills/sherlock-review/SKILL.md +4 -3
- package/assets/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/assets/skills/technical-writing/SKILL.md +12 -6
- package/assets/skills/technical-writing/evals/technical-writing.yaml +96 -0
- package/dist/cli/brain-commands.d.ts +5 -0
- package/dist/cli/brain-commands.js +4 -0
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-WRSDXLOT.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-45NWEKVS.js → agent-booster-wasm-UFNJNF3M.js} +2 -2
- package/dist/cli/chunks/{agent-handler-LVHMYFEF.js → agent-handler-EAYVRJXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-YDWOJFEQ.js → agent-memory-branch-M65C6WAQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-O6NJBCCM.js +2 -0
- package/dist/cli/chunks/{arena-ELDZH3CZ.js → arena-2GDICP6R.js} +4 -4
- package/dist/cli/chunks/{arena-CZKHXDDS.js → arena-CG3X67OE.js} +2 -2
- package/dist/cli/chunks/{audit-5MT4T47Z.js → audit-F4FSPJPL.js} +3 -3
- package/dist/cli/chunks/base-J2FXOE77.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-6TGYPC2B.js → better-sqlite3-2MCFXW4J.js} +2 -2
- package/dist/cli/chunks/brain-handler-WGTJNYNB.js +95 -0
- package/dist/cli/chunks/{branch-enumerator-WVILM4SO.js → branch-enumerator-KL7C535H.js} +2 -2
- package/dist/cli/chunks/{browser-RX5ALU3H.js → browser-SJEXDVHS.js} +2 -2
- package/dist/cli/chunks/browser-workflow-LXGER6ZD.js +2 -0
- package/dist/cli/chunks/{chunk-2H4XH6FT.js → chunk-244RKAEP.js} +2 -2
- package/dist/cli/chunks/{chunk-SI6DPU5D.js → chunk-27TUMXPD.js} +1 -1
- package/dist/cli/chunks/{chunk-YNMJEDN5.js → chunk-2MBYDPCP.js} +2 -2
- package/dist/cli/chunks/{chunk-24QHCVX6.js → chunk-2Q6DTBMT.js} +1 -1
- package/dist/cli/chunks/{chunk-XWUWX7BV.js → chunk-355MI7RV.js} +13 -13
- package/dist/cli/chunks/{chunk-NQXXI77K.js → chunk-3LX5OKBD.js} +2 -2
- package/dist/cli/chunks/{chunk-63GMRQ25.js → chunk-3RPDKJGV.js} +1 -1
- package/dist/cli/chunks/chunk-3YMIT73A.js +4 -0
- package/dist/cli/chunks/{chunk-P3EYRILV.js → chunk-43KUVBSU.js} +2 -2
- package/dist/cli/chunks/chunk-477FKXSS.js +2 -0
- package/dist/cli/chunks/{chunk-HGWXF45W.js → chunk-4BIMTRRX.js} +1 -1
- package/dist/cli/chunks/{chunk-SSUAAX3F.js → chunk-4CVNVBX5.js} +2 -2
- package/dist/cli/chunks/{chunk-5V3TI2LG.js → chunk-4HL3SD4A.js} +1 -1
- package/dist/cli/chunks/{chunk-KKU2QGSJ.js → chunk-4PEG4DU2.js} +2 -2
- package/dist/cli/chunks/{chunk-J4ELZNLY.js → chunk-4QSQKFED.js} +2 -2
- package/dist/cli/chunks/chunk-53ZBETYR.js +16 -0
- package/dist/cli/chunks/{chunk-7TE5ONQQ.js → chunk-544KDWL4.js} +1 -1
- package/dist/cli/chunks/chunk-54RCGMLB.js +8 -0
- package/dist/cli/chunks/{chunk-KU2AUFGX.js → chunk-5AGXIZQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-LQLPB2T6.js → chunk-5M24X6W7.js} +2 -2
- package/dist/cli/chunks/{chunk-YU2BDRSD.js → chunk-5O5T4LEU.js} +1 -1
- package/dist/cli/chunks/{chunk-NAEWCFQT.js → chunk-5RFXX4IF.js} +2 -2
- package/dist/cli/chunks/{chunk-MD43XRX5.js → chunk-62MLAQRJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PEQDY4BO.js → chunk-6D6TGL2E.js} +2 -2
- package/dist/cli/chunks/{chunk-IOYG4VFL.js → chunk-6IHZDSDL.js} +2 -2
- package/dist/cli/chunks/{chunk-C5FP5GW3.js → chunk-6P3Y45QL.js} +2 -2
- package/dist/cli/chunks/{chunk-4LQFBY5L.js → chunk-6TEVM3X3.js} +10 -10
- package/dist/cli/chunks/{chunk-YPBSUGMI.js → chunk-7XTUKKRA.js} +1 -1
- package/dist/cli/chunks/chunk-A3GDX6UF.js +2 -0
- package/dist/cli/chunks/{chunk-HLUXXCHF.js → chunk-A5YTKKNA.js} +1 -1
- package/dist/cli/chunks/{chunk-Y4PFUMOU.js → chunk-ADNGZAT2.js} +1 -1
- package/dist/cli/chunks/{chunk-KNSRL6NO.js → chunk-AWQAE3SW.js} +2 -2
- package/dist/cli/chunks/{chunk-BY5OF7OH.js → chunk-AXDBQFR4.js} +2 -2
- package/dist/cli/chunks/{chunk-525CFDUE.js → chunk-AXVD7O3F.js} +2 -2
- package/dist/cli/chunks/{chunk-JHQCRRJI.js → chunk-B52ULNYO.js} +2 -2
- package/dist/cli/chunks/chunk-B6S4FC7M.js +3 -0
- package/dist/cli/chunks/{chunk-AJMJNQMP.js → chunk-BDVFSMOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-DXD6K2ZP.js → chunk-BGXXMX3Y.js} +2 -2
- package/dist/cli/chunks/{chunk-EK7OLYOZ.js → chunk-BKMQQY5T.js} +2 -2
- package/dist/cli/chunks/{chunk-VWPM27GU.js → chunk-BN2FROBQ.js} +2 -2
- package/dist/cli/chunks/{chunk-J7I6PABJ.js → chunk-BO6EQNOC.js} +2 -2
- package/dist/cli/chunks/{chunk-4D4DENG6.js → chunk-BOVAKCDC.js} +2 -2
- package/dist/cli/chunks/{chunk-ZFL436FN.js → chunk-BSXKZDKO.js} +2 -2
- package/dist/cli/chunks/{chunk-J442IZLE.js → chunk-C5QVJ5XQ.js} +1 -1
- package/dist/cli/chunks/{chunk-ZB3LEFYG.js → chunk-CFQLLF3D.js} +2 -2
- package/dist/cli/chunks/{chunk-UHEOGZLX.js → chunk-DUCVLT3F.js} +7 -7
- package/dist/cli/chunks/{chunk-TVGI32MB.js → chunk-E4RMJCGA.js} +3 -3
- package/dist/cli/chunks/{chunk-TIUKLYAI.js → chunk-EONDCWY4.js} +1 -1
- package/dist/cli/chunks/{chunk-ZJH5MU2I.js → chunk-F4AGNKL2.js} +2 -2
- package/dist/cli/chunks/{chunk-N7HL5PHH.js → chunk-F6YD3BOW.js} +1 -1
- package/dist/cli/chunks/{chunk-5VZL4UVN.js → chunk-FQRS7WVA.js} +2 -2
- package/dist/cli/chunks/{chunk-SHKOCGNK.js → chunk-FT24SSDG.js} +2 -2
- package/dist/cli/chunks/chunk-FV4YNSAJ.js +5 -0
- package/dist/cli/chunks/{chunk-KXCLACFG.js → chunk-FVDM3X42.js} +2 -2
- package/dist/cli/chunks/{chunk-32BPDLRZ.js → chunk-FVH7TXWU.js} +2 -2
- package/dist/cli/chunks/{chunk-72XSEQMW.js → chunk-FWR5QY37.js} +2 -2
- package/dist/cli/chunks/chunk-FYINK2B7.js +6 -0
- package/dist/cli/chunks/{chunk-5JZRZI4S.js → chunk-GGISVPOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-5LAVKGLH.js → chunk-GPIJIZJQ.js} +2 -2
- package/dist/cli/chunks/{chunk-5QO3R3TU.js → chunk-GXEVOT5F.js} +2 -2
- package/dist/cli/chunks/{chunk-IHRXZZQM.js → chunk-GZ4VB5RI.js} +1 -1
- package/dist/cli/chunks/chunk-HBDSCYSK.js +2 -0
- package/dist/cli/chunks/{chunk-GSKMOPL7.js → chunk-HGG4HR7C.js} +2 -2
- package/dist/cli/chunks/{chunk-AR67RJPY.js → chunk-HSCKWWO2.js} +2 -2
- package/dist/cli/chunks/{chunk-6XXZDV2C.js → chunk-HSQ3GUYJ.js} +2 -2
- package/dist/cli/chunks/{chunk-AAMLQ2LF.js → chunk-HZQBW5EM.js} +3 -3
- package/dist/cli/chunks/{chunk-O5W3FIO6.js → chunk-IGIYANVT.js} +2 -2
- package/dist/cli/chunks/{chunk-C6D5AHBO.js → chunk-IPWMSXBF.js} +2 -2
- package/dist/cli/chunks/{chunk-NDJ7P2EP.js → chunk-IWVNC7VY.js} +1 -1
- package/dist/cli/chunks/{chunk-FDDC72IA.js → chunk-IZODXKZD.js} +2 -2
- package/dist/cli/chunks/{chunk-NO3IV5Q5.js → chunk-J2MT2OJV.js} +1 -1
- package/dist/cli/chunks/{chunk-GQ6TUIKY.js → chunk-JKIJVVSP.js} +1 -1
- package/dist/cli/chunks/{chunk-LE4QJREF.js → chunk-JMRDT2XK.js} +1 -1
- package/dist/cli/chunks/{chunk-2YZ4G6NW.js → chunk-JR2UMTKG.js} +1 -1
- package/dist/cli/chunks/{chunk-RJIEG3NA.js → chunk-K6CH4CFF.js} +2 -2
- package/dist/cli/chunks/{chunk-5NNNEWLS.js → chunk-K7KW5QB5.js} +81 -88
- package/dist/cli/chunks/chunk-KFCQP434.js +2 -0
- package/dist/cli/chunks/{chunk-A5GBXCP5.js → chunk-KH4T6STG.js} +2 -2
- package/dist/cli/chunks/{chunk-VMDFFTCK.js → chunk-KJBYZO57.js} +1 -1
- package/dist/cli/chunks/{chunk-GJYHWYXR.js → chunk-KP4OKOKV.js} +2 -2
- package/dist/cli/chunks/chunk-L2MBKVSE.js +2 -0
- package/dist/cli/chunks/{chunk-XIQW7EFL.js → chunk-L3IPUIT3.js} +2 -2
- package/dist/cli/chunks/{chunk-W5HQUIML.js → chunk-L7PSU2YN.js} +2 -2
- package/dist/cli/chunks/{chunk-6DPYNAOK.js → chunk-LA3JPGQA.js} +2 -2
- package/dist/cli/chunks/{chunk-5PBLPQ5T.js → chunk-LC2QRN7V.js} +14 -13
- package/dist/cli/chunks/{chunk-SSYAQZXA.js → chunk-LHY7TMTM.js} +2 -2
- package/dist/cli/chunks/{chunk-QQWBWEJS.js → chunk-LLQ2UMF6.js} +3 -3
- package/dist/cli/chunks/{chunk-DTMAS2GB.js → chunk-LOJ7OO6W.js} +2 -2
- package/dist/cli/chunks/{chunk-32GN3JKR.js → chunk-LPUSH3VF.js} +1 -1
- package/dist/cli/chunks/{chunk-SDLWKRVL.js → chunk-LSEC2BU7.js} +2 -2
- package/dist/cli/chunks/{chunk-IOKYCMTJ.js → chunk-LTGB7OIU.js} +2 -2
- package/dist/cli/chunks/{chunk-6ZBXSOX6.js → chunk-LUG7YNVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-CAKMOVZ6.js → chunk-LWAFRYKE.js} +2 -2
- package/dist/cli/chunks/{chunk-FLNAW7C4.js → chunk-M24ZAZ4U.js} +2 -2
- package/dist/cli/chunks/{chunk-L2DWPVNJ.js → chunk-MKRKRXTX.js} +1 -1
- package/dist/cli/chunks/{chunk-YTHTQPWR.js → chunk-MNNLONAD.js} +1 -1
- package/dist/cli/chunks/{chunk-V5NHZV7S.js → chunk-MQM37KAR.js} +2 -2
- package/dist/cli/chunks/{chunk-PPUZWYUG.js → chunk-MSX2OHYT.js} +2 -2
- package/dist/cli/chunks/{chunk-YRAX7SFJ.js → chunk-MVYQRVLP.js} +2 -2
- package/dist/cli/chunks/{chunk-QVDCVD5D.js → chunk-MZC5WM2P.js} +2 -2
- package/dist/cli/chunks/{chunk-S75SOOZL.js → chunk-MZRBNBB3.js} +2 -2
- package/dist/cli/chunks/{chunk-FL64OUBA.js → chunk-N3KQU4UC.js} +2 -2
- package/dist/cli/chunks/{chunk-G5RHFBAY.js → chunk-NKU3FFM4.js} +2 -2
- package/dist/cli/chunks/chunk-O5EWFR76.js +2 -0
- package/dist/cli/chunks/{chunk-63ZKI4PX.js → chunk-O5RDHD5T.js} +2 -2
- package/dist/cli/chunks/chunk-O6UWIXME.js +3 -0
- package/dist/cli/chunks/{chunk-HCH4Y6XX.js → chunk-OA4EQDC4.js} +2 -2
- package/dist/cli/chunks/{chunk-QPEOLAAS.js → chunk-OBCXCRXK.js} +1 -1
- package/dist/cli/chunks/{chunk-6ICX3FEG.js → chunk-OHU5P25N.js} +22 -22
- package/dist/cli/chunks/{chunk-GFWHUQSF.js → chunk-OOSV2RIA.js} +2 -2
- package/dist/cli/chunks/{chunk-MO55CVMT.js → chunk-OW23N2Y5.js} +14 -14
- package/dist/cli/chunks/{chunk-M7WJCTG3.js → chunk-OXOO3YDL.js} +2 -2
- package/dist/cli/chunks/{chunk-KQYJ4VQ5.js → chunk-OYGKSSSI.js} +1 -1
- package/dist/cli/chunks/chunk-PGO46IIW.js +2 -0
- package/dist/cli/chunks/{chunk-NVEWF4JV.js → chunk-PZOYQHWS.js} +1 -1
- package/dist/cli/chunks/{chunk-IESR7TNB.js → chunk-Q2BZSG7Z.js} +2 -2
- package/dist/cli/chunks/{chunk-XIIQ5QTT.js → chunk-Q7V722K5.js} +2 -2
- package/dist/cli/chunks/{chunk-F742SZAX.js → chunk-QZU6M5IO.js} +2 -2
- package/dist/cli/chunks/{chunk-PINSJCM3.js → chunk-R55Y76SJ.js} +1 -1
- package/dist/cli/chunks/{chunk-5B5QPCNU.js → chunk-RMEQYJPU.js} +4 -4
- package/dist/cli/chunks/{chunk-ZQ2XW3IP.js → chunk-RTYXFXTI.js} +2 -2
- package/dist/cli/chunks/{chunk-DVYHMDFR.js → chunk-SJF3O4FX.js} +374 -371
- package/dist/cli/chunks/{chunk-AG2EWGXS.js → chunk-SOUS7Z2H.js} +2 -2
- package/dist/cli/chunks/{chunk-3HD7E6HN.js → chunk-SRVNR3R3.js} +2 -2
- package/dist/cli/chunks/{chunk-KITOPKRG.js → chunk-SU3SXMVG.js} +2 -2
- package/dist/cli/chunks/chunk-SWGPLXWW.js +32 -0
- package/dist/cli/chunks/{chunk-ZR2TKVXQ.js → chunk-TRB3EVH3.js} +2 -2
- package/dist/cli/chunks/{chunk-OCV2XEWQ.js → chunk-TVBDUMKT.js} +2 -2
- package/dist/cli/chunks/{chunk-IOQ6ZQ5W.js → chunk-TWTXPSFU.js} +1 -1
- package/dist/cli/chunks/{chunk-CJSHWQXP.js → chunk-ULYUVUL2.js} +2 -2
- package/dist/cli/chunks/{chunk-PHT5N7SC.js → chunk-UNTBVJ5X.js} +2 -2
- package/dist/cli/chunks/{chunk-LKTTUHLF.js → chunk-UQAA4PHU.js} +2 -2
- package/dist/cli/chunks/{chunk-SR52XP5F.js → chunk-UWSJVKTE.js} +1 -1
- package/dist/cli/chunks/{chunk-L6QSTQME.js → chunk-V2LJ54KP.js} +2 -2
- package/dist/cli/chunks/{chunk-FBDVGRSC.js → chunk-VCCTTKP3.js} +7 -7
- package/dist/cli/chunks/{chunk-YLMNVLDK.js → chunk-VEGUYUVS.js} +1 -1
- package/dist/cli/chunks/{chunk-ASEOFRIG.js → chunk-VUQPVWNK.js} +2 -2
- package/dist/cli/chunks/{chunk-VXFLJNCA.js → chunk-VVGUE2T2.js} +2 -2
- package/dist/cli/chunks/{chunk-4NFQLP6R.js → chunk-W5ASDHJQ.js} +1 -1
- package/dist/cli/chunks/{chunk-I7MQIM2U.js → chunk-WGXT5NWQ.js} +1 -1
- package/dist/cli/chunks/chunk-WJN3V7QB.js +7 -0
- package/dist/cli/chunks/chunk-WPCRQIIF.js +29 -0
- package/dist/cli/chunks/{chunk-SASBO5Y5.js → chunk-WQNLXUWA.js} +6 -6
- package/dist/cli/chunks/{chunk-5SPCGMBB.js → chunk-WZVRMKG2.js} +2 -2
- package/dist/cli/chunks/{chunk-MI5MFHRA.js → chunk-X27IUWTD.js} +2 -2
- package/dist/cli/chunks/{chunk-HJ6ZGVTB.js → chunk-X4B345B6.js} +2 -2
- package/dist/cli/chunks/{chunk-HVRRLYX6.js → chunk-X5I2Y4VO.js} +2 -2
- package/dist/cli/chunks/{chunk-SUDMM5SO.js → chunk-X7IQIFTS.js} +2 -2
- package/dist/cli/chunks/chunk-XJN3RKUD.js +3 -0
- package/dist/cli/chunks/{chunk-E3D4GPLP.js → chunk-XQMGXTHJ.js} +3 -3
- package/dist/cli/chunks/{chunk-67Z5R7RJ.js → chunk-XTSAMB2Q.js} +2 -2
- package/dist/cli/chunks/{chunk-KVF4NXGQ.js → chunk-XZLIF4O2.js} +2 -2
- package/dist/cli/chunks/{chunk-EA4YQVKS.js → chunk-Y4LSEOZ3.js} +1 -1
- package/dist/cli/chunks/{chunk-OAEE6JWQ.js → chunk-Y4YN2RXR.js} +2 -2
- package/dist/cli/chunks/{chunk-CEYSYSK5.js → chunk-YDI56L35.js} +2 -2
- package/dist/cli/chunks/{chunk-JDIYMZCQ.js → chunk-YFILS5D5.js} +2 -2
- package/dist/cli/chunks/{chunk-GAHNO6JJ.js → chunk-YISDX6WB.js} +2 -2
- package/dist/cli/chunks/{chunk-AGRV5B3T.js → chunk-YP2GHQSV.js} +2 -2
- package/dist/cli/chunks/{chunk-UNGBRZDK.js → chunk-YSX756AM.js} +4 -4
- package/dist/cli/chunks/{chunk-BEKDKVQT.js → chunk-YWANOASW.js} +2 -2
- package/dist/cli/chunks/{chunk-JQ3DYUMS.js → chunk-YYIJLG7S.js} +2 -2
- package/dist/cli/chunks/{chunk-CRPIYUTJ.js → chunk-Z7SD7LXM.js} +2 -2
- package/dist/cli/chunks/{chunk-U2A7NHZA.js → chunk-ZDWD73UF.js} +2 -2
- package/dist/cli/chunks/{chunk-WP4RETKG.js → chunk-ZFT3RLA4.js} +2 -2
- package/dist/cli/chunks/{chunk-VJCIEHEF.js → chunk-ZNTHX5G3.js} +1 -1
- package/dist/cli/chunks/{chunk-PF7RBAYL.js → chunk-ZS27R7VL.js} +2 -2
- package/dist/cli/chunks/{chunk-24OX5TQJ.js → chunk-ZXHHHR7K.js} +1 -1
- package/dist/cli/chunks/{ci-MFUR4CWV.js → ci-N5MOMNXH.js} +2 -2
- package/dist/cli/chunks/{ci-config-PNDLQ6XV.js → ci-config-6L2ROQCW.js} +2 -2
- package/dist/cli/chunks/{ci-output-PFZ4M7NC.js → ci-output-DSRBYEIK.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-5HH6NLZN.js → circuit-breaker-VRPTNBL7.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-QCKYLGLC.js → claude-flow-setup-4YFG3FU5.js} +2 -2
- package/dist/cli/chunks/client-I3L6BKRQ.js +2 -0
- package/dist/cli/chunks/{cline-installer-EASVPFXR.js → cline-installer-7RGYJWGN.js} +2 -2
- package/dist/cli/chunks/{code-UJXDVYRK.js → code-ISC6NW2K.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-BZJ3UDP4.js → code-index-extractor-2FID75YV.js} +2 -2
- package/dist/cli/chunks/{codex-installer-XSQZUVOZ.js → codex-installer-DZ7OG6KM.js} +2 -2
- package/dist/cli/chunks/{completions-OWOOJFI2.js → completions-SM3LICWK.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-KP5TOHDT.js → complexity-analyzer-ZWD2CTAD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-IFKQXLHM.js → continuedev-installer-AGASOA26.js} +2 -2
- package/dist/cli/chunks/copilot-installer-CLPZYTQC.js +3 -0
- package/dist/cli/chunks/core-handlers-5EFOJ37H.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MMDDNKZB.js → cost-tracker-7PIGQYDV.js} +2 -2
- package/dist/cli/chunks/{coverage-LUH2B7NT.js → coverage-T2GEBTYS.js} +9 -9
- package/dist/cli/chunks/cross-domain-router-65WJAKVD.js +2 -0
- package/dist/cli/chunks/{cursor-installer-4YLM5GWM.js → cursor-installer-KXBID4MB.js} +2 -2
- package/dist/cli/chunks/daemon-43MXIVH3.js +18 -0
- package/dist/cli/chunks/{daemon-MZKVM4CJ.js → daemon-VAMJLQJ5.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-X4CYW665.js → dag-attention-scheduler-UBP4VHTA.js} +2 -2
- package/dist/cli/chunks/{detect-7BM2XINO.js → detect-QWFIQRKI.js} +2 -2
- package/dist/cli/chunks/{dist-node-Y5APLEYB.js → dist-node-I2GICS3W.js} +2 -2
- package/dist/cli/chunks/{domain-handler-X3ZRJNAH.js → domain-handler-Z66ISB2A.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-2UW5KQJB.js → domain-plugins-KHMD3FKT.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-35W4CIBV.js → domain-transfer-JWGNNA6K.js} +2 -2
- package/dist/cli/chunks/dream-VQ2PZCVR.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-F5P5B6JX.js +3 -0
- package/dist/cli/chunks/{embedding-space-SBM2MZD2.js → embedding-space-KHG6TITM.js} +2 -2
- package/dist/cli/chunks/{eval-4QA2SROK.js → eval-43OHU7EI.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-Z6BF6KYM.js → experience-capture-middleware-KXD47H6P.js} +3 -3
- package/dist/cli/chunks/{fast-paths-FIORX6GN.js → fast-paths-6D75D5KD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-6LYI2T4G.js → feature-flags-IE35Y55N.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ZOO7LMIC.js → feature-flags-OYYHY7LS.js} +2 -2
- package/dist/cli/chunks/file-discovery-LGBTY3ID.js +2 -0
- package/dist/cli/chunks/{fleet-7WF53H4F.js → fleet-AGVJMFGD.js} +16 -16
- package/dist/cli/chunks/{gnn-wrapper-KJ6B7BRM.js → gnn-wrapper-5L66A7LW.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-DEKKMOVW.js → heartbeat-handler-2BY6YYOT.js} +5 -5
- package/dist/cli/chunks/heartbeat-scheduler-3DU3M5AT.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-N2IMSRPV.js +2 -0
- package/dist/cli/chunks/hnsw-index-DVU7TTJE.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-L27WS27N.js → hnsw-legacy-bridge-RYMWFNAH.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-4YOQC6L4.js → hnswlib-node-GG47HP2P.js} +2 -2
- package/dist/cli/chunks/{hooks-TAOKV4EJ.js → hooks-FQNACS24.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-AS2PNHOD.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-BODRJLHL.js → hypergraph-engine-6BYNJQEP.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-RKMYJNTU.js → hypergraph-handler-CYTAXZKJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-Y4OONLFP.js +2 -0
- package/dist/cli/chunks/{init-guard-MXHSLSB2.js → init-guard-METTAV5O.js} +2 -2
- package/dist/cli/chunks/{init-handler-HUE57IFW.js → init-handler-GFT74U5Y.js} +6 -6
- package/dist/cli/chunks/init-wizard-HLNUBJQN.js +2 -0
- package/dist/cli/chunks/kernel-XKFWCL7Y.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-S333IKYQ.js → kilocode-installer-GZV2D3FF.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-WM5DLQWC.js → kiro-installer-Q4ZXUFC7.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-CNL77CSZ.js +2 -0
- package/dist/cli/chunks/{learning-LNHMQLH5.js → learning-WA2QEYL7.js} +35 -34
- package/dist/cli/chunks/{llm-router-EWFXYZZR.js → llm-router-GRTCHWH7.js} +4 -4
- package/dist/cli/chunks/llm-router-service-UIYTYKP6.js +2 -0
- package/dist/cli/chunks/{load-FGYGWVDK.js → load-WXN3Q7Y5.js} +2 -2
- package/dist/cli/chunks/load-test-PXLW4A5B.js +2 -0
- package/dist/cli/chunks/{mcp-2FHNAAOM.js → mcp-LIQCPSJN.js} +2 -2
- package/dist/cli/chunks/{memory-DZMQ73AB.js → memory-OP6CHRFH.js} +5 -5
- package/dist/cli/chunks/memory-backend-XYOSO73Q.js +2 -0
- package/dist/cli/chunks/memory-handlers-PQFYVNVG.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-6F2UAEUW.js → multi-model-executor-H54DEVRZ.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-XY3BGOTZ.js → opencode-installer-BSQV6UAT.js} +2 -2
- package/dist/cli/chunks/{orchestrator-B4CNKUOS.js → orchestrator-TJDPQ4VL.js} +122 -35
- package/dist/cli/chunks/pattern-null-store-BKGTQFNF.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-R4GUFNMD.js → pattern-usage-recorder-FOVS4M5L.js} +2 -2
- package/dist/cli/chunks/{pipeline-FG5RKVRO.js → pipeline-4AY2ZIC6.js} +2 -2
- package/dist/cli/chunks/{platform-3BT4KEVJ.js → platform-FCSITYMR.js} +2 -2
- package/dist/cli/chunks/{plugin-WI4RIN7O.js → plugin-E56TV5S2.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7ECDNQFS.js → prime-radiant-advanced-wasm-ACOPC533.js} +2 -2
- package/dist/cli/chunks/project-root-MPX7CN2C.js +2 -0
- package/dist/cli/chunks/protocol-executor-CRQOCC4A.js +2 -0
- package/dist/cli/chunks/{protocol-handler-WNODKPGW.js → protocol-handler-KRVXF4LS.js} +2 -2
- package/dist/cli/chunks/{prove-5RHAEPYZ.js → prove-KMFPSKGD.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-UEGQ3O7F.js +2 -0
- package/dist/cli/chunks/{quality-WPHR7BGQ.js → quality-6DBI3HLB.js} +2 -2
- package/dist/cli/chunks/{quality-gate-4RKTEZMX.js → quality-gate-3ROZMEIL.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-32574XSG.js +2 -0
- package/dist/cli/chunks/real-embeddings-MIGZNKK3.js +2 -0
- package/dist/cli/chunks/{ref-validation-TPAWHOHH.js → ref-validation-EYIP7DHW.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-7AVHFNDI.js → roocode-installer-IGGZHR2Y.js} +2 -2
- package/dist/cli/chunks/router-CZJY5WX6.js +2 -0
- package/dist/cli/chunks/routing-feedback-RC3UBNFX.js +2 -0
- package/dist/cli/chunks/{routing-handler-YKEDVJSH.js → routing-handler-BWNHBYDC.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-JUAMM354.js → ruvector-commands-PXIHF432.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-OG7OV2AK.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-THYMW7ZO.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-3H6CLFU7.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-6JQJIKKW.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-VJDUIRTX.js → rvf-store-integrity-CVB3NMSL.js} +2 -2
- package/dist/cli/chunks/safe-db-QFKCVTIJ.js +2 -0
- package/dist/cli/chunks/schedule-6JLVMMYB.js +2 -0
- package/dist/cli/chunks/scheduler-3MPZRMJD.js +2 -0
- package/dist/cli/chunks/{security-ORDN3RD2.js → security-DCRGOTWU.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-CF4BCIO7.js → shared-rvf-adapter-GKD74QUB.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-C32UBR6D.js → shared-rvf-dual-writer-HVAAVEOH.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-LGTIKAEX.js +2 -0
- package/dist/cli/chunks/{standalone-memory-OXRJYZXN.js → standalone-memory-O7O2U5N4.js} +2 -2
- package/dist/cli/chunks/{status-handler-BCX5D4HY.js → status-handler-BQTPJJTL.js} +2 -2
- package/dist/cli/chunks/{structural-health-LFG7RUU6.js → structural-health-4H6J4OHK.js} +2 -2
- package/dist/cli/chunks/sync-DJ4TF6QX.js +2 -0
- package/dist/cli/chunks/{sync-YJEE2K2L.js → sync-WW5TAVYW.js} +2 -2
- package/dist/cli/chunks/{task-handler-6LXKPTXJ.js → task-handler-HEM4IEOW.js} +2 -2
- package/dist/cli/chunks/{task-handlers-CILP36I7.js → task-handlers-JRA3NXIR.js} +3 -3
- package/dist/cli/chunks/test-772ZXVG2.js +34 -0
- package/dist/cli/chunks/test-runner-process-XGF2U3NG.js +2 -0
- package/dist/cli/chunks/{test-scheduling-ISI2O4Q5.js → test-scheduling-4TRB7LZ7.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-CICBIJ7T.js +2 -0
- package/dist/cli/chunks/{token-usage-XOC5KG7S.js → token-usage-B7PEKE2G.js} +2 -2
- package/dist/cli/chunks/{transformers-LSLQAARK.js → transformers-V7X7BDZX.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-OXPFKFZS.js +2 -0
- package/dist/cli/chunks/{types-5BLCGLCR.js → types-AHHTUY3I.js} +2 -2
- package/dist/cli/chunks/unified-memory-GUR3IUI6.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-NJP2F2RY.js +2 -0
- package/dist/cli/chunks/unified-persistence-NILBWXDP.js +2 -0
- package/dist/cli/chunks/{upgrade-RQJYLK3J.js → upgrade-DZ4DLUQ5.js} +2 -2
- package/dist/cli/chunks/{validate-QBHWXXCK.js → validate-4DTLIDJE.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-IKXBKFB5.js → validate-swarm-A26UFVIS.js} +2 -2
- package/dist/cli/chunks/visual-security-YECYZ27X.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-ZF6FIE5R.js → web-tree-sitter-F2C7QRYT.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-HQGDZT5D.js → windsurf-installer-OOBTDA6W.js} +2 -2
- package/dist/cli/chunks/{witness-chain-DCHCAMSQ.js → witness-chain-KGFZJP32.js} +2 -2
- package/dist/cli/chunks/witness-chain-LYBXFLJB.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-CNTXOGPN.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-PX2OQ6XT.js → witness-chain-verifier-OB7ZZOI3.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-RXYQNFJB.js → witness-key-manager-YCKGKGQI.js} +2 -2
- package/dist/cli/chunks/{workflow-FBKCA4H6.js → workflow-PRERHWKY.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-UIBGWCU3.js +2 -0
- package/dist/cli/chunks/wrappers-L4UY4V63.js +2 -0
- package/dist/cli/commands/coverage.js +4 -1
- package/dist/cli/commands/learning-prune.js +9 -1
- package/dist/cli/commands/test.js +26 -4
- package/dist/cli/handlers/brain-handler.js +32 -2
- package/dist/cli/handlers/heartbeat-handler.js +3 -1
- package/dist/cli/utils/coverage-data.js +5 -1
- package/dist/cli/utils/coverage-verdict.d.ts +10 -2
- package/dist/cli/utils/coverage-verdict.js +23 -8
- package/dist/cli/utils/fleet-operation.js +9 -3
- package/dist/coordination/handlers/code-intelligence-handlers.js +17 -3
- package/dist/coordination/handlers/coverage-handlers.js +22 -9
- package/dist/coordination/handlers/coverage-target.d.ts +22 -2
- package/dist/coordination/handlers/coverage-target.js +45 -9
- package/dist/coordination/handlers/handler-utils.d.ts +19 -0
- package/dist/coordination/handlers/handler-utils.js +22 -8
- package/dist/coordination/handlers/test-execution-handlers.js +64 -20
- package/dist/coordination/protocols/code-intelligence-index.js +6 -3
- package/dist/coordination/protocols/learning-consolidation-archive.d.ts +6 -3
- package/dist/coordination/protocols/learning-consolidation-archive.js +4 -3
- package/dist/coordination/workflow-builtin.js +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +8 -3
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +39 -25
- package/dist/domains/code-intelligence/services/text-relevance.d.ts +32 -0
- package/dist/domains/code-intelligence/services/text-relevance.js +63 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts +2 -0
- package/dist/domains/defect-intelligence/prediction-history.d.ts +15 -1
- package/dist/domains/defect-intelligence/prediction-history.js +63 -7
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +33 -13
- package/dist/domains/learning-optimization/coordinator.js +17 -10
- package/dist/domains/learning-optimization/domain-ranking.d.ts +26 -0
- package/dist/domains/learning-optimization/domain-ranking.js +28 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +5 -0
- package/dist/domains/learning-optimization/pattern-archive.d.ts +55 -8
- package/dist/domains/learning-optimization/pattern-archive.js +90 -17
- package/dist/domains/learning-optimization/pattern-consolidation.js +18 -2
- package/dist/domains/learning-optimization/pattern-merge.d.ts +26 -0
- package/dist/domains/learning-optimization/pattern-merge.js +127 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +21 -35
- package/dist/domains/test-execution/coordinator.d.ts +3 -1
- package/dist/domains/test-execution/coordinator.js +13 -4
- package/dist/domains/test-execution/interfaces.d.ts +5 -0
- package/dist/domains/test-execution/plugin.js +2 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts +9 -1
- package/dist/domains/test-execution/services/flaky-detector.js +26 -8
- package/dist/domains/test-execution/services/retry-handler.d.ts +7 -1
- package/dist/domains/test-execution/services/retry-handler.js +44 -5
- package/dist/domains/test-execution/services/runner-test-cases.d.ts +2 -0
- package/dist/domains/test-execution/services/runner-test-cases.js +7 -3
- package/dist/domains/test-execution/services/test-executor.d.ts +5 -1
- package/dist/domains/test-execution/services/test-executor.js +85 -17
- package/dist/init/copilot-installer.d.ts +6 -0
- package/dist/init/copilot-installer.js +37 -17
- package/dist/init/init-wizard-steps.js +3 -1
- package/dist/init/phases/07-hooks.js +97 -10
- package/dist/init/platform-config-generator.d.ts +10 -0
- package/dist/init/platform-config-generator.js +26 -1
- package/dist/integrations/embeddings/cache/EmbeddingCache.js +1 -1
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +16 -1
- package/dist/integrations/ruvector/brain-rvf-exporter.js +18 -32
- package/dist/integrations/ruvector/brain-rvf-richness.d.ts +75 -0
- package/dist/integrations/ruvector/brain-rvf-richness.js +127 -0
- package/dist/kernel/unified-memory-migration.js +1 -1
- package/dist/kernel/unified-memory.d.ts +8 -0
- package/dist/kernel/unified-memory.js +13 -0
- package/dist/learning/checkpoint-shrink-ack.d.ts +25 -0
- package/dist/learning/checkpoint-shrink-ack.js +57 -0
- package/dist/learning/dream/dream-engine.d.ts +44 -3
- package/dist/learning/dream/dream-engine.js +6 -2
- package/dist/learning/embedder-endpoint-client.d.ts +45 -0
- package/dist/learning/embedder-endpoint-client.js +98 -3
- package/dist/learning/embedder-identity-store.js +3 -1
- package/dist/learning/embedding-space-legacy-adoption.d.ts +53 -0
- package/dist/learning/embedding-space-legacy-adoption.js +115 -0
- package/dist/learning/embedding-space-registry.d.ts +90 -0
- package/dist/learning/embedding-space-registry.js +181 -0
- package/dist/learning/experience-capture.d.ts +3 -1
- package/dist/learning/experience-capture.js +15 -5
- package/dist/learning/experience-space-verification.d.ts +2 -0
- package/dist/learning/experience-space-verification.js +3 -2
- package/dist/learning/learning-retention.js +4 -0
- package/dist/learning/pattern-promotion.d.ts +7 -0
- package/dist/learning/pattern-promotion.js +64 -12
- package/dist/learning/real-embeddings.d.ts +3 -0
- package/dist/learning/real-embeddings.js +73 -11
- package/dist/learning/rvf-pattern-store.js +6 -1
- package/dist/mcp/bundle.js +558 -537
- package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
- package/dist/mcp/handlers/domain-handler-configs.js +1 -0
- package/dist/mcp/handlers/heartbeat-handlers.d.ts +4 -2
- package/dist/mcp/protocol-server.js +1 -1
- package/dist/mcp/tools/learning-optimization/optimize.d.ts +6 -1
- package/dist/mcp/tools/learning-optimization/optimize.js +20 -11
- package/dist/planning/goap-planner.js +4 -0
- package/dist/planning/plan-executor.js +6 -2
- package/dist/shared/embeddings/index.d.ts +2 -2
- package/dist/shared/embeddings/index.js +1 -1
- package/dist/shared/embeddings/nomic-embedder.d.ts +8 -2
- package/dist/shared/embeddings/nomic-embedder.js +19 -11
- package/dist/shared/embeddings/ollama-client.d.ts +28 -2
- package/dist/shared/embeddings/ollama-client.js +84 -22
- package/dist/shared/embeddings/types.d.ts +15 -0
- package/dist/shared/embeddings/types.js +4 -0
- package/dist/shared/git/git-analyzer.d.ts +30 -11
- package/dist/shared/git/git-analyzer.js +95 -48
- package/dist/shared/io/confined-read.d.ts +32 -7
- package/dist/shared/io/confined-read.js +58 -25
- package/dist/shared/io/file-reader.js +4 -1
- package/dist/shared/pytest-junit-report.d.ts +93 -0
- package/dist/shared/pytest-junit-report.js +241 -0
- package/dist/shared/safe-db.d.ts +1 -1
- package/dist/shared/safe-db.js +20 -5
- package/dist/shared/sqlite-journal-mode.d.ts +39 -0
- package/dist/shared/sqlite-journal-mode.js +53 -0
- package/dist/shared/test-runner-project.d.ts +51 -1
- package/dist/shared/test-runner-project.js +140 -25
- package/dist/sync/claude-flow-bridge.js +1 -1
- package/dist/sync/readers/sqlite-reader.js +3 -4
- package/dist/sync/writers/sqlite-writer.js +1 -1
- package/dist/workers/interfaces.d.ts +2 -2
- package/dist/workers/quality-daemon/git-watcher.d.ts +8 -0
- package/dist/workers/quality-daemon/git-watcher.js +54 -12
- package/dist/workers/quality-daemon/index.js +1 -1
- package/dist/workers/quality-daemon/priority-queue.d.ts +2 -1
- package/dist/workers/workers/defect-predictor.d.ts +9 -4
- package/dist/workers/workers/defect-predictor.js +98 -37
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-6CQ2PIP5.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +0 -2
- package/dist/cli/chunks/base-SMCMMVGP.js +0 -2
- package/dist/cli/chunks/brain-handler-HQWZFO52.js +0 -95
- package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +0 -2
- package/dist/cli/chunks/chunk-CGGUM2YJ.js +0 -3
- package/dist/cli/chunks/chunk-D6COXLYE.js +0 -8
- package/dist/cli/chunks/chunk-EGYE5UPQ.js +0 -2
- package/dist/cli/chunks/chunk-IUBJVHNB.js +0 -3
- package/dist/cli/chunks/chunk-KL7OKSU2.js +0 -4
- package/dist/cli/chunks/chunk-KPRCB5LT.js +0 -7
- package/dist/cli/chunks/chunk-LRSX2FJM.js +0 -2
- package/dist/cli/chunks/chunk-M4FRQ4TE.js +0 -12
- package/dist/cli/chunks/chunk-MAFQV4U4.js +0 -16
- package/dist/cli/chunks/chunk-NZU4ACBZ.js +0 -2
- package/dist/cli/chunks/chunk-RV74I3YO.js +0 -3
- package/dist/cli/chunks/chunk-SJ6Y4725.js +0 -5
- package/dist/cli/chunks/chunk-UE5ZOZR2.js +0 -2
- package/dist/cli/chunks/chunk-VSIKHWZ4.js +0 -29
- package/dist/cli/chunks/chunk-YAPLJR7K.js +0 -2
- package/dist/cli/chunks/client-MHQRTZM4.js +0 -2
- package/dist/cli/chunks/copilot-installer-IGJ6KGQY.js +0 -3
- package/dist/cli/chunks/core-handlers-UAK3LLJE.js +0 -2
- package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +0 -2
- package/dist/cli/chunks/daemon-CAVZ7OFV.js +0 -18
- package/dist/cli/chunks/dream-EJY24JN6.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +0 -3
- package/dist/cli/chunks/file-discovery-UZSFSS4V.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +0 -2
- package/dist/cli/chunks/hnsw-index-POCPMVJH.js +0 -2
- package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +0 -2
- package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +0 -2
- package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +0 -2
- package/dist/cli/chunks/kernel-CCDWT7KS.js +0 -2
- package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +0 -2
- package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +0 -2
- package/dist/cli/chunks/load-test-UNZUWY3F.js +0 -2
- package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +0 -2
- package/dist/cli/chunks/memory-handlers-MP426XRJ.js +0 -2
- package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +0 -2
- package/dist/cli/chunks/project-root-BEANNYWU.js +0 -2
- package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +0 -2
- package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +0 -2
- package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +0 -2
- package/dist/cli/chunks/router-EP34O3KB.js +0 -2
- package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +0 -2
- package/dist/cli/chunks/safe-db-TCAU4FUT.js +0 -2
- package/dist/cli/chunks/schedule-NB5KV435.js +0 -2
- package/dist/cli/chunks/scheduler-JKXGKVK6.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +0 -2
- package/dist/cli/chunks/sync-OSF7C2NL.js +0 -2
- package/dist/cli/chunks/test-SD457QJ6.js +0 -34
- package/dist/cli/chunks/test-runner-process-VKD65QQU.js +0 -2
- package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +0 -2
- package/dist/cli/chunks/unified-memory-GI76TXFV.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +0 -2
- package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +0 -2
- package/dist/cli/chunks/visual-security-GZ2MOKWB.js +0 -2
- package/dist/cli/chunks/witness-chain-P3XXXA62.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +0 -2
- package/dist/cli/chunks/wrappers-TWSKBTWD.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as o}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as o}from"./chunk-BDVFSMOQ.js";function c(e,t){u.set(e,t)}function l(e){u.delete(e)}function s(e,t){let n=e!=null?u.get(e):void 0;return n?n(t):new Promise(r=>r(t()))}var u,i=o(()=>{"use strict";u=new WeakMap});export{c as a,l as b,s as c,i as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as T}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as T}from"./chunk-X7IQIFTS.js";import{a as M}from"./chunk-YYIJLG7S.js";import{i as b}from"./chunk-4BIMTRRX.js";import{C as q}from"./chunk-OW23N2Y5.js";import{c as _}from"./chunk-YP2GHQSV.js";import{a as h,e as x}from"./chunk-AWQAE3SW.js";var R=Object.freeze({readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0}),P=["accessibility_test","advisor_consult","agent_complete","agent_list","agent_metrics","agent_spawn","agent_status","aqe_health","chaos_test","code_index","contract_validate","coverage_analyze_sublinear","cross_phase_cleanup","cross_phase_query","cross_phase_stats","cross_phase_store","defect_predict","fleet_health","fleet_init","fleet_status","format_signals","infra_healing_feed_output","infra_healing_recover","infra_healing_status","memory_delete","memory_query","memory_retrieve","memory_share","memory_store","memory_usage","migration_check","migration_promote","migration_status","model_route","phase_end","phase_start","pipeline_list","pipeline_load","pipeline_approve","pipeline_reject","pipeline_run","pipeline_status","pipeline_validate","quality_assess","requirements_validate","routing_economics","routing_metrics","security_scan_comprehensive","session_cache_stats","task_cancel","task_list","task_orchestrate","task_status","task_submit","team_broadcast","team_health","team_list","team_message","team_rebalance","team_scale","test_execute_parallel","test_generate_enhanced","validation_pipeline"],C=["qe/analysis/token_usage","qe/code/c4","qe/coherence/audit","qe/coherence/check","qe/coherence/collapse","qe/coherence/consensus","qe/coverage/gaps","qe/embeddings/compare","qe/embeddings/generate","qe/embeddings/search","qe/embeddings/stats","qe/embeddings/store","qe/learning/dream","qe/learning/optimize","qe/mincut/health","qe/mincut/analyze","qe/mincut/strengthen","qe/planning/goap_execute","qe/planning/goap_plan","qe/planning/goap_status","qe/quality/gate","qe/qx/analyze","qe/requirements/quality-criteria","qe/security/url-validate","qe/tests/load","qe/tests/schedule","qe/visual/compare","qe/workflows/browser-load"],L=Object.freeze([...P,...C].sort());function w(){return{annotations:R,reason:"No narrow side-effect-free guarantee is recorded for this built-in; retain conservative policy defaults."}}var S=Object.freeze(Object.fromEntries(L.map(r=>[r,w()])));function k(r,e){let t=Object.hasOwn(S,r)?S[r]:void 0;return Object.freeze({...t?.annotations??R,...t?e:void 0})}q();x();import*as p from"path";import*as d from"fs";function O(){return process.env.AQE_MEMORY_BACKEND==="memory"}var s=null,c=null,g=null;function Q(r){g=r}async function A(){return s||c||(c=(async()=>{if(O()){let o=new M;return await o.initialize(),s=o,o}let r=_(),e=p.join(r,".agentic-qe");d.existsSync(e)||d.mkdirSync(e,{recursive:!0});let t=new T({sqlite:{path:p.join(e,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"mcp-tools"});return await t.initialize(),s=t,t})(),c)}function F(){if(g)try{g()}catch{}s&&(s.dispose().catch(()=>{}),s=null),c=null}async function V(r){return r?.memory?r.memory:A()}var u=null,m=null;function D(){let r=(process.env.AQE_LLM_ROUTER_DISABLED??"").trim().toLowerCase();return r?r!=="false"&&r!=="0"&&r!=="no"&&r!=="off":!1}function U(r){u=r,m=null}async function j(){return D()?null:u||m||(m=(async()=>{let{createLLMRouterService:r}=await import("./llm-router-service-UIYTYKP6.js"),e=await r();return e?(u=e.router,u):null})(),m)}function Y(){u=null,m=null}async function W(r){return r?.llmRouter?r.llmRouter:await j()??void 0}async function G(r){if(r?.kernel)return r.kernel;try{let{getFleetState:e}=await import("./core-handlers-5EFOJ37H.js");return e().kernel??void 0}catch{return}}var I={info:(r,e)=>console.log(`[MCP-TOOL] ${r}`,e||""),warn:(r,e)=>console.warn(`[MCP-TOOL] \u26A0\uFE0F ${r}`,e||""),error:(r,e)=>console.error(`[MCP-TOOL] \u274C ${r}`,e||"")},v=class{logger=I;currentDataSource="real";setLogger(e){this.logger=e}markAsDemoData(e,t){this.currentDataSource=e.demoMode?"demo":"fallback",this.logger.warn(`${this.config.name} returning ${this.currentDataSource} data`,{reason:t,requestId:e.requestId,demoMode:e.demoMode})}markAsEstimatedData(){this.currentDataSource="estimated"}markAsRealData(){this.currentDataSource="real"}isDemoMode(e){return e.demoMode===!0}validate(e){let t=[];if(typeof e!="object"||e===null)return{valid:!1,errors:["Parameters must be an object"]};let o=e,{properties:i,required:n}=this.config.schema;if(n)for(let a of n)a in o||t.push(`Missing required field: ${a}`);for(let[a,l]of Object.entries(o)){let f=i[a];if(!f)continue;let y=this.validateType(a,l,f);y&&t.push(y)}return{valid:t.length===0,errors:t}}validateType(e,t,o){if(t==null)return null;let i=Array.isArray(t)?"array":typeof t;if(o.type==="array"&&!Array.isArray(t))return`${e} must be an array`;if(o.type!=="array"&&i!==o.type)return`${e} must be of type ${o.type}, got ${i}`;if(o.enum&&!o.enum.includes(t))return`${e} must be one of: ${o.enum.join(", ")}`;if(o.type==="number"){let n=t;if(o.minimum!==void 0&&n<o.minimum)return`${e} must be >= ${o.minimum}`;if(o.maximum!==void 0&&n>o.maximum)return`${e} must be <= ${o.maximum}`}if(o.type==="string"){let n=t;if(o.minLength!==void 0&&n.length<o.minLength)return`${e} must be at least ${o.minLength} characters`;if(o.maxLength!==void 0&&n.length>o.maxLength)return`${e} must be at most ${o.maxLength} characters`}return null}async invoke(e,t={}){let o=Date.now(),i=b();this.currentDataSource="real";let n=this.validate(e);if(!n.valid)return{success:!1,error:`Validation failed: ${n.errors.join("; ")}`,metadata:this.createMetadata(o,i)};let a={requestId:i,startTime:o,streaming:t.streaming,onStream:t.onStream,abortSignal:t.abortSignal,demoMode:t.demoMode,memory:t.memory,llmRouter:t.llmRouter,kernel:t.kernel};try{let l=await this.execute(e,a);return{...l,metadata:{...l.metadata,...this.createMetadata(o,i)}}}catch(l){return{success:!1,error:h(l),metadata:this.createMetadata(o,i)}}}createMetadata(e,t){return{executionTime:Date.now()-e,timestamp:new Date().toISOString(),requestId:t,domain:this.config.domain,toolName:this.config.name,dataSource:this.currentDataSource}}emitStream(e,t){e.streaming&&e.onStream&&e.onStream(t)}isAborted(e){return e.abortSignal?.aborted??!1}get name(){return this.config.name}get description(){return this.config.description}get annotations(){return k(this.name,this.config.annotations)}get domain(){return this.config.domain}getSchema(){return this.config.schema}get timeout(){return this.config.timeout??6e4}get supportsStreaming(){return this.config.streaming??!1}resetInstanceCache(){}};export{O as a,Q as b,A as c,F as d,V as e,U as f,j as g,Y as h,W as i,G as j,I as k,v as l};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as g,b as d,c as u,e as m,f as S}from"./chunk-ZDWD73UF.js";import{b as O}from"./chunk-BDVFSMOQ.js";import*as c from"fs";import*as j from"os";import*as t from"path";function k(){o=null,f=null}function v(n){let e=m(n);return R.has(e)||(R.add(e),console.error(`[AQE] No project marker found and "${n}" is a shared temp/system directory; using the private scratch root "${e}" instead of creating a shared .agentic-qe store there. Set AQE_PROJECT_ROOT to choose a root.`)),e}function T(...n){return t.join(x(),".agentic-qe",...n)}function _(n,e){let s=t.relative(e,n);return s===""||!s.startsWith("..")&&!t.isAbsolute(s)}function x(n=process.cwd()){if(process.env.AQE_PROJECT_ROOT)return process.env.AQE_PROJECT_ROOT;let e=t.resolve(n);if(o&&f===e)return o;f=e;let s=t.parse(e).root,l=null;try{l=t.resolve(j.homedir())}catch{l=null}let r=e,a=null,i=null,h=null;for(;r!==s&&!g(r);){let p=c.existsSync(t.join(r,".git")),y=!p&&d(r),P=r===l&&r!==e&&!_(e,t.join(r,".agentic-qe"));i===null&&!P&&!y&&c.existsSync(t.join(r,".agentic-qe"))&&a===null&&(a=r),p&&i===null&&(i=r),c.existsSync(t.join(r,"package.json"))&&(h=r),r=t.dirname(r)}return a?o=a:i?o=i:h?o=h:u(e)?o=v(e):o=e,o}var o,f,R,A=O(()=>{S();S();o=null,f=null;R=new Set});export{k as a,T as b,x as c,A as d};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{c as H,d as J}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{c as H,d as J}from"./chunk-IZODXKZD.js";import{h as G}from"./chunk-6TEVM3X3.js";import{g as U}from"./chunk-5AGXIZQ5.js";import{e as N}from"./chunk-RMEQYJPU.js";import{e as T}from"./chunk-Y4LSEOZ3.js";import{b as v,c as C}from"./chunk-XZLIF4O2.js";import{b as B}from"./chunk-LTGB7OIU.js";import{i as W}from"./chunk-4BIMTRRX.js";import{b,d as _}from"./chunk-MQM37KAR.js";import{c as k,d as E}from"./chunk-JMRDT2XK.js";import{a as oe}from"./chunk-O5EWFR76.js";import{c as q}from"./chunk-NKU3FFM4.js";import{S as se,b as z}from"./chunk-V2LJ54KP.js";import{a as y,e as $}from"./chunk-AWQAE3SW.js";import{randomUUID as te}from"crypto";$();_();import{randomUUID as ce}from"node:crypto";var D=C(),P=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;localTrajectories=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async startTrajectory(e,t){let i=`trajectory-${ce()}`;if(this.claudeFlowAvailable)try{let{execFileSync:n}=await import("child_process"),r=["--no-install",D,"hooks","intelligence","trajectory-start","--task",e];t&&r.push("--agent",t);let s=n("npx",r,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}).match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);if(s?.[1])return s[1]}catch(n){console.debug("[TrajectoryBridge] Claude Flow trajectory start failed:",n instanceof Error?n.message:n)}return this.localTrajectories.set(i,{id:i,task:e,agent:t,steps:[],startedAt:Date.now()}),i}async recordStep(e,t,i,n){if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=["--no-install",D,"hooks","intelligence","trajectory-step","--trajectory-id",e,"--action",t];i&&s.push("--result",i),n!==void 0&&s.push("--quality",String(n)),a("npx",s,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot});return}catch(a){console.debug("[TrajectoryBridge] Claude Flow trajectory step failed:",a instanceof Error?a.message:a)}let r=this.localTrajectories.get(e);r&&r.steps.push({id:`step-${r.steps.length+1}`,action:t,result:i,quality:n,timestamp:Date.now()})}async endTrajectory(e,t,i){if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),a=["--no-install",D,"hooks","intelligence","trajectory-end","--trajectory-id",e,"--success",String(t)];i&&a.push("--feedback",i),r("npx",a,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch{}let n=this.localTrajectories.get(e);if(n)return n.success=t,n.feedback=i,n.completedAt=Date.now(),await this.persistTrajectory(n),n}getTrajectory(e){return this.localTrajectories.get(e)}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async persistTrajectory(e){try{let{getUnifiedMemory:t}=await import("./unified-memory-GUR3IUI6.js"),i=t();i.isInitialized()||await i.initialize();let n=i.getDatabase();try{n.prepare("PRAGMA table_info(qe_trajectories)").all().some(o=>o.name==="feedback")||n.exec("ALTER TABLE qe_trajectories ADD COLUMN feedback TEXT")}catch{}let r=new Date(e.startedAt).toISOString(),a=e.completedAt?new Date(e.completedAt).toISOString():null;n.prepare(`
|
|
3
3
|
INSERT OR REPLACE INTO qe_trajectories
|
|
4
4
|
(id, task, agent, domain, started_at, ended_at, success, steps_json, feedback)
|
|
5
5
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
6
|
-
`).run(e.id,e.task,e.agent||null,null,r,a,e.success?1:0,JSON.stringify(e.steps),e.feedback||null)}catch(t){console.debug("[TrajectoryBridge] Trajectory persistence failed:",t instanceof Error?t.message:t)}}};var V=C(),X={low:[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i],high:[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/database.*migration/i,/distributed/i,/concurrent/i]},R=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;routingHistory=[];async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async routeTask(e){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",V,"hooks","model-route","--task",e],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}),n=i.match(/model[:\s]+["']?(haiku|sonnet|opus)/i),r=i.match(/confidence[:\s]+([0-9.]+)/i),a=i.match(/reason(?:ing)?[:\s]+["']?([^"'\n]+)/i);if(n)return{model:n[1].toLowerCase(),confidence:r?parseFloat(r[1]):.7,reasoning:a?.[1]?.trim()}}catch(t){console.debug("[ModelRouterBridge] Claude Flow routing failed:",t instanceof Error?t.message:t)}return this.localRoute(e)}async recordOutcome(e){if(this.routingHistory.push(e),this.routingHistory.length>1e3&&(this.routingHistory=this.routingHistory.slice(-500)),this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process");t("npx",["--no-install",V,"hooks","model-outcome","--task",e.task,"--model",e.model,"--outcome",e.outcome],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch(t){console.debug("[ModelRouterBridge] Outcome recording failed:",t instanceof Error?t.message:t)}}getStats(){let e={totalRoutings:this.routingHistory.length,modelDistribution:{haiku:0,sonnet:0,opus:0},successRate:{haiku:0,sonnet:0,opus:0}},t={haiku:0,sonnet:0,opus:0};for(let i of this.routingHistory)e.modelDistribution[i.model]++,i.outcome==="success"&&t[i.model]++;for(let i of["haiku","sonnet","opus"]){let n=e.modelDistribution[i];e.successRate[i]=n>0?t[i]/n:0}return e}isClaudeFlowAvailable(){return this.claudeFlowAvailable}localRoute(e){let t=e.toLowerCase();for(let i of X.low)if(i.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task detected - using haiku for speed"};for(let i of X.high)if(i.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task detected - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task description - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity task - using sonnet for balance"}}};_();$();var M=C(),S=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;analysisCache=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async analyze(e,t="medium"){let i=e||this.options.projectRoot,n=`${i}:${t}`,r=this.analysisCache.get(n);if(r)return r;if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=a("npx",["--no-install",M,"hooks","pretrain","--path",i,"--depth",t],{encoding:"utf-8",timeout:12e4,cwd:this.options.projectRoot});try{let o=b(s),d={success:!0,repositoryPath:i,depth:t,analysis:o.analysis||void 0,agentConfigs:o.agentConfigs};return this.analysisCache.set(n,d),d}catch{return{success:!0,repositoryPath:i,depth:t}}}catch(a){console.debug("[PretrainBridge] Claude Flow analyze failed, using local:",a instanceof Error?a.message:a)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",M,"hooks","build-agents","--format",e],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot});try{return b(i)}catch(n){return console.debug("[PretrainBridge] Agent config parse error:",n instanceof Error?n.message:n),[]}}catch(t){console.debug("[PretrainBridge] Claude Flow generateAgentConfigs failed:",t instanceof Error?t.message:t)}return this.generateLocalAgentConfigs()}async transferPatterns(e,t=.7){if(this.claudeFlowAvailable)try{let{execFileSync:i}=await import("child_process"),n=i("npx",["--no-install",M,"hooks","transfer","--source-path",e,"--min-confidence",String(t)],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot}),r=n.match(/transferred[:\s]+(\d+)/i),a=n.match(/skipped[:\s]+(\d+)/i);return{transferred:r?parseInt(r[1]):0,skipped:a?parseInt(a[1]):0}}catch(i){console.debug("[PretrainBridge] Claude Flow transferPatterns failed:",i instanceof Error?i.message:i)}return{transferred:0,skipped:0}}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),d=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),c=new Set,g=new Set;for(let p of d.slice(0,100))(p.endsWith(".ts")||p.endsWith(".tsx"))&&c.add("typescript"),(p.endsWith(".js")||p.endsWith(".jsx"))&&c.add("javascript"),p.endsWith(".py")&&c.add("python"),p.endsWith(".go")&&c.add("go"),p.endsWith(".rs")&&c.add("rust");let w=a(e,"package.json");if(n(w))try{let p=b(r(w,"utf-8")),f={...p.dependencies,...p.devDependencies};f.react&&g.add("react"),f.vue&&g.add("vue"),f.angular&&g.add("angular"),f.vitest&&g.add("vitest"),f.jest&&g.add("jest"),f.playwright&&g.add("playwright"),f.express&&g.add("express"),f.fastify&&g.add("fastify")}catch(p){console.debug("[PretrainBridge] package.json parse error:",p instanceof Error?p.message:p)}let m={success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(c),frameworks:Array.from(g),patterns:[],complexity:d.length>500?3:d.length>100?2:1}};return this.analysisCache.set(`${e}:${t}`,m),m}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}generateLocalAgentConfigs(){return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-quality-gate",type:"worker",capabilities:["quality-assessment","risk-scoring"],model:"sonnet"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}};var Q=class{constructor(e){this.options=e;this.trajectory=new P(e),this.modelRouter=new R(e),this.pretrain=new S(e)}options;trajectory;modelRouter;pretrain;initialized=!1;async initialize(){this.initialized||(await Promise.all([this.trajectory.initialize(),this.modelRouter.initialize(),this.pretrain.initialize()]),this.initialized=!0)}getStatus(){return{available:this.isAvailable(),features:{trajectories:this.trajectory.isClaudeFlowAvailable(),modelRouting:this.modelRouter.isClaudeFlowAvailable(),pretrain:this.pretrain.isClaudeFlowAvailable(),patternSearch:this.trajectory.isClaudeFlowAvailable()}}}isAvailable(){return this.trajectory.isClaudeFlowAvailable()||this.modelRouter.isClaudeFlowAvailable()||this.pretrain.isClaudeFlowAvailable()}};function K(u){return new Q(u)}import{createHash as le}from"node:crypto";oe();se();var F=q.create("experience-capture"),Z={"catches-bug":1,flaky:-1,"false-positive":-1,"new-coverage":.3,redundant:0,"code-smell":-.5,neutral:0},ue=new Set(Object.keys(Z));function Y(u){return typeof u=="string"&&ue.has(u)}function de(u){if(Y(u))return Z[u]}var pe={namespace:"qe-experiences",minQualityForPatternExtraction:.7,similarityThreshold:.85,promotionThreshold:T,maxExperiencesPerDomain:1e3,enableCrossDomainSharing:!0,autoCleanup:!0,cleanupIntervalMs:864e5},L=class{constructor(e,t,i,n={}){this.memory=e;this.patternStore=t;this.eventBus=i;this.config={...pe,...n}}memory;patternStore;eventBus;config;initialized=!1;cleanupTimer;activeExperiences=new Map;stats={totalCaptured:0,successfulCaptures:0,patternsExtracted:0,patternsPromoted:0,byDomain:new Map};sessionCaptureCount=0;witnessChain;nullRecorder;setWitnessChain(e){this.witnessChain=e}setNullRecorder(e){this.nullRecorder=e}async initialize(){this.initialized||(await this.loadStats(),this.config.autoCleanup&&(this.cleanupTimer=setInterval(()=>this.cleanup(),this.config.cleanupIntervalMs)),this.initialized=!0,console.log("[ExperienceCapture] Initialized"))}startCapture(e,t){let i=`exp-${Date.now()}-${W().slice(0,8)}`,n={id:i,task:e,agent:t?.agent,domain:t?.domain,model:t?.model,startedAt:Date.now(),completedAt:0,durationMs:0,steps:[],success:!1,quality:0,trajectoryId:t?.trajectoryId,metadata:t?.metadata,appliedPatterns:t?.appliedPatterns};return this.activeExperiences.set(i,n),i}recordStep(e,t){let i=this.activeExperiences.get(e);if(!i){console.warn(`[ExperienceCapture] Experience not found: ${e}`);return}i.steps.push({...t,timestamp:Date.now()})}async completeCapture(e,t){let i=this.activeExperiences.get(e);if(!i)return E(new Error(`Experience not found: ${e}`));let n=Date.now();i.completedAt=n,i.durationMs=n-i.startedAt,i.success=t.success,i.feedback=t.feedback,t.outcomeBasis&&(i.outcomeBasis=t.outcomeBasis),t.quality!==void 0?i.quality=t.quality:i.quality=this.calculateQuality(i);let r=t.testOutcome??i.metadata?.testOutcome;if(r&&Y(r)&&(i.testOutcome=r,i.reward=de(r)),this.witnessChain&&z().useWitnessChain)try{let o=this.witnessChain.appendWitness({type:"experience-capture",decision:i.success?"PASS":"FAIL",context:{experienceId:i.id,task:i.task,quality:i.quality,domain:i.domain,reward:i.reward},evidence:i.reward});i.witnessHash=o.hash}catch(o){F.warn("Failed to create witness receipt for experience",{experienceId:i.id,error:o instanceof Error?o.message:String(o)})}this.activeExperiences.delete(e),await this.storeExperience(i),this.updateStats(i);let a=i.reward!==void 0?i.reward<0:!i.success;if(this.nullRecorder&&a&&i.appliedPatterns?.length){let o=`${i.domain??"unknown"}:${i.agent??"unknown"}`;for(let d of i.appliedPatterns)try{await this.nullRecorder({patternId:d,contextFingerprint:o,failureMode:i.testOutcome??i.feedback??"task-failure",trajectoryRef:i.trajectoryId,evidenceClass:"EXECUTED"})}catch(c){F.warn("Failed to record pattern null",{patternId:d,error:c instanceof Error?c.message:String(c)})}}let s=i.reward===void 0||i.reward>0;if(i.outcomeBasis!==void 0||i.success&&i.quality>=this.config.minQualityForPatternExtraction&&s){let o=await this.extractPattern(i);(o.newPattern||o.reinforced)&&(i.patterns=[o.patternId])}return this.emitExperienceCaptured(i),k(i)}getActiveExperience(e){return this.activeExperiences.get(e)}getPendingCount(){return this.activeExperiences.size}async flushPending(){let e=Array.from(this.activeExperiences.entries());if(e.length===0)return 0;let t=0;for(let[i,n]of e){let r=Date.now();n.completedAt=r,n.durationMs=r-n.startedAt,n.quality=n.quality||this.calculateQuality(n),n.metadata={...n.metadata,flushedByCompaction:!0},await this.storeExperience(n),this.updateStats(n),this.activeExperiences.delete(i),t++}return F.info(`Flushed ${t} pending experiences before compaction`),t}async getExperience(e){let t=`${this.config.namespace}:experience:${e}`;return await this.memory.get(t)??null}async searchExperiences(e={}){let t=e.limit||100,i=[],n;e.domain?n=await this.memory.search(`${this.config.namespace}:index:domain:${e.domain}:*`,t*2):n=await this.memory.search(`${this.config.namespace}:experience:*`,t*2);for(let r of n){if(i.length>=t)break;let a=r.includes(":index:")?await this.memory.get(r):null,s=a?await this.getExperience(a):await this.memory.get(r);s&&(e.agent&&s.agent!==e.agent||e.success!==void 0&&s.success!==e.success||e.minQuality!==void 0&&s.quality<e.minQuality||i.push(s))}return i}async getStats(){let e={};for(let[t,i]of this.stats.byDomain)e[t]=i;return{totalExperiences:this.stats.totalCaptured,byDomain:e,successRate:this.stats.totalCaptured>0?this.stats.successfulCaptures/this.stats.totalCaptured:0,avgQuality:await this.calculateAvgQuality(),patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted}}async extractPattern(e){if(!this.patternStore)return{newPattern:!1,reinforced:!1,promoted:!1};let t=this.experienceIdentity(e),i=await this.patternStore.search(t,{limit:1,domain:e.domain,patternType:this.detectPatternType(e.task),useVectorSearch:!1});if(i.success&&i.value.length>0){let a=i.value[0],s=a.pattern.context?.experienceOrigin;if(s?.task===e.task&&s.domain===(e.domain??null)&&s.patternType===this.detectPatternType(e.task)&&a.pattern.patternType===s.patternType&&(!e.domain||a.pattern.qeDomain===e.domain)){let o=await this.patternStore.recordUsage(a.pattern.id,e.success,this.usageOutcomeTag(e)),d=await this.patternStore.get(a.pattern.id),c=!1;return d&&e.success&&d.tier==="short-term"&&d.usageCount>=this.config.promotionThreshold&&(await this.patternStore.promote(a.pattern.id)).success&&(c=!0,this.stats.patternsPromoted++,console.log(`[ExperienceCapture] Pattern promoted: ${a.pattern.id} (${d.usageCount} uses)`)),{newPattern:!1,patternId:a.pattern.id,reinforced:o.success,promoted:c}}}let n=this.experienceToPatternOptions(e),r=await this.patternStore.create(n);return r.success?(this.stats.patternsExtracted++,await this.patternStore.recordUsage(r.value.id,e.success,this.usageOutcomeTag(e)),{newPattern:!0,patternId:r.value.id,reinforced:!1,promoted:!1}):{newPattern:!1,reinforced:!1,promoted:!1}}async shareAcrossDomains(e){if(!this.config.enableCrossDomainSharing||!e.domain)return;let t=this.getRelatedDomains(e.domain);for(let i of t){let n=`${this.config.namespace}:shared:${i}:${e.id}`;await this.memory.set(n,{sourceExperience:e.id,sourceDomain:e.domain,sharedAt:Date.now()},{persist:!0})}}async cleanup(){let t=0;for(let i of this.stats.byDomain.keys()){let n=this.stats.byDomain.get(i)||0;if(n>this.config.maxExperiencesPerDomain){let r=await this.searchExperiences({domain:i,limit:n});r.sort((s,o)=>s.quality-o.quality||s.startedAt-o.startedAt);let a=n-this.config.maxExperiencesPerDomain;for(let s=0;s<Math.min(a,r.length);s++){let o=r[s];await this.softDeleteExperience(o.id),t++}}}return console.log(`[ExperienceCapture] Cleanup: ${t} archived (0 destroyed)`),{removed:0,consolidated:0,archived:t}}async dispose(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0),await this.saveStats(),this.sessionCaptureCount===0&&console.warn("[ExperienceCapture] WARNING: Zero experiences captured this session. Learning cannot improve without experience data. Ensure tasks call startCapture()/completeCapture() to feed the learning loop."),this.activeExperiences.clear(),this.initialized=!1}async storeExperience(e){let t=`${this.config.namespace}:experience:${e.id}`;if(await this.memory.set(t,e,{persist:!0}),e.domain){let i=`${this.config.namespace}:index:domain:${e.domain}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}if(e.agent){let i=`${this.config.namespace}:index:agent:${e.agent}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}}async deleteExperience(e){await this.softDeleteExperience(e)}async softDeleteExperience(e){let t=await this.getExperience(e);if(!t)return;let i=`${this.config.namespace}:experience:${e}`,n={...t,_archived:!0};await this.memory.set(i,n,{persist:!0})}calculateQuality(e){if(e.steps.length===0)return e.success?.5:.2;let t=e.steps.filter(n=>n.quality!==void 0);if(t.length===0)return e.success?.6:.3;let i=t.reduce((n,r)=>n+(r.quality||0),0)/t.length;return e.success?Math.min(1,i+.1):Math.max(0,i-.2)}updateStats(e){if(this.stats.totalCaptured++,this.sessionCaptureCount++,e.success&&this.stats.successfulCaptures++,e.domain){let t=this.stats.byDomain.get(e.domain)||0;this.stats.byDomain.set(e.domain,t+1)}}async calculateAvgQuality(){let e=await this.searchExperiences({limit:100});return e.length===0?0:e.reduce((i,n)=>i+n.quality,0)/e.length}usageOutcomeTag(e){let t=typeof e.metadata?.runId=="string"?e.metadata.runId:void 0;return e.outcomeBasis!==void 0?B({measured:!0,success:e.success,basis:e.outcomeBasis},t):B({measured:!1,success:null,basis:"task-completed"},t)}experienceToPatternOptions(e){let t=this.detectPatternType(e.task),n=`Task: {{task}}
|
|
6
|
+
`).run(e.id,e.task,e.agent||null,null,r,a,e.success?1:0,JSON.stringify(e.steps),e.feedback||null)}catch(t){console.debug("[TrajectoryBridge] Trajectory persistence failed:",t instanceof Error?t.message:t)}}};var V=C(),X={low:[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i],high:[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/database.*migration/i,/distributed/i,/concurrent/i]},R=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;routingHistory=[];async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async routeTask(e){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",V,"hooks","model-route","--task",e],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}),n=i.match(/model[:\s]+["']?(haiku|sonnet|opus)/i),r=i.match(/confidence[:\s]+([0-9.]+)/i),a=i.match(/reason(?:ing)?[:\s]+["']?([^"'\n]+)/i);if(n)return{model:n[1].toLowerCase(),confidence:r?parseFloat(r[1]):.7,reasoning:a?.[1]?.trim()}}catch(t){console.debug("[ModelRouterBridge] Claude Flow routing failed:",t instanceof Error?t.message:t)}return this.localRoute(e)}async recordOutcome(e){if(this.routingHistory.push(e),this.routingHistory.length>1e3&&(this.routingHistory=this.routingHistory.slice(-500)),this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process");t("npx",["--no-install",V,"hooks","model-outcome","--task",e.task,"--model",e.model,"--outcome",e.outcome],{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch(t){console.debug("[ModelRouterBridge] Outcome recording failed:",t instanceof Error?t.message:t)}}getStats(){let e={totalRoutings:this.routingHistory.length,modelDistribution:{haiku:0,sonnet:0,opus:0},successRate:{haiku:0,sonnet:0,opus:0}},t={haiku:0,sonnet:0,opus:0};for(let i of this.routingHistory)e.modelDistribution[i.model]++,i.outcome==="success"&&t[i.model]++;for(let i of["haiku","sonnet","opus"]){let n=e.modelDistribution[i];e.successRate[i]=n>0?t[i]/n:0}return e}isClaudeFlowAvailable(){return this.claudeFlowAvailable}localRoute(e){let t=e.toLowerCase();for(let i of X.low)if(i.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task detected - using haiku for speed"};for(let i of X.high)if(i.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task detected - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task description - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity task - using sonnet for balance"}}};_();$();var M=C(),S=class{constructor(e){this.options=e}options;claudeFlowAvailable=!1;analysisCache=new Map;async initialize(){this.claudeFlowAvailable=await this.checkClaudeFlow()}async checkClaudeFlow(){return v(this.options.projectRoot).available}async analyze(e,t="medium"){let i=e||this.options.projectRoot,n=`${i}:${t}`,r=this.analysisCache.get(n);if(r)return r;if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=a("npx",["--no-install",M,"hooks","pretrain","--path",i,"--depth",t],{encoding:"utf-8",timeout:12e4,cwd:this.options.projectRoot});try{let o=b(s),c={success:!0,repositoryPath:i,depth:t,analysis:o.analysis||void 0,agentConfigs:o.agentConfigs};return this.analysisCache.set(n,c),c}catch{return{success:!0,repositoryPath:i,depth:t}}}catch(a){console.debug("[PretrainBridge] Claude Flow analyze failed, using local:",a instanceof Error?a.message:a)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowAvailable)try{let{execFileSync:t}=await import("child_process"),i=t("npx",["--no-install",M,"hooks","build-agents","--format",e],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot});try{return b(i)}catch(n){return console.debug("[PretrainBridge] Agent config parse error:",n instanceof Error?n.message:n),[]}}catch(t){console.debug("[PretrainBridge] Claude Flow generateAgentConfigs failed:",t instanceof Error?t.message:t)}return this.generateLocalAgentConfigs()}async transferPatterns(e,t=.7){if(this.claudeFlowAvailable)try{let{execFileSync:i}=await import("child_process"),n=i("npx",["--no-install",M,"hooks","transfer","--source-path",e,"--min-confidence",String(t)],{encoding:"utf-8",timeout:6e4,cwd:this.options.projectRoot}),r=n.match(/transferred[:\s]+(\d+)/i),a=n.match(/skipped[:\s]+(\d+)/i);return{transferred:r?parseInt(r[1]):0,skipped:a?parseInt(a[1]):0}}catch(i){console.debug("[PretrainBridge] Claude Flow transferPatterns failed:",i instanceof Error?i.message:i)}return{transferred:0,skipped:0}}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),c=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),l=new Set,u=new Set;for(let g of c.slice(0,100))(g.endsWith(".ts")||g.endsWith(".tsx"))&&l.add("typescript"),(g.endsWith(".js")||g.endsWith(".jsx"))&&l.add("javascript"),g.endsWith(".py")&&l.add("python"),g.endsWith(".go")&&l.add("go"),g.endsWith(".rs")&&l.add("rust");let w=a(e,"package.json");if(n(w))try{let g=b(r(w,"utf-8")),f={...g.dependencies,...g.devDependencies};f.react&&u.add("react"),f.vue&&u.add("vue"),f.angular&&u.add("angular"),f.vitest&&u.add("vitest"),f.jest&&u.add("jest"),f.playwright&&u.add("playwright"),f.express&&u.add("express"),f.fastify&&u.add("fastify")}catch(g){console.debug("[PretrainBridge] package.json parse error:",g instanceof Error?g.message:g)}let m={success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(l),frameworks:Array.from(u),patterns:[],complexity:c.length>500?3:c.length>100?2:1}};return this.analysisCache.set(`${e}:${t}`,m),m}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}generateLocalAgentConfigs(){return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-quality-gate",type:"worker",capabilities:["quality-assessment","risk-scoring"],model:"sonnet"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}};var Q=class{constructor(e){this.options=e;this.trajectory=new P(e),this.modelRouter=new R(e),this.pretrain=new S(e)}options;trajectory;modelRouter;pretrain;initialized=!1;async initialize(){this.initialized||(await Promise.all([this.trajectory.initialize(),this.modelRouter.initialize(),this.pretrain.initialize()]),this.initialized=!0)}getStatus(){return{available:this.isAvailable(),features:{trajectories:this.trajectory.isClaudeFlowAvailable(),modelRouting:this.modelRouter.isClaudeFlowAvailable(),pretrain:this.pretrain.isClaudeFlowAvailable(),patternSearch:this.trajectory.isClaudeFlowAvailable()}}}isAvailable(){return this.trajectory.isClaudeFlowAvailable()||this.modelRouter.isClaudeFlowAvailable()||this.pretrain.isClaudeFlowAvailable()}};function K(p){return new Q(p)}import{createHash as le}from"node:crypto";oe();se();var F=q.create("experience-capture"),Z={"catches-bug":1,flaky:-1,"false-positive":-1,"new-coverage":.3,redundant:0,"code-smell":-.5,neutral:0},ue=new Set(Object.keys(Z));function Y(p){return typeof p=="string"&&ue.has(p)}function de(p){if(Y(p))return Z[p]}var pe={namespace:"qe-experiences",minQualityForPatternExtraction:.7,similarityThreshold:.85,promotionThreshold:T,maxExperiencesPerDomain:1e3,enableCrossDomainSharing:!0,autoCleanup:!0,cleanupIntervalMs:864e5},L=class{constructor(e,t,i,n={}){this.memory=e;this.patternStore=t;this.eventBus=i;this.config={...pe,...n}}memory;patternStore;eventBus;config;initialized=!1;cleanupTimer;activeExperiences=new Map;stats={totalCaptured:0,successfulCaptures:0,patternsExtracted:0,patternsPromoted:0,byDomain:new Map};sessionCaptureCount=0;witnessChain;nullRecorder;setWitnessChain(e){this.witnessChain=e}setNullRecorder(e){this.nullRecorder=e}async initialize(){this.initialized||(await this.loadStats(),this.config.autoCleanup&&(this.cleanupTimer=setInterval(()=>this.cleanup(),this.config.cleanupIntervalMs)),this.initialized=!0,console.log("[ExperienceCapture] Initialized"))}startCapture(e,t){let i=`exp-${Date.now()}-${W().slice(0,8)}`,n={id:i,task:e,agent:t?.agent,domain:t?.domain,model:t?.model,startedAt:Date.now(),completedAt:0,durationMs:0,steps:[],success:!1,quality:0,trajectoryId:t?.trajectoryId,metadata:t?.metadata,appliedPatterns:t?.appliedPatterns};return this.activeExperiences.set(i,n),i}recordStep(e,t){let i=this.activeExperiences.get(e);if(!i){console.warn(`[ExperienceCapture] Experience not found: ${e}`);return}i.steps.push({...t,timestamp:Date.now()})}async completeCapture(e,t){let i=this.activeExperiences.get(e);if(!i)return E(new Error(`Experience not found: ${e}`));let n=Date.now();i.completedAt=n,i.durationMs=n-i.startedAt,i.success=t.success,i.feedback=t.feedback,t.outcomeBasis&&(i.outcomeBasis=t.outcomeBasis),t.quality!==void 0?i.quality=t.quality:i.quality=this.calculateQuality(i);let r=t.testOutcome??i.metadata?.testOutcome;if(r&&Y(r)&&(i.testOutcome=r,i.reward=de(r)),this.witnessChain&&z().useWitnessChain)try{let c=this.witnessChain.appendWitness({type:"experience-capture",decision:i.success?"PASS":"FAIL",context:{experienceId:i.id,task:i.task,quality:i.quality,domain:i.domain,reward:i.reward},evidence:i.reward});i.witnessHash=c.hash}catch(c){F.warn("Failed to create witness receipt for experience",{experienceId:i.id,error:c instanceof Error?c.message:String(c)})}this.activeExperiences.delete(e),await this.storeExperience(i),this.updateStats(i);let a=i.reward!==void 0?i.reward<0:!i.success;if(this.nullRecorder&&a&&i.appliedPatterns?.length){let c=`${i.domain??"unknown"}:${i.agent??"unknown"}`;for(let l of i.appliedPatterns)try{await this.nullRecorder({patternId:l,contextFingerprint:c,failureMode:i.testOutcome??i.feedback??"task-failure",trajectoryRef:i.trajectoryId,evidenceClass:"EXECUTED"})}catch(u){F.warn("Failed to record pattern null",{patternId:l,error:u instanceof Error?u.message:String(u)})}}let s=i.reward===void 0||i.reward>0,o=i.success&&i.quality>=this.config.minQualityForPatternExtraction&&s;if(o||i.outcomeBasis!==void 0){let c=await this.extractPattern(i,{createIfMissing:o});(c.newPattern||c.reinforced)&&(i.patterns=[c.patternId])}return this.emitExperienceCaptured(i),k(i)}getActiveExperience(e){return this.activeExperiences.get(e)}getPendingCount(){return this.activeExperiences.size}async flushPending(){let e=Array.from(this.activeExperiences.entries());if(e.length===0)return 0;let t=0;for(let[i,n]of e){let r=Date.now();n.completedAt=r,n.durationMs=r-n.startedAt,n.quality=n.quality||this.calculateQuality(n),n.metadata={...n.metadata,flushedByCompaction:!0},await this.storeExperience(n),this.updateStats(n),this.activeExperiences.delete(i),t++}return F.info(`Flushed ${t} pending experiences before compaction`),t}async getExperience(e){let t=`${this.config.namespace}:experience:${e}`;return await this.memory.get(t)??null}async searchExperiences(e={}){let t=e.limit||100,i=[],n;e.domain?n=await this.memory.search(`${this.config.namespace}:index:domain:${e.domain}:*`,t*2):n=await this.memory.search(`${this.config.namespace}:experience:*`,t*2);for(let r of n){if(i.length>=t)break;let a=r.includes(":index:")?await this.memory.get(r):null,s=a?await this.getExperience(a):await this.memory.get(r);s&&(e.agent&&s.agent!==e.agent||e.success!==void 0&&s.success!==e.success||e.minQuality!==void 0&&s.quality<e.minQuality||i.push(s))}return i}async getStats(){let e={};for(let[t,i]of this.stats.byDomain)e[t]=i;return{totalExperiences:this.stats.totalCaptured,byDomain:e,successRate:this.stats.totalCaptured>0?this.stats.successfulCaptures/this.stats.totalCaptured:0,avgQuality:await this.calculateAvgQuality(),patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted}}async extractPattern(e,t={}){if(!this.patternStore)return{newPattern:!1,reinforced:!1,promoted:!1};let i=this.experienceIdentity(e),n=await this.patternStore.search(i,{limit:1,domain:e.domain,patternType:this.detectPatternType(e.task),useVectorSearch:!1});if(n.success&&n.value.length>0){let s=n.value[0],o=s.pattern.context?.experienceOrigin;if(o?.task===e.task&&o.domain===(e.domain??null)&&o.patternType===this.detectPatternType(e.task)&&s.pattern.patternType===o.patternType&&(!e.domain||s.pattern.qeDomain===e.domain)){let c=await this.patternStore.recordUsage(s.pattern.id,e.success,this.usageOutcomeTag(e)),l=await this.patternStore.get(s.pattern.id),u=!1;return l&&e.success&&l.tier==="short-term"&&l.usageCount>=this.config.promotionThreshold&&(await this.patternStore.promote(s.pattern.id)).success&&(u=!0,this.stats.patternsPromoted++,console.log(`[ExperienceCapture] Pattern promoted: ${s.pattern.id} (${l.usageCount} uses)`)),{newPattern:!1,patternId:s.pattern.id,reinforced:c.success,promoted:u}}}if(t.createIfMissing===!1)return{newPattern:!1,reinforced:!1,promoted:!1};let r=this.experienceToPatternOptions(e),a=await this.patternStore.create(r);return a.success?(this.stats.patternsExtracted++,await this.patternStore.recordUsage(a.value.id,e.success,this.usageOutcomeTag(e)),{newPattern:!0,patternId:a.value.id,reinforced:!1,promoted:!1}):{newPattern:!1,reinforced:!1,promoted:!1}}async shareAcrossDomains(e){if(!this.config.enableCrossDomainSharing||!e.domain)return;let t=this.getRelatedDomains(e.domain);for(let i of t){let n=`${this.config.namespace}:shared:${i}:${e.id}`;await this.memory.set(n,{sourceExperience:e.id,sourceDomain:e.domain,sharedAt:Date.now()},{persist:!0})}}async cleanup(){let t=0;for(let i of this.stats.byDomain.keys()){let n=this.stats.byDomain.get(i)||0;if(n>this.config.maxExperiencesPerDomain){let r=await this.searchExperiences({domain:i,limit:n});r.sort((s,o)=>s.quality-o.quality||s.startedAt-o.startedAt);let a=n-this.config.maxExperiencesPerDomain;for(let s=0;s<Math.min(a,r.length);s++){let o=r[s];await this.softDeleteExperience(o.id),t++}}}return console.log(`[ExperienceCapture] Cleanup: ${t} archived (0 destroyed)`),{removed:0,consolidated:0,archived:t}}async dispose(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0),await this.saveStats(),this.sessionCaptureCount===0&&console.warn("[ExperienceCapture] WARNING: Zero experiences captured this session. Learning cannot improve without experience data. Ensure tasks call startCapture()/completeCapture() to feed the learning loop."),this.activeExperiences.clear(),this.initialized=!1}async storeExperience(e){let t=`${this.config.namespace}:experience:${e.id}`;if(await this.memory.set(t,e,{persist:!0}),e.domain){let i=`${this.config.namespace}:index:domain:${e.domain}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}if(e.agent){let i=`${this.config.namespace}:index:agent:${e.agent}:${e.id}`;await this.memory.set(i,e.id,{persist:!0})}}async deleteExperience(e){await this.softDeleteExperience(e)}async softDeleteExperience(e){let t=await this.getExperience(e);if(!t)return;let i=`${this.config.namespace}:experience:${e}`,n={...t,_archived:!0};await this.memory.set(i,n,{persist:!0})}calculateQuality(e){if(e.steps.length===0)return e.success?.5:.2;let t=e.steps.filter(n=>n.quality!==void 0);if(t.length===0)return e.success?.6:.3;let i=t.reduce((n,r)=>n+(r.quality||0),0)/t.length;return e.success?Math.min(1,i+.1):Math.max(0,i-.2)}updateStats(e){if(this.stats.totalCaptured++,this.sessionCaptureCount++,e.success&&this.stats.successfulCaptures++,e.domain){let t=this.stats.byDomain.get(e.domain)||0;this.stats.byDomain.set(e.domain,t+1)}}async calculateAvgQuality(){let e=await this.searchExperiences({limit:100});return e.length===0?0:e.reduce((i,n)=>i+n.quality,0)/e.length}usageOutcomeTag(e){let t=typeof e.metadata?.runId=="string"?e.metadata.runId:void 0;return e.outcomeBasis!==void 0?B({measured:!0,success:e.success,basis:e.outcomeBasis},t):B({measured:!1,success:null,basis:"task-completed"},t)}experienceToPatternOptions(e){let t=this.detectPatternType(e.task),n=`Task: {{task}}
|
|
7
7
|
|
|
8
8
|
Steps:
|
|
9
9
|
${e.steps.map((r,a)=>`${a+1}. ${r.action}${r.result?` \u2192 ${r.result}`:""}`).join(`
|
|
10
10
|
`)}
|
|
11
11
|
|
|
12
|
-
Duration: ${e.durationMs}ms`;return{patternType:t,qeDomain:e.domain,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:[...this.extractTags(e),this.experienceIdentity(e)],experienceOrigin:{task:e.task,domain:e.domain??null,patternType:t},testType:this.detectTestType(e.task)},template:{type:"workflow",content:n,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}experienceIdentity(e){return le("sha256").update(JSON.stringify([e.task,e.domain??null,this.detectPatternType(e.task)])).digest("hex")}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t} ${this.experienceIdentity(e)}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),n=["unit","integration","e2e","api","mock","coverage","security"];for(let r of n)i.some(a=>a.includes(r))&&t.push(r);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){F.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function ee(u,e,t,i){return new L(u,e,t,i)}var ge={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:T},I=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ge,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await H(J),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=N(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=G(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-C32UBR6D.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=ee(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-DCHCAMSQ.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-DCHCAMSQ.js"),{getUnifiedPersistence:n}=await import("./unified-persistence-OP7FDQPD.js"),r=n();if(r.isInitialized()){let a=r.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-OP7FDQPD.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-SSVF5TE5.js"),n=new i(t.getDatabase());this.experienceCapture.setNullRecorder(r=>n.recordNullWhenUnlocked(r))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-ZOO7LMIC.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-35W4CIBV.js"),i=t(),n=this.patternStore,r=await n.getStats();this._domainTransferInterval=setInterval(async()=>{try{r=await n.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=r.byDomain?.[a]??0,o=r.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:r.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=K({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let n=U(i.value,t.value);return k(n)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return k([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),k([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(n=>n.pattern.id),avgSimilarity:t.length>0?t.reduce((n,r)=>n+r.similarity,0)/t.length:0};try{let n=`pattern-usage:search:${Date.now()}-${te().slice(0,8)}`;await this.memory.set(n,i,{persist:!0,ttl:10080*60})}catch(n){console.debug("[AQELearningEngine] Failed to track pattern search:",y(n))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let r of i)if(r.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let n=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let r of n)if(r.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let n=`task-${Date.now()}-${te().slice(0,8)}`,r=n;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{r=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(c){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(c))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let c=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});c.success&&c.value.length>0&&(s=c.value.map(g=>g.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:r!==n?r:void 0,appliedPatterns:s}));let d={id:o||r,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(d.id,d),d.id}async recordStep(e,t,i,n){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,n)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:n});let r=this.activeTasks.get(e);r&&r.steps.push({action:t,result:i,quality:n,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(r){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(r))}let n=this.activeTasks.get(e);if(n)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(n),n}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(n){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",n instanceof Error?n.message:n)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((n,r)=>n+(r.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),d=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),c=new Set,g=new Set;for(let m of d.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&c.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&c.add("javascript"),m.endsWith(".py")&&c.add("python"),m.endsWith(".go")&&c.add("go"),m.endsWith(".rs")&&c.add("rust");let w=a(e,"package.json");if(n(w))try{let m=b(r(w,"utf-8")),p={...m.dependencies,...m.devDependencies};p.react&&g.add("react"),p.vue&&g.add("vue"),p.vitest&&g.add("vitest"),p.jest&&g.add("jest"),p.playwright&&g.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(c),frameworks:Array.from(g),patterns:[],complexity:d.length>500?3:d.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},me={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ie=class{config;constructor(e){this.config={...me,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),n=e.slice(t),r=[],a=Date.now(),s=h(i.map(l=>l.tokenMetrics.costUsd)),o=h(n.map(l=>l.tokenMetrics.costUsd)),d=h(i.map(l=>l.tokenMetrics.savingsUsd)),c=h(n.map(l=>l.tokenMetrics.savingsUsd));if(o>s*1.1&&c<=d*1.05){let l=Math.min(1,(o-s)/(s||1));r.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(l),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(l=>l.qualityMetrics.gatePassRate)),w=h(n.map(l=>l.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&r.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let p=h(i.map(l=>l.learningMetrics.patternCount)),f=h(n.map(l=>l.learningMetrics.patternCount)),ne=h(i.map(l=>l.learningMetrics.averageConfidence)),O=h(n.map(l=>l.learningMetrics.averageConfidence)),re=Math.abs(f-p),ae=Math.abs(O-ne);re<1&&ae<.02&&r.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${O.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let x=h(i.map(l=>l.performanceMetrics.p95LatencyMs)),j=h(n.map(l=>l.performanceMetrics.p95LatencyMs));if(j>x*1.2&&x>0){let l=Math.min(1,(j-x)/(x||1));r.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${x.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(l),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return r}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(u){return u.length===0?0:u.reduce((e,t)=>e+t,0)/u.length}function A(u){return Math.max(0,Math.min(1,u))}function he(u,e,t){return new I(u,e,t)}function st(u,e,t){return he(u,{projectRoot:e},t)}export{ge as a,I as b,me as c,ie as d,he as e,st as f};
|
|
12
|
+
Duration: ${e.durationMs}ms`;return{patternType:t,qeDomain:e.domain,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:[...this.extractTags(e),this.experienceIdentity(e)],experienceOrigin:{task:e.task,domain:e.domain??null,patternType:t},testType:this.detectTestType(e.task)},template:{type:"workflow",content:n,variables:[{name:"task",type:"string",description:"The task to execute",required:!0}]}}}detectPatternType(e){let t=e.toLowerCase();return t.includes("test")||t.includes("spec")?(t.includes("unit")||t.includes("integration")||t.includes("e2e"),"test-template"):t.includes("mock")||t.includes("stub")?"mock-pattern":t.includes("assert")||t.includes("expect")?"assertion-pattern":t.includes("coverage")?"coverage-strategy":t.includes("api")||t.includes("contract")?"api-contract":t.includes("visual")||t.includes("screenshot")?"visual-baseline":t.includes("accessibility")||t.includes("a11y")?"a11y-check":t.includes("performance")||t.includes("perf")?"perf-benchmark":t.includes("flaky")?"flaky-fix":t.includes("refactor")?"refactor-safe":t.includes("error")||t.includes("exception")?"error-handling":"test-template"}experienceIdentity(e){return le("sha256").update(JSON.stringify([e.task,e.domain??null,this.detectPatternType(e.task)])).digest("hex")}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t} ${this.experienceIdentity(e)}`}extractTags(e){let t=[];e.domain&&t.push(e.domain),e.agent&&t.push(e.agent),e.model&&t.push(`model:${e.model}`);let i=e.task.toLowerCase().split(/\s+/),n=["unit","integration","e2e","api","mock","coverage","security"];for(let r of n)i.some(a=>a.includes(r))&&t.push(r);return t}detectTestType(e){let t=e.toLowerCase();if(t.includes("unit"))return"unit";if(t.includes("integration"))return"integration";if(t.includes("e2e")||t.includes("end-to-end"))return"e2e";if(t.includes("contract")||t.includes("api"))return"contract";if(t.includes("smoke"))return"smoke"}getRelatedDomains(e){return{"test-generation":["test-execution","coverage-analysis"],"test-execution":["test-generation","coverage-analysis","quality-assessment"],"coverage-analysis":["test-generation","test-execution"],"quality-assessment":["test-execution","defect-intelligence"],"defect-intelligence":["quality-assessment","code-intelligence"],"requirements-validation":["test-generation","quality-assessment"],"code-intelligence":["defect-intelligence","security-compliance"],"security-compliance":["code-intelligence","quality-assessment"],"contract-testing":["test-generation","test-execution"],"visual-accessibility":["quality-assessment","test-execution"],"chaos-resilience":["test-execution","quality-assessment"],"learning-optimization":[]}[e]||[]}emitExperienceCaptured(e){this.eventBus&&this.eventBus.publish({id:`exp-captured-${e.id}`,type:"learning.ExperienceCaptured",source:"learning-optimization",timestamp:new Date,payload:{experience:e,reward:e.reward,testOutcome:e.testOutcome}})}async loadStats(){try{let e=await this.memory.get(`${this.config.namespace}:stats`);e&&(this.stats.totalCaptured=e.totalCaptured,this.stats.successfulCaptures=e.successfulCaptures,this.stats.patternsExtracted=e.patternsExtracted,this.stats.patternsPromoted=e.patternsPromoted,this.stats.byDomain=new Map(e.byDomain))}catch(e){F.debug("Stats restoration failed, starting fresh",{error:e instanceof Error?e.message:String(e)})}}async saveStats(){try{await this.memory.set(`${this.config.namespace}:stats`,{totalCaptured:this.stats.totalCaptured,successfulCaptures:this.stats.successfulCaptures,patternsExtracted:this.stats.patternsExtracted,patternsPromoted:this.stats.patternsPromoted,byDomain:Array.from(this.stats.byDomain.entries())},{persist:!0})}catch(e){console.error("[ExperienceCapture] Failed to save stats:",e)}}};function ee(p,e,t,i){return new L(p,e,t,i)}var ge={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:T},I=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ge,...t}}memory;eventBus;config;reasoningBank;claudeFlowBridge;experienceCapture;patternStore;coherenceService;initialized=!1;_domainTransferEngine=null;_domainTransferInterval=null;activeTasks=new Map;completedTasks=0;claudeFlowErrors=0;async initialize(){if(!this.initialized){try{this.coherenceService=await H(J),this.coherenceService.isInitialized()&&console.log("[AQELearningEngine] CoherenceService initialized with WASM engines")}catch(e){console.log("[AQELearningEngine] CoherenceService WASM unavailable, using fallback:",y(e))}this.patternStore=N(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=G(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-HVAAVEOH.js"),t=await e();t&&this.reasoningBank.setRvfDualWriter(t)}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] RVF wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableExperienceCapture){this.experienceCapture=ee(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-KGFZJP32.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-KGFZJP32.js"),{getUnifiedPersistence:n}=await import("./unified-persistence-NILBWXDP.js"),r=n();if(r.isInitialized()){let a=r.getDatabase(),s=i(a),o=t(s);this.experienceCapture.setWitnessChain(o)}}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Witness chain wiring skipped:",e instanceof Error?e.message:e)}try{let{getUnifiedPersistence:e}=await import("./unified-persistence-NILBWXDP.js"),t=e();if(t.isInitialized()){let{PatternNullStore:i}=await import("./pattern-null-store-BKGTQFNF.js"),n=new i(t.getDatabase());this.experienceCapture.setNullRecorder(r=>n.recordNullWhenUnlocked(r))}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Null recorder wiring skipped:",e instanceof Error?e.message:e)}}try{let{isCrossDomainTransferEnabled:e}=await import("./feature-flags-OYYHY7LS.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-JWGNNA6K.js"),i=t(),n=this.patternStore,r=await n.getStats();this._domainTransferInterval=setInterval(async()=>{try{r=await n.getStats()}catch(a){process.env.DEBUG&&console.debug("[AQELearningEngine] Stats refresh failed:",a instanceof Error?a.message:a)}},6e4),this._domainTransferInterval.unref?.(),i.setPerformanceProvider(a=>{let s=r.byDomain?.[a]??0,o=r.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:r.avgConfidence??.5,patternCount:s,timestamp:Date.now()}}),this._domainTransferEngine=i}}catch(e){process.env.DEBUG&&console.debug("[AQELearningEngine] Domain transfer wiring skipped:",e instanceof Error?e.message:e)}if(this.config.enableClaudeFlow)try{this.claudeFlowBridge=K({projectRoot:this.config.projectRoot}),await this.claudeFlowBridge.initialize(),this.claudeFlowBridge.isAvailable()&&console.log("[AQELearningEngine] Claude Flow integration enabled")}catch(e){process.env.DEBUG&&console.log("[AQELearningEngine] Claude Flow not available, using standalone mode:",y(e))}this.initialized=!0,console.log("[AQELearningEngine] Initialized")}}getStatus(){let e=this.claudeFlowBridge?.getStatus();return{initialized:this.initialized,claudeFlowAvailable:e?.available??!1,features:{patternLearning:!0,vectorSearch:!0,taskRouting:!0,trajectories:e?.features.trajectories??!1,modelRouting:e?.features.modelRouting??!1,pretrain:e?.features.pretrain??!1}}}async getStats(){if(!this.initialized||!this.reasoningBank)throw new Error("Engine not initialized");let e=await this.reasoningBank.getStats(),t=this.experienceCapture?await this.experienceCapture.getStats():{totalExperiences:0,byDomain:{},successRate:0,avgQuality:0,patternsExtracted:0,patternsPromoted:0};return{...e,activeTasks:this.activeTasks.size,completedTasks:this.completedTasks,claudeFlowStatus:this.claudeFlowBridge?.getStatus()??{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,patternSearch:!1}},claudeFlowErrors:this.claudeFlowErrors,experienceCapture:t}}async storePattern(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.storePattern(e)}async searchPatterns(e,t){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.searchPatterns(e,t)}async getPattern(e){return!this.initialized||!this.reasoningBank?null:this.reasoningBank.getPattern(e)}async recordOutcome(e){return!this.initialized||!this.reasoningBank?E(new Error("Engine not initialized")):this.reasoningBank.recordOutcome(e)}async routeTask(e){if(!this.initialized||!this.reasoningBank)return E(new Error("Engine not initialized"));let t=await this.searchPatternsForTask(e.task,{limit:5,minConfidence:.4,domain:e.domain,contextFingerprint:e.domain?`${e.domain}:router`:void 0});t.success&&t.value.length>0&&await this.trackPatternSearch(e.task,t.value);let i=await this.reasoningBank.routeTask(e);if(i.success&&this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable(),i.success&&t.success){let n=U(i.value,t.value);return k(n)}return i}async route(e,t){let i=await this.routeTask({task:e,context:t});return i.success?i.value:null}async searchPatternsForTask(e,t={}){if(!this.reasoningBank)return k([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,contextFingerprint:t.contextFingerprint,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),k([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(n=>n.pattern.id),avgSimilarity:t.length>0?t.reduce((n,r)=>n+r.similarity,0)/t.length:0};try{let n=`pattern-usage:search:${Date.now()}-${te().slice(0,8)}`;await this.memory.set(n,i,{persist:!0,ttl:10080*60})}catch(n){console.debug("[AQELearningEngine] Failed to track pattern search:",y(n))}}async recommendModel(e){if(this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.modelRouter.routeTask(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow model routing failed:",t instanceof Error?t.message:t)}return this.localModelRoute(e)}async recordModelOutcome(e,t,i){this.claudeFlowBridge?.modelRouter.isClaudeFlowAvailable()&&await this.claudeFlowBridge.modelRouter.recordOutcome({task:e,model:t,outcome:i})}localModelRoute(e){let t=e.toLowerCase(),i=[/simple/i,/basic/i,/fix typo/i,/rename/i,/format/i,/add comment/i,/lint/i,/minor/i,/quick/i,/small/i];for(let r of i)if(r.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let n=[/architect/i,/design/i,/complex/i,/security/i,/performance/i,/refactor.*large/i,/critical/i,/analysis/i,/multi.*file/i,/distributed/i,/concurrent/i,/migration/i];for(let r of n)if(r.test(t))return{model:"opus",confidence:.8,reasoning:"High complexity task - using opus for capability"};return e.length>500?{model:"opus",confidence:.65,reasoning:"Long task description - using opus for complex reasoning"}:e.length<50?{model:"haiku",confidence:.6,reasoning:"Short task - using haiku for efficiency"}:{model:"sonnet",confidence:.7,reasoning:"Medium complexity - using sonnet for balance"}}async startTask(e,t,i){let n=`task-${Date.now()}-${te().slice(0,8)}`,r=n;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{r=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(l){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(l))}let a=`${i??"unknown"}:${t??"unknown"}`,s;try{let l=await this.searchPatternsForTask(e,{domain:i,contextFingerprint:a});l.success&&l.value.length>0&&(s=l.value.map(u=>u.pattern.id))}catch{}let o;this.experienceCapture&&(o=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:r!==n?r:void 0,appliedPatterns:s}));let c={id:o||r,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(c.id,c),c.id}async recordStep(e,t,i,n){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,n)}catch(a){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow recordStep failed (${this.claudeFlowErrors} total errors):`,y(a))}this.experienceCapture&&this.experienceCapture.recordStep(e,{action:t,result:i,quality:n});let r=this.activeTasks.get(e);r&&r.steps.push({action:t,result:i,quality:n,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(r){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(r))}let n=this.activeTasks.get(e);if(n)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(n),n}getTask(e){return this.activeTasks.get(e)}async analyzeCodebase(e,t="medium"){let i=e||this.config.projectRoot;if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.analyze(i,t)}catch(n){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",n instanceof Error?n.message:n)}return this.localAnalyze(i,t)}async generateAgentConfigs(e="yaml"){if(this.claudeFlowBridge?.pretrain.isClaudeFlowAvailable())try{return await this.claudeFlowBridge.pretrain.generateAgentConfigs(e)}catch(t){console.debug("[AQELearningEngine] Claude Flow agent config failed:",t instanceof Error?t.message:t)}return[{name:"qe-test-architect",type:"worker",capabilities:["test-generation","test-design"],model:"sonnet"},{name:"qe-coverage-specialist",type:"worker",capabilities:["coverage-analysis","gap-detection"],model:"haiku"},{name:"qe-security-scanner",type:"worker",capabilities:["security-scanning","vulnerability-detection"],model:"opus"}]}async captureExperience(e){if(!this.experienceCapture||!this.config.enableExperienceCapture)return;let t=e.steps.length>0?e.steps.reduce((n,r)=>n+(r.quality??.5),0)/e.steps.length:.5;await this.experienceCapture.completeCapture(e.id,{success:!0,quality:t});let i=await this.experienceCapture.getExperience(e.id);i&&i.quality>=.7&&await this.experienceCapture.shareAcrossDomains(i)}startExperienceCapture(e,t){if(this.experienceCapture)return this.experienceCapture.startCapture(e,t)}getExperienceCaptureService(){return this.experienceCapture}async localAnalyze(e,t){try{let{glob:i}=await import("tinyglobby"),{existsSync:n,readFileSync:r}=await import("fs"),{join:a}=await import("path"),c=await i(t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],{cwd:e,ignore:["node_modules/**","dist/**","coverage/**",".git/**"],expandDirectories:!1,onlyFiles:!0}),l=new Set,u=new Set;for(let m of c.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&l.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&l.add("javascript"),m.endsWith(".py")&&l.add("python"),m.endsWith(".go")&&l.add("go"),m.endsWith(".rs")&&l.add("rust");let w=a(e,"package.json");if(n(w))try{let m=b(r(w,"utf-8")),g={...m.dependencies,...m.devDependencies};g.react&&u.add("react"),g.vue&&u.add("vue"),g.vitest&&u.add("vitest"),g.jest&&u.add("jest"),g.playwright&&u.add("playwright")}catch(m){console.debug("[AQELearningEngine] package.json parse failed:",m instanceof Error?m.message:m)}return{success:!0,repositoryPath:e,depth:t,analysis:{languages:Array.from(l),frameworks:Array.from(u),patterns:[],complexity:c.length>500?3:c.length>100?2:1}}}catch(i){return{success:!1,repositoryPath:e,depth:t,error:y(i)}}}getGuidance(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.getGuidance(e,t)}generateContext(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.generateContext(e,t)}checkAntiPatterns(e,t){if(!this.reasoningBank)throw new Error("Engine not initialized");return this.reasoningBank.checkAntiPatterns(e,t)}async dispose(){this._domainTransferInterval&&(clearInterval(this._domainTransferInterval),this._domainTransferInterval=null),this._domainTransferEngine=null,this.experienceCapture&&await this.experienceCapture.dispose(),this.patternStore&&await this.patternStore.dispose(),this.reasoningBank&&await this.reasoningBank.dispose(),this.activeTasks.clear(),this.initialized=!1}},me={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ie=class{config;constructor(e){this.config={...me,...e}}runMetaLearningCycle(e){if(process.env.AQE_META_LEARNING_ENABLED!=="true")return[];if(!this.config.enabled)return[];if(e.length<this.config.minSnapshotsForAnalysis)return[];let t=Math.floor(e.length/2),i=e.slice(0,t),n=e.slice(t),r=[],a=Date.now(),s=h(i.map(d=>d.tokenMetrics.costUsd)),o=h(n.map(d=>d.tokenMetrics.costUsd)),c=h(i.map(d=>d.tokenMetrics.savingsUsd)),l=h(n.map(d=>d.tokenMetrics.savingsUsd));if(o>s*1.1&&l<=c*1.05){let d=Math.min(1,(o-s)/(s||1));r.push({id:`meta-tw-${a}`,type:"token-waste",description:`Token cost increased by ${((o/(s||1)-1)*100).toFixed(1)}% while savings remained flat`,confidence:A(d),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let u=h(i.map(d=>d.qualityMetrics.gatePassRate)),w=h(n.map(d=>d.qualityMetrics.gatePassRate));Math.abs(w-u)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&r.push({id:`meta-qp-${a}`,type:"quality-plateau",description:`Gate pass rate has been flat at ${(w*100).toFixed(1)}% across ${e.length} snapshots`,confidence:A(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let g=h(i.map(d=>d.learningMetrics.patternCount)),f=h(n.map(d=>d.learningMetrics.patternCount)),ne=h(i.map(d=>d.learningMetrics.averageConfidence)),O=h(n.map(d=>d.learningMetrics.averageConfidence)),re=Math.abs(f-g),ae=Math.abs(O-ne);re<1&&ae<.02&&r.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${O.toFixed(2)}) have stagnated`,confidence:A(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let x=h(i.map(d=>d.performanceMetrics.p95LatencyMs)),j=h(n.map(d=>d.performanceMetrics.p95LatencyMs));if(j>x*1.2&&x>0){let d=Math.min(1,(j-x)/(x||1));r.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${x.toFixed(0)}ms to ${j.toFixed(0)}ms`,confidence:A(d),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return r}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(p){return p.length===0?0:p.reduce((e,t)=>e+t,0)/p.length}function A(p){return Math.max(0,Math.min(1,p))}function he(p,e,t){return new I(p,e,t)}function st(p,e,t){return he(p,{projectRoot:e},t)}export{ge as a,I as b,me as c,ie as d,he as e,st as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{d as s}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{d as s}from"./chunk-MQM37KAR.js";s();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as c,e as h}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as c,e as h}from"./chunk-Z7SD7LXM.js";import{a as l,d}from"./chunk-M24ZAZ4U.js";d();h();var u=class{store=new Map;vectors=new Map;cleanupInterval;async initialize(){this.cleanupInterval=setInterval(()=>this.cleanup(),c.CLEANUP_INTERVAL_MS),this.cleanupInterval.unref&&this.cleanupInterval.unref()}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.store.clear(),this.vectors.clear()}async set(t,r,e){let s={value:r,namespace:e?.namespace??"default",createdAt:Date.now()};e?.ttl&&(s.expiresAt=Date.now()+e.ttl*c.TTL_MULTIPLIER_MS);let n=this.buildKey(t,e?.namespace);this.store.set(n,s)}async get(t,r){let e=this.buildKey(t,r?.namespace),s=this.store.get(e);if(s){if(s.expiresAt&&Date.now()>s.expiresAt){this.store.delete(e);return}return s.value}}async delete(t,r){let e=this.buildKey(t,r?.namespace);return this.store.delete(e)}async has(t,r){return await this.get(t,r)!==void 0}async search(t,r=c.DEFAULT_SEARCH_LIMIT,e){let s=t.replace(/[.+^${}()|[\]\\]/g,"\\$&"),n=new RegExp(`^${s.replace(/\*/g,".*").replace(/\?/g,".")}$`,"su"),i=[],o=e?.namespace?`${e.namespace}:`:void 0;for(let a of this.store.keys()){if(o&&!a.startsWith(o))continue;let p=o?a.slice(o.length):a;if(n.test(p)&&(i.push(a),i.length>=r))break}return i}async vectorSearch(t,r,e){let s=[];for(let[n,i]of this.vectors.entries()){if(e&&!n.startsWith(e))continue;let o=l(t,i.embedding);s.push({key:n,score:o,metadata:i.metadata})}return s.sort((n,i)=>i.score-n.score).slice(0,r)}getVectorSearchProvenance(){return{backend:"in-memory",indexType:"flat",approximate:!1,estimatedRecall:1}}async storeVector(t,r,e){this.vectors.set(t,{embedding:r,metadata:e})}buildKey(t,r){return r?`${r}:${t}`:t}cleanup(){let t=Date.now();for(let[r,e]of this.store.entries())e.expiresAt&&t>e.expiresAt&&this.store.delete(r)}getStats(){return{entries:this.store.size,vectors:this.vectors.size}}async clear(t){if(t){let r=`${t}:`;for(let e of this.store.keys())e.startsWith(r)&&this.store.delete(e)}else this.store.clear()}async count(t){let r=0,e=`${t}:`;for(let s of this.store.keys())if(s.startsWith(e)){let n=this.store.get(s);n&&(!n.expiresAt||Date.now()<=n.expiresAt)&&r++}return r}async hasCodeIntelligenceIndex(){return await this.count("code-intelligence:kg")>0}};export{u as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as T}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as T}from"./chunk-BDVFSMOQ.js";var S,E,t,N,_=T(()=>{"use strict";S={MMAP_SIZE_BYTES:67108864,CACHE_SIZE_KB:-32e3,BUSY_TIMEOUT_MS:5e3,DEFAULT_VECTOR_DIMENSIONS:384,DEFAULT_SEARCH_LIMIT:100,CLEANUP_INTERVAL_MS:6e4,TTL_MULTIPLIER_MS:1e3},E={M_CONNECTIONS:16,EF_CONSTRUCTION:200,EF_SEARCH:100,DEFAULT_K_NEIGHBORS:10,COVERAGE_VECTOR_DIMENSION:384},t={MAX_CONCURRENT_AGENTS:15,DEFAULT_AGENT_TTL_MS:36e5,DEFAULT_AGENT_TIMEOUT_MS:12e4,MAX_POOL_SIZE:10},N={MAX_HISTORY_SIZE:1e4}});export{S as a,E as b,t as c,N as d,_ as e};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as S}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as S}from"./chunk-BDVFSMOQ.js";import{createHash as C}from"crypto";import*as a from"fs";import*as c from"os";import*as n from"path";function P(t){try{return a.realpathSync.native(t)}catch{return t}}function i(){let t="",r="";try{t=c.tmpdir()}catch{}try{r=c.homedir()}catch{}return{platform:process.platform,tmpdir:t,homedir:r,env:process.env,realpath:P}}function m(t){return t==="win32"?n.win32:n.posix}function l(t,r=i()){let e=m(r.platform),o=e.resolve(r.realpath(e.resolve(t))),s=e.parse(o).root.length;for(;o.length>s&&/[\\/]$/.test(o);)o=o.slice(0,-1);return r.platform==="win32"?o.toLowerCase():o}function w(t,r=i()){let e=m(r.platform),o=l(t,r);if(r.tmpdir&&o===l(r.tmpdir,r))return!0;if(r.platform==="win32")return o===e.parse(o).root.toLowerCase();let s=e.resolve(t);return y.some(p=>p===s||l(p,r)===o)}function b(t,r=i()){if(r.platform==="win32")return!1;try{return(a.statSync(t).mode&514)===514}catch{return!1}}function k(t,r=i()){return w(t,r)||b(t,r)}function A(t=i()){let r=m(t.platform),e;if(t.platform==="win32")e=t.env.LOCALAPPDATA||r.join(t.homedir,"AppData","Local");else if(t.platform==="darwin")e=r.join(t.homedir,"Library","Caches");else{let o=t.env.XDG_CACHE_HOME;e=o&&r.isAbsolute(o)?o:r.join(t.homedir,".cache")}return r.join(e,"agentic-qe","scratch")}function E(t,r=i()){let e=C("sha256").update(l(t,r)).digest("hex").slice(0,16);return m(r.platform).join(A(r),e)}function u(t){a.mkdirSync(t,{recursive:!0,mode:448}),process.platform!=="win32"&&a.chmodSync(t,448)}function R(t,r=i()){let e=E(t,r);try{return u(e),d(e,t),e}catch(o){let s=typeof process.getuid=="function"?String(process.getuid()):"user",p=n.join(r.tmpdir||c.tmpdir(),`agentic-qe-scratch-${s}`),f=n.join(p,n.basename(e));try{return u(p),u(f),d(f,t),f}catch(v){let g=h=>h instanceof Error?h.message:String(h);throw new Error(`Cannot create a private AQE scratch root for "${t}". User cache "${e}" failed: ${g(o)}. Temporary fallback "${f}" failed: ${g(v)}. Set AQE_PROJECT_ROOT to a project directory or make the user cache writable.`)}}}function d(t,r){let e=n.join(t,"SCRATCH_ROOT_FOR");try{a.existsSync(e)||a.writeFileSync(e,`${n.resolve(r)}
|
|
3
3
|
`,{mode:384})}catch{}}var y,O=S(()=>{"use strict";y=["/","/tmp","/var/tmp","/usr/tmp","/dev/shm","/run/shm","/private","/private/tmp","/private/var","/private/var/tmp","/var","/usr","/etc","/opt","/srv","/mnt","/media","/run","/home","/Users","/Volumes"]});export{w as a,b,k as c,E as d,R as e,O as f};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as e}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as e}from"./chunk-BDVFSMOQ.js";function r(t){t.exec(n)}var n,a=e(()=>{"use strict";n=`
|
|
3
3
|
-- Negative pattern records (ADR-110 kept nulls)
|
|
4
4
|
CREATE TABLE IF NOT EXISTS qe_pattern_nulls (
|
|
5
5
|
id TEXT PRIMARY KEY,
|
|
@@ -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.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
2
|
function l(s,e){let t=s.prepare("SELECT confidence, usage_count, successful_uses FROM qe_patterns WHERE id = ?").get(e.patternId);if(!t)return{updated:!1};let u=e.success?1:0,n=t.usage_count+1,a=t.successful_uses+u,c=a/n,r=Math.min(1,n/100),o=t.confidence*.3+r*.2+c*.5,i=s.prepare(`
|
|
3
3
|
INSERT INTO qe_pattern_usage (pattern_id, success, metrics_json, feedback)
|
|
4
4
|
VALUES (?, ?, ?, ?)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{e as U,h as W,i as G}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{e as U,h as W,i as G}from"./chunk-LLQ2UMF6.js";import{b as F}from"./chunk-B52ULNYO.js";import{o as j,q as V}from"./chunk-LOJ7OO6W.js";import{b as D,c as $,d as Y}from"./chunk-SRVNR3R3.js";import{a as T,e as N}from"./chunk-AWQAE3SW.js";N();Y();import*as C from"fs";import*as b from"path";import*as H from"yaml";var z=5,X=4,Z=3e4,ee=".claude/skills",te=5e3,se=500,K=100,re=1e3,q=500,ne=.8,ae=.2,ie=.1,w=.1,oe=.1,le=.1,ce=.1,ue=200,de=500,pe=300,me=1,ge=.9,Q={maxWorkers:z,batchSize:X,retryFailedTests:!0,timeout:Z,skillsDir:ee,progressIntervalMs:te},S=class{async execute(e,r,s){let t=$(K,se+K);return await new Promise(i=>setTimeout(i,t)),{output:this.generateMockResponse(e),tokensUsed:D(q,re+q),durationMs:t}}generateMockResponse(e){let r=[];return e.includes("alt")&&r.push("alt","1.1.1","perceivable"),e.includes("contrast")&&r.push("contrast","1.4.3","4.5:1"),e.includes("keyboard")&&r.push("keyboard","2.1.1","operable","button"),e.includes("label")&&r.push("label","3.3.2","understandable"),e.includes("ARIA")&&r.push("ARIA","4.1.2","robust"),e.includes("focus")&&r.push("focus","2.4.7","outline"),e.includes("lang")&&r.push("lang","3.1.1","language"),e.includes("caption")&&r.push("caption","1.2.2","track"),e.includes("accessible")&&r.push("accessible","compliant"),r.length===0&&r.push("accessibility","WCAG","finding"),`Analysis complete. Found issues related to: ${r.join(", ")}.
|
|
3
3
|
Recommendations: Implement proper ${r[0]} attributes for better accessibility.
|
|
4
4
|
Severity: ${e.includes("critical")?"critical":"serious"}`}},P=class{constructor(e,r,s){this.executor=r;this.config=s;this.id=e}executor;config;id;status="idle";tasksCompleted=0;tasksFailed=0;lastHeartbeat=Date.now();async executeBatch(e){this.status="running";let r=[];for(let s of e){this.lastHeartbeat=Date.now();try{let t=await this.executeTestCase(s);if(r.push(t),t.passed)this.tasksCompleted++;else if(this.tasksFailed++,this.config.retryFailedTests&&!t.passed){let a=await this.executeTestCase(s,!0);a.passed&&(r[r.length-1]=a,this.tasksCompleted++,this.tasksFailed--)}}catch(t){this.tasksFailed++,r.push({testId:s.testCaseId,passed:!1,expectedPatterns:s.testCase.expected_output.must_contain||[],actualPatterns:[],reasoningQuality:0,category:s.testCase.category,priority:s.testCase.priority,error:T(t)})}}return this.status="idle",r}async executeTestCase(e,r=!1){let s=Date.now(),t=this.buildPrompt(e),a=await this.executor.execute(t,e.model,{timeout:this.config.timeout}),i=this.validateResponse(a.output,e.testCase.expected_output,e.testCase.validation);return{testId:e.testCaseId,passed:i.passed,expectedPatterns:e.testCase.expected_output.must_contain||[],actualPatterns:i.foundPatterns,reasoningQuality:i.reasoningQuality,executionTimeMs:Date.now()-s,category:e.testCase.category,priority:e.testCase.priority,error:i.error}}buildPrompt(e){let{testCase:r}=e,s=r.input.context;return`Analyze the following ${s.language||"HTML"} code for accessibility issues.
|
|
5
5
|
Context: ${s.description||r.description}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
2
|
var r="insufficient-evidence";function s(t,n){let e=n&&typeof n=="object"?n:null;return e&&(e.status===r||e.evidenceStatus===r)?!1:t==="coverage-analysis"?e?.measured===!0:!0}export{s as a};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{c as U,d as j,e as _}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{c as U,d as j,e as _}from"./chunk-O6UWIXME.js";import"./chunk-B6S4FC7M.js";import"./chunk-HGG4HR7C.js";import{d as x,e as k}from"./chunk-VEGUYUVS.js";import"./chunk-54RCGMLB.js";import{a as F,b as G,d as L}from"./chunk-OYGKSSSI.js";import"./chunk-XJN3RKUD.js";import"./chunk-OBCXCRXK.js";import{g as D,j as Q,l as N}from"./chunk-4HL3SD4A.js";import"./chunk-OA4EQDC4.js";import"./chunk-A3GDX6UF.js";import"./chunk-MQM37KAR.js";import"./chunk-YP2GHQSV.js";import"./chunk-ZDWD73UF.js";import"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";import{Command as W}from"commander";import s from"chalk";import*as $ from"fs";import*as u from"path";async function J(n,a,f,P,v){let e=Date.now(),i=[];if(!n.enabled)return{phase:n.name,type:n.type,status:"skipped",duration:0,exitCode:0,summary:"Phase disabled",artifacts:[]};try{let r={},c="passed",m="",b;switch(n.type){case"test":{let l=await a.kernel.getDomainAPIAsync("test-generation");if(!l)return T(n,e,"failed",1,"Test generation domain not available",i);let h=n.config.target||".",{walkSourceFiles:p}=await import("./file-discovery-LGBTY3ID.js"),o=u.resolve(h),S=p(o,{includeTests:!1}),w=await l.generateTests({sourceFiles:S,testType:n.config.type||"unit",framework:n.config.framework||"vitest",coverageTarget:80});if(w.success&&w.value){let g=w.value;r={testsGenerated:g.tests.length,coverageEstimate:g.coverageEstimate},m=`Generated ${g.tests.length} tests (${g.coverageEstimate==null?"coverage unmeasured":`est. ${g.coverageEstimate}% coverage`})`;let y=u.join(f,"test-generation.json");$.writeFileSync(y,k(g),"utf-8"),i.push(y)}else c="failed",m=w.error?.message||"Test generation failed";break}case"coverage":{let l=await a.kernel.getDomainAPIAsync("coverage-analysis");if(!l)return T(n,e,"failed",1,"Coverage analysis domain not available",i);let h=n.config.target||".",p=n.config.threshold||80,o=await U(l,u.resolve(h),p,()=>{}),S=_(o,p,u.resolve(h));r={...S.summary??{},...S,threshold:p},delete r.summary;let g=I=>I==null?"n/a":`${Math.round(I*10)/10}%`;switch(o.kind){case"measured":{if(o.insufficientEvidence.length>0){c="warning",b=j(o,p),m=`INSUFFICIENT EVIDENCE \u2014 ${o.insufficientEvidence.join("; ")}`;break}c=o.verdict.meetsThreshold?"passed":"warning",m=`Line: ${g(o.summary.line)}, Branch: ${g(o.summary.branch)} \u2014 ${o.verdict.meetsThreshold?"meets":"below"} ${p}% threshold (measured)`;break}case"estimate":{c="warning",b=j(o,p),m=`UNMEASURED \u2014 no coverage report; heuristic ESTIMATE only (line ~${g(o.summary.line)}), not gated. Run tests with coverage to measure.`;break}case"unmeasured":{c="warning",b=j(o,p),m=`UNMEASURED \u2014 ${o.message}`;break}case"no-sources":{c="warning",m="No source files found";break}default:c="failed",m=o.message}let y=u.join(f,"coverage.json");$.writeFileSync(y,k(S),"utf-8"),i.push(y);break}case"security":{let l=await a.kernel.getDomainAPIAsync("security-compliance");if(!l)return T(n,e,"failed",1,"Security domain not available",i);let h=n.config.target||".",{walkSourceFiles:p}=await import("./file-discovery-LGBTY3ID.js"),o=u.resolve(h),S=p(o,{includeTests:!0}),w=await l.runSASTScan(S);if(w.success&&w.value){let g=w.value,y=g.vulnerabilities||[],I=y.filter(d=>d.severity==="high"||d.severity==="critical").length;r={vulnerabilities:y.length,high:I},c=I>0?"failed":y.length>0?"warning":"passed",m=y.length===0?"No vulnerabilities found":`${y.length} vulnerabilities (${I} high/critical)`;let{toSARIF:E}=await import("./ci-output-DSRBYEIK.js"),q=u.join(f,"security.sarif");$.writeFileSync(q,E({vulnerabilities:y,target:h,scanType:"SAST"}),"utf-8"),i.push(q);let t=u.join(f,"security.json");$.writeFileSync(t,k(g),"utf-8"),i.push(t)}else c="failed",m=w.error?.message||"Security scan failed";break}case"quality-gate":{try{let h=await Q(a.kernel.memory),p=N(h,{coverage:v});r={...p,metrics:h,evidenceStatus:"measured"},c=p.passed?"passed":"failed",m=`Quality gate: ${p.passed?"PASSED":"FAILED"} (${p.checks.filter(o=>o.passed).length}/${p.checks.length} measured checks passed)`}catch(h){c="failed",m=`Quality gate: ${h instanceof Error?h.message:String(h)}`,r=h instanceof D?{...h.toDetails(),error:m,checks:[]}:{passed:!1,evidenceStatus:"unavailable",error:m,checks:[]}}let l=u.join(f,`quality-gate-${P+1}.json`);$.writeFileSync(l,k(r),"utf-8"),i.push(l);break}case"code-intelligence":{let l=await a.kernel.getDomainAPIAsync("code-intelligence");if(!l)return T(n,e,"failed",1,"Code intelligence domain not available",i);let h=n.config.target||".",{walkSourceFiles:p}=await import("./file-discovery-LGBTY3ID.js"),o=u.resolve(h),S=p(o,{includeTests:!1}),w=await l.index({paths:S,target:o,incremental:!0});if(w.success&&w.value){let g=w.value;r=g,m=`Indexed ${g.filesIndexed} files, ${g.nodesCreated} nodes`;let y=u.join(f,"code-intelligence.json");$.writeFileSync(y,k(g),"utf-8"),i.push(y)}else c="warning",m=w.error?.message||"Code intelligence indexing incomplete";break}default:m=`Custom phase "${n.name}" \u2014 no built-in handler`,c="warning"}let R=Date.now()-e;return{phase:n.name,type:n.type,status:c,duration:R,exitCode:b??(c==="failed"?1:0),summary:m,artifacts:i,details:r}}catch(r){let c=Date.now()-e;return{phase:n.name,type:n.type,status:"failed",duration:c,exitCode:1,summary:`Error: ${r instanceof Error?r.message:String(r)}`,artifacts:i}}}function T(n,a,f,P,v,e){return{phase:n.name,type:n.type,status:f,duration:Date.now()-a,exitCode:P,summary:v,artifacts:e}}function O(n){let a=`# AQE CI/CD Report
|
|
3
3
|
|
|
4
4
|
`;a+=`**Status:** ${n.overallStatus==="passed"?"PASSED":n.overallStatus==="warning"?"WARNING":"FAILED"}
|
|
5
5
|
`,a+=`**Duration:** ${(n.duration/1e3).toFixed(1)}s
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-OYGKSSSI.js";import"./chunk-BDVFSMOQ.js";export{a as findCIConfigFile,d as getDefaultCIConfig,c as parseCIConfigContent,b as parseCIConfigFile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k}from"./chunk-VEGUYUVS.js";import"./chunk-BDVFSMOQ.js";export{b as FORMAT_OPTION,c as OUTPUT_OPTION,h as coverageToMarkdown,i as qualityGateToMarkdown,a as securityExecutionStatus,j as securityToMarkdown,k as testRunToMarkdown,e as toJSON,g as toJUnit,f as toSARIF,d as writeOutput};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,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.15.18");process.exit(0)}
|
|
2
|
+
import{a,b}from"./chunk-544KDWL4.js";import"./chunk-BDVFSMOQ.js";export{a as AdvisorCircuitBreaker,b as AdvisorCircuitBreakerError};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as g}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as g}from"./chunk-4CVNVBX5.js";import{b as p}from"./chunk-XZLIF4O2.js";import{b as f,d as h}from"./chunk-MQM37KAR.js";import{a as d,e as v}from"./chunk-AWQAE3SW.js";import{a as b}from"./chunk-BDVFSMOQ.js";import{existsSync as c,readFileSync as m}from"node:fs";h();v();import{join as a}from"node:path";async function C(t,e){let o=p(t);if(e&&o.available&&console.log(`[ClaudeFlow] Detected via ${o.method}${o.version?`: v${o.version}`:""}`),!o.available)return{available:!1};let r={"mcp-config":"mcp","local-binary":"cli","npx-cached":"cli","npm-dependency":"npm"};return{available:!0,version:o.version,method:o.method?r[o.method]:void 0}}async function F(t){return{trajectories:!0,modelRouting:!0,pretrain:!0,workers:!0,patternSearch:!0}}function S(t,e){return{version:"1.0",projectRoot:t,integration:{enabled:!0,features:{trajectories:e.trajectories,modelRouting:e.modelRouting,pretrain:e.pretrain,workers:e.workers}},learning:{trajectoryStorage:e.trajectories?"claude-flow":"local",patternSearch:e.patternSearch?"claude-flow":"local"},routing:{modelRouting:e.modelRouting?"claude-flow":"rule-based",preferences:{simple:"haiku",standard:"sonnet",complex:"opus"}},pretrain:{enabled:e.pretrain,depth:"medium",autoRun:!0},workers:{enabled:e.workers,autoDispatch:["optimize","consolidate"]}}}function R(t){let e=a(t,".claude","settings.json"),o={};if(c(e))try{o=f(m(e,"utf-8"))}catch{}o.mcpServers||(o.mcpServers={});let r=o.mcpServers;!r.ruflo&&!r["claude-flow"]&&(r.ruflo={command:"npx",args:["ruflo@3.5.18","mcp"],env:{}}),g(e,JSON.stringify(o,null,2))}async function O(t){let{projectRoot:e,force:o,checkOnly:r,debug:s}=t,n=await C(e,s);if(!n.available&&!o)return{available:!1,features:{trajectories:!1,modelRouting:!1,pretrain:!1,workers:!1,patternSearch:!1}};let l=await F(e);if(r)return{available:n.available,version:n.version,features:l};let w=a(e,".agentic-qe"),u=a(w,"claude-flow-integration.json");try{let i=S(e,l);g(u,JSON.stringify(i,null,2)),s&&console.log(`[ClaudeFlow] Config written to: ${u}`)}catch(i){return{available:n.available,version:n.version,features:l,error:`Failed to write config: ${d(i)}`}}try{R(e)}catch(i){s&&console.log("[ClaudeFlow] MCP config update failed:",d(i))}return{available:!0,version:n.version,features:l,configPath:u}}function $(t){let e=a(t,".agentic-qe","claude-flow-integration.json");return c(e)}function D(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(!c(e))return null;try{return f(m(e,"utf-8"))}catch{return null}}function M(t){let e=a(t,".agentic-qe","claude-flow-integration.json");if(c(e))try{return b("node:fs").rmSync(e),!0}catch{return!1}return!0}export{D as getClaudeFlowConfig,$ as isClaudeFlowConfigured,M as removeClaudeFlowIntegration,O as setupClaudeFlowIntegration};
|
|
@@ -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.15.18");process.exit(0)}
|
|
2
|
+
import{c as a,d as b,e as c}from"./chunk-6P3Y45QL.js";import"./chunk-L7PSU2YN.js";import"./chunk-OA4EQDC4.js";import"./chunk-F4AGNKL2.js";import"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";c();export{a as VibiumClientImpl,b as VibiumClientProvider};
|
|
@@ -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.15.
|
|
2
|
-
import{b as f}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as f}from"./chunk-VCCTTKP3.js";import{a as m,e as v}from"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";v();import{existsSync as s,mkdirSync as p,readFileSync as u,writeFileSync as a}from"fs";import{join as h,dirname as d}from"path";var l=class{projectRoot;overwrite;options;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=f()}async install(){let e={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("cline",{memoryBackend:this.options.memoryBackend}),r=h(this.projectRoot,t.path);if(e.configPath=r,!s(r)||this.overwrite){let o=d(r);if(s(o)||p(o,{recursive:!0}),s(r)&&this.overwrite){let c=this.mergeExistingConfig(r,t.content);a(r,c)}else a(r,t.content);e.mcpConfigured=!0}let n=this.generator.generateBehavioralRules("cline"),i=h(this.projectRoot,n.path);if(e.modePath=i,!s(i)||this.overwrite){let o=d(i);if(s(o)||p(o,{recursive:!0}),s(i)&&this.overwrite){let c=this.mergeExistingModes(i,n.content);a(i,c)}else a(i,n.content);e.modeInstalled=!0}}catch(t){e.success=!1,e.errors.push(`Cline installation failed: ${m(t)}`)}return e}mergeExistingConfig(e,t){try{let r=JSON.parse(u(e,"utf-8")),n=JSON.parse(t);return r.mcpServers||(r.mcpServers={}),Object.assign(r.mcpServers,n.mcpServers),JSON.stringify(r,null,2)+`
|
|
3
3
|
`}catch{return t}}mergeExistingModes(e,t){try{let r=JSON.parse(u(e,"utf-8")),n=JSON.parse(t);if(!Array.isArray(r))return t;let i=r.filter(o=>o.slug!=="qe-engineer");return i.push(...n),JSON.stringify(i,null,2)+`
|
|
4
4
|
`}catch{return t}}};function x(g){return new l(g)}export{l as ClineInstaller,x as createClineInstaller};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as T,b as D}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as T,b as D}from"./chunk-HGG4HR7C.js";import{d as $,e as C}from"./chunk-VEGUYUVS.js";import"./chunk-OBCXCRXK.js";import"./chunk-BDVFSMOQ.js";import{Command as z}from"commander";import e from"chalk";function O(P,p,A){return new z("code").description("Code intelligence analysis").argument("<action>","Action (index|search|impact|deps|complexity|c4)").argument("[target]","Target path or query").option("--depth <depth>","Analysis depth","3").option("--include-tests","Include test files").option("--incremental","Incremental indexing (index action only)").option("--git-since <ref>","Index changes since git ref (index action only)").option("--level <level>","C4 level for c4 action (context|container|component|all)","all").option("-F, --format <format>","Output format (text|json)","text").option("-o, --output <path>","Write output to file").addHelpText("after",`
|
|
3
3
|
Examples:
|
|
4
4
|
aqe code index src/ Index source files into knowledge graph
|
|
5
5
|
aqe code index src/ --incremental Incremental index (only changed files)
|
|
@@ -13,7 +13,7 @@ Examples:
|
|
|
13
13
|
aqe code c4 . --format json -o c4.json Full C4 result as JSON
|
|
14
14
|
`).action(async(b,m,i)=>{if(await A())try{let u=await P.kernel.getDomainAPIAsync("code-intelligence");if(!u){console.log(e.red("Code intelligence domain not available"));return}let v=await import("path"),k=i.format||"text",I=parseInt(i.depth);if(isNaN(I)||I<1){console.log(e.red(`Invalid --depth value: "${i.depth}" (must be a positive integer)`));return}if(b==="index"){let d=i.incremental||!1,s=i.gitSince,r=d?"Incrementally indexing":"Indexing";console.log(e.blue(`
|
|
15
15
|
${r} codebase at ${m||"."}${s?` (since ${s})`:""}...
|
|
16
|
-
`));let n=v.resolve(m||"."),g;if(s){let{getGitRefError:t}=await import("./ref-validation-
|
|
16
|
+
`));let n=v.resolve(m||"."),g;if(s){let{getGitRefError:t}=await import("./ref-validation-EYIP7DHW.js"),c=t(s,"--git-since ref");if(c)return console.log(e.red(c)),await p(1);let{execFileSync:f}=await import("child_process");try{let h=f("git",["diff","--name-only","--diff-filter=ACMR",s,"--",n],{encoding:"utf-8",cwd:process.cwd()}).trim();g=h?h.split(`
|
|
17
17
|
`).filter(y=>T.has(v.extname(y))).map(y=>v.resolve(y)):[]}catch{console.log(e.yellow(` Warning: git diff failed for ref "${s}", falling back to full scan`)),g=D(n,{includeTests:i.includeTests||!1})}}else g=D(n,{includeTests:i.includeTests||!1});console.log(e.gray(` Found ${g.length} files to index...
|
|
18
18
|
`));let o=await u.index({paths:g,target:n,incremental:d,includeTests:i.includeTests||!1});if(o.success&&o.value){let t=o.value;if(k==="json")$(C(t),i.output);else{if(console.log(e.green(`Indexing complete
|
|
19
19
|
`)),console.log(e.cyan(" Results:")),console.log(` Files indexed: ${e.white(t.filesIndexed)}`),console.log(` Nodes created: ${e.white(t.nodesCreated)}`),console.log(` Edges created: ${e.white(t.edgesCreated)}`),console.log(` Duration: ${e.yellow(t.duration+"ms")}`),t.warnings&&t.warnings.length>0){console.log(e.yellow(`
|
package/dist/cli/chunks/{code-index-extractor-BZJ3UDP4.js → code-index-extractor-2FID75YV.js}
RENAMED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import"./chunk-BDVFSMOQ.js";import{readFile as m}from"fs/promises";var d=new Set(["if","for","while","switch","catch","return","new","throw","import","export","constructor"]),h=50;function x(o,c){let n=c.split(`
|
|
3
3
|
`),e=[],i=[];for(let t=0;t<n.length;t++){let s=n[t],a=s.match(/(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s+(\w+)/);if(a){e.push({type:"function",name:a[1],lineStart:t+1});continue}let l=s.match(/(?:export\s+)?(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s+)?(?:\([^)]*\)|[a-zA-Z_]\w*)\s*(?::\s*[^=]+)?\s*=>/);if(l){e.push({type:"function",name:l[1],lineStart:t+1});continue}let u=s.match(/(?:export\s+)?(?:default\s+)?(?:abstract\s+)?class\s+(\w+)/);if(u){e.push({type:"class",name:u[1],lineStart:t+1});continue}let f=s.match(/(?:export\s+)?interface\s+(\w+)/);if(f){e.push({type:"interface",name:f[1],lineStart:t+1});continue}let r=s.match(/^\s+(?:(?:public|private|protected|static|readonly|override|abstract|async)\s+)*(\w+)\s*(?:<[^>]*>)?\s*\([^)]*\)\s*(?::\s*[^{]+)?\s*\{?\s*$/);if(r&&!d.has(r[1])){e.push({type:"function",name:r[1],lineStart:t+1});continue}let p=s.match(/(?:import|from)\s+['"](\.[^'"]+)['"]/);p&&i.push(p[1])}return{path:o,entities:e,imports:i}}async function y(o){let c=[];for(let n=0;n<o.length;n+=h){let e=o.slice(n,n+h),i=await Promise.allSettled(e.map(async t=>{let s=await m(t,"utf-8");return x(t,s)}));for(let t of i)t.status==="fulfilled"&&c.push(t.value)}return{files:c}}export{y as extractCodeIndex};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as N}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as N}from"./chunk-GZ4VB5RI.js";import{a as j}from"./chunk-4CVNVBX5.js";import{b as I}from"./chunk-VCCTTKP3.js";import{a as P}from"./chunk-UWSJVKTE.js";import"./chunk-MQM37KAR.js";import{a as b,e as B}from"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";B();import{copyFileSync as E,existsSync as l,mkdirSync as k,readFileSync as v,readdirSync as G,statSync as w,writeFileSync as C}from"fs";import{join as n,dirname as S}from"path";import{fileURLToPath as $}from"url";var U=512,D=`# Agentic QE
|
|
3
3
|
|
|
4
4
|
Preserve project data, especially .agentic-qe/memory.db. Read affected code and tests before editing, validate inputs at system boundaries, and run focused checks before broader gates. Discover AQE tools and skills from their live schemas.`,O=class y{projectRoot;overwrite;options;generator;static AGENTS_START="<!-- BEGIN AGENTIC-QE CODEX -->";static AGENTS_END="<!-- END AGENTIC-QE CODEX -->";constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=I()}async install(){let e={success:!0,mcpConfigured:!1,agentsMdInstalled:!1,hooksConfigured:!1,skillsInstalled:0,errors:[],configPath:"",agentsMdPath:"",hooksPath:n(this.projectRoot,".codex","hooks.json"),skillsPath:n(this.projectRoot,".agents","skills"),guidancePolicy:this.options.guidancePolicy??"full",ownedGuidanceBytes:0,components:{mcp:{status:"skipped"},rules:{status:"skipped"},hooks:{status:"unavailable"},skills:{status:"unavailable"}}};try{let t=this.generator.generateMcpConfig("codex",{memoryBackend:this.options.memoryBackend}),s=n(this.projectRoot,t.path);e.configPath=s;let o=l(s);if(this.options.installMcp!==!1&&(!o||this.overwrite)){let r=S(s);if(l(r)||k(r,{recursive:!0}),l(s)&&this.overwrite){let c=this.mergeExistingTomlConfig(s,t.content);C(s,c)}else C(s,t.content);e.mcpConfigured=!0,e.components.mcp.status=o?"updated":"installed"}else this.options.installMcp!==!1&&o&&(e.components.mcp.status="preserved")}catch(t){this.recordComponentFailure(e,"mcp",t)}try{let t=this.options.guidancePolicy??"full",s=this.generator.generateBehavioralRules("codex"),o=n(this.projectRoot,s.path);e.agentsMdPath=o;let r=l(o);if(t==="none")if(!r)e.components.rules.status="skipped";else{let c=v(o,"utf-8"),i=this.removeOwnedAgentsSections(c);i!==c?(C(o,i),e.components.rules.status="updated"):e.components.rules.status="preserved"}else if(r){let c=t==="compact"?D:s.content,i=v(o,"utf-8"),d=this.mergeExistingAgentsMdContent(i,c);d!==i?(C(o,d),e.agentsMdInstalled=!0,e.components.rules.status="updated"):e.components.rules.status="preserved",e.ownedGuidanceBytes=this.measureOwnedAgentsSection(d)}else{let c=t==="compact"?D:s.content,i=this.markAgentsSection(c);C(o,i),e.agentsMdInstalled=!0,e.ownedGuidanceBytes=Buffer.byteLength(i),e.components.rules.status="installed"}}catch(t){this.recordComponentFailure(e,"rules",t)}try{e.components.hooks.status=this.installCodexHooks(e)}catch(t){this.recordComponentFailure(e,"hooks",t)}try{let t=this.installCodexSkills();e.skillsInstalled=t.count,e.components.skills.status=t.status}catch(t){this.recordComponentFailure(e,"skills",t)}for(let t of["hooks","skills"])if(e.components[t].status==="unavailable"){let s=`Codex ${t} unavailable: packaged assets could not be located`;e.components[t].error=s,e.errors.push(s)}return e.success=e.errors.length===0,e}recordComponentFailure(e,t,s){let o=b(s);e.components[t]={status:"failed",error:o},e.errors.push(`Codex ${t} installation failed: ${o}`)}installCodexHooks(e){let t=this.resolvePackageRoot();if(!t)return"unavailable";let s=n(t,".codex","hooks.json"),o=n(t,".codex","hooks");if(!l(s)||!l(o))return"unavailable";let r=n(this.projectRoot,".codex"),c=n(r,"hooks");k(c,{recursive:!0});for(let a of G(o)){if(!this.options.includeRuflo&&a==="ruflo-codex-hook.cjs")continue;let u=n(o,a);if(!w(u).isFile())continue;let f=n(c,a);(!l(f)||this.overwrite)&&E(u,f)}let i=[{source:n(t,".claude","hooks","aqe-hook.cjs"),target:n(c,"aqe-runtime.cjs")},...this.options.includeRuflo?[{source:n(t,".claude","helpers","ruflo-hook.cjs"),target:n(c,"ruflo-runtime.cjs")}]:[]];for(let a of i)l(a.source)&&(!l(a.target)||this.overwrite)&&E(a.source,a.target);let d=JSON.parse(v(s,"utf-8")),g=a=>a.flatMap(u=>{if(!u||typeof u!="object")return[u];let f=u;if(!Array.isArray(f.hooks))return JSON.stringify(u).includes("ruflo-codex-hook.cjs")?[]:[u];let R=f.hooks.filter(F=>!JSON.stringify(F).includes("ruflo-codex-hook.cjs"));return R.length>0?[{...f,hooks:R}]:[]}),h={...d,hooks:Object.fromEntries(Object.entries(d.hooks||{}).map(([a,u])=>[a,this.options.includeRuflo?u:g(u)]))},p=n(r,"hooks.json");if(!l(p))return C(p,JSON.stringify(h,null,2)+`
|
|
5
5
|
`),e.hooksConfigured=!0,"installed";let m=JSON.parse(v(p,"utf-8")),x=a=>JSON.stringify(a).includes("/.codex/hooks/aqe-codex-hook.cjs")||JSON.stringify(a).includes("/.codex/hooks/ruflo-codex-hook.cjs"),A={},T=new Set([...Object.keys(m.hooks||{}),...Object.keys(h.hooks||{})]);for(let a of T){let u=(m.hooks?.[a]||[]).filter(f=>!x(f));A[a]=[...u,...h.hooks?.[a]||[]]}let M=j(p,JSON.stringify({...m,description:h.description,hooks:A},null,2)+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import"./chunk-BDVFSMOQ.js";import{Command as v}from"commander";import o from"chalk";var c=["test-generation","test-execution","coverage-analysis","quality-assessment","defect-intelligence","requirements-validation","code-intelligence","security-compliance","contract-testing","visual-accessibility","chaos-resilience","learning-optimization"],a=["qe-tdd-specialist","qe-test-architect","qe-parallel-executor","qe-flaky-hunter","qe-retry-handler","qe-coverage-specialist","qe-gap-detector","qe-quality-gate","qe-deployment-advisor","qe-code-complexity","qe-qx-partner","qe-security-scanner","qe-security-auditor","qe-contract-validator","qe-integration-tester","qe-graphql-tester","qe-visual-tester","qe-accessibility-auditor","qe-responsive-tester","qe-performance-tester","qe-load-tester","qe-chaos-engineer","qe-code-intelligence","qe-dependency-mapper","qe-kg-builder","qe-requirements-validator","qe-bdd-generator","qe-defect-predictor","qe-root-cause-analyzer","qe-regression-analyzer","qe-impact-analyzer","qe-risk-assessor","qe-learning-coordinator","qe-pattern-learner","qe-transfer-specialist","qe-metrics-optimizer","qe-fleet-commander","qe-queen-coordinator","qe-property-tester","qe-mutation-tester","qe-tdd-red","qe-tdd-green","qe-tdd-refactor","qe-code-reviewer","qe-integration-reviewer","qe-performance-reviewer","qe-security-reviewer"],i=["tester","reviewer","security-auditor","security-architect","performance-engineer","code-analyzer","cicd-engineer","reasoningbank-learner","adr-architect","ddd-domain-expert","v3-integration-architect","memory-specialist","claims-authorizer","sparc-orchestrator","sona-learning-optimizer","safla-neural","production-validator","tdd-london-swarm","queen-coordinator","swarm-memory-manager","worker-specialist","collective-intelligence-coordinator","scout-explorer","adaptive-coordinator","mesh-coordinator","hierarchical-coordinator","consensus-coordinator","byzantine-coordinator","raft-manager","crdt-synchronizer","n8n-workflow-executor","n8n-unit-tester","n8n-integration-test","n8n-trigger-test","n8n-security-auditor"],P=[...a,...i];var p=["generate-tests","execute-tests","analyze-coverage","assess-quality","predict-defects","validate-requirements","analyze-code","scan-security","validate-contracts","test-accessibility","chaos-test","optimize-learning"],b=["p0","p1","p2","p3"],y=["pending","running","completed","failed","cancelled"],d=["jest","vitest","pytest","junit","playwright","cypress","go-test","node-test"],w=["unit","integration","e2e"],C=["sqlite","agentdb","hybrid"];function q(){return`#!/bin/bash
|
|
3
3
|
# AQE CLI Bash Completion Script
|
|
4
4
|
# Generated by aqe completions bash
|
|
5
5
|
# ADR-041: Shell Completions for Enhanced Developer Experience
|