feat: add support for meta plugin options and outputs

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-18 10:07:51 -03:00
parent 15774d377d
commit 592c277735
5 changed files with 80 additions and 5 deletions

View File

@@ -25,6 +25,7 @@ pub struct BinaryMetaPlugin {
is_saved: bool,
item_id: Option<i64>,
conn: Option<*mut Connection>,
output_name: Option<String>,
}
impl BinaryMetaPlugin {
@@ -36,6 +37,7 @@ impl BinaryMetaPlugin {
is_saved: false,
item_id: None,
conn: None,
output_name: None,
}
}
@@ -69,7 +71,7 @@ impl MetaPlugin for BinaryMetaPlugin {
// Save to database immediately
let meta = crate::db::Meta {
id: item_id,
name: self.meta_name.clone(),
name: self.get_output_name(&self.meta_name),
value,
};
let _ = crate::db::store_meta(conn_ref, meta);
@@ -91,6 +93,18 @@ impl MetaPlugin for BinaryMetaPlugin {
Ok(())
}
fn configure(&mut self, options: &std::collections::HashMap<String, serde_yaml::Value>) -> Result<()> {
if let Some(max_buffer_size) = options.get("max_buffer_size") {
if let Ok(size) = max_buffer_size.as_u64() {
self.max_buffer_size = size as usize;
}
}
Ok(())
}
fn get_output_name(&self, default_name: &str) -> String {
self.output_name.clone().unwrap_or_else(|| default_name.to_string())
}
}
impl CwdMetaPlugin {