Files
mnote/design/07-ai/process/7-38-page-ai-sidebar-runtime-owner-split-v1.md
T

33 lines
1.8 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.
# 7-38 Page AI sidebar runtime owner split v1
> 创建时间:2026-05-25
> 状态:`process`
> 来源:`design/03-rust-web/process/3-22-sidebar-tree-runtime-second-stage-split-v1.md` Batch A。
## 1. 背景
`rust/crates/mnote-web/browser/sidebar-tree-runtime.js` 中仍有大量 Page AI panel 代码:会话、消息、profile、skills、gateway health、ACP runtime、permission dialog、plan/status event、session search/resume 等。当前粗略搜索 `pageAi*` / `data-page-ai` / `PAGE_AI` 命中约 800 处。
这些代码不是 tree/filetree runtime 的长期 owner。继续把 Page AI 面板放在 `03-rust-web` 的 sidebar runtime 拆分里,会让 tree shell、local folder、AI session 三条边界继续混在一起。
## 2. Owner 判断
- owner`07-ai`
- 运行位置:当前仍可挂在 sidebar UI,但 runtime 模块应独立于 tree/filetree runtime。
- 目标模块候选:`rust/crates/mnote-web/browser/page-ai-panel-runtime.js`
- 主壳职责:只加载 asset、提供当前 document/workspace/root/bootstrap。
## 3. 后续执行建议
- [ ] 只读审计 Page AI panel 的状态入口:`pageUiState.pageAi*`、storage、session 列表、profile/skills、permission dialog。
- [ ] 新增 `page-ai-panel-runtime.js`,先迁纯数据 normalize / storage helper,不迁事件流和 DOM 面板。
- [ ] 第二刀迁 permission dialog DOM helper,保持 `/api/hermes/client/runs/*/resolve-permission` 业务调用不变。
- [ ] 第三刀迁 session list/search/resume DOM helper。
- [ ] 浏览器验证使用页面 AI / ACP smoke,而不是 tree/filetree smoke 替代。
## 4. 非目标
- 不在 03-rust-web 的 sidebar runtime 二阶段里继续扩大 Page AI 实现。
- 不改变 Hermes / Reasonix ACP runtime 协议。
- 不把 local-first agent 文件编辑链路改回粗粒度 `mnote.page.save`