Preface

In DeepSeek Harness (DSH) development scenarios, agents often need to handle remote resources, such as downloading images, archives, or installer packages. Although DSH’s built-in web_fetch tool is good at extracting web page body text, it discards binary data and is not suitable for file download scenarios. The dsh-fetch-file plugin fills this gap, allowing agents to stream the response from any URL into a workspace file, with built-in security guardrails and size limits.

Overview

This is a DSH plugin maintained by ZhijiangTang. Its core value is to stream responses from any URL into workspace files, support binary content, and include path security guardrails and size limits.

Core Features

  1. Download any URL as a workspace file: Supports http/https protocols and automatically follows redirects.
  2. Binary-friendly, streaming to disk: Responses are written to disk in a streaming manner, without loading the entire file into memory, making it suitable for large files.
  3. Path guardrails: Ensures the write path remains within the workspace root and prevents out-of-bounds access.
  4. 200MB per-download limit: The default is MAX_SIZE_BYTES = 200 * 1024 * 1024; if the limit is exceeded, the operation is aborted and a standardized error is returned.
  5. Zero dependencies, pure ESM: No build step required; installation is simple.

Installation and Enablement

Before installing, make sure your DSH version is 0.1.0-rc.6 or higher and that a profile has been configured. Run the following command to install the plugin:

dsh plugin --profile <你的 profile> add file:./plugins/dsh-fetch-file

Typical Usage

When invoking the download tool, pass the url and dest parameters.

Parameters

  • url (string, required): The URL to download. The plugin automatically follows redirects.
  • dest (string, optional): The save path (relative to the workspace root). Defaults to the basename of the URL; if the URL has no basename, it falls back to download-<timestamp>.
  • overwrite (boolean, optional): Whether to overwrite an existing file. Defaults to false.

Return Value Specification

The plugin does not throw exceptions; all results are returned as standardized values.

  • Success:
    { "ok": true, "path": "...", "absPath": "...", "sizeBytes": 1024, "status": 200, "contentType": "..." }
  • Failure:
    { "ok": false, "error": "..." }
The `error` field can be a string (such as "dest is outside the workspace") or an object (containing a `stage` field, such as `http`, `network`, `timeout`, `size`, `fs`, etc.).

Difference from web_fetch

Feature download (this plugin) web_fetch (built-in)
Purpose Download to a file and persist it to the workspace Read a web page and return body text
Content Raw bytes, binary-friendly Extracts body after fetching and discards binary data
Result File path + byte size + status code Summary text
Limit 200MB (configurable) Limited by model context / fetching strategy

Notes

  • Permission requirements: The plugin requires filesystem:write and network:outbound permissions to run.
  • Ecosystem background: The DSH plugin ecosystem is maintained by the community and has no official affiliation with DeepSeek / High-Flyer.
  • Pre-installation check: It is recommended to review the source code and license (MIT) before installation to ensure compliance with your project’s security standards.

Next Steps

The plugin returns results using standardized values and does not throw exceptions, making it suitable for integration into DSH workflows. See the links below for full documentation and source code.