Skip to content

Context gauge

In review
Live · web

Context gauge: drag usage past 60% then 85% and watch both forms recolor

Context window

Local Engine · managed
healthy

Token budget

ring
41%CTX
healthy
Usage82K / 200K · 41%

Inline chip strip: the per-session underline (cyan → amber → red); an unmanaged Cloud Agent session shows a faint empty track, never a faked line

primarygatewayauditdocs

Thresholds 0.60 / 0.85 + the band fills are all var(--token). Cyan is healthy, warm is status; the fill grows, the color hard-cuts (never tweens). The island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform. Spec + live demo,
// not yet exported from @dizyx/nockerl-react; promotion is tracked.)
// Linear bar + ring share one threshold model (0.60 / 0.85) and the same
// formatTokenCount readout ("82K / 200K · 41%"). Cyan = healthy, warm = status.
export function SessionContext({ tokens, contextWindow }: ContextState) {
return (
<>
<ContextGauge form="bar" used={tokens} total={contextWindow} />
<ContextGauge form="ring" used={tokens} total={contextWindow} />
</>
);
}
// Compact inline form for a session chips bar. An unmanaged (Cloud Agent)
// session passes used={null} → a faint empty track, never a faked fill.
<ContextGauge form="chip" used={null} total={contextWindow} label="docs" />
PropTypeDefaultDescription
used *number | nullTokens consumed. null = unmanaged session (no data) → a faint empty track, never a faked fill.
total *numberContext-window capacity in tokens. Defaults to 200_000 upstream when the gateway omits it.
form'bar' | 'ring' | 'chip''bar'Linear meter, ring/arc gauge, or the compact inline chip underline.
labelstringOptional name shown on the chip form (the session slug).
lowThresholdnumber0.60Ratio below which the fill is cyan (healthy). Matches Android CONTEXT_LOW_THRESHOLD.
highThresholdnumber0.85Ratio at/above which the fill is red (critical); between the two it is amber. Matches CONTEXT_HIGH_THRESHOLD.