Skip to main content

vtcode_core/plugins/
mod.rs

1//! Plugin system for VT Code
2//!
3//! This module provides a comprehensive plugin system that supports:
4//! - Commands (slash commands)
5//! - Agents (specialized profiles)
6//! - Skills (model-invoked capabilities)
7//! - Hooks (event handlers)
8//! - MCP servers (Model Context Protocol)
9
10pub mod caching;
11pub mod components;
12pub mod directory;
13pub mod loader;
14pub mod manager;
15pub mod manifest;
16pub mod runtime;
17pub mod validation;
18
19pub use caching::*;
20pub use components::*;
21pub use directory::*;
22pub use loader::*;
23pub use manager::*;
24pub use manifest::*;
25pub use runtime::*;
26pub use validation::*;
27
28/// Type alias for plugin identifiers
29pub type PluginId = String;
30
31/// Type alias for plugin names
32pub type PluginName = String;
33
34/// Plugin loading result
35pub type PluginResult<T> = Result<T, PluginError>;
36
37#[cfg(test)]
38mod tests {
39    // Intentionally empty test module for compilation check
40
41    #[test]
42    fn test_plugin_system_compilation() {
43        // This test just verifies that the plugin system compiles
44    }
45}
46
47/// Plugin error types
48#[derive(Debug, thiserror::Error)]
49pub enum PluginError {
50    #[error("Plugin manifest validation failed: {0}")]
51    ManifestValidationError(String),
52
53    #[error("Plugin not found: {0}")]
54    NotFound(PluginId),
55
56    #[error("Plugin already exists: {0}")]
57    AlreadyExists(PluginId),
58
59    #[error("Plugin loading failed: {0}")]
60    LoadingError(String),
61
62    #[error("Plugin execution failed: {0}")]
63    ExecutionError(String),
64
65    #[error("Plugin permission denied: {0}")]
66    PermissionDenied(String),
67
68    #[error("Plugin configuration error: {0}")]
69    ConfigurationError(String),
70
71    #[error("I/O error: {0}")]
72    IoError(#[from] std::io::Error),
73
74    #[error("JSON serialization error: {0}")]
75    JsonError(#[from] serde_json::Error),
76
77    #[error("TOML serialization error: {0}")]
78    TomlError(#[from] toml::de::Error),
79}