pub struct AgentDescriptor {
pub id: CapabilityId,
pub name: String,
pub version: String,
pub description: String,
pub risk: RiskLevel,
pub metadata: BTreeMap<String, Value>,
}Expand description
Versioned contract for invoking an agent through a gateway.
Fields§
§id: CapabilityIdStable capability identity.
name: StringModel-facing delegation name.
version: StringSemantic contract version.
description: StringModel-facing description of when this agent should be used.
risk: RiskLevelCoarse risk classification for policy engines.
metadata: BTreeMap<String, Value>Host-only namespaced metadata.
Implementations§
Source§impl AgentDescriptor
impl AgentDescriptor
Sourcepub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self
Creates an agent contract with a fresh ephemeral capability identity.
Rebuilding this descriptor produces a different identity. Applications
that persist grants, policies, or audit records must restore the same
CapabilityId and call Self::with_id.
Sourcepub const fn with_id(self, id: CapabilityId) -> Self
pub const fn with_id(self, id: CapabilityId) -> Self
Replaces the capability identity with an application-owned stable ID.
The ID should be loaded from durable configuration or storage and reused across process restarts whenever grants or audit records outlive one process.
Sourcepub fn capability(&self) -> CapabilityDescriptor
pub fn capability(&self) -> CapabilityDescriptor
Converts this descriptor into a grantable agent capability.
Sourcepub fn model_spec(&self) -> ToolSpec
pub fn model_spec(&self) -> ToolSpec
Converts this descriptor into the callable shape exposed to a model.
Trait Implementations§
Source§impl Clone for AgentDescriptor
impl Clone for AgentDescriptor
Source§fn clone(&self) -> AgentDescriptor
fn clone(&self) -> AgentDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more