DeepSeek Harness (DSH) adopts a plugin-based architecture. When handling non-image files (such as text, PDFs, archives, or binary data), users typically need to store files in the session workspace for subsequent processing or delivery via model invocation. This plugin provides arbitrary file upload capabilities for the DSH Web interface, persists files into a session-specific directory, and uses a tool to allow the model to deliver resulting files to users as clickable download cards.
Core Features¶
- File Upload and Persistence: Provides an upload button on the left side of the input area (by default, when the DSH version is ≥ 0.1.5, this button automatically yields to the built-in upload feature to avoid functional overlap). Files are persisted in the
<workspace>/uploads/<sessionId>/directory, and the Dock above the upload area displays the list of uploaded files. - Model Awareness and Delivery: After a successful upload, the plugin automatically injects a message explicitly informing the LLM of the current session’s upload directory path and file list. The model can invoke the
share_session_filetool to render any file in the workspace as a downloadable card in the browser. - Enhanced Download Entry in the New UI: For the new UI in DSH 0.1.5+ (file delivery cards and the file browsing area in the right-side sidebar), the plugin provides download entries, solving the issue in the original UI where files could only be previewed but not downloaded.
- Security and Permissions: Built-in sessionId whitelist and file name sanitization mechanisms reject
..paths and out-of-bounds access. The default maximum file size is 512 MiB. - Remote Workspace Support: Starting with v0.5.0, the plugin supports SSH remote workspaces. Read and write operations are performed through the official file seams (
ctx.fs+ctx.subprocess), removing the dependency on local filesystem assumptions.
Installation and Enablement¶
Prerequisites: Ensure DSH is installed and the target profile (default web) is running.
# 使用官方仓库脚本安装
bash install.sh
# 或手动执行官方命令
npm pack -y
dsh --profile web plugin add ./deepseek-ai-dsh-session-files-<ver>.tgz
After installation, restart DSH and refresh the browser.
Typical Usage¶
- Verify Installation: After restarting and refreshing the page, the upload button should be visible in the input area (if it has not yielded). Open a session, click the button to upload any file, and file chips should appear above the input area.
- Verify File Persistence: Check via the command line that the files exist in the workspace. Assume the DSH address is
<dsh-address>:
# 检查插件加载
curl -s http://<dsh-address>/plugins/@deepseek-ai/dsh-session-files/client.js | head -c 80
# 检查配置
curl -s http://<dsh-address>/dsh-session-files/config
# 列出文件
curl -s 'http://<dsh-address>/dsh-session-files/list?sessionId=<某会话id>'
In a local or remote workspace terminal, run `ls <workspace>/uploads/<sessionId>/` to verify the presence of the files.
- Model Delivery: After uploading files, the model can invoke the
share_session_filetool during the conversation to generate download cards in the conversation stream.
Applicable Scenarios and Notes¶
- Permissions and Security: The plugin runs with the permissions of the current DSH process. Please review the source code (MIT License) and ensure it complies with your security policies.
- Version Differences: On DSH 0.1.0-rc.x versions, the plugin’s behavior differs from that in 0.1.5+ versions (for example, the built-in upload tool does not exist and the UI structure is different).
- Known Issue Fix: v0.4.1 fixed the issue where an empty red box alert appeared at the bottom of the page due to a same-named function-scope override.
Conclusion¶
This plugin addresses DSH’s limitations in generic file upload and delivery, making it suitable for agent scenarios that require persisting files within a session or distributing files through model invocation. For more details and source code, visit GitHub.