@alexpeng/dsh-custom-plugin 0.4.1 → 0.5.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 +203 -0
- package/README.i18n.yaml +2 -2
- package/README.md +56 -6
- package/README.zh.md +45 -6
- package/icon.svg +29 -0
- package/lib/client.js +234 -127
- package/lib/client.js.map +1 -1
- package/lib/index.js +156 -38
- package/lib/types/client/custom.d.ts +44 -7
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/extract.d.ts +16 -0
- package/lib/types/host-service.d.ts +16 -2
- package/lib/types/protocol.d.ts +2 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +26 -17
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,209 @@ 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.5.0 — 2026-09-28
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
- **Target dsh 0.1.7-rc.2.** All `@deepseek-ai/dsh-*` dependencies, the
|
|
12
|
+
`@deepseek-ai/dsh-tools` peer range, and `@deepseek-ai/cordis` moved to the
|
|
13
|
+
versions that release ships, and `engines.dsh` now states the supported range.
|
|
14
|
+
dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own runtime
|
|
15
|
+
version at install and startup and skips a bundle that does not match. The
|
|
16
|
+
declared floor is the release this package was built and verified against;
|
|
17
|
+
`^0.1.7-rc.2` additionally admits later 0.1.x releases that have not been
|
|
18
|
+
re-verified, and `engines.dsh` is declarative — no part of dsh reads it.
|
|
19
|
+
- The browser half declares `dsh.client.inject` as the five packages that own
|
|
20
|
+
the slots it registers into, replacing the retired
|
|
21
|
+
`@deepseek-ai/dsh-client-runtime` row.
|
|
22
|
+
- Slot-provided data shapes (`SessionListState`, `WorkspaceListState`,
|
|
23
|
+
`TurnLocation`) are now declared locally instead of imported from harness
|
|
24
|
+
controller packages that rename across releases; only `SnapshotSelectorHook`
|
|
25
|
+
still comes from the slot SDK.
|
|
26
|
+
- In-session search uses dsh's event index when the deployment opens one and
|
|
27
|
+
otherwise scans the session log it already read, reporting which path answered
|
|
28
|
+
in the panel. dsh's shipped `web` profile configures the index with
|
|
29
|
+
`openAt: never`, so the indexed route was unavailable on a default install.
|
|
30
|
+
- Plugin Manager cards, bundle details, and the settings inventory now show a
|
|
31
|
+
real name and icon: `locale/en.json`, `locale/zh.json`, and `icon.svg`.
|
|
32
|
+
|
|
33
|
+
### Fixed
|
|
34
|
+
|
|
35
|
+
- **The timeline rail, export, and quote features lost the current session.**
|
|
36
|
+
The session list snapshot has had no `current` field since dsh
|
|
37
|
+
0.1.6-alpha.2 (view selection moved to the Workspace browser), so the rail
|
|
38
|
+
tracked nothing. The viewed session now comes from the standard `sessionId`
|
|
39
|
+
prop every session-scoped slot entry receives.
|
|
40
|
+
- **Opening a session or a workspace failed silently.** `ctx.sessions.open` is
|
|
41
|
+
gone; navigation goes through `ctx.uiWorkspace.openSession()` /
|
|
42
|
+
`connectWorkspace()`. Branching and full-text search go through
|
|
43
|
+
`ctx.remote.session.fork()` / `.search()` — `ctx.sessions` still declares
|
|
44
|
+
those two, but the remote namespace is the documented surface — each with an
|
|
45
|
+
honest failure message when the service is absent.
|
|
46
|
+
- **Exports lost tool results and the new model-visible messages.** The
|
|
47
|
+
`tool-result` content block was replaced by a tool-role message whose call id
|
|
48
|
+
now sits on the message (`toolCallId`, still falling back to `source.callId`
|
|
49
|
+
for older logs); `system/message` and `developer/message` are exported as
|
|
50
|
+
injected context; and `file`, `tool-addition`, `tool-removal`, and offloaded
|
|
51
|
+
`image` blocks are named instead of dropped.
|
|
52
|
+
- `conversation.chat.turnTail` changed from a chain slot to a list slot, so its
|
|
53
|
+
`select` registration option no longer applies and was replaced by an id and
|
|
54
|
+
order.
|
|
55
|
+
- Client diagnostics are throttled per message kind. The previous single shared
|
|
56
|
+
window let the frequently emitted rail line swallow the one-shot timeline
|
|
57
|
+
result line, which made a successful timeline fetch look like zero turns.
|
|
58
|
+
- `pnpm smoke` now checks the manifest fields dsh reads before it activates a
|
|
59
|
+
bundle (client platform and `./client` export, patch path, icon size, locale
|
|
60
|
+
display metadata, and peer ranges agreeing with the build target), so an
|
|
61
|
+
unsupported or stale declaration fails the local gate instead of being skipped
|
|
62
|
+
silently in a user's profile. The peer check refuses to read a range form it
|
|
63
|
+
cannot interpret, and every `files` entry must resolve to something in the tree
|
|
64
|
+
— an entry matching nothing used to publish a bundle missing that piece. Both
|
|
65
|
+
new rules were confirmed red by breaking them on purpose. The
|
|
66
|
+
`dsh.client.inject` rows are counted, not resolved: only a running shell knows
|
|
67
|
+
which module ids it serves, so a retired name there is caught by the live
|
|
68
|
+
boot-graph probe below, not by this gate.
|
|
69
|
+
- A search excerpt now extends its window so a pasted query longer than two
|
|
70
|
+
thirds of the excerpt is still shown whole. Measured first: the previous
|
|
71
|
+
centering already covered ordinary queries, including a hit at the very end of
|
|
72
|
+
a long message, so only the long-query case was affected — the fix is narrow,
|
|
73
|
+
and the added test fails against the old formula.
|
|
74
|
+
- Exports no longer fail outright on a `tool/result` event whose `message` is
|
|
75
|
+
absent, and the scan fallback reads each event shape through its own typed
|
|
76
|
+
case instead of a cast that hid real field drift.
|
|
77
|
+
- When cross-session full-text search is unavailable, the palette says what still
|
|
78
|
+
works (title matching over sessions and workspaces) instead of showing a bare
|
|
79
|
+
error.
|
|
80
|
+
- Added `scripts/live-dsh-check.sh`: a manual probe that runs against a *running*
|
|
81
|
+
isolated dsh profile and exercises the host half on real session data
|
|
82
|
+
(timeline, the three export formats, the search scan path, usage scan, backup,
|
|
83
|
+
a UTF-8 state round trip, the Mermaid engine route, the client→host diagnostic
|
|
84
|
+
ring, both fences, and the boot graph the shell serves), exiting non-zero on
|
|
85
|
+
any failure. CI has no harness to talk to, so this is the check to run when a
|
|
86
|
+
dsh release lands. Verified against 0.1.7-rc.2 with 19 probes green; the
|
|
87
|
+
session-dependent ones `SKIP` — and the closing line counts them instead of
|
|
88
|
+
claiming a clean sweep — when the scratch home holds no session, and the UTF-8
|
|
89
|
+
probe was shown to distinguish a correct write from the mangled-bytes write it
|
|
90
|
+
guards against.
|
|
91
|
+
- The live check itself was then tested against a dead endpoint and found two of
|
|
92
|
+
its own probes green-by-absence; the restore probe now refuses to pass when the
|
|
93
|
+
append it restores never landed. Running it against a real profile exposed five
|
|
94
|
+
more defects in the tool, all fixed: restoring the prompt library through
|
|
95
|
+
`curl -d "$var"` mangled non-ASCII to U+FFFD (Git Bash re-encodes non-ASCII
|
|
96
|
+
argv for `curl.exe`), so bodies are now written by node and sent with
|
|
97
|
+
`--data-binary @file`; the script checked out with CRLF endings (the stored
|
|
98
|
+
blobs were already LF — `core.autocrlf` was rewriting them on checkout, now
|
|
99
|
+
pinned by `.gitattributes`); its search probe read the query word with a greedy
|
|
100
|
+
`sed` that needed *some* six-letter run anywhere after the last `"text":"`, so
|
|
101
|
+
it silently `SKIP`ped the one probe covering the scan path; it looked for
|
|
102
|
+
sessions under `<state file>/../sessions`, which only finds anything because
|
|
103
|
+
Windows folds the path lexically and would see nothing on a POSIX shell; and
|
|
104
|
+
the real-home guard missed a `DSH_HOME` written with a trailing separator,
|
|
105
|
+
which is exactly the spelling that would have probed a developer's own harness
|
|
106
|
+
home.
|
|
107
|
+
- The READMEs add a plugin-to-dsh compatibility table. A mismatched pair is not
|
|
108
|
+
silent — dsh logs `disabling profile plugin …` on stderr, rejects the install,
|
|
109
|
+
and models the state as `incompatible` in the plugin manager — but none of that
|
|
110
|
+
reaches the page a user is looking at, so the supported window belongs in the
|
|
111
|
+
README.
|
|
112
|
+
|
|
113
|
+
### Verified by independent review
|
|
114
|
+
|
|
115
|
+
Four reviewers were dispatched against `30e025b..HEAD` with separate charters
|
|
116
|
+
(code correctness, claims-vs-evidence, contract-vs-installed-runtime, and a
|
|
117
|
+
deep re-audit pinned to the previous commit). Their findings were each
|
|
118
|
+
re-verified before being acted on; three of their "critical" items were
|
|
119
|
+
refuted by measurement and are recorded below so nobody re-litigates them.
|
|
120
|
+
|
|
121
|
+
- Fixed: `package.json` declared `"icon"` twice. `JSON.parse` keeps the last
|
|
122
|
+
value, so every gate stayed green on a manifest npm would warn about. `pnpm
|
|
123
|
+
smoke` now counts top-level keys in the file text and compares them with what
|
|
124
|
+
survived parsing, and separately checks that `engines.dsh`'s floor names the
|
|
125
|
+
installed dsh-tools release (nothing in dsh reads `engines.dsh`, so this is
|
|
126
|
+
the only place that keeps it honest).
|
|
127
|
+
- Fixed: the session probes looked under `<state file>/../sessions`, which only
|
|
128
|
+
resolves because Windows folds the path lexically; they now use the home
|
|
129
|
+
directory directly. Skips are counted and named in the closing line, a missing
|
|
130
|
+
boot-graph URL line fails instead of vanishing, the Mermaid probe reads
|
|
131
|
+
`mermaidSource` rather than inferring "local" from a byte count, and a
|
|
132
|
+
rejected state write now carries the host's own error text.
|
|
133
|
+
- Fixed: the restore probe was vacuously green — it never checked that the
|
|
134
|
+
append it restores had landed. It now refuses to pass when the write failed,
|
|
135
|
+
verified by mutating the write condition and watching exactly that line go
|
|
136
|
+
red.
|
|
137
|
+
- Fixed: the client's last-holder clear left `turns` and the rail positions
|
|
138
|
+
behind with no session identity, and a holder whose `sessionId` prop flipped to
|
|
139
|
+
null could wipe the identity other holders were still rendering. A null holder
|
|
140
|
+
now claims nothing at all.
|
|
141
|
+
- Fixed: `slots.inject`'s callback registered the component outside the
|
|
142
|
+
surrounding `try`, so a rejected registration would take a surface down
|
|
143
|
+
silently while the diagnostic ring still read green; the deferred `register`
|
|
144
|
+
has its own guard now, and the summary line reports how many injection
|
|
145
|
+
requests it actually submitted rather than asserting "8 / 7" — dsh defers the
|
|
146
|
+
callback until a slot is declared, so no line printed at install time can
|
|
147
|
+
claim a surface materialized; the per-slot `ok` / `register` lines do that.
|
|
148
|
+
- Fixed: the search request was passed as `as never`, which hid that `values`
|
|
149
|
+
must be `keyof SessionEventMap` rather than `string`; typed, the compiler
|
|
150
|
+
caught it immediately. A synchronous throw from `searchEvents` now degrades to
|
|
151
|
+
the scan path like a rejection does, a log with exactly 100 hits no longer
|
|
152
|
+
claims there are more, and the scan's role filter is exercised by a fixture
|
|
153
|
+
that only it can exclude. Each of the three is pinned by a test that fails
|
|
154
|
+
against the code it replaces (verified by reverting one at a time).
|
|
155
|
+
- Fixed: the sidebar footer button ignored the `wide` prop the host supplies, so
|
|
156
|
+
its label wrapped into a vertical stack inside the 56px rail — measured both
|
|
157
|
+
ways on a live profile: 36px icon-only when collapsed, "项目" again at 280px.
|
|
158
|
+
- Added `scripts/check-boot-graph.mjs`, run by the live check: the served
|
|
159
|
+
`__DSH_BOOT__` graph must contain our row, every `dsh.client.inject` target,
|
|
160
|
+
and reachable client bytes. This is the only gate that can see the failure
|
|
161
|
+
shape that started this whole upgrade — a manifest naming a module the shell no
|
|
162
|
+
longer serves — and it was confirmed red by pointing the inject list at the
|
|
163
|
+
retired `@deepseek-ai/dsh-client-runtime`.
|
|
164
|
+
- Measured against dsh 0.2.0-rc.1 (published the day after this release):
|
|
165
|
+
`dsh plugin add` rejects the bundle and rolls the profile back; with the
|
|
166
|
+
exact-version exemption granted, the source typechecks against 0.2's own
|
|
167
|
+
types, 111/111 unit tests pass, 19/19 live probes pass, and the browser
|
|
168
|
+
behaves as on 0.1.7 — eight slot registrations, the rail, prompt insertion,
|
|
169
|
+
the `Ctrl+K` palette with title search, and quote-reply. The peer range is
|
|
170
|
+
deliberately not widened: `^0.2.0-rc.1` would silently admit every 0.2.x
|
|
171
|
+
release, including a stable nobody has reviewed — the very failure this
|
|
172
|
+
upgrade exists to prevent. What stays unverified there (branch / Mermaid /
|
|
173
|
+
LaTeX chips) is unverified here too: those need a real model reply.
|
|
174
|
+
- Retracted after re-measurement, so the record does not carry them: "the
|
|
175
|
+
`slots.inject(key, fn)` service method does not exist in 0.1.7" (it is
|
|
176
|
+
declared at `dsh-client-ui-renderer`'s registry interface, and all eight
|
|
177
|
+
surfaces materialize in a live browser); "`data-chat-flow-kind` is gone, so the
|
|
178
|
+
rail has no anchors" (the reading was taken while the host's trajectory tab had
|
|
179
|
+
the chat flow unmounted); "`WorkspaceSnapshot.state` was renamed to `phase`"
|
|
180
|
+
(both axes ship side by side). Corrected in place: `ctx.sessions` still
|
|
181
|
+
declares `fork()` and `search()` (only `open` is gone), the `current` field and
|
|
182
|
+
the turnTail kind change both landed in 0.1.6-alpha.2 rather than 0.1.7, and
|
|
183
|
+
the bilingual README gate enforces hash freshness, not content parity.
|
|
184
|
+
|
|
185
|
+
## 0.4.2 — 2026-09-12
|
|
186
|
+
|
|
187
|
+
### Fixed
|
|
188
|
+
|
|
189
|
+
- **Exports fail on forked/resumed sessions with "读取会话失败: seeded
|
|
190
|
+
session constructor seed must equal its inherited prefix".** Newer dsh
|
|
191
|
+
builds replay-validate inside `sessionQuery.readSession()` through a
|
|
192
|
+
snapshot-mode constructor that rejects any seeded (forked or resumed) session
|
|
193
|
+
whose log outgrew its seed boundary, so timeline, export, in-session
|
|
194
|
+
search, and usage scans all failed on those sessions. Every read now goes
|
|
195
|
+
through a shared helper that falls back to `observeSession()` (the live and
|
|
196
|
+
restore paths dsh's own session page uses) when `readSession()` rejects, and
|
|
197
|
+
surfaces the original error only when no fallback exists.
|
|
198
|
+
- **The "PDF(含图片)" export button produced an `.html` file.** The button and
|
|
199
|
+
its description now say what actually lands on disk: "HTML(含图片)", a
|
|
200
|
+
print-ready HTML document you turn into a PDF via the browser print dialog.
|
|
201
|
+
- **Weather FX are invisible on light backgrounds.** Snow, rain, and sakura
|
|
202
|
+
colors were tuned for the dark theme only — pure-white flakes, 6%-alpha pale
|
|
203
|
+
rain, and 90%-lightness pink petals all vanish over the near-white palette
|
|
204
|
+
backgrounds. The FX canvas now picks a darker particle palette (cool slate
|
|
205
|
+
snow, steel-blue rain, deeper rose petals, each with a lifted alpha floor)
|
|
206
|
+
whenever the resolved theme is light or the saturated aurora background is
|
|
207
|
+
active, and swaps palettes live on theme/background changes without
|
|
208
|
+
rebuilding the particle field.
|
|
209
|
+
|
|
7
210
|
## 0.4.1 — 2026-09-09
|
|
8
211
|
|
|
9
212
|
### 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:
|
|
7
|
-
README.zh.md:
|
|
6
|
+
README.md: 4660041579f0afb622e515c4531bb47f3f8369da
|
|
7
|
+
README.zh.md: f0f82dfa0fb26dd9661c8394da11fe56203924c3
|
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
|
|
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,27 @@ 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.5.x | dsh 0.1.7-rc.2 (declared range `>=0.1.7-rc.2 <0.2.0`) | current |
|
|
124
|
+
| 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 era | superseded; do not expect it to work on 0.1.7+ |
|
|
125
|
+
|
|
126
|
+
0.1.7 changed the plugin-facing contracts this suite depends on (session
|
|
127
|
+
navigation moved to `ctx.uiWorkspace`, the session list stopped publishing the
|
|
128
|
+
viewed session, and the message model dropped the `tool-result` content block),
|
|
129
|
+
so neither release substitutes for the other. dsh 0.1.7+ validates a bundle's
|
|
130
|
+
`@deepseek-ai/dsh-*` peer ranges against its own version at install and startup
|
|
131
|
+
and skips a bundle that does not match. Runtimes predating that gate load the
|
|
132
|
+
bundle anyway and degrade instead: on 0.1.1-rc.2, 7 of 8 slot registrations
|
|
133
|
+
succeed, the turn-tail entry is rejected (that slot became a list slot back in
|
|
134
|
+
0.1.6-alpha.2), and the open-session / branch / cross-session actions
|
|
135
|
+
report their service as missing rather than throwing.
|
|
136
|
+
|
|
119
137
|
## Install
|
|
120
138
|
|
|
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).
|
|
139
|
+
Prerequisites: Node 22+, pnpm, and the `dsh` CLI (the official `@deepseek-ai/dsh` npm package; `npx @deepseek-ai/dsh` stands in for `dsh` when it is not installed globally). This release targets **dsh 0.1.7-rc.2 through the rest of 0.1.x** — dsh checks a bundle's `@deepseek-ai/dsh-*` peer ranges against its own version at install and startup, and skips a bundle that does not match, so `package.json` declares a range whose floor is the release this package was actually built and verified against. It does not yet support 0.2.x: `^0.1.7-rc.2` excludes it, and `dsh plugin add` against 0.2.0-rc.1 rejects the install and rolls the profile back. What has been measured there, with dsh's exact-version exemption granted: the source typechecks against 0.2.0-rc.1's own published types, 111/111 unit tests pass, all 19 live host probes pass, and the browser surfaces behave the same as on 0.1.7 — eight slot registrations, the timeline rail, prompt insertion into the composer, `Ctrl+K` palette with title search, and quote-reply writing a blockquote. What stays unverified there is what stays unverified here: the per-turn chips (branch, Mermaid render, LaTeX) need a real model reply, so a credential-free scratch home cannot reach them. The range is not widened for a different reason — `^0.2.0-rc.1` would silently admit every 0.2.x release, including a future stable nobody has looked at, which is the same mistake this upgrade exists to stop. On an older dsh, install the matching older plugin release instead of granting a compatibility exemption.
|
|
122
140
|
|
|
123
141
|
### From npm
|
|
124
142
|
|
|
@@ -191,15 +209,47 @@ Appearance and feature toggles (the `cfg` field, all with defaults):
|
|
|
191
209
|
- Cost estimates use DeepSeek's official peak/off-peak list prices and are indicative only.
|
|
192
210
|
- Dark-mode background restriction is deliberate: only "no color" and "aurora" are selectable in dark mode.
|
|
193
211
|
- DSH currently exposes no archive-restore API; the plugin does not bypass that boundary by editing the underlying registry.
|
|
212
|
+
- The command palette owns `Ctrl+K` / `Cmd+K` (no Alt/Shift, ignored inside editors). dsh's own default on the **web** profile is `Ctrl+Alt+K` (the desktop default is plain `Ctrl+K`), so nothing collides out of the box — but dsh 0.1.7 lets you rebind host shortcuts, and if you assign a host command to plain `Ctrl+K`, both fire. Keep the palette key reserved, or pick another binding there.
|
|
213
|
+
- 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
214
|
|
|
195
215
|
## Development
|
|
196
216
|
|
|
197
217
|
```sh
|
|
198
|
-
pnpm typecheck
|
|
199
|
-
pnpm test
|
|
200
|
-
pnpm build
|
|
218
|
+
pnpm typecheck # type check
|
|
219
|
+
pnpm test # vitest unit tests
|
|
220
|
+
pnpm build # build the node ESM library and the browser bundle into lib/
|
|
221
|
+
pnpm check:readme # bilingual README hash consistency
|
|
222
|
+
pnpm smoke # post-build contract checks: loader handshake, manifest
|
|
223
|
+
# fields dsh reads, patch row, local Mermaid engine
|
|
201
224
|
```
|
|
202
225
|
|
|
226
|
+
`scripts/live-dsh-check.sh` is a separate, manual probe against a **running**
|
|
227
|
+
isolated dsh profile (`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`):
|
|
228
|
+
it exercises the host half on real session data — timeline, the three export
|
|
229
|
+
formats, the search scan path, usage scan, backup, the Mermaid engine route, the
|
|
230
|
+
client→host diagnostic ring, a UTF-8 state round trip that restores and then
|
|
231
|
+
verifies your prompt library, and both trust fences. It refuses to run against a
|
|
232
|
+
real `~/.dsh` unless you set `ALLOW_REAL_DSH_HOME=1`, reports `PASS`/`FAIL` per
|
|
233
|
+
probe, counts and names anything it `SKIP`s, and exits non-zero on any failure.
|
|
234
|
+
CI has no harness to talk to, so run it whenever a dsh release lands; slot
|
|
235
|
+
registration and rendering still need the browser pass described above.
|
|
236
|
+
|
|
237
|
+
Checking a new dsh release takes four commands, and never touches your own
|
|
238
|
+
harness home:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
mkdir -p /tmp/dshnext && cd /tmp/dshnext && npm init -y && npm i @deepseek-ai/dsh@<version>
|
|
242
|
+
DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js plugin --profile web add <packed.tgz>
|
|
243
|
+
DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js --profile web --no-open --port 13999 &
|
|
244
|
+
DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash scripts/live-dsh-check.sh
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
If the release falls outside the declared peer range, the second command refuses
|
|
248
|
+
and rolls the profile back; `dsh plugin --profile web allow-version <pkg>@<ver>
|
|
249
|
+
--dsh-version <version> --accept-risk` grants the exact-version exemption, so the
|
|
250
|
+
probe can tell you *what* actually breaks instead of what the gate already
|
|
251
|
+
refused.
|
|
252
|
+
|
|
203
253
|
## License
|
|
204
254
|
|
|
205
255
|
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
|
-
-
|
|
97
|
-
- **快捷面板**:在非编辑状态按 `Ctrl+K` / `Cmd+K
|
|
96
|
+
- **会话搜索**:搜索当前会话的用户、助手和工具内容,点击结果跳转到所属轮次;部署开启了 dsh 事件索引时走索引,否则直接扫描同一份会话日志,面板会说明本次用的是哪条路径。
|
|
97
|
+
- **快捷面板**:在非编辑状态按 `Ctrl+K` / `Cmd+K`,统一搜索会话、工作区、提示词和常用功能;跨会话全文搜索使用 dsh 官方接口,不可用时如实提示原因。
|
|
98
98
|
- **可靠归档**:运行中的会话默认不可选,批量操作分别报告成功与失败数量。
|
|
99
99
|
|
|
100
100
|
### 额度与用量
|
|
@@ -116,9 +116,23 @@ DeepSeek Harness(DSH)Web GUI 的 Custom 便利套件:个性化外观、天
|
|
|
116
116
|
|
|
117
117
|
`custom_plugin_status` 工具报告:外观配置、今日按模型用量、余额、时间线样本、Mermaid 引擎加载情况、状态文件路径与客户端诊断。插件不注入任何系统提示。
|
|
118
118
|
|
|
119
|
+
## 版本对应
|
|
120
|
+
|
|
121
|
+
| 插件版本 | 构建并实测过的 dsh | 状态 |
|
|
122
|
+
| --- | --- | --- |
|
|
123
|
+
| 0.5.x | dsh 0.1.7-rc.2(声明范围 `>=0.1.7-rc.2 <0.2.0`) | 当前 |
|
|
124
|
+
| 0.4.2 | dsh 0.1.1-rc.1 … 0.1.6 时代 | 已被取代,在 0.1.7+ 上不要指望可用 |
|
|
125
|
+
|
|
126
|
+
0.1.7 改掉了本套件依赖的插件侧契约(会话导航归 `ctx.uiWorkspace`、会话列表不再提供
|
|
127
|
+
当前查看的会话、消息模型移除 `tool-result` 内容块),两个版本互不替代。0.1.7 及更新
|
|
128
|
+
的 dsh 会在安装与启动时按 bundle 的 `@deepseek-ai/dsh-*` peer 范围校验自身版本,不匹配
|
|
129
|
+
就整包跳过。没有这道闸的更早宿主仍会加载插件,但表现为功能退化:实测 0.1.1-rc.2 上
|
|
130
|
+
8 个槽位注册成 7 个,turnTail 条目被拒(该槽位自 0.1.6-alpha.2 起由 chain 改为 list),打开会话、
|
|
131
|
+
创建分支、跨会话搜索会提示对应服务缺失,而不是抛错。
|
|
132
|
+
|
|
119
133
|
## 安装
|
|
120
134
|
|
|
121
|
-
前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh
|
|
135
|
+
前置:Node 22+、pnpm,以及 `dsh` CLI(官方 npm 包 `@deepseek-ai/dsh`;未全局安装时,可用 `npx @deepseek-ai/dsh` 代替 `dsh`)。本版本面向 **dsh 0.1.7-rc.2 及其后的 0.1.x**:dsh 在安装与启动时会用自身版本校验 bundle 的 `@deepseek-ai/dsh-*` peer 范围,不匹配的 bundle 会被整包跳过,所以 `package.json` 声明的范围以下界为准——下界才是本包实际构建并实测过的那个版本。0.2.x 暂不在支持范围内:`^0.1.7-rc.2` 把它排除在外,`dsh plugin add` 在 0.2.0-rc.1 上会直接拒绝安装并回滚 profile。已实测到的部分(授予 dsh 的精确版本豁免后):源码能通过 0.2.0-rc.1 自己发布的类型检查、111 个单测全过、19 条活体探针全过,浏览器侧与 0.1.7 表现一致——八个槽位注册、时间线轨、提示词写入输入框、`Ctrl+K` 面板带标题检索、引用回复把 blockquote 写进输入框。验不到的部分也和 0.1.7 一样:回合内的 chips(分叉、Mermaid 渲染、LaTeX)需要一次真实的模型回复,无凭据的临时家目录跑不出来。不收编范围还有另一个理由:`^0.2.0-rc.1` 会静默放行整个 0.2.x,包括一个谁都没看过的正式版——而这正是这次升级要止住的错误。仍在旧版 dsh 的用户请安装对应的旧版插件,而不是授予兼容性豁免。
|
|
122
136
|
|
|
123
137
|
### 从 npm 安装
|
|
124
138
|
|
|
@@ -190,16 +204,41 @@ dsh plugin --profile web add link:F:/dsh-plugin-dev
|
|
|
190
204
|
- 系统凭据存储会在宿主启动时检测 profile `node_modules` 中的 `keytar` 模块;无法加载时使用兼容的状态文件回退。
|
|
191
205
|
- 费用按 DeepSeek 官方峰谷单价估算,仅供参考。
|
|
192
206
|
- 深色模式下背景限制是刻意设计:仅「无颜色」与「极光」可选。
|
|
207
|
+
- dsh 0.1.7 起支持自定义快捷键。快捷面板固定占用 `Ctrl/Cmd+K`(不带 Alt/Shift,且编辑器内不触发)。dsh 在 **web** 上的默认值是 `Ctrl+Alt+K`(桌面版默认才是裸 `Ctrl+K`),所以开箱并不冲突;但你可以把某个 dsh 命令重新绑到 `Ctrl+K`,那样两者会同时响应,请把其中一个换开。
|
|
193
208
|
- DSH 当前没有公开的归档恢复接口;插件不会绕过官方边界修改底层注册表。
|
|
209
|
+
- dsh 自带的 `web` profile 把 session-query 索引配成 `openAt: never`,即默认不启用全文搜索。此时会话内搜索改为直接扫描日志(按出现顺序,最多 100 条),快捷面板的跨会话搜索会显示 dsh 给出的不可用原因。
|
|
194
210
|
|
|
195
211
|
## 开发
|
|
196
212
|
|
|
197
213
|
```sh
|
|
198
|
-
pnpm typecheck
|
|
199
|
-
pnpm test
|
|
200
|
-
pnpm build
|
|
214
|
+
pnpm typecheck # 类型检查
|
|
215
|
+
pnpm test # vitest 单元测试
|
|
216
|
+
pnpm build # 构建 node ESM 库与浏览器 bundle 到 lib/
|
|
217
|
+
pnpm check:readme # 双语 README 哈希一致性
|
|
218
|
+
pnpm smoke # 构建后契约自检:加载器握手、dsh 会读的清单字段、
|
|
219
|
+
# patch 行、本地 Mermaid 引擎
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
`scripts/live-dsh-check.sh` 是另一条**手动**探针,对着一个正在运行的隔离 dsh profile
|
|
223
|
+
(`DSH_HOME=… DSH_PORT=… bash scripts/live-dsh-check.sh`),在真实会话数据上跑宿主侧全链路:
|
|
224
|
+
时间线、三种导出、搜索扫描路径、用量扫描、备份、Mermaid 引擎路由、客户端→宿主的诊断回环、
|
|
225
|
+
一次会还原并校验提示词库的 UTF-8 往返,以及两处同源/loopback 围栏。默认拒绝在真实的
|
|
226
|
+
`~/.dsh` 上运行(需显式 `ALLOW_REAL_DSH_HOME=1`),逐项报 PASS/FAIL,被 `SKIP` 的项会计数并写进收尾行,任一失败即非零退出。
|
|
227
|
+
CI 没有可对话的宿主,所以每次 dsh 发版都建议跑一遍;槽位注册与渲染仍需按上文用浏览器过一遍。
|
|
228
|
+
|
|
229
|
+
自己验一个新 dsh 版本只要四条命令,且全程不碰你自己的 harness 家目录:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
mkdir -p /tmp/dshnext && cd /tmp/dshnext && npm init -y && npm i @deepseek-ai/dsh@<版本>
|
|
233
|
+
DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js plugin --profile web add <打包好的.tgz>
|
|
234
|
+
DSH_HOME=/tmp/dshnext-home node node_modules/@deepseek-ai/dsh/lib/bin.js --profile web --no-open --port 13999 &
|
|
235
|
+
DSH_HOME=/tmp/dshnext-home DSH_PORT=13999 COOKIE_JAR=/tmp/dshnext/jar.txt bash scripts/live-dsh-check.sh
|
|
201
236
|
```
|
|
202
237
|
|
|
238
|
+
若新版本落在声明的 peer 范围之外,第二条会被拒并回滚 profile;这时可以用
|
|
239
|
+
`dsh plugin --profile web allow-version <包名>@<版本> --dsh-version <版本> --accept-risk`
|
|
240
|
+
授予精确版本豁免——这样探针能告诉你**到底是什么坏了**,而不是只看到闸口拒绝。
|
|
241
|
+
|
|
203
242
|
## 许可证
|
|
204
243
|
|
|
205
244
|
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>
|