@wonderwhy-er/desktop-commander 0.2.18-alpha.1 → 0.2.18-alpha.3
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 +45 -19
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -208,31 +208,57 @@ 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
|
-
|
|
211
|
+
// Strategy: We want to preserve the tag/version the user used
|
|
212
|
+
// - If user ran: npx @pkg@latest → keep @latest
|
|
213
|
+
// - If user ran: npx @pkg@alpha → keep @alpha
|
|
214
|
+
// - If user ran: npx @pkg@0.2.18-alpha.1 → keep @0.2.18-alpha.1
|
|
214
215
|
|
|
215
|
-
//
|
|
216
|
-
|
|
216
|
+
// Check npm_config_user_agent which contains the original command
|
|
217
|
+
// Example: "npm/10.2.4 node/v20.11.0 darwin arm64 workspaces/false"
|
|
218
|
+
const userAgent = process.env.npm_config_user_agent || '';
|
|
219
|
+
const execPath = process.env.npm_execpath || '';
|
|
217
220
|
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
221
|
+
// Check if there's a version/tag in the npx cache path
|
|
222
|
+
// npx caches packages like: ~/.npm/_npx/<hash>/node_modules/@wonderwhy-er/desktop-commander
|
|
223
|
+
const scriptPath = import.meta.url;
|
|
224
|
+
|
|
225
|
+
// Look for @version in the path (npx cache includes it sometimes)
|
|
226
|
+
const versionMatch = scriptPath.match(/@wonderwhy-er\/desktop-commander@([^\/]+)/);
|
|
227
|
+
if (versionMatch) {
|
|
228
|
+
const spec = `@wonderwhy-er/desktop-commander@${versionMatch[1]}`;
|
|
229
|
+
console.log('[DEBUG] Detected version from path:', spec);
|
|
230
|
+
return spec;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// Read package.json to get the actual installed version
|
|
234
|
+
try {
|
|
235
|
+
const packageJsonPath = join(__dirname, 'package.json');
|
|
236
|
+
if (existsSync(packageJsonPath)) {
|
|
237
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
|
|
238
|
+
const version = packageJson.version;
|
|
239
|
+
|
|
240
|
+
if (version) {
|
|
241
|
+
// Check if version looks like a pre-release (alpha, beta, rc)
|
|
242
|
+
if (version.includes('alpha') || version.includes('beta') || version.includes('rc')) {
|
|
243
|
+
// User explicitly installed a pre-release version, keep it
|
|
244
|
+
const spec = `@wonderwhy-er/desktop-commander@${version}`;
|
|
245
|
+
console.log('[DEBUG] Using pre-release version:', spec);
|
|
246
|
+
return spec;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// For stable versions, assume user wants @latest
|
|
250
|
+
console.log('[DEBUG] Stable version detected, using @latest');
|
|
251
|
+
return '@wonderwhy-er/desktop-commander@latest';
|
|
227
252
|
}
|
|
228
253
|
}
|
|
254
|
+
} catch (error) {
|
|
255
|
+
console.log('[DEBUG] Could not read package.json:', error.message);
|
|
229
256
|
}
|
|
230
257
|
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
const spec = `${npmPackage}@${npmVersion}`;
|
|
258
|
+
// Fallback to @latest
|
|
259
|
+
console.log('[DEBUG] Falling back to @latest');
|
|
260
|
+
return '@wonderwhy-er/desktop-commander@latest';
|
|
261
|
+
}
|
|
236
262
|
console.log('[DEBUG] Found package spec from npm env:', spec);
|
|
237
263
|
return spec;
|
|
238
264
|
}
|
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.3";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.18-alpha.
|
|
1
|
+
export const VERSION = '0.2.18-alpha.3';
|
package/package.json
CHANGED