catalog

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveSkillsPrompt added in v0.12.0

func ActiveSkillsPrompt(items []ActiveSkillItem) string

func AvailableSkillsPrompt added in v0.12.0

func AvailableSkillsPrompt(items []AvailableSkillItem) string

func IsValidSkillArgumentName added in v0.17.0

func IsValidSkillArgumentName(name string) bool

func NormalizeSkillInsert added in v0.17.0

func NormalizeSkillInsert(v spec.SkillInsert) (spec.SkillInsert, bool)

func RenderSkillBody added in v0.17.0

func RenderSkillBody(body string, arguments []spec.SkillArgument, values map[string]string) spec.RenderSkillBodyResult

RenderSkillBody renders declared string arguments into body.

Supported placeholders:

  • $name
  • {{name}}
  • {{ name }}

Only declared arguments are substituted. Unknown placeholders are preserved and warned. No runtime variables are expanded. No command syntax is interpreted or sanitized.

Types

type ActiveSkillItem

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

type AvailableSkillItem

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

type Catalog

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

func New

func New(providers ProviderResolver) *Catalog

func (*Catalog) Add

func (c *Catalog) Add(ctx context.Context, def spec.SkillDef) (spec.SkillRecord, error)

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 spec.ProviderSkillKey) (string, error)

func (*Catalog) GetIndex added in v0.7.0

func (*Catalog) HandleForKey

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

func (*Catalog) ListPromptIndexRecords added in v0.7.0

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

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

func (*Catalog) ListUserEntries added in v0.7.0

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 added in v0.7.0

func (c *Catalog) ResolveDef(def spec.SkillDef) (spec.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) (spec.ProviderSkillKey, bool)

type PromptFilter added in v0.7.0

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

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

PromptFilter is used for LLM prompt listing.

type ProviderResolver

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

type UserEntry added in v0.7.0

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

type UserFilter added in v0.7.0

type UserFilter struct {
	Types          []string
	NamePrefix     string
	LocationPrefix string
	AllowDefs      []spec.SkillDef
	Inserts        []spec.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