feat: add evidence search and stabilize pdf previews

- add document evidence parsing/search/open routes, Hermes tool wiring, local index settings/status, and the document-evidence skill plus design notes
- fix PDF resource tabs by rendering PDFs inline with pdf.js canvases instead of iframe preview pages, release PDF documents on close, and document the fourth-PDF stall bug
- keep PDF preview at 2x rendering while removing the previous lazy-load/placeholder direction, and make dev:hot bind loopback defaults externally reachable

Verification:
- node --check rust/crates/mnote-web/browser/document-resource-tab-runtime.js
- node scripts/task-dev-hot-plan-test.js
- cargo test -p mnote-web --manifest-path rust/Cargo.toml pdf_preview_page_does_not_render_visible_toolbar
- cargo test -p mnote-web --manifest-path rust/Cargo.toml document_shell_returns_page_aggregate_snapshot
- cargo build -p mnote-web --manifest-path rust/Cargo.toml
- browser smoke: sequentially opened the four tea_seed_oil_cosmetic PDFs; fourth PDF rendered 15/15 canvases, iframeCount=0, browser errors=0
This commit is contained in:
lix-2026
2026-06-04 18:51:16 +08:00
parent 9f4b5c4d48
commit 627213dc01
51 changed files with 15960 additions and 1844 deletions
+16
View File
@@ -0,0 +1,16 @@
# MNote document evidence
使用场景:需要在本地工作区搜索 PDF、图片 OCR、Office 派生内容或 Markdown,并在回答中给出可点击回跳的原文证据。
优先使用工具:
- `mnote.evidence.search`:先按问题搜索证据,必须保留返回的 `quote``source``openAction`
- `mnote.evidence.read`:需要更多上下文时,按上一轮返回的 `source` locator 读回周边证据。
- `mnote.evidence.open`:需要给 UI 打开动作时,按 locator 归一化,不要自行拼接 URL。
回答要求:
- 关键事实必须带可回跳来源,至少包含文档名、资源名或页码、quote 摘要。
- 不要直接读取 `.mnote/index`、OCR sidecar 或 provider 原始响应来替代 evidence tool。
- 不要把 OCR 文本当成 owner Markdown 正文真相。
- 如果 evidence 结果没有 page、bbox 或 section,只说明定位能力降级,不伪造页码。