agentic-qe 3.11.4 → 3.11.5
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/hooks/aqe-hook.cjs +44 -10
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +58 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +25 -0
- package/dist/audit/witness-chain.js +69 -22
- package/dist/audit/witness-key-manager.d.ts +11 -0
- package/dist/audit/witness-key-manager.js +24 -0
- package/dist/cli/brain-commands.js +2 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-KNM5R47J.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-62I6ZNRW.js → agent-booster-wasm-CSTBLNYZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-E2TZKKBS.js → agent-handler-M4W4GTXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-JHAHC2NH.js → agent-memory-branch-VGXFYLSQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-MXPJLVR3.js +2 -0
- package/dist/cli/chunks/{arena-72ZV65BR.js → arena-FKSD3LLM.js} +4 -4
- package/dist/cli/chunks/{arena-KLG3YSSR.js → arena-IQBRGWAG.js} +2 -2
- package/dist/cli/chunks/audit-7NSGRR4Z.js +3 -0
- package/dist/cli/chunks/base-X4EXQ2AS.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-LAFK5QZ4.js → better-sqlite3-2KR4LQRU.js} +2 -2
- package/dist/cli/chunks/brain-handler-M6A3UB66.js +89 -0
- package/dist/cli/chunks/{branch-enumerator-C7MPNYT7.js → branch-enumerator-2JGKY4BB.js} +2 -2
- package/dist/cli/chunks/{browser-UUDUDYLR.js → browser-J43WQPJL.js} +2 -2
- package/dist/cli/chunks/browser-workflow-4HX6RP5F.js +2 -0
- package/dist/cli/chunks/{chunk-UJMTKXPI.js → chunk-26WEI3P4.js} +2 -2
- package/dist/cli/chunks/{chunk-TQ373GGI.js → chunk-2XPMATEK.js} +2 -2
- package/dist/cli/chunks/{chunk-QJ5NCYJ3.js → chunk-2XQHG56O.js} +2 -2
- package/dist/cli/chunks/{chunk-EONKMHKO.js → chunk-354367AP.js} +2 -2
- package/dist/cli/chunks/{chunk-THKZVOZV.js → chunk-37ZUF5NX.js} +1 -1
- package/dist/cli/chunks/{chunk-5P7Q5YNC.js → chunk-3I4TCMOJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PQUXFSN6.js → chunk-3JF5A72M.js} +2 -2
- package/dist/cli/chunks/{chunk-B5XUWHKQ.js → chunk-3LY7OCSO.js} +1 -1
- package/dist/cli/chunks/{chunk-HJ24KMC2.js → chunk-3V36WMIO.js} +1 -1
- package/dist/cli/chunks/{chunk-6JUOH6L4.js → chunk-3WR35GFF.js} +2 -2
- package/dist/cli/chunks/{chunk-T76RFXQX.js → chunk-4LODYRNV.js} +2 -2
- package/dist/cli/chunks/{chunk-D5S47YUS.js → chunk-4MHN7JWC.js} +3 -3
- package/dist/cli/chunks/chunk-4QOI5JS7.js +14 -0
- package/dist/cli/chunks/{chunk-63QUN3JK.js → chunk-4RTWPR3X.js} +1 -1
- package/dist/cli/chunks/chunk-4XJ2A3HY.js +65 -0
- package/dist/cli/chunks/{chunk-KUZMVH6N.js → chunk-4Y3LGBKJ.js} +3 -3
- package/dist/cli/chunks/{chunk-JFLSQH2X.js → chunk-52U5BFZP.js} +2 -2
- package/dist/cli/chunks/{chunk-YNK6SUPU.js → chunk-53YOYZW5.js} +2 -2
- package/dist/cli/chunks/{chunk-O7PVZ32A.js → chunk-5WMU7XCF.js} +1 -1
- package/dist/cli/chunks/{chunk-ZKCKOQJI.js → chunk-62OTU2AP.js} +2 -2
- package/dist/cli/chunks/{chunk-3SKIZDKL.js → chunk-62UM7Q5N.js} +1 -1
- package/dist/cli/chunks/{chunk-SFDUT5WM.js → chunk-6Q57K4YD.js} +2 -2
- package/dist/cli/chunks/{chunk-3SBUL72V.js → chunk-6R3YOAKO.js} +2 -2
- package/dist/cli/chunks/chunk-6T65OKUM.js +2 -0
- package/dist/cli/chunks/{chunk-TCVEKRPI.js → chunk-7BCRULCP.js} +2 -2
- package/dist/cli/chunks/{chunk-VKJQAKYG.js → chunk-7DTMENY6.js} +2 -2
- package/dist/cli/chunks/{chunk-XQ6DW5FV.js → chunk-7KXPNNMR.js} +2 -2
- package/dist/cli/chunks/{chunk-N2BJN6AO.js → chunk-7P6X4BFO.js} +3 -3
- package/dist/cli/chunks/{chunk-SL3SNOO2.js → chunk-7YSBATSN.js} +2 -2
- package/dist/cli/chunks/{chunk-5U2WHPXL.js → chunk-ABU64UWB.js} +1 -1
- package/dist/cli/chunks/{chunk-4RHNPRAP.js → chunk-AF6P5RWY.js} +2 -2
- package/dist/cli/chunks/{chunk-4JFH3MVA.js → chunk-AGJOGUP5.js} +1 -1
- package/dist/cli/chunks/{chunk-5Z4FBCBK.js → chunk-AL5VJJN4.js} +1 -1
- package/dist/cli/chunks/{chunk-Z2REKBD6.js → chunk-AOQYORVA.js} +2 -2
- package/dist/cli/chunks/{chunk-X64BEXUY.js → chunk-AOXJFDH5.js} +117 -113
- package/dist/cli/chunks/{chunk-DRMHVY4T.js → chunk-AXKWV5NF.js} +4 -4
- package/dist/cli/chunks/{chunk-3FJZMQJ7.js → chunk-B2VBDMDI.js} +2 -2
- package/dist/cli/chunks/{chunk-ARPBG6FQ.js → chunk-BJLA2IX7.js} +2 -2
- package/dist/cli/chunks/{chunk-6W3QHS45.js → chunk-BLPWJQTY.js} +2 -2
- package/dist/cli/chunks/{chunk-O5NEJIHB.js → chunk-BTLUWH4R.js} +2 -2
- package/dist/cli/chunks/{chunk-Y4AXOHW4.js → chunk-C4EZNOWK.js} +1 -1
- package/dist/cli/chunks/{chunk-FRFVN6AA.js → chunk-C5C4W572.js} +2 -2
- package/dist/cli/chunks/{chunk-7AWK43JN.js → chunk-CDJP6COA.js} +2 -2
- package/dist/cli/chunks/{chunk-VJGHRWMH.js → chunk-CKOF27L7.js} +2 -2
- package/dist/cli/chunks/{chunk-3E7D3A35.js → chunk-D45QLJEL.js} +1 -1
- package/dist/cli/chunks/{chunk-MALOUGSF.js → chunk-DFRRWOEX.js} +2 -2
- package/dist/cli/chunks/{chunk-JDFPAJGB.js → chunk-DLBVADWQ.js} +92 -92
- package/dist/cli/chunks/{chunk-7IKWF2AD.js → chunk-DPL762HU.js} +1 -1
- package/dist/cli/chunks/{chunk-RFQBDMAP.js → chunk-DVW66FPU.js} +1 -1
- package/dist/cli/chunks/{chunk-JPENUVCI.js → chunk-EDOGRFAG.js} +1 -1
- package/dist/cli/chunks/{chunk-HWBMYR5W.js → chunk-EEKG35K5.js} +5 -5
- package/dist/cli/chunks/{chunk-WQZ2WRO4.js → chunk-EK3HPH6A.js} +1 -1
- package/dist/cli/chunks/{chunk-WZYNY3VF.js → chunk-FGD6HINU.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSBJNE35.js → chunk-FGSIID5C.js} +2 -2
- package/dist/cli/chunks/{chunk-TCWR6TDN.js → chunk-FHTYEAQ3.js} +2 -2
- package/dist/cli/chunks/{chunk-BRLUNIR4.js → chunk-FII3WCCY.js} +2 -2
- package/dist/cli/chunks/{chunk-VCUCD3B5.js → chunk-FIPKIIMS.js} +2 -2
- package/dist/cli/chunks/{chunk-6545AS2J.js → chunk-FMNXHVIN.js} +2 -2
- package/dist/cli/chunks/{chunk-VO6YJGB4.js → chunk-G2ZIJZJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-7ADD2ZQL.js → chunk-GODAWJMZ.js} +2 -2
- package/dist/cli/chunks/{chunk-AQIEK4SY.js → chunk-GW6XWMX2.js} +2 -2
- package/dist/cli/chunks/{chunk-GOQ4P2PB.js → chunk-HC6KTVFR.js} +2 -2
- package/dist/cli/chunks/{chunk-2KNFS3L5.js → chunk-HJWT4KME.js} +1 -1
- package/dist/cli/chunks/{chunk-NV3TXXOW.js → chunk-I3ANRYQ6.js} +2 -2
- package/dist/cli/chunks/{chunk-IQBZBUP5.js → chunk-I3NWKPXJ.js} +2 -2
- package/dist/cli/chunks/chunk-IBDQWKI3.js +2 -0
- package/dist/cli/chunks/{chunk-LW5DHT3Z.js → chunk-IU5RSN6M.js} +2 -2
- package/dist/cli/chunks/{chunk-XHRLBJTM.js → chunk-J5XDKVI7.js} +2 -2
- package/dist/cli/chunks/{chunk-QEVX4GWF.js → chunk-J6PFPY7V.js} +2 -2
- package/dist/cli/chunks/{chunk-AE6HXMOG.js → chunk-JATLFS6A.js} +1 -1
- package/dist/cli/chunks/{chunk-HJO4RNOW.js → chunk-JBKZ5TUM.js} +2 -2
- package/dist/cli/chunks/{chunk-7QTB5XIQ.js → chunk-JDSHUECG.js} +2 -2
- package/dist/cli/chunks/{chunk-GRQ36XUH.js → chunk-K4C25BWV.js} +2 -2
- package/dist/cli/chunks/{chunk-BMQDELPA.js → chunk-K4I7UIU5.js} +1 -1
- package/dist/cli/chunks/{chunk-AJXGGTX7.js → chunk-KP3R2M2G.js} +1 -1
- package/dist/cli/chunks/chunk-KQVIWE3W.js +2 -0
- package/dist/cli/chunks/{chunk-ZFCVT43J.js → chunk-KVVJVMDM.js} +2 -2
- package/dist/cli/chunks/{chunk-WMIRAD3J.js → chunk-LOE2JETO.js} +2 -2
- package/dist/cli/chunks/{chunk-54B6P2WS.js → chunk-LPR2R3AN.js} +3 -3
- package/dist/cli/chunks/{chunk-EZRHSHOQ.js → chunk-M6FW56MV.js} +2 -2
- package/dist/cli/chunks/{chunk-IF3HPQNV.js → chunk-MCHEUSY4.js} +1 -1
- package/dist/cli/chunks/{chunk-NBBLPDJX.js → chunk-MEIU7457.js} +2 -2
- package/dist/cli/chunks/{chunk-4BFCLSDN.js → chunk-MHMQ6MCT.js} +2 -2
- package/dist/cli/chunks/{chunk-UQ72K44T.js → chunk-MIU5RUBJ.js} +2 -2
- package/dist/cli/chunks/{chunk-LKURMUBU.js → chunk-MMEXHZUC.js} +37 -12
- package/dist/cli/chunks/{chunk-SRVTNG6L.js → chunk-MTBGOWJA.js} +2 -2
- package/dist/cli/chunks/{chunk-TPMBFARK.js → chunk-NCSXLMDL.js} +67 -22
- package/dist/cli/chunks/{chunk-TU6YN43Q.js → chunk-O7J54OHN.js} +1 -1
- package/dist/cli/chunks/{chunk-JCTCM6IR.js → chunk-OGNTCZKK.js} +1 -1
- package/dist/cli/chunks/{chunk-FSGMRQFC.js → chunk-OS2HHJTM.js} +2 -2
- package/dist/cli/chunks/{chunk-TSWF3AGQ.js → chunk-OS62Y77J.js} +2 -2
- package/dist/cli/chunks/{chunk-VQU7DMEY.js → chunk-PVDXNQPL.js} +2 -2
- package/dist/cli/chunks/{chunk-DNOU2HVQ.js → chunk-PW72M2FE.js} +2 -2
- package/dist/cli/chunks/{chunk-HH6NCBSP.js → chunk-Q5TR6ETB.js} +22 -22
- package/dist/cli/chunks/{chunk-PFWJQPUC.js → chunk-QKK7VBVB.js} +2 -2
- package/dist/cli/chunks/{chunk-JNQN5DNS.js → chunk-RFLHPLET.js} +1 -1
- package/dist/cli/chunks/{chunk-IB3ZPLFA.js → chunk-RJN2RM76.js} +2 -2
- package/dist/cli/chunks/{chunk-PEIQDQXN.js → chunk-RKXZLTWR.js} +2 -2
- package/dist/cli/chunks/{chunk-5VSQAGA2.js → chunk-SE3JFUKP.js} +1 -1
- package/dist/cli/chunks/{chunk-LMJUMUQJ.js → chunk-SK754ZSH.js} +4 -4
- package/dist/cli/chunks/{chunk-UCYTY4LG.js → chunk-SO6G4IX3.js} +2 -2
- package/dist/cli/chunks/{chunk-ICCTQ5LO.js → chunk-SUL3I6QZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G3TFNY4T.js → chunk-TBT3OFRW.js} +2 -2
- package/dist/cli/chunks/{chunk-AYGEWPN4.js → chunk-TEIWJ3GJ.js} +1 -1
- package/dist/cli/chunks/{chunk-YKSWC7I4.js → chunk-TRNBQFFG.js} +8 -20
- package/dist/cli/chunks/{chunk-NSPCZPTB.js → chunk-TTJJ4DQE.js} +2 -2
- package/dist/cli/chunks/{chunk-2WPSMQIL.js → chunk-UBI2EOS3.js} +1 -1
- package/dist/cli/chunks/{chunk-ADFKY3X2.js → chunk-UBY322ED.js} +2 -2
- package/dist/cli/chunks/{chunk-QSDIY3E2.js → chunk-UORTQXJ2.js} +1 -1
- package/dist/cli/chunks/{chunk-ODZSQVEW.js → chunk-URP75DL4.js} +1 -1
- package/dist/cli/chunks/{chunk-37ZDGJ3H.js → chunk-V6NAB5UZ.js} +1 -1
- package/dist/cli/chunks/{chunk-YZ5EQR37.js → chunk-VMFAANWX.js} +2 -2
- package/dist/cli/chunks/{chunk-NFJT7XXR.js → chunk-VMWRMINE.js} +1 -1
- package/dist/cli/chunks/{chunk-MCT4CD5M.js → chunk-VN2HHBZN.js} +2 -2
- package/dist/cli/chunks/{chunk-QMC5MTBV.js → chunk-W72FJA2H.js} +2 -2
- package/dist/cli/chunks/chunk-W7TYKPLY.js +27 -0
- package/dist/cli/chunks/{chunk-YUHM72VQ.js → chunk-WHHQIL4F.js} +2 -2
- package/dist/cli/chunks/{chunk-4YT5YN5G.js → chunk-WMZ2QGGS.js} +2 -2
- package/dist/cli/chunks/{chunk-Q7ORVHJB.js → chunk-WPSK237F.js} +3 -3
- package/dist/cli/chunks/{chunk-ZYZT2CDX.js → chunk-XKQY2Z3Q.js} +1 -1
- package/dist/cli/chunks/{chunk-WNMDWP5A.js → chunk-XLT3FYS7.js} +2 -2
- package/dist/cli/chunks/{chunk-U34OZXD6.js → chunk-XT4TDLOB.js} +2 -2
- package/dist/cli/chunks/{chunk-6GYGAW53.js → chunk-Y25PO65W.js} +2 -2
- package/dist/cli/chunks/{chunk-3SRPFBU7.js → chunk-Y6DWJKHU.js} +3 -3
- package/dist/cli/chunks/{chunk-D6CKKNYC.js → chunk-YBPLJRVT.js} +2 -2
- package/dist/cli/chunks/{chunk-LLUPRGOR.js → chunk-YFCULQBP.js} +2 -2
- package/dist/cli/chunks/{chunk-HT6WAYIR.js → chunk-YGVDP6X7.js} +1 -1
- package/dist/cli/chunks/{chunk-RCPD6F4R.js → chunk-YR2JKBZO.js} +2 -2
- package/dist/cli/chunks/{chunk-P6S6ZVB5.js → chunk-YZSTZUGJ.js} +1 -1
- package/dist/cli/chunks/{chunk-CNF3ZWLM.js → chunk-ZG5UAEEO.js} +2 -2
- package/dist/cli/chunks/{chunk-MWFJC5HR.js → chunk-ZLBY25MB.js} +1 -1
- package/dist/cli/chunks/chunk-ZMPAM4DY.js +2 -0
- package/dist/cli/chunks/{chunk-A4OMK3FO.js → chunk-ZPP57WQU.js} +2 -2
- package/dist/cli/chunks/{chunk-U3AVZGQA.js → chunk-ZXEWTZFR.js} +1 -1
- package/dist/cli/chunks/{ci-HQCRSCC7.js → ci-CBNVLOOQ.js} +2 -2
- package/dist/cli/chunks/{ci-output-YBVXLA6O.js → ci-output-I4HY2FYJ.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ULGMF2QN.js → circuit-breaker-5VRBKGWL.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-MKZ2LJXK.js → claude-flow-setup-XPJPKHIO.js} +2 -2
- package/dist/cli/chunks/client-AHXNCOHK.js +2 -0
- package/dist/cli/chunks/{cline-installer-WZQ6XBWN.js → cline-installer-OFRDUUWZ.js} +2 -2
- package/dist/cli/chunks/{code-H3KGH45S.js → code-QIZQVB3E.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-NUVEAJ7C.js → code-index-extractor-LMUUWEX4.js} +2 -2
- package/dist/cli/chunks/{codex-installer-JQI6E6CV.js → codex-installer-N2MKIZ2S.js} +2 -2
- package/dist/cli/chunks/{completions-NDF4PFE7.js → completions-Y36S3C5J.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-XCZH66HG.js → complexity-analyzer-73YS3WUD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-Z4AJGZ7S.js → continuedev-installer-SAOTP6J3.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-K4IPAL7C.js → copilot-installer-A4HXF6HE.js} +2 -2
- package/dist/cli/chunks/core-handlers-EEFLLMAZ.js +2 -0
- package/dist/cli/chunks/{cost-tracker-35KXAB23.js → cost-tracker-P26XUVZS.js} +2 -2
- package/dist/cli/chunks/{coverage-QW5I4TYZ.js → coverage-HVNHSMVJ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-LT3H4SNJ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-P4Z7RMIZ.js → cursor-installer-46BQFTYZ.js} +2 -2
- package/dist/cli/chunks/{daemon-WQWTCYBM.js → daemon-Y54O3FLT.js} +3 -3
- package/dist/cli/chunks/daemon-YE7K2AZF.js +10 -0
- package/dist/cli/chunks/{dag-attention-scheduler-7XD2VGON.js → dag-attention-scheduler-ETA7YY52.js} +2 -2
- package/dist/cli/chunks/{detect-GZ3P4DI7.js → detect-5WLQ2J3E.js} +2 -2
- package/dist/cli/chunks/{dist-node-6WWAW7OP.js → dist-node-45WW6I7J.js} +2 -2
- package/dist/cli/chunks/{domain-handler-3GTLWARQ.js → domain-handler-J7DQV74M.js} +2 -2
- package/dist/cli/chunks/domain-transfer-GD2EGQVR.js +2 -0
- package/dist/cli/chunks/dream-4K3BK4IG.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-BGIMA77V.js → embed-and-insert-pattern-JELNEA2D.js} +2 -2
- package/dist/cli/chunks/{eval-SXV6DRDD.js → eval-A4PA5G2U.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-TT6WCT2S.js → experience-capture-middleware-MLHTYWTA.js} +3 -3
- package/dist/cli/chunks/{fast-paths-HTAZHEQP.js → fast-paths-QYDTITRV.js} +2 -2
- package/dist/cli/chunks/{feature-flags-WBUKU54W.js → feature-flags-H4MSY26Z.js} +2 -2
- package/dist/cli/chunks/{feature-flags-DIE3Z2B4.js → feature-flags-MQYYRHIK.js} +2 -2
- package/dist/cli/chunks/{file-discovery-SKDETFS3.js → file-discovery-RMFVJNGL.js} +2 -2
- package/dist/cli/chunks/{fleet-WCWEPAVU.js → fleet-7KZQOTAC.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-KWZOWBYS.js → gnn-wrapper-NMZFTGVH.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-3AGYHVG2.js → heartbeat-handler-7BQDK7MG.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-IMPPGQUK.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-EIAA6R2L.js +2 -0
- package/dist/cli/chunks/hnsw-index-ZXXP6AXZ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-6OJJDZHL.js → hnsw-legacy-bridge-TPPGBPKF.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-URULPKRF.js → hnswlib-node-E6NSZPP2.js} +2 -2
- package/dist/cli/chunks/{hooks-OXEBTLXV.js → hooks-CYZIUYSH.js} +48 -52
- package/dist/cli/chunks/hybrid-router-LXWG4MLH.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-NL74PRHD.js → hypergraph-engine-WC6DMTYQ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-KZ54AEEL.js → hypergraph-handler-GTGA3TXJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-TP5LRFYH.js +2 -0
- package/dist/cli/chunks/{init-handler-XKZXRXPG.js → init-handler-N3Z72JNI.js} +6 -6
- package/dist/cli/chunks/init-wizard-AIOA5KOY.js +2 -0
- package/dist/cli/chunks/kernel-SQALRU6Q.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-WISQMJK7.js → kilocode-installer-FUX4V6II.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-O7TBB3GM.js → kiro-installer-ZSNZT7ZR.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JFVT6SNN.js +2 -0
- package/dist/cli/chunks/{learning-6IZBGVRU.js → learning-UQY64COU.js} +3 -3
- package/dist/cli/chunks/{llm-router-QDMQPPQ7.js → llm-router-CMHGGX6N.js} +4 -4
- package/dist/cli/chunks/llm-router-service-XHFKTH3I.js +2 -0
- package/dist/cli/chunks/{load-KLAJJGL5.js → load-E6WH4QN2.js} +2 -2
- package/dist/cli/chunks/load-test-JEIFJKNN.js +2 -0
- package/dist/cli/chunks/{mcp-SZOPQZIZ.js → mcp-UM5VTW6N.js} +2 -2
- package/dist/cli/chunks/{memory-G3WY74C6.js → memory-7Q3XDUE5.js} +5 -5
- package/dist/cli/chunks/memory-backend-NT7I37CP.js +2 -0
- package/dist/cli/chunks/memory-handlers-746D7NE7.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-TDNQGTOT.js → multi-model-executor-LZENWVRR.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-NGYGEDMV.js → opencode-installer-O2JAIPLF.js} +2 -2
- package/dist/cli/chunks/{orchestrator-KPI5DY2C.js → orchestrator-DKZWXDRI.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-6QU6WHDW.js +2 -0
- package/dist/cli/chunks/pattern-usage-recorder-CLUL4M55.js +2 -0
- package/dist/cli/chunks/{pipeline-CSDCC675.js → pipeline-2VDLTR5J.js} +2 -2
- package/dist/cli/chunks/{platform-Q5XKEVKH.js → platform-4N4Q5XYX.js} +2 -2
- package/dist/cli/chunks/{plugin-XKKR3GVL.js → plugin-GY5AU5CS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-22QVNKEN.js → prime-radiant-advanced-wasm-TQ4DKDZS.js} +2 -2
- package/dist/cli/chunks/protocol-executor-GT2MZYUU.js +2 -0
- package/dist/cli/chunks/{protocol-handler-REQKTJGG.js → protocol-handler-T3LZ3WRG.js} +2 -2
- package/dist/cli/chunks/{prove-NOFUFSQN.js → prove-OV7S5J4W.js} +2 -2
- package/dist/cli/chunks/provider-manager-OATJ7R3D.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-IJXNQ67O.js +2 -0
- package/dist/cli/chunks/{quality-3DQ2H5TK.js → quality-AXD4NLQA.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-6RBHWCUG.js +2 -0
- package/dist/cli/chunks/{real-embeddings-FCGNYWLL.js → real-embeddings-2PUCC7FG.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-HX3CNRIR.js → roocode-installer-WJ5ARGLW.js} +2 -2
- package/dist/cli/chunks/router-XKQRT5JK.js +2 -0
- package/dist/cli/chunks/routing-feedback-ACPSD4LW.js +2 -0
- package/dist/cli/chunks/{routing-handler-YRZ2LDCR.js → routing-handler-CU6657SZ.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GCQVBJ4E.js → ruvector-commands-IIF6VSFW.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-B562P3ZC.js → rvf-dual-writer-YMQI7XO2.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-NAGFKCMD.js → rvf-migration-adapter-HDE3PR2W.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-WWFBEJ5Q.js → rvf-migration-coordinator-MQV5OA7K.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-SIWRKE33.js +2 -0
- package/dist/cli/chunks/safe-db-LCPUYMX4.js +2 -0
- package/dist/cli/chunks/schedule-HIQJCWXG.js +2 -0
- package/dist/cli/chunks/scheduler-QE5EJ5LE.js +2 -0
- package/dist/cli/chunks/{security-IFOYTD75.js → security-UM3IGDSM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-TYD5TQ35.js → shared-rvf-adapter-I3SOJ6M4.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-YGOOVDQZ.js → shared-rvf-dual-writer-KQGC2UO7.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-EU54UTMH.js +2 -0
- package/dist/cli/chunks/status-handler-OX4CJZME.js +46 -0
- package/dist/cli/chunks/{structural-health-KZI6YMKV.js → structural-health-PYUMVBXJ.js} +2 -2
- package/dist/cli/chunks/{sync-Z5BDDBMK.js → sync-2TED3YTY.js} +2 -2
- package/dist/cli/chunks/{sync-ABZNNYRC.js → sync-VALFNTA6.js} +2 -2
- package/dist/cli/chunks/{task-handler-5ACZEPJ7.js → task-handler-VPGAJVPC.js} +2 -2
- package/dist/cli/chunks/{task-handlers-UZWDPL6A.js → task-handlers-IB4UAMU6.js} +3 -3
- package/dist/cli/chunks/{test-APO3MCVV.js → test-OMRJOZB6.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-EFZA5G5C.js → test-scheduling-ZL3YFPBU.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-J2OPLNUK.js → token-bootstrap-DNWZI7SH.js} +2 -2
- package/dist/cli/chunks/{token-usage-VHWVNN4R.js → token-usage-IYO7RGFF.js} +2 -2
- package/dist/cli/chunks/{transformers-PX4HPO75.js → transformers-53ALC34T.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-44HA2Z3F.js → tree-sitter-wasm-parser-WUKJ2I2Q.js} +2 -2
- package/dist/cli/chunks/{types-IMOP7F4R.js → types-47FTEPMV.js} +2 -2
- package/dist/cli/chunks/unified-memory-CJLMC2I4.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FDGR4D2J.js +2 -0
- package/dist/cli/chunks/unified-persistence-UFH5GLDN.js +2 -0
- package/dist/cli/chunks/{upgrade-OZ3O6ZZI.js → upgrade-QPLMJA5Z.js} +2 -2
- package/dist/cli/chunks/{validate-DRY5BMWX.js → validate-3GVKZOVF.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-QD3LYPUF.js → validate-swarm-XCRTLVM6.js} +2 -2
- package/dist/cli/chunks/{vibium-2J3H2ITD.js → vibium-CH4VPKVZ.js} +2 -2
- package/dist/cli/chunks/visual-security-4ARJ7J2Y.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-KRNUOGKI.js → web-tree-sitter-JDBNAZTV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-PQIPH3WP.js → windsurf-installer-3MNPVJBP.js} +2 -2
- package/dist/cli/chunks/witness-chain-73QC33ED.js +2 -0
- package/dist/cli/chunks/{witness-chain-HPLOYPS7.js → witness-chain-HR5UBV5J.js} +2 -2
- package/dist/cli/chunks/witness-key-manager-G5SQTIBZ.js +2 -0
- package/dist/cli/chunks/{workflow-OAQ3FWCY.js → workflow-43EMD5FY.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RKMMPXNA.js +2 -0
- package/dist/cli/chunks/{wrappers-UPIU6S5S.js → wrappers-3N7AYNM3.js} +2 -2
- package/dist/cli/commands/audit.d.ts +12 -0
- package/dist/cli/commands/audit.js +64 -4
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +45 -19
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +13 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +38 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.js +19 -1
- package/dist/cli/handlers/status-handler.d.ts +18 -0
- package/dist/cli/handlers/status-handler.js +47 -0
- package/dist/coordination/mincut/queen-integration.js +24 -7
- package/dist/coordination/protocol-executor.js +2 -1
- package/dist/coordination/queen-lifecycle.js +4 -1
- package/dist/domains/code-intelligence/coordinator.js +10 -6
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +3 -1
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +6 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +21 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +7 -0
- package/dist/domains/learning-optimization/plugin.js +5 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +10 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +57 -0
- package/dist/domains/test-execution/plugin.js +2 -2
- package/dist/domains/test-execution/services/flaky-detector.js +1 -1
- package/dist/domains/test-generation/coordinator.js +22 -8
- package/dist/domains/test-generation/interfaces.d.ts +3 -0
- package/dist/domains/test-generation/services/test-generator.js +9 -1
- package/dist/integrations/ruvector/delta-tracker.js +10 -1
- package/dist/integrations/ruvector/sona-persistence.d.ts +24 -0
- package/dist/integrations/ruvector/sona-persistence.js +76 -0
- package/dist/integrations/ruvector/sona-three-loop.d.ts +15 -0
- package/dist/integrations/ruvector/sona-three-loop.js +17 -0
- package/dist/kernel/unified-memory-schemas.d.ts +2 -2
- package/dist/kernel/unified-memory-schemas.js +48 -2
- package/dist/kernel/unified-memory.d.ts +22 -0
- package/dist/kernel/unified-memory.js +43 -0
- package/dist/learning/aqe-learning-engine.js +3 -1
- package/dist/learning/dream/concept-graph.d.ts +31 -1
- package/dist/learning/dream/concept-graph.js +109 -3
- package/dist/learning/dream/dream-engine.d.ts +13 -1
- package/dist/learning/dream/dream-engine.js +146 -10
- package/dist/learning/dream/index.d.ts +1 -1
- package/dist/learning/dream/types.d.ts +23 -0
- package/dist/learning/pattern-store.d.ts +2 -2
- package/dist/learning/pattern-store.js +14 -3
- package/dist/learning/qe-reasoning-bank.js +34 -31
- package/dist/learning/routing-topology-gate.d.ts +12 -2
- package/dist/learning/routing-topology-gate.js +15 -3
- package/dist/learning/rvf-pattern-store.d.ts +1 -1
- package/dist/learning/rvf-pattern-store.js +21 -8
- package/dist/learning/sqlite-persistence.js +12 -9
- package/dist/mcp/bundle.js +516 -442
- package/dist/mcp/qe-tool-bridge.js +7 -2
- package/dist/mcp/tools/base.d.ts +29 -0
- package/dist/mcp/tools/base.js +25 -0
- package/dist/mcp/tools/coverage-analysis/index.js +6 -4
- package/dist/mcp/tools/learning-optimization/dream.d.ts +4 -13
- package/dist/mcp/tools/learning-optimization/dream.js +10 -96
- package/dist/mcp/tools/planning/goap-execute.d.ts +13 -1
- package/dist/mcp/tools/planning/goap-execute.js +33 -18
- package/dist/mcp/tools/registry.js +7 -2
- package/dist/persistence/rvf-migration-coordinator.js +2 -1
- package/dist/planning/actions/qe-action-library.js +124 -1
- package/dist/planning/goap-planner.d.ts +14 -2
- package/dist/planning/goap-planner.js +51 -9
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/plan-executor.d.ts +84 -4
- package/dist/planning/plan-executor.js +221 -56
- package/dist/planning/types.d.ts +27 -0
- package/dist/shared/events/domain-events.d.ts +2 -0
- package/dist/workers/workers/learning-consolidation.js +21 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-2HMUXHWY.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-M2NKRVRE.js +0 -2
- package/dist/cli/chunks/audit-EPB7ETMT.js +0 -3
- package/dist/cli/chunks/base-CCHC2DAC.js +0 -2
- package/dist/cli/chunks/brain-handler-FBMYEERK.js +0 -89
- package/dist/cli/chunks/browser-workflow-4DGHFYY3.js +0 -2
- package/dist/cli/chunks/chunk-5AQ7FXYG.js +0 -27
- package/dist/cli/chunks/chunk-KYTFIP6R.js +0 -2
- package/dist/cli/chunks/chunk-MYMIEQSZ.js +0 -65
- package/dist/cli/chunks/chunk-XXRTWG7O.js +0 -2
- package/dist/cli/chunks/chunk-ZSA6V5FH.js +0 -2
- package/dist/cli/chunks/client-2OVEDWGU.js +0 -2
- package/dist/cli/chunks/core-handlers-UXRRYP52.js +0 -2
- package/dist/cli/chunks/cross-domain-router-PV3VQVLO.js +0 -2
- package/dist/cli/chunks/daemon-ESUEM6VB.js +0 -10
- package/dist/cli/chunks/domain-transfer-TQYO3SVG.js +0 -2
- package/dist/cli/chunks/dream-UFUXVJQC.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-MBG3SARO.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-5HXA3QB3.js +0 -2
- package/dist/cli/chunks/hnsw-index-PZRQWBRG.js +0 -2
- package/dist/cli/chunks/hybrid-router-NQRIE2GG.js +0 -2
- package/dist/cli/chunks/impact-analyzer-46347ZDV.js +0 -2
- package/dist/cli/chunks/init-wizard-CJYP4WKO.js +0 -2
- package/dist/cli/chunks/kernel-22KQZ56U.js +0 -2
- package/dist/cli/chunks/knowledge-graph-KM3JDBGR.js +0 -2
- package/dist/cli/chunks/llm-router-service-IFO6GRRO.js +0 -2
- package/dist/cli/chunks/load-test-TTKCYAPB.js +0 -2
- package/dist/cli/chunks/memory-backend-ELHCX2ZT.js +0 -2
- package/dist/cli/chunks/memory-handlers-3SKYQZTL.js +0 -2
- package/dist/cli/chunks/pattern-null-store-TMXAYD43.js +0 -2
- package/dist/cli/chunks/protocol-executor-BPLR5EJC.js +0 -2
- package/dist/cli/chunks/provider-manager-4MMD5QKL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-P7KNT3WZ.js +0 -2
- package/dist/cli/chunks/queen-coordinator-NBZZ4MGC.js +0 -2
- package/dist/cli/chunks/router-2RXR6J2Q.js +0 -2
- package/dist/cli/chunks/routing-feedback-AVAA76TK.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-X2YDJA55.js +0 -2
- package/dist/cli/chunks/safe-db-4PRU65BK.js +0 -2
- package/dist/cli/chunks/schedule-2AST5CHW.js +0 -2
- package/dist/cli/chunks/scheduler-SW6II7OU.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-OB5NEGAK.js +0 -2
- package/dist/cli/chunks/status-handler-HFPWSCBY.js +0 -45
- package/dist/cli/chunks/unified-memory-X7OJYGSD.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-O6HOD5YL.js +0 -2
- package/dist/cli/chunks/unified-persistence-C332CER2.js +0 -2
- package/dist/cli/chunks/visual-security-MPUG5HPI.js +0 -2
- package/dist/cli/chunks/witness-chain-Q4BZHPDF.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-4NDWECYK.js +0 -2
|
@@ -1,11 +1,11 @@
|
|
|
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.11.
|
|
2
|
-
import{d as z,f as ke}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.11.5");process.exit(0)}
|
|
2
|
+
import{d as z,f as ke}from"./chunk-IU5RSN6M.js";import{a as Ge}from"./chunk-ZMPAM4DY.js";import{c as te}from"./chunk-Y25PO65W.js";import{a as B,b,c as ze}from"./chunk-YFCULQBP.js";import{b as L,d as re}from"./chunk-CKOF27L7.js";import{a as j,c as qe}from"./chunk-TTJJ4DQE.js";import{a as D,c as Fe}from"./chunk-RKXZLTWR.js";import{a as ne,b as Pe}from"./chunk-FHTYEAQ3.js";import{a as se,d as X,e as oe,f as ie}from"./chunk-3JF5A72M.js";import{a as v,e as Me}from"./chunk-FIPKIIMS.js";import{c as h,e as xe}from"./chunk-C4EZNOWK.js";import{createHash as Te}from"node:crypto";function Be(o){let e=Buffer.alloc(8);return e.writeBigUInt64LE(BigInt(o)),e}function We(o){return typeof o=="string"?Buffer.from(o,"utf8"):o instanceof Uint8Array?Buffer.from(o):Buffer.from(W(o),"utf8")}function W(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?`[${o.map(W).join(",")}]`:`{${Object.keys(o).sort().map(t=>`${JSON.stringify(t)}:${W(o[t])}`).join(",")}}`}function de(...o){let e=Te("sha256");for(let t of o)e.update(t);return e.digest()}function ce(o,e,t){return de(je,o,e,Be(t))}var je,ae,I,Ee=h(()=>{"use strict";je=Buffer.from("ruvector:chain:"),ae=Te("sha256").update("ruvector-proof-gate-v1").digest();I=class o{seq=0;prev=ae;chain=[];payloadHashes=[];admit(e){let t=de(We(e)),n=ce(this.prev,t,this.seq);this.prev=n,this.chain.push(n),this.payloadHashes.push(t);let a={sequence:this.seq,payloadHash:t.toString("hex"),chainCommitment:n.toString("hex")};return this.seq+=1,a}verifyReceipt(e){return e.sequence>=0&&e.sequence<this.chain.length&&this.chain[e.sequence].toString("hex")===e.chainCommitment}chainRoot(){return this.prev.toString("hex")}get length(){return this.seq}get isEmpty(){return this.seq===0}verifyIntegrity(){if(this.chain.length!==this.payloadHashes.length)return!1;let e=ae;for(let t=0;t<this.chain.length;t++){if(!ce(e,this.payloadHashes[t],t).equals(this.chain[t]))return!1;e=this.chain[t]}return e.equals(this.prev)}toJSON(){return{seq:this.seq,head:this.prev.toString("hex"),chain:this.chain.map(e=>e.toString("hex")),payloadHashes:this.payloadHashes.map(e=>e.toString("hex"))}}static fromJSON(e){let t=new o;t.seq=e.seq,t.prev=Buffer.from(e.head,"hex");for(let n of e.chain)t.chain.push(Buffer.from(n,"hex"));for(let n of e.payloadHashes)t.payloadHashes.push(Buffer.from(n,"hex"));return t}}});function O(o){if(!H.has(o))throw new Error(`Invalid table name: "${o}" is not in the allowlist`);return o}function nt(o){let e=o.split(".");if(e.length>2)throw new Error(`Invalid SQL identifier: "${o}" has too many parts (max: schema.table)`);for(let t of e)if(!ue.test(t))throw new Error(`Invalid SQL identifier: "${o}" \u2014 part "${t}" does not match pattern ${ue}`);return o}var H,ue,Y=h(()=>{"use strict";H=new Set(["schema_version","kv_store","vectors","rl_q_values","goap_goals","goap_actions","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","sona_patterns","sona_fisher_matrices","test_outcomes","routing_outcomes","coverage_sessions","patterns","hypergraph_nodes","hypergraph_edges","hypergraph_vertices","hypergraph_hyperedges","hypergraph_edge_vertices","hypergraph_vertex_properties","hypergraph_edge_properties","captured_experiences","experience_applications","witness_chain","witness_chain_receipts","witness_chain_archive","trajectories","trajectory_steps","pattern_evolution_events","pattern_relationships","pattern_versions","learning_daily_snapshots","metrics_outcomes","experience_consolidation_log","qe_pattern_reuse","qe_agent_co_execution"]);ue=/^[a-z_][a-z0-9_]{0,62}$/});var w,pe,le,ge,me,$,_e,fe,Ne,Se,he,Re,Le=h(()=>{"use strict";ke();qe();w=11,pe=`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
4
4
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
5
5
|
version INTEGER NOT NULL,
|
|
6
6
|
migrated_at TEXT DEFAULT (datetime('now'))
|
|
7
7
|
);
|
|
8
|
-
`,
|
|
8
|
+
`,le=`
|
|
9
9
|
-- Key-Value Store (v2 compatible - same schema as HybridBackend)
|
|
10
10
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
11
11
|
key TEXT NOT NULL,
|
|
@@ -17,7 +17,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
17
17
|
);
|
|
18
18
|
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
19
19
|
CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;
|
|
20
|
-
`,
|
|
20
|
+
`,ge=`
|
|
21
21
|
-- Vector Embeddings (new in v3 - replaces in-memory AgentDB)
|
|
22
22
|
CREATE TABLE IF NOT EXISTS vectors (
|
|
23
23
|
id TEXT PRIMARY KEY,
|
|
@@ -30,7 +30,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
30
30
|
);
|
|
31
31
|
CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);
|
|
32
32
|
CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);
|
|
33
|
-
`,
|
|
33
|
+
`,me=`
|
|
34
34
|
-- Q-Values for RL algorithms (ADR-046)
|
|
35
35
|
CREATE TABLE IF NOT EXISTS rl_q_values (
|
|
36
36
|
id TEXT PRIMARY KEY,
|
|
@@ -51,7 +51,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
51
51
|
CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);
|
|
52
52
|
CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);
|
|
53
53
|
CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);
|
|
54
|
-
|
|
54
|
+
`,$=`
|
|
55
55
|
-- GOAP Goals
|
|
56
56
|
CREATE TABLE IF NOT EXISTS goap_goals (
|
|
57
57
|
id TEXT PRIMARY KEY,
|
|
@@ -78,7 +78,13 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
78
78
|
category TEXT NOT NULL,
|
|
79
79
|
qe_domain TEXT,
|
|
80
80
|
created_at TEXT DEFAULT (datetime('now')),
|
|
81
|
-
updated_at TEXT DEFAULT (datetime('now'))
|
|
81
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
82
|
+
-- A14: real domain API method binding (kernel.getDomainAPI(qe_domain)[method](params)).
|
|
83
|
+
-- method/implemented are NULL/0 for actions with no real backing yet \u2014
|
|
84
|
+
-- GOAPExecutor must report those as "not implemented", never simulate them.
|
|
85
|
+
method TEXT,
|
|
86
|
+
params TEXT,
|
|
87
|
+
implemented INTEGER DEFAULT 0
|
|
82
88
|
);
|
|
83
89
|
|
|
84
90
|
-- GOAP Plans
|
|
@@ -112,12 +118,51 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
112
118
|
created_at TEXT DEFAULT (datetime('now'))
|
|
113
119
|
);
|
|
114
120
|
|
|
121
|
+
-- A14: canonical per-step execution history (was previously undefined in
|
|
122
|
+
-- this schema \u2014 plan-executor.ts invented its own parallel
|
|
123
|
+
-- execution_results/executed_steps tables instead). One row per action
|
|
124
|
+
-- step per execution attempt (execution_id groups steps from the same
|
|
125
|
+
-- plan.execute() call, since a plan can be executed/retried more than
|
|
126
|
+
-- once). Aggregate per-execution stats (steps completed/failed, total
|
|
127
|
+
-- duration, final world state) are derived by querying this table rather
|
|
128
|
+
-- than maintained in a separate denormalized summary table.
|
|
129
|
+
CREATE TABLE IF NOT EXISTS goap_execution_steps (
|
|
130
|
+
id TEXT PRIMARY KEY,
|
|
131
|
+
plan_id TEXT NOT NULL,
|
|
132
|
+
execution_id TEXT NOT NULL,
|
|
133
|
+
action_id TEXT NOT NULL,
|
|
134
|
+
step_order INTEGER NOT NULL,
|
|
135
|
+
world_state_before TEXT,
|
|
136
|
+
world_state_after TEXT,
|
|
137
|
+
status TEXT NOT NULL DEFAULT 'pending',
|
|
138
|
+
retries INTEGER DEFAULT 0,
|
|
139
|
+
started_at TEXT,
|
|
140
|
+
duration_ms INTEGER,
|
|
141
|
+
agent_id TEXT,
|
|
142
|
+
agent_output TEXT,
|
|
143
|
+
error_message TEXT,
|
|
144
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
145
|
+
-- Deliberately no FK to goap_plans/goap_actions: PlanExecutor.execute()
|
|
146
|
+
-- can legitimately run an ad-hoc GOAPPlan/GOAPAction that was never
|
|
147
|
+
-- saved via savePlan()/addAction() (e.g. programmatic orchestration
|
|
148
|
+
-- bypassing the A* planner). unified-memory.ts enables the
|
|
149
|
+
-- foreign_keys pragma, so an enforced FK here would reject that
|
|
150
|
+
-- entirely legitimate usage, not just catch real corruption.
|
|
151
|
+
);
|
|
152
|
+
|
|
115
153
|
-- GOAP Indexes
|
|
116
154
|
CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);
|
|
117
155
|
CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);
|
|
118
156
|
CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);
|
|
119
157
|
CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);
|
|
120
|
-
|
|
158
|
+
CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_plan ON goap_execution_steps(plan_id);
|
|
159
|
+
CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_action ON goap_execution_steps(action_id);
|
|
160
|
+
-- idx_goap_exec_steps_execution is NOT created here: databases with a
|
|
161
|
+
-- pre-existing narrower goap_execution_steps table (missing execution_id)
|
|
162
|
+
-- would fail on "no such column" since CREATE TABLE IF NOT EXISTS above
|
|
163
|
+
-- silently no-ops against them. unified-memory.ts's v11 migration creates
|
|
164
|
+
-- this index only after confirming/backfilling the column.
|
|
165
|
+
`,_e=`
|
|
121
166
|
-- Concept Graph Nodes (Dream Engine)
|
|
122
167
|
CREATE TABLE IF NOT EXISTS concept_nodes (
|
|
123
168
|
id TEXT PRIMARY KEY,
|
|
@@ -186,7 +231,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
186
231
|
CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);
|
|
187
232
|
CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
|
|
188
233
|
CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
|
|
189
|
-
`,
|
|
234
|
+
`,fe=`
|
|
190
235
|
-- QE Patterns table (unified from sqlite-persistence.ts)
|
|
191
236
|
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
192
237
|
id TEXT PRIMARY KEY,
|
|
@@ -336,7 +381,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
336
381
|
CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);
|
|
337
382
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
|
|
338
383
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
|
|
339
|
-
`,
|
|
384
|
+
`,Ne=`
|
|
340
385
|
-- MinCut Graph Snapshots (ADR-047)
|
|
341
386
|
CREATE TABLE IF NOT EXISTS mincut_snapshots (
|
|
342
387
|
id TEXT PRIMARY KEY,
|
|
@@ -442,7 +487,7 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
442
487
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);
|
|
443
488
|
CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);
|
|
444
489
|
CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);
|
|
445
|
-
`,
|
|
490
|
+
`,Se=`
|
|
446
491
|
-- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)
|
|
447
492
|
CREATE TABLE IF NOT EXISTS sona_patterns (
|
|
448
493
|
id TEXT PRIMARY KEY,
|
|
@@ -551,16 +596,16 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
551
596
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
|
|
552
597
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
|
|
553
598
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
|
|
554
|
-
`,Re=["kv_store","vectors","rl_q_values","goap_actions","goap_goals","goap_plans","goap_plan_signatures","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","hypergraph_nodes","hypergraph_edges","sona_patterns","witness_chain"]});function U(o,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?o:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function c(i,d,u,T){return i!==u?i-u:d.localeCompare(T)}return{get(){return n.value},set(i,d){let u=d??Date.now();(n.timestamp===0||c(u,o,n.timestamp,n.nodeId)>0)&&(n={value:i,timestamp:u,nodeId:o,version:n.version+1,lastUpdated:Date.now()})},merge(i){let d=i.getState();this.applyState(d)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(i){(n.timestamp===0||c(i.timestamp,i.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:i.value,timestamp:i.timestamp,nodeId:i.nodeId,version:Math.max(n.version,i.version)+1,lastUpdated:Date.now()})},getNodeId(){return o},getTimestamp(){return n.timestamp}}}function F(o,e){let t=U(o);return t.applyState(e),t}var $=h(()=>{"use strict"});function C(o){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[o]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[o]=(e.counts[o]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[c,i]of Object.entries(t.counts)){let d=e.counts[c]||0;i>d&&(e.counts[c]=i,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return o},getLocalCount(){return e.counts[o]||0}}}function x(o,e){let t=C(o);return t.applyState(e),t}var M=h(()=>{"use strict"});function P(o){let e=C(o),t=C(o),n=0,c=Date.now();return{get(){return e.get()-t.get()},increment(i=1){if(i<0)throw new Error("Use decrement() for negative values");i!==0&&(e.increment(i),n++,c=Date.now())},decrement(i=1){if(i<0)throw new Error("Use increment() for negative values");i!==0&&(t.increment(i),n++,c=Date.now())},merge(i){let d=i.getState();this.applyState(d)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:c}},applyState(i){let d=this.get();e.applyState(i.positive),t.applyState(i.negative);let u=this.get();d!==u&&(n=Math.max(n,i.version)+1,c=Date.now())},getNodeId(){return o}}}function G(o,e){let t=P(o);return t.applyState(e),t}var K=h(()=>{"use strict";M()});function He(o,e){return`${o}:${Date.now()}:${e}`}function V(o){return typeof o=="string"?`s:${o}`:typeof o=="number"?`n:${o}`:typeof o=="boolean"?`b:${o}`:`j:${JSON.stringify(o)}`}function Ye(o){let e=o.substring(0,2),t=o.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return L(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function k(o){let e=new Map,t=new Map,n=0,c=Date.now(),i=0;function d(T){let E=e.get(T);if(!E||E.size===0)return!1;let p=t.get(T);if(!p||p.size===0)return!0;for(let g of E)if(!p.has(g))return!0;return!1}function u(T){let E=e.get(T);if(!E)return new Set;let p=t.get(T)||new Set,g=new Set;for(let l of E)p.has(l)||g.add(l);return g}return{has(T){let E=V(T);return d(E)},values(){let T=[];for(let[E]of e)d(E)&&T.push(Ye(E));return T},size(){let T=0;for(let[E]of e)d(E)&&T++;return T},add(T){let E=V(T),p=He(o,i++);e.has(E)||e.set(E,new Set),e.get(E).add(p),n++,c=Date.now()},remove(T){let E=V(T),p=e.get(E);if(!p||p.size===0)return;t.has(E)||t.set(E,new Set);let g=t.get(E);for(let l of p)g.add(l);n++,c=Date.now()},merge(T){let E=T.getState();this.applyState(E)},getState(){let T={};for(let[p,g]of e)T[p]=Array.from(g);let E={};for(let[p,g]of t)g.size>0&&(E[p]=Array.from(g));return{elements:T,tombstones:E,version:n,lastUpdated:c}},applyState(T){let E=!1;for(let[p,g]of Object.entries(T.elements)){e.has(p)||e.set(p,new Set);let l=e.get(p);for(let _ of g)l.has(_)||(l.add(_),E=!0)}for(let[p,g]of Object.entries(T.tombstones)){t.has(p)||t.set(p,new Set);let l=t.get(p);for(let _ of g)l.has(_)||(l.add(_),E=!0)}E&&(n=Math.max(n,T.version)+1,c=Date.now())},getNodeId(){return o},clear(){for(let[T,E]of e){t.has(T)||t.set(T,new Set);let p=t.get(T);for(let g of E)p.add(g)}n++,c=Date.now()}}}function q(o,e){let t=k(o);return t.applyState(e),t}var Q=h(()=>{"use strict";ne()});function J(o){let e={...$e,...o},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:c}=e,i=new Map,d=new Map,u=new Map,T=new Map,E=0,p=[],g=new Set,l={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function _(s,r,a){let f={key:s,type:r,operation:a,timestamp:Date.now(),nodeId:t};for(let we of g)try{we(f)}catch(Ue){console.error("[CRDTStore] Error in change listener:",Ue)}}function S(s,r){E++,n&&l[s].add(r)}function Z(){if(!n||!(l.registers.size>0||l.gCounters.size>0||l.pnCounters.size>0||l.sets.size>0))return;let r={fromVersion:p.length>0?p[p.length-1].toVersion:0,toVersion:E,timestamp:Date.now(),nodeId:t};if(l.registers.size>0){r.registers={};for(let a of l.registers){let f=i.get(a);f&&(r.registers[a]=f.getState())}l.registers.clear()}if(l.gCounters.size>0){r.gCounters={};for(let a of l.gCounters){let f=d.get(a);f&&(r.gCounters[a]=f.getState())}l.gCounters.clear()}if(l.pnCounters.size>0){r.pnCounters={};for(let a of l.pnCounters){let f=u.get(a);f&&(r.pnCounters[a]=f.getState())}l.pnCounters.clear()}if(l.sets.size>0){r.sets={};for(let a of l.sets){let f=T.get(a);f&&(r.sets[a]=f.getState())}l.sets.clear()}for(p.push(r);p.length>c;)p.shift()}let R={getRegister(s){return i.has(s)||i.set(s,U(t)),i.get(s)},setRegister(s,r){R.getRegister(s).set(r),S("registers",s),_(s,"lww-register","set")},hasRegister(s){return i.has(s)},deleteRegister(s){let r=i.delete(s);return r&&S("registers",s),r},getGCounter(s){return d.has(s)||d.set(s,C(t)),d.get(s)},incrementGCounter(s,r){R.getGCounter(s).increment(r),S("gCounters",s),_(s,"g-counter","increment")},hasGCounter(s){return d.has(s)},deleteGCounter(s){let r=d.delete(s);return r&&S("gCounters",s),r},getCounter(s){return u.has(s)||u.set(s,P(t)),u.get(s)},incrementCounter(s,r){R.getCounter(s).increment(r),S("pnCounters",s),_(s,"pn-counter","increment")},decrementCounter(s,r){R.getCounter(s).decrement(r),S("pnCounters",s),_(s,"pn-counter","decrement")},hasCounter(s){return u.has(s)},deleteCounter(s){let r=u.delete(s);return r&&S("pnCounters",s),r},getSet(s){return T.has(s)||T.set(s,k(t)),T.get(s)},addToSet(s,r){R.getSet(s).add(r),S("sets",s),_(s,"or-set","add")},removeFromSet(s,r){R.getSet(s).remove(r),S("sets",s),_(s,"or-set","remove")},hasSet(s){return T.has(s)},deleteSet(s){let r=T.delete(s);return r&&S("sets",s),r},merge(s){let r=s.getState();R.applyState(r)},getState(){Z();let s={version:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,a]of i)s.registers[r]=a.getState();for(let[r,a]of d)s.gCounters[r]=a.getState();for(let[r,a]of u)s.pnCounters[r]=a.getState();for(let[r,a]of T)s.sets[r]=a.getState();return s},applyState(s){for(let[r,a]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(a):i.set(r,F(t,a)),S("registers",r),_(r,"lww-register","merge");for(let[r,a]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(a):d.set(r,x(t,a)),S("gCounters",r),_(r,"g-counter","merge");for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,G(t,a)),S("pnCounters",r),_(r,"pn-counter","merge");for(let[r,a]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(a):T.set(r,q(t,a)),S("sets",r),_(r,"or-set","merge");E=Math.max(E,s.version)+1},getDelta(s){if(Z(),p.length===0)return s>=E,null;let r=p.filter(f=>f.toVersion>s);if(r.length===0)return null;let a={fromVersion:s,toVersion:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let f of r)f.registers&&Object.assign(a.registers,f.registers),f.gCounters&&Object.assign(a.gCounters,f.gCounters),f.pnCounters&&Object.assign(a.pnCounters,f.pnCounters),f.sets&&Object.assign(a.sets,f.sets);return Object.keys(a.registers).length===0&&delete a.registers,Object.keys(a.gCounters).length===0&&delete a.gCounters,Object.keys(a.pnCounters).length===0&&delete a.pnCounters,Object.keys(a.sets).length===0&&delete a.sets,a},applyDelta(s){if(s.registers)for(let[r,a]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(a):i.set(r,F(t,a)),S("registers",r),_(r,"lww-register","merge");if(s.gCounters)for(let[r,a]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(a):d.set(r,x(t,a)),S("gCounters",r),_(r,"g-counter","merge");if(s.pnCounters)for(let[r,a]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(a):u.set(r,G(t,a)),S("pnCounters",r),_(r,"pn-counter","merge");if(s.sets)for(let[r,a]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(a):T.set(r,q(t,a)),S("sets",r),_(r,"or-set","merge");E=Math.max(E,s.toVersion)+1},getVersion(){return E},getNodeId(){return t},on(s,r){if(s==="change")return g.add(r),()=>{g.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){g.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(i.keys())),(!s||s==="g-counter")&&r.push(...Array.from(d.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(u.keys())),(!s||s==="or-set")&&r.push(...Array.from(T.keys())),r},clear(){i.clear(),d.clear(),u.clear(),T.clear(),p.length=0,l.registers.clear(),l.gCounters.clear(),l.pnCounters.clear(),l.sets.clear(),E=0},getStats(){return{total:i.size+d.size+u.size+T.size,registers:i.size,gCounters:d.size,pnCounters:u.size,sets:T.size,version:E,nodeId:t,deltaHistorySize:p.length}}};return R}var $e,Ce=h(()=>{"use strict";$();M();K();Q();$e={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Ie=h(()=>{"use strict"});var Oe=h(()=>{"use strict";$();M();K();Q();Ce();Ie()});var Je={};Fe(Je,{ALLOWED_TABLE_NAMES:()=>H,BinaryHeap:()=>re,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>ye,UnifiedHnswIndex:()=>X,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>B,createHnswIndex:()=>se,findProjectRoot:()=>b,getDefaultDbPath:()=>be,getResolvedDefaultConfig:()=>De,getUnifiedMemory:()=>Xe,initializeUnifiedMemory:()=>Ke,resetUnifiedMemory:()=>Ve,validateTableName:()=>O});import*as m from"fs";import*as ve from"os";import*as N from"path";function be(){let o=b();return N.join(o,".agentic-qe","memory.db")}function De(){return{...ye,dbPath:be()}}function Xe(o){return A.getInstance(o)}async function Ke(o){let e=Xe(o);return await e.initialize(),e}function Ve(){A.resetInstance()}function Qe(){if(Ae)return;Ae=!0;let o=()=>{try{let e=A.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",o),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("SIGTERM",()=>{o(),process.exit(0)})}var y,ye,A,Ae,Ze=h(()=>{Ge();ne();xe();Me();Pe();de();Y();Y();oe();oe();Le();Oe();ze();y=ee.create("unified-memory");ye={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:v.MMAP_SIZE_BYTES,cacheSize:v.CACHE_SIZE_KB,busyTimeout:v.BUSY_TIMEOUT_MS,vectorDimensions:v.DEFAULT_VECTOR_DIMENSIONS};A=class o{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new X("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=De();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(!N.isAbsolute(this.config.dbPath)){let n=b();this.config.dbPath=N.join(n,this.config.dbPath)}}static getInstance(e){return o.instance||(o.instance=new o(e)),o.instance}static async getInstanceAsync(e){return o.instance?.initialized?o.instance:(o.instancePromise||(o.instancePromise=(async()=>{let t=o.getInstance(e);return await t.initialize(),t})()),o.instancePromise)}static resetInstance(){o.instance&&(o.instance.close(),o.instance=null),o.instancePromise=null,B()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=this.config.dbPath===":memory:",n="",c=!1,i=0;if(!t){let d=process.env.AQE_PROJECT_ROOT;if(d){let u=N.resolve(this.config.dbPath),T=N.resolve(d);!u.startsWith(T)&&!u.startsWith(ve.tmpdir())&&u.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${d}". Redirecting to test-safe path.`),this.config.dbPath=N.join(d,".agentic-qe","memory.db"))}if(n=N.dirname(this.config.dbPath),m.existsSync(n)||m.mkdirSync(n,{recursive:!0}),c=m.existsSync(this.config.dbPath),c)i=m.statSync(this.config.dbPath).size;else if(m.existsSync(n)){let u=this.findRecentBackups(n);if(u.length>0){let T=u[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
599
|
+
`,Re=["kv_store","vectors","rl_q_values","goap_actions","goap_goals","goap_plans","goap_plan_signatures","goap_execution_steps","concept_nodes","concept_edges","dream_cycles","dream_insights","qe_patterns","qe_pattern_embeddings","qe_pattern_usage","qe_trajectories","embeddings","execution_results","executed_steps","mincut_snapshots","mincut_history","mincut_weak_vertices","mincut_alerts","mincut_healing_actions","mincut_observations","hypergraph_nodes","hypergraph_edges","sona_patterns","witness_chain"]});function U(o,e,t){let n={value:e,timestamp:t??(e!==void 0?Date.now():0),nodeId:e!==void 0?o:"",version:e!==void 0?1:0,lastUpdated:Date.now()};function a(i,d,u,T){return i!==u?i-u:d.localeCompare(T)}return{get(){return n.value},set(i,d){let u=d??Date.now();(n.timestamp===0||a(u,o,n.timestamp,n.nodeId)>0)&&(n={value:i,timestamp:u,nodeId:o,version:n.version+1,lastUpdated:Date.now()})},merge(i){let d=i.getState();this.applyState(d)},getState(){return{value:n.value,timestamp:n.timestamp,nodeId:n.nodeId,version:n.version,lastUpdated:n.lastUpdated}},applyState(i){(n.timestamp===0||a(i.timestamp,i.nodeId,n.timestamp,n.nodeId)>0)&&(n={value:i.value,timestamp:i.timestamp,nodeId:i.nodeId,version:Math.max(n.version,i.version)+1,lastUpdated:Date.now()})},getNodeId(){return o},getTimestamp(){return n.timestamp}}}function x(o,e){let t=U(o);return t.applyState(e),t}var K=h(()=>{"use strict"});function C(o){let e={counts:{},version:0,lastUpdated:Date.now()};return e.counts[o]=0,{get(){return Object.values(e.counts).reduce((t,n)=>t+n,0)},increment(t=1){if(t<0)throw new Error("G-Counter can only increment by positive values");t!==0&&(e.counts[o]=(e.counts[o]||0)+t,e.version++,e.lastUpdated=Date.now())},merge(t){let n=t.getState();this.applyState(n)},getState(){return{counts:{...e.counts},version:e.version,lastUpdated:e.lastUpdated}},applyState(t){let n=!1;for(let[a,i]of Object.entries(t.counts)){let d=e.counts[a]||0;i>d&&(e.counts[a]=i,n=!0)}n&&(e.version=Math.max(e.version,t.version)+1,e.lastUpdated=Date.now())},getNodeId(){return o},getLocalCount(){return e.counts[o]||0}}}function F(o,e){let t=C(o);return t.applyState(e),t}var M=h(()=>{"use strict"});function G(o){let e=C(o),t=C(o),n=0,a=Date.now();return{get(){return e.get()-t.get()},increment(i=1){if(i<0)throw new Error("Use decrement() for negative values");i!==0&&(e.increment(i),n++,a=Date.now())},decrement(i=1){if(i<0)throw new Error("Use increment() for negative values");i!==0&&(t.increment(i),n++,a=Date.now())},merge(i){let d=i.getState();this.applyState(d)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:a}},applyState(i){let d=this.get();e.applyState(i.positive),t.applyState(i.negative);let u=this.get();d!==u&&(n=Math.max(n,i.version)+1,a=Date.now())},getNodeId(){return o}}}function P(o,e){let t=G(o);return t.applyState(e),t}var V=h(()=>{"use strict";M()});function He(o,e){return`${o}:${Date.now()}:${e}`}function Q(o){return typeof o=="string"?`s:${o}`:typeof o=="number"?`n:${o}`:typeof o=="boolean"?`b:${o}`:`j:${JSON.stringify(o)}`}function Ye(o){let e=o.substring(0,2),t=o.substring(2);switch(e){case"s:":return t;case"n:":return Number(t);case"b:":return t==="true";case"j:":return L(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function k(o){let e=new Map,t=new Map,n=0,a=Date.now(),i=0;function d(T){let E=e.get(T);if(!E||E.size===0)return!1;let p=t.get(T);if(!p||p.size===0)return!0;for(let g of E)if(!p.has(g))return!0;return!1}function u(T){let E=e.get(T);if(!E)return new Set;let p=t.get(T)||new Set,g=new Set;for(let l of E)p.has(l)||g.add(l);return g}return{has(T){let E=Q(T);return d(E)},values(){let T=[];for(let[E]of e)d(E)&&T.push(Ye(E));return T},size(){let T=0;for(let[E]of e)d(E)&&T++;return T},add(T){let E=Q(T),p=He(o,i++);e.has(E)||e.set(E,new Set),e.get(E).add(p),n++,a=Date.now()},remove(T){let E=Q(T),p=e.get(E);if(!p||p.size===0)return;t.has(E)||t.set(E,new Set);let g=t.get(E);for(let l of p)g.add(l);n++,a=Date.now()},merge(T){let E=T.getState();this.applyState(E)},getState(){let T={};for(let[p,g]of e)T[p]=Array.from(g);let E={};for(let[p,g]of t)g.size>0&&(E[p]=Array.from(g));return{elements:T,tombstones:E,version:n,lastUpdated:a}},applyState(T){let E=!1;for(let[p,g]of Object.entries(T.elements)){e.has(p)||e.set(p,new Set);let l=e.get(p);for(let f of g)l.has(f)||(l.add(f),E=!0)}for(let[p,g]of Object.entries(T.tombstones)){t.has(p)||t.set(p,new Set);let l=t.get(p);for(let f of g)l.has(f)||(l.add(f),E=!0)}E&&(n=Math.max(n,T.version)+1,a=Date.now())},getNodeId(){return o},clear(){for(let[T,E]of e){t.has(T)||t.set(T,new Set);let p=t.get(T);for(let g of E)p.add(g)}n++,a=Date.now()}}}function q(o,e){let t=k(o);return t.applyState(e),t}var J=h(()=>{"use strict";re()});function Z(o){let e={...$e,...o},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:a}=e,i=new Map,d=new Map,u=new Map,T=new Map,E=0,p=[],g=new Set,l={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function f(s,r,c){let _={key:s,type:r,operation:c,timestamp:Date.now(),nodeId:t};for(let we of g)try{we(_)}catch(Ue){console.error("[CRDTStore] Error in change listener:",Ue)}}function N(s,r){E++,n&&l[s].add(r)}function ee(){if(!n||!(l.registers.size>0||l.gCounters.size>0||l.pnCounters.size>0||l.sets.size>0))return;let r={fromVersion:p.length>0?p[p.length-1].toVersion:0,toVersion:E,timestamp:Date.now(),nodeId:t};if(l.registers.size>0){r.registers={};for(let c of l.registers){let _=i.get(c);_&&(r.registers[c]=_.getState())}l.registers.clear()}if(l.gCounters.size>0){r.gCounters={};for(let c of l.gCounters){let _=d.get(c);_&&(r.gCounters[c]=_.getState())}l.gCounters.clear()}if(l.pnCounters.size>0){r.pnCounters={};for(let c of l.pnCounters){let _=u.get(c);_&&(r.pnCounters[c]=_.getState())}l.pnCounters.clear()}if(l.sets.size>0){r.sets={};for(let c of l.sets){let _=T.get(c);_&&(r.sets[c]=_.getState())}l.sets.clear()}for(p.push(r);p.length>a;)p.shift()}let R={getRegister(s){return i.has(s)||i.set(s,U(t)),i.get(s)},setRegister(s,r){R.getRegister(s).set(r),N("registers",s),f(s,"lww-register","set")},hasRegister(s){return i.has(s)},deleteRegister(s){let r=i.delete(s);return r&&N("registers",s),r},getGCounter(s){return d.has(s)||d.set(s,C(t)),d.get(s)},incrementGCounter(s,r){R.getGCounter(s).increment(r),N("gCounters",s),f(s,"g-counter","increment")},hasGCounter(s){return d.has(s)},deleteGCounter(s){let r=d.delete(s);return r&&N("gCounters",s),r},getCounter(s){return u.has(s)||u.set(s,G(t)),u.get(s)},incrementCounter(s,r){R.getCounter(s).increment(r),N("pnCounters",s),f(s,"pn-counter","increment")},decrementCounter(s,r){R.getCounter(s).decrement(r),N("pnCounters",s),f(s,"pn-counter","decrement")},hasCounter(s){return u.has(s)},deleteCounter(s){let r=u.delete(s);return r&&N("pnCounters",s),r},getSet(s){return T.has(s)||T.set(s,k(t)),T.get(s)},addToSet(s,r){R.getSet(s).add(r),N("sets",s),f(s,"or-set","add")},removeFromSet(s,r){R.getSet(s).remove(r),N("sets",s),f(s,"or-set","remove")},hasSet(s){return T.has(s)},deleteSet(s){let r=T.delete(s);return r&&N("sets",s),r},merge(s){let r=s.getState();R.applyState(r)},getState(){ee();let s={version:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,c]of i)s.registers[r]=c.getState();for(let[r,c]of d)s.gCounters[r]=c.getState();for(let[r,c]of u)s.pnCounters[r]=c.getState();for(let[r,c]of T)s.sets[r]=c.getState();return s},applyState(s){for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,x(t,c)),N("registers",r),f(r,"lww-register","merge");for(let[r,c]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(c):d.set(r,F(t,c)),N("gCounters",r),f(r,"g-counter","merge");for(let[r,c]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(c):u.set(r,P(t,c)),N("pnCounters",r),f(r,"pn-counter","merge");for(let[r,c]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(c):T.set(r,q(t,c)),N("sets",r),f(r,"or-set","merge");E=Math.max(E,s.version)+1},getDelta(s){if(ee(),p.length===0)return s>=E,null;let r=p.filter(_=>_.toVersion>s);if(r.length===0)return null;let c={fromVersion:s,toVersion:E,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let _ of r)_.registers&&Object.assign(c.registers,_.registers),_.gCounters&&Object.assign(c.gCounters,_.gCounters),_.pnCounters&&Object.assign(c.pnCounters,_.pnCounters),_.sets&&Object.assign(c.sets,_.sets);return Object.keys(c.registers).length===0&&delete c.registers,Object.keys(c.gCounters).length===0&&delete c.gCounters,Object.keys(c.pnCounters).length===0&&delete c.pnCounters,Object.keys(c.sets).length===0&&delete c.sets,c},applyDelta(s){if(s.registers)for(let[r,c]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(c):i.set(r,x(t,c)),N("registers",r),f(r,"lww-register","merge");if(s.gCounters)for(let[r,c]of Object.entries(s.gCounters))d.has(r)?d.get(r).applyState(c):d.set(r,F(t,c)),N("gCounters",r),f(r,"g-counter","merge");if(s.pnCounters)for(let[r,c]of Object.entries(s.pnCounters))u.has(r)?u.get(r).applyState(c):u.set(r,P(t,c)),N("pnCounters",r),f(r,"pn-counter","merge");if(s.sets)for(let[r,c]of Object.entries(s.sets))T.has(r)?T.get(r).applyState(c):T.set(r,q(t,c)),N("sets",r),f(r,"or-set","merge");E=Math.max(E,s.toVersion)+1},getVersion(){return E},getNodeId(){return t},on(s,r){if(s==="change")return g.add(r),()=>{g.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){g.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(i.keys())),(!s||s==="g-counter")&&r.push(...Array.from(d.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(u.keys())),(!s||s==="or-set")&&r.push(...Array.from(T.keys())),r},clear(){i.clear(),d.clear(),u.clear(),T.clear(),p.length=0,l.registers.clear(),l.gCounters.clear(),l.pnCounters.clear(),l.sets.clear(),E=0},getStats(){return{total:i.size+d.size+u.size+T.size,registers:i.size,gCounters:d.size,pnCounters:u.size,sets:T.size,version:E,nodeId:t,deltaHistorySize:p.length}}};return R}var $e,Ce=h(()=>{"use strict";K();M();V();J();$e={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Ie=h(()=>{"use strict"});var Oe=h(()=>{"use strict";K();M();V();J();Ce();Ie()});var Je={};xe(Je,{ALLOWED_TABLE_NAMES:()=>H,BinaryHeap:()=>se,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>ye,UnifiedHnswIndex:()=>X,UnifiedMemoryManager:()=>A,clearProjectRootCache:()=>B,createHnswIndex:()=>oe,findProjectRoot:()=>b,getDefaultDbPath:()=>be,getResolvedDefaultConfig:()=>De,getUnifiedMemory:()=>Xe,initializeUnifiedMemory:()=>Ke,resetUnifiedMemory:()=>Ve,validateTableName:()=>O});import*as m from"fs";import*as ve from"os";import*as S from"path";function be(){let o=b();return S.join(o,".agentic-qe","memory.db")}function De(){return{...ye,dbPath:be()}}function Xe(o){return A.getInstance(o)}async function Ke(o){let e=Xe(o);return await e.initialize(),e}function Ve(){A.resetInstance()}function Qe(){if(Ae)return;Ae=!0;let o=()=>{try{let e=A.instance;e&&e.close()}catch(e){console.debug("[UnifiedMemory] Cleanup error:",e instanceof Error?e.message:e)}};process.on("beforeExit",o),process.on("SIGINT",()=>{o(),process.exit(0)}),process.on("SIGTERM",()=>{o(),process.exit(0)})}var y,ye,A,Ae,Ze=h(()=>{Pe();re();Fe();Me();Ge();Ee();Y();Y();ie();ie();Le();Oe();ze();y=te.create("unified-memory");ye={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:v.MMAP_SIZE_BYTES,cacheSize:v.CACHE_SIZE_KB,busyTimeout:v.BUSY_TIMEOUT_MS,vectorDimensions:v.DEFAULT_VECTOR_DIMENSIONS};A=class o{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new X("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=De();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(!S.isAbsolute(this.config.dbPath)){let n=b();this.config.dbPath=S.join(n,this.config.dbPath)}}static getInstance(e){return o.instance||(o.instance=new o(e)),o.instance}static async getInstanceAsync(e){return o.instance?.initialized?o.instance:(o.instancePromise||(o.instancePromise=(async()=>{let t=o.getInstance(e);return await t.initialize(),t})()),o.instancePromise)}static resetInstance(){o.instance&&(o.instance.close(),o.instance=null),o.instancePromise=null,B()}async initialize(e){if(!this.initialized)return this.initPromise||(this.initPromise=this._doInitialize(e?.signal)),this.initPromise}async _doInitialize(e){if(!this.initialized){e?.throwIfAborted();try{let t=this.config.dbPath===":memory:",n="",a=!1,i=0;if(!t){let d=process.env.AQE_PROJECT_ROOT;if(d){let u=S.resolve(this.config.dbPath),T=S.resolve(d);!u.startsWith(T)&&!u.startsWith(ve.tmpdir())&&u.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${d}". Redirecting to test-safe path.`),this.config.dbPath=S.join(d,".agentic-qe","memory.db"))}if(n=S.dirname(this.config.dbPath),m.existsSync(n)||m.mkdirSync(n,{recursive:!0}),a=m.existsSync(this.config.dbPath),a)i=m.statSync(this.config.dbPath).size;else if(m.existsSync(n)){let u=this.findRecentBackups(n);if(u.length>0){let T=u[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
555
600
|
Expected: ${this.config.dbPath}
|
|
556
601
|
Found ${u.length} backup(s), newest: ${T.path} (${(T.size/1024/1024).toFixed(1)}MB)
|
|
557
|
-
Restoring from backup to prevent data loss...`),m.copyFileSync(T.path,this.config.dbPath);for(let E of["-wal","-shm"]){let p=this.config.dbPath+E;m.existsSync(p)&&m.unlinkSync(p)}i=T.size}}}if(e?.throwIfAborted(),this.db=
|
|
602
|
+
Restoring from backup to prevent data loss...`),m.copyFileSync(T.path,this.config.dbPath);for(let E of["-wal","-shm"]){let p=this.config.dbPath+E;m.existsSync(p)&&m.unlinkSync(p)}i=T.size}}}if(e?.throwIfAborted(),this.db=ne(this.config.dbPath,{walMode:this.config.walMode,busyTimeout:this.config.busyTimeout}),this.db.pragma(`mmap_size = ${this.config.mmapSize}`),this.db.pragma(`cache_size = ${this.config.cacheSize}`),this.db.pragma("foreign_keys = ON"),e?.aborted){try{this.db.close()}catch{}this.db=null,e.throwIfAborted()}if(await this.runMigrations(),e?.throwIfAborted(),a&&i>1e6)try{let d=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(d&&d.cnt===0){let u=m.statSync(this.config.dbPath).size;u<i*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
|
|
558
603
|
DB was ${(i/1024/1024).toFixed(1)}MB, now ${(u/1024/1024).toFixed(1)}MB with 0 patterns.
|
|
559
604
|
This looks like the DB was replaced with an empty schema.
|
|
560
|
-
Check backups in ${n} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${D(t)}`)}}}findRecentBackups(e){try{let n=m.readdirSync(e).filter(i=>i.startsWith("memory")&&i.endsWith(".db")&&i!=="memory.db").map(i=>{let d=
|
|
605
|
+
Check backups in ${n} and restore manually.`)}}catch{}this.vectorsLoaded=!1,this.initialized=!0,console.log(`[UnifiedMemory] Initialized: ${this.config.dbPath}`),this.warnIfDuplicateDatabases()}catch(t){throw this.initPromise=null,t instanceof Error&&(t.name==="AbortError"||(e?.aborted??!1))?t:new Error(`Failed to initialize UnifiedMemoryManager: ${D(t)}`)}}}findRecentBackups(e){try{let n=m.readdirSync(e).filter(i=>i.startsWith("memory")&&i.endsWith(".db")&&i!=="memory.db").map(i=>{let d=S.join(e,i),u=m.statSync(d);return{path:d,size:u.size,mtime:u.mtimeMs}}).filter(i=>i.size>1e6).sort((i,d)=>d.mtime-i.mtime),a=S.join(e,"backups");if(m.existsSync(a)){let i=m.readdirSync(a);for(let d of i)if(d.endsWith(".db")){let u=S.join(a,d),T=m.statSync(u);T.size>1e6&&n.push({path:u,size:T.size,mtime:T.mtimeMs})}n.sort((d,u)=>u.mtime-d.mtime)}return n}catch{return[]}}warnIfDuplicateDatabases(){if(this.config.dbPath!==":memory:")try{let e=b(),t=S.resolve(this.config.dbPath),a=[S.join(e,".agentic-qe","memory.db"),S.join(e,"v3",".agentic-qe","memory.db")].map(i=>S.resolve(i)).filter(i=>i!==t&&m.existsSync(i));a.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
|
|
561
606
|
Canonical: ${t}
|
|
562
|
-
Duplicates: ${
|
|
563
|
-
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){y.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let n=O(e);return this.db.prepare(`PRAGMA table_info(${n})`).all().some(i=>i.name===t)}catch(n){return y.debug("Column existence check failed",{table:e,column:t,error:n instanceof Error?n.message:String(n)}),!1}}handleV2SchemaIncompatibilities(){if(!this.db)return;let e=[{table:"goap_plans",requiredColumn:"status",columnDef:"TEXT DEFAULT 'pending'"},{table:"goap_actions",requiredColumn:"agent_type",columnDef:"TEXT DEFAULT 'unknown'"},{table:"concept_nodes",requiredColumn:"concept_type",columnDef:"TEXT DEFAULT 'general'"},{table:"concept_edges",requiredColumn:"edge_type",columnDef:"TEXT DEFAULT 'related'"},{table:"dream_insights",requiredColumn:"cycle_id",columnDef:"TEXT DEFAULT ''"},{table:"rl_q_values",requiredColumn:"algorithm",columnDef:"TEXT DEFAULT 'q-learning'"}];for(let{table:t,requiredColumn:n,columnDef:
|
|
607
|
+
Duplicates: ${a.join(", ")}
|
|
608
|
+
This can cause data splits. Remove duplicates or set AQE_PROJECT_ROOT.`)}catch(e){y.debug("Duplicate database check failed",{error:e instanceof Error?e.message:String(e)})}}columnExists(e,t){if(!this.db)return!1;try{let n=O(e);return this.db.prepare(`PRAGMA table_info(${n})`).all().some(i=>i.name===t)}catch(n){return y.debug("Column existence check failed",{table:e,column:t,error:n instanceof Error?n.message:String(n)}),!1}}handleV2SchemaIncompatibilities(){if(!this.db)return;let e=[{table:"goap_plans",requiredColumn:"status",columnDef:"TEXT DEFAULT 'pending'"},{table:"goap_actions",requiredColumn:"agent_type",columnDef:"TEXT DEFAULT 'unknown'"},{table:"concept_nodes",requiredColumn:"concept_type",columnDef:"TEXT DEFAULT 'general'"},{table:"concept_edges",requiredColumn:"edge_type",columnDef:"TEXT DEFAULT 'related'"},{table:"dream_insights",requiredColumn:"cycle_id",columnDef:"TEXT DEFAULT ''"},{table:"rl_q_values",requiredColumn:"algorithm",columnDef:"TEXT DEFAULT 'q-learning'"}];for(let{table:t,requiredColumn:n,columnDef:a}of e)if(this.db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name=?").get(t)&&!this.columnExists(t,n)){let d=O(t);try{this.db.exec(`ALTER TABLE ${d} ADD COLUMN ${n} ${a}`),console.log(`[UnifiedMemory] Added column ${n} to ${t} (safe migration)`)}catch(u){console.log(`[UnifiedMemory] Column ${n} on ${t}: ${u instanceof Error?u.message:String(u)}`)}}}async runMigrations(){if(!this.db)throw new Error("Database not initialized");this.db.exec(pe),this.handleV2SchemaIncompatibilities();let t=this.db.prepare("SELECT version FROM schema_version WHERE id = 1").get()?.version??0;t<w&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${w}`),this.db.transaction(()=>{t<1&&this.db.exec(le),t<2&&this.db.exec(ge),t<3&&(this.db.exec(me),this.db.exec($),this.db.exec(_e)),t<4&&this.db.exec(fe),t<5&&this.db.exec(Ne),t<6&&this.db.exec(z),t<7&&this.db.exec(Se),t<8&&this.db.exec(he),t<9&&(this.db.exec(`
|
|
564
609
|
CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
|
|
565
610
|
name, description, pattern_type, qe_domain,
|
|
566
611
|
content='qe_patterns',
|
|
@@ -586,10 +631,10 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
586
631
|
`),this.db.exec(`
|
|
587
632
|
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
588
633
|
SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
|
|
589
|
-
`)),t<10&&this.db.exec(j),this.db.prepare(`
|
|
634
|
+
`)),t<10&&this.db.exec(j),t<11&&this.migrateToV11GoapExecutionSteps(),this.db.prepare(`
|
|
590
635
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
591
636
|
VALUES (1, ?, datetime('now'))
|
|
592
|
-
`).run(w)})(),console.log("[UnifiedMemory] Migration complete"))}async loadVectorIndex(){if(this.vectorsLoaded)return;if(!this.db)throw new Error("Database not initialized");this.vectorIndex.clear();let e=this.db.prepare("SELECT id, embedding, dimensions FROM vectors").all();for(let t of e){let n=this.bufferToFloatArray(t.embedding,t.dimensions);this.vectorIndex.add(t.id,n)}this.vectorsLoaded=!0,console.log(`[UnifiedMemory] Loaded ${e.length} vectors into vector index (ruvector flat)`)}async kvSet(e,t,n="default",
|
|
637
|
+
`).run(w)})(),console.log("[UnifiedMemory] Migration complete"))}migrateToV11GoapExecutionSteps(){let e=this.db;e.exec($);let t=(n,a,i)=>{e.prepare(`SELECT name FROM pragma_table_info('${n}')`).all().some(u=>u.name===a)||e.exec(`ALTER TABLE ${n} ADD COLUMN ${a} ${i}`)};t("goap_execution_steps","execution_id","TEXT"),t("goap_execution_steps","retries","INTEGER DEFAULT 0"),t("goap_execution_steps","started_at","TEXT"),t("goap_execution_steps","agent_output","TEXT"),t("goap_actions","method","TEXT"),t("goap_actions","params","TEXT"),t("goap_actions","implemented","INTEGER DEFAULT 0"),e.exec("CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_execution ON goap_execution_steps(execution_id)")}async loadVectorIndex(){if(this.vectorsLoaded)return;if(!this.db)throw new Error("Database not initialized");this.vectorIndex.clear();let e=this.db.prepare("SELECT id, embedding, dimensions FROM vectors").all();for(let t of e){let n=this.bufferToFloatArray(t.embedding,t.dimensions);this.vectorIndex.add(t.id,n)}this.vectorsLoaded=!0,console.log(`[UnifiedMemory] Loaded ${e.length} vectors into vector index (ruvector flat)`)}async kvSet(e,t,n="default",a){this.ensureInitialized();let i=a?Date.now()+a*1e3:null,d=JSON.stringify(t);this.db.prepare(`
|
|
593
638
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
594
639
|
VALUES (?, ?, ?, ?)
|
|
595
640
|
`).run(e,n,d,i),this.auditWrite("kvSet",n,e,d)}async kvGet(e,t="default"){this.ensureInitialized();let n=this.db.prepare(`
|
|
@@ -598,19 +643,19 @@ import{d as z,f as ke}from"./chunk-LW5DHT3Z.js";import{a as Pe}from"./chunk-XXRT
|
|
|
598
643
|
`).get(e,t);if(n){if(n.expires_at&&Date.now()>n.expires_at){this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t);return}return L(n.value)}}async kvDelete(e,t="default"){this.ensureInitialized();let n=this.db.prepare("DELETE FROM kv_store WHERE key = ? AND namespace = ?").run(e,t);return n.changes>0&&this.auditWrite("kvDelete",t,e,""),n.changes>0}async kvExists(e,t="default"){return this.ensureInitialized(),this.db.prepare(`
|
|
599
644
|
SELECT 1 FROM kv_store
|
|
600
645
|
WHERE key = ? AND namespace = ? AND (expires_at IS NULL OR expires_at > ?)
|
|
601
|
-
`).get(e,t,Date.now())!==void 0}async kvSearch(e,t="default",n=100){this.ensureInitialized();let
|
|
646
|
+
`).get(e,t,Date.now())!==void 0}async kvSearch(e,t="default",n=100){this.ensureInitialized();let a=e.replace(/\*/g,"%").replace(/\?/g,"_");return this.db.prepare(`
|
|
602
647
|
SELECT key FROM kv_store
|
|
603
648
|
WHERE namespace = ? AND key LIKE ?
|
|
604
649
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
605
650
|
LIMIT ?
|
|
606
|
-
`).all(t,
|
|
651
|
+
`).all(t,a,Date.now(),n).map(d=>d.key)}async kvCleanupExpired(){return this.ensureInitialized(),this.db.prepare("DELETE FROM kv_store WHERE expires_at IS NOT NULL AND expires_at < ?").run(Date.now()).changes}enableProofGate(){this.ensureInitialized(),this.proofGateEnvChecked=!0,!this.proofGate&&(this.proofGate=this.loadProofChain()??new I)}isProofGateEnabled(){return this.proofGate!==null}verifyMemoryIntegrity(){if(!this.proofGate)throw new Error("Proof-gate not enabled \u2014 call enableProofGate() or set AQE_PROOF_GATE=1");return this.proofGate.verifyIntegrity()}getProofChainRoot(){return this.proofGate?this.proofGate.chainRoot():null}getProofChainLength(){return this.proofGate?this.proofGate.length:0}auditWrite(e,t,n,a){if(!this.proofGate){if(this.proofGateEnvChecked||(this.proofGateEnvChecked=!0,process.env.AQE_PROOF_GATE!=="1"))return;this.proofGate=this.loadProofChain()??new I}if(t!==o.PROOF_NS)try{this.proofGate.admit({op:e,ns:t,key:n,value:a}),this.persistProofChain()}catch(i){y.warn(`proof-gate audit skipped for ${t}/${n}: ${D(i)}`)}}persistProofChain(){!this.proofGate||!this.db||this.db.prepare(`
|
|
607
652
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
608
653
|
VALUES (?, ?, ?, NULL)
|
|
609
654
|
`).run(o.PROOF_KEY,o.PROOF_NS,JSON.stringify(this.proofGate.toJSON()))}loadProofChain(){if(!this.db)return null;let e=this.db.prepare(`
|
|
610
655
|
SELECT value FROM kv_store WHERE key = ? AND namespace = ?
|
|
611
|
-
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return I.fromJSON(JSON.parse(e.value))}catch(t){return y.warn(`proof-gate chain failed to load (starting fresh): ${D(t)}`),null}}async vectorStore(e,t,n="default",
|
|
656
|
+
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return I.fromJSON(JSON.parse(e.value))}catch(t){return y.warn(`proof-gate chain failed to load (starting fresh): ${D(t)}`),null}}async vectorStore(e,t,n="default",a){this.ensureInitialized();let i=this.floatArrayToBuffer(t),d=a?JSON.stringify(a):null;this.db.prepare(`
|
|
612
657
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
613
658
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
614
659
|
`).run(e,n,i,t.length,d),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
|
|
615
660
|
SELECT embedding, dimensions, metadata FROM vectors WHERE id = ?
|
|
616
|
-
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?L(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e);return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,n){this.ensureInitialized(),this.vectorsLoaded||await this.loadVectorIndex();let
|
|
661
|
+
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?L(t.metadata):void 0}}async vectorDelete(e){this.ensureInitialized();let t=this.db.prepare("DELETE FROM vectors WHERE id = ?").run(e);return this.vectorIndex.remove(e),t.changes>0}async vectorSearch(e,t=10,n){this.ensureInitialized(),this.vectorsLoaded||await this.loadVectorIndex();let a=this.vectorIndex.search(e,t*2);if(a.length===0)return[];let i=a.map(E=>E.id),d=i.map(()=>"?").join(","),u=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${d})`).all(...i),T=new Map(u.map(E=>[E.id,E]));if(n){let E=[];for(let p of a){let g=T.get(p.id);if(g&&g.namespace===n&&(E.push({id:p.id,score:p.score,metadata:g.metadata?L(g.metadata):void 0}),E.length>=t))break}return E}return a.slice(0,t).map(E=>{let p=T.get(E.id);return{id:E.id,score:E.score,metadata:p?.metadata?L(p.metadata):void 0}})}async vectorCount(e){return this.ensureInitialized(),e?this.db.prepare("SELECT COUNT(*) as count FROM vectors WHERE namespace = ?").get(e).count:this.db.prepare("SELECT COUNT(*) as count FROM vectors").get().count}queryCount(e){this.ensureInitialized();let t=O(e);return this.db.prepare(`SELECT COUNT(*) as c FROM ${t}`).get().c}initializeCRDT(e){if(this.crdtStore){console.warn("[UnifiedMemory] CRDT store already initialized");return}this.crdtStore=Z({nodeId:e}),console.log(`[UnifiedMemory] CRDT store initialized for node: ${e}`)}getCRDTStore(){return this.crdtStore}isCRDTInitialized(){return this.crdtStore!==null}async crdtSet(e,t,n="crdt"){this.ensureInitialized(),this.crdtStore&&this.crdtStore.setRegister(e,t),await this.kvSet(e,t,n)}async crdtGet(e,t="crdt"){if(this.crdtStore){let n=this.crdtStore.getRegister(e);if(n)return n.get()}return this.kvGet(e,t)}crdtIncrement(e,t=1){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");let n=this.crdtStore.getCounter(e);n||(this.crdtStore.incrementCounter(e,0),n=this.crdtStore.getCounter(e));for(let a=0;a<t;a++)this.crdtStore.incrementCounter(e)}crdtGetCounter(e){return this.crdtStore?this.crdtStore.getCounter(e)?.get()??0:0}crdtAddToSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.addToSet(e,t)}crdtRemoveFromSet(e,t){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.removeFromSet(e,t)}crdtGetSet(e){if(!this.crdtStore)return new Set;let t=this.crdtStore.getSet(e);return new Set(t.values())}crdtGetState(){return this.crdtStore?this.crdtStore.getState():null}crdtGetDelta(e){return this.crdtStore?this.crdtStore.getDelta(e??0):null}crdtMerge(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyState(e)}crdtApplyDelta(e){if(!this.crdtStore)throw new Error("CRDT store not initialized. Call initializeCRDT first.");this.crdtStore.applyDelta(e)}async crdtPersist(){if(!this.crdtStore)return;let e=this.crdtStore.getState();await this.kvSet("__crdt_state__",e,"crdt-internal")}async crdtRestore(){if(!this.crdtStore)return!1;let e=await this.kvGet("__crdt_state__","crdt-internal");return e?(this.crdtStore.applyState(e),!0):!1}getDatabase(){if(!this.db||!this.initialized)throw new Error("UnifiedMemoryManager not initialized");return this.db}isInitialized(){return this.initialized}getDbPath(){return this.config.dbPath}prepare(e,t){if(!this.db)throw new Error("Database not initialized");let n=this.preparedStatements.get(e);return n||(n=this.db.prepare(t),this.preparedStatements.set(e,n)),n}transaction(e){if(!this.db)throw new Error("Database not initialized");return this.db.transaction(e)()}getStats(){if(!this.db)throw new Error("Database not initialized");let e=Re.map(a=>{try{let i=this.db.prepare(`SELECT COUNT(*) as count FROM ${a}`).get();return{name:a,rowCount:i.count}}catch(i){return y.debug("Table row count query failed",{table:a,error:i instanceof Error?i.message:String(i)}),{name:a,rowCount:0}}}),t=0,n=0;try{m.existsSync(this.config.dbPath)&&(t=m.statSync(this.config.dbPath).size);let a=this.config.dbPath+"-wal";m.existsSync(a)&&(n=m.statSync(a).size)}catch(a){console.debug("[UnifiedMemory] File stat error:",a instanceof Error?a.message:a)}return{tables:e,fileSize:t,walSize:n,vectorIndexSize:this.vectorIndex.size()}}vacuum(){if(!this.db)throw new Error("Database not initialized");this.db.exec("VACUUM")}checkpoint(){if(!this.db)throw new Error("Database not initialized");this.db.pragma("wal_checkpoint(TRUNCATE)")}close(){this.db&&(this.preparedStatements.clear(),this.vectorIndex.clear(),this.db.close(),this.db=null,this.initialized=!1,console.log("[UnifiedMemory] Database closed"))}ensureInitialized(){if(!this.initialized||!this.db)throw new Error("UnifiedMemoryManager not initialized. Call initialize() first.")}floatArrayToBuffer(e){let t=Buffer.alloc(e.length*4);for(let n=0;n<e.length;n++)t.writeFloatLE(e[n],n*4);return t}bufferToFloatArray(e,t){let n=new Float32Array(e.buffer,e.byteOffset,t);return Array.from(n)}};Ae=!1;Qe()});export{H as a,O as b,nt as c,Y as d,be as e,ye as f,De as g,A as h,Xe as i,Ke as j,Ve as k,Je as l,Ze as m};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
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.11.5");process.exit(0)}
|
|
2
2
|
import{readFileSync as R,existsSync as v,readdirSync as y}from"fs";import{join as S}from"path";var M=100*1024,b=/mcp__([a-z][a-z0-9-]*)__([a-z][a-z0-9_]*)/g,x=/^```/;function w(e,r){let n=e.length>M?e.slice(0,M):e,o=[],i=n.split(`
|
|
3
3
|
`),a=!1;for(let s=0;s<i.length;s++){let p=i[s];if(x.test(p.trim())){a=!a;continue}let l,c=new RegExp(b.source,"g");for(;(l=c.exec(p))!==null;){let t=l[1],g=l[2],f=l[0],d=a?"code-block":"prose",u=d==="prose"?.9:.5;o.push({toolName:f,serverName:t,actionName:g,confidence:u,context:d,lineNumber:s+1})}}return o}function E(e){let r=new Map;for(let n of e)r.has(n.serverName)||r.set(n.serverName,[]),r.get(n.serverName).push(n);return r}function N(e){let r=[],n=[S(e,".claude","mcp.json"),S(e,".mcp.json")],o=process.env.HOME||process.env.USERPROFILE||"";o&&n.push(S(o,".claude","mcp.json"));for(let i of n)if(v(i))try{let a=R(i,"utf-8"),s=JSON.parse(a);s.mcpServers&&typeof s.mcpServers=="object"&&r.push(...Object.keys(s.mcpServers))}catch{}return[...new Set(r)]}function h(e,r,n){if(!v(e))return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Agent file not found: ${e}`],allSatisfied:!0};let o;try{o=R(e,"utf-8")}catch{return{agentName:r,references:[],requiredServers:[],availableServers:n,missingServers:[],warnings:[`Failed to read agent file: ${e}`],allSatisfied:!0}}let i=w(o,r),a=E(i),s=[...a.keys()],p=new Set(n),l=s.filter(t=>!p.has(t)),c=[];for(let t of l){let g=a.get(t)||[],f=Math.max(...g.map(m=>m.confidence)),d=g.length,u=[...new Set(g.map(m=>m.context))].join(", ");c.push(`[advisory] Agent "${r}" references MCP server "${t}" (${d} tool ref${d>1?"s":""}, confidence: ${f}, context: ${u}) but server is not configured. Agent may have reduced capabilities.`)}return{agentName:r,references:i,requiredServers:s,availableServers:n,missingServers:l,warnings:c,allSatisfied:l.length===0}}function C(e,r){let n=Date.now(),o=[],i=[],a=N(r);if(!v(e))return{agents:[],totalServersReferenced:0,globalMissingServers:[],agentsWithMissingDeps:[],warnings:[`Agents directory not found: ${e}`],durationMs:Date.now()-n};try{let c=y(e);for(let g of c){if(!g.endsWith(".md"))continue;let f=g.replace(".md",""),d=S(e,g),u=h(d,f,a);o.push(u),i.push(...u.warnings)}let t=S(e,"subagents");if(v(t)){let g=y(t);for(let f of g){if(!f.endsWith(".md"))continue;let d=f.replace(".md",""),u=S(t,f),m=h(u,d,a);o.push(m),i.push(...m.warnings)}}}catch(c){i.push(`Error scanning agents directory: ${c.message}`)}let s=new Set,p=new Set,l=[];for(let c of o){for(let t of c.requiredServers)s.add(t);for(let t of c.missingServers)p.add(t);c.missingServers.length>0&&l.push(c.agentName)}return{agents:o,totalServersReferenced:s.size,globalMissingServers:[...p],agentsWithMissingDeps:l,warnings:i,durationMs:Date.now()-n}}export{N as a,C as b};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
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.11.5");process.exit(0)}
|
|
2
2
|
function M(u){let e=u|0;return()=>{e=e+1831565813|0;let n=Math.imul(e^e>>>15,1|e);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}var A=2,y=10,x=200,p=1e-8,b=class{epsilon;seed;constructor(e){if(this.epsilon=e?.epsilon??.3,this.seed=e?.seed,this.epsilon<=0||this.epsilon>=1)throw new Error("SparsifierConfig.epsilon must be in (0, 1)")}sparsify(e){if(e.nodeCount<=0||e.edges.length===0)return{nodeCount:e.nodeCount,edges:[]};let n=this.seed!==void 0?M(this.seed):Math.random,t=this.approximateEffectiveResistances(e),i=e.nodeCount,r=e.edges.length,o=Math.max(1,Math.log(i)),m=this.epsilon*this.epsilon,l=Math.min(r,Math.max(i-1,A*(i-1)*(1-this.epsilon))),s=new Float64Array(r),c=0;for(let a=0;a<r;a++){let d=e.edges[a][2];s[a]=d*t[a],c+=s[a]}if(c<=0)return{nodeCount:e.nodeCount,edges:[]};let f=[];for(let a=0;a<r;a++){let[d,C,E]=e.edges[a],g=Math.min(1,s[a]/c*l);if(n()<g){let w=E/g;f.push([d,C,w])}}return{nodeCount:e.nodeCount,edges:f}}validateSpectral(e,n){let t=Math.min(y,Math.max(1,e.nodeCount-1)),i=this.computeLaplacian(e),r=this.computeLaplacian(n),o=this.computeTopEigenvalues(i,t),m=this.computeTopEigenvalues(r,t),l=[],s=!0,c=this.epsilon;for(let f=0;f<o.length;f++){if(o[f]<1e-10)continue;let a=m[f]/o[f];l.push(a),(a<1-c||a>1+c)&&(s=!1)}return{isValid:s,eigenvalueRatios:l,originalEdgeCount:e.edges.length,sparsifiedEdgeCount:n.edges.length,compressionRatio:e.edges.length>0?n.edges.length/e.edges.length:0}}computeLaplacian(e){let n=e.nodeCount,t=Array.from({length:n},()=>new Array(n).fill(0));for(let[i,r,o]of e.edges)i<0||i>=n||r<0||r>=n||(t[i][i]+=o,t[r][r]+=o,t[i][r]-=o,t[r][i]-=o);return t}computeTopEigenvalues(e,n){let t=e.length;if(t===0)return[];let i=[],r=[],o=e.map(m=>[...m]);for(let m=0;m<Math.min(n,t);m++){let l=this.powerIteration(o,t,r);if(l===null)break;i.push(l.eigenvalue),r.push(l.eigenvector),V(o,l.eigenvalue,l.eigenvector)}return i}approximateEffectiveResistances(e){let n=e.nodeCount,t=new Float64Array(n);for(let[r,o,m]of e.edges)r>=0&&r<n&&(t[r]+=m),o>=0&&o<n&&(t[o]+=m);let i=new Array(e.edges.length);for(let r=0;r<e.edges.length;r++){let[o,m]=e.edges[r],l=t[o]||1,s=t[m]||1;i[r]=1/l+1/s}return i}powerIteration(e,n,t){let i=0;for(let s=0;s<n;s++)for(let c=0;c<n;c++)i+=e[s][c]*e[s][c];if(i<p*p)return null;let r=t.length,o=new Array(n);for(let s=0;s<n;s++)o[s]=Math.sin((s+1)*(r+1)*1.618033988749895)+.1*(s-n/2);for(let s of t)h(o,s);if(R(o)<p)return null;let l=0;for(let s=0;s<x;s++){let c=L(e,o);for(let d of t)h(c,d);let f=S(c,o),a=v(c);if(a<p)return{eigenvalue:0,eigenvector:o};for(let d=0;d<n;d++)o[d]=c[d]/a;if(Math.abs(f-l)<p){l=f;break}l=f}return{eigenvalue:Math.abs(l),eigenvector:o}}};function L(u,e){let n=u.length,t=new Array(n).fill(0);for(let i=0;i<n;i++){let r=0;for(let o=0;o<n;o++)r+=u[i][o]*e[o];t[i]=r}return t}function v(u){let e=0;for(let n=0;n<u.length;n++)e+=u[n]*u[n];return Math.sqrt(e)}function R(u){let e=v(u);if(e>0)for(let n=0;n<u.length;n++)u[n]/=e;return e}function S(u,e){let n=0;for(let t=0;t<u.length;t++)n+=u[t]*e[t];return n}function h(u,e){let n=S(u,e);for(let t=0;t<u.length;t++)u[t]-=n*e[t]}function V(u,e,n){let t=n.length;for(let i=0;i<t;i++)for(let r=0;r<t;r++)u[i][r]-=e*n[i]*n[r]}export{b as a};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
2
|
-
import{a as
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.5");process.exit(0)}
|
|
2
|
+
import{a as h}from"./chunk-TEIWJ3GJ.js";import{a as C,f as x}from"./chunk-3LY7OCSO.js";var d={mechanical:["convert var to const","add types","remove console","convert to async","convert to esm","arrow function","rename variable","format code"],simple:["fix typo","update comment","fix simple bug","add documentation","format","rename","simple refactor","basic test"],moderate:["implement feature","implement","refactor","complex refactor","performance optimization","optimize","test generation","generate test","error handling","validation logic","api integration","code index","coverage analysis","quality assessment","defect prediction","predict defect","analyze coverage","analyze","assess","scan","detect"],complex:["multi-file refactor","orchestrate","coordinate","large codebase","migration","cross-domain","workflow","system design","analyze security","security scan","security analysis","vulnerability scan","chaos test","resilience test","contract validation"],critical:["architecture","security audit","critical bug","algorithm design","system-wide","vulnerability","cryptography","performance critical","hardcoded secret","cve","owasp","penetration test","exploit"]},f={architecture:/\b(architect|design|system design|overall structure|component design)\b/i,security:/\b(security|vulnerability|audit|xss|sql injection|csrf|encryption|auth|authentication|authorization)\b/i,multiStep:/\b(orchestrate|coordinate|workflow|pipeline|multi[- ]step)\b/i,crossDomain:/\b(cross[- ]domain|across (domains|modules)|integrate|coordination)\b/i},m=class{config;agentBoosterAdapter;constructor(e,t){this.config=e,this.agentBoosterAdapter=t}async collectSignals(e){let t=e.task.toLowerCase(),r=await this.checkAgentBoosterEligibility(e),o={simple:this.findKeywordMatches(t,d.simple),moderate:this.findKeywordMatches(t,d.moderate),complex:this.findKeywordMatches(t,d.complex),critical:this.findKeywordMatches(t,d.critical)},c=e.codeContext?e.codeContext.split(`
|
|
3
3
|
`).length:void 0,n=e.filePaths?e.filePaths.length:void 0,i=f.architecture.test(t),a=f.security.test(t),l=f.multiStep.test(t),g=f.crossDomain.test(t),b=this.detectCreativityRequirement(t),S=this.estimateLanguageComplexity(e.codeContext,e.filePaths),T=e.codeContext?this.estimateCyclomaticComplexity(e.codeContext):void 0;return{linesOfCode:c,fileCount:n,hasArchitectureScope:i,hasSecurityScope:a,requiresMultiStepReasoning:l,requiresCrossDomainCoordination:g,isMechanicalTransform:r.eligible,languageComplexity:S,cyclomaticComplexity:T,dependencyCount:this.countDependencies(e.codeContext),requiresCreativity:b,detectedTransformType:r.transformType,keywordMatches:o}}async checkAgentBoosterEligibility(e){if(!this.config.enableAgentBooster)return{eligible:!1,confidence:0,reason:"Agent Booster is disabled"};let t=e.task.toLowerCase(),r,o=0;for(let n of h){let i=this.getTransformKeywords(n),a=0;for(let l of i)t.includes(l.toLowerCase())&&(a=a===0?.5:a+.25);for(let l of d.mechanical)t.includes(l.toLowerCase())&&(a=Math.max(a,.6));a>o&&(o=a,r=n)}if(e.codeContext&&r&&this.agentBoosterAdapter)try{let i=(await this.agentBoosterAdapter.detectTransformOpportunities(e.codeContext)).opportunities.find(a=>a.type===r);if(i)return{eligible:i.confidence>=this.config.agentBoosterThreshold,transformType:r,confidence:i.confidence,reason:i.reason}}catch(n){console.debug("[SignalCollector] WASM analysis error:",n instanceof Error?n.message:n)}let c=o>=this.config.agentBoosterThreshold&&r!==void 0;return{eligible:c,transformType:r,confidence:Math.min(o,1),reason:c?`Detected ${r} transform pattern`:"No mechanical transform pattern detected"}}findKeywordMatches(e,t){let r=[];for(let o of t)e.includes(o.toLowerCase())&&r.push(o);return r}detectCreativityRequirement(e){return e.includes("design")||e.includes("creative")||e.includes("innovative")||e.includes("novel")}estimateLanguageComplexity(e,t){if(!e&&(!t||t.length===0))return;let r=[".ts",".tsx",".rs",".cpp",".c",".go"],o=[".js",".jsx",".py",".java"],c=[".json",".yaml",".md",".txt",".css",".html"];if(t){for(let n of t)if(r.some(i=>n.endsWith(i)))return"high";for(let n of t)if(o.some(i=>n.endsWith(i)))return"medium";for(let n of t)if(c.some(i=>n.endsWith(i)))return"low"}if(e){let n=/<[A-Z][^>]*>/.test(e),i=/\b(async|await)\b/.test(e),a=/\b(interface|type|class)\b/.test(e);return n&&a?"high":i||a?"medium":"low"}return"medium"}estimateCyclomaticComplexity(e){let t=[/\bif\b/g,/\bfor\b/g,/\bwhile\b/g,/\bcase\b/g,/\bcatch\b/g,/&&/g,/\|\|/g,/\?/g],r=1;for(let o of t){let c=e.match(o);c&&(r+=c.length)}return r}countDependencies(e){if(!e)return;let t=e.match(/\b(import|require|from)\b.*['"].*['"]/g);return t?t.length:0}getTransformKeywords(e){return{"var-to-const":["var to const","convert var","var declaration","var to let","convert var to const","change var to const"],"add-types":["add types","add type","typescript types","type annotations","type annotation","add type annotations"],"remove-console":["remove console","delete console","console.log","remove console.log","strip console"],"promise-to-async":["promise to async","async await",".then to async","convert to async","convert function to async"],"cjs-to-esm":["commonjs to esm","require to import","convert to esm","cjs to esm","module conversion"],"func-to-arrow":["arrow function","function to arrow","convert to arrow","convert function to arrow"]}[e]||[]}};function v(s,e){return new m(s,e)}var u=class{calculateCodeComplexity(e){let t=0;return t+=this.calculateLinesOfCodeContribution(e.linesOfCode),t+=this.calculateFileCountContribution(e.fileCount),t+=this.calculateCyclomaticContribution(e.cyclomaticComplexity),t+=this.calculateLanguageContribution(e.languageComplexity),Math.min(t,100)}calculateReasoningComplexity(e){let t=0;return t+=this.calculateKeywordScore(e.keywordMatches),e.requiresMultiStepReasoning&&(t+=20),e.requiresCreativity&&(t+=20),Math.min(t,100)}calculateScopeComplexity(e){let t=0;return e.hasArchitectureScope&&(t+=40),e.hasSecurityScope&&(t+=30),e.requiresCrossDomainCoordination&&(t+=20),t+=this.calculateDependencyContribution(e.dependencyCount),Math.min(t,100)}calculateOverallComplexity(e,t,r,o){if(o.isMechanicalTransform&&!o.hasSecurityScope&&!o.hasArchitectureScope&&!o.requiresMultiStepReasoning&&!o.requiresCrossDomainCoordination&&e===0&&t===0&&r===0)return 5;let c=e*.3+t*.4+r*.3,n=0;return o.hasSecurityScope&&(n=Math.max(n,50)),o.hasArchitectureScope&&(n=Math.max(n,55)),o.requiresCrossDomainCoordination&&(n=Math.max(n,35)),o.requiresMultiStepReasoning&&(n=Math.max(n,30)),o.keywordMatches.simple.length+o.keywordMatches.moderate.length+o.keywordMatches.complex.length+o.keywordMatches.critical.length===0&&!o.isMechanicalTransform&&c<15&&(n=Math.max(n,15)),Math.min(Math.max(Math.round(c),n),100)}calculateConfidence(e,t){let r=.5;return t.codeContext&&(r+=.2),t.filePaths&&t.filePaths.length>0&&(r+=.1),r+=this.calculateKeywordConfidenceBoost(e.keywordMatches),e.isMechanicalTransform&&(r+=.15),Math.min(r,1)}calculateLinesOfCodeContribution(e){return e===void 0||e<10?0:e<50?10:e<200?20:30}calculateFileCountContribution(e){return e===void 0||e===1?0:e<5?10:20}calculateCyclomaticContribution(e){return e===void 0||e<5?0:e<10?10:e<20?20:30}calculateLanguageContribution(e){return e==="low"?0:e==="medium"?10:e==="high"?20:0}calculateKeywordScore(e){let t=e.simple.length*5+e.moderate.length*15+e.complex.length*25+e.critical.length*35;return Math.min(t,60)}calculateDependencyContribution(e){return e===void 0||e<3?0:e<10?5:10}calculateKeywordConfidenceBoost(e){let t=e.simple.length+e.moderate.length+e.complex.length+e.critical.length;return t>=3?.1:t>=1?.05:0}};function M(){return new u}var p=class{getRecommendedTier(e){for(let t of[0,1,2,3,4]){let[r,o]=C[t].complexityRange;if(e>=r&&e<=o)return t}return 2}findAlternateTiers(e,t){let r=[];return t>0&&r.push(t-1),t<4&&r.push(t+1),t<3&&!r.includes(4)&&r.push(4),r}generateExplanation(e,t,r){let o=[];return o.push(`Complexity score: ${e}/100 (Tier ${t})`),r.isMechanicalTransform&&o.push(this.formatMechanicalTransformInfo(r.detectedTransformType)),o.push(...this.formatScopeExplanations(r)),o.push(...this.formatCodeMetricsExplanations(r)),o.join(". ")}formatMechanicalTransformInfo(e){return`Detected mechanical transform: ${e}`}formatScopeExplanations(e){let t=[];return e.hasArchitectureScope&&t.push("Architecture scope detected"),e.hasSecurityScope&&t.push("Security scope detected"),e.requiresMultiStepReasoning&&t.push("Multi-step reasoning required"),e.requiresCrossDomainCoordination&&t.push("Cross-domain coordination required"),t}formatCodeMetricsExplanations(e){let t=[];return e.linesOfCode!==void 0&&e.linesOfCode>100&&t.push(`Large code change: ${e.linesOfCode} lines`),e.fileCount!==void 0&&e.fileCount>3&&t.push(`Multi-file change: ${e.fileCount} files`),t}};function w(){return new p}var y=class{config;signalCollector;scoreCalculator;tierRecommender;constructor(e,t,r,o){this.config=e,this.signalCollector=t,this.scoreCalculator=r,this.tierRecommender=o}async analyze(e){try{let t=await this.signalCollector.collectSignals(e),r=this.scoreCalculator.calculateCodeComplexity(t),o=this.scoreCalculator.calculateReasoningComplexity(t),c=this.scoreCalculator.calculateScopeComplexity(t),n=this.scoreCalculator.calculateOverallComplexity(r,o,c,t),i=this.tierRecommender.getRecommendedTier(n),a=this.tierRecommender.findAlternateTiers(n,i),l=this.scoreCalculator.calculateConfidence(t,e),g=this.tierRecommender.generateExplanation(n,i,t);return{overall:n,codeComplexity:r,reasoningComplexity:o,scopeComplexity:c,confidence:l,signals:t,recommendedTier:i,alternateTiers:a,explanation:g}}catch(t){throw new x(`Failed to analyze task complexity: ${t instanceof Error?t.message:"Unknown error"}`,t instanceof Error?t:void 0)}}async checkAgentBoosterEligibility(e){return this.signalCollector.checkAgentBoosterEligibility(e)}getRecommendedTier(e){return this.tierRecommender.getRecommendedTier(e)}};function L(s,e){let t=new m(s,e),r=new u,o=new p;return new y(s,t,r,o)}function z(s,e,t,r){return new y(s,e,t,r)}export{m as a,v as b,u as c,M as d,p as e,w as f,y as g,L as h,z as i};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
2
|
-
import{b as l,c}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.11.5");process.exit(0)}
|
|
2
|
+
import{b as l,c}from"./chunk-TTJJ4DQE.js";import{i}from"./chunk-K4I7UIU5.js";c();var u=.15,d=.03,p=.25,s=class{constructor(t){this.db=t;l(t)}db;recordNull(t){this.db.prepare(`
|
|
3
3
|
INSERT INTO qe_pattern_nulls (id, pattern_id, context_fingerprint, failure_mode, trajectory_ref, evidence_class)
|
|
4
4
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
5
5
|
ON CONFLICT(pattern_id, context_fingerprint) DO UPDATE SET
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
2
|
-
import{c as t,e as o}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.11.5");process.exit(0)}
|
|
2
|
+
import{c as t,e as o}from"./chunk-C4EZNOWK.js";var g={};o(g,{DotProductAttention:()=>u,FlashAttention:()=>m,HyperbolicAttention:()=>h,LinearAttention:()=>f,MoEAttention:()=>_,MultiHeadAttention:()=>A,RuvectorLayer:()=>a,SonaEngine:()=>b,TensorCompress:()=>c,default:()=>r,differentiableSearch:()=>l,getCompressionLevel:()=>p,hierarchicalForward:()=>s,init:()=>d,pipeline:()=>L});import{createRequire as n}from"module";var i,e,r,a,c,l,s,p,d,m,u,A,h,f,_,b,L,q=t(()=>{i=n(import.meta.url),e=i("hnswlib-node"),r=e,{RuvectorLayer:a,TensorCompress:c,differentiableSearch:l,hierarchicalForward:s,getCompressionLevel:p,init:d,FlashAttention:m,DotProductAttention:u,MultiHeadAttention:A,HyperbolicAttention:h,LinearAttention:f,MoEAttention:_,SonaEngine:b,pipeline:L}=e||{}});export{r as a,a as b,c,l as d,s as e,p as f,d as g,m as h,u as i,A as j,h as k,f as l,_ as m,b as n,L as o,g as p,q};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.
|
|
2
|
-
import{b as y,d as p}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.11.5");process.exit(0)}
|
|
2
|
+
import{b as y,d as p}from"./chunk-UBI2EOS3.js";import{i as h}from"./chunk-K4I7UIU5.js";var f={healthyThreshold:3,warningThreshold:2,checkIntervalMs:5e3,maxHistoryEntries:100,alertsEnabled:!0,alertCooldownMs:6e4,selfHealingEnabled:!1,maxHealingActionsPerMinute:5};var g=class{calculator;config;eventBus;persistence;graph;history=[];alerts=new Map;lastAlertTime=new Map;monitoringInterval=null;isMonitoring=!1;constructor(e,t={},r,i){this.graph=e,this.config={...f,...t},this.calculator=p(),this.eventBus=r,this.persistence=i}start(){this.isMonitoring||(this.isMonitoring=!0,this.monitoringInterval=setInterval(()=>this.checkHealth(),this.config.checkIntervalMs),this.checkHealth())}stop(){this.monitoringInterval&&(clearInterval(this.monitoringInterval),this.monitoringInterval=null),this.isMonitoring=!1}updateGraph(e){this.graph=e,this.isMonitoring&&this.checkHealth()}isEmptyTopology(){return this.graph.getVerticesByType("agent").length===0}checkHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph),r=this.isEmptyTopology()?"idle":this.determineStatus(e),i=this.calculateTrend();return this.recordHistory(e),this.isEmptyTopology()||this.checkAlertConditions(e,t,r),this.persistence&&t.length>0&&this.persistence.saveWeakVertices(t).catch(n=>console.warn("[MinCutHealthMonitor] Failed to persist weak vertices:",n)),this.emitEvent("mincut.updated",e,{status:r,weakVertexCount:t.length}),{status:r,minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:i,history:this.history.slice(-20),lastUpdated:new Date}}getHealth(){let e=this.calculator.getMinCutValue(this.graph),t=this.calculator.findWeakVertices(this.graph);return{status:this.isEmptyTopology()?"idle":this.determineStatus(e),minCutValue:e,healthyThreshold:this.config.healthyThreshold,warningThreshold:this.config.warningThreshold,weakVertexCount:t.length,topWeakVertices:t.slice(0,5),trend:this.calculateTrend(),history:this.history.slice(-20),lastUpdated:new Date}}getMinCutValue(){return this.calculator.getMinCutValue(this.graph)}getWeakVertices(){return this.calculator.findWeakVertices(this.graph)}isCritical(){return this.calculator.getMinCutValue(this.graph)<this.config.warningThreshold}isHealthy(){return this.calculator.getMinCutValue(this.graph)>=this.config.healthyThreshold}getActiveAlerts(){return Array.from(this.alerts.values()).filter(e=>!e.acknowledged).sort((e,t)=>{let r={critical:0,high:1,medium:2,low:3,info:4};return r[e.severity]-r[t.severity]})}getAllAlerts(){return Array.from(this.alerts.values())}acknowledgeAlert(e){let t=this.alerts.get(e);return t?(t.acknowledged=!0,!0):!1}clearAcknowledgedAlerts(){let e=[];for(let[t,r]of this.alerts)r.acknowledged&&e.push(t);for(let t of e)this.alerts.delete(t);return e.length}getHistory(){return[...this.history]}getTrend(){return this.calculateTrend()}getStats(e=6e4){let t=Date.now()-e,r=this.history.filter(n=>n.timestamp.getTime()>t);if(r.length===0){let n=this.calculator.getMinCutValue(this.graph);return{min:n,max:n,average:n,count:0}}let i=r.map(n=>n.value);return{min:Math.min(...i),max:Math.max(...i),average:i.reduce((n,a)=>n+a,0)/i.length,count:r.length}}updateConfig(e){Object.assign(this.config,e),e.checkIntervalMs&&this.isMonitoring&&(this.stop(),this.start())}getConfig(){return{...this.config}}determineStatus(e){return e>=this.config.healthyThreshold?"healthy":e>=this.config.warningThreshold?"warning":"critical"}calculateTrend(){if(this.history.length<3)return"stable";let e=this.history.slice(-5),t=e[0].value,i=e[e.length-1].value-t,a=e.reduce((o,c)=>o+c.value,0)/e.length*.1;return i>a?"improving":i<-a?"degrading":"stable"}recordHistory(e){let t={timestamp:new Date,value:e,vertexCount:this.graph.vertexCount,edgeCount:this.graph.edgeCount};for(this.history.push(t);this.history.length>this.config.maxHistoryEntries;)this.history.shift()}checkAlertConditions(e,t,r){if(!this.config.alertsEnabled)return;let i=Date.now();r==="critical"?this.maybeGenerateAlert("critical-threshold","critical",`MinCut value (${e.toFixed(2)}) is below critical threshold (${this.config.warningThreshold})`,e,this.config.warningThreshold,t):r==="warning"&&this.maybeGenerateAlert("warning-threshold","high",`MinCut value (${e.toFixed(2)}) is below healthy threshold (${this.config.healthyThreshold})`,e,this.config.healthyThreshold,t);let n=t.filter(o=>o.weightedDegree===0);n.length>0&&this.maybeGenerateAlert("isolated-vertices","high",`${n.length} isolated vertex(es) detected`,e,0,n);let a=t.filter(o=>o.riskScore>.8);a.length>0&&this.maybeGenerateAlert("critical-vertices","medium",`${a.length} critical vertex(es) with high risk score`,e,0,a)}maybeGenerateAlert(e,t,r,i,n,a){let o=Date.now(),c=this.lastAlertTime.get(e)||0;if(o-c<this.config.alertCooldownMs)return;let s={id:h(),severity:t,message:r,minCutValue:i,threshold:n,affectedVertices:a.map(l=>l.vertexId),timestamp:new Date,acknowledged:!1,remediations:a.flatMap(l=>l.suggestions).slice(0,5)};this.alerts.set(s.id,s),this.persistence&&this.persistence.saveAlert(s).catch(l=>console.warn("[MinCutHealthMonitor] Failed to persist alert:",l)),this.lastAlertTime.set(e,o),this.emitEvent("mincut.alert.generated",i,{alert:s})}emitEvent(e,t,r){if(!this.eventBus)return;let i={id:h(),type:e,source:"coordination",timestamp:new Date,correlationId:h(),payload:{minCutValue:t,...r}};this.eventBus.publish(i).catch(n=>{console.error("Failed to publish MinCut event:",n)})}};function v(m,e,t,r){return new g(m,e,t,r)}var d=null,u=null;function C(){return d||(d=y()),d}function P(){return u||(u=v(C())),u}function B(){return d!==null}function F(){return u!==null}export{f as a,v as b,C as c,P as d,B as e,F as f};
|