Documentation
¶
Overview ¶
Package commands is the one place slash commands are defined. The terminal UI, the web chat, and the messaging gateways all dispatch through it, so a command behaves the same wherever it is typed and only has to be written once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
Action is a machine-readable instruction for the calling surface, returned alongside the human-readable output.
type Deps ¶
type Deps struct {
Config func() *config.Config
Agent *agent.Agent
Store store.Store
Skills *skills.Manager
MCP *mcp.Manager
Reload func() error
Version string
// WebURL is the dashboard address, shown by /web.
WebURL string
}
Deps are the services commands read and write. Any of them may be nil; a command that needs a missing one says so rather than panicking.
type Input ¶
type Input struct {
// Name is the command without its leading slash.
Name string
// Args is everything after the command name, trimmed.
Args string
// SessionID is the conversation the command was typed in, when there is one.
SessionID string
Surface Surface
}
Input is one invocation.
type Result ¶
type Result struct {
// Output is markdown to show in the transcript.
Output string `json:"output"`
Action Action `json:"action,omitempty"`
}
Result is what running a command produced.
type Spec ¶
type Spec struct {
Name string `json:"name"`
Summary string `json:"summary"`
// Args is a usage hint like "<id>", empty when the command takes none.
Args string `json:"args,omitempty"`
// Surfaces lists where the command is offered.
Surfaces []Surface `json:"surfaces"`
// Client marks a command the calling surface must carry out itself —
// clearing its own transcript, quitting, opening a page. The server has no
// way to do those, so it only reports the intent.
Client bool `json:"client,omitempty"`
}
Spec describes a command for palettes and help output.