pub struct PluginRegistry { /* private fields */ }Implementations§
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn apply(
&self,
tools: &mut ToolRegistry,
policies: &mut PolicyRegistry,
command_env: &HashMap<String, String>,
skills: &mut SkillRegistry,
mcp: &mut McpManager,
prompt: &mut PromptAssembly,
) -> Result<(), Vec<PluginError>>
pub fn apply( &self, tools: &mut ToolRegistry, policies: &mut PolicyRegistry, command_env: &HashMap<String, String>, skills: &mut SkillRegistry, mcp: &mut McpManager, prompt: &mut PromptAssembly, ) -> Result<(), Vec<PluginError>>
Apply all enabled plugins’ components into the agent extension registries.
§Namespacing
Plugin tools are registered as plugin__<plugin_name>__<tool_name> to
avoid conflicts with built-in tools.
§Errors
Returns a list of per-plugin errors. Plugins that fail component loading are marked Degraded; their successfully-loaded components remain active.
Sourcepub fn apply_prompt_sections(&self, prompt: &mut PromptAssembly)
pub fn apply_prompt_sections(&self, prompt: &mut PromptAssembly)
Re-apply only prompt sections from enabled plugins into a prompt assembly.
This is a lighter variant of apply — it does not
re-register tools, policies, skills, or MCP servers. Useful when the
prompt assembly is rebuilt (e.g. after tools change).
Sourcepub fn apply_subagents(
&self,
subagents: &mut SubagentRegistry,
) -> Result<(), Vec<PluginError>>
pub fn apply_subagents( &self, subagents: &mut SubagentRegistry, ) -> Result<(), Vec<PluginError>>
Apply enabled plugin agent definitions into a subagent registry.
Plugin agents are registered as <plugin_name>:<agent_name> so they do
not collide with built-in, project, or user agent names.
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn discover_installed(&mut self) -> Result<Vec<PluginId>, PluginError>
pub fn discover_installed(&mut self) -> Result<Vec<PluginId>, PluginError>
Scan the installed directory and load all plugins found there.
Each subdirectory that contains a plugin.json is loaded.
Plugins are NOT auto-enabled — state is restored from plugin_state.json.
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn new(plugins_root: impl Into<PathBuf>) -> Self
pub fn new(plugins_root: impl Into<PathBuf>) -> Self
Create a new registry backed by plugins_root (typically ~/.telos/plugins/).
Sourcepub fn installed_dir(&self) -> PathBuf
pub fn installed_dir(&self) -> PathBuf
Path where installed plugins live.
Sourcepub fn state_path(&self) -> PathBuf
pub fn state_path(&self) -> PathBuf
Path to the state file.
Sourcepub fn register(&mut self, plugin: LoadedPlugin)
pub fn register(&mut self, plugin: LoadedPlugin)
Register a loaded plugin without enabling it.
If a plugin with the same ID already exists, it is replaced (the old plugin’s state is lost).
Sourcepub fn enable(&mut self, id: &PluginId) -> Result<(), PluginError>
pub fn enable(&mut self, id: &PluginId) -> Result<(), PluginError>
Enable a plugin. Call this after registration.
This is idempotent — enabling an already-enabled plugin is a no-op.
Sourcepub fn disable(&mut self, id: &PluginId) -> Result<(), PluginError>
pub fn disable(&mut self, id: &PluginId) -> Result<(), PluginError>
Disable a plugin. Does not uninstall — the plugin stays on disk.
This is idempotent — disabling an already-disabled plugin is a no-op.
Sourcepub fn mark_degraded(&mut self, id: &PluginId, errors: Vec<PluginError>)
pub fn mark_degraded(&mut self, id: &PluginId, errors: Vec<PluginError>)
Mark a plugin as degraded (enabled but with component load errors).
Sourcepub fn mark_error(&mut self, id: &PluginId, error: PluginError)
pub fn mark_error(&mut self, id: &PluginId, error: PluginError)
Mark a plugin as in error state.
Sourcepub fn remove(&mut self, id: &PluginId) -> Option<PluginEntry>
pub fn remove(&mut self, id: &PluginId) -> Option<PluginEntry>
Remove a plugin from the registry entirely.
Sourcepub fn get(&self, id: &PluginId) -> Option<&PluginEntry>
pub fn get(&self, id: &PluginId) -> Option<&PluginEntry>
Look up a plugin by ID.
Sourcepub fn get_mut(&mut self, id: &PluginId) -> Option<&mut PluginEntry>
pub fn get_mut(&mut self, id: &PluginId) -> Option<&mut PluginEntry>
Mutable lookup.
Sourcepub fn list_enabled(&self) -> Vec<&PluginEntry>
pub fn list_enabled(&self) -> Vec<&PluginEntry>
All enabled plugins.
Sourcepub fn list_disabled(&self) -> Vec<&PluginEntry>
pub fn list_disabled(&self) -> Vec<&PluginEntry>
All disabled plugins.
Sourcepub fn list_all(&self) -> Vec<&PluginEntry>
pub fn list_all(&self) -> Vec<&PluginEntry>
All plugins regardless of status.
Sourcepub fn is_installed(&self, id: &PluginId) -> bool
pub fn is_installed(&self, id: &PluginId) -> bool
Check if a plugin is installed (present in registry, any status).
Source§impl PluginRegistry
impl PluginRegistry
Sourcepub fn save_state(&self) -> Result<(), PluginError>
pub fn save_state(&self) -> Result<(), PluginError>
Save enabled/disabled state to plugin_state.json.
Sourcepub fn load_state(&mut self) -> Result<(), PluginError>
pub fn load_state(&mut self) -> Result<(), PluginError>
Load enabled/disabled state from plugin_state.json.