Loading component…
Loading component…
One agent at work: the person who asked, the agent with a work area, the files it was given and its tools as cards, joined by soft connectors with a light on the one in use
To reuse this local React demo, copy all files from the Code tab into the same folder, then import AgentWorkbench from ./agent-workbench.
import { AgentWorkbench, type WorkbenchStep, type WorkbenchTool } from "@/components/ui/agent-workbench";
const tools: WorkbenchTool[] = [
{ id: "gmail", name: "Gmail", logo: <GmailLogo />, scope: "Read & send · ryan@lumen.co", last: "Sent the weekly digest", when: "2h ago" },
{ id: "calendar", name: "Google Calendar", logo: <CalendarLogo />, scope: "Read & book · Work" },
];
const steps: WorkbenchStep[] = [
{ id: "s1", text: "Reading Ryan's request", at: "user" },
{ id: "s2", text: "Checking Marc's calendar next week", at: "calendar", running: true },
];
export function Workbench() {
return (
<AgentWorkbench
user={{ name: "Ryan Brooks", photo: "/ryan.jpg", message: "Find 30 minutes with Marc next week." }}
agent={{ id: "assistant", name: "Assistant", subtitle: "Works in your Google account" }}
tools={tools}
files={[{ id: "budget", name: "budget-q4.xlsx", logo: <ExcelLogo />, meta: "48 KB" }]}
steps={steps}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| user | { name, message, photo?, avatar? } | Who asked, on the left – their photo URL shown round beside the name (avatar takes your own node instead), and their message; without a photo, or if it doesn't load, the person's full mark | |
| agent | { id, name, subtitle?, details? } | The agent in the middle – its pixel mark from its id, twinkling while it works; click it and its info card opens below with details, what it does now, its steps and the tools it used | |
| tools | WorkbenchTool[] | Its tools below as cards – logo, name, what each may do and where, and what it did last; up to four, with more the last spot sums up the rest ("+3 more tools") | |
| WorkbenchTool.scope / last / when | string / string / string | "Read & send · ryan@lumen.co", its last action and when – while it's called, what it does now shows instead | |
| WorkbenchTool.details / WorkbenchFile.details | { label, value }[] | Lines in the info card that opens below a tool or a file when it's clicked – a tool's card also lists what it did for this request | |
| files | WorkbenchFile[] | What it was given, on the right under a macOS folder – name, logo and a short meta like "48 KB"; up to four, then "+N more"; a file without a logo gets a plain page | |
| steps | WorkbenchStep[] | What it did and does, oldest first – the last three show in its work area, newest on top | |
| WorkbenchStep.at / running | string / boolean | Where it reaches – a tool id, "files" or "user" – and whether it still runs; the running step's line carries the light | |
| reading | string | The id of the file it reads right now – lit up in the list | |
| done | boolean | Finished – the status says Done and nothing runs | |
| title | string | The section's accessible name | |
| className | string | Extra class on the root – set the color variables on it |
Fills its container's width – the person, the agent and the files in a row, the tools in a row below, joined by soft rounded connectors with a hollow dot at each end
Below 720px everything stacks – the person, the agent, the files, then the tools – and the connectors step aside
Long names, scopes, file names and steps end in … with the full text on hover; the message keeps to four lines
Broken data holds: a photo that doesn't load shows the person's mark, a step without text says Working… or Done, a tool without a last action says Nothing yet, no steps at all reads Waiting for a request
One or two tools stay card-sized in the middle instead of stretching across
The classic style has rounder cards, pill tags and status and firmer type – the same behavior as the clean one
The work area keeps three rows of the same height, so the card never jumps as steps come in
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"