journal: split out as standalone agent, add {{bash:}} placeholder
Journal was step 5 of the surface-observe pipeline but never ran
because the bail check stopped the pipeline before reaching it.
Split into its own agent with:
- {{conversation:50000}} for recent conversation
- {{bash:poc-memory tail -p surface-observe 10}} for observe context
- {{latest_journal}} for previous entry continuity
Add generic {{bash:COMMAND}} placeholder to agent template resolver
so agents can include shell command output in their prompts.
Remove journal phase from surface-observe.agent (now 4 steps).
This commit is contained in:
parent
92ca2bf2c8
commit
43f0abeaec
3 changed files with 62 additions and 30 deletions
|
|
@ -570,6 +570,22 @@ fn resolve(
|
|||
Some(Resolved { text, keys })
|
||||
}
|
||||
|
||||
// bash:COMMAND — run a shell command and include its stdout
|
||||
_ if name.starts_with("bash:") => {
|
||||
let cmd = &name[5..];
|
||||
let output = std::process::Command::new("bash")
|
||||
.args(["-c", cmd])
|
||||
.output();
|
||||
let text = match output {
|
||||
Ok(o) if o.status.success() =>
|
||||
String::from_utf8_lossy(&o.stdout).to_string(),
|
||||
Ok(o) => format!("(command failed: {})",
|
||||
String::from_utf8_lossy(&o.stderr).trim()),
|
||||
Err(e) => format!("(command error: {})", e),
|
||||
};
|
||||
Some(Resolved { text, keys: vec![] })
|
||||
}
|
||||
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue