Expand description
Every input to the reducer.
Msg is an exhaustive sum over three categories:
- User intent — key presses, pastes, slash commands, submit,
cancel, quit. Originates from
app::event_source. - Effect results — stream chunks, tool outcomes, MCP
lifecycle, save/load completion. Originates from
effect::EffectRunnerwhen a spawned task finishes a unit of work. - Housekeeping —
Tick(timer-driven redraw),StatusDismiss,InstructionsChanged(mtime watcher).
Every effect-result variant carries a TurnId. The reducer’s first
gate on any such message is if state.turn.accepts(msg.turn_id())
— messages for a cancelled / superseded turn are dropped without
state change. This is the architectural guarantee that stale
streaming events can never corrupt the current turn.
Structs§
- Key
- Bare key event — deliberately smaller than crossterm’s
KeyEventso the reducer doesn’t depend on crossterm. The app event source does the conversion. - KeyMods
- Startup
Config - Helper for
app::event_source— pass through the MCP config that effect::mcp needs to dispatchInitMcpServersas its first effect. Not aMsgbecause it’s startup-only.
Enums§
- KeyCode
- Msg
- Single reducer input. Non-exhaustive is intentional: adding a new
variant is a deliberate act that forces every reducer arm to
consider it at compile time (the reducer’s match is NOT
_ =>— seereducer.rs). - MsgKind
- Compact kind tag for tracing / replay indexing.
- Paste
- Paste payload. Images come in as raw bytes; text as UTF-8.
- Slash
Cmd - Slash commands — a typed surface over what the user typed as
/<name> [args]. Parsed inapp::event_sourceagainst the singleCOMMAND_REGISTRY; unknown commands produceSlashCmd::Unknownso the reducer can issue a “no such command” status line.