agentic-qe 3.15.2 → 3.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/brain-checkpoint.cjs +46 -6
- package/.claude/hooks/aqe-hook.cjs +280 -51
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +86 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/ag-ui/state-delta-cache.js +14 -5
- package/dist/adapters/trajectory-adapter.js +3 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-WQSFQES5.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-664M7426.js → agent-booster-wasm-CYG3PKHH.js} +2 -2
- package/dist/cli/chunks/{agent-handler-E47ITH45.js → agent-handler-WTFYFZKL.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-CFWVOJX3.js → agent-memory-branch-G6WE3ZXU.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-TDHBBADE.js +2 -0
- package/dist/cli/chunks/{arena-JM3OY263.js → arena-S72QW44C.js} +4 -4
- package/dist/cli/chunks/{arena-ZU5CGBGH.js → arena-ZFXQEVUQ.js} +2 -2
- package/dist/cli/chunks/{audit-HVBRC5AS.js → audit-KPYIEQJ3.js} +3 -3
- package/dist/cli/chunks/base-CZSB27VO.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-45JLBQX3.js → better-sqlite3-L2M3TI5D.js} +2 -2
- package/dist/cli/chunks/{brain-handler-FKDONZYA.js → brain-handler-FHKLQTB4.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-M3DPS3D5.js → branch-enumerator-3BSHOPOK.js} +2 -2
- package/dist/cli/chunks/{browser-TG2TV6NR.js → browser-JUIJPL6Y.js} +2 -2
- package/dist/cli/chunks/browser-workflow-AEMIS6PA.js +2 -0
- package/dist/cli/chunks/{chunk-3KTAMNKI.js → chunk-2GJJGO5D.js} +2 -2
- package/dist/cli/chunks/{chunk-HSXLHNSS.js → chunk-2M75CW5Q.js} +2 -2
- package/dist/cli/chunks/{chunk-MEUJWTOX.js → chunk-2MEWIXW4.js} +2 -2
- package/dist/cli/chunks/{chunk-SKQTRYE7.js → chunk-2TBHPYOU.js} +2 -2
- package/dist/cli/chunks/{chunk-PZK7O445.js → chunk-34Y4CIHD.js} +2 -2
- package/dist/cli/chunks/{chunk-RO6HAZLV.js → chunk-35VDOH4Y.js} +1 -1
- package/dist/cli/chunks/{chunk-KQMCCHPO.js → chunk-366IBPZB.js} +2 -2
- package/dist/cli/chunks/{chunk-GJTH6VBH.js → chunk-3MNKYCLH.js} +1 -1
- package/dist/cli/chunks/{chunk-6KEYA4EH.js → chunk-3UUMGWHW.js} +4 -4
- package/dist/cli/chunks/{chunk-EQG3JYSV.js → chunk-3Y4GX5FL.js} +2 -2
- package/dist/cli/chunks/{chunk-BKZSTZDB.js → chunk-3ZTBV6M3.js} +1 -1
- package/dist/cli/chunks/{chunk-UZL4JYVW.js → chunk-4IYHYHTG.js} +2 -2
- package/dist/cli/chunks/{chunk-56CE7UO4.js → chunk-4JVVVKAX.js} +6 -6
- package/dist/cli/chunks/chunk-4N7YXTV3.js +4 -0
- package/dist/cli/chunks/{chunk-N653RGT3.js → chunk-4TM5K6EZ.js} +2 -2
- package/dist/cli/chunks/{chunk-IAOB2G3X.js → chunk-5LEUEWJY.js} +2 -2
- package/dist/cli/chunks/{chunk-LRVR56PD.js → chunk-5QUOM357.js} +1 -1
- package/dist/cli/chunks/{chunk-NBV37CEK.js → chunk-5WOBFN2T.js} +2 -2
- package/dist/cli/chunks/{chunk-I7J2ESGR.js → chunk-6AKJ73X3.js} +2 -2
- package/dist/cli/chunks/{chunk-L77Z3Q6L.js → chunk-6EQDA4EC.js} +2 -2
- package/dist/cli/chunks/{chunk-3DCRAW43.js → chunk-6TYTBQPV.js} +2 -2
- package/dist/cli/chunks/{chunk-IQB5ZBYO.js → chunk-6V6XVGCL.js} +3 -3
- package/dist/cli/chunks/{chunk-DHSGCI6H.js → chunk-6W6GZHQA.js} +6 -6
- package/dist/cli/chunks/{chunk-MY2XZHW3.js → chunk-7IJVCDDC.js} +1 -1
- package/dist/cli/chunks/{chunk-AS27JP67.js → chunk-7PDC4SKR.js} +1 -1
- package/dist/cli/chunks/{chunk-3KXKJSKS.js → chunk-7SWHW5AC.js} +20 -20
- package/dist/cli/chunks/{chunk-FH6N2LKG.js → chunk-7TW5UGDP.js} +2 -2
- package/dist/cli/chunks/{chunk-SZYK5JL7.js → chunk-7UUSV2SK.js} +1 -1
- package/dist/cli/chunks/{chunk-HFF5ERIE.js → chunk-A3IQU2ND.js} +2 -2
- package/dist/cli/chunks/{chunk-RIAKRZCZ.js → chunk-A5H7TF7C.js} +2 -2
- package/dist/cli/chunks/{chunk-ATGIGJSL.js → chunk-A6PII4R4.js} +1 -1
- package/dist/cli/chunks/{chunk-X4CADOSD.js → chunk-AEL4XJGJ.js} +2 -2
- package/dist/cli/chunks/{chunk-JCB6K24D.js → chunk-AOZJ6UUZ.js} +2 -2
- package/dist/cli/chunks/chunk-APV5UWTU.js +15 -0
- package/dist/cli/chunks/{chunk-QJN5RW2U.js → chunk-AQTQ24SK.js} +3 -3
- package/dist/cli/chunks/{chunk-GDSLQTJC.js → chunk-AS54N3H7.js} +2 -2
- package/dist/cli/chunks/chunk-ASUXS4N4.js +2 -0
- package/dist/cli/chunks/{chunk-HS3O763N.js → chunk-B23ROYST.js} +3 -3
- package/dist/cli/chunks/{chunk-IHKRKRAV.js → chunk-BDKQSEEY.js} +1 -1
- package/dist/cli/chunks/{chunk-2B2MGJ2W.js → chunk-BO43BGHX.js} +2 -2
- package/dist/cli/chunks/{chunk-MDDECCAC.js → chunk-CF3BPD2R.js} +161 -159
- package/dist/cli/chunks/{chunk-ANI3KPB7.js → chunk-CFXROOIU.js} +2 -2
- package/dist/cli/chunks/{chunk-3RC5UMRJ.js → chunk-CNQUU6CF.js} +2 -2
- package/dist/cli/chunks/{chunk-NKWMTXBL.js → chunk-D5V6C3XG.js} +3 -3
- package/dist/cli/chunks/{chunk-ZIKH7U5A.js → chunk-D6PUDLJ4.js} +2 -2
- package/dist/cli/chunks/{chunk-FNPZINHV.js → chunk-DE3QNPTG.js} +1 -1
- package/dist/cli/chunks/{chunk-VTGAPHJE.js → chunk-DH5NWHH2.js} +2 -2
- package/dist/cli/chunks/{chunk-OWZ3F7DJ.js → chunk-DLA3EHKJ.js} +1 -1
- package/dist/cli/chunks/{chunk-7UA7SMM4.js → chunk-DWG4TN6A.js} +1 -1
- package/dist/cli/chunks/{chunk-4MCO43NX.js → chunk-EBIMVSPH.js} +4 -4
- package/dist/cli/chunks/{chunk-WMNVFCKY.js → chunk-ED5HUPUR.js} +2 -2
- package/dist/cli/chunks/{chunk-Y5VPLOA7.js → chunk-EQGT4VLC.js} +1 -1
- package/dist/cli/chunks/{chunk-ZVQSIH7Y.js → chunk-F5BREV2Q.js} +8 -8
- package/dist/cli/chunks/{chunk-CV7E627D.js → chunk-FPFGN2Z5.js} +2 -2
- package/dist/cli/chunks/{chunk-GJ7DON5S.js → chunk-FTUNC4EI.js} +3 -3
- package/dist/cli/chunks/chunk-FXTZXZCU.js +54 -0
- package/dist/cli/chunks/{chunk-6UO5YSNN.js → chunk-GJB3LPCS.js} +2 -2
- package/dist/cli/chunks/{chunk-6WVEICL2.js → chunk-GPZH6OPP.js} +4 -4
- package/dist/cli/chunks/{chunk-T5N2PIPS.js → chunk-HR7RL4PB.js} +2 -2
- package/dist/cli/chunks/{chunk-IT753IPZ.js → chunk-HSR53REE.js} +2 -2
- package/dist/cli/chunks/{chunk-DNS37AHW.js → chunk-HU474NXP.js} +1 -1
- package/dist/cli/chunks/{chunk-NP2WWIZ3.js → chunk-HV3ZVUHO.js} +1 -1
- package/dist/cli/chunks/{chunk-ITM26I6O.js → chunk-HVIFA73X.js} +2 -2
- package/dist/cli/chunks/{chunk-Q32UGPWK.js → chunk-HW4V7BVV.js} +2 -2
- package/dist/cli/chunks/{chunk-5DFPAJ5O.js → chunk-I5VJ3FBC.js} +2 -2
- package/dist/cli/chunks/{chunk-AR5V7VNC.js → chunk-IARE5VGI.js} +1 -1
- package/dist/cli/chunks/chunk-INVDDFJC.js +2 -0
- package/dist/cli/chunks/{chunk-M36DAETL.js → chunk-JJBTM4JO.js} +2 -2
- package/dist/cli/chunks/chunk-JVQK6NGI.js +14 -0
- package/dist/cli/chunks/{chunk-TMYGGYRY.js → chunk-K65X6CQA.js} +1 -1
- package/dist/cli/chunks/{chunk-HBMBO4FD.js → chunk-KCBCYF7M.js} +2 -2
- package/dist/cli/chunks/{chunk-V67UQRQN.js → chunk-KGS6H2HB.js} +2 -2
- package/dist/cli/chunks/{chunk-JSTKSPYT.js → chunk-L6OSEWOS.js} +1 -1
- package/dist/cli/chunks/{chunk-LH3H4V7C.js → chunk-LEB6O2IN.js} +2 -2
- package/dist/cli/chunks/{chunk-JIRX6KUR.js → chunk-LPZAB3N2.js} +3 -3
- package/dist/cli/chunks/{chunk-A6L2OCMO.js → chunk-M3ACHBC7.js} +2 -2
- package/dist/cli/chunks/{chunk-WBZIOTY6.js → chunk-M3ONCPSU.js} +2 -2
- package/dist/cli/chunks/{chunk-EATZW5T2.js → chunk-MUSYQF53.js} +2 -2
- package/dist/cli/chunks/{chunk-GSC6JXDE.js → chunk-MZDUBFLP.js} +1 -1
- package/dist/cli/chunks/{chunk-2Q4Y3VQ6.js → chunk-NT6FYFJA.js} +2 -2
- package/dist/cli/chunks/{chunk-HADOG2PT.js → chunk-O66D4NEJ.js} +2 -2
- package/dist/cli/chunks/{chunk-QZNFZ5IQ.js → chunk-OGARNKLS.js} +2 -2
- package/dist/cli/chunks/{chunk-QGCFMACF.js → chunk-OKNMZLGB.js} +2 -2
- package/dist/cli/chunks/{chunk-TC4B5D4Z.js → chunk-OMHISPPF.js} +1 -1
- package/dist/cli/chunks/{chunk-DGKPGRBT.js → chunk-OT6SOPAL.js} +2 -2
- package/dist/cli/chunks/{chunk-W6PLBRRS.js → chunk-OTTTHNIT.js} +1 -1
- package/dist/cli/chunks/{chunk-JFFVYCTV.js → chunk-P36IODAM.js} +2 -2
- package/dist/cli/chunks/{chunk-EDRIROCG.js → chunk-P6EGRAQG.js} +2 -2
- package/dist/cli/chunks/{chunk-HOBBYORR.js → chunk-PBUWNMZ2.js} +1 -1
- package/dist/cli/chunks/{chunk-Z3PANQUT.js → chunk-POTVF6BY.js} +1 -1
- package/dist/cli/chunks/{chunk-SVHFSOGT.js → chunk-POVP6O6K.js} +1 -1
- package/dist/cli/chunks/{chunk-LVDZ25VX.js → chunk-PPA53NJB.js} +2 -2
- package/dist/cli/chunks/{chunk-GHXNRF63.js → chunk-PUPEKA2J.js} +2 -2
- package/dist/cli/chunks/{chunk-RLQ4MYB6.js → chunk-QDQLL2QB.js} +2 -2
- package/dist/cli/chunks/{chunk-O6QTCUSL.js → chunk-QSVNVDA5.js} +1 -1
- package/dist/cli/chunks/{chunk-UKRK3IE3.js → chunk-QUXX2DP7.js} +2 -2
- package/dist/cli/chunks/{chunk-T75PWWK4.js → chunk-QVNMTMDJ.js} +2 -2
- package/dist/cli/chunks/{chunk-3XF7YTQC.js → chunk-QZBFMXO5.js} +52 -52
- package/dist/cli/chunks/{chunk-BT6TZTCL.js → chunk-RDTR43YN.js} +2 -2
- package/dist/cli/chunks/{chunk-55T7PDYP.js → chunk-RGD2CG23.js} +2 -2
- package/dist/cli/chunks/{chunk-NWYAV2UG.js → chunk-RQUSJEON.js} +2 -2
- package/dist/cli/chunks/{chunk-2AOAEMJG.js → chunk-RRSZ27A7.js} +2 -2
- package/dist/cli/chunks/{chunk-6XLCFDIB.js → chunk-RWLOERKK.js} +2 -2
- package/dist/cli/chunks/{chunk-5YS2DF5G.js → chunk-RWQDRPN5.js} +2 -2
- package/dist/cli/chunks/{chunk-CFDIYZGA.js → chunk-S7D4GD7H.js} +2 -2
- package/dist/cli/chunks/{chunk-NLY5NUHZ.js → chunk-SKHP5WUP.js} +2 -2
- package/dist/cli/chunks/{chunk-HMDSBWF6.js → chunk-SP2JO53K.js} +2 -2
- package/dist/cli/chunks/{chunk-WJ7657IX.js → chunk-SRDECRTL.js} +2 -2
- package/dist/cli/chunks/{chunk-CRYZXTSQ.js → chunk-TBVPNN65.js} +2 -2
- package/dist/cli/chunks/{chunk-UX4BOI6K.js → chunk-U5AVZ3T2.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSKQPXRW.js → chunk-UCSGZVJX.js} +1 -1
- package/dist/cli/chunks/{chunk-URWT3EQT.js → chunk-UGNTLSBL.js} +2 -2
- package/dist/cli/chunks/{chunk-IM67YHDK.js → chunk-UTALYUMW.js} +2 -2
- package/dist/cli/chunks/{chunk-FCMCQ6OX.js → chunk-UZDTRCVU.js} +2 -2
- package/dist/cli/chunks/{chunk-WUSSZ2S6.js → chunk-V5NYGDSX.js} +2 -2
- package/dist/cli/chunks/{chunk-KTLYL3BS.js → chunk-VGN46ZT4.js} +2 -2
- package/dist/cli/chunks/{chunk-MOSXT6AO.js → chunk-VHBZADYK.js} +2 -2
- package/dist/cli/chunks/{chunk-6OL2WES5.js → chunk-VOKIUF7I.js} +1 -1
- package/dist/cli/chunks/{chunk-HYWW4A2E.js → chunk-VRT736E3.js} +2 -2
- package/dist/cli/chunks/{chunk-Z7XCXHEB.js → chunk-VUBLJBHQ.js} +2 -2
- package/dist/cli/chunks/{chunk-6O4KVU4K.js → chunk-VX7CQUO7.js} +2 -2
- package/dist/cli/chunks/{chunk-YYVLMW65.js → chunk-W7EHNX3Y.js} +2 -2
- package/dist/cli/chunks/{chunk-J4EJMAH3.js → chunk-WI7I6LMM.js} +1 -1
- package/dist/cli/chunks/{chunk-5TEPPW4J.js → chunk-WLOHTLHO.js} +2 -2
- package/dist/cli/chunks/{chunk-WBCE6V2N.js → chunk-WQZBKLAG.js} +1 -1
- package/dist/cli/chunks/{chunk-YH7VOLBP.js → chunk-WSND64RL.js} +2 -2
- package/dist/cli/chunks/{chunk-D75HDHX3.js → chunk-WSUYEVSY.js} +1 -1
- package/dist/cli/chunks/{chunk-HXT4XDQO.js → chunk-WTMLRMKW.js} +2 -2
- package/dist/cli/chunks/{chunk-FRZVLRVR.js → chunk-WW4RJ6BH.js} +2 -2
- package/dist/cli/chunks/{chunk-QR5ILM34.js → chunk-X335K4SU.js} +2 -2
- package/dist/cli/chunks/{chunk-326V7N25.js → chunk-X33LID2T.js} +1 -1
- package/dist/cli/chunks/{chunk-NL6HKEPR.js → chunk-XTGVGZ4J.js} +3 -3
- package/dist/cli/chunks/{chunk-AXJ75X6I.js → chunk-XV2TIODR.js} +1 -1
- package/dist/cli/chunks/{chunk-2JEPRQMT.js → chunk-XXW4KFBB.js} +1 -1
- package/dist/cli/chunks/{chunk-TZH2QAFZ.js → chunk-YCGU2LI7.js} +2 -2
- package/dist/cli/chunks/chunk-YGEC3PSD.js +2 -0
- package/dist/cli/chunks/{chunk-W7P7EOJ4.js → chunk-YGKU2QRC.js} +1 -1
- package/dist/cli/chunks/{chunk-XQBH3366.js → chunk-YHZGFWJE.js} +2 -2
- package/dist/cli/chunks/{chunk-E6GANSLP.js → chunk-YJH7UFA2.js} +2 -2
- package/dist/cli/chunks/{chunk-IBAXNCR2.js → chunk-YQ3ZW47V.js} +2 -2
- package/dist/cli/chunks/{chunk-MYDZBABD.js → chunk-YTRGMILO.js} +2 -2
- package/dist/cli/chunks/chunk-YW4GM36K.js +2 -0
- package/dist/cli/chunks/{chunk-W5EKSBS4.js → chunk-Z7JPWXW2.js} +2 -2
- package/dist/cli/chunks/{chunk-2AWU2E6R.js → chunk-Z7UGEQ4G.js} +1 -1
- package/dist/cli/chunks/{chunk-B4H66LPR.js → chunk-ZATQLTYL.js} +1 -1
- package/dist/cli/chunks/{chunk-N4MNSEKY.js → chunk-ZI6NJEBY.js} +1 -1
- package/dist/cli/chunks/{chunk-YJSKT6G6.js → chunk-ZJW4HRUA.js} +1 -1
- package/dist/cli/chunks/{chunk-QB7H62A4.js → chunk-ZL2GYU7H.js} +2 -2
- package/dist/cli/chunks/{ci-JNBOR6FP.js → ci-JPISJ25U.js} +3 -3
- package/dist/cli/chunks/{ci-output-FYNKONEQ.js → ci-output-DPHTFIGX.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-KOIXRDAD.js → circuit-breaker-PQ65VU2M.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-4CO7KHRN.js → claude-flow-setup-GKHVO7AD.js} +2 -2
- package/dist/cli/chunks/client-BS7I637W.js +2 -0
- package/dist/cli/chunks/{cline-installer-CMYAPKK5.js → cline-installer-HWMQZJ64.js} +2 -2
- package/dist/cli/chunks/{code-WFIAEP3H.js → code-OTY7BF3D.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-IYM6HWJN.js → code-index-extractor-FG3TMHHR.js} +2 -2
- package/dist/cli/chunks/{codex-installer-DORVWRSU.js → codex-installer-63JARKKS.js} +2 -2
- package/dist/cli/chunks/{completions-54VM2MX2.js → completions-4ZHONFML.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-EGZDP5N4.js → complexity-analyzer-FYHTJW5Y.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-4SDVDD4T.js → continuedev-installer-ZAWDSUR3.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-7FJQ7PCL.js → copilot-installer-5QK565JX.js} +2 -2
- package/dist/cli/chunks/core-handlers-UG7RMTK5.js +2 -0
- package/dist/cli/chunks/cost-tracker-AWWMPPBJ.js +2 -0
- package/dist/cli/chunks/{coverage-DI5LDRJ7.js → coverage-SMFQEGKE.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-NX7F6TOF.js +2 -0
- package/dist/cli/chunks/{cursor-installer-RTSZP5YD.js → cursor-installer-3BL7JACV.js} +2 -2
- package/dist/cli/chunks/{daemon-LM7LETPV.js → daemon-OJ624POF.js} +4 -4
- package/dist/cli/chunks/{daemon-SP3APEZY.js → daemon-R6ULBHHF.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-C3QBODFE.js → dag-attention-scheduler-J6I3LTMY.js} +2 -2
- package/dist/cli/chunks/{detect-I4RBUFFJ.js → detect-5Q5W33UR.js} +2 -2
- package/dist/cli/chunks/{dist-node-PT6TCBCO.js → dist-node-GJNW56NA.js} +2 -2
- package/dist/cli/chunks/{domain-handler-MJMTMB5X.js → domain-handler-IZQY2G44.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-Y4A2WYJW.js → domain-plugins-PIGO3KI2.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-DUO42TLA.js → domain-transfer-NU3B4FQG.js} +2 -2
- package/dist/cli/chunks/dream-GYEH57FW.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-66ZQK4AI.js → embed-and-insert-pattern-5QDDRPWV.js} +2 -2
- package/dist/cli/chunks/{eval-NQ7H27UF.js → eval-TB5HOAUY.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-MHEYPTIG.js → experience-capture-middleware-SIYVLKDE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-YYDGN6ZC.js → fast-paths-T7QELS6D.js} +2 -2
- package/dist/cli/chunks/{feature-flags-YFGUORHY.js → feature-flags-T3CNNYMJ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-FY4DOYS2.js → feature-flags-TNZ7ZAJV.js} +2 -2
- package/dist/cli/chunks/{file-discovery-TOMDY7TK.js → file-discovery-M45P2ZCY.js} +2 -2
- package/dist/cli/chunks/{fleet-MO3UCWB4.js → fleet-DSBZPHBZ.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-SLW4PPXQ.js → gnn-wrapper-EHODCF32.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-36RFCP4E.js → heartbeat-handler-V5DBVF7V.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-4TJ3T7LR.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-PHFK4EAP.js +2 -0
- package/dist/cli/chunks/hnsw-index-434XDDBH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-BJLWBKHE.js → hnsw-legacy-bridge-IYKDYA2F.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-RAYNVJCJ.js → hnswlib-node-DKG4LW3X.js} +2 -2
- package/dist/cli/chunks/{hooks-JMHFWVEQ.js → hooks-VKNMAILY.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-DYVJQENQ.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-JUDBKPOX.js → hypergraph-engine-AXZVP7A7.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-AXTWXOZU.js → hypergraph-handler-6EO6JN4Z.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-CBAST6M2.js +2 -0
- package/dist/cli/chunks/{init-handler-PARJNZFF.js → init-handler-N3NG3RHN.js} +6 -6
- package/dist/cli/chunks/init-wizard-DWIJW7HY.js +2 -0
- package/dist/cli/chunks/kernel-AQGCS4X2.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-22HX2E4V.js → kilocode-installer-JICGAHLM.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-OVPBLY7J.js → kiro-installer-VYBFP6ZH.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-2ICXFUUV.js +2 -0
- package/dist/cli/chunks/{learning-DWXPJ3R6.js → learning-3BHEZEPK.js} +3 -3
- package/dist/cli/chunks/{llm-router-7PPVVKNG.js → llm-router-GPTEZCUN.js} +4 -4
- package/dist/cli/chunks/llm-router-service-C47RGTH6.js +2 -0
- package/dist/cli/chunks/{load-VI5XHNZA.js → load-W5BIRPU4.js} +2 -2
- package/dist/cli/chunks/load-test-LRDAW3N6.js +2 -0
- package/dist/cli/chunks/{mcp-UW4Z3Z64.js → mcp-EBV4DZPG.js} +2 -2
- package/dist/cli/chunks/{memory-UD2KCB5M.js → memory-7F6YYKNL.js} +5 -5
- package/dist/cli/chunks/memory-backend-UFBAYPQ6.js +2 -0
- package/dist/cli/chunks/memory-handlers-OGLJHAAJ.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-5O4WWU5Z.js → multi-model-executor-3ZIA2YOL.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-DTRFDGM7.js → opencode-installer-2XRZUTLR.js} +2 -2
- package/dist/cli/chunks/{orchestrator-ENJIKV6Z.js → orchestrator-VSZVJUJW.js} +85 -26
- package/dist/cli/chunks/pattern-null-store-27FCITT3.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-QPNIU5PD.js → pattern-usage-recorder-I2IGVHRL.js} +2 -2
- package/dist/cli/chunks/{pipeline-G3JYDNPE.js → pipeline-5G3O6WBY.js} +2 -2
- package/dist/cli/chunks/{platform-P4WR6N3D.js → platform-6GUFDIA3.js} +2 -2
- package/dist/cli/chunks/{plugin-C7763Q5W.js → plugin-GYXE4CIC.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-DH6R3XSZ.js → prime-radiant-advanced-wasm-THX6JLGZ.js} +2 -2
- package/dist/cli/chunks/{project-root-7DTXDLEG.js → project-root-QJRBKZQU.js} +2 -2
- package/dist/cli/chunks/protocol-executor-XWXXTMEW.js +2 -0
- package/dist/cli/chunks/{protocol-handler-EODULGOZ.js → protocol-handler-B54LRU26.js} +2 -2
- package/dist/cli/chunks/{prove-A7G3SIOF.js → prove-PCY2WQOD.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-3RMYXENE.js +2 -0
- package/dist/cli/chunks/{quality-JTURFUX3.js → quality-LPVDZC7U.js} +2 -2
- package/dist/cli/chunks/{quality-gate-M2EI754V.js → quality-gate-L3KXL6WE.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-AS6DZ7UJ.js +2 -0
- package/dist/cli/chunks/{real-embeddings-DI7JMCG7.js → real-embeddings-N3H523PJ.js} +2 -2
- package/dist/cli/chunks/{ref-validation-MSFMNKDR.js → ref-validation-6BKDPHZ7.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-XIMFFHOH.js → roocode-installer-NSGGTWXE.js} +2 -2
- package/dist/cli/chunks/router-OVNLNGHO.js +2 -0
- package/dist/cli/chunks/routing-feedback-TBOWEB6H.js +2 -0
- package/dist/cli/chunks/{routing-handler-MCDKNBQW.js → routing-handler-SRQNUBG3.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-OBSYAK2X.js → ruvector-commands-2IGULGDE.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-YJYRCYGT.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-VMRQ2SFO.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-4DTRIHY6.js → rvf-migration-coordinator-ZD6WK5CK.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-B75L3ALW.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-CWAVMRC4.js → rvf-store-integrity-QULKUBBI.js} +2 -2
- package/dist/cli/chunks/safe-db-CRQHMCV6.js +2 -0
- package/dist/cli/chunks/schedule-L3DKJRXU.js +2 -0
- package/dist/cli/chunks/scheduler-VRHYUGY5.js +2 -0
- package/dist/cli/chunks/{security-74TWSO74.js → security-JW4EBARW.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-ZHNAGE5H.js → shared-rvf-adapter-VQ7NJTGY.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-BS5WAVCC.js → shared-rvf-dual-writer-SKTS52HK.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-JVAZETTL.js +2 -0
- package/dist/cli/chunks/{standalone-memory-3HGHTE7S.js → standalone-memory-3N4YJCSY.js} +2 -2
- package/dist/cli/chunks/{status-handler-XWEEGNGH.js → status-handler-5BQ2IIDG.js} +2 -2
- package/dist/cli/chunks/{structural-health-TB5JGMVS.js → structural-health-WGYR2RJB.js} +2 -2
- package/dist/cli/chunks/{sync-T4VLBURM.js → sync-DLKSXTIR.js} +2 -2
- package/dist/cli/chunks/sync-R5OKUBTQ.js +2 -0
- package/dist/cli/chunks/{task-handler-RQ65QKXX.js → task-handler-Z5KNTSUX.js} +2 -2
- package/dist/cli/chunks/{task-handlers-USYWJ4H2.js → task-handlers-RZFMYFSC.js} +3 -3
- package/dist/cli/chunks/test-LHWKZJRN.js +34 -0
- package/dist/cli/chunks/test-scheduling-EN7WXUMS.js +15 -0
- package/dist/cli/chunks/token-bootstrap-4V3OO4EC.js +2 -0
- package/dist/cli/chunks/{token-usage-CISTB5K5.js → token-usage-PFC2BYBS.js} +2 -2
- package/dist/cli/chunks/{transformers-C7LV763N.js → transformers-VZCC4SHC.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-P26JC3YV.js → tree-sitter-wasm-parser-ZYDQXGKN.js} +2 -2
- package/dist/cli/chunks/{types-YMVMKIWB.js → types-I6AWHZZQ.js} +2 -2
- package/dist/cli/chunks/unified-memory-WOOCCIUM.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-PDDHFLUB.js +2 -0
- package/dist/cli/chunks/unified-persistence-6ETD3JSC.js +2 -0
- package/dist/cli/chunks/{upgrade-U2REOPAW.js → upgrade-T7SG75PA.js} +2 -2
- package/dist/cli/chunks/{validate-NDTCKN7P.js → validate-YLYEHTY3.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-OJUGVH5Q.js → validate-swarm-VTLTRUE3.js} +2 -2
- package/dist/cli/chunks/visual-security-O4OT2YPY.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-2CLRSA7K.js → web-tree-sitter-JUM7ZY5M.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DSUJJ4PG.js → windsurf-installer-4KS2466T.js} +2 -2
- package/dist/cli/chunks/witness-chain-67JHPDCN.js +2 -0
- package/dist/cli/chunks/{witness-chain-TEGL4ZWB.js → witness-chain-E4X6TOCT.js} +2 -2
- package/dist/cli/chunks/witness-chain-repair-MB53OZO6.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-SPXKFC67.js → witness-chain-verifier-LBWJHO7Y.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-EALOV4OV.js → witness-key-manager-5IHVMXHJ.js} +2 -2
- package/dist/cli/chunks/{workflow-PYI6HCAG.js → workflow-XUQXIRNE.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-ZVFSNRYZ.js +2 -0
- package/dist/cli/chunks/wrappers-YVF5SQUN.js +2 -0
- package/dist/cli/commands/test.js +30 -12
- package/dist/cli/utils/generated-test-writer.d.ts +35 -0
- package/dist/cli/utils/generated-test-writer.js +44 -0
- package/dist/context/compiler.js +4 -1
- package/dist/coordination/consensus/providers/ollama-provider.js +16 -27
- package/dist/coordination/consensus/providers/openrouter-provider.js +13 -24
- package/dist/coordination/handlers/test-execution-handlers.js +4 -2
- package/dist/coordination/protocols/defect-investigation.js +4 -1
- package/dist/domains/code-intelligence/services/metric-collector/test-counter.js +3 -3
- package/dist/domains/coverage-analysis/services/gap-detector.js +3 -1
- package/dist/domains/learning-optimization/services/learning-coordinator.js +4 -2
- package/dist/domains/test-execution/services/flaky-detector.js +8 -2
- package/dist/domains/test-execution/services/retry-handler.js +23 -20
- package/dist/domains/test-execution/services/test-executor.js +5 -2
- package/dist/domains/test-generation/services/test-generator.js +5 -2
- package/dist/governance/compliance-reporter.js +8 -7
- package/dist/governance/proof-envelope-integration.js +3 -1
- package/dist/init/phases/07-hooks.js +30 -4
- package/dist/init/phases/10-workers.js +42 -6
- package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.d.ts +4 -1
- package/dist/integrations/agentic-flow/onnx-embeddings/embedding-generator.js +6 -2
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.js +2 -1
- package/dist/integrations/ruvector/coverage-router.d.ts +3 -1
- package/dist/integrations/ruvector/coverage-router.js +7 -6
- package/dist/integrations/ruvector/diff-risk-classifier.js +5 -4
- package/dist/integrations/ruvector/rvf-dual-writer.js +10 -1
- package/dist/integrations/vibium/runtime.js +2 -6
- package/dist/learning/dream/dream-engine.d.ts +5 -0
- package/dist/learning/dream/dream-engine.js +20 -3
- package/dist/learning/embedding-space.d.ts +18 -0
- package/dist/learning/embedding-space.js +33 -0
- package/dist/learning/rvf-pattern-store.js +19 -5
- package/dist/mcp/bundle.js +443 -441
- package/dist/mcp/handlers/handler-factory.js +3 -1
- package/dist/mcp/handlers/save-results-option.d.ts +62 -0
- package/dist/mcp/handlers/save-results-option.js +35 -0
- package/dist/mcp/protocol-server.js +22 -11
- package/dist/mcp/security/rate-limiter.d.ts +8 -1
- package/dist/mcp/security/rate-limiter.js +33 -4
- package/dist/mcp/services/session-resume.js +11 -0
- package/dist/mcp/services/session-store.d.ts +31 -2
- package/dist/mcp/services/session-store.js +84 -15
- package/dist/mcp/services/session-write-buffer.d.ts +55 -0
- package/dist/mcp/services/session-write-buffer.js +144 -0
- package/dist/memory/crdt/g-counter.js +10 -8
- package/dist/shared/embeddings/ollama-client.d.ts +1 -1
- package/dist/shared/embeddings/ollama-client.js +30 -31
- package/dist/shared/git/git-analyzer.d.ts +4 -1
- package/dist/shared/git/git-analyzer.js +9 -4
- package/dist/shared/llm/cost-tracker.js +8 -6
- package/dist/shared/llm/providers/azure-openai.js +5 -21
- package/dist/shared/llm/providers/bedrock.js +5 -21
- package/dist/shared/llm/providers/claude.js +5 -21
- package/dist/shared/llm/providers/cognitum.js +5 -17
- package/dist/shared/llm/providers/gemini.js +9 -23
- package/dist/shared/llm/providers/ollama.js +5 -21
- package/dist/shared/llm/providers/openai.js +5 -21
- package/dist/shared/llm/providers/openrouter.js +9 -23
- package/dist/shared/llm/providers/response-deadline.d.ts +3 -0
- package/dist/shared/llm/providers/response-deadline.js +100 -0
- package/dist/shared/llm/spend-ledger.js +3 -2
- package/dist/shared/metrics/code-metrics.d.ts +1 -0
- package/dist/shared/metrics/code-metrics.js +3 -44
- package/dist/shared/metrics/cognitive-complexity.d.ts +17 -0
- package/dist/shared/metrics/cognitive-complexity.js +108 -0
- package/dist/shared/npm-cli-invocation.d.ts +21 -0
- package/dist/shared/npm-cli-invocation.js +28 -0
- package/dist/shared/optional-module.js +24 -0
- package/dist/shared/test-runner-args.d.ts +42 -0
- package/dist/shared/test-runner-args.js +74 -0
- package/dist/shared/utils/safe-record.d.ts +18 -0
- package/dist/shared/utils/safe-record.js +28 -0
- package/dist/test-scheduling/executors/vitest-executor.js +23 -5
- package/dist/workers/quality-daemon/git-watcher.js +5 -0
- package/package.json +1 -1
- package/dist/adapters/ag-ui/json-patch-utils.d.ts +0 -136
- package/dist/adapters/ag-ui/json-patch-utils.js +0 -575
- package/dist/cli/chunks/adapter-EUIELRLI.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-LXRKHASR.js +0 -2
- package/dist/cli/chunks/base-4DSLX33Y.js +0 -2
- package/dist/cli/chunks/browser-workflow-AWCQLQZK.js +0 -2
- package/dist/cli/chunks/chunk-E2QHUMCR.js +0 -2
- package/dist/cli/chunks/chunk-I7ECEOFV.js +0 -2
- package/dist/cli/chunks/chunk-LW4BCFIV.js +0 -15
- package/dist/cli/chunks/chunk-QJGKL67W.js +0 -54
- package/dist/cli/chunks/chunk-X43HA3RF.js +0 -14
- package/dist/cli/chunks/chunk-Z3K4JZXQ.js +0 -4
- package/dist/cli/chunks/client-UJVHZXNQ.js +0 -2
- package/dist/cli/chunks/core-handlers-AFXZOSH3.js +0 -2
- package/dist/cli/chunks/cost-tracker-D6YSKTQC.js +0 -2
- package/dist/cli/chunks/cross-domain-router-ZLNVKLIR.js +0 -2
- package/dist/cli/chunks/dream-4OPJXXEG.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-J5KLHO6C.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-56P6XSFR.js +0 -2
- package/dist/cli/chunks/hnsw-index-GFZ6XCEW.js +0 -2
- package/dist/cli/chunks/hybrid-backend-TUBWJDDN.js +0 -2
- package/dist/cli/chunks/impact-analyzer-FXVGKS6B.js +0 -2
- package/dist/cli/chunks/init-wizard-LK73HQ7W.js +0 -2
- package/dist/cli/chunks/kernel-TCZDKRSI.js +0 -2
- package/dist/cli/chunks/knowledge-graph-TWMB2GH2.js +0 -2
- package/dist/cli/chunks/llm-router-service-HPDH3P77.js +0 -2
- package/dist/cli/chunks/load-test-HTYOUYSN.js +0 -2
- package/dist/cli/chunks/memory-backend-X5BE2MPK.js +0 -2
- package/dist/cli/chunks/memory-handlers-SQXMFX5X.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OCQGQZU6.js +0 -2
- package/dist/cli/chunks/protocol-executor-CYEQHQCL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-GSTA5WJ4.js +0 -2
- package/dist/cli/chunks/queen-coordinator-Y2Q5RQL7.js +0 -2
- package/dist/cli/chunks/router-4QB5L4IW.js +0 -2
- package/dist/cli/chunks/routing-feedback-YBVHJY5L.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-T5B456SW.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-2O2NL7ZF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-RDB3GWTW.js +0 -2
- package/dist/cli/chunks/safe-db-YXVMLFU4.js +0 -2
- package/dist/cli/chunks/schedule-K6XWCCSK.js +0 -2
- package/dist/cli/chunks/scheduler-4MW22D6Q.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-UVDHUSAU.js +0 -2
- package/dist/cli/chunks/sync-LSPNSVDI.js +0 -2
- package/dist/cli/chunks/test-M2XTKD62.js +0 -33
- package/dist/cli/chunks/test-scheduling-GYXJQHJL.js +0 -15
- package/dist/cli/chunks/token-bootstrap-OTEMRUFR.js +0 -2
- package/dist/cli/chunks/unified-memory-UUK77NSE.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-JOUE6WNF.js +0 -2
- package/dist/cli/chunks/unified-persistence-3DRJGNQE.js +0 -2
- package/dist/cli/chunks/visual-security-EM7FQG5X.js +0 -2
- package/dist/cli/chunks/witness-chain-7NZ6IIUN.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-ZWS5WXFL.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3C3S5FIM.js +0 -2
- package/dist/cli/chunks/wrappers-NXJHGK3W.js +0 -2
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.3");process.exit(0)}
|
|
2
|
+
import{a as xe}from"./chunk-PPA53NJB.js";import{a as de,b as ye,c as Se,d as Ae,e as $e,f as qe,g as Te,h as je,i as Oe,j as Me,k as Fe,l as Ne,m as Be,n as Qe,o as Ve,p as We}from"./chunk-UZDTRCVU.js";import{a as L,b as ue,c as _e,e as De,f as Q}from"./chunk-ZL2GYU7H.js";import{a as Le}from"./chunk-ZATQLTYL.js";import"./chunk-7PDC4SKR.js";import{c as Re}from"./chunk-3Y4GX5FL.js";import"./chunk-BDKQSEEY.js";import"./chunk-3ZTBV6M3.js";import"./chunk-YHZGFWJE.js";import"./chunk-GJB3LPCS.js";import"./chunk-7SWHW5AC.js";import"./chunk-OGARNKLS.js";import{b as _,d as ce}from"./chunk-UGNTLSBL.js";import"./chunk-ASUXS4N4.js";import"./chunk-UTALYUMW.js";import"./chunk-NT6FYFJA.js";import"./chunk-7TW5UGDP.js";import"./chunk-D6PUDLJ4.js";import"./chunk-M3ONCPSU.js";import"./chunk-HVIFA73X.js";import"./chunk-CNQUU6CF.js";import"./chunk-Z7UGEQ4G.js";import"./chunk-WSND64RL.js";import"./chunk-INVDDFJC.js";import"./chunk-FPFGN2Z5.js";import"./chunk-WLOHTLHO.js";import{a as E,b as Ee,e as le}from"./chunk-2GJJGO5D.js";import"./chunk-6TYTBQPV.js";import"./chunk-YTRGMILO.js";import{a as D,b as he}from"./chunk-Z7JPWXW2.js";import"./chunk-34Y4CIHD.js";import{a as lt}from"./chunk-WSUYEVSY.js";le();le();var y=class{requiresPhases;requiresEnhancements;async shouldRun(e){return!0}async execute(e){let t=Date.now();try{return{success:!0,data:await this.run(e),durationMs:Date.now()-t,message:`${this.description} completed`}}catch(s){return{success:!1,error:Ee(s),durationMs:Date.now()-t,message:`${this.description} failed: ${E(s)}`}}}checkDependencies(e){if(!this.requiresPhases?.length)return!0;for(let t of this.requiresPhases)if(!e.results.get(t)?.success)return e.services.warn(`Phase ${this.name} requires ${t} which has not completed`),!1;return!0}checkEnhancements(e){if(!this.requiresEnhancements?.length)return!0;for(let t of this.requiresEnhancements)if(!(t==="claudeFlow"?e.enhancements.claudeFlow:t==="ruvector"?e.enhancements.ruvector:!1))return e.services.warn(`Phase ${this.name} requires ${t} which is not available`),!1;return!0}};ce();he();import{existsSync as T}from"fs";import{join as j}from"path";var V=class extends y{name="detection";description="Detect existing installations";order=10;critical=!0;async run(e){let{projectRoot:t}=e,s=await this.detectV2Installation(t),n=T(j(t,".agentic-qe","config.yaml")),o=s.version?.startsWith("3."),r=s.detected,i=n||o||!1,c=!r&&!i;return e.v2Detection=s,{v2Detected:r,v3Detected:i,freshInstall:c,v2Detection:s}}async detectV2Installation(e){let t=j(e,".agentic-qe","memory.db"),s=j(e,".agentic-qe","config"),n=j(e,".claude","agents"),o=j(e,".agentic-qe","config","learning.json"),r=T(t),i=T(s),c=T(n),d=T(o),m=T(j(e,".agentic-qe","config.yaml")),u,p=!1;return r&&(u=this.readVersionFromDb(t),u?p=u.startsWith("3."):u="2.x.x"),{detected:!p&&r&&(!u?.startsWith("3.")||d&&!m),memoryDbPath:r?t:void 0,configPath:i?s:void 0,agentsPath:c?n:void 0,hasMemoryDb:r,hasConfig:i,hasAgents:c,version:u}}readVersionFromDb(e){try{let t=D(e,{readonly:!0,fileMustExist:!0});try{if(!t.prepare(`
|
|
3
3
|
SELECT name FROM sqlite_master
|
|
4
4
|
WHERE type='table' AND name='kv_store'
|
|
5
5
|
`).get()){t.close();return}let n=t.prepare(`
|
|
6
6
|
SELECT value FROM kv_store
|
|
7
7
|
WHERE key = 'aqe_version' AND namespace = '_system'
|
|
8
|
-
`).get();return t.close(),n?_(n.value):void 0}catch{t.close();return}}catch{return}}};var
|
|
8
|
+
`).get();return t.close(),n?_(n.value):void 0}catch{t.close();return}}catch{return}}};var W=class extends y{name="analysis";description="Analyze project structure";order=20;critical=!0;requiresPhases=["detection"];async run(e){let s=await Se(e.projectRoot).analyze();return e.analysis=s,e.services.log(` Project: ${s.projectName}`),e.services.log(` Languages: ${s.languages.map(n=>n.name).join(", ")}`),e.services.log(` Frameworks: ${s.frameworks.map(n=>n.name).join(", ")}`),s}};var H=class extends y{name="configuration";description="Generate configuration";order=30;critical=!0;requiresPhases=["analysis"];async run(e){if(!e.analysis)throw new Error("Analysis phase must complete before configuration");let s=Ae({minimal:e.options.minimal}).recommend(e.analysis);return s=this.applyOptions(s,e),e.config=s,e.services.log(` Version: ${s.version}`),e.services.log(` Learning: ${s.learning.enabled?"enabled":"disabled"}`),e.services.log(` Workers: ${s.workers.enabled.length}`),s}applyOptions(e,t){let{options:s}=t;return s.minimal&&(e.skills.install=!1,e.learning.pretrainedPatterns=!1,e.workers.enabled=[],e.workers.daemonAutoStart=!1),s.skipPatterns&&(e.learning.pretrainedPatterns=!1),s.wizardAnswers&&(e=this.applyWizardAnswers(e,s.wizardAnswers)),e}applyWizardAnswers(e,t){switch(t["project-type"]&&t["project-type"]!=="auto"&&(e.project.type=t["project-type"]),t["learning-mode"]){case"full":e.learning.enabled=!0,e.learning.embeddingModel="transformer";break;case"basic":e.learning.enabled=!0,e.learning.embeddingModel="hash";break;case"disabled":e.learning.enabled=!1;break}return t["load-patterns"]===!1&&(e.learning.pretrainedPatterns=!1),t.hooks===!1&&(e.hooks.claudeCode=!1),t.workers===!1&&(e.workers.daemonAutoStart=!1),t.skills===!1&&(e.skills.install=!1),e}};import{existsSync as G,mkdirSync as ke}from"fs";import{join as U}from"path";var K=class extends y{name="database";description="Initialize persistence database";order=40;critical=!0;requiresPhases=["configuration"];async shouldRun(e){return e.options.memoryBackend!=="memory"}async run(e){let{projectRoot:t}=e,s=U(t,"vectors.db");G(s)&&e.services.log(` \u26A0 Stale vectors.db detected at ${s}
|
|
9
9
|
This file is left over from @ruvector/router (pre-v3.9.6).
|
|
10
10
|
It is no longer read or written by AQE. Safe to delete:
|
|
11
|
-
rm "${s}"`);let n=
|
|
11
|
+
rm "${s}"`);let n=U(t,".agentic-qe");G(n)||ke(n,{recursive:!0});let o=U(n,"workers");G(o)||ke(o,{recursive:!0});let r=U(n,"data");G(r)||ke(r,{recursive:!0});let i=U(n,"memory.db"),c=!G(i);try{let{initializeUnifiedMemory:d,resetUnifiedMemory:m}=await import("./unified-memory-WOOCCIUM.js"),u=await d({dbPath:i,walMode:!0,busyTimeout:5e3}),h=u.getStats().tables.map(B=>B.name);await u.kvSet("_init_marker",{initialized:new Date().toISOString(),projectRoot:t,version:de()},"_system");let P=u.getDatabase().prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;return m(),e.services.log(` Database: ${i}`),e.services.log(` Schema version: v${P}`),e.services.log(` Tables: ${h.length} (v3 full schema)`),{dbPath:i,created:c,tablesCreated:h,schemaVersion:P}}catch(d){throw new Error(`SQLite persistence initialization FAILED: ${d}
|
|
12
12
|
Database path: ${i}
|
|
13
|
-
Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as me,mkdirSync as
|
|
13
|
+
Ensure the directory is writable and has sufficient disk space.`)}}};import{existsSync as me,mkdirSync as ve,writeFileSync as ct}from"fs";import{join as x}from"path";var z=class extends y{name="learning";description="Initialize learning system";order=50;critical=!1;requiresPhases=["database","configuration"];async shouldRun(e){return e.options.memoryBackend==="memory"?!1:e.config?.learning?.enabled??!0}async run(e){let t=e.config,{projectRoot:s,options:n}=e;if(!t.learning.enabled)return{enabled:!1,dataDir:"",hnswDir:"",patternsLoaded:0};let o=x(s,".agentic-qe","data");me(o)||ve(o,{recursive:!0});let r=x(o,"hnsw");me(r)||ve(r,{recursive:!0});let i=x(o,"learning-config.json"),c={embeddingModel:t.learning.embeddingModel,hnswConfig:t.learning.hnswConfig,qualityThreshold:t.learning.qualityThreshold,promotionThreshold:t.learning.promotionThreshold,databasePath:x(o,"memory.db"),hnswIndexPath:x(r,"index.bin"),initialized:new Date().toISOString()};Q(i,c,[["initialized"]]);let d=0;return t.learning.pretrainedPatterns&&!n.skipPatterns&&(d=await this.loadPretrainedPatterns(o,e)),e.services.log(` Data dir: ${o}`),e.services.log(` HNSW dir: ${r}`),e.services.log(` Patterns loaded: ${d}`),{enabled:!0,dataDir:o,hnswDir:r,patternsLoaded:d}}async loadPretrainedPatterns(e,t){try{let s=x(e,"patterns");me(s)||ve(s,{recursive:!0});let n=x(s,"index.json");return me(n)||ct(n,JSON.stringify({version:de(),domains:[],loadedAt:new Date().toISOString()},null,2),"utf-8"),0}catch(s){return t.services.warn(`Could not load pre-trained patterns: ${s}`),0}}};ce();he();import{existsSync as dt,statSync as ut}from"fs";import{join as pe}from"path";var He=3e4,Ge=18e4,Ue=["**/node_modules/**","**/dist/**","**/build/**","**/out/**","**/coverage/**","**/.agentic-qe/**","**/.git/**","**/.next/**","**/.nuxt/**","**/.output/**","**/__pycache__/**","**/.pytest_cache/**","**/target/**","**/vendor/**","**/.venv/**","**/venv/**","**/.tox/**","**/*.min.js","**/*.min.css","**/*.bundle.js","**/*.map","**/package-lock.json","**/yarn.lock","**/pnpm-lock.yaml","**/Pipfile.lock","**/poetry.lock","**/.env","**/.env.*"],J=class extends y{name="code-intelligence";description="Code intelligence pre-scan";order=60;critical=!1;requiresPhases=["database"];async shouldRun(e){if(e.options.memoryBackend==="memory")return e.services.log(" Code intelligence skipped (database-free mode)"),!1;let t=process.env.AQE_SKIP_CODE_INDEX;return t==="1"||t==="true"?(e.services.log(" Code intelligence skipped (AQE_SKIP_CODE_INDEX=1)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):e.options.skipCodeIndex?(e.services.log(" Code intelligence skipped (--skip-code-index)"),e.services.log(" Run `aqe code index` later to build the KG on demand."),!1):!0}async run(e){let{projectRoot:t}=e,s=pe(t,".agentic-qe","memory.db");if(!dt(s))return e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let n=D(s);try{if(!this.checkCodeIntelligenceIndex(n))return n.close(),e.services.log(" Building knowledge graph..."),await this.runCodeIntelligenceScan(t,e,!1);let r=this.getLastIndexedAt(n);if(!r){let d=this.getKGEntryCount(n);return n.close(),e.services.log(` Using existing index (${d} entries)`),{status:"existing",entries:d}}let i=this.getKGEntryCount(n);n.close();let c=await this.findChangedFiles(t,r);return c.length===0?(e.services.log(` Index up to date (${i} entries)`),{status:"existing",entries:i}):(e.services.log(` Delta scan: ${c.length} files changed since last index...`),await this.runCodeIntelligenceScan(t,e,!0,c))}catch(o){try{n.close()}catch{}throw o}}checkCodeIntelligenceIndex(e){try{return e.prepare(`
|
|
14
14
|
SELECT COUNT(*) as count FROM kv_store
|
|
15
15
|
WHERE namespace = 'code-intelligence:kg'
|
|
16
16
|
`).get().count>0}catch{return!1}}getKGEntryCount(e){try{return e.prepare(`
|
|
17
17
|
SELECT COUNT(*) as count FROM kv_store
|
|
18
18
|
WHERE namespace LIKE 'code-intelligence:kg%'
|
|
19
|
-
`).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-
|
|
19
|
+
`).get().count}catch{return 0}}async runCodeIntelligenceScan(e,t,s,n){let{KnowledgeGraphService:o}=await import("./knowledge-graph-2ICXFUUV.js"),r=pe(e,".agentic-qe","memory.db"),i={type:"sqlite",sqlite:{path:r,walMode:!0}},{backend:c}=await xe(i,!0),d=new o(c,{namespace:"code-intelligence:kg",enableVectorEmbeddings:!0});try{let m;if(n)m=n;else{let{glob:p}=await import("tinyglobby");m=(await p(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ue,expandDirectories:!1})).map(g=>pe(e,g))}t.services.log(` Scanning ${m.length} source files...`);let u=await this.runBoundedScan(d,m,s,t);if(u.status==="timeout")return t.services.warn(` \u26A0 Code intelligence pre-scan exceeded ${Ge/1e3}s phase cap. Indexed ${u.entries} entries before timeout. Last file: ${u.timeoutFile??"(unknown)"}. Init is continuing \u2014 re-run 'aqe code index' later, or report this file to https://github.com/proffesor-for-testing/agentic-qe/issues.`),u;if(u.status==="indexed"){let p=s?"Delta indexed":"Indexed";t.services.log(` ${p} ${u.entries} entries to ${r}`),await this.buildHypergraph(r,m,t)}return u}finally{try{d.destroy()}catch{}try{await c.dispose()}catch{}}}async runBoundedScan(e,t,s,n){let o=0,r=0,i=0,c="",d=Date.now(),m=!1;s||await e.clear();let u=n.projectRoot,p=g=>g.startsWith(u)?g.slice(u.length+1):g;for(let g of t){if(Date.now()-d>Ge){m=!0;break}c=g,n.services.log(` [${i+1}/${t.length}] ${p(g)}`);try{let w=await this.withTimeout(e.index({paths:[g],incremental:!0,includeTests:!0}),He,g);w.success&&(o+=w.value.nodesCreated,r+=w.value.edgesCreated)}catch(w){let P=w instanceof Error?w.message:String(w);P.startsWith("AQE_PER_FILE_TIMEOUT")?n.services.warn(` \u26A0 Skipped ${p(g)} \u2014 indexing exceeded ${He/1e3}s`):n.services.warn(` \u26A0 Failed to index ${p(g)}: ${P}`)}i++}let h=o+r;return m?{status:"timeout",entries:h,timeoutFile:c}:{status:"indexed",entries:h}}withTimeout(e,t,s){return new Promise((n,o)=>{let r=setTimeout(()=>{o(new Error(`AQE_PER_FILE_TIMEOUT: ${s}`))},t);typeof r.unref=="function"&&r.unref(),e.then(i=>{clearTimeout(r),n(i)},i=>{clearTimeout(r),o(i)})})}async buildHypergraph(e,t,s){try{let{extractCodeIndex:n}=await import("./code-index-extractor-FG3TMHHR.js"),{createHypergraphEngine:o}=await import("./hypergraph-engine-AXZVP7A7.js"),r=D(e),i=await o({db:r,maxTraversalDepth:10,maxQueryResults:1e3,enableVectorSearch:!1}),c=await n(t),d=await i.buildFromIndexResult(c);r.close(),d.nodesCreated+d.edgesCreated>0&&s.services.log(` Hypergraph: ${d.nodesCreated} nodes, ${d.edgesCreated} edges`)}catch(n){s.services.warn?.(` Hypergraph build skipped: ${n}`)}}getLastIndexedAt(e){try{let t=e.prepare(`
|
|
20
20
|
SELECT value FROM kv_store
|
|
21
21
|
WHERE namespace = 'code-intelligence:kg'
|
|
22
22
|
AND key = 'metadata:index'
|
|
23
|
-
`).get();if(!t)return null;let s=_(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let{glob:s}=await import("tinyglobby"),n=await s(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:
|
|
24
|
-
`);
|
|
25
|
-
`),"utf-8")}let o=
|
|
23
|
+
`).get();if(!t)return null;let s=_(t.value);if(!s.indexedAt)return null;let n=new Date(s.indexedAt);return isNaN(n.getTime())?null:n}catch{return null}}async findChangedFiles(e,t){let{glob:s}=await import("tinyglobby"),n=await s(["**/*.ts","**/*.tsx","**/*.js","**/*.jsx","**/*.py"],{cwd:e,ignore:Ue,expandDirectories:!1}),o=t.getTime(),r=[];for(let i of n){let c=pe(e,i);try{ut(c).mtimeMs>o&&r.push(c)}catch{}}return r}};ce();import{existsSync as C,mkdirSync as Y,readFileSync as Ke,writeFileSync as O}from"fs";import{join as v,dirname as mt}from"path";import{fileURLToPath as pt}from"url";var gt=pt(import.meta.url),ze=mt(gt),ft=[["aqe","initialized"]],X=class extends y{name="hooks";description="Configure Claude Code hooks";order=70;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Hooks skipped (--no-claude)"),!1):e.config?.hooks?.claudeCode??!0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.hooks.claudeCode)return{configured:!1,settingsPath:"",hookTypes:[],existingAqeDetected:!1};let n=v(s,".claude");C(n)||Y(n,{recursive:!0});let o=v(n,"hooks");C(o)||Y(o,{recursive:!0});let r=v(n,"settings.json"),i={},c;if(C(r))try{let b=Ke(r,"utf-8");i=_(b),c=_(b)}catch{i={}}let d=this.generateHooksConfig(t,s),m=Object.keys(d),u=i.hooks||{},p=this.hasExistingAqeHooks(u);p&&e.services.log(" Detected existing AQE hooks \u2014 replacing with updated config"),i.hooks=Te(u,d);let h=i.env,g={memoryBackend:e.options.memoryBackend};i.env=je(h,Oe(t,g),g);let w=Fe(t,s,g);Me(i,w,{statusLine:!e.options.noStatusLine,...g});let P=i.enabledMcpjsonServers||[];if(P=P.filter(b=>b!=="aqe"),P.includes("agentic-qe")||P.push("agentic-qe"),i.enabledMcpjsonServers=P,De(c,i,ft)){let b=$e(r);b&&e.services.log(` Backup created: ${b}`),O(r,JSON.stringify(i,null,2),"utf-8")}else e.services.log(" Settings unchanged \u2014 .claude/settings.json left as-is");this.writeHooksReadme(o,m),this.installHookAssets(o,e);try{let b=Ke(r,"utf-8"),ae=_(b).hooks;(!ae||!this.hasExistingAqeHooks(ae))&&e.services.log(" WARNING: settings.json written but AQE hooks not detected \u2014 check settings-merge logic")}catch{e.services.log(" WARNING: Could not verify settings.json after write")}return e.services.log(` Settings: ${r}`),e.services.log(` Hooks dir: ${o}`),e.services.log(` Hook types: ${m.join(", ")}`),{configured:!0,settingsPath:r,hookTypes:m,existingAqeDetected:p}}writeHooksReadme(e,t){let s=v(e,"README.txt");if(C(s))return;let n=["AQE Hooks Directory","====================","","Claude Code hooks are configured in .claude/settings.json (not as files here).","This directory contains supporting infrastructure for the learning system.","","Configured hook types: "+t.join(", "),"","Files:"," settings.json \u2014 Hook definitions (in parent .claude/ directory)"," helpers/brain-checkpoint.cjs \u2014 Auto-exports brain to aqe.rvf on session end"," cross-phase-memory.yaml \u2014 QCSD feedback loop configuration","","Manual testing:"," npx agentic-qe hooks session-start --session-id test --json",' npx agentic-qe hooks route --task "generate tests" --json'," npx agentic-qe hooks post-edit --file src/example.ts --success --json",""].join(`
|
|
24
|
+
`);O(s,n,"utf-8")}installHookAssets(e,t){let{projectRoot:s}=t;this.installBrainCheckpoint(s,t),this.installStatusline(s,t),this.installHookShim(s,t);let n=v(e,"cross-phase-memory.yaml");if(!C(n)){let r=[v(s,"v3","assets","hooks","cross-phase-memory.yaml"),v(s,"assets","hooks","cross-phase-memory.yaml"),v(s,"node_modules","agentic-qe","v3","assets","hooks","cross-phase-memory.yaml")],i=!1;for(let c of r)if(C(c)){let{copyFileSync:d}=lt("fs");d(c,n),t.services.log(" Installed cross-phase memory config"),i=!0;break}i||O(n,["# Cross-Phase Memory Hooks Configuration","# Generated by aqe init",'version: "1.0"',"enabled: true",""].join(`
|
|
25
|
+
`),"utf-8")}let o=v(e,"v3-domain-workers.json");C(o)||O(o,JSON.stringify({version:"3.0",workers:[{name:"pattern-consolidator",interval:"5m",enabled:!0},{name:"routing-accuracy-monitor",interval:"10m",enabled:!0},{name:"coverage-gap-scanner",interval:"15m",enabled:!0},{name:"flaky-test-detector",interval:"30m",enabled:!0}]},null,2),"utf-8")}hasExistingAqeHooks(e){for(let t of Object.values(e))if(Array.isArray(t)){for(let s of t)if(qe(s))return!0}return!1}installBrainCheckpoint(e,t){let s=v(e,".claude","helpers");C(s)||Y(s,{recursive:!0});let n=v(s,"brain-checkpoint.cjs"),o=[v(e,".claude","helpers","brain-checkpoint.cjs"),v(e,"node_modules","agentic-qe",".claude","helpers","brain-checkpoint.cjs"),v(ze,"..","..","..",".claude","helpers","brain-checkpoint.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed brain-checkpoint.cjs (copied)");return}C(n)||(O(n,this.generateBrainCheckpointScript(),"utf-8"),t.services.log(" Installed brain-checkpoint.cjs (generated)"))}installStatusline(e,t){let s=v(e,".claude","helpers");C(s)||Y(s,{recursive:!0});let n=v(s,"statusline-v3.cjs"),o=[v(e,"node_modules","agentic-qe","assets","helpers","statusline-v3.cjs"),v(e,"assets","helpers","statusline-v3.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed statusline-v3.cjs (copied)");return}C(n)||(O(n,this.generateMinimalStatuslineScript(),"utf-8"),t.services.log(" Installed statusline-v3.cjs (generated)"))}installHookShim(e,t){let s=v(e,".claude","hooks");C(s)||Y(s,{recursive:!0});let n=v(s,"aqe-hook.cjs"),o=[v(e,"node_modules","agentic-qe",".claude","hooks","aqe-hook.cjs"),v(ze,"..","..","..",".claude","hooks","aqe-hook.cjs")];for(let r of o)if(C(r)&&r!==n){ue(r,n)&&t.services.log(" Installed aqe-hook.cjs (copied)");return}C(n)||t.services.log(" \u26A0 aqe-hook.cjs source not found \u2014 lifecycle hooks cannot run until AQE is reinstalled")}generateMinimalStatuslineScript(){return`#!/usr/bin/env node
|
|
26
26
|
/**
|
|
27
27
|
* Agentic QE v3 Statusline (minimal fallback, generated by aqe init)
|
|
28
28
|
* For the full statusline, reinstall: npx agentic-qe init --auto
|
|
@@ -68,16 +68,39 @@ const AQE_DIR = path.join(PROJECT_ROOT, '.agentic-qe');
|
|
|
68
68
|
const RVF_PATH = path.join(AQE_DIR, 'aqe.rvf');
|
|
69
69
|
const DB_PATH = path.join(AQE_DIR, 'memory.db');
|
|
70
70
|
const MAX_AGE_HOURS = 24;
|
|
71
|
-
|
|
71
|
+
// Windows (#872): never execFile aqe.cmd (EINVAL without a shell); reuse the
|
|
72
|
+
// hook shim's resolver, which runs the AQE bundle via node instead.
|
|
73
|
+
function aqeInvocation() {
|
|
74
|
+
if (process.platform !== 'win32') return { cmd: process.env.AQE_HOOK_BIN || 'aqe', args: [] };
|
|
75
|
+
const shimPath = path.join(__dirname, '..', 'hooks', 'aqe-hook.cjs');
|
|
76
|
+
let src = '';
|
|
77
|
+
try { src = fs.readFileSync(shimPath, 'utf8'); } catch { /* missing */ }
|
|
78
|
+
// An older shim runs its hook main (spawn + exit) when required.
|
|
79
|
+
if (!src.includes('resolveAqeInvocation') || !src.includes('require.main === module')) {
|
|
80
|
+
return { cmd: null, args: [], reason: '.claude/hooks/aqe-hook.cjs is missing or predates #872; re-run aqe init' };
|
|
81
|
+
}
|
|
82
|
+
try {
|
|
83
|
+
return require(shimPath).resolveAqeInvocation({ project: PROJECT_ROOT });
|
|
84
|
+
} catch (e) {
|
|
85
|
+
return { cmd: null, args: [], reason: 'aqe-hook.cjs failed to load: ' + e.message };
|
|
86
|
+
}
|
|
87
|
+
}
|
|
72
88
|
|
|
73
89
|
function log(msg) { process.stderr.write('[brain-checkpoint] ' + msg + '\\n'); }
|
|
74
90
|
|
|
75
91
|
function exportBrain() {
|
|
76
92
|
if (!fs.existsSync(DB_PATH)) { log('No memory.db, skipping'); return { exported: false }; }
|
|
93
|
+
const aqe = aqeInvocation();
|
|
94
|
+
if (!aqe.cmd) { log('Export skipped: ' + aqe.reason); return { exported: false, reason: aqe.reason }; }
|
|
95
|
+
// Never write through a committed symlink: .agentic-qe must be a real dir, and
|
|
96
|
+
// unlink (not existsSync) drops a planted aqe.rvf link, even a dangling one.
|
|
97
|
+
let st; try { st = fs.lstatSync(AQE_DIR); } catch { /* missing */ }
|
|
98
|
+
if (!st || !st.isDirectory()) { log('Export skipped: .agentic-qe is a symlink'); return { exported: false }; }
|
|
99
|
+
for (const f of [RVF_PATH, RVF_PATH + '.idmap.json']) { try { fs.unlinkSync(f); } catch { /* absent */ } }
|
|
77
100
|
try {
|
|
78
101
|
const result = execFileSync(
|
|
79
|
-
|
|
80
|
-
{ timeout: 60000, encoding: 'utf-8' }
|
|
102
|
+
aqe.cmd, [...aqe.args, 'brain', 'export', '-o', RVF_PATH, '--format', 'rvf'],
|
|
103
|
+
{ timeout: 60000, encoding: 'utf-8', windowsHide: true }
|
|
81
104
|
);
|
|
82
105
|
const m = result.match(/Patterns:\\s+(\\d+)/);
|
|
83
106
|
const p = m ? m[1] : '0';
|
|
@@ -105,16 +128,17 @@ function verifyBrain() {
|
|
|
105
128
|
const cmd = process.argv[2] || 'verify';
|
|
106
129
|
const result = cmd === 'export' ? exportBrain() : verifyBrain();
|
|
107
130
|
if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
|
|
108
|
-
`}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:60,continueOnError:!0}]}]}}};import{existsSync as ht,readFileSync as yt}from"fs";ce();import{join as
|
|
131
|
+
`}generateHooksConfig(e,t){return{PreToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',timeout:3,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],PostToolUse:[{matcher:"^(Write|Edit|MultiEdit)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',timeout:5,continueOnError:!0}]},{matcher:"^Bash$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',timeout:5,continueOnError:!0}]},{matcher:"^(Task|Agent)$",hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',timeout:5,continueOnError:!0}]}],UserPromptSubmit:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',timeout:5,continueOnError:!0}]}],SessionStart:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',timeout:10,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" verify --json'`,timeout:5,continueOnError:!0}]}],Stop:[{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',timeout:5,continueOnError:!0}]},{hooks:[{type:"command",command:`sh -c 'exec node "\${CLAUDE_PROJECT_DIR:-.}/.claude/helpers/brain-checkpoint.cjs" export --json'`,timeout:60,continueOnError:!0}]}]}}};import{existsSync as ht,readFileSync as yt}from"fs";ce();import{join as kt}from"path";var Z=class extends y{constructor(t=s=>Ne(s)){super();this.detectPlugin=t}detectPlugin;name="mcp";description="Configure MCP server";order=80;critical=!1;requiresPhases=["configuration","database"];async run(t){let{projectRoot:s}=t;if(t.options.noClaude)return t.services.log(" MCP: skipped (--no-claude \u2014 .mcp.json is the Claude Code surface)"),{configured:!1,mcpPath:"",serverName:""};if(t.options.noMcp)return t.services.log(" MCP: skipped (--no-mcp)"),t.services.log(" CLI commands available: aqe memory, aqe test, aqe coverage, etc."),{configured:!1,mcpPath:"",serverName:""};if(!t.options.withMcp){let m=this.detectPlugin(s);if(m.enabled)return t.services.log(Be(s)),{configured:!1,mcpPath:"",serverName:"",skippedForPlugin:m.pluginKey}}let n=t.options.memoryBackend==="memory",r={command:"aqe-mcp",args:[],env:n?{AQE_MEMORY_BACKEND:"memory",AQE_LEARNING_ENABLED:"false",AQE_WORKERS_ENABLED:"false",NODE_ENV:"production"}:{AQE_LEARNING_ENABLED:"true",AQE_WORKERS_ENABLED:"true",NODE_ENV:"production"}},i=kt(s,".mcp.json"),c={};if(ht(i))try{let m=yt(i,"utf-8");c=_(m)}catch{c={}}c.mcpServers||(c.mcpServers={});let d=c.mcpServers;return d["agentic-qe"]=r,L(i,JSON.stringify(c,null,2)),t.services.log(` MCP config: ${i}`),t.services.log(" Server: agentic-qe"),n?(t.services.log(" Memory backend: in-memory (database-free)"),t.services.log(" Learning: disabled (db-free)"),t.services.log(" Workers: disabled (db-free)")):(t.services.log(" Learning: enabled"),t.services.log(" Workers: enabled")),{configured:!0,mcpPath:i,serverName:"agentic-qe"}}};import{existsSync as S,readFileSync as wt,readdirSync as Ct}from"fs";import{join as A}from"path";le();import{spawnSync as vt}from"node:child_process";import*as ge from"node:os";import*as Ye from"node:fs";var M="vibium@^26.8.21",Xe={platform:()=>ge.platform(),arch:()=>ge.arch(),existsSync:l=>Ye.existsSync(l)},Je=["/usr/bin/chromium","/usr/bin/chromium-browser","/usr/bin/google-chrome","/usr/bin/google-chrome-stable","/snap/bin/chromium"];function be(l=Xe){if(l.platform()!=="linux"||l.arch()!=="arm64")return;let e=Je.find(t=>l.existsSync(t));return e?{code:"linux-arm64-system-chromium-found",browserPath:e,message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. Found system browser at ${e}. Export VIBIUM_BROWSER_PATH=${e} before running vibium.`}:{code:"linux-arm64-no-system-chromium",message:`Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system chromium was found on PATH (checked: ${Je.join(", ")}). Install via \`apt-get install chromium\` (or your distro's equivalent), then export VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`}}function ee(l,e,t,s){return l(e,t,{encoding:"utf8",timeout:s,maxBuffer:8*1024*1024})}var we=(l,e,t)=>vt(l,e,t);function bt(l=we,e=5e3){let t=ee(l,"vibium",["--version"],e);if(t.status!==0)return null;let s=(t.stdout||"").trim(),n=(t.stderr||"").trim(),o=s||n;if(!o)return"unknown";let r=o.match(/v?(\d+\.\d+\.\d+(?:[-+][\w.]+)?)/);return r?r[1]:o.split(/\s+/)[0]||"unknown"}function te(l=we,e=5e3){let t=bt(l,e);if(!t)return{status:"cli-missing"};let s=/^(\d+)\.(\d+)\.(\d+)(?:\+[\w.]+)?$/.exec(t);if(!s||Number(s[1])!==26||Number(s[2])<8||Number(s[2])===8&&Number(s[3])<21)return{status:"unsupported-version",version:t,message:`Vibium ${t} is unsupported; install ${M} for the browser.start() API`};let n=ee(l,"vibium",["is-installed"],e);return n.status===0?{status:"ready",version:t}:{status:"payload-missing",version:t,message:n.stderr?.trim()||n.stdout?.trim()||E(n.error)||"Vibium Chrome/chromedriver payload is missing or incomplete"}}function Ze(l={}){let e=l.packageSpec||M;if(l.skip)return{status:"skipped",packageSpec:e,message:"install skipped by options"};let t=l.spawner||we,s=l.platformProbe||Xe,n=be(s),o=te(t);if(o.status==="ready")return{status:"already-installed",version:o.version,packageSpec:e,platformHint:n};let r=l.npmBin||"npm",i=ee(t,r,["--version"],5e3);if(i.error||i.status!==0)return{status:"npm-unavailable",packageSpec:e,message:`npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${e}\`.`};let c=l.timeoutMs||18e4,d=ee(t,r,["install","-g",e],c);if(d.status!==0)return{status:"install-failed",packageSpec:e,message:d.stderr?.trim()||d.stdout?.trim()||E(d.error)||"unknown npm install failure"};let m=te(t);if(m.status==="payload-missing"){let u=ee(t,"vibium",["install"],c);if(u.status!==0)return{status:"install-failed",packageSpec:e,platformHint:n,message:`Browser payload installation failed: ${u.stderr?.trim()||u.stdout?.trim()||"vibium install failed"}. Run \`vibium install\` and verify with \`vibium is-installed\`.`};m=te(t)}if(m.status!=="ready"){let u=m.message?`: ${m.message}`:"";return{status:"install-failed",packageSpec:e,platformHint:n,message:`npm completed, but Vibium readiness verification failed (${m.status})${u}. Run \`npm install -g ${e}\`, then verify with \`vibium is-installed\`.`}}return{status:"installed",version:m.version,packageSpec:e,platformHint:n}}var ne=class extends y{name="assets";description="Install skills and agents";order=90;critical=!1;requiresPhases=["configuration"];async run(e){let t=e.config,{projectRoot:s,options:n}=e,o=this.detectVersionUpgrade(e),r=n.upgrade||t.skills.overwrite||n.autoMode&&o,i=0,c=0,d=0,m=0,u=0,p=0,h=0,g=0,w=0,P,B;if(n.upgrade?e.services.log(" Upgrade mode: overwriting existing files"):n.autoMode&&o&&e.services.log(" Version upgrade detected: updating skills and agents"),!n.noClaude&&t.skills.install){let k=await Qe({projectRoot:s,installV2Skills:t.skills.installV2,installV3Skills:t.skills.installV3,overwrite:r}).install();i=k.installed.length,k.errors.length>0&&e.services.warn(`Skills warnings: ${k.errors.join(", ")}`)}if(!n.noClaude){try{let k=await Ve({projectRoot:s,installQEAgents:!0,installSubagents:!0,overwrite:r}).install();c=k.installed.length,k.errors.length>0&&e.services.warn(`Agents warnings: ${k.errors.join(", ")}`)}catch(f){e.services.warn(`Agents install error: ${f instanceof Error?f.message:f}`)}Re(s)}let b;if(n.browserEngine===!0&&!n.minimal)try{let f=te();if(f.status==="ready")b={status:"already-installed",version:f.version,packageSpec:M,platformHint:be()},e.services.log(` Browser engine: vibium ${b.version} (already installed)`);else switch(e.services.log(" Browser engine: installing vibium via npm (this can take 1\u20133 minutes on first run; downloads Chrome for Testing)\u2026"),b=Ze({skip:!1}),b.status){case"installed":e.services.log(` Browser engine: vibium ${b.version} installed`);break;case"skipped":e.services.log(" Browser engine: skipped");break;case"install-failed":e.services.warn(`Browser engine install failed (qe-browser skill will be unavailable until you run \`aqe init --browser-engine\`): ${b.message||"unknown"}`);break;case"npm-unavailable":e.services.warn("Browser engine: npm not on PATH \u2014 install Node.js + npm, then `aqe init --browser-engine` to enable qe-browser");break}b?.platformHint&&e.services.warn(` Browser engine platform hint: ${b.platformHint.message}`)}catch(f){let k=f instanceof Error?f.message:String(f);e.services.warn(`Browser engine install error: ${k}
|
|
109
132
|
qe-browser fleet skill will be unavailable until you run:
|
|
110
|
-
npm install -g ${
|
|
111
|
-
Then re-run \`aqe init --browser-engine\` to verify. The rest of the AQE install will continue.`)}else b={status:"skipped",packageSpec:
|
|
133
|
+
npm install -g ${M}
|
|
134
|
+
Then re-run \`aqe init --browser-engine\` to verify. The rest of the AQE install will continue.`)}else b={status:"skipped",packageSpec:M,message:n.minimal?"minimal mode":"browser setup not requested; run aqe init --browser-engine"};if(n.withN8n){let k=await We({projectRoot:s,installAgents:!0,installSkills:!0,overwrite:r,n8nApiConfig:n.n8nApiConfig}).install();d=k.agentsInstalled.length,m=k.skillsInstalled.length,k.errors.length>0&&e.services.warn(`N8n warnings: ${k.errors.join(", ")}`)}let fe=n.autoMode&&S(A(s,"opencode.json"));if(n.withOpenCode||fe){let{createOpenCodeInstaller:f}=await import("./opencode-installer-2XRZUTLR.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installTools:!1,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();u=a.agentsInstalled.length,p=a.skillsInstalled.length,a.errors.length>0&&e.services.warn(`OpenCode warnings: ${a.errors.join(", ")}`)}e.services.log(` Skills: ${i}`),e.services.log(` Agents: ${c}`),n.withN8n&&(e.services.log(` N8n agents: ${d}`),e.services.log(` N8n skills: ${m}`)),(n.withOpenCode||fe)&&(e.services.log(` OpenCode agents: ${u}`),e.services.log(` OpenCode skills: ${p}`));let ae=n.autoMode&&S(A(s,".kiro"));if(n.withKiro||ae){let{createKiroInstaller:f}=await import("./kiro-installer-VYBFP6ZH.js"),a=await f({projectRoot:s,installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();h=a.agentsInstalled.length,g=a.skillsInstalled.length,w=a.hooksInstalled.length,a.errors.length>0&&e.services.warn(`Kiro warnings: ${a.errors.join(", ")}`),e.services.log(` Kiro agents: ${h}`),e.services.log(` Kiro skills: ${g}`),e.services.log(` Kiro hooks: ${w}`),e.services.log(` Kiro steering: ${a.steeringInstalled.length}`),a.mcpConfigured&&e.services.log(" Kiro MCP: .kiro/settings/mcp.json")}let R=[];if(n.withCopilot||n.autoMode&&S(A(s,".vscode"))){let{createCopilotInstaller:f}=await import("./copilot-installer-5QK565JX.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("copilot"),a.errors.length>0&&e.services.warn(`Copilot warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Copilot MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Copilot rules: ${a.rulesPath}`)}if(n.withCursor||n.autoMode&&S(A(s,".cursor"))){let{createCursorInstaller:f}=await import("./cursor-installer-3BL7JACV.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("cursor"),a.errors.length>0&&e.services.warn(`Cursor warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cursor MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Cursor rules: ${a.rulesPath}`)}if(n.withCline){let{createClineInstaller:f}=await import("./cline-installer-HWMQZJ64.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("cline"),a.errors.length>0&&e.services.warn(`Cline warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Cline MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Cline mode: ${a.modePath}`)}if(n.withKiloCode||n.autoMode&&S(A(s,".kilocode"))){let{createKiloCodeInstaller:f}=await import("./kilocode-installer-JICGAHLM.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("kilocode"),a.errors.length>0&&e.services.warn(`Kilo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Kilo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Kilo Code mode: ${a.modePath}`)}if(n.withRooCode||n.autoMode&&S(A(s,".roo"))){let{createRooCodeInstaller:f}=await import("./roocode-installer-NSGGTWXE.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("roocode"),a.errors.length>0&&e.services.warn(`Roo Code warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Roo Code MCP: ${a.configPath}`),a.modeInstalled&&e.services.log(` Roo Code mode: ${a.modePath}`)}if(n.withCodex||n.autoMode&&S(A(s,".codex"))){let{createCodexInstaller:f}=await import("./codex-installer-63JARKKS.js"),a=await f({projectRoot:s,overwrite:r,installMcp:!n.noMcp,includeRuflo:n.withRuflo,guidancePolicy:n.codexGuidance,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();P={policy:a.guidancePolicy,ownedBytes:a.ownedGuidanceBytes},B={hooks:a.components.hooks,skills:a.components.skills},a.mcpConfigured&&R.push("codex"),a.errors.length>0&&e.services.warn(`Codex warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Codex MCP: ${a.configPath}`),a.agentsMdInstalled&&e.services.log(` Codex AGENTS.md: ${a.agentsMdPath}`),a.hooksConfigured&&e.services.log(` Codex hooks: ${a.hooksPath}`),a.skillsInstalled>0&&e.services.log(` Codex skills: ${a.skillsInstalled} installed`),e.services.log(n.withRuflo?" Codex Ruflo integration: enabled":" Codex Ruflo integration: not installed (opt in with --with-ruflo)")}if(n.withWindsurf||n.autoMode&&S(A(s,".windsurf"))){let{createWindsurfInstaller:f}=await import("./windsurf-installer-4KS2466T.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("windsurf"),a.errors.length>0&&e.services.warn(`Windsurf warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Windsurf MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Windsurf rules: ${a.rulesPath}`)}if(n.withContinueDev||n.autoMode&&S(A(s,".continue"))){let{createContinueDevInstaller:f}=await import("./continuedev-installer-ZAWDSUR3.js"),a=await f({projectRoot:s,overwrite:r,memoryBackend:n.memoryBackend==="memory"?"memory":void 0}).install();a.mcpConfigured&&R.push("continuedev"),a.errors.length>0&&e.services.warn(`Continue.dev warnings: ${a.errors.join(", ")}`),a.mcpConfigured&&e.services.log(` Continue.dev MCP: ${a.configPath}`),a.rulesInstalled&&e.services.log(` Continue.dev rules: ${a.rulesPath}`)}return R.length>0&&e.services.log(` Platforms configured: ${R.join(", ")}`),{skillsInstalled:i,agentsInstalled:c,n8nAgents:d,n8nSkills:m,openCodeAgents:u,openCodeSkills:p,kiroAgents:h,kiroSkills:g,kiroHooks:w,platformsConfigured:R,browserEngine:b,codexGuidance:P,codexComponents:B}}detectVersionUpgrade(e){let t=e.config.version,s=A(e.projectRoot,".agentic-qe","config.yaml");if(S(s))try{let i=wt(s,"utf-8").match(/version:\s*"?([^"\n]+)"?/)?.[1];if(i===t)return!1;if(i!==void 0)return!0}catch{}let n=A(e.projectRoot,".claude","agents","v3");try{return S(n)&&Ct(n).some(o=>o.endsWith(".md")&&o.startsWith("qe-"))}catch{return!1}}};import{existsSync as It,mkdirSync as Pt}from"fs";import{join as F,dirname as Et}from"path";import{fileURLToPath as Rt}from"url";var St=Rt(import.meta.url),ls=Et(St),se=class extends y{name="workers";description="Configure background workers";order=100;critical=!1;requiresPhases=["configuration"];async shouldRun(e){if(e.options.memoryBackend==="memory")return!1;let t=e.config;return t?.workers?.daemonAutoStart&&(t?.workers?.enabled?.length??0)>0}async run(e){let t=e.config,{projectRoot:s}=e;if(!t.workers.daemonAutoStart||t.workers.enabled.length===0)return{workersDir:"",workersConfigured:0,registryPath:"",daemonStarted:!1,daemonPid:null};let n=F(s,".agentic-qe","workers");It(n)||Pt(n,{recursive:!0});let o={"learning-consolidation":18e5,"pattern-consolidator":18e5,"test-health":3e5,"coverage-tracker":6e5,"coverage-gap-scanner":6e5,"flaky-detector":9e5,"flaky-test-detector":9e5,"security-scan":18e5,"quality-gate":3e5,"compliance-checker":18e5,"defect-predictor":9e5,"regression-monitor":6e5,"routing-accuracy-monitor":9e5,"performance-baseline":36e5,"cloud-sync":3e5},r={};for(let h of t.workers.enabled)r[h]={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,lastRun:null,status:"pending"};let i=F(n,"registry.json"),c={version:t.version,maxConcurrent:t.workers.maxConcurrent,workers:r,createdAt:new Date().toISOString(),daemonPid:null};Q(i,c,[["createdAt"]]);for(let h of t.workers.enabled){let g=F(n,`${h}.json`),w={name:h,enabled:!0,interval:t.workers.intervals[h]||o[h]||6e4,projectRoot:s,dataDir:F(s,".agentic-qe","data"),createdAt:new Date().toISOString()};Q(g,w,[["createdAt"]])}let d=F(n,"start-daemon.cjs");L(d,`#!/usr/bin/env node
|
|
112
135
|
// AQE v3 Worker Daemon Startup Script (cross-platform)
|
|
113
136
|
// Generated by aqe init
|
|
114
137
|
// Starts the MCP server with background workers enabled
|
|
115
138
|
|
|
116
|
-
const
|
|
117
|
-
const {
|
|
139
|
+
const fs = require('fs');
|
|
140
|
+
const { existsSync, readFileSync } = fs;
|
|
141
|
+
const { join, dirname } = require('path');
|
|
118
142
|
const { spawn } = require('child_process');
|
|
119
143
|
|
|
120
144
|
const projectRoot = join(__dirname, '..', '..');
|
|
@@ -122,8 +146,33 @@ const workersDir = join(projectRoot, '.agentic-qe', 'workers');
|
|
|
122
146
|
const pidFile = join(workersDir, 'daemon.pid');
|
|
123
147
|
const logFile = join(workersDir, 'daemon.log');
|
|
124
148
|
|
|
125
|
-
//
|
|
126
|
-
|
|
149
|
+
// A repository can commit .agentic-qe, workers/ or a file in it as a symlink.
|
|
150
|
+
// Never write through one (#970): real directories only, appends only to a
|
|
151
|
+
// regular file (lstat + O_NOFOLLOW where the platform has it), and the pid file
|
|
152
|
+
// is replaced by rename instead of being written in place.
|
|
153
|
+
function isRealDir(d) { try { const s = fs.lstatSync(d); return s.isDirectory() && !s.isSymbolicLink(); } catch { return false; } }
|
|
154
|
+
function isRegularOrAbsent(f) { try { return fs.lstatSync(f).isFile(); } catch (e) { return !!e && e.code === 'ENOENT'; } }
|
|
155
|
+
if (!isRealDir(join(projectRoot, '.agentic-qe')) || !isRealDir(workersDir)) {
|
|
156
|
+
console.error('AQE v3 Worker Daemon not started: .agentic-qe/workers must be a real directory, not a symlink');
|
|
157
|
+
process.exit(1);
|
|
158
|
+
}
|
|
159
|
+
function appendFileSync(file, data) {
|
|
160
|
+
if (!isRegularOrAbsent(file)) return;
|
|
161
|
+
const c = fs.constants;
|
|
162
|
+
let fd;
|
|
163
|
+
try {
|
|
164
|
+
fd = fs.openSync(file, c.O_APPEND | c.O_CREAT | c.O_WRONLY | (c.O_NOFOLLOW || 0), 0o644);
|
|
165
|
+
fs.writeSync(fd, data);
|
|
166
|
+
} catch {} finally { if (fd !== undefined) { try { fs.closeSync(fd); } catch {} } }
|
|
167
|
+
}
|
|
168
|
+
function writeFileSync(file, data) {
|
|
169
|
+
const tmp = file + '.' + process.pid + '.' + Date.now() + '.tmp';
|
|
170
|
+
try { fs.writeFileSync(tmp, data, { flag: 'wx' }); fs.renameSync(tmp, file); }
|
|
171
|
+
catch { try { fs.unlinkSync(tmp); } catch {} }
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Check if already running (only trust a regular pid file, never a link target)
|
|
175
|
+
if (existsSync(pidFile) && isRegularOrAbsent(pidFile)) {
|
|
127
176
|
const pid = parseInt(readFileSync(pidFile, 'utf-8').trim(), 10);
|
|
128
177
|
try { process.kill(pid, 0); console.log('Daemon already running (PID: ' + pid + ')'); process.exit(0); } catch {}
|
|
129
178
|
}
|
|
@@ -165,8 +214,18 @@ if (binCandidate && binCandidate.endsWith('bundle.js')) {
|
|
|
165
214
|
mcpCmd = binCandidate;
|
|
166
215
|
mcpArgs = [];
|
|
167
216
|
} else {
|
|
168
|
-
|
|
169
|
-
|
|
217
|
+
// Windows (#872): npx is npx.cmd, which spawn() refuses to start without a
|
|
218
|
+
// shell (EINVAL since CVE-2024-27980). Run npm's bundled npx CLI via node.
|
|
219
|
+
const npxCli = join(dirname(process.execPath), 'node_modules', 'npm', 'bin', 'npx-cli.js');
|
|
220
|
+
if (process.platform === 'win32' && !existsSync(npxCli)) {
|
|
221
|
+
appendFileSync(logFile, '[' + ts + '] ERROR: no AQE MCP bundle found and npx-cli.js is missing next to node.exe; install agentic-qe locally (npm install -D agentic-qe).\\n');
|
|
222
|
+
console.error('AQE v3 Worker Daemon not started: agentic-qe MCP bundle not found (see ' + logFile + ')');
|
|
223
|
+
process.exit(1);
|
|
224
|
+
}
|
|
225
|
+
mcpCmd = process.platform === 'win32' ? process.execPath : 'npx';
|
|
226
|
+
mcpArgs = process.platform === 'win32'
|
|
227
|
+
? [npxCli, '--yes', 'agentic-qe', 'mcp']
|
|
228
|
+
: ['--yes', 'agentic-qe', 'mcp'];
|
|
170
229
|
appendFileSync(logFile, '[' + ts + '] WARNING: using npx fallback \u2014 daemon.pid will point at the npx wrapper, not the MCP server. \`aqe daemon status\` may misreport liveness after the wrapper exits.\\n');
|
|
171
230
|
}
|
|
172
231
|
|
|
@@ -183,7 +242,7 @@ appendFileSync(logFile, '[' + ts + '] Daemon started with PID: ' + child.pid + '
|
|
|
183
242
|
console.log('AQE v3 Worker Daemon started (PID: ' + child.pid + ')');
|
|
184
243
|
console.log('Log file: ' + logFile);
|
|
185
244
|
console.log('To stop: node ' + join(workersDir, 'stop-daemon.cjs'));
|
|
186
|
-
`);let u=
|
|
245
|
+
`);let u=F(n,"stop-daemon.cjs");return L(u,`#!/usr/bin/env node
|
|
187
246
|
// AQE v3 Worker Daemon Stop Script (cross-platform)
|
|
188
247
|
// Generated by aqe init
|
|
189
248
|
|
|
@@ -206,7 +265,7 @@ try {
|
|
|
206
265
|
console.log('Daemon not running (stale PID file)');
|
|
207
266
|
try { unlinkSync(pidFile); } catch {}
|
|
208
267
|
}
|
|
209
|
-
`),e.services.log(` Workers dir: ${n}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`),e.services.log(` Registry: ${i}`),{workersDir:n,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:!1,daemonPid:null}}};import{existsSync as At,readFileSync as _t,writeFileSync as Ce}from"fs";import{join as
|
|
268
|
+
`),e.services.log(` Workers dir: ${n}`),e.services.log(` Workers: ${t.workers.enabled.join(", ")}`),e.services.log(` Registry: ${i}`),{workersDir:n,workersConfigured:t.workers.enabled.length,registryPath:i,daemonStarted:!1,daemonPid:null}}};import{existsSync as At,readFileSync as _t,writeFileSync as Ce}from"fs";import{join as et}from"path";var re=class extends y{name="claude-md";description="Generate CLAUDE.md";order=110;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" CLAUDE.md skipped (--no-claude)"),!1):!0}async run(e){let t=e.config,{projectRoot:s}=e,n=et(s,"CLAUDE.md"),o=this.generateContent(t),r=!1;if(At(n)){let i=_t(n,"utf-8");if(i.includes("## Agentic QE v3"))return e.services.log(" CLAUDE.md already has AQE section"),{generated:!1,path:n,backupCreated:!1};let c=et(s,"CLAUDE.md.backup");Ce(c,i,"utf-8"),r=!0,Ce(n,i+`
|
|
210
269
|
|
|
211
270
|
`+o,"utf-8")}else Ce(n,o,"utf-8");return e.services.log(` Path: ${n}`),r&&e.services.log(" Backup created"),{generated:!0,path:n,backupCreated:r}}generateContent(e){let t=e.domains.enabled.slice(0,6).join(", "),s=Math.max(0,e.domains.enabled.length-6);return`## Agentic QE v3
|
|
212
271
|
|
|
@@ -370,7 +429,7 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
|
|
|
370
429
|
|
|
371
430
|
---
|
|
372
431
|
*Generated by AQE v3 init - ${new Date().toISOString()}*
|
|
373
|
-
`}};import{existsSync as
|
|
432
|
+
`}};import{existsSync as $,readFileSync as Dt}from"fs";import{join as N,dirname as xt}from"path";import{mkdirSync as tt}from"fs";he();var $t=/^# \d{4}-\d{2}-\d{2}T[\d:.]+Z$/,oe=class extends y{name="verification";description="Verify installation";order=120;critical=!0;requiresPhases=["database","configuration"];async run(e){let t=e.config,{projectRoot:s}=e,n=[],o=e.options.memoryBackend==="memory",r=N(s,".agentic-qe","memory.db");n.push({name:o?"Database (in-memory mode)":"Database exists",passed:o||$(r)}),n.push({name:".agentic-qe directory",passed:$(N(s,".agentic-qe"))});let i=N(s,".agentic-qe","config.yaml");await this.saveConfig(t,s),n.push({name:"Config saved",passed:$(i)});let c=o?!0:await this.writeVersionToDb(t.version,s);n.push({name:"Version marker",passed:c});let d=["Database exists",".agentic-qe directory","Config saved"],m=n.filter(u=>d.includes(u.name)).every(u=>u.passed);e.services.log(" Verification checks:");for(let u of n){let p=d.includes(u.name),h=u.passed?"\u2713":p?"\u2717":"\u26A0",g=!p&&!u.passed?" (optional)":"";e.services.log(` ${h} ${u.name}${g}`)}return{verified:m,versionWritten:c,configSaved:$(i),checks:n}}async writeVersionToDb(e,t){let s=N(t,".agentic-qe","memory.db");try{let n=xt(s);$(n)||tt(n,{recursive:!0});let o=D(s);try{o.exec(`
|
|
374
433
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
375
434
|
key TEXT NOT NULL,
|
|
376
435
|
namespace TEXT NOT NULL,
|
|
@@ -385,9 +444,9 @@ Task({ prompt: "Security audit", subagent_type: "qe-security-scanner", run_in_ba
|
|
|
385
444
|
`).run("aqe_version",JSON.stringify(e),r),o.prepare(`
|
|
386
445
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
|
|
387
446
|
VALUES (?, '_system', ?, ?)
|
|
388
|
-
`).run("init_timestamp",JSON.stringify(new Date().toISOString()),r),o.close(),!0}catch{return o.close(),!1}}catch{return!1}}async saveConfig(e,t){let s=N(t,".agentic-qe")
|
|
447
|
+
`).run("init_timestamp",JSON.stringify(new Date().toISOString()),r),o.close(),!0}catch{return o.close(),!1}}catch{return!1}}async saveConfig(e,t){let s=N(t,".agentic-qe");$(s)||tt(s,{recursive:!0});let n=N(s,"config.yaml");if($(n)){let r=this.loadExistingConfig(n);r&&(e=this.mergeConfigs(e,r))}let o=this.configToYAML(e);_e(n,o,$t)}loadExistingConfig(e){try{let t=Dt(e,"utf-8");return this.parseYAML(t)}catch{return null}}parseYAML(e){try{let t={},s=e.split(`
|
|
389
448
|
`),n="",o="";for(let i of s){if(i.trim().startsWith("#")||i.trim()==="")continue;let c=i.match(/^(\w+):\s*(.*)$/);if(c){n=c[1],o="";let p=c[2].trim();p&&!p.startsWith('"')?t[n]=this.parseValue(p):p?t[n]=this.parseValue(p):t[n]={};continue}let d=i.match(/^ {2}(\w+):\s*(.*)$/);if(d&&n){o=d[1];let p=d[2].trim();t[n]||(t[n]={}),p?t[n][o]=this.parseValue(p):t[n][o]={};continue}let m=i.match(/^ {4}([\w-]+):\s*(.*)$/);if(m&&n&&o){let p=m[1],h=m[2].trim(),g=t[n];g[o]||(g[o]={}),typeof g[o]=="object"&&!Array.isArray(g[o])&&(g[o][p]=this.parseValue(h));continue}let u=i.match(/^ {4}- "?([^"]*)"?$/);if(u&&n&&o){let p=t[n];Array.isArray(p[o])||(p[o]=[]),p[o].push(u[1])}}let r=[["domains","enabled"],["domains","disabled"],["workers","enabled"]];for(let[i,c]of r){let d=t[i];d&&c in d&&!Array.isArray(d[c])&&(d[c]=[])}return t}catch{return null}}parseValue(e){return e==="true"?!0:e==="false"?!1:/^\d+$/.test(e)?parseInt(e,10):/^\d+\.\d+$/.test(e)?parseFloat(e):e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}mergeConfigs(e,t){if(t.domains?.enabled&&Array.isArray(t.domains.enabled)){let s=new Set(t.domains.enabled),n=new Set(e.domains.enabled);for(let r of n)s.add(r);let o=new Set(Array.isArray(t.domains?.disabled)?t.domains.disabled:[]);e.domains.enabled=Array.from(s).filter(r=>!o.has(r))}return t.domains?.disabled&&Array.isArray(t.domains.disabled)&&(e.domains.disabled=t.domains.disabled),t.learning?.enabled!==void 0&&(e.learning.enabled=t.learning.enabled),t.learning?.qualityThreshold!==void 0&&(e.learning.qualityThreshold=t.learning.qualityThreshold),t.learning?.promotionThreshold!==void 0&&(e.learning.promotionThreshold=t.learning.promotionThreshold),t.hooks?.claudeCode!==void 0&&(e.hooks.claudeCode=t.hooks.claudeCode),t.hooks?.preCommit!==void 0&&(e.hooks.preCommit=t.hooks.preCommit),t.hooks?.ciIntegration!==void 0&&(e.hooks.ciIntegration=t.hooks.ciIntegration),t.workers?.enabled&&Array.isArray(t.workers.enabled)&&(e.workers.enabled=t.workers.enabled),t.workers?.daemonAutoStart!==void 0&&(e.workers.daemonAutoStart=t.workers.daemonAutoStart),t.agents?.maxConcurrent!==void 0&&(e.agents.maxConcurrent=t.agents.maxConcurrent),t.agents?.defaultTimeout!==void 0&&(e.agents.defaultTimeout=t.agents.defaultTimeout),e}configToYAML(e){return["# Agentic QE v3 Configuration","# Generated by aqe init",`# ${new Date().toISOString()}`,"#",'# NOTE: Your customizations are PRESERVED when you run "aqe init" again.','# You do NOT need to re-run "aqe init" after editing this file - changes',"# take effect immediately. The following settings are merged on reinstall:","# - domains.enabled (custom domains like visual-accessibility)","# - domains.disabled","# - learning.enabled, qualityThreshold, and promotionThreshold","# - hooks.* preferences","# - workers.enabled","# - agents.maxConcurrent and defaultTimeout","",`version: "${e.version}"`,"","project:",` name: "${e.project.name}"`,` root: "${e.project.root}"`,` type: "${e.project.type}"`,"","learning:",` enabled: ${e.learning.enabled}`,` embeddingModel: "${e.learning.embeddingModel}"`," hnswConfig:",` M: ${e.learning.hnswConfig.M}`,` efConstruction: ${e.learning.hnswConfig.efConstruction}`,` efSearch: ${e.learning.hnswConfig.efSearch}`,` qualityThreshold: ${e.learning.qualityThreshold}`,` promotionThreshold: ${e.learning.promotionThreshold}`,` pretrainedPatterns: ${e.learning.pretrainedPatterns}`,"","routing:",` mode: "${e.routing.mode}"`,` confidenceThreshold: ${e.routing.confidenceThreshold}`,` feedbackEnabled: ${e.routing.feedbackEnabled}`,"","# ADR-092: Advisor Strategy \u2014 agents consult a stronger model for strategic guidance","# Set provider/model to override auto-detection from environment API keys","advisor:",' # provider: "openrouter" # openrouter | claude | ollama (auto-detected if not set)',' # model: "anthropic/claude-opus-5.5" # provider-specific model ID',' # maxUses: "3" # per-task advisor call cap',' redact: "strict" # strict | balanced | off',"","workers:"," enabled:",...e.workers.enabled.map(s=>` - "${s}"`)," intervals:",...Object.entries(e.workers.intervals).map(([s,n])=>` ${s}: ${n}`),` maxConcurrent: ${e.workers.maxConcurrent}`,` daemonAutoStart: ${e.workers.daemonAutoStart}`,"","hooks:",` claudeCode: ${e.hooks.claudeCode}`,` preCommit: ${e.hooks.preCommit}`,` ciIntegration: ${e.hooks.ciIntegration}`,"","skills:",` install: ${e.skills.install}`,` installV2: ${e.skills.installV2}`,` installV3: ${e.skills.installV3}`,` overwrite: ${e.skills.overwrite}`,"","domains:"," enabled:",...e.domains.enabled.map(s=>` - "${s}"`)," disabled:",...e.domains.disabled.map(s=>` - "${s}"`),"","agents:",` maxConcurrent: ${e.agents.maxConcurrent}`,` defaultTimeout: ${e.agents.defaultTimeout}`,""].join(`
|
|
390
|
-
`)}};le();import{existsSync as
|
|
449
|
+
`)}};le();import{existsSync as q,mkdirSync as nt,readdirSync as st,copyFileSync as rt}from"fs";import{join as I,dirname as qt}from"path";import{fileURLToPath as Tt}from"url";var jt=Tt(import.meta.url),ot=qt(jt);function Ot(){let l=[I(ot,"../../assets/governance"),I(ot,"../assets/governance")],e=Le(import.meta.url);e&&(l.push(I(e,"assets/governance")),l.push(I(e,"dist/assets/governance"))),l.push(I(process.cwd(),"node_modules/agentic-qe/assets/governance")),l.push(I(process.cwd(),"assets/governance"));for(let t of l)if(q(t))return t;throw new Error(`Governance assets not found. Package may be corrupted. Searched: ${l.join(", ")}`)}var Ie=class{projectRoot;overwrite;skipShards;assetsPath;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.skipShards=e.skipShards??!1,this.assetsPath=Ot()}async install(){let e=[],t=[],s=[],n=I(this.projectRoot,".claude","guidance"),o=I(n,"shards");try{nt(n,{recursive:!0}),this.skipShards||nt(o,{recursive:!0})}catch(m){return s.push(`Failed to create governance directory: ${E(m)}`),{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:!1,shardsInstalled:0}}let r=!1,i=I(this.assetsPath,"constitution.md"),c=I(n,"constitution.md");if(q(i))try{!q(c)||this.overwrite?(rt(i,c),e.push("constitution.md"),r=!0):t.push("constitution.md")}catch(m){s.push(`Failed to install constitution.md: ${E(m)}`)}else s.push("constitution.md not found in assets");let d=0;if(!this.skipShards){let m=I(this.assetsPath,"shards");if(q(m))try{let u=st(m).filter(p=>p.endsWith(".shard.md"));for(let p of u){let h=I(m,p),g=I(o,p);try{!q(g)||this.overwrite?(rt(h,g),e.push(`shards/${p}`),d++):t.push(`shards/${p}`)}catch(w){s.push(`Failed to install ${p}: ${E(w)}`)}}}catch(u){s.push(`Failed to read shards directory: ${E(u)}`)}else s.push("Shards directory not found in assets")}return{installed:e,skipped:t,errors:s,governanceDir:n,constitutionInstalled:r,shardsInstalled:d}}isInstalled(){let e=I(this.projectRoot,".claude","guidance","constitution.md");return q(e)}getInstalledShards(){let e=I(this.projectRoot,".claude","guidance","shards");if(!q(e))return[];try{return st(e).filter(t=>t.endsWith(".shard.md"))}catch{return[]}}};function it(l){return new Ie(l)}var ie=class extends y{name="governance";description="Install governance configuration";order=95;critical=!1;requiresPhases=["configuration"];async shouldRun(e){return e.options.noClaude?(e.services.log(" Governance skipped (--no-claude)"),!1):e.options.noGovernance?(e.services.log(" Governance skipped (--no-governance flag)"),!1):e.options.minimal?(e.services.log(" Governance skipped (minimal mode)"),!1):!0}async run(e){let{projectRoot:t,options:s}=e,n=s.upgrade,o=it({projectRoot:t,overwrite:n});if(o.isInstalled()&&!n){let i=o.getInstalledShards();return e.services.log(` Governance already installed (${i.length} shards)`),e.services.log(" Use --upgrade to overwrite existing files"),{filesInstalled:0,filesSkipped:1+i.length,constitutionInstalled:!1,shardsInstalled:0,governanceDir:`${t}/.claude/guidance`,skippedByFlag:!1}}let r=await o.install();if(r.errors.length>0)for(let i of r.errors)e.services.warn(` ${i}`);return e.services.log(` Constitution: ${r.constitutionInstalled?"installed":"skipped"}`),e.services.log(` Shards: ${r.shardsInstalled} installed, ${r.skipped.filter(i=>i.startsWith("shards/")).length} skipped`),r.installed.length>0&&(e.services.log(" Governance enabled (non-strict mode by default)"),e.services.log(" Set GOVERNANCE_STRICT_MODE=true for strict enforcement")),{filesInstalled:r.installed.length,filesSkipped:r.skipped.length,constitutionInstalled:r.constitutionInstalled,shardsInstalled:r.shardsInstalled,governanceDir:r.governanceDir,skippedByFlag:!1}}};var Mt=new V,Ft=new W,Nt=new H,Bt=new K,Lt=new z,Qt=new J,Vt=new X,Wt=new Z,Ht=new ne,Gt=new se,Ut=new re,Kt=new oe,zt=new ie;function at(){return[Mt,Ft,Nt,Bt,Lt,Qt,Vt,Wt,Ht,zt,Gt,Ut,Kt]}var Pe=class{phases;context;constructor(e){this.context=this.createContext(e),this.phases=e.customPhases??at()}createContext(e){let t=e.withAllPlatforms;return{projectRoot:e.projectRoot,options:{autoMode:e.autoMode,upgrade:e.upgrade,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,minimal:e.minimal,browserEngine:e.browserEngine,withN8n:e.withN8n,withOpenCode:e.withOpenCode,withKiro:e.withKiro,withCopilot:e.withCopilot||t,withCursor:e.withCursor||t,withCline:e.withCline||t,withKiloCode:e.withKiloCode||t,withRooCode:e.withRooCode||t,withCodex:e.withCodex||t,withRuflo:e.withRuflo,codexGuidance:e.codexGuidance,withWindsurf:e.withWindsurf||t,withContinueDev:e.withContinueDev||t,withAllPlatforms:e.withAllPlatforms,n8nApiConfig:e.n8nApiConfig,wizardAnswers:e.wizardAnswers,noGovernance:e.noGovernance,noMcp:e.noMcp,withMcp:e.withMcp,noClaude:e.noClaude,noStatusLine:e.noStatusLine,memoryBackend:e.memoryBackend},config:{},enhancements:{claudeFlow:!1,ruvector:!1},results:new Map,services:{log:s=>console.log(s),warn:s=>console.warn(s),error:s=>console.error(s)}}}async initialize(){let e=Date.now(),t=[];try{let s=[...this.phases].sort((n,o)=>n.order-o.order);for(let n of s){if(!await n.shouldRun(this.context))continue;console.log(`
|
|
391
450
|
\u{1F4CB} ${n.description}...`);let r=await n.execute(this.context);if(this.context.results.set(n.name,r),t.push({step:n.description,status:r.success?"success":"error",message:r.message||"",durationMs:r.durationMs}),!r.success&&n.critical){if(console.error(`
|
|
392
451
|
\u274C Critical phase failed: ${n.name}`),n.rollback)try{await n.rollback(this.context)}catch(i){console.error(`Rollback failed: ${i}`)}return this.createFailureResult(t,e)}if(r.skipRemaining)break}return this.createSuccessResult(t,e)}catch(s){return t.push({step:"Initialization Failed",status:"error",message:E(s),durationMs:0}),this.createFailureResult(t,e)}}createSuccessResult(e,t){let s=this.context.config,n=this.context.results.get("learning"),o=this.context.results.get("code-intelligence"),r=this.context.results.get("assets"),i=this.context.results.get("hooks"),c=this.context.results.get("mcp"),d=this.context.results.get("claude-md"),m=this.context.results.get("workers");return{success:!0,config:s||ye("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:this.context.results.has("analysis"),configGenerated:this.context.results.has("configuration"),codeIntelligenceIndexed:o?.data?.entries??0,patternsLoaded:n?.data?.patternsLoaded??0,skillsInstalled:r?.data?.skillsInstalled??0,agentsInstalled:r?.data?.agentsInstalled??0,hooksConfigured:i?.data?.configured??!1,mcpConfigured:c?.data?.configured??!1,claudeMdGenerated:d?.data?.generated??!1,workersStarted:m?.data?.workersConfigured??0,codexGuidance:r?.data?.codexGuidance,codexComponents:r?.data?.codexComponents},totalDurationMs:Date.now()-t,timestamp:new Date}}createFailureResult(e,t){return{success:!1,config:ye("unknown",this.context.projectRoot),steps:e,summary:{projectAnalyzed:!1,configGenerated:!1,codeIntelligenceIndexed:0,patternsLoaded:0,skillsInstalled:0,agentsInstalled:0,hooksConfigured:!1,mcpConfigured:!1,claudeMdGenerated:!1,workersStarted:0},totalDurationMs:Date.now()-t,timestamp:new Date}}getPhase(e){return this.phases.find(t=>t.name===e)}getPhases(){return[...this.phases]}getContext(){return this.context}};function Jt(l){return new Pe(l)}async function cr(l){return await Jt({projectRoot:l,autoMode:!0}).initialize()}function dr(l){let e=[];e.push(""),e.push("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"),e.push("\u2502 AQE v3 Initialization \u2502"),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");for(let s of l.steps){let n=s.status==="success"?"\u2713":s.status==="error"?"\u2717":"\u25CB",o=s.step.substring(0,48).padEnd(48);e.push(`\u2502 ${n} ${o} ${String(s.durationMs).padStart(4)}ms \u2502`)}e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524"),e.push(`\u2502 Project: ${l.config.project.name.substring(0,45).padEnd(45)} \u2502`),e.push(`\u2502 Type: ${l.config.project.type.padEnd(48)} \u2502`),e.push(`\u2502 Code Intel: ${String(l.summary.codeIntelligenceIndexed).padEnd(43)} \u2502`),e.push(`\u2502 Patterns: ${String(l.summary.patternsLoaded).padEnd(45)} \u2502`),e.push(`\u2502 Skills: ${String(l.summary.skillsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Agents: ${String(l.summary.agentsInstalled).padEnd(47)} \u2502`),e.push(`\u2502 Workers: ${String(l.summary.workersStarted).padEnd(46)} \u2502`),e.push(`\u2502 Hooks: ${l.summary.hooksConfigured?"Yes":"No".padEnd(48)} \u2502`),e.push(`\u2502 MCP: ${l.summary.mcpConfigured?"Yes":"No".padEnd(50)} \u2502`),e.push(`\u2502 CLAUDE.md: ${l.summary.claudeMdGenerated?"Yes":"No".padEnd(44)} \u2502`),e.push("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");let t=l.success?"\u2713 AQE v3 initialized successfully":"\u2717 Initialization failed";return e.push(`\u2502 ${t.padEnd(57)} \u2502`),e.push("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"),e.push(""),e.join(`
|
|
393
452
|
`)}export{Pe as ModularInitOrchestrator,Jt as createModularInitOrchestrator,dr as formatInitResultModular,cr as quickInitModular};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.3");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-6EQDA4EC.js";import"./chunk-UTALYUMW.js";import"./chunk-POTVF6BY.js";import"./chunk-WSUYEVSY.js";export{a as PatternNullStore};
|
package/dist/cli/chunks/{pattern-usage-recorder-QPNIU5PD.js → pattern-usage-recorder-I2IGVHRL.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,b}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.3");process.exit(0)}
|
|
2
|
+
import{a,b}from"./chunk-WQZBKLAG.js";import"./chunk-WSUYEVSY.js";export{a as recordPatternUsage,b as recordPatternUsageBatch};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as v,c as w,d as l}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.3");process.exit(0)}
|
|
2
|
+
import{a as v,c as w,d as l}from"./chunk-Z7UGEQ4G.js";import"./chunk-WSUYEVSY.js";import{Command as O}from"commander";import{resolve as C}from"path";import s from"chalk";import*as M from"node:fs/promises";import{parse as W}from"yaml";var E=["eq","neq","gt","gte","lt","lte","contains","exists"],D=["sequential","parallel"],N=/\$\{([^}]+)\}/g,k=class{parse(r,t){try{let n=this.interpolateVariables(r,t??{}),a=W(n);return this.validateAndConvert(a)}catch(n){return l(n instanceof Error?new Error(`YAML parse error: ${n.message}`):new Error(`YAML parse error: ${String(n)}`))}}async loadFromFile(r,t){try{let n=await M.readFile(r,"utf-8");return this.parse(n,t)}catch(n){return l(n instanceof Error?new Error(`Failed to read pipeline file '${r}': ${n.message}`):new Error(`Failed to read pipeline file '${r}': ${String(n)}`))}}interpolateVariables(r,t){return r.replace(N,(n,a)=>{let o=this.resolveVarPath(t,a);return o===void 0?n:String(o)})}validateSchema(r){return this.validateAndConvert(r)}validateAndConvert(r){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error("YAML must parse to an object"));let t=r;if(!t.id||typeof t.id!="string")return l(new Error("Missing or invalid required field 'id' (string)"));if(!t.name||typeof t.name!="string")return l(new Error("Missing or invalid required field 'name' (string)"));if(!t.steps||!Array.isArray(t.steps)||t.steps.length===0)return l(new Error("'steps' must be a non-empty array"));let n=typeof t.description=="string"?t.description:"",a=typeof t.version=="string"?t.version:"1.0.0",o;if(t.defaultMode!==void 0){if(!D.includes(t.defaultMode))return l(new Error(`Invalid defaultMode '${String(t.defaultMode)}'. Must be one of: ${D.join(", ")}`));o=t.defaultMode}let e;if(t.timeout!==void 0){if(typeof t.timeout!="number"||t.timeout<=0)return l(new Error("'timeout' must be a positive number"));e=t.timeout}let i=Array.isArray(t.tags)?t.tags.filter(g=>typeof g=="string"):void 0,u=this.validateSteps(t.steps);if(!u.success)return u;let c;if(t.triggers!==void 0){if(!Array.isArray(t.triggers))return l(new Error("'triggers' must be an array"));let g=this.validateTriggers(t.triggers);if(!g.success)return g;c=g.value}let f=this.detectCircularDependencies(u.value);if(f)return l(new Error(`Circular dependency detected: ${f}`));let d={id:t.id,name:t.name,description:n,version:a,steps:u.value,...o!==void 0&&{defaultMode:o},...e!==void 0&&{timeout:e},...i!==void 0&&{tags:i},...c!==void 0&&{triggers:c}};return w(d)}validateSteps(r){let t=[],n=new Set;for(let a=0;a<r.length;a++){let o=r[a];if(!o||typeof o!="object"||Array.isArray(o))return l(new Error(`Step at index ${a} must be an object`));let e=o;if(!e.id||typeof e.id!="string")return l(new Error(`Step at index ${a}: missing or invalid 'id' (string)`));if(n.has(e.id))return l(new Error(`Duplicate step ID: ${e.id}`));if(n.add(e.id),!e.name||typeof e.name!="string")return l(new Error(`Step '${e.id}': missing or invalid 'name' (string)`));if(!e.domain||typeof e.domain!="string")return l(new Error(`Step '${e.id}': missing or invalid 'domain' (string)`));if(!v.includes(e.domain))return l(new Error(`Step '${e.id}': invalid domain '${e.domain}'. Must be one of: ${v.join(", ")}`));if(!e.action||typeof e.action!="string")return l(new Error(`Step '${e.id}': missing or invalid 'action' (string)`));let i=this.validateStringRecord(e.inputMapping,`Step '${e.id}'.inputMapping`);if(i!==void 0&&i instanceof Error)return l(i);let u=this.validateStringRecord(e.outputMapping,`Step '${e.id}'.outputMapping`);if(u!==void 0&&u instanceof Error)return l(u);let c;if(e.dependsOn!==void 0){if(!Array.isArray(e.dependsOn)||!e.dependsOn.every(p=>typeof p=="string"))return l(new Error(`Step '${e.id}': 'dependsOn' must be an array of strings`));for(let p of e.dependsOn)if(!r.some(j=>j.id===p))return l(new Error(`Step '${e.id}' depends on unknown step: ${p}`));c=e.dependsOn}let f;if(e.condition!==void 0){let p=this.validateCondition(e.condition,`Step '${e.id}'.condition`);if(!p.success)return p;f=p.value}let d;if(e.skipCondition!==void 0){let p=this.validateCondition(e.skipCondition,`Step '${e.id}'.skipCondition`);if(!p.success)return p;d=p.value}let g;if(e.timeout!==void 0){if(typeof e.timeout!="number"||e.timeout<=0)return l(new Error(`Step '${e.id}': 'timeout' must be a positive number`));g=e.timeout}let $;if(e.retry!==void 0){let p=this.validateRetry(e.retry,e.id);if(!p.success)return p;$=p.value}let b;if(e.rollback!==void 0){let p=this.validateRollback(e.rollback,e.id);if(!p.success)return p;b=p.value}let R=typeof e.continueOnFailure=="boolean"?e.continueOnFailure:void 0,S;if(e.approval!==void 0){let p=this.validateApproval(e.approval,e.id);if(!p.success)return p;S=p.value}let A={id:e.id,name:e.name,domain:e.domain,action:e.action,...i!==void 0&&{inputMapping:i},...u!==void 0&&{outputMapping:u},...c!==void 0&&{dependsOn:c},...f!==void 0&&{condition:f},...d!==void 0&&{skipCondition:d},...g!==void 0&&{timeout:g},...$!==void 0&&{retry:$},...b!==void 0&&{rollback:b},...R!==void 0&&{continueOnFailure:R},...S!==void 0&&{approval:S}};t.push(A)}return w(t)}validateCondition(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`${t}: must be an object with path, operator, value`));let n=r;return!n.path||typeof n.path!="string"?l(new Error(`${t}: missing or invalid 'path' (string)`)):!n.operator||typeof n.operator!="string"?l(new Error(`${t}: missing or invalid 'operator' (string)`)):E.includes(n.operator)?n.value===void 0?l(new Error(`${t}: missing 'value'`)):w({path:n.path,operator:n.operator,value:n.value}):l(new Error(`${t}: invalid operator '${n.operator}'. Must be one of: ${E.join(", ")}`))}validateTriggers(r){let t=[];for(let n=0;n<r.length;n++){let a=r[n];if(!a||typeof a!="object"||Array.isArray(a))return l(new Error(`Trigger at index ${n} must be an object`));let o=a;if(!o.eventType||typeof o.eventType!="string")return l(new Error(`Trigger at index ${n}: missing or invalid 'eventType' (string)`));let e;if(o.sourceDomain!==void 0){if(typeof o.sourceDomain!="string"||!v.includes(o.sourceDomain))return l(new Error(`Trigger at index ${n}: invalid 'sourceDomain' '${String(o.sourceDomain)}'`));e=o.sourceDomain}let i;if(o.condition!==void 0){let c=this.validateCondition(o.condition,`Trigger at index ${n}.condition`);if(!c.success)return c;i=c.value}let u=this.validateStringRecord(o.inputMapping,`Trigger at index ${n}.inputMapping`);if(u!==void 0&&u instanceof Error)return l(u);t.push({eventType:o.eventType,...e!==void 0&&{sourceDomain:e},...i!==void 0&&{condition:i},...u!==void 0&&{inputMapping:u}})}return w(t)}validateRetry(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'retry' must be an object`));let n=r;return typeof n.maxAttempts!="number"||n.maxAttempts<1?l(new Error(`Step '${t}': retry.maxAttempts must be a positive integer`)):typeof n.backoffMs!="number"||n.backoffMs<0?l(new Error(`Step '${t}': retry.backoffMs must be a non-negative number`)):w({maxAttempts:n.maxAttempts,backoffMs:n.backoffMs,...typeof n.backoffMultiplier=="number"&&{backoffMultiplier:n.backoffMultiplier}})}validateRollback(r,t){if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'rollback' must be an object`));let n=r;return!n.domain||typeof n.domain!="string"||!v.includes(n.domain)?l(new Error(`Step '${t}': rollback.domain is invalid or missing`)):!n.action||typeof n.action!="string"?l(new Error(`Step '${t}': rollback.action is required (string)`)):w({domain:n.domain,action:n.action,...n.input!==void 0&&typeof n.input=="object"&&{input:n.input}})}validateApproval(r,t){if(typeof r=="boolean")return w(r);if(!r||typeof r!="object"||Array.isArray(r))return l(new Error(`Step '${t}': 'approval' must be a boolean or object`));let n=r,a={};if(n.expiresAfter!==void 0&&n.autoApproveAfter!==void 0)return l(new Error(`Step '${t}': set only one approval expiry field`));let o=n.expiresAfter??n.autoApproveAfter;if(o!==void 0){if(typeof o!="number"||!Number.isSafeInteger(o)||o<0||o>2147483647)return l(new Error(`Step '${t}': approval expiry must be an integer from 0 to 2147483647 milliseconds`));a.expiresAfter=o}if(n.message!==void 0){if(typeof n.message!="string")return l(new Error(`Step '${t}': approval.message must be a string`));a.message=n.message}return w(a)}validateStringRecord(r,t){if(r==null)return;if(typeof r!="object"||Array.isArray(r))return new Error(`${t}: must be an object with string values`);let n=r;for(let[a,o]of Object.entries(n))if(typeof o!="string")return new Error(`${t}: value for key '${a}' must be a string, got ${typeof o}`);return n}resolveVarPath(r,t){if(t in r)return r[t];let n=t.split("."),a=r;for(let o of n){if(a==null||typeof a!="object")return;a=a[o]}return a}detectCircularDependencies(r){let t=new Set,n=new Set,a=(o,e)=>{if(n.has(o))return[...e,o].join(" -> ");if(t.has(o))return null;t.add(o),n.add(o);let i=r.find(u=>u.id===o);if(i?.dependsOn)for(let u of i.dependsOn){let c=a(u,[...e,o]);if(c)return c}return n.delete(o),null};for(let o of r){let e=a(o.id,[]);if(e)return e}return null}};function h(m){let r={};for(let t of m){let n=t.indexOf("=");if(n===-1)r[t]=!0;else{let a=t.slice(0,n),o=t.slice(n+1);o==="true"?r[a]=!0:o==="false"?r[a]=!1:!isNaN(Number(o))&&o!==""?r[a]=Number(o):r[a]=o}}return r}function T(m){return h(m)}function y(m){return m.workflowOrchestrator}function U(m,r,t){let n=new k,a=new O("pipeline").description("Manage YAML deterministic pipelines (Imp-9)");return a.command("load <file>").description("Load and register a pipeline from a YAML file").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{if(!await t())return;let i=y(m);if(!i){console.error(s.red(' Workflow orchestrator not available. Run "aqe fleet init" first.')),await r(1);return}let u=C(o),c=e.vars?h(e.vars):void 0;console.log(s.blue(`
|
|
3
3
|
Loading pipeline from: ${o}
|
|
4
4
|
`));let f=await n.loadFromFile(u,c);if(!f.success){console.error(s.red(` Parse error: ${f.error.message}`)),await r(1);return}let d=f.value,g=i.registerWorkflow(d);if(!g.success){console.error(s.red(` Registration error: ${g.error.message}`)),await r(1);return}console.log(s.green(" Pipeline loaded successfully.")),console.log(` ID: ${s.cyan(d.id)}`),console.log(` Name: ${s.cyan(d.name)}`),console.log(` Steps: ${s.cyan(d.steps.length)}`),console.log(` Version: ${s.cyan(d.version)}`),d.tags?.length&&console.log(` Tags: ${s.cyan(d.tags.join(", "))}`),console.log(""),await r(0)}),a.command("validate <file>").description("Validate a YAML pipeline without registering it").option("--vars <entries...>","Variable substitutions (key=value)").action(async(o,e)=>{let i=C(o),u=e.vars?h(e.vars):void 0;console.log(s.blue(`
|
|
5
5
|
Validating pipeline: ${o}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as R}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.3");process.exit(0)}
|
|
2
|
+
import{a as R}from"./chunk-HV3ZVUHO.js";import{a as y}from"./chunk-PBUWNMZ2.js";import{a as E,e as A}from"./chunk-2GJJGO5D.js";import"./chunk-WSUYEVSY.js";import{Command as O,Option as I}from"commander";import o from"chalk";import{existsSync as p,readFileSync as $}from"node:fs";import g from"node:path";A();var k=Object.keys(y),M={copilot:()=>import("./copilot-installer-5QK565JX.js"),cursor:()=>import("./cursor-installer-3BL7JACV.js"),cline:()=>import("./cline-installer-HWMQZJ64.js"),kilocode:()=>import("./kilocode-installer-JICGAHLM.js"),roocode:()=>import("./roocode-installer-NSGGTWXE.js"),codex:()=>import("./codex-installer-63JARKKS.js"),windsurf:()=>import("./windsurf-installer-4KS2466T.js"),continuedev:()=>import("./continuedev-installer-ZAWDSUR3.js")};function j(n){return k.includes(n)}function V(n,e){let t=g.join(n,e.configPath),s=g.join(n,e.rulesPath);return{configExists:p(t),rulesExists:p(s)}}function G(n,e){try{let t=$(n,"utf-8");return e==="json"?{valid:!0,data:JSON.parse(t)}:e==="toml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:e==="yaml"?t.trim().length===0?{valid:!1,error:"File is empty"}:{valid:!0}:{valid:!0}}catch(t){return{valid:!1,error:E(t)}}}function D(n,e){try{return $(n,"utf-8").includes("agentic-qe")}catch{return!1}}function T(n){let e="<!-- BEGIN AGENTIC-QE CODEX -->",t="<!-- END AGENTIC-QE CODEX -->",s=n.match(/<!-- BEGIN AGENTIC-QE CODEX -->[\s\S]*?<!-- END AGENTIC-QE CODEX -->/g)||[];return s.length===0?n.includes(e)||n.includes(t)?"malformed":"none":s[0].includes("Discover AQE tools and skills from their live schemas")?"compact":"full"}function q(n,e,t={}){let s=y[e],r=[],i=(l,m,h)=>{r.push({label:l,passed:m,detail:h})},d=t.expectMcp!==!1,u=g.join(n,s.configPath),c=p(u);if(d?i("Config file",c,c?s.configPath:`missing: ${s.configPath}`):i("MCP configuration",!0,c?`${s.configPath} preserved`:"intentionally disabled"),c&&d){let l=G(u,s.configFormat);i("Config syntax",l.valid,l.valid?`valid ${s.configFormat.toUpperCase()}`:l.error||"invalid configuration"),i("AQE MCP entry",D(u,s),"agentic-qe server entry")}let P=g.join(n,s.rulesPath),a=p(P);if(e==="codex"){let l=t.guidancePolicy??"full",m=a?T($(P,"utf-8")):"none";i("Behavioral rules",l==="none"||a,l==="none"?"intentionally disabled":a?s.rulesPath:`missing: ${s.rulesPath}`),i("Codex guidance",m===l,`selected=${l}, detected=${m}`)}else i("Behavioral rules",a,a?s.rulesPath:`missing: ${s.rulesPath}`);if(e==="codex"){let l=g.join(n,".codex","hooks.json"),m=[],h=!1;if(p(l))try{let f=JSON.parse($(l,"utf-8"));h=!!(f.hooks&&typeof f.hooks=="object"),m=JSON.stringify(f).match(/\.codex\/hooks\/[a-z0-9-]+\.cjs/gi)||[]}catch{h=!1}i("Lifecycle hooks",h,h?".codex/hooks.json is valid":"missing or invalid .codex/hooks.json");let x=[...new Set(m.map(f=>f.split("/").pop()))],S=x.length>0&&x.every(f=>p(g.join(n,".codex","hooks",f)));i("Hook adapters",S,x.length>0?`${x.length} referenced adapter(s)`:"no Codex hook adapters referenced");let w=["aqe-runtime.cjs",...x.includes("ruflo-codex-hook.cjs")?["ruflo-runtime.cjs"]:[]],C=w.filter(f=>!p(g.join(n,".codex","hooks",f)));i("Hook runtimes",C.length===0,C.length===0?`${w.length} runtime(s) present`:`missing: ${C.join(", ")}`);let N=g.join(n,".agents","skills"),v=R({includeRuflo:t.expectRuflo===!0}),b=v.filter(f=>!p(g.join(N,f.name,"SKILL.md"))).map(f=>f.name);i("QE skills",b.length===0,b.length===0?`${v.length} required AQE skill(s) present`:`missing: ${b.join(", ")}`)}return{platform:e,passed:r.every(l=>l.passed),checks:r}}function F(){let n=new O("platform").description("Manage coding agent platform configurations");return n.command("list").description("List all supported platforms and their configuration status").action(async()=>{let e=process.cwd();console.log(""),console.log(o.bold.blue(" Supported Platforms")),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let t=18,s=36,r=14;console.log(o.gray(` ${"Platform".padEnd(t)}${"Config Path".padEnd(s)}${"Status".padEnd(r)}`)),console.log(o.gray(` ${"\u2500".repeat(t+s+r)}`));for(let i of k){let d=y[i],{configExists:u,rulesExists:c}=V(e,d),l=u&&c?o.green("configured"):u||c?o.yellow("partial"):o.gray("not configured");console.log(` ${o.white(d.name.padEnd(t))}${o.gray(d.configPath.padEnd(s))}${l}`)}console.log(""),console.log(o.gray(' Use "aqe platform setup <name>" to configure a platform')),console.log(o.gray(' Use "aqe init --with-all-platforms" to configure all at once')),console.log("")}),n.command("setup <name>").description("Set up a specific platform configuration").option("--overwrite","Overwrite existing configuration files").option("--with-ruflo","Add optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Setting up ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");try{let i=await M[e](),u=[`create${e.charAt(0).toUpperCase()}${e.slice(1).replace(/([a-z])([A-Z])/g,"$1$2")}Installer`,`create${L(e)}Installer`],c;for(let l of u)if(typeof i[l]=="function"){c=i[l];break}if(!c){for(let l of Object.keys(i))if(l.startsWith("create")&&l.endsWith("Installer")&&typeof i[l]=="function"){c=i[l];break}}c||(console.log(o.red(` Could not find installer factory for ${e}`)),process.exit(1));let a=await c({projectRoot:s,overwrite:t.overwrite,...e==="codex"?{includeRuflo:t.withRuflo,guidancePolicy:t.codexGuidance}:{}}).install();if(a.success)console.log(o.green(` ${r.name} configured successfully`)),a.mcpConfigured&&console.log(o.gray(` MCP config: ${r.configPath}`)),(a.rulesInstalled||a.agentsMdInstalled)&&console.log(o.gray(` Rules: ${r.rulesPath}`)),e==="codex"&&(a.hooksConfigured&&console.log(o.gray(" Hooks: .codex/hooks.json")),console.log(o.gray(` QE skills: ${a.skillsInstalled??0} installed`)),console.log(t.withRuflo?o.green(" Ruflo integration: enabled"):o.gray(" Ruflo integration: not installed (opt in with --with-ruflo)")));else{if(console.log(o.red(` ${r.name} setup failed`)),a.errors)for(let l of a.errors)console.log(o.red(` ${l}`));process.exit(1)}}catch(i){console.log(o.red(` Failed to set up ${r.name}: ${E(i)}`)),process.exit(1)}console.log("")}),n.command("verify <name>").description("Verify a platform configuration is correct").option("--no-mcp","Verify a deliberately MCP-free platform installation").option("--with-ruflo","Require optional Ruflo guidance and lifecycle hooks (Codex only)").addOption(new I("--codex-guidance <mode>","Expected Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).action(async(e,t)=>{let s=process.cwd();j(e)||(console.log(""),console.log(o.red(` Unknown platform: ${e}`)),console.log(o.gray(` Valid platforms: ${k.join(", ")}`)),console.log(""),process.exit(1));let r=y[e];console.log(""),console.log(o.bold.blue(` Verifying ${r.name}`)),console.log(o.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log("");let i=q(s,e,{expectMcp:t.mcp!==!1,expectRuflo:t.withRuflo,guidancePolicy:t.codexGuidance});for(let d of i.checks){let u=` [${d.passed?"pass":"fail"}] ${d.label}: ${d.detail}`;console.log(d.passed?o.green(u):o.red(u))}console.log(""),i.passed?console.log(o.green(` ${r.name} configuration is valid`)):(console.log(o.yellow(` ${r.name} configuration has issues`)),console.log(o.gray(` Run "aqe platform setup ${e}" to fix`)),process.exitCode=1),console.log("")}),n}function L(n){return n.charAt(0).toUpperCase()+n.slice(1)}var H=F;export{F as createPlatformCommand,H as default,q as verifyPlatformConfiguration};
|