Skip to content

feat: Tevarn 内置 VSD/VSDX 查看器 - #2

Open
wu1w wants to merge 1 commit into
mainfrom
cursor/vsd-viewer-e786
Open

feat: Tevarn 内置 VSD/VSDX 查看器#2
wu1w wants to merge 1 commit into
mainfrom
cursor/vsd-viewer-e786

Conversation

@wu1w

@wu1w wu1w commented Aug 13, 2026

Copy link
Copy Markdown
Owner

在 Tevarn 工作台里直接查看 Microsoft Visio 图纸,不必再装单独的 Visio 客户端。

做什么

  • 聊天产物预览支持 .vsd / .vsdx / .vsdm / .vdx
  • doc_read 按页提取形状文字,Agent 可以读流程图
  • VSDX(ZIP/XML)在进程内渲染成 SVG,无额外依赖
  • 旧版二进制 .vsd:若本机有 LibreOffice Draw 或 vsd2svg 则转 PDF/SVG;否则提取可打印字符串,并提示安装命令

怎么用

  1. 把 Visio 文件放进工作区(或在对话里点文件预览)
  2. 问「打开 xxx.vsd / 看看这张流程图」
  3. 预览面板会画出页面;也可以继续「系统打开」

旧版 .vsd 要图形预览时,在 Windows 上安装 LibreOffice:

winget install --id TheDocumentFoundation.LibreOffice -e --accept-package-agreements --accept-source-agreements

测试

  • backend/tests/test_visio_preview.py:VSDX SVG 渲染、VDX、无转换器时的 .vsd 回退、doc_read
  • test_tool_policy.py::test_visio_keyword_selects_office_pack
  • frontend artifacts / file-preview logic smoke

API:GET /api/files/visio-preview?path=...as=pdf 在 LibreOffice 转换成功时返回 PDF)

Open in Web Open in Cursor 

Add an in-app Visio viewer so Tevarn can open VSD/VSDX without a
separate desktop app. VSDX/VSDM/VDX render to SVG from the XML
package; binary .vsd uses LibreOffice or libvisio when present,
otherwise extracted text plus an install hint.

doc_read understands visio, chat artifacts treat .vsd/.vsdx as
previewable, and office-pack routing matches visio/vsd keywords.

Co-authored-by: wu1w <wu1w@users.noreply.github.com>
@wu1w
wu1w marked this pull request as ready for review August 13, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants