diff --git a/web/src/components/AgentPanel.vue b/web/src/components/AgentPanel.vue index f0dfb00f..17c39cfc 100644 --- a/web/src/components/AgentPanel.vue +++ b/web/src/components/AgentPanel.vue @@ -126,7 +126,7 @@
-

暂无附件

+

暂无附件,支持 txt/md/docx/html 格式 ≤ 5 MB

上传附件
@@ -827,7 +827,7 @@ const stopResize = () => { display: flex; align-items: flex-start; gap: 10px; - padding: 12px; + padding: 6px 12px; border-radius: 8px; border: 1px solid var(--gray-150); transition: all 0.15s ease; diff --git a/web/src/components/ToolCallingResult/BaseToolCall.vue b/web/src/components/ToolCallingResult/BaseToolCall.vue index 27827bf7..ebbea3a4 100644 --- a/web/src/components/ToolCallingResult/BaseToolCall.vue +++ b/web/src/components/ToolCallingResult/BaseToolCall.vue @@ -305,11 +305,24 @@ const formatResultData = (data) => { :deep(.tag) { font-size: 12px; - color: var(--gray-600); - background-color: var(--gray-100); - padding: 0px 4px; + color: var(--gray-800); + background-color: var(--gray-50); + padding: 4px 4px; border-radius: 4px; margin-left: 8px; + + &.tag-yes { + color: var(--main-500); + } + + &.success { + color: var(--color-success-500); + background-color: var(--color-success-50); + } + &.error { + color: var(--color-error-500); + background-color: var(--color-error-50); + } } } } diff --git a/web/src/components/ToolCallingResult/ToolCallRenderer.vue b/web/src/components/ToolCallingResult/ToolCallRenderer.vue index 0a4da6b6..0b9c5626 100644 --- a/web/src/components/ToolCallingResult/ToolCallRenderer.vue +++ b/web/src/components/ToolCallingResult/ToolCallRenderer.vue @@ -23,6 +23,21 @@ + + + + + + + + + + + + + + + @@ -41,6 +56,11 @@ import TodoListTool from './tools/TodoListTool.vue' import ImageTool from './tools/ImageTool.vue' import TaskTool from './tools/TaskTool.vue' import WriteFileTool from './tools/WriteFileTool.vue' +import ReadFileTool from './tools/ReadFileTool.vue' +import ListDirectoryTool from './tools/ListDirectoryTool.vue' +import SearchFileContentTool from './tools/SearchFileContentTool.vue' +import GlobTool from './tools/GlobTool.vue' +import EditFileTool from './tools/EditFileTool.vue' const props = defineProps({ toolCall: { @@ -130,6 +150,26 @@ const isWriteFileResult = computed(() => { return toolName.value === 'write_file' }) +const isReadFileResult = computed(() => { + return toolName.value === 'read_file' +}) + +const isListDirectoryResult = computed(() => { + return toolName.value === 'list_directory' || toolName.value === 'ls' +}) + +const isSearchFileContentResult = computed(() => { + return toolName.value === 'search_file_content' +}) + +const isGlobResult = computed(() => { + return toolName.value === 'glob' +}) + +const isEditFileResult = computed(() => { + return toolName.value === 'edit_file' || toolName.value === 'replace' +}) + // 处理知识图谱刷新 const graphToolCallRef = ref(null) const refreshGraph = () => { diff --git a/web/src/components/ToolCallingResult/index.js b/web/src/components/ToolCallingResult/index.js index 204c4fdc..15a8c361 100644 --- a/web/src/components/ToolCallingResult/index.js +++ b/web/src/components/ToolCallingResult/index.js @@ -10,3 +10,8 @@ export { default as CalculatorTool } from './tools/CalculatorTool.vue' export { default as TodoListTool } from './tools/TodoListTool.vue' export { default as ImageTool } from './tools/ImageTool.vue' export { default as WriteFileTool } from './tools/WriteFileTool.vue' +export { default as ReadFileTool } from './tools/ReadFileTool.vue' +export { default as ListDirectoryTool } from './tools/ListDirectoryTool.vue' +export { default as SearchFileContentTool } from './tools/SearchFileContentTool.vue' +export { default as GlobTool } from './tools/GlobTool.vue' +export { default as EditFileTool } from './tools/EditFileTool.vue' diff --git a/web/src/components/ToolCallingResult/tools/EditFileTool.vue b/web/src/components/ToolCallingResult/tools/EditFileTool.vue new file mode 100644 index 00000000..b3c35f0a --- /dev/null +++ b/web/src/components/ToolCallingResult/tools/EditFileTool.vue @@ -0,0 +1,55 @@ + + + diff --git a/web/src/components/ToolCallingResult/tools/GlobTool.vue b/web/src/components/ToolCallingResult/tools/GlobTool.vue new file mode 100644 index 00000000..32ec4c4e --- /dev/null +++ b/web/src/components/ToolCallingResult/tools/GlobTool.vue @@ -0,0 +1,38 @@ + + + + + diff --git a/web/src/components/ToolCallingResult/tools/ListDirectoryTool.vue b/web/src/components/ToolCallingResult/tools/ListDirectoryTool.vue new file mode 100644 index 00000000..29b65fb8 --- /dev/null +++ b/web/src/components/ToolCallingResult/tools/ListDirectoryTool.vue @@ -0,0 +1,44 @@ + + + + + diff --git a/web/src/components/ToolCallingResult/tools/ReadFileTool.vue b/web/src/components/ToolCallingResult/tools/ReadFileTool.vue new file mode 100644 index 00000000..d3aeded3 --- /dev/null +++ b/web/src/components/ToolCallingResult/tools/ReadFileTool.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/web/src/components/ToolCallingResult/tools/SearchFileContentTool.vue b/web/src/components/ToolCallingResult/tools/SearchFileContentTool.vue new file mode 100644 index 00000000..c31b10b7 --- /dev/null +++ b/web/src/components/ToolCallingResult/tools/SearchFileContentTool.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/web/src/components/ToolCallingResult/tools/TodoListTool.vue b/web/src/components/ToolCallingResult/tools/TodoListTool.vue index 639fb6d1..98650db7 100644 --- a/web/src/components/ToolCallingResult/tools/TodoListTool.vue +++ b/web/src/components/ToolCallingResult/tools/TodoListTool.vue @@ -147,17 +147,17 @@ const todoListData = (content) => { .todo-list { display: flex; flex-direction: column; - gap: 8px; + gap: 2px; } .todo-item { display: flex; align-items: flex-start; gap: 10px; - padding: 10px 12px; - background: var(--gray-25); + padding: 4px 8px; + // background: var(--gray-10); border-radius: 6px; - border: 1px solid var(--gray-150); + // border: 1px solid var(--gray-150); .todo-status { flex-shrink: 0;