Components / AI interfaces
Agent plan and status
The steps an agent is working through, and a pill that says what it is doing now.
Functions: cui_agent_plan, cui_agent_status

Usage
cui_plan_step steps[] = {
{ "Search for sources", "3 results", CUI_TASK_DONE },
{ "Read the attached report", "Page 12 of 40", CUI_TASK_RUNNING },
{ "Draft the summary", NULL, CUI_TASK_PENDING },
};
int step = cui_agent_plan(ui, "plan", steps, 3, .title = "Research plan");
cui_agent_status(ui, "Reading quarterly-report.pdf", .status = CUI_TASK_RUNNING, .seconds = elapsed);
The rail fills up to the step in progress, the running step shimmers, and the header counts finished steps with a progress bar. The status pill shows loader dots while running and a check or a cross when done.
cui_agent_plan returns the index of the step that was clicked this frame, or -1. steps is your array and is only read: you change each status as the agent moves on. A step is a title, a detail line that may be NULL, and one of CUI_TASK_PENDING, CUI_TASK_RUNNING, CUI_TASK_DONE, CUI_TASK_FAILED or CUI_TASK_SKIPPED. Pending is the zero value. The header counts done and skipped steps as finished, and shows title, or "Plan".
cui_agent_status returns nothing, takes no id and keeps no state. status is pending when not set. seconds is the elapsed time you measured, shown as "42s" or "1m 05s", and 0 hides it. icon replaces the mark of every status except running.
Keyboard
None yet. A step is clicked with the pointer; the status pill only displays.
Options of cui_agent_plan
| Option | Type | Default | Description |
|---|---|---|---|
.title | const char * | "Plan" | heading of the plan, default "Plan" |
Options of cui_agent_status
| Option | Type | Default | Description |
|---|---|---|---|
.status | cui_task_status | One of CUI_TASK_PENDING, CUI_TASK_RUNNING, CUI_TASK_DONE, CUI_TASK_FAILED or CUI_TASK_SKIPPED. | |
.seconds | float | elapsed time shown after the text, as 42s or 1m 05s; 0 hides it | |
.icon | const char * | An icon: a CUI_ICON_* constant, or a string from another icon font. |
cui_plan_step
| Field | Type | Description |
|---|---|---|
title | const char * | the step's text; shimmers while the step is running |
detail | const char * | smaller muted line under the title (red when the step failed); may be NULL |
status | cui_task_status | One of CUI_TASK_PENDING, CUI_TASK_RUNNING, CUI_TASK_DONE, CUI_TASK_FAILED or CUI_TASK_SKIPPED. |
cui_task_status: CUI_TASK_PENDING, CUI_TASK_RUNNING, CUI_TASK_DONE, CUI_TASK_FAILED, CUI_TASK_SKIPPED
Related
- Sources and citations: Citations inside an answer and the list of sources they point to.
- Reasoning and tool calls: A folding block for a model's reasoning, and a row for each tool it calls with its status.
- Composer and model picker: The message box of a chat, with attachments, send and stop, and a menu for choosing the model.
- Suggestions, response actions and the context meter: Prompt suggestions to start from, the actions under a response, and a ring that shows how full the context is.