Agent plan

The plan an AI agent is working through, as a live task list: each step's status, the one it is on, substeps, and "2 of 5 done". As a card, folded away behind its title, or compact: one line with the current step.

Agent plan

No script: re-render it as the steps change.

Use it

<x-ds::agent-plan title="Answer the refund question">
    <x-ds::agent-plan-step label="Read the refund policy" status="done" />
    <x-ds::agent-plan-step label="Check the delivery date" status="running" detail="Asking the carrier">
        <x-ds::agent-plan-step label="Look up the tracking number" status="done" />
        <x-ds::agent-plan-step label="Fetch the delivery event" status="running" />
    </x-ds::agent-plan-step>
    <x-ds::agent-plan-step label="Draft the reply" />
</x-ds::agent-plan>

Or from rows, as an agent framework hands them over:

<x-ds::agent-plan title="Tidy the inbox" :steps="$run->plan" />
{{-- [['label' => 'Archive newsletters', 'status' => 'done', 'detail' => null, 'substeps' => []], …] --}}

Folded behind its title, or one line:

<x-ds::agent-plan title="Tidy the inbox" :steps="$run->plan" :collapsible="true" :open="false" />
<x-ds::agent-plan title="Tidy the inbox" :steps="$run->plan" variant="compact" />

Props

agent-plan

PropTypeDefaultWhat it does
titlestringrequiredWhat the plan is for. Names the list.
stepsarray—Rows of label, status, detail, substeps, in place of children.
variantdefault compactdefaultCompact: one line, the current step and the count.
collapsibleboolfalseThe title, count and bar fold the list away.
openbooltrueWith collapsible: open on first paint.
progressTextstring:done of :total doneThe count beside the title.
statusTextarray—[status => words].

agent-plan-step

PropTypeDefaultWhat it does
labelstringrequiredThe step, in words.
statusstringpendingFrom the status set.
detailstring—A quieter line under it. A failed step's is red: say why.
currentboolfalseThe step the reader is on. The plan finds it on its own; you rarely need this.
statusTextarray—[status => words].
SlotWhat it does
defaultSubsteps: more agent-plan-steps, one level.

The current step is the running one, else the one waiting for the reader, else the first failure, else the first not started. A done or cancelled step is struck through.

Accessibility

  • An ordered list named by the title, with each step's status written before its label for screen readers.
  • The running step is aria-current="step".
  • The bar is a named progressbar; inside a collapsible summary it is hidden, as the count beside it says the same.

Don't

  • Don't use it for onboarding. That is the checklist: work the reader does. This is work the agent does.
  • Don't nest substeps inside substeps. One level is read.

From the package repo: edit this page on GitHub.

Was this page helpful?