Skip to main content

PluginManager

Struct PluginManager 

Source
pub struct PluginManager {
    pub working_dir: Option<PathBuf>,
    pub paths: PluginPaths,
}
Expand description

Plugin manager: discovers, installs, and manages plugins.

Fields§

§working_dir: Option<PathBuf>

Working directory for path resolution.

§paths: PluginPaths

Resolved paths.

Implementations§

Source§

impl PluginManager

Source

pub fn new(working_dir: Option<PathBuf>) -> Self

Create a new PluginManager.

Source

pub fn discover_plugins(&self) -> Result<Vec<PluginManifest>>

Discover plugins from both project and global plugin directories. Scans each directory for subdirectories containing a manifest.json.

Source

pub fn load_manifest(&self, plugin_dir: &Path) -> Result<PluginManifest>

Load a plugin manifest from a directory. Checks multiple possible locations for manifest.json.

Source

pub fn install_plugin( &self, plugin_name: &str, marketplace_name: &str, scope: PluginScope, ) -> Result<PluginConfig>

Install a plugin from a marketplace into the plugins directory.

Source

pub fn uninstall_plugin( &self, plugin_name: &str, marketplace_name: &str, scope: PluginScope, ) -> Result<()>

Uninstall a plugin.

Source

pub fn enable_plugin( &self, plugin_name: &str, marketplace_name: &str, scope: PluginScope, ) -> Result<()>

Enable a disabled plugin.

Source

pub fn disable_plugin( &self, plugin_name: &str, marketplace_name: &str, scope: PluginScope, ) -> Result<()>

Disable a plugin.

Source

pub fn list_installed( &self, scope: Option<PluginScope>, ) -> Result<Vec<PluginConfig>>

List all installed plugins, optionally filtering by scope.

Source

pub fn load_known_marketplaces(&self) -> Result<KnownMarketplaces>

Load the known marketplaces registry from disk.

Source

pub fn save_known_marketplaces( &self, marketplaces: &KnownMarketplaces, ) -> Result<()>

Save the known marketplaces registry to disk.

Source

pub fn load_installed_plugins( &self, scope: PluginScope, ) -> Result<InstalledPlugins>

Load the installed plugins registry from disk.

Source

pub fn save_installed_plugins( &self, plugins: &InstalledPlugins, scope: PluginScope, ) -> Result<()>

Save the installed plugins registry to disk.

Source

pub fn load_plugin_metadata(&self, plugin_dir: &Path) -> Result<PluginMetadata>

Load plugin metadata from a plugin.json file in the given directory.

Source

pub fn parse_skill_metadata(skill_file: &Path) -> (String, String)

Parse SKILL.md frontmatter for name and description.

Source

pub fn discover_skills_in_dir(plugin_dir: &Path) -> Vec<String>

Discover skill names in a plugin directory.

Source

pub fn extract_name_from_url(url: &str) -> String

Extract a name from a git URL.

Source§

impl PluginManager

Source

pub fn add_marketplace( &self, url: &str, name: Option<&str>, branch: &str, ) -> Result<MarketplaceInfo>

Add a marketplace by recording its info and cloning its repository. In this Rust port the actual git clone is performed synchronously via std::process::Command.

Source

pub fn remove_marketplace(&self, name: &str) -> Result<()>

Remove a marketplace.

Source

pub fn list_marketplaces(&self) -> Result<Vec<MarketplaceInfo>>

List all registered marketplaces.

Source

pub fn sync_marketplace(&self, name: &str) -> Result<()>

Sync (git pull) a marketplace.

Source

pub fn sync_all_marketplaces(&self) -> Result<HashMap<String, Option<String>>>

Sync all registered marketplaces. Returns a map of name to optional error message.

Source

pub fn get_marketplace_catalog(&self, name: &str) -> Result<MarketplaceCatalog>

Get the plugin catalog from a marketplace. If no marketplace.json exists, auto-discovers plugins from plugins/ and skills/ dirs.

Source

pub fn list_marketplace_plugins( &self, name: &str, ) -> Result<Vec<PluginMetadata>>

List all plugins available in a marketplace.

Source

pub fn search_marketplace( &self, marketplace_name: &str, query: &str, ) -> Result<Vec<PluginMetadata>>

Search marketplace plugins by query string. Simple substring match on name/description.

Source

pub async fn fetch_remote_catalog( registry_url: &str, ) -> Result<MarketplaceCatalog>

Fetch a marketplace catalog from a remote HTTP registry URL.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more