The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(config): split monolithic controller files into per-domain modules
Steven Enamakel55bb7bed6f74
diff --git a/crates/openhuman-core/src/agent/triage/evaluator.rs b/crates/openhuman-core/src/agent/triage/evaluator.rsindex 81f71d290c..4dc46194fe 100644--- a/crates/openhuman-core/src/agent/triage/evaluator.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator.rs@@ -28,7 +28,6 @@//! sending no tool schemas to the backend — the turn degrades to a plain//! chat completion.-mod arm;mod chain;mod outcome;@@ -38,16 +37,18 @@ pub use arm::TRIGGER_TRIAGE_AGENT_ID;pub use chain::{run_triage, run_triage_with_arms};pub use outcome::{TriageOutcome, TriageResolutionPath, TriageRun};+#[cfg(test)]+use super::envelope::TriggerEnvelope;+#[cfg(test)]+use super::routing::ResolvedProvider;+#[cfg(test)]+use crate::agent::harness::definition::{AgentDefinition, PromptSource};#[cfg(test)]pub(crate) use arm::{classify_error, ArmError};#[cfg(test)]pub(crate) use chain::run_triage_with_arms_for_test;#[cfg(test)]pub(crate) use prompt::{extract_inline_prompt, render_user_message, truncate_payload};-#[cfg(test)]-use super::envelope::TriggerEnvelope;-#[cfg(test)]-use super::routing::ResolvedProvider;#[cfg(test)]#[path = "evaluator_tests.rs"]diff --git a/crates/openhuman-core/src/agent/triage/evaluator/arm.rs b/crates/openhuman-core/src/agent/triage/evaluator/arm.rsindex 30e4e0f7e4..323652c3a2 100644--- a/crates/openhuman-core/src/agent/triage/evaluator/arm.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator/arm.rs@@ -121,8 +121,7 @@ pub(super) async fn try_arm(// which `prepare_messages_for_provider` short-circuits before// any disk read happens. The same constructor is used at the// main channel-dispatch site in `channels::runtime::dispatch`.- multimodal_files:- crate::config::MultimodalFileConfig::for_untrusted_channel_input(),+ multimodal_files: crate::config::MultimodalFileConfig::for_untrusted_channel_input(),max_tool_iterations: 1,on_delta: None,target_agent_id: Some("trigger_triage".to_string()),diff --git a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs b/crates/openhuman-core/src/agent/triage/evaluator/chain.rsindex aada173a4f..c41cac160f 100644--- a/crates/openhuman-core/src/agent/triage/evaluator/chain.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator/chain.rs@@ -285,7 +285,6 @@ where}}-fn now_ms() -> i64 {chrono::Utc::now().timestamp_millis()}diff --git a/crates/openhuman-core/src/agent/triage/evaluator/outcome.rs b/crates/openhuman-core/src/agent/triage/evaluator/outcome.rsindex be0ab41559..a305d9840a 100644--- a/crates/openhuman-core/src/agent/triage/evaluator/outcome.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator/outcome.rs@@ -61,4 +61,3 @@ impl TriageOutcome {}}}-diff --git a/crates/openhuman-core/src/agent/triage/evaluator_tests.rs b/crates/openhuman-core/src/agent/triage/evaluator_tests.rsindex 7aca5b1878..efa7850f11 100644--- a/crates/openhuman-core/src/agent/triage/evaluator_tests.rs+++ b/crates/openhuman-core/src/agent/triage/evaluator_tests.rs@@ -60,7 +60,7 @@ fn envelope() -> TriggerEnvelope {const VALID_JSON_REPLY: &str = "{\"action\":\"acknowledge\",\"reason\":\"all good\"}";-#[path = "evaluator_fallback_chain_tests.rs"]-mod fallback_chain_tests;#[path = "evaluator_deferral_tests.rs"]mod deferral_tests;+#[path = "evaluator_fallback_chain_tests.rs"]+mod fallback_chain_tests;diff --git a/crates/openhuman-core/src/config/schemas/controllers.rs b/crates/openhuman-core/src/config/schemas/controllers.rsindex 37ede7583b..d96a7d7336 100644--- a/crates/openhuman-core/src/config/schemas/controllers.rs+++ b/crates/openhuman-core/src/config/schemas/controllers.rs@@ -1,5 +1,22 @@+//! `config` namespace controllers, grouped by the settings area they serve.+#[cfg(test)]#[path = "controllers_tests.rs"]mod tests;-include!("controllers_part_01.rs");-include!("controllers_part_02.rs");++mod agent;+mod inference;+mod integrations;+mod registry;+mod voice;+mod workspace;++pub use registry::{all_controller_schemas, all_registered_controllers};++#[cfg(test)]+pub(super) use agent::{handle_get_autonomy_settings, handle_update_autonomy_settings};+#[cfg(test)]+pub(super) use workspace::{handle_get_agent_paths, handle_get_data_paths};++#[cfg(test)]+use serde_json::{Map, Value};diff --git a/crates/openhuman-core/src/config/schemas/controllers/agent.rs b/crates/openhuman-core/src/config/schemas/controllers/agent.rsindex 422f78d61f..2981321b91 100644--- a/crates/openhuman-core/src/config/schemas/controllers/agent.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/agent.rs@@ -5,7 +5,11 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use super::super::helpers::{deserialize_params, to_json, ActivityLevelSettingsUpdate, AgentSettingsUpdate, AutonomySettingsUpdate, BrowserSettingsUpdate, MemorySyncSettingsUpdate, PrivacyModeUpdate, SandboxSettingsUpdate, SetBrowserAllowAllParams};+use super::super::helpers::{+ deserialize_params, to_json, ActivityLevelSettingsUpdate, AgentSettingsUpdate,+ AutonomySettingsUpdate, BrowserSettingsUpdate, MemorySyncSettingsUpdate, PrivacyModeUpdate,+ SandboxSettingsUpdate, SetBrowserAllowAllParams,+};pub(super) fn handle_get_autonomy_settings(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async move { to_json(config_rpc::get_autonomy_settings().await?) })@@ -108,7 +112,9 @@ pub(super) fn handle_get_activity_level_settings(_params: Map<String, Value>) ->Box::pin(async move { to_json(config_rpc::get_activity_level_settings().await?) })}-pub(super) fn handle_update_activity_level_settings(params: Map<String, Value>) -> ControllerFuture {+pub(super) fn handle_update_activity_level_settings(+ params: Map<String, Value>,+) -> ControllerFuture {Box::pin(async move {let update = deserialize_params::<ActivityLevelSettingsUpdate>(params)?;let patch = config_rpc::ActivityLevelSettingsPatch {diff --git a/crates/openhuman-core/src/config/schemas/controllers/inference.rs b/crates/openhuman-core/src/config/schemas/controllers/inference.rsindex 11a4eae6b9..c79426d696 100644--- a/crates/openhuman-core/src/config/schemas/controllers/inference.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/inference.rs@@ -5,7 +5,10 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use super::super::helpers::{deserialize_params, to_json, LocalAiSettingsUpdate, MemorySettingsUpdate, ModelSettingsUpdate, RuntimeSettingsUpdate};+use super::super::helpers::{+ deserialize_params, to_json, LocalAiSettingsUpdate, MemorySettingsUpdate, ModelSettingsUpdate,+ RuntimeSettingsUpdate,+};pub(super) fn handle_get_config(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async { to_json(config_rpc::load_and_get_config_snapshot().await?) })diff --git a/crates/openhuman-core/src/config/schemas/controllers/integrations.rs b/crates/openhuman-core/src/config/schemas/controllers/integrations.rsindex 638a50db14..70a1380503 100644--- a/crates/openhuman-core/src/config/schemas/controllers/integrations.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/integrations.rs@@ -5,7 +5,9 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use super::super::helpers::{deserialize_params, to_json, ComposioTriggerSettingsUpdate, SearchSettingsUpdate};+use super::super::helpers::{+ deserialize_params, to_json, ComposioTriggerSettingsUpdate, SearchSettingsUpdate,+};pub(super) fn handle_update_search_settings(params: Map<String, Value>) -> ControllerFuture {Box::pin(async move {@@ -58,7 +60,9 @@ pub(super) fn handle_get_search_settings(_params: Map<String, Value>) -> Control})}-pub(super) fn handle_update_composio_trigger_settings(params: Map<String, Value>) -> ControllerFuture {+pub(super) fn handle_update_composio_trigger_settings(+ params: Map<String, Value>,+) -> ControllerFuture {Box::pin(async move {log::debug!("[config][rpc] update_composio_trigger_settings enter");let update = match deserialize_params::<ComposioTriggerSettingsUpdate>(params) {@@ -85,7 +89,9 @@ pub(super) fn handle_update_composio_trigger_settings(params: Map<String, Value>})}-pub(super) fn handle_get_composio_trigger_settings(_params: Map<String, Value>) -> ControllerFuture {+pub(super) fn handle_get_composio_trigger_settings(+ _params: Map<String, Value>,+) -> ControllerFuture {Box::pin(async {log::debug!("[config][rpc] get_composio_trigger_settings enter");match config_rpc::get_composio_trigger_settings().await {diff --git a/crates/openhuman-core/src/config/schemas/controllers/registry.rs b/crates/openhuman-core/src/config/schemas/controllers/registry.rsindex af935e786f..10c4d74226 100644--- a/crates/openhuman-core/src/config/schemas/controllers/registry.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/registry.rs@@ -4,11 +4,33 @@ use crate::core::all::RegisteredController;use crate::core::ControllerSchema;use super::super::schema_defs::schemas;-use super::inference::{handle_get_config, handle_get_client_config, handle_update_model_settings, handle_update_memory_settings, handle_update_runtime_settings, handle_update_local_ai_settings, handle_resolve_api_url, handle_get_runtime_flags};-use super::agent::{handle_get_autonomy_settings, handle_update_autonomy_settings, handle_get_privacy_mode, handle_set_privacy_mode, handle_get_agent_settings, handle_update_agent_settings, handle_update_browser_settings, handle_set_browser_allow_all, handle_get_activity_level_settings, handle_update_activity_level_settings, handle_get_memory_sync_settings, handle_update_memory_sync_settings, handle_get_sandbox_settings, handle_update_sandbox_settings};-use super::workspace::{handle_workspace_onboarding_flag_exists, handle_workspace_onboarding_flag_set, handle_update_analytics_settings, handle_get_analytics_settings, handle_get_dashboard_settings, handle_agent_server_status, handle_reset_local_data, handle_get_data_paths, handle_get_agent_paths, handle_update_agent_paths, handle_get_onboarding_completed, handle_set_onboarding_completed};-use super::voice::{handle_get_dictation_settings, handle_update_dictation_settings, handle_get_voice_server_settings, handle_update_voice_server_settings};-use super::integrations::{handle_update_search_settings, handle_get_search_settings, handle_update_composio_trigger_settings, handle_get_composio_trigger_settings};+use super::agent::{+ handle_get_activity_level_settings, handle_get_agent_settings, handle_get_autonomy_settings,+ handle_get_memory_sync_settings, handle_get_privacy_mode, handle_get_sandbox_settings,+ handle_set_browser_allow_all, handle_set_privacy_mode, handle_update_activity_level_settings,+ handle_update_agent_settings, handle_update_autonomy_settings, handle_update_browser_settings,+ handle_update_memory_sync_settings, handle_update_sandbox_settings,+};+use super::inference::{+ handle_get_client_config, handle_get_config, handle_get_runtime_flags, handle_resolve_api_url,+ handle_update_local_ai_settings, handle_update_memory_settings, handle_update_model_settings,+ handle_update_runtime_settings,+};+use super::integrations::{+ handle_get_composio_trigger_settings, handle_get_search_settings,+ handle_update_composio_trigger_settings, handle_update_search_settings,+};+use super::voice::{+ handle_get_dictation_settings, handle_get_voice_server_settings,+ handle_update_dictation_settings, handle_update_voice_server_settings,+};+use super::workspace::{+ handle_agent_server_status, handle_get_agent_paths, handle_get_analytics_settings,+ handle_get_dashboard_settings, handle_get_data_paths, handle_get_onboarding_completed,+ handle_reset_local_data, handle_set_onboarding_completed, handle_update_agent_paths,+ handle_update_analytics_settings, handle_workspace_onboarding_flag_exists,+ handle_workspace_onboarding_flag_set,+};pub fn all_controller_schemas() -> Vec<ControllerSchema> {vec![diff --git a/crates/openhuman-core/src/config/schemas/controllers/voice.rs b/crates/openhuman-core/src/config/schemas/controllers/voice.rsindex 28f2696f45..fa6f423d97 100644--- a/crates/openhuman-core/src/config/schemas/controllers/voice.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/voice.rs@@ -5,7 +5,9 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use super::super::helpers::{deserialize_params, to_json, DictationSettingsUpdate, VoiceServerSettingsUpdate};+use super::super::helpers::{+ deserialize_params, to_json, DictationSettingsUpdate, VoiceServerSettingsUpdate,+};pub(super) fn handle_get_dictation_settings(_params: Map<String, Value>) -> ControllerFuture {Box::pin(async { to_json(config_rpc::get_dictation_settings().await?) })diff --git a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs b/crates/openhuman-core/src/config/schemas/controllers/workspace.rsindex bc0cfd1c8d..0f4db8734a 100644--- a/crates/openhuman-core/src/config/schemas/controllers/workspace.rs+++ b/crates/openhuman-core/src/config/schemas/controllers/workspace.rs@@ -5,9 +5,15 @@ use serde_json::{Map, Value};use crate::config::rpc as config_rpc;use crate::core::all::ControllerFuture;-use super::super::helpers::{deserialize_params, to_json, AgentPathsUpdate, AnalyticsSettingsUpdate, OnboardingCompletedSetParams, WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams, DEFAULT_ONBOARDING_FLAG_NAME};+use super::super::helpers::{+ deserialize_params, to_json, AgentPathsUpdate, AnalyticsSettingsUpdate,+ OnboardingCompletedSetParams, WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams,+ DEFAULT_ONBOARDING_FLAG_NAME,+};-pub(super) fn handle_workspace_onboarding_flag_exists(params: Map<String, Value>) -> ControllerFuture {+pub(super) fn handle_workspace_onboarding_flag_exists(+ params: Map<String, Value>,+) -> ControllerFuture {Box::pin(async move {let payload = deserialize_params::<WorkspaceOnboardingFlagParams>(params)?;to_json(diff --git a/crates/openhuman-core/src/config/schemas/controllers_part_01.rs b/crates/openhuman-core/src/config/schemas/controllers_part_01.rsdeleted file mode 100644index daf6598b22..0000000000--- a/crates/openhuman-core/src/config/schemas/controllers_part_01.rs+++ /dev/null@@ -1,678 +0,0 @@-use serde_json::{Map, Value};--use crate::core::all::{ControllerFuture, RegisteredController};-use crate::core::ControllerSchema;-use crate::config::rpc as config_rpc;--use super::helpers::{- deserialize_params, to_json, ActivityLevelSettingsUpdate, AgentPathsUpdate,- AgentSettingsUpdate, AnalyticsSettingsUpdate, AutonomySettingsUpdate, BrowserSettingsUpdate,- ComposioTriggerSettingsUpdate, DictationSettingsUpdate, LocalAiSettingsUpdate,- MemorySettingsUpdate, MemorySyncSettingsUpdate, ModelSettingsUpdate,- OnboardingCompletedSetParams, PrivacyModeUpdate, RuntimeSettingsUpdate, SandboxSettingsUpdate,- SearchSettingsUpdate, SetBrowserAllowAllParams, VoiceServerSettingsUpdate,- WorkspaceOnboardingFlagParams, WorkspaceOnboardingFlagSetParams, DEFAULT_ONBOARDING_FLAG_NAME,-};-use super::schema_defs::schemas;--pub fn all_controller_schemas() -> Vec<ControllerSchema> {- vec![- schemas("get_config"),- schemas("get_client_config"),- schemas("update_model_settings"),- schemas("update_memory_settings"),- schemas("update_runtime_settings"),- schemas("update_browser_settings"),- schemas("update_local_ai_settings"),- schemas("resolve_api_url"),- schemas("get_runtime_flags"),- schemas("set_browser_allow_all"),- schemas("workspace_onboarding_flag_exists"),- schemas("workspace_onboarding_flag_set"),- schemas("update_analytics_settings"),- schemas("get_analytics_settings"),- schemas("get_dashboard_settings"),- schemas("agent_server_status"),- schemas("reset_local_data"),- schemas("get_data_paths"),- schemas("get_agent_paths"),- schemas("update_agent_paths"),- schemas("get_onboarding_completed"),- schemas("set_onboarding_completed"),- schemas("get_dictation_settings"),- schemas("update_dictation_settings"),- schemas("get_voice_server_settings"),- schemas("update_voice_server_settings"),- schemas("update_composio_trigger_settings"),- schemas("get_composio_trigger_settings"),- schemas("get_autonomy_settings"),- schemas("update_autonomy_settings"),- schemas("get_privacy_mode"),- schemas("set_privacy_mode"),- schemas("get_agent_settings"),- schemas("update_agent_settings"),- schemas("update_search_settings"),- schemas("get_search_settings"),- schemas("get_activity_level_settings"),- schemas("update_activity_level_settings"),- schemas("get_memory_sync_settings"),- schemas("update_memory_sync_settings"),- schemas("get_sandbox_settings"),- schemas("update_sandbox_settings"),- ]-}--pub fn all_registered_controllers() -> Vec<RegisteredController> {- vec![- RegisteredController {- schema: schemas("get_config"),- handler: handle_get_config,- },- RegisteredController {- schema: schemas("get_client_config"),- handler: handle_get_client_config,- },- RegisteredController {- schema: schemas("update_model_settings"),- handler: handle_update_model_settings,- },- RegisteredController {- schema: schemas("update_memory_settings"),- handler: handle_update_memory_settings,- },- RegisteredController {- schema: schemas("update_runtime_settings"),- handler: handle_update_runtime_settings,- },- RegisteredController {- schema: schemas("update_browser_settings"),- handler: handle_update_browser_settings,- },- RegisteredController {- schema: schemas("update_local_ai_settings"),- handler: handle_update_local_ai_settings,- },- RegisteredController {- schema: schemas("resolve_api_url"),- handler: handle_resolve_api_url,- },- RegisteredController {- schema: schemas("get_runtime_flags"),- handler: handle_get_runtime_flags,- },- RegisteredController {- schema: schemas("set_browser_allow_all"),- handler: handle_set_browser_allow_all,- },- RegisteredController {- schema: schemas("workspace_onboarding_flag_exists"),- handler: handle_workspace_onboarding_flag_exists,- },- RegisteredController {- schema: schemas("workspace_onboarding_flag_set"),- handler: handle_workspace_onboarding_flag_set,- },- RegisteredController {- schema: schemas("update_analytics_settings"),- handler: handle_update_analytics_settings,- },- RegisteredController {- schema: schemas("get_analytics_settings"),- handler: handle_get_analytics_settings,- },- RegisteredController {- schema: schemas("get_dashboard_settings"),- handler: handle_get_dashboard_settings,- },- RegisteredController {- schema: schemas("agent_server_status"),- handler: handle_agent_server_status,- },- RegisteredController {- schema: schemas("reset_local_data"),- handler: handle_reset_local_data,- },- RegisteredController {- schema: schemas("get_data_paths"),- handler: handle_get_data_paths,- },- RegisteredController {- schema: schemas("get_agent_paths"),- handler: handle_get_agent_paths,- },- RegisteredController {- schema: schemas("update_agent_paths"),- handler: handle_update_agent_paths,- },- RegisteredController {- schema: schemas("get_onboarding_completed"),- handler: handle_get_onboarding_completed,- },- RegisteredController {- schema: schemas("set_onboarding_completed"),- handler: handle_set_onboarding_completed,- },- RegisteredController {- schema: schemas("get_dictation_settings"),- handler: handle_get_dictation_settings,- },- RegisteredController {- schema: schemas("update_dictation_settings"),- handler: handle_update_dictation_settings,- },- RegisteredController {- schema: schemas("get_voice_server_settings"),- handler: handle_get_voice_server_settings,- },- RegisteredController {- schema: schemas("update_voice_server_settings"),- handler: handle_update_voice_server_settings,- },- RegisteredController {- schema: schemas("update_composio_trigger_settings"),- handler: handle_update_composio_trigger_settings,- },- RegisteredController {- schema: schemas("get_composio_trigger_settings"),- handler: handle_get_composio_trigger_settings,- },- RegisteredController {- schema: schemas("get_autonomy_settings"),- handler: handle_get_autonomy_settings,- },- RegisteredController {- schema: schemas("update_autonomy_settings"),- handler: handle_update_autonomy_settings,- },- RegisteredController {- schema: schemas("get_privacy_mode"),- handler: handle_get_privacy_mode,- },- RegisteredController {- schema: schemas("set_privacy_mode"),- handler: handle_set_privacy_mode,- },- RegisteredController {- schema: schemas("get_agent_settings"),- handler: handle_get_agent_settings,- },- RegisteredController {- schema: schemas("update_agent_settings"),- handler: handle_update_agent_settings,- },- RegisteredController {- schema: schemas("update_search_settings"),- handler: handle_update_search_settings,- },- RegisteredController {- schema: schemas("get_search_settings"),- handler: handle_get_search_settings,- },- RegisteredController {- schema: schemas("get_activity_level_settings"),- handler: handle_get_activity_level_settings,- },- RegisteredController {- schema: schemas("update_activity_level_settings"),- handler: handle_update_activity_level_settings,- },- RegisteredController {- schema: schemas("get_memory_sync_settings"),- handler: handle_get_memory_sync_settings,- },- RegisteredController {- schema: schemas("update_memory_sync_settings"),- handler: handle_update_memory_sync_settings,- },- RegisteredController {- schema: schemas("get_sandbox_settings"),- handler: handle_get_sandbox_settings,- },- RegisteredController {- schema: schemas("update_sandbox_settings"),- handler: handle_update_sandbox_settings,- },- ]-}--fn handle_get_config(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::load_and_get_config_snapshot().await?) })-}--fn handle_get_client_config(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] get_client_config enter");- match config_rpc::load_and_get_client_config_snapshot().await {- Ok(snapshot) => to_json(snapshot),- Err(err) => {- log::warn!("[config][rpc] get_client_config load failed: {err}");- Err(err)- }- }- })-}--fn handle_update_model_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<ModelSettingsUpdate>(params)?;- let patch = config_rpc::ModelSettingsPatch {- api_url: update.api_url,- inference_url: update.inference_url,- api_key: update.api_key,- default_model: update.default_model,- default_temperature: update.default_temperature,- model_routes: update.model_routes.map(|routes| {- routes- .into_iter()- .map(|r| crate::config::ModelRouteConfig {- hint: r.hint,- model: r.model,- })- .collect()- }),- cloud_providers: update- .cloud_providers- .map(|entries| {- use crate::config::schema::cloud_providers::{- generate_provider_id, is_slug_reserved, migrate_legacy_fields, AuthStyle,- CloudProviderCreds,- };- let reserved_count = entries- .iter()- .filter(|e| {- let t = e.slug.trim();- !t.is_empty() && is_slug_reserved(t)- })- .count();- if reserved_count > 0 {- log::debug!(- "[config] update_model_settings: dropping {} reserved cloud provider slug(s)",- reserved_count- );- }- entries- .into_iter()- // Silently drop entries whose (non-empty) slug is reserved —- // typically the migration-seeded "openhuman" / "cloud" /- // "pid" built-ins that the frontend echoes back on every- // save (see `migrations::unify_ai_provider_settings`).- // Empty slugs still fall through so the explicit- // validation error below fires for actual frontend- // bugs. `apply_model_settings` re-injects the existing- // reserved entries from the stored config so they- // aren't dropped on save.- .filter(|e| {- let trimmed = e.slug.trim();- trimmed.is_empty() || !is_slug_reserved(trimmed)- })- .map(|e| {- let slug = e.slug.trim().to_string();- if slug.is_empty() {- return Err(- "cloud provider slug must not be empty".to_string()- );- }- let auth_style = match e- .auth_style- .as_deref()- .unwrap_or("bearer")- .to_ascii_lowercase()- .as_str()- {- "bearer" => AuthStyle::Bearer,- "anthropic" => AuthStyle::Anthropic,- "openhuman_jwt" | "openhumanjwt" => AuthStyle::OpenhumanJwt,- "none" => AuthStyle::None,- other => {- return Err(format!(- "unknown auth_style '{}'; valid: bearer, anthropic, openhuman_jwt, none",- other- ))- }- };- let id = e- .id- .filter(|s| !s.trim().is_empty())- .unwrap_or_else(|| generate_provider_id(&slug));- let label = e- .label- .filter(|s| !s.trim().is_empty())- .unwrap_or_else(|| slug.clone());- let mut entry = CloudProviderCreds {- id,- slug,- label,- endpoint: e.endpoint,- auth_style,- legacy_type: e.legacy_type,- default_model: e.default_model,- };- // Apply any remaining legacy-field migration.- migrate_legacy_fields(&mut entry);- Ok(entry)- })- .collect::<Result<Vec<_>, String>>()- })- .transpose()?,- // The config-domain RPC doesn't carry a model-registry payload — the- // per-model vision registry is updated via the inference-domain- // `inference_update_model_settings` path.- model_registry: None,- primary_cloud: update.primary_cloud,- chat_provider: update.chat_provider,- reasoning_provider: update.reasoning_provider,- agentic_provider: update.agentic_provider,- coding_provider: update.coding_provider,- vision_provider: update.vision_provider,- memory_provider: update.memory_provider,- embeddings_provider: update.embeddings_provider,- heartbeat_provider: update.heartbeat_provider,- learning_provider: update.learning_provider,- subconscious_provider: update.subconscious_provider,- };- to_json(config_rpc::load_and_apply_model_settings(patch).await?)- })-}--fn handle_update_memory_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<MemorySettingsUpdate>(params)?;- let patch = config_rpc::MemorySettingsPatch {- backend: update.backend,- auto_save: update.auto_save,- embedding_provider: update.embedding_provider,- embedding_model: update.embedding_model,- embedding_dimensions: update.embedding_dimensions,- memory_window: update.memory_window,- };- to_json(config_rpc::load_and_apply_memory_settings(patch).await?)- })-}--fn handle_update_runtime_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<RuntimeSettingsUpdate>(params)?;- let patch = config_rpc::RuntimeSettingsPatch {- kind: update.kind,- reasoning_enabled: update.reasoning_enabled,- };- to_json(config_rpc::load_and_apply_runtime_settings(patch).await?)- })-}--pub(super) fn handle_get_autonomy_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move { to_json(config_rpc::get_autonomy_settings().await?) })-}--pub(super) fn handle_update_autonomy_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<AutonomySettingsUpdate>(params)?;- let patch = config_rpc::AutonomySettingsPatch {- level: update.level,- workspace_only: update.workspace_only,- allowed_commands: update.allowed_commands,- forbidden_paths: update.forbidden_paths,- trusted_roots: update.trusted_roots,- allow_tool_install: update.allow_tool_install,- max_actions_per_hour: update- .max_actions_per_hour- .map(|v| u32::try_from(v).unwrap_or(u32::MAX)),- auto_approve: update.auto_approve,- require_task_plan_approval: update.require_task_plan_approval,- auto_approve_all: update.auto_approve_all,- };- to_json(config_rpc::load_and_apply_autonomy_settings(patch).await?)- })-}--pub(super) fn handle_get_privacy_mode(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move { to_json(config_rpc::get_privacy_mode().await?) })-}--pub(super) fn handle_set_privacy_mode(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<PrivacyModeUpdate>(params)?;- let patch = config_rpc::PrivacySettingsPatch { mode: update.mode };- to_json(config_rpc::load_and_apply_privacy_settings(patch).await?)- })-}--fn handle_get_agent_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {- log::debug!("[config][rpc] get_agent_settings enter");- match config_rpc::get_agent_settings().await {- Ok(outcome) => {- log::debug!("[config][rpc] get_agent_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] get_agent_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_update_agent_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] update_agent_settings enter");- let update = match deserialize_params::<AgentSettingsUpdate>(params) {- Ok(u) => u,- Err(err) => {- log::warn!("[config][rpc] update_agent_settings invalid params: {err}");- return Err(err);- }- };- let patch = config_rpc::AgentSettingsPatch {- agent_timeout_secs: update.agent_timeout_secs,- };- match config_rpc::load_and_apply_agent_settings(patch).await {- Ok(outcome) => {- log::debug!("[config][rpc] update_agent_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] update_agent_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_update_browser_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<BrowserSettingsUpdate>(params)?;- let patch = config_rpc::BrowserSettingsPatch {- enabled: update.enabled,- backend: update.backend,- };- to_json(config_rpc::load_and_apply_browser_settings(patch).await?)- })-}--fn handle_update_local_ai_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<LocalAiSettingsUpdate>(params)?;- let base_url = match update.base_url {- None => None,- Some(Value::Null) => Some(None),- Some(Value::String(value)) => Some(Some(value)),- Some(_) => return Err("invalid params: base_url must be a string or null".to_string()),- };- let patch = config_rpc::LocalAiSettingsPatch {- runtime_enabled: update.runtime_enabled,- opt_in_confirmed: update.opt_in_confirmed,- provider: update.provider,- base_url,- model_id: update.model_id,- chat_model_id: update.chat_model_id,- usage_embeddings: update.usage_embeddings,- usage_heartbeat: update.usage_heartbeat,- usage_learning_reflection: update.usage_learning_reflection,- usage_subconscious: update.usage_subconscious,- api_key: update.api_key,- };- to_json(config_rpc::load_and_apply_local_ai_settings(patch).await?)- })-}--fn handle_get_runtime_flags(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_runtime_flags()) })-}--fn handle_resolve_api_url(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::load_and_resolve_api_url().await?) })-}--fn handle_set_browser_allow_all(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let payload = deserialize_params::<SetBrowserAllowAllParams>(params)?;- to_json(config_rpc::set_browser_allow_all(payload.enabled)?)- })-}--fn handle_workspace_onboarding_flag_exists(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let payload = deserialize_params::<WorkspaceOnboardingFlagParams>(params)?;- to_json(- config_rpc::workspace_onboarding_flag_resolve(- payload.flag_name,- DEFAULT_ONBOARDING_FLAG_NAME,- )- .await?,- )- })-}--fn handle_workspace_onboarding_flag_set(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let payload = deserialize_params::<WorkspaceOnboardingFlagSetParams>(params)?;- to_json(- config_rpc::workspace_onboarding_flag_set(- payload.flag_name,- DEFAULT_ONBOARDING_FLAG_NAME,- payload.value,- )- .await?,- )- })-}--fn handle_update_analytics_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<AnalyticsSettingsUpdate>(params)?;- let patch = config_rpc::AnalyticsSettingsPatch {- enabled: update.enabled,- };- to_json(config_rpc::load_and_apply_analytics_settings(patch).await?)- })-}--fn handle_get_analytics_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {- use crate::rpc::RpcOutcome;- let config = config_rpc::load_config_with_timeout().await?;- let result = serde_json::json!({- "enabled": config.observability.analytics_enabled,- });- to_json(RpcOutcome::new(- result,- vec!["analytics settings read".to_string()],- ))- })-}--fn handle_get_dashboard_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_dashboard_settings().await?) })-}--fn handle_agent_server_status(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::agent_server_status()) })-}--fn handle_reset_local_data(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::reset_local_data().await?) })-}--fn handle_get_data_paths(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] get_data_paths enter");- match resolve_data_paths(params).await {- Ok(outcome) => {- log::debug!("[config][rpc] get_data_paths ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] get_data_paths fail: {err}");- Err(err)- }- }- })-}--/// Resolve the data paths for `get_data_paths`, honoring an optional `user_id`-/// param. The Clear App Data flow passes the signed-in id (#4950) because it-/// removes the active-user marker *before* the reset resolves paths — without-/// the explicit id the core would fall back to the pre-login `users/local` dir-/// and leave the real user's data behind. Absent/blank → marker-based-/// resolution (the default used by the agent tool and diagnostics).-async fn resolve_data_paths(- params: Map<String, Value>,-) -> Result<crate::rpc::RpcOutcome<Value>, String> {- let user_id = params- .get("user_id")- .and_then(Value::as_str)- .map(str::trim)- .filter(|id| !id.is_empty())- .map(|id| id.to_string());- log::debug!(- "[config][rpc] get_data_paths: explicit_user_id={}",- user_id.is_some()- );- match user_id.as_deref() {- Some(id) => config_rpc::get_data_paths_for_user(id).await,- None => config_rpc::get_data_paths().await,- }-}--pub(super) fn handle_get_agent_paths(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {- log::debug!("[config][rpc] get_agent_paths enter");- match config_rpc::get_agent_paths().await {- Ok(outcome) => {- log::debug!("[config][rpc] get_agent_paths ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] get_agent_paths fail: {err}");- Err(err)- }- }- })-}--fn handle_update_agent_paths(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] update_agent_paths enter");- let update = match deserialize_params::<AgentPathsUpdate>(params) {- Ok(u) => u,- Err(err) => {- log::warn!("[config][rpc] update_agent_paths invalid params: {err}");- return Err(err);- }- };- let patch = config_rpc::AgentPathsPatch {- action_dir: update.action_dir,- };- match config_rpc::load_and_apply_agent_paths_settings(patch).await {- Ok(outcome) => {- log::debug!("[config][rpc] update_agent_paths ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] update_agent_paths failed: {err}");- Err(err)- }- }- })-}diff --git a/crates/openhuman-core/src/config/schemas/controllers_part_02.rs b/crates/openhuman-core/src/config/schemas/controllers_part_02.rsdeleted file mode 100644index de337f373b..0000000000--- a/crates/openhuman-core/src/config/schemas/controllers_part_02.rs+++ /dev/null@@ -1,211 +0,0 @@--fn handle_get_onboarding_completed(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_onboarding_completed().await?) })-}--fn handle_get_dictation_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_dictation_settings().await?) })-}--fn handle_update_dictation_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<DictationSettingsUpdate>(params)?;- let patch = config_rpc::DictationSettingsPatch {- enabled: update.enabled,- hotkey: update.hotkey,- activation_mode: update.activation_mode,- llm_refinement: update.llm_refinement,- streaming: update.streaming,- streaming_interval_ms: update.streaming_interval_ms,- };- to_json(config_rpc::load_and_apply_dictation_settings(patch).await?)- })-}--fn handle_get_voice_server_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async { to_json(config_rpc::get_voice_server_settings().await?) })-}--fn handle_update_voice_server_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<VoiceServerSettingsUpdate>(params)?;- let patch = config_rpc::VoiceServerSettingsPatch {- auto_start: update.auto_start,- hotkey: update.hotkey,- activation_mode: update.activation_mode,- skip_cleanup: update.skip_cleanup,- min_duration_secs: update.min_duration_secs,- silence_threshold: update.silence_threshold,- custom_dictionary: update.custom_dictionary,- always_on_enabled: update.always_on_enabled,- wake_word: update.wake_word,- stt_engine: update.stt_engine,- };- let result = config_rpc::load_and_apply_voice_server_settings(patch).await?;- // Apply the always-on toggle live (start/idle the capture loop) so the- // Settings switch takes effect without a restart. Don't fail the RPC if- // the reload hiccups, but DO surface it — otherwise the saved setting- // silently wouldn't apply until the next launch.- match config_rpc::load_config_with_timeout().await {- Ok(config) => {- log::info!("[config][rpc] voice settings saved; applying live always-on state");- crate::voice::always_on::start_if_enabled(&config).await;- }- Err(error) => {- log::warn!(- "[config][rpc] voice settings saved, but live always-on apply was skipped \- (config reload failed): {error}"- );- }- }- to_json(result)- })-}--fn handle_set_onboarding_completed(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let payload = deserialize_params::<OnboardingCompletedSetParams>(params)?;- to_json(config_rpc::set_onboarding_completed(payload.value).await?)- })-}--fn handle_update_composio_trigger_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] update_composio_trigger_settings enter");- let update = match deserialize_params::<ComposioTriggerSettingsUpdate>(params) {- Ok(u) => u,- Err(err) => {- log::warn!("[config][rpc] update_composio_trigger_settings invalid params: {err}");- return Err(err);- }- };- let patch = config_rpc::ComposioTriggerSettingsPatch {- triage_disabled: update.triage_disabled,- triage_disabled_toolkits: update.triage_disabled_toolkits,- };- match config_rpc::load_and_apply_composio_trigger_settings(patch).await {- Ok(outcome) => {- log::debug!("[config][rpc] update_composio_trigger_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] update_composio_trigger_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_get_composio_trigger_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {- log::debug!("[config][rpc] get_composio_trigger_settings enter");- match config_rpc::get_composio_trigger_settings().await {- Ok(outcome) => {- log::debug!("[config][rpc] get_composio_trigger_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] get_composio_trigger_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_update_search_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- log::debug!("[config][rpc] update_search_settings enter");- let update = match deserialize_params::<SearchSettingsUpdate>(params) {- Ok(u) => u,- Err(err) => {- log::warn!("[config][rpc] update_search_settings invalid params: {err}");- return Err(err);- }- };- let patch = config_rpc::SearchSettingsPatch {- engine: update.engine,- max_results: update.max_results,- timeout_secs: update.timeout_secs,- parallel_api_key: update.parallel_api_key,- brave_api_key: update.brave_api_key,- querit_api_key: update.querit_api_key,- exa_api_key: update.exa_api_key,- tavily_api_key: update.tavily_api_key,- allowed_domains: update.allowed_domains,- allow_all: update.allow_all,- };- match config_rpc::load_and_apply_search_settings(patch).await {- Ok(outcome) => {- log::debug!("[config][rpc] update_search_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] update_search_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_get_search_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async {- log::debug!("[config][rpc] get_search_settings enter");- match config_rpc::get_search_settings().await {- Ok(outcome) => {- log::debug!("[config][rpc] get_search_settings ok");- to_json(outcome)- }- Err(err) => {- log::warn!("[config][rpc] get_search_settings failed: {err}");- Err(err)- }- }- })-}--fn handle_get_activity_level_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move { to_json(config_rpc::get_activity_level_settings().await?) })-}--fn handle_update_activity_level_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<ActivityLevelSettingsUpdate>(params)?;- let patch = config_rpc::ActivityLevelSettingsPatch {- level: update.level,- };- to_json(config_rpc::load_and_apply_activity_level_settings(patch).await?)- })-}--fn handle_get_memory_sync_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move { to_json(config_rpc::get_memory_sync_settings().await?) })-}--fn handle_update_memory_sync_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<MemorySyncSettingsUpdate>(params)?;- let patch = config_rpc::MemorySyncSettingsPatch {- sync_interval_secs: update.sync_interval_secs,- };- to_json(config_rpc::load_and_apply_memory_sync_settings(patch).await?)- })-}--fn handle_get_sandbox_settings(_params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move { to_json(config_rpc::get_sandbox_settings().await?) })-}--fn handle_update_sandbox_settings(params: Map<String, Value>) -> ControllerFuture {- Box::pin(async move {- let update = deserialize_params::<SandboxSettingsUpdate>(params)?;- let patch = config_rpc::SandboxSettingsPatch {- backend: update.backend,- enabled: update.enabled,- docker_image: update.docker_image,- docker_memory_limit_mb: update.docker_memory_limit_mb,- docker_cpu_limit: update.docker_cpu_limit,- env_passthrough: update.env_passthrough,- };- to_json(config_rpc::load_and_apply_sandbox_settings(patch).await?)- })-}diff --git a/crates/openhuman-core/src/config/schemas/schema_defs.rs b/crates/openhuman-core/src/config/schemas/schema_defs.rsindex 89c8fc6f24..9ceca598ce 100644--- a/crates/openhuman-core/src/config/schemas/schema_defs.rs+++ b/crates/openhuman-core/src/config/schemas/schema_defs.rs@@ -1,29 +1,30 @@-use crate::core::{ControllerSchema, FieldSchema, TypeSchema};+//! Controller schema definitions for the `config` namespace, grouped by+//! settings area. `schemas` looks a function up across every group.-use super::helpers::{json_output, optional_bool, optional_json, optional_string};+use crate::core::{ControllerSchema, FieldSchema, TypeSchema};-#[path = "schemas_schema_part_01.rs"]-mod schemas_schema_part_01;-#[path = "schemas_schema_part_02.rs"]-mod schemas_schema_part_02;+mod agent;+mod inference;+mod integrations;+mod voice;+mod workspace;pub fn schemas(function: &str) -> ControllerSchema {- if let Some(schema) = schemas_schema_part_01::lookup(function) {- return schema;- }- if let Some(schema) = schemas_schema_part_02::lookup(function) {- return schema;- }- ControllerSchema {- namespace: "config",- function: "unknown",- description: "Unknown config controller function.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "error",- ty: TypeSchema::String,- comment: "Lookup error details.",- required: true,- }],- }+ inference::lookup(function)+ .or_else(|| agent::lookup(function))+ .or_else(|| workspace::lookup(function))+ .or_else(|| voice::lookup(function))+ .or_else(|| integrations::lookup(function))+ .unwrap_or_else(|| ControllerSchema {+ namespace: "config",+ function: "unknown",+ description: "Unknown config controller function.",+ inputs: vec![],+ outputs: vec![FieldSchema {+ name: "error",+ ty: TypeSchema::String,+ comment: "Lookup error details.",+ required: true,+ }],+ })}diff --git a/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs b/crates/openhuman-core/src/config/schemas/schema_defs/voice.rsindex 869a666661..0cf44128df 100644--- a/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs+++ b/crates/openhuman-core/src/config/schemas/schema_defs/voice.rs@@ -6,7 +6,7 @@ use super::super::helpers::{json_output, optional_bool, optional_json, optional_pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {match function {-"get_dictation_settings" => Some( ControllerSchema {+ "get_dictation_settings" => Some(ControllerSchema {namespace: "config",function: "get_dictation_settings",description: "Read current voice dictation settings.",diff --git a/crates/openhuman-core/src/config/schemas/schemas_schema_part_01.rs b/crates/openhuman-core/src/config/schemas/schemas_schema_part_01.rsdeleted file mode 100644index ce4d9093ed..0000000000--- a/crates/openhuman-core/src/config/schemas/schemas_schema_part_01.rs+++ /dev/null@@ -1,621 +0,0 @@-use super::*;--pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {- match function {-"get_config" => Some( ControllerSchema {- namespace: "config",- function: "get",- description: "Read persisted config snapshot and resolved paths.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "snapshot",- ty: TypeSchema::Json,- comment: "Config snapshot with workspace and config paths.",- required: true,- }],- }),-"get_client_config" => Some( ControllerSchema {- namespace: "config",- function: "get_client_config",- description: "Read safe client-facing config fields (api_url, feature flags). No secrets.",- inputs: vec![],- outputs: vec![- FieldSchema {- name: "api_url",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Configured OpenHuman product backend URL, if any.",- required: false,- },- FieldSchema {- name: "inference_url",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Custom OpenAI-compatible LLM endpoint, if any. When set together with an api_key, inference goes direct to this URL.",- required: false,- },- FieldSchema {- name: "default_model",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Default model identifier.",- required: false,- },- FieldSchema {- name: "app_version",- ty: TypeSchema::String,- comment: "OpenHuman core version.",- required: true,- },- FieldSchema {- name: "api_key_set",- ty: TypeSchema::Bool,- comment: "True when a custom backend api_key is stored locally. The key itself is never returned over RPC.",- required: true,- },- FieldSchema {- name: "model_routes",- ty: TypeSchema::Json,- comment: "Persisted task-hint -> model id pairs the core router will obey. Empty when the OpenHuman built-in router is active.",- required: true,- },- ],- }),-"update_model_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_model_settings",- description: "Update model and backend connection settings, including a custom OpenAI-compatible backend (api_url + api_key).",- inputs: vec![- optional_string("api_url", "OpenHuman product backend URL (auth/billing/voice). Almost always left blank; the inference URL is a separate `inference_url` field."),- optional_string("inference_url", "Custom OpenAI-compatible LLM endpoint. When set together with `api_key`, inference goes direct to this URL instead of the OpenHuman backend. Pass an empty string to clear."),- optional_string("api_key", "Optional API key for the configured inference endpoint. Pass an empty string to clear a previously stored key."),- optional_string("default_model", "Default model id."),- FieldSchema {- name: "default_temperature",- ty: TypeSchema::Option(Box::new(TypeSchema::F64)),- comment: "Default model temperature.",- required: false,- },- FieldSchema {- name: "model_routes",- ty: TypeSchema::Option(Box::new(TypeSchema::Json)),- comment: "Optional list of {hint, model} pairs mapping task hints (reasoning, agentic, coding, summarization) to provider-specific model ids. Replaces config.model_routes wholesale; send [] to clear (e.g. when switching back to the OpenHuman built-in router).",- required: false,- },- FieldSchema {- name: "cloud_providers",- ty: TypeSchema::Option(Box::new(TypeSchema::Json)),- comment: "Optional list of cloud provider entries {id, slug, label, endpoint, auth_style}. API keys are stored separately via cloud_provider_set_key. Replaces config.cloud_providers wholesale.",- required: false,- },- optional_string("primary_cloud", "id of the cloud_providers entry used when a workload routes to 'cloud'. Empty string clears."),- optional_string("chat_provider", "Provider string for direct conversational chat workloads."),- optional_string("reasoning_provider", "Provider string for the main reasoning workload (e.g. 'cloud', 'ollama:llama3.1:8b', 'openai:gpt-4o')."),- optional_string("agentic_provider", "Provider string for sub-agent / tool-loop workloads."),- optional_string("coding_provider", "Provider string for code-generation workloads."),- optional_string("vision_provider", "Provider string for the vision / multimodal workload (managed default: vision-v1)."),- optional_string("memory_provider", "Provider string for memory-tree extract + summarise."),- optional_string("embeddings_provider", "Provider string for embedding generation."),- optional_string("heartbeat_provider", "Provider string for the heartbeat background-reasoning loop."),- optional_string("learning_provider", "Provider string for learning / reflection passes."),- optional_string("subconscious_provider", "Provider string for subconscious evaluation."),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"update_memory_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_memory_settings",- description: "Update memory backend and embedding settings.",- inputs: vec![- optional_string("backend", "Memory backend identifier."),- FieldSchema {- name: "auto_save",- ty: TypeSchema::Option(Box::new(TypeSchema::Bool)),- comment: "Enable auto-save.",- required: false,- },- optional_string("embedding_provider", "Embedding provider identifier."),- optional_string("embedding_model", "Embedding model identifier."),- FieldSchema {- name: "embedding_dimensions",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Embedding dimensions.",- required: false,- },- optional_string(- "memory_window",- "Stepped long-term memory window preset: minimal | balanced | extended | maximum.",- ),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"update_runtime_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_runtime_settings",- description: "Update runtime execution strategy settings.",- inputs: vec![- optional_string("kind", "Runtime kind."),- optional_bool("reasoning_enabled", "Enable reasoning mode."),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"get_autonomy_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_autonomy_settings",- description: "Get the agent access-mode settings (autonomy level, workspace confinement, trusted roots, command allow-list, forbidden paths).",- inputs: vec![],- outputs: vec![json_output("autonomy", "Current [autonomy] config block.")],- }),-"update_autonomy_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_autonomy_settings",- description: "Update the agent access mode: autonomy level, workspace confinement, trusted-roots allow-list, command allow-list, forbidden paths, and OS-install permission. Applies live to active sessions.",- inputs: vec![- optional_string("level", "Autonomy level: readonly | supervised | full."),- optional_bool("workspace_only", "Confine file/path access to the workspace directory."),- FieldSchema {- name: "allowed_commands",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(TypeSchema::String)))),- comment: "Replace the shell command allow-list (array of base command names).",- required: false,- },- FieldSchema {- name: "forbidden_paths",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(TypeSchema::String)))),- comment: "Replace the forbidden-paths denylist (array of path prefixes).",- required: false,- },- FieldSchema {- name: "trusted_roots",- ty: TypeSchema::Option(Box::new(TypeSchema::Json)),- comment: "Replace the trusted-roots allow-list: array of {path, access: read|readwrite}. Grants access outside the workspace; credential dirs (~/.ssh, ~/.gnupg, ~/.aws) stay blocked regardless.",- required: false,- },- optional_bool("allow_tool_install", "Allow the agent to install OS packages via install_tool (intended for Full mode)."),- FieldSchema {- name: "max_actions_per_hour",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Rate limit for side-effecting actions per hour.",- required: false,- },- FieldSchema {- name: "auto_approve",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(TypeSchema::String)))),- comment: "Replace the \"Always allow\" allowlist (array of tool names the agent runs without an approval prompt). Empty array clears it.",- required: false,- },- optional_bool("require_task_plan_approval", "Require approval before an agent executes a task-board plan."),- optional_bool("auto_approve_all", "When true, auto-approve all tool calls without prompting. SubconsciousTainted and Unknown origins still denied. Hard security blocks unaffected."),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"get_privacy_mode" => Some( ControllerSchema {- namespace: "config",- function: "get_privacy_mode",- description: "Get the active Privacy Mode (data-egress posture): local_only | standard | sensitive. Distinct from the autonomy access mode.",- inputs: vec![],- outputs: vec![json_output("mode", "Current privacy mode: local_only | standard | sensitive.")],- }),-"set_privacy_mode" => Some( ControllerSchema {- namespace: "config",- function: "set_privacy_mode",- description: "Set the Privacy Mode (data-egress posture). local_only blocks external model calls at the inference chokepoint. Applies live to active sessions without a restart.",- inputs: vec![- optional_string("mode", "Privacy mode: local_only | standard | sensitive."),- ],- outputs: vec![json_output("mode", "Updated privacy mode.")],- }),-"get_agent_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_agent_settings",- description: "Read agent execution settings: the action/tool wall-clock timeout, the runtime-effective value, and whether the OPENHUMAN_TOOL_TIMEOUT_SECS env var overrides it.",- inputs: vec![],- outputs: vec![json_output(- "settings",- "Agent settings: agent_timeout_secs, effective_timeout_secs, env_override, min_timeout_secs, max_timeout_secs.",- )],- }),-"update_agent_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_agent_settings",- description: "Update agent execution settings. Currently the action/tool wall-clock timeout (seconds). Applies to the next tool call without a restart; the OPENHUMAN_TOOL_TIMEOUT_SECS env var still overrides it when set.",- inputs: vec![FieldSchema {- name: "agent_timeout_secs",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Wall-clock timeout for a single tool/action execution, in seconds (1–3600). Extend this when large local models are interrupted before finishing.",- required: false,- }],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"update_browser_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_browser_settings",- description: "Update browser automation settings.",- inputs: vec![- optional_bool("enabled", "Enable browser integration."),- optional_string(- "backend",- "Browser backend: agent_browser, playwright, rust_native, computer_use, or auto.",- ),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"update_local_ai_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_local_ai_settings",- description:- "Update the local AI runtime master switch and per-feature usage flags.",- inputs: vec![- optional_bool(- "runtime_enabled",- "Master switch — when false, no subsystem uses the selected local AI runtime.",- ),- optional_bool(- "opt_in_confirmed",- "MVP opt-in marker. Bootstrap hard-overrides to disabled when this is false, \- regardless of `runtime_enabled`. Set in tandem with `runtime_enabled` from the \- unified AI panel.",- ),- optional_string(- "provider",- "Local provider identifier. Supported values: ollama, lm_studio, omlx.",- ),- optional_json(- "base_url",- "Provider base URL string, or null to clear. For LM Studio this defaults to http://localhost:1234/v1.",- ),- optional_string(- "api_key",- "Bearer credential for keyed local runtimes such as OMLX. Pass an empty string to clear.",- ),- optional_string("model_id", "Default local chat model identifier."),- optional_string("chat_model_id", "Local chat model identifier."),- optional_bool(- "usage_embeddings",- "Use the local model for embedding generation (when runtime_enabled).",- ),- optional_bool(- "usage_heartbeat",- "Use the local model inside the heartbeat loop (when runtime_enabled).",- ),- optional_bool(- "usage_learning_reflection",- "Use the local model for learning/reflection passes (when runtime_enabled).",- ),- optional_bool(- "usage_subconscious",- "Use the local model for subconscious evaluation (when runtime_enabled).",- ),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"resolve_api_url" => Some( ControllerSchema {- namespace: "config",- function: "resolve_api_url",- description: "Resolve effective API base URL using config/env/default from core.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "api_url",- ty: TypeSchema::String,- comment: "Resolved backend API URL.",- required: true,- }],- }),-"get_runtime_flags" => Some( ControllerSchema {- namespace: "config",- function: "get_runtime_flags",- description: "Read environment-driven runtime flags.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "flags",- ty: TypeSchema::Ref("RuntimeFlagsOut"),- comment: "Runtime flag state.",- required: true,- }],- }),-"set_browser_allow_all" => Some( ControllerSchema {- namespace: "config",- function: "set_browser_allow_all",- description: "Disable browser allow-all mode, or enable it only when operator opt-in is present.",- inputs: vec![FieldSchema {- name: "enabled",- ty: TypeSchema::Bool,- comment: "Whether to enable browser allow-all mode. Runtime enable is refused unless OPENHUMAN_BROWSER_ALLOW_ALL_RPC_ENABLE=1.",- required: true,- }],- outputs: vec![FieldSchema {- name: "flags",- ty: TypeSchema::Ref("RuntimeFlagsOut"),- comment: "Updated runtime flag state.",- required: true,- }],- }),-"workspace_onboarding_flag_exists" => Some( ControllerSchema {- namespace: "config",- function: "workspace_onboarding_flag_exists",- description: "Check if onboarding flag file exists in workspace.",- inputs: vec![FieldSchema {- name: "flag_name",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Optional onboarding flag name override.",- required: false,- }],- outputs: vec![FieldSchema {- name: "exists",- ty: TypeSchema::Bool,- comment: "True when the flag file is present.",- required: true,- }],- }),-"workspace_onboarding_flag_set" => Some( ControllerSchema {- namespace: "config",- function: "workspace_onboarding_flag_set",- description: "Create or remove the onboarding flag file in workspace.",- inputs: vec![- FieldSchema {- name: "flag_name",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "Optional onboarding flag name override.",- required: false,- },- FieldSchema {- name: "value",- ty: TypeSchema::Bool,- comment: "True to create, false to remove.",- required: true,- },- ],- outputs: vec![FieldSchema {- name: "exists",- ty: TypeSchema::Bool,- comment: "True when the flag file is present after the operation.",- required: true,- }],- }),-"update_analytics_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_analytics_settings",- description: "Enable or disable anonymized analytics and error reporting.",- inputs: vec![optional_bool(- "enabled",- "Enable anonymized analytics and crash reports.",- )],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"get_analytics_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_analytics_settings",- description: "Read current analytics settings.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "enabled",- ty: TypeSchema::Bool,- comment: "Whether anonymized analytics is enabled.",- required: true,- }],- }),-"get_dashboard_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_dashboard_settings",- description: "Read dashboard settings, including the local architecture diagram viewer.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "dashboard",- ty: TypeSchema::Json,- comment: "Current [dashboard] config block.",- required: true,- }],- }),-"update_search_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_search_settings",- description: "Update search engine selection and BYO API credentials.",- inputs: vec![- optional_string(- "engine",- "Active engine: disabled | managed | parallel | brave | querit | exa | tavily.",- ),- FieldSchema {- name: "max_results",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Maximum results per query (1-20).",- required: false,- },- FieldSchema {- name: "timeout_secs",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Per-request timeout in seconds (1-120).",- required: false,- },- optional_string(- "parallel_api_key",- "Parallel API key (empty string clears the stored key).",- ),- optional_string(- "brave_api_key",- "Brave Search API key (empty string clears the stored key).",- ),- optional_string(- "querit_api_key",- "Querit API key (empty string clears the stored key).",- ),- optional_string(- "exa_api_key",- "Exa API key (empty string clears the stored key).",- ),- optional_string(- "tavily_api_key",- "Tavily API key (empty string clears the stored key).",- ),- FieldSchema {- name: "allowed_domains",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(- TypeSchema::String,- )))),- comment: "Websites the assistant may open/read (web_fetch/curl). Exact hosts match their subdomains; \"*\" allows all public sites; empty blocks all web access.",- required: false,- },- FieldSchema {- name: "allow_all",- ty: TypeSchema::Option(Box::new(TypeSchema::Bool)),- comment: "\"Allow all sites\" toggle. true sets the allowlist to [\"*\"]; false drops the wildcard, keeping explicit hosts.",- required: false,- },- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"get_search_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_search_settings",- description:- "Read search engine settings. API keys are surfaced as presence booleans only.",- inputs: vec![],- outputs: vec![json_output(- "settings",- "Engine, effective engine, limits, and per-provider configuration flags.",- )],- }),-"get_activity_level_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_activity_level_settings",- description: "Get the agent activity level (0–4) and its derived settings: sync cadence, heartbeat/subconscious toggles, token budget, estimated monthly cost.",- inputs: vec![],- outputs: vec![json_output("settings", "Activity level settings with cost estimates.")],- }),-"update_activity_level_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_activity_level_settings",- description: "Set the agent activity level. Immediately updates the scheduler gate mode and persists the change.",- inputs: vec![optional_string("level", "Activity level: off | minimal | moderate | active | always_on (or 0–4).")],- outputs: vec![json_output("settings", "Updated activity level settings with cost estimates.")],- }),-"get_memory_sync_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_memory_sync_settings",- description: "Get the global memory-sync cadence applied to all opted-in sources: stored value, resolved selected cadence, manual/default flags, the 24h default, and the preset options (4h/12h/24h).",- inputs: vec![],- outputs: vec![json_output("settings", "Memory sync schedule settings.")],- }),-"update_memory_sync_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_memory_sync_settings",- description: "Set the global memory-sync cadence. Omit/null resets to the default; 0 means Manual only (auto-sync disabled); a positive value is seconds between syncs. Takes effect on the next scheduler tick.",- inputs: vec![FieldSchema {- name: "sync_interval_secs",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Seconds between auto-syncs. null = default (24h); 0 = Manual only; n>0 = sync every n seconds.",- required: false,- }],- outputs: vec![json_output("settings", "Updated memory sync schedule settings.")],- }),-"get_sandbox_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_sandbox_settings",- description: "Get sandbox execution backend settings: selected backend, Docker image/limits, env passthrough, Docker availability, and detected OS backend.",- inputs: vec![],- outputs: vec![json_output("settings", "Sandbox settings with status.")],- }),-"update_sandbox_settings" => Some( ControllerSchema {- namespace: "config",- function: "update_sandbox_settings",- description: "Update sandbox execution backend settings: backend selection, Docker image, memory/CPU limits, and env passthrough. Applies to new agent sessions.",- inputs: vec![- optional_string("backend", "Sandbox backend: auto | landlock | firejail | bubblewrap | docker | none."),- optional_bool("enabled", "Enable or disable sandbox execution."),- optional_string("docker_image", "Docker image for sandboxed execution (e.g. alpine:3.20)."),- FieldSchema {- name: "docker_memory_limit_mb",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Docker container memory limit in MB.",- required: false,- },- FieldSchema {- name: "docker_cpu_limit",- ty: TypeSchema::Option(Box::new(TypeSchema::F64)),- comment: "Docker container CPU limit (e.g. 1.0 = one core).",- required: false,- },- FieldSchema {- name: "env_passthrough",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(TypeSchema::String)))),- comment: "Environment variables to pass through into the sandbox.",- required: false,- },- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),-"agent_server_status" => Some( ControllerSchema {- namespace: "config",- function: "agent_server_status",- description: "Return agent server runtime URL and status.",- inputs: vec![],- outputs: vec![json_output("status", "Agent server status payload.")],- }),-"reset_local_data" => Some( ControllerSchema {- namespace: "config",- function: "reset_local_data",- description:- "Delete local OpenHuman data for the active config/workspace so the next restart boots clean.",- inputs: vec![],- outputs: vec![json_output("result", "Reset result with removed paths.")],- }),-"get_data_paths" => Some( ControllerSchema {- namespace: "config",- function: "get_data_paths",- description:- "Resolve the OpenHuman data directories (current workspace, default ~/.openhuman, active workspace marker) that reset_local_data would remove. Read-only — performs no filesystem changes.",- inputs: vec![optional_string(- "user_id",- "Resolve paths for this specific user id (users/<id>) instead of the active-user marker. Clear App Data passes this because it signs the user out — removing the marker — before deleting the data.",- )],- outputs: vec![json_output(- "paths",- "Resolved data paths: current_openhuman_dir, default_openhuman_dir, active_workspace_marker_path.",- )],- }),-"get_agent_paths" => Some( ControllerSchema {- namespace: "config",- function: "get_agent_paths",- description:- "Resolve the agent's filesystem roots (action_dir, workspace_dir, projects_dir) so the UI can render live values instead of hard-coded strings. Read-only. Also returns `action_dir_env_override: bool` so the UI knows when OPENHUMAN_ACTION_DIR is forcing the value (Settings → action_dir editing disabled in that case).",- inputs: vec![],- outputs: vec![json_output(- "paths",- "Resolved agent paths: action_dir (acting-tool CWD), workspace_dir (internal state, agent-blocked), projects_dir (default projects home), action_dir_source (env | override | default).",- )],- }),-"update_agent_paths" => Some( ControllerSchema {- namespace: "config",- function: "update_agent_paths",- description:- "Update the agent's editable filesystem roots. Currently only action_dir (the acting-tool sandbox). The path must be absolute; a missing directory is auto-created; it cannot equal the internal workspace_dir. An empty string clears the override and reverts to the default. Applies to new sessions immediately (live policy hot-swap), no restart. OPENHUMAN_ACTION_DIR still overrides at runtime when set.",- inputs: vec![FieldSchema {- name: "action_dir",- ty: TypeSchema::Option(Box::new(TypeSchema::String)),- comment: "New absolute action sandbox path. Empty string clears the override (revert to default). Omit to leave unchanged.",- required: false,- }],- outputs: vec![json_output(- "paths",- "Updated agent paths (same shape as get_agent_paths): action_dir, workspace_dir, projects_dir, action_dir_source.",- )],- }),-"get_onboarding_completed" => Some( ControllerSchema {- namespace: "config",- function: "get_onboarding_completed",- description: "Read whether the user has completed the onboarding flow.",- inputs: vec![],- outputs: vec![FieldSchema {- name: "completed",- ty: TypeSchema::Bool,- comment: "True when onboarding has been completed.",- required: true,- }],- }),-"get_dictation_settings" => Some( ControllerSchema {- namespace: "config",- function: "get_dictation_settings",- description: "Read current voice dictation settings.",- inputs: vec![],- outputs: vec![json_output("settings", "Dictation settings payload.")],- }),- _ => None,- }-}diff --git a/crates/openhuman-core/src/config/schemas/schemas_schema_part_02.rs b/crates/openhuman-core/src/config/schemas/schemas_schema_part_02.rsdeleted file mode 100644index a60f5814e9..0000000000--- a/crates/openhuman-core/src/config/schemas/schemas_schema_part_02.rs+++ /dev/null@@ -1,143 +0,0 @@-use super::*;--pub(super) fn lookup(function: &str) -> Option<ControllerSchema> {- match function {- "update_dictation_settings" => Some(ControllerSchema {- namespace: "config",- function: "update_dictation_settings",- description: "Update voice dictation settings.",- inputs: vec![- optional_bool("enabled", "Enable voice dictation."),- optional_string("hotkey", "Global hotkey string (e.g. Fn)."),- optional_string("activation_mode", "Activation mode: toggle or push."),- optional_bool(- "llm_refinement",- "Enable LLM post-processing of transcription.",- ),- optional_bool("streaming", "Enable WebSocket streaming transcription."),- FieldSchema {- name: "streaming_interval_ms",- ty: TypeSchema::Option(Box::new(TypeSchema::U64)),- comment: "Interval between streaming inference passes (ms).",- required: false,- },- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),- "get_voice_server_settings" => Some(ControllerSchema {- namespace: "config",- function: "get_voice_server_settings",- description: "Read current voice server settings.",- inputs: vec![],- outputs: vec![json_output("settings", "Voice server settings payload.")],- }),- "update_voice_server_settings" => Some(ControllerSchema {- namespace: "config",- function: "update_voice_server_settings",- description: "Update voice server settings.",- inputs: vec![- optional_bool(- "auto_start",- "Start the voice server automatically with the core.",- ),- optional_string("hotkey", "Voice server hotkey string (e.g. Fn)."),- optional_string("activation_mode", "Activation mode: tap or push."),- optional_bool(- "skip_cleanup",- "Skip LLM cleanup and keep dictation verbatim.",- ),- FieldSchema {- name: "min_duration_secs",- ty: TypeSchema::Option(Box::new(TypeSchema::F64)),- comment: "Minimum recording duration in seconds.",- required: false,- },- FieldSchema {- name: "silence_threshold",- ty: TypeSchema::Option(Box::new(TypeSchema::F64)),- comment: "RMS energy threshold for silence detection.",- required: false,- },- FieldSchema {- name: "custom_dictionary",- ty: TypeSchema::Option(Box::new(TypeSchema::Json)),- comment: "Custom vocabulary words to bias the STT engine toward.",- required: false,- },- optional_bool(- "always_on_enabled",- "Continuous always-on listening (no hotkey). Opt-in.",- ),- optional_string(- "wake_word",- "Always-on wake word; utterances must contain it (default 'Hey Tiny').",- ),- optional_string(- "stt_engine",- "Hosted speech-to-text engine: backend, elevenlabs, or openai.",- ),- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),- "set_onboarding_completed" => Some(ControllerSchema {- namespace: "config",- function: "set_onboarding_completed",- description: "Mark the onboarding flow as completed or reset it.",- inputs: vec![FieldSchema {- name: "value",- ty: TypeSchema::Bool,- comment: "True to mark completed, false to reset.",- required: true,- }],- outputs: vec![FieldSchema {- name: "completed",- ty: TypeSchema::Bool,- comment: "Updated onboarding completed state.",- required: true,- }],- }),- "update_composio_trigger_settings" => Some(ControllerSchema {- namespace: "config",- function: "update_composio_trigger_settings",- description: "Update Composio trigger-triage settings. When triage is disabled the \- local LLM is NOT invoked per trigger — events are still archived to \- trigger history.",- inputs: vec![- optional_bool(- "triage_disabled",- "When true, skip the LLM triage turn for all Composio triggers globally.",- ),- FieldSchema {- name: "triage_disabled_toolkits",- ty: TypeSchema::Option(Box::new(TypeSchema::Array(Box::new(- TypeSchema::String,- )))),- comment: "Toolkit slugs that skip LLM triage (e.g. [\"gmail\", \"slack\"]).",- required: false,- },- ],- outputs: vec![json_output("snapshot", "Updated config snapshot.")],- }),- "get_composio_trigger_settings" => Some(ControllerSchema {- namespace: "config",- function: "get_composio_trigger_settings",- description: "Read current Composio trigger-triage settings.",- inputs: vec![],- outputs: vec![- FieldSchema {- name: "triage_disabled",- ty: TypeSchema::Bool,- comment: "Whether the global triage-disabled flag is set.",- required: true,- },- FieldSchema {- name: "triage_disabled_toolkits",- ty: TypeSchema::Array(Box::new(TypeSchema::String)),- comment: "Toolkit slugs that skip LLM triage.",- required: true,- },- ],- }),- _ => None,- }-}