feat: update meta plugin table to show options and sorted output keys

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 19:48:03 -03:00
parent 8cd1d6ddf2
commit 091f750bd8

View File

@@ -277,32 +277,50 @@ fn build_meta_plugin_table(meta_plugin_info: &Vec<MetaPluginInfo>) -> Table {
meta_plugin_table.set_titles(row!( meta_plugin_table.set_titles(row!(
b->"Meta Name", b->"Meta Name",
b->"Found", b->"Options",
b->"Binary",
b->"Args",
b->"Outputs")); b->"Outputs"));
for info in meta_plugin_info { for info in meta_plugin_info {
// Extract just the keys from the outputs // Get default options for the meta plugin
let outputs_keys: Vec<&str> = info.outputs.keys().map(|s| s.as_str()).collect(); let meta_plugin_type = match MetaPluginType::from_str(&info.meta_name) {
let outputs_display = if outputs_keys.is_empty() { Ok(plugin_type) => plugin_type,
"".to_string() Err(_) => continue,
};
// Create a default plugin to get its default options
let default_plugin = get_meta_plugin(
meta_plugin_type.clone(),
None,
None,
);
// Get and sort options
let mut options: Vec<_> = default_plugin.options().iter().collect();
options.sort_by(|a, b| a.0.cmp(b.0));
// Format options as YAML string, each on a new line
let options_str = if options.is_empty() {
"{}".to_string()
} else { } else {
outputs_keys.join(", ") let options_map: std::collections::BTreeMap<_, _> = options.into_iter().collect();
serde_yaml::to_string(&options_map)
.unwrap_or_else(|_| "Unable to serialize options".to_string())
.trim()
.to_string()
};
// Get and sort output keys
let mut output_keys: Vec<&String> = info.outputs.keys().collect();
output_keys.sort();
let outputs_display = if output_keys.is_empty() {
"{}".to_string()
} else {
output_keys.join("\n")
}; };
meta_plugin_table.add_row(Row::new(vec![ meta_plugin_table.add_row(Row::new(vec![
Cell::new(&info.meta_name), Cell::new(&info.meta_name),
match info.found { Cell::new(&options_str),
true => Cell::new("Yes").with_style(Attr::ForegroundColor(color::GREEN)),
false => Cell::new("No").with_style(Attr::ForegroundColor(color::RED)),
},
match info.binary.as_str() {
"<INTERNAL>" => Cell::new(&info.binary).with_style(Attr::ForegroundColor(color::BRIGHT_BLACK)),
"<NOT FOUND>" => Cell::new(&info.binary).with_style(Attr::ForegroundColor(color::RED)),
_ => Cell::new(&info.binary),
},
Cell::new(&info.args),
Cell::new(&outputs_display), Cell::new(&outputs_display),
])); ]));
} }