refactor: remove redundant meta_name field and simplify default outputs

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:12:06 -03:00
parent b8d51e2fa2
commit 7b1820cb63
10 changed files with 2 additions and 36 deletions

View File

@@ -16,7 +16,6 @@ impl BinaryMetaPlugin {
outputs: Option<std::collections::HashMap<String, serde_yaml::Value>>,
) -> BinaryMetaPlugin {
let mut base = crate::meta_plugin::BaseMetaPlugin::new();
base.meta_name = "binary".to_string();
// Initialize with helper function
base.initialize_plugin(
@@ -138,9 +137,6 @@ impl MetaPlugin for BinaryMetaPlugin {
self.base.outputs_mut()
}
fn default_outputs(&self) -> Vec<String> {
vec!["binary".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
self.base.options()

View File

@@ -111,9 +111,6 @@ impl MetaPlugin for CwdMetaPlugin {
self.base.outputs_mut()
}
fn default_outputs(&self) -> Vec<String> {
vec!["cwd".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -128,9 +128,6 @@ impl MetaPlugin for KeepPidMetaPlugin {
&mut self.outputs
}
fn default_outputs(&self) -> Vec<String> {
vec!["keep_pid".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -48,7 +48,6 @@ pub struct MetaPluginResponse {
pub struct BaseMetaPlugin {
pub outputs: std::collections::HashMap<String, serde_yaml::Value>,
pub options: std::collections::HashMap<String, serde_yaml::Value>,
pub meta_name: String,
pub is_finalized: bool,
}
@@ -96,10 +95,6 @@ impl BaseMetaPlugin {
}
impl MetaPlugin for BaseMetaPlugin {
fn meta_name(&self) -> String {
self.meta_name.clone()
}
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
&self.outputs
}
@@ -187,11 +182,6 @@ 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
}
@@ -267,8 +257,8 @@ pub trait MetaPlugin where Self: 'static {
// Get the default output names this plugin can produce
fn default_outputs(&self) -> Vec<String> {
// Default implementation returns empty - plugins should override this
Vec::new()
// Default implementation returns the meta type as a string
vec![self.meta_type().to_string()]
}

View File

@@ -127,9 +127,6 @@ impl MetaPlugin for ReadRateMetaPlugin {
&mut self.outputs
}
fn default_outputs(&self) -> Vec<String> {
vec!["read_rate".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -120,9 +120,6 @@ impl MetaPlugin for ReadTimeMetaPlugin {
&mut self.outputs
}
fn default_outputs(&self) -> Vec<String> {
vec!["read_time".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -131,9 +131,6 @@ impl MetaPlugin for ShellMetaPlugin {
&mut self.outputs
}
fn default_outputs(&self) -> Vec<String> {
vec!["shell".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -132,9 +132,6 @@ impl MetaPlugin for ShellPidMetaPlugin {
&mut self.outputs
}
fn default_outputs(&self) -> Vec<String> {
vec!["shell_pid".to_string()]
}
fn options(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {

View File

@@ -38,7 +38,6 @@ impl TextMetaPlugin {
outputs: Option<std::collections::HashMap<String, serde_yaml::Value>>,
) -> TextMetaPlugin {
let mut base = crate::meta_plugin::BaseMetaPlugin::new();
base.meta_name = "text".to_string();
// Initialize with helper function
base.initialize_plugin(

View File

@@ -11,7 +11,6 @@ impl UserMetaPlugin {
outputs: Option<std::collections::HashMap<String, serde_yaml::Value>>,
) -> UserMetaPlugin {
let mut base = crate::meta_plugin::BaseMetaPlugin::new();
base.meta_name = "user".to_string();
// Initialize with helper function
base.initialize_plugin(