Introduction¶
DeepSeek Harness (DSH) adopts a “everything is a plugin” architecture, where developers register tools to agents via plugins to extend capabilities. Download operations are prone to repeated failures over unstable networks, and improvements like retries and resume are difficult to implement at the caller level in place. Ghost Downloader is a desktop download tool with built-in support for resumable downloads, multi-threading, and retry on failure. This plugin leverages its official CLI tool ghd to unify download queue management: downloads initiated by the AI and those initiated manually from the desktop share the same queue, progress is visible in the UI, and the default destination is bound to the session working directory so the agent can read back files.
Plugin Positioning¶
- Name: dsh-ghost-download
- Maintainer: a-molecule-of-ATP
- Type: Workflow plugin
- Core value: Acts as an adapter that reuses the user’s existing Ghost Downloader engine without adding a new downloader or migrating queues. The agent invokes it via the
ghdCLI and shares the same queue with the desktop app.
Core Capabilities¶
The plugin registers 8 tools to the agent, all routed through the ghd CLI:
ghost_download: Submit one or multiple links for download. Supports http/https/ftp/magnet/ed2k,.torrentURLs, and HLS/DASH manifests. Parameters include target directorydir, file indexselect, renamename, request headersheaders, same-name conflict policyconflict(defaultkeep),useGhostFolder(ignoresdir, defers to Ghost’s own rules),precheck(usesghd probebefore submission to check disk space and same-name files; report-only, no auto-skip), andwaitSeconds(synchronous wait duration).ghost_probe: Preview a link only. Returns the resolved filename, size, and file list (for torrents, this provides the file index needed forselect). Results are cached for 5 minutes;fresh:trueforces a re-probe.ghost_tasks: List all current Ghost tasks with their status and progress. Filterable bystatus, or uselimitto cap the number of results returned (newest first).ghost_task: View details of a single task (status, progress, files, errors). Failed tasks include a diagnosis (certificate/DNS/authentication/resource-not-found/range-request, etc.) and a suggested action.ghost_control: Control tasks —pauseto pause,startto resume/start,retryto retry (optionally specifytaskIds; if omitted, retries allfailedtasks),removeto delete (deletes files of the task that haven’t finished yet, can be disabled in settings;deleteFiles:truealso deletes already-produced files).ghost_wait: Block until a task stops running (completed/failed/paused/removed), then report the final status.timeoutSecondsdefaults to 600 seconds, clamped by thewaitLimitSecondsupper bound. Optionalchecksumparameter for integrity verification supports md5/sha1/sha256/sha512/crc32, with the algorithm auto-detected by length.ghost_stats: Aggregate status counts and total byte size for tasks currently visible in the queue. Ghost does not retain history, so only the current queue is summarized.ghost_doctor: Read-only health check. Verifiesghdavailability, live tasks, small-file network/certificate probe, session download directory writability, and cross-checks against Ghost’sUserConfig.json.
Two additional non-tool capabilities are provided:
- Sidebar “Ghost Download Queue” panel: Displays download progress in real time on the right side of the Web client, polling a queue snapshot cached for 3 seconds every 5 seconds.
- Shell download interception: Rejects
curl -o/curl -O/wgetby default and redirects the model toghost_download(can be disabled viablockShellDownloads).
Installation & Activation¶
This plugin is installed via link: and requires linking the plugin package to your profile.
- Place the plugin package (containing
cordis.patch.yml,package.json, etc.) into your profile directory. - Insert the following into your profile’s
cordis.patch.yml:
- insert:
- id: ghost-download
name: '@local/dsh-ghost-download'
- Configure
ghdPathin the DSH plugin page, pointing toghd.exe(by default, it probes theGHOST_GHD/GHD_PATHenvironment variables, standard install directories, and finally falls back toPATH).
Configuration Options¶
The plugin provides 12 configuration items, all marked .volatile() and taking effect immediately upon save:
| Field | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | true |
When disabled, no ghost_* tools are registered |
ghdPath |
string | "" |
Path to ghd.exe; auto-detect if left empty |
pollIntervalMs |
natural | 5000 |
Background polling interval (ms, minimum 1000) |
blockShellDownloads |
boolean | true |
Reject curl -o / curl -O / wget |
maxUrlsPerCall |
natural | 50 |
Max links per ghost_download call |
waitLimitSeconds |
natural | 3600 |
Synchronous wait upper bound (10–7200) |
watchLimitMinutes |
natural | 30 |
Per-task background watch upper bound (minutes) |
maxOutputChars |
natural | 20000 |
Max characters in successful result (min 500) |
maxErrorChars |
natural | 2000 |
Max characters in error output (min 200) |
allowedUrlSchemes |
string[] | ["http","https","ftp","magnet","ed2k"] |
Protocol whitelist |
controlRemoveEnabled |
boolean | true |
Whether to allow remove in ghost_control |
noticeIncludePath |
boolean | true |
Whether notifications include the absolute file path |
Typical Usage¶
- Submit a download and wait synchronously for completion:
ghost_download(
urls: ["https://example.com/file.zip", "magnet:?xt=urn:btih:..."],
dir: "/path/to/session/downloads",
conflict: "keep",
waitSeconds: 600
)
- Preview a link and select a torrent file index:
probe_result = ghost_probe(urls=["..."], fresh: true)
select = probe_result.files[0].index
ghost_download(urls=["..."], select: select)
- Wait for a task to complete and verify its md5:
result = ghost_wait(
taskId: "tsk_0123",
timeoutSeconds: 600,
checksum: "md5:5d41402abc4b2a76b9719d911017c592"
)
- View task details and attempt a retry:
task = ghost_task(taskId: "tsk_0123")
ghost_control(taskIds: ["tsk_0123"], action: "retry")
- Run a health check on the current queue:
health = ghost_doctor()
Use Cases & Caveats¶
- The
ghdCLI tool of Ghost Downloader must be installed in advance (install via “Settings → Command-Line Tools” in the desktop app). - The plugin runs with the permissions of the current DSH process. Review the source code and license (MIT) before installing.
- Same-name conflict defaults to
keep; passingoverwritewill overwrite existing files. ghost_proberesults are cached for 5 minutes. Header values containing cookies/tokens will appear in the local process list as CLI arguments — handle sensitive headers with care.- Task IDs follow the format
tsk_0123;ghost_task/ghost_control/ghost_waitonly accept this format. - Up to 50 links per call (limited by the 32K Windows command-line constraint); exported results are truncated to
maxOutputChars/maxErrorChars. - Background watching has limits: 30 minutes per task, or stops after 10 consecutive CLI failures or 3 session disconnections.
Value Recap¶
This plugin unifies the download queue into Ghost Downloader via the official ghd CLI, letting the agent and the desktop app share the same queue. It reuses resumable download and retry capabilities, binds the default destination to the session working directory for easy file read-back by the agent. It provides 8 tools, a sidebar queue panel, and shell download interception — an adapter, not a new downloader. Ideal for scenarios where the agent and desktop app need to share a download queue and manage download progress uniformly.
- Plugin directory page: https://www.skillhub.cn/plugins/a-molecule-of-ATP/dsh-ghost-download
- GitHub repository: https://github.com/a-molecule-of-ATP/dsh-ghost-download