pub struct DispatchOutput {Show 13 fields
pub lines: Vec<OutputLine>,
pub replay_lines: Vec<ReplayLine>,
pub mode_change: Option<ModeTarget>,
pub show_overlay: Option<OverlayTarget>,
pub quit: bool,
pub clear_log: bool,
pub risk: Option<RiskDirection>,
pub friction: Option<FrictionDecision>,
pub pending_command: Option<Command>,
pub verbose_toggle: Option<bool>,
pub wrap_off_toggle: Option<bool>,
pub coaching_reset: bool,
pub dismiss_overlay: bool,
}Expand description
What the dispatcher produced. Mode changes and quits are separate side-channel effects so the caller can apply them without string-parsing lines back.
Fields§
§lines: Vec<OutputLine>§replay_lines: Vec<ReplayLine>Replayed log rows the TUI should append without
persisting. Empty for every command except /resume, where
the dispatcher emits one entry per event from the prior
session’s event log. Kept as a separate field (rather than
an OutputLine::Replayed variant) so the routing rule
“replay = silent, lines = recorded” is enforced at the
type level — a future contributor cannot accidentally flip
a normal line into silent mode or vice versa.
mode_change: Option<ModeTarget>§show_overlay: Option<OverlayTarget>Open a modal overlay on top of the current mode. The dispatcher only signals intent; the TUI resolves presentation + dismissal keybinds.
quit: bool§clear_log: bool§risk: Option<RiskDirection>§friction: Option<FrictionDecision>Friction decision applied to the command. Always present
when risk is. Proceed means “the command was run
immediately”; Pause / TypedConfirm means “the command
was not run — the caller must honor the friction before
re-dispatching.” That split is why Decision is emitted
as data rather than baked into the line output.
pending_command: Option<Command>Carries the resolved Command when DispatchOutput::friction
is Pause or TypedConfirm, so the caller (TUI) can open
a friction overlay and, after the pause elapses and any
typed confirmation lands, re-run the command with
run_bypass_friction. None for Proceed (the command
already ran) and for commands without a risk direction.
verbose_toggle: Option<bool>Verbose-mode intent emitted by /verbose. None means
“leave it alone.” A Some(new_state) carries the target
boolean the TUI should swing to — the dispatcher resolves
Toggle against [DispatchContext::verbose_snapshot] so
the TUI is free of the toggle semantics and every
downstream caller sees an absolute state, not an
instruction.
wrap_off_toggle: Option<bool>Wrap-off intent emitted by /wrap-off. Some(true)
means “skip wrap on the next /quit / session end for
this session only” — the flag never persists across
sessions (per ADDENDUM_A §9.1). None means the
command did not touch the flag.
coaching_reset: boolCoaching-reset intent emitted by /coaching reset.
true means the TUI should empty its coaching buffer.
Kept as a boolean (not an Option<()>) so the default
value is immediately legible.
dismiss_overlay: boolDismiss any active modal overlay. Used by commands whose
“purpose” is to clear operator context (/clear) or by
failure paths in commands that might otherwise leave a
stale overlay floating (e.g. /evaluate <coin> when the
engine returns an empty body — we emit an alert line and
signal dismissal so the operator is not left staring at
an older, unrelated verdict card). Ignored when
DispatchOutput::show_overlay is Some — opening and
closing in the same tick would be contradictory, and
show_overlay wins because the data path is the reason
the command ran.
Implementations§
Source§impl DispatchOutput
impl DispatchOutput
pub fn with_line(self, l: OutputLine) -> Self
Trait Implementations§
Source§impl Clone for DispatchOutput
impl Clone for DispatchOutput
Source§fn clone(&self) -> DispatchOutput
fn clone(&self) -> DispatchOutput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more