Loading component…
Loading component…
This component has not been implemented locally yet.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Tasks from ./agent-tasks.
import { AgentTasksScreen } from "@/components/ui/agent-tasks";
export default function Page() {
const [tasks, setTasks] = useState(initialTasks);
return (
<AgentTasksScreen
tasks={tasks}
projects={["Northwind", "Platform", "Evalkit"]}
artifacts={files}
onCreate={(task) => api.startTask(task.title, task.project)}
onOpenInbox={(taskId, itemId) => router.push("/inbox?item=" + itemId)} // Decide, and a row's Needs you
onSelect={(id) => api.markSeen(id)}
onNavigate={(label) => router.push(routes[label])} // "Inbox", "Agent Orchestration", the sidebar's items
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| onNavigate | (label: string) => void | Called with the label of a sidebar item – with "Agent Orchestration" from Show agents, and with "Inbox" from Decide when there's no onOpenInbox | |
| workspace | string | "Fieldwork" | The workspace in the sidebar |
| tasks | { id; title; project; status?: "planning" \| "running" \| "paused"; statusText?; steps?; artifacts?; asks?; needs?; updatedAt; done?; goal?; started?; history?; decided? }[] | Every task. statusText is where it is in words ("Writing the draft") – without it the status and its asks say it; steps { label, done? } fill the ring and show as 2/4; asks are what waits on you in the Inbox (see below) – the amber Needs you counts them; needs is that count for a task without asks listed; updatedAt a timestamp in ms; done lists it under Done ("Done · Tue"); history is what happened so far, newest first; decided { question, answer, at } what you chose for it before. Pass a stable array (state) – the screen follows it when it changes | |
| tasks[].asks | { id; question; kind?: "decision" \| "pick" \| "approval" \| "question" }[] | What the task waits on you for – the Inbox's items, by their ids there. The row's Needs you counts them (and the sidebar's Inbox count adds them up); the panel shows "1 decision waiting" with the first question and a dark Decide that calls onOpenInbox with its id. The decision itself is made in the Inbox | |
| projects | string[] | in the order they appear in tasks | The projects, in the order their groups show – and the choices for a new task |
| artifacts | Record<string, { updated?; doc?; table?; sheet?; code?; image?; files?; preview? }> | What each artifact shows in its tab, by file name – the App Shell's viewers: a document you write in, a sheet with formulas, a folder, code or an image | |
| defaultTab | "active" \| "done" | "active" | The list the screen opens with |
| defaultSelected | string \| null | "ingest" | The task open on the right when the screen starts |
| onSelect | (id: string) => void | Called when a task is opened | |
| onCreate | (task: AgentTask) => void | Called with a new task – it lists at the top of its project, planning, with a dashed ring | |
| onOpenInbox | (taskId: string, itemId?: string) => void | Called with the panel's Decide and a row's Needs you badge – open the Inbox at that item (the agent Inbox's defaultSelected). Without it the screen calls onNavigate("Inbox") | |
| onOpenArtifact | (task: string, name: string) => void | Called when an artifact opens in its own tab of the Task panel | |
| onArtifactChange | (name: string, artifact: ShellArtifact) => void | Called with the whole artifact whenever you change it in its tab – the screen keeps the change while it lives; save it here | |
| suggested | WorkspaceSource[] | a few of the artifacts | Suggested in a New tab of the Task panel (the + after its tabs) – one with an artifact opens it in that tab |
| labels | { tasks?; active?; done?; newTask?; create?; placeholder?; needsYou?; decide?; decisionOne?; decisionMany?; showAgents?; happened?; … } | Labels, e.g. for a translation | |
| loading | boolean | While your tasks load: gray rows in the list and gray lines in the Task panel, in the shape of the real ones (the shared Skeleton) | |
| empty | boolean | No tasks at all: Active shows No active tasks with a sentence on how to start and a New task button that opens the new-task line, Done shows Nothing done yet, and the Task panel shows nothing open | |
| user | { name: string; avatar?: string } | { name: "Alex Morgan" } | Account at the bottom of the sidebar |
| className | string | Extra class on the root |
Fills its container – give it the full viewport height in your app
Rows have one fixed height; steps, artifacts and time sit in fixed columns so they line up; the status words give way before the title does
Below 900px the head shares one centerline with the App Shell's corner buttons – title, count, Active / Done and + all on it
Below 560px each row takes two lines – the title, and where it is under it – and the counts make room; a row opens its task in the App Shell's sheet from the right
Touch targets grow to 36px and shortcut hints hide on touch screens
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"