Agent plan

The agent's plan as a live task list, with agent-plan-step. It shares the checklist's visual language (marks, a count, a bar) but is not the onboarding checklist: no accordion, no dismissal, no actions. Host-driven: the steps' statuses come from the server. No script.

Anatomy

div[data-ds-agent-plan]  card                    (details with `collapsible`)
├── title + "2 of 5 done"                        (the summary with `collapsible`)
├── ds::progress  done of total, success, sm     (aria-hidden inside a summary)
└── ol[aria-label=title]
    └── li[data-ds-plan-step=status][aria-current=step if running][data-ds-current]
        ├── mark (aria-hidden)
        ├── p: sr-only "Done: " + label          struck and muted when done or cancelled
        ├── detail                               muted; danger when failed
        └── ol — substeps, the same items, one level

Steps

As children (ds::agent-plan-step label status detail, substeps in its slot) or as steps rows (label, status, detail, substeps; arrays or objects). Children are read from the rendered slot, as checklist reads its items: each step leaves data-ds-plan-step="status", a step renames its substeps' marks to data-ds-plan-substep so the plan counts its own steps only. "2 of 5 done" counts top-level steps that are done.

The current step: the running one, else the one waiting, else the first failure, else the first pending; none once all have finished. It is marked data-ds-current in the HTML, before any script (a step's current prop sets it instead). The running step is aria-current="step".

Detail is shown for every status: a failed step's in the danger colour, so it says why.

Variants

defaulta card: title, count, bar, the list
collapsiblethe title, count and bar are a native disclosure's summary; open (default true)
compactone line, a pill: the current step's mark and label, then the count. The whole list is in the page; CSS shows only the data-ds-current step and hides details and substeps. Once every step has finished, the plan's title with a done mark.

Motion

A step whose status changes on a re-render swaps its mark, which grows in from @starting-style (motion-safe, CSS only; see the status set in specs/agent-status.md).

Accessibility

Rolean ordered list named by the title; the bar a progressbar named by the title
Statuseach step's in words before its label, visually hidden
Currentaria-current="step" on the running step
Keyboardnone, but for the collapsible summary: Enter or Space
Focusthe summary draws the ring inside its box

Inside the collapsible summary the bar is aria-hidden: the count beside the title already says it in words, and a progressbar inside a disclosure button is read as part of its name.

Do not

  • Do not use it for onboarding. That is ds::checklist, which the reader works through; this is work the agent does.
  • Do not nest deeper than one level. A substep's own slot is not read.
  • Do not colour a step without a status. Pass the status; the words follow.

From the package repo: edit this page on GitHub.

Was this page helpful?