pub struct SkillCard {Show 14 fields
pub id: String,
pub symbol: Symbol,
pub aliases: Vec<Symbol>,
pub origin: Symbol,
pub title: String,
pub description: String,
pub input_shape: ShapeRef,
pub output_shape: ShapeRef,
pub roles: Vec<SkillRole>,
pub capabilities: Vec<CapabilityName>,
pub policy: SkillPolicy,
pub transport_id: String,
pub transport_kind: String,
pub operation: String,
}Expand description
Full runtime description of a single skill.
A card carries the skill’s identity and symbol, its input and output shape
contracts, the roles it plays, the capabilities required to call it, its
SkillPolicy, and the transport coordinates (id, kind, and operation)
used to dispatch a call. It is a shape-bearing runtime handle; its
serializable projection is the SkillCardDescriptor (skill/Card).
Fields§
§id: StringStable string identifier for the skill.
symbol: SymbolSymbol the skill is registered and called under.
aliases: Vec<Symbol>Additional symbols that also resolve to this skill.
origin: SymbolSymbol naming where the card came from (for example fixture).
title: StringHuman-readable title.
description: StringHuman-readable description of what the skill does.
input_shape: ShapeRefShape contract the call arguments must satisfy.
output_shape: ShapeRefShape contract the call result must satisfy.
roles: Vec<SkillRole>Roles this skill plays for an agent.
capabilities: Vec<CapabilityName>Capabilities a caller must hold to invoke the skill.
policy: SkillPolicyPrivacy, caching, and recording policy.
transport_id: StringIdentifier of the transport that runs the skill.
transport_kind: StringKind of the transport (for example fixture, mcp, http).
operation: StringOperation name the transport dispatches for this skill.
Implementations§
Source§impl SkillCard
impl SkillCard
Sourcepub fn fixture(spec: FixtureSkillSpec) -> Self
pub fn fixture(spec: FixtureSkillSpec) -> Self
Builds a fixture skill card from spec.
The card is given the fixture origin, the SkillRole::Tool role, a
default SkillPolicy, and a single skill-specific call capability.
Sourcepub fn with_capability(self, capability: CapabilityName) -> Self
pub fn with_capability(self, capability: CapabilityName) -> Self
Returns the card with capability appended to its required capabilities.
Sourcepub fn with_role(self, role: SkillRole) -> Self
pub fn with_role(self, role: SkillRole) -> Self
Returns the card with role added if it is not already present.
Sourcepub fn with_policy(self, policy: SkillPolicy) -> Self
pub fn with_policy(self, policy: SkillPolicy) -> Self
Returns the card with its policy replaced by policy.
Sourcepub fn with_cache_mode(self, cache: SkillCacheMode) -> Self
pub fn with_cache_mode(self, cache: SkillCacheMode) -> Self
Returns the card with its cache mode set to cache.
Sourcepub fn with_cassette_mode(self, cassette: SkillCassetteMode) -> Self
pub fn with_cassette_mode(self, cassette: SkillCassetteMode) -> Self
Returns the card with its cassette mode set to cassette.
Sourcepub fn with_idempotent(self, idempotent: bool) -> Self
pub fn with_idempotent(self, idempotent: bool) -> Self
Returns the card with its idempotency flag set to idempotent.
Sourcepub fn with_semantic_key(self, semantic_key: impl Into<String>) -> Self
pub fn with_semantic_key(self, semantic_key: impl Into<String>) -> Self
Returns the card with its semantic key set to semantic_key.
Sourcepub fn with_privacy(self, privacy: SkillPrivacyPolicy) -> Self
pub fn with_privacy(self, privacy: SkillPrivacyPolicy) -> Self
Returns the card with its privacy policy set to privacy.
Source§impl SkillCard
impl SkillCard
Sourcepub fn to_expr(&self, cx: &mut Cx) -> Result<Expr>
pub fn to_expr(&self, cx: &mut Cx) -> Result<Expr>
Encodes the card as a skill/card map Expr, the inverse of
SkillCard::from_expr.
Sourcepub fn from_expr(expr: &Expr) -> Result<Self>
pub fn from_expr(expr: &Expr) -> Result<Self>
Decodes a card from a skill/card map Expr, the inverse of
SkillCard::to_expr.
Missing policy fields fall back to SkillPolicy::default.
Trait Implementations§
Source§impl Object for SkillCard
impl Object for SkillCard
Source§fn display(&self, _cx: &mut Cx) -> Result<String>
fn display(&self, _cx: &mut Cx) -> Result<String>
Source§fn header(&self) -> &ObjectHeader
fn header(&self) -> &ObjectHeader
Source§fn op(&self, _key: &OpKey) -> Option<&dyn Op>
fn op(&self, _key: &OpKey) -> Option<&dyn Op>
key, if any.