local

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

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

func ScanWithRoot(fsys fs.FS, rootPath string) ([]contract.SkillDescriptor, error)

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

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

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.

Jump to

Keyboard shortcuts

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