feat(hermes): Batch 2 §I + Batch 3 §M - 流恢复 + Kanban 看板

## Batch 2 §I 流恢复(chat 在切页/刷新后能接上 run)

校对稿:用 run_id 持久化到 localStorage,新页面挂载时查询 status 决定是否重连。

### 后端
- 新 Tauri 命令 hermes_run_status(run_id):
  · GET /v1/runs/{run_id} 返回 { run_id, status, last_event, output?, ... }
  · status: running / stopping / completed / failed / cancelled / waiting_for_approval
  · 404 友好返回 status='not_found' 而不是抛错

### 前端 chat-store
- 新 STORAGE_ACTIVE_RUN 持久化 { runId, sessionId, profile, t }
- hermes-run-started 监听里 safeSet 持久化
- cleanupAfterRun 里 safeRemove 清理
- 新方法 recoverIfRunning():
  · 跨 profile / 1 小时过期 → 直接清
  · status=running/stopping/waiting_for_approval → attachStreamListeners + 恢复 streaming
  · status=已结束 → 拉最新 messages
  · 404 → 静默清

### chat.js
- 页面挂载时 store.recoverIfRunning() — 切页/刷新后无缝接上流

## Batch 3 §M Kanban 看板(Hermes 已内置)

校对稿:「Hermes 已内置 kanban 系统,直接调 /api/plugins/kanban/* 即可」。
设计稿原本是「自建本地存储」(~800 行),复用 Hermes 内置后大幅缩减。

### 新页面 /h/kanban
- 全部走 hermesDashboardApi(复用 §H 的基础设施)
- 顶部 board 切换器 + 「+ 新任务」按钮
- 渲染 board.columns(按状态分列:todo / in_progress / blocked / done / archived)
- 任务卡片:title + summary(2 行截断)+ priority badge + assignee + 评论数
- 点卡片 → showContentModal 显示详情 + 「修改状态」按钮
- 修改状态 → PATCH /api/plugins/kanban/tasks/{id} { status }
- board 切换 → POST /api/plugins/kanban/boards/{slug}/switch

### sidebar
- 「管理」section 加 Kanban 入口(inbox 图标)
- /h/kanban 路由注册

### CSS (.hm-kanban-*)
- 水平滚动 board 容器
- 280px 固定宽度列 + 内部滚动
- 卡片 hover 边框变 accent 色 + 轻阴影
- 优先级 badge(琥珀色)/ assignee(accent 色)

### i18n
- 27 个新键 × 3 语言(zh-CN/en/zh-TW)

## 累计
- Rust: 1 个新命令(hermes_run_status ~30 行)
- 前端: chat-store 流恢复(~40 行)+ kanban 新页面(~230 行)
- i18n: 27 个新键 × 3 语言
- CSS: ~100 行
- cargo check ✓ + npm build ✓
This commit is contained in:
晴天
2026-05-14 05:12:37 +08:00
parent 3168551569
commit 3c8c315402
10 changed files with 468 additions and 4 deletions

View File

@@ -486,6 +486,35 @@ export default {
hermesProfileActive: _('当前', 'Active', '當前'),
hermesProfileCreated: _('已创建 Profile "{name}"', 'Profile "{name}" created', '已建立 Profile "{name}"'),
hermesProfileCreateFailed: _('创建失败', 'Create failed', '建立失敗'),
// Batch 3 §M: Kanban 看板Hermes 已内置,走 /api/plugins/kanban/*
hermesKanbanTitle: _('看板', 'Kanban', '看板'),
hermesKanbanDesc: _('管理 Agent 任务卡片,按状态分列', 'Manage agent tasks by status columns', '管理 Agent 任務卡片,按狀態分欄'),
hermesKanbanEmpty: _('暂无任务(请先启动 Dashboard', 'No tasks (start Dashboard first)', '暫無任務(請先啟動 Dashboard'),
hermesKanbanColEmpty: _('(空)', '(empty)', '(空)'),
hermesKanbanNewTask: _('新任务', 'New task', '新任務'),
hermesKanbanNewTaskTitle: _('新建任务', 'New task', '新建任務'),
hermesKanbanTitleLabel: _('标题', 'Title', '標題'),
hermesKanbanTitleRequired: _('标题不能为空', 'Title is required', '標題不能為空'),
hermesKanbanSummaryLabel: _('摘要', 'Summary', '摘要'),
hermesKanbanDescLabel: _('描述', 'Description', '描述'),
hermesKanbanStatusLabel: _('状态', 'Status', '狀態'),
hermesKanbanPriorityLabel: _('优先级', 'Priority', '優先級'),
hermesKanbanAssigneeLabel: _('指派给', 'Assignee', '指派給'),
hermesKanbanRunSummary: _('最近运行摘要', 'Latest run summary', '最近執行摘要'),
hermesKanbanColTodo: _('待办', 'To do', '待辦'),
hermesKanbanColInProgress: _('进行中', 'In progress', '進行中'),
hermesKanbanColBlocked: _('阻塞', 'Blocked', '阻塞'),
hermesKanbanColDone: _('完成', 'Done', '完成'),
hermesKanbanColArchived: _('归档', 'Archived', '歸檔'),
hermesKanbanTaskCreated: _('任务已创建', 'Task created', '任務已建立'),
hermesKanbanTaskCreateFailed: _('创建任务失败', 'Create task failed', '建立任務失敗'),
hermesKanbanTaskUpdated: _('任务已更新', 'Task updated', '任務已更新'),
hermesKanbanTaskUpdateFailed: _('更新任务失败', 'Update task failed', '更新任務失敗'),
hermesKanbanTaskLoadFailed: _('加载任务失败', 'Load task failed', '載入任務失敗'),
hermesKanbanMoveStatus: _('修改状态', 'Change status', '修改狀態'),
hermesKanbanMoveStatusTitle: _('修改任务状态', 'Change task status', '修改任務狀態'),
hermesKanbanBoardSwitched: _('已切换到看板 "{name}"', 'Switched to board "{name}"', '已切換到看板 "{name}"'),
hermesKanbanBoardSwitchFailed: _('切换看板失败', 'Switch board failed', '切換看板失敗'),
// Web 模式(远程浏览器)下流式聊天暂不可用
chatWebModeStreamingUnsupported: _(
'Web 模式暂不支持 Hermes 实时流式聊天(依赖桌面端事件桥)。请打开桌面客户端使用此功能。',