@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/CHANGELOG.md CHANGED
@@ -1,498 +1,598 @@
1
- # Changelog
2
-
3
- All notable changes to this project are documented here. The format loosely
4
- follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
- follow [Semantic Versioning](https://semver.org/).
6
-
7
- ## 0.6.0 — not yet published
8
-
9
- ### Changed
10
-
11
- - **Built against dsh 0.2.0-rc.2, and the declared range now names it.** Every
12
- `@deepseek-ai/dsh-*` devDependency moved to 0.2.0-rc.2 and the source
13
- type-checked against that release's own published types with no source
14
- changes. The gate-relevant peer became
15
- `@deepseek-ai/dsh-tools >=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3`,
16
- and `engines.dsh` was set to the same range. That spelling is load-bearing:
17
- `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N`
18
- sorts above `0.2.0-0`, so no caret form can admit a verified prerelease — and
19
- `^0.2.0-rc.2` would additionally admit 0.2.0 stable plus every later 0.2.x,
20
- which is exactly the unverified support this range exists to withhold.
21
- 0.2.0-rc.1 is left out on purpose: the bundle is now built for rc.2.
22
- - `pnpm smoke`'s two range checks were rewritten, because both encoded the old
23
- premise that a peer range is a single caret pin. They now assert what is
24
- actually load-bearing: the installed build target must **satisfy** the peer
25
- range (same comparator and `includePrerelease` semantics dsh's own gate uses),
26
- a range that admits every version is rejected as stating no support at all,
27
- and `engines.dsh` must admit the same versions as the peer range across ten
28
- probed releases. `semver` became a devDependency to make the first check
29
- possible. Verified by mutation: a stale range, a `*` range, and a diverging
30
- `engines.dsh` each turn the gate red.
31
- - The desktop release line pins its shell and runtime together, so dsh Desktop
32
- always ships one exact dsh version — this is why 0.2.0-rc.2 stopped being a
33
- speculative target: any Desktop install *is* that runtime.
34
-
35
- ### Added
36
-
37
- - `tests/loopback.spec.ts`: the request-level fence had never had a unit test —
38
- only the live probe script exercised it. Twelve tests now pin the two header
39
- shapes dsh Desktop's shell produces (`web-document.ts` deletes `host`,
40
- `origin`, `cookie` and `sec-fetch-site` before forwarding; the WebSocket
41
- upgrade rewrites `Origin` to the Host authority), plus the rejections a
42
- forged Origin, a cross-site marker, and a non-loopback socket must still get.
43
- - README (both languages) gained an "On dsh Desktop" section: how the shell
44
- routes requests, why the profile is managed by Desktop's own `dsh` command,
45
- and which part still needs a window and a login.
46
-
47
- ### Fixed
48
-
49
- - **A second dsh host could read a half-written state document.** The atomic
50
- replace wrote to one shared temp name, `custom-plugin-state.json.tmp`, while
51
- the queue that serializes saves lives inside a single process. dsh Desktop
52
- owns `$DSH_HOME/profiles/desktop` and the Web profile owns `profiles/web`,
53
- but both hosts read and write the same
54
- `$DSH_HOME/custom-plugin-state.json`, so two hosts saving at the same moment
55
- wrote and renamed that one temp file against each other — the Windows
56
- EPERM/EBUSY shape this queue was built to stop, reachable across processes.
57
- Temp names are now qualified by the writing pid (both the state document and
58
- the pre-import recovery backup), and a failed turn deletes its own temp
59
- instead of leaving a per-pid file behind. Building that cleanup surfaced a
60
- second bug: `rm` was used in the new `catch` but never imported, so a failed
61
- save reported `ReferenceError` instead of the real rename error and left the
62
- temp file on disk.
63
-
64
- ### Verified
65
-
66
- - **dsh 0.2.0-rc.2, the version Desktop ships.** Confirmed from the installed
67
- app's own bytes, not the repository: `resources/app.asar/dsh/desktop-runtime.json`
68
- records `release.version 0.2.0-rc.2`, `node 24.18.1`, `pnpm 11.7.0`, and lists
69
- `@deepseek-ai/dsh 0.2.0-rc.2` with `@deepseek-ai/cordis 4.0.4` (the version
70
- this package's cordis peer already names) among its shared packages.
71
- - 0.5.0 on that runtime behaved as predicted: `dsh plugin --profile web add`
72
- refused it, naming `peerDependencies {"@deepseek-ai/dsh-tools":"^0.1.7-rc.2"}`,
73
- and rolled the profile back. With the exemption granted, 18 of 19 live host
74
- probes passed, 0 failed.
75
- - **0.6.0 installs on 0.2.0-rc.2 with no exemption at all** (`plugin add` exit
76
- 0, profile kept), and the same 18-pass/1-skip/0-fail result holds there and on
77
- 0.1.7-rc.2 — boot graph 66 module rows on 0.2.0-rc.2 and 65 on 0.1.7-rc.2, our
78
- row served, all
79
- five `dsh.client.inject` targets present, Mermaid engine loaded locally, UTF-8
80
- state round trip restored. The single skip is the session-dependent probe; a
81
- credential-free scratch home holds no session.
82
- - The rebuild of `pnpm-lock.yaml` (required: the old lockfile cached a
83
- `minimumReleaseAge` policy snapshot that no longer matched the allow-list, so
84
- every install was rejected) also moved the dev tree's `mermaid` from 11.17.0
85
- to 11.17.2. That is inside the declared `^11.6.0`, and the scratch profiles
86
- used for the live probes resolved 11.17.2 themselves, so the measured Mermaid
87
- engine is the version an installing user gets.
88
- - The installed `lib/client.js` is byte-identical to the repository build
89
- (207762 bytes, sha256 prefix `f559cd7f1bd8a49a`). The *served* bundle is 49
90
- bytes larger because dsh's composite `/plugins/??…` route joins modules with
91
- `;\n` and rewrites the `sourceMappingURL` — so byte identity is asserted at
92
- the installed file, never at the HTTP response.
93
- - 126 unit tests pass, typecheck is clean, `pnpm smoke` and `check:readme` are
94
- green. Not verified: opening the plugin inside a real Desktop window (needs a
95
- login), the desktop profile's own composition, and the per-turn chips.
96
-
97
- ## 0.5.0 — 2026-09-28
98
-
99
- ### Changed
100
-
101
- - **Target dsh 0.1.7-rc.2.** All `@deepseek-ai/dsh-*` dependencies, the
102
- `@deepseek-ai/dsh-tools` peer range, and `@deepseek-ai/cordis` moved to the
103
- versions that release ships, and `engines.dsh` now states the supported range.
104
- dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own runtime
105
- version at install and startup and skips a bundle that does not match. The
106
- declared floor is the release this package was built and verified against;
107
- `^0.1.7-rc.2` additionally admits later 0.1.x releases that have not been
108
- re-verified, and `engines.dsh` is declarative — no part of dsh reads it.
109
- - The browser half declares `dsh.client.inject` as the five packages that own
110
- the slots it registers into, replacing the retired
111
- `@deepseek-ai/dsh-client-runtime` row.
112
- - Slot-provided data shapes (`SessionListState`, `WorkspaceListState`,
113
- `TurnLocation`) are now declared locally instead of imported from harness
114
- controller packages that rename across releases; only `SnapshotSelectorHook`
115
- still comes from the slot SDK.
116
- - In-session search uses dsh's event index when the deployment opens one and
117
- otherwise scans the session log it already read, reporting which path answered
118
- in the panel. dsh's shipped `web` profile configures the index with
119
- `openAt: never`, so the indexed route was unavailable on a default install.
120
- - Plugin Manager cards, bundle details, and the settings inventory now show a
121
- real name and icon: `locale/en.json`, `locale/zh.json`, and `icon.svg`.
122
-
123
- ### Fixed
124
-
125
- - **The timeline rail, export, and quote features lost the current session.**
126
- The session list snapshot has had no `current` field since dsh
127
- 0.1.6-alpha.2 (view selection moved to the Workspace browser), so the rail
128
- tracked nothing. The viewed session now comes from the standard `sessionId`
129
- prop every session-scoped slot entry receives.
130
- - **Opening a session or a workspace failed silently.** `ctx.sessions.open` is
131
- gone; navigation goes through `ctx.uiWorkspace.openSession()` /
132
- `connectWorkspace()`. Branching and full-text search go through
133
- `ctx.remote.session.fork()` / `.search()` — `ctx.sessions` still declares
134
- those two, but the remote namespace is the documented surface — each with an
135
- honest failure message when the service is absent.
136
- - **Exports lost tool results and the new model-visible messages.** The
137
- `tool-result` content block was replaced by a tool-role message whose call id
138
- now sits on the message (`toolCallId`, still falling back to `source.callId`
139
- for older logs); `system/message` and `developer/message` are exported as
140
- injected context; and `file`, `tool-addition`, `tool-removal`, and offloaded
141
- `image` blocks are named instead of dropped.
142
- - `conversation.chat.turnTail` changed from a chain slot to a list slot, so its
143
- `select` registration option no longer applies and was replaced by an id and
144
- order.
145
- - Client diagnostics are throttled per message kind. The previous single shared
146
- window let the frequently emitted rail line swallow the one-shot timeline
147
- result line, which made a successful timeline fetch look like zero turns.
148
- - `pnpm smoke` now checks the manifest fields dsh reads before it activates a
149
- bundle (client platform and `./client` export, patch path, icon size, locale
150
- display metadata, and peer ranges agreeing with the build target), so an
151
- unsupported or stale declaration fails the local gate instead of being skipped
152
- silently in a user's profile. The peer check refuses to read a range form it
153
- cannot interpret, and every `files` entry must resolve to something in the tree
154
- — an entry matching nothing used to publish a bundle missing that piece. Both
155
- new rules were confirmed red by breaking them on purpose. The
156
- `dsh.client.inject` rows are counted, not resolved: only a running shell knows
157
- which module ids it serves, so a retired name there is caught by the live
158
- boot-graph probe below, not by this gate.
159
- - A search excerpt now extends its window so a pasted query longer than two
160
- thirds of the excerpt is still shown whole. Measured first: the previous
161
- centering already covered ordinary queries, including a hit at the very end of
162
- a long message, so only the long-query case was affected — the fix is narrow,
163
- and the added test fails against the old formula.
164
- - Exports no longer fail outright on a `tool/result` event whose `message` is
165
- absent, and the scan fallback reads each event shape through its own typed
166
- case instead of a cast that hid real field drift.
167
- - When cross-session full-text search is unavailable, the palette says what still
168
- works (title matching over sessions and workspaces) instead of showing a bare
169
- error.
170
- - Added `scripts/live-dsh-check.sh`: a manual probe that runs against a *running*
171
- isolated dsh profile and exercises the host half on real session data
172
- (timeline, the three export formats, the search scan path, usage scan, backup,
173
- a UTF-8 state round trip, the Mermaid engine route, the client→host diagnostic
174
- ring, both fences, and the boot graph the shell serves), exiting non-zero on
175
- any failure. CI has no harness to talk to, so this is the check to run when a
176
- dsh release lands. Verified against 0.1.7-rc.2 with 19 probes green; the
177
- session-dependent ones `SKIP` — and the closing line counts them instead of
178
- claiming a clean sweep — when the scratch home holds no session, and the UTF-8
179
- probe was shown to distinguish a correct write from the mangled-bytes write it
180
- guards against.
181
- - The live check itself was then tested against a dead endpoint and found two of
182
- its own probes green-by-absence; the restore probe now refuses to pass when the
183
- append it restores never landed. Running it against a real profile exposed five
184
- more defects in the tool, all fixed: restoring the prompt library through
185
- `curl -d "$var"` mangled non-ASCII to U+FFFD (Git Bash re-encodes non-ASCII
186
- argv for `curl.exe`), so bodies are now written by node and sent with
187
- `--data-binary @file`; the script checked out with CRLF endings (the stored
188
- blobs were already LF — `core.autocrlf` was rewriting them on checkout, now
189
- pinned by `.gitattributes`); its search probe read the query word with a greedy
190
- `sed` that needed *some* six-letter run anywhere after the last `"text":"`, so
191
- it silently `SKIP`ped the one probe covering the scan path; it looked for
192
- sessions under `<state file>/../sessions`, which only finds anything because
193
- Windows folds the path lexically and would see nothing on a POSIX shell; and
194
- the real-home guard missed a `DSH_HOME` written with a trailing separator,
195
- which is exactly the spelling that would have probed a developer's own harness
196
- home.
197
- - The READMEs add a plugin-to-dsh compatibility table. A mismatched pair is not
198
- silent — dsh logs `disabling profile plugin …` on stderr, rejects the install,
199
- and models the state as `incompatible` in the plugin manager — but none of that
200
- reaches the page a user is looking at, so the supported window belongs in the
201
- README.
202
-
203
- ### Verified by independent review
204
-
205
- Four reviewers were dispatched against `30e025b..HEAD` with separate charters
206
- (code correctness, claims-vs-evidence, contract-vs-installed-runtime, and a
207
- deep re-audit pinned to the previous commit). Their findings were each
208
- re-verified before being acted on; three of their "critical" items were
209
- refuted by measurement and are recorded below so nobody re-litigates them.
210
-
211
- - Fixed: `package.json` declared `"icon"` twice. `JSON.parse` keeps the last
212
- value, so every gate stayed green on a manifest npm would warn about. `pnpm
213
- smoke` now counts top-level keys in the file text and compares them with what
214
- survived parsing, and separately checks that `engines.dsh`'s floor names the
215
- installed dsh-tools release (nothing in dsh reads `engines.dsh`, so this is
216
- the only place that keeps it honest).
217
- - Fixed: the session probes looked under `<state file>/../sessions`, which only
218
- resolves because Windows folds the path lexically; they now use the home
219
- directory directly. Skips are counted and named in the closing line, a missing
220
- boot-graph URL line fails instead of vanishing, the Mermaid probe reads
221
- `mermaidSource` rather than inferring "local" from a byte count, and a
222
- rejected state write now carries the host's own error text.
223
- - Fixed: the restore probe was vacuously green — it never checked that the
224
- append it restores had landed. It now refuses to pass when the write failed,
225
- verified by mutating the write condition and watching exactly that line go
226
- red.
227
- - Fixed: the client's last-holder clear left `turns` and the rail positions
228
- behind with no session identity, and a holder whose `sessionId` prop flipped to
229
- null could wipe the identity other holders were still rendering. A null holder
230
- now claims nothing at all.
231
- - Fixed: `slots.inject`'s callback registered the component outside the
232
- surrounding `try`, so a rejected registration would take a surface down
233
- silently while the diagnostic ring still read green; the deferred `register`
234
- has its own guard now, and the summary line reports how many injection
235
- requests it actually submitted rather than asserting "8 / 7" — dsh defers the
236
- callback until a slot is declared, so no line printed at install time can
237
- claim a surface materialized; the per-slot `ok` / `register` lines do that.
238
- - Fixed: the search request was passed as `as never`, which hid that `values`
239
- must be `keyof SessionEventMap` rather than `string`; typed, the compiler
240
- caught it immediately. A synchronous throw from `searchEvents` now degrades to
241
- the scan path like a rejection does, a log with exactly 100 hits no longer
242
- claims there are more, and the scan's role filter is exercised by a fixture
243
- that only it can exclude. Each of the three is pinned by a test that fails
244
- against the code it replaces (verified by reverting one at a time).
245
- - Fixed: the sidebar footer button ignored the `wide` prop the host supplies, so
246
- its label wrapped into a vertical stack inside the 56px rail — measured both
247
- ways on a live profile: 36px icon-only when collapsed, "项目" again at 280px.
248
- - Added `scripts/check-boot-graph.mjs`, run by the live check: the served
249
- `__DSH_BOOT__` graph must contain our row, every `dsh.client.inject` target,
250
- and reachable client bytes. This is the only gate that can see the failure
251
- shape that started this whole upgrade — a manifest naming a module the shell no
252
- longer serves — and it was confirmed red by pointing the inject list at the
253
- retired `@deepseek-ai/dsh-client-runtime`.
254
- - Measured against dsh 0.2.0-rc.1 (published the day after this release):
255
- `dsh plugin add` rejects the bundle and rolls the profile back; with the
256
- exact-version exemption granted, the source typechecks against 0.2's own
257
- types, 111/111 unit tests pass, 19/19 live probes pass, and the browser
258
- behaves as on 0.1.7 — eight slot registrations, the rail, prompt insertion,
259
- the `Ctrl+K` palette with title search, and quote-reply. The peer range is
260
- deliberately not widened: `^0.2.0-rc.1` would silently admit every 0.2.x
261
- release, including a stable nobody has reviewed — the very failure this
262
- upgrade exists to prevent. What stays unverified there (branch / Mermaid /
263
- LaTeX chips) is unverified here too: those need a real model reply.
264
- - Accepted and published: a human walked the isolated 0.1.7-rc.2 profile in a
265
- browser (personalization panel, prompts into the composer, project folders, the
266
- timeline rail, quote reply, export entries, `Ctrl+K`) and reported it behaving.
267
- The same person then ran 0.5.0 on their own machine — dsh upgraded to
268
- 0.1.7-rc.2, plugin updated through the in-app market — and reported it
269
- behaving there too. That install's `lib/client.js` is md5
270
- `6639a0aebbe7d0eed32b0c2c5c50c544`, 207762 bytes: byte-identical to the repo
271
- build this section describes, so the chain "what was verified = what was
272
- published = what a user runs" is closed at both ends.
273
- Not covered by either pass, in this or any release until someone runs it with a
274
- key: the per-turn chips (branch, Mermaid render, LaTeX/MathML) and the real
275
- balance figures, all of which need an actual model reply. `0.5.0` was then
276
- published to npm, and the tarball pulled back from the registry was verified
277
- byte-identical to the `lib/` this section describes (34 files, 215634 B).
278
- - Retracted after re-measurement, so the record does not carry them: "the
279
- `slots.inject(key, fn)` service method does not exist in 0.1.7" (it is
280
- declared at `dsh-client-ui-renderer`'s registry interface, and all eight
281
- surfaces materialize in a live browser); "`data-chat-flow-kind` is gone, so the
282
- rail has no anchors" (the reading was taken while the host's trajectory tab had
283
- the chat flow unmounted); "`WorkspaceSnapshot.state` was renamed to `phase`"
284
- (both axes ship side by side). Corrected in place: `ctx.sessions` still
285
- declares `fork()` and `search()` (only `open` is gone), the `current` field and
286
- the turnTail kind change both landed in 0.1.6-alpha.2 rather than 0.1.7, and
287
- the bilingual README gate enforces hash freshness, not content parity.
288
-
289
- ## 0.4.2 — 2026-09-12
290
-
291
- ### Fixed
292
-
293
- - **Exports fail on forked/resumed sessions with "读取会话失败: seeded
294
- session constructor seed must equal its inherited prefix".** Newer dsh
295
- builds replay-validate inside `sessionQuery.readSession()` through a
296
- snapshot-mode constructor that rejects any seeded (forked or resumed) session
297
- whose log outgrew its seed boundary, so timeline, export, in-session
298
- search, and usage scans all failed on those sessions. Every read now goes
299
- through a shared helper that falls back to `observeSession()` (the live and
300
- restore paths dsh's own session page uses) when `readSession()` rejects, and
301
- surfaces the original error only when no fallback exists.
302
- - **The "PDF(含图片)" export button produced an `.html` file.** The button and
303
- its description now say what actually lands on disk: "HTML(含图片)", a
304
- print-ready HTML document you turn into a PDF via the browser print dialog.
305
- - **Weather FX are invisible on light backgrounds.** Snow, rain, and sakura
306
- colors were tuned for the dark theme only — pure-white flakes, 6%-alpha pale
307
- rain, and 90%-lightness pink petals all vanish over the near-white palette
308
- backgrounds. The FX canvas now picks a darker particle palette (cool slate
309
- snow, steel-blue rain, deeper rose petals, each with a lifted alpha floor)
310
- whenever the resolved theme is light or the saturated aurora background is
311
- active, and swaps palettes live on theme/background changes without
312
- rebuilding the particle field.
313
-
314
- ## 0.4.1 — 2026-09-09
315
-
316
- ### Fixed
317
-
318
- - **Fresh installs show nothing after a "successful" install.** `keytar` (a
319
- native optional dependency) tripped pnpm 11's strict build-script gate, so
320
- `dsh plugin add` exited non-zero and the harness never reconciled the bundle
321
- layer — the package sat inert in `dependencies` with no host half and no
322
- browser half. `keytar` is no longer a dependency: the OS-keyring adapter
323
- still detects a `keytar` module present in the profile's `node_modules`, and
324
- users who want the OS keyring can add it themselves
325
- (`dsh plugin --profile web add keytar`).
326
- - The browser half now waits for the `slots` service (a child fiber) before
327
- mounting its surfaces instead of reading it synchronously: newer dsh builds
328
- activate the slots provider after this plugin's entry, and the synchronous
329
- read lost that race every time, logging "slots service unavailable" and
330
- skipping all UI. The mount stays fail-soft — the GUI boots even when the
331
- service never appears.
332
-
333
- ## 0.4.0 — 2026-09-03
334
-
335
- ### Added
336
-
337
- - 7 / 30 / 90-day usage trends, per-model summaries, CSV export, and local monthly CNY budget warnings.
338
- - Versioned, secret-free state backup with previewed merge/replace import and automatic recovery copies.
339
- - Editable, tagged, sortable favorite prompts with usage recency, `{{variable}}` templates, and JSON / Markdown portability.
340
- - Indexed current-session search and a Ctrl/Cmd+K command palette backed by DSH's official search APIs.
341
-
342
- ### Changed
343
-
344
- - Batch archive skips running sessions and reports separate success and failure counts.
345
- - Existing prompt and config documents are normalized for the new optional fields.
346
-
347
- ### Fixed
348
-
349
- - State-dependent routes now wait for the initial local state load; usage events
350
- arriving during an import, edit, or usage scan are queued and persisted instead
351
- of racing a stale snapshot.
352
- - Backup imports reject malformed counters/configuration, honor imported folder
353
- parents and sibling order, and keep the 5 MiB document boundary distinct from
354
- the JSON request envelope.
355
- - Search hits carry their session id and archive batches retain per-item errors;
356
- stale cross-session clicks and swallowed archive failures now surface clearly.
357
- - Malformed persisted peak counters, invalid calendar buckets, failed usage
358
- rebuilds, and partial state edits are handled without presenting or keeping
359
- a misleading snapshot; backup requests now validate their envelope fields.
360
-
361
- ### Security
362
-
363
- - Backups exclude API keys and credential metadata; imports preserve the active credential.
364
- - Archive restore remains deferred until DSH exposes an official API.
365
-
366
- ## 0.1.6 — 2026-09-02
367
-
368
- ### Fixed
369
-
370
- - Usage scans now preserve the live ledger when a session read fails or new
371
- usage arrives during replay, and return the replayed Beijing day so a
372
- midnight-crossing scan cannot relabel its result.
373
- - Legacy API-key migration no longer overwrites an existing system credential;
374
- failed system-key deletion is reported instead of being treated as success.
375
- - Legacy usage rows without a recoverable peak/off-peak split are marked as
376
- inexact and are no longer shown with a misleading cost estimate.
377
- - DeepSeek peak/off-peak cost estimates now treat only Beijing Monday-Friday
378
- 09:00–12:00 / 14:00–18:00 as peak; weekends are off-peak.
379
- - The browser usage panel now uses the same Beijing-time day bucket as the
380
- Host, including when the desktop host runs outside UTC+8.
381
- - Client state snapshots are serialized in invocation order so rapid settings
382
- changes cannot be overwritten by an older save completing later.
383
- - Timeline refreshes ignore stale session/request responses and follow live
384
- conversation running-state changes.
385
- - Mermaid modal changes reload correctly, while concurrent CDN loads share one
386
- in-flight request; the balance hover panel also remains reachable across its
387
- trigger gap.
388
-
389
- ### Changed
390
-
391
- - Centralized the cost formula, added explicit `deepseek-v4-flash-vision-exp`
392
- pricing, and covered the rule with unit tests.
393
- - Usage history is pruned to 90 Beijing calendar days; usage scans use four
394
- concurrent reads and share one in-flight scan instead of duplicating work.
395
- - The balance panel now shows the peak/off-peak token and cost split, pricing
396
- source link, and the built-in rule check date.
397
- - Saved panel keys prefer the optional OS credential store, migrate legacy
398
- state-file keys when possible, and no longer cross the browser state boundary.
399
- - Light/dark root theme styles now take precedence over the host OS preference,
400
- and the build uses the current tsdown dependency configuration without
401
- deprecation warnings.
402
-
403
- ### Added
404
-
405
- - Regression coverage for ordered state saves and shared in-flight Mermaid
406
- loading.
407
-
408
- ## 0.1.3 — 2026-08-23
409
-
410
- ### Fixed
411
-
412
- - Concurrent state saves are serialized per state file: two racing saves could
413
- collide on the shared `.tmp` file and fail the rename on Windows; a failed
414
- debounced save now surfaces in the status-tool diagnostics instead of being
415
- swallowed silently.
416
-
417
- ### Added
418
-
419
- - CI: bilingual README hash consistency check (`node scripts/check-readme-i18n.mjs`)
420
- — editing one language without the other, or forgetting to re-record the
421
- hashes in `README.i18n.yaml`, now fails the build instead of drifting silently.
422
- - CI: Dependabot with monthly schedules (GitHub Actions and grouped npm
423
- minor/patch bumps); workflow actions upgraded to current majors.
424
- - `pnpm smoke` — post-build smoke script: headless Edge loads `lib/client.js`
425
- against a stubbed module loader and asserts the registration handshake, plus
426
- artifact contract checks (loader banner/footer, node-half ESM import,
427
- patch row, local Mermaid engine).
428
- - Tests: the balance key resolution chain (panel → environment → DSH
429
- credentials, via a new credential-reader seam), state merge edge cases, and
430
- concurrent-save serialization.
431
- - Docs: the security section now states explicitly that the panel-pasted key
432
- is stored in plaintext in the state file (same trust domain as DSH's own
433
- credentials).
434
- - This changelog (also shipped in the npm tarball).
435
-
436
- ## 0.1.2 — 2026-08-23
437
-
438
- ### Fixed
439
-
440
- - **Mermaid diagrams in assistant replies now render in place.** The rendering
441
- entry previously hooked only user messages, so assistant-generated diagrams —
442
- mindmaps in particular — never got an entry point. A `MutationObserver` now
443
- scans GUI code blocks and renders ```mermaid``` fences where they are
444
- (`MermaidInPlace`), without moving any React-owned nodes.
445
-
446
- ### Changed
447
-
448
- - Mermaid engine is a local runtime dependency served by the host; the CDN
449
- mirrors are a fallback only. The source (`local` / `cdn`) is visible in the
450
- status tool diagnostics.
451
-
452
- ### Added (repository-side)
453
-
454
- - GitHub Actions CI (Node 22 + pnpm 11: typecheck / test / build), README
455
- badges, and a bilingual screenshot gallery under `docs/`.
456
-
457
- ## 0.1.1 — 2026-08-22
458
-
459
- ### Security
460
-
461
- - Mermaid rendering hardened: `securityLevel: strict` (was `loose`), and the
462
- `/custom-plugin/mermaid.js` engine route is behind the same loopback trust
463
- fence as every other route.
464
-
465
- ### Fixed
466
-
467
- - Peak/off-peak pricing and daily usage buckets are computed in Beijing time
468
- (UTC+8) regardless of the host machine's timezone; tests are
469
- timezone-independent.
470
-
471
- ### Changed
472
-
473
- - `@deepseek-ai/dsh-tools` moved to `peerDependencies` and externalized from
474
- the bundle — `lib/index.js` shrinks from ~245 KB to ~45 KB and shares the
475
- harness instance at runtime.
476
- - Dead code removed: unused `afterSeq` incremental timeline protocol and cache,
477
- unused type re-exports, dead client state fields, unconditional startup log.
478
-
479
- ### Added
480
-
481
- - Self-contained `prepare` script — GitHub source installs build themselves
482
- (pnpm ≥ 10 users: allowlist the build script, see README).
483
- - Package metadata: `repository`, `author`, `bugs`, `homepage`,
484
- `engines` (Node ≥ 22); LICENSE copyright line filled in.
485
-
486
- ## 0.1.0 — 2026-08-22
487
-
488
- Initial release: a personalization suite for the DSH web GUI, mounted through
489
- the official profile mechanism without touching DSH source.
490
-
491
- - Appearance: background palettes, liquid glass, weather effects
492
- (rain / sakura / snow).
493
- - Per-user-message timeline rail with stars and branching.
494
- - Multi-level project folders; prompt library.
495
- - Conversation export (JSON / Markdown / PDF with images).
496
- - Mermaid rendering; quote reply.
497
- - DeepSeek balance and daily token usage (peak/off-peak aware).
498
- - `custom_plugin_status` agent-facing diagnostic tool.
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format loosely
4
+ follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
+ follow [Semantic Versioning](https://semver.org/).
6
+
7
+ ## 0.7.0 — 2026-09-30
8
+
9
+ 桌面版适配修复版。0.6.0 及之前的产物在 dsh Desktop 里几乎全部功能失效——本版
10
+ 定位根因、修复围栏,并按桌面版重新校准了外观与额度两个界面。
11
+
12
+ ### Fixed
13
+
14
+ - **桌面版全线 `forbidden` 的根因**:插件的访问围栏在回环判定之外额外要求一个
15
+ 浏览器同源标记(`sec-fetch-site: same-origin` 或 `origin` 头),而桌面版
16
+ Electron 壳把渲染进程请求转发给它自己的 Host 之前会删掉 `host`、`origin`、
17
+ `sec-fetch-site`、`cookie`——于是每个 `/api/custom-plugin/*` 路由和
18
+ `/custom-plugin/mermaid.js` 都被误拒为 403 `forbidden`:三种导出、会话搜索、
19
+ Mermaid 引擎预加载与就地渲染(连带 mermaid.live 按钮不出现)、余额与用量、
20
+ 以及**一切静默失败的状态保存**(主题、玻璃模式、项目文件夹、提示词库在桌面
21
+ 版从未真正持久化过)。0.7.0 起围栏对齐官方 API 围栏的信任语义:回环套接字 +
22
+ 回环 Host、非 `cross-site`、`origin` 缺省或与 Host 一致即放行;异源与跨站
23
+ 仍然 403。新增 guard 级单测(桌面转发形状、桌面 WS 形状、异源、跨站、非法
24
+ origin、非回环 Host)与 `scripts/desktop-shape-probe.mjs` 活体探针;并在
25
+ 真实桌面安装(F:\DSH,dsh 0.2.0-rc.2)上实测:11 项通过 / 0 失败。
26
+ - **客户端不再静默吞错**:`loadCfg` / `saveCfg` 失败现在 toast + 上报客户端
27
+ 诊断,「看起来生效其实没存上」从此不可复现。
28
+ - **余额「额度?」的间歇性根因**:宿主对 `api.deepseek.com` 的外呼与桌面版
29
+ GUI 一样走本机直连,而本机代理/安全软件按规则间歇性对 443 做 TLS 解密——
30
+ 被接管的时刻 Node 校验不了其自签名证书(`SELF_SIGNED_CERT_IN_CHAIN`),
31
+ 于是登录时首次查询失败、稍后手动刷新又成功,顶栏停在 `额度?` 上。0.7.0 起
32
+ 宿主把这类连接层失败(TLS 拦截 / DNS / 连接超时)翻译成可读的中文原因,
33
+ 客户端失败后按 8s/30s/30s 自动重试(60 秒轮询继续兜底),顶栏悬停即可看到
34
+ 真实原因。失败态顶栏文案按反馈只显示「额度」两字,不带问号。
35
+
36
+ ### Removed
37
+
38
+ - **极光背景预设**:与整体配色不再协调,从色板中移除;旧存档的 `bg: 'aurora'`
39
+ 在宿主归一化与客户端加载两侧自动迁移为 `default`。
40
+ - **消息时间线轨道**(系统已内置对话时间线):轨道、悬停卡(跳转/星标/分支/
41
+ 全文)、「显示时间线 / 时间线在左侧 / 仅显示星标」三个开关与时间线标签页
42
+ 全部移除;`timeline` / `timelineLeft` / `starsOnly` 配置键退役(旧状态文件
43
+ 里的残留键会被宿主归一化丢弃)。保留:消息尾部的 LaTeX / MathML / Mermaid
44
+ 芯片(其数据链 `/timeline` 原样保留,会话运行期间由 OverlayRoot 每 3 秒
45
+ 轮询驱动)、星标数据字段(备份兼容)与搜索定位跳转。
46
+
47
+ ### Changed
48
+
49
+ - **色板适配深色模式**:20 组色系在深色下不再禁用——按同色系自动派生深色
50
+ 变体(保留色相与低饱和,明度落到深色档,饱和度压缩至 0.55 倍,避免暖色系
51
+ 在深底上抢眼),色板预览即当前模式的实际效果;「深色强制重置背景」的旧
52
+ 逻辑随之移除,主题翻转只重新着色。
53
+ - **头部入口交互统一**:个性化 / 提示词 / 额度三张卡片统一为「点一下显示、
54
+ 再点一下关闭」——额度卡片移除悬停即开与固定/取消固定的混合逻辑,提示词
55
+ 浮层重复点击按钮即可关闭;四个浮层表面(含项目文件夹侧栏)互斥,打开一个
56
+ 自动收起其它。
57
+ - **液态玻璃**:删除「在 Chromium 启用液态玻璃…」的桌面端无关文案;位移折射
58
+ 链上轻微模糊与饱和(`url(#vx-lg) blur(2.5px) saturate(1.12)`),大面积面板
59
+ 中部文字清晰、玻璃可感知;液态模式下「全局浮层玻璃」把同样的位移链延伸到
60
+ 弹窗 / 菜单 / 提示框 / 下拉框与系统设置窗(`CSS.supports` 门控,不支持
61
+ SVG 位移滤镜的引擎回退毛玻璃)。并修复了一个让面板「看起来没有液态」的
62
+ 作用域缺陷:主题毛玻璃底色(64% 白底)特异性压过 10% 液态底色,而本应翻盘
63
+ 的选择器要求 `vx-liquid` 出现在 `.vx-root` 内部(它实际挂在 `<html>` 上),
64
+ 从未匹配——只有不在 `.vx-root` 里的额度浮层是真液态。现以 `:root.vx-liquid`
65
+ 作用域重写液态底色,并把主题类镜像到 `<html>`,所有玻璃表面统一。
66
+ - **点阵背景全局移除**:所有玻璃表面不再渲染滚动的点阵纹理。
67
+ - **额度区改版**:顶栏胶囊在未配置 Key 时显示本机费用估算(`≈¥0.42 · 今日
68
+ N 次`,按官方价目表折算,不用 Key、不联网);配置了 Key 照旧显示真实余额。
69
+ 面板默认区只放用量趋势 / 预算 / 今日明细 / 扫描按钮;「余额查询」收为可折
70
+ 叠可选项(配置过 Key 默认展开),未配置时不再显示任何报错。
71
+ - **价目表更新**(2026-09-30 核对官方页):`deepseek-flash` 峰时输入 ¥2 / 输出
72
+ ¥8 / 缓存命中 ¥0.04(旧名 `deepseek-v4-flash` / `-vision-exp` 仍按 Flash 计
73
+ 价路由),`deepseek-v4-pro` ¥9 / ¥27 不变;闲时一律半价。
74
+
75
+ ## 0.6.0 — 2026-09-30
76
+
77
+ ### Published
78
+
79
+ - `npm publish` went out at 2026-09-29T17:26:16Z — 01:26 local on 2026-09-30, which is
80
+ why this entry is dated 09-30 — and registry `dist-tags.latest` is now `0.6.0`.
81
+ The first `PUT` returned 401, npm opened its browser sign-in flow, and
82
+ the retried `PUT` returned **202 Accepted** — npm then keeps the version
83
+ processing for a few minutes, during which the registry still reads
84
+ `latest: 0.5.0`. Anyone re-checking too early will see "not published"; check
85
+ `time["0.6.0"]` before re-running `npm publish`, because a second publish of an
86
+ accepted-but-processing version fails on the version already existing.
87
+ - The published tarball was unpacked and compared to the repository build:
88
+ `lib/client.js` 207762 B (sha256 `f559cd7f1bd8a49a`), `lib/index.js` 81224 B,
89
+ `package.json`, `cordis.patch.yml`, `icon.svg`, `README.md` — all byte-identical.
90
+ - That registry artifact was then installed into a fresh scratch profile on
91
+ dsh 0.2.0-rc.2 — dsh Desktop's exact bundled version — and scored the same
92
+ 18 pass / 1 skip / 0 fail as the locally packed one.
93
+ - **Install it by exact version for now.** A bare `dsh plugin … add
94
+ @alexpeng/dsh-custom-plugin` resolved `0.4.2` on this machine minutes after
95
+ the publish: the plugin manager reads a cached packument whose `latest` was
96
+ still stale. `@alexpeng/dsh-custom-plugin@0.6.0` installs cleanly. Use
97
+ `npm view @alexpeng/dsh-custom-plugin dist-tags --prefer-online` to read the
98
+ real tag instead of the cached one.
99
+
100
+ ### Changed
101
+
102
+ - **Built against dsh 0.2.0-rc.2, and the declared range now names it.** Every
103
+ `@deepseek-ai/dsh-*` devDependency moved to 0.2.0-rc.2 and the source
104
+ type-checked against that release's own published types with no source
105
+ changes. The gate-relevant peer became
106
+ `@deepseek-ai/dsh-tools >=0.1.7-rc.2 <0.2.0-0 || >=0.2.0-rc.2 <0.2.0-rc.3`,
107
+ and `engines.dsh` was set to the same range. That spelling is load-bearing:
108
+ `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N`
109
+ sorts above `0.2.0-0`, so no caret form can admit a verified prerelease — and
110
+ `^0.2.0-rc.2` would additionally admit 0.2.0 stable plus every later 0.2.x,
111
+ which is exactly the unverified support this range exists to withhold.
112
+ 0.2.0-rc.1 is left out on purpose: the bundle is now built for rc.2.
113
+ - `pnpm smoke`'s two range checks were rewritten, because both encoded the old
114
+ premise that a peer range is a single caret pin. They now assert what is
115
+ actually load-bearing: the installed build target must **satisfy** the peer
116
+ range (same comparator and `includePrerelease` semantics dsh's own gate uses),
117
+ a range that admits every version is rejected as stating no support at all,
118
+ and `engines.dsh` must admit the same versions as the peer range across ten
119
+ probed releases. `semver` became a devDependency to make the first check
120
+ possible. Verified by mutation: a stale range, a `*` range, and a diverging
121
+ `engines.dsh` each turn the gate red.
122
+ - The desktop release line pins its shell and runtime together, so dsh Desktop
123
+ always ships one exact dsh version — this is why 0.2.0-rc.2 stopped being a
124
+ speculative target: any Desktop install *is* that runtime.
125
+
126
+ ### Added
127
+
128
+ - `tests/loopback.spec.ts`: the request-level fence had never had a unit test —
129
+ only the live probe script exercised it. Twelve tests now pin the two header
130
+ shapes dsh Desktop's shell produces (`web-document.ts` deletes `host`,
131
+ `origin`, `cookie` and `sec-fetch-site` before forwarding; the WebSocket
132
+ upgrade rewrites `Origin` to the Host authority), plus the rejections a
133
+ forged Origin, a cross-site marker, and a non-loopback socket must still get.
134
+ - `scripts/desktop-runtime.mjs`: reads which dsh version an **installed** dsh
135
+ Desktop carries, straight out of `resources/app.asar/dsh/desktop-runtime.json`,
136
+ and prints whether the peer range declared here admits it. Promoted from a
137
+ throwaway probe because Desktop pins shell and runtime together, so "what does
138
+ this installer actually run" is a question every future Desktop release
139
+ re-asks and the repository cannot answer. Read-only; takes the installation
140
+ directory or the archive path. Verified in both directions: on this machine's
141
+ install it reports `0.2.0-rc.2 / ADMITTED`, and with the peer range temporarily
142
+ reverted to `^0.1.7-rc.2` the same run reports `REFUSED`.
143
+ - README (both languages) gained an "On dsh Desktop" section: how the shell
144
+ routes requests, why the profile is managed by Desktop's own `dsh` command,
145
+ and which part still needs a window and a login.
146
+
147
+ ### Fixed
148
+
149
+ - **A second dsh host could read a half-written state document.** The atomic
150
+ replace wrote to one shared temp name, `custom-plugin-state.json.tmp`, while
151
+ the queue that serializes saves lives inside a single process. dsh Desktop
152
+ owns `$DSH_HOME/profiles/desktop` and the Web profile owns `profiles/web`,
153
+ but both hosts read and write the same
154
+ `$DSH_HOME/custom-plugin-state.json`, so two hosts saving at the same moment
155
+ wrote and renamed that one temp file against each other — the Windows
156
+ EPERM/EBUSY shape this queue was built to stop, reachable across processes.
157
+ Temp names are now qualified by the writing pid (both the state document and
158
+ the pre-import recovery backup), and a failed turn deletes its own temp
159
+ instead of leaving a per-pid file behind. Building that cleanup surfaced a
160
+ second bug: `rm` was used in the new `catch` but never imported, so a failed
161
+ save reported `ReferenceError` instead of the real rename error and left the
162
+ temp file on disk.
163
+
164
+ ### Verified
165
+
166
+ - **dsh 0.2.0-rc.2, the version Desktop ships.** Confirmed from the installed
167
+ app's own bytes, not the repository: `resources/app.asar/dsh/desktop-runtime.json`
168
+ records `release.version 0.2.0-rc.2`, `node 24.18.1`, `pnpm 11.7.0`, and lists
169
+ `@deepseek-ai/dsh 0.2.0-rc.2` with `@deepseek-ai/cordis 4.0.4` (the version
170
+ this package's cordis peer already names) among its shared packages.
171
+ - 0.5.0 on that runtime behaved as predicted: `dsh plugin --profile web add`
172
+ refused it, naming `peerDependencies {"@deepseek-ai/dsh-tools":"^0.1.7-rc.2"}`,
173
+ and rolled the profile back. With the exemption granted, 18 of 19 live host
174
+ probes passed, 0 failed.
175
+ - **0.6.0 installs on 0.2.0-rc.2 with no exemption at all** (`plugin add` exit
176
+ 0, profile kept), and the same 18-pass/1-skip/0-fail result holds there and on
177
+ 0.1.7-rc.2 — boot graph 66 module rows on 0.2.0-rc.2 and 65 on 0.1.7-rc.2, our
178
+ row served, all
179
+ five `dsh.client.inject` targets present, Mermaid engine loaded locally, UTF-8
180
+ state round trip restored. The single skip is the session-dependent probe; a
181
+ credential-free scratch home holds no session.
182
+ - The rebuild of `pnpm-lock.yaml` (required: the old lockfile cached a
183
+ `minimumReleaseAge` policy snapshot that no longer matched the allow-list, so
184
+ every install was rejected) also moved the dev tree's `mermaid` from 11.17.0
185
+ to 11.17.2. That is inside the declared `^11.6.0`, and the scratch profiles
186
+ used for the live probes resolved 11.17.2 themselves, so the measured Mermaid
187
+ engine is the version an installing user gets.
188
+ - The installed `lib/client.js` is byte-identical to the repository build
189
+ (207762 bytes, sha256 prefix `f559cd7f1bd8a49a`). The *served* bundle is 49
190
+ bytes larger because dsh's composite `/plugins/??…` route joins modules with
191
+ `;\n` and rewrites the `sourceMappingURL` — so byte identity is asserted at
192
+ the installed file, never at the HTTP response.
193
+ - 126 unit tests pass, typecheck is clean, `pnpm smoke` and `check:readme` are
194
+ green. Not verified: opening the plugin inside a real Desktop window (needs a
195
+ login), the desktop profile's own composition, and the per-turn chips.
196
+
197
+ ## 0.5.0 — 2026-09-28
198
+
199
+ ### Changed
200
+
201
+ - **Target dsh 0.1.7-rc.2.** All `@deepseek-ai/dsh-*` dependencies, the
202
+ `@deepseek-ai/dsh-tools` peer range, and `@deepseek-ai/cordis` moved to the
203
+ versions that release ships, and `engines.dsh` now states the supported range.
204
+ dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own runtime
205
+ version at install and startup and skips a bundle that does not match. The
206
+ declared floor is the release this package was built and verified against;
207
+ `^0.1.7-rc.2` additionally admits later 0.1.x releases that have not been
208
+ re-verified, and `engines.dsh` is declarative — no part of dsh reads it.
209
+ - The browser half declares `dsh.client.inject` as the five packages that own
210
+ the slots it registers into, replacing the retired
211
+ `@deepseek-ai/dsh-client-runtime` row.
212
+ - Slot-provided data shapes (`SessionListState`, `WorkspaceListState`,
213
+ `TurnLocation`) are now declared locally instead of imported from harness
214
+ controller packages that rename across releases; only `SnapshotSelectorHook`
215
+ still comes from the slot SDK.
216
+ - In-session search uses dsh's event index when the deployment opens one and
217
+ otherwise scans the session log it already read, reporting which path answered
218
+ in the panel. dsh's shipped `web` profile configures the index with
219
+ `openAt: never`, so the indexed route was unavailable on a default install.
220
+ - Plugin Manager cards, bundle details, and the settings inventory now show a
221
+ real name and icon: `locale/en.json`, `locale/zh.json`, and `icon.svg`.
222
+
223
+ ### Fixed
224
+
225
+ - **The timeline rail, export, and quote features lost the current session.**
226
+ The session list snapshot has had no `current` field since dsh
227
+ 0.1.6-alpha.2 (view selection moved to the Workspace browser), so the rail
228
+ tracked nothing. The viewed session now comes from the standard `sessionId`
229
+ prop every session-scoped slot entry receives.
230
+ - **Opening a session or a workspace failed silently.** `ctx.sessions.open` is
231
+ gone; navigation goes through `ctx.uiWorkspace.openSession()` /
232
+ `connectWorkspace()`. Branching and full-text search go through
233
+ `ctx.remote.session.fork()` / `.search()` — `ctx.sessions` still declares
234
+ those two, but the remote namespace is the documented surface — each with an
235
+ honest failure message when the service is absent.
236
+ - **Exports lost tool results and the new model-visible messages.** The
237
+ `tool-result` content block was replaced by a tool-role message whose call id
238
+ now sits on the message (`toolCallId`, still falling back to `source.callId`
239
+ for older logs); `system/message` and `developer/message` are exported as
240
+ injected context; and `file`, `tool-addition`, `tool-removal`, and offloaded
241
+ `image` blocks are named instead of dropped.
242
+ - `conversation.chat.turnTail` changed from a chain slot to a list slot, so its
243
+ `select` registration option no longer applies and was replaced by an id and
244
+ order.
245
+ - Client diagnostics are throttled per message kind. The previous single shared
246
+ window let the frequently emitted rail line swallow the one-shot timeline
247
+ result line, which made a successful timeline fetch look like zero turns.
248
+ - `pnpm smoke` now checks the manifest fields dsh reads before it activates a
249
+ bundle (client platform and `./client` export, patch path, icon size, locale
250
+ display metadata, and peer ranges agreeing with the build target), so an
251
+ unsupported or stale declaration fails the local gate instead of being skipped
252
+ silently in a user's profile. The peer check refuses to read a range form it
253
+ cannot interpret, and every `files` entry must resolve to something in the tree
254
+ — an entry matching nothing used to publish a bundle missing that piece. Both
255
+ new rules were confirmed red by breaking them on purpose. The
256
+ `dsh.client.inject` rows are counted, not resolved: only a running shell knows
257
+ which module ids it serves, so a retired name there is caught by the live
258
+ boot-graph probe below, not by this gate.
259
+ - A search excerpt now extends its window so a pasted query longer than two
260
+ thirds of the excerpt is still shown whole. Measured first: the previous
261
+ centering already covered ordinary queries, including a hit at the very end of
262
+ a long message, so only the long-query case was affected — the fix is narrow,
263
+ and the added test fails against the old formula.
264
+ - Exports no longer fail outright on a `tool/result` event whose `message` is
265
+ absent, and the scan fallback reads each event shape through its own typed
266
+ case instead of a cast that hid real field drift.
267
+ - When cross-session full-text search is unavailable, the palette says what still
268
+ works (title matching over sessions and workspaces) instead of showing a bare
269
+ error.
270
+ - Added `scripts/live-dsh-check.sh`: a manual probe that runs against a *running*
271
+ isolated dsh profile and exercises the host half on real session data
272
+ (timeline, the three export formats, the search scan path, usage scan, backup,
273
+ a UTF-8 state round trip, the Mermaid engine route, the client→host diagnostic
274
+ ring, both fences, and the boot graph the shell serves), exiting non-zero on
275
+ any failure. CI has no harness to talk to, so this is the check to run when a
276
+ dsh release lands. Verified against 0.1.7-rc.2 with 19 probes green; the
277
+ session-dependent ones `SKIP` — and the closing line counts them instead of
278
+ claiming a clean sweep — when the scratch home holds no session, and the UTF-8
279
+ probe was shown to distinguish a correct write from the mangled-bytes write it
280
+ guards against.
281
+ - The live check itself was then tested against a dead endpoint and found two of
282
+ its own probes green-by-absence; the restore probe now refuses to pass when the
283
+ append it restores never landed. Running it against a real profile exposed five
284
+ more defects in the tool, all fixed: restoring the prompt library through
285
+ `curl -d "$var"` mangled non-ASCII to U+FFFD (Git Bash re-encodes non-ASCII
286
+ argv for `curl.exe`), so bodies are now written by node and sent with
287
+ `--data-binary @file`; the script checked out with CRLF endings (the stored
288
+ blobs were already LF — `core.autocrlf` was rewriting them on checkout, now
289
+ pinned by `.gitattributes`); its search probe read the query word with a greedy
290
+ `sed` that needed *some* six-letter run anywhere after the last `"text":"`, so
291
+ it silently `SKIP`ped the one probe covering the scan path; it looked for
292
+ sessions under `<state file>/../sessions`, which only finds anything because
293
+ Windows folds the path lexically and would see nothing on a POSIX shell; and
294
+ the real-home guard missed a `DSH_HOME` written with a trailing separator,
295
+ which is exactly the spelling that would have probed a developer's own harness
296
+ home.
297
+ - The READMEs add a plugin-to-dsh compatibility table. A mismatched pair is not
298
+ silent — dsh logs `disabling profile plugin …` on stderr, rejects the install,
299
+ and models the state as `incompatible` in the plugin manager — but none of that
300
+ reaches the page a user is looking at, so the supported window belongs in the
301
+ README.
302
+
303
+ ### Verified by independent review
304
+
305
+ Four reviewers were dispatched against `30e025b..HEAD` with separate charters
306
+ (code correctness, claims-vs-evidence, contract-vs-installed-runtime, and a
307
+ deep re-audit pinned to the previous commit). Their findings were each
308
+ re-verified before being acted on; three of their "critical" items were
309
+ refuted by measurement and are recorded below so nobody re-litigates them.
310
+
311
+ - Fixed: `package.json` declared `"icon"` twice. `JSON.parse` keeps the last
312
+ value, so every gate stayed green on a manifest npm would warn about. `pnpm
313
+ smoke` now counts top-level keys in the file text and compares them with what
314
+ survived parsing, and separately checks that `engines.dsh`'s floor names the
315
+ installed dsh-tools release (nothing in dsh reads `engines.dsh`, so this is
316
+ the only place that keeps it honest).
317
+ - Fixed: the session probes looked under `<state file>/../sessions`, which only
318
+ resolves because Windows folds the path lexically; they now use the home
319
+ directory directly. Skips are counted and named in the closing line, a missing
320
+ boot-graph URL line fails instead of vanishing, the Mermaid probe reads
321
+ `mermaidSource` rather than inferring "local" from a byte count, and a
322
+ rejected state write now carries the host's own error text.
323
+ - Fixed: the restore probe was vacuously green — it never checked that the
324
+ append it restores had landed. It now refuses to pass when the write failed,
325
+ verified by mutating the write condition and watching exactly that line go
326
+ red.
327
+ - Fixed: the client's last-holder clear left `turns` and the rail positions
328
+ behind with no session identity, and a holder whose `sessionId` prop flipped to
329
+ null could wipe the identity other holders were still rendering. A null holder
330
+ now claims nothing at all.
331
+ - Fixed: `slots.inject`'s callback registered the component outside the
332
+ surrounding `try`, so a rejected registration would take a surface down
333
+ silently while the diagnostic ring still read green; the deferred `register`
334
+ has its own guard now, and the summary line reports how many injection
335
+ requests it actually submitted rather than asserting "8 / 7" — dsh defers the
336
+ callback until a slot is declared, so no line printed at install time can
337
+ claim a surface materialized; the per-slot `ok` / `register` lines do that.
338
+ - Fixed: the search request was passed as `as never`, which hid that `values`
339
+ must be `keyof SessionEventMap` rather than `string`; typed, the compiler
340
+ caught it immediately. A synchronous throw from `searchEvents` now degrades to
341
+ the scan path like a rejection does, a log with exactly 100 hits no longer
342
+ claims there are more, and the scan's role filter is exercised by a fixture
343
+ that only it can exclude. Each of the three is pinned by a test that fails
344
+ against the code it replaces (verified by reverting one at a time).
345
+ - Fixed: the sidebar footer button ignored the `wide` prop the host supplies, so
346
+ its label wrapped into a vertical stack inside the 56px rail — measured both
347
+ ways on a live profile: 36px icon-only when collapsed, "项目" again at 280px.
348
+ - Added `scripts/check-boot-graph.mjs`, run by the live check: the served
349
+ `__DSH_BOOT__` graph must contain our row, every `dsh.client.inject` target,
350
+ and reachable client bytes. This is the only gate that can see the failure
351
+ shape that started this whole upgrade — a manifest naming a module the shell no
352
+ longer serves — and it was confirmed red by pointing the inject list at the
353
+ retired `@deepseek-ai/dsh-client-runtime`.
354
+ - Measured against dsh 0.2.0-rc.1 (published the day after this release):
355
+ `dsh plugin add` rejects the bundle and rolls the profile back; with the
356
+ exact-version exemption granted, the source typechecks against 0.2's own
357
+ types, 111/111 unit tests pass, 19/19 live probes pass, and the browser
358
+ behaves as on 0.1.7 — eight slot registrations, the rail, prompt insertion,
359
+ the `Ctrl+K` palette with title search, and quote-reply. The peer range is
360
+ deliberately not widened: `^0.2.0-rc.1` would silently admit every 0.2.x
361
+ release, including a stable nobody has reviewed — the very failure this
362
+ upgrade exists to prevent. What stays unverified there (branch / Mermaid /
363
+ LaTeX chips) is unverified here too: those need a real model reply.
364
+ - Accepted and published: a human walked the isolated 0.1.7-rc.2 profile in a
365
+ browser (personalization panel, prompts into the composer, project folders, the
366
+ timeline rail, quote reply, export entries, `Ctrl+K`) and reported it behaving.
367
+ The same person then ran 0.5.0 on their own machine — dsh upgraded to
368
+ 0.1.7-rc.2, plugin updated through the in-app market — and reported it
369
+ behaving there too. That install's `lib/client.js` is md5
370
+ `6639a0aebbe7d0eed32b0c2c5c50c544`, 207762 bytes: byte-identical to the repo
371
+ build this section describes, so the chain "what was verified = what was
372
+ published = what a user runs" is closed at both ends.
373
+ Not covered by either pass, in this or any release until someone runs it with a
374
+ key: the per-turn chips (branch, Mermaid render, LaTeX/MathML) and the real
375
+ balance figures, all of which need an actual model reply. `0.5.0` was then
376
+ published to npm, and the tarball pulled back from the registry was verified
377
+ byte-identical to the `lib/` this section describes (34 files, 215634 B).
378
+ - Retracted after re-measurement, so the record does not carry them: "the
379
+ `slots.inject(key, fn)` service method does not exist in 0.1.7" (it is
380
+ declared at `dsh-client-ui-renderer`'s registry interface, and all eight
381
+ surfaces materialize in a live browser); "`data-chat-flow-kind` is gone, so the
382
+ rail has no anchors" (the reading was taken while the host's trajectory tab had
383
+ the chat flow unmounted); "`WorkspaceSnapshot.state` was renamed to `phase`"
384
+ (both axes ship side by side). Corrected in place: `ctx.sessions` still
385
+ declares `fork()` and `search()` (only `open` is gone), the `current` field and
386
+ the turnTail kind change both landed in 0.1.6-alpha.2 rather than 0.1.7, and
387
+ the bilingual README gate enforces hash freshness, not content parity.
388
+
389
+ ## 0.4.2 — 2026-09-12
390
+
391
+ ### Fixed
392
+
393
+ - **Exports fail on forked/resumed sessions with "读取会话失败: seeded
394
+ session constructor seed must equal its inherited prefix".** Newer dsh
395
+ builds replay-validate inside `sessionQuery.readSession()` through a
396
+ snapshot-mode constructor that rejects any seeded (forked or resumed) session
397
+ whose log outgrew its seed boundary, so timeline, export, in-session
398
+ search, and usage scans all failed on those sessions. Every read now goes
399
+ through a shared helper that falls back to `observeSession()` (the live and
400
+ restore paths dsh's own session page uses) when `readSession()` rejects, and
401
+ surfaces the original error only when no fallback exists.
402
+ - **The "PDF(含图片)" export button produced an `.html` file.** The button and
403
+ its description now say what actually lands on disk: "HTML(含图片)", a
404
+ print-ready HTML document you turn into a PDF via the browser print dialog.
405
+ - **Weather FX are invisible on light backgrounds.** Snow, rain, and sakura
406
+ colors were tuned for the dark theme only — pure-white flakes, 6%-alpha pale
407
+ rain, and 90%-lightness pink petals all vanish over the near-white palette
408
+ backgrounds. The FX canvas now picks a darker particle palette (cool slate
409
+ snow, steel-blue rain, deeper rose petals, each with a lifted alpha floor)
410
+ whenever the resolved theme is light or the saturated aurora background is
411
+ active, and swaps palettes live on theme/background changes without
412
+ rebuilding the particle field.
413
+
414
+ ## 0.4.1 — 2026-09-09
415
+
416
+ ### Fixed
417
+
418
+ - **Fresh installs show nothing after a "successful" install.** `keytar` (a
419
+ native optional dependency) tripped pnpm 11's strict build-script gate, so
420
+ `dsh plugin add` exited non-zero and the harness never reconciled the bundle
421
+ layer — the package sat inert in `dependencies` with no host half and no
422
+ browser half. `keytar` is no longer a dependency: the OS-keyring adapter
423
+ still detects a `keytar` module present in the profile's `node_modules`, and
424
+ users who want the OS keyring can add it themselves
425
+ (`dsh plugin --profile web add keytar`).
426
+ - The browser half now waits for the `slots` service (a child fiber) before
427
+ mounting its surfaces instead of reading it synchronously: newer dsh builds
428
+ activate the slots provider after this plugin's entry, and the synchronous
429
+ read lost that race every time, logging "slots service unavailable" and
430
+ skipping all UI. The mount stays fail-soft — the GUI boots even when the
431
+ service never appears.
432
+
433
+ ## 0.4.0 — 2026-09-03
434
+
435
+ ### Added
436
+
437
+ - 7 / 30 / 90-day usage trends, per-model summaries, CSV export, and local monthly CNY budget warnings.
438
+ - Versioned, secret-free state backup with previewed merge/replace import and automatic recovery copies.
439
+ - Editable, tagged, sortable favorite prompts with usage recency, `{{variable}}` templates, and JSON / Markdown portability.
440
+ - Indexed current-session search and a Ctrl/Cmd+K command palette backed by DSH's official search APIs.
441
+
442
+ ### Changed
443
+
444
+ - Batch archive skips running sessions and reports separate success and failure counts.
445
+ - Existing prompt and config documents are normalized for the new optional fields.
446
+
447
+ ### Fixed
448
+
449
+ - State-dependent routes now wait for the initial local state load; usage events
450
+ arriving during an import, edit, or usage scan are queued and persisted instead
451
+ of racing a stale snapshot.
452
+ - Backup imports reject malformed counters/configuration, honor imported folder
453
+ parents and sibling order, and keep the 5 MiB document boundary distinct from
454
+ the JSON request envelope.
455
+ - Search hits carry their session id and archive batches retain per-item errors;
456
+ stale cross-session clicks and swallowed archive failures now surface clearly.
457
+ - Malformed persisted peak counters, invalid calendar buckets, failed usage
458
+ rebuilds, and partial state edits are handled without presenting or keeping
459
+ a misleading snapshot; backup requests now validate their envelope fields.
460
+
461
+ ### Security
462
+
463
+ - Backups exclude API keys and credential metadata; imports preserve the active credential.
464
+ - Archive restore remains deferred until DSH exposes an official API.
465
+
466
+ ## 0.1.6 — 2026-09-02
467
+
468
+ ### Fixed
469
+
470
+ - Usage scans now preserve the live ledger when a session read fails or new
471
+ usage arrives during replay, and return the replayed Beijing day so a
472
+ midnight-crossing scan cannot relabel its result.
473
+ - Legacy API-key migration no longer overwrites an existing system credential;
474
+ failed system-key deletion is reported instead of being treated as success.
475
+ - Legacy usage rows without a recoverable peak/off-peak split are marked as
476
+ inexact and are no longer shown with a misleading cost estimate.
477
+ - DeepSeek peak/off-peak cost estimates now treat only Beijing Monday-Friday
478
+ 09:00–12:00 / 14:00–18:00 as peak; weekends are off-peak.
479
+ - The browser usage panel now uses the same Beijing-time day bucket as the
480
+ Host, including when the desktop host runs outside UTC+8.
481
+ - Client state snapshots are serialized in invocation order so rapid settings
482
+ changes cannot be overwritten by an older save completing later.
483
+ - Timeline refreshes ignore stale session/request responses and follow live
484
+ conversation running-state changes.
485
+ - Mermaid modal changes reload correctly, while concurrent CDN loads share one
486
+ in-flight request; the balance hover panel also remains reachable across its
487
+ trigger gap.
488
+
489
+ ### Changed
490
+
491
+ - Centralized the cost formula, added explicit `deepseek-v4-flash-vision-exp`
492
+ pricing, and covered the rule with unit tests.
493
+ - Usage history is pruned to 90 Beijing calendar days; usage scans use four
494
+ concurrent reads and share one in-flight scan instead of duplicating work.
495
+ - The balance panel now shows the peak/off-peak token and cost split, pricing
496
+ source link, and the built-in rule check date.
497
+ - Saved panel keys prefer the optional OS credential store, migrate legacy
498
+ state-file keys when possible, and no longer cross the browser state boundary.
499
+ - Light/dark root theme styles now take precedence over the host OS preference,
500
+ and the build uses the current tsdown dependency configuration without
501
+ deprecation warnings.
502
+
503
+ ### Added
504
+
505
+ - Regression coverage for ordered state saves and shared in-flight Mermaid
506
+ loading.
507
+
508
+ ## 0.1.3 — 2026-08-23
509
+
510
+ ### Fixed
511
+
512
+ - Concurrent state saves are serialized per state file: two racing saves could
513
+ collide on the shared `.tmp` file and fail the rename on Windows; a failed
514
+ debounced save now surfaces in the status-tool diagnostics instead of being
515
+ swallowed silently.
516
+
517
+ ### Added
518
+
519
+ - CI: bilingual README hash consistency check (`node scripts/check-readme-i18n.mjs`)
520
+ — editing one language without the other, or forgetting to re-record the
521
+ hashes in `README.i18n.yaml`, now fails the build instead of drifting silently.
522
+ - CI: Dependabot with monthly schedules (GitHub Actions and grouped npm
523
+ minor/patch bumps); workflow actions upgraded to current majors.
524
+ - `pnpm smoke` — post-build smoke script: headless Edge loads `lib/client.js`
525
+ against a stubbed module loader and asserts the registration handshake, plus
526
+ artifact contract checks (loader banner/footer, node-half ESM import,
527
+ patch row, local Mermaid engine).
528
+ - Tests: the balance key resolution chain (panel → environment → DSH
529
+ credentials, via a new credential-reader seam), state merge edge cases, and
530
+ concurrent-save serialization.
531
+ - Docs: the security section now states explicitly that the panel-pasted key
532
+ is stored in plaintext in the state file (same trust domain as DSH's own
533
+ credentials).
534
+ - This changelog (also shipped in the npm tarball).
535
+
536
+ ## 0.1.2 — 2026-08-23
537
+
538
+ ### Fixed
539
+
540
+ - **Mermaid diagrams in assistant replies now render in place.** The rendering
541
+ entry previously hooked only user messages, so assistant-generated diagrams —
542
+ mindmaps in particular — never got an entry point. A `MutationObserver` now
543
+ scans GUI code blocks and renders ```mermaid``` fences where they are
544
+ (`MermaidInPlace`), without moving any React-owned nodes.
545
+
546
+ ### Changed
547
+
548
+ - Mermaid engine is a local runtime dependency served by the host; the CDN
549
+ mirrors are a fallback only. The source (`local` / `cdn`) is visible in the
550
+ status tool diagnostics.
551
+
552
+ ### Added (repository-side)
553
+
554
+ - GitHub Actions CI (Node 22 + pnpm 11: typecheck / test / build), README
555
+ badges, and a bilingual screenshot gallery under `docs/`.
556
+
557
+ ## 0.1.1 — 2026-08-22
558
+
559
+ ### Security
560
+
561
+ - Mermaid rendering hardened: `securityLevel: strict` (was `loose`), and the
562
+ `/custom-plugin/mermaid.js` engine route is behind the same loopback trust
563
+ fence as every other route.
564
+
565
+ ### Fixed
566
+
567
+ - Peak/off-peak pricing and daily usage buckets are computed in Beijing time
568
+ (UTC+8) regardless of the host machine's timezone; tests are
569
+ timezone-independent.
570
+
571
+ ### Changed
572
+
573
+ - `@deepseek-ai/dsh-tools` moved to `peerDependencies` and externalized from
574
+ the bundle — `lib/index.js` shrinks from ~245 KB to ~45 KB and shares the
575
+ harness instance at runtime.
576
+ - Dead code removed: unused `afterSeq` incremental timeline protocol and cache,
577
+ unused type re-exports, dead client state fields, unconditional startup log.
578
+
579
+ ### Added
580
+
581
+ - Self-contained `prepare` script — GitHub source installs build themselves
582
+ (pnpm ≥ 10 users: allowlist the build script, see README).
583
+ - Package metadata: `repository`, `author`, `bugs`, `homepage`,
584
+ `engines` (Node ≥ 22); LICENSE copyright line filled in.
585
+
586
+ ## 0.1.0 — 2026-08-22
587
+
588
+ Initial release: a personalization suite for the DSH web GUI, mounted through
589
+ the official profile mechanism without touching DSH source.
590
+
591
+ - Appearance: background palettes, liquid glass, weather effects
592
+ (rain / sakura / snow).
593
+ - Per-user-message timeline rail with stars and branching.
594
+ - Multi-level project folders; prompt library.
595
+ - Conversation export (JSON / Markdown / PDF with images).
596
+ - Mermaid rendering; quote reply.
597
+ - DeepSeek balance and daily token usage (peak/off-peak aware).
598
+ - `custom_plugin_status` agent-facing diagnostic tool.