From 0ed7e3aae721c51ed6baf96cf16654c60a7823d3 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 10:50:11 -0300 Subject: [PATCH] refactor: update plugin creation to use consistent config approach Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/services/item_service.rs | 2 +- src/services/meta_service.rs | 22 ++-------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/services/item_service.rs b/src/services/item_service.rs index efa08c3..179ad1e 100644 --- a/src/services/item_service.rs +++ b/src/services/item_service.rs @@ -353,7 +353,7 @@ impl ItemService { let mut plugins: Vec> = plugin_types .iter() - .map(|p| get_meta_plugin(p.clone())) + .map(|p| get_meta_plugin_with_config(p.clone(), None, None)) .collect(); debug!("ITEM_SERVICE: Created {} meta plugins for MCP item", plugins.len()); diff --git a/src/services/meta_service.rs b/src/services/meta_service.rs index c2fcd77..cd1ef0a 100644 --- a/src/services/meta_service.rs +++ b/src/services/meta_service.rs @@ -32,26 +32,8 @@ impl MetaService { .map(|meta_plugin_type| { debug!("META_SERVICE: Creating plugin: {:?}", meta_plugin_type); - // Get the plugin name to find its configuration - let plugin_name = match meta_plugin_type { - MetaPluginType::FileMagic => "file_magic", - MetaPluginType::FileMime => "file_mime", - MetaPluginType::FileEncoding => "file_encoding", - MetaPluginType::MagicFile => "magic_file", - MetaPluginType::LineCount => "line_count", - MetaPluginType::WordCount => "word_count", - MetaPluginType::Cwd => "cwd", - MetaPluginType::Binary => "binary", - MetaPluginType::Text => "text", - MetaPluginType::User => "user", - MetaPluginType::Shell => "shell", - MetaPluginType::ShellPid => "shell_pid", - MetaPluginType::KeepPid => "keep_pid", - MetaPluginType::Digest => "digest", - MetaPluginType::ReadTime => "read_time", - MetaPluginType::ReadRate => "read_rate", - MetaPluginType::Hostname => "hostname", - }; + // Get the plugin name to find its configuration using the Display trait + let plugin_name = meta_plugin_type.to_string().to_lowercase(); // Get options and outputs from settings let (options, outputs) = if let Some(meta_plugin_configs) = &settings.meta_plugins {