feat: add meta plugin options to status information
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -41,6 +41,7 @@ pub struct MetaPluginInfo {
|
|||||||
pub binary: String,
|
pub binary: String,
|
||||||
pub args: String,
|
pub args: String,
|
||||||
pub outputs: std::collections::HashMap<String, serde_yaml::Value>,
|
pub outputs: std::collections::HashMap<String, serde_yaml::Value>,
|
||||||
|
pub options: std::collections::HashMap<String, serde_yaml::Value>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generate_status_info(
|
pub fn generate_status_info(
|
||||||
@@ -151,6 +152,7 @@ pub fn generate_status_info(
|
|||||||
binary: binary_display,
|
binary: binary_display,
|
||||||
args: args_display,
|
args: args_display,
|
||||||
outputs: outputs_display,
|
outputs: outputs_display,
|
||||||
|
options: std::collections::HashMap::new(),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,25 @@ impl StatusService {
|
|||||||
Some(crate::compression_engine::default_compression_type())
|
Some(crate::compression_engine::default_compression_type())
|
||||||
};
|
};
|
||||||
|
|
||||||
generate_status_info(data_path, db_path, &meta_plugin_types, enabled_compression_type)
|
let mut status_info = generate_status_info(data_path, db_path, &meta_plugin_types, enabled_compression_type);
|
||||||
|
|
||||||
|
// Add options to each meta plugin info
|
||||||
|
for meta_plugin_info in &mut status_info.meta_plugins {
|
||||||
|
let meta_plugin_type = MetaPluginType::from_str(&meta_plugin_info.meta_name).unwrap();
|
||||||
|
let plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type, None, None);
|
||||||
|
|
||||||
|
// Convert options to a serializable format
|
||||||
|
let options: std::collections::HashMap<String, serde_yaml::Value> = plugin
|
||||||
|
.options()
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| (k.clone(), v.clone()))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
// Add options to the meta plugin info
|
||||||
|
meta_plugin_info.options = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
status_info
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn generate_supported_status(
|
pub fn generate_supported_status(
|
||||||
@@ -55,7 +73,25 @@ impl StatusService {
|
|||||||
// Default to LZ4 compression for the API status endpoint
|
// Default to LZ4 compression for the API status endpoint
|
||||||
let enabled_compression_type = Some(CompressionType::LZ4);
|
let enabled_compression_type = Some(CompressionType::LZ4);
|
||||||
|
|
||||||
generate_status_info(data_path, db_path, &supported_meta_plugins, enabled_compression_type)
|
let mut status_info = generate_status_info(data_path, db_path, &supported_meta_plugins, enabled_compression_type);
|
||||||
|
|
||||||
|
// Add options to each meta plugin info
|
||||||
|
for meta_plugin_info in &mut status_info.meta_plugins {
|
||||||
|
let meta_plugin_type = MetaPluginType::from_str(&meta_plugin_info.meta_name).unwrap();
|
||||||
|
let plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type, None, None);
|
||||||
|
|
||||||
|
// Convert options to a serializable format
|
||||||
|
let options: std::collections::HashMap<String, serde_yaml::Value> = plugin
|
||||||
|
.options()
|
||||||
|
.iter()
|
||||||
|
.map(|(k, v)| (k.clone(), v.clone()))
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
// Add options to the meta plugin info
|
||||||
|
meta_plugin_info.options = options;
|
||||||
|
}
|
||||||
|
|
||||||
|
status_info
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user