DeepSeek Harness (DSH) uses a plugin-based architecture. In conversational scenarios, file transfer is a common requirement. The dsh-file-bridge plugin provides this capability, supporting bidirectional file exchange through three methods: attachment button upload, tool delivery, and path jumping.
Core Features¶
- User Upload: Upload files via the attachment button in the input box. Images are automatically compressed to 1600px and support native preview; non-image files generate access links.
- Agent Delivery: The Agent calls the
send_filestool. Images are rendered as clickable previews, while other files provide download links. - Explorer Jump: Wrap the absolute path of the source file (e.g.,
/root/proj/a.md) in backticks within the reply body. Clicking it opens the sidebar file manager. - Static Service: Provides a read-only static service at
/dsh-files/*, with path traversal prevention and RFC 5987 encoding support for Chinese filenames.
Installation and Configuration¶
Install the plugin using the official command:
dsh plugin --profile web add 'github:fengs2021/dsh-file-bridge'
After installation, restart the Web service:
systemctl restart dsh-web
The plugin is initialized through the cordis.patch.yml configuration file. Set the following parameters:
- insert:
- id: file-bridge
name: dsh-file-bridge
config:
publicBase: "http://你的公网地址:端口" # 生成文件 URL 的基础地址,必须配置
filesDir: "/root/.dsh/files" # 共享文件目录(默认 ~/.dsh/files)
Usage¶
- User Upload: The user clicks the attachment button in the input box to select files. The system automatically processes image compression or link generation.
- Agent Delivery and Jump: After the Agent calls the
send_filestool, wrap the absolute path of the source file from the tool call in backticks in the reply. This path must be in the same conversation turn as the reply and must be the source path of the tool call.
Notes¶
- Android WebView: The app side must implement the
WebChromeClient.onShowFileChoosermethod to support file selection. - Nginx Configuration: The deployment environment must configure
client_max_body_sizein Nginx. It is recommended to set it to 25m (the default 1m may cause a 413 error). - Dependency Link: The plugin directory must link
node_modules/@deepseek-ai/dsh-tools; otherwise, an error will occur. - Path Rule: A backtick-wrapped path must be the source path of a tool call and take effect only in the same turn as the reply.
Conclusion¶
This plugin provides basic file interaction capabilities for DSH conversational scenarios through three methods: attachment button upload, tool invocation, and path jumping. Developers can configure the file storage path and public address in cordis.patch.yml as needed. See the project homepage for more details: GitHub