tools: unify channel and memory tools, clean up mcp-server

Move all tool definitions and dispatch out of mcp-server.rs:
- Channel tools: new tools/channels.rs with definitions, async
  dispatch, blocking dispatch, and capnp RPC helpers
- Memory tools: make tools/memory.rs pub so mcp-server can use it

mcp-server.rs is now pure JSON-RPC protocol plumbing (482 → 169 lines).
No tool-specific code remains in that file.

Also removes duplicated channel RPC helpers and fetch_all_channels
that were in both mcp-server.rs and thalamus/channels.rs.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-04 14:45:22 -04:00 committed by Kent Overstreet
parent 1ef137fb3a
commit 943f42d876
4 changed files with 392 additions and 352 deletions

19
Cargo.lock generated
View file

@ -623,6 +623,25 @@ dependencies = [
"tracing-subscriber",
]
[[package]]
name = "consciousness-channel-tmux"
version = "0.4.0"
dependencies = [
"capnp",
"capnp-rpc",
"dirs",
"futures",
"json5",
"libc",
"poc-memory",
"scopeguard",
"serde",
"tokio",
"tokio-util",
"tracing",
"tracing-subscriber",
]
[[package]]
name = "console-api"
version = "0.8.1"