pub struct CapabilityRegistry { /* private fields */ }Expand description
Registry that holds all available capability implementations.
The registry provides access to capabilities by ID and allows applying multiple capabilities to build a RuntimeAgent.
§Example
use everruns_core::capabilities::CapabilityRegistry;
let registry = CapabilityRegistry::with_builtins();
// Get a capability by ID
if let Some(cap) = registry.get("current_time") {
println!("Capability: {}", cap.name());
}
// List all available capabilities
for cap in registry.list() {
println!("{}: {}", cap.id(), cap.name());
}Implementations§
Source§impl CapabilityRegistry
impl CapabilityRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a registry with all built-in capabilities registered
Uses DeploymentGrade::from_env() to determine which capabilities to include.
For explicit control, use with_builtins_for_grade().
Sourcepub fn with_builtins_for_grade(grade: DeploymentGrade) -> Self
pub fn with_builtins_for_grade(grade: DeploymentGrade) -> Self
Create a registry with built-in capabilities for a specific deployment grade
Experimental capabilities are included via integration plugins in dev environments. Non-experimental integration plugins (like Daytona) are included in all environments.
Sourcepub fn register(&mut self, capability: impl Capability + 'static)
pub fn register(&mut self, capability: impl Capability + 'static)
Register a capability
Sourcepub fn register_boxed(&mut self, capability: Box<dyn Capability>)
pub fn register_boxed(&mut self, capability: Box<dyn Capability>)
Register a boxed capability
Sourcepub fn register_arc(&mut self, capability: Arc<dyn Capability>)
pub fn register_arc(&mut self, capability: Arc<dyn Capability>)
Register an Arc-wrapped capability
Sourcepub fn unregister(&mut self, id: &str) -> Option<Arc<dyn Capability>>
pub fn unregister(&mut self, id: &str) -> Option<Arc<dyn Capability>>
Remove a capability from the registry.
Sourcepub fn list(&self) -> Vec<&Arc<dyn Capability>>
pub fn list(&self) -> Vec<&Arc<dyn Capability>>
Get all registered capabilities
Sourcepub fn builder() -> CapabilityRegistryBuilder
pub fn builder() -> CapabilityRegistryBuilder
Create a builder for fluent capability registration
Sourcepub fn blueprint(&self, id: &str) -> Option<AgentBlueprint>
pub fn blueprint(&self, id: &str) -> Option<AgentBlueprint>
Find a blueprint by ID across all registered capabilities.
Returns a fresh AgentBlueprint (with new tool instances) each time.
Sourcepub fn blueprint_with_capability(
&self,
id: &str,
) -> Option<(String, AgentBlueprint)>
pub fn blueprint_with_capability( &self, id: &str, ) -> Option<(String, AgentBlueprint)>
Find a blueprint and the capability that registered it.
Returns (capability_id, blueprint) with fresh tool instances.
Sourcepub fn all_blueprints(&self) -> Vec<AgentBlueprint>
pub fn all_blueprints(&self) -> Vec<AgentBlueprint>
Collect all blueprints from all registered capabilities.
Trait Implementations§
Source§impl Clone for CapabilityRegistry
impl Clone for CapabilityRegistry
Source§fn clone(&self) -> CapabilityRegistry
fn clone(&self) -> CapabilityRegistry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CapabilityRegistry
impl Debug for CapabilityRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for CapabilityRegistry
impl !UnwindSafe for CapabilityRegistry
impl Freeze for CapabilityRegistry
impl Send for CapabilityRegistry
impl Sync for CapabilityRegistry
impl Unpin for CapabilityRegistry
impl UnsafeUnpin for CapabilityRegistry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> 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