@philomelcc/dsh-downloads: DSH Workbench Download Queue Module

Introduction

When running agents or scripts in DSH, you often need to pull HTTP resources, magnet links, or large files. Built-in system downloads are often just “click once and finish,” lacking queues, progress, and control panels; putting downloads into the terminal also makes it difficult to view their status uniformly in the Web UI. DeepSeek Harness’s Workspace supports extending the interface by module; @philomelcc/dsh-downloads is a module that adds a Downloads tab to the Workspace, managing progress with a task queue and optionally taking over the browser’s default downloads. Below is an explanation of usage, covering installation, engines, APIs, and notes.

What is this

@philomelcc/dsh-downloads (npm package name @philomelcc/dsh-downloads, current version 0.1.4) is maintained by philomelcc and licensed under MIT (aria2 and Xunlei SDK follow their respective licenses). Categorically, it belongs to Networking Tools in the DSH Community Directory. One-sentence positioning: A download manager in the Workspace—task queue, progress, pause/resume/cancel, magnet links, optional Chrome default download takeover, and a history of what was downloaded in each session.

Core Features

Based on the GitHub README, the module provides the following capabilities:

  1. Task Queue and Status: List view of tasks and statistics; support for pausing, resuming, canceling, and removing individual tasks.
  2. Multi-source URLs: Support for HTTP/HTTPS, magnet links, and .torrent files; allows specifying a directory, filename, and backend engine when creating a task.
  3. Dual Engine Strategy: Magnet and torrents use aria2 (DHT + LPD, --seed-time=0); HTTP/HTTPS uses Xunlei P2SP if an API Key is configured, otherwise aria2 with multiple connections.
  4. Health Check: /wb/downloads/health allows viewing engine paths and default directories; the page remains open even if aria2 is not installed, and magnet-related operations will provide readable error messages.
  5. Session History: /wb/downloads/history returns the download records within the session.
  6. Collaboration with Other Tools: POST /wb/downloads/register is provided for tools like fast_download to register tasks.
  7. Optional Chrome Extension: The repository contains chrome-extension/ for default download takeover (install as needed).

This package does not include the aria2 binary; the Xunlei engine is optional, requiring you to install the SDK and credentials yourself. It does not affect the page or other backends if not configured.

Installation and Enablement

The Workspace depends on @philomelcc/dsh-workbench; you must install the Workspace before installing the download module. The official installation commands are as follows (PowerShell):

dsh plugin --profile web add @philomelcc/dsh-workbench
dsh plugin --profile web add @philomelcc/dsh-downloads

After completing the above commands, restart the Web UI. The module will add a Downloads tab to the Workspace.

Configure aria2 (Magnet / Default HTTP)

The module will look for the aria2 executable in the following order:

  1. Environment variable ARIA2C_PATH points to aria2c (Windows is aria2c.exe);
  2. Cache path ~/.dsh/download-center/bin/aria2c (Windows is aria2c.exe);
  3. After installing via a package manager and restarting, e.g., winget install aria2.aria2 or scoop install aria2.

If aria2 is not installed, the interface is still usable; magnet download failure messages are readable, and /wb/downloads/health will explain the reason.

Optional: Xunlei Engine (HTTP/HTTPS)

Xunlei is an optional acceleration path involving native modules that require build approval; it is not a dependency. You can install it when you have an API Key:

npm i @xunlei-open/dlsdk @xunlei-open/dlsdk-native-windows-x64

Credentials file path: ~/.dsh/secrets/xunlei.txt. If the SDK is not installed, magnet and HTTP downloads still go through aria2; the Xunlei backend will report readable errors, which does not affect the page or other logic.

Typical Usage

Web Interface

After restarting, open the Workspace Downloads tab and create tasks via the interface (underlying logic uses the following APIs).

HTTP API (Loopback Only)

The README states: All routes only accept loopback access (localhost); do not expose the DSH process port in insecure environments.

Method Path Description
GET /wb/downloads/list Task list and statistics
GET /wb/downloads/history Session history
GET /wb/downloads/health Engine paths, default directory
POST /wb/downloads/create Request body { url, dir?, fileName?, backend? }
POST /wb/downloads/pause Request body { id }
POST /wb/downloads/resume Request body { id }
POST /wb/downloads/cancel Request body { id }
POST /wb/downloads/remove Request body { id }
POST /wb/downloads/open Request body { id, kind: 'file' \| 'dir' }
POST /wb/downloads/register For external tools to register, see README for fields

Example of creating a task (conceptually):

POST /wb/downloads/create
Content-Type: application/json

{
  "url": "https://example.com/file.zip",
  "dir": "/path/to/save",
  "fileName": "file.zip"
}

To control a task, simply call pause, resume, or cancel with the same id.

Code Structure (for Review)

index.js            Host: Router entry point
client.js           Client: Page and registerView('downloads')
lib/tasks.js        Task table, state machine, persistence, history
lib/engines.js      aria2 / Xunlei sub-processes and progress parsing
lib/xunlei*.mjs     Xunlei worker (separate process)
chrome-extension/   Optional Chrome takeover
test/               Client-side smoke tests

When reviewing permissions and network behavior, you can focus on lib/engines.js and the sub-process startup logic.

Scenarios and Notes

Who is it for?: Developers already using the DSH web profile Workspace who want to queue downloads, view progress, and see history in a unified Web UI; when magnet links or optional Xunlei HTTP acceleration are needed, engines can be configured manually as described above.

Permissions and Security: The plugin runs with the current dsh process, allowing access to directories and network resources that the process user can write to. It is recommended to read the GitHub repository source code and the MIT license before installing; when using the Xunlei SDK, additionally follow its license and credential management requirements. The community plugin directory skillhub.cn is an independent ecosystem site with no official affiliation to DeepSeek / Hyperbolic.

Dependencies: You must have @philomelcc/dsh-workbench installed first; aria2 and Xunlei both need to be installed and configured manually by you; the module will not download the GPL aria2 binary for you.

Conclusion

@philomelcc/dsh-downloads puts a “real download queue” into the DSH Workspace: controllable progress, magnet support, optional dual-engine HTTP, and session history retention. Install and restart the Web UI using the two official dsh plugin --profile web add commands to use the Downloads tab; details and issues can be found in the community directory and GitHub.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye