diff --git a/crates/owlry-core/src/config/mod.rs b/crates/owlry-core/src/config/mod.rs index f611e41..3581e87 100644 --- a/crates/owlry-core/src/config/mod.rs +++ b/crates/owlry-core/src/config/mod.rs @@ -162,6 +162,9 @@ pub struct ProvidersConfig { /// Enable calculator provider (= expression or calc expression) #[serde(default = "default_true")] pub calculator: bool, + /// Enable converter provider (> expression or auto-detect) + #[serde(default = "default_true")] + pub converter: bool, /// Enable frecency-based result ranking #[serde(default = "default_true")] pub frecency: bool, @@ -239,6 +242,7 @@ impl Default for ProvidersConfig { commands: true, uuctl: true, calculator: true, + converter: true, frecency: true, frecency_weight: 0.3, websearch: true, diff --git a/crates/owlry-core/src/providers/mod.rs b/crates/owlry-core/src/providers/mod.rs index c9ef27c..5b3a3c6 100644 --- a/crates/owlry-core/src/providers/mod.rs +++ b/crates/owlry-core/src/providers/mod.rs @@ -295,7 +295,27 @@ impl ProviderManager { core_providers.push(provider); } + // Built-in dynamic providers + let mut builtin_dynamic: Vec> = Vec::new(); + + if config.providers.calculator { + builtin_dynamic.push(Box::new(calculator::CalculatorProvider)); + info!("Registered built-in calculator provider"); + } + + if config.providers.converter { + builtin_dynamic.push(Box::new(converter::ConverterProvider::new())); + info!("Registered built-in converter provider"); + } + + // Built-in static providers + if config.providers.system { + core_providers.push(Box::new(system::SystemProvider::new())); + info!("Registered built-in system provider"); + } + let mut manager = Self::new(core_providers, native_providers); + manager.builtin_dynamic = builtin_dynamic; manager.runtimes = runtimes; manager.runtime_type_ids = runtime_type_ids; manager