Introduction¶
DeepSeek Harness (DSH) uses a plugin-based architecture. When building text-based agents, making a model directly read local files usually requires configuring complex filesystem tools or relying on cloud services. The dsh-file-upload-local plugin provides a complete local file handling solution within the session space. Users can complete uploads through UI interactions, and agents can call the uploaded files.
What Is This¶
This plugin is maintained by lubenweimeiyoukaig and is licensed under the MIT License. It provides local file upload capability for DSH. It supports uploading via a paperclip button and full-screen drag-and-drop, stores files in session-isolated directories, and allows agents to read them with the read_document tool.
Core Features¶
- Upload interactions: Provides a paperclip button and a full-screen drag-and-drop overlay.
- Attachment bar: Images display 64px thumbnails (click to view); other files display their type icon and filename. Each item includes a remove button.
- Reading tool: Provides the
read_documenttool. Supports paginated reading of text files (offset/limit) and uses tesseract.js for OCR on images. - Storage mechanism: Files are isolated by session and stored in
.dsh-uploads/<sessionId>/. The plugin includes a TTL scanning mechanism to prevent unbounded directory growth.
Installation and Enablement¶
- Run the following command to install the plugin:
dsh plugin --profile web add dsh-file-upload-local
- After installation, restart dsh web.
Typical Usage¶
- Click the paperclip button on the left side of the input box, or drag files directly to any part of the window to upload them.
- Uploaded files appear above the input box. You can click a thumbnail to view the full image, or click the remove button (✕) to delete an unwanted attachment.
- After sending a message, the agent will use the
read_document <path>tool to read the attachment content. For text files, it paginates line by line; for images, it performs OCR.
Configuration¶
You can adjust the following parameters in the configuration file (default values):
- id: dsh-file-upload-local
config:
uploadMaxBytes: 26214400 # 单个上传文件大小上限
uploadTtlMs: 604800000 # 文件过期时间(7天)
sweepIntervalMs: 3600000 # TTL 扫描间隔
maxConcurrentUploads: 4 # 最大并发上传数
maxFileBytes: 26214400 # read_document 读取单次上限
readLimit: 2000 # read_document 每页最大行数
ocrLangs: 'chi_sim+eng' # tesseract OCR 语言包
Notes¶
- OCR language pack: The default is
chi_sim+eng. This language pack must be downloaded over the network on first use or pre-cached in advance. Without network access, the OCR feature will be unavailable. - Image reading path: Images are read by default through the OCR path (i.e.,
read_document), which is suitable for text-only models. If the current model supports image input, you can use theread_imagetool directly. - Permissions and source code: The plugin runs under the current DSH process permissions. It is recommended to review the source code and license before installation.
Conclusion¶
This plugin simplifies the local file interaction workflow. For more configuration details and source code, refer to: GitHub.