pub struct PluginManager { /* private fields */ }Expand description
Manages plugin lifecycle: install, remove, list.
All operations are synchronous. Plugin watchers and agent config overlays are applied separately by the agent bootstrap layer.
Implementations§
Source§impl PluginManager
impl PluginManager
Sourcepub fn default_plugins_dir() -> PathBuf
pub fn default_plugins_dir() -> PathBuf
Returns the canonical default plugins directory: ~/.local/share/zeph/plugins/.
Both the CLI and TUI must use this helper so they always point to the same directory.
Sourcepub fn new(
plugins_dir: PathBuf,
managed_skills_dir: PathBuf,
mcp_allowed_commands: Vec<String>,
base_allowed_commands: Vec<String>,
) -> Self
pub fn new( plugins_dir: PathBuf, managed_skills_dir: PathBuf, mcp_allowed_commands: Vec<String>, base_allowed_commands: Vec<String>, ) -> Self
Create a new manager.
§Parameters
plugins_dir— root installation directory for plugins.managed_skills_dir— directory for user-managed skills (conflict detection).mcp_allowed_commands— allowlist for MCP server commands from agent config.base_allowed_commands— host’stools.shell.allowed_commands. Used to emit a non-fatal warning when a plugin overlay would be silently dropped at load time (tighten-only invariant).
Sourcepub fn add(&self, source: &str) -> Result<AddResult, PluginError>
pub fn add(&self, source: &str) -> Result<AddResult, PluginError>
Install a plugin from a local directory path.
§Errors
Returns PluginError if the manifest is invalid, the source cannot be read,
there are skill name conflicts, MCP commands are not allowlisted, or config
overlay keys are not in the tighten-only safelist.
Sourcepub fn remove(&self, name: &str) -> Result<RemoveResult, PluginError>
pub fn remove(&self, name: &str) -> Result<RemoveResult, PluginError>
Remove an installed plugin by name.
§Errors
Returns PluginError::NotFound if the plugin is not installed.
Sourcepub fn list_installed(&self) -> Result<Vec<InstalledPlugin>, PluginError>
pub fn list_installed(&self) -> Result<Vec<InstalledPlugin>, PluginError>
Sourcepub fn collect_skill_dirs(&self) -> Result<Vec<PathBuf>, PluginError>
pub fn collect_skill_dirs(&self) -> Result<Vec<PathBuf>, PluginError>
Returns all skill directory paths from installed plugins.
§Errors
Returns PluginError if the plugins directory cannot be read.
Auto Trait Implementations§
impl Freeze for PluginManager
impl RefUnwindSafe for PluginManager
impl Send for PluginManager
impl Sync for PluginManager
impl Unpin for PluginManager
impl UnsafeUnpin for PluginManager
impl UnwindSafe for PluginManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request