rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Lemon140339/dsh-ghost-downloader
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
A DeepSeek Harness plugin that downloads files for a session over the faster of
two paths: the local Ghost Downloader (multi-connection, resumable, visible in
its window) or a plain one-connection fetch inside the plugin. It registers a
ghost_download tool for every agent in the profile.
The plugin, its tests and this documentation were written in one session by
the deepseek-flash model inside DeepSeek Harness.
The problem. An agent that needs a real file — a model checkpoint, a dataset,
a video clip, an ISO — has no good way to get it inside a session. web_fetch
returns decoded text. Shelling out to curl gives you one connection, no resume,
no progress you can see, and a file that may land outside the workspace where
later reads are blocked. On many hosts a single connection is throttled to a
crawl; and the public GitHub mirrors that exist for blocked networks are slower
than GitHub itself whenever GitHub is reachable.
What changes.
ghost_download writes the file to disk and returns
its path and state, so the next step can use it instead of working around a
missing tool.What you get in practice. Downloads stop being a blocking shell command: a Ghost task keeps running while the conversation moves on, the agent can poll for "done" instead of guessing, and a broken route falls over to one that works instead of failing silently.
When it is not worth it. Files of a few megabytes from a fast host are fine
with plain curl. Tasks cannot be paused or cancelled through the agent — use
Ghost's window for that. And it is Windows-only, because Ghost Downloader is.
| OS | Windows 10 or 11 (Ghost Downloader is a Windows application) |
| Harness | DeepSeek Harness ^0.2.1-rc.3 — the plugin API surface it was written against is 0.2.2-rc.3 |
| Node | 20 or newer, as bundled in the Harness |
| Downloader | Ghost Downloader 4.5.x, aria2 RPC enabled (the default), GitHub acceleration optional |
engines.dsh in package.json is enforced by the plugin manager: installing on
an older Harness is refused rather than silently half-working.
This is a DeepSeek Harness bundle installed from its directory; it is not published on npm.
git clone https://github.com/Lemon140339/dsh-ghost-downloaderghost_download is now available to every agent in the
profile.Requires Ghost Downloader installed, with its aria2 RPC enabled (the default).
The plugin finds the executable itself; set ghostExe only for an unusual
layout.
To disable it, switch the bundle off in Plugins; to remove it, delete the bundle there and the cloned folder. Nothing is written into the downloader, so uninstalling leaves Ghost exactly as it was.
ghost_download { "action": "add", "urls": ["https://example.com/file.zip"] }.<session workspace>/downloads, and the file
is there with the expected size.{ "action": "list" } shows the task if Ghost handled it; status reports it
either way.via (which path was used).mode overrides the routing: auto (default), ghost, or direct.
Files land in <session workspace>/downloads unless dir says otherwise, and
the folder is created on demand. Ghost writes with its own OS account, so the
file appears directly in the workspace and later reads, moves and edits stay
inside the sandbox. Only per-task options (dir, out, header) are sent over
the RPC: the downloader's own configuration is never read, written or changed.
The status returned by add is the state observed when the task was
confirmed: small files are usually already COMPLETED, anything large is still
RUNNING. Follow with status or wait for the final state — a path is
usable only once it reports COMPLETED.
auto choosesGhost only wins when a server limits a single connection. When the link is
already saturated, Ghost's extra connections reach the same total and its
submission handoff is pure loss. So auto:
.m3u8 playlist → Ghost (only it can
handle those);autoGhostBytes (32 MiB) →
direct;autoGhostBytes → Ghost.GitHub gets its own rule. The downloader reaches GitHub through public mirror
proxies, which exist for networks where github.com is blocked or crawling — when
GitHub itself is reachable they are usually slower, and the downloader's eight
workers do not help much through them. So auto downloads from GitHub directly
and hands the link to the proxy chain only when that fails (connection error or
a transfer that stalls for 15 s). githubRoute pins the behaviour: auto
(default), ghost (always proxy), direct (never proxy).
The downloader ships its GitHub acceleration disabled (GitHub.Enabled in its
UserConfig.json); with it off, a link handed over is fetched directly, exactly
like this plugin's own path. The tool reads that switch (it never writes it) and
says so when a fallback runs while the switch is off.
A single connection usually already saturates a home link, so Ghost only matches
it there; the gain appears on hosts that throttle one connection, where extra
connections recover throughput (bounded by the host's per-IP limit, not by the
worker count). Below roughly 10 MiB, Ghost's fixed handoff cost dominates and it
loses outright. autoGhostBytes is the crossover knob; mode overrides the
guess per call when you know the host better than the heuristic.
A throughput probe was tried and rejected: sampling the first megabytes reads far below the sustained rate while CDN fill-in is still happening, so it misclassified fast mirrors as slow and routed them to Ghost. Size and ranged support are the reliable cheap signals.
ghost_download { "action": "add", "urls": ["https://example.com/big.iso"] }
ghost_download { "action": "status", "paths": ["./downloads/big.iso"] }
ghost_download { "action": "wait", "paths": ["./downloads/big.iso"], "timeoutMs": 90000 }
ghost_download { "action": "add", "urls": ["https://example.com/a.zip"], "mode": "ghost" }
ghost_download { "action": "add", "urls": ["https://example.com/a.zip"], "dir": "C:/Downloads" }
ghost_download { "action": "add", "urls": ["https://example.com/private.bin"], "headers": { "Referer": "https://example.com/" } }
Paths may be absolute or relative to the session workspace.
Set these on the plugin's row in the profile patch; every key has a working default.
| key | default | meaning |
|---|---|---|
rpcPort |
16800 |
Ghost's Aria2Rpc.Port |
rpcHost |
127.0.0.1 |
RPC host |
ghostExe |
auto-detected | executable used when the port is silent |
autoLaunch |
true |
start Ghost instead of failing |
defaultDirName |
downloads |
folder created under the session workspace |
autoGhostBytes |
33554432 (32 MiB) |
size at or above which auto considers Ghost |
githubRoute |
auto |
auto = direct first, proxy chain on failure; ghost = always proxy; direct = never proxy |
launchTimeoutMs |
30000 |
how long to wait for a started Ghost |
maxWaitMs |
120000 |
upper bound for one wait call |
dataDir |
%LOCALAPPDATA%\GhostDownloader |
where Ghost keeps tasks.jsonl and its log |
ledgerPath / logPath |
derived from dataDir |
individual overrides |
confirmMs |
6000 |
window for confirming that Ghost created a task |
With ghostExe empty the plugin looks, in order:
HKLM 64-bit, HKLM 32-bit, HKCU)
whose DisplayName mentions Ghost Downloader — its InstallLocation;%ProgramFiles%,
%ProgramFiles(x86)%, %LOCALAPPDATA%, %APPDATA%, each with
Ghost Downloader, Programs\Ghost Downloader and GhostDownloader
appended;Ghost-Downloader-3.exe or the first
Ghost-Downloader*.exe.If nothing is found, the tool reports that and asks for ghostExe instead of
guessing. Point dataDir at a nonstandard location when Ghost was installed in
portable mode, and rpcPort when Aria2Rpc.Port was changed in
UserConfig.json.
tasks.jsonl (task status), its
GhostDownloader.log (why a submission was refused), and UserConfig.json
(only the GitHub.Enabled switch, to explain a fallback).127.0.0.1:<rpcPort> for Ghost's RPC.autoLaunch is on; never stops it.| symptom | likely cause | what to do |
|---|---|---|
Ghost Downloader is not answering on 127.0.0.1:16800 |
Ghost is not running and autoLaunch is off |
start Ghost, or set autoLaunch: true |
could not find its executable |
unusual install location or portable setup | set ghostExe (and dataDir if needed) |
status stays RUNNING and wait times out |
Ghost keeps retrying a broken connection | check the link in Ghost's window; it may resume by itself |
| GitHub download falls back and still fails | GitHub unreachable and Ghost's GitHub acceleration is off | enable it in Ghost's settings, or set githubRoute: "ghost" |
| no percentage while a task runs | Ghost rewrites its ledger only on state changes | expect status only; progress appears when the task finishes |
| Windows toast "链接解析失败" from Ghost | Ghost's own notification for a failed link | rejections for 404/410 are pre-screened; for other failures adjust Ghost's Notice settings |
aria2.getVersion and aria2.addUri. The
tool cannot pause, resume, cancel or remove a task, and status comes from
Ghost's ledger rather than the RPC. Use Ghost's window for task control.FAILED
with that log message. A submission whose task never appears is UNKNOWN, not
a fake success..ghd sidecar marks an unfinished task, and the ledger
is rewritten only on state changes, so there is no live percentage to report.direct path has no resume: a dropped connection loses that file's
progress. Files it writes are invisible to list (they are not Ghost tasks),
though status still reports them from the filesystem. A transfer with no
data for 15 s is aborted rather than left waiting.node test/routing.test.mjs # routing rules, no network
node test/tool.test.mjs # tool layer, needs the local test server
node test/verify.mjs # Ghost client, needs Ghost running + the test server
node test/bench.mjs # optional three-way speed comparison
python test/serve.py 18080 # local ranged file server for the tests above
See CHANGELOG.md.
MIT. See LICENSE.
Not affiliated with the Ghost Downloader project; this plugin only talks to its local aria2-compatible JSON-RPC endpoint.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。