agentic-qe 3.9.8 → 3.9.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/_shared/executor-preamble.md +86 -0
- package/.claude/agents/v3/qe-coverage-specialist.md +20 -1
- package/.claude/agents/v3/qe-fleet-commander.md +20 -1
- package/.claude/agents/v3/qe-pentest-validator.md +20 -1
- package/.claude/agents/v3/qe-queen-coordinator.md +20 -1
- package/.claude/agents/v3/qe-risk-assessor.md +20 -1
- package/.claude/agents/v3/qe-root-cause-analyzer.md +19 -0
- package/.claude/agents/v3/qe-security-auditor.md +20 -1
- package/.claude/agents/v3/qe-test-architect.md +33 -1
- package/.claude/helpers/advisor-call.cjs +283 -0
- package/.claude/skills/README.md +4 -3
- package/.claude/skills/a11y-ally/SKILL.md +40 -18
- package/.claude/skills/accessibility-testing/SKILL.md +4 -0
- package/.claude/skills/compatibility-testing/SKILL.md +23 -0
- package/.claude/skills/e2e-flow-verifier/SKILL.md +87 -52
- package/.claude/skills/enterprise-integration-testing/SKILL.md +4 -0
- package/.claude/skills/localization-testing/SKILL.md +14 -0
- package/.claude/skills/observability-testing-patterns/SKILL.md +16 -0
- package/.claude/skills/qe-browser/SKILL.md +409 -0
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +291 -0
- package/.claude/skills/qe-browser/fixtures/package.json +7 -0
- package/.claude/skills/qe-browser/fixtures/serve-skills.js +130 -0
- package/.claude/skills/qe-browser/references/assertion-kinds.md +132 -0
- package/.claude/skills/qe-browser/references/migration-from-playwright.md +195 -0
- package/.claude/skills/qe-browser/schemas/output.json +188 -0
- package/.claude/skills/qe-browser/scripts/assert.js +378 -0
- package/.claude/skills/qe-browser/scripts/batch.js +292 -0
- package/.claude/skills/qe-browser/scripts/check-injection.js +267 -0
- package/.claude/skills/qe-browser/scripts/intent-score.js +325 -0
- package/.claude/skills/qe-browser/scripts/lib/vibium.js +330 -0
- package/.claude/skills/qe-browser/scripts/package.json +7 -0
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +212 -0
- package/.claude/skills/qe-browser/scripts/validate-config.json +46 -0
- package/.claude/skills/qe-browser/scripts/visual-diff.js +276 -0
- package/.claude/skills/qe-visual-accessibility/SKILL.md +31 -1
- package/.claude/skills/security-visual-testing/SKILL.md +18 -0
- package/.claude/skills/skills-manifest.json +20 -13
- package/.claude/skills/testability-scoring/SKILL.md +23 -0
- package/.claude/skills/trust-tier-manifest.json +14 -3
- package/.claude/skills/visual-testing-advanced/SKILL.md +41 -1
- package/CHANGELOG.md +75 -0
- package/README.md +5 -3
- package/assets/agents/v3/helpers/advisor-call.cjs +283 -0
- package/assets/agents/v3/qe-coverage-specialist.md +20 -1
- package/assets/agents/v3/qe-fleet-commander.md +20 -1
- package/assets/agents/v3/qe-pentest-validator.md +20 -1
- package/assets/agents/v3/qe-queen-coordinator.md +20 -1
- package/assets/agents/v3/qe-risk-assessor.md +20 -1
- package/assets/agents/v3/qe-root-cause-analyzer.md +19 -0
- package/assets/agents/v3/qe-security-auditor.md +20 -1
- package/assets/agents/v3/qe-test-architect.md +33 -1
- package/assets/skills/README.md +4 -3
- package/assets/skills/a11y-ally/SKILL.md +40 -18
- package/assets/skills/accessibility-testing/SKILL.md +4 -0
- package/assets/skills/compatibility-testing/SKILL.md +23 -0
- package/assets/skills/e2e-flow-verifier/SKILL.md +87 -52
- package/assets/skills/enterprise-integration-testing/SKILL.md +4 -0
- package/assets/skills/localization-testing/SKILL.md +14 -0
- package/assets/skills/observability-testing-patterns/SKILL.md +16 -0
- package/assets/skills/qe-browser/SKILL.md +409 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +291 -0
- package/assets/skills/qe-browser/fixtures/package.json +7 -0
- package/assets/skills/qe-browser/fixtures/serve-skills.js +130 -0
- package/assets/skills/qe-browser/references/assertion-kinds.md +132 -0
- package/assets/skills/qe-browser/references/migration-from-playwright.md +195 -0
- package/assets/skills/qe-browser/schemas/output.json +188 -0
- package/assets/skills/qe-browser/scripts/assert.js +378 -0
- package/assets/skills/qe-browser/scripts/batch.js +292 -0
- package/assets/skills/qe-browser/scripts/check-injection.js +267 -0
- package/assets/skills/qe-browser/scripts/intent-score.js +325 -0
- package/assets/skills/qe-browser/scripts/lib/vibium.js +330 -0
- package/assets/skills/qe-browser/scripts/package.json +7 -0
- package/assets/skills/qe-browser/scripts/smoke-test.sh +212 -0
- package/assets/skills/qe-browser/scripts/validate-config.json +46 -0
- package/assets/skills/qe-browser/scripts/visual-diff.js +276 -0
- package/assets/skills/qe-visual-accessibility/SKILL.md +31 -1
- package/assets/skills/security-visual-testing/SKILL.md +18 -0
- package/assets/skills/skills-manifest.json +211 -15
- package/assets/skills/testability-scoring/SKILL.md +23 -0
- package/assets/skills/trust-tier-manifest.json +14 -3
- package/assets/skills/visual-testing-advanced/SKILL.md +41 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-IKCDCMSI.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-LAE4NTVX.js → agent-booster-wasm-HM4XSABF.js} +2 -2
- package/dist/cli/chunks/{agent-handler-FVXHR6XN.js → agent-handler-UDBDLLO4.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-Q7LLBA7C.js → agent-memory-branch-VIXQ3DAR.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-W4WW7SQW.js +2 -0
- package/dist/cli/chunks/{audit-YRLKHJLX.js → audit-FWTGLQHH.js} +2 -2
- package/dist/cli/chunks/base-UQKFTHOY.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-XFGOGICB.js → better-sqlite3-TYI3CCWU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-KIUSNVSS.js → brain-handler-45ZGBLSB.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-VKZ4L3FH.js → branch-enumerator-ZBXELCQA.js} +2 -2
- package/dist/cli/chunks/{browser-GZVIYFIB.js → browser-2KM5IKEX.js} +2 -2
- package/dist/cli/chunks/browser-workflow-NMOEM3HW.js +2 -0
- package/dist/cli/chunks/{chunk-7PHNHFZI.js → chunk-226DSROQ.js} +3 -3
- package/dist/cli/chunks/{chunk-MGX2BZWE.js → chunk-27B575K6.js} +2 -2
- package/dist/cli/chunks/{chunk-P7APAQD6.js → chunk-2IJFZW3N.js} +12 -12
- package/dist/cli/chunks/{chunk-TWDWDKOI.js → chunk-32OB4ZYQ.js} +1 -1
- package/dist/cli/chunks/{chunk-E4D36LGH.js → chunk-335CCAOL.js} +1 -1
- package/dist/cli/chunks/{chunk-Q5PARJC6.js → chunk-34WI4QNF.js} +2 -2
- package/dist/cli/chunks/chunk-3A4BL62O.js +2 -0
- package/dist/cli/chunks/{chunk-6ZMM7MXA.js → chunk-3AG647MY.js} +2 -2
- package/dist/cli/chunks/{chunk-LPRHYSXN.js → chunk-3HIDCXW3.js} +1 -1
- package/dist/cli/chunks/{chunk-HN7HYUW6.js → chunk-4EKWEDHA.js} +9 -9
- package/dist/cli/chunks/{chunk-JCROLOP6.js → chunk-4FU6YNDP.js} +2 -2
- package/dist/cli/chunks/{chunk-A4DJMFDM.js → chunk-4LOJJ4VX.js} +1 -1
- package/dist/cli/chunks/{chunk-I25KIHQE.js → chunk-4VOGUZW5.js} +1 -1
- package/dist/cli/chunks/{chunk-KJZU3E5G.js → chunk-4ZR5G4MZ.js} +2 -2
- package/dist/cli/chunks/{chunk-W45FANJG.js → chunk-52ZHPZVX.js} +2 -2
- package/dist/cli/chunks/{chunk-LOANEFGZ.js → chunk-53G3OCGS.js} +2 -2
- package/dist/cli/chunks/{chunk-TZMKO6PC.js → chunk-54TZA65H.js} +2 -2
- package/dist/cli/chunks/{chunk-GHJRX7PV.js → chunk-5QKTLOGO.js} +1 -1
- package/dist/cli/chunks/{chunk-76UL224Z.js → chunk-5TATJQ3Z.js} +2 -2
- package/dist/cli/chunks/{chunk-OGFGNAKQ.js → chunk-5V6DRRLO.js} +2 -2
- package/dist/cli/chunks/{chunk-BXMIQRF3.js → chunk-6X7WKNDF.js} +2 -2
- package/dist/cli/chunks/chunk-7FWZHYYE.js +2 -0
- package/dist/cli/chunks/{chunk-R2LWLZ3Y.js → chunk-A2ULGMMG.js} +1 -1
- package/dist/cli/chunks/{chunk-AVKDT3UL.js → chunk-A53XKLEA.js} +8 -8
- package/dist/cli/chunks/{chunk-GOPE5OB5.js → chunk-A5OIXFFL.js} +1 -1
- package/dist/cli/chunks/{chunk-I7OH6RAC.js → chunk-ACNL4NFI.js} +2 -2
- package/dist/cli/chunks/{chunk-PBPOSPTY.js → chunk-AE6Y5CNJ.js} +2 -2
- package/dist/cli/chunks/{chunk-TN72MXLI.js → chunk-AO4HDN62.js} +2 -2
- package/dist/cli/chunks/{chunk-IHJXFWUL.js → chunk-AOA454FC.js} +2 -2
- package/dist/cli/chunks/{chunk-N2L7RWNX.js → chunk-B2QVWL5R.js} +2 -2
- package/dist/cli/chunks/{chunk-7CFEGUEH.js → chunk-B3L3CT4X.js} +2 -2
- package/dist/cli/chunks/{chunk-XVXSQOQG.js → chunk-B4AFVIOA.js} +2 -2
- package/dist/cli/chunks/{chunk-S72TSJS4.js → chunk-BCSCJBYQ.js} +2 -2
- package/dist/cli/chunks/{chunk-UAI5NPPQ.js → chunk-BIV6HWMT.js} +2 -2
- package/dist/cli/chunks/{chunk-XPL3BXLM.js → chunk-BNNH3KZP.js} +1 -1
- package/dist/cli/chunks/{chunk-JK6JBNGL.js → chunk-C234RGWZ.js} +2 -2
- package/dist/cli/chunks/{chunk-4EAAHMVM.js → chunk-C55GEYDA.js} +2 -2
- package/dist/cli/chunks/{chunk-Y67OXEUM.js → chunk-CEBZHZ4O.js} +1 -1
- package/dist/cli/chunks/{chunk-A2QLTNN5.js → chunk-CFQHIWWH.js} +1 -1
- package/dist/cli/chunks/{chunk-KMGAJRQ6.js → chunk-CJO2V2FB.js} +1 -1
- package/dist/cli/chunks/{chunk-5TGK7VTS.js → chunk-CQNXIYQW.js} +2 -2
- package/dist/cli/chunks/{chunk-IP2Z4Z6X.js → chunk-D2A4TGZY.js} +1 -1
- package/dist/cli/chunks/{chunk-VVNR4R22.js → chunk-DG2OYKUQ.js} +2 -2
- package/dist/cli/chunks/{chunk-ELZ5SKEN.js → chunk-DPYCHODC.js} +2 -2
- package/dist/cli/chunks/{chunk-WUCWFDBE.js → chunk-E4YKNKQL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCKNGICX.js → chunk-EEWTTYRC.js} +1 -1
- package/dist/cli/chunks/{chunk-IFIYNCT2.js → chunk-EGIYLRW5.js} +2 -2
- package/dist/cli/chunks/{chunk-DLKRK2GU.js → chunk-EHGTNSJ2.js} +1 -1
- package/dist/cli/chunks/{chunk-IIYXSWJN.js → chunk-EJNASXOY.js} +2 -2
- package/dist/cli/chunks/{chunk-ZJ4PMOIZ.js → chunk-F7HRGQRS.js} +2 -2
- package/dist/cli/chunks/{chunk-2QI5RYVR.js → chunk-FF7TSDO4.js} +2 -2
- package/dist/cli/chunks/{chunk-DDDEGBBJ.js → chunk-FIQNVPYY.js} +2 -2
- package/dist/cli/chunks/{chunk-F5VLJFVU.js → chunk-FJOBKT7N.js} +1 -1
- package/dist/cli/chunks/{chunk-JNJYWWBG.js → chunk-FYI52MFF.js} +6 -6
- package/dist/cli/chunks/{chunk-UOSKMAAY.js → chunk-GCNTU3QJ.js} +1 -1
- package/dist/cli/chunks/{chunk-4GMV6Z7Y.js → chunk-H56YBNXW.js} +2 -2
- package/dist/cli/chunks/{chunk-HTL2WT64.js → chunk-HJMLJNCB.js} +1 -1
- package/dist/cli/chunks/chunk-I3IRIJOT.js +2 -0
- package/dist/cli/chunks/chunk-IEQ2VYMO.js +3 -0
- package/dist/cli/chunks/{chunk-PG7CZ6Q4.js → chunk-IGRKFVFD.js} +2 -2
- package/dist/cli/chunks/{chunk-SQ6XZGR4.js → chunk-IJPE6OGD.js} +10 -10
- package/dist/cli/chunks/{chunk-AYKMWP7F.js → chunk-IJUL2UMO.js} +1 -1
- package/dist/cli/chunks/{chunk-JVH7753D.js → chunk-ISZJAZ2D.js} +1 -1
- package/dist/cli/chunks/{chunk-NCXVOOA7.js → chunk-ITDYTODU.js} +2 -2
- package/dist/cli/chunks/{chunk-RGCCSAHI.js → chunk-JHUEBBSX.js} +2 -2
- package/dist/cli/chunks/{chunk-TDPHLQ2M.js → chunk-JN3CC2TX.js} +2 -2
- package/dist/cli/chunks/{chunk-TSDTRJOG.js → chunk-JOEEGNNX.js} +2 -2
- package/dist/cli/chunks/{chunk-QVGSD25D.js → chunk-JQX2DHQT.js} +1 -1
- package/dist/cli/chunks/{chunk-VHZ653XS.js → chunk-JRG4AFUR.js} +3 -3
- package/dist/cli/chunks/{chunk-SP3ZBJ63.js → chunk-JRMNQWRL.js} +3 -3
- package/dist/cli/chunks/{chunk-EKDFIYV5.js → chunk-JXDJMVIG.js} +2 -2
- package/dist/cli/chunks/{chunk-3WOQMFTD.js → chunk-JYPW22JV.js} +2 -2
- package/dist/cli/chunks/{chunk-WJDOOT2M.js → chunk-KK3KVYE7.js} +2 -2
- package/dist/cli/chunks/{chunk-4KX6TMKB.js → chunk-KSRAA6ZD.js} +3 -3
- package/dist/cli/chunks/chunk-KUCU5ML6.js +6 -0
- package/dist/cli/chunks/{chunk-MVW7AACO.js → chunk-KXXLMLMJ.js} +2 -2
- package/dist/cli/chunks/{chunk-HE2NWYHK.js → chunk-LKCFJC4Q.js} +1 -1
- package/dist/cli/chunks/{chunk-237NNDKL.js → chunk-LODXDV4G.js} +2 -2
- package/dist/cli/chunks/{chunk-W4IRWGGR.js → chunk-M4CYXAVP.js} +4 -4
- package/dist/cli/chunks/{chunk-R4VOIXJQ.js → chunk-MOLMS6MA.js} +2 -2
- package/dist/cli/chunks/{chunk-SDMGF3KD.js → chunk-NBTM2J4B.js} +2 -2
- package/dist/cli/chunks/{chunk-X66IXWSO.js → chunk-NIFVFUCU.js} +2 -2
- package/dist/cli/chunks/{chunk-266SKKFM.js → chunk-OOHKW3UE.js} +2 -2
- package/dist/cli/chunks/{chunk-WXEDVKJS.js → chunk-ORA6NIXN.js} +2 -2
- package/dist/cli/chunks/{chunk-ECYDMBDA.js → chunk-OSD55UO7.js} +2 -2
- package/dist/cli/chunks/{chunk-SSURIMCL.js → chunk-OWQRMH3G.js} +2 -2
- package/dist/cli/chunks/chunk-QFUINEBN.js +2 -0
- package/dist/cli/chunks/{chunk-HYACMUUR.js → chunk-RE2IBX7Z.js} +2 -2
- package/dist/cli/chunks/{chunk-2V5VKOJ2.js → chunk-RMQQ5UHM.js} +2 -2
- package/dist/cli/chunks/{chunk-U62WL3WZ.js → chunk-ROEMVTXC.js} +3 -3
- package/dist/cli/chunks/{chunk-YOKRSFGA.js → chunk-SMTAZQJ3.js} +2 -2
- package/dist/cli/chunks/{chunk-OZTSMI7P.js → chunk-TO4NGP3E.js} +1 -1
- package/dist/cli/chunks/{chunk-LFEBTWFS.js → chunk-TTXYZUTQ.js} +2 -2
- package/dist/cli/chunks/{chunk-IZTUAI5T.js → chunk-U4NODKRR.js} +2 -2
- package/dist/cli/chunks/{chunk-JD3GH47Z.js → chunk-U635PSAW.js} +2 -2
- package/dist/cli/chunks/{chunk-6DBYVKGA.js → chunk-UBT7VCKQ.js} +2 -2
- package/dist/cli/chunks/{chunk-YSUMQBMY.js → chunk-UETM5XDO.js} +1 -1
- package/dist/cli/chunks/{chunk-BZB5D4BO.js → chunk-URXG7FMO.js} +4 -3
- package/dist/cli/chunks/{chunk-M2JBQVBP.js → chunk-VIWDVS24.js} +2 -2
- package/dist/cli/chunks/{chunk-6A4FEIE2.js → chunk-VNKCUKUJ.js} +3 -3
- package/dist/cli/chunks/{chunk-6KWX7A3R.js → chunk-VXIXHZCN.js} +2 -2
- package/dist/cli/chunks/{chunk-YIJDCZVX.js → chunk-WFEXEDMC.js} +2 -2
- package/dist/cli/chunks/{chunk-CG3HIYF4.js → chunk-WLX57ULC.js} +2 -2
- package/dist/cli/chunks/{chunk-FKODRXOU.js → chunk-WVQZGLCT.js} +2 -2
- package/dist/cli/chunks/{chunk-677V67MR.js → chunk-WW5DZ6BU.js} +1 -1
- package/dist/cli/chunks/{chunk-7L64UC5U.js → chunk-X364AIY6.js} +1 -1
- package/dist/cli/chunks/{chunk-UGJNR52C.js → chunk-XH7D6EGE.js} +1 -1
- package/dist/cli/chunks/{chunk-66DCG6RO.js → chunk-XICRAXUR.js} +4 -4
- package/dist/cli/chunks/{chunk-ETXK25IY.js → chunk-XMAV7AIC.js} +1 -1
- package/dist/cli/chunks/{chunk-NHXFAXEV.js → chunk-XSUPK7FI.js} +1 -1
- package/dist/cli/chunks/{chunk-3ZAGYTEC.js → chunk-XSWOB74I.js} +2 -2
- package/dist/cli/chunks/chunk-YPIZMTTA.js +14 -0
- package/dist/cli/chunks/{chunk-YDW522M7.js → chunk-YT6KBEXE.js} +2 -2
- package/dist/cli/chunks/{chunk-P2H5ARHM.js → chunk-ZENLP5LF.js} +1 -1
- package/dist/cli/chunks/{ci-A5ZXOEC4.js → ci-WS32HBBS.js} +2 -2
- package/dist/cli/chunks/{ci-output-S47BMRYC.js → ci-output-67R5MSLL.js} +2 -2
- package/dist/cli/chunks/circuit-breaker-MA562FT7.js +2 -0
- package/dist/cli/chunks/{claude-flow-setup-F5WBEBVK.js → claude-flow-setup-4QKGSRS7.js} +2 -2
- package/dist/cli/chunks/client-XQGZKXOB.js +2 -0
- package/dist/cli/chunks/{cline-installer-HLKR4QDR.js → cline-installer-6VSROHRY.js} +2 -2
- package/dist/cli/chunks/{code-MTZWS6JT.js → code-FBPBHVV3.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-BALTZ2WQ.js → code-index-extractor-62F622V2.js} +2 -2
- package/dist/cli/chunks/{codex-installer-LI2VIGET.js → codex-installer-LSR6DVCU.js} +2 -2
- package/dist/cli/chunks/{completions-TOF4GTNF.js → completions-56QOICBN.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-IPFXIT6T.js → complexity-analyzer-SDH4NWIS.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-KWI66RBI.js → continuedev-installer-S7ZPL3VC.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-REFOE6UF.js → copilot-installer-25GNNKNL.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-M2MZQXCN.js → cost-tracker-73J4Y2RS.js} +2 -2
- package/dist/cli/chunks/{coverage-UR2XSJCR.js → coverage-WEE2AZ5F.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-C2ZFCSXJ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-X4PXCVYH.js → cursor-installer-DHQ644T3.js} +2 -2
- package/dist/cli/chunks/{daemon-5R6ZEEBB.js → daemon-3WUJ5E3X.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-RUY2RJZA.js → dag-attention-scheduler-IRLAM43H.js} +2 -2
- package/dist/cli/chunks/{detect-PX2AYBHM.js → detect-DTSB4T4R.js} +2 -2
- package/dist/cli/chunks/{domain-handler-5JXWEO3E.js → domain-handler-DDN2Z5XC.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-6M2YLBJY.js → domain-transfer-3RRG4S6R.js} +2 -2
- package/dist/cli/chunks/dream-JSZZ67OO.js +2 -0
- package/dist/cli/chunks/esm-node-X4TES6NX.js +2 -0
- package/dist/cli/chunks/{eval-L6ZBG462.js → eval-UXEP425X.js} +2 -2
- package/dist/cli/chunks/{fast-paths-WIFDALFK.js → fast-paths-4XLHS2VN.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YLBXFUCN.js → feature-flags-6C2HD76K.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GRHF5MTK.js → feature-flags-KXXHAEYF.js} +2 -2
- package/dist/cli/chunks/{file-discovery-4HXUB4HN.js → file-discovery-YSDUIZO4.js} +2 -2
- package/dist/cli/chunks/{fleet-RPLJXOEP.js → fleet-TYDG5DWK.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-2D5IOGAT.js → gnn-wrapper-GJVYRPHB.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-D5SWZZGA.js → heartbeat-handler-X63CM35O.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-WSG4Y3M2.js → heartbeat-scheduler-NYH4CMVM.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-SQCVEHB5.js +2 -0
- package/dist/cli/chunks/hnsw-index-UGVC5IDK.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-UH6RWE74.js → hnsw-legacy-bridge-YDVUZTJI.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-BJ4ZJPMP.js → hnswlib-node-TLBDFWA6.js} +2 -2
- package/dist/cli/chunks/{hooks-KGDQNB5T.js → hooks-B6PVGP7D.js} +6 -6
- package/dist/cli/chunks/hybrid-router-YZEBKUZJ.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-LARQCK7V.js → hypergraph-engine-OQ2ZEG53.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-RACF4AOX.js → hypergraph-handler-VPD424MI.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-ZIXSRWED.js +2 -0
- package/dist/cli/chunks/{init-handler-64AOFMJD.js → init-handler-5WYP6NJW.js} +6 -6
- package/dist/cli/chunks/init-wizard-MO6PCXPX.js +2 -0
- package/dist/cli/chunks/kernel-P54KQB2F.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-4ICIP6QN.js → kilocode-installer-YVY4EVMY.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-J2GOV2OB.js → kiro-installer-GNT4BN3A.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-GU57FQAQ.js +2 -0
- package/dist/cli/chunks/{learning-QD4JVH3K.js → learning-LD2RSBRS.js} +3 -3
- package/dist/cli/chunks/llm-router-ALKXFKLQ.js +36 -0
- package/dist/cli/chunks/{load-EXKUJMBK.js → load-XAOTGZYB.js} +2 -2
- package/dist/cli/chunks/load-test-5RFBTSS7.js +2 -0
- package/dist/cli/chunks/{mcp-NSNDZSMH.js → mcp-WDAJHGH4.js} +2 -2
- package/dist/cli/chunks/{memory-63JTNVZN.js → memory-M7QD57JD.js} +5 -5
- package/dist/cli/chunks/memory-backend-GPOP3IR4.js +2 -0
- package/dist/cli/chunks/memory-handlers-2NHGZLQM.js +2 -0
- package/dist/cli/chunks/multi-model-executor-2XZQK2IN.js +14 -0
- package/dist/cli/chunks/{opencode-installer-244LFSPN.js → opencode-installer-ASCVY3GG.js} +2 -2
- package/dist/cli/chunks/{orchestrator-TZB457J6.js → orchestrator-GOZICWN3.js} +22 -19
- package/dist/cli/chunks/{pipeline-YLBD2Z5Q.js → pipeline-YHQRJWV3.js} +2 -2
- package/dist/cli/chunks/{platform-53PWFZSE.js → platform-4NESYFHN.js} +2 -2
- package/dist/cli/chunks/{plugin-6GUQEFJU.js → plugin-E24I2RVB.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-VCOK7FV5.js → prime-radiant-advanced-wasm-CDVSLR7R.js} +2 -2
- package/dist/cli/chunks/protocol-executor-M5IONISJ.js +2 -0
- package/dist/cli/chunks/{protocol-handler-25UEGTE2.js → protocol-handler-TGTDKSZB.js} +2 -2
- package/dist/cli/chunks/{prove-CTOU5F6G.js → prove-WUKDAMSE.js} +2 -2
- package/dist/cli/chunks/provider-manager-BTKK6W7M.js +24 -0
- package/dist/cli/chunks/qe-reasoning-bank-WIEXCBVE.js +2 -0
- package/dist/cli/chunks/{quality-PB7H5UEF.js → quality-RTIOIS2K.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-ZFK6DANW.js +2 -0
- package/dist/cli/chunks/{real-embeddings-RWWYCIE5.js → real-embeddings-4JJKAEMO.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-U4AGYVKL.js → roocode-installer-XU2IXRBM.js} +2 -2
- package/dist/cli/chunks/router-TOFBEI2Q.js +2 -0
- package/dist/cli/chunks/routing-feedback-RC2VDP6W.js +2 -0
- package/dist/cli/chunks/{routing-handler-NTDKDEBE.js → routing-handler-3KBOCIEN.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-RQKOLQSW.js → ruvector-commands-HHE2ZPX7.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-6EZ7S7OG.js → rvf-dual-writer-GAWM2BUZ.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-EBTV6FV2.js → rvf-migration-adapter-HQPEC4BN.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-MERU7VLY.js → rvf-migration-coordinator-A4K45EFU.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-ZOQDH3JY.js +2 -0
- package/dist/cli/chunks/safe-db-RIP3X32S.js +2 -0
- package/dist/cli/chunks/schedule-Q6KZRLWS.js +2 -0
- package/dist/cli/chunks/scheduler-SJO5QPAU.js +2 -0
- package/dist/cli/chunks/{security-JPDLGHMC.js → security-UIKUNOXB.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-JJCR3AWU.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-7OGLQE5Y.js → shared-rvf-dual-writer-ZUWSLFPH.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HK2S6XAI.js +2 -0
- package/dist/cli/chunks/{status-handler-3TI3DHEL.js → status-handler-E3VSWGA6.js} +2 -2
- package/dist/cli/chunks/{structural-health-WCZKXVWS.js → structural-health-Y22H4BOU.js} +2 -2
- package/dist/cli/chunks/{sync-AM5T4GYO.js → sync-CA4KWZFS.js} +2 -2
- package/dist/cli/chunks/{task-handler-VHDTXPVP.js → task-handler-3EZPIAMD.js} +2 -2
- package/dist/cli/chunks/task-handlers-6UVAQAGP.js +2 -0
- package/dist/cli/chunks/{test-G6P5XGHM.js → test-Q5DOFSJI.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-37RBUN4E.js → test-scheduling-BSXWCIMQ.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-XGEZU2CS.js +2 -0
- package/dist/cli/chunks/{token-usage-5XGVBLFR.js → token-usage-BZX5TCG6.js} +2 -2
- package/dist/cli/chunks/{transformers-JTKWAZJU.js → transformers-7ITQPXAU.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-KW2GWIIQ.js → tree-sitter-wasm-parser-ZYBBNYR3.js} +2 -2
- package/dist/cli/chunks/{types-7R72BACI.js → types-ACZ5VVRC.js} +2 -2
- package/dist/cli/chunks/unified-memory-EXO6WK33.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-7HPSTFVV.js +2 -0
- package/dist/cli/chunks/unified-persistence-WC3O4WOJ.js +2 -0
- package/dist/cli/chunks/{validate-TYB4ZTUL.js → validate-IQL6OVXD.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-3TFI6PLT.js → validate-swarm-J52J2K5X.js} +2 -2
- package/dist/cli/chunks/{vibium-3YELURJT.js → vibium-XSE76PXE.js} +2 -2
- package/dist/cli/chunks/visual-security-COW3OCEE.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-7Q77A27Y.js → web-tree-sitter-YM6QXUIY.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-ASARRM2X.js → windsurf-installer-M27DVL4H.js} +2 -2
- package/dist/cli/chunks/{witness-chain-WZ6PNXEY.js → witness-chain-NB5LP73S.js} +2 -2
- package/dist/cli/chunks/witness-chain-XQXF3RSP.js +2 -0
- package/dist/cli/chunks/{workflow-JDTEE6TY.js → workflow-5DODQ6XS.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-HSIZEKZM.js +2 -0
- package/dist/cli/chunks/{wrappers-X7WZLBZD.js → wrappers-K7HHCIYD.js} +2 -2
- package/dist/cli/commands/llm-router.js +252 -0
- package/dist/coordination/queen-task-management.js +8 -1
- package/dist/init/browser-engine-installer.d.ts +60 -0
- package/dist/init/browser-engine-installer.js +92 -0
- package/dist/init/init-wizard-steps.js +9 -0
- package/dist/init/phases/09-assets.d.ts +2 -0
- package/dist/init/phases/09-assets.js +65 -0
- package/dist/init/phases/12-verification.js +8 -0
- package/dist/init/skills-installer.js +1 -0
- package/dist/kernel/unified-memory-schemas.d.ts +1 -1
- package/dist/kernel/unified-memory-schemas.js +2 -1
- package/dist/mcp/bundle.js +47 -44
- package/dist/mcp/protocol-server.js +87 -0
- package/dist/routing/advisor/circuit-breaker.d.ts +56 -0
- package/dist/routing/advisor/circuit-breaker.js +128 -0
- package/dist/routing/advisor/domain-prompts.d.ts +14 -0
- package/dist/routing/advisor/domain-prompts.js +53 -0
- package/dist/routing/advisor/index.d.ts +10 -0
- package/dist/routing/advisor/index.js +9 -0
- package/dist/routing/advisor/multi-model-executor.d.ts +60 -0
- package/dist/routing/advisor/multi-model-executor.js +176 -0
- package/dist/routing/advisor/redaction.d.ts +40 -0
- package/dist/routing/advisor/redaction.js +187 -0
- package/dist/routing/advisor/types.d.ts +101 -0
- package/dist/routing/advisor/types.js +9 -0
- package/dist/routing/queen-integration.d.ts +3 -0
- package/dist/routing/queen-integration.js +7 -1
- package/dist/routing/routing-feedback.d.ts +7 -1
- package/dist/routing/routing-feedback.js +57 -11
- package/dist/routing/tiny-dancer-router.d.ts +35 -1
- package/dist/routing/tiny-dancer-router.js +33 -0
- package/dist/routing/types.d.ts +12 -0
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-D4XQUIJD.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-CGIWYLIP.js +0 -2
- package/dist/cli/chunks/base-BYVP2STR.js +0 -2
- package/dist/cli/chunks/browser-workflow-PC4N5TKL.js +0 -2
- package/dist/cli/chunks/chunk-2K3DJ3EK.js +0 -7
- package/dist/cli/chunks/chunk-JBQ4WGB4.js +0 -14
- package/dist/cli/chunks/chunk-OT4JADWW.js +0 -2
- package/dist/cli/chunks/client-56BU3GAX.js +0 -2
- package/dist/cli/chunks/cross-domain-router-XQT52BTB.js +0 -2
- package/dist/cli/chunks/dream-LFZCN5WK.js +0 -2
- package/dist/cli/chunks/esm-node-EBDIEPKS.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-BMXTVGZB.js +0 -2
- package/dist/cli/chunks/hnsw-index-YX6XLICT.js +0 -2
- package/dist/cli/chunks/impact-analyzer-MGSI2WBK.js +0 -2
- package/dist/cli/chunks/init-wizard-TBDWRRMC.js +0 -2
- package/dist/cli/chunks/kernel-NV7TO2FK.js +0 -2
- package/dist/cli/chunks/knowledge-graph-7REGYH6A.js +0 -2
- package/dist/cli/chunks/llm-router-4K4IT2PQ.js +0 -30
- package/dist/cli/chunks/load-test-RYQK44TT.js +0 -2
- package/dist/cli/chunks/memory-backend-3EBE2DEX.js +0 -2
- package/dist/cli/chunks/memory-handlers-2335MVQJ.js +0 -2
- package/dist/cli/chunks/protocol-executor-MR37S7GX.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-DANGLPTH.js +0 -2
- package/dist/cli/chunks/queen-coordinator-4YJPYF5F.js +0 -2
- package/dist/cli/chunks/router-F4IPY4RQ.js +0 -2
- package/dist/cli/chunks/routing-feedback-VGHFIJ5S.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-2P75WF5A.js +0 -2
- package/dist/cli/chunks/safe-db-47NEO2RS.js +0 -2
- package/dist/cli/chunks/schedule-L5GJW25Z.js +0 -2
- package/dist/cli/chunks/scheduler-NGGGSZMO.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-NKNTYGHO.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-TE2ZRHKA.js +0 -2
- package/dist/cli/chunks/task-handlers-GEJ36WNB.js +0 -2
- package/dist/cli/chunks/token-bootstrap-JPE3LWXQ.js +0 -2
- package/dist/cli/chunks/unified-memory-KSBLUZT4.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-V3EOMQIZ.js +0 -2
- package/dist/cli/chunks/unified-persistence-URIRJ4BM.js +0 -2
- package/dist/cli/chunks/visual-security-DJOOVCBZ.js +0 -2
- package/dist/cli/chunks/witness-chain-ZWJUCXCJ.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-5CKA6Q74.js +0 -2
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"tier0": 51,
|
|
9
9
|
"tier1": 5,
|
|
10
10
|
"tier2": 7,
|
|
11
|
-
"tier3":
|
|
12
|
-
"total":
|
|
11
|
+
"tier3": 50,
|
|
12
|
+
"total": 113
|
|
13
13
|
},
|
|
14
14
|
"validationStatus": {
|
|
15
|
-
"passing":
|
|
15
|
+
"passing": 50,
|
|
16
16
|
"failing": 0,
|
|
17
17
|
"unknown": 12,
|
|
18
18
|
"skipped": 51
|
|
@@ -294,6 +294,17 @@
|
|
|
294
294
|
},
|
|
295
295
|
"file": "qcsd-ideation-swarm/SKILL.md"
|
|
296
296
|
},
|
|
297
|
+
{
|
|
298
|
+
"name": "qe-browser",
|
|
299
|
+
"category": "browser-automation",
|
|
300
|
+
"validation": {
|
|
301
|
+
"status": "passing",
|
|
302
|
+
"schemaPath": "schemas/output.json",
|
|
303
|
+
"validatorPath": "scripts/validate-config.json",
|
|
304
|
+
"evalPath": "evals/qe-browser.yaml"
|
|
305
|
+
},
|
|
306
|
+
"file": "qe-browser/SKILL.md"
|
|
307
|
+
},
|
|
297
308
|
{
|
|
298
309
|
"name": "qe-chaos-resilience",
|
|
299
310
|
"validation": {
|
|
@@ -68,7 +68,47 @@ When detecting visual regressions or validating UI:
|
|
|
68
68
|
|
|
69
69
|
---
|
|
70
70
|
|
|
71
|
-
##
|
|
71
|
+
## PRIMARY PATH: qe-browser visual-diff
|
|
72
|
+
|
|
73
|
+
**Most visual regression work should go through the `qe-browser` fleet skill.** It wraps Vibium (WebDriver BiDi) and provides pixel-diff against stored baselines with threshold enforcement and diff-image output. See `.claude/skills/qe-browser/SKILL.md`.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
# Navigate
|
|
77
|
+
vibium go https://example.com
|
|
78
|
+
vibium wait load
|
|
79
|
+
|
|
80
|
+
# First run — creates baseline in .aqe/visual-baselines/homepage.png
|
|
81
|
+
node .claude/skills/qe-browser/scripts/visual-diff.js --name homepage
|
|
82
|
+
|
|
83
|
+
# Subsequent runs — compare, non-zero exit on mismatch
|
|
84
|
+
node .claude/skills/qe-browser/scripts/visual-diff.js --name homepage --threshold 0.02
|
|
85
|
+
|
|
86
|
+
# Scope to a single region
|
|
87
|
+
node .claude/skills/qe-browser/scripts/visual-diff.js --name hero --selector "#hero"
|
|
88
|
+
|
|
89
|
+
# Responsive — run diff at each breakpoint
|
|
90
|
+
for viewport in "375 667" "768 1024" "1920 1080"; do
|
|
91
|
+
read w h <<< "$viewport"
|
|
92
|
+
vibium viewport $w $h
|
|
93
|
+
node .claude/skills/qe-browser/scripts/visual-diff.js --name "homepage-${w}x${h}"
|
|
94
|
+
done
|
|
95
|
+
|
|
96
|
+
# Reset baseline after an intentional design change
|
|
97
|
+
node .claude/skills/qe-browser/scripts/visual-diff.js --name homepage --update-baseline
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Baselines live in `.aqe/visual-baselines/`. The script uses `pixelmatch` when installed, with a hash-based exact-match fallback otherwise. Non-zero exit when similarity < `1 - threshold`, so CI gating is `$?`-based.
|
|
101
|
+
|
|
102
|
+
### When to keep Playwright visual regression
|
|
103
|
+
|
|
104
|
+
Use the Playwright recipe below only when you need:
|
|
105
|
+
- **AI semantic comparison** (Percy, Applitools) to ignore insignificant pixel drift
|
|
106
|
+
- **Cross-browser rendering checks** in Firefox/WebKit (Vibium is Chrome-only today)
|
|
107
|
+
- **Tight integration with an existing Playwright test suite**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## LEGACY: Visual Regression with Playwright (fallback)
|
|
72
112
|
|
|
73
113
|
```javascript
|
|
74
114
|
import { test, expect } from '@playwright/test';
|
package/dist/cli/bundle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
3
|
-
import{a as y}from"./chunks/chunk-
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
3
|
+
import{a as y}from"./chunks/chunk-A2ULGMMG.js";import{a as f,c as A}from"./chunks/chunk-IGRKFVFD.js";import"./chunks/chunk-335CCAOL.js";A();import{Command as P}from"commander";import m from"chalk";function h(e,i,a,s){let l=e.command(i).description(a);if(s)for(let u of s)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,i){let a=e.commands,s=a.indexOf(i);s>=0&&a.splice(s,1)}function r(e,i){let a=h(e,i.name,i.description,i.aliases);a.action(async()=>{try{let s=await i.factory();w(e,a),e.addCommand(s),await e.parseAsync(process.argv)}catch(s){console.error(`Failed to load command '${i.name}':`,s instanceof Error?s.message:s),process.exit(1)}})}function d(e,i,a,s,l,u){let g=h(e,i,a,u);g.action(async()=>{try{let p=await s();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${i}':`,p instanceof Error?p.message:p),process.exit(1)}})}var S=["[UnifiedMemory]","[HybridBackend]","[UnifiedPersistence]","[PersistentSONAEngine]","[QueenGovernance]","[QueenCoordinator]","[Queen]","[QUEEN]","[DomainBreakerRegistry]","[RealEmbeddings]","[HNSWIndex]","[PatternStore]","[TestGenerationCoordinator]","[CodeIntelligence]","[ProductFactorsBridge]","[LearningOptimizationCoordinator]","[DreamEngine]","[DreamScheduler]","[SecurityCompliance]","[Providers]","[GNN]","[test-generation]","[test-execution]","[coverage-analysis]","[quality-assessment]","[defect-intelligence]","[requirements-validation]","[code-intelligence]","[security-compliance]","[contract-testing]","[visual-accessibility]","[chaos-resilience]","[learning-optimization]","[enterprise-integration]","[coordination]","[PatternLearnerService]","[RequirementsValidation]","[ParserRegistry]","[AdversarialDefense]","[ContinueGateIntegration]","[ContinueGate]","[SQLitePatternStore]","[TokenTracking]","[InfraHealing]","[ExperienceCapture]"],I=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let a=(typeof e[0]=="string"?e[0]:"").trimStart();if(S.some(s=>a.startsWith(s))||I.test(a)){process.stderr.write(e.map(String).join(" ")+`
|
|
4
4
|
`);return}b(...e)};var O=console.info.bind(console);console.info=(...e)=>{process.stderr.write(e.map(String).join(" ")+`
|
|
5
|
-
`)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,i){let a=e.getDomainAPI("visual-accessibility");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let s=e.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function D(){let{QEKernelImpl:e}=await import("./chunks/kernel-
|
|
5
|
+
`)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,i){let a=e.getDomainAPI("visual-accessibility");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let s=e.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function D(){let{QEKernelImpl:e}=await import("./chunks/kernel-P54KQB2F.js"),{CrossDomainEventRouter:i}=await import("./chunks/cross-domain-router-C2ZFCSXJ.js"),{DefaultProtocolExecutor:a}=await import("./chunks/protocol-executor-M5IONISJ.js"),{WorkflowOrchestrator:s}=await import("./chunks/workflow-orchestrator-HSIZEKZM.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-ZFK6DANW.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-SJO5QPAU.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y]}),await t.kernel.initialize(),t.router=new i(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new a(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new s(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),C(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=l(t.kernel,t.router,p,void 0),await t.queen.initialize(),t.initialized=!0}async function k(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),a=(await import("path")).resolve(".agentic-qe");return e.existsSync(a)?c():(console.error(m.red(`
|
|
6
6
|
Error: AQE system not initialized in this directory.`)),console.log(m.yellow("Run `aqe init` first to set up this project.\n")),!1)}async function c(){if(t.initialized&&t.kernel&&t.queen)return!0;process.stderr.write(m.gray("Auto-initializing v3 system...")+`
|
|
7
7
|
`);let e=3e4,i=new Promise((a,s)=>{setTimeout(()=>s(new Error("Initialization timeout after 30 seconds")),e)});try{return await Promise.race([D(),i]),process.stderr.write(m.green("System ready")+`
|
|
8
8
|
|
|
9
|
-
`),!0}catch(a){return a.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),a),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new P,v="3.9.
|
|
9
|
+
`),!0}catch(a){return a.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),a),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new P,v="3.9.10";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(v);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-5WYP6NJW.js").then(e=>e.createInitHandler(o)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-E3VSWGA6.js").then(e=>e.createStatusHandler(o,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-E3VSWGA6.js").then(e=>e.createHealthHandler(o,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-3EZPIAMD.js").then(e=>e.createTaskHandler(o,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-UDBDLLO4.js").then(e=>e.createAgentHandler(o,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-DDN2Z5XC.js").then(e=>e.createDomainHandler(o,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-TGTDKSZB.js").then(e=>e.createProtocolHandler(o,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-45ZGBLSB.js").then(e=>e.createBrainHandler(o,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-VPD424MI.js").then(e=>e.createHypergraphHandler(o,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-X63CM35O.js").then(e=>e.createHeartbeatHandler(o)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-3KBOCIEN.js").then(e=>e.createRoutingHandler(o)),t);r(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-5DODQ6XS.js").then(e=>e.createWorkflowCommand(t,o,c))});r(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-Q5DOFSJI.js").then(e=>e.createTestCommand(t,o,c))});r(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-WEE2AZ5F.js").then(e=>e.createCoverageCommand(t,o,c))});r(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-RTIOIS2K.js").then(e=>e.createQualityCommand(t,o,c))});r(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-UIKUNOXB.js").then(e=>e.createSecurityCommand(t,o,c))});r(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-FBPBHVV3.js").then(e=>e.createCodeCommand(t,o,c))});r(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-56QOICBN.js").then(e=>e.createCompletionsCommand(o))});r(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-TYDG5DWK.js").then(e=>e.createFleetCommand(t,o,c,C))});r(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-J52J2K5X.js").then(e=>e.createValidateSwarmCommand(t,o,c))});r(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-IQL6OVXD.js").then(e=>e.createValidateCommand(t,o,c))});r(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-UXEP425X.js").then(e=>e.createEvalCommand())});r(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-WS32HBBS.js").then(e=>e.createCICommand(t,o,c))});r(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-BZX5TCG6.js").then(e=>e.createTokenUsageCommand())});r(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-ALKXFKLQ.js").then(e=>e.createLLMRouterCommand())});r(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-CA4KWZFS.js").then(e=>e.createSyncCommands())});r(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-B6PVGP7D.js").then(e=>e.createHooksCommand())});r(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-LD2RSBRS.js").then(e=>e.createLearningCommand())});r(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-M7QD57JD.js").then(e=>e.createMemoryCommand(t,o,c))});r(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-WDAJHGH4.js").then(e=>e.createMcpCommand())});r(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-4NESYFHN.js").then(e=>e.createPlatformCommand())});r(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-WUKDAMSE.js").then(e=>e.createProveCommand(t,o,c))});r(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-HHE2ZPX7.js").then(e=>e.createRuVectorCommand())});r(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-FWTGLQHH.js").then(e=>e.createAuditCommand(t,o,c))});r(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-YHQRJWV3.js").then(e=>e.createPipelineCommand(t,o,c))});r(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-E24I2RVB.js").then(e=>e.createPluginCommand())});r(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-3WUJ5E3X.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
|
|
10
10
|
|
|
11
11
|
Shutting down...`)),console.log(m.green(`Shutdown complete
|
|
12
12
|
`)),await o(0)});process.on("SIGTERM",async()=>{console.log(m.yellow(`
|
|
13
|
-
Received SIGTERM, shutting down gracefully...`)),await o(0)});async function z(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-
|
|
13
|
+
Received SIGTERM, shutting down gracefully...`)),await o(0)});async function z(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-4XLHS2VN.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-XGEZU2CS.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await o(0)}z().catch(async e=>{console.error(m.red("Fatal error:"),e),await o(1)});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a,b,c}from"./chunk-KSRAA6ZD.js";import"./chunk-VXIXHZCN.js";import"./chunk-GCNTU3QJ.js";import"./chunk-DG2OYKUQ.js";import"./chunk-IGRKFVFD.js";import"./chunk-335CCAOL.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as x}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a as x}from"./chunk-7FWZHYYE.js";import{c as f}from"./chunk-WLX57ULC.js";import"./chunk-335CCAOL.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{b as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{b as p}from"./chunk-NBTM2J4B.js";import{a as g}from"./chunk-CJO2V2FB.js";import"./chunk-DG2OYKUQ.js";import"./chunk-335CCAOL.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
|
|
3
3
|
Agents (${a.length})
|
|
4
4
|
`)),a.length===0)console.log(s.gray(" No agents found"));else{let e=new Map;for(let i of a)e.has(i.domain)||e.set(i.domain,[]),e.get(i.domain).push(i);let o=Array.from(e.entries());for(let[i,m]of o){console.log(s.cyan(` ${i}:`));for(let r of m)console.log(` ${r.id}`),console.log(` Type: ${r.type}`),console.log(` Status: ${g(r.status)}`),r.startedAt&&console.log(s.gray(` Started: ${r.startedAt.toISOString()}`));console.log("")}}}catch(a){console.error(s.red(`
|
|
5
5
|
Failed to list agents:`),a),await this.cleanupAndExit(1)}}async executeSpawn(n,t,a){if(await this.ensureInitialized())try{let e=t.capabilities.split(",");console.log(s.blue(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import"./chunk-335CCAOL.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-226DSROQ.js";import"./chunk-OWQRMH3G.js";import"./chunk-VNKCUKUJ.js";import"./chunk-XICRAXUR.js";import"./chunk-EEWTTYRC.js";import"./chunk-ZENLP5LF.js";import"./chunk-XH7D6EGE.js";import"./chunk-53G3OCGS.js";import"./chunk-ITDYTODU.js";import"./chunk-KK3KVYE7.js";import"./chunk-AO4HDN62.js";import"./chunk-JYPW22JV.js";import"./chunk-NIFVFUCU.js";import"./chunk-URXG7FMO.js";import"./chunk-TTXYZUTQ.js";import"./chunk-7FWZHYYE.js";import"./chunk-WLX57ULC.js";import"./chunk-DG2OYKUQ.js";import"./chunk-A2ULGMMG.js";import"./chunk-IGRKFVFD.js";import"./chunk-D2A4TGZY.js";import"./chunk-RMQQ5UHM.js";import"./chunk-RE2IBX7Z.js";import"./chunk-SMTAZQJ3.js";import"./chunk-AOA454FC.js";import"./chunk-UBT7VCKQ.js";import"./chunk-B4AFVIOA.js";import"./chunk-4ZR5G4MZ.js";import"./chunk-KXXLMLMJ.js";import"./chunk-54TZA65H.js";import"./chunk-335CCAOL.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,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.9.
|
|
2
|
-
import{f as s,o as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{f as s,o as p}from"./chunk-URXG7FMO.js";import"./chunk-TTXYZUTQ.js";import{d as c,e as u,f as h,g as m}from"./chunk-ORA6NIXN.js";import"./chunk-7FWZHYYE.js";import"./chunk-WLX57ULC.js";import"./chunk-DG2OYKUQ.js";import"./chunk-IGRKFVFD.js";import"./chunk-RMQQ5UHM.js";import{p as l,q as d}from"./chunk-RE2IBX7Z.js";import"./chunk-SMTAZQJ3.js";import"./chunk-AOA454FC.js";import"./chunk-UBT7VCKQ.js";import"./chunk-B4AFVIOA.js";import"./chunk-4ZR5G4MZ.js";import"./chunk-KXXLMLMJ.js";import"./chunk-54TZA65H.js";import{g as f}from"./chunk-335CCAOL.js";import{Command as g}from"commander";import a from"chalk";p();import{existsSync as y}from"node:fs";import b from"node:path";function C(n,i){let t=[];t.push(a.bold("Witness Chain Audit Verification")),t.push("");let e=i?a.green("ENABLED"):a.yellow("DISABLED");t.push(` Feature Flag: ${e}`),t.push(` Chain Length: ${n.length} receipts`);let r=n.valid?a.green("VALID"):a.red("BROKEN");return t.push(` Integrity: ${r}`),n.length>0&&t.push(` Last Hash: ${n.lastHash.slice(0,16)}...`),!n.valid&&n.brokenAt>=0&&(t.push(""),t.push(a.red(` Break detected at index ${n.brokenAt}`)),t.push(a.red(` ${n.message}`))),t.push(""),t.join(`
|
|
3
3
|
`)}function x(){try{let n=s(),i=b.join(n,".agentic-qe","memory.db");if(!y(i))return null;let t=(d(),f(l)),e=new t(i),r=c(e),o=h(r);return e.close(),o}catch{return null}}async function A(n){let i=m(),e=(x()??u()).verifyChain(),r={featureEnabled:i,chainLength:e.length,integrity:e.valid,brokenAt:e.brokenAt,lastHash:e.lastHash,message:e.message};return n.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(C(e,i)),r}function v(n,i,t){let e=new g("audit").description("Witness chain audit trail management");return e.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{await A({format:r.format}),await i(0)}catch(o){console.error("Failed to verify witness chain:",o),await i(1)}}),e}export{v as createAuditCommand,C as formatVerificationText,A as handleAuditVerify};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-34WI4QNF.js";import"./chunk-JN3CC2TX.js";import"./chunk-URXG7FMO.js";import"./chunk-TTXYZUTQ.js";import"./chunk-7FWZHYYE.js";import"./chunk-WLX57ULC.js";import"./chunk-DG2OYKUQ.js";import"./chunk-IGRKFVFD.js";import"./chunk-D2A4TGZY.js";import"./chunk-RMQQ5UHM.js";import"./chunk-RE2IBX7Z.js";import"./chunk-SMTAZQJ3.js";import"./chunk-AOA454FC.js";import"./chunk-UBT7VCKQ.js";import"./chunk-B4AFVIOA.js";import"./chunk-4ZR5G4MZ.js";import"./chunk-KXXLMLMJ.js";import"./chunk-54TZA65H.js";import"./chunk-335CCAOL.js";export{f as MCPToolBase,e as defaultToolLogger,d as getMemoryBackend,b as getSharedMemoryBackend,a as registerRvfResetFn,c as resetSharedMemoryBackend};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-RE2IBX7Z.js";import"./chunk-335CCAOL.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as $,b as M,c as L,d as v,e as H,f as k,g as F,h as _,i as P,j as G,k as V,l as ce,m as q,n as Q,o as de,p as Y,q as j,r as W,s as U}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a as $,b as M,c as L,d as v,e as H,f as k,g as F,h as _,i as P,j as G,k as V,l as ce,m as q,n as Q,o as de,p as Y,q as j,r as W,s as U}from"./chunk-E4YKNKQL.js";import{h as ae}from"./chunk-AO4HDN62.js";import{a as se,b as ie,c as le,d as O,f as Ne}from"./chunk-JYPW22JV.js";import"./chunk-URXG7FMO.js";import"./chunk-TTXYZUTQ.js";import"./chunk-7FWZHYYE.js";import"./chunk-WLX57ULC.js";import{b as N,d as Be}from"./chunk-DG2OYKUQ.js";import"./chunk-IGRKFVFD.js";import{a as S,b as Ie}from"./chunk-RMQQ5UHM.js";import"./chunk-RE2IBX7Z.js";import"./chunk-SMTAZQJ3.js";import"./chunk-AOA454FC.js";import"./chunk-UBT7VCKQ.js";import"./chunk-B4AFVIOA.js";import"./chunk-4ZR5G4MZ.js";import"./chunk-KXXLMLMJ.js";import"./chunk-54TZA65H.js";import"./chunk-335CCAOL.js";import T from"path";import r from"chalk";Ie();Be();import{existsSync as z,mkdirSync as Oe,writeFileSync as ke,readFileSync as X}from"fs";import{join as E,resolve as Z}from"path";var qe={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Te(n,t){let o=qe[n.tableName];return!(o&&t[o]===!1)}var Ae=1e4;function De(n,t,o,e){if(!Te(t,o))return Q(E(e,t.fileName),[]),{count:0,rows:[]};let[s,i]=t.domainColumn?q(o.domains,t.domainColumn):[void 0,[]];if(G(n,t.tableName,s,i)>=Ae){let d=t.blobColumns,f=d&&d.length>0?p=>k(p,d):void 0;return{count:de(E(e,t.fileName),ce(n,t.tableName,s,i),f)}}let a=V(n,t.tableName,s,i);return t.blobColumns&&t.blobColumns.length>0&&(a=a.map(d=>k(d,t.blobColumns))),Q(E(e,t.fileName),a),{count:a.length,rows:a}}function me(n){let t=[];for(let o of v){let e=E(n,o.fileName);z(e)?t.push(_(X(e,"utf-8"))):t.push(_(""))}return _(t.join(":"))}function fe(n,t,o="memory.db"){let e=Z(t.outputPath);z(e)||Oe(e,{recursive:!0});let s=0,i={},c=new Set;for(let u of v){let p=De(n,u,t,e);if(i[u.tableName]=p.count,s+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let l of p.rows)l.qe_domain&&c.add(l.qe_domain);else if(p.count>0){let[l,h]=u.domainColumn?q(t.domains,u.domainColumn):[void 0,[]],b=`SELECT DISTINCT qe_domain FROM qe_patterns ${l?`WHERE ${l} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let y=n.prepare(b).all(...h||[]);for(let R of y)c.add(R.qe_domain)}catch{}}}}let a=t.includeVectors!==!1?G(n,"vectors"):0,d=me(e),f={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:o,stats:{patternCount:i.qe_patterns||0,vectorCount:a,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:s},domains:[...c].sort(),checksum:d,tableRecordCounts:i};return ke(E(e,"manifest.json"),JSON.stringify(f,null,2),"utf-8"),f}var $e=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function Me(n){return n==="1.0"?v.filter(t=>$e.has(t.tableName)):n==="3.0"?v:(console.warn(`[brain-import] Unknown manifest version '${n}'. Attempting full import \u2014 some files may be missing.`),v)}function ue(n,t,o){let e=Z(t),s=E(e,"manifest.json");if(!z(s))throw new Error(`Manifest not found at ${s}`);let i=N(X(s,"utf-8")),c=me(e);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let a=Me(i.version);if(o.dryRun){let l=0;for(let h of a){let m=Y(E(e,h.fileName),N);l+=m.length}return{imported:l,skipped:0,conflicts:0}}U(n);let d=0,f=0,u=0;return n.transaction(()=>{for(let l of a){let h=E(e,l.fileName),m=Y(h,N);l.blobColumns&&l.blobColumns.length>0&&(m=m.map(b=>F(b,l.blobColumns)));for(let b of m){let y;if(l.dedupColumns&&l.dedupColumns.length>0)y=W(n,l.tableName,b,l.dedupColumns);else{let R=$[l.tableName]||"id",C=L[l.tableName],x=M[l.tableName];y=j(n,l.tableName,b,R,o.mergeStrategy,C,x)}d+=y.imported,f+=y.skipped,u+=y.conflicts}}})(),{imported:d,skipped:f,conflicts:u}}function pe(n){let t=Z(n),o=E(t,"manifest.json");if(!z(o))throw new Error(`Manifest not found at ${o}`);return N(X(o,"utf-8"))}Ne();import{existsSync as K,statSync as Le,unlinkSync as ge,writeFileSync as Fe}from"fs";import{resolve as ee}from"path";function be(n,t,o="memory.db"){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let e=ee(t.outputPath),s=t.dimension??384;K(e)&&ge(e);let i=`${e}.idmap.json`;K(i)&&ge(i);let c=se(e,s);try{let a={},d=new Set,f=0;for(let w of v){let[g,oe]=w.domainColumn?q(t.domains,w.domainColumn):[void 0,[]],B=V(n,w.tableName,g,oe);if(w.tableName==="qe_patterns")for(let D of B)D.qe_domain&&d.add(D.qe_domain);let J=H[w.tableName];J&&J.length>0&&(B=B.map(D=>k(D,J))),a[w.tableName]=B,f+=B.length}let u=0,p=[];if(P(n,"qe_pattern_embeddings")){let w=n.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let g of w)g.embedding&&g.dimension===s&&p.push({id:`pe:${g.pattern_id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"qe_pattern_embeddings"}})}if(P(n,"captured_experiences")){let w=n.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let g of w)g.embedding_dimension===s&&p.push({id:`exp:${g.id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"captured_experiences",domain:g.domain,confidence:g.quality}})}if(P(n,"sona_patterns")){let w=n.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let g of w)g.state_embedding.byteLength/4===s&&p.push({id:`sona:${g.id}`,vector:new Float32Array(g.state_embedding.buffer,g.state_embedding.byteOffset,s),metadata:{tableName:"sona_patterns",domain:g.domain,confidence:g.confidence}})}p.length>0&&(u=c.ingest(p).accepted);let l={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:o,domains:[...d].sort(),tables:a},h=JSON.stringify(l),m=_(h),b=Buffer.from(h);c.embedKernel(b);let y=t.sign?c.sign(b)??void 0:void 0,R=y?t.signerKeyId??"default":void 0,C=c.fileId(),x=C?{fileId:C,parentId:c.parentId(),lineageDepth:c.lineageDepth()}:void 0,I=c.status(),A={version:"3.0",format:"rvf",exportedAt:l.exportedAt,sourceDb:o,stats:{patternCount:(a.qe_patterns||[]).length,embeddingCount:u,qValueCount:(a.rl_q_values||[]).length,dreamInsightCount:(a.dream_insights||[]).length,witnessChainLength:(a.witness_chain||[]).length,totalRecords:f},domains:l.domains,checksum:m,rvfStatus:{totalVectors:I.totalVectors,totalSegments:I.totalSegments,fileSizeBytes:I.fileSizeBytes},...y?{signature:y,signerKeyId:R}:{},...x?{lineage:x}:{}};if(y)try{c.freeze()}catch{}let Se=`${e}.manifest.json`;return Fe(Se,JSON.stringify(A,null,2),"utf-8"),A}finally{c.close()}}var Pe={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function ye(n,t,o){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let e=ee(t);if(!K(e))throw new Error(`RVF file not found: ${e}`);let s=ie(e);try{let i=s.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let m=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let c=s.extractKernel();if(!c||!c.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let a;try{a=JSON.parse(c.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(o.dryRun){let m=0;if(a.tables)for(let b of Object.values(a.tables))m+=b?.length??0;else m=(a.patterns?.length??0)+(a.qValues?.length??0)+(a.dreamInsights?.length??0)+(a.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}U(n);let d=0,f=0,u=0,p=0,l={};if(a.tables)Object.assign(l,a.tables);else for(let[m,b]of Object.entries(Pe)){let y=a[m];Array.isArray(y)&&(l[b]=y)}if(n.transaction(()=>{for(let m of v){let b=l[m.tableName];if(!b||!Array.isArray(b))continue;let y=H[m.tableName];if(y&&y.length>0){b=b.map(R=>F(R,y));for(let R of b)for(let C of y)R[C]instanceof Buffer&&p++}for(let R of b){let C;if(m.dedupColumns&&m.dedupColumns.length>0)C=W(n,m.tableName,R,m.dedupColumns);else{let x=$[m.tableName]||"id",I=L[m.tableName],A=M[m.tableName];C=j(n,m.tableName,R,x,o.mergeStrategy,I,A)}d+=C.imported,f+=C.skipped,u+=C.conflicts}}})(),u>0)try{s.compact()}catch{}return{imported:d,skipped:f,conflicts:u,embeddingsRestored:p}}finally{s.close()}}function he(n){if(!O())throw new Error("@ruvector/rvf-node is not available.");let t=ee(n);if(!K(t))throw new Error(`RVF file not found: ${t}`);let o=le(t);try{let e=o.extractKernel();if(!e||!e.image)throw new Error("No brain data found in RVF file");let s=e.image.toString("utf-8"),i;try{i=JSON.parse(s)}catch(h){throw new Error(`Failed to parse brain kernel data as JSON: ${h instanceof Error?h.message:h}`)}let c=o.status(),a=Le(t).size,d=i.tables,f=d?d.qe_patterns?.length??0:i.patterns?.length??0,u=d?d.rl_q_values?.length??0:i.qValues?.length??0,p=d?d.dream_insights?.length??0:i.dreamInsights?.length??0,l=d?d.witness_chain?.length??0:i.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:i.exportedAt??"unknown",sourceDb:i.sourceDb??"unknown",stats:{patternCount:f,embeddingCount:c.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:l},domains:i.domains??[],checksum:_(s),rvfStatus:{totalVectors:c.totalVectors,totalSegments:c.totalSegments,fileSizeBytes:a}}}finally{o.close()}}function te(){return O()}function we(n,t){if(!n.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};n.exec(`
|
|
3
3
|
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
4
4
|
pattern_id TEXT PRIMARY KEY
|
|
5
5
|
)
|
|
@@ -65,4 +65,4 @@ Examples:
|
|
|
65
65
|
aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
|
|
66
66
|
aqe brain import -i .agentic-qe/brain.rvf --dry-run
|
|
67
67
|
aqe brain info -i .agentic-qe/brain.rvf
|
|
68
|
-
`}};async function ne(n){if(n)return n;let{findProjectRoot:t}=await import("./unified-memory-
|
|
68
|
+
`}};async function ne(n){if(n)return n;let{findProjectRoot:t}=await import("./unified-memory-EXO6WK33.js");return T.join(t(),".agentic-qe","memory.db")}function xe(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function lt(n,t){return new re(n,t)}export{re as BrainHandler,lt as createBrainHandler};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import"./chunk-335CCAOL.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
|
|
3
3
|
`),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
|
|
4
4
|
`).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
|
|
5
5
|
`)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a as p}from"./chunk-IJUL2UMO.js";import"./chunk-335CCAOL.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y}from"path";import{parse as d}from"yaml";var l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(__dirname,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
|
|
3
3
|
${i.errors.join(`
|
|
4
4
|
`)}`);return this.cache.set(r,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}async list(){try{return(await k(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>y(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(r){if(r.code==="ENOENT")return[];throw r}}async validate(r){let e=[],n=[];if(r.name||e.push("Workflow must have a name"),r.version||e.push("Workflow must have a version"),r.description||n.push("Workflow should have a description"),Array.isArray(r.variables)?r.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(r.steps))e.push("Workflow must have a steps array");else if(r.steps.length===0)e.push("Workflow must have at least one step");else{r.steps.forEach((t,s)=>{t.name||e.push(`Step at index ${s} must have a name`),t.action||e.push(`Step ${t.name||s} must have an action`),(!t.config||typeof t.config!="object")&&e.push(`Step ${t.name||s} must have a config object`),t.assertions&&Array.isArray(t.assertions)&&t.assertions.forEach((f,u)=>{f.condition||e.push(`Assertion ${u} in step ${t.name||s} must have a condition`),f.message||n.push(`Assertion ${u} in step ${t.name||s} should have a message`)})});let o=r.steps.map(t=>t.name),i=o.filter((t,s)=>o.indexOf(t)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(r,e){let n=await this.load(r),o=n.variables.filter(t=>t.required&&!(t.name in e)).map(t=>t.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(t=>{t.name in e?i[t.name]=e[t.name]:"default"in t&&(i[t.name]=t.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:r}}}async getMetadata(r){try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}clearCache(){this.cache.clear()}async reload(r){return this.cache.delete(r),this.load(r)}},W=new l;function w(a,r){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),t=r;for(let s of i)if(t&&typeof t=="object"&&s in t)t=t[s];else return e;return t!=null?String(t):e})}function v(a,r){let e={...r.variables,result:r.results.get("__last_result__")},n=w(a,e);return p(n,e,!1)}var g=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],b={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},h={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function R(a){return h[a]}function S(a){return g.includes(a)}function $(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:b[a],category:r}})}export{h as WORKFLOW_CATEGORIES,b as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,W as defaultWorkflowLoader,v as evaluateCondition,$ as getAllWorkflowTemplates,R as getWorkflowsByCategory,w as interpolateVariables,S as isValidWorkflowTemplate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.10");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-LODXDV4G.js";import"./chunk-34WI4QNF.js";import"./chunk-JN3CC2TX.js";import"./chunk-URXG7FMO.js";import"./chunk-TTXYZUTQ.js";import"./chunk-7FWZHYYE.js";import"./chunk-WLX57ULC.js";import"./chunk-DG2OYKUQ.js";import"./chunk-IGRKFVFD.js";import"./chunk-D2A4TGZY.js";import"./chunk-RMQQ5UHM.js";import"./chunk-RE2IBX7Z.js";import"./chunk-SMTAZQJ3.js";import"./chunk-AOA454FC.js";import"./chunk-UBT7VCKQ.js";import"./chunk-B4AFVIOA.js";import"./chunk-4ZR5G4MZ.js";import"./chunk-KXXLMLMJ.js";import"./chunk-54TZA65H.js";import"./chunk-335CCAOL.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as U,b 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.9.10");process.exit(0)}
|
|
2
|
+
import{a as U,b as G}from"./chunk-OWQRMH3G.js";import{g as W}from"./chunk-VNKCUKUJ.js";import{a as _}from"./chunk-XICRAXUR.js";import{e as S}from"./chunk-XH7D6EGE.js";import{b as v,c as x}from"./chunk-ITDYTODU.js";import{a as ne}from"./chunk-7FWZHYYE.js";import{c as z}from"./chunk-WLX57ULC.js";import{b as k,d as q}from"./chunk-DG2OYKUQ.js";import{b,c as E}from"./chunk-A2ULGMMG.js";import{a as y,c as I}from"./chunk-IGRKFVFD.js";import{f as O}from"./chunk-D2A4TGZY.js";import{S as ae,b as N}from"./chunk-54TZA65H.js";import{randomUUID as Z}from"crypto";I();q();import{randomUUID as se}from"node:crypto";var j=x(),P=class{constructor(e){this.options=e}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-${se()}`;if(this.claudeFlowAvailable)try{let{execFileSync:r}=await import("child_process"),n=["--no-install",j,"hooks","intelligence","trajectory-start","--task",e];t&&n.push("--agent",t);let s=r("npx",n,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot}).match(/trajectoryId[:\s]+["']?([^"'\s,}]+)/i);if(s?.[1])return s[1]}catch(r){console.debug("[TrajectoryBridge] Claude Flow trajectory start failed:",r instanceof Error?r.message:r)}return this.localTrajectories.set(i,{id:i,task:e,agent:t,steps:[],startedAt:Date.now()}),i}async recordStep(e,t,i,r){if(this.claudeFlowAvailable)try{let{execFileSync:a}=await import("child_process"),s=["--no-install",j,"hooks","intelligence","trajectory-step","--trajectory-id",e,"--action",t];i&&s.push("--result",i),r!==void 0&&s.push("--quality",String(r)),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 n=this.localTrajectories.get(e);n&&n.steps.push({id:`step-${n.steps.length+1}`,action:t,result:i,quality:r,timestamp:Date.now()})}async endTrajectory(e,t,i){if(this.claudeFlowAvailable)try{let{execFileSync:n}=await import("child_process"),a=["--no-install",j,"hooks","intelligence","trajectory-end","--trajectory-id",e,"--success",String(t)];i&&a.push("--feedback",i),n("npx",a,{encoding:"utf-8",timeout:1e4,cwd:this.options.projectRoot})}catch{}let r=this.localTrajectories.get(e);if(r)return r.success=t,r.feedback=i,r.completedAt=Date.now(),await this.persistTrajectory(r),r}getTrajectory(e){return this.localTrajectories.get(e)}isClaudeFlowAvailable(){return this.claudeFlowAvailable}async persistTrajectory(e){try{let{join:t}=await import("path"),{existsSync:i,mkdirSync:r}=await import("fs"),{createRequire:n}=await import("module"),a=n(import.meta.url),{openDatabase:s}=a("../../shared/safe-db.js"),o=t(this.options.projectRoot,".agentic-qe","trajectories.db"),u=t(this.options.projectRoot,".agentic-qe");i(u)||r(u,{recursive:!0});let p=s(o);p.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS trajectories (
|
|
4
4
|
id TEXT PRIMARY KEY,
|
|
5
5
|
task TEXT NOT NULL,
|
|
@@ -21,4 +21,4 @@ Steps:
|
|
|
21
21
|
${e.steps.map((n,a)=>`${a+1}. ${n.action}${n.result?` \u2192 ${n.result}`:""}`).join(`
|
|
22
22
|
`)}
|
|
23
23
|
|
|
24
|
-
Duration: ${e.durationMs}ms`;return{patternType:t,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:this.extractTags(e),testType:this.detectTestType(e.task)},template:{type:"workflow",content:r,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"}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t}`}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+/),r=["unit","integration","e2e","api","mock","coverage","security"];for(let n of r)i.some(a=>a.includes(n))&&t.push(n);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){M.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 Y(l,e,t,i){return new Q(l,e,t,i)}var ue={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:S},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ue,...t}}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 U(G),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=_(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=W(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-7OGLQE5Y.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=Y(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-WZ6PNXEY.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-WZ6PNXEY.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-URIRJ4BM.js"),n=r();if(n.isInitialized()){let a=n.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{isCrossDomainTransferEnabled:e}=await import("./feature-flags-GRHF5MTK.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-6M2YLBJY.js"),i=t(),r=this.patternStore,n=await r.getStats();this._domainTransferInterval=setInterval(async()=>{try{n=await r.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=n.byDomain?.[a]??0,o=n.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:n.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=V({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});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 r=this.enhanceRoutingWithPatterns(i.value,t.value);return b(r)}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 b([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),b([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(r=>r.pattern.id),avgSimilarity:t.length>0?t.reduce((r,n)=>r+n.similarity,0)/t.length:0};try{let r=`pattern-usage:search:${Date.now()}-${Z().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60*1e3})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}enhanceRoutingWithPatterns(e,t){let i=t.filter(o=>o.similarity>=.5&&o.pattern.qualityScore>=.3);if(i.length===0)return e;let r=i.map(o=>{let u=o.pattern;return`[Pattern: ${u.name}] ${u.description} (confidence: ${(u.confidence*100).toFixed(0)}%, similarity: ${(o.similarity*100).toFixed(0)}%)`}),n=[...e.guidance,"--- Relevant Patterns ---",...r],a=[...e.patterns,...i.map(o=>o.pattern)],s=i.length>0?`; Found ${i.length} relevant pattern(s) with avg similarity ${(i.reduce((o,u)=>o+u.similarity,0)/i.length*100).toFixed(0)}%`:"";return{...e,patterns:a,guidance:n,reasoning:e.reasoning+s,confidence:Math.min(1,e.confidence+i.length*.02)}}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 n of i)if(n.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let r=[/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 n of r)if(n.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 r=`task-${Date.now()}-${Z().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(o){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(o))}let a;this.experienceCapture&&(a=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0}));let s={id:a||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(s.id,s),s.id}async recordStep(e,t,i,r){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,r)}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:r});let n=this.activeTasks.get(e);n&&n.steps.push({action:t,result:i,quality:r,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(n){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(n))}let r=this.activeTasks.get(e);if(r)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(r),r}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(r){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",r instanceof Error?r.message:r)}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((r,n)=>r+(n.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 i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],u=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),p=new Set,g=new Set;for(let m of u.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&p.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&p.add("javascript"),m.endsWith(".py")&&p.add("python"),m.endsWith(".go")&&p.add("go"),m.endsWith(".rs")&&p.add("rust");let w=a(e,"package.json");if(r(w))try{let m=k(n(w,"utf-8")),d={...m.dependencies,...m.devDependencies};d.react&&g.add("react"),d.vue&&g.add("vue"),d.vitest&&g.add("vitest"),d.jest&&g.add("jest"),d.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(p),frameworks:Array.from(g),patterns:[],complexity:u.length>500?3:u.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}},de={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ee=class{config;constructor(e){this.config={...de,...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),r=e.slice(t),n=[],a=Date.now(),s=h(i.map(c=>c.tokenMetrics.costUsd)),o=h(r.map(c=>c.tokenMetrics.costUsd)),u=h(i.map(c=>c.tokenMetrics.savingsUsd)),p=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&p<=u*1.05){let c=Math.min(1,(o-s)/(s||1));n.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:F(c),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(c=>c.qualityMetrics.gatePassRate)),w=h(r.map(c=>c.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&n.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:F(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let d=h(i.map(c=>c.learningMetrics.patternCount)),f=h(r.map(c=>c.learningMetrics.patternCount)),te=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),ie=Math.abs(f-d),re=Math.abs($-te);ie<1&&re<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:F(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let C=h(i.map(c=>c.performanceMetrics.p95LatencyMs)),A=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(A>C*1.2&&C>0){let c=Math.min(1,(A-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${A.toFixed(0)}ms`,confidence:F(c),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return n}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(l){return l.length===0?0:l.reduce((e,t)=>e+t,0)/l.length}function F(l){return Math.max(0,Math.min(1,l))}function pe(l,e,t){return new L(l,e,t)}function et(l,e,t){return pe(l,{projectRoot:e},t)}export{ue as a,L as b,de as c,ee as d,pe as e,et as f};
|
|
24
|
+
Duration: ${e.durationMs}ms`;return{patternType:t,name:this.generatePatternName(e),description:`Pattern extracted from: ${e.task}`,context:{tags:this.extractTags(e),testType:this.detectTestType(e.task)},template:{type:"workflow",content:r,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"}generatePatternName(e){let t=e.task.replace(/[^a-zA-Z0-9\s-]/g,"").slice(0,50).trim();return`${e.domain?`[${e.domain}] `:""}${t}`}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+/),r=["unit","integration","e2e","api","mock","coverage","security"];for(let n of r)i.some(a=>a.includes(n))&&t.push(n);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){M.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 Y(l,e,t,i){return new Q(l,e,t,i)}var ue={enableClaudeFlow:!0,enableExperienceCapture:!0,enablePatternPromotion:!0,promotionThreshold:S},L=class{constructor(e,t,i){this.memory=e;this.eventBus=i;this.config={...ue,...t}}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 U(G),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=_(this.memory,{promotionThreshold:this.config.promotionThreshold}),await this.patternStore.initialize(),this.reasoningBank=W(this.memory,this.eventBus,this.config.reasoningBank,this.coherenceService),await this.reasoningBank.initialize();try{let{getSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-ZUWSLFPH.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=Y(this.memory,this.patternStore,this.eventBus,{promotionThreshold:this.config.promotionThreshold}),await this.experienceCapture.initialize();try{let{isWitnessChainFeatureEnabled:e}=await import("./witness-chain-NB5LP73S.js");if(e()){let{createPersistentWitnessChain:t,createWitnessChainSQLitePersistence:i}=await import("./witness-chain-NB5LP73S.js"),{getUnifiedPersistence:r}=await import("./unified-persistence-WC3O4WOJ.js"),n=r();if(n.isInitialized()){let a=n.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{isCrossDomainTransferEnabled:e}=await import("./feature-flags-KXXHAEYF.js");if(e()&&this.patternStore){let{createDomainTransferEngine:t}=await import("./domain-transfer-3RRG4S6R.js"),i=t(),r=this.patternStore,n=await r.getStats();this._domainTransferInterval=setInterval(async()=>{try{n=await r.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=n.byDomain?.[a]??0,o=n.totalPatterns??0;return{domain:a,successRate:o>0?s/o:.5,avgConfidence:n.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=V({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});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 r=this.enhanceRoutingWithPatterns(i.value,t.value);return b(r)}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 b([]);try{return await this.reasoningBank.searchPatterns(e,{limit:t.limit||5,minConfidence:t.minConfidence||.4,domain:t.domain,useVectorSearch:!0})}catch(i){return console.warn("[AQELearningEngine] Pattern search failed:",y(i)),b([])}}async trackPatternSearch(e,t){let i={timestamp:Date.now(),task:e.slice(0,500),patternsFound:t.length,patternIds:t.map(r=>r.pattern.id),avgSimilarity:t.length>0?t.reduce((r,n)=>r+n.similarity,0)/t.length:0};try{let r=`pattern-usage:search:${Date.now()}-${Z().slice(0,8)}`;await this.memory.set(r,i,{persist:!0,ttl:10080*60*1e3})}catch(r){console.debug("[AQELearningEngine] Failed to track pattern search:",y(r))}}enhanceRoutingWithPatterns(e,t){let i=t.filter(o=>o.similarity>=.5&&o.pattern.qualityScore>=.3);if(i.length===0)return e;let r=i.map(o=>{let u=o.pattern;return`[Pattern: ${u.name}] ${u.description} (confidence: ${(u.confidence*100).toFixed(0)}%, similarity: ${(o.similarity*100).toFixed(0)}%)`}),n=[...e.guidance,"--- Relevant Patterns ---",...r],a=[...e.patterns,...i.map(o=>o.pattern)],s=i.length>0?`; Found ${i.length} relevant pattern(s) with avg similarity ${(i.reduce((o,u)=>o+u.similarity,0)/i.length*100).toFixed(0)}%`:"";return{...e,patterns:a,guidance:n,reasoning:e.reasoning+s,confidence:Math.min(1,e.confidence+i.length*.02)}}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 n of i)if(n.test(t))return{model:"haiku",confidence:.75,reasoning:"Low complexity task - using haiku for speed"};let r=[/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 n of r)if(n.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 r=`task-${Date.now()}-${Z().slice(0,8)}`,n=r;if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{n=await this.claudeFlowBridge.trajectory.startTrajectory(e,t)}catch(o){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow startTrajectory failed (${this.claudeFlowErrors} total errors):`,y(o))}let a;this.experienceCapture&&(a=this.experienceCapture.startCapture(e,{agent:t,domain:i,trajectoryId:n!==r?n:void 0}));let s={id:a||n,task:e,agent:t,startedAt:Date.now(),steps:[]};return this.activeTasks.set(s.id,s),s.id}async recordStep(e,t,i,r){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.recordStep(e,t,i,r)}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:r});let n=this.activeTasks.get(e);n&&n.steps.push({action:t,result:i,quality:r,timestamp:Date.now()})}async endTask(e,t,i){if(this.claudeFlowBridge?.trajectory.isClaudeFlowAvailable())try{await this.claudeFlowBridge.trajectory.endTrajectory(e,t,i)}catch(n){this.claudeFlowErrors++,console.warn(`[AQELearningEngine] Claude Flow endTrajectory failed (${this.claudeFlowErrors} total errors):`,y(n))}let r=this.activeTasks.get(e);if(r)return this.activeTasks.delete(e),this.completedTasks++,this.config.enableExperienceCapture&&t&&await this.captureExperience(r),r}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(r){console.debug("[AQELearningEngine] Claude Flow pretrain analyze failed:",r instanceof Error?r.message:r)}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((r,n)=>r+(n.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 i=await import("fast-glob"),{existsSync:r,readFileSync:n}=await import("fs"),{join:a}=await import("path"),s=t==="shallow"?["*.ts","*.js","*.json"]:t==="medium"?["**/*.ts","**/*.js","**/*.json","**/*.py"]:["**/*"],o=["node_modules/**","dist/**","coverage/**",".git/**"],u=await i.default(s,{cwd:e,ignore:o,onlyFiles:!0}),p=new Set,g=new Set;for(let m of u.slice(0,100))(m.endsWith(".ts")||m.endsWith(".tsx"))&&p.add("typescript"),(m.endsWith(".js")||m.endsWith(".jsx"))&&p.add("javascript"),m.endsWith(".py")&&p.add("python"),m.endsWith(".go")&&p.add("go"),m.endsWith(".rs")&&p.add("rust");let w=a(e,"package.json");if(r(w))try{let m=k(n(w,"utf-8")),d={...m.dependencies,...m.devDependencies};d.react&&g.add("react"),d.vue&&g.add("vue"),d.vitest&&g.add("vitest"),d.jest&&g.add("jest"),d.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(p),frameworks:Array.from(g),patterns:[],complexity:u.length>500?3:u.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}},de={enabled:!1,snapshotIntervalMs:3e5,minSnapshotsForAnalysis:5,autoApplyThreshold:.8},ee=class{config;constructor(e){this.config={...de,...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),r=e.slice(t),n=[],a=Date.now(),s=h(i.map(c=>c.tokenMetrics.costUsd)),o=h(r.map(c=>c.tokenMetrics.costUsd)),u=h(i.map(c=>c.tokenMetrics.savingsUsd)),p=h(r.map(c=>c.tokenMetrics.savingsUsd));if(o>s*1.1&&p<=u*1.05){let c=Math.min(1,(o-s)/(s||1));n.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:F(c),suggestedAction:"Review cache configuration and increase pattern reuse thresholds",detectedAt:a})}let g=h(i.map(c=>c.qualityMetrics.gatePassRate)),w=h(r.map(c=>c.qualityMetrics.gatePassRate));Math.abs(w-g)<.02&&e.length>=this.config.minSnapshotsForAnalysis&&n.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:F(.6+(e.length-this.config.minSnapshotsForAnalysis)*.05),suggestedAction:"Consider reviewing quality thresholds or adding new test coverage domains",detectedAt:a});let d=h(i.map(c=>c.learningMetrics.patternCount)),f=h(r.map(c=>c.learningMetrics.patternCount)),te=h(i.map(c=>c.learningMetrics.averageConfidence)),$=h(r.map(c=>c.learningMetrics.averageConfidence)),ie=Math.abs(f-d),re=Math.abs($-te);ie<1&&re<.02&&n.push({id:`meta-ls-${a}`,type:"learning-stall",description:`Pattern count (~${Math.round(f)}) and confidence (~${$.toFixed(2)}) have stagnated`,confidence:F(.65+(e.length-this.config.minSnapshotsForAnalysis)*.04),suggestedAction:"Expand to new QE domains or lower pattern creation thresholds to encourage exploration",detectedAt:a});let C=h(i.map(c=>c.performanceMetrics.p95LatencyMs)),A=h(r.map(c=>c.performanceMetrics.p95LatencyMs));if(A>C*1.2&&C>0){let c=Math.min(1,(A-C)/(C||1));n.push({id:`meta-pr-${a}`,type:"performance-regression",description:`P95 latency increased from ${C.toFixed(0)}ms to ${A.toFixed(0)}ms`,confidence:F(c),suggestedAction:"Profile hot paths and consider HNSW index tuning or batch size reduction",detectedAt:a})}return n}shouldAutoApply(e,t){let i=(t??this.config).autoApplyThreshold;return e.confidence>=i}};function h(l){return l.length===0?0:l.reduce((e,t)=>e+t,0)/l.length}function F(l){return Math.max(0,Math.min(1,l))}function pe(l,e,t){return new L(l,e,t)}function et(l,e,t){return pe(l,{projectRoot:e},t)}export{ue as a,L as b,de as c,ee as d,pe as e,et 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.9.
|
|
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.9.10");process.exit(0)}
|
|
2
|
+
import{a as n}from"./chunk-JN3CC2TX.js";import{a as o}from"./chunk-MOLMS6MA.js";import{a,e as c}from"./chunk-UBT7VCKQ.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
|