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.
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-fleetFor Claude Code, Cursor or Codex: installs it and wires the props to your own data.
Paste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install prompt
Install Agent fleet from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/agent-fleet
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add agent-fleet
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/use-floating.ts
- lib/knowns/icons/actor-icon.tsx
- lib/knowns/icons/model-icons.tsx
- lib/knowns/icons/tool-icons.tsx
- lib/knowns/icons/model-icons.data.ts
- lib/knowns/icons/tool-icons.data.ts
- lib/knowns/icons/LICENSES.md
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- components/ui/knowns/dialog.tsx
- components/ui/knowns/status-dot.tsx
- components/ui/knowns/tooltip.tsx
- components/ui/knowns/tooltip-utils.ts
- components/ui/knowns/toggle-group.tsx
- components/ui/knowns/agent-fleet/agent-fleet.tsx
- components/ui/knowns/agent-fleet/fleet-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/agent-fleet, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "agent-fleet" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
null - 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- Default
ticks - Clock time in ms. By default it ticks every second while anything is live.
- formatCost
(usd) => string- Default
formatUsd - Card spend (agent + sub-agents) and the totals.
- title / className
ReactNode / string- Default
"Fleet" / - - Heading above the totals bar.
- aria-label
string- Default
the 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| 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" | "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 | null | 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" | "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 | ticks | Clock time in ms. By default it ticks every second while anything is live. |
| formatCost | (usd) => string | formatUsd | Card spend (agent + sub-agents) and the totals. |
| title / className | ReactNode / string | "Fleet" / - | Heading above the totals bar. |
| aria-label | string | the 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
- 01Lists one card per main agent with its model logo, task, state, spend and clock, in a single column or a grid through layout.
- 02Totals the fleet in the header, such as how many agents are running, and takes title={null} when your page already has a heading.
- 03Unfolds a sub-agent tree under the open agent with wires between parents and children, showing two levels inline and collapsing deeper ones.
- 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.
- 05Opens a sub-agent's tasks in a popover, or in a dialog sheet below 640px.
- 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
| State | What moves | Timing |
|---|---|---|
| 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
- Status dotInstalled with it. Marks the state of each agent.
- DialogInstalled with it. Holds the approval answer and the tasks sheet on small screens.
- Toggle groupInstalled with it. Its Toggle sits on the expand control.
- Agent monitorPairs with it: pick an agent in the fleet, then follow its steps in the monitor.
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
- Following one agent closely: use Agent Monitor.
- Agents passing one piece of work along in order: use Agent Handoff.
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" }).