Skip to content
GitHub (opens in a new tab)

DecisionCard

An agent presents a choice mid-run and waits: options with a recommended one, or a free-text answer. Confirm or skip, then one line.

stableOrganismcontracts/decisioncard.json

Preview

DecisionCard

The agent asks and waits. Not ApprovalCard. Not AlertDialog.

Master

Pick an option, confirm (⌘/Ctrl+Enter), and the card resolves to one line.

Billing refactor asks

paused · 0:42

The v1 invoices endpoint has 3 callers. What should I do with it?

The v1 invoices endpoint has 3 callers. What should I do with it?

Usage

DecisionCard pauses the agent for a choice. The recommended option comes first, starts selected, and keeps its quiet badge. Confirm is the one solid primary; one action to approve is an ApprovalCard.

Do's

  • an agent needs the person to pick between options before it continues
  • a short free-text answer the agent waits for
  • the agent can fall back to a default when skipped

Don'ts

  • one side effect to approve — ApprovalCard
  • standing access — PermissionRequest
  • a page-blocking yes/no — AlertDialog
  • a form the person fills on their own — Field / RadioGroup
<DecisionCard
  title="Billing refactor asks"
  meta="paused · 0:42"
  question="The v1 invoices endpoint has 3 callers. What should I do with it?"
  options={options}
  value={value}
  onValueChange={setValue}
  onConfirm={send}
  onSkip={skip}
/>

When to use

  • an agent needs the person to pick between options before it continues
  • a short free-text answer the agent waits for
  • the agent can fall back to a default when skipped

When not to use

  • one side effect to approve — ApprovalCard
  • standing access — PermissionRequest
  • a page-blocking yes/no — AlertDialog
  • a form the person fills on their own — Field / RadioGroup

What an agent reads

import { DecisionCard } from "agentic-ds-kit";
must
  • section aria-labelledby the h3 title
  • options are a kit RadioGroup named by the question
  • a disabled option stays in the RadioGroup, disabled, with its reason as the description, so it is announced, not skipped
  • free text is a Field-wrapped Textarea with a hint
  • Confirm and Skip carry aria-keyshortcuts; ⌘/Ctrl+Enter confirms and Escape skips (not on another control) inside the card; Confirm shows ⌘⏎ as an aria-hidden key chip, hidden on touch screens and below --grid-breakpoint-sm
  • sending sets aria-busy and announces in a status region
  • the error is a small kit LoadError (role=alert)
  • once resolved, focus moves to the one-line row
  • motion is opacity and transform only, off under prefers-reduced-motion
defaults
  • allowFreeText false
  • freeTextLabel Your answer
  • freeTextHint One or two sentences is enough.
  • status pending
  • errorMessage The answer was not sent.
stops if
  • Do not invent a local DecisionCard, ChoiceCard, or AgentQuestion
  • Do not start with nothing selected when an option is recommended; list it first and start value on it
  • Confirm is the one solid primary; Skip is ghost
  • Do not use raw hex

From contracts/decisioncard.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
titlestringYes—Who asks, e.g. "Billing refactor asks".
questionstringYes——
metastringNo—e.g. "paused · 0:42".
optionsarrayNo—{ id, label, description?, recommended?, disabled?, disabledReason? }[] as a kit RadioGroup (card layout). recommended shows a quiet Badge. A disabled option stays in the group and shows disabledReason in place of its description.
allowFreeTextbooleanNofalseFree text when there are no options.
freeTextLabelstringNoYour answer—
freeTextHintstringNoOne or two sentences is enough.—
valuestringNo—Option id or free-text answer. Confirm is disabled until set.
onValueChangefunctionNo—(value) => void
statusenumNopendingresolved and skipped render one line. pending | sending | error | resolved | skipped
errorMessagestringNoThe answer was not sent.—
resolvedLabelstringNo—Line text; default the chosen option's label.
resolvedAtstringNo——
onConfirmfunctionNo—Confirm (⌘⏎ key chip, no icon), the one solid primary while it waits; outline while sending or after an error. ⌘/Ctrl+Enter inside the card.
onSkipfunctionNo—Skip for now (ghost). Escape while focus is in the card but not on another control.
  • Component
    →

    ApprovalCard

    The agent asks before it acts: risk, what will happen in words, an exact preview of the command or diff, and Approve (⌘/Ctrl+Enter) / Deny (Escape) with an optional auto-deny countdown.

  • Component
    →

    PermissionRequest

    An agent asks for standing access to a capability (files, email, repo, billing), scope by scope, with why and expiry.

  • Component
    →

    AlertDialog

    Must-choose overlay that interrupts until the user cancels or confirms.

  • Component
    →

    Field

    One labeled control with optional hint and an error or success message.