Documentation
¶
Index ¶
- Variables
- type Catalog
- type CatalogImpl
- type CatalogImplOpts
- type CatalogOpt
- type Parser
- type ParserImpl
- type Skill
- type SkillImpl
- func (s *SkillImpl) AllowedTools() string
- func (s *SkillImpl) Body() string
- func (s *SkillImpl) Compatibility() string
- func (s *SkillImpl) Description() string
- func (s *SkillImpl) License() string
- func (s *SkillImpl) Metadata() map[string]any
- func (s *SkillImpl) Name() string
- func (s *SkillImpl) RootPath() string
- func (s *SkillImpl) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMissingYAMLFrontmatter is returned when the yaml frontmatter is missing. ErrMissingYAMLFrontmatter = fmt.Errorf("agents: missing yaml frontmatter") // ErrInvalidSkillFormat is returned when the skill format is invalid. ErrInvalidSkillFormat = fmt.Errorf("agents: invalid skill format") )
Functions ¶
This section is empty.
Types ¶
type Catalog ¶
type Catalog interface {
// Load loads the catalog from the configured roots.
Load() error
// Skills returns the list of skills in the catalog.
Skills() []Skill
// Skill returns the skill with the given name, or nil if it does not exist.
Skill(name string) (Skill, bool)
// Enable is enabling a skill in the catalog.
Enable(name string)
// Disable is disabling a skill in the catalog.
Disable(name string)
// Clear clears the catalog of skills.
Clear()
}
Catalog represents a catalog of skills.
type CatalogImpl ¶
type CatalogImpl struct {
// contains filtered or unexported fields
}
CatalogImpl represents a catalog of skills.
func NewCatalog ¶
func NewCatalog(opts ...CatalogOpt) *CatalogImpl
NewCatalog creates a new Catalog.
func (*CatalogImpl) Disable ¶
func (c *CatalogImpl) Disable(name string)
Disable is disabling a skill in the catalog. It removes the skill from the active skills map.
func (*CatalogImpl) Enable ¶
func (c *CatalogImpl) Enable(name string)
Enable is enabling a skill in the catalog.
func (*CatalogImpl) Load ¶
func (c *CatalogImpl) Load() error
Load loads the catalog from the configured roots.
func (*CatalogImpl) Skill ¶
func (c *CatalogImpl) Skill(name string) (Skill, bool)
Skill returns the skill with the given name, or nil if it does not exist.
func (*CatalogImpl) Skills ¶
func (c *CatalogImpl) Skills() []Skill
Skills returns the list of skills in the catalog.
type CatalogImplOpts ¶
type CatalogImplOpts struct {
// Roots is the list of root directories to scan for skills.
Roots []string
}
CatalogOpts is a slice of CatalogOpt functions.
func DefaultCatalogOpts ¶
func DefaultCatalogOpts() *CatalogImplOpts
DefaultCatalogOpts returns the default options for creating a Catalog.
type CatalogOpt ¶
type CatalogOpt func(*CatalogImplOpts)
CatalogOpt represents options for creating a Catalog.
func WithRoots ¶
func WithRoots(roots ...string) CatalogOpt
WithRoots returns a CatalogOpt that sets the roots of the catalog.
type Parser ¶
type Parser interface {
// Parse parses a SKILL.md file and returns a Skill.
Parse(r io.Reader) (Skill, error)
}
Parser respresents a parser that can parse SKILL.md files.
type Skill ¶
type Skill interface {
// RootPath returns the root path of the skill.
RootPath() string
// Name returns the name of the skill.
Name() string
// Description returns the description of the skill.
Description() string
// License returns the license of the skill.
License() string
// Compatibility returns the compatibility of the skill.
Compatibility() string
// Metadata returns the metadata of the skill.
Metadata() map[string]any
// AllowedTools returns the allowed tools of the skill.
AllowedTools() string
// Body returns the body of the skill.
Body() string
yaml.Unmarshaler
}
Skill represents a skill parsed from a SKILL.md file.
func LoadSkills ¶
LoadSkills loads a skill by seeking skills files in the given path.
type SkillImpl ¶
type SkillImpl struct {
// contains filtered or unexported fields
}
SkillImpl represents a skill parsed from a SKILL.md file.
func (*SkillImpl) AllowedTools ¶
AllowedTools returns the allowed tools of the skill.
func (*SkillImpl) Compatibility ¶
Compatibility returns the compatibility of the skill.
func (*SkillImpl) Description ¶
Description returns the description of the skill.
func (*SkillImpl) UnmarshalYAML ¶
UnmarshalYAML unmarshals the skill from YAML.