Preface¶
In the DSH web client, uploading documents and allowing models to read the text is a common requirement. It involves selecting PDF, DOCX, XLSX, and TXT/MD/Code files, viewing file cards similar to chat.deepseek.com, and sending the extracted text to the model along with the message.
dsh-ds-attach is a DeepSeek Harness plugin maintained by wqx-txdsyl, providing attachment upload, DS-style file cards, drag-and-drop upload, text extraction, and attachment display within messages. Below are its features, installation, and configuration.
What is this¶
dsh-ds-attach is a DeepSeek Harness plugin that replicates the attachment upload, DS-style file cards, drag-and-drop upload, and PDF/DOCX/XLSX/TXT text extraction/injection capabilities found in chat.deepseek.com.
The maintainer is wqx-txdsyl, and the license is MIT. The verified version and dependency information are as follows:
package.json: 0.1.0
peerDependencies: @deepseek-ai/cordis ^4.0.1
license: MIT
The README states that this plugin depends on pdfjs-dist, mammoth, and xlsx, and is pure JS without native compilation.
Core Features¶
- Upload Entry: A paperclip button on the left side of the input box toolbar allows for multi-selecting any document or image; non-image files can be dragged to any location on the page to upload.
- File Card: Dimensions 240x64px, 16px border radius, 1px border, containing the official colored document icon and a delete button.
- Status Flow: Supports uploading, parsing, completed, no text extracted, and upload failed states.
- Text Extraction: Supports PDF, DOCX, XLSX, and TXT/MD/Code files; the default character budget is 150,000 characters, with truncation at paragraph boundaries.
- Message Display: Uses a custom user node renderer in user messages with priority -1; the card displays the filename, icon, and size, and expands on click to show the full text.
- Clear After Send: After sending a message, the input box attachment area is automatically cleared.
- Image Processing: Images automatically go through the DSH native visual attachment pipeline.
- Scanned PDF: When there is no text layer, it automatically renders page images and invokes the visual model for OCR.
- Text Injection: Extracted text is injected into the message structure for the model to read.
The host side provides the following interfaces:
/ds-attach/upload
/ds-attach/file
/ds-attach/meta
File storage path:
$DSH_HOME/ds-attach/<sessionId>/
Files are isolated by session and have path traversal protection.
Installation and Activation¶
First, install the plugin from GitHub:
dsh plugin --profile web add github:wqx-txdsyl/dsh-ds-attach
You can also install using a local absolute path:
dsh plugin --profile web add <local absolute path>
After installation, restart the DSH web client for the plugin to take effect.
If the installation prompts for allowBuilds, add it as instructed.
Typical Usage¶
The following explains the usage steps.
- Upload File: Click the paperclip button to select a document or image; non-image files can also be dragged to any location on the page to upload.
- Check Parsing Status: The file card displays the status: uploading, parsing, completed, no text extracted, or upload failed.
- Send Message: The attachment card is displayed with the user message; the input box attachment area is automatically cleared.
- Scanned PDF OCR: You need to configure one of the following keys:
DEEPEYE_API_KEY
BOOK_OCR_API_KEY
If no key is configured, it will show “no text extracted”.
OCR defaults to Zhipu’s glm-4v-flash, with the default baseUrl as follows:
https://open.bigmodel.cn/api/paas/v4
Adjustable configuration options are:
DS_ATTACH_MAX_CHARS
DS_ATTACH_FORCE_OCR=1
DS_ATTACH_TEXTLAYER_ONLY=1
BOOK_OCR_SCALE
BOOK_OCR_CONCURRENCY
BOOK_OCR_CROP_TOP
BOOK_OCR_CROP_BOTTOM
BOOK_OCR_MODEL
BOOK_OCR_BASE_URL
BOOK_OCR_MAX_TOKENS
BOOK_OCR_TIMEOUT_MS
Among these, BOOK_OCR_SCALE defaults to 3, BOOK_OCR_CONCURRENCY defaults to 2, BOOK_OCR_CROP_TOP defaults to 0.07, and BOOK_OCR_CROP_BOTTOM defaults to 0.08; setting BOOK_OCR_CROP_TOP and BOOK_OCR_CROP_BOTTOM to 0 disables cropping.
The character budget can be adjusted using DS_ATTACH_MAX_CHARS, with a default of 150,000 characters.
Applicable Scenarios and Notes¶
Suitable for scenarios in the DSH web client where you need to upload PDF, DOCX, XLSX, and TXT/MD/Code files and provide the document text to the model.
Please note the following points:
- The plugin runs with the permissions of the current DSH process; you should check the source code, dependencies, and license before installing.
- The license is MIT, and the peerDependencies is
@deepseek-ai/cordis ^4.0.1. DS_ATTACH_FORCE_OCR=1forces OCR;DS_ATTACH_TEXTLAYER_ONLY=1disables OCR.- OCR relies on
DEEPEYE_API_KEYorBOOK_OCR_API_KEY; if not configured, scanning PDF OCR cannot be completed. - The community directory should be treated as an independent plugin directory and is not equivalent to the DeepSeek official app store.
Links¶
dsh-ds-attach provides upload, card display, text extraction, and message injection capabilities, making it suitable for document attachment scenarios in the DSH web client.
GitHub:
https://github.com/wqx-txdsyl/dsh-ds-attach
Directory Page: Verified URL not provided.