@wonderwhy-er/desktop-commander 0.1.28 → 0.1.30
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 +11 -1
- package/dist/tools/mime-types.d.ts +2 -0
- package/dist/tools/mime-types.js +27 -0
- package/dist/utils.js +10 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -46,6 +46,15 @@ async function getNpmVersion() {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
const getVersion = async () => {
|
|
50
|
+
try {
|
|
51
|
+
const packageJson = await import('./package.json', { assert: { type: 'json' } });
|
|
52
|
+
return packageJson.default.version;
|
|
53
|
+
} catch {
|
|
54
|
+
return 'unknown'
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
49
58
|
// Function to detect shell environment
|
|
50
59
|
function detectShell() {
|
|
51
60
|
// Check for Windows shells
|
|
@@ -115,7 +124,7 @@ async function getTrackingProperties(additionalProps = {}) {
|
|
|
115
124
|
}
|
|
116
125
|
|
|
117
126
|
const context = getExecutionContext();
|
|
118
|
-
|
|
127
|
+
const version = await getVersion();
|
|
119
128
|
return {
|
|
120
129
|
platform: platform(),
|
|
121
130
|
nodeVersion: nodeVersion,
|
|
@@ -123,6 +132,7 @@ async function getTrackingProperties(additionalProps = {}) {
|
|
|
123
132
|
executionContext: context.runMethod,
|
|
124
133
|
isCI: context.isCI,
|
|
125
134
|
shell: context.shell,
|
|
135
|
+
DCVersion: version,
|
|
126
136
|
timestamp: new Date().toISOString(),
|
|
127
137
|
...additionalProps
|
|
128
138
|
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// Simple MIME type detection based on file extension
|
|
2
|
+
export function getMimeType(filePath) {
|
|
3
|
+
const extension = filePath.toLowerCase().split('.').pop() || '';
|
|
4
|
+
// Image types
|
|
5
|
+
const imageTypes = {
|
|
6
|
+
'png': 'image/png',
|
|
7
|
+
'jpg': 'image/jpeg',
|
|
8
|
+
'jpeg': 'image/jpeg',
|
|
9
|
+
'gif': 'image/gif',
|
|
10
|
+
'bmp': 'image/bmp',
|
|
11
|
+
'svg': 'image/svg+xml',
|
|
12
|
+
'webp': 'image/webp',
|
|
13
|
+
'ico': 'image/x-icon',
|
|
14
|
+
'tif': 'image/tiff',
|
|
15
|
+
'tiff': 'image/tiff',
|
|
16
|
+
};
|
|
17
|
+
// Text types - consider everything else as text for simplicity
|
|
18
|
+
// Check if the file is an image
|
|
19
|
+
if (extension in imageTypes) {
|
|
20
|
+
return imageTypes[extension];
|
|
21
|
+
}
|
|
22
|
+
// Default to text/plain for all other files
|
|
23
|
+
return 'text/plain';
|
|
24
|
+
}
|
|
25
|
+
export function isImageFile(mimeType) {
|
|
26
|
+
return mimeType.startsWith('image/');
|
|
27
|
+
}
|
package/dist/utils.js
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { platform } from 'os';
|
|
2
|
+
let VERSION = 'unknown';
|
|
3
|
+
try {
|
|
4
|
+
const versionModule = await import('./version.js');
|
|
5
|
+
VERSION = versionModule.VERSION;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
}
|
|
2
9
|
// Set default tracking state
|
|
3
10
|
const isTrackingEnabled = true;
|
|
4
11
|
let uniqueUserId = 'unknown';
|
|
@@ -25,7 +32,7 @@ try {
|
|
|
25
32
|
// Silently fail - we don't want analytics issues to break functionality
|
|
26
33
|
});
|
|
27
34
|
}
|
|
28
|
-
catch
|
|
35
|
+
catch {
|
|
29
36
|
//console.log('Analytics module not available - continuing without tracking');
|
|
30
37
|
}
|
|
31
38
|
export const capture = (event, properties) => {
|
|
@@ -36,14 +43,14 @@ export const capture = (event, properties) => {
|
|
|
36
43
|
properties = properties || {};
|
|
37
44
|
properties.timestamp = new Date().toISOString();
|
|
38
45
|
properties.platform = platform();
|
|
46
|
+
properties.DCVersion = VERSION;
|
|
39
47
|
posthog.capture({
|
|
40
48
|
distinctId: uniqueUserId,
|
|
41
49
|
event,
|
|
42
50
|
properties
|
|
43
51
|
});
|
|
44
52
|
}
|
|
45
|
-
catch
|
|
53
|
+
catch {
|
|
46
54
|
// Silently fail - we don't want analytics issues to break functionality
|
|
47
|
-
console.error('Analytics tracking failed:', error);
|
|
48
55
|
}
|
|
49
56
|
};
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.30";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.
|
|
1
|
+
export const VERSION = '0.1.30';
|