feat: 优化 Chat 页面和 Agents 页面

- 优化 Chat 页面交互和消息显示
- 增强 Agents 页面功能
- 改进 ChatAgentSelector 组件
- 优化 ChatMessage 和 ChatSidebar 组件
- 更新聊天逻辑 useAgents 和 chat 模块

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 19:48:42 +08:00
parent a35a88effc
commit bce8b9240b
7 changed files with 362 additions and 195 deletions

View File

@@ -278,7 +278,7 @@ async function createAgent() {
const skillsLabels = newAgent.value.selectedSkills.map(id => getSkillLabel(id)).join(', ')
agents.value.unshift({
id: result.agent_id,
id: result.agent_id_str || result.agent_id,
name: newAgent.value.name,
avatar: newAgent.value.avatar,
description: newAgent.value.description,
@@ -341,6 +341,7 @@ async function saveEdit() {
body: JSON.stringify({
name: editingAgent.value.name,
description: editingAgent.value.description,
avatar: editingAgent.value.avatar,
skills: skills,
role_description: editingAgent.value.prompt,
model_provider: selectedModel?.provider || '',
@@ -353,6 +354,7 @@ async function saveEdit() {
if (agent) {
agent.name = editingAgent.value.name
agent.description = editingAgent.value.description
agent.avatar = editingAgent.value.avatar
agent.skills = editingAgent.value.skillsMode === 'all' ? '*' : editingAgent.value.selectedSkills.join(', ')
agent.model = selectedModel?.name || ''
}