Expand description
Dispatcher — resolves a Command into a DispatchOutput.
The dispatcher is the boundary between “the operator asked for
X” and “the engine did Y.” It owns the HTTP client, reads the
shared EngineState, and returns structured output that the
caller (TUI or non-interactive entrypoint) renders.
Structs§
- Dispatch
Context - Shared context for dispatch. The HTTP client is optional — the TUI launches even when the engine is unreachable, and commands that need it degrade to a clear error line.
- Dispatch
Output - What the dispatcher produced. Mode changes and quits are separate side-channel effects so the caller can apply them without string-parsing lines back.
- Replay
Line - One replayed log entry bound for the conversation pane.
- Static
Label - Trivial
StateSourcethat returns the same label on every call. The default value isLabel::Steady— the “no friction, nothing abnormal” label — so a freshDispatchContextdoes not accidentally gate commands when the engine has not yet reported a state.
Enums§
- Never
- Placeholder error type — the dispatcher’s public signature reserves a Result<…> slot for future commands that need to refuse execution rather than emit a warn line.
- Output
Line - One atomic output action the caller must handle. A single
dispatch can emit multiple — e.g.
/helpemits severalLines.
Traits§
- State
Source - A thin read-only handle to the operator’s current behavioural
label. The dispatcher consults this on every risk-increasing
command to compute the
FrictionDecision.
Functions§
- dispatch
- Parse, resolve, execute. Returns
Ok(None)when the line is empty — callers should skip rendering in that case. - run_
bypass_ friction - Run a
Commandwithout consulting the friction ladder.