catalog

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveSkillsPrompt

func ActiveSkillsPrompt(items []ActiveSkillItem) string

func AvailableSkillsPrompt

func AvailableSkillsPrompt(items []AvailableSkillItem) string

Types

type ActiveSkillItem

type ActiveSkillItem struct {
	Name      string
	Body      string
	Resources provider.SkillResourceInfo
}

type AvailableSkillItem

type AvailableSkillItem struct {
	Name        string
	Description string
	Location    string
	Resources   provider.SkillResourceInfo
}

type Catalog

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

func NewCatalog

func NewCatalog(providers ProviderResolver) *Catalog

func (*Catalog) Add

Add registers a skill by its host/lifecycle definition (user input). It stores provider-canonicalized identity internally, but returns only the original def to callers.

func (*Catalog) EnsureBody

func (c *Catalog) EnsureBody(ctx context.Context, key provider.ProviderSkillKey) (string, error)

func (*Catalog) GetIndex

func (*Catalog) HandleForKey

func (c *Catalog) HandleForKey(key provider.ProviderSkillKey) (spec.SkillHandle, bool)

func (*Catalog) ListPromptIndexRecords

func (c *Catalog) ListPromptIndexRecords(f PromptFilter) []provider.ProviderSkillIndexRecord

ListPromptIndexRecords lists INTERNAL records for prompt assembly (returns canonical keys).

func (*Catalog) ListUserEntries

func (c *Catalog) ListUserEntries(f UserFilter) []UserEntry

ListUserEntries lists host-facing records, while preserving the canonical key for internal consumers.

func (*Catalog) Remove

Remove removes a skill by its EXACT host/lifecycle definition. Returns the host-facing record, the canonical internal key, and ok=false if not found.

func (*Catalog) ResolveDef

func (c *Catalog) ResolveDef(def provider.SkillDef) (provider.ProviderSkillKey, bool)

ResolveDef resolves an EXACT user-provided skill def (as originally added) to the internal canonical key.

func (*Catalog) ResolveHandle

func (c *Catalog) ResolveHandle(h spec.SkillHandle) (provider.ProviderSkillKey, bool)

type PromptFilter

type PromptFilter struct {
	Types          []string
	LLMNamePrefix  string
	LocationPrefix string

	Inserts []document.SkillInsert
	// AllowDefs restricts to an explicit allowlist of host/lifecycle definitions. Empty means "all".
	AllowDefs []provider.SkillDef
}

PromptFilter is used for LLM prompt listing.

type ProviderResolver

type ProviderResolver interface {
	Provider(skillType string) (provider.SkillProvider, bool)
}

type UserEntry

type UserEntry struct {
	Key    provider.ProviderSkillKey // canonical/internal key
	Record spec.SkillRecord          // host-facing record (user def)
}

type UserFilter

type UserFilter struct {
	Types          []string
	NamePrefix     string
	LocationPrefix string
	AllowDefs      []provider.SkillDef
	Inserts        []document.SkillInsert
}

UserFilter is used for host/lifecycle listing.

Jump to

Keyboard shortcuts

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