dsh-update-status 0.1.0 → 0.1.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 +9 -0
- package/README.md +6 -3
- package/README.zh.md +6 -3
- package/docs/RELEASING.md +10 -14
- package/lib/client.js +16 -15
- package/lib/client.js.map +1 -1
- package/lib/index.js +50 -17
- package/package.json +13 -16
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here.
|
|
4
4
|
|
|
5
|
+
## 0.1.1 — 2026-09-10
|
|
6
|
+
|
|
7
|
+
Verified DeepSeek Harness: `0.1.5-rc.1`.
|
|
8
|
+
|
|
9
|
+
- Adapted the Web client half to DeepSeek Harness `0.1.5-rc.1`.
|
|
10
|
+
- Dropped `@deepseek-ai/dsh-client-ui-slots` from `dsh.client.inject` (it is a frozen platform module, not a boot-graph plugin).
|
|
11
|
+
- Fitted the sidebar version chip to the 24px `sidebar.brand.name` row used by the current shell.
|
|
12
|
+
- Moved Host RPC onto authenticated `POST /api/dsh-update-status.*` Fetch routes so the SPA fallback no longer answers with HTTP 405.
|
|
13
|
+
|
|
5
14
|
## 0.1.0 — 2026-09-10
|
|
6
15
|
|
|
7
16
|
- Added a static DeepSeek Harness Web Cordis plugin with a read-only Host update-status service.
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
> DSH Update Status is a community plugin for DeepSeek Harness. It does not modify DSH core and it never installs, restarts, rolls back, downloads, or replaces DSH files.
|
|
23
23
|
|
|
24
|
-
It
|
|
24
|
+
It shadows only the expanded sidebar brand name with `DeepSeek` plus a compact version chip that fits the 24px brand row, leaving the official fish mark untouched. Tap the chip to inspect npm release channels, compatibility status, and a copy-only command for the selected channel.
|
|
25
25
|
|
|
26
26
|
<p align="center">
|
|
27
27
|
<img src="./assets/update-panel.png" width="500" alt="DSH Update Status panel showing the current stable release, an alpha preview, compatibility labels, and a copy-only upgrade command">
|
|
@@ -44,7 +44,7 @@ Requirements:
|
|
|
44
44
|
|
|
45
45
|
- DeepSeek Harness with the Web profile
|
|
46
46
|
- Node.js 20 or newer
|
|
47
|
-
- Verified DSH release: `0.1.
|
|
47
|
+
- Verified DSH release: `0.1.5-rc.1`
|
|
48
48
|
|
|
49
49
|
With an installed `dsh` command:
|
|
50
50
|
|
|
@@ -101,11 +101,14 @@ The plugin honors npm dist-tags. It does not pick the numerically greatest versi
|
|
|
101
101
|
|
|
102
102
|
## Compatibility
|
|
103
103
|
|
|
104
|
+
Current release: plugin **`0.1.1`** is verified against DeepSeek Harness **`0.1.5-rc.1`**.
|
|
105
|
+
|
|
104
106
|
| Plugin | Verified DeepSeek Harness |
|
|
105
107
|
| --- | --- |
|
|
106
108
|
| `0.1.0` | `0.1.2-rc.1` |
|
|
109
|
+
| `0.1.1` | `0.1.5-rc.1` |
|
|
107
110
|
|
|
108
|
-
A newer DSH version is not automatically declared compatible. Verify it manually first. If the plugin is incompatible, disable or uninstall it rather than patching DSH core.
|
|
111
|
+
Use `0.1.1` with DSH `0.1.5-rc.1`. Keep `0.1.0` only if you are still on DSH `0.1.2-rc.1`. A newer DSH version is not automatically declared compatible. Verify it manually first. If the plugin is incompatible, disable or uninstall it rather than patching DSH core.
|
|
109
112
|
|
|
110
113
|
## Configuration
|
|
111
114
|
|
package/README.zh.md
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
> DSH Update Status 是 DeepSeek Harness 社区插件。它不修改 DSH 核心,也绝不会安装、重启、回滚、下载或替换 DSH 文件。
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
插件只把展开侧栏中的品牌名称换成适配 24px 品牌行的 `DeepSeek + 版本芯片`,官方鱼标保持不变。点击芯片可查看 npm 发布通道、兼容性状态,以及与所选通道对应的“仅复制”命令。
|
|
25
25
|
|
|
26
26
|
<p align="center">
|
|
27
27
|
<img src="./assets/update-panel.png" width="500" alt="DSH Update Status 面板:当前稳定版、alpha 预览版、兼容性标签和仅复制的升级命令">
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
- 带 Web profile 的 DeepSeek Harness
|
|
46
46
|
- Node.js 20 或更新版本
|
|
47
|
-
- 已验证的 DSH 版本:`0.1.
|
|
47
|
+
- 已验证的 DSH 版本:`0.1.5-rc.1`
|
|
48
48
|
|
|
49
49
|
已经安装 `dsh` 命令:
|
|
50
50
|
|
|
@@ -101,11 +101,14 @@ npm install -g @deepseek-ai/dsh@alpha
|
|
|
101
101
|
|
|
102
102
|
## 兼容性
|
|
103
103
|
|
|
104
|
+
当前发布:插件 **`0.1.1`** 已针对 DeepSeek Harness **`0.1.5-rc.1`** 验证。
|
|
105
|
+
|
|
104
106
|
| 插件版本 | 已验证的 DeepSeek Harness |
|
|
105
107
|
| --- | --- |
|
|
106
108
|
| `0.1.0` | `0.1.2-rc.1` |
|
|
109
|
+
| `0.1.1` | `0.1.5-rc.1` |
|
|
107
110
|
|
|
108
|
-
|
|
111
|
+
DSH `0.1.5-rc.1` 请使用 `0.1.1`。仍在 DSH `0.1.2-rc.1` 上时继续使用 `0.1.0`。更高 DSH 版本不会被自动宣称为兼容,需要人工验证。不兼容时请禁用或卸载插件,不要修改 DSH 核心。
|
|
109
112
|
|
|
110
113
|
## 配置
|
|
111
114
|
|
package/docs/RELEASING.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
# Releasing dsh-update-status
|
|
2
2
|
|
|
3
|
-
Releases are built from immutable Git tags and published by GitHub Actions. npm packages are immutable: never reuse a version that npm has accepted.
|
|
3
|
+
Releases are built from immutable Git tags and published by GitHub Actions through npm Trusted Publishing (GitHub OIDC). The repository stores **no** `NPM_TOKEN`, npm access token, or OTP. npm packages are immutable: never reuse a version that npm has accepted.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## npm Trusted Publisher
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
The token must belong to the npm account or organization that owns `dsh-update-status`, have publish permission, and satisfy that account’s 2FA/automation requirements. Never put it in a source file, local `.npmrc`, issue, or workflow log. After `0.1.0` succeeds, configure OIDC as below and remove the Secret before the next version.
|
|
10
|
-
|
|
11
|
-
## One-time npm Trusted Publisher configuration after first publish
|
|
12
|
-
|
|
13
|
-
After the first package exists at [npmjs.com](https://www.npmjs.com/), add a **Trusted Publisher**:
|
|
7
|
+
The public package at [npmjs.com/package/dsh-update-status](https://www.npmjs.com/package/dsh-update-status) is bound to this repository:
|
|
14
8
|
|
|
15
9
|
| npm field | Value |
|
|
16
10
|
| --- | --- |
|
|
@@ -20,7 +14,9 @@ After the first package exists at [npmjs.com](https://www.npmjs.com/), add a **T
|
|
|
20
14
|
| Workflow filename | `release.yml` |
|
|
21
15
|
| Environment | Leave blank |
|
|
22
16
|
|
|
23
|
-
The workflow path must
|
|
17
|
+
The workflow path must remain `.github/workflows/release.yml`. The `publish` job receives only a short-lived GitHub OIDC token through `id-token: write`. Do not add an `NPM_TOKEN` GitHub secret.
|
|
18
|
+
|
|
19
|
+
The first `0.1.0` package was bootstrapped once with a token because npm cannot attach a Trusted Publisher until the package exists. Later versions must use OIDC only.
|
|
24
20
|
|
|
25
21
|
## What a release tag does
|
|
26
22
|
|
|
@@ -29,7 +25,7 @@ Pushing a tag matching `v*` triggers [`.github/workflows/release.yml`](../.githu
|
|
|
29
25
|
1. Require `vX.Y.Z` to exactly match `package.json`’s `X.Y.Z` version.
|
|
30
26
|
2. Install dependencies with a frozen lockfile, run tests, build, and pack exactly one `.tgz` artifact.
|
|
31
27
|
3. Upload that artifact and `SHA256SUMS` as a GitHub Actions artifact.
|
|
32
|
-
4. Publish that same artifact to npm with
|
|
28
|
+
4. Publish that same artifact to npm with Trusted Publishing and the `latest` dist-tag.
|
|
33
29
|
5. Create (or update) the GitHub Release and attach the tarball and checksum **only after** the publish job succeeds.
|
|
34
30
|
|
|
35
31
|
If `dsh-update-status@X.Y.Z` already exists on npm, the immutable npm package is left unchanged and the workflow continues safely to the GitHub Release step.
|
|
@@ -58,7 +54,7 @@ shasum -a 256 .tmp/release/dsh-update-status-*.tgz
|
|
|
58
54
|
npm pack --dry-run .tmp/release/dsh-update-status-*.tgz
|
|
59
55
|
```
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
Confirm npm does not already own the exact version:
|
|
62
58
|
|
|
63
59
|
```sh
|
|
64
60
|
VERSION="$(node -p "require('./package.json').version")"
|
|
@@ -67,7 +63,7 @@ npm view "dsh-update-status@$VERSION" version || true
|
|
|
67
63
|
|
|
68
64
|
## Publish a version
|
|
69
65
|
|
|
70
|
-
After
|
|
66
|
+
After the matching source commit is on `main`:
|
|
71
67
|
|
|
72
68
|
```sh
|
|
73
69
|
VERSION="$(node -p "require('./package.json').version")"
|
|
@@ -75,7 +71,7 @@ git tag -a "v$VERSION" -m "dsh-update-status v$VERSION"
|
|
|
75
71
|
git push origin "v$VERSION"
|
|
76
72
|
```
|
|
77
73
|
|
|
78
|
-
Watch the **Release** workflow in GitHub Actions. It publishes npm and creates the GitHub Release; do not run `npm publish` locally for a tag-managed release.
|
|
74
|
+
Watch the **Release** workflow in GitHub Actions. It publishes npm and creates the GitHub Release; do not run `npm publish` locally for a tag-managed release. Never reuse `0.1.0`.
|
|
79
75
|
|
|
80
76
|
## Verify the public package
|
|
81
77
|
|
package/lib/client.js
CHANGED
|
@@ -35,14 +35,15 @@ window.__ModuleLoader__.load({
|
|
|
35
35
|
*
|
|
36
36
|
* The static package uses the authenticated Connection RPC channel because
|
|
37
37
|
* `harness.handle` / `host.call` are dynamic-Cordis-only closure APIs in DSH
|
|
38
|
-
* 0.1.
|
|
38
|
+
* 0.1.5-rc.1. The endpoint vocabulary remains deliberately small and private
|
|
39
39
|
* to this plugin channel.
|
|
40
40
|
*/
|
|
41
41
|
const PLUGIN_ID$1 = "dsh-update-status";
|
|
42
42
|
const PACKAGE_NAME = "@deepseek-ai/dsh";
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
/** Shared Connection RPC channel. Custom prefixes 405 on the SPA fallback. */
|
|
44
|
+
const UPDATE_STATUS_CHANNEL = "/api";
|
|
45
|
+
/** Exact DSH release this bundle declares compatible in package.json. */
|
|
46
|
+
const STATIC_COMPATIBLE_VERSION = "0.1.5-rc.1";
|
|
46
47
|
const RELEASE_CHANNELS = [
|
|
47
48
|
"latest",
|
|
48
49
|
"next",
|
|
@@ -53,8 +54,8 @@ window.__ModuleLoader__.load({
|
|
|
53
54
|
return typeof value === "number" && Number.isInteger(value) && value >= 30 && value <= 1440;
|
|
54
55
|
}
|
|
55
56
|
const UPDATE_ENDPOINTS = {
|
|
56
|
-
getStatus: "get-status",
|
|
57
|
-
checkUpdate: "check-update"
|
|
57
|
+
getStatus: "dsh-update-status.get-status",
|
|
58
|
+
checkUpdate: "dsh-update-status.check-update"
|
|
58
59
|
};
|
|
59
60
|
function isReleaseChannel(value) {
|
|
60
61
|
return value === "latest" || value === "next" || value === "alpha";
|
|
@@ -432,7 +433,7 @@ window.__ModuleLoader__.load({
|
|
|
432
433
|
const snapshot = useObservable(ui.status);
|
|
433
434
|
if (!preferences.sidebarEnabled) return null;
|
|
434
435
|
const state = visualState(snapshot.status, snapshot.loading, snapshot.error);
|
|
435
|
-
const version = snapshot.status?.currentVersion ?? "
|
|
436
|
+
const version = snapshot.status?.currentVersion ?? "—";
|
|
436
437
|
const activate = (event) => {
|
|
437
438
|
event.preventDefault();
|
|
438
439
|
event.stopPropagation();
|
|
@@ -1239,15 +1240,15 @@ window.__ModuleLoader__.load({
|
|
|
1239
1240
|
//#region src/client/styles.ts
|
|
1240
1241
|
/** Plugin-owned CSS only; no shell DOM selection or official SVG manipulation. */
|
|
1241
1242
|
const UPDATE_STATUS_CSS = `
|
|
1242
|
-
.dus-brand-name{align-items:center;gap:
|
|
1243
|
-
.dus-brand-deepseek{font-size:
|
|
1244
|
-
.dus-badge{align-items:center;
|
|
1243
|
+
.dus-brand-name{align-items:center;gap:6px;height:24px;max-width:100%;min-width:0;display:inline-flex}
|
|
1244
|
+
.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}
|
|
1245
|
+
.dus-badge{align-items:center;background:var(--dsw-alias-label-primary,#111);border:0;border-radius:4px;color:var(--dsw-alias-label-primary-inverted,#fff);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}
|
|
1245
1246
|
.dus-badge:focus-visible,.dus-footer-button:focus-visible,.dus-action:focus-visible,.dus-close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}
|
|
1246
|
-
.dus-badge:hover{
|
|
1247
|
-
.dus-badge[data-update=true]{
|
|
1248
|
-
.dus-badge[data-error=true]{
|
|
1247
|
+
.dus-badge:hover{filter:brightness(1.08)}
|
|
1248
|
+
.dus-badge[data-update=true]{background:var(--dsw-alias-state-warn-primary,#d97706);color:#111}
|
|
1249
|
+
.dus-badge[data-error=true]{background:var(--dsw-alias-state-error-primary,#dc2626);color:#fff}
|
|
1249
1250
|
.dus-badge-version{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
1250
|
-
.dus-dot{background:currentColor;border-radius:50%;display:inline-block;flex:0 0 auto;height:
|
|
1251
|
+
.dus-dot{background:currentColor;border-radius:50%;display:inline-block;flex:0 0 auto;height:5px;opacity:.9;width:5px}
|
|
1251
1252
|
.dus-dot[data-update=true]{animation:dus-pulse 1.5s ease-in-out infinite;background:var(--dsw-alias-state-warn-primary)}
|
|
1252
1253
|
.dus-dot[data-loading=true]{animation:dus-pulse .9s ease-in-out infinite}
|
|
1253
1254
|
@keyframes dus-pulse{0%,100%{opacity:.45;transform:scale(.82)}50%{opacity:1;transform:scale(1.15)}}
|
|
@@ -1309,7 +1310,7 @@ window.__ModuleLoader__.load({
|
|
|
1309
1310
|
.dus-channel-compat[data-compatibility=verified]{color:var(--dsw-alias-state-success-primary)}
|
|
1310
1311
|
.dus-channel-compat[data-compatibility=incompatible]{color:var(--dsw-alias-state-error-primary)}
|
|
1311
1312
|
.dus-settings-hint{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:8px 0 0}
|
|
1312
|
-
@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel[data-origin]{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-footer-button{height:48px;min-height:48px;min-width:48px;width:48px}.dus-
|
|
1313
|
+
@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel[data-origin]{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-footer-button{height:48px;min-height:48px;min-width:48px;width:48px}.dus-action{min-height:40px;line-height:38px}.dus-close{height:40px;min-height:40px;min-width:40px;width:40px}}
|
|
1313
1314
|
`;
|
|
1314
1315
|
//#endregion
|
|
1315
1316
|
//#region src/client/index.ts
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["PLUGIN_ID","PLUGIN_ID"],"sources":["../src/shared/channels.ts","../src/shared/types.ts","../src/shared/semver.ts","../src/shared/preview-guidance.ts","../src/client/i18n.ts","../src/client/react.ts","../src/client/components.tsx","../src/client/contract.ts","../src/client/stores.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["import type { ChannelRelease, UpdateStatus } from './types.ts'\n\nconst CHANNEL_ORDER = { latest: 0, next: 1, alpha: 2 } as const\n\n/**\n * Reduce raw dist-tags to user-meaningful choices without losing Host facts.\n * The selected channel and stable return path are mandatory; other rows must\n * represent a version that differs from both the running DSH and earlier rows.\n */\nexport function visibleChannelReleases(status: Pick<UpdateStatus, 'currentVersion' | 'channel' | 'channels'>): ChannelRelease[] {\n const ordered = [...status.channels].sort((left, right) => CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel])\n const mandatory = new Set(['latest', status.channel])\n const visible = ordered.filter(release => mandatory.has(release.channel))\n const seenVersions = new Set(visible.map(release => release.version).filter((version): version is string => version !== null))\n\n for (const release of ordered) {\n if (mandatory.has(release.channel) || release.version === null || release.version === status.currentVersion) continue\n if (seenVersions.has(release.version)) continue\n visible.push(release)\n seenVersions.add(release.version)\n }\n\n return visible.sort((left, right) => CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel])\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 in DSH\n * 0.1.2-rc.1. The endpoint vocabulary remains deliberately small and private\n * to this plugin channel.\n */\n\nexport const PLUGIN_ID = 'dsh-update-status'\nexport const PACKAGE_NAME = '@deepseek-ai/dsh'\nexport const UPDATE_STATUS_CHANNEL = '/dsh-update-status'\nexport const RELEASES_URL = 'https://github.com/deepseek-ai/deepseek-harness/releases'\n/** Exact DSH release this Phase-1 bundle declares compatible in package.json. */\nexport const STATIC_COMPATIBLE_VERSION = '0.1.2-rc.1'\nexport const RELEASE_CHANNELS = ['latest', 'next', 'alpha'] as const\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: 'get-status',\n checkUpdate: 'check-update',\n} as const\n\nexport type UpdateEndpoint = (typeof UPDATE_ENDPOINTS)[keyof typeof UPDATE_ENDPOINTS]\nexport type ReleaseChannel = (typeof RELEASE_CHANNELS)[number]\nexport type ReleaseCompatibility = 'verified' | 'unverified' | 'incompatible'\nexport type InstallKind = 'npm-global' | 'pnpm-global' | 'source-checkout' | 'unknown'\n\nexport function isReleaseChannel(value: unknown): value is ReleaseChannel {\n return value === 'latest' || value === 'next' || value === 'alpha'\n}\n\nexport interface ChannelRelease {\n channel: ReleaseChannel\n version: string | null\n publishedAt: string | null\n compatibility: ReleaseCompatibility\n}\n\n/** Arguments accepted by either read/check endpoint. */\nexport interface CheckUpdateRequest {\n force?: boolean\n channel?: ReleaseChannel\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 latestVersion: string | null\n hasUpdate: boolean\n cached: boolean\n checkedAt: string | null\n warning: string | null\n installKind: InstallKind\n upgradeCommand: string\n releaseUrl: string\n changelogUrl: string\n publishedAt: string | null\n packageName: string\n /** Selected npm dist-tag used for comparison and command generation. */\n channel: ReleaseChannel\n /** All supported dist-tags returned by the same cached registry request. */\n channels: ChannelRelease[]\n /** Phase 1 is informational only; the GUI must never apply an update. */\n canApplyInPlace: false\n}\n\n/** Persisted browser preference served through the ordinary DSH settings seam. */\nexport interface UpdateStatusSettings {\n sidebarEnabled: boolean\n channel: ReleaseChannel\n /** On-demand npm-registry cache duration. This never starts a browser timer. */\n cacheTtlMinutes: number\n}\n","/**\n * Small, dependency-free SemVer 2.0 comparator for the host check path.\n * It intentionally accepts the common leading `v` used by release tags while\n * preserving prerelease precedence (`0.1.2-rc.1 < 0.1.2`).\n */\n\nexport interface ParsedSemver {\n major: number\n minor: number\n patch: number\n prerelease: readonly string[]\n}\n\nconst SEMVER = /^(?:v)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$/\nconst NUMERIC_IDENTIFIER = /^(0|[1-9]\\d*)$/\n\nexport function parseSemver(value: string): ParsedSemver | undefined {\n const match = SEMVER.exec(value.trim())\n if (match === null) return undefined\n const major = Number(match[1])\n const minor = Number(match[2])\n const patch = Number(match[3])\n if (!Number.isSafeInteger(major) || !Number.isSafeInteger(minor) || !Number.isSafeInteger(patch)) return undefined\n const prerelease = match[4] === undefined ? [] : match[4].split('.')\n return { major, minor, patch, prerelease }\n}\n\nfunction compareIdentifier(left: string, right: string): number {\n const leftNumeric = NUMERIC_IDENTIFIER.test(left)\n const rightNumeric = NUMERIC_IDENTIFIER.test(right)\n if (leftNumeric && rightNumeric) return Number(left) - Number(right)\n if (leftNumeric) return -1\n if (rightNumeric) return 1\n return left < right ? -1 : left > right ? 1 : 0\n}\n\n/** Returns a negative number when left is older; undefined means unparsable. */\nexport function compareSemver(leftValue: string, rightValue: string): number | undefined {\n const left = parseSemver(leftValue)\n const right = parseSemver(rightValue)\n if (left === undefined || right === undefined) return undefined\n\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (left[key] !== right[key]) return left[key] - right[key]\n }\n\n const leftStable = left.prerelease.length === 0\n const rightStable = right.prerelease.length === 0\n if (leftStable && rightStable) return 0\n if (leftStable) return 1\n if (rightStable) return -1\n\n const length = Math.max(left.prerelease.length, right.prerelease.length)\n for (let index = 0; index < length; index += 1) {\n const leftPart = left.prerelease[index]\n const rightPart = right.prerelease[index]\n if (leftPart === undefined) return -1\n if (rightPart === undefined) return 1\n const comparison = compareIdentifier(leftPart, rightPart)\n if (comparison !== 0) return comparison\n }\n return 0\n}\n\n/** False rather than a guess when either version is not valid SemVer. */\nexport function hasSemverUpdate(currentVersion: string, latestVersion: string): boolean {\n const comparison = compareSemver(currentVersion, latestVersion)\n return comparison !== undefined && comparison < 0\n}\n","import type { UpdateStatus } from './types.ts'\nimport { PACKAGE_NAME } from './types.ts'\nimport { parseSemver } from './semver.ts'\n\n/** Pinned guidance only: never execute a command or mutate the followed channel. */\nexport function previewCommand(status: UpdateStatus, version: string | null): string | null {\n if (version === null || version.trim() !== version || parseSemver(version) === undefined) return null\n if (status.installKind === 'npm-global') return `npm install -g ${PACKAGE_NAME}@${version}`\n if (status.installKind === 'pnpm-global') return `pnpm add -g ${PACKAGE_NAME}@${version}`\n return null\n}\n","/** Tiny bilingual dictionary kept local to avoid changing the host locale tree. */\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 'footer.status': { zh: '打开 DSH 版本状态', en: 'Open DSH version status' },\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.latest': { zh: '所选通道版本', en: 'Selected channel version' },\n 'panel.channels': { zh: '可用发布通道', en: 'Available release channels' },\n 'panel.compatVerified': { zh: '已验证兼容', en: 'Verified compatible' },\n 'panel.compatUnverified': { zh: '尚未验证兼容', en: 'Compatibility unverified' },\n 'panel.compatIncompatible': { zh: '已知不兼容', en: 'Known incompatible' },\n 'panel.selectChannel': { zh: '选择此通道', en: 'Select channel' },\n 'panel.selectedChannel': { zh: '已选择', en: 'Selected' },\n 'panel.notChecked': { zh: '尚未取得', en: 'Not available yet' },\n 'panel.available': { zh: '发现新版本', en: 'Update available' },\n 'panel.currentState': { zh: '未发现可用更新', en: 'No update found' },\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.switchingChannel': { zh: '正在切换通道…', en: 'Switching channel…' },\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 restart DSH yourself.' },\n 'panel.readOnly': { zh: '阶段 1 仅提示:本插件不会安装、重启、回滚或替换任何文件。', en: 'Phase 1 is advisory only: this plugin never installs, restarts, rolls back, or replaces files.' },\n 'panel.error': { zh: '检查提示', en: 'Check notice' },\n 'panel.static': { zh: '此连接只显示静态版本;请在运行 DSH 的本机打开侧栏查看完整更新信息。', en: 'This connection shows only the static version. Open the sidebar on the computer running DSH for full update details.' },\n 'preview.open': { zh: '查看预览版升级方式', en: 'View preview upgrade instructions' },\n 'preview.close': { zh: '收起升级说明', en: 'Hide upgrade instructions' },\n 'preview.follow': { zh: '关注通道只影响检查结果,不代表已安装或已切换版本。', en: 'Following a channel only changes update checks, not the installed version.' },\n 'preview.target': { zh: '目标版本', en: 'Target version' },\n 'preview.risk': { zh: '预览版本可能不稳定,插件兼容性尚需确认。执行前请保存工作、备份配置并结束运行中的任务;安装后需手动重启 DSH。此页面不会安装或重启。', en: 'Preview builds may be unstable and plugin compatibility needs checking. Save work, back up configuration and finish active tasks before executing. Restart DSH manually afterwards. This page never installs or restarts.' },\n 'preview.unavailable': { zh: '暂无可确认的预览目标,请先检查更新。', en: 'No confirmed preview target. Check for updates first.' },\n 'preview.manual': { zh: '当前安装方式无法安全生成命令,请先确认安装来源;源码安装需按其构建说明操作。', en: 'Cannot safely generate a command for this installation. Confirm its source; source checkouts require their build instructions.' },\n 'preview.same': { zh: '此目标与当前运行版本相同,无需重复安装。', en: 'This target is already running; no reinstall is needed.' },\n 'settings.title': { zh: '版本与更新', en: 'Version & updates' },\n 'settings.sidebar': { zh: '在侧栏显示版本状态入口', en: 'Show the version-status entry in the sidebar' },\n 'settings.sidebarHint': { zh: '关闭后不再渲染品牌 Badge 和收起轨道兜底入口。不会执行或安排升级。', en: 'When off, the brand badge and collapsed-rail fallback are not rendered. No update is run or scheduled.' },\n 'settings.channel': { zh: '关注发布通道', en: 'Release channel to follow' },\n 'settings.channelLatest': { zh: '稳定版(latest,推荐)', en: 'Stable (latest, recommended)' },\n 'settings.channelNext': { zh: '候选版(next)', en: 'Release candidate (next)' },\n 'settings.channelAlpha': { zh: '预览版(alpha)', en: 'Preview (alpha)' },\n 'settings.channelHint': { zh: '预览通道可能包含未稳定接口或插件兼容性变化。这里只检查并生成命令,不会安装。', en: 'Preview channels may contain unstable APIs or plugin compatibility changes. This only checks and generates a command; it never installs.' },\n 'settings.readonly': { zh: '此连接的设置为只读;显示状态不受影响。', en: 'Settings are read-only on this connection; status display is unchanged.' },\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): string {\n const entry = DICTIONARY[key]\n if (entry === undefined) return key\n return entry[languageOf()] ?? entry.en\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 replacement, collapsed-rail fallback, overlay detail panel, and settings page. */\n\nimport type * as ReactNS from 'react'\nimport { visibleChannelReleases } from '../shared/channels.ts'\nimport { previewCommand } from '../shared/preview-guidance.ts'\nimport { MAX_CACHE_TTL_MINUTES, MIN_CACHE_TTL_MINUTES, isCacheTtlMinutes, type ReleaseChannel, type ReleaseCompatibility, type UpdateStatus } from '../shared/types.ts'\nimport type { PreferencesStore, PanelStore, StatusStore } from './stores.ts'\nimport { t } 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\nfunction channelLabel(channel: ReleaseChannel): string {\n if (channel === 'latest') return t('settings.channelLatest')\n if (channel === 'next') return t('settings.channelNext')\n return t('settings.channelAlpha')\n}\n\nfunction compatibilityLabel(value: ReleaseCompatibility): string {\n if (value === 'verified') return t('panel.compatVerified')\n if (value === 'incompatible') return t('panel.compatIncompatible')\n return t('panel.compatUnverified')\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\ntype VisualState = 'loading' | 'update' | 'current' | 'problem'\n\nfunction visualState(status: UpdateStatus | null, loading: boolean, error: string | null): VisualState {\n if (loading) return 'loading'\n if (error !== null || status?.warning !== null) return status?.hasUpdate === true ? 'update' : 'problem'\n return status?.hasUpdate === true ? 'update' : 'current'\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 canManage: boolean\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 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 if (ui.canManage) ui.panel.toggle('brand')\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={ui.canManage ? 'button' : undefined}\n tabIndex={ui.canManage ? 0 : undefined}\n aria-label={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n aria-disabled={ui.canManage ? undefined : true}\n title={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n onClick={ui.canManage ? activate : undefined}\n onKeyDown={ui.canManage ? onKeyDown : undefined}\n >\n <span className=\"dus-badge-version\">{shortVersion(version)}</span>\n <span className=\"dus-dot\" data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={snapshot.loading || undefined} aria-hidden=\"true\" />\n </span>\n </span>\n )\n}\n\n/** List-slot fallback: it deliberately disappears while the name badge is wide. */\nexport function FooterAction({ wide, ui }: { wide?: unknown; ui: SharedUi }): ReactNS.ReactElement | null {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n if (wide === true || !preferences.sidebarEnabled) return null\n const state = visualState(snapshot.status, snapshot.loading, snapshot.error)\n const label = badgeLabel(snapshot.status, snapshot.loading, snapshot.error)\n return (\n <button\n className=\"dus-footer-button\"\n type=\"button\"\n aria-label={t('footer.status')}\n title={label}\n disabled={!ui.canManage}\n onClick={() => { ui.panel.toggle('rail') }}\n >\n <span className=\"dus-footer-icon\" aria-hidden=\"true\">↟</span>\n <span className=\"dus-dot dus-footer-dot\" data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={state === 'loading' || undefined} />\n </button>\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?.hasUpdate === true) return { kind: 'update', text: t('panel.available') }\n if (status?.warning !== null && status?.warning !== undefined) return { kind: 'warning', text: status.warning }\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/** Full detail is only opened from a loopback/local DSH UI surface. */\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 commandRef = React.useRef<HTMLElement | null>(null)\n const dialogRef = React.useRef<HTMLDialogElement | null>(null)\n const [copyMessage, setCopyMessage] = React.useState<string | null>(null)\n const visible = panel.open && preferences.sidebarEnabled && ui.canManage\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 summary = statusSummary(status, snapshot.loading, snapshot.error)\n const switchingChannel = status !== null && status.channel !== preferences.channel\n const command = switchingChannel ? t('panel.switchingChannel') : status?.upgradeCommand ?? '—'\n\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\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\" data-origin={panel.origin} 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 <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.latest')} · {status === null ? 'latest' : channelLabel(status.channel)}</span>\n <code className=\"dus-meta-value\">{status?.latestVersion ?? t('panel.notChecked')}</code>\n {status?.publishedAt !== null && status?.publishedAt !== undefined && <span className=\"dus-meta-sub\">{t('panel.publishedAt')}: {timeText(status.publishedAt)}</span>}\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 {status !== null && <div className=\"dus-channel-list\" aria-label={t('panel.channels')}>\n <p className=\"dus-command-label\">{t('panel.channels')}</p>\n {visibleChannelReleases(status).map(release => {\n const selected = release.channel === preferences.channel\n return <div className=\"dus-channel-row\" data-selected={selected || undefined} key={release.channel}>\n <span>{channelLabel(release.channel)}</span>\n <code>{release.version ?? '—'}</code>\n <span className=\"dus-channel-compat\" data-compatibility={release.compatibility}>{compatibilityLabel(release.compatibility)}</span>\n <button\n className=\"dus-channel-action\"\n type=\"button\"\n disabled={selected || !preferences.writable || release.version === null}\n aria-label={`${selected ? t('panel.selectedChannel') : t('panel.selectChannel')}: ${channelLabel(release.channel)}`}\n onClick={() => { ui.preferences.setChannel(release.channel) }}\n >{selected ? t('panel.selectedChannel') : t('panel.selectChannel')}</button>\n </div>\n })}\n </div>}\n\n {status?.warning !== null && status?.warning !== undefined && <p className=\"dus-warning\">{t('panel.error')}: {status.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(undefined, 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 <button className=\"dus-action\" type=\"button\" disabled={switchingChannel || status === null} onClick={() => { void copy() }}>{t('panel.copy')}</button>\n </div>\n\n <p className=\"dus-command-label\">{t('panel.command')}</p>\n <code ref={commandRef} className=\"dus-command\" tabIndex={0}>{command}</code>\n {copyMessage !== null && <p className=\"dus-copy-message\" role=\"status\">{copyMessage}</p>}\n <p className=\"dus-note\">{t('panel.commandNote')}</p>\n <p className=\"dus-note\">{t('panel.readOnly')}</p>\n </section>\n </dialog>\n )\n}\n\n/** Separate setting page: disables only this plugin's own rendering. */\nexport function UpdateSettings({ ui }: { ui: SharedUi }): ReactNS.ReactElement {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n const [showGuidance, setShowGuidance] = React.useState(false)\n const previews = snapshot.status?.channels.filter(release => release.channel !== 'latest') ?? []\n const channelOptions = snapshot.status === null\n ? [{ channel: preferences.channel }]\n : visibleChannelReleases(snapshot.status)\n return (\n <section className=\"dus-settings\">\n <h2 className=\"dus-settings-heading\">{t('settings.title')}</h2>\n <div className=\"dus-settings-card\">\n <label className=\"dus-settings-toggle\">\n <input\n type=\"checkbox\"\n checked={preferences.sidebarEnabled}\n disabled={!preferences.writable}\n onChange={(event) => { ui.preferences.setSidebarEnabled(event.currentTarget.checked) }}\n />\n <span>{t('settings.sidebar')}</span>\n </label>\n <p className=\"dus-settings-hint\">{t('settings.sidebarHint')}</p>\n {!preferences.writable && <p className=\"dus-settings-hint\">{t('settings.readonly')}</p>}\n </div>\n <div className=\"dus-settings-card\">\n <label className=\"dus-settings-field\">\n <span>{t('settings.channel')}</span>\n <select\n className=\"dus-channel-select\"\n value={preferences.channel}\n disabled={!preferences.writable}\n onChange={(event) => { ui.preferences.setChannel(event.currentTarget.value as ReleaseChannel) }}\n >\n {channelOptions.map(option => <option value={option.channel} key={option.channel}>{channelLabel(option.channel)}</option>)}\n </select>\n </label>\n <p className=\"dus-settings-hint\">{t('settings.channelHint')}</p>\n <p className=\"dus-settings-hint\">{t('panel.current')}: <code>{snapshot.status?.currentVersion ?? '…'}</code></p>\n <p className=\"dus-settings-hint\">{t('preview.follow')}</p>\n {ui.canManage && <button className=\"dus-action\" type=\"button\" aria-expanded={showGuidance} onClick={() => { setShowGuidance(!showGuidance) }}>{t(showGuidance ? 'preview.close' : 'preview.open')}</button>}\n {ui.canManage && showGuidance && <section aria-label={t('preview.open')}>\n <p className=\"dus-warning\">{t('preview.risk')}</p>\n <button className=\"dus-action\" type=\"button\" disabled={snapshot.loading} onClick={() => { void ui.status.refresh(undefined, preferences.cacheTtlMinutes) }}>{t(snapshot.loading ? 'panel.checking' : 'panel.check')}</button>\n {snapshot.error !== null && <p role=\"alert\">{snapshot.error}</p>}\n {previews.length === 0 && <p>{t('preview.unavailable')}</p>}\n {previews.map(release => {\n const status = snapshot.status!\n const command = previewCommand(status, release.version)\n return <div className=\"dus-settings-card\" key={release.channel}>\n <p>{channelLabel(release.channel)} · {t('preview.target')}: <code>{release.version ?? t('panel.notChecked')}</code></p>\n <p>{compatibilityLabel(release.compatibility)}</p>\n {release.version === null ? <p>{t('preview.unavailable')}</p> : release.version === status.currentVersion ? <p>{t('preview.same')}</p> : command !== null ? <><p>{t('panel.command')}</p><code className=\"dus-command\" tabIndex={0}>{command}</code></> : <p>{t('preview.manual')}</p>}\n </div>\n })}\n <p className=\"dus-note\">{t('panel.commandNote')}</p>\n </section>}\n </div>\n </section>\n )\n}\n","/** Minimal structural client faces — runtime services stay owned by DSH. */\n\nimport { isReleaseChannel, type ChannelRelease, type UpdateStatus } from '../shared/types.ts'\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\nexport interface ConnectionClient {\n isLoopback?: boolean\n rpc?: ConnectionRpc\n}\n\nexport interface SettingsScopeSnapshot {\n status?: unknown\n value?: unknown\n writable?: unknown\n}\n\nexport interface SettingsScope {\n getSnapshot(): SettingsScopeSnapshot\n subscribe(listener: () => void): () => void\n set(field: string, value: unknown): Promise<void>\n}\n\nexport interface SettingsScopeBinder {\n bind(spec: { namespace: string }): SettingsScope\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}\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 stringOrNull(value: unknown): string | null {\n return typeof value === 'string' ? value : null\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.installKind !== 'string'\n || typeof record.upgradeCommand !== 'string' || typeof record.releaseUrl !== 'string'\n || typeof record.changelogUrl !== 'string' || typeof record.packageName !== 'string'\n || !isReleaseChannel(record.channel) || !Array.isArray(record.channels) || record.canApplyInPlace !== false) return undefined\n const validKind = record.installKind === 'npm-global' || record.installKind === 'pnpm-global'\n || record.installKind === 'source-checkout' || record.installKind === 'unknown'\n if (!validKind) return undefined\n const latestVersion = record.latestVersion === null ? null : stringOrNull(record.latestVersion)\n const checkedAt = record.checkedAt === null ? null : stringOrNull(record.checkedAt)\n const warning = record.warning === null ? null : stringOrNull(record.warning)\n const publishedAt = record.publishedAt === null ? null : stringOrNull(record.publishedAt)\n if ((record.latestVersion !== null && latestVersion === null) || (record.checkedAt !== null && checkedAt === null)\n || (record.warning !== null && warning === null) || (record.publishedAt !== null && publishedAt === null)) return undefined\n const channels: ChannelRelease[] = []\n for (const raw of record.channels) {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return undefined\n const item = raw as Record<string, unknown>\n const version = item.version === null ? null : stringOrNull(item.version)\n const channelPublishedAt = item.publishedAt === null ? null : stringOrNull(item.publishedAt)\n if (!isReleaseChannel(item.channel) || (item.version !== null && version === null)\n || (item.publishedAt !== null && channelPublishedAt === null)\n || (item.compatibility !== 'verified' && item.compatibility !== 'unverified' && item.compatibility !== 'incompatible')) return undefined\n channels.push({ channel: item.channel, version, publishedAt: channelPublishedAt, compatibility: item.compatibility })\n }\n return {\n currentVersion: record.currentVersion,\n latestVersion,\n hasUpdate: record.hasUpdate,\n cached: record.cached,\n checkedAt,\n warning,\n installKind: record.installKind as UpdateStatus['installKind'],\n upgradeCommand: record.upgradeCommand,\n releaseUrl: record.releaseUrl,\n changelogUrl: record.changelogUrl,\n publishedAt,\n packageName: record.packageName,\n channel: record.channel,\n channels,\n canApplyInPlace: false,\n }\n}\n","/** Small observable stores shared by the independent sidebar and overlay slots. */\n\nimport { DEFAULT_CACHE_TTL_MINUTES, isCacheTtlMinutes, isReleaseChannel, PLUGIN_ID, RELEASE_CHANNELS, UPDATE_ENDPOINTS, UPDATE_STATUS_CHANNEL, type ReleaseChannel, type UpdateStatus } from '../shared/types.ts'\nimport type { ConnectionClient, Observable, SettingsScope } from './contract.ts'\nimport { errorMessage, updateStatusOf } from './contract.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\n private readonly allowRequests: boolean\n private readonly listeners = new Set<() => void>()\n private inFlight: Promise<boolean> | undefined\n private stopped = false\n\n constructor(private readonly connection: ConnectionClient, staticVersion: string | null = null) {\n this.allowRequests = staticVersion === null\n this.snapshot = staticVersion === null\n ? INITIAL_STATUS\n : { status: {\n currentVersion: staticVersion,\n latestVersion: null,\n hasUpdate: false,\n cached: true,\n checkedAt: null,\n warning: null,\n installKind: 'unknown',\n upgradeCommand: '',\n releaseUrl: '',\n changelogUrl: '',\n publishedAt: null,\n packageName: '@deepseek-ai/dsh',\n channel: 'latest',\n channels: RELEASE_CHANNELS.map(channel => ({ channel, version: null, publishedAt: null, compatibility: 'unverified' })),\n canApplyInPlace: false,\n }, loading: false, error: null }\n }\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 if (this.allowRequests) await this.request(false, this.snapshot.status?.channel ?? 'latest', cacheTtlMinutes)\n }\n\n /** User gesture only: force the Host to bypass TTL (while retaining single-flight). */\n async refresh(channel: ReleaseChannel = this.snapshot.status?.channel ?? 'latest', cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n if (this.allowRequests) await this.request(true, channel, cacheTtlMinutes)\n }\n\n /** Channel selection re-projects the Host cache; it is not a forced refresh. */\n async selectChannel(channel: ReleaseChannel, cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n if (!this.allowRequests) return\n // A persisted preference or a newer selection can arrive while another\n // channel is in flight. Keep checking after every joined request until the\n // requested projection is actually the published snapshot.\n for (let attempts = 0; attempts < 3 && !this.stopped && this.snapshot.status?.channel !== channel; attempts += 1) {\n const pending = this.inFlight\n if (pending !== undefined && !await pending) return\n if (this.stopped || this.snapshot.status?.channel === channel) return\n if (!await this.request(false, channel, cacheTtlMinutes)) return\n }\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, channel: ReleaseChannel, 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, channel, cacheTtlMinutes: ttl }\n : { channel, 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 channel: ReleaseChannel\n cacheTtlMinutes: number\n writable: boolean\n status: 'loading' | 'ready' | 'unavailable'\n}\n\nconst INITIAL_PREFERENCES: PreferencesSnapshot = {\n sidebarEnabled: true,\n channel: 'latest',\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: SettingsScope | 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: SettingsScope): () => 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 channel: isReleaseChannel(value.channel) ? value.channel : 'latest',\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 channel: isReleaseChannel(value.channel) ? value.channel : 'latest',\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 setChannel(channel: ReleaseChannel): void {\n const previous = this.snapshot\n this.publish({ ...previous, channel })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('channel', channel).catch(() => { this.publish(previous) })\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 && previous.channel === next.channel\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 type PanelOrigin = 'brand' | 'rail'\n\nexport interface PanelSnapshot {\n open: boolean\n origin: PanelOrigin\n}\n\n/** Open state also retains its trigger, so the desktop card sits beside it. */\nexport class PanelStore implements Observable<PanelSnapshot> {\n private snapshot: PanelSnapshot = { open: false, origin: 'brand' }\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(origin: PanelOrigin): void {\n const open = !(this.snapshot.open && this.snapshot.origin === origin)\n this.set({ open, origin })\n }\n\n close(): void { this.set({ ...this.snapshot, open: false }) }\n\n private set(next: PanelSnapshot): void {\n if (this.snapshot.open === next.open && this.snapshot.origin === next.origin) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\n/** The one namespace name used by Host registration and browser binding. */\nexport const SETTINGS_NAMESPACE = PLUGIN_ID\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:8px;min-width:0;width:100%;display:flex}\n.dus-brand-deepseek{font-size:15px;font-weight:650;letter-spacing:-.015em;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}\n.dus-badge{align-items:center;gap:5px;background:var(--dsw-alias-button-floating-fill);border:1px solid var(--dsw-alias-border-l2);border-radius:999px;color:var(--dsw-alias-label-secondary);cursor:pointer;display:inline-flex;flex:0 0 auto;font-size:11px;font-variant-numeric:tabular-nums;line-height:20px;max-width:132px;outline:none;padding:0 8px;touch-action:manipulation;user-select:none}\n.dus-badge:focus-visible,.dus-footer-button:focus-visible,.dus-action:focus-visible,.dus-close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-badge:hover{background:var(--dsw-alias-button-floating-hover)}\n.dus-badge[data-update=true]{border-color:var(--dsw-alias-state-business-primary);color:var(--dsw-alias-state-business-primary)}\n.dus-badge[data-error=true]{border-color:var(--dsw-alias-state-error-primary);color:var(--dsw-alias-state-error-primary)}\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:6px;width:6px}\n.dus-dot[data-update=true]{animation:dus-pulse 1.5s ease-in-out infinite;background:var(--dsw-alias-state-warn-primary)}\n.dus-dot[data-loading=true]{animation:dus-pulse .9s ease-in-out infinite}\n@keyframes dus-pulse{0%,100%{opacity:.45;transform:scale(.82)}50%{opacity:1;transform:scale(1.15)}}\n@media (prefers-reduced-motion:reduce){.dus-dot[data-update=true],.dus-dot[data-loading=true]{animation:none}}\n.dus-footer-button{align-items:center;background:transparent;border:0;border-radius:10px;color:var(--dsw-alias-label-secondary);cursor:pointer;display:flex;height:44px;justify-content:center;min-height:44px;min-width:44px;padding:0;position:relative;touch-action:manipulation;width:44px}\n.dus-footer-button:hover{background:var(--dsw-alias-button-floating-hover);color:var(--dsw-alias-label-primary)}\n.dus-footer-icon{font-size:18px;line-height:1}\n.dus-footer-dot{border:1.5px solid var(--dsw-specific-sidebar-fill);position:absolute;right:9px;top:9px}\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);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[data-origin=brand]{left:min(292px,calc(100vw - 402px))}\n.dus-panel[data-origin=rail]{left:min(68px,calc(100vw - 402px))}\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.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-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-settings{display:grid;gap:14px;max-width:640px;padding:4px 0}\n.dus-settings-heading{font-size:16px;font-weight:650;margin:0}\n.dus-settings-card{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:12px}\n.dus-settings-toggle{align-items:flex-start;cursor:pointer;display:flex;gap:10px;font-size:13px;line-height:1.4}\n.dus-settings-toggle input{accent-color:var(--dsw-alias-state-business-primary);height:18px;margin:0;min-height:18px;min-width:18px;width:18px}\n.dus-settings-field{display:grid;font-size:13px;font-weight:600;gap:8px}\n.dus-channel-select{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;color:inherit;font:inherit;min-height:40px;padding:0 10px;width:100%}\n.dus-channel-list{border-top:1px solid var(--dsw-alias-border-l2);margin:12px 0 0;padding-top:2px}\n.dus-channel-row{align-items:center;display:grid;font-size:11px;gap:8px;grid-template-columns:minmax(0,1fr) auto;line-height:1.4;padding:6px 0}\n.dus-channel-row[data-selected=true]{color:var(--dsw-alias-state-business-primary)}\n.dus-channel-row code{font-size:11px}\n.dus-channel-compat{color:var(--dsw-alias-label-secondary)}\n.dus-channel-action{background:transparent;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:inherit;cursor:pointer;font-size:11px;justify-self:end;min-height:32px;padding:0 9px}\n.dus-channel-action:disabled{cursor:default;opacity:.55}\n.dus-channel-action:not(:disabled):hover{background:var(--dsw-alias-button-floating-hover)}\n.dus-channel-compat[data-compatibility=verified]{color:var(--dsw-alias-state-success-primary)}\n.dus-channel-compat[data-compatibility=incompatible]{color:var(--dsw-alias-state-error-primary)}\n.dus-settings-hint{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:8px 0 0}\n@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel[data-origin]{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-footer-button{height:48px;min-height:48px;min-width:48px;width:48px}.dus-badge{line-height:24px;min-height:28px}.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 replaces only `sidebar.brand.name`, leaves the\n * official fish (`sidebar.brand.mark`) untouched, and adds a collapsed-rail\n * fallback at `sidebar.footer.action`. The detail panel is an additive\n * `shell.overlay`, never a chat-area floating widget.\n */\n\nimport type { ClientContext, ConnectionClient, SettingsScopeBinder } from './contract.ts'\nimport { BrandName, FooterAction, type SharedUi, UpdatePanel, UpdateSettings } from './components.tsx'\nimport { SETTINGS_NAMESPACE, PanelStore, PreferencesStore, StatusStore } from './stores.ts'\nimport { STATIC_COMPATIBLE_VERSION } from '../shared/types.ts'\nimport { t } from './i18n.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 // The authenticated transport can serve a remote browser too. Restrict the\n // metadata request and command panel to the machine running DSH; remote\n // clients deliberately render only the release this bundle is compatible with.\n const canManage = connection.isLoopback === true\n const status = new StatusStore(connection, canManage ? null : STATIC_COMPATIBLE_VERSION)\n const preferences = new PreferencesStore()\n const panel = new PanelStore()\n const ui: SharedUi = { status, preferences, panel, canManage }\n\n ctx.effect(() => {\n const disposeStyles = installStyles()\n if (canManage) void status.load(preferences.getSnapshot().cacheTtlMinutes)\n return () => {\n status.stop()\n disposeStyles()\n }\n }, 'dsh-update-status: style and first status read')\n\n // This is deliberately separate from the client module's hard injection:\n // a missing settings provider keeps the default visible state and does not\n // prevent the version badge or Host check from working.\n ctx.inject(['settingsScope'], (raw) => {\n const binder = (raw as { settingsScope?: unknown }).settingsScope\n if (binder === null || typeof binder !== 'object' || typeof (binder as SettingsScopeBinder).bind !== 'function') return\n try {\n const scope = (binder as SettingsScopeBinder).bind({ namespace: SETTINGS_NAMESPACE })\n ctx.effect(() => {\n const detach = preferences.attach(scope)\n let selected = status.getSnapshot().status?.channel ?? 'latest'\n const syncPreferences = () => {\n const next = preferences.getSnapshot()\n if (next.channel !== selected) {\n selected = next.channel\n void status.selectChannel(selected, next.cacheTtlMinutes)\n }\n // Changing cache policy deliberately does not issue a network request.\n // Its value is sent on the next ordinary status read or manual check.\n }\n syncPreferences()\n const unsubscribe = preferences.subscribe(syncPreferences)\n return () => { unsubscribe(); detach() }\n }, 'dsh-update-status: sidebar and channel preferences')\n } catch {\n // Default remains enabled when the Host settings namespace is unavailable.\n }\n })\n\n // single slot: DeepSeek + our badge replaces the complete official wordmark\n // (which contains HARNESS), but never touches sidebar.brand.mark.\n ctx.slots.inject('sidebar.brand.name', () => ctx.slots.register(\n // Official brand uses priority 0; the single-slot ledger requires a\n // different, lower priority to shadow it without mutating official code.\n { name: 'sidebar.brand.name', priority: -10 },\n () => BrandName({ ui }),\n ))\n\n // additive fallback; returns null in wide mode to avoid two visible badges.\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register(\n { name: 'sidebar.footer.action', id: 'dsh-update-status', order: 40 },\n props => FooterAction({ wide: props.wide, ui }),\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 // Independent settings section provides the required way to hide our entry.\n ctx.slots.inject('settings.section', () => ctx.slots.register(\n { name: 'settings.section', id: 'dsh-update-status', order: 80, label: () => t('settings.title') },\n () => UpdateSettings({ ui }),\n ))\n}\n\nmodule.exports = {\n name: PLUGIN_ID,\n inject: ['slots', 'connection'],\n apply,\n}\n"],"mappings":";;;;;;;EAEA,MAAM,gBAAgB;GAAE,QAAQ;GAAG,MAAM;GAAG,OAAO;EAAE;;;;;;EAOrD,SAAgB,uBAAuB,QAAyF;GAC9H,MAAM,UAAU,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC,MAAM,MAAM,UAAU,cAAc,KAAK,WAAW,cAAc,MAAM,QAAQ;GACrH,MAAM,4BAAY,IAAI,IAAI,CAAC,UAAU,OAAO,OAAO,CAAC;GACpD,MAAM,UAAU,QAAQ,QAAO,YAAW,UAAU,IAAI,QAAQ,OAAO,CAAC;GACxE,MAAM,eAAe,IAAI,IAAI,QAAQ,KAAI,YAAW,QAAQ,OAAO,CAAC,CAAC,QAAQ,YAA+B,YAAY,IAAI,CAAC;GAE7H,KAAK,MAAM,WAAW,SAAS;IAC7B,IAAI,UAAU,IAAI,QAAQ,OAAO,KAAK,QAAQ,YAAY,QAAQ,QAAQ,YAAY,OAAO,gB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A4B,IAAI,MAAM,SAGrD;IAAE,MAAM;IAAsB,UAAU;GAAI,SACtC,UAAU,EAAE,GAAG,CAAC,CACxB,CAAC;GAGD,IAAI,MAAM,OAAO,+BAA+B,IAAI,MAAM,SACxD;IAAE,MAAM;IAAyB,IAAI;IAAqB,OAAO;GAAG,IACpE,UAAS,aAAa;IAAE,MAAM,MAAM;IAAM;GAAG,CAAC,CAChD,CAAC;GAGD,IAAI,MAAM,OAAO,uBAAuB,IAAI,MAAM,SAChD;IAAE,MAAM;IAAiB,IAAI;IAAqB,OAAO;GAAG,SACtD,YAAY,EAAE,GAAG,CAAC,CAC1B,CAAC;GAGD,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SACnD;IAAE,MAAM;IAAoB,IAAI;IAAqB,OAAO;IAAI,aAAa,EAAE,gBAAgB;GAAE,SAC3F,eAAe,EAAE,GAAG,CAAC,CAC7B,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"],"sources":["../src/shared/channels.ts","../src/shared/types.ts","../src/shared/semver.ts","../src/shared/preview-guidance.ts","../src/client/i18n.ts","../src/client/react.ts","../src/client/components.tsx","../src/client/contract.ts","../src/client/stores.ts","../src/client/styles.ts","../src/client/index.ts"],"sourcesContent":["import type { ChannelRelease, UpdateStatus } from './types.ts'\n\nconst CHANNEL_ORDER = { latest: 0, next: 1, alpha: 2 } as const\n\n/**\n * Reduce raw dist-tags to user-meaningful choices without losing Host facts.\n * The selected channel and stable return path are mandatory; other rows must\n * represent a version that differs from both the running DSH and earlier rows.\n */\nexport function visibleChannelReleases(status: Pick<UpdateStatus, 'currentVersion' | 'channel' | 'channels'>): ChannelRelease[] {\n const ordered = [...status.channels].sort((left, right) => CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel])\n const mandatory = new Set(['latest', status.channel])\n const visible = ordered.filter(release => mandatory.has(release.channel))\n const seenVersions = new Set(visible.map(release => release.version).filter((version): version is string => version !== null))\n\n for (const release of ordered) {\n if (mandatory.has(release.channel) || release.version === null || release.version === status.currentVersion) continue\n if (seenVersions.has(release.version)) continue\n visible.push(release)\n seenVersions.add(release.version)\n }\n\n return visible.sort((left, right) => CHANNEL_ORDER[left.channel] - CHANNEL_ORDER[right.channel])\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 in DSH\n * 0.1.5-rc.1. The endpoint vocabulary remains deliberately small and private\n * to this plugin channel.\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'\n/** Exact DSH release this bundle declares compatible in package.json. */\nexport const STATIC_COMPATIBLE_VERSION = '0.1.5-rc.1'\nexport const RELEASE_CHANNELS = ['latest', 'next', 'alpha'] as const\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\nexport type UpdateEndpoint = (typeof UPDATE_ENDPOINTS)[keyof typeof UPDATE_ENDPOINTS]\nexport type ReleaseChannel = (typeof RELEASE_CHANNELS)[number]\nexport type ReleaseCompatibility = 'verified' | 'unverified' | 'incompatible'\nexport type InstallKind = 'npm-global' | 'pnpm-global' | 'source-checkout' | 'unknown'\n\nexport function isReleaseChannel(value: unknown): value is ReleaseChannel {\n return value === 'latest' || value === 'next' || value === 'alpha'\n}\n\nexport interface ChannelRelease {\n channel: ReleaseChannel\n version: string | null\n publishedAt: string | null\n compatibility: ReleaseCompatibility\n}\n\n/** Arguments accepted by either read/check endpoint. */\nexport interface CheckUpdateRequest {\n force?: boolean\n channel?: ReleaseChannel\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 latestVersion: string | null\n hasUpdate: boolean\n cached: boolean\n checkedAt: string | null\n warning: string | null\n installKind: InstallKind\n upgradeCommand: string\n releaseUrl: string\n changelogUrl: string\n publishedAt: string | null\n packageName: string\n /** Selected npm dist-tag used for comparison and command generation. */\n channel: ReleaseChannel\n /** All supported dist-tags returned by the same cached registry request. */\n channels: ChannelRelease[]\n /** Phase 1 is informational only; the GUI must never apply an update. */\n canApplyInPlace: false\n}\n\n/** Persisted browser preference served through the ordinary DSH settings seam. */\nexport interface UpdateStatusSettings {\n sidebarEnabled: boolean\n channel: ReleaseChannel\n /** On-demand npm-registry cache duration. This never starts a browser timer. */\n cacheTtlMinutes: number\n}\n","/**\n * Small, dependency-free SemVer 2.0 comparator for the host check path.\n * It intentionally accepts the common leading `v` used by release tags while\n * preserving prerelease precedence (`0.1.2-rc.1 < 0.1.2`).\n */\n\nexport interface ParsedSemver {\n major: number\n minor: number\n patch: number\n prerelease: readonly string[]\n}\n\nconst SEMVER = /^(?:v)?(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*)?$/\nconst NUMERIC_IDENTIFIER = /^(0|[1-9]\\d*)$/\n\nexport function parseSemver(value: string): ParsedSemver | undefined {\n const match = SEMVER.exec(value.trim())\n if (match === null) return undefined\n const major = Number(match[1])\n const minor = Number(match[2])\n const patch = Number(match[3])\n if (!Number.isSafeInteger(major) || !Number.isSafeInteger(minor) || !Number.isSafeInteger(patch)) return undefined\n const prerelease = match[4] === undefined ? [] : match[4].split('.')\n return { major, minor, patch, prerelease }\n}\n\nfunction compareIdentifier(left: string, right: string): number {\n const leftNumeric = NUMERIC_IDENTIFIER.test(left)\n const rightNumeric = NUMERIC_IDENTIFIER.test(right)\n if (leftNumeric && rightNumeric) return Number(left) - Number(right)\n if (leftNumeric) return -1\n if (rightNumeric) return 1\n return left < right ? -1 : left > right ? 1 : 0\n}\n\n/** Returns a negative number when left is older; undefined means unparsable. */\nexport function compareSemver(leftValue: string, rightValue: string): number | undefined {\n const left = parseSemver(leftValue)\n const right = parseSemver(rightValue)\n if (left === undefined || right === undefined) return undefined\n\n for (const key of ['major', 'minor', 'patch'] as const) {\n if (left[key] !== right[key]) return left[key] - right[key]\n }\n\n const leftStable = left.prerelease.length === 0\n const rightStable = right.prerelease.length === 0\n if (leftStable && rightStable) return 0\n if (leftStable) return 1\n if (rightStable) return -1\n\n const length = Math.max(left.prerelease.length, right.prerelease.length)\n for (let index = 0; index < length; index += 1) {\n const leftPart = left.prerelease[index]\n const rightPart = right.prerelease[index]\n if (leftPart === undefined) return -1\n if (rightPart === undefined) return 1\n const comparison = compareIdentifier(leftPart, rightPart)\n if (comparison !== 0) return comparison\n }\n return 0\n}\n\n/** False rather than a guess when either version is not valid SemVer. */\nexport function hasSemverUpdate(currentVersion: string, latestVersion: string): boolean {\n const comparison = compareSemver(currentVersion, latestVersion)\n return comparison !== undefined && comparison < 0\n}\n","import type { UpdateStatus } from './types.ts'\nimport { PACKAGE_NAME } from './types.ts'\nimport { parseSemver } from './semver.ts'\n\n/** Pinned guidance only: never execute a command or mutate the followed channel. */\nexport function previewCommand(status: UpdateStatus, version: string | null): string | null {\n if (version === null || version.trim() !== version || parseSemver(version) === undefined) return null\n if (status.installKind === 'npm-global') return `npm install -g ${PACKAGE_NAME}@${version}`\n if (status.installKind === 'pnpm-global') return `pnpm add -g ${PACKAGE_NAME}@${version}`\n return null\n}\n","/** Tiny bilingual dictionary kept local to avoid changing the host locale tree. */\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 'footer.status': { zh: '打开 DSH 版本状态', en: 'Open DSH version status' },\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.latest': { zh: '所选通道版本', en: 'Selected channel version' },\n 'panel.channels': { zh: '可用发布通道', en: 'Available release channels' },\n 'panel.compatVerified': { zh: '已验证兼容', en: 'Verified compatible' },\n 'panel.compatUnverified': { zh: '尚未验证兼容', en: 'Compatibility unverified' },\n 'panel.compatIncompatible': { zh: '已知不兼容', en: 'Known incompatible' },\n 'panel.selectChannel': { zh: '选择此通道', en: 'Select channel' },\n 'panel.selectedChannel': { zh: '已选择', en: 'Selected' },\n 'panel.notChecked': { zh: '尚未取得', en: 'Not available yet' },\n 'panel.available': { zh: '发现新版本', en: 'Update available' },\n 'panel.currentState': { zh: '未发现可用更新', en: 'No update found' },\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.switchingChannel': { zh: '正在切换通道…', en: 'Switching channel…' },\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 restart DSH yourself.' },\n 'panel.readOnly': { zh: '阶段 1 仅提示:本插件不会安装、重启、回滚或替换任何文件。', en: 'Phase 1 is advisory only: this plugin never installs, restarts, rolls back, or replaces files.' },\n 'panel.error': { zh: '检查提示', en: 'Check notice' },\n 'panel.static': { zh: '此连接只显示静态版本;请在运行 DSH 的本机打开侧栏查看完整更新信息。', en: 'This connection shows only the static version. Open the sidebar on the computer running DSH for full update details.' },\n 'preview.open': { zh: '查看预览版升级方式', en: 'View preview upgrade instructions' },\n 'preview.close': { zh: '收起升级说明', en: 'Hide upgrade instructions' },\n 'preview.follow': { zh: '关注通道只影响检查结果,不代表已安装或已切换版本。', en: 'Following a channel only changes update checks, not the installed version.' },\n 'preview.target': { zh: '目标版本', en: 'Target version' },\n 'preview.risk': { zh: '预览版本可能不稳定,插件兼容性尚需确认。执行前请保存工作、备份配置并结束运行中的任务;安装后需手动重启 DSH。此页面不会安装或重启。', en: 'Preview builds may be unstable and plugin compatibility needs checking. Save work, back up configuration and finish active tasks before executing. Restart DSH manually afterwards. This page never installs or restarts.' },\n 'preview.unavailable': { zh: '暂无可确认的预览目标,请先检查更新。', en: 'No confirmed preview target. Check for updates first.' },\n 'preview.manual': { zh: '当前安装方式无法安全生成命令,请先确认安装来源;源码安装需按其构建说明操作。', en: 'Cannot safely generate a command for this installation. Confirm its source; source checkouts require their build instructions.' },\n 'preview.same': { zh: '此目标与当前运行版本相同,无需重复安装。', en: 'This target is already running; no reinstall is needed.' },\n 'settings.title': { zh: '版本与更新', en: 'Version & updates' },\n 'settings.sidebar': { zh: '在侧栏显示版本状态入口', en: 'Show the version-status entry in the sidebar' },\n 'settings.sidebarHint': { zh: '关闭后不再渲染品牌 Badge 和收起轨道兜底入口。不会执行或安排升级。', en: 'When off, the brand badge and collapsed-rail fallback are not rendered. No update is run or scheduled.' },\n 'settings.channel': { zh: '关注发布通道', en: 'Release channel to follow' },\n 'settings.channelLatest': { zh: '稳定版(latest,推荐)', en: 'Stable (latest, recommended)' },\n 'settings.channelNext': { zh: '候选版(next)', en: 'Release candidate (next)' },\n 'settings.channelAlpha': { zh: '预览版(alpha)', en: 'Preview (alpha)' },\n 'settings.channelHint': { zh: '预览通道可能包含未稳定接口或插件兼容性变化。这里只检查并生成命令,不会安装。', en: 'Preview channels may contain unstable APIs or plugin compatibility changes. This only checks and generates a command; it never installs.' },\n 'settings.readonly': { zh: '此连接的设置为只读;显示状态不受影响。', en: 'Settings are read-only on this connection; status display is unchanged.' },\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): string {\n const entry = DICTIONARY[key]\n if (entry === undefined) return key\n return entry[languageOf()] ?? entry.en\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 replacement, collapsed-rail fallback, overlay detail panel, and settings page. */\n\nimport type * as ReactNS from 'react'\nimport { visibleChannelReleases } from '../shared/channels.ts'\nimport { previewCommand } from '../shared/preview-guidance.ts'\nimport { MAX_CACHE_TTL_MINUTES, MIN_CACHE_TTL_MINUTES, isCacheTtlMinutes, type ReleaseChannel, type ReleaseCompatibility, type UpdateStatus } from '../shared/types.ts'\nimport type { PreferencesStore, PanelStore, StatusStore } from './stores.ts'\nimport { t } 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\nfunction channelLabel(channel: ReleaseChannel): string {\n if (channel === 'latest') return t('settings.channelLatest')\n if (channel === 'next') return t('settings.channelNext')\n return t('settings.channelAlpha')\n}\n\nfunction compatibilityLabel(value: ReleaseCompatibility): string {\n if (value === 'verified') return t('panel.compatVerified')\n if (value === 'incompatible') return t('panel.compatIncompatible')\n return t('panel.compatUnverified')\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\ntype VisualState = 'loading' | 'update' | 'current' | 'problem'\n\nfunction visualState(status: UpdateStatus | null, loading: boolean, error: string | null): VisualState {\n if (loading) return 'loading'\n if (error !== null || status?.warning !== null) return status?.hasUpdate === true ? 'update' : 'problem'\n return status?.hasUpdate === true ? 'update' : 'current'\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 canManage: boolean\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 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 if (ui.canManage) ui.panel.toggle('brand')\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={ui.canManage ? 'button' : undefined}\n tabIndex={ui.canManage ? 0 : undefined}\n aria-label={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n aria-disabled={ui.canManage ? undefined : true}\n title={badgeLabel(snapshot.status, snapshot.loading, snapshot.error)}\n onClick={ui.canManage ? activate : undefined}\n onKeyDown={ui.canManage ? onKeyDown : undefined}\n >\n <span className=\"dus-badge-version\">{shortVersion(version)}</span>\n <span className=\"dus-dot\" data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={snapshot.loading || undefined} aria-hidden=\"true\" />\n </span>\n </span>\n )\n}\n\n/** List-slot fallback: it deliberately disappears while the name badge is wide. */\nexport function FooterAction({ wide, ui }: { wide?: unknown; ui: SharedUi }): ReactNS.ReactElement | null {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n if (wide === true || !preferences.sidebarEnabled) return null\n const state = visualState(snapshot.status, snapshot.loading, snapshot.error)\n const label = badgeLabel(snapshot.status, snapshot.loading, snapshot.error)\n return (\n <button\n className=\"dus-footer-button\"\n type=\"button\"\n aria-label={t('footer.status')}\n title={label}\n disabled={!ui.canManage}\n onClick={() => { ui.panel.toggle('rail') }}\n >\n <span className=\"dus-footer-icon\" aria-hidden=\"true\">↟</span>\n <span className=\"dus-dot dus-footer-dot\" data-update={snapshot.status?.hasUpdate === true || undefined} data-loading={state === 'loading' || undefined} />\n </button>\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?.hasUpdate === true) return { kind: 'update', text: t('panel.available') }\n if (status?.warning !== null && status?.warning !== undefined) return { kind: 'warning', text: status.warning }\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/** Full detail is only opened from a loopback/local DSH UI surface. */\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 commandRef = React.useRef<HTMLElement | null>(null)\n const dialogRef = React.useRef<HTMLDialogElement | null>(null)\n const [copyMessage, setCopyMessage] = React.useState<string | null>(null)\n const visible = panel.open && preferences.sidebarEnabled && ui.canManage\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 summary = statusSummary(status, snapshot.loading, snapshot.error)\n const switchingChannel = status !== null && status.channel !== preferences.channel\n const command = switchingChannel ? t('panel.switchingChannel') : status?.upgradeCommand ?? '—'\n\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\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\" data-origin={panel.origin} 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 <div className=\"dus-metadata-row\">\n <span className=\"dus-meta-label\">{t('panel.latest')} · {status === null ? 'latest' : channelLabel(status.channel)}</span>\n <code className=\"dus-meta-value\">{status?.latestVersion ?? t('panel.notChecked')}</code>\n {status?.publishedAt !== null && status?.publishedAt !== undefined && <span className=\"dus-meta-sub\">{t('panel.publishedAt')}: {timeText(status.publishedAt)}</span>}\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 {status !== null && <div className=\"dus-channel-list\" aria-label={t('panel.channels')}>\n <p className=\"dus-command-label\">{t('panel.channels')}</p>\n {visibleChannelReleases(status).map(release => {\n const selected = release.channel === preferences.channel\n return <div className=\"dus-channel-row\" data-selected={selected || undefined} key={release.channel}>\n <span>{channelLabel(release.channel)}</span>\n <code>{release.version ?? '—'}</code>\n <span className=\"dus-channel-compat\" data-compatibility={release.compatibility}>{compatibilityLabel(release.compatibility)}</span>\n <button\n className=\"dus-channel-action\"\n type=\"button\"\n disabled={selected || !preferences.writable || release.version === null}\n aria-label={`${selected ? t('panel.selectedChannel') : t('panel.selectChannel')}: ${channelLabel(release.channel)}`}\n onClick={() => { ui.preferences.setChannel(release.channel) }}\n >{selected ? t('panel.selectedChannel') : t('panel.selectChannel')}</button>\n </div>\n })}\n </div>}\n\n {status?.warning !== null && status?.warning !== undefined && <p className=\"dus-warning\">{t('panel.error')}: {status.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(undefined, 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 <button className=\"dus-action\" type=\"button\" disabled={switchingChannel || status === null} onClick={() => { void copy() }}>{t('panel.copy')}</button>\n </div>\n\n <p className=\"dus-command-label\">{t('panel.command')}</p>\n <code ref={commandRef} className=\"dus-command\" tabIndex={0}>{command}</code>\n {copyMessage !== null && <p className=\"dus-copy-message\" role=\"status\">{copyMessage}</p>}\n <p className=\"dus-note\">{t('panel.commandNote')}</p>\n <p className=\"dus-note\">{t('panel.readOnly')}</p>\n </section>\n </dialog>\n )\n}\n\n/** Separate setting page: disables only this plugin's own rendering. */\nexport function UpdateSettings({ ui }: { ui: SharedUi }): ReactNS.ReactElement {\n const preferences = useObservable(ui.preferences)\n const snapshot = useObservable(ui.status)\n const [showGuidance, setShowGuidance] = React.useState(false)\n const previews = snapshot.status?.channels.filter(release => release.channel !== 'latest') ?? []\n const channelOptions = snapshot.status === null\n ? [{ channel: preferences.channel }]\n : visibleChannelReleases(snapshot.status)\n return (\n <section className=\"dus-settings\">\n <h2 className=\"dus-settings-heading\">{t('settings.title')}</h2>\n <div className=\"dus-settings-card\">\n <label className=\"dus-settings-toggle\">\n <input\n type=\"checkbox\"\n checked={preferences.sidebarEnabled}\n disabled={!preferences.writable}\n onChange={(event) => { ui.preferences.setSidebarEnabled(event.currentTarget.checked) }}\n />\n <span>{t('settings.sidebar')}</span>\n </label>\n <p className=\"dus-settings-hint\">{t('settings.sidebarHint')}</p>\n {!preferences.writable && <p className=\"dus-settings-hint\">{t('settings.readonly')}</p>}\n </div>\n <div className=\"dus-settings-card\">\n <label className=\"dus-settings-field\">\n <span>{t('settings.channel')}</span>\n <select\n className=\"dus-channel-select\"\n value={preferences.channel}\n disabled={!preferences.writable}\n onChange={(event) => { ui.preferences.setChannel(event.currentTarget.value as ReleaseChannel) }}\n >\n {channelOptions.map(option => <option value={option.channel} key={option.channel}>{channelLabel(option.channel)}</option>)}\n </select>\n </label>\n <p className=\"dus-settings-hint\">{t('settings.channelHint')}</p>\n <p className=\"dus-settings-hint\">{t('panel.current')}: <code>{snapshot.status?.currentVersion ?? '…'}</code></p>\n <p className=\"dus-settings-hint\">{t('preview.follow')}</p>\n {ui.canManage && <button className=\"dus-action\" type=\"button\" aria-expanded={showGuidance} onClick={() => { setShowGuidance(!showGuidance) }}>{t(showGuidance ? 'preview.close' : 'preview.open')}</button>}\n {ui.canManage && showGuidance && <section aria-label={t('preview.open')}>\n <p className=\"dus-warning\">{t('preview.risk')}</p>\n <button className=\"dus-action\" type=\"button\" disabled={snapshot.loading} onClick={() => { void ui.status.refresh(undefined, preferences.cacheTtlMinutes) }}>{t(snapshot.loading ? 'panel.checking' : 'panel.check')}</button>\n {snapshot.error !== null && <p role=\"alert\">{snapshot.error}</p>}\n {previews.length === 0 && <p>{t('preview.unavailable')}</p>}\n {previews.map(release => {\n const status = snapshot.status!\n const command = previewCommand(status, release.version)\n return <div className=\"dus-settings-card\" key={release.channel}>\n <p>{channelLabel(release.channel)} · {t('preview.target')}: <code>{release.version ?? t('panel.notChecked')}</code></p>\n <p>{compatibilityLabel(release.compatibility)}</p>\n {release.version === null ? <p>{t('preview.unavailable')}</p> : release.version === status.currentVersion ? <p>{t('preview.same')}</p> : command !== null ? <><p>{t('panel.command')}</p><code className=\"dus-command\" tabIndex={0}>{command}</code></> : <p>{t('preview.manual')}</p>}\n </div>\n })}\n <p className=\"dus-note\">{t('panel.commandNote')}</p>\n </section>}\n </div>\n </section>\n )\n}\n","/** Minimal structural client faces — runtime services stay owned by DSH. */\n\nimport { isReleaseChannel, type ChannelRelease, type UpdateStatus } from '../shared/types.ts'\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\nexport interface ConnectionClient {\n isLoopback?: boolean\n rpc?: ConnectionRpc\n}\n\nexport interface SettingsScopeSnapshot {\n status?: unknown\n value?: unknown\n writable?: unknown\n}\n\nexport interface SettingsScope {\n getSnapshot(): SettingsScopeSnapshot\n subscribe(listener: () => void): () => void\n set(field: string, value: unknown): Promise<void>\n}\n\nexport interface SettingsScopeBinder {\n bind(spec: { namespace: string }): SettingsScope\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}\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 stringOrNull(value: unknown): string | null {\n return typeof value === 'string' ? value : null\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.installKind !== 'string'\n || typeof record.upgradeCommand !== 'string' || typeof record.releaseUrl !== 'string'\n || typeof record.changelogUrl !== 'string' || typeof record.packageName !== 'string'\n || !isReleaseChannel(record.channel) || !Array.isArray(record.channels) || record.canApplyInPlace !== false) return undefined\n const validKind = record.installKind === 'npm-global' || record.installKind === 'pnpm-global'\n || record.installKind === 'source-checkout' || record.installKind === 'unknown'\n if (!validKind) return undefined\n const latestVersion = record.latestVersion === null ? null : stringOrNull(record.latestVersion)\n const checkedAt = record.checkedAt === null ? null : stringOrNull(record.checkedAt)\n const warning = record.warning === null ? null : stringOrNull(record.warning)\n const publishedAt = record.publishedAt === null ? null : stringOrNull(record.publishedAt)\n if ((record.latestVersion !== null && latestVersion === null) || (record.checkedAt !== null && checkedAt === null)\n || (record.warning !== null && warning === null) || (record.publishedAt !== null && publishedAt === null)) return undefined\n const channels: ChannelRelease[] = []\n for (const raw of record.channels) {\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) return undefined\n const item = raw as Record<string, unknown>\n const version = item.version === null ? null : stringOrNull(item.version)\n const channelPublishedAt = item.publishedAt === null ? null : stringOrNull(item.publishedAt)\n if (!isReleaseChannel(item.channel) || (item.version !== null && version === null)\n || (item.publishedAt !== null && channelPublishedAt === null)\n || (item.compatibility !== 'verified' && item.compatibility !== 'unverified' && item.compatibility !== 'incompatible')) return undefined\n channels.push({ channel: item.channel, version, publishedAt: channelPublishedAt, compatibility: item.compatibility })\n }\n return {\n currentVersion: record.currentVersion,\n latestVersion,\n hasUpdate: record.hasUpdate,\n cached: record.cached,\n checkedAt,\n warning,\n installKind: record.installKind as UpdateStatus['installKind'],\n upgradeCommand: record.upgradeCommand,\n releaseUrl: record.releaseUrl,\n changelogUrl: record.changelogUrl,\n publishedAt,\n packageName: record.packageName,\n channel: record.channel,\n channels,\n canApplyInPlace: false,\n }\n}\n","/** Small observable stores shared by the independent sidebar and overlay slots. */\n\nimport { DEFAULT_CACHE_TTL_MINUTES, isCacheTtlMinutes, isReleaseChannel, PLUGIN_ID, RELEASE_CHANNELS, UPDATE_ENDPOINTS, UPDATE_STATUS_CHANNEL, type ReleaseChannel, type UpdateStatus } from '../shared/types.ts'\nimport type { ConnectionClient, Observable, SettingsScope } from './contract.ts'\nimport { errorMessage, updateStatusOf } from './contract.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\n private readonly allowRequests: boolean\n private readonly listeners = new Set<() => void>()\n private inFlight: Promise<boolean> | undefined\n private stopped = false\n\n constructor(private readonly connection: ConnectionClient, staticVersion: string | null = null) {\n this.allowRequests = staticVersion === null\n this.snapshot = staticVersion === null\n ? INITIAL_STATUS\n : { status: {\n currentVersion: staticVersion,\n latestVersion: null,\n hasUpdate: false,\n cached: true,\n checkedAt: null,\n warning: null,\n installKind: 'unknown',\n upgradeCommand: '',\n releaseUrl: '',\n changelogUrl: '',\n publishedAt: null,\n packageName: '@deepseek-ai/dsh',\n channel: 'latest',\n channels: RELEASE_CHANNELS.map(channel => ({ channel, version: null, publishedAt: null, compatibility: 'unverified' })),\n canApplyInPlace: false,\n }, loading: false, error: null }\n }\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 if (this.allowRequests) await this.request(false, this.snapshot.status?.channel ?? 'latest', cacheTtlMinutes)\n }\n\n /** User gesture only: force the Host to bypass TTL (while retaining single-flight). */\n async refresh(channel: ReleaseChannel = this.snapshot.status?.channel ?? 'latest', cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n if (this.allowRequests) await this.request(true, channel, cacheTtlMinutes)\n }\n\n /** Channel selection re-projects the Host cache; it is not a forced refresh. */\n async selectChannel(channel: ReleaseChannel, cacheTtlMinutes: number = DEFAULT_CACHE_TTL_MINUTES): Promise<void> {\n if (!this.allowRequests) return\n // A persisted preference or a newer selection can arrive while another\n // channel is in flight. Keep checking after every joined request until the\n // requested projection is actually the published snapshot.\n for (let attempts = 0; attempts < 3 && !this.stopped && this.snapshot.status?.channel !== channel; attempts += 1) {\n const pending = this.inFlight\n if (pending !== undefined && !await pending) return\n if (this.stopped || this.snapshot.status?.channel === channel) return\n if (!await this.request(false, channel, cacheTtlMinutes)) return\n }\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, channel: ReleaseChannel, 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, channel, cacheTtlMinutes: ttl }\n : { channel, 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 channel: ReleaseChannel\n cacheTtlMinutes: number\n writable: boolean\n status: 'loading' | 'ready' | 'unavailable'\n}\n\nconst INITIAL_PREFERENCES: PreferencesSnapshot = {\n sidebarEnabled: true,\n channel: 'latest',\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: SettingsScope | 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: SettingsScope): () => 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 channel: isReleaseChannel(value.channel) ? value.channel : 'latest',\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 channel: isReleaseChannel(value.channel) ? value.channel : 'latest',\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 setChannel(channel: ReleaseChannel): void {\n const previous = this.snapshot\n this.publish({ ...previous, channel })\n const scope = this.scope\n if (scope === undefined || !previous.writable) return\n void scope.set('channel', channel).catch(() => { this.publish(previous) })\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 && previous.channel === next.channel\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 type PanelOrigin = 'brand' | 'rail'\n\nexport interface PanelSnapshot {\n open: boolean\n origin: PanelOrigin\n}\n\n/** Open state also retains its trigger, so the desktop card sits beside it. */\nexport class PanelStore implements Observable<PanelSnapshot> {\n private snapshot: PanelSnapshot = { open: false, origin: 'brand' }\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(origin: PanelOrigin): void {\n const open = !(this.snapshot.open && this.snapshot.origin === origin)\n this.set({ open, origin })\n }\n\n close(): void { this.set({ ...this.snapshot, open: false }) }\n\n private set(next: PanelSnapshot): void {\n if (this.snapshot.open === next.open && this.snapshot.origin === next.origin) return\n this.snapshot = next\n for (const listener of this.listeners) listener()\n }\n}\n\n/** The one namespace name used by Host registration and browser binding. */\nexport const SETTINGS_NAMESPACE = PLUGIN_ID\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.dus-badge{align-items:center;background:var(--dsw-alias-label-primary,#111);border:0;border-radius:4px;color:var(--dsw-alias-label-primary-inverted,#fff);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-footer-button:focus-visible,.dus-action:focus-visible,.dus-close:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}\n.dus-badge:hover{filter:brightness(1.08)}\n.dus-badge[data-update=true]{background:var(--dsw-alias-state-warn-primary,#d97706);color:#111}\n.dus-badge[data-error=true]{background:var(--dsw-alias-state-error-primary,#dc2626);color:#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.dus-dot[data-update=true]{animation:dus-pulse 1.5s ease-in-out infinite;background:var(--dsw-alias-state-warn-primary)}\n.dus-dot[data-loading=true]{animation:dus-pulse .9s ease-in-out infinite}\n@keyframes dus-pulse{0%,100%{opacity:.45;transform:scale(.82)}50%{opacity:1;transform:scale(1.15)}}\n@media (prefers-reduced-motion:reduce){.dus-dot[data-update=true],.dus-dot[data-loading=true]{animation:none}}\n.dus-footer-button{align-items:center;background:transparent;border:0;border-radius:10px;color:var(--dsw-alias-label-secondary);cursor:pointer;display:flex;height:44px;justify-content:center;min-height:44px;min-width:44px;padding:0;position:relative;touch-action:manipulation;width:44px}\n.dus-footer-button:hover{background:var(--dsw-alias-button-floating-hover);color:var(--dsw-alias-label-primary)}\n.dus-footer-icon{font-size:18px;line-height:1}\n.dus-footer-dot{border:1.5px solid var(--dsw-specific-sidebar-fill);position:absolute;right:9px;top:9px}\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);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[data-origin=brand]{left:min(292px,calc(100vw - 402px))}\n.dus-panel[data-origin=rail]{left:min(68px,calc(100vw - 402px))}\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.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-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-settings{display:grid;gap:14px;max-width:640px;padding:4px 0}\n.dus-settings-heading{font-size:16px;font-weight:650;margin:0}\n.dus-settings-card{border:1px solid var(--dsw-alias-border-l2);border-radius:10px;padding:12px}\n.dus-settings-toggle{align-items:flex-start;cursor:pointer;display:flex;gap:10px;font-size:13px;line-height:1.4}\n.dus-settings-toggle input{accent-color:var(--dsw-alias-state-business-primary);height:18px;margin:0;min-height:18px;min-width:18px;width:18px}\n.dus-settings-field{display:grid;font-size:13px;font-weight:600;gap:8px}\n.dus-channel-select{background:var(--dsw-specific-input-major);border:1px solid var(--dsw-alias-border-l2);border-radius:8px;color:inherit;font:inherit;min-height:40px;padding:0 10px;width:100%}\n.dus-channel-list{border-top:1px solid var(--dsw-alias-border-l2);margin:12px 0 0;padding-top:2px}\n.dus-channel-row{align-items:center;display:grid;font-size:11px;gap:8px;grid-template-columns:minmax(0,1fr) auto;line-height:1.4;padding:6px 0}\n.dus-channel-row[data-selected=true]{color:var(--dsw-alias-state-business-primary)}\n.dus-channel-row code{font-size:11px}\n.dus-channel-compat{color:var(--dsw-alias-label-secondary)}\n.dus-channel-action{background:transparent;border:1px solid var(--dsw-alias-border-l2);border-radius:7px;color:inherit;cursor:pointer;font-size:11px;justify-self:end;min-height:32px;padding:0 9px}\n.dus-channel-action:disabled{cursor:default;opacity:.55}\n.dus-channel-action:not(:disabled):hover{background:var(--dsw-alias-button-floating-hover)}\n.dus-channel-compat[data-compatibility=verified]{color:var(--dsw-alias-state-success-primary)}\n.dus-channel-compat[data-compatibility=incompatible]{color:var(--dsw-alias-state-error-primary)}\n.dus-settings-hint{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.45;margin:8px 0 0}\n@media (max-width:640px),(hover:none) and (pointer:coarse){.dus-panel[data-origin]{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-footer-button{height:48px;min-height:48px;min-width:48px;width:48px}.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, leaves the official fish\n * (`sidebar.brand.mark`) untouched, and adds a collapsed-rail fallback at\n * `sidebar.footer.action`. The detail panel is an additive `shell.overlay`,\n * never a chat-area floating widget.\n */\n\nimport type { ClientContext, ConnectionClient, SettingsScopeBinder } from './contract.ts'\nimport { BrandName, FooterAction, type SharedUi, UpdatePanel, UpdateSettings } from './components.tsx'\nimport { SETTINGS_NAMESPACE, PanelStore, PreferencesStore, StatusStore } from './stores.ts'\nimport { STATIC_COMPATIBLE_VERSION } from '../shared/types.ts'\nimport { t } from './i18n.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 // The authenticated transport can serve a remote browser too. Restrict the\n // metadata request and command panel to the machine running DSH; remote\n // clients deliberately render only the release this bundle is compatible with.\n const canManage = connection.isLoopback === true\n const status = new StatusStore(connection, canManage ? null : STATIC_COMPATIBLE_VERSION)\n const preferences = new PreferencesStore()\n const panel = new PanelStore()\n const ui: SharedUi = { status, preferences, panel, canManage }\n\n ctx.effect(() => {\n const disposeStyles = installStyles()\n if (canManage) void status.load(preferences.getSnapshot().cacheTtlMinutes)\n return () => {\n status.stop()\n disposeStyles()\n }\n }, 'dsh-update-status: style and first status read')\n\n // This is deliberately separate from the client module's hard injection:\n // a missing settings provider keeps the default visible state and does not\n // prevent the version badge or Host check from working.\n ctx.inject(['settingsScope'], (raw) => {\n const binder = (raw as { settingsScope?: unknown }).settingsScope\n if (binder === null || typeof binder !== 'object' || typeof (binder as SettingsScopeBinder).bind !== 'function') return\n try {\n const scope = (binder as SettingsScopeBinder).bind({ namespace: SETTINGS_NAMESPACE })\n ctx.effect(() => {\n const detach = preferences.attach(scope)\n let selected = status.getSnapshot().status?.channel ?? 'latest'\n const syncPreferences = () => {\n const next = preferences.getSnapshot()\n if (next.channel !== selected) {\n selected = next.channel\n void status.selectChannel(selected, next.cacheTtlMinutes)\n }\n // Changing cache policy deliberately does not issue a network request.\n // Its value is sent on the next ordinary status read or manual check.\n }\n syncPreferences()\n const unsubscribe = preferences.subscribe(syncPreferences)\n return () => { unsubscribe(); detach() }\n }, 'dsh-update-status: sidebar and channel preferences')\n } catch {\n // Default remains enabled when the Host settings namespace is unavailable.\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 ctx.slots.inject('sidebar.brand.name', () => ctx.slots.register(\n { name: 'sidebar.brand.name', priority: -10 },\n () => BrandName({ ui }),\n ))\n\n // additive fallback; returns null in wide mode to avoid two visible badges.\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register(\n { name: 'sidebar.footer.action', id: 'dsh-update-status', order: 40 },\n props => FooterAction({ wide: props.wide, ui }),\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 // Independent settings section provides the required way to hide our entry.\n ctx.slots.inject('settings.section', () => ctx.slots.register(\n { name: 'settings.section', id: 'dsh-update-status', order: 80, label: () => t('settings.title') },\n () => UpdateSettings({ ui }),\n ))\n}\n\nmodule.exports = {\n name: PLUGIN_ID,\n inject: ['slots', 'connection'],\n apply,\n}\n"],"mappings":";;;;;;;EAEA,MAAM,gBAAgB;GAAE,QAAQ;GAAG,MAAM;GAAG,OAAO;EAAE;;;;;;EAOrD,SAAgB,uBAAuB,QAAyF;GAC9H,MAAM,UAAU,CAAC,GAAG,OAAO,QAAQ,CAAC,CAAC,MAAM,MAAM,UAAU,cAAc,KAAK,WAAW,cAAc,MAAM,QAAQ;GACrH,MAAM,4BAAY,IAAI,IAAI,CAAC,UAAU,OAAO,OAAO,CAAC;GACpD,MAAM,UAAU,QAAQ,QAAO,YAAW,UAAU,IAAI,QAAQ,OAAO,CAAC;GACxE,MAAM,eAAe,IAAI,IAAI,QAAQ,KAAI,YAAW,QAAQ,OAAO,CAAC,CAAC,QAAQ,YAA+B,YAAY,IAAI,CAAC;GAE7H,KAAK,MAAM,WAAW,SAAS;IAC7B,IAAI,UAAU,IAAI,QAAQ,OAAO,KAAK,QAAQ,YAAY,QAAQ,QAAQ,YAAY,OAAO,gBAAgB;IAC7G,IAAI,aAAa,IAAI,QAAQ,OAAO,GAAG;IACvC,QAAQ,KAAK,OAAO;IACpB,aAAa,IAAI,QAAQ,OAAO;GAClC;GAEA,OAAO,QAAQ,MAAM,MAAM,UAAU,cAAc,KAAK,WAAW,cAAc,MAAM,QAAQ;EACjG;;;;;;;;;;;ECdA,MAAaA,cAAY;EACzB,MAAa,eAAe;;EAE5B,MAAa,wBAAwB;;EAGrC,MAAa,4BAA4B;EACzC,MAAa,mBAAmB;GAAC;GAAU;GAAQ;EAAO;EAG1D,MAAa,wBAAwB;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D,YAAY,EAAE,GAAG,CAAC,CAC1B,CAAC;GAGD,IAAI,MAAM,OAAO,0BAA0B,IAAI,MAAM,SACnD;IAAE,MAAM;IAAoB,IAAI;IAAqB,OAAO;IAAI,aAAa,EAAE,gBAAgB;GAAE,SAC3F,eAAe,EAAE,GAAG,CAAC,CAC7B,CAAC;EACH;EAEA,OAAO,UAAU;GACf,MAAM;GACN,QAAQ,CAAC,SAAS,YAAY;GAC9B;EACF"}
|
package/lib/index.js
CHANGED
|
@@ -8,12 +8,13 @@ import { dirname, join, normalize, sep } from "node:path";
|
|
|
8
8
|
*
|
|
9
9
|
* The static package uses the authenticated Connection RPC channel because
|
|
10
10
|
* `harness.handle` / `host.call` are dynamic-Cordis-only closure APIs in DSH
|
|
11
|
-
* 0.1.
|
|
11
|
+
* 0.1.5-rc.1. The endpoint vocabulary remains deliberately small and private
|
|
12
12
|
* to this plugin channel.
|
|
13
13
|
*/
|
|
14
14
|
const PLUGIN_ID = "dsh-update-status";
|
|
15
15
|
const PACKAGE_NAME = "@deepseek-ai/dsh";
|
|
16
|
-
|
|
16
|
+
/** Shared Connection RPC channel. Custom prefixes 405 on the SPA fallback. */
|
|
17
|
+
const UPDATE_STATUS_CHANNEL = "/api";
|
|
17
18
|
const RELEASE_CHANNELS = [
|
|
18
19
|
"latest",
|
|
19
20
|
"next",
|
|
@@ -23,8 +24,8 @@ function isCacheTtlMinutes(value) {
|
|
|
23
24
|
return typeof value === "number" && Number.isInteger(value) && value >= 30 && value <= 1440;
|
|
24
25
|
}
|
|
25
26
|
const UPDATE_ENDPOINTS = {
|
|
26
|
-
getStatus: "get-status",
|
|
27
|
-
checkUpdate: "check-update"
|
|
27
|
+
getStatus: "dsh-update-status.get-status",
|
|
28
|
+
checkUpdate: "dsh-update-status.check-update"
|
|
28
29
|
};
|
|
29
30
|
function isReleaseChannel(value) {
|
|
30
31
|
return value === "latest" || value === "next" || value === "alpha";
|
|
@@ -176,6 +177,32 @@ function requestOf(value) {
|
|
|
176
177
|
...record.cacheTtlMinutes === void 0 ? {} : { cacheTtlMinutes: record.cacheTtlMinutes }
|
|
177
178
|
};
|
|
178
179
|
}
|
|
180
|
+
function jsonResponse(rpcId, result) {
|
|
181
|
+
return Response.json({
|
|
182
|
+
type: "server-response",
|
|
183
|
+
rpcId,
|
|
184
|
+
result
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/** Envelope-compatible Fetch adapter for one namespaced `/api` endpoint. */
|
|
188
|
+
async function dispatchUpdateStatusFetch(endpoint, handler, request) {
|
|
189
|
+
if (request.method !== "POST") return new Response("not found", { status: 404 });
|
|
190
|
+
if (request.headers.get("content-type")?.split(";", 1)[0]?.trim().toLowerCase() !== "application/json") return new Response("content type must be application/json", { status: 415 });
|
|
191
|
+
let body;
|
|
192
|
+
try {
|
|
193
|
+
body = await request.json();
|
|
194
|
+
} catch {
|
|
195
|
+
return new Response("body is not JSON", { status: 400 });
|
|
196
|
+
}
|
|
197
|
+
const record = body !== null && typeof body === "object" && !Array.isArray(body) ? body : {};
|
|
198
|
+
const rpcId = typeof record.rpcId === "string" ? record.rpcId : "invalid-request";
|
|
199
|
+
if (record.type !== "client-request" || record.method !== endpoint) return jsonResponse(rpcId, failure("gateway/bad-request", "invalid client-request message"));
|
|
200
|
+
try {
|
|
201
|
+
return jsonResponse(rpcId, await handler(endpoint, record.payload, request.signal));
|
|
202
|
+
} catch (error) {
|
|
203
|
+
return new Response(`handler failure: ${String(error)}`, { status: 500 });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
179
206
|
/** Endpoint dispatcher, exported to allow exact JSON-shape tests without a Host. */
|
|
180
207
|
function createUpdateStatusRpcHandler(service) {
|
|
181
208
|
return async (endpoint, payload) => {
|
|
@@ -204,21 +231,27 @@ function createUpdateStatusRpcHandler(service) {
|
|
|
204
231
|
}
|
|
205
232
|
/**
|
|
206
233
|
* Static packages do not receive dynamic Cordis's `harness.handle` closure.
|
|
207
|
-
*
|
|
208
|
-
*
|
|
234
|
+
* DSH 0.1.5 serves browser unary RPC only on the shared `/api` channel; a
|
|
235
|
+
* private prefix such as `/dsh-update-status` is answered by the SPA fallback
|
|
236
|
+
* with HTTP 405. Exact Fetch routes on `/api/<endpoint>` are dispatched by
|
|
237
|
+
* Connection before the Typert interceptor and do not need a new HTTP prefix.
|
|
209
238
|
*/
|
|
210
239
|
function installUpdateStatusRpc(ctx, service) {
|
|
211
240
|
const handler = createUpdateStatusRpcHandler(service);
|
|
212
|
-
ctx.inject(["connection"], (
|
|
213
|
-
const connection =
|
|
214
|
-
const
|
|
215
|
-
if (
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
241
|
+
ctx.inject(["connection"], (owned) => {
|
|
242
|
+
const connection = owned.connection;
|
|
243
|
+
const register = typeof connection.fetch?.register === "function" ? connection.fetch.register.bind(connection.fetch) : void 0;
|
|
244
|
+
if (register === void 0) return;
|
|
245
|
+
try {
|
|
246
|
+
for (const endpoint of Object.values(UPDATE_ENDPOINTS)) register({
|
|
247
|
+
path: `${UPDATE_STATUS_CHANNEL}/${endpoint}`,
|
|
248
|
+
methods: ["POST"],
|
|
249
|
+
requestBody: "buffered",
|
|
250
|
+
fetch: (request) => dispatchUpdateStatusFetch(endpoint, handler, request)
|
|
251
|
+
});
|
|
252
|
+
} catch (error) {
|
|
253
|
+
console.error("[dsh-update-status] authenticated RPC route registration failed:", error);
|
|
254
|
+
}
|
|
222
255
|
});
|
|
223
256
|
}
|
|
224
257
|
//#endregion
|
|
@@ -321,7 +354,7 @@ function dateOrNull(value) {
|
|
|
321
354
|
return Number.isFinite(time) ? new Date(time).toISOString() : null;
|
|
322
355
|
}
|
|
323
356
|
function compatibilityOf(version) {
|
|
324
|
-
return version === "0.1.
|
|
357
|
+
return version === "0.1.5-rc.1" ? "verified" : "unverified";
|
|
325
358
|
}
|
|
326
359
|
function registryReleaseOf(value) {
|
|
327
360
|
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error("npm registry returned an invalid document");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-update-status",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Read-only DeepSeek Harness Web plugin that shows the running DSH version, discovers latest/next/alpha releases, warns about compatibility, and generates copy-only upgrade commands.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -29,15 +29,6 @@
|
|
|
29
29
|
"engines": {
|
|
30
30
|
"node": ">=20"
|
|
31
31
|
},
|
|
32
|
-
"scripts": {
|
|
33
|
-
"build": "tsdown",
|
|
34
|
-
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json",
|
|
35
|
-
"test": "pnpm run typecheck && vitest run",
|
|
36
|
-
"test:unit": "vitest run",
|
|
37
|
-
"clean": "rm -rf lib coverage",
|
|
38
|
-
"prepack": "pnpm run build",
|
|
39
|
-
"verify": "pnpm run test && pnpm run build && pnpm pack --dry-run"
|
|
40
|
-
},
|
|
41
32
|
"repository": {
|
|
42
33
|
"type": "git",
|
|
43
34
|
"url": "git+https://github.com/idoall/dsh-update-status.git"
|
|
@@ -59,14 +50,13 @@
|
|
|
59
50
|
"@deepseek-ai/dsh-client-connection",
|
|
60
51
|
"@deepseek-ai/dsh-client-ui-layout",
|
|
61
52
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
62
|
-
"@deepseek-ai/dsh-client-ui-slots",
|
|
63
53
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
64
54
|
"@deepseek-ai/dsh-client-ui-settings-general"
|
|
65
55
|
]
|
|
66
56
|
},
|
|
67
57
|
"compatibility": {
|
|
68
58
|
"dshReleases": {
|
|
69
|
-
"0.1.
|
|
59
|
+
"0.1.5-rc.1": "compatible"
|
|
70
60
|
}
|
|
71
61
|
}
|
|
72
62
|
},
|
|
@@ -84,11 +74,11 @@
|
|
|
84
74
|
},
|
|
85
75
|
"peerDependencies": {
|
|
86
76
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
87
|
-
"@deepseek-ai/dsh-settings": "0.1.
|
|
77
|
+
"@deepseek-ai/dsh-settings": ">=0.1.5-rc.1"
|
|
88
78
|
},
|
|
89
79
|
"devDependencies": {
|
|
90
80
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
91
|
-
"@deepseek-ai/dsh-settings": "0.1.
|
|
81
|
+
"@deepseek-ai/dsh-settings": "0.1.5-rc.1",
|
|
92
82
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
93
83
|
"@types/node": "^26.2.0",
|
|
94
84
|
"@types/react": "^18.3.31",
|
|
@@ -97,5 +87,12 @@
|
|
|
97
87
|
"typescript": "^7.0.2",
|
|
98
88
|
"vitest": "^4.1.11"
|
|
99
89
|
},
|
|
100
|
-
"
|
|
101
|
-
|
|
90
|
+
"scripts": {
|
|
91
|
+
"build": "tsdown",
|
|
92
|
+
"typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json",
|
|
93
|
+
"test": "pnpm run typecheck && vitest run",
|
|
94
|
+
"test:unit": "vitest run",
|
|
95
|
+
"clean": "rm -rf lib coverage",
|
|
96
|
+
"verify": "pnpm run test && pnpm run build && pnpm pack --dry-run"
|
|
97
|
+
}
|
|
98
|
+
}
|