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 (appended after the agent’s base 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 more