KQ-783 · CONTEXT/METER

Context Meter

A ring built from one arc per message, laid end to end from twelve o'clock. A new message's arc draws to its share of the window on glide while the earlier arcs slide to their new starts, and the centre percentage rolls its digits on snap. At the warn line the ring turns warn and a note with a Summarise button unfolds under measured height; the host folds older messages into one and the folded arcs fade. Past the limit the ring turns danger.

KQ-783 · CONTEXT/METER
Fernworks Model 3 · 48k windowWithin the window
Used
0 / 48k
Messages
0
Free
48k

0k of 48k · 0% · 0 messages

Install

One command — the source lands in your repo. Or copy it from the Code tab.

$ pnpm dlx shadcn@latest add @kinetiq/context-meter

Props

messages
ContextMessage[]
default
The window's contents, oldest first; each carries its tokens and who wrote it.
limit
number
default
The window size in tokens.
warnAt
number
default 0.8
Fraction of the window at which the ring warns and offers to summarise.
onSummarize
() => void
default
Fires from the Summarise button; fold older messages into one here.
label
string
default
Names the meter.
format
(tokens: number) => string
default
Formats the token readout; defaults to a compact form like 38.4k.