Files
mnote/design/old/07-ai/done/7-7-page-ai-mini-hermes-control-surface-v1.md
T
Agent Board b798f628ee chore: land tree view-state, vault, Pi module split, and repo hygiene
Persist PageTree expand state via control-plane view-state and align
chevron/DOM with restored expansion; keep Sidex-style shallow page-tree
scan and drop the unused recursive scanner that only added cargo noise.

Add password vault workbench routes/runtime/skill/CLI, split page_ai_pi
into a module package, and retire Hermes/ACP/OpenHub recycle + root
harness evidence from the index while gitignoring recycle and local
diag dumps.

Archive superseded design/bugs docs under old/, point architecture at
ARCHITECTURE.md, and refresh smokes for Pi S1–S7, vault, and editor
regressions so the working tree can stay clean.
2026-07-21 05:13:05 +08:00

399 lines
27 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# [recycle] 7-7 [done] 页面 AI Mini Hermes 控制面设计与执行 checklist v1
> 更新时间:2026-05-14
>
> 当前状态:`DONE`。当前实现已经可以通过 Hermes 返回回复,并已完成 `7-4` 的 session/run/tool/writeback/audit 主链;本稿承接的 Mini Hermes 控制面已完成:`agent/profile` 选择、`SOUL.md` / `USER.md` / `MEMORY.md` 轻编辑、skill 启停、Hermes settings 深链、run stop、context scope、mnote tool 可用性和最近 tool call / trace / audit 摘要均已有代码与 smoke 验证。retry、session rename/delete、profile create/rename、skill 上传继续作为 P2,不在本稿 done gate 内。
>
> 上位依据:
> - `/mnt/Data1T/mnote/ARCHITECTURE.md`
> - `/mnt/Data1T/mnote/design/01-05-current-priority-overview.md`
> - `/mnt/Data1T/mnote/design/03-rust-web/reference/3-rust-web-long-term-architecture-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/process/5-5-page-aggregate-single-truth-alignment-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/done/5-6-page-aggregate-alignment-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/05-editor-mainline/reference-code/hermes-web-ui-0.5.18`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-3-page-ai-hermes-panel-and-mnote-plugin-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-4-page-ai-hermes-panel-execution-checklist-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-5-hermes-client-proxy-contract-v1.md`
> - `/mnt/Data1T/mnote/design/07-ai/done/7-6-mnote-hermes-plugin-tool-contract-v1.md`
---
## 1. 方向判断
当前截图和实现状态说明:页面 AI 已经能回复,但它还更像“能发消息的 Hermes run 面板”,缺少用户自然期待的 Hermes 运行态控制与设置入口。
下一阶段不要把 mnote 做成第二个 Hermes 管理台,也不要把 Hermes 的 Settings / Profiles / Usage / Logs 全部搬进页面抽屉。正确方向是:
> **页面 AI 面板成为 Mini Hermes control surface:只管理和当前 mnote 页面会话直接相关的 session、run、agent/profile、model、skill、tool、context scope 与错误恢复;所有全局配置真相仍归 Hermes。**
边界继续保持:
- Hermes 持有 session/message/tool event/usage/model/profile 真相。
- mnote 只持有页面、树、正文、artifact、edge、Page Aggregate 和 audit 真相。
- 页面 AI 面板只调用 Hermes,不保存聊天历史,不维护 provider/API key,不重建 plugin registry。
- 页面 AI 面板可以选择 agent/profile、启停 skill、编辑当前 agent 的轻量人格文件;保存和生效都必须走 Hermes API。
- provider/API key、账号登录、全局 marketplace、profile 导入导出等深层设置跳转或 deep link 到 Hermes 自己的设置页。
用户提供的参考图只作为能力边界参考,不要求照搬 UI:
- `/mnt/Data1T/mnote/tmp/img_v3_0211m_b7390ad9-a45b-4d94-8126-b7c17f029feg.png`AI 人格页,包含 `SOUL.md``IDENTITY.md``USER.md` 类 profile 文件编辑和保存。
- `/mnt/Data1T/mnote/tmp/img_v3_0211m_0d6e7a60-8c21-4fd1-8cdf-d548dab7532g.png`:技能页,包含搜索、上传、自定义技能额度、单个技能启停和详情查看。
---
## 2. Hermes Web UI 参考索引
参考根目录固定为:
```text
/mnt/Data1T/mnote/design/05-editor-mainline/reference-code/hermes-web-ui-0.5.18
```
只参考下表列出的具体位置。目标是复用 Hermes 的语义与行为边界,仍然用 Leptos 实现 mnote 页面内面板。
| mnote 下一步任务 | 参考文件 | 搜索点 / 具体位置 | 参考目的 | 不采用内容 |
| --- | --- | --- | --- | --- |
| run 发起、恢复和事件语义 | `packages/client/src/api/hermes/chat.ts` | `StartRunRequest``RunEvent``registerSessionHandlers``resumeSession``startRunViaSocket` | 对齐 run 创建、session room 恢复、事件类型和浏览器端分发语义 | 不直接复用 Vue/TS client,不让浏览器绕过 mnote-web proxy |
| 前端消息归并 | `packages/client/src/stores/hermes/chat.ts` | `mapHermesMessages``case 'tool.started'``case 'tool.completed'``refreshActiveSession``switchSession` | 对齐 message/tool event 在前端归并成消息列表的规则 | 不把归并结果保存到 mnote local/session storage 作为真相 |
| 面板分层 | `packages/client/src/components/hermes/chat/ChatPanel.vue` | `activeSessionTitle``showSessions``handleNewChat``MessageList``ChatInput``SessionListItem` | 对齐 session list / message list / input 的最小层次 | 不复制 Hermes 全屏布局、Vue 组件结构或 Naive UI |
| tool 消息展示 | `packages/client/src/components/hermes/chat/MessageItem.vue` | `message.role === 'tool'``formatToolPayload``tool-preview``tool-details``tool-error-badge` | 对齐 tool 结果默认折叠、摘要、错误 badge、详情展开 | 不把 tool result 当正文写入,不扩大为审计详情管理台 |
| session 列表项 | `packages/client/src/components/hermes/chat/SessionListItem.vue` | `session-item-title``session.title``session-item-model` | 对齐 session 标题、模型和时间的展示语义 | 不把 Hermes session title 同步为 mnote page title |
| model 选择展示 | `packages/client/src/components/layout/ModelSelector.vue` | `selectedDisplayName``handleSelect``model-name``model-item` | 对齐模型显示名称、选择行为和禁用态 | 不在 mnote 保存 model/provider/API key 真相 |
| agent/profile 选择 | `packages/client/src/components/layout/ProfileSelector.vue``packages/client/src/api/hermes/profiles.ts``packages/client/src/stores/hermes/profiles.ts` | `fetchProfiles``switchProfile``activeProfileName``handleChange` | 对齐 Hermes profile 作为 agent 的选择语义;mnote 面板选择的是 profile,不是自建 agent 表 | 不要求页面刷新;不直接复制 Hermes sidebar profile selector |
| profile 管理边界 | `packages/client/src/views/hermes/ProfilesView.vue``packages/client/src/components/hermes/profiles/ProfileCard.vue``ProfileCreateModal.vue``ProfileRenameModal.vue``packages/server/src/routes/hermes/profiles.ts` | `/api/hermes/profiles``/api/hermes/profiles/active``rename``create``delete` | 只参考 profile list/detail/rename 的字段和错误边界 | 第一阶段不做 import/export/delete;不把 mnote 做成完整 ProfilesView |
| agent 人格文件编辑 | `packages/client/src/views/hermes/MemoryView.vue``packages/client/src/api/hermes/skills.ts``packages/server/src/routes/hermes/memory.ts``packages/server/src/controllers/hermes/memory.ts` | `fetchMemory``saveMemory``memory/user/soul``SOUL.md``USER.md``MEMORY.md` | 对齐 Hermes 如何读取和保存人格/记忆文件;mnote 可提供当前 agent 的轻量编辑器 | 不在 mnote 直接读写 profile 目录;不绕过 Hermes API 写文件 |
| run 生命周期与持久化 | `packages/server/src/services/hermes/chat-run-socket.ts` | `handleRun``emit``applyResponseStreamEvent``flushResponseRunToDb``markCompleted` | 对齐 queued/running/tool_calling/completed/failed 与 flush 到 Hermes DB 的时机 | 不在 mnote 里重写 Hermes 编排器 |
| session 存储真相 | `packages/server/src/db/hermes/session-store.ts` | `HermesSessionRow``HermesMessageRow``getSessionDetail``addMessage``renameSession` | 明确 session/message/tool call 真相字段来自 Hermes | 不在 mnote 建第二份 chat/session 表 |
| plugin/tool 发现 | `packages/server/src/services/hermes/plugins.ts` | `PluginManager``providesTools``listHermesPlugins``requiresEnv` | 对齐 mnote tools 作为 Hermes plugin/tool registry 的一部分被发现 | 不把 mnote-web 私有 route 当成最终 plugin registry |
| skill/plugin API 外观 | `packages/client/src/api/hermes/plugins.ts``packages/client/src/api/hermes/skills.ts``packages/client/src/views/hermes/SkillsView.vue``packages/client/src/components/hermes/skills/SkillList.vue``SkillDetail.vue``packages/server/src/routes/hermes/skills.ts` | `fetchSkills``toggleSkill``pinSkillApi``fetchSkillContent``fetchSkillFiles``/api/hermes/skills/toggle` | 对齐 skill 搜索、分类、启停、详情和文件查看;页面 AI 需要能启停技能 | 不实现完整 marketplace、批量安装、复杂上传发布流程 |
| 不进入 mnote 面板第一阶段 | `packages/client/src/views/hermes/SettingsView.vue``ProfilesView.vue``UsageView.vue``LogsView.vue``JobsView.vue``FilesView.vue``ChannelsView.vue``TerminalView.vue``GroupChatView.vue` | 页面级管理视图入口 | 用来明确边界:这些属于 Hermes 管理台 | 不搬进 mnote 页面 AI 抽屉 |
快速定位命令:
```bash
cd /mnt/Data1T/mnote/design/05-editor-mainline/reference-code/hermes-web-ui-0.5.18
rg -n "StartRunRequest|RunEvent|registerSessionHandlers|resumeSession|startRunViaSocket|mapHermesMessages|tool\\.started|tool\\.completed|activeSessionTitle|formatToolPayload|selectedDisplayName|fetchProfiles|switchProfile|fetchMemory|saveMemory|toggleSkill|SkillList|handleRun|flushResponseRunToDb|PluginManager|providesTools" packages/client/src packages/server/src
```
---
## 3. 产品边界
### 3.1 必须进入 mnote 页面 AI 面板
- 当前 Hermes session 标题、session id、模型名、profile 名和恢复状态。
- agent/profile 选择:用户能在页面 AI 面板里选择当前使用的 Hermes profileprofile 等同本设计中的 agent。
- agent/profile 轻编辑:用户能查看和修改当前 agent 的 `SOUL.md``USER.md``MEMORY.md`,若 Hermes 后续暴露 `IDENTITY.md` 也按同一文件编辑模型接入。
- skill 启停:用户能搜索 Hermes skills,查看简要说明,并启用/停用单个 skill。
- 当前 run 状态:`idle``queued``running``tool_calling``completed``failed``aborted`
- 当前页面上下文范围:当前页、当前选区、当前块、全文、页面设置。
- 当前 mnote tools 可用性:`mnote.page.get``mnote.page.save``mnote.page.update_title``mnote.page.update_options``mnote.artifact.create_summary``mnote.artifact.create_ai_note`
- 最近 tool call 摘要、参数摘要、结果摘要、失败原因和 trace/audit id。
- 停止、重试、继续、重新读取当前页上下文的最小操作。
- 跳转 Hermes 设置的入口,说明缺失项应在 Hermes 中配置。
### 3.2 不进入 mnote 页面 AI 面板
- provider/API key 密钥管理。
- 全局 profile 导入导出、删除、批量迁移、凭据清理等危险操作。
- Hermes plugin marketplace / skill marketplace 的安装、发布、版本管理和批量上传。
- usage 报表、日志中心、任务中心、文件中心、频道、终端、群聊。
- Hermes session 数据库迁移、导入导出、conversation 管理台。
- 独立 mnote 聊天历史存储。
### 3.3 可选但不阻塞第一阶段
- 当前页面最近 sessions 搜索。
- session 重命名与删除。
- profile rename / create。
- model 下拉切换。
- skill pin、skill 文件详情查看、单个本地 skill 上传。
- tool event JSON 详情复制。
- session deep link 到 Hermes 管理台。
---
## 4. 目标信息架构
页面 AI 抽屉保持 Wolai 对齐后的壳层,内部按五层组织:
1. 顶部状态条:session 标题、agent/profile、模型、连接状态、设置跳转。
2. 消息区:Hermes message list、streaming 回复、tool event 折叠项。
3. Agent 设置区:profile 选择、SOUL/USER/MEMORY 轻编辑、skill 搜索与启停。
4. 上下文与工具条:当前 context scope、可用 mnote tools、最近 audit/trace。
5. 输入区:prompt 输入、发送、停止、重试、继续。
验收时不要只看 DOM,应以截图和交互为准:
- 顶部状态在窄屏不挤压输入区。
- tool event 折叠项不会撑破抽屉宽度。
- 失败态能看到可执行动作,不只是一段错误文本。
- 设置入口不会暗示 mnote 自己持有 API key。
- agent/profile 选择和 skill 启停必须明确显示“由 Hermes 保存 / 全局生效或当前 profile 生效”的作用域,避免用户误以为只是当前页面临时开关。
---
## 5. 数据与 API 边界
### 5.1 mnote-web proxy 需要补齐的读接口
- `GET /api/hermes/client/session/current?documentId=...`
- `GET /api/hermes/client/sessions?documentId=...&limit=...`
- `GET /api/hermes/client/session/:sessionId`
- `GET /api/hermes/client/models`
- `GET /api/hermes/client/profiles`
- `GET /api/hermes/client/profiles/:profileName`
- `GET /api/hermes/client/profile-memory?profile=...`
- `GET /api/hermes/client/skills?profile=...&query=...`
- `GET /api/hermes/client/tools?scope=mnote`
- `GET /api/hermes/client/runtime/status`
这些接口只透传或规整 Hermes 状态,不在 mnote 保存真相。
### 5.2 mnote-web proxy 需要补齐的操作接口
- `POST /api/hermes/client/run`
- `POST /api/hermes/client/run/:runId/stop`
- `POST /api/hermes/client/run/:runId/retry`
- `POST /api/hermes/client/session/:sessionId/resume`
- `POST /api/hermes/client/session/:sessionId/rename`
- `DELETE /api/hermes/client/session/:sessionId`
- `PUT /api/hermes/client/profiles/active`
- `POST /api/hermes/client/profile-memory`
- `PUT /api/hermes/client/skills/toggle`
第一阶段必须完成 `run/stop/resume`、profile 选择、skill 单项启停、`SOUL.md` / `USER.md` / `MEMORY.md` 轻编辑。`retry/rename/delete`、profile create/rename、skill 上传可以排到 P2,但 UI 文案不能让用户误以为已经支持。
### 5.3 Agent / profile 选择语义
在本稿中,“agent” 等同 Hermes profile。页面 AI 不创建 mnote 私有 agent 表。
选择 profile 时必须处理 session 归属:
- 若当前没有 Hermes session,选择 profile 后创建新 sessionsession 的 `profile` 字段由 Hermes 持有。
- 若当前 session 已绑定 profile,用户切换 profile 时默认创建一个新的当前页 session;不要原地篡改旧 session 的 profile。
- 页面可以记住“当前页面最后使用的 session id / profile name”作为 UI 恢复线索,但聊天真相仍以 Hermes session detail 为准。
- profile 切换不自动改页面正文,不自动触发写入工具。
### 5.4 Agent 人格文件编辑语义
页面 AI 面板允许轻编辑当前 profile 的人格文件:
- `SOUL.md`:核心人格、价值观、行为边界。
- `USER.md`:用户偏好与长期上下文。
- `MEMORY.md`Hermes memory 笔记。
- `IDENTITY.md`:若 Hermes API 暴露,则作为同类 profile file 接入;未暴露时 UI 不显示假入口。
保存规则:
- 通过 Hermes API 保存,不由 mnote 直接读写 `.hermes` 文件。
- 保存前显示本次修改作用域:当前 Hermes profile。
- 保存后只影响后续 run;已完成的 Hermes session/message 不回写。
- 保存失败必须显示 Hermes 返回的原因,不能静默保留本地草稿并显示成功。
### 5.5 Skill 启停语义
页面 AI 面板允许搜索、查看和启停 skill。
第一阶段只要求:
- 列表来自 Hermes `/api/hermes/skills` 或 mnote-web 同源 proxy。
- 单个 skill 的 `enabled` 状态由 Hermes 持有。
- toggle 调用 Hermes `/api/hermes/skills/toggle` 语义。
- UI 明确展示 skill 来源:builtin / hub / local / modified。
- 禁用 skill 影响后续 run;正在运行的 run 不强制中断,除非 Hermes upstream 本身返回中断。
不在第一阶段做:
- marketplace 安装/发布。
- 批量启停。
- 删除 builtin skill。
- 上传并发布完整 skill 包。单个本地 skill 上传可排 P2,且仍走 Hermes。
### 5.6 mnote tool manifest
页面 AI 面板展示 tool 可用性时应优先从 Hermes plugin/tool registry 来,而不是硬编码前端列表。允许 mnote-web 在过渡期提供同源聚合:
- tool name
- description
- read/write 分类
- required scope
- permission 状态
- last call summary
- last audit id
- unavailable reason
---
## 6. 顺序执行 checklist
### A. 设计与现状审计
- [ ] A1. 打开当前 `3000` 页面 AI 抽屉,记录“能回复但缺设置/运行态控制”的截图到 `tmp/`
- 验收标准:截图能看到回复链路、顶部或设置区域缺失点、当前 session/run 状态展示缺口。
- [ ] A2. 用 `rg` 确认活跃设计稿中页面 AI 主线已经指向 Hermes session/run/events。
- 验收标准:`design/07-ai/process` 只剩本 `7-7` 作为 AI 活跃稿;`7-2``7-6` 位于 `done/`
- [ ] A3. 对照 Hermes Web UI 参考索引打开精确文件,不整目录通读。
- 验收标准:实现任务说明中写明参考了哪个 `packages/...` 文件和哪个搜索点。
### B. 面板状态模型
- [ ] B1. 定义 Leptos 侧 `HermesPanelState`
- 验收标准:状态至少包含 `sessionId``sessionTitle``agentProfileName``profileFilesState``skillListState``modelName``runStatus``connectionStatus``contextScope``toolAvailability``lastAudit`
- [ ] B2. 明确哪些字段来自 Hermes,哪些字段来自 mnote。
- 验收标准:session/message/model/profile/run/tool event 来自 Hermespage title/context/audit 来自 mnote;没有字段把 Hermes session title 当作页面标题。
- [ ] B3. 增加空态、连接失败态、tool 不可用态。
- 验收标准:Hermes 未启动、未配置模型、mnote plugin 缺失、权限不足分别有不同 UI 状态。
### C. 顶部 Mini Hermes 状态条
- [ ] C1. 展示当前 session 标题和恢复状态。
- 验收标准:刷新页面后能从 Hermes session detail 恢复标题和消息,不从 mnote 本地 state 恢复聊天真相。
- [ ] C2. 展示 model/agent profile 摘要。
- 验收标准:能看到当前模型与 agent profile;缺失时显示“选择 agent / 去 Hermes 配置”的动作,而不是在 mnote 内要求填写 API key。
- [ ] C3. 增加设置跳转入口。
- 验收标准:入口跳到 Hermes 设置或 profile 页面;mnote 页面内不出现 provider/API key 编辑表单。
- [ ] C4. 支持 agent/profile 选择。
- 验收标准:profile 列表来自 Hermes;选择新 profile 后新建或切换到该 profile 的 Hermes session,不原地篡改旧 session profile。
### C5. Agent 人格轻编辑
- [ ] C5.1 展示当前 agent 的人格文件入口。
- 验收标准:至少展示 `SOUL.md``USER.md``MEMORY.md``IDENTITY.md` 只在 Hermes API 暴露时展示。
- [ ] C5.2 支持编辑并保存 `SOUL.md`
- 验收标准:保存调用 Hermes API;保存失败不显示成功;保存后新 run 使用更新后人格。
- [ ] C5.3 支持编辑并保存 `USER.md` / `MEMORY.md`
- 验收标准:保存作用域显示为当前 Hermes profilemnote 不直接写 `.hermes` 文件。
- [ ] C5.4 防止运行中误改。
- 验收标准:run 正在进行时编辑器可以查看,但保存按钮禁用或明确提示“保存只影响后续 run”。
### D. Run 控制与恢复
- [ ] D1. 显示 run 状态。
- 验收标准:发送后能依次看到 running/tool_calling/completed 或 failed;状态来自 Hermes run event。
- [ ] D2. 支持停止当前 run。
- 验收标准:点击停止后 Hermes run 进入 aborted/failed 的明确终止态,输入框恢复可用。
- [ ] D3. 支持失败后重试或继续。
- 验收标准:失败态有明确按钮;重试不会创建 mnote 本地聊天副本。
- [ ] D4. 刷新后恢复进行中或已完成 session。
- 验收标准:刷新页面不丢失 Hermes 消息;若 run 已结束,状态显示 completed/failed 而不是一直 loading。
### E. Context Scope
- [ ] E1. 增加 context scope 控件。
- 验收标准:至少支持当前页、当前选区、当前块、页面设置四类;无选区时选区项禁用。
- [ ] E2. run input 只携带当前 scope 的上下文摘要。
- 验收标准:正文大对象不长期写进 Hermes sessionHermes 需要最新正文时通过 `mnote.page.get` 回读。
- [ ] E3. tool call audit 记录 context scope。
- 验收标准:`mnote.page.save`、artifact 写入等 audit 能看到本次来源是 page/selection/block/options 哪种 scope。
### F. Tool 可用性与最近调用
- [ ] F1. 展示 mnote tools 清单。
- 验收标准:清单来源于 Hermes plugin/tool registry 或 mnote-web 过渡聚合,不能只写死在前端。
- [ ] F2. 区分只读工具和写入工具。
- 验收标准:`mnote.page.get` 明确为只读;`mnote.page.save``mnote.page.update_title``mnote.artifact.*` 明确为写入。
- [ ] F3. tool event 默认折叠,支持展开详情。
- 验收标准:交互参考 `MessageItem.vue``tool-preview` / `tool-details`,但使用 Leptos 实现;长 JSON 不撑破布局。
- [ ] F4. 最近 tool call 关联 audit。
- 验收标准:能从 UI 或测试输出看到 `sessionId/runId/toolCallId/traceId/auditId` 的串联。
### F5. Skill 管理最小面
- [ ] F5.1 展示 Hermes skills 列表和搜索。
- 验收标准:列表来自 Hermes skills API;能按名称/描述过滤;显示 builtin / hub / local / modified 来源。
- [ ] F5.2 支持单个 skill 启停。
- 验收标准:开关调用 Hermes `toggleSkill` 语义;刷新后状态仍由 Hermes 返回;失败时回滚 UI 开关。
- [ ] F5.3 支持查看 skill 详情。
- 验收标准:能查看 `SKILL.md` 摘要或详情;长内容不撑破抽屉;详情来源于 Hermes API。
- [ ] F5.4 明确 skill toggle 作用域。
- 验收标准:UI 说明启停影响当前 Hermes profile 或 Hermes 全局配置;不把它描述成仅当前 mnote 页面临时开关。
### G. Session 列表最小面
- [ ] G1. 支持当前页面最近 Hermes sessions 列表。
- 验收标准:列表来自 Hermes session API;只过滤/标注当前 document context,不复制 session 到 mnote。
- [ ] G2. 支持切换 session。
- 验收标准:切换后 message list 从 Hermes detail 恢复;页面正文不因切换 session 被自动修改。
- [ ] G3. P2 支持 rename/delete/search。
- 验收标准:若未实现,UI 不出现可点击假按钮;若实现,操作调用 Hermes session API。
### H. 错误与权限
- [ ] H1. Hermes 未启动或 proxy 502 时显示可诊断状态。
- 验收标准:错误能区分 upstream unavailable、auth/permission、model missing、tool unavailable。
- [ ] H2. 写入工具权限失败不泄露正文。
- 验收标准:tool error 展示摘要、trace/audit id 和恢复动作,不展示不必要的正文 payload。
- [ ] H3. 旧 `/api/ai-agent/run` 继续保持退场 guard。
- 验收标准:新页面 AI 主链不会调用旧入口;retirement smoke 继续通过。
### I. 自动化验收
- [x] I1. 新增或扩展 browser smokesession 状态条。
- 验收标准:断言 session title/model/run status 可见。
- [x] I2. 新增或扩展 browser smokeagent/profile 选择。
- 验收标准:断言 profile 列表来自 Hermes;切换 profile 后新 run/session 使用目标 profile。
- [x] I3. 新增或扩展 browser smokeagent 人格文件编辑。
- 验收标准:保存 `SOUL.md``USER.md` 后通过 Hermes API 读回一致;运行中保存行为符合禁用或提示规则。
- [x] I4. 新增或扩展 browser smokeskill 启停。
- 验收标准:toggle 后刷新仍保持 Hermes 返回状态;失败时 UI 回滚。
- [x] I5. 新增或扩展 browser smokerun stop/retry。
- 验收标准:至少覆盖 stop;retry 若未实现则断言按钮不存在或禁用。
- [x] I6. 新增或扩展 browser smokecontext scope。
- 验收标准:选区/当前页上下文能进入 run payload 或 tool audit。
- [x] I7. 新增或扩展 browser smoketool 可用性与 audit。
- 验收标准:能看到 mnote tool 列表、一次 tool call、对应 audit id。
- [x] I8. 移动端 smoke。
- 验收标准:状态条、tool 折叠、输入区在窄屏不重叠。
---
## 7. Done Gate
本稿移入 `done/` 前必须同时满足:
- [x] 页面 AI 抽屉具备 Mini Hermes 状态条,用户能看见当前 session、model/agent profile、run 状态。
- [x] 页面 AI 抽屉能选择 agent/profile;切换 agent 不篡改已有 Hermes session profile。
- [x] 页面 AI 抽屉能轻编辑当前 agent 的 `SOUL.md``USER.md``MEMORY.md`,保存真相在 Hermes。
- [x] 页面 AI 抽屉能搜索、查看并启停 Hermes skill,刷新后状态仍以 Hermes 返回为准。
- [x] 页面 AI 抽屉具备 context scope 控件,run input 和 tool audit 能反映 scope。
- [x] 页面 AI 抽屉能展示 mnote tool 可用性、最近 tool call 和 audit/trace 串联。
- [x] stop 至少可用;retry/rename/delete 若未实现,必须明确标为 P2 且 UI 不出现假可用按钮。
- [x] Hermes 未启动、模型缺失、plugin/tool 不可用、权限失败至少四类错误有可区分展示。
- [x] 页面刷新后仍以 Hermes session detail/resume 为会话真相。
- [x] mnote 不保存聊天消息真相,不保存 provider/API key,不创建第二套 profile/skill/plugin registry。
- [x] `git diff --check` 通过。
- [x] Rust 侧相关测试通过:`cargo test -p mnote-web hermes_client -- --nocapture``cargo test -p mnote-web hermes_tools_ -- --nocapture`
- [x] 正式 `3000` smoke 覆盖 session/run/tool/audit/mobile,且证据写回本文。
---
## 8. P2 后续项
以下能力不阻塞本稿 `done`,后续另开设计或 checklist 推进:
- retry / continue 的更完整 Hermes run lifecycle。
- session rename / delete / search。
- profile create / rename / import / export。
- skill 文件详情、pin、上传与 marketplace 发布。
- usage / logs / jobs / files / channels / terminal / group chat 等 Hermes 管理台页面。
不要先做 Hermes 全局设置页复刻。API key、provider、usage/logs/jobs/files/channels、profile 导入导出、skill marketplace 发布仍应留在 Hermes 自己的管理台。
---
## 9. 验收证据
- 设计参考已落到本文第 2 节的精确文件索引;人格页参考图为 `/mnt/Data1T/mnote/tmp/img_v3_0211m_b7390ad9-a45b-4d94-8126-b7c17f029feg.png`,技能页参考图为 `/mnt/Data1T/mnote/tmp/img_v3_0211m_0d6e7a60-8c21-4fd1-8cdf-d548dab7532g.png`
- 代码入口:`rust/crates/mnote-web/src/ssr/pages/layout.rs``rust/crates/mnote-web/src/ssr/styles.rs``rust/crates/mnote-web/src/routes/hermes_client.rs``rust/crates/mnote-web/src/routes/web_shell.rs``rust/crates/mnote-web/src/routes/mod.rs`
- 自动化:
- `cargo test -p mnote-web hermes_client -- --nocapture`
- `cargo test -p mnote-web hermes_tools -- --nocapture`
- `cargo test -p mnote-web web_shell -- --nocapture`
- `node scripts/task-hermes-page-ai-agent-skill-smoke.js`
- `node scripts/task-hermes-page-ai-smoke.js`
- `node scripts/task-hermes-page-ai-mobile-smoke.js`
- `MNOTE_EXPECTED_HERMES_SETTINGS_URL=http://127.0.0.1:8642/hermes/settings node scripts/task-hermes-page-ai-runtime-controls-smoke.js`
- 截图证据:`/mnt/Data1T/mnote/tmp/page-ai-mini-hermes-control-surface.png`
- 运行约束:上述 smoke 已在正式 `3000` mnote-web 入口执行;`3000` 已重启为当前最新二进制。