@xuanling-rs/xuanling-mcp 0.2.5 → 0.2.7

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/README-ZH.md CHANGED
@@ -11,7 +11,7 @@ proposal-first SQLite Memory。
11
11
  启动器要求 Node.js 18.17 或更高版本。
12
12
 
13
13
  ```sh
14
- npm install --global @xuanling-rs/xuanling-mcp@0.2.5
14
+ npm install --global @xuanling-rs/xuanling-mcp@0.2.7
15
15
  xuanling-mcp --version
16
16
  ```
17
17
 
@@ -24,7 +24,7 @@ MCP Client 也可以使用 `npx` 固定版本:
24
24
  "command": "npx",
25
25
  "args": [
26
26
  "-y",
27
- "@xuanling-rs/xuanling-mcp@0.2.5",
27
+ "@xuanling-rs/xuanling-mcp@0.2.7",
28
28
  "--workspace-root",
29
29
  "/absolute/path/to/project",
30
30
  "--tool-profile",
package/README.md CHANGED
@@ -12,7 +12,7 @@ SQLite memory.
12
12
  The launcher requires Node.js 18.17 or newer.
13
13
 
14
14
  ```sh
15
- npm install --global @xuanling-rs/xuanling-mcp@0.2.5
15
+ npm install --global @xuanling-rs/xuanling-mcp@0.2.7
16
16
  xuanling-mcp --version
17
17
  ```
18
18
 
@@ -25,7 +25,7 @@ MCP clients can also pin the version with `npx`:
25
25
  "command": "npx",
26
26
  "args": [
27
27
  "-y",
28
- "@xuanling-rs/xuanling-mcp@0.2.5",
28
+ "@xuanling-rs/xuanling-mcp@0.2.7",
29
29
  "--workspace-root",
30
30
  "/absolute/path/to/project",
31
31
  "--tool-profile",
package/lib/launcher.js CHANGED
@@ -1,6 +1,11 @@
1
1
  import { spawn as nodeSpawn } from "node:child_process";
2
2
  import { createHash } from "node:crypto";
3
- import { existsSync as nodeExistsSync, readFileSync as nodeReadFileSync } from "node:fs";
3
+ import {
4
+ chmodSync as nodeChmodSync,
5
+ existsSync as nodeExistsSync,
6
+ readFileSync as nodeReadFileSync,
7
+ statSync as nodeStatSync,
8
+ } from "node:fs";
4
9
  import { createRequire } from "node:module";
5
10
  import { constants as osConstants } from "node:os";
6
11
  import path from "node:path";
@@ -60,14 +65,41 @@ function exitCodeForSignal(signal) {
60
65
  return typeof number === "number" ? 128 + number : 1;
61
66
  }
62
67
 
68
+ // Plugin-cache transports (ZCode marketplace sync, for example) can strip the
69
+ // executable bit from the payload, which would turn every spawn into EACCES.
70
+ async function ensureExecutable(binaryPath, { chmod, runtime, stat }) {
71
+ if (runtime.platform === "win32") return;
72
+ let info;
73
+ try {
74
+ info = stat(binaryPath);
75
+ } catch {
76
+ // A missing or unreadable binary fails in spawn with its own error.
77
+ return;
78
+ }
79
+ if ((info.mode & 0o111) !== 0) return;
80
+ const mode = info.mode | 0o111;
81
+ try {
82
+ await chmod(binaryPath, mode);
83
+ } catch (error) {
84
+ const message = error instanceof Error ? error.message : String(error);
85
+ throw new Error(
86
+ `Native binary at ${binaryPath} is not executable and the permission could not be restored: ${message}`,
87
+ );
88
+ }
89
+ }
90
+
63
91
  export async function launch({
64
92
  argv = process.argv.slice(2),
65
93
  env = process.env,
66
94
  runtime = process,
67
95
  spawn = nodeSpawn,
96
+ stat = nodeStatSync,
97
+ chmod = nodeChmodSync,
68
98
  target = detectTarget(),
69
99
  binaryPath = resolveNativeBinary(target),
70
100
  } = {}) {
101
+ await ensureExecutable(binaryPath, { chmod, runtime, stat });
102
+
71
103
  const child = spawn(binaryPath, argv, {
72
104
  env,
73
105
  stdio: "inherit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuanling-rs/xuanling-mcp",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Cross-platform stdio MCP server for XuanLing typed filesystem, process, project, artifact, session, and memory tools.",
5
5
  "license": "MIT",
6
6
  "author": "umbrella22 and XuanLing contributors",
@@ -35,9 +35,9 @@
35
35
  "directory": "npm/packages/xuanling-mcp"
36
36
  },
37
37
  "optionalDependencies": {
38
- "xuanling-mcp-darwin-arm64": "npm:@xuanling-rs/xuanling-mcp-darwin-arm64@0.2.5-darwin-arm64",
39
- "xuanling-mcp-linux-x64-gnu": "npm:@xuanling-rs/xuanling-mcp-linux-x64-gnu@0.2.5-linux-x64-gnu",
40
- "xuanling-mcp-win32-x64-msvc": "npm:@xuanling-rs/xuanling-mcp-win32-x64-msvc@0.2.5-win32-x64-msvc"
38
+ "xuanling-mcp-darwin-arm64": "npm:@xuanling-rs/xuanling-mcp-darwin-arm64@0.2.7-darwin-arm64",
39
+ "xuanling-mcp-linux-x64-gnu": "npm:@xuanling-rs/xuanling-mcp-linux-x64-gnu@0.2.7-linux-x64-gnu",
40
+ "xuanling-mcp-win32-x64-msvc": "npm:@xuanling-rs/xuanling-mcp-win32-x64-msvc@0.2.7-win32-x64-msvc"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",
@@ -45,6 +45,6 @@
45
45
  "registry": "https://registry.npmjs.org"
46
46
  },
47
47
  "xuanlingRelease": {
48
- "sourceCommit": "3b5ec0f1addc6ae69ba89cfdac078d45c51a5aef"
48
+ "sourceCommit": "1c27b1746dec23792dafe88a7ef987124b8eae6a"
49
49
  }
50
50
  }