import { Wrench } from "lucide-react"; import { cn } from "@/shared/ui/cn"; import { AgentProgressStatusIcon } from "./agent-progress-status-icon"; import type { AgentChatProgress } from "../types"; import { AgentProcessDisclosure } from "./agent-process-disclosure"; export function AgentToolProgress({ item, compact = false }: { item: AgentChatProgress; compact?: boolean; }) { const name = item.tool?.name ?? item.title .replace(/^(?:正在调用|准备调用)\s*/, "") .replace( /\s*(?:调用失败|已执行完成|已完成|正在执行|正在调用|调用中|已进入待执行状态|等待执行|执行失败)\s*$/, "" ); const input = item.tool?.input; return ( {name || "工具调用"} } > {input ? (

调用参数

            {JSON.stringify(input, null, 2)}
          
{item.status === "error" && item.detail ? (

{item.detail}

) : null}
) : null} {!input && item.detail ? (

{item.detail}

) : !input ? (

无附加参数

) : null}
); }