From 55ac1758f3086430d21e4ec6664daa281198fe39 Mon Sep 17 00:00:00 2001 From: Andrew Phillips Date: Wed, 27 Aug 2025 15:45:38 -0300 Subject: [PATCH] feat: add meta plugins information to config table Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) --- src/modes/status.rs | 60 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/modes/status.rs b/src/modes/status.rs index 8fbd97d..e3949e9 100644 --- a/src/modes/status.rs +++ b/src/modes/status.rs @@ -125,6 +125,66 @@ fn build_config_table(settings: &config::Settings) -> Table { ])); } + // Add meta plugins information + if let Some(meta_plugins) = &settings.meta_plugins { + config_table.add_empty_row(); + config_table.add_row(Row::new(vec![ + Cell::new("Meta Plugins").with_style(Attr::Bold), + Cell::new(""), + ])); + + for plugin_config in meta_plugins { + // Create the plugin to get its default options + let meta_plugin_type = match MetaPluginType::from_str(&plugin_config.name) { + Ok(plugin_type) => plugin_type, + Err(_) => continue, + }; + + // Get the plugin with its default options + let default_plugin = get_meta_plugin( + meta_plugin_type, + None, + None, + ); + + // Add plugin name + config_table.add_row(Row::new(vec![ + Cell::new(&format!(" {}", plugin_config.name)), + Cell::new(""), + ])); + + // Merge default options with user-provided options + let mut all_options = default_plugin.options().clone(); + for (key, value) in &plugin_config.options { + all_options.insert(key.clone(), value.clone()); + } + + // Add options + if !all_options.is_empty() { + let options_str = serde_yaml::to_string(&all_options) + .unwrap_or_else(|_| "Unable to serialize options".to_string()) + .trim() + .to_string(); + config_table.add_row(Row::new(vec![ + Cell::new(" Options"), + Cell::new(&options_str), + ])); + } + + // Add outputs if they exist + if !plugin_config.outputs.is_empty() { + let outputs_str = serde_yaml::to_string(&plugin_config.outputs) + .unwrap_or_else(|_| "Unable to serialize outputs".to_string()) + .trim() + .to_string(); + config_table.add_row(Row::new(vec![ + Cell::new(" Outputs"), + Cell::new(&outputs_str), + ])); + } + } + } + config_table }