dsh-transfer-dock 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/README.zh.md +25 -25
- package/client.js +11 -11
- package/cordis.patch.yml +1 -1
- package/docs/architecture.svg +4 -4
- package/docs/banner.svg +6 -6
- package/index.js +8 -8
- package/package.json +4 -4
- package/test/smoke.mjs +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p align="right"><b>English</b> · <a href="README.zh.md">中文</a></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
4
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/banner.svg" width="100%" alt="dsh-transfer-dock — live download cards in the corner of the DeepSeek Harness UI">
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
<img src="https://img.shields.io/badge/node-%E2%89%A520-3c873a?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >= 20">
|
|
10
10
|
<img src="https://img.shields.io/badge/dsh-0.2.0--rc.1%2B-7c5cff?style=flat-square" alt="DeepSeek Harness >= 0.2.0-rc.1">
|
|
11
11
|
<img src="https://img.shields.io/badge/tests-smoke%20%C2%B7%20offline-22d3ee?style=flat-square" alt="Tests: offline smoke">
|
|
12
|
-
<img src="https://img.shields.io/badge/version-0.1.
|
|
12
|
+
<img src="https://img.shields.io/badge/version-0.1.1-6d4aff?style=flat-square" alt="Version 0.1.1">
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
16
|
<b>A background download shouldn't be one word: "Running".</b><br>
|
|
17
|
-
<sub>dsh-
|
|
17
|
+
<sub>dsh-transfer-dock grows a live card in the bottom-right corner: file, progress, bytes, speed and ETA.</sub>
|
|
18
18
|
</p>
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
<p align="center">
|
|
23
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
24
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
23
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/card-fill.png" width="46%" alt="A card with a known total: 32% · curl">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/card-stripes.png" width="46%" alt="An indeterminate card: moving stripes, bytes written">
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
27
|
<p align="center">
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
> You start a 2 GB model download in Harness and it goes to the background. The corner of the UI says nothing; the job row says "Running".
|
|
32
32
|
> You can't tell whether it's downloading at full speed, stuck on DNS, or already dead.
|
|
33
33
|
>
|
|
34
|
-
> dsh-
|
|
34
|
+
> dsh-transfer-dock turns those forty seconds into one card: **file name, 32%, 4.14 MB / 12.9 MB, 148 KB/s, 59s left**.
|
|
35
35
|
> No second window, no wrapped commands, no takeover — it observes and draws the result where you are already looking.
|
|
36
36
|
|
|
37
37
|
## Contents
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
Harness pushes download commands into background jobs (`run_in_background: true`) so they don't block the turn. The cost: the UI keeps a single status row, and the next real signal is a completion notice a dozen seconds later. Everything in between is invisible.
|
|
61
61
|
|
|
62
|
-
dsh-
|
|
62
|
+
dsh-transfer-dock fills that gap, and it **only observes**:
|
|
63
63
|
|
|
64
64
|
| It does | It doesn't |
|
|
65
65
|
|---|---|
|
|
@@ -77,7 +77,7 @@ A card is 366 px wide (clamped to `100vw - 36px` on narrow screens), fixed 18 px
|
|
|
77
77
|
| Part | Content | Notes |
|
|
78
78
|
|---|---|---|
|
|
79
79
|
| Tool badge | `git` / `py` / `npm` / `a2` / `c` / `w` / `web` / `app` / `rs` / `go` / `dk` | Derived from the detected tool |
|
|
80
|
-
| Title | File, repo or package name | e.g. `numpy-2.2.6-cp310-win_amd64.whl`, `dsh-
|
|
80
|
+
| Title | File, repo or package name | e.g. `numpy-2.2.6-cp310-win_amd64.whl`, `dsh-transfer-dock`, `lodash`; falls back to the first 60 characters of the command |
|
|
81
81
|
| Subtitle | Byte progress or status text | `4.14 MB / 12.9 MB`, `12.4 MB written`, `Completed`, `Download failed`, `Cancelled`, `Stopping…` |
|
|
82
82
|
| Bar | Filled bar or moving stripes | Filled when the total is known; stripes otherwise (see [Stripes are not a bug](#stripes-are-not-a-bug)) |
|
|
83
83
|
| Bottom left | Percentage + tool | The tool alone means indeterminate |
|
|
@@ -101,7 +101,7 @@ The `✕` button only removes the card from the current page — **it never stop
|
|
|
101
101
|
The plugin is split into two halves that talk over a single read-only JSON route:
|
|
102
102
|
|
|
103
103
|
<p align="center">
|
|
104
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
104
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/architecture.svg" width="100%" alt="dsh-transfer-dock data flow: download tools → Host sampling → JSON state → browser card">
|
|
105
105
|
</p>
|
|
106
106
|
|
|
107
107
|
| Half | Files | Runtime | Responsibility |
|
|
@@ -132,7 +132,7 @@ flowchart LR
|
|
|
132
132
|
4. If the command contains exactly one HTTP(S) URL, the Host sends a `HEAD` request and reads `content-length` as the total.
|
|
133
133
|
5. Every 700 ms the Host samples only the **delta**, so pre-existing files never count as part of this download.
|
|
134
134
|
6. After the job ends, the Host keeps returning it for 12 seconds (`settledTtlMs`) so the browser can render the final state.
|
|
135
|
-
7. The browser fetches `/plugin/dsh-
|
|
135
|
+
7. The browser fetches `/plugin/dsh-transfer-dock/state` every 600 ms and pauses while the page is hidden.
|
|
136
136
|
8. The browser merges disk bytes with the downloader's own progress lines, renders the card, and fades finished cards out after 2.6 seconds.
|
|
137
137
|
|
|
138
138
|
## Three data sources
|
|
@@ -279,19 +279,19 @@ The plugin is listed in the [awesome-dsh-plugin](https://github.com/awesome-dsh-
|
|
|
279
279
|
### From the CLI
|
|
280
280
|
|
|
281
281
|
```powershell
|
|
282
|
-
dsh plugin --profile desktop add github:imnotRiv3r/dsh-
|
|
282
|
+
dsh plugin --profile desktop add github:imnotRiv3r/dsh-transfer-dock
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
That one command is the whole install: it adds the dependency to the profile's `package.json` and appends `dsh-
|
|
285
|
+
That one command is the whole install: it adds the dependency to the profile's `package.json` and appends `dsh-transfer-dock` to `dsh.profile.bundles`. There is no npm package — the GitHub source is the only release channel. To pin a commit:
|
|
286
286
|
|
|
287
287
|
```powershell
|
|
288
|
-
dsh plugin --profile desktop add github:imnotRiv3r/dsh-
|
|
288
|
+
dsh plugin --profile desktop add github:imnotRiv3r/dsh-transfer-dock#b2404e2
|
|
289
289
|
```
|
|
290
290
|
|
|
291
291
|
Uninstall is symmetric — it drops the dependency and the `bundles` row together:
|
|
292
292
|
|
|
293
293
|
```powershell
|
|
294
|
-
dsh plugin --profile desktop remove dsh-
|
|
294
|
+
dsh plugin --profile desktop remove dsh-transfer-dock
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
The repo has no build step (no `prepare`/`install` script, and `exports` points straight at the source), so the first install does not raise pnpm's `allowBuilds` prompt.
|
|
@@ -299,12 +299,12 @@ The repo has no build step (no `prepare`/`install` script, and `exports` points
|
|
|
299
299
|
### Link a local checkout (development)
|
|
300
300
|
|
|
301
301
|
```powershell
|
|
302
|
-
dsh plugin --profile desktop add 'link:E:\dshWorkspace\dsh-
|
|
302
|
+
dsh plugin --profile desktop add 'link:E:\dshWorkspace\dsh-transfer-dock'
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
The profile now points at your checkout, so edits are live: the Host half hot-reloads with the profile, the browser half needs one page refresh. pnpm warns that a `link:` dependency does not resolve `peerDependencies` from the target — the only one this package declares is `@deepseek-ai/schemastery`, which a DSH profile already provides through `@deepseek-ai/dsh-base`.
|
|
306
306
|
|
|
307
|
-
Prefer a frozen copy, where edits require re-running the command? Use `file:E:\dshWorkspace\dsh-
|
|
307
|
+
Prefer a frozen copy, where edits require re-running the command? Use `file:E:\dshWorkspace\dsh-transfer-dock` instead of `link:...`.
|
|
308
308
|
|
|
309
309
|
### What reloads when
|
|
310
310
|
|
|
@@ -322,13 +322,13 @@ Prefer a frozen copy, where edits require re-running the command? Use `file:E:\d
|
|
|
322
322
|
|
|
323
323
|
```powershell
|
|
324
324
|
# Is the Host half alive? `hits` grows once the browser half attaches (use your DSH Web port).
|
|
325
|
-
Invoke-RestMethod http://127.0.0.1:2482/plugin/dsh-
|
|
325
|
+
Invoke-RestMethod http://127.0.0.1:2482/plugin/dsh-transfer-dock/state
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
A healthy response looks like:
|
|
329
329
|
|
|
330
330
|
```json
|
|
331
|
-
{ "version": 1, "now": 1731427200000, "tasks": [], "poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.
|
|
331
|
+
{ "version": 1, "now": 1731427200000, "tasks": [], "poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.1" } }
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
Now trigger a visible download (rate-limited to 300 KB/s so the card has time to appear):
|
|
@@ -342,11 +342,11 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
342
342
|
|
|
343
343
|
## Config
|
|
344
344
|
|
|
345
|
-
The row id is `
|
|
345
|
+
The row id is `transfer-dock`; edit it in the profile's `cordis.patch.yml`:
|
|
346
346
|
|
|
347
347
|
```yaml
|
|
348
|
-
- id:
|
|
349
|
-
name: dsh-
|
|
348
|
+
- id: transfer-dock
|
|
349
|
+
name: dsh-transfer-dock
|
|
350
350
|
config:
|
|
351
351
|
enabled: true
|
|
352
352
|
guidePrompt: true
|
|
@@ -373,7 +373,7 @@ With `guidePrompt` on, the plugin injects a short system-prompt section: **for d
|
|
|
373
373
|
|
|
374
374
|
## The state route
|
|
375
375
|
|
|
376
|
-
`GET /plugin/dsh-
|
|
376
|
+
`GET /plugin/dsh-transfer-dock/state` returns a read-only JSON snapshot (`cache-control: no-store`):
|
|
377
377
|
|
|
378
378
|
```json
|
|
379
379
|
{
|
|
@@ -397,7 +397,7 @@ With `guidePrompt` on, the plugin injects a short system-prompt section: **for d
|
|
|
397
397
|
"source": "temp"
|
|
398
398
|
}
|
|
399
399
|
],
|
|
400
|
-
"poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.
|
|
400
|
+
"poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.1" }
|
|
401
401
|
}
|
|
402
402
|
```
|
|
403
403
|
|
|
@@ -428,7 +428,7 @@ For debugging, add `?diag=...` to the URL: the value is truncated to 4000 charac
|
|
|
428
428
|
|---|---|---|
|
|
429
429
|
| No card at all | Not a background job | Use `run_in_background: true`; foreground downloads never show a card |
|
|
430
430
|
| | Command doesn't look like a download | Check it against the list above; `npm run build` and `git status` don't count |
|
|
431
|
-
| | Browser half not loaded | Refresh the page; confirm `dsh-
|
|
431
|
+
| | Browser half not loaded | Refresh the page; confirm `dsh-transfer-dock` is in `bundles` |
|
|
432
432
|
| | Plugin disabled | Check `enabled`; look for `disabled by config` in the Host log |
|
|
433
433
|
| | `webServer` not ready | The plugin retries every 500 ms, 20 times; after that you'll see `webServer never became available` |
|
|
434
434
|
| Card appears but bytes stay at 0 | Download doesn't hit disk, or lands somewhere unresolved | Use an explicit `-o` / `-OutFile`; make sure `$var` paths expand to real absolute paths |
|
|
@@ -465,8 +465,8 @@ Three-state diagnosis with `poll.hits`:
|
|
|
465
465
|
## Development
|
|
466
466
|
|
|
467
467
|
```powershell
|
|
468
|
-
git clone https://github.com/imnotRiv3r/dsh-
|
|
469
|
-
cd dsh-
|
|
468
|
+
git clone https://github.com/imnotRiv3r/dsh-transfer-dock.git
|
|
469
|
+
cd dsh-transfer-dock
|
|
470
470
|
|
|
471
471
|
node test/smoke.mjs # detection, parsing, merging, browser-half registration — fully offline
|
|
472
472
|
npm run check # node --check on every source file
|
package/README.zh.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p align="right"><a href="README.md">English</a> · <b>中文</b></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
4
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/banner.svg" width="100%" alt="dsh-transfer-dock — 在 DeepSeek Harness 右下角显示实时下载卡片">
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<img src="https://img.shields.io/badge/node-%E2%89%A520-3c873a?style=flat-square&logo=nodedotjs&logoColor=white" alt="Node.js >= 20">
|
|
10
10
|
<img src="https://img.shields.io/badge/dsh-0.2.0--rc.1%2B-7c5cff?style=flat-square" alt="DeepSeek Harness >= 0.2.0-rc.1">
|
|
11
11
|
<img src="https://img.shields.io/badge/tests-smoke%20%C2%B7%20offline-22d3ee?style=flat-square" alt="Tests: offline smoke">
|
|
12
|
-
<img src="https://img.shields.io/badge/version-0.1.
|
|
12
|
+
<img src="https://img.shields.io/badge/version-0.1.1-6d4aff?style=flat-square" alt="Version 0.1.1">
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
---
|
|
21
21
|
|
|
22
22
|
<p align="center">
|
|
23
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
24
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
23
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/card-fill.png" width="46%" alt="知道总量时的下载卡片:32% · curl">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/card-stripes.png" width="46%" alt="不确定态卡片:条纹流动,显示已写入字节">
|
|
25
25
|
</p>
|
|
26
26
|
|
|
27
27
|
<p align="center">
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
> 你在 Harness 里起了一个 2 GB 的模型下载,命令进了后台。界面右下角什么都没有,任务行只写着「Running」。
|
|
32
32
|
> 你不知道它是在全速下载、被 DNS 卡住、还是早就停了。
|
|
33
33
|
>
|
|
34
|
-
> dsh-
|
|
34
|
+
> dsh-transfer-dock 把那几十秒变成一张卡片:**文件名、32%、4.14 MB / 12.9 MB、148 KB/s、剩 59s**。
|
|
35
35
|
> 不另开窗口、不改下载命令、不接管任务——它只是观察,然后把观察结果画在你正在看的地方。
|
|
36
36
|
|
|
37
37
|
## 目录
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
Harness 的下载类命令经常被放进后台任务(`run_in_background: true`),这样它不会锁住当前回合;代价是界面只剩一行任务状态。十几秒后才有一行结束通知,中间发生了什么完全不可见。
|
|
61
61
|
|
|
62
|
-
dsh-
|
|
62
|
+
dsh-transfer-dock 补上的正是这段盲区,并且**只做观察**:
|
|
63
63
|
|
|
64
64
|
| 它做 | 它不做 |
|
|
65
65
|
|---|---|
|
|
@@ -77,7 +77,7 @@ dsh-download-dock 补上的正是这段盲区,并且**只做观察**:
|
|
|
77
77
|
| 元素 | 内容 | 说明 |
|
|
78
78
|
|---|---|---|
|
|
79
79
|
| 工具徽标 | `git` / `py` / `npm` / `a2` / `c` / `w` / `web` / `app` / `rs` / `go` / `dk` | 由识别到的工具决定,渐变底色 + 小号字母 |
|
|
80
|
-
| 标题 | 文件名、仓库名或包名 | `numpy-2.2.6-cp310-win_amd64.whl`、`dsh-
|
|
80
|
+
| 标题 | 文件名、仓库名或包名 | `numpy-2.2.6-cp310-win_amd64.whl`、`dsh-transfer-dock`、`lodash`;取不到时退化为命令首行前 60 字符 |
|
|
81
81
|
| 副标题 | 字节进度或状态文本 | `4.14 MB / 12.9 MB`、`已写入 12.4 MB`、`已完成`、`下载失败`、`已取消`、`正在停止…` |
|
|
82
82
|
| 进度条 | 填充条或流动条纹 | 有总量 → 填充百分比;无总量 → 条纹(见[条纹不是坏掉](#条纹不是坏掉)) |
|
|
83
83
|
| 左下 | 百分比 + 工具名 | 只有工具名时说明处于不确定态 |
|
|
@@ -101,7 +101,7 @@ dsh-download-dock 补上的正是这段盲区,并且**只做观察**:
|
|
|
101
101
|
插件分成两个半区,它们之间只通过一条只读 JSON 路由通信:
|
|
102
102
|
|
|
103
103
|
<p align="center">
|
|
104
|
-
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-
|
|
104
|
+
<img src="https://raw.githubusercontent.com/imnotRiv3r/dsh-transfer-dock/main/docs/architecture.svg" width="100%" alt="dsh-transfer-dock 数据流:下载工具 → Host 采样 → JSON 状态 → 浏览器卡片">
|
|
105
105
|
</p>
|
|
106
106
|
|
|
107
107
|
| 半区 | 文件 | 运行环境 | 职责 |
|
|
@@ -132,7 +132,7 @@ flowchart LR
|
|
|
132
132
|
4. 若命令里只有一个 HTTP(S) URL,Host 发一次 `HEAD` 读 `content-length`,补上总量。
|
|
133
133
|
5. 每 700 ms 采样一次;只算增量,所以目录里的旧文件不会被算进来。
|
|
134
134
|
6. 任务结束后,Host 继续返回该任务 12 秒(`settledTtlMs`),让浏览器有时间渲染收尾状态。
|
|
135
|
-
7. 浏览器每 600 ms 拉一次 `/plugin/dsh-
|
|
135
|
+
7. 浏览器每 600 ms 拉一次 `/plugin/dsh-transfer-dock/state`;页面隐藏时暂停轮询。
|
|
136
136
|
8. 浏览器把「磁盘字节」和「job 输出里下载器自己报的进度」合并,渲染卡片;结束的卡片在 2.6 秒后淡出。
|
|
137
137
|
|
|
138
138
|
## 三条数据通路
|
|
@@ -279,19 +279,19 @@ flowchart LR
|
|
|
279
279
|
### 从命令行安装
|
|
280
280
|
|
|
281
281
|
```powershell
|
|
282
|
-
dsh plugin --profile desktop add github:imnotRiv3r/dsh-
|
|
282
|
+
dsh plugin --profile desktop add github:imnotRiv3r/dsh-transfer-dock
|
|
283
283
|
```
|
|
284
284
|
|
|
285
|
-
这一条命令就是完整安装:把依赖写进 profile 的 `package.json`,并把 `dsh-
|
|
285
|
+
这一条命令就是完整安装:把依赖写进 profile 的 `package.json`,并把 `dsh-transfer-dock` 追加到 `dsh.profile.bundles`。本插件没有 npm 包,GitHub 源是唯一发布渠道。需要固定 commit 时:
|
|
286
286
|
|
|
287
287
|
```powershell
|
|
288
|
-
dsh plugin --profile desktop add github:imnotRiv3r/dsh-
|
|
288
|
+
dsh plugin --profile desktop add github:imnotRiv3r/dsh-transfer-dock#b2404e2
|
|
289
289
|
```
|
|
290
290
|
|
|
291
291
|
卸载是对称的——依赖与 `bundles` 行会一起移除:
|
|
292
292
|
|
|
293
293
|
```powershell
|
|
294
|
-
dsh plugin --profile desktop remove dsh-
|
|
294
|
+
dsh plugin --profile desktop remove dsh-transfer-dock
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
仓库没有构建步骤(没有 `prepare`/`install` 脚本,`exports` 直接指向源码),所以首次安装不会触发 pnpm 的 `allowBuilds` 审批。
|
|
@@ -299,12 +299,12 @@ dsh plugin --profile desktop remove dsh-download-dock
|
|
|
299
299
|
### 链接本地目录(开发)
|
|
300
300
|
|
|
301
301
|
```powershell
|
|
302
|
-
dsh plugin --profile desktop add 'link:E:\dshWorkspace\dsh-
|
|
302
|
+
dsh plugin --profile desktop add 'link:E:\dshWorkspace\dsh-transfer-dock'
|
|
303
303
|
```
|
|
304
304
|
|
|
305
305
|
之后 profile 指向你的工作副本,改动即时生效:Host 半随 profile 热加载,浏览器半需要刷新一次页面。pnpm 会警告 `link:` 依赖不会从目标解析 `peerDependencies`——本包只声明了 `@deepseek-ai/schemastery`,而 DSH profile 已通过 `@deepseek-ai/dsh-base` 提供它。
|
|
306
306
|
|
|
307
|
-
如果你想要一份冻结的副本(改动后需重跑命令),把 `link:...` 换成 `file:E:\dshWorkspace\dsh-
|
|
307
|
+
如果你想要一份冻结的副本(改动后需重跑命令),把 `link:...` 换成 `file:E:\dshWorkspace\dsh-transfer-dock`。
|
|
308
308
|
|
|
309
309
|
### 生效顺序
|
|
310
310
|
|
|
@@ -322,13 +322,13 @@ dsh plugin --profile desktop add 'link:E:\dshWorkspace\dsh-download-dock'
|
|
|
322
322
|
|
|
323
323
|
```powershell
|
|
324
324
|
# Host 半是否活着(浏览器半挂上后 hits 会持续增长;端口以你的 DSH Web 实例为准)
|
|
325
|
-
Invoke-RestMethod http://127.0.0.1:2482/plugin/dsh-
|
|
325
|
+
Invoke-RestMethod http://127.0.0.1:2482/plugin/dsh-transfer-dock/state
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
正常输出长这样:
|
|
329
329
|
|
|
330
330
|
```json
|
|
331
|
-
{ "version": 1, "now": 1731427200000, "tasks": [], "poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.
|
|
331
|
+
{ "version": 1, "now": 1731427200000, "tasks": [], "poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.1" } }
|
|
332
332
|
```
|
|
333
333
|
|
|
334
334
|
再触发一次可见的下载(限速 300 KB/s,让卡片有足够时间出现):
|
|
@@ -342,11 +342,11 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
342
342
|
|
|
343
343
|
## 配置
|
|
344
344
|
|
|
345
|
-
行 id 是 `
|
|
345
|
+
行 id 是 `transfer-dock`,在 profile 的 `cordis.patch.yml` 里改:
|
|
346
346
|
|
|
347
347
|
```yaml
|
|
348
|
-
- id:
|
|
349
|
-
name: dsh-
|
|
348
|
+
- id: transfer-dock
|
|
349
|
+
name: dsh-transfer-dock
|
|
350
350
|
config:
|
|
351
351
|
enabled: true
|
|
352
352
|
guidePrompt: true
|
|
@@ -373,7 +373,7 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
373
373
|
|
|
374
374
|
## 状态接口
|
|
375
375
|
|
|
376
|
-
`GET /plugin/dsh-
|
|
376
|
+
`GET /plugin/dsh-transfer-dock/state` 返回一份只读 JSON 快照(`cache-control: no-store`):
|
|
377
377
|
|
|
378
378
|
```json
|
|
379
379
|
{
|
|
@@ -397,7 +397,7 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
397
397
|
"source": "temp"
|
|
398
398
|
}
|
|
399
399
|
],
|
|
400
|
-
"poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.
|
|
400
|
+
"poll": { "hits": 412, "lastHitAt": 1731427200000, "build": "0.1.1" }
|
|
401
401
|
}
|
|
402
402
|
```
|
|
403
403
|
|
|
@@ -428,7 +428,7 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
428
428
|
|---|---|---|
|
|
429
429
|
| 一张卡片都没有 | 命令不是后台任务 | 用 `run_in_background: true`;前台下载永远不会出卡片 |
|
|
430
430
|
| | 命令不像下载 | 检查命令是否在识别清单内;`npm run build`、`git status` 不算下载 |
|
|
431
|
-
| | 浏览器半没加载 | 刷新页面;确认 `bundles` 里有 `dsh-
|
|
431
|
+
| | 浏览器半没加载 | 刷新页面;确认 `bundles` 里有 `dsh-transfer-dock` |
|
|
432
432
|
| | 插件被关闭 | 检查 `enabled`;看 Host 日志是否出现 `disabled by config` |
|
|
433
433
|
| | `webServer` 未就绪 | 插件会以 500 ms 间隔重试 20 次;超时后日志里会有 `webServer never became available` |
|
|
434
434
|
| 卡片有,但字节一直是 0 | 下载不落盘或落到未解析路径 | 命令里显式用 `-o` / `-OutFile`;带 `$var` 的路径要确保能展开成真实绝对路径 |
|
|
@@ -465,8 +465,8 @@ curl.exe -L -# --limit-rate 300k -o "$env:TEMP\probe.bin" `
|
|
|
465
465
|
## 开发
|
|
466
466
|
|
|
467
467
|
```powershell
|
|
468
|
-
git clone https://github.com/imnotRiv3r/dsh-
|
|
469
|
-
cd dsh-
|
|
468
|
+
git clone https://github.com/imnotRiv3r/dsh-transfer-dock.git
|
|
469
|
+
cd dsh-transfer-dock
|
|
470
470
|
|
|
471
471
|
node test/smoke.mjs # 识别、解析、合并、浏览器半注册;完全离线
|
|
472
472
|
npm run check # 对每个源文件跑 node --check
|
package/client.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 浏览器半:右下角的下载进度卡片。
|
|
3
3
|
*
|
|
4
|
-
* 数据有两路:Host 的 `/plugin/dsh-
|
|
4
|
+
* 数据有两路:Host 的 `/plugin/dsh-transfer-dock/state` 给出「哪些后台任务是下载、
|
|
5
5
|
* 已经写了多少字节、当前速度」;job 输出流给出下载器自己打的百分比(git、
|
|
6
6
|
* aria2、curl -# 等)。两路合起来:有百分比就用百分比,没有就用字节曲线。
|
|
7
7
|
*
|
|
8
|
-
* @module dsh-
|
|
8
|
+
* @module dsh-transfer-dock/client
|
|
9
9
|
*/
|
|
10
10
|
window.__ModuleLoader__.load({
|
|
11
|
-
id: 'dsh-
|
|
11
|
+
id: 'dsh-transfer-dock',
|
|
12
12
|
factory(require) {
|
|
13
13
|
const React = require('react')
|
|
14
14
|
const h = React.createElement
|
|
15
15
|
|
|
16
|
-
const STATE_PATH = '/plugin/dsh-
|
|
16
|
+
const STATE_PATH = '/plugin/dsh-transfer-dock/state'
|
|
17
17
|
const POLL_MS = 600
|
|
18
18
|
const FADE_MS = 2600
|
|
19
19
|
const MIN_LIVE_MS = 500
|
|
@@ -54,7 +54,7 @@ window.__ModuleLoader__.load({
|
|
|
54
54
|
boxShadow: '0 18px 40px -18px rgba(0, 0, 0, .55), 0 2px 8px -2px rgba(0, 0, 0, .25)',
|
|
55
55
|
backdropFilter: 'blur(12px) saturate(140%)',
|
|
56
56
|
padding: '11px 12px 12px',
|
|
57
|
-
animation: 'dsh-
|
|
57
|
+
animation: 'dsh-transfer-dock-in 180ms ease-out both',
|
|
58
58
|
fontFamily: 'inherit',
|
|
59
59
|
},
|
|
60
60
|
head: { display: 'flex', alignItems: 'center', gap: 9, marginBottom: 9 },
|
|
@@ -127,7 +127,7 @@ window.__ModuleLoader__.load({
|
|
|
127
127
|
backgroundImage:
|
|
128
128
|
'repeating-linear-gradient(115deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 78%, transparent) 0 12px, color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, transparent) 12px 24px)',
|
|
129
129
|
backgroundSize: '24px 100%',
|
|
130
|
-
animation: 'dsh-
|
|
130
|
+
animation: 'dsh-transfer-dock-stripes 900ms linear infinite',
|
|
131
131
|
},
|
|
132
132
|
meta: {
|
|
133
133
|
display: 'flex',
|
|
@@ -149,8 +149,8 @@ window.__ModuleLoader__.load({
|
|
|
149
149
|
wordBreak: 'break-word',
|
|
150
150
|
},
|
|
151
151
|
keyframes: [
|
|
152
|
-
'@keyframes dsh-
|
|
153
|
-
'@keyframes dsh-
|
|
152
|
+
'@keyframes dsh-transfer-dock-in{from{opacity:0;transform:translateY(10px) scale(.99)}to{opacity:1;transform:none}}',
|
|
153
|
+
'@keyframes dsh-transfer-dock-stripes{from{background-position:0 0}to{background-position:24px 0}}',
|
|
154
154
|
].join(''),
|
|
155
155
|
}
|
|
156
156
|
|
|
@@ -460,7 +460,7 @@ window.__ModuleLoader__.load({
|
|
|
460
460
|
|
|
461
461
|
// 注入一次动画关键帧。
|
|
462
462
|
React.useEffect(() => {
|
|
463
|
-
const id = 'dsh-
|
|
463
|
+
const id = 'dsh-transfer-dock-style'
|
|
464
464
|
if (document.getElementById(id) !== null) return
|
|
465
465
|
const style = document.createElement('style')
|
|
466
466
|
style.id = id
|
|
@@ -534,7 +534,7 @@ window.__ModuleLoader__.load({
|
|
|
534
534
|
}
|
|
535
535
|
if (cards.length === 0) return null
|
|
536
536
|
// 挂到 body:插槽容器上的 transform / overflow 会让 position: fixed 失效或被裁剪。
|
|
537
|
-
const panel = h('div', { style: S.wrap, className: 'dsh-
|
|
537
|
+
const panel = h('div', { style: S.wrap, className: 'dsh-transfer-dock' }, cards)
|
|
538
538
|
if (ReactDOM !== null) return ReactDOM.createPortal(panel, document.body)
|
|
539
539
|
return panel
|
|
540
540
|
}
|
|
@@ -670,7 +670,7 @@ window.__ModuleLoader__.load({
|
|
|
670
670
|
ctx.slots.register(
|
|
671
671
|
{
|
|
672
672
|
name: 'shell.overlay',
|
|
673
|
-
id: 'dsh-
|
|
673
|
+
id: 'dsh-transfer-dock',
|
|
674
674
|
order: 60,
|
|
675
675
|
inject: () => ({ jobs: ctx.jobs }),
|
|
676
676
|
},
|
package/cordis.patch.yml
CHANGED
package/docs/architecture.svg
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="740" viewBox="0 0 1280 740" role="img" aria-label="dsh-
|
|
2
|
-
<title>dsh-
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="740" viewBox="0 0 1280 740" role="img" aria-label="dsh-transfer-dock data flow: download tools feed the Host sampler, a JSON state route, and the browser card">
|
|
2
|
+
<title>dsh-transfer-dock · data flow</title>
|
|
3
3
|
<defs>
|
|
4
4
|
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
5
5
|
<stop offset="0" stop-color="#08080f"/>
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
<text x="376" y="530" class="mono" font-size="10.5" fill="#8f8ba8">snapshot() → { version: 1, now, tasks[] }</text>
|
|
110
110
|
<rect x="376" y="540" width="360" height="16" rx="4" fill="#7c5cff" fill-opacity="0.16"/>
|
|
111
|
-
<text x="392" y="552" class="mono" font-size="9.5" fill="#c4b5fd">GET /plugin/dsh-
|
|
111
|
+
<text x="392" y="552" class="mono" font-size="9.5" fill="#c4b5fd">GET /plugin/dsh-transfer-dock/state</text>
|
|
112
112
|
</g>
|
|
113
113
|
|
|
114
114
|
<!-- 右列:浏览器 -->
|
|
@@ -174,6 +174,6 @@
|
|
|
174
174
|
<text x="266" y="710" class="mono" font-size="10.5" fill="#b9b5ce">磁盘增量 ÷ HEAD 总量</text>
|
|
175
175
|
<text x="452" y="710" class="mono" font-size="10.5" fill="#6f6c86">→</text>
|
|
176
176
|
<text x="478" y="710" class="mono" font-size="10.5" fill="#b9b5ce">都没有:条纹不确定态</text>
|
|
177
|
-
<text x="1216" y="710" class="mono" font-size="10" fill="#6f6c86" text-anchor="end">dsh-
|
|
177
|
+
<text x="1216" y="710" class="mono" font-size="10" fill="#6f6c86" text-anchor="end">dsh-transfer-dock 0.1.1</text>
|
|
178
178
|
</g>
|
|
179
179
|
</svg>
|
package/docs/banner.svg
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="340" viewBox="0 0 1280 340" role="img" aria-label="dsh-
|
|
2
|
-
<title>dsh-
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="340" viewBox="0 0 1280 340" role="img" aria-label="dsh-transfer-dock — live download cards for DeepSeek Harness">
|
|
2
|
+
<title>dsh-transfer-dock</title>
|
|
3
3
|
<defs>
|
|
4
4
|
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
|
5
5
|
<stop offset="0" stop-color="#08080f"/>
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
<circle cx="80" cy="53" r="3.5" fill="#a78bfa"/>
|
|
65
65
|
<text x="92" y="57.5" class="mono" font-size="10.5" letter-spacing="2.2" fill="#b9b3d4">DEEPSEEK HARNESS · PLUGIN</text>
|
|
66
66
|
|
|
67
|
-
<text x="64" y="140" class="mono" font-size="68" font-weight="700" letter-spacing="-2.5" fill="#7c5cff" fill-opacity="0.38" filter="url(#softglow)">dsh-
|
|
68
|
-
<text x="64" y="140" class="mono" font-size="68" font-weight="700" letter-spacing="-2.5" fill="url(#title)">dsh-
|
|
67
|
+
<text x="64" y="140" class="mono" font-size="68" font-weight="700" letter-spacing="-2.5" fill="#7c5cff" fill-opacity="0.38" filter="url(#softglow)">dsh-transfer-dock</text>
|
|
68
|
+
<text x="64" y="140" class="mono" font-size="68" font-weight="700" letter-spacing="-2.5" fill="url(#title)">dsh-transfer-dock</text>
|
|
69
69
|
|
|
70
70
|
<text x="66" y="184" class="sans" font-size="25" font-weight="600" fill="#dedbf0">后台下载,看得见的每一字节</text>
|
|
71
71
|
<text x="66" y="212" class="mono" font-size="13" fill="#8f8ba8">bytes · speed · ETA · right in the corner of the UI</text>
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
<text x="599" y="255" class="chip" text-anchor="middle">winget</text>
|
|
90
90
|
</g>
|
|
91
91
|
|
|
92
|
-
<text x="66" y="306" class="mono" font-size="11" letter-spacing="0.6" fill="#7b7794">MIT · node ≥ 20 · dsh ≥ 0.2.0-rc.1 · github.com/imnotRiv3r/dsh-
|
|
92
|
+
<text x="66" y="306" class="mono" font-size="11" letter-spacing="0.6" fill="#7b7794">MIT · node ≥ 20 · dsh ≥ 0.2.0-rc.1 · github.com/imnotRiv3r/dsh-transfer-dock</text>
|
|
93
93
|
</g>
|
|
94
94
|
|
|
95
95
|
<!-- 右:卡片示意 -->
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
<text x="828" y="184" class="mono" font-size="12" fill="#cfcbdd">32% · curl</text>
|
|
120
120
|
<text x="1194" y="184" class="mono" font-size="12" text-anchor="end" fill="#8f8ca4">148 KB/s · 剩 59s · 40s</text>
|
|
121
121
|
|
|
122
|
-
<text x="828" y="214" class="mono" font-size="11" fill="#7f7b98">/plugin/dsh-
|
|
122
|
+
<text x="828" y="214" class="mono" font-size="11" fill="#7f7b98">/plugin/dsh-transfer-dock/state · 600 ms poll</text>
|
|
123
123
|
<text x="828" y="234" class="mono" font-size="11" fill="#7f7b98">host sampler 700 ms · disk delta + content-length</text>
|
|
124
124
|
|
|
125
125
|
<g stroke="#22d3ee" stroke-opacity="0.25" fill="none">
|
package/index.js
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* `ctx.webServer.register()` 暴露一个只读 JSON 路由给同源的 Web GUI。
|
|
6
6
|
* 插件只观察 job 注册表,不消费模型游标、不改变任务状态。
|
|
7
7
|
*
|
|
8
|
-
* @module dsh-
|
|
8
|
+
* @module dsh-transfer-dock
|
|
9
9
|
*/
|
|
10
10
|
import z from '@deepseek-ai/schemastery'
|
|
11
11
|
import { DiskSampler } from './lib/sampler.js'
|
|
12
12
|
import { DownloadTracker } from './lib/tracker.js'
|
|
13
13
|
|
|
14
14
|
/** 状态路由;浏览器半用同一常量拼 URL。 */
|
|
15
|
-
export const STATE_PATH = '/plugin/dsh-
|
|
15
|
+
export const STATE_PATH = '/plugin/dsh-transfer-dock/state'
|
|
16
16
|
|
|
17
17
|
/** 只需要 job 注册表;提示词与 HTTP 路由都是可选增强。 */
|
|
18
18
|
export const inject = ['jobs']
|
|
@@ -54,7 +54,7 @@ export const Config = z.object({
|
|
|
54
54
|
const PROMPT_ORDER = 9000
|
|
55
55
|
|
|
56
56
|
/** 提示词段名。 */
|
|
57
|
-
const PROMPT_NAME = 'plugin:dsh-
|
|
57
|
+
const PROMPT_NAME = 'plugin:dsh-transfer-dock/download-guidance'
|
|
58
58
|
|
|
59
59
|
/** 引导模型让下载可被观察。 */
|
|
60
60
|
const PROMPT_TEXT = [
|
|
@@ -73,7 +73,7 @@ const PROMPT_TEXT = [
|
|
|
73
73
|
export function apply(ctx, config) {
|
|
74
74
|
const settings = normalizeConfig(config)
|
|
75
75
|
if (!settings.enabled) {
|
|
76
|
-
ctx.logger.debug('dsh-
|
|
76
|
+
ctx.logger.debug('dsh-transfer-dock: disabled by config')
|
|
77
77
|
return
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -117,7 +117,7 @@ function installStateRoute(ctx, tracker) {
|
|
|
117
117
|
let attempts = 0
|
|
118
118
|
let timer
|
|
119
119
|
// 浏览器半每 600ms 轮询一次;计数用来判断它到底有没有挂载。
|
|
120
|
-
const stats = { hits: 0, lastHitAt: 0, build: '0.1.
|
|
120
|
+
const stats = { hits: 0, lastHitAt: 0, build: '0.1.1' }
|
|
121
121
|
|
|
122
122
|
const attempt = () => {
|
|
123
123
|
if (dispose !== undefined) return
|
|
@@ -147,13 +147,13 @@ function installStateRoute(ctx, tracker) {
|
|
|
147
147
|
})
|
|
148
148
|
return
|
|
149
149
|
} catch (error) {
|
|
150
|
-
ctx.logger.warn(`dsh-
|
|
150
|
+
ctx.logger.warn(`dsh-transfer-dock: cannot register ${STATE_PATH}: ${String(error)}`)
|
|
151
151
|
return
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
attempts += 1
|
|
155
155
|
if (attempts >= 20) {
|
|
156
|
-
ctx.logger.warn('dsh-
|
|
156
|
+
ctx.logger.warn('dsh-transfer-dock: webServer never became available; the progress card stays idle')
|
|
157
157
|
return
|
|
158
158
|
}
|
|
159
159
|
timer = setTimeout(attempt, 500)
|
|
@@ -188,7 +188,7 @@ function installPrompt(ctx, settings) {
|
|
|
188
188
|
})
|
|
189
189
|
return typeof dispose === 'function' ? dispose : undefined
|
|
190
190
|
} catch (error) {
|
|
191
|
-
ctx.logger.warn(`dsh-
|
|
191
|
+
ctx.logger.warn(`dsh-transfer-dock: cannot add system prompt section: ${String(error)}`)
|
|
192
192
|
return undefined
|
|
193
193
|
}
|
|
194
194
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-transfer-dock",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "下载坞:在 DeepSeek Harness 界面右下角显示后台下载的实时进度卡片(字节、速度、剩余时间),覆盖 git clone / pip / npm / curl / aria2 / winget 等后台下载。",
|
|
6
6
|
"icon": "icon.svg",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"author": "imnotRiv3r",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/imnotRiv3r/dsh-
|
|
11
|
+
"url": "git+https://github.com/imnotRiv3r/dsh-transfer-dock.git"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/imnotRiv3r/dsh-
|
|
13
|
+
"homepage": "https://github.com/imnotRiv3r/dsh-transfer-dock#readme",
|
|
14
14
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/imnotRiv3r/dsh-
|
|
15
|
+
"url": "https://github.com/imnotRiv3r/dsh-transfer-dock/issues"
|
|
16
16
|
},
|
|
17
17
|
"keywords": [
|
|
18
18
|
"deepseek-harness",
|
package/test/smoke.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const notDownload = [
|
|
|
36
36
|
'git status',
|
|
37
37
|
'git fetch --all'.replace('fetch', 'status'),
|
|
38
38
|
'curl --version',
|
|
39
|
-
'Start-Sleep 1; Invoke-WebRequest -Uri "http://127.0.0.1:2482/plugin/dsh-
|
|
39
|
+
'Start-Sleep 1; Invoke-WebRequest -Uri "http://127.0.0.1:2482/plugin/dsh-transfer-dock/state" -UseBasicParsing',
|
|
40
40
|
'npm run build',
|
|
41
41
|
'python -m pip list',
|
|
42
42
|
]
|
|
@@ -149,7 +149,7 @@ exported.apply({
|
|
|
149
149
|
jobs: { state: {}, observe: () => () => {} },
|
|
150
150
|
})
|
|
151
151
|
assert.equal(registered.options.name, 'shell.overlay')
|
|
152
|
-
assert.equal(registered.options.id, 'dsh-
|
|
152
|
+
assert.equal(registered.options.id, 'dsh-transfer-dock')
|
|
153
153
|
assert.equal(registered.Component.name, 'DownloadCards')
|
|
154
154
|
|
|
155
155
|
console.log('smoke: 全部通过')
|