dsh-add-image-button
Persistent "Add image" button in the composer tool row for DeepSeek Harness Web: opens the system file picker (image/*, multi-select) and routes selected images through the official draft attachment pipeline.
- Stars
- 0
- Language
- JavaScript
- Created
- Aug 23, 2026
- Updated
- Aug 23, 2026
Introduction
@local/dsh-add-image-button
持久化「添加图片」按钮:为 DSH 官方图片输入(拖放 + 粘贴)补充系统文件选择入口。
功能
- 在对话输入栏工具行左端(
conversation.input.left加法式座位,id: "add-image",order: 10)显示一个图片图标按钮。 - 点击按钮打开系统文件选择器(
accept="image/*",多选)。 - 选中的图片走官方 draft 附件管线:
conversation.createDraftImages(files)→inputActions.addImages(ids),与拖放/粘贴完全一致 —— 官方附件 rail 缩略图、预览、删除、随消息发送全部可用。 - 输入 busy(
adjudicating/submitting)或会话已移除时按钮自动禁用。 - 非图片类型被拒后回滚,不污染输入;
conversation服务缺失时仅告警。
结构
package.json—@local/dsh-add-image-button,dsh.client声明浏览器半区(platform: web)。lib/index.js— Host 半区最小实现(本扩展无 Host 逻辑)。client.js— 浏览器半区(window.__ModuleLoader__静态模块格式)。
安装(已在 v1 完成)
- 扩展源码目录:
C:\Users\yuyang\.dsh\extensions\add-image-button\ - profile 依赖(
C:\Users\yuyang\.dsh\profiles\web\package.json):"@local/dsh-add-image-button": "link:C:/Users/yuyang/.dsh/extensions/add-image-button" - profile node_modules 链接:
C:\Users\yuyang\.dsh\profiles\web\node_modules\@local\dsh-add-image-button→ (Junction) 扩展目录 - 组合行(
C:\Users\yuyang\.dsh\profiles\web\cordis.patch.yml):insert: [{ id: add-image-button, name: "@local/dsh-add-image-button" }]
修改后重启 dsh web 进程并刷新页面生效。