agent state badge: idle / thinking / offline + age timer

new badge between the status line and the terminal. shows current
state with a glyph + label + age suffix (e.g. '🧠 thinking · 12s').
state transitions are driven from existing SSE turn_start/turn_end —
no harness changes needed. on page load, history backfill detects an
in-flight turn (turn_start without matching turn_end) and starts in
thinking. state-just-changed flash kicks in on each transition. age
timer ticks client-side every 1s.

compacting/napping states will be added when /compact and nap land —
their slots are reserved in the state enum, just unused for now.
This commit is contained in:
müde 2026-05-15 19:36:29 +02:00
parent 0cc25d33d8
commit 211599c589
3 changed files with 96 additions and 2 deletions

View file

@ -13,6 +13,10 @@
<p class="meta">loading…</p>
</div>
<div id="state-row">
<span id="state-badge" class="state-badge state-loading">… booting</span>
</div>
<div class="terminal-wrap">
<div id="live" class="live terminal"><div class="meta">connecting…</div></div>
<div id="term-input" class="term-input"></div>