feat: extract meta plugins configured into separate table

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 16:36:45 -03:00
parent 90323ab6b1
commit 03b3eea957

View File

@@ -125,12 +125,26 @@ fn build_config_table(settings: &config::Settings) -> Table {
])); ]));
} }
// Add meta plugins information config_table
if let Some(meta_plugins) = &settings.meta_plugins { }
config_table.add_empty_row();
config_table.add_row(Row::new(vec![ fn build_meta_plugins_configured_table(settings: &config::Settings) -> Option<Table> {
Cell::new("Meta Plugins").with_style(Attr::Bold), let meta_plugins = settings.meta_plugins.as_ref()?;
Cell::new(""), if meta_plugins.is_empty() {
return None;
}
let mut table = Table::new();
if std::io::stdout().is_terminal() {
table.set_format(get_format_box_chars_no_border_line_separator());
} else {
table.set_format(*FORMAT_NO_BORDER_LINE_SEPARATOR);
}
table.set_titles(Row::new(vec![
Cell::new("Plugin Name").with_style(Attr::Bold),
Cell::new("Options").with_style(Attr::Bold),
Cell::new("Outputs").with_style(Attr::Bold),
])); ]));
for plugin_config in meta_plugins { for plugin_config in meta_plugins {
@@ -140,19 +154,6 @@ fn build_config_table(settings: &config::Settings) -> Table {
Err(_) => continue, Err(_) => continue,
}; };
// Get the plugin with no options to see its pure defaults
let _default_plugin = get_meta_plugin(
meta_plugin_type.clone(),
None,
None,
);
// Add plugin name
config_table.add_row(Row::new(vec![
Cell::new(&format!(" {}", plugin_config.name)),
Cell::new(""),
]));
// Get the actual plugin with user-provided options to see the merged result // Get the actual plugin with user-provided options to see the merged result
// Convert outputs from HashMap<String, String> to HashMap<String, serde_yaml::Value> // Convert outputs from HashMap<String, String> to HashMap<String, serde_yaml::Value>
let outputs_converted: std::collections::HashMap<String, serde_yaml::Value> = plugin_config.outputs let outputs_converted: std::collections::HashMap<String, serde_yaml::Value> = plugin_config.outputs
@@ -161,7 +162,6 @@ fn build_config_table(settings: &config::Settings) -> Table {
.collect(); .collect();
// Convert options from HashMap<String, serde_yaml::Value> to the correct type // Convert options from HashMap<String, serde_yaml::Value> to the correct type
// (they're already in the correct type, so we can use them directly)
let options_converted = plugin_config.options.clone(); let options_converted = plugin_config.options.clone();
let actual_plugin = get_meta_plugin( let actual_plugin = get_meta_plugin(
@@ -179,10 +179,6 @@ fn build_config_table(settings: &config::Settings) -> Table {
.trim() .trim()
.to_string() .to_string()
}; };
config_table.add_row(Row::new(vec![
Cell::new(" Options"),
Cell::new(&options_str),
]));
// Show the merged outputs // Show the merged outputs
let outputs_str = if actual_plugin.outputs().is_empty() { let outputs_str = if actual_plugin.outputs().is_empty() {
@@ -220,14 +216,15 @@ fn build_config_table(settings: &config::Settings) -> Table {
output_pairs.join(", ") output_pairs.join(", ")
} }
}; };
config_table.add_row(Row::new(vec![
Cell::new(" Outputs"), table.add_row(Row::new(vec![
Cell::new(&plugin_config.name),
Cell::new(&options_str),
Cell::new(&outputs_str), Cell::new(&outputs_str),
])); ]));
} }
}
config_table Some(table)
} }
fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table { fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
@@ -308,6 +305,14 @@ pub fn mode_status(
println!("CONFIG:"); println!("CONFIG:");
build_config_table(settings).printstd(); build_config_table(settings).printstd();
println!(); println!();
// Print META PLUGINS CONFIGURED if they exist
if let Some(meta_plugins_table) = build_meta_plugins_configured_table(settings) {
println!("META PLUGINS CONFIGURED:");
meta_plugins_table.printstd();
println!();
}
println!("PATHS:"); println!("PATHS:");
build_path_table(&status_info.paths).printstd(); build_path_table(&status_info.paths).printstd();
println!(); println!();