Expand description
Slash command registry, handler trait, and channel sink abstraction for Zeph.
This crate provides the non-generic infrastructure for slash command dispatch:
ChannelSink— minimal async I/O trait replacing theC: Channelgeneric in handlersCommandOutput— exhaustive result type for command executionSlashCategory— grouping enum for/helpoutputCommandInfo— static metadata for a registered commandCommandHandler— object-safe handler trait (noCgeneric)CommandRegistry— registry with longest-word-boundary dispatchCommandContext— non-generic dispatch context with trait-object fieldstraits— sub-trait definitions for subsystem accesshandlers— concrete handler implementations (session, debug)
§Design
CommandRegistry and CommandHandler are non-generic: they operate on CommandContext,
a concrete struct whose fields are trait objects (&mut dyn DebugAccess, etc.). zeph-core
implements these traits on its internal state types and constructs CommandContext at dispatch
time from Agent<C> fields.
This crate does NOT depend on zeph-core. A change in zeph-core’s agent loop does
not recompile zeph-commands.
Re-exports§
pub use commands::COMMANDS;pub use context::CommandContext;pub use sink::ChannelSink;pub use sink::NullSink;pub use traits::agent::AgentAccess;pub use traits::agent::NullAgent;
Modules§
- commands
- Static registry of all slash commands, used for
/helpoutput generation. - context
- Non-generic command execution context.
- handlers
- Slash command handler implementations.
- sink
- Minimal channel I/O trait for slash command handlers.
- traits
- Sub-trait definitions for command handler context access.
Structs§
- Command
Error - Error type returned by command handlers.
- Command
Info - Static metadata about a registered command, used for
/helpoutput generation. - Command
Registry - Registry of slash command handlers.
Enums§
- Command
Output - Result of executing a slash command.
- Slash
Category - Category for grouping commands in
/helpoutput.
Traits§
- Command
Handler - A slash command handler that can be registered with
CommandRegistry.