From 7a4c264a6366b7ce19339f6b70a115c0f5c8dbdf Mon Sep 17 00:00:00 2001 From: ftboy Date: Sat, 25 Oct 2025 17:33:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(agent):=20agent=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/agent-config/AgentCard.vue | 159 +++++++++--------- .../components/agent-config/AgentSettings.vue | 149 ++++++++++++++++ .../agent-config/McpServerInfoCard.vue | 122 ++++++++++++++ .../components/agent-config/SkillInfoCard.vue | 88 ++++++++++ src/renderer/src/i18n/en-US/agents.json | 55 ++++++ src/renderer/src/i18n/en-US/index.ts | 2 + src/renderer/src/i18n/fa-IR/agents.json | 55 ++++++ src/renderer/src/i18n/fa-IR/index.ts | 2 + src/renderer/src/i18n/fr-FR/agents.json | 55 ++++++ src/renderer/src/i18n/fr-FR/index.ts | 2 + src/renderer/src/i18n/ja-JP/agents.json | 55 ++++++ src/renderer/src/i18n/ja-JP/index.ts | 2 + src/renderer/src/i18n/ko-KR/agents.json | 55 ++++++ src/renderer/src/i18n/ko-KR/index.ts | 2 + src/renderer/src/i18n/ru-RU/agents.json | 55 ++++++ src/renderer/src/i18n/ru-RU/index.ts | 2 + src/renderer/src/i18n/zh-CN/agents.json | 55 ++++++ src/renderer/src/i18n/zh-CN/index.ts | 2 + src/renderer/src/i18n/zh-HK/agents.json | 55 ++++++ src/renderer/src/i18n/zh-HK/index.ts | 2 + src/renderer/src/i18n/zh-TW/agents.json | 55 ++++++ src/renderer/src/i18n/zh-TW/index.ts | 3 + src/renderer/src/views/Agents.vue | 47 +++++- 23 files changed, 998 insertions(+), 81 deletions(-) create mode 100644 src/renderer/src/components/agent-config/AgentSettings.vue create mode 100644 src/renderer/src/components/agent-config/McpServerInfoCard.vue create mode 100644 src/renderer/src/components/agent-config/SkillInfoCard.vue create mode 100644 src/renderer/src/i18n/en-US/agents.json create mode 100644 src/renderer/src/i18n/fa-IR/agents.json create mode 100644 src/renderer/src/i18n/fr-FR/agents.json create mode 100644 src/renderer/src/i18n/ja-JP/agents.json create mode 100644 src/renderer/src/i18n/ko-KR/agents.json create mode 100644 src/renderer/src/i18n/ru-RU/agents.json create mode 100644 src/renderer/src/i18n/zh-CN/agents.json create mode 100644 src/renderer/src/i18n/zh-HK/agents.json create mode 100644 src/renderer/src/i18n/zh-TW/agents.json diff --git a/src/renderer/src/components/agent-config/AgentCard.vue b/src/renderer/src/components/agent-config/AgentCard.vue index 35f9c8d..e3904c5 100644 --- a/src/renderer/src/components/agent-config/AgentCard.vue +++ b/src/renderer/src/components/agent-config/AgentCard.vue @@ -15,27 +15,30 @@ - - - by - - {{ agent.provider?.organization || 'Unknown' }} - - - {{ agent.provider?.organization || 'Unknown' }} +
+ + + + by + + {{ agent.provider?.organization || 'Unknown' }} + + + {{ agent.provider?.organization || 'Unknown' }} + - +
@@ -43,58 +46,56 @@ {{ agent.description }}

- -
- - {{ skill.name }} - - - +{{ agent.skills.length - 3 }} - + +
+
+ + {{ skill.name }} + + + +{{ agent.skills.length - 3 }} + +
+ + +
+ +
- -
- - -
+ +
+ + + @@ -131,4 +140,4 @@ const showDetails = (agent: Agent) => { -webkit-box-orient: vertical; overflow: hidden; } - \ No newline at end of file + diff --git a/src/renderer/src/components/agent-config/AgentSettings.vue b/src/renderer/src/components/agent-config/AgentSettings.vue new file mode 100644 index 0000000..c6d3ebe --- /dev/null +++ b/src/renderer/src/components/agent-config/AgentSettings.vue @@ -0,0 +1,149 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/components/agent-config/McpServerInfoCard.vue b/src/renderer/src/components/agent-config/McpServerInfoCard.vue new file mode 100644 index 0000000..1007029 --- /dev/null +++ b/src/renderer/src/components/agent-config/McpServerInfoCard.vue @@ -0,0 +1,122 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/components/agent-config/SkillInfoCard.vue b/src/renderer/src/components/agent-config/SkillInfoCard.vue new file mode 100644 index 0000000..fa7af73 --- /dev/null +++ b/src/renderer/src/components/agent-config/SkillInfoCard.vue @@ -0,0 +1,88 @@ + + + \ No newline at end of file diff --git a/src/renderer/src/i18n/en-US/agents.json b/src/renderer/src/i18n/en-US/agents.json new file mode 100644 index 0000000..15fbec6 --- /dev/null +++ b/src/renderer/src/i18n/en-US/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Agent Market", + "subtitle": "Discover and install various professional agents" + }, + "categories": { + "title": "Category Filter", + "all": "All", + "development": "Development", + "productivity": "Productivity", + "analytics": "Analytics", + "research": "Research", + "design": "Design", + "support": "Support" + }, + "agentCard": { + "details": { + "basicInfo": "Basic Information", + "version": "Version", + "provider": "Provider", + "skills": "Skills", + "mcpServers": "MCP Servers" + } + }, + "toast": { + "installSuccess": { + "title": "Installation Successful", + "description": "{name} has been successfully installed" + }, + "configure": { + "title": "Configuration", + "description": "Opening configuration interface for {name}" + }, + "uninstallSuccess": { + "title": "Uninstall Successful", + "description": "{name} has been successfully uninstalled" + }, + "installError": { + "title": "Installation Failed", + "description": "Failed to install {name}" + }, + "uninstallError": { + "title": "Uninstall Failed", + "description": "Failed to uninstall {name}" + } + }, + "search": { + "placeholder": "Search agents..." + }, + "results": "results", + "empty": { + "title": "No agents found", + "description": "Try changing your search criteria or category filter" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/en-US/index.ts b/src/renderer/src/i18n/en-US/index.ts index a3ff4dd..ebde1b5 100644 --- a/src/renderer/src/i18n/en-US/index.ts +++ b/src/renderer/src/i18n/en-US/index.ts @@ -16,6 +16,7 @@ import newThread from './newThread.json' import about from './about.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // Individual top-level keys const others = { @@ -50,5 +51,6 @@ export default { about, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/fa-IR/agents.json b/src/renderer/src/i18n/fa-IR/agents.json new file mode 100644 index 0000000..58159cf --- /dev/null +++ b/src/renderer/src/i18n/fa-IR/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "بازار عامل", + "subtitle": "کشف و نصب عوامل حرفه‌ای مختلف" + }, + "categories": { + "title": "فیلتر دسته‌بندی", + "all": "همه", + "development": "توسعه", + "productivity": "بهره‌وری", + "analytics": "تحلیل", + "research": "تحقیق", + "design": "طراحی", + "support": "پشتیبانی" + }, + "agentCard": { + "details": { + "basicInfo": "اطلاعات پایه", + "version": "نسخه", + "provider": "ارائه‌دهنده", + "skills": "مهارت‌ها", + "mcpServers": "سرورهای MCP" + } + }, + "toast": { + "installSuccess": { + "title": "نصب موفق", + "description": "{name} با موفقیت نصب شد" + }, + "configure": { + "title": "پیکربندی", + "description": "در حال باز کردن رابط پیکربندی برای {name}" + }, + "uninstallSuccess": { + "title": "حذف نصب موفق", + "description": "{name} با موفقیت حذف نصب شد" + }, + "installError": { + "title": "نصب ناموفق", + "description": "نصب {name} ناموفق بود" + }, + "uninstallError": { + "title": "حذف نصب ناموفق", + "description": "حذف نصب {name} ناموفق بود" + } + }, + "search": { + "placeholder": "جستجوی عوامل..." + }, + "results": "نتیجه", + "empty": { + "title": "عامل‌ای یافت نشد", + "description": "سعی کنید معیارهای جستجو یا فیلتر دسته‌بندی خود را تغییر دهید" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/fa-IR/index.ts b/src/renderer/src/i18n/fa-IR/index.ts index e876a05..eceafda 100644 --- a/src/renderer/src/i18n/fa-IR/index.ts +++ b/src/renderer/src/i18n/fa-IR/index.ts @@ -16,6 +16,7 @@ import artifacts from './artifacts.json' import chat from './chat.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' const others = { Silicon: 'SiliconFlow', @@ -49,5 +50,6 @@ export default { chat, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/fr-FR/agents.json b/src/renderer/src/i18n/fr-FR/agents.json new file mode 100644 index 0000000..bac32a6 --- /dev/null +++ b/src/renderer/src/i18n/fr-FR/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Marché des Agents", + "subtitle": "Découvrez et installez divers agents professionnels" + }, + "categories": { + "title": "Filtre par catégorie", + "all": "Tous", + "development": "Développement", + "productivity": "Productivité", + "analytics": "Analyse", + "research": "Recherche", + "design": "Conception", + "support": "Support" + }, + "agentCard": { + "details": { + "basicInfo": "Informations de base", + "version": "Version", + "provider": "Fournisseur", + "skills": "Compétences", + "mcpServers": "Serveurs MCP" + } + }, + "toast": { + "installSuccess": { + "title": "Installation réussie", + "description": "{name} a été installé avec succès" + }, + "configure": { + "title": "Configuration", + "description": "Ouverture de l'interface de configuration pour {name}" + }, + "uninstallSuccess": { + "title": "Désinstallation réussie", + "description": "{name} a été désinstallé avec succès" + }, + "installError": { + "title": "Échec de l'installation", + "description": "Échec de l'installation de {name}" + }, + "uninstallError": { + "title": "Échec de la désinstallation", + "description": "Échec de la désinstallation de {name}" + } + }, + "search": { + "placeholder": "Rechercher des agents..." + }, + "results": "résultats", + "empty": { + "title": "Aucun agent trouvé", + "description": "Essayez de modifier vos critères de recherche ou votre filtre de catégorie" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/fr-FR/index.ts b/src/renderer/src/i18n/fr-FR/index.ts index 7edbbc6..d707d78 100644 --- a/src/renderer/src/i18n/fr-FR/index.ts +++ b/src/renderer/src/i18n/fr-FR/index.ts @@ -16,6 +16,7 @@ import artifacts from './artifacts.json' import chat from './chat.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -50,5 +51,6 @@ export default { chat, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/ja-JP/agents.json b/src/renderer/src/i18n/ja-JP/agents.json new file mode 100644 index 0000000..7c58206 --- /dev/null +++ b/src/renderer/src/i18n/ja-JP/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "エージェントマーケット", + "subtitle": "様々な専門エージェントを発見してインストール" + }, + "categories": { + "title": "カテゴリフィルター", + "all": "すべて", + "development": "開発", + "productivity": "生産性", + "analytics": "分析", + "research": "研究", + "design": "デザイン", + "support": "サポート" + }, + "agentCard": { + "details": { + "basicInfo": "基本情報", + "version": "バージョン", + "provider": "プロバイダー", + "skills": "スキル", + "mcpServers": "MCP サーバー" + } + }, + "toast": { + "installSuccess": { + "title": "インストール成功", + "description": "{name} が正常にインストールされました" + }, + "configure": { + "title": "設定", + "description": "{name} の設定インターフェースを開いています" + }, + "uninstallSuccess": { + "title": "アンインストール成功", + "description": "{name} が正常にアンインストールされました" + }, + "installError": { + "title": "インストール失敗", + "description": "{name} のインストールに失敗しました" + }, + "uninstallError": { + "title": "アンインストール失敗", + "description": "{name} のアンインストールに失敗しました" + } + }, + "search": { + "placeholder": "エージェントを検索..." + }, + "results": "件の結果", + "empty": { + "title": "エージェントが見つかりません", + "description": "検索条件またはカテゴリフィルターを変更してみてください" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/ja-JP/index.ts b/src/renderer/src/i18n/ja-JP/index.ts index 7249f83..23ec4ce 100644 --- a/src/renderer/src/i18n/ja-JP/index.ts +++ b/src/renderer/src/i18n/ja-JP/index.ts @@ -16,6 +16,7 @@ import newThread from './newThread.json' import about from './about.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -49,5 +50,6 @@ export default { about, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/ko-KR/agents.json b/src/renderer/src/i18n/ko-KR/agents.json new file mode 100644 index 0000000..3a4af74 --- /dev/null +++ b/src/renderer/src/i18n/ko-KR/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "에이전트 마켓", + "subtitle": "다양한 전문 에이전트를 발견하고 설치하세요" + }, + "categories": { + "title": "카테고리 필터", + "all": "전체", + "development": "개발", + "productivity": "생산성", + "analytics": "분석", + "research": "연구", + "design": "디자인", + "support": "지원" + }, + "agentCard": { + "details": { + "basicInfo": "기본 정보", + "version": "버전", + "provider": "제공자", + "skills": "스킬", + "mcpServers": "MCP 서버" + } + }, + "toast": { + "installSuccess": { + "title": "설치 성공", + "description": "{name}이(가) 성공적으로 설치되었습니다" + }, + "configure": { + "title": "구성", + "description": "{name}의 구성 인터페이스를 열고 있습니다" + }, + "uninstallSuccess": { + "title": "제거 성공", + "description": "{name}이(가) 성공적으로 제거되었습니다" + }, + "installError": { + "title": "설치 실패", + "description": "{name} 설치에 실패했습니다" + }, + "uninstallError": { + "title": "제거 실패", + "description": "{name} 제거에 실패했습니다" + } + }, + "search": { + "placeholder": "에이전트 검색..." + }, + "results": "개 결과", + "empty": { + "title": "에이전트를 찾을 수 없습니다", + "description": "검색 조건이나 카테고리 필터를 변경해 보세요" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/ko-KR/index.ts b/src/renderer/src/i18n/ko-KR/index.ts index 2b9fbfc..a75f31b 100644 --- a/src/renderer/src/i18n/ko-KR/index.ts +++ b/src/renderer/src/i18n/ko-KR/index.ts @@ -16,6 +16,7 @@ import newThread from './newThread.json' import about from './about.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -50,5 +51,6 @@ export default { about, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/ru-RU/agents.json b/src/renderer/src/i18n/ru-RU/agents.json new file mode 100644 index 0000000..615d713 --- /dev/null +++ b/src/renderer/src/i18n/ru-RU/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Рынок Агентов", + "subtitle": "Откройте и установите различных профессиональных агентов" + }, + "categories": { + "title": "Фильтр по категориям", + "all": "Все", + "development": "Разработка", + "productivity": "Производительность", + "analytics": "Аналитика", + "research": "Исследования", + "design": "Дизайн", + "support": "Поддержка" + }, + "agentCard": { + "details": { + "basicInfo": "Основная информация", + "version": "Версия", + "provider": "Провайдер", + "skills": "Навыки", + "mcpServers": "MCP серверы" + } + }, + "toast": { + "installSuccess": { + "title": "Установка успешна", + "description": "{name} успешно установлен" + }, + "configure": { + "title": "Настройка", + "description": "Открывается интерфейс настройки для {name}" + }, + "uninstallSuccess": { + "title": "Удаление успешно", + "description": "{name} успешно удален" + }, + "installError": { + "title": "Ошибка установки", + "description": "Не удалось установить {name}" + }, + "uninstallError": { + "title": "Ошибка удаления", + "description": "Не удалось удалить {name}" + } + }, + "search": { + "placeholder": "Поиск агентов..." + }, + "results": "результатов", + "empty": { + "title": "Агенты не найдены", + "description": "Попробуйте изменить критерии поиска или фильтр категорий" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/ru-RU/index.ts b/src/renderer/src/i18n/ru-RU/index.ts index 9b4da9e..5750151 100644 --- a/src/renderer/src/i18n/ru-RU/index.ts +++ b/src/renderer/src/i18n/ru-RU/index.ts @@ -15,6 +15,7 @@ import components from './components.json' import newThread from './newThread.json' import about from './about.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -48,5 +49,6 @@ export default { newThread, about, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/zh-CN/agents.json b/src/renderer/src/i18n/zh-CN/agents.json new file mode 100644 index 0000000..bbf6a9a --- /dev/null +++ b/src/renderer/src/i18n/zh-CN/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Agent市场", + "subtitle": "发现和安装各种专业智能体" + }, + "categories": { + "title": "分类筛选", + "all": "全部", + "development": "开发", + "productivity": "生产力", + "analytics": "分析", + "research": "研究", + "design": "设计", + "support": "客服" + }, + "agentCard": { + "details": { + "basicInfo": "基本信息", + "version": "版本", + "provider": "提供商", + "skills": "技能", + "mcpServers": "MCP 服务器" + } + }, + "toast": { + "installSuccess": { + "title": "安装成功", + "description": "{name} 已成功安装" + }, + "configure": { + "title": "配置", + "description": "正在打开 {name} 的配置界面" + }, + "uninstallSuccess": { + "title": "卸载成功", + "description": "{name} 已成功卸载" + }, + "installError": { + "title": "安装失败", + "description": "{name} 安装失败" + }, + "uninstallError": { + "title": "卸载失败", + "description": "{name} 卸载失败" + } + }, + "search": { + "placeholder": "搜索智能体..." + }, + "results": "个结果", + "empty": { + "title": "未找到智能体", + "description": "尝试更改搜索条件或分类筛选" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/zh-CN/index.ts b/src/renderer/src/i18n/zh-CN/index.ts index e6ba53d..48af5b3 100644 --- a/src/renderer/src/i18n/zh-CN/index.ts +++ b/src/renderer/src/i18n/zh-CN/index.ts @@ -16,6 +16,7 @@ import newThread from './newThread.json' import about from './about.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -51,5 +52,6 @@ export default { about, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/zh-HK/agents.json b/src/renderer/src/i18n/zh-HK/agents.json new file mode 100644 index 0000000..79a4b26 --- /dev/null +++ b/src/renderer/src/i18n/zh-HK/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Agent市場", + "subtitle": "發現和安裝各種專業智能體" + }, + "categories": { + "title": "分類篩選", + "all": "全部", + "development": "開發", + "productivity": "生產力", + "analytics": "分析", + "research": "研究", + "design": "設計", + "support": "客服" + }, + "agentCard": { + "details": { + "basicInfo": "基本資訊", + "version": "版本", + "provider": "提供商", + "skills": "技能", + "mcpServers": "MCP 伺服器" + } + }, + "toast": { + "installSuccess": { + "title": "安裝成功", + "description": "{name} 已成功安裝" + }, + "configure": { + "title": "設定", + "description": "正在開啟 {name} 的設定介面" + }, + "uninstallSuccess": { + "title": "卸載成功", + "description": "{name} 已成功卸載" + }, + "installError": { + "title": "安裝失敗", + "description": "{name} 安裝失敗" + }, + "uninstallError": { + "title": "卸載失敗", + "description": "{name} 卸載失敗" + } + }, + "search": { + "placeholder": "搜尋智能體..." + }, + "results": "個結果", + "empty": { + "title": "未找到智能體", + "description": "嘗試更改搜尋條件或分類篩選" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/zh-HK/index.ts b/src/renderer/src/i18n/zh-HK/index.ts index 02cbc7c..3c89cb7 100644 --- a/src/renderer/src/i18n/zh-HK/index.ts +++ b/src/renderer/src/i18n/zh-HK/index.ts @@ -15,6 +15,7 @@ import components from './components.json' import newThread from './newThread.json' import about from './about.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' // 单独的顶层键 const others = { @@ -49,5 +50,6 @@ export default { newThread, about, promptSetting, + agents, ...others } diff --git a/src/renderer/src/i18n/zh-TW/agents.json b/src/renderer/src/i18n/zh-TW/agents.json new file mode 100644 index 0000000..79a4b26 --- /dev/null +++ b/src/renderer/src/i18n/zh-TW/agents.json @@ -0,0 +1,55 @@ +{ + "page": { + "title": "Agent市場", + "subtitle": "發現和安裝各種專業智能體" + }, + "categories": { + "title": "分類篩選", + "all": "全部", + "development": "開發", + "productivity": "生產力", + "analytics": "分析", + "research": "研究", + "design": "設計", + "support": "客服" + }, + "agentCard": { + "details": { + "basicInfo": "基本資訊", + "version": "版本", + "provider": "提供商", + "skills": "技能", + "mcpServers": "MCP 伺服器" + } + }, + "toast": { + "installSuccess": { + "title": "安裝成功", + "description": "{name} 已成功安裝" + }, + "configure": { + "title": "設定", + "description": "正在開啟 {name} 的設定介面" + }, + "uninstallSuccess": { + "title": "卸載成功", + "description": "{name} 已成功卸載" + }, + "installError": { + "title": "安裝失敗", + "description": "{name} 安裝失敗" + }, + "uninstallError": { + "title": "卸載失敗", + "description": "{name} 卸載失敗" + } + }, + "search": { + "placeholder": "搜尋智能體..." + }, + "results": "個結果", + "empty": { + "title": "未找到智能體", + "description": "嘗試更改搜尋條件或分類篩選" + } +} \ No newline at end of file diff --git a/src/renderer/src/i18n/zh-TW/index.ts b/src/renderer/src/i18n/zh-TW/index.ts index 5634597..8487ed1 100644 --- a/src/renderer/src/i18n/zh-TW/index.ts +++ b/src/renderer/src/i18n/zh-TW/index.ts @@ -16,6 +16,8 @@ import chat from './chat.json' import toolCall from './toolCall.json' import contextMenu from './contextMenu.json' import promptSetting from './promptSetting.json' +import agents from './agents.json' + // 单独的顶层键 const others = { Silicon: '矽基流動', @@ -49,5 +51,6 @@ export default { toolCall, contextMenu, promptSetting, + agents, ...others } diff --git a/src/renderer/src/views/Agents.vue b/src/renderer/src/views/Agents.vue index ce1b7df..7a9083a 100644 --- a/src/renderer/src/views/Agents.vue +++ b/src/renderer/src/views/Agents.vue @@ -46,13 +46,14 @@ -
+
@@ -91,8 +92,8 @@ const loadAgents = async () => { } } -// 分类数据 -const categories = ref([ +// 分类数据 - 使用计算属性确保语言切换时更新 +const categories = computed(() => [ { id: 'all', name: t('agents.categories.all') }, { id: 'development', name: t('agents.categories.development') }, { id: 'productivity', name: t('agents.categories.productivity') }, @@ -169,14 +170,16 @@ const handleInstallAgent = async (agent: Agent) => { toast({ title: t('agents.toast.installSuccess.title'), description: t('agents.toast.installSuccess.description', { name: agent.name }), - variant: 'default' + variant: 'default', + duration: 3000 }) } catch (error) { console.error('Failed to install agent:', error) toast({ title: t('agents.toast.installError.title'), description: t('agents.toast.installError.description', { name: agent.name }), - variant: 'destructive' + variant: 'destructive', + duration: 5000 }) } } @@ -187,10 +190,42 @@ const handleConfigureAgent = (agent: Agent) => { toast({ title: t('agents.toast.configure.title'), description: t('agents.toast.configure.description', { name: agent.name }), - variant: 'default' + variant: 'default', + duration: 3000 }) } +const handleUninstallAgent = async (agent: Agent) => { + console.log('卸载智能体:', agent.name) + + try { + // 通过 configPresenter 卸载智能体 + const configPresenter = usePresenter('configPresenter') + await configPresenter.uninstallAgent(agent.id) + + // 更新本地状态 + const agentIndex = agents.value.findIndex(a => a.id === agent.id) + if (agentIndex !== -1) { + agents.value[agentIndex].installed = false + } + + toast({ + title: t('agents.toast.uninstallSuccess.title'), + description: t('agents.toast.uninstallSuccess.description', { name: agent.name }), + variant: 'default', + duration: 3000 + }) + } catch (error) { + console.error('Failed to uninstall agent:', error) + toast({ + title: t('agents.toast.uninstallError.title'), + description: t('agents.toast.uninstallError.description', { name: agent.name }), + variant: 'destructive', + duration: 5000 + }) + } +} + const toggleCategory = (categoryId: string) => { activeCategory.value = categoryId } -- Gitee From dac7d67789ecab50c9ef549adb651d19581c11a9 Mon Sep 17 00:00:00 2001 From: ftboy Date: Sat, 25 Oct 2025 17:35:00 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix(agent):=20=E8=A7=A3=E5=86=B3commit?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/components/agent-config/AgentCard.vue | 4 ---- src/renderer/src/components/agent-config/AgentSettings.vue | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/agent-config/AgentCard.vue b/src/renderer/src/components/agent-config/AgentCard.vue index e3904c5..8d35264 100644 --- a/src/renderer/src/components/agent-config/AgentCard.vue +++ b/src/renderer/src/components/agent-config/AgentCard.vue @@ -89,15 +89,11 @@