ComponentsAI & chat

Agent Fanout

One agent starts others, and they start more. Each agent is a card with its model, tools, task, status, and run time. Lines draw in as agents start, and the header counts what is running, needs you, or failed.

SourceRegistry JSON

Installation

pnpm dlx shadcn@latest add https://sprout.tulipfarm.ai/r/agent-fanout.json

Copies Agent Fanout and the components it uses (Badge, Brand Icon, Button, and Popover) into your app, installs the packages, and adds the styles. Then import it from @/components/ui/agent-fanout. Needs Tailwind CSS 4 and a components.json from shadcn init.

Usage

Agent Fanout usageTSX
import { AgentFanout } from "@tulipfarm/sprout/agent-fanout";

<AgentFanout
  agent={{
    id: "orchestrator",
    name: "Orchestrator",
    model: "Opus 5.5",
    brand: "claude",
    tools: ["slack", "notion", "github"],
    task: "Launch the new pricing page by Friday",
    status: "running",
    elapsed: 14000,
    agents: [
      {
        id: "researcher",
        name: "Researcher",
        model: "GPT-5.5",
        brand: "openai",
        tools: ["notion", "slack"],
        task: "Compare the pricing of five competitors",
        status: "running",
        elapsed: 7000,
      },
    ],
  }}
  onRetry={retry}
  onDismiss={dismiss}
  onOpen={open}
/>

Pass the agent that started the run as agent, and the agents it started as its agents, as deep as they go. Your app owns the run: move each status through queued, running, needs-you, done, failed, and stopped, and tick elapsed in ms.

brand picks the model's logo from Brand Icon, and model names it. Pass icon for agents that are not a known model. tools are Brand Icon names; past four, the last shows as a count.

Needs you and failed

Agents that need you or failed get a button in the header. It opens a list with each agent's task and reason. Pass onOpen to add Open to agents that need you, and onRetry and onDismiss to add Retry and Dismiss to failed ones. The component does not change the run itself. In the demo above, Retry stops the failed agent and starts a new one, and Dismiss stops it.

Board update

8 agents, 3 running, 1 needs you, 1 failed
  • LeadOpus 5.5
    Running

    Prepare the quarterly board update

    • AnalystSonnet 5.5
      Running

      Gather the numbers for the quarter

      • FinanceHaiku 4.5
        Done

        Pull revenue and burn from the ledger

      • ProductHaiku 4.5
        Needs you

        Summarize what shipped

    • DesignerGPT-5.5
      Running

      Lay out the slides in the board template

      • ChartsHaiku 4.5
        Failed

        Render the revenue charts

      • CopyHaiku 4.5
        Stopped

        Draft speaker notes

      • ReviewerHaiku 4.5
        Queued

        Check every number against the ledger

Layout

The agents the root starts sit side by side, joined by one line. Deeper agents stack under their parent. When the row runs out of room, it first narrows the gaps between cards, then the cards themselves, down to --sprout-agent-fanout-card-min. Narrow cards give the whole header to the name: the status moves to the footer as an icon, and the tools move above the task when it gets cramped. With layout="auto", the default, the tree turns into a list only when even narrow cards do not fit, so every agent stacks under its parent. Set layout="list" to always stack, or layout="tree" to always use a row, which narrows the same way and then scrolls sideways.

Checkout audit

5 agents, 2 running, 1 needs you
  • Main agentOpus 5.5
    Running

    Audit the checkout flow before launch

    • UX reviewSonnet 5.5
      Done

      Walk every checkout step on mobile

    • PerformanceGPT-5.5
      Running

      Profile the payment page load

    • AccessibilityHaiku 4.5
      Needs you

      Check forms with a screen reader

    • CopyGrok 5
      Queued

      Proofread every error message

The number in a card's footer shows or hides the agents it started. Pass defaultCollapsed with agent ids to start them hidden.

Board update

8 agents, 3 running, 1 needs you, 1 failed
  • LeadOpus 5.5
    Running

    Prepare the quarterly board update

    • AnalystSonnet 5.5
      Running

      Gather the numbers for the quarter

      • FinanceHaiku 4.5
        Done

        Pull revenue and burn from the ledger

      • ProductHaiku 4.5
        Needs you

        Summarize what shipped

    • DesignerGPT-5.5
      Running

      Lay out the slides in the board template

Motion

A new agent's line draws from its parent, then its card fades in. Other cards slide to make room, status badges swap in, and header counts roll. Hidden or removed cards fade out where they stood while their lines retract. Nothing animates on first load. With reduced motion, cards and lines only fade and the running spinner stops.

Accessibility

The tree is a nested list, labeled by who started each level, so screen readers hear its depth. Lines are hidden from them. Each footer button says what it does, such as “Hide 3 agents started by Orchestrator”, and reports whether its list is open. One live status reads the header counts when they change. Run times are <time> elements and stay quiet.

Theme tokens

Cards use --sprout-surface, --sprout-line, and --sprout-radius-panel, like Card. Statuses use the Badge colors. Lines use --sprout-agent-fanout-line, a neutral mix of --sprout-border-strong and --sprout-line. Lines leading to running agents use --sprout-agent-fanout-line-active, a mix of --sprout-info. Set --sprout-agent-fanout-card (17.25rem), --sprout-agent-fanout-gap (3rem), and --sprout-agent-fanout-indent (2.5rem) to change the card width, the space between side-by-side cards, and how far stacked agents indent. --sprout-agent-fanout-card-min (9.5rem) and --sprout-agent-fanout-gap-min (1rem) set how far the row shrinks before it turns into a list.