Skip to content

Agent Monitor

One agent at work, as a card: its current step with a clock and the bill so far, a time strip and the finished steps with each tool's logo, the exact command when it needs your OK, and a small bar when folded.

On this page
Used for
  • Watch one agent work
  • Allow a risky command
  • Pause or cancel a run
  • Show run cost live
  • Summarise a finished run

Examples

Installation

npx knowns-ui@latest add agent-monitor
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

state
"running" | "paused" | "waiting" | "finished" | "failed" | "idle"
Defaultfrom run, else idle
Tag colour and what the well shows. waiting turns the well amber and the footer into Decline / Allow.
agent
{ name, role?, model?, icon? }
Header. model picks the provider logo (modelIcon); icon overrides it.
steps
{ id, label, kind?, tool?, icon?, state, since?, took?, detail?, output? }[]
Default[]
state: queued | running | done | failed. Finished steps list newest first (3 rows, then scroll); every started step gets a bar in the time strip, width ∝ took. tool picks the brand logo, kind a glyph.
current
{ label, tool?, icon?, since? }
Defaultthe running step
The live line in the well, with a ticking clock from since.
since / until / pausedFor
epoch ms / epoch ms / ms
Run clock: (until ?? now) − since − pausedFor, shown as "Finished in 19s". While paused the clock and bars hold.
cost
number | string
Numbers go through formatUsd. Shimmers while running.
ask
{ title, command?, tool?, since? }
While waiting: the title and the exact command as inline code. since grows the amber wait bar.
outcome / error
{ added?, removed?, files?, note? } / ReactNode
Finished: "+1284 −316 · 42 files · Tagged v3.2.0". Failed: the error line.
run / actor
AgentRun / string
Live from a run: the actor's tasks become steps (the tool it called most gives the logo), its open tool call is the current line, spend is the cost, a pending approval is the ask. Allow / Decline emit approval.resolve. Explicit props still win.
onAllow / onDecline
() => void
Allow (⏎) and Decline (Esc) while the card has focus and is waiting - never global. Enter on another control in the card does that control's job.
onPause / onResume / onCancel / onLog
() => void
Each button shows only when its handler is given.
collapsed / defaultCollapsed / onCollapsedChange
boolean
Defaultfalse
Folds into a 40px bar: logo, name, state dot, the tools used, cost. Height animates by grid rows.
a11y
role=group
Labelled by the agent's name; state changes and the ask are announced politely. Rows are buttons that open the step's info card; bars do the same with the mouse.

What it handles

  1. 01Shows the agent's name, role and model logo above a well that holds the current step, a run clock and the cost so far.
  2. 02Runs the clock as until, or now, minus since and pausedFor, so the clock holds while the state is paused.
  3. 03Draws a time strip with one bar per step and finished steps below it with their tool logos and how long each took.
  4. 04Asks for permission with the exact command in inline code, and wires Allow to Enter and Decline to Escape through aria-keyshortcuts.
  5. 05Offers Pause, Resume, Cancel and View log only when you pass the matching handler, and its state label reads Idle, Running, Paused, Needs you, Finished or Failed.
  6. 06Folds to one line with a state dot through collapsed, and derives every field from an actor in a run when you pass run and actor.

States

First render
Nothing. It paints as it is
none
Card collapses or opens
The body folds and fades
280ms, ease out
Strip while running
Bars grow with the clock once a second
none
Strip after the run
Bars settle to their final length
280ms, ease in-out
Step row hover
The row tints
120ms, ease out
Chevron flips
It rotates half a turn
180ms, ease out
Reduced motion
Fold, strip and chevron change at once
0ms

Works with

When to use

When to use

  • Watching one agent at work: current step with a clock and cost, recent steps, and the exact command when it needs your OK.
  • A side panel or card that folds into a small bar when the user looks elsewhere.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Monitor to my app and wire it to my own data.
  • I need watching one agent at work: current step with a clock and cost, recent steps, and the exact command when it needs your OK. Set that up with the Knowns UI Agent Monitor.
  • Which Agent Monitor props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-monitor" }) and search_docs({ query: "agent monitor" }).

Need help?

Stuck on Agent Monitor, or found something off? We read every message.