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}
\` : ''} \`;