kit

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadAll

func LoadAll(dir string) (map[string]*Kit, error)

LoadAll reads all *.yaml kit files in dir, keyed by kit name.

func Resolve

func Resolve(pf *projectfile.ProjectFile, availableKits map[string]*Kit, installedSkills []string) ([]string, error)

Resolve returns the final skill set for a project. Algorithm:

  • union all skills declared by projectFile.Kits
  • apply projectFile.Add
  • apply projectFile.Remove
  • expand globs against installedSkills
  • return a deduplicated, sorted skill name slice

func ResolveMCPServers

func ResolveMCPServers(pf *projectfile.ProjectFile, availableKits map[string]*Kit) ([]string, error)

ResolveMCPServers returns the final MCP server set for a project. MCP servers are kit-scoped so projects only activate runtime tools declared by their selected kits.

func Save

func Save(path string, kit *Kit) error

Save writes a kit YAML file to path atomically.

Types

type Conflict

type Conflict struct {
	Name    string `json:"name"`
	Current string `json:"current"`
	Next    string `json:"next"`
}

type Kit

type Kit struct {
	Name         string            `yaml:"name"`
	Description  string            `yaml:"description,omitempty"`
	Skills       []string          `yaml:"-"`
	SkillAliases map[string]string `yaml:"-"`
	MCPServers   []string          `yaml:"mcp_servers,omitempty"`
	Source       *Source           `yaml:"source,omitempty"`
}

Kit is a named bundle of Scribe skills.

func Load

func Load(path string) (*Kit, error)

Load reads a single kit YAML file from path.

func Parse

func Parse(data []byte) (*Kit, error)

Parse reads a kit YAML document from bytes.

func ParseYAML

func ParseYAML(data []byte) (*Kit, error)

ParseYAML parses a kit YAML document from bytes.

func (Kit) MarshalYAML

func (k Kit) MarshalYAML() (any, error)

func (*Kit) UnmarshalYAML

func (k *Kit) UnmarshalYAML(value *yaml.Node) error

type MissingRef

type MissingRef struct {
	Ref      string `json:"ref"`
	Registry string `json:"registry,omitempty"`
	Reason   string `json:"reason"`
}

type Ref

type Ref struct {
	Raw      string
	Registry string
	Source   manifest.Source
	Skill    string
	Local    bool
	Glob     bool
}

Ref is a parsed skill reference from a kit.

func ParseSkillRef

func ParseSkillRef(raw, defaultRegistry string) (Ref, error)

ParseSkillRef parses same-registry, cross-registry, pinned github, and local skill references used by registry-published kits.

type Resolution

type Resolution struct {
	Skills    []ResolvedSkill `json:"skills"`
	Missing   []MissingRef    `json:"missing,omitempty"`
	Conflicts []Conflict      `json:"conflicts,omitempty"`
}

func ResolveWithDetail

func ResolveWithDetail(ctx context.Context, in ResolverInput) (Resolution, error)

type ResolvedOrigin

type ResolvedOrigin string
const (
	OriginSameRegistry  ResolvedOrigin = "same_registry"
	OriginCrossRegistry ResolvedOrigin = "cross_registry"
	OriginLocal         ResolvedOrigin = "local"
)

type ResolvedSkill

type ResolvedSkill struct {
	Name     string          `json:"name"`
	Origin   ResolvedOrigin  `json:"origin"`
	Registry string          `json:"registry,omitempty"`
	Source   manifest.Source `json:"source,omitempty"`
	Aliased  bool            `json:"aliased,omitempty"`
	AliasFor string          `json:"alias_for,omitempty"`
}

type ResolverInput

type ResolverInput struct {
	Project         *projectfile.ProjectFile
	Kits            map[string]*Kit
	InstalledSkills []string
	Registries      []config.RegistryConfig
	NowRegistry     func(context.Context, string) (*manifest.Manifest, error)
}

type Source

type Source struct {
	Registry string `yaml:"registry"`
	Rev      string `yaml:"rev,omitempty"`
}

Source records the registry source for a kit.

Jump to

Keyboard shortcuts

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