agentic-qe 3.13.1 → 3.13.2
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 +29 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-I4SNWMCM.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-4VM3DE42.js → agent-booster-wasm-PZYYTKSS.js} +2 -2
- package/dist/cli/chunks/{agent-handler-ZDLMZQQX.js → agent-handler-DNN7GXUN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-P72MDHHV.js → agent-memory-branch-LVCBBCQY.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-WI47XKXI.js +2 -0
- package/dist/cli/chunks/{arena-GCRBQ26R.js → arena-422HSTPE.js} +2 -2
- package/dist/cli/chunks/{arena-55FZGKEV.js → arena-OCEOLMCH.js} +4 -4
- package/dist/cli/chunks/{audit-VYAYVLIV.js → audit-5O45K34M.js} +3 -3
- package/dist/cli/chunks/base-VJ6VDLD7.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-GMRPPMDM.js → better-sqlite3-Y36THYK2.js} +2 -2
- package/dist/cli/chunks/{brain-handler-IUKMRGWO.js → brain-handler-7VHXYN3P.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-TUI3RWLX.js → branch-enumerator-PZKOD6S6.js} +2 -2
- package/dist/cli/chunks/{browser-NBQTZYX2.js → browser-M74UO4WJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-WRYHQQDU.js +2 -0
- package/dist/cli/chunks/{chunk-5BB5DUL4.js → chunk-24S5IUSI.js} +2 -2
- package/dist/cli/chunks/{chunk-E4D47QTF.js → chunk-2DG44UZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-KNWDXI3I.js → chunk-2QJPAQE5.js} +2 -2
- package/dist/cli/chunks/{chunk-2G2QWV7B.js → chunk-4DKL4H5L.js} +2 -2
- package/dist/cli/chunks/{chunk-IBSBOHUX.js → chunk-4FYTWD4Q.js} +2 -2
- package/dist/cli/chunks/{chunk-6XZXMEK4.js → chunk-4HFNY3Z2.js} +2 -2
- package/dist/cli/chunks/{chunk-DTRFZD7N.js → chunk-4PM5VORA.js} +2 -2
- package/dist/cli/chunks/{chunk-WINA3XUT.js → chunk-4SFOQSXU.js} +2 -2
- package/dist/cli/chunks/{chunk-JOTNKZ7A.js → chunk-4STE6VLR.js} +10 -10
- package/dist/cli/chunks/{chunk-XN2CD5S6.js → chunk-54BCLRRJ.js} +2 -2
- package/dist/cli/chunks/{chunk-LTKNCYMO.js → chunk-5AAG7JTB.js} +2 -2
- package/dist/cli/chunks/{chunk-IZO6TPGX.js → chunk-5EFNZEOB.js} +2 -2
- package/dist/cli/chunks/{chunk-YLAEIS6F.js → chunk-5GGGZYFA.js} +1 -1
- package/dist/cli/chunks/{chunk-FQXQJMSF.js → chunk-5KMBZTDI.js} +2 -2
- package/dist/cli/chunks/{chunk-UHKXKWMD.js → chunk-5XYVRTI6.js} +2 -2
- package/dist/cli/chunks/{chunk-HFI5PHG5.js → chunk-62D27BDO.js} +3 -3
- package/dist/cli/chunks/{chunk-EVDYFGVH.js → chunk-6DMB6WK5.js} +2 -2
- package/dist/cli/chunks/{chunk-TQ2MA3SR.js → chunk-6R7TX5L4.js} +1 -1
- package/dist/cli/chunks/chunk-6UGYFYS4.js +2 -0
- package/dist/cli/chunks/{chunk-H7YZ2YF2.js → chunk-6XHDH3IJ.js} +2 -2
- package/dist/cli/chunks/{chunk-XOQQGZFY.js → chunk-73HALJY5.js} +1 -1
- package/dist/cli/chunks/{chunk-QLOOW23R.js → chunk-7TCVVVFA.js} +3 -3
- package/dist/cli/chunks/{chunk-LJQ27PUE.js → chunk-A2OD5Z4B.js} +1 -1
- package/dist/cli/chunks/{chunk-OE4B6LDZ.js → chunk-AJ7A52GF.js} +1 -1
- package/dist/cli/chunks/{chunk-RZ6CO3RZ.js → chunk-AP2BBV2D.js} +2 -2
- package/dist/cli/chunks/{chunk-EAKHU5YX.js → chunk-AS2HVJ42.js} +3 -3
- package/dist/cli/chunks/{chunk-2CQAWYYE.js → chunk-ASIGTVFQ.js} +1 -1
- package/dist/cli/chunks/{chunk-UKBDH27A.js → chunk-B7KZMPF2.js} +1 -1
- package/dist/cli/chunks/{chunk-7D7XFZZI.js → chunk-BFKXHXWW.js} +2 -2
- package/dist/cli/chunks/{chunk-NHV4PTG6.js → chunk-BO2RBAPF.js} +2 -2
- package/dist/cli/chunks/{chunk-ELMUHNXN.js → chunk-BSQ32ZS5.js} +2 -2
- package/dist/cli/chunks/{chunk-XSCOEY4C.js → chunk-CKTFKA7Q.js} +2 -2
- package/dist/cli/chunks/{chunk-LSKQUUUN.js → chunk-CLBBFKXV.js} +2 -2
- package/dist/cli/chunks/{chunk-YRVUYM62.js → chunk-COOMXCCP.js} +2 -2
- package/dist/cli/chunks/{chunk-3Y6CHW67.js → chunk-DAHNHVND.js} +1 -1
- package/dist/cli/chunks/{chunk-OCKTPTQ7.js → chunk-DCQQJLUY.js} +2 -2
- package/dist/cli/chunks/{chunk-NP4CP3LR.js → chunk-DIPOFCBX.js} +2 -2
- package/dist/cli/chunks/{chunk-YMMVCOPF.js → chunk-DL2HDULJ.js} +5 -5
- package/dist/cli/chunks/{chunk-UJ6TMZC6.js → chunk-DQXSDWRP.js} +2 -2
- package/dist/cli/chunks/{chunk-GTPZVLL6.js → chunk-E6JJ4ZRQ.js} +1 -1
- package/dist/cli/chunks/{chunk-55WDVSCM.js → chunk-E6PYV3DB.js} +2 -2
- package/dist/cli/chunks/{chunk-J45DX3IK.js → chunk-EABGQVTV.js} +1 -1
- package/dist/cli/chunks/{chunk-AOMXMFDH.js → chunk-EFHMS7TJ.js} +2 -2
- package/dist/cli/chunks/{chunk-BOCEOLLJ.js → chunk-ELVUERQW.js} +2 -2
- package/dist/cli/chunks/{chunk-MPD7RR4P.js → chunk-EU7NUUL6.js} +1 -1
- package/dist/cli/chunks/{chunk-M3T6FB54.js → chunk-F6UMLI5Y.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCLFAOVT.js → chunk-FECBWGCA.js} +2 -2
- package/dist/cli/chunks/{chunk-S6F3IJMK.js → chunk-FFMUTX26.js} +1 -1
- package/dist/cli/chunks/{chunk-2OM3TDC4.js → chunk-FJ2L6P7O.js} +1 -1
- package/dist/cli/chunks/{chunk-ZLCATRXI.js → chunk-FMYNKZ2S.js} +2 -2
- package/dist/cli/chunks/{chunk-4WGSMODQ.js → chunk-FXXXLDB3.js} +1 -1
- package/dist/cli/chunks/{chunk-FM272B4O.js → chunk-FZEWEG6Q.js} +2 -2
- package/dist/cli/chunks/{chunk-PKMCZFET.js → chunk-G4LZ5SBC.js} +2 -2
- package/dist/cli/chunks/{chunk-IV2VCR75.js → chunk-GHJRLC3C.js} +5 -5
- package/dist/cli/chunks/{chunk-4QMWWYNU.js → chunk-GKKD22CC.js} +2 -2
- package/dist/cli/chunks/{chunk-3F4XH4ZA.js → chunk-GMKJWOXZ.js} +1 -1
- package/dist/cli/chunks/{chunk-3KGCBAUH.js → chunk-GMKQJEKX.js} +2 -2
- package/dist/cli/chunks/{chunk-IJP42OGW.js → chunk-GZ775E5O.js} +2 -2
- package/dist/cli/chunks/{chunk-GJEEPKAT.js → chunk-H6C2YTPX.js} +2 -2
- package/dist/cli/chunks/{chunk-QG6BXSNJ.js → chunk-HANBJ37Z.js} +2 -2
- package/dist/cli/chunks/{chunk-6C3MZLYW.js → chunk-HANJESCY.js} +2 -2
- package/dist/cli/chunks/{chunk-THFLRJT6.js → chunk-HD6PZHLC.js} +3 -3
- package/dist/cli/chunks/{chunk-SPJQJWGK.js → chunk-HHUKHEW5.js} +2 -2
- package/dist/cli/chunks/{chunk-WWP2VXYJ.js → chunk-HQCJYUKC.js} +2 -2
- package/dist/cli/chunks/{chunk-AYYDO52G.js → chunk-IIZ3HBPV.js} +2 -2
- package/dist/cli/chunks/{chunk-P4Y3G6OB.js → chunk-IV77BQ2R.js} +2 -2
- package/dist/cli/chunks/{chunk-CWP4RMOM.js → chunk-J722Z7VO.js} +2 -2
- package/dist/cli/chunks/{chunk-GOV2MHLV.js → chunk-JDRYENTD.js} +2 -2
- package/dist/cli/chunks/{chunk-LVHMXGDI.js → chunk-JKVUSXT4.js} +3 -3
- package/dist/cli/chunks/{chunk-RSCGBHLM.js → chunk-JMRUHQEL.js} +2 -2
- package/dist/cli/chunks/{chunk-IMQKEFW6.js → chunk-JPO4AC5Q.js} +1 -1
- package/dist/cli/chunks/{chunk-ZHEKGB4A.js → chunk-JPPHM3I6.js} +2 -2
- package/dist/cli/chunks/{chunk-EGMGOWCE.js → chunk-K3MNTU4O.js} +2 -2
- package/dist/cli/chunks/{chunk-UHGMS2PJ.js → chunk-K47EWX3M.js} +1 -1
- package/dist/cli/chunks/{chunk-ORDH4VPL.js → chunk-KAHMXURL.js} +1 -1
- package/dist/cli/chunks/{chunk-VLUJWI56.js → chunk-KHVW6DQS.js} +1 -1
- package/dist/cli/chunks/{chunk-FDUSWM6O.js → chunk-KKPWS3XJ.js} +18 -18
- package/dist/cli/chunks/{chunk-MY47CR27.js → chunk-KRRGOJ6K.js} +2 -2
- package/dist/cli/chunks/chunk-LEOSNZR2.js +2 -0
- package/dist/cli/chunks/{chunk-PIOO2M4W.js → chunk-LG6UUM55.js} +2 -2
- package/dist/cli/chunks/{chunk-V32MDID3.js → chunk-LJWIBYTR.js} +2 -2
- package/dist/cli/chunks/{chunk-YQCAXYBF.js → chunk-LQDQTLWV.js} +2 -2
- package/dist/cli/chunks/{chunk-23MT7OBY.js → chunk-LXYVWAFN.js} +2 -2
- package/dist/cli/chunks/{chunk-WWCH5SSF.js → chunk-LZNJ7HXB.js} +2 -2
- package/dist/cli/chunks/{chunk-IJA4WS7B.js → chunk-M4JZOCV3.js} +1 -1
- package/dist/cli/chunks/{chunk-XFUF654L.js → chunk-MBTVAIFF.js} +1 -1
- package/dist/cli/chunks/{chunk-L7IOTWWY.js → chunk-MNDPSIEI.js} +1 -1
- package/dist/cli/chunks/{chunk-ZH6ZBDVV.js → chunk-MUSLUG6Y.js} +1 -1
- package/dist/cli/chunks/{chunk-UMCEEXQN.js → chunk-MVJ5UQI3.js} +1 -1
- package/dist/cli/chunks/{chunk-MX5ZDKRR.js → chunk-N2AGOQCL.js} +2 -2
- package/dist/cli/chunks/{chunk-S6VNPKHO.js → chunk-N4O2RWSL.js} +1 -1
- package/dist/cli/chunks/{chunk-JELNVHBF.js → chunk-NBRKZOPM.js} +1 -1
- package/dist/cli/chunks/{chunk-LSZZQ7H6.js → chunk-NIE3SGZM.js} +1 -1
- package/dist/cli/chunks/{chunk-USUFTHHT.js → chunk-NNIKJZA4.js} +3 -3
- package/dist/cli/chunks/{chunk-JAPOMPFD.js → chunk-NTKIDOIW.js} +2 -2
- package/dist/cli/chunks/{chunk-CWXDL7AH.js → chunk-ODE7Z667.js} +1 -1
- package/dist/cli/chunks/{chunk-A2MG3YXO.js → chunk-OYWZYG6Q.js} +1 -1
- package/dist/cli/chunks/{chunk-6QKQFHS7.js → chunk-P33EORZZ.js} +2 -2
- package/dist/cli/chunks/{chunk-Y734CWHJ.js → chunk-PILZKQX7.js} +2 -2
- package/dist/cli/chunks/{chunk-MAYZTGJ2.js → chunk-PJOH5Z5I.js} +2 -2
- package/dist/cli/chunks/{chunk-2XZ4BHWS.js → chunk-PNQWEOE2.js} +1 -1
- package/dist/cli/chunks/{chunk-ZYPESQ4M.js → chunk-PRQPUOSH.js} +2 -2
- package/dist/cli/chunks/{chunk-ZXX2VFMA.js → chunk-PT6NTWGT.js} +2 -2
- package/dist/cli/chunks/{chunk-AY7S7AWN.js → chunk-Q45FBGVV.js} +1 -1
- package/dist/cli/chunks/{chunk-GASOBSNB.js → chunk-Q625ISQI.js} +4 -4
- package/dist/cli/chunks/{chunk-SS6K4FBH.js → chunk-QS6TI7NR.js} +2 -2
- package/dist/cli/chunks/{chunk-TDGE52HJ.js → chunk-QVD3LU27.js} +1 -1
- package/dist/cli/chunks/{chunk-2D2XFUKI.js → chunk-QZACODX6.js} +2 -2
- package/dist/cli/chunks/{chunk-YBPCBFEE.js → chunk-REBNPQI7.js} +2 -2
- package/dist/cli/chunks/{chunk-MUFYDKVC.js → chunk-RF2DMPX2.js} +2 -2
- package/dist/cli/chunks/{chunk-HUMQU4ES.js → chunk-RI2V2U2N.js} +2 -2
- package/dist/cli/chunks/{chunk-YVKMHXQK.js → chunk-RJYAUJDC.js} +3 -3
- package/dist/cli/chunks/{chunk-VAJT6QWX.js → chunk-RWHHOQIC.js} +1 -1
- package/dist/cli/chunks/{chunk-INYS35DV.js → chunk-RWUK5VMZ.js} +2 -2
- package/dist/cli/chunks/{chunk-ZIBW7CB4.js → chunk-SOOI2HJB.js} +1 -1
- package/dist/cli/chunks/{chunk-OPQY2333.js → chunk-T2XXTEZV.js} +2 -2
- package/dist/cli/chunks/{chunk-TBQTGQ75.js → chunk-T55XIENI.js} +2 -2
- package/dist/cli/chunks/{chunk-ARTLSAXO.js → chunk-T726SRYP.js} +2 -2
- package/dist/cli/chunks/{chunk-3K4YC3GC.js → chunk-TLG56A27.js} +2 -2
- package/dist/cli/chunks/{chunk-KW5NBORV.js → chunk-TTWWCWAR.js} +2 -2
- package/dist/cli/chunks/{chunk-AHTOWWSE.js → chunk-TVWX7NYD.js} +1 -1
- package/dist/cli/chunks/{chunk-UCQ66N6M.js → chunk-U2FCUBBW.js} +2 -2
- package/dist/cli/chunks/{chunk-FQUUMC57.js → chunk-UIQVVS7K.js} +2 -2
- package/dist/cli/chunks/{chunk-LTWT4GZD.js → chunk-UPGJZA3D.js} +4 -4
- package/dist/cli/chunks/{chunk-MCIO7BDK.js → chunk-UVLWT6QM.js} +1 -1
- package/dist/cli/chunks/{chunk-CE6LYEHT.js → chunk-VKU5BUUC.js} +1 -1
- package/dist/cli/chunks/{chunk-7WEHZCSK.js → chunk-VOYUCJLK.js} +2 -2
- package/dist/cli/chunks/{chunk-FRAGSKXQ.js → chunk-WMK2ZNLM.js} +3 -3
- package/dist/cli/chunks/{chunk-SXADKQJN.js → chunk-WTSVP6OK.js} +2 -2
- package/dist/cli/chunks/{chunk-MXKHIZVM.js → chunk-XS2S3ECA.js} +3 -3
- package/dist/cli/chunks/{chunk-N7WAZ2Y6.js → chunk-XXQLFPIK.js} +1 -1
- package/dist/cli/chunks/{chunk-J4T6D2OQ.js → chunk-XZOTFJHU.js} +2 -2
- package/dist/cli/chunks/{chunk-BF5BKSDU.js → chunk-YTHUTBBH.js} +2 -2
- package/dist/cli/chunks/{chunk-SHWXADCI.js → chunk-YWJ2GPD4.js} +2 -2
- package/dist/cli/chunks/{chunk-WZROSTQZ.js → chunk-YXTDCP6H.js} +1 -1
- package/dist/cli/chunks/{chunk-2ISLQU3G.js → chunk-YZUMCXH6.js} +1 -1
- package/dist/cli/chunks/{chunk-HYIRFJDB.js → chunk-ZIT5VF43.js} +2 -2
- package/dist/cli/chunks/{chunk-DVPGQG4W.js → chunk-ZY5FB3JV.js} +2 -2
- package/dist/cli/chunks/{ci-HHL5WQXQ.js → ci-EOFZKCSH.js} +2 -2
- package/dist/cli/chunks/{ci-output-HVOJC2KN.js → ci-output-TAJFQWDP.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-HRXMIY2G.js → circuit-breaker-QA7YJ3IF.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-3I7WVMZN.js → claude-flow-setup-4RNAIALK.js} +2 -2
- package/dist/cli/chunks/client-N2WAM5IK.js +2 -0
- package/dist/cli/chunks/{cline-installer-NBREL4QT.js → cline-installer-K25NUUA4.js} +2 -2
- package/dist/cli/chunks/{code-TX4E2RWU.js → code-JM4D3I2W.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-YELOFLSL.js → code-index-extractor-6B6TJ2B5.js} +2 -2
- package/dist/cli/chunks/{codex-installer-HEX3KFRB.js → codex-installer-GRUENCIO.js} +2 -2
- package/dist/cli/chunks/{completions-72GGFRGG.js → completions-LADTXGCC.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-WRAKDYUK.js → complexity-analyzer-IQITOJH5.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-UGYKSKTI.js → continuedev-installer-H6NAXFZK.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-RPCRUKIJ.js → copilot-installer-W7HCQKOS.js} +2 -2
- package/dist/cli/chunks/core-handlers-VSX474R3.js +2 -0
- package/dist/cli/chunks/{cost-tracker-CNHJ7G4M.js → cost-tracker-MC7KEENQ.js} +2 -2
- package/dist/cli/chunks/{coverage-RHIQ4XEX.js → coverage-NOOKPFYQ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-VNE7QKX4.js +2 -0
- package/dist/cli/chunks/{cursor-installer-KSRVA4V2.js → cursor-installer-GOZ64GZJ.js} +2 -2
- package/dist/cli/chunks/{daemon-IT4AAFBW.js → daemon-G4ABQMFJ.js} +3 -3
- package/dist/cli/chunks/{daemon-QBXSJABV.js → daemon-V23WTCJJ.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-F7WCQTLY.js → dag-attention-scheduler-YKOO6ZWL.js} +2 -2
- package/dist/cli/chunks/{detect-2IYU332U.js → detect-SNEMKQGJ.js} +2 -2
- package/dist/cli/chunks/{dist-node-CIYNYCYN.js → dist-node-VBNEM6K6.js} +2 -2
- package/dist/cli/chunks/{domain-handler-QRYQO2QK.js → domain-handler-2G5XEERC.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-2OQDOD3G.js → domain-transfer-HSEUUM7E.js} +2 -2
- package/dist/cli/chunks/dream-A5LVJU7T.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-P2IFC7JL.js → embed-and-insert-pattern-H6MU5HK4.js} +2 -2
- package/dist/cli/chunks/{eval-SBPK37IB.js → eval-XYVDJXJF.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-3GMFND3F.js → experience-capture-middleware-BZQJVXTE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-4OYYII2F.js → fast-paths-76WWBJ4H.js} +2 -2
- package/dist/cli/chunks/{feature-flags-BM6QTMMC.js → feature-flags-7E5YZ4P5.js} +2 -2
- package/dist/cli/chunks/{feature-flags-NFCAYUWO.js → feature-flags-SCQ35J6M.js} +2 -2
- package/dist/cli/chunks/{file-discovery-2M3ZUAGC.js → file-discovery-LU5MAXWA.js} +2 -2
- package/dist/cli/chunks/{fleet-QMGGVIDV.js → fleet-M3TH65SV.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-WGMAGZMO.js → gnn-wrapper-OYUJEJD2.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-5RSMEZGG.js → heartbeat-handler-II4NSOXK.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-CFZ6DNQY.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-I4Y2T4HO.js +2 -0
- package/dist/cli/chunks/hnsw-index-SBR5VYGN.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-TYPQ2T6P.js → hnsw-legacy-bridge-322R2UAB.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-JDDFYVCX.js → hnswlib-node-OVLAHTPU.js} +2 -2
- package/dist/cli/chunks/{hooks-NUC5P3OJ.js → hooks-2A27XCUJ.js} +37 -37
- package/dist/cli/chunks/hybrid-router-E6YM74NQ.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-OIB7WK54.js → hypergraph-engine-ERA527UR.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-XX2N75QC.js → hypergraph-handler-7XL4OL6W.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-GHYFSSMJ.js +2 -0
- package/dist/cli/chunks/{init-handler-AKSTJMZY.js → init-handler-WN6KQ5WY.js} +6 -6
- package/dist/cli/chunks/init-wizard-KAN5KOGD.js +2 -0
- package/dist/cli/chunks/kernel-LET4HEEF.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-375V5ZZB.js → kilocode-installer-5UCCFZ7V.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-GKY5GB5Q.js → kiro-installer-77DPEP3K.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-P3UJWNQS.js +2 -0
- package/dist/cli/chunks/{learning-2CQE3QP6.js → learning-A5GKUD73.js} +3 -3
- package/dist/cli/chunks/{llm-router-FTQNRF45.js → llm-router-SINJNEGP.js} +4 -4
- package/dist/cli/chunks/llm-router-service-BOBENURJ.js +2 -0
- package/dist/cli/chunks/{load-3DBAO5ZG.js → load-Q56GLXHJ.js} +2 -2
- package/dist/cli/chunks/load-test-4VDCVB7S.js +2 -0
- package/dist/cli/chunks/{mcp-AWR6TDXM.js → mcp-VBDU2WLY.js} +2 -2
- package/dist/cli/chunks/{memory-GI4LCNXY.js → memory-IGWBRDIT.js} +5 -5
- package/dist/cli/chunks/memory-backend-RRFAYQYS.js +2 -0
- package/dist/cli/chunks/{memory-handlers-MALKG7GP.js → memory-handlers-IITHQ7KV.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-SWFT5U72.js → multi-model-executor-2QUEY4CC.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-EYXGYJX5.js → opencode-installer-FZJ5N2B3.js} +2 -2
- package/dist/cli/chunks/{orchestrator-MP3EAZVC.js → orchestrator-BGLDS47V.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-V7DEZEF2.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-25P3R3W7.js → pattern-usage-recorder-4MFN4WKV.js} +2 -2
- package/dist/cli/chunks/{pipeline-LSAFL25D.js → pipeline-GZHAORGP.js} +2 -2
- package/dist/cli/chunks/{platform-IJ6DJ2PG.js → platform-TZEX4YZQ.js} +2 -2
- package/dist/cli/chunks/{plugin-OXOZRZW2.js → plugin-VEYUFCNY.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-HJNJQQ3R.js → prime-radiant-advanced-wasm-OA5DLXJJ.js} +2 -2
- package/dist/cli/chunks/protocol-executor-I3C2ZETP.js +2 -0
- package/dist/cli/chunks/{protocol-handler-TCMUH2HL.js → protocol-handler-MVJ5N4X5.js} +2 -2
- package/dist/cli/chunks/{prove-ADXQ2GOX.js → prove-VKF7YCUA.js} +2 -2
- package/dist/cli/chunks/provider-manager-HB4YVQDI.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-RDLBAXJY.js +2 -0
- package/dist/cli/chunks/{quality-EWP36ORX.js → quality-NLB5LVGM.js} +2 -2
- package/dist/cli/chunks/{quality-gate-3BIG7PVU.js → quality-gate-OM6A7FQM.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-QRWRNUDR.js +2 -0
- package/dist/cli/chunks/{real-embeddings-D4NBT7W5.js → real-embeddings-NONEKGAV.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-DOPWH6YV.js → roocode-installer-ORXQQO3F.js} +2 -2
- package/dist/cli/chunks/router-WDF7KV4M.js +2 -0
- package/dist/cli/chunks/routing-feedback-DHYB4ZNL.js +2 -0
- package/dist/cli/chunks/{routing-handler-5ADEFOHS.js → routing-handler-LGMIBVDS.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-PLMEIHSN.js → ruvector-commands-4GZMU4BZ.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-EQWKVNQB.js → rvf-dual-writer-45HKI22F.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-2OWFUUCG.js → rvf-migration-adapter-RHYIXI3I.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-URAETAPU.js → rvf-migration-coordinator-ANTAYKNN.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-7W53TYTH.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-4AWPW4TF.js → rvf-store-integrity-CPQUTFST.js} +2 -2
- package/dist/cli/chunks/safe-db-4HBFO7OQ.js +2 -0
- package/dist/cli/chunks/schedule-M2OSBJZM.js +2 -0
- package/dist/cli/chunks/scheduler-JWV5MSGE.js +2 -0
- package/dist/cli/chunks/{security-HDLZVM62.js → security-BM6LMCBI.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-YQT7PF7X.js → shared-rvf-adapter-3HGARKJX.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-N5D3NSJ7.js → shared-rvf-dual-writer-UQ4O46ZI.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-QA4JRQZ2.js +2 -0
- package/dist/cli/chunks/{status-handler-KLYRJ2MR.js → status-handler-TGRAM5PC.js} +2 -2
- package/dist/cli/chunks/{structural-health-6LKVRP6Y.js → structural-health-RXETMBB3.js} +2 -2
- package/dist/cli/chunks/{sync-7VMFPBVB.js → sync-B4KEYFCP.js} +2 -2
- package/dist/cli/chunks/{sync-YYOW6L6W.js → sync-JTBZIACA.js} +2 -2
- package/dist/cli/chunks/{task-handler-RKQDGFN2.js → task-handler-D7VXHWPG.js} +2 -2
- package/dist/cli/chunks/{task-handlers-6YJ4QTEP.js → task-handlers-XF6VVPTR.js} +3 -3
- package/dist/cli/chunks/{test-ASPUIUJH.js → test-BKEIMBSX.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-I7ABQBBU.js → test-scheduling-A4OHR7KW.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-2XZBTODN.js → token-bootstrap-LIDDAOAK.js} +2 -2
- package/dist/cli/chunks/{token-usage-TMUE6PTF.js → token-usage-BJUFIU4V.js} +2 -2
- package/dist/cli/chunks/{transformers-FDHHH4SL.js → transformers-YYUQCGMV.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-G7PGZA5C.js → tree-sitter-wasm-parser-DFXYTJ23.js} +2 -2
- package/dist/cli/chunks/{types-JGT57UFP.js → types-Z75HK5HH.js} +2 -2
- package/dist/cli/chunks/unified-memory-BEUZQTTC.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FHLSAEX4.js +2 -0
- package/dist/cli/chunks/unified-persistence-TVEQGCSB.js +2 -0
- package/dist/cli/chunks/{upgrade-V6UQODJF.js → upgrade-NETNZZH3.js} +2 -2
- package/dist/cli/chunks/{validate-UBZAE5RW.js → validate-U2WQ7P6T.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-TSO2MI5X.js → validate-swarm-DKD7H2E3.js} +2 -2
- package/dist/cli/chunks/{vibium-7G3VYSQA.js → vibium-FOQ73JBW.js} +2 -2
- package/dist/cli/chunks/visual-security-AYV46OUO.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-MIYJSF2L.js → web-tree-sitter-PQXWMQO6.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-5TLZSQIJ.js → windsurf-installer-CTFSFOBX.js} +2 -2
- package/dist/cli/chunks/{witness-chain-LTV7H2HM.js → witness-chain-NCRHNFQM.js} +2 -2
- package/dist/cli/chunks/witness-chain-RU356H6R.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-PAJ2J4AL.js → witness-key-manager-WGCSSB23.js} +2 -2
- package/dist/cli/chunks/{workflow-DL3ESR2H.js → workflow-FE5QGP2U.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-N2DQTC3X.js +2 -0
- package/dist/cli/chunks/{wrappers-5HSU665E.js → wrappers-AHL5K2LO.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +9 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +38 -0
- package/dist/cli/commands/hooks.d.ts +2 -2
- package/dist/cli/commands/hooks.js +8 -2
- package/dist/coordination/handlers/coverage-collection.js +6 -2
- package/dist/coordination/queen-coordinator.js +4 -3
- package/dist/integrations/ruvector/rvf-store-integrity.js +5 -1
- package/dist/integrations/ruvector/shared-rvf-adapter.js +5 -5
- package/dist/mcp/bundle.js +46 -46
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-VRZNL53W.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-XCNMNERX.js +0 -2
- package/dist/cli/chunks/base-VZZNR4UR.js +0 -2
- package/dist/cli/chunks/browser-workflow-5DZNIFUY.js +0 -2
- package/dist/cli/chunks/chunk-BBLWZT5I.js +0 -2
- package/dist/cli/chunks/chunk-QES4QHQW.js +0 -2
- package/dist/cli/chunks/client-EY2IYQDL.js +0 -2
- package/dist/cli/chunks/core-handlers-G4GLA4DT.js +0 -2
- package/dist/cli/chunks/cross-domain-router-P3K4IH5H.js +0 -2
- package/dist/cli/chunks/dream-IT4ZQGEO.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-UUWSPHF2.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-YUJVSFPD.js +0 -2
- package/dist/cli/chunks/hnsw-index-FQZ47RSJ.js +0 -2
- package/dist/cli/chunks/hybrid-router-T5MF73NF.js +0 -2
- package/dist/cli/chunks/impact-analyzer-AEGELYMD.js +0 -2
- package/dist/cli/chunks/init-wizard-WKX3OGWM.js +0 -2
- package/dist/cli/chunks/kernel-5CVWFIGR.js +0 -2
- package/dist/cli/chunks/knowledge-graph-EGPMNDMT.js +0 -2
- package/dist/cli/chunks/llm-router-service-H4LXOARB.js +0 -2
- package/dist/cli/chunks/load-test-OOOGITSN.js +0 -2
- package/dist/cli/chunks/memory-backend-O2YOT4LW.js +0 -2
- package/dist/cli/chunks/pattern-null-store-WBOHE2XL.js +0 -2
- package/dist/cli/chunks/protocol-executor-JCNTPW5J.js +0 -2
- package/dist/cli/chunks/provider-manager-LPGQ5GOO.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-FWVYVSPP.js +0 -2
- package/dist/cli/chunks/queen-coordinator-UXNALRVD.js +0 -2
- package/dist/cli/chunks/router-C6LUIQYY.js +0 -2
- package/dist/cli/chunks/routing-feedback-KMSGGDVD.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-K54BELUE.js +0 -2
- package/dist/cli/chunks/safe-db-NGOZWF2D.js +0 -2
- package/dist/cli/chunks/schedule-B3Y5P64E.js +0 -2
- package/dist/cli/chunks/scheduler-Z6QVRMTB.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-PLOUGATS.js +0 -2
- package/dist/cli/chunks/unified-memory-P5YVLMFI.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-7HI43A2O.js +0 -2
- package/dist/cli/chunks/unified-persistence-U26YP3N3.js +0 -2
- package/dist/cli/chunks/visual-security-6FCDY5FF.js +0 -2
- package/dist/cli/chunks/witness-chain-I3K3WQID.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-MAALP4WA.js +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
3
|
-
import{a as v,b as fe,c as he}from"./chunk-
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
3
|
+
import{a as v,b as fe,c as he}from"./chunk-AS2HVJ42.js";import{a as pe,b as ge}from"./chunk-COOMXCCP.js";import{a as ue}from"./chunk-HANBJ37Z.js";import{a as Y}from"./chunk-MVJ5UQI3.js";import{d as G,h as ne}from"./chunk-62D27BDO.js";import"./chunk-Q625ISQI.js";import"./chunk-5GGGZYFA.js";import"./chunk-GKKD22CC.js";import"./chunk-6R7TX5L4.js";import{b as K}from"./chunk-FJ2L6P7O.js";import"./chunk-ODE7Z667.js";import"./chunk-RF2DMPX2.js";import"./chunk-2DG44UZ5.js";import"./chunk-4FYTWD4Q.js";import"./chunk-TTWWCWAR.js";import"./chunk-LQDQTLWV.js";import"./chunk-WMK2ZNLM.js";import{i as M,m as U}from"./chunk-U2FCUBBW.js";import"./chunk-HQCJYUKC.js";import"./chunk-YWJ2GPD4.js";import{a as Ie}from"./chunk-6UGYFYS4.js";import{c as de}from"./chunk-BSQ32ZS5.js";import{b as R}from"./chunk-REBNPQI7.js";import{b as le,d as Le}from"./chunk-FMYNKZ2S.js";import{a as me}from"./chunk-TVWX7NYD.js";import"./chunk-E6PYV3DB.js";import"./chunk-LEOSNZR2.js";import"./chunk-E6JJ4ZRQ.js";import"./chunk-IIZ3HBPV.js";import"./chunk-SOOI2HJB.js";import"./chunk-6DMB6WK5.js";import"./chunk-5EFNZEOB.js";import"./chunk-J722Z7VO.js";import"./chunk-TLG56A27.js";import"./chunk-DIPOFCBX.js";import"./chunk-ZY5FB3JV.js";import"./chunk-VOYUCJLK.js";import"./chunk-DQXSDWRP.js";import"./chunk-GZ775E5O.js";import"./chunk-AJ7A52GF.js";import{Command as it}from"commander";import $ from"chalk";import ye from"node:path";U();import{randomUUID as B}from"crypto";import C from"chalk";var F="dream-scheduler:hook-state";async function x(o){try{let e=await o.get(F);return e||(e={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0}),e.experienceCount++,await o.set(F,e),e.experienceCount}catch{return 0}}async function W(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-BEUZQTTC.js"),t=e();t.isInitialized()||await t.initialize();let{initializeExperienceCapture:n}=await import("./experience-capture-middleware-BZQJVXTE.js");await n();let r=t.getDatabase();try{r.pragma("busy_timeout = 60000")}catch{}let s=`cli-${Date.now()}-${B().slice(0,8)}`,a=o.durationMs||0,c;if(o.success){let i=a>0&&a<5e3?.1:0,h=o.source.includes("post-task")?.1:o.source.includes("post-edit")?.05:0;c=Math.min(.95,.7+i+h)}else{let i=o.source.includes("post-task")?.15:o.source.includes("post-edit")?.1:0;c=Math.min(.6,.3+i)}r.prepare(`
|
|
4
4
|
INSERT OR REPLACE INTO captured_experiences
|
|
5
5
|
(id, task, agent, domain, success, quality, duration_ms,
|
|
6
6
|
started_at, completed_at, source)
|
|
7
7
|
VALUES (?, ?, ?, ?, ?, ?, ?, datetime('now'), datetime('now'), ?)
|
|
8
|
-
`).run(s,o.task.slice(0,500),o.agent,o.domain,o.success?1:0,c,a,o.source),(async()=>{try{let{computeRealEmbedding:i}=await import("./real-embeddings-
|
|
8
|
+
`).run(s,o.task.slice(0,500),o.agent,o.domain,o.success?1:0,c,a,o.source),(async()=>{try{let{computeRealEmbedding:i}=await import("./real-embeddings-NONEKGAV.js"),h=`${o.domain}: ${o.task}`.slice(0,512),l=await i(h);r.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(l).buffer),l.length,s)}catch{}})()}catch(e){console.error(C.dim(`[hooks] persistCommandExperience: ${e instanceof Error?e.message:"unknown"}`))}}async function oe(o){let{getUnifiedMemory:e}=await import("./unified-memory-BEUZQTTC.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}try{n.exec(`
|
|
9
9
|
CREATE TABLE IF NOT EXISTS captured_experiences (
|
|
10
10
|
id TEXT PRIMARY KEY,
|
|
11
11
|
task TEXT NOT NULL,
|
|
@@ -40,7 +40,7 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
40
40
|
FOREIGN KEY (experience_id) REFERENCES captured_experiences(id) ON DELETE CASCADE
|
|
41
41
|
);
|
|
42
42
|
CREATE INDEX IF NOT EXISTS idx_exp_apps_experience ON experience_applications(experience_id);
|
|
43
|
-
`)}catch{}try{let u=n.prepare("PRAGMA table_info(qe_trajectories)").all();u.length>0&&!u.some(
|
|
43
|
+
`)}catch{}try{let u=n.prepare("PRAGMA table_info(qe_trajectories)").all();u.length>0&&!u.some(k=>k.name==="metadata_json")&&n.exec("ALTER TABLE qe_trajectories ADD COLUMN metadata_json TEXT")}catch{}let r=`exp-${Date.now()}-${B().slice(0,8)}`,s=`${o.agent}:${o.taskId}`,a=o.durationMs??0,c=o.success?1:0,i=a<100?1:a<500?.8:a<2e3?.6:a<5e3?.4:a<1e4?.2:.1,h=.25*c+.325+.1*i,l=null,g=0,d=0,y=n.transaction(()=>{n.prepare(`
|
|
44
44
|
INSERT INTO captured_experiences
|
|
45
45
|
(id, task, agent, domain, success, quality, duration_ms,
|
|
46
46
|
model_tier, started_at, completed_at, source)
|
|
@@ -49,13 +49,13 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
49
49
|
INSERT INTO experience_applications
|
|
50
50
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
51
51
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
52
|
-
`).run(`app-${Date.now()}-${
|
|
52
|
+
`).run(`app-${Date.now()}-${B().slice(0,8)}`,r,s,o.success?1:0,Math.round(h*100),`[Patch 060] post-task outcome: ${o.success?"success":"failure"}`);try{let p=n.prepare(`
|
|
53
53
|
SELECT key, value FROM kv_store
|
|
54
54
|
WHERE namespace = 'task-bridge'
|
|
55
55
|
AND (expires_at IS NULL OR expires_at > strftime('%s','now') * 1000)
|
|
56
56
|
ORDER BY created_at DESC
|
|
57
57
|
LIMIT 1
|
|
58
|
-
`).get();if(
|
|
58
|
+
`).get();if(p?.value)try{l=JSON.parse(p.value)}catch{l=null}if(l&&Array.isArray(l.selectedPatternIds)&&l.selectedPatternIds.length>0){let T=l.estimatedTokenSavings&&l.selectedPatternIds.length?Math.round(l.estimatedTokenSavings/l.selectedPatternIds.length):0,D=n.prepare(`
|
|
59
59
|
INSERT INTO experience_applications
|
|
60
60
|
(id, experience_id, task, success, tokens_saved, feedback, applied_at)
|
|
61
61
|
VALUES (?, ?, ?, ?, ?, ?, datetime('now'))
|
|
@@ -71,29 +71,29 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
71
71
|
AND successful_uses >= 3
|
|
72
72
|
AND success_rate >= 0.7
|
|
73
73
|
AND confidence >= 0.6
|
|
74
|
-
`);for(let S of l.selectedPatternIds){D.run(`app-${Date.now()}-${
|
|
74
|
+
`);for(let S of l.selectedPatternIds){D.run(`app-${Date.now()}-${B().slice(0,8)}`,r,`${s}:pattern:${S}`,o.success?1:0,T,`[Patch 160+300] task-bridge pattern_id=${S} ts=${T}`);try{me(n,{patternId:S,success:o.success,metrics:{tokens_saved:T,source:"cli-hook-post-task",experience_id:r},feedback:`[Patch 160+300] task-bridge pattern_id=${S} ts=${T}`})}catch{}try{let j=L.get(S);j?.tier==="short-term"&&j.successful_uses>=3&&j.success_rate>=.7&&j.confidence>=.6&&P.run(S)}catch{}}p&&n.prepare("DELETE FROM kv_store WHERE namespace='task-bridge' AND key = ?").run(p.key)}}catch(p){console.error(C.dim(`[hooks] post-task bridge: ${p instanceof Error?p.message:"unknown"}`))}let u=`traj-${Date.now()}-${B().slice(0,8)}`,k=o.parentAgentId!==void 0||o.depth!==void 0?JSON.stringify({...o.parentAgentId!==void 0?{parentAgentId:o.parentAgentId}:{},...o.depth!==void 0?{depth:o.depth}:{}}):null;n.prepare(`
|
|
75
75
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json, metadata_json)
|
|
76
76
|
VALUES (?, ?, ?, ?, datetime('now'), datetime('now'), ?, ?, ?)
|
|
77
|
-
`).run(u,s,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]),
|
|
77
|
+
`).run(u,s,o.agent,o.domain??"general",o.success?1:0,JSON.stringify([{step:1,task:o.taskId,success:o.success}]),k);try{let p=n.prepare(`
|
|
78
78
|
SELECT id, task, agent, success, started_at, completed_at
|
|
79
79
|
FROM captured_experiences
|
|
80
80
|
WHERE consolidated_into IS NULL
|
|
81
81
|
AND task LIKE ?
|
|
82
82
|
AND started_at > datetime('now', '-1 hour')
|
|
83
83
|
ORDER BY started_at ASC
|
|
84
|
-
`).all(`%:${o.taskId}`);if(
|
|
84
|
+
`).all(`%:${o.taskId}`);if(p.length>=2){let T=`traj-multi-${Date.now()}-${B().slice(0,8)}`,D=JSON.stringify(p.map((S,j)=>({step:j+1,task:S.task,agent:S.agent,success:!!S.success,started_at:S.started_at,completed_at:S.completed_at}))),L=p.every(S=>!!S.success);n.prepare(`
|
|
85
85
|
INSERT INTO qe_trajectories (id, task, agent, domain, started_at, ended_at, success, steps_json)
|
|
86
86
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
87
|
-
`).run(T,`multi:${o.taskId}`,o.agent,o.domain??"general",
|
|
87
|
+
`).run(T,`multi:${o.taskId}`,o.agent,o.domain??"general",p[0].started_at,p[p.length-1].completed_at,L?1:0,D);let P=p.map(()=>"?").join(",");n.prepare(`UPDATE captured_experiences SET consolidated_into = ? WHERE id IN (${P})`).run(T,...p.map(S=>S.id)),g=p.length}}catch(p){console.error(C.dim(`[hooks] post-task stitch: ${p instanceof Error?p.message:"unknown"}`))}});try{y()}catch(u){console.error(C.dim(`[hooks] persistTaskOutcome txn: ${u instanceof Error?u.message:"unknown"}`))}if(o.success)try{let u=n.prepare(`
|
|
88
88
|
SELECT id FROM dream_insights
|
|
89
89
|
WHERE actionable = 1 AND (applied = 0 OR applied IS NULL)
|
|
90
90
|
ORDER BY created_at DESC
|
|
91
91
|
LIMIT 3
|
|
92
|
-
`).all();if(u.length>0){let{createDreamEngine:
|
|
92
|
+
`).all();if(u.length>0){let{createDreamEngine:k}=await import("./dream-A5LVJU7T.js"),p=k();await p.initialize();try{for(let T of u){let D=await p.applyInsight(T.id);D.success&&D.patternId&&d++}}finally{await p.close()}}}catch(u){console.error(C.dim(`[hooks] post-task insight apply: ${u instanceof Error?u.message:"unknown"}`))}return(async()=>{try{let{computeRealEmbedding:u}=await import("./real-embeddings-NONEKGAV.js"),k=`${o.domain??"general"}: ${s}`.slice(0,512),p=await u(k);n.prepare("UPDATE captured_experiences SET embedding = ?, embedding_dimension = ? WHERE id = ?").run(Buffer.from(new Float32Array(p).buffer),p.length,r)}catch{}})(),{experienceId:r,qualityScore:h,bridge:l,stitchedSiblings:g,insightsApplied:d}}async function J(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-BEUZQTTC.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}let r=`${o.taskType}|${o.priority}|${o.domain||"any"}`,s=o.agent,a=`q-learning:aqe-hook-router:${r}:${s}`,c=o.success?.1:-1,i=.1,h=.9,l=n.prepare(`
|
|
93
93
|
SELECT q_value FROM rl_q_values WHERE id = ?
|
|
94
|
-
`).get(a),
|
|
94
|
+
`).get(a),g=l&&typeof l.q_value=="number"?l.q_value:0,d=n.prepare(`
|
|
95
95
|
SELECT MAX(q_value) AS m FROM rl_q_values WHERE state_key = ?
|
|
96
|
-
`).get(r),
|
|
96
|
+
`).get(r),y=d&&typeof d.m=="number"?d.m:0,u=g+i*(c+h*y-g);n.prepare(`
|
|
97
97
|
INSERT INTO rl_q_values
|
|
98
98
|
(id, algorithm, agent_id, state_key, action_key, q_value, visits, last_reward, domain, created_at, updated_at)
|
|
99
99
|
VALUES (?, 'q-learning', 'aqe-hook-router', ?, ?, ?, 1, ?, ?, datetime('now'), datetime('now'))
|
|
@@ -102,7 +102,7 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
102
102
|
visits = visits + 1,
|
|
103
103
|
last_reward = excluded.last_reward,
|
|
104
104
|
updated_at = datetime('now')
|
|
105
|
-
`).run(a,r,s,u,c,o.domain||"any")}catch(e){console.error(C.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function re(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-
|
|
105
|
+
`).run(a,r,s,u,c,o.domain||"any")}catch(e){console.error(C.dim(`[hooks] q-learning update: ${e instanceof Error?e.message:"unknown"}`))}}async function re(o){try{let{getUnifiedMemory:e}=await import("./unified-memory-BEUZQTTC.js"),t=e();t.isInitialized()||await t.initialize();let n=t.getDatabase();try{n.pragma("busy_timeout = 60000")}catch{}n.prepare(`
|
|
106
106
|
UPDATE routing_outcomes
|
|
107
107
|
SET success = ?, quality_score = ?, duration_ms = ?
|
|
108
108
|
WHERE id IN (
|
|
@@ -113,7 +113,7 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
113
113
|
ORDER BY (CASE WHEN used_agent = ? THEN 0 ELSE 1 END), created_at DESC
|
|
114
114
|
LIMIT 1
|
|
115
115
|
)
|
|
116
|
-
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(C.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function se(){let{getUnifiedMemory:o}=await import("./unified-memory-
|
|
116
|
+
`).run(o.success?1:0,o.qualityScore,o.durationMs,o.agent)}catch(e){console.error(C.dim(`[hooks] routing UPDATE: ${e instanceof Error?e.message:"unknown"}`))}}async function se(){let{getUnifiedMemory:o}=await import("./unified-memory-BEUZQTTC.js"),e=o();e.isInitialized()||await e.initialize();let t=e.getDatabase();try{t.pragma("busy_timeout = 60000")}catch{}let n=new Set(t.prepare("PRAGMA table_info(captured_experiences)").all().map(i=>i.name)),r=[["consolidated_into","TEXT DEFAULT NULL"],["consolidation_count","INTEGER DEFAULT 1"],["quality_updated_at","TEXT DEFAULT NULL"],["reuse_success_count","INTEGER DEFAULT 0"],["reuse_failure_count","INTEGER DEFAULT 0"]];for(let[i,h]of r)n.has(i)||t.exec(`ALTER TABLE captured_experiences ADD COLUMN ${i} ${h}`);let s=t.prepare(`
|
|
117
117
|
SELECT
|
|
118
118
|
domain,
|
|
119
119
|
agent,
|
|
@@ -129,11 +129,11 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
129
129
|
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
130
130
|
ORDER BY avg_quality DESC
|
|
131
131
|
LIMIT 50
|
|
132
|
-
`).all();if(s.length===0)return 0;let{v4:a}=await import("./dist-node-
|
|
132
|
+
`).all();if(s.length===0)return 0;let{v4:a}=await import("./dist-node-VBNEM6K6.js"),c=0;for(let i of s)try{let h=new Date().toISOString().slice(0,7),l=`${i.agent}-${i.domain}-${h}`,g=t.prepare(`
|
|
133
133
|
SELECT id FROM qe_patterns
|
|
134
134
|
WHERE qe_domain = ? AND name = ?
|
|
135
135
|
LIMIT 1
|
|
136
|
-
`).get(i.domain,l);if(
|
|
136
|
+
`).get(i.domain,l);if(g)t.prepare(`
|
|
137
137
|
UPDATE qe_patterns
|
|
138
138
|
SET usage_count = usage_count + ?,
|
|
139
139
|
successful_uses = successful_uses + ?,
|
|
@@ -141,33 +141,33 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
141
141
|
quality_score = MIN(0.99, quality_score + 0.005),
|
|
142
142
|
updated_at = datetime('now')
|
|
143
143
|
WHERE id = ?
|
|
144
|
-
`).run(i.cnt,i.successes,
|
|
144
|
+
`).run(i.cnt,i.successes,g.id);else{let d=a(),y=Math.min(.95,i.avg_quality*.8+i.success_rate*.2),u=y*.3+Math.min(i.cnt,100)/100*.2+i.success_rate*.5,k=`Auto-consolidated from ${i.cnt} experiences. Agent: ${i.agent}, success rate: ${(i.success_rate*100).toFixed(0)}%`,p=(i.sources||"").split(",").filter(Boolean);t.prepare(`
|
|
145
145
|
INSERT INTO qe_patterns (
|
|
146
146
|
id, pattern_type, qe_domain, domain, name, description,
|
|
147
147
|
confidence, usage_count, success_rate, quality_score, tier,
|
|
148
148
|
template_json, context_json, created_at, successful_uses
|
|
149
149
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
150
|
-
`).run(d,"workflow",i.domain,i.domain,l,y,
|
|
150
|
+
`).run(d,"workflow",i.domain,i.domain,l,k,y,i.cnt,i.success_rate,u,"short-term",JSON.stringify({type:"workflow",content:`${i.agent} pattern for ${i.domain}`,variables:[]}),JSON.stringify({tags:p,sourceType:"session-consolidation",extractedAt:new Date().toISOString()}),i.successes);let{ensurePatternEmbedding:T}=await import("./embed-and-insert-pattern-H6MU5HK4.js");await T(t,d,l,k,p),c++}t.prepare(`
|
|
151
151
|
UPDATE captured_experiences
|
|
152
152
|
SET application_count = application_count + 1
|
|
153
153
|
WHERE domain = ? AND agent = ? AND application_count = 0
|
|
154
|
-
`).run(i.domain,i.agent)}catch{}return c}var
|
|
154
|
+
`).run(i.domain,i.agent)}catch{}return c}var m={reasoningBank:null,hookRegistry:null,coherenceService:null,sessionId:null,initialized:!1,initializationPromise:null};async function ke(){let o=m.reasoningBank;try{o&&await o.dispose()}catch{}try{let{resetSharedRvfDualWriter:e}=await import("./shared-rvf-dual-writer-UQ4O46ZI.js");e()}catch{}try{let{resetSharedRvfAdapter:e}=await import("./shared-rvf-adapter-3HGARKJX.js");e()}catch{}m.reasoningBank=null,m.hookRegistry=null,m.coherenceService=null,m.sessionId=null,m.initialized=!1,m.initializationPromise=null}async function _(){if(m.initializationPromise&&await m.initializationPromise,m.initialized&&m.reasoningBank&&m.hookRegistry)return{reasoningBank:m.reasoningBank,hookRegistry:m.hookRegistry};if(m.initializationPromise=Pe(),await m.initializationPromise,m.initializationPromise=null,!m.reasoningBank||!m.hookRegistry)throw new Error("Failed to initialize hooks system");return{reasoningBank:m.reasoningBank,hookRegistry:m.hookRegistry}}async function Pe(){if(!m.initialized)try{let o=R(),e=ye.join(o,".agentic-qe"),t=await O(e);try{m.coherenceService=await pe(ge),console.log($.dim("[hooks] CoherenceService initialized with WASM engines"))}catch(a){console.log($.dim(`[hooks] CoherenceService WASM unavailable, using fallback: ${a instanceof Error?a.message:"unknown"}`))}m.reasoningBank=ne(t,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0},m.coherenceService??void 0);let n=1e4,r=new AbortController,s=setTimeout(()=>r.abort(new Error("ReasoningBank init timeout")),n);try{await m.reasoningBank.initialize({signal:r.signal})}finally{clearTimeout(s)}try{let{getSharedRvfDualWriter:a}=await import("./shared-rvf-dual-writer-UQ4O46ZI.js"),c=await a();c&&m.reasoningBank.setRvfDualWriter(c)}catch(a){process.env.DEBUG&&console.debug("[hooks] RVF wiring skipped:",a instanceof Error?a.message:a)}m.hookRegistry=he(m.reasoningBank),m.initialized=!0,console.log($.dim("[hooks] System initialized"))}catch(o){console.warn($.yellow(`[hooks] Using fallback mode: ${o instanceof Error?o.message:"unknown error"}`));let e=Ce();m.reasoningBank=ne(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0}),m.hookRegistry=new fe,m.hookRegistry.initialize(m.reasoningBank),m.initialized=!0}}function q(o){try{o.pragma("busy_timeout = 60000")}catch{}}async function O(o){let t=new ue({sqlite:{path:ye.join(o,"memory.db"),walMode:!0,poolSize:3,busyTimeout:6e4},enableFallback:!0,defaultNamespace:"qe-patterns"}),n=new AbortController,r=setTimeout(()=>n.abort(new Error("Backend init timeout")),5e3);try{await t.initialize({signal:n.signal})}finally{clearTimeout(r)}return t}function Ce(){let o=new Map;return{initialize:async()=>{},dispose:async()=>{o.clear()},get:async e=>{let t=o.get(e);return t?t.value:void 0},set:async(e,t,n)=>{o.set(e,{value:t})},delete:async e=>o.delete(e),has:async e=>o.has(e),search:async(e,t)=>{let n=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(n.replace(/\*/g,".*"));return Array.from(o.keys()).filter(s=>r.test(s))},vectorSearch:async(e,t)=>[],storeVector:async(e,t,n)=>{},count:async e=>{let t=0,n=`${e}:`;for(let r of o.keys())r.startsWith(n)&&t++;return t},hasCodeIntelligenceIndex:async()=>{let e="code-intelligence:kg:";for(let t of o.keys())if(t.startsWith(e))return!0;return!1}}}function f(o){console.log(JSON.stringify(o,null,2))}function N(o){console.log($.green("\u2713"),o)}function b(o){console.error($.red("\u2717"),o)}function Z(o){if(o.length===0){console.log($.dim(" No specific guidance"));return}o.forEach((e,t)=>{console.log($.cyan(` ${t+1}.`),e)})}async function H(o=500){return process.stdin.isTTY?"":new Promise(e=>{let t="",n=setTimeout(()=>{process.stdin.removeAllListeners(),process.stdin.pause(),e(t)},o);process.stdin.setEncoding("utf8"),process.stdin.on("data",r=>{t+=r}),process.stdin.on("end",()=>{clearTimeout(n),e(t)}),process.stdin.on("error",()=>{clearTimeout(n),e(t)}),process.stdin.resume()})}function Ee(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return""}let t=e.tool_input,n=e.toolInput,r=[t?.file_path,t?.filePath,n?.file_path,n?.filePath,e.file_path,e.filePath];for(let s of r)if(typeof s=="string"&&s.trim())return s;return""}function Te(o){if(!o.trim())return"";let e;try{e=JSON.parse(o)}catch{return""}let t=e.tool_input,n=e.toolInput,r=[t?.subagent_type,t?.subagentType,n?.subagent_type,n?.subagentType,e.subagent_type,e.subagentType];for(let s of r)if(typeof s=="string"&&s.trim())return s;return""}import I from"chalk";import qe from"node:path";U();function _e(o){o.command("pre-edit").description("Get context and guidance before editing a file").requiredOption("-f, --file <path>","File path to edit").option("-o, --operation <type>","Operation type: create, update, delete, refactor","update").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),r=(await t.emit(v.PreTestGeneration,{targetFile:e.file,testType:"unit",operation:e.operation}))[0]||{success:!0,guidance:[],routing:null};if(e.json){let s=r.guidance||[],c=[r.routing?.recommendedAgent?`Recommended agent: ${r.routing.recommendedAgent} (${(r.routing.confidence*100).toFixed(0)}% confidence).`:"",...s.map(i=>i)].filter(Boolean).join(" ");f({hookSpecificOutput:{hookEventName:"PreToolUse",additionalContext:c||void 0},file:e.file,operation:e.operation,patterns:r.routing?.patterns?.length||0})}else console.log(I.bold(`
|
|
155
155
|
\u{1F4DD} Pre-Edit Analysis`)),console.log(I.dim(` File: ${e.file}`)),console.log(I.dim(` Operation: ${e.operation}`)),r.routing&&(console.log(I.bold(`
|
|
156
156
|
\u{1F3AF} Recommended Agent:`),I.cyan(r.routing.recommendedAgent)),console.log(I.dim(` Confidence: ${(r.routing.confidence*100).toFixed(1)}%`))),console.log(I.bold(`
|
|
157
|
-
\u{1F4A1} Guidance:`)),Z(r.guidance||[]);return}catch(t){throw b(`pre-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("post-edit").description("Record editing outcome for pattern learning").requiredOption("-f, --file <path>","File path that was edited").option("--success","Edit was successful").option("--failure","Edit failed").option("--pattern-id <id>","Pattern ID that was applied").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n=e.success||!e.failure,r=e.file||"";if(!r.trim())try{let
|
|
157
|
+
\u{1F4A1} Guidance:`)),Z(r.guidance||[]);return}catch(t){throw b(`pre-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("post-edit").description("Record editing outcome for pattern learning").requiredOption("-f, --file <path>","File path that was edited").option("--success","Edit was successful").option("--failure","Edit failed").option("--pattern-id <id>","Pattern ID that was applied").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n=e.success||!e.failure,r=e.file||"";if(!r.trim())try{let g=await H();r=Ee(g)}catch{}let s=r.split("/").pop()||"unknown",c=/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(s)?"test-generation":"code-intelligence",i=e.patternId||`edit:${c}:${s}`,l=(await t.emit(v.PostTestGeneration,{targetFile:r,success:n,patternId:i,generatedTests:null,testCount:0}))[0]||{success:!0,patternsLearned:0};try{let{reasoningBank:g}=await _();await g.recordOutcome({patternId:i,success:n,metrics:{executionTimeMs:0},feedback:`Edit ${n?"succeeded":"failed"}: ${r}`})}catch{}try{await W({task:`edit: ${r}`,agent:"cli-hook",domain:c,success:n,source:"cli-hook-post-edit"})}catch{}try{let g=R(),d=qe.join(g,".agentic-qe"),y=await O(d);await x(y)}catch{}e.json?f({success:!0,file:r,editSuccess:n,patternsLearned:l.patternsLearned||0,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):(N(`Recorded edit outcome for ${r||"(unknown file)"}`),l.patternsLearned&&console.log(I.green(` Patterns learned: ${l.patternsLearned}`)));return}catch(t){throw b(`post-edit failed: ${t instanceof Error?t.message:"unknown"}`),t}})}import{randomUUID as je}from"crypto";U();import A from"chalk";import Me from"node:path";function Ue(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 Se(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 H();t=Ue(c)}if(!t.trim())throw new Error("No task provided. Pass --task <description> or pipe a Claude Code hook event JSON to stdin.");let{reasoningBank:n}=await _(),r={task:t,domain:e.domain,capabilities:e.capabilities},s=await n.routeTask(r);if(!s.success)throw new Error(s.error.message);let a=s.value;e.json?f({recommendedAgent:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,domains:a.domains,patternCount:a.patterns.length,guidance:a.guidance,reasoning:a.reasoning,exploration:a.exploration??!1,criticality:a.criticality??null,qWeight:a.qWeight??null}):(console.log(A.bold(`
|
|
158
158
|
\u{1F3AF} Task Routing Result`)),console.log(A.dim(` Task: "${t}"`)),console.log(A.bold(`
|
|
159
159
|
\u{1F464} Recommended Agent:`),A.cyan(a.recommendedAgent)),console.log(A.dim(` Confidence: ${(a.confidence*100).toFixed(1)}%`)),a.alternatives.length>0&&(console.log(A.bold(`
|
|
160
160
|
\u{1F504} Alternatives:`)),a.alternatives.forEach(c=>{console.log(A.dim(` - ${c.agent}: ${(c.score*100).toFixed(1)}%`))})),console.log(A.bold(`
|
|
161
161
|
\u{1F4C2} Detected Domains:`),a.domains.join(", ")),console.log(A.bold(`
|
|
162
162
|
\u{1F4A1} Guidance:`)),Z(a.guidance),console.log(A.bold(`
|
|
163
|
-
\u{1F4D6} Reasoning:`),A.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-
|
|
163
|
+
\u{1F4D6} Reasoning:`),A.dim(a.reasoning)));try{let{getUnifiedMemory:c}=await import("./unified-memory-BEUZQTTC.js"),i=c();i.isInitialized()||await i.initialize();let h=i.getDatabase();q(h),Y(h);let l=`route-${Date.now()}-${je().slice(0,8)}`,g=a.confidence<.5,d=a;h.prepare(`
|
|
164
164
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
165
165
|
id, task_json, decision_json, used_agent,
|
|
166
166
|
followed_recommendation, success, quality_score,
|
|
167
167
|
duration_ms, error,
|
|
168
168
|
exploration, criticality, q_weight
|
|
169
169
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
170
|
-
`).run(l,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:
|
|
170
|
+
`).run(l,JSON.stringify({description:t,domain:e.domain}),JSON.stringify({recommended:a.recommendedAgent,confidence:a.confidence,alternatives:a.alternatives,lowConfidence:g,exploration:d.exploration??!1,criticality:d.criticality??null,qWeight:d.qWeight??null}),a.recommendedAgent,1,0,-1,0,g?"low-confidence":null,d.exploration?1:0,d.criticality??null,d.qWeight??null);let y=R(),u=Me.join(y,".agentic-qe"),k=await O(u);await x(k)}catch(c){console.error(A.dim(`[hooks] route persist: ${c instanceof Error?c.message:"unknown"}`))}return}catch(t){throw b(`route failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("post-route").description("Close the most-recent route sentinel from a Stop hook (#451)").option("--success [bool]","Whether the turn completed successfully","true").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=.325+(t?.25:0)+.1,r=M();r.isInitialized()||await r.initialize();let s=r.getDatabase();q(s);let a=s.prepare(`
|
|
171
171
|
SELECT id, task_json, used_agent FROM routing_outcomes
|
|
172
172
|
WHERE quality_score = -1
|
|
173
173
|
AND task_json NOT LIKE '%"taskId"%'
|
|
@@ -186,7 +186,7 @@ import{a as v,b as fe,c as he}from"./chunk-EAKHU5YX.js";import{a as pe,b as ge}f
|
|
|
186
186
|
WHERE quality_score = -1
|
|
187
187
|
AND task_json NOT LIKE '%"taskId"%'
|
|
188
188
|
AND created_at < datetime('now', '-300 seconds')
|
|
189
|
-
`).run();e.json?f({success:!0,resolved:c.changes>0,staleSwept:i.changes,qualityScore:n,turnSuccess:t}):i.changes>0&&console.log(A.dim(`[hooks] post-route: swept ${i.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(A.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import E from"chalk";
|
|
189
|
+
`).run();e.json?f({success:!0,resolved:c.changes>0,staleSwept:i.changes,qualityScore:n,turnSuccess:t}):i.changes>0&&console.log(A.dim(`[hooks] post-route: swept ${i.changes} stale sentinel(s)`));return}catch(t){e.json?f({success:!1,error:t instanceof Error?t.message:"unknown"}):console.error(A.dim(`[hooks] post-route: ${t instanceof Error?t.message:"unknown"}`));return}})}import E from"chalk";Le();function be(o){o.command("stats").description("Display hooks system statistics").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.getStats();if(e.json)f(n);else{console.log(E.bold(`
|
|
190
190
|
\u{1F4CA} Hooks System Statistics
|
|
191
191
|
`)),console.log(E.bold("Patterns:")),console.log(` Total: ${E.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(E.bold(`
|
|
192
192
|
By Domain:`));for(let[r,s]of Object.entries(n.byDomain))s>0&&console.log(` ${r}: ${s}`);console.log(E.bold(`
|
|
@@ -198,8 +198,8 @@ Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOp
|
|
|
198
198
|
Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("emit").description("Emit a QE hook event").requiredOption("-e, --event <name>","Event name (e.g., qe:pattern-applied)").option("-d, --data <json>","Event data as JSON","{}").option("--json","Output as JSON").action(async e=>{try{let{hookRegistry:t}=await _(),n;try{n=le(e.data)}catch{throw new Error(`Invalid JSON data: ${e.data}`)}let r=await t.emit(e.event,n);e.json?f({event:e.event,results:r}):(console.log(E.bold(`
|
|
199
199
|
\u{1F4E1} Hook Event Emitted`)),console.log(E.dim(` Event: ${e.event}`)),console.log(E.dim(` Handlers: ${r.length}`)),r.forEach((s,a)=>{let c=s.success?E.green("\u2713"):E.red("\u2717");console.log(` ${c} Handler ${a+1}: ${s.success?"success":s.error}`),s.patternsLearned&&console.log(E.green(` Patterns learned: ${s.patternsLearned}`))}))}catch(t){throw b(`emit failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("learn").description("Store a new pattern in the reasoning bank").requiredOption("-n, --name <name>","Pattern name").requiredOption("-d, --description <desc>","Pattern description").option("-t, --type <type>","Pattern type","test-template").option("--domain <domain>","QE domain").option("--tags <tags...>","Pattern tags").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.storePattern({patternType:e.type,name:e.name,description:e.description,template:{type:"prompt",content:e.description,variables:[]},context:{tags:e.tags||[]}});if(!n.success)throw new Error(n.error.message);let r=n.value;e.json?f({success:!0,pattern:{id:r.id,name:r.name,type:r.patternType,domain:r.qeDomain}}):(N(`Pattern stored: ${r.name}`),console.log(E.dim(` ID: ${r.id}`)),console.log(E.dim(` Domain: ${r.qeDomain}`)),console.log(E.dim(` Tier: ${r.tier}`)))}catch(t){throw b(`learn failed: ${t instanceof Error?t.message:"unknown"}`),t}}),o.command("search").description("Search for patterns in the reasoning bank").requiredOption("-q, --query <query>","Search query").option("-l, --limit <n>","Maximum results","10").option("-d, --domain <domain>","Filter by domain").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=await t.searchPatterns(e.query,{limit:parseInt(e.limit,10),domain:e.domain});if(!n.success)throw new Error(n.error.message);let r=n.value;e.json?f({query:e.query,total:r.length,patterns:r.map(s=>({id:s.pattern.id,name:s.pattern.name,score:s.score,domain:s.pattern.qeDomain,matchType:s.matchType}))}):(console.log(E.bold(`
|
|
200
200
|
\u{1F50D} Search Results for "${e.query}"
|
|
201
|
-
`)),r.length===0?console.log(E.dim(" No patterns found")):r.forEach((s,a)=>{console.log(`${E.cyan(`${a+1}.`)} ${s.pattern.name} ${E.dim(`(${(s.score*100).toFixed(1)}%)`)}`),console.log(E.dim(` Domain: ${s.pattern.qeDomain}`)),console.log(E.dim(` Match: ${s.matchType}`)),console.log(E.dim(` ID: ${s.pattern.id}`)),console.log()}),console.log(E.dim(`Found ${r.length} pattern(s)`)))}catch(t){throw b(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}U();import Q from"chalk";import
|
|
202
|
-
`)){let t=e.match(/^(?:export\s+)?NAGUAL_CLOUD_KEY=(.+)/);if(t)return t[1].trim().replace(/^['"]|['"]$/g,"")}}catch{}}var
|
|
201
|
+
`)),r.length===0?console.log(E.dim(" No patterns found")):r.forEach((s,a)=>{console.log(`${E.cyan(`${a+1}.`)} ${s.pattern.name} ${E.dim(`(${(s.score*100).toFixed(1)}%)`)}`),console.log(E.dim(` Domain: ${s.pattern.qeDomain}`)),console.log(E.dim(` Match: ${s.matchType}`)),console.log(E.dim(` ID: ${s.pattern.id}`)),console.log()}),console.log(E.dim(`Found ${r.length} pattern(s)`)))}catch(t){throw b(`search failed: ${t instanceof Error?t.message:"unknown"}`),t}})}U();import Q from"chalk";import Be from"node:path";function we(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()}`;m.sessionId=t;let{reasoningBank:n}=await _(),r=await n.getStats(),s=R(),a=Be.join(s,".agentic-qe"),c=await O(a),i=await c.get(F),h=!i||!i.sessionStartTime;i?(i.sessionStartTime=new Date().toISOString(),i.totalDreamsThisSession=0):i={lastDreamTime:null,experienceCount:0,sessionStartTime:new Date().toISOString(),totalDreamsThisSession:0},await c.set(F,i);let l=[];l.push(`AQE Learning: ${r.totalPatterns} patterns loaded`);let g=Object.entries(r.byDomain).filter(([,y])=>y>0).sort(([,y],[,u])=>u-y).slice(0,5);g.length>0&&l.push(`Top domains: ${g.map(([y,u])=>`${y}(${u})`).join(", ")}`),r.patternSuccessRate>0&&l.push(`Pattern success rate: ${(r.patternSuccessRate*100).toFixed(0)}%`),r.routingRequests>0&&l.push(`Routing confidence: ${(r.avgRoutingConfidence*100).toFixed(0)}% across ${r.routingRequests} requests`);let d=l.join(". ")+".";e.json?f({hookSpecificOutput:{hookEventName:"SessionStart",additionalContext:d},sessionId:t,initialized:!0,patternsLoaded:r.totalPatterns,dreamScheduler:{enabled:!0,lastDreamTime:i.lastDreamTime,pendingExperiences:i.experienceCount}}):(N(`Session started: ${t}`),console.log(Q.dim(` Patterns loaded: ${r.totalPatterns}`)),console.log(Q.dim(` Dream scheduler: enabled (${i.experienceCount} pending experiences)`)));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("session-end").description("Save session state when Claude Code session ends").option("--save-state","Save learning state to disk").option("--export-metrics","Export session metrics").option("--json","Output as JSON").action(async e=>{try{let t=m.sessionId||"unknown",n=null;if(m.initialized&&m.reasoningBank)try{n=await m.reasoningBank.getStats()}catch{}let r=0;try{r=await se()}catch{}if(e.json){let s=n?`Session complete: ${n.totalPatterns} patterns, ${n.routingRequests} routings, ${(n.patternSuccessRate*100).toFixed(0)}% success rate`:"Session complete";f({continue:!0,sessionId:t,stateSaved:e.saveState||!1,metricsExported:e.exportMetrics||!1,patternsConsolidated:r,finalStats:n?{patternsLearned:n.totalPatterns,routingRequests:n.routingRequests,successRate:n.patternSuccessRate}:null})}else N(`Session ended: ${t}`),n&&(console.log(Q.dim(` Patterns: ${n.totalPatterns}`)),console.log(Q.dim(` Routing requests: ${n.routingRequests}`))),r>0&&console.log(Q.dim(` Patterns consolidated: ${r}`));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{createHash as Qe,randomUUID as Ve}from"node:crypto";import w from"chalk";import Xe from"node:path";U();Ie();import{readFileSync as Fe}from"node:fs";import{homedir as He}from"node:os";var ee=de.create("nagual-client");function ze(){try{let o=Fe(`${He()}/.nagual/cloud-hooks.env`,"utf8");for(let e of o.split(`
|
|
202
|
+
`)){let t=e.match(/^(?:export\s+)?NAGUAL_CLOUD_KEY=(.+)/);if(t)return t[1].trim().replace(/^['"]|['"]$/g,"")}}catch{}}var Ge="http://localhost:3333",Re=3e3,We=5e3;var ie=class{baseUrl;token;enabled;constructor(){this.baseUrl=process.env.NAGUAL_URL??Ge,this.token=process.env.NAGUAL_CLOUD_KEY??process.env.NAGUAL_API_TOKEN??ze(),this.enabled=!0}async search(e,t,n=5){try{let r=await fetch(`${this.baseUrl}/api/patterns/search`,{method:"POST",headers:this.headers(),body:JSON.stringify({query:e,domain:t,limit:n}),signal:AbortSignal.timeout(Re)});return r.ok?(await r.json()).patterns??[]:[]}catch{return[]}}async recordOutcome(e,t){try{let n=await fetch(`${this.baseUrl}/api/patterns/${encodeURIComponent(e)}/outcome`,{method:"POST",headers:this.headers(),body:JSON.stringify(t),signal:AbortSignal.timeout(Re)});n.ok||ee.debug("nagual recordOutcome non-OK",{patternId:e,status:n.status})}catch(n){ee.debug("nagual recordOutcome failed (non-fatal)",{patternId:e,err:n})}}async promotePattern(e){let t={problem:e.problem,solution:e.solution,domain:e.domain,reward:e.reward*.8,tags:[...e.tags??[],"source:aqe",e.source_project?`project:${e.source_project}`:null].filter(n=>n!==null)};try{let n=await fetch(`${this.baseUrl}/api/patterns`,{method:"POST",headers:this.headers(),body:JSON.stringify(t),signal:AbortSignal.timeout(We)});n.ok||ee.debug("nagual promotePattern non-OK",{status:n.status})}catch(n){ee.debug("nagual promotePattern failed (non-fatal)",{err:n})}}headers(){let e={"Content-Type":"application/json"};return this.token&&(e.Authorization=`Bearer ${this.token}`),e}},ae;function Ae(){return ae||(ae=new ie),ae}var Je=/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/;function ve(o,e){let t={};if(o!==void 0){if(!Je.test(o))return{error:`Invalid --parent-agent-id "${o}": must start with a letter or digit and contain only letters, digits, "_", ".", ":", "-" (max 128 chars)`};t.parentAgentId=o}if(e!==void 0){let n=typeof e=="number"?e:Number(e);if(!Number.isInteger(n))return{error:`Invalid --depth "${e}": must be an integer`};if(n<0)return{error:`Invalid --depth ${n}: must be >= 0`};if(n>32)return{error:`Invalid --depth ${n}: must be <= 32`};t.depth=n}return t}var Ke="task-bridge",Ye=6e5,Oe=.5;function Ze(o){return Qe("sha256").update(o).digest("hex").slice(0,16)}var et=new Set(["test-generation","coverage-analysis","defect-intelligence","security-compliance","quality-assessment","requirements-validation"]),tt=80;async function nt(o,e){return!process.env.NAGUAL_URL&&!process.env.NAGUAL_CLOUD_URL&&!process.env.NAGUAL_CLOUD_KEY?[]:o.length<tt?[]:e&&!et.has(e)?[]:Ae().search(o.slice(0,300),e,3)}function Ne(o){o.command("pre-task").description("Get context and guidance before spawning a Task agent").option("--task-id <id>","Task identifier").option("-d, --description <desc>","Task description").option("--json","Output as JSON").action(async e=>{try{let{reasoningBank:t}=await _(),n=null;if(e.description){let d=await t.routeTask({task:e.description});d.success&&(n=d.value)}let r=(n?.patterns??[]).slice(0,5).map(d=>d?.id).filter(d=>typeof d=="string"),s=n?.domains?.[0],a=e.description?await nt(String(e.description),s):[],c=null,i=[],h=0,l=null;try{let d=M();d.isInitialized()||await d.initialize();let y=d.getDatabase();q(y);try{let u=y.prepare(`
|
|
203
203
|
SELECT used_agent AS agent,
|
|
204
204
|
ROUND(AVG(quality_score), 3) AS avgQuality,
|
|
205
205
|
COUNT(*) AS n
|
|
@@ -208,37 +208,37 @@ Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list fail
|
|
|
208
208
|
GROUP BY used_agent
|
|
209
209
|
ORDER BY avgQuality DESC, n DESC
|
|
210
210
|
LIMIT 1
|
|
211
|
-
`).get();u&&(c=u)}catch{}try{i=
|
|
211
|
+
`).get();u&&(c=u)}catch{}try{i=y.prepare(`
|
|
212
212
|
SELECT key, value
|
|
213
213
|
FROM kv_store
|
|
214
214
|
WHERE namespace = 'verdicts'
|
|
215
215
|
AND created_at > datetime('now', '-7 days')
|
|
216
216
|
ORDER BY created_at DESC
|
|
217
217
|
LIMIT 3
|
|
218
|
-
`).all().map(
|
|
218
|
+
`).all().map(k=>({key:k.key,summary:String(k.value).slice(0,200)}))}catch{}if(r.length>0)try{let u=r.map(()=>"?").join(","),k=y.prepare(`
|
|
219
219
|
SELECT COALESCE(SUM(average_token_savings), 0) AS sum
|
|
220
220
|
FROM qe_patterns
|
|
221
221
|
WHERE id IN (${u})
|
|
222
|
-
`).get(...r);h=Math.max(0,Math.round(
|
|
222
|
+
`).get(...r);h=Math.max(0,Math.round(k?.sum??0))}catch{}if(e.description)try{let u=String(e.description),k=G(u),p="normal",T=n?.domains?.[0]??"any",D=Math.max(0,Math.min(10,Math.round(Math.min(u.length/200,1)*10)));l=`task:${Ze(u)}`;let L=JSON.stringify({selectedPatternIds:r,agent:n?.recommendedAgent??null,description:u.slice(0,200),taskType:k,priority:p,domain:T,complexityBucket:D,estimatedTokenSavings:h,ts:Date.now()}),P=Date.now()+Ye;y.prepare(`
|
|
223
223
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at, created_at)
|
|
224
224
|
VALUES (?, ?, ?, ?, strftime('%s','now')*1000)
|
|
225
|
-
`).run(l,
|
|
225
|
+
`).run(l,Ke,L,P)}catch(u){console.error(w.dim(`[hooks] pre-task bridge: ${u instanceof Error?u.message:"unknown"}`))}if(n?.recommendedAgent)try{Y(y);let u=e.taskId||`hook-${Date.now()}`,k=`route-${Date.now()}-${Ve().slice(0,8)}`,p=n.confidence<Oe,T=n;y.prepare(`
|
|
226
226
|
INSERT INTO routing_outcomes (
|
|
227
227
|
id, task_json, decision_json, used_agent,
|
|
228
228
|
followed_recommendation, success, quality_score,
|
|
229
229
|
duration_ms, error,
|
|
230
230
|
exploration, criticality, q_weight
|
|
231
231
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
232
|
-
`).run(
|
|
232
|
+
`).run(k,JSON.stringify({description:e.description,taskId:u}),JSON.stringify({recommended:n.recommendedAgent,confidence:n.confidence,alternatives:n.alternatives,lowConfidence:p,exploration:T.exploration??!1,criticality:T.criticality??null,qWeight:T.qWeight??null}),n.recommendedAgent,1,0,-1,0,p?"low-confidence":null,T.exploration?1:0,T.criticality??null,T.qWeight??null)}catch(u){console.error(w.dim(`[hooks] pre-task sentinel: ${u instanceof Error?u.message:"unknown"}`))}}catch(d){console.error(w.dim(`[hooks] pre-task memory: ${d instanceof Error?d.message:"unknown"}`))}let g=n?n.confidence<Oe:!1;if(e.json)f({success:!0,taskId:e.taskId,description:e.description,recommendedAgent:n?.recommendedAgent,confidence:n?.confidence,guidance:n?.guidance||[],selectedPatternIds:r,historicalBest:c,priorVerdicts:i,estimatedTokenSavings:h,lowConfidence:g,bridgeKey:l,nagualPatterns:a.map(d=>({id:d.id,problem:d.problem,solution:d.solution.slice(0,400),domain:d.domain,reward:d.reward}))});else if(console.log(w.bold(`
|
|
233
233
|
\u{1F680} Pre-Task Analysis`)),console.log(w.dim(` Task ID: ${e.taskId||"N/A"}`)),n&&(console.log(w.bold(`
|
|
234
|
-
\u{1F3AF} Recommended:`),w.cyan(n.recommendedAgent)),console.log(w.dim(` Confidence: ${(n.confidence*100).toFixed(1)}%`)),
|
|
235
|
-
\u{1F4DA} Nagual context (cross-project):`));for(let d of a)console.log(w.dim(` [${d.domain}] ${d.problem.slice(0,80)} (reward: ${d.reward.toFixed(2)})`))}return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success [bool]","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("-d, --description <desc>","Task description \u2014 fallback Q-state source when pre-task bridge is absent (issue #499)").option("--parent-agent-id <id>","Agent that spawned this task (ADR-101 nesting provenance)").option("--depth <n>","Nesting depth of this task, 0 = top-level (ADR-101)").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0;if(!e.agent||!String(e.agent).trim())try{let s=await
|
|
234
|
+
\u{1F3AF} Recommended:`),w.cyan(n.recommendedAgent)),console.log(w.dim(` Confidence: ${(n.confidence*100).toFixed(1)}%`)),g&&console.log(w.yellow(" \u26A0 Low confidence \u2014 consider providing more context"))),a.length>0){console.log(w.bold(`
|
|
235
|
+
\u{1F4DA} Nagual context (cross-project):`));for(let d of a)console.log(w.dim(` [${d.domain}] ${d.problem.slice(0,80)} (reward: ${d.reward.toFixed(2)})`))}return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}}),o.command("post-task").description("Record task outcome for pattern learning").option("--task-id <id>","Task identifier").option("--success [bool]","Whether task succeeded","true").option("--agent <name>","Agent that executed the task").option("--duration <ms>","Task duration in milliseconds").option("-d, --description <desc>","Task description \u2014 fallback Q-state source when pre-task bridge is absent (issue #499)").option("--parent-agent-id <id>","Agent that spawned this task (ADR-101 nesting provenance)").option("--depth <n>","Nesting depth of this task, 0 = top-level (ADR-101)").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0;if(!e.agent||!String(e.agent).trim())try{let s=await H(),a=Te(s);a&&(e.agent=a)}catch{}let n=ve(e.parentAgentId,e.depth);if(n.error){e.json?console.log(JSON.stringify({success:!1,error:n.error})):console.error(w.red(` \u2717 ${n.error}`)),process.exitCode=1;return}let r=0;try{let{hookRegistry:s,reasoningBank:a}=await _();r=(await s.emit(v.QEAgentCompletion,{taskId:e.taskId,success:t,agent:e.agent,duration:e.duration?parseInt(e.duration,10):void 0,timestamp:Date.now()})).reduce((g,d)=>g+(d.patternsLearned||0),0);{let g=e.taskId||`hook-${Date.now()}`,d=e.agent||"unknown",y=e.duration?parseInt(e.duration,10):0,u=(n.parentAgentId?`, Parent: ${n.parentAgentId}`:"")+(n.depth!==void 0?`, Depth: ${n.depth}`:"");await a.recordOutcome({patternId:`task:${d}:${g}`,success:t,metrics:{executionTimeMs:y},feedback:`Agent: ${d}, Task: ${g}${u}`});let k=await oe({taskId:g,agent:d,durationMs:y,success:t,parentAgentId:n.parentAgentId,depth:n.depth}),p=d==="unknown"&&k.bridge?.agent?k.bridge.agent:d;await re({agent:p,success:t,durationMs:y,qualityScore:k.qualityScore});let T=String(e.description??"");if(k.bridge||T){let D=k.bridge?.taskType??G(T),L=k.bridge?.priority??"normal",P=k.bridge?.domain??K(T)[0]??"any";await J({taskType:D,priority:L,domain:P,agent:p,success:t})}}let i=R(),h=Xe.join(i,".agentic-qe"),l=await O(h);await x(l)}catch(s){console.error(w.dim(`[hooks] Learning init: ${s instanceof Error?s.message:"unknown"}`))}e.json?f({success:!0,taskId:e.taskId,taskSuccess:t,patternsLearned:r,dreamTriggered:!1,dreamReason:"deferred-to-kernel"}):(N(`Task completed: ${e.taskId||"unknown"}`),console.log(w.dim(` Success: ${t}`)),r>0&&console.log(w.green(` Patterns learned: ${r}`)));return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}import{existsSync as ot,readFileSync as rt}from"node:fs";import{randomUUID as De}from"node:crypto";import X from"chalk";import xe from"node:path";U();import*as z from"fs";import*as te from"path";var V=class o{statePath;warnThreshold;blockThreshold;halfOpenAfterMs;staleAfterMs;constructor(e){this.statePath=e.statePath,this.warnThreshold=e.warnThreshold??3,this.blockThreshold=e.blockThreshold??5,this.halfOpenAfterMs=e.halfOpenAfterMs??12e4,this.staleAfterMs=e.staleAfterMs??30*6e4}static signature(e){return e.trim().replace(/\s+/g," ").slice(0,200)}check(e,t=Date.now()){let n=o.signature(e);if(!n)return{verdict:"allow",consecutiveFailures:0,halfOpen:!1};let r=this.readState()[n];if(!r||r.consecutiveFailures<this.warnThreshold)return{verdict:"allow",consecutiveFailures:r?.consecutiveFailures??0,halfOpen:!1};let s=r.consecutiveFailures;return s>=this.blockThreshold?t-r.lastFailureAt>=this.halfOpenAfterMs?{verdict:"warn",consecutiveFailures:s,halfOpen:!0,hint:`This command has failed ${s}x consecutively; allowing one probe attempt. If it fails again it will be flagged immediately.`}:{verdict:"block",consecutiveFailures:s,halfOpen:!1,hint:`The same command failed ${s}x consecutively. Re-running it unchanged is unlikely to succeed \u2014 inspect the error output, change the approach, or fix the underlying problem first. (A successful run resets this breaker.)`}:{verdict:"warn",consecutiveFailures:s,halfOpen:!1,hint:`This command has failed ${s}x consecutively \u2014 consider changing approach before retrying.`}}record(e,t,n=Date.now()){let r=o.signature(e);if(r)try{let s=this.readState();if(t){s[r]&&(delete s[r],this.writeState(s,n));return}let a=s[r]??{consecutiveFailures:0,lastFailureAt:n};a.consecutiveFailures+=1,a.lastFailureAt=n,s[r]=a,this.writeState(s,n)}catch{}}static isStrict(e=process.env){return e.AQE_STRICT_TOOL_LOOP==="1"||e.AQE_STRICT_TOOL_LOOP==="true"}readState(){try{let e=z.readFileSync(this.statePath,"utf8"),t=JSON.parse(e);return typeof t=="object"&&t!==null?t:{}}catch{return{}}}writeState(e,t){for(let[n,r]of Object.entries(e))t-r.lastFailureAt>this.staleAfterMs&&delete e[n];z.mkdirSync(te.dirname(this.statePath),{recursive:!0}),z.writeFileSync(this.statePath,JSON.stringify(e))}};function ce(o){return new V({statePath:te.join(o,".agentic-qe","tool-loop-state.json")})}function st(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 at(o){try{let e=M();e.isInitialized()||await e.initialize();let t=e.getDatabase();q(t);let n=o.framework==="pytest"?"python":"javascript",r=o.command.split(/\s+/).slice(0,3).join("-").slice(0,80);t.prepare(`
|
|
236
236
|
INSERT INTO test_outcomes (
|
|
237
237
|
id, test_id, test_name, generated_by, framework, language, domain,
|
|
238
238
|
passed, execution_time_ms, maintainability_score, created_at
|
|
239
239
|
) VALUES (?, ?, ?, 'cli-hook-post-command', ?, ?, 'test-execution',
|
|
240
240
|
?, ?, 0.5, datetime('now'))
|
|
241
|
-
`).run(`to-${Date.now()}-${
|
|
241
|
+
`).run(`to-${Date.now()}-${De().slice(0,8)}`,`cmd:${r}`,o.command.slice(0,200),o.framework,n,o.success?1:0,o.durationMs);try{let s=xe.join(process.cwd(),"coverage","coverage-summary.json");if(ot(s)){let c=JSON.parse(rt(s,"utf-8")).total??{},i=Number(c.lines?.pct??0),h=Number(c.branches?.pct??0),l=Number(c.functions?.pct??0),g=t.prepare(`
|
|
242
242
|
SELECT after_lines, after_branches, after_functions
|
|
243
243
|
FROM coverage_sessions
|
|
244
244
|
WHERE target_path = ?
|
|
@@ -252,8 +252,8 @@ Registered: ${n.length}/${Object.keys(v).length}`))}}catch(t){throw b(`list fail
|
|
|
252
252
|
tests_generated, tests_passed, duration_ms,
|
|
253
253
|
started_at, completed_at
|
|
254
254
|
) VALUES (?, ?, 'cli-hook-post-command', ?, ?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?)
|
|
255
|
-
`).run(`cs-${Date.now()}-${
|
|
256
|
-
\u26A0\uFE0F Command Warnings:`)),a.forEach(i=>console.log(X.yellow(` - ${i}`))));return}catch{e.json&&f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),o.command("post-command").description("Record Bash command outcome").option("-c, --command <cmd>","Command that was executed").option("--success [bool]","Whether command succeeded","true").option("--exit-code <code>","Command exit code").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=e.exitCode?parseInt(e.exitCode,10):t?0:1,r=(e.command||"").substring(0,200);try{ce(R()).record(r,t)}catch{}let s=/\b(test|vitest|jest|pytest|mocha)\b/i.test(r),a=/\b(build|compile|tsc)\b/i.test(r),c=/\b(lint|eslint|prettier)\b/i.test(r),i=0,h=!1;try{let{reasoningBank:l}=await _();if(s){let{hookRegistry:T}=await _();await T.emit(v.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${r.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let
|
|
255
|
+
`).run(`cs-${Date.now()}-${De().slice(0,8)}`,process.cwd(),o.framework,g?.after_lines??0,g?.after_branches??0,g?.after_functions??0,i,h,l,o.success?1:0,o.durationMs,d,d)}}catch(s){console.error(X.dim(`[hooks] coverage_sessions: ${s instanceof Error?s.message:"unknown"}`))}}catch(e){console.error(X.dim(`[hooks] test_outcomes: ${e instanceof Error?e.message:"unknown"}`))}}function $e(o){o.command("guard").description("File guardian - block edits to protected files").requiredOption("-f, --file <path>","File path to check").option("--json","Output as JSON (required for hook API)").action(async e=>{try{let t=e.file||"",n=t.replace(/\\/g,"/"),s=[{pattern:/^\.env($|\.)/,reason:"Environment file contains secrets"},{pattern:/\.env\.[a-zA-Z]+$/,reason:"Environment file contains secrets"},{pattern:/\.lock$/,reason:"Lock files are auto-generated"},{pattern:/(^|\/)node_modules\//,reason:"node_modules is managed by package manager"},{pattern:/(^|\/)\.agentic-qe\/memory\.db/,reason:"AQE memory database must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-wal$/,reason:"AQE WAL file must not be directly edited"},{pattern:/(^|\/)\.agentic-qe\/memory\.db-shm$/,reason:"AQE shared memory file must not be directly edited"}].find(a=>a.pattern.test(n));s?e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Protected file: ${s.reason} (${t})`}}):b(`Blocked: ${s.reason} (${t})`):e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}}):N(`Allowed: ${t}`);return}catch{e.json&&f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),o.command("pre-command").description("Get context before executing a Bash command").option("-c, --command <cmd>","Command to be executed").option("--json","Output as JSON").action(async e=>{try{let t=e.command||"",n=[{pattern:/rm\s+(-[a-zA-Z]*f[a-zA-Z]*\s+)?-[a-zA-Z]*r[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+(-[a-zA-Z]*r[a-zA-Z]*\s+)?-[a-zA-Z]*f[a-zA-Z]*\s+\/(?!\w)/,reason:"Recursive delete of root filesystem"},{pattern:/rm\s+-rf\s+~/,reason:"Recursive delete of home directory"},{pattern:/DROP\s+(TABLE|DATABASE|SCHEMA)/i,reason:"Destructive SQL operation"},{pattern:/git\s+push\s+.*--force(?!-)/,reason:"Force push can overwrite remote history"},{pattern:/git\s+reset\s+--hard/,reason:"Hard reset discards uncommitted changes"},{pattern:/>\s*\/dev\/sd[a-z]/,reason:"Direct write to block device"},{pattern:/dd\s+if=.*of=\/dev\/sd/,reason:"Direct disk write via dd"},{pattern:/chmod\s+777\s/,reason:"World-writable permissions are a security risk"},{pattern:/:\(\)\s*\{\s*:\|\s*:&\s*\}\s*;?\s*:/,reason:"Fork bomb detected"},{pattern:/mkfs\./,reason:"Filesystem format operation"},{pattern:/>\s*\/dev\/null\s*2>&1\s*&\s*disown/,reason:"Stealth background process"}],r=[{pattern:/\.agentic-qe.*rm/,reason:"Deleting AQE data files"},{pattern:/rm\s+-rf\s/,reason:"Recursive force delete"},{pattern:/git\s+clean\s+-[a-zA-Z]*f/,reason:"Force cleaning untracked files"}],s=n.find(i=>i.pattern.test(t)),a=r.filter(i=>i.pattern.test(t)).map(i=>i.reason),c=null;try{c=ce(R()).check(t)}catch{}if(c&&c.verdict==="block"&&V.isStrict()){e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Tool-loop breaker (AQE_STRICT_TOOL_LOOP): ${c.hint}`}}):b(`Blocked by tool-loop breaker: ${c.hint}`);return}if(c&&c.verdict==="block"?a.push(`\u{1F6D1} TOOL-LOOP BREAKER: ${c.hint}`):c&&c.verdict==="warn"&&a.push(`Tool-loop breaker: ${c.hint}`),s)e.json?f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:`Dangerous command blocked: ${s.reason}`}}):b(`Blocked: ${s.reason}`);else if(e.json){let i={hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}};a.length>0&&(i.hookSpecificOutput.additionalContext=`Warnings: ${a.join("; ")}`),f(i)}else a.length>0&&(console.log(X.yellow(`
|
|
256
|
+
\u26A0\uFE0F Command Warnings:`)),a.forEach(i=>console.log(X.yellow(` - ${i}`))));return}catch{e.json&&f({hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"allow"}});return}}),o.command("post-command").description("Record Bash command outcome").option("-c, --command <cmd>","Command that was executed").option("--success [bool]","Whether command succeeded","true").option("--exit-code <code>","Command exit code").option("--json","Output as JSON").action(async e=>{try{let t=e.success==="true"||e.success===!0,n=e.exitCode?parseInt(e.exitCode,10):t?0:1,r=(e.command||"").substring(0,200);try{ce(R()).record(r,t)}catch{}let s=/\b(test|vitest|jest|pytest|mocha)\b/i.test(r),a=/\b(build|compile|tsc)\b/i.test(r),c=/\b(lint|eslint|prettier)\b/i.test(r),i=0,h=!1;try{let{reasoningBank:l}=await _();if(s){let{hookRegistry:T}=await _();await T.emit(v.TestExecutionResult,{runId:`cmd-${Date.now()}`,patternId:`cmd:test:${r.split(/\s+/).slice(0,3).join("-")}`,passed:t?1:0,failed:t?0:1,duration:0,flaky:!1})}let g=r.replace(/[^a-zA-Z0-9]/g,"-").slice(0,80),d=s?"test-execution":a?"code-intelligence":c?"quality-assessment":"code-intelligence";await l.recordOutcome({patternId:`cmd:${g}`,success:t,metrics:{executionTimeMs:0},feedback:`Command: ${r}, exit: ${n}`}),i=1,(s||a||c)&&(await W({task:`bash: ${r}`,agent:"cli-hook",domain:d,success:t,source:"cli-hook-post-command"}),h=!0);let y=st(r);y&&await at({command:r,framework:y,success:t,durationMs:0});let u=R(),k=xe.join(u,".agentic-qe"),p=await O(k);await x(p)}catch(l){console.error(X.dim(`[hooks] post-command learning: ${l instanceof Error?l.message:"unknown"}`))}e.json&&f({success:!0,command:r.substring(0,100),commandSuccess:t,exitCode:n,patternsLearned:i,experienceRecorded:h});return}catch(t){e.json&&f({success:!1,error:t instanceof Error?t.message:"unknown"});return}})}function In(){let o=new it("hooks").description("Self-learning QE hooks for pattern recognition and guidance").addHelpText("after",`
|
|
257
257
|
Examples:
|
|
258
258
|
# File editing hooks (learning from edits)
|
|
259
259
|
aqe hooks pre-edit --file src/utils.ts --operation create
|
|
@@ -278,4 +278,4 @@ Examples:
|
|
|
278
278
|
aqe hooks search --query "authentication"
|
|
279
279
|
aqe hooks stats
|
|
280
280
|
aqe hooks list
|
|
281
|
-
`);return
|
|
281
|
+
`);return _e(o),Se(o),be(o),we(o),Ne(o),$e(o),o.hook("postAction",async()=>{await ke()}),o}export{v as QE_HOOK_EVENTS,In as createHooksCommand,ke as disposeHooksSystem,_ as getHooksSystem,m as hooksState};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{d as a,e as b,f as c}from"./chunk-KRRGOJ6K.js";import"./chunk-GMKJWOXZ.js";import"./chunk-XXQLFPIK.js";import"./chunk-M4JZOCV3.js";import"./chunk-73HALJY5.js";import"./chunk-Q45FBGVV.js";import"./chunk-IIZ3HBPV.js";import"./chunk-SOOI2HJB.js";import"./chunk-AJ7A52GF.js";export{a as HybridRouter,b as createHybridRouter,c as createQERouter};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{a,b,c,d,e}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e}from"./chunk-G4LZ5SBC.js";import"./chunk-HQCJYUKC.js";import"./chunk-FMYNKZ2S.js";import"./chunk-IIZ3HBPV.js";import"./chunk-SOOI2HJB.js";import"./chunk-AJ7A52GF.js";export{a as DEFAULT_HYPERGRAPH_ENGINE_CONFIG,b as HypergraphEngine,c as createHypergraphEngine,d as createHypergraphEngineSync,e as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
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.13.2");process.exit(0)}
|
|
2
|
+
import"./chunk-AJ7A52GF.js";import e from"chalk";import{join as m,resolve as h}from"path";import{existsSync as y}from"fs";var c=class{name="hypergraph";description="Query the code knowledge hypergraph";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let s=n.command("hypergraph").alias("hg").description(this.description);s.command("stats").description("Show hypergraph statistics (node/edge counts by type)").option("--db <path>","Database path").action(async t=>{await this.executeStats(t)}),s.command("untested").description("Find functions with no test coverage").option("--db <path>","Database path").option("--limit <number>","Max results","20").action(async t=>{await this.executeUntested(t)}),s.command("impacted <files...>").description("Find tests impacted by changed files").option("--db <path>","Database path").action(async(t,i)=>{await this.executeImpacted(t,i)}),s.command("gaps").description("Find functions with low coverage").option("--db <path>","Database path").option("--max-coverage <number>","Coverage threshold (%)","50").option("--limit <number>","Max results","20").action(async t=>{await this.executeGaps(t)})}async executeStats(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=await r.getStats();if(console.log(e.blue(`
|
|
3
3
|
Hypergraph Statistics
|
|
4
4
|
`)),console.log(e.white(` Total nodes: ${t.totalNodes}`)),console.log(e.white(` Total edges: ${t.totalEdges}`)),t.totalNodes>0){console.log(e.gray(`
|
|
5
5
|
Nodes by type:`));for(let[i,o]of Object.entries(t.nodesByType))o>0&&console.log(e.gray(` ${i}: ${o}`));console.log(e.gray(`
|
|
@@ -15,7 +15,7 @@ import"./chunk-OE4B6LDZ.js";import e from"chalk";import{join as m,resolve as h}f
|
|
|
15
15
|
`))}finally{i()}await this.cleanupAndExit(0)}async executeGaps(n){if(!await this.ensureInitialized())return;let{engine:r,close:s}=await this.openEngine(n.db);try{let t=parseInt(n.maxCoverage,10)||50,i=parseInt(n.limit,10)||20,o=await r.findCoverageGaps(t),a=o.slice(0,i);if(console.log(e.blue(`
|
|
16
16
|
Coverage Gaps (<= ${t}%) \u2014 ${o.length} total
|
|
17
17
|
`)),a.length===0)console.log(e.green(" No coverage gaps found!"));else{for(let l of a){let d=l.coverage!==void 0?e.red(` ${l.coverage}%`):"",p=l.complexity?e.yellow(` complexity=${l.complexity}`):"";console.log(e.white(` ${l.name}`)+d+e.gray(` ${l.filePath||""}`)+p)}o.length>i&&console.log(e.gray(`
|
|
18
|
-
... and ${o.length-i} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async openEngine(n){let{findProjectRoot:r}=await import("./unified-memory-
|
|
18
|
+
... and ${o.length-i} more (use --limit to show more)`))}console.log("")}finally{s()}await this.cleanupAndExit(0)}async openEngine(n){let{findProjectRoot:r}=await import("./unified-memory-BEUZQTTC.js"),{openDatabase:s}=await import("./safe-db-4HBFO7OQ.js"),{createHypergraphEngine:t}=await import("./hypergraph-engine-ERA527UR.js"),i=r(),o=n||m(i,".agentic-qe","memory.db");if(!y(o))throw new Error(`Database not found: ${o}
|
|
19
19
|
Run "aqe init --auto" first.`);let a=s(o);try{return{engine:await t({db:a,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),close:()=>{try{a.close()}catch{}}}}catch(l){try{a.close()}catch{}throw l}}getHelp(){return`
|
|
20
20
|
Query the code knowledge hypergraph for untested functions,
|
|
21
21
|
impacted tests, and coverage gaps.
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-4SFOQSXU.js";import"./chunk-XS2S3ECA.js";import"./chunk-ELVUERQW.js";import"./chunk-T2XXTEZV.js";import"./chunk-6UGYFYS4.js";import"./chunk-BSQ32ZS5.js";import"./chunk-FMYNKZ2S.js";import"./chunk-E6JJ4ZRQ.js";import"./chunk-IIZ3HBPV.js";import"./chunk-SOOI2HJB.js";import"./chunk-AJ7A52GF.js";export{a as ImpactAnalyzerService};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{a as p}from"./chunk-E6JJ4ZRQ.js";import{a as w,c as y}from"./chunk-IIZ3HBPV.js";import"./chunk-AJ7A52GF.js";import o from"chalk";import{createRequire as C}from"node:module";y();var f=class{name="init";description="Initialize the AQE v3 system";cleanupAndExit;originalStdoutWrite=null;constructor(e){this.cleanupAndExit=e}register(e,t){e.command("init").description(this.description).option("-d, --domains <domains>","Comma-separated list of domains to enable","all").option("-m, --max-agents <number>","Maximum concurrent agents","15").option("--memory <backend>",'Memory backend (sqlite|agentdb|hybrid|memory). "memory" = database-free, in-memory only.',"hybrid").option("--no-database","Database-free install: alias for `--memory memory`. Skips the SQLite database phase and runs any MCP server in-memory \u2014 nothing is written to .agentic-qe/.").option("--lazy","Enable lazy loading of domains").option("--wizard","Run interactive setup wizard").option("--auto","Auto-configure based on project analysis").option("-u, --upgrade","Upgrade existing installation (overwrite skills, agents, validation)").option("--minimal","Minimal configuration (skip optional features)").option("--skip-patterns","Skip loading pre-trained patterns").option("--skip-code-index","Skip code intelligence pre-scan (supported escape hatch \u2014 KG can be built later via `aqe code index`, also via env AQE_SKIP_CODE_INDEX=1)").option("--json","Emit machine-readable JSON result on stdout (suppresses banners; phase progress goes to stderr). Used by the release-gate corpus and CI tooling. See InitJsonOutput in init-handler.ts for the schema.").option("--with-n8n","Install n8n workflow testing agents and skills").option("--with-opencode","Include OpenCode agent/skill provisioning").option("--with-kiro","Include AWS Kiro IDE integration (agents, skills, hooks, steering)").option("--with-copilot","Include GitHub Copilot MCP config and instructions").option("--with-cursor","Include Cursor MCP config and rules").option("--with-cline","Include Cline MCP config and custom QE mode").option("--with-kilocode","Include Kilo Code MCP config and custom QE mode").option("--with-roocode","Include Roo Code MCP config and custom QE mode").option("--with-codex","Include OpenAI Codex CLI MCP, AGENTS.md, hooks, and QE skills").option("--with-windsurf","Include Windsurf MCP config and rules").option("--with-continuedev","Include Continue.dev MCP config and rules").option("--no-mcp","Skip MCP server config (MCP is enabled by default)").option("--with-mcp","Enable MCP server config (default \u2014 kept for backward compatibility)").option("--with-all-platforms","Include all coding agent platform configurations").option("--auto-migrate","Automatically migrate from v2 if detected").option("--with-claude-flow","Force Claude Flow integration setup").option("--skip-claude-flow","Skip Claude Flow integration").option("--no-governance","Skip governance configuration (ADR-058)").option("--no-claude","Suppress the default Claude Code surface (.claude/, .mcp.json, CLAUDE.md, governance, hooks) so --with-<platform> flags are the only install targets (#532)").option("--modular","Use new modular init system (default for --auto)").action(async i=>{await this.execute(i,t)})}async execute(e,t){if(e.json===!0){this.originalStdoutWrite=process.stdout.write.bind(process.stdout);let i=process.stderr.write.bind(process.stderr);process.stdout.write=((...l)=>i(...l))}try{if(e.withAllPlatforms&&(e.withCopilot=!0,e.withCursor=!0,e.withCline=!0,e.withKilocode=!0,e.withRoocode=!0,e.withCodex=!0,e.withWindsurf=!0,e.withContinuedev=!0),e.upgrade&&!e.auto&&!e.wizard&&(e.auto=!0),e.wizard||e.auto){if(console.log(o.blue(`
|
|
3
3
|
Agentic QE v3 Initialization
|
|
4
4
|
`)),e.auto||e.modular){await this.runModularInit(e,t);return}await this.runLegacyWizard(e,t);return}let i=!!(e.withOpencode||e.withN8n||e.withKiro||e.withCopilot||e.withCursor||e.withCline||e.withKilocode||e.withRoocode||e.withCodex||e.withWindsurf||e.withContinuedev||e.withAllPlatforms),l=e.database===!1||e.memory==="memory",c=e.claude===!1;if(e.modular||i||l||c){console.log(o.blue(`
|
|
5
5
|
Agentic QE v3 Initialization
|
|
6
6
|
`)),await this.runModularInit(e,t);return}await this.runStandardInit(e,t)}catch(i){console.error(o.red(`
|
|
7
7
|
Failed to initialize:`),i),await this.cleanupAndExit(1)}}async runModularInit(e,t){let i=e.json===!0,l=e.database===!1||e.memory==="memory";l&&(process.env.AQE_MEMORY_BACKEND="memory",i||console.log(o.gray(` Database-free mode: in-memory backend (no .agentic-qe/memory.db)
|
|
8
8
|
`)));let c=e.claude===!1;c&&!(e.withOpencode||e.withN8n||e.withKiro||e.withCopilot||e.withCursor||e.withCline||e.withKilocode||e.withRoocode||e.withCodex||e.withWindsurf||e.withContinuedev||e.withAllPlatforms)&&!i&&console.log(o.yellow(` --no-claude set without any --with-<platform>: this install will write almost nothing.
|
|
9
|
-
`));let{createModularInitOrchestrator:r}=await import("./orchestrator-
|
|
9
|
+
`));let{createModularInitOrchestrator:r}=await import("./orchestrator-BGLDS47V.js"),s=r({projectRoot:process.cwd(),autoMode:e.auto,upgrade:e.upgrade,minimal:e.minimal,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,withN8n:e.withN8n,withOpenCode:e.withOpencode,withKiro:e.withKiro,withCopilot:e.withCopilot,withCursor:e.withCursor,withCline:e.withCline,withKiloCode:e.withKilocode,withRooCode:e.withRoocode,withCodex:e.withCodex,withWindsurf:e.withWindsurf,withContinueDev:e.withContinuedev,noMcp:e.noMcp&&!e.withMcp,noGovernance:e.noGovernance,noClaude:c,memoryBackend:l?"memory":void 0});console.log(o.white(` Analyzing project...
|
|
10
10
|
`));let n=await s.initialize();if(i){this.originalStdoutWrite&&(process.stdout.write=this.originalStdoutWrite);let a={schemaVersion:1,success:n.success,steps:n.steps.map(m=>({step:m.step,status:m.status,message:m.message,durationMs:m.durationMs})),summary:n.summary,totalDurationMs:n.totalDurationMs,timestamp:n.timestamp.toISOString()};process.stdout.write(JSON.stringify(a,null,2)+`
|
|
11
|
-
`);let d=n.steps.some(m=>m.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let a of n.steps){let d=a.status==="success"?"*":a.status==="error"?"x":"!",m=a.status==="success"?o.green:a.status==="error"?o.red:o.yellow;console.log(m(` ${d} ${a.step} (${a.durationMs}ms)`))}console.log("");let u;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:a}=await import("./claude-flow-setup-
|
|
11
|
+
`);let d=n.steps.some(m=>m.status==="error");await this.cleanupAndExit(n.success&&!d?0:1);return}for(let a of n.steps){let d=a.status==="success"?"*":a.status==="error"?"x":"!",m=a.status==="success"?o.green:a.status==="error"?o.red:o.yellow;console.log(m(` ${d} ${a.step} (${a.durationMs}ms)`))}console.log("");let u;if(!e.skipClaudeFlow&&(e.withClaudeFlow||n.success))try{let{setupClaudeFlowIntegration:a}=await import("./claude-flow-setup-4RNAIALK.js");if(u=await a({projectRoot:process.cwd(),force:e.withClaudeFlow}),u.available)console.log(o.green(" * Claude Flow integration enabled")),u.features.trajectories&&console.log(o.gray(" - SONA trajectory tracking")),u.features.modelRouting&&console.log(o.gray(" - 3-tier model routing (haiku/sonnet/opus)")),u.features.pretrain&&console.log(o.gray(" - Codebase pretrain analysis")),console.log("");else{let{getClaudeFlowNotFoundMessage:d}=await import("./detect-SNEMKQGJ.js");console.log(o.gray(d())),console.log("")}}catch{let{getClaudeFlowNotFoundMessage:a}=await import("./detect-SNEMKQGJ.js");console.log(o.gray(a())),console.log("")}n.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
12
12
|
`)),console.log(o.blue(" Summary:")),console.log(o.gray(` - Patterns loaded: ${n.summary.patternsLoaded}`)),console.log(o.gray(` - Skills installed: ${n.summary.skillsInstalled}`)),console.log(o.gray(` - Agents installed: ${n.summary.agentsInstalled}`)),console.log(o.gray(` - Hooks configured: ${n.summary.hooksConfigured?"Yes":"No"}`)),console.log(o.gray(` - Workers started: ${n.summary.workersStarted}`)),console.log(o.gray(` - Claude Flow: ${u?.available?"Enabled":"Standalone mode"}`)),console.log(o.gray(` - Total time: ${n.totalDurationMs}ms
|
|
13
13
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),n.summary.mcpConfigured&&(console.log(o.gray(`
|
|
14
14
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
15
15
|
`))),h()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
16
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:i}=await import("./init-wizard-
|
|
16
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,t){let{InitOrchestrator:i}=await import("./init-wizard-KAN5KOGD.js"),l={projectRoot:process.cwd(),autoMode:e.auto,minimal:e.minimal,skipPatterns:e.skipPatterns,withN8n:e.withN8n},c=new i(l);if(e.wizard){console.log(o.white(` Setup Wizard Steps:
|
|
17
17
|
`));let s=c.getWizardSteps();for(let n=0;n<s.length;n++)console.log(o.gray(` ${n+1}. ${s[n].title}`)),console.log(o.gray(` ${s[n].description}
|
|
18
18
|
`))}console.log(o.white(` Analyzing project...
|
|
19
19
|
`));let r=await c.initialize();for(let s of r.steps){let n=s.status==="success"?"*":s.status==="error"?"x":"!",u=s.status==="success"?o.green:s.status==="error"?o.red:o.yellow;console.log(u(` ${n} ${s.step} (${s.durationMs}ms)`))}console.log(""),r.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
@@ -21,7 +21,7 @@ import{a as p}from"./chunk-GTPZVLL6.js";import{a as w,c as y}from"./chunk-AYYDO5
|
|
|
21
21
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),r.summary.mcpConfigured&&(console.log(o.gray(`
|
|
22
22
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
23
23
|
`))),h()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
24
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:i}=await import("./kernel-
|
|
24
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,t){let{QEKernelImpl:i}=await import("./kernel-LET4HEEF.js"),{CrossDomainEventRouter:l}=await import("./cross-domain-router-VNE7QKX4.js"),{DefaultProtocolExecutor:c}=await import("./protocol-executor-I3C2ZETP.js"),{WorkflowOrchestrator:r}=await import("./workflow-orchestrator-N2DQTC3X.js"),{createQueenCoordinator:s}=await import("./queen-coordinator-QRWRNUDR.js");console.log(o.blue(`
|
|
25
25
|
Initializing Agentic QE v3...
|
|
26
26
|
`));let n=e.domains==="all"?[...p]:e.domains.split(",").filter(d=>p.includes(d));console.log(o.gray(` Domains: ${n.length}`)),console.log(o.gray(` Max Agents: ${e.maxAgents}`)),console.log(o.gray(` Memory: ${e.memory}`)),console.log(o.gray(` Lazy Loading: ${e.lazy?"enabled":"disabled"}
|
|
27
27
|
`)),t.kernel=new i({maxConcurrentAgents:parseInt(e.maxAgents,10),memoryBackend:e.memory,hnswEnabled:!0,lazyLoading:e.lazy||!1,enabledDomains:n,enableExperienceBridge:!1}),await t.kernel.initialize(),console.log(o.green(" * Kernel initialized")),t.router=new l(t.kernel.eventBus),await t.router.initialize(),console.log(o.green(" * Cross-domain router initialized"));let u=d=>t.kernel.getDomainAPI(d),a=new c(t.kernel.eventBus,t.kernel.memory,u);console.log(o.green(" * Protocol executor initialized")),t.workflowOrchestrator=new r(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),this.registerDomainWorkflowActions(t.kernel,t.workflowOrchestrator),console.log(o.green(" * Workflow orchestrator initialized")),t.queen=s(t.kernel,t.router,a,void 0),await t.queen.initialize(),console.log(o.green(" * Queen Coordinator initialized")),t.initialized=!0,console.log(o.green(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-UPGJZA3D.js";import"./chunk-PJOH5Z5I.js";import"./chunk-JPO4AC5Q.js";import"./chunk-A2OD5Z4B.js";import"./chunk-QVD3LU27.js";import"./chunk-FMYNKZ2S.js";import"./chunk-IIZ3HBPV.js";import"./chunk-6DMB6WK5.js";import"./chunk-5EFNZEOB.js";import"./chunk-AJ7A52GF.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{A as b,z as a}from"./chunk-4STE6VLR.js";import"./chunk-EABGQVTV.js";import"./chunk-AS2HVJ42.js";import"./chunk-H6C2YTPX.js";import"./chunk-G4LZ5SBC.js";import"./chunk-ASIGTVFQ.js";import"./chunk-OYWZYG6Q.js";import"./chunk-BO2RBAPF.js";import"./chunk-24S5IUSI.js";import"./chunk-B7KZMPF2.js";import"./chunk-MNDPSIEI.js";import"./chunk-NNIKJZA4.js";import"./chunk-LJWIBYTR.js";import"./chunk-IV77BQ2R.js";import"./chunk-GHJRLC3C.js";import"./chunk-HHUKHEW5.js";import"./chunk-RJYAUJDC.js";import"./chunk-COOMXCCP.js";import"./chunk-HANBJ37Z.js";import"./chunk-ZIT5VF43.js";import"./chunk-MVJ5UQI3.js";import"./chunk-K3MNTU4O.js";import"./chunk-A2OD5Z4B.js";import"./chunk-4SFOQSXU.js";import"./chunk-XS2S3ECA.js";import"./chunk-ELVUERQW.js";import"./chunk-WTSVP6OK.js";import"./chunk-RWUK5VMZ.js";import"./chunk-5XYVRTI6.js";import"./chunk-YZUMCXH6.js";import"./chunk-54BCLRRJ.js";import"./chunk-5AAG7JTB.js";import"./chunk-KHVW6DQS.js";import"./chunk-FECBWGCA.js";import"./chunk-GMKQJEKX.js";import"./chunk-6XHDH3IJ.js";import"./chunk-HD6PZHLC.js";import"./chunk-JDRYENTD.js";import"./chunk-FFMUTX26.js";import"./chunk-T2XXTEZV.js";import"./chunk-KRRGOJ6K.js";import"./chunk-GMKJWOXZ.js";import"./chunk-XXQLFPIK.js";import"./chunk-M4JZOCV3.js";import"./chunk-73HALJY5.js";import"./chunk-Q45FBGVV.js";import"./chunk-EFHMS7TJ.js";import"./chunk-NTKIDOIW.js";import"./chunk-62D27BDO.js";import"./chunk-Q625ISQI.js";import"./chunk-5GGGZYFA.js";import"./chunk-GKKD22CC.js";import"./chunk-6R7TX5L4.js";import"./chunk-FJ2L6P7O.js";import"./chunk-ODE7Z667.js";import"./chunk-RF2DMPX2.js";import"./chunk-2DG44UZ5.js";import"./chunk-4FYTWD4Q.js";import"./chunk-TTWWCWAR.js";import"./chunk-4DKL4H5L.js";import"./chunk-P33EORZZ.js";import"./chunk-LQDQTLWV.js";import"./chunk-WMK2ZNLM.js";import"./chunk-U2FCUBBW.js";import"./chunk-HQCJYUKC.js";import"./chunk-YWJ2GPD4.js";import"./chunk-6UGYFYS4.js";import"./chunk-BSQ32ZS5.js";import"./chunk-REBNPQI7.js";import"./chunk-FMYNKZ2S.js";import"./chunk-TVWX7NYD.js";import"./chunk-E6PYV3DB.js";import"./chunk-LEOSNZR2.js";import"./chunk-E6JJ4ZRQ.js";import"./chunk-IIZ3HBPV.js";import"./chunk-SOOI2HJB.js";import"./chunk-BFKXHXWW.js";import"./chunk-6DMB6WK5.js";import"./chunk-5EFNZEOB.js";import"./chunk-J722Z7VO.js";import"./chunk-TLG56A27.js";import"./chunk-DIPOFCBX.js";import"./chunk-ZY5FB3JV.js";import"./chunk-VOYUCJLK.js";import"./chunk-DQXSDWRP.js";import"./chunk-GZ775E5O.js";import"./chunk-AJ7A52GF.js";export{a as QEKernelImpl,b as createKernel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{b as f}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.2");process.exit(0)}
|
|
2
|
+
import{b as f}from"./chunk-NIE3SGZM.js";import{a as m,c as v}from"./chunk-IIZ3HBPV.js";import"./chunk-AJ7A52GF.js";v();import{existsSync as n,mkdirSync as p,readFileSync as d,writeFileSync as a}from"fs";import{join as u,dirname as h}from"path";var l=class{projectRoot;overwrite;options;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=f()}async install(){let e={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("kilocode",{memoryBackend:this.options.memoryBackend}),r=u(this.projectRoot,t.path);if(e.configPath=r,!n(r)||this.overwrite){let s=h(r);if(n(s)||p(s,{recursive:!0}),n(r)&&this.overwrite){let c=this.mergeExistingConfig(r,t.content);a(r,c)}else a(r,t.content);e.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("kilocode"),o=u(this.projectRoot,i.path);if(e.modePath=o,!n(o)||this.overwrite){let s=h(o);if(n(s)||p(s,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,i.content);a(o,c)}else a(o,i.content);e.modeInstalled=!0}}catch(t){e.success=!1,e.errors.push(`Kilo Code installation failed: ${m(t)}`)}return e}mergeExistingConfig(e,t){try{let r=JSON.parse(d(e,"utf-8")),i=JSON.parse(t);return r.mcpServers||(r.mcpServers={}),Object.assign(r.mcpServers,i.mcpServers),JSON.stringify(r,null,2)+`
|
|
3
3
|
`}catch{return t}}mergeExistingModes(e,t){try{let r=JSON.parse(d(e,"utf-8")),i=JSON.parse(t);if(!Array.isArray(r))return t;let o=r.filter(s=>s.slug!=="qe-engineer");return o.push(...i),JSON.stringify(o,null,2)+`
|
|
4
4
|
`}catch{return t}}};function x(g){return new l(g)}export{l as KiloCodeInstaller,x as createKiloCodeInstaller};
|