skill

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderLoaded added in v0.2.0

func RenderLoaded(content Content) string

RenderLoaded formats a loaded skill for the model, including resource-base guidance.

func SanitizeRelativePath added in v0.2.0

func SanitizeRelativePath(rel string) (string, error)

SanitizeRelativePath rejects paths that escape a skill bundle directory.

Types

type Content

type Content struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Body        string `json:"body"`
	Path        string `json:"path"`
}

func ReadFile added in v0.2.0

func ReadFile(ctx context.Context, reg Registry, name, rel string) (Content, error)

ReadFile loads a supporting file from the skill directory identified by name.

type Descriptor

type Descriptor struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Path        string `json:"path"`
}

type Registry

type Registry interface {
	List(context.Context) ([]Descriptor, error)
	Load(context.Context, string) (Content, error)
}

type RunResult added in v0.2.0

type RunResult struct {
	Name     string
	Path     string
	Script   string
	Args     []string
	ExitCode int
	Stdout   string
	Stderr   string
}

RunResult is the outcome of executing one script inside a skill directory.

func RunScript added in v0.2.0

func RunScript(ctx context.Context, reg Registry, name, rel string, args []string, timeout time.Duration) (RunResult, error)

RunScript executes a script relative to the skill directory identified by name.

Jump to

Keyboard shortcuts

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