feat: v0.11.3 - 工具卡片三态转换 + 流式进度监控 + 默认工具页签
- 工具卡片完整生命周期: 准备中 -> 执行中 -> 完成 - onToolCallPrepare 流式阶段提前显示工具意图 - 工作空间监控定时器: AI处理中提示 - 日志面板流式进度: 每5秒输出, 15秒无新内容警告 - 提示栏按状态分组显示所有工具 - write_file 写入前增加开始日志 - 工具页签新卡片始终自动滚动到底部 - 默认页签切换为工具页签
This commit is contained in:
@@ -261,7 +261,7 @@ function renderToolCallCard(tc: ToolCallRecord): string {
|
||||
browser_click: '点击元素', browser_type: '输入文本', browser_scroll: '滚动页面', browser_close: '关闭浏览器'
|
||||
};
|
||||
const statusLabels: Record<string, string> = {
|
||||
pending: '⏳ 等待确认', running: '🔄 执行中', success: '✅ 完成', error: '❌ 失败', cancelled: '🚫 已取消'
|
||||
pending: '📝 准备中…', running: '🔄 执行中', success: '✅ 完成', error: '❌ 失败', cancelled: '🚫 已取消'
|
||||
};
|
||||
|
||||
const icon = icons[tc.name] || '🔧';
|
||||
@@ -428,8 +428,9 @@ export function updateToolCallCardInPlaceholder(tc: ToolCallRecord): void {
|
||||
if (!currentPlaceholder) return;
|
||||
const container = currentPlaceholder.querySelector('.tool-calls-container');
|
||||
if (!container) return;
|
||||
// 找到第一个同名且状态为 running 的卡片
|
||||
const existing = container.querySelector(`.tool-call-card[data-tool-name="${tc.name}"].tool-call-running`) as HTMLElement;
|
||||
// 找到第一个同名且状态为 running 的卡片(CSS.escape 防特殊字符)
|
||||
const escapedName = CSS.escape(tc.name);
|
||||
const existing = container.querySelector(`.tool-call-card[data-tool-name="${escapedName}"].tool-call-running`) as HTMLElement;
|
||||
if (existing) {
|
||||
const cardDiv = document.createElement('div');
|
||||
cardDiv.innerHTML = renderToolCallCard(tc);
|
||||
|
||||
Reference in New Issue
Block a user