dsh-mcp 1.14.1 → 1.14.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.en.md CHANGED
@@ -12,6 +12,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - **Supported DSH version**: **dsh `0.2.0-rc.2`** — the latest release is developed and verified on `0.2.0-rc.2` (declared in `package.json` → `dsh.supported`); older entries state the version verified at their time. When the DSH and plugin versions do not match, the Settings page reports a diagnosis (check whether the bundle is selected → restart `dsh web` → hard-refresh → upgrade both sides).
13
13
  - **Release convention**: every version entry states `- **Supported DSH version**: dsh <version>`, mirrored in the GitHub Release notes. The release body is written in **Chinese** (matching [CHANGELOG.md](CHANGELOG.md)), with heading levels mirroring the entry.
14
14
 
15
+ ## [1.14.2] - 2026-10-29
16
+
17
+ - **Supported DSH version**: **dsh `0.2.0-rc.2`**
18
+
19
+ ### Fixed
20
+
21
+ - **Windows OAuth authorization page never opens ([#16](https://github.com/ArvinQi/dsh-mcp/issues/16))**: `openBrowser` used to run `spawn("start", [url])` on Windows, but `start` is a `cmd.exe` builtin rather than an executable, so spawning it without a shell only ever produced `ENOENT` — and `child.on("error", () => {})` swallowed that error. The result was that on Windows the authorization page never opened and nothing was reported (both call sites in `lib/oauth.js`, `oauthStart` and `allowBrowserOnMount`, were affected). It now uses `rundll32.exe url.dll,FileProtocolHandler`, passing the authorization URL as **one untouched argument** with no shell involved, so `&` in the query string cannot split the command — which also avoids the command-injection surface of handing the URL back to a shell via `cmd /c start "" <url>`. The macOS (`open`) / Linux (`xdg-open`) openers and the best-effort semantics (error callback, `detached`, `unref`) are unchanged (PR [#17](https://github.com/ArvinQi/dsh-mcp/pull/17), thanks [@Nyarlathoteppppp](https://github.com/Nyarlathoteppppp))
22
+
23
+ ### Notes
24
+
25
+ - New zero-dependency module `lib/browser-command.js`: `browserCommand(url, platform)` returns the "command + argument array" per platform, lifting "which program opens the URL" out of `openBrowser` so it can be asserted
26
+ - New `test/oauth-browser.test.mjs`: asserts that on win32 an authorization URL containing `&` is handed to `rundll32.exe url.dll,FileProtocolHandler` as a single argument, and that the darwin / linux commands are unchanged; the test does not need the DSH module closure, so it also runs in CI's `npm test` (unlike `oauth-flow.test.mjs`, which is skipped there)
27
+ - Only the host-side way of opening the browser changed: the client bundle `lib/client.js` and every Remote interface are untouched, so no rebuild is needed after upgrading
28
+
15
29
  ## [1.14.1] - 2026-10-20
16
30
 
17
31
  - **Supported DSH version**: **dsh `0.2.0-rc.2`**
package/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@
12
12
  - **支持版本**:**dsh `0.2.0-rc.2`** —— 最新版本在 `0.2.0-rc.2` 上开发与验证(`package.json` → `dsh.supported` 同步声明);历史版本条目各自声明当时验证的版本。DSH 与插件版本不匹配时,设置页会给出排查诊断(核对 bundle 是否已选中 → 重启 `dsh web` → 硬刷新 → 同步升级)。
13
13
  - **发版约定**:每个版本条目都要声明 `- **支持版本**:dsh <版本>`,并在 GitHub Release notes 中同步。Release 正文用**中文**(与本文档一致),标题层级与条目一致。
14
14
 
15
+ ## [1.14.2] - 2026-10-29
16
+
17
+ - **支持版本**:**dsh `0.2.0-rc.2`**
18
+
19
+ ### 修复
20
+
21
+ - **Windows OAuth 授权页无法打开([#16](https://github.com/ArvinQi/dsh-mcp/issues/16))**:此前 `openBrowser` 在 Windows 上执行 `spawn("start", [url])`,而 `start` 是 `cmd.exe` 的内置命令、并非可执行文件,不经过 shell 启动只会得到 `ENOENT`,该错误又被 `child.on("error", () => {})` 静默吞掉,于是 Windows 上发起 OAuth 授权时浏览器根本不打开、也没有任何提示(`lib/oauth.js` 里 `oauthStart` 与 `allowBrowserOnMount` 两处调用都受影响)。现改用 `rundll32.exe url.dll,FileProtocolHandler`,授权 URL 作为**单个原样参数**传递、不经过 shell,因此查询参数中的 `&` 不会被拆成命令;同时也避免了 `cmd /c start "" <url>` 那种把 URL 重新交给 shell 解析带来的命令注入面。macOS(`open`)/ Linux(`xdg-open`)的打开方式与「尽力打开」(错误回调、`detached`、`unref`)语义均保持不变(PR [#17](https://github.com/ArvinQi/dsh-mcp/pull/17),感谢 [@Nyarlathoteppppp](https://github.com/Nyarlathoteppppp))
22
+
23
+ ### 说明
24
+
25
+ - 新增零依赖模块 `lib/browser-command.js`:`browserCommand(url, platform)` 按平台返回「命令 + 参数数组」,把「用哪个程序打开」从 `openBrowser` 里剥出来以便断言
26
+ - 新增 `test/oauth-browser.test.mjs`:断言 win32 下含 `&` 的授权 URL 作为单个参数交给 `rundll32.exe url.dll,FileProtocolHandler`,且 darwin / linux 的启动命令保持不变;该测试不依赖 DSH 模块闭包,因此在 CI 的 `npm test` 中也会执行(不会像 `oauth-flow.test.mjs` 那样被跳过)
27
+ - 本次只改变宿主侧打开浏览器的方式:客户端包 `lib/client.js` 与所有 Remote 接口未变,升级后无需重新构建产物
28
+
15
29
  ## [1.14.1] - 2026-10-20
16
30
 
17
31
  - **支持版本**:**dsh `0.2.0-rc.2`**
package/README.en.md CHANGED
@@ -101,6 +101,7 @@ dsh-mcp/
101
101
  │ ├── patch-writer.js managed-block writer: disables a declaration on takeover (backup/atomic/idempotent)
102
102
  │ ├── mcp-client.js vendored MCP client (from @deepseek-ai/dsh-mcp-client, with tool-list stability extension)
103
103
  │ ├── oauth.js MCP OAuth client provider (authorization-code + PKCE, loopback callback, token persistence)
104
+ │ ├── browser-command.js per-platform browser opener: rundll32 on Windows, URL never through a shell (1.14.2)
104
105
  │ ├── system-ca.js system CA trust: merges the OS roots into Node's default store (1.14.0)
105
106
  │ ├── probe.js vendored connection probe (from mcp-client/src/probe.ts)
106
107
  │ ├── transport.js vendored transport factory (from mcp-client/src/transport.ts)
package/README.md CHANGED
@@ -107,6 +107,7 @@ dsh-mcp/
107
107
  │ ├── patch-writer.js 受管块写入器:接管时在 patch 文件里停用声明行(备份/原子/幂等)
108
108
  │ ├── mcp-client.js vendored MCP 客户端(源自 @deepseek-ai/dsh-mcp-client,含工具列表稳定扩展)
109
109
  │ ├── oauth.js MCP OAuth 客户端提供者(授权码 + PKCE、回环回调、token 持久化)
110
+ │ ├── browser-command.js 按平台选择浏览器打开命令:Windows 走 rundll32,URL 不经过 shell(1.14.2)
110
111
  │ ├── system-ca.js 系统证书信任:把操作系统根证书并入 Node 默认库(1.14.0)
111
112
  │ ├── probe.js vendored 连接探测(源自 mcp-client/src/probe.ts)
112
113
  │ ├── transport.js vendored 传输工厂(源自 mcp-client/src/transport.ts)
@@ -0,0 +1,5 @@
1
+ /** Choose a browser opener without passing the URL through a shell. */
2
+ export function browserCommand(url, platform = process.platform) {
3
+ if (platform === "win32") return ["rundll32.exe", ["url.dll,FileProtocolHandler", url]];
4
+ return [platform === "darwin" ? "open" : "xdg-open", [url]];
5
+ }
package/lib/oauth.js CHANGED
@@ -21,6 +21,7 @@ import {
21
21
  startAuthorization,
22
22
  } from "@modelcontextprotocol/client";
23
23
  import { credentialRef } from "@deepseek-ai/dsh-credentials";
24
+ import { browserCommand } from "./browser-command.js";
24
25
  import { hostText } from "./host-locales.js";
25
26
  import { systemFetch } from "./system-ca.js";
26
27
 
@@ -93,11 +94,8 @@ export function oauthCredentialRefs(serverId) {
93
94
 
94
95
  /** Open the system browser to one URL, best effort. */
95
96
  function openBrowser(url) {
96
- const command =
97
- process.platform === "darwin" ? "open"
98
- : process.platform === "win32" ? "start"
99
- : "xdg-open";
100
- const child = spawn(command, [url], { detached: true, stdio: "ignore" });
97
+ const [command, args] = browserCommand(url);
98
+ const child = spawn(command, args, { detached: true, stdio: "ignore" });
101
99
  child.on("error", () => {});
102
100
  child.unref();
103
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mcp",
3
- "version": "1.14.1",
3
+ "version": "1.14.2",
4
4
  "description": "MCP 管理界面 + tool search:可视化配置/启停/刷新 MCP 服务器与工具勾选,按需检索(tool search)热注入;工具列表稳定命中缓存、不撑爆上下文。DeepSeek Harness plugin: MCP management UI + tool search — stable tool list, cache-friendly, no context bloat.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",