Skill

Trait Skill 

Source
pub trait Skill:
    Send
    + Sync
    + Debug {
    // Required methods
    fn meta(&self) -> &SkillMeta;
    fn read_instructions<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<String, SkillError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn load_resource<'life0, 'life1, 'async_trait>(
        &'life0 self,
        kind: SkillResourceKind,
        path: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<SkillResource, SkillError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn run_script<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        script: &'life1 str,
        args: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Result<ScriptResult, SkillError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             Self: 'async_trait;
}
Expand description

A single skill with its own IO capabilities.

Each implementation encapsulates how to read instructions, load resources, and run scripts. This replaces the old SkillRegistry trait where a single registry handled all skills and required skill_id parameters.

Required Methods§

Source

fn meta(&self) -> &SkillMeta

Metadata for this skill (id, name, description, allowed_tools).

Source

fn read_instructions<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<String, SkillError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Read the raw SKILL.md content.

Source

fn load_resource<'life0, 'life1, 'async_trait>( &'life0 self, kind: SkillResourceKind, path: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SkillResource, SkillError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Load a resource (reference or asset) by relative path.

Source

fn run_script<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, script: &'life1 str, args: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<ScriptResult, SkillError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, Self: 'async_trait,

Run a script by relative path with arguments.

Implementors§