feat(hermes): Batch 3 §N - 群聊(多 Agent 并行响应)

Hermes 内核没有「群聊」概念,由 ClawPanel 前端编排:
- 用户选 1-N 个 Profile(每个对应一个 Agent 配置)
- 发消息 → 串行调度(用 hermes_profile_use 切换 + hermesAgentRun 阻塞调用)
- 每个 Profile 的回复用 @profile_name 标记后显示在统一界面

## 新页面 /h/group-chat(~250 行)

### UI 布局
- 左侧 240px: Profile 多选列表
  · 顶部说明 + 已选 N 个统计
  · checkbox 风格,is-checked 高亮
- 右侧主区: 消息列表 + 输入框
  · user 消息右对齐(accent 蓝色气泡)
  · assistant 消息左对齐(每条带 @profile 徽章)
  · loading 状态用三点跳动动画
  · error 状态红色 + ⚠️ 图标
  · 输入框 Enter 发送 / Shift+Enter 换行

### 调度策略
- 当前实现:串行(hermes_profile_use 切换 + hermesAgentRun)
  · 简单稳健,避免后端并发对同一 profile 状态的竞态
  · 缺点:N 个 profile 总耗时 = N × 单次耗时
- 真正并发需后端支持 hermes_agent_run(profile=...) 参数
  · 留作下次内核改造(设计稿已记下)

### 限制(明确告知用户)
- 仅 Tauri 桌面端(Web 模式显示禁用提示)
- 非流式(用阻塞式 hermesAgentRun,等所有完成后一起显示)
- 不持久化(一次性会话,刷新清空,不挂 chat-store)
- 切 profile 后不还原(用户后续 /h/chat 会保持最后切到的 profile)

### sidebar
- 监控 section 加群聊入口(agents icon,紧跟 /h/chat 之后)
- /h/group-chat 路由注册

### CSS(~180 行)
- .hm-gc-layout: grid 双栏(响应式 → 单栏)
- .hm-gc-side: 左侧 profile 多选
- .hm-gc-main: 右侧消息列表 + 输入区
- 加载点动画 hm-gc-pulse
- @profile 徽章用 mono 字体 + accent 色

### i18n
- 13 个新键 × 3 语言(hermesGroupChat*)

## 累计
- 1 个新页面 ~250 行 + CSS ~180 行 + i18n 39 字符串
- npm build ✓
This commit is contained in:
晴天
2026-05-14 05:39:36 +08:00
parent 129d8c0ac1
commit debce2f810
4 changed files with 459 additions and 0 deletions

View File

@@ -600,6 +600,20 @@ export default {
hermesFilesUnreadable: _('文件无法读取', 'File unreadable', '檔案無法讀取'),
hermesFilesUnsavedConfirm: _('当前文件有未保存的修改,确认丢弃?', 'Current file has unsaved changes. Discard?', '目前檔案有未儲存的修改,確認丟棄?'),
hermesFilesDiscardChanges: _('丢弃', 'Discard', '丟棄'),
// Batch 3 §N: 群聊(多 Agent 并行响应)
hermesGroupChatTitle: _('群聊', 'Group Chat', '群聊'),
hermesGroupChatDesc: _('选多个 Profile一句话同时问多个 Agent对比不同模型/角色的回答', 'Pick multiple profiles, ask one question to many agents at once, compare answers', '選多個 Profile一句話同時問多個 Agent比較不同模型/角色的回答'),
hermesGroupChatProfiles: _('参与的 Profile', 'Participating profiles', '參與的 Profile'),
hermesGroupChatProfilesHint: _('勾选要一起回复的 Profile每个 Profile 是一个 Agent 配置)', 'Tick profiles that should reply together', '勾選要一起回覆的 Profile'),
hermesGroupChatSelected: _('已选 {n} 个', '{n} selected', '已選 {n} 個'),
hermesGroupChatEmpty: _('选好 Profile 后输入消息发送', 'Pick profiles and send a message to start', '選好 Profile 後輸入訊息發送'),
hermesGroupChatPlaceholder: _('输入消息Enter 发送Shift+Enter 换行)…', 'Type a message (Enter to send, Shift+Enter for newline)…', '輸入訊息Enter 發送Shift+Enter 換行)…'),
hermesGroupChatSend: _('发送', 'Send', '發送'),
hermesGroupChatSending: _('发送中…', 'Sending…', '發送中…'),
hermesGroupChatClear: _('清空', 'Clear', '清空'),
hermesGroupChatRunFailed: _('运行失败', 'Run failed', '執行失敗'),
hermesGroupChatNoOutput: _('(无输出)', '(no output)', '(無輸出)'),
hermesGroupChatWebUnsupported: _('Web 模式不支持群聊(依赖 hermesAgentRun需桌面端事件桥。请用桌面客户端。', 'Group chat is not supported in Web mode (requires desktop event bridge). Use the desktop app.', 'Web 模式不支援群聊(依賴 hermesAgentRun需桌面端事件橋。請用桌面客戶端。'),
// Web 模式(远程浏览器)下流式聊天暂不可用
chatWebModeStreamingUnsupported: _(
'Web 模式暂不支持 Hermes 实时流式聊天(依赖桌面端事件桥)。请打开桌面客户端使用此功能。',