//! User config commands (synced key-value preferences) use crate::commands::error::ApiError; use crate::state::AppState; use std::sync::Arc; use tauri::State; use tracing::instrument; /// Get a user config value by key. #[tauri::command] #[instrument(skip_all)] pub async fn get_config( state: State<'_, Arc>, key: String, ) -> Result, ApiError> { let db = state.orchestrator.database(); let value = db.config().get(&key).await?; Ok(value) } /// Set a user config value (upserts on key). #[tauri::command] #[instrument(skip_all)] pub async fn set_config( state: State<'_, Arc>, key: String, value: String, ) -> Result<(), ApiError> { let db = state.orchestrator.database(); db.config().set(&key, &value).await?; Ok(()) }