drawio-mcp-server 2.1.0 → 2.2.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.
@@ -0,0 +1,35 @@
1
+ const SEMVER_HEAD = /^(\d+)\.(\d+)\.(\d+)/;
2
+ export function parseVersion(raw) {
3
+ const m = SEMVER_HEAD.exec(raw);
4
+ if (!m)
5
+ return null;
6
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
7
+ }
8
+ export function compareVersion(a, b) {
9
+ for (let i = 0; i < 3; i++) {
10
+ if (a[i] < b[i])
11
+ return -1;
12
+ if (a[i] > b[i])
13
+ return 1;
14
+ }
15
+ return 0;
16
+ }
17
+ export function isBelowFloor(v, floor) {
18
+ const parsed = parseVersion(floor);
19
+ if (!parsed)
20
+ return false;
21
+ return compareVersion(v, parsed) < 0;
22
+ }
23
+ export function isInRange(v, r) {
24
+ const min = parseVersion(r.min);
25
+ if (!min)
26
+ return false;
27
+ if (compareVersion(v, min) < 0)
28
+ return false;
29
+ if (r.maxExclusive === null)
30
+ return true;
31
+ const max = parseVersion(r.maxExclusive);
32
+ if (!max)
33
+ return true;
34
+ return compareVersion(v, max) < 0;
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drawio-mcp-server",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Provides Draw.io services to MCP Clients",
5
5
  "type": "module",
6
6
  "main": "build/index.js",
@@ -34,11 +34,11 @@
34
34
  "@hono/node-server": "1.19.13",
35
35
  "@modelcontextprotocol/sdk": "1.29.0",
36
36
  "cachedir": "2.4.0",
37
- "hono": "4.12.14",
37
+ "hono": "4.12.25",
38
38
  "nanoid": "5.1.6",
39
39
  "node-forge": "1.4.0",
40
40
  "unzipper": "0.12.3",
41
- "ws": "8.18.3",
41
+ "ws": "8.21.0",
42
42
  "zod": "4.2.1"
43
43
  },
44
44
  "devDependencies": {
@@ -60,15 +60,16 @@
60
60
  "ts-jest": "29.4.9",
61
61
  "typescript": "5.9.3",
62
62
  "drawio-mcp-dev-proxy": "1.0.0",
63
- "drawio-mcp-plugin": "2.1.0"
63
+ "drawio-mcp-plugin": "2.2.0"
64
64
  },
65
65
  "scripts": {
66
- "build": "rimraf build && tsc && mkdir -p build/plugin && cp node_modules/drawio-mcp-plugin/dist/mcp-plugin.js build/plugin/mcp-plugin.js",
66
+ "vendor:compat": "rimraf src/vendored/compat && mkdir -p src/vendored/compat && cp ../drawio-mcp-compat/src/index.ts src/vendored/compat/index.ts",
67
+ "build": "pnpm run vendor:compat && rimraf build && tsc && mkdir -p build/plugin && cp node_modules/drawio-mcp-plugin/dist/mcp-plugin.js build/plugin/mcp-plugin.js",
67
68
  "ci": "pnpm install --frozen-lockfile",
68
- "dev": "tsc --watch",
69
- "dev:server": "concurrently --kill-others-on-fail -n tsc,node -c cyan,green \"tsc --watch --preserveWatchOutput\" \"node --watch --watch-path=build build/index.js\"",
69
+ "dev": "pnpm run vendor:compat && tsc --watch",
70
+ "dev:server": "pnpm run vendor:compat && concurrently --kill-others-on-fail -n tsc,node -c cyan,green \"tsc --watch --preserveWatchOutput\" \"node --watch --watch-path=build build/index.js\"",
70
71
  "inspect": "HOST=0.0.0.0 pnpx @modelcontextprotocol/inspector --config ./inspector.json --server drawio",
71
- "lint": "biome check src/ && tsc --noEmit",
72
+ "lint": "pnpm run vendor:compat && biome check src/ && tsc --noEmit",
72
73
  "lint:fix": "biome check --write src/",
73
74
  "prefetch-assets": "node build/prefetch-assets.js",
74
75
  "format": "prettier --write \"**/*.ts\"",