Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
PluginManager
Defined in the plugins module.
Rust AI Agent SDK
Manages plugin registration and execution.
Fields
| Name | Type | Description |
|---|
plugins | HashMap<String | Registered plugins |
enabled | HashMap<String | Enabled plugins |
hook_map | HashMap<PluginHook | Hook to plugin mapping |
Methods
new
Create a new plugin manager
register
fn register(&mut self, plugin: impl Plugin + 'static) -> ()
Register a plugin
Parameters:
| Name | Type |
|---|
plugin | impl Plugin + 'static |
enable
fn enable(&mut self, name: &str) -> bool
Enable a plugin
Parameters:
disable
fn disable(&mut self, name: &str) -> bool
Disable a plugin
Parameters:
is_enabled
fn is_enabled(&self, name: &str) -> bool
Check if a plugin is enabled
Parameters:
list_plugins
fn list_plugins(&self) -> Vec<PluginInfo>
List all plugins
get
fn get(&self, name: &str) -> Option<Arc<RwLock<Box<dyn Plugin>>>>
Get plugin by name
Parameters:
execute_hook
fn execute_hook(
&self,
hook: PluginHook,
data: serde_json::Value,
) -> Result<serde_json::Value>
Execute hooks for a specific hook type
Parameters:
| Name | Type |
|---|
hook | PluginHook |
data | serde_json::Value |
get_hook_plugins
fn get_hook_plugins(&self, hook: PluginHook) -> Vec<String>
Get plugins that handle a specific hook
Parameters:
len
Count registered plugins
is_empty
fn is_empty(&self) -> bool
Check if empty
enabled_count
fn enabled_count(&self) -> usize
Count enabled plugins
Source
View on GitHub
praisonai/src/plugins/mod.rs at line 258