Vision & Multimodal
dsh-vision-paste
hel10o/dsh-vision-paste · ★ 0
DSH plugin: paste an image into the chat and it becomes a file path the model ha
README body is shown in Chinese.
Repository is no longer available (checked 2026-11-15). This entry is retained for tracking and cannot be installed.
README
Table of contents
DSH 插件:让「粘贴图片」变成「粘贴路径」,配合 vision-bridge-mcp 给纯文本模型加识图能力。
组成(一个包,两个半)
- host 半(lib/index.js):注册
POST /vision-paste路由,接收浏览器发来的图片字节,校验 PNG/JPEG/WebP/GIF,存入本地目录(默认~/.zcode/cli/image-cache,由os.homedir()推导,vision-bridge 的latest约定能直接找到),返回绝对路径。 - client 半(lib/client.js):捕获聊天框的图片粘贴事件,调上面的接口,把
识别这张图:<路径>插入输入框并弹缩略图提示。
配置(可选,写在插件行 config 里)
saveDir:图片保存目录,默认<家目录>/.zcode/cli/image-cachemaxBytes:单张上限,默认 26214400(25MB)
安装(DSH ≥ 0.1.0-rc.6)
dsh plugin --profile web add dsh-vision-paste
# 或本地源码: dsh plugin --profile web add file:D:/path/to/dsh-vision-paste
在 ~/.dsh/profiles/web/cordis.patch.yml 的 insert 列表加入:
- id: vision-paste
name: 'dsh-vision-paste'
config:
saveDir: 'C:/Users/你/.dsh/vision-bridge/image-cache' # 可选,默认 ~/.zcode/cli/image-cache
# 同时接入 vision-bridge MCP(API Key 自备):
- id: mcp-vision-bridge
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: vision-bridge
transport: stdio
command: node
args: ['--use-env-proxy', 'C:/path/to/vision-bridge-mcp/server.js']
cwd: 'C:/path/to/vision-bridge-mcp'
env:
VISION_API_KEY: '<你的Key>'
VISION_API_BASE: 'https://wawapii.com/v1' # 任意 OpenAI 兼容视觉端点
VISION_MODEL: 'gemini-3.5-flash'
VISION_API_STYLE: openai
# 代理按需删除
HTTPS_PROXY: 'http://127.0.0.1:7897'
HTTP_PROXY: 'http://127.0.0.1:7897'
NO_PROXY: 'localhost,127.0.0.1'
toolCallTimeoutMs: 90000
failOnStartupError: true
重启 dsh web 生效。聊天框里 Ctrl+V 粘贴截图 → 输入框自动出现文件路径 → 发送 → 模型调用 mcp__vision-bridge__ocr_image 识图。
更新
pnpm 会把本包复制进 ~/.dsh/profiles/web/node_modules/dsh-vision-paste(不是符号链接),修改源码后需重新同步:
dsh plugin --profile web add dsh-vision-paste
改的是 client 半(lib/client.js)时,同步后在浏览器按 Ctrl+F5 强制刷新即可;改的是 host 半(lib/index.js)时需重启 dsh web。
适用说明
- 适配 DSH
0.1.0-rc.6的 client 插件 API(ctx.effect),DSH 升级前先验证; - 主模型为纯文本模型(不声明图片输入)时收益最大;模型本身支持图片的部署可以跳过本插件直接传图。