Skip to main content

PluginRegistry

Struct PluginRegistry 

Source
pub struct PluginRegistry { /* private fields */ }

Implementations§

Source§

impl PluginRegistry

Source

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.

Source

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).

Source

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

Source

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

Source

pub fn new(plugins_root: impl Into<PathBuf>) -> Self

Create a new registry backed by plugins_root (typically ~/.telos/plugins/).

Source

pub fn installed_dir(&self) -> PathBuf

Path where installed plugins live.

Source

pub fn state_path(&self) -> PathBuf

Path to the state file.

Source

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).

Source

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.

Source

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.

Source

pub fn mark_degraded(&mut self, id: &PluginId, errors: Vec<PluginError>)

Mark a plugin as degraded (enabled but with component load errors).

Source

pub fn mark_error(&mut self, id: &PluginId, error: PluginError)

Mark a plugin as in error state.

Source

pub fn remove(&mut self, id: &PluginId) -> Option<PluginEntry>

Remove a plugin from the registry entirely.

Source

pub fn get(&self, id: &PluginId) -> Option<&PluginEntry>

Look up a plugin by ID.

Source

pub fn get_mut(&mut self, id: &PluginId) -> Option<&mut PluginEntry>

Mutable lookup.

Source

pub fn list_enabled(&self) -> Vec<&PluginEntry>

All enabled plugins.

Source

pub fn list_disabled(&self) -> Vec<&PluginEntry>

All disabled plugins.

Source

pub fn list_all(&self) -> Vec<&PluginEntry>

All plugins regardless of status.

Source

pub fn is_installed(&self, id: &PluginId) -> bool

Check if a plugin is installed (present in registry, any status).

Source

pub fn len(&self) -> usize

Number of registered plugins.

Source

pub fn is_empty(&self) -> bool

Returns true if no plugins are registered.

Source§

impl PluginRegistry

Source

pub fn save_state(&self) -> Result<(), PluginError>

Save enabled/disabled state to plugin_state.json.

Source

pub fn load_state(&mut self) -> Result<(), PluginError>

Load enabled/disabled state from plugin_state.json.

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.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

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
§

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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,