feat(coding): add model tools and device packages
This commit is contained in:
@@ -629,6 +629,37 @@ const ToolDetails = memo(function ToolDetails({ details }: { details: KnownToolD
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (details.schema === 'makelore-model-tool.v1') {
|
||||
return (
|
||||
<div className="rounded-xl bg-foreground/[0.035] p-3 text-xs">
|
||||
<p className="font-semibold">模型联网搜索 · {details.modelId}</p>
|
||||
{details.status === 'succeeded' ? (
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
{details.sources.length > 0
|
||||
? `已返回 ${details.sources.length} 个来源`
|
||||
: '提供方未返回结构化来源'}
|
||||
</p>
|
||||
) : (
|
||||
<p className="mt-1 text-destructive">{details.error.code} · {details.error.message}</p>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
if (details.schema === 'makelore-device-package.v1') {
|
||||
const subject = details.preview?.displayName
|
||||
?? details.index?.packages.at(-1)?.displayName
|
||||
?? '本机包';
|
||||
return (
|
||||
<div className="rounded-xl bg-foreground/[0.035] p-3 text-xs">
|
||||
<p className="font-semibold">本机插件 · {subject}</p>
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
{details.operation === 'prepare'
|
||||
? `等待确认${details.preview?.includesExecutableCode ? ' · 包含可执行扩展' : ''}`
|
||||
: `操作完成 · 共 ${details.index?.packages.length ?? 0} 个本机包`}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return <SubagentGraph details={details} />;
|
||||
});
|
||||
|
||||
@@ -832,6 +863,16 @@ function toolDetailsProgress(details: KnownToolDetails | undefined): string | nu
|
||||
? `${details.operation} · 成功`
|
||||
: `${details.operation} · ${details.error ?? '请求失败'}`;
|
||||
}
|
||||
if (details.schema === 'makelore-model-tool.v1') {
|
||||
return details.status === 'succeeded'
|
||||
? `联网搜索 · ${details.sources.length} 个来源`
|
||||
: `联网搜索 · ${details.error.code}`;
|
||||
}
|
||||
if (details.schema === 'makelore-device-package.v1') {
|
||||
return details.operation === 'prepare'
|
||||
? `本机插件 · 等待确认安装 ${details.preview?.displayName ?? ''}`.trim()
|
||||
: `本机插件 · ${details.operation}`;
|
||||
}
|
||||
const task = details.tasks.find((candidate) => (
|
||||
candidate.status === 'running' || candidate.status === 'queued'
|
||||
)) ?? details.tasks.at(-1);
|
||||
|
||||
Reference in New Issue
Block a user