dsh-grok-subscription 1.1.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.0 — 2026-09-28
4
+
5
+ - **Remove the bundled Responses adapter. The `grok-build` route is now always the host's own pi-ai adapter.** The bundled implementation and everything that existed only to support it are gone: its request building, encrypted-reasoning envelope, prompt-cache and usage mapping and image collection (`src/adapter.js` drops from 1081 to 467 lines), the synchronous duck registration, `createGrokBuildAdapterSync` / `createDuckHostAdapter`, the release-then-re-register upgrade 1.2.0 added, and the `DSH_GROK_ADAPTER=fallback` switch. `apply` still returns immediately and builds the adapter from a deferred task, but registers exactly once.
6
+ - Why this is safe to drop: every DSH installation carries the adapter. `@deepseek-ai/dsh` depends on `dsh-base`, `dsh-base` depends on `@deepseek-ai/dsh-llm-pi-ai`, that package depends on `@earendil-works/pi-ai`, and `dsh-base`'s bundle patch mounts the `llm-pi-ai` row unconditionally (no `disabled:` gate). Checked on the npm registry for `dsh-base` 0.1.5-rc.2, 0.1.7-rc.2 and 0.2.0-rc.1, so the whole declared peer span ships it.
7
+ - What happens instead when it is missing: nothing is registered and Settings' **Active path** reads **unavailable** (new copy in both locales). No substitute adapter is invented — a half-working replacement would hide the real problem behind subtler symptoms, which is exactly how the `DUPLICATE_ADAPTER` defect survived seven releases.
8
+ - Behaviour deltas, stated plainly:
9
+ - **A rejected token is no longer renewed mid-stream and retried.** That retry lived in the bundled adapter; renewal is now proactive (through the official CLI, shortly before the recorded expiry). A session the server has already revoked surfaces as an authentication error until you sign in again. The session service keeps `refreshToken()` — tested, and the natural seam if a host-side hook is added later.
10
+ - **Settings reports three states instead of two**: `starting` while the deferred registration is pending, `official pi-ai` once it lands, `unavailable` when the host's packages cannot be resolved. The old `bundled fallback` state cannot occur.
11
+ - Request construction is unchanged: the pinned `grok:<sessionId>` `prompt_cache_key` and the forced `reasoning.encrypted_content` include still go through `withGrokRequestSemantics`, and the host still owns the image pipeline. Cache behaviour, quota, sign-in, catalog and the RPC surface are untouched.
12
+ - Docs are now desktop-only, as asked: the READMEs and both guides lead with **Settings → Plugins** (type the package name, then restart the app), and the `--profile web`, `npx` and Headless instructions are gone. The guides explain the pi-ai dependency and keep a terminal fallback for the desktop profile.
13
+ - Tests: 153 pass. Removed the files that only exercised the deleted adapter (`stream-history`, `stream-toolcall`, `usage-cache`, `image-input`) and the five duck-driven 401 tests in `session-renewal`; kept every assertion that still describes shipped behaviour (`visiblePiModels`, the cache-key format, session-level renewal). Added `tests/adapter-registration.test.mjs`: one registration per apply, nothing registered on an unavailable host, and a refused registration reported rather than left as a dead route.
14
+ - Verified live on the real 0.2.0-rc.1 desktop runtime against the live subscription: the route serves `PiAiAdapter`, diagnostics read `pi-ai` with `hostPeersResolved: true`, a three-turn conversation through the host's durable message shape answered `stored` → `42` → `84` with replay state on every turn, a tool turn returned `finish: tool-calls` with `get_weather {"city":"Paris"}`, and a `purpose: 'compaction'` turn completed normally.
15
+
16
+ ## 1.2.0 — 2026-09-28
17
+
18
+ - Fix **the host's official pi-ai adapter never serving the route**. `ctx.llm.registerAdapter` refuses a second adapter for a provider that already has one (`DUPLICATE_ADAPTER`, all-or-nothing) in every Host this plugin supports, while the plugin registered its bundled adapter synchronously and then re-registered the same `grok-build` route from the deferred upgrade. That throw landed in the upgrade's `catch` and was logged at warn level, so **every release since 0.1.10 — the one that introduced the bundled-then-upgrade design — ran the bundled adapter** while Settings reported `Active path: bundled fallback`. The upgrade now releases the bundled registration and claims the route again in one synchronous step, and restores the bundled adapter if the Host refuses the replacement, so the route is never left unserved. This defect predates 1.1.3 and is unrelated to the 0.2.0 compatibility gate that release fixed. Reported in 1.1.3's release notes and fixed here.
19
+ - Pin the request fields this plugin owns on the pi-ai path, instead of inheriting pi-ai's defaults. `withEncryptedReasoningInclude` (the single seam that injects `include: ['reasoning.encrypted_content']` into `samplingParams`, which pi-ai assigns over the assembled body last) becomes `withGrokRequestSemantics` and now also pins `prompt_cache_key` to the same `grok:<sessionId>` value the bundled adapter builds. A profile that disables caching (`cacheRetention: 'none'`) is left alone: the plugin never switches a cache back on.
20
+ - **Auxiliary requests deliberately share the session's cache key.** `dsh-llm-pi-ai` forwards only `sessionId` from `GenerateOptions` into pi-ai, so compaction and session-title calls arrive with no purpose marker; isolating them would mean suffixing the session id, which pi-ai also writes into the `session_id` and `x-client-request-id` headers. Measured against the live proxy, isolation does not pay: after a large auxiliary call a repeated chat request still read the full cached prefix in 4 of 5 shared-key trials versus 2 of 5 isolated ones, matching a control run with no auxiliary call at all. The bundled adapter keeps its own `grok:compaction:<sessionId>` scheme; this path keeps the shared key, and the guide says so.
21
+ - Add `DSH_GROK_ADAPTER=fallback` as a documented rollback. It keeps the bundled adapter even where the Host's official one is available, without waiting for a release, and is read from DSH's own environment (`~/.dsh/.env`).
22
+ - Verified on the real 0.2.0-rc.1 desktop runtime against the live subscription. Diagnostics now read `pi-ai` with `hostPeersResolved: true`. A three-turn conversation using the Host's own durable message shape (the accumulator's blocks plus `createAssistantMessage` with its replay state) answered `stored` → `42` → `84`, proving encrypted-reasoning replay survives the switch, with `cacheReadTokens` climbing 1152 → 1280 → 1408. A tool turn returned `finish: tool-calls` with `get_weather {"city":"Paris"}`. A `purpose: 'compaction'` turn completed normally. The rollback switch was exercised live: `fallback` serves the bundled adapter, unset and any other value serve `PiAiAdapter`.
23
+ - `tests/pi-ai-request-body.test.mjs` drives the real `@earendil-works/pi-ai` Responses API through the plugin's wrapper with a stubbed transport and asserts the outgoing body — `include`, `prompt_cache_key`, `store: false`, `model`, and the converted input — so a pi-ai release that stops honouring `samplingParams` fails CI instead of silently dropping both fields. `tests/pi-ai-request-semantics.test.mjs` covers the wrapper directly (including the disabled-cache case), and `tests/adapter-upgrade.test.mjs` models the Host's registry rule and the rollback switch. All eight new assertions fail against 1.1.3.
24
+ - No session, login, renewal, model-routing, quota, or proxy changes. The bundled adapter is still shipped and still the automatic fallback. Restart DSH fully after updating.
25
+
3
26
  ## 1.1.3 — 2026-09-28
4
27
 
5
28
  - Fix **the plugin disappearing from the desktop app after it updated to DSH 0.2.0-rc.1**. DSH 0.2.0 gates every profile entry on the plugin's `@deepseek-ai/dsh*` peer ranges (`evaluatePluginCompatibility` in `@deepseek-ai/dsh-app-boot`) and drops the whole bundle before any plugin code loads when one of them does not admit the running version. This plugin declared `^0.1.5-rc.2`, which is `<0.2.0`, so the Host reported `skipping profile bundle "dsh-grok-subscription": Plugin dsh-grok-subscription@1.1.2 is incompatible with dsh 0.2.0-rc.1` and started without a `grok-build` route, without a Settings section, and without any error in the UI. Reproduced against the real desktop runtime, and confirmed fixed with the same `dsh --profile <name> --dump-config`: the composition now emits the `grok-subscription` row.
package/README.en.md CHANGED
@@ -46,11 +46,7 @@ For DSH setup, see the [official instructions](https://github.com/deepseek-ai/de
46
46
 
47
47
  ### 1. Install the plugin
48
48
 
49
- ```sh
50
- dsh plugin --profile web add dsh-grok-subscription@latest
51
- ```
52
-
53
- Then **manually restart the target DSH instance**. Refreshing the browser alone does not reload the Host adapter.
49
+ In the desktop app open **Settings → Plugins**, type the package name `dsh-grok-subscription` into the install field, and install it. Then **quit and restart the desktop app completely**: refreshing the page alone does not reload the Host adapter.
54
50
 
55
51
  ### 2. Sign in
56
52
 
@@ -63,19 +59,18 @@ Open **Settings → Grok Subscription** and select **CLI login** or **Device-cod
63
59
  Pick a Grok model your account can use, adjust reasoning effort as needed, and start chatting or coding. The badge beside the model shows weekly quota when usage can be read successfully.
64
60
 
65
61
  <details>
66
- <summary>Verify the install / use npx / pin a version</summary>
62
+ <summary>Check the version / pin one / fall back when the UI install fails</summary>
67
63
 
68
- ```sh
69
- dsh plugin --profile web list dsh-grok-subscription --depth 0
70
- ```
64
+ **Settings → Plugins** lists the installed plugins and their versions, and the plugin's own **Settings → Grok Subscription** page shows a version card. To pin a version, put the full `package@version` in the install field, for example `dsh-grok-subscription@2.0.0`.
71
65
 
72
- Without a global `dsh` command, retain your full `npx` launcher prefix. This example uses the baseline version declared in the package metadata:
66
+ If the UI install fails (an unusual profile directory, say), the equivalent runs against the desktop profile itself (pnpm ≥ 11):
73
67
 
74
68
  ```sh
75
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web add dsh-grok-subscription@latest
69
+ cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
70
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
76
71
  ```
77
72
 
78
- See the [full user guide](docs/guide.en.md) for pinned npm versions, GitHub-source installs, CLI paths, and Headless usage.
73
+ `dsh plugin --profile desktop …` is refused: the Electron application owns that profile exclusively. CLI paths, sign-in, and troubleshooting are in the [full user guide](docs/guide.en.md).
79
74
 
80
75
  </details>
81
76
 
@@ -116,27 +111,17 @@ Identity and time values in the account screenshot are demo data. Usage screensh
116
111
 
117
112
  ## User guide
118
113
 
119
- The [full user guide](docs/guide.en.md) covers CLI sign-in, the model catalog, images, quota limitations, network troubleshooting, Headless usage, and development.
114
+ The [full user guide](docs/guide.en.md) covers installation and compatibility, CLI sign-in, the model catalog, images, quota limitations, network troubleshooting, and development.
120
115
 
121
116
  Quick links: [Sign-in and credentials](docs/guide.en.md#sign-in-and-credentials) · [Image input](docs/guide.en.md#image-input) · [Troubleshooting](docs/guide.en.md#troubleshooting) · [Contributing](CONTRIBUTING.md).
122
117
 
123
118
  ## Update and uninstall
124
119
 
125
- **Update an npm installation:** check versions in Settings. Supported npm installs can update there, or you can run:
126
-
127
- ```sh
128
- dsh plugin --profile web add dsh-grok-subscription@latest
129
- ```
130
-
131
- For a GitHub-source install, use `dsh plugin --profile web update dsh-grok-subscription`. For a local `link:` install, pull and rebuild the checkout instead of replacing its development link.
120
+ **Update:** put `dsh-grok-subscription` (or `dsh-grok-subscription@version`) into the **Settings → Plugins** install field again to install over the current copy; the plugin's own page also has a version card and an **Update plugin** button. Then **quit and restart the desktop app completely**.
132
121
 
133
122
  The desktop app owns its `desktop` profile exclusively, so `dsh plugin --profile desktop …` is refused there. The desktop **Update plugin** button therefore installs the exact version inside that profile directory with DSH's own bundled pnpm; before `1.1.1` that button always failed in the desktop app. Manual steps: [Updates and sign-out](docs/guide.en.md#updates-and-sign-out).
134
123
 
135
- **Uninstall:**
136
-
137
- ```sh
138
- dsh plugin --profile web remove dsh-grok-subscription
139
- ```
124
+ **Uninstall:** remove `dsh-grok-subscription` in **Settings → Plugins**, or run `pnpm remove dsh-grok-subscription` in that profile directory, then restart the desktop app. Uninstalling leaves other plugins, the profile, and the CLI's `auth.json` intact, and is not the same as signing out of the official CLI; see [Updates and sign-out](docs/guide.en.md#updates-and-sign-out).
140
125
 
141
126
  Restart DSH afterwards. Removal does not delete other plugins, the whole profile, or the CLI's `auth.json`; it is not the same as signing out of the official CLI. See [Updates and sign-out](docs/guide.en.md#updates-and-sign-out).
142
127
 
@@ -148,7 +133,7 @@ Restart DSH afterwards. Removal does not delete other plugins, the whole profile
148
133
 
149
134
  **Sign-in or requests time out?** Check connectivity from the DSH host to account and subscription services, including its launch-time proxy settings. Network issues, authentication, or service errors can cause failures; do not assume the quota is exhausted. See [Troubleshooting](docs/guide.en.md#troubleshooting).
150
135
 
151
- **Images still unavailable after updating?** Fully restart DSH, check the model's image support, and check the attachment capability shown under **Active path** in Settings.
136
+ **Images still unavailable after updating?** Fully restart the desktop app, check the model's image support, and check that **Active path** in Settings reads **official pi-ai** with attachment capability available. An **unavailable** row means the host has no pi-ai adapter.
152
137
 
153
138
  ## Scope and support
154
139
 
package/README.md CHANGED
@@ -46,11 +46,7 @@
46
46
 
47
47
  ### 1. 安装插件
48
48
 
49
- ```sh
50
- dsh plugin --profile web add dsh-grok-subscription@latest
51
- ```
52
-
53
- 完成后,**手动重启正在运行的目标 DSH**。仅刷新浏览器不会重新加载 Host 中的适配器。
49
+ 在桌面版打开 **设置 → 插件**,在安装输入框里填入包名 `dsh-grok-subscription` 并安装,然后**完全退出并重启桌面应用**。仅刷新页面不会重新加载 Host 中的适配器。
54
50
 
55
51
  ### 2. 登录订阅
56
52
 
@@ -63,19 +59,18 @@ dsh plugin --profile web add dsh-grok-subscription@latest
63
59
  在模型选择器中选择账号可用的 Grok 模型。按需要调整推理档位,开始对话或编程;模型旁的徽章显示成功读取到的每周余量。
64
60
 
65
61
  <details>
66
- <summary>检查安装 / 使用 npx / 安装指定版本</summary>
62
+ <summary>确认版本 / 固定版本 / 界面安装失败时的兜底</summary>
67
63
 
68
- ```sh
69
- dsh plugin --profile web list dsh-grok-subscription --depth 0
70
- ```
64
+ **设置 → 插件** 会列出已安装插件与版本,插件自己的 **设置 → Grok 订阅** 页也有版本卡片。要固定版本,在安装框里填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.0`。
71
65
 
72
- 没有全局 `dsh` 命令时,保留你使用的完整 `npx` 前缀。以下使用项目元数据声明的基线版本作为示例:
66
+ 界面安装失败时(例如 profile 目录权限异常),可以对桌面版 profile 手动执行等价操作(pnpm ≥ 11):
73
67
 
74
68
  ```sh
75
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web add dsh-grok-subscription@latest
69
+ cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
70
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
76
71
  ```
77
72
 
78
- 固定 npm 版本、GitHub 来源安装、CLI 路径与 Headless 使用见 [完整使用指南](docs/guide.zh-CN.md)。
73
+ `dsh plugin --profile desktop …` 会被拒绝:桌面版 profile 由 Electron 应用独占。CLI 路径、登录方式与故障排查见 [完整使用指南](docs/guide.zh-CN.md)。
79
74
 
80
75
  </details>
81
76
 
@@ -116,29 +111,17 @@ npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web add dsh-grok-subscriptio
116
111
 
117
112
  ## 使用指南
118
113
 
119
- [完整使用指南](docs/guide.zh-CN.md) 包含 CLI 登录、模型目录、图片输入、额度限制、网络排查、Headless 使用和本地开发。
114
+ [完整使用指南](docs/guide.zh-CN.md) 包含安装与兼容性、CLI 登录、模型目录、图片输入、额度限制、网络排查和本地开发。
120
115
 
121
116
  常用入口:[登录与凭据](docs/guide.zh-CN.md#登录与凭据) · [图片输入](docs/guide.zh-CN.md#图片输入) · [故障排查](docs/guide.zh-CN.md#故障排查) · [参与贡献](CONTRIBUTING.md)。
122
117
 
123
118
  ## 更新与卸载
124
119
 
125
- **更新 npm 安装:** 可在设置页检查版本;支持的 npm 安装可一键更新,也可以运行:
120
+ **更新:** 在 **设置 → 插件** 的安装框里重新填入 `dsh-grok-subscription`(或 `dsh-grok-subscription@版本`)安装即可覆盖;插件自己的设置页也有版本卡片与「更新插件」按钮。完成后**完全退出并重启桌面应用**。
126
121
 
127
- ```sh
128
- dsh plugin --profile web add dsh-grok-subscription@latest
129
- ```
130
-
131
- GitHub 来源安装可使用 `dsh plugin --profile web update dsh-grok-subscription`;本地 `link:` 安装应拉取对应仓库并重新构建,不要替换开发链接。
132
-
133
- 桌面版由 Electron 应用独占 `desktop` profile,`dsh plugin --profile desktop …` 会被拒绝,因此桌面版的「更新插件」由插件自己在该 profile 目录中用 DSH 自带的 pnpm 安装精确版本;`1.1.1` 之前该按钮在桌面版必然失败,手动步骤见[更新与登出](docs/guide.zh-CN.md#更新与登出)。
134
-
135
- **卸载:**
136
-
137
- ```sh
138
- dsh plugin --profile web remove dsh-grok-subscription
139
- ```
122
+ 桌面版由 Electron 应用独占 `desktop` profile,`dsh plugin --profile desktop …` 会被直接拒绝,因此桌面版的「更新插件」由插件在该 profile 目录中用 DSH 自带的 pnpm 安装精确版本;`1.1.1` 之前该按钮在桌面版必然失败,手动步骤见[更新与登出](docs/guide.zh-CN.md#更新与登出)。
140
123
 
141
- 完成后手动重启 DSH。卸载不会删除其他插件、整个 profile 或 Grok CLI 的 `auth.json`,也不等于从官方 CLI 登出;清理范围见 [更新与登出](docs/guide.zh-CN.md#更新与登出)。
124
+ **卸载:** 在 **设置 → 插件** 里移除 `dsh-grok-subscription`,或在该 profile 目录执行 `pnpm remove dsh-grok-subscription`,然后重启桌面应用。卸载不会删除其他插件、整个 profile 或 Grok CLI 的 `auth.json`,也不等于从官方 CLI 登出;清理范围见 [更新与登出](docs/guide.zh-CN.md#更新与登出)。
142
125
 
143
126
  ## 常见问题
144
127
 
@@ -146,7 +129,7 @@ dsh plugin --profile web remove dsh-grok-subscription
146
129
 
147
130
  **登录或请求超时?** 检查 DSH 所在机器能否连接账号与订阅服务,以及启动环境的代理设置。网络、登录状态和服务端异常都可能导致失败,不要直接认定为额度耗尽。见 [故障排查](docs/guide.zh-CN.md#故障排查)。
148
131
 
149
- **更新后不能带图?** 完整重启 DSH,检查模型是否在图片支持列表,以及设置页的「运行通路」是否显示附件能力可用。
132
+ **更新后不能带图?** 完整重启桌面应用,检查模型是否在图片支持列表,以及设置页的「运行通路」是否显示**官方 pi-ai** 且附件能力可用。若显示「不可用」,说明宿主缺少 pi-ai 适配器。
150
133
 
151
134
  ## 边界与支持
152
135
 
package/docs/guide.en.md CHANGED
@@ -6,37 +6,20 @@ For quick setup, see the [README](../README.en.md#install). This guide covers de
6
6
 
7
7
  ## Installation and compatibility
8
8
 
9
- You need DeepSeek Harness, the official Grok Build CLI, and an account with Grok Build access. The plugin declares Node.js `^22.19.0 || >=24.0.0`; DSH peers use `>=0.1.5-rc.2 <0.3.0-0`, which spans the whole 0.1 and 0.2 lines. See [package.json](../package.json) for the full requirements. Declared compatibility is not a claim that every version has passed live verification.
9
+ You need the DeepSeek Harness desktop app, the official Grok Build CLI, and an account with Grok Build access. The plugin declares Node.js `^22.19.0 || >=24.0.0`; DSH peers use `>=0.1.5-rc.2 <0.3.0-0`, which spans the whole 0.1 and 0.2 lines. See [package.json](../package.json) for the full requirements. Declared compatibility is not a claim that every version has passed live verification.
10
10
 
11
- **Install from npm:**
11
+ **Install:** in the desktop app open **Settings → Plugins**, type the package name `dsh-grok-subscription` into the install field, and install it. Then **quit and restart the desktop app completely**; refreshing the page alone does not reload the Host adapter. To pin a version, put the full `package@version` in that field, for example `dsh-grok-subscription@2.0.0`.
12
12
 
13
- ```sh
14
- dsh plugin --profile web add dsh-grok-subscription@latest
15
- dsh plugin --profile web list dsh-grok-subscription --depth 0
16
- ```
17
-
18
- For reproducibility, pin a published version, for example:
19
-
20
- ```sh
21
- dsh plugin --profile web add dsh-grok-subscription@1.1.3
22
- ```
13
+ **The plugin depends on the host's own pi-ai adapter.** From 2.0.0 the `grok-build` route is served entirely by the host's `@deepseek-ai/dsh-llm-pi-ai` / `@earendil-works/pi-ai`, which every DSH installation carries (`@deepseek-ai/dsh` → `dsh-base` → `dsh-llm-pi-ai`, with the `llm-pi-ai` row mounted unconditionally). If those packages cannot be resolved from the DSH installation, the plugin registers no route at all and **Active path** in Settings reads **unavailable**.
23
14
 
24
- **Install from GitHub:**
15
+ If the UI install fails (an unusual profile directory, say), the equivalent runs against the desktop profile itself (pnpm ≥ 11):
25
16
 
26
17
  ```sh
27
- dsh plugin --profile web add BaronCyrus/dsh-grok-subscription
28
- ```
29
-
30
- The GitHub branch and published npm package may differ. Choose an installation source deliberately; a source commit does not mean a new npm version has been published.
31
-
32
- If you launch DSH with `npx` and have no global `dsh` command, retain the full prefix for plugin operations. This example uses the baseline declared in the package:
33
-
34
- ```sh
35
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web add dsh-grok-subscription@latest
36
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web list dsh-grok-subscription --depth 0
18
+ cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
19
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
37
20
  ```
38
21
 
39
- Restart the target DSH instance after installation. For local diagnosis, `dsh --profile web --dump-config` should show one `grok-build` route. Redact sensitive settings and personal paths before sharing diagnostics; do not post the full configuration.
22
+ `dsh plugin --profile desktop …` is refused: the Electron application owns that profile exclusively.
40
23
 
41
24
  ## Sign-in and credentials
42
25
 
@@ -64,7 +47,7 @@ After sign-in, the plugin prefers the catalog from `/v1/models-v2`; while signed
64
47
 
65
48
  Reasoning options follow model metadata. The implementation recognizes `low` / `medium` / `high` / `xhigh`, usually defaulting to `high`; the built-in `grok-4.5` entry has only the first three. Follow the actual menu and backend-supported choices. See [catalog.js](../src/catalog.js).
66
49
 
67
- Login, pull, logout, and catalog refresh notify the model picker. Near a known token expiry, or after an authentication rejection, the plugin attempts renewal through the official CLI. If renewal fails, authorization may still be required again; uninterrupted sessions are not guaranteed.
50
+ Login, pull, logout, and catalog refresh notify the model picker. Near a known token expiry the plugin renews through the official CLI. If renewal fails, or the server has already revoked the session, authorization may still be required again; uninterrupted sessions are not guaranteed.
68
51
 
69
52
  ## Image input
70
53
 
@@ -80,7 +63,7 @@ These exact IDs come from `IMAGE_INPUT_MODEL_IDS` in [constants.js](../src/const
80
63
 
81
64
  Paste or attach an image in the composer. DSH's attachment service processes it within pixel and byte budgets; over-budget images may degrade to a text description. Do not assume every image is sent at its original resolution.
82
65
 
83
- Both the host's pi-ai adapter and the bundled fallback have image-handling paths, but both depend on the host attachment capability. The **Active path** row in Settings shows the adapter and whether image input is available. After an update, a refreshed browser can still be using an old adapter if the Host was not restarted.
66
+ The `grok-build` route is served by the host's official pi-ai adapter, which also owns the image pipeline (attachment resolution plus pixel and byte budgets). The **Active path** row in Settings names the adapter serving the route and whether image input is available; **unavailable** means the host has no pi-ai adapter. After an update, a refreshed browser can still be running the old version if the Host was not restarted.
84
67
 
85
68
  ## Quota and caching
86
69
 
@@ -88,28 +71,10 @@ Usage is read through the undocumented `/v1/billing?format=credits` endpoint and
88
71
 
89
72
  The composer badge appears only for `grok-build` with a successful usage read; hover or click for weekly quota and its reset time. Missing data does not mean zero quota. A failed read does not invent percentages or independently block chat.
90
73
 
91
- For prefix caching, the plugin keeps a stable `prompt_cache_key` and tool ordering within a DSH session, and the bundled adapter preserves `reasoning.encrypted_content`. These are request-construction measures, not a guarantee of backend cache hits or quota savings. No invented hit rate is reported. See [adapter.js](../src/adapter.js).
92
-
93
- ## Headless usage
94
-
95
- First complete subscription sign-in through the Grok CLI on the same host and verify Web usage. Then install the plugin into the target Headless profile:
96
-
97
- ```sh
98
- dsh plugin --profile headless add dsh-grok-subscription@latest
99
- ```
100
-
101
- Confirm that this profile's model configuration selects a `grok-build` model the account can use, then run a one-shot interactive task:
102
-
103
- ```sh
104
- dsh --profile headless "reply with exactly: ok"
105
- ```
106
-
107
- That task makes a real model request and uses the selected service's quota; it is not an offline check. Selecting a model in Web is not proof that another profile is configured correctly.
74
+ For prefix caching, the plugin pins one stable `prompt_cache_key` per DSH session (`grok:<sessionId>`) and writes it into every request; tool ordering stays stable. Auxiliary requests (compaction, session titles) share the session's key rather than taking a separate one; measured against the proxy, isolating them did not improve the chat prefix's cache reads. These are request-construction measures, not a guarantee of backend cache hits or quota savings. No invented hit rate is reported. See [adapter.js](../src/adapter.js).
108
75
 
109
76
  ## Troubleshooting
110
77
 
111
- **`dsh` not found.** Use the full `npx` prefix you use to launch DSH, or check the installed launcher's path.
112
-
113
78
  **`grok` not found or no login window.** Check that the CLI is installed on the DSH Host and its process sees `DSH_GROK_BIN` / `PATH`. Look for a clickable login link in the panel. A browser failing to open does not by itself prove the authorization service is unreachable. On Windows, if the CLI is not on `PATH`, put the absolute `grok.exe` path in the user-level `DSH_GROK_BIN` (for example `setx DSH_GROK_BIN "C:\Users\<user>\.grok\bin\grok.exe"`) and restart DSH completely; note that `DSH_*` is a DSH bootstrap prefix, so declaring it in `~/.dsh/.env` makes that environment layer fail.
114
79
 
115
80
  **`fetch failed` or `Billing request timed out`.** Check access to the account service and `cli-chat-proxy.grok.com` separately. When a proxy is needed, set standard `https_proxy` / `http_proxy` variables in DSH's launch environment or `~/.dsh/.env`, not the project directory's `.env`, then manually restart DSH. The plugin uses the host network setup rather than providing its own proxy service. Network conditions are one possibility; also check authentication and backend errors.
@@ -118,28 +83,30 @@ That task makes a real model request and uses the selected service's quota; it i
118
83
 
119
84
  **Chat or usage returns `401`.** Check the CLI session. If automatic renewal fails, run `grok login` again, authorize, and pull the session. Do not repeatedly paste an old token.
120
85
 
121
- **Images rejected.** Check the supported IDs and attachment capability under **Active path**. Fully restart the Host after updating, then refresh the browser.
86
+ **Images rejected.** Check the supported IDs, confirm **Active path** reads **official pi-ai** with attachment capability available, and fully restart the desktop app after updating.
122
87
 
123
88
  **Auth-file permission error.** Check the actual path, owner, symlink status, and permissions. `chmod 600` fixes permission bits only.
124
89
 
125
90
  **No response on an old release.** Version `1.0.0` had a tool-call serialization defect fixed in `1.0.1`; older versions may also lack later renewal fixes. Update to the current published version before diagnosing a persistent problem rather than attributing every missing response to that old defect.
126
91
 
127
- **The plugin vanished from Settings after a DSH update.** From 0.2.0 DSH refuses a plugin whose `@deepseek-ai/dsh*` peer ranges do not admit the running version, and it drops the whole bundle before any plugin code loads: no `grok-build` route, no Settings section, and nothing in the panel to explain it. The Host writes `skipping profile bundle "dsh-grok-subscription"` to its own stderr, and `dsh --profile web --dump-config` omits the `grok-subscription` row. Update the plugin rather than granting a version exemption: an exemption re-enables a build that was never checked against that Host.
92
+ **The plugin vanished from Settings after a DSH update.** From 0.2.0 DSH refuses a plugin whose `@deepseek-ai/dsh*` peer ranges do not admit the running version, and it drops the whole bundle before any plugin code loads: no `grok-build` route, no Settings section, and nothing in the panel to explain it. The Host writes `skipping profile bundle "dsh-grok-subscription"` to its own stderr (the desktop app refuses `dsh --profile desktop --dump-config`, so that line is the evidence to look for). Update the plugin rather than granting a version exemption: an exemption re-enables a build that was never checked against that Host.
93
+
94
+ **Active path reads "unavailable".** The host has no pi-ai adapter: `@earendil-works/pi-ai` or `@deepseek-ai/dsh-llm-pi-ai` cannot be resolved from the DSH installation. Check that the installation is complete, that `node_modules` was not pruned by hand, and restart the desktop app completely.
128
95
 
129
96
  ## Updates and sign-out
130
97
 
131
- For npm installs, update in Settings or run `dsh plugin --profile web add dsh-grok-subscription@latest`. For GitHub-source installs, run `dsh plugin --profile web update dsh-grok-subscription`. For local links, pull, test, and rebuild the checkout. Restart DSH afterwards.
98
+ **Update:** put `dsh-grok-subscription` (or `dsh-grok-subscription@version`) into the **Settings → Plugins** install field again to install over the current copy; the plugin's own page also has a version card and an **Update plugin** button. Then **quit and restart the desktop app completely**.
132
99
 
133
100
  In the desktop app the `desktop` profile is owned exclusively by the Electron application, and `dsh plugin --profile desktop …` is refused outright (`profile "desktop" is managed exclusively by the Electron application`), so the desktop app can only be updated by the plugin itself. From 1.1.1 the **Update plugin** button installs the exact version inside that profile directory with DSH's own bundled pnpm. If you are still on an older version and the button reports an error, run the equivalent by hand (pnpm ≥ 11):
134
101
 
135
102
  ```sh
136
103
  cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
137
- pnpm add --save-exact dsh-grok-subscription@1.1.3
104
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
138
105
  ```
139
106
 
140
107
  Then quit and restart the desktop app completely. After a successful update the profile's `package.json` dependency should show the target version while its `dsh.profile.bundles` entry is unchanged. Refreshing the browser is not enough: without a Host restart the old version keeps loading.
141
108
 
142
- Uninstall with `dsh plugin --profile web remove dsh-grok-subscription`. This leaves the profile, other plugins, and the CLI's `auth.json` intact.
109
+ **Uninstall:** remove `dsh-grok-subscription` in **Settings → Plugins**, or run `pnpm remove dsh-grok-subscription` in that profile directory. This leaves the profile, other plugins, and the CLI's `auth.json` intact.
143
110
 
144
111
  The Settings logout action clears plugin-side session state; it does not revoke the official CLI session. If the CLI file remains, a later pull or startup may sync it again. To end the official session, use the official CLI / account's sign-out and authorization-management flow. Do not delete an entire DSH profile to handle one account.
145
112
 
@@ -6,37 +6,20 @@
6
6
 
7
7
  ## 安装与兼容性
8
8
 
9
- 需要 DeepSeek Harness、官方 Grok Build CLI,以及当前具有 Grok Build 使用资格的订阅账号。插件的 Node.js 要求为 `^22.19.0 || >=24.0.0`,DSH peer 声明以 [package.json](../package.json) 为准;其中 DSH 依赖使用 `>=0.1.5-rc.2 <0.3.0-0`,覆盖 0.1 与 0.2 全线。声明范围不等于所有版本都已经过实机验证。
9
+ 需要 DeepSeek Harness 桌面版、官方 Grok Build CLI,以及当前具有 Grok Build 使用资格的订阅账号。插件的 Node.js 要求为 `^22.19.0 || >=24.0.0`,DSH peer 声明以 [package.json](../package.json) 为准;其中 DSH 依赖使用 `>=0.1.5-rc.2 <0.3.0-0`,覆盖 0.1 与 0.2 全线。声明范围不等于所有版本都已经过实机验证。
10
10
 
11
- **npm 安装:**
11
+ **安装:** 在桌面版打开 **设置 → 插件**,在安装输入框里填入包名 `dsh-grok-subscription` 并安装,然后**完全退出并重启桌面应用**。仅刷新页面不会重新加载 Host 中的适配器。需要可重复安装时,填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.0`。
12
12
 
13
- ```sh
14
- dsh plugin --profile web add dsh-grok-subscription@latest
15
- dsh plugin --profile web list dsh-grok-subscription --depth 0
16
- ```
17
-
18
- 需要可重复安装时,固定已发布版本,例如:
19
-
20
- ```sh
21
- dsh plugin --profile web add dsh-grok-subscription@1.1.3
22
- ```
13
+ **插件依赖宿主自带的 pi-ai 适配器。** 从 2.0.0 起,`grok-build` 路由完全由宿主的 `@deepseek-ai/dsh-llm-pi-ai` / `@earendil-works/pi-ai` 服务;DSH 的任何安装方式都带有它们(`@deepseek-ai/dsh` → `dsh-base` → `dsh-llm-pi-ai`,且 `llm-pi-ai` 行无条件挂载)。这两个包无法从 DSH 安装目录解析时,插件不会注册任何路由,设置页的「运行通路」显示**不可用**。
23
14
 
24
- **GitHub 来源安装:**
15
+ 界面安装失败时(例如 profile 目录权限异常),可以对桌面版 profile 手动执行等价操作(pnpm ≥ 11):
25
16
 
26
17
  ```sh
27
- dsh plugin --profile web add BaronCyrus/dsh-grok-subscription
28
- ```
29
-
30
- GitHub 分支与 npm 发布版本可能不同;请明确选择安装来源,不要把某个源码提交当作已经发布的 npm 版本。
31
-
32
- 如果 DSH 通过 `npx` 运行、没有全局 `dsh` 命令,插件操作也需要完整前缀。下面以包声明的基线版本为例:
33
-
34
- ```sh
35
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web add dsh-grok-subscription@latest
36
- npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web list dsh-grok-subscription --depth 0
18
+ cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
19
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
37
20
  ```
38
21
 
39
- 安装后手动重启目标 DSH。需要进一步检查时,在本机运行 `dsh --profile web --dump-config`,确认只有一个 `grok-build` 路由;分享诊断前先隐藏敏感配置与个人路径,不要公开整份配置。
22
+ `dsh plugin --profile desktop …` 会被直接拒绝:桌面版 profile 由 Electron 应用独占。
40
23
 
41
24
  ## 登录与凭据
42
25
 
@@ -64,7 +47,7 @@ chmod 600 "${GROK_HOME:-$HOME/.grok}/auth.json"
64
47
 
65
48
  推理档位按模型元数据提供。当前实现识别 `low` / `medium` / `high` / `xhigh`,通常默认 `high`;内置 `grok-4.5` 目录只包含前三档。以实际菜单与服务端接受的选项为准。实现见 [catalog.js](../src/catalog.js)。
66
49
 
67
- 登录、拉取、登出和目录刷新会通知模型选择器更新。临近已知的 token 到期时间或遇到认证拒绝时,插件会尝试通过官方 CLI 续期;若失败,仍可能需要重新授权,不承诺会话永不失效。
50
+ 登录、拉取、登出和目录刷新会通知模型选择器更新。临近已知的 token 到期时间时,插件会通过官方 CLI 续期;若续期失败或服务端已撤销会话,仍需要重新授权,不承诺会话永不失效。
68
51
 
69
52
  ## 图片输入
70
53
 
@@ -80,7 +63,7 @@ grok-4.6
80
63
 
81
64
  在输入框粘贴或附加图片后,DSH 的附件服务会按像素与体积预算处理。图片超出可用预算时可能降级为文本说明;不要假设每张原图都以原始分辨率发出。
82
65
 
83
- 宿主官方 pi-ai 适配器和内置回退适配器都有对应图片通路,但都依赖宿主附件能力。设置页的 **运行通路** 会显示当前适配器和图片输入是否可用。更新后只有界面刷新、Host 未重启时,可能仍运行旧适配器。
66
+ `grok-build` 路由由宿主官方的 pi-ai 适配器服务,图片通路(附件解析、像素与体积预算)也由它负责。设置页的 **运行通路** 会显示适配器是否在服务,以及图片输入是否可用;显示**不可用**时说明宿主缺少 pi-ai 适配器。更新后只有界面刷新、Host 未重启时,可能仍在运行旧版本。
84
67
 
85
68
  ## 额度与缓存
86
69
 
@@ -88,28 +71,10 @@ grok-4.6
88
71
 
89
72
  输入框徽章仅在当前 provider 为 `grok-build` 且用量读取成功时显示,悬停或点击查看每周余量与重置时间。缺失数据不是额度为零;读取失败不会编造百分比,也不会因为单独的额度读取故障阻止聊天。
90
73
 
91
- 前缀缓存方面,插件为同一 DSH 会话保持稳定的 `prompt_cache_key` 和工具顺序,内置回退适配器保留 `reasoning.encrypted_content`。这些是请求构造措施,不保证服务端缓存命中或节省额度;项目不提供虚构的命中率。实现见 [adapter.js](../src/adapter.js)。
92
-
93
- ## Headless 使用
94
-
95
- 先在同一主机上完成 Grok CLI 订阅登录,并验证 Web 中可正常使用。然后把插件安装到目标 Headless profile:
96
-
97
- ```sh
98
- dsh plugin --profile headless add dsh-grok-subscription@latest
99
- ```
100
-
101
- 确认该 profile 的模型配置确实选择了 `grok-build` 下你有权使用的模型,再执行一次性交互任务:
102
-
103
- ```sh
104
- dsh --profile headless "只回复:ok"
105
- ```
106
-
107
- 这条任务命令会发起真实模型调用并使用所选服务的额度;它不是离线检查。Web 中选择模型,不应被当作另一个 profile 已正确配置的证明。
74
+ 前缀缓存方面,插件为同一 DSH 会话固定同一个 `prompt_cache_key`(`grok:<sessionId>`),并在请求里显式写入,工具顺序保持稳定。压缩、会话标题这类辅助请求与会话共用同一个 key,而不是另开一个——对代理实测下来,隔离它们并不会提高聊天前缀的缓存命中。这些是请求构造措施,不保证服务端缓存命中或节省额度;项目不提供虚构的命中率。实现见 [adapter.js](../src/adapter.js)。
108
75
 
109
76
  ## 故障排查
110
77
 
111
- **找不到 `dsh`。** 使用你运行 DSH 时的完整 `npx` 前缀,或检查已安装启动器的命令路径。
112
-
113
78
  **找不到 `grok` / 不弹出登录窗口。** 检查 CLI 是否安装在 DSH Host、`DSH_GROK_BIN` / `PATH` 是否对该进程可见,以及面板是否已显示可点击授权链接。浏览器没有弹出,不一定等于授权服务不可达。Windows 上若 CLI 不在 `PATH` 中,可把 `grok.exe` 的绝对路径写入用户级 `DSH_GROK_BIN`(例如 `setx DSH_GROK_BIN "C:\Users\<用户>\.grok\bin\grok.exe"`),再完全重启 DSH;注意 `DSH_*` 是 DSH 的 bootstrap 前缀,写进 `~/.dsh/.env` 会让该环境层直接报错。
114
79
 
115
80
  **`fetch failed` / `Billing request timed out`。** 分别检查账号服务和 `cli-chat-proxy.grok.com` 的网络连接。需要代理时,在 DSH 启动环境或 `~/.dsh/.env` 中设置标准 `https_proxy` / `http_proxy`,而不是放进项目目录的 `.env`;再手动重启 DSH。插件沿用宿主网络配置,不提供单独代理服务。网络只是可能原因,还应检查认证和服务端错误。
@@ -118,28 +83,30 @@ dsh --profile headless "只回复:ok"
118
83
 
119
84
  **聊天或用量返回 `401`。** 检查 CLI 会话是否有效。自动续期失败时,重新运行 `grok login`,完成授权后再次拉取。不要反复粘贴旧 token。
120
85
 
121
- **图片被拒绝。** 对照图片支持列表,检查「运行通路」的附件能力,并在更新后完整重启 Host,再刷新网页。
86
+ **图片被拒绝。** 对照图片支持列表,确认设置页「运行通路」显示**官方 pi-ai** 且附件能力可用,并在更新后完整重启桌面应用。
122
87
 
123
88
  **文件权限错误。** 检查 auth 文件的真实路径、所有者、是否为符号链接以及权限;`chmod 600` 仅解决权限位问题。
124
89
 
125
90
  **旧版本发消息无回复。** `1.0.0` 存在已在 `1.0.1` 修正的工具调用序列化问题;旧版本也可能缺少后续续期修复。先更新到当前发布版,再定位仍然存在的问题,不要把所有无回复都归因于旧缺陷。
126
91
 
127
- **DSH 更新后插件从设置页消失。** 0.2.0 起,插件的 `@deepseek-ai/dsh*` peer 范围若不包含当前运行版本,DSH 会在加载任何插件代码之前丢掉整个 bundle:既没有 `grok-build` 路由,也没有设置分区,界面里没有任何提示。Host 自己的 stderr 会输出 `skipping profile bundle "dsh-grok-subscription"`,`dsh --profile web --dump-config` 里也不会出现 `grok-subscription` 行。此时应更新插件,而不是授予版本豁免——豁免会重新启用一个从未针对该 Host 验证过的构建。
92
+ **DSH 更新后插件从设置页消失。** 0.2.0 起,插件的 `@deepseek-ai/dsh*` peer 范围若不包含当前运行版本,DSH 会在加载任何插件代码之前丢掉整个 bundle:既没有 `grok-build` 路由,也没有设置分区,界面里没有任何提示。Host 自己的 stderr 会输出 `skipping profile bundle "dsh-grok-subscription"`(桌面版不允许通过 `dsh --profile desktop --dump-config` 检查,以这行日志为准)。此时应更新插件,而不是授予版本豁免——豁免会重新启用一个从未针对该 Host 验证过的构建。
93
+
94
+ **「运行通路」显示不可用。** 说明宿主缺少 pi-ai 适配器:`@earendil-works/pi-ai` 或 `@deepseek-ai/dsh-llm-pi-ai` 无法从 DSH 安装目录解析。确认 DSH 安装完整、没有手工裁剪 `node_modules`,然后完全重启桌面应用。
128
95
 
129
96
  ## 更新与登出
130
97
 
131
- npm 安装可在设置页更新,或运行 `dsh plugin --profile web add dsh-grok-subscription@latest`。GitHub 来源安装可运行 `dsh plugin --profile web update dsh-grok-subscription`。本地链接安装则拉取对应 checkout、测试并构建。更新后手动重启 DSH。
98
+ **更新:** 在 **设置 → 插件** 的安装框里重新填入 `dsh-grok-subscription`(或 `dsh-grok-subscription@版本`)安装即可覆盖;插件自己的设置页也有版本卡片与「更新插件」按钮。完成后**完全退出并重启桌面应用**。
132
99
 
133
- 桌面版的 `desktop` profile 由 Electron 应用独占,`dsh plugin --profile desktop …` 会被直接拒绝(`profile "desktop" is managed exclusively by the Electron application`),所以桌面版只能由插件自己更新。1.1.1 起「更新插件」会在该 profile 目录中用 DSH 自带的 pnpm 安装精确版本;若你仍停留在旧版本且按钮报错,可在终端手动执行(pnpm 需 ≥ 11):
100
+ 桌面版的 `desktop` profile 由 Electron 应用独占,`dsh plugin --profile desktop …` 会被直接拒绝(`profile "desktop" is managed exclusively by the Electron application`),因此桌面版的更新由插件在该 profile 目录中用 DSH 自带的 pnpm 安装精确版本。1.1.1 之前插件自己的按钮在桌面版必然失败;界面安装失败时也可以在终端手动执行(pnpm 需 ≥ 11):
134
101
 
135
102
  ```sh
136
103
  cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
137
- pnpm add --save-exact dsh-grok-subscription@1.1.3
104
+ pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.0
138
105
  ```
139
106
 
140
107
  然后完全退出并重启桌面版。更新成功后该 profile 的 `package.json` 里依赖应变为目标版本,`dsh.profile.bundles` 条目保持不变。仅刷新网页不够:Host 未重启时仍会加载旧版本。
141
108
 
142
- 卸载使用 `dsh plugin --profile web remove dsh-grok-subscription`。这不删除整个 profile、其他插件或 Grok CLI 的 `auth.json`。
109
+ **卸载:** 在 **设置 → 插件** 里移除 `dsh-grok-subscription`,或在该 profile 目录执行 `pnpm remove dsh-grok-subscription`。这不删除整个 profile、其他插件或 Grok CLI 的 `auth.json`。
143
110
 
144
111
  设置页「登出」清理的是插件侧会话状态,不等于撤销官方 CLI 会话。CLI 文件仍然存在时,之后重新拉取或启动可能再次同步登录;彻底结束官方会话应使用官方 CLI / 账号提供的登出与授权管理流程。不要靠删除整个 DSH profile 来处理一个账号。
145
112
 
package/lib/client.js CHANGED
@@ -39,7 +39,7 @@ var import_react2 = require("react");
39
39
  var zh = {
40
40
  nav: "Grok \u8BA2\u9605",
41
41
  title: "Grok \u8BA2\u9605",
42
- subtitle: "\u7528 SuperGrok / X Premium\uFF08Grok Build\uFF09\u4F1A\u8BDD\uFF0C\u800C\u4E0D\u662F XAI_API_KEY\u3002\xB7 1.1.3",
42
+ subtitle: "\u7528 SuperGrok / X Premium\uFF08Grok Build\uFF09\u4F1A\u8BDD\uFF0C\u800C\u4E0D\u662F XAI_API_KEY\u3002\xB7 2.0.0",
43
43
  signedIn: "\u5DF2\u767B\u5F55",
44
44
  signedOut: "\u672A\u767B\u5F55",
45
45
  account: "\u8D26\u6237",
@@ -66,11 +66,12 @@ var zh = {
66
66
  renderError: "\u754C\u9762\u6E32\u67D3\u5931\u8D25",
67
67
  diagnostics: "\u8FD0\u884C\u901A\u8DEF",
68
68
  adapterPiAi: "\u5B98\u65B9 pi-ai",
69
- adapterFallback: "\u5185\u7F6E\u56DE\u9000",
69
+ adapterUnavailable: "\u4E0D\u53EF\u7528",
70
+ adapterStarting: "\u542F\u52A8\u4E2D",
70
71
  imageInput: "\u56FE\u7247\u8F93\u5165",
71
72
  imageInputOn: "\u53EF\u7528",
72
73
  imageInputOff: "\u4E0D\u53EF\u7528\uFF08\u672A\u89E3\u6790\u5230\u5BBF\u4E3B\u9644\u4EF6\u670D\u52A1\uFF09",
73
- adapterHint: "\u82E5\u663E\u793A\u300C\u5185\u7F6E\u56DE\u9000\u300D\u4E14\u8D34\u56FE\u88AB\u62D2\uFF0C\u8BF7\u91CD\u542F dsh web \u8BA9\u65B0\u7248\u4E3B\u673A\u7AEF\u751F\u6548\u3002",
74
+ adapterHint: "\u82E5\u663E\u793A\u300C\u4E0D\u53EF\u7528\u300D\uFF0C\u8BF4\u660E\u5BBF\u4E3B\u7F3A\u5C11 pi-ai \u9002\u914D\u5668\uFF1B\u8BF7\u786E\u8BA4 DSH \u5B89\u88C5\u5B8C\u6574\u540E\u91CD\u542F\u3002",
74
75
  busy: "\u5904\u7406\u4E2D\u2026",
75
76
  busyCatalog: "\u6B63\u5728\u5237\u65B0\u6A21\u578B\u76EE\u5F55\u2026",
76
77
  busyUsage: "\u6B63\u5728\u5237\u65B0\u7528\u91CF\u2026",
@@ -119,7 +120,7 @@ var zh = {
119
120
  var en = {
120
121
  nav: "Grok Subscription",
121
122
  title: "Grok Subscription",
122
- subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 1.1.3",
123
+ subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 2.0.0",
123
124
  signedIn: "Signed in",
124
125
  signedOut: "Signed out",
125
126
  account: "Account",
@@ -146,11 +147,12 @@ var en = {
146
147
  renderError: "Failed to render this panel",
147
148
  diagnostics: "Active path",
148
149
  adapterPiAi: "official pi-ai",
149
- adapterFallback: "bundled fallback",
150
+ adapterUnavailable: "unavailable",
151
+ adapterStarting: "starting",
150
152
  imageInput: "Image input",
151
153
  imageInputOn: "available",
152
154
  imageInputOff: "unavailable (host attachment service not resolved)",
153
- adapterHint: 'If this says "bundled fallback" and images are rejected, restart dsh web so the new host bundle loads.',
155
+ adapterHint: 'If this says "unavailable", the host has no pi-ai adapter; check the DSH installation and restart.',
154
156
  busy: "Working\u2026",
155
157
  busyCatalog: "Refreshing model catalog\u2026",
156
158
  busyUsage: "Refreshing usage\u2026",
@@ -725,12 +727,18 @@ function Chip({ tone = "off", children }) {
725
727
  children
726
728
  ] });
727
729
  }
730
+ var ADAPTER_LABELS = {
731
+ "pi-ai": "adapterPiAi",
732
+ unavailable: "adapterUnavailable",
733
+ starting: "adapterStarting"
734
+ };
728
735
  function DiagnosticsRows({ diagnostics, t }) {
729
736
  if (!diagnostics) return null;
737
+ const adapterKey = ADAPTER_LABELS[diagnostics.adapter];
730
738
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "gsRows", children: [
731
739
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "gsRow", children: [
732
740
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("diagnostics") }),
733
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "gsRowValue", children: diagnostics.adapter === "pi-ai" ? t("adapterPiAi") : t("adapterFallback") })
741
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: "gsRowValue", children: adapterKey ? t(adapterKey) : diagnostics.adapter })
734
742
  ] }),
735
743
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "gsRow", children: [
736
744
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: t("imageInput") }),