Zenjibad/dsh-any-attachment0

dsh-any-attachment

dsh捆绑包:在dsh Web中允许附加任何文件类型。文本类文件内联读取,二进制文件作为工作区路径引用,光栅图像通过内置管道处理

AI 分析

核心用途是解除DSH Web端上传文件类型的限制。适合需要向智能体投喂非标准文本(如PDF、压缩包、代码等)并让其通过工具读取的复杂任务场景。

包名
dsh-any-attachment
版本
0.1.0
许可证
MIT
最近更新
2026年8月14日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Zenjibad/dsh-any-attachment

dsh-any-attachment

A DeepSeek Harness (dsh) plugin bundle that lets the Web UI attach files of any type: text-like files are extracted and inlined into the prompt, everything else becomes a workspace path the agent can read with its existing tools. Raster images keep flowing through the built-in image pipeline. No changes to the harness repo.

What it does

Attached fileResult
note.md, code.py, data.json, ... (valid UTF-8)stored in the session's workspace; first 50 KB inlined into the prompt as text, with the path line
report.pdf, archive.zip, song.mp3, ... (binary)stored in the session's workspace; prompt gets only the path line — the agent reads it itself
photo.png / .jpg / .webp / .gifrouted to the built-in image pipeline unchanged (visible to vision-capable models)

Attach via the + button in the composer or by dragging a file onto the window. Pending files show as rows with name/size, download, a collapsible extracted-text preview, and removal; sending goes through the rail's Send with files button, which composes the path + extracted text into the message.

Files land in the session's workspace directory (/, deduped with a -2 suffix on collisions), so the agent can read, edit, or reference them with its normal fs tools and the sandbox policy applies as usual.

Install

dsh plugin --profile web add https://github.com/Zenjibad/dsh-any-attachment

Restart dsh web (or rely on the profile patch hot-reload), then hard-refresh the page.

Limits

GuardValue
Max bytes per file25 MB
Max files per message8
Inlined text per file / per message50 KB / 100 KB
Namebasename only; traversal, separators, drive letters rejected
Upload targetthe session's own cwd, resolved server-side
Download scopefiles must resolve inside that same cwd

How it works

  • Host (lib/): registers an RPC channel /attachments-any (authority trusted-host, same LAN fence as /api). upload validates base64/size/name, writes into the session cwd, sniffs UTF-8 and extracts; read returns bytes for download after a realpath containment check.
  • Client (client/): composer + button (conversation.input.left), file rail + send (conversation.input.dock), and a capture-phase drop handler. Rasters route through createDraftImages/addImages; everything else uploads via the channel. Sending calls the scope-addressed conversation.sendSession with the composed text part.

Known limitation: while files are pending, the composer is blocked with "Send with the files above" — plain Enter sends text without the pending files; use the rail's Send button (or the block clears once the rail is empty).

Test

node --test

License

MIT