feat: add default outputs display for meta plugins
Co-authored-by: aider (openai/andrew/openrouter/anthropic/claude-sonnet-4) <aider@aider.chat>
This commit is contained in:
@@ -105,6 +105,12 @@ pub fn generate_status_info(
|
|||||||
let is_supported = meta_plugin.is_supported();
|
let is_supported = meta_plugin.is_supported();
|
||||||
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
let is_enabled = enabled_meta_plugins.contains(&meta_plugin_type);
|
||||||
|
|
||||||
|
// Initialize the plugin to populate any default outputs
|
||||||
|
// We use a dummy item_id since we're just showing the plugin structure
|
||||||
|
if let Ok(_) = meta_plugin.initialize(&rusqlite::Connection::open_in_memory().unwrap(), 0) {
|
||||||
|
// Plugin initialized successfully
|
||||||
|
}
|
||||||
|
|
||||||
let (binary_display, args_display) = if !is_supported {
|
let (binary_display, args_display) = if !is_supported {
|
||||||
("<NOT FOUND>".to_string(), "".to_string())
|
("<NOT FOUND>".to_string(), "".to_string())
|
||||||
} else {
|
} else {
|
||||||
@@ -119,13 +125,19 @@ pub fn generate_status_info(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Create a display of default outputs for status
|
||||||
|
let mut default_outputs = std::collections::HashMap::new();
|
||||||
|
for output_name in meta_plugin.default_outputs() {
|
||||||
|
default_outputs.insert(output_name, serde_yaml::Value::String("default".to_string()));
|
||||||
|
}
|
||||||
|
|
||||||
meta_plugin_info.push(MetaPluginInfo {
|
meta_plugin_info.push(MetaPluginInfo {
|
||||||
meta_name: meta_plugin.meta_name(),
|
meta_name: meta_plugin.meta_name(),
|
||||||
found: is_supported,
|
found: is_supported,
|
||||||
enabled: is_enabled,
|
enabled: is_enabled,
|
||||||
binary: binary_display,
|
binary: binary_display,
|
||||||
args: args_display,
|
args: args_display,
|
||||||
outputs: meta_plugin.outputs().clone(),
|
outputs: if default_outputs.is_empty() { meta_plugin.outputs().clone() } else { default_outputs },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,12 @@ pub trait MetaPlugin {
|
|||||||
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value>;
|
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value>;
|
||||||
fn outputs_mut(&mut self) -> &mut std::collections::HashMap<String, serde_yaml::Value>;
|
fn outputs_mut(&mut self) -> &mut std::collections::HashMap<String, serde_yaml::Value>;
|
||||||
|
|
||||||
|
// 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()
|
||||||
|
}
|
||||||
|
|
||||||
// Save metadata to database using central output handler
|
// Save metadata to database using central output handler
|
||||||
fn save_meta(&mut self, conn: &Connection, item_id: i64, internal_name: &str, value: String) -> Result<()> {
|
fn save_meta(&mut self, conn: &Connection, item_id: i64, internal_name: &str, value: String) -> Result<()> {
|
||||||
output_metadata(conn, item_id, internal_name, value, self.outputs())
|
output_metadata(conn, item_id, internal_name, value, self.outputs())
|
||||||
|
|||||||
Reference in New Issue
Block a user