diff --git a/src/renderer/src/components/agent-config/AgentCard.vue b/src/renderer/src/components/agent-config/AgentCard.vue index 35f9c8d2d70469b3786ce0ca303e67c77c0e16a7..8d352643ee19f1ecb8b6ebe587b83c9d4d76ca8a 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,59 +46,53 @@ {{ agent.description }}

- -
- - {{ skill.name }} - - - +{{ agent.skills.length - 3 }} - + +
+
+ + {{ skill.name }} + + + +{{ agent.skills.length - 3 }} + +
+ + +
+ +
- -
- - -
+ +
+ + + @@ -131,4 +136,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 0000000000000000000000000000000000000000..b74ed09eb3435f12a5a212bd099a930bd4a2b09d --- /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 0000000000000000000000000000000000000000..10070299fd2ebf6dc359019b051c55f35aecab7c --- /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 0000000000000000000000000000000000000000..fa7af7330df5308a2a8bd8dac0a4ebcd4a557bc0 --- /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 0000000000000000000000000000000000000000..15fbec6b707214430b4c4cdc29b93c5a8c2f3a78 --- /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 a3ff4dda3f0bd48b4e4e0c15fceaf4dfe99e2fb1..ebde1b54e575c1445188bb47ceb5318f39b5e7a4 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 0000000000000000000000000000000000000000..58159cf7aed1f65b3b7739b817a727f8ce10047d --- /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 e876a05d2c257dc5355af49163068384388de688..eceafda329fdf9ef9a691f5f184e650ed692ccfc 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 0000000000000000000000000000000000000000..bac32a6c044c164a3fd09ed912e2bb80d8ff5229 --- /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 7edbbc673db946cb80c880325f3798a5967f558c..d707d7857c5dcf7404d30a739d097d7e5844c42c 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 0000000000000000000000000000000000000000..7c582064b69311301583ba4164f195b7a15e72a1 --- /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 7249f83794a121ef886915773e5eb75c2834d206..23ec4cefc5f52eef6a64f0df50ab75425485d24d 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 0000000000000000000000000000000000000000..3a4af74044f5e872789a4ce2c6f9ede3ed76327f --- /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 2b9fbfc3efb4a2df5e6093e6d0e2a45ebd1b77f3..a75f31bdb55eaf33586526683fc4a12370228d20 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 0000000000000000000000000000000000000000..615d713f30c4ff9c93ca70e878df571636a66303 --- /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 9b4da9e1fe704b66543404f2593a0d974decf061..575015103a3176360fb3536c9c987ccc838395ec 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 0000000000000000000000000000000000000000..bbf6a9ada15d9267fcf7f8cc8ab2773f3a5df90f --- /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 e6ba53dba0a8092fc50f8206c005f7d9afea2958..48af5b32e322d22030677e8cc4e04be6cceeda66 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 0000000000000000000000000000000000000000..79a4b26cfd16dab03b27d6470cfa8be3292cb994 --- /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 02cbc7c2634f96541a8bb45662df44249f6f51cc..3c89cb7eca467a1aa5a392cb0ff37f8bceca59aa 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 0000000000000000000000000000000000000000..79a4b26cfd16dab03b27d6470cfa8be3292cb994 --- /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 5634597d5c37cddf16f3a056b14f13c9afb92021..8487ed172ab3ff01071339299c74d52a8e8d057d 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 ce1b7df28f63460923df49beb04f88f79eeb3cd8..7a9083a86c88f1dfb2317eb1c6f9641a0eb48aa7 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 }