dsh-image-gallery
其他 活跃维护

dsh-image-gallery

statem-li/dsh-image-gallery

支持将会话中generate_image生图工具的输出渲染为并排缩略图画廊,点击可查看大图、右键可直接保存图片,无需修改DSH源码即可接入,配置简单无侵入。

0
Stars 标星
0
Forks 分支
0
Watchers 关注
0
Open Issues
TypeScript
主要语言
None
开源协议
33 KB
仓库大小
1 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:statem-li/dsh-image-gallery
git clone https://github.com/statem-li/dsh-image-gallery.git
git clone git@github.com:statem-li/dsh-image-gallery.git
README.md main

dsh-image-gallery — 生图画廊插件

把会话里 generate_image 工具的成功结果渲染为对话内并排缩略图画廊:

  • 📷 生图结果直接以卡片形式显示在消息流中(缩略图并排)
  • 🔍 单击缩略图 → 原图 Lightbox 放大(Esc / 点击遮罩关闭)
  • 💾 Lightbox 右上角「保存图片」按钮:优先弹系统「另存为」对话框(位置与文件名自选),不可用时自动降级为普通下载
  • ⏳ 链接失效(生图链接仅 24 小时有效)时显示占位提示,不裂图
  • 🖼️ 配合 generate_image 的 count 参数,一次生成多张并排展示

原理

监听会话事件流中的 tool/call(name = generate_image)与 tool/result
(文本含 imageUrl),通过 DSH 客户端插件机制注册一个 conversation.chat.node
渲染器,把同一调用的成功图片发布为 generated-images 节点。纯插件实现,
不改动 DSH 源码。

安装

官方一键安装(推荐)

在 DSH 终端执行(仓库已打 dsh-plugin 主题,可被 DSH 插件目录 发现):

dsh plugin add github:statem-li/dsh-image-gallery

安装后重启 dsh web 生效。如需锁定版本:dsh plugin add github:statem-li/dsh-image-gallery#<commit-sha>。


以下是手动安装方式(备用):

  1. 把本目录链接到 DSH web profile:

    New-Item -ItemType Junction -Path "$env:USERPROFILE\.dsh\profiles\web\node_modules\@dsh-external\dsh-image-gallery" -Target (Get-Location)
  2. 在 %USERPROFILE%\.dsh\profiles\web\cordis.patch.yml 追加:

    - insert:
       - id: dsh-image-gallery
         name: "@dsh-external/dsh-image-gallery"
  3. 重启 DSH web(或等 patch 热装配)后刷新页面。

构建

依赖 DSH 源码检出(DSH_CHECKOUT 指向 deepseek-harness 检出目录):

DSH_CHECKOUT=D:/AI/deepseek-harness bash scripts/build.sh   # host 半身 tsc
tsdown                                                  # client bundle → lib/client.js

依赖

  • DSH client 插件机制:@deepseek-ai/dsh-client-runtime、@deepseek-ai/dsh-client-ui-slots、@deepseek-ai/dsh-client-ui-conversation
  • 生图工具:generate_image(dsh-vision-helper 提供,支持 count 一次多张)

许可

BSD-3-Clause