fix: remove duplicate meta_type and replace meta_name with meta_type
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -110,7 +110,7 @@ pub fn generate_status_info(
|
|||||||
|
|
||||||
// Get meta name first to avoid borrowing issues
|
// Get meta name first to avoid borrowing issues
|
||||||
log::debug!("STATUS: Getting meta name...");
|
log::debug!("STATUS: Getting meta name...");
|
||||||
let meta_name = meta_plugin.meta_name();
|
let meta_name = meta_plugin.meta_type().to_string();
|
||||||
log::debug!("STATUS: Got meta name: {}", meta_name);
|
log::debug!("STATUS: Got meta name: {}", meta_name);
|
||||||
|
|
||||||
// Note: In status mode we don't have access to actual settings,
|
// Note: In status mode we don't have access to actual settings,
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use std::io::Write;
|
|||||||
use std::process::{Command, Stdio, Child};
|
use std::process::{Command, Stdio, Child};
|
||||||
use which::which;
|
use which::which;
|
||||||
|
|
||||||
use crate::meta_plugin::{MetaPlugin, MetaPluginResponse};
|
use crate::meta_plugin::{MetaPlugin, MetaPluginResponse, MetaPluginType};
|
||||||
|
|
||||||
pub struct MetaPluginCommand {
|
pub struct MetaPluginCommand {
|
||||||
pub program: String,
|
pub program: String,
|
||||||
@@ -23,7 +23,6 @@ impl std::fmt::Debug for MetaPluginCommand {
|
|||||||
.field("program", &self.program)
|
.field("program", &self.program)
|
||||||
.field("args", &self.args)
|
.field("args", &self.args)
|
||||||
.field("supported", &self.supported)
|
.field("supported", &self.supported)
|
||||||
.field("meta_name", &self.meta_name)
|
|
||||||
.field("split_whitespace", &self.split_whitespace)
|
.field("split_whitespace", &self.split_whitespace)
|
||||||
.field("process", &self.process)
|
.field("process", &self.process)
|
||||||
.field("writer", &"Box<dyn Write>")
|
.field("writer", &"Box<dyn Write>")
|
||||||
|
|||||||
@@ -95,6 +95,12 @@ impl BaseMetaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl MetaPlugin for BaseMetaPlugin {
|
impl MetaPlugin for BaseMetaPlugin {
|
||||||
|
fn meta_type(&self) -> MetaPluginType {
|
||||||
|
// This is a base implementation, so we need to return something
|
||||||
|
// This might not be used, but we need to satisfy the trait
|
||||||
|
MetaPluginType::Binary
|
||||||
|
}
|
||||||
|
|
||||||
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
|
fn outputs(&self) -> &std::collections::HashMap<String, serde_yaml::Value> {
|
||||||
&self.outputs
|
&self.outputs
|
||||||
}
|
}
|
||||||
@@ -215,8 +221,6 @@ pub trait MetaPlugin where Self: 'static {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn meta_type(&self) -> MetaPluginType;
|
|
||||||
|
|
||||||
// Get program information for display in status
|
// Get program information for display in status
|
||||||
fn program_info(&self) -> Option<(&str, Vec<&str>)> {
|
fn program_info(&self) -> Option<(&str, Vec<&str>)> {
|
||||||
None
|
None
|
||||||
@@ -291,7 +295,7 @@ pub fn get_meta_plugin(
|
|||||||
// For command type, we need to parse the command from options
|
// For command type, we need to parse the command from options
|
||||||
let mut program_name = String::new();
|
let mut program_name = String::new();
|
||||||
let mut args = Vec::new();
|
let mut args = Vec::new();
|
||||||
let meta_name = MetaPluginType::Command.to_string();
|
let mut meta_name = MetaPluginType::Command.to_string();
|
||||||
let mut split_whitespace = true;
|
let mut split_whitespace = true;
|
||||||
|
|
||||||
if let Some(opts) = &options {
|
if let Some(opts) = &options {
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ pub fn settings_meta_plugin_types(cmd: &mut Command, settings: &config::Settings
|
|||||||
let mut found = false;
|
let mut found = false;
|
||||||
for meta_plugin_type in MetaPluginType::iter() {
|
for meta_plugin_type in MetaPluginType::iter() {
|
||||||
let meta_plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type.clone(), None, None);
|
let meta_plugin = crate::meta_plugin::get_meta_plugin(meta_plugin_type.clone(), None, None);
|
||||||
if meta_plugin.meta_name() == trimmed_name {
|
if meta_plugin.meta_type().to_string() == trimmed_name {
|
||||||
meta_plugin_types.push(meta_plugin_type);
|
meta_plugin_types.push(meta_plugin_type);
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ impl MetaService {
|
|||||||
let mut output_names: std::collections::HashMap<String, Vec<String>> = std::collections::HashMap::new();
|
let mut output_names: std::collections::HashMap<String, Vec<String>> = std::collections::HashMap::new();
|
||||||
|
|
||||||
for plugin in plugins.iter() {
|
for plugin in plugins.iter() {
|
||||||
let plugin_name = plugin.meta_name();
|
let plugin_name = plugin.meta_type().to_string();
|
||||||
// For each plugin, collect all the output names it might write to
|
// For each plugin, collect all the output names it might write to
|
||||||
for (internal_name, output_config) in plugin.outputs() {
|
for (internal_name, output_config) in plugin.outputs() {
|
||||||
let output_name = match output_config {
|
let output_name = match output_config {
|
||||||
|
|||||||
Reference in New Issue
Block a user