Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Command ¶
type Command interface {
Name() string
Description() string
Run(ctx context.Context, args string) error
}
Command is a slash-command handler. Run is called with the trimmed arg string (everything after `/<name>`).
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps names to commands. Built-ins are registered first via Register and always win: user/project skills are added with RegisterIfAbsent so a cloned repo's `./.enso/skills/quit.md` can't silently hijack the built-in `/quit` (a trust/safety concern).
func (*Registry) Register ¶
Register adds (or replaces) a command by name. Use only for trusted, first-party commands (the built-ins); untrusted skills go through RegisterIfAbsent so they can't overwrite a built-in.
func (*Registry) RegisterIfAbsent ¶
RegisterIfAbsent adds c only if no command with its name already exists, returning false on collision (the existing command is kept). Used for user/project skills so they shadow nothing already registered — built-ins, registered first, take precedence.
type Skill ¶
type Skill struct {
// contains filtered or unexported fields
}
Skill is a user-defined slash command loaded from disk. Frontmatter fields are surfaced via Description(); the body is a `text/template` rendered against `{ Args }` and submitted as the next user message.
The submitter receives both the rendered text AND the skill's `allowed-tools` list so the host can apply a per-turn registry restriction in addition to forwarding the message. Empty list = no restriction.
func LoadSkills ¶
LoadSkills scans the user dir (`$XDG_CONFIG_HOME/enso/skills`) and the project dir (`./.enso/skills`) for `*.md` files and returns parsed Skill values. Project skills shadow user skills on name collision.
func (*Skill) AllowedTools ¶
func (*Skill) Description ¶
func (*Skill) SetSubmitter ¶
SetSubmitter binds the skill to a callback that injects the rendered text as the next user message and, if non-empty, applies the skill's `allowed-tools` restriction for that turn. Returns the same skill for chaining.