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