dsh-update-status 0.5.0 → 0.5.1
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 +11 -0
- package/README.md +18 -7
- package/README.zh.md +17 -6
- package/docs/RELEASING.md +16 -2
- package/lib/client.js +1 -0
- package/lib/client.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.5.1 — 2026-11-14
|
|
6
|
+
|
|
7
|
+
Checked against DeepSeek Harness `0.2.2-rc.3`, the newest DSH published (carried by npm's `next` tag; `latest` is `0.2.2-rc.1`). Engine and peer ranges are unchanged: `>=0.1.7-alpha.2 <0.3.0` already admits `0.2.2-rc.3`, so this release is not a permission slip — it fixes one macOS Desktop behaviour the `0.2.2` line changed. Release notes: [`docs/releases/v0.5.1.md`](docs/releases/v0.5.1.md).
|
|
8
|
+
|
|
9
|
+
- **The panel keeps working on macOS Desktop.** DSH `0.2.2-rc.2` narrowed macOS drag exclusion to controls inside a `data-window-drag` row or a `data-window-drag-controls` scope (upgrade guide `v0.2.2-rc.1/window-drag-regions`). The panel opens at `top: 12px`, so it covers the conversation header's drag row — the conversation header, the plugin manager and Settings → Account all mark themselves as drag rows. Without a declared region its buttons (Check for updates, Release notes, Restart, the cache input, ×) would start a window drag instead of activating. The `<section class="dus-panel">` now carries `data-window-drag-exclude`, the documented migration for an interactive viewport without nested drag rows; the full-viewport backdrop deliberately keeps no region so the rest of the frame still drags.
|
|
10
|
+
- **No change on plain Web or Windows.** Those had no automatic exclusion to lose, and the attribute is inert there; on a DSH older than `0.2.2-rc.2` it is equally harmless. No setting, profile value, service receipt or command changes.
|
|
11
|
+
- **Checklist for the whole surface, not one item.** All 49 upgrade-guide items from `v0.2.1-rc.4` through `v0.2.2-rc.1` were read against the plugin's surfaces. Only `window-drag-regions` applies: no `pluginManager`/`BundleInfo.updatable`, context-menu, `Menu` positioning, Session projection, Schedule, Office, LLM-error or filesystem-policy code exists in this bundle.
|
|
12
|
+
- **devDependencies now follow the running DSH.** `@deepseek-ai/dsh-settings` `0.1.7-alpha.2` → `0.2.2-rc.3`, `@deepseek-ai/cordis` `^4.0.4` → `^4.1.0`, `@deepseek-ai/schemastery` `^3.18.4` → `^3.19.0`. Both type checks and all 241 tests pass against the APIs the current Host actually ships, instead of against the `0.1.7` line; the declared peer ranges still admit older releases.
|
|
13
|
+
- **Checked on the running Host, not assumed.** Under DSH `0.2.2-rc.3`: `POST /api/dsh-update-status.get-status` answers `200` with `currentVersion: "0.2.2-rc.3"` and no warning, the restart-status and restart-check RPCs answer with `supervisor: "launchd"` and the live session list, `dsh-update-status/client.js` is published in `__DSH_BOOT__`, and a headless Chromium render of the real GUI shows the chip reading `0.2.2-rc.3` with the green dot and the panel carrying `data-window-drag-exclude=""` with zero console errors. All six injected packages still exist at `0.2.2-rc.3`.
|
|
14
|
+
- **Verification:** both type checks, 241 tests, the build, the shadowed-peer guard and `pnpm pack --dry-run`. No refreshed-page manual acceptance pass was run on macOS Desktop itself, where the window-region rule lives.
|
|
15
|
+
|
|
5
16
|
## 0.5.0 — 2026-10-28
|
|
6
17
|
|
|
7
18
|
Loadability is decided by DSH alone: `dsh.engines.dsh` and the `@deepseek-ai/dsh-settings` peer both declare `>=0.1.7-alpha.2 <0.3.0`, and this release changes neither. It publishes no per-release verification. Release notes: [`docs/releases/v0.5.0.md`](docs/releases/v0.5.0.md).
|
package/README.md
CHANGED
|
@@ -43,11 +43,12 @@ It shadows only the expanded sidebar brand name with `DeepSeek` plus a compact v
|
|
|
43
43
|
- **One card per upgradable version** — every published version strictly newer than the running one gets its own card, newest first, and each card carries that version's own copy-only command. When nothing is newer there are no cards at all and the panel says the running release is the newest.
|
|
44
44
|
- **The newest card is the one that stands out** — the highest version gets an amber border and a **Newest** pill; every other card stays neutral. There is no sort control: the order is the version order, and only the top card is emphasized.
|
|
45
45
|
- **One release line, zero configuration** — reads npm's dist-tags in one registry request and keeps every version that is newer than the running one, stable, release candidate or alpha alike. There is no channel to follow and no choice to make.
|
|
46
|
-
- **An honest prerelease comparison** — the running version and each candidate are ordered with SemVer, so `0.2.
|
|
46
|
+
- **An honest prerelease comparison** — the running version and each candidate are ordered with SemVer, so `0.2.2-rc.3` outranks `0.2.2-alpha.3`, and a release candidate still sorts below its own stable release.
|
|
47
47
|
- **Copy-only guidance, per version** — each card's command names that card's exact version, never a dist-tag that can move, and is never executed by the plugin.
|
|
48
48
|
- **No compatibility bookkeeping** — the panel no longer claims that a DeepSeek Harness release was tested with this build. What decides whether the plugin loads is DSH's own gate: the declared engine range and the `@deepseek-ai/dsh-settings` peer range.
|
|
49
49
|
- **Cache without polling** — one Host check on mount, a configurable 30–1,440 minute cache, single-flight registry access, and no frontend polling. Only the Check for updates button bypasses the cache.
|
|
50
50
|
- **Mobile-safe panel** — uses a modal browser top layer so the scrollable, safe-area-aware bottom sheet stays above the DSH drawer.
|
|
51
|
+
- **Clickable on macOS Desktop** — the panel opens at `top: 12px`, over the chrome row that drags the window. Since DSH `0.2.2-rc.2` macOS excludes only controls inside a `data-window-drag` row, so the panel declares its own window region (`data-window-drag-exclude`) and its buttons keep responding instead of starting a window drag.
|
|
51
52
|
- **Supervised safe restart** — after a one-time service setup, the panel can restart DSH for you: it warns about the work it would interrupt, and refuses outright when DSH was started by hand or by the desktop app.
|
|
52
53
|
|
|
53
54
|
## Install
|
|
@@ -55,7 +56,7 @@ It shadows only the expanded sidebar brand name with `DeepSeek` plus a compact v
|
|
|
55
56
|
Requirements:
|
|
56
57
|
|
|
57
58
|
- DeepSeek Harness with the Web profile
|
|
58
|
-
- DeepSeek Harness `>=0.1.7-alpha.2 <0.3.0` — the range this plugin declares in `dsh.engines.dsh`, with the same bounds on the `@deepseek-ai/dsh-settings` peer. DSH refuses a bundle outside that range at profile load. There is no per-release tested list to consult: inside the range, the plugin is not waiting for a release to be "approved".
|
|
59
|
+
- DeepSeek Harness `>=0.1.7-alpha.2 <0.3.0` — the range this plugin declares in `dsh.engines.dsh`, with the same bounds on the `@deepseek-ai/dsh-settings` peer. DSH refuses a bundle outside that range at profile load. The upper bound is the `0.3.0` line, so every published `0.2.x` release is inside the range — including the `0.2.2` prereleases, whose newest published build is `0.2.2-rc.3`. There is no per-release tested list to consult: inside the range, the plugin is not waiting for a release to be "approved".
|
|
59
60
|
- Node.js 20 or newer
|
|
60
61
|
|
|
61
62
|
With an installed `dsh` command:
|
|
@@ -94,7 +95,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
94
95
|
Example command on a card for a global install:
|
|
95
96
|
|
|
96
97
|
```sh
|
|
97
|
-
npm install -g @deepseek-ai/dsh@0.2.
|
|
98
|
+
npm install -g @deepseek-ai/dsh@0.2.2-rc.3
|
|
98
99
|
```
|
|
99
100
|
|
|
100
101
|
Each card shows one command that matches the detected installation kind and names that card's exact release. The plugin does not run it. When the installation kind cannot take a package-manager command — a source checkout, for example — the panel shows that guidance once instead of a copy button on every card, rather than inventing a command.
|
|
@@ -122,7 +123,7 @@ The plugin asks the npm registry for `@deepseek-ai/dsh` once per cache window, c
|
|
|
122
123
|
|
|
123
124
|
- Every tag npm returns counts, including one this plugin has never seen. A version can carry several tags; its card shows one, picked in the order `latest`, `next`, `alpha`, `beta`, `rc`, then others.
|
|
124
125
|
- SemVer decides the order, prereleases included, so an `alpha` ahead of the stable line is offered rather than hidden.
|
|
125
|
-
- The comparison is exact: `0.2.
|
|
126
|
+
- The comparison is exact: `0.2.2-rc.3` is newer than `0.2.2-alpha.3`, and both sort below `0.2.2`.
|
|
126
127
|
- The running version decides the list. Upgrading DSH and re-checking the panel shrinks it; installing an older one grows it.
|
|
127
128
|
- npm's web page shows only the `latest` tag on the package page; versions carried by other tags live on the Versions page. The panel does not copy that shortcut — it lists them.
|
|
128
129
|
- Nothing here installs anything, and nothing is applied on its own. Choosing to follow a channel — and the `channel` preference that stored it — was removed in `0.2.0`.
|
|
@@ -171,6 +172,14 @@ From `0.1.2` this plugin is fully usable there anyway:
|
|
|
171
172
|
|
|
172
173
|
A LAN bridge must preserve DSH's authenticated transport and Host authorization policy. This plugin does not change bridge configuration or grant settings access; a Host refusal must be resolved by the deployment operator.
|
|
173
174
|
|
|
175
|
+
## macOS Desktop window regions
|
|
176
|
+
|
|
177
|
+
DSH's macOS Desktop window is dragged by the chrome rows that mark themselves `data-window-drag` — the conversation header, the plugin manager and Settings → Account. Up to DSH `0.2.2-rc.1` the desktop shell excluded matching interactive controls anywhere in the page; from `0.2.2-rc.2` it excludes only controls inside a drag row or a `data-window-drag-controls` scope, and a custom overlay that covers a drag row must declare its own region.
|
|
178
|
+
|
|
179
|
+
The panel opens at `top: 12px`, `left: 292px`, so it does cover the conversation header's drag row. It therefore carries `data-window-drag-exclude` on its own scrolling box — the documented migration for "an interactive viewport without nested drag rows". The exclusion covers exactly the panel: Check for updates, Release notes, Restart, the cache input and × keep responding. The full-viewport backdrop declares no region on purpose: it only closes the panel, and excluding it would make the whole frame undraggable for as long as the panel is open.
|
|
180
|
+
|
|
181
|
+
Plain Web and Windows are unaffected: they never had that automatic exclusion, and the attribute is inert there. On a DSH older than `0.2.2-rc.2` the attribute is equally harmless. No setting, stored value or command changes.
|
|
182
|
+
|
|
174
183
|
## Loadability and update notices
|
|
175
184
|
|
|
176
185
|
This plugin does not vouch for any DeepSeek Harness release. Loading is DSH's decision, and DSH makes it from two declarations only: `dsh.engines.dsh` says `>=0.1.7-alpha.2 <0.3.0`, and the `@deepseek-ai/dsh-settings` peer range says the same. Inside those bounds you can run any DSH release you like; no plugin update is needed to "allow" a newer one.
|
|
@@ -179,13 +188,14 @@ This plugin does not vouch for any DeepSeek Harness release. Loading is DSH's de
|
|
|
179
188
|
|
|
180
189
|
What remains is the update notice: one card per version newer than the running one, each with its own command. What the plugin knows about a release is what npm publishes — version, tag and publish date — and it says nothing about whether the release is good for you.
|
|
181
190
|
|
|
182
|
-
The
|
|
191
|
+
The `0.4.x` rows in the table still mention that removed list; that is history, and no release now waits for a list entry.
|
|
183
192
|
|
|
184
193
|
### Plugin versions on npm
|
|
185
194
|
|
|
186
195
|
| Plugin | On npm | What that version is |
|
|
187
196
|
| --- | --- | --- |
|
|
188
|
-
| **`0.5.
|
|
197
|
+
| **`0.5.1`** | `latest` | macOS Desktop keeps responding: the panel now declares its own window region (`data-window-drag-exclude`) after DSH `0.2.2-rc.2` narrowed drag exclusion to marked rows; devDependencies move to DSH `0.2.2-rc.3` |
|
|
198
|
+
| **`0.5.0`** | published | One card per upgradable version, each with its own copy-only command; the verified-release mechanism is removed and DSH's engine and peer ranges alone decide loading |
|
|
189
199
|
| **`0.4.8`** | published | Added DSH `0.2.1-rc.4` to the then-current verified list, under the mechanism `0.5.0` removed; no functional code changed |
|
|
190
200
|
| **`0.4.7`** | published | Removes the redundant settings menu; version status and update notices remain on by default, with details in the sidebar chip panel |
|
|
191
201
|
| **`0.4.6`** | published | Added DSH `0.2.1-rc.3` to the then-current verified list; includes maintenance and starting terminals in restart confirmation, and restores restart-storm recovery guidance |
|
|
@@ -221,6 +231,7 @@ The rows below `0.5.0` in the table still mention that removed list; that is his
|
|
|
221
231
|
- Pin a plugin version when you need to stay on one:
|
|
222
232
|
|
|
223
233
|
```sh
|
|
234
|
+
dsh plugin --profile web add dsh-update-status@0.5.1
|
|
224
235
|
dsh plugin --profile web add dsh-update-status@0.5.0
|
|
225
236
|
dsh plugin --profile web add dsh-update-status@0.4.8
|
|
226
237
|
dsh plugin --profile web add dsh-update-status@0.4.7
|
|
@@ -246,7 +257,7 @@ The rows below `0.5.0` in the table still mention that removed list; that is his
|
|
|
246
257
|
- Two declarations decide whether the plugin loads at all, and DSH evaluates them at profile load:
|
|
247
258
|
- `dsh.engines.dsh` and `peerDependencies['@deepseek-ai/dsh-settings']` both declare `>=0.1.7-alpha.2 <0.3.0`. The lower bound names the alpha on purpose — under node-semver's default prerelease rule a range like `>=0.1.6-0 <0.2.0` does **not** admit `0.1.7-alpha.2`. The upper bound moved from `<0.2.0` to `<0.3.0` in `0.1.11` for the mirror-image reason: DSH refuses an incompatible bundle at profile load, and a plain `<0.2.0` excludes the `0.2.0` stable, so the day DSH `0.2.0` shipped the plugin would have been silently dropped. DSH evaluates the range with `includePrerelease: true`, so `0.2.0-rc.2` was already inside it. These bounds decide loading only — they are not a claim that every release inside them was tested.
|
|
248
259
|
- `@deepseek-ai/schemastery` is a **peer**, not a plain dependency: DSH 0.1.7 resolves only a linked plugin's peer dependencies from the running installation, so a `link:` install of this directory would otherwise fail to import the Host half.
|
|
249
|
-
- Per-release notes — what changed, who is affected, what to do — are hand-written in Chinese and English and become the GitHub Release body: [`v0.5.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.0.md) · [`v0.4.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.8.md) · [`v0.4.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.7.md) · [`v0.4.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.6.md) · [`v0.4.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.5.md) · [`v0.4.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.4.md) · [`v0.4.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.3.md) · [`v0.4.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.2.md) · [`v0.4.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.1.md) · [`v0.4.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.0.md) · [`v0.3.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.2.md) · [`v0.3.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.1.md) · [`v0.3.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.0.md) · [`v0.2.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.1.md) · [`v0.2.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.0.md) · [`v0.1.12`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.12.md) · [`v0.1.11`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.11.md) · [`v0.1.10`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.10.md) · [`v0.1.9`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.9.md) · [`v0.1.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.8.md) · [`v0.1.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.7.md) · [`v0.1.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.6.md) · [`v0.1.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.5.md) · [`v0.1.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.4.md) · [`v0.1.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.3.md) (covers the never-published `0.1.2`).
|
|
260
|
+
- Per-release notes — what changed, who is affected, what to do — are hand-written in Chinese and English and become the GitHub Release body: [`v0.5.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.1.md) · [`v0.5.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.0.md) · [`v0.4.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.8.md) · [`v0.4.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.7.md) · [`v0.4.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.6.md) · [`v0.4.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.5.md) · [`v0.4.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.4.md) · [`v0.4.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.3.md) · [`v0.4.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.2.md) · [`v0.4.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.1.md) · [`v0.4.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.0.md) · [`v0.3.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.2.md) · [`v0.3.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.1.md) · [`v0.3.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.0.md) · [`v0.2.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.1.md) · [`v0.2.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.0.md) · [`v0.1.12`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.12.md) · [`v0.1.11`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.11.md) · [`v0.1.10`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.10.md) · [`v0.1.9`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.9.md) · [`v0.1.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.8.md) · [`v0.1.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.7.md) · [`v0.1.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.6.md) · [`v0.1.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.5.md) · [`v0.1.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.4.md) · [`v0.1.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.3.md) (covers the never-published `0.1.2`).
|
|
250
261
|
|
|
251
262
|
## Configuration
|
|
252
263
|
|
package/README.zh.md
CHANGED
|
@@ -43,11 +43,12 @@
|
|
|
43
43
|
- **一个可升级版本一张卡片**:凡是严格新于当前运行版本的已发布版本,各占一张卡片,最新的排在最上面;每张卡片带的是**该版本自己的**只复制命令。没有任何更新版本时不显示卡片,面板直接说明当前版本最新。
|
|
44
44
|
- **只有最新那张卡片被强调**:最高版本用琥珀色描边加**最新**标签突出,其余卡片保持中性。没有手动排序控件:顺序就是版本顺序,只有最上面那张被强调。
|
|
45
45
|
- **只有一条发布线、零配置**:一次 registry 请求读取 npm 的全部 dist-tags,保留所有比当前运行版本更新的版本——稳定版、RC、Alpha 一视同仁。没有需要关注的通道,也没有需要做的选择。
|
|
46
|
-
- **诚实的预发布比较**:运行版本与每个候选版本按 SemVer 排序,因此 `0.2.
|
|
46
|
+
- **诚实的预发布比较**:运行版本与每个候选版本按 SemVer 排序,因此 `0.2.2-rc.3` 高于 `0.2.2-alpha.3`,而 RC 仍然低于它自己的正式版 `0.2.2`。
|
|
47
47
|
- **按版本给命令,只复制不执行**:每张卡片上的命令都钉在该卡片的确切版本上,不用会移动的 dist-tag,插件也从不执行它。
|
|
48
48
|
- **不再维护兼容台账**:面板不再声称某个 DeepSeek Harness 版本“与本构建一起测过”。能不能加载由 DSH 自己按声明的引擎范围与 `@deepseek-ai/dsh-settings` peer 范围判定。
|
|
49
49
|
- **缓存但不轮询**:Host 挂载时检查一次,缓存可设为 30–1,440 分钟并合并并发请求;前端没有轮询,只有“检查更新”按钮绕过缓存。
|
|
50
50
|
- **移动端可靠**:详情使用浏览器 modal top layer;底部 sheet 可滚动、适配 safe area,并保持在 DSH 抽屉上方。
|
|
51
|
+
- **macOS 桌面版上按钮照常可用**:面板开在 `top: 12px`,正好压在负责拖动窗口的 chrome 行上。DSH `0.2.2-rc.2` 起,macOS 只排除 `data-window-drag` 行内的控件,所以面板自己声明窗口区域(`data-window-drag-exclude`),按钮点下去不会变成拖窗口。
|
|
51
52
|
- **受监督的安全重启**:一次性装好后台服务后,面板就能替你重启 DSH——它会先提醒会中断哪些工作,而终端直启或桌面应用托管的 DSH 会被直接拒绝。
|
|
52
53
|
|
|
53
54
|
## 安装
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
要求:
|
|
56
57
|
|
|
57
58
|
- 带 Web profile 的 DeepSeek Harness
|
|
58
|
-
- DeepSeek Harness `>=0.1.7-alpha.2 <0.3.0`——这是插件在 `dsh.engines.dsh` 中声明的范围,`@deepseek-ai/dsh-settings` peer 范围与之相同。超出范围的 bundle 会在 profile 加载时被 DSH
|
|
59
|
+
- DeepSeek Harness `>=0.1.7-alpha.2 <0.3.0`——这是插件在 `dsh.engines.dsh` 中声明的范围,`@deepseek-ai/dsh-settings` peer 范围与之相同。超出范围的 bundle 会在 profile 加载时被 DSH 拒绝。上界是 `0.3.0` 这条线,所以所有已发布的 `0.2.x` 版本都在范围内——包括 `0.2.2` 的预发布版本,其中最新已发布的是 `0.2.2-rc.3`。没有“已验证发布清单”需要你对照:在范围内,插件不需要等某个版本被“批准”。
|
|
59
60
|
- Node.js 20 或更新版本
|
|
60
61
|
|
|
61
62
|
已经安装 `dsh` 命令:
|
|
@@ -94,7 +95,7 @@ dsh plugin --profile web add "link:$(pwd)"
|
|
|
94
95
|
全局安装时,卡片上的命令可能长这样:
|
|
95
96
|
|
|
96
97
|
```sh
|
|
97
|
-
npm install -g @deepseek-ai/dsh@0.2.
|
|
98
|
+
npm install -g @deepseek-ai/dsh@0.2.2-rc.3
|
|
98
99
|
```
|
|
99
100
|
|
|
100
101
|
每张卡片只显示一条与检测到的安装方式匹配、并写明该卡片确切版本号的命令,插件不会运行它。当这种安装方式给不出包管理器命令时(例如源码检出),面板只在整块面板上给一次说明,而不是给每张卡片配一个复制按钮去编造命令。
|
|
@@ -122,7 +123,7 @@ npm install -g @deepseek-ai/dsh@0.2.1-rc.4
|
|
|
122
123
|
|
|
123
124
|
- npm 返回的每个 tag 都算,包括插件没听说过的 tag。同一个版本可能带多个 tag,卡片上只显示一个,按 `latest`、`next`、`alpha`、`beta`、`rc`、其他的顺序取。
|
|
124
125
|
- 按 SemVer 从高到低排列(含预发布):因此跑到稳定版前面的 `alpha` 会被列出,而不是被藏起来。
|
|
125
|
-
- 比较是精确的:`0.2.
|
|
126
|
+
- 比较是精确的:`0.2.2-rc.3` 比 `0.2.2-alpha.3` 新,两者都低于 `0.2.2`。
|
|
126
127
|
- 列表以当前运行版本为准:升级 DSH 后重新检查,卡片会变少;装回旧版本则会变多。
|
|
127
128
|
- npm 网页只在包首页显示 `latest` 那个 tag,其他 tag 上的版本要到 Versions 页面才看得到。面板不照搬这个简化,它们都会被列出。
|
|
128
129
|
- 这里不会安装任何东西,也不会自动应用任何更新。跟随某条通道——以及保存它的 `channel` 偏好——已在 `0.2.0` 移除。
|
|
@@ -171,6 +172,14 @@ dsh plugin --profile web exec dsh-update-status-service activate
|
|
|
171
172
|
|
|
172
173
|
局域网转发必须保留 DSH 的已认证传输和 Host 授权策略。本插件不会修改转发配置或授予设置访问权;Host 拒绝访问时,应由部署维护者处理。
|
|
173
174
|
|
|
175
|
+
## macOS 桌面版的窗口区域
|
|
176
|
+
|
|
177
|
+
DSH macOS 桌面版靠自报 `data-window-drag` 的 chrome 行拖动窗口——会话头部、插件管理页、设置 → 账号。到 DSH `0.2.2-rc.1` 为止,桌面壳会排除页面上任何匹配的交互控件;从 `0.2.2-rc.2` 起,只排除 `data-window-drag` 行或 `data-window-drag-controls` 范围内的控件,压在拖动行上的自定义浮层必须自己声明区域。
|
|
178
|
+
|
|
179
|
+
面板开在 `top: 12px`、`left: 292px`,确实压在会话头部的拖动行上,因此它在自己可滚动的盒子上带 `data-window-drag-exclude`——这正是官方对“没有嵌套拖动行的交互视口”给出的迁移方式。排除范围刚好等于面板:检查更新、发布说明、重启、缓存输入框和 × 都照常响应。全屏背景层刻意不声明区域:它只负责关闭面板,若把整屏排除,面板打开期间整个窗口就再也拖不动了。
|
|
180
|
+
|
|
181
|
+
纯 Web 与 Windows 不受影响:它们从来没有那套自动排除,这个属性在那边是惰性的;在 `0.2.2-rc.2` 之前的 DSH 上同样无害。没有任何设置项、保存值或命令发生变化。
|
|
182
|
+
|
|
174
183
|
## 可加载性与更新提示
|
|
175
184
|
|
|
176
185
|
本插件不为任何 DeepSeek Harness 版本背书。能不能加载由 DSH 决定,而 DSH 只看两处声明:`dsh.engines.dsh` 是 `>=0.1.7-alpha.2 <0.3.0`,`@deepseek-ai/dsh-settings` 的 peer 范围与之相同。在这个范围内,你想跑哪个 DSH 版本都行,不需要插件再发一版来“批准”它。
|
|
@@ -185,7 +194,8 @@ dsh plugin --profile web exec dsh-update-status-service activate
|
|
|
185
194
|
|
|
186
195
|
| 插件版本 | npm 发布状态 | 该版本是什么 |
|
|
187
196
|
| --- | --- | --- |
|
|
188
|
-
| **`0.5.
|
|
197
|
+
| **`0.5.1`** | `latest` | macOS 桌面版按钮照常可用:DSH `0.2.2-rc.2` 起拖动排除只认标记行,面板改为自己声明窗口区域(`data-window-drag-exclude`);devDependencies 跟进到 DSH `0.2.2-rc.3` |
|
|
198
|
+
| **`0.5.0`** | 已发布 | 一个可升级版本一张卡片、各带自己的只复制命令;已验证发布机制被删除,能否加载只由 DSH 的引擎范围与 peer 范围决定 |
|
|
189
199
|
| **`0.4.8`** | 已发布 | 在当时那份已验证清单中为 DSH `0.2.1-rc.4` 追加条目——那套机制已在本次发布删除;功能代码不变 |
|
|
190
200
|
| **`0.4.7`** | 已发布 | 移除重复的设置菜单;安装后默认显示版本与更新提示,详情统一由侧栏版本芯片打开 |
|
|
191
201
|
| **`0.4.6`** | 已发布 | 在当时那份已验证清单中为 DSH `0.2.1-rc.3` 追加条目;后台维护和启动中的终端也需重启确认,并恢复重启风暴的原因与恢复指引 |
|
|
@@ -221,6 +231,7 @@ dsh plugin --profile web exec dsh-update-status-service activate
|
|
|
221
231
|
- 需要固定插件版本时显式指定:
|
|
222
232
|
|
|
223
233
|
```sh
|
|
234
|
+
dsh plugin --profile web add dsh-update-status@0.5.1
|
|
224
235
|
dsh plugin --profile web add dsh-update-status@0.5.0
|
|
225
236
|
dsh plugin --profile web add dsh-update-status@0.4.8
|
|
226
237
|
dsh plugin --profile web add dsh-update-status@0.4.7
|
|
@@ -246,7 +257,7 @@ dsh plugin --profile web exec dsh-update-status-service activate
|
|
|
246
257
|
- 有两处声明决定插件能不能加载,DSH 在 profile 加载时会检查:
|
|
247
258
|
- `dsh.engines.dsh` 与 `peerDependencies['@deepseek-ai/dsh-settings']` 都声明 `>=0.1.7-alpha.2 <0.3.0`。下界特意写成这个 alpha:按 node-semver 默认的预发布规则,`>=0.1.6-0 <0.2.0` 这样的范围**并不接纳** `0.1.7-alpha.2`。上界在 `0.1.11` 从 `<0.2.0` 放宽到 `<0.3.0` 是同一件事的镜像:DSH 会在 profile 加载时拒绝不兼容的 bundle,而裸的 `<0.2.0` 恰好排除 `0.2.0` 正式版——DSH `0.2.0` 发布当天插件就会被静默丢弃。DSH 判定时使用 `includePrerelease: true`,所以 `0.2.0-rc.2` 本来就在这个范围内。这两个边界只决定能否加载,并不表示范围内的每个版本都被测过。
|
|
248
259
|
- `@deepseek-ai/schemastery` 是 **peer**,不是普通依赖:DSH 0.1.7 只从运行安装解析 link 插件的 peer 依赖,否则 `link:` 安装会连 Host 半边都 import 失败。
|
|
249
|
-
- 每个版本的中英文详细说明(改了什么、影响谁、需要做什么)手写后直接作为 GitHub Release 正文:[`v0.5.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.0.md) · [`v0.4.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.8.md) · [`v0.4.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.7.md) · [`v0.4.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.6.md) · [`v0.4.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.5.md) · [`v0.4.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.4.md) · [`v0.4.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.3.md) · [`v0.4.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.2.md) · [`v0.4.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.1.md) · [`v0.4.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.0.md) · [`v0.3.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.2.md) · [`v0.3.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.1.md) · [`v0.3.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.0.md) · [`v0.2.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.1.md) · [`v0.2.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.0.md) · [`v0.1.12`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.12.md) · [`v0.1.11`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.11.md) · [`v0.1.10`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.10.md) · [`v0.1.9`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.9.md) · [`v0.1.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.8.md) · [`v0.1.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.7.md) · [`v0.1.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.6.md) · [`v0.1.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.5.md) · [`v0.1.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.4.md) · [`v0.1.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.3.md)(含从未发布的 `0.1.2`)。
|
|
260
|
+
- 每个版本的中英文详细说明(改了什么、影响谁、需要做什么)手写后直接作为 GitHub Release 正文:[`v0.5.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.1.md) · [`v0.5.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.5.0.md) · [`v0.4.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.8.md) · [`v0.4.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.7.md) · [`v0.4.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.6.md) · [`v0.4.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.5.md) · [`v0.4.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.4.md) · [`v0.4.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.3.md) · [`v0.4.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.2.md) · [`v0.4.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.1.md) · [`v0.4.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.4.0.md) · [`v0.3.2`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.2.md) · [`v0.3.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.1.md) · [`v0.3.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.3.0.md) · [`v0.2.1`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.1.md) · [`v0.2.0`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.2.0.md) · [`v0.1.12`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.12.md) · [`v0.1.11`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.11.md) · [`v0.1.10`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.10.md) · [`v0.1.9`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.9.md) · [`v0.1.8`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.8.md) · [`v0.1.7`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.7.md) · [`v0.1.6`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.6.md) · [`v0.1.5`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.5.md) · [`v0.1.4`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.4.md) · [`v0.1.3`](https://github.com/idoall/dsh-update-status/blob/main/docs/releases/v0.1.3.md)(含从未发布的 `0.1.2`)。
|
|
250
261
|
|
|
251
262
|
## 配置
|
|
252
263
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -69,8 +69,22 @@ Never release an uncommitted worktree or reuse a published npm version.
|
|
|
69
69
|
|
|
70
70
|
1. Write `docs/releases/vX.Y.Z.md` (bilingual, hand-written — see above) **and** the matching `CHANGELOG.md` entry in the same commit.
|
|
71
71
|
2. Update the version matrix in `README.md` and `README.zh.md`: the npm status of every version and what each version changed. Do not reintroduce a verified-release list, a verified/unverified label, or a count of tested DSH releases — that mechanism was removed in `0.5.0`.
|
|
72
|
-
3. Bump the version in `package.json`. There is no compatibility list to sync: `dsh.engines.dsh` and the peer ranges change only when the plugin genuinely needs a different DSH range, and they are not updated per DSH release.
|
|
73
|
-
|
|
72
|
+
3. Bump the version in `package.json`. There is no compatibility list to sync: `dsh.engines.dsh` and the peer ranges change only when the plugin genuinely needs a different DSH range, and they are not updated per DSH release. Do still confirm that the declared range admits the newest published DSH build, and that this plugin does not need a code change for it — a range that merely contains the release is not the same as a plugin that still works:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
# The newest build any dist-tag carries, not just `latest`.
|
|
76
|
+
npm view @deepseek-ai/dsh dist-tags --json
|
|
77
|
+
npm view @deepseek-ai/dsh versions --json | tail -5
|
|
78
|
+
|
|
79
|
+
# Every upgrade-guide directory between the release this plugin was last
|
|
80
|
+
# checked against and that newest build; read the items that touch a surface
|
|
81
|
+
# the plugin actually uses (Client slots and overlays, settings forms, the
|
|
82
|
+
# Connection `/api` route, the Host exports).
|
|
83
|
+
ls "$(npm root -g)/@deepseek-ai/dsh/docs/upgrade-guide"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
4. Keep the devDependencies on the DSH API line that is actually installed, so both type checks and the test suite exercise the current surfaces rather than an older one: `@deepseek-ai/dsh-settings`, `@deepseek-ai/cordis` and `@deepseek-ai/schemastery` should match the running installation's versions (within the declared peer ranges), and `pnpm-workspace.yaml`'s `minimumReleaseAgeExclude` should name the versions being installed.
|
|
87
|
+
5. Verify:
|
|
74
88
|
|
|
75
89
|
```sh
|
|
76
90
|
git switch main
|
package/lib/client.js
CHANGED
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["PLUGIN_ID","PLUGIN_ID","sameSnapshot"],"sources":["../src/shared/visual-state.ts","../src/shared/types.ts","../src/client/i18n.ts","../src/client/react.ts","../src/client/components.tsx","../src/client/contract.ts","../src/client/stores.ts","../src/client/settings/hostDirectScope.ts","../src/client/settings/configFormScope.ts","../src/client/settings/settingsChannel.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The single place that decides which visual state the sidebar chip is in.\n *\n * It lives in `shared` rather than inside the component so the decision is a pure\n * function that a test can drive directly: the regression this guards against is\n * exactly a state-classification mistake, and it was invisible to every test while\n * it sat inside TSX.\n */\nimport type { UpdateStatus } from './types.ts'\n\nexport type VisualState = 'loading' | 'update' | 'current' | 'problem'\n\n/**\n * Only a read the plugin could not complete is a chip-level problem.\n *\n * An advisory notice — a preview channel this bundle has not been verified against,\n * say — leaves the chip surface alone and belongs in the panel. Repainting the brand\n * row for a plugin-side bookkeeping fact is the surprise the breathing dot replaced:\n * an operator who upgrades DSH ahead of this bundle must not watch the chip turn red.\n *\n * A Host older than `warningKind` sends no field at all; `undefined` then keeps the\n * previous behaviour (any warning is a problem) rather than silently dropping a real\n * failure on the floor.\n */\nexport function isChipProblem(status: UpdateStatus | null): boolean {\n if (status === null) return false\n if (status.warningKind === undefined) return status.warning !== null\n return status.warningKind === 'failure'\n}\n\nexport function visualState(status: UpdateStatus | null, loading: boolean, error: string | null): VisualState {\n if (loading) return 'loading'\n if (error !== null || isChipProblem(status)) return status?.hasUpdate === true ? 'update' : 'problem'\n return status?.hasUpdate === true ? 'update' : 'current'\n}\n","/**\n * JSON-only contract shared by the Host and Web halves.\n *\n * The static package uses the authenticated Connection RPC channel because\n * `harness.handle` / `host.call` are dynamic-Cordis-only closure APIs. The\n * endpoint vocabulary remains deliberately small and private to this plugin\n * channel.\n *\n * There is ONE release line, not a channel catalogue: the Host reports the\n * newest version the npm registry publishes under any dist-tag, and the client\n * compares it with the running version. `latest`, `next` and `alpha` are npm's\n * bookkeeping, not a user choice this plugin asks anyone to make.\n */\n\nexport const PLUGIN_ID = 'dsh-update-status'\nexport const PACKAGE_NAME = '@deepseek-ai/dsh'\n/** Shared Connection RPC channel. Custom prefixes 405 on the SPA fallback. */\nexport const UPDATE_STATUS_CHANNEL = '/api'\nexport const RELEASES_URL = 'https://github.com/deepseek-ai/deepseek-harness/releases'\nexport const DEFAULT_CACHE_TTL_MINUTES = 360\nexport const MIN_CACHE_TTL_MINUTES = 30\nexport const MAX_CACHE_TTL_MINUTES = 1_440\n\nexport function isCacheTtlMinutes(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value)\n && value >= MIN_CACHE_TTL_MINUTES && value <= MAX_CACHE_TTL_MINUTES\n}\n\nexport const UPDATE_ENDPOINTS = {\n getStatus: 'dsh-update-status.get-status',\n checkUpdate: 'dsh-update-status.check-update',\n} as const\n\n/** Restart RPC remains on the same authenticated Connection `/api` channel. */\nexport const RESTART_ENDPOINTS = {\n status: 'dsh-update-status.restart-status',\n check: 'dsh-update-status.restart-check',\n request: 'dsh-update-status.restart',\n} as const\n\nexport type UpdateEndpoint = (typeof UPDATE_ENDPOINTS)[keyof typeof UPDATE_ENDPOINTS]\nexport type RestartEndpoint = (typeof RESTART_ENDPOINTS)[keyof typeof RESTART_ENDPOINTS]\n/**\n * Severity of `warning`, so a surface can tell \"the plugin could not determine\n * the update state\" from \"here is something worth knowing\".\n *\n * - `failure`: no usable answer — a failed registry read, or a version SemVer\n * cannot compare. This is what justifies repainting the sidebar chip.\n * - `notice`: the answer is complete and usable; the text is advisory, e.g. the\n * Host resolved a stale copy of a shared library. The chip must NOT repaint for\n * this — an operator upgrading DSH ahead of the plugin would otherwise see the\n * chip turn red for a plugin-side bookkeeping fact.\n *\n * Optional on purpose: a Host older than this field leaves it `undefined`, and\n * the client then falls back to treating any warning as a failure.\n */\nexport type UpdateWarningKind = 'failure' | 'notice'\nexport type InstallKind = 'npm-global' | 'pnpm-global' | 'source-checkout' | 'unknown'\n\n/** Language-neutral warning facts; the browser renders them in its own locale. */\nexport type UpdateWarning =\n | { code: 'registry-unavailable'; detail: string }\n | { code: 'version-incomparable'; currentVersion: string; latestVersion: string }\n /**\n * The Host resolved a `@deepseek-ai/schemastery` that DSH does not ship, so the\n * Loader's volatile projection is unavailable and the preference fields cannot\n * be marked volatile. Advisory: the version answer itself is complete, and the\n * text carries the exact directory to remove. See `host/schemastery.ts`.\n */\n | { code: 'stale-schemastery'; version: string | null; path: string; nodeModulesDir: string | null }\n\n/**\n * One published version that is newer than the running one.\n *\n * The plugin's only job is to say \"a newer version exists, here is how to get\n * it\", so a candidate carries the version, the npm dist-tag that publishes it,\n * when it was published, its release line, and a copy-only command when the\n * detected installation kind actually accepts one.\n */\nexport interface ReleaseCandidate {\n version: string\n /** The npm dist-tag carrying this version; null when the Host could not tell. */\n tag: string | null\n publishedAt: string | null\n /** Numeric release line, e.g. `0.2.1` for `0.2.1-rc.4`. */\n line: string\n /** Copy-only upgrade command, or null when this installation cannot be upgraded that way. */\n command: string | null\n}\n\n/** Arguments accepted by either read/check endpoint. */\nexport interface CheckUpdateRequest {\n force?: boolean\n /** User preference, bounded by the Host before it affects cache expiry. */\n cacheTtlMinutes?: number\n}\n\n/**\n * A lossless, JSON-serializable snapshot used by both browser surfaces.\n * Nulls are intentional: a failed first check must still render a truthful\n * current-version card instead of an empty or malformed UI.\n */\nexport interface UpdateStatus {\n currentVersion: string\n /**\n * Every published version strictly newer than `currentVersion`, highest first.\n * Empty means \"you are on the newest published version\" — never a placeholder.\n */\n releases: ReleaseCandidate[]\n hasUpdate: boolean\n cached: boolean\n checkedAt: string | null\n /** English fallback for older clients; current clients localize `warnings`. */\n warning: string | null\n /** Severity of `warning`; absent from a Host older than the field. */\n warningKind?: UpdateWarningKind | null\n /** Structured warning facts; absent from a Host older than this field. */\n warnings?: UpdateWarning[]\n installKind: InstallKind\n releaseUrl: string\n changelogUrl: string\n packageName: string\n /** Phase 1 is informational only; the GUI must never apply an update. */\n canApplyInPlace: false\n}\n","/** Tiny bilingual dictionary kept local to avoid changing the host locale tree. */\n\nimport type { UpdateStatus, UpdateWarning } from '../shared/types.ts'\n\nexport type Language = 'zh' | 'en'\n\ntype Entry = { zh: string; en: string }\n\nconst DICTIONARY: Record<string, Entry> = {\n 'brand.status': { zh: 'DSH 版本状态', en: 'DSH version status' },\n 'brand.checking': { zh: '正在检查版本', en: 'Checking version' },\n 'brand.update': { zh: '有可用更新', en: 'Update available' },\n 'brand.current': { zh: '已是最新或尚未发现更新', en: 'Up to date or no update found' },\n 'brand.problem': { zh: '检查遇到问题', en: 'Check encountered a problem' },\n 'panel.title': { zh: 'DSH 更新状态', en: 'DSH update status' },\n 'panel.close': { zh: '关闭', en: 'Close' },\n 'panel.cacheDuration': { zh: '缓存时长', en: 'Cache duration' },\n 'panel.minutes': { zh: '分钟', en: 'minutes' },\n 'panel.cacheHint': { zh: '到期后在下次打开或读取状态时检查;不会后台轮询。点击“检查更新”会立即检查。', en: 'After expiry, DSH checks only on the next status read; there is no background polling. “Check for updates” checks immediately.' },\n 'panel.cacheReadonly': { zh: '此连接的缓存设置为只读。', en: 'This connection’s cache setting is read-only.' },\n 'panel.current': { zh: '当前运行版本', en: 'Current running version' },\n 'panel.updatesFound': { zh: '发现 {count} 个可升级版本', en: '{count} newer version(s) available' },\n 'panel.latest': { zh: '最新', en: 'Newest' },\n 'panel.notChecked': { zh: '尚未取得', en: 'Not available yet' },\n 'panel.currentState': { zh: '已是最新', en: 'Up to date' },\n 'panel.cached': { zh: '来自 Host 缓存', en: 'From Host cache' },\n 'panel.live': { zh: '刚从 npm registry 检查', en: 'Checked npm registry now' },\n 'panel.checkedAt': { zh: '上次检查', en: 'Last checked' },\n 'panel.publishedAt': { zh: '发布时间', en: 'Published' },\n 'panel.check': { zh: '检查更新', en: 'Check for updates' },\n 'panel.checking': { zh: '检查中…', en: 'Checking…' },\n 'panel.releaseNotes': { zh: '发布说明', en: 'Release notes' },\n 'panel.command': { zh: '升级命令', en: 'Upgrade command' },\n 'panel.copy': { zh: '复制命令', en: 'Copy command' },\n 'panel.copied': { zh: '已复制', en: 'Copied' },\n 'panel.copyFallback': { zh: '浏览器未允许复制;已选中文本,请长按或复制。', en: 'Clipboard unavailable; the command is selected for long-press or copy.' },\n 'panel.commandNote': { zh: '仅复制,不会执行。请在运行 DSH 的那台电脑的终端执行;完成后仅在已安装用户级监督服务时使用本面板的重启,否则由你自行重启 DSH。', en: 'Copy only — nothing runs here. Execute it in a terminal on the computer running DSH, then use this panel’s restart only when user-level supervision is installed; otherwise restart DSH yourself.' },\n 'panel.readOnly': { zh: '插件不会安装、升级、回滚或替换 DSH 文件;只有当前 DSH 已由用户显式安装的后台服务监督时,才允许安全重启。', en: 'The plugin never installs, upgrades, rolls back, or replaces DSH files. Safe restart is available only when the current DSH is supervised by a user-installed service.' },\n 'restart.title': { zh: '安全重启 DSH Web', en: 'Safely restart DSH Web' },\n 'restart.button': { zh: '重启', en: 'Restart' },\n 'restart.loading': { zh: '读取重启状态…', en: 'Reading restart status…' },\n 'restart.checking': { zh: '检查活动任务…', en: 'Checking active work…' },\n 'restart.confirm': { zh: '确认重启', en: 'Confirm restart' },\n 'restart.force': { zh: '强制重启', en: 'Force restart' },\n 'restart.cancel': { zh: '取消', en: 'Cancel' },\n 'restart.retry': { zh: '重新检查', en: 'Check again' },\n 'restart.confirmHint': { zh: '再次点击“确认重启”后,页面会短暂断开;后台服务恢复新实例后将自动刷新。', en: 'Click Confirm restart again. The page disconnects briefly and refreshes once the supervised service starts a new instance.' },\n 'restart.activeWarning': { zh: '检测到 {count} 个正在运行的任务。强制重启会中断它们。', en: '{count} active work item(s) are running. A forced restart interrupts them.' },\n 'restart.waitingShort': { zh: '重启中…', en: 'Restarting…' },\n 'restart.waiting': { zh: '正在等待后台服务恢复 DSH(已等待 {seconds} 秒)…', en: 'Waiting for the user service to restore DSH ({seconds}s elapsed)…' },\n 'restart.timeout': { zh: '60 秒内未检测到新 DSH 实例。请检查用户服务状态和日志;重新加载本页不会再次触发重启。', en: 'No new DSH instance was detected within 60 seconds. Check the user-service status and logs; reloading this page will not trigger another restart.' },\n 'restart.unavailable': { zh: '当前 DSH 不是由已确认的用户级后台服务启动。为避免页面重启后无法恢复,按钮已禁用;请先按服务管理文档安装并接管 DSH。', en: 'This DSH is not running under a verified user-level service. Restart is disabled so the page cannot strand itself; install and activate supervision first.' },\n 'restart.unavailableDesktop': { zh: 'DSH Desktop 管理当前 Host;请退出并重新打开桌面应用。', en: 'DSH Desktop manages this Host. Quit and reopen the desktop app instead.' },\n 'restart.unavailableMismatch': { zh: '检测到监督标记,但当前进程不是该平台服务真正启动并持有的那个(例如被另一个重启工具拉起)。重启后无法保证恢复,按钮已禁用。', en: 'A supervision marker exists, but this process is not the one that platform service actually started and owns (another restart tool launched it, for example). Restart is disabled so the page cannot strand itself.' },\n 'restart.recoverIntro': { zh: '第一行只列出占用端口的进程,不会杀它;请先自行停止它,再执行第二行让监督服务重新接管。', en: 'The first line only lists whoever holds the port — it kills nothing. Stop that process yourself, then run the second line to hand supervision back.' },\n 'restart.recoverLabel': { zh: '恢复命令', en: 'Recovery commands' },\n 'restart.recoverNote': { zh: '仅复制,不会执行,也不会杀任何进程。', en: 'Copy only — nothing runs here, and no process is killed.' },\n 'restart.recoverInstall': { zh: '尚未安装用户级监督服务;请按 README 的「受监督的重启」一节安装并接管 DSH,之后这个按钮才会启用。', en: 'No user-level supervisor is installed. Follow the “Supervised restart” section of the README to install and activate one; this button stays disabled until then.' },\n 'restart.unavailableThrashing': { zh: '监督服务正在反复启动失败(检测到重启风暴)。请先停止占用该端口的另一个 DSH 实例,并查看服务日志;在那之前重启可能无法恢复。', en: 'The supervisor is repeatedly failing to start (a restart storm was detected). Stop the other DSH instance holding this port and check the service logs; until then a restart may not recover.' },\n 'restart.unavailableActivity': { zh: '无法完整读取正在运行的任务。为避免中断未能列出的工作,重启已禁用。', en: 'Active work could not be inspected completely. Restart is disabled to avoid interrupting work that could not be listed.' },\n 'restart.unavailableTimer': { zh: '当前 Host 没有可用的安全退出调度器。为确保响应先送达浏览器,重启已禁用。', en: 'This Host has no safe exit scheduler. Restart is disabled so its response can reach the browser first.' },\n 'restart.unavailableStale': { zh: '此页面连接的是过期 DSH 实例。请等待恢复或重新加载后再重试。', en: 'This page is connected to a stale DSH instance. Wait for recovery or reload before trying again.' },\n 'panel.error': { zh: '检查提示', en: 'Check notice' },\n 'warning.registryUnavailable': { zh: '无法检查 npm registry:{detail}', en: 'Unable to check the npm registry: {detail}' },\n 'warning.versionIncomparable': { zh: '无法按 SemVer 比较当前版本 {currentVersion} 与线上版本 {latestVersion}。', en: 'Unable to compare the current version {currentVersion} with the published version {latestVersion} using SemVer.' },\n 'warning.staleSchemastery': { zh: '本插件解析到的 @deepseek-ai/schemastery(版本 {version})来自 {path},不是 DSH 自带的那份,偏好字段无法标记为 volatile。请删除该残留目录并重启 DSH:rm -rf {nodeModulesDir}', en: 'This plugin resolved @deepseek-ai/schemastery {version} from {path} instead of the copy DSH provides, so preference fields cannot be marked volatile. Remove the stale directory and restart DSH: rm -rf {nodeModulesDir}' },\n 'warning.staleSchemasteryNoPath': { zh: '本插件解析到的 @deepseek-ai/schemastery(版本 {version})来自 {path},不是 DSH 自带的那份,偏好字段无法标记为 volatile。请删除该处残留的 @deepseek-ai/schemastery 目录并重启 DSH。', en: 'This plugin resolved @deepseek-ai/schemastery {version} from {path} instead of the copy DSH provides, so preference fields cannot be marked volatile. Remove the stale @deepseek-ai/schemastery directory there and restart DSH.' },\n 'guidance.sourceCheckout': { zh: '请更新 DSH 源码 checkout、安装依赖并重新构建;本插件无法从 GUI 原地替换。', en: 'Update the DSH source checkout, install its dependencies, and rebuild it; this plugin cannot replace it in place from the GUI.' },\n 'guidance.unknownInstall': { zh: '升级前请先确认 DSH 的安装方式;本插件无法代为执行升级。', en: 'Confirm how DSH was installed before upgrading; this plugin cannot perform the upgrade for you.' },\n}\n\nexport function languageOf(): Language {\n try {\n return navigator.language.toLowerCase().startsWith('zh') ? 'zh' : 'en'\n } catch {\n return 'en'\n }\n}\n\nexport function t(key: keyof typeof DICTIONARY, params: Record<string, string> = {}, language: Language = languageOf()): string {\n const entry = DICTIONARY[key]\n if (entry === undefined) return key\n const template = entry[language] ?? entry.en\n return template.replace(/\\{([A-Za-z]+)\\}/g, (match, name: string) => params[name] ?? match)\n}\n\nexport function warningText(warning: UpdateWarning, language: Language = languageOf()): string {\n switch (warning.code) {\n case 'registry-unavailable': return t('warning.registryUnavailable', { detail: warning.detail }, language)\n case 'version-incomparable': return t('warning.versionIncomparable', {\n currentVersion: warning.currentVersion,\n latestVersion: warning.latestVersion,\n }, language)\n case 'stale-schemastery': {\n const params = { version: warning.version ?? '—', path: warning.path }\n // Only print a removal command when the Host could name the directory to\n // remove; the module path alone would make `rm -rf` delete a single file.\n return warning.nodeModulesDir === null\n ? t('warning.staleSchemasteryNoPath', params, language)\n : t('warning.staleSchemastery', { ...params, nodeModulesDir: warning.nodeModulesDir }, language)\n }\n }\n}\n\n/** Prefer structured warnings, but keep the Host string for mixed-version clients. */\nexport function localizedWarning(status: Pick<UpdateStatus, 'warning' | 'warnings'>, language: Language = languageOf()): string | null {\n const warnings = status.warnings ?? []\n return warnings.length === 0 ? status.warning : warnings.map(item => warningText(item, language)).join(' ')\n}\n\n/**\n * Advice for an installation this plugin cannot hand a copyable command.\n *\n * `null` is the honest answer for an npm/pnpm global install: its candidate\n * already carries a real command, so guidance prose there would only be noise.\n */\nexport function localizedUpgradeGuidance(\n installKind: UpdateStatus['installKind'],\n language: Language = languageOf(),\n): string | null {\n if (installKind === 'source-checkout') return t('guidance.sourceCheckout', {}, language)\n if (installKind === 'unknown') return t('guidance.unknownInstall', {}, language)\n return null\n}\n","/** React arrives from DSH's frozen browser module table at client materialization. */\nimport type * as ReactNS from 'react'\n\n// eslint/oxlint would normally discourage require; DSH's closure factory makes\n// this the supported runtime import path for a third-party client bundle.\nexport const React: typeof ReactNS = require('react') as typeof ReactNS\nexport const h = React.createElement\n","/** Sidebar chip and overlay detail panel. */\n\nimport type * as ReactNS from 'react'\nimport { isChipProblem, visualState } from '../shared/visual-state.ts'\nimport { MAX_CACHE_TTL_MINUTES, MIN_CACHE_TTL_MINUTES, isCacheTtlMinutes, type ReleaseCandidate, type UpdateStatus } from '../shared/types.ts'\nimport type { PreferencesStore, PanelStore, RestartStore, StatusStore } from './stores.ts'\nimport { languageOf, localizedUpgradeGuidance, localizedWarning, t, type Language } from './i18n.ts'\nimport { React, h } from './react.ts'\n\nfunction useObservable<T>(store: { subscribe(listener: () => void): () => void; getSnapshot(): T }): T {\n return React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot)\n}\n\nfunction timeText(value: string | null): string | null {\n if (value === null) return null\n try {\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(new Date(value))\n } catch {\n return value\n }\n}\n\nfunction shortVersion(value: string): string {\n if (value.length <= 16) return value\n return value.slice(0, 15) + '…'\n}\n\n/** Persists a cache policy only; it never schedules a browser or Host timer. */\nfunction CacheTtlControl({ preferences }: { preferences: PreferencesStore }): ReactNS.ReactElement {\n const snapshot = useObservable(preferences)\n const [draft, setDraft] = React.useState(String(snapshot.cacheTtlMinutes))\n React.useEffect(() => { setDraft(String(snapshot.cacheTtlMinutes)) }, [snapshot.cacheTtlMinutes])\n const save = (): void => {\n const value = Number(draft)\n if (isCacheTtlMinutes(value)) preferences.setCacheTtlMinutes(value)\n else setDraft(String(snapshot.cacheTtlMinutes))\n }\n return (\n <div className=\"dus-cache-setting\">\n <label className=\"dus-cache-field\">\n <span>{t('panel.cacheDuration')}</span>\n <span className=\"dus-cache-input-wrap\">\n <input\n className=\"dus-cache-input\"\n type=\"number\"\n inputMode=\"numeric\"\n min={MIN_CACHE_TTL_MINUTES}\n max={MAX_CACHE_TTL_MINUTES}\n step={1}\n value={draft}\n disabled={!snapshot.writable}\n aria-describedby=\"dus-cache-hint\"\n onChange={(event) => { setDraft(event.currentTarget.value) }}\n onBlur={save}\n onKeyDown={(event) => {\n if (event.key === 'Enter') { event.currentTarget.blur() }\n if (event.key === 'Escape') { setDraft(String(snapshot.cacheTtlMinutes)); event.currentTarget.blur() }\n }}\n />\n <span>{t('panel.minutes')}</span>\n </span>\n </label>\n <p className=\"dus-cache-hint\" id=\"dus-cache-hint\">{t('panel.cacheHint')}</p>\n {!snapshot.writable && <p className=\"dus-cache-hint\">{t('panel.cacheReadonly')}</p>}\n </div>\n )\n}\n\nfunction badgeLabel(status: UpdateStatus | null, loading: boolean, error: string | null): string {\n const state = visualState(status, loading, error)\n if (state === 'loading') return t('brand.checking')\n if (state === 'update') return t('brand.update')\n if (state === 'problem') return t('brand.problem')\n return t('brand.current')\n}\n\nexport interface SharedUi {\n status: StatusStore\n preferences: PreferencesStore\n panel: PanelStore\n restart: RestartStore\n}\n\n/** Occupies ONLY sidebar.brand.name; the official fish mark stays untouched. */\nexport function BrandName({ ui }: { ui: SharedUi }): ReactNS.ReactElement | null {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n // Defence in depth only: the entry that renders this component is already\n // disposed while the preference is off, because a single slot arbitrates by\n // priority and returning null would keep occupying the cell. See\n // client/index.ts — that disposal is what brings the official brand back.\n if (!preferences.sidebarEnabled) return null\n\n const state = visualState(snapshot.status, snapshot.loading, snapshot.error)\n const version = snapshot.status?.currentVersion ?? '—'\n const activate = (event: ReactNS.SyntheticEvent): void => {\n // The surrounding sidebar brand is an existing New Session <button>. This\n // non-button interaction prevents a nested button and stops its click.\n event.preventDefault()\n event.stopPropagation()\n // The official brand identity ancestor is aria-hidden. Do not leave focus\n // inside it while the modal dialog is open (Chrome otherwise warns).\n const target = event.currentTarget\n if (target instanceof HTMLElement) target.blur()\n ui.panel.toggle()\n }\n const onKeyDown = (event: ReactNS.KeyboardEvent<HTMLSpanElement>): void => {\n if (event.key !== 'Enter' && event.key !== ' ') return\n activate(event)\n }\n\n return (\n <span className=\"dus-brand-name\">\n {/* No handler: clicking this still bubbles to the shell's New Session button. */}\n <span className=\"dus-brand-deepseek\">DeepSeek</span>\n <span\n className=\"dus-badge\"\n data-update={snapshot.status?.hasUpdate === true || undefined}\n data-error={state === 'problem' || undefined}\n role=\"button\"\n tabIndex={0}\n aria-label={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n title={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n onClick={activate}\n onKeyDown={onKeyDown}\n >\n <span className=\"dus-badge-version\">{shortVersion(version)}</span>\n {/* `data-state` drives the palette (green when up to date); `data-update`\n and `data-loading` remain the louder, state-specific rules. */}\n <span className=\"dus-dot\" data-state={state} data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={snapshot.loading || undefined} aria-hidden=\"true\" />\n </span>\n </span>\n )\n}\n\nfunction restartUnavailableText(reason: 'not-supervised' | 'desktop' | 'supervisor-mismatch' | 'supervisor-thrashing' | 'activity-unavailable' | 'timer-unavailable' | 'stale-instance' | null | undefined): string {\n if (reason === 'desktop') return t('restart.unavailableDesktop')\n if (reason === 'supervisor-mismatch') return t('restart.unavailableMismatch')\n if (reason === 'supervisor-thrashing') return t('restart.unavailableThrashing')\n if (reason === 'activity-unavailable') return t('restart.unavailableActivity')\n if (reason === 'timer-unavailable') return t('restart.unavailableTimer')\n if (reason === 'stale-instance') return t('restart.unavailableStale')\n return t('restart.unavailable')\n}\n\nfunction RestartControl({ restart }: { restart: RestartStore }): ReactNS.ReactElement {\n const snapshot = useObservable(restart)\n React.useEffect(() => { void restart.refresh() }, [restart])\n const unavailable = snapshot.status !== null && !snapshot.status.available\n const hasActivity = snapshot.activity.length > 0\n // Recovery steps only make sense for a lost supervision, which is exactly when\n // the Host attaches them; the other refusals say what to do in their own text.\n const recoverable = snapshot.status?.recovery?.commands ?? null\n const waiting = snapshot.phase === 'waiting'\n const label = snapshot.phase === 'unknown' ? t('restart.loading')\n : snapshot.phase === 'checking' ? t('restart.checking')\n : snapshot.phase === 'armed' ? (hasActivity ? t('restart.force') : t('restart.confirm'))\n : waiting ? t('restart.waitingShort')\n : snapshot.phase === 'timeout' ? t('restart.retry')\n : snapshot.phase === 'error' ? t('restart.retry')\n : t('restart.button')\n const disabled = snapshot.phase === 'unknown' || snapshot.phase === 'checking' || waiting || unavailable\n const click = (): void => {\n if (snapshot.phase === 'armed') { void restart.request(hasActivity); return }\n if (snapshot.phase === 'timeout' || snapshot.phase === 'error') { void restart.check(); return }\n void restart.check()\n }\n return <>\n <button\n className=\"dus-action dus-restart\"\n type=\"button\"\n disabled={disabled}\n title={unavailable ? restartUnavailableText(snapshot.status?.unavailableReason) : t('restart.title')}\n onClick={click}\n >{label}</button>\n {snapshot.phase === 'armed' && <button className=\"dus-action\" type=\"button\" onClick={() => restart.cancel()}>{t('restart.cancel')}</button>}\n {unavailable && <p className=\"dus-restart-message\" role=\"status\">{restartUnavailableText(snapshot.status?.unavailableReason)}</p>}\n {unavailable && recoverable !== null && <div className=\"dus-restart-recover\">\n <p className=\"dus-restart-message\">{t('restart.recoverIntro')}</p>\n <CommandBlock command={recoverable} label={t('restart.recoverLabel')} note={t('restart.recoverNote')} />\n </div>}\n {unavailable && snapshot.status?.unavailableReason === 'not-supervised' && <p className=\"dus-restart-message\">{t('restart.recoverInstall')}</p>}\n {snapshot.phase === 'armed' && <p className=\"dus-restart-message\" role=\"status\">\n {hasActivity ? t('restart.activeWarning', { count: String(snapshot.activity.length) }) : t('restart.confirmHint')}\n </p>}\n {hasActivity && snapshot.phase === 'armed' && <ul className=\"dus-restart-work\">{snapshot.activity.map(item => <li key={`${item.type}:${item.id}`}>{item.label} · {item.status}</li>)}</ul>}\n {waiting && <p className=\"dus-restart-message\" role=\"status\">{t('restart.waiting', { seconds: String(Math.floor(snapshot.elapsedMs / 1000)) })}</p>}\n {snapshot.phase === 'timeout' && <p className=\"dus-restart-message\" role=\"alert\">{t('restart.timeout')}</p>}\n {snapshot.phase === 'error' && snapshot.error !== null && <p className=\"dus-restart-message\" role=\"alert\">{snapshot.error}</p>}\n </>\n}\n\nfunction statusSummary(status: UpdateStatus | null, loading: boolean, error: string | null): { kind: 'update' | 'ok' | 'warning' | 'error'; text: string } {\n if (loading && status === null) return { kind: 'warning', text: t('brand.checking') }\n if (error !== null) return { kind: 'error', text: error }\n if (status !== null && status.releases.length > 0) {\n // The count is the whole answer: the cards below name every version, so the\n // state line does not repeat one of them and go stale when the list changes.\n return { kind: 'update', text: t('panel.updatesFound', { count: String(status.releases.length) }) }\n }\n if (status !== null) {\n const warning = localizedWarning(status)\n if (warning !== null) return { kind: 'warning', text: warning }\n }\n return { kind: 'ok', text: t('panel.currentState') }\n}\n\nfunction selectCommand(element: HTMLElement | null): void {\n if (element === null) return\n try {\n const selection = window.getSelection()\n if (selection === null) return\n const range = document.createRange()\n range.selectNodeContents(element)\n selection.removeAllRanges()\n selection.addRange(range)\n element.focus()\n } catch {\n // The command remains ordinary selectable text even when selection fails.\n }\n}\n\n/**\n * One copy-only command and its own feedback.\n *\n * Each instance owns its clipboard state, so a card's \"已复制\" never appears on\n * another card: the panel can show several commands at once.\n */\nfunction CopyableCommand({ command, disabled, label }: { command: string; disabled: boolean; label: string | null }): ReactNS.ReactElement {\n const commandRef = React.useRef<HTMLElement | null>(null)\n const [copyMessage, setCopyMessage] = React.useState<string | null>(null)\n const copy = async (): Promise<void> => {\n setCopyMessage(null)\n try {\n if (!navigator.clipboard?.writeText) throw new Error('Clipboard API unavailable')\n await navigator.clipboard.writeText(command)\n setCopyMessage(t('panel.copied'))\n } catch {\n selectCommand(commandRef.current)\n setCopyMessage(t('panel.copyFallback'))\n }\n }\n return (\n <>\n {label !== null && <p className=\"dus-command-label\">{label}</p>}\n <code ref={commandRef} className=\"dus-command\" tabIndex={0}>{command}</code>\n <div className=\"dus-actions dus-command-actions\">\n <button className=\"dus-action\" type=\"button\" disabled={disabled} onClick={() => { void copy() }}>{t('panel.copy')}</button>\n {copyMessage !== null && <p className=\"dus-copy-message\" role=\"status\">{copyMessage}</p>}\n </div>\n </>\n )\n}\n\n/** A labelled, copy-only command block, used by restart recovery. */\nfunction CommandBlock({ command, disabled = false, label = t('panel.command'), note = t('panel.commandNote') }: { command: string; disabled?: boolean; label?: string; note?: string }): ReactNS.ReactElement {\n return (\n <>\n <CopyableCommand command={command} disabled={disabled} label={label} />\n <p className=\"dus-note\">{note}</p>\n </>\n )\n}\n\n/** One card, in the order the Host sent it, with \"newest\" already decided. */\nexport interface ReleaseRow {\n release: ReleaseCandidate\n /** Only ever true for the first row: the amber border and the 最新 pill. */\n newest: boolean\n}\n\nexport interface ReleaseView {\n rows: ReleaseRow[]\n /** Some card carries a real command, so the copy-only note belongs on the panel. */\n copyable: boolean\n /** One explanation for an installation no candidate can hand a command to. */\n guidance: string | null\n}\n\n/**\n * What the card area renders, decided as a pure function.\n *\n * It lives outside the JSX for the same reason `visualState` does: \"nothing newer\n * means no card and no command block at all\" is a rule that regressions hide\n * from, and a test can drive this directly without a DOM. The Host's array is\n * already newest-first, so the client never re-sorts it — it only marks index 0.\n */\nexport function releaseViewOf(status: UpdateStatus | null, language: Language = languageOf()): ReleaseView {\n const releases = status === null ? [] : status.releases\n const copyable = releases.some(release => release.command !== null)\n return {\n rows: releases.map((release, index) => ({ release, newest: index === 0 })),\n copyable,\n guidance: status !== null && releases.length > 0 && !copyable\n ? localizedUpgradeGuidance(status.installKind, language)\n : null,\n }\n}\n\n/**\n * One upgradable version, top to bottom: what it is, when it shipped, and how to\n * get it. `newest` is index 0 of the Host's array — the list arrives sorted, and\n * the client must not re-sort a contract the Host already ordered.\n */\nfunction ReleaseCard({ release, newest, disabled }: { release: ReleaseCandidate; newest: boolean; disabled: boolean }): ReactNS.ReactElement {\n const published = timeText(release.publishedAt)\n return (\n <article className=\"dus-release\" data-highlight={newest || undefined}>\n <div className=\"dus-release-head\">\n <code className=\"dus-release-version\">{release.version}</code>\n {newest && <span className=\"dus-pill dus-pill-latest\">{t('panel.latest')}</span>}\n {release.tag !== null && <span className=\"dus-pill\">{release.tag}</span>}\n </div>\n <p className=\"dus-release-meta\">\n <span className=\"dus-release-line\">{release.line}</span>\n {published !== null && <span>{t('panel.publishedAt')}: {published}</span>}\n </p>\n {/* A source checkout has no command this panel may fabricate; the panel's\n guidance line speaks for every such card instead. */}\n {release.command !== null && <CopyableCommand command={release.command} disabled={disabled} label={null} />}\n </article>\n )\n}\n\n/** Full detail from whichever page the operator is on (the transport is authenticated). */\nexport function UpdatePanel({ ui }: { ui: SharedUi }): ReactNS.ReactElement | null {\n const panel = useObservable(ui.panel)\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n const dialogRef = React.useRef<HTMLDialogElement | null>(null)\n const visible = panel.open && preferences.sidebarEnabled\n\n React.useLayoutEffect(() => {\n if (!visible) return undefined\n const dialog = dialogRef.current\n if (dialog === null) return undefined\n try {\n if (!dialog.open) dialog.showModal()\n } catch {\n // Older embedded Chromium still receives a visible non-top-layer dialog.\n dialog.setAttribute('open', '')\n }\n return () => {\n if (dialog.open) dialog.close()\n }\n }, [visible])\n\n React.useEffect(() => {\n if (!panel.open) return undefined\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') ui.panel.close()\n }\n window.addEventListener('keydown', onKeyDown)\n return () => { window.removeEventListener('keydown', onKeyDown) }\n }, [panel.open, ui.panel])\n\n if (!visible) return null\n const status = snapshot.status\n const warning = status === null ? null : localizedWarning(status)\n const summary = statusSummary(status, snapshot.loading, snapshot.error)\n const view = releaseViewOf(status)\n\n return (\n <dialog\n ref={dialogRef}\n className=\"dus-overlay-root\"\n aria-label={t('panel.title')}\n onCancel={(event) => {\n event.preventDefault()\n ui.panel.close()\n }}\n >\n <div className=\"dus-backdrop\" onClick={() => { ui.panel.close() }} />\n <section className=\"dus-panel\" role=\"dialog\" aria-modal=\"true\" aria-label={t('panel.title')} onClick={(event) => { event.stopPropagation() }}>\n <div className=\"dus-panel-head\">\n <span className=\"dus-panel-title\">{t('panel.title')}</span>\n <button className=\"dus-close\" type=\"button\" aria-label={t('panel.close')} onClick={() => { ui.panel.close() }}>×</button>\n </div>\n\n <CacheTtlControl preferences={ui.preferences} />\n <p className=\"dus-state\" data-kind={summary.kind}>{summary.text}</p>\n\n <div className=\"dus-metadata\">\n <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.current')}</span>\n <code className=\"dus-meta-value\">{status?.currentVersion ?? '…'}</code>\n </div>\n {status?.checkedAt !== null && status?.checkedAt !== undefined && <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.checkedAt')}</span>\n <span className=\"dus-meta-value\">{timeText(status.checkedAt)}</span>\n <span className=\"dus-meta-sub\">{status.cached ? t('panel.cached') : t('panel.live')}</span>\n </div>}\n </div>\n\n {warning !== null && <p className=\"dus-warning\">{t('panel.error')}: {warning}</p>}\n {snapshot.error !== null && <p className=\"dus-warning\">{t('panel.error')}: {snapshot.error}</p>}\n\n <div className=\"dus-actions\">\n <button className=\"dus-action\" type=\"button\" disabled={snapshot.loading} onClick={() => { void ui.status.refresh(preferences.cacheTtlMinutes) }}>\n {snapshot.loading ? t('panel.checking') : t('panel.check')}\n </button>\n {status !== null && <a className=\"dus-action\" href={status.changelogUrl} target=\"_blank\" rel=\"noreferrer\">{t('panel.releaseNotes')}</a>}\n <RestartControl restart={ui.restart} />\n </div>\n\n {view.rows.length > 0 && <div className=\"dus-releases\">\n {view.rows.map(row => (\n <ReleaseCard key={row.release.version} release={row.release} newest={row.newest} disabled={snapshot.loading} />\n ))}\n </div>}\n {view.copyable && <p className=\"dus-note\">{t('panel.commandNote')}</p>}\n {view.guidance !== null && <p className=\"dus-guidance\">{view.guidance}</p>}\n <p className=\"dus-note\">{t('panel.readOnly')}</p>\n </section>\n </dialog>\n )\n}\n","/** Minimal structural client faces — runtime services stay owned by DSH. */\n\nimport type { InstallKind, ReleaseCandidate, UpdateStatus, UpdateWarning } from '../shared/types.ts'\n\nexport type RestartPhase = 'unknown' | 'idle' | 'armed' | 'checking' | 'waiting' | 'timeout' | 'error'\n\nexport interface RestartRecoveryValue {\n /** Copy-only advice from the installer's own receipt: find the port holder, then recover. */\n commands: string\n}\n\nexport interface RestartStatusValue {\n instanceId: string\n /**\n * When the current Host process started. Optional on purpose: a bundle that was\n * hot-reloaded over an older Host must keep rendering without it.\n */\n startedAt?: string\n available: boolean\n supervisor: 'launchd' | 'systemd' | 'task-scheduler' | 'unknown' | null\n unavailableReason: 'not-supervised' | 'desktop' | 'supervisor-mismatch' | 'supervisor-thrashing' | 'activity-unavailable' | 'timer-unavailable' | 'stale-instance' | null\n /** Optional: an older Host sends no recovery steps and the panel simply omits them. */\n recovery?: RestartRecoveryValue\n}\n\nexport interface RestartActivityItemValue {\n type: 'agent' | 'job' | 'terminal'\n id: string\n label: string\n status: string\n ownerSession?: string\n}\n\nexport interface RestartCheckValue {\n kind: 'ready' | 'active-work' | 'unavailable'\n status: RestartStatusValue\n activity?: { hasActive: boolean; items: RestartActivityItemValue[] }\n}\n\nexport interface RestartRequestValue {\n kind: 'ready' | 'active-work' | 'unavailable' | 'scheduled' | 'in-progress'\n status?: RestartStatusValue\n activity?: { hasActive: boolean; items: RestartActivityItemValue[] }\n instanceId?: string\n}\n\n\nexport interface Observable<T> {\n getSnapshot(): T\n subscribe(listener: () => void): () => void\n}\n\nexport interface ConnectionRpc {\n call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown>\n}\n\n/**\n * The authenticated transport face. There is deliberately NO `isLoopback` gate\n * here: DSH's settings Client treats a non-loopback page as process-local, but\n * that is a settings *persistence* policy — the Connection RPC itself stays\n * authenticated and reachable over a LAN bridge, so gating this plugin's own\n * read-only status on it only made the panel inert on exactly the page it is\n * used from. See settings/settingsChannel.ts for the one place a loopback\n * distinction still matters (choosing the Host settings channel).\n */\nexport interface ConnectionClient {\n rpc?: ConnectionRpc\n}\n\nexport interface SlotRegistration {\n name: string\n id?: string\n order?: number\n /** Single-slot arbitration: the lowest registered priority renders. */\n priority?: number\n label?: () => string\n locale?: string\n inject?: () => unknown\n}\n\nexport interface Slots {\n inject(name: string, callback: () => unknown): () => void\n register(registration: SlotRegistration, component: (props: Record<string, unknown>) => unknown): () => void\n}\n\nexport interface ClientContext {\n slots: Slots\n get(name: string): unknown\n inject(names: string[], callback: (ctx: unknown) => void): () => void\n effect(setup: () => (() => void) | void, label?: string): () => void\n /** Optional lifecycle event seam (Cordis contexts expose it; guarded here). */\n on?(name: string, listener: () => void): unknown\n}\n\nexport function errorMessage(error: unknown): string {\n const text = error instanceof Error ? error.message : String(error)\n return text.replace(/\\s+/g, ' ').trim().slice(0, 220) || 'unknown error'\n}\n\nfunction objectOf(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : undefined\n}\n\nexport function restartStatusOf(value: unknown): RestartStatusValue | undefined {\n const record = objectOf(value)\n if (record === undefined || typeof record.instanceId !== 'string' || record.instanceId === '' || typeof record.available !== 'boolean') return undefined\n const supervisor = record.supervisor === null ? null\n : record.supervisor === 'launchd' || record.supervisor === 'systemd' || record.supervisor === 'task-scheduler' || record.supervisor === 'unknown'\n ? record.supervisor : undefined\n const unavailableReason = record.unavailableReason === null ? null\n : record.unavailableReason === 'not-supervised' || record.unavailableReason === 'desktop' || record.unavailableReason === 'supervisor-mismatch' || record.unavailableReason === 'supervisor-thrashing' || record.unavailableReason === 'activity-unavailable' || record.unavailableReason === 'timer-unavailable' || record.unavailableReason === 'stale-instance'\n ? record.unavailableReason : undefined\n if (supervisor === undefined || unavailableReason === undefined) return undefined\n if (record.startedAt !== undefined && (typeof record.startedAt !== 'string' || record.startedAt === '')) return undefined\n const recovery = record.recovery === undefined ? undefined : objectOf(record.recovery)\n if (record.recovery !== undefined && (recovery === undefined || typeof recovery.commands !== 'string' || recovery.commands === '')) return undefined\n if (record.available && (supervisor === null || unavailableReason !== null)) return undefined\n if (!record.available && unavailableReason === null) return undefined\n return {\n instanceId: record.instanceId,\n ...(record.startedAt === undefined ? {} : { startedAt: record.startedAt }),\n available: record.available, supervisor, unavailableReason,\n ...(recovery === undefined ? {} : { recovery: { commands: recovery.commands as string } }),\n }\n}\n\nfunction restartActivityOf(value: unknown): { hasActive: boolean; items: RestartActivityItemValue[] } | undefined {\n const record = objectOf(value)\n if (record === undefined || typeof record.hasActive !== 'boolean' || !Array.isArray(record.items)) return undefined\n const items: RestartActivityItemValue[] = []\n for (const raw of record.items) {\n const item = objectOf(raw)\n if (item === undefined || (item.type !== 'agent' && item.type !== 'job' && item.type !== 'terminal')\n || typeof item.id !== 'string' || typeof item.label !== 'string' || typeof item.status !== 'string') return undefined\n if (item.ownerSession !== undefined && typeof item.ownerSession !== 'string') return undefined\n items.push({ type: item.type, id: item.id, label: item.label, status: item.status, ...(item.ownerSession === undefined ? {} : { ownerSession: item.ownerSession }) })\n }\n if (record.hasActive !== (items.length > 0)) return undefined\n return { hasActive: record.hasActive, items }\n}\n\nexport function restartCheckOf(value: unknown): RestartCheckValue | undefined {\n const record = objectOf(value)\n if (record === undefined || (record.kind !== 'ready' && record.kind !== 'active-work' && record.kind !== 'unavailable')) return undefined\n const status = restartStatusOf(record.status)\n if (status === undefined) return undefined\n const activity = record.activity === undefined ? undefined : restartActivityOf(record.activity)\n if (record.activity !== undefined && activity === undefined) return undefined\n if (record.kind === 'active-work' && (activity === undefined || !activity.hasActive)) return undefined\n if (record.kind !== 'active-work' && activity !== undefined) return undefined\n return { kind: record.kind, status, ...(activity === undefined ? {} : { activity }) }\n}\n\nexport function restartRequestOf(value: unknown): RestartRequestValue | undefined {\n const record = objectOf(value)\n if (record === undefined || (record.kind !== 'ready' && record.kind !== 'active-work' && record.kind !== 'unavailable' && record.kind !== 'scheduled' && record.kind !== 'in-progress')) return undefined\n if (record.kind === 'scheduled' || record.kind === 'in-progress') return typeof record.instanceId === 'string' && record.instanceId !== '' ? { kind: record.kind, instanceId: record.instanceId } : undefined\n const check = restartCheckOf(record)\n return check === undefined ? undefined : check\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === 'string' ? value : null\n}\n\nfunction warningOf(value: unknown): UpdateWarning | undefined {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (record.code === 'registry-unavailable' && typeof record.detail === 'string') {\n return { code: record.code, detail: record.detail }\n }\n if (record.code === 'version-incomparable' && typeof record.currentVersion === 'string'\n && typeof record.latestVersion === 'string') {\n return {\n code: record.code,\n currentVersion: record.currentVersion,\n latestVersion: record.latestVersion,\n }\n }\n if (record.code === 'stale-schemastery') {\n const version = record.version === null ? null : stringOrNull(record.version)\n const nodeModulesDir = record.nodeModulesDir === null ? null : stringOrNull(record.nodeModulesDir)\n const path = stringOrNull(record.path)\n if (path !== null && (record.version === null || version !== null)\n && (record.nodeModulesDir === null || nodeModulesDir !== null)) {\n return { code: record.code, version, path, nodeModulesDir }\n }\n }\n return undefined\n}\n\nfunction installKindOf(value: unknown): InstallKind | undefined {\n return value === 'npm-global' || value === 'pnpm-global' || value === 'source-checkout' || value === 'unknown'\n ? value\n : undefined\n}\n\n/**\n * A field the contract types as `string | null`.\n *\n * `null` is a value the Host chose to send; `undefined` means it was missing or\n * malformed, which a caller turns into a rejection.\n */\nfunction nullableString(value: unknown): string | null | undefined {\n if (value === null) return null\n return typeof value === 'string' && value !== '' ? value : undefined\n}\n\n/**\n * One upgradable version, exactly as the Host described it.\n *\n * Every field is required by the contract, so a missing `line` or a numeric\n * `tag` rejects the whole payload instead of rendering a half-filled card: the\n * card list is the panel's whole answer, and a wrong one is worse than a read\n * error the operator can retry.\n */\nfunction releaseCandidateOf(value: unknown): ReleaseCandidate | undefined {\n const record = objectOf(value)\n if (record === undefined) return undefined\n if (typeof record.version !== 'string' || record.version === '') return undefined\n if (typeof record.line !== 'string' || record.line === '') return undefined\n const tag = nullableString(record.tag)\n const publishedAt = nullableString(record.publishedAt)\n // An empty command is not a command: fold it into \"this installation cannot\n // express one\" so the panel shows guidance instead of a copy button that would\n // put an empty string on the clipboard.\n const command = record.command === '' ? null : nullableString(record.command)\n if (tag === undefined || publishedAt === undefined || command === undefined) return undefined\n return { version: record.version, tag, publishedAt, line: record.line, command }\n}\n\n/** The release line of a version: no SemVer maths needed, the Host's own rule. */\nfunction releaseLineOf(version: string): string {\n return version.split('-', 1)[0] ?? version\n}\n\n/**\n * A 0.4.x Host answered with a single `latestVersion` plus its `upgradeCommand`.\n *\n * A client bundle that hot-reloads over that Host must keep the page alive, so\n * the one candidate those fields describe is synthesized instead of rejecting a\n * payload the Host is still entitled to send. `tag` is null because the legacy\n * shape never carried it.\n */\nfunction legacyReleaseOf(record: Record<string, unknown>, installKind: InstallKind): ReleaseCandidate | undefined {\n if (typeof record.latestVersion !== 'string' || record.latestVersion === '') return undefined\n // The legacy shape allowed a missing publish time; `0.4.x` always sent the key.\n const publishedAt = record.publishedAt === undefined ? null : nullableString(record.publishedAt)\n if (publishedAt === undefined) return undefined\n // The legacy Host put guidance prose into `upgradeCommand` for a source\n // checkout or an unknown install. Reusing that string would render an English\n // sentence inside a copyable <code>, so those kinds take the guidance path.\n const command = installKind === 'npm-global' || installKind === 'pnpm-global'\n ? (typeof record.upgradeCommand === 'string' && record.upgradeCommand !== '' ? record.upgradeCommand : null)\n : null\n return {\n version: record.latestVersion,\n tag: null,\n publishedAt,\n line: releaseLineOf(record.latestVersion),\n command,\n }\n}\n\n/** Reject malformed RPC output before it reaches a slot component. */\nexport function updateStatusOf(value: unknown): UpdateStatus | undefined {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (typeof record.currentVersion !== 'string' || typeof record.hasUpdate !== 'boolean'\n || typeof record.cached !== 'boolean' || typeof record.releaseUrl !== 'string'\n || typeof record.changelogUrl !== 'string' || typeof record.packageName !== 'string'\n || record.canApplyInPlace !== false) return undefined\n const installKind = installKindOf(record.installKind)\n if (installKind === undefined) return undefined\n const checkedAt = record.checkedAt === null ? null : stringOrNull(record.checkedAt)\n const warning = record.warning === null ? null : stringOrNull(record.warning)\n // Absent or unrecognised means a Host older than the field: leave it undefined and\n // let the visual state fall back to \"any warning is a failure\", never to \"no warning\".\n const warningKind = record.warningKind === 'failure' || record.warningKind === 'notice' ? record.warningKind : undefined\n if ((record.checkedAt !== null && checkedAt === null) || (record.warning !== null && warning === null)) return undefined\n\n const releases: ReleaseCandidate[] = []\n if (record.releases !== undefined) {\n if (!Array.isArray(record.releases)) return undefined\n for (const raw of record.releases) {\n const parsed = releaseCandidateOf(raw)\n if (parsed === undefined) return undefined\n releases.push(parsed)\n }\n }\n // Hot reload over a 0.4.x Host: the legacy pair still names the one version it\n // found. Only when the new array is absent or empty — a Host that sends both is\n // new, and its array is authoritative.\n if (releases.length === 0 && record.hasUpdate === true) {\n const legacy = legacyReleaseOf(record, installKind)\n if (legacy !== undefined) releases.push(legacy)\n }\n // The chip reads `hasUpdate`, the panel reads `releases`; letting them disagree\n // would paint \"an update exists\" over an empty card list.\n if (record.hasUpdate !== (releases.length > 0)) return undefined\n\n const warnings: UpdateWarning[] = []\n if (record.warnings !== undefined) {\n if (!Array.isArray(record.warnings)) return undefined\n for (const raw of record.warnings) {\n const parsed = warningOf(raw)\n if (parsed === undefined) return undefined\n warnings.push(parsed)\n }\n }\n return {\n currentVersion: record.currentVersion,\n releases,\n hasUpdate: record.hasUpdate,\n cached: record.cached,\n checkedAt,\n warning,\n warningKind,\n warnings,\n installKind,\n releaseUrl: record.releaseUrl,\n changelogUrl: record.changelogUrl,\n packageName: record.packageName,\n canApplyInPlace: false,\n }\n}\n","/** Small observable stores shared by the independent sidebar and overlay slots. */\n\nimport { DEFAULT_CACHE_TTL_MINUTES, isCacheTtlMinutes, PLUGIN_ID, RESTART_ENDPOINTS, UPDATE_ENDPOINTS, UPDATE_STATUS_CHANNEL, type UpdateStatus } from '../shared/types.ts'\nimport type { ConnectionClient, Observable, RestartActivityItemValue, RestartPhase, RestartStatusValue } from './contract.ts'\nimport { errorMessage, restartCheckOf, restartRequestOf, restartStatusOf, updateStatusOf } from './contract.ts'\nimport type { SettingsScopeLike } from './settings/scopeFaces.ts'\n\nexport interface StatusSnapshot {\n status: UpdateStatus | null\n loading: boolean\n error: string | null\n}\n\nconst INITIAL_STATUS: StatusSnapshot = { status: null, loading: true, error: null }\n\nexport class StatusStore implements Observable<StatusSnapshot> {\n private snapshot: StatusSnapshot = INITIAL_STATUS\n private readonly listeners = new Set<() => void>()\n private inFlight: Promise<boolean> | undefined\n private stopped = false\n\n constructor(private readonly connection: ConnectionClient) {}\n\n getSnapshot = (): StatusSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n /** First mount reads the Host's cached status; it never starts a browser timer. */\n async load(cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n await this.request(false, cacheTtlMinutes)\n }\n\n /** User gesture only: force the Host to bypass TTL (while retaining single-flight). */\n async refresh(cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n await this.request(true, cacheTtlMinutes)\n }\n\n /**\n * Ordinary read that waits out an in-flight request first.\n *\n * Used once per mount, when the stored cache policy arrives after the first\n * read already started: joining that request would keep the default policy, so\n * the follow-up read has to come after it settles.\n */\n async reload(cacheTtlMinutes: number): Promise<void> {\n const pending = this.inFlight\n if (pending !== undefined) await pending\n if (this.stopped) return\n await this.request(false, cacheTtlMinutes)\n }\n\n stop(): void {\n this.stopped = true\n this.listeners.clear()\n }\n\n private publish(next: StatusSnapshot): void {\n if (this.stopped) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n\n private request(force: boolean, cacheTtlMinutes: number): Promise<boolean> {\n if (this.inFlight !== undefined) return this.inFlight\n const rpc = this.connection.rpc\n if (rpc === undefined || typeof rpc.call !== 'function') {\n this.publish({ ...this.snapshot, loading: false, error: 'DSH connection RPC is unavailable' })\n return Promise.resolve(false)\n }\n\n this.publish({ ...this.snapshot, loading: true, error: null })\n const run = (async () => {\n try {\n const endpoint = force ? UPDATE_ENDPOINTS.checkUpdate : UPDATE_ENDPOINTS.getStatus\n const ttl = isCacheTtlMinutes(cacheTtlMinutes) ? cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES\n const raw = await rpc.call(UPDATE_STATUS_CHANNEL, endpoint, force\n ? { force: true, cacheTtlMinutes: ttl }\n : { cacheTtlMinutes: ttl })\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) throw new Error('invalid update-status RPC response')\n const envelope = raw as { ok?: unknown; value?: unknown; error?: { message?: unknown } }\n if (envelope.ok !== true) throw new Error(typeof envelope.error?.message === 'string' ? envelope.error.message : 'update-status RPC failed')\n const status = updateStatusOf(envelope.value)\n if (status === undefined) throw new Error('invalid update-status payload')\n this.publish({ status, loading: false, error: null })\n return true\n } catch (error) {\n this.publish({ ...this.snapshot, loading: false, error: errorMessage(error) })\n return false\n }\n })()\n this.inFlight = run\n void run.finally(() => {\n if (this.inFlight === run) this.inFlight = undefined\n })\n return run\n }\n}\n\nexport interface PreferencesSnapshot {\n sidebarEnabled: boolean\n cacheTtlMinutes: number\n writable: boolean\n status: 'loading' | 'ready' | 'unavailable'\n}\n\nconst INITIAL_PREFERENCES: PreferencesSnapshot = {\n sidebarEnabled: true,\n cacheTtlMinutes: DEFAULT_CACHE_TTL_MINUTES,\n writable: false,\n status: 'loading',\n}\n\nexport class PreferencesStore implements Observable<PreferencesSnapshot> {\n private snapshot: PreferencesSnapshot = INITIAL_PREFERENCES\n private readonly listeners = new Set<() => void>()\n private scope: SettingsScopeLike | undefined\n\n getSnapshot = (): PreferencesSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n attach(scope: SettingsScopeLike): () => void {\n this.scope = scope\n const sync = () => {\n const raw = scope.getSnapshot()\n const value = raw.value !== null && typeof raw.value === 'object' && !Array.isArray(raw.value)\n ? raw.value as Record<string, unknown>\n : {}\n const status = raw.status === 'ready' || raw.status === 'unavailable' ? raw.status : 'loading'\n this.publish({\n sidebarEnabled: value.sidebarEnabled !== false,\n cacheTtlMinutes: isCacheTtlMinutes(value.cacheTtlMinutes) ? value.cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES,\n writable: raw.writable === true,\n status,\n })\n }\n sync()\n return scope.subscribe(sync)\n }\n\n setSidebarEnabled(enabled: boolean): void {\n const previous = this.snapshot\n this.publish({ ...previous, sidebarEnabled: enabled })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('sidebarEnabled', enabled).catch(() => {\n // A rejected Host-backed write restores the authoritative scope snapshot.\n try {\n const raw = scope.getSnapshot()\n const value = raw.value !== null && typeof raw.value === 'object' && !Array.isArray(raw.value)\n ? raw.value as Record<string, unknown>\n : {}\n this.publish({\n sidebarEnabled: value.sidebarEnabled !== false,\n cacheTtlMinutes: isCacheTtlMinutes(value.cacheTtlMinutes) ? value.cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES,\n writable: raw.writable === true,\n status: raw.status === 'ready' || raw.status === 'unavailable' ? raw.status : 'loading',\n })\n } catch {\n this.publish(previous)\n }\n })\n }\n\n setCacheTtlMinutes(cacheTtlMinutes: number): void {\n if (!isCacheTtlMinutes(cacheTtlMinutes)) return\n const previous = this.snapshot\n this.publish({ ...previous, cacheTtlMinutes })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('cacheTtlMinutes', cacheTtlMinutes).catch(() => { this.publish(previous) })\n }\n\n private publish(next: PreferencesSnapshot): void {\n const previous = this.snapshot\n if (previous.sidebarEnabled === next.sidebarEnabled\n && previous.cacheTtlMinutes === next.cacheTtlMinutes\n && previous.writable === next.writable && previous.status === next.status) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\nexport interface PanelSnapshot {\n open: boolean\n}\n\n/** Open state of the detail panel, whose only trigger is the brand-row chip. */\nexport class PanelStore implements Observable<PanelSnapshot> {\n private snapshot: PanelSnapshot = { open: false }\n private readonly listeners = new Set<() => void>()\n\n getSnapshot = (): PanelSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n toggle(): void {\n this.set({ open: !this.snapshot.open })\n }\n\n close(): void { this.set({ open: false }) }\n\n private set(next: PanelSnapshot): void {\n if (this.snapshot.open === next.open) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\nexport interface RestartSnapshot {\n phase: RestartPhase\n status: RestartStatusValue | null\n activity: readonly RestartActivityItemValue[]\n elapsedMs: number\n error: string | null\n}\n\nexport interface RestartStoreOptions {\n /** Injected by tests; defaults to browser timers. */\n readonly schedule?: (callback: () => void, delay: number) => unknown\n readonly cancel?: (handle: unknown) => void\n /** Per-RPC safety timeout used only while the Host is restarting. */\n readonly requestTimeout?: (callback: () => void, delay: number) => unknown\n readonly cancelRequestTimeout?: (handle: unknown) => void\n /** Same-origin liveness fallback when a new Host lacks this plugin route. */\n readonly liveness?: () => Promise<boolean>\n readonly reload?: () => void\n}\n\nconst INITIAL_RESTART: RestartSnapshot = {\n phase: 'unknown', status: null, activity: [], elapsedMs: 0, error: null,\n}\n\n/**\n * Restart state belongs to the client entry, not a modal component, so closing\n * the update panel cannot strand a confirmed restart half-way through recovery.\n * It starts no timer until the user confirms a restart request.\n */\nexport class RestartStore implements Observable<RestartSnapshot> {\n private snapshot: RestartSnapshot = INITIAL_RESTART\n private readonly listeners = new Set<() => void>()\n private timer: unknown\n private generation = 0\n private stopped = false\n private readonly schedule: (callback: () => void, delay: number) => unknown\n private readonly cancelTimer: (handle: unknown) => void\n private readonly requestTimeout: (callback: () => void, delay: number) => unknown\n private readonly cancelRequestTimeout: (handle: unknown) => void\n private readonly liveness: () => Promise<boolean>\n private readonly reload: () => void\n private pendingAbort: AbortController | undefined\n private reloaded = false\n\n constructor(private readonly connection: ConnectionClient, options: RestartStoreOptions = {}) {\n this.schedule = options.schedule ?? ((callback, delay) => window.setTimeout(callback, delay))\n this.cancelTimer = options.cancel ?? (handle => { window.clearTimeout(handle as number) })\n this.requestTimeout = options.requestTimeout ?? ((callback, delay) => window.setTimeout(callback, delay))\n this.cancelRequestTimeout = options.cancelRequestTimeout ?? (handle => { window.clearTimeout(handle as number) })\n this.liveness = options.liveness ?? (async () => {\n try {\n const response = await fetch(new URL('.', window.location.href), { method: 'HEAD', credentials: 'same-origin', cache: 'no-store' })\n return response.status === 200 || response.status === 401\n } catch { return false }\n })\n this.reload = options.reload ?? (() => window.location.reload())\n }\n\n getSnapshot = (): RestartSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n stop(): void {\n this.stopped = true\n this.generation += 1\n if (this.timer !== undefined) this.cancelTimer(this.timer)\n this.timer = undefined\n this.pendingAbort?.abort()\n this.pendingAbort = undefined\n this.listeners.clear()\n }\n\n /** Read capability on a visible surface; this is not a restart and never polls. */\n async refresh(): Promise<void> {\n if (this.snapshot.phase === 'waiting') return\n const raw = await this.call(RESTART_ENDPOINTS.status, {})\n if (raw === undefined) return\n const status = restartStatusOf(raw)\n if (status === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart-status payload' })\n return\n }\n this.publish({ phase: status.available ? 'idle' : 'idle', status, activity: [], elapsedMs: 0, error: null })\n }\n\n /** First click checks active work and arms the second, destructive action. */\n async check(): Promise<void> {\n this.publish({ ...this.snapshot, phase: 'checking', error: null })\n const raw = await this.call(RESTART_ENDPOINTS.check, {})\n if (raw === undefined) return\n const checked = restartCheckOf(raw)\n if (checked === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart-check payload' })\n return\n }\n if (checked.kind === 'unavailable') {\n this.publish({ phase: 'idle', status: checked.status, activity: [], elapsedMs: 0, error: null })\n return\n }\n this.publish({\n phase: 'armed', status: checked.status,\n activity: checked.activity?.items ?? [], elapsedMs: 0, error: null,\n })\n }\n\n cancel(): void {\n if (this.snapshot.phase !== 'armed' && this.snapshot.phase !== 'error' && this.snapshot.phase !== 'timeout') return\n this.publish({ ...this.snapshot, phase: this.snapshot.status === null ? 'unknown' : 'idle', activity: [], elapsedMs: 0, error: null })\n }\n\n /** Second click emits the Host request; `force` is only true after the activity list was shown. */\n async request(force: boolean): Promise<void> {\n const current = this.snapshot\n if (current.phase !== 'armed' || current.status === null || !current.status.available) return\n this.publish({ ...current, phase: 'checking', error: null })\n const raw = await this.call(RESTART_ENDPOINTS.request, { force, expectedInstanceId: current.status.instanceId })\n if (raw === undefined) return\n const result = restartRequestOf(raw)\n if (result === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart payload' })\n return\n }\n if (result.kind === 'scheduled' || result.kind === 'in-progress') {\n if (result.instanceId === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'restart response omitted instance identity' })\n return\n }\n this.beginRecovery(result.instanceId)\n return\n }\n if (result.kind === 'active-work' || result.kind === 'ready') {\n this.publish({\n phase: 'armed', status: result.status ?? current.status,\n activity: result.activity?.items ?? [], elapsedMs: 0, error: null,\n })\n return\n }\n this.publish({ phase: 'idle', status: result.status ?? current.status, activity: [], elapsedMs: 0, error: null })\n }\n\n private beginRecovery(previousInstanceId: string): void {\n const generation = ++this.generation\n const startedAt = Date.now()\n this.publish({ ...this.snapshot, phase: 'waiting', elapsedMs: 0, error: null })\n const attempt = async (delay: number): Promise<void> => {\n if (this.stopped || generation !== this.generation) return\n const elapsedMs = Date.now() - startedAt\n if (elapsedMs >= 60_000) {\n this.publish({ ...this.snapshot, phase: 'timeout', elapsedMs, error: null })\n return\n }\n this.timer = this.schedule(() => {\n void (async () => {\n if (this.stopped || generation !== this.generation) return\n const raw = await this.call(RESTART_ENDPOINTS.status, {}, false, 4_000)\n if (this.stopped || generation !== this.generation) return\n const status = raw === undefined ? undefined : restartStatusOf(raw)\n const nextElapsed = Date.now() - startedAt\n if (status !== undefined && status.instanceId !== previousInstanceId) {\n this.publish({ phase: 'waiting', status, activity: [], elapsedMs: nextElapsed, error: null })\n if (!this.reloaded) { this.reloaded = true; this.reload() }\n return\n }\n // A healthy carrier with no plugin route means the new DSH came back\n // but this plugin did not load. Refresh so the page can show the real\n // startup failure instead of claiming DSH is still down forever.\n if (raw === undefined && await this.liveness()) {\n if (!this.reloaded) { this.reloaded = true; this.reload() }\n return\n }\n this.publish({ ...this.snapshot, phase: 'waiting', elapsedMs: nextElapsed })\n await attempt(Math.min(delay * 2, 10_000))\n })()\n }, delay)\n }\n void attempt(1_000)\n }\n\n private async call(endpoint: string, payload: unknown, surfaceError: boolean = true, timeoutMs?: number): Promise<unknown | undefined> {\n const rpc = this.connection.rpc\n if (rpc === undefined || typeof rpc.call !== 'function') {\n if (surfaceError) this.publish({ ...this.snapshot, phase: 'error', error: 'DSH connection RPC is unavailable' })\n return undefined\n }\n const controller = timeoutMs === undefined ? undefined : new AbortController()\n if (controller !== undefined) this.pendingAbort = controller\n let timeout: unknown\n if (controller !== undefined && timeoutMs !== undefined) timeout = this.requestTimeout(() => controller.abort(), timeoutMs)\n try {\n const raw = await rpc.call(UPDATE_STATUS_CHANNEL, endpoint, payload, controller?.signal)\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) throw new Error('invalid restart RPC response')\n const envelope = raw as { ok?: unknown; value?: unknown; error?: { message?: unknown } }\n if (envelope.ok !== true) throw new Error(typeof envelope.error?.message === 'string' ? envelope.error.message : 'restart RPC failed')\n return envelope.value\n } catch (error) {\n if (surfaceError) this.publish({ ...this.snapshot, phase: 'error', error: errorMessage(error) })\n return undefined\n } finally {\n if (timeout !== undefined) this.cancelRequestTimeout(timeout)\n if (this.pendingAbort === controller) this.pendingAbort = undefined\n }\n }\n\n private publish(next: RestartSnapshot): void {\n if (this.stopped) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\n/**\n * The one settings namespace, which on DSH 0.1.7 IS the Loader entry id in\n * `cordis.patch.yml`: the Host half's volatile `Config` fields are projected as\n * that entry's form, and the browser half addresses the same id through\n * `ctx.configForms.get(...)`.\n */\nexport const SETTINGS_NAMESPACE = PLUGIN_ID\n","/**\n * dsh-update-status — direct Host settings channel (non-loopback pages).\n *\n * WHY THIS EXISTS\n *\n * DSH's settings Client keeps Host persistence disabled on any page whose\n * location is not a loopback authority. `ctx.configForms.get(entryId)` — the\n * DSH 0.1.7 successor of `settingsScope.bind()` — then answers\n * `status: 'unavailable'` immediately and NEVER sends `settings.describe`\n * (`@deepseek-ai/dsh-client-ui-settings`: the persistence mode resolves from\n * `remote.$host.isLoopback` and pins a remote page to `memory`; every row it\n * backs is inert even though Connection authentication covers the API).\n *\n * The decision itself is one line in the official client:\n *\n * const persistence = ctx.remote.$host.isLoopback ? \"host\" : \"memory\"\n *\n * and `isLoopback` is true only for `localhost` / `[::1]` / `127.0.0.0/8` pages\n * (or a transport that declares `ownsHost`). A LAN page reached through a\n * forwarding plugin is therefore non-loopback even though the API answers and\n * the page is authenticated.\n *\n * This plugin's preferences — the sidebar toggle, the followed release channel\n * and the cache policy — live in the Host settings entry `dsh-update-status`, so\n * without a channel they all silently fall back to defaults on a LAN page (the\n * host's configured `channel` would be ignored, silently switching the followed\n * release line). This module speaks the SAME public Remote the official form\n * speaks (`settings.describe` / `settings.mutate`, the generated Typert face\n * mounted by `@deepseek-ai/dsh-api-remotes`) and derives the same per-namespace\n * snapshot shape, so the ONE shared Host document keeps serving every device.\n *\n * This channel is opened ONLY when the official form reports `unavailable`\n * (see `settingsChannel.ts`), so loopback pages keep the official path and pay\n * no extra wire read. Everything here is guarded: an absent Remote, a refused\n * read, or a malformed answer leaves the preferences exactly as unavailable as\n * they were before this channel existed.\n */\nimport type { SettingsPathOpLike, SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\n\n/** One namespace row of a `settings.describe` answer (the fields consumed here). */\nexport interface SettingsNamespaceViewLike {\n readonly ns: string\n readonly value: unknown\n readonly base?: unknown\n readonly user?: unknown\n readonly revision: number\n}\n\n/** The `settings.describe` answer body. */\nexport interface SettingsDescribeViewLike {\n readonly writable: boolean\n readonly hasDocument?: boolean\n readonly namespaces: readonly SettingsNamespaceViewLike[]\n}\n\n/** The Remote envelope every generated client call answers with. */\nexport type SettingsRemoteOutcome<T> =\n | { readonly ok: true; readonly value: T }\n | { readonly ok: false; readonly error?: { readonly code?: string; readonly message?: string } }\n\n/** The `remote.settings` namespace face (structural; never imported at runtime). */\nexport interface SettingsRemoteLike {\n describe(): Promise<SettingsRemoteOutcome<SettingsDescribeViewLike>>\n mutate(\n namespace: string,\n ops: readonly SettingsPathOpLike[],\n expectedRevision?: number,\n ): Promise<SettingsRemoteOutcome<SettingsNamespaceViewLike>>\n}\n\n/** A refused namespace write; `code` keeps the Host's own diagnosis. */\nexport class SettingsWriteFailure extends Error {\n readonly code: string\n\n constructor(code: string, message?: string) {\n super(message === undefined || message === '' ? code : message)\n this.name = 'SettingsWriteFailure'\n this.code = code\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n\n/**\n * Guard: does this value look like the `remote.settings` namespace face?\n * Applied to a bare service object (`ctx.get('remote.settings')` or a payload\n * member), and it never calls anything.\n */\nexport function settingsRemoteFace(value: unknown): SettingsRemoteLike | undefined {\n if (!isRecord(value)) return undefined\n if (typeof value.describe !== 'function' || typeof value.mutate !== 'function') return undefined\n return value as unknown as SettingsRemoteLike\n}\n\n/**\n * Guard: read the `remote.settings` face off an injection payload.\n *\n * The payload a `ctx.inject(['remote.settings'], …)` callback receives exposes\n * the LITERAL service key. Reading the dotted PARENT off that injected context\n * (`payload.remote`) throws `cannot get property \"remote\" without inject` — a\n * throw that used to abort a whole wiring callback on a LAN page. So the literal\n * key is read FIRST and every read is contained; the nested\n * (`payload.remote.settings`) shape is only a fallback for a plain object\n * payload. Both absence and refusal answer `undefined`.\n */\nexport function settingsRemoteOf(raw: unknown): SettingsRemoteLike | undefined {\n if (!isRecord(raw)) return undefined\n try {\n const direct = settingsRemoteFace((raw as Record<string, unknown>)['remote.settings'])\n if (direct !== undefined) return direct\n } catch {\n // Injected-context proxy refusal: fall through to the nested shape.\n }\n try {\n const remote = (raw as { remote?: unknown }).remote\n if (isRecord(remote)) return settingsRemoteFace(remote.settings)\n } catch {\n // Same refusal: no face is readable from this payload.\n }\n return undefined\n}\n\n/**\n * Guard: subscribe to the Host's settings-document invalidation on the Remote\n * service object (`remote.$on`). Returns undefined when the service exposes no\n * event seam — the preferences then refresh on reconnect only.\n */\nexport function settingsInvalidationsOf(service: unknown): ((listener: () => void) => () => void) | undefined {\n if (!isRecord(service)) return undefined\n const on = service.$on\n if (typeof on !== 'function') return undefined\n return (listener) => {\n const dispose = (on as (event: string, callback: () => void) => unknown)\n .call(service, 'settings/document-updated', listener)\n return typeof dispose === 'function' ? dispose as () => void : () => {}\n }\n}\n\n/** The channel consumers subscribe to, plus the refresh/dispose seams the client wires. */\nexport interface HostDirectScope extends SettingsScopeLike {\n /** Re-read the Host document; resolves after the snapshot reflects the answer. */\n load(): Promise<void>\n /** Drop every listener and stop accepting work. */\n dispose(): void\n /** Last Host error message (diagnostics only; never rendered as plugin state). */\n lastError(): string | undefined\n}\n\nfunction cloneOps(ops: readonly SettingsPathOpLike[]): SettingsPathOpLike[] {\n try {\n return structuredClone(ops) as SettingsPathOpLike[]\n } catch {\n // structuredClone absent/refusing the shape: copy by hand (the op payload is\n // plain JSON by contract, so a shallow structural copy is equivalent).\n return ops.map(op => (op.op === 'set'\n ? { op: 'set' as const, path: [...op.path], value: op.value }\n : { op: 'unset' as const, path: [...op.path] }))\n }\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction sameSnapshot(a: SettingsScopeSnapshotLike, b: SettingsScopeSnapshotLike): boolean {\n return a.status === b.status\n && a.revision === b.revision\n && a.writable === b.writable\n && a.mode === b.mode\n && a.value === b.value\n && a.base === b.base\n && a.user === b.user\n}\n\nfunction readySnapshot(\n row: SettingsNamespaceViewLike,\n writable: boolean,\n): SettingsScopeSnapshotLike {\n return {\n status: 'ready',\n // The raw section crosses this boundary untouched: PreferencesStore is the\n // plugin's own strict judge and reports a hand-edited or future-schema\n // document truthfully instead of silently dropping it.\n value: row.value,\n base: row.base,\n user: row.user,\n revision: row.revision,\n writable,\n mode: 'host',\n }\n}\n\nfunction unavailableSnapshot(writable: boolean): SettingsScopeSnapshotLike {\n return {\n status: 'unavailable',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable,\n mode: 'host',\n }\n}\n\n/**\n * Build the direct Host settings scope for one namespace.\n *\n * Snapshot semantics mirror the official per-namespace derivation: a namespace\n * row answers `ready` with the resolved section, its `base`/`user` layers and its\n * revision fence, and the document's `writable` decides editability. A row the\n * Host does not serve answers `unavailable`; a refused read keeps the last\n * confirmed document and reports `unavailable` only while it has never held one.\n *\n * Writes are serialized in issue order, fenced by the latest known revision and\n * REJECT with {@link SettingsWriteFailure} on a Host refusal — that rejection is\n * what makes the settings page surface a conflict instead of pretending the edit\n * landed (the official scope resolves on `!ok` after its recovery read).\n *\n * @param remote - the `remote.settings` face of the page's Remote service.\n * @param namespace - the settings namespace this scope derives from.\n * @returns the scope plus its load/dispose seams.\n */\nexport function createHostDirectScope(remote: SettingsRemoteLike, namespace: string): HostDirectScope {\n let snapshot: SettingsScopeSnapshotLike = {\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n mode: 'host',\n }\n let held: SettingsScopeSnapshotLike | undefined\n let error: string | undefined\n let disposed = false\n let tail: Promise<void> = Promise.resolve()\n const listeners = new Set<() => void>()\n\n const publish = (next: SettingsScopeSnapshotLike): void => {\n if (disposed || sameSnapshot(next, snapshot)) return\n snapshot = next\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A broken listener must never break the channel.\n }\n }\n }\n\n const adopt = (next: SettingsScopeSnapshotLike): void => {\n if (next.status === 'ready') held = next\n publish(next)\n }\n\n async function load(): Promise<void> {\n if (disposed) return\n let outcome: SettingsRemoteOutcome<SettingsDescribeViewLike>\n try {\n outcome = await remote.describe()\n } catch (caught) {\n outcome = { ok: false, error: { message: messageOf(caught) } }\n }\n if (disposed) return\n if (!outcome.ok) {\n error = outcome.error?.message ?? outcome.error?.code ?? 'settings/describe-failed'\n // A refused read never invents state: the last confirmed document stays\n // authoritative; without one the channel is unavailable.\n publish(held ?? unavailableSnapshot(snapshot.writable))\n return\n }\n error = undefined\n const view = outcome.value\n const writable = view.writable === true\n const row = Array.isArray(view.namespaces)\n ? view.namespaces.find(candidate => candidate.ns === namespace)\n : undefined\n if (row === undefined || typeof row.revision !== 'number') {\n publish(unavailableSnapshot(writable))\n return\n }\n adopt(readySnapshot(row, writable))\n }\n\n /** Fold one write answer's namespace row in without a second wire read. */\n function fold(row: SettingsNamespaceViewLike, writable: boolean): void {\n if (typeof row.revision !== 'number') return\n adopt(readySnapshot(row, writable))\n }\n\n function mutate(ops: readonly SettingsPathOpLike[], expectedRevision?: number): Promise<void> {\n const owned = cloneOps(ops)\n const run = tail.then(async () => {\n if (disposed) throw new SettingsWriteFailure('settings/unavailable')\n const revision = expectedRevision ?? snapshot.revision\n let outcome: SettingsRemoteOutcome<SettingsNamespaceViewLike>\n try {\n outcome = revision === undefined\n ? await remote.mutate(namespace, owned)\n : await remote.mutate(namespace, owned, revision)\n } catch (caught) {\n await load()\n throw new SettingsWriteFailure('settings/unreachable', messageOf(caught))\n }\n if (outcome.ok) {\n // A successful write proves the document accepts writes on this page.\n fold(outcome.value, true)\n return\n }\n await load()\n throw new SettingsWriteFailure(\n outcome.error?.code ?? 'settings/unknown',\n outcome.error?.message,\n )\n })\n // The queue never poisons itself: the caller sees the rejection, the next\n // queued write still runs.\n tail = run.then(() => undefined, () => undefined)\n return run\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n // The official scope implements `set` exactly this way; the revision fence\n // falls back to the latest known one, same as the official pendingRevision.\n set: (field, value) => mutate([{ op: 'set', path: [field], value }]),\n load,\n dispose() {\n disposed = true\n listeners.clear()\n },\n lastError: () => error,\n }\n}\n","/**\n * dsh-update-status — official settings-form adapter.\n *\n * DSH 0.1.7 removed the per-namespace `settingsScope` service this plugin's\n * client half was built on. Its successor is `ctx.configForms`\n * (`@deepseek-ai/dsh-client-ui-settings`): one shared `settings.describe`\n * mirror per browser plus a per-entry write queue, reached as\n * `ctx.configForms.get(entryId)` for the entry the plugin's Host half owns.\n * That form already answers the exact facts this plugin's own scope contract\n * needs — status, value, base, user, revision, writable, mode — so this module\n * only projects it onto {@link SettingsScopeLike} and leaves the existing\n * channel selection (`settingsChannel.ts`) in charge of the LAN fallback.\n *\n * Two deliberate translations:\n *\n * - A refused write (`set` answers `false`) becomes a REJECTION. The settings\n * page must surface a conflict instead of pretending the edit landed, which\n * is the same contract the direct Host channel already obeys\n * (`hostDirectScope.ts`). A transport fault rejects too.\n * - `mode` is what separates the two pages: DSH pins it to `memory` on a\n * non-loopback page, where the form is terminally `unavailable` and never\n * writes — exactly the state that hands the preferences to the direct Host\n * Remote so a phone still edits the one shared entry.\n *\n * The service is deliberately read structurally: the client bundle purity gate\n * forbids cross-plugin value imports, and the runtime object belongs to the\n * user's harness.\n */\nimport type { SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\nimport { SettingsWriteFailure } from './hostDirectScope.ts'\n\n/** One form snapshot as `ConfigForm.getSnapshot()` answers it. */\nexport interface ConfigFormSnapshotLike<T> {\n status: 'loading' | 'ready' | 'unavailable'\n value: T | undefined\n base: unknown\n user: unknown\n revision: number | undefined\n writable: boolean\n mode: 'host' | 'memory'\n}\n\n/** The subset of `ConfigForm<T>` this adapter reads. */\nexport interface ConfigFormLike<T = unknown> {\n getSnapshot(): ConfigFormSnapshotLike<T>\n subscribe(listener: () => void): () => void\n set(field: string, value: unknown): Promise<boolean>\n}\n\n/** The `ctx.configForms` binder face. */\nexport interface ConfigFormsFace {\n get<T>(entryId: string): ConfigFormLike<T>\n}\n\n/**\n * Guard: read the `configForms` face off an injection payload.\n *\n * The literal service key is read inside a `try`, because an injected payload\n * proxy can refuse a member read (the failure this plugin already hit on the\n * dotted `remote.settings` parent). Absence and refusal both answer\n * `undefined`, which leaves the channel on its direct Host path.\n *\n * @param raw - the payload a `ctx.inject(['configForms'], …)` callback received.\n * @returns the binder face, or undefined when this page has no settings forms.\n */\nexport function configFormsOf(raw: unknown): ConfigFormsFace | undefined {\n if (raw === null || typeof raw !== 'object') return undefined\n let face: unknown\n try {\n face = (raw as Record<string, unknown>)['configForms']\n } catch {\n return undefined\n }\n if (face === null || typeof face !== 'object') return undefined\n if (typeof (face as { get?: unknown }).get !== 'function') return undefined\n return face as ConfigFormsFace\n}\n\n/**\n * Project one official config form onto the plugin's settings-scope contract.\n *\n * @param form - the shared form for the plugin's own Loader entry id.\n * @returns a scope the preferences store and the channel selection can use as-is.\n */\nexport function configFormScope(form: ConfigFormLike): SettingsScopeLike {\n return {\n getSnapshot(): SettingsScopeSnapshotLike {\n const snapshot = form.getSnapshot()\n return {\n status: snapshot.status,\n value: snapshot.value as SettingsScopeSnapshotLike['value'],\n base: snapshot.base,\n user: snapshot.user,\n revision: snapshot.revision,\n writable: snapshot.writable,\n mode: snapshot.mode,\n }\n },\n subscribe(listener) {\n return form.subscribe(listener)\n },\n async set(field, value) {\n let accepted: boolean\n try {\n accepted = await form.set(field, value)\n } catch (error) {\n // Transport fault: the write did not land and the caller must not\n // pretend it did (the recovery read belongs to the form itself).\n throw new SettingsWriteFailure(\n 'settings/unreachable',\n error instanceof Error ? error.message : String(error),\n )\n }\n if (!accepted) {\n // Refused or skipped (memory mode, stale revision, Host validation):\n // the form has already re-read the authoritative value.\n throw new SettingsWriteFailure('settings/conflict')\n }\n },\n }\n}\n","/**\n * dsh-update-status — settings source selection.\n *\n * The plugin's ONE storage contract is the Host settings entry\n * `dsh-update-status`. Two client channels can serve it:\n *\n * 1. the official `ctx.configForms` form (loopback pages) — the DSH 0.1.7\n * successor of the removed `settingsScope` service, and\n * 2. the direct Host channel (`hostDirectScope.ts`), which exists exactly\n * because the official form is deliberately inert on a non-loopback page —\n * the LAN page a phone uses.\n *\n * This module picks between them without ever guessing:\n *\n * - The official form wins whenever it is not `unavailable`, so a loopback page\n * keeps the official semantics (the one shared describe mirror, the official\n * write queue and revision fences) and pays NO extra wire read.\n * - Only when the official form reports `unavailable` (the documented\n * non-loopback degradation: it is pinned to `memory` mode there and never\n * crosses the wire) is the direct channel opened, lazily and once.\n * - With neither source the channel stays `loading`, i.e. exactly the state this\n * plugin had before the direct channel existed.\n */\nimport type { SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\n\n/** Snapshot used while no channel has answered yet. */\nconst LOADING_SNAPSHOT: SettingsScopeSnapshotLike = Object.freeze({\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n mode: 'host',\n}) as SettingsScopeSnapshotLike\n\nexport interface SettingsChannelOptions {\n /**\n * Build the direct Host channel. Called at most once, and only when the\n * official scope cannot serve this page. Returning `undefined` (the Remote\n * service is not composed) leaves the channel on the official/unavailable\n * path; a later {@link SettingsChannel.refresh} retries.\n */\n openDirect(): SettingsScopeLike | undefined\n}\n\nexport interface SettingsChannel extends SettingsScopeLike {\n /** Point the channel at the official form once the service answers. */\n setOfficial(scope: SettingsScopeLike | undefined): void\n /** Re-evaluate the selection (e.g. the Remote service just arrived). */\n refresh(): void\n /** Ask the active source for a fresh read (no-op for the official form). */\n reload(): void\n dispose(): void\n}\n\nfunction sameSnapshot(a: SettingsScopeSnapshotLike, b: SettingsScopeSnapshotLike): boolean {\n return a.status === b.status\n && a.revision === b.revision\n && a.writable === b.writable\n && a.mode === b.mode\n && a.value === b.value\n && a.base === b.base\n && a.user === b.user\n}\n\n/** The load seam a direct channel exposes (the official scope refreshes itself). */\ntype LoadableScope = SettingsScopeLike & { load?: () => Promise<void> }\n\n/** Ask a channel for its first/next read; a refusal surfaces as a snapshot, never a throw. */\nfunction loadSource(source: SettingsScopeLike | undefined): Promise<void> {\n const loadable = source as LoadableScope | undefined\n if (loadable === undefined || typeof loadable.load !== 'function') return Promise.resolve()\n return Promise.resolve(loadable.load()).then(() => undefined, () => undefined)\n}\n\nexport function createSettingsChannel(options: SettingsChannelOptions): SettingsChannel {\n let official: SettingsScopeLike | undefined\n let direct: SettingsScopeLike | undefined\n let active: SettingsScopeLike | undefined\n let snapshot: SettingsScopeSnapshotLike = LOADING_SNAPSHOT\n let disposed = false\n const disposers: Array<() => void> = []\n const listeners = new Set<() => void>()\n\n const notify = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A broken listener must never break the channel.\n }\n }\n }\n\n const publish = (next: SettingsScopeSnapshotLike): void => {\n if (disposed || sameSnapshot(next, snapshot)) return\n snapshot = next\n notify()\n }\n\n const select = (): SettingsScopeLike | undefined => {\n // The official scope is authoritative unless it reports the documented\n // non-loopback degradation.\n if (official !== undefined && official.getSnapshot().status !== 'unavailable') return official\n if (direct === undefined) {\n try {\n direct = options.openDirect()\n } catch {\n direct = undefined\n }\n if (direct !== undefined) {\n try {\n disposers.push(direct.subscribe(() => {\n if (active === direct) publish(direct!.getSnapshot())\n }))\n } catch {\n // An unsubscribable direct channel is still readable synchronously.\n }\n // The direct channel has no owner to `ensure()` it (the official scope is\n // ensured by its own plugin), so the initial read is issued here.\n void loadSource(direct)\n }\n }\n return direct ?? official\n }\n\n const reselect = (): void => {\n if (disposed) return\n const next = select()\n if (next !== active) {\n active = next\n publish(next?.getSnapshot() ?? LOADING_SNAPSHOT)\n return\n }\n // Same source: forward its current snapshot (a change must have come from it).\n publish(next?.getSnapshot() ?? LOADING_SNAPSHOT)\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n set(field, value) {\n const source = active\n if (source === undefined) {\n return Promise.reject(new Error('dsh-update-status: settings channel is unavailable'))\n }\n return source.set(field, value)\n },\n setOfficial(scope) {\n if (disposed) return\n official = scope\n if (scope !== undefined) {\n try {\n disposers.push(scope.subscribe(() => {\n reselect()\n }))\n } catch {\n // Guarded read path: selection still happens synchronously below.\n }\n }\n reselect()\n },\n refresh: reselect,\n reload() {\n if (active === undefined || active === official) return\n void loadSource(active)\n },\n dispose() {\n disposed = true\n listeners.clear()\n for (const dispose of disposers.splice(0)) {\n try {\n dispose()\n } catch {\n // Contained.\n }\n }\n const disposable = active as (SettingsScopeLike & { dispose?: () => void }) | undefined\n if (disposable !== undefined && typeof disposable.dispose === 'function') {\n try {\n disposable.dispose()\n } catch {\n // Contained.\n }\n }\n },\n }\n}\n","/** Plugin-owned CSS only; no shell DOM selection or official SVG manipulation. */\n\nexport const UPDATE_STATUS_CSS = `\n.dus-brand-name{align-items:center;gap:6px;height:24px;max-width:100%;min-width:0;display:inline-flex}\n.dus-brand-deepseek{font-size:14px;font-weight:650;letter-spacing:-.015em;line-height:24px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n/* The chip is a NEUTRAL SECOND-LEVEL SURFACE, never a high-contrast pill. It used\n to be label-primary + label-primary-inverted, which is a near-white box with dark\n text on the dark shell — a white frame that swallows the amber halo and fights the\n warn colour. --dsw-alias-button-floating-hover is the one palette surface that is\n grey in BOTH themes (#f1f3f5 light / #353638 dark), matching the reference: a light\n grey chip on the light shell, a dark grey chip with white text on the dark one. The\n sibling button-floating-fill is pure white in light mode and changes nothing there.\n Text stays label-primary (#0f1115 light / #f9fafb dark), so it is never low-contrast.\n Every colour here is a theme token, so the chip follows whatever appearance DSH\n resolves — light, dark, or system-follows-the-OS — with no plugin-side detection,\n no media query and no per-theme branch to keep in sync. */\n.dus-badge{--dus-badge-surface:var(--dsw-alias-button-floating-hover,#f1f3f5);align-items:center;background:var(--dus-badge-surface);border:0;border-radius:4px;color:var(--dsw-alias-label-primary,#0f1115);cursor:pointer;display:inline-flex;flex:none;font-family:var(--ds-font-family-code,var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace));font-size:10px;font-variant-numeric:tabular-nums;font-weight:600;gap:4px;height:16px;line-height:16px;max-width:140px;outline:none;padding:0 6px;touch-action:manipulation;user-select:none;white-space:nowrap}\n.dus-badge:focus-visible,.dus-action:focus-visible,.dus-close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n/* Hover has to read as \"raised\" in BOTH themes. brightness() only ever brightens, and on\n the light shell it turns the grey chip pure white — the chip all but disappears. Mixing\n a little of the theme's own label colour into the surface darkens it in light mode and\n lightens it in dark mode, so one declaration stays correct in both. The brightness\n filter remains the fallback: an engine without color-mix drops only the second\n declaration, never the whole hover rule. */\n.dus-badge:hover{filter:brightness(1.08)}\n@supports (background:color-mix(in srgb,red 50%,transparent)){.dus-badge:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary) 8%,var(--dus-badge-surface));filter:none}}\n/* The failure state is the one deliberate repaint, and it follows the shell's own\n badge pattern (brokenBadge): error fill with a bg-layer-3 label, which is white\n text on the dark red of the light theme and dark text on the light red of the dark\n theme — readable in both, unlike the fixed white text it replaces. */\n.dus-badge[data-error=true]{background:var(--dsw-alias-state-error-primary,#dc2626);color:var(--dsw-alias-bg-layer-3,#fff)}\n.dus-badge-version{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dus-dot{background:currentColor;border-radius:50%;display:inline-block;flex:0 0 auto;height:5px;opacity:.9;width:5px}\n/* An available update repaints NOTHING: the chip keeps its normal fill and only\n the amber dot breathes. The halo is animated with the dot so the glow grows\n and shrinks as one light, never as a separate ripple. The update state is\n declared AFTER the loading state, so a re-check on a known update keeps the\n amber glow instead of falling back to the neutral loading pulse.\n Each box-shadow is declared twice: a literal amber first for any engine\n without color-mix, then the halo mixed from the theme's own warn colour so the\n glow always matches the dot in both light and dark themes. */\n/* The dot carries the whole status. Three states, in precedence order:\n up to date = a plain green circle (success token, never the text colour, so a\n dark theme no longer paints a black dot that reads as \"off\"); checking = the\n neutral grey pulse; a pending update = the amber dot below, which is the only\n state allowed to breathe or glow.\n The up-to-date rule is declared BEFORE loading and update: equal specificity, so\n the later, louder states win if two ever land on the same dot. */\n.dus-dot[data-state=current]{background:var(--dsw-alias-state-success-primary,#22c55e);opacity:1}\n.dus-dot[data-loading=true]{animation:dus-pulse .9s ease-in-out infinite}\n.dus-dot[data-update=true]{--dus-update-color:var(--dsw-alias-state-warn-primary,#f59e0b);animation:dus-update-pulse 1.6s ease-in-out infinite;background:var(--dus-update-color);height:6px;opacity:1;width:6px}\n@keyframes dus-pulse{0%,100%{opacity:.45;transform:scale(.82)}50%{opacity:1;transform:scale(1.15)}}\n@keyframes dus-update-pulse{0%,100%{box-shadow:0 0 2px 0 rgba(245,158,11,.4);box-shadow:0 0 2px 0 color-mix(in srgb,var(--dus-update-color) 45%,transparent);transform:scale(.8)}50%{box-shadow:0 0 7px 2px rgba(245,158,11,.72);box-shadow:0 0 7px 2px color-mix(in srgb,var(--dus-update-color) 72%,transparent);transform:scale(1.15)}}\n@media (prefers-reduced-motion:reduce){.dus-dot[data-update=true],.dus-dot[data-loading=true]{animation:none}.dus-dot[data-update=true]{box-shadow:0 0 5px 1px rgba(245,158,11,.6);box-shadow:0 0 5px 1px color-mix(in srgb,var(--dus-update-color) 62%,transparent)}}\n.dus-overlay-root{background:transparent;border:0;color:inherit;height:100dvh;inset:0;margin:0;max-height:none;max-width:none;padding:0;pointer-events:none;position:fixed;width:100vw}\n.dus-overlay-root::backdrop{background:transparent}\n.dus-backdrop{background:transparent;inset:0;pointer-events:auto;position:absolute}\n.dus-panel{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:var(--dsw-elevation-panel);box-sizing:border-box;color:var(--dsw-alias-label-primary);left:min(292px,calc(100vw - 402px));max-height:min(640px,calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overflow:auto;padding:14px;pointer-events:auto;position:absolute;top:12px;width:min(390px,calc(100vw - 24px));z-index:1}\n.dus-panel-head{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:12px}\n.dus-panel-title{font-size:14px;font-weight:650}\n.dus-close{align-items:center;background:transparent;border:0;border-radius:8px;color:inherit;cursor:pointer;display:inline-flex;font-size:20px;height:32px;justify-content:center;line-height:1;min-height:32px;min-width:32px;padding:0;touch-action:manipulation;width:32px}\n.dus-close:hover,.dus-action:hover{background:var(--dsw-alias-button-floating-hover)}\n.dus-cache-setting{border:1px solid var(--dsw-alias-border-l2);border-radius:9px;margin:0 0 12px;padding:9px}\n.dus-cache-field{align-items:center;display:flex;font-size:12px;font-weight:600;gap:10px;justify-content:space-between}\n.dus-cache-input-wrap{align-items:center;display:flex;gap:6px;font-size:11px;font-weight:400}\n.dus-cache-input{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:inherit;font:inherit;min-height:30px;padding:0 7px;text-align:right;width:72px}\n.dus-cache-input:focus{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-cache-input:disabled{cursor:not-allowed;opacity:.55}\n.dus-cache-hint{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.4;margin:7px 0 0}\n.dus-state{border-radius:9px;color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.45;margin:0 0 12px;padding:8px 9px}\n.dus-state[data-kind=update],.dus-state[data-kind=warning]{background:var(--dsw-alias-state-warn-tertiary)}\n.dus-state[data-kind=ok]{background:var(--dsw-alias-state-success-tertiary)}\n.dus-state[data-kind=error]{background:var(--dsw-alias-bg-layer-3)}\n.dus-metadata{display:grid;gap:9px;margin:0 0 12px}\n.dus-metadata-row{align-items:baseline;display:grid;gap:8px;grid-template-columns:minmax(0,1fr) auto}\n.dus-meta-label{color:var(--dsw-alias-label-secondary);font-size:12px}\n.dus-meta-value{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;max-width:210px;overflow-wrap:anywhere;text-align:right}\n.dus-meta-sub{color:var(--dsw-alias-label-secondary);font-size:11px;grid-column:1 / -1}\n/* One card per upgradable version. Every value here is a theme token, so the\n cards follow light, dark and OS-following appearances with no plugin-side\n detection; only the highest version's border changes, because \"newest\" is the\n single fact that must survive a glance at a multi-card list. */\n.dus-releases{display:grid;gap:9px;margin:0 0 12px}\n.dus-release{background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:9px}\n.dus-release[data-highlight=true]{border-color:var(--dsw-alias-state-warn-primary)}\n.dus-release-head{align-items:center;display:flex;flex-wrap:wrap;gap:6px}\n.dus-release-version{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;font-weight:650;overflow-wrap:anywhere}\n.dus-release-meta{align-items:baseline;color:var(--dsw-alias-label-secondary);display:flex;flex-wrap:wrap;font-size:11px;gap:2px 8px;line-height:1.45;margin:5px 0 0}\n.dus-release-line{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-variant-numeric:tabular-nums}\n.dus-pill{border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-secondary);font-size:10px;line-height:16px;padding:0 6px;white-space:nowrap}\n.dus-pill-latest{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);font-weight:600}\n.dus-guidance{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:0 0 12px}\n.dus-warning{border-left:2px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:0 0 12px;padding-left:8px}\n.dus-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}\n.dus-action{background:var(--dsw-alias-button-floating-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;color:inherit;cursor:pointer;font-size:12px;line-height:30px;min-height:32px;padding:0 10px;touch-action:manipulation}\n.dus-action:disabled{cursor:wait;opacity:.65}\n.dus-restart{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}\n.dus-restart-message{color:var(--dsw-alias-label-secondary);flex-basis:100%;font-size:11px;line-height:1.45;margin:0}\n.dus-restart-work{color:var(--dsw-alias-label-secondary);flex-basis:100%;font-size:11px;line-height:1.5;margin:0;overflow-wrap:anywhere;padding-left:18px}\n/* A job label is a whole shell command: clamp it so one long command cannot push\n the panel's buttons off a 390px card. */\n.dus-restart-work li{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}\n/* Recovery steps live under the disabled button and take their own row, like the\n active-work list: the instruction, the copyable commands, then the no-op note. */\n.dus-restart-recover{flex-basis:100%}\n.dus-command-label{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;margin:0 0 6px}\n.dus-command{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:block;font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:11px;line-height:1.5;margin:0;overflow-wrap:anywhere;padding:9px;tab-size:2;user-select:text;white-space:pre-wrap}\n.dus-command:focus{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-note{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.45;margin:8px 0 0}\n.dus-copy-message{color:var(--dsw-alias-state-business-primary);font-size:11px;margin:7px 0 0}\n.dus-command-actions{align-items:center;margin:8px 0 0}\n@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:0;left:0;right:0;max-height:min(78dvh,calc(100dvh - env(safe-area-inset-top)));padding:16px max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));position:fixed;top:auto;width:100vw}.dus-action{min-height:40px;line-height:38px}.dus-close{height:40px;min-height:40px;min-width:40px;width:40px}}\n`\n","/**\n * DSH Web client half. It shadows only `sidebar.brand.name` with a compact\n * name + version chip that fits the 24px brand row and leaves the official fish\n * (`sidebar.brand.mark`) untouched. The detail panel is an additive\n * `shell.overlay`, never a chat-area floating widget.\n *\n * Deliberately NO `sidebar.footer.action` entry. DSH renders that list in one\n * row directly above `sidebar.settings`, and the collapsed rail's content box is\n * only 36px wide (the 56px column minus its 10px inline padding) — room for the\n * single official action. A second registrant makes that shared, centred row\n * overflow: on a phone it pushed the neighbouring plugin's entry off the screen\n * edge and parked our own dot on the rail's border. The chip in the expanded\n * brand row is the entry, so a collapsed sidebar carries none.\n *\n * The status read and the detail panel are NOT restricted to a loopback page.\n * DSH disables Host settings *persistence* on a non-loopback page, but the\n * Connection RPC stays authenticated and reachable there — see\n * settings/settingsChannel.ts for the one place the loopback distinction still\n * matters.\n *\n * Preferences live in the Host-side `dsh-update-status` settings entry — the\n * plugin's own Loader entry, whose volatile `Config` fields DSH 0.1.7 projects\n * as that entry's form. Two client channels can serve it: the official\n * `ctx.configForms.get(entryId)` form (the successor of the removed\n * `settingsScope` service) and, on the non-loopback pages where that form is\n * deliberately inert, a direct Host channel over `remote.settings`. See\n * settingsChannel.ts.\n */\n\nimport type { ClientContext, ConnectionClient } from './contract.ts'\nimport { BrandName, type SharedUi, UpdatePanel } from './components.tsx'\nimport { SETTINGS_NAMESPACE, PanelStore, PreferencesStore, RestartStore, StatusStore } from './stores.ts'\nimport { configFormScope, configFormsOf } from './settings/configFormScope.ts'\nimport {\n createHostDirectScope,\n settingsInvalidationsOf,\n settingsRemoteFace,\n settingsRemoteOf,\n type SettingsRemoteLike,\n} from './settings/hostDirectScope.ts'\nimport { createSettingsChannel } from './settings/settingsChannel.ts'\nimport { UPDATE_STATUS_CSS } from './styles.ts'\n\nconst PLUGIN_ID = 'dsh-update-status'\nconst CSS_TAG_ID = `${PLUGIN_ID}/styles`\n\nfunction installStyles(): () => void {\n if (typeof document === 'undefined') return () => {}\n const existing = document.querySelector(`style[data-plugin-css=\"${CSS_TAG_ID}\"]`)\n if (existing !== null) return () => {}\n const tag = document.createElement('style')\n tag.dataset.plugin = PLUGIN_ID\n tag.dataset.pluginCss = CSS_TAG_ID\n tag.textContent = UPDATE_STATUS_CSS\n document.head.appendChild(tag)\n return () => {\n const live = document.querySelector(`style[data-plugin-css=\"${CSS_TAG_ID}\"]`)\n if (live?.parentNode !== undefined && live?.parentNode !== null) live.parentNode.removeChild(live)\n }\n}\n\nfunction connectionOf(ctx: ClientContext): ConnectionClient {\n try {\n const candidate = ctx.get('connection')\n return candidate !== null && typeof candidate === 'object' ? candidate as ConnectionClient : {}\n } catch {\n return {}\n }\n}\n\nfunction apply(ctx: ClientContext): void {\n const connection = connectionOf(ctx)\n const status = new StatusStore(connection)\n const preferences = new PreferencesStore()\n const panel = new PanelStore()\n const restart = new RestartStore(connection)\n const ui: SharedUi = { status, preferences, panel, restart }\n\n const disposers: Array<() => void> = []\n let stopped = false\n /** Own a subscription raised from an injection callback; release after teardown at once. */\n const own = (dispose: unknown): void => {\n if (typeof dispose !== 'function') return\n if (stopped) {\n try {\n (dispose as () => void)()\n } catch {\n // Contained.\n }\n return\n }\n disposers.push(dispose as () => void)\n }\n\n // The plugin's ONE storage contract is the Host settings entry\n // `dsh-update-status` (the plugin's own Loader entry id), but two client\n // channels can serve it: the official `configForms` form (loopback pages) and\n // — only when that form reports the documented non-loopback degradation — a\n // direct Host channel over the same public Remote. A LAN page is exactly that\n // non-loopback case; without the direct channel every preference silently\n // falls back to its default there. See settingsChannel.ts.\n let remoteSettings: SettingsRemoteLike | undefined\n /** Resolve the direct channel's Remote face; `ctx.get` covers a payload we could not read. */\n const directRemote = (): SettingsRemoteLike | undefined => {\n if (remoteSettings !== undefined) return remoteSettings\n try {\n remoteSettings = settingsRemoteFace(ctx.get('remote.settings'))\n } catch {\n // The dotted service key is not readable on this context.\n }\n return remoteSettings\n }\n const channel = createSettingsChannel({\n openDirect: () => {\n const remote = directRemote()\n return remote === undefined ? undefined : createHostDirectScope(remote, SETTINGS_NAMESPACE)\n },\n })\n\n ctx.effect(() => {\n const disposeStyles = installStyles()\n const detach = preferences.attach(channel)\n // The mount read uses the cache policy the profile stored. The settings\n // document usually arrives one tick after the effect, so the first\n // authoritative value issues that read; later edits deliberately do not —\n // changing the duration never starts a request of its own. A profile that\n // stores the default policy costs no second read.\n let usedCacheTtl = preferences.getSnapshot().cacheTtlMinutes\n let storedPolicyApplied = false\n const applyStoredPolicyOnce = () => {\n if (storedPolicyApplied) return\n const snapshot = preferences.getSnapshot()\n if (snapshot.status === 'loading') return\n storedPolicyApplied = true\n if (snapshot.cacheTtlMinutes === usedCacheTtl) return\n usedCacheTtl = snapshot.cacheTtlMinutes\n void status.reload(snapshot.cacheTtlMinutes)\n }\n applyStoredPolicyOnce()\n const unsubscribe = preferences.subscribe(applyStoredPolicyOnce)\n // Every mount reads the Host's cached status, whichever page it is on; the\n // transport is authenticated and the Host route is the plugin's own. There is\n // no channel to project: the Host always answers with the newest release.\n void status.load(preferences.getSnapshot().cacheTtlMinutes)\n return () => {\n stopped = true\n unsubscribe()\n detach()\n for (const dispose of disposers.splice(0)) {\n try {\n dispose()\n } catch {\n // Contained.\n }\n }\n channel.dispose()\n restart.stop()\n status.stop()\n disposeStyles()\n }\n }, 'dsh-update-status: styles, settings channel and first status read')\n\n // Official seam first: it stays authoritative whenever it is not `unavailable`,\n // so a loopback page keeps the official semantics (one shared describe mirror,\n // the official write queue) and pays no extra wire read. DSH 0.1.7 replaced\n // the per-namespace `settingsScope` service with these entry-addressed forms,\n // keyed by the Loader entry id the Host Config half owns (SETTINGS_NAMESPACE).\n try {\n ctx.inject(['configForms'], (raw: unknown) => {\n try {\n const forms = configFormsOf(raw)\n if (forms === undefined) return\n channel.setOfficial(configFormScope(forms.get<unknown>(SETTINGS_NAMESPACE)))\n } catch {\n // Unreadable settings seam: the preferences stay on their defaults.\n }\n })\n } catch {\n // No configForms seam on this host: the direct channel is the only hope.\n }\n\n // Direct Host channel. The Remote service can arrive before or after the\n // official scope, so `refresh()` re-evaluates the selection either way; the\n // document invalidation keeps this page in step with edits made elsewhere,\n // and a reconnect retries a read that was refused.\n //\n // Every read here is contained: the injected payload intentionally refuses the\n // dotted PARENT (`payload.remote` throws \"cannot get property … without\n // inject\"), so one unreadable member must never abort the whole wiring.\n try {\n ctx.inject(['remote.settings'], (raw: unknown) => {\n try {\n remoteSettings = settingsRemoteOf(raw) ?? remoteSettings\n channel.refresh()\n const invalidations = settingsInvalidationsOf(ctx.get('remote'))\n if (invalidations !== undefined) own(invalidations(() => channel.reload()))\n } catch {\n // No usable Remote seam: the direct channel stays closed and the official\n // scope keeps its verdict.\n }\n })\n } catch {\n // No Remote seam: non-loopback pages keep the honest unavailable state.\n }\n if (typeof ctx.on === 'function') {\n try {\n own(ctx.on('connection/reset', () => { channel.reload(); void restart.refresh() }))\n } catch {\n // No lifecycle event seam on this host.\n }\n }\n\n // Single slot: a compact name + version chip shadows the official wordmark\n // (priority 0). Lowest priority renders; never touch sidebar.brand.mark.\n //\n // The registration itself is conditional, and that is not a detail: a single\n // slot arbitrates by PRIORITY, not by what the component renders. A component\n // that returns null still OCCUPIES the cell, so the official occupant\n // (@deepseek-ai/dsh-client-ui-brand-official) and the shell's own fallback can\n // never come back. Turning the preference off therefore disposes our entry —\n // the previous winner leaves the ledger and the next-lowest occupant renders\n // again — and turning it back on registers a fresh one.\n ctx.slots.inject('sidebar.brand.name', () => {\n let registration: (() => void) | undefined\n const syncRegistration = (): void => {\n const enabled = preferences.getSnapshot().sidebarEnabled\n if (enabled && registration === undefined) {\n registration = ctx.slots.register({ name: 'sidebar.brand.name', priority: -10 }, () => BrandName({ ui }))\n } else if (!enabled && registration !== undefined) {\n registration()\n registration = undefined\n }\n }\n syncRegistration()\n const unsubscribe = preferences.subscribe(syncRegistration)\n return () => {\n unsubscribe()\n registration?.()\n registration = undefined\n }\n })\n\n // additive frame overlay for click/tap panel and narrow-view bottom sheet.\n ctx.slots.inject('shell.overlay', () => ctx.slots.register(\n { name: 'shell.overlay', id: 'dsh-update-status', order: 40 },\n () => UpdatePanel({ ui }),\n ))\n}\n\nmodule.exports = {\n name: PLUGIN_ID,\n inject: ['slots', 'connection'],\n apply,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAwBA,SAAgB,cAAc,QAAsC;GAClE,IAAI,WAAW,MAAM,OAAO;GAC5B,IAAI,OAAO,gBAAgB,KAAA,GAAW,OAAO,OAAO,YAAY;GAChE,OAAO,OAAO,gBAAgB;EAChC;EAEA,SAAgB,YAAY,QAA6B,SAAkB,OAAmC;GAC5G,IAAI,SAAS,OAAO;GACpB,IAAI,UAAU,QAAQ,cAAc,MAAM,GAAG,OAAO,QAAQ,cAAc,OAAO,WAAW;GAC5F,OAAO,QAAQ,cAAc,OAAO,WAAW;EACjD;;;;;;;;;;;;;;;;ECpBA,MAAaA,cAAY;;EAGzB,MAAa,wBAAwB;EAIrC,MAAa,wBAAwB;EAErC,SAAgB,kBAAkB,OAAiC;GACjE,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KACrD,SAAA,MAAkC,SAAA;EACzC;EAEA,MAAa,mBAAmB;GAC9B,WAAW;GACX,aAAa;EACf;;EAGA,MAAa,oBAAoB;GAC/B,QAAQ;GACR,OAAO;GACP,SAAS;EACX;;;EC9BA,MAAM,aAAoC;GACxC,gBAAgB;IAAE,IAAI;IAAY,IAAI;GAAqB;GAC3D,kBAAkB;IAAE,IAAI;IAAU,IAAI;GAAmB;GACzD,gBAAgB;IAAE,IAAI;IAAS,IAAI;GAAmB;GACtD,iBAAiB;IAAE,IAAI;IAAe,I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C;GACH,QAAQ,CAER;GACA,IAAI,OAAO,IAAI,OAAO,YACpB,IAAI;IACF,IAAI,IAAI,GAAG,0BAA0B;KAAE,QAAQ,OAAO;KAAG,QAAa,QAAQ;IAAE,CAAC,CAAC;GACpF,QAAQ,CAER;GAaF,IAAI,MAAM,OAAO,4BAA4B;IAC3C,IAAI;IACJ,MAAM,yBAA+B;KACnC,MAAM,UAAU,YAAY,YAAY,CAAC,CAAC;KAC1C,IAAI,WAAW,iBAAiB,KAAA,GAC9B,eAAe,IAAI,MAAM,SAAS;MAAE,MAAM;MAAsB,UAAU;KAAI,SAAS,UAAU,EAAE,GAAG,CAAC,CAAC;UACnG,IAAI,CAAC,WAAW,iBAAiB,KAAA,GAAW;MACjD,aAAa;MACb,eAAe,KAAA;KACjB;IACF;IACA,iBAAiB;IACjB,MAAM,cAAc,YAAY,UAAU,gBAAgB;IAC1D,aAAa;KACX,YAAY;KACZ,eAAe;KACf,eAAe,KAAA;IACjB;GACF,CAAC;GAGD,IAAI,MAAM,OAAO,uBAAuB,IAAI,MAAM,SAChD;IAAE,MAAM;IAAiB,IAAI;IAAqB,OAAO;GAAG,SACtD,YAAY,EAAE,GAAG,CAAC,CAC1B,CAAC;EACH;EAEA,OAAO,UAAU;GACf,MAAM;GACN,QAAQ,CAAC,SAAS,YAAY;GAC9B;EACF"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["PLUGIN_ID","PLUGIN_ID","sameSnapshot"],"sources":["../src/shared/visual-state.ts","../src/shared/types.ts","../src/client/i18n.ts","../src/client/react.ts","../src/client/components.tsx","../src/client/contract.ts","../src/client/stores.ts","../src/client/settings/hostDirectScope.ts","../src/client/settings/configFormScope.ts","../src/client/settings/settingsChannel.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["/**\n * The single place that decides which visual state the sidebar chip is in.\n *\n * It lives in `shared` rather than inside the component so the decision is a pure\n * function that a test can drive directly: the regression this guards against is\n * exactly a state-classification mistake, and it was invisible to every test while\n * it sat inside TSX.\n */\nimport type { UpdateStatus } from './types.ts'\n\nexport type VisualState = 'loading' | 'update' | 'current' | 'problem'\n\n/**\n * Only a read the plugin could not complete is a chip-level problem.\n *\n * An advisory notice — a preview channel this bundle has not been verified against,\n * say — leaves the chip surface alone and belongs in the panel. Repainting the brand\n * row for a plugin-side bookkeeping fact is the surprise the breathing dot replaced:\n * an operator who upgrades DSH ahead of this bundle must not watch the chip turn red.\n *\n * A Host older than `warningKind` sends no field at all; `undefined` then keeps the\n * previous behaviour (any warning is a problem) rather than silently dropping a real\n * failure on the floor.\n */\nexport function isChipProblem(status: UpdateStatus | null): boolean {\n if (status === null) return false\n if (status.warningKind === undefined) return status.warning !== null\n return status.warningKind === 'failure'\n}\n\nexport function visualState(status: UpdateStatus | null, loading: boolean, error: string | null): VisualState {\n if (loading) return 'loading'\n if (error !== null || isChipProblem(status)) return status?.hasUpdate === true ? 'update' : 'problem'\n return status?.hasUpdate === true ? 'update' : 'current'\n}\n","/**\n * JSON-only contract shared by the Host and Web halves.\n *\n * The static package uses the authenticated Connection RPC channel because\n * `harness.handle` / `host.call` are dynamic-Cordis-only closure APIs. The\n * endpoint vocabulary remains deliberately small and private to this plugin\n * channel.\n *\n * There is ONE release line, not a channel catalogue: the Host reports the\n * newest version the npm registry publishes under any dist-tag, and the client\n * compares it with the running version. `latest`, `next` and `alpha` are npm's\n * bookkeeping, not a user choice this plugin asks anyone to make.\n */\n\nexport const PLUGIN_ID = 'dsh-update-status'\nexport const PACKAGE_NAME = '@deepseek-ai/dsh'\n/** Shared Connection RPC channel. Custom prefixes 405 on the SPA fallback. */\nexport const UPDATE_STATUS_CHANNEL = '/api'\nexport const RELEASES_URL = 'https://github.com/deepseek-ai/deepseek-harness/releases'\nexport const DEFAULT_CACHE_TTL_MINUTES = 360\nexport const MIN_CACHE_TTL_MINUTES = 30\nexport const MAX_CACHE_TTL_MINUTES = 1_440\n\nexport function isCacheTtlMinutes(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value)\n && value >= MIN_CACHE_TTL_MINUTES && value <= MAX_CACHE_TTL_MINUTES\n}\n\nexport const UPDATE_ENDPOINTS = {\n getStatus: 'dsh-update-status.get-status',\n checkUpdate: 'dsh-update-status.check-update',\n} as const\n\n/** Restart RPC remains on the same authenticated Connection `/api` channel. */\nexport const RESTART_ENDPOINTS = {\n status: 'dsh-update-status.restart-status',\n check: 'dsh-update-status.restart-check',\n request: 'dsh-update-status.restart',\n} as const\n\nexport type UpdateEndpoint = (typeof UPDATE_ENDPOINTS)[keyof typeof UPDATE_ENDPOINTS]\nexport type RestartEndpoint = (typeof RESTART_ENDPOINTS)[keyof typeof RESTART_ENDPOINTS]\n/**\n * Severity of `warning`, so a surface can tell \"the plugin could not determine\n * the update state\" from \"here is something worth knowing\".\n *\n * - `failure`: no usable answer — a failed registry read, or a version SemVer\n * cannot compare. This is what justifies repainting the sidebar chip.\n * - `notice`: the answer is complete and usable; the text is advisory, e.g. the\n * Host resolved a stale copy of a shared library. The chip must NOT repaint for\n * this — an operator upgrading DSH ahead of the plugin would otherwise see the\n * chip turn red for a plugin-side bookkeeping fact.\n *\n * Optional on purpose: a Host older than this field leaves it `undefined`, and\n * the client then falls back to treating any warning as a failure.\n */\nexport type UpdateWarningKind = 'failure' | 'notice'\nexport type InstallKind = 'npm-global' | 'pnpm-global' | 'source-checkout' | 'unknown'\n\n/** Language-neutral warning facts; the browser renders them in its own locale. */\nexport type UpdateWarning =\n | { code: 'registry-unavailable'; detail: string }\n | { code: 'version-incomparable'; currentVersion: string; latestVersion: string }\n /**\n * The Host resolved a `@deepseek-ai/schemastery` that DSH does not ship, so the\n * Loader's volatile projection is unavailable and the preference fields cannot\n * be marked volatile. Advisory: the version answer itself is complete, and the\n * text carries the exact directory to remove. See `host/schemastery.ts`.\n */\n | { code: 'stale-schemastery'; version: string | null; path: string; nodeModulesDir: string | null }\n\n/**\n * One published version that is newer than the running one.\n *\n * The plugin's only job is to say \"a newer version exists, here is how to get\n * it\", so a candidate carries the version, the npm dist-tag that publishes it,\n * when it was published, its release line, and a copy-only command when the\n * detected installation kind actually accepts one.\n */\nexport interface ReleaseCandidate {\n version: string\n /** The npm dist-tag carrying this version; null when the Host could not tell. */\n tag: string | null\n publishedAt: string | null\n /** Numeric release line, e.g. `0.2.1` for `0.2.1-rc.4`. */\n line: string\n /** Copy-only upgrade command, or null when this installation cannot be upgraded that way. */\n command: string | null\n}\n\n/** Arguments accepted by either read/check endpoint. */\nexport interface CheckUpdateRequest {\n force?: boolean\n /** User preference, bounded by the Host before it affects cache expiry. */\n cacheTtlMinutes?: number\n}\n\n/**\n * A lossless, JSON-serializable snapshot used by both browser surfaces.\n * Nulls are intentional: a failed first check must still render a truthful\n * current-version card instead of an empty or malformed UI.\n */\nexport interface UpdateStatus {\n currentVersion: string\n /**\n * Every published version strictly newer than `currentVersion`, highest first.\n * Empty means \"you are on the newest published version\" — never a placeholder.\n */\n releases: ReleaseCandidate[]\n hasUpdate: boolean\n cached: boolean\n checkedAt: string | null\n /** English fallback for older clients; current clients localize `warnings`. */\n warning: string | null\n /** Severity of `warning`; absent from a Host older than the field. */\n warningKind?: UpdateWarningKind | null\n /** Structured warning facts; absent from a Host older than this field. */\n warnings?: UpdateWarning[]\n installKind: InstallKind\n releaseUrl: string\n changelogUrl: string\n packageName: string\n /** Phase 1 is informational only; the GUI must never apply an update. */\n canApplyInPlace: false\n}\n","/** Tiny bilingual dictionary kept local to avoid changing the host locale tree. */\n\nimport type { UpdateStatus, UpdateWarning } from '../shared/types.ts'\n\nexport type Language = 'zh' | 'en'\n\ntype Entry = { zh: string; en: string }\n\nconst DICTIONARY: Record<string, Entry> = {\n 'brand.status': { zh: 'DSH 版本状态', en: 'DSH version status' },\n 'brand.checking': { zh: '正在检查版本', en: 'Checking version' },\n 'brand.update': { zh: '有可用更新', en: 'Update available' },\n 'brand.current': { zh: '已是最新或尚未发现更新', en: 'Up to date or no update found' },\n 'brand.problem': { zh: '检查遇到问题', en: 'Check encountered a problem' },\n 'panel.title': { zh: 'DSH 更新状态', en: 'DSH update status' },\n 'panel.close': { zh: '关闭', en: 'Close' },\n 'panel.cacheDuration': { zh: '缓存时长', en: 'Cache duration' },\n 'panel.minutes': { zh: '分钟', en: 'minutes' },\n 'panel.cacheHint': { zh: '到期后在下次打开或读取状态时检查;不会后台轮询。点击“检查更新”会立即检查。', en: 'After expiry, DSH checks only on the next status read; there is no background polling. “Check for updates” checks immediately.' },\n 'panel.cacheReadonly': { zh: '此连接的缓存设置为只读。', en: 'This connection’s cache setting is read-only.' },\n 'panel.current': { zh: '当前运行版本', en: 'Current running version' },\n 'panel.updatesFound': { zh: '发现 {count} 个可升级版本', en: '{count} newer version(s) available' },\n 'panel.latest': { zh: '最新', en: 'Newest' },\n 'panel.notChecked': { zh: '尚未取得', en: 'Not available yet' },\n 'panel.currentState': { zh: '已是最新', en: 'Up to date' },\n 'panel.cached': { zh: '来自 Host 缓存', en: 'From Host cache' },\n 'panel.live': { zh: '刚从 npm registry 检查', en: 'Checked npm registry now' },\n 'panel.checkedAt': { zh: '上次检查', en: 'Last checked' },\n 'panel.publishedAt': { zh: '发布时间', en: 'Published' },\n 'panel.check': { zh: '检查更新', en: 'Check for updates' },\n 'panel.checking': { zh: '检查中…', en: 'Checking…' },\n 'panel.releaseNotes': { zh: '发布说明', en: 'Release notes' },\n 'panel.command': { zh: '升级命令', en: 'Upgrade command' },\n 'panel.copy': { zh: '复制命令', en: 'Copy command' },\n 'panel.copied': { zh: '已复制', en: 'Copied' },\n 'panel.copyFallback': { zh: '浏览器未允许复制;已选中文本,请长按或复制。', en: 'Clipboard unavailable; the command is selected for long-press or copy.' },\n 'panel.commandNote': { zh: '仅复制,不会执行。请在运行 DSH 的那台电脑的终端执行;完成后仅在已安装用户级监督服务时使用本面板的重启,否则由你自行重启 DSH。', en: 'Copy only — nothing runs here. Execute it in a terminal on the computer running DSH, then use this panel’s restart only when user-level supervision is installed; otherwise restart DSH yourself.' },\n 'panel.readOnly': { zh: '插件不会安装、升级、回滚或替换 DSH 文件;只有当前 DSH 已由用户显式安装的后台服务监督时,才允许安全重启。', en: 'The plugin never installs, upgrades, rolls back, or replaces DSH files. Safe restart is available only when the current DSH is supervised by a user-installed service.' },\n 'restart.title': { zh: '安全重启 DSH Web', en: 'Safely restart DSH Web' },\n 'restart.button': { zh: '重启', en: 'Restart' },\n 'restart.loading': { zh: '读取重启状态…', en: 'Reading restart status…' },\n 'restart.checking': { zh: '检查活动任务…', en: 'Checking active work…' },\n 'restart.confirm': { zh: '确认重启', en: 'Confirm restart' },\n 'restart.force': { zh: '强制重启', en: 'Force restart' },\n 'restart.cancel': { zh: '取消', en: 'Cancel' },\n 'restart.retry': { zh: '重新检查', en: 'Check again' },\n 'restart.confirmHint': { zh: '再次点击“确认重启”后,页面会短暂断开;后台服务恢复新实例后将自动刷新。', en: 'Click Confirm restart again. The page disconnects briefly and refreshes once the supervised service starts a new instance.' },\n 'restart.activeWarning': { zh: '检测到 {count} 个正在运行的任务。强制重启会中断它们。', en: '{count} active work item(s) are running. A forced restart interrupts them.' },\n 'restart.waitingShort': { zh: '重启中…', en: 'Restarting…' },\n 'restart.waiting': { zh: '正在等待后台服务恢复 DSH(已等待 {seconds} 秒)…', en: 'Waiting for the user service to restore DSH ({seconds}s elapsed)…' },\n 'restart.timeout': { zh: '60 秒内未检测到新 DSH 实例。请检查用户服务状态和日志;重新加载本页不会再次触发重启。', en: 'No new DSH instance was detected within 60 seconds. Check the user-service status and logs; reloading this page will not trigger another restart.' },\n 'restart.unavailable': { zh: '当前 DSH 不是由已确认的用户级后台服务启动。为避免页面重启后无法恢复,按钮已禁用;请先按服务管理文档安装并接管 DSH。', en: 'This DSH is not running under a verified user-level service. Restart is disabled so the page cannot strand itself; install and activate supervision first.' },\n 'restart.unavailableDesktop': { zh: 'DSH Desktop 管理当前 Host;请退出并重新打开桌面应用。', en: 'DSH Desktop manages this Host. Quit and reopen the desktop app instead.' },\n 'restart.unavailableMismatch': { zh: '检测到监督标记,但当前进程不是该平台服务真正启动并持有的那个(例如被另一个重启工具拉起)。重启后无法保证恢复,按钮已禁用。', en: 'A supervision marker exists, but this process is not the one that platform service actually started and owns (another restart tool launched it, for example). Restart is disabled so the page cannot strand itself.' },\n 'restart.recoverIntro': { zh: '第一行只列出占用端口的进程,不会杀它;请先自行停止它,再执行第二行让监督服务重新接管。', en: 'The first line only lists whoever holds the port — it kills nothing. Stop that process yourself, then run the second line to hand supervision back.' },\n 'restart.recoverLabel': { zh: '恢复命令', en: 'Recovery commands' },\n 'restart.recoverNote': { zh: '仅复制,不会执行,也不会杀任何进程。', en: 'Copy only — nothing runs here, and no process is killed.' },\n 'restart.recoverInstall': { zh: '尚未安装用户级监督服务;请按 README 的「受监督的重启」一节安装并接管 DSH,之后这个按钮才会启用。', en: 'No user-level supervisor is installed. Follow the “Supervised restart” section of the README to install and activate one; this button stays disabled until then.' },\n 'restart.unavailableThrashing': { zh: '监督服务正在反复启动失败(检测到重启风暴)。请先停止占用该端口的另一个 DSH 实例,并查看服务日志;在那之前重启可能无法恢复。', en: 'The supervisor is repeatedly failing to start (a restart storm was detected). Stop the other DSH instance holding this port and check the service logs; until then a restart may not recover.' },\n 'restart.unavailableActivity': { zh: '无法完整读取正在运行的任务。为避免中断未能列出的工作,重启已禁用。', en: 'Active work could not be inspected completely. Restart is disabled to avoid interrupting work that could not be listed.' },\n 'restart.unavailableTimer': { zh: '当前 Host 没有可用的安全退出调度器。为确保响应先送达浏览器,重启已禁用。', en: 'This Host has no safe exit scheduler. Restart is disabled so its response can reach the browser first.' },\n 'restart.unavailableStale': { zh: '此页面连接的是过期 DSH 实例。请等待恢复或重新加载后再重试。', en: 'This page is connected to a stale DSH instance. Wait for recovery or reload before trying again.' },\n 'panel.error': { zh: '检查提示', en: 'Check notice' },\n 'warning.registryUnavailable': { zh: '无法检查 npm registry:{detail}', en: 'Unable to check the npm registry: {detail}' },\n 'warning.versionIncomparable': { zh: '无法按 SemVer 比较当前版本 {currentVersion} 与线上版本 {latestVersion}。', en: 'Unable to compare the current version {currentVersion} with the published version {latestVersion} using SemVer.' },\n 'warning.staleSchemastery': { zh: '本插件解析到的 @deepseek-ai/schemastery(版本 {version})来自 {path},不是 DSH 自带的那份,偏好字段无法标记为 volatile。请删除该残留目录并重启 DSH:rm -rf {nodeModulesDir}', en: 'This plugin resolved @deepseek-ai/schemastery {version} from {path} instead of the copy DSH provides, so preference fields cannot be marked volatile. Remove the stale directory and restart DSH: rm -rf {nodeModulesDir}' },\n 'warning.staleSchemasteryNoPath': { zh: '本插件解析到的 @deepseek-ai/schemastery(版本 {version})来自 {path},不是 DSH 自带的那份,偏好字段无法标记为 volatile。请删除该处残留的 @deepseek-ai/schemastery 目录并重启 DSH。', en: 'This plugin resolved @deepseek-ai/schemastery {version} from {path} instead of the copy DSH provides, so preference fields cannot be marked volatile. Remove the stale @deepseek-ai/schemastery directory there and restart DSH.' },\n 'guidance.sourceCheckout': { zh: '请更新 DSH 源码 checkout、安装依赖并重新构建;本插件无法从 GUI 原地替换。', en: 'Update the DSH source checkout, install its dependencies, and rebuild it; this plugin cannot replace it in place from the GUI.' },\n 'guidance.unknownInstall': { zh: '升级前请先确认 DSH 的安装方式;本插件无法代为执行升级。', en: 'Confirm how DSH was installed before upgrading; this plugin cannot perform the upgrade for you.' },\n}\n\nexport function languageOf(): Language {\n try {\n return navigator.language.toLowerCase().startsWith('zh') ? 'zh' : 'en'\n } catch {\n return 'en'\n }\n}\n\nexport function t(key: keyof typeof DICTIONARY, params: Record<string, string> = {}, language: Language = languageOf()): string {\n const entry = DICTIONARY[key]\n if (entry === undefined) return key\n const template = entry[language] ?? entry.en\n return template.replace(/\\{([A-Za-z]+)\\}/g, (match, name: string) => params[name] ?? match)\n}\n\nexport function warningText(warning: UpdateWarning, language: Language = languageOf()): string {\n switch (warning.code) {\n case 'registry-unavailable': return t('warning.registryUnavailable', { detail: warning.detail }, language)\n case 'version-incomparable': return t('warning.versionIncomparable', {\n currentVersion: warning.currentVersion,\n latestVersion: warning.latestVersion,\n }, language)\n case 'stale-schemastery': {\n const params = { version: warning.version ?? '—', path: warning.path }\n // Only print a removal command when the Host could name the directory to\n // remove; the module path alone would make `rm -rf` delete a single file.\n return warning.nodeModulesDir === null\n ? t('warning.staleSchemasteryNoPath', params, language)\n : t('warning.staleSchemastery', { ...params, nodeModulesDir: warning.nodeModulesDir }, language)\n }\n }\n}\n\n/** Prefer structured warnings, but keep the Host string for mixed-version clients. */\nexport function localizedWarning(status: Pick<UpdateStatus, 'warning' | 'warnings'>, language: Language = languageOf()): string | null {\n const warnings = status.warnings ?? []\n return warnings.length === 0 ? status.warning : warnings.map(item => warningText(item, language)).join(' ')\n}\n\n/**\n * Advice for an installation this plugin cannot hand a copyable command.\n *\n * `null` is the honest answer for an npm/pnpm global install: its candidate\n * already carries a real command, so guidance prose there would only be noise.\n */\nexport function localizedUpgradeGuidance(\n installKind: UpdateStatus['installKind'],\n language: Language = languageOf(),\n): string | null {\n if (installKind === 'source-checkout') return t('guidance.sourceCheckout', {}, language)\n if (installKind === 'unknown') return t('guidance.unknownInstall', {}, language)\n return null\n}\n","/** React arrives from DSH's frozen browser module table at client materialization. */\nimport type * as ReactNS from 'react'\n\n// eslint/oxlint would normally discourage require; DSH's closure factory makes\n// this the supported runtime import path for a third-party client bundle.\nexport const React: typeof ReactNS = require('react') as typeof ReactNS\nexport const h = React.createElement\n","/** Sidebar chip and overlay detail panel. */\n\nimport type * as ReactNS from 'react'\nimport { isChipProblem, visualState } from '../shared/visual-state.ts'\nimport { MAX_CACHE_TTL_MINUTES, MIN_CACHE_TTL_MINUTES, isCacheTtlMinutes, type ReleaseCandidate, type UpdateStatus } from '../shared/types.ts'\nimport type { PreferencesStore, PanelStore, RestartStore, StatusStore } from './stores.ts'\nimport { languageOf, localizedUpgradeGuidance, localizedWarning, t, type Language } from './i18n.ts'\nimport { React, h } from './react.ts'\n\nfunction useObservable<T>(store: { subscribe(listener: () => void): () => void; getSnapshot(): T }): T {\n return React.useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot)\n}\n\nfunction timeText(value: string | null): string | null {\n if (value === null) return null\n try {\n return new Intl.DateTimeFormat(undefined, { dateStyle: 'medium', timeStyle: 'short' }).format(new Date(value))\n } catch {\n return value\n }\n}\n\nfunction shortVersion(value: string): string {\n if (value.length <= 16) return value\n return value.slice(0, 15) + '…'\n}\n\n/** Persists a cache policy only; it never schedules a browser or Host timer. */\nfunction CacheTtlControl({ preferences }: { preferences: PreferencesStore }): ReactNS.ReactElement {\n const snapshot = useObservable(preferences)\n const [draft, setDraft] = React.useState(String(snapshot.cacheTtlMinutes))\n React.useEffect(() => { setDraft(String(snapshot.cacheTtlMinutes)) }, [snapshot.cacheTtlMinutes])\n const save = (): void => {\n const value = Number(draft)\n if (isCacheTtlMinutes(value)) preferences.setCacheTtlMinutes(value)\n else setDraft(String(snapshot.cacheTtlMinutes))\n }\n return (\n <div className=\"dus-cache-setting\">\n <label className=\"dus-cache-field\">\n <span>{t('panel.cacheDuration')}</span>\n <span className=\"dus-cache-input-wrap\">\n <input\n className=\"dus-cache-input\"\n type=\"number\"\n inputMode=\"numeric\"\n min={MIN_CACHE_TTL_MINUTES}\n max={MAX_CACHE_TTL_MINUTES}\n step={1}\n value={draft}\n disabled={!snapshot.writable}\n aria-describedby=\"dus-cache-hint\"\n onChange={(event) => { setDraft(event.currentTarget.value) }}\n onBlur={save}\n onKeyDown={(event) => {\n if (event.key === 'Enter') { event.currentTarget.blur() }\n if (event.key === 'Escape') { setDraft(String(snapshot.cacheTtlMinutes)); event.currentTarget.blur() }\n }}\n />\n <span>{t('panel.minutes')}</span>\n </span>\n </label>\n <p className=\"dus-cache-hint\" id=\"dus-cache-hint\">{t('panel.cacheHint')}</p>\n {!snapshot.writable && <p className=\"dus-cache-hint\">{t('panel.cacheReadonly')}</p>}\n </div>\n )\n}\n\nfunction badgeLabel(status: UpdateStatus | null, loading: boolean, error: string | null): string {\n const state = visualState(status, loading, error)\n if (state === 'loading') return t('brand.checking')\n if (state === 'update') return t('brand.update')\n if (state === 'problem') return t('brand.problem')\n return t('brand.current')\n}\n\nexport interface SharedUi {\n status: StatusStore\n preferences: PreferencesStore\n panel: PanelStore\n restart: RestartStore\n}\n\n/** Occupies ONLY sidebar.brand.name; the official fish mark stays untouched. */\nexport function BrandName({ ui }: { ui: SharedUi }): ReactNS.ReactElement | null {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n // Defence in depth only: the entry that renders this component is already\n // disposed while the preference is off, because a single slot arbitrates by\n // priority and returning null would keep occupying the cell. See\n // client/index.ts — that disposal is what brings the official brand back.\n if (!preferences.sidebarEnabled) return null\n\n const state = visualState(snapshot.status, snapshot.loading, snapshot.error)\n const version = snapshot.status?.currentVersion ?? '—'\n const activate = (event: ReactNS.SyntheticEvent): void => {\n // The surrounding sidebar brand is an existing New Session <button>. This\n // non-button interaction prevents a nested button and stops its click.\n event.preventDefault()\n event.stopPropagation()\n // The official brand identity ancestor is aria-hidden. Do not leave focus\n // inside it while the modal dialog is open (Chrome otherwise warns).\n const target = event.currentTarget\n if (target instanceof HTMLElement) target.blur()\n ui.panel.toggle()\n }\n const onKeyDown = (event: ReactNS.KeyboardEvent<HTMLSpanElement>): void => {\n if (event.key !== 'Enter' && event.key !== ' ') return\n activate(event)\n }\n\n return (\n <span className=\"dus-brand-name\">\n {/* No handler: clicking this still bubbles to the shell's New Session button. */}\n <span className=\"dus-brand-deepseek\">DeepSeek</span>\n <span\n className=\"dus-badge\"\n data-update={snapshot.status?.hasUpdate === true || undefined}\n data-error={state === 'problem' || undefined}\n role=\"button\"\n tabIndex={0}\n aria-label={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n title={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n onClick={activate}\n onKeyDown={onKeyDown}\n >\n <span className=\"dus-badge-version\">{shortVersion(version)}</span>\n {/* `data-state` drives the palette (green when up to date); `data-update`\n and `data-loading` remain the louder, state-specific rules. */}\n <span className=\"dus-dot\" data-state={state} data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={snapshot.loading || undefined} aria-hidden=\"true\" />\n </span>\n </span>\n )\n}\n\nfunction restartUnavailableText(reason: 'not-supervised' | 'desktop' | 'supervisor-mismatch' | 'supervisor-thrashing' | 'activity-unavailable' | 'timer-unavailable' | 'stale-instance' | null | undefined): string {\n if (reason === 'desktop') return t('restart.unavailableDesktop')\n if (reason === 'supervisor-mismatch') return t('restart.unavailableMismatch')\n if (reason === 'supervisor-thrashing') return t('restart.unavailableThrashing')\n if (reason === 'activity-unavailable') return t('restart.unavailableActivity')\n if (reason === 'timer-unavailable') return t('restart.unavailableTimer')\n if (reason === 'stale-instance') return t('restart.unavailableStale')\n return t('restart.unavailable')\n}\n\nfunction RestartControl({ restart }: { restart: RestartStore }): ReactNS.ReactElement {\n const snapshot = useObservable(restart)\n React.useEffect(() => { void restart.refresh() }, [restart])\n const unavailable = snapshot.status !== null && !snapshot.status.available\n const hasActivity = snapshot.activity.length > 0\n // Recovery steps only make sense for a lost supervision, which is exactly when\n // the Host attaches them; the other refusals say what to do in their own text.\n const recoverable = snapshot.status?.recovery?.commands ?? null\n const waiting = snapshot.phase === 'waiting'\n const label = snapshot.phase === 'unknown' ? t('restart.loading')\n : snapshot.phase === 'checking' ? t('restart.checking')\n : snapshot.phase === 'armed' ? (hasActivity ? t('restart.force') : t('restart.confirm'))\n : waiting ? t('restart.waitingShort')\n : snapshot.phase === 'timeout' ? t('restart.retry')\n : snapshot.phase === 'error' ? t('restart.retry')\n : t('restart.button')\n const disabled = snapshot.phase === 'unknown' || snapshot.phase === 'checking' || waiting || unavailable\n const click = (): void => {\n if (snapshot.phase === 'armed') { void restart.request(hasActivity); return }\n if (snapshot.phase === 'timeout' || snapshot.phase === 'error') { void restart.check(); return }\n void restart.check()\n }\n return <>\n <button\n className=\"dus-action dus-restart\"\n type=\"button\"\n disabled={disabled}\n title={unavailable ? restartUnavailableText(snapshot.status?.unavailableReason) : t('restart.title')}\n onClick={click}\n >{label}</button>\n {snapshot.phase === 'armed' && <button className=\"dus-action\" type=\"button\" onClick={() => restart.cancel()}>{t('restart.cancel')}</button>}\n {unavailable && <p className=\"dus-restart-message\" role=\"status\">{restartUnavailableText(snapshot.status?.unavailableReason)}</p>}\n {unavailable && recoverable !== null && <div className=\"dus-restart-recover\">\n <p className=\"dus-restart-message\">{t('restart.recoverIntro')}</p>\n <CommandBlock command={recoverable} label={t('restart.recoverLabel')} note={t('restart.recoverNote')} />\n </div>}\n {unavailable && snapshot.status?.unavailableReason === 'not-supervised' && <p className=\"dus-restart-message\">{t('restart.recoverInstall')}</p>}\n {snapshot.phase === 'armed' && <p className=\"dus-restart-message\" role=\"status\">\n {hasActivity ? t('restart.activeWarning', { count: String(snapshot.activity.length) }) : t('restart.confirmHint')}\n </p>}\n {hasActivity && snapshot.phase === 'armed' && <ul className=\"dus-restart-work\">{snapshot.activity.map(item => <li key={`${item.type}:${item.id}`}>{item.label} · {item.status}</li>)}</ul>}\n {waiting && <p className=\"dus-restart-message\" role=\"status\">{t('restart.waiting', { seconds: String(Math.floor(snapshot.elapsedMs / 1000)) })}</p>}\n {snapshot.phase === 'timeout' && <p className=\"dus-restart-message\" role=\"alert\">{t('restart.timeout')}</p>}\n {snapshot.phase === 'error' && snapshot.error !== null && <p className=\"dus-restart-message\" role=\"alert\">{snapshot.error}</p>}\n </>\n}\n\nfunction statusSummary(status: UpdateStatus | null, loading: boolean, error: string | null): { kind: 'update' | 'ok' | 'warning' | 'error'; text: string } {\n if (loading && status === null) return { kind: 'warning', text: t('brand.checking') }\n if (error !== null) return { kind: 'error', text: error }\n if (status !== null && status.releases.length > 0) {\n // The count is the whole answer: the cards below name every version, so the\n // state line does not repeat one of them and go stale when the list changes.\n return { kind: 'update', text: t('panel.updatesFound', { count: String(status.releases.length) }) }\n }\n if (status !== null) {\n const warning = localizedWarning(status)\n if (warning !== null) return { kind: 'warning', text: warning }\n }\n return { kind: 'ok', text: t('panel.currentState') }\n}\n\nfunction selectCommand(element: HTMLElement | null): void {\n if (element === null) return\n try {\n const selection = window.getSelection()\n if (selection === null) return\n const range = document.createRange()\n range.selectNodeContents(element)\n selection.removeAllRanges()\n selection.addRange(range)\n element.focus()\n } catch {\n // The command remains ordinary selectable text even when selection fails.\n }\n}\n\n/**\n * One copy-only command and its own feedback.\n *\n * Each instance owns its clipboard state, so a card's \"已复制\" never appears on\n * another card: the panel can show several commands at once.\n */\nfunction CopyableCommand({ command, disabled, label }: { command: string; disabled: boolean; label: string | null }): ReactNS.ReactElement {\n const commandRef = React.useRef<HTMLElement | null>(null)\n const [copyMessage, setCopyMessage] = React.useState<string | null>(null)\n const copy = async (): Promise<void> => {\n setCopyMessage(null)\n try {\n if (!navigator.clipboard?.writeText) throw new Error('Clipboard API unavailable')\n await navigator.clipboard.writeText(command)\n setCopyMessage(t('panel.copied'))\n } catch {\n selectCommand(commandRef.current)\n setCopyMessage(t('panel.copyFallback'))\n }\n }\n return (\n <>\n {label !== null && <p className=\"dus-command-label\">{label}</p>}\n <code ref={commandRef} className=\"dus-command\" tabIndex={0}>{command}</code>\n <div className=\"dus-actions dus-command-actions\">\n <button className=\"dus-action\" type=\"button\" disabled={disabled} onClick={() => { void copy() }}>{t('panel.copy')}</button>\n {copyMessage !== null && <p className=\"dus-copy-message\" role=\"status\">{copyMessage}</p>}\n </div>\n </>\n )\n}\n\n/** A labelled, copy-only command block, used by restart recovery. */\nfunction CommandBlock({ command, disabled = false, label = t('panel.command'), note = t('panel.commandNote') }: { command: string; disabled?: boolean; label?: string; note?: string }): ReactNS.ReactElement {\n return (\n <>\n <CopyableCommand command={command} disabled={disabled} label={label} />\n <p className=\"dus-note\">{note}</p>\n </>\n )\n}\n\n/** One card, in the order the Host sent it, with \"newest\" already decided. */\nexport interface ReleaseRow {\n release: ReleaseCandidate\n /** Only ever true for the first row: the amber border and the 最新 pill. */\n newest: boolean\n}\n\nexport interface ReleaseView {\n rows: ReleaseRow[]\n /** Some card carries a real command, so the copy-only note belongs on the panel. */\n copyable: boolean\n /** One explanation for an installation no candidate can hand a command to. */\n guidance: string | null\n}\n\n/**\n * What the card area renders, decided as a pure function.\n *\n * It lives outside the JSX for the same reason `visualState` does: \"nothing newer\n * means no card and no command block at all\" is a rule that regressions hide\n * from, and a test can drive this directly without a DOM. The Host's array is\n * already newest-first, so the client never re-sorts it — it only marks index 0.\n */\nexport function releaseViewOf(status: UpdateStatus | null, language: Language = languageOf()): ReleaseView {\n const releases = status === null ? [] : status.releases\n const copyable = releases.some(release => release.command !== null)\n return {\n rows: releases.map((release, index) => ({ release, newest: index === 0 })),\n copyable,\n guidance: status !== null && releases.length > 0 && !copyable\n ? localizedUpgradeGuidance(status.installKind, language)\n : null,\n }\n}\n\n/**\n * One upgradable version, top to bottom: what it is, when it shipped, and how to\n * get it. `newest` is index 0 of the Host's array — the list arrives sorted, and\n * the client must not re-sort a contract the Host already ordered.\n */\nfunction ReleaseCard({ release, newest, disabled }: { release: ReleaseCandidate; newest: boolean; disabled: boolean }): ReactNS.ReactElement {\n const published = timeText(release.publishedAt)\n return (\n <article className=\"dus-release\" data-highlight={newest || undefined}>\n <div className=\"dus-release-head\">\n <code className=\"dus-release-version\">{release.version}</code>\n {newest && <span className=\"dus-pill dus-pill-latest\">{t('panel.latest')}</span>}\n {release.tag !== null && <span className=\"dus-pill\">{release.tag}</span>}\n </div>\n <p className=\"dus-release-meta\">\n <span className=\"dus-release-line\">{release.line}</span>\n {published !== null && <span>{t('panel.publishedAt')}: {published}</span>}\n </p>\n {/* A source checkout has no command this panel may fabricate; the panel's\n guidance line speaks for every such card instead. */}\n {release.command !== null && <CopyableCommand command={release.command} disabled={disabled} label={null} />}\n </article>\n )\n}\n\n/** Full detail from whichever page the operator is on (the transport is authenticated). */\nexport function UpdatePanel({ ui }: { ui: SharedUi }): ReactNS.ReactElement | null {\n const panel = useObservable(ui.panel)\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n const dialogRef = React.useRef<HTMLDialogElement | null>(null)\n const visible = panel.open && preferences.sidebarEnabled\n\n React.useLayoutEffect(() => {\n if (!visible) return undefined\n const dialog = dialogRef.current\n if (dialog === null) return undefined\n try {\n if (!dialog.open) dialog.showModal()\n } catch {\n // Older embedded Chromium still receives a visible non-top-layer dialog.\n dialog.setAttribute('open', '')\n }\n return () => {\n if (dialog.open) dialog.close()\n }\n }, [visible])\n\n React.useEffect(() => {\n if (!panel.open) return undefined\n const onKeyDown = (event: KeyboardEvent): void => {\n if (event.key === 'Escape') ui.panel.close()\n }\n window.addEventListener('keydown', onKeyDown)\n return () => { window.removeEventListener('keydown', onKeyDown) }\n }, [panel.open, ui.panel])\n\n if (!visible) return null\n const status = snapshot.status\n const warning = status === null ? null : localizedWarning(status)\n const summary = statusSummary(status, snapshot.loading, snapshot.error)\n const view = releaseViewOf(status)\n\n return (\n <dialog\n ref={dialogRef}\n className=\"dus-overlay-root\"\n aria-label={t('panel.title')}\n onCancel={(event) => {\n event.preventDefault()\n ui.panel.close()\n }}\n >\n <div className=\"dus-backdrop\" onClick={() => { ui.panel.close() }} />\n {/*\n `data-window-drag-exclude` is DSH's window-region declaration (upgrade\n guide v0.2.2-rc.1 → v0.2.2-rc.2, \"Explicit window regions for custom\n Client overlays\"). This panel is positioned at `top: 12px`, so on macOS\n Desktop it sits over a `data-window-drag` chrome row: the conversation\n header, the plugin manager and Settings → Account all mark one. Before\n that release macOS excluded matching controls anywhere in the page, so\n the panel's buttons kept working by accident. Now only controls inside a\n drag row or a `data-window-drag-controls` scope are excluded, and a\n custom overlay outside those scopes has to declare its own region —\n without this attribute a click on Check for updates, Release notes,\n Restart or × would drag the window instead of activating the control.\n The exclusion belongs on the visible viewport (this scrolling section),\n not on every focusable descendant; the full-viewport backdrop keeps no\n region so header dragging still works everywhere the panel is not.\n */}\n <section\n className=\"dus-panel\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={t('panel.title')}\n data-window-drag-exclude=\"\"\n onClick={(event) => { event.stopPropagation() }}\n >\n <div className=\"dus-panel-head\">\n <span className=\"dus-panel-title\">{t('panel.title')}</span>\n <button className=\"dus-close\" type=\"button\" aria-label={t('panel.close')} onClick={() => { ui.panel.close() }}>×</button>\n </div>\n\n <CacheTtlControl preferences={ui.preferences} />\n <p className=\"dus-state\" data-kind={summary.kind}>{summary.text}</p>\n\n <div className=\"dus-metadata\">\n <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.current')}</span>\n <code className=\"dus-meta-value\">{status?.currentVersion ?? '…'}</code>\n </div>\n {status?.checkedAt !== null && status?.checkedAt !== undefined && <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.checkedAt')}</span>\n <span className=\"dus-meta-value\">{timeText(status.checkedAt)}</span>\n <span className=\"dus-meta-sub\">{status.cached ? t('panel.cached') : t('panel.live')}</span>\n </div>}\n </div>\n\n {warning !== null && <p className=\"dus-warning\">{t('panel.error')}: {warning}</p>}\n {snapshot.error !== null && <p className=\"dus-warning\">{t('panel.error')}: {snapshot.error}</p>}\n\n <div className=\"dus-actions\">\n <button className=\"dus-action\" type=\"button\" disabled={snapshot.loading} onClick={() => { void ui.status.refresh(preferences.cacheTtlMinutes) }}>\n {snapshot.loading ? t('panel.checking') : t('panel.check')}\n </button>\n {status !== null && <a className=\"dus-action\" href={status.changelogUrl} target=\"_blank\" rel=\"noreferrer\">{t('panel.releaseNotes')}</a>}\n <RestartControl restart={ui.restart} />\n </div>\n\n {view.rows.length > 0 && <div className=\"dus-releases\">\n {view.rows.map(row => (\n <ReleaseCard key={row.release.version} release={row.release} newest={row.newest} disabled={snapshot.loading} />\n ))}\n </div>}\n {view.copyable && <p className=\"dus-note\">{t('panel.commandNote')}</p>}\n {view.guidance !== null && <p className=\"dus-guidance\">{view.guidance}</p>}\n <p className=\"dus-note\">{t('panel.readOnly')}</p>\n </section>\n </dialog>\n )\n}\n","/** Minimal structural client faces — runtime services stay owned by DSH. */\n\nimport type { InstallKind, ReleaseCandidate, UpdateStatus, UpdateWarning } from '../shared/types.ts'\n\nexport type RestartPhase = 'unknown' | 'idle' | 'armed' | 'checking' | 'waiting' | 'timeout' | 'error'\n\nexport interface RestartRecoveryValue {\n /** Copy-only advice from the installer's own receipt: find the port holder, then recover. */\n commands: string\n}\n\nexport interface RestartStatusValue {\n instanceId: string\n /**\n * When the current Host process started. Optional on purpose: a bundle that was\n * hot-reloaded over an older Host must keep rendering without it.\n */\n startedAt?: string\n available: boolean\n supervisor: 'launchd' | 'systemd' | 'task-scheduler' | 'unknown' | null\n unavailableReason: 'not-supervised' | 'desktop' | 'supervisor-mismatch' | 'supervisor-thrashing' | 'activity-unavailable' | 'timer-unavailable' | 'stale-instance' | null\n /** Optional: an older Host sends no recovery steps and the panel simply omits them. */\n recovery?: RestartRecoveryValue\n}\n\nexport interface RestartActivityItemValue {\n type: 'agent' | 'job' | 'terminal'\n id: string\n label: string\n status: string\n ownerSession?: string\n}\n\nexport interface RestartCheckValue {\n kind: 'ready' | 'active-work' | 'unavailable'\n status: RestartStatusValue\n activity?: { hasActive: boolean; items: RestartActivityItemValue[] }\n}\n\nexport interface RestartRequestValue {\n kind: 'ready' | 'active-work' | 'unavailable' | 'scheduled' | 'in-progress'\n status?: RestartStatusValue\n activity?: { hasActive: boolean; items: RestartActivityItemValue[] }\n instanceId?: string\n}\n\n\nexport interface Observable<T> {\n getSnapshot(): T\n subscribe(listener: () => void): () => void\n}\n\nexport interface ConnectionRpc {\n call(channel: string, endpoint: string, payload: unknown, signal?: AbortSignal): Promise<unknown>\n}\n\n/**\n * The authenticated transport face. There is deliberately NO `isLoopback` gate\n * here: the Connection RPC is authenticated on LAN pages too. Older DSH clients\n * restricted settings persistence there, but that never justified disabling\n * this plugin's read-only status. Current settings authorization belongs to\n * the Host; settings/settingsChannel.ts selects by form availability, not origin.\n */\nexport interface ConnectionClient {\n rpc?: ConnectionRpc\n}\n\nexport interface SlotRegistration {\n name: string\n id?: string\n order?: number\n /** Single-slot arbitration: the lowest registered priority renders. */\n priority?: number\n label?: () => string\n locale?: string\n inject?: () => unknown\n}\n\nexport interface Slots {\n inject(name: string, callback: () => unknown): () => void\n register(registration: SlotRegistration, component: (props: Record<string, unknown>) => unknown): () => void\n}\n\nexport interface ClientContext {\n slots: Slots\n get(name: string): unknown\n inject(names: string[], callback: (ctx: unknown) => void): () => void\n effect(setup: () => (() => void) | void, label?: string): () => void\n /** Optional lifecycle event seam (Cordis contexts expose it; guarded here). */\n on?(name: string, listener: () => void): unknown\n}\n\nexport function errorMessage(error: unknown): string {\n const text = error instanceof Error ? error.message : String(error)\n return text.replace(/\\s+/g, ' ').trim().slice(0, 220) || 'unknown error'\n}\n\nfunction objectOf(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : undefined\n}\n\nexport function restartStatusOf(value: unknown): RestartStatusValue | undefined {\n const record = objectOf(value)\n if (record === undefined || typeof record.instanceId !== 'string' || record.instanceId === '' || typeof record.available !== 'boolean') return undefined\n const supervisor = record.supervisor === null ? null\n : record.supervisor === 'launchd' || record.supervisor === 'systemd' || record.supervisor === 'task-scheduler' || record.supervisor === 'unknown'\n ? record.supervisor : undefined\n const unavailableReason = record.unavailableReason === null ? null\n : record.unavailableReason === 'not-supervised' || record.unavailableReason === 'desktop' || record.unavailableReason === 'supervisor-mismatch' || record.unavailableReason === 'supervisor-thrashing' || record.unavailableReason === 'activity-unavailable' || record.unavailableReason === 'timer-unavailable' || record.unavailableReason === 'stale-instance'\n ? record.unavailableReason : undefined\n if (supervisor === undefined || unavailableReason === undefined) return undefined\n if (record.startedAt !== undefined && (typeof record.startedAt !== 'string' || record.startedAt === '')) return undefined\n const recovery = record.recovery === undefined ? undefined : objectOf(record.recovery)\n if (record.recovery !== undefined && (recovery === undefined || typeof recovery.commands !== 'string' || recovery.commands === '')) return undefined\n if (record.available && (supervisor === null || unavailableReason !== null)) return undefined\n if (!record.available && unavailableReason === null) return undefined\n return {\n instanceId: record.instanceId,\n ...(record.startedAt === undefined ? {} : { startedAt: record.startedAt }),\n available: record.available, supervisor, unavailableReason,\n ...(recovery === undefined ? {} : { recovery: { commands: recovery.commands as string } }),\n }\n}\n\nfunction restartActivityOf(value: unknown): { hasActive: boolean; items: RestartActivityItemValue[] } | undefined {\n const record = objectOf(value)\n if (record === undefined || typeof record.hasActive !== 'boolean' || !Array.isArray(record.items)) return undefined\n const items: RestartActivityItemValue[] = []\n for (const raw of record.items) {\n const item = objectOf(raw)\n if (item === undefined || (item.type !== 'agent' && item.type !== 'job' && item.type !== 'terminal')\n || typeof item.id !== 'string' || typeof item.label !== 'string' || typeof item.status !== 'string') return undefined\n if (item.ownerSession !== undefined && typeof item.ownerSession !== 'string') return undefined\n items.push({ type: item.type, id: item.id, label: item.label, status: item.status, ...(item.ownerSession === undefined ? {} : { ownerSession: item.ownerSession }) })\n }\n if (record.hasActive !== (items.length > 0)) return undefined\n return { hasActive: record.hasActive, items }\n}\n\nexport function restartCheckOf(value: unknown): RestartCheckValue | undefined {\n const record = objectOf(value)\n if (record === undefined || (record.kind !== 'ready' && record.kind !== 'active-work' && record.kind !== 'unavailable')) return undefined\n const status = restartStatusOf(record.status)\n if (status === undefined) return undefined\n const activity = record.activity === undefined ? undefined : restartActivityOf(record.activity)\n if (record.activity !== undefined && activity === undefined) return undefined\n if (record.kind === 'active-work' && (activity === undefined || !activity.hasActive)) return undefined\n if (record.kind !== 'active-work' && activity !== undefined) return undefined\n return { kind: record.kind, status, ...(activity === undefined ? {} : { activity }) }\n}\n\nexport function restartRequestOf(value: unknown): RestartRequestValue | undefined {\n const record = objectOf(value)\n if (record === undefined || (record.kind !== 'ready' && record.kind !== 'active-work' && record.kind !== 'unavailable' && record.kind !== 'scheduled' && record.kind !== 'in-progress')) return undefined\n if (record.kind === 'scheduled' || record.kind === 'in-progress') return typeof record.instanceId === 'string' && record.instanceId !== '' ? { kind: record.kind, instanceId: record.instanceId } : undefined\n const check = restartCheckOf(record)\n return check === undefined ? undefined : check\n}\n\nfunction stringOrNull(value: unknown): string | null {\n return typeof value === 'string' ? value : null\n}\n\nfunction warningOf(value: unknown): UpdateWarning | undefined {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (record.code === 'registry-unavailable' && typeof record.detail === 'string') {\n return { code: record.code, detail: record.detail }\n }\n if (record.code === 'version-incomparable' && typeof record.currentVersion === 'string'\n && typeof record.latestVersion === 'string') {\n return {\n code: record.code,\n currentVersion: record.currentVersion,\n latestVersion: record.latestVersion,\n }\n }\n if (record.code === 'stale-schemastery') {\n const version = record.version === null ? null : stringOrNull(record.version)\n const nodeModulesDir = record.nodeModulesDir === null ? null : stringOrNull(record.nodeModulesDir)\n const path = stringOrNull(record.path)\n if (path !== null && (record.version === null || version !== null)\n && (record.nodeModulesDir === null || nodeModulesDir !== null)) {\n return { code: record.code, version, path, nodeModulesDir }\n }\n }\n return undefined\n}\n\nfunction installKindOf(value: unknown): InstallKind | undefined {\n return value === 'npm-global' || value === 'pnpm-global' || value === 'source-checkout' || value === 'unknown'\n ? value\n : undefined\n}\n\n/**\n * A field the contract types as `string | null`.\n *\n * `null` is a value the Host chose to send; `undefined` means it was missing or\n * malformed, which a caller turns into a rejection.\n */\nfunction nullableString(value: unknown): string | null | undefined {\n if (value === null) return null\n return typeof value === 'string' && value !== '' ? value : undefined\n}\n\n/**\n * One upgradable version, exactly as the Host described it.\n *\n * Every field is required by the contract, so a missing `line` or a numeric\n * `tag` rejects the whole payload instead of rendering a half-filled card: the\n * card list is the panel's whole answer, and a wrong one is worse than a read\n * error the operator can retry.\n */\nfunction releaseCandidateOf(value: unknown): ReleaseCandidate | undefined {\n const record = objectOf(value)\n if (record === undefined) return undefined\n if (typeof record.version !== 'string' || record.version === '') return undefined\n if (typeof record.line !== 'string' || record.line === '') return undefined\n const tag = nullableString(record.tag)\n const publishedAt = nullableString(record.publishedAt)\n // An empty command is not a command: fold it into \"this installation cannot\n // express one\" so the panel shows guidance instead of a copy button that would\n // put an empty string on the clipboard.\n const command = record.command === '' ? null : nullableString(record.command)\n if (tag === undefined || publishedAt === undefined || command === undefined) return undefined\n return { version: record.version, tag, publishedAt, line: record.line, command }\n}\n\n/** The release line of a version: no SemVer maths needed, the Host's own rule. */\nfunction releaseLineOf(version: string): string {\n return version.split('-', 1)[0] ?? version\n}\n\n/**\n * A 0.4.x Host answered with a single `latestVersion` plus its `upgradeCommand`.\n *\n * A client bundle that hot-reloads over that Host must keep the page alive, so\n * the one candidate those fields describe is synthesized instead of rejecting a\n * payload the Host is still entitled to send. `tag` is null because the legacy\n * shape never carried it.\n */\nfunction legacyReleaseOf(record: Record<string, unknown>, installKind: InstallKind): ReleaseCandidate | undefined {\n if (typeof record.latestVersion !== 'string' || record.latestVersion === '') return undefined\n // The legacy shape allowed a missing publish time; `0.4.x` always sent the key.\n const publishedAt = record.publishedAt === undefined ? null : nullableString(record.publishedAt)\n if (publishedAt === undefined) return undefined\n // The legacy Host put guidance prose into `upgradeCommand` for a source\n // checkout or an unknown install. Reusing that string would render an English\n // sentence inside a copyable <code>, so those kinds take the guidance path.\n const command = installKind === 'npm-global' || installKind === 'pnpm-global'\n ? (typeof record.upgradeCommand === 'string' && record.upgradeCommand !== '' ? record.upgradeCommand : null)\n : null\n return {\n version: record.latestVersion,\n tag: null,\n publishedAt,\n line: releaseLineOf(record.latestVersion),\n command,\n }\n}\n\n/** Reject malformed RPC output before it reaches a slot component. */\nexport function updateStatusOf(value: unknown): UpdateStatus | undefined {\n if (value === null || typeof value !== 'object' || Array.isArray(value)) return undefined\n const record = value as Record<string, unknown>\n if (typeof record.currentVersion !== 'string' || typeof record.hasUpdate !== 'boolean'\n || typeof record.cached !== 'boolean' || typeof record.releaseUrl !== 'string'\n || typeof record.changelogUrl !== 'string' || typeof record.packageName !== 'string'\n || record.canApplyInPlace !== false) return undefined\n const installKind = installKindOf(record.installKind)\n if (installKind === undefined) return undefined\n const checkedAt = record.checkedAt === null ? null : stringOrNull(record.checkedAt)\n const warning = record.warning === null ? null : stringOrNull(record.warning)\n // Absent or unrecognised means a Host older than the field: leave it undefined and\n // let the visual state fall back to \"any warning is a failure\", never to \"no warning\".\n const warningKind = record.warningKind === 'failure' || record.warningKind === 'notice' ? record.warningKind : undefined\n if ((record.checkedAt !== null && checkedAt === null) || (record.warning !== null && warning === null)) return undefined\n\n const releases: ReleaseCandidate[] = []\n if (record.releases !== undefined) {\n if (!Array.isArray(record.releases)) return undefined\n for (const raw of record.releases) {\n const parsed = releaseCandidateOf(raw)\n if (parsed === undefined) return undefined\n releases.push(parsed)\n }\n }\n // Hot reload over a 0.4.x Host: the legacy pair still names the one version it\n // found. Only when the new array is absent or empty — a Host that sends both is\n // new, and its array is authoritative.\n if (releases.length === 0 && record.hasUpdate === true) {\n const legacy = legacyReleaseOf(record, installKind)\n if (legacy !== undefined) releases.push(legacy)\n }\n // The chip reads `hasUpdate`, the panel reads `releases`; letting them disagree\n // would paint \"an update exists\" over an empty card list.\n if (record.hasUpdate !== (releases.length > 0)) return undefined\n\n const warnings: UpdateWarning[] = []\n if (record.warnings !== undefined) {\n if (!Array.isArray(record.warnings)) return undefined\n for (const raw of record.warnings) {\n const parsed = warningOf(raw)\n if (parsed === undefined) return undefined\n warnings.push(parsed)\n }\n }\n return {\n currentVersion: record.currentVersion,\n releases,\n hasUpdate: record.hasUpdate,\n cached: record.cached,\n checkedAt,\n warning,\n warningKind,\n warnings,\n installKind,\n releaseUrl: record.releaseUrl,\n changelogUrl: record.changelogUrl,\n packageName: record.packageName,\n canApplyInPlace: false,\n }\n}\n","/** Small observable stores shared by the independent sidebar and overlay slots. */\n\nimport { DEFAULT_CACHE_TTL_MINUTES, isCacheTtlMinutes, PLUGIN_ID, RESTART_ENDPOINTS, UPDATE_ENDPOINTS, UPDATE_STATUS_CHANNEL, type UpdateStatus } from '../shared/types.ts'\nimport type { ConnectionClient, Observable, RestartActivityItemValue, RestartPhase, RestartStatusValue } from './contract.ts'\nimport { errorMessage, restartCheckOf, restartRequestOf, restartStatusOf, updateStatusOf } from './contract.ts'\nimport type { SettingsScopeLike } from './settings/scopeFaces.ts'\n\nexport interface StatusSnapshot {\n status: UpdateStatus | null\n loading: boolean\n error: string | null\n}\n\nconst INITIAL_STATUS: StatusSnapshot = { status: null, loading: true, error: null }\n\nexport class StatusStore implements Observable<StatusSnapshot> {\n private snapshot: StatusSnapshot = INITIAL_STATUS\n private readonly listeners = new Set<() => void>()\n private inFlight: Promise<boolean> | undefined\n private stopped = false\n\n constructor(private readonly connection: ConnectionClient) {}\n\n getSnapshot = (): StatusSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n /** First mount reads the Host's cached status; it never starts a browser timer. */\n async load(cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n await this.request(false, cacheTtlMinutes)\n }\n\n /** User gesture only: force the Host to bypass TTL (while retaining single-flight). */\n async refresh(cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n await this.request(true, cacheTtlMinutes)\n }\n\n /**\n * Ordinary read that waits out an in-flight request first.\n *\n * Used once per mount, when the stored cache policy arrives after the first\n * read already started: joining that request would keep the default policy, so\n * the follow-up read has to come after it settles.\n */\n async reload(cacheTtlMinutes: number): Promise<void> {\n const pending = this.inFlight\n if (pending !== undefined) await pending\n if (this.stopped) return\n await this.request(false, cacheTtlMinutes)\n }\n\n stop(): void {\n this.stopped = true\n this.listeners.clear()\n }\n\n private publish(next: StatusSnapshot): void {\n if (this.stopped) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n\n private request(force: boolean, cacheTtlMinutes: number): Promise<boolean> {\n if (this.inFlight !== undefined) return this.inFlight\n const rpc = this.connection.rpc\n if (rpc === undefined || typeof rpc.call !== 'function') {\n this.publish({ ...this.snapshot, loading: false, error: 'DSH connection RPC is unavailable' })\n return Promise.resolve(false)\n }\n\n this.publish({ ...this.snapshot, loading: true, error: null })\n const run = (async () => {\n try {\n const endpoint = force ? UPDATE_ENDPOINTS.checkUpdate : UPDATE_ENDPOINTS.getStatus\n const ttl = isCacheTtlMinutes(cacheTtlMinutes) ? cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES\n const raw = await rpc.call(UPDATE_STATUS_CHANNEL, endpoint, force\n ? { force: true, cacheTtlMinutes: ttl }\n : { cacheTtlMinutes: ttl })\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) throw new Error('invalid update-status RPC response')\n const envelope = raw as { ok?: unknown; value?: unknown; error?: { message?: unknown } }\n if (envelope.ok !== true) throw new Error(typeof envelope.error?.message === 'string' ? envelope.error.message : 'update-status RPC failed')\n const status = updateStatusOf(envelope.value)\n if (status === undefined) throw new Error('invalid update-status payload')\n this.publish({ status, loading: false, error: null })\n return true\n } catch (error) {\n this.publish({ ...this.snapshot, loading: false, error: errorMessage(error) })\n return false\n }\n })()\n this.inFlight = run\n void run.finally(() => {\n if (this.inFlight === run) this.inFlight = undefined\n })\n return run\n }\n}\n\nexport interface PreferencesSnapshot {\n sidebarEnabled: boolean\n cacheTtlMinutes: number\n writable: boolean\n status: 'loading' | 'ready' | 'unavailable'\n}\n\nconst INITIAL_PREFERENCES: PreferencesSnapshot = {\n sidebarEnabled: true,\n cacheTtlMinutes: DEFAULT_CACHE_TTL_MINUTES,\n writable: false,\n status: 'loading',\n}\n\nexport class PreferencesStore implements Observable<PreferencesSnapshot> {\n private snapshot: PreferencesSnapshot = INITIAL_PREFERENCES\n private readonly listeners = new Set<() => void>()\n private scope: SettingsScopeLike | undefined\n\n getSnapshot = (): PreferencesSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n attach(scope: SettingsScopeLike): () => void {\n this.scope = scope\n const sync = () => {\n const raw = scope.getSnapshot()\n const value = raw.value !== null && typeof raw.value === 'object' && !Array.isArray(raw.value)\n ? raw.value as Record<string, unknown>\n : {}\n const status = raw.status === 'ready' || raw.status === 'unavailable' ? raw.status : 'loading'\n this.publish({\n sidebarEnabled: value.sidebarEnabled !== false,\n cacheTtlMinutes: isCacheTtlMinutes(value.cacheTtlMinutes) ? value.cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES,\n writable: raw.writable === true,\n status,\n })\n }\n sync()\n return scope.subscribe(sync)\n }\n\n setSidebarEnabled(enabled: boolean): void {\n const previous = this.snapshot\n this.publish({ ...previous, sidebarEnabled: enabled })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('sidebarEnabled', enabled).catch(() => {\n // A rejected Host-backed write restores the authoritative scope snapshot.\n try {\n const raw = scope.getSnapshot()\n const value = raw.value !== null && typeof raw.value === 'object' && !Array.isArray(raw.value)\n ? raw.value as Record<string, unknown>\n : {}\n this.publish({\n sidebarEnabled: value.sidebarEnabled !== false,\n cacheTtlMinutes: isCacheTtlMinutes(value.cacheTtlMinutes) ? value.cacheTtlMinutes : DEFAULT_CACHE_TTL_MINUTES,\n writable: raw.writable === true,\n status: raw.status === 'ready' || raw.status === 'unavailable' ? raw.status : 'loading',\n })\n } catch {\n this.publish(previous)\n }\n })\n }\n\n setCacheTtlMinutes(cacheTtlMinutes: number): void {\n if (!isCacheTtlMinutes(cacheTtlMinutes)) return\n const previous = this.snapshot\n this.publish({ ...previous, cacheTtlMinutes })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('cacheTtlMinutes', cacheTtlMinutes).catch(() => { this.publish(previous) })\n }\n\n private publish(next: PreferencesSnapshot): void {\n const previous = this.snapshot\n if (previous.sidebarEnabled === next.sidebarEnabled\n && previous.cacheTtlMinutes === next.cacheTtlMinutes\n && previous.writable === next.writable && previous.status === next.status) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\nexport interface PanelSnapshot {\n open: boolean\n}\n\n/** Open state of the detail panel, whose only trigger is the brand-row chip. */\nexport class PanelStore implements Observable<PanelSnapshot> {\n private snapshot: PanelSnapshot = { open: false }\n private readonly listeners = new Set<() => void>()\n\n getSnapshot = (): PanelSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n toggle(): void {\n this.set({ open: !this.snapshot.open })\n }\n\n close(): void { this.set({ open: false }) }\n\n private set(next: PanelSnapshot): void {\n if (this.snapshot.open === next.open) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\nexport interface RestartSnapshot {\n phase: RestartPhase\n status: RestartStatusValue | null\n activity: readonly RestartActivityItemValue[]\n elapsedMs: number\n error: string | null\n}\n\nexport interface RestartStoreOptions {\n /** Injected by tests; defaults to browser timers. */\n readonly schedule?: (callback: () => void, delay: number) => unknown\n readonly cancel?: (handle: unknown) => void\n /** Per-RPC safety timeout used only while the Host is restarting. */\n readonly requestTimeout?: (callback: () => void, delay: number) => unknown\n readonly cancelRequestTimeout?: (handle: unknown) => void\n /** Same-origin liveness fallback when a new Host lacks this plugin route. */\n readonly liveness?: () => Promise<boolean>\n readonly reload?: () => void\n}\n\nconst INITIAL_RESTART: RestartSnapshot = {\n phase: 'unknown', status: null, activity: [], elapsedMs: 0, error: null,\n}\n\n/**\n * Restart state belongs to the client entry, not a modal component, so closing\n * the update panel cannot strand a confirmed restart half-way through recovery.\n * It starts no timer until the user confirms a restart request.\n */\nexport class RestartStore implements Observable<RestartSnapshot> {\n private snapshot: RestartSnapshot = INITIAL_RESTART\n private readonly listeners = new Set<() => void>()\n private timer: unknown\n private generation = 0\n private stopped = false\n private readonly schedule: (callback: () => void, delay: number) => unknown\n private readonly cancelTimer: (handle: unknown) => void\n private readonly requestTimeout: (callback: () => void, delay: number) => unknown\n private readonly cancelRequestTimeout: (handle: unknown) => void\n private readonly liveness: () => Promise<boolean>\n private readonly reload: () => void\n private pendingAbort: AbortController | undefined\n private reloaded = false\n\n constructor(private readonly connection: ConnectionClient, options: RestartStoreOptions = {}) {\n this.schedule = options.schedule ?? ((callback, delay) => window.setTimeout(callback, delay))\n this.cancelTimer = options.cancel ?? (handle => { window.clearTimeout(handle as number) })\n this.requestTimeout = options.requestTimeout ?? ((callback, delay) => window.setTimeout(callback, delay))\n this.cancelRequestTimeout = options.cancelRequestTimeout ?? (handle => { window.clearTimeout(handle as number) })\n this.liveness = options.liveness ?? (async () => {\n try {\n const response = await fetch(new URL('.', window.location.href), { method: 'HEAD', credentials: 'same-origin', cache: 'no-store' })\n return response.status === 200 || response.status === 401\n } catch { return false }\n })\n this.reload = options.reload ?? (() => window.location.reload())\n }\n\n getSnapshot = (): RestartSnapshot => this.snapshot\n\n subscribe = (listener: () => void): (() => void) => {\n this.listeners.add(listener)\n return () => { this.listeners.delete(listener) }\n }\n\n stop(): void {\n this.stopped = true\n this.generation += 1\n if (this.timer !== undefined) this.cancelTimer(this.timer)\n this.timer = undefined\n this.pendingAbort?.abort()\n this.pendingAbort = undefined\n this.listeners.clear()\n }\n\n /** Read capability on a visible surface; this is not a restart and never polls. */\n async refresh(): Promise<void> {\n if (this.snapshot.phase === 'waiting') return\n const raw = await this.call(RESTART_ENDPOINTS.status, {})\n if (raw === undefined) return\n const status = restartStatusOf(raw)\n if (status === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart-status payload' })\n return\n }\n this.publish({ phase: status.available ? 'idle' : 'idle', status, activity: [], elapsedMs: 0, error: null })\n }\n\n /** First click checks active work and arms the second, destructive action. */\n async check(): Promise<void> {\n this.publish({ ...this.snapshot, phase: 'checking', error: null })\n const raw = await this.call(RESTART_ENDPOINTS.check, {})\n if (raw === undefined) return\n const checked = restartCheckOf(raw)\n if (checked === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart-check payload' })\n return\n }\n if (checked.kind === 'unavailable') {\n this.publish({ phase: 'idle', status: checked.status, activity: [], elapsedMs: 0, error: null })\n return\n }\n this.publish({\n phase: 'armed', status: checked.status,\n activity: checked.activity?.items ?? [], elapsedMs: 0, error: null,\n })\n }\n\n cancel(): void {\n if (this.snapshot.phase !== 'armed' && this.snapshot.phase !== 'error' && this.snapshot.phase !== 'timeout') return\n this.publish({ ...this.snapshot, phase: this.snapshot.status === null ? 'unknown' : 'idle', activity: [], elapsedMs: 0, error: null })\n }\n\n /** Second click emits the Host request; `force` is only true after the activity list was shown. */\n async request(force: boolean): Promise<void> {\n const current = this.snapshot\n if (current.phase !== 'armed' || current.status === null || !current.status.available) return\n this.publish({ ...current, phase: 'checking', error: null })\n const raw = await this.call(RESTART_ENDPOINTS.request, { force, expectedInstanceId: current.status.instanceId })\n if (raw === undefined) return\n const result = restartRequestOf(raw)\n if (result === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'invalid restart payload' })\n return\n }\n if (result.kind === 'scheduled' || result.kind === 'in-progress') {\n if (result.instanceId === undefined) {\n this.publish({ ...this.snapshot, phase: 'error', error: 'restart response omitted instance identity' })\n return\n }\n this.beginRecovery(result.instanceId)\n return\n }\n if (result.kind === 'active-work' || result.kind === 'ready') {\n this.publish({\n phase: 'armed', status: result.status ?? current.status,\n activity: result.activity?.items ?? [], elapsedMs: 0, error: null,\n })\n return\n }\n this.publish({ phase: 'idle', status: result.status ?? current.status, activity: [], elapsedMs: 0, error: null })\n }\n\n private beginRecovery(previousInstanceId: string): void {\n const generation = ++this.generation\n const startedAt = Date.now()\n this.publish({ ...this.snapshot, phase: 'waiting', elapsedMs: 0, error: null })\n const attempt = async (delay: number): Promise<void> => {\n if (this.stopped || generation !== this.generation) return\n const elapsedMs = Date.now() - startedAt\n if (elapsedMs >= 60_000) {\n this.publish({ ...this.snapshot, phase: 'timeout', elapsedMs, error: null })\n return\n }\n this.timer = this.schedule(() => {\n void (async () => {\n if (this.stopped || generation !== this.generation) return\n const raw = await this.call(RESTART_ENDPOINTS.status, {}, false, 4_000)\n if (this.stopped || generation !== this.generation) return\n const status = raw === undefined ? undefined : restartStatusOf(raw)\n const nextElapsed = Date.now() - startedAt\n if (status !== undefined && status.instanceId !== previousInstanceId) {\n this.publish({ phase: 'waiting', status, activity: [], elapsedMs: nextElapsed, error: null })\n if (!this.reloaded) { this.reloaded = true; this.reload() }\n return\n }\n // A healthy carrier with no plugin route means the new DSH came back\n // but this plugin did not load. Refresh so the page can show the real\n // startup failure instead of claiming DSH is still down forever.\n if (raw === undefined && await this.liveness()) {\n if (!this.reloaded) { this.reloaded = true; this.reload() }\n return\n }\n this.publish({ ...this.snapshot, phase: 'waiting', elapsedMs: nextElapsed })\n await attempt(Math.min(delay * 2, 10_000))\n })()\n }, delay)\n }\n void attempt(1_000)\n }\n\n private async call(endpoint: string, payload: unknown, surfaceError: boolean = true, timeoutMs?: number): Promise<unknown | undefined> {\n const rpc = this.connection.rpc\n if (rpc === undefined || typeof rpc.call !== 'function') {\n if (surfaceError) this.publish({ ...this.snapshot, phase: 'error', error: 'DSH connection RPC is unavailable' })\n return undefined\n }\n const controller = timeoutMs === undefined ? undefined : new AbortController()\n if (controller !== undefined) this.pendingAbort = controller\n let timeout: unknown\n if (controller !== undefined && timeoutMs !== undefined) timeout = this.requestTimeout(() => controller.abort(), timeoutMs)\n try {\n const raw = await rpc.call(UPDATE_STATUS_CHANNEL, endpoint, payload, controller?.signal)\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) throw new Error('invalid restart RPC response')\n const envelope = raw as { ok?: unknown; value?: unknown; error?: { message?: unknown } }\n if (envelope.ok !== true) throw new Error(typeof envelope.error?.message === 'string' ? envelope.error.message : 'restart RPC failed')\n return envelope.value\n } catch (error) {\n if (surfaceError) this.publish({ ...this.snapshot, phase: 'error', error: errorMessage(error) })\n return undefined\n } finally {\n if (timeout !== undefined) this.cancelRequestTimeout(timeout)\n if (this.pendingAbort === controller) this.pendingAbort = undefined\n }\n }\n\n private publish(next: RestartSnapshot): void {\n if (this.stopped) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\n/**\n * The one settings namespace, which on DSH 0.1.7 IS the Loader entry id in\n * `cordis.patch.yml`: the Host half's volatile `Config` fields are projected as\n * that entry's form, and the browser half addresses the same id through\n * `ctx.configForms.get(...)`.\n */\nexport const SETTINGS_NAMESPACE = PLUGIN_ID\n","/**\n * dsh-update-status — fallback direct Host settings channel.\n *\n * Older DSH clients made the official form unavailable on non-loopback pages.\n * This channel kept the sidebar toggle and cache policy connected to the ONE\n * Host settings entry `dsh-update-status` on those clients. Current DSH forms\n * use the shared Host mirror on LAN pages too and no longer expose `mode`.\n *\n * The fallback remains for an absent or unavailable official form, selected by\n * `settingsChannel.ts`, never by page origin. It speaks the SAME authenticated\n * Remote as the official form (`settings.describe` / `settings.mutate`) and\n * preserves Host authorization and revision fences; it does not grant access.\n * A ready official form, including a read-only one, never opens this channel.\n * An absent Remote, refused read or malformed answer remains unavailable.\n */\nimport type { SettingsPathOpLike, SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\n\n/** One namespace row of a `settings.describe` answer (the fields consumed here). */\nexport interface SettingsNamespaceViewLike {\n readonly ns: string\n readonly value: unknown\n readonly base?: unknown\n readonly user?: unknown\n readonly revision: number\n}\n\n/** The `settings.describe` answer body. */\nexport interface SettingsDescribeViewLike {\n readonly writable: boolean\n readonly hasDocument?: boolean\n readonly namespaces: readonly SettingsNamespaceViewLike[]\n}\n\n/** The Remote envelope every generated client call answers with. */\nexport type SettingsRemoteOutcome<T> =\n | { readonly ok: true; readonly value: T }\n | { readonly ok: false; readonly error?: { readonly code?: string; readonly message?: string } }\n\n/** The `remote.settings` namespace face (structural; never imported at runtime). */\nexport interface SettingsRemoteLike {\n describe(): Promise<SettingsRemoteOutcome<SettingsDescribeViewLike>>\n mutate(\n namespace: string,\n ops: readonly SettingsPathOpLike[],\n expectedRevision?: number,\n ): Promise<SettingsRemoteOutcome<SettingsNamespaceViewLike>>\n}\n\n/** A refused namespace write; `code` keeps the Host's own diagnosis. */\nexport class SettingsWriteFailure extends Error {\n readonly code: string\n\n constructor(code: string, message?: string) {\n super(message === undefined || message === '' ? code : message)\n this.name = 'SettingsWriteFailure'\n this.code = code\n }\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null\n}\n\n/**\n * Guard: does this value look like the `remote.settings` namespace face?\n * Applied to a bare service object (`ctx.get('remote.settings')` or a payload\n * member), and it never calls anything.\n */\nexport function settingsRemoteFace(value: unknown): SettingsRemoteLike | undefined {\n if (!isRecord(value)) return undefined\n if (typeof value.describe !== 'function' || typeof value.mutate !== 'function') return undefined\n return value as unknown as SettingsRemoteLike\n}\n\n/**\n * Guard: read the `remote.settings` face off an injection payload.\n *\n * The payload a `ctx.inject(['remote.settings'], …)` callback receives exposes\n * the LITERAL service key. Reading the dotted PARENT off that injected context\n * (`payload.remote`) throws `cannot get property \"remote\" without inject` — a\n * throw that used to abort a whole wiring callback on a LAN page. So the literal\n * key is read FIRST and every read is contained; the nested\n * (`payload.remote.settings`) shape is only a fallback for a plain object\n * payload. Both absence and refusal answer `undefined`.\n */\nexport function settingsRemoteOf(raw: unknown): SettingsRemoteLike | undefined {\n if (!isRecord(raw)) return undefined\n try {\n const direct = settingsRemoteFace((raw as Record<string, unknown>)['remote.settings'])\n if (direct !== undefined) return direct\n } catch {\n // Injected-context proxy refusal: fall through to the nested shape.\n }\n try {\n const remote = (raw as { remote?: unknown }).remote\n if (isRecord(remote)) return settingsRemoteFace(remote.settings)\n } catch {\n // Same refusal: no face is readable from this payload.\n }\n return undefined\n}\n\n/**\n * Guard: subscribe to the Host's settings-document invalidation on the Remote\n * service object (`remote.$on`). Returns undefined when the service exposes no\n * event seam — the preferences then refresh on reconnect only.\n */\nexport function settingsInvalidationsOf(service: unknown): ((listener: () => void) => () => void) | undefined {\n if (!isRecord(service)) return undefined\n const on = service.$on\n if (typeof on !== 'function') return undefined\n return (listener) => {\n const dispose = (on as (event: string, callback: () => void) => unknown)\n .call(service, 'settings/document-updated', listener)\n return typeof dispose === 'function' ? dispose as () => void : () => {}\n }\n}\n\n/** The channel consumers subscribe to, plus the refresh/dispose seams the client wires. */\nexport interface HostDirectScope extends SettingsScopeLike {\n /** Re-read the Host document; resolves after the snapshot reflects the answer. */\n load(): Promise<void>\n /** Drop every listener and stop accepting work. */\n dispose(): void\n /** Last Host error message (diagnostics only; never rendered as plugin state). */\n lastError(): string | undefined\n}\n\nfunction cloneOps(ops: readonly SettingsPathOpLike[]): SettingsPathOpLike[] {\n try {\n return structuredClone(ops) as SettingsPathOpLike[]\n } catch {\n // structuredClone absent/refusing the shape: copy by hand (the op payload is\n // plain JSON by contract, so a shallow structural copy is equivalent).\n return ops.map(op => (op.op === 'set'\n ? { op: 'set' as const, path: [...op.path], value: op.value }\n : { op: 'unset' as const, path: [...op.path] }))\n }\n}\n\nfunction messageOf(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction sameSnapshot(a: SettingsScopeSnapshotLike, b: SettingsScopeSnapshotLike): boolean {\n return a.status === b.status\n && a.revision === b.revision\n && a.writable === b.writable\n && a.mode === b.mode\n && a.value === b.value\n && a.base === b.base\n && a.user === b.user\n}\n\nfunction readySnapshot(\n row: SettingsNamespaceViewLike,\n writable: boolean,\n): SettingsScopeSnapshotLike {\n return {\n status: 'ready',\n // The raw section crosses this boundary untouched: PreferencesStore is the\n // plugin's own strict judge and reports a hand-edited or future-schema\n // document truthfully instead of silently dropping it.\n value: row.value,\n base: row.base,\n user: row.user,\n revision: row.revision,\n writable,\n mode: 'host',\n }\n}\n\nfunction unavailableSnapshot(writable: boolean): SettingsScopeSnapshotLike {\n return {\n status: 'unavailable',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable,\n mode: 'host',\n }\n}\n\n/**\n * Build the direct Host settings scope for one namespace.\n *\n * Snapshot semantics mirror the official per-namespace derivation: a namespace\n * row answers `ready` with the resolved section, its `base`/`user` layers and its\n * revision fence, and the document's `writable` decides editability. A row the\n * Host does not serve answers `unavailable`; a refused read keeps the last\n * confirmed document and reports `unavailable` only while it has never held one.\n *\n * Writes are serialized in issue order, fenced by the latest known revision and\n * REJECT with {@link SettingsWriteFailure} on a Host refusal — that rejection is\n * what makes the settings page surface a conflict instead of pretending the edit\n * landed (the official scope resolves on `!ok` after its recovery read).\n *\n * @param remote - the `remote.settings` face of the page's Remote service.\n * @param namespace - the settings namespace this scope derives from.\n * @returns the scope plus its load/dispose seams.\n */\nexport function createHostDirectScope(remote: SettingsRemoteLike, namespace: string): HostDirectScope {\n let snapshot: SettingsScopeSnapshotLike = {\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n mode: 'host',\n }\n let held: SettingsScopeSnapshotLike | undefined\n let error: string | undefined\n let disposed = false\n let tail: Promise<void> = Promise.resolve()\n const listeners = new Set<() => void>()\n\n const publish = (next: SettingsScopeSnapshotLike): void => {\n if (disposed || sameSnapshot(next, snapshot)) return\n snapshot = next\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A broken listener must never break the channel.\n }\n }\n }\n\n const adopt = (next: SettingsScopeSnapshotLike): void => {\n if (next.status === 'ready') held = next\n publish(next)\n }\n\n async function load(): Promise<void> {\n if (disposed) return\n let outcome: SettingsRemoteOutcome<SettingsDescribeViewLike>\n try {\n outcome = await remote.describe()\n } catch (caught) {\n outcome = { ok: false, error: { message: messageOf(caught) } }\n }\n if (disposed) return\n if (!outcome.ok) {\n error = outcome.error?.message ?? outcome.error?.code ?? 'settings/describe-failed'\n // A refused read never invents state: the last confirmed document stays\n // authoritative; without one the channel is unavailable.\n publish(held ?? unavailableSnapshot(snapshot.writable))\n return\n }\n error = undefined\n const view = outcome.value\n const writable = view.writable === true\n const row = Array.isArray(view.namespaces)\n ? view.namespaces.find(candidate => candidate.ns === namespace)\n : undefined\n if (row === undefined || typeof row.revision !== 'number') {\n publish(unavailableSnapshot(writable))\n return\n }\n adopt(readySnapshot(row, writable))\n }\n\n /** Fold one write answer's namespace row in without a second wire read. */\n function fold(row: SettingsNamespaceViewLike, writable: boolean): void {\n if (typeof row.revision !== 'number') return\n adopt(readySnapshot(row, writable))\n }\n\n function mutate(ops: readonly SettingsPathOpLike[], expectedRevision?: number): Promise<void> {\n const owned = cloneOps(ops)\n const run = tail.then(async () => {\n if (disposed) throw new SettingsWriteFailure('settings/unavailable')\n const revision = expectedRevision ?? snapshot.revision\n let outcome: SettingsRemoteOutcome<SettingsNamespaceViewLike>\n try {\n outcome = revision === undefined\n ? await remote.mutate(namespace, owned)\n : await remote.mutate(namespace, owned, revision)\n } catch (caught) {\n await load()\n throw new SettingsWriteFailure('settings/unreachable', messageOf(caught))\n }\n if (outcome.ok) {\n // A successful write proves the document accepts writes on this page.\n fold(outcome.value, true)\n return\n }\n await load()\n throw new SettingsWriteFailure(\n outcome.error?.code ?? 'settings/unknown',\n outcome.error?.message,\n )\n })\n // The queue never poisons itself: the caller sees the rejection, the next\n // queued write still runs.\n tail = run.then(() => undefined, () => undefined)\n return run\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n // The official scope implements `set` exactly this way; the revision fence\n // falls back to the latest known one, same as the official pendingRevision.\n set: (field, value) => mutate([{ op: 'set', path: [field], value }]),\n load,\n dispose() {\n disposed = true\n listeners.clear()\n },\n lastError: () => error,\n }\n}\n","/**\n * dsh-update-status — official settings-form adapter.\n *\n * DSH 0.1.7 removed the per-namespace `settingsScope` service this plugin's\n * client half was built on. Its successor is `ctx.configForms`\n * (`@deepseek-ai/dsh-client-ui-settings`): one shared `settings.describe`\n * mirror per browser plus a per-entry write queue, reached as\n * `ctx.configForms.get(entryId)` for the entry the plugin's Host half owns.\n * That form already answers the exact facts this plugin's own scope contract\n * needs — status, value, base, user, revision, writable — so this module\n * projects it onto {@link SettingsScopeLike}. Channel selection depends on\n * availability, never on the page origin or the optional legacy `mode`.\n *\n * Two deliberate translations:\n *\n * - A refused write (`set` answers `false`) becomes a REJECTION. The settings\n * page must surface a conflict instead of pretending the edit landed, which\n * is the same contract the direct Host channel already obeys\n * (`hostDirectScope.ts`). A transport fault rejects too.\n * - Legacy forms may supply `mode`; current forms omit it. Preserve the value\n * if supplied, without inventing one or inferring write permission from it.\n * `status` selects the channel, `writable` describes editability, and the Host\n * decides whether an actual write is accepted.\n *\n * The service is deliberately read structurally: the client bundle purity gate\n * forbids cross-plugin value imports, and the runtime object belongs to the\n * user's harness.\n */\nimport type { SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\nimport { SettingsWriteFailure } from './hostDirectScope.ts'\n\n/** One form snapshot as `ConfigForm.getSnapshot()` answers it. */\nexport interface ConfigFormSnapshotLike<T> {\n status: 'loading' | 'ready' | 'unavailable'\n value: T | undefined\n base: unknown\n user: unknown\n revision: number | undefined\n writable: boolean\n /** Legacy DSH metadata; current forms omit it. Never an authorization signal. */\n mode?: 'host' | 'memory' | undefined\n}\n\n/** The subset of `ConfigForm<T>` this adapter reads. */\nexport interface ConfigFormLike<T = unknown> {\n getSnapshot(): ConfigFormSnapshotLike<T>\n subscribe(listener: () => void): () => void\n set(field: string, value: unknown): Promise<boolean>\n}\n\n/** The `ctx.configForms` binder face. */\nexport interface ConfigFormsFace {\n get<T>(entryId: string): ConfigFormLike<T>\n}\n\n/**\n * Guard: read the `configForms` face off an injection payload.\n *\n * The literal service key is read inside a `try`, because an injected payload\n * proxy can refuse a member read (the failure this plugin already hit on the\n * dotted `remote.settings` parent). Absence and refusal both answer\n * `undefined`, which leaves the channel on its direct Host path.\n *\n * @param raw - the payload a `ctx.inject(['configForms'], …)` callback received.\n * @returns the binder face, or undefined when this page has no settings forms.\n */\nexport function configFormsOf(raw: unknown): ConfigFormsFace | undefined {\n if (raw === null || typeof raw !== 'object') return undefined\n let face: unknown\n try {\n face = (raw as Record<string, unknown>)['configForms']\n } catch {\n return undefined\n }\n if (face === null || typeof face !== 'object') return undefined\n if (typeof (face as { get?: unknown }).get !== 'function') return undefined\n return face as ConfigFormsFace\n}\n\n/**\n * Project one official config form onto the plugin's settings-scope contract.\n *\n * @param form - the shared form for the plugin's own Loader entry id.\n * @returns a scope the preferences store and the channel selection can use as-is.\n */\nexport function configFormScope(form: ConfigFormLike): SettingsScopeLike {\n return {\n getSnapshot(): SettingsScopeSnapshotLike {\n const snapshot = form.getSnapshot()\n return {\n status: snapshot.status,\n value: snapshot.value as SettingsScopeSnapshotLike['value'],\n base: snapshot.base,\n user: snapshot.user,\n revision: snapshot.revision,\n writable: snapshot.writable,\n mode: snapshot.mode,\n }\n },\n subscribe(listener) {\n return form.subscribe(listener)\n },\n async set(field, value) {\n let accepted: boolean\n try {\n accepted = await form.set(field, value)\n } catch (error) {\n // Transport fault: the write did not land and the caller must not\n // pretend it did (the recovery read belongs to the form itself).\n throw new SettingsWriteFailure(\n 'settings/unreachable',\n error instanceof Error ? error.message : String(error),\n )\n }\n if (!accepted) {\n // Refused or skipped (memory mode, stale revision, Host validation):\n // the form has already re-read the authoritative value.\n throw new SettingsWriteFailure('settings/conflict')\n }\n },\n }\n}\n","/**\n * dsh-update-status — settings source selection.\n *\n * The plugin's ONE storage contract is the Host settings entry\n * `dsh-update-status`. Two client channels can serve it:\n *\n * 1. the official `ctx.configForms` form — the DSH 0.1.7 successor of the\n * removed `settingsScope` service, available on current LAN pages too, and\n * 2. the direct Host channel (`hostDirectScope.ts`), retained for hosts where\n * the official form is absent or unavailable (including older LAN clients).\n *\n * This module picks between them without ever guessing:\n *\n * - The official form wins whenever it is not `unavailable`, on any origin,\n * keeping its shared describe mirror, write queue and revision fences without\n * an extra wire read. A read-only ready form still wins.\n * - When the official form is absent or reports `unavailable`, the direct\n * channel is opened lazily. It uses the same Host authorization policy.\n * - With neither source the channel stays `loading`, i.e. exactly the state this\n * plugin had before the direct channel existed.\n */\nimport type { SettingsScopeLike, SettingsScopeSnapshotLike } from './scopeFaces.ts'\n\n/** Snapshot used while no channel has answered yet. */\nconst LOADING_SNAPSHOT: SettingsScopeSnapshotLike = Object.freeze({\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n mode: 'host',\n}) as SettingsScopeSnapshotLike\n\nexport interface SettingsChannelOptions {\n /**\n * Build the direct Host channel. Called at most once, and only when the\n * official scope cannot serve this page. Returning `undefined` (the Remote\n * service is not composed) leaves the channel on the official/unavailable\n * path; a later {@link SettingsChannel.refresh} retries.\n */\n openDirect(): SettingsScopeLike | undefined\n}\n\nexport interface SettingsChannel extends SettingsScopeLike {\n /** Point the channel at the official form once the service answers. */\n setOfficial(scope: SettingsScopeLike | undefined): void\n /** Re-evaluate the selection (e.g. the Remote service just arrived). */\n refresh(): void\n /** Ask the active source for a fresh read (no-op for the official form). */\n reload(): void\n dispose(): void\n}\n\nfunction sameSnapshot(a: SettingsScopeSnapshotLike, b: SettingsScopeSnapshotLike): boolean {\n return a.status === b.status\n && a.revision === b.revision\n && a.writable === b.writable\n && a.mode === b.mode\n && a.value === b.value\n && a.base === b.base\n && a.user === b.user\n}\n\n/** The load seam a direct channel exposes (the official scope refreshes itself). */\ntype LoadableScope = SettingsScopeLike & { load?: () => Promise<void> }\n\n/** Ask a channel for its first/next read; a refusal surfaces as a snapshot, never a throw. */\nfunction loadSource(source: SettingsScopeLike | undefined): Promise<void> {\n const loadable = source as LoadableScope | undefined\n if (loadable === undefined || typeof loadable.load !== 'function') return Promise.resolve()\n return Promise.resolve(loadable.load()).then(() => undefined, () => undefined)\n}\n\nexport function createSettingsChannel(options: SettingsChannelOptions): SettingsChannel {\n let official: SettingsScopeLike | undefined\n let direct: SettingsScopeLike | undefined\n let active: SettingsScopeLike | undefined\n let snapshot: SettingsScopeSnapshotLike = LOADING_SNAPSHOT\n let disposed = false\n const disposers: Array<() => void> = []\n const listeners = new Set<() => void>()\n\n const notify = (): void => {\n for (const listener of [...listeners]) {\n try {\n listener()\n } catch {\n // A broken listener must never break the channel.\n }\n }\n }\n\n const publish = (next: SettingsScopeSnapshotLike): void => {\n if (disposed || sameSnapshot(next, snapshot)) return\n snapshot = next\n notify()\n }\n\n const select = (): SettingsScopeLike | undefined => {\n // Availability decides authority, not page origin or legacy mode metadata.\n if (official !== undefined && official.getSnapshot().status !== 'unavailable') return official\n if (direct === undefined) {\n try {\n direct = options.openDirect()\n } catch {\n direct = undefined\n }\n if (direct !== undefined) {\n try {\n disposers.push(direct.subscribe(() => {\n if (active === direct) publish(direct!.getSnapshot())\n }))\n } catch {\n // An unsubscribable direct channel is still readable synchronously.\n }\n // The direct channel has no owner to `ensure()` it (the official scope is\n // ensured by its own plugin), so the initial read is issued here.\n void loadSource(direct)\n }\n }\n return direct ?? official\n }\n\n const reselect = (): void => {\n if (disposed) return\n const next = select()\n if (next !== active) {\n active = next\n publish(next?.getSnapshot() ?? LOADING_SNAPSHOT)\n return\n }\n // Same source: forward its current snapshot (a change must have come from it).\n publish(next?.getSnapshot() ?? LOADING_SNAPSHOT)\n }\n\n return {\n getSnapshot: () => snapshot,\n subscribe(listener) {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n set(field, value) {\n const source = active\n if (source === undefined) {\n return Promise.reject(new Error('dsh-update-status: settings channel is unavailable'))\n }\n return source.set(field, value)\n },\n setOfficial(scope) {\n if (disposed) return\n official = scope\n if (scope !== undefined) {\n try {\n disposers.push(scope.subscribe(() => {\n reselect()\n }))\n } catch {\n // Guarded read path: selection still happens synchronously below.\n }\n }\n reselect()\n },\n refresh: reselect,\n reload() {\n if (active === undefined || active === official) return\n void loadSource(active)\n },\n dispose() {\n disposed = true\n listeners.clear()\n for (const dispose of disposers.splice(0)) {\n try {\n dispose()\n } catch {\n // Contained.\n }\n }\n const disposable = active as (SettingsScopeLike & { dispose?: () => void }) | undefined\n if (disposable !== undefined && typeof disposable.dispose === 'function') {\n try {\n disposable.dispose()\n } catch {\n // Contained.\n }\n }\n },\n }\n}\n","/** Plugin-owned CSS only; no shell DOM selection or official SVG manipulation. */\n\nexport const UPDATE_STATUS_CSS = `\n.dus-brand-name{align-items:center;gap:6px;height:24px;max-width:100%;min-width:0;display:inline-flex}\n.dus-brand-deepseek{font-size:14px;font-weight:650;letter-spacing:-.015em;line-height:24px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n/* The chip is a NEUTRAL SECOND-LEVEL SURFACE, never a high-contrast pill. It used\n to be label-primary + label-primary-inverted, which is a near-white box with dark\n text on the dark shell — a white frame that swallows the amber halo and fights the\n warn colour. --dsw-alias-button-floating-hover is the one palette surface that is\n grey in BOTH themes (#f1f3f5 light / #353638 dark), matching the reference: a light\n grey chip on the light shell, a dark grey chip with white text on the dark one. The\n sibling button-floating-fill is pure white in light mode and changes nothing there.\n Text stays label-primary (#0f1115 light / #f9fafb dark), so it is never low-contrast.\n Every colour here is a theme token, so the chip follows whatever appearance DSH\n resolves — light, dark, or system-follows-the-OS — with no plugin-side detection,\n no media query and no per-theme branch to keep in sync. */\n.dus-badge{--dus-badge-surface:var(--dsw-alias-button-floating-hover,#f1f3f5);align-items:center;background:var(--dus-badge-surface);border:0;border-radius:4px;color:var(--dsw-alias-label-primary,#0f1115);cursor:pointer;display:inline-flex;flex:none;font-family:var(--ds-font-family-code,var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace));font-size:10px;font-variant-numeric:tabular-nums;font-weight:600;gap:4px;height:16px;line-height:16px;max-width:140px;outline:none;padding:0 6px;touch-action:manipulation;user-select:none;white-space:nowrap}\n.dus-badge:focus-visible,.dus-action:focus-visible,.dus-close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n/* Hover has to read as \"raised\" in BOTH themes. brightness() only ever brightens, and on\n the light shell it turns the grey chip pure white — the chip all but disappears. Mixing\n a little of the theme's own label colour into the surface darkens it in light mode and\n lightens it in dark mode, so one declaration stays correct in both. The brightness\n filter remains the fallback: an engine without color-mix drops only the second\n declaration, never the whole hover rule. */\n.dus-badge:hover{filter:brightness(1.08)}\n@supports (background:color-mix(in srgb,red 50%,transparent)){.dus-badge:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary) 8%,var(--dus-badge-surface));filter:none}}\n/* The failure state is the one deliberate repaint, and it follows the shell's own\n badge pattern (brokenBadge): error fill with a bg-layer-3 label, which is white\n text on the dark red of the light theme and dark text on the light red of the dark\n theme — readable in both, unlike the fixed white text it replaces. */\n.dus-badge[data-error=true]{background:var(--dsw-alias-state-error-primary,#dc2626);color:var(--dsw-alias-bg-layer-3,#fff)}\n.dus-badge-version{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dus-dot{background:currentColor;border-radius:50%;display:inline-block;flex:0 0 auto;height:5px;opacity:.9;width:5px}\n/* An available update repaints NOTHING: the chip keeps its normal fill and only\n the amber dot breathes. The halo is animated with the dot so the glow grows\n and shrinks as one light, never as a separate ripple. The update state is\n declared AFTER the loading state, so a re-check on a known update keeps the\n amber glow instead of falling back to the neutral loading pulse.\n Each box-shadow is declared twice: a literal amber first for any engine\n without color-mix, then the halo mixed from the theme's own warn colour so the\n glow always matches the dot in both light and dark themes. */\n/* The dot carries the whole status. Three states, in precedence order:\n up to date = a plain green circle (success token, never the text colour, so a\n dark theme no longer paints a black dot that reads as \"off\"); checking = the\n neutral grey pulse; a pending update = the amber dot below, which is the only\n state allowed to breathe or glow.\n The up-to-date rule is declared BEFORE loading and update: equal specificity, so\n the later, louder states win if two ever land on the same dot. */\n.dus-dot[data-state=current]{background:var(--dsw-alias-state-success-primary,#22c55e);opacity:1}\n.dus-dot[data-loading=true]{animation:dus-pulse .9s ease-in-out infinite}\n.dus-dot[data-update=true]{--dus-update-color:var(--dsw-alias-state-warn-primary,#f59e0b);animation:dus-update-pulse 1.6s ease-in-out infinite;background:var(--dus-update-color);height:6px;opacity:1;width:6px}\n@keyframes dus-pulse{0%,100%{opacity:.45;transform:scale(.82)}50%{opacity:1;transform:scale(1.15)}}\n@keyframes dus-update-pulse{0%,100%{box-shadow:0 0 2px 0 rgba(245,158,11,.4);box-shadow:0 0 2px 0 color-mix(in srgb,var(--dus-update-color) 45%,transparent);transform:scale(.8)}50%{box-shadow:0 0 7px 2px rgba(245,158,11,.72);box-shadow:0 0 7px 2px color-mix(in srgb,var(--dus-update-color) 72%,transparent);transform:scale(1.15)}}\n@media (prefers-reduced-motion:reduce){.dus-dot[data-update=true],.dus-dot[data-loading=true]{animation:none}.dus-dot[data-update=true]{box-shadow:0 0 5px 1px rgba(245,158,11,.6);box-shadow:0 0 5px 1px color-mix(in srgb,var(--dus-update-color) 62%,transparent)}}\n.dus-overlay-root{background:transparent;border:0;color:inherit;height:100dvh;inset:0;margin:0;max-height:none;max-width:none;padding:0;pointer-events:none;position:fixed;width:100vw}\n.dus-overlay-root::backdrop{background:transparent}\n.dus-backdrop{background:transparent;inset:0;pointer-events:auto;position:absolute}\n.dus-panel{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);border-radius:14px;box-shadow:var(--dsw-elevation-panel);box-sizing:border-box;color:var(--dsw-alias-label-primary);left:min(292px,calc(100vw - 402px));max-height:min(640px,calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));overflow:auto;padding:14px;pointer-events:auto;position:absolute;top:12px;width:min(390px,calc(100vw - 24px));z-index:1}\n.dus-panel-head{align-items:center;display:flex;gap:8px;justify-content:space-between;margin-bottom:12px}\n.dus-panel-title{font-size:14px;font-weight:650}\n.dus-close{align-items:center;background:transparent;border:0;border-radius:8px;color:inherit;cursor:pointer;display:inline-flex;font-size:20px;height:32px;justify-content:center;line-height:1;min-height:32px;min-width:32px;padding:0;touch-action:manipulation;width:32px}\n.dus-close:hover,.dus-action:hover{background:var(--dsw-alias-button-floating-hover)}\n.dus-cache-setting{border:1px solid var(--dsw-alias-border-l2);border-radius:9px;margin:0 0 12px;padding:9px}\n.dus-cache-field{align-items:center;display:flex;font-size:12px;font-weight:600;gap:10px;justify-content:space-between}\n.dus-cache-input-wrap{align-items:center;display:flex;gap:6px;font-size:11px;font-weight:400}\n.dus-cache-input{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:inherit;font:inherit;min-height:30px;padding:0 7px;text-align:right;width:72px}\n.dus-cache-input:focus{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-cache-input:disabled{cursor:not-allowed;opacity:.55}\n.dus-cache-hint{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.4;margin:7px 0 0}\n.dus-state{border-radius:9px;color:var(--dsw-alias-label-primary);font-size:12px;line-height:1.45;margin:0 0 12px;padding:8px 9px}\n.dus-state[data-kind=update],.dus-state[data-kind=warning]{background:var(--dsw-alias-state-warn-tertiary)}\n.dus-state[data-kind=ok]{background:var(--dsw-alias-state-success-tertiary)}\n.dus-state[data-kind=error]{background:var(--dsw-alias-bg-layer-3)}\n.dus-metadata{display:grid;gap:9px;margin:0 0 12px}\n.dus-metadata-row{align-items:baseline;display:grid;gap:8px;grid-template-columns:minmax(0,1fr) auto}\n.dus-meta-label{color:var(--dsw-alias-label-secondary);font-size:12px}\n.dus-meta-value{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;max-width:210px;overflow-wrap:anywhere;text-align:right}\n.dus-meta-sub{color:var(--dsw-alias-label-secondary);font-size:11px;grid-column:1 / -1}\n/* One card per upgradable version. Every value here is a theme token, so the\n cards follow light, dark and OS-following appearances with no plugin-side\n detection; only the highest version's border changes, because \"newest\" is the\n single fact that must survive a glance at a multi-card list. */\n.dus-releases{display:grid;gap:9px;margin:0 0 12px}\n.dus-release{background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:9px}\n.dus-release[data-highlight=true]{border-color:var(--dsw-alias-state-warn-primary)}\n.dus-release-head{align-items:center;display:flex;flex-wrap:wrap;gap:6px}\n.dus-release-version{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:12px;font-weight:650;overflow-wrap:anywhere}\n.dus-release-meta{align-items:baseline;color:var(--dsw-alias-label-secondary);display:flex;flex-wrap:wrap;font-size:11px;gap:2px 8px;line-height:1.45;margin:5px 0 0}\n.dus-release-line{font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-variant-numeric:tabular-nums}\n.dus-pill{border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-secondary);font-size:10px;line-height:16px;padding:0 6px;white-space:nowrap}\n.dus-pill-latest{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);font-weight:600}\n.dus-guidance{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:0 0 12px}\n.dus-warning{border-left:2px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:0 0 12px;padding-left:8px}\n.dus-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}\n.dus-action{background:var(--dsw-alias-button-floating-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;color:inherit;cursor:pointer;font-size:12px;line-height:30px;min-height:32px;padding:0 10px;touch-action:manipulation}\n.dus-action:disabled{cursor:wait;opacity:.65}\n.dus-restart{border-color:var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary)}\n.dus-restart-message{color:var(--dsw-alias-label-secondary);flex-basis:100%;font-size:11px;line-height:1.45;margin:0}\n.dus-restart-work{color:var(--dsw-alias-label-secondary);flex-basis:100%;font-size:11px;line-height:1.5;margin:0;overflow-wrap:anywhere;padding-left:18px}\n/* A job label is a whole shell command: clamp it so one long command cannot push\n the panel's buttons off a 390px card. */\n.dus-restart-work li{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}\n/* Recovery steps live under the disabled button and take their own row, like the\n active-work list: the instruction, the copyable commands, then the no-op note. */\n.dus-restart-recover{flex-basis:100%}\n.dus-command-label{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600;margin:0 0 6px}\n.dus-command{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;display:block;font-family:var(--dsw-font-family-mono,ui-monospace,SFMono-Regular,Menlo,monospace);font-size:11px;line-height:1.5;margin:0;overflow-wrap:anywhere;padding:9px;tab-size:2;user-select:text;white-space:pre-wrap}\n.dus-command:focus{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-note{color:var(--dsw-alias-label-secondary);font-size:11px;line-height:1.45;margin:8px 0 0}\n.dus-copy-message{color:var(--dsw-alias-state-business-primary);font-size:11px;margin:7px 0 0}\n.dus-command-actions{align-items:center;margin:8px 0 0}\n@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0;bottom:0;left:0;right:0;max-height:min(78dvh,calc(100dvh - env(safe-area-inset-top)));padding:16px max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));position:fixed;top:auto;width:100vw}.dus-action{min-height:40px;line-height:38px}.dus-close{height:40px;min-height:40px;min-width:40px;width:40px}}\n`\n","/**\n * DSH Web client half. It shadows only `sidebar.brand.name` with a compact\n * name + version chip that fits the 24px brand row and leaves the official fish\n * (`sidebar.brand.mark`) untouched. The detail panel is an additive\n * `shell.overlay`, never a chat-area floating widget.\n *\n * Deliberately NO `sidebar.footer.action` entry. DSH renders that list in one\n * row directly above `sidebar.settings`, and the collapsed rail's content box is\n * only 36px wide (the 56px column minus its 10px inline padding) — room for the\n * single official action. A second registrant makes that shared, centred row\n * overflow: on a phone it pushed the neighbouring plugin's entry off the screen\n * edge and parked our own dot on the rail's border. The chip in the expanded\n * brand row is the entry, so a collapsed sidebar carries none.\n *\n * The status read and the detail panel are NOT restricted to a loopback page.\n * Connection RPC stays authenticated and reachable there. Settings select the\n * official form whenever available, including current LAN pages; see\n * settings/settingsChannel.ts for the legacy fallback.\n *\n * Preferences live in the Host-side `dsh-update-status` settings entry — the\n * plugin's own Loader entry, whose volatile `Config` fields DSH 0.1.7 projects\n * as that entry's form. Two client channels can serve it: the official\n * `ctx.configForms.get(entryId)` form (the successor of the removed\n * `settingsScope` service) and, when that form is absent or unavailable,\n * a direct Host channel over `remote.settings`. See\n * settingsChannel.ts.\n */\n\nimport type { ClientContext, ConnectionClient } from './contract.ts'\nimport { BrandName, type SharedUi, UpdatePanel } from './components.tsx'\nimport { SETTINGS_NAMESPACE, PanelStore, PreferencesStore, RestartStore, StatusStore } from './stores.ts'\nimport { configFormScope, configFormsOf } from './settings/configFormScope.ts'\nimport {\n createHostDirectScope,\n settingsInvalidationsOf,\n settingsRemoteFace,\n settingsRemoteOf,\n type SettingsRemoteLike,\n} from './settings/hostDirectScope.ts'\nimport { createSettingsChannel } from './settings/settingsChannel.ts'\nimport { UPDATE_STATUS_CSS } from './styles.ts'\n\nconst PLUGIN_ID = 'dsh-update-status'\nconst CSS_TAG_ID = `${PLUGIN_ID}/styles`\n\nfunction installStyles(): () => void {\n if (typeof document === 'undefined') return () => {}\n const existing = document.querySelector(`style[data-plugin-css=\"${CSS_TAG_ID}\"]`)\n if (existing !== null) return () => {}\n const tag = document.createElement('style')\n tag.dataset.plugin = PLUGIN_ID\n tag.dataset.pluginCss = CSS_TAG_ID\n tag.textContent = UPDATE_STATUS_CSS\n document.head.appendChild(tag)\n return () => {\n const live = document.querySelector(`style[data-plugin-css=\"${CSS_TAG_ID}\"]`)\n if (live?.parentNode !== undefined && live?.parentNode !== null) live.parentNode.removeChild(live)\n }\n}\n\nfunction connectionOf(ctx: ClientContext): ConnectionClient {\n try {\n const candidate = ctx.get('connection')\n return candidate !== null && typeof candidate === 'object' ? candidate as ConnectionClient : {}\n } catch {\n return {}\n }\n}\n\nfunction apply(ctx: ClientContext): void {\n const connection = connectionOf(ctx)\n const status = new StatusStore(connection)\n const preferences = new PreferencesStore()\n const panel = new PanelStore()\n const restart = new RestartStore(connection)\n const ui: SharedUi = { status, preferences, panel, restart }\n\n const disposers: Array<() => void> = []\n let stopped = false\n /** Own a subscription raised from an injection callback; release after teardown at once. */\n const own = (dispose: unknown): void => {\n if (typeof dispose !== 'function') return\n if (stopped) {\n try {\n (dispose as () => void)()\n } catch {\n // Contained.\n }\n return\n }\n disposers.push(dispose as () => void)\n }\n\n // The plugin's ONE storage contract is the Host settings entry\n // `dsh-update-status` (the plugin's own Loader entry id), but two client\n // channels can serve it: the official `configForms` form on any origin, and\n // a direct Host fallback when that form is absent or unavailable. Both use\n // the same Host authorization policy. See settingsChannel.ts.\n let remoteSettings: SettingsRemoteLike | undefined\n /** Resolve the direct channel's Remote face; `ctx.get` covers a payload we could not read. */\n const directRemote = (): SettingsRemoteLike | undefined => {\n if (remoteSettings !== undefined) return remoteSettings\n try {\n remoteSettings = settingsRemoteFace(ctx.get('remote.settings'))\n } catch {\n // The dotted service key is not readable on this context.\n }\n return remoteSettings\n }\n const channel = createSettingsChannel({\n openDirect: () => {\n const remote = directRemote()\n return remote === undefined ? undefined : createHostDirectScope(remote, SETTINGS_NAMESPACE)\n },\n })\n\n ctx.effect(() => {\n const disposeStyles = installStyles()\n const detach = preferences.attach(channel)\n // The mount read uses the cache policy the profile stored. The settings\n // document usually arrives one tick after the effect, so the first\n // authoritative value issues that read; later edits deliberately do not —\n // changing the duration never starts a request of its own. A profile that\n // stores the default policy costs no second read.\n let usedCacheTtl = preferences.getSnapshot().cacheTtlMinutes\n let storedPolicyApplied = false\n const applyStoredPolicyOnce = () => {\n if (storedPolicyApplied) return\n const snapshot = preferences.getSnapshot()\n if (snapshot.status === 'loading') return\n storedPolicyApplied = true\n if (snapshot.cacheTtlMinutes === usedCacheTtl) return\n usedCacheTtl = snapshot.cacheTtlMinutes\n void status.reload(snapshot.cacheTtlMinutes)\n }\n applyStoredPolicyOnce()\n const unsubscribe = preferences.subscribe(applyStoredPolicyOnce)\n // Every mount reads the Host's cached status, whichever page it is on; the\n // transport is authenticated and the Host route is the plugin's own. There is\n // no channel to project: the Host always answers with the newest release.\n void status.load(preferences.getSnapshot().cacheTtlMinutes)\n return () => {\n stopped = true\n unsubscribe()\n detach()\n for (const dispose of disposers.splice(0)) {\n try {\n dispose()\n } catch {\n // Contained.\n }\n }\n channel.dispose()\n restart.stop()\n status.stop()\n disposeStyles()\n }\n }, 'dsh-update-status: styles, settings channel and first status read')\n\n // Official seam first: it stays authoritative whenever it is not `unavailable`,\n // so any page keeps the official semantics (one shared describe mirror,\n // the official write queue) and pays no extra wire read. DSH 0.1.7 replaced\n // the per-namespace `settingsScope` service with these entry-addressed forms,\n // keyed by the Loader entry id the Host Config half owns (SETTINGS_NAMESPACE).\n try {\n ctx.inject(['configForms'], (raw: unknown) => {\n try {\n const forms = configFormsOf(raw)\n if (forms === undefined) return\n channel.setOfficial(configFormScope(forms.get<unknown>(SETTINGS_NAMESPACE)))\n } catch {\n // Unreadable settings seam: the preferences stay on their defaults.\n }\n })\n } catch {\n // No configForms seam on this host: the direct channel is the only hope.\n }\n\n // Direct Host channel. The Remote service can arrive before or after the\n // official scope, so `refresh()` re-evaluates the selection either way; the\n // document invalidation keeps this page in step with edits made elsewhere,\n // and a reconnect retries a read that was refused.\n //\n // Every read here is contained: the injected payload intentionally refuses the\n // dotted PARENT (`payload.remote` throws \"cannot get property … without\n // inject\"), so one unreadable member must never abort the whole wiring.\n try {\n ctx.inject(['remote.settings'], (raw: unknown) => {\n try {\n remoteSettings = settingsRemoteOf(raw) ?? remoteSettings\n channel.refresh()\n const invalidations = settingsInvalidationsOf(ctx.get('remote'))\n if (invalidations !== undefined) own(invalidations(() => channel.reload()))\n } catch {\n // No usable Remote seam: the direct channel stays closed and the official\n // scope keeps its verdict.\n }\n })\n } catch {\n // No Remote seam: an unavailable official form has no usable fallback.\n }\n if (typeof ctx.on === 'function') {\n try {\n own(ctx.on('connection/reset', () => { channel.reload(); void restart.refresh() }))\n } catch {\n // No lifecycle event seam on this host.\n }\n }\n\n // Single slot: a compact name + version chip shadows the official wordmark\n // (priority 0). Lowest priority renders; never touch sidebar.brand.mark.\n //\n // The registration itself is conditional, and that is not a detail: a single\n // slot arbitrates by PRIORITY, not by what the component renders. A component\n // that returns null still OCCUPIES the cell, so the official occupant\n // (@deepseek-ai/dsh-client-ui-brand-official) and the shell's own fallback can\n // never come back. Turning the preference off therefore disposes our entry —\n // the previous winner leaves the ledger and the next-lowest occupant renders\n // again — and turning it back on registers a fresh one.\n ctx.slots.inject('sidebar.brand.name', () => {\n let registration: (() => void) | undefined\n const syncRegistration = (): void => {\n const enabled = preferences.getSnapshot().sidebarEnabled\n if (enabled && registration === undefined) {\n registration = ctx.slots.register({ name: 'sidebar.brand.name', priority: -10 }, () => BrandName({ ui }))\n } else if (!enabled && registration !== undefined) {\n registration()\n registration = undefined\n }\n }\n syncRegistration()\n const unsubscribe = preferences.subscribe(syncRegistration)\n return () => {\n unsubscribe()\n registration?.()\n registration = undefined\n }\n })\n\n // additive frame overlay for click/tap panel and narrow-view bottom sheet.\n ctx.slots.inject('shell.overlay', () => ctx.slots.register(\n { name: 'shell.overlay', id: 'dsh-update-status', order: 40 },\n () => UpdatePanel({ ui }),\n ))\n}\n\nmodule.exports = {\n name: PLUGIN_ID,\n inject: ['slots', 'connection'],\n apply,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;EAwBA,SAAgB,cAAc,QAAsC;GAClE,IAAI,WAAW,MAAM,OAAO;GAC5B,IAAI,OAAO,gBAAgB,KAAA,GAAW,OAAO,OAAO,YAAY;GAChE,OAAO,OAAO,gBAAgB;EAChC;EAEA,SAAgB,YAAY,QAA6B,SAAkB,OAAmC;GAC5G,IAAI,SAAS,OAAO;GACpB,IAAI,UAAU,QAAQ,cAAc,MAAM,GAAG,OAAO,QAAQ,cAAc,OAAO,WAAW;GAC5F,OAAO,QAAQ,cAAc,OAAO,WAAW;EACjD;;;;;;;;;;;;;;;;ECpBA,MAAaA,cAAY;;EAGzB,MAAa,wBAAwB;EAIrC,MAAa,wBAAwB;EAErC,SAAgB,kBAAkB,OAAiC;GACjE,OAAO,OAAO,UAAU,YAAY,OAAO,UAAU,KAAK,KACrD,SAAA,MAAkC,SAAA;EACzC;EAEA,MAAa,mBAAmB;GAC9B,WAAW;GACX,aAAa;EACf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
|
|
4
4
|
"description": "DeepSeek Harness Web plugin for version status, copy-only upgrade guidance, and safe restart when an explicit user-level supervisor is installed.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -80,9 +80,9 @@
|
|
|
80
80
|
"@deepseek-ai/schemastery": "^3.18.4"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@deepseek-ai/cordis": "^4.0
|
|
84
|
-
"@deepseek-ai/dsh-settings": "0.
|
|
85
|
-
"@deepseek-ai/schemastery": "^3.
|
|
83
|
+
"@deepseek-ai/cordis": "^4.1.0",
|
|
84
|
+
"@deepseek-ai/dsh-settings": "0.2.2-rc.3",
|
|
85
|
+
"@deepseek-ai/schemastery": "^3.19.0",
|
|
86
86
|
"@types/node": "^26.2.0",
|
|
87
87
|
"@types/react": "^18.3.31",
|
|
88
88
|
"react": "^18.3.1",
|