diff --git a/crates/zclaw-growth/src/storage/sqlite.rs b/crates/zclaw-growth/src/storage/sqlite.rs index 3c2b723..15db689 100644 --- a/crates/zclaw-growth/src/storage/sqlite.rs +++ b/crates/zclaw-growth/src/storage/sqlite.rs @@ -41,6 +41,11 @@ pub(crate) struct MemoryRow { } impl SqliteStorage { + /// Get a reference to the underlying connection pool + pub fn pool(&self) -> &SqlitePool { + &self.pool + } + /// Create a new SQLite storage at the given path pub async fn new(path: impl Into) -> Result { let path = path.into(); diff --git a/crates/zclaw-kernel/src/registry.rs b/crates/zclaw-kernel/src/registry.rs index f696a39..69fc9fd 100644 --- a/crates/zclaw-kernel/src/registry.rs +++ b/crates/zclaw-kernel/src/registry.rs @@ -85,6 +85,7 @@ impl AgentRegistry { system_prompt: config.system_prompt.clone(), temperature: config.temperature, max_tokens: config.max_tokens, + user_profile: None, }) } diff --git a/crates/zclaw-types/src/agent.rs b/crates/zclaw-types/src/agent.rs index ed84fc8..5763a78 100644 --- a/crates/zclaw-types/src/agent.rs +++ b/crates/zclaw-types/src/agent.rs @@ -171,6 +171,9 @@ pub struct AgentInfo { pub system_prompt: Option, pub temperature: Option, pub max_tokens: Option, + /// UserProfile from zclaw-memory UserProfileStore (populated on-demand by agent_get) + #[serde(default)] + pub user_profile: Option, } impl From for AgentInfo { @@ -189,6 +192,7 @@ impl From for AgentInfo { system_prompt: config.system_prompt, temperature: config.temperature, max_tokens: config.max_tokens, + user_profile: None, // Populated on-demand by agent_get command } } } diff --git a/desktop/src-tauri/src/kernel_commands/agent.rs b/desktop/src-tauri/src/kernel_commands/agent.rs index abe3675..7cdc8a2 100644 --- a/desktop/src-tauri/src/kernel_commands/agent.rs +++ b/desktop/src-tauri/src/kernel_commands/agent.rs @@ -163,7 +163,7 @@ pub async fn agent_list( Ok(kernel.list_agents()) } -/// Get agent info +/// Get agent info (with optional UserProfile from memory store) // @connected #[tauri::command] pub async fn agent_get( @@ -180,7 +180,19 @@ pub async fn agent_get( let id: AgentId = agent_id.parse() .map_err(|_| "Invalid agent ID format".to_string())?; - Ok(kernel.get_agent(&id)) + let mut info = kernel.get_agent(&id); + + // Extend with UserProfile if available + if let Some(ref mut agent_info) = info { + if let Ok(storage) = crate::viking_commands::get_storage().await { + let profile_store = zclaw_memory::UserProfileStore::new(storage.pool().clone()); + if let Ok(Some(profile)) = profile_store.get(&agent_id).await { + agent_info.user_profile = Some(serde_json::to_value(profile).unwrap_or_default()); + } + } + } + + Ok(info) } /// Delete an agent diff --git a/desktop/src/lib/kernel-types.ts b/desktop/src/lib/kernel-types.ts index 58fef8b..a8998af 100644 --- a/desktop/src/lib/kernel-types.ts +++ b/desktop/src/lib/kernel-types.ts @@ -33,6 +33,7 @@ export interface AgentInfo { systemPrompt?: string; temperature?: number; maxTokens?: number; + userProfile?: Record; } export interface CreateAgentRequest {