{
// 删除文件
fs.unlinkSync(absolutePath);
+ // Verilog 文件添加知识图谱提示
+ const isVerilogFile = filePath.endsWith('.v') || filePath.endsWith('.sv');
+ if (isVerilogFile) {
+ return `文件已删除: ${filePath}\n\n[提示] 请删除知识图谱中相关节点`;
+ }
+
return `文件已删除: ${filePath}`;
}
diff --git a/src/views/messageArea.ts b/src/views/messageArea.ts
index f88f87f..92e8108 100644
--- a/src/views/messageArea.ts
+++ b/src/views/messageArea.ts
@@ -528,6 +528,89 @@ export function getMessageAreaStyles(): string {
border-radius: 4px;
font-size: 12px;}
+ /* 智能体卡片样式 */
+ .segment-agent {
+ margin: 8px 0;
+ }
+ .agent-card {
+ border: 1px solid var(--vscode-input-border);
+ border-radius: 8px;
+ overflow: hidden;
+ background: var(--vscode-editor-background);
+ }
+ .agent-header {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 8px 12px;
+ background: var(--vscode-sideBar-background);
+ border-bottom: 1px solid var(--vscode-input-border);
+ }
+ .agent-icon {
+ font-size: 16px;
+ }
+ .agent-name {
+ font-weight: 500;
+ flex: 1;
+ }
+ .agent-status {
+ font-size: 11px;
+ padding: 2px 8px;
+ border-radius: 10px;
+ }
+ .agent-status.running {
+ background: var(--vscode-inputValidation-infoBackground);
+ color: var(--vscode-inputValidation-infoForeground);
+ }
+ .agent-status.completed {
+ background: #28a745;
+ color: white;
+ }
+ .agent-status.error {
+ background: #dc3545;
+ color: white;
+ }
+ .agent-body {
+ padding: 8px;
+ }
+ .agent-steps-container {
+ max-height: 150px;
+ overflow-y: auto;
+ font-size: 12px;
+ }
+ .agent-step {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ padding: 4px 8px;
+ border-radius: 4px;
+ margin-bottom: 4px;
+ background: var(--vscode-list-hoverBackground);
+ }
+ .agent-step:last-child {
+ margin-bottom: 0;
+ }
+ .step-icon {
+ flex-shrink: 0;
+ }
+ .step-name {
+ font-weight: 500;
+ color: var(--vscode-foreground);
+ }
+ .step-result {
+ color: var(--vscode-descriptionForeground);
+ font-size: 11px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ .agent-step-placeholder {
+ color: var(--vscode-descriptionForeground);
+ font-style: italic;
+ padding: 8px;
+ text-align: center;
+ }
+
${getWaveformPreviewContent()}
`;
}
@@ -903,6 +986,41 @@ export function getMessageAreaScript(): string {
}
}, 0);
}
+ } else if (segment.type === 'agent') {
+ // 智能体卡片渲染
+ segmentDiv.className += ' segment-agent';
+ const statusText = segment.agentStatus === 'completed' ? '完成'
+ : segment.agentStatus === 'error' ? '错误' : '执行中';
+ const statusClass = segment.agentStatus || 'running';
+
+ const stepsHtml = (segment.agentSteps || []).map(step => {
+ const icon = step.status === 'completed' ? '✅' : step.status === 'error' ? '❌' : '🔄';
+ const result = step.toolResult ? \`: \${step.toolResult.substring(0, 50)}\${step.toolResult.length > 50 ? '...' : ''}\` : '';
+ return \`\${icon}\${step.toolName}\${result}
\`;
+ }).join('');
+
+ segmentDiv.innerHTML = \`
+
+
+
+
+ \${stepsHtml || '
等待执行...
'}
+
+
+
+ \`;
+
+ // 自动滚动到最新步骤
+ setTimeout(() => {
+ const container = segmentDiv.querySelector('.agent-steps-container');
+ if (container) {
+ container.scrollTop = container.scrollHeight;
+ }
+ }, 0);
}
currentSegmentedMessage.appendChild(segmentDiv);
@@ -1045,6 +1163,33 @@ export function getMessageAreaScript(): string {
\`;
+ } else if (segment.type === 'agent') {
+ // 智能体卡片渲染
+ segmentDiv.className += ' segment-agent';
+ const statusText = segment.agentStatus === 'completed' ? '完成'
+ : segment.agentStatus === 'error' ? '错误' : '执行中';
+ const statusClass = segment.agentStatus || 'running';
+
+ const stepsHtml = (segment.agentSteps || []).map(step => {
+ const icon = step.status === 'completed' ? '✅' : step.status === 'error' ? '❌' : '🔄';
+ const result = step.toolResult ? \`: \${step.toolResult.substring(0, 50)}\${step.toolResult.length > 50 ? '...' : ''}\` : '';
+ return \`\${icon}\${step.toolName}\${result}
\`;
+ }).join('');
+
+ segmentDiv.innerHTML = \`
+
+
+
+
+ \${stepsHtml || '
等待执行...
'}
+
+
+
+ \`;
}
container.appendChild(segmentDiv);
diff --git a/src/views/webviewContent.ts b/src/views/webviewContent.ts
index 740d484..93066e4 100644
--- a/src/views/webviewContent.ts
+++ b/src/views/webviewContent.ts
@@ -377,6 +377,7 @@ export function getWebviewContent(iconUri?: string): string {
+
${getInputAreaContent()}
@@ -399,7 +400,8 @@ export function getWebviewContent(iconUri?: string): string {
const questions = {
counter: '生成一个4位同步计数器',
fsm: '生成一个状态机',
- testbench: '生成测试平台'
+ testbench: '生成测试平台',
+ explore: '请启动知识探索智能体,分析当前项目结构'
};
if (questions[type]) {
messageInput.value = questions[type];