feat(chat): 扩展极简模式工具分类显示映射

This commit is contained in:
JOJO 2026-07-10 14:03:06 +08:00
parent 576fbb39d8
commit 67292f9fd3

View File

@ -584,12 +584,25 @@ const blockGroups = computed(() => {
return groups;
});
type ToolCategory = 'read' | 'command' | 'edit' | 'search' | 'webpage' | 'other';
type ToolCategory =
| 'read'
| 'command'
| 'edit'
| 'search'
| 'webpage'
| 'memory_update'
| 'memory_read'
| 'conversation'
| 'sub_agent'
| 'other';
const TOOL_CATEGORY_MAP: Record<string, ToolCategory> = {
//
// /
read_file: 'read',
read_skill: 'read',
vlm_analyze: 'read',
view_image: 'read',
view_video: 'read',
//
run_command: 'command',
@ -604,13 +617,27 @@ const TOOL_CATEGORY_MAP: Record<string, ToolCategory> = {
delete_file: 'edit',
rename_file: 'edit',
create_folder: 'edit',
save_webpage: 'edit',
//
web_search: 'search',
//
extract_webpage: 'webpage'
extract_webpage: 'webpage',
save_webpage: 'webpage',
//
update_memory: 'memory_update',
update_project_memory: 'memory_update',
//
recall_project_memory: 'memory_read',
//
conversation_search: 'conversation',
conversation_review: 'conversation',
//
create_sub_agent: 'sub_agent'
};
const CATEGORY_LABELS: Record<ToolCategory, (count: number) => string> = {
@ -619,10 +646,25 @@ const CATEGORY_LABELS: Record<ToolCategory, (count: number) => string> = {
edit: (n) => `编辑了 ${n} 次文件`,
search: (n) => `搜索了 ${n}`,
webpage: (n) => `查看了 ${n} 次网页`,
memory_update: (n) => `更新了 ${n} 次记忆`,
memory_read: (n) => `查看了 ${n} 次记忆`,
conversation: (n) => `回顾了 ${n} 次对话`,
sub_agent: (n) => `创建了 ${n} 个子智能体`,
other: (n) => `执行了 ${n} 次其他操作`
};
const CATEGORY_ORDER: ToolCategory[] = ['read', 'command', 'edit', 'search', 'webpage', 'other'];
const CATEGORY_ORDER: ToolCategory[] = [
'read',
'command',
'edit',
'search',
'webpage',
'memory_update',
'memory_read',
'conversation',
'sub_agent',
'other'
];
const getToolCategory = (action: Action): ToolCategory => {
const name = action.tool?.name;