Documentation
¶
Overview ¶
Package selection resolves user-provided skill selectors (by name, the "all" wildcard, or a name@path disambiguator) against the skills discovered in a source. Resolution is a pure function of its inputs: it prefers exact matches, refuses to guess between duplicates in non-interactive use, and surfaces close matches when a name does not resolve.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAmbiguousSelection is returned when a selector cannot be resolved // without guessing — a duplicated id with no disambiguating path, or a // wildcard over a source that still contains duplicates. ErrAmbiguousSelection = errors.New("ambiguous skill selection") // ErrInvalidSelection is returned when an explicitly selected skill is invalid. ErrInvalidSelection = errors.New("selected skill is invalid") )
Sentinel selection errors. Callers map these to exit codes at the CLI boundary (ErrAmbiguousSelection/NoMatchError → usage/2, ErrInvalidSelection → 3).
Functions ¶
func Closest ¶
Closest returns up to limit candidate names within a small edit distance of target, ordered by (distance, name) for determinism. It is used to suggest near-misses when a skill selector does not resolve (FR-017).
func Resolve ¶
func Resolve(res discovery.Result, sels []Selector, interactive bool) ([]discovery.DiscoveredSkill, error)
Resolve maps selectors onto discovered skills, preferring exact matches and refusing to guess between duplicates non-interactively. The returned skills are de-duplicated and returned in deterministic (RepoPath, ID) order.
Types ¶
type NoMatchError ¶
NoMatchError is returned when a name selector matches no discovered skill; it carries the closest candidate names as suggestions (FR-017).
func (*NoMatchError) Error ¶
func (e *NoMatchError) Error() string