Tool lifecycle UI components for React/Next.js from ui.inference.sh. Display tool calls: pending, progress, approval required, results. Capabilities: tool status, progress indicators, approval flows, results display. Use for: showing agent tool calls, human-in-the-loop approvals, tool output. Triggers: tool ui, tool calls, tool status, tool approval, tool results," agent tools, mcp tools ui, function calling ui, tool lifecycle, tool pending
来自ui.inference.sh的工具生命周期组件。

bash
npx shadcn@latest add https://ui.inference.sh/r/tools.json
| 状态 | 描述 |
|---|---|
| pending | 工具调用已请求,等待执行 |
| running |
tsx
import { ToolCall } from @/registry/blocks/tools/tool-call
args={{ query: 最新AI新闻 }}
status=running
/>
tsx
import { ToolResult } from @/registry/blocks/tools/tool-result
result={{ results: [...] }}
status=success
/>
tsx
import { ToolApproval } from @/registry/blocks/tools/tool-approval
args={{ to: user@example.com, subject: 你好 }}
onApprove={() => executeTool()}
onDeny={() => cancelTool()}
/>
tsx
import { ToolCall, ToolResult, ToolApproval } from @/registry/blocks/tools
function ToolDisplay({ tool }) {
if (tool.status === approval) {
return (
args={tool.args}
onApprove={tool.approve}
onDeny={tool.deny}
/>
)
}
if (tool.result) {
return (
result={tool.result}
status={tool.status}
/>
)
}
return (
args={tool.args}
status={tool.status}
/>
)
}
tsx
args={{ path: /src/index.ts }}
status=running
className=border-blue-500
/>
工具会根据其名称自动获取图标:
| 模式 | 图标 |
|---|---|
| search、find | 搜索 |
| read、get |
Agent组件会自动处理工具生命周期:
tsx
import { Agent } from @/registry/blocks/agent/agent
config={{
core_app: { ref: openrouter/claude-sonnet-45@0fkg6xwb },
tools: [
{
name: search_web,
description: 搜索网络,
parameters: { query: { type: string } },
requiresApproval: true, // 启用审批流程
},
],
}}
/>
bash
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 tools-ui-1776352281 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 tools-ui-1776352281 技能
skillhub install tools-ui-1776352281
文件大小: 2.1 KB | 发布时间: 2026-4-17 13:52