@wonderwhy-er/desktop-commander 0.3.1-alpha.1 → 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.
Files changed (82) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +1152 -1152
  3. package/dist/bootstrap.js +0 -0
  4. package/dist/command-manager.js +0 -0
  5. package/dist/config-field-definitions.js +0 -0
  6. package/dist/config-manager.js +0 -0
  7. package/dist/config-recovery.js +0 -0
  8. package/dist/config.js +0 -0
  9. package/dist/custom-stdio.js +0 -0
  10. package/dist/data/onboarding-prompts.json +70 -70
  11. package/dist/error-handlers.js +0 -0
  12. package/dist/handlers/filesystem-handlers.js +2 -2
  13. package/dist/index.js +0 -0
  14. package/dist/npm-scripts/remote.js +25 -23
  15. package/dist/remote-device/desktop-commander-integration.d.ts +1 -0
  16. package/dist/remote-device/device.js +14 -2
  17. package/dist/remote-device/realtime-health-telemetry.d.ts +35 -0
  18. package/dist/remote-device/realtime-health-telemetry.js +110 -0
  19. package/dist/remote-device/remote-channel.d.ts +66 -55
  20. package/dist/remote-device/remote-channel.js +336 -389
  21. package/dist/remote-device/rollouts.d.ts +48 -0
  22. package/dist/remote-device/rollouts.js +105 -0
  23. package/dist/remote-device/scripts/blocking-offline-update.js +135 -133
  24. package/dist/search-manager.js +0 -0
  25. package/dist/server.js +581 -712
  26. package/dist/setup-claude-server.js +942 -942
  27. package/dist/terminal-manager.js +0 -0
  28. package/dist/tools/edit.js +2 -2
  29. package/dist/tools/fuzzySearch.js +9 -9
  30. package/dist/tools/improved-process-tools.js +10 -10
  31. package/dist/tools/pdf/extract-images.js +3 -7
  32. package/dist/tools/pdf/lib/pdf2md.js +28 -33
  33. package/dist/tools/pdf/utils.d.ts +10 -0
  34. package/dist/tools/pdf/utils.js +11 -0
  35. package/dist/tools/prompts.js +1 -1
  36. package/dist/tools/schemas.d.ts +0 -10
  37. package/dist/tools/schemas.js +0 -8
  38. package/dist/track-installation.js +387 -387
  39. package/dist/types.js +0 -0
  40. package/dist/ui/config-editor/config-editor-runtime.js +53 -53
  41. package/dist/ui/config-editor/index.html +13 -13
  42. package/dist/ui/config-editor/src/app.js +30 -30
  43. package/dist/ui/config-editor/src/array-modal.js +32 -32
  44. package/dist/ui/config-editor/styles.css +586 -586
  45. package/dist/ui/contracts.d.ts +27 -0
  46. package/dist/ui/contracts.js +36 -0
  47. package/dist/ui/file-preview/index.html +16 -16
  48. package/dist/ui/file-preview/preview-runtime.js +190 -182
  49. package/dist/ui/file-preview/src/app.js +8 -8
  50. package/dist/ui/file-preview/src/components/html-renderer.js +4 -2
  51. package/dist/ui/file-preview/src/document-layout.js +31 -31
  52. package/dist/ui/file-preview/src/document-outline.js +8 -8
  53. package/dist/ui/file-preview/src/markdown/conflict-dialog.js +33 -33
  54. package/dist/ui/file-preview/src/markdown/controller.js +9 -9
  55. package/dist/ui/file-preview/src/markdown/editor.js +31 -31
  56. package/dist/ui/file-preview/styles.css +1630 -1630
  57. package/dist/ui/resources.js +11 -4
  58. package/dist/uninstall-claude-server.js +745 -745
  59. package/dist/utils/files/binary.js +4 -4
  60. package/dist/utils/files/excel.js +3 -3
  61. package/dist/utils/files/text.d.ts +7 -0
  62. package/dist/utils/files/text.js +40 -21
  63. package/dist/utils/lazy-package.d.ts +5 -3
  64. package/dist/utils/lazy-package.js +6 -4
  65. package/dist/utils/system-info.d.ts +1 -0
  66. package/dist/utils/system-info.js +110 -97
  67. package/dist/utils/terminal-timestamps.d.ts +2 -0
  68. package/dist/utils/terminal-timestamps.js +18 -0
  69. package/dist/utils/usageTracker.d.ts +0 -39
  70. package/dist/utils/usageTracker.js +16 -176
  71. package/dist/version.d.ts +1 -1
  72. package/dist/version.js +1 -1
  73. package/node_modules/@desktop-commander/telemetry-contract/README.md +56 -56
  74. package/node_modules/@desktop-commander/telemetry-contract/package.json +32 -32
  75. package/node_modules/@desktop-commander/telemetry-contract/transport.d.ts +38 -38
  76. package/node_modules/@desktop-commander/telemetry-contract/transport.js +164 -164
  77. package/package.json +24 -15
  78. package/vendor/telemetry-contract/README.md +56 -56
  79. package/vendor/telemetry-contract/package.json +32 -32
  80. package/vendor/telemetry-contract/transport.d.ts +38 -38
  81. package/vendor/telemetry-contract/transport.js +164 -164
  82. package/vendor/telemetry-contract/transport.test.js +39 -39
@@ -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
- const cssInlined = replaceOrThrow(templateHtml, /<link[^>]*href=["']\.\/styles\.css["'][^>]*>/i, `<style>${safeCss}</style>`, 'styles.css link tag');
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() {