Skip to content

Agent Fleet

Every main agent at a glance: what it is working on, its tools, spend and clock, and how its sub-agents are doing. Open one to see its tree, and approve or retry right there.

On this page
Used for
  • Many agents at a glance
  • Approve from a list
  • Retry failed agents
  • Track fleet spend
  • Drill into sub-agents

Examples

Layout

Grid

Installation

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

Props

runs
AgentRun[]
One row (or card) per run. The root agent is the row; other agents nest under the agent that first called them. Tasks become steps, pending approvals make an agent Needs you.
agents
FleetAgent[]
Or plain data: { id, name, model?, icon?, state, task?, tools?, spend?, startedAt?, endedAt?, request?, error?, steps?, children? }. Shown before run cards.
state
"queued" | "running" | "waiting" | "done" | "failed" | "stopped"
Spelled out as Queued, Running, Needs you, Done, Failed, Stopped (queued and stopped are muted).
layout
"list" | "grid"
Default"list"
List: one agent per row in a single column (mark, name and model, current task, status, needs you, spend, clock; the numbers line up). From 520 to 820px wide the clock is left out and needs you goes under the task; below 520px a row takes two lines. Grid: cards side by side, as many columns as there are agents up to the width.
open / defaultOpen / onOpenChange
string | null
Defaultnull
Id of the main agent whose sub-agents are open, one at a time. List: the tree unfolds right under its row, hanging from the row's mark by guide lines drawn in each row's own box. Grid: its own row under that card's row (the other cards dim), with connectors that grow from the parent into each child.
Depth
-
Children and grandchildren show inline; deeper agents collapse into a "N sub-agents ›" chip (amber / red when something below needs you or failed). The chip, Enter or → drills in, with a breadcrumb; ← or Backspace goes back up. "Expand all" shows up to 4 levels.
Tasks
-
Click a sub-agent (or Space / Enter on it) for a Tasks popover under the card: tool, title, duration, live running and failed rows, Approve / Reject for a waiting one. A bottom sheet below 640px.
onSelect
(agent) => void
A card was clicked.
onResolve
(agent, action) => void
Shows Approve / Reject on waiting agents and Retry / Dismiss on failed ones. For run agents, approve / reject also emit approval.resolve.
density
"compact" | "comfortable"
Default"compact"
Compact: 14px titles, 14px padding, cards at least 248px wide, so 3-4 a row on a wide page, 2 at tablet width and 1 on a phone. Comfortable: 16px titles, 20px padding, cards from 320px.
now
number
Defaultticks
Clock time in ms. By default it ticks every second while anything is live.
formatCost
(usd) => string
DefaultformatUsd
Card spend (agent + sub-agents) and the totals.
title / className
ReactNode / string
Default"Fleet" / -
Heading above the totals bar.
aria-label
string
Defaultthe title
The region's name for screen readers. With two fleets on one page, give each its own.
Summary
-
One quiet line: agents / sub-agents, running, needs you, cost (whole trees, any depth). Running and needs-you changes are announced politely.
Keyboard
-
Main rows and cards are buttons (aria-expanded, aria-controls); in the list ↑ ↓ Home End move between rows. The tree (role=tree, real aria-level): ↑ ↓ Home End move, → drills into a collapsed agent, ← goes to the parent or back up, Enter / Space opens Tasks, Esc closes and returns to the card.

What it handles

  1. 01Lists one card per main agent with its model logo, task, state, spend and clock, in a single column or a grid through layout.
  2. 02Totals the fleet in the header, such as how many agents are running, and takes title={null} when your page already has a heading.
  3. 03Unfolds a sub-agent tree under the open agent with wires between parents and children, showing two levels inline and collapsing deeper ones.
  4. 04Adds Approve and Reject to waiting agents and Retry and Dismiss to failed ones when you pass onResolve, and emits approval.resolve on the run.
  5. 05Opens a sub-agent's tasks in a popover, or in a dialog sheet below 640px.
  6. 06Moves between rows with Up, Down, Home and End, opens one with Enter or Space, and builds cards from runs, so each run's root agent is a card.

States

First render
Nothing. The cards paint as they are
none
Open a tree
Nodes slide in from the left, up to 10 of them
180ms, ease out
Drill into a sub-agent
The tree slides to its new root
280ms, ease out
Close a tree
The tree fades and slides out
180ms, ease out
Card hover
The border darkens
180ms, ease out
Row hover
The row tints
120ms, ease out
Wire packet
A lit packet loops along a live wire
none
Reduced motion
The tree fades only
120ms, opacity only

Works with

When to use

When to use

  • An overview of many main agents: model, task, tools, state, spend and clock per card, with totals on top.
  • Approving or retrying sub-agents without leaving the overview.

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 Fleet to my app and wire it to my own data.
  • I need an overview of many main agents: model, task, tools, state, spend and clock per card, with totals on top. Set that up with the Knowns UI Agent Fleet.
  • Which Agent Fleet props do I need for a minimal setup? Show me a short example.

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

Need help?

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