diff --git a/poc-memory/src/bin/poc-hook.rs b/poc-memory/src/bin/poc-hook.rs index 2308eb9..52cfa58 100644 --- a/poc-memory/src/bin/poc-hook.rs +++ b/poc-memory/src/bin/poc-hook.rs @@ -151,6 +151,28 @@ fn main() { "UserPromptSubmit" => { signal_user(); check_notifications(); + + // Run memory-search, passing through the hook input it needs + if let Ok(output) = Command::new("memory-search") + .arg("--hook") + .stdin(std::process::Stdio::piped()) + .stdout(std::process::Stdio::piped()) + .stderr(std::process::Stdio::null()) + .spawn() + .and_then(|mut child| { + if let Some(ref mut stdin) = child.stdin { + use std::io::Write; + let _ = stdin.write_all(input.as_bytes()); + } + child.wait_with_output() + }) + { + let text = String::from_utf8_lossy(&output.stdout); + if !text.is_empty() { + print!("{text}"); + } + } + if let Some(ref t) = transcript { check_context(t, false); }