Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrConflict = errors.New("resolver: version conflict")
ErrConflict is returned when two packages require incompatible versions of a shared transitive dependency.
Functions ¶
func DefaultFetchManifest ¶
DefaultFetchManifest fetches a dependency's melon.yaml from the GitHub raw content API. Returns an empty Manifest and nil error when the file is absent (HTTP 404) — missing manifests are treated as deps with no transitive deps. Respects the GITHUB_TOKEN environment variable if set.
Types ¶
type ResolvedDep ¶
type ResolvedDep struct {
Name string // full dep name, e.g. "github.com/anthropics/skills/skills/skill-creator"
Version string // exact pinned semver, e.g. "1.3.1"
RepoURL string // https://github.com/anthropics/skills (repo root, derived from name)
Subdir string // subdirectory within the repo, e.g. "skills/skill-creator" (empty if repo root)
GitTag string // e.g. "v1.3.1"
Entrypoint string // path to SKILL.md relative to subdir root, e.g. "SKILL.md"
TreeHash string // SHA256 of the full directory tree at this tag (sorted file paths)
}
ResolvedDep is a single dependency with its pinned version.
func Resolve ¶
func Resolve( m manifest.Manifest, resolveVersion func(repoURL, constraint string) (string, string, error), fetchManifest func(repoURL, gitTag, subdir string) (manifest.Manifest, error), ) ([]ResolvedDep, error)
Resolve builds a flat, sorted list of all transitive dependencies from m.
resolveVersion is called to convert a (repoURL, constraint) pair into a pinned (version, gitTag). Typically set to fetcher.LatestMatchingVersion.
fetchManifest fetches the melon.yaml for a dep from its source. It should return an empty Manifest and nil error when the file is absent (404). Typically set to DefaultFetchManifest.
Uses a greedy highest-compatible-version strategy. Returns ErrConflict if two packages require incompatible versions of a shared transitive dep.