dsh-paste-file
Manifest validPaste/drop files into the DSH composer, save them under the current workspace, and insert relative paths.
dsh-paste-files
GitHub: https://github.com/lhh666-6/dsh-paste-file
npm:
dsh-paste-files
把文件通过「粘贴 / 拖放 / 选择文件」保存到当前 DSH workspace,并在输入框中插入对应的 workspace 相对路径,方便模型用 DSH 自带的文件读取工具继续处理。
行为
-
在 composer 左侧增加一个 粘贴文件 按钮,可以多选文件。
-
在输入框内粘贴文件、或把文件拖进窗口时:
- 如果只有图片,保留 DSH 原生图片附件行为,不拦截。
- 只要包含非图片文件,就拦截该次粘贴/拖放,把所有文件上传并保存到当前会话 workspace。
-
保存位置:
<当前 workspace>/pasted-files/<时间戳>-<短随机>-<文件名>。 -
保存完成后,把 workspace 相对路径以行内代码形式插入当前输入框草稿,例如:
`pasted-files/1724320000000-report.pdf`
架构
- Host 面:注册
/_dsh-paste-files/upload路由,根据sessionId从 DSH SessionStore 读取当前会话cwd,把上传的原始字节写入该 workspace。 - Client 面:注册到
conversation.input.leftslot,提供按钮、文件选择器,以及 document 级 capture 阶段 paste/drop 监听。
开发
npm install
npm run typecheck
npm run build
安装
# npm 安装(推荐,预构建)
dsh plugin --profile web add dsh-paste-files
dsh plugin --profile desktop add dsh-paste-files
# 或直接从 GitHub 安装
dsh plugin --profile web add github:lhh666-6/dsh-paste-file
dsh plugin --profile desktop add github:lhh666-6/dsh-paste-file
安装后重启 DSH(或切换一次 profile)生效。
限制
- 浏览器无法从剪贴板拿到文件的绝对路径,因此插件采用「上传到 workspace 再插入相对路径」的方案。
- 当前默认单文件上限 64 MiB。
- 只是为了把文件变成模型可读的路径,不是向模型协议新增通用二进制附件。
Comments
Loading…
Similar plugins
by yybukn
Attach tables and documents (xlsx, csv, pdf, zip…) to the DSH composer via paste or drag-and-drop: files are saved into the session workspace and an @reference is inserted.
★ 1
MIT
JavaScript
Aug 31, 2026
dsh plugin --profile web add dsh-table-attachby dkjsiogu
DeepSeek Harness plugin: drag unsupported files into the composer as workspace path references
★ 0
MIT
TypeScript
Aug 15, 2026
dsh plugin --profile web add dsh-file-pathby dannyvan
Drag & drop or click to attach any non-image file (PDF/Word/Excel/ZIP/text) into the composer: in the desktop shell it resolves the real Finder path instantly; otherwise it uploads to the workspace an
★ 4
↓ 99/wk
MIT
JavaScript
Aug 16, 2026
dsh plugin --profile web add dsh-file-dropby whyzsm
Attach files/folders in the DSH composer: clipboard paste, native picker, @-mention path search, paged Markdown conversion
★ 0
MIT
JavaScript
Sep 28, 2026
dsh plugin --profile web add dsh-clipfileby zmm863-commits
DSH Web GUI paperclip button: a 📎 button in the composer opens a file picker (drag & drop supported) and inserts file contents into the textarea.
★ 4
↓ 382/wk
MIT
TypeScript
Oct 4, 2026
dsh plugin --profile web add dsh-paperclipby jhuanxx44
Finder clipboard paste for macOS: Cmd+C files or folders in Finder, then Ctrl+V in the DSH composer inserts their absolute paths; ordinary text paste with Cmd+V is untouched.
★ 1
↓ 232/wk
MIT
JavaScript
Sep 17, 2026
dsh plugin --profile web add dsh-paste-path