StatusLineSnapshot class final
Everything one status-bar frame renders from, built entirely host-side (see the library docs: zero fetches, zero subprocesses from here down). Fields the host cannot supply stay null and their segments hide — a hidden segment is data absence, never a fallback string.
Constructors
- StatusLineSnapshot({required String cwd, String? homeDir, String? workRoot, String? modelName, String? providerName, String? thinkingLevel, String? approvalMode, String? agentLoadMode, StatusLineGit? git, String? pr, int contextTokens = 0, int contextWindow = 0, int tokensIn = 0, int tokensOut = 0, int cacheRead = 0, int cacheWrite = 0, double? tokensPerSecond, double? tokensPerSecondAvg, double? costUsd, String? sessionName, String? sessionId, int subagents = 0, Duration elapsed = Duration.zero, int deadlineRemainingMs = -1, DateTime? now, String? hostname, bool idle = true, int? idleChangedAgoMs, String? brandFrame})
-
const
Properties
- agentLoadMode → String?
-
Agent load mode label for
mode(omp,pi, …;defaultrenders as nothing — it is the absence of a special mode).final - approvalMode → String?
-
Approval mode label for
mode(yolo,write, …). Must be the CLI label (ApprovalModeLabel.label), NOT the enum name — the autopilot highlight matches this string against kAutopilotLabel exactly; a host that feeds.name(unattended) silently renders as a plain muted mode with no highlight.final - brandFrame → String?
-
The brand-zone animation frame (gh-1446 AC5): the CURRENT activity
ring glyph, resolved by the host from the compile-time
TuiSymbols.activitySpinnerlist — never model text (a model-authored string can never become a frame).null/idle renders the BLANK frame cell so theFacolumn is constant in both states; while streaming the host passes ringframe % ring.lengthoff the live spinner tick.final - cacheRead → int
-
final
- cacheWrite → int
-
final
- contextPercent → double?
-
Live context pressure as a percent (0–100+);
nullwhen the window is unknown. Derived, never carried: one source of truth.no setter - contextTokens → int
-
Live context estimate: provider-reported usage plus the trailing
in-flight estimate (what the NEXT request carries).
final
- contextWindow → int
-
Effective context window in tokens;
0= unknown (thecontext_pctsegment then rendersused/?and the gauge renders without labels).final - costUsd → double?
-
Running session cost in USD;
null= unpriced model → thecostsegment hides (E2: never$0.00for an unknown price).final - cwd → String
-
Working directory for the
pathsegment.final - deadlineRemainingMs → int
-
gh-1556: LIVE remaining deadline budget in ms for the
timercountdown chip; negative hides the segment. The host recomputes this from itsSessionDeadlineper frame tick — the chip is a pure projection of the one clock, never a second timer source.final - elapsed → Duration
-
Active-processing time for
time_spentand the streaming spinner cadence (idle wall clock excluded).final - git → StatusLineGit?
-
Git working-tree state;
nullor a branchless clean state hides git.final - hashCode → int
-
The hash code for this object.
no setterinherited
- homeDir → String?
-
Home directory root,
~-abbreviated by thepathsegment.final - hostname → String?
-
Machine hostname;
nullhideshostname.final - idle → bool
-
Whether the agent is idle (vs streaming/working): idle dims the bar
and drives the
pibrand fade toward its dim endpoint.final - idleChangedAgoMs → int?
-
Milliseconds since the last idle↔working flip;
null= no flip observed (the brand mark sits at its endpoint). Drives the 450 ms brand fade (see statusLineBrandFadeT).final - modelName → String?
-
Active model id/name;
nullhides themodelsegment.final - now → DateTime?
-
Wall clock for the
timesegment. Injected (never read from the system here) so renders stay pure and testable on a virtual clock.final - pr → String?
-
Host-resolved open PR for the current branch (
#123);nullhidespr(no tool, unauthed, other forge — the host owns that policy).final - providerName → String?
-
Provider display label for
model(the host's_statusProviderLabelpolicy: a saved custom entry's name beats the catalog protocol kind); rendered asprovider / modelwhen non-empty, the bare model otherwise (issue #920).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sessionId → String?
-
Session id (first 8 chars render);
nullrenders thenewfallback.final - sessionName → String?
-
Session display name;
nullhidessession_name.final - subagents → int
-
Live background subagent count; hidden when zero.
final
- thinkingLevel → String?
-
Thinking-level suffix for
model(rendered only when StatusLineSegmentOptions.showThinkingLevel is on).final - tokensIn → int
-
Provider usage counters (cumulative session totals).
final
- tokensOut → int
-
final
- tokensPerSecond → double?
-
Live output rate for
token_rate(tok/s); hidden when null/zero.final - tokensPerSecondAvg → double?
-
Session-average output rate for
token_rate_avg(tok/s): the usage ledger's total output over accumulated active-stream time (gh-1762). Hidden when null — until a completed turn exists it stays null, never0 t/s.final - workRoot → String?
-
Workspace root the
pathsegment strips when StatusLineSegmentOptions.stripWorkPrefix is on.final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited