dsh-omni-vision
A canvas the agent draws on and then sees: eyes_render draws text/shapes in the Web GUI, stores the PNG locally, and hands the result back to the model. Windows-only: eyes_ocr reads text via the built-in Windows OCR engine (Windows.Media.Ocr).
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Renji004/dsh-omni-vision说明文档
阅读完整 README ↗使用
eyes_render —— 画
参数:width/height(64–2048)、background(CSS 颜色)、title、description、commands(数组)、mermaid(字符串,可选)、ocr(布尔,渲染后顺带本地 OCR,默认 false)。
Mermaid 连线图:传 mermaid 参数(Mermaid 源码字符串,如 graph LR\n A[start] --> B[process] --> C[end])即可让浏览器渲染出流程图/时序图等,无需手工计算坐标;mermaid 存在时优先于 commands。支持 flowchart / sequenceDiagram / classDiagram / stateDiagram 等 Mermaid 语法。渲染结果走同一套 PNG 存档(一式两份)+ 可选 OCR(可把节点文字读回给模型)。按需加载(本插件所有下载均按需,见"下载策略"):只有实际传 mermaid 参数渲染时才加载,优先用本地副本(在插件目录 npm i mermaid@11 后全离线可用),缺失时才回退 CDN(首次需浏览器联网,成功后浏览器缓存)。加载或语法失败时工具返回明确错误。
落盘 PNG 的像素尺寸与 width/height 完全一致(不做设备像素比缩放),命令坐标与 PNG 像素一一对应——eyes_analyze 看到的网格坐标、contentBox 都与命令里的 x/y 直接可比。
text 的 y 是首行字形顶部的坐标:绘制时用 measureText 量出字形顶部相对字母基线的距离(actualBoundingBoxAscent),在 y + ascent 处画基线,字形顶精确落在 y 上(跨引擎一致,不随字体/字号/浏览器解释差异偏下),中文、拉丁文混排时顶部对齐一致。
PNG 一式两份:renders/eyes-.png(ocr:true 且读回成功后自动删除,读完即焚)+ pics/eyes-.png(永久保留,结果里的 keptPath)。
| op | 字段 |
|---|---|
text | x,y,text,size,font,weight,color,align,maxWidth |
line | x1,y1,x2,y2,color,width |
rect | x,y,w,h,radius,fill,stroke,strokeWidth |
circle | cx,cy,r,fill,stroke,strokeWidth |
ellipse | cx,cy,rx,ry,fill,stroke,strokeWidth |
clear | color(清屏底色) |
eyes_ocr —— 读文字
参数:path(PNG 绝对路径,如 eyes_render 返回的 path)。返回 ok、text(全文)、lines(逐行)、language,以及 fileDeleted(renders/ 下的源文件读取后自动删除)。
eyes_analyze —— 看图形
参数:path(PNG 绝对路径)、grid(采样网格 N×N,2–32,默认 8)、maxColors(主色数量,1–16,默认 6)。返回 gridCells(网格平均色)、dominantColors(主色及占比)、contentBox(内容包围盒),以及 fileDeleted(同上,读完即焚)。
eyes_paste —— 收图
参数:hint(可选,显示在粘贴卡片上的说明)。调用后 GUI 出现粘贴卡片,用户选择一张图片复制后ctrl+v或直接拖到浏览器界面(批量读取时,可把多张图片副本直接放入 renders/ 文件夹并告诉所用AI),浏览器捕获并保存为 /renders/paste-.png(读完即焚,无 pics/ 永久副本读完即焚;未读取的文件会留在 renders/ 中,可手动清理)。返回 path、width、height、bytes、fileSaved、fileError。
示例
用 eyes_paste 让用户粘贴一张截图,然后用 eyes_ocr 读出里面的文字并复述给我
用 eyes_render 画一张 800x400 的画布,写上文字"Hello 世界 123",设 ocr:true,然后告诉我你看到了什么
用 eyes_render 画一张 900x500 的 Mermaid 流程图:
graph TD\n A[登录] --> B{校验}\n B -->|成功| C[进入主页]\n B -->|失败| D[提示错误],设 ocr:true 读回节点文字
eyes_ocr 读取 \renders\eyes-xxx.png,把识别出的文字逐行复述给我
eyes_analyze 分析 \renders\eyes-xxx.png,网格 12,然后描述画面布局和主要颜色