dsh-grok-subscription 1.1.1 → 1.1.2
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 +7 -0
- package/docs/guide.en.md +4 -4
- package/docs/guide.zh-CN.md +4 -4
- package/lib/client.js +2 -2
- package/lib/index.js +29 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.2 — 2026-09-28
|
|
4
|
+
|
|
5
|
+
- Fix **Windows reporting "no grok CLI"** with the official CLI installed. Detection probed for a file literally named `grok`, but `fs.existsSync` never applies Windows' `PATHEXT` resolution, so the installed `grok.exe` was invisible: `resolveGrokBin()` fell back to the bare name, `grokCliAvailable()` returned `false`, and every CLI-backed path — session pull, CLI/device-code login, automatic renewal — was short-circuited before it ran. Settings showed the orange "CLI not found" warning and the plugin stayed on its built-in fallback adapter, even though `spawn("grok")` itself works on Windows.
|
|
6
|
+
- Probe every name the platform would run. The Windows branch now tries the `PATHEXT` suffixes (defaulting to `.COM;.EXE;.BAT;.CMD` when `PATHEXT` is absent) for an explicit `DSH_GROK_BIN` path, for the `${GROK_HOME:-%USERPROFILE%\.grok}\bin\grok` install, and for every `PATH` entry, and it reads quoted entries such as `"C:\Program Files\…"`. Resolution and execution agree, because the existing `grok.exe` found by the probe is the path that gets spawned.
|
|
7
|
+
- Make the platform injectable in both helpers so the Windows branch runs on any CI OS. `tests/cli-detection.test.mjs` adds 13 cases — the two requested by the report, `PATHEXT` handling, quoted `PATH`, and a real-temp-directory `grok.exe` smoke test — and asserts unchanged POSIX behaviour.
|
|
8
|
+
- No session, login, renewal, model-routing, proxy, or quota behaviour changes. A repository-wide sweep of the remaining `existsSync`/`spawn` path joins found no other defect of this class. Restart DSH fully after updating.
|
|
9
|
+
|
|
3
10
|
## 1.1.1 — 2026-09-28
|
|
4
11
|
|
|
5
12
|
- Fix **Update plugin** failing in the desktop app. The update built its command from `process.argv[1]`, which is the entry script of whichever process loaded the plugin — the `dsh` CLI only when the host *is* the CLI. The desktop app loads plugins inside `@deepseek-ai/dsh-desktop-host`, so that argument was the desktop host entry and the update relaunched the application with `plugin …` as script arguments instead of installing anything. The version check kept working, so the update button appeared to run and then reported failure.
|
package/docs/guide.en.md
CHANGED
|
@@ -18,7 +18,7 @@ dsh plugin --profile web list dsh-grok-subscription --depth 0
|
|
|
18
18
|
For reproducibility, pin a published version, for example:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
dsh plugin --profile web add dsh-grok-subscription@1.1.
|
|
21
|
+
dsh plugin --profile web add dsh-grok-subscription@1.1.2
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**Install from GitHub:**
|
|
@@ -40,7 +40,7 @@ Restart the target DSH instance after installation. For local diagnosis, `dsh --
|
|
|
40
40
|
|
|
41
41
|
## Sign-in and credentials
|
|
42
42
|
|
|
43
|
-
**The official Grok Build CLI must be available on the DSH Host**, not just on the phone or another computer viewing the Web UI. The plugin checks `DSH_GROK_BIN`, then `${GROK_HOME:-$HOME/.grok}/bin/grok`, then `grok` on `PATH`. See [session.js](../src/session.js).
|
|
43
|
+
**The official Grok Build CLI must be available on the DSH Host**, not just on the phone or another computer viewing the Web UI. The plugin checks `DSH_GROK_BIN`, then `${GROK_HOME:-$HOME/.grok}/bin/grok`, then `grok` on `PATH`. On Windows the `PATHEXT` suffixes (`.exe`, `.cmd`, …) are completed too, so a `grok.exe` install is recognised. See [session.js](../src/session.js).
|
|
44
44
|
|
|
45
45
|
Use **CLI login** or **Device-code login** in Settings. The plugin invokes the official CLI and shows the available authorization link and one-time code in the panel. Alternatively, run this locally:
|
|
46
46
|
|
|
@@ -110,7 +110,7 @@ That task makes a real model request and uses the selected service's quota; it i
|
|
|
110
110
|
|
|
111
111
|
**`dsh` not found.** Use the full `npx` prefix you use to launch DSH, or check the installed launcher's path.
|
|
112
112
|
|
|
113
|
-
**`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.
|
|
113
|
+
**`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
114
|
|
|
115
115
|
**`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.
|
|
116
116
|
|
|
@@ -132,7 +132,7 @@ In the desktop app the `desktop` profile is owned exclusively by the Electron ap
|
|
|
132
132
|
|
|
133
133
|
```sh
|
|
134
134
|
cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
135
|
-
pnpm add --save-exact dsh-grok-subscription@1.1.
|
|
135
|
+
pnpm add --save-exact dsh-grok-subscription@1.1.2
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
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
|
@@ -18,7 +18,7 @@ dsh plugin --profile web list dsh-grok-subscription --depth 0
|
|
|
18
18
|
需要可重复安装时,固定已发布版本,例如:
|
|
19
19
|
|
|
20
20
|
```sh
|
|
21
|
-
dsh plugin --profile web add dsh-grok-subscription@1.1.
|
|
21
|
+
dsh plugin --profile web add dsh-grok-subscription@1.1.2
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
**GitHub 来源安装:**
|
|
@@ -40,7 +40,7 @@ npx -y @deepseek-ai/dsh@0.1.5-rc.2 plugin --profile web list dsh-grok-subscripti
|
|
|
40
40
|
|
|
41
41
|
## 登录与凭据
|
|
42
42
|
|
|
43
|
-
**官方 Grok Build CLI 必须在 DSH Host 上可用**,不是只安装在访问网页的手机或另一台电脑上。插件按以下顺序寻找命令:`DSH_GROK_BIN` 指定的路径、`${GROK_HOME:-$HOME/.grok}/bin/grok`、系统 `PATH` 中的 `grok
|
|
43
|
+
**官方 Grok Build CLI 必须在 DSH Host 上可用**,不是只安装在访问网页的手机或另一台电脑上。插件按以下顺序寻找命令:`DSH_GROK_BIN` 指定的路径、`${GROK_HOME:-$HOME/.grok}/bin/grok`、系统 `PATH` 中的 `grok`。Windows 上按 `PATHEXT` 补全后缀(`.exe`、`.cmd` 等),所以安装成 `grok.exe` 也能识别。实现见 [session.js](../src/session.js)。
|
|
44
44
|
|
|
45
45
|
可在设置页发起 **CLI 登录** 或 **设备码登录**;插件会调用官方 CLI,并将可用的授权链接和一次性验证码显示在面板中。也可以自行在本机运行:
|
|
46
46
|
|
|
@@ -110,7 +110,7 @@ dsh --profile headless "只回复:ok"
|
|
|
110
110
|
|
|
111
111
|
**找不到 `dsh`。** 使用你运行 DSH 时的完整 `npx` 前缀,或检查已安装启动器的命令路径。
|
|
112
112
|
|
|
113
|
-
**找不到 `grok` / 不弹出登录窗口。** 检查 CLI 是否安装在 DSH Host、`DSH_GROK_BIN` / `PATH` 是否对该进程可见,以及面板是否已显示可点击授权链接。浏览器没有弹出,不一定等于授权服务不可达。
|
|
113
|
+
**找不到 `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
114
|
|
|
115
115
|
**`fetch failed` / `Billing request timed out`。** 分别检查账号服务和 `cli-chat-proxy.grok.com` 的网络连接。需要代理时,在 DSH 启动环境或 `~/.dsh/.env` 中设置标准 `https_proxy` / `http_proxy`,而不是放进项目目录的 `.env`;再手动重启 DSH。插件沿用宿主网络配置,不提供单独代理服务。网络只是可能原因,还应检查认证和服务端错误。
|
|
116
116
|
|
|
@@ -132,7 +132,7 @@ npm 安装可在设置页更新,或运行 `dsh plugin --profile web add dsh-gr
|
|
|
132
132
|
|
|
133
133
|
```sh
|
|
134
134
|
cd "$HOME/.dsh/profiles/desktop" # Windows: cd "$env:USERPROFILE\.dsh\profiles\desktop"
|
|
135
|
-
pnpm add --save-exact dsh-grok-subscription@1.1.
|
|
135
|
+
pnpm add --save-exact dsh-grok-subscription@1.1.2
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
然后完全退出并重启桌面版。更新成功后该 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 1.1.
|
|
42
|
+
subtitle: "\u7528 SuperGrok / X Premium\uFF08Grok Build\uFF09\u4F1A\u8BDD\uFF0C\u800C\u4E0D\u662F XAI_API_KEY\u3002\xB7 1.1.2",
|
|
43
43
|
signedIn: "\u5DF2\u767B\u5F55",
|
|
44
44
|
signedOut: "\u672A\u767B\u5F55",
|
|
45
45
|
account: "\u8D26\u6237",
|
|
@@ -119,7 +119,7 @@ var zh = {
|
|
|
119
119
|
var en = {
|
|
120
120
|
nav: "Grok Subscription",
|
|
121
121
|
title: "Grok Subscription",
|
|
122
|
-
subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 1.1.
|
|
122
|
+
subtitle: "Use a SuperGrok / X Premium (Grok Build) session, not XAI_API_KEY. \xB7 1.1.2",
|
|
123
123
|
signedIn: "Signed in",
|
|
124
124
|
signedOut: "Signed out",
|
|
125
125
|
account: "Account",
|
package/lib/index.js
CHANGED
|
@@ -1636,17 +1636,38 @@ async function createGrokBuildAdapter(session, options = {}) {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
|
|
1638
1638
|
// src/session.js
|
|
1639
|
-
|
|
1640
|
-
|
|
1639
|
+
var WINDOWS_EXEC_EXTENSIONS = [".COM", ".EXE", ".BAT", ".CMD"];
|
|
1640
|
+
var hasPathSeparator = (value) => value.includes("/") || value.includes("\\");
|
|
1641
|
+
function executableNames(bin, platform, env) {
|
|
1642
|
+
if (platform !== "win32") return [bin];
|
|
1643
|
+
const declared = String(env.PATHEXT ?? "").split(";").map((part) => part.trim()).filter(Boolean).map((part) => part.startsWith(".") ? part : `.${part}`);
|
|
1644
|
+
const extensions = declared.length > 0 ? declared : WINDOWS_EXEC_EXTENSIONS;
|
|
1645
|
+
return [bin, ...extensions.map((extension) => `${bin}${extension}`)];
|
|
1646
|
+
}
|
|
1647
|
+
function firstExisting(names, exists) {
|
|
1648
|
+
for (const name2 of names) if (exists(name2)) return name2;
|
|
1649
|
+
return void 0;
|
|
1650
|
+
}
|
|
1651
|
+
function pathEntry(dir, platform) {
|
|
1652
|
+
return platform === "win32" && dir.length > 1 && dir.startsWith('"') && dir.endsWith('"') ? dir.slice(1, -1) : dir;
|
|
1653
|
+
}
|
|
1654
|
+
function resolveGrokBin(env = process.env, exists = existsSync3, platform = process.platform) {
|
|
1655
|
+
const override = typeof env.DSH_GROK_BIN === "string" && env.DSH_GROK_BIN.trim() ? env.DSH_GROK_BIN.trim() : void 0;
|
|
1656
|
+
if (override !== void 0) {
|
|
1657
|
+
if (!hasPathSeparator(override)) return override;
|
|
1658
|
+
return firstExisting(executableNames(override, platform, env), exists) ?? override;
|
|
1659
|
+
}
|
|
1641
1660
|
const local = join3(grokHome(env), "bin", "grok");
|
|
1642
|
-
|
|
1661
|
+
const installed = firstExisting(executableNames(local, platform, env), exists);
|
|
1662
|
+
if (installed !== void 0) return installed;
|
|
1643
1663
|
return "grok";
|
|
1644
1664
|
}
|
|
1645
|
-
function grokCliAvailable(env = process.env, exists = existsSync3) {
|
|
1646
|
-
const bin = resolveGrokBin(env, exists);
|
|
1647
|
-
if (
|
|
1648
|
-
const delimiter =
|
|
1649
|
-
|
|
1665
|
+
function grokCliAvailable(env = process.env, exists = existsSync3, platform = process.platform) {
|
|
1666
|
+
const bin = resolveGrokBin(env, exists, platform);
|
|
1667
|
+
if (hasPathSeparator(bin)) return exists(bin);
|
|
1668
|
+
const delimiter = platform === "win32" ? ";" : ":";
|
|
1669
|
+
const names = executableNames(bin, platform, env);
|
|
1670
|
+
return String(env.PATH ?? "").split(delimiter).some((dir) => dir && names.some((name2) => exists(join3(pathEntry(dir, platform), name2))));
|
|
1650
1671
|
}
|
|
1651
1672
|
function openExternal(url, options = {}) {
|
|
1652
1673
|
const spawnFn = options.spawn ?? spawn;
|