diff --git a/REFACTOR.md b/REFACTOR.md index 047aa220..468ea6ac 100644 --- a/REFACTOR.md +++ b/REFACTOR.md @@ -15,9 +15,7 @@ - [x] 移除 lightrag - [x] 新增图谱构建,支持自定义 Schema、支持自定义并发数,知识库与向量检索解耦 - [x] 知识图谱抽取要求支持并发处理 - - -## 权限部分 +- [ ] UV 的版本 - [x] Agent 的 user_id 使用的有歧义,从数据库表到代码中都修改为统一使用 yuxi_id 来代替 - [ ] 权限新增一个 guest 的预设字段,暂无任何权限 - [ ] rename database table name, such as skills -> agent_skills, subagents -> agent_subagents, mcp, tool_call, 等等 diff --git a/web/src/components/MessageInputComponent.vue b/web/src/components/MessageInputComponent.vue index e46df558..1ce1b37c 100644 --- a/web/src/components/MessageInputComponent.vue +++ b/web/src/components/MessageInputComponent.vue @@ -269,11 +269,27 @@ diff --git a/web/src/utils/mention_icon_utils.js b/web/src/utils/mention_icon_utils.js new file mode 100644 index 00000000..c2447d0a --- /dev/null +++ b/web/src/utils/mention_icon_utils.js @@ -0,0 +1,27 @@ +import { FolderFilled } from '@ant-design/icons-vue' +import { BookMarked, BookOpen, Bot, Plug } from 'lucide-vue-next' +import { getFileIcon, getFileIconColor } from '@/utils/file_utils' + +export const MENTION_ICON_SIZE = 15 +export const MENTION_ICON_STROKE_WIDTH = 2.2 + +const MENTION_TYPE_ICON_COMPONENTS = { + knowledge: BookOpen, + skill: BookMarked, + mcp: Plug, + subagent: Bot +} + +export const getMentionIconComponent = (type, value = '') => { + if (type === 'file') { + return String(value || '').endsWith('/') ? FolderFilled : getFileIcon(value) + } + return MENTION_TYPE_ICON_COMPONENTS[type] || Plug +} + +export const getMentionIconStyle = (type, value = '') => { + if (type !== 'file') return null + return { + color: String(value || '').endsWith('/') ? '#ffa940' : getFileIconColor(value) + } +}