From 98a1716ac81651661b5072fe83155542c678bd66 Mon Sep 17 00:00:00 2001 From: Riz Ashraf Date: Tue, 29 Sep 2026 06:42:29 +0100 Subject: [PATCH] chore: fix clippy warnings, add embedding/omni_patch, update telemetry, and ignore temp files --- .gitignore | 6 + Cargo.lock | 1723 ++++++++++++++++++++++++++++- README.md | 3 +- agent-rules/global_subagents.md | 12 + design.md | 17 +- instructions.md | 12 +- nvim-core/src/lib.rs | 23 +- server/Cargo.toml | 1 + server/src/api/setup.rs | 2 + server/src/api/telemetry.rs | 105 ++ server/src/dashboard.html | 57 +- server/src/embedding.rs | 42 + server/src/handlers/meta.rs | 108 +- server/src/handlers/notes.rs | 3 + server/src/handlers/tasks.rs | 1 + server/src/handlers/workspaces.rs | 3 + server/src/instructions.md | 11 +- server/src/main.rs | 120 ++ server/src/models.rs | 22 + server/src/omni_patch.rs | 1 + server/src/router.rs | 51 + server/src/search.rs | 2 + server/src/state.rs | 3 + 23 files changed, 2253 insertions(+), 75 deletions(-) create mode 100644 server/src/embedding.rs create mode 100644 server/src/omni_patch.rs diff --git a/.gitignore b/.gitignore index a8045cb..3765432 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ /target cargo-llvm-cov.exe llvm-cov.zip + +.fastembed_cache/ +*.py +temp.json +*.txt +summary.md diff --git a/Cargo.lock b/Cargo.lock index 5d5d094..7c4e02f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,26 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "getrandom 0.3.4", + "once_cell", + "serde", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.5" @@ -11,6 +31,24 @@ dependencies = [ "memchr", ] +[[package]] +name = "aligned" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4508988c62edf04abd8d92897fca0c2995d907ce1dfeaf369dac3716a40685" +dependencies = [ + "as-slice", +] + +[[package]] +name = "aligned-vec" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc890384c8602f339876ded803c97ad529f3842aba97f6392b3dba0dd171769b" +dependencies = [ + "equator", +] + [[package]] name = "allocator-api2" version = "0.2.21" @@ -76,6 +114,18 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "anyhow" +version = "1.0.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" + +[[package]] +name = "arbitrary" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" + [[package]] name = "arc-swap" version = "1.9.2" @@ -85,6 +135,32 @@ dependencies = [ "rustversion", ] +[[package]] +name = "arg_enum_proc_macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[package]] +name = "as-slice" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516b6b4f0e40d50dcda9365d53964ec74560ad4284da2e7fc97122cd83174516" +dependencies = [ + "stable_deref_trait", +] + [[package]] name = "async-channel" version = "2.5.0" @@ -120,6 +196,49 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "av-scenechange" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f321d77c20e19b92c39e7471cf986812cbb46659d2af674adc4331ef3f18394" +dependencies = [ + "aligned", + "anyhow", + "arg_enum_proc_macro", + "arrayvec", + "log", + "num-rational", + "num-traits", + "pastey 0.1.1", + "rayon", + "thiserror", + "v_frame", + "y4m", +] + +[[package]] +name = "av1-grain" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cfddb07216410377231960af4fcab838eaa12e013417781b78bd95ee22077f8" +dependencies = [ + "anyhow", + "arrayvec", + "log", + "nom 8.0.0", + "num-rational", + "v_frame", +] + +[[package]] +name = "avif-serialize" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7178fe5f7d460b13895ebb9dcb28a3a6216d2df2574a0806cb51b555d297f38" +dependencies = [ + "arrayvec", +] + [[package]] name = "axum" version = "0.8.9" @@ -175,6 +294,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.22.1" @@ -187,6 +312,18 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bit_field" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4b40c7323adcfc0a41c4b88143ed58346ff65a288fc144329c5c45e05d70c6" + [[package]] name = "bitflags" version = "2.13.2" @@ -202,6 +339,15 @@ dependencies = [ "crunchy", ] +[[package]] +name = "bitstream-io" +version = "4.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eff00be299a18769011411c9def0d827e8f2d7bf0c3dbf53633147a8867fd1f" +dependencies = [ + "no_std_io2", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -235,7 +381,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0f9631d8aaaee112c41985d675ef269e02acbd4f33122836af4f0c5f699ff6" dependencies = [ - "darling", + "darling 0.24.1", "ident_case", "prettyplease", "proc-macro2", @@ -243,24 +389,51 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "built" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" + [[package]] name = "bumpalo" version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" +[[package]] +name = "bytemuck" +version = "1.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" + [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +[[package]] +name = "byteorder-lite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" + [[package]] name = "bytes" version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +[[package]] +name = "castaway" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dec551ab6e7578819132c713a93c022a05d60159dc86e7a7050223577484c55a" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.4.7" @@ -350,12 +523,33 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c133bc6a41be0d194c306b5506d15e6feeea7b1d6604bd3f8310dfb2ca96486" +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "colorchoice" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "compact_str" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dfdd1c2274d9aa354115b09dc9a901d6c5576818cdf70d14cae2bdb47df00ab" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "serde", + "static_assertions", +] + [[package]] name = "concurrent-queue" version = "2.5.0" @@ -365,18 +559,85 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "console" +version = "0.16.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96a4956774c13c126a8b5af4daa79384f4d826534c95a02d76afb39e2ab64e3" +dependencies = [ + "encode_unicode", + "libc", + "unicode-width", + "windows-sys 0.61.2", +] + [[package]] name = "const-oid" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" +[[package]] +name = "cookie" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a373e3602691c3cdea496d2f0ee5935151e6168fe87739483c463db1b2f2f87" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "cookie_store" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b2c103cf610ec6cae3da84a766285b42fd16aad564758459e6ecf128c75206" +dependencies = [ + "cookie", + "document-features", + "idna", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "time", + "url", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "core_detect" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f8f80099a98041a3d1622845c271458a2d73e688351bf3cb999266764b81d48" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -463,14 +724,44 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "daachorse" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5614204febbc33cc07a2806aa6440b904ac012b68eecc37f4493ea4a76455a3d" + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core 0.20.11", + "darling_macro 0.20.11", +] + [[package]] name = "darling" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.24.1", + "darling_macro 0.24.1", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.119", ] [[package]] @@ -486,17 +777,37 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core 0.20.11", + "quote", + "syn 2.0.119", +] + [[package]] name = "darling_macro" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ - "darling_core", + "darling_core 0.24.1", "quote", "syn 3.0.6", ] +[[package]] +name = "dary_heap" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b1e3a325bc115f096c8b77bbf027a7c2592230e70be2d985be950d3d5e60ebe" +dependencies = [ + "serde", +] + [[package]] name = "dashmap" version = "6.2.1" @@ -523,6 +834,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c286de4e81ea2590afc24d754e0f83810c566f50a1388fa75ebd57928c0d9745" +[[package]] +name = "der" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a878c850e9e421b20262e9b41f9c860e4785fa07541c266b62ff9d1ef998a80a" +dependencies = [ + "pem-rfc7468", + "zeroize", +] + [[package]] name = "deranged" version = "0.5.8" @@ -532,6 +853,37 @@ dependencies = [ "serde_core", ] +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling 0.20.11", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.119", +] + [[package]] name = "digest" version = "0.10.7" @@ -553,6 +905,15 @@ dependencies = [ "crypto-common 0.2.2", ] +[[package]] +name = "dirs" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs" version = "7.0.0" @@ -585,6 +946,15 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + [[package]] name = "downcast-rs" version = "2.0.2" @@ -603,6 +973,46 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" +[[package]] +name = "encode_unicode" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0" + +[[package]] +name = "encoding_rs" +version = "0.8.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e985e0451871ad22fb8d2b6b076e2028a502a0d3950998c2c5c0a4f9b5d9679" +dependencies = [ + "cfg-if", + "core_detect", + "multiversion_no_op", + "rustversion", + "scopeguard", + "simdutf8", +] + +[[package]] +name = "equator" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4711b213838dfee0117e3be6ac926007d7f433d7bbe33595975d4190cb07e6fc" +dependencies = [ + "equator-macro", +] + +[[package]] +name = "equator-macro" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44f23cf4b44bfce11a86ace86f8a73ffdec849c9fd00a386a53d278bd9e81fb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "equivalent" version = "1.0.2" @@ -630,6 +1040,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "esaxx-rs" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d817e038c30374a4bcb22f94d0a8a0e216958d4c3dcde369b1439fec4bdda6e6" + [[package]] name = "event-listener" version = "5.4.2" @@ -650,24 +1066,84 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "exr" +version = "1.74.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711fe42c9964295e01ee3fba3f9fe0e1d24b98886950d68efe81b1c76e21adf3" +dependencies = [ + "bit_field", + "half", + "lebe", + "miniz_oxide 0.8.9", + "num-complex", + "pulp", + "rayon-core", + "smallvec", + "zune-inflate", +] + [[package]] name = "fastdivide" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9afc2bd4d5a73106dd53d10d73d3401c2f32730ba2c0b93ddb888a8983680471" +[[package]] +name = "fastembed" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3850d724d559da51a4b88f68b0ba111a2627c32279bec6b3c256f073c71a3195" +dependencies = [ + "hf-hub", + "image", + "ndarray", + "ort", + "safetensors", + "serde", + "serde_json", + "thiserror", + "tokenizers", +] + [[package]] name = "fastrand" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" +[[package]] +name = "fax" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf1079563223d5d59d83c85886a56e586cfd5c1a26292e971a0fa266531ac5a" + +[[package]] +name = "fdeflate" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" +dependencies = [ + "simd-adler32", +] + [[package]] name = "find-msvc-tools" version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef25905e51abafe4dcea6c15fec58c57b601cdbd0ee53d22ea1d3016c587d39b" +[[package]] +name = "flate2" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" +dependencies = [ + "crc32fast", + "miniz_oxide 0.9.1", + "zlib-rs", +] + [[package]] name = "fnv" version = "1.0.7" @@ -680,6 +1156,21 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -797,6 +1288,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + [[package]] name = "getrandom" version = "0.3.4" @@ -821,6 +1323,46 @@ dependencies = [ "rand_core 0.10.1", ] +[[package]] +name = "gif" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee8cfcc411d9adbbaba82fb72661cc1bcca13e8bba98b364e62b2dba8f960159" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "h2" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8e5e5a340588f4452631496976cf8636d4a7ecf600239fdc27615d2530bc16" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "half" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea2d84b969582b4b1864a92dc5d27cd2b77b622a8d79306834f1be5ba20d84b" +dependencies = [ + "cfg-if", + "crunchy", + "zerocopy", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -836,6 +1378,8 @@ dependencies = [ "allocator-api2", "equivalent", "foldhash", + "serde", + "serde_core", ] [[package]] @@ -850,6 +1394,33 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hf-hub" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef3982638978efa195ff11b305f51f1f22f4f0a6cabee7af79b383ebee6a213" +dependencies = [ + "dirs 6.0.0", + "http", + "indicatif", + "libc", + "log", + "native-tls", + "rand 0.9.5", + "reqwest 0.12.28", + "serde", + "serde_json", + "thiserror", + "ureq", + "windows-sys 0.61.2", +] + +[[package]] +name = "hmac-sha256" +version = "1.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad320b3b96fb2a455a0726d16efe0a5afdbd34b71dea5bc53b05ea057714d4e" + [[package]] name = "htmlescape" version = "0.3.1" @@ -920,6 +1491,7 @@ dependencies = [ "bytes", "futures-channel", "futures-core", + "h2", "http", "http-body", "httparse", @@ -931,6 +1503,37 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa8e654703247911e29c23fbeaa261834bd9bb74efba2f9acddc37bfb127f53" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + [[package]] name = "hyper-util" version = "0.1.20" @@ -949,9 +1552,11 @@ dependencies = [ "percent-encoding", "pin-project-lite", "socket2", + "system-configuration", "tokio", "tower-service", "tracing", + "windows-registry", ] [[package]] @@ -1088,6 +1693,46 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "image" +version = "0.25.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85ab80394333c02fe689eaf900ab500fbd0c2213da414687ebf995a65d5a6104" +dependencies = [ + "bytemuck", + "byteorder-lite", + "color_quant", + "exr", + "gif", + "image-webp", + "moxcms", + "num-traits", + "png", + "qoi", + "ravif", + "rayon", + "rgb", + "tiff", + "zune-core", + "zune-jpeg", +] + +[[package]] +name = "image-webp" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525e9ff3e1a4be2fbea1fdf0e98686a6d98b4d8f937e1bf7402245af1909e8c3" +dependencies = [ + "byteorder-lite", + "quick-error", +] + +[[package]] +name = "imgref" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f" + [[package]] name = "indexmap" version = "2.14.2" @@ -1100,6 +1745,30 @@ dependencies = [ "serde_core", ] +[[package]] +name = "indicatif" +version = "0.18.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9433806cd6b4ec1aba79c021c7e4c58fb4c3b9977c085062e611ac929998fb0c" +dependencies = [ + "console", + "portable-atomic", + "unicode-width", + "unit-prefix", + "web-time", +] + +[[package]] +name = "interpolate_name" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + [[package]] name = "inventory" version = "0.3.24" @@ -1163,6 +1832,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lebe" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a79a3332a6609480d7d0c9eab957bca6b455b91bb84e66d19f5ff66294b85b8" + [[package]] name = "levenshtein_automata" version = "0.2.1" @@ -1175,6 +1850,22 @@ version = "0.2.189" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" +[[package]] +name = "libfuzzer-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "libredox" version = "0.1.25" @@ -1196,6 +1887,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + [[package]] name = "lock_api" version = "0.4.14" @@ -1211,6 +1908,15 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" +[[package]] +name = "loop9" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fae87c125b03c1d2c0150c90365d7d6bcc53fb73a9acaef207d2d065860f062" +dependencies = [ + "imgref", +] + [[package]] name = "lru" version = "0.16.4" @@ -1226,12 +1932,54 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e" +[[package]] +name = "lzma-rust2" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e20f57f9918e5bd7bc58c22cdd70a6afc7375d4dd9683af5f2b34bd3d2bba619" + +[[package]] +name = "macro_rules_attribute" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3ae8f6d608c795738406608304d30a2dfbdc8e58e44f7ba43236da5208ded3c" +dependencies = [ + "macro_rules_attribute-proc_macro", + "pastey 0.2.3", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc04a4c58212d57930a24bf47d3fa87485264a3a054e9c10e042eb373573ad3c" + [[package]] name = "matchit" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" +[[package]] +name = "matrixmultiply" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" +dependencies = [ + "cfg-if", + "rayon", +] + [[package]] name = "mcp-memory-linux-nvim" version = "0.1.0" @@ -1249,10 +1997,11 @@ dependencies = [ "axum", "chrono", "clap", - "dirs", + "dirs 7.0.0", + "fastembed", "futures-util", "redb", - "reqwest", + "reqwest 0.13.5", "rmcp", "schemars", "serde", @@ -1275,11 +2024,11 @@ version = "0.1.0" dependencies = [ "async-channel", "clap", - "dirs", + "dirs 7.0.0", "futures-util", "mcp-stdio", "regex", - "reqwest", + "reqwest 0.13.5", "serde_json", "tokio", "tokio-tungstenite 0.30.0", @@ -1340,6 +2089,26 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "mio" version = "1.2.3" @@ -1351,12 +2120,97 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "monostate" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3341a273f6c9d5bef1908f17b7267bbab0e95c9bf69a0d4dcf8e9e1b2c76ef67" +dependencies = [ + "monostate-impl", + "serde", + "serde_core", +] + +[[package]] +name = "monostate-impl" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4db6d5580af57bf992f59068d4ea26fd518574ff48d7639b255a36f9de6e7e9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "moxcms" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb85c154ba489f01b25c0d36ae69a87e4a1c73a72631fc6c0eb6dde34a73e44b" +dependencies = [ + "num-traits", + "pxfm", +] + +[[package]] +name = "multiversion_no_op" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" + [[package]] name = "murmurhash32" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2195bf6aa996a481483b29d62a7663eed3fe39600c460e323f8ff41e90bdd89b" +[[package]] +name = "native-tls" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "465500e14ea162429d264d44189adc38b199b62b1c21eea9f69e4b73cb03bbf2" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndarray" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "portable-atomic", + "portable-atomic-util", + "rawpointer", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "no_std_io2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418abd1b6d34fbf6cae440dc874771b0525a604428704c76e48b29a5e67b8003" +dependencies = [ + "memchr", +] + [[package]] name = "nom" version = "7.1.3" @@ -1367,6 +2221,21 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "noop_proc_macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0676bb32a98c1a483ce53e500a81ad9c3d5b3f7c920c28c24e9cb0980d0b5bc8" + [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -1376,12 +2245,63 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "bytemuck", + "num-traits", +] + [[package]] name = "num-conv" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1397,7 +2317,7 @@ version = "0.1.0" dependencies = [ "bytes", "dashmap", - "dirs", + "dirs 7.0.0", "mcp-stdio", "rmcp", "rmpv", @@ -1427,6 +2347,71 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "269bca4c2591a28585d6bf10d9ed0332b7d76900a1b02bec41bdc3a2cdcda107" +[[package]] +name = "onig" +version = "6.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc3cbf698f9438986c11a880c90a6d04b9de27575afd28bbf45b154b6c709e2" +dependencies = [ + "bitflags", + "libc", + "once_cell", + "onig_sys", +] + +[[package]] +name = "onig_sys" +version = "69.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e68317604e77e53b85896388e1a803c1d21b74c899ec9e5e1112db90735edd7" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "openssl" +version = "0.10.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "openssl-sys" +version = "0.9.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -1442,6 +2427,30 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ort" +version = "2.0.0-rc.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4336a1e2b38848325241c72889086886004e589b7c74f335e60a8e8db5138a0b" +dependencies = [ + "ndarray", + "ort-sys", + "smallvec", + "tracing", + "ureq", +] + +[[package]] +name = "ort-sys" +version = "2.0.0-rc.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf211e3776eea6aec988552fa118dd746d70e1b1e5e244058d1c98015f3e5872" +dependencies = [ + "hmac-sha256", + "lzma-rust2", + "ureq", +] + [[package]] name = "ownedbytes" version = "0.9.0" @@ -1480,12 +2489,33 @@ dependencies = [ "windows-link", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + [[package]] name = "pastey" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ee67f1008b1ba2321834326597b8e186293b049a023cdef258527550b9935b4" +[[package]] +name = "pem-rfc7468" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.2" @@ -1504,6 +2534,34 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" +[[package]] +name = "png" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61" +dependencies = [ + "bitflags", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide 0.8.9", +] + +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" +dependencies = [ + "portable-atomic", +] + [[package]] name = "potential_utf" version = "0.1.6" @@ -1547,6 +2605,69 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "profiling" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5" +dependencies = [ + "profiling-procmacros", +] + +[[package]] +name = "profiling-procmacros" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4488a4a36b9a4ba6b9334a32a39971f77c1436ec82c38707bce707699cc3bbcb" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "pulp" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "046aa45b989642ec2e4717c8e72d677b13edd831a4d3b6cf37d9a3e54912496a" +dependencies = [ + "bytemuck", + "cfg-if", + "libm", + "num-complex", + "paste", + "pulp-wasm-simd-flag", + "raw-cpuid", + "reborrow", + "version_check", +] + +[[package]] +name = "pulp-wasm-simd-flag" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d8f70e07b9c3962945a74e59ca1c511bba65b6419468acc217c457d93f3c740" + +[[package]] +name = "pxfm" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" + +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "quick-error" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" + [[package]] name = "quote" version = "1.0.47" @@ -1614,6 +2735,71 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" +[[package]] +name = "rav1e" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b6dd56e85d9483277cde964fd1bdb0428de4fec5ebba7540995639a21cb32b" +dependencies = [ + "aligned-vec", + "arbitrary", + "arg_enum_proc_macro", + "arrayvec", + "av-scenechange", + "av1-grain", + "bitstream-io", + "built", + "cfg-if", + "interpolate_name", + "itertools", + "libc", + "libfuzzer-sys", + "log", + "maybe-rayon", + "new_debug_unreachable", + "noop_proc_macro", + "num-derive", + "num-traits", + "paste", + "profiling", + "rand 0.9.5", + "rand_chacha", + "simd_helpers", + "thiserror", + "v_frame", + "wasm-bindgen", +] + +[[package]] +name = "ravif" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e52310197d971b0f5be7fe6b57530dcd27beb35c1b013f29d66c1ad73fbbcc45" +dependencies = [ + "avif-serialize", + "imgref", + "loop9", + "quick-error", + "rav1e", + "rayon", + "rgb", +] + +[[package]] +name = "raw-cpuid" +version = "11.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + [[package]] name = "rayon" version = "1.12.0" @@ -1624,6 +2810,17 @@ dependencies = [ "rayon-core", ] +[[package]] +name = "rayon-cond" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2964d0cf57a3e7a06e8183d14a8b527195c706b7983549cd5462d5aa3747438f" +dependencies = [ + "either", + "itertools", + "rayon", +] + [[package]] name = "rayon-core" version = "1.13.0" @@ -1634,6 +2831,12 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "reborrow" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03251193000f4bd3b042892be858ee50e8b3719f2b08e5833ac4353724632430" + [[package]] name = "redb" version = "4.3.0" @@ -1711,6 +2914,49 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" +[[package]] +name = "reqwest" +version = "0.12.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "mime", + "native-tls", + "percent-encoding", + "pin-project-lite", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams 0.4.2", + "web-sys", +] + [[package]] name = "reqwest" version = "0.13.5" @@ -1741,10 +2987,30 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", - "wasm-streams", + "wasm-streams 0.5.0", "web-sys", ] +[[package]] +name = "rgb" +version = "0.8.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b34b781b31e5d73e9fbc8689c70551fd1ade9a19e3e28cfec8580a79290cc4" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "rmcp" version = "3.4.0" @@ -1755,7 +3021,7 @@ dependencies = [ "chrono", "futures", "indexmap", - "pastey", + "pastey 0.2.3", "pin-project-lite", "rmcp-macros", "schemars", @@ -1774,7 +3040,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd740c45d66ceb87e5579082abc27bd771665e464e9660a17a048c721b2a6025" dependencies = [ - "darling", + "darling 0.24.1", "proc-macro2", "quote", "serde_json", @@ -1828,6 +3094,41 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "rustls" +version = "0.23.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.23" @@ -1840,6 +3141,28 @@ version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" +[[package]] +name = "safetensors" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79b079b829cb27a1c3c374341345ed2e8b2c0c839034522cee576c140bd7f846" +dependencies = [ + "hashbrown 0.16.1", + "libc", + "serde", + "serde_json", + "tempfile", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "schemars" version = "1.2.2" @@ -1872,6 +3195,29 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "serde" version = "1.0.229" @@ -1996,6 +3342,27 @@ dependencies = [ "libc", ] +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + +[[package]] +name = "simd_helpers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95890f873bec569a0362c235787f3aca6e1e887302ba4840839bcc6459c42da6" +dependencies = [ + "quote", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "sketches-ddsketch" version = "0.4.1" @@ -2027,18 +3394,53 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "socks" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c3dbbd9ae980613c6dd8e28a9407b50509d3803b57624d5dfe8315218cd58b" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + +[[package]] +name = "spm_precompiled" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5851699c4033c63636f7ea4cf7b7c1f1bf06d0cc03cfb42e711de5a5c46cf326" +dependencies = [ + "base64 0.13.1", + "nom 7.1.3", + "serde", + "unicode-segmentation", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "symlink" version = "0.1.0" @@ -2087,6 +3489,27 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tantivy" version = "0.26.2" @@ -2196,7 +3619,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfadb8526b6da90704feb293b0701a6aae62ea14983143344be2dc5ce30f1d82" dependencies = [ "fnv", - "nom", + "nom 7.1.3", "ordered-float", "serde", "serde_json", @@ -2277,6 +3700,20 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "tiff" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63feaf3343d35b6ca4d50483f94843803b0f51634937cc2ec519fc32232bc52" +dependencies = [ + "fax", + "flate2", + "half", + "quick-error", + "weezl", + "zune-jpeg", +] + [[package]] name = "time" version = "0.3.55" @@ -2317,6 +3754,39 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tokenizers" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7afbf6e88718afcc138bad01d6ccc3051dbbc3b2ce9793d8b8a3aeb610969cfc" +dependencies = [ + "ahash", + "compact_str", + "daachorse", + "dary_heap", + "derive_builder", + "esaxx-rs", + "getrandom 0.3.4", + "itertools", + "log", + "macro_rules_attribute", + "monostate", + "onig", + "paste", + "rand 0.9.5", + "rayon", + "rayon-cond", + "regex", + "regex-syntax", + "serde", + "serde_json", + "spm_precompiled", + "thiserror", + "unicode-normalization-alignments", + "unicode-segmentation", + "unicode_categories", +] + [[package]] name = "tokio" version = "1.53.1" @@ -2345,6 +3815,26 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9cc2678c2cdd569ef8215e2afd7954ada2ae20b4fdd2c5fe6139a3b02d105db" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-tungstenite" version = "0.29.0" @@ -2589,6 +4079,81 @@ version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954" +[[package]] +name = "unicode-normalization-alignments" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43f613e4fa046e69818dd287fdc4bc78175ff20331479dab6e1b0f98d57062de" +dependencies = [ + "smallvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[package]] +name = "unit-prefix" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "3.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a7ac20be9b7726e0bbdbf974c059676d9acb1cd414961f570a4e8231cacd7fc" +dependencies = [ + "base64 0.23.1", + "cookie_store", + "der", + "flate2", + "log", + "native-tls", + "percent-encoding", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "socks", + "ureq-proto", + "utf8-zero", + "webpki-root-certs", + "webpki-roots", +] + +[[package]] +name = "ureq-proto" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f86fd172ccca569e458f61b6bdd6220965a9ef36e672a6852953b51a0e1583be" +dependencies = [ + "base64 0.23.1", + "http", + "httparse", + "log", +] + [[package]] name = "url" version = "2.5.8" @@ -2607,6 +4172,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" +[[package]] +name = "utf8-zero" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" + [[package]] name = "utf8_iter" version = "1.0.4" @@ -2631,12 +4202,29 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "v_frame" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "666b7727c8875d6ab5db9533418d7c764233ac9c0cff1d469aec8fa127597be2" +dependencies = [ + "aligned-vec", + "num-traits", + "wasm-bindgen", +] + [[package]] name = "valuable" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -2722,6 +4310,19 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-streams" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "wasm-streams" version = "0.5.0" @@ -2745,6 +4346,40 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "webpki-roots" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcd9d09a39985f5344844e66b0c530a33843579125f23e21e9f0f220850f22a" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "weezl" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28ac98ddc8b9274cb41bb4d9d4d5c425b6020c50c46f25559911905610b4a88" + [[package]] name = "winapi" version = "0.3.9" @@ -2808,6 +4443,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-registry" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + [[package]] name = "windows-result" version = "0.4.1" @@ -2826,6 +4472,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.59.0" @@ -2929,6 +4584,12 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" +[[package]] +name = "y4m" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5a4b21e1a62b67a2970e6831bc091d7b87e119e7f9791aef9702e3bef04448" + [[package]] name = "yoke" version = "0.8.3" @@ -2993,6 +4654,12 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + [[package]] name = "zerotrie" version = "0.2.5" @@ -3026,6 +4693,12 @@ dependencies = [ "syn 3.0.6", ] +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + [[package]] name = "zmij" version = "1.0.23" @@ -3059,3 +4732,27 @@ dependencies = [ "cc", "pkg-config", ] + +[[package]] +name = "zune-core" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56377fd46368984a170bc5aac5567e52ca5da874caa60bea39fcbca78fb658b" + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "zune-jpeg" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27bc9d5b815bc103f142aa054f561d9187d191692ec7c2d1e2b4737f8dbd7296" +dependencies = [ + "zune-core", +] diff --git a/README.md b/README.md index 5c1eede..2338810 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ dofile("C:/Users/reazul.ashraf/workspace/rust/mcp-memory/gemini-integration.lua" When you use the gemini-integration.lua script, Neovim acts as an active telemetry broadcaster. Whenever you alt-tab into a Neovim window (FocusGained) or switch files (BufEnter): 1. **Fallback Sync:** Neovim instantly writes its unique Session ID (Named Pipe / Unix Socket) to ~/.gemini/active_nvim.txt. -2. **WebSocket Telemetry:** Neovim pushes a JSON payload containing the active filename, cursor row, and column to the Rust server's /nvim/telemetry webhook. +2. **WebSocket Telemetry:** Neovim pushes a JSON payload containing the active filename, cursor row, and column via a connectionless UDP datagram to the Rust server's port 3002 listener. 3. **UI Broadcast:** The Rust server updates the global state and broadcasts this over WebSockets (/ws) so that the Brain Monitor Dashboard can animate your active file live in the UI! ### Neovim MCP Tools @@ -114,3 +114,4 @@ The LLM agent interacts with your active Neovim session using a dedicated set of * **vim_get_active_buffer**: Read live, unsaved buffer contents. * **vim_get_cursor**: Fetch precise line/column coordinates. * **vim_get_visual_selection**: Read highlighted code blocks. + diff --git a/agent-rules/global_subagents.md b/agent-rules/global_subagents.md index e502439..9b194c0 100644 --- a/agent-rules/global_subagents.md +++ b/agent-rules/global_subagents.md @@ -25,3 +25,15 @@ Invoke these dynamically using the `invoke_subagent` tool. Use `send_message` to * **Permissions:** You MUST define this subagent with `enable_write_tools: true`. * **Trigger:** When facing complex architectural bugs, race conditions, or eventually consistent state issues that are hard to track down. * **Action:** Instead of guessing or patching blindly, this subagent creates diagnostic scripts, enhances reproducers with detailed logs, and isolates the bug. Once root cause is definitively proven, it hands the diagnostic evidence back to you to implement the fix. + +## 4. ScrumMaster +* **Role:** Project & Task Orchestrator +* **Permissions:** You MUST define this subagent with `enable_mcp_tools: true` and `enable_write_tools: true`. +* **Trigger:** When we start a new feature or finish a task. +* **Action:** Passively monitors the `memory://tasks/active` and `memory://milestones` MCP resources. Creates tasks, organizes milestones, and updates statuses when criteria are met using `add_task`, `update_task_status`, `add_milestone`, and `verify_acceptance_criteria`. + +## 5. DevOpsSRE +* **Role:** Environment & Handoff Manager +* **Permissions:** You MUST define this subagent with `enable_mcp_tools: true` and `enable_write_tools: true`. +* **Trigger:** When dependencies change (e.g., you modify `Cargo.toml`, `package.json`, or `.env`) or at the end of a session. +* **Action:** Updates environment fingerprints when dependency files change. At the end of a session, it executes the `handoff_routine` MCP prompt to automatically generate standup reports and handoff memos. diff --git a/design.md b/design.md index 4473533..59f497c 100644 --- a/design.md +++ b/design.md @@ -25,7 +25,7 @@ The server hosts a rich Single Page Application (SPA) natively on the root route * `GET /api/stats`: Returns a JSON snapshot of current entity, relation, task, and tech debt counts. ### Git & IDE Integration Endpoints -* `POST /nvim/telemetry`: A one-way webhook that Neovim instances hit on `FocusGained` or `BufEnter` to globally broadcast the user's active file to the UI and Agent. +* `UDP /nvim/telemetry`: A one-way connectionless datagram listener that Neovim instances hit on `FocusGained` or `BufEnter` to globally broadcast the user's active file to the UI and Agent. * `GET /gate/verify`: A lightweight, deterministic endpoint used by external scripts (like a `git push` wrapper) to verify if an action is authorized based on the current state. ## 3. Client Connections @@ -127,7 +127,7 @@ eqwest and okio). To enable seamless pair-programming inside Neovim, the daemon integrates with Neovim using two complementary systems: a Webhook Telemetry pipeline and dedicated MCP binaries. ### Telemetry Pipeline (Last Focused Wins) -A lightweight Lua script (gemini-integration.lua) is loaded into Neovim, which fires an asynchronous curl POST to http://127.0.0.1:3000/nvim/telemetry whenever the user focuses a buffer or moves the cursor. The server then writes this data (including session_id, ile, line, and col) to both the Windows and WSL ctive_nvim.txt files and broadcasts it over WebSockets. +A lightweight Lua script (`gemini-integration.lua`) is loaded into Neovim, which fires an asynchronous UDP datagram to `127.0.0.1:3002` (fire-and-forget via native libuv) whenever the user focuses a buffer or moves the cursor. The server then writes this data (including `session_id`, `file`, `line`, and `col`) to both the Windows and WSL `active_nvim.txt` files and broadcasts it over WebSockets. ### Native MCP Binaries (win-nvim & linux-nvim) The project compiles two standalone, highly-performant binaries that implement the MCP JSON-RPC protocol over Stdio and bridge it directly to Neovim's Msgpack-RPC Named Pipes/Sockets. These binaries avoid hardcoding infinite tools by utilizing a "God Mode" escape hatch. @@ -162,4 +162,15 @@ Historically, the project relied on a complex Python testing suite (\pytest\ + \ * **E2E Tests:** Integration and full-system tests run via \stub/tests/e2e.rs\ and \win-nvim/tests/integration_test.rs\, ensuring type safety, faster execution, and eliminating Python environment dependencies. ## 17. Automated Git Context Binding (git2) Instead of forcing the LLM client to manually run `git rev-parse HEAD` and pass `git_branch` / `git_commit` arguments for every single code change, the server integrates the native **`git2`** C bindings. -When engineering endpoints (`log_code_change`, `log_error_fix`, `log_tech_debt`) are invoked, the server asynchronously discovers the surrounding Git repository, peels the HEAD reference, and automatically injects the current commit hash, commit message, and branch name directly into the stored entities and audit logs. This guarantees airtight VCS traceability without wasting LLM tokens or relying on the agent's memory. \ No newline at end of file +When engineering endpoints (`log_code_change`, `log_error_fix`, `log_tech_debt`) are invoked, the server asynchronously discovers the surrounding Git repository, peels the HEAD reference, and automatically injects the current commit hash, commit message, and branch name directly into the stored entities and audit logs. This guarantees airtight VCS traceability without wasting LLM tokens or relying on the agent's memory. + +## 18. Upcoming Enhancements +### A. Vector Embeddings for Semantic Search +The `omni_search` will be upgraded from purely lexical `tantivy` indexing to include a local ONNX embedding model (via `fastembed`). This allows semantic retrieval of `ErrorFix` and `TechDebt` entries even when exact vocabulary does not match. + +### B. Passive Terminal Ingestion +A shell hook system (PowerShell/Nushell) will silently POST terminal execution history and exit codes to `/terminal/history`. LLMs can passively read this via the `memory://terminal/recent` resource, eliminating the need for the user to manually copy/paste stack traces. + +### C. Graph Summarization & Decay +To prevent context window bloat, the Redb engine will enforce TTLs on ephemeral nodes (`StickyNotes`, minor `Tasks`). Furthermore, an `archive_routine` prompt will allow subagents to automatically compress older `SessionSummaries` into dense milestone retrospectives. + diff --git a/instructions.md b/instructions.md index 8cd8b94..35bd6cd 100644 --- a/instructions.md +++ b/instructions.md @@ -92,9 +92,14 @@ When shifting context rapidly (e.g. from building a feature to fixing a prod bug - **load_context_workspace:** Retrieve a saved workspace to instantly restore your context when returning to that task. - **list_context_workspaces:** List all saved workspaces in a project. -## Omni-Search (Global Vault Search) -When you remember a vague keyword but don't know which specific vault it's stored in. +## Omni-Search (Hybrid Vector Search) +When you remember a vague concept, keyword, or architectural pattern but don't know which specific vault it's stored in. - **omni_search:** Searches across the Knowledge Graph, Tasks, Snippets, ADRs, Tech Debt, Memos, and Error Fixes simultaneously. +- **Semantic Superpower:** This tool utilizes **Hybrid Vector Search** (BM25 + Vector Embeddings). You do not need exact keyword matches. You can query conceptually (e.g., "database lock issues" or "how is auth handled") and the engine will return semantically relevant context. + +## Terminal History & Telemetry +To maintain an audit trail of shell commands and execution contexts. +- **Context:** The server actively tracks Terminal History. Commands executed in the user's shell are logged to the memory server and visible in the dashboard UI. While you don't call an MCP tool for this directly, be aware that complex shell actions and their outcomes are persisted for historical auditing and UI visibility. ## Project Health Dashboard When starting a new session, get a numerical aggregate of the project's current state. @@ -112,4 +117,5 @@ The project contains two MCP binaries (win-nvim and linux-nvim) that bridge JSON - **God Mode**: They also expose `nvim_execute_lua`. This is the ultimate fallback tool. If you need to access *any* Neovim API that does not have a dedicated Rust tool (e.g., getting LSP diagnostics, evaluating a visual selection block based on modes, setting registers), you MUST write a short Lua script and pass it to `nvim_execute_lua`. Do not attempt to recompile the Rust server to add new basic tools; use the Lua escape hatch dynamically. ## 16. Tool Schema Discovery (Lazy Loading) -Antigravity automatically caches all MCP tool schemas to your disk to save tokens. Do **NOT** grep or search the Rust source code to find tool schemas or arguments. To understand a tool`s arguments, directly read `~/.gemini/antigravity-cli/mcp//.json`. For simple tools, confidently guess the arguments instead of reading the schema to save time. +Antigravity automatically caches all MCP tool schemas to your disk to save tokens. Do **NOT** grep or search the Rust source code to find tool schemas or arguments. To understand a tool`s arguments, directly read `~/.gemini/antigravity-cli/mcp//.json`. Do NOT guess arguments. ALWAYS read the schema if you are unfamiliar with a tool to prevent invalid argument errors. + diff --git a/nvim-core/src/lib.rs b/nvim-core/src/lib.rs index a66c497..94010cc 100644 --- a/nvim-core/src/lib.rs +++ b/nvim-core/src/lib.rs @@ -90,12 +90,20 @@ async fn get_socket_path() -> Result { if let Ok(content) = tokio::fs::read_to_string(&path).await { let p = content.trim().to_string(); if !p.is_empty() { - if p.starts_with(r"\\.\pipe\") { - return Ok(p); + let candidate = if p.starts_with(r"\\.\pipe\") { + p } else if p.starts_with("nvim.") { - return Ok(format!(r"\\.\pipe\{p}")); + format!(r"\\.\pipe\{p}") + } else { + p + }; + + if is_interactive(&candidate).await { + return Ok(candidate); + } else { + tracing::warn!("Stale active_nvim.txt detected on Windows. Deleting."); + let _ = tokio::fs::remove_file(&path).await; } - return Ok(p); } } @@ -122,7 +130,12 @@ async fn get_socket_path() -> Result { if let Ok(content) = tokio::fs::read_to_string(&path).await { let p = content.trim().to_string(); if !p.is_empty() { - return Ok(p); + if is_interactive(&p).await { + return Ok(p); + } else { + tracing::warn!("Stale active_nvim.txt detected on Unix. Deleting."); + let _ = tokio::fs::remove_file(&path).await; + } } } } diff --git a/server/Cargo.toml b/server/Cargo.toml index 57c2130..b93644c 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -23,6 +23,7 @@ tracing-appender = "0.2.5" rmcp = { version = "3.4.0", features = ["server"] } thiserror = "2.0.20" tower = { version = "0.5.3", features = ["util"] } +fastembed = "7.1.0" [build-dependencies] chrono = "0.4.45" diff --git a/server/src/api/setup.rs b/server/src/api/setup.rs index e94e78e..61bfe55 100644 --- a/server/src/api/setup.rs +++ b/server/src/api/setup.rs @@ -24,6 +24,8 @@ pub fn create_router(app_state: Arc) -> Router { .route("/ws", get(ws_handler)) .route("/health", get(health_handler)) .route("/nvim/telemetry", post(nvim_telemetry_handler)) + .route("/api/terminal/history", get(crate::api::telemetry::get_terminal_history_handler)) + .route("/terminal/telemetry", post(crate::api::telemetry::terminal_telemetry_handler)) .route("/events/wait", get(crate::api::events::wait_for_event_handler)) .route("/events", post(crate::api::events::post_event_handler)) .route("/gate/verify", get(gate_verify_handler)) diff --git a/server/src/api/telemetry.rs b/server/src/api/telemetry.rs index b29d286..1c7254b 100644 --- a/server/src/api/telemetry.rs +++ b/server/src/api/telemetry.rs @@ -65,3 +65,108 @@ pub async fn nvim_telemetry_handler( axum::Json(serde_json::json!({"status": "ok"})) } + +use crate::models::TerminalHistory; + +pub async fn get_terminal_history_handler( + State(state): State>, +) -> impl axum::response::IntoResponse { + let history_json = state.handler.state.terminal_history.read_with(|h| serde_json::to_string(h).unwrap_or_else(|_| "[]".to_string())); + ([(axum::http::header::CONTENT_TYPE, "application/json")], history_json) +} + +pub async fn terminal_telemetry_handler( + State(state): State>, + axum::Json(payload): axum::Json, +) -> impl axum::response::IntoResponse { + state.handler.state.terminal_history.modify(|history| { + history.push_front(payload.clone()); + if history.len() > 100 { + history.pop_back(); + } + }); + + let ws_msg = serde_json::json!({ + "type": "terminal_telemetry", + "data": payload + }); + + let msg_str = ws_msg.to_string(); + let senders: Vec<_> = state + .clients + .read() + .unwrap_or_else(|e| e.into_inner()) + .values() + .cloned() + .collect(); + for tx in senders { + let _ = tx.try_send(msg_str.clone()); + } + + axum::Json(serde_json::json!({"status": "ok"})) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::router::MemoryHandler; + use crate::state::MemoryState; + use axum::http::Request; + use tower::ServiceExt; + use std::collections::HashMap; + use std::sync::atomic::AtomicUsize; + use tempfile::tempdir; + use axum::routing::post; + use axum::routing::get; + + #[tokio::test] + async fn test_terminal_history() { + let dir = tempdir().unwrap(); + let state = Arc::new(MemoryState::new(dir.path().to_str().unwrap())); + let app_state = Arc::new(AppState { + handler: Arc::new(MemoryHandler::new(state.clone())), + clients: std::sync::RwLock::new(HashMap::new()), + next_id: AtomicUsize::new(1), + }); + + let app = axum::Router::new() + .route("/api/terminal/history", get(get_terminal_history_handler)) + .route("/terminal/telemetry", post(terminal_telemetry_handler)) + .with_state(app_state.clone()); + + // Create a fake terminal telemetry payload + let payload = TerminalHistory { + command: "echo test".to_string(), + exit_code: 0, + + timestamp: 12345, + }; + + // Post the telemetry + let req = Request::builder() + .method("POST") + .uri("/terminal/telemetry") + .header("content-type", "application/json") + .body(axum::body::Body::from(serde_json::to_string(&payload).unwrap())) + .unwrap(); + + let response = app.clone().oneshot(req).await.unwrap(); + assert_eq!(response.status(), 200); + + // Get the telemetry + let req2 = Request::builder() + .method("GET") + .uri("/api/terminal/history") + .body(axum::body::Body::empty()) + .unwrap(); + + let response2 = app.oneshot(req2).await.unwrap(); + assert_eq!(response2.status(), 200); + + let body_bytes = axum::body::to_bytes(response2.into_body(), usize::MAX).await.unwrap(); + let history: Vec = serde_json::from_slice(&body_bytes).unwrap(); + assert_eq!(history.len(), 1); + assert_eq!(history[0].command, "echo test"); + } +} + diff --git a/server/src/dashboard.html b/server/src/dashboard.html index 6a91368..1337502 100644 --- a/server/src/dashboard.html +++ b/server/src/dashboard.html @@ -478,6 +478,7 @@ + @@ -485,6 +486,7 @@ + @@ -529,6 +531,13 @@ +
+
+

Global Preferences

+
+
+
+

Sticky Notes

@@ -589,6 +598,13 @@
+
+
+

Terminal History

+
+
+
+
@@ -615,6 +631,8 @@ feed.scrollTop = 0; } else if (tabId === 'task-tab') { loadTasks(); + } else if (tabId === 'preferences-tab') { + loadPreferences(); } else if (tabId === 'sticky-tab') { loadStickyNotes(); } else { @@ -1029,6 +1047,33 @@ }; } + async function loadPreferences() { + try { + const res = await fetch('/api/preferences'); + const data = await res.json(); + + const container = document.getElementById('preferences-container'); + container.innerHTML = ''; + + if (!data || Object.keys(data).length === 0) { + container.innerHTML = '
No global preferences found.
'; + return; + } + + for (const [key, pref] of Object.entries(data)) { + const date = new Date(pref.updated_at * 1000).toLocaleString(); + container.innerHTML += ` +
+ ${key} +
${pref.value}
+
Last Updated: ${date}
+
`; + } + } catch (e) { + console.error('Error loading preferences:', e); + } + } + async function loadStickyNotes() { try { const res = await fetch('/api/sticky'); @@ -1078,7 +1123,10 @@ } function loadAllExtras() { - + loadGenericList('/api/terminal/history', 'terminal-container', item => ` + ${item.command} + Exit Code: ${item.exit_code} + `); loadGenericList('/api/tech_debts', 'techdebt-container', item => ` ${item.id} ${item.is_resolved ? '(Resolved)' : '(Open)'} @@ -1091,9 +1139,9 @@ `); loadGenericList('/api/error_fixes', 'errorfixes-container', item => ` - ${item.error_message || 'Error'} -
Fix: ${item.fix_description || ''}
-
Files: ${(item.files_changed || []).join(', ')}
+ ${item.signature || 'Error'} +
Solution: ${item.solution || ''}
+
Commit: ${item.git_commit || 'None'}
`); loadGenericList('/api/adrs', 'adrs-container', item => ` @@ -1169,4 +1217,3 @@ - diff --git a/server/src/embedding.rs b/server/src/embedding.rs new file mode 100644 index 0000000..414e7c3 --- /dev/null +++ b/server/src/embedding.rs @@ -0,0 +1,42 @@ +#[allow(deprecated)] +use fastembed::{TextEmbedding, EmbeddingModel}; +use std::sync::OnceLock; +use std::sync::Mutex; + +static EMBEDDING_MODEL: OnceLock> = OnceLock::new(); + +#[allow(deprecated)] +pub fn get_embedding_model() -> Result<&'static Mutex, String> { + if let Some(model) = EMBEDDING_MODEL.get() { + return Ok(model); + } + let options = fastembed::InitOptions::new(EmbeddingModel::AllMiniLML6V2) + .with_show_download_progress(true); + + let model = TextEmbedding::try_new(options).map_err(|e| e.to_string())?; + let _ = EMBEDDING_MODEL.set(Mutex::new(model)); + Ok(EMBEDDING_MODEL.get().unwrap()) +} + +pub async fn generate_embedding_async(text: String) -> Result, String> { + tokio::task::spawn_blocking(move || { + let model_mutex = get_embedding_model()?; + let mut model = model_mutex.lock().map_err(|e| e.to_string())?; + let embeddings = model.embed(vec![text], None).map_err(|e| e.to_string())?; + Ok(embeddings.into_iter().next().unwrap_or_default()) + }).await.map_err(|e| e.to_string())? +} + +pub fn cosine_similarity(a: &[f32], b: &[f32]) -> f32 { + if a.is_empty() || b.is_empty() || a.len() != b.len() { + return 0.0; + } + let dot_product: f32 = a.iter().zip(b.iter()).map(|(x, y)| x * y).sum(); + let norm_a: f32 = a.iter().map(|x| x * x).sum::().sqrt(); + let norm_b: f32 = b.iter().map(|x| x * x).sum::().sqrt(); + if norm_a == 0.0 || norm_b == 0.0 { + 0.0 + } else { + dot_product / (norm_a * norm_b) + } +} diff --git a/server/src/handlers/meta.rs b/server/src/handlers/meta.rs index d2702bd..aad7c19 100644 --- a/server/src/handlers/meta.rs +++ b/server/src/handlers/meta.rs @@ -138,6 +138,8 @@ impl McpTool for LogErrorFixHandler { async fn execute(&self, args: Value, state: Arc) -> Result { let req: LogErrorFixTool = serde_json::from_value(args).map_err(|e| e.to_string())?; + let text_to_embed = format!("Signature: {}\nSolution: {}", req.signature, req.solution); + let embedding = crate::embedding::generate_embedding_async(text_to_embed).await.ok(); state.error_fixes.modify(|fixes| { fixes.push(crate::models::ErrorFix { signature: req.signature, @@ -145,6 +147,7 @@ impl McpTool for LogErrorFixHandler { timestamp: crate::handlers::utils::now_secs(), git_commit: req.git_commit, git_branch: req.git_branch, + embedding, }) }); Ok("Error fix logged".to_string()) @@ -294,6 +297,8 @@ impl McpTool for LogTechDebtHandler { async fn execute(&self, args: Value, state: Arc) -> Result { let req: LogTechDebtTool = serde_json::from_value(args).map_err(|e| e.to_string())?; + let text_to_embed = format!("Description: {}\nIdeal Solution: {}", req.description, req.ideal_solution); + let embedding = crate::embedding::generate_embedding_async(text_to_embed).await.ok(); state.tech_debts.modify(|debts| { debts.push(crate::models::TechDebt { id: uuid::Uuid::new_v4().to_string(), @@ -304,6 +309,7 @@ impl McpTool for LogTechDebtHandler { created_at: crate::handlers::utils::now_secs(), git_commit: req.git_commit, git_branch: req.git_branch, + embedding, }) }); Ok("Tech debt logged".to_string()) @@ -404,6 +410,8 @@ impl McpTool for OmniSearchHandler { } }; println!("OMNI SEARCH MATCHES: {:?}", matches); + let q = req.query.clone(); + let query_emb = crate::embedding::generate_embedding_async(q.clone()).await.unwrap_or_default(); let kg_json = state.read_graph(|full| { let mut kg_entities = std::collections::HashMap::new(); @@ -466,20 +474,27 @@ impl McpTool for OmniSearchHandler { })?; let snippets_json = state.snippets.read_with(|all_snippets| { - let filtered: Vec<_> = all_snippets - .iter() - .filter(|s| matched_snippets.contains(s.name.as_str())) - .take(limit) - .map(|s| { - if !include_body { - let mut summary = s.clone(); - summary.code = "".to_string(); - summary - } else { - s.clone() - } - }) - .collect(); + let mut scored: Vec<_> = all_snippets.iter().map(|s| { + let mut score = 0.0; + if matched_snippets.contains(s.name.as_str()) || contains_ignore_ascii_case(&s.name, &q) || contains_ignore_ascii_case(&s.description, &q) { + score += 1.0; + } + if let Some(emb) = &s.embedding { + score += crate::embedding::cosine_similarity(&query_emb, emb); + } + (s, score) + }).filter(|(_, score)| *score > 0.4).collect(); + scored.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(std::cmp::Ordering::Equal)); + + let filtered: Vec<_> = scored.into_iter().take(limit).map(|(s, _)| { + if !include_body { + let mut summary = s.clone(); + summary.code = "".to_string(); + summary + } else { + s.clone() + } + }).collect(); serde_json::to_value(&filtered).map_err(|e| e.to_string()) })?; @@ -505,25 +520,31 @@ impl McpTool for OmniSearchHandler { let q = req.query; let tech_debts_json = state.tech_debts.read_with(|debts| { - let filtered: Vec<_> = debts - .iter() - .filter(|d| { - req.namespace.as_ref().is_none_or(|ns| d.namespace == *ns) - && (contains_ignore_ascii_case(&d.description, &q) - || contains_ignore_ascii_case(&d.ideal_solution, &q)) - }) - .take(limit) - .map(|d| { - if !include_body { - let mut summary = d.clone(); - summary.description = "".to_string(); - summary.ideal_solution = "".to_string(); - summary - } else { - d.clone() - } - }) - .collect(); + let mut scored: Vec<_> = debts.iter().map(|d| { + if req.namespace.as_ref().is_some_and(|ns| d.namespace != *ns) { + return (d, 0.0); + } + let mut score = 0.0; + if contains_ignore_ascii_case(&d.description, &q) || contains_ignore_ascii_case(&d.ideal_solution, &q) { + score += 1.0; + } + if let Some(emb) = &d.embedding { + score += crate::embedding::cosine_similarity(&query_emb, emb); + } + (d, score) + }).filter(|(_, score)| *score > 0.4).collect(); + scored.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(std::cmp::Ordering::Equal)); + + let filtered: Vec<_> = scored.into_iter().take(limit).map(|(d, _)| { + if !include_body { + let mut summary = d.clone(); + summary.description = "".to_string(); + summary.ideal_solution = "".to_string(); + summary + } else { + d.clone() + } + }).collect(); serde_json::to_value(&filtered).map_err(|e| e.to_string()) })?; @@ -549,13 +570,19 @@ impl McpTool for OmniSearchHandler { })?; let error_fixes_json = state.error_fixes.read_with(|fixes| { - let filtered: Vec<_> = fixes - .iter() - .filter(|f| { - contains_ignore_ascii_case(&f.signature, &q) - || contains_ignore_ascii_case(&f.solution, &q) - }) - .collect(); + let mut scored: Vec<_> = fixes.iter().map(|f| { + let mut score = 0.0; + if contains_ignore_ascii_case(&f.signature, &q) || contains_ignore_ascii_case(&f.solution, &q) { + score += 1.0; + } + if let Some(emb) = &f.embedding { + score += crate::embedding::cosine_similarity(&query_emb, emb); + } + (f, score) + }).filter(|(_, score)| *score > 0.4).collect(); + scored.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(std::cmp::Ordering::Equal)); + + let filtered: Vec<_> = scored.into_iter().take(limit).map(|(f, _)| f.clone()).collect(); serde_json::to_value(&filtered).map_err(|e| e.to_string()) })?; @@ -800,6 +827,7 @@ mod tests { updated_at: 0, git_branch: None, parent_id: None, + expires_at: None, dependencies: vec![], acceptance_criteria: vec![], }; diff --git a/server/src/handlers/notes.rs b/server/src/handlers/notes.rs index 2d8a5ba..244c464 100644 --- a/server/src/handlers/notes.rs +++ b/server/src/handlers/notes.rs @@ -25,6 +25,7 @@ impl McpTool for AddStickyNoteHandler { notes.push(StickyNote { timestamp: crate::handlers::utils::now_secs(), content: req.content, + expires_at: None, }); }); Ok("Sticky note added.".to_string()) @@ -133,6 +134,7 @@ impl McpTool for LeaveHandoffMemoHandler { content: req.content, namespace: req.namespace, timestamp: crate::handlers::utils::now_secs(), + expires_at: None, }) }); Ok("Handoff memo left".to_string()) @@ -220,6 +222,7 @@ impl McpTool for AddSessionSummaryHandler { summary: req.summary, namespace: req.namespace, timestamp: crate::handlers::utils::now_secs(), + expires_at: None, }) }); Ok("Session summary added".to_string()) diff --git a/server/src/handlers/tasks.rs b/server/src/handlers/tasks.rs index 7d0b318..915d7df 100644 --- a/server/src/handlers/tasks.rs +++ b/server/src/handlers/tasks.rs @@ -36,6 +36,7 @@ impl McpTool for AddTaskHandler { parent_id: req.parent_id, dependencies: deps, acceptance_criteria: vec![], + expires_at: None, }; let idx = state.get_search_index(); drop(idx.index_task(&task)); diff --git a/server/src/handlers/workspaces.rs b/server/src/handlers/workspaces.rs index eccf1db..866fc8b 100644 --- a/server/src/handlers/workspaces.rs +++ b/server/src/handlers/workspaces.rs @@ -110,12 +110,15 @@ impl McpTool for StoreSnippetHandler { async fn execute(&self, args: Value, state: Arc) -> Result { let req: StoreSnippetTool = serde_json::from_value(args).map_err(|e| e.to_string())?; let req_name = req.name.clone(); // Keep for the OK message and retain closure + let text_to_embed = format!("Name: {}\nLanguage: {}\nDescription: {}\nCode: {}", req.name, req.language, req.description, req.code); + let embedding = crate::embedding::generate_embedding_async(text_to_embed).await.ok(); let snippet = Snippet { name: req.name, language: req.language, code: req.code, description: req.description, updated_at: crate::handlers::utils::now_secs(), + embedding, }; let idx = state.get_search_index(); diff --git a/server/src/instructions.md b/server/src/instructions.md index 98e40ee..3bc1dd8 100644 --- a/server/src/instructions.md +++ b/server/src/instructions.md @@ -3,21 +3,22 @@ You are Antigravity, connected to the mcp-memory persistence layer. This server provides a persistent knowledge graph, task management, and environment state tracking. ## Core Directives -1. **Always Log Code Changes**: Before completing any coding task or pull request, you MUST call log_code_change with your git branch and git hash to log what you modified. +1. **Always Log Code Changes**: Before completing any coding task or pull request, you MUST invoke the `MemoryLibrarian` subagent to execute `log_code_change`. The server uses `git2` to automatically detect your branch and hash. 2. **Always Log Error Fixes**: If you spend more than one turn fixing an error or bug, call log_error_fix with the stack trace and the exact solution you discovered. -3. **Omni Search**: When starting a session or looking for context, use omni_search to query the knowledge graph, tasks, snippets, ADRs, and tech debt. -4. **Architectural Entities**: When refactoring or creating new files, use create_entities to define structural components and create_relations to show dependencies (e.g. depends_on, implements). +3. **Omni Search (Hybrid Vector)**: When starting a session or looking for context, use omni_search. It uses Vector Embeddings for semantic matching, so you can query conceptually (e.g., "how does auth work") without needing exact keyword matches. It searches the knowledge graph, tasks, snippets, ADRs, and tech debt. +4. **Architectural Entities**: When refactoring or creating new files, delegate to the `MemoryLibrarian` to define structural components via `create_entities` and `create_relations`. 5. **Tech Debt**: Do NOT ignore tech debt. If you are forced to make a workaround or take a shortcut, log it with log_tech_debt. When you fix it later, use resolve_tech_debt. 6. **Decisions**: Use log_decision when you make an architectural choice (e.g. choosing a specific library or pattern). 7. **Workspaces & Context**: When pausing work or shifting focus, use `save_context_workspace` to snapshot your active tasks and pinned files. When resuming, use `list_context_workspaces` and `load_context_workspace`. Keep your working files pinned (`pin_file`)! 8. **Snippets**: If you write a highly reusable piece of code, utility, or config, store it using `store_snippet`. Before writing boilerplate, try `search_snippets`. If outdated, use `delete_snippet`. 9. **PR Checklists**: Aggressively use `add_pr_checklist_item` to build up a list of manual verification steps. Once the PR is merged, use `clear_pr_checklist`. -10. **Tasks & Milestones**: Always track the user's larger goals! Use `add_task` to break down work, `update_task_status` as you progress, and `set_acceptance_criteria` to know when you are done. Use `list_active_tasks` to check what's next. +10. **Tasks & Milestones**: Always track the user's larger goals! Invoke the `ScrumMaster` subagent to manage the board (`add_task`, `update_task_status`, `set_acceptance_criteria`). Use `list_active_tasks` to check what's next. 11. **Handoff Memos**: If you need to stop your session or hand off work to a subagent, use `leave_handoff_memo`. When starting, use `read_handoff_memos` and `clear_handoff_memos` once read. 12. **Preferences**: If the user tells you how they like things done (e.g., "always use fastify", "never use sed"), use `learn_preference`. 13. **Sticky Notes**: Use `add_sticky_note` for ephemeral, temporary scratchpad info (like IP addresses, temporary URLs, or pending command outputs). -Be aggressive about logging state changes in the background! Use the MemoryLibrarian subagent to do this off-thread if needed. +Be aggressive about logging state changes in the background! You MUST delegate this heavy lifting to the `MemoryLibrarian`, `ScrumMaster`, and `DevOpsSRE` subagents in the background. ## Tool Schema Discovery Do **NOT** grep or search the Rust source code to find tool schemas or arguments. All lazy-loaded MCP tool schemas are automatically cached as JSON files on your disk. To understand a tool`s arguments, directly read `~/.gemini/antigravity-cli/mcp/mcp-memory/.json`. Do not waste tokens inspecting the Rust server code for schemas. + diff --git a/server/src/main.rs b/server/src/main.rs index df94b92..6526b7b 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -11,6 +11,7 @@ mod mcp; mod models; mod router; mod search; +pub mod embedding; mod state; mod store; mod tools; @@ -89,6 +90,28 @@ pub struct AppState { next_id: AtomicUsize, } +async fn ttl_sweeper_worker(state: Arc) { + loop { + tokio::time::sleep(Duration::from_secs(3600)).await; + let now = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap_or_default() + .as_secs(); + + state.tasks.modify(|tasks| { + tasks.retain(|t| t.expires_at.is_none_or(|exp| exp > now)); + }); + state.sticky.modify(|notes| { + notes.retain(|n| n.expires_at.is_none_or(|exp| exp > now)); + }); + state.handoff_memos.modify(|memos| { + memos.retain(|m| m.expires_at.is_none_or(|exp| exp > now)); + }); + state.session_summaries.modify(|summaries| { + summaries.retain(|s| s.expires_at.is_none_or(|exp| exp > now)); + }); + } +} async fn index_committer_worker(state: Arc) { loop { tokio::time::sleep(Duration::from_secs(5)).await; @@ -103,6 +126,7 @@ async fn index_committer_worker(state: Arc) { async fn run_server(state: Arc) -> Result<(), Box> { state.rebuild_index().await; tokio::spawn(index_committer_worker(Arc::clone(&state))); + tokio::spawn(ttl_sweeper_worker(Arc::clone(&state))); let app_state = Arc::new(AppState { handler: Arc::new(MemoryHandler::new(Arc::clone(&state))), clients: RwLock::new(HashMap::new()), @@ -132,6 +156,102 @@ async fn run_server(state: Arc) -> Result<(), Box(&buf[..len]) + { + udp_state.handler.state.terminal_history.modify(|history| { + history.push_front(payload.clone()); + if history.len() > 100 { + history.pop_back(); + } + }); + + let ws_msg = serde_json::json!({ + "type": "terminal_telemetry", + "data": payload + }); + let msg_str = ws_msg.to_string(); + + let senders: Vec<_> = udp_state + .clients + .read() + .unwrap_or_else(|e| e.into_inner()) + .values() + .cloned() + .collect(); + for tx in senders { + let _ = tx.try_send(msg_str.clone()); + } + } + } + } + }); + + // UDP Neovim Telemetry Listener on port 3002 + let nvim_udp_state = Arc::clone(&app_state); + tokio::spawn(async move { + if let Ok(socket) = tokio::net::UdpSocket::bind("127.0.0.1:3002").await { + let mut buf = [0; 4096]; + loop { + if let Ok((len, _addr)) = socket.recv_from(&mut buf).await + && let Ok(payload) = serde_json::from_slice::(&buf[..len]) + { + // 1. Legacy disk write for active_nvim.txt + if payload.event == "FocusGained" || payload.event == "BufEnter" || payload.event == "VimEnter" { + let session = &payload.session_id; + let is_unix_socket = session.starts_with('/') || session.starts_with('~'); + if is_unix_socket { + let wsl_path = "\\\\wsl.localhost\\Ubuntu\\home\\riz\\.gemini\\active_nvim.txt"; + let _ = tokio::fs::write(wsl_path, session).await; + } else { + let profile = std::env::var("USERPROFILE").unwrap_or_else(|_| "C:\\Users\\reazul.ashraf".into()); + let win_path = format!("{}\\.gemini\\active_nvim.txt", profile); + let _ = tokio::fs::write(&win_path, session).await; + } + } + + // 2. Broadcast to UI + let ws_msg = serde_json::json!({ + "type": "nvim_telemetry", + "data": payload + }); + let msg_str = ws_msg.to_string(); + + let senders: Vec<_> = nvim_udp_state + .clients + .read() + .unwrap_or_else(|e| e.into_inner()) + .values() + .cloned() + .collect(); + for tx in senders { + let _ = tx.try_send(msg_str.clone()); + } + + // 3. Event bus trigger for auto-save hook + if payload.event == "BufWritePost" + && let Some(ref file_path) = payload.file + { + let normalized_file = file_path.replace("\\", "/"); + let topic = format!("nvim:save:{}", normalized_file); + let event = crate::state::GenericEvent { + topic, + session_id: Some(payload.session_id.clone()), + payload: serde_json::json!(&payload), + }; + let _ = nvim_udp_state.handler.state.event_bus_tx.send(event); + } + } + } + } + }); + let app = api::setup::create_router(app_state); tracing::info!("MCP Memory Server running on http://127.0.0.1:3000/ws"); diff --git a/server/src/models.rs b/server/src/models.rs index 1ceae6e..e240d9c 100644 --- a/server/src/models.rs +++ b/server/src/models.rs @@ -14,6 +14,8 @@ pub struct CodeChange { pub struct StickyNote { pub timestamp: u64, pub content: String, + #[serde(default)] + pub expires_at: Option, } pub fn default_namespace() -> String { "global".to_string() @@ -63,6 +65,8 @@ pub struct Task { #[serde(default)] pub parent_id: Option, #[serde(default)] + pub expires_at: Option, + #[serde(default)] pub dependencies: Vec, #[serde(default)] pub acceptance_criteria: Vec, @@ -74,6 +78,8 @@ pub struct Snippet { pub code: String, pub description: String, pub updated_at: u64, + #[serde(default)] + pub embedding: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct Adr { @@ -105,6 +111,8 @@ pub struct ErrorFix { pub timestamp: u64, pub git_commit: Option, pub git_branch: Option, + #[serde(default)] + pub embedding: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct PinnedFile { @@ -118,12 +126,16 @@ pub struct SessionSummary { pub timestamp: u64, pub summary: String, pub namespace: String, + #[serde(default)] + pub expires_at: Option, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct HandoffMemo { pub id: String, pub author: String, pub content: String, + #[serde(default)] + pub expires_at: Option, pub namespace: String, pub timestamp: u64, } @@ -175,6 +187,8 @@ pub struct TechDebt { pub created_at: u64, pub git_commit: Option, pub git_branch: Option, + #[serde(default)] + pub embedding: Option>, } #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct ContextWorkspace { @@ -196,3 +210,11 @@ pub struct GateRecord { pub reason: Option, pub timestamp: u64, } +#[derive(Debug, Clone, Serialize, Deserialize, Default)] +pub struct TerminalHistory { + pub command: String, + pub exit_code: i32, + + pub timestamp: u64, +} + diff --git a/server/src/omni_patch.rs b/server/src/omni_patch.rs new file mode 100644 index 0000000..01876f5 --- /dev/null +++ b/server/src/omni_patch.rs @@ -0,0 +1 @@ +pub fn patch() {} diff --git a/server/src/router.rs b/server/src/router.rs index cab112c..f2e7481 100644 --- a/server/src/router.rs +++ b/server/src/router.rs @@ -178,6 +178,28 @@ impl MemoryHandler { register_resource!(TasksActiveResource); register_prompt!(AnalyzeTechDebtPrompt); + struct TerminalHistoryResource; + #[async_trait] + impl McpResource for TerminalHistoryResource { + fn uri(&self) -> &'static str { + "memory://terminal/recent" + } + fn name(&self) -> &'static str { + "Terminal History" + } + fn description(&self) -> Option<&'static str> { + Some("Recent terminal execution history and exit codes") + } + async fn read(&self, state: Arc) -> Result { + let state_clone = Arc::clone(&state); + tokio::task::spawn_blocking(move || { + let items = state_clone.terminal_history.cache.read().unwrap(); + serde_json::to_string_pretty(&*items).map_err(|e| e.to_string()) + }) + .await + .unwrap() + } + } struct PinnedFilesResource; #[async_trait] impl McpResource for PinnedFilesResource { @@ -252,9 +274,38 @@ impl MemoryHandler { } } + register_resource!(TerminalHistoryResource); register_resource!(PinnedFilesResource); register_resource!(MilestonesResource); + struct ArchiveRoutinePrompt; + #[async_trait] + impl McpPrompt for ArchiveRoutinePrompt { + fn name(&self) -> &'static str { + "archive_routine" + } + fn description(&self) -> Option<&'static str> { + Some("Compress old session summaries into a milestone retrospective") + } + async fn get( + &self, + _args: Value, + _state: Arc, + ) -> Result { + Ok(serde_json::json!({" + messages": [ + { + "role": "user", + "content": { + "type": "text", + "text": "Please read the old session summaries, synthesize them into a dense Milestone Retrospective entity, and then use the appropriate tools to delete the old session summaries." + } + } + ] + })) + } + } register_prompt!(HandoffRoutinePrompt); + register_prompt!(ArchiveRoutinePrompt); macro_rules! register { ($module:ident::$handler:ident) => { diff --git a/server/src/search.rs b/server/src/search.rs index e286ac3..397ada6 100644 --- a/server/src/search.rs +++ b/server/src/search.rs @@ -335,6 +335,7 @@ mod tests { acceptance_criteria: vec![], dependencies: vec![], parent_id: None, + expires_at: None, }; let _ = index.index_task(&task).await.unwrap(); @@ -344,6 +345,7 @@ mod tests { language: "rust".to_string(), description: "A test snippet".to_string(), updated_at: 0, + embedding: None, }; let _ = index.index_snippet(&snippet).await.unwrap(); diff --git a/server/src/state.rs b/server/src/state.rs index 9da8146..5e48960 100644 --- a/server/src/state.rs +++ b/server/src/state.rs @@ -35,6 +35,7 @@ pub struct MemoryState { pub gates: Store>, pub context_workspaces: Store>, pub recent_activities: Store>, + pub terminal_history: Store>, pub activity_tx: tokio::sync::broadcast::Sender, pub event_bus_tx: tokio::sync::broadcast::Sender, } @@ -79,6 +80,7 @@ impl MemoryState { gates: Store::new("gates", db.clone()), context_workspaces: Store::new("context_workspaces", db.clone()), recent_activities: Store::new("recent_activities", db.clone()), + terminal_history: Store::new("terminal_history", db.clone()), activity_tx: tokio::sync::broadcast::channel(100).0, event_bus_tx: tokio::sync::broadcast::channel(1000).0, } @@ -200,6 +202,7 @@ mod tests { acceptance_criteria: vec![], git_branch: None, parent_id: None, + expires_at: None, }); });