@wonderwhy-er/desktop-commander 0.3.1-alpha.2 → 0.3.1
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/LICENSE +20 -20
- package/README.md +1152 -1152
- package/dist/bootstrap.js +0 -0
- package/dist/command-manager.js +0 -0
- package/dist/config-field-definitions.js +0 -0
- package/dist/config-manager.js +0 -0
- package/dist/config-recovery.js +0 -0
- package/dist/config.js +0 -0
- package/dist/custom-stdio.js +0 -0
- package/dist/data/onboarding-prompts.json +70 -70
- package/dist/error-handlers.js +0 -0
- package/dist/handlers/filesystem-handlers.js +2 -2
- package/dist/index.js +0 -0
- package/dist/npm-scripts/remote.js +25 -23
- package/dist/remote-device/desktop-commander-integration.d.ts +1 -0
- package/dist/remote-device/device.js +14 -2
- package/dist/remote-device/realtime-health-telemetry.d.ts +35 -0
- package/dist/remote-device/realtime-health-telemetry.js +110 -0
- package/dist/remote-device/remote-channel.d.ts +66 -55
- package/dist/remote-device/remote-channel.js +336 -389
- package/dist/remote-device/rollouts.d.ts +48 -0
- package/dist/remote-device/rollouts.js +105 -0
- package/dist/remote-device/scripts/blocking-offline-update.js +135 -133
- package/dist/search-manager.js +0 -0
- package/dist/server.js +581 -712
- package/dist/setup-claude-server.js +942 -942
- package/dist/terminal-manager.js +0 -0
- package/dist/tools/edit.js +2 -2
- package/dist/tools/fuzzySearch.js +9 -9
- package/dist/tools/improved-process-tools.js +10 -10
- package/dist/tools/pdf/extract-images.js +2 -6
- package/dist/tools/pdf/lib/pdf2md.js +28 -33
- package/dist/tools/pdf/utils.d.ts +10 -0
- package/dist/tools/pdf/utils.js +11 -0
- package/dist/tools/prompts.js +1 -1
- package/dist/tools/schemas.d.ts +0 -10
- package/dist/tools/schemas.js +0 -8
- package/dist/track-installation.js +387 -387
- package/dist/types.js +0 -0
- package/dist/ui/config-editor/config-editor-runtime.js +53 -53
- package/dist/ui/config-editor/index.html +13 -13
- package/dist/ui/config-editor/src/app.js +30 -30
- package/dist/ui/config-editor/src/array-modal.js +32 -32
- package/dist/ui/config-editor/styles.css +586 -586
- package/dist/ui/contracts.d.ts +27 -0
- package/dist/ui/contracts.js +36 -0
- package/dist/ui/file-preview/index.html +16 -16
- package/dist/ui/file-preview/preview-runtime.js +190 -182
- package/dist/ui/file-preview/src/app.js +8 -8
- package/dist/ui/file-preview/src/components/html-renderer.js +4 -2
- package/dist/ui/file-preview/src/document-layout.js +31 -31
- package/dist/ui/file-preview/src/document-outline.js +8 -8
- package/dist/ui/file-preview/src/markdown/conflict-dialog.js +33 -33
- package/dist/ui/file-preview/src/markdown/controller.js +9 -9
- package/dist/ui/file-preview/src/markdown/editor.js +31 -31
- package/dist/ui/file-preview/styles.css +1630 -1630
- package/dist/ui/resources.js +11 -4
- package/dist/uninstall-claude-server.js +745 -745
- package/dist/utils/files/binary.js +4 -4
- package/dist/utils/files/excel.js +3 -3
- package/dist/utils/files/text.d.ts +7 -0
- package/dist/utils/files/text.js +40 -21
- package/dist/utils/system-info.d.ts +1 -0
- package/dist/utils/system-info.js +110 -97
- package/dist/utils/terminal-timestamps.d.ts +2 -0
- package/dist/utils/terminal-timestamps.js +18 -0
- package/dist/utils/usageTracker.d.ts +0 -39
- package/dist/utils/usageTracker.js +16 -176
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/node_modules/@desktop-commander/telemetry-contract/README.md +56 -56
- package/node_modules/@desktop-commander/telemetry-contract/package.json +32 -32
- package/node_modules/@desktop-commander/telemetry-contract/transport.d.ts +38 -38
- package/node_modules/@desktop-commander/telemetry-contract/transport.js +164 -164
- package/package.json +6 -10
- package/vendor/telemetry-contract/README.md +56 -56
- package/vendor/telemetry-contract/package.json +32 -32
- package/vendor/telemetry-contract/transport.d.ts +38 -38
- package/vendor/telemetry-contract/transport.js +164 -164
- package/vendor/telemetry-contract/transport.test.js +39 -39
package/dist/ui/resources.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import fs from 'fs/promises';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
|
-
import { CONFIG_EDITOR_RESOURCE_URI, FILE_PREVIEW_RESOURCE_URI } from './contracts.js';
|
|
7
|
+
import { buildUiContentSecurityPolicy, CONFIG_EDITOR_RESOURCE_URI, FILE_PREVIEW_RESOURCE_URI, UI_FONT_ORIGINS, UI_RESOURCE_CSP } from './contracts.js';
|
|
8
8
|
const UI_RESOURCE_MIME_TYPE = 'text/html;profile=mcp-app';
|
|
9
9
|
export const FILE_PREVIEW_RESOURCE = {
|
|
10
10
|
uri: FILE_PREVIEW_RESOURCE_URI,
|
|
@@ -31,7 +31,9 @@ function replaceOrThrow(source, pattern, replacement, context) {
|
|
|
31
31
|
function inlineTemplateAssets(templateHtml, css, runtime) {
|
|
32
32
|
const safeCss = css.replace(/<\/style/gi, '<\\/style');
|
|
33
33
|
const safeRuntime = runtime.replace(/<\/script/gi, '<\\/script');
|
|
34
|
-
|
|
34
|
+
// First in <head>, so it covers everything the page loads, previews included
|
|
35
|
+
const policyAdded = replaceOrThrow(templateHtml, /<head>/i, `<head><meta http-equiv="Content-Security-Policy" content="${buildUiContentSecurityPolicy(UI_RESOURCE_CSP, UI_FONT_ORIGINS)}">`, '<head> tag');
|
|
36
|
+
const cssInlined = replaceOrThrow(policyAdded, /<link[^>]*href=["']\.\/styles\.css["'][^>]*>/i, `<style>${safeCss}</style>`, 'styles.css link tag');
|
|
35
37
|
const runtimeInlined = replaceOrThrow(cssInlined, /<script[^>]*src=["']\.\/[^"']+["'][^>]*>\s*<\/script>/i, `<script>${safeRuntime}</script>`, 'runtime script tag');
|
|
36
38
|
if (/href=["']\.\/styles\.css["']/i.test(runtimeInlined) ||
|
|
37
39
|
/<script[^>]*src=["']\.\/[^"']+["']/i.test(runtimeInlined)) {
|
|
@@ -53,14 +55,19 @@ export async function getFilePreviewResourceText() {
|
|
|
53
55
|
export async function getConfigEditorResourceText() {
|
|
54
56
|
return readInlinedResourceHtml(DIST_CONFIG_EDITOR_DIR, 'config-editor-runtime.js');
|
|
55
57
|
}
|
|
58
|
+
function getUiResourceMeta() {
|
|
59
|
+
return { ui: { csp: UI_RESOURCE_CSP } };
|
|
60
|
+
}
|
|
56
61
|
const READABLE_UI_RESOURCES = {
|
|
57
62
|
[FILE_PREVIEW_RESOURCE_URI]: {
|
|
58
63
|
mimeType: FILE_PREVIEW_RESOURCE.mimeType,
|
|
59
|
-
getText: getFilePreviewResourceText
|
|
64
|
+
getText: getFilePreviewResourceText,
|
|
65
|
+
getMeta: getUiResourceMeta
|
|
60
66
|
},
|
|
61
67
|
[CONFIG_EDITOR_RESOURCE_URI]: {
|
|
62
68
|
mimeType: CONFIG_EDITOR_RESOURCE.mimeType,
|
|
63
|
-
getText: getConfigEditorResourceText
|
|
69
|
+
getText: getConfigEditorResourceText,
|
|
70
|
+
getMeta: getUiResourceMeta
|
|
64
71
|
}
|
|
65
72
|
};
|
|
66
73
|
export function listUiResources() {
|