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.
Proposed text or code edits you accept or reject in place: unified, split or inline phrase diff, always with + / − marks and counts ("+2 −2", read as "2 added, 2 removed"), then one line.
Accept or reject a proposed edit in place. Not ApprovalCard. Not CodeSnippet.
Accept (⌘/Ctrl+Enter) or Reject (Escape) and the card settles to one line.
const subtotal = sumLines(lines);Removed:return subtotal * (1 + rate);Added:const total = subtotal * (1 + rate);Added:return Math.round(total * 100) / 100;
InlineDiff reviews one proposed edit. Changes always carry + / − marks and say Added / Removed to screen readers. Accept is the one solid primary.
import { InlineDiff } from "agentic-ds-kit";From contracts/inlinediff.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| title | string | Yes | — | — |
| mode | unified | split | inline | No | unified | — |
| file | string | No | — | — |
| hunkHeader | string | No | — | e.g. "@@ -41,2 +41,3 @@ calcTotal". |
| lines | array | No | — | { type: "context" | "add" | "remove", text, oldNo?, newNo? }[] for unified and split. |
| segments | array | No | — | { type: "same" | "add" | "remove", text }[] for inline. |
| status | enum | No | pending | accepted and rejected render one line. pending | accepted | rejected | stale | loading | error | empty |
| hunkLabel | string | No | — | — |
| staleReason | string | No | — | — |
| errorMessage | string | No | — | — |
| onRetry | function | No | — | — |
| onAccept | function | No | — | Accept, the one solid primary, with a ⌘⏎ key chip (hidden on touch screens and below --grid-breakpoint-sm). ⌘/Ctrl+Enter in the card. |
| onReject | function | No | — | Reject (outline), first in the footer, with an Esc key chip. Escape in the card, not on another control. |
| onAcceptAll | function | No | — | Accept all (ghost), between Reject and Accept. Pass it only when the proposal has 2 or more hunks. |
| resolvedSummary | string | No | — | — |
| resolvedAt | string | No | — | — |
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.
Read-only block of code with a copy button, optional title, language label, tabs, and line numbers.
Placeholder when a list, page, or region has nothing to show.
Review an agent's change file by file, then accept or reject each file, or the rest at once.