From fb1156d24fc2d0bc86b6feba407250200c3ca5fc Mon Sep 17 00:00:00 2001 From: Roe-xin Date: Wed, 24 Dec 2025 10:43:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=B0=86=E8=8B=B1=E6=96=87=E7=9A=84?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E5=90=8D=E7=A7=B0=E6=98=A0=E5=B0=84=E4=B8=BA?= =?UTF-8?q?=E4=B8=AD=E6=96=87=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/messageArea.ts | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/views/messageArea.ts b/src/views/messageArea.ts index 342afab..fc6fb46 100644 --- a/src/views/messageArea.ts +++ b/src/views/messageArea.ts @@ -491,6 +491,19 @@ export function getMessageAreaStyles(): string { */ export function getMessageAreaScript(): string { return ` + // 工具名称映射 + function getToolDisplayName(toolName) { + const toolNameMap = { + 'file_read': '已完成文件读取', + 'file_write': '已完成文件写入', + 'file_list': '已读取目录', + 'syntax_check': '语法检查', + 'simulation': '仿真', + 'waveform_summary': '波形分析' + }; + return toolNameMap[toolName] || toolName; + } + // 添加消息 function addMessage(text, sender) { const div = document.createElement('div'); @@ -729,7 +742,7 @@ export function getMessageAreaScript(): string {
\${shouldCollapse ? collapseIconSvg : ''} \${statusIcon} - \${segment.toolName || '工具'} + \${getToolDisplayName(segment.toolName) || '工具'} \${toolResult && !shouldCollapse ? \`\${toolResult}\` : ''}
\${shouldCollapse ? \`\` : ''} @@ -920,7 +933,7 @@ export function getMessageAreaScript(): string {
\${shouldCollapse ? collapseIconSvg : ''} \${statusIcon} - \${segment.toolName || '工具'} + \${getToolDisplayName(segment.toolName) || '工具'} \${toolResult && !shouldCollapse ? \`\${toolResult}\` : ''}
\${shouldCollapse ? \`\` : ''} @@ -1054,7 +1067,7 @@ export function getMessageAreaScript(): string { div.className = \`message tool-status tool-\${status}\`; div.innerHTML = \` \${statusIcons[status]} - \${toolName} + \${getToolDisplayName(toolName)} \${statusTexts[status]} \${detail ? \`
\${detail}
\` : ''} \`;