Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LatestMatchingVersion ¶
LatestMatchingVersion queries the remote repo's git tags via git ls-remote and returns the highest version that satisfies constraint. Returns the bare version (e.g. "1.2.3") and the git tag/ref (e.g. "v1.2.3").
If constraint is a branch name (e.g. "main", "HEAD") rather than a semver constraint, it is resolved to the current HEAD SHA of that branch and used directly as the git ref. The returned version is the short SHA.
func LatestTag ¶
LatestTag returns the highest semver tag in repoURL, regardless of constraints. Returns the bare version (e.g. "1.2.3") and the git tag (e.g. "v1.2.3").
func ParseDepName ¶
ParseDepName splits a GitHub dep name into the repo root URL and subdirectory.
"github.com/owner/repo" → ("https://github.com/owner/repo", "")
"github.com/owner/repo/sub/dir" → ("https://github.com/owner/repo", "sub/dir")
"github.com/owner/repo/tree/<branch>/sub/dir" → ("https://github.com/owner/repo", "sub/dir")
Types ¶
type FetchResult ¶
type FetchResult struct {
TreeHash string // "sha256:<hex>"
Files []string // sorted relative file paths within the installed directory
}
FetchResult contains the computed tree hash and file list produced by Fetch.
func Fetch ¶
func Fetch(dep resolver.ResolvedDep, installDir string) (FetchResult, error)
Fetch installs the skill directory for dep into installDir using a shallow git sparse-checkout. If installDir already exists and its tree hash matches dep.TreeHash the install is skipped (idempotent).
Returns a FetchResult with the computed tree hash and sorted file list.