Documentation
¶
Index ¶
- func ActiveSkillsPrompt(items []ActiveSkillItem) string
- func AvailableSkillsPrompt(items []AvailableSkillItem) string
- func IsValidSkillArgumentName(name string) bool
- func NormalizeSkillInsert(v spec.SkillInsert) (spec.SkillInsert, bool)
- func RenderSkillBody(body string, arguments []spec.SkillArgument, values map[string]string) spec.RenderSkillBodyResult
- type ActiveSkillItem
- type AvailableSkillItem
- type Catalog
- func (c *Catalog) Add(ctx context.Context, def spec.SkillDef) (spec.SkillRecord, error)
- func (c *Catalog) EnsureBody(ctx context.Context, key spec.ProviderSkillKey) (string, error)
- func (c *Catalog) GetIndex(key spec.ProviderSkillKey) (spec.ProviderSkillIndexRecord, bool)
- func (c *Catalog) HandleForKey(key spec.ProviderSkillKey) (spec.SkillHandle, bool)
- func (c *Catalog) ListPromptIndexRecords(f PromptFilter) []spec.ProviderSkillIndexRecord
- func (c *Catalog) ListUserEntries(f UserFilter) []UserEntry
- func (c *Catalog) Remove(def spec.SkillDef) (spec.SkillRecord, spec.ProviderSkillKey, bool)
- func (c *Catalog) ResolveDef(def spec.SkillDef) (spec.ProviderSkillKey, bool)
- func (c *Catalog) ResolveHandle(h spec.SkillHandle) (spec.ProviderSkillKey, bool)
- type PromptFilter
- type ProviderResolver
- type UserEntry
- type UserFilter
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 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 ¶
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 (*Catalog) GetIndex ¶ added in v0.7.0
func (c *Catalog) GetIndex(key spec.ProviderSkillKey) (spec.ProviderSkillIndexRecord, bool)
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 ¶
func (c *Catalog) Remove(def spec.SkillDef) (spec.SkillRecord, spec.ProviderSkillKey, bool)
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
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.