Skip to main content

Capabilities

Struct Capabilities 

Source
pub struct Capabilities {
Show 13 fields pub schema_version: String, pub tier: String, pub version: String, pub features: CapabilityFeatures, pub models: CapabilityModels, pub permissions: CapabilityPermissions, pub hooks: CapabilityHooks, pub compaction: CapabilityCompaction, pub approval: CapabilityApproval, pub transcripts: CapabilityTranscripts, pub hnsw: CapabilityHnsw, pub kg_backend: Option<String>, pub memory_kinds: Vec<String>,
}
Expand description

Top-level capabilities report for a running instance.

Schema versions:

  • v1 (legacy, pre-v0.6.3.1): tier, version, features, models. Reachable via Accept-Capabilities: v1 (HTTP) or the MCP accept argument set to "v1". See CapabilitiesV1.
  • v2 (v0.6.3.1 honesty patch): schema_version="2" plus the permissions, hooks, compaction, approval, transcripts blocks. v1 fields preserved at the same top-level paths — old clients that read v2 by name continue to work for the un-dropped fields. Default response shape.

v2 honesty patch (P1, v0.6.3.1):

  • features.recall_mode_active and features.reranker_active are runtime state, not config-derived flags.
  • features.memory_reflection is now a {planned, version, enabled} object, not a bool.
  • compaction and transcripts carry the same planned-feature shape so operators can distinguish “disabled but built” from “not in this build.”
  • permissions.mode = "advisory" until the enforcement gate ships in P4. Was "ask", which implied an active interactive loop.
  • The following fields were removed because no backing implementation exists: permissions.rule_summary, hooks.by_event, approval.subscribers, approval.default_timeout_seconds.

Fields§

§schema_version: String

Schema-version discriminator. Always "2" since v0.6.3.

§tier: String§version: String§features: CapabilityFeatures§models: CapabilityModels§permissions: CapabilityPermissions

Active permission/governance rules. Pre-P4 reports the count of namespaces that have a metadata.governance policy attached to their standard memory; the underlying permission system itself is P4 work.

§hooks: CapabilityHooks

Registered hooks. Pre-v0.7 reports webhook subscriptions as a proxy (hook system itself is v0.7 Bucket 0).

§compaction: CapabilityCompaction

Compaction state. v0.8 work — reports {planned, version, enabled} until the subsystem ships.

§approval: CapabilityApproval

Approval API state. Reports the live count of pending actions from the existing pending_actions table.

§transcripts: CapabilityTranscripts

Sidechain-transcript state. v0.7 Bucket 1.7 work — reports {planned, version, enabled} until the subsystem ships.

§hnsw: CapabilityHnsw

v0.6.3.1 (P3, G2): HNSW vector-index health. Defaults to a quiet zero-state report; the MCP/HTTP capabilities wrapper overwrites with live process counters when the index module has run an eviction.

§kg_backend: Option<String>

v0.7 J1 — knowledge-graph backend tag. "age" when a Postgres SAL adapter probed Apache AGE successfully at connect time; "cte" when the deployment falls back to the recursive-CTE path (every SQLite deployment + Postgres without AGE installed). None when no SAL adapter is wired (the active dispatch path through the legacy crate::db free functions pre-J2). Operators consult this through ai-memory doctor and memory_capabilities to verify which traversal path their daemon actually runs. Skipped from the JSON wire when None so v1 / v2 clients that don’t know the field round-trip cleanly.

§memory_kinds: Vec<String>

L1-1 (v0.7.0) — the set of typed memory kinds this binary supports. Always ["observation", "reflection"] for v0.7.0; Goal/Plan/Step/Decision land in L1-6/v0.8.0. Callers that want to enumerate valid values for a memory_kind filter should consult this field rather than hardcoding the list.

#[serde(default)] keeps older capabilities consumers that don’t know the field from breaking.

Implementations§

Source§

impl Capabilities

Source

pub fn to_v1(&self) -> CapabilitiesV1

Project the v2 report down to the legacy v1 shape. Used to honour Accept-Capabilities: v1 from older clients.

memory_reflection collapses from {planned, enabled} to a single bool (enabled value). All v2-only fields (recall_mode_active, reranker_active, permissions, hooks, compaction, approval, transcripts) are dropped.

Source

pub fn to_v3( &self, summary: String, to_describe_to_user: String, tools: Vec<ToolEntry>, agent_permitted_families: Option<Vec<String>>, your_harness_supports_deferred_registration: Option<bool>, ) -> CapabilitiesV3

v0.7.0 (A1+A2+A3+A4): project the report into the v3 shape.

v3 = v2 +

  • top-level summary (A1) — terse description of operational access plus the three named recovery paths.
  • top-level to_describe_to_user (A2) — plain-English end-user-facing sentence the LLM should repeat verbatim when asked “what tools do you have?”. No MCP jargon.
  • top-level tools (A3) — per-tool array carrying name, family, loaded, and callable_now. callable_now combines profile-side loaded-state with the [mcp.allowlist] agent-can-call decision so an LLM that keeps a manifest cache doesn’t need to ask twice to know whether a tool will resolve.
  • top-level agent_permitted_families (A4, optional) — when the [mcp.allowlist] is enabled AND an agent_id is provided, lists the family names the requesting agent is allowed to access (collapses every callable_now=true entry’s family to a unique list). When the allowlist is disabled or no agent_id is provided, the field is omitted from the wire (so v2-shaped consumers see no churn from A4 alone).

All four are computed by the caller from the live Profile + McpConfig + agent_id state because the Capabilities struct itself doesn’t know which families the MCP server actually advertised or which agent is asking.

A5 bumps the default wire shape to v3. v2 stays supported indefinitely.

Trait Implementations§

Source§

impl Clone for Capabilities

Source§

fn clone(&self) -> Capabilities

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Capabilities

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Capabilities

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Capabilities

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

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

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

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + 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
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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