dsh-image-preview
Local image hosting for DeepSeek Harness: serves images from a preview directory over the web profile's own HTTP server so chat messages can render them inline, plus a preview_image tool that stages an existing local image and returns its URL. 适合需要让 AI 将生成的本地图片快速生成 URL 并直接在聊天框中展示的用户。
같은 패키지 이름의 다른 저장소
설치
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:ReiRui/dsh-image-preview配置
在 $DSH_HOME/profiles/web/cordis.patch.yml 里覆盖该行的 config:
- id: image-preview
config:
root: !!js dshHomePath('preview') # 预览目录,可改成项目目录
prefix: /preview # URL 前缀
使用
- 让 AI 生成/下载一张图(截图、渲染预览等)到本地;
- AI 调用
preview_image工具传入绝对路径; - 工具返回
http://127.0.0.1:3080/preview/,AI 在回复里贴该链接; - 页面内联显示图片。
也可以直接访问 http://127.0.0.1:3080/preview/ 查看。
AI 使用提示(给 agent 的约定)
- 必须调用
preview_image工具,禁止手动把文件复制进~/.dsh/preview:新会话的文件沙箱默认是workspace-write,AI 的文件工具写不进预览目录(会报"目录出错")。工具内部不受该沙箱限制。 - 工具返回的
url字段是唯一有效的 URL,AI 应原样内嵌(),不要自行拼接或猜文件名。 - 通过工具复制的文件名为
8位随机-原名(如7faf2295-theme-gallery.png),这是与手动复制区分的特征。 - 工具返回
ok:false时,把error原样报告给用户(文件不存在 / 类型不支持等)。