@wonderwhy-er/desktop-commander 0.1.37 → 0.1.38
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 +1 -1
- package/dist/index.js +1 -2
- package/dist/setup-claude-server.js +14 -15
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -297,7 +297,7 @@ This project extends the MCP Filesystem Server to enable:
|
|
|
297
297
|
Created as part of exploring Claude MCPs: https://youtube.com/live/TlbjFDbl5Us
|
|
298
298
|
|
|
299
299
|
## DONE
|
|
300
|
-
- **29-04-2025 Telemetry Opt Out
|
|
300
|
+
- **29-04-2025 Telemetry Opt Out trought configuration** - There is now setting to disable telemetry in config, ask in chat
|
|
301
301
|
- **23-04-2025 Enhanced edit functionality** - Improved format, added fuzzy search and multi-occurrence replacements, should fail less and use edit block more often
|
|
302
302
|
- **16-04-2025 Better configurations** - Improved settings for allowed paths, commands and shell environments
|
|
303
303
|
- **14-04-2025 Windows environment fixes** - Resolved issues specific to Windows platforms
|
package/dist/index.js
CHANGED
|
@@ -45,13 +45,12 @@ async function runSetup() {
|
|
|
45
45
|
}
|
|
46
46
|
async function runServer() {
|
|
47
47
|
try {
|
|
48
|
-
const transport = new FilteredStdioServerTransport();
|
|
49
|
-
console.log("start");
|
|
50
48
|
// Check if first argument is "setup"
|
|
51
49
|
if (process.argv[2] === 'setup') {
|
|
52
50
|
await runSetup();
|
|
53
51
|
return;
|
|
54
52
|
}
|
|
53
|
+
const transport = new FilteredStdioServerTransport();
|
|
55
54
|
// Handle uncaught exceptions
|
|
56
55
|
process.on('uncaughtException', async (error) => {
|
|
57
56
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
@@ -243,8 +243,6 @@ async function trackEvent(eventName, additionalProps = {}) {
|
|
|
243
243
|
|
|
244
244
|
} catch (error) {
|
|
245
245
|
lastError = error;
|
|
246
|
-
logToFile(`Error tracking event ${eventName} (attempt ${attempt}/${maxRetries + 1}): ${error}`, true);
|
|
247
|
-
|
|
248
246
|
if (attempt <= maxRetries) {
|
|
249
247
|
// Wait before retry (exponential backoff)
|
|
250
248
|
await new Promise(resolve => setTimeout(resolve, 1000 * attempt));
|
|
@@ -261,7 +259,6 @@ async function trackEvent(eventName, additionalProps = {}) {
|
|
|
261
259
|
async function ensureTrackingCompleted(eventName, additionalProps = {}, timeoutMs = 6000) {
|
|
262
260
|
return new Promise(async (resolve) => {
|
|
263
261
|
const timeoutId = setTimeout(() => {
|
|
264
|
-
logToFile(`Tracking timeout for ${eventName}`, true);
|
|
265
262
|
resolve(false);
|
|
266
263
|
}, timeoutMs);
|
|
267
264
|
|
|
@@ -271,7 +268,6 @@ async function ensureTrackingCompleted(eventName, additionalProps = {}, timeoutM
|
|
|
271
268
|
resolve(true);
|
|
272
269
|
} catch (error) {
|
|
273
270
|
clearTimeout(timeoutId);
|
|
274
|
-
logToFile(`Failed to complete tracking for ${eventName}: ${error}`, true);
|
|
275
271
|
resolve(false);
|
|
276
272
|
}
|
|
277
273
|
});
|
|
@@ -309,15 +305,17 @@ function logToFile(message, isError = false) {
|
|
|
309
305
|
|
|
310
306
|
// Setup global error handlers
|
|
311
307
|
process.on('uncaughtException', async (error) => {
|
|
312
|
-
logToFile(`Uncaught exception: ${error.stack || error.message}`, true);
|
|
313
308
|
await trackEvent('npx_setup_uncaught_exception', { error: error.message });
|
|
314
|
-
|
|
309
|
+
setTimeout(() => {
|
|
310
|
+
process.exit(1);
|
|
311
|
+
}, 1000);
|
|
315
312
|
});
|
|
316
313
|
|
|
317
314
|
process.on('unhandledRejection', async (reason, promise) => {
|
|
318
|
-
logToFile(`Unhandled rejection at: ${promise}, reason: ${reason}`, true);
|
|
319
315
|
await trackEvent('npx_setup_unhandled_rejection', { error: String(reason) });
|
|
320
|
-
|
|
316
|
+
setTimeout(() => {
|
|
317
|
+
process.exit(1);
|
|
318
|
+
}, 1000);
|
|
321
319
|
});
|
|
322
320
|
|
|
323
321
|
// Track when the process is about to exi
|
|
@@ -325,8 +323,6 @@ let isExiting = false;
|
|
|
325
323
|
process.on('exit', () => {
|
|
326
324
|
if (!isExiting) {
|
|
327
325
|
isExiting = true;
|
|
328
|
-
// Synchronous tracking for exit handler
|
|
329
|
-
logToFile('Process is exiting. Some tracking events may not be sent.');
|
|
330
326
|
}
|
|
331
327
|
});
|
|
332
328
|
|
|
@@ -403,7 +399,6 @@ try {
|
|
|
403
399
|
updateSetupStep(machineIdInitStep, 'fallback', error);
|
|
404
400
|
}
|
|
405
401
|
} catch (error) {
|
|
406
|
-
logToFile(`Error initializing user ID: ${error}`, true);
|
|
407
402
|
addSetupStep('initialize_machine_id', 'failed', error);
|
|
408
403
|
}
|
|
409
404
|
|
|
@@ -479,14 +474,15 @@ async function restartClaude() {
|
|
|
479
474
|
} else if (platform === "darwin") {
|
|
480
475
|
await execAsync(`open -a "Claude"`);
|
|
481
476
|
updateSetupStep(startStep, 'completed');
|
|
477
|
+
logToFile(`Claude has been restarted.`);
|
|
482
478
|
await trackEvent('npx_setup_start_claude_success', { platform });
|
|
483
479
|
} else if (platform === "linux") {
|
|
484
480
|
await execAsync(`claude`);
|
|
481
|
+
logToFile(`Claude has been restarted.`);
|
|
485
482
|
updateSetupStep(startStep, 'completed');
|
|
486
483
|
await trackEvent('npx_setup_start_claude_success', { platform });
|
|
487
484
|
}
|
|
488
485
|
|
|
489
|
-
logToFile(`Claude has been restarted.`);
|
|
490
486
|
updateSetupStep(restartStep, 'completed');
|
|
491
487
|
await trackEvent('npx_setup_restart_claude_success', { platform });
|
|
492
488
|
} catch (startError) {
|
|
@@ -684,7 +680,6 @@ export default async function setup() {
|
|
|
684
680
|
|
|
685
681
|
// Check if the old "desktopCommander" exists and remove i
|
|
686
682
|
if (config.mcpServers.desktopCommander) {
|
|
687
|
-
logToFile('Found old "desktopCommander" installation. Removing it...');
|
|
688
683
|
delete config.mcpServers.desktopCommander;
|
|
689
684
|
await trackEvent('npx_setup_remove_old_config');
|
|
690
685
|
}
|
|
@@ -743,7 +738,9 @@ export default async function setup() {
|
|
|
743
738
|
if (process.argv.length >= 2 && process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
744
739
|
setup().then(success => {
|
|
745
740
|
if (!success) {
|
|
746
|
-
|
|
741
|
+
setTimeout(() => {
|
|
742
|
+
process.exit(1);
|
|
743
|
+
}, 1000);
|
|
747
744
|
}
|
|
748
745
|
}).catch(async error => {
|
|
749
746
|
await ensureTrackingCompleted('npx_setup_fatal_error', {
|
|
@@ -751,6 +748,8 @@ if (process.argv.length >= 2 && process.argv[1] === fileURLToPath(import.meta.ur
|
|
|
751
748
|
error_stack: error.stack
|
|
752
749
|
});
|
|
753
750
|
logToFile(`Fatal error: ${error}`, true);
|
|
754
|
-
|
|
751
|
+
setTimeout(() => {
|
|
752
|
+
process.exit(1);
|
|
753
|
+
}, 1000);
|
|
755
754
|
});
|
|
756
755
|
}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.38";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.38';
|