pub struct AppConfig {Show 17 fields
pub hotkey_listen: String,
pub hotkey_new_session: String,
pub grace_period_secs: u32,
pub llm: LlmSettings,
pub voice: VoiceSettings,
pub mcp_servers: Vec<McpServerEntry>,
pub mdh_pointers: HashMap<String, String>,
pub ui: UiSettings,
pub privacy: PrivacySettings,
pub nats_url: String,
pub developer: DeveloperSettings,
pub notifications: NotificationSettings,
pub web_search: WebSearchConfig,
pub permissions: GlobalPermissionSettings,
pub pipeline: PipelineSettings,
pub prompt_enhancement: PromptEnhancementSettings,
pub hooks: HooksSettings,
}Expand description
Application configuration persisted to a YAML file.
Only fields that differ from their defaults are written to disk. All
other fields fall back to Default::default() at load time, keeping the
YAML file minimal and human-readable.
Fields§
§hotkey_listen: StringGlobal hotkey to toggle the app or trigger recording.
hotkey_new_session: StringGlobal hotkey to open a new agent session window.
grace_period_secs: u32Grace period in seconds for agent shutdown.
llm: LlmSettingsLLM configuration and provider selection.
voice: VoiceSettingsVoice/STT configuration.
mcp_servers: Vec<McpServerEntry>MCP server configuration (full spec, Claude Code compatible).
mdh_pointers: HashMap<String, String>MDH pointer mappings
ui: UiSettingsUI preferences (theme, accent)
privacy: PrivacySettingsPrivacy and data-handling preferences shared by onboarding and settings.
nats_url: StringNATS URL for embedded MQ connectivity.
developer: DeveloperSettingsDeveloper and simulator settings
notifications: NotificationSettingsNotification settings for response completion and feedback
web_search: WebSearchConfigWeb search configuration
permissions: GlobalPermissionSettingsGlobal permission settings for tool execution
pipeline: PipelineSettingsPipeline and context management settings
prompt_enhancement: PromptEnhancementSettingsPrompt enhancement settings
hooks: HooksSettingsHooks configuration.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn data_dir() -> PathBuf
pub fn data_dir() -> PathBuf
Returns the default directory for storing Gestura data
On all platforms: ~/.gestura/
When GESTURA_HOME_DIR is set, Gestura resolves its data directory from
that override instead of the OS home-directory lookup. This keeps spawned
CLI processes and tests deterministic on platforms where standard home-dir
resolution ignores HOME/USERPROFILE overrides.
Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
Returns the default config path: ~/.gestura/config.yaml
Sourcepub fn legacy_json_path() -> PathBuf
pub fn legacy_json_path() -> PathBuf
Returns the legacy config path used by older versions: ~/.gestura/config.json
Sourcepub fn legacy_json_backup_path() -> PathBuf
pub fn legacy_json_backup_path() -> PathBuf
Returns the legacy config backup path: ~/.gestura/config.json.backup
Sourcepub fn is_first_run() -> bool
pub fn is_first_run() -> bool
Check if this is the first run of the application
Sourcepub fn whisper_models_dir() -> PathBuf
pub fn whisper_models_dir() -> PathBuf
Returns the default directory for Whisper models
Sourcepub fn default_whisper_model_path() -> PathBuf
pub fn default_whisper_model_path() -> PathBuf
Returns the default path for the recommended Whisper model
Sourcepub fn load_from_path(path: impl AsRef<Path>) -> AppConfig
pub fn load_from_path(path: impl AsRef<Path>) -> AppConfig
Load configuration from disk at an explicit path.
If the file does not exist or cannot be read/parsed, this returns
AppConfig::default.
Sourcepub async fn load_from_path_async(path: impl AsRef<Path>) -> AppConfig
pub async fn load_from_path_async(path: impl AsRef<Path>) -> AppConfig
Load configuration from disk at an explicit path (async).
If the file does not exist or cannot be read/parsed, this returns
AppConfig::default.
Sourcepub fn get(&self, key: &str) -> Option<String>
pub fn get(&self, key: &str) -> Option<String>
Get a config value by dot-notation key (e.g., “llm.primary”)
Sourcepub fn set(&mut self, key: &str, value: &str) -> bool
pub fn set(&mut self, key: &str, value: &str) -> bool
Set a config value by its dot-notation key.
Sourcepub fn update_voice_provider(&mut self, provider: &str)
pub fn update_voice_provider(&mut self, provider: &str)
Update the selected voice provider.
Sourcepub fn update_whisper_model_filename(&mut self, model_filename: &str)
pub fn update_whisper_model_filename(&mut self, model_filename: &str)
Update the configured Whisper model using a managed filename.
Sourcepub fn update_local_whisper_model_path(&mut self, model_path: impl Into<String>)
pub fn update_local_whisper_model_path(&mut self, model_path: impl Into<String>)
Point the local Whisper configuration at an explicit model path.
Sourcepub fn update_audio_device(&mut self, device_name: Option<String>)
pub fn update_audio_device(&mut self, device_name: Option<String>)
Update the selected audio input device (None = system default).
Sourcepub fn update_llm_provider(&mut self, provider: &str) -> Result<(), AppError>
pub fn update_llm_provider(&mut self, provider: &str) -> Result<(), AppError>
Update the primary LLM provider and ensure its config block exists.
Sourcepub fn update_provider_model(
&mut self,
provider: &str,
model: &str,
) -> Result<(), AppError>
pub fn update_provider_model( &mut self, provider: &str, model: &str, ) -> Result<(), AppError>
Update the model for a specific LLM provider.
Sourcepub fn update_ollama_config(
&mut self,
base_url: &str,
model: &str,
) -> Result<(), AppError>
pub fn update_ollama_config( &mut self, base_url: &str, model: &str, ) -> Result<(), AppError>
Update Ollama’s base URL and selected model.
Sourcepub fn apply_notification_settings_patch(
&mut self,
patch: NotificationSettingsPatch,
)
pub fn apply_notification_settings_patch( &mut self, patch: NotificationSettingsPatch, )
Apply a partial notification-settings update.
Sourcepub fn update_default_enabled_tools(&mut self, patch: HashMap<String, bool>)
pub fn update_default_enabled_tools(&mut self, patch: HashMap<String, bool>)
Merge default enabled-tool preferences into the global permission settings.
Sourcepub fn set_default_permission_level(
&mut self,
level: &str,
) -> Result<(), AppError>
pub fn set_default_permission_level( &mut self, level: &str, ) -> Result<(), AppError>
Update the default permission level for new sessions.
Sourcepub fn set_theme_mode(&mut self, theme_mode: &str)
pub fn set_theme_mode(&mut self, theme_mode: &str)
Update the selected UI theme mode.
Sourcepub fn apply_prompt_enhancement_settings_patch(
&mut self,
patch: PromptEnhancementSettingsPatch,
)
pub fn apply_prompt_enhancement_settings_patch( &mut self, patch: PromptEnhancementSettingsPatch, )
Apply a partial prompt-enhancement settings update.
Sourcepub fn add_mcp_server_entry(
&mut self,
entry: McpServerEntry,
) -> Result<(), AppError>
pub fn add_mcp_server_entry( &mut self, entry: McpServerEntry, ) -> Result<(), AppError>
Add an MCP server entry, rejecting duplicate names.
Sourcepub fn remove_mcp_server(
&mut self,
name: &str,
) -> Result<McpServerEntry, AppError>
pub fn remove_mcp_server( &mut self, name: &str, ) -> Result<McpServerEntry, AppError>
Remove an MCP server entry by name.
Sourcepub fn set_mcp_server_enabled(
&mut self,
name: &str,
enabled: bool,
) -> Result<(), AppError>
pub fn set_mcp_server_enabled( &mut self, name: &str, enabled: bool, ) -> Result<(), AppError>
Enable or disable an MCP server by name.
Sourcepub fn apply_env_overrides(self) -> AppConfig
pub fn apply_env_overrides(self) -> AppConfig
Apply environment variable overrides to the configuration
Sourcepub fn normalize_derived_defaults(&mut self)
pub fn normalize_derived_defaults(&mut self)
Normalizes configuration fields whose defaults depend on sibling values.
Sourcepub fn find_mcp_server(&self, name: &str) -> Option<&McpServerEntry>
pub fn find_mcp_server(&self, name: &str) -> Option<&McpServerEntry>
Find an MCP server entry by name (immutable).
Sourcepub fn find_mcp_server_mut(&mut self, name: &str) -> Option<&mut McpServerEntry>
pub fn find_mcp_server_mut(&mut self, name: &str) -> Option<&mut McpServerEntry>
Find an MCP server entry by name (mutable).
Trait Implementations§
Source§impl AppConfigSecurityExt for AppConfig
impl AppConfigSecurityExt for AppConfig
Source§fn load() -> Self
fn load() -> Self
Load configuration from disk, falling back to defaults if missing (sync version).
If ~/.gestura/config.yaml is missing but ~/.gestura/config.json exists,
this will automatically migrate the JSON file to YAML.
This method also handles migration of secrets to the secure keystore.
Source§async fn load_async() -> Self
async fn load_async() -> Self
Load configuration from disk asynchronously, falling back to defaults if missing.
This is the preferred method for GUI/Tauri commands to avoid blocking the UI thread.
Source§fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>
fn save_to_path(&self, path: impl AsRef<Path>) -> Result<()>
Save configuration to disk at an explicit path.
This handles stripping secrets before writing to disk if security is enabled.
Source§async fn save_async(&self) -> Result<()>
async fn save_async(&self) -> Result<()>
Save configuration to disk asynchronously.
Source§async fn save_to_path_async(&self, path: impl AsRef<Path>) -> Result<()>
async fn save_to_path_async(&self, path: impl AsRef<Path>) -> Result<()>
Save configuration to disk at an explicit path (async).
This is the async equivalent of AppConfig::save_to_path.
Source§fn sanitize_secrets(&mut self)
fn sanitize_secrets(&mut self)
Clear secrets from the struct (used before saving to disk)
Source§fn api_key_keychain_status() -> Vec<(&'static str, bool)>
fn api_key_keychain_status() -> Vec<(&'static str, bool)>
Check which API key providers have secrets stored in the OS keychain.
Returns a list of (provider_label, is_present) tuples for every known
provider. This is intended for CLI/TUI display — no secret values are
exposed.
When the security feature is disabled (or keychain access is disabled at
runtime) every provider reports false.
Source§fn has_plaintext_secrets(&self) -> bool
fn has_plaintext_secrets(&self) -> bool
Returns true if the config struct currently contains any plaintext secrets that should not be persisted to disk.
Source§fn hydrate_secrets_sync(&mut self) -> Result<()>
fn hydrate_secrets_sync(&mut self) -> Result<()>
Load secrets from keystore into the struct (sync)
Source§async fn hydrate_secrets(&mut self) -> Result<()>
async fn hydrate_secrets(&mut self) -> Result<()>
Async version of hydrate secrets
Source§fn migrate_secrets_sync(&self) -> Result<bool>
fn migrate_secrets_sync(&self) -> Result<bool>
Move secrets from the struct (if present) to the keychain. Returns true if any secrets were migrated.
Source§async fn migrate_secrets(&self) -> Result<bool>
async fn migrate_secrets(&self) -> Result<bool>
Async version of migrate secrets
Source§fn load_with_env() -> Self
fn load_with_env() -> Self
Load configuration with environment variable overrides applied
This is the recommended way to load configuration as it respects the full precedence hierarchy: env vars > config file > defaults
Source§async fn load_with_env_async() -> Self
async fn load_with_env_async() -> Self
Load configuration asynchronously with environment variable overrides
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AppConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AppConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<&AppConfig> for HotReloadableSettings
impl From<&AppConfig> for HotReloadableSettings
Source§fn from(config: &AppConfig) -> HotReloadableSettings
fn from(config: &AppConfig) -> HotReloadableSettings
Source§impl Serialize for AppConfig
impl Serialize for AppConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for AppConfig
impl StructuralPartialEq for AppConfig
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().