Skip to content
GitHub (opens in a new tab)

AgentTree

An orchestrator and its sub-agents as a tree, with status, time and cost on every node.

stableOrganismcontracts/agenttree.json

Preview

AgentTree

An orchestrator and its sub-agents. Not TreeView. Not AgentFleet.

Master

Fold a branch with its chevron. Branch costs roll up (Σ); waiting and failed leaves act in place.

Orchestrator · example data

  • Ship v2 billing
    Running8m 12sΣ $0.14
    • Research
      Running2m 10sΣ $0.14
      • scan-codebase
        Running58s$0.14

Usage

AgentTree shows how one orchestrator split its work. Status is always text in its own column. Several independent agents belong in AgentFleet; a file tree is TreeView.

Do's

  • show how an orchestrator split work into sub-agents
  • find which sub-agent waits or failed, and act on it
  • see cost roll up per branch

Don'ts

  • agents side by side with a summary each — AgentFleet
  • one agent over time — AgentMonitor or AgentTrail
  • a file or category hierarchy — TreeView
<AgentTree
  label="Orchestrator"
  root={root}
  folded={folded}
  onFoldedChange={setFolded}
  onApprove={approve}
  onRetry={retry}
/>

An orchestrator and its sub-agents as a tree. Every node shows status, time and cost; branch costs roll up (Σ). Fold branches; approve or retry in place.

When to use

  • show how an orchestrator split work into sub-agents
  • find which sub-agent waits or failed, and act on it
  • see cost roll up per branch

When not to use

  • agents side by side with a summary each — AgentFleet
  • one agent over time — AgentMonitor or AgentTrail
  • a file or category hierarchy — TreeView

What an agent reads

import { AgentTree } from "agentic-ds-kit";
must
  • nested lists; branch chevrons are buttons with aria-expanded and aria-controls
  • status is text in its own column; icons are aria-hidden
  • Approve and Retry name the node
  • aria-busy while loading
  • entry motion animates height, opacity, transform and blur; off under prefers-reduced-motion
  • with onSelect, node names are buttons named "<name>, <status>" with aria-pressed
defaults
  • label Orchestrator
  • currency $
  • loading false
stops if
  • Do not invent a local AgentTree, SubAgentList, or OrchestratorTree
  • Do not use TreeView for agent runs
  • Do not color status without the text label
  • Do not use raw hex

From contracts/agenttree.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
rootobjectNo—{ id, name, status: "queued" | "running" | "waiting" | "done" | "failed", elapsed?, cost?: number, note?, children? }. Missing root shows Empty.
labelstringNoOrchestrator—
foldedstring[]No—Folded branch ids; a folded branch shows "N agents".
onFoldedChangefunctionNo—(folded) => void. Adds the chevron disclosure on branches.
selectedIdstringNo—Selected node id; its row shows the selected ring and its name button aria-pressed.
onSelectfunctionNo—(id) => void. Makes each node name a button, e.g. to open that agent's step elsewhere.
onApprovefunctionNo—(id) => void. Waiting leaf: Approve.
onRetryfunctionNo—(id) => void. Failed leaf: Retry.
currencystringNo$—
loadingbooleanNofalse—
  • Component
    →

    AgentMonitor

    One agent at work: a live clock and running cost lead; finished steps sit in a time strip you can open.

  • Component
    →

    AgentTrail

    A vertical step list for a running agent task: done steps with durations, the current step with a live timer, then pending steps.

  • Component
    →

    TreeView

    Nested hierarchy people open and close level by level to browse, pick, or check items.

  • Component
    →

    Empty

    Placeholder when a list, page, or region has nothing to show.