Skip to main content

SkillCatalog

Struct SkillCatalog 

Source
pub struct SkillCatalog { /* private fields */ }
Expand description

Registry of available skills.

In the progressive-disclosure model the catalog has one responsibility: know what skills exist (name + description) and build the dynamic skill meta-tool schema that is included in every CallLLM action so the model can invoke any skill by name.

Skill content is never held here — it is returned to the LLM as a regular tool-call result by the SDK layer (read from disk on demand).

Implementations§

Source§

impl SkillCatalog

Source

pub fn new() -> Self

Source

pub fn set_available(&mut self, skills: Vec<SkillMetadata>)

Replace the full available-skills set in one shot.

Source

pub fn upsert_available(&mut self, skill: SkillMetadata)

Add or replace a single skill entry.

Source

pub fn available_count(&self) -> usize

Source

pub fn allowed_tools(&self, name: &str) -> &[CompactString]

P1-B tool gating: the tool ids the named skill declares it needs. Empty when the skill is unknown or declares none (⇒ that skill does not narrow the toolset). The kernel unions these across the active-skill set in emit_call_llm.

Source

pub fn is_empty(&self) -> bool

Source

pub fn build_tool_schema(&self) -> Option<ToolSchema>

Build the dynamic skill meta-tool schema to inject into every LLM call.

Returns None when no skills are registered (nothing to inject). The description field embeds the full <available_skills> XML so the model learns what is available without a separate system message.

Trait Implementations§

Source§

impl Default for SkillCatalog

Source§

fn default() -> Self

Returns the “default value” for a type. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.