Skip to main content

Module state

Module state 

Source
Expand description

Top-level app state — composed of mode, conversation log, prompt buffer, and a shared handle to the engine-state mirror.

Ownership rules:

  • AppState is !Send because of the crossterm backend it will eventually render through; keep it single-threaded.
  • The engine-state mirror is Arc<RwLock<EngineState>> and is written only by the WS subscriber task; the app reads it.
  • Command execution is async and happens in the event loop, not in submit_prompt. submit_prompt only buffers the line into AppState::pending_input; the loop drains it.
  • Persistence is optional. When a SessionSink is present, every log entry is recorded synchronously.

Structs§

AppState
FrictionPause
Live state of a friction-pause overlay.

Enums§

ActiveOverlay
Runtime representation of a live overlay. This exists as a separate enum (not just OverlayTarget) so overlays can carry ephemeral state — scroll offset, filter text, a timer, a typed-confirm buffer — that the input + render layers mutate without going back through dispatch.
FrictionOutcome
Why a friction-pause overlay ended. Used by the event loop to decide whether to re-dispatch the pending command or drop it.
RiskOverlayTrigger
Why the ActiveOverlay::Risk overlay opened.