Documentation
¶
Index ¶
- func Scan(fsys fs.FS) ([]contract.SkillDescriptor, error)
- func ScanWithRoot(fsys fs.FS, rootPath string) ([]contract.SkillDescriptor, error)
- type LocalRegistry
- func (r *LocalRegistry) Get(name string) *contract.SkillDescriptor
- func (r *LocalRegistry) HasScript(name string) bool
- func (r *LocalRegistry) List() ([]contract.SkillDescriptor, error)
- func (r *LocalRegistry) ListScripts(name string) []string
- func (r *LocalRegistry) LoadContent(name string) ([]byte, error)
- func (r *LocalRegistry) LoadScript(name string) ([]byte, error)
- func (r *LocalRegistry) LoadScriptByName(name, scriptFile string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Scan ¶
func Scan(fsys fs.FS) ([]contract.SkillDescriptor, error)
Scan walks top-level directories in fsys looking for SKILL.md files. It parses frontmatter to extract SkillDescriptor fields. Hidden directories (starting with ".") and "_template/" are skipped.
func ScanWithRoot ¶
ScanWithRoot works like Scan but, when rootPath is non-empty, resolves symlinks and verifies each entry stays within rootPath. Entries that resolve outside the root are skipped with a log warning.
Types ¶
type LocalRegistry ¶
type LocalRegistry struct {
// contains filtered or unexported fields
}
LocalRegistry implements contract.SkillRegistry backed by an fs.FS.
func NewEmbeddedRegistry ¶
func NewEmbeddedRegistry() (*LocalRegistry, error)
NewEmbeddedRegistry creates a LocalRegistry backed by the compile-time embedded skills. Embedded skills are assigned TrustBuiltin provenance.
func NewLocalRegistry ¶
func NewLocalRegistry(fsys fs.FS) (*LocalRegistry, error)
NewLocalRegistry creates a LocalRegistry by scanning the given filesystem.
func NewLocalRegistryWithRoot ¶
func NewLocalRegistryWithRoot(fsys fs.FS, rootPath string) (*LocalRegistry, error)
NewLocalRegistryWithRoot creates a LocalRegistry that validates symlinks against the given rootPath. This prevents skill directories that are symlinks pointing outside the project root from being loaded.
func (*LocalRegistry) Get ¶
func (r *LocalRegistry) Get(name string) *contract.SkillDescriptor
Get returns the descriptor for the named skill, or nil if not found.
func (*LocalRegistry) HasScript ¶
func (r *LocalRegistry) HasScript(name string) bool
HasScript reports whether the named skill has an associated script.
func (*LocalRegistry) List ¶
func (r *LocalRegistry) List() ([]contract.SkillDescriptor, error)
List returns all available skill descriptors.
func (*LocalRegistry) ListScripts ¶
func (r *LocalRegistry) ListScripts(name string) []string
ListScripts returns the filenames of all scripts for the named skill.
func (*LocalRegistry) LoadContent ¶
func (r *LocalRegistry) LoadContent(name string) ([]byte, error)
LoadContent reads the full SKILL.md content for the named skill.
func (*LocalRegistry) LoadScript ¶
func (r *LocalRegistry) LoadScript(name string) ([]byte, error)
LoadScript reads the script content for the named skill.
func (*LocalRegistry) LoadScriptByName ¶
func (r *LocalRegistry) LoadScriptByName(name, scriptFile string) ([]byte, error)
LoadScriptByName reads a specific script file for the named skill.