Struct PluginHost
pub struct PluginHost { /* private fields */ }Expand description
Manages the lifecycle of WASM plugins.
Implementations§
Source§impl PluginHost
impl PluginHost
Sourcepub fn new(workspace_dir: &Path) -> Result<Self, PluginError>
pub fn new(workspace_dir: &Path) -> Result<Self, PluginError>
Create a new plugin host rooted at workspace_dir, scanning its
plugins/ subdirectory.
Sourcepub fn with_security(
workspace_dir: &Path,
signature_mode: SignatureMode,
trusted_publisher_keys: Vec<String>,
) -> Result<Self, PluginError>
pub fn with_security( workspace_dir: &Path, signature_mode: SignatureMode, trusted_publisher_keys: Vec<String>, ) -> Result<Self, PluginError>
Create a host rooted at workspace_dir (scanning workspace_dir/plugins)
with signature verification settings.
Sourcepub fn from_plugins_dir(plugins_dir: &Path) -> Result<Self, PluginError>
pub fn from_plugins_dir(plugins_dir: &Path) -> Result<Self, PluginError>
Create a host that scans plugins_dir directly (no plugins/ suffix is
appended). Use this when the caller already holds the fully resolved
plugin directory, e.g. PluginsConfig::resolved_plugins_dir().
Sourcepub fn from_plugins_dir_with_security(
plugins_dir: &Path,
signature_mode: SignatureMode,
trusted_publisher_keys: Vec<String>,
) -> Result<Self, PluginError>
pub fn from_plugins_dir_with_security( plugins_dir: &Path, signature_mode: SignatureMode, trusted_publisher_keys: Vec<String>, ) -> Result<Self, PluginError>
Self::from_plugins_dir with signature verification settings.
pub fn parse_signature_mode(mode: &str) -> Option<SignatureMode>
pub fn resolve_signature_mode(mode: &str) -> SignatureMode
Sourcepub fn list_plugins(&self) -> Vec<PluginInfo>
pub fn list_plugins(&self) -> Vec<PluginInfo>
List all discovered plugins.
Sourcepub fn get_plugin(&self, name: &str) -> Option<PluginInfo>
pub fn get_plugin(&self, name: &str) -> Option<PluginInfo>
Get info about a specific plugin.
Sourcepub fn install(&mut self, source: &str) -> Result<String, PluginError>
pub fn install(&mut self, source: &str) -> Result<String, PluginError>
Install a plugin from a directory path. Returns the installed plugin’s manifest name so callers can key follow-up work (config seeding, messaging) off the canonical name rather than the source path.
Sourcepub fn tool_plugins(&self) -> Vec<&PluginManifest>
pub fn tool_plugins(&self) -> Vec<&PluginManifest>
Get tool-capable plugins.
Sourcepub fn tool_plugin_details(&self) -> Vec<(&PluginManifest, &Path)>
pub fn tool_plugin_details(&self) -> Vec<(&PluginManifest, &Path)>
Get tool-capable plugins with their resolved WASM file paths.
Returns (manifest, resolved_wasm_path) tuples for building WasmTools.
Tool plugins without a wasm_path are skipped.
Sourcepub fn channel_plugins(&self) -> Vec<&PluginManifest>
pub fn channel_plugins(&self) -> Vec<&PluginManifest>
Get channel-capable plugins.
pub fn channel_plugin_details(&self) -> Vec<(&PluginManifest, &Path)>
Sourcepub fn skill_plugins(&self) -> Vec<&PluginManifest>
pub fn skill_plugins(&self) -> Vec<&PluginManifest>
Get skill-capable plugins.
pub fn skill_plugin_details(&self) -> Vec<(&PluginManifest, PathBuf)>
Sourcepub fn plugins_dir(&self) -> &Path
pub fn plugins_dir(&self) -> &Path
Returns the plugins directory path.