render: extract render_node() + add {{seed}} placeholder
Refactor cmd_render into render_node() that returns a String —
reusable by both the CLI and agent placeholders.
Add {{seed}} placeholder: renders each seed node using the same
output as poc-memory render (content + deduped footer links). Agents
see exactly what a human sees — no special formatting.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
5ce1d4ed24
commit
d6c26e27fe
2 changed files with 40 additions and 20 deletions
|
|
@ -164,6 +164,21 @@ fn resolve(
|
|||
})
|
||||
}
|
||||
|
||||
// seed — render output for each seed node (content + deduped links)
|
||||
"seed" => {
|
||||
let mut text = String::new();
|
||||
let mut result_keys = Vec::new();
|
||||
for key in keys {
|
||||
if let Some(rendered) = crate::cli::node::render_node(store, key) {
|
||||
if !text.is_empty() { text.push_str("\n\n---\n\n"); }
|
||||
text.push_str(&format!("## {}\n\n{}", key, rendered));
|
||||
result_keys.push(key.clone());
|
||||
}
|
||||
}
|
||||
if text.is_empty() { return None; }
|
||||
Some(Resolved { text, keys: result_keys })
|
||||
}
|
||||
|
||||
"organize" => {
|
||||
// Show seed nodes with their neighbors for exploratory organizing
|
||||
use crate::store::NodeType;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue