dsh-grok-subscription 2.0.2 → 2.0.3
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 +4 -0
- package/README.en.md +2 -2
- package/README.md +2 -2
- package/docs/guide.en.md +3 -3
- package/docs/guide.zh-CN.md +3 -3
- package/lib/client.js +2 -2
- package/lib/index.js +20 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.0.3 — 2026-09-29
|
|
4
|
+
|
|
5
|
+
- Use the **documented context window**, not the 256k value `models-v2` currently returns. The public model table lists `grok-4.7`, `grok-4.6` and `grok-4.5` at 500k, and `grok-4.7` Fast as the same model; only `grok-build-0.1` is 256k. The subscription catalog reports `context_window: 256000` for all four Build models anyway. A model id in that table now keeps the documented window (`grok-4.7-build-fast` included) even when the catalog says otherwise. An id that is not in the table still uses the catalog value, and the static fallback when a window is missing is 500k again.
|
|
6
|
+
|
|
3
7
|
## 2.0.2 — 2026-09-29
|
|
4
8
|
|
|
5
9
|
- Read an omitted weekly percentage as **0% used / 100% remaining**, instead of telling a fresh billing period that the account has no quota number. Right after the 2026-09-28 rollover, `GET /v1/billing?format=credits` returned the unified-billing `config` (`isUnifiedBillingUser`, zero prepaid balance, zero on-demand cap, and a weekly `currentPeriod`) with no `creditUsagePercent`. That omission is proto3 dropping a zero scalar, not a new meter: the same account's `GetGrokCreditsConfig` response on grok.com (HTTP 200, `grpc-status: 0`) carried the same window and also omitted the usage-ratio field. Once usage was non-zero the field came back on the wire, and an explicit number still wins. The zero is adopted only when the period type is weekly or monthly, both bounds parse, the window contains the current time, and no percentage exists on the body or on a product row. Prepaid balance and on-demand cap are still not a percentage. Outside that window the card stays unavailable. An explicit `0` is shown the same way but is not marked as omitted.
|
package/README.en.md
CHANGED
|
@@ -61,13 +61,13 @@ Pick a Grok model your account can use, adjust reasoning effort as needed, and s
|
|
|
61
61
|
<details>
|
|
62
62
|
<summary>Check the version / pin one / fall back when the UI install fails</summary>
|
|
63
63
|
|
|
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.
|
|
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.3`.
|
|
65
65
|
|
|
66
66
|
If the UI install fails (an unusual profile directory, say), the equivalent runs against the desktop profile itself (pnpm ≥ 11):
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
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.
|
|
70
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
71
71
|
```
|
|
72
72
|
|
|
73
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).
|
package/README.md
CHANGED
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
<details>
|
|
62
62
|
<summary>确认版本 / 固定版本 / 界面安装失败时的兜底</summary>
|
|
63
63
|
|
|
64
|
-
**设置 → 插件** 会列出已安装插件与版本,插件自己的 **设置 → Grok 订阅** 页也有版本卡片。要固定版本,在安装框里填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.
|
|
64
|
+
**设置 → 插件** 会列出已安装插件与版本,插件自己的 **设置 → Grok 订阅** 页也有版本卡片。要固定版本,在安装框里填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.3`。
|
|
65
65
|
|
|
66
66
|
界面安装失败时(例如 profile 目录权限异常),可以对桌面版 profile 手动执行等价操作(pnpm ≥ 11):
|
|
67
67
|
|
|
68
68
|
```sh
|
|
69
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.
|
|
70
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
`dsh plugin --profile desktop …` 会被拒绝:桌面版 profile 由 Electron 应用独占。CLI 路径、登录方式与故障排查见 [完整使用指南](docs/guide.zh-CN.md)。
|
package/docs/guide.en.md
CHANGED
|
@@ -8,7 +8,7 @@ For quick setup, see the [README](../README.en.md#install). This guide covers de
|
|
|
8
8
|
|
|
9
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:** 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.
|
|
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.3`.
|
|
12
12
|
|
|
13
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**.
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ If the UI install fails (an unusual profile directory, say), the equivalent runs
|
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
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.
|
|
19
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
`dsh plugin --profile desktop …` is refused: the Electron application owns that profile exclusively.
|
|
@@ -101,7 +101,7 @@ In the desktop app the `desktop` profile is owned exclusively by the Electron ap
|
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
103
|
cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
104
|
-
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.
|
|
104
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
105
105
|
```
|
|
106
106
|
|
|
107
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.
|
package/docs/guide.zh-CN.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
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
|
-
**安装:** 在桌面版打开 **设置 → 插件**,在安装输入框里填入包名 `dsh-grok-subscription` 并安装,然后**完全退出并重启桌面应用**。仅刷新页面不会重新加载 Host 中的适配器。需要可重复安装时,填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.
|
|
11
|
+
**安装:** 在桌面版打开 **设置 → 插件**,在安装输入框里填入包名 `dsh-grok-subscription` 并安装,然后**完全退出并重启桌面应用**。仅刷新页面不会重新加载 Host 中的适配器。需要可重复安装时,填入完整的 `包名@版本`,例如 `dsh-grok-subscription@2.0.3`。
|
|
12
12
|
|
|
13
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 安装目录解析时,插件不会注册任何路由,设置页的「运行通路」显示**不可用**。
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
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.
|
|
19
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
`dsh plugin --profile desktop …` 会被直接拒绝:桌面版 profile 由 Electron 应用独占。
|
|
@@ -101,7 +101,7 @@ grok-4.6
|
|
|
101
101
|
|
|
102
102
|
```sh
|
|
103
103
|
cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
104
|
-
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.
|
|
104
|
+
pnpm add --save-exact --config.minimumReleaseAge=0 dsh-grok-subscription@2.0.3
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
然后完全退出并重启桌面版。更新成功后该 profile 的 `package.json` 里依赖应变为目标版本,`dsh.profile.bundles` 条目保持不变。仅刷新网页不够:Host 未重启时仍会加载旧版本。
|
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 2.0.
|
|
42
|
+
subtitle: "\u7528 SuperGrok / X Premium\uFF08Grok Build\uFF09\u4F1A\u8BDD\uFF0C\u800C\u4E0D\u662F XAI_API_KEY\u3002\xB7 2.0.3",
|
|
43
43
|
signedIn: "\u5DF2\u767B\u5F55",
|
|
44
44
|
signedOut: "\u672A\u767B\u5F55",
|
|
45
45
|
account: "\u8D26\u6237",
|
|
@@ -124,7 +124,7 @@ var zh = {
|
|
|
124
124
|
var en = {
|
|
125
125
|
nav: "Grok Subscription",
|
|
126
126
|
title: "Grok Subscription",
|
|
127
|
-
subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 2.0.
|
|
127
|
+
subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 2.0.3",
|
|
128
128
|
signedIn: "Signed in",
|
|
129
129
|
signedOut: "Signed out",
|
|
130
130
|
account: "Account",
|
package/lib/index.js
CHANGED
|
@@ -323,7 +323,21 @@ async function readResponseJson(response, options = {}) {
|
|
|
323
323
|
|
|
324
324
|
// src/catalog.js
|
|
325
325
|
var REASONING_LEVELS = Object.freeze(["low", "medium", "high", "xhigh"]);
|
|
326
|
-
var
|
|
326
|
+
var DOCUMENTED_CONTEXT_WINDOWS = Object.freeze({
|
|
327
|
+
"grok-4.7": 5e5,
|
|
328
|
+
"grok-4.7-build-fast": 5e5,
|
|
329
|
+
"grok-4.6": 5e5,
|
|
330
|
+
"grok-4.5": 5e5,
|
|
331
|
+
"grok-4.3": 1e6,
|
|
332
|
+
"grok-4.20-0309-reasoning": 1e6,
|
|
333
|
+
"grok-4.20-0309-non-reasoning": 1e6,
|
|
334
|
+
"grok-4.20-multi-agent-0309": 1e6,
|
|
335
|
+
"grok-build-0.1": 256e3
|
|
336
|
+
});
|
|
337
|
+
var FALLBACK_CONTEXT_WINDOW = 5e5;
|
|
338
|
+
function documentedContextWindow(id) {
|
|
339
|
+
return Object.prototype.hasOwnProperty.call(DOCUMENTED_CONTEXT_WINDOWS, id) ? DOCUMENTED_CONTEXT_WINDOWS[id] : void 0;
|
|
340
|
+
}
|
|
327
341
|
function asId(value) {
|
|
328
342
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
329
343
|
}
|
|
@@ -358,11 +372,12 @@ function extractLiveModels(body) {
|
|
|
358
372
|
if (!id || seen.has(id)) continue;
|
|
359
373
|
seen.add(id);
|
|
360
374
|
const object = row && typeof row === "object" ? row : { id };
|
|
375
|
+
const contextWindow = documentedContextWindow(id) ?? contextWindowOf(object) ?? FALLBACK_CONTEXT_WINDOW;
|
|
361
376
|
models.push(Object.freeze({
|
|
362
377
|
id,
|
|
363
378
|
name: displayNameOf(id, object),
|
|
364
|
-
contextWindow
|
|
365
|
-
maxTokens:
|
|
379
|
+
contextWindow,
|
|
380
|
+
maxTokens: contextWindow,
|
|
366
381
|
reasoning: object.reasoning !== false,
|
|
367
382
|
reasoningEfforts: reasoningEffortsOf(object)
|
|
368
383
|
}));
|
|
@@ -373,8 +388,8 @@ function fallbackModels() {
|
|
|
373
388
|
return FALLBACK_MODEL_IDS.map((id) => Object.freeze({
|
|
374
389
|
id,
|
|
375
390
|
name: id === "grok-4.7" ? "Grok 4.7" : id === "grok-4.6" ? "Grok 4.6" : "Grok 4.5",
|
|
376
|
-
contextWindow: FALLBACK_CONTEXT_WINDOW,
|
|
377
|
-
maxTokens: FALLBACK_CONTEXT_WINDOW,
|
|
391
|
+
contextWindow: documentedContextWindow(id) ?? FALLBACK_CONTEXT_WINDOW,
|
|
392
|
+
maxTokens: documentedContextWindow(id) ?? FALLBACK_CONTEXT_WINDOW,
|
|
378
393
|
reasoning: true,
|
|
379
394
|
reasoningEfforts: id === "grok-4.5" ? ["low", "medium", "high"] : ["low", "medium", "high", "xhigh"],
|
|
380
395
|
defaultEffort: "high",
|