memory.rs: clean up store access and tool dispatch

- Single access() function returns StoreAccess enum (Daemon/Client/None)
- OnceLock for daemon store, thread-local RefCell for client socket
- Remove dispatch() - Tool handlers call jsonargs_* directly
- get_provenance() takes agent ref, no JSON round-trip
- Expose missing graph tools (communities, normalize, link_impact, trace)
- Local tool! macro for cleaner Tool definitions

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-13 14:27:38 -04:00
parent fb46ab095d
commit 9bb07bc26a
2 changed files with 264 additions and 259 deletions

View file

@ -13,9 +13,7 @@ use tokio::io::{AsyncBufReadExt, AsyncWriteExt, BufReader, BufWriter};
use tokio::net::{UnixListener, UnixStream};
use crate::agent::tools::Tool;
// Re-export for backwards compatibility
pub use crate::agent::tools::memory::{socket_path, memory_rpc};
use crate::agent::tools::memory::socket_path;
#[derive(Debug, Deserialize)]
#[allow(dead_code)]