@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
@@ -3,6 +3,33 @@
3
3
  */
4
4
  export declare const FILE_PREVIEW_RESOURCE_URI = "ui://desktop-commander/file-preview";
5
5
  export declare const CONFIG_EDITOR_RESOURCE_URI = "ui://desktop-commander/config-editor";
6
+ /**
7
+ * A UI resource's `_meta.ui.csp`: the MCP Apps spec's `McpUiResourceCsp`. ext-apps defines it, but re-exports it through
8
+ * paths that Node16 module resolution can't follow, so the shape is repeated here.
9
+ */
10
+ export interface McpUiResourceCsp {
11
+ connectDomains?: string[];
12
+ resourceDomains?: string[];
13
+ frameDomains?: string[];
14
+ baseUriDomains?: string[];
15
+ }
16
+ /**
17
+ * Origins the UI pages may reach. All lists are empty: the pages are self-contained, and an HTML file previewed inside
18
+ * them inherits the policy, so it can't send anything to another origin or load anything from one (fonts from
19
+ * `UI_FONT_ORIGINS` aside).
20
+ */
21
+ export declare const UI_RESOURCE_CSP: McpUiResourceCsp;
22
+ /**
23
+ * Font origins the pages' own policy allows. Claude's apps send their UI font as `@font-face` rules that load from here.
24
+ * Kept out of `UI_RESOURCE_CSP`: its `resourceDomains` would also allow scripts and images from the origin.
25
+ */
26
+ export declare const UI_FONT_ORIGINS: string[];
27
+ /**
28
+ * Content-Security-Policy for a `ui.csp` declaration, built the way the MCP Apps spec tells hosts to, without `'self'` (the
29
+ * pages are inlined, and `'self'` would be the host's origin), with local `blob:` images and media, extra font origins,
30
+ * and form posts blocked. An empty list becomes `'none'`.
31
+ */
32
+ export declare function buildUiContentSecurityPolicy(csp: McpUiResourceCsp, fontOrigins?: string[]): string;
6
33
  export interface UiToolMeta extends Record<string, unknown> {
7
34
  'ui/resourceUri': string;
8
35
  'openai/outputTemplate': string;
@@ -3,6 +3,42 @@
3
3
  */
4
4
  export const FILE_PREVIEW_RESOURCE_URI = 'ui://desktop-commander/file-preview';
5
5
  export const CONFIG_EDITOR_RESOURCE_URI = 'ui://desktop-commander/config-editor';
6
+ /**
7
+ * Origins the UI pages may reach. All lists are empty: the pages are self-contained, and an HTML file previewed inside
8
+ * them inherits the policy, so it can't send anything to another origin or load anything from one (fonts from
9
+ * `UI_FONT_ORIGINS` aside).
10
+ */
11
+ export const UI_RESOURCE_CSP = {
12
+ connectDomains: [],
13
+ resourceDomains: [],
14
+ frameDomains: [],
15
+ baseUriDomains: [],
16
+ };
17
+ /**
18
+ * Font origins the pages' own policy allows. Claude's apps send their UI font as `@font-face` rules that load from here.
19
+ * Kept out of `UI_RESOURCE_CSP`: its `resourceDomains` would also allow scripts and images from the origin.
20
+ */
21
+ export const UI_FONT_ORIGINS = ['https://assets.claude.ai'];
22
+ /**
23
+ * Content-Security-Policy for a `ui.csp` declaration, built the way the MCP Apps spec tells hosts to, without `'self'` (the
24
+ * pages are inlined, and `'self'` would be the host's origin), with local `blob:` images and media, extra font origins,
25
+ * and form posts blocked. An empty list becomes `'none'`.
26
+ */
27
+ export function buildUiContentSecurityPolicy(csp, fontOrigins = []) {
28
+ const sources = (fixed, domains = []) => [...fixed, ...domains].join(' ') || "'none'";
29
+ return [
30
+ "default-src 'none'",
31
+ `script-src ${sources(["'unsafe-inline'"], csp.resourceDomains)}`,
32
+ `style-src ${sources(["'unsafe-inline'"], csp.resourceDomains)}`,
33
+ `img-src ${sources(['data:', 'blob:'], csp.resourceDomains)}`,
34
+ `font-src ${sources(fontOrigins, csp.resourceDomains)}`,
35
+ `media-src ${sources(['data:', 'blob:'], csp.resourceDomains)}`,
36
+ `connect-src ${sources([], csp.connectDomains)}`,
37
+ `frame-src ${sources([], csp.frameDomains)}`,
38
+ `base-uri ${sources([], csp.baseUriDomains)}`,
39
+ "form-action 'none'",
40
+ ].join('; ');
41
+ }
6
42
  export function buildUiToolMeta(resourceUri, widgetAccessible = false, showMcpUiPreviews = true) {
7
43
  if (!showMcpUiPreviews) {
8
44
  return undefined;
@@ -1,16 +1,16 @@
1
- <!doctype html>
2
- <!--
3
- Host page for the File Preview MCP UI. It establishes the root structure and script/style loading required to render text, markdown, and HTML previews safely.
4
- -->
5
- <html lang="en">
6
- <head>
7
- <meta charset="utf-8" />
8
- <meta name="viewport" content="width=device-width, initial-scale=1" />
9
- <title>Desktop Commander File Preview</title>
10
- <link rel="stylesheet" href="./styles.css" />
11
- </head>
12
- <body>
13
- <div id="app"></div>
14
- <script src="./preview-runtime.js"></script>
15
- </body>
16
- </html>
1
+ <!doctype html>
2
+ <!--
3
+ Host page for the File Preview MCP UI. It establishes the root structure and script/style loading required to render text, markdown, and HTML previews safely.
4
+ -->
5
+ <html lang="en">
6
+ <head>
7
+ <meta charset="utf-8" />
8
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
9
+ <title>Desktop Commander File Preview</title>
10
+ <link rel="stylesheet" href="./styles.css" />
11
+ </head>
12
+ <body>
13
+ <div id="app"></div>
14
+ <script src="./preview-runtime.js"></script>
15
+ </body>
16
+ </html>