wqx-txdsyl/dsh-ds-attach 预览 preview

wqx-txdsyl/dsh-ds-attach

DeepSeek Harness 的 chat.deepseek.com 风格附件功能:回形针上传、DS 风格文件卡片、拖拽上传、文本提取(PDF/DOCX/XLSX/TXT)、对话记录中的附件卡片

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH) that replicates the exact attachment UI and interaction from the official DeepSeek Chat website. To install the plugin, users can run the command dsh plugin --profile web add github:wqx-txdsyl/dsh-ds-attach directly via the DSH CLI, or install it from a local directory by adding the absolute path of the cloned repo. After installation, users need to restart the dsh web process for the plugin to take effect. It adds an identical paperclip upload button to the input toolbar, and supports drag-and-drop upload anywhere on the page, matching the official DeepSeek Chat behavior.

The plugin handles multiple common file types: it extracts text from PDFs with pdfjs-dist, from DOCX files with mammoth, from XLSX with xlsx, and reads plain text directly from TXT, MD, and code files. All extracted text is truncated at the paragraph boundary by default to a 150,000 character limit, which can be adjusted via the DS_ATTACH_MAX_CHARS environment variable. After you send a message with attachments, the input area attachment list is automatically cleared, matching the official DeepSeek Chat workflow. Attachments in the conversation flow display as official-style cards with colored file icons instead of raw text, so conversations stay clean and readable.

For scanned PDFs with no text layer, the plugin automatically runs OCR via Zhipu's glm-4v-flash model, which requires users to set the DEEPEYE_API_KEY or BOOK_OCR_API_KEY environment variable before first use. Multiple OCR parameters can be adjusted via environment variables, including rendering resolution, concurrent pages, and header/footer cropping. All uploaded files are stored in $DSH_HOME/ds-attach/<sessionId>/ for session isolation, with path traversal protection to prevent common security issues. The plugin uses three pure JavaScript dependencies that require no native compilation, and is released under the permissive open source MIT license.

这是一款专为DeepSeek Harness(DSH)开发的原生插件,一比一复刻了DeepSeek Chat官方网站的附件渲染样式与交互逻辑。插件提供回形针上传按钮、拖拽上传功能,支持PDF、DOCX、XLSX、TXT等多种格式文件提取文本,自带符合官方设计风格的文件卡片UI,需安装到DSH的web端使用,安装后重启dsh web即可生效。

对普通用户来说,使用流程和官方DeepSeek Chat完全一致:选中文件或拖拽上传后,插件自动完成文本提取,发送消息后输入区附件自动清空;对话流中附件会显示为带彩色分类图标的文件卡片,而非直接展示杂乱的原始长文本,用户点击卡片才可以展开查看全部内容。

插件提取的文本会按固定格式结构化注入对话,方便模型读取内容;扫描版无文字层PDF会自动调用智谱GLM-4V-Flash进行OCR识别,需要配置对应环境变量密钥,用户也可通过环境变量调整最大字符数、OCR分辨率等参数,项目采用MIT许可证开源。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:wqx-txdsyl/dsh-ds-attach

把 wqx-txdsyl/dsh-ds-attach 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-ds-attach

DeepSeek Chat(chat.deepseek.com)同款附件渲染样式 —— 上传按钮、文件卡片、图标、消息内附件展示,全部一比一复刻官方前端(图标与样式直接提取自 chat.deepseek.com 前端 bundle)。DeepSeek Harness 插件(dual-face bundle)。

预览

功能(与 chat.deepseek.com 一致)

  • 回形针上传按钮:输入框工具栏左侧,DSH 官方 IconPaperclipOutline16 图标,点击选择任意文档/图片(多选),tooltip「上传文档或图片(仅文本提取)」
  • 拖拽上传:非图片文件拖到页面任意位置即上传
  • DS 风格文件卡片:240×64px、圆角 16px、1px 边框——左侧 28×28 官方彩色文档图标(PDF 红/表格绿/图片紫/PPT 橙/文本蓝,从 chat.deepseek.com 前端 bundle 扒出的精确 SVG)、文件名(14px/500)+ 状态副行(12px)、右上角 18px 圆形删除按钮,多文件横排
  • 状态流转:上传中 → 解析中 → 完成 / 未提取到文本 / 上传失败(与官方「Uploading/Parsing/No text extracted」对应)
  • 文本提取(与官方一致,服务端解析):
    • PDF → pdfjs-dist 提取文本
    • DOCX → mammoth 提取文本
    • XLSX → xlsx 读取单元格(前 5 个 sheet)
    • TXT/MD/代码 → 直接读文本
    • 按 token 预算截断(默认 15 万字符,DS_ATTACH_MAX_CHARS 可调;在段落边界截断,不切断句子)
  • 发送即清空:卡片随消息发送后,输入框附件区自动清空(DS chat 行为)
  • 消息里显示卡片:自定义 user 节点渲染器(priority -1 接管),对话流中附件显示为真正的文件卡片(文件名 + 彩色图标 + 大小,点击展开全文),而非原始长文本;普通消息保持原样浅蓝气泡
  • 图片分流:图片自动走 DSH 原生视觉附件管线
  • 扫描版 PDF OCR(与官方一致):PDF 无文字层时,自动渲染每页为图片并调用视觉模型识别文字(智谱 glm-4v-flash,走 DEEPEYE_API_KEY / BOOK_OCR_API_KEY 环境变量)
  • 模型可读:提取文本随消息结构化注入(【附件】名\n【文件大小】N\n【文件内容】…【文件内容结束】),模型读到完整内容

安装

# 从 GitHub
dsh plugin --profile web add github:wqx-txdsyl/dsh-ds-attach

# 或本地路径
dsh plugin --profile web add <本目录绝对路径>

重启 dsh web 生效。

依赖

pdfjs-dist / mammoth / xlsx(纯 JS,无原生编译)。安装插件时若提示 allowBuilds,按提示添加即可(这些库无编译脚本,通常无需)。

说明

  • host 半:/ds-attach/upload(base64 接收 + 落盘 + 文本提取 + 扫描 PDF OCR)、/ds-attach/file(回读)、/ds-attach/meta(元信息)
  • client 半:回形针按钮 + 拖拽 + 卡片 UI + user 消息渲染器
  • 文件存于 $DSH_HOME/ds-attach/<sessionId>/,会话隔离,路径穿越防护
  • 扫描版 PDF(无文字层):自动渲染页图 → 视觉模型 OCR,依赖 DEEPEYE_API_KEY 或 BOOK_OCR_API_KEY 环境变量(智谱 glm-4v-flash,baseUrl 默认 https://open.bigmodel.cn/api/paas/v4);未配置 key 时才显示「未提取到文本」
    • 文字层优先(快路径,与官方一致):PDF 只要带文字层(哪怕内嵌的劣质 OCR 层)就秒出文字层文本,不触发慢速视觉 OCR;仅纯扫描 PDF(无文字层)自动 OCR
    • 想要更清晰的视觉 OCR 文本(劣质文字层的书):DS_ATTACH_FORCE_OCR=1 强制 OCR(注意:整本书逐页识别,可能需数分钟);DS_ATTACH_TEXTLAYER_ONLY=1 禁用 OCR
    • OCR 可调环境变量:BOOK_OCR_SCALE(渲染分辨率倍数,默认 3,越高字形越清晰)、BOOK_OCR_CONCURRENCY(并行页数,默认 2)、BOOK_OCR_CROP_TOP / BOOK_OCR_CROP_BOTTOM(OCR 前裁剪页眉页脚区域,页面高度比例,默认 0.07/0.08,设 0 关闭)、BOOK_OCR_MODEL / BOOK_OCR_BASE_URL / BOOK_OCR_MAX_TOKENS / BOOK_OCR_TIMEOUT_MS
  • user 渲染器接管所有用户消息渲染(与产品样式一致),保证普通消息显示不变

License

MIT

← 上一个 Prev dsh-chat-tools 下一个 Next dsh-skills-manager →