refactor: replace meta_name with MetaPluginType from strum

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-27 21:04:52 -03:00
parent 892a3f24a5
commit 79fdf05d84
14 changed files with 36 additions and 32 deletions

View File

@@ -185,9 +185,15 @@ pub fn process_metadata_outputs(internal_name: &str, value: serde_yaml::Value, o
}
pub trait MetaPlugin where Self: 'static {
fn meta_type(&self) -> MetaPluginType;
// For backward compatibility, provide meta_name() that uses meta_type()
fn meta_name(&self) -> String {
self.meta_type().to_string()
}
fn is_supported(&self) -> bool {
true
}
fn is_internal(&self) -> bool {
true
@@ -218,7 +224,7 @@ pub trait MetaPlugin where Self: 'static {
}
}
fn meta_name(&self) -> String;
fn meta_type(&self) -> MetaPluginType;
// Get program information for display in status
fn program_info(&self) -> Option<(&str, Vec<&str>)> {
@@ -294,7 +300,7 @@ pub fn get_meta_plugin(
// For command type, we need to parse the command from options
let mut program_name = String::new();
let mut args = Vec::new();
let mut meta_name = "command".to_string();
let meta_name = MetaPluginType::Command.to_string();
let mut split_whitespace = true;
if let Some(opts) = &options {