condaThinker/dsh-image-inline

DSH插件:show_image工具将图片内联渲染到网页聊天流中(QQ/微信风格)——消息中的路径文本,图片字节从不进入模型上下文。

Project Overview项目介绍

dsh-image-inline is a DSH plugin that lets the model render images inline in the Web UI chat stream. The host validates path, format, and size, stores the file as a content-addressed attachment, and returns a text-only result; the image payload travels via tool/result meta and is rendered client-side, keeping model context pure text. Nested run_code calls and legacy replays fall back to a path-addressed route. Caveat: per-image byte and pixel caps (default 25MiB/40MP) apply, oversized images leave orphan attachment objects, and the registry grows monotonically.

dsh-image-inline 是 DSH 插件,让模型通过 show_image 工具在 Web UI 对话流中主动渲染图片。host 校验路径、格式、尺寸,存为内容寻址附件并返回纯文本结果,图片经 tool/result meta 字段在客户端渲染卡片,模型上下文保持纯文本。嵌套 run_code 调用与旧回放会改走路径寻址路由以兼容。注意:单张图片有字节与像素上限(默认 25MiB/40MP),超限会留下无引用的孤儿附件对象,注册表会单调增长。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:condaThinker/dsh-image-inline

把 condaThinker/dsh-image-inline 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-image-inline

让 DeepSeek Harness (DSH) 的 Web UI 支持模型主动把一张图片渲染进对话流(QQ/微信聊天式:图片显示在会话里、可上翻、和对话同步)。

对话流消息内容里只保留路径文本,图片本身不进入模型上下文(模型上下文保持干净,纯文本模型路由不受影响)。

工作方式

模型调用新增的 show_image 工具(传入磁盘图片路径)时:

  1. host(dsh/index.js):校验路径/格式/大小 → 读取字节 → 通过附件服务 saveImage 存成内容寻址附件 → 返回纯文本结果(路径 + 元数据摘要)。图片的展示载荷(attachmentId/宽高/字节数)通过工具的 presentationMeta 放进 tool/result 事件的 meta 字段——不进模型上下文、不进会话日志的 image 块。
  2. client(dsh/client.js):注册 tool.call.toolview 键控槽位(key = show_image),在对话流中该工具调用的位置渲染图片卡片(复用官方 MessageImage 组件:缩略图、点击看原图、加载失败可重试)。图片 URL 走插件自己的内容寻址 HTTP 端点。
模型 → show_image(path) → 附件服务存图 → 纯文本结果(路径+摘要)
                                   │
                                   ├─ tool/result meta ─→ client toolview 渲染图片卡片
                                   └─ 注册表($DSH_HOME/plugins/dsh-image-inline/registry.json)
                                        └─ GET /plugin/show-image/<attachmentId> → 图片字节

嵌套调用(run_code 内 tools.show_image)与旧回放

模型把 show_image 写进 run_code 的 JS 里("Show key figures to user" 这类批量展示)时,调用变成嵌套 code-dispatch:宿主工具注册表只对顶层执行投影 presentationMeta,tool/code-dispatch 事件只携带文本结果、没有 attachmentId——客户端无法走内容寻址路由。

处理方式:client 在 meta 缺失时解析结果文本里的 <path>,改走路径寻址路由 GET /plugin/show-image-by-path?path=<绝对路径>(host 按扩展名/regular file/字节上限校验后回字节,路径来自模型已写入会话的文本,同 loopback 信任模型)。因此嵌套调用与旧 schema 回放都能渲染图片;文件不存在/格式不对时 onError 自动退回原文本结果。tool/result 事件带 meta 的顶层调用不受影响,仍走内容寻址路由。

为什么需要插件自己的 HTTP 端点?

DSH 内置的 conversation.resolveImage → session.attachment RPC 只服务"会话日志的 image 块里被引用的附件"(api-proxy 的 referencedImage 授权)。本插件的结果故意不包含 image 块(否则图片会进入模型上下文),因此附件永远不会被日志引用,必须由插件自己提供读取通道。

安全性:attachmentId 是 sha256:<hex> 内容哈希——内容寻址 capability URL,不知道图片内容就无法猜测;id 只出现在用户可读的会话日志与插件注册表中。服务默认绑定 loopback,与整个 Web UI 同一信任模型。

安装

npx -p @deepseek-ai/dsh dsh plugin --profile web add github:condaThinker/dsh-image-inline
sudo systemctl restart dsh   # 或按你的方式重启 web profile

本插件零构建(纯 JS),GitHub 直接分发源码,安装时无需执行任何构建脚本。

卸载:

npx -p @deepseek-ai/dsh dsh plugin --profile web remove dsh-image-inline
sudo systemctl restart dsh

配置

cordis.patch.yml 中的 config(可覆盖):

键 默认 说明
maxImageBytes 26214400 (25MiB) 单张图片编码字节上限(实际生效值 = min(本配置, 附件服务配置))
maxImagePixels 40000000 (40MP) 宽×高上限;0 关闭该检查
mediaTypes png/jpeg/webp/gif 接受的格式白名单

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-plugin-dir-tree 下一个 Next promptwall →