收口 MNote P0 P1 P2 审查尾项
- 归档 OnlyOffice live bridge、Page AI、mindmap、design governance 与相关 bug 条目 - 补齐 MinerU OCR 后端 runtime 合同与 smoke/test 基线 - 收口 ChatOnly/Doubao、ObjectIdentity、Page Aggregate compat 与 runtime owner 文档口径 验证: - cargo test --manifest-path rust/Cargo.toml -p mnote-web local_ocr -- --test-threads=1 - cargo test --manifest-path rust/Cargo.toml -p mnote-web onlyoffice_bridge -- --test-threads=1 - git diff --check - git diff --cached --check - codegraph index . --force && codegraph status . - codegraph sync . && codegraph status .
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# MNote mindmap editing
|
||||
|
||||
Use this skill only when the user asks to read, summarize, update, or create an MNote mindmap resource.
|
||||
|
||||
Typical triggers:
|
||||
- The user mentions 思维导图, 脑图, mindmap, KMind, or `.mindmap.json`.
|
||||
- The current Page AI target is a mindmap resource tab.
|
||||
- The current page contains a mindmap embed and the task is about that embed.
|
||||
- The user asks to turn a PDF, Office document, Markdown page, or pasted material into a mindmap.
|
||||
|
||||
Rules:
|
||||
- First call `mnote.context.snapshot` or `mnote.context.resolve_target` when target metadata is needed.
|
||||
- Prefer the current mindmap resource tab over page embeds when both are present.
|
||||
- For existing mindmaps, call `mnote.mindmap.fetch` before proposing or applying changes.
|
||||
- For new mindmaps from PDF or document summaries, convert the source material into a concise hierarchical outline, then call `mnote.mindmap.create_from_outline`.
|
||||
- Do not write a naked simple-mind-map tree as the final file. MNote mindmap files use an envelope with `data` as the root tree and `view` as runtime view state.
|
||||
- Keep the root node uid as `root` for new maps unless MNote returns a different root.
|
||||
- Let MNote generate child node uid values; do not invent duplicate ids.
|
||||
- Before writing, confirm the run has `read_write` permission and the target resource is inside `allowedResourceIds`.
|
||||
- After writing or creating a mindmap, read it back with `mnote.mindmap.fetch` and report the changed `.mindmap.json` path.
|
||||
- If authorization is missing, ask the user to grant access instead of guessing a path.
|
||||
|
||||
Current apply_ops contract:
|
||||
- Supported operations are `updateText` / `updateNode`, `insertChild` / `addChild`, and `deleteNode`.
|
||||
- `updateText` / `updateNode` require `nodeId` (or `node_id` / `id`) and `text` (or `title`).
|
||||
- `insertChild` / `addChild` require `parentId` (or `parent_id` / `nodeId`) and a child node payload.
|
||||
- `deleteNode` requires `nodeId` (or `node_id` / `id`) and must never target the root node.
|
||||
- Unknown operations are rejected; do not assume extra edit verbs exist.
|
||||
- Prefer small, reviewable edits. Keep node text concise and split long prose into child nodes.
|
||||
- Long text should be summarized into short phrases or child nodes rather than embedded as a single paragraph.
|
||||
- Respect `dryRun` and revision checks when the caller provides them.
|
||||
|
||||
Mindmap outline format:
|
||||
- Use one central root topic as the `title`; it should name the subject, not explain it in a paragraph.
|
||||
- Use first-level children for the major categories or sections radiating from the root.
|
||||
- Use concise keywords or short phrases for node text. Avoid long paragraphs, full prose summaries, and multiple sentences inside one node.
|
||||
- Put one idea in each node. Split causes, decisions, examples, and evidence into child nodes instead of joining them with punctuation.
|
||||
- Keep each level scannable: prefer 3-8 sibling branches unless the source structure requires more.
|
||||
- Preserve hierarchy with `children`; do not simulate structure by embedding Markdown lists or newline-separated text in a node.
|
||||
- Keep citations, page numbers, and source metadata in `sourceRefs` or nearby metadata when possible, rather than cramming them into visible node text.
|
||||
|
||||
PDF or document to mindmap workflow:
|
||||
1. Identify the source resource and target page.
|
||||
2. Extract or receive a title plus outline from the source material.
|
||||
3. Keep the outline small enough to be useful: preserve chapters, decisions, key concepts, and relationships; remove repeated prose.
|
||||
4. Call `mnote.mindmap.create_from_outline` with `title`, `outline`, `sourceRefs`, and the target resource path when provided.
|
||||
5. Verify the created resource by fetching it and checking the root title and first-level branches.
|
||||
@@ -0,0 +1,68 @@
|
||||
# MNote ONLYOFFICE live bridge
|
||||
|
||||
用于操作当前已经打开的 ONLYOFFICE 编辑器会话。
|
||||
|
||||
## 适用范围
|
||||
|
||||
- 仅针对当前浏览器里打开的 ONLYOFFICE 文档
|
||||
- 支持 Word、Excel、PPT 的基础读写
|
||||
- 不用于离线批量修改文件
|
||||
|
||||
## 可用工具
|
||||
|
||||
- `mnote.onlyoffice.session.current`
|
||||
- `mnote.onlyoffice.capabilities`
|
||||
- `mnote.onlyoffice.selection.get`
|
||||
- `mnote.onlyoffice.document.insert_text`
|
||||
- `mnote.onlyoffice.document.replace_selection`
|
||||
- `mnote.onlyoffice.document.insert_html`
|
||||
- `mnote.onlyoffice.document.export`
|
||||
- `mnote.onlyoffice.document.search_replace`
|
||||
- `mnote.onlyoffice.document.insert_table`
|
||||
- `mnote.onlyoffice.document.get_comments`
|
||||
- `mnote.onlyoffice.document.add_comment`
|
||||
- `mnote.onlyoffice.sheet.get_sheets`
|
||||
- `mnote.onlyoffice.sheet.add_sheet`
|
||||
- `mnote.onlyoffice.sheet.rename_sheet`
|
||||
- `mnote.onlyoffice.sheet.get_range`
|
||||
- `mnote.onlyoffice.sheet.get_range_values`
|
||||
- `mnote.onlyoffice.sheet.get_values`
|
||||
- `mnote.onlyoffice.sheet.set_value`
|
||||
- `mnote.onlyoffice.sheet.set_formula`
|
||||
- `mnote.onlyoffice.sheet.batch_set_values`
|
||||
- `mnote.onlyoffice.sheet.set_range_values`
|
||||
- `mnote.onlyoffice.sheet.format_range`
|
||||
- `mnote.onlyoffice.sheet.set_dimensions`
|
||||
- `mnote.onlyoffice.sheet.sort_range`
|
||||
- `mnote.onlyoffice.sheet.add_chart`
|
||||
- `mnote.onlyoffice.presentation.get_slides`
|
||||
- `mnote.onlyoffice.presentation.get_slide_texts`
|
||||
- `mnote.onlyoffice.presentation.get_shapes`
|
||||
- `mnote.onlyoffice.presentation.add_text_slide`
|
||||
- `mnote.onlyoffice.presentation.replace_text`
|
||||
- `mnote.onlyoffice.presentation.set_shape_text`
|
||||
- `mnote.onlyoffice.presentation.delete_slide`
|
||||
- `mnote.onlyoffice.presentation.add_table`
|
||||
- `mnote.onlyoffice.presentation.clear_slide`
|
||||
- `mnote.onlyoffice.presentation.add_shape`
|
||||
|
||||
## 使用原则
|
||||
|
||||
- 先调用 `mnote.onlyoffice.session.current` 确认当前会话存在,并记录 `sessionId` / `documentId` / `assetId` / `fileType`
|
||||
- 多个 ONLYOFFICE 标签页同时打开时,写操作必须显式传 `onlyofficeSessionId`
|
||||
- 写入前优先做最小范围修改,并先用 `dryRun` 检查计划
|
||||
- 读取大块表格时优先使用 `sheet.get_values`,写入多格时优先使用 `sheet.batch_set_values`
|
||||
- 需要按用户可见坐标定位表格时优先使用 A1 地址工具:`sheet.get_range_values` / `sheet.set_range_values`
|
||||
- `sheet.set_range_values` 只写入 A1 区域与二维 `values` 的交集,调用前应确认尺寸
|
||||
- 表格样式只做显式小范围:`sheet.format_range` 支持字体粗斜体、颜色、对齐和数字格式;`sheet.set_dimensions` 支持零基行高/列宽
|
||||
- Excel 排序使用 `sheet.sort_range`,先确认 A1 range,`keyColumn` 是 range 内从 1 开始的列号;图表使用 `sheet.add_chart`,默认柱状图
|
||||
- `document.export` 仅支持 `markdown` 和 `html`
|
||||
- Word 精确文本替换优先使用 `document.search_replace`
|
||||
- Word 插入结构化表格使用 `document.insert_table`;评论读取/添加使用 `document.get_comments` / `document.add_comment`
|
||||
- `document.add_comment` 默认给当前选区加评论;没有可靠选区时显式传 `target: "document_start"`
|
||||
- PPT 文本读取优先使用 `presentation.get_slide_texts`;`presentation.replace_text` 只处理文本框纯文本,命中文本框会按纯文本段落重建
|
||||
- PPT 精确改某个文本框时先调用 `presentation.get_shapes` 获取 `shapeIndex` / `shapeId`,再调用 `presentation.set_shape_text`
|
||||
- 删除 PPT 幻灯片前必须先调用 `presentation.get_slides` 或 `presentation.get_slide_texts` 确认 `slideIndex`
|
||||
- PPT 插入结构化表格使用 `presentation.add_table`,默认居中插入;需要精确位置时传 `xMm` / `yMm` / `widthMm` / `heightMm`
|
||||
- PPT 清空指定页对象使用 `presentation.clear_slide`,调用前必须确认目标 `slideIndex`;添加基础图形使用 `presentation.add_shape`
|
||||
- 需要大范围离线处理时,改用 `officecli`
|
||||
Reference in New Issue
Block a user