agentic-qe 3.9.0 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +43 -0
- package/dist/audit/witness-chain.d.ts +1 -1
- package/dist/cli/bundle.js +8 -8
- package/dist/cli/chunks/adapter-53WBPKXU.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-PQYB7VRU.js → agent-booster-wasm-AKAOHSCX.js} +2 -2
- package/dist/cli/chunks/{agent-handler-QDAB5NQS.js → agent-handler-MTGPOUVP.js} +2 -2
- package/dist/cli/chunks/agent-memory-branch-UFPKWUFK.js +2 -0
- package/dist/cli/chunks/aqe-learning-engine-MV7NGY24.js +2 -0
- package/dist/cli/chunks/{audit-S7JUYYVP.js → audit-VBEZHNHO.js} +2 -2
- package/dist/cli/chunks/base-DZVGMQN2.js +2 -0
- package/dist/cli/chunks/better-sqlite3-IRPHIXRU.js +2 -0
- package/dist/cli/chunks/brain-handler-7EO3FFRZ.js +68 -0
- package/dist/cli/chunks/{branch-enumerator-XK4V5W7L.js → branch-enumerator-MZRGP35N.js} +2 -2
- package/dist/cli/chunks/{browser-PALA5PL3.js → browser-VSIWQE7J.js} +2 -2
- package/dist/cli/chunks/browser-workflow-3J5YNMEI.js +2 -0
- package/dist/cli/chunks/chunk-25LFUL2K.js +79 -0
- package/dist/cli/chunks/{chunk-LHJQD2VU.js → chunk-2EC5Z2J4.js} +68 -68
- package/dist/cli/chunks/{chunk-4YOMLWEK.js → chunk-2VVV73PW.js} +1 -1
- package/dist/cli/chunks/{chunk-BPWXXEH2.js → chunk-2WBCYSUN.js} +128 -128
- package/dist/cli/chunks/{chunk-X3KI6JOY.js → chunk-2Z2TFEOL.js} +2 -2
- package/dist/cli/chunks/chunk-34U7JDCN.js +2 -0
- package/dist/cli/chunks/{chunk-24FKIJNC.js → chunk-3GZKAORV.js} +2 -2
- package/dist/cli/chunks/{chunk-72WOAVK6.js → chunk-4D2ZG2QO.js} +1 -1
- package/dist/cli/chunks/{chunk-B36CDR4U.js → chunk-4DAOZQ3V.js} +2 -2
- package/dist/cli/chunks/{chunk-CL6POIX4.js → chunk-4FMHBBG5.js} +1 -1
- package/dist/cli/chunks/{chunk-BXAXGEFC.js → chunk-4FT3PND7.js} +5 -5
- package/dist/cli/chunks/{chunk-IGJPMN4I.js → chunk-4LA7IW3V.js} +1 -1
- package/dist/cli/chunks/{chunk-JRYGQO2W.js → chunk-4PKXIBX2.js} +1 -1
- package/dist/cli/chunks/{chunk-YPFOCNOE.js → chunk-4UH25U4O.js} +1 -1
- package/dist/cli/chunks/{chunk-U5RN7YQW.js → chunk-4Z27TRQF.js} +2 -2
- package/dist/cli/chunks/{chunk-YW2THB5Q.js → chunk-563PJBDM.js} +2 -2
- package/dist/cli/chunks/{chunk-BDIEMZ22.js → chunk-56IWS2KY.js} +2 -2
- package/dist/cli/chunks/chunk-5AUKULWO.js +2 -0
- package/dist/cli/chunks/{chunk-VSVXUTJN.js → chunk-5L6AU3QK.js} +2 -2
- package/dist/cli/chunks/{chunk-RTGGL7D7.js → chunk-5RL66XSH.js} +2 -2
- package/dist/cli/chunks/{chunk-YANUP2RO.js → chunk-65M7C6SH.js} +1 -1
- package/dist/cli/chunks/{chunk-ESVQ6MEB.js → chunk-6SOJVEU7.js} +2 -2
- package/dist/cli/chunks/{chunk-UFUVUO3J.js → chunk-727BDQ3K.js} +2 -2
- package/dist/cli/chunks/{chunk-TLHP5EII.js → chunk-7NOIIC7G.js} +1 -1
- package/dist/cli/chunks/{chunk-N4TL73TH.js → chunk-7SLN2JGP.js} +8 -8
- package/dist/cli/chunks/{chunk-NZ2VCPN4.js → chunk-AA33R5U4.js} +2 -2
- package/dist/cli/chunks/{chunk-Y7BHKZFJ.js → chunk-AKSJQ6B3.js} +2 -2
- package/dist/cli/chunks/{chunk-3ZOONQG6.js → chunk-BIVIPF4O.js} +1 -1
- package/dist/cli/chunks/{chunk-VOS4NQSF.js → chunk-BKCTNRC5.js} +2 -2
- package/dist/cli/chunks/{chunk-B6LLWYQ6.js → chunk-BOH22AKC.js} +2 -2
- package/dist/cli/chunks/{chunk-OI5NGQO2.js → chunk-BY47GV4T.js} +2 -2
- package/dist/cli/chunks/chunk-CCYMJKWX.js +2 -0
- package/dist/cli/chunks/chunk-CL3K5EJK.js +2 -0
- package/dist/cli/chunks/{chunk-GPQ57KA4.js → chunk-CQBSGYRA.js} +2 -2
- package/dist/cli/chunks/{chunk-MZOFWJTM.js → chunk-CQP7ZFME.js} +2 -2
- package/dist/cli/chunks/chunk-DBE34QES.js +2 -0
- package/dist/cli/chunks/chunk-DHE66JRR.js +12 -0
- package/dist/cli/chunks/{chunk-2BZFNEN2.js → chunk-DNLMZTE2.js} +1 -1
- package/dist/cli/chunks/{chunk-XLRQYLWW.js → chunk-DSE57A5N.js} +1 -1
- package/dist/cli/chunks/{chunk-SUSEVMZT.js → chunk-E25S5E2D.js} +1 -1
- package/dist/cli/chunks/{chunk-FEKY7T6Q.js → chunk-FAXVVLPL.js} +2 -2
- package/dist/cli/chunks/chunk-FRJLP7IB.js +2 -0
- package/dist/cli/chunks/{chunk-CS2KS7LP.js → chunk-FUIHWBVF.js} +1 -1
- package/dist/cli/chunks/{chunk-LNQIY6BP.js → chunk-GCMVJS5X.js} +2 -2
- package/dist/cli/chunks/{chunk-XT2V2322.js → chunk-GITD7SRQ.js} +2 -2
- package/dist/cli/chunks/{chunk-JJO7Y4H3.js → chunk-GK72GUHA.js} +3 -3
- package/dist/cli/chunks/{chunk-6EOS7KX2.js → chunk-GPLERTZU.js} +2 -2
- package/dist/cli/chunks/{chunk-2E5NQNSU.js → chunk-HW4ISY5B.js} +11 -11
- package/dist/cli/chunks/{chunk-HRO6OZQD.js → chunk-ICDXWIFZ.js} +1 -1
- package/dist/cli/chunks/{chunk-3NZLZHJI.js → chunk-J4BS6IWE.js} +1 -1
- package/dist/cli/chunks/{chunk-4VUPRTVX.js → chunk-JOVINE23.js} +2 -2
- package/dist/cli/chunks/chunk-JV7LX6OT.js +95 -0
- package/dist/cli/chunks/{chunk-6SVX4DJC.js → chunk-KBA7FBK3.js} +3 -3
- package/dist/cli/chunks/chunk-KDDZYXP4.js +2 -0
- package/dist/cli/chunks/{chunk-GAOJV3OX.js → chunk-KNVAAVHH.js} +2 -2
- package/dist/cli/chunks/{chunk-CWFB6BSA.js → chunk-KQTJ2YLI.js} +4 -4
- package/dist/cli/chunks/{chunk-FGA7VIFR.js → chunk-KTYUCZEM.js} +3 -3
- package/dist/cli/chunks/{chunk-RU5WAHB7.js → chunk-KZTO5EVM.js} +2 -2
- package/dist/cli/chunks/{chunk-IFNIIK34.js → chunk-KZUJBZ7B.js} +3 -3
- package/dist/cli/chunks/{chunk-GKNNSCLC.js → chunk-L5WZUPZF.js} +2 -2
- package/dist/cli/chunks/{chunk-MDUHYUHF.js → chunk-L5YEPSDU.js} +2 -2
- package/dist/cli/chunks/chunk-LCAA6H4J.js +2 -0
- package/dist/cli/chunks/{chunk-XRE2HCWG.js → chunk-LMMEUVE5.js} +1 -1
- package/dist/cli/chunks/{chunk-7VDBAVTY.js → chunk-MN742FIH.js} +2 -2
- package/dist/cli/chunks/chunk-MY4LMIG7.js +180 -0
- package/dist/cli/chunks/{chunk-WGMPEW2T.js → chunk-N3F3CX4V.js} +2 -2
- package/dist/cli/chunks/{chunk-YVA65UZL.js → chunk-NJY7ZA77.js} +1 -1
- package/dist/cli/chunks/{chunk-3IHG3WOY.js → chunk-NM6TIEJ3.js} +3 -3
- package/dist/cli/chunks/{chunk-KP5NUODU.js → chunk-NRCKGXJJ.js} +1 -1
- package/dist/cli/chunks/{chunk-3ADGXLTM.js → chunk-PFNFC43Q.js} +1 -1
- package/dist/cli/chunks/{chunk-4VBTXZRM.js → chunk-PJFLO37I.js} +2 -2
- package/dist/cli/chunks/{chunk-XIBDETCS.js → chunk-PNL5G6TE.js} +2 -2
- package/dist/cli/chunks/{chunk-AFLLQ5PP.js → chunk-Q4A72ZTV.js} +2 -2
- package/dist/cli/chunks/{chunk-EHDQJQ6Y.js → chunk-QEQTC4WQ.js} +5 -5
- package/dist/cli/chunks/{chunk-IAV2JMIX.js → chunk-QIH3E775.js} +2 -2
- package/dist/cli/chunks/{chunk-GRUUQAR6.js → chunk-QNBQBSAI.js} +2 -2
- package/dist/cli/chunks/{chunk-WIEC7VKK.js → chunk-QODE4LM6.js} +2 -2
- package/dist/cli/chunks/{chunk-HY6PMO5W.js → chunk-QPRVX4H2.js} +2 -2
- package/dist/cli/chunks/chunk-RC5CPXON.js +2 -0
- package/dist/cli/chunks/{chunk-TWUWL5EJ.js → chunk-RITN3XR4.js} +2 -2
- package/dist/cli/chunks/{chunk-WBQSXPBI.js → chunk-RJROC5M3.js} +2 -2
- package/dist/cli/chunks/chunk-RQGYJK7H.js +2 -0
- package/dist/cli/chunks/{chunk-XO6PVK2P.js → chunk-S3RDH5CI.js} +2 -2
- package/dist/cli/chunks/{chunk-3IUNFTIF.js → chunk-SCF7NRVE.js} +1 -1
- package/dist/cli/chunks/chunk-SDTVHR63.js +2 -0
- package/dist/cli/chunks/chunk-SGAW2WLI.js +65 -0
- package/dist/cli/chunks/{chunk-N2NS2PHA.js → chunk-SNVM4YJS.js} +2 -2
- package/dist/cli/chunks/{chunk-JXM26HEE.js → chunk-SRRFWTNF.js} +2 -2
- package/dist/cli/chunks/{chunk-UQHYFOBX.js → chunk-STE42EMB.js} +2 -2
- package/dist/cli/chunks/{chunk-WJ3DLOXF.js → chunk-T5GV6UIO.js} +2 -2
- package/dist/cli/chunks/{chunk-4YS3IJ45.js → chunk-TKF447CW.js} +1 -1
- package/dist/cli/chunks/{chunk-ZAPS3UGQ.js → chunk-TTOE336G.js} +3 -3
- package/dist/cli/chunks/{chunk-YAGODYIG.js → chunk-UKDOMLBI.js} +3 -3
- package/dist/cli/chunks/{chunk-JBANAPWG.js → chunk-V6XBAZNH.js} +1 -1
- package/dist/cli/chunks/{chunk-BULKFVYX.js → chunk-VHVWAXCF.js} +1 -1
- package/dist/cli/chunks/{chunk-5SKGFSKD.js → chunk-VL7YOOC2.js} +2 -2
- package/dist/cli/chunks/{chunk-AKE543X2.js → chunk-VUAO4VFC.js} +2 -2
- package/dist/cli/chunks/{chunk-7R6YMLVS.js → chunk-WG4GHAML.js} +2 -2
- package/dist/cli/chunks/{chunk-BTREG4IW.js → chunk-WXWY2GAF.js} +2 -2
- package/dist/cli/chunks/chunk-X35GP7TR.js +1 -0
- package/dist/cli/chunks/chunk-X6LCMOGC.js +2 -0
- package/dist/cli/chunks/{chunk-BGXNSCXX.js → chunk-XFMKJ3UD.js} +1 -1
- package/dist/cli/chunks/{chunk-BLBRY5UD.js → chunk-XH53ARZD.js} +2 -2
- package/dist/cli/chunks/chunk-XIBVVZGB.js +2 -0
- package/dist/cli/chunks/chunk-XYJL6DKI.js +2 -0
- package/dist/cli/chunks/{chunk-5T2ZQWKF.js → chunk-Y6O7CDLI.js} +2 -2
- package/dist/cli/chunks/{chunk-4I2IOUS4.js → chunk-YXCU4CJX.js} +1 -1
- package/dist/cli/chunks/{chunk-YR6ZZGH7.js → chunk-Z2IKNC5M.js} +1 -1
- package/dist/cli/chunks/{chunk-OLHKGP35.js → chunk-Z54EO6E6.js} +2 -2
- package/dist/cli/chunks/{chunk-ZDATDCYN.js → chunk-Z5HXGVXZ.js} +1 -1
- package/dist/cli/chunks/{ci-J374KDLI.js → ci-2BCOBWFG.js} +2 -2
- package/dist/cli/chunks/ci-output-FB4OJHAC.js +2 -0
- package/dist/cli/chunks/{claude-flow-setup-245JLJCN.js → claude-flow-setup-NEEFZTMB.js} +2 -2
- package/dist/cli/chunks/client-EF555KYW.js +2 -0
- package/dist/cli/chunks/{cline-installer-LBA2M5N3.js → cline-installer-ODO2PS4K.js} +2 -2
- package/dist/cli/chunks/{code-U4N4WONM.js → code-NSOF62VE.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-A57Z6BO4.js → code-index-extractor-YQL5XN52.js} +2 -2
- package/dist/cli/chunks/{codex-installer-UXMK2N4T.js → codex-installer-SPEY6VYT.js} +2 -2
- package/dist/cli/chunks/{completions-W66BSCOE.js → completions-OWKBUMBE.js} +2 -2
- package/dist/cli/chunks/complexity-analyzer-PGTXKP73.js +2 -0
- package/dist/cli/chunks/{continuedev-installer-LRFZ2SJM.js → continuedev-installer-KGOXAC7L.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-CQ3JYBIB.js → copilot-installer-BF3UA3TG.js} +2 -2
- package/dist/cli/chunks/cost-tracker-2HDJ66E2.js +2 -0
- package/dist/cli/chunks/{coverage-4PUEQXAY.js → coverage-KPA2PHIN.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-GXFNK5TS.js +2 -0
- package/dist/cli/chunks/{cursor-installer-JZEDEDHA.js → cursor-installer-7CDZFHTV.js} +2 -2
- package/dist/cli/chunks/{daemon-B7TWGHXQ.js → daemon-4BPGCKDJ.js} +3 -3
- package/dist/cli/chunks/dag-attention-scheduler-2MAVGSBB.js +2 -0
- package/dist/cli/chunks/detect-WRPWTGP5.js +2 -0
- package/dist/cli/chunks/{domain-handler-FT5FLZWL.js → domain-handler-JZVSJ7AG.js} +2 -2
- package/dist/cli/chunks/domain-transfer-XGIZOR2X.js +2 -0
- package/dist/cli/chunks/dream-3IKF5XH4.js +2 -0
- package/dist/cli/chunks/esm-node-DHAE52OW.js +2 -0
- package/dist/cli/chunks/{eval-GHMPFGWV.js → eval-T7YPAS4G.js} +2 -2
- package/dist/cli/chunks/{fast-paths-B3R647KN.js → fast-paths-QECJTKCQ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-DWS7ARSX.js → feature-flags-LIFURSFZ.js} +2 -2
- package/dist/cli/chunks/feature-flags-R4QZYTIW.js +2 -0
- package/dist/cli/chunks/file-discovery-4W3K3W4C.js +2 -0
- package/dist/cli/chunks/{fleet-EKOKMOMW.js → fleet-NLLQWCI5.js} +3 -3
- package/dist/cli/chunks/gnn-wrapper-XEII72LN.js +2 -0
- package/dist/cli/chunks/{heartbeat-handler-MBBS4IBU.js → heartbeat-handler-DJ65RE5D.js} +4 -4
- package/dist/cli/chunks/{heartbeat-scheduler-XDGMOT7X.js → heartbeat-scheduler-H664265Q.js} +2 -2
- package/dist/cli/chunks/hnsw-adapter-DML5KXQR.js +2 -0
- package/dist/cli/chunks/hnsw-index-BUPPGVR6.js +2 -0
- package/dist/cli/chunks/hnsw-legacy-bridge-SQIDTWAA.js +2 -0
- package/dist/cli/chunks/hnswlib-node-WICYCU5U.js +2 -0
- package/dist/cli/chunks/{hooks-L5VLZGEK.js → hooks-GZUHUD63.js} +6 -6
- package/dist/cli/chunks/hypergraph-engine-MLCDZ6BL.js +2 -0
- package/dist/cli/chunks/{hypergraph-handler-3HDGB5SZ.js → hypergraph-handler-NNDDI4R3.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-DPTMJRYS.js +2 -0
- package/dist/cli/chunks/{init-handler-JDET6WUN.js → init-handler-IJ6BHE6A.js} +6 -6
- package/dist/cli/chunks/init-wizard-35PUDJPW.js +2 -0
- package/dist/cli/chunks/kernel-2HZ44ZJ4.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-GZZG5AFW.js → kilocode-installer-EPZFFPFE.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-IWNY5TKH.js → kiro-installer-5VACG3HU.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JL62G72U.js +2 -0
- package/dist/cli/chunks/{learning-722ZNSZ6.js → learning-6FITK6XY.js} +3 -3
- package/dist/cli/chunks/{llm-router-DNAV746L.js → llm-router-4DDC6AKJ.js} +2 -2
- package/dist/cli/chunks/{load-Y3GCUFM4.js → load-KGDNVUBX.js} +2 -2
- package/dist/cli/chunks/load-test-LN245SSD.js +2 -0
- package/dist/cli/chunks/{mcp-LKPIBZ3W.js → mcp-4LETGVIV.js} +2 -2
- package/dist/cli/chunks/{memory-L57MLFOP.js → memory-II4I4QMO.js} +5 -5
- package/dist/cli/chunks/memory-backend-SVM7YRIE.js +2 -0
- package/dist/cli/chunks/memory-handlers-TQXTOJGQ.js +2 -0
- package/dist/cli/chunks/opencode-installer-EU6JCWBW.js +3 -0
- package/dist/cli/chunks/{orchestrator-QHSBB2UC.js → orchestrator-YLMGJVSP.js} +5 -5
- package/dist/cli/chunks/{pipeline-D3QER35Z.js → pipeline-MPZJWYKK.js} +2 -2
- package/dist/cli/chunks/{platform-T4E7Q3RD.js → platform-YH35ZZFZ.js} +2 -2
- package/dist/cli/chunks/{plugin-JHW2YPRC.js → plugin-B7JYZFNQ.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-G7CFNNQV.js → prime-radiant-advanced-wasm-KTUK6UE2.js} +2 -2
- package/dist/cli/chunks/protocol-executor-IEN2XB4L.js +2 -0
- package/dist/cli/chunks/{protocol-handler-2BQQ4HDM.js → protocol-handler-3NXMVU34.js} +2 -2
- package/dist/cli/chunks/{prove-UQ6JFT73.js → prove-H5LMGSUC.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-Q3ZV3JRG.js +2 -0
- package/dist/cli/chunks/{quality-JRZYMC77.js → quality-RCWHY6GO.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-E6ON3JUR.js +2 -0
- package/dist/cli/chunks/real-embeddings-NKH4VURF.js +2 -0
- package/dist/cli/chunks/{roocode-installer-F4E2LAYR.js → roocode-installer-SB7QJYM3.js} +2 -2
- package/dist/cli/chunks/router-WMC3LZ3C.js +2 -0
- package/dist/cli/chunks/routing-feedback-VKCZRCE3.js +2 -0
- package/dist/cli/chunks/{routing-handler-VNKFUUGB.js → routing-handler-SY7GKG2W.js} +2 -2
- package/dist/cli/chunks/ruvector-commands-HATTO3UQ.js +8 -0
- package/dist/cli/chunks/rvf-dual-writer-D57EXQUD.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-OWDYN6KD.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-SIQVJB5S.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-C7NBH5UN.js +2 -0
- package/dist/cli/chunks/safe-db-5KLXCNXN.js +2 -0
- package/dist/cli/chunks/schedule-HAWWOXWB.js +2 -0
- package/dist/cli/chunks/scheduler-HTRDY5BC.js +2 -0
- package/dist/cli/chunks/{security-EBEG2OPU.js → security-DS3XLZWN.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-6I2Z5UGL.js +2 -0
- package/dist/cli/chunks/shared-rvf-dual-writer-YB7AH6XJ.js +2 -0
- package/dist/cli/chunks/sqlite-persistence-WNNRGTGG.js +2 -0
- package/dist/cli/chunks/{status-handler-VZ32M4G4.js → status-handler-TUYHE4FT.js} +2 -2
- package/dist/cli/chunks/{structural-health-K6LRCKV6.js → structural-health-XNGBNRRD.js} +2 -2
- package/dist/cli/chunks/{sync-MHSHNLIM.js → sync-K6CIRKBB.js} +2 -2
- package/dist/cli/chunks/{task-handler-JNOIBZ2G.js → task-handler-7PJY67DR.js} +2 -2
- package/dist/cli/chunks/task-handlers-WB5CDWUR.js +2 -0
- package/dist/cli/chunks/{test-DO22BNIL.js → test-WV5ALEBB.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-VLRQZEFL.js → test-scheduling-N55ZGGA2.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-SINWHAKR.js +2 -0
- package/dist/cli/chunks/{token-usage-LG3PXRXH.js → token-usage-R7TGEVGL.js} +2 -2
- package/dist/cli/chunks/transformers-6DBLXPV7.js +2 -0
- package/dist/cli/chunks/{tree-sitter-wasm-parser-FT2KB66N.js → tree-sitter-wasm-parser-7C7FKMQW.js} +2 -2
- package/dist/cli/chunks/types-VNPMOKQT.js +2 -0
- package/dist/cli/chunks/unified-memory-72SKVZ7Y.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-TMN2L77W.js +2 -0
- package/dist/cli/chunks/unified-persistence-MDN3SRCR.js +2 -0
- package/dist/cli/chunks/{validate-VQCRSVNQ.js → validate-53MNIRAF.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-A5DHAWTP.js → validate-swarm-ZY4RGUFO.js} +2 -2
- package/dist/cli/chunks/{vibium-RZBSL4EB.js → vibium-PBADBIV6.js} +2 -2
- package/dist/cli/chunks/visual-security-TRBCXPIB.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-7C4NXEOF.js → web-tree-sitter-O7VI6RLB.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-ES3KPQG3.js → windsurf-installer-HV3C3TAD.js} +2 -2
- package/dist/cli/chunks/witness-chain-4WIMYP4X.js +2 -0
- package/dist/cli/chunks/witness-chain-JOI2YYGK.js +2 -0
- package/dist/cli/chunks/{workflow-JETHX4ML.js → workflow-5RVAQ4TM.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-2NQ72S3C.js +2 -0
- package/dist/cli/chunks/{wrappers-WP5RH745.js → wrappers-RRHCCA3E.js} +2 -2
- package/dist/cli/commands/ruvector-commands.js +14 -2
- package/dist/cli/index.js +10 -15
- package/dist/coordination/agent-memory-branch.d.ts +117 -0
- package/dist/coordination/agent-memory-branch.js +213 -0
- package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
- package/dist/coordination/agent-teams/mailbox.js +130 -4
- package/dist/coordination/handlers/handler-utils.d.ts +1 -0
- package/dist/coordination/handlers/handler-utils.js +9 -2
- package/dist/coordination/handlers/quality-handlers.js +7 -1
- package/dist/domains/contract-testing/coordinator.js +11 -0
- package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
- package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
- package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
- package/dist/domains/quality-assessment/coherence/index.js +2 -2
- package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
- package/dist/domains/quality-assessment/coherence/types.js +11 -0
- package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
- package/dist/domains/quality-assessment/coordinator.js +92 -0
- package/dist/domains/test-execution/coordinator.d.ts +19 -0
- package/dist/domains/test-execution/coordinator.js +102 -5
- package/dist/domains/test-generation/coordinator.js +11 -0
- package/dist/domains/test-generation/interfaces.d.ts +2 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
- package/dist/domains/test-generation/services/test-generator.js +37 -0
- package/dist/init/agents-installer.d.ts +5 -3
- package/dist/init/agents-installer.js +17 -43
- package/dist/init/find-package-root.d.ts +22 -0
- package/dist/init/find-package-root.js +46 -0
- package/dist/init/n8n-installer.d.ts +4 -2
- package/dist/init/n8n-installer.js +23 -23
- package/dist/init/opencode-installer.d.ts +0 -5
- package/dist/init/opencode-installer.js +12 -39
- package/dist/init/skills-installer.d.ts +5 -2
- package/dist/init/skills-installer.js +15 -37
- package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
- package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
- package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
- package/dist/integrations/ruvector/cognitive-routing.js +208 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
- package/dist/integrations/ruvector/feature-flags.js +59 -0
- package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
- package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
- package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
- package/dist/integrations/ruvector/index.d.ts +5 -2
- package/dist/integrations/ruvector/index.js +13 -2
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
- package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
- package/dist/integrations/ruvector/sona-persistence.js +10 -0
- package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
- package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
- package/dist/kernel/agent-coordinator.d.ts +75 -1
- package/dist/kernel/agent-coordinator.js +250 -1
- package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
- package/dist/kernel/hnsw-legacy-bridge.js +88 -0
- package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
- package/dist/kernel/hnsw-shadow-validator.js +139 -0
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/index.js +1 -1
- package/dist/kernel/interfaces.d.ts +39 -0
- package/dist/kernel/kernel.d.ts +23 -0
- package/dist/kernel/kernel.js +106 -1
- package/dist/kernel/unified-memory.d.ts +1 -1
- package/dist/kernel/unified-memory.js +7 -3
- package/dist/learning/aqe-learning-engine.d.ts +65 -0
- package/dist/learning/aqe-learning-engine.js +134 -0
- package/dist/learning/dream/dream-engine.d.ts +6 -1
- package/dist/learning/dream/dream-engine.js +37 -2
- package/dist/learning/dream/dream-scheduler.d.ts +25 -0
- package/dist/learning/dream/dream-scheduler.js +120 -0
- package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
- package/dist/learning/dream/rvcow-branch-manager.js +60 -5
- package/dist/learning/experience-capture.d.ts +3 -3
- package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
- package/dist/learning/hyperbolic-pattern-index.js +142 -0
- package/dist/learning/index.d.ts +3 -3
- package/dist/learning/index.js +1 -1
- package/dist/learning/metrics-tracker.d.ts +44 -0
- package/dist/learning/metrics-tracker.js +37 -0
- package/dist/learning/pattern-promotion.d.ts +3 -3
- package/dist/learning/pattern-store.d.ts +45 -2
- package/dist/learning/pattern-store.js +239 -4
- package/dist/learning/qe-patterns.d.ts +1 -1
- package/dist/learning/qe-reasoning-bank.js +1 -1
- package/dist/learning/rvf-pattern-migration.d.ts +50 -0
- package/dist/learning/rvf-pattern-migration.js +106 -0
- package/dist/learning/rvf-pattern-store.d.ts +69 -0
- package/dist/learning/rvf-pattern-store.js +449 -0
- package/dist/mcp/bundle.js +1894 -1804
- package/dist/mcp/handlers/index.d.ts +1 -0
- package/dist/mcp/handlers/index.js +2 -0
- package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
- package/dist/mcp/handlers/migration-handlers.js +85 -0
- package/dist/mcp/protocol-server.d.ts +1 -0
- package/dist/mcp/protocol-server.js +63 -2
- package/dist/mcp/types.d.ts +1 -1
- package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
- package/dist/optimization/early-exit-token-optimizer.js +3 -3
- package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
- package/dist/persistence/rvf-consistency-validator.js +182 -0
- package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
- package/dist/persistence/rvf-migration-adapter.js +303 -0
- package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
- package/dist/persistence/rvf-migration-coordinator.js +224 -0
- package/dist/persistence/rvf-stage-gate.d.ts +70 -0
- package/dist/persistence/rvf-stage-gate.js +163 -0
- package/package.json +10 -10
- package/dist/cli/chunks/adapter-WBR5NXS3.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +0 -2
- package/dist/cli/chunks/base-2WXOSMBQ.js +0 -2
- package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +0 -2
- package/dist/cli/chunks/brain-handler-PPEGDCN4.js +0 -68
- package/dist/cli/chunks/browser-workflow-42F7GK5T.js +0 -2
- package/dist/cli/chunks/chunk-263XS447.js +0 -2
- package/dist/cli/chunks/chunk-2I7J3O6V.js +0 -2
- package/dist/cli/chunks/chunk-3JPRUND5.js +0 -2
- package/dist/cli/chunks/chunk-3THRQEZ2.js +0 -95
- package/dist/cli/chunks/chunk-4B6NCELM.js +0 -2
- package/dist/cli/chunks/chunk-62ADTHV7.js +0 -2
- package/dist/cli/chunks/chunk-BR26T7ZS.js +0 -180
- package/dist/cli/chunks/chunk-DRT3WKQW.js +0 -2
- package/dist/cli/chunks/chunk-FIA6X7UL.js +0 -2
- package/dist/cli/chunks/chunk-J3KWWR6Z.js +0 -1
- package/dist/cli/chunks/chunk-JZSDOIXA.js +0 -2
- package/dist/cli/chunks/chunk-MV6CMOJQ.js +0 -65
- package/dist/cli/chunks/chunk-N5UXCLFI.js +0 -2
- package/dist/cli/chunks/chunk-OF4D7MYI.js +0 -2
- package/dist/cli/chunks/chunk-QOVHWZEP.js +0 -1
- package/dist/cli/chunks/chunk-RFSN6IDA.js +0 -79
- package/dist/cli/chunks/chunk-X5IJGWYG.js +0 -2
- package/dist/cli/chunks/ci-output-7JN7F6CI.js +0 -2
- package/dist/cli/chunks/client-MCSNSH2C.js +0 -2
- package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +0 -2
- package/dist/cli/chunks/cost-tracker-4F723RB6.js +0 -2
- package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +0 -2
- package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +0 -2
- package/dist/cli/chunks/detect-L6ZZHUSX.js +0 -2
- package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +0 -2
- package/dist/cli/chunks/dream-4TDBIYED.js +0 -2
- package/dist/cli/chunks/esm-node-2PKHKOTS.js +0 -2
- package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +0 -2
- package/dist/cli/chunks/file-discovery-QFPA6GMV.js +0 -2
- package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +0 -2
- package/dist/cli/chunks/hnsw-index-YO7CT23I.js +0 -2
- package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +0 -2
- package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +0 -2
- package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +0 -2
- package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +0 -2
- package/dist/cli/chunks/kernel-YNDTVKIW.js +0 -2
- package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +0 -2
- package/dist/cli/chunks/load-test-GZUBXFF3.js +0 -2
- package/dist/cli/chunks/memory-backend-3NQIZUXE.js +0 -2
- package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +0 -2
- package/dist/cli/chunks/opencode-installer-4HUB36H5.js +0 -3
- package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +0 -2
- package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +0 -2
- package/dist/cli/chunks/real-embeddings-GK63VF35.js +0 -2
- package/dist/cli/chunks/router-RJGHWDQ3.js +0 -2
- package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +0 -2
- package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +0 -8
- package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +0 -2
- package/dist/cli/chunks/safe-db-G22E5ROA.js +0 -2
- package/dist/cli/chunks/schedule-Y7VVCPYV.js +0 -2
- package/dist/cli/chunks/scheduler-AUQIFQB7.js +0 -2
- package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +0 -2
- package/dist/cli/chunks/task-handlers-P5DSUKND.js +0 -2
- package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +0 -2
- package/dist/cli/chunks/transformers-GY7SIKEU.js +0 -2
- package/dist/cli/chunks/types-QJGNBKP2.js +0 -2
- package/dist/cli/chunks/unified-memory-XYGENQUT.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +0 -2
- package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +0 -2
- package/dist/cli/chunks/visual-security-V47BLGJM.js +0 -2
- package/dist/cli/chunks/witness-chain-BR63P4A7.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,49 @@ All notable changes to the Agentic QE project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [3.9.2] - 2026-04-06
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **`aqe init --auto` hangs at "Code intelligence pre-scan"** — After v3.9.1 flipped `useRVFPatternStore` to `true` by default, `AQELearningEngine.initialize()` would open `patterns.rvf` twice in the same process: once via `createPatternStore()` and again via `getSharedRvfDualWriter()` → `getSharedRvfAdapter()`. The native @ruvector/rvf-node binding acquires an exclusive file lock on open, so the second call deadlocked waiting for a lock the same process already held. `createPatternStore()` now routes through the `getSharedRvfAdapter()` singleton so only one handle to `patterns.rvf` exists per process.
|
|
13
|
+
- **CLI process doesn't exit after `aqe init` completes** — Native NAPI handles from @ruvector/rvf-node and @ruvector/router kept the event loop alive indefinitely, and `cleanupAndExit()`'s async dynamic imports for cleanup loaded even more native bindings before the 3-second force-exit timer could fire. `cleanupAndExit()` is now synchronous: best-effort fire-and-forget disposes followed by immediate `process.exit()`. Init now completes and exits cleanly in ~7 seconds.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **`RvfPatternStore.dispose()` respects shared adapters** — New `skipCloseOnDispose` option prevents `dispose()` from closing an adapter owned by the `getSharedRvfAdapter()` singleton, so other consumers (dual-writer, migration adapter) retain access to the shared handle.
|
|
18
|
+
|
|
19
|
+
## [3.9.1] - 2026-04-05
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **RVF persistent vector storage (ADR-065/066)** — `RvfPatternStore` backed by @ruvector/rvf-node native HNSW replaces in-memory index rebuild on startup. Cold-start drops from seconds to <2ms; search p50 under 0.2ms. Factory routing via `createPatternStore()` with automatic fallback to SQLite.
|
|
24
|
+
- **Agent memory branching (ADR-067)** — Per-agent COW isolation via `RvfNativeAdapter.derive()` with ingest-log merge on completion and automatic branch cleanup on failure. Wired into `DefaultAgentCoordinator` spawn/complete lifecycle.
|
|
25
|
+
- **Dream RVF COW (ADR-069)** — Dream engine uses RVF forks instead of SQLite savepoints when RVF is active. Child adapter lifecycle managed with temp file cleanup. Recall validation gate compares top-k overlap before merge.
|
|
26
|
+
- **HNSW unification (ADR-071)** — Three separate HNSW implementations (`InMemoryHNSWIndex`, `HNSWEmbeddingIndex`, `HNSWIndex`) unified through `HnswLegacyBridge` → `HnswAdapter`. Shadow validator confirms <2% divergence. Old implementations decommissioned.
|
|
27
|
+
- **RVF dual-write migration (ADR-072)** — `RvfMigrationAdapter` with 5-stage routing (SQLite-only → dual-write → RVF-primary). `RvfConsistencyValidator` tracks rolling divergence. `RvfStageGate` enforces go/no-go criteria with witness chain. Stage 2 (dual-write, SQLite reads) active by default. MCP tools: `migration_status`, `migration_check`, `migration_promote`.
|
|
28
|
+
- **StrongDM software factory (ADR-062)** — Loop detection wired to MCP protocol-server (blocks on strike 3+), holdout testing (10% FNV-1a selection), gate ratcheting (monotonic 5-pass/2%/95% cap), progressive context (TF-IDF prediction), and meta-learning cycles (4 insight types).
|
|
29
|
+
- **RuVector advanced capabilities (ADR-087)** — EWC++ outcome recording wired to 3 domain coordinators, HDC fingerprinting (10K-bit hypervectors), delta event sourcing, cognitive routing (predictive compression), and hyperbolic HNSW (Poincare ball).
|
|
30
|
+
- **HnswShadowValidator** — Brute-force vs HnswAdapter divergence validation for search consistency verification.
|
|
31
|
+
- **RvfMigrationCoordinator** — Wires migration adapter, consistency validator, and stage gate with real SQLite/RVF handles. Initializes on kernel boot when migration stage >= 2.
|
|
32
|
+
- **Shared RVF adapter singleton** — Eliminates dual file handles between kernel and dream engine.
|
|
33
|
+
- **500+ new tests** — Covering RVF pattern store, agent memory branching, HNSW bridge, shadow validator, migration adapter, consistency validator, stage gate, StrongDM tiers, and RuVector capabilities.
|
|
34
|
+
|
|
35
|
+
### Fixed
|
|
36
|
+
|
|
37
|
+
- **`require()` fails in ESM bundles ("Dynamic require of X is not supported")** — esbuild's CJS compatibility shim throws in ESM chunks because `require` is undefined. Added `createRequire` banner to both CLI and MCP build scripts so every chunk has a working `require`. Fixes RVF, sqlite, and all native module paths in the CLI.
|
|
38
|
+
- **`aqe init` path resolution** — Skills and agents installers now resolve paths from package root via `findPackageRoot()` instead of brittle relative traversals that broke under esbuild code-splitting chunk layouts.
|
|
39
|
+
- **`quality_assess` hangs on large projects** — Defaults to `src/` instead of cwd; `discoverSourceFiles` skips `.agentic-qe/.claude/.cache` dirs with `maxFiles=5000` cap.
|
|
40
|
+
- **Dream cycle empty-query** — `RvfPatternStore` returns all patterns from SQLite when query is empty.
|
|
41
|
+
- **Coherence integration fallback** — `RvfPatternStore` computes brute-force cosine over SQLite embeddings when RVF adapter unavailable.
|
|
42
|
+
- **7 pre-existing test failures resolved** — Fixed console spy targets, ADR-062 loop detection in MCP tests, dream cycle RVF paths, and coherence vector search fallback.
|
|
43
|
+
|
|
44
|
+
### Changed
|
|
45
|
+
|
|
46
|
+
- **@ruvector/gnn bumped 0.1.19 → 0.1.25** — Latest ProgressiveHnswBackend improvements.
|
|
47
|
+
- **3 RVF feature flags default to `true`** — `useRVFPatternStore`, `useAgentMemoryBranching`, `useUnifiedHnsw` all ship enabled (opt-out via config).
|
|
48
|
+
- **RVF migration stage default: 2** — Dual-write with SQLite as source of truth for reads. Stage promotions (3, 4) gated by observation periods.
|
|
49
|
+
- **ESM-safe dynamic imports** — `require()` replaced with `import()` in dream-engine and branch-manager.
|
|
50
|
+
|
|
8
51
|
## [3.9.0] - 2026-04-02
|
|
9
52
|
|
|
10
53
|
### Added
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { type Database as DatabaseType } from 'better-sqlite3';
|
|
9
9
|
import { type WitnessKeyManager } from './witness-key-manager.js';
|
|
10
|
-
export type WitnessActionType = 'PATTERN_CREATE' | 'PATTERN_UPDATE' | 'PATTERN_PROMOTE' | 'PATTERN_QUARANTINE' | 'DREAM_MERGE' | 'DREAM_DISCARD' | 'QUALITY_GATE_PASS' | 'QUALITY_GATE_FAIL' | 'ROUTING_DECISION' | 'BRANCH_MERGE' | 'HEBBIAN_PENALTY' | 'KEY_ROTATION';
|
|
10
|
+
export type WitnessActionType = 'PATTERN_CREATE' | 'PATTERN_UPDATE' | 'PATTERN_PROMOTE' | 'PATTERN_QUARANTINE' | 'DREAM_MERGE' | 'DREAM_DISCARD' | 'QUALITY_GATE_PASS' | 'QUALITY_GATE_FAIL' | 'ROUTING_DECISION' | 'BRANCH_MERGE' | 'BRANCH_DISCARD' | 'HEBBIAN_PENALTY' | 'KEY_ROTATION';
|
|
11
11
|
export interface WitnessEntry {
|
|
12
12
|
id: number;
|
|
13
13
|
prev_hash: string;
|
package/dist/cli/bundle.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
3
|
-
import{a as y}from"./chunks/chunk-
|
|
4
|
-
`);return}b(...e)};var
|
|
5
|
-
`)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
|
|
3
|
+
import{a as y}from"./chunks/chunk-BIVIPF4O.js";import{a as f,c as A}from"./chunks/chunk-SDTVHR63.js";import"./chunks/chunk-YXCU4CJX.js";A();import{Command as P}from"commander";import m from"chalk";function h(e,i,a,s){let l=e.command(i).description(a);if(s)for(let u of s)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function w(e,i){let a=e.commands,s=a.indexOf(i);s>=0&&a.splice(s,1)}function r(e,i){let a=h(e,i.name,i.description,i.aliases);a.action(async()=>{try{let s=await i.factory();w(e,a),e.addCommand(s),await e.parseAsync(process.argv)}catch(s){console.error(`Failed to load command '${i.name}':`,s instanceof Error?s.message:s),process.exit(1)}})}function d(e,i,a,s,l,u){let g=h(e,i,a,u);g.action(async()=>{try{let p=await s();w(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${i}':`,p instanceof Error?p.message:p),process.exit(1)}})}var S=["[UnifiedMemory]","[HybridBackend]","[UnifiedPersistence]","[PersistentSONAEngine]","[QueenGovernance]","[QueenCoordinator]","[Queen]","[QUEEN]","[DomainBreakerRegistry]","[RealEmbeddings]","[HNSWIndex]","[PatternStore]","[TestGenerationCoordinator]","[CodeIntelligence]","[ProductFactorsBridge]","[LearningOptimizationCoordinator]","[DreamEngine]","[DreamScheduler]","[SecurityCompliance]","[Providers]","[GNN]","[test-generation]","[test-execution]","[coverage-analysis]","[quality-assessment]","[defect-intelligence]","[requirements-validation]","[code-intelligence]","[security-compliance]","[contract-testing]","[visual-accessibility]","[chaos-resilience]","[learning-optimization]","[enterprise-integration]","[coordination]","[PatternLearnerService]","[RequirementsValidation]","[ParserRegistry]","[AdversarialDefense]","[ContinueGateIntegration]","[ContinueGate]","[SQLitePatternStore]","[TokenTracking]","[InfraHealing]","[ExperienceCapture]"],I=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,b=console.log.bind(console);console.log=(...e)=>{let a=(typeof e[0]=="string"?e[0]:"").trimStart();if(S.some(s=>a.startsWith(s))||I.test(a)){process.stderr.write(e.map(String).join(" ")+`
|
|
4
|
+
`);return}b(...e)};var O=console.info.bind(console);console.info=(...e)=>{process.stderr.write(e.map(String).join(" ")+`
|
|
5
|
+
`)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function C(e,i){let a=e.getDomainAPI("visual-accessibility");if(a?.registerWorkflowActions)try{a.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let s=e.getDomainAPI("requirements-validation");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(i)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function D(){let{QEKernelImpl:e}=await import("./chunks/kernel-2HZ44ZJ4.js"),{CrossDomainEventRouter:i}=await import("./chunks/cross-domain-router-GXFNK5TS.js"),{DefaultProtocolExecutor:a}=await import("./chunks/protocol-executor-IEN2XB4L.js"),{WorkflowOrchestrator:s}=await import("./chunks/workflow-orchestrator-2NQ72S3C.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-E6ON3JUR.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-HTRDY5BC.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y]}),await t.kernel.initialize(),t.router=new i(t.kernel.eventBus),await t.router.initialize();let g=E=>t.kernel.getDomainAPI(E),p=new a(t.kernel.eventBus,t.kernel.memory,g);t.workflowOrchestrator=new s(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),C(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=l(t.kernel,t.router,p,void 0),await t.queen.initialize(),t.initialized=!0}async function k(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),a=(await import("path")).resolve(".agentic-qe");return e.existsSync(a)?c():(console.error(m.red(`
|
|
6
6
|
Error: AQE system not initialized in this directory.`)),console.log(m.yellow("Run `aqe init` first to set up this project.\n")),!1)}async function c(){if(t.initialized&&t.kernel&&t.queen)return!0;process.stderr.write(m.gray("Auto-initializing v3 system...")+`
|
|
7
|
-
`);let e=3e4,
|
|
7
|
+
`);let e=3e4,i=new Promise((a,s)=>{setTimeout(()=>s(new Error("Initialization timeout after 30 seconds")),e)});try{return await Promise.race([D(),i]),process.stderr.write(m.green("System ready")+`
|
|
8
8
|
|
|
9
|
-
`),!0}catch(
|
|
9
|
+
`),!0}catch(a){return a.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),a),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new P,v="3.9.2";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(v);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-IJ6BHE6A.js").then(e=>e.createInitHandler(o)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-TUYHE4FT.js").then(e=>e.createStatusHandler(o,k)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-TUYHE4FT.js").then(e=>e.createHealthHandler(o,k)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-7PJY67DR.js").then(e=>e.createTaskHandler(o,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-MTGPOUVP.js").then(e=>e.createAgentHandler(o,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-JZVSJ7AG.js").then(e=>e.createDomainHandler(o,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-3NXMVU34.js").then(e=>e.createProtocolHandler(o,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-7EO3FFRZ.js").then(e=>e.createBrainHandler(o,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-NNDDI4R3.js").then(e=>e.createHypergraphHandler(o,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-DJ65RE5D.js").then(e=>e.createHeartbeatHandler(o)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-SY7GKG2W.js").then(e=>e.createRoutingHandler(o)),t);r(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-5RVAQ4TM.js").then(e=>e.createWorkflowCommand(t,o,c))});r(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-WV5ALEBB.js").then(e=>e.createTestCommand(t,o,c))});r(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-KPA2PHIN.js").then(e=>e.createCoverageCommand(t,o,c))});r(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-RCWHY6GO.js").then(e=>e.createQualityCommand(t,o,c))});r(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-DS3XLZWN.js").then(e=>e.createSecurityCommand(t,o,c))});r(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-NSOF62VE.js").then(e=>e.createCodeCommand(t,o,c))});r(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-OWKBUMBE.js").then(e=>e.createCompletionsCommand(o))});r(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-NLLQWCI5.js").then(e=>e.createFleetCommand(t,o,c,C))});r(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-ZY4RGUFO.js").then(e=>e.createValidateSwarmCommand(t,o,c))});r(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-53MNIRAF.js").then(e=>e.createValidateCommand(t,o,c))});r(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-T7YPAS4G.js").then(e=>e.createEvalCommand())});r(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-2BCOBWFG.js").then(e=>e.createCICommand(t,o,c))});r(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-R7TGEVGL.js").then(e=>e.createTokenUsageCommand())});r(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-4DDC6AKJ.js").then(e=>e.createLLMRouterCommand())});r(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-K6CIRKBB.js").then(e=>e.createSyncCommands())});r(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-GZUHUD63.js").then(e=>e.createHooksCommand())});r(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-6FITK6XY.js").then(e=>e.createLearningCommand())});r(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-II4I4QMO.js").then(e=>e.createMemoryCommand(t,o,c))});r(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-4LETGVIV.js").then(e=>e.createMcpCommand())});r(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-YH35ZZFZ.js").then(e=>e.createPlatformCommand())});r(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-H5LMGSUC.js").then(e=>e.createProveCommand(t,o,c))});r(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-HATTO3UQ.js").then(e=>e.createRuVectorCommand())});r(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-VBEZHNHO.js").then(e=>e.createAuditCommand(t,o,c))});r(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-MPZJWYKK.js").then(e=>e.createPipelineCommand(t,o,c))});r(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-B7JYZFNQ.js").then(e=>e.createPluginCommand())});r(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-4BPGCKDJ.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
|
|
10
10
|
|
|
11
11
|
Shutting down...`)),console.log(m.green(`Shutdown complete
|
|
12
|
-
`)),await
|
|
13
|
-
Received SIGTERM, shutting down gracefully...`)),await
|
|
12
|
+
`)),await o(0)});process.on("SIGTERM",async()=>{console.log(m.yellow(`
|
|
13
|
+
Received SIGTERM, shutting down gracefully...`)),await o(0)});async function z(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-QECJTKCQ.js");e(process.argv)&&(console.log(v),process.exit(0));let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-SINWHAKR.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"}),await n.parseAsync(),await o(0)}z().catch(async e=>{console.error(m.red("Fatal error:"),e),await o(1)});
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import{a,b,c}from"./chunk-KBA7FBK3.js";import"./chunk-BOH22AKC.js";import"./chunk-4D2ZG2QO.js";import"./chunk-N3F3CX4V.js";import"./chunk-SDTVHR63.js";import"./chunk-YXCU4CJX.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as x}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.2");process.exit(0)}
|
|
2
|
+
import{a as x}from"./chunk-XIBVVZGB.js";import{c as f}from"./chunk-JOVINE23.js";import"./chunk-YXCU4CJX.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{b 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.2");process.exit(0)}
|
|
2
|
+
import{b as p}from"./chunk-5RL66XSH.js";import{a as g}from"./chunk-65M7C6SH.js";import"./chunk-N3F3CX4V.js";import"./chunk-YXCU4CJX.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
|
|
3
3
|
Agents (${a.length})
|
|
4
4
|
`)),a.length===0)console.log(s.gray(" No agents found"));else{let e=new Map;for(let i of a)e.has(i.domain)||e.set(i.domain,[]),e.get(i.domain).push(i);let o=Array.from(e.entries());for(let[i,m]of o){console.log(s.cyan(` ${i}:`));for(let r of m)console.log(` ${r.id}`),console.log(` Type: ${r.type}`),console.log(` Status: ${g(r.status)}`),r.startedAt&&console.log(s.gray(` Started: ${r.startedAt.toISOString()}`));console.log("")}}}catch(a){console.error(s.red(`
|
|
5
5
|
Failed to list agents:`),a),await this.cleanupAndExit(1)}}async executeSpawn(n,t,a){if(await this.ensureInitialized())try{let e=t.capabilities.split(",");console.log(s.blue(`
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import"./chunk-YXCU4CJX.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-4FT3PND7.js";import"./chunk-L5WZUPZF.js";import"./chunk-7SLN2JGP.js";import"./chunk-SGAW2WLI.js";import"./chunk-4UH25U4O.js";import"./chunk-4PKXIBX2.js";import"./chunk-TKF447CW.js";import"./chunk-5L6AU3QK.js";import"./chunk-S3RDH5CI.js";import"./chunk-FRJLP7IB.js";import"./chunk-QEQTC4WQ.js";import"./chunk-RQGYJK7H.js";import"./chunk-563PJBDM.js";import"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import"./chunk-N3F3CX4V.js";import"./chunk-BIVIPF4O.js";import"./chunk-SDTVHR63.js";import"./chunk-E25S5E2D.js";import"./chunk-XYJL6DKI.js";import"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import"./chunk-YXCU4CJX.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{
|
|
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");process.exit(0)}
|
|
2
|
+
import{f as s,o as p}from"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import{d as c,e as u,f as h,g as m}from"./chunk-Y6O7CDLI.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import"./chunk-N3F3CX4V.js";import"./chunk-SDTVHR63.js";import"./chunk-XYJL6DKI.js";import{p as l,q as d}from"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import{g as f}from"./chunk-YXCU4CJX.js";import{Command as g}from"commander";import a from"chalk";p();import{existsSync as y}from"node:fs";import b from"node:path";function C(n,i){let t=[];t.push(a.bold("Witness Chain Audit Verification")),t.push("");let e=i?a.green("ENABLED"):a.yellow("DISABLED");t.push(` Feature Flag: ${e}`),t.push(` Chain Length: ${n.length} receipts`);let r=n.valid?a.green("VALID"):a.red("BROKEN");return t.push(` Integrity: ${r}`),n.length>0&&t.push(` Last Hash: ${n.lastHash.slice(0,16)}...`),!n.valid&&n.brokenAt>=0&&(t.push(""),t.push(a.red(` Break detected at index ${n.brokenAt}`)),t.push(a.red(` ${n.message}`))),t.push(""),t.join(`
|
|
3
3
|
`)}function x(){try{let n=s(),i=b.join(n,".agentic-qe","memory.db");if(!y(i))return null;let t=(d(),f(l)),e=new t(i),r=c(e),o=h(r);return e.close(),o}catch{return null}}async function A(n){let i=m(),e=(x()??u()).verifyChain(),r={featureEnabled:i,chainLength:e.length,integrity:e.valid,brokenAt:e.brokenAt,lastHash:e.lastHash,message:e.message};return n.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(C(e,i)),r}function v(n,i,t){let e=new g("audit").description("Witness chain audit trail management");return e.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{await A({format:r.format}),await i(0)}catch(o){console.error("Failed to verify witness chain:",o),await i(1)}}),e}export{v as createAuditCommand,C as formatVerificationText,A as handleAuditVerify};
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f}from"./chunk-AA33R5U4.js";import"./chunk-3GZKAORV.js";import"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import"./chunk-N3F3CX4V.js";import"./chunk-SDTVHR63.js";import"./chunk-E25S5E2D.js";import"./chunk-XYJL6DKI.js";import"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import"./chunk-YXCU4CJX.js";export{f as MCPToolBase,e as defaultToolLogger,d as getMemoryBackend,b as getSharedMemoryBackend,a as registerRvfResetFn,c as resetSharedMemoryBackend};
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-L5YEPSDU.js";import"./chunk-YXCU4CJX.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
|
|
@@ -0,0 +1,68 @@
|
|
|
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");process.exit(0)}
|
|
2
|
+
import{a as $,b as M,c as L,d as v,e as H,f as k,g as F,h as _,i as P,j as G,k as V,l as ce,m as q,n as Q,o as de,p as Y,q as j,r as W,s as U}from"./chunk-QIH3E775.js";import{h as ae}from"./chunk-QEQTC4WQ.js";import{a as se,b as ie,c as le,d as O,f as Ne}from"./chunk-RQGYJK7H.js";import"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import{b as N,d as Be}from"./chunk-N3F3CX4V.js";import"./chunk-SDTVHR63.js";import{a as S,b as Ie}from"./chunk-XYJL6DKI.js";import"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import"./chunk-YXCU4CJX.js";import T from"path";import r from"chalk";Ie();Be();import{existsSync as z,mkdirSync as Oe,writeFileSync as ke,readFileSync as X}from"fs";import{join as E,resolve as Z}from"path";var qe={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Te(n,t){let o=qe[n.tableName];return!(o&&t[o]===!1)}var Ae=1e4;function De(n,t,o,e){if(!Te(t,o))return Q(E(e,t.fileName),[]),{count:0,rows:[]};let[s,i]=t.domainColumn?q(o.domains,t.domainColumn):[void 0,[]];if(G(n,t.tableName,s,i)>=Ae){let d=t.blobColumns,f=d&&d.length>0?p=>k(p,d):void 0;return{count:de(E(e,t.fileName),ce(n,t.tableName,s,i),f)}}let a=V(n,t.tableName,s,i);return t.blobColumns&&t.blobColumns.length>0&&(a=a.map(d=>k(d,t.blobColumns))),Q(E(e,t.fileName),a),{count:a.length,rows:a}}function me(n){let t=[];for(let o of v){let e=E(n,o.fileName);z(e)?t.push(_(X(e,"utf-8"))):t.push(_(""))}return _(t.join(":"))}function fe(n,t,o="memory.db"){let e=Z(t.outputPath);z(e)||Oe(e,{recursive:!0});let s=0,i={},c=new Set;for(let u of v){let p=De(n,u,t,e);if(i[u.tableName]=p.count,s+=p.count,u.tableName==="qe_patterns"){if(p.rows)for(let l of p.rows)l.qe_domain&&c.add(l.qe_domain);else if(p.count>0){let[l,h]=u.domainColumn?q(t.domains,u.domainColumn):[void 0,[]],b=`SELECT DISTINCT qe_domain FROM qe_patterns ${l?`WHERE ${l} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let y=n.prepare(b).all(...h||[]);for(let R of y)c.add(R.qe_domain)}catch{}}}}let a=t.includeVectors!==!1?G(n,"vectors"):0,d=me(e),f={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:o,stats:{patternCount:i.qe_patterns||0,vectorCount:a,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:s},domains:[...c].sort(),checksum:d,tableRecordCounts:i};return ke(E(e,"manifest.json"),JSON.stringify(f,null,2),"utf-8"),f}var $e=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function Me(n){return n==="1.0"?v.filter(t=>$e.has(t.tableName)):n==="3.0"?v:(console.warn(`[brain-import] Unknown manifest version '${n}'. Attempting full import \u2014 some files may be missing.`),v)}function ue(n,t,o){let e=Z(t),s=E(e,"manifest.json");if(!z(s))throw new Error(`Manifest not found at ${s}`);let i=N(X(s,"utf-8")),c=me(e);if(c!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${c}. The export may have been tampered with or corrupted.`);let a=Me(i.version);if(o.dryRun){let l=0;for(let h of a){let m=Y(E(e,h.fileName),N);l+=m.length}return{imported:l,skipped:0,conflicts:0}}U(n);let d=0,f=0,u=0;return n.transaction(()=>{for(let l of a){let h=E(e,l.fileName),m=Y(h,N);l.blobColumns&&l.blobColumns.length>0&&(m=m.map(b=>F(b,l.blobColumns)));for(let b of m){let y;if(l.dedupColumns&&l.dedupColumns.length>0)y=W(n,l.tableName,b,l.dedupColumns);else{let R=$[l.tableName]||"id",C=L[l.tableName],x=M[l.tableName];y=j(n,l.tableName,b,R,o.mergeStrategy,C,x)}d+=y.imported,f+=y.skipped,u+=y.conflicts}}})(),{imported:d,skipped:f,conflicts:u}}function pe(n){let t=Z(n),o=E(t,"manifest.json");if(!z(o))throw new Error(`Manifest not found at ${o}`);return N(X(o,"utf-8"))}Ne();import{existsSync as K,statSync as Le,unlinkSync as ge,writeFileSync as Fe}from"fs";import{resolve as ee}from"path";function be(n,t,o="memory.db"){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let e=ee(t.outputPath),s=t.dimension??384;K(e)&&ge(e);let i=`${e}.idmap.json`;K(i)&&ge(i);let c=se(e,s);try{let a={},d=new Set,f=0;for(let w of v){let[g,oe]=w.domainColumn?q(t.domains,w.domainColumn):[void 0,[]],B=V(n,w.tableName,g,oe);if(w.tableName==="qe_patterns")for(let D of B)D.qe_domain&&d.add(D.qe_domain);let J=H[w.tableName];J&&J.length>0&&(B=B.map(D=>k(D,J))),a[w.tableName]=B,f+=B.length}let u=0,p=[];if(P(n,"qe_pattern_embeddings")){let w=n.prepare("SELECT pattern_id, embedding, dimension FROM qe_pattern_embeddings").all();for(let g of w)g.embedding&&g.dimension===s&&p.push({id:`pe:${g.pattern_id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"qe_pattern_embeddings"}})}if(P(n,"captured_experiences")){let w=n.prepare("SELECT id, embedding, embedding_dimension, domain, quality FROM captured_experiences WHERE embedding IS NOT NULL").all();for(let g of w)g.embedding_dimension===s&&p.push({id:`exp:${g.id}`,vector:new Float32Array(g.embedding.buffer,g.embedding.byteOffset,s),metadata:{tableName:"captured_experiences",domain:g.domain,confidence:g.quality}})}if(P(n,"sona_patterns")){let w=n.prepare("SELECT id, state_embedding, domain, confidence FROM sona_patterns WHERE state_embedding IS NOT NULL").all();for(let g of w)g.state_embedding.byteLength/4===s&&p.push({id:`sona:${g.id}`,vector:new Float32Array(g.state_embedding.buffer,g.state_embedding.byteOffset,s),metadata:{tableName:"sona_patterns",domain:g.domain,confidence:g.confidence}})}p.length>0&&(u=c.ingest(p).accepted);let l={version:"3.0",format:"rvf",exportedAt:new Date().toISOString(),sourceDb:o,domains:[...d].sort(),tables:a},h=JSON.stringify(l),m=_(h),b=Buffer.from(h);c.embedKernel(b);let y=t.sign?c.sign(b)??void 0:void 0,R=y?t.signerKeyId??"default":void 0,C=c.fileId(),x=C?{fileId:C,parentId:c.parentId(),lineageDepth:c.lineageDepth()}:void 0,I=c.status(),A={version:"3.0",format:"rvf",exportedAt:l.exportedAt,sourceDb:o,stats:{patternCount:(a.qe_patterns||[]).length,embeddingCount:u,qValueCount:(a.rl_q_values||[]).length,dreamInsightCount:(a.dream_insights||[]).length,witnessChainLength:(a.witness_chain||[]).length,totalRecords:f},domains:l.domains,checksum:m,rvfStatus:{totalVectors:I.totalVectors,totalSegments:I.totalSegments,fileSizeBytes:I.fileSizeBytes},...y?{signature:y,signerKeyId:R}:{},...x?{lineage:x}:{}};if(y)try{c.freeze()}catch{}let Se=`${e}.manifest.json`;return Fe(Se,JSON.stringify(A,null,2),"utf-8"),A}finally{c.close()}}var Pe={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function ye(n,t,o){if(!O())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let e=ee(t);if(!K(e))throw new Error(`RVF file not found: ${e}`);let s=ie(e);try{let i=s.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let m=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${m}`)}let c=s.extractKernel();if(!c||!c.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let a;try{a=JSON.parse(c.image.toString("utf-8"))}catch(m){throw new Error(`Failed to parse brain kernel data as JSON: ${m instanceof Error?m.message:m}`)}if(o.dryRun){let m=0;if(a.tables)for(let b of Object.values(a.tables))m+=b?.length??0;else m=(a.patterns?.length??0)+(a.qValues?.length??0)+(a.dreamInsights?.length??0)+(a.witnessChain?.length??0);return{imported:m,skipped:0,conflicts:0,embeddingsRestored:0}}U(n);let d=0,f=0,u=0,p=0,l={};if(a.tables)Object.assign(l,a.tables);else for(let[m,b]of Object.entries(Pe)){let y=a[m];Array.isArray(y)&&(l[b]=y)}if(n.transaction(()=>{for(let m of v){let b=l[m.tableName];if(!b||!Array.isArray(b))continue;let y=H[m.tableName];if(y&&y.length>0){b=b.map(R=>F(R,y));for(let R of b)for(let C of y)R[C]instanceof Buffer&&p++}for(let R of b){let C;if(m.dedupColumns&&m.dedupColumns.length>0)C=W(n,m.tableName,R,m.dedupColumns);else{let x=$[m.tableName]||"id",I=L[m.tableName],A=M[m.tableName];C=j(n,m.tableName,R,x,o.mergeStrategy,I,A)}d+=C.imported,f+=C.skipped,u+=C.conflicts}}})(),u>0)try{s.compact()}catch{}return{imported:d,skipped:f,conflicts:u,embeddingsRestored:p}}finally{s.close()}}function he(n){if(!O())throw new Error("@ruvector/rvf-node is not available.");let t=ee(n);if(!K(t))throw new Error(`RVF file not found: ${t}`);let o=le(t);try{let e=o.extractKernel();if(!e||!e.image)throw new Error("No brain data found in RVF file");let s=e.image.toString("utf-8"),i;try{i=JSON.parse(s)}catch(h){throw new Error(`Failed to parse brain kernel data as JSON: ${h instanceof Error?h.message:h}`)}let c=o.status(),a=Le(t).size,d=i.tables,f=d?d.qe_patterns?.length??0:i.patterns?.length??0,u=d?d.rl_q_values?.length??0:i.qValues?.length??0,p=d?d.dream_insights?.length??0:i.dreamInsights?.length??0,l=d?d.witness_chain?.length??0:i.witnessChain?.length??0;return{version:"3.0",format:"rvf",exportedAt:i.exportedAt??"unknown",sourceDb:i.sourceDb??"unknown",stats:{patternCount:f,embeddingCount:c.totalVectors,qValueCount:u,dreamInsightCount:p,witnessChainLength:l},domains:i.domains??[],checksum:_(s),rvfStatus:{totalVectors:c.totalVectors,totalSegments:c.totalSegments,fileSizeBytes:a}}}finally{o.close()}}function te(){return O()}function we(n,t){if(!n.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};n.exec(`
|
|
3
|
+
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
4
|
+
pattern_id TEXT PRIMARY KEY
|
|
5
|
+
)
|
|
6
|
+
`),n.exec("DELETE FROM _covered_patterns"),n.exec(`
|
|
7
|
+
INSERT INTO _covered_patterns (pattern_id)
|
|
8
|
+
SELECT DISTINCT json_extract(action_data, '$.patternId')
|
|
9
|
+
FROM witness_chain
|
|
10
|
+
WHERE action_type = 'PATTERN_CREATE'
|
|
11
|
+
AND json_extract(action_data, '$.patternId') IS NOT NULL
|
|
12
|
+
`),n.exec(`
|
|
13
|
+
INSERT OR IGNORE INTO _covered_patterns (pattern_id)
|
|
14
|
+
SELECT DISTINCT json_extract(action_data, '$.pattern_id')
|
|
15
|
+
FROM witness_chain
|
|
16
|
+
WHERE action_type = 'PATTERN_CREATE'
|
|
17
|
+
AND json_extract(action_data, '$.pattern_id') IS NOT NULL
|
|
18
|
+
`);let e=n.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
|
|
19
|
+
FROM qe_patterns p
|
|
20
|
+
LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
|
|
21
|
+
WHERE c.pattern_id IS NULL
|
|
22
|
+
ORDER BY p.created_at ASC`).all(),i=n.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-e.length,c=0;for(let a of e)t.append("PATTERN_CREATE",{patternId:a.id,patternType:a.pattern_type,qeDomain:a.qe_domain,name:a.name,originalCreatedAt:a.created_at,backfilled:!0},"system:backfill"),c++;return n.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:c,skipped:i}}async function Re(n,t){if(Ve(t.format)==="rvf"){let s=S(n,{readonly:!0});try{return be(s,{outputPath:t.outputPath,domains:t.domains},n)}finally{s.close()}}let e=S(n,{readonly:!0});try{return fe(e,t,n)}finally{e.close()}}async function Ce(n,t,o){if(_e(t,o.format)==="rvf"){let i=S(n);try{return ye(i,t,{mergeStrategy:o.mergeStrategy,dryRun:o.dryRun})}finally{i.close()}}let s=S(n);try{return ue(s,t,o)}finally{s.close()}}async function ve(n,t){return _e(n,t)==="rvf"?he(n):pe(n)}async function Ee(n){let t=S(n);try{let o=ae(t);return await o.initialize(),we(t,o)}finally{t.close()}}function Ve(n){if(n==="jsonl")return"jsonl";if(n==="rvf"){if(!te())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return te()?"rvf":"jsonl"}function _e(n,t){return t==="rvf"?"rvf":t==="jsonl"?"jsonl":n.endsWith(".rvf")?"rvf":"jsonl"}var re=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(t,o){this.cleanupAndExit=t,this.ensureInitialized=o}register(t,o){let e=t.command("brain").description(this.description);e.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").action(async s=>{await this.executeExport(s)}),e.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async s=>{await this.executeImport(s)}),e.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async s=>{await this.executeInfo(s)}),e.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async s=>{await this.executeWitnessBackfill(s)})}async executeExport(t){try{console.log(r.blue(`
|
|
23
|
+
Exporting brain state (format: ${t.format})...
|
|
24
|
+
`));let o=await ne(t.db),e=await Re(o,{outputPath:T.resolve(t.output),format:t.format});if(console.log(r.green(" Export complete.")),console.log(` Format: ${r.cyan("format"in e?e.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${r.cyan(e.stats.patternCount)}`),"embeddingCount"in e.stats?console.log(` Vectors: ${r.cyan(e.stats.embeddingCount)}`):"vectorCount"in e.stats&&console.log(` Vectors: ${r.cyan(e.stats.vectorCount)}`),"rvfStatus"in e){let s=e.rvfStatus;console.log(` RVF Size: ${r.cyan(xe(s.fileSizeBytes))}`),console.log(` Segments: ${r.cyan(s.totalSegments)}`)}console.log(` Checksum: ${r.gray(e.checksum)}`),console.log(` Output: ${r.cyan(T.resolve(t.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
|
|
25
|
+
Brain export failed:`),o),await this.cleanupAndExit(1)}}async executeImport(t){try{t.dryRun?console.log(r.yellow(`
|
|
26
|
+
Dry-run mode \u2014 no data will be written.
|
|
27
|
+
`)):console.log(r.blue(`
|
|
28
|
+
Importing brain state...
|
|
29
|
+
`));let o=await ne(t.db),e=await Ce(o,T.resolve(t.input),{mergeStrategy:t.strategy,dryRun:t.dryRun});console.log(r.green(" Import complete.")),console.log(` Imported: ${r.cyan(e.imported)}`),console.log(` Skipped: ${r.yellow(e.skipped)}`),console.log(` Conflicts: ${r.red(e.conflicts)}`),"embeddingsRestored"in e&&console.log(` Embeddings: ${r.cyan(e.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
|
|
30
|
+
Brain import failed:`),o),await this.cleanupAndExit(1)}}async executeInfo(t){try{console.log(r.blue(`
|
|
31
|
+
Brain Export Info
|
|
32
|
+
`));let o=T.resolve(t.input),e=await ve(o),s="format"in e?e.format??"jsonl":"jsonl";if(console.log(` Version: ${r.cyan(e.version)}`),console.log(` Format: ${r.cyan(s)}`),console.log(` Exported: ${r.cyan(e.exportedAt)}`),console.log(` Source DB: ${r.cyan(e.sourceDb)}`),console.log(r.blue(`
|
|
33
|
+
Learning Data:`)),console.log(` Patterns: ${r.cyan(e.stats.patternCount)}`),"qValueCount"in e.stats&&console.log(` Q-Values: ${r.cyan(e.stats.qValueCount)}`),"dreamInsightCount"in e.stats){let a=e.stats.dreamInsightCount,f=("tableRecordCounts"in e?e.tableRecordCounts:void 0)?.dream_cycles,u=f!==void 0?` (${f} cycles)`:"";console.log(` Dream Insights: ${r.cyan(a)}${r.gray(u)}`)}"witnessChainLength"in e.stats&&console.log(` Witness Chain: ${r.cyan(e.stats.witnessChainLength)} entries`),"embeddingCount"in e.stats?console.log(` Embeddings: ${r.cyan(e.stats.embeddingCount)}`):"vectorCount"in e.stats&&console.log(` Vectors: ${r.cyan(e.stats.vectorCount)}`);let i="tableRecordCounts"in e?e.tableRecordCounts:void 0;if(i){let a=Object.entries(i).filter(([d,f])=>f>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(d));if(a.length>0)for(let[d,f]of a){let p=`${d.replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase())}:`.padEnd(15);console.log(` ${p}${r.cyan(f)}`)}}let c="totalRecords"in e.stats?e.stats.totalRecords:void 0;if(c!==void 0&&(console.log(r.blue(`
|
|
34
|
+
Summary:`)),console.log(` Total Records: ${r.cyan(c)}`)),"domains"in e&&Array.isArray(e.domains)&&e.domains.length>0&&(c||console.log(r.blue(`
|
|
35
|
+
Summary:`)),console.log(` Domains: ${r.cyan(e.domains.join(", "))}`)),"rvfStatus"in e){let a=e.rvfStatus;console.log(r.blue(`
|
|
36
|
+
RVF Details:`)),console.log(` File Size: ${r.cyan(xe(a.fileSizeBytes))}`),console.log(` Vectors: ${r.cyan(a.totalVectors)}`),console.log(` Segments: ${r.cyan(a.totalSegments)}`)}if("lineage"in e){let a=e.lineage;a&&(console.log(r.blue(`
|
|
37
|
+
Lineage:`)),console.log(` File ID: ${r.cyan(a.fileId)}`),console.log(` Parent ID: ${r.cyan(a.parentId??"none (root)")}`),console.log(` Depth: ${r.cyan(a.lineageDepth)}`))}if("signature"in e){let a=e.signature,d=e.signerKeyId;console.log(r.blue(`
|
|
38
|
+
Signature:`)),a?(console.log(` Status: ${r.green("Signed")}`),console.log(` Key ID: ${r.cyan(d??"unknown")}`),console.log(` Signature: ${r.gray(a.slice(0,32)+"...")}`)):console.log(` Status: ${r.yellow("Unsigned")}`)}console.log(`
|
|
39
|
+
Checksum: ${r.gray(e.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
|
|
40
|
+
Failed to read brain info:`),o),await this.cleanupAndExit(1)}}async executeWitnessBackfill(t){try{console.log(r.blue(`
|
|
41
|
+
Running witness chain backfill...
|
|
42
|
+
`));let o=await ne(t.db),e=await Ee(o);console.log(r.green(" Backfill complete.")),console.log(` Created: ${r.cyan(e.created)} new witness entries`),console.log(` Skipped: ${r.cyan(e.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(o){console.error(r.red(`
|
|
43
|
+
Witness backfill failed:`),o),await this.cleanupAndExit(1)}}getHelp(){return`
|
|
44
|
+
Export, import, and inspect QE brain state.
|
|
45
|
+
|
|
46
|
+
Formats:
|
|
47
|
+
rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
|
|
48
|
+
jsonl \u2014 JSONL directory format (fallback when native not available)
|
|
49
|
+
|
|
50
|
+
Usage:
|
|
51
|
+
aqe brain export -o brain.rvf [--format rvf] [--db <path>]
|
|
52
|
+
aqe brain export -o ./brain-dir --format jsonl [--db <path>]
|
|
53
|
+
aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
|
|
54
|
+
aqe brain info -i brain.rvf
|
|
55
|
+
|
|
56
|
+
Subcommands:
|
|
57
|
+
export Export brain state to a portable .rvf file or JSONL directory
|
|
58
|
+
import Import a brain export into the local database
|
|
59
|
+
info Show manifest metadata for an existing brain export
|
|
60
|
+
|
|
61
|
+
Examples:
|
|
62
|
+
aqe brain export -o .agentic-qe/brain.rvf
|
|
63
|
+
aqe brain export -o .agentic-qe/brain.rvf --format rvf
|
|
64
|
+
aqe brain export -o ./brain-export --format jsonl
|
|
65
|
+
aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
|
|
66
|
+
aqe brain import -i .agentic-qe/brain.rvf --dry-run
|
|
67
|
+
aqe brain info -i .agentic-qe/brain.rvf
|
|
68
|
+
`}};async function ne(n){if(n)return n;let{findProjectRoot:t}=await import("./unified-memory-72SKVZ7Y.js");return T.join(t(),".agentic-qe","memory.db")}function xe(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function lt(n,t){return new re(n,t)}export{re as BrainHandler,lt as createBrainHandler};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
|
|
2
|
+
import"./chunk-YXCU4CJX.js";var f=class{language;constructor(e="typescript"){this.language=e}enumerate(e,s){let r=[],n=e.split(`
|
|
3
3
|
`),l=!1;for(let i=0;i<n.length;i++){let d=n[i],t=d.trim(),c=i+1,u=d.length-d.trimStart().length+1;if(l){t.includes("*/")&&(l=!1);continue}if(t.startsWith("/*")){l=!t.includes("*/");continue}if(t.startsWith("//"))continue;if(/^\s*if\s*\(/.test(d)&&(this.findMatchingElse(n,i)||r.push({file:s,line:c,column:u,language:this.language,construct:"if-without-else",triggerCondition:"when condition is false",currentHandling:"falls through \u2014 no else branch",suggestedGuard:"Add else branch or document why falsy path is safe",severity:"medium"})),/^\s*switch\s*\(/.test(d)){let a=this.extractBlock(n,i);if(a&&!a.includes("default:")&&!a.includes("default :")&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-no-default",triggerCondition:"when value matches no case",currentHandling:"falls through \u2014 no default case",suggestedGuard:"Add default case with error handling or exhaustive check",severity:"high"}),a){let g=a.match(/case\s+[^:]+:/g)||[],h=a.match(/\b(break|return|throw|continue)\b/g)||[];g.length>0&&h.length<g.length&&r.push({file:s,line:c,column:u,language:this.language,construct:"switch-missing-break",triggerCondition:"when case falls through to next case",currentHandling:"fall-through \u2014 may execute unintended cases",suggestedGuard:"Add break/return to each case or add explicit // falls through comment",severity:"medium"})}}if(/\bcatch\s*\(/.test(t)||/\bcatch\s*\{/.test(t)){let a=this.extractBlock(n,i);if(a!==null){let g=a.replace(/[{}]/g,"").trim();(g.length===0||/^\s*\/\//.test(g))&&r.push({file:s,line:c,column:u,language:this.language,construct:"try-empty-catch",triggerCondition:"when exception is thrown",currentHandling:"exception silently swallowed",suggestedGuard:"Log the error or rethrow with context",severity:"high"})}}if(/\btry\s*\{/.test(t)&&this.extractBlock(n,i)&&(n.slice(i,Math.min(i+30,n.length)).join(`
|
|
4
4
|
`).includes("finally")||r.push({file:s,line:c,column:u,language:this.language,construct:"try-no-finally",triggerCondition:"when cleanup is needed regardless of success/failure",currentHandling:"no finally block \u2014 cleanup may be skipped on exception",suggestedGuard:"Add finally block for resource cleanup if applicable",severity:"low"})),t.includes("?.")){let a=t.match(/(\w+(?:\.\w+)*)\?\./g)||[];for(let g of a)if(!t.includes("??")&&!t.includes("|| ")&&!t.includes("if")){r.push({file:s,line:c,column:u,language:this.language,construct:"optional-chaining-null-path",triggerCondition:`when ${g.replace("?.","")} is null/undefined`,currentHandling:"returns undefined \u2014 may propagate",suggestedGuard:"Add ?? fallback or explicit null check",severity:"low"});break}}if(t.includes("??")&&!t.includes("?.")&&r.push({file:s,line:c,column:u,language:this.language,construct:"nullish-coalescing-fallback",triggerCondition:"when left side is null/undefined",currentHandling:"uses fallback value",suggestedGuard:"Verify fallback value is appropriate for all null cases",severity:"low"}),/\.\s*then\s*\(/.test(t)&&!t.includes(".catch")&&!t.includes("await")){let a=n.slice(i,Math.min(i+5,n.length)).join(" ");!a.includes(".catch")&&!a.includes("try")&&r.push({file:s,line:c,column:u,language:this.language,construct:"promise-no-catch",triggerCondition:"when promise rejects",currentHandling:"unhandled rejection \u2014 may crash process",suggestedGuard:"Add .catch() handler or use try/catch with await",severity:"high"})}let p=["map","filter","reduce","forEach","find","some","every","flatMap"];for(let a of p)if(new RegExp(`\\.${a}\\s*\\(`).test(t)){let h=n.slice(Math.max(0,i-3),i).join(" ");if(!h.includes(".length")&&!h.includes("if (")&&!h.includes("?.")){r.push({file:s,line:c,column:u,language:this.language,construct:"array-callback-empty",triggerCondition:`when array is empty before .${a}()`,currentHandling:a==="reduce"?"may throw without initial value":"returns empty result \u2014 may cause downstream issues",suggestedGuard:a==="reduce"?"Provide initial value or check array length":"Check array length or handle empty result",severity:a==="reduce"?"high":"low"});break}}/\|\|\s*['"`\d]/.test(t)&&!t.includes("??")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-or-falsy",triggerCondition:'when left side is falsy (0, "", false, null, undefined)',currentHandling:'uses fallback \u2014 may unintentionally override 0, "", or false',suggestedGuard:"Use ?? instead of || if only null/undefined should trigger fallback",severity:"medium"}),/&&\s*\w+\s*\(/.test(t)&&!t.includes("if")&&!t.includes("while")&&r.push({file:s,line:c,column:u,language:this.language,construct:"logical-and-short-circuit",triggerCondition:"when left side is falsy \u2014 right side never executes",currentHandling:"short-circuits \u2014 function call skipped silently",suggestedGuard:"Use explicit if-statement for clarity when side effects matter",severity:"low"}),(t.match(/\?/g)||[]).length>=2&&t.includes(":")&&r.push({file:s,line:c,column:u,language:this.language,construct:"ternary-complex",triggerCondition:"when nested ternary conditions interact",currentHandling:"nested ternary \u2014 hard to read and maintain",suggestedGuard:"Refactor to if/else or switch for readability",severity:"medium"}),(/\btypeof\s+\w+\s*===?\s*['"]/.test(t)||/\binstanceof\b/.test(t))&&!t.includes("else")&&!this.findMatchingElse(n,i)&&r.push({file:s,line:c,column:u,language:this.language,construct:"type-guard-unhandled",triggerCondition:"when value does not match the guarded type",currentHandling:"unguarded type path \u2014 may cause runtime type errors",suggestedGuard:"Add else branch or exhaustive type checking",severity:"medium"})}return r}findMatchingElse(e,s){let r={depth:0};for(let n=s;n<Math.min(s+30,e.length);n++){let l=e[n];for(let i of l)i==="{"&&r.depth++,i==="}"&&r.depth--;if(r.depth===0&&n>s){if((e[n+1]?.trim()||"").startsWith("else")||e[n].trim().endsWith("else")||e[n].trim().endsWith("else {")||e[n].includes("} else"))return!0;break}}return!1}extractBlock(e,s){let r=0,n=!1,l=[];for(let i=s;i<Math.min(s+50,e.length);i++){let d=e[i];for(let t of d)t==="{"&&(r++,n=!0),t==="}"&&r--;if(n&&(l.push(d),r===0))return l.join(`
|
|
5
5
|
`)}return null}};function y(o,e,s){let r=Date.now(),n=s||(e.endsWith(".ts")||e.endsWith(".tsx")?"typescript":"javascript"),i=new f(n).enumerate(o,e);return{file:e,language:n,branches:i,totalConstructs:i.length,unhandledCount:i.length,duration:Date.now()-r}}function b(o){let e=[];if(e.push(`# Branch Enumeration Report: ${o.file}`),e.push(""),e.push(`**Language**: ${o.language} | **Branches**: ${o.unhandledCount} | **Duration**: ${o.duration}ms`),e.push(""),o.branches.length===0)return e.push("No unhandled branches detected."),e.join(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.
|
|
2
|
-
import{a as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.9.2");process.exit(0)}
|
|
2
|
+
import{a as p}from"./chunk-4LA7IW3V.js";import"./chunk-YXCU4CJX.js";import{readFile as m,readdir as k}from"fs/promises";import{join as c,basename as y}from"path";import{parse as d}from"yaml";var l=class{templatesDir;cache=new Map;constructor(r){this.templatesDir=r||c(__dirname,"templates")}async load(r){if(this.cache.has(r))return this.cache.get(r);try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n),i=await this.validate(o);if(!i.valid)throw new Error(`Invalid workflow template ${r}:
|
|
3
3
|
${i.errors.join(`
|
|
4
4
|
`)}`);return this.cache.set(r,o),o}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}async list(){try{return(await k(this.templatesDir)).filter(e=>e.endsWith(".yaml")||e.endsWith(".yml")).map(e=>y(e,e.endsWith(".yaml")?".yaml":".yml")).sort()}catch(r){if(r.code==="ENOENT")return[];throw r}}async validate(r){let e=[],n=[];if(r.name||e.push("Workflow must have a name"),r.version||e.push("Workflow must have a version"),r.description||n.push("Workflow should have a description"),Array.isArray(r.variables)?r.variables.forEach((o,i)=>{o.name||e.push(`Variable at index ${i} must have a name`),o.type||e.push(`Variable ${o.name} must have a type`),o.required===void 0&&n.push(`Variable ${o.name} should specify if it's required`)}):e.push("Workflow must have a variables array"),!Array.isArray(r.steps))e.push("Workflow must have a steps array");else if(r.steps.length===0)e.push("Workflow must have at least one step");else{r.steps.forEach((t,s)=>{t.name||e.push(`Step at index ${s} must have a name`),t.action||e.push(`Step ${t.name||s} must have an action`),(!t.config||typeof t.config!="object")&&e.push(`Step ${t.name||s} must have a config object`),t.assertions&&Array.isArray(t.assertions)&&t.assertions.forEach((f,u)=>{f.condition||e.push(`Assertion ${u} in step ${t.name||s} must have a condition`),f.message||n.push(`Assertion ${u} in step ${t.name||s} should have a message`)})});let o=r.steps.map(t=>t.name),i=o.filter((t,s)=>o.indexOf(t)!==s);i.length>0&&e.push(`Duplicate step names found: ${i.join(", ")}`)}return{valid:e.length===0,errors:e,warnings:n}}async createContext(r,e){let n=await this.load(r),o=n.variables.filter(t=>t.required&&!(t.name in e)).map(t=>t.name);if(o.length>0)throw new Error(`Missing required variables: ${o.join(", ")}`);let i={};return n.variables.forEach(t=>{t.name in e?i[t.name]=e[t.name]:"default"in t&&(i[t.name]=t.default)}),{variables:i,results:new Map,metadata:{startTime:Date.now(),workflow:n.name,templateName:r}}}async getMetadata(r){try{let e=c(this.templatesDir,`${r}.yaml`),n=await m(e,"utf-8"),o=d(n);return{name:o.name,version:o.version,description:o.description}}catch(e){throw e.code==="ENOENT"?new Error(`Workflow template not found: ${r}`):e}}clearCache(){this.cache.clear()}async reload(r){return this.cache.delete(r),this.load(r)}},W=new l;function w(a,r){return a.replace(/\{\{([^}]+)\}\}/g,(e,n)=>{let i=n.trim().split("."),t=r;for(let s of i)if(t&&typeof t=="object"&&s in t)t=t[s];else return e;return t!=null?String(t):e})}function v(a,r){let e={...r.variables,result:r.results.get("__last_result__")},n=w(a,e);return p(n,e,!1)}var g=["login-flow","oauth-flow","scraping-workflow","visual-regression","form-validation","navigation-flow","api-integration","performance-audit","accessibility-audit"],b={"login-flow":"Authentication testing workflow for login forms with credential validation","oauth-flow":"OAuth2/OIDC authentication testing workflow with provider integration","scraping-workflow":"Data extraction workflow for web scraping with pagination and structured output","visual-regression":"Screenshot comparison workflow for visual regression testing across breakpoints","form-validation":"Input validation testing workflow for form fields with error handling","navigation-flow":"Multi-page navigation workflow for testing user journeys and state persistence","api-integration":"Browser-API hybrid testing workflow for validating frontend-backend integration","performance-audit":"Lighthouse-style performance audit workflow with Core Web Vitals","accessibility-audit":"WCAG 2.1 Level AA compliance audit workflow with automated accessibility testing"},h={authentication:["login-flow","oauth-flow"],testing:["form-validation","navigation-flow","api-integration"],quality:["visual-regression","performance-audit","accessibility-audit"],automation:["scraping-workflow"]};function R(a){return h[a]}function S(a){return g.includes(a)}function $(){return g.map(a=>{let r=Object.entries(h).find(([e,n])=>n.includes(a))?.[0]||"other";return{name:a,description:b[a],category:r}})}export{h as WORKFLOW_CATEGORIES,b as WORKFLOW_DESCRIPTIONS,g as WORKFLOW_TEMPLATES,l as WorkflowLoader,W as defaultWorkflowLoader,v as evaluateCondition,$ as getAllWorkflowTemplates,R as getWorkflowsByCategory,w as interpolateVariables,S as isValidWorkflowTemplate};
|
|
@@ -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.2");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-XH53ARZD.js";import"./chunk-AA33R5U4.js";import"./chunk-3GZKAORV.js";import"./chunk-GK72GUHA.js";import"./chunk-SNVM4YJS.js";import"./chunk-XIBVVZGB.js";import"./chunk-JOVINE23.js";import"./chunk-N3F3CX4V.js";import"./chunk-SDTVHR63.js";import"./chunk-E25S5E2D.js";import"./chunk-XYJL6DKI.js";import"./chunk-L5YEPSDU.js";import"./chunk-KNVAAVHH.js";import"./chunk-34U7JDCN.js";import"./chunk-MN742FIH.js";import"./chunk-4DAOZQ3V.js";import"./chunk-LCAA6H4J.js";import"./chunk-727BDQ3K.js";import"./chunk-DBE34QES.js";import"./chunk-YXCU4CJX.js";export{a as BrowserWorkflowTool};
|
|
@@ -0,0 +1,79 @@
|
|
|
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");process.exit(0)}
|
|
2
|
+
import{i as c}from"./chunk-TKF447CW.js";import{a as p}from"./chunk-XIBVVZGB.js";import{c as m}from"./chunk-JOVINE23.js";import{b as g,d as E}from"./chunk-N3F3CX4V.js";import{a as l,b as _}from"./chunk-XYJL6DKI.js";_();import b from"node:path";import{existsSync as h}from"node:fs";E();p();var T=m.create("metrics-tracker"),d=class{db=null;dbPath;initialized=!1;constructor(e=process.cwd()){this.dbPath=b.join(e,".agentic-qe","memory.db")}async initialize(){if(!this.initialized){if(!h(this.dbPath))throw new Error(`Database not found: ${this.dbPath}. Run "aqe init --auto" first.`);this.db=l(this.dbPath),this.ensureMetricsTable(),this.initialized=!0}}ensureMetricsTable(){this.db&&this.db.exec(`
|
|
3
|
+
CREATE TABLE IF NOT EXISTS learning_daily_snapshots (
|
|
4
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
5
|
+
snapshot_date TEXT NOT NULL UNIQUE,
|
|
6
|
+
total_patterns INTEGER DEFAULT 0,
|
|
7
|
+
patterns_created_today INTEGER DEFAULT 0,
|
|
8
|
+
total_experiences INTEGER DEFAULT 0,
|
|
9
|
+
experiences_today INTEGER DEFAULT 0,
|
|
10
|
+
total_q_values INTEGER DEFAULT 0,
|
|
11
|
+
avg_reward REAL DEFAULT 0.0,
|
|
12
|
+
avg_confidence REAL DEFAULT 0.0,
|
|
13
|
+
avg_quality_score REAL DEFAULT 0.0,
|
|
14
|
+
success_rate REAL DEFAULT 0.0,
|
|
15
|
+
pattern_reuse_count INTEGER DEFAULT 0,
|
|
16
|
+
short_term_patterns INTEGER DEFAULT 0,
|
|
17
|
+
long_term_patterns INTEGER DEFAULT 0,
|
|
18
|
+
domain_coverage_json TEXT,
|
|
19
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
20
|
+
);
|
|
21
|
+
CREATE INDEX IF NOT EXISTS idx_learning_daily_snapshots_date ON learning_daily_snapshots(snapshot_date DESC);
|
|
22
|
+
`)}async getCurrentMetrics(){if(this.initialized||await this.initialize(),!this.db)throw new Error("Database not initialized");let e=new Date().toISOString().split("T")[0],r=new Date(Date.now()-10080*60*1e3).toISOString().split("T")[0],a=this.getPatternStats(e),t=this.getExperienceStats(e),s=this.getQValueStats(),o=this.getDomainCoverage(),n=this.getHistoricalAvgReward(r);return{timestamp:new Date,totalPatterns:a.total,patternsCreatedToday:a.createdToday,totalExperiences:t.total,experiencesToday:t.recordedToday,totalQValues:s.total,avgReward:t.avgReward,avgRewardDelta:t.avgReward-n,domainCoverage:o,patternReuseCount:a.reuseCount,shortTermPatterns:a.shortTerm,longTermPatterns:a.longTerm,avgConfidence:a.avgConfidence,avgQualityScore:a.avgQualityScore,successRate:t.successRate}}getPatternStats(e){if(!this.db)return{total:0,createdToday:0,shortTerm:0,longTerm:0,avgConfidence:0,avgQualityScore:0,reuseCount:0};if(!this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{total:0,createdToday:0,shortTerm:0,longTerm:0,avgConfidence:0,avgQualityScore:0,reuseCount:0};let a=this.db.prepare(`
|
|
23
|
+
SELECT
|
|
24
|
+
COUNT(*) as total,
|
|
25
|
+
SUM(CASE WHEN date(created_at) = ? THEN 1 ELSE 0 END) as created_today,
|
|
26
|
+
SUM(CASE WHEN tier = 'short-term' THEN 1 ELSE 0 END) as short_term,
|
|
27
|
+
SUM(CASE WHEN tier = 'long-term' THEN 1 ELSE 0 END) as long_term,
|
|
28
|
+
AVG(confidence) as avg_confidence,
|
|
29
|
+
AVG(quality_score) as avg_quality_score,
|
|
30
|
+
SUM(usage_count) as total_usage
|
|
31
|
+
FROM qe_patterns
|
|
32
|
+
`).get(e);return{total:a.total||0,createdToday:a.created_today||0,shortTerm:a.short_term||0,longTerm:a.long_term||0,avgConfidence:a.avg_confidence||0,avgQualityScore:a.avg_quality_score||0,reuseCount:a.total_usage||0}}getExperienceStats(e){if(!this.db)return{total:0,recordedToday:0,avgReward:0,successRate:0};if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='captured_experiences'").get()){let t=this.db.prepare(`
|
|
33
|
+
SELECT
|
|
34
|
+
COUNT(*) as total,
|
|
35
|
+
SUM(CASE WHEN date(started_at) = ? THEN 1 ELSE 0 END) as recorded_today,
|
|
36
|
+
AVG(quality) as avg_reward,
|
|
37
|
+
AVG(CASE WHEN success = 1 THEN 1.0 ELSE 0.0 END) as success_rate
|
|
38
|
+
FROM captured_experiences
|
|
39
|
+
WHERE agent != 'cli-hook'
|
|
40
|
+
`).get(e);return{total:t.total||0,recordedToday:t.recorded_today||0,avgReward:t.avg_reward||0,successRate:t.success_rate||0}}if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_usage'").get()){let t=this.db.prepare(`
|
|
41
|
+
SELECT
|
|
42
|
+
COUNT(*) as total,
|
|
43
|
+
SUM(CASE WHEN date(created_at) = ? THEN 1 ELSE 0 END) as recorded_today,
|
|
44
|
+
AVG(success) as success_rate
|
|
45
|
+
FROM qe_pattern_usage
|
|
46
|
+
`).get(e);return{total:t.total||0,recordedToday:t.recorded_today||0,avgReward:t.success_rate||0,successRate:t.success_rate||0}}return{total:0,recordedToday:0,avgReward:0,successRate:0}}getQValueStats(){return this.db?this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='rl_q_values'").get()?{total:this.db.prepare(`
|
|
47
|
+
SELECT COUNT(*) as total FROM rl_q_values
|
|
48
|
+
`).get().total||0}:{total:0}:{total:0}}getDomainCoverage(){let e={};for(let t of c)e[t]=0;if(!this.db||!this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return e;let a=this.db.prepare(`
|
|
49
|
+
SELECT qe_domain, COUNT(*) as count
|
|
50
|
+
FROM qe_patterns
|
|
51
|
+
GROUP BY qe_domain
|
|
52
|
+
`).all();for(let t of a)c.includes(t.qe_domain)&&(e[t.qe_domain]=t.count);return e}getHistoricalAvgReward(e){return this.db&&this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='captured_experiences'").get()&&this.db.prepare(`
|
|
53
|
+
SELECT AVG(quality) as avg_reward
|
|
54
|
+
FROM captured_experiences
|
|
55
|
+
WHERE started_at <= datetime(?)
|
|
56
|
+
AND agent != 'cli-hook'
|
|
57
|
+
`).get(e+" 23:59:59")?.avg_reward||0}async getDashboardData(){this.initialized||await this.initialize();let e=await this.getCurrentMetrics(),r=await this.getMetricsHistory(7),a=r.map(n=>n.patternsCreatedToday),t=r.map(n=>n.experiencesToday),s=r.map(n=>n.avgReward),o=Object.entries(e.domainCoverage).filter(([n,i])=>i>0).sort((n,i)=>i[1]-n[1]).slice(0,5).map(([n,i])=>({domain:n,count:i}));return{current:e,history:r,trends:{patternsPerDay:a,experiencesPerDay:t,avgRewardPerDay:s},topDomains:o}}async getMetricsHistory(e){if(this.initialized||await this.initialize(),!this.db)return[];let r=[];if(!this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='learning_daily_snapshots'").get())return[];let t=this.db.prepare(`
|
|
58
|
+
SELECT *
|
|
59
|
+
FROM learning_daily_snapshots
|
|
60
|
+
ORDER BY snapshot_date DESC
|
|
61
|
+
LIMIT ?
|
|
62
|
+
`).all(e);for(let s of t){let o={};try{o=g(s.domain_coverage_json||"{}")}catch(n){T.debug("Domain coverage JSON parse failed",{error:n instanceof Error?n.message:String(n)});for(let i of c)o[i]=0}r.push({timestamp:new Date(s.snapshot_date),totalPatterns:s.total_patterns,patternsCreatedToday:s.patterns_created_today,totalExperiences:s.total_experiences,experiencesToday:s.experiences_today,totalQValues:s.total_q_values,avgReward:s.avg_reward,avgRewardDelta:0,domainCoverage:o,patternReuseCount:s.pattern_reuse_count,shortTermPatterns:s.short_term_patterns,longTermPatterns:s.long_term_patterns,avgConfidence:s.avg_confidence,avgQualityScore:s.avg_quality_score,successRate:s.success_rate})}return r}async saveSnapshot(){if(this.initialized||await this.initialize(),!this.db)throw new Error("Database not initialized");let e=await this.getCurrentMetrics(),r=new Date().toISOString().split("T")[0];this.db.prepare(`
|
|
63
|
+
INSERT OR REPLACE INTO learning_daily_snapshots (
|
|
64
|
+
snapshot_date,
|
|
65
|
+
total_patterns,
|
|
66
|
+
patterns_created_today,
|
|
67
|
+
total_experiences,
|
|
68
|
+
experiences_today,
|
|
69
|
+
total_q_values,
|
|
70
|
+
avg_reward,
|
|
71
|
+
avg_confidence,
|
|
72
|
+
avg_quality_score,
|
|
73
|
+
success_rate,
|
|
74
|
+
pattern_reuse_count,
|
|
75
|
+
short_term_patterns,
|
|
76
|
+
long_term_patterns,
|
|
77
|
+
domain_coverage_json
|
|
78
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
79
|
+
`).run(r,e.totalPatterns,e.patternsCreatedToday,e.totalExperiences,e.experiencesToday,e.totalQValues,e.avgReward,e.avgConfidence,e.avgQualityScore,e.successRate,e.patternReuseCount,e.shortTermPatterns,e.longTermPatterns,JSON.stringify(e.domainCoverage))}async getDashboardDataWithRegret(e){let r=await this.getDashboardData();return e&&e.length>0&&(r.regretHealth=e),r}async collectUnifiedSnapshot(){this.initialized||await this.initialize();let e=await this.getCurrentMetrics();return{timestamp:Date.now(),tokenMetrics:{totalTokens:0,costUsd:0,savingsUsd:0,cacheHitRate:0},qualityMetrics:{gatePassRate:e.successRate,averageScore:e.avgQualityScore,ratchetLevel:0},learningMetrics:{patternCount:e.totalPatterns,averageConfidence:e.avgConfidence,quarantinedCount:0,transferSuccessRate:0},performanceMetrics:{avgLatencyMs:0,p95LatencyMs:0,errorRate:0}}}close(){this.db&&(this.db.close(),this.db=null,this.initialized=!1)}};function C(u){return new d(u)}export{d as a,C as b};
|