feat(nvim-core): implement bidirectional event streaming and real-time shadow buffer

- Created global thread-safe NvimState to shadow Neovim context.
- Injected Lua autocmds (CursorMoved, TextChanged) on connection to stream events back to MCP.
- Upgraded msgpack RPC loop to intercept and parse 'mcp_event' notifications alongside standard responses.
- Optimized nvim_get_cursor to pull instantly from the local shadow buffer, bypassing RPC round-trips.
This commit is contained in:
Riz Ashraf committed 2026-09-22 22:32:37 +01:00
1 parent 61b03bc6e3
commit ea735003e2
2 files changed
+113 -12

No files matched your search

Generated
+22
View File
@@ -497,6 +497,20 @@ dependencies = [
"syn 3.0.6",
]
[[package]]
name = "dashmap"
version = "6.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6361d5c062261c78a176addb82d4c821ae42bed6089de0e12603cd25de2059c"
dependencies = [
"cfg-if",
"crossbeam-utils",
"hashbrown 0.14.5",
"lock_api",
"once_cell",
"parking_lot_core",
]
[[package]]
name = "data-encoding"
version = "2.11.1"
@@ -807,6 +821,12 @@ dependencies = [
"rand_core 0.10.1",
]
[[package]]
name = "hashbrown"
version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
[[package]]
name = "hashbrown"
version = "0.16.1"
@@ -1375,6 +1395,8 @@ dependencies = [
name = "nvim-core"
version = "0.1.0"
dependencies = [
"bytes",
"dashmap",
"dirs",
"mcp-stdio",
"rmcp",