@alexpeng/dsh-custom-plugin 0.5.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/CHANGELOG.md +598 -394
- package/README.i18n.yaml +2 -2
- package/README.md +91 -33
- package/README.zh.md +73 -31
- package/lib/client.js +473 -933
- package/lib/client.js.map +1 -1
- package/lib/index.js +58 -18
- package/lib/types/client/custom.d.ts +1 -5
- package/lib/types/client/palette.d.ts +31 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/host-service.d.ts +9 -0
- package/lib/types/loopback.d.ts +14 -7
- package/lib/types/pricing.d.ts +1 -1
- package/lib/types/protocol.d.ts +2 -7
- package/lib/types/routes.d.ts +4 -4
- package/lib/types/state.d.ts +9 -0
- package/package.json +14 -13
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:
|
|
7
|
-
README.zh.md:
|
|
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,
|
|
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>
|
|
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>
|
|
37
|
-
<td width="50%" valign="top" align="center"><b>
|
|
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>
|
|
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
|
|
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)
|
|
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 (
|
|
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
|
|
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
|
-
- **
|
|
105
|
-
- **
|
|
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` ¥
|
|
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
|
|
|
@@ -120,7 +109,8 @@ The `custom_plugin_status` tool reports appearance config, today's per-model usa
|
|
|
120
109
|
|
|
121
110
|
| plugin release | dsh it was built and verified against | status |
|
|
122
111
|
| --- | --- | --- |
|
|
123
|
-
| 0.
|
|
112
|
+
| 0.6.x | dsh 0.1.7-rc.2 and dsh 0.2.0-rc.2 (peer range names both; see Install) | this release |
|
|
113
|
+
| 0.5.x | dsh 0.1.7-rc.2 (peer range `>=0.1.7-rc.2 <0.2.0-0`) | fine on 0.1.x; refused on any 0.2.x host, including dsh Desktop |
|
|
124
114
|
| 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 era | superseded; do not expect it to work on 0.1.7+ |
|
|
125
115
|
|
|
126
116
|
0.1.7 changed the plugin-facing contracts this suite depends on (session
|
|
@@ -136,7 +126,7 @@ report their service as missing rather than throwing.
|
|
|
136
126
|
|
|
137
127
|
## Install
|
|
138
128
|
|
|
139
|
-
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** — 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`
|
|
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.
|
|
140
130
|
|
|
141
131
|
### From npm
|
|
142
132
|
|
|
@@ -147,6 +137,51 @@ dsh plugin --profile web add @alexpeng/dsh-custom-plugin
|
|
|
147
137
|
|
|
148
138
|
The registry tarball ships prebuilt output — no source build on the installing machine.
|
|
149
139
|
|
|
140
|
+
### On dsh Desktop
|
|
141
|
+
|
|
142
|
+
dsh Desktop is an Electron shell around the same Web application, and it bundles
|
|
143
|
+
**exactly dsh 0.2.0-rc.2** — the desktop release line pins the shell and the
|
|
144
|
+
runtime together, so a Desktop install is always a 0.2.x runtime. 0.7.0 names
|
|
145
|
+
that version in its peer range and installs there with no compatibility
|
|
146
|
+
exemption; 0.5.0 did not, and was refused with the same message a 0.2.x Web
|
|
147
|
+
profile prints.
|
|
148
|
+
|
|
149
|
+
Measured against 0.2.0-rc.2: the boot graph carries our row and all five inject
|
|
150
|
+
targets, the Mermaid engine loads locally, and the host probes score the same
|
|
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.
|
|
167
|
+
|
|
168
|
+
Managing the desktop profile takes the `dsh` command that ships with Desktop, not
|
|
169
|
+
the npm one — the public CLI refuses the reserved `desktop` profile:
|
|
170
|
+
|
|
171
|
+
1. Start Desktop once so the profile exists, then quit it fully (closing the
|
|
172
|
+
window only hides it; on Windows use the tray).
|
|
173
|
+
2. `dsh plugin --profile desktop add @alexpeng/dsh-custom-plugin`
|
|
174
|
+
3. Reopen Desktop. The in-app Plugin Manager installs and updates against the
|
|
175
|
+
same profile using Desktop's own bundled pnpm, if you would rather not open a
|
|
176
|
+
terminal.
|
|
177
|
+
|
|
178
|
+
Appearance, prompt library, project folders, stars and usage all live in
|
|
179
|
+
`$DSH_HOME/custom-plugin-state.json`, which Desktop and Web share by design —
|
|
180
|
+
each keeps its own `profiles/<name>` for code, never for that file — so
|
|
181
|
+
switching between the two shows the same data. Both hosts can therefore write it
|
|
182
|
+
at once, which is why the state replace names its temp file after the writing
|
|
183
|
+
process.
|
|
184
|
+
|
|
150
185
|
### From GitHub (source install)
|
|
151
186
|
|
|
152
187
|
```sh
|
|
@@ -178,14 +213,11 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
|
|
|
178
213
|
|
|
179
214
|
| Key | Default | Meaning |
|
|
180
215
|
|---|---|---|
|
|
181
|
-
| `bg` | `天青灰` | `default` (no color) /
|
|
216
|
+
| `bg` | `天青灰` | `default` (no color) / one of the 20 palette names (both themes; a stored `aurora` migrates to `default`) |
|
|
182
217
|
| `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
|
|
183
218
|
| `glass` | `true` | master glass toggle for Custom surfaces |
|
|
184
219
|
| `glassMode` | `frost` | `frost` frosted / `liquid` displacement glass |
|
|
185
220
|
| `globalGlass` | `true` | blur global overlays (dialogs/menus/tooltips) |
|
|
186
|
-
| `timeline` | `true` | timeline rail toggle |
|
|
187
|
-
| `timelineLeft` | `false` | rail on the left |
|
|
188
|
-
| `starsOnly` | `false` | show only starred nodes |
|
|
189
221
|
| `quote` | `true` | selection quote reply |
|
|
190
222
|
| `antiScroll` | `false` | anti auto-scroll |
|
|
191
223
|
| `mermaid` | `true` | automatic in-place Mermaid rendering (plus render chips) |
|
|
@@ -207,7 +239,7 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
|
|
|
207
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.
|
|
208
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.
|
|
209
241
|
- Cost estimates use DeepSeek's official peak/off-peak list prices and are indicative only.
|
|
210
|
-
-
|
|
242
|
+
- Palettes derive a same-family dark variant in dark mode (hue and low saturation kept).
|
|
211
243
|
- DSH currently exposes no archive-restore API; the plugin does not bypass that boundary by editing the underlying registry.
|
|
212
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.
|
|
213
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.
|
|
@@ -228,12 +260,24 @@ isolated dsh profile (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`
|
|
|
228
260
|
it exercises the host half on real session data — timeline, the three export
|
|
229
261
|
formats, the search scan path, usage scan, backup, the Mermaid engine route, the
|
|
230
262
|
client→host diagnostic ring, a UTF-8 state round trip that restores and then
|
|
231
|
-
verifies your prompt library, and
|
|
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
|
|
232
266
|
real `~/.dsh` unless you set `ALLOW_REAL_DSH_HOME=1`, reports `PASS`/`FAIL` per
|
|
233
267
|
probe, counts and names anything it `SKIP`s, and exits non-zero on any failure.
|
|
234
268
|
CI has no harness to talk to, so run it whenever a dsh release lands; slot
|
|
235
269
|
registration and rendering still need the browser pass described above.
|
|
236
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
|
+
|
|
237
281
|
Checking a new dsh release takes four commands, and never touches your own
|
|
238
282
|
harness home:
|
|
239
283
|
|
|
@@ -250,6 +294,20 @@ and rolls the profile back; `dsh plugin --profile web allow-version <pkg>@<ver>
|
|
|
250
294
|
probe can tell you *what* actually breaks instead of what the gate already
|
|
251
295
|
refused.
|
|
252
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
|
+
|
|
253
311
|
## License
|
|
254
312
|
|
|
255
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
|
|
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
|
|
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
|
-
|
|
44
|
+
天气特效截自深色模式。额度历史、备份导入预览、会话搜索与快捷面板属于同一套动态面板,需在 DSH 内打开对应页查看;仓库未另附固定截图。
|
|
46
45
|
|
|
47
46
|
## 功能
|
|
48
47
|
|
|
49
48
|
### 外观个性化
|
|
50
49
|
|
|
51
|
-
- **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI
|
|
50
|
+
- **背景颜色**:20 组低饱和典雅色(每组合配 tab 栏色,默认「天青灰」),另有「无颜色」(跟随 GUI 默认主题)。深浅色模式均可选用;深色模式自动派生同色系的深色变体(保留色相与低饱和,落到深色明度档),色板预览即当前模式的实际效果。
|
|
52
51
|
- **天气特效**:画布渲染、不挡交互,一键切换——飘雪、电影感雨滴(三层景深 + 地面溅起)、樱花飘落;关闭时自动清空画布。
|
|
53
|
-
- **玻璃效果**:所有 Custom
|
|
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
|
-
-
|
|
105
|
-
-
|
|
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
|
|
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
|
|
|
@@ -120,7 +109,8 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
|
|
|
120
109
|
|
|
121
110
|
| 插件版本 | 构建并实测过的 dsh | 状态 |
|
|
122
111
|
| --- | --- | --- |
|
|
123
|
-
| 0.
|
|
112
|
+
| 0.6.x | dsh 0.1.7-rc.2 与 dsh 0.2.0-rc.2(peer 范围两个都写进去了,见「安装」) | 本版本 |
|
|
113
|
+
| 0.5.x | dsh 0.1.7-rc.2(peer 范围 `>=0.1.7-rc.2 <0.2.0-0`) | 在 0.1.x 上没问题;任何 0.2.x 宿主都会拒绝它,dsh 桌面版也算 |
|
|
124
114
|
| 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 时代 | 已被取代,在 0.1.7+ 上不要指望可用 |
|
|
125
115
|
|
|
126
116
|
0.1.7 改掉了本套件依赖的插件侧契约(会话导航归 `ctx.uiWorkspace`、会话列表不再提供
|
|
@@ -132,7 +122,7 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
|
|
|
132
122
|
|
|
133
123
|
## 安装
|
|
134
124
|
|
|
135
|
-
前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。本版本面向 **dsh 0.1.7-rc.2 及其后的 0.1.x**:dsh 在安装与启动时会用自身版本校验 bundle 的 `@deepseek-ai/dsh-*` peer 范围,不匹配的 bundle 会被整包跳过,所以 `package.json`
|
|
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),而不是授予兼容性豁免。
|
|
136
126
|
|
|
137
127
|
### 从 npm 安装
|
|
138
128
|
|
|
@@ -143,6 +133,42 @@ dsh plugin --profile web add @alexpeng/dsh-custom-plugin
|
|
|
143
133
|
|
|
144
134
|
registry 上是预构建产物,安装端无需从源码构建。
|
|
145
135
|
|
|
136
|
+
### 在 dsh 桌面版上
|
|
137
|
+
|
|
138
|
+
dsh 桌面版是同一套 Web 应用外面的一层 Electron 壳,随包携带**正好是 dsh
|
|
139
|
+
0.2.0-rc.2**——桌面发布线把壳和运行时钉成同一个版本,所以桌面端拿到的永远是
|
|
140
|
+
0.2.x 运行时。0.7.0 的 peer 范围把这个版本写了进去(自 0.6.0 起),因此在桌面
|
|
141
|
+
版上安装不需要任何兼容性豁免;0.5.0 需要,它给出的拒绝信息和 0.2.x 的 Web
|
|
142
|
+
profile 完全一样。
|
|
143
|
+
|
|
144
|
+
对 0.2.0-rc.2 的实测:boot 图里有我们那一行、五个 inject 目标都在、Mermaid 引
|
|
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
|
+
观感、面板布局、点阵清除)归装它的人过目。
|
|
156
|
+
|
|
157
|
+
管桌面 profile 要用桌面版自带的 `dsh` 命令,不是 npm 装的那个——公开 CLI 拒绝
|
|
158
|
+
保留的 `desktop` profile:
|
|
159
|
+
|
|
160
|
+
1. 先启动一次桌面版让 profile 建立,然后完全退出(关窗口只是隐藏;Windows 上
|
|
161
|
+
从托盘退出)。
|
|
162
|
+
2. `dsh plugin --profile desktop add @alexpeng/dsh-custom-plugin`
|
|
163
|
+
3. 重新打开桌面版。应用内的插件管理器也用桌面版自带的 pnpm 在同一个 profile 上
|
|
164
|
+
安装和更新,不想开终端就用它。
|
|
165
|
+
|
|
166
|
+
外观、提示词库、项目文件夹、星标和用量都存在
|
|
167
|
+
`$DSH_HOME/custom-plugin-state.json`,这个文件按设计由桌面版和 Web 共享——两
|
|
168
|
+
边各自持有自己的 `profiles/<名字>`,那里面只放代码不放这个文件——所以在两者
|
|
169
|
+
之间切换看到的是同一份数据。两个宿主因此可能同时写它,这就是状态替换把临时文
|
|
170
|
+
件按写入进程的 pid 命名的原因。
|
|
171
|
+
|
|
146
172
|
### 从 GitHub 安装(源码安装)
|
|
147
173
|
|
|
148
174
|
```sh
|
|
@@ -174,14 +200,11 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
|
|
|
174
200
|
|
|
175
201
|
| 配置项 | 默认值 | 说明 |
|
|
176
202
|
|---|---|---|
|
|
177
|
-
| `bg` | `天青灰` | `default`(无颜色)/ `aurora
|
|
203
|
+
| `bg` | `天青灰` | `default`(无颜色)/ 20 组调色板名之一(深浅色通用;旧存档的 `aurora` 自动迁移为 `default`) |
|
|
178
204
|
| `weather` | `none` | `none` / `snow` / `rain` / `sakura` |
|
|
179
205
|
| `glass` | `true` | Custom 面板玻璃总开关 |
|
|
180
206
|
| `glassMode` | `frost` | `frost` 毛玻璃 / `liquid` 液态玻璃 |
|
|
181
207
|
| `globalGlass` | `true` | 全局浮层(弹窗/菜单/提示)加模糊 |
|
|
182
|
-
| `timeline` | `true` | 时间线轨道开关 |
|
|
183
|
-
| `timelineLeft` | `false` | 轨道放左侧 |
|
|
184
|
-
| `starsOnly` | `false` | 只显示星标节点 |
|
|
185
208
|
| `quote` | `true` | 划词引用回复 |
|
|
186
209
|
| `antiScroll` | `false` | 防自动跳底 |
|
|
187
210
|
| `mermaid` | `true` | Mermaid 图表自动就地渲染(含消息下方渲染按钮) |
|
|
@@ -203,7 +226,7 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
|
|
|
203
226
|
- 额度面板会显示峰/闲 token 与费用分布,并提供官方价目链接;没有峰时字段的历史行会标记为“不精确”,不计入费用总额,重新扫描后可更新。
|
|
204
227
|
- 系统凭据存储会在宿主启动时检测 profile `node_modules` 中的 `keytar` 模块;无法加载时使用兼容的状态文件回退。
|
|
205
228
|
- 费用按 DeepSeek 官方峰谷单价估算,仅供参考。
|
|
206
|
-
-
|
|
229
|
+
- 色板在深色模式自动派生同色系深色变体(保留色相与低饱和)。
|
|
207
230
|
- dsh 0.1.7 起支持自定义快捷键。快捷面板固定占用 `Ctrl/Cmd+K`(不带 Alt/Shift,且编辑器内不触发)。dsh 在 **web** 上的默认值是 `Ctrl+Alt+K`(桌面版默认才是裸 `Ctrl+K`),所以开箱并不冲突;但你可以把某个 dsh 命令重新绑到 `Ctrl+K`,那样两者会同时响应,请把其中一个换开。
|
|
208
231
|
- DSH 当前没有公开的归档恢复接口;插件不会绕过官方边界修改底层注册表。
|
|
209
232
|
- dsh 自带的 `web` profile 把 session-query 索引配成 `openAt: never`,即默认不启用全文搜索。此时会话内搜索改为直接扫描日志(按出现顺序,最多 100 条),快捷面板的跨会话搜索会显示 dsh 给出的不可用原因。
|
|
@@ -222,10 +245,17 @@ pnpm smoke # 构建后契约自检:加载器握手、dsh 会读的清
|
|
|
222
245
|
`scripts/live-dsh-check.sh` 是另一条**手动**探针,对着一个正在运行的隔离 dsh profile
|
|
223
246
|
(`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`),在真实会话数据上跑宿主侧全链路:
|
|
224
247
|
时间线、三种导出、搜索扫描路径、用量扫描、备份、Mermaid 引擎路由、客户端→宿主的诊断回环、
|
|
225
|
-
一次会还原并校验提示词库的 UTF-8
|
|
248
|
+
一次会还原并校验提示词库的 UTF-8 往返,以及访问围栏的三种形态(无标记回环放行、异源拒绝、跨站拒绝)。默认拒绝在真实的
|
|
226
249
|
`~/.dsh` 上运行(需显式 `ALLOW_REAL_DSH_HOME=1`),逐项报 PASS/FAIL,被 `SKIP` 的项会计数并写进收尾行,任一失败即非零退出。
|
|
227
250
|
CI 没有可对话的宿主,所以每次 dsh 发版都建议跑一遍;槽位注册与渲染仍需按上文用浏览器过一遍。
|
|
228
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
|
+
|
|
229
259
|
自己验一个新 dsh 版本只要四条命令,且全程不碰你自己的 harness 家目录:
|
|
230
260
|
|
|
231
261
|
```bash
|
|
@@ -239,6 +269,18 @@ DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash s
|
|
|
239
269
|
`dsh plugin --profile web allow-version <包名>@<版本> --dsh-version <版本> --accept-risk`
|
|
240
270
|
授予精确版本豁免——这样探针能告诉你**到底是什么坏了**,而不是只看到闸口拒绝。
|
|
241
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
|
+
|
|
242
284
|
## 许可证
|
|
243
285
|
|
|
244
286
|
Apache-2.0。部分代码参考 [Nagi-ovo/voyager](https://github.com/Nagi-ovo/voyager) 与 [unovue/inspira-ui](https://github.com/unovue/inspira-ui)。
|