Loading component…
Loading component…
What your orchestrator needs from you, one question at a time – pick an option, a variant or approve, send it in a keystroke and the next one glides in.
To reuse this local React demo, copy all files from the Code tab into the same folder, then import Agent/Inbox from ./inbox.
import { InboxScreen } from "@/components/ui/inbox";
export default function Page() {
const [items, setItems] = useState(initialItems);
return (
<InboxScreen
items={items}
running={tasks.filter((t) => t.running).length}
onDecide={(id, answer) => api.answer(id, answer)}
onLater={(id) => api.snooze(id)}
onNavigate={(label) => router.push(routes[label])}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| onNavigate | (label: string) => void | Called with the label of a sidebar item – and with "Tasks" from the empty state | |
| workspace | string | "Fieldwork" | The workspace in the sidebar |
| items | { id; kind: "decision" \| "pick" \| "approval" \| "question"; question; context?; task; at; unread?; options?; facts?; suggestions?; done? }[] | Everything the orchestrator asked. at is a timestamp in ms; options { id, title, summary?, recommended?, pros?, cons?, wireframe?, preview? } for decision and pick – the recommended one is chosen when it opens; facts { label, value } for approval; suggestions for question; done { answer, at, label? } lists it under Done. Pass a stable array (state) – the screen follows it when it changes | |
| running | number | 3 | How many tasks keep running – the line under "You're all caught up" |
| defaultTab | "open" \| "done" | "open" | The list the screen opens with |
| defaultSelected | string | The item open when the screen starts, by id – for a deep link, e.g. a task's Decide on the Tasks screen (?item=queue); it opens in its own list, and on phones full-width | |
| onDecide | (id: string, answer: { option?: string; text?: string } \| "approve" \| "decline") => void | Called when you send – with the chosen option, what you wrote in the reply field, or both; approve / decline for an approval | |
| onLater | (id: string) => void | Later – the item moves to the end of the open list | |
| onReopen | (id: string) => void | Reopen on a done item – it moves back to the top of the open list | |
| onSelect | (id: string \| null) => void | Called when another item shows, and with null when none is left | |
| tasks | Record<string, { goal?; project?; status?; started?; steps?; artifacts? }> | About each task, by its name – shown in the Task panel on the right | |
| defaultOpenArtifacts | { task: string; name: string }[] | Artifacts already open as tabs in the Task panel when the screen starts – once every tab was closed, the panel comes back with the task alone | |
| 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 |
| onOpenArtifact | (task: string, name: string) => void | Called when an artifact opens – from the Task panel, a done item or a folder | |
| onArtifactChange | (name: string, artifact: ShellArtifact) => void | Called with the whole artifact whenever you change it in its tab – a cell, a column width, a style, the document's text, a folder's entries. The screen keeps every change itself while it lives (switch tabs, close and reopen); save it here | |
| labels | { inbox?; open?; done?; send?; later?; approve?; decline?; reopen?; recommended?; reply?; answer?; sent?; caughtUp?; tasks?; running?: (n) => string; … } | Labels, e.g. for a translation | |
| user | { name: string; avatar?: string } | { name: "Alex Morgan" } | Account at the bottom of the sidebar |
| loading | boolean | While your items load: gray rows in the list, a gray question in the reading column and gray lines in the Task panel, in the shape of the real ones (the shared Skeleton) | |
| empty | boolean | No items at all: the list's head and Open / Done stay, the reading column shows “Nothing in your inbox yet” with a short line and a Go to Thread button, the Task panel says no task is open and the Inbox count hides; loading wins when both are on | |
| className | string | Extra class on the root |
Fills its container – give it the full viewport height in your app
Rows have one fixed height; the reading column stays at most 560px wide and centered
Below 640px the list fills the screen; a row opens its item full-width with a back button, and Esc goes back
On phones the reply field takes its own line above the buttons, the variants keep three to a row, shortcut hints hide; touch targets grow to 36px
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"