refactor: split configure into configure_options and configure_outputs methods
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -109,16 +109,16 @@ pub trait MetaPlugin {
|
||||
output_metadata(conn, item_id, internal_name, value, self.outputs())
|
||||
}
|
||||
|
||||
// Configure plugin with options and outputs
|
||||
fn configure(&mut self, options: &std::collections::HashMap<String, serde_yaml::Value>) -> Result<()> {
|
||||
if let Some(outputs) = options.get("outputs") {
|
||||
if let Some(outputs_map) = outputs.as_mapping() {
|
||||
for (key, value) in outputs_map {
|
||||
if let Some(key_str) = key.as_str() {
|
||||
self.outputs_mut().insert(key_str.to_string(), value.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Configure plugin with options (excluding outputs)
|
||||
fn configure_options(&mut self, _options: &std::collections::HashMap<String, serde_yaml::Value>) -> Result<()> {
|
||||
// Default implementation does nothing - plugins can override this
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Configure plugin outputs mapping
|
||||
fn configure_outputs(&mut self, outputs: &std::collections::HashMap<String, serde_yaml::Value>) -> Result<()> {
|
||||
for (key, value) in outputs {
|
||||
self.outputs_mut().insert(key.clone(), value.clone());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user