@wonderwhy-er/desktop-commander 0.3.1 → 0.3.2-alpha.3

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 (206) hide show
  1. package/README.md +2 -0
  2. package/dist/bootstrap.js +7 -7
  3. package/dist/bootstrap.js.map +1 -0
  4. package/dist/command-manager.d.ts +98 -1
  5. package/dist/command-manager.js +200 -16
  6. package/dist/command-manager.js.map +1 -0
  7. package/dist/config-field-definitions.js.map +1 -0
  8. package/dist/config-manager.js.map +1 -0
  9. package/dist/config-recovery.js.map +1 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/custom-stdio.js.map +1 -0
  12. package/dist/error-handlers.js.map +1 -0
  13. package/dist/handlers/edit-search-handlers.js.map +1 -0
  14. package/dist/handlers/filesystem-handlers.js.map +1 -0
  15. package/dist/handlers/history-handlers.js.map +1 -0
  16. package/dist/handlers/index.js.map +1 -0
  17. package/dist/handlers/process-handlers.js.map +1 -0
  18. package/dist/handlers/search-answers.js.map +1 -0
  19. package/dist/handlers/search-handlers.js.map +1 -0
  20. package/dist/handlers/terminal-handlers.js.map +1 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/npm-scripts/remote.js +9 -7
  23. package/dist/npm-scripts/remote.js.map +1 -0
  24. package/dist/npm-scripts/setup.js.map +1 -0
  25. package/dist/npm-scripts/uninstall.js.map +1 -0
  26. package/dist/npm-scripts/verify-ripgrep.js.map +1 -0
  27. package/dist/remote-device/desktop-commander-integration.js +3 -1
  28. package/dist/remote-device/desktop-commander-integration.js.map +1 -0
  29. package/dist/remote-device/device-authenticator.js.map +1 -0
  30. package/dist/remote-device/device.d.ts +4 -3
  31. package/dist/remote-device/device.js +120 -33
  32. package/dist/remote-device/device.js.map +1 -0
  33. package/dist/remote-device/diagnostics/device-log.js.map +1 -0
  34. package/dist/remote-device/diagnostics/redact.js +30 -8
  35. package/dist/remote-device/diagnostics/redact.js.map +1 -0
  36. package/dist/remote-device/diagnostics/report.js +32 -14
  37. package/dist/remote-device/diagnostics/report.js.map +1 -0
  38. package/dist/remote-device/diagnostics/upload.d.ts +1 -1
  39. package/dist/remote-device/diagnostics/upload.js +3 -3
  40. package/dist/remote-device/diagnostics/upload.js.map +1 -0
  41. package/dist/remote-device/mqtt/config.d.ts +1 -0
  42. package/dist/remote-device/mqtt/config.js +3 -0
  43. package/dist/remote-device/mqtt/config.js.map +1 -0
  44. package/dist/remote-device/mqtt/mqtt-enrollment.d.ts +15 -0
  45. package/dist/remote-device/mqtt/mqtt-enrollment.js +293 -0
  46. package/dist/remote-device/mqtt/mqtt-enrollment.js.map +1 -0
  47. package/dist/remote-device/mqtt/mqtt-transport.d.ts +45 -0
  48. package/dist/remote-device/mqtt/mqtt-transport.js +276 -0
  49. package/dist/remote-device/mqtt/mqtt-transport.js.map +1 -0
  50. package/dist/remote-device/realtime-health-telemetry.js.map +1 -0
  51. package/dist/remote-device/remote-channel.d.ts +20 -3
  52. package/dist/remote-device/remote-channel.js +185 -21
  53. package/dist/remote-device/remote-channel.js.map +1 -0
  54. package/dist/remote-device/remote-utils.d.ts +3 -0
  55. package/dist/remote-device/remote-utils.js +20 -0
  56. package/dist/remote-device/remote-utils.js.map +1 -0
  57. package/dist/remote-device/rollouts.js.map +1 -0
  58. package/dist/remote-device/transport-telemetry.d.ts +1 -1
  59. package/dist/remote-device/transport-telemetry.js +8 -5
  60. package/dist/remote-device/transport-telemetry.js.map +1 -0
  61. package/dist/search-manager.js.map +1 -0
  62. package/dist/server.js +2 -0
  63. package/dist/server.js.map +1 -0
  64. package/dist/terminal-manager.js +4 -41
  65. package/dist/terminal-manager.js.map +1 -0
  66. package/dist/tools/config.js.map +1 -0
  67. package/dist/tools/edit.js.map +1 -0
  68. package/dist/tools/feedback.js.map +1 -0
  69. package/dist/tools/filesystem.js.map +1 -0
  70. package/dist/tools/fuzzySearch.js.map +1 -0
  71. package/dist/tools/fuzzySearchCore.js.map +1 -0
  72. package/dist/tools/improved-process-tools.d.ts +2 -0
  73. package/dist/tools/improved-process-tools.js +69 -40
  74. package/dist/tools/improved-process-tools.js.map +1 -0
  75. package/dist/tools/mime-types.js.map +1 -0
  76. package/dist/tools/pdf/extract-images.js.map +1 -0
  77. package/dist/tools/pdf/index.js.map +1 -0
  78. package/dist/tools/pdf/lib/pdf2md.js.map +1 -0
  79. package/dist/tools/pdf/manipulations.js.map +1 -0
  80. package/dist/tools/pdf/markdown.d.ts +10 -38
  81. package/dist/tools/pdf/markdown.js +7 -3
  82. package/dist/tools/pdf/markdown.js.map +1 -0
  83. package/dist/tools/pdf/utils.js.map +1 -0
  84. package/dist/tools/process.js +10 -2
  85. package/dist/tools/process.js.map +1 -0
  86. package/dist/tools/prompts.js.map +1 -0
  87. package/dist/tools/schemas.js.map +1 -0
  88. package/dist/tools/usage.js.map +1 -0
  89. package/dist/track-installation.js +2 -2
  90. package/dist/types.js.map +1 -0
  91. package/dist/ui/config-editor/config-editor-runtime.js +61 -80
  92. package/dist/ui/config-editor/src/app.js.map +1 -0
  93. package/dist/ui/config-editor/src/array-modal.js.map +1 -0
  94. package/dist/ui/config-editor/src/main.js.map +1 -0
  95. package/dist/ui/contracts.js.map +1 -0
  96. package/dist/ui/file-preview/preview-runtime.js +215 -226
  97. package/dist/ui/file-preview/shared/preview-file-types.js.map +1 -0
  98. package/dist/ui/file-preview/src/app.js.map +1 -0
  99. package/dist/ui/file-preview/src/components/code-viewer.js.map +1 -0
  100. package/dist/ui/file-preview/src/components/highlighting.js.map +1 -0
  101. package/dist/ui/file-preview/src/components/html-renderer.js.map +1 -0
  102. package/dist/ui/file-preview/src/components/markdown-renderer.js.map +1 -0
  103. package/dist/ui/file-preview/src/directory-controller.js.map +1 -0
  104. package/dist/ui/file-preview/src/document-layout.js.map +1 -0
  105. package/dist/ui/file-preview/src/document-outline.js.map +1 -0
  106. package/dist/ui/file-preview/src/document-workspace.js.map +1 -0
  107. package/dist/ui/file-preview/src/file-type-handlers.js.map +1 -0
  108. package/dist/ui/file-preview/src/host/external-actions.js.map +1 -0
  109. package/dist/ui/file-preview/src/host/selection-context.js.map +1 -0
  110. package/dist/ui/file-preview/src/image-preview.js.map +1 -0
  111. package/dist/ui/file-preview/src/main.js.map +1 -0
  112. package/dist/ui/file-preview/src/markdown/conflict-dialog.js.map +1 -0
  113. package/dist/ui/file-preview/src/markdown/controller.js.map +1 -0
  114. package/dist/ui/file-preview/src/markdown/editor.js.map +1 -0
  115. package/dist/ui/file-preview/src/markdown/linking.js.map +1 -0
  116. package/dist/ui/file-preview/src/markdown/outline.js.map +1 -0
  117. package/dist/ui/file-preview/src/markdown/parser.js.map +1 -0
  118. package/dist/ui/file-preview/src/markdown/preview.js.map +1 -0
  119. package/dist/ui/file-preview/src/markdown/slugify.js.map +1 -0
  120. package/dist/ui/file-preview/src/markdown/utils.js.map +1 -0
  121. package/dist/ui/file-preview/src/model.js.map +1 -0
  122. package/dist/ui/file-preview/src/panel-actions.js.map +1 -0
  123. package/dist/ui/file-preview/src/path-utils.js.map +1 -0
  124. package/dist/ui/file-preview/src/payload-utils.js.map +1 -0
  125. package/dist/ui/file-preview/src/types.js.map +1 -0
  126. package/dist/ui/resources.js.map +1 -0
  127. package/dist/ui/shared/compact-row.js.map +1 -0
  128. package/dist/ui/shared/escape-html.js.map +1 -0
  129. package/dist/ui/shared/host-context.js.map +1 -0
  130. package/dist/ui/shared/tool-bridge.js.map +1 -0
  131. package/dist/ui/shared/tool-shell.js.map +1 -0
  132. package/dist/ui/shared/ui-event-tracker.js.map +1 -0
  133. package/dist/ui/shared/widget-state.js.map +1 -0
  134. package/dist/utils/ab-test.js.map +1 -0
  135. package/dist/utils/atomic-write.js.map +1 -0
  136. package/dist/utils/brace-expansion.d.ts +25 -0
  137. package/dist/utils/brace-expansion.js +171 -0
  138. package/dist/utils/capture.d.ts +9 -3
  139. package/dist/utils/capture.js +29 -7
  140. package/dist/utils/capture.js.map +1 -0
  141. package/dist/utils/cmd-commands.d.ts +3 -0
  142. package/dist/utils/cmd-commands.js +322 -0
  143. package/dist/utils/command-reading.d.ts +78 -0
  144. package/dist/utils/command-reading.js +7 -0
  145. package/dist/utils/command-wrappers.d.ts +45 -0
  146. package/dist/utils/command-wrappers.js +941 -0
  147. package/dist/utils/dockerPrompt.js.map +1 -0
  148. package/dist/utils/exit-process.js.map +1 -0
  149. package/dist/utils/feature-flags.js.map +1 -0
  150. package/dist/utils/files/base.js.map +1 -0
  151. package/dist/utils/files/binary.js.map +1 -0
  152. package/dist/utils/files/docx.js.map +1 -0
  153. package/dist/utils/files/excel.js.map +1 -0
  154. package/dist/utils/files/factory.js.map +1 -0
  155. package/dist/utils/files/image.js.map +1 -0
  156. package/dist/utils/files/index.js.map +1 -0
  157. package/dist/utils/files/pdf.js.map +1 -0
  158. package/dist/utils/files/text.js.map +1 -0
  159. package/dist/utils/fuzzySearchLogger.js.map +1 -0
  160. package/dist/utils/inline-shells.d.ts +64 -0
  161. package/dist/utils/inline-shells.js +290 -0
  162. package/dist/utils/internal-facts.js.map +1 -0
  163. package/dist/utils/lazy-package.js.map +1 -0
  164. package/dist/utils/lineEndingHandler.js.map +1 -0
  165. package/dist/utils/logger.js.map +1 -0
  166. package/dist/utils/mcp-ui-ab-test.js.map +1 -0
  167. package/dist/utils/open-browser.js.map +1 -0
  168. package/dist/utils/posix-commands.d.ts +3 -0
  169. package/dist/utils/posix-commands.js +201 -0
  170. package/dist/utils/powershell-commands.d.ts +60 -0
  171. package/dist/utils/powershell-commands.js +420 -0
  172. package/dist/utils/process-detection.js.map +1 -0
  173. package/dist/utils/process-tree.js +4 -4
  174. package/dist/utils/process-tree.js.map +1 -0
  175. package/dist/utils/rename.js.map +1 -0
  176. package/dist/utils/ripgrep-resolver.js.map +1 -0
  177. package/dist/utils/shell-script-files.d.ts +4 -0
  178. package/dist/utils/shell-script-files.js +121 -0
  179. package/dist/utils/shell.d.ts +47 -0
  180. package/dist/utils/shell.js +119 -0
  181. package/dist/utils/shell.js.map +1 -0
  182. package/dist/utils/system-info.d.ts +2 -0
  183. package/dist/utils/system-info.js +5 -1
  184. package/dist/utils/system-info.js.map +1 -0
  185. package/dist/utils/terminal-timestamps.js.map +1 -0
  186. package/dist/utils/threadpool-size.d.ts +36 -0
  187. package/dist/utils/threadpool-size.js +143 -0
  188. package/dist/utils/toolHistory.js.map +1 -0
  189. package/dist/utils/trackTools.js.map +1 -0
  190. package/dist/utils/unsupportedParams.js.map +1 -0
  191. package/dist/utils/usageTracker.js.map +1 -0
  192. package/dist/utils/welcome-onboarding.js.map +1 -0
  193. package/dist/utils/withTimeout.js.map +1 -0
  194. package/dist/version.d.ts +1 -1
  195. package/dist/version.js +1 -1
  196. package/dist/version.js.map +1 -0
  197. package/package.json +15 -8
  198. package/node_modules/@desktop-commander/telemetry-contract/README.md +0 -56
  199. package/node_modules/@desktop-commander/telemetry-contract/package.json +0 -32
  200. package/node_modules/@desktop-commander/telemetry-contract/transport.d.ts +0 -38
  201. package/node_modules/@desktop-commander/telemetry-contract/transport.js +0 -164
  202. package/vendor/telemetry-contract/README.md +0 -56
  203. package/vendor/telemetry-contract/package.json +0 -32
  204. package/vendor/telemetry-contract/transport.d.ts +0 -38
  205. package/vendor/telemetry-contract/transport.js +0 -164
  206. package/vendor/telemetry-contract/transport.test.js +0 -39
@@ -0,0 +1,78 @@
1
+ /**
2
+ * What the command check finds in a command's text. The check reads each
3
+ * command with a reader for the shell that will run it (POSIX shells,
4
+ * PowerShell, cmd). Every reader returns a CommandReading, and checkCommand()
5
+ * in command-manager.ts turns it into a CommandCheck.
6
+ */
7
+ /** One command the shell would run */
8
+ export interface FoundCommand {
9
+ /**
10
+ * The command's name as the shell reads it, with quotes and escapes removed.
11
+ * In PowerShell it is what the name means there: an alias gives its target
12
+ * (in Windows PowerShell 5.1 "sc" gives "Set-Content"), and a program gives
13
+ * the program's file name. When the name is known only at run time ("$tool"),
14
+ * this is the name as it is written in the text.
15
+ */
16
+ name: string;
17
+ /**
18
+ * The command's words as the shell reads them, starting with the name as
19
+ * written (before PowerShell gives its meaning). A word known only at run
20
+ * time, such as "$CMD" or "$(date)", is null.
21
+ */
22
+ words: (string | null)[];
23
+ /**
24
+ * The same words as they are written in the text, quotes included. The
25
+ * wrapper rules use them: cmd's start takes a first word in quotes as the
26
+ * window title, and a program known only at run time is named as written.
27
+ */
28
+ written: string[];
29
+ /**
30
+ * The same words as the shell reads them, but with each part known only at
31
+ * run time kept as it is written: "sudo $X" gives sudo $X, where `words`
32
+ * has null and `written` keeps the quotes. A shell started with a command
33
+ * text (bash -c "sudo $X") gets such a word as its command, so the check
34
+ * reads it to see the programs it names.
35
+ */
36
+ wordTexts: string[];
37
+ /**
38
+ * PowerShell's Start-Process only: the programs it may start, as this
39
+ * PowerShell binds its FilePath, each with its value (null when known only
40
+ * at run time) and its text as written. A splatted @params may hold
41
+ * FilePath, so it counts as a program known only at run time.
42
+ */
43
+ filePaths?: {
44
+ word: string | null;
45
+ written: string;
46
+ }[];
47
+ /** Where the command starts: an index into the command's text */
48
+ start: number;
49
+ /** True when the name is known only at run time: a variable, or the output of another command */
50
+ nameAtRunTime: boolean;
51
+ }
52
+ /** A function the command's text defines */
53
+ export interface DefinedFunction {
54
+ /** The function's name as written */
55
+ name: string;
56
+ /** Where the definition ends: the index just past its last character */
57
+ end: number;
58
+ }
59
+ /** What a reader found in a command's text */
60
+ export interface CommandReading {
61
+ /** Every command the shell would run, including those nested in others, in the order they start */
62
+ commands: FoundCommand[];
63
+ /**
64
+ * The functions defined by the text's own statements, which stay defined
65
+ * for the rest of the text. A definition inside a subshell, a { } group,
66
+ * another function's body, a pipeline, an if or loop body, after && or ||,
67
+ * or in a PowerShell script block is not listed: it may not exist when a
68
+ * later command runs. Nor is a function the text may remove or hide behind
69
+ * an alias (unset -f halt, Remove-Item function:net, Set-Alias net net.exe),
70
+ * wherever that is written, or one the PowerShell session has an alias of
71
+ * (the user's profile can set one). There are none when the text runs code
72
+ * the reader doesn't read (eval, a file run with ., Invoke-Expression, a
73
+ * method call), which may remove any of them.
74
+ */
75
+ functions: DefinedFunction[];
76
+ /** The parser's message when the text can't be parsed. The two lists are then empty. */
77
+ parseError?: string;
78
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * What the command check finds in a command's text. The check reads each
3
+ * command with a reader for the shell that will run it (POSIX shells,
4
+ * PowerShell, cmd). Every reader returns a CommandReading, and checkCommand()
5
+ * in command-manager.ts turns it into a CommandCheck.
6
+ */
7
+ export {};
@@ -0,0 +1,45 @@
1
+ import type { FoundCommand } from './command-reading.js';
2
+ /**
3
+ * The commands that run in `shell`: each of `commands`, followed by the
4
+ * programs that the wrappers among them start (for env sudo ls: env, then
5
+ * sudo). A started program has its wrapper's start.
6
+ */
7
+ export declare function withStartedPrograms(commands: FoundCommand[], shell: string): FoundCommand[];
8
+ /** Where a program's options end, in each way they can be read, and the command texts and programs they give */
9
+ export interface OptionReadings {
10
+ /** The first word after the options, in each reading: a wrapper's program, or a shell's script file */
11
+ operands: number[];
12
+ /**
13
+ * Each command text an option gives, or for a shell the first word after its options (bash -c 'sudo ls'), with
14
+ * the first word after it. The text is null when it is known only at run time, in whole or in part; `at` is then
15
+ * the word that holds it. It has no `at` when it is in the option's own word (--command='sudo ls'), and `to`
16
+ * when it is the words from `at` up to that one, joined with spaces (watch -n 5 sudo ls)
17
+ */
18
+ texts: {
19
+ text: string | null;
20
+ at?: number;
21
+ to?: number;
22
+ after: number;
23
+ }[];
24
+ /** Each program an option names (start-stop-daemon --exec), null when known only at run time; `at` is its word, unless it is in the option's own */
25
+ programs: {
26
+ program: string | null;
27
+ at?: number;
28
+ }[];
29
+ /** Whether it also runs command texts that aren't among its words, as parallel's from a :::: file (see commandFiles) */
30
+ hidden: boolean;
31
+ }
32
+ /** How a POSIX shell, by its name in POSIX_SHELLS, reads its own options (see BASH_OPTIONS) */
33
+ export declare function shellOptionReadings(program: string, words: (string | null)[]): OptionReadings;
34
+ /**
35
+ * For a program that runs one command text in a shell (see TEXT_PROGRAMS): its
36
+ * options read in every way, and the shell that reads its texts. Undefined for
37
+ * any other program.
38
+ */
39
+ export declare function textProgramReadings(program: string, words: (string | null)[]): {
40
+ readings: OptionReadings;
41
+ shell: string;
42
+ arguments?: number[];
43
+ } | undefined;
44
+ /** For a program that runs one command text in the shell it was started from (see SAME_SHELL_PROGRAMS): its options read in every way */
45
+ export declare function sameShellProgramReadings(program: string, words: (string | null)[]): OptionReadings | undefined;