feat: add finalization state tracking to meta plugins

Co-authored-by: aider (openai/andrew/openrouter/qwen/qwen3-coder) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-26 18:23:02 -03:00
parent 6574b5a072
commit bd879100be
3 changed files with 76 additions and 0 deletions

View File

@@ -161,6 +161,14 @@ pub trait MetaPlugin {
true
}
// Check if the plugin is already finalized
fn is_finalized(&self) -> bool {
false
}
// Set the finalized state (only for plugins that can track this)
fn set_finalized(&mut self, _finalized: bool) {}
// Update the meta plugin with new data
fn update(&mut self, _data: &[u8]) -> MetaPluginResponse {
// Default implementation does nothing
@@ -250,6 +258,11 @@ pub trait MetaPlugin {
self.configure_outputs(outputs)?;
Ok(())
}
// Method to downcast to concrete type (for checking finalization state)
fn as_any_mut(&mut self) -> &mut dyn std::any::Any {
self
}
}
pub fn get_meta_plugin(meta_plugin_type: MetaPluginType) -> Box<dyn MetaPlugin> {