Approve, reject, override or reverse an agent's proposed action. The confirmation says what will run, the records, count and total it touches, who approves and whether it can be undone, read from the action's parameters; disabled buttons always say why.
Part of High Command Pro. The preview and props are open to everyone; installing it needs your license key. Set up your key · Pricing
$ npx shadcn@latest add @highcommand/agent-action-barCopies the source into your project and pulls in what it needs (3 other items). First time? Add the registry to components.json.
Approve, reject, override, reverse an agent's recommended action.
decisionrequiredAgentDecision—The agent decision whose recommended action this bar approves, rejects, overrides or reverses (its `can` says which buttons work).
onApproverequired(note: string | undefined) => Promise<void>—Each runs the action; reject with an Error (with `status` 409 or 422 to reload) to show its message.
onRejectrequired(note: string) => Promise<void>—Rejects the recommended action with the person's note.
onOverriderequired(replacement: { type: string; params: Record<string, unknown> }, note: string) => Promise<void>—Runs a replacement action (its type and params) instead of the recommended one, with the person's note.
onReverserequired(executionId: string, note: string | undefined) => Promise<void>—Undoes an execution by its id, with an optional note; the undo runs as a new action.
rolestring | nullnullThe signed-in role ("operator", "finance", "admin"): says on Approve who is needed when it is not this one.
onDone() => void—After an action ran (or a conflict): reload the decision.
onOpenRecord(r: { type: string; id: string }) => void—A record link was pressed. Without it records are plain names.
idTypesRecord<string, string>—Your id prefixes → record kinds, when they differ from the defaults (see `DEFAULT_ID_TYPES`).
classNamestring—Extra class names for the bar.
<ExecutionRecords />2 propsWhat an execution created and changed, each record a link that opens it.recordsrequiredActionRecord[]—What the execution created or changed.
onOpenRecord(r: { type: string; id: string }) => void—Fires with a record's type and id when its link is pressed; without it names are plain text.
actionScope(params: Record<string, unknown>, idType?: (v: unknown) => string | undefined): ActionScopeReads what an action's parameters will touch (the batch count and noun, its total, money parameters, details and the records named); `idType` maps an id to a record kind (default: the standard id prefixes).
scopeLine(s: ActionScope): string | null"5 orders · $49,074.46 total", or null when the action names no batch.
approvalText(tags: readonly string[], roles: readonly string[], why?: string | undefined): stringWho approves and why, before anyone clicks: "Money action (freight spend) · finance or admin approves".
approveNeeds(o: { role: string | null; approverRoles: readonly string[]; proposed: boolean; approveOk: boolean; }): string | nullThe label on a disabled Approve when the signed-in role is not an approver. Null when the role may approve, nothing can be approved, or the button is off for another reason (decided, expired).
disabledLine(o: { can: { approve: Gate; reject: Gate; override: Gate; reverse: Gate; }; hasAction: boolean; hasExecutions: boolean; onButton?: "approve" | null | undefined; }): { ...; } | nullThe one line under the buttons. Buttons that are off for the same reason share one line ("Approve, reject and override unavailable: decision is approved"); when buttons are off for different reasons only the most relevant shows: an undo that cannot run first once something ran, else Approve, Override, Reject. A reason already printed on its button (`onButton`) is not repeated.
moneyInputMinor(text: string): string | null"1,250.50" or "$1,250.50" typed by a person, as cents; null when it is not a positive amount.
idTypeOf(types?: Readonly<Record<string, string>>): (v: unknown) => string | undefinedThe record kind an id names, or undefined when it is not a record id.
fieldLabel(k: string): stringA parameter's name for people ("need_by" → "Need by").
usdCents(minor: bigint): stringCents as dollars and cents: "$49,074.46".
sentence(t: string): stringAn action's effect as a sentence: capital first letter, a full stop at the end.
rolesText(roles: readonly string[]): string"finance or admin", "admin": who may approve, in words.