
taxueseek/dsh-files
51Last commit Aug 14, 2026
dsh-files DSH plugin
dsh-files adds a file-upload button and drag-drop zone to the Web UI, with colored cards showing real format. It also provides a read_document tool that parses text, PDF, DOCX, and XLSX files with content sniffing, encoding detection, and pagination.
How to install the dsh-files DSH plugin
dsh plugin --profile web add dsh-filesCopying does not run this command. Review the repository and version before installing the dsh-files DSH plugin.
dsh-files DSH plugin data source
dsh-files DSH plugin snapshot date: Aug 16, 2026
discovered
What the dsh-files DSH plugin can do
- Session-isolated file storage under `.dsh-filess/<sessionId>/`
- Two upload entry points: toolbar button and drag-drop anywhere on page
- Colored floating cards (PDF red, DOC blue, XLS green, TXT gray) based on byte-sniffed real format
- Send linkage: file paths auto-injected into input box on card mount
- Security guards: loopback host, same-origin, sec-fetch-site checks, filename sanitization, unknown session 403, concurrency limit (default 4)
- TTL sweep (default 7 days) and optional per-session upload quota
- Content sniffing: rejects disguised files (e.g., exe renamed to .pdf), reads UTF-8, UTF-16, GB18030
- Paged reading with line numbers for text, no line numbers for PDF/DOCX/XLSX, XLSX sheet-level reading
- Explicit hint for scanned PDFs (no text layer) to avoid empty-string confusion
- LRU parse cache (entry + byte budget), invalidated on file change
Where the dsh-files DSH plugin fits
- Upload a PDF report and ask the model to extract key findings
- Drag and drop a code file, then have the model analyze its logic
- Upload an Excel workbook with multiple sheets and query specific sheet data
- Upload a Word document and translate its content to another language
- Attach multiple files to a single conversation, each stored in its own session workspace
Who the dsh-files DSH plugin is for
- DSH Web users who need to attach files to conversations
- Developers building AI assistants that require file-reading capabilities within DSH
dsh-files DSH plugin limitations
- Only works in DSH Web environment (requires `ctx.fs` and session sandbox)
- Document reading supports only text, PDF, DOCX, and XLSX formats; other formats (images, archives) are not parsed
- Uploaded files are not format-whitelisted by default; security relies on session sandbox isolation
- Parse dependencies (pdfjs-dist, mammoth, read-excel-file) may have their own constraints
- The plugin is still under active development (57 unit tests); edge cases may not be fully covered
dsh-files DSH plugin: from the repository README
Quoted from the taxueseek/dsh-files README, the upstream source of the dsh-files DSH plugin. Copyright remains with the original authors.
DeepSeek Harness 双面插件(dual-face plugin):一个包、一行 cordis 配置,为 Web UI 提供「文件上传」与「文档读取」两项能力。 - **上传**:输入框工具栏回形针按钮,文件以浮动彩色卡片呈现,发送时自动把路径附入消息;按会话隔离存储到 `<会话工作区>/.dsh-filess/<sessionId>/`,TTL 定期清扫,sha256 内容去重 - **文档读取**:`read_document` 工具读取文本 / PDF / DOCX / XLSX,内容嗅探判定真实格式(不信任扩展名),大小预检,LRU 解析缓存 ## 功能 ### 上传 - 会话隔离存储:文件落在发起会话自己的工作区 `.dsh-filess/<sessionId>/` 下,agent 的 fs 后端一定能读到;会话之间互不可见 - 两种入口:输入框工具栏回形针按钮选择,或直接把文件拖到页面任意位置(拖拽悬停有遮罩提示);多文件横排 - 浮动彩色卡片:按**字节嗅探的真实格式**着色(PDF 红 / DOC 蓝 / XLS 绿 / TXT 灰),伪装文件(exe 改 .pdf)不按扩展名显示;文件名、大小、移除按钮 - 发送联动:卡片挂载后文件路径自动注入输入框,随消息发出 - 安全护栏:loopback host + same-origin + sec-fetch-site 三重校验;文件名消毒(控制字符、路径分隔、点段、前导点全部剥离,并按 UTF-8 字节截断,长中文名不触发 ENAMETOOLONG);未知会话 403;并发限流(默认 4)超限 429 - 生命周期管理:TTL 清扫(默认 7 天),空会话目录自动回收;可选会话存储配额(`maxUploadBytesPerSession`,超限 507) ### 文档读取 - 内容嗅探:PDF 头 / ZIP 中央目录成员 / UTF-8 / UTF-16 BOM / GB18030,全部从字节判定,扩展名伪装(可执行文件、图片改成 .pdf)一律拒绝;上传侧同步嗅探,卡片显示真实格式 - 编码链:UTF-16 BOM → UTF-8(fatal)→ GB18030(fatal),中文 GBK 文件可直接读取 - 分页读取:行号 + offset/limit 分页,长文档按需翻页;窗口总字符预算(`maxOutputChars`)超限时截断并显式标记剩余行数 - 行号策略按格式分化:text(代码/配置)带行号供精确定位;PDF/DOCX/XLSX 段落流不带行号(省 token) - XLSX sheet 级读取:`sheet` 参数指定工作表时返回该 sheet 全量(不受行截断限制),其余 sheet 走合并读取(默认前 5 个),截断显式标记;`list_she
Read the full READMEThe repository declares no license. Check with the authors before using it.
dsh-files DSH plugin questions
How do I upload a file using dsh-files?
You can either click the paperclip icon in the input toolbar to select files, or drag and drop files anywhere on the page. A floating colored card will appear for each file. The file path is automatically injected into the input box when the card is attached, and sent with the message.
What file formats are supported for document reading?
The read_document tool supports plain text, PDF, DOCX, and XLSX files. It uses content sniffing to determine the real format, so disguised files (e.g., an executable renamed to .pdf) will be rejected. For PDFs without a text layer (scanned documents), it returns an explicit message instead of an empty string.
How are uploaded files stored and how long do they persist?
Uploaded files are stored in the session's workspace under `.dsh-filess/<sessionId>/`. Each session has its own isolated directory. By default, files are kept for 7 days (TTL) and automatically cleaned up. You can also configure a per-session upload quota in bytes.
Can I read specific sheets in an Excel file?
Yes. You can use the `sheet` parameter to specify a sheet name and get its full data (not subject to row limit). The `list_sheets` parameter returns all sheet names without reading cells. If you don't specify a sheet, the first 5 sheets are merged by default.
How do I configure upload limits like file size or concurrency?
All configuration is done via the plugin's config block in your DSH profile YAML. You can set `maxFileBytes`, `maxConcurrentUploads`, `maxUploadBytesPerSession`, `uploadTtlMs`, and many other options. See the README's config section for the full list.