agentic-qe 3.9.33 → 3.9.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +104 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +7 -0
- package/dist/audit/witness-chain.js +9 -0
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-JUISYMI3.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-DUOP4SS6.js → agent-booster-wasm-4PJZ34PF.js} +2 -2
- package/dist/cli/chunks/{agent-handler-6AHMQ5OK.js → agent-handler-OB5JATVT.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-77WTL4KU.js → agent-memory-branch-ZEHRWZ5R.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-DEIUPULJ.js +2 -0
- package/dist/cli/chunks/{audit-ZRSUAGID.js → audit-PWFRSBBW.js} +2 -2
- package/dist/cli/chunks/base-7SMQWXHT.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-SDVX3I7F.js → better-sqlite3-XEIBI22V.js} +2 -2
- package/dist/cli/chunks/{brain-handler-EPNKL22C.js → brain-handler-6SMUCFO7.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-VVPWHTZ4.js → branch-enumerator-U6ROQR4O.js} +2 -2
- package/dist/cli/chunks/{browser-NNQ6UHFJ.js → browser-BMM57TA3.js} +2 -2
- package/dist/cli/chunks/browser-workflow-4DGHRZLS.js +2 -0
- package/dist/cli/chunks/{chunk-KQDWD34T.js → chunk-2FTSVPVG.js} +1 -1
- package/dist/cli/chunks/{chunk-JHFQJKTW.js → chunk-2ICMLI2T.js} +2 -2
- package/dist/cli/chunks/{chunk-IQ5OS342.js → chunk-2UY3X3KE.js} +9 -9
- package/dist/cli/chunks/{chunk-2NRCDJBB.js → chunk-3BDZSWCA.js} +2 -2
- package/dist/cli/chunks/{chunk-DLUEORKO.js → chunk-3R6YQEQY.js} +4 -4
- package/dist/cli/chunks/{chunk-TGMZ7K72.js → chunk-3UGY4ZQB.js} +1 -1
- package/dist/cli/chunks/{chunk-FRS4DYHG.js → chunk-3YIVRMQB.js} +1 -1
- package/dist/cli/chunks/{chunk-54B5QL4A.js → chunk-42QMNST6.js} +2 -2
- package/dist/cli/chunks/{chunk-4HJAUI2N.js → chunk-4HJVTKJD.js} +1 -1
- package/dist/cli/chunks/{chunk-LFPYLTNN.js → chunk-4NVDPO7L.js} +2 -2
- package/dist/cli/chunks/{chunk-LAPIIGZ2.js → chunk-4UZ7G2KT.js} +2 -2
- package/dist/cli/chunks/{chunk-4MRVNLCT.js → chunk-4YKHVRQH.js} +3 -3
- package/dist/cli/chunks/{chunk-JEGTTVTL.js → chunk-56O5V5MP.js} +2 -2
- package/dist/cli/chunks/{chunk-SR2EV7PQ.js → chunk-5CZDHJZX.js} +1 -1
- package/dist/cli/chunks/{chunk-VJHKNSOC.js → chunk-5Q7X5SDB.js} +2 -2
- package/dist/cli/chunks/{chunk-KF3R6OCB.js → chunk-5XXZQCHS.js} +1 -1
- package/dist/cli/chunks/{chunk-6DBS53L7.js → chunk-6CCKOU2U.js} +2 -2
- package/dist/cli/chunks/{chunk-KLTN2AVK.js → chunk-6SN55CMC.js} +2 -2
- package/dist/cli/chunks/{chunk-TIEXYJMS.js → chunk-6TYWIS4R.js} +2 -2
- package/dist/cli/chunks/{chunk-H5AQHFIA.js → chunk-6WZNRHJJ.js} +1 -1
- package/dist/cli/chunks/{chunk-LERCHSFI.js → chunk-72HXOVRN.js} +1 -1
- package/dist/cli/chunks/{chunk-JF4SWEMU.js → chunk-7RNLOYAP.js} +2 -2
- package/dist/cli/chunks/{chunk-C2XCETKV.js → chunk-A5LZVQQL.js} +3 -3
- package/dist/cli/chunks/chunk-A7QP5E46.js +2 -0
- package/dist/cli/chunks/{chunk-JMSQW6KN.js → chunk-AAVOYIKA.js} +1 -1
- package/dist/cli/chunks/chunk-ACL5JFJR.js +2 -0
- package/dist/cli/chunks/{chunk-CCSISDAP.js → chunk-BBHTM2RF.js} +1 -1
- package/dist/cli/chunks/chunk-BCD2IMXF.js +9 -0
- package/dist/cli/chunks/{chunk-LXWXZPEB.js → chunk-BEJAUYFA.js} +2 -2
- package/dist/cli/chunks/{chunk-GVO53VR5.js → chunk-BKF3E3UJ.js} +1 -1
- package/dist/cli/chunks/{chunk-ZUFM5K7F.js → chunk-BSM7YJBY.js} +1 -1
- package/dist/cli/chunks/{chunk-PIINM2PD.js → chunk-BTPDHALG.js} +2 -2
- package/dist/cli/chunks/{chunk-3J4TTZP7.js → chunk-BTQA2E2Y.js} +2 -2
- package/dist/cli/chunks/{chunk-23VQRQCC.js → chunk-BXBUUSJN.js} +3 -3
- package/dist/cli/chunks/{chunk-BLNISJ3M.js → chunk-C7QVMFCJ.js} +3 -3
- package/dist/cli/chunks/{chunk-GLA2TD4M.js → chunk-CMKNLC3Q.js} +4 -4
- package/dist/cli/chunks/{chunk-7HRE2VTG.js → chunk-CROIRPKG.js} +2 -2
- package/dist/cli/chunks/{chunk-MZ6GBVQY.js → chunk-CTU4V32J.js} +2 -2
- package/dist/cli/chunks/{chunk-L77OGJVK.js → chunk-D2ITP3ON.js} +2 -2
- package/dist/cli/chunks/{chunk-Q5JL7NZG.js → chunk-DEJW6GYF.js} +2 -2
- package/dist/cli/chunks/{chunk-LKEQBIX2.js → chunk-E7N6CRFV.js} +1 -1
- package/dist/cli/chunks/{chunk-IWBJ7KB7.js → chunk-F6R2TGNS.js} +2 -2
- package/dist/cli/chunks/{chunk-IXWIABRJ.js → chunk-FMAUTL26.js} +2 -2
- package/dist/cli/chunks/{chunk-7ZMRQKO2.js → chunk-FMV22K3J.js} +2 -2
- package/dist/cli/chunks/{chunk-AVQS5H7Y.js → chunk-FMZ7I4XV.js} +1 -1
- package/dist/cli/chunks/{chunk-LJBVPR3Z.js → chunk-FPPV7TYI.js} +2 -2
- package/dist/cli/chunks/{chunk-UBOH75WQ.js → chunk-FXITHMQB.js} +4 -4
- package/dist/cli/chunks/{chunk-EYCV6IYA.js → chunk-G6BJ5I57.js} +1 -1
- package/dist/cli/chunks/{chunk-WRPQJZSP.js → chunk-GHMIADYW.js} +2 -2
- package/dist/cli/chunks/{chunk-JGCTXHHZ.js → chunk-GQCIW2ZZ.js} +1 -1
- package/dist/cli/chunks/{chunk-B4N7XODV.js → chunk-GR732YA3.js} +2 -2
- package/dist/cli/chunks/{chunk-CG2IM6IA.js → chunk-GWROZUWK.js} +1 -1
- package/dist/cli/chunks/{chunk-JTXZ3MMZ.js → chunk-GWXP36YP.js} +2 -2
- package/dist/cli/chunks/{chunk-KGA5XCHX.js → chunk-H7V3ZQT7.js} +2 -2
- package/dist/cli/chunks/{chunk-MI5TV5HT.js → chunk-HAOGVFKR.js} +2 -2
- package/dist/cli/chunks/{chunk-BD6BS2AL.js → chunk-HGJGU625.js} +2 -2
- package/dist/cli/chunks/{chunk-GBMKXJKW.js → chunk-HKQ23RPJ.js} +5 -5
- package/dist/cli/chunks/{chunk-HCAWQ7ZD.js → chunk-HMIRBSTI.js} +2 -2
- package/dist/cli/chunks/{chunk-JJY6K3OI.js → chunk-HSR7EHVN.js} +1 -1
- package/dist/cli/chunks/{chunk-QCFJQZXN.js → chunk-I5XEXLBF.js} +1 -1
- package/dist/cli/chunks/{chunk-TNQW3FUW.js → chunk-I7XQT6YM.js} +2 -2
- package/dist/cli/chunks/{chunk-6TC6UCDL.js → chunk-ICYM7H6T.js} +2 -2
- package/dist/cli/chunks/{chunk-SFNSMZGU.js → chunk-II6DIMY6.js} +2 -2
- package/dist/cli/chunks/{chunk-OPC4ZVSN.js → chunk-INCNWH3R.js} +2 -2
- package/dist/cli/chunks/{chunk-YDIHYU7V.js → chunk-IQ363U37.js} +2 -2
- package/dist/cli/chunks/{chunk-46LV5MI3.js → chunk-IXOGBA7C.js} +13 -13
- package/dist/cli/chunks/{chunk-EVDEFUJG.js → chunk-J2LOP3GE.js} +2 -2
- package/dist/cli/chunks/{chunk-BIXDUMZ4.js → chunk-JNK742DP.js} +1 -1
- package/dist/cli/chunks/{chunk-473YM6LV.js → chunk-JW4N25B5.js} +2 -2
- package/dist/cli/chunks/{chunk-NCTSH4T6.js → chunk-KAEWFVGD.js} +2 -2
- package/dist/cli/chunks/{chunk-HVC3F4IM.js → chunk-M4BCSFVN.js} +1 -1
- package/dist/cli/chunks/{chunk-C5UGKQUG.js → chunk-M7TDNJMZ.js} +1 -1
- package/dist/cli/chunks/{chunk-QYIGUM3F.js → chunk-MHUPY3YO.js} +2 -2
- package/dist/cli/chunks/{chunk-GU5DISHT.js → chunk-MSEG7GKM.js} +1 -1
- package/dist/cli/chunks/chunk-NAVH552F.js +15 -0
- package/dist/cli/chunks/{chunk-F6WQ3ES6.js → chunk-NFIOKKA6.js} +2 -2
- package/dist/cli/chunks/{chunk-63SAZCUH.js → chunk-NJUNYXMH.js} +2 -2
- package/dist/cli/chunks/{chunk-N44DNZTM.js → chunk-NPUMPLL7.js} +1 -1
- package/dist/cli/chunks/{chunk-V7GV54AY.js → chunk-NS4P3VRA.js} +2 -2
- package/dist/cli/chunks/{chunk-IYDZ4NWA.js → chunk-NWWXVXXG.js} +2 -2
- package/dist/cli/chunks/{chunk-UDJLIERV.js → chunk-NZB2JE2D.js} +2 -2
- package/dist/cli/chunks/{chunk-5RILQ3EG.js → chunk-O3MTYRBX.js} +1 -1
- package/dist/cli/chunks/{chunk-ZGR5LFER.js → chunk-OJ5GBEXU.js} +2 -2
- package/dist/cli/chunks/{chunk-FQQJUIN7.js → chunk-OPD6AENV.js} +2 -2
- package/dist/cli/chunks/chunk-PHJK33IV.js +2 -0
- package/dist/cli/chunks/{chunk-24M7JF3G.js → chunk-PK3NAZQI.js} +2 -2
- package/dist/cli/chunks/{chunk-6S5H34AN.js → chunk-PY7PJT2Y.js} +2 -2
- package/dist/cli/chunks/{chunk-YCD3EBQJ.js → chunk-QOAVXGAU.js} +2 -2
- package/dist/cli/chunks/{chunk-FHSCCEHZ.js → chunk-RP5SDWCL.js} +22 -16
- package/dist/cli/chunks/{chunk-MFMPTRZW.js → chunk-RPRFDO23.js} +1 -1
- package/dist/cli/chunks/{chunk-AL54ARD4.js → chunk-RZDMSTAQ.js} +2 -2
- package/dist/cli/chunks/{chunk-GJKTHVFE.js → chunk-S3QU54ZQ.js} +1 -1
- package/dist/cli/chunks/{chunk-DEXOYNIQ.js → chunk-SBDRHY3I.js} +2 -2
- package/dist/cli/chunks/{chunk-NFFA2UKL.js → chunk-SI6VUQSI.js} +3 -3
- package/dist/cli/chunks/{chunk-RP2RRUKT.js → chunk-SMPMLODT.js} +1 -1
- package/dist/cli/chunks/{chunk-VVGXCLJF.js → chunk-SSJV4AZ7.js} +5 -5
- package/dist/cli/chunks/{chunk-HRE4TFMN.js → chunk-T26ENWX5.js} +8 -8
- package/dist/cli/chunks/{chunk-MAP6IAOP.js → chunk-T2QVCK56.js} +1 -1
- package/dist/cli/chunks/{chunk-NNFWNI6A.js → chunk-T4HZLBM4.js} +2 -2
- package/dist/cli/chunks/{chunk-FEJCPLXV.js → chunk-TE27EK44.js} +2 -2
- package/dist/cli/chunks/{chunk-U5L7FALK.js → chunk-TLBIFZM4.js} +2 -2
- package/dist/cli/chunks/{chunk-OXGZKXSI.js → chunk-UDKBQAAH.js} +2 -2
- package/dist/cli/chunks/{chunk-AGMHJ3GS.js → chunk-UJTI5MRE.js} +2 -2
- package/dist/cli/chunks/{chunk-3B5ZAFB2.js → chunk-UQ6JC3UY.js} +3 -3
- package/dist/cli/chunks/{chunk-K5YL3O22.js → chunk-VLZ3LC6L.js} +2 -2
- package/dist/cli/chunks/{chunk-MULV6D5J.js → chunk-VMMPOLUV.js} +2 -2
- package/dist/cli/chunks/{chunk-R3U7DSLA.js → chunk-WFVBK7N3.js} +2 -2
- package/dist/cli/chunks/{chunk-UYMA75Y4.js → chunk-WGWOCTQW.js} +1 -1
- package/dist/cli/chunks/{chunk-JPJURL4N.js → chunk-WSJN6HFR.js} +2 -2
- package/dist/cli/chunks/{chunk-KD2B54EH.js → chunk-WU3RGTLV.js} +1 -1
- package/dist/cli/chunks/{chunk-VSV6PV47.js → chunk-X27VMOIH.js} +1 -1
- package/dist/cli/chunks/{chunk-GY2G2YYH.js → chunk-X3GKTB6R.js} +1 -1
- package/dist/cli/chunks/{chunk-CAZQL4G2.js → chunk-XMCMLPXY.js} +2 -2
- package/dist/cli/chunks/{chunk-TLVEBQCX.js → chunk-XUZ73S3Y.js} +2 -2
- package/dist/cli/chunks/{chunk-VK7AXSAI.js → chunk-YBGQT3OS.js} +2 -2
- package/dist/cli/chunks/{chunk-BOHAND5J.js → chunk-YL56FMCJ.js} +1 -1
- package/dist/cli/chunks/{chunk-QSH4Y5E6.js → chunk-YLYKRAGZ.js} +2 -2
- package/dist/cli/chunks/{chunk-LYWA4OU6.js → chunk-YPJ2O3TE.js} +2 -2
- package/dist/cli/chunks/{chunk-HJETZJJO.js → chunk-YQRABKOC.js} +2 -2
- package/dist/cli/chunks/{chunk-LICFVB4C.js → chunk-YTB7DDLE.js} +1 -1
- package/dist/cli/chunks/{chunk-JYDWDNNZ.js → chunk-YYKZVBIG.js} +2 -2
- package/dist/cli/chunks/{chunk-TH2BBFJ6.js → chunk-Z6NUCGQA.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSDK26IP.js → chunk-ZAGCKWOC.js} +1 -1
- package/dist/cli/chunks/{ci-WZ4E35B6.js → ci-GXSOJB6I.js} +2 -2
- package/dist/cli/chunks/{ci-output-WMYWSAHI.js → ci-output-GNUGZD2F.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-4E4ZZ47P.js → circuit-breaker-LAW2AAHF.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-Q37FECGF.js → claude-flow-setup-VF5NUUJZ.js} +2 -2
- package/dist/cli/chunks/client-OSUT6W6W.js +2 -0
- package/dist/cli/chunks/{cline-installer-O7GPSWES.js → cline-installer-H7RPYI3G.js} +2 -2
- package/dist/cli/chunks/{code-AEIXP2UD.js → code-COHRPYF6.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-5RXCWE5W.js → code-index-extractor-353PWY6B.js} +2 -2
- package/dist/cli/chunks/{codex-installer-HDPSP2IN.js → codex-installer-DIXHDH63.js} +2 -2
- package/dist/cli/chunks/{completions-LYTPZCND.js → completions-NGPREB6E.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-WBRRBUIA.js → complexity-analyzer-BO3QCTWT.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-6KICDS72.js → continuedev-installer-SG4HUNX6.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-2YI4SWDH.js → copilot-installer-RC6ZFHQG.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-YEVYFYK5.js → cost-tracker-Q76KFISR.js} +2 -2
- package/dist/cli/chunks/{coverage-MO2TU62L.js → coverage-PT23ZOGU.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-X5EEGWMA.js +2 -0
- package/dist/cli/chunks/{cursor-installer-AO2JNN27.js → cursor-installer-ZDS65WC6.js} +2 -2
- package/dist/cli/chunks/{daemon-WCSJ3HS2.js → daemon-M32BWOES.js} +4 -4
- package/dist/cli/chunks/{daemon-6DWF4GAR.js → daemon-ZRDBUK4Q.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-NI6TAE7Y.js → dag-attention-scheduler-GUPZT7PR.js} +2 -2
- package/dist/cli/chunks/{detect-3MTKRZEI.js → detect-PZNLC2CO.js} +2 -2
- package/dist/cli/chunks/{dist-node-32YFXCS3.js → dist-node-QO5MMHVF.js} +2 -2
- package/dist/cli/chunks/{domain-handler-TFVVUKSC.js → domain-handler-OH2YSZCT.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-7HWX6PVA.js → domain-transfer-TVTK2YX5.js} +2 -2
- package/dist/cli/chunks/dream-CP4VOPNU.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-GGNDGEHX.js → embed-and-insert-pattern-2ARE7NCX.js} +2 -2
- package/dist/cli/chunks/{eval-T2KWZU2L.js → eval-64RXRKM4.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-JHQPDNVK.js → experience-capture-middleware-TH7JERGY.js} +3 -3
- package/dist/cli/chunks/{fast-paths-KJQ56NG6.js → fast-paths-IAWNSJFU.js} +2 -2
- package/dist/cli/chunks/{feature-flags-DJU7Z6UH.js → feature-flags-22FDDEFG.js} +2 -2
- package/dist/cli/chunks/{feature-flags-IPK5DUQM.js → feature-flags-TAKLIOWM.js} +2 -2
- package/dist/cli/chunks/{file-discovery-G5I7VV34.js → file-discovery-QWEHC5VO.js} +2 -2
- package/dist/cli/chunks/{fleet-BRKXQGTC.js → fleet-5PQX4H2Q.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-F44UEMIK.js → gnn-wrapper-RR5EYGCL.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-4EJQ3VWP.js → heartbeat-handler-QOVPD6JV.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-MX7EHYU5.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-B7FZYZGZ.js +2 -0
- package/dist/cli/chunks/hnsw-index-7OVB67MX.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-HVFM7LAR.js → hnsw-legacy-bridge-RRTRMCEL.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-QOENX3WX.js → hnswlib-node-XEOLAMMR.js} +2 -2
- package/dist/cli/chunks/{hooks-QFQSVB2C.js → hooks-DTEIDS42.js} +34 -34
- package/dist/cli/chunks/{hybrid-router-TZPIYG3I.js → hybrid-router-E36GZC7Q.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-HXG5GI27.js → hypergraph-engine-7VTF3N6A.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-R4LFFQ3Z.js → hypergraph-handler-CTUGX3DL.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-TG34YBHU.js +2 -0
- package/dist/cli/chunks/{init-handler-NJKVTURQ.js → init-handler-HRSUGKSE.js} +6 -6
- package/dist/cli/chunks/init-wizard-MS3A2X5C.js +2 -0
- package/dist/cli/chunks/kernel-J4IW4DA6.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-T6CMAQ6P.js → kilocode-installer-UGB5UY5B.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-IOAHUSWU.js → kiro-installer-7SAM5O2F.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-4LCYX5AN.js +2 -0
- package/dist/cli/chunks/{learning-2AH5KAFV.js → learning-GBRPEBXN.js} +3 -3
- package/dist/cli/chunks/{llm-router-I3YBDMC7.js → llm-router-YP2RW2QC.js} +4 -4
- package/dist/cli/chunks/{load-MTLOPMP4.js → load-3TRJPJBJ.js} +2 -2
- package/dist/cli/chunks/load-test-TFBVT7V3.js +2 -0
- package/dist/cli/chunks/{mcp-EEINX3NP.js → mcp-U7ZYZTEU.js} +2 -2
- package/dist/cli/chunks/{memory-OBDYP5P7.js → memory-CLBPDAAE.js} +5 -5
- package/dist/cli/chunks/memory-backend-E7OCG27P.js +2 -0
- package/dist/cli/chunks/{memory-handlers-TTMZ2JK6.js → memory-handlers-JEOU6AOR.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-OCANACFF.js → multi-model-executor-MPPD63KI.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-4PNJOOKX.js → opencode-installer-DIMXI5PK.js} +2 -2
- package/dist/cli/chunks/{orchestrator-DGIKNLST.js → orchestrator-YKOSNTFS.js} +5 -5
- package/dist/cli/chunks/{pipeline-4DZ3FRRT.js → pipeline-SDCM3CNA.js} +2 -2
- package/dist/cli/chunks/{platform-A27VETGX.js → platform-7UH4BXN7.js} +2 -2
- package/dist/cli/chunks/{plugin-SAIG2MCN.js → plugin-KIVAXJ3P.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-XBCJETFT.js → prime-radiant-advanced-wasm-PONLGWM6.js} +2 -2
- package/dist/cli/chunks/protocol-executor-MYFH7ZP4.js +2 -0
- package/dist/cli/chunks/{protocol-handler-NDOZLFK7.js → protocol-handler-6RYLLDOG.js} +2 -2
- package/dist/cli/chunks/{prove-XVUI5VJL.js → prove-PDFFRQQW.js} +2 -2
- package/dist/cli/chunks/{provider-manager-W6CZHTWY.js → provider-manager-I6R4EQGK.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-G46PVD2U.js +2 -0
- package/dist/cli/chunks/{quality-MRCQ7SDM.js → quality-KQVKAGWL.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-ZQRKBBUH.js +2 -0
- package/dist/cli/chunks/{real-embeddings-3NBKHQSF.js → real-embeddings-VQXMPAH6.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-FPWTSZG7.js → roocode-installer-RYPQ25JO.js} +2 -2
- package/dist/cli/chunks/router-UBQULTOO.js +2 -0
- package/dist/cli/chunks/routing-feedback-3VBS3SYD.js +2 -0
- package/dist/cli/chunks/{routing-handler-SYAT3QTK.js → routing-handler-U4FEWPIN.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-Y3JV2RC4.js → ruvector-commands-YID52EZ6.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-4IS5JKSA.js → rvf-dual-writer-HABBORJW.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-FPEUOS55.js → rvf-migration-adapter-JE5NWU3J.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-FR4NHRNG.js → rvf-migration-coordinator-FBIFWTAD.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-NDKSHCMG.js +2 -0
- package/dist/cli/chunks/safe-db-ZPGX4NYW.js +2 -0
- package/dist/cli/chunks/schedule-JZUKDE6O.js +2 -0
- package/dist/cli/chunks/scheduler-7YIQOOW3.js +2 -0
- package/dist/cli/chunks/{security-EPJBWOM2.js → security-22ERFMD6.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-YU7XN6ND.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-MSUS3ROX.js → shared-rvf-dual-writer-G5VIQHSN.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-4STSI5SJ.js +2 -0
- package/dist/cli/chunks/{status-handler-7T6ZWWSG.js → status-handler-5B3FP2DN.js} +2 -2
- package/dist/cli/chunks/{structural-health-IT5COKMM.js → structural-health-6YSKVKQG.js} +2 -2
- package/dist/cli/chunks/{sync-MVC5LKWT.js → sync-2YCW23XX.js} +2 -2
- package/dist/cli/chunks/{sync-CYTAJ62F.js → sync-OFSJUYBU.js} +2 -2
- package/dist/cli/chunks/{task-handler-R5T6DQ62.js → task-handler-6OIPFSXX.js} +2 -2
- package/dist/cli/chunks/{task-handlers-BQDACRA4.js → task-handlers-6QY5Q5IH.js} +3 -3
- package/dist/cli/chunks/{test-JQ6DNHJU.js → test-VR6EP23Y.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-47CCXYB3.js → test-scheduling-OI7N5QBA.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-THINRRHA.js → token-bootstrap-HZES3TAA.js} +2 -2
- package/dist/cli/chunks/{token-usage-AQOWJPTG.js → token-usage-2NSXSNS7.js} +2 -2
- package/dist/cli/chunks/{transformers-KRVEZU55.js → transformers-4U4PX5YQ.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-UDOTWN4W.js → tree-sitter-wasm-parser-NQ3JYKHC.js} +2 -2
- package/dist/cli/chunks/{types-YZSDKHGD.js → types-YGTXBQ4T.js} +2 -2
- package/dist/cli/chunks/unified-memory-R72C7IBY.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-A4LOFKDQ.js +2 -0
- package/dist/cli/chunks/unified-persistence-MYD2R4LE.js +2 -0
- package/dist/cli/chunks/{upgrade-UX6VHS4H.js → upgrade-GS4EJOHW.js} +2 -2
- package/dist/cli/chunks/{validate-SUS7IEZG.js → validate-4X7OETYQ.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-E2YE6GY2.js → validate-swarm-RSVPLHZQ.js} +2 -2
- package/dist/cli/chunks/{vibium-UZMTKRTE.js → vibium-SN2J4QEA.js} +2 -2
- package/dist/cli/chunks/visual-security-CUKQ5N37.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-XXU37FYS.js → web-tree-sitter-ZO6DPXRC.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-WRTVYD3Y.js → windsurf-installer-RGSOOJSH.js} +2 -2
- package/dist/cli/chunks/{witness-chain-6OSAEH67.js → witness-chain-7XBKRDAW.js} +2 -2
- package/dist/cli/chunks/witness-chain-S7ADS6TA.js +2 -0
- package/dist/cli/chunks/{workflow-7XKEQVKT.js → workflow-H7KG5R6L.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-3GIDXU43.js +2 -0
- package/dist/cli/chunks/{wrappers-2HDILUDI.js → wrappers-3YCDNHDG.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +12 -21
- package/dist/integrations/ruvector/rvf-dual-writer.d.ts +22 -0
- package/dist/integrations/ruvector/rvf-dual-writer.js +21 -0
- package/dist/integrations/ruvector/rvf-native-adapter.d.ts +18 -1
- package/dist/integrations/ruvector/rvf-native-adapter.js +15 -1
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +46 -1
- package/dist/integrations/ruvector/shared-rvf-adapter.js +137 -0
- package/dist/kernel/hybrid-backend.d.ts +14 -3
- package/dist/kernel/hybrid-backend.js +16 -3
- package/dist/kernel/unified-memory.d.ts +3 -1
- package/dist/kernel/unified-memory.js +28 -3
- package/dist/learning/dream/dream-scheduler.d.ts +18 -0
- package/dist/learning/dream/dream-scheduler.js +68 -0
- package/dist/learning/qe-reasoning-bank.js +19 -2
- package/dist/learning/sqlite-persistence.d.ts +11 -0
- package/dist/learning/sqlite-persistence.js +30 -0
- package/dist/mcp/bundle.js +352 -346
- package/package.json +6 -2
- package/dist/cli/chunks/adapter-PSHWPJGO.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-2WOSQ42V.js +0 -2
- package/dist/cli/chunks/base-QZ6CGEZG.js +0 -2
- package/dist/cli/chunks/browser-workflow-T74U33BJ.js +0 -2
- package/dist/cli/chunks/chunk-AE7P7VDM.js +0 -9
- package/dist/cli/chunks/chunk-LVCQ4LSA.js +0 -2
- package/dist/cli/chunks/chunk-MCONVCB6.js +0 -15
- package/dist/cli/chunks/chunk-ND33EKHX.js +0 -2
- package/dist/cli/chunks/chunk-SHAXRSWJ.js +0 -2
- package/dist/cli/chunks/client-3YW2WA67.js +0 -2
- package/dist/cli/chunks/cross-domain-router-2MAV2XPY.js +0 -2
- package/dist/cli/chunks/dream-4N3YBX36.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-5KZS7T6Q.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-A4XK3GZU.js +0 -2
- package/dist/cli/chunks/hnsw-index-TI7LZBWF.js +0 -2
- package/dist/cli/chunks/impact-analyzer-NQZBRTZH.js +0 -2
- package/dist/cli/chunks/init-wizard-UZR2AKQA.js +0 -2
- package/dist/cli/chunks/kernel-2HFKLNTS.js +0 -2
- package/dist/cli/chunks/knowledge-graph-GHICW2ZM.js +0 -2
- package/dist/cli/chunks/load-test-DUOZJLRA.js +0 -2
- package/dist/cli/chunks/memory-backend-AMPSDQR7.js +0 -2
- package/dist/cli/chunks/protocol-executor-4HZSMKVG.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-OGPCKVDP.js +0 -2
- package/dist/cli/chunks/queen-coordinator-ETWOFJGR.js +0 -2
- package/dist/cli/chunks/router-OMWLL5V3.js +0 -2
- package/dist/cli/chunks/routing-feedback-SULO56IE.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-PFMHXYDR.js +0 -2
- package/dist/cli/chunks/safe-db-V34EBOPG.js +0 -2
- package/dist/cli/chunks/schedule-WJALMS5B.js +0 -2
- package/dist/cli/chunks/scheduler-CBWMQLTY.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-KOZOSWBO.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-7RV55RNF.js +0 -2
- package/dist/cli/chunks/unified-memory-FHP2C2NF.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-MI27GSUL.js +0 -2
- package/dist/cli/chunks/unified-persistence-67RJXTNL.js +0 -2
- package/dist/cli/chunks/visual-security-JF6AGYOT.js +0 -2
- package/dist/cli/chunks/witness-chain-HNY2ED2G.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-OPUU4TNV.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import"./chunk-HSR7EHVN.js";function n(e){return e.includes("--version")||e.includes("-v")?"cli-version":e[2]==="health"?"cli-health":process.env.AQE_MCP==="1"||process.env.AQE_MCP_MODE==="1"?"mcp":process.env.AQE_HTTP_PORT?"http":"cli-full"}function o(e){return process.env.AQE_FAST_PATHS==="false"?!1:e.includes("--version")||e.includes("-v")}function r(e){return e[2]==="health"}export{n as detectBootMode,r as isHealthFastPath,o as isVersionFastPath};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q}from"./chunk-HGJGU625.js";import"./chunk-HSR7EHVN.js";q();export{a as DEFAULT_FEATURE_FLAGS,n as configureForCI,o as configureForDevelopment,p as configureForHeuristicMode,b as getVibiumFeatureFlags,m as initVibiumFeatureFlagsFromEnv,j as isAutoRetryEnabled,l as isAxeCoreEnabled,e as isBrowserModeEnabled,i as isDefaultHeadless,h as isE2EExecutionEnabled,f as isScreenshotCaptureEnabled,g as isVisualRegressionEnabled,d as resetVibiumFeatureFlags,c as setVibiumFeatureFlags,k as shouldLogPerformanceMetrics};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,S as R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,S as R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";R();export{a as DEFAULT_FEATURE_FLAGS,b as getRuVectorFeatureFlags,A as getRvfMigrationStage,Q as initFeatureFlagsFromEnv,y as isAgentMemoryBranchingEnabled,t as isCNNVisualRegressionEnabled,O as isCognitiveRoutingEnabled,v as isCoherenceActionGateEnabled,r as isCoherenceGateEnabled,H as isColdTierGNNEnabled,o as isCrossDomainTransferEnabled,C as isCusumDriftDetectionEnabled,u as isDAGAttentionEnabled,D as isDeltaEventSourcingEnabled,l as isDeterministicDitherEnabled,M as isEpropOnlineLearningEnabled,E as isEwcPlusPlusEnabled,f as isFlashAttentionEnabled,g as isGNNIndexEnabled,N as isGrangerCausalityEnabled,F as isGraphMAEEnabled,B as isHDCFingerprintingEnabled,p as isHnswHealthMonitorEnabled,G as isHopfieldMemoryEnabled,P as isHyperbolicHnswEnabled,I as isMetaLearningEnabled,k as isMetadataFilteringEnabled,i as isNativeHNSWEnabled,m as isNeuralRoutingEnabled,x as isRVFPatternStoreEnabled,w as isReasoningQECEnabled,q as isRegretTrackingEnabled,L as isReservoirReplayEnabled,e as isSONAEnabled,n as isSONAThreeLoopEnabled,K as isSpectralSparsificationEnabled,J as isSublinearSolverEnabled,j as isTemporalCompressionEnabled,z as isUnifiedHnswEnabled,s as isWitnessChainEnabled,d as resetRuVectorFeatureFlags,c as setRuVectorFeatureFlags,h as shouldLogMigrationMetrics};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,b}from"./chunk-G6BJ5I57.js";import"./chunk-HSR7EHVN.js";export{a as SOURCE_EXTENSIONS,b as walkSourceFiles};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as k,b as K,c as x,d as T,e as H,f as F,g as Q,j as _}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a as k,b as K,c as x,d as T,e as H,f as F,g as Q,j as _}from"./chunk-AAVOYIKA.js";import{a as v,b as V}from"./chunk-GWXP36YP.js";import{a as G}from"./chunk-FXITHMQB.js";import"./chunk-VLZ3LC6L.js";import"./chunk-ZAGCKWOC.js";import{c as C,d as S}from"./chunk-GQCIW2ZZ.js";import"./chunk-5XXZQCHS.js";import{v as q}from"./chunk-T26ENWX5.js";import"./chunk-YL56FMCJ.js";import"./chunk-3YIVRMQB.js";import"./chunk-M7TDNJMZ.js";import"./chunk-C7QVMFCJ.js";import"./chunk-WGWOCTQW.js";import"./chunk-WSJN6HFR.js";import{c as L}from"./chunk-NS4P3VRA.js";import{a as W}from"./chunk-F6R2TGNS.js";import{a as E}from"./chunk-JW4N25B5.js";import"./chunk-Z6NUCGQA.js";import"./chunk-ICYM7H6T.js";import{d as j}from"./chunk-BXBUUSJN.js";import"./chunk-4HJVTKJD.js";import"./chunk-YPJ2O3TE.js";import"./chunk-3UGY4ZQB.js";import"./chunk-GHMIADYW.js";import"./chunk-IQ363U37.js";import"./chunk-WU3RGTLV.js";import"./chunk-M4BCSFVN.js";import{b as N}from"./chunk-PY7PJT2Y.js";import"./chunk-OPD6AENV.js";import"./chunk-6TYWIS4R.js";import"./chunk-SI6VUQSI.js";import"./chunk-7RNLOYAP.js";import"./chunk-UQ6JC3UY.js";import"./chunk-HGJGU625.js";import"./chunk-CMKNLC3Q.js";import"./chunk-UDKBQAAH.js";import"./chunk-J2LOP3GE.js";import"./chunk-CTU4V32J.js";import"./chunk-NJUNYXMH.js";import"./chunk-A5LZVQQL.js";import"./chunk-T4HZLBM4.js";import"./chunk-2ICMLI2T.js";import"./chunk-INCNWH3R.js";import"./chunk-SSJV4AZ7.js";import"./chunk-3R6YQEQY.js";import"./chunk-5CZDHJZX.js";import"./chunk-XUZ73S3Y.js";import"./chunk-GWROZUWK.js";import"./chunk-X3GKTB6R.js";import"./chunk-NPUMPLL7.js";import"./chunk-A7QP5E46.js";import"./chunk-HKQ23RPJ.js";import"./chunk-VMMPOLUV.js";import"./chunk-BCD2IMXF.js";import"./chunk-NAVH552F.js";import"./chunk-PK3NAZQI.js";import"./chunk-RP5SDWCL.js";import"./chunk-YQRABKOC.js";import"./chunk-IXOGBA7C.js";import"./chunk-NFIOKKA6.js";import"./chunk-RZDMSTAQ.js";import"./chunk-ACL5JFJR.js";import"./chunk-4NVDPO7L.js";import"./chunk-PHJK33IV.js";import"./chunk-BTPDHALG.js";import{a as I}from"./chunk-6WZNRHJJ.js";import{a as B,c as ee}from"./chunk-DEJW6GYF.js";import"./chunk-E7N6CRFV.js";import"./chunk-56O5V5MP.js";import{a as z,b as te}from"./chunk-NZB2JE2D.js";import"./chunk-6SN55CMC.js";import"./chunk-FPPV7TYI.js";import{c as $,d as ne}from"./chunk-3BDZSWCA.js";import"./chunk-UJTI5MRE.js";import"./chunk-HMIRBSTI.js";import"./chunk-SBDRHY3I.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";ne();import{Command as ie}from"commander";import t from"chalk";ee();te();import h from"chalk";import{existsSync as oe}from"fs";import{join as P}from"path";var R=class{projectRoot;options;orchestrator;constructor(e){this.options=e,this.projectRoot=e.projectRoot}async checkCodeIntelligence(){if(this.options.skipCodeScan)return console.log(h.yellow(" Code intelligence scan skipped (--skip-code-scan flag)")),{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!1,scanRequested:!1},shouldProceed:!0,skipReason:"skip-flag"};if(await this.hasCodeIntelligenceIndex()){let i=await this.getKGEntryCount();return console.log(h.green(` \u2713 Code intelligence index found (${i} entries)`)),{codeIntelligence:{hasIndex:!0,entryCount:i,wasPrompted:!1,scanRequested:!1},shouldProceed:!0}}return!this.options.nonInteractive&&(console.log(h.yellow(`
|
|
3
3
|
\u26A0 No code intelligence index found`)),console.log(h.gray(" Building a knowledge graph improves agent accuracy by 80%")),console.log(h.gray(" This is a one-time operation and can be run later with:")),console.log(h.cyan(` aqe code-intelligence index
|
|
4
4
|
`)),await this.promptScan())?{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!0,scanRequested:!0},shouldProceed:!1,skipReason:"scan-requested"}:(console.log(h.gray(" Continuing without code intelligence index")),{codeIntelligence:{hasIndex:!1,entryCount:0,wasPrompted:!this.options.nonInteractive,scanRequested:!1},shouldProceed:!0})}async runCodeIntelligenceScan(){try{if(console.log(h.blue(`
|
|
5
|
-
Building code intelligence knowledge graph...`)),this.orchestrator||(this.orchestrator=new G({projectRoot:this.projectRoot,autoMode:!0,...this.options.initOptions})),await this.hasCodeIntelligenceIndex()){let s=await this.getKGEntryCount();return console.log(h.green(` \u2713 Index already exists (${s} entries)`)),{success:!0,entries:s}}let{KnowledgeGraphService:i}=await import("./knowledge-graph-
|
|
5
|
+
Building code intelligence knowledge graph...`)),this.orchestrator||(this.orchestrator=new G({projectRoot:this.projectRoot,autoMode:!0,...this.options.initOptions})),await this.hasCodeIntelligenceIndex()){let s=await this.getKGEntryCount();return console.log(h.green(` \u2713 Index already exists (${s} entries)`)),{success:!0,entries:s}}let{KnowledgeGraphService:i}=await import("./knowledge-graph-4LCYX5AN.js"),{InMemoryBackend:c}=await import("./memory-backend-E7OCG27P.js"),m=new c;await m.initialize();let n=new i(m,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0}),g=await(await import("fast-glob")).default(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:this.projectRoot,ignore:["node_modules/**","dist/**","coverage/**",".agentic-qe/**"]});console.log(h.gray(` Indexing ${g.length} files...`));let o=await n.index({paths:g.map(s=>P(this.projectRoot,s)),incremental:!1,includeTests:!0});if(n.destroy(),o.success){let s=o.value.nodesCreated+o.value.edgesCreated;return console.log(h.green(` \u2713 Indexed ${s} knowledge graph entries`)),{success:!0,entries:s}}return console.log(h.yellow(" \u26A0 Code intelligence scan completed with warnings")),{success:!1,entries:0}}catch(e){return console.error(h.red(" \u2717 Code intelligence scan failed:"),B(e)),{success:!1,entries:0}}}async getStatusForAgents(){let e=await this.hasCodeIntelligenceIndex(),i=e?await this.getKGEntryCount():0;return{codeIntelligenceAvailable:e,knowledgeGraphSize:i,recommendedCapabilities:e?["semantic-search","code-analysis","context-aware"]:["basic-analysis"]}}async hasCodeIntelligenceIndex(){let e=P(this.projectRoot,".agentic-qe","memory.db");if(!oe(e))return!1;try{let i=z(e),c=i.prepare(`
|
|
6
6
|
SELECT COUNT(*) as count FROM kv_store
|
|
7
7
|
WHERE namespace = 'code-intelligence:kg'
|
|
8
8
|
`).get();return i.close(),c.count>0}catch{return!1}}async getKGEntryCount(){let e=P(this.projectRoot,".agentic-qe","memory.db");try{let i=z(e),c=i.prepare(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p}from"./chunk-INCNWH3R.js";import"./chunk-RZDMSTAQ.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";export{e as GNNLayerFactory,c as QEGNNEmbeddingIndex,d as QEGNNIndexFactory,f as TensorCompressionFactory,p as batchDifferentiableSearch,i as getDifferentiableSearch,k as getGetCompressionLevel,j as getHierarchicalForward,l as getInit,g as getRuvectorLayer,h as getTensorCompress,b as initGNN,a as isGNNAvailable,m as toFloat32Array,o as toIEmbedding,n as toNumberArray};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{b as d}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{b as d}from"./chunk-BBHTM2RF.js";import{a as c,c as f}from"./chunk-DEJW6GYF.js";import"./chunk-HSR7EHVN.js";import*as s from"fs";import*as l from"path";import e from"chalk";f();var h=class{name="heartbeat";description="Manage the token-free heartbeat scheduler";cleanupAndExit;worker;constructor(t){this.cleanupAndExit=t}async getWorker(){if(!this.worker){let{HeartbeatSchedulerWorker:t}=await import("./heartbeat-scheduler-MX7EHYU5.js");this.worker=new t}return this.worker}register(t,o){let a=t.command("heartbeat").description(this.description);a.command("status").description("Show heartbeat worker status, health, and schedule").action(async()=>{await this.executeStatus()}),a.command("run-now").description("Trigger an immediate heartbeat cycle").option("-t, --timeout <ms>","Timeout in milliseconds (default: worker built-in 60s)").action(async n=>{let i=n.timeout?parseInt(n.timeout,10):void 0;await this.executeRunNow(i)}),a.command("history").description("Show recent heartbeat results").option("-n, --count <count>","Number of entries to show","10").action(async n=>{await this.executeHistory(parseInt(n.count,10)||10)}),a.command("log").description("Show today's daily log entries").option("-d, --date <date>","Show log for specific date (YYYY-MM-DD)").action(async n=>{await this.executeLog(n.date)}),a.command("pause").description("Pause the heartbeat worker").action(async()=>{await this.executePause()}),a.command("resume").description("Resume the heartbeat worker").action(async()=>{await this.executeResume()})}async executeStatus(){try{this.worker=await this.getWorker(),await this.worker.initialize();let t=this.worker.getHealth(),o=this.worker.lastResult;if(console.log(e.blue(`
|
|
3
3
|
Heartbeat Scheduler Status`)),console.log(e.gray(" "+"\u2500".repeat(35))),console.log(` Status: ${x(t.status)}`),console.log(` Health Score: ${y(t.healthScore)}${e.gray("/100")}`),this.worker.lastRunAt){let n=p(this.worker.lastRunAt);console.log(` Last Run: ${e.cyan(this.worker.lastRunAt.toISOString().replace("T"," ").slice(0,19))} ${e.gray(`(${n})`)}`)}else console.log(` Last Run: ${e.gray("never")}`);if(this.worker.nextRunAt){let n=p(this.worker.nextRunAt,!0);console.log(` Next Run: ${e.cyan(this.worker.nextRunAt.toISOString().replace("T"," ").slice(0,19))} ${e.gray(`(${n})`)}`)}console.log(` Total Runs: ${e.cyan(String(t.totalExecutions))}`);let a=t.totalExecutions>0?(t.successfulExecutions/t.totalExecutions*100).toFixed(1):"100.0";if(console.log(` Success Rate: ${e.cyan(a+"%")}`),o?.metrics?.domainMetrics){let n=o.metrics.domainMetrics;console.log(""),console.log(e.blue(" Last Result:")),console.log(` Promoted: ${e.cyan(String(n.promoted??0))} patterns`),console.log(` Deprecated: ${e.cyan(String(n.deprecated??0))} patterns`),console.log(` Decayed: ${e.cyan(String(n.decayed??0))} patterns`),console.log(` Pending Exp: ${e.cyan(String(n.pendingExperiences??0))}`),console.log(` Avg Conf: ${e.cyan(String(n.avgConfidence??0))}`)}console.log(""),await this.cleanupAndExit(0)}catch(t){console.error(e.red(`
|
|
4
4
|
Failed to get heartbeat status:`),c(t)),await this.cleanupAndExit(1)}}async executeRunNow(t){try{this.worker=await this.getWorker(),console.log(e.blue(`
|
|
5
5
|
Triggering heartbeat cycle...
|
|
@@ -8,7 +8,7 @@ import{b as d}from"./chunk-CCSISDAP.js";import{a as c,c as f}from"./chunk-Q5JL7N
|
|
|
8
8
|
Heartbeat History (last ${o.length})`)),console.log(e.gray(" "+"\u2500".repeat(60)));for(let a of o){let n=a.success?e.green("OK"):e.red("FAIL"),i=a.timestamp.slice(0,19).replace("T"," "),u=a.domainMetrics||{};console.log(` ${e.gray(i)} ${n} score:${e.cyan(String(a.healthScore))} +${u.promoted??0}/-${u.deprecated??0} ${e.gray(d(a.durationMs))}`)}console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(e.red(`
|
|
9
9
|
Failed to load history:`),c(o)),await this.cleanupAndExit(1)}}async executeLog(t){try{let o=t||new Date().toISOString().split("T")[0];if(!/^\d{4}-\d{2}-\d{2}$/.test(o)){console.error(e.red(`
|
|
10
10
|
Invalid date format: "${o}". Use YYYY-MM-DD.
|
|
11
|
-
`)),await this.cleanupAndExit(1);return}let{findProjectRoot:a}=await import("./unified-memory-
|
|
11
|
+
`)),await this.cleanupAndExit(1);return}let{findProjectRoot:a}=await import("./unified-memory-R72C7IBY.js"),n=l.join(a(),".agentic-qe","logs"),i=l.join(n,`${o}.md`);if(!s.existsSync(i)){console.log(e.yellow(`
|
|
12
12
|
No daily log found for ${o}.
|
|
13
13
|
`)),await this.cleanupAndExit(0);return}let u=s.readFileSync(i,"utf-8");console.log(e.blue(`
|
|
14
14
|
Daily Log \u2014 ${o}`)),console.log(e.gray(" "+"\u2500".repeat(40)));for(let g of u.split(`
|
|
@@ -45,4 +45,4 @@ Examples:
|
|
|
45
45
|
aqe heartbeat log --date 2026-03-25
|
|
46
46
|
aqe heartbeat pause
|
|
47
47
|
aqe heartbeat resume
|
|
48
|
-
`}},m=100;async function w(){let{findProjectRoot:r}=await import("./unified-memory-
|
|
48
|
+
`}},m=100;async function w(){let{findProjectRoot:r}=await import("./unified-memory-R72C7IBY.js");return l.join(r(),".agentic-qe","heartbeat-history.json")}async function b(r){try{let t=await w(),o=l.dirname(t);s.existsSync(o)||s.mkdirSync(o,{recursive:!0});let a=[];if(s.existsSync(t))try{a=JSON.parse(s.readFileSync(t,"utf-8"))}catch{a=[]}a.unshift({timestamp:r.timestamp.toISOString(),success:r.success,durationMs:r.durationMs,healthScore:r.metrics.healthScore,domainMetrics:r.metrics.domainMetrics}),a.length>m&&(a=a.slice(0,m)),s.writeFileSync(t,JSON.stringify(a,null,2))}catch{}}async function S(r){try{let t=await w();return s.existsSync(t)?JSON.parse(s.readFileSync(t,"utf-8")).slice(0,r):[]}catch{return[]}}function x(r){switch(r){case"idle":return e.cyan(r);case"running":return e.yellow(r);case"paused":return e.yellow(r);case"stopped":return e.gray(r);case"error":return e.red(r);default:return e.white(r)}}function y(r){return r>=80?e.green(String(r)):r>=50?e.yellow(String(r)):e.red(String(r))}function k(r){switch(r){case"improving":return e.green(r);case"stable":return e.cyan(r);case"degrading":return e.red(r);default:return e.gray(r)}}function p(r,t=!1){let o=t?r.getTime()-Date.now():Date.now()-r.getTime();return o<0?t?"now":"just now":o<6e4?`${Math.floor(o/1e3)}s ${t?"from now":"ago"}`:o<36e5?`${Math.floor(o/6e4)}m ${t?"from now":"ago"}`:`${Math.floor(o/36e5)}h ${t?"from now":"ago"}`}function A(r){return new h(r)}export{h as HeartbeatHandler,A as createHeartbeatHandler};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{b as a}from"./chunk-BTQA2E2Y.js";import"./chunk-D2ITP3ON.js";import"./chunk-MSEG7GKM.js";import"./chunk-NPUMPLL7.js";import"./chunk-IXOGBA7C.js";import"./chunk-NFIOKKA6.js";import"./chunk-RZDMSTAQ.js";import"./chunk-PHJK33IV.js";import"./chunk-BTPDHALG.js";import"./chunk-DEJW6GYF.js";import"./chunk-NZB2JE2D.js";import"./chunk-6SN55CMC.js";import"./chunk-FPPV7TYI.js";import"./chunk-3BDZSWCA.js";import"./chunk-UJTI5MRE.js";import"./chunk-HMIRBSTI.js";import"./chunk-SBDRHY3I.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";export{a as HeartbeatSchedulerWorker};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,c as b}from"./chunk-SBDRHY3I.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";b();export{a as HnswAdapter};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-4NVDPO7L.js";import"./chunk-PHJK33IV.js";import"./chunk-BTPDHALG.js";import"./chunk-3BDZSWCA.js";import"./chunk-SBDRHY3I.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";export{a as DEFAULT_HNSW_CONFIG,b as HNSWIndex,d as benchmarkHNSW,c as createHNSWIndex};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import"./chunk-HSR7EHVN.js";var s=class{adapter;metadataMap=new Map;insertCount=0;constructor(e){this.adapter=e}async initialize(){}async insert(e,t,r){this.adapter.addByStringId(e,t),this.insertCount++,r&&this.metadataMap.set(e,r)}async search(e,t){return this.adapter.searchByArray(e,t).map(a=>({key:a.id,score:a.score,distance:1-a.score,metadata:this.metadataMap.get(a.id)}))}async batchInsert(e){for(let t of e)await this.insert(t.key,t.vector,t.metadata)}async delete(e){let t=this.adapter.removeByStringId(e);return t&&this.metadataMap.delete(e),t}async getStats(){return{nativeHNSW:!0,backendType:"ruvector-gnn",vectorCount:this.adapter.size(),indexSizeBytes:this.adapter.size()*this.adapter.dimensions()*4,avgSearchLatencyMs:this.adapter.lastSearchLatencyMs,p95SearchLatencyMs:0,p99SearchLatencyMs:0,searchOperations:0,insertOperations:this.insertCount}}async clear(){this.adapter.clear(),this.metadataMap.clear(),this.insertCount=0}isNativeAvailable(){return!0}};export{s as HnswLegacyBridge};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.35");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-FMAUTL26.js";import"./chunk-HSR7EHVN.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
|
|
@@ -1,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.9.
|
|
3
|
-
import{a as z}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.9.35");process.exit(0)}
|
|
3
|
+
import{a as z}from"./chunk-O3MTYRBX.js";import{a as R,b as re,c as ae}from"./chunk-C7QVMFCJ.js";import{a as oe,b as se}from"./chunk-T4HZLBM4.js";import{d as ne,h as G}from"./chunk-SSJV4AZ7.js";import"./chunk-3R6YQEQY.js";import"./chunk-5CZDHJZX.js";import"./chunk-XUZ73S3Y.js";import"./chunk-GWROZUWK.js";import"./chunk-X3GKTB6R.js";import"./chunk-NPUMPLL7.js";import"./chunk-A7QP5E46.js";import"./chunk-HKQ23RPJ.js";import{a as ee}from"./chunk-NAVH552F.js";import{a as te}from"./chunk-RP5SDWCL.js";import"./chunk-YQRABKOC.js";import{f as T,k as q,o as C}from"./chunk-IXOGBA7C.js";import"./chunk-NFIOKKA6.js";import{b as X,d as he}from"./chunk-RZDMSTAQ.js";import"./chunk-ACL5JFJR.js";import"./chunk-PHJK33IV.js";import"./chunk-BTPDHALG.js";import"./chunk-6WZNRHJJ.js";import"./chunk-DEJW6GYF.js";import"./chunk-E7N6CRFV.js";import"./chunk-NZB2JE2D.js";import"./chunk-6SN55CMC.js";import"./chunk-FPPV7TYI.js";import"./chunk-3BDZSWCA.js";import"./chunk-UJTI5MRE.js";import"./chunk-HMIRBSTI.js";import"./chunk-SBDRHY3I.js";import"./chunk-CROIRPKG.js";import"./chunk-5Q7X5SDB.js";import"./chunk-HSR7EHVN.js";import{Command as Ce}from"commander";import O from"chalk";import ie from"node:path";C();import{randomUUID as M}from"crypto";import j from"chalk";var L="dream-scheduler:hook-state";async function A(o){try{let e=await o.get(L);return e||(e={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0}),e.experienceCount++,await o.set(L,e),e.experienceCount}catch{return 0}}async function B(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-R72C7IBY.js"),t=e();t.isInitialized()||await t.initialize();let{initializeExperienceCapture:n}=await import("./experience-capture-middleware-TH7JERGY.js");await n();let s=t.getDatabase();try{s.pragma("busy_timeout = 60000")}catch{}let r=`cli-${Date.now()}-${M().slice(0,8)}`,a=o.durationMs||0,c;if(o.success){let i=a>0&&a<5e3?.1:0,y=o.source.includes("post-task")?.1:o.source.includes("post-edit")?.05:0;c=Math.min(.95,.7+i+y)}else{let i=o.source.includes("post-task")?.15:o.source.includes("post-edit")?.1:0;c=Math.min(.6,.3+i)}s.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(r,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(r,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-VQXMPAH6.js"),y=`${o.domain}: ${o.task}`.slice(0,512),d=await i(y);s.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(d).buffer),d.length,r)}catch{}})()}catch(e){console.error(j.dim(`[hooks] persistCommandExperience: ${e instanceof Error?e.message:"unknown"}`))}}async function V(o){let{getUnifiedMemory:e}=await import("./unified-memory-R72C7IBY.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}let s=`exp-${Date.now()}-${M().slice(0,8)}`,r=`${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,y=.25*c+.325+.1*i,d=null,l=0,m=0,p=n.transaction(()=>{n.prepare(`
|
|
9
9
|
INSERT INTO captured_experiences
|
|
10
10
|
(id, task, agent, domain, success, quality, duration_ms,
|
|
11
11
|
model_tier, started_at, completed_at, source)
|
|
@@ -14,13 +14,13 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
14
14
|
INSERT INTO experience_applications
|
|
15
15
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
16
16
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
17
|
-
`).run(`app-${Date.now()}-${M().slice(0,8)}`,s,r,o.success?1:0,Math.round(y*100),`[Patch 060] post-task outcome: ${o.success?"success":"failure"}`);try{let
|
|
17
|
+
`).run(`app-${Date.now()}-${M().slice(0,8)}`,s,r,o.success?1:0,Math.round(y*100),`[Patch 060] post-task outcome: ${o.success?"success":"failure"}`);try{let u=n.prepare(`
|
|
18
18
|
SELECT key, value FROM kv_store
|
|
19
19
|
WHERE namespace = 'task-bridge'
|
|
20
20
|
AND (expires_at IS NULL OR expires_at > strftime('%s','now') * 1000)
|
|
21
21
|
ORDER BY created_at DESC
|
|
22
22
|
LIMIT 1
|
|
23
|
-
`).get();if(
|
|
23
|
+
`).get();if(u?.value)try{d=JSON.parse(u.value)}catch{d=null}if(d&&Array.isArray(d.selectedPatternIds)&&d.selectedPatternIds.length>0){let S=d.estimatedTokenSavings&&d.selectedPatternIds.length?Math.round(d.estimatedTokenSavings/d.selectedPatternIds.length):0,x=n.prepare(`
|
|
24
24
|
INSERT INTO experience_applications
|
|
25
25
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
26
26
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
@@ -36,20 +36,20 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
36
36
|
AND successful_uses >= 3
|
|
37
37
|
AND success_rate >= 0.7
|
|
38
38
|
AND confidence >= 0.6
|
|
39
|
-
`);for(let w of d.selectedPatternIds){x.run(`app-${Date.now()}-${M().slice(0,8)}`,s,`${r}:pattern:${w}`,o.success?1:0,S,`[Patch 160+300] task-bridge pattern_id=${w} ts=${S}`);try{te(n,{patternId:w,success:o.success,metrics:{tokens_saved:S,source:"cli-hook-post-task",experience_id:s},feedback:`[Patch 160+300] task-bridge pattern_id=${w} ts=${S}`})}catch{}try{let P=H.get(w);P?.tier==="short-term"&&P.successful_uses>=3&&P.success_rate>=.7&&P.confidence>=.6&&J.run(w)}catch{}}
|
|
39
|
+
`);for(let w of d.selectedPatternIds){x.run(`app-${Date.now()}-${M().slice(0,8)}`,s,`${r}:pattern:${w}`,o.success?1:0,S,`[Patch 160+300] task-bridge pattern_id=${w} ts=${S}`);try{te(n,{patternId:w,success:o.success,metrics:{tokens_saved:S,source:"cli-hook-post-task",experience_id:s},feedback:`[Patch 160+300] task-bridge pattern_id=${w} ts=${S}`})}catch{}try{let P=H.get(w);P?.tier==="short-term"&&P.successful_uses>=3&&P.success_rate>=.7&&P.confidence>=.6&&J.run(w)}catch{}}u&&n.prepare("DELETE FROM kv_store WHERE namespace='task-bridge' AND key = ?").run(u.key)}}catch(u){console.error(j.dim(`[hooks] post-task bridge: ${u instanceof Error?u.message:"unknown"}`))}let h=`traj-${Date.now()}-${M().slice(0,8)}`;n.prepare(`
|
|
40
40
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
41
41
|
VALUES (?, ?, ?, ?, datetime('now'), datetime('now'), ?, ?)
|
|
42
|
-
`).run(h,r,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]));try{let
|
|
42
|
+
`).run(h,r,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]));try{let u=n.prepare(`
|
|
43
43
|
SELECT id, task, agent, success, started_at, completed_at
|
|
44
44
|
FROM captured_experiences
|
|
45
45
|
WHERE consolidated_into IS NULL
|
|
46
46
|
AND task LIKE ?
|
|
47
47
|
AND started_at > datetime('now', '-1 hour')
|
|
48
48
|
ORDER BY started_at ASC
|
|
49
|
-
`).all(`%:${o.taskId}`);if(
|
|
49
|
+
`).all(`%:${o.taskId}`);if(u.length>=2){let S=`traj-multi-${Date.now()}-${M().slice(0,8)}`,x=JSON.stringify(u.map((w,P)=>({step:P+1,task:w.task,agent:w.agent,success:!!w.success,started_at:w.started_at,completed_at:w.completed_at}))),H=u.every(w=>!!w.success);n.prepare(`
|
|
50
50
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
51
51
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
52
|
-
`).run(S,`multi:${o.taskId}`,o.agent,o.domain??"general",
|
|
52
|
+
`).run(S,`multi:${o.taskId}`,o.agent,o.domain??"general",u[0].started_at,u[u.length-1].completed_at,H?1:0,x);let J=u.map(()=>"?").join(",");n.prepare(`UPDATE captured_experiences SET consolidated_into = ? WHERE id IN (${J})`).run(S,...u.map(w=>w.id)),l=u.length}}catch(u){console.error(j.dim(`[hooks] post-task stitch: ${u instanceof Error?u.message:"unknown"}`))}if(o.success)try{m=n.prepare(`
|
|
53
53
|
UPDATE dream_insights
|
|
54
54
|
SET applied = COALESCE(applied, 0) + 1
|
|
55
55
|
WHERE id IN (
|
|
@@ -58,11 +58,11 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
58
58
|
ORDER BY created_at DESC
|
|
59
59
|
LIMIT 3
|
|
60
60
|
)
|
|
61
|
-
`).run().changes??0}catch{}});try{p()}catch(h){console.error(j.dim(`[hooks] persistTaskOutcome txn: ${h instanceof Error?h.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:h}=await import("./real-embeddings-
|
|
61
|
+
`).run().changes??0}catch{}});try{p()}catch(h){console.error(j.dim(`[hooks] persistTaskOutcome txn: ${h instanceof Error?h.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:h}=await import("./real-embeddings-VQXMPAH6.js"),u=`${o.domain??"general"}: ${r}`.slice(0,512),S=await h(u);n.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(S).buffer),S.length,s)}catch{}})(),{experienceId:s,qualityScore:y,bridge:d,stitchedSiblings:l,insightsApplied:m}}async function K(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-R72C7IBY.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}let s=`${o.taskType}|${o.priority}|${o.domain||"any"}|${o.complexityBucket}`,r=o.agent,a=`q-learning:aqe-hook-router:${s}:${r}`,c=o.success?.1:-1,i=.1,y=.9,d=n.prepare(`
|
|
62
62
|
SELECT q_value FROM rl_q_values WHERE id = ?
|
|
63
|
-
`).get(a),
|
|
63
|
+
`).get(a),l=d&&typeof d.q_value=="number"?d.q_value:0,m=n.prepare(`
|
|
64
64
|
SELECT MAX(q_value) AS m FROM rl_q_values WHERE state_key = ?
|
|
65
|
-
`).get(s),p=m&&typeof m.m=="number"?m.m:0,h=
|
|
65
|
+
`).get(s),p=m&&typeof m.m=="number"?m.m:0,h=l+i*(c+y*p-l);n.prepare(`
|
|
66
66
|
INSERT INTO rl_q_values
|
|
67
67
|
(id, algorithm, agent_id, state_key, action_key, q_value, visits, last_reward, domain, created_at, updated_at)
|
|
68
68
|
VALUES (?, 'q-learning', 'aqe-hook-router', ?, ?, ?, 1, ?, ?, datetime('now'), datetime('now'))
|
|
@@ -71,7 +71,7 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
71
71
|
visits = visits + 1,
|
|
72
72
|
last_reward = excluded.last_reward,
|
|
73
73
|
updated_at = datetime('now')
|
|
74
|
-
`).run(a,s,r,h,c,o.domain||"any")}catch(e){console.error(j.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function Y(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-
|
|
74
|
+
`).run(a,s,r,h,c,o.domain||"any")}catch(e){console.error(j.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function Y(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-R72C7IBY.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}n.prepare(`
|
|
75
75
|
UPDATE routing_outcomes
|
|
76
76
|
SET success = ?, quality_score = ?, duration_ms = ?
|
|
77
77
|
WHERE id IN (
|
|
@@ -82,7 +82,7 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
82
82
|
ORDER BY (CASE WHEN used_agent = ? THEN 0 ELSE 1 END), created_at DESC
|
|
83
83
|
LIMIT 1
|
|
84
84
|
)
|
|
85
|
-
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(j.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function Z(){let{getUnifiedMemory:o}=await import("./unified-memory-
|
|
85
|
+
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(j.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function Z(){let{getUnifiedMemory:o}=await import("./unified-memory-R72C7IBY.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)),s=[["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,y]of s)n.has(i)||t.exec(`ALTER TABLE captured_experiences ADD COLUMN ${i} ${y}`);let r=t.prepare(`
|
|
86
86
|
SELECT
|
|
87
87
|
domain,
|
|
88
88
|
agent,
|
|
@@ -98,11 +98,11 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
98
98
|
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
99
99
|
ORDER BY avg_quality DESC
|
|
100
100
|
LIMIT 50
|
|
101
|
-
`).all();if(r.length===0)return 0;let{v4:a}=await import("./dist-node-
|
|
101
|
+
`).all();if(r.length===0)return 0;let{v4:a}=await import("./dist-node-QO5MMHVF.js"),c=0;for(let i of r)try{let y=new Date().toISOString().slice(0,7),d=`${i.agent}-${i.domain}-${y}`,l=t.prepare(`
|
|
102
102
|
SELECT id FROM qe_patterns
|
|
103
103
|
WHERE qe_domain = ? AND name = ?
|
|
104
104
|
LIMIT 1
|
|
105
|
-
`).get(i.domain,d);if(
|
|
105
|
+
`).get(i.domain,d);if(l)t.prepare(`
|
|
106
106
|
UPDATE qe_patterns
|
|
107
107
|
SET usage_count = usage_count + ?,
|
|
108
108
|
successful_uses = successful_uses + ?,
|
|
@@ -110,33 +110,33 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
110
110
|
quality_score = MIN(0.99, quality_score + 0.005),
|
|
111
111
|
updated_at = datetime('now')
|
|
112
112
|
WHERE id = ?
|
|
113
|
-
`).run(i.cnt,i.successes,
|
|
113
|
+
`).run(i.cnt,i.successes,l.id);else{let m=a(),p=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),h=p*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5,u=`Auto-consolidated from ${i.cnt} experiences. Agent: ${i.agent}, success rate: ${(i.success_rate*100).toFixed(0)}%`,S=(i.sources||"").split(",").filter(Boolean);t.prepare(`
|
|
114
114
|
INSERT INTO qe_patterns (
|
|
115
115
|
id, pattern_type, qe_domain, domain, name, description,
|
|
116
116
|
confidence, usage_count, success_rate, quality_score, tier,
|
|
117
117
|
template_json, context_json, created_at, successful_uses
|
|
118
118
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
119
|
-
`).run(m,"workflow",i.domain,i.domain,d,
|
|
119
|
+
`).run(m,"workflow",i.domain,i.domain,d,u,p,i.cnt,i.success_rate,h,"short-term",JSON.stringify({type:"workflow",content:`${i.agent} pattern for ${i.domain}`,variables:[]}),JSON.stringify({tags:S,sourceType:"session-consolidation",extractedAt:new Date().toISOString()}),i.successes);let{ensurePatternEmbedding:x}=await import("./embed-and-insert-pattern-2ARE7NCX.js");await x(t,m,d,u,S),c++}t.prepare(`
|
|
120
120
|
UPDATE captured_experiences
|
|
121
121
|
SET application_count = application_count + 1
|
|
122
122
|
WHERE domain = ? AND agent = ? AND application_count = 0
|
|
123
|
-
`).run(i.domain,i.agent)}catch{}return c}var g={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function E(){if(g.initializationPromise&&await g.initializationPromise,g.initialized&&g.reasoningBank&&g.hookRegistry)return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry};if(g.initializationPromise=Ee(),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 Ee(){if(!g.initialized)try{let o=T(),e=ie.join(o,".agentic-qe"),t=await v(e);try{g.coherenceService=await oe(se),console.log(O.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log(O.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}g.reasoningBank=G(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},g.coherenceService??void 0);let n=1e4,s=new AbortController,r=setTimeout(()=>s.abort(new Error("ReasoningBank init timeout")),n);try{await g.reasoningBank.initialize({signal:s.signal})}finally{clearTimeout(r)}try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-
|
|
123
|
+
`).run(i.domain,i.agent)}catch{}return c}var g={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function E(){if(g.initializationPromise&&await g.initializationPromise,g.initialized&&g.reasoningBank&&g.hookRegistry)return{reasoningBank:g.reasoningBank,hookRegistry:g.hookRegistry};if(g.initializationPromise=Ee(),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 Ee(){if(!g.initialized)try{let o=T(),e=ie.join(o,".agentic-qe"),t=await v(e);try{g.coherenceService=await oe(se),console.log(O.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log(O.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}g.reasoningBank=G(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},g.coherenceService??void 0);let n=1e4,s=new AbortController,r=setTimeout(()=>s.abort(new Error("ReasoningBank init timeout")),n);try{await g.reasoningBank.initialize({signal:s.signal})}finally{clearTimeout(r)}try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-G5VIQHSN.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=ae(g.reasoningBank),g.initialized=!0,console.log(O.dim("[hooks] System initialized"))}catch(o){console.warn(O.yellow(`[hooks] Using fallback mode: ${o instanceof Error?o.message:"unknown error"}`));let e=Se();g.reasoningBank=G(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0}),g.hookRegistry=new re,g.hookRegistry.initialize(g.reasoningBank),g.initialized=!0}}function N(o){try{o.pragma("busy_timeout = 60000")}catch{}}async function v(o){let t=new ee({sqlite:{path:ie.join(o,"memory.db"),walMode:!0,poolSize:3,busyTimeout:6e4},enableFallback:!0,defaultNamespace:"qe-patterns"}),n=new AbortController,s=setTimeout(()=>n.abort(new Error("Backend init timeout")),5e3);try{await t.initialize({signal:n.signal})}finally{clearTimeout(s)}return t}function Se(){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,"\\$&"),s=new RegExp(n.replace(/\*/g,".*"));return Array.from(o.keys()).filter(r=>s.test(r))},vectorSearch:async(e,t)=>[],storeVector:async(e,t,n)=>{},count:async e=>{let t=0,n=`${e}:`;for(let s of o.keys())s.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 $(o){console.log(O.green("\u2713"),o)}function _(o){console.error(O.red("\u2717"),o)}function W(o){if(o.length===0){console.log(O.dim(" No specific guidance"));return}o.forEach((e,t)=>{console.log(O.cyan(` ${t+1}.`),e)})}async function Q(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",s=>{t+=s}),process.stdin.on("end",()=>{clearTimeout(n),e(t)}),process.stdin.on("error",()=>{clearTimeout(n),e(t)}),process.stdin.resume()})}function ce(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return""}let t=e.tool_input,n=e.toolInput,s=[t?.file_path,t?.filePath,n?.file_path,n?.filePath,e.file_path,e.filePath];for(let r of s)if(typeof r=="string"&&r.trim())return r;return""}import I from"chalk";import we from"node:path";C();function de(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 E(),s=(await t.emit(R.PreTestGeneration,{targetFile:e.file,testType:"unit",operation:e.operation}))[0]||{success:!0,guidance:[],routing:null};if(e.json){let r=s.guidance||[],c=[s.routing?.recommendedAgent?`Recommended agent: ${s.routing.recommendedAgent} (${(s.routing.confidence*100).toFixed(0)}% confidence).`:"",...r.map(i=>i)].filter(Boolean).join(" ");f({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:c||void 0},file:e.file,operation:e.operation,patterns:s.routing?.patterns?.length||0})}else console.log(I.bold(`
|
|
124
124
|
\u{1F4DD} Pre-Edit Analysis`)),console.log(I.dim(` File: ${e.file}`)),console.log(I.dim(` Operation: ${e.operation}`)),s.routing&&(console.log(I.bold(`
|
|
125
125
|
\u{1F3AF} Recommended Agent:`),I.cyan(s.routing.recommendedAgent)),console.log(I.dim(` Confidence: ${(s.routing.confidence*100).toFixed(1)}%`))),console.log(I.bold(`
|
|
126
|
-
\u{1F4A1} Guidance:`)),W(s.guidance||[]);return}catch(t){throw _(`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 E(),n=e.success||!e.failure,s=e.file||"";if(!s.trim())try{let
|
|
126
|
+
\u{1F4A1} Guidance:`)),W(s.guidance||[]);return}catch(t){throw _(`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 E(),n=e.success||!e.failure,s=e.file||"";if(!s.trim())try{let l=await Q();s=ce(l)}catch{}let r=s.split("/").pop()||"unknown",c=/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(r)?"test-generation":"code-intelligence",i=e.patternId||`edit:${c}:${r}`,d=(await t.emit(R.PostTestGeneration,{targetFile:s,success:n,patternId:i,generatedTests:null,testCount:0}))[0]||{success:!0,patternsLearned:0};try{let{reasoningBank:l}=await E();await l.recordOutcome({patternId:i,success:n,metrics:{executionTimeMs:0},feedback:`Edit ${n?"succeeded":"failed"}: ${s}`})}catch{}try{await B({task:`edit: ${s}`,agent:"cli-hook",domain:c,success:n,source:"cli-hook-post-edit"})}catch{}try{let l=T(),m=we.join(l,".agentic-qe"),p=await v(m);await A(p)}catch{}e.json?f({success:!0,file:s,editSuccess:n,patternsLearned:d.patternsLearned||0,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):($(`Recorded edit outcome for ${s||"(unknown file)"}`),d.patternsLearned&&console.log(I.green(` Patterns learned: ${d.patternsLearned}`)));return}catch(t){throw _(`post-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}})}import{randomUUID as _e}from"crypto";C();import b from"chalk";import be from"node:path";function Te(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 me(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 Q();t=Te(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 E(),s={task:t,domain:e.domain,capabilities:e.capabilities},r=await n.routeTask(s);if(!r.success)throw new Error(r.error.message);let a=r.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(b.bold(`
|
|
127
127
|
\u{1F3AF} Task Routing Result`)),console.log(b.dim(` Task: "${t}"`)),console.log(b.bold(`
|
|
128
128
|
\u{1F464} Recommended Agent:`),b.cyan(a.recommendedAgent)),console.log(b.dim(` Confidence: ${(a.confidence*100).toFixed(1)}%`)),a.alternatives.length>0&&(console.log(b.bold(`
|
|
129
129
|
\u{1F504} Alternatives:`)),a.alternatives.forEach(c=>{console.log(b.dim(` - ${c.agent}: ${(c.score*100).toFixed(1)}%`))})),console.log(b.bold(`
|
|
130
130
|
\u{1F4C2} Detected Domains:`),a.domains.join(", ")),console.log(b.bold(`
|
|
131
131
|
\u{1F4A1} Guidance:`)),W(a.guidance),console.log(b.bold(`
|
|
132
|
-
\u{1F4D6} Reasoning:`),b.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-
|
|
132
|
+
\u{1F4D6} Reasoning:`),b.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-R72C7IBY.js"),i=c();i.isInitialized()||await i.initialize();let y=i.getDatabase();N(y),z(y);let d=`route-${Date.now()}-${_e().slice(0,8)}`,l=a.confidence<.5,m=a;y.prepare(`
|
|
133
133
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
134
134
|
id, task_json, decision_json, used_agent,
|
|
135
135
|
followed_recommendation, success, quality_score,
|
|
136
136
|
duration_ms, error,
|
|
137
137
|
exploration, criticality, q_weight
|
|
138
138
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
139
|
-
`).run(d,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:
|
|
139
|
+
`).run(d,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:l,exploration:m.exploration??!1,criticality:m.criticality??null,qWeight:m.qWeight??null}),a.recommendedAgent,1,0,-1,0,l?"low-confidence":null,m.exploration?1:0,m.criticality??null,m.qWeight??null);let p=T(),h=be.join(p,".agentic-qe"),u=await v(h);await A(u)}catch(c){console.error(b.dim(`[hooks] route persist: ${c instanceof Error?c.message:"unknown"}`))}return}catch(t){throw _(`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,s=q();s.isInitialized()||await s.initialize();let r=s.getDatabase();N(r);let a=r.prepare(`
|
|
140
140
|
UPDATE routing_outcomes
|
|
141
141
|
SET success = ?, quality_score = ?, duration_ms = 0, error = NULL
|
|
142
142
|
WHERE id = (
|
|
@@ -155,7 +155,7 @@ import{a as z}from"./chunk-5RILQ3EG.js";import{a as R,b as re,c as ae}from"./chu
|
|
|
155
155
|
WHERE quality_score = -1
|
|
156
156
|
AND task_json NOT LIKE '%"taskId"%'
|
|
157
157
|
AND created_at < datetime('now', '-300 seconds')
|
|
158
|
-
`).run();e.json?f({success:!0,resolved:a.changes>0,staleSwept:c.changes,qualityScore:n,turnSuccess:t}):c.changes>0&&console.log(b.dim(`[hooks] post-route: swept ${c.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(b.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import k from"chalk";he();function
|
|
158
|
+
`).run();e.json?f({success:!0,resolved:a.changes>0,staleSwept:c.changes,qualityScore:n,turnSuccess:t}):c.changes>0&&console.log(b.dim(`[hooks] post-route: swept ${c.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(b.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import k from"chalk";he();function le(o){o.command("stats").description("Display hooks system statistics").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await E(),n=await t.getStats();if(e.json)f(n);else{console.log(k.bold(`
|
|
159
159
|
\u{1F4CA} Hooks System Statistics
|
|
160
160
|
`)),console.log(k.bold("Patterns:")),console.log(` Total: ${k.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(k.bold(`
|
|
161
161
|
By Domain:`));for(let[s,r]of Object.entries(n.byDomain))r>0&&console.log(` ${s}: ${r}`);console.log(k.bold(`
|
|
@@ -167,7 +167,7 @@ Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOp
|
|
|
167
167
|
Registered: ${n.length}/${Object.keys(R).length}`))}}catch(t){throw _(`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 E(),n;try{n=X(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let s=await t.emit(e.event,n);e.json?f({event:e.event,results:s}):(console.log(k.bold(`
|
|
168
168
|
\u{1F4E1} Hook Event Emitted`)),console.log(k.dim(` Event: ${e.event}`)),console.log(k.dim(` Handlers: ${s.length}`)),s.forEach((r,a)=>{let c=r.success?k.green("\u2713"):k.red("\u2717");console.log(` ${c} Handler ${a+1}: ${r.success?"success":r.error}`),r.patternsLearned&&console.log(k.green(` Patterns learned: ${r.patternsLearned}`))}))}catch(t){throw _(`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 E(),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 s=n.value;e.json?f({success:!0,pattern:{id:s.id,name:s.name,type:s.patternType,domain:s.qeDomain}}):($(`Pattern stored: ${s.name}`),console.log(k.dim(` ID: ${s.id}`)),console.log(k.dim(` Domain: ${s.qeDomain}`)),console.log(k.dim(` Tier: ${s.tier}`)))}catch(t){throw _(`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 E(),n=await t.searchPatterns(e.query,{limit:parseInt(e.limit,10),domain:e.domain});if(!n.success)throw new Error(n.error.message);let s=n.value;e.json?f({query:e.query,total:s.length,patterns:s.map(r=>({id:r.pattern.id,name:r.pattern.name,score:r.score,domain:r.pattern.qeDomain,matchType:r.matchType}))}):(console.log(k.bold(`
|
|
169
169
|
\u{1F50D} Search Results for "${e.query}"
|
|
170
|
-
`)),s.length===0?console.log(k.dim(" No patterns found")):s.forEach((r,a)=>{console.log(`${k.cyan(`${a+1}.`)} ${r.pattern.name} ${k.dim(`(${(r.score*100).toFixed(1)}%)`)}`),console.log(k.dim(` Domain: ${r.pattern.qeDomain}`)),console.log(k.dim(` Match: ${r.matchType}`)),console.log(k.dim(` ID: ${r.pattern.id}`)),console.log()}),console.log(k.dim(`Found ${s.length} pattern(s)`)))}catch(t){throw _(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}C();import U from"chalk";import Re from"node:path";function
|
|
170
|
+
`)),s.length===0?console.log(k.dim(" No patterns found")):s.forEach((r,a)=>{console.log(`${k.cyan(`${a+1}.`)} ${r.pattern.name} ${k.dim(`(${(r.score*100).toFixed(1)}%)`)}`),console.log(k.dim(` Domain: ${r.pattern.qeDomain}`)),console.log(k.dim(` Match: ${r.matchType}`)),console.log(k.dim(` ID: ${r.pattern.id}`)),console.log()}),console.log(k.dim(`Found ${s.length} pattern(s)`)))}catch(t){throw _(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}C();import U from"chalk";import Re from"node:path";function ue(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 E(),s=await n.getStats(),r=T(),a=Re.join(r,".agentic-qe"),c=await v(a),i=await c.get(L),y=!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(L,i);let d=[];d.push(`AQE Learning: ${s.totalPatterns} patterns loaded`);let l=Object.entries(s.byDomain).filter(([,p])=>p>0).sort(([,p],[,h])=>h-p).slice(0,5);l.length>0&&d.push(`Top domains: ${l.map(([p,h])=>`${p}(${h})`).join(", ")}`),s.patternSuccessRate>0&&d.push(`Pattern success rate: ${(s.patternSuccessRate*100).toFixed(0)}%`),s.routingRequests>0&&d.push(`Routing confidence: ${(s.avgRoutingConfidence*100).toFixed(0)}% across ${s.routingRequests} requests`);let m=d.join(". ")+".";e.json?f({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:m},sessionId:t,initialized:!0,patternsLoaded:s.totalPatterns,dreamScheduler:{enabled:!0,lastDreamTime:i.lastDreamTime,pendingExperiences:i.experienceCount}}):($(`Session started: ${t}`),console.log(U.dim(` Patterns loaded: ${s.totalPatterns}`)),console.log(U.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 s=0;try{s=await Z()}catch{}if(e.json){let r=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:s,finalStats:n?{patternsLearned:n.totalPatterns,routingRequests:n.routingRequests,successRate:n.patternSuccessRate}:null})}else $(`Session ended: ${t}`),n&&(console.log(U.dim(` Patterns: ${n.totalPatterns}`)),console.log(U.dim(` Routing requests: ${n.routingRequests}`))),s>0&&console.log(U.dim(` Patterns consolidated: ${s}`));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{createHash as De,randomUUID as ve}from"node:crypto";import D from"chalk";import $e from"node:path";C();var xe="task-bridge",Ae=6e5,pe=.5;function Oe(o){return De("sha256").update(o).digest("hex").slice(0,16)}function ge(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 E(),n=null;if(e.description){let d=await t.routeTask({task:e.description});d.success&&(n=d.value)}let s=(n?.patterns??[]).slice(0,5).map(d=>d?.id).filter(d=>typeof d=="string"),r=null,a=[],c=0,i=null;try{let d=q();d.isInitialized()||await d.initialize();let l=d.getDatabase();N(l);try{let m=l.prepare(`
|
|
171
171
|
SELECT used_agent AS agent,
|
|
172
172
|
ROUND(AVG(quality_score), 3) AS avgQuality,
|
|
173
173
|
COUNT(*) AS n
|
|
@@ -176,36 +176,36 @@ Registered: ${n.length}/${Object.keys(R).length}`))}}catch(t){throw _(`list fail
|
|
|
176
176
|
GROUP BY used_agent
|
|
177
177
|
ORDER BY avgQuality DESC, n DESC
|
|
178
178
|
LIMIT 1
|
|
179
|
-
`).get();m&&(r=m)}catch{}try{a=
|
|
179
|
+
`).get();m&&(r=m)}catch{}try{a=l.prepare(`
|
|
180
180
|
SELECT key, value
|
|
181
181
|
FROM kv_store
|
|
182
182
|
WHERE namespace = 'verdicts'
|
|
183
183
|
AND created_at > datetime('now', '-7 days')
|
|
184
184
|
ORDER BY created_at DESC
|
|
185
185
|
LIMIT 3
|
|
186
|
-
`).all().map(p=>({key:p.key,summary:String(p.value).slice(0,200)}))}catch{}if(s.length>0)try{let m=s.map(()=>"?").join(","),p=
|
|
186
|
+
`).all().map(p=>({key:p.key,summary:String(p.value).slice(0,200)}))}catch{}if(s.length>0)try{let m=s.map(()=>"?").join(","),p=l.prepare(`
|
|
187
187
|
SELECT COALESCE(SUM(average_token_savings), 0) AS sum
|
|
188
188
|
FROM qe_patterns
|
|
189
189
|
WHERE id IN (${m})
|
|
190
|
-
`).get(...s);c=Math.max(0,Math.round(p?.sum??0))}catch{}if(e.description)try{let m=String(e.description),p=ne(m),h="normal",
|
|
190
|
+
`).get(...s);c=Math.max(0,Math.round(p?.sum??0))}catch{}if(e.description)try{let m=String(e.description),p=ne(m),h="normal",u=n?.domains?.[0]??"any",S=Math.max(0,Math.min(10,Math.round(Math.min(m.length/200,1)*10)));i=`task:${Oe(m)}`;let x=JSON.stringify({selectedPatternIds:s,agent:n?.recommendedAgent??null,description:m.slice(0,200),taskType:p,priority:h,domain:u,complexityBucket:S,estimatedTokenSavings:c,ts:Date.now()}),H=Date.now()+Ae;l.prepare(`
|
|
191
191
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
|
|
192
192
|
VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
|
|
193
|
-
`).run(i,xe,x,H)}catch(m){console.error(D.dim(`[hooks] pre-task bridge: ${m instanceof Error?m.message:"unknown"}`))}if(n?.recommendedAgent)try{z(
|
|
193
|
+
`).run(i,xe,x,H)}catch(m){console.error(D.dim(`[hooks] pre-task bridge: ${m instanceof Error?m.message:"unknown"}`))}if(n?.recommendedAgent)try{z(l);let m=e.taskId||`hook-${Date.now()}`,p=`route-${Date.now()}-${ve().slice(0,8)}`,h=n.confidence<pe,u=n;l.prepare(`
|
|
194
194
|
INSERT INTO routing_outcomes (
|
|
195
195
|
id, task_json, decision_json, used_agent,
|
|
196
196
|
followed_recommendation, success, quality_score,
|
|
197
197
|
duration_ms, error,
|
|
198
198
|
exploration, criticality, q_weight
|
|
199
199
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
200
|
-
`).run(p,JSON.stringify({description:e.description,taskId:m}),JSON.stringify({recommended:n.recommendedAgent,confidence:n.confidence,alternatives:n.alternatives,lowConfidence:h,exploration:
|
|
200
|
+
`).run(p,JSON.stringify({description:e.description,taskId:m}),JSON.stringify({recommended:n.recommendedAgent,confidence:n.confidence,alternatives:n.alternatives,lowConfidence:h,exploration:u.exploration??!1,criticality:u.criticality??null,qWeight:u.qWeight??null}),n.recommendedAgent,1,0,-1,0,h?"low-confidence":null,u.exploration?1:0,u.criticality??null,u.qWeight??null)}catch(m){console.error(D.dim(`[hooks] pre-task sentinel: ${m instanceof Error?m.message:"unknown"}`))}}catch(d){console.error(D.dim(`[hooks] pre-task memory: ${d instanceof Error?d.message:"unknown"}`))}let y=n?n.confidence<pe:!1;e.json?f({success:!0,taskId:e.taskId,description:e.description,recommendedAgent:n?.recommendedAgent,confidence:n?.confidence,guidance:n?.guidance||[],selectedPatternIds:s,historicalBest:r,priorVerdicts:a,estimatedTokenSavings:c,lowConfidence:y,bridgeKey:i}):(console.log(D.bold(`
|
|
201
201
|
\u{1F680} Pre-Task Analysis`)),console.log(D.dim(` Task ID: ${e.taskId||"N/A"}`)),n&&(console.log(D.bold(`
|
|
202
|
-
\u{1F3AF} Recommended:`),D.cyan(n.recommendedAgent)),console.log(D.dim(` Confidence: ${(n.confidence*100).toFixed(1)}%`)),y&&console.log(D.yellow(" \u26A0 Low confidence \u2014 consider providing more context"))));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("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=0;try{let{hookRegistry:s,reasoningBank:r}=await E();n=(await s.emit(R.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((d,
|
|
202
|
+
\u{1F3AF} Recommended:`),D.cyan(n.recommendedAgent)),console.log(D.dim(` Confidence: ${(n.confidence*100).toFixed(1)}%`)),y&&console.log(D.yellow(" \u26A0 Low confidence \u2014 consider providing more context"))));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("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=0;try{let{hookRegistry:s,reasoningBank:r}=await E();n=(await s.emit(R.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((d,l)=>d+(l.patternsLearned||0),0);{let d=e.taskId||`hook-${Date.now()}`,l=e.agent||"unknown",m=e.duration?parseInt(e.duration,10):0;await r.recordOutcome({patternId:`task:${l}:${d}`,success:t,metrics:{executionTimeMs:m},feedback:`Agent: ${l}, Task: ${d}`});let p=await V({taskId:d,agent:l,durationMs:m,success:t}),h=l==="unknown"&&p.bridge?.agent?p.bridge.agent:l;await Y({agent:h,success:t,durationMs:m,qualityScore:p.qualityScore}),p.bridge&&await K({taskType:p.bridge.taskType,priority:p.bridge.priority,domain:p.bridge.domain,complexityBucket:p.bridge.complexityBucket,agent:h,success:t})}let c=T(),i=$e.join(c,".agentic-qe"),y=await v(i);await A(y)}catch(s){console.error(D.dim(`[hooks] Learning init: ${s instanceof Error?s.message:"unknown"}`))}e.json?f({success:!0,taskId:e.taskId,taskSuccess:t,patternsLearned:n,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):($(`Task completed: ${e.taskId||"unknown"}`),console.log(D.dim(` Success: ${t}`)),n>0&&console.log(D.green(` Patterns learned: ${n}`)));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{existsSync as Ie,readFileSync as Ne}from"node:fs";import{randomUUID as fe}from"node:crypto";import F from"chalk";import ke from"node:path";C();function Pe(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 qe(o){try{let e=q();e.isInitialized()||await e.initialize();let t=e.getDatabase();N(t);let n=o.framework==="pytest"?"python":"javascript",s=o.command.split(/\s+/).slice(0,3).join("-").slice(0,80);t.prepare(`
|
|
203
203
|
INSERT INTO test_outcomes (
|
|
204
204
|
id, test_id, test_name, generated_by, framework, language, domain,
|
|
205
205
|
passed, execution_time_ms, maintainability_score, created_at
|
|
206
206
|
) VALUES (?, ?, ?, 'cli-hook-post-command', ?, ?, 'test-execution',
|
|
207
207
|
?, ?, 0.5, datetime('now'))
|
|
208
|
-
`).run(`to-${Date.now()}-${fe().slice(0,8)}`,`cmd:${s}`,o.command.slice(0,200),o.framework,n,o.success?1:0,o.durationMs);try{let r=ke.join(process.cwd(),"coverage","coverage-summary.json");if(Ie(r)){let c=JSON.parse(Ne(r,"utf-8")).total??{},i=Number(c.lines?.pct??0),y=Number(c.branches?.pct??0),d=Number(c.functions?.pct??0),
|
|
208
|
+
`).run(`to-${Date.now()}-${fe().slice(0,8)}`,`cmd:${s}`,o.command.slice(0,200),o.framework,n,o.success?1:0,o.durationMs);try{let r=ke.join(process.cwd(),"coverage","coverage-summary.json");if(Ie(r)){let c=JSON.parse(Ne(r,"utf-8")).total??{},i=Number(c.lines?.pct??0),y=Number(c.branches?.pct??0),d=Number(c.functions?.pct??0),l=t.prepare(`
|
|
209
209
|
SELECT after_lines, after_branches, after_functions
|
|
210
210
|
FROM coverage_sessions
|
|
211
211
|
WHERE target_path = ?
|
|
@@ -219,8 +219,8 @@ Registered: ${n.length}/${Object.keys(R).length}`))}}catch(t){throw _(`list fail
|
|
|
219
219
|
tests_generated, tests_passed, duration_ms,
|
|
220
220
|
started_at, completed_at
|
|
221
221
|
) VALUES (?, ?, 'cli-hook-post-command', ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?)
|
|
222
|
-
`).run(`cs-${Date.now()}-${fe().slice(0,8)}`,process.cwd(),o.framework,
|
|
223
|
-
\u26A0\uFE0F Command Warnings:`)),a.forEach(c=>console.log(F.yellow(` - ${c}`))));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,s=(e.command||"").substring(0,200),r=/\b(test|vitest|jest|pytest|mocha)\b/i.test(s),a=/\b(build|compile|tsc)\b/i.test(s),c=/\b(lint|eslint|prettier)\b/i.test(s),i=0,y=!1;try{let{reasoningBank:d}=await E();if(r){let{hookRegistry:x}=await E();await x.emit(R.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${s.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let
|
|
222
|
+
`).run(`cs-${Date.now()}-${fe().slice(0,8)}`,process.cwd(),o.framework,l?.after_lines??0,l?.after_branches??0,l?.after_functions??0,i,y,d,o.success?1:0,o.durationMs,m,m)}}catch(r){console.error(F.dim(`[hooks] coverage_sessions: ${r instanceof Error?r.message:"unknown"}`))}}catch(e){console.error(F.dim(`[hooks] test_outcomes: ${e instanceof Error?e.message:"unknown"}`))}}function ye(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,"/"),r=[{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));r?e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Protected file: ${r.reason} (${t})`}}):_(`Blocked: ${r.reason} (${t})`):e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}}):$(`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"}],s=[{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"}],r=n.find(c=>c.pattern.test(t)),a=s.filter(c=>c.pattern.test(t)).map(c=>c.reason);if(r)e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Dangerous command blocked: ${r.reason}`}}):_(`Blocked: ${r.reason}`);else if(e.json){let c={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};a.length>0&&(c.hookSpecificOutput.additionalContext=`Warnings: ${a.join("; ")}`),f(c)}else a.length>0&&(console.log(F.yellow(`
|
|
223
|
+
\u26A0\uFE0F Command Warnings:`)),a.forEach(c=>console.log(F.yellow(` - ${c}`))));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,s=(e.command||"").substring(0,200),r=/\b(test|vitest|jest|pytest|mocha)\b/i.test(s),a=/\b(build|compile|tsc)\b/i.test(s),c=/\b(lint|eslint|prettier)\b/i.test(s),i=0,y=!1;try{let{reasoningBank:d}=await E();if(r){let{hookRegistry:x}=await E();await x.emit(R.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${s.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let l=s.replace(/[^a-zA-Z0-9]/g,"-").slice(0,80),m=r?"test-execution":a?"code-intelligence":c?"quality-assessment":"code-intelligence";await d.recordOutcome({patternId:`cmd:${l}`,success:t,metrics:{executionTimeMs:0},feedback:`Command: ${s}, exit: ${n}`}),i=1,(r||a||c)&&(await B({task:`bash: ${s}`,agent:"cli-hook",domain:m,success:t,source:"cli-hook-post-command"}),y=!0);let p=Pe(s);p&&await qe({command:s,framework:p,success:t,durationMs:0});let h=T(),u=ke.join(h,".agentic-qe"),S=await v(u);await A(S)}catch(d){console.error(F.dim(`[hooks] post-command learning: ${d instanceof Error?d.message:"unknown"}`))}e.json&&f({success:!0,command:s.substring(0,100),commandSuccess:t,exitCode:n,patternsLearned:i,experienceRecorded:y});return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}function Kt(){let o=new Ce("hooks").description("Self-learning QE hooks for pattern recognition and guidance").addHelpText("after",`
|
|
224
224
|
Examples:
|
|
225
225
|
# File editing hooks (learning from edits)
|
|
226
226
|
aqe hooks pre-edit --file src/utils.ts --operation create
|
|
@@ -245,4 +245,4 @@ Examples:
|
|
|
245
245
|
aqe hooks search --query "authentication"
|
|
246
246
|
aqe hooks stats
|
|
247
247
|
aqe hooks list
|
|
248
|
-
`);return de(o),me(o),
|
|
248
|
+
`);return de(o),me(o),le(o),ue(o),ge(o),ye(o),o}export{R as QE_HOOK_EVENTS,Kt as createHooksCommand,E as getHooksSystem,g as hooksState};
|