pub struct CapabilityLocalization {
pub locale: &'static str,
pub name: Option<&'static str>,
pub description: Option<&'static str>,
pub config_description: Option<&'static str>,
pub config_overlay: Option<Value>,
}Expand description
Trait for implementing capabilities that extend agent functionality.
A capability can contribute:
- System prompt additions (prepended to agent’s system prompt)
- Tools (added to agent’s available tools)
§System Prompt Contributions
Capabilities provide system prompt content via system_prompt_contribution().
This async method receives a SystemPromptContext with access to the session
filesystem, allowing capabilities to generate dynamic content (e.g., reading
AGENTS.md or scanning for skills).
The default implementation wraps the static system_prompt_addition() text
in <capability id="..."> XML tags. Capabilities that need dynamic content
override system_prompt_contribution() directly.
§Example
use everruns_core::capabilities::Capability;
struct CurrentTimeCapability;
impl Capability for CurrentTimeCapability {
fn id(&self) -> &str {
"current_time"
}
fn name(&self) -> &str {
"Current Time"
}
fn description(&self) -> &str {
"Provides tools to get the current date and time."
}
fn tools(&self) -> Vec<Box<dyn Tool>> {
vec![Box::new(GetCurrentTimeTool)]
}
}Localized display strings for one locale.
Base English strings stay in name() / description() / config_schema();
localizations are additive overlays, so adding a locale never changes the
Capability trait contract for existing implementations.
Fields§
§locale: &'static strLanguage tag this entry applies to, lowercase (e.g. "uk" or "uk-ua").
name: Option<&'static str>Localized display name; None falls back to name().
description: Option<&'static str>Localized description; None falls back to description().
config_description: Option<&'static str>One-line summary of what this capability’s config controls.
Provide an "en" entry for the base locale; capabilities without
config leave this None everywhere.
config_overlay: Option<Value>Overlay merged into config_schema() by clients before rendering.
Mirrors JSON Schema structure (properties / items nesting); nodes
carry title, description, and enum_labels (map from enum value
to localized label, applied to oneOf const/title entries).
Implementations§
Trait Implementations§
Source§impl Clone for CapabilityLocalization
impl Clone for CapabilityLocalization
Source§fn clone(&self) -> CapabilityLocalization
fn clone(&self) -> CapabilityLocalization
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CapabilityLocalization
impl RefUnwindSafe for CapabilityLocalization
impl Send for CapabilityLocalization
impl Sync for CapabilityLocalization
impl Unpin for CapabilityLocalization
impl UnsafeUnpin for CapabilityLocalization
impl UnwindSafe for CapabilityLocalization
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