@alexpeng/dsh-custom-plugin 0.4.2 → 0.6.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
@@ -4,6 +4,288 @@ All notable changes to this project are documented here. The format loosely
4
4
  follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions
5
5
  follow [Semantic Versioning](https://semver.org/).
6
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
+
7
289
  ## 0.4.2 — 2026-09-12
8
290
 
9
291
  ### Fixed
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: eb2b863638b101a7b1a768233e687218ec913549
7
- README.zh.md: ec3625b6ef3a95adc4ce9519a6cda7c775e51f97
6
+ README.md: cc76977b752647e342987111d810cd8a76d7edb6
7
+ README.zh.md: 7778594e06ac0c7a96708de71040a90a2367eb7a
package/README.md CHANGED
@@ -93,8 +93,8 @@ Plugin state can be exported as a versioned JSON backup containing appearance, f
93
93
  - **Anti auto-scroll**: force `scroll-behavior: auto` so sends never yank the view to the bottom (off by default);
94
94
  - **Formula copy**: LaTeX / MathML copy chips under matching messages (MathML pastes into Word);
95
95
  - **Batch archive**: select sessions and archive them in bulk; running sessions are unavailable and completion reports separate success/failure counts. DSH exposes no restore API yet, so the plugin provides no restore entry point.
96
- - **Session search**: search current-session user, assistant, and tool content through DSH's official index and jump to the containing turn; superseded requests are cancelled.
97
- - **Command palette**: press `Ctrl+K` / `Cmd+K` outside editors to search sessions, workspaces, prompts, and common actions; cross-session content search uses DSH's official API.
96
+ - **Session search**: search current-session user, assistant, and tool content and jump to the containing turn; superseded requests are cancelled. DSH's event index is used when the deployment opens one, and otherwise the plugin scans the session log it already read (the panel says which path answered).
97
+ - **Command palette**: press `Ctrl+K` / `Cmd+K` outside editors to search sessions, workspaces, prompts, and common actions; cross-session content search uses DSH's official API and reports its own unavailability.
98
98
  - **Reliable archive**: running sessions are unavailable by default and batch completion reports separate success and failure counts.
99
99
 
100
100
  ### Balance and usage
@@ -116,9 +116,28 @@ The Settings → 个性化 section provides the full appearance and tool-toggle
116
116
 
117
117
  The `custom_plugin_status` tool reports appearance config, today's per-model usage, balance, a timeline sample, Mermaid engine state, the state file path and client diagnostics. The plugin never injects system-prompt announcements.
118
118
 
119
+ ## Compatibility
120
+
121
+ | plugin release | dsh it was built and verified against | status |
122
+ | --- | --- | --- |
123
+ | 0.6.x | dsh 0.1.7-rc.2 and dsh 0.2.0-rc.2 (peer range names both; see Install) | this release |
124
+ | 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 |
125
+ | 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 era | superseded; do not expect it to work on 0.1.7+ |
126
+
127
+ 0.1.7 changed the plugin-facing contracts this suite depends on (session
128
+ navigation moved to `ctx.uiWorkspace`, the session list stopped publishing the
129
+ viewed session, and the message model dropped the `tool-result` content block),
130
+ so neither release substitutes for the other. dsh 0.1.7+ validates a bundle's
131
+ `@deepseek-ai/dsh-*` peer ranges against its own version at install and startup
132
+ and skips a bundle that does not match. Runtimes predating that gate load the
133
+ bundle anyway and degrade instead: on 0.1.1-rc.2, 7 of 8 slot registrations
134
+ succeed, the turn-tail entry is rejected (that slot became a list slot back in
135
+ 0.1.6-alpha.2), and the open-session / branch / cross-session actions
136
+ report their service as missing rather than throwing.
137
+
119
138
  ## Install
120
139
 
121
- 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).
140
+ Prerequisites: Node 22+, pnpm, and the `dsh` CLI (the official `@deepseek-ai/dsh` npm package; `npx @deepseek-ai/dsh` stands in for `dsh` when it is not installed globally). This release targets **dsh 0.1.7-rc.2 through the rest of 0.1.x, plus 0.2.0-rc.2** — dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own version at install and startup, and skips a bundle that does not match, so `package.json` names only the releases this package was actually built and verified against. 0.6.0 is type-checked and built against 0.2.0-rc.2, and the same artifact was run through the live host probes on both runtime lines: 18 of 19 probes pass on 0.2.0-rc.2 (boot graph of 66 module rows) and on 0.1.7-rc.2 (65 rows), the one skip being the probe that needs a real session. What stays unverified is what was always unverified: the per-turn chips (branch, Mermaid render, LaTeX) need a real model reply, so a credential-free scratch home cannot reach them, and slot rendering still needs a browser pass. The range deliberately excludes 0.2.0-rc.1 (a superseded prerelease), 0.2.0-rc.3 and later prereleases nobody has looked at, and 0.2.0 stable until someone does. Range spelling matters here: `^0.1.7-rc.2` desugars to `>=0.1.7-rc.2 <0.2.0-0`, and every `0.2.0-rc.N` sorts *above* `0.2.0-0`, so a verified prerelease has to be named in its own clause — `pnpm smoke` checks that the build target actually satisfies the declared range and that `engines.dsh` admits the same versions. On an older dsh, install the matching older plugin release (`0.5.0` targets 0.1.7-rc.2) rather than granting a compatibility exemption.
122
141
 
123
142
  ### From npm
124
143
 
@@ -129,6 +148,42 @@ dsh plugin --profile web add @alexpeng/dsh-custom-plugin
129
148
 
130
149
  The registry tarball ships prebuilt output — no source build on the installing machine.
131
150
 
151
+ ### On dsh Desktop
152
+
153
+ dsh Desktop is an Electron shell around the same Web application, and it bundles
154
+ **exactly dsh 0.2.0-rc.2** — the desktop release line pins the shell and the
155
+ runtime together, so a Desktop install is always a 0.2.x runtime. 0.6.0 names
156
+ that version in its peer range and installs there with no compatibility
157
+ exemption; 0.5.0 did not, and was refused with the same message a 0.2.x Web
158
+ profile prints.
159
+
160
+ Measured against 0.2.0-rc.2: the boot graph carries our row and all five inject
161
+ targets, the Mermaid engine loads locally, and the host probes score the same
162
+ there as on 0.1.7-rc.2. The desktop request path does not disturb this plugin's
163
+ access fence either — the shell forwards renderer requests to its own Host after
164
+ deleting `host`, `origin`, `sec-fetch-site` and `cookie`, then attaches its own
165
+ credential, which is the shape the loopback fence accepts (that fence now has
166
+ unit tests, which it never had before). What has *not* been done is opening this
167
+ plugin inside a Desktop window; that pass belongs to whoever installs it, and it
168
+ needs your login.
169
+
170
+ Managing the desktop profile takes the `dsh` command that ships with Desktop, not
171
+ the npm one — the public CLI refuses the reserved `desktop` profile:
172
+
173
+ 1. Start Desktop once so the profile exists, then quit it fully (closing the
174
+ window only hides it; on Windows use the tray).
175
+ 2. `dsh plugin --profile desktop add @alexpeng/dsh-custom-plugin`
176
+ 3. Reopen Desktop. The in-app Plugin Manager installs and updates against the
177
+ same profile using Desktop's own bundled pnpm, if you would rather not open a
178
+ terminal.
179
+
180
+ Appearance, prompt library, project folders, stars and usage all live in
181
+ `$DSH_HOME/custom-plugin-state.json`, which Desktop and Web share by design —
182
+ each keeps its own `profiles/<name>` for code, never for that file — so
183
+ switching between the two shows the same data. Both hosts can therefore write it
184
+ at once, which is why the state replace names its temp file after the writing
185
+ process.
186
+
132
187
  ### From GitHub (source install)
133
188
 
134
189
  ```sh
@@ -191,15 +246,47 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
191
246
  - Cost estimates use DeepSeek's official peak/off-peak list prices and are indicative only.
192
247
  - Dark-mode background restriction is deliberate: only "no color" and "aurora" are selectable in dark mode.
193
248
  - DSH currently exposes no archive-restore API; the plugin does not bypass that boundary by editing the underlying registry.
249
+ - The command palette owns `Ctrl+K` / `Cmd+K` (no Alt/Shift, ignored inside editors). dsh's own default on the **web** profile is `Ctrl+Alt+K` (the desktop default is plain `Ctrl+K`), so nothing collides out of the box — but dsh 0.1.7 lets you rebind host shortcuts, and if you assign a host command to plain `Ctrl+K`, both fire. Keep the palette key reserved, or pick another binding there.
250
+ - 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.
194
251
 
195
252
  ## Development
196
253
 
197
254
  ```sh
198
- pnpm typecheck # type check
199
- pnpm test # vitest unit tests
200
- pnpm build # build the node ESM library and the browser bundle into lib/
255
+ pnpm typecheck # type check
256
+ pnpm test # vitest unit tests
257
+ pnpm build # build the node ESM library and the browser bundle into lib/
258
+ pnpm check:readme # bilingual README hash consistency
259
+ pnpm smoke # post-build contract checks: loader handshake, manifest
260
+ # fields dsh reads, patch row, local Mermaid engine
201
261
  ```
202
262
 
263
+ `scripts/live-dsh-check.sh` is a separate, manual probe against a **running**
264
+ isolated dsh profile (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`):
265
+ it exercises the host half on real session data — timeline, the three export
266
+ formats, the search scan path, usage scan, backup, the Mermaid engine route, the
267
+ client→host diagnostic ring, a UTF-8 state round trip that restores and then
268
+ verifies your prompt library, and both trust fences. It refuses to run against a
269
+ real `~/.dsh` unless you set `ALLOW_REAL_DSH_HOME=1`, reports `PASS`/`FAIL` per
270
+ probe, counts and names anything it `SKIP`s, and exits non-zero on any failure.
271
+ CI has no harness to talk to, so run it whenever a dsh release lands; slot
272
+ registration and rendering still need the browser pass described above.
273
+
274
+ Checking a new dsh release takes four commands, and never touches your own
275
+ harness home:
276
+
277
+ ```bash
278
+ mkdir -p /tmp/dshnext && cd /tmp/dshnext && npm init -y && npm i @deepseek-ai/dsh@<version>
279
+ DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js plugin --profile web add <packed.tgz>
280
+ DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js --profile web --no-open --port 13999 &
281
+ DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash scripts/live-dsh-check.sh
282
+ ```
283
+
284
+ If the release falls outside the declared peer range, the second command refuses
285
+ and rolls the profile back; `dsh plugin --profile web allow-version <pkg>@<ver>
286
+ --dsh-version <version> --accept-risk` grants the exact-version exemption, so the
287
+ probe can tell you *what* actually breaks instead of what the gate already
288
+ refused.
289
+
203
290
  ## License
204
291
 
205
292
  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
@@ -93,8 +93,8 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
93
93
  - **防自动跳转**:强制 `scroll-behavior: auto`,发送消息不再把视图拽到底部(默认关闭);
94
94
  - **公式复制**:含公式的消息下方显示 LaTeX / MathML 复制按钮(MathML 可直接粘贴进 Word);
95
95
  - **批量归档**:勾选多个会话批量归档,运行中会话默认不可选,并分别报告成功与失败数量;DSH 尚未公开恢复接口,插件不提供恢复入口。
96
- - **会话搜索**:通过 DSH 官方索引搜索当前会话的用户、助手和工具内容,点击结果跳转到所属轮次。
97
- - **快捷面板**:在非编辑状态按 `Ctrl+K` / `Cmd+K`,统一搜索会话、工作区、提示词和常用功能。
96
+ - **会话搜索**:搜索当前会话的用户、助手和工具内容,点击结果跳转到所属轮次;部署开启了 dsh 事件索引时走索引,否则直接扫描同一份会话日志,面板会说明本次用的是哪条路径。
97
+ - **快捷面板**:在非编辑状态按 `Ctrl+K` / `Cmd+K`,统一搜索会话、工作区、提示词和常用功能;跨会话全文搜索使用 dsh 官方接口,不可用时如实提示原因。
98
98
  - **可靠归档**:运行中的会话默认不可选,批量操作分别报告成功与失败数量。
99
99
 
100
100
  ### 额度与用量
@@ -116,9 +116,24 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
116
116
 
117
117
  `custom_plugin_status` 工具报告:外观配置、今日按模型用量、余额、时间线样本、Mermaid 引擎加载情况、状态文件路径与客户端诊断。插件不注入任何系统提示。
118
118
 
119
+ ## 版本对应
120
+
121
+ | 插件版本 | 构建并实测过的 dsh | 状态 |
122
+ | --- | --- | --- |
123
+ | 0.6.x | dsh 0.1.7-rc.2 与 dsh 0.2.0-rc.2(peer 范围两个都写进去了,见「安装」) | 本版本 |
124
+ | 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 桌面版也算 |
125
+ | 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 时代 | 已被取代,在 0.1.7+ 上不要指望可用 |
126
+
127
+ 0.1.7 改掉了本套件依赖的插件侧契约(会话导航归 `ctx.uiWorkspace`、会话列表不再提供
128
+ 当前查看的会话、消息模型移除 `tool-result` 内容块),两个版本互不替代。0.1.7 及更新
129
+ 的 dsh 会在安装与启动时按 bundle 的 `@deepseek-ai/dsh-*` peer 范围校验自身版本,不匹配
130
+ 就整包跳过。没有这道闸的更早宿主仍会加载插件,但表现为功能退化:实测 0.1.1-rc.2 上
131
+ 8 个槽位注册成 7 个,turnTail 条目被拒(该槽位自 0.1.6-alpha.2 起由 chain 改为 list),打开会话、
132
+ 创建分支、跨会话搜索会提示对应服务缺失,而不是抛错。
133
+
119
134
  ## 安装
120
135
 
121
- 前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。
136
+ 前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。本版本面向 **dsh 0.1.7-rc.2 及其后的 0.1.x,外加 0.2.0-rc.2**:dsh 在安装与启动时会用自身版本校验 bundle 的 `@deepseek-ai/dsh-*` peer 范围,不匹配的 bundle 会被整包跳过,所以 `package.json` 只写出本包实际构建并实测过的那些版本。0.6.0 是针对 0.2.0-rc.2 做类型检查与构建的,同一个产物在两条运行时线上都跑过活体宿主探针:0.2.0-rc.2(boot 图 66 行)与 0.1.7-rc.2(65 行)各 19 项里 18 项通过,跳过的那项需要真实会话。验不到的部分和以往一样:回合内的 chips(分叉、Mermaid 渲染、LaTeX)需要一次真实的模型回复,无凭据的临时家目录跑不出来,槽位渲染也仍要在浏览器里过一遍。范围刻意不收 0.2.0-rc.1(已被取代的预发布版)、0.2.0-rc.3 及之后谁都没看过的预发布版,以及尚未验证的 0.2.0 正式版。范围的写法在这里有讲究:`^0.1.7-rc.2` 展开成 `>=0.1.7-rc.2 <0.2.0-0`,而每一个 `0.2.0-rc.N` 都排在 `0.2.0-0` **之上**,所以实测过的预发布版本必须单独写成一段——`pnpm smoke` 会检查构建目标确实落在声明范围里,并且 `engines.dsh` 与它放行同一批版本。仍在旧版 dsh 的用户请安装对应的旧版插件(0.5.0 面向 0.1.7-rc.2),而不是授予兼容性豁免。
122
137
 
123
138
  ### 从 npm 安装
124
139
 
@@ -129,6 +144,35 @@ dsh plugin --profile web add @alexpeng/dsh-custom-plugin
129
144
 
130
145
  registry 上是预构建产物,安装端无需从源码构建。
131
146
 
147
+ ### 在 dsh 桌面版上
148
+
149
+ dsh 桌面版是同一套 Web 应用外面的一层 Electron 壳,随包携带**正好是 dsh
150
+ 0.2.0-rc.2**——桌面发布线把壳和运行时钉成同一个版本,所以桌面端拿到的永远是
151
+ 0.2.x 运行时。0.6.0 的 peer 范围把这个版本写了进去,因此在桌面版上安装不需要任
152
+ 何兼容性豁免;0.5.0 需要,它给出的拒绝信息和 0.2.x 的 Web profile 完全一样。
153
+
154
+ 对 0.2.0-rc.2 的实测:boot 图里有我们那一行、五个 inject 目标都在、Mermaid 引
155
+ 擎本地加载,宿主侧探针的成绩与在 0.1.7-rc.2 上的一致。桌面版的请求路径也不碰本
156
+ 插件的访问围栏——壳在把渲染进程的请求转发给它自己的 Host 之前会删掉 `host`、
157
+ `origin`、`sec-fetch-site`、`cookie`,再挂上它自己的凭证,而 loopback 围栏接受
158
+ 的正是这个形状(这条围栏此前只有实跑脚本覆盖,如今有了单测)。没做的是在真的桌
159
+ 面窗口里打开这个插件;那一遍验收归装它的人,而且要用你的登录。
160
+
161
+ 管桌面 profile 要用桌面版自带的 `dsh` 命令,不是 npm 装的那个——公开 CLI 拒绝
162
+ 保留的 `desktop` profile:
163
+
164
+ 1. 先启动一次桌面版让 profile 建立,然后完全退出(关窗口只是隐藏;Windows 上
165
+ 从托盘退出)。
166
+ 2. `dsh plugin --profile desktop add @alexpeng/dsh-custom-plugin`
167
+ 3. 重新打开桌面版。应用内的插件管理器也用桌面版自带的 pnpm 在同一个 profile 上
168
+ 安装和更新,不想开终端就用它。
169
+
170
+ 外观、提示词库、项目文件夹、星标和用量都存在
171
+ `$DSH_HOME/custom-plugin-state.json`,这个文件按设计由桌面版和 Web 共享——两
172
+ 边各自持有自己的 `profiles/<名字>`,那里面只放代码不放这个文件——所以在两者
173
+ 之间切换看到的是同一份数据。两个宿主因此可能同时写它,这就是状态替换把临时文
174
+ 件按写入进程的 pid 命名的原因。
175
+
132
176
  ### 从 GitHub 安装(源码安装)
133
177
 
134
178
  ```sh
@@ -190,16 +234,41 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
190
234
  - 系统凭据存储会在宿主启动时检测 profile `node_modules` 中的 `keytar` 模块;无法加载时使用兼容的状态文件回退。
191
235
  - 费用按 DeepSeek 官方峰谷单价估算,仅供参考。
192
236
  - 深色模式下背景限制是刻意设计:仅「无颜色」与「极光」可选。
237
+ - dsh 0.1.7 起支持自定义快捷键。快捷面板固定占用 `Ctrl/Cmd+K`(不带 Alt/Shift,且编辑器内不触发)。dsh 在 **web** 上的默认值是 `Ctrl+Alt+K`(桌面版默认才是裸 `Ctrl+K`),所以开箱并不冲突;但你可以把某个 dsh 命令重新绑到 `Ctrl+K`,那样两者会同时响应,请把其中一个换开。
193
238
  - DSH 当前没有公开的归档恢复接口;插件不会绕过官方边界修改底层注册表。
239
+ - dsh 自带的 `web` profile 把 session-query 索引配成 `openAt: never`,即默认不启用全文搜索。此时会话内搜索改为直接扫描日志(按出现顺序,最多 100 条),快捷面板的跨会话搜索会显示 dsh 给出的不可用原因。
194
240
 
195
241
  ## 开发
196
242
 
197
243
  ```sh
198
- pnpm typecheck # 类型检查
199
- pnpm test # vitest 单元测试
200
- pnpm build # 构建 node ESM 库与浏览器 bundle 到 lib/
244
+ pnpm typecheck # 类型检查
245
+ pnpm test # vitest 单元测试
246
+ pnpm build # 构建 node ESM 库与浏览器 bundle 到 lib/
247
+ pnpm check:readme # 双语 README 哈希一致性
248
+ pnpm smoke # 构建后契约自检:加载器握手、dsh 会读的清单字段、
249
+ # patch 行、本地 Mermaid 引擎
201
250
  ```
202
251
 
252
+ `scripts/live-dsh-check.sh` 是另一条**手动**探针,对着一个正在运行的隔离 dsh profile
253
+ (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`),在真实会话数据上跑宿主侧全链路:
254
+ 时间线、三种导出、搜索扫描路径、用量扫描、备份、Mermaid 引擎路由、客户端→宿主的诊断回环、
255
+ 一次会还原并校验提示词库的 UTF-8 往返,以及两处同源/loopback 围栏。默认拒绝在真实的
256
+ `~/.dsh` 上运行(需显式 `ALLOW_REAL_DSH_HOME=1`),逐项报 PASS/FAIL,被 `SKIP` 的项会计数并写进收尾行,任一失败即非零退出。
257
+ CI 没有可对话的宿主,所以每次 dsh 发版都建议跑一遍;槽位注册与渲染仍需按上文用浏览器过一遍。
258
+
259
+ 自己验一个新 dsh 版本只要四条命令,且全程不碰你自己的 harness 家目录:
260
+
261
+ ```bash
262
+ mkdir -p /tmp/dshnext && cd /tmp/dshnext && npm init -y && npm i @deepseek-ai/dsh@<版本>
263
+ DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js plugin --profile web add <打包好的.tgz>
264
+ DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js --profile web --no-open --port 13999 &
265
+ DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash scripts/live-dsh-check.sh
266
+ ```
267
+
268
+ 若新版本落在声明的 peer 范围之外,第二条会被拒并回滚 profile;这时可以用
269
+ `dsh plugin --profile web allow-version <包名>@<版本> --dsh-version <版本> --accept-risk`
270
+ 授予精确版本豁免——这样探针能告诉你**到底是什么坏了**,而不是只看到闸口拒绝。
271
+
203
272
  ## 许可证
204
273
 
205
274
  Apache-2.0。部分代码参考 [Nagi-ovo/voyager](https://github.com/Nagi-ovo/voyager) 与 [unovue/inspira-ui](https://github.com/unovue/inspira-ui)。
package/icon.svg ADDED
@@ -0,0 +1,29 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="Custom 便利套件">
2
+ <defs>
3
+ <linearGradient id="bg" x1="0" y1="0" x2="0" y2="1">
4
+ <stop offset="0" stop-color="#26304a"/>
5
+ <stop offset="1" stop-color="#1a2135"/>
6
+ </linearGradient>
7
+ </defs>
8
+ <rect width="64" height="64" rx="14" fill="url(#bg)"/>
9
+ <g stroke="#8fa4c8" stroke-width="2.5" stroke-linecap="round">
10
+ <path d="M34 20h14"/>
11
+ <path d="M34 32h10"/>
12
+ <path d="M34 44h14"/>
13
+ </g>
14
+ <g fill="#e9ebee">
15
+ <circle cx="44" cy="20" r="4"/>
16
+ <circle cx="40" cy="32" r="4"/>
17
+ <circle cx="46" cy="44" r="4"/>
18
+ </g>
19
+ <g stroke="#c9d3e4" stroke-width="2" stroke-linecap="round">
20
+ <path d="M18 16v32"/>
21
+ </g>
22
+ <g fill="#f2b544">
23
+ <circle cx="18" cy="22" r="3.5"/>
24
+ </g>
25
+ <g fill="#7f93b8">
26
+ <circle cx="18" cy="32" r="2.5"/>
27
+ <circle cx="18" cy="42" r="2.5"/>
28
+ </g>
29
+ </svg>