@alexpeng/dsh-custom-plugin 0.6.0 → 0.7.0

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.i18n.yaml CHANGED
@@ -3,5 +3,5 @@
3
3
  # after editing either side, bring the other along and re-record the hashes:
4
4
  # git hash-object --path README.md README.md
5
5
  # git hash-object --path README.zh.md README.zh.md
6
- README.md: cc76977b752647e342987111d810cd8a76d7edb6
7
- README.zh.md: 7778594e06ac0c7a96708de71040a90a2367eb7a
6
+ README.md: fe96c35fa8095a5800f789a18b87114104e0b4bb
7
+ README.zh.md: dd5a9dd9f444a91815ff52cfd0a70dac37b5c3b1
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  English | [中文](README.zh.md)
11
11
 
12
- Custom convenience suite for the DeepSeek Harness (DSH) Web GUI: personalization, weather FX, glass effects, a per-user-message timeline rail, project folders, enhanced prompts, conversation export/search, Mermaid rendering, quote reply, 7/30/90-day usage analytics, budget and key-free local backups, plus a Ctrl/Cmd+K command palette.
12
+ Custom convenience suite for the DeepSeek Harness (DSH) Web GUI: personalization, weather FX, glass effects, project folders, enhanced prompts, conversation export/search, Mermaid rendering, quote reply, 7/30/90-day usage analytics, budget and key-free local backups, plus a Ctrl/Cmd+K command palette.
13
13
 
14
14
  The plugin is dual-face: the host half (`src/`) owns the state document, registers the `/api/custom-plugin` routes and the `custom_plugin_status` agent tool; the browser half (`src/client/`) injects its UI through eight injections into seven official slots and talks to the host over same-origin fetch. Mounted through the official profile mechanism — no DSH source changes.
15
15
 
@@ -26,42 +26,30 @@ The plugin is dual-face: the host half (`src/`) owns the state document, registe
26
26
  </tr>
27
27
  <tr>
28
28
  <td width="50%" valign="top"><b>Liquid glass (displacement refraction on Custom surfaces)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="Liquid glass" width="100%"></td>
29
- <td width="50%" valign="top"><b>Timeline rail with hover preview</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/timeline.png" alt="Timeline rail" width="100%"></td>
29
+ <td width="50%" valign="top"><b>Multi-level project folders</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="Project folders" width="100%"></td>
30
30
  </tr>
31
31
  <tr>
32
- <td width="50%" valign="top"><b>Multi-level project folders</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="Project folders" width="100%"></td>
33
32
  <td width="50%" valign="top"><b>Mermaid mindmap rendered in place</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/mermaid-mindmap.png" alt="Mermaid mindmap" width="100%"></td>
33
+ <td width="50%" valign="top" align="center"><b>Balance and today's per-model usage</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/balance-usage.png" alt="Balance and usage panel" width="100%"></td>
34
34
  </tr>
35
35
  <tr>
36
- <td width="50%" valign="top" align="center"><b>Balance and today's per-model usage</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/balance-usage.png" alt="Balance and usage panel" width="100%"></td>
37
- <td width="50%" valign="top" align="center"><b>Rain — three depth layers</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-rain.gif" alt="Rain FX" width="100%"></td>
36
+ <td width="50%" valign="top" align="center"><b>Rain (three depth layers)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-rain.gif" alt="Rain effect" width="100%"></td>
37
+ <td width="50%" valign="top" align="center"><b>Sakura</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-sakura.gif" alt="Sakura effect" width="100%"></td>
38
38
  </tr>
39
39
  <tr>
40
- <td width="50%" valign="top" align="center"><b>Sakura petals</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-sakura.gif" alt="Sakura FX" width="100%"></td>
41
- <td width="50%" valign="top" align="center"><b>Snow</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-snow.gif" alt="Snow FX" width="100%"></td>
40
+ <td width="50%" valign="top" align="center"><b>Snow</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-snow.gif" alt="Snow effect" width="100%"></td>
42
41
  </tr>
43
42
  </table>
44
43
 
45
- Weather FX is shown in dark mode, where only "no color" and "aurora" backgrounds are selectable. Usage history, backup-import previews, session search, and the command palette are dynamic views of the same panel; open them inside DSH to inspect the live UI — no additional fixed screenshots are included.
44
+ Weather FX is shown in dark mode. Usage history, backup-import previews, session search, and the command palette are dynamic views of the same panel; open them inside DSH to inspect the live UI — no additional fixed screenshots are included.
46
45
 
47
46
  ## What it does
48
47
 
49
48
  ### Appearance
50
49
 
51
- - **Background colors**: 20 muted low-saturation palettes (each with a matching tab color, `天青灰` by default) plus "no color" (follows the GUI default theme) and the high-saturation aurora gradient. In dark mode only "no color" and "aurora" stay selectable; the other colors are disabled and the plugin text turns white for readability.
50
+ - **Background colors**: 20 muted low-saturation palettes (each with a matching tab color, `天青灰` by default) plus "no color" (follows the GUI default theme). Every palette works in both themes; dark mode derives the same family's dark variant (hue and low saturation kept, lightness dropped onto the dark ramp), and the swatch preview shows what the current theme will actually paint.
52
51
  - **Weather FX**: canvas-rendered, pointer-transparent one-click overlays — falling snow, cinematic rain (three depth layers with splashes), and drifting sakura petals; turning it off clears the canvas.
53
- - **Glass**: frosted glass on every Custom surface, or liquid glass (Chromium displacement refraction, no chromatic dispersion, slight backdrop blur; Safari/Firefox fall back to frosted). A global-glass option applies backdrop blur to dialogs, menus, tooltips and listboxes.
54
-
55
- ### Timeline navigation
56
-
57
- Every direct user message gets a node on a right-side (or left-side) rail:
58
-
59
- - hover for a preview popover (overflow-aware positioning) with LaTeX / MathML / Mermaid markers rendered inline;
60
- - click to jump to that message (the chat scrollport is driven directly, so rows inside nested scrollers still land centered);
61
- - drag the thumb or wheel over the rail to scroll (the rail replaces the native scrollbar);
62
- - nodes can be starred (and the rail can show only starred ones), forked into a new session at that message, or copied in full.
63
-
64
- Nodes are sourced from the rendered user-message rows (DOM positioning) and refresh automatically after history loads; the rail keeps up to 400 tail nodes.
52
+ - **Glass**: frosted glass on every Custom surface, or liquid glass (edge displacement refraction chained with a slight blur + saturation so text over large panels stays readable; engines without SVG-referencing backdrop filters fall back to frosted). A global-glass option extends the same treatment to dialogs, menus, tooltips, listboxes and the system settings window — displaced as well in liquid mode.
65
53
 
66
54
  ### Project folders
67
55
 
@@ -99,12 +87,13 @@ Plugin state can be exported as a versioned JSON backup containing appearance, f
99
87
 
100
88
  ### Balance and usage
101
89
 
102
- A balance badge sits in the session header (clickable to pin); the balance panel provides:
90
+ A usage badge sits in the session header (clickable to pin): with an API key configured it shows the official balance; without one it shows the local cost estimate (e.g. `≈¥0.42`) and today's call count. The panel provides:
103
91
 
104
- - **Balance**: the official `https://api.deepseek.com/user/balance` endpoint, CNY preferred, granted and topped-up balances listed separately, with the account availability flag.
105
- - **Key resolution order**: the system credential store (when available) → the legacy plugin state-file key → environment variables `DEEPSEEK_API_KEY` / `DEEPSEEK_KEY` / `DEEPSEEK_TOKEN` (values must start with `sk-`) → the DSH credentials file `$DSH_HOME/.credentials.yaml` (reuses the DeepSeek key already configured in DSH — no duplicate setup).
92
+ - **Usage and cost (default section, key-free)**: today's and historical usage, budget and the cost estimate all come from local session records — no key required.
93
+ - **Balance query (collapsible opt-in, needs an API key)**: the official `https://api.deepseek.com/user/balance` endpoint, CNY preferred, granted and topped-up balances listed separately, with the account availability flag; with no key configured the section stays collapsed and shows no error. The host's outbound call goes over the machine's direct connection (system proxy settings are not read); when a local proxy or security suite intermittently TLS-intercepts HTTPS, the query fails with a readable reason ("TLS certificate verification failed") and retries automatically (8s/30s/30s, with the 60s poll as the backstop) — hover the header pill to see the reason.
94
+ - **Key resolution order**: the system credential store (when available) → the legacy plugin state-file key → environment variables `DEEPSEEK_API_KEY` / `DEEPSEEK_KEY` / `DEEPSEEK_TOKEN` (values must start with `sk-`) → the DSH credentials file `$DSH_HOME/.credentials.yaml` (reuses the DeepSeek key already configured in DSH — no duplicate setup). Account-login Desktop installs have no sk- key; that is a normal state.
106
95
  - **Today's usage**: per-model input / output / cache token counters and call counts, folded live from `session/event` records.
107
- - **Cost estimate**: DeepSeek's current official peak/off-peak table — peak hours are Beijing Monday–Friday 09:00–12:00 / 14:00–18:00; all other hours, including weekends, are off-peak at half price: `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` ¥3 / ¥9, `deepseek-v4-pro` ¥9 / ¥27 (CNY per 1M tokens in / out, cache writes ¥0.1 / ¥0.3; the retired `deepseek-chat` / `deepseek-reasoner` price as v4-flash). Indicative only.
96
+ - **Cost estimate**: DeepSeek's current official peak/off-peak table (checked 2026-09-30) — peak hours are Beijing Monday–Friday 09:00–12:00 / 14:00–18:00; all other hours, including weekends, are off-peak at half price: `deepseek-flash` (the retired names `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` still route at Flash pricing) peaks at ¥2 / ¥8, `deepseek-v4-pro` ¥9 / ¥27 (CNY per 1M tokens, peak in / out). Indicative only.
108
97
  - **Scan**: "scan today's session logs" replays every session and buckets usage events by their own timestamp (cross-midnight sessions keep contributing today's usage), reporting how many active sessions were scanned.
109
98
  - **History and budget**: inspect 7 / 30 / 90-day trends and per-model totals, export UTF-8 CSV, and set a local monthly CNY budget with an in-plugin warning threshold.
110
99
 
@@ -137,7 +126,7 @@ report their service as missing rather than throwing.
137
126
 
138
127
  ## Install
139
128
 
140
- Prerequisites: Node 22+, pnpm, and the `dsh` CLI (the official `@deepseek-ai/dsh` npm package; `npx @deepseek-ai/dsh` stands in for `dsh` when it is not installed globally). This release targets **dsh 0.1.7-rc.2 through the rest of 0.1.x, plus 0.2.0-rc.2** — dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own version at install and startup, and skips a bundle that does not match, so `package.json` names only the releases this package was actually built and verified against. 0.6.0 is type-checked and built against 0.2.0-rc.2, and the same artifact was run through the live host probes on both runtime lines: 18 of 19 probes pass on 0.2.0-rc.2 (boot graph of 66 module rows) and on 0.1.7-rc.2 (65 rows), the one skip being the probe that needs a real session. What stays unverified is what was always unverified: the per-turn chips (branch, Mermaid render, LaTeX) need a real model reply, so a credential-free scratch home cannot reach them, and slot rendering still needs a browser pass. The range deliberately excludes 0.2.0-rc.1 (a superseded prerelease), 0.2.0-rc.3 and later prereleases nobody has looked at, and 0.2.0 stable until someone does. Range spelling matters here: `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N` sorts *above* `0.2.0-0`, so a verified prerelease has to be named in its own clause — `pnpm smoke` checks that the build target actually satisfies the declared range and that `engines.dsh` admits the same versions. On an older dsh, install the matching older plugin release (`0.5.0` targets 0.1.7-rc.2) rather than granting a compatibility exemption.
129
+ Prerequisites: Node 22+, pnpm, and the `dsh` CLI (the official `@deepseek-ai/dsh` npm package; `npx @deepseek-ai/dsh` stands in for `dsh` when it is not installed globally). This release targets **dsh 0.1.7-rc.2 through the rest of 0.1.x, plus 0.2.0-rc.2** — dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own version at install and startup, and skips a bundle that does not match, so `package.json` names only the releases this package was actually built and verified against. 0.7.0 keeps the build target 0.6.0 established (0.2.0-rc.2) and the same peer range; the 0.6.0 artifact ran the live host probes on both runtime lines (0.2.0-rc.2 boot graph of 66 module rows, 0.1.7-rc.2 of 65, 18 of 19 probes passing each, the skip needing a real session), and the 0.7.0 artifact additionally passed the desktop-shape live probe **on a real Desktop install** (see "On dsh Desktop" below). What stays unverified is what was always unverified: the per-turn chips (Mermaid render, LaTeX) need a real model reply, so a credential-free scratch home cannot reach them, and slot rendering still needs a browser pass. The range deliberately excludes 0.2.0-rc.1 (a superseded prerelease), 0.2.0-rc.3 and later prereleases nobody has looked at, and 0.2.0 stable until someone does. Range spelling matters here: `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N` sorts *above* `0.2.0-0`, so a verified prerelease has to be named in its own clause — `pnpm smoke` checks that the build target actually satisfies the declared range and that `engines.dsh` admits the same versions. On an older dsh, install the matching older plugin release (`0.5.0` targets 0.1.7-rc.2) rather than granting a compatibility exemption.
141
130
 
142
131
  ### From npm
143
132
 
@@ -152,20 +141,29 @@ The registry tarball ships prebuilt output — no source build on the installing
152
141
 
153
142
  dsh Desktop is an Electron shell around the same Web application, and it bundles
154
143
  **exactly dsh 0.2.0-rc.2** — the desktop release line pins the shell and the
155
- runtime together, so a Desktop install is always a 0.2.x runtime. 0.6.0 names
144
+ runtime together, so a Desktop install is always a 0.2.x runtime. 0.7.0 names
156
145
  that version in its peer range and installs there with no compatibility
157
146
  exemption; 0.5.0 did not, and was refused with the same message a 0.2.x Web
158
147
  profile prints.
159
148
 
160
149
  Measured against 0.2.0-rc.2: the boot graph carries our row and all five inject
161
150
  targets, the Mermaid engine loads locally, and the host probes score the same
162
- there as on 0.1.7-rc.2. The desktop request path does not disturb this plugin's
163
- access fence either — the shell forwards renderer requests to its own Host after
164
- deleting `host`, `origin`, `sec-fetch-site` and `cookie`, then attaches its own
165
- credential, which is the shape the loopback fence accepts (that fence now has
166
- unit tests, which it never had before). What has *not* been done is opening this
167
- plugin inside a Desktop window; that pass belongs to whoever installs it, and it
168
- needs your login.
151
+ there as on 0.1.7-rc.2. The access fence shares the platform fence's trust
152
+ semantics: a loopback socket naming a loopback Host, a non-`cross-site` marker,
153
+ and an Origin that is absent or matches the Host authority. The shell forwards
154
+ renderer requests to its own Host after deleting `host`, `origin`,
155
+ `sec-fetch-site` and `cookie`, then attaches its own credential — that unmarked
156
+ shape is accepted outright (through 0.6.0 the fence additionally required a
157
+ same-origin marker and rejected exactly this shape with `forbidden`; fixed in
158
+ 0.7.0 with fence-level unit tests). Foreign-origin and cross-site requests are
159
+ still 403. **The 0.7.0 artifact has been probed route by route on a real
160
+ Desktop install in the desktop forward shape** (upgraded to this build, Desktop
161
+ restarted, `scripts/desktop-shape-probe.mjs` run): state / debug / backup /
162
+ usage scan / the Mermaid engine preload and script routes all answer 200, and
163
+ foreign-origin and cross-site probes still get 403; the timeline, the three
164
+ export formats and search are re-checked by the same probe once the GUI has
165
+ produced its first session. The visual pass inside the Desktop window (liquid
166
+ glass look, panel layout, pattern removal) belongs to whoever installs it.
169
167
 
170
168
  Managing the desktop profile takes the `dsh` command that ships with Desktop, not
171
169
  the npm one — the public CLI refuses the reserved `desktop` profile:
@@ -215,14 +213,11 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
215
213
 
216
214
  | Key | Default | Meaning |
217
215
  |---|---|---|
218
- | `bg` | `天青灰` | `default` (no color) / `aurora` / one of the 20 palette names |
216
+ | `bg` | `天青灰` | `default` (no color) / one of the 20 palette names (both themes; a stored `aurora` migrates to `default`) |
219
217
  | `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
220
218
  | `glass` | `true` | master glass toggle for Custom surfaces |
221
219
  | `glassMode` | `frost` | `frost` frosted / `liquid` displacement glass |
222
220
  | `globalGlass` | `true` | blur global overlays (dialogs/menus/tooltips) |
223
- | `timeline` | `true` | timeline rail toggle |
224
- | `timelineLeft` | `false` | rail on the left |
225
- | `starsOnly` | `false` | show only starred nodes |
226
221
  | `quote` | `true` | selection quote reply |
227
222
  | `antiScroll` | `false` | anti auto-scroll |
228
223
  | `mermaid` | `true` | automatic in-place Mermaid rendering (plus render chips) |
@@ -244,7 +239,7 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
244
239
  - The balance panel shows the peak/off-peak token and cost split plus a link to the official pricing page; legacy rows without peak counters are marked inexact and excluded from cost totals until rescanned.
245
240
  - OS credential storage detects a `keytar` module present in the profile's `node_modules` when the host starts; when it cannot be loaded, the compatibility state-file fallback is used.
246
241
  - Cost estimates use DeepSeek's official peak/off-peak list prices and are indicative only.
247
- - Dark-mode background restriction is deliberate: only "no color" and "aurora" are selectable in dark mode.
242
+ - Palettes derive a same-family dark variant in dark mode (hue and low saturation kept).
248
243
  - DSH currently exposes no archive-restore API; the plugin does not bypass that boundary by editing the underlying registry.
249
244
  - The command palette owns `Ctrl+K` / `Cmd+K` (no Alt/Shift, ignored inside editors). dsh's own default on the **web** profile is `Ctrl+Alt+K` (the desktop default is plain `Ctrl+K`), so nothing collides out of the box — but dsh 0.1.7 lets you rebind host shortcuts, and if you assign a host command to plain `Ctrl+K`, both fire. Keep the palette key reserved, or pick another binding there.
250
245
  - dsh's shipped `web` profile composes its session-query index with `openAt: never`, so full-text search is off unless the deployment enables it. In-session search therefore answers from a direct log scan (ordered, capped at 100 hits) and the palette's cross-session search shows dsh's own refusal.
@@ -265,12 +260,24 @@ isolated dsh profile (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`
265
260
  it exercises the host half on real session data — timeline, the three export
266
261
  formats, the search scan path, usage scan, backup, the Mermaid engine route, the
267
262
  client→host diagnostic ring, a UTF-8 state round trip that restores and then
268
- verifies your prompt library, and both trust fences. It refuses to run against a
263
+ verifies your prompt library, and the three trust-fence shapes (an unmarked
264
+ loopback request passes, a foreign Origin and a cross-site marker are
265
+ rejected). It refuses to run against a
269
266
  real `~/.dsh` unless you set `ALLOW_REAL_DSH_HOME=1`, reports `PASS`/`FAIL` per
270
267
  probe, counts and names anything it `SKIP`s, and exits non-zero on any failure.
271
268
  CI has no harness to talk to, so run it whenever a dsh release lands; slot
272
269
  registration and rendering still need the browser pass described above.
273
270
 
271
+ `scripts/desktop-shape-probe.mjs` is a third probe, aimed at a **running dsh
272
+ Desktop** (its Host listens on `127.0.0.1:19387` by default, override with
273
+ `DSH_PORT`): it probes state / debug / backup / usage scan / the Mermaid engine
274
+ and script routes in the exact header shape the desktop shell forwards (loopback
275
+ Host, no `origin`, no `sec-fetch-site`), then runs timeline, the three export
276
+ formats and search against the first session the host has registered; the
277
+ foreign-origin and cross-site probes must still come back 403. It is read-only
278
+ against the real home; if the GUI has no session yet, send one message there and
279
+ re-run.
280
+
274
281
  Checking a new dsh release takes four commands, and never touches your own
275
282
  harness home:
276
283
 
@@ -287,6 +294,20 @@ and rolls the profile back; `dsh plugin --profile web allow-version <pkg>@<ver>
287
294
  probe can tell you *what* actually breaks instead of what the gate already
288
295
  refused.
289
296
 
297
+ For a **dsh Desktop** release, start one step earlier, because the repository
298
+ cannot tell you what an installer runs: Desktop pins its shell and
299
+ `@deepseek-ai/dsh` to one exact version and ships the whole runtime inside
300
+ `resources/app.asar`. Read it off the installed app instead — the command is
301
+ read-only, and it prints that version together with whether the peer range
302
+ declared here admits it:
303
+
304
+ ```bash
305
+ node scripts/desktop-runtime.mjs "D:/DSH" # the installation dir
306
+ node scripts/desktop-runtime.mjs "D:/DSH/resources/app.asar" # or the archive itself
307
+ ```
308
+
309
+ Then run the four commands above against the version it names.
310
+
290
311
  ## License
291
312
 
292
313
  Apache-2.0. Portions of the code reference [Nagi-ovo/voyager](https://github.com/Nagi-ovo/voyager) and [unovue/inspira-ui](https://github.com/unovue/inspira-ui).
package/README.zh.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  [English](README.md) | 中文
11
11
 
12
- DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天气特效、玻璃效果、按用户消息的时间线导航、项目文件夹、增强提示词库、会话导出与会话搜索、Mermaid 渲染、引用回复、7/30/90 天用量分析、预算与无密钥本地备份,以及 Ctrl/Cmd+K 快捷面板。
12
+ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天气特效、玻璃效果、项目文件夹、增强提示词库、会话导出与会话搜索、Mermaid 渲染、引用回复、7/30/90 天用量分析、预算与无密钥本地备份,以及 Ctrl/Cmd+K 快捷面板。
13
13
 
14
14
  插件为双半区架构:宿主半区(`src/`)持有状态文档、注册 `/api/custom-plugin` 路由与 `custom_plugin_status` 智能体工具;浏览器半区(`src/client/`)通过 7 个官方 slot 的 8 处注入挂载 UI,以同源 fetch 与宿主通信。经官方 profile 机制挂载,不改 DSH 源码。
15
15
 
@@ -26,42 +26,30 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
26
26
  </tr>
27
27
  <tr>
28
28
  <td width="50%" valign="top"><b>液态玻璃(Custom 面板位移折射)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/liquid-glass.png" alt="液态玻璃" width="100%"></td>
29
- <td width="50%" valign="top"><b>时间线轨道与悬停预览</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/timeline.png" alt="时间线轨道" width="100%"></td>
29
+ <td width="50%" valign="top"><b>多级项目文件夹</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="项目文件夹" width="100%"></td>
30
30
  </tr>
31
31
  <tr>
32
- <td width="50%" valign="top"><b>多级项目文件夹</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/project-folders.png" alt="项目文件夹" width="100%"></td>
33
32
  <td width="50%" valign="top"><b>Mermaid 思维导图就地渲染</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/mermaid-mindmap.png" alt="Mermaid 思维导图" width="100%"></td>
33
+ <td width="50%" valign="top" align="center"><b>余额与今日分模型用量</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/balance-usage.png" alt="余额与用量面板" width="100%"></td>
34
34
  </tr>
35
35
  <tr>
36
- <td width="50%" valign="top" align="center"><b>余额与今日分模型用量</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/balance-usage.png" alt="余额与用量面板" width="100%"></td>
37
36
  <td width="50%" valign="top" align="center"><b>雨(三层景深)</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-rain.gif" alt="下雨特效" width="100%"></td>
37
+ <td width="50%" valign="top" align="center"><b>樱花</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-sakura.gif" alt="樱花特效" width="100%"></td>
38
38
  </tr>
39
39
  <tr>
40
- <td width="50%" valign="top" align="center"><b>樱花</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-sakura.gif" alt="樱花特效" width="100%"></td>
41
40
  <td width="50%" valign="top" align="center"><b>飘雪</b><br><img src="https://github.com/AlexPeng07/dsh-custom-plugin/raw/main/docs/weather-snow.gif" alt="飘雪特效" width="100%"></td>
42
41
  </tr>
43
42
  </table>
44
43
 
45
- 天气特效截自深色模式(深色下仅「无颜色」与「极光」背景可选)。额度历史、备份导入预览、会话搜索与快捷面板属于同一套动态面板,需在 DSH 内打开对应页查看;仓库未另附固定截图。
44
+ 天气特效截自深色模式。额度历史、备份导入预览、会话搜索与快捷面板属于同一套动态面板,需在 DSH 内打开对应页查看;仓库未另附固定截图。
46
45
 
47
46
  ## 功能
48
47
 
49
48
  ### 外观个性化
50
49
 
51
- - **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI 默认主题)与高饱和「极光」渐变。深色模式下仅「无颜色」与「极光」可选,其余颜色禁用,插件文字自动转白保证可读性。
50
+ - **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI 默认主题)。深浅色模式均可选用;深色模式自动派生同色系的深色变体(保留色相与低饱和,落到深色明度档),色板预览即当前模式的实际效果。
52
51
  - **天气特效**:画布渲染、不挡交互,一键切换——飘雪、电影感雨滴(三层景深 + 地面溅起)、樱花飘落;关闭时自动清空画布。
53
- - **玻璃效果**:所有 Custom 面板默认毛玻璃;可切换液态玻璃(Chromium 位移折射,无色散、轻微背景模糊;Safari/Firefox 自动回退毛玻璃)。「全局浮层玻璃」对弹窗、菜单、提示框、下拉框统一加模糊。
54
-
55
- ### 时间线导航
56
-
57
- 每条用户消息在右侧(或左侧)轨道生成一个节点:
58
-
59
- - 悬停弹出预览卡(自动防溢出定位),卡内直接显示 LaTeX / MathML / Mermaid 标记;
60
- - 点击跳转到对应消息(直接驱动聊天滚动容器,消息位于嵌套滚动区时也能居中);
61
- - 拖动滑块或在轨道上滚轮滚动(轨道替代原生滚动条);
62
- - 节点支持星标(可只显示星标)、在该消息处创建分支会话、一键复制全文。
63
-
64
- 节点按渲染出的用户消息行定位(DOM 行 sourcing),加载历史后自动刷新;轨道尾部最多保留 400 个节点。
52
+ - **玻璃效果**:所有 Custom 面板默认毛玻璃;可切换液态玻璃(边缘位移折射 + 轻微模糊提饱和,大面积面板中部文字仍清晰;不支持 SVG 位移滤镜的引擎自动回退毛玻璃)。「全局浮层玻璃」对弹窗、菜单、提示框、下拉框与系统设置窗统一加玻璃质感,液态模式下浮层同样位移折射。
65
53
 
66
54
  ### 项目文件夹
67
55
 
@@ -99,12 +87,13 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
99
87
 
100
88
  ### 额度与用量
101
89
 
102
- 会话头部常驻额度徽标(可点击固定),额度面板提供:
90
+ 会话头部常驻用量徽标(可点击固定):配置了 API Key 时显示官方余额,未配置时显示本机费用估算(如 `≈¥0.42`)与今日调用次数。面板提供:
103
91
 
104
- - **余额**:调用官方 `https://api.deepseek.com/user/balance` 接口,优先显示 CNY,赠送与充值余额分列,并显示账户可用状态。
105
- - **Key 解析顺序**:系统凭据存储(可用时)→ 插件旧状态文件中的 Key → 环境变量 `DEEPSEEK_API_KEY` / `DEEPSEEK_KEY` / `DEEPSEEK_TOKEN`(取值需以 `sk-` 开头)→ DSH 凭据文件 `$DSH_HOME/.credentials.yaml`(自动复用 DSH 已配置的 DeepSeek key,无需重复填写)。
92
+ - **用量与费用(默认区,无 Key 可用)**:今日/历史用量、预算与费用估算全部来自本机会话记录,不需要任何密钥。
93
+ - **余额查询(可折叠可选项,需要 API Key)**:调用官方 `https://api.deepseek.com/user/balance` 接口,优先显示 CNY,赠送与充值余额分列,并显示账户可用状态;未配置 Key 时该区收起、不显示任何报错。宿主外呼走本机直连(不读系统代理);若本机代理/安全软件间歇性对 HTTPS 做 TLS 解密,查询会以「TLS 证书校验失败」等可读原因失败并自动重试(8s/30s/30s,60 秒轮询兜底),顶栏悬停可见原因。
94
+ - **Key 解析顺序**:系统凭据存储(可用时)→ 插件旧状态文件中的 Key → 环境变量 `DEEPSEEK_API_KEY` / `DEEPSEEK_KEY` / `DEEPSEEK_TOKEN`(取值需以 `sk-` 开头)→ DSH 凭据文件 `$DSH_HOME/.credentials.yaml`(自动复用 DSH 已配置的 DeepSeek key,无需重复填写)。桌面版账号登录没有 sk- 密钥,属正常状态。
106
95
  - **今日用量**:按模型统计输入 / 输出 / 缓存 token 与调用次数,实时折叠自 `session/event` 事件。
107
- - **费用估算**:按 DeepSeek 当前官方峰谷价目估算——高峰为北京时间周一至周五 9–12、14–18 时;其余时间(含周末)均为空闲时段,按半价计:`deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` ¥3 / ¥9,`deepseek-v4-pro` ¥9 / ¥27(每百万 tokens 输入 / 输出,缓存写入 ¥0.1 / ¥0.3;已停用的 `deepseek-chat` / `deepseek-reasoner` 按 v4-flash 计),仅供参考。
96
+ - **费用估算**:按 DeepSeek 当前官方峰谷价目估算(2026-09-30 核对)——高峰为北京时间周一至周五 9–12、14–18 时;其余时间(含周末)均为空闲时段,按半价计:`deepseek-flash`(旧名 `deepseek-v4-flash` / `deepseek-v4-flash-vision-exp` 仍按 Flash 计价路由)峰值 ¥2 / ¥8,`deepseek-v4-pro` ¥9 / ¥27(每百万 tokens 峰时输入 / 输出,缓存命中 ¥0.04 / 写入与未命中输入同价档),仅供参考。
108
97
  - **扫描**:「扫描今日会话日志」重放全部会话、按事件自身时间戳归入今日(跨午夜会话不丢量),完成后显示扫描到的活跃会话数。
109
98
  - **历史与预算**:查看 7 / 30 / 90 天趋势和按模型汇总,导出 UTF-8 CSV;可设置人民币月预算与预警比例。
110
99
 
@@ -133,7 +122,7 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
133
122
 
134
123
  ## 安装
135
124
 
136
- 前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。本版本面向 **dsh 0.1.7-rc.2 及其后的 0.1.x,外加 0.2.0-rc.2**:dsh 在安装与启动时会用自身版本校验 bundle 的 `@deepseek-ai/dsh-*` peer 范围,不匹配的 bundle 会被整包跳过,所以 `package.json` 只写出本包实际构建并实测过的那些版本。0.6.0 是针对 0.2.0-rc.2 做类型检查与构建的,同一个产物在两条运行时线上都跑过活体宿主探针:0.2.0-rc.2(boot 图 66 行)与 0.1.7-rc.2(65 行)各 19 项里 18 项通过,跳过的那项需要真实会话。验不到的部分和以往一样:回合内的 chips(分叉、Mermaid 渲染、LaTeX)需要一次真实的模型回复,无凭据的临时家目录跑不出来,槽位渲染也仍要在浏览器里过一遍。范围刻意不收 0.2.0-rc.1(已被取代的预发布版)、0.2.0-rc.3 及之后谁都没看过的预发布版,以及尚未验证的 0.2.0 正式版。范围的写法在这里有讲究:`^0.1.7-rc.2` 展开成 `>=0.1.7-rc.2 <0.2.0-0`,而每一个 `0.2.0-rc.N` 都排在 `0.2.0-0` **之上**,所以实测过的预发布版本必须单独写成一段——`pnpm smoke` 会检查构建目标确实落在声明范围里,并且 `engines.dsh` 与它放行同一批版本。仍在旧版 dsh 的用户请安装对应的旧版插件(0.5.0 面向 0.1.7-rc.2),而不是授予兼容性豁免。
125
+ 前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。本版本面向 **dsh 0.1.7-rc.2 及其后的 0.1.x,外加 0.2.0-rc.2**:dsh 在安装与启动时会用自身版本校验 bundle 的 `@deepseek-ai/dsh-*` peer 范围,不匹配的 bundle 会被整包跳过,所以 `package.json` 只写出本包实际构建并实测过的那些版本。0.7.0 沿用 0.6.0 确立的构建目标(0.2.0-rc.2)与同一条 peer 范围;0.6.0 的产物在两条运行时线上跑过活体宿主探针(0.2.0-rc.2 boot 图 66 行、0.1.7-rc.2 65 行,各 19 项里 18 项通过,跳过的那项需要真实会话),0.7.0 的产物则额外在**真实桌面安装**上过了桌面形态活体探针(见下文「在 dsh 桌面版上」)。验不到的部分和以往一样:回合内的 chips(Mermaid 渲染、LaTeX)需要一次真实的模型回复,无凭据的临时家目录跑不出来,槽位渲染也仍要在浏览器里过一遍。范围刻意不收 0.2.0-rc.1(已被取代的预发布版)、0.2.0-rc.3 及之后谁都没看过的预发布版,以及尚未验证的 0.2.0 正式版。范围的写法在这里有讲究:`^0.1.7-rc.2` 展开成 `>=0.1.7-rc.2 <0.2.0-0`,而每一个 `0.2.0-rc.N` 都排在 `0.2.0-0` **之上**,所以实测过的预发布版本必须单独写成一段——`pnpm smoke` 会检查构建目标确实落在声明范围里,并且 `engines.dsh` 与它放行同一批版本。仍在旧版 dsh 的用户请安装对应的旧版插件(0.5.0 面向 0.1.7-rc.2),而不是授予兼容性豁免。
137
126
 
138
127
  ### 从 npm 安装
139
128
 
@@ -148,15 +137,22 @@ registry 上是预构建产物,安装端无需从源码构建。
148
137
 
149
138
  dsh 桌面版是同一套 Web 应用外面的一层 Electron 壳,随包携带**正好是 dsh
150
139
  0.2.0-rc.2**——桌面发布线把壳和运行时钉成同一个版本,所以桌面端拿到的永远是
151
- 0.2.x 运行时。0.6.0 的 peer 范围把这个版本写了进去,因此在桌面版上安装不需要任
152
- 何兼容性豁免;0.5.0 需要,它给出的拒绝信息和 0.2.x 的 Web profile 完全一样。
140
+ 0.2.x 运行时。0.7.0 的 peer 范围把这个版本写了进去(自 0.6.0 起),因此在桌面
141
+ 版上安装不需要任何兼容性豁免;0.5.0 需要,它给出的拒绝信息和 0.2.x 的 Web
142
+ profile 完全一样。
153
143
 
154
144
  对 0.2.0-rc.2 的实测:boot 图里有我们那一行、五个 inject 目标都在、Mermaid 引
155
- 擎本地加载,宿主侧探针的成绩与在 0.1.7-rc.2 上的一致。桌面版的请求路径也不碰本
156
- 插件的访问围栏——壳在把渲染进程的请求转发给它自己的 Host 之前会删掉 `host`、
157
- `origin`、`sec-fetch-site`、`cookie`,再挂上它自己的凭证,而 loopback 围栏接受
158
- 的正是这个形状(这条围栏此前只有实跑脚本覆盖,如今有了单测)。没做的是在真的桌
159
- 面窗口里打开这个插件;那一遍验收归装它的人,而且要用你的登录。
145
+ 擎本地加载,宿主侧探针的成绩与在 0.1.7-rc.2 上的一致。访问围栏与官方 API 围栏
146
+ 同一套信任语义:回环套接字 + 回环 Host、非 `cross-site`、`origin` 缺省或与
147
+ Host 一致即放行。壳在把渲染进程的请求转发给它自己的 Host 之前会删掉 `host`、
148
+ `origin`、`sec-fetch-site`、`cookie`,再挂上它自己的凭证——这种无标记形状因此
149
+ 被直接接受(0.6.0 及之前的围栏还额外要求同源标记,曾把这套形状全部误拒为
150
+ forbidden,0.7.0 起修复并补了围栏级单测)。异源与跨站请求仍然 403。**0.7.0 的
151
+ 产物已在真实桌面安装上按桌面转发形状逐路由实测过**(升级到本构建、重启桌面
152
+ 版、跑 `scripts/desktop-shape-probe.mjs`):state / debug / backup / 用量扫描 /
153
+ Mermaid 引擎预加载与脚本路由全部 200,异源与跨站仍 403;时间线与三种导出、
154
+ 搜索在 GUI 里产生第一个会话后由同一探针补验。桌面窗口内的视觉验收(液态玻璃
155
+ 观感、面板布局、点阵清除)归装它的人过目。
160
156
 
161
157
  管桌面 profile 要用桌面版自带的 `dsh` 命令,不是 npm 装的那个——公开 CLI 拒绝
162
158
  保留的 `desktop` profile:
@@ -204,14 +200,11 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
204
200
 
205
201
  | 配置项 | 默认值 | 说明 |
206
202
  |---|---|---|
207
- | `bg` | `天青灰` | `default`(无颜色)/ `aurora`(极光)/ 20 组调色板名之一 |
203
+ | `bg` | `天青灰` | `default`(无颜色)/ 20 组调色板名之一(深浅色通用;旧存档的 `aurora` 自动迁移为 `default`) |
208
204
  | `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
209
205
  | `glass` | `true` | Custom 面板玻璃总开关 |
210
206
  | `glassMode` | `frost` | `frost` 毛玻璃 / `liquid` 液态玻璃 |
211
207
  | `globalGlass` | `true` | 全局浮层(弹窗/菜单/提示)加模糊 |
212
- | `timeline` | `true` | 时间线轨道开关 |
213
- | `timelineLeft` | `false` | 轨道放左侧 |
214
- | `starsOnly` | `false` | 只显示星标节点 |
215
208
  | `quote` | `true` | 划词引用回复 |
216
209
  | `antiScroll` | `false` | 防自动跳底 |
217
210
  | `mermaid` | `true` | Mermaid 图表自动就地渲染(含消息下方渲染按钮) |
@@ -233,7 +226,7 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
233
226
  - 额度面板会显示峰/闲 token 与费用分布,并提供官方价目链接;没有峰时字段的历史行会标记为“不精确”,不计入费用总额,重新扫描后可更新。
234
227
  - 系统凭据存储会在宿主启动时检测 profile `node_modules` 中的 `keytar` 模块;无法加载时使用兼容的状态文件回退。
235
228
  - 费用按 DeepSeek 官方峰谷单价估算,仅供参考。
236
- - 深色模式下背景限制是刻意设计:仅「无颜色」与「极光」可选。
229
+ - 色板在深色模式自动派生同色系深色变体(保留色相与低饱和)。
237
230
  - dsh 0.1.7 起支持自定义快捷键。快捷面板固定占用 `Ctrl/Cmd+K`(不带 Alt/Shift,且编辑器内不触发)。dsh 在 **web** 上的默认值是 `Ctrl+Alt+K`(桌面版默认才是裸 `Ctrl+K`),所以开箱并不冲突;但你可以把某个 dsh 命令重新绑到 `Ctrl+K`,那样两者会同时响应,请把其中一个换开。
238
231
  - DSH 当前没有公开的归档恢复接口;插件不会绕过官方边界修改底层注册表。
239
232
  - dsh 自带的 `web` profile 把 session-query 索引配成 `openAt: never`,即默认不启用全文搜索。此时会话内搜索改为直接扫描日志(按出现顺序,最多 100 条),快捷面板的跨会话搜索会显示 dsh 给出的不可用原因。
@@ -252,10 +245,17 @@ pnpm smoke # 构建后契约自检:加载器握手、dsh 会读的清
252
245
  `scripts/live-dsh-check.sh` 是另一条**手动**探针,对着一个正在运行的隔离 dsh profile
253
246
  (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`),在真实会话数据上跑宿主侧全链路:
254
247
  时间线、三种导出、搜索扫描路径、用量扫描、备份、Mermaid 引擎路由、客户端→宿主的诊断回环、
255
- 一次会还原并校验提示词库的 UTF-8 往返,以及两处同源/loopback 围栏。默认拒绝在真实的
248
+ 一次会还原并校验提示词库的 UTF-8 往返,以及访问围栏的三种形态(无标记回环放行、异源拒绝、跨站拒绝)。默认拒绝在真实的
256
249
  `~/.dsh` 上运行(需显式 `ALLOW_REAL_DSH_HOME=1`),逐项报 PASS/FAIL,被 `SKIP` 的项会计数并写进收尾行,任一失败即非零退出。
257
250
  CI 没有可对话的宿主,所以每次 dsh 发版都建议跑一遍;槽位注册与渲染仍需按上文用浏览器过一遍。
258
251
 
252
+ `scripts/desktop-shape-probe.mjs` 是第三条探针,面向**正在运行的 dsh 桌面版**
253
+ (Host 默认 `127.0.0.1:19387`,可用 `DSH_PORT` 覆盖):以桌面壳转发的请求形状
254
+ (回环 Host、无 `origin` / `sec-fetch-site`)逐路由探测 state / debug / backup /
255
+ 用量扫描 / Mermaid 引擎与脚本路由,发现宿主已注册的会话后补跑时间线、三种导出
256
+ 与搜索;异源与跨站探针必须仍是 403。全程只读,不写状态文件;GUI 里还没有会话
257
+ 时先发一条消息再重跑即可。
258
+
259
259
  自己验一个新 dsh 版本只要四条命令,且全程不碰你自己的 harness 家目录:
260
260
 
261
261
  ```bash
@@ -269,6 +269,18 @@ DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash s
269
269
  `dsh plugin --profile web allow-version <包名>@<版本> --dsh-version <版本> --accept-risk`
270
270
  授予精确版本豁免——这样探针能告诉你**到底是什么坏了**,而不是只看到闸口拒绝。
271
271
 
272
+ 验**桌面版**发版要往前多走一步,因为仓库回答不了"用户装的那一版里到底是哪个 dsh":
273
+ 桌面版把壳和 `@deepseek-ai/dsh` 钉成同一个精确版本,整套运行时打在
274
+ `resources/app.asar` 里。直接读装好的那个 app,命令只读不写,它会把内置版本连同
275
+ "本仓库声明的 peer 范围收不收它"一起打出来:
276
+
277
+ ```bash
278
+ node scripts/desktop-runtime.mjs "D:/DSH" # 传安装目录
279
+ node scripts/desktop-runtime.mjs "D:/DSH/resources/app.asar" # 或直接传归档文件
280
+ ```
281
+
282
+ 拿到版本号后,再按上面四条命令对着它跑一遍。
283
+
272
284
  ## 许可证
273
285
 
274
286
  Apache-2.0。部分代码参考 [Nagi-ovo/voyager](https://github.com/Nagi-ovo/voyager) 与 [unovue/inspira-ui](https://github.com/unovue/inspira-ui)。