dsh-imgpt
DiscoveredDSH allows any model to send images: it automatically saves images dragged into the dialog box to the working path and pastes the path into the dialog box. DSH enables any model to send images: it automatically saves images dragged into the dialog box to the working path and pastes the path into the dialog box.
📎 imgpt — DSH 图片→路径 插件
English · 中文
Image to Path:让任何模型都能发送图片。粘贴/拖拽图片 → 自动保存到工作目录 → 输入框插入文件路径文本 → 纯文本发送,绕开非视觉模型拦截。
imgpt(image-to-path)是 DeepSeek Harness(DSH)Web GUI 的插件。DSH 底层在发送 type: 'image' 内容块时会检查当前模型的 inputModalities——DeepSeek 等非视觉模型被声明为仅支持文本,消息一旦含图片就会被拒绝(MODEL_DOES_NOT_SUPPORT_IMAGES,提示"当前模型不支持图片")。imgpt 不改动任何底层代码,而是改变图片的传递形态:把图片落盘成文件,消息里只带文件路径。
✨ 功能特性
| 功能 | 说明 |
|---|---|
| 🖼️ 粘贴图片 | 输入框 Ctrl+V 粘贴截图/图片 → 自动保存 + 插入路径 |
| 🎯 拖拽图片 | 拖入图片 → 自动保存 + 插入路径(无原生遮罩残留) |
| 📎 启用开关 | 输入框工具行开关,随时切换「路径转换」与「原生图片通道」 |
| 🗑️ 清除缓存 | 双击确认后清空 .dsh-images,徽标显示清除数量 |
| 📋 状态徽标 | 输入框下方实时显示:启用状态 / 保存进度 / 失败原因 / 清除结果 |
| 👁️ 视觉看图 | 配合视觉模型辅助,发送路径 + "识别这张图片"即可读图 |
🎬 效果示意
粘贴/拖拽图片 ──► capture 阶段拦截 ──► 保存到 工作目录\.dsh-images\ ──► 输入框插入:
D:\Work\xx\.dsh-images\m5x2k9a-截图.png
──► 正常发送(任何模型)
🔧 工作原理
Client 半体(浏览器,client/imgpt-web)
- 在
document捕获阶段监听paste/dragenter/dragover/drop - 检测到图片后
preventDefault+stopPropagation(拦截 DSH 原生图片通道,同时抑制原生拖拽遮罩) - 用
FileReader把图片读为 base64,fetchPOST 到 Host 端点 - 拿到返回的文件路径后,以合成
paste事件把路径文本插入输入框(复用 InputBar 原生文本插入链路)
Host 半体(服务端,plugins/imgpt-host)
- 在 DSH
webServer注册两个 HTTP 端点:POST /imgpt-save— 校验会话 → 用node:fs把 base64 解码写为二进制图片到.dsh-imagesPOST /imgpt-clear— 递归统计并删除.dsh-images
- 工作目录取自会话头部的
cwd
为什么这样设计:常驻插件无法使用动态插件专用的 harness.handle/host.call RPC,且 fs 服务的沙盒策略对非会话上下文会拒绝写入——因此采用「Client fetch + Host webServer 路由 + node:fs 直接落盘」,最简且随 DSH 启动自动加载。
📦 仓库结构
imgpt/
├── README.md # 本文件
├── LICENSE # MIT
├── .gitignore
├── package.json # 仓库元信息
├── plugins/
│ └── imgpt-host/
│ └── index.js # Host 半体(webServer HTTP 端点 + node:fs 落盘)
└── client/
└── imgpt-web/
├── package.json # Client 包声明(dsh.client + exports)
└── lib/
├── index.js # Node 半体(空插件,满足 Loader 装载)
└── client.js # 浏览器 bundle(拦截/上传/插入路径/开关/清除)
🚀 安装到 DSH
需要把仓库文件放到 DSH profile 目录(默认
~/.dsh/profiles/web/,即C:\Users\<你>\.dsh\profiles\web\)。
-
复制 Host 半体
Copy-Item -Recurse plugins\imgpt-host "C:\Users\<你>\.dsh\profiles\web\plugins\imgpt-host" -
复制 Client 包
Copy-Item -Recurse client\imgpt-web "C:\Users\<你>\.dsh\profiles\web\node_modules\imgpt-web" -
注册组合补丁:在
C:\Users\<你>\.dsh\profiles\web\cordis.patch.yml的insert列表中追加两行:- insert: # ... 已有条目 - id: imgpt-host name: './plugins/imgpt-host/index.js' - id: imgpt-web name: 'imgpt-web' -
重启 DSH。输入框工具行出现 📎 开关 + 🗑️ 清除、下方出现状态徽标即安装成功。
⚠️ 不要在该 profile 目录下运行
pnpm install,会清掉手动放置的imgpt-web包。
🎯 使用方式
- 在输入框
Ctrl+V粘贴截图 或 拖入图片文件 - 图片自动保存到
工作目录\.dsh-images\,输入框自动插入绝对路径文本 - 直接发送(任何模型都能收到);需要看图时在路径后加"识别这张图片"
- 📎 开关控制是否启用本功能;🗑️ 双击确认清除缓存
🛠️ 技术要点
ctx.effect(cb)会立即执行cb并把返回值当清理函数——清理必须写成ctx.effect(() => () => {...}),否则监听器注册后立即被移除。- 原生 InputBar 的拖拽遮罩清理依赖
drop/dragend,而正常 drop 后浏览器不再发dragend——需在 drop 后合成dragend事件清理。 - 本插件不注册任何 dsh-tools 工具,只注册 webServer 路由与客户端槽位,不存在工具输出声明类兼容问题。
📄 许可证
Comments
Loading…
Similar plugins
by loudMore
DSH 插件:图片与文件直达纯文本模型——图片保留原生附件体验,PDF/Office/压缩包/视频/音频显示为附件栏方块,点击发送时自动转为工作区路径,配合 dsh-vision-toolkit 粘贴即看图。A DSH plugin that delivers images AND files to text-only models as workspace paths: images keep
★ 11
MIT
JavaScript
Sep 18, 2026
dsh plugin --profile web add @dsh-external/dsh-drop-to-pathby kbpoyo
DSH 插件:让纯文本模型也能看图。Web 端直接粘贴图片即可发送,无需指定图片路径;模型自主调用视觉技能查看,多模态模型原生直通,零skill绑定。
★ 5
↓ 34/wk
MIT
JavaScript
Aug 14, 2026
dsh plugin --profile web add @kbpoyo/dsh-image-bridgeby netori
DSH image-generation plugin with native support for zhenzhen-image style async task gateways (submit + poll), including multi-reference image-to-image. Fork of @dickpy/dsh-imagegen.
★ 0
Apache-2.0
JavaScript
Sep 11, 2026
dsh plugin --profile web add dsh-imagegen-zhenzhenby Practice019
DSH 插件:通过本地 Quicker 转发(doubao web2api) 提供 `doubao_ask` 动态搜索/图片生成/多模态识图工具, 并支持**粘贴图片 → 本地路径**(paste-to-path)。
★ 0
MIT
JavaScript
Aug 28, 2026
dsh plugin --profile web add doubao-dsh-pluginby condaThinker
DSH plugin: show_image tool that renders an image inline into the web chat flow (QQ/WeChat style) — path text in the message, image bytes never enter model context.
★ 2
JavaScript
Aug 30, 2026
dsh plugin --profile web add dsh-image-inlineby wszhoho
File attachments for the dsh web GUI: toolbar upload button (multi-select) plus drag-and-paste add files to the chat input; images follow the native draft-image flow, documents are saved into the sess
★ 1
↓ 547/wk
MIT
JavaScript
Sep 29, 2026
dsh plugin --profile web add @wszhoho/dsh-file-attachment