move render_node() to memory.rs

This commit is contained in:
Kent Overstreet 2026-04-12 22:20:22 -04:00
parent 4b4271f618
commit 3e0c6b039f
2 changed files with 7 additions and 8 deletions

View file

@ -89,13 +89,6 @@ pub fn cmd_node_rename(old_key: &str, new_key: &str) -> Result<(), String> {
Ok(())
}
/// Render a node to a string: content + deduped footer links.
/// Used by both the CLI command and agent placeholders.
pub fn render_node(store: &store::Store, key: &str) -> Option<String> {
crate::hippocampus::memory::MemoryNode::from_store(store, key)
.map(|node| node.render())
}
pub fn cmd_render(key: &[String]) -> Result<(), String> {
if key.is_empty() {
return Err("render requires a key".into());
@ -300,4 +293,3 @@ pub fn cmd_lookups(date: Option<&str>) -> Result<(), String> {
resolved.iter().map(|(_, c)| *c as u64).sum::<u64>());
Ok(())
}

View file

@ -91,3 +91,10 @@ impl MemoryNode {
out
}
}
/// Render a node to a string: content + deduped footer links.
/// Used by both the CLI command and agent placeholders.
pub fn render_node(store: &Store, key: &str) -> Option<String> {
crate::hippocampus::memory::MemoryNode::from_store(store, key)
.map(|node| node.render())
}