diff --git a/src/subconscious/api.rs b/src/subconscious/api.rs index aee6cc3..0761825 100644 --- a/src/subconscious/api.rs +++ b/src/subconscious/api.rs @@ -44,7 +44,9 @@ pub async fn call_api_with_tools( let (ui_tx, mut ui_rx) = crate::agent::ui_channel::channel(); // Subconscious agents only get memory tools — no filesystem access. - let tool_defs = thought::memory_definitions(); + // TODO: respect tools whitelist from agent header to filter which + // native tools each agent gets (e.g. journal agent only gets journal tools) + let tool_defs = thought::memory_and_journal_definitions(); let tracker = ProcessTracker::new(); // Provenance tracks which agent:phase is making writes. // Updated between steps by the bail function via set_provenance(). diff --git a/src/thought/memory.rs b/src/thought/memory.rs index 6b51727..2969dc9 100644 --- a/src/thought/memory.rs +++ b/src/thought/memory.rs @@ -57,6 +57,12 @@ pub fn definitions() -> Vec { "key":{"type":"string","description":"Output name (e.g. 'relevant_memories')"}, "value":{"type":"string","description":"Output value"} },"required":["key","value"]})), + ] +} + +/// Journal-only tools — only given to the journal agent +pub fn journal_definitions() -> Vec { + vec![ ToolDef::new("journal_tail", "Read the last N journal entries (default 1).", json!({"type":"object","properties":{ diff --git a/src/thought/mod.rs b/src/thought/mod.rs index c886d20..7c25db8 100644 --- a/src/thought/mod.rs +++ b/src/thought/mod.rs @@ -128,3 +128,11 @@ pub fn all_definitions() -> Vec { pub fn memory_definitions() -> Vec { memory::definitions() } + +/// Return memory + journal tool definitions. +/// Used by the journal agent only. +pub fn memory_and_journal_definitions() -> Vec { + let mut defs = memory::definitions(); + defs.extend(memory::journal_definitions()); + defs +}