From 834247fa531461a24f411b223b6286bfa95a08b8 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 1 Apr 2026 15:12:14 -0400 Subject: [PATCH] Split journal tools from default definitions, expose to all for now journal_definitions() separated from definitions() in memory.rs. All agents get memory + journal tools via memory_and_journal_definitions(). TODO: implement per-agent tool whitelist from header to properly restrict journal tools to journal agent only. Co-Authored-By: Proof of Concept --- src/subconscious/api.rs | 4 +++- src/thought/memory.rs | 6 ++++++ src/thought/mod.rs | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) 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 +}