Raxol. UI. Components. Harness. AxolFace
(Raxol v2.6.1)
View Source
The axol face ≡··≡ — the harness identity/status layer.
A fixed four-display-column glyph: the gills (≡) are constant, the two
eyes carry the agent's state. The face swaps in place, no width jitter,
so it can sit in a status strip and never disturb layout.
States
| State | Cycle | Motif |
|---|---|---|
:boot | ≡--≡ → ≡··≡ → ≡oo≡ → ≡··≡ | wake blink |
:idle | ≡··≡ … ≡--≡ | neutral, slow blink |
:thinking | ≡··≡ → ≡''≡ → ≡..≡ | eyes drift |
:working | ≡oo≡ → ≡OO≡ | pupils pulse |
:done | ≡^^≡ | happy squint |
:error | ≡xx≡ | knocked-out eyes |
The state maps directly from harness contract events (see
Raxol.UI.Components.Harness.AxolFace usage in the mix raxol.code
surface): turn_started → :thinking, tool activity → :working,
turn_completed{final} → :done, error → :error, otherwise
:idle. Frame advance is event-driven (bump on each item_delta) or a
subscription tick.
Single source of truth
glyph/3 is a pure function of (state, frame, ascii?) so every
surface — the CLI boot beat, this TUI component, an SSE status line —
renders the identical face. ascii?: true selects an ASCII-only
fallback (gills =, ASCII eyes) for terminals without a UTF-8 font;
the branded ≡ face is the default (it is single display-width and
renders in modern terminals).
Summary
Functions
Foreground color for a state's face (nil = terminal default).
The face glyph for state at frame, ASCII if ascii?.
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
The face states, in canonical order.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.
Types
@type face_state() :: :boot | :idle | :thinking | :working | :done | :error
@type t() :: %{ id: String.t() | atom(), state: face_state(), frame: non_neg_integer(), ascii: boolean(), style: map(), theme: map() }
Functions
@spec color(face_state()) :: atom() | nil
Foreground color for a state's face (nil = terminal default).
@spec glyph(face_state(), non_neg_integer(), boolean()) :: String.t()
The face glyph for state at frame, ASCII if ascii?.
Pure: the single source of truth shared by every surface. frame wraps
over the state's cycle length, so any non-negative integer is valid.
Callback implementation for Raxol.UI.Components.Base.Component.handle_event/3.
Callback implementation for Raxol.UI.Components.Base.Component.mount/1.
@spec states() :: [face_state()]
The face states, in canonical order.
Callback implementation for Raxol.UI.Components.Base.Component.unmount/1.
Callback implementation for Raxol.UI.Components.Base.Component.update/2.