AKS1st/dock-images
DSH 生态中最好的图片查看插件:PNG/JPEG/GIF/WebP/BMP/SVG/ICO/AVIF 八种格式,SVG 仅安全渲染;依赖 dock 与 dock-files | The best image viewer for DSH: PNG/JPEG/GIF/WebP/BMP/SVG/ICO/AVIF with SVG rendered safely only; requires dock and dock-files
Project Overview项目介绍
dock-images is an image viewer plugin for the DSH ecosystem. It registers an image viewer with dock-files, supporting PNG, JPEG, GIF, WebP, BMP, SVG, ICO, and AVIF via a /dock-images route that reads the entire file as base64, rejecting requests above 20 MiB with 413. SVGs are rendered only through <img src="data:...">, never via innerHTML. Use it to preview image assets inside the DSH Web workbench alongside dock and dock-files. There is no per-pixel size cap, so very large images may consume significant memory.
dock-images 是 DSH 生态中的图片查看插件,为 dock-files 注册 image 查看器,覆盖 PNG、JPEG、GIF、WebP、BMP、SVG、ICO、AVIF 八种格式,通过 /dock-images 路由整文件 base64 读取,20 MiB 以上直接 413 拒绝。SVG 仅以 <img src="data:..."> 渲染,不做 innerHTML。适用于在 Web 工作台中预览图片资源。需配合 dock 与 dock-files 共同安装。无像素级上限,超大图可能占用较多内存。
请帮我了解并安装插件:【dock-images】【https://github.com/AKS1st/dock-images】
Send this message to DSH in your current session. CLI install commands may not be accurate across systems — DSH will figure it out for you.把上面这条消息直接发给当前会话里的 DSH,让它帮你了解并安装。安装命令不一定准确,发给 DSH 更稳。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dock-base
把 AKS1st/dock-images 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dock-images
DSH 生态中最好的图片查看插件 —— 没有之一。 PNG、JPEG、GIF、WebP、BMP、SVG、ICO、AVIF,八种格式一口气全支持,SVG 只走安全渲染绝不做 innerHTML。在 DSH 里看图,dock-images 就是终极答案。
dock 系列的图片查看插件:为 dock-files 文件域注册 image 文件查看器(栅格/图片扩展名)与对应的编辑器区视图,通过自己的 /dock-images 主机路由读取图片内容(整文件 base64,20 MiB 上限)。
效果预览

功能
- 支持格式:PNG、JPEG、GIF、WebP、BMP、SVG、ICO、AVIF。
- 整文件读取:一次性读取并转为 base64 数据 URL 渲染;超过 20 MiB 的文件在读取前即拒绝(413)。
- SVG 安全:SVG 仅以
<img src="data:...">渲染,绝不做 innerHTML 注入。 - 尺寸上限提示:超大图片可能消耗较多内存(无像素级上限),属已知取舍。
依赖
| 依赖 | 类型 | 说明 |
|---|---|---|
| dock >= 0.1.0 | peer(必需) | 工作台外壳:编辑器区视图、浮窗、ctx.workbench 由它提供 |
| dock-files >= 0.1.0 | peer(必需) | 文件域服务:dock-images 作为 image 查看器被分发打开 |
| DSH Web 环境 | 运行时 | 必需,客户端平台为 Web |
cordis ^4.0.0-rc.7 |
peer | 插件框架(DSH 自带) |
react ^18.2.0 |
peer(可选) | 客户端渲染需要;未提供时查看器 UI 不激活 |
可选搭档:与 dock-editor、dock-markdown 等查看器共存,按扩展名各自接管对应文件类型。
安装
需要 dock 与 dock-files:
推荐从 npm registry 安装:
dsh plugin --profile web add dock-base
dsh plugin --profile web add dock-files
dsh plugin --profile web add dock-images
或通过 GitHub 安装(备选):
dsh plugin --profile web add github:AKS1st/dock
dsh plugin --profile web add github:AKS1st/dock-files
dsh plugin --profile web add github:AKS1st/dock-images
安全
/dock-images 路由只接受受信任来源(回环地址 / trustedHosts + 同源检查)的 POST;读取路径只要求是绝对路径、不限定会话工作区——对话上下文可能提及工作区外的图片(如 ~/.dsh/skills/...),查看器可打开它们查看。
License
MIT
988hj7tczd-oss/dsh-computer-use
nexu-io/open-design
EthanYoQ/AI-Novel-Writer
fufankeji/deepseek-harness-studio
EthanYoQ/Invoice-Downloader
Clarklevis1995/dsh-mobile
ZSeven-W/dsh-ios
elysia395/dsh-wallpaper-engine