target

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	Templates      fs.FS
	Index          *knowledge.Index
	Renderer       *render.Renderer
	HookInstallers *install.Registry
	Base           string
	IDs            []string
	RouterFilter   []string
	NoMCP          bool
	NoHooks        bool
	SettingsFile   string
}

Context carries the resolved inputs an install Strategy needs. It is a small facade over the CLI options so this package never imports the cmd package.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry maps a layout name to its install Strategy. Build it once at boot with NewRegistry and pass it where it is needed; there is no package-level registry var (no Singleton, no Service Locator).

func NewRegistry

func NewRegistry() *Registry

NewRegistry builds the Registry with the built-in Claude and opencode layouts, keying each Strategy by its own Name so the allow-list cannot drift.

func (*Registry) Has

func (r *Registry) Has(name string) bool

Has reports whether a layout name is registered.

func (*Registry) Install

func (r *Registry) Install(name string, ctx Context) (Report, error)

Install dispatches to the named layout's Strategy, returning its Report. It errors when the name is not registered.

func (*Registry) Names

func (r *Registry) Names() []string

Names returns the registered layout names sorted for stable diagnostics.

type Report

type Report struct {
	Notes    []string // progress lines for stdout
	Warnings []string // non-fatal warnings for stderr
}

Report collects a Strategy's human-facing output so the caller owns all stdout/stderr; the package itself stays silent and easy to test.

type Target

type Target interface {
	// Name is the layout key the Registry registers the Strategy under.
	Name() string
	// Install renders the selected skills and wires the layout's config,
	// returning a Report of what it did.
	Install(ctx Context) (Report, error)
}

Target installs the rendered skills for one agent layout into Context.Base.

Jump to

Keyboard shortcuts

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