forked from kent/consciousness
cli: convert simple commands to use memory_rpc
Commands now forward to daemon (or fallback to local store): - query → memory_query - journal tail → journal_tail - graph link-set → memory_link_set - graph link-add → memory_link_add - weight-set → memory_weight_set - node rename → memory_rename Removes ~50 lines of duplicated store access code. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
d2a82d4327
commit
11b58e6b0b
4 changed files with 34 additions and 87 deletions
|
|
@ -203,9 +203,12 @@ pub fn cmd_query(expr: &[String]) -> Result<(), String> {
|
|||
}
|
||||
|
||||
let query_str = expr.join(" ");
|
||||
let store = crate::store::Store::load()?;
|
||||
let graph = store.build_graph();
|
||||
crate::query_parser::run_query(&store, &graph, &query_str)
|
||||
let result = crate::mcp_server::memory_rpc(
|
||||
"memory_query",
|
||||
serde_json::json!({"query": query_str}),
|
||||
).map_err(|e| e.to_string())?;
|
||||
print!("{}", result);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_group_content(group: &crate::config::ContextGroup, store: &crate::store::Store, cfg: &crate::config::Config) -> Vec<(String, String)> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue