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.
3.2 KiB
3.2 KiB
[recycle] 7-32 ACP tool locations 与打开动作 checklist v1
状态:done
归档说明(2026-05-21):ACP tool locations 解析、SSE 桥接与前端打开动作已完成;浏览器 smoke 可作为后续补强。
Owner:ACP tool event data + Page AI open action
参考:
reference-code/hermes-vscode-main/src/protocol.ts、src/chatPanel.ts
目标
保留 ACP tool_call.locations[],在 Page AI tool card 中展示位置,并对 read/edit 完成事件提供打开动作。默认打开到 MNote 主编辑器资源 tab / 当前工作区 tab,不默认新浏览器窗口。
允许修改范围
rust/crates/mnote-web/src/acp_types.rsrust/crates/mnote-web/src/acp_session_manager.rsrust/crates/mnote-web/src/acp_bridge.rsrust/crates/mnote-web/src/ssr/pages/layout.rs- 相关 Rust 测试和必要 smoke 脚本
禁止事项
- 不重写资源 tab registry。
- 不新增与 Sidex workbench checklist 冲突的 editor group 模型。
- 不默认
window.open。 - 不绕过 existing allowed root / local workspace access。
Checklist
SessionUpdate::ToolCall解析locations: [{ path }]。AcpSessionEvent::ToolCall携带 locations,并通过 SSEtool.started发送。tool.completed能保留或关联此前相同toolCallId的 locations/kind/title。- Page AI tool card 展示 location 摘要。
- 对 read/edit completed tool card 增加“打开”动作,优先复用已有 resource tab / file open resolver。
- 补测试覆盖 locations parse、SSE 数据、前端字符串断言或 smoke。
- 更新本文件“执行记录”。
验收命令
cd /mnt/Data1T/mnote/rust && cargo test -p mnote-web acp_tool -- --test-threads=1
cd /mnt/Data1T/mnote/rust && cargo test -p mnote-web page_ai_uses_backend_acp_session_runtime_store -- --test-threads=1
执行记录
- 2026-05-20 Reasonix Code 实现:
acp_types.rs: 新增ToolLocation结构体(含path字段),SessionUpdate::ToolCall新增locations: Vec<ToolLocation>(含反序列化支持)。acp_session_manager.rs:AcpSessionEvent::ToolCall新增locations: Vec<String>,session_update_to_event中映射 locations。acp_bridge.rs: SSEtool.started事件数据包含locations数组,桥测试中验证。layout.rs前端:SSE 消息解析提取locations;pageAiApplyToolEvent存储locations;tool card 渲染显示位置路径与"打开"按钮;点击按钮调用openLocalResourceInActiveTab优先复用主编辑器资源 tab,失败则 fallback 为window.open。- 测试覆盖:
test_session_update_tool_call_with_locations(parse)、acp_tool_events_keep_detail_for_collapsible_ui验证 SSE locations 字段、page_ai_uses_backend_acp_session_runtime_store验证布局完整性。 - Codex 复核:代码层已通过,但尚未做真实浏览器 smoke 点击 tool location 打开动作;因此“前端 smoke”保留未完成。
- 验收通过:
cargo test -p mnote-web acp_bridge -- --test-threads=1、cargo test -p mnote-web page_ai_uses_backend_acp_session_runtime_store -- --test-threads=1、cargo test -p mnote-web acp -- --test-threads=1。