Agent 审批收件箱

New

人机协同审批队列:带风险分级与过期时间的请求项、可展开详情、原地落定的批准/拒绝流转,以及带影响范围、增删统计与撤销的操作回执卡。

Approvals3
report-agentlowexpires in 6h
Send weekly usage report
Email to 3 recipients
alex@acme.co, priya@acme.coeng-leads@acme.co
migrate-agentmediumexpires in 2h
Run database migration
2 tables altered, backup taken first
Planned changes
db: production/users, sessions
+143
cleanup-agenthigh
Delete 12 stale branches
Includes 2 branches with unmerged commits

安装

用 shadcn CLI 添加,或手动复制源码。

$ bunx --bun shadcn add @uilab/agent-inbox

API 参考

AgentInbox

variant?
"card" | "quiet"

Card keeps the approval-queue shell; quiet becomes a flat semantic list.

card
title?
ReactNode
count?
number

Pending-count badge shown next to the title; omit to hide it entirely.

action?
ReactNode

Trailing slot for the caller's own controls, e.g. a "Clear" button.

className?
string
children?
ReactNode

`InboxItem`s (or any other row, e.g. a standalone `ActionReceipt`) — hairline-separated top to bottom.

InboxRiskBadge

risk
"medium" | "low" | "high"
className?
string

InboxItem

variant?
"card" | "quiet"

Matches the parent AgentInbox variant; quiet renders a compact flat row.

icon?
ReactNode

16px leading icon, e.g. `<Mail className="h-4 w-4" />`.

source?
ReactNode

Requesting agent, e.g. "deploy-agent".

title
ReactNode
description?
ReactNode
risk?
"medium" | "low" | "high"
expires?
ReactNode

Trailing countdown readout, e.g. "expires in 2h".

status?
"pending" | "approved" | "denied" | "expired"
pending
onApprove?
(() => void)
onDeny?
(() => void)
approveLabel?
ReactNode
Approve
denyLabel?
ReactNode
Deny
resolution?
ReactNode

Replaces the approve/deny row once `status` is no longer "pending".

className?
string
children?
ReactNode

Optional detail region (e.g. a command preview or an `ActionReceipt`) revealed by a "Details" toggle.

ActionReceipt

icon?
ReactNode

16px icon, defaults to a `Check` in the library's success green.

title
ReactNode
scope?
ReactNode

Sub-line describing what was acted on, e.g. "db: production/users, sessions".

added?
number
removed?
number
timestamp?
ReactNode
onUndo?
(() => void)
undoLabel?
ReactNode
Undo
className?
string
children?
ReactNode

Optional extra content, e.g. a list of affected file rows.

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.