Loading component…
Loading component…
Hand work to your agents by dragging it onto them – each agent previews its new “busy until” time, or switch to Auto and every new task goes to whoever is free first
To reuse this local React demo, copy all files from the Code tab into the same folder, then import DelegateBoard from ./delegate-board.
import { DelegateBoard, type DelegateAgent, type DelegateTask } from "@/components/ui/delegate-board";
export function Dispatch({ agents, tasks }: { agents: DelegateAgent[]; tasks: DelegateTask[] }) {
return (
<DelegateBoard
agents={agents} // { id, name, model?, avatar?, current? }
tasks={tasks} // { id, title, estimate, tools?, agentId? } – no agentId: unassigned
onAssign={(taskId, agentId) => api.assign(taskId, agentId)} // agentId null: back to unassigned
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| agents | DelegateAgent[] | { id, name, model?, avatar?, current?, rate? } – current: minutes left on the task it runs now, for the Busy until time; rate: cost per minute of work, shown after the model, as the price of a hand-off and as the total in the queues | |
| formatCost | (amount: number) => string | dollars, e.g. "$0.60" | Formats every cost – swap in your currency or credits |
| tasks | DelegateTask[] | { id, title, estimate (minutes), tools?, agentId? }. In each queue the first task is the running one; past three, a +N chip lists the rest in a tooltip on hover or focus | |
| onAssign | (taskId: string, agentId: string \| null) => void | A drop, a keyboard pick or Auto. null means back to Unassigned. Without it the board moves tasks itself | |
| mode / defaultMode | "auto" \| "manual" | "manual" | Auto hands every unassigned task to the least busy agent, about one a second; Manual waits for a drag. The Auto switch sits in the bar |
| onModeChange | (mode: DelegateMode) => void | The Auto switch was turned on or off | |
| suggestion | { taskId, agentId } \| null | A proposed hand-off: the agent lights up and previews its new time, the task is marked | |
| now | number | Date.now() | The clock for the Busy until times |
| title | string | "Delegate" | Heading in the bar |
| className | string | Extra class on the root |
Fills its container up to 720px; below 560px the pile sits above the agents
Works with touch: cards and chips can be dragged with a finger
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"