工具授权

New

人机协同权限卡:审阅工具详情与参数、允许一次/始终允许/拒绝,可选 Shiki 高亮代码值。

Allow this tool to run?
terminal.run
Approval required

The agent wants to run the project test suite in the current workspace.

Command
bun test tests/a11y.test.tsx
Directory
ui-components

安装

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

$ bunx --bun shadcn add @uilab/tool-approval

API 参考

ToolApprovalCode

code
string
language?
"text" | "bash" | "diff" | "json" | "tsx" | "typescript"
bash
className?
string

ToolApproval

tool
ReactNode
title?
ReactNode
Allow this tool to run?
description?
ReactNode
parameters?
ToolApprovalParameter[]
[]
status?
"error" | "pending" | "approved" | "denied" | "running" | "complete" | "approving"
pending
open?
boolean
defaultOpen?
boolean
false
onOpenChange?
((open: boolean) => void)
onApprove?
(() => void)
onAlwaysAllow?
(() => void)
onDeny?
(() => void)
className?
string

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.