1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
// Plugin command implementation
use crate::cli::PluginCommand;
use crate::ui::UI;
use anyhow::Result;
use vx_plugin::PluginRegistry;
pub async fn handle(registry: &PluginRegistry, command: PluginCommand) -> Result<()> {
// TODO: Replace with vx-core tool manager
// let tool_manager = crate::tool_manager::ToolManager::new()
// .or_else(|_| crate::tool_manager::ToolManager::minimal())?;
match command {
PluginCommand::List {
enabled: _,
category: _,
} => {
UI::header("Available Plugins");
let plugins = registry.list_plugins();
if plugins.is_empty() {
UI::warn("No plugins registered");
return Ok(());
}
for plugin_name in plugins {
UI::item(&format!("📦 {}", plugin_name));
}
// for tool in tools {
// let status_icon = if tool.installed { "✅" } else { "❌" };
// let version_str = tool
// .version
// .as_ref()
// .map(|v| format!(" ({v})"))
// .unwrap_or_default();
// println!(
// " {} {} - {}{}",
// status_icon, tool.name, tool.description, version_str
// );
// if let Some(homepage) = &tool.homepage {
// println!(" 🌐 {homepage}");
// }
// }
}
PluginCommand::Info { name } => {
UI::header(&format!("Tool: {name}"));
UI::warning("Plugin info not yet implemented in new architecture");
// match tool_manager.get_tool_info(&name) {
// Ok(info) => {
// UI::header(&format!("Tool: {}", info.name));
// println!("Description: {}", info.description);
// println!("Installed: {}", if info.installed { "Yes" } else { "No" });
// if let Some(version) = &info.version {
// println!("Version: {version}");
// }
// if let Some(homepage) = &info.homepage {
// println!("Homepage: {homepage}");
// }
// println!(
// "Auto-install: {}",
// if info.supports_auto_install {
// "Yes"
// } else {
// "No"
// }
// );
// }
// Err(e) => {
// UI::error(&format!("Tool not found: {e}"));
// }
// }
}
PluginCommand::Enable { name: _ } => {
UI::warning("Enable/disable commands not applicable to the new tool system");
UI::hint("All tools are automatically available");
}
PluginCommand::Disable { name: _ } => {
UI::warning("Enable/disable commands not applicable to the new tool system");
UI::hint("All tools are automatically available");
}
PluginCommand::Search { query } => {
UI::header(&format!("Tools matching '{query}'"));
UI::warning("Plugin search not yet implemented in new architecture");
// let tools = tool_manager.get_all_tools();
// let matching_tools: Vec<_> = tools
// .into_iter()
// .filter(|tool| {
// tool.name.contains(&query)
// || tool
// .description
// .to_lowercase()
// .contains(&query.to_lowercase())
// })
// .collect();
// if matching_tools.is_empty() {
// UI::info(&format!("No tools found matching '{query}'"));
// } else {
// UI::header(&format!("Tools matching '{query}'"));
// for tool in matching_tools {
// println!(" * {} - {}", tool.name, tool.description);
// }
// }
}
PluginCommand::Stats => {
UI::header("Tool Statistics");
UI::warning("Plugin stats not yet implemented in new architecture");
// let tools = tool_manager.get_all_tools();
// let total = tools.len();
// let installed = tools.iter().filter(|t| t.installed).count();
// let auto_install = tools.iter().filter(|t| t.supports_auto_install).count();
// UI::header("Tool Statistics");
// println!(" Total tools: {total}");
// println!(" Installed tools: {installed}");
// println!(" Not installed: {}", total - installed);
// println!(" Support auto-install: {auto_install}");
}
}
Ok(())
}