@wonderwhy-er/desktop-commander 0.2.22 → 0.2.24
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.md +14 -55
- package/dist/custom-stdio.d.ts +1 -0
- package/dist/custom-stdio.js +19 -0
- package/dist/handlers/filesystem-handlers.d.ts +4 -0
- package/dist/handlers/filesystem-handlers.js +120 -14
- package/dist/handlers/node-handlers.d.ts +6 -0
- package/dist/handlers/node-handlers.js +73 -0
- package/dist/index.js +5 -3
- package/dist/search-manager.d.ts +25 -0
- package/dist/search-manager.js +212 -0
- package/dist/server.js +161 -107
- package/dist/terminal-manager.d.ts +56 -2
- package/dist/terminal-manager.js +169 -13
- package/dist/tools/edit.d.ts +28 -4
- package/dist/tools/edit.js +87 -4
- package/dist/tools/filesystem.d.ts +23 -12
- package/dist/tools/filesystem.js +201 -416
- package/dist/tools/improved-process-tools.d.ts +2 -2
- package/dist/tools/improved-process-tools.js +244 -214
- package/dist/tools/mime-types.d.ts +1 -0
- package/dist/tools/mime-types.js +7 -0
- package/dist/tools/pdf/extract-images.d.ts +34 -0
- package/dist/tools/pdf/extract-images.js +132 -0
- package/dist/tools/pdf/index.d.ts +6 -0
- package/dist/tools/pdf/index.js +3 -0
- package/dist/tools/pdf/lib/pdf2md.d.ts +36 -0
- package/dist/tools/pdf/lib/pdf2md.js +76 -0
- package/dist/tools/pdf/manipulations.d.ts +13 -0
- package/dist/tools/pdf/manipulations.js +96 -0
- package/dist/tools/pdf/markdown.d.ts +7 -0
- package/dist/tools/pdf/markdown.js +37 -0
- package/dist/tools/pdf/utils.d.ts +12 -0
- package/dist/tools/pdf/utils.js +34 -0
- package/dist/tools/prompts.js +0 -10
- package/dist/tools/schemas.d.ts +167 -12
- package/dist/tools/schemas.js +54 -5
- package/dist/types.d.ts +2 -1
- package/dist/utils/feature-flags.js +7 -4
- package/dist/utils/files/base.d.ts +167 -0
- package/dist/utils/files/base.js +5 -0
- package/dist/utils/files/binary.d.ts +21 -0
- package/dist/utils/files/binary.js +65 -0
- package/dist/utils/files/excel.d.ts +24 -0
- package/dist/utils/files/excel.js +416 -0
- package/dist/utils/files/factory.d.ts +40 -0
- package/dist/utils/files/factory.js +101 -0
- package/dist/utils/files/image.d.ts +21 -0
- package/dist/utils/files/image.js +78 -0
- package/dist/utils/files/index.d.ts +10 -0
- package/dist/utils/files/index.js +13 -0
- package/dist/utils/files/pdf.d.ts +32 -0
- package/dist/utils/files/pdf.js +142 -0
- package/dist/utils/files/text.d.ts +63 -0
- package/dist/utils/files/text.js +357 -0
- package/dist/utils/ripgrep-resolver.js +3 -2
- package/dist/utils/system-info.d.ts +5 -0
- package/dist/utils/system-info.js +71 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +14 -3
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import os from 'os';
|
|
2
2
|
import fs from 'fs';
|
|
3
3
|
import path from 'path';
|
|
4
|
+
import { execSync } from 'child_process';
|
|
4
5
|
/**
|
|
5
6
|
* Detect container environment and type
|
|
6
7
|
*/
|
|
@@ -114,17 +115,51 @@ function discoverContainerMounts(isContainer) {
|
|
|
114
115
|
try {
|
|
115
116
|
const mountsContent = fs.readFileSync('/proc/mounts', 'utf8');
|
|
116
117
|
const mountLines = mountsContent.split('\n');
|
|
118
|
+
// System filesystem types that are never user mounts
|
|
119
|
+
const systemFsTypes = new Set([
|
|
120
|
+
'overlay', 'tmpfs', 'proc', 'sysfs', 'devpts', 'cgroup', 'cgroup2',
|
|
121
|
+
'mqueue', 'debugfs', 'securityfs', 'pstore', 'configfs', 'fusectl',
|
|
122
|
+
'hugetlbfs', 'autofs', 'devtmpfs', 'bpf', 'tracefs', 'shm'
|
|
123
|
+
]);
|
|
124
|
+
// Filesystem types that indicate host mounts
|
|
125
|
+
const hostMountFsTypes = new Set(['fakeowner', '9p', 'virtiofs', 'fuse.sshfs']);
|
|
117
126
|
for (const line of mountLines) {
|
|
118
127
|
const parts = line.split(' ');
|
|
119
128
|
if (parts.length >= 4) {
|
|
120
129
|
const device = parts[0];
|
|
121
130
|
const mountPoint = parts[1];
|
|
131
|
+
const fsType = parts[2];
|
|
122
132
|
const options = parts[3];
|
|
123
|
-
//
|
|
124
|
-
|
|
133
|
+
// Skip system mount points
|
|
134
|
+
const isSystemMountPoint = mountPoint === '/' ||
|
|
135
|
+
mountPoint.startsWith('/dev') ||
|
|
136
|
+
mountPoint.startsWith('/sys') ||
|
|
137
|
+
mountPoint.startsWith('/proc') ||
|
|
138
|
+
mountPoint.startsWith('/run') ||
|
|
139
|
+
mountPoint.startsWith('/sbin') ||
|
|
140
|
+
mountPoint === '/etc/resolv.conf' ||
|
|
141
|
+
mountPoint === '/etc/hostname' ||
|
|
142
|
+
mountPoint === '/etc/hosts';
|
|
143
|
+
if (isSystemMountPoint) {
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
// Detect user mounts by:
|
|
147
|
+
// 1. Known host-mount filesystem types (fakeowner, 9p, virtiofs)
|
|
148
|
+
// 2. Device from /run/host_mark/ (docker-mcp-gateway pattern)
|
|
149
|
+
// 3. Non-system filesystem type with user-like mount point
|
|
150
|
+
const isHostMountFs = hostMountFsTypes.has(fsType);
|
|
151
|
+
const isHostMarkDevice = device.startsWith('/run/host_mark/');
|
|
152
|
+
const isNonSystemFs = !systemFsTypes.has(fsType);
|
|
153
|
+
const isUserLikePath = mountPoint.startsWith('/mnt/') ||
|
|
125
154
|
mountPoint.startsWith('/workspace') ||
|
|
126
155
|
mountPoint.startsWith('/data/') ||
|
|
127
|
-
|
|
156
|
+
mountPoint.startsWith('/home/') ||
|
|
157
|
+
mountPoint.startsWith('/Users/') ||
|
|
158
|
+
mountPoint.startsWith('/app/') ||
|
|
159
|
+
mountPoint.startsWith('/project/') ||
|
|
160
|
+
mountPoint.startsWith('/src/') ||
|
|
161
|
+
mountPoint.startsWith('/code/');
|
|
162
|
+
if (isHostMountFs || isHostMarkDevice || (isNonSystemFs && isUserLikePath)) {
|
|
128
163
|
const isReadOnly = options.includes('ro');
|
|
129
164
|
mounts.push({
|
|
130
165
|
hostPath: device,
|
|
@@ -326,6 +361,36 @@ function detectNodeInfo() {
|
|
|
326
361
|
return undefined;
|
|
327
362
|
}
|
|
328
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Detect Python installation and version and put on systeminfo.pythonInfo
|
|
366
|
+
*/
|
|
367
|
+
function detectPythonInfo() {
|
|
368
|
+
// Try python commands in order of preference
|
|
369
|
+
const pythonCommands = process.platform === 'win32'
|
|
370
|
+
? ['python', 'python3', 'py'] // Windows: 'python' is common, 'py' launcher
|
|
371
|
+
: ['python3', 'python']; // Unix: prefer python3
|
|
372
|
+
for (const cmd of pythonCommands) {
|
|
373
|
+
try {
|
|
374
|
+
const version = execSync(`${cmd} --version`, {
|
|
375
|
+
encoding: 'utf8',
|
|
376
|
+
timeout: 5000,
|
|
377
|
+
stdio: ['pipe', 'pipe', 'pipe']
|
|
378
|
+
}).trim();
|
|
379
|
+
// Verify it's Python 3.x
|
|
380
|
+
if (version.includes('Python 3')) {
|
|
381
|
+
return {
|
|
382
|
+
available: true,
|
|
383
|
+
command: cmd,
|
|
384
|
+
version: version.replace('Python ', '')
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
// Command not found or failed, try next
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
return { available: false, command: '' };
|
|
393
|
+
}
|
|
329
394
|
/**
|
|
330
395
|
* Get comprehensive system information for tool prompts
|
|
331
396
|
*/
|
|
@@ -420,6 +485,8 @@ export function getSystemInfo() {
|
|
|
420
485
|
}
|
|
421
486
|
// Detect Node.js installation from current process
|
|
422
487
|
const nodeInfo = detectNodeInfo();
|
|
488
|
+
// Detect Python installation
|
|
489
|
+
const pythonInfo = detectPythonInfo();
|
|
423
490
|
// Get process information
|
|
424
491
|
const processInfo = {
|
|
425
492
|
pid: process.pid,
|
|
@@ -447,6 +514,7 @@ export function getSystemInfo() {
|
|
|
447
514
|
},
|
|
448
515
|
isDXT: !!process.env.MCP_DXT,
|
|
449
516
|
nodeInfo,
|
|
517
|
+
pythonInfo,
|
|
450
518
|
processInfo,
|
|
451
519
|
examplePaths
|
|
452
520
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.24";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.24';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderwhy-er/desktop-commander",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "MCP server for terminal operations and file editing",
|
|
5
5
|
"mcpName": "io.github.wonderwhy-er/desktop-commander",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"testemonials"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"postinstall": "node dist/track-installation.js && node dist/npm-scripts/verify-ripgrep.js ||
|
|
25
|
+
"postinstall": "node dist/track-installation.js && node dist/npm-scripts/verify-ripgrep.js || node -e \"process.exit(0)\"",
|
|
26
26
|
"open-chat": "open -n /Applications/Claude.app",
|
|
27
27
|
"sync-version": "node scripts/sync-version.js",
|
|
28
28
|
"bump": "node scripts/sync-version.js --bump",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"watch": "tsc --watch",
|
|
33
33
|
"start": "node dist/index.js",
|
|
34
34
|
"start:debug": "node --inspect-brk=9229 dist/index.js",
|
|
35
|
-
"setup": "npm install && npm run build && node setup-claude-server.js",
|
|
35
|
+
"setup": "npm install --include=dev && npm run build && node setup-claude-server.js",
|
|
36
36
|
"setup:debug": "npm install && npm run build && node setup-claude-server.js --debug",
|
|
37
37
|
"remove": "npm install && npm run build && node uninstall-claude-server.js",
|
|
38
38
|
"prepare": "npm run build",
|
|
@@ -78,11 +78,22 @@
|
|
|
78
78
|
],
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
|
81
|
+
"@opendocsg/pdf2md": "^0.2.2",
|
|
81
82
|
"@vscode/ripgrep": "^1.15.9",
|
|
82
83
|
"cross-fetch": "^4.1.0",
|
|
83
84
|
"fastest-levenshtein": "^1.0.16",
|
|
85
|
+
"file-type": "^21.1.1",
|
|
84
86
|
"glob": "^10.3.10",
|
|
85
87
|
"isbinaryfile": "^5.0.4",
|
|
88
|
+
"exceljs": "^4.4.0",
|
|
89
|
+
"md-to-pdf": "^5.2.5",
|
|
90
|
+
"pdf-lib": "^1.17.1",
|
|
91
|
+
"remark": "^15.0.1",
|
|
92
|
+
"remark-gfm": "^4.0.1",
|
|
93
|
+
"remark-parse": "^11.0.0",
|
|
94
|
+
"sharp": "^0.34.5",
|
|
95
|
+
"unified": "^11.0.5",
|
|
96
|
+
"unpdf": "^1.4.0",
|
|
86
97
|
"zod": "^3.24.1",
|
|
87
98
|
"zod-to-json-schema": "^3.23.5"
|
|
88
99
|
},
|