pub struct PluginRegistry { /* private fields */ }Expand description
Plugin registry — manage installed plugins
Implementations§
Source§impl PluginRegistry
impl PluginRegistry
pub fn new() -> Self
Sourcepub fn tools(&self) -> &[Arc<dyn Tool>]
pub fn tools(&self) -> &[Arc<dyn Tool>]
Tools contributed by plugins during on_register.
LoopRunner::with_plugin_registry appends these to the agent’s tool
list. They were previously logged and dropped, so a plugin could
“register” a tool the agent could never call.
Sourcepub fn host_plugins(&self) -> &[HostPluginEntry]
pub fn host_plugins(&self) -> &[HostPluginEntry]
Host plugin directories found by ingest_host_plugins.
Sourcepub fn channels(&self) -> &ChannelRegistry
pub fn channels(&self) -> &ChannelRegistry
Every channel that can be selected by name — built-ins plus whatever
plugins registered during on_register.
Sourcepub fn ingest_host_plugins(&mut self, workspace: &Path, extra: &[PathBuf])
pub fn ingest_host_plugins(&mut self, workspace: &Path, extra: &[PathBuf])
Discover OpenClaw/Hermes plugin directories and keep them.
Kept, not just logged: host_plugins() is what feeds SKILL.md-bearing
plugin directories into skill discovery. A HostPluginEntry carries no
entrypoint, so a plugin whose manifest declares neither a skill nor an
in-process registration still does nothing — see docs/ before adding
an execution model for those.
Sourcepub async fn register(&mut self, plugin: Arc<dyn Plugin>)
pub async fn register(&mut self, plugin: Arc<dyn Plugin>)
Register a plugin and call its on_register with a PluginContext
Sourcepub fn register_sync(&mut self, plugin: Arc<dyn Plugin>)
pub fn register_sync(&mut self, plugin: Arc<dyn Plugin>)
Register a plugin without async (for tests, legacy)
Sourcepub fn register_hook(&mut self, hook: Arc<dyn LifecycleHook>)
pub fn register_hook(&mut self, hook: Arc<dyn LifecycleHook>)
Register a lifecycle hook directly (not from a plugin)
Sourcepub fn register_pre_tool_hook(&mut self, hook: Arc<dyn PreToolHook>)
pub fn register_pre_tool_hook(&mut self, hook: Arc<dyn PreToolHook>)
Register a pre-tool hook directly (not from a plugin)
Sourcepub fn hooks(&self) -> &HookManager
pub fn hooks(&self) -> &HookManager
Access the hook manager
Sourcepub async fn call(
&self,
plugin: &str,
method: &str,
params: Value,
) -> Result<Value, PluginError>
pub async fn call( &self, plugin: &str, method: &str, params: Value, ) -> Result<Value, PluginError>
Call a plugin method
Sourcepub fn info(&self, name: &str) -> Option<PluginInfo>
pub fn info(&self, name: &str) -> Option<PluginInfo>
Get plugin info
Sourcepub async fn emit(&self, event: &LifecycleEvent)
pub async fn emit(&self, event: &LifecycleEvent)
Emit lifecycle event to all registered hooks
Sourcepub async fn check_pre_tool(&self, name: &str, arguments: &str) -> HookDecision
pub async fn check_pre_tool(&self, name: &str, arguments: &str) -> HookDecision
Run pre-tool checks
Sourcepub async fn notify_post_tool(
&self,
name: &str,
arguments: &str,
result: &ToolResult,
)
pub async fn notify_post_tool( &self, name: &str, arguments: &str, result: &ToolResult, )
Notify post-tool hooks
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PluginRegistry
impl !UnwindSafe for PluginRegistry
impl Freeze for PluginRegistry
impl Send for PluginRegistry
impl Sync for PluginRegistry
impl Unpin for PluginRegistry
impl UnsafeUnpin for PluginRegistry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 more