Crew tree
A lead and its sub-agents as one live tree of cards – what each does now, how full its context is, its tools and the last thing it was handed; handoffs run as a light along the connectors, a click opens the details with steering, and a switcher swaps projects.
oxyn add crew-treersx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Rendered from Rust at build time · goes live when visible
When to use
- A lead and its sub-agents as one live tree of cards: every agent stays on screen, each card says what it does right now, how full its context is, its tools and the last thing it was handed.
- Handoffs run as a light along the rounded connectors and light up the card they reach; a click opens the agent's details with steering; a switcher swaps projects.
When not to use
- An agent asks before it acts: use Approval Card instead.
- Several open requests in one card: use Approval pager instead.
- An agent's question in its own card above the composer: use Decision Card instead.
Installation
Crew tree is free and MIT. The oxyn CLI copies its code, and the components it needs, into src/oxyn/ of your Dioxus or GPUI project, so it is yours to change.
cargo install --git https://github.com/ismailqureshi72/Oxyn oxyn-cli
oxyn init
oxyn add crew-treeuse crate::oxyn::{CrewTree, STATUS_INDICATOR_CSS};Rather depend on the crate? cargo add oxyn-dioxus oxyn-core --git https://github.com/ismailqureshi72/Oxyn, then use oxyn_dioxus::{CrewTree, STATUS_INDICATOR_CSS};
Usage
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Examples
Default
A lead and three sub-agents with their helpers; handoffs run along the connectors and light up the card they reach, contexts fill, and the lead ends up asking you to merge.
Code
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Working details
The lead's details while it works: task, model, usage, tools, last handoff and Message / Pause / Stop.
Stop the payment page crashing on empty baskets, get it reviewed and shipped
Claude OpusCode
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Needs you
The run settled with the lead waiting: "1 needs you" in the header and Message / Decline / Approve in its details.
Stop the payment page crashing on empty baskets, get it reviewed and shipped
Claude OpusCode
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Launch
Another project from the switcher: the launch post crew (Editor, Researcher, Writer with its Fact checker, SEO).
Code
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Narrow
Narrow: every level indented, the cards as wide as there is room.
Code
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}Classic
Classic style: elevated cards, a grey footer band and filled badges.
Code
rsx! {
CrewTree {
root: Some(crew()),
handoffs: handoffs(),
projects: projects(),
now: clock.now(),
on_steer: move |(agent, action, message)| steer(agent, action, message),
on_project: move |id| switch_to(id),
}
}API reference
CrewTree
| Prop | Type | Default | Description |
|---|---|---|---|
root | Option<CrewCard> | Default::default() | The lead and its tree (the demo project's crew when `None`). |
handoffs | Vec<CrewHandoff> | Default::default() | Handoffs; new ids run a light (the demo's when `root` is `None`). |
title | String | Default::default() | Header title when there are no projects. |
projects | Vec<CrewProject> | Default::default() | Projects for the switcher (the demo's three when `root` is `None` and this is empty). |
project | String | "checkout" | The project at the start. |
at | Option<u64> | Default::default() | Freeze the demo at this many ms into a pass (a settled state). |
open | String | Default::default() | The card whose details are open at the start (agent id). |
nowrequired | ClockMs | — | The clock. |
style | String | Default::default() | `clean`, `classic`, or empty to follow `data-cstyle`. |
on_steer | EventHandler<(String, String, String)> | — | A steering action: (agent id, action, message). |
on_select | EventHandler<String> | — | A card was opened (agent id). |
on_project | EventHandler<String> | — | Another project was chosen (its id). |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Into the crew – one stop for all cards – then the project switcher |
| ← → ↑ ↓ | Walk the cards |
| HomeorEnd | The lead, the last card |
| EnterorSpace | Open or close the card's details |
| Esc | Close the message field, then the details – focus goes back to the card |
| ↑ ↓ Enter | In the project switcher: pick a project; Esc closes it |
Accessibility
- A tree; every card is named with its status, activity and context – "Coder: Working, Editing basket.ts, context 38%" – and says it opens a dialog.
- The details are a dialog named after the agent; close, steering buttons and the message field are reachable by Tab.
- The project switcher is a button with a listbox; the current project is marked as selected.
- A polite live region reads each handoff and each steering action – "Lead handed to Coder: Handle empty baskets", "Paused Coder".
Responsive behaviour
- Wide (760 px): sub-agents side by side under the lead; narrower: every level indented.
- Rows are fixed, so a changing activity or context never moves a card or a connector.
- Long names, activities and tasks end in … with the full text on hover.
Edge cases (spec)
Wide at 760 px; below that every level is indented and cards take the remaining width. Rows are fixed, so changing activity or context never moves a card. Below 420 px the "N agents" count drops. Long names, activities and tasks end in an ellipsis with the full text on hover. Context values outside 0–1 or NaN are clamped; a NaN cost is left out.
Notes for AI
- Import
CrewTreefromoxyn_dioxusand includeSTATUS_INDICATOR_CSSplus the token stylesheet once. - A GPUI version exists:
CrewTreeElinoxyn_gpui. - Props to set first:
now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.