recommend

package
v0.84.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package recommend produces a filtered, grouped view of which plugins provide a set of requested capabilities. Pure + deterministic (design V2): no ranking (inventory carries no quality/popularity signal — design review D13).

NOTE: the inventory is manifest-derived (registry manifests + sibling plugin.json checkouts); it does NOT carry runtime-factory-verified signal. Providers carry real Kind ("registry"|"external"|"local-plugin") + ReleaseStatus ("released"| "local-only") fields, surfaced as-is for the consumer to interpret.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CapabilityHit

type CapabilityHit struct {
	ID        string            `json:"id"`
	Category  string            `json:"category"`
	Name      string            `json:"name"`
	Providers []ProviderSummary `json:"providers"`
}

CapabilityHit groups providers of one capability.

type Options

type Options struct {
	Capabilities         []string
	Categories           []string
	IncludeUncategorized bool

	// DefaultPlugins is the set of always-available (built-in) plugin names, used
	// to derive the installRequired selection-fact (D10/AS5). Injected by the
	// caller (e.g. from all.DefaultPlugins) so this package stays pure (⊥ a heavy
	// plugins/all import). A provider is installRequired when its Kind is
	// "external" or "local-plugin" AND its name is not in this set.
	DefaultPlugins []string
}

Options selects capabilities to recommend for.

type ProviderSummary

type ProviderSummary struct {
	Name          string `json:"name"`
	Kind          string `json:"kind"`
	ReleaseStatus string `json:"releaseStatus,omitempty"`
	Source        string `json:"source,omitempty"`

	// InstallRequired (D10) is a selection FACT: true when this provider needs
	// explicit install/setup — Kind is "external" or "local-plugin" AND the name
	// is not a built-in default. Raw Kind/ReleaseStatus above let the consumer
	// interpret further; ⊥ wiring-implications (M2) and ⊥ quality-rank (D13).
	InstallRequired bool `json:"installRequired,omitempty"`
}

ProviderSummary is a compact provider descriptor (real inventory fields).

type Recommendation

type Recommendation struct {
	Requested    []string        `json:"requested"`
	Capabilities []CapabilityHit `json:"capabilities"`
	Unmatched    []string        `json:"unmatched,omitempty"`
}

Recommendation is the filtered + grouped result.

func Recommend

func Recommend(inv *inventory.Inventory, opts Options) *Recommendation

Recommend filters inv to requested capabilities and groups their providers. It is pure: it performs no ranking (the inventory carries no quality or popularity signal) and produces a deterministic ordering.

type WizardProvider added in v0.83.1

type WizardProvider struct {
	CapabilityID    string `json:"capabilityId"`
	Category        string `json:"category,omitempty"`
	Name            string `json:"name"`
	Kind            string `json:"kind"`
	ReleaseStatus   string `json:"releaseStatus,omitempty"`
	InstallRequired bool   `json:"installRequired,omitempty"`
}

WizardProvider is a single provider within the wizard state, carrying the selection facts (raw Kind/ReleaseStatus + installRequired).

type WizardState added in v0.83.1

type WizardState struct {
	Chosen       []WizardProvider `json:"chosen"`
	Alternatives []WizardProvider `json:"alternatives,omitempty"`
	GlueGaps     []string         `json:"glueGaps,omitempty"`
	NextSteps    []string         `json:"nextSteps,omitempty"`
}

WizardState is the agent-consumable scaffold wizard state (design G4/§C4). Transport-agnostic JSON: the MCP/ACP twin is deferred to M4; M1 emits this directly so any host (CLI, agent) can consume it. It composes the chosen capability providers (+ facts) with the grammar wire's glue-gaps and Category-B runtime-hook preconditions, surfaced as actionable NextSteps.

func BuildWizardState added in v0.83.1

func BuildWizardState(rec *Recommendation, glueGaps, hooks []string) *WizardState

BuildWizardState composes a WizardState from a Recommendation. For each capability the first provider is "chosen" and the rest are "alternatives", each carrying its facts. glueGaps (unselected Attaches.To from the grammar wire) pass through; hooks (Category-B RuntimeHooks) become NextSteps, as does an explicit "install <name>" step for every installRequired provider.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL