agentic-qe 3.11.3 → 3.11.5
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/hooks/aqe-hook.cjs +44 -10
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +106 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +25 -0
- package/dist/audit/witness-chain.js +69 -22
- package/dist/audit/witness-key-manager.d.ts +11 -0
- package/dist/audit/witness-key-manager.js +24 -0
- package/dist/cli/brain-commands.js +2 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-KNM5R47J.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-BFRW7HEU.js → agent-booster-wasm-CSTBLNYZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-ZVC3VFPC.js → agent-handler-M4W4GTXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-3WU3CVSX.js → agent-memory-branch-VGXFYLSQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-MXPJLVR3.js +2 -0
- package/dist/cli/chunks/{arena-QMRLNQUC.js → arena-FKSD3LLM.js} +4 -4
- package/dist/cli/chunks/{arena-JMVTWWG5.js → arena-IQBRGWAG.js} +2 -2
- package/dist/cli/chunks/audit-7NSGRR4Z.js +3 -0
- package/dist/cli/chunks/base-X4EXQ2AS.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-EBRXKEX5.js → better-sqlite3-2KR4LQRU.js} +2 -2
- package/dist/cli/chunks/brain-handler-M6A3UB66.js +89 -0
- package/dist/cli/chunks/{branch-enumerator-CJJG6X3I.js → branch-enumerator-2JGKY4BB.js} +2 -2
- package/dist/cli/chunks/{browser-LI2CDWVR.js → browser-J43WQPJL.js} +2 -2
- package/dist/cli/chunks/browser-workflow-4HX6RP5F.js +2 -0
- package/dist/cli/chunks/{chunk-DS7AZD26.js → chunk-26WEI3P4.js} +2 -2
- package/dist/cli/chunks/{chunk-OVEG5MEL.js → chunk-2XPMATEK.js} +2 -2
- package/dist/cli/chunks/{chunk-36HTS4EP.js → chunk-2XQHG56O.js} +2 -2
- package/dist/cli/chunks/{chunk-CGKHG46K.js → chunk-354367AP.js} +2 -2
- package/dist/cli/chunks/{chunk-FPKKKUWF.js → chunk-37ZUF5NX.js} +1 -1
- package/dist/cli/chunks/{chunk-H7Y43HBQ.js → chunk-3I4TCMOJ.js} +1 -1
- package/dist/cli/chunks/{chunk-WV66MXJI.js → chunk-3JF5A72M.js} +2 -2
- package/dist/cli/chunks/{chunk-MX5FMAY5.js → chunk-3LY7OCSO.js} +1 -1
- package/dist/cli/chunks/{chunk-KHUN65Q3.js → chunk-3V36WMIO.js} +1 -1
- package/dist/cli/chunks/{chunk-VFEU4JM4.js → chunk-3WR35GFF.js} +2 -2
- package/dist/cli/chunks/{chunk-A43MKBSX.js → chunk-4LODYRNV.js} +2 -2
- package/dist/cli/chunks/{chunk-3E3PSEC5.js → chunk-4MHN7JWC.js} +3 -3
- package/dist/cli/chunks/chunk-4QOI5JS7.js +14 -0
- package/dist/cli/chunks/{chunk-LKLWIP4Z.js → chunk-4RTWPR3X.js} +1 -1
- package/dist/cli/chunks/chunk-4XJ2A3HY.js +65 -0
- package/dist/cli/chunks/{chunk-PMHSTMHV.js → chunk-4Y3LGBKJ.js} +3 -3
- package/dist/cli/chunks/{chunk-SFDBIO64.js → chunk-52U5BFZP.js} +2 -2
- package/dist/cli/chunks/{chunk-YPRM6ZFL.js → chunk-53YOYZW5.js} +2 -2
- package/dist/cli/chunks/{chunk-REZ2GZQ3.js → chunk-5WMU7XCF.js} +1 -1
- package/dist/cli/chunks/{chunk-VUEYLW5P.js → chunk-62OTU2AP.js} +2 -2
- package/dist/cli/chunks/{chunk-3XLGXCSX.js → chunk-62UM7Q5N.js} +1 -1
- package/dist/cli/chunks/{chunk-DZZ4AJQI.js → chunk-6Q57K4YD.js} +2 -2
- package/dist/cli/chunks/chunk-6R3YOAKO.js +2 -0
- package/dist/cli/chunks/chunk-6T65OKUM.js +2 -0
- package/dist/cli/chunks/{chunk-VTDWQ7WI.js → chunk-7BCRULCP.js} +2 -2
- package/dist/cli/chunks/{chunk-XCSEJQXR.js → chunk-7DTMENY6.js} +2 -2
- package/dist/cli/chunks/{chunk-N2K2EQFH.js → chunk-7KXPNNMR.js} +2 -2
- package/dist/cli/chunks/{chunk-XKUN5PDH.js → chunk-7P6X4BFO.js} +3 -3
- package/dist/cli/chunks/{chunk-3CBYKKRW.js → chunk-7YSBATSN.js} +2 -2
- package/dist/cli/chunks/{chunk-ZDPQB67L.js → chunk-ABU64UWB.js} +1 -1
- package/dist/cli/chunks/{chunk-IJHPZMEQ.js → chunk-AF6P5RWY.js} +2 -2
- package/dist/cli/chunks/{chunk-7S7QF4HJ.js → chunk-AGJOGUP5.js} +1 -1
- package/dist/cli/chunks/{chunk-EHEFI6LR.js → chunk-AL5VJJN4.js} +1 -1
- package/dist/cli/chunks/{chunk-Q2A2XQGF.js → chunk-AOQYORVA.js} +2 -2
- package/dist/cli/chunks/{chunk-6WWNK67C.js → chunk-AOXJFDH5.js} +180 -176
- package/dist/cli/chunks/{chunk-SWRGPCZ2.js → chunk-AXKWV5NF.js} +4 -4
- package/dist/cli/chunks/{chunk-3BREKEL5.js → chunk-B2VBDMDI.js} +2 -2
- package/dist/cli/chunks/{chunk-RXN5DWVM.js → chunk-BJLA2IX7.js} +2 -2
- package/dist/cli/chunks/{chunk-DPYNXEBC.js → chunk-BLPWJQTY.js} +2 -2
- package/dist/cli/chunks/{chunk-SMHYPPO6.js → chunk-BTLUWH4R.js} +2 -2
- package/dist/cli/chunks/{chunk-PUK5NE47.js → chunk-C4EZNOWK.js} +1 -1
- package/dist/cli/chunks/{chunk-ATFADWGD.js → chunk-C5C4W572.js} +2 -2
- package/dist/cli/chunks/{chunk-WTKT2AD3.js → chunk-CDJP6COA.js} +2 -2
- package/dist/cli/chunks/{chunk-G6MPXBCD.js → chunk-CKOF27L7.js} +2 -2
- package/dist/cli/chunks/{chunk-BQ5EJPK3.js → chunk-D45QLJEL.js} +1 -1
- package/dist/cli/chunks/{chunk-WCVZHXWL.js → chunk-DFRRWOEX.js} +2 -2
- package/dist/cli/chunks/{chunk-PSL53AQ4.js → chunk-DLBVADWQ.js} +92 -92
- package/dist/cli/chunks/{chunk-HRD5I7ES.js → chunk-DPL762HU.js} +1 -1
- package/dist/cli/chunks/{chunk-7QIYYYUE.js → chunk-DVW66FPU.js} +1 -1
- package/dist/cli/chunks/{chunk-ABD6JBNO.js → chunk-EDOGRFAG.js} +1 -1
- package/dist/cli/chunks/{chunk-7SBMTSGY.js → chunk-EEKG35K5.js} +5 -5
- package/dist/cli/chunks/{chunk-PW4GGJMP.js → chunk-EK3HPH6A.js} +1 -1
- package/dist/cli/chunks/{chunk-QPMISAWB.js → chunk-FGD6HINU.js} +1 -1
- package/dist/cli/chunks/{chunk-SLU35IDJ.js → chunk-FGSIID5C.js} +2 -2
- package/dist/cli/chunks/{chunk-DNOBN3IR.js → chunk-FHTYEAQ3.js} +2 -2
- package/dist/cli/chunks/{chunk-S2T2BXUL.js → chunk-FII3WCCY.js} +2 -2
- package/dist/cli/chunks/{chunk-77QJQRL2.js → chunk-FIPKIIMS.js} +2 -2
- package/dist/cli/chunks/{chunk-WYJFVSEB.js → chunk-FMNXHVIN.js} +2 -2
- package/dist/cli/chunks/{chunk-FZLCKIPP.js → chunk-G2ZIJZJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-L6PH7JIE.js → chunk-GODAWJMZ.js} +2 -2
- package/dist/cli/chunks/{chunk-KTYESESI.js → chunk-GW6XWMX2.js} +2 -2
- package/dist/cli/chunks/{chunk-AC6OZTY4.js → chunk-HC6KTVFR.js} +2 -2
- package/dist/cli/chunks/{chunk-EXCU4J7T.js → chunk-HJWT4KME.js} +1 -1
- package/dist/cli/chunks/{chunk-GBCDJJWH.js → chunk-I3ANRYQ6.js} +2 -2
- package/dist/cli/chunks/{chunk-KXRI4MR3.js → chunk-I3NWKPXJ.js} +2 -2
- package/dist/cli/chunks/chunk-IBDQWKI3.js +2 -0
- package/dist/cli/chunks/{chunk-7FVWETN4.js → chunk-IU5RSN6M.js} +2 -2
- package/dist/cli/chunks/{chunk-L44XXD3X.js → chunk-J5XDKVI7.js} +2 -2
- package/dist/cli/chunks/{chunk-NJ2RY4OL.js → chunk-J6PFPY7V.js} +2 -2
- package/dist/cli/chunks/{chunk-27MMZQ7X.js → chunk-JATLFS6A.js} +1 -1
- package/dist/cli/chunks/{chunk-SIAJP3YA.js → chunk-JBKZ5TUM.js} +2 -2
- package/dist/cli/chunks/{chunk-PLQADRA6.js → chunk-JDSHUECG.js} +2 -2
- package/dist/cli/chunks/chunk-K4C25BWV.js +24 -0
- package/dist/cli/chunks/{chunk-UFZCHVLH.js → chunk-K4I7UIU5.js} +1 -1
- package/dist/cli/chunks/{chunk-6F43POT6.js → chunk-KP3R2M2G.js} +1 -1
- package/dist/cli/chunks/chunk-KQVIWE3W.js +2 -0
- package/dist/cli/chunks/{chunk-JWTMVC6E.js → chunk-KVVJVMDM.js} +2 -2
- package/dist/cli/chunks/{chunk-EZ4GKHSI.js → chunk-LOE2JETO.js} +2 -2
- package/dist/cli/chunks/{chunk-O7ZDQ5FF.js → chunk-LPR2R3AN.js} +3 -3
- package/dist/cli/chunks/{chunk-AKOGQT3A.js → chunk-M6FW56MV.js} +2 -2
- package/dist/cli/chunks/{chunk-NBOEXSV2.js → chunk-MCHEUSY4.js} +1 -1
- package/dist/cli/chunks/{chunk-B7XPSXK6.js → chunk-MEIU7457.js} +2 -2
- package/dist/cli/chunks/{chunk-3FOFPGHH.js → chunk-MHMQ6MCT.js} +2 -2
- package/dist/cli/chunks/{chunk-6JR2RSY2.js → chunk-MIU5RUBJ.js} +2 -2
- package/dist/cli/chunks/{chunk-QCCXH5DK.js → chunk-MMEXHZUC.js} +37 -12
- package/dist/cli/chunks/{chunk-LW5TUN5F.js → chunk-MTBGOWJA.js} +2 -2
- package/dist/cli/chunks/{chunk-JVXPKHND.js → chunk-NCSXLMDL.js} +77 -27
- package/dist/cli/chunks/{chunk-WLLGPGQY.js → chunk-O7J54OHN.js} +1 -1
- package/dist/cli/chunks/{chunk-ZM7WOA3K.js → chunk-OGNTCZKK.js} +1 -1
- package/dist/cli/chunks/{chunk-CYJ6O5VZ.js → chunk-OS2HHJTM.js} +2 -2
- package/dist/cli/chunks/{chunk-242B625Q.js → chunk-OS62Y77J.js} +2 -2
- package/dist/cli/chunks/{chunk-CLZ5RQVA.js → chunk-PVDXNQPL.js} +2 -2
- package/dist/cli/chunks/{chunk-PUUGIBFF.js → chunk-PW72M2FE.js} +2 -2
- package/dist/cli/chunks/{chunk-RWUGXU2K.js → chunk-Q5TR6ETB.js} +22 -22
- package/dist/cli/chunks/{chunk-CCDGNJZX.js → chunk-QKK7VBVB.js} +2 -2
- package/dist/cli/chunks/{chunk-BHZI6PDR.js → chunk-RFLHPLET.js} +1 -1
- package/dist/cli/chunks/{chunk-KULBMV6K.js → chunk-RJN2RM76.js} +2 -2
- package/dist/cli/chunks/{chunk-LGEZ3ZJX.js → chunk-RKXZLTWR.js} +2 -2
- package/dist/cli/chunks/{chunk-OFMVC6P3.js → chunk-SE3JFUKP.js} +1 -1
- package/dist/cli/chunks/{chunk-S7KDHA6P.js → chunk-SK754ZSH.js} +4 -4
- package/dist/cli/chunks/{chunk-OQGELUM2.js → chunk-SO6G4IX3.js} +2 -2
- package/dist/cli/chunks/{chunk-5746QYRF.js → chunk-SUL3I6QZ.js} +2 -2
- package/dist/cli/chunks/{chunk-22CUJA33.js → chunk-TBT3OFRW.js} +2 -2
- package/dist/cli/chunks/{chunk-26KHL4VO.js → chunk-TEIWJ3GJ.js} +1 -1
- package/dist/cli/chunks/{chunk-SFGBC5RP.js → chunk-TRNBQFFG.js} +8 -20
- package/dist/cli/chunks/{chunk-UTGW75AZ.js → chunk-TTJJ4DQE.js} +2 -2
- package/dist/cli/chunks/{chunk-H6YFMUFG.js → chunk-UBI2EOS3.js} +1 -1
- package/dist/cli/chunks/{chunk-GCIL7PK7.js → chunk-UBY322ED.js} +2 -2
- package/dist/cli/chunks/{chunk-P4UGVVVX.js → chunk-UORTQXJ2.js} +1 -1
- package/dist/cli/chunks/{chunk-BFBZFUBP.js → chunk-URP75DL4.js} +1 -1
- package/dist/cli/chunks/chunk-V6NAB5UZ.js +2 -0
- package/dist/cli/chunks/{chunk-DZ7PWB6E.js → chunk-VMFAANWX.js} +2 -2
- package/dist/cli/chunks/{chunk-6KKKPVOF.js → chunk-VMWRMINE.js} +1 -1
- package/dist/cli/chunks/{chunk-ECGASTG7.js → chunk-VN2HHBZN.js} +2 -2
- package/dist/cli/chunks/{chunk-6GVRP64A.js → chunk-W72FJA2H.js} +2 -2
- package/dist/cli/chunks/chunk-W7TYKPLY.js +27 -0
- package/dist/cli/chunks/{chunk-2OUXYSQV.js → chunk-WHHQIL4F.js} +2 -2
- package/dist/cli/chunks/{chunk-RRSUW2TK.js → chunk-WMZ2QGGS.js} +2 -2
- package/dist/cli/chunks/{chunk-54TDOQAH.js → chunk-WPSK237F.js} +3 -3
- package/dist/cli/chunks/{chunk-LMA6KEZH.js → chunk-XKQY2Z3Q.js} +1 -1
- package/dist/cli/chunks/{chunk-UMWYL37S.js → chunk-XLT3FYS7.js} +2 -2
- package/dist/cli/chunks/{chunk-5EW36WTI.js → chunk-XT4TDLOB.js} +2 -2
- package/dist/cli/chunks/{chunk-7UOH55UT.js → chunk-Y25PO65W.js} +2 -2
- package/dist/cli/chunks/{chunk-ED7MD6OI.js → chunk-Y6DWJKHU.js} +3 -3
- package/dist/cli/chunks/{chunk-A4NYOH7P.js → chunk-YBPLJRVT.js} +2 -2
- package/dist/cli/chunks/{chunk-BA7PJS3Y.js → chunk-YFCULQBP.js} +2 -2
- package/dist/cli/chunks/{chunk-B65CRJN6.js → chunk-YGVDP6X7.js} +1 -1
- package/dist/cli/chunks/chunk-YR2JKBZO.js +2 -0
- package/dist/cli/chunks/{chunk-FJRRXCIS.js → chunk-YZSTZUGJ.js} +1 -1
- package/dist/cli/chunks/{chunk-H2YOWAEB.js → chunk-ZG5UAEEO.js} +2 -2
- package/dist/cli/chunks/{chunk-MU36VPXV.js → chunk-ZLBY25MB.js} +1 -1
- package/dist/cli/chunks/chunk-ZMPAM4DY.js +2 -0
- package/dist/cli/chunks/{chunk-4ITHKHR5.js → chunk-ZPP57WQU.js} +2 -2
- package/dist/cli/chunks/{chunk-B6USJW5E.js → chunk-ZXEWTZFR.js} +1 -1
- package/dist/cli/chunks/{ci-JW4O2J3W.js → ci-CBNVLOOQ.js} +2 -2
- package/dist/cli/chunks/{ci-output-JNXJV4B2.js → ci-output-I4HY2FYJ.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-XDD4KUGR.js → circuit-breaker-5VRBKGWL.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-L6IZOGYZ.js → claude-flow-setup-XPJPKHIO.js} +2 -2
- package/dist/cli/chunks/client-AHXNCOHK.js +2 -0
- package/dist/cli/chunks/{cline-installer-PK5SMN2B.js → cline-installer-OFRDUUWZ.js} +2 -2
- package/dist/cli/chunks/{code-ZDVX3SQH.js → code-QIZQVB3E.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-VXZNKEU5.js → code-index-extractor-LMUUWEX4.js} +2 -2
- package/dist/cli/chunks/{codex-installer-OXKSIX7H.js → codex-installer-N2MKIZ2S.js} +2 -2
- package/dist/cli/chunks/{completions-VRFFK223.js → completions-Y36S3C5J.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-FTIMV74J.js → complexity-analyzer-73YS3WUD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-KTYBBPN4.js → continuedev-installer-SAOTP6J3.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-WDC3YNUR.js → copilot-installer-A4HXF6HE.js} +2 -2
- package/dist/cli/chunks/core-handlers-EEFLLMAZ.js +2 -0
- package/dist/cli/chunks/{cost-tracker-6MH4H33B.js → cost-tracker-P26XUVZS.js} +2 -2
- package/dist/cli/chunks/{coverage-NHATLNS4.js → coverage-HVNHSMVJ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-LT3H4SNJ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-VQSUJDFB.js → cursor-installer-46BQFTYZ.js} +2 -2
- package/dist/cli/chunks/{daemon-3VAOEKQW.js → daemon-Y54O3FLT.js} +3 -3
- package/dist/cli/chunks/daemon-YE7K2AZF.js +10 -0
- package/dist/cli/chunks/{dag-attention-scheduler-HZ6OGYIH.js → dag-attention-scheduler-ETA7YY52.js} +2 -2
- package/dist/cli/chunks/{detect-CGU3SC63.js → detect-5WLQ2J3E.js} +2 -2
- package/dist/cli/chunks/{dist-node-DIBQ7PTA.js → dist-node-45WW6I7J.js} +2 -2
- package/dist/cli/chunks/{domain-handler-DCMGAYXS.js → domain-handler-J7DQV74M.js} +2 -2
- package/dist/cli/chunks/domain-transfer-GD2EGQVR.js +2 -0
- package/dist/cli/chunks/dream-4K3BK4IG.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-7247LAU3.js → embed-and-insert-pattern-JELNEA2D.js} +2 -2
- package/dist/cli/chunks/{eval-6KR7TFOK.js → eval-A4PA5G2U.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-IIOR6RVV.js → experience-capture-middleware-MLHTYWTA.js} +3 -3
- package/dist/cli/chunks/{fast-paths-M7OGD4ZI.js → fast-paths-QYDTITRV.js} +2 -2
- package/dist/cli/chunks/{feature-flags-U75KFIGH.js → feature-flags-H4MSY26Z.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GGUXHRJI.js → feature-flags-MQYYRHIK.js} +2 -2
- package/dist/cli/chunks/{file-discovery-V52AYEB7.js → file-discovery-RMFVJNGL.js} +2 -2
- package/dist/cli/chunks/{fleet-2UH72CK4.js → fleet-7KZQOTAC.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-J2GDLT3P.js → gnn-wrapper-NMZFTGVH.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-QIDQHRXT.js → heartbeat-handler-7BQDK7MG.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-IMPPGQUK.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-EIAA6R2L.js +2 -0
- package/dist/cli/chunks/hnsw-index-ZXXP6AXZ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-IU62PIY5.js → hnsw-legacy-bridge-TPPGBPKF.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-QNZJOJAB.js → hnswlib-node-E6NSZPP2.js} +2 -2
- package/dist/cli/chunks/{hooks-ZI4D3ATS.js → hooks-CYZIUYSH.js} +48 -52
- package/dist/cli/chunks/hybrid-router-LXWG4MLH.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-6JEERAGA.js → hypergraph-engine-WC6DMTYQ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-YMDGYCB6.js → hypergraph-handler-GTGA3TXJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-TP5LRFYH.js +2 -0
- package/dist/cli/chunks/{init-handler-N57NW3QI.js → init-handler-N3Z72JNI.js} +6 -6
- package/dist/cli/chunks/init-wizard-AIOA5KOY.js +2 -0
- package/dist/cli/chunks/kernel-SQALRU6Q.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-7ABTGXJ5.js → kilocode-installer-FUX4V6II.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-2JFOHLVI.js → kiro-installer-ZSNZT7ZR.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JFVT6SNN.js +2 -0
- package/dist/cli/chunks/{learning-3P3ZXRGD.js → learning-UQY64COU.js} +3 -3
- package/dist/cli/chunks/{llm-router-AWB2KHDW.js → llm-router-CMHGGX6N.js} +4 -4
- package/dist/cli/chunks/llm-router-service-XHFKTH3I.js +2 -0
- package/dist/cli/chunks/{load-GGVBCBGX.js → load-E6WH4QN2.js} +2 -2
- package/dist/cli/chunks/load-test-JEIFJKNN.js +2 -0
- package/dist/cli/chunks/{mcp-33NHIBN3.js → mcp-UM5VTW6N.js} +2 -2
- package/dist/cli/chunks/{memory-IVAQS4OW.js → memory-7Q3XDUE5.js} +5 -5
- package/dist/cli/chunks/memory-backend-NT7I37CP.js +2 -0
- package/dist/cli/chunks/memory-handlers-746D7NE7.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-NWQY6IN2.js → multi-model-executor-LZENWVRR.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-FBB4JOEV.js → opencode-installer-O2JAIPLF.js} +2 -2
- package/dist/cli/chunks/{orchestrator-GDAXR7DH.js → orchestrator-DKZWXDRI.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-6QU6WHDW.js +2 -0
- package/dist/cli/chunks/pattern-usage-recorder-CLUL4M55.js +2 -0
- package/dist/cli/chunks/{pipeline-VIKAOIBE.js → pipeline-2VDLTR5J.js} +2 -2
- package/dist/cli/chunks/{platform-FFVP36LH.js → platform-4N4Q5XYX.js} +2 -2
- package/dist/cli/chunks/{plugin-TI6QOLXH.js → plugin-GY5AU5CS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-AZRNI2OL.js → prime-radiant-advanced-wasm-TQ4DKDZS.js} +2 -2
- package/dist/cli/chunks/protocol-executor-GT2MZYUU.js +2 -0
- package/dist/cli/chunks/{protocol-handler-J4EA34B3.js → protocol-handler-T3LZ3WRG.js} +2 -2
- package/dist/cli/chunks/{prove-ADVRMAWS.js → prove-OV7S5J4W.js} +2 -2
- package/dist/cli/chunks/provider-manager-OATJ7R3D.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-IJXNQ67O.js +2 -0
- package/dist/cli/chunks/{quality-GB5SJFSD.js → quality-AXD4NLQA.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-6RBHWCUG.js +2 -0
- package/dist/cli/chunks/{real-embeddings-GDRJ4XSH.js → real-embeddings-2PUCC7FG.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-Q6EISUDV.js → roocode-installer-WJ5ARGLW.js} +2 -2
- package/dist/cli/chunks/router-XKQRT5JK.js +2 -0
- package/dist/cli/chunks/routing-feedback-ACPSD4LW.js +2 -0
- package/dist/cli/chunks/{routing-handler-RO4RTRAG.js → routing-handler-CU6657SZ.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-FFIHCGVQ.js → ruvector-commands-IIF6VSFW.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-JGEK3A5Y.js → rvf-dual-writer-YMQI7XO2.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-OVYC4QM6.js → rvf-migration-adapter-HDE3PR2W.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-U6L77QTS.js → rvf-migration-coordinator-MQV5OA7K.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-SIWRKE33.js +2 -0
- package/dist/cli/chunks/safe-db-LCPUYMX4.js +2 -0
- package/dist/cli/chunks/schedule-HIQJCWXG.js +2 -0
- package/dist/cli/chunks/scheduler-QE5EJ5LE.js +2 -0
- package/dist/cli/chunks/{security-QPQIDAIL.js → security-UM3IGDSM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-JRJTI4UD.js → shared-rvf-adapter-I3SOJ6M4.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-DSHGURDA.js → shared-rvf-dual-writer-KQGC2UO7.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-EU54UTMH.js +2 -0
- package/dist/cli/chunks/status-handler-OX4CJZME.js +46 -0
- package/dist/cli/chunks/{structural-health-UVECCN7U.js → structural-health-PYUMVBXJ.js} +2 -2
- package/dist/cli/chunks/{sync-XXIGTGCG.js → sync-2TED3YTY.js} +2 -2
- package/dist/cli/chunks/{sync-ZLZ4CZFJ.js → sync-VALFNTA6.js} +2 -2
- package/dist/cli/chunks/{task-handler-73YAVOKJ.js → task-handler-VPGAJVPC.js} +2 -2
- package/dist/cli/chunks/{task-handlers-PKECV27D.js → task-handlers-IB4UAMU6.js} +3 -3
- package/dist/cli/chunks/{test-U3SXW4SV.js → test-OMRJOZB6.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-POJND3GV.js → test-scheduling-ZL3YFPBU.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-ICX6SIXJ.js → token-bootstrap-DNWZI7SH.js} +2 -2
- package/dist/cli/chunks/{token-usage-WCHJUVGT.js → token-usage-IYO7RGFF.js} +2 -2
- package/dist/cli/chunks/{transformers-L77UIHIY.js → transformers-53ALC34T.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-CVAXURQP.js → tree-sitter-wasm-parser-WUKJ2I2Q.js} +2 -2
- package/dist/cli/chunks/{types-LNVJBDM2.js → types-47FTEPMV.js} +2 -2
- package/dist/cli/chunks/unified-memory-CJLMC2I4.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FDGR4D2J.js +2 -0
- package/dist/cli/chunks/unified-persistence-UFH5GLDN.js +2 -0
- package/dist/cli/chunks/{upgrade-4ND5RQFY.js → upgrade-QPLMJA5Z.js} +2 -2
- package/dist/cli/chunks/{validate-ZA4XT6K2.js → validate-3GVKZOVF.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-FNK3GCJ4.js → validate-swarm-XCRTLVM6.js} +2 -2
- package/dist/cli/chunks/{vibium-E2CK2GBQ.js → vibium-CH4VPKVZ.js} +2 -2
- package/dist/cli/chunks/visual-security-4ARJ7J2Y.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-63VRNKZV.js → web-tree-sitter-JDBNAZTV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-5BTCVOLH.js → windsurf-installer-3MNPVJBP.js} +2 -2
- package/dist/cli/chunks/witness-chain-73QC33ED.js +2 -0
- package/dist/cli/chunks/{witness-chain-6CUUGISD.js → witness-chain-HR5UBV5J.js} +2 -2
- package/dist/cli/chunks/witness-key-manager-G5SQTIBZ.js +2 -0
- package/dist/cli/chunks/{workflow-V7ED22XT.js → workflow-43EMD5FY.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RKMMPXNA.js +2 -0
- package/dist/cli/chunks/{wrappers-7S3NTTLW.js → wrappers-3N7AYNM3.js} +2 -2
- package/dist/cli/commands/audit.d.ts +12 -0
- package/dist/cli/commands/audit.js +64 -4
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +45 -19
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +13 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +38 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.js +19 -1
- package/dist/cli/handlers/status-handler.d.ts +18 -0
- package/dist/cli/handlers/status-handler.js +47 -0
- package/dist/coordination/consensus/providers/ollama-provider.js +3 -2
- package/dist/coordination/mincut/queen-integration.js +24 -7
- package/dist/coordination/protocol-executor.js +2 -1
- package/dist/coordination/queen-lifecycle.js +4 -1
- package/dist/domains/code-intelligence/coordinator.js +10 -6
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +3 -1
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +6 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +21 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +7 -0
- package/dist/domains/learning-optimization/plugin.js +5 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +10 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +57 -0
- package/dist/domains/test-execution/plugin.js +2 -2
- package/dist/domains/test-execution/services/flaky-detector.js +1 -1
- package/dist/domains/test-generation/coordinator.js +22 -8
- package/dist/domains/test-generation/interfaces.d.ts +3 -0
- package/dist/domains/test-generation/services/test-generator.js +9 -1
- package/dist/integrations/ruvector/delta-tracker.js +10 -1
- package/dist/integrations/ruvector/proof-gate.d.ts +68 -0
- package/dist/integrations/ruvector/proof-gate.js +135 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +24 -0
- package/dist/integrations/ruvector/sona-persistence.js +76 -0
- package/dist/integrations/ruvector/sona-three-loop.d.ts +15 -0
- package/dist/integrations/ruvector/sona-three-loop.js +17 -0
- package/dist/kernel/unified-memory-schemas.d.ts +2 -2
- package/dist/kernel/unified-memory-schemas.js +48 -2
- package/dist/kernel/unified-memory.d.ts +57 -0
- package/dist/kernel/unified-memory.js +148 -0
- package/dist/learning/aqe-learning-engine.js +3 -1
- package/dist/learning/dream/concept-graph.d.ts +31 -1
- package/dist/learning/dream/concept-graph.js +109 -3
- package/dist/learning/dream/dream-engine.d.ts +13 -1
- package/dist/learning/dream/dream-engine.js +146 -10
- package/dist/learning/dream/index.d.ts +1 -1
- package/dist/learning/dream/types.d.ts +23 -0
- package/dist/learning/local-judge-client.js +2 -1
- package/dist/learning/pattern-store.d.ts +2 -2
- package/dist/learning/pattern-store.js +14 -3
- package/dist/learning/qe-reasoning-bank.js +34 -31
- package/dist/learning/routing-topology-gate.d.ts +12 -2
- package/dist/learning/routing-topology-gate.js +15 -3
- package/dist/learning/rvf-pattern-store.d.ts +1 -1
- package/dist/learning/rvf-pattern-store.js +21 -8
- package/dist/learning/sqlite-persistence.js +12 -9
- package/dist/mcp/bundle.js +524 -445
- package/dist/mcp/qe-tool-bridge.js +7 -2
- package/dist/mcp/tools/base.d.ts +29 -0
- package/dist/mcp/tools/base.js +25 -0
- package/dist/mcp/tools/coverage-analysis/index.js +6 -4
- package/dist/mcp/tools/learning-optimization/dream.d.ts +4 -13
- package/dist/mcp/tools/learning-optimization/dream.js +10 -96
- package/dist/mcp/tools/planning/goap-execute.d.ts +13 -1
- package/dist/mcp/tools/planning/goap-execute.js +33 -18
- package/dist/mcp/tools/registry.js +7 -2
- package/dist/persistence/rvf-migration-coordinator.js +2 -1
- package/dist/planning/actions/qe-action-library.js +124 -1
- package/dist/planning/goap-planner.d.ts +14 -2
- package/dist/planning/goap-planner.js +51 -9
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/plan-executor.d.ts +84 -4
- package/dist/planning/plan-executor.js +221 -56
- package/dist/planning/types.d.ts +27 -0
- package/dist/routing/free-tier/coordinator-support.d.ts +6 -3
- package/dist/routing/free-tier/coordinator-support.js +6 -3
- package/dist/routing/free-tier/executor.d.ts +14 -0
- package/dist/routing/free-tier/executor.js +21 -0
- package/dist/routing/free-tier/index.d.ts +1 -0
- package/dist/routing/free-tier/index.js +1 -0
- package/dist/routing/free-tier/pattern-cache.d.ts +57 -0
- package/dist/routing/free-tier/pattern-cache.js +148 -0
- package/dist/routing/free-tier/provider.js +9 -1
- package/dist/routing/value-score.js +3 -0
- package/dist/shared/embeddings/ollama-client.js +2 -1
- package/dist/shared/events/domain-events.d.ts +2 -0
- package/dist/shared/llm/model-mapping.js +26 -0
- package/dist/shared/llm/model-registry.d.ts +10 -0
- package/dist/shared/llm/model-registry.js +92 -0
- package/dist/shared/llm/ollama-url.d.ts +17 -0
- package/dist/shared/llm/ollama-url.js +25 -0
- package/dist/shared/llm/providers/ollama-timeout.d.ts +26 -0
- package/dist/shared/llm/providers/ollama-timeout.js +31 -0
- package/dist/shared/llm/providers/ollama.d.ts +10 -0
- package/dist/shared/llm/providers/ollama.js +31 -4
- package/dist/shared/llm/router/hybrid-router.js +18 -1
- package/dist/workers/workers/learning-consolidation.js +21 -1
- package/package.json +5 -1
- package/dist/cli/chunks/adapter-IU3H3MD7.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-BGOC63IN.js +0 -2
- package/dist/cli/chunks/audit-TTWAAV7P.js +0 -3
- package/dist/cli/chunks/base-DVPRE3WO.js +0 -2
- package/dist/cli/chunks/brain-handler-FXPLJCPV.js +0 -89
- package/dist/cli/chunks/browser-workflow-MP5P7KZF.js +0 -2
- package/dist/cli/chunks/chunk-2SZQDTI5.js +0 -2
- package/dist/cli/chunks/chunk-6IHB3T6M.js +0 -2
- package/dist/cli/chunks/chunk-7PDUD7FF.js +0 -2
- package/dist/cli/chunks/chunk-EBCUWMLX.js +0 -27
- package/dist/cli/chunks/chunk-NWUVXLBB.js +0 -65
- package/dist/cli/chunks/chunk-OCACCUFO.js +0 -2
- package/dist/cli/chunks/chunk-PY2Q6MN3.js +0 -24
- package/dist/cli/chunks/chunk-UNH2DE2G.js +0 -2
- package/dist/cli/chunks/client-ADCDBTEE.js +0 -2
- package/dist/cli/chunks/core-handlers-HCACMLUW.js +0 -2
- package/dist/cli/chunks/cross-domain-router-HXFQAU4M.js +0 -2
- package/dist/cli/chunks/daemon-ZSK6CLQR.js +0 -10
- package/dist/cli/chunks/domain-transfer-UWFKBZTJ.js +0 -2
- package/dist/cli/chunks/dream-SVWQH62A.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-QW5TW5QS.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-D6EJWYAL.js +0 -2
- package/dist/cli/chunks/hnsw-index-4MWR4U5W.js +0 -2
- package/dist/cli/chunks/hybrid-router-BYVUBHER.js +0 -2
- package/dist/cli/chunks/impact-analyzer-OK2UIMSG.js +0 -2
- package/dist/cli/chunks/init-wizard-6NNPNS6J.js +0 -2
- package/dist/cli/chunks/kernel-F4A4GRNO.js +0 -2
- package/dist/cli/chunks/knowledge-graph-MSJDEZCF.js +0 -2
- package/dist/cli/chunks/llm-router-service-27IQAO7G.js +0 -2
- package/dist/cli/chunks/load-test-TT5VLAN7.js +0 -2
- package/dist/cli/chunks/memory-backend-FVSK53IM.js +0 -2
- package/dist/cli/chunks/memory-handlers-OPUDOZNT.js +0 -2
- package/dist/cli/chunks/pattern-null-store-7MVEDWCY.js +0 -2
- package/dist/cli/chunks/protocol-executor-BLDDYEJ4.js +0 -2
- package/dist/cli/chunks/provider-manager-ZYCFRYZQ.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-P66CCPHM.js +0 -2
- package/dist/cli/chunks/queen-coordinator-LPHT3SX5.js +0 -2
- package/dist/cli/chunks/router-XQ2TERUT.js +0 -2
- package/dist/cli/chunks/routing-feedback-K52O752B.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-G4DV7FK3.js +0 -2
- package/dist/cli/chunks/safe-db-TMSEITES.js +0 -2
- package/dist/cli/chunks/schedule-RWFLA43O.js +0 -2
- package/dist/cli/chunks/scheduler-2V55MJJR.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-L7QM6IWF.js +0 -2
- package/dist/cli/chunks/status-handler-SBT3MZTX.js +0 -45
- package/dist/cli/chunks/unified-memory-ZSULA46X.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-SQEWFUBN.js +0 -2
- package/dist/cli/chunks/unified-persistence-EDCTT6SE.js +0 -2
- package/dist/cli/chunks/visual-security-SOGAETFP.js +0 -2
- package/dist/cli/chunks/witness-chain-AJCECBH5.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UXRUCOZR.js +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
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.11.
|
|
3
|
-
import{a as v,b as fe,c as he}from"./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.11.5");process.exit(0)}
|
|
3
|
+
import{a as v,b as fe,c as he}from"./chunk-4Y3LGBKJ.js";import{a as pe,b as ge}from"./chunk-J6PFPY7V.js";import{a as ue}from"./chunk-I3NWKPXJ.js";import{a as Y}from"./chunk-SE3JFUKP.js";import{d as G,h as ne}from"./chunk-EEKG35K5.js";import"./chunk-UORTQXJ2.js";import"./chunk-4XJ2A3HY.js";import"./chunk-PW72M2FE.js";import"./chunk-UBI2EOS3.js";import{b as K}from"./chunk-MCHEUSY4.js";import"./chunk-YGVDP6X7.js";import"./chunk-JBKZ5TUM.js";import"./chunk-W7TYKPLY.js";import"./chunk-IBDQWKI3.js";import"./chunk-TRNBQFFG.js";import"./chunk-LPR2R3AN.js";import{i as M,m as U}from"./chunk-NCSXLMDL.js";import"./chunk-IU5RSN6M.js";import{a as $e}from"./chunk-ZMPAM4DY.js";import{c as de}from"./chunk-Y25PO65W.js";import{b as R}from"./chunk-YFCULQBP.js";import{b as le,d as Ie}from"./chunk-CKOF27L7.js";import{a as me}from"./chunk-4QOI5JS7.js";import"./chunk-RJN2RM76.js";import"./chunk-OS62Y77J.js";import"./chunk-TTJJ4DQE.js";import"./chunk-5WMU7XCF.js";import"./chunk-RKXZLTWR.js";import"./chunk-K4I7UIU5.js";import"./chunk-FHTYEAQ3.js";import"./chunk-WHHQIL4F.js";import"./chunk-3JF5A72M.js";import"./chunk-CDJP6COA.js";import"./chunk-FIPKIIMS.js";import"./chunk-2XQHG56O.js";import"./chunk-2XPMATEK.js";import"./chunk-JDSHUECG.js";import"./chunk-GODAWJMZ.js";import"./chunk-C4EZNOWK.js";import{Command as at}from"commander";import $ from"chalk";import ke from"node:path";U();import{randomUUID as F}from"crypto";import C from"chalk";var H="dream-scheduler:hook-state";async function x(o){try{let e=await o.get(H);return e||(e={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0}),e.experienceCount++,await o.set(H,e),e.experienceCount}catch{return 0}}async function W(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-CJLMC2I4.js"),t=e();t.isInitialized()||await t.initialize();let{initializeExperienceCapture:n}=await import("./experience-capture-middleware-MLHTYWTA.js");await n();let r=t.getDatabase();try{r.pragma("busy_timeout = 60000")}catch{}let s=`cli-${Date.now()}-${F().slice(0,8)}`,a=o.durationMs||0,c;if(o.success){let i=a>0&&a<5e3?.1:0,h=o.source.includes("post-task")?.1:o.source.includes("post-edit")?.05:0;c=Math.min(.95,.7+i+h)}else{let i=o.source.includes("post-task")?.15:o.source.includes("post-edit")?.1:0;c=Math.min(.6,.3+i)}r.prepare(`
|
|
4
4
|
INSERT OR REPLACE INTO captured_experiences
|
|
5
5
|
(id, task, agent, domain, success, quality, duration_ms,
|
|
6
6
|
started_at, completed_at, source)
|
|
7
7
|
VALUES (?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
|
8
|
-
`).run(s,o.task.slice(0,500),o.agent,o.domain,o.success?1:0,c,a,o.source),(async()=>{try{let{computeRealEmbedding:i}=await import("./real-embeddings-
|
|
8
|
+
`).run(s,o.task.slice(0,500),o.agent,o.domain,o.success?1:0,c,a,o.source),(async()=>{try{let{computeRealEmbedding:i}=await import("./real-embeddings-2PUCC7FG.js"),h=`${o.domain}: ${o.task}`.slice(0,512),l=await i(h);r.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(l).buffer),l.length,s)}catch{}})()}catch(e){console.error(C.dim(`[hooks] persistCommandExperience: ${e instanceof Error?e.message:"unknown"}`))}}async function oe(o){let{getUnifiedMemory:e}=await import("./unified-memory-CJLMC2I4.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}try{n.exec(`
|
|
9
9
|
CREATE TABLE IF NOT EXISTS captured_experiences (
|
|
10
10
|
id TEXT PRIMARY KEY,
|
|
11
11
|
task TEXT NOT NULL,
|
|
@@ -40,7 +40,7 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
40
40
|
FOREIGN KEY (experience_id) REFERENCES captured_experiences(id) ON DELETE CASCADE
|
|
41
41
|
);
|
|
42
42
|
CREATE INDEX IF NOT EXISTS idx_exp_apps_experience ON experience_applications(experience_id);
|
|
43
|
-
`)}catch{}try{let u=n.prepare("PRAGMA table_info(qe_trajectories)").all();u.length>0&&!u.some(
|
|
43
|
+
`)}catch{}try{let u=n.prepare("PRAGMA table_info(qe_trajectories)").all();u.length>0&&!u.some(y=>y.name==="metadata_json")&&n.exec("ALTER TABLE qe_trajectories ADD COLUMN metadata_json TEXT")}catch{}let r=`exp-${Date.now()}-${F().slice(0,8)}`,s=`${o.agent}:${o.taskId}`,a=o.durationMs??0,c=o.success?1:0,i=a<100?1:a<500?.8:a<2e3?.6:a<5e3?.4:a<1e4?.2:.1,h=.25*c+.325+.1*i,l=null,p=0,d=0,k=n.transaction(()=>{n.prepare(`
|
|
44
44
|
INSERT INTO captured_experiences
|
|
45
45
|
(id, task, agent, domain, success, quality, duration_ms,
|
|
46
46
|
model_tier, started_at, completed_at, source)
|
|
@@ -49,13 +49,13 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
49
49
|
INSERT INTO experience_applications
|
|
50
50
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
51
51
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
52
|
-
`).run(`app-${Date.now()}-${
|
|
52
|
+
`).run(`app-${Date.now()}-${F().slice(0,8)}`,r,s,o.success?1:0,Math.round(h*100),`[Patch 060] post-task outcome: ${o.success?"success":"failure"}`);try{let m=n.prepare(`
|
|
53
53
|
SELECT key, value FROM kv_store
|
|
54
54
|
WHERE namespace = 'task-bridge'
|
|
55
55
|
AND (expires_at IS NULL OR expires_at > strftime('%s','now') * 1000)
|
|
56
56
|
ORDER BY created_at DESC
|
|
57
57
|
LIMIT 1
|
|
58
|
-
`).get();if(m?.value)try{l=JSON.parse(m.value)}catch{l=null}if(l&&Array.isArray(l.selectedPatternIds)&&l.selectedPatternIds.length>0){let T=l.estimatedTokenSavings&&l.selectedPatternIds.length?Math.round(l.estimatedTokenSavings/l.selectedPatternIds.length):0,
|
|
58
|
+
`).get();if(m?.value)try{l=JSON.parse(m.value)}catch{l=null}if(l&&Array.isArray(l.selectedPatternIds)&&l.selectedPatternIds.length>0){let T=l.estimatedTokenSavings&&l.selectedPatternIds.length?Math.round(l.estimatedTokenSavings/l.selectedPatternIds.length):0,D=n.prepare(`
|
|
59
59
|
INSERT INTO experience_applications
|
|
60
60
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
61
61
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
@@ -71,29 +71,25 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
71
71
|
AND successful_uses >= 3
|
|
72
72
|
AND success_rate >= 0.7
|
|
73
73
|
AND confidence >= 0.6
|
|
74
|
-
`);for(let S of l.selectedPatternIds){
|
|
74
|
+
`);for(let S of l.selectedPatternIds){D.run(`app-${Date.now()}-${F().slice(0,8)}`,r,`${s}:pattern:${S}`,o.success?1:0,T,`[Patch 160+300] task-bridge pattern_id=${S} ts=${T}`);try{me(n,{patternId:S,success:o.success,metrics:{tokens_saved:T,source:"cli-hook-post-task",experience_id:r},feedback:`[Patch 160+300] task-bridge pattern_id=${S} ts=${T}`})}catch{}try{let j=L.get(S);j?.tier==="short-term"&&j.successful_uses>=3&&j.success_rate>=.7&&j.confidence>=.6&&P.run(S)}catch{}}m&&n.prepare("DELETE FROM kv_store WHERE namespace='task-bridge' AND key = ?").run(m.key)}}catch(m){console.error(C.dim(`[hooks] post-task bridge: ${m instanceof Error?m.message:"unknown"}`))}let u=`traj-${Date.now()}-${F().slice(0,8)}`,y=o.parentAgentId!==void 0||o.depth!==void 0?JSON.stringify({...o.parentAgentId!==void 0?{parentAgentId:o.parentAgentId}:{},...o.depth!==void 0?{depth:o.depth}:{}}):null;n.prepare(`
|
|
75
75
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json, metadata_json)
|
|
76
76
|
VALUES (?, ?, ?, ?, datetime('now'), datetime('now'), ?, ?, ?)
|
|
77
|
-
`).run(u,s,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]),
|
|
77
|
+
`).run(u,s,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]),y);try{let m=n.prepare(`
|
|
78
78
|
SELECT id, task, agent, success, started_at, completed_at
|
|
79
79
|
FROM captured_experiences
|
|
80
80
|
WHERE consolidated_into IS NULL
|
|
81
81
|
AND task LIKE ?
|
|
82
82
|
AND started_at > datetime('now', '-1 hour')
|
|
83
83
|
ORDER BY started_at ASC
|
|
84
|
-
`).all(`%:${o.taskId}`);if(m.length>=2){let T=`traj-multi-${Date.now()}-${
|
|
84
|
+
`).all(`%:${o.taskId}`);if(m.length>=2){let T=`traj-multi-${Date.now()}-${F().slice(0,8)}`,D=JSON.stringify(m.map((S,j)=>({step:j+1,task:S.task,agent:S.agent,success:!!S.success,started_at:S.started_at,completed_at:S.completed_at}))),L=m.every(S=>!!S.success);n.prepare(`
|
|
85
85
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
86
86
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
87
|
-
`).run(T,`multi:${o.taskId}`,o.agent,o.domain??"general",m[0].started_at,m[m.length-1].completed_at,L?1:0,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
ORDER BY created_at DESC
|
|
94
|
-
LIMIT 3
|
|
95
|
-
)
|
|
96
|
-
`).run().changes??0}catch{}});try{k()}catch(u){console.error(H.dim(`[hooks] persistTaskOutcome txn: ${u instanceof Error?u.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:u}=await import("./real-embeddings-GDRJ4XSH.js"),E=`${o.domain??"general"}: ${s}`.slice(0,512),m=await u(E);n.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(m).buffer),m.length,r)}catch{}})(),{experienceId:r,qualityScore:h,bridge:l,stitchedSiblings:p,insightsApplied:d}}async function W(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-ZSULA46X.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}let r=`${o.taskType}|${o.priority}|${o.domain||"any"}`,s=o.agent,a=`q-learning:aqe-hook-router:${r}:${s}`,c=o.success?.1:-1,i=.1,h=.9,l=n.prepare(`
|
|
87
|
+
`).run(T,`multi:${o.taskId}`,o.agent,o.domain??"general",m[0].started_at,m[m.length-1].completed_at,L?1:0,D);let P=m.map(()=>"?").join(",");n.prepare(`UPDATE captured_experiences SET consolidated_into = ? WHERE id IN (${P})`).run(T,...m.map(S=>S.id)),p=m.length}}catch(m){console.error(C.dim(`[hooks] post-task stitch: ${m instanceof Error?m.message:"unknown"}`))}});try{k()}catch(u){console.error(C.dim(`[hooks] persistTaskOutcome txn: ${u instanceof Error?u.message:"unknown"}`))}if(o.success)try{let u=n.prepare(`
|
|
88
|
+
SELECT id FROM dream_insights
|
|
89
|
+
WHERE actionable = 1 AND (applied = 0 OR applied IS NULL)
|
|
90
|
+
ORDER BY created_at DESC
|
|
91
|
+
LIMIT 3
|
|
92
|
+
`).all();if(u.length>0){let{createDreamEngine:y}=await import("./dream-4K3BK4IG.js"),m=y();await m.initialize();try{for(let T of u){let D=await m.applyInsight(T.id);D.success&&D.patternId&&d++}}finally{await m.close()}}}catch(u){console.error(C.dim(`[hooks] post-task insight apply: ${u instanceof Error?u.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:u}=await import("./real-embeddings-2PUCC7FG.js"),y=`${o.domain??"general"}: ${s}`.slice(0,512),m=await u(y);n.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(m).buffer),m.length,r)}catch{}})(),{experienceId:r,qualityScore:h,bridge:l,stitchedSiblings:p,insightsApplied:d}}async function J(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-CJLMC2I4.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}let r=`${o.taskType}|${o.priority}|${o.domain||"any"}`,s=o.agent,a=`q-learning:aqe-hook-router:${r}:${s}`,c=o.success?.1:-1,i=.1,h=.9,l=n.prepare(`
|
|
97
93
|
SELECT q_value FROM rl_q_values WHERE id = ?
|
|
98
94
|
`).get(a),p=l&&typeof l.q_value=="number"?l.q_value:0,d=n.prepare(`
|
|
99
95
|
SELECT MAX(q_value) AS m FROM rl_q_values WHERE state_key = ?
|
|
@@ -106,7 +102,7 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
106
102
|
visits = visits + 1,
|
|
107
103
|
last_reward = excluded.last_reward,
|
|
108
104
|
updated_at = datetime('now')
|
|
109
|
-
`).run(a,r,s,u,c,o.domain||"any")}catch(e){console.error(
|
|
105
|
+
`).run(a,r,s,u,c,o.domain||"any")}catch(e){console.error(C.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function re(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-CJLMC2I4.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}n.prepare(`
|
|
110
106
|
UPDATE routing_outcomes
|
|
111
107
|
SET success = ?, quality_score = ?, duration_ms = ?
|
|
112
108
|
WHERE id IN (
|
|
@@ -117,7 +113,7 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
117
113
|
ORDER BY (CASE WHEN used_agent = ? THEN 0 ELSE 1 END), created_at DESC
|
|
118
114
|
LIMIT 1
|
|
119
115
|
)
|
|
120
|
-
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(
|
|
116
|
+
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(C.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function se(){let{getUnifiedMemory:o}=await import("./unified-memory-CJLMC2I4.js"),e=o();e.isInitialized()||await e.initialize();let t=e.getDatabase();try{t.pragma("busy_timeout = 60000")}catch{}let n=new Set(t.prepare("PRAGMA table_info(captured_experiences)").all().map(i=>i.name)),r=[["consolidated_into","TEXT DEFAULT NULL"],["consolidation_count","INTEGER DEFAULT 1"],["quality_updated_at","TEXT DEFAULT NULL"],["reuse_success_count","INTEGER DEFAULT 0"],["reuse_failure_count","INTEGER DEFAULT 0"]];for(let[i,h]of r)n.has(i)||t.exec(`ALTER TABLE captured_experiences ADD COLUMN ${i} ${h}`);let s=t.prepare(`
|
|
121
117
|
SELECT
|
|
122
118
|
domain,
|
|
123
119
|
agent,
|
|
@@ -133,7 +129,7 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
133
129
|
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
134
130
|
ORDER BY avg_quality DESC
|
|
135
131
|
LIMIT 50
|
|
136
|
-
`).all();if(s.length===0)return 0;let{v4:a}=await import("./dist-node-
|
|
132
|
+
`).all();if(s.length===0)return 0;let{v4:a}=await import("./dist-node-45WW6I7J.js"),c=0;for(let i of s)try{let h=new Date().toISOString().slice(0,7),l=`${i.agent}-${i.domain}-${h}`,p=t.prepare(`
|
|
137
133
|
SELECT id FROM qe_patterns
|
|
138
134
|
WHERE qe_domain = ? AND name = ?
|
|
139
135
|
LIMIT 1
|
|
@@ -145,33 +141,33 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
145
141
|
quality_score = MIN(0.99, quality_score + 0.005),
|
|
146
142
|
updated_at = datetime('now')
|
|
147
143
|
WHERE id = ?
|
|
148
|
-
`).run(i.cnt,i.successes,p.id);else{let d=a(),k=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),u=k*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5,
|
|
144
|
+
`).run(i.cnt,i.successes,p.id);else{let d=a(),k=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),u=k*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5,y=`Auto-consolidated from ${i.cnt} experiences. Agent: ${i.agent}, success rate: ${(i.success_rate*100).toFixed(0)}%`,m=(i.sources||"").split(",").filter(Boolean);t.prepare(`
|
|
149
145
|
INSERT INTO qe_patterns (
|
|
150
146
|
id, pattern_type, qe_domain, domain, name, description,
|
|
151
147
|
confidence, usage_count, success_rate, quality_score, tier,
|
|
152
148
|
template_json, context_json, created_at, successful_uses
|
|
153
149
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
154
|
-
`).run(d,"workflow",i.domain,i.domain,l,
|
|
150
|
+
`).run(d,"workflow",i.domain,i.domain,l,y,k,i.cnt,i.success_rate,u,"short-term",JSON.stringify({type:"workflow",content:`${i.agent} pattern for ${i.domain}`,variables:[]}),JSON.stringify({tags:m,sourceType:"session-consolidation",extractedAt:new Date().toISOString()}),i.successes);let{ensurePatternEmbedding:T}=await import("./embed-and-insert-pattern-JELNEA2D.js");await T(t,d,l,y,m),c++}t.prepare(`
|
|
155
151
|
UPDATE captured_experiences
|
|
156
152
|
SET application_count = application_count + 1
|
|
157
153
|
WHERE domain = ? AND agent = ? AND application_count = 0
|
|
158
|
-
`).run(i.domain,i.agent)}catch{}return c}var g={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function _(){if(g.initializationPromise&&await g.initializationPromise,g.initialized&&g.reasoningBank&&g.hookRegistry)return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry};if(g.initializationPromise=
|
|
159
|
-
\u{1F4DD} Pre-Edit Analysis`)),console.log(
|
|
160
|
-
\u{1F3AF} Recommended Agent:`)
|
|
161
|
-
\u{1F4A1} Guidance:`)),
|
|
154
|
+
`).run(i.domain,i.agent)}catch{}return c}var g={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function _(){if(g.initializationPromise&&await g.initializationPromise,g.initialized&&g.reasoningBank&&g.hookRegistry)return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry};if(g.initializationPromise=Le(),await g.initializationPromise,g.initializationPromise=null,!g.reasoningBank||!g.hookRegistry)throw new Error("Failed to initialize hooks system");return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry}}async function Le(){if(!g.initialized)try{let o=R(),e=ke.join(o,".agentic-qe"),t=await O(e);try{g.coherenceService=await pe(ge),console.log($.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log($.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}g.reasoningBank=ne(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},g.coherenceService??void 0);let n=1e4,r=new AbortController,s=setTimeout(()=>r.abort(new Error("ReasoningBank init timeout")),n);try{await g.reasoningBank.initialize({signal:r.signal})}finally{clearTimeout(s)}try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-KQGC2UO7.js"),c=await a();c&&g.reasoningBank.setRvfDualWriter(c)}catch(a){process.env.DEBUG&&console.debug("[hooks] RVF wiring skipped:",a instanceof Error?a.message:a)}g.hookRegistry=he(g.reasoningBank),g.initialized=!0,console.log($.dim("[hooks] System initialized"))}catch(o){console.warn($.yellow(`[hooks] Using fallback mode: ${o instanceof Error?o.message:"unknown error"}`));let e=Pe();g.reasoningBank=ne(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0}),g.hookRegistry=new fe,g.hookRegistry.initialize(g.reasoningBank),g.initialized=!0}}function q(o){try{o.pragma("busy_timeout = 60000")}catch{}}async function O(o){let t=new ue({sqlite:{path:ke.join(o,"memory.db"),walMode:!0,poolSize:3,busyTimeout:6e4},enableFallback:!0,defaultNamespace:"qe-patterns"}),n=new AbortController,r=setTimeout(()=>n.abort(new Error("Backend init timeout")),5e3);try{await t.initialize({signal:n.signal})}finally{clearTimeout(r)}return t}function Pe(){let o=new Map;return{initialize:async()=>{},dispose:async()=>{o.clear()},get:async e=>{let t=o.get(e);return t?t.value:void 0},set:async(e,t,n)=>{o.set(e,{value:t})},delete:async e=>o.delete(e),has:async e=>o.has(e),search:async(e,t)=>{let n=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n.replace(/\*/g,".*"));return Array.from(o.keys()).filter(s=>r.test(s))},vectorSearch:async(e,t)=>[],storeVector:async(e,t,n)=>{},count:async e=>{let t=0,n=`${e}:`;for(let r of o.keys())r.startsWith(n)&&t++;return t},hasCodeIntelligenceIndex:async()=>{let e="code-intelligence:kg:";for(let t of o.keys())if(t.startsWith(e))return!0;return!1}}}function f(o){console.log(JSON.stringify(o,null,2))}function N(o){console.log($.green("\u2713"),o)}function b(o){console.error($.red("\u2717"),o)}function Z(o){if(o.length===0){console.log($.dim(" No specific guidance"));return}o.forEach((e,t)=>{console.log($.cyan(` ${t+1}.`),e)})}async function B(o=500){return process.stdin.isTTY?"":new Promise(e=>{let t="",n=setTimeout(()=>{process.stdin.removeAllListeners(),process.stdin.pause(),e(t)},o);process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{t+=r}),process.stdin.on("end",()=>{clearTimeout(n),e(t)}),process.stdin.on("error",()=>{clearTimeout(n),e(t)}),process.stdin.resume()})}function ye(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return""}let t=e.tool_input,n=e.toolInput,r=[t?.file_path,t?.filePath,n?.file_path,n?.filePath,e.file_path,e.filePath];for(let s of r)if(typeof s=="string"&&s.trim())return s;return""}function Ee(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return""}let t=e.tool_input,n=e.toolInput,r=[t?.subagent_type,t?.subagentType,n?.subagent_type,n?.subagentType,e.subagent_type,e.subagentType];for(let s of r)if(typeof s=="string"&&s.trim())return s;return""}import I from"chalk";import Ce from"node:path";U();function Te(o){o.command("pre-edit").description("Get context and guidance before editing a file").requiredOption("-f, --file <path>","File path to edit").option("-o, --operation <type>","Operation type: create, update, delete, refactor","update").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),r=(await t.emit(v.PreTestGeneration,{targetFile:e.file,testType:"unit",operation:e.operation}))[0]||{success:!0,guidance:[],routing:null};if(e.json){let s=r.guidance||[],c=[r.routing?.recommendedAgent?`Recommended agent: ${r.routing.recommendedAgent} (${(r.routing.confidence*100).toFixed(0)}% confidence).`:"",...s.map(i=>i)].filter(Boolean).join(" ");f({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:c||void 0},file:e.file,operation:e.operation,patterns:r.routing?.patterns?.length||0})}else console.log(I.bold(`
|
|
155
|
+
\u{1F4DD} Pre-Edit Analysis`)),console.log(I.dim(` File: ${e.file}`)),console.log(I.dim(` Operation: ${e.operation}`)),r.routing&&(console.log(I.bold(`
|
|
156
|
+
\u{1F3AF} Recommended Agent:`),I.cyan(r.routing.recommendedAgent)),console.log(I.dim(` Confidence: ${(r.routing.confidence*100).toFixed(1)}%`))),console.log(I.bold(`
|
|
157
|
+
\u{1F4A1} Guidance:`)),Z(r.guidance||[]);return}catch(t){throw b(`pre-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("post-edit").description("Record editing outcome for pattern learning").requiredOption("-f, --file <path>","File path that was edited").option("--success","Edit was successful").option("--failure","Edit failed").option("--pattern-id <id>","Pattern ID that was applied").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n=e.success||!e.failure,r=e.file||"";if(!r.trim())try{let p=await B();r=ye(p)}catch{}let s=r.split("/").pop()||"unknown",c=/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(s)?"test-generation":"code-intelligence",i=e.patternId||`edit:${c}:${s}`,l=(await t.emit(v.PostTestGeneration,{targetFile:r,success:n,patternId:i,generatedTests:null,testCount:0}))[0]||{success:!0,patternsLearned:0};try{let{reasoningBank:p}=await _();await p.recordOutcome({patternId:i,success:n,metrics:{executionTimeMs:0},feedback:`Edit ${n?"succeeded":"failed"}: ${r}`})}catch{}try{await W({task:`edit: ${r}`,agent:"cli-hook",domain:c,success:n,source:"cli-hook-post-edit"})}catch{}try{let p=R(),d=Ce.join(p,".agentic-qe"),k=await O(d);await x(k)}catch{}e.json?f({success:!0,file:r,editSuccess:n,patternsLearned:l.patternsLearned||0,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):(N(`Recorded edit outcome for ${r||"(unknown file)"}`),l.patternsLearned&&console.log(I.green(` Patterns learned: ${l.patternsLearned}`)));return}catch(t){throw b(`post-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}})}import{randomUUID as qe}from"crypto";U();import A from"chalk";import je from"node:path";function Me(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return o.trim()}let t=[e.prompt,e.user_prompt,e.command,e.tool_input?.prompt,e.tool_input?.description,e.toolInput?.prompt,e.toolInput?.description];for(let n of t)if(typeof n=="string"&&n.trim())return n;return""}function _e(o){o.command("route").description("Route a task to the optimal QE agent").option("-t, --task <description>","Task description (falls back to stdin event JSON)").option("-d, --domain <domain>","Target QE domain hint").option("-c, --capabilities <caps...>","Required capabilities").option("--json","Output as JSON").action(async e=>{try{let t=e.task??"";if(!t.trim()){let c=await B();t=Me(c)}if(!t.trim())throw new Error("No task provided. Pass --task <description> or pipe a Claude Code hook event JSON to stdin.");let{reasoningBank:n}=await _(),r={task:t,domain:e.domain,capabilities:e.capabilities},s=await n.routeTask(r);if(!s.success)throw new Error(s.error.message);let a=s.value;e.json?f({recommendedAgent:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,domains:a.domains,patternCount:a.patterns.length,guidance:a.guidance,reasoning:a.reasoning,exploration:a.exploration??!1,criticality:a.criticality??null,qWeight:a.qWeight??null}):(console.log(A.bold(`
|
|
162
158
|
\u{1F3AF} Task Routing Result`)),console.log(A.dim(` Task: "${t}"`)),console.log(A.bold(`
|
|
163
159
|
\u{1F464} Recommended Agent:`),A.cyan(a.recommendedAgent)),console.log(A.dim(` Confidence: ${(a.confidence*100).toFixed(1)}%`)),a.alternatives.length>0&&(console.log(A.bold(`
|
|
164
160
|
\u{1F504} Alternatives:`)),a.alternatives.forEach(c=>{console.log(A.dim(` - ${c.agent}: ${(c.score*100).toFixed(1)}%`))})),console.log(A.bold(`
|
|
165
161
|
\u{1F4C2} Detected Domains:`),a.domains.join(", ")),console.log(A.bold(`
|
|
166
|
-
\u{1F4A1} Guidance:`)),
|
|
167
|
-
\u{1F4D6} Reasoning:`),A.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-
|
|
162
|
+
\u{1F4A1} Guidance:`)),Z(a.guidance),console.log(A.bold(`
|
|
163
|
+
\u{1F4D6} Reasoning:`),A.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-CJLMC2I4.js"),i=c();i.isInitialized()||await i.initialize();let h=i.getDatabase();q(h),Y(h);let l=`route-${Date.now()}-${qe().slice(0,8)}`,p=a.confidence<.5,d=a;h.prepare(`
|
|
168
164
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
169
165
|
id, task_json, decision_json, used_agent,
|
|
170
166
|
followed_recommendation, success, quality_score,
|
|
171
167
|
duration_ms, error,
|
|
172
168
|
exploration, criticality, q_weight
|
|
173
169
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
174
|
-
`).run(l,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:p,exploration:d.exploration??!1,criticality:d.criticality??null,qWeight:d.qWeight??null}),a.recommendedAgent,1,0,-1,0,p?"low-confidence":null,d.exploration?1:0,d.criticality??null,d.qWeight??null);let k=R(),u=
|
|
170
|
+
`).run(l,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:p,exploration:d.exploration??!1,criticality:d.criticality??null,qWeight:d.qWeight??null}),a.recommendedAgent,1,0,-1,0,p?"low-confidence":null,d.exploration?1:0,d.criticality??null,d.qWeight??null);let k=R(),u=je.join(k,".agentic-qe"),y=await O(u);await x(y)}catch(c){console.error(A.dim(`[hooks] route persist: ${c instanceof Error?c.message:"unknown"}`))}return}catch(t){throw b(`route failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("post-route").description("Close the most-recent route sentinel from a Stop hook (#451)").option("--success [bool]","Whether the turn completed successfully","true").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=.325+(t?.25:0)+.1,r=M();r.isInitialized()||await r.initialize();let s=r.getDatabase();q(s);let a=s.prepare(`
|
|
175
171
|
SELECT id, task_json, used_agent FROM routing_outcomes
|
|
176
172
|
WHERE quality_score = -1
|
|
177
173
|
AND task_json NOT LIKE '%"taskId"%'
|
|
@@ -181,7 +177,7 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
181
177
|
UPDATE routing_outcomes
|
|
182
178
|
SET success = ?, quality_score = ?, duration_ms = 0, error = NULL
|
|
183
179
|
WHERE id = ?
|
|
184
|
-
`).run(t?1:0,n,a.id):{changes:0};if(a)try{let h=JSON.parse(a.task_json),l=String(h.description??"");l&&await
|
|
180
|
+
`).run(t?1:0,n,a.id):{changes:0};if(a)try{let h=JSON.parse(a.task_json),l=String(h.description??"");l&&await J({taskType:G(l),priority:"normal",domain:K(l)[0]??"any",agent:a.used_agent,success:t})}catch{}let i=s.prepare(`
|
|
185
181
|
UPDATE routing_outcomes
|
|
186
182
|
SET success = 0,
|
|
187
183
|
quality_score = 0.325,
|
|
@@ -190,20 +186,20 @@ import{a as v,b as fe,c as he}from"./chunk-PMHSTMHV.js";import{a as pe,b as ge}f
|
|
|
190
186
|
WHERE quality_score = -1
|
|
191
187
|
AND task_json NOT LIKE '%"taskId"%'
|
|
192
188
|
AND created_at < datetime('now', '-300 seconds')
|
|
193
|
-
`).run();e.json?f({success:!0,resolved:c.changes>0,staleSwept:i.changes,qualityScore:n,turnSuccess:t}):i.changes>0&&console.log(A.dim(`[hooks] post-route: swept ${i.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(A.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import
|
|
189
|
+
`).run();e.json?f({success:!0,resolved:c.changes>0,staleSwept:i.changes,qualityScore:n,turnSuccess:t}):i.changes>0&&console.log(A.dim(`[hooks] post-route: swept ${i.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(A.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import E from"chalk";Ie();function Se(o){o.command("stats").description("Display hooks system statistics").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.getStats();if(e.json)f(n);else{console.log(E.bold(`
|
|
194
190
|
\u{1F4CA} Hooks System Statistics
|
|
195
|
-
`)),console.log(
|
|
196
|
-
By Domain:`));for(let[r,s]of Object.entries(n.byDomain))s>0&&console.log(` ${r}: ${s}`);console.log(
|
|
197
|
-
Routing:`)),console.log(` Requests: ${n.routingRequests}`),console.log(` Avg Confidence: ${(n.avgRoutingConfidence*100).toFixed(1)}%`),console.log(
|
|
198
|
-
Learning:`)),console.log(` Outcomes: ${n.learningOutcomes}`),console.log(` Success Rate: ${(n.patternSuccessRate*100).toFixed(1)}%`),console.log(
|
|
199
|
-
Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${n.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${n.patternStoreStats.hnswStats.nativeAvailable?"\u2713":"\u2717"}`)}}catch(t){throw b(`stats failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("list").description("List all registered QE hook events").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n=t.getRegisteredEvents();if(e.json)f({events:n,totalEvents:Object.keys(v).length,registeredEvents:n.length});else{console.log(
|
|
191
|
+
`)),console.log(E.bold("Patterns:")),console.log(` Total: ${E.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(E.bold(`
|
|
192
|
+
By Domain:`));for(let[r,s]of Object.entries(n.byDomain))s>0&&console.log(` ${r}: ${s}`);console.log(E.bold(`
|
|
193
|
+
Routing:`)),console.log(` Requests: ${n.routingRequests}`),console.log(` Avg Confidence: ${(n.avgRoutingConfidence*100).toFixed(1)}%`),console.log(E.bold(`
|
|
194
|
+
Learning:`)),console.log(` Outcomes: ${n.learningOutcomes}`),console.log(` Success Rate: ${(n.patternSuccessRate*100).toFixed(1)}%`),console.log(E.bold(`
|
|
195
|
+
Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${n.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${n.patternStoreStats.hnswStats.nativeAvailable?"\u2713":"\u2717"}`)}}catch(t){throw b(`stats failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("list").description("List all registered QE hook events").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n=t.getRegisteredEvents();if(e.json)f({events:n,totalEvents:Object.keys(v).length,registeredEvents:n.length});else{console.log(E.bold(`
|
|
200
196
|
\u{1F4CB} Registered QE Hook Events
|
|
201
|
-
`)),console.log(
|
|
202
|
-
Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("emit").description("Emit a QE hook event").requiredOption("-e, --event <name>","Event name (e.g., qe:pattern-applied)").option("-d, --data <json>","Event data as JSON","{}").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n;try{n=le(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let r=await t.emit(e.event,n);e.json?f({event:e.event,results:r}):(console.log(
|
|
203
|
-
\u{1F4E1} Hook Event Emitted`)),console.log(
|
|
197
|
+
`)),console.log(E.bold("All Available Events:"));for(let[r,s]of Object.entries(v)){let c=n.includes(s)?E.green("\u2713"):E.dim("\u25CB");console.log(` ${c} ${r}: ${E.dim(s)}`)}console.log(E.dim(`
|
|
198
|
+
Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("emit").description("Emit a QE hook event").requiredOption("-e, --event <name>","Event name (e.g., qe:pattern-applied)").option("-d, --data <json>","Event data as JSON","{}").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n;try{n=le(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let r=await t.emit(e.event,n);e.json?f({event:e.event,results:r}):(console.log(E.bold(`
|
|
199
|
+
\u{1F4E1} Hook Event Emitted`)),console.log(E.dim(` Event: ${e.event}`)),console.log(E.dim(` Handlers: ${r.length}`)),r.forEach((s,a)=>{let c=s.success?E.green("\u2713"):E.red("\u2717");console.log(` ${c} Handler ${a+1}: ${s.success?"success":s.error}`),s.patternsLearned&&console.log(E.green(` Patterns learned: ${s.patternsLearned}`))}))}catch(t){throw b(`emit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("learn").description("Store a new pattern in the reasoning bank").requiredOption("-n, --name <name>","Pattern name").requiredOption("-d, --description <desc>","Pattern description").option("-t, --type <type>","Pattern type","test-template").option("--domain <domain>","QE domain").option("--tags <tags...>","Pattern tags").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.storePattern({patternType:e.type,name:e.name,description:e.description,template:{type:"prompt",content:e.description,variables:[]},context:{tags:e.tags||[]}});if(!n.success)throw new Error(n.error.message);let r=n.value;e.json?f({success:!0,pattern:{id:r.id,name:r.name,type:r.patternType,domain:r.qeDomain}}):(N(`Pattern stored: ${r.name}`),console.log(E.dim(` ID: ${r.id}`)),console.log(E.dim(` Domain: ${r.qeDomain}`)),console.log(E.dim(` Tier: ${r.tier}`)))}catch(t){throw b(`learn failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("search").description("Search for patterns in the reasoning bank").requiredOption("-q, --query <query>","Search query").option("-l, --limit <n>","Maximum results","10").option("-d, --domain <domain>","Filter by domain").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.searchPatterns(e.query,{limit:parseInt(e.limit,10),domain:e.domain});if(!n.success)throw new Error(n.error.message);let r=n.value;e.json?f({query:e.query,total:r.length,patterns:r.map(s=>({id:s.pattern.id,name:s.pattern.name,score:s.score,domain:s.pattern.qeDomain,matchType:s.matchType}))}):(console.log(E.bold(`
|
|
204
200
|
\u{1F50D} Search Results for "${e.query}"
|
|
205
|
-
`)),r.length===0?console.log(
|
|
206
|
-
`)){let t=e.match(/^(?:export\s+)?NAGUAL_CLOUD_KEY=(.+)/);if(t)return t[1].trim().replace(/^['"]|['"]$/g,"")}}catch{}}var
|
|
201
|
+
`)),r.length===0?console.log(E.dim(" No patterns found")):r.forEach((s,a)=>{console.log(`${E.cyan(`${a+1}.`)} ${s.pattern.name} ${E.dim(`(${(s.score*100).toFixed(1)}%)`)}`),console.log(E.dim(` Domain: ${s.pattern.qeDomain}`)),console.log(E.dim(` Match: ${s.matchType}`)),console.log(E.dim(` ID: ${s.pattern.id}`)),console.log()}),console.log(E.dim(`Found ${r.length} pattern(s)`)))}catch(t){throw b(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}U();import Q from"chalk";import Ue from"node:path";function be(o){o.command("session-start").description("Initialize session state when Claude Code session starts").option("-s, --session-id <id>","Session ID").option("--json","Output as JSON").action(async e=>{try{let t=e.sessionId||`session-${Date.now()}`;g.sessionId=t;let{reasoningBank:n}=await _(),r=await n.getStats(),s=R(),a=Ue.join(s,".agentic-qe"),c=await O(a),i=await c.get(H),h=!i||!i.sessionStartTime;i?(i.sessionStartTime=new Date().toISOString(),i.totalDreamsThisSession=0):i={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0},await c.set(H,i);let l=[];l.push(`AQE Learning: ${r.totalPatterns} patterns loaded`);let p=Object.entries(r.byDomain).filter(([,k])=>k>0).sort(([,k],[,u])=>u-k).slice(0,5);p.length>0&&l.push(`Top domains: ${p.map(([k,u])=>`${k}(${u})`).join(", ")}`),r.patternSuccessRate>0&&l.push(`Pattern success rate: ${(r.patternSuccessRate*100).toFixed(0)}%`),r.routingRequests>0&&l.push(`Routing confidence: ${(r.avgRoutingConfidence*100).toFixed(0)}% across ${r.routingRequests} requests`);let d=l.join(". ")+".";e.json?f({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:d},sessionId:t,initialized:!0,patternsLoaded:r.totalPatterns,dreamScheduler:{enabled:!0,lastDreamTime:i.lastDreamTime,pendingExperiences:i.experienceCount}}):(N(`Session started: ${t}`),console.log(Q.dim(` Patterns loaded: ${r.totalPatterns}`)),console.log(Q.dim(` Dream scheduler: enabled (${i.experienceCount} pending experiences)`)));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("session-end").description("Save session state when Claude Code session ends").option("--save-state","Save learning state to disk").option("--export-metrics","Export session metrics").option("--json","Output as JSON").action(async e=>{try{let t=g.sessionId||"unknown",n=null;if(g.initialized&&g.reasoningBank)try{n=await g.reasoningBank.getStats()}catch{}let r=0;try{r=await se()}catch{}if(e.json){let s=n?`Session complete: ${n.totalPatterns} patterns, ${n.routingRequests} routings, ${(n.patternSuccessRate*100).toFixed(0)}% success rate`:"Session complete";f({continue:!0,sessionId:t,stateSaved:e.saveState||!1,metricsExported:e.exportMetrics||!1,patternsConsolidated:r,finalStats:n?{patternsLearned:n.totalPatterns,routingRequests:n.routingRequests,successRate:n.patternSuccessRate}:null})}else N(`Session ended: ${t}`),n&&(console.log(Q.dim(` Patterns: ${n.totalPatterns}`)),console.log(Q.dim(` Routing requests: ${n.routingRequests}`))),r>0&&console.log(Q.dim(` Patterns consolidated: ${r}`));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{createHash as Je,randomUUID as Qe}from"node:crypto";import w from"chalk";import Ve from"node:path";U();$e();import{readFileSync as Fe}from"node:fs";import{homedir as He}from"node:os";var ee=de.create("nagual-client");function Be(){try{let o=Fe(`${He()}/.nagual/cloud-hooks.env`,"utf8");for(let e of o.split(`
|
|
202
|
+
`)){let t=e.match(/^(?:export\s+)?NAGUAL_CLOUD_KEY=(.+)/);if(t)return t[1].trim().replace(/^['"]|['"]$/g,"")}}catch{}}var ze="http://localhost:3333",we=3e3,Ge=5e3;var ie=class{baseUrl;token;enabled;constructor(){this.baseUrl=process.env.NAGUAL_URL??ze,this.token=process.env.NAGUAL_CLOUD_KEY??process.env.NAGUAL_API_TOKEN??Be(),this.enabled=!0}async search(e,t,n=5){try{let r=await fetch(`${this.baseUrl}/api/patterns/search`,{method:"POST",headers:this.headers(),body:JSON.stringify({query:e,domain:t,limit:n}),signal:AbortSignal.timeout(we)});return r.ok?(await r.json()).patterns??[]:[]}catch{return[]}}async recordOutcome(e,t){try{let n=await fetch(`${this.baseUrl}/api/patterns/${encodeURIComponent(e)}/outcome`,{method:"POST",headers:this.headers(),body:JSON.stringify(t),signal:AbortSignal.timeout(we)});n.ok||ee.debug("nagual recordOutcome non-OK",{patternId:e,status:n.status})}catch(n){ee.debug("nagual recordOutcome failed (non-fatal)",{patternId:e,err:n})}}async promotePattern(e){let t={problem:e.problem,solution:e.solution,domain:e.domain,reward:e.reward*.8,tags:[...e.tags??[],"source:aqe",e.source_project?`project:${e.source_project}`:null].filter(n=>n!==null)};try{let n=await fetch(`${this.baseUrl}/api/patterns`,{method:"POST",headers:this.headers(),body:JSON.stringify(t),signal:AbortSignal.timeout(Ge)});n.ok||ee.debug("nagual promotePattern non-OK",{status:n.status})}catch(n){ee.debug("nagual promotePattern failed (non-fatal)",{err:n})}}headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization=`Bearer ${this.token}`),e}},ae;function Re(){return ae||(ae=new ie),ae}var We=/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/;function Ae(o,e){let t={};if(o!==void 0){if(!We.test(o))return{error:`Invalid --parent-agent-id "${o}": must start with a letter or digit and contain only letters, digits, "_", ".", ":", "-" (max 128 chars)`};t.parentAgentId=o}if(e!==void 0){let n=typeof e=="number"?e:Number(e);if(!Number.isInteger(n))return{error:`Invalid --depth "${e}": must be an integer`};if(n<0)return{error:`Invalid --depth ${n}: must be >= 0`};if(n>32)return{error:`Invalid --depth ${n}: must be <= 32`};t.depth=n}return t}var Xe="task-bridge",Ke=6e5,ve=.5;function Ye(o){return Je("sha256").update(o).digest("hex").slice(0,16)}var Ze=new Set(["test-generation","coverage-analysis","defect-intelligence","security-compliance","quality-assessment","requirements-validation"]),et=80;async function tt(o,e){return!process.env.NAGUAL_URL&&!process.env.NAGUAL_CLOUD_URL&&!process.env.NAGUAL_CLOUD_KEY?[]:o.length<et?[]:e&&!Ze.has(e)?[]:Re().search(o.slice(0,300),e,3)}function Oe(o){o.command("pre-task").description("Get context and guidance before spawning a Task agent").option("--task-id <id>","Task identifier").option("-d, --description <desc>","Task description").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=null;if(e.description){let d=await t.routeTask({task:e.description});d.success&&(n=d.value)}let r=(n?.patterns??[]).slice(0,5).map(d=>d?.id).filter(d=>typeof d=="string"),s=n?.domains?.[0],a=e.description?await tt(String(e.description),s):[],c=null,i=[],h=0,l=null;try{let d=M();d.isInitialized()||await d.initialize();let k=d.getDatabase();q(k);try{let u=k.prepare(`
|
|
207
203
|
SELECT used_agent AS agent,
|
|
208
204
|
ROUND(AVG(quality_score), 3) AS avgQuality,
|
|
209
205
|
COUNT(*) AS n
|
|
@@ -219,30 +215,30 @@ Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list fail
|
|
|
219
215
|
AND created_at > datetime('now', '-7 days')
|
|
220
216
|
ORDER BY created_at DESC
|
|
221
217
|
LIMIT 3
|
|
222
|
-
`).all().map(
|
|
218
|
+
`).all().map(y=>({key:y.key,summary:String(y.value).slice(0,200)}))}catch{}if(r.length>0)try{let u=r.map(()=>"?").join(","),y=k.prepare(`
|
|
223
219
|
SELECT COALESCE(SUM(average_token_savings), 0) AS sum
|
|
224
220
|
FROM qe_patterns
|
|
225
221
|
WHERE id IN (${u})
|
|
226
|
-
`).get(...r);h=Math.max(0,Math.round(
|
|
222
|
+
`).get(...r);h=Math.max(0,Math.round(y?.sum??0))}catch{}if(e.description)try{let u=String(e.description),y=G(u),m="normal",T=n?.domains?.[0]??"any",D=Math.max(0,Math.min(10,Math.round(Math.min(u.length/200,1)*10)));l=`task:${Ye(u)}`;let L=JSON.stringify({selectedPatternIds:r,agent:n?.recommendedAgent??null,description:u.slice(0,200),taskType:y,priority:m,domain:T,complexityBucket:D,estimatedTokenSavings:h,ts:Date.now()}),P=Date.now()+Ke;k.prepare(`
|
|
227
223
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
|
|
228
224
|
VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
|
|
229
|
-
`).run(l,
|
|
225
|
+
`).run(l,Xe,L,P)}catch(u){console.error(w.dim(`[hooks] pre-task bridge: ${u instanceof Error?u.message:"unknown"}`))}if(n?.recommendedAgent)try{Y(k);let u=e.taskId||`hook-${Date.now()}`,y=`route-${Date.now()}-${Qe().slice(0,8)}`,m=n.confidence<ve,T=n;k.prepare(`
|
|
230
226
|
INSERT INTO routing_outcomes (
|
|
231
227
|
id, task_json, decision_json, used_agent,
|
|
232
228
|
followed_recommendation, success, quality_score,
|
|
233
229
|
duration_ms, error,
|
|
234
230
|
exploration, criticality, q_weight
|
|
235
231
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
236
|
-
`).run(
|
|
232
|
+
`).run(y,JSON.stringify({description:e.description,taskId:u}),JSON.stringify({recommended:n.recommendedAgent,confidence:n.confidence,alternatives:n.alternatives,lowConfidence:m,exploration:T.exploration??!1,criticality:T.criticality??null,qWeight:T.qWeight??null}),n.recommendedAgent,1,0,-1,0,m?"low-confidence":null,T.exploration?1:0,T.criticality??null,T.qWeight??null)}catch(u){console.error(w.dim(`[hooks] pre-task sentinel: ${u instanceof Error?u.message:"unknown"}`))}}catch(d){console.error(w.dim(`[hooks] pre-task memory: ${d instanceof Error?d.message:"unknown"}`))}let p=n?n.confidence<ve:!1;if(e.json)f({success:!0,taskId:e.taskId,description:e.description,recommendedAgent:n?.recommendedAgent,confidence:n?.confidence,guidance:n?.guidance||[],selectedPatternIds:r,historicalBest:c,priorVerdicts:i,estimatedTokenSavings:h,lowConfidence:p,bridgeKey:l,nagualPatterns:a.map(d=>({id:d.id,problem:d.problem,solution:d.solution.slice(0,400),domain:d.domain,reward:d.reward}))});else if(console.log(w.bold(`
|
|
237
233
|
\u{1F680} Pre-Task Analysis`)),console.log(w.dim(` Task ID: ${e.taskId||"N/A"}`)),n&&(console.log(w.bold(`
|
|
238
234
|
\u{1F3AF} Recommended:`),w.cyan(n.recommendedAgent)),console.log(w.dim(` Confidence: ${(n.confidence*100).toFixed(1)}%`)),p&&console.log(w.yellow(" \u26A0 Low confidence \u2014 consider providing more context"))),a.length>0){console.log(w.bold(`
|
|
239
|
-
\u{1F4DA} Nagual context (cross-project):`));for(let d of a)console.log(w.dim(` [${d.domain}] ${d.problem.slice(0,80)} (reward: ${d.reward.toFixed(2)})`))}return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success [bool]","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("-d, --description <desc>","Task description \u2014 fallback Q-state source when pre-task bridge is absent (issue #499)").option("--parent-agent-id <id>","Agent that spawned this task (ADR-101 nesting provenance)").option("--depth <n>","Nesting depth of this task, 0 = top-level (ADR-101)").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=
|
|
235
|
+
\u{1F4DA} Nagual context (cross-project):`));for(let d of a)console.log(w.dim(` [${d.domain}] ${d.problem.slice(0,80)} (reward: ${d.reward.toFixed(2)})`))}return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success [bool]","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("-d, --description <desc>","Task description \u2014 fallback Q-state source when pre-task bridge is absent (issue #499)").option("--parent-agent-id <id>","Agent that spawned this task (ADR-101 nesting provenance)").option("--depth <n>","Nesting depth of this task, 0 = top-level (ADR-101)").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0;if(!e.agent||!String(e.agent).trim())try{let s=await B(),a=Ee(s);a&&(e.agent=a)}catch{}let n=Ae(e.parentAgentId,e.depth);if(n.error){e.json?console.log(JSON.stringify({success:!1,error:n.error})):console.error(w.red(` \u2717 ${n.error}`)),process.exitCode=1;return}let r=0;try{let{hookRegistry:s,reasoningBank:a}=await _();r=(await s.emit(v.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((p,d)=>p+(d.patternsLearned||0),0);{let p=e.taskId||`hook-${Date.now()}`,d=e.agent||"unknown",k=e.duration?parseInt(e.duration,10):0,u=(n.parentAgentId?`, Parent: ${n.parentAgentId}`:"")+(n.depth!==void 0?`, Depth: ${n.depth}`:"");await a.recordOutcome({patternId:`task:${d}:${p}`,success:t,metrics:{executionTimeMs:k},feedback:`Agent: ${d}, Task: ${p}${u}`});let y=await oe({taskId:p,agent:d,durationMs:k,success:t,parentAgentId:n.parentAgentId,depth:n.depth}),m=d==="unknown"&&y.bridge?.agent?y.bridge.agent:d;await re({agent:m,success:t,durationMs:k,qualityScore:y.qualityScore});let T=String(e.description??"");if(y.bridge||T){let D=y.bridge?.taskType??G(T),L=y.bridge?.priority??"normal",P=y.bridge?.domain??K(T)[0]??"any";await J({taskType:D,priority:L,domain:P,agent:m,success:t})}}let i=R(),h=Ve.join(i,".agentic-qe"),l=await O(h);await x(l)}catch(s){console.error(w.dim(`[hooks] Learning init: ${s instanceof Error?s.message:"unknown"}`))}e.json?f({success:!0,taskId:e.taskId,taskSuccess:t,patternsLearned:r,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):(N(`Task completed: ${e.taskId||"unknown"}`),console.log(w.dim(` Success: ${t}`)),r>0&&console.log(w.green(` Patterns learned: ${r}`)));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{existsSync as nt,readFileSync as ot}from"node:fs";import{randomUUID as Ne}from"node:crypto";import X from"chalk";import De from"node:path";U();import*as z from"fs";import*as te from"path";var V=class o{statePath;warnThreshold;blockThreshold;halfOpenAfterMs;staleAfterMs;constructor(e){this.statePath=e.statePath,this.warnThreshold=e.warnThreshold??3,this.blockThreshold=e.blockThreshold??5,this.halfOpenAfterMs=e.halfOpenAfterMs??12e4,this.staleAfterMs=e.staleAfterMs??30*6e4}static signature(e){return e.trim().replace(/\s+/g," ").slice(0,200)}check(e,t=Date.now()){let n=o.signature(e);if(!n)return{verdict:"allow",consecutiveFailures:0,halfOpen:!1};let r=this.readState()[n];if(!r||r.consecutiveFailures<this.warnThreshold)return{verdict:"allow",consecutiveFailures:r?.consecutiveFailures??0,halfOpen:!1};let s=r.consecutiveFailures;return s>=this.blockThreshold?t-r.lastFailureAt>=this.halfOpenAfterMs?{verdict:"warn",consecutiveFailures:s,halfOpen:!0,hint:`This command has failed ${s}x consecutively; allowing one probe attempt. If it fails again it will be flagged immediately.`}:{verdict:"block",consecutiveFailures:s,halfOpen:!1,hint:`The same command failed ${s}x consecutively. Re-running it unchanged is unlikely to succeed \u2014 inspect the error output, change the approach, or fix the underlying problem first. (A successful run resets this breaker.)`}:{verdict:"warn",consecutiveFailures:s,halfOpen:!1,hint:`This command has failed ${s}x consecutively \u2014 consider changing approach before retrying.`}}record(e,t,n=Date.now()){let r=o.signature(e);if(r)try{let s=this.readState();if(t){s[r]&&(delete s[r],this.writeState(s,n));return}let a=s[r]??{consecutiveFailures:0,lastFailureAt:n};a.consecutiveFailures+=1,a.lastFailureAt=n,s[r]=a,this.writeState(s,n)}catch{}}static isStrict(e=process.env){return e.AQE_STRICT_TOOL_LOOP==="1"||e.AQE_STRICT_TOOL_LOOP==="true"}readState(){try{let e=z.readFileSync(this.statePath,"utf8"),t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}writeState(e,t){for(let[n,r]of Object.entries(e))t-r.lastFailureAt>this.staleAfterMs&&delete e[n];z.mkdirSync(te.dirname(this.statePath),{recursive:!0}),z.writeFileSync(this.statePath,JSON.stringify(e))}};function ce(o){return new V({statePath:te.join(o,".agentic-qe","tool-loop-state.json")})}function rt(o){return/\bjest\b/i.test(o)?"jest":/\bvitest\b/i.test(o)?"vitest":/\bpytest\b/i.test(o)?"pytest":/\bmocha\b/i.test(o)?"mocha":null}async function st(o){try{let e=M();e.isInitialized()||await e.initialize();let t=e.getDatabase();q(t);let n=o.framework==="pytest"?"python":"javascript",r=o.command.split(/\s+/).slice(0,3).join("-").slice(0,80);t.prepare(`
|
|
240
236
|
INSERT INTO test_outcomes (
|
|
241
237
|
id, test_id, test_name, generated_by, framework, language, domain,
|
|
242
238
|
passed, execution_time_ms, maintainability_score, created_at
|
|
243
239
|
) VALUES (?, ?, ?, 'cli-hook-post-command', ?, ?, 'test-execution',
|
|
244
240
|
?, ?, 0.5, datetime('now'))
|
|
245
|
-
`).run(`to-${Date.now()}-${
|
|
241
|
+
`).run(`to-${Date.now()}-${Ne().slice(0,8)}`,`cmd:${r}`,o.command.slice(0,200),o.framework,n,o.success?1:0,o.durationMs);try{let s=De.join(process.cwd(),"coverage","coverage-summary.json");if(nt(s)){let c=JSON.parse(ot(s,"utf-8")).total??{},i=Number(c.lines?.pct??0),h=Number(c.branches?.pct??0),l=Number(c.functions?.pct??0),p=t.prepare(`
|
|
246
242
|
SELECT after_lines, after_branches, after_functions
|
|
247
243
|
FROM coverage_sessions
|
|
248
244
|
WHERE target_path = ?
|
|
@@ -256,8 +252,8 @@ Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list fail
|
|
|
256
252
|
tests_generated, tests_passed, duration_ms,
|
|
257
253
|
started_at, completed_at
|
|
258
254
|
) VALUES (?, ?, 'cli-hook-post-command', ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?)
|
|
259
|
-
`).run(`cs-${Date.now()}-${
|
|
260
|
-
\u26A0\uFE0F Command Warnings:`)),a.forEach(i=>console.log(
|
|
255
|
+
`).run(`cs-${Date.now()}-${Ne().slice(0,8)}`,process.cwd(),o.framework,p?.after_lines??0,p?.after_branches??0,p?.after_functions??0,i,h,l,o.success?1:0,o.durationMs,d,d)}}catch(s){console.error(X.dim(`[hooks] coverage_sessions: ${s instanceof Error?s.message:"unknown"}`))}}catch(e){console.error(X.dim(`[hooks] test_outcomes: ${e instanceof Error?e.message:"unknown"}`))}}function xe(o){o.command("guard").description("File guardian - block edits to protected files").requiredOption("-f, --file <path>","File path to check").option("--json","Output as JSON (required for hook API)").action(async e=>{try{let t=e.file||"",n=t.replace(/\\/g,"/"),s=[{pattern:/^\.env($|\.)/,reason:"Environment file contains secrets"},{pattern:/\.env\.[a-zA-Z]+$/,reason:"Environment file contains secrets"},{pattern:/\.lock$/,reason:"Lock files are auto-generated"},{pattern:/(^|\/)node_modules\//,reason:"node_modules is managed by package manager"},{pattern:/(^|\/)\.agentic-qe\/memory\.db/,reason:"AQE memory database must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-wal$/,reason:"AQE WAL file must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-shm$/,reason:"AQE shared memory file must not be directly edited"}].find(a=>a.pattern.test(n));s?e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Protected file: ${s.reason} (${t})`}}):b(`Blocked: ${s.reason} (${t})`):e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}}):N(`Allowed: ${t}`);return}catch{e.json&&f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),o.command("pre-command").description("Get context before executing a Bash command").option("-c, --command <cmd>","Command to be executed").option("--json","Output as JSON").action(async e=>{try{let t=e.command||"",n=[{pattern:/rm\s+(-[a-zA-Z]*f[a-zA-Z]*\s+)?-[a-zA-Z]*r[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+(-[a-zA-Z]*r[a-zA-Z]*\s+)?-[a-zA-Z]*f[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+-rf\s+~/,reason:"Recursive delete of home directory"},{pattern:/DROP\s+(TABLE|DATABASE|SCHEMA)/i,reason:"Destructive SQL operation"},{pattern:/git\s+push\s+.*--force(?!-)/,reason:"Force push can overwrite remote history"},{pattern:/git\s+reset\s+--hard/,reason:"Hard reset discards uncommitted changes"},{pattern:/>\s*\/dev\/sd[a-z]/,reason:"Direct write to block device"},{pattern:/dd\s+if=.*of=\/dev\/sd/,reason:"Direct disk write via dd"},{pattern:/chmod\s+777\s/,reason:"World-writable permissions are a security risk"},{pattern:/:\(\)\s*\{\s*:\|\s*:&\s*\}\s*;?\s*:/,reason:"Fork bomb detected"},{pattern:/mkfs\./,reason:"Filesystem format operation"},{pattern:/>\s*\/dev\/null\s*2>&1\s*&\s*disown/,reason:"Stealth background process"}],r=[{pattern:/\.agentic-qe.*rm/,reason:"Deleting AQE data files"},{pattern:/rm\s+-rf\s/,reason:"Recursive force delete"},{pattern:/git\s+clean\s+-[a-zA-Z]*f/,reason:"Force cleaning untracked files"}],s=n.find(i=>i.pattern.test(t)),a=r.filter(i=>i.pattern.test(t)).map(i=>i.reason),c=null;try{c=ce(R()).check(t)}catch{}if(c&&c.verdict==="block"&&V.isStrict()){e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Tool-loop breaker (AQE_STRICT_TOOL_LOOP): ${c.hint}`}}):b(`Blocked by tool-loop breaker: ${c.hint}`);return}if(c&&c.verdict==="block"?a.push(`\u{1F6D1} TOOL-LOOP BREAKER: ${c.hint}`):c&&c.verdict==="warn"&&a.push(`Tool-loop breaker: ${c.hint}`),s)e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Dangerous command blocked: ${s.reason}`}}):b(`Blocked: ${s.reason}`);else if(e.json){let i={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};a.length>0&&(i.hookSpecificOutput.additionalContext=`Warnings: ${a.join("; ")}`),f(i)}else a.length>0&&(console.log(X.yellow(`
|
|
256
|
+
\u26A0\uFE0F Command Warnings:`)),a.forEach(i=>console.log(X.yellow(` - ${i}`))));return}catch{e.json&&f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),o.command("post-command").description("Record Bash command outcome").option("-c, --command <cmd>","Command that was executed").option("--success [bool]","Whether command succeeded","true").option("--exit-code <code>","Command exit code").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=e.exitCode?parseInt(e.exitCode,10):t?0:1,r=(e.command||"").substring(0,200);try{ce(R()).record(r,t)}catch{}let s=/\b(test|vitest|jest|pytest|mocha)\b/i.test(r),a=/\b(build|compile|tsc)\b/i.test(r),c=/\b(lint|eslint|prettier)\b/i.test(r),i=0,h=!1;try{let{reasoningBank:l}=await _();if(s){let{hookRegistry:T}=await _();await T.emit(v.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${r.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let p=r.replace(/[^a-zA-Z0-9]/g,"-").slice(0,80),d=s?"test-execution":a?"code-intelligence":c?"quality-assessment":"code-intelligence";await l.recordOutcome({patternId:`cmd:${p}`,success:t,metrics:{executionTimeMs:0},feedback:`Command: ${r}, exit: ${n}`}),i=1,(s||a||c)&&(await W({task:`bash: ${r}`,agent:"cli-hook",domain:d,success:t,source:"cli-hook-post-command"}),h=!0);let k=rt(r);k&&await st({command:r,framework:k,success:t,durationMs:0});let u=R(),y=De.join(u,".agentic-qe"),m=await O(y);await x(m)}catch(l){console.error(X.dim(`[hooks] post-command learning: ${l instanceof Error?l.message:"unknown"}`))}e.json&&f({success:!0,command:r.substring(0,100),commandSuccess:t,exitCode:n,patternsLearned:i,experienceRecorded:h});return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}function $n(){let o=new at("hooks").description("Self-learning QE hooks for pattern recognition and guidance").addHelpText("after",`
|
|
261
257
|
Examples:
|
|
262
258
|
# File editing hooks (learning from edits)
|
|
263
259
|
aqe hooks pre-edit --file src/utils.ts --operation create
|
|
@@ -282,4 +278,4 @@ Examples:
|
|
|
282
278
|
aqe hooks search --query "authentication"
|
|
283
279
|
aqe hooks stats
|
|
284
280
|
aqe hooks list
|
|
285
|
-
`);return
|
|
281
|
+
`);return Te(o),_e(o),Se(o),be(o),Oe(o),xe(o),o}export{v as QE_HOOK_EVENTS,$n as createHooksCommand,_ as getHooksSystem,g as hooksState};
|
|
@@ -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.11.5");process.exit(0)}
|
|
2
|
+
import{a,b,c}from"./chunk-YR2JKBZO.js";import"./chunk-AL5VJJN4.js";import"./chunk-ZLBY25MB.js";import"./chunk-V6NAB5UZ.js";import"./chunk-RFLHPLET.js";import"./chunk-RKXZLTWR.js";import"./chunk-K4I7UIU5.js";import"./chunk-C4EZNOWK.js";export{a as HybridRouter,b as createHybridRouter,c as createQERouter};
|
|
@@ -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.11.
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.5");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-DFRRWOEX.js";import"./chunk-IU5RSN6M.js";import"./chunk-CKOF27L7.js";import"./chunk-RKXZLTWR.js";import"./chunk-K4I7UIU5.js";import"./chunk-C4EZNOWK.js";export{a as DEFAULT_HYPERGRAPH_ENGINE_CONFIG,b as HypergraphEngine,c as createHypergraphEngine,d as createHypergraphEngineSync,e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
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.11.5");process.exit(0)}
|
|
2
|
+
import"./chunk-C4EZNOWK.js";import e from"chalk";import{join as m,resolve as h}from"path";import{existsSync as y}from"fs";var c=class{name="hypergraph";description="Query the code knowledge hypergraph";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let s=n.command("hypergraph").alias("hg").description(this.description);s.command("stats").description("Show hypergraph statistics (node/edge counts by type)").option("--db <path>","Database path").action(async t=>{await this.executeStats(t)}),s.command("untested").description("Find functions with no test coverage").option("--db <path>","Database path").option("--limit <number>","Max results","20").action(async t=>{await this.executeUntested(t)}),s.command("impacted <files...>").description("Find tests impacted by changed files").option("--db <path>","Database path").action(async(t,i)=>{await this.executeImpacted(t,i)}),s.command("gaps").description("Find functions with low coverage").option("--db <path>","Database path").option("--max-coverage <number>","Coverage threshold (%)","50").option("--limit <number>","Max results","20").action(async t=>{await this.executeGaps(t)})}async executeStats(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=await r.getStats();if(console.log(e.blue(`
|
|
3
3
|
Hypergraph Statistics
|
|
4
4
|
`)),console.log(e.white(` Total nodes: ${t.totalNodes}`)),console.log(e.white(` Total edges: ${t.totalEdges}`)),t.totalNodes>0){console.log(e.gray(`
|
|
5
5
|
Nodes by type:`));for(let[i,o]of Object.entries(t.nodesByType))o>0&&console.log(e.gray(` ${i}: ${o}`));console.log(e.gray(`
|
|
@@ -15,7 +15,7 @@ import"./chunk-PUK5NE47.js";import e from"chalk";import{join as m,resolve as h}f
|
|
|
15
15
|
`))}finally{i()}await this.cleanupAndExit(0)}async executeGaps(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=parseInt(n.maxCoverage,10)||50,i=parseInt(n.limit,10)||20,o=await r.findCoverageGaps(t),a=o.slice(0,i);if(console.log(e.blue(`
|
|
16
16
|
Coverage Gaps (<= ${t}%) \u2014 ${o.length} total
|
|
17
17
|
`)),a.length===0)console.log(e.green(" No coverage gaps found!"));else{for(let l of a){let d=l.coverage!==void 0?e.red(` ${l.coverage}%`):"",p=l.complexity?e.yellow(` complexity=${l.complexity}`):"";console.log(e.white(` ${l.name}`)+d+e.gray(` ${l.filePath||""}`)+p)}o.length>i&&console.log(e.gray(`
|
|
18
|
-
... and ${o.length-i} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async openEngine(n){let{findProjectRoot:r}=await import("./unified-memory-
|
|
18
|
+
... and ${o.length-i} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async openEngine(n){let{findProjectRoot:r}=await import("./unified-memory-CJLMC2I4.js"),{openDatabase:s}=await import("./safe-db-LCPUYMX4.js"),{createHypergraphEngine:t}=await import("./hypergraph-engine-WC6DMTYQ.js"),i=r(),o=n||m(i,".agentic-qe","memory.db");if(!y(o))throw new Error(`Database not found: ${o}
|
|
19
19
|
Run "aqe init --auto" first.`);let a=s(o);try{return{engine:await t({db:a,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),close:()=>{try{a.close()}catch{}}}}catch(l){try{a.close()}catch{}throw l}}getHelp(){return`
|
|
20
20
|
Query the code knowledge hypergraph for untested functions,
|
|
21
21
|
impacted tests, and coverage gaps.
|
|
@@ -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.11.5");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-AOQYORVA.js";import"./chunk-AXKWV5NF.js";import"./chunk-26WEI3P4.js";import"./chunk-6R3YOAKO.js";import"./chunk-ZMPAM4DY.js";import"./chunk-Y25PO65W.js";import"./chunk-CKOF27L7.js";import"./chunk-5WMU7XCF.js";import"./chunk-RKXZLTWR.js";import"./chunk-K4I7UIU5.js";import"./chunk-C4EZNOWK.js";export{a as ImpactAnalyzerService};
|
|
@@ -1,19 +1,19 @@
|
|
|
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.11.
|
|
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.11.5");process.exit(0)}
|
|
2
|
+
import{a as p}from"./chunk-5WMU7XCF.js";import{a as w,c as y}from"./chunk-RKXZLTWR.js";import"./chunk-C4EZNOWK.js";import o from"chalk";import{createRequire as C}from"node:module";y();var f=class{name="init";description="Initialize the AQE v3 system";cleanupAndExit;originalStdoutWrite=null;constructor(e){this.cleanupAndExit=e}register(e,t){e.command("init").description(this.description).option("-d, --domains <domains>","Comma-separated list of domains to enable","all").option("-m, --max-agents <number>","Maximum concurrent agents","15").option("--memory <backend>",'Memory backend (sqlite|agentdb|hybrid|memory). "memory" = database-free, in-memory only.',"hybrid").option("--no-database","Database-free install: alias for `--memory memory`. Skips the SQLite database phase and runs any MCP server in-memory \u2014 nothing is written to .agentic-qe/.").option("--lazy","Enable lazy loading of domains").option("--wizard","Run interactive setup wizard").option("--auto","Auto-configure based on project analysis").option("-u, --upgrade","Upgrade existing installation (overwrite skills, agents, validation)").option("--minimal","Minimal configuration (skip optional features)").option("--skip-patterns","Skip loading pre-trained patterns").option("--skip-code-index","Skip code intelligence pre-scan (supported escape hatch \u2014 KG can be built later via `aqe code index`, also via env AQE_SKIP_CODE_INDEX=1)").option("--json","Emit machine-readable JSON result on stdout (suppresses banners; phase progress goes to stderr). Used by the release-gate corpus and CI tooling. See InitJsonOutput in init-handler.ts for the schema.").option("--with-n8n","Install n8n workflow testing agents and skills").option("--with-opencode","Include OpenCode agent/skill provisioning").option("--with-kiro","Include AWS Kiro IDE integration (agents, skills, hooks, steering)").option("--with-copilot","Include GitHub Copilot MCP config and instructions").option("--with-cursor","Include Cursor MCP config and rules").option("--with-cline","Include Cline MCP config and custom QE mode").option("--with-kilocode","Include Kilo Code MCP config and custom QE mode").option("--with-roocode","Include Roo Code MCP config and custom QE mode").option("--with-codex","Include OpenAI Codex CLI MCP config and AGENTS.md").option("--with-windsurf","Include Windsurf MCP config and rules").option("--with-continuedev","Include Continue.dev MCP config and rules").option("--no-mcp","Skip MCP server config (MCP is enabled by default)").option("--with-mcp","Enable MCP server config (default \u2014 kept for backward compatibility)").option("--with-all-platforms","Include all coding agent platform configurations").option("--auto-migrate","Automatically migrate from v2 if detected").option("--with-claude-flow","Force Claude Flow integration setup").option("--skip-claude-flow","Skip Claude Flow integration").option("--no-governance","Skip governance configuration (ADR-058)").option("--no-claude","Suppress the default Claude Code surface (.claude/, .mcp.json, CLAUDE.md, governance, hooks) so --with-<platform> flags are the only install targets (#532)").option("--modular","Use new modular init system (default for --auto)").action(async i=>{await this.execute(i,t)})}async execute(e,t){if(e.json===!0){this.originalStdoutWrite=process.stdout.write.bind(process.stdout);let i=process.stderr.write.bind(process.stderr);process.stdout.write=((...l)=>i(...l))}try{if(e.withAllPlatforms&&(e.withCopilot=!0,e.withCursor=!0,e.withCline=!0,e.withKilocode=!0,e.withRoocode=!0,e.withCodex=!0,e.withWindsurf=!0,e.withContinuedev=!0),e.upgrade&&!e.auto&&!e.wizard&&(e.auto=!0),e.wizard||e.auto){if(console.log(o.blue(`
|
|
3
3
|
Agentic QE v3 Initialization
|
|
4
4
|
`)),e.auto||e.modular){await this.runModularInit(e,t);return}await this.runLegacyWizard(e,t);return}let i=!!(e.withOpencode||e.withN8n||e.withKiro||e.withCopilot||e.withCursor||e.withCline||e.withKilocode||e.withRoocode||e.withCodex||e.withWindsurf||e.withContinuedev||e.withAllPlatforms),l=e.database===!1||e.memory==="memory",c=e.claude===!1;if(e.modular||i||l||c){console.log(o.blue(`
|
|
5
5
|
Agentic QE v3 Initialization
|
|
6
6
|
`)),await this.runModularInit(e,t);return}await this.runStandardInit(e,t)}catch(i){console.error(o.red(`
|
|
7
7
|
Failed to initialize:`),i),await this.cleanupAndExit(1)}}async runModularInit(e,t){let i=e.json===!0,l=e.database===!1||e.memory==="memory";l&&(process.env.AQE_MEMORY_BACKEND="memory",i||console.log(o.gray(` Database-free mode: in-memory backend (no .agentic-qe/memory.db)
|
|
8
8
|
`)));let c=e.claude===!1;c&&!(e.withOpencode||e.withN8n||e.withKiro||e.withCopilot||e.withCursor||e.withCline||e.withKilocode||e.withRoocode||e.withCodex||e.withWindsurf||e.withContinuedev||e.withAllPlatforms)&&!i&&console.log(o.yellow(` --no-claude set without any --with-<platform>: this install will write almost nothing.
|
|
9
|
-
`));let{createModularInitOrchestrator:r}=await import("./orchestrator-
|
|
9
|
+
`));let{createModularInitOrchestrator:r}=await import("./orchestrator-DKZWXDRI.js"),s=r({projectRoot:process.cwd(),autoMode:e.auto,upgrade:e.upgrade,minimal:e.minimal,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,withN8n:e.withN8n,withOpenCode:e.withOpencode,withKiro:e.withKiro,withCopilot:e.withCopilot,withCursor:e.withCursor,withCline:e.withCline,withKiloCode:e.withKilocode,withRooCode:e.withRoocode,withCodex:e.withCodex,withWindsurf:e.withWindsurf,withContinueDev:e.withContinuedev,noMcp:e.noMcp&&!e.withMcp,noGovernance:e.noGovernance,noClaude:c,memoryBackend:l?"memory":void 0});console.log(o.white(` Analyzing project...
|
|
10
10
|
`));let n=await s.initialize();if(i){this.originalStdoutWrite&&(process.stdout.write=this.originalStdoutWrite);let a={schemaVersion:1,success:n.success,steps:n.steps.map(m=>({step:m.step,status:m.status,message:m.message,durationMs:m.durationMs})),summary:n.summary,totalDurationMs:n.totalDurationMs,timestamp:n.timestamp.toISOString()};process.stdout.write(JSON.stringify(a,null,2)+`
|
|
11
|
-
`);let d=n.steps.some(m=>m.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let a of n.steps){let d=a.status==="success"?"*":a.status==="error"?"x":"!",m=a.status==="success"?o.green:a.status==="error"?o.red:o.yellow;console.log(m(` ${d} ${a.step} (${a.durationMs}ms)`))}console.log("");let u;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:a}=await import("./claude-flow-setup-
|
|
11
|
+
`);let d=n.steps.some(m=>m.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let a of n.steps){let d=a.status==="success"?"*":a.status==="error"?"x":"!",m=a.status==="success"?o.green:a.status==="error"?o.red:o.yellow;console.log(m(` ${d} ${a.step} (${a.durationMs}ms)`))}console.log("");let u;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:a}=await import("./claude-flow-setup-XPJPKHIO.js");if(u=await a({projectRoot:process.cwd(),force:e.withClaudeFlow}),u.available)console.log(o.green(" * Claude Flow integration enabled")),u.features.trajectories&&console.log(o.gray(" - SONA trajectory tracking")),u.features.modelRouting&&console.log(o.gray(" - 3-tier model routing (haiku/sonnet/opus)")),u.features.pretrain&&console.log(o.gray(" - Codebase pretrain analysis")),console.log("");else{let{getClaudeFlowNotFoundMessage:d}=await import("./detect-5WLQ2J3E.js");console.log(o.gray(d())),console.log("")}}catch{let{getClaudeFlowNotFoundMessage:a}=await import("./detect-5WLQ2J3E.js");console.log(o.gray(a())),console.log("")}n.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
12
12
|
`)),console.log(o.blue(" Summary:")),console.log(o.gray(` - Patterns loaded: ${n.summary.patternsLoaded}`)),console.log(o.gray(` - Skills installed: ${n.summary.skillsInstalled}`)),console.log(o.gray(` - Agents installed: ${n.summary.agentsInstalled}`)),console.log(o.gray(` - Hooks configured: ${n.summary.hooksConfigured?"Yes":"No"}`)),console.log(o.gray(` - Workers started: ${n.summary.workersStarted}`)),console.log(o.gray(` - Claude Flow: ${u?.available?"Enabled":"Standalone mode"}`)),console.log(o.gray(` - Total time: ${n.totalDurationMs}ms
|
|
13
13
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),n.summary.mcpConfigured&&(console.log(o.gray(`
|
|
14
14
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
15
15
|
`))),h()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
16
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:i}=await import("./init-wizard-
|
|
16
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:i}=await import("./init-wizard-AIOA5KOY.js"),l={projectRoot:process.cwd(),autoMode:e.auto,minimal:e.minimal,skipPatterns:e.skipPatterns,withN8n:e.withN8n},c=new i(l);if(e.wizard){console.log(o.white(` Setup Wizard Steps:
|
|
17
17
|
`));let s=c.getWizardSteps();for(let n=0;n<s.length;n++)console.log(o.gray(` ${n+1}. ${s[n].title}`)),console.log(o.gray(` ${s[n].description}
|
|
18
18
|
`))}console.log(o.white(` Analyzing project...
|
|
19
19
|
`));let r=await c.initialize();for(let s of r.steps){let n=s.status==="success"?"*":s.status==="error"?"x":"!",u=s.status==="success"?o.green:s.status==="error"?o.red:o.yellow;console.log(u(` ${n} ${s.step} (${s.durationMs}ms)`))}console.log(""),r.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
@@ -21,7 +21,7 @@ import{a as p}from"./chunk-REZ2GZQ3.js";import{a as w,c as y}from"./chunk-LGEZ3Z
|
|
|
21
21
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),r.summary.mcpConfigured&&(console.log(o.gray(`
|
|
22
22
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
23
23
|
`))),h()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
24
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:i}=await import("./kernel-
|
|
24
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:i}=await import("./kernel-SQALRU6Q.js"),{CrossDomainEventRouter:l}=await import("./cross-domain-router-LT3H4SNJ.js"),{DefaultProtocolExecutor:c}=await import("./protocol-executor-GT2MZYUU.js"),{WorkflowOrchestrator:r}=await import("./workflow-orchestrator-RKMMPXNA.js"),{createQueenCoordinator:s}=await import("./queen-coordinator-6RBHWCUG.js");console.log(o.blue(`
|
|
25
25
|
Initializing Agentic QE v3...
|
|
26
26
|
`));let n=e.domains==="all"?[...p]:e.domains.split(",").filter(d=>p.includes(d));console.log(o.gray(` Domains: ${n.length}`)),console.log(o.gray(` Max Agents: ${e.maxAgents}`)),console.log(o.gray(` Memory: ${e.memory}`)),console.log(o.gray(` Lazy Loading: ${e.lazy?"enabled":"disabled"}
|
|
27
27
|
`)),t.kernel=new i({maxConcurrentAgents:parseInt(e.maxAgents,10),memoryBackend:e.memory,hnswEnabled:!0,lazyLoading:e.lazy||!1,enabledDomains:n,enableExperienceBridge:!1}),await t.kernel.initialize(),console.log(o.green(" * Kernel initialized")),t.router=new l(t.kernel.eventBus),await t.router.initialize(),console.log(o.green(" * Cross-domain router initialized"));let u=d=>t.kernel.getDomainAPI(d),a=new c(t.kernel.eventBus,t.kernel.memory,u);console.log(o.green(" * Protocol executor initialized")),t.workflowOrchestrator=new r(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),this.registerDomainWorkflowActions(t.kernel,t.workflowOrchestrator),console.log(o.green(" * Workflow orchestrator initialized")),t.queen=s(t.kernel,t.router,a,void 0),await t.queen.initialize(),console.log(o.green(" * Queen Coordinator initialized")),t.initialized=!0,console.log(o.green(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.5");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-SK754ZSH.js";import"./chunk-4MHN7JWC.js";import"./chunk-37ZUF5NX.js";import"./chunk-4RTWPR3X.js";import"./chunk-O7J54OHN.js";import"./chunk-CKOF27L7.js";import"./chunk-RKXZLTWR.js";import"./chunk-FHTYEAQ3.js";import"./chunk-WHHQIL4F.js";import"./chunk-C4EZNOWK.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|