Skill source abstraction — represent and resolve GitHub, Git, HTTP, path, binary, and local skill origins.
SkillSource
A fully resolved skill source.
Fields
| Name | Type | Description |
|---|---|---|
source | String | The raw source string (URL, path, or owner/repo shorthand). |
path | Option<String> | Subdirectory path within the source (for multi-skill repos). |
rev | Option<String> | Pinned revision (git commit, tag, or branch). |
version | Option<String> | Required SKILL.md version. |
kind | SkillSourceKind | Source-type-specific data. |
Methods
github
pub fn github(source: impl Into<String>) -> Self
git
pub fn git(source: impl Into<String>) -> Self
http
pub fn http(source: impl Into<String>) -> Self
path
pub fn path(source: impl Into<String>) -> Self
local
pub fn local() -> Self
binary
pub fn binary(source: impl Into<String>, binary_name: impl Into<String>) -> Self
new
pub fn new(source_type: SourceType, source: impl Into<String>) -> Self
Compatibility: convert SourceType to SkillSourceKind.
Used by manifest.rs::SkillEntry::resolve(). Will be removed once
callers migrate to the named constructors.
from_path
pub fn from_path(source: &str) -> Self
Create a path-based skill source.
Alias for Self::path(source). Kept for backward compatibility.
with_rev
pub fn with_rev(self, rev: impl Into<String>) -> Self
with_path
pub fn with_path(self, path: impl Into<String>) -> Self
with_version
pub fn with_version(self, version: impl Into<String>) -> Self
with_binary
pub fn with_binary(self, binary: impl Into<String>) -> Self
with_asset_pattern
pub fn with_asset_pattern(self, pattern: impl Into<String>) -> Self
with_forked_from
pub fn with_forked_from(self, forked_from: impl Into<String>) -> Self
with_dev
pub fn with_dev(self, dev_mode: bool) -> Self
is_github
pub fn is_github(&self) -> bool
is_git_based
pub fn is_git_based(&self) -> bool
is_binary
pub fn is_binary(&self) -> bool
is_local
pub fn is_local(&self) -> bool
is_path
pub fn is_path(&self) -> bool
is_http
pub fn is_http(&self) -> bool
is_local_path
pub fn is_local_path(&self) -> bool
Returns true if this source points to a local filesystem path (either a Path source or a Binary source with a local project).
is_remote_installable
pub fn is_remote_installable(&self) -> bool
True for sources that need gitignore entries (not Path or Local).
display_name
pub fn display_name(&self) -> String
Derive a human-readable skill name from this source. Uses the path’s last segment if available, otherwise the source’s last segment.
infer
pub fn infer(source: &str) -> Result<Self>
Infer a SkillSource from a raw source string (no explicit type).
http_skill_url
pub fn http_skill_url(&self) -> Result<String>
Return the URL to fetch the SKILL.md file from an HTTP source.
If the URL doesn’t already end with skill.md (case-insensitive),
appends /skill.md.
git_url
pub fn git_url(&self) -> Result<String>
Build a git clone URL for this source.
Trait Implementations
DebugClonePartialEqEq
SourceType
The type of source a skill is fetched from.
Kept for Ion.toml serde deserialization (used by SkillEntry::Full in manifest.rs).
Variants
GithubGitHttpPathBinaryLocal
Trait Implementations
DebugClonePartialEqEqSerializeDeserialize<'de>
SkillSourceKind
Per-source-type data that only makes sense for that variant.
Variants
GithubGitHttpPathBinary { binary_name: String, asset_pattern: Option<String>, local_project: Option<PathBuf>, dev: bool }Local { forked_from: Option<String> }
Trait Implementations
DebugClonePartialEqEq