-
-
+
@@ -559,6 +559,7 @@ import type { ProtectedFileAccessContext } from '@/utils/protectedFileAccess';
import { unwrapFinalAnswerWrappers, thinkingEqualsAnswer } from '@/utils/finalAnswer';
import { getAgentToolIconName } from '@/utils/agent-tool-icons';
import { getQueryText, getWikiPageText } from '@/utils/agent-tool-display';
+import { previewShellCommand } from '@/utils/shellExecResult';
import { parseWikiToolReferences } from '@/utils/wikiToolReferences';
import {
buildManualMarkdown,
@@ -624,6 +625,7 @@ const TOOL_NAME_KEYS: Record
= {
query_knowledge_graph: 'agentStream.tools.queryKnowledgeGraph',
read_skill: 'agentStream.tools.readSkill',
execute_skill_script: 'agentStream.tools.executeSkillScript',
+ shell_exec: 'agentStream.tools.shellExec',
data_analysis: 'agentStream.tools.dataAnalysis',
data_schema: 'agentStream.tools.dataSchema',
database_query: 'agentStream.tools.databaseQuery',
@@ -1043,6 +1045,12 @@ const formatToolResultContent = (value: unknown): string => {
const isMcpTool = (toolName?: string | null): boolean => String(toolName || '').startsWith('mcp_');
+const resolveToolDisplayType = (event: any): string | undefined => {
+ if (event?.display_type) return event.display_type
+ if (event?.tool_name === 'shell_exec') return 'shell_exec'
+ return undefined
+};
+
const WIKI_EDIT_TOOL_NAMES = new Set([
'wiki_write_page',
'wiki_replace_text',
@@ -2605,6 +2613,9 @@ const getToolTitle = (event: any): string => {
if (event.tool_name === 'wiki_search' || event.tool_name === 'wiki_read_page') {
return `${getLocalizedToolName(event.tool_name)}...`;
}
+ if (event.tool_name === 'shell_exec') {
+ return t('agentStream.toolStatus.shellExecRunning');
+ }
const localizedName = getLocalizedToolName(event.tool_name);
return t('agentStream.toolStatus.calling', { name: localizedName });
}
@@ -2700,6 +2711,14 @@ const getToolTitle = (event: any): string => {
return pageLabel ? `${baseTitle}:「${sanitizeForDisplay(pageLabel)}」` : baseTitle;
}
+ if (toolName === 'shell_exec') {
+ const command = previewShellCommand(
+ String(event.tool_data?.command || event.arguments?.command || ''),
+ )
+ const baseTitle = getToolDescription(event)
+ return command ? `${baseTitle}:${command}` : baseTitle
+ }
+
// Use tool summary if available
const summary = getToolSummary(event);
return summary || getToolDescription(event);
@@ -2717,6 +2736,9 @@ const getToolDescription = (event: any): string => {
if (event.tool_name === 'query_understand') {
return t('agentStream.toolStatus.queryUnderstanding');
}
+ if (event.tool_name === 'shell_exec') {
+ return t('agentStream.toolStatus.shellExecRunning');
+ }
const localizedName = getLocalizedToolName(event.tool_name);
return t('agentStream.toolStatus.calling', { name: localizedName });
}
@@ -2747,6 +2769,9 @@ const getToolDescription = (event: any): string => {
return success ? t('agentStream.toolStatus.attachmentParsingDone') : t('agentStream.toolStatus.attachmentParsingFailed');
} else if (toolName === 'query_understand') {
return success ? t('agentStream.toolStatus.queryUnderstandDone') : t('agentStream.toolStatus.calledFailed', { name: getLocalizedToolName(toolName) });
+ } else if (toolName === 'shell_exec') {
+ const localizedName = getLocalizedToolName(toolName);
+ return success ? localizedName : t('agentStream.toolStatus.calledFailed', { name: localizedName });
} else {
const localizedName = getLocalizedToolName(toolName);
return success ? t('agentStream.toolStatus.called', { name: localizedName }) : t('agentStream.toolStatus.calledFailed', { name: localizedName });
diff --git a/frontend/src/views/chat/components/ToolResultRenderer.vue b/frontend/src/views/chat/components/ToolResultRenderer.vue
index 3c64818c..da08bb6e 100644
--- a/frontend/src/views/chat/components/ToolResultRenderer.vue
+++ b/frontend/src/views/chat/components/ToolResultRenderer.vue
@@ -46,6 +46,13 @@
v-else-if="displayType === 'wiki_write_page' || displayType === 'wiki_replace_text' || displayType === 'wiki_rename_page' || displayType === 'wiki_delete_page'"
:data="toolData as WikiEditData" />
+
+