agentic-qe 3.9.31 → 3.9.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +143 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-PSHWPJGO.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-AQXZYWZY.js → agent-booster-wasm-DUOP4SS6.js} +2 -2
- package/dist/cli/chunks/{agent-handler-7N4ZPXCY.js → agent-handler-6AHMQ5OK.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-FLKF2JVX.js → agent-memory-branch-77WTL4KU.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-2WOSQ42V.js +2 -0
- package/dist/cli/chunks/{audit-B4V4IKTA.js → audit-ZRSUAGID.js} +2 -2
- package/dist/cli/chunks/base-QZ6CGEZG.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-WENGW3YX.js → better-sqlite3-QOENX3WX.js} +2 -2
- package/dist/cli/chunks/{brain-handler-OOXJ2KYY.js → brain-handler-EPNKL22C.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-LFKFW3A4.js → branch-enumerator-VVPWHTZ4.js} +2 -2
- package/dist/cli/chunks/{browser-F72IES2I.js → browser-NNQ6UHFJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-T74U33BJ.js +2 -0
- package/dist/cli/chunks/{chunk-PSF6YQQM.js → chunk-23VQRQCC.js} +3 -3
- package/dist/cli/chunks/{chunk-HHEIQHLQ.js → chunk-24M7JF3G.js} +2 -2
- package/dist/cli/chunks/{chunk-5WWQLPB4.js → chunk-2NRCDJBB.js} +2 -2
- package/dist/cli/chunks/{chunk-GJSH4UZ3.js → chunk-3B5ZAFB2.js} +3 -3
- package/dist/cli/chunks/{heartbeat-scheduler-OH3SS7MH.js → chunk-3J4TTZP7.js} +2 -2
- package/dist/cli/chunks/{chunk-7MXQV7RB.js → chunk-46LV5MI3.js} +2 -2
- package/dist/cli/chunks/{chunk-35SFAIXE.js → chunk-473YM6LV.js} +2 -2
- package/dist/cli/chunks/{chunk-QEJBJST4.js → chunk-4HJAUI2N.js} +1 -1
- package/dist/cli/chunks/{chunk-YMN4C32S.js → chunk-4MRVNLCT.js} +3 -3
- package/dist/cli/chunks/{chunk-JKKV5KKS.js → chunk-54B5QL4A.js} +2 -2
- package/dist/cli/chunks/{chunk-CYUGE5ZQ.js → chunk-5RILQ3EG.js} +1 -1
- package/dist/cli/chunks/{chunk-TJGIIGKL.js → chunk-63SAZCUH.js} +2 -2
- package/dist/cli/chunks/{chunk-XGBIXRKD.js → chunk-6DBS53L7.js} +2 -2
- package/dist/cli/chunks/{chunk-XMMWYQJK.js → chunk-6S5H34AN.js} +2 -2
- package/dist/cli/chunks/{chunk-52D3CYE5.js → chunk-6TC6UCDL.js} +2 -2
- package/dist/cli/chunks/{chunk-DMF4Z2M6.js → chunk-7HRE2VTG.js} +2 -2
- package/dist/cli/chunks/{chunk-AKJWBJDK.js → chunk-7ZMRQKO2.js} +2 -2
- package/dist/cli/chunks/{chunk-OXOXNAEZ.js → chunk-AE7P7VDM.js} +2 -2
- package/dist/cli/chunks/{chunk-7OVVBBOZ.js → chunk-AGMHJ3GS.js} +2 -2
- package/dist/cli/chunks/{chunk-WB6TI6Q3.js → chunk-AL54ARD4.js} +2 -2
- package/dist/cli/chunks/{chunk-5M4F3PAL.js → chunk-AVQS5H7Y.js} +1 -1
- package/dist/cli/chunks/{chunk-SL4TAJOE.js → chunk-B4N7XODV.js} +2 -2
- package/dist/cli/chunks/{chunk-NBKM7NKX.js → chunk-BD6BS2AL.js} +2 -2
- package/dist/cli/chunks/{chunk-ROEIR3OD.js → chunk-BIXDUMZ4.js} +1 -1
- package/dist/cli/chunks/{chunk-5AMAJCZS.js → chunk-BLNISJ3M.js} +3 -3
- package/dist/cli/chunks/{chunk-462MZLJB.js → chunk-BOHAND5J.js} +1 -1
- package/dist/cli/chunks/{chunk-G3YKCZWQ.js → chunk-C2XCETKV.js} +3 -3
- package/dist/cli/chunks/{chunk-A424Z7LA.js → chunk-C5UGKQUG.js} +1 -1
- package/dist/cli/chunks/{chunk-VUL5HIKR.js → chunk-CAZQL4G2.js} +2 -2
- package/dist/cli/chunks/{chunk-K37CNLQZ.js → chunk-CCSISDAP.js} +1 -1
- package/dist/cli/chunks/{chunk-PYYNY7RJ.js → chunk-CG2IM6IA.js} +1 -1
- package/dist/cli/chunks/{chunk-CUSLB7MB.js → chunk-DEXOYNIQ.js} +2 -2
- package/dist/cli/chunks/{chunk-YEZJE2ZW.js → chunk-DLUEORKO.js} +4 -4
- package/dist/cli/chunks/{chunk-RTGNWRQI.js → chunk-EVDEFUJG.js} +2 -2
- package/dist/cli/chunks/{chunk-MAJ5QFVY.js → chunk-EYCV6IYA.js} +1 -1
- package/dist/cli/chunks/{chunk-X2FLWV5C.js → chunk-F6WQ3ES6.js} +2 -2
- package/dist/cli/chunks/{chunk-JJRZOLDY.js → chunk-FEJCPLXV.js} +2 -2
- package/dist/cli/chunks/{chunk-VSKABN3B.js → chunk-FHSCCEHZ.js} +2 -2
- package/dist/cli/chunks/{chunk-7RPEBKQZ.js → chunk-FQQJUIN7.js} +2 -2
- package/dist/cli/chunks/chunk-FRS4DYHG.js +2 -0
- package/dist/cli/chunks/{chunk-M6RVKGIP.js → chunk-GBMKXJKW.js} +2 -2
- package/dist/cli/chunks/{chunk-ONMJJ2C3.js → chunk-GJKTHVFE.js} +1 -1
- package/dist/cli/chunks/{chunk-JRIDPOEZ.js → chunk-GLA2TD4M.js} +4 -4
- package/dist/cli/chunks/{chunk-QITO7E7Y.js → chunk-GU5DISHT.js} +1 -1
- package/dist/cli/chunks/chunk-GVO53VR5.js +2 -0
- package/dist/cli/chunks/{chunk-AQN6PDHI.js → chunk-GY2G2YYH.js} +1 -1
- package/dist/cli/chunks/{chunk-IRRGUXAU.js → chunk-H5AQHFIA.js} +1 -1
- package/dist/cli/chunks/{chunk-G2U7Q6V6.js → chunk-HCAWQ7ZD.js} +2 -2
- package/dist/cli/chunks/{chunk-XTWYCMAM.js → chunk-HJETZJJO.js} +2 -2
- package/dist/cli/chunks/{chunk-T4DDCMKG.js → chunk-HRE4TFMN.js} +140 -140
- package/dist/cli/chunks/{chunk-EKYPQ5DX.js → chunk-HVC3F4IM.js} +1 -1
- package/dist/cli/chunks/{chunk-UIRTXM7C.js → chunk-IQ5OS342.js} +61 -121
- package/dist/cli/chunks/{chunk-TYUIQSSF.js → chunk-IWBJ7KB7.js} +2 -2
- package/dist/cli/chunks/{chunk-PUSZ4NBY.js → chunk-IXWIABRJ.js} +2 -2
- package/dist/cli/chunks/{chunk-UNXUSYRL.js → chunk-IYDZ4NWA.js} +2 -2
- package/dist/cli/chunks/chunk-JEGTTVTL.js +2 -0
- package/dist/cli/chunks/{chunk-L7DNPOAQ.js → chunk-JF4SWEMU.js} +2 -2
- package/dist/cli/chunks/{chunk-GN7FUCJH.js → chunk-JGCTXHHZ.js} +1 -1
- package/dist/cli/chunks/{chunk-3VKB4HVT.js → chunk-JHFQJKTW.js} +2 -2
- package/dist/cli/chunks/{chunk-BMS7WFDB.js → chunk-JJY6K3OI.js} +1 -1
- package/dist/cli/chunks/{chunk-LF5RO6WO.js → chunk-JMSQW6KN.js} +1 -1
- package/dist/cli/chunks/{chunk-QGLWFZVQ.js → chunk-JPJURL4N.js} +2 -2
- package/dist/cli/chunks/{chunk-XNJ6DIEW.js → chunk-JTXZ3MMZ.js} +2 -2
- package/dist/cli/chunks/{chunk-L63KB63A.js → chunk-JYDWDNNZ.js} +2 -2
- package/dist/cli/chunks/{chunk-YQJBE6NX.js → chunk-K5YL3O22.js} +2 -2
- package/dist/cli/chunks/chunk-KD2B54EH.js +2 -0
- package/dist/cli/chunks/{chunk-DUF733Z7.js → chunk-KF3R6OCB.js} +1 -1
- package/dist/cli/chunks/{chunk-XY3WUGD3.js → chunk-KGA5XCHX.js} +2 -2
- package/dist/cli/chunks/{chunk-EJXRBAQF.js → chunk-KLTN2AVK.js} +2 -2
- package/dist/cli/chunks/{chunk-YLEMSN46.js → chunk-KQDWD34T.js} +1 -1
- package/dist/cli/chunks/{chunk-RDJWUKIR.js → chunk-L77OGJVK.js} +2 -2
- package/dist/cli/chunks/{chunk-62KYX5NH.js → chunk-LAPIIGZ2.js} +2 -2
- package/dist/cli/chunks/chunk-LERCHSFI.js +5 -0
- package/dist/cli/chunks/{chunk-VLAGWLHF.js → chunk-LFPYLTNN.js} +2 -2
- package/dist/cli/chunks/{chunk-LRWRFKQH.js → chunk-LICFVB4C.js} +1 -1
- package/dist/cli/chunks/{chunk-N6SIKSCO.js → chunk-LJBVPR3Z.js} +2 -2
- package/dist/cli/chunks/{chunk-GQFAVT2I.js → chunk-LKEQBIX2.js} +1 -1
- package/dist/cli/chunks/chunk-LVCQ4LSA.js +2 -0
- package/dist/cli/chunks/{chunk-XE4YKDIM.js → chunk-LXWXZPEB.js} +2 -2
- package/dist/cli/chunks/{chunk-5G2L4XRU.js → chunk-LYWA4OU6.js} +2 -2
- package/dist/cli/chunks/{chunk-REJEFTWX.js → chunk-MAP6IAOP.js} +1 -1
- package/dist/cli/chunks/{chunk-EAIPJSKH.js → chunk-MCONVCB6.js} +3 -3
- package/dist/cli/chunks/{chunk-TLCCM2AF.js → chunk-MFMPTRZW.js} +1 -1
- package/dist/cli/chunks/{chunk-MYCVU3D3.js → chunk-MI5TV5HT.js} +2 -2
- package/dist/cli/chunks/{chunk-CNKOIHF6.js → chunk-MULV6D5J.js} +2 -2
- package/dist/cli/chunks/{chunk-47QIAHUJ.js → chunk-MZ6GBVQY.js} +2 -2
- package/dist/cli/chunks/{chunk-ZG4EKPGV.js → chunk-N44DNZTM.js} +1 -1
- package/dist/cli/chunks/{chunk-FOAWHNOP.js → chunk-NCTSH4T6.js} +2 -2
- package/dist/cli/chunks/{chunk-NTVJKQ5S.js → chunk-ND33EKHX.js} +2 -2
- package/dist/cli/chunks/{chunk-BYHUGO73.js → chunk-NFFA2UKL.js} +3 -3
- package/dist/cli/chunks/{chunk-YN7HCVUP.js → chunk-NNFWNI6A.js} +2 -2
- package/dist/cli/chunks/{chunk-NNF3GCGF.js → chunk-OPC4ZVSN.js} +2 -2
- package/dist/cli/chunks/{chunk-KXRDQQGN.js → chunk-OXGZKXSI.js} +2 -2
- package/dist/cli/chunks/{chunk-NZQYNUGM.js → chunk-PIINM2PD.js} +2 -2
- package/dist/cli/chunks/{chunk-K6MFAVXK.js → chunk-Q5JL7NZG.js} +2 -2
- package/dist/cli/chunks/{chunk-I3TFGMOQ.js → chunk-QCFJQZXN.js} +1 -1
- package/dist/cli/chunks/{chunk-IY4P35N3.js → chunk-QSH4Y5E6.js} +2 -2
- package/dist/cli/chunks/{chunk-JMLOEW7Y.js → chunk-QYIGUM3F.js} +2 -2
- package/dist/cli/chunks/chunk-R3U7DSLA.js +62 -0
- package/dist/cli/chunks/{chunk-QMSDKKYG.js → chunk-RP2RRUKT.js} +1 -1
- package/dist/cli/chunks/{chunk-ZWSRIJ2T.js → chunk-SFNSMZGU.js} +2 -2
- package/dist/cli/chunks/{chunk-N6P7ENG7.js → chunk-SHAXRSWJ.js} +2 -2
- package/dist/cli/chunks/{chunk-UIIEZMSM.js → chunk-SR2EV7PQ.js} +1 -1
- package/dist/cli/chunks/{chunk-TVHWI77X.js → chunk-TGMZ7K72.js} +1 -1
- package/dist/cli/chunks/{chunk-7V7TP242.js → chunk-TH2BBFJ6.js} +1 -1
- package/dist/cli/chunks/{chunk-ENCFLC44.js → chunk-TIEXYJMS.js} +2 -2
- package/dist/cli/chunks/{chunk-VA45HLBF.js → chunk-TLVEBQCX.js} +2 -2
- package/dist/cli/chunks/chunk-TNQW3FUW.js +29 -0
- package/dist/cli/chunks/{chunk-NLUBN642.js → chunk-U5L7FALK.js} +2 -2
- package/dist/cli/chunks/{chunk-KJAIE7SL.js → chunk-UBOH75WQ.js} +4 -4
- package/dist/cli/chunks/{chunk-CFLA2GBS.js → chunk-UDJLIERV.js} +2 -2
- package/dist/cli/chunks/{chunk-VAIOZDG5.js → chunk-UYMA75Y4.js} +1 -1
- package/dist/cli/chunks/{chunk-ZBJRNCWX.js → chunk-V7GV54AY.js} +2 -2
- package/dist/cli/chunks/{chunk-AKFRM4IO.js → chunk-VJHKNSOC.js} +2 -2
- package/dist/cli/chunks/{chunk-L4JTTPU7.js → chunk-VK7AXSAI.js} +2 -2
- package/dist/cli/chunks/{chunk-FUHPLXJX.js → chunk-VSV6PV47.js} +1 -1
- package/dist/cli/chunks/{chunk-VOOJDHLI.js → chunk-VVGXCLJF.js} +3 -3
- package/dist/cli/chunks/{chunk-CQWZNVIM.js → chunk-WRPQJZSP.js} +2 -2
- package/dist/cli/chunks/{chunk-4N736EES.js → chunk-YCD3EBQJ.js} +2 -2
- package/dist/cli/chunks/{chunk-JF3U456G.js → chunk-YDIHYU7V.js} +2 -2
- package/dist/cli/chunks/{chunk-7UHRT5AX.js → chunk-ZGR5LFER.js} +2 -2
- package/dist/cli/chunks/{chunk-W7XVEWKQ.js → chunk-ZSDK26IP.js} +1 -1
- package/dist/cli/chunks/{chunk-PTOTOBOU.js → chunk-ZUFM5K7F.js} +1 -1
- package/dist/cli/chunks/{ci-LRTJSZHT.js → ci-WZ4E35B6.js} +2 -2
- package/dist/cli/chunks/{ci-output-LISCHUKD.js → ci-output-WMYWSAHI.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-7PMP25KZ.js → circuit-breaker-4E4ZZ47P.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-DOW4QVMC.js → claude-flow-setup-Q37FECGF.js} +2 -2
- package/dist/cli/chunks/client-3YW2WA67.js +2 -0
- package/dist/cli/chunks/{cline-installer-2NXQGW73.js → cline-installer-O7GPSWES.js} +2 -2
- package/dist/cli/chunks/{code-3X6RWAS7.js → code-AEIXP2UD.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-4ABP5WCP.js → code-index-extractor-5RXCWE5W.js} +2 -2
- package/dist/cli/chunks/{codex-installer-V7PII6GL.js → codex-installer-HDPSP2IN.js} +2 -2
- package/dist/cli/chunks/{completions-Y7LNQ63I.js → completions-LYTPZCND.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-XLYMAM6I.js → complexity-analyzer-WBRRBUIA.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-GOT4TKNT.js → continuedev-installer-6KICDS72.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-D6BAQVIO.js → copilot-installer-2YI4SWDH.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-VT7C5Q52.js → cost-tracker-YEVYFYK5.js} +2 -2
- package/dist/cli/chunks/{coverage-C62MRP4M.js → coverage-MO2TU62L.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-2MAV2XPY.js +2 -0
- package/dist/cli/chunks/{cursor-installer-WAWSS2K2.js → cursor-installer-AO2JNN27.js} +2 -2
- package/dist/cli/chunks/daemon-6DWF4GAR.js +16 -0
- package/dist/cli/chunks/daemon-WCSJ3HS2.js +10 -0
- package/dist/cli/chunks/{dag-attention-scheduler-SZIZWPV7.js → dag-attention-scheduler-NI6TAE7Y.js} +2 -2
- package/dist/cli/chunks/{detect-AJX6NJEP.js → detect-3MTKRZEI.js} +2 -2
- package/dist/cli/chunks/{dist-node-E5X47QTY.js → dist-node-32YFXCS3.js} +2 -2
- package/dist/cli/chunks/{domain-handler-FN3PIP45.js → domain-handler-TFVVUKSC.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-N3TOJEMT.js → domain-transfer-7HWX6PVA.js} +2 -2
- package/dist/cli/chunks/dream-4N3YBX36.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-PJI5TZKR.js → embed-and-insert-pattern-GGNDGEHX.js} +2 -2
- package/dist/cli/chunks/{eval-OS54TDQU.js → eval-T2KWZU2L.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-FBM4ANZW.js → experience-capture-middleware-JHQPDNVK.js} +3 -3
- package/dist/cli/chunks/{fast-paths-2CVAAPQO.js → fast-paths-KJQ56NG6.js} +2 -2
- package/dist/cli/chunks/{feature-flags-GEXTW6OT.js → feature-flags-DJU7Z6UH.js} +2 -2
- package/dist/cli/chunks/{feature-flags-A5KFWVFC.js → feature-flags-IPK5DUQM.js} +2 -2
- package/dist/cli/chunks/{file-discovery-KWLVC7KN.js → file-discovery-G5I7VV34.js} +2 -2
- package/dist/cli/chunks/{fleet-MNKH356S.js → fleet-BRKXQGTC.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-ALTWYFVZ.js → gnn-wrapper-F44UEMIK.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-MBMEPEGW.js → heartbeat-handler-4EJQ3VWP.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-5KZS7T6Q.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-A4XK3GZU.js +2 -0
- package/dist/cli/chunks/hnsw-index-TI7LZBWF.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-WTD5PR5V.js → hnsw-legacy-bridge-HVFM7LAR.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-NYOVLWBG.js → hnswlib-node-SDVX3I7F.js} +2 -2
- package/dist/cli/chunks/{hooks-ELHGEBFK.js → hooks-QFQSVB2C.js} +10 -10
- package/dist/cli/chunks/{hybrid-router-D6ZMIZCE.js → hybrid-router-TZPIYG3I.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-JOQ6TERZ.js → hypergraph-engine-HXG5GI27.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-HX45YWWN.js → hypergraph-handler-R4LFFQ3Z.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-NQZBRTZH.js +2 -0
- package/dist/cli/chunks/{init-handler-TNVU6NQ6.js → init-handler-NJKVTURQ.js} +13 -12
- package/dist/cli/chunks/init-wizard-UZR2AKQA.js +2 -0
- package/dist/cli/chunks/kernel-2HFKLNTS.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-YC5RJIY4.js → kilocode-installer-T6CMAQ6P.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-EAB26M55.js → kiro-installer-IOAHUSWU.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-GHICW2ZM.js +2 -0
- package/dist/cli/chunks/{learning-A2OB7D2B.js → learning-2AH5KAFV.js} +3 -3
- package/dist/cli/chunks/{llm-router-KEG6PA7C.js → llm-router-I3YBDMC7.js} +4 -4
- package/dist/cli/chunks/load-MTLOPMP4.js +2 -0
- package/dist/cli/chunks/load-test-DUOZJLRA.js +2 -0
- package/dist/cli/chunks/{mcp-ERJHZ6FN.js → mcp-EEINX3NP.js} +2 -2
- package/dist/cli/chunks/{memory-GSRIJIVR.js → memory-OBDYP5P7.js} +5 -5
- package/dist/cli/chunks/memory-backend-AMPSDQR7.js +2 -0
- package/dist/cli/chunks/memory-handlers-TTMZ2JK6.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-GK3V7ERC.js → multi-model-executor-OCANACFF.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-6TTN26RG.js → opencode-installer-4PNJOOKX.js} +2 -2
- package/dist/cli/chunks/{orchestrator-YVTSM6QW.js → orchestrator-DGIKNLST.js} +5 -5
- package/dist/cli/chunks/{pipeline-EWLJCY5G.js → pipeline-4DZ3FRRT.js} +2 -2
- package/dist/cli/chunks/{platform-2ULHQQME.js → platform-A27VETGX.js} +2 -2
- package/dist/cli/chunks/{plugin-PYN2KOXA.js → plugin-SAIG2MCN.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-IULCTOGZ.js → prime-radiant-advanced-wasm-XBCJETFT.js} +2 -2
- package/dist/cli/chunks/protocol-executor-4HZSMKVG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-FZYI2SBP.js → protocol-handler-NDOZLFK7.js} +2 -2
- package/dist/cli/chunks/{prove-DN7S74SP.js → prove-XVUI5VJL.js} +2 -2
- package/dist/cli/chunks/{provider-manager-FT3MCROB.js → provider-manager-W6CZHTWY.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-OGPCKVDP.js +2 -0
- package/dist/cli/chunks/{quality-ITBU6LGC.js → quality-MRCQ7SDM.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-ETWOFJGR.js +2 -0
- package/dist/cli/chunks/{real-embeddings-PZUZ5RXJ.js → real-embeddings-3NBKHQSF.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-2LMVZOUZ.js → roocode-installer-FPWTSZG7.js} +2 -2
- package/dist/cli/chunks/router-OMWLL5V3.js +2 -0
- package/dist/cli/chunks/routing-feedback-SULO56IE.js +2 -0
- package/dist/cli/chunks/{routing-handler-5RB73UCF.js → routing-handler-SYAT3QTK.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-VBN4APMG.js → ruvector-commands-Y3JV2RC4.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-BNY4AUWT.js → rvf-dual-writer-4IS5JKSA.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-73MKPBGV.js → rvf-migration-adapter-FPEUOS55.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-SGVB7ZAZ.js → rvf-migration-coordinator-FR4NHRNG.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-PFMHXYDR.js +2 -0
- package/dist/cli/chunks/safe-db-V34EBOPG.js +2 -0
- package/dist/cli/chunks/schedule-WJALMS5B.js +2 -0
- package/dist/cli/chunks/scheduler-CBWMQLTY.js +2 -0
- package/dist/cli/chunks/{security-XUH4H7R3.js → security-EPJBWOM2.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-KOZOSWBO.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-GML4EDYF.js → shared-rvf-dual-writer-MSUS3ROX.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-7RV55RNF.js +2 -0
- package/dist/cli/chunks/{status-handler-XI7GJF6Z.js → status-handler-7T6ZWWSG.js} +2 -2
- package/dist/cli/chunks/{structural-health-WPCYKOXV.js → structural-health-IT5COKMM.js} +2 -2
- package/dist/cli/chunks/sync-CYTAJ62F.js +17 -0
- package/dist/cli/chunks/sync-MVC5LKWT.js +2 -0
- package/dist/cli/chunks/{task-handler-FZB55IEG.js → task-handler-R5T6DQ62.js} +2 -2
- package/dist/cli/chunks/{task-handlers-EXZGFH7F.js → task-handlers-BQDACRA4.js} +3 -3
- package/dist/cli/chunks/{test-XYRN4OVU.js → test-JQ6DNHJU.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-FLVOPGOT.js → test-scheduling-47CCXYB3.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-FDCFVRHM.js → token-bootstrap-THINRRHA.js} +2 -2
- package/dist/cli/chunks/{token-usage-MHNZF3DM.js → token-usage-AQOWJPTG.js} +2 -2
- package/dist/cli/chunks/{transformers-4CRVTMWY.js → transformers-KRVEZU55.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-UDOTWN4W.js +2 -0
- package/dist/cli/chunks/{types-RKCD4BNL.js → types-YZSDKHGD.js} +2 -2
- package/dist/cli/chunks/unified-memory-FHP2C2NF.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-MI27GSUL.js +2 -0
- package/dist/cli/chunks/unified-persistence-67RJXTNL.js +2 -0
- package/dist/cli/chunks/{upgrade-463W7VKH.js → upgrade-UX6VHS4H.js} +2 -2
- package/dist/cli/chunks/{validate-LENSMEAY.js → validate-SUS7IEZG.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-4FEBNAWA.js → validate-swarm-E2YE6GY2.js} +2 -2
- package/dist/cli/chunks/{vibium-TXNVIVWJ.js → vibium-UZMTKRTE.js} +2 -2
- package/dist/cli/chunks/visual-security-JF6AGYOT.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-BZEGWID4.js → web-tree-sitter-XXU37FYS.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-7AFXJTPU.js → windsurf-installer-WRTVYD3Y.js} +2 -2
- package/dist/cli/chunks/{witness-chain-G6SUZOZG.js → witness-chain-6OSAEH67.js} +2 -2
- package/dist/cli/chunks/witness-chain-HNY2ED2G.js +2 -0
- package/dist/cli/chunks/{workflow-EVQPO6FH.js → workflow-7XKEQVKT.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-OPUU4TNV.js +2 -0
- package/dist/cli/chunks/{wrappers-HR6RUDI2.js → wrappers-2HDILUDI.js} +2 -2
- package/dist/cli/handlers/init-handler.js +47 -0
- package/dist/domains/learning-optimization/coordinator-helpers.js +7 -1
- package/dist/domains/learning-optimization/coordinator.js +5 -1
- package/dist/domains/learning-optimization/services/learning-coordinator.js +42 -17
- package/dist/domains/learning-optimization/services/metrics-optimizer.js +4 -1
- package/dist/domains/learning-optimization/services/production-intel.js +14 -5
- package/dist/domains/learning-optimization/services/transfer-specialist.js +12 -4
- package/dist/integrations/embeddings/base/EmbeddingGenerator.d.ts +1 -1
- package/dist/integrations/embeddings/base/EmbeddingGenerator.js +14 -5
- package/dist/kernel/hybrid-backend.d.ts +17 -7
- package/dist/kernel/hybrid-backend.js +24 -10
- package/dist/kernel/interfaces.d.ts +21 -6
- package/dist/kernel/memory-backend.d.ts +5 -5
- package/dist/kernel/memory-backend.js +14 -7
- package/dist/learning/real-embeddings.js +1 -1
- package/dist/mcp/bundle.js +454 -454
- package/dist/mcp/handlers/core-handlers.js +21 -0
- package/dist/shared/parsers/tree-sitter-wasm-parser.js +8 -3
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/kv-date-rehydrate.d.ts +51 -0
- package/dist/shared/utils/kv-date-rehydrate.js +78 -0
- package/dist/workers/interfaces.d.ts +26 -0
- package/dist/workers/worker-manager.d.ts +15 -12
- package/dist/workers/worker-manager.js +11 -0
- package/dist/workers/workers/learning-consolidation.js +123 -90
- package/package.json +23 -10
- package/dist/cli/chunks/adapter-CI2GZYME.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-KNQKALLI.js +0 -2
- package/dist/cli/chunks/base-P7PRMQWY.js +0 -2
- package/dist/cli/chunks/browser-workflow-QUP4A763.js +0 -2
- package/dist/cli/chunks/chunk-2NLZXG6V.js +0 -2
- package/dist/cli/chunks/chunk-5Z6PYYWK.js +0 -2
- package/dist/cli/chunks/chunk-RBDAHW2M.js +0 -2
- package/dist/cli/chunks/client-XF6SJO2C.js +0 -2
- package/dist/cli/chunks/cross-domain-router-J2OFPM6R.js +0 -2
- package/dist/cli/chunks/daemon-CP2ETHRF.js +0 -19
- package/dist/cli/chunks/dream-D5LD5SOZ.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-M2MMM3N6.js +0 -2
- package/dist/cli/chunks/hnsw-index-JO7KNF7M.js +0 -2
- package/dist/cli/chunks/impact-analyzer-ROQL4J7P.js +0 -2
- package/dist/cli/chunks/init-wizard-4BDFZX4M.js +0 -2
- package/dist/cli/chunks/kernel-37Y63WKR.js +0 -2
- package/dist/cli/chunks/knowledge-graph-V3DX6ZCX.js +0 -2
- package/dist/cli/chunks/load-D6ZDLVA3.js +0 -2
- package/dist/cli/chunks/load-test-HPBA2CMT.js +0 -2
- package/dist/cli/chunks/memory-backend-DODDBB46.js +0 -2
- package/dist/cli/chunks/memory-handlers-MFLCRS7V.js +0 -2
- package/dist/cli/chunks/protocol-executor-D56OYMCJ.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-KXROIEK7.js +0 -2
- package/dist/cli/chunks/queen-coordinator-XOGATERL.js +0 -2
- package/dist/cli/chunks/router-3EHNUCOM.js +0 -2
- package/dist/cli/chunks/routing-feedback-ZHKGET22.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-4YC5IQUW.js +0 -2
- package/dist/cli/chunks/safe-db-PLJRHQIC.js +0 -2
- package/dist/cli/chunks/schedule-7DGELVJE.js +0 -2
- package/dist/cli/chunks/scheduler-VWASEC2J.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-DCVDY2XW.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-CTEBGVOW.js +0 -2
- package/dist/cli/chunks/sync-SFKTCRZC.js +0 -23
- package/dist/cli/chunks/tree-sitter-wasm-parser-CI3V4AND.js +0 -2
- package/dist/cli/chunks/unified-memory-YDKXKW3D.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-6N7YZCLR.js +0 -2
- package/dist/cli/chunks/unified-persistence-UTWLPUQI.js +0 -2
- package/dist/cli/chunks/visual-security-DGXSOFKD.js +0 -2
- package/dist/cli/chunks/witness-chain-VP4MF6EU.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-VXSYAKQY.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{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.9.33");process.exit(0)}
|
|
2
|
+
import{a as h}from"./chunk-AVQS5H7Y.js";import{a as C,f as x}from"./chunk-BIXDUMZ4.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
|
|
3
3
|
`).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
var P="quality-daemon",x=class{constructor(e){this.backend=e}backend;async get(e){return this.backend.kvGet(e,P)}async set(e,t){await this.backend.kvSet(e,t,P)}async search(e){return this.backend.kvSearch(e,P)}};import{cpus as Z,freemem as ee,totalmem as te,loadavg as ie}from"os";var p=class{queues={now:[],next:[],later:[]};_maxSize;constructor(e=1e3){this._maxSize=e}enqueue(e){return this.size>=this._maxSize?!1:(this.queues[e.priority].push(e),!0)}dequeue(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(;i.length>0;){let o=i.shift();if(!(o.ttlMs&&e-o.createdAt>o.ttlMs))return o}}}peek(){let e=Date.now();for(let t of["now","next","later"]){let i=this.queues[t];for(let o of i)if(!o.ttlMs||e-o.createdAt<=o.ttlMs)return o}}drainPriority(e){let t=this.queues[e].splice(0),i=Date.now();return t.filter(o=>!o.ttlMs||i-o.createdAt<=o.ttlMs)}pruneExpired(){let e=0,t=Date.now();for(let i of["now","next","later"]){let o=this.queues[i].length;this.queues[i]=this.queues[i].filter(r=>!r.ttlMs||t-r.createdAt<=r.ttlMs),e+=o-this.queues[i].length}return e}get size(){return this.queues.now.length+this.queues.next.length+this.queues.later.length}get depths(){return{now:this.queues.now.length,next:this.queues.next.length,later:this.queues.later.length}}get isEmpty(){return this.size===0}clear(){this.queues.now=[],this.queues.next=[],this.queues.later=[]}};import{watch as G}from"fs";import{execFile as Q}from"child_process";import{promisify as $}from"util";import{resolve as R,join as H}from"path";import{existsSync as L,readFileSync as U}from"fs";var _=$(Q),z={repoRoot:process.cwd(),debounceMs:500,maxChangedFiles:200,pollIntervalMs:5e3},g=class{constructor(e,t){this.queue=e;this.options={...z,...t}}queue;watcher;pollTimer;options;lastKnownHeads=new Map;debounceTimer;_running=!1;_polling=!1;get running(){return this._running}async start(){if(this._running)return;let e=R(this.options.repoRoot,".git","refs","heads");if(!L(e))throw new Error(`Git refs directory not found: ${e}`);await this.snapshotHeads(),process.platform==="darwin"||process.platform==="win32"?this.watcher=G(e,{recursive:!0},(i,o)=>{o&&this.handleRefChange(o)}):this.pollTimer=setInterval(()=>{this.poll().catch(i=>{console.debug("[GitWatcher] Poll error:",i)})},this.options.pollIntervalMs),this._running=!0}stop(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=void 0),this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=void 0),this.watcher&&(this.watcher.close(),this.watcher=void 0),this._running=!1}async poll(){if(this._polling)return[];this._polling=!0;let e=[];try{let{stdout:t}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let i of t.trim().split(`
|
|
3
|
+
`)){if(!i)continue;let[o,r]=i.split(" "),n=this.lastKnownHeads.get(o);n&&n!==r&&(e.push(o),await this.enqueueCommitAnalysis(o,r)),this.lastKnownHeads.set(o,r)}}catch{}finally{this._polling=!1}return e}handleRefChange(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.processRefChange(e).catch(t=>{console.debug("[GitWatcher] Error processing ref change:",t)})},this.options.debounceMs)}async processRefChange(e){let t=e.replace(/\\/g,"/"),i=R(this.options.repoRoot,".git","refs","heads"),o=H(i,e),r;try{r=U(o,"utf-8").trim()}catch{return}this.lastKnownHeads.get(t)!==r&&(this.lastKnownHeads.set(t,r),await this.enqueueCommitAnalysis(t,r))}async enqueueCommitAnalysis(e,t){let i=[];try{let{stdout:n}=await _("git",["diff-tree","--no-commit-id","--name-only","-r",t],{cwd:this.options.repoRoot});i=n.trim().split(`
|
|
4
|
+
`).filter(Boolean).slice(0,this.options.maxChangedFiles)}catch{}let o={type:"git_commit",branch:e,commitHash:t,changedFiles:i},r={id:`git-${t}-${Date.now()}`,priority:"next",payload:o,createdAt:Date.now(),source:"git-watcher",ttlMs:300*1e3};this.queue.enqueue(r)}async snapshotHeads(){try{let{stdout:e}=await _("git",["for-each-ref","--format=%(refname:short) %(objectname:short)","refs/heads/"],{cwd:this.options.repoRoot});for(let t of e.trim().split(`
|
|
5
|
+
`)){if(!t)continue;let[i,o]=t.split(" ");this.lastKnownHeads.set(i,o)}}catch{}}};var E={regressionThreshold:2,gapThreshold:60,memoryPrefix:"quality-daemon:coverage"},f=class{constructor(e,t){this.queue=e;this.options={...E,...t}}queue;options;async analyze(e,t,i){let o=await t.get(`${this.options.memoryPrefix}:snapshot`);if(await t.set(`${this.options.memoryPrefix}:snapshot`,e),!o)return{regressionDetected:!1,overallDelta:{line:0,branch:0,function:0,statement:0},affectedFiles:[],newGaps:[]};let r=o,n={line:e.overall.line-r.overall.line,branch:e.overall.branch-r.overall.branch,function:e.overall.function-r.overall.function,statement:e.overall.statement-r.overall.statement},s=n.line<-this.options.regressionThreshold||n.branch<-this.options.regressionThreshold,a=i??Object.keys(e.files),u=[],c=[];for(let d of a){let l=e.files[d],m=r.files[d];if(!l)continue;let I=m?l.line-m.line:0,M=m?l.branch-m.branch:0,D=m?l.uncoveredLines.filter(T=>!m.uncoveredLines.includes(T)):l.uncoveredLines;if((I!==0||M!==0||D.length>0)&&u.push({file:d,lineDelta:I,branchDelta:M,newUncoveredLines:D}),l.line<this.options.gapThreshold){let T=this.computeRiskScore(l,D.length);c.push({file:d,uncoveredLines:l.uncoveredLines,currentCoverage:l.line,riskScore:T})}}return(s||c.length>0)&&this.enqueueTestSuggestion(e,r,c),await t.set(`${this.options.memoryPrefix}:delta`,{timestamp:Date.now(),overallDelta:n,regressionDetected:s,affectedFileCount:u.length,gapCount:c.length}),{regressionDetected:s,overallDelta:n,affectedFiles:u,newGaps:c}}async buildSnapshot(e){let t=await e.get("coverage:latest");if(t)return{timestamp:Date.now(),overall:{line:t.line,branch:t.branch,function:t.function,statement:t.statement},files:t.files??{}}}computeRiskScore(e,t){let o=1-Math.min(100,Math.max(0,e.line))/100,r=Math.min(t/50,1);return Math.min(1,o*.6+r*.4)}enqueueTestSuggestion(e,t,i){let o={type:"coverage_delta",previousSnapshot:`snapshot-${t.timestamp}`,currentSnapshot:`snapshot-${e.timestamp}`},r={id:`coverage-delta-${Date.now()}`,priority:i.some(n=>n.riskScore>.8)?"now":"next",payload:o,createdAt:Date.now(),source:"coverage-delta",ttlMs:600*1e3};this.queue.enqueue(r)}};import{execFile as j}from"child_process";import{promisify as B}from"util";var J=B(j),K={runsPerWorkflow:10,flakyThreshold:3,repo:""},y=class{constructor(e,t){this.queue=e;this.options={...K,...t}}queue;options;async check(){let e=await this.fetchRecentRuns(),t=this.groupByWorkflow(e),i=[],o=[],r=0;for(let[s,a]of Object.entries(t)){let u=a.filter(m=>m.conclusion==="failure").length,c=a.length>0?(a.length-u)/a.length*100:100,d=this.countConsecutiveFailures(a),l=a[0]?.conclusion??"unknown";l==="failure"&&r++,d>=this.options.flakyThreshold&&(o.push(s),this.enqueueFailureAlert(s,a[0])),i.push({name:s,recentRuns:a.length,failedRuns:u,successRate:Math.round(c*10)/10,lastConclusion:l,consecutiveFailures:d})}let n=this.calculateHealthScore(i);return{timestamp:Date.now(),workflows:i,failingWorkflows:r,flakyWorkflows:o,healthScore:n}}async fetchRecentRuns(){try{let e=["run","list","--limit",String(this.options.runsPerWorkflow*5),"--json","name,status,conclusion,headBranch,number,databaseId,createdAt"];this.options.repo&&e.push("--repo",this.options.repo);let{stdout:t}=await J("gh",e,{timeout:15e3});return JSON.parse(t).map(o=>({name:o.name,status:o.status,conclusion:o.conclusion??"pending",headBranch:o.headBranch,runNumber:o.number,databaseId:o.databaseId,createdAt:o.createdAt}))}catch{return[]}}groupByWorkflow(e){let t={};for(let i of e)t[i.name]||(t[i.name]=[]),t[i.name].push(i);for(let i of Object.keys(t))t[i]=t[i].slice(0,this.options.runsPerWorkflow);return t}countConsecutiveFailures(e){let t=0;for(let i of e)if(i.conclusion==="failure")t++;else break;return t}calculateHealthScore(e){if(e.length===0)return 100;let t=e.reduce((i,o)=>i+o.successRate,0)/e.length;return Math.round(t)}enqueueFailureAlert(e,t){let i={type:"ci_failure",workflowName:e,runId:t.databaseId,conclusion:t.conclusion},o={id:`ci-failure-${e}-${Date.now()}`,priority:"now",payload:i,createdAt:Date.now(),source:"ci-monitor",ttlMs:1800*1e3};this.queue.enqueue(o)}};var V={memoryPrefix:"quality-daemon:suggestions",maxSuggestions:100,minRiskScore:.3},v=class{options;constructor(e){this.options={...V,...e}}async suggest(e,t,i){let o=[],r=e.filter(s=>s.riskScore>=this.options.minRiskScore);for(let s of r){let a=t.includes(s.file),u=this.determinePriority(s,a),c=this.determineTestType(s.file),d=this.estimateEffort(s);o.push({id:`suggestion-${Date.now()}-${o.length}`,file:s.file,uncoveredLines:s.uncoveredLines.slice(0,50),suggestedTestType:c,description:this.generateDescription(s,c),priority:u,estimatedEffort:d,createdAt:Date.now(),status:"pending"})}o.sort((s,a)=>{let u={high:0,medium:1,low:2};return u[s.priority]-u[a.priority]});let n=o.slice(0,this.options.maxSuggestions);return await this.storeSuggestions(n,i),n}async getPending(e){return(await e.get(`${this.options.memoryPrefix}:list`)??[]).filter(i=>i.status==="pending")}async updateStatus(e,t,i){let o=await i.get(`${this.options.memoryPrefix}:list`);if(!o)return!1;let r=o.findIndex(s=>s.id===e);if(r===-1)return!1;let n=o.map((s,a)=>a===r?{...s,status:t}:s);return await i.set(`${this.options.memoryPrefix}:list`,n),!0}determinePriority(e,t){return e.riskScore>.8?"high":t||e.riskScore>.5?"medium":"low"}determineTestType(e){return e.includes("/api/")||e.includes("/routes/")||e.includes("/handlers/")?"integration":e.includes("/e2e/")||e.includes("/pages/")||e.includes("/views/")?"e2e":"unit"}estimateEffort(e){return e.uncoveredLines.length<=10?"small":e.uncoveredLines.length<=50?"medium":"large"}generateDescription(e,t){let i=e.uncoveredLines.length,o=Math.round(e.currentCoverage);return`Add ${t} tests for ${e.file} (${i} uncovered lines, ${o}% coverage, risk ${(e.riskScore*100).toFixed(0)}%)`}async storeSuggestions(e,t){let r=[...(await t.get(`${this.options.memoryPrefix}:list`)??[]).filter(n=>n.status!=="pending"),...e].slice(-this.options.maxSuggestions);await t.set(`${this.options.memoryPrefix}:list`,r),await t.set(`${this.options.memoryPrefix}:count`,{pending:e.length,total:r.length,lastUpdated:Date.now()})}};var Y={memoryPrefix:"quality-daemon:nightly",maxEntryAge:6048e5,nightlyHour:2},w=class{constructor(e,t){this.queue=e;this.options={...Y,...t}}queue;options;lastRunDate;shouldRun(){let e=new Date,t=e.toISOString().split("T")[0];return this.lastRunDate===t?!1:e.getHours()>=this.options.nightlyHour}scheduleIfDue(){if(!this.shouldRun())return!1;let e={type:"nightly",tasks:["consolidate_patterns","prune_expired","generate_report"]},t={id:`nightly-${Date.now()}`,priority:"later",payload:e,createdAt:Date.now(),source:"nightly-consolidation",ttlMs:720*60*1e3};return this.queue.enqueue(t)}async execute(e,t){let i=Date.now(),o=new Date().toISOString().split("T")[0],r=await this.consolidatePatterns(e),n=await this.pruneExpired(e),s=this.generateReport(o,t);await e.set(`${this.options.memoryPrefix}:report:${o}`,s),this.lastRunDate=o;let a={timestamp:Date.now(),patternsConsolidated:r,entriesPruned:n,reportGenerated:!0,durationMs:Date.now()-i};return await e.set(`${this.options.memoryPrefix}:last-result`,a),a}async getLastResult(e){return e.get(`${this.options.memoryPrefix}:last-result`)}async consolidatePatterns(e){let t=await e.search("quality-daemon:*"),i=0;return await e.get("quality-daemon:suggestions:count")&&i++,await e.get("quality-daemon:coverage:delta")&&i++,i}async pruneExpired(e){let t=await e.search("quality-daemon:*"),i=0,o=Date.now();for(let r of t){if(r.endsWith(":snapshot")||r.endsWith(":list"))continue;let n=await e.get(r);n&&typeof n.timestamp=="number"&&o-n.timestamp>this.options.maxEntryAge&&(await e.set(r,{pruned:!0,prunedAt:o}),i++)}return i}generateReport(e,t){return{date:e,coverageHealth:t.coverageHealth??0,ciHealth:t.ciHealth??0,commitsAnalyzed:t.commitsAnalyzed??0,suggestionsGenerated:t.suggestionsGenerated??0,notificationsSent:t.notificationsSent??0,queueDepthAvg:t.queueDepthAvg??0,daemonUptime:t.uptimeSeconds??0}}};import{writeFileSync as q,mkdirSync as W,readdirSync as S,readFileSync as A,unlinkSync as N}from"fs";import{join as b,resolve as X}from"path";var F={notificationsDir:X(process.cwd(),".agentic-qe","notifications"),maxNotifications:200},k=class{notificationsDir;maxNotifications;webhookUrl;urlValidator;_sentCount=0;constructor(e){this.notificationsDir=e?.notificationsDir??F.notificationsDir,this.maxNotifications=e?.maxNotifications??F.maxNotifications,this.webhookUrl=e?.webhookUrl,this.urlValidator=e?.urlValidator}get sentCount(){return this._sentCount}initialize(){W(this.notificationsDir,{recursive:!0})}async send(e){let t={...e,id:`notif-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,timestamp:Date.now(),read:!1};return this.writeToFile(t),this.webhookUrl&&await this.sendWebhook(t),this._sentCount++,this.pruneOldNotifications(),t}list(e){let t=e?.limit??50;try{let i=S(this.notificationsDir).filter(r=>r.endsWith(".json")).sort().reverse(),o=[];for(let r of i){if(o.length>=t)break;try{let n=A(b(this.notificationsDir,r),"utf-8"),s=JSON.parse(n);if(e?.unreadOnly&&s.read||e?.type&&s.type!==e.type)continue;o.push(s)}catch{}}return o}catch{return[]}}markRead(e){try{let t=S(this.notificationsDir).filter(n=>n.endsWith(`-${e}.json`));if(t.length===0)return!1;let i=b(this.notificationsDir,t[0]),r={...JSON.parse(A(i,"utf-8")),read:!0};return q(i,JSON.stringify(r,null,2)),!0}catch{return!1}}clear(){try{let e=S(this.notificationsDir).filter(t=>t.endsWith(".json"));for(let t of e)N(b(this.notificationsDir,t));return e.length}catch{return 0}}writeToFile(e){try{W(this.notificationsDir,{recursive:!0});let t=`${e.timestamp}-${e.id}.json`,i=b(this.notificationsDir,t);q(i,JSON.stringify(e,null,2))}catch(t){console.debug("[NotificationService] Failed to write notification:",t)}}async sendWebhook(e){if(this.webhookUrl){if(this.urlValidator&&!this.urlValidator(this.webhookUrl)){console.warn("[NotificationService] Webhook URL blocked by SSRF guard:",this.webhookUrl);return}try{let t=await fetch(this.webhookUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(5e3)});t.ok||console.debug(`[NotificationService] Webhook returned ${t.status}`)}catch(t){console.debug("[NotificationService] Webhook delivery failed:",t)}}}pruneOldNotifications(){try{let e=S(this.notificationsDir).filter(i=>i.endsWith(".json")).sort();if(e.length<=this.maxNotifications)return;let t=e.slice(0,e.length-this.maxNotifications);for(let i of t)N(b(this.notificationsDir,i))}catch{}}};var C={tickIntervalMs:3e4,ciPollIntervalMs:5*6e4,coverageCheckIntervalMs:2*6e4,cpuThreshold:.7,memoryThreshold:.8},O=class{queue;gitWatcher;coverageDelta;ciMonitor;testSuggester;nightlyConsolidation;notificationService;tickTimer;_running=!1;_startedAt=0;_tickCount=0;_lastTickAt;_throttled=!1;_commitsAnalyzed=0;_suggestionsGenerated=0;_ciHealth=100;_coverageHealth=100;_lastCICheck;_lastCoverageCheck;_memory;config;constructor(e){this.config={tickIntervalMs:e?.tickIntervalMs??C.tickIntervalMs,ciPollIntervalMs:e?.ciPollIntervalMs??C.ciPollIntervalMs,coverageCheckIntervalMs:e?.coverageCheckIntervalMs??C.coverageCheckIntervalMs,cpuThreshold:e?.cpuThreshold??C.cpuThreshold,memoryThreshold:e?.memoryThreshold??C.memoryThreshold},this.queue=new p,this.gitWatcher=new g(this.queue,e?.git),this.coverageDelta=new f(this.queue,e?.coverage),this.ciMonitor=new y(this.queue,e?.ci),this.testSuggester=new v(e?.suggestions),this.nightlyConsolidation=new w(this.queue,e?.nightly),this.notificationService=new k(e?.notifications)}get running(){return this._running}async start(e){this._running||(this._memory=e,this._running=!0,this._startedAt=Date.now(),this.notificationService.initialize(),await this.gitWatcher.start().catch(t=>{console.debug("[QualityDaemon] Git watcher failed to start:",t)}),this.scheduleTick())}async stop(){this._running&&(this._running=!1,this.tickTimer&&(clearTimeout(this.tickTimer),this.tickTimer=void 0),this.gitWatcher.stop(),this._memory&&await this._memory.set("quality-daemon:state",{stoppedAt:Date.now(),tickCount:this._tickCount,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated}))}getStatus(){return{running:this._running,uptimeSeconds:this._running?Math.floor((Date.now()-this._startedAt)/1e3):0,tickCount:this._tickCount,queueDepth:this.queue.depths,lastTickAt:this._lastTickAt,throttled:this._throttled,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,ciHealth:this._ciHealth,coverageHealth:this._coverageHealth,lastCICheck:this._lastCICheck,lastCoverageCheck:this._lastCoverageCheck}}scheduleTick(){this._running&&(this.tickTimer=setTimeout(()=>this.tick(),this.config.tickIntervalMs))}async tick(){if(!(!this._running||!this._memory)){if(this._tickCount++,this._lastTickAt=Date.now(),this._throttled=this.isResourceConstrained(),this._throttled){await this.processNowItems(this._memory),this.scheduleTick();return}await this.processQueue(this._memory),await this.runPeriodicChecks(this._memory),this.nightlyConsolidation.scheduleIfDue(),this.queue.pruneExpired(),this.scheduleTick()}}async processQueue(e){let t=0,i=10;for(;t<i&&!this.queue.isEmpty;){let o=this.queue.dequeue();if(!o)break;await this.handleQueueItem(o,e),t++}}async processNowItems(e){let t=this.queue.drainPriority("now");for(let i of t)await this.handleQueueItem(i,e)}async handleQueueItem(e,t){let i=e.payload;switch(i.type){case"git_commit":this._commitsAnalyzed++;let o=await this.coverageDelta.buildSnapshot(t);if(o){let r=await this.coverageDelta.analyze(o,t,i.changedFiles);if(r.regressionDetected&&await this.notificationService.send({type:"coverage_drop",title:"Coverage Regression Detected",message:`Line coverage delta: ${r.overallDelta.line.toFixed(1)}% (${r.affectedFiles.length} files affected)`,severity:"high",metadata:{delta:r.overallDelta,commit:i.commitHash}}),r.newGaps.length>0){let n=await this.testSuggester.suggest(r.newGaps,i.changedFiles,t);this._suggestionsGenerated+=n.length,n.length>0&&await this.notificationService.send({type:"suggestion_available",title:"New Test Suggestions Available",message:`${n.length} test suggestions generated for uncovered code`,severity:"info",metadata:{count:n.length}})}}break;case"coverage_delta":{let r=await this.testSuggester.getPending(t);r.length>0&&await this.notificationService.send({type:"suggestion_available",title:"Test Suggestions Pending",message:`${r.length} test suggestions awaiting review`,severity:"info",metadata:{count:r.length}});break}case"gate_failure":await this.notificationService.send({type:"gate_failure",title:`Quality Gate Failed: ${i.gateName}`,message:`Score ${i.score} below threshold ${i.threshold}`,severity:"critical",metadata:{gate:i.gateName,score:i.score,threshold:i.threshold}});break;case"ci_failure":await this.notificationService.send({type:"ci_failure",title:`CI Failure: ${i.workflowName}`,message:`Workflow ${i.workflowName} run #${i.runId} concluded: ${i.conclusion}`,severity:"high",metadata:{workflow:i.workflowName,runId:i.runId}});break;case"nightly":{let r={coverageHealth:this._coverageHealth,ciHealth:this._ciHealth,commitsAnalyzed:this._commitsAnalyzed,suggestionsGenerated:this._suggestionsGenerated,notificationsSent:this.notificationService.sentCount,queueDepthAvg:this.queue.size,uptimeSeconds:Math.floor((Date.now()-this._startedAt)/1e3)};await this.nightlyConsolidation.execute(t,r);break}default:console.warn("[QualityDaemon] Unhandled payload type:",i.type)}}async runPeriodicChecks(e){let t=Date.now();if(!this._lastCICheck||t-this._lastCICheck>=this.config.ciPollIntervalMs)try{let i=await this.ciMonitor.check();this._ciHealth=i.healthScore,this._lastCICheck=t,i.flakyWorkflows.length>0&&await this.notificationService.send({type:"flaky_detected",title:"Flaky Workflows Detected",message:`${i.flakyWorkflows.length} workflows showing repeated failures: ${i.flakyWorkflows.join(", ")}`,severity:"medium",metadata:{workflows:i.flakyWorkflows}})}catch{}if(!this._lastCoverageCheck||t-this._lastCoverageCheck>=this.config.coverageCheckIntervalMs)try{let i=await this.coverageDelta.buildSnapshot(e);i&&(this._coverageHealth=Math.round((i.overall.line+i.overall.branch+i.overall.function+i.overall.statement)/4),this._lastCoverageCheck=t)}catch{}}isResourceConstrained(){if(1-ee()/te()>this.config.memoryThreshold)return!0;let t=Z().length;return(t>0?ie()[0]/t:0)>this.config.cpuThreshold}};export{x as a,O as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as f}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as f}from"./chunk-LVCQ4LSA.js";import{c as p}from"./chunk-PIINM2PD.js";import{a as l,d as b}from"./chunk-2NRCDJBB.js";import{a as d,c as g}from"./chunk-DEXOYNIQ.js";f();g();b();var v={dimensions:384,M:16,efConstruction:200,efSearch:100,metric:"cosine",namespace:"coverage-hnsw",maxElements:1e5},S=p.create("coverage-analysis/hnsw-index"),u=class{constructor(e,t={}){this.memory=e;this.config={...v,...t},this.stats={vectorCount:0,searchOperations:0,insertOperations:0}}memory;config;stats;searchLatencies=[];backendType="ruvector-gnn";adapter=null;initialized=!1;metadataStore=new Map;async initialize(){if(this.initialized)return;let e=this.config.metric==="cosine"?"cosine":"euclidean",t=`coverage-${this.config.namespace}`;d.close(t),this.adapter=d.create(t,{dimensions:this.config.dimensions,M:this.config.M,efConstruction:this.config.efConstruction,efSearch:this.config.efSearch,metric:e}),S.info(`HnswAdapter initialized: dimension=${this.config.dimensions}, metric=${this.config.metric}, M=${this.config.M} (unified backend via ADR-071)`),this.initialized=!0}isNativeAvailable(){return this.initialized&&this.adapter!==null}getBackendType(){return this.backendType}isRuvectorAvailable(){return this.initialized&&this.adapter!==null&&this.adapter.isRuvectorAvailable()}async insert(e,t,a){this.initialized||await this.initialize(),t=this.validateVector(t),this.adapter.addByStringId(e,t),a&&this.metadataStore.set(e,a),this.stats.insertOperations++,this.stats.vectorCount=this.adapter.size()}async search(e,t){this.initialized||await this.initialize(),e=this.validateVector(e);let a=performance.now(),n=[];this.adapter.size()>0&&(n=this.adapter.searchByArray(e,t).map(({id:i,score:o})=>({key:i,score:o,distance:1-o,metadata:this.metadataStore.get(i)})));let s=performance.now()-a;return this.recordSearchLatency(s),this.stats.searchOperations++,n}async batchInsert(e){this.initialized||await this.initialize();let t=100;for(let a=0;a<e.length;a+=t){let n=e.slice(a,a+t);await Promise.all(n.map(r=>this.insert(r.key,r.vector,r.metadata)))}}async delete(e){if(!this.adapter)return!1;let t=this.adapter.removeByStringId(e);if(t){this.metadataStore.delete(e);let a=this.buildKey(e);await this.memory.delete(a),this.stats.vectorCount=this.adapter.size()}return t}async getStats(){return{nativeHNSW:this.initialized&&this.adapter!==null,backendType:this.backendType,vectorCount:this.stats.vectorCount,indexSizeBytes:this.stats.vectorCount*this.config.dimensions*4,avgSearchLatencyMs:this.calculateAvgLatency(),p95SearchLatencyMs:this.calculatePercentileLatency(95),p99SearchLatencyMs:this.calculatePercentileLatency(99),searchOperations:this.stats.searchOperations,insertOperations:this.stats.insertOperations}}async clear(){this.metadataStore.clear(),this.adapter&&this.adapter.clear(),this.stats.vectorCount=0,this.searchLatencies=[]}validateVector(e){if(e.length!==this.config.dimensions)return this.resizeVector(e,this.config.dimensions);for(let t=0;t<e.length;t++)if(!Number.isFinite(e[t]))throw new Error(`Invalid vector value at index ${t}: ${e[t]}`);return e}resizeVector(e,t){if(e.length===t)return e;if(e.length>t){let n=new Array(t).fill(0),r=e.length/t;for(let s=0;s<t;s++){let h=Math.floor(s*r),i=Math.floor((s+1)*r),o=0;for(let m=h;m<i;m++)o+=e[m];n[s]=o/(i-h)}return n}let a=new Array(t).fill(0);for(let n=0;n<e.length;n++)a[n]=e[n];return a}buildKey(e){return`${this.config.namespace}:${e}`}recordSearchLatency(e){this.searchLatencies.push(e);let t=1e3;this.searchLatencies.length>t&&(this.searchLatencies=this.searchLatencies.slice(-t))}calculateAvgLatency(){return this.searchLatencies.length===0?0:this.searchLatencies.reduce((t,a)=>t+a,0)/this.searchLatencies.length}calculatePercentileLatency(e){if(this.searchLatencies.length===0)return 0;let t=[...this.searchLatencies].sort((n,r)=>n-r),a=Math.ceil(e/100*t.length)-1;return t[Math.max(0,a)]}setEfSearch(e){this.config.efSearch=e}};function C(c,e){return new u(c,e)}async function H(c,e=1e4,t=1e3){let n=performance.now();for(let i=0;i<e;i++){let o=Array.from({length:384},()=>l());await c.insert(`bench-${i}`,o)}let r=performance.now()-n,s=performance.now();for(let i=0;i<t;i++){let o=Array.from({length:384},()=>l());await c.search(o,10)}let h=performance.now()-s;return{insertTimeMs:r,searchTimeMs:h,avgSearchLatencyMs:h/t,isNative:c.isNativeAvailable(),backendType:c.getBackendType()}}export{v as a,u as b,C as c,H as d};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
2
|
var s={copilot:{id:"copilot",name:"GitHub Copilot",configPath:".vscode/mcp.json",configFormat:"json",configKey:"servers",rulesPath:".github/copilot-instructions.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cursor:{id:"cursor",name:"Cursor",configPath:".cursor/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".cursorrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},cline:{id:"cline",name:"Cline",configPath:".vscode/cline_mcp_settings.json",configFormat:"json",configKey:"mcpServers",rulesPath:".vscode/cline_custom_modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},kilocode:{id:"kilocode",name:"Kilo Code",configPath:".kilocode/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".kilocode/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},roocode:{id:"roocode",name:"Roo Code",configPath:".roo/mcp.json",configFormat:"json",configKey:"mcpServers",rulesPath:".roo/modes.json",rulesFormat:"json",supportsAutoApprove:!0,supportsCustomModes:!0,globalConfig:!1},codex:{id:"codex",name:"OpenAI Codex CLI",configPath:".codex/config.toml",configFormat:"toml",configKey:"mcp_servers",rulesPath:"AGENTS.md",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},windsurf:{id:"windsurf",name:"Windsurf",configPath:".windsurf/mcp_config.json",configFormat:"json",configKey:"mcpServers",rulesPath:".windsurfrules",rulesFormat:"markdown",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1},continuedev:{id:"continuedev",name:"Continue.dev",configPath:".continue/config.yaml",configFormat:"yaml",configKey:"mcpServers",rulesPath:".continue/rules/aqe-qe-standards.yaml",rulesFormat:"yaml",supportsAutoApprove:!1,supportsCustomModes:!1,globalConfig:!1}},i=["fleet_init","fleet_status","fleet_health","agent_list","agent_metrics","agent_status","team_list","team_health","task_list","task_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","defect_predict","code_index","memory_store","memory_retrieve","memory_query","memory_usage","model_route","routing_metrics","aqe_health"];function l(n){let e={command:"npx",args:["-y","agentic-qe@latest","mcp"],env:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"}};return n&&(e.disabled=!1,e.alwaysAllow=i),e}function c(n){let e=l(n.supportsAutoApprove);if(n.id==="copilot"){let o={[n.configKey]:{"agentic-qe":{type:"stdio",...e}}};return JSON.stringify(o,null,2)+`
|
|
3
3
|
`}let t={[n.configKey]:{"agentic-qe":e}};return JSON.stringify(t,null,2)+`
|
|
4
4
|
`}function u(){return`# Agentic QE MCP Server
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as N,d as P}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as N,d as P}from"./chunk-2NRCDJBB.js";import{b,e as k}from"./chunk-AGMHJ3GS.js";import{a as p,d as F}from"./chunk-HCAWQ7ZD.js";import{a as T,c as E}from"./chunk-DEXOYNIQ.js";import{a as H,b as O}from"./chunk-7HRE2VTG.js";import{c as z,g as S}from"./chunk-JJY6K3OI.js";function x(l){let e=0;for(let t=0;t<l.length;t++)e+=l[t]*l[t];return Math.sqrt(e)}function C(l,e,t,s){let n=t*s;if(n===0)return 0;let o=0;for(let r=0;r<l.length;r++)o+=l[r]*e[r];return o/n}function U(l={}){let{name:e="default",...t}=l;return new M(e,t)}var f,w,v,I,A,M,D=z(()=>{F();P();k();E();f=null,w=null;try{let l=(O(),S(H));f=l.differentiableSearch,w=l.init}catch{}v=class{data=[];compareFn;constructor(e){this.compareFn=e}push(e){this.data.push(e),this.bubbleUp(this.data.length-1)}pop(){if(this.data.length===0)return;let e=this.data[0],t=this.data.pop();return this.data.length>0&&(this.data[0]=t,this.sinkDown(0)),e}peek(){return this.data[0]}size(){return this.data.length}bubbleUp(e){for(;e>0;){let t=e-1>>1;if(this.compareFn(this.data[e],this.data[t])<0)[this.data[e],this.data[t]]=[this.data[t],this.data[e]],e=t;else break}}sinkDown(e){let t=this.data.length;for(;;){let s=e,n=2*e+1,o=2*e+2;if(n<t&&this.compareFn(this.data[n],this.data[s])<0&&(s=n),o<t&&this.compareFn(this.data[o],this.data[s])<0&&(s=o),s!==e)[this.data[e],this.data[s]]=[this.data[s],this.data[e]],e=s;else break}}},I=class{nodes=new Map;M=b.M_CONNECTIONS;Mmax0=b.M_CONNECTIONS*2;efConstruction=b.EF_CONSTRUCTION;efSearch=b.EF_SEARCH;mL=1/Math.log(b.M_CONNECTIONS);maxLevel=16;entryPoint=null;currentMaxLevel=-1;randomLevel(){return Math.min(Math.floor(-Math.log(N())*this.mL),this.maxLevel)}similarity(e,t){let s=this.nodes.get(t);return s?p(e,s.embedding):-1}searchLayer(e,t,s){let n=t,o=this.similarity(e,n),r=!0;for(;r;){r=!1;let a=this.nodes.get(n);if(!a)break;let h=a.neighbors.get(s)??[];for(let d of h){if(!this.nodes.has(d))continue;let i=this.similarity(e,d);i>o&&(n=d,o=i,r=!0)}}return n}searchLayerBeam(e,t,s,n){let o=new Set(t),r=t.filter(i=>this.nodes.has(i)).map(i=>({id:i,score:this.similarity(e,i)})),a=new v((i,c)=>c.score-i.score),h=new v((i,c)=>i.score-c.score);for(let i of r)a.push(i),h.push(i);for(;a.size()>0;){let i=a.pop();if(h.size()>=n&&i.score<h.peek().score)break;let c=this.nodes.get(i.id);if(!c)continue;let u=c.neighbors.get(s)??[];for(let m of u){if(o.has(m)||(o.add(m),!this.nodes.has(m)))continue;let g=this.similarity(e,m),y=h.size()>=n?h.peek().score:-1/0;if(h.size()<n||g>y){let L={id:m,score:g};a.push(L),h.push(L),h.size()>n&&h.pop()}}}let d=[];for(;h.size()>0;)d.push(h.pop());return d.reverse(),d}selectNeighbors(e,t,s){return t.sort((n,o)=>o.score-n.score).slice(0,s).map(n=>n.id)}getMaxConnections(e){return e===0?this.Mmax0:this.M}add(e,t){this.nodes.has(e)&&this.remove(e);let s=this.randomLevel(),n={id:e,embedding:t,neighbors:new Map};for(let r=0;r<=s;r++)n.neighbors.set(r,[]);if(this.nodes.set(e,n),this.entryPoint===null){this.entryPoint=e,this.currentMaxLevel=s;return}let o=this.entryPoint;for(let r=this.currentMaxLevel;r>s;r--)o=this.searchLayer(t,o,r);for(let r=Math.min(s,this.currentMaxLevel);r>=0;r--){let a=this.getMaxConnections(r),h=this.searchLayerBeam(t,[o],r,this.efConstruction),d=this.selectNeighbors(t,h,a);n.neighbors.set(r,[...d]);for(let i of d){let c=this.nodes.get(i);if(!c)continue;let u=c.neighbors.get(r)??[];if(u.push(e),u.length>a){let m=u.filter(g=>this.nodes.has(g)).map(g=>({id:g,score:p(c.embedding,this.nodes.get(g).embedding)}));m.sort((g,y)=>y.score-g.score),c.neighbors.set(r,m.slice(0,a).map(g=>g.id))}else c.neighbors.set(r,u)}h.length>0&&(o=h[0].id)}s>this.currentMaxLevel&&(this.entryPoint=e,this.currentMaxLevel=s)}remove(e){let t=this.nodes.get(e);if(!t)return!1;for(let[s,n]of t.neighbors.entries())for(let o of n){let r=this.nodes.get(o);if(!r)continue;let a=r.neighbors.get(s);if(!a)continue;let h=a.indexOf(e);h!==-1&&a.splice(h,1);let d=this.getMaxConnections(s);if(a.length<d){for(let i of n)if(i!==o&&i!==e&&this.nodes.has(i)&&!a.includes(i)){a.push(i);let c=this.nodes.get(i);if(c){let u=c.neighbors.get(s)??[];!u.includes(o)&&u.length<d&&(u.push(o),c.neighbors.set(s,u))}if(a.length>=d)break}}r.neighbors.set(s,a)}if(this.nodes.delete(e),this.entryPoint===e)if(this.nodes.size===0)this.entryPoint=null,this.currentMaxLevel=-1;else{let s=null,n=-1;for(let[o,r]of this.nodes.entries()){let a=-1;for(let h of r.neighbors.keys())h>a&&(a=h);a>n&&(n=a,s=o)}this.entryPoint=s,this.currentMaxLevel=n}return!0}search(e,t){if(this.nodes.size===0||this.entryPoint===null)return[];if(this.nodes.size===1){let r=this.nodes.get(this.entryPoint);return[{id:r.id,score:p(e,r.embedding)}]}let s=this.entryPoint;for(let r=this.currentMaxLevel;r>0;r--)s=this.searchLayer(e,s,r);let n=Math.max(this.efSearch,t);return this.searchLayerBeam(e,[s],0,n).slice(0,t)}size(){return this.nodes.size}clear(){this.nodes.clear(),this.entryPoint=null,this.currentMaxLevel=-1}};A=class{ids=[];vectors=[];norms=[];idToIndex=new Map;initialized=!1;constructor(){if(w&&!this.initialized)try{w(),this.initialized=!0}catch{this.initialized=f!==null}}add(e,t){let s=new Float32Array(t),n=x(s);if(this.idToIndex.has(e)){let r=this.idToIndex.get(e);this.vectors[r]=s,this.norms[r]=n;return}let o=this.ids.length;this.ids.push(e),this.vectors.push(s),this.norms.push(n),this.idToIndex.set(e,o)}search(e,t){if(this.ids.length===0)return[];let s=Math.min(t,this.ids.length),n=this.vectors.length>0?this.vectors[0].length:0,o=e.length,r=n===o;if(f&&this.vectors.length>0&&r){let i=new Float32Array(e),c=x(i);return f(i,this.vectors,s,1).indices.map(m=>({id:this.ids[m],score:C(i,this.vectors[m],c,this.norms[m])}))}let a=new Float32Array(e),h=x(a),d=[];for(let i=0;i<this.ids.length;i++){let c=this.vectors[i];if(c.length!==a.length){i===0&&console.warn(`[RuvectorFlatIndex] Dimension mismatch: query=${a.length}, stored=${c.length}. Skipping ${this.ids.length} mismatched vectors. Re-index with correct dimensions.`);continue}else d.push({id:this.ids[i],score:C(a,c,h,this.norms[i])})}return d.sort((i,c)=>c.score-i.score),d.slice(0,s)}remove(e){let t=this.idToIndex.get(e);if(t===void 0)return!1;let s=this.ids.length-1;if(t!==s){let n=this.ids[s];this.ids[t]=n,this.vectors[t]=this.vectors[s],this.norms[t]=this.norms[s],this.idToIndex.set(n,t)}return this.ids.pop(),this.vectors.pop(),this.norms.pop(),this.idToIndex.delete(e),!0}clear(){this.ids=[],this.vectors=[],this.norms=[],this.idToIndex.clear()}size(){return this.ids.length}},M=class{adapter;constructor(e,t){this.adapter=T.create(e,t)}add(e,t){this.adapter.addByStringId(e,t)}search(e,t){return this.adapter.searchByArray(e,t)}remove(e){return this.adapter.removeByStringId(e)}clear(){this.adapter.clear()}size(){return this.adapter.size()}recall(){return this.adapter.recall()}getProvider(){return this.adapter}}});export{v as a,I as b,A as c,M as d,U as e,D as f};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
2
|
var N="ffffffff-ffff-ffff-ffff-ffffffffffff";var _="00000000-0000-0000-0000-000000000000";var y=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function k(r){return typeof r=="string"&&y.test(r)}var u=k;function q(r){if(!u(r))throw TypeError("Invalid UUID");let n;return Uint8Array.of((n=parseInt(r.slice(0,8),16))>>>24,n>>>16&255,n>>>8&255,n&255,(n=parseInt(r.slice(9,13),16))>>>8,n&255,(n=parseInt(r.slice(14,18),16))>>>8,n&255,(n=parseInt(r.slice(19,23),16))>>>8,n&255,(n=parseInt(r.slice(24,36),16))/1099511627776&255,n/4294967296&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255)}var c=q;var x=[];for(let r=0;r<256;++r)x.push((r+256).toString(16).slice(1));function l(r,n=0){return(x[r[n+0]]+x[r[n+1]]+x[r[n+2]]+x[r[n+3]]+"-"+x[r[n+4]]+x[r[n+5]]+"-"+x[r[n+6]]+x[r[n+7]]+"-"+x[r[n+8]]+x[r[n+9]]+"-"+x[r[n+10]]+x[r[n+11]]+x[r[n+12]]+x[r[n+13]]+x[r[n+14]]+x[r[n+15]]).toLowerCase()}function C(r,n=0){let f=l(r,n);if(!u(f))throw TypeError("Stringified UUID is invalid");return f}var H=C;var v=new Uint8Array(16);function m(){return crypto.getRandomValues(v)}var g={};function X(r,n,f){let e,o=r?._v6??!1;if(r){let t=Object.keys(r);t.length===1&&t[0]==="_v6"&&(r=void 0)}if(r)e=E(r.random??r.rng?.()??m(),r.msecs,r.nsecs,r.clockseq,r.node,n,f);else{let t=Date.now(),i=m();j(g,t,i),e=E(i,g.msecs,g.nsecs,o?void 0:g.clockseq,o?void 0:g.node,n,f)}return n??l(e)}function j(r,n,f){return r.msecs??=-1/0,r.nsecs??=0,n===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):n>r.msecs?r.nsecs=0:n<r.msecs&&(r.node=void 0),r.node||(r.node=f.slice(10,16),r.node[0]|=1,r.clockseq=(f[8]<<8|f[9])&16383),r.msecs=n,r}function E(r,n,f,e,o,t,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!t)t=new Uint8Array(16),i=0;else if(i<0||i+16>t.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);n??=Date.now(),f??=0,e??=(r[8]<<8|r[9])&16383,o??=r.slice(10,16),n+=122192928e5;let d=((n&268435455)*1e4+f)%4294967296;t[i++]=d>>>24&255,t[i++]=d>>>16&255,t[i++]=d>>>8&255,t[i++]=d&255;let a=n/4294967296*1e4&268435455;t[i++]=a>>>8&255,t[i++]=a&255,t[i++]=a>>>24&15|16,t[i++]=a>>>16&255,t[i++]=e>>>8|128,t[i++]=e&255;for(let p=0;p<6;++p)t[i++]=o[p];return t}var D=X;function U(r){let n=typeof r=="string"?c(r):r,f=G(n);return typeof r=="string"?l(f):f}function G(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}import{createHash as K}from"node:crypto";function M(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),K("md5").update(r).digest()}var T=M;function O(r){r=unescape(encodeURIComponent(r));let n=new Uint8Array(r.length);for(let f=0;f<r.length;++f)n[f]=r.charCodeAt(f);return n}var w="6ba7b810-9dad-11d1-80b4-00c04fd430c8",I="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function h(r,n,f,e,o,t){let i=typeof f=="string"?O(f):f,d=typeof e=="string"?c(e):e;if(typeof e=="string"&&(e=c(e)),e?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let a=new Uint8Array(16+i.length);if(a.set(d),a.set(i,d.length),a=n(a),a[6]=a[6]&15|r,a[8]=a[8]&63|128,o){if(t??=0,t<0||t+16>o.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let p=0;p<16;++p)o[t+p]=a[p];return o}return l(a)}function S(r,n,f,e){return h(48,T,r,n,f,e)}S.DNS=w;S.URL=I;var z=S;function F(r,n,f){return!n&&!r&&crypto.randomUUID?crypto.randomUUID():J(r,n,f)}function J(r,n,f){r=r||{};let e=r.random??r.rng?.()??m();if(e.length<16)throw new Error("Random bytes length must be >= 16");if(e[6]=e[6]&15|64,e[8]=e[8]&63|128,n){if(f=f||0,f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;++o)n[f+o]=e[o];return n}return l(e)}var P=F;import{createHash as Q}from"node:crypto";function W(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),Q("sha1").update(r).digest()}var V=W;function R(r,n,f,e){return h(80,V,r,n,f,e)}R.DNS=w;R.URL=I;var Y=R;function Z(r,n,f){r??={},f??=0;let e=D({...r,_v6:!0},new Uint8Array(16));if(e=U(e),n){if(f<0||f+16>n.length)throw new RangeError(`UUID byte range ${f}:${f+15} is out of buffer bounds`);for(let o=0;o<16;o++)n[f+o]=e[o];return n}return l(e)}var s=Z;function $(r){let n=typeof r=="string"?c(r):r,f=b(n);return typeof r=="string"?l(f):f}function b(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}var A={};function B(r,n,f){let e;if(r)e=L(r.random??r.rng?.()??m(),r.msecs,r.seq,n,f);else{let o=Date.now(),t=m();r0(A,o,t),e=L(t,A.msecs,A.seq,n,f)}return n??l(e)}function r0(r,n,f){return r.msecs??=-1/0,r.seq??=0,n>r.msecs?(r.seq=f[6]<<23|f[7]<<16|f[8]<<8|f[9],r.msecs=n):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}function L(r,n,f,e,o=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!e)e=new Uint8Array(16),o=0;else if(o<0||o+16>e.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);return n??=Date.now(),f??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],e[o++]=n/1099511627776&255,e[o++]=n/4294967296&255,e[o++]=n/16777216&255,e[o++]=n/65536&255,e[o++]=n/256&255,e[o++]=n&255,e[o++]=112|f>>>28&15,e[o++]=f>>>20&255,e[o++]=128|f>>>14&63,e[o++]=f>>>6&255,e[o++]=f<<2&255|r[10]&3,e[o++]=r[11],e[o++]=r[12],e[o++]=r[13],e[o++]=r[14],e[o++]=r[15],e}var n0=B;function f0(r){if(!u(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}var e0=f0;export{N as a,_ as b,u as c,c as d,H as e,D as f,U as g,z as h,P as i,Y as j,s as k,$ as l,n0 as m,e0 as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as e,b as g,e as r}from"./chunk-PIINM2PD.js";import{c as o}from"./chunk-JJY6K3OI.js";var L=o(()=>{"use strict";e();g();r()});export{L as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as n}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as n}from"./chunk-MCONVCB6.js";import{a as o}from"./chunk-JEGTTVTL.js";import{a,e as c}from"./chunk-AGMHJ3GS.js";c();var M=a.CLEANUP_INTERVAL_MS,y=".agentic-qe/memory.db";async function d(r,t=!0){let e;switch(r.type){case"memory":e=new o;break;case"sqlite":e=new n({sqlite:r.sqlite,enableFallback:!0});break;case"agentdb":e=new n({sqlite:{path:r.agentdb?.path??y},enableFallback:!0});break;case"hybrid":e=new n(r.hybrid);break;default:throw new Error(`Unknown memory backend type: ${r.type}`)}return t&&await e.initialize(),{backend:e,type:r.type,initialized:t}}async function u(r=!0){let t=process.env.AQE_MEMORY_BACKEND??"memory",e=process.env.AQE_MEMORY_PATH??".agentic-qe",i={type:t,sqlite:{path:`${e}/memory.db`,walMode:!0},agentdb:{path:`${e}/memory.db`},hybrid:{enableFallback:!0,sqlite:{path:`${e}/memory.db`}}};return d(i,r)}export{d as a,u as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{d as m}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{d as m}from"./chunk-2NRCDJBB.js";import{d as T}from"./chunk-HCAWQ7ZD.js";T();function p(t,r,o){let e=0,n=t.length;for(;e<n;){let i=e+n>>>1;o(t[i],r)<=0?e=i+1:n=i}return e}function a(t,r,o){let e=p(t,r,o);return t.splice(e,0,r),e}function s(){return(t,r)=>t.createdAt.getTime()-r.createdAt.getTime()}m();export{a,s as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
2
|
var s=["qe-pentest-validator","qe-security-auditor","qe-security-scanner","qe-security-reviewer"],c="anthropic/claude-sonnet-4.6",u="claude-sonnet-4-6";function o(n){return n.includes("claude-opus-4-7")||n.includes("claude-opus-4.7")}function i(n,e=process.env){return e.AQE_CYBER_VERIFIED==="true"?!1:s.includes(n)}function a(n,e,r,t=process.env){return!i(n,t)||!o(e)?e:r}export{c as a,u as b,o as c,i as d,a as e};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{h as s,k as o,o 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.9.33");process.exit(0)}
|
|
2
|
+
import{h as s,k as o,o as p}from"./chunk-46LV5MI3.js";import{a as m}from"./chunk-LVCQ4LSA.js";import{c as r}from"./chunk-PIINM2PD.js";import{a,e as u}from"./chunk-AGMHJ3GS.js";p();u();m();var l=r.create("hybrid-backend"),c=class{unifiedMemory=null;config;cleanupInterval;cleanupCount=0;initialized=!1;constructor(e){this.config={sqlite:{path:e?.sqlite?.path??".agentic-qe/memory.db",walMode:e?.sqlite?.walMode??!0,poolSize:e?.sqlite?.poolSize??5,busyTimeout:e?.sqlite?.busyTimeout??a.BUSY_TIMEOUT_MS,...e?.sqlite},agentdb:{path:e?.agentdb?.path??".agentic-qe/memory.db",...e?.agentdb},enableFallback:e?.enableFallback??!0,defaultNamespace:e?.defaultNamespace??"default",cleanupInterval:e?.cleanupInterval??a.CLEANUP_INTERVAL_MS}}async initialize(){if(this.initialized)return;let e={dbPath:this.config.sqlite.path??s.dbPath,walMode:this.config.sqlite.walMode??!0,busyTimeout:this.config.sqlite.busyTimeout??a.BUSY_TIMEOUT_MS};this.unifiedMemory=o(e),await this.unifiedMemory.initialize(),this.cleanupInterval=setInterval(()=>this.cleanup(),this.config.cleanupInterval),this.cleanupInterval.unref&&this.cleanupInterval.unref(),this.initialized=!0,console.log(`[HybridBackend] Initialized with unified memory: ${this.unifiedMemory.getDbPath()}`)}async dispose(){this.cleanupInterval&&clearInterval(this.cleanupInterval),this.initialized=!1}async set(e,i,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;await this.unifiedMemory.kvSet(e,i,n,t?.ttl)}async get(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvGet(e,t)}async delete(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace,n=await this.unifiedMemory.kvDelete(e,t),d=await this.unifiedMemory.vectorDelete(e);return n||d}async has(e,i){this.ensureInitialized();let t=i?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvExists(e,t)}async search(e,i=100,t){this.ensureInitialized();let n=t?.namespace??this.config.defaultNamespace;return this.unifiedMemory.kvSearch(e,n,i)}async vectorSearch(e,i){return this.ensureInitialized(),(await this.unifiedMemory.vectorSearch(e,i)).map(n=>({key:n.id,score:n.score,metadata:n.metadata}))}async storeVector(e,i,t){this.ensureInitialized(),await this.unifiedMemory.vectorStore(e,i,this.config.defaultNamespace,t)}getHealth(){return{sqlite:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",sqlitePersistent:!0,agentdb:this.unifiedMemory?.isInitialized()?"healthy":"unavailable",fallback:"inactive"}}isPersistent(){return this.unifiedMemory?.isInitialized()??!1}getConfig(){return{...this.config}}async setWithBackend(e,i,t,n){await this.set(e,i,n)}async getVectorStats(){if(!this.unifiedMemory?.isInitialized())return null;let e=await this.unifiedMemory.vectorCount(),i=this.unifiedMemory.getStats();return{vectorCount:e,indexSize:i.vectorIndexSize}}getUnifiedMemory(){return this.unifiedMemory}async count(e){return this.ensureInitialized(),this.unifiedMemory.getDatabase().prepare(`
|
|
3
3
|
SELECT COUNT(*) as count FROM kv_store
|
|
4
4
|
WHERE namespace LIKE ?
|
|
5
5
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
@@ -12,4 +12,4 @@ import{h as s,k as o,o as m}from"./chunk-7MXQV7RB.js";import{a as u}from"./chunk
|
|
|
12
12
|
DELETE FROM kv_store WHERE rowid NOT IN (
|
|
13
13
|
SELECT rowid FROM kv_store ORDER BY rowid DESC LIMIT 5000
|
|
14
14
|
)
|
|
15
|
-
`).run();t.changes>0&&console.log(`[HybridBackend] kv_store retention: pruned ${t.changes} rows (kept 5000)`)}}catch(i){l.debug("KV store retention pruning failed",{error:i instanceof Error?i.message:String(i)})}}catch(e){console.warn("[HybridBackend] Cleanup failed:",e)}}};export{
|
|
15
|
+
`).run();t.changes>0&&console.log(`[HybridBackend] kv_store retention: pruned ${t.changes} rows (kept 5000)`)}}catch(i){l.debug("KV store retention pruning failed",{error:i instanceof Error?i.message:String(i)})}}catch(e){console.warn("[HybridBackend] Cleanup failed:",e)}}};export{c as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
2
|
var h={0:"sqlite-only",1:"hybrid",2:"dual-write-sqlite-primary",3:"dual-write-rvf-primary",4:"rvf-primary"},g=class{config;db=null;rvfStore=null;totalWrites=0;totalReads=0;rvfWriteFailures=0;rvfReadFailures=0;fallbacksUsed=0;sqliteLatencies=[];rvfLatencies=[];sqliteWriteLatencies=[];rvfWriteLatencies=[];constructor(e){this.config={rvfPath:".agentic-qe/patterns.rvf",dimensions:384,enableFallback:!0,...e}}setSqliteDb(e){this.db=e}setRvfStore(e){this.rvfStore=e}get stage(){return this.config.stage}setStage(e){this.config={...this.config,stage:e}}write(e,t){this.totalWrites++;let s={sqliteSuccess:!1,rvfSuccess:!1,stage:this.config.stage,fallbackUsed:!1},n=this.config.stage<4,o=this.config.stage>=2;if(n&&this.db){let i=performance.now();try{let r=Buffer.from(t instanceof Float32Array?t.buffer:new Float32Array(t).buffer);this.db.prepare(`
|
|
3
3
|
INSERT INTO qe_pattern_embeddings (pattern_id, embedding, dimension, model, created_at)
|
|
4
4
|
VALUES (?, ?, ?, 'all-MiniLM-L6-v2', datetime('now'))
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as D}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as D}from"./chunk-5RILQ3EG.js";import{c as x}from"./chunk-GJKTHVFE.js";import{a as _}from"./chunk-NCTSH4T6.js";import{k as w,o as I}from"./chunk-46LV5MI3.js";import{b as f,d as U}from"./chunk-AL54ARD4.js";import{a as g,c as q}from"./chunk-Q5JL7NZG.js";import{a as v}from"./chunk-JJY6K3OI.js";import{randomUUID as Q}from"crypto";I();U();q();var F={alpha:.1,minOutcomes:10,weightFloor:.2,weightCeiling:2},p=class{records=new Map;config;constructor(e){this.config={...F,...e}}recordOutcome(e,t,o){let{alpha:i,minOutcomes:r,weightFloor:s,weightCeiling:n}=this.config,c=this.records.get(e),d=t?1:0,a=Math.max(0,Math.min(1,o)),l,u;c?(l=i*d+(1-i)*c.emaAccuracy,u=i*a+(1-i)*c.emaQuality):(l=d,u=a);let h=(c?.totalOutcomes??0)+1,R;h>=r?R=Math.max(s,Math.min(n,l*2)):R=1;let k={agentId:e,emaAccuracy:l,emaQuality:u,calibratedWeight:R,totalOutcomes:h,lastUpdated:new Date};return this.records.set(e,k),k}getCalibration(e){return this.records.get(e)??null}getCalibratedWeight(e){let t=this.records.get(e);return!t||t.totalOutcomes<this.config.minOutcomes?1:t.calibratedWeight}getAllCalibrations(){return Array.from(this.records.values())}reset(e){e!==void 0?this.records.delete(e):this.records.clear()}serialize(){let e={};for(let[t,o]of this.records)e[t]={...o};return e}deserialize(e){this.records.clear();for(let[t,o]of Object.entries(e))this.records.set(t,{...o,lastUpdated:new Date(o.lastUpdated)})}};var P={escalateAfterFailures:2,deEscalateAfterSuccesses:5,maxTier:"opus",minTier:"haiku"},A=["booster","haiku","sonnet","opus"];function y(m){return A.indexOf(m)}var b=class{config;states=new Map;constructor(e){this.config={...P,...e}}recordOutcome(e,t,o){let i=this.states.get(e);i||(i={agentId:e,currentTier:o,baseTier:o,consecutiveFailures:0,consecutiveSuccesses:0,escalationCount:0,deEscalationCount:0,lastAction:"none",lastActionTimestamp:new Date},this.states.set(e,i));let r=i.currentTier;if(t){if(i.consecutiveSuccesses++,i.consecutiveFailures=0,i.consecutiveSuccesses>=this.config.deEscalateAfterSuccesses){let s=y(i.currentTier),n=y(this.config.minTier);if(s>n)return i.currentTier=A[s-1],i.deEscalationCount++,i.consecutiveSuccesses=0,i.lastAction="de-escalate",i.lastActionTimestamp=new Date,{action:"de-escalate",previousTier:r,newTier:i.currentTier}}}else if(i.consecutiveFailures++,i.consecutiveSuccesses=0,i.consecutiveFailures>=this.config.escalateAfterFailures){let s=y(i.currentTier),n=y(this.config.maxTier);if(s<n)return i.currentTier=A[s+1],i.escalationCount++,i.consecutiveFailures=0,i.lastAction="escalate",i.lastActionTimestamp=new Date,{action:"escalate",previousTier:r,newTier:i.currentTier}}return{action:"none",previousTier:r,newTier:i.currentTier}}getCurrentTier(e){return this.states.get(e)?.currentTier??null}getState(e){return this.states.get(e)??null}getAllStates(){return Array.from(this.states.values())}reset(e){e?this.states.delete(e):this.states.clear()}};var T={booster:{avgInputTokens:0,avgOutputTokens:0,costPerTask:0},haiku:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.0035},sonnet:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.021},opus:{avgInputTokens:2e3,avgOutputTokens:1e3,costPerTask:.105}},S=["booster","haiku","sonnet","opus"],E=T.opus.costPerTask,N={qualityWeight:.6,costWeight:.4,budgetPerHourUsd:0,budgetPerDayUsd:0,minQualityThreshold:.5,enabled:!0},L=.15,C=class{config;costTracker;tierQualityEstimates=new Map;tierOutcomeCounts=new Map;constructor(e,t){let o={...N,...t};o.qualityWeight=Math.max(0,Math.min(1,o.qualityWeight)),o.costWeight=Math.max(0,Math.min(1,o.costWeight)),o.minQualityThreshold=Math.max(0,Math.min(1,o.minQualityThreshold)),o.budgetPerHourUsd=Math.max(0,o.budgetPerHourUsd),o.budgetPerDayUsd=Math.max(0,o.budgetPerDayUsd);let i=o.qualityWeight+o.costWeight;i>0&&i!==1&&(o.qualityWeight/=i,o.costWeight/=i),this.config=o,this.costTracker=e,this.tierQualityEstimates.set("booster",.3),this.tierQualityEstimates.set("haiku",.55),this.tierQualityEstimates.set("sonnet",.75),this.tierQualityEstimates.set("opus",.9)}scoreTiers(e){let t=S.map(o=>{let i=this.getQualityEstimate(o,e),r=T[o].costPerTask,s=r>0?i/r:i>0?1/0:0,n=E>0?1-r/E:1,c=this.config.qualityWeight*i+this.config.costWeight*n;return{tier:o,qualityScore:i,estimatedCostUsd:r,qualityPerDollar:s,economicScore:c}});return t.sort((o,i)=>i.economicScore-o.economicScore),t}selectTier(e){let t=this.scoreTiers(e);for(let r of t)if(!(r.qualityScore<this.config.minQualityThreshold)&&!this.wouldExceedBudget(r.tier))return{tier:r.tier,reason:`Best economic score (${r.economicScore.toFixed(3)}): quality=${r.qualityScore.toFixed(2)}, cost=$${r.estimatedCostUsd.toFixed(4)}`,scores:t};let o=t.filter(r=>r.qualityScore>=this.config.minQualityThreshold);if(o.length>0){let r=[...o].sort((s,n)=>s.estimatedCostUsd-n.estimatedCostUsd)[0];return{tier:r.tier,reason:`Budget constrained fallback to ${r.tier}`,scores:t}}let i=[...t].sort((r,s)=>s.qualityScore-r.qualityScore)[0];return{tier:i.tier,reason:`No tier meets quality threshold ${this.config.minQualityThreshold}; using best quality: ${i.tier}`,scores:t}}wouldExceedBudget(e){let t=T[e].costPerTask;if(t===0)return!1;let o=this.costTracker.getCurrentCost("hour"),i=this.costTracker.getCurrentCost("day");return this.config.budgetPerHourUsd>0&&o+t>this.config.budgetPerHourUsd||this.config.budgetPerDayUsd>0&&i+t>this.config.budgetPerDayUsd}updateFromOutcome(e,t){let o=e.outcome.qualityScore,i=this.tierQualityEstimates.get(t)??.5,r=this.tierOutcomeCounts.get(t)??0,s=r<5?.4:L,n=i*(1-s)+o*s;this.tierQualityEstimates.set(t,n),this.tierOutcomeCounts.set(t,r+1)}getEconomicReport(){let e=this.scoreTiers(.5),t=this.costTracker.getCurrentCost("hour"),o=this.costTracker.getCurrentCost("day"),i={hourly:this.config.budgetPerHourUsd>0?Math.max(0,this.config.budgetPerHourUsd-t):null,daily:this.config.budgetPerDayUsd>0?Math.max(0,this.config.budgetPerDayUsd-o):null},r=null,s=[...e].sort((a,l)=>l.qualityPerDollar-a.qualityPerDollar),n=s.find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar)),c=[...s].reverse().find(a=>a.estimatedCostUsd>0&&isFinite(a.qualityPerDollar));if(n&&c&&n.tier!==c.tier){let a=c.estimatedCostUsd-n.estimatedCostUsd;a>0&&(r={usd:a,description:`Switch from ${c.tier} ($${c.estimatedCostUsd.toFixed(4)}/task) to ${n.tier} ($${n.estimatedCostUsd.toFixed(4)}/task) for comparable tasks to save ~$${a.toFixed(4)}/task`})}let d=this.generateRecommendation(e,i);return{tierEfficiency:e,currentHourlyCostUsd:t,currentDailyCostUsd:o,budgetRemaining:i,recommendation:d,savingsOpportunity:r}}computeCostAdjustedReward(e,t,o){let i=T[t].costPerTask;if(E===0)return e;let r=i/E,s=Math.max(0,o-this.config.minQualityThreshold),n=r*(1-s),c=e-n*this.config.costWeight;return Math.max(-1,Math.min(1,c))}serializeEstimates(){let e={};for(let t of S)e[t]={quality:this.tierQualityEstimates.get(t)??.5,count:this.tierOutcomeCounts.get(t)??0};return e}deserializeEstimates(e){for(let t of S)e[t]&&(this.tierQualityEstimates.set(t,e[t].quality),this.tierOutcomeCounts.set(t,e[t].count))}getConfig(){return{...this.config}}getQualityEstimate(e,t){let o=this.tierQualityEstimates.get(e)??.5,i=e==="booster"?t*.4:e==="haiku"?t*.2:0;return Math.max(0,Math.min(1,o-i))}generateRecommendation(e,t){if(t.hourly!==null&&t.hourly<.01)return"Hourly budget nearly exhausted. Consider increasing budget or routing to cheaper tiers.";if(t.daily!==null&&t.daily<.1)return"Daily budget nearly exhausted. Only critical tasks should use expensive tiers.";let o=e[0];return o?`Most cost-efficient tier: ${o.tier} (score=${o.economicScore.toFixed(3)}, quality=${o.qualityScore.toFixed(2)})`:"No economic data available yet."}};var O=class{outcomes=[];maxOutcomes;constructor(e=1e4){this.maxOutcomes=e}add(e){this.outcomes.push(e),this.outcomes.length>this.maxOutcomes&&(this.outcomes=this.outcomes.slice(-this.maxOutcomes))}getByAgent(e,t=100){return this.outcomes.filter(o=>o.usedAgent===e).slice(-t)}getAll(e=1e3){return this.outcomes.slice(-e)}getRecentOverrides(e=50){return this.outcomes.filter(t=>!t.followedRecommendation).slice(-e)}clear(){this.outcomes=[]}get size(){return this.outcomes.length}},M=class m{static schemaMigrated=!1;outcomeStore;router=null;db=null;calibrator=null;escalationTracker=null;economicModel=null;economicPersistCounter=0;static ECONOMIC_PERSIST_INTERVAL=10;persistCount=0;maxOutcomes;static RETENTION_CLEANUP_INTERVAL=100;constructor(e=1e4,t){this.maxOutcomes=e,this.outcomeStore=new O(e),t?.enableEMACalibration&&this.enableCalibration(),t?.enableAutoEscalation&&this.enableAutoEscalation()}async initialize(){try{this.db=w(),this.db.isInitialized()||await this.db.initialize(),await this.loadFromDb(),this.loadCalibratorState()}catch(e){console.warn("[RoutingFeedbackCollector] DB init failed, using memory-only:",g(e)),this.db=null}}async loadFromDb(){if(!this.db)return;let t=this.db.getDatabase().prepare(`
|
|
3
3
|
SELECT * FROM routing_outcomes ORDER BY created_at DESC LIMIT ?
|
|
4
4
|
`).all(this.maxOutcomes);for(let o of t.reverse()){let i={id:o.id,task:f(o.task_json),decision:f(o.decision_json),usedAgent:o.used_agent,followedRecommendation:!!o.followed_recommendation,outcome:{success:!!o.success,qualityScore:o.quality_score,durationMs:o.duration_ms,error:o.error||void 0},timestamp:new Date(o.created_at),advisorConsultation:o.advisor_consultation_json?f(o.advisor_consultation_json):void 0};this.outcomeStore.add(i)}t.length>0&&console.log(`[RoutingFeedbackCollector] Loaded ${t.length} outcomes from DB`)}persistOutcome(e){if(this.db)try{let t=this.db.getDatabase();if(!m.schemaMigrated){for(let r of["ALTER TABLE routing_outcomes ADD COLUMN model_tier TEXT","ALTER TABLE routing_outcomes ADD COLUMN advisor_consultation_json TEXT"])try{t.prepare(r).run()}catch{}D(t),m.schemaMigrated=!0}let o=this.inferTier(e.usedAgent),i=e.advisorConsultation?JSON.stringify(e.advisorConsultation):null;t.prepare(`
|
|
5
5
|
INSERT OR REPLACE INTO routing_outcomes (
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{b as c,d as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{b as c,d as p}from"./chunk-AL54ARD4.js";import{a as f}from"./chunk-JJY6K3OI.js";p();import{existsSync as l,readFileSync as i}from"node:fs";import{join as a}from"node:path";import{execSync as m}from"node:child_process";var s=null,d=0,g=6e4;function S(){s=null,d=0}function b(e){if(s&&Date.now()-d<g)return s;let n=w(e);return s=n,d=Date.now(),n}function w(e){let n=h(e);if(n)return n;let r=v(e);if(r)return r;let t=k(e);return t||{available:!1}}function h(e){let n=a(e,".mcp.json");if(l(n))try{let o=c(i(n,"utf-8"));if(o.mcpServers?.ruflo||o.mcpServers?.["claude-flow"])return{available:!0,method:"mcp-config"}}catch{}let r=a(e,".claude","mcp.json");if(l(r))try{let o=c(i(r,"utf-8"));if(o.mcpServers?.ruflo||o.mcpServers?.["claude-flow"])return{available:!0,method:"mcp-config"}}catch{}let t=a(e,".claude","settings.json");if(l(t))try{let o=c(i(t,"utf-8")),u=o.mcpServers||o.mcp?.servers||{};if(u.ruflo||u["claude-flow"]||u["@anthropic/claude-flow"])return{available:!0,method:"mcp-config"}}catch{}return null}function v(e){let n=a(e,"package.json");if(!l(n))return null;try{let r=c(i(n,"utf-8")),t={...r.dependencies,...r.devDependencies};if(t.ruflo||t["@claude-flow/cli"]||t["claude-flow"])return{available:!0,method:"npm-dependency"}}catch{}return null}function k(e){for(let n of["ruflo","@claude-flow/cli"])try{return{available:!0,method:"npx-cached",version:m(`npx --no-install ${n} --version`,{encoding:"utf-8",timeout:5e3,cwd:e,stdio:["pipe","pipe","pipe"]}).trim().match(/\d+\.\d+\.\d+[\w.-]*/)?.[0]}}catch{}return null}function x(){for(let e of["ruflo","@claude-flow/cli"])try{return f.resolve(`${e}/package.json`),e}catch{}return"ruflo"}function P(){return[" Claude Flow not found \u2014 running in standalone mode.",""," Claude Flow adds optional features:"," - SONA trajectory tracking (reinforcement learning)"," - 3-tier model routing (haiku / sonnet / opus)"," - Codebase pretrain analysis",""," To install later:"," npm install -g ruflo"," claude mcp add ruflo -- npx -y ruflo@3.5.18"," aqe init --auto --with-claude-flow"].join(`
|
|
3
3
|
`)}export{S as a,b,x as c,P as d};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as v}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
|
+
import{a as v}from"./chunk-LVCQ4LSA.js";import{c as l}from"./chunk-PIINM2PD.js";import{S as R,b as g}from"./chunk-VJHKNSOC.js";v();R();import{createHash as m,randomUUID as f}from"crypto";var a=l.create("witness-chain"),p=class{logLikelihoodRatio=0;upperBound;lowerBound;observations=0;constructor(t=.05,e=.05){this.upperBound=Math.log(1/t),this.lowerBound=Math.log(e)}addWeightedEvidence(t,e){return this.logLikelihoodRatio+=t?e:-e,this.observations++,this.logLikelihoodRatio>=this.upperBound?"PASS":this.logLikelihoodRatio<=this.lowerBound?"FAIL":"INCONCLUSIVE"}addEvidence(t){return this.addWeightedEvidence(t,.5)}getRatio(){return this.logLikelihoodRatio}getObservations(){return this.observations}getBounds(){return{upper:this.upperBound,lower:this.lowerBound}}reset(){this.logLikelihoodRatio=0,this.observations=0}},c="0".repeat(64),h=class{receipts=[];lastHash=c;sprtAccumulators=new Map;appendWitness(t){let e=f(),i=Date.now(),s=this.receipts.length,n=this.lastHash+JSON.stringify(t)+i,o=m("sha256").update(n).digest("hex"),u={id:e,timestamp:i,previousHash:this.lastHash,hash:o,decision:t,chainIndex:s};return this.receipts.push(u),this.lastHash=o,this.updateSPRT(t),a.debug("Witness appended",{chainIndex:s,type:t.type,decision:t.decision,hash:o.slice(0,16)+"..."}),u}verifyChain(){if(this.receipts.length===0)return{valid:!0,length:0,brokenAt:-1,message:"Chain is empty (valid)",lastHash:c};let t=c;for(let e=0;e<this.receipts.length;e++){let i=this.receipts[e];if(i.previousHash!==t)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: previousHash mismatch`,lastHash:this.lastHash};let s=i.previousHash+JSON.stringify(i.decision)+i.timestamp,n=m("sha256").update(s).digest("hex");if(i.hash!==n)return{valid:!1,length:this.receipts.length,brokenAt:e,message:`Chain broken at index ${e}: hash mismatch (tamper detected)`,lastHash:this.lastHash};t=i.hash}return{valid:!0,length:this.receipts.length,brokenAt:-1,message:`Chain valid (${this.receipts.length} receipts)`,lastHash:this.lastHash}}getChain(t){return t!==void 0&&t>0?[...this.receipts.slice(-t)]:[...this.receipts]}getChainLength(){return this.receipts.length}getLastHash(){return this.lastHash}exportChain(){let t={version:"1.0.0",exportedAt:Date.now(),length:this.receipts.length,receipts:this.receipts};return JSON.stringify(t,null,2)}importChain(t){try{let e=JSON.parse(t);if(!e||e.version!=="1.0.0"||!Array.isArray(e.receipts))return a.warn("Import failed: invalid format"),!1;let i=this.receipts,s=this.lastHash;this.receipts=e.receipts,this.lastHash=e.receipts.length>0?e.receipts[e.receipts.length-1].hash:c;let n=this.verifyChain();return n.valid?(a.info("Chain imported successfully",{length:e.receipts.length}),!0):(this.receipts=i,this.lastHash=s,a.warn("Import failed: chain integrity check failed",{message:n.message}),!1)}catch(e){return a.warn("Import failed: parse error",{error:e instanceof Error?e.message:String(e)}),!1}}getSPRT(t,e,i){return this.sprtAccumulators.has(t)||this.sprtAccumulators.set(t,new p(e,i)),this.sprtAccumulators.get(t)}getReceipt(t){return this.receipts[t]}updateSPRT(t){let e=t.decision==="PASS"||t.decision==="PERMIT";this.getSPRT(t.type).addEvidence(e)}},d=class extends h{persistence;constructor(t){super(),this.persistence=t;let e=t.loadAllReceipts();if(e.length>0){let i={version:"1.0.0",exportedAt:Date.now(),length:e.length,receipts:e};this.importChain(JSON.stringify(i))?a.info("Witness chain restored from SQLite",{receipts:e.length}):a.warn("Failed to restore witness chain from SQLite \u2014 starting fresh")}}appendWitness(t){let e=super.appendWitness(t);try{this.persistence.insertReceipt(e)}catch(i){a.warn("Failed to persist witness receipt to SQLite",{chainIndex:e.chainIndex,error:i instanceof Error?i.message:String(i)})}return e}};function C(r){r.exec(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS witness_chain_receipts (
|
|
4
4
|
id TEXT PRIMARY KEY,
|
|
5
5
|
chain_index INTEGER NOT NULL,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.33");process.exit(0)}
|
|
2
2
|
var s={"test-generation":/test|spec|describe|it\(|expect|assert|mock|stub|fixture|tdd|bdd/i,"test-execution":/run|execute|parallel|retry|flaky|timeout|worker|orchestrat/i,"coverage-analysis":/coverage|branch|line|uncovered|gap|untested|percentage|sublinear/i,"quality-assessment":/quality|gate|deploy|readiness|metric|threshold|sla|score/i,"defect-intelligence":/defect|bug|predict|root.?cause|regression|failure|incident/i,"requirements-validation":/requirement|bdd|gherkin|testabil|accept|criteri|scenario/i,"code-intelligence":/semantic|knowledge|graph|ast|symbol|reference|impact|depend/i,"security-compliance":/vuln|cve|owasp|xss|sqli|injection|csrf|auth|secret|compliance|sast|dast/i,"contract-testing":/contract|pact|openapi|swagger|graphql|schema|endpoint|api/i,"visual-accessibility":/screenshot|visual|snapshot|pixel|percy|a11y|aria|wcag|screen.?reader|accessible|contrast/i,"chaos-resilience":/chaos|resilience|fault|inject|blast|recover|latency|failure|stress|load/i,"learning-optimization":/learn|pattern|optim|neural|embedding|vector|memory|adapt|train/i};function l(e){for(let[t,a]of Object.entries(s))if(a.test(e))return t;return null}function m(e){let t=[];for(let[a,n]of Object.entries(s))n.test(e)&&t.push(a);return t}function u(e){return e}function d(e){let t=Math.min(e.usageCount/100,1);return e.confidence*.3+t*.2+e.successRate*.5}var c=3;function p(e,t,a=.4){let n=e.tier==="short-term"&&e.successfulUses>=c,r=e.successRate>=.7&&e.confidence>=.6,i=t===void 0||t<a,o;return n?r?i||(o="coherence_violation"):o="low_quality":o="insufficient_usage",{meetsUsageCriteria:n,meetsQualityCriteria:r,meetsCoherenceCriteria:i,blockReason:o}}function y(e){let t=[];if(e.id||t.push("Pattern ID is required"),e.patternType||t.push("Pattern type is required"),e.qeDomain||t.push("QE domain is required"),e.name||t.push("Pattern name is required"),e.template?.content||t.push("Template content is required"),e.confidence!==void 0&&(e.confidence<0||e.confidence>1)&&t.push("Confidence must be between 0 and 1"),e.successRate!==void 0&&(e.successRate<0||e.successRate>1)&&t.push("Success rate must be between 0 and 1"),e.template?.variables){let a=new Set;for(let n of e.template.variables)a.has(n.name)&&t.push(`Duplicate variable name: ${n.name}`),a.add(n.name),e.template.content.includes(`{{${n.name}}}`)||t.push(`Variable ${n.name} not referenced in template`)}return{valid:t.length===0,errors:t}}function f(e,t){let a=e.content;for(let n of e.variables){let r=t[n.name]??n.defaultValue;if(n.required&&r===void 0)throw new Error(`Required variable ${n.name} not provided`);if(r!==void 0){let i=`{{${n.name}}}`,o=typeof r=="object"?JSON.stringify(r):String(r);a=a.split(i).join(o)}}return a}var g=Object.keys(s);export{l as a,m as b,u as c,d,c as e,p as f,y as g,f as h,g as i};
|