Documentation
¶
Overview ¶
Package slash is part of the GoFastr harness.
See docs/harness-architecture.md § Slash commands.
Package slash implements the slash-command parser + the built-in command catalog.
Per § Slash commands, parsing happens at the client: a /-prefixed input is converted to a typed wire Command before being sent to the engine. Built-in commands (bare /foo, no namespace) ship with the harness; user/plugin commands live under namespaces like /custom:bar, /super-skill:baz.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotSlashCommand = errors.New("slash: not a slash command")
ErrNotSlashCommand signals an input didn't start with '/'.
var ErrUnknownNamespace = errors.New("slash: unknown namespace")
ErrUnknownNamespace is returned by the resolver when a namespace isn't claimed by built-ins or any plugin.
Functions ¶
func AllNamespaces ¶
func AllNamespaces() []string
AllNamespaces returns the reserved namespaces shipped in v0.1. Plugins claim additional namespaces via Plugin.Register.
Types ¶
type Builtin ¶
Builtin is one shipped command's metadata.
func AllBuiltins ¶
func AllBuiltins() []Builtin
AllBuiltins returns the v0.1 built-in command catalog, as documented at § Slash commands → Built-in commands shipped in v0.1.
The handlers are wired by the harness composition layer; this catalog is what clients display via GET /v1/slash-commands.
type Cmd ¶
type Cmd struct {
// IsBuiltin reports whether Namespace is empty.
IsBuiltin bool
// Namespace is the prefix before the colon ("skills" in
// "/skills:foo"). Empty for built-ins.
Namespace string
// Name is the verb after the colon (or after the slash for
// built-ins). "foo" in "/skills:foo".
Name string
// Args is the remaining whitespace-delimited tokens, preserving
// quoted segments as single tokens.
Args []string
// Raw is the original input including leading slash.
Raw string
}
Cmd is a parsed slash-command invocation.