Expand description
Item selection: which Agents, skills and package-level documents of a settled dependency graph a consumer installs.
A pure pass over the graph the resolver settled. It seeds items from the consumer’s own requests and from unfiltered manifest edges, then closes over the skills the selected Agents name. Nothing here reads the filesystem, so the answer does not depend on the order the resolver met the packages in. Items are identified by package, kind and slug; the names they install under (renames, collision suffixes) are the caller’s.
The rule, in three steps:
- Seeds. Each of the consumer’s requests seeds its package, and so does each entry of
the root package’s manifest, as the consumer’s own request. The root package itself is
selected whole. A request that takes everything also opens its package: every unfiltered
entry of an open package’s manifest seeds its target in turn and opens it. A filtered entry
of a dependency’s manifest seeds nothing, and its
excludeblocks nothing; only the consumer’s ownexclude(or the root’s) does. - Items per request.
Alltakes every item;Includetakes Agents and skills by kind and slug, and the package’s bootstrap documents;Excludetakes all but the items it names by slug or path;only_skillsandonly_agentstake one kind. Hooks are taken byAllandExcludeonly. - Skill refs. Every selected Agent’s
skillsresolve to a package: its own, then its dependencies breadth first, then any other package in registry order. The skill is selected unless the consumer excluded it, and a package it lands in also selects its bootstrap documents. A ref<skill>__<provider>that no package ships is skipped when the requester declares the provider, and is aMissingSkillotherwise.
Registry order is computed here, not supplied: a depth-first walk from the root package
(if any), then each request in order, descending each package’s manifest entries in
declaration order. GraphView::packages is a set. A package no request reaches is never
selected from and never supplies a skill.
Structs§
- Definition
- An Agent or skill of a package, with the skills an Agent names.
- Graph
View - Item
- An item of a package, found by the caller: what the crate does not prepare (bootstrap documents, hooks). MCP servers are selected outside this pass, by the caller.
- Missing
Skill - A skill ref no package ships.
- Package
Input - A package as a caller holds it across the JSON boundary: the
crate::prepare::Preparedit got earlier (prepare’s result, as serialized) and the items preparation does not read. Onlyprepared.selectionis read; the rest is ignored. - Package
View - Request
- A dependency entry as selection sees it: the package it names and the items it asks for.
- Selected
Item - Selection
Facts - What selection reads of a prepared package.
preparecomputes it (Prepared::selection), so a caller on the other side of the JSON boundary passesprepare’s result and derives nothing. - Selection
Result
Enums§
- Requester
- Why an item is selected.