@wonderwhy-er/desktop-commander 0.2.18-alpha.6 → 0.2.18-alpha.8
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/dist/setup-claude-server.js +23 -24
- package/dist/setup.log +21 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -208,10 +208,13 @@ function detectShell() {
|
|
|
208
208
|
|
|
209
209
|
// Function to get the package spec that was used to run this script
|
|
210
210
|
function getPackageSpec() {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
// Use stderr for debug output so it's always visible
|
|
212
|
+
const debug = (msg) => process.stderr.write(`${msg}\n`);
|
|
213
|
+
|
|
214
|
+
debug('\n[DEBUG getPackageSpec] Starting detection...');
|
|
215
|
+
debug(`[DEBUG getPackageSpec] process.argv: ${JSON.stringify(process.argv)}`);
|
|
216
|
+
debug(`[DEBUG getPackageSpec] __dirname: ${__dirname}`);
|
|
217
|
+
debug(`[DEBUG getPackageSpec] __filename: ${__filename}`);
|
|
215
218
|
|
|
216
219
|
// Strategy: Check multiple sources to detect the version
|
|
217
220
|
// 1. Check process.argv[1] which contains the actual script path
|
|
@@ -222,52 +225,46 @@ function getPackageSpec() {
|
|
|
222
225
|
// npx extracts packages to: ~/.npm/_npx/<hash>/node_modules/@scope/package-name/
|
|
223
226
|
// The actual script path will contain this structure
|
|
224
227
|
const scriptPath = __dirname;
|
|
225
|
-
|
|
228
|
+
debug('[DEBUG getPackageSpec] Checking script path for version...');
|
|
226
229
|
|
|
227
230
|
// Look for node_modules/@wonderwhy-er/desktop-commander in the path
|
|
228
231
|
// This works because npx extracts to a predictable location
|
|
229
232
|
const nodeModulesMatch = scriptPath.match(/node_modules\/@wonderwhy-er\/desktop-commander/);
|
|
230
233
|
if (nodeModulesMatch) {
|
|
231
|
-
|
|
234
|
+
debug('[DEBUG getPackageSpec] Script is in node_modules, reading package.json...');
|
|
232
235
|
}
|
|
233
236
|
|
|
234
237
|
// Method 2: Read package.json to get the actual installed version
|
|
235
238
|
try {
|
|
236
239
|
const packageJsonPath = join(__dirname, 'package.json');
|
|
237
|
-
|
|
240
|
+
debug(`[DEBUG getPackageSpec] Trying to read: ${packageJsonPath}`);
|
|
238
241
|
|
|
239
242
|
if (existsSync(packageJsonPath)) {
|
|
240
243
|
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
241
244
|
const version = packageJson.version;
|
|
242
|
-
|
|
245
|
+
debug(`[DEBUG getPackageSpec] Found version in package.json: ${version}`);
|
|
243
246
|
|
|
244
247
|
if (version) {
|
|
245
248
|
// Always use the exact version if it's a pre-release
|
|
246
249
|
if (version.includes('alpha') || version.includes('beta') || version.includes('rc')) {
|
|
247
250
|
const spec = `@wonderwhy-er/desktop-commander@${version}`;
|
|
248
|
-
|
|
251
|
+
debug(`[DEBUG getPackageSpec] ✓ Using pre-release version: ${spec}`);
|
|
249
252
|
return spec;
|
|
250
253
|
}
|
|
251
254
|
|
|
252
255
|
// For stable versions, use @latest tag
|
|
253
|
-
|
|
256
|
+
debug('[DEBUG getPackageSpec] ✓ Stable version, using @latest');
|
|
254
257
|
return '@wonderwhy-er/desktop-commander@latest';
|
|
255
258
|
}
|
|
256
259
|
} else {
|
|
257
|
-
|
|
260
|
+
debug('[DEBUG getPackageSpec] ✗ package.json not found');
|
|
258
261
|
}
|
|
259
262
|
} catch (error) {
|
|
260
|
-
|
|
263
|
+
debug(`[DEBUG getPackageSpec] ✗ Error reading package.json: ${error.message}`);
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
// Fallback
|
|
264
|
-
|
|
265
|
-
return '@wonderwhy-er/desktop-commander@latest';
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
console.log('[DEBUG] Falling back to @latest');
|
|
270
|
-
// Fallback to @latest if we can't detect
|
|
267
|
+
debug('[DEBUG getPackageSpec] ⚠ Falling back to @latest');
|
|
271
268
|
return '@wonderwhy-er/desktop-commander@latest';
|
|
272
269
|
}
|
|
273
270
|
|
|
@@ -776,6 +773,8 @@ export default async function setup() {
|
|
|
776
773
|
|
|
777
774
|
// Determine if running through npx or locally
|
|
778
775
|
const isNpx = import.meta.url.includes('node_modules');
|
|
776
|
+
process.stderr.write(`\n[SETUP] import.meta.url: ${import.meta.url}\n`);
|
|
777
|
+
process.stderr.write(`[SETUP] isNpx: ${isNpx}\n`);
|
|
779
778
|
await trackEvent('npx_setup_execution_mode', { isNpx });
|
|
780
779
|
|
|
781
780
|
// Fix Windows path handling for npx execution
|
|
@@ -830,14 +829,14 @@ export default async function setup() {
|
|
|
830
829
|
// Standard configuration without debug
|
|
831
830
|
if (isNpx) {
|
|
832
831
|
const packageSpec = getPackageSpec();
|
|
833
|
-
|
|
832
|
+
process.stderr.write(`\n[SETUP] Creating config with package spec: ${packageSpec}\n`);
|
|
834
833
|
serverConfig = {
|
|
835
834
|
"command": isWindows ? "npx.cmd" : "npx",
|
|
836
835
|
"args": [
|
|
837
836
|
packageSpec
|
|
838
837
|
]
|
|
839
838
|
};
|
|
840
|
-
|
|
839
|
+
process.stderr.write(`[SETUP] serverConfig.args: ${JSON.stringify(serverConfig.args)}\n`);
|
|
841
840
|
await trackEvent('npx_setup_config_standard_npx', { packageSpec });
|
|
842
841
|
} else {
|
|
843
842
|
// For local installation, use absolute path to handle Windows properly
|
|
@@ -875,15 +874,15 @@ export default async function setup() {
|
|
|
875
874
|
// Add or update the terminal server config with the proper name "desktop-commander"
|
|
876
875
|
config.mcpServers["desktop-commander"] = serverConfig;
|
|
877
876
|
|
|
878
|
-
|
|
879
|
-
|
|
877
|
+
process.stderr.write('\n[SETUP] Writing config to Claude:\n');
|
|
878
|
+
process.stderr.write(`[SETUP] desktop-commander args: ${JSON.stringify(config.mcpServers["desktop-commander"].args)}\n`);
|
|
880
879
|
|
|
881
880
|
// Write the updated config back
|
|
882
881
|
writeFileSync(claudeConfigPath, JSON.stringify(config, null, 2), 'utf8');
|
|
883
882
|
|
|
884
883
|
// Verify what was written
|
|
885
884
|
const writtenConfig = JSON.parse(readFileSync(claudeConfigPath, 'utf8'));
|
|
886
|
-
|
|
885
|
+
process.stderr.write(`[SETUP] Verified written args: ${JSON.stringify(writtenConfig.mcpServers["desktop-commander"].args)}\n\n`);
|
|
887
886
|
|
|
888
887
|
updateSetupStep(updateConfigStep, 'completed');
|
|
889
888
|
await trackEvent('npx_setup_update_config');
|
package/dist/setup.log
CHANGED
|
@@ -61,3 +61,24 @@ The server is available as "desktop-commander" in Claude's MCP server list
|
|
|
61
61
|
2025-08-21T15:01:43.932Z - or join our community: https://discord.com/invite/kQ27sNnZr7
|
|
62
62
|
|
|
63
63
|
|
|
64
|
+
2025-10-22T15:22:43.506Z - ✅ Desktop Commander MCP v0.2.18-alpha.6 successfully added to Claude’s configuration.
|
|
65
|
+
2025-10-22T15:22:43.507Z - Configuration location: /Users/fiberta/Library/Application Support/Claude/claude_desktop_config.json
|
|
66
|
+
2025-10-22T15:22:46.639Z -
|
|
67
|
+
✅ Claude has been restarted automatically!
|
|
68
|
+
2025-10-22T15:22:46.664Z -
|
|
69
|
+
✅ Installation successfully completed! Thank you for using Desktop Commander!
|
|
70
|
+
|
|
71
|
+
2025-10-22T15:22:46.664Z -
|
|
72
|
+
The server is available as "desktop-commander" in Claude's MCP server list
|
|
73
|
+
2025-10-22T15:22:46.665Z - Future updates will install automatically — no need to run this setup again.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
2025-10-22T15:22:46.665Z - 🤔 Need help or have feedback? Happy to jump on a quick call:
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
2025-10-22T15:22:46.665Z - https://calendar.app.google/SHMNZN5MJznJWC5A7
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
2025-10-22T15:22:46.665Z - or join our community: https://discord.com/invite/kQ27sNnZr7
|
|
83
|
+
|
|
84
|
+
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.18-alpha.
|
|
1
|
+
export declare const VERSION = "0.2.18-alpha.8";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.18-alpha.
|
|
1
|
+
export const VERSION = '0.2.18-alpha.8';
|
package/package.json
CHANGED