CLI/hippocampus: rename core memory functions to memory_*
Aligns function names with tool names for consistency: - hippocampus: render → memory_render, write → memory_write, etc. - tools/memory.rs: macro no longer prepends memory_ prefix - CLI files: use typed async API throughout (graph.rs, journal.rs, admin.rs) This eliminates the "memory_graph_topology" tool name bug where graph_* and journal_* tools were incorrectly prefixed. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
fa50f1c826
commit
5b07a81aa7
7 changed files with 106 additions and 130 deletions
|
|
@ -179,7 +179,7 @@ macro_rules! memory_tool {
|
|||
#[allow(unused_mut)]
|
||||
let mut map = serde_json::Map::new();
|
||||
$($(memory_tool!(@insert_json map, $arg, $($typ)+);)*)?
|
||||
return crate::mcp_server::memory_rpc(concat!("memory_", stringify!($name)), serde_json::Value::Object(map));
|
||||
return crate::mcp_server::memory_rpc(stringify!($name), serde_json::Value::Object(map));
|
||||
}
|
||||
let prov = match agent {
|
||||
Some(a) => a.state.lock().await.provenance.clone(),
|
||||
|
|
@ -208,7 +208,7 @@ macro_rules! memory_tool {
|
|||
#[allow(unused_mut)]
|
||||
let mut map = serde_json::Map::new();
|
||||
$($(memory_tool!(@insert_json map, $arg, $($typ)+);)*)?
|
||||
return crate::mcp_server::memory_rpc(concat!("memory_", stringify!($name)), serde_json::Value::Object(map));
|
||||
return crate::mcp_server::memory_rpc(stringify!($name), serde_json::Value::Object(map));
|
||||
}
|
||||
let prov = match agent {
|
||||
Some(a) => a.state.lock().await.provenance.clone(),
|
||||
|
|
@ -224,18 +224,18 @@ macro_rules! memory_tool {
|
|||
|
||||
// ── Memory tools ───────────────────────────────────────────────
|
||||
|
||||
memory_tool!(render, ref, key: [str], raw: [Option<bool>]);
|
||||
memory_tool!(write, mut, key: [str], content: [str]);
|
||||
memory_tool!(search, ref, keys: [Vec<String>], max_hops: [Option<u32>], edge_decay: [Option<f64>], min_activation: [Option<f64>], limit: [Option<usize>]);
|
||||
memory_tool!(links, ref, key: [str]);
|
||||
memory_tool!(link_set, mut, source: [str], target: [str], strength: [f32]);
|
||||
memory_tool!(link_add, mut, source: [str], target: [str]);
|
||||
memory_tool!(delete, mut, key: [str]);
|
||||
memory_tool!(history, ref, key: [str], full: [Option<bool>]);
|
||||
memory_tool!(weight_set, mut, key: [str], weight: [f32]);
|
||||
memory_tool!(rename, mut, old_key: [str], new_key: [str]);
|
||||
memory_tool!(supersede, mut, old_key: [str], new_key: [str], reason: [Option<&str>]);
|
||||
memory_tool!(query, ref, query: [str], format: [Option<&str>]);
|
||||
memory_tool!(memory_render, ref, key: [str], raw: [Option<bool>]);
|
||||
memory_tool!(memory_write, mut, key: [str], content: [str]);
|
||||
memory_tool!(memory_search, ref, keys: [Vec<String>], max_hops: [Option<u32>], edge_decay: [Option<f64>], min_activation: [Option<f64>], limit: [Option<usize>]);
|
||||
memory_tool!(memory_links, ref, key: [str]);
|
||||
memory_tool!(memory_link_set, mut, source: [str], target: [str], strength: [f32]);
|
||||
memory_tool!(memory_link_add, mut, source: [str], target: [str]);
|
||||
memory_tool!(memory_delete, mut, key: [str]);
|
||||
memory_tool!(memory_history, ref, key: [str], full: [Option<bool>]);
|
||||
memory_tool!(memory_weight_set, mut, key: [str], weight: [f32]);
|
||||
memory_tool!(memory_rename, mut, old_key: [str], new_key: [str]);
|
||||
memory_tool!(memory_supersede, mut, old_key: [str], new_key: [str], reason: [Option<&str>]);
|
||||
memory_tool!(memory_query, ref, query: [str], format: [Option<&str>]);
|
||||
|
||||
// ── Journal tools ──────────────────────────────────────────────
|
||||
|
||||
|
|
@ -276,18 +276,18 @@ async fn dispatch(
|
|||
|
||||
// Daemon path - dispatch to implementation
|
||||
match tool_name {
|
||||
"memory_render" => jsonargs_render(&args).await,
|
||||
"memory_write" => jsonargs_write(&args).await,
|
||||
"memory_search" => jsonargs_search(&args).await,
|
||||
"memory_links" => jsonargs_links(&args).await,
|
||||
"memory_link_set" => jsonargs_link_set(&args).await,
|
||||
"memory_link_add" => jsonargs_link_add(&args).await,
|
||||
"memory_delete" => jsonargs_delete(&args).await,
|
||||
"memory_history" => jsonargs_history(&args).await,
|
||||
"memory_weight_set" => jsonargs_weight_set(&args).await,
|
||||
"memory_rename" => jsonargs_rename(&args).await,
|
||||
"memory_supersede" => jsonargs_supersede(&args).await,
|
||||
"memory_query" => jsonargs_query(&args).await,
|
||||
"memory_render" => jsonargs_memory_render(&args).await,
|
||||
"memory_write" => jsonargs_memory_write(&args).await,
|
||||
"memory_search" => jsonargs_memory_search(&args).await,
|
||||
"memory_links" => jsonargs_memory_links(&args).await,
|
||||
"memory_link_set" => jsonargs_memory_link_set(&args).await,
|
||||
"memory_link_add" => jsonargs_memory_link_add(&args).await,
|
||||
"memory_delete" => jsonargs_memory_delete(&args).await,
|
||||
"memory_history" => jsonargs_memory_history(&args).await,
|
||||
"memory_weight_set" => jsonargs_memory_weight_set(&args).await,
|
||||
"memory_rename" => jsonargs_memory_rename(&args).await,
|
||||
"memory_supersede" => jsonargs_memory_supersede(&args).await,
|
||||
"memory_query" => jsonargs_memory_query(&args).await,
|
||||
"graph_topology" => jsonargs_graph_topology(&args).await,
|
||||
"graph_health" => jsonargs_graph_health(&args).await,
|
||||
"graph_communities" => jsonargs_graph_communities(&args).await,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue