Skip to main content

SkillDirResolver

Trait SkillDirResolver 

Source
pub trait SkillDirResolver: Send + Sync {
    // Required method
    fn skill_dir(&self, scope: &SkillScope, name: &str) -> String;

    // Provided method
    fn display_dir(&self, scope: &SkillScope, name: &str) -> String { ... }
}
Expand description

Resolves the on-execution path of a skill directory.

${SKILL_DIR} (and the agent-facing display path) must be valid in the namespace where the skill’s commands and bundled-file reads actually run. The default (VfsSkillDirResolver) keeps everything in the session VFS, which is correct when the shell shares that namespace (the hosted server’s session sandbox). An embedder whose shell runs elsewhere — e.g. a CLI whose bash runs on the host — implements this to return a path valid there.

Required Methods§

Source

fn skill_dir(&self, scope: &SkillScope, name: &str) -> String

Value substituted for ${SKILL_DIR} during activation.

Provided Methods§

Source

fn display_dir(&self, scope: &SkillScope, name: &str) -> String

Agent-facing display path for the skill directory (shown in list_skills / read_skill). Defaults to the workspace-prefixed VFS path, matching the file_system capability’s display convention.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§