Documentation
¶
Overview ¶
Package initspec resolves awf init answers against the catalog's value descriptors and emits the descriptor schema (ADR-0029). It bridges the catalog's VarDescriptor set to a resolved (vars, catalog-trim) pair plus the commit-scope list via explicit answers, an optional line-based prompter, or the silent default.
Index ¶
- func CatalogVars(cat *catalog.Catalog) []catalog.VarDescriptor
- func Describe(descs []catalog.VarDescriptor) ([]byte, error)
- func MergeSetFlags(base map[string]string, sets []string) error
- func ParseAnswersFile(b []byte) (map[string]string, error)
- func Resolve(descs []catalog.VarDescriptor, answers map[string]string, in io.Reader, ...) (map[string]string, *config.CatalogTrim, []string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatalogVars ¶
func CatalogVars(cat *catalog.Catalog) []catalog.VarDescriptor
CatalogVars returns the catalog's value descriptors with the catalog-trim multiselect descriptors' Options and Default computed from the catalog itself: Options lists every skill (or doc) name sorted, and Default comma-joins the curated-core names (the pre-selected set). Other descriptors pass through unchanged. Describe and Resolve operate on the returned slice so the trim option list stays derived from the catalog (ADR-0029).
func Describe ¶
func Describe(descs []catalog.VarDescriptor) ([]byte, error)
Describe marshals the descriptor set as JSON ({"descriptors": [...]}) for `awf init --describe`. An empty Target is normalized to "var".
func MergeSetFlags ¶
MergeSetFlags overlays "key=value" strings onto base (later wins).
func ParseAnswersFile ¶
ParseAnswersFile parses a flat key→value answer map from JSON or YAML bytes.
func Resolve ¶
func Resolve(descs []catalog.VarDescriptor, answers map[string]string, in io.Reader, out io.Writer, interactive bool, needed func(*config.CatalogTrim) (map[string]bool, error)) (map[string]string, *config.CatalogTrim, []string, error)
Resolve maps descriptors + answers to a vars map, an optional catalog trim, and the resolved commit-scope list. Multiselect descriptors resolve first — the trim decides which var prompts are worth asking (ADR-0086 Decision 6), so artifact selection precedes var entry. For a string/enum descriptor the value is: the explicit answer if present; otherwise an interactive prompt (when interactive and, given a needed filter, the var is one the selection's templates reference); otherwise empty. A nil needed prompts for everything. A multiselect descriptor resolves to a verbatim selection (see resolveMultiselect) routed to the catalog-skills/catalog-docs trim dimension.
Types ¶
This section is empty.