Skip to main content

Module command

Module command 

Source
Expand description

The command registry and the wire envelope (spec §4, Appendix A).

A command is a CommandSpec: name, group, doc, the JSON Schemas of its argument and result types (derived with schemars), the frame phase it runs in, MCP-style annotations, and a handler. Each cmd_* module owns a pub static COMMANDS: &[CommandSpec]; registry gathers them. A host generates its tool list from describe; nothing lists commands by hand.

Structs§

Annotations
CommandSpec
Ctx
What an app-phase handler sees.
Empty
A command that returns nothing beyond the envelope.
Envelope
NoArgs
A command that takes nothing.
Notice
Reply

Enums§

Handler
NoticeKind
Outcome
What a handler returns.
Phase
Where in the frame a command runs (§4.4).

Functions§

describe
The registry as JSON — what a host turns into tools/list and what the generated docs render: [{name, group, doc, phase, annotations, argsSchema, resultSchema}].
lookup
parse_args
registry
Every registered command, in module order. Each cmd_* module contributes its COMMANDS static; tests/automation_registry.rs walks the source tree for static COMMANDS declarations and fails if one is missing here, so this function cannot silently become a hand-kept subset.
schema_of
The JSON Schema of a type, as a serde_json::Value.

Type Aliases§

AppHandler
InputHandler