agentic-qe 3.13.4 → 3.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +430 -430
- package/.claude/helpers/helpers.manifest.json +6 -6
- package/.claude/helpers/hook-handler.cjs +565 -565
- package/.claude/helpers/intelligence.cjs +1058 -1058
- package/.claude/helpers/statusline.cjs +1022 -968
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +89 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-7XXMDGFO.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-PR3RQWXF.js → agent-booster-wasm-TMON22NL.js} +2 -2
- package/dist/cli/chunks/{agent-handler-J5EPFBSZ.js → agent-handler-JOX6O26U.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-CCHI6QAA.js → agent-memory-branch-AMIJIDCM.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-2KGMCBJG.js +2 -0
- package/dist/cli/chunks/{arena-KMKBGSMY.js → arena-N6SO2CCQ.js} +2 -2
- package/dist/cli/chunks/{arena-SI7IPVZ3.js → arena-RKLFXDMO.js} +4 -4
- package/dist/cli/chunks/{audit-ZDKR3HT6.js → audit-ZJE3DUH6.js} +3 -3
- package/dist/cli/chunks/base-4M3VL4XK.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-BP5CZGMD.js → better-sqlite3-5G6AR6LX.js} +2 -2
- package/dist/cli/chunks/{brain-handler-MSYMTM5B.js → brain-handler-QD4DZ574.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-FRAHCBTO.js → branch-enumerator-PG3OUYE6.js} +2 -2
- package/dist/cli/chunks/{browser-4KHKVNYC.js → browser-Y2DJG7HQ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-DHIPXEGO.js +2 -0
- package/dist/cli/chunks/{chunk-Q4VZXT6X.js → chunk-2BUDKFIE.js} +1 -1
- package/dist/cli/chunks/{chunk-NQVF4M7L.js → chunk-2FTAMEOB.js} +1 -1
- package/dist/cli/chunks/{chunk-AROPZPNG.js → chunk-2ILX73JG.js} +1 -1
- package/dist/cli/chunks/{chunk-6GNVVQW3.js → chunk-2SVDR5KB.js} +2 -2
- package/dist/cli/chunks/{chunk-HN2DD2DQ.js → chunk-2VUXU22M.js} +2 -2
- package/dist/cli/chunks/{chunk-U52IQFMP.js → chunk-3OUHOJBN.js} +1 -1
- package/dist/cli/chunks/{chunk-BQRCNRTJ.js → chunk-3QJH5W55.js} +2 -2
- package/dist/cli/chunks/{chunk-OU2YHXJY.js → chunk-3TC4ZPGR.js} +2 -2
- package/dist/cli/chunks/{chunk-ISGKDLZ7.js → chunk-463VBHHH.js} +2 -2
- package/dist/cli/chunks/{chunk-IN5KRJSE.js → chunk-4VWB64OH.js} +1 -1
- package/dist/cli/chunks/{chunk-WSQE3VZB.js → chunk-4YFBAXRD.js} +1 -1
- package/dist/cli/chunks/{chunk-N7LIYK7Z.js → chunk-523XPMTU.js} +1 -1
- package/dist/cli/chunks/{chunk-QXF6EQFP.js → chunk-5CMZDVUR.js} +2 -2
- package/dist/cli/chunks/{chunk-VOAXVNO5.js → chunk-5VGQABM3.js} +4 -4
- package/dist/cli/chunks/{chunk-UOO7P2AK.js → chunk-5VV5MOED.js} +2 -2
- package/dist/cli/chunks/{chunk-5IVXM3TE.js → chunk-6FICUNAV.js} +1 -1
- package/dist/cli/chunks/{chunk-LASZCR5G.js → chunk-6ITWOYET.js} +2 -2
- package/dist/cli/chunks/{chunk-7EL5QEMJ.js → chunk-6QZSF6RL.js} +2 -2
- package/dist/cli/chunks/{chunk-KDICUKYX.js → chunk-6UPQD42K.js} +2 -2
- package/dist/cli/chunks/{chunk-LJSHQU2P.js → chunk-6VUEUYFL.js} +5 -5
- package/dist/cli/chunks/{chunk-75CFWCQV.js → chunk-7225UNNY.js} +2 -2
- package/dist/cli/chunks/{chunk-L3UTZEVW.js → chunk-75QKZ6VX.js} +2 -2
- package/dist/cli/chunks/{chunk-GRMKN44A.js → chunk-7GTB7LVJ.js} +3 -3
- package/dist/cli/chunks/{chunk-EUIUWZF4.js → chunk-7KRZ2Q6B.js} +3 -3
- package/dist/cli/chunks/{chunk-ERKYIV25.js → chunk-7NYCYSGW.js} +2 -2
- package/dist/cli/chunks/{chunk-7YAHECC5.js → chunk-7TON6JSG.js} +2 -2
- package/dist/cli/chunks/chunk-ACHMNMEJ.js +2 -0
- package/dist/cli/chunks/{chunk-27FWRWOB.js → chunk-ADYY2GKC.js} +2 -2
- package/dist/cli/chunks/{chunk-NAZFAGJ5.js → chunk-AOUULKKT.js} +2 -2
- package/dist/cli/chunks/{chunk-XBSBVPSM.js → chunk-AU3APBY2.js} +2 -2
- package/dist/cli/chunks/{chunk-C3AF5Z55.js → chunk-BAOKXLIV.js} +2 -2
- package/dist/cli/chunks/{chunk-RO4BYINM.js → chunk-BDVZF46F.js} +2 -2
- package/dist/cli/chunks/{chunk-LIMFWEUI.js → chunk-BGLSIA4U.js} +2 -2
- package/dist/cli/chunks/{chunk-UNMWI4QU.js → chunk-BI6UU3Z3.js} +1 -1
- package/dist/cli/chunks/{chunk-SFRYDGLF.js → chunk-BOM5NGCR.js} +1 -1
- package/dist/cli/chunks/{chunk-QENUKXPP.js → chunk-CBXJ4AQS.js} +2 -2
- package/dist/cli/chunks/{chunk-6XCULO27.js → chunk-CKYRZ3TA.js} +2 -2
- package/dist/cli/chunks/{chunk-RLZZTFEN.js → chunk-CTILSLXF.js} +2 -2
- package/dist/cli/chunks/chunk-CVXEOTIK.js +2 -0
- package/dist/cli/chunks/{chunk-3RSF7POD.js → chunk-D777E2MT.js} +2 -2
- package/dist/cli/chunks/{chunk-FZ4MUDHZ.js → chunk-DKGDBKBJ.js} +1 -1
- package/dist/cli/chunks/{chunk-KO3UQYGY.js → chunk-DLBJ7IZT.js} +75 -75
- package/dist/cli/chunks/{chunk-56QR72EB.js → chunk-DR2M2SI2.js} +2 -2
- package/dist/cli/chunks/{chunk-MP3RCZ75.js → chunk-DS53MJCN.js} +1 -1
- package/dist/cli/chunks/{chunk-KE656E6T.js → chunk-DSIS6WQD.js} +3 -3
- package/dist/cli/chunks/{chunk-CQP6BDSF.js → chunk-DSTQ2OWI.js} +1 -1
- package/dist/cli/chunks/{chunk-WUXCL65V.js → chunk-DXM7IN2W.js} +2 -2
- package/dist/cli/chunks/{chunk-O74V7MB4.js → chunk-E3OKRZCH.js} +2 -2
- package/dist/cli/chunks/{chunk-TO7FTPRV.js → chunk-E7MD5LHC.js} +2 -2
- package/dist/cli/chunks/{chunk-A2G26WU4.js → chunk-EKWEJOV7.js} +1 -1
- package/dist/cli/chunks/chunk-EP4ORDFE.js +2 -0
- package/dist/cli/chunks/{chunk-5RVWL2U3.js → chunk-EVJSK56E.js} +3 -3
- package/dist/cli/chunks/chunk-EY44JDUL.js +12 -0
- package/dist/cli/chunks/{chunk-JDADACZZ.js → chunk-EYHRYIBX.js} +1 -1
- package/dist/cli/chunks/{chunk-FJSL7TWU.js → chunk-EYWR4Y3J.js} +1 -1
- package/dist/cli/chunks/{chunk-E7FCVH32.js → chunk-F66FYZQF.js} +2 -2
- package/dist/cli/chunks/{chunk-GNFKG2LX.js → chunk-FGQH5LOG.js} +2 -2
- package/dist/cli/chunks/{chunk-ZAT65V6I.js → chunk-FH6H4KOZ.js} +17 -17
- package/dist/cli/chunks/{chunk-OU3SYEYJ.js → chunk-FV47SYXK.js} +1 -1
- package/dist/cli/chunks/chunk-GA7PUAMT.js +2 -0
- package/dist/cli/chunks/{chunk-IVZA5XTW.js → chunk-GEH3S5DI.js} +2 -2
- package/dist/cli/chunks/{chunk-44SYMJ4T.js → chunk-GQCYO54W.js} +2 -2
- package/dist/cli/chunks/{chunk-4HVVVVUF.js → chunk-GSZL3WST.js} +2 -2
- package/dist/cli/chunks/{chunk-XTHRSBMJ.js → chunk-GV3C224P.js} +2 -2
- package/dist/cli/chunks/{chunk-JBHGMLN7.js → chunk-HBNMEYJS.js} +182 -201
- package/dist/cli/chunks/{chunk-LUAYTM77.js → chunk-HPRX5S74.js} +1 -1
- package/dist/cli/chunks/{chunk-PFQLB4XP.js → chunk-HWWMINXV.js} +2 -2
- package/dist/cli/chunks/{chunk-UQFMQOZB.js → chunk-IHUAEQZN.js} +1 -1
- package/dist/cli/chunks/{chunk-GGZB2ZBB.js → chunk-ISOTSVI7.js} +1 -1
- package/dist/cli/chunks/{chunk-RCRKCMN5.js → chunk-JDADNBWS.js} +1 -1
- package/dist/cli/chunks/{chunk-ITQCSIYG.js → chunk-JGQZ7ECC.js} +1 -1
- package/dist/cli/chunks/{chunk-5R26MAMK.js → chunk-JH6KUV74.js} +2 -2
- package/dist/cli/chunks/{chunk-6CZUQA4G.js → chunk-JPJSOS4H.js} +1 -1
- package/dist/cli/chunks/{chunk-NW4YPUPN.js → chunk-JQXAWTS5.js} +3 -3
- package/dist/cli/chunks/{chunk-II2RP3MY.js → chunk-K7ZFBGLE.js} +2 -2
- package/dist/cli/chunks/chunk-KBHSID6C.js +62 -0
- package/dist/cli/chunks/{chunk-KZAVYHH7.js → chunk-KHDE4KT5.js} +4 -4
- package/dist/cli/chunks/{chunk-LEIG3KIG.js → chunk-KMCI3RGD.js} +2 -2
- package/dist/cli/chunks/{chunk-KB4S7MGB.js → chunk-LGP26FTM.js} +2 -2
- package/dist/cli/chunks/{chunk-55E62F4T.js → chunk-LLVXOXAK.js} +1 -1
- package/dist/cli/chunks/{chunk-PIYDPOW6.js → chunk-LQYAJ7RR.js} +2 -2
- package/dist/cli/chunks/{chunk-KQLJILCZ.js → chunk-LVLGRUUJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PRHLV6FS.js → chunk-LYGHX4II.js} +1 -1
- package/dist/cli/chunks/{chunk-RKNKFLCQ.js → chunk-MOIKR7RU.js} +2 -2
- package/dist/cli/chunks/chunk-MSA6MD5C.js +2 -0
- package/dist/cli/chunks/{chunk-MWWTYPFL.js → chunk-MTEEFP6V.js} +2 -2
- package/dist/cli/chunks/{chunk-OR2RC7ZH.js → chunk-N6QUDQ5H.js} +2 -2
- package/dist/cli/chunks/{chunk-Z7FVGJYC.js → chunk-N7JRGAJF.js} +2 -2
- package/dist/cli/chunks/{chunk-WCUXA3NV.js → chunk-NNIAUDHF.js} +1 -1
- package/dist/cli/chunks/{chunk-SQCACQUM.js → chunk-NUCVMWDJ.js} +2 -2
- package/dist/cli/chunks/{chunk-N57M7UPQ.js → chunk-NUDDFJYU.js} +2 -2
- package/dist/cli/chunks/{chunk-GIU26D5G.js → chunk-NX6FOAS4.js} +1 -1
- package/dist/cli/chunks/{chunk-ZYCPTARG.js → chunk-O34674VM.js} +2 -2
- package/dist/cli/chunks/{chunk-PJFQGNRW.js → chunk-OIGWREK7.js} +1 -1
- package/dist/cli/chunks/{chunk-DQ247474.js → chunk-OS56PKRO.js} +2 -2
- package/dist/cli/chunks/{chunk-OF7674H5.js → chunk-P4CHYYJN.js} +2 -2
- package/dist/cli/chunks/{chunk-VLELNETG.js → chunk-P6A35LKJ.js} +2 -2
- package/dist/cli/chunks/{chunk-GOFP47XU.js → chunk-PA6SUNDD.js} +1 -1
- package/dist/cli/chunks/{chunk-O45CEMVF.js → chunk-PGDDPZ7W.js} +1 -1
- package/dist/cli/chunks/{chunk-ESMSH7HG.js → chunk-PLYGIUFO.js} +2 -2
- package/dist/cli/chunks/{chunk-EEHEMDNV.js → chunk-POZ3S4UO.js} +2 -2
- package/dist/cli/chunks/{chunk-NQJLUY2K.js → chunk-PSAXLKDZ.js} +2 -2
- package/dist/cli/chunks/{chunk-HGY62IYZ.js → chunk-PTBW2QXE.js} +2 -2
- package/dist/cli/chunks/{chunk-PI55PHUL.js → chunk-PW3JLQGH.js} +2 -2
- package/dist/cli/chunks/{chunk-GOHWEQEP.js → chunk-PX7MVV6F.js} +2 -2
- package/dist/cli/chunks/{chunk-SJ26ZR75.js → chunk-Q4RU4XG6.js} +2 -2
- package/dist/cli/chunks/{chunk-XF4F5ZXO.js → chunk-QQA4N3YT.js} +4 -4
- package/dist/cli/chunks/chunk-QSO5RFJ4.js +15 -0
- package/dist/cli/chunks/{chunk-Z6FK7T7J.js → chunk-R2GHZ2QG.js} +2 -2
- package/dist/cli/chunks/{chunk-VDPQ7NVG.js → chunk-R5FSKAS3.js} +1 -1
- package/dist/cli/chunks/{chunk-5DESO7E4.js → chunk-R5LDNZVB.js} +2 -2
- package/dist/cli/chunks/{chunk-X5JMTHXC.js → chunk-RBNSZFVL.js} +3 -3
- package/dist/cli/chunks/{chunk-TM6LLT4G.js → chunk-RDSO3R2R.js} +3 -3
- package/dist/cli/chunks/{chunk-27REOPQK.js → chunk-SZO6JIFM.js} +2 -2
- package/dist/cli/chunks/{chunk-IU5SILCS.js → chunk-TGSL4OOT.js} +2 -2
- package/dist/cli/chunks/{chunk-4FP4PJ45.js → chunk-THW6LF5I.js} +2 -2
- package/dist/cli/chunks/{chunk-FBXWU37F.js → chunk-TMM5NKPI.js} +1 -1
- package/dist/cli/chunks/{chunk-VZO4V4R4.js → chunk-TWNXZOJY.js} +2 -2
- package/dist/cli/chunks/{chunk-X67O2KUE.js → chunk-U63JEFF5.js} +7 -7
- package/dist/cli/chunks/{chunk-IUFNB6I6.js → chunk-UHQA6EH6.js} +2 -2
- package/dist/cli/chunks/{chunk-XLP44YGX.js → chunk-UN2MXDJT.js} +2 -2
- package/dist/cli/chunks/{chunk-CTNDSP2M.js → chunk-UNLH7NPY.js} +1 -1
- package/dist/cli/chunks/{chunk-EPSF2ERW.js → chunk-V4QQTPZF.js} +2 -2
- package/dist/cli/chunks/{chunk-UAEP2ZUQ.js → chunk-V5MS6XNT.js} +2 -2
- package/dist/cli/chunks/{chunk-XEI5LLHX.js → chunk-VK5I4JSN.js} +2 -2
- package/dist/cli/chunks/{chunk-W37WY3OL.js → chunk-VSP2IB5N.js} +2 -2
- package/dist/cli/chunks/{chunk-PD2ZSCEH.js → chunk-WA553ALQ.js} +1 -1
- package/dist/cli/chunks/{chunk-TFFEB7XD.js → chunk-X3CHYV7G.js} +2 -2
- package/dist/cli/chunks/{chunk-MPVOZKUP.js → chunk-X75OYPS6.js} +1 -1
- package/dist/cli/chunks/{chunk-C75V5PTW.js → chunk-XF2TKGSC.js} +1 -1
- package/dist/cli/chunks/{chunk-Y7VWCP35.js → chunk-XLDEWLP4.js} +1 -1
- package/dist/cli/chunks/{chunk-26SNR2EK.js → chunk-XRH2D6JV.js} +3 -3
- package/dist/cli/chunks/{chunk-MANWLRAW.js → chunk-XZPAKAFJ.js} +1 -1
- package/dist/cli/chunks/{chunk-6XVP6BGM.js → chunk-Y2QZK46R.js} +2 -2
- package/dist/cli/chunks/{chunk-6BHRSGR7.js → chunk-YL7CAOQG.js} +3 -3
- package/dist/cli/chunks/{chunk-SPTCNM45.js → chunk-YOVQBSTW.js} +2 -2
- package/dist/cli/chunks/{chunk-2Q73TQUQ.js → chunk-YQUZGPUQ.js} +1 -1
- package/dist/cli/chunks/{chunk-YZGA4ELM.js → chunk-YRRYKR7U.js} +2 -2
- package/dist/cli/chunks/{chunk-NAAPL2HK.js → chunk-Z6SAS2NU.js} +1 -1
- package/dist/cli/chunks/{ci-DK4FGREO.js → ci-MWQVCZ2W.js} +2 -2
- package/dist/cli/chunks/{ci-output-HQBBQQES.js → ci-output-ZCH4IZ7H.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-MJCS46DN.js → circuit-breaker-N3VSQM5X.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-IIQT52H4.js → claude-flow-setup-TSJFOGXN.js} +2 -2
- package/dist/cli/chunks/client-IEN43WBH.js +2 -0
- package/dist/cli/chunks/{cline-installer-7SPKUNNZ.js → cline-installer-OHKWAB4I.js} +2 -2
- package/dist/cli/chunks/{code-V2B4FP3X.js → code-3UTIL3QR.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-IRGAI76Y.js → code-index-extractor-TVG2V2NY.js} +2 -2
- package/dist/cli/chunks/{codex-installer-PDFCYRU6.js → codex-installer-L6ZOTOO2.js} +2 -2
- package/dist/cli/chunks/{completions-TAJ6N7YZ.js → completions-SFRB664X.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-JHQKQKBG.js → complexity-analyzer-HDZKVO6D.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-DESZXCLC.js → continuedev-installer-HKLZR3UO.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-OQPXBLWS.js → copilot-installer-5P3LX3C5.js} +2 -2
- package/dist/cli/chunks/core-handlers-PBITKHVP.js +2 -0
- package/dist/cli/chunks/{cost-tracker-KHDFSCAJ.js → cost-tracker-MZR5RB6E.js} +2 -2
- package/dist/cli/chunks/{coverage-T7EENIDE.js → coverage-L6V6NFIM.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-JGCWQ7BO.js +2 -0
- package/dist/cli/chunks/{cursor-installer-X6BFU5QU.js → cursor-installer-FD6DT23Y.js} +2 -2
- package/dist/cli/chunks/{daemon-UTPP4JCG.js → daemon-HTSRODRG.js} +4 -4
- package/dist/cli/chunks/{daemon-22NOG5XI.js → daemon-I5ESGZGX.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-XI6DG3FW.js → dag-attention-scheduler-JPTHWB2Q.js} +2 -2
- package/dist/cli/chunks/{detect-7IMQGJ5I.js → detect-RTUZDBEZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-YMLM4K7J.js → dist-node-5HLWHNYA.js} +2 -2
- package/dist/cli/chunks/{domain-handler-LRTJGTEH.js → domain-handler-R7IPUX54.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-HZJ3WUCT.js → domain-transfer-E3I2LMCB.js} +2 -2
- package/dist/cli/chunks/dream-52MPUF5Q.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-QSRN7Z5Q.js → embed-and-insert-pattern-BXUWG73R.js} +2 -2
- package/dist/cli/chunks/{eval-JVVVQVV6.js → eval-3ZFM75YA.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-ORZN3ROJ.js → experience-capture-middleware-NJ3BT657.js} +3 -3
- package/dist/cli/chunks/{fast-paths-LUFARZR5.js → fast-paths-Q3V5C5IM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ZHQESXIP.js → feature-flags-D3JGPHXY.js} +2 -2
- package/dist/cli/chunks/{feature-flags-2XC4ECLW.js → feature-flags-XZGJNPZ7.js} +2 -2
- package/dist/cli/chunks/file-discovery-MZOYXIOS.js +2 -0
- package/dist/cli/chunks/{fleet-FUQ6G4SB.js → fleet-FG3EBA75.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-A4E6OKGD.js → gnn-wrapper-PKZLZHL2.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-3JKQORXA.js → heartbeat-handler-YZTRVH75.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-LMAEJQYQ.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-DGGDYJEL.js +2 -0
- package/dist/cli/chunks/hnsw-index-KA7WDTHX.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-AHKFKM2J.js → hnsw-legacy-bridge-WONHB63F.js} +2 -2
- package/dist/cli/chunks/hnswlib-node-Q4VPSJJM.js +2 -0
- package/dist/cli/chunks/{hooks-JNW5ZB2E.js → hooks-RWX5ZZCE.js} +47 -47
- package/dist/cli/chunks/hybrid-router-Q6JQTV55.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-3DTAMNSJ.js → hypergraph-engine-G6N24L5G.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-ZV4AZRGF.js → hypergraph-handler-4RGOLL6F.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-7LFSGIQP.js +2 -0
- package/dist/cli/chunks/{init-handler-NPOUX47N.js → init-handler-L7DZAHXO.js} +12 -12
- package/dist/cli/chunks/init-wizard-T4K44J6D.js +2 -0
- package/dist/cli/chunks/kernel-TGHK6X7F.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-D35TR6LG.js → kilocode-installer-G7PUCUDZ.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-OHHTQENO.js → kiro-installer-H6234HEB.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-MV3OSGCB.js +2 -0
- package/dist/cli/chunks/learning-346CA4DH.js +119 -0
- package/dist/cli/chunks/{llm-router-XLTE52H5.js → llm-router-ATNRDTEM.js} +4 -4
- package/dist/cli/chunks/llm-router-service-OOCNAPJO.js +2 -0
- package/dist/cli/chunks/{load-BHMK4FIL.js → load-3L2CK4ML.js} +2 -2
- package/dist/cli/chunks/load-test-4OZPYWL4.js +2 -0
- package/dist/cli/chunks/{mcp-V4MAYT7C.js → mcp-JJ4ZDUJB.js} +2 -2
- package/dist/cli/chunks/{memory-PDA7MQ7E.js → memory-U3K2Y777.js} +5 -5
- package/dist/cli/chunks/memory-backend-LMRIHJQY.js +2 -0
- package/dist/cli/chunks/memory-handlers-J6CVQ5DS.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-KECHOXKD.js → multi-model-executor-DPCU4CSM.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-LWSCQOOZ.js → opencode-installer-KNUCUSRG.js} +2 -2
- package/dist/cli/chunks/{orchestrator-ENEBTEUW.js → orchestrator-DJV2NUWD.js} +11 -11
- package/dist/cli/chunks/pattern-null-store-AQWPHLRW.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-XIHGXYZZ.js → pattern-usage-recorder-TQ7KECBB.js} +2 -2
- package/dist/cli/chunks/{pipeline-GQOJM3LU.js → pipeline-JG57VFOB.js} +2 -2
- package/dist/cli/chunks/{platform-L56TGXGZ.js → platform-L7LOBG4E.js} +2 -2
- package/dist/cli/chunks/{plugin-SZ6PZKYX.js → plugin-ATBPEU2K.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-SID5FQFW.js → prime-radiant-advanced-wasm-XCX7CNVW.js} +2 -2
- package/dist/cli/chunks/protocol-executor-FWUT6L6K.js +2 -0
- package/dist/cli/chunks/{protocol-handler-5MMNVVPX.js → protocol-handler-DOFLSB4N.js} +2 -2
- package/dist/cli/chunks/{prove-DJ6BQ2AK.js → prove-CDBMRPBD.js} +2 -2
- package/dist/cli/chunks/provider-manager-4PY7IR3V.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-M4XVWRPY.js +2 -0
- package/dist/cli/chunks/quality-5CMQBYP3.js +7 -0
- package/dist/cli/chunks/{quality-gate-CVHVSORK.js → quality-gate-LU66IWRT.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-KSRI42QZ.js +2 -0
- package/dist/cli/chunks/{real-embeddings-DN2MEJVM.js → real-embeddings-3B7AXYOP.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-LTAQJWIH.js → roocode-installer-GF4YJW7E.js} +2 -2
- package/dist/cli/chunks/router-F2TCXNSG.js +2 -0
- package/dist/cli/chunks/routing-feedback-VHOWXUY7.js +2 -0
- package/dist/cli/chunks/{routing-handler-PSWR2UCT.js → routing-handler-PWQMWFND.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-VTP6Y7PN.js → ruvector-commands-SMD6KSBD.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-EBUMXPRO.js → rvf-dual-writer-M5TEJ56X.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-5N7GHMD3.js → rvf-migration-adapter-EHLWMZYI.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-GQKDBNRR.js → rvf-migration-coordinator-GMVLX3FX.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-XG3LFOYW.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-LR3SYGQK.js → rvf-store-integrity-PDADEHAZ.js} +2 -2
- package/dist/cli/chunks/safe-db-CTHJ3SXC.js +2 -0
- package/dist/cli/chunks/schedule-LLYADLGL.js +2 -0
- package/dist/cli/chunks/scheduler-72YIGDIX.js +2 -0
- package/dist/cli/chunks/{security-YDWLYXYD.js → security-PSMBTUSM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-I3HQY7DE.js → shared-rvf-adapter-DP2Z4YLV.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-2UADEA5N.js → shared-rvf-dual-writer-UOU6ORBJ.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-N7OO3ZOE.js +2 -0
- package/dist/cli/chunks/{status-handler-QRHI3F4V.js → status-handler-T565F47D.js} +2 -2
- package/dist/cli/chunks/{structural-health-FWKE63CM.js → structural-health-54WNSZ7Y.js} +2 -2
- package/dist/cli/chunks/{sync-2QRCT5MT.js → sync-5ZGYF7JF.js} +2 -2
- package/dist/cli/chunks/{sync-E32MBAOF.js → sync-EXADT5IZ.js} +2 -2
- package/dist/cli/chunks/{task-handler-C7BKMOCL.js → task-handler-JXWQZDEX.js} +2 -2
- package/dist/cli/chunks/{task-handlers-PADWLLDO.js → task-handlers-UKHRILMM.js} +3 -3
- package/dist/cli/chunks/test-3SU56PMM.js +33 -0
- package/dist/cli/chunks/{test-scheduling-5WKIWH4H.js → test-scheduling-CZZ4KKWM.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-6SKOJM3U.js → token-bootstrap-RSIAPUIV.js} +2 -2
- package/dist/cli/chunks/{token-usage-V6JW55RV.js → token-usage-7HW43ORO.js} +2 -2
- package/dist/cli/chunks/{transformers-3UPFBYSB.js → transformers-A5REG7OI.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-UCY4S2DU.js → tree-sitter-wasm-parser-F43MC7E5.js} +2 -2
- package/dist/cli/chunks/{types-XNMNQGET.js → types-DEOHTTJ3.js} +2 -2
- package/dist/cli/chunks/unified-memory-Q55MJWAM.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-4BEKV2K5.js +2 -0
- package/dist/cli/chunks/unified-persistence-IIB5MR67.js +2 -0
- package/dist/cli/chunks/{upgrade-MVTMTOPL.js → upgrade-7NKNCL2I.js} +2 -2
- package/dist/cli/chunks/{validate-OJWR2AGZ.js → validate-SN2UY7CT.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-2RGSF2K2.js → validate-swarm-YITFMCXY.js} +2 -2
- package/dist/cli/chunks/{vibium-O3ZLAEEZ.js → vibium-AZNIG6O7.js} +2 -2
- package/dist/cli/chunks/visual-security-F4FUP6KV.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-6VPASTI4.js → web-tree-sitter-DY4YXPMR.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-CINHOW3N.js → windsurf-installer-HXD4BK7N.js} +2 -2
- package/dist/cli/chunks/witness-chain-SQ5LCKUQ.js +2 -0
- package/dist/cli/chunks/{witness-chain-2NXW7FT7.js → witness-chain-UV7BOO6T.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-ODW4DJWT.js → witness-key-manager-BCNW3SZH.js} +2 -2
- package/dist/cli/chunks/{workflow-BFGS2GAU.js → workflow-R3SSSWA5.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-Z4PZXWVY.js +2 -0
- package/dist/cli/chunks/{wrappers-VEVVSVMS.js → wrappers-6JUXYAML.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +16 -27
- package/dist/cli/commands/learning.js +66 -0
- package/dist/cli/commands/quality.d.ts +12 -0
- package/dist/cli/commands/quality.js +50 -74
- package/dist/cli/commands/test.js +33 -4
- package/dist/cli/handlers/init-handler.d.ts +2 -0
- package/dist/cli/handlers/init-handler.js +4 -1
- package/dist/cli/utils/file-discovery.d.ts +1 -0
- package/dist/cli/utils/file-discovery.js +13 -1
- package/dist/domains/coverage-analysis/services/coverage-analyzer.js +5 -0
- package/dist/domains/quality-assessment/index.d.ts +1 -0
- package/dist/domains/quality-assessment/index.js +1 -0
- package/dist/domains/quality-assessment/quality-evidence.d.ts +41 -0
- package/dist/domains/quality-assessment/quality-evidence.js +115 -0
- package/dist/domains/test-execution/coordinator.d.ts +1 -0
- package/dist/domains/test-execution/coordinator.js +11 -4
- package/dist/domains/test-execution/interfaces.d.ts +2 -0
- package/dist/domains/test-execution/services/retry-handler.js +3 -3
- package/dist/domains/test-execution/services/test-executor.d.ts +5 -0
- package/dist/domains/test-execution/services/test-executor.js +93 -30
- package/dist/domains/test-generation/gates/test-quality-gate.d.ts +8 -2
- package/dist/domains/test-generation/gates/test-quality-gate.js +93 -4
- package/dist/domains/test-generation/generators/base-test-generator.js +0 -15
- package/dist/domains/test-generation/generators/jest-vitest-generator.js +17 -26
- package/dist/domains/test-generation/services/test-generator.js +7 -2
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/07-hooks.js +3 -1
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/settings-merge.d.ts +3 -1
- package/dist/init/settings-merge.js +9 -3
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +2 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +14 -0
- package/dist/integrations/embeddings/index/HNSWIndex.js +2 -0
- package/dist/kernel/hybrid-backend.d.ts +1 -1
- package/dist/kernel/hybrid-backend.js +2 -2
- package/dist/kernel/interfaces.d.ts +2 -2
- package/dist/kernel/memory-backend.d.ts +1 -1
- package/dist/kernel/memory-backend.js +3 -1
- package/dist/kernel/unified-memory.d.ts +1 -1
- package/dist/kernel/unified-memory.js +19 -4
- package/dist/learning/real-embeddings.js +20 -4
- package/dist/learning/sqlite-persistence.d.ts +3 -2
- package/dist/learning/sqlite-persistence.js +7 -8
- package/dist/mcp/bundle.js +453 -472
- package/dist/mcp/handlers/memory-handlers.js +2 -5
- package/dist/mcp/tools/quality-assessment/evaluate.d.ts +7 -0
- package/dist/mcp/tools/quality-assessment/evaluate.js +72 -20
- package/dist/mcp/tools/security-compliance/scan.js +8 -1
- package/package.json +2 -2
- package/dist/cli/chunks/adapter-JISQ35YY.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-TVTNP76S.js +0 -2
- package/dist/cli/chunks/base-WBCYKM45.js +0 -2
- package/dist/cli/chunks/better-sqlite3-FXJFG2WH.js +0 -2
- package/dist/cli/chunks/browser-workflow-4JM3IWCS.js +0 -2
- package/dist/cli/chunks/chunk-344CLTV7.js +0 -62
- package/dist/cli/chunks/chunk-6VNUASTQ.js +0 -15
- package/dist/cli/chunks/chunk-CW7LDLJ2.js +0 -2
- package/dist/cli/chunks/chunk-HGBVGEUE.js +0 -2
- package/dist/cli/chunks/chunk-JJ5YIKTJ.js +0 -12
- package/dist/cli/chunks/chunk-QGH54HTH.js +0 -2
- package/dist/cli/chunks/chunk-TCYSMSBO.js +0 -2
- package/dist/cli/chunks/chunk-YQI6SOUO.js +0 -2
- package/dist/cli/chunks/client-FNDZB4TY.js +0 -2
- package/dist/cli/chunks/core-handlers-S37RHLKP.js +0 -2
- package/dist/cli/chunks/cross-domain-router-7ZHDB2V3.js +0 -2
- package/dist/cli/chunks/dream-BEVYNIOO.js +0 -2
- package/dist/cli/chunks/file-discovery-UHXZQ7GS.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-K4YLB3X4.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-PPR3LTMA.js +0 -2
- package/dist/cli/chunks/hnsw-index-ZSKFT4LZ.js +0 -2
- package/dist/cli/chunks/hybrid-router-4SXBHTOY.js +0 -2
- package/dist/cli/chunks/impact-analyzer-55GE7EQD.js +0 -2
- package/dist/cli/chunks/init-wizard-EUQLSGI6.js +0 -2
- package/dist/cli/chunks/kernel-BSGSVYPM.js +0 -2
- package/dist/cli/chunks/knowledge-graph-OITIVT5J.js +0 -2
- package/dist/cli/chunks/learning-24PCHLWU.js +0 -117
- package/dist/cli/chunks/llm-router-service-RUPU52AR.js +0 -2
- package/dist/cli/chunks/load-test-ZV3C55ZE.js +0 -2
- package/dist/cli/chunks/memory-backend-S3KCPHCF.js +0 -2
- package/dist/cli/chunks/memory-handlers-X5BLXOSH.js +0 -2
- package/dist/cli/chunks/pattern-null-store-ILVDKSCX.js +0 -2
- package/dist/cli/chunks/protocol-executor-GDRHCW3Q.js +0 -2
- package/dist/cli/chunks/provider-manager-BS4MVCSH.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-P3ARGHDN.js +0 -2
- package/dist/cli/chunks/quality-WKC4JCB3.js +0 -7
- package/dist/cli/chunks/queen-coordinator-GI7GNVDM.js +0 -2
- package/dist/cli/chunks/router-YU6MLJBV.js +0 -2
- package/dist/cli/chunks/routing-feedback-D6B2SK5V.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-M7ZVRN5Z.js +0 -2
- package/dist/cli/chunks/safe-db-3OHTLXG7.js +0 -2
- package/dist/cli/chunks/schedule-H43ADREQ.js +0 -2
- package/dist/cli/chunks/scheduler-CGSXNEPJ.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-V6U5FKVK.js +0 -2
- package/dist/cli/chunks/test-KX4UKHSX.js +0 -33
- package/dist/cli/chunks/unified-memory-H2J5BHPY.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-LFGIWMTS.js +0 -2
- package/dist/cli/chunks/unified-persistence-F6W7EXU5.js +0 -2
- package/dist/cli/chunks/visual-security-EHVU32UE.js +0 -2
- package/dist/cli/chunks/witness-chain-BIICGRHC.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-PVTYPYY4.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{d 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.13.6");process.exit(0)}
|
|
2
|
+
import{d as j,f as ke}from"./chunk-GV3C224P.js";import{a as B,c as qe}from"./chunk-E7MD5LHC.js";import{a as Ge}from"./chunk-GA7PUAMT.js";import{c as te}from"./chunk-F66FYZQF.js";import{a as W,b as D,c as ze}from"./chunk-SZO6JIFM.js";import{b as C,d as re}from"./chunk-2VUXU22M.js";import{a as X,c as Fe}from"./chunk-6UPQD42K.js";import{a as ne,b as Pe}from"./chunk-5CMZDVUR.js";import{a as se,d as w,e as oe,f as ie}from"./chunk-PW3JLQGH.js";import{a as b,e as Me}from"./chunk-Q4RU4XG6.js";import{c as h,e as xe}from"./chunk-ISOTSVI7.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(H(o),"utf8")}function H(o){return o===null||typeof o!="object"?JSON.stringify(o)??"null":Array.isArray(o)?`[${o.map(H).join(",")}]`:`{${Object.keys(o).sort().map(t=>`${JSON.stringify(t)}:${H(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,O,Ee=h(()=>{"use strict";je=Buffer.from("ruvector:chain:"),ae=Te("sha256").update("ruvector-proof-gate-v1").digest();O=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 A(o){if(!Y.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 Y,ue,$=h(()=>{"use strict";Y=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 U,pe,le,ge,me,K,_e,fe,Ne,Se,he,Re,Le=h(()=>{"use strict";ke();qe();U=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,
|
|
@@ -51,7 +51,7 @@ import{d as z,f as ke}from"./chunk-XTHRSBMJ.js";import{a as j,c as qe}from"./chu
|
|
|
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
|
+
`,K=`
|
|
55
55
|
-- GOAP Goals
|
|
56
56
|
CREATE TABLE IF NOT EXISTS goap_goals (
|
|
57
57
|
id TEXT PRIMARY KEY,
|
|
@@ -596,16 +596,16 @@ import{d as z,f as ke}from"./chunk-XTHRSBMJ.js";import{a as j,c as qe}from"./chu
|
|
|
596
596
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_technique ON coverage_sessions(technique);
|
|
597
597
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_agent ON coverage_sessions(agent_id);
|
|
598
598
|
CREATE INDEX IF NOT EXISTS idx_coverage_sessions_created ON coverage_sessions(created_at);
|
|
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!
|
|
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 x(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,c,E,d){return i!==E?i-E:c.localeCompare(d)}return{get(){return n.value},set(i,c){let E=c??Date.now();(n.timestamp===0||a(E,o,n.timestamp,n.nodeId)>0)&&(n={value:i,timestamp:E,nodeId:o,version:n.version+1,lastUpdated:Date.now()})},merge(i){let c=i.getState();this.applyState(c)},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 F(o,e){let t=x(o);return t.applyState(e),t}var V=h(()=>{"use strict"});function I(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 c=e.counts[a]||0;i>c&&(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 M(o,e){let t=I(o);return t.applyState(e),t}var G=h(()=>{"use strict"});function P(o){let e=I(o),t=I(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 c=i.getState();this.applyState(c)},getState(){return{positive:e.getState(),negative:t.getState(),version:n,lastUpdated:a}},applyState(i){let c=this.get();e.applyState(i.positive),t.applyState(i.negative);let E=this.get();c!==E&&(n=Math.max(n,i.version)+1,a=Date.now())},getNodeId(){return o}}}function k(o,e){let t=P(o);return t.applyState(e),t}var Q=h(()=>{"use strict";G()});function He(o,e){return`${o}:${Date.now()}:${e}`}function J(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 C(t);default:throw new Error(`Unknown serialization type: ${e}`)}}function q(o){let e=new Map,t=new Map,n=0,a=Date.now(),i=0;function c(d){let u=e.get(d);if(!u||u.size===0)return!1;let p=t.get(d);if(!p||p.size===0)return!0;for(let _ of u)if(!p.has(_))return!0;return!1}function E(d){let u=e.get(d);if(!u)return new Set;let p=t.get(d)||new Set,_=new Set;for(let g of u)p.has(g)||_.add(g);return _}return{has(d){let u=J(d);return c(u)},values(){let d=[];for(let[u]of e)c(u)&&d.push(Ye(u));return d},size(){let d=0;for(let[u]of e)c(u)&&d++;return d},add(d){let u=J(d),p=He(o,i++);e.has(u)||e.set(u,new Set),e.get(u).add(p),n++,a=Date.now()},remove(d){let u=J(d),p=e.get(u);if(!p||p.size===0)return;t.has(u)||t.set(u,new Set);let _=t.get(u);for(let g of p)_.add(g);n++,a=Date.now()},merge(d){let u=d.getState();this.applyState(u)},getState(){let d={};for(let[p,_]of e)d[p]=Array.from(_);let u={};for(let[p,_]of t)_.size>0&&(u[p]=Array.from(_));return{elements:d,tombstones:u,version:n,lastUpdated:a}},applyState(d){let u=!1;for(let[p,_]of Object.entries(d.elements)){e.has(p)||e.set(p,new Set);let g=e.get(p);for(let l of _)g.has(l)||(g.add(l),u=!0)}for(let[p,_]of Object.entries(d.tombstones)){t.has(p)||t.set(p,new Set);let g=t.get(p);for(let l of _)g.has(l)||(g.add(l),u=!0)}u&&(n=Math.max(n,d.version)+1,a=Date.now())},getNodeId(){return o},clear(){for(let[d,u]of e){t.has(d)||t.set(d,new Set);let p=t.get(d);for(let _ of u)p.add(_)}n++,a=Date.now()}}}function z(o,e){let t=q(o);return t.applyState(e),t}var Z=h(()=>{"use strict";re()});function ee(o){let e={...$e,...o},{nodeId:t,enableDeltaTracking:n,maxDeltaHistory:a}=e,i=new Map,c=new Map,E=new Map,d=new Map,u=0,p=[],_=new Set,g={registers:new Set,gCounters:new Set,pnCounters:new Set,sets:new Set};function l(s,r,T){let N={key:s,type:r,operation:T,timestamp:Date.now(),nodeId:t};for(let we of _)try{we(N)}catch(Ue){console.error("[CRDTStore] Error in change listener:",Ue)}}function m(s,r){u++,n&&g[s].add(r)}function L(){if(!n||!(g.registers.size>0||g.gCounters.size>0||g.pnCounters.size>0||g.sets.size>0))return;let r={fromVersion:p.length>0?p[p.length-1].toVersion:0,toVersion:u,timestamp:Date.now(),nodeId:t};if(g.registers.size>0){r.registers={};for(let T of g.registers){let N=i.get(T);N&&(r.registers[T]=N.getState())}g.registers.clear()}if(g.gCounters.size>0){r.gCounters={};for(let T of g.gCounters){let N=c.get(T);N&&(r.gCounters[T]=N.getState())}g.gCounters.clear()}if(g.pnCounters.size>0){r.pnCounters={};for(let T of g.pnCounters){let N=E.get(T);N&&(r.pnCounters[T]=N.getState())}g.pnCounters.clear()}if(g.sets.size>0){r.sets={};for(let T of g.sets){let N=d.get(T);N&&(r.sets[T]=N.getState())}g.sets.clear()}for(p.push(r);p.length>a;)p.shift()}let R={getRegister(s){return i.has(s)||i.set(s,x(t)),i.get(s)},setRegister(s,r){R.getRegister(s).set(r),m("registers",s),l(s,"lww-register","set")},hasRegister(s){return i.has(s)},deleteRegister(s){let r=i.delete(s);return r&&m("registers",s),r},getGCounter(s){return c.has(s)||c.set(s,I(t)),c.get(s)},incrementGCounter(s,r){R.getGCounter(s).increment(r),m("gCounters",s),l(s,"g-counter","increment")},hasGCounter(s){return c.has(s)},deleteGCounter(s){let r=c.delete(s);return r&&m("gCounters",s),r},getCounter(s){return E.has(s)||E.set(s,P(t)),E.get(s)},incrementCounter(s,r){R.getCounter(s).increment(r),m("pnCounters",s),l(s,"pn-counter","increment")},decrementCounter(s,r){R.getCounter(s).decrement(r),m("pnCounters",s),l(s,"pn-counter","decrement")},hasCounter(s){return E.has(s)},deleteCounter(s){let r=E.delete(s);return r&&m("pnCounters",s),r},getSet(s){return d.has(s)||d.set(s,q(t)),d.get(s)},addToSet(s,r){R.getSet(s).add(r),m("sets",s),l(s,"or-set","add")},removeFromSet(s,r){R.getSet(s).remove(r),m("sets",s),l(s,"or-set","remove")},hasSet(s){return d.has(s)},deleteSet(s){let r=d.delete(s);return r&&m("sets",s),r},merge(s){let r=s.getState();R.applyState(r)},getState(){L();let s={version:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let[r,T]of i)s.registers[r]=T.getState();for(let[r,T]of c)s.gCounters[r]=T.getState();for(let[r,T]of E)s.pnCounters[r]=T.getState();for(let[r,T]of d)s.sets[r]=T.getState();return s},applyState(s){for(let[r,T]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(T):i.set(r,F(t,T)),m("registers",r),l(r,"lww-register","merge");for(let[r,T]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(T):c.set(r,M(t,T)),m("gCounters",r),l(r,"g-counter","merge");for(let[r,T]of Object.entries(s.pnCounters))E.has(r)?E.get(r).applyState(T):E.set(r,k(t,T)),m("pnCounters",r),l(r,"pn-counter","merge");for(let[r,T]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(T):d.set(r,z(t,T)),m("sets",r),l(r,"or-set","merge");u=Math.max(u,s.version)+1},getDelta(s){if(L(),p.length===0)return s>=u,null;let r=p.filter(N=>N.toVersion>s);if(r.length===0)return null;let T={fromVersion:s,toVersion:u,timestamp:Date.now(),nodeId:t,registers:{},gCounters:{},pnCounters:{},sets:{}};for(let N of r)N.registers&&Object.assign(T.registers,N.registers),N.gCounters&&Object.assign(T.gCounters,N.gCounters),N.pnCounters&&Object.assign(T.pnCounters,N.pnCounters),N.sets&&Object.assign(T.sets,N.sets);return Object.keys(T.registers).length===0&&delete T.registers,Object.keys(T.gCounters).length===0&&delete T.gCounters,Object.keys(T.pnCounters).length===0&&delete T.pnCounters,Object.keys(T.sets).length===0&&delete T.sets,T},applyDelta(s){if(s.registers)for(let[r,T]of Object.entries(s.registers))i.has(r)?i.get(r).applyState(T):i.set(r,F(t,T)),m("registers",r),l(r,"lww-register","merge");if(s.gCounters)for(let[r,T]of Object.entries(s.gCounters))c.has(r)?c.get(r).applyState(T):c.set(r,M(t,T)),m("gCounters",r),l(r,"g-counter","merge");if(s.pnCounters)for(let[r,T]of Object.entries(s.pnCounters))E.has(r)?E.get(r).applyState(T):E.set(r,k(t,T)),m("pnCounters",r),l(r,"pn-counter","merge");if(s.sets)for(let[r,T]of Object.entries(s.sets))d.has(r)?d.get(r).applyState(T):d.set(r,z(t,T)),m("sets",r),l(r,"or-set","merge");u=Math.max(u,s.toVersion)+1},getVersion(){return u},getNodeId(){return t},on(s,r){if(s==="change")return _.add(r),()=>{_.delete(r)};throw new Error(`Unknown event type: ${s}`)},removeAllListeners(){_.clear()},keys(s){let r=[];return(!s||s==="lww-register")&&r.push(...Array.from(i.keys())),(!s||s==="g-counter")&&r.push(...Array.from(c.keys())),(!s||s==="pn-counter")&&r.push(...Array.from(E.keys())),(!s||s==="or-set")&&r.push(...Array.from(d.keys())),r},clear(){i.clear(),c.clear(),E.clear(),d.clear(),p.length=0,g.registers.clear(),g.gCounters.clear(),g.pnCounters.clear(),g.sets.clear(),u=0},getStats(){return{total:i.size+c.size+E.size+d.size,registers:i.size,gCounters:c.size,pnCounters:E.size,sets:d.size,version:u,nodeId:t,deltaHistorySize:p.length}}};return R}var $e,Ce=h(()=>{"use strict";V();G();Q();Z();$e={nodeId:"default-node",enableDeltaTracking:!0,maxDeltaHistory:100}});var Ie=h(()=>{"use strict"});var Oe=h(()=>{"use strict";V();G();Q();Z();Ce();Ie()});var Je={};xe(Je,{ALLOWED_TABLE_NAMES:()=>Y,BinaryHeap:()=>se,DEFAULT_UNIFIED_MEMORY_CONFIG:()=>De,UnifiedHnswIndex:()=>w,UnifiedMemoryManager:()=>v,clearProjectRootCache:()=>W,createHnswIndex:()=>oe,findProjectRoot:()=>D,getDefaultDbPath:()=>be,getResolvedDefaultConfig:()=>ye,getUnifiedMemory:()=>Xe,initializeUnifiedMemory:()=>Ke,resetUnifiedMemory:()=>Ve,validateTableName:()=>A});import*as f from"fs";import*as ve from"os";import*as S from"path";function be(){let o=D();return S.join(o,".agentic-qe","memory.db")}function ye(){return{...De,dbPath:be()}}function Xe(o){return v.getInstance(o)}async function Ke(o){let e=Xe(o);return await e.initialize(),e}function Ve(){v.resetInstance()}function Qe(){if(Ae)return;Ae=!0;let o=()=>{try{let e=v.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,De,v,Ae,Ze=h(()=>{Pe();re();Fe();Me();Ge();Ee();$();$();ie();ie();Le();Oe();ze();y=te.create("unified-memory");De={dbPath:".agentic-qe/memory.db",walMode:!0,mmapSize:b.MMAP_SIZE_BYTES,cacheSize:b.CACHE_SIZE_KB,busyTimeout:b.BUSY_TIMEOUT_MS,vectorDimensions:b.DEFAULT_VECTOR_DIMENSIONS};v=class o{static instance=null;static instancePromise=null;db=null;config;initialized=!1;vectorsLoaded=!1;initPromise=null;preparedStatements=new Map;vectorIndex=new w("qe-memory");crdtStore=null;proofGate=null;proofGateEnvChecked=!1;static PROOF_NS="__proofgate__";static PROOF_KEY="chain";constructor(e){let t=ye();if(this.config={...t,...e},process.env.AQE_MEMORY_BACKEND==="memory"){this.config.dbPath=":memory:";return}if(!S.isAbsolute(this.config.dbPath)){let n=D();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,W()}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 c=process.env.AQE_PROJECT_ROOT;if(c){let E=S.resolve(this.config.dbPath),d=S.resolve(c);!E.startsWith(d)&&!E.startsWith(ve.tmpdir())&&E.includes(".agentic-qe")&&(console.error(`[UnifiedMemory] WARNING: DB path "${this.config.dbPath}" points to a production .agentic-qe/ while AQE_PROJECT_ROOT="${c}". Redirecting to test-safe path.`),this.config.dbPath=S.join(c,".agentic-qe","memory.db"))}if(n=S.dirname(this.config.dbPath),f.existsSync(n)||f.mkdirSync(n,{recursive:!0}),a=f.existsSync(this.config.dbPath),a)i=f.statSync(this.config.dbPath).size;else if(f.existsSync(n)){let E=this.findRecentBackups(n);if(E.length>0){let d=E[0];console.error(`[UnifiedMemory] CRITICAL: Database file missing but directory exists!
|
|
600
600
|
Expected: ${this.config.dbPath}
|
|
601
|
-
Found ${
|
|
602
|
-
Restoring from backup to prevent data loss...`),
|
|
603
|
-
DB was ${(i/1024/1024).toFixed(1)}MB, now ${(
|
|
601
|
+
Found ${E.length} backup(s), newest: ${d.path} (${(d.size/1024/1024).toFixed(1)}MB)
|
|
602
|
+
Restoring from backup to prevent data loss...`),f.copyFileSync(d.path,this.config.dbPath);for(let u of["-wal","-shm"]){let p=this.config.dbPath+u;f.existsSync(p)&&f.unlinkSync(p)}i=d.size}}}if(e?.throwIfAborted(),this.db=ne(this.config.dbPath,{walMode:this.config.walMode,busyTimeout:this.config.busyTimeout,autoRestore:!0}),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 c=this.db.prepare("SELECT COUNT(*) as cnt FROM qe_patterns").get();if(c&&c.cnt===0){let E=f.statSync(this.config.dbPath).size;E<i*.1&&console.error(`[UnifiedMemory] CRITICAL: Possible data loss detected!
|
|
603
|
+
DB was ${(i/1024/1024).toFixed(1)}MB, now ${(E/1024/1024).toFixed(1)}MB with 0 patterns.
|
|
604
604
|
This looks like the DB was replaced with an empty schema.
|
|
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: ${
|
|
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: ${X(t)}`)}}}findRecentBackups(e){try{let n=f.readdirSync(e).filter(i=>i.startsWith("memory")&&i.endsWith(".db")&&i!=="memory.db").map(i=>{let c=S.join(e,i),E=f.statSync(c);return{path:c,size:E.size,mtime:E.mtimeMs}}).filter(i=>i.size>1e6).sort((i,c)=>c.mtime-i.mtime),a=S.join(e,"backups");if(f.existsSync(a)){let i=f.readdirSync(a);for(let c of i)if(c.endsWith(".db")){let E=S.join(a,c),d=f.statSync(E);d.size>1e6&&n.push({path:E,size:d.size,mtime:d.mtimeMs})}n.sort((c,E)=>E.mtime-c.mtime)}return n}catch{return[]}}warnIfDuplicateDatabases(){if(this.config.dbPath!==":memory:")try{let e=D(),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&&f.existsSync(i));a.length>0&&console.warn(`[UnifiedMemory] WARNING: Duplicate database(s) detected!
|
|
606
606
|
Canonical: ${t}
|
|
607
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=
|
|
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=A(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 c=A(t);try{this.db.exec(`ALTER TABLE ${c} ADD COLUMN ${n} ${a}`),console.log(`[UnifiedMemory] Added column ${n} to ${t} (safe migration)`)}catch(E){console.log(`[UnifiedMemory] Column ${n} on ${t}: ${E instanceof Error?E.message:String(E)}`)}}}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<U&&(console.log(`[UnifiedMemory] Migrating from v${t} to v${U}`),this.db.transaction(()=>{t<1&&this.db.exec(le),t<2&&this.db.exec(ge),t<3&&(this.db.exec(me),this.db.exec(K),this.db.exec(_e)),t<4&&this.db.exec(fe),t<5&&this.db.exec(Ne),t<6&&this.db.exec(j),t<7&&this.db.exec(Se),t<8&&this.db.exec(he),t<9&&(this.db.exec(`
|
|
609
609
|
CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
|
|
610
610
|
name, description, pattern_type, qe_domain,
|
|
611
611
|
content='qe_patterns',
|
|
@@ -631,16 +631,16 @@ import{d as z,f as ke}from"./chunk-XTHRSBMJ.js";import{a as j,c as qe}from"./chu
|
|
|
631
631
|
`),this.db.exec(`
|
|
632
632
|
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
633
633
|
SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
|
|
634
|
-
`)),t<10&&this.db.exec(
|
|
634
|
+
`)),t<10&&this.db.exec(B),t<11&&this.migrateToV11GoapExecutionSteps(),this.db.prepare(`
|
|
635
635
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
636
636
|
VALUES (1, ?, datetime('now'))
|
|
637
|
-
`).run(
|
|
637
|
+
`).run(U)})(),console.log("[UnifiedMemory] Migration complete"))}migrateToV11GoapExecutionSteps(){let e=this.db;e.exec(K);let t=(n,a,i)=>{e.prepare(`SELECT name FROM pragma_table_info('${n}')`).all().some(E=>E.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,c=JSON.stringify(t);this.db.prepare(`
|
|
638
638
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
639
639
|
VALUES (?, ?, ?, ?)
|
|
640
|
-
`).run(e,n,
|
|
640
|
+
`).run(e,n,c,i),this.auditWrite("kvSet",n,e,c)}async kvGet(e,t="default"){this.ensureInitialized();let n=this.db.prepare(`
|
|
641
641
|
SELECT value, expires_at FROM kv_store
|
|
642
642
|
WHERE key = ? AND namespace = ?
|
|
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
|
|
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 C(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(`
|
|
644
644
|
SELECT 1 FROM kv_store
|
|
645
645
|
WHERE key = ? AND namespace = ? AND (expires_at IS NULL OR expires_at > ?)
|
|
646
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(`
|
|
@@ -648,14 +648,14 @@ import{d as z,f as ke}from"./chunk-XTHRSBMJ.js";import{a as j,c as qe}from"./chu
|
|
|
648
648
|
WHERE namespace = ? AND key LIKE ?
|
|
649
649
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
650
650
|
LIMIT ?
|
|
651
|
-
`).all(t,a,Date.now(),n).map(
|
|
651
|
+
`).all(t,a,Date.now(),n).map(c=>c.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 O)}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 O}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}: ${X(i)}`)}}persistProofChain(){!this.proofGate||!this.db||this.db.prepare(`
|
|
652
652
|
INSERT OR REPLACE INTO kv_store (key, namespace, value, expires_at)
|
|
653
653
|
VALUES (?, ?, ?, NULL)
|
|
654
654
|
`).run(o.PROOF_KEY,o.PROOF_NS,JSON.stringify(this.proofGate.toJSON()))}loadProofChain(){if(!this.db)return null;let e=this.db.prepare(`
|
|
655
655
|
SELECT value FROM kv_store WHERE key = ? AND namespace = ?
|
|
656
|
-
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return
|
|
656
|
+
`).get(o.PROOF_KEY,o.PROOF_NS);if(!e)return null;try{return O.fromJSON(JSON.parse(e.value))}catch(t){return y.warn(`proof-gate chain failed to load (starting fresh): ${X(t)}`),null}}async vectorStore(e,t,n="default",a){this.ensureInitialized();let i=this.floatArrayToBuffer(t),c=a?JSON.stringify(a):null;this.db.prepare(`
|
|
657
657
|
INSERT OR REPLACE INTO vectors (id, namespace, embedding, dimensions, metadata, updated_at)
|
|
658
658
|
VALUES (?, ?, ?, ?, ?, datetime('now'))
|
|
659
|
-
`).run(e,n,i,t.length,
|
|
659
|
+
`).run(e,n,i,t.length,c),this.vectorIndex.add(e,t)}async vectorGet(e){this.ensureInitialized();let t=this.db.prepare(`
|
|
660
660
|
SELECT embedding, dimensions, metadata FROM vectors WHERE id = ?
|
|
661
|
-
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?
|
|
661
|
+
`).get(e);if(t)return{embedding:this.bufferToFloatArray(t.embedding,t.dimensions),metadata:t.metadata?C(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,a){this.ensureInitialized(),this.vectorsLoaded||await this.loadVectorIndex();let i=this.vectorIndex.size(),c=Math.min(i,Math.max(t*2,1)),E=this.vectorIndex.search(e,c);for(;a&&E.filter(l=>l.id.startsWith(a)).length<t&&c<i;)c=Math.min(i,c*2),E=this.vectorIndex.search(e,c);if(E.length===0)return[];let d=E.map(l=>l.id),u=d.map(()=>"?").join(","),p=this.db.prepare(`SELECT id, namespace, metadata FROM vectors WHERE id IN (${u})`).all(...d),_=new Map(p.map(l=>[l.id,l]));if(n){let l=[];for(let m of E){let L=_.get(m.id);if(L&&L.namespace===n&&(!a||m.id.startsWith(a))&&(l.push({id:m.id,score:m.score,metadata:L.metadata?C(L.metadata):void 0}),l.length>=t))break}return l}return(a?E.filter(l=>l.id.startsWith(a)).slice(0,t):E.slice(0,t)).map(l=>{let m=_.get(l.id);return{id:l.id,score:l.score,metadata:m?.metadata?C(m.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=A(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=ee({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{f.existsSync(this.config.dbPath)&&(t=f.statSync(this.config.dbPath).size);let a=this.config.dbPath+"-wal";f.existsSync(a)&&(n=f.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{Y as a,A as b,nt as c,$ as d,be as e,De as f,ye as g,v as h,Xe as i,Ke as j,Ve as k,Je as l,Ze as m};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
2
|
import{readFileSync as l,writeFileSync as c,mkdirSync as m,renameSync as u}from"node:fs";import{join as d,dirname as h}from"node:path";import{homedir as p}from"node:os";var C={maxCallsPerSession:10},S=d(p(),".agentic-qe","advisor","circuit-breaker.json"),x=1440*60*1e3,n=class{maxCalls;statePath;constructor(t){this.maxCalls=t?.maxCallsPerSession??C.maxCallsPerSession,this.statePath=t?.statePath??S}acquire(t){let e=this.load(),a=e.sessions[t]?.count??0;if(a>=this.maxCalls)throw new i(`Advisor circuit breaker tripped: ${a} calls in session "${t}" (max: ${this.maxCalls}). Do not retry \u2014 continue without the advisor.`,t,a,this.maxCalls);let r=a+1;return e.sessions[t]={count:r,lastUpdated:new Date().toISOString()},this.save(e),{sessionId:t,callCount:r,maxCalls:this.maxCalls,remaining:this.maxCalls-r,tripped:!1}}getState(t){let s=this.load().sessions[t]?.count??0;return{sessionId:t,callCount:s,maxCalls:this.maxCalls,remaining:this.maxCalls-s,tripped:s>=this.maxCalls}}reset(t){if(t){let e=this.load();delete e.sessions[t],this.save(e)}else this.save({sessions:{}})}load(){try{let t=l(this.statePath,"utf-8"),e=JSON.parse(t);return this.evictStale(e),e}catch{return{sessions:{}}}}save(t){try{m(h(this.statePath),{recursive:!0});let e=this.statePath+".tmp."+process.pid;c(e,JSON.stringify(t,null,2)),u(e,this.statePath)}catch{}}evictStale(t){let e=Date.now();for(let[s,a]of Object.entries(t.sessions))e-new Date(a.lastUpdated).getTime()>x&&delete t.sessions[s]}},i=class extends Error{constructor(e,s,a,r){super(e);this.sessionId=s;this.callCount=a;this.maxCalls=r;this.name="AdvisorCircuitBreakerError"}sessionId;callCount;maxCalls;exitCode=3};export{n as a,i as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
|
+
import{a as e,b as g,e as r}from"./chunk-F66FYZQF.js";import{c as o}from"./chunk-ISOTSVI7.js";var L=o(()=>{"use strict";e();g();r()});export{L as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{b as f,d as v}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
|
+
import{b as f,d as v}from"./chunk-2VUXU22M.js";import q,{MultiBar as F,Presets as k}from"cli-progress";import O from"ora";import o from"chalk";v();import{existsSync as w,readFileSync as y,writeFileSync as j,mkdirSync as W,unlinkSync as V}from"fs";import{join as p}from"path";import{homedir as C}from"os";var u={wizards:{enabled:!0,themes:["default","minimal","detailed"],defaultTheme:"default"},progress:{style:"multi-bar",updateIntervalMs:100,showETA:!0,colors:!0},completion:{maxSuggestions:10,historyWeight:.3,contextWeight:.7,fuzzyMatch:!0},streaming:{enabled:!0,bufferSize:100,updateIntervalMs:50}};function x(){return p(C(),".aqe")}function E(){return p(x(),"cli-config.json")}var g=null,d=0,T=5e3;function S(){return g?Date.now()-d<T:!1}function A(s){let e=[],t=s;if(typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"wizards.enabled",message:"must be a boolean"}),t.themes!==void 0)if(!Array.isArray(t.themes))e.push({path:"wizards.themes",message:"must be an array"});else{let r=["default","minimal","detailed"];for(let n of t.themes)r.includes(n)||e.push({path:"wizards.themes",message:`invalid theme: ${n}`})}return t.defaultTheme!==void 0&&(["default","minimal","detailed"].includes(t.defaultTheme)||e.push({path:"wizards.defaultTheme",message:`invalid theme: ${t.defaultTheme}`})),e}function P(s){let e=[],t=s;return t.style!==void 0&&(["multi-bar","single-bar","spinner"].includes(t.style)||e.push({path:"progress.style",message:`invalid style: ${t.style}`})),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"progress.updateIntervalMs",message:"must be a number >= 10"}),typeof t.showETA!="boolean"&&t.showETA!==void 0&&e.push({path:"progress.showETA",message:"must be a boolean"}),typeof t.colors!="boolean"&&t.colors!==void 0&&e.push({path:"progress.colors",message:"must be a boolean"}),e}function $(s){let e=[],t=s;return t.maxSuggestions!==void 0&&(typeof t.maxSuggestions!="number"||t.maxSuggestions<1)&&e.push({path:"completion.maxSuggestions",message:"must be a number >= 1"}),t.historyWeight!==void 0&&(typeof t.historyWeight!="number"||t.historyWeight<0||t.historyWeight>1)&&e.push({path:"completion.historyWeight",message:"must be a number between 0 and 1"}),t.contextWeight!==void 0&&(typeof t.contextWeight!="number"||t.contextWeight<0||t.contextWeight>1)&&e.push({path:"completion.contextWeight",message:"must be a number between 0 and 1"}),typeof t.fuzzyMatch!="boolean"&&t.fuzzyMatch!==void 0&&e.push({path:"completion.fuzzyMatch",message:"must be a boolean"}),e}function I(s){let e=[],t=s;return typeof t.enabled!="boolean"&&t.enabled!==void 0&&e.push({path:"streaming.enabled",message:"must be a boolean"}),t.bufferSize!==void 0&&(typeof t.bufferSize!="number"||t.bufferSize<1)&&e.push({path:"streaming.bufferSize",message:"must be a number >= 1"}),t.updateIntervalMs!==void 0&&(typeof t.updateIntervalMs!="number"||t.updateIntervalMs<10)&&e.push({path:"streaming.updateIntervalMs",message:"must be a number >= 10"}),e}function M(s){let e=[];if(typeof s!="object"||s===null)return{valid:!1,errors:[{path:"",message:"config must be an object"}]};let t=s;return t.wizards!==void 0&&(typeof t.wizards!="object"||t.wizards===null?e.push({path:"wizards",message:"must be an object"}):e.push(...A(t.wizards))),t.progress!==void 0&&(typeof t.progress!="object"||t.progress===null?e.push({path:"progress",message:"must be an object"}):e.push(...P(t.progress))),t.completion!==void 0&&(typeof t.completion!="object"||t.completion===null?e.push({path:"completion",message:"must be an object"}):e.push(...$(t.completion))),t.streaming!==void 0&&(typeof t.streaming!="object"||t.streaming===null?e.push({path:"streaming",message:"must be an object"}):e.push(...I(t.streaming))),{valid:e.length===0,errors:e}}var z=["__proto__","constructor","prototype"];function m(s,e){let t={...s};for(let r of Object.keys(e)){if(z.includes(r)){console.warn(`Security: Skipping forbidden key '${String(r)}' in configuration merge`);continue}let n=e[r],i=s[r];n!==void 0&&typeof n=="object"&&!Array.isArray(n)&&typeof i=="object"&&!Array.isArray(i)?t[r]=m(i,n):n!==void 0&&(t[r]=n)}return t}function D(){let s=E();if(!w(s))return{...u};try{let e=y(s,"utf-8"),t=f(e),r=M(t);return r.valid?m(u,t):(console.warn(`CLI config validation errors: ${r.errors.map(n=>`${n.path}: ${n.message}`).join(", ")}`),console.warn("Using default configuration"),{...u})}catch(e){return console.warn(`Failed to load CLI config: ${e instanceof Error?e.message:"Unknown error"}`),{...u}}}function c(){return S()||(g=D(),d=Date.now()),g}function B(){return process.stdout.isTTY===!0}function h(){let s=c();return process.env.NO_COLOR!==void 0?!1:process.env.FORCE_COLOR!==void 0?!0:s.progress.colors&&B()}var b=class{multiBar;agentBars=new Map;agentStates=new Map;fleetBar=null;startTime=Date.now();options;isActive=!1;constructor(e={}){let t=c(),r=h();this.options={title:"Fleet Progress",showEta:t.progress.showETA,showPercentage:!0,...e};let n=r?o.cyan("{bar}"):"{bar}",i=this.options.format||`{name} ${n} {percentage}% | {status} {eta}`;this.multiBar=new F({clearOnComplete:!1,hideCursor:!0,format:i,barCompleteChar:"\u2588",barIncompleteChar:"\u2591",forceRedraw:!0,fps:Math.round(1e3/t.progress.updateIntervalMs)},k.shades_classic)}start(e){this.isActive=!0,this.startTime=Date.now(),console.log(o.blue(`
|
|
3
3
|
${this.options.title}
|
|
4
4
|
`)),this.fleetBar=this.multiBar.create(100,0,{name:o.white("Fleet Progress".padEnd(30)),status:"",eta:""})}addAgent(e){if(!this.isActive)return;this.agentStates.set(e.id,e);let t=this.multiBar.create(100,e.progress,{name:o.gray(this.truncateName(e.name,30).padEnd(30)),status:this.getStatusIcon(e.status),eta:e.eta?this.formatEta(e.eta):""});this.agentBars.set(e.id,t),this.updateFleetProgress()}updateAgent(e,t,r){if(!this.isActive)return;let n=this.agentStates.get(e),i=this.agentBars.get(e);!n||!i||(n.progress=Math.min(100,Math.max(0,t)),r?.status&&(n.status=r.status),r?.message&&(n.message=r.message),r?.eta!==void 0&&(n.eta=r.eta),i.update(n.progress,{name:this.getAgentNameDisplay(n),status:this.getStatusIcon(n.status),eta:n.eta?this.formatEta(n.eta):""}),this.updateFleetProgress())}completeAgent(e,t=!0){if(!this.isActive)return;let r=this.agentStates.get(e),n=this.agentBars.get(e);!r||!n||(r.status=t?"completed":"failed",r.progress=t?100:r.progress,n.update(r.progress,{name:this.getAgentNameDisplay(r),status:this.getStatusIcon(r.status),eta:""}),this.updateFleetProgress())}stop(){if(!this.isActive)return;this.isActive=!1,this.multiBar.stop();let e=Array.from(this.agentStates.values()).filter(i=>i.status==="completed").length,t=Array.from(this.agentStates.values()).filter(i=>i.status==="failed").length,r=this.agentStates.size,n=Date.now()-this.startTime;console.log(""),console.log(t===0?o.green(`All ${e}/${r} agents completed successfully (${this.formatDuration(n)})`):o.yellow(`${e}/${r} agents completed, ${t} failed (${this.formatDuration(n)})`)),console.log("")}updateFleetProgress(){if(!this.fleetBar)return;let e=Array.from(this.agentStates.values()),t=e.reduce((a,l)=>a+l.progress,0),r=e.length>0?Math.round(t/e.length):0,n=e.filter(a=>a.status==="completed").length,i=e.filter(a=>a.status==="running").length;this.fleetBar.update(r,{status:o.gray(`${n}/${e.length} complete, ${i} running`),eta:this.options.showEta?this.estimateFleetEta(e):""})}getAgentNameDisplay(e){let t=this.truncateName(e.name,26);switch(e.status){case"completed":return o.green(t.padEnd(30));case"failed":return o.red(t.padEnd(30));case"running":return o.yellow(t.padEnd(30));default:return o.gray(t.padEnd(30))}}getStatusIcon(e){switch(e){case"completed":return o.green("\u2713");case"failed":return o.red("\u2717");case"running":return o.yellow("\u25B6");default:return o.gray("\u25CB")}}truncateName(e,t){return e.length<=t?e:e.slice(0,t-3)+"..."}formatEta(e){return e<=0?"":e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}formatDuration(e){return e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`}estimateFleetEta(e){let t=e.filter(a=>a.status==="running"||a.status==="pending");if(t.length===0)return"";let r=t.map(a=>a.eta||0).filter(a=>a>0);if(r.length>0){let a=Math.max(...r);return o.gray(`ETA: ${this.formatEta(a)}`)}let n=Date.now()-this.startTime,i=t.reduce((a,l)=>a+l.progress,0)/t.length;if(i>0){let a=n/(i/100),l=Math.max(0,a-n);return o.gray(`ETA: ${this.formatEta(l)}`)}return""}};function X(s){let e=Date.now(),t=O({text:s,color:"cyan"}).start(),r=setInterval(()=>{let i=((Date.now()-e)/1e3).toFixed(1);t.text=`${s} (${i}s)`},100);r.unref?.();let n=()=>{clearInterval(r)};return{spinner:t,stop:()=>{n(),t.stop()},succeed:i=>{n();let a=((Date.now()-e)/1e3).toFixed(1);t.succeed(i||`${s} (${a}s)`)},fail:i=>{n();let a=((Date.now()-e)/1e3).toFixed(1);t.fail(i||`${s} failed (${a}s)`)}}}export{b as a,X 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.13.
|
|
2
|
-
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
|
+
var e=null,f=null,t=null,u=!1;async function W(){return u&&!t?e:t||(t=(async()=>{try{if(process.env.AQE_RVF_MODE==="sqlite-only"||process.env.AQE_MEMORY_BACKEND==="memory")return null;let{isRvfNativeAvailable:d}=await import("./rvf-native-adapter-XG3LFOYW.js");if(!d())return null;let{getUnifiedMemory:v,findProjectRoot:p}=await import("./unified-memory-Q55MJWAM.js"),o=v().getDatabase();if(!o)return null;let{join:m}=await import("node:path"),g=m(process.env.AQE_PROJECT_ROOT??p(),".agentic-qe","brain.rvf"),{RvfDualWriter:R}=await import("./rvf-dual-writer-M5TEJ56X.js"),l=new R(o,{rvfPath:g,mode:"dual-write",dimensions:384});await l.initialize(),e=l;try{let{getRvfMigrationStage:y}=await import("./feature-flags-D3JGPHXY.js"),a=y();if(a>=2){let{RvfMigrationAdapter:A}=await import("./rvf-migration-adapter-EHLWMZYI.js"),s=new A({stage:a});s.setSqliteDb(o);let{getSharedRvfAdapter:D}=await import("./shared-rvf-adapter-DP2Z4YLV.js"),i=D();if(i){let h={ingest:n=>i.ingest(n),search:(n,M)=>i.search(n,M).map(c=>({id:c.id,score:c.score})),delete:n=>i.delete(n),status:()=>i.status(),close:()=>{}};s.setRvfStore(h)}f=s,console.log(`[RVF] Migration adapter active at stage ${a} (${["sqlite-only","hybrid","dual-sqlite","dual-rvf","rvf-primary"][a]})`)}}catch{}return l}catch(r){return(process.env.DEBUG||process.env.AQE_VERBOSE)&&console.debug("[RVF] Dual-writer init failed, degrading to sqlite-only:",r instanceof Error?r.message:r),null}finally{u=!0,t=null,import("./base-4M3VL4XK.js").then(({registerRvfResetFn:r})=>r(w)).catch(()=>{})}})(),t)}function S(){return e}function b(){return f}function w(){if(e){try{e.close()}catch{}e=null}f=null,t=null,u=!1}export{W as a,S as b,b as c,w as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{d as m}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
|
+
import{d as m}from"./chunk-PX7MVV6F.js";import{d as T}from"./chunk-OS56PKRO.js";T();function p(t,r,o){let e=0,n=t.length;for(;e<n;){let i=e+n>>>1;o(t[i],r)<=0?e=i+1:n=i}return e}function a(t,r,o){let e=p(t,r,o);return t.splice(e,0,r),e}function s(){return(t,r)=>t.createdAt.getTime()-r.createdAt.getTime()}m();export{a,s as b};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.
|
|
2
|
-
import{c as t}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.13.6");process.exit(0)}
|
|
2
|
+
import{c as t}from"./chunk-ISOTSVI7.js";function o(e){try{return e.prepare(`
|
|
3
3
|
SELECT COUNT(*) as count FROM sqlite_master
|
|
4
4
|
WHERE type='table' AND name IN ('hypergraph_nodes', 'hypergraph_edges')
|
|
5
5
|
`).get().count===2}catch{return!1}}var r,a,E,n,p=t(()=>{"use strict";r=`
|