@hao0311/dsh-toolbox 0.5.5 → 0.5.6

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.
Files changed (2) hide show
  1. package/README.md +198 -191
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,191 +1,198 @@
1
- # dsh-toolbox
2
-
3
- > 英文版在本文末尾([English](#english)),也可单独看 [README.en.md](README.en.md)。
4
- DSH Web GUI 里的工具箱:左侧导航(手机上在抽屉里)多一行「工具箱」,点开是一个右侧抽屉
5
- (手机端全屏,可随时退出、任务在后台继续)。
6
-
7
- 桌面端打开抽屉时**主页面自动往左让位**:面板多宽,主内容就让出多宽,不会压住聊天;
8
- 窗口较窄(让位后主内容不足约 640px)时会顺手把左侧导航收成图标轨,关面板后自动恢复。
9
- 面板宽度随窗口自适应:424px ~ 340px。
10
-
11
- ## 你可能正卡在这几件事上
12
-
13
- - 模型说「网络慢」的时候,你分不清是模型慢、代理慢还是 Wi-Fi 差,只能靠猜。
14
- - 想验证就得另开测速站、抓包工具,再把结论手动贴回对话。
15
-
16
- ## 装上之后
17
-
18
- - 侧栏一行「工具箱」:连接状态(局域网 / Tailscale / 外网、Wi-Fi 频段信道速率信号)、一键体检、测速、质量监控都在一个抽屉里。
19
- - 测速由服务端计时、四路并发,关掉面板任务继续跑,回来还能看曲线。
20
- - 结果一键生成中文总结复制进对话,模型不用再猜「到底哪一段慢」。
21
- - 桌面端打开时主页面自动让位,不压住聊天;手机端全屏。
22
-
23
- ## 功能
24
-
25
- | 功能区 | 做什么 |
26
- |---|---|
27
- | 连接状态 | 打开面板自动刷新:局域网 / 本机回环 / Tailscale / 外网、客户端 IP、本机地址、公网出口、Wi-Fi 频段·信道·速率·信号 |
28
- | 一键体检 | 打面板自动跑一次**轻量**检查(约 1~2 秒,只发小请求);点按钮跑**完整**体检(含网关 ping、DNS、公网出口),给「良好 / 一般 / 较差」结论和建议 |
29
- | 测速 | 快速 20MB / 标准 100MB / 极限 500MB / 持续 30 秒 / 自定义(下载、上传、时长自选)。服务端计时、4 并发流、实时曲线;关掉面板继续跑 |
30
- | 质量监控 | 30 秒 / 1 分钟 / 3 分钟低流量采样(每 0.3 秒一个小请求),给延迟曲线、丢包和卡顿尖峰——查「卡」而不是查带宽 |
31
- | 历史记录 | 体检 / 测速 / 监控自动存本机(localStorage,最近 40 条),测速结果和上一次对比 |
32
- | 自动巡检 | 页面开着时每 3/5/10 分钟做 3 次轻探测;网络变差时导航入口亮红点,并在面板里提示 |
33
- | 分享 / 报告 | 生成一段中文总结(连接方式、体检结论、测速、监控、建议),一键复制发人 |
34
-
35
- ## 实现
36
-
37
- - **宿主端** `index.js`:`ctx.connection.fetch.register` 注册 `/api/toolbox/net/*`
38
- 路由(下载流 / 上传流 / 信息 / 诊断 / 服务端计时 / 状态),并通过官方
39
- `webserver/index-inject` 把 `client.css`、`client.js` 内联进 `index.html`。
40
- 宿主只在**启动时**读一次本文件;CSS / JS 是每次页面加载现读,所以改界面不用重启。
41
- - **客户端** `client.js`:纯 DOM 注入,不依赖 React、不改 DSH 布局。
42
- 测量引擎与面板解耦:关掉面板任务照跑,重新打开能看到实时状态;
43
- 入口行的小圆点 / 顶部 2px 进度线表示后台任务。
44
- - **鉴权**:路由都挂在 `/api` 下,走 connection 层统一的 Host/Origin + cookie 校验。
45
-
46
- ## 测速原理
47
-
48
- | 项目 | 做法 |
49
- |---|---|
50
- | 下载 | `GET /api/toolbox/net/download?mb=N` 流式返回 N×1MiB 随机数据,客户端流式读取计数;数字以**服务端计时**为准 |
51
- | 上传 | `POST /api/toolbox/net/upload`,浏览器发随机 Blob,服务端边收边计数,返回首字节→末字节耗时 |
52
- | 延迟 / 抖动 / 丢包 | 连续小请求 `/api/toolbox/net/info`,超时算丢包 |
53
-
54
- > 电脑本机上打开会走回环,数字会虚高到 GB/s 级别,面板会标「本机回环」提醒。
55
-
56
- ## 安装 / 更新
57
-
58
- ```sh
59
- dsh plugin --profile web add github:Hao0311/dsh-toolbox
60
- ```
61
-
62
- > npm 上有 ldchao 的同名包 `dsh-toolbox`(股票盯盘 + 小说阅读器,不是本插件),
63
- > `dsh plugin add dsh-toolbox` 会装错,务必用上面的 `github:` 来源。
64
-
65
- 开发时用本目录的同步脚本:把本目录同步到 `~/.dsh/profiles/web/node_modules/dsh-toolbox/`,
66
- 并在 `cordis.patch.yml` 的标记块里加入 `insert:` 条目(幂等,重复跑不会重复写)。
67
-
68
- ```powershell
69
- powershell -NoProfile -File D:\Workspaces\DSH\plugins\dsh-toolbox\install.ps1
70
- ```
71
-
72
- - **只改 `client.js` / `client.css`**:跑 install.ps1 后浏览器刷新即可,**不用重启 DSH**。
73
- - **改了 `index.js`**:需要重启 DSH(插件只在启动时装载):
74
- `powershell -NoProfile -File D:\Workspaces\DSH\tools\dsh\dsh-restart.ps1`
75
-
76
- > 注意:用 PowerShell 5.1 读写本目录的中文文件时别用 `Get-Content`/`Set-Content` 改内容
77
- > (默认按 ANSI 读会把 UTF-8 中文写坏);改文件用编辑器或 Node 脚本。
78
-
79
- ## 加新工具
80
-
81
- ```js
82
- window.DSHToolbox.register({
83
- id: 'my-tool', // 唯一
84
- title: '我的工具',
85
- hint: '一句话说明', // 可选
86
- render(container) { // 自己画 UI,container 是一个普通 DOM 节点
87
- container.textContent = 'hello';
88
- },
89
- });
90
- ```
91
-
92
- 注册顺序即面板底部「更多工具」里的显示顺序。
93
-
94
- ## 自检
95
-
96
- - 页面源码里搜 `__DSH_TOOLBOX__`(宿主注入的 global,报告注入行数与路由状态)。
97
- - 直接请求 `/api/toolbox/net/info`,应返回 `{ ok: true, ip, host, ... }`。
98
- - 本地验证脚本:`.cdp-verify/cdp-toolbox.js`(桌面/手机截图)、
99
- `.cdp-verify/cdp-toolbox-func.js`(点按钮、跑体检/测速/监控、验证后台继续)。
100
-
101
- ---
102
-
103
- # English
104
-
105
- > Also available as a standalone file: [README.en.md](README.en.md).
106
-
107
- A toolbox inside the DSH Web GUI: one more row in the left navigation (inside the drawer on phones) that opens a right-side drawer — full screen on phones, closable at any time, with measurements continuing in the background.
108
-
109
- On desktop the main page **makes room**: the drawer takes width, the chat content shifts left instead of being covered. In narrow windows (content under ~640 px after shifting) the left navigation also collapses into an icon rail, and restores when the panel closes. The drawer width adapts between 424 px and 340 px.
110
-
111
- ## The friction this removes
112
-
113
- - When the model says "the network is slow", you cannot tell whether it is the model, a proxy, or your Wi-Fi — so you guess.
114
- - Verifying means opening a speed-test site and a packet tool in another tab, then pasting the conclusion back into the chat.
115
-
116
- ## After installing
117
-
118
- - One sidebar row: connection type (LAN / Tailscale / public, Wi-Fi band, channel, rate, signal), one-click health check, speed test and quality monitor in a single drawer.
119
- - Speed tests are server-timed with four concurrent streams; closing the drawer does not stop them, and the chart is there when you return.
120
- - Results are summarised and copied into the conversation in one click, so the model no longer has to guess which hop is slow.
121
- - On desktop the page makes room instead of being covered; on phones the drawer is full screen.
122
-
123
- ## Features
124
-
125
- | Area | What it does |
126
- |---|---|
127
- | Connection | Refreshed on open: LAN / loopback / Tailscale / public, client IP, local address, public egress, Wi-Fi band, channel, rate and signal |
128
- | One-click check | Opening the panel runs a **light** check (~1–2 s, small requests only); the button runs a **full** check (gateway ping, DNS, public egress) and grades it good / fair / poor with suggestions |
129
- | Speed test | Quick 20 MB / standard 100 MB / extreme 500 MB / 30 s continuous / custom (download, upload, duration). Server-side timing, 4 concurrent streams, live chart — keeps running after you close the panel |
130
- | Quality monitor | 30 s / 1 min / 3 min low-traffic sampling (a small request every 0.3 s) producing a latency chart, packet loss and stall spikes — for "it feels laggy", not for bandwidth |
131
- | History | Checks, speed tests and monitors are stored locally (localStorage, last 40), and each speed test is compared with the previous one |
132
- | Auto patrol | While the page is open, 3 light probes every 3/5/10 minutes; a red dot on the nav entry and an in-panel hint when the network degrades |
133
- | Share / report | Builds a short summary (connection type, check result, speed, monitor, advice) with one-click copy |
134
-
135
- ## Implementation
136
-
137
- - **Host `index.js`** registers `/api/toolbox/net/*` through `ctx.connection.fetch.register` (download stream, upload stream, info, diagnostics, server timing, status) and inlines `client.css` / `client.js` into `index.html` via the official `webserver/index-inject` hook. The host reads this file once at startup; CSS and JS are read on every page load, so UI changes need no restart.
138
- - **Client `client.js`** is pure DOM injection — no React dependency, no layout changes to DSH. The measurement engine is decoupled from the panel: close the panel and the job keeps running; reopen it and you see live state. A dot on the nav row and a 2 px progress line at the top indicate a background job.
139
- - **Auth**: routes live under `/api` and inherit the connection layer's Host/Origin + cookie checks.
140
-
141
- ## How measurement works
142
-
143
- | Item | Method |
144
- |---|---|
145
- | Download | `GET /api/toolbox/net/download?mb=N` streams N × 1 MiB of random data; the client counts as it reads, and the number is **server-timed** |
146
- | Upload | `POST /api/toolbox/net/upload`; the browser posts a random Blob, the server counts bytes and returns first-byte → last-byte duration |
147
- | Latency / jitter / loss | Repeated small requests to `/api/toolbox/net/info`; timeouts count as loss |
148
-
149
- > Running it on the same machine goes over loopback, where numbers inflate to GB/s levels — the panel labels that case as "local loopback".
150
-
151
- ## Install / update
152
-
153
- ```sh
154
- dsh plugin --profile web add github:Hao0311/dsh-toolbox
155
- ```
156
-
157
- > npm hosts a **different, same-named** package `dsh-toolbox` (stock tracking + novel reader). `dsh plugin add dsh-toolbox` installs the wrong one; use the `github:` source above, or the scoped npm name `@hao0311/dsh-toolbox`.
158
-
159
- For development, this directory ships a sync script that copies it into `~/.dsh/profiles/web/node_modules/dsh-toolbox/` and adds an `insert:` entry inside a marker block of `cordis.patch.yml` (idempotent):
160
-
161
- ```powershell
162
- powershell -NoProfile -File D:\Workspaces\DSH\plugins\dsh-toolbox\install.ps1
163
- ```
164
-
165
- - **Only `client.js` / `client.css` changed**: run install.ps1 and reload the page — no DSH restart.
166
- - **`index.js` changed**: restart DSH (plugins load at startup).
167
-
168
- ## Adding your own tool
169
-
170
- ```js
171
- window.DSHToolbox.register({
172
- id: 'my-tool', // unique
173
- title: 'My tool',
174
- hint: 'one line', // optional
175
- render(container) { // draw into a plain DOM node
176
- container.textContent = 'hello';
177
- },
178
- });
179
- ```
180
-
181
- Registration order is the order shown under "more tools" at the bottom of the panel.
182
-
183
- ## Self-check
184
-
185
- - Search the page source for `__DSH_TOOLBOX__` (the host-injected global reporting injected lines and route status).
186
- - Request `/api/toolbox/net/info` directly; it should return `{ ok: true, ip, host, ... }`.
187
- - Local verification scripts: `.cdp-verify/cdp-toolbox.js` (desktop/mobile screenshots) and `.cdp-verify/cdp-toolbox-func.js` (click through checks, speed test, monitor, background continuation).
188
-
189
- ## License
190
-
191
- MIT
1
+ # dsh-toolbox
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@hao0311/dsh-toolbox)](https://www.npmjs.com/package/@hao0311/dsh-toolbox)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@hao0311/dsh-toolbox)](https://www.npmjs.com/package/@hao0311/dsh-toolbox)
5
+ [![license](https://img.shields.io/npm/l/@hao0311/dsh-toolbox)](https://github.com/Hao0311/dsh-toolbox/blob/main/LICENSE)
6
+ [![GitHub stars](https://img.shields.io/github/stars/Hao0311/dsh-toolbox)](https://github.com/Hao0311/dsh-toolbox)
7
+ [![dsh plugin](https://img.shields.io/badge/dsh-plugin-4B32C3)](https://awesome-dsh-plugin.com/p/Hao0311/dsh-toolbox/)
8
+
9
+
10
+ > 英文版在本文末尾([English](#english)),也可单独看 [README.en.md](README.en.md)。
11
+ DSH Web GUI 里的工具箱:左侧导航(手机上在抽屉里)多一行「工具箱」,点开是一个右侧抽屉
12
+ (手机端全屏,可随时退出、任务在后台继续)。
13
+
14
+ 桌面端打开抽屉时**主页面自动往左让位**:面板多宽,主内容就让出多宽,不会压住聊天;
15
+ 窗口较窄(让位后主内容不足约 640px)时会顺手把左侧导航收成图标轨,关面板后自动恢复。
16
+ 面板宽度随窗口自适应:424px ~ 340px。
17
+
18
+ ## 你可能正卡在这几件事上
19
+
20
+ - 模型说「网络慢」的时候,你分不清是模型慢、代理慢还是 Wi-Fi 差,只能靠猜。
21
+ - 想验证就得另开测速站、抓包工具,再把结论手动贴回对话。
22
+
23
+ ## 装上之后
24
+
25
+ - 侧栏一行「工具箱」:连接状态(局域网 / Tailscale / 外网、Wi-Fi 频段信道速率信号)、一键体检、测速、质量监控都在一个抽屉里。
26
+ - 测速由服务端计时、四路并发,关掉面板任务继续跑,回来还能看曲线。
27
+ - 结果一键生成中文总结复制进对话,模型不用再猜「到底哪一段慢」。
28
+ - 桌面端打开时主页面自动让位,不压住聊天;手机端全屏。
29
+
30
+ ## 功能
31
+
32
+ | 功能区 | 做什么 |
33
+ |---|---|
34
+ | 连接状态 | 打开面板自动刷新:局域网 / 本机回环 / Tailscale / 外网、客户端 IP、本机地址、公网出口、Wi-Fi 频段·信道·速率·信号 |
35
+ | 一键体检 | 打面板自动跑一次**轻量**检查(约 1~2 秒,只发小请求);点按钮跑**完整**体检(含网关 ping、DNS、公网出口),给「良好 / 一般 / 较差」结论和建议 |
36
+ | 测速 | 快速 20MB / 标准 100MB / 极限 500MB / 持续 30 秒 / 自定义(下载、上传、时长自选)。服务端计时、4 并发流、实时曲线;关掉面板继续跑 |
37
+ | 质量监控 | 30 秒 / 1 分钟 / 3 分钟低流量采样(每 0.3 秒一个小请求),给延迟曲线、丢包和卡顿尖峰——查「卡」而不是查带宽 |
38
+ | 历史记录 | 体检 / 测速 / 监控自动存本机(localStorage,最近 40 条),测速结果和上一次对比 |
39
+ | 自动巡检 | 页面开着时每 3/5/10 分钟做 3 次轻探测;网络变差时导航入口亮红点,并在面板里提示 |
40
+ | 分享 / 报告 | 生成一段中文总结(连接方式、体检结论、测速、监控、建议),一键复制发人 |
41
+
42
+ ## 实现
43
+
44
+ - **宿主端** `index.js`:`ctx.connection.fetch.register` 注册 `/api/toolbox/net/*`
45
+ 路由(下载流 / 上传流 / 信息 / 诊断 / 服务端计时 / 状态),并通过官方
46
+ `webserver/index-inject` 把 `client.css`、`client.js` 内联进 `index.html`。
47
+ 宿主只在**启动时**读一次本文件;CSS / JS 是每次页面加载现读,所以改界面不用重启。
48
+ - **客户端** `client.js`:纯 DOM 注入,不依赖 React、不改 DSH 布局。
49
+ 测量引擎与面板解耦:关掉面板任务照跑,重新打开能看到实时状态;
50
+ 入口行的小圆点 / 顶部 2px 进度线表示后台任务。
51
+ - **鉴权**:路由都挂在 `/api` 下,走 connection 层统一的 Host/Origin + cookie 校验。
52
+
53
+ ## 测速原理
54
+
55
+ | 项目 | 做法 |
56
+ |---|---|
57
+ | 下载 | `GET /api/toolbox/net/download?mb=N` 流式返回 N×1MiB 随机数据,客户端流式读取计数;数字以**服务端计时**为准 |
58
+ | 上传 | `POST /api/toolbox/net/upload`,浏览器发随机 Blob,服务端边收边计数,返回首字节→末字节耗时 |
59
+ | 延迟 / 抖动 / 丢包 | 连续小请求 `/api/toolbox/net/info`,超时算丢包 |
60
+
61
+ > 电脑本机上打开会走回环,数字会虚高到 GB/s 级别,面板会标「本机回环」提醒。
62
+
63
+ ## 安装 / 更新
64
+
65
+ ```sh
66
+ dsh plugin --profile web add github:Hao0311/dsh-toolbox
67
+ ```
68
+
69
+ > npm 上有 ldchao 的同名包 `dsh-toolbox`(股票盯盘 + 小说阅读器,不是本插件),
70
+ > `dsh plugin add dsh-toolbox` 会装错,务必用上面的 `github:` 来源。
71
+
72
+ 开发时用本目录的同步脚本:把本目录同步到 `~/.dsh/profiles/web/node_modules/dsh-toolbox/`,
73
+ 并在 `cordis.patch.yml` 的标记块里加入 `insert:` 条目(幂等,重复跑不会重复写)。
74
+
75
+ ```powershell
76
+ powershell -NoProfile -File D:\Workspaces\DSH\plugins\dsh-toolbox\install.ps1
77
+ ```
78
+
79
+ - **只改 `client.js` / `client.css`**:跑 install.ps1 后浏览器刷新即可,**不用重启 DSH**。
80
+ - **改了 `index.js`**:需要重启 DSH(插件只在启动时装载):
81
+ `powershell -NoProfile -File D:\Workspaces\DSH\tools\dsh\dsh-restart.ps1`
82
+
83
+ > 注意:用 PowerShell 5.1 读写本目录的中文文件时别用 `Get-Content`/`Set-Content` 改内容
84
+ > (默认按 ANSI 读会把 UTF-8 中文写坏);改文件用编辑器或 Node 脚本。
85
+
86
+ ## 加新工具
87
+
88
+ ```js
89
+ window.DSHToolbox.register({
90
+ id: 'my-tool', // 唯一
91
+ title: '我的工具',
92
+ hint: '一句话说明', // 可选
93
+ render(container) { // 自己画 UI,container 是一个普通 DOM 节点
94
+ container.textContent = 'hello';
95
+ },
96
+ });
97
+ ```
98
+
99
+ 注册顺序即面板底部「更多工具」里的显示顺序。
100
+
101
+ ## 自检
102
+
103
+ - 页面源码里搜 `__DSH_TOOLBOX__`(宿主注入的 global,报告注入行数与路由状态)。
104
+ - 直接请求 `/api/toolbox/net/info`,应返回 `{ ok: true, ip, host, ... }`。
105
+ - 本地验证脚本:`.cdp-verify/cdp-toolbox.js`(桌面/手机截图)、
106
+ `.cdp-verify/cdp-toolbox-func.js`(点按钮、跑体检/测速/监控、验证后台继续)。
107
+
108
+ ---
109
+
110
+ # English
111
+
112
+ > Also available as a standalone file: [README.en.md](README.en.md).
113
+
114
+ A toolbox inside the DSH Web GUI: one more row in the left navigation (inside the drawer on phones) that opens a right-side drawer — full screen on phones, closable at any time, with measurements continuing in the background.
115
+
116
+ On desktop the main page **makes room**: the drawer takes width, the chat content shifts left instead of being covered. In narrow windows (content under ~640 px after shifting) the left navigation also collapses into an icon rail, and restores when the panel closes. The drawer width adapts between 424 px and 340 px.
117
+
118
+ ## The friction this removes
119
+
120
+ - When the model says "the network is slow", you cannot tell whether it is the model, a proxy, or your Wi-Fi — so you guess.
121
+ - Verifying means opening a speed-test site and a packet tool in another tab, then pasting the conclusion back into the chat.
122
+
123
+ ## After installing
124
+
125
+ - One sidebar row: connection type (LAN / Tailscale / public, Wi-Fi band, channel, rate, signal), one-click health check, speed test and quality monitor in a single drawer.
126
+ - Speed tests are server-timed with four concurrent streams; closing the drawer does not stop them, and the chart is there when you return.
127
+ - Results are summarised and copied into the conversation in one click, so the model no longer has to guess which hop is slow.
128
+ - On desktop the page makes room instead of being covered; on phones the drawer is full screen.
129
+
130
+ ## Features
131
+
132
+ | Area | What it does |
133
+ |---|---|
134
+ | Connection | Refreshed on open: LAN / loopback / Tailscale / public, client IP, local address, public egress, Wi-Fi band, channel, rate and signal |
135
+ | One-click check | Opening the panel runs a **light** check (~1–2 s, small requests only); the button runs a **full** check (gateway ping, DNS, public egress) and grades it good / fair / poor with suggestions |
136
+ | Speed test | Quick 20 MB / standard 100 MB / extreme 500 MB / 30 s continuous / custom (download, upload, duration). Server-side timing, 4 concurrent streams, live chart — keeps running after you close the panel |
137
+ | Quality monitor | 30 s / 1 min / 3 min low-traffic sampling (a small request every 0.3 s) producing a latency chart, packet loss and stall spikes — for "it feels laggy", not for bandwidth |
138
+ | History | Checks, speed tests and monitors are stored locally (localStorage, last 40), and each speed test is compared with the previous one |
139
+ | Auto patrol | While the page is open, 3 light probes every 3/5/10 minutes; a red dot on the nav entry and an in-panel hint when the network degrades |
140
+ | Share / report | Builds a short summary (connection type, check result, speed, monitor, advice) with one-click copy |
141
+
142
+ ## Implementation
143
+
144
+ - **Host `index.js`** registers `/api/toolbox/net/*` through `ctx.connection.fetch.register` (download stream, upload stream, info, diagnostics, server timing, status) and inlines `client.css` / `client.js` into `index.html` via the official `webserver/index-inject` hook. The host reads this file once at startup; CSS and JS are read on every page load, so UI changes need no restart.
145
+ - **Client `client.js`** is pure DOM injection — no React dependency, no layout changes to DSH. The measurement engine is decoupled from the panel: close the panel and the job keeps running; reopen it and you see live state. A dot on the nav row and a 2 px progress line at the top indicate a background job.
146
+ - **Auth**: routes live under `/api` and inherit the connection layer's Host/Origin + cookie checks.
147
+
148
+ ## How measurement works
149
+
150
+ | Item | Method |
151
+ |---|---|
152
+ | Download | `GET /api/toolbox/net/download?mb=N` streams N × 1 MiB of random data; the client counts as it reads, and the number is **server-timed** |
153
+ | Upload | `POST /api/toolbox/net/upload`; the browser posts a random Blob, the server counts bytes and returns first-byte → last-byte duration |
154
+ | Latency / jitter / loss | Repeated small requests to `/api/toolbox/net/info`; timeouts count as loss |
155
+
156
+ > Running it on the same machine goes over loopback, where numbers inflate to GB/s levels — the panel labels that case as "local loopback".
157
+
158
+ ## Install / update
159
+
160
+ ```sh
161
+ dsh plugin --profile web add github:Hao0311/dsh-toolbox
162
+ ```
163
+
164
+ > npm hosts a **different, same-named** package `dsh-toolbox` (stock tracking + novel reader). `dsh plugin add dsh-toolbox` installs the wrong one; use the `github:` source above, or the scoped npm name `@hao0311/dsh-toolbox`.
165
+
166
+ For development, this directory ships a sync script that copies it into `~/.dsh/profiles/web/node_modules/dsh-toolbox/` and adds an `insert:` entry inside a marker block of `cordis.patch.yml` (idempotent):
167
+
168
+ ```powershell
169
+ powershell -NoProfile -File D:\Workspaces\DSH\plugins\dsh-toolbox\install.ps1
170
+ ```
171
+
172
+ - **Only `client.js` / `client.css` changed**: run install.ps1 and reload the page — no DSH restart.
173
+ - **`index.js` changed**: restart DSH (plugins load at startup).
174
+
175
+ ## Adding your own tool
176
+
177
+ ```js
178
+ window.DSHToolbox.register({
179
+ id: 'my-tool', // unique
180
+ title: 'My tool',
181
+ hint: 'one line', // optional
182
+ render(container) { // draw into a plain DOM node
183
+ container.textContent = 'hello';
184
+ },
185
+ });
186
+ ```
187
+
188
+ Registration order is the order shown under "more tools" at the bottom of the panel.
189
+
190
+ ## Self-check
191
+
192
+ - Search the page source for `__DSH_TOOLBOX__` (the host-injected global reporting injected lines and route status).
193
+ - Request `/api/toolbox/net/info` directly; it should return `{ ok: true, ip, host, ... }`.
194
+ - Local verification scripts: `.cdp-verify/cdp-toolbox.js` (desktop/mobile screenshots) and `.cdp-verify/cdp-toolbox-func.js` (click through checks, speed test, monitor, background continuation).
195
+
196
+ ## License
197
+
198
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hao0311/dsh-toolbox",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "exports": {