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

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 (162) hide show
  1. package/dist/command-manager.d.ts +4 -4
  2. package/dist/command-manager.js +58 -21
  3. package/dist/ui/config-editor/config-editor-runtime.js +80 -61
  4. package/dist/ui/file-preview/preview-runtime.js +226 -215
  5. package/dist/utils/brace-expansion.d.ts +6 -1
  6. package/dist/utils/brace-expansion.js +33 -12
  7. package/dist/utils/cmd-commands.d.ts +2 -2
  8. package/dist/utils/cmd-commands.js +57 -9
  9. package/dist/utils/command-reading.d.ts +17 -3
  10. package/dist/utils/command-reading.js +8 -1
  11. package/dist/utils/command-wrappers.d.ts +3 -3
  12. package/dist/utils/command-wrappers.js +37 -14
  13. package/dist/utils/inline-shells.d.ts +5 -2
  14. package/dist/utils/inline-shells.js +30 -10
  15. package/dist/utils/posix-commands.d.ts +5 -2
  16. package/dist/utils/posix-commands.js +68 -32
  17. package/dist/utils/posix-shell-capabilities.d.ts +8 -0
  18. package/dist/utils/posix-shell-capabilities.js +120 -0
  19. package/dist/utils/powershell-commands.d.ts +2 -1
  20. package/dist/utils/powershell-commands.js +54 -6
  21. package/dist/utils/shell-script-files.d.ts +5 -1
  22. package/dist/utils/shell-script-files.js +38 -19
  23. package/dist/utils/shell.d.ts +4 -3
  24. package/dist/utils/shell.js +9 -5
  25. package/dist/version.d.ts +1 -1
  26. package/dist/version.js +1 -1
  27. package/package.json +1 -1
  28. package/dist/bootstrap.js.map +0 -1
  29. package/dist/command-manager.js.map +0 -1
  30. package/dist/config-field-definitions.js.map +0 -1
  31. package/dist/config-manager.js.map +0 -1
  32. package/dist/config-recovery.js.map +0 -1
  33. package/dist/config.js.map +0 -1
  34. package/dist/custom-stdio.js.map +0 -1
  35. package/dist/error-handlers.js.map +0 -1
  36. package/dist/handlers/edit-search-handlers.js.map +0 -1
  37. package/dist/handlers/filesystem-handlers.js.map +0 -1
  38. package/dist/handlers/history-handlers.js.map +0 -1
  39. package/dist/handlers/index.js.map +0 -1
  40. package/dist/handlers/process-handlers.js.map +0 -1
  41. package/dist/handlers/search-answers.js.map +0 -1
  42. package/dist/handlers/search-handlers.js.map +0 -1
  43. package/dist/handlers/terminal-handlers.js.map +0 -1
  44. package/dist/index.js.map +0 -1
  45. package/dist/npm-scripts/remote.js.map +0 -1
  46. package/dist/npm-scripts/setup.js.map +0 -1
  47. package/dist/npm-scripts/uninstall.js.map +0 -1
  48. package/dist/npm-scripts/verify-ripgrep.js.map +0 -1
  49. package/dist/remote-device/desktop-commander-integration.js.map +0 -1
  50. package/dist/remote-device/device-authenticator.js.map +0 -1
  51. package/dist/remote-device/device.js.map +0 -1
  52. package/dist/remote-device/diagnostics/device-log.js.map +0 -1
  53. package/dist/remote-device/diagnostics/redact.js.map +0 -1
  54. package/dist/remote-device/diagnostics/report.js.map +0 -1
  55. package/dist/remote-device/diagnostics/upload.js.map +0 -1
  56. package/dist/remote-device/mqtt/config.js.map +0 -1
  57. package/dist/remote-device/mqtt/mqtt-enrollment.js.map +0 -1
  58. package/dist/remote-device/mqtt/mqtt-transport.js.map +0 -1
  59. package/dist/remote-device/realtime-health-telemetry.js.map +0 -1
  60. package/dist/remote-device/remote-channel.js.map +0 -1
  61. package/dist/remote-device/remote-utils.js.map +0 -1
  62. package/dist/remote-device/rollouts.js.map +0 -1
  63. package/dist/remote-device/transport-telemetry.js.map +0 -1
  64. package/dist/search-manager.js.map +0 -1
  65. package/dist/server.js.map +0 -1
  66. package/dist/terminal-manager.js.map +0 -1
  67. package/dist/tools/config.js.map +0 -1
  68. package/dist/tools/edit.js.map +0 -1
  69. package/dist/tools/feedback.js.map +0 -1
  70. package/dist/tools/filesystem.js.map +0 -1
  71. package/dist/tools/fuzzySearch.js.map +0 -1
  72. package/dist/tools/fuzzySearchCore.js.map +0 -1
  73. package/dist/tools/improved-process-tools.js.map +0 -1
  74. package/dist/tools/mime-types.js.map +0 -1
  75. package/dist/tools/pdf/extract-images.js.map +0 -1
  76. package/dist/tools/pdf/index.js.map +0 -1
  77. package/dist/tools/pdf/lib/pdf2md.js.map +0 -1
  78. package/dist/tools/pdf/manipulations.js.map +0 -1
  79. package/dist/tools/pdf/markdown.js.map +0 -1
  80. package/dist/tools/pdf/utils.js.map +0 -1
  81. package/dist/tools/process.js.map +0 -1
  82. package/dist/tools/prompts.js.map +0 -1
  83. package/dist/tools/schemas.js.map +0 -1
  84. package/dist/tools/usage.js.map +0 -1
  85. package/dist/types.js.map +0 -1
  86. package/dist/ui/config-editor/src/app.js.map +0 -1
  87. package/dist/ui/config-editor/src/array-modal.js.map +0 -1
  88. package/dist/ui/config-editor/src/main.js.map +0 -1
  89. package/dist/ui/contracts.js.map +0 -1
  90. package/dist/ui/file-preview/shared/preview-file-types.js.map +0 -1
  91. package/dist/ui/file-preview/src/app.js.map +0 -1
  92. package/dist/ui/file-preview/src/components/code-viewer.js.map +0 -1
  93. package/dist/ui/file-preview/src/components/highlighting.js.map +0 -1
  94. package/dist/ui/file-preview/src/components/html-renderer.js.map +0 -1
  95. package/dist/ui/file-preview/src/components/markdown-renderer.js.map +0 -1
  96. package/dist/ui/file-preview/src/directory-controller.js.map +0 -1
  97. package/dist/ui/file-preview/src/document-layout.js.map +0 -1
  98. package/dist/ui/file-preview/src/document-outline.js.map +0 -1
  99. package/dist/ui/file-preview/src/document-workspace.js.map +0 -1
  100. package/dist/ui/file-preview/src/file-type-handlers.js.map +0 -1
  101. package/dist/ui/file-preview/src/host/external-actions.js.map +0 -1
  102. package/dist/ui/file-preview/src/host/selection-context.js.map +0 -1
  103. package/dist/ui/file-preview/src/image-preview.js.map +0 -1
  104. package/dist/ui/file-preview/src/main.js.map +0 -1
  105. package/dist/ui/file-preview/src/markdown/conflict-dialog.js.map +0 -1
  106. package/dist/ui/file-preview/src/markdown/controller.js.map +0 -1
  107. package/dist/ui/file-preview/src/markdown/editor.js.map +0 -1
  108. package/dist/ui/file-preview/src/markdown/linking.js.map +0 -1
  109. package/dist/ui/file-preview/src/markdown/outline.js.map +0 -1
  110. package/dist/ui/file-preview/src/markdown/parser.js.map +0 -1
  111. package/dist/ui/file-preview/src/markdown/preview.js.map +0 -1
  112. package/dist/ui/file-preview/src/markdown/slugify.js.map +0 -1
  113. package/dist/ui/file-preview/src/markdown/utils.js.map +0 -1
  114. package/dist/ui/file-preview/src/model.js.map +0 -1
  115. package/dist/ui/file-preview/src/panel-actions.js.map +0 -1
  116. package/dist/ui/file-preview/src/path-utils.js.map +0 -1
  117. package/dist/ui/file-preview/src/payload-utils.js.map +0 -1
  118. package/dist/ui/file-preview/src/types.js.map +0 -1
  119. package/dist/ui/resources.js.map +0 -1
  120. package/dist/ui/shared/compact-row.js.map +0 -1
  121. package/dist/ui/shared/escape-html.js.map +0 -1
  122. package/dist/ui/shared/host-context.js.map +0 -1
  123. package/dist/ui/shared/tool-bridge.js.map +0 -1
  124. package/dist/ui/shared/tool-shell.js.map +0 -1
  125. package/dist/ui/shared/ui-event-tracker.js.map +0 -1
  126. package/dist/ui/shared/widget-state.js.map +0 -1
  127. package/dist/utils/ab-test.js.map +0 -1
  128. package/dist/utils/atomic-write.js.map +0 -1
  129. package/dist/utils/capture.js.map +0 -1
  130. package/dist/utils/dockerPrompt.js.map +0 -1
  131. package/dist/utils/exit-process.js.map +0 -1
  132. package/dist/utils/feature-flags.js.map +0 -1
  133. package/dist/utils/files/base.js.map +0 -1
  134. package/dist/utils/files/binary.js.map +0 -1
  135. package/dist/utils/files/docx.js.map +0 -1
  136. package/dist/utils/files/excel.js.map +0 -1
  137. package/dist/utils/files/factory.js.map +0 -1
  138. package/dist/utils/files/image.js.map +0 -1
  139. package/dist/utils/files/index.js.map +0 -1
  140. package/dist/utils/files/pdf.js.map +0 -1
  141. package/dist/utils/files/text.js.map +0 -1
  142. package/dist/utils/fuzzySearchLogger.js.map +0 -1
  143. package/dist/utils/internal-facts.js.map +0 -1
  144. package/dist/utils/lazy-package.js.map +0 -1
  145. package/dist/utils/lineEndingHandler.js.map +0 -1
  146. package/dist/utils/logger.js.map +0 -1
  147. package/dist/utils/mcp-ui-ab-test.js.map +0 -1
  148. package/dist/utils/open-browser.js.map +0 -1
  149. package/dist/utils/process-detection.js.map +0 -1
  150. package/dist/utils/process-tree.js.map +0 -1
  151. package/dist/utils/rename.js.map +0 -1
  152. package/dist/utils/ripgrep-resolver.js.map +0 -1
  153. package/dist/utils/shell.js.map +0 -1
  154. package/dist/utils/system-info.js.map +0 -1
  155. package/dist/utils/terminal-timestamps.js.map +0 -1
  156. package/dist/utils/toolHistory.js.map +0 -1
  157. package/dist/utils/trackTools.js.map +0 -1
  158. package/dist/utils/unsupportedParams.js.map +0 -1
  159. package/dist/utils/usageTracker.js.map +0 -1
  160. package/dist/utils/welcome-onboarding.js.map +0 -1
  161. package/dist/utils/withTimeout.js.map +0 -1
  162. package/dist/version.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { parse, forEachChild } from 'unbash';
2
2
  import { braceWords, quotedChars, unquotedChars, MAX_BRACE_WORDS } from './brace-expansion.js';
3
+ import { posixBraceSemantics } from './posix-shell-capabilities.js';
3
4
  /**
4
5
  * The command check's reader for POSIX shells (bash, zsh, sh, dash, ksh,
5
6
  * fish), with unbash, a bash parser. It finds every command the shell would
@@ -16,8 +17,8 @@ import { braceWords, quotedChars, unquotedChars, MAX_BRACE_WORDS } from './brace
16
17
  * are scripts of their own). Any error anywhere is a parse error here, so the
17
18
  * check never decides on a command it read only in part.
18
19
  */
19
- /** Word parts whose text is taken as written (a glob as its own text, not the files it matches) */
20
- const STATIC_PARTS = new Set(['Literal', 'SingleQuoted', 'AnsiCQuoted', 'Glob']);
20
+ /** Quoted and literal text is known before execution; globs depend on the matching files */
21
+ const STATIC_PARTS = new Set(['Literal', 'SingleQuoted', 'AnsiCQuoted']);
21
22
  /** Word parts that bash drops when they are empty and unquoted ($X, ${X}, $(cmd)) */
22
23
  const VANISHING_PARTS = new Set(['SimpleExpansion', 'ParameterExpansion', 'CommandExpansion']);
23
24
  /** The commands that remove a function: unset -f, and zsh's unfunction, unhash -f and disable -f */
@@ -99,13 +100,44 @@ function partChars(part) {
99
100
  * A brace expansion makes several and bash drops the empty ones: {,sudo} ls
100
101
  * runs sudo, {,} sudo runs sudo, and {$X,sudo} id runs sudo when $X is empty.
101
102
  */
102
- function wordsMade(word) {
103
+ function wordsMade(word, options) {
103
104
  if (!word.parts?.some((part) => part.type === 'BraceExpansion')) {
104
105
  return [{ value: wordValue(word), mayVanish: mayVanish(word) }];
105
106
  }
106
- const made = braceWords(braceChars(word));
107
+ const made = braceWords(braceChars(word), options);
107
108
  return made && made.map((text) => ({ value: text.includes('\0') ? null : text, mayVanish: MAY_VANISH.test(text) }));
108
109
  }
110
+ const BRACE_LIMIT_ERROR = `brace expansion makes more than ${MAX_BRACE_WORDS} words, or takes too long to read`;
111
+ /** Keep inspected words aligned; only a tail after a retained command name may defer a bounded failure. */
112
+ function commandWords(words, options) {
113
+ const expanded = [];
114
+ for (const source of words) {
115
+ const made = wordsMade(source, options);
116
+ if (made === null) {
117
+ if (!expanded.some((word) => !word.mayVanish))
118
+ return null;
119
+ return { words: expanded, argumentError: BRACE_LIMIT_ERROR };
120
+ }
121
+ expanded.push(...made.map((word) => ({ ...word, source })));
122
+ }
123
+ return { words: expanded };
124
+ }
125
+ /** A retained runtime word still ends name selection even when its source was already listed. */
126
+ function commandNames(expanded) {
127
+ const names = [];
128
+ const runtimeSources = new Set();
129
+ for (let index = 0; index < expanded.length; index++) {
130
+ const name = expanded[index];
131
+ if (name.value !== null || !runtimeSources.has(name.source)) {
132
+ names.push({ index, name });
133
+ if (name.value === null)
134
+ runtimeSources.add(name.source);
135
+ }
136
+ if (!name.mayVanish)
137
+ break;
138
+ }
139
+ return names;
140
+ }
109
141
  /** Whether bash may drop the word entirely, so that the next word is the command's name */
110
142
  function mayVanish(word) {
111
143
  const parts = word.parts ?? [];
@@ -136,8 +168,13 @@ function mayRunUnreadCode(command) {
136
168
  const name = words[at];
137
169
  return name === null || (name !== undefined && CODE_RUNNERS.has(name));
138
170
  }
139
- /** Reads a command for a POSIX shell */
140
- export async function readPosixCommands(command) {
171
+ /**
172
+ * The caller supplies its actual selected native endpoint; no endpoint or unsupported capability
173
+ * retains the legacy reading exactly. Capability capture happens on import, not after caller changes.
174
+ */
175
+ export async function readPosixCommands(command, selectedShell) {
176
+ const semantics = selectedShell === undefined ? 'legacy' : await posixBraceSemantics(selectedShell) ?? 'legacy';
177
+ const options = { semantics };
141
178
  const script = parse(command);
142
179
  let parseError;
143
180
  const commands = [];
@@ -148,33 +185,31 @@ export async function readPosixCommands(command) {
148
185
  parseError ?? (parseError = node.errors?.[0]?.message);
149
186
  if (node.type === 'Command' && node.name) {
150
187
  const words = [node.name, ...node.args.filter((arg) => arg.type === 'Word')];
151
- const values = words.map(wordValue);
152
- // The name, and the next word too while the words before it may vanish ($EMPTY sudo ls runs sudo)
153
- for (let i = 0; i < words.length; i++) {
154
- const made = wordsMade(words[i]);
155
- if (made === null) {
156
- parseError ?? (parseError = `brace expansion makes more than ${MAX_BRACE_WORDS} words, or takes too long to read`);
157
- break;
158
- }
159
- // Each word made is the name while the ones before it may vanish; those known only at run time all
160
- // give the word's text as the name, so it is given once
161
- const kept = made.findIndex((word) => !word.mayVanish);
162
- const names = kept < 0 ? made : made.slice(0, kept + 1);
163
- names.forEach((name, k) => {
164
- if (name.value === null && names.findIndex((other) => other.value === null) < k)
165
- return;
166
- commands.push({
167
- name: name.value ?? words[i].text,
168
- words: [...made.slice(k).map((word) => word.value), ...values.slice(i + 1)],
169
- written: [...made.slice(k).map(() => words[i].text), ...words.slice(i + 1).map((word) => word.text)],
170
- // unbash's value of a word keeps the parts known only at run time as written
171
- wordTexts: [...made.slice(k).map((word) => word.value ?? words[i].value), ...words.slice(i + 1).map((word) => word.value)],
172
- start: backticksStart ?? (i === 0 ? node.pos : words[i].pos),
188
+ const expanded = commandWords(words, options);
189
+ if (expanded === null) {
190
+ parseError ?? (parseError = BRACE_LIMIT_ERROR);
191
+ }
192
+ else {
193
+ const candidates = commandNames(expanded.words).map(({ index, name }) => {
194
+ const remaining = expanded.words.slice(index);
195
+ return {
196
+ name: name.value ?? name.source.text,
197
+ words: remaining.map((word) => word.value),
198
+ written: remaining.map((word) => word.source.text),
199
+ wordTexts: remaining.map((word) => word.value ?? word.source.value),
200
+ start: backticksStart ?? (name.source === words[0] ? node.pos : name.source.pos),
173
201
  nameAtRunTime: name.value === null,
174
- });
202
+ ...(expanded.argumentError === undefined ? {} : { argumentError: expanded.argumentError }),
203
+ };
175
204
  });
176
- if (kept >= 0)
177
- break;
205
+ const unsafePrefix = candidates.some((candidate) => candidate.nameAtRunTime
206
+ || COMMAND_PREFIXES.has(candidate.words[0] ?? '') || mayRunUnreadCode(candidate));
207
+ if (expanded.argumentError !== undefined && unsafePrefix) {
208
+ parseError ?? (parseError = expanded.argumentError);
209
+ }
210
+ else {
211
+ commands.push(...candidates);
212
+ }
178
213
  }
179
214
  }
180
215
  const inBackticks = node.type === 'CommandExpansion' && node.text.startsWith('`');
@@ -188,7 +223,8 @@ export async function readPosixCommands(command) {
188
223
  // text may remove: wherever the removal is written, it may run before a call,
189
224
  // from a function's body. Code the reader doesn't read may remove any of them.
190
225
  const functions = [];
191
- const statements = commands.some(mayRunUnreadCode) ? [] : script.commands;
226
+ const statements = commands.some((command) => command.argumentError !== undefined || mayRunUnreadCode(command))
227
+ ? [] : script.commands;
192
228
  for (const statement of statements) {
193
229
  if (statement.command.type !== 'Function' || statement.background)
194
230
  continue;
@@ -0,0 +1,8 @@
1
+ import type { BraceSemantics } from './brace-expansion.js';
2
+ /**
3
+ * Fixed --version only, on a matching precaptured native endpoint; never caller code or a profile.
4
+ * Native Bash5.2 retains the backslash slot that Bash5.3 omits; other Bash4/5 calls keep legacy rules.
5
+ * Bash3.2 and Zsh5.9 defaults remain supported; startup options and profiles are not evaluated.
6
+ * One bounded query per endpoint (at most 32); unknown, unavailable or other versions retain legacy behavior.
7
+ */
8
+ export declare function posixBraceSemantics(shell: string): Promise<BraceSemantics | undefined>;
@@ -0,0 +1,120 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { execFile } from 'child_process';
4
+ /** Captured at server import, before a command can change cwd, PATH or startup variables. */
5
+ const launchCwd = fs.realpathSync(process.cwd());
6
+ const launchPathValue = process.env.PATH ?? '';
7
+ const launchEnv = { ...process.env };
8
+ const launchPath = launchPathValue.split(path.delimiter)
9
+ .map((folder) => path.resolve(launchCwd, folder));
10
+ // process.env is case-insensitive on Windows; its plain-object copy is not.
11
+ for (const name of Object.keys(launchEnv))
12
+ if (name.toLowerCase() === 'path')
13
+ delete launchEnv[name];
14
+ launchEnv.PATH = launchPath.join(path.delimiter);
15
+ delete launchEnv.BASH_ENV;
16
+ delete launchEnv.ENV;
17
+ delete launchEnv.ZDOTDIR;
18
+ const endpoints = new Map();
19
+ const aliases = new Map();
20
+ const names = process.platform === 'win32' ? ['bash.exe', 'zsh.exe'] : ['bash', 'zsh'];
21
+ const key = (file) => process.platform === 'win32' ? file.toLowerCase() : file;
22
+ /** A script named bash is not a native capability endpoint, even on the launch PATH. */
23
+ function nativeFile(file) {
24
+ let descriptor;
25
+ try {
26
+ const real = fs.realpathSync(file);
27
+ if (!isLaunchExecutable(real))
28
+ return undefined;
29
+ descriptor = fs.openSync(real, 'r');
30
+ const header = Buffer.alloc(4);
31
+ if (fs.readSync(descriptor, header, 0, 4, 0) !== 4)
32
+ return undefined;
33
+ const magic = header.toString('hex');
34
+ return magic.startsWith('4d5a') || ['7f454c46', 'feedface', 'feedfacf', 'cefaedfe',
35
+ 'cffaedfe', 'cafebabe', 'bebafeca', 'cafebabf', 'bfbafeca'].includes(magic) ? real : undefined;
36
+ }
37
+ catch {
38
+ // Missing or unreadable endpoints cannot supply a native capability; preserve the legacy reading.
39
+ return undefined;
40
+ }
41
+ finally {
42
+ if (descriptor !== undefined)
43
+ fs.closeSync(descriptor);
44
+ }
45
+ }
46
+ function capture(file) {
47
+ const real = nativeFile(file);
48
+ if (real === undefined)
49
+ return undefined;
50
+ let endpoint = endpoints.get(key(real));
51
+ if (endpoint === undefined) {
52
+ if (endpoints.size >= 32)
53
+ return undefined;
54
+ endpoint = { file: real };
55
+ endpoints.set(key(real), endpoint);
56
+ }
57
+ aliases.set(key(file), endpoint);
58
+ aliases.set(key(real), endpoint);
59
+ return endpoint;
60
+ }
61
+ function isLaunchExecutable(file) {
62
+ try {
63
+ fs.accessSync(file, process.platform === 'win32' ? fs.constants.F_OK : fs.constants.X_OK);
64
+ return fs.statSync(file).isFile();
65
+ }
66
+ catch {
67
+ // A missing or inaccessible PATH entry cannot be the executable selected at launch.
68
+ return false;
69
+ }
70
+ }
71
+ // Bare names bind to the FIRST launch-PATH executable, including an unsupported script.
72
+ for (const name of names) {
73
+ let first = true;
74
+ for (const folder of launchPath) {
75
+ const file = path.join(folder, name);
76
+ if (!isLaunchExecutable(file))
77
+ continue;
78
+ const endpoint = capture(file);
79
+ if (first)
80
+ aliases.set(key(name), endpoint);
81
+ first = false;
82
+ }
83
+ }
84
+ const standards = process.platform === 'win32'
85
+ ? [path.join(launchEnv.ProgramFiles ?? 'C:\\Program Files', 'Git', 'bin', 'bash.exe'),
86
+ path.join(launchEnv.ProgramFiles ?? 'C:\\Program Files', 'Git', 'usr', 'bin', 'bash.exe')]
87
+ : ['/bin/bash', '/usr/bin/bash', '/usr/local/bin/bash', '/opt/homebrew/bin/bash',
88
+ '/bin/zsh', '/usr/bin/zsh', '/usr/local/bin/zsh', '/opt/homebrew/bin/zsh'];
89
+ for (const file of standards)
90
+ capture(file);
91
+ /**
92
+ * Fixed --version only, on a matching precaptured native endpoint; never caller code or a profile.
93
+ * Native Bash5.2 retains the backslash slot that Bash5.3 omits; other Bash4/5 calls keep legacy rules.
94
+ * Bash3.2 and Zsh5.9 defaults remain supported; startup options and profiles are not evaluated.
95
+ * One bounded query per endpoint (at most 32); unknown, unavailable or other versions retain legacy behavior.
96
+ */
97
+ export function posixBraceSemantics(shell) {
98
+ const bare = !shell.includes('/') && !shell.includes('\\');
99
+ const endpoint = aliases.get(key(bare ? shell : path.resolve(launchCwd, shell)));
100
+ if (endpoint === undefined)
101
+ return Promise.resolve(undefined);
102
+ endpoint.semantics ?? (endpoint.semantics = new Promise((resolve) => {
103
+ execFile(endpoint.file, ['--version'], { cwd: launchCwd, env: launchEnv, timeout: 1000,
104
+ maxBuffer: 4096, windowsHide: true, encoding: 'utf8' }, (error, stdout) => {
105
+ if (error)
106
+ return resolve(undefined);
107
+ const version = /^GNU bash, version (\d+)\.(\d+)(?:\D|$)/.exec(stdout);
108
+ if (version?.[1] === '3' && version[2] === '2')
109
+ return resolve('bash3');
110
+ if (version?.[1] === '5' && version[2] === '2')
111
+ return resolve('bash5.2');
112
+ if (version && ['4', '5'].includes(version[1]))
113
+ return resolve('legacy');
114
+ if (/^zsh 5\.9(?:\D|$)/.test(stdout))
115
+ return resolve('zsh');
116
+ resolve(undefined);
117
+ });
118
+ }));
119
+ return endpoint.semantics;
120
+ }
@@ -53,7 +53,8 @@ export declare class PowerShellHelper {
53
53
  }
54
54
  /**
55
55
  * Reads a command for a PowerShell shell ("powershell.exe", "pwsh" or a path),
56
- * with the same program as the helper. checkCommand() has made sure it's there.
56
+ * only when its filesystem identity matches a launch-PATH parser. Custom
57
+ * executables are refused before startup, rather than used to validate themselves.
57
58
  */
58
59
  export declare function readPowerShellCommands(command: string, shell: string): Promise<CommandReading>;
59
60
  /** The process ids of the helpers running now, for tests */
@@ -1,8 +1,9 @@
1
1
  import { spawn } from 'child_process';
2
2
  import { randomBytes } from 'crypto';
3
+ import fs from 'fs';
3
4
  import path from 'path';
4
5
  import { fileURLToPath } from 'url';
5
- import { getShellEnvironment, resolveProgramPath } from './shell.js';
6
+ import { getShellEnvironment, resolveShellPath } from './shell.js';
6
7
  /**
7
8
  * The command check's reader for PowerShell. No JavaScript parser reads
8
9
  * PowerShell correctly (here-strings, @{ } tables, & $var), so a helper
@@ -401,16 +402,63 @@ export class PowerShellHelper {
401
402
  }
402
403
  /** One helper per PowerShell program (Windows PowerShell and PowerShell 7 read some names differently) */
403
404
  const helpers = new Map();
405
+ function parserIdentity(program) {
406
+ const identity = fs.realpathSync(program);
407
+ return process.platform === 'win32' ? identity.toLowerCase() : identity;
408
+ }
409
+ // The server's launch PATH is the operator's authority for parser endpoints. Capture it
410
+ // before a request can select a shell; finding a candidate must never execute it.
411
+ const nativeParsers = (process.platform === 'win32' ? ['powershell', 'pwsh'] : ['pwsh'])
412
+ .flatMap((name) => {
413
+ const program = resolveShellPath(name);
414
+ if (program === null)
415
+ return [];
416
+ // Relative PATH entries belong to the launch cwd, not the helper's mcpRoot cwd.
417
+ try {
418
+ return [{ name, program: path.resolve(program), identity: parserIdentity(program) }];
419
+ }
420
+ catch {
421
+ // An endpoint may disappear or become unreadable after lookup. Omitting it denies approval.
422
+ return [];
423
+ }
424
+ });
425
+ function launchParserForBareName(shell) {
426
+ const requestedName = shell.trim();
427
+ if (requestedName.includes('/') || requestedName.includes('\\'))
428
+ return undefined;
429
+ const name = process.platform === 'win32'
430
+ ? requestedName.toLowerCase().replace(/\.exe$/, '')
431
+ : requestedName;
432
+ return nativeParsers.find((parser) => parser.name === name);
433
+ }
404
434
  /**
405
435
  * Reads a command for a PowerShell shell ("powershell.exe", "pwsh" or a path),
406
- * with the same program as the helper. checkCommand() has made sure it's there.
436
+ * only when its filesystem identity matches a launch-PATH parser. Custom
437
+ * executables are refused before startup, rather than used to validate themselves.
407
438
  */
408
439
  export function readPowerShellCommands(command, shell) {
409
- const program = path.resolve(resolveProgramPath(shell));
410
- let helper = helpers.get(program);
440
+ const requested = resolveShellPath(shell);
441
+ // A bare native name can retain its launch binding when relative PATH entries
442
+ // stop resolving after chdir. A currently resolved different program is never replaced.
443
+ let identity = requested === null ? launchParserForBareName(shell)?.identity : undefined;
444
+ try {
445
+ if (requested !== null)
446
+ identity = parserIdentity(requested);
447
+ }
448
+ catch { /* A missing or unreadable identity cannot approve a parser. */ }
449
+ const native = nativeParsers.find((parser) => parser.identity === identity);
450
+ if (!native) {
451
+ throw new Error(`No trusted PowerShell parser matches "${shell}"; ` +
452
+ 'use a PowerShell executable from the server\'s launch PATH');
453
+ }
454
+ // An alias keeps the launch flags its requested name uses for execution. A
455
+ // PowerShell 7 login helper must not share state with a non-login alias.
456
+ const args = helperArgs(shell);
457
+ const key = `${identity}\0${args.includes('-Login')}`;
458
+ let helper = helpers.get(key);
411
459
  if (!helper) {
412
- helper = new PowerShellHelper(program);
413
- helpers.set(program, helper);
460
+ helper = new PowerShellHelper(native.program, args);
461
+ helpers.set(key, helper);
414
462
  }
415
463
  return helper.read(command);
416
464
  }
@@ -1,4 +1,8 @@
1
+ import { type ArgumentInspection } from './command-reading.js';
1
2
  type FileWord = string | null;
3
+ interface FileWordSource extends ArgumentInspection {
4
+ written?: readonly string[];
5
+ }
2
6
  /** File arguments are found before command/script arguments can be mistaken for more host options. */
3
- export declare function shellScriptFiles(program: string, args: FileWord[]): FileWord[];
7
+ export declare function shellScriptFiles(program: string, args: FileWord[], source?: FileWordSource): FileWord[];
4
8
  export {};
@@ -1,5 +1,9 @@
1
1
  import { getShellType, POSIX_SHELLS } from './shell.js';
2
+ import { requireCompleteArguments } from './command-reading.js';
2
3
  const POSIX_VALUE_OPTIONS = new Set(['-o', '+o', '-O', '+O', '--rcfile', '--init-file']);
4
+ const POSIX_SHORT_OPTIONS = /^[-+][a-zA-Z]+$/;
5
+ // These scalar spellings prove one argument; quoted $@ and arrays do not.
6
+ const QUOTED_SCALAR_VALUE = /^"\$(?:[A-Za-z_]\w*|\{[A-Za-z_]\w*\})"$/;
3
7
  const BASH_STARTUP_OPTIONS = new Set(['--rcfile', '--init-file']);
4
8
  // Minimum spellings and aliases follow the PowerShell host's option precedence.
5
9
  const POWERSHELL_VALUE_OPTIONS = [
@@ -9,26 +13,40 @@ const POWERSHELL_VALUE_OPTIONS = [
9
13
  ['-windowstyle', '-w'], ['-encodedarguments', '-encodeda'],
10
14
  ];
11
15
  const POWERSHELL_VALUE_ALIASES = new Set(['-ep', '-if', '-of', '-wd', '-ea']);
12
- /** Option values must not be mistaken for the shell's script filename. */
13
- function posixValueOption(arg) {
14
- return POSIX_VALUE_OPTIONS.has(arg) || /^[-+][a-zA-Z]*[oO]/.test(arg);
16
+ /** Skipping only one grouped value would mistake another option name for the script. */
17
+ function posixValueOptions(arg) {
18
+ if (POSIX_VALUE_OPTIONS.has(arg))
19
+ return [arg];
20
+ if (!POSIX_SHORT_OPTIONS.test(arg))
21
+ return [];
22
+ return [...arg.slice(1)]
23
+ .filter((letter) => letter === 'o' || letter === 'O')
24
+ .map((letter) => arg[0] + letter);
15
25
  }
16
26
  /** Command/stdin mode owns later words, so only a positional file before that boundary is a script. */
17
- function posixScriptFile(args) {
27
+ function posixScriptFile(args, source) {
28
+ let quotedRuntimeValue = false;
18
29
  for (let i = 0; i < args.length; i++) {
19
30
  const arg = args[i];
20
31
  if (arg === null)
21
32
  return arg;
22
33
  if (/^-[a-zA-Z]*[cs]/.test(arg) || arg === '--command')
23
34
  return undefined;
24
- if (posixValueOption(arg)) {
25
- i++;
35
+ const valueOptions = posixValueOptions(arg);
36
+ if (valueOptions.length > 0) {
37
+ const optionValues = args.slice(i + 1, i + 1 + valueOptions.length);
38
+ const uncertainValue = optionValues.some((value, offset) => value === null
39
+ && !QUOTED_SCALAR_VALUE.test(source.written?.[i + 1 + offset] ?? ''));
40
+ if (uncertainValue)
41
+ return null;
42
+ quotedRuntimeValue || (quotedRuntimeValue = optionValues.includes(null));
43
+ i += valueOptions.length;
26
44
  continue;
27
45
  }
28
46
  if (!arg.startsWith('-') && !arg.startsWith('+'))
29
47
  return arg;
30
48
  }
31
- return undefined;
49
+ return quotedRuntimeValue ? null : undefined;
32
50
  }
33
51
  /** A custom rcfile needs a note only when the explicit host options cause Bash to read it. */
34
52
  function bashStartupFile(args) {
@@ -36,7 +54,6 @@ function bashStartupFile(args) {
36
54
  let interactive = false;
37
55
  let login = false;
38
56
  let noRc = false;
39
- let posix = false;
40
57
  for (let i = 0; i < args.length; i++) {
41
58
  const arg = args[i];
42
59
  if (arg === null || arg === '--')
@@ -49,24 +66,22 @@ function bashStartupFile(args) {
49
66
  noRc = true;
50
67
  if (arg === '--login')
51
68
  login = true;
52
- if (arg === '--posix')
53
- posix = true;
54
- if (/^[-+][a-zA-Z]+$/.test(arg)) {
69
+ if (POSIX_SHORT_OPTIONS.test(arg)) {
55
70
  if (arg.includes('i'))
56
71
  interactive = arg[0] === '-';
57
72
  if (arg.includes('l'))
58
73
  login = arg[0] === '-';
59
74
  }
60
- if (posixValueOption(arg)) {
61
- if (args[++i] === 'posix' && /^[-+][a-zA-Z]*o/.test(arg))
62
- posix = arg[0] === '-';
75
+ const valueOptions = posixValueOptions(arg);
76
+ if (valueOptions.length > 0) {
77
+ i += valueOptions.length;
63
78
  continue;
64
79
  }
65
80
  if (!arg.startsWith('-') && !arg.startsWith('+'))
66
81
  break;
67
82
  }
68
- // Bash reads the custom rcfile only in interactive, non-login Bash mode.
69
- if (!interactive || login || noRc || posix || file === '')
83
+ // POSIX-mode rcfile handling differs by Bash version; it cannot prove this file is unused.
84
+ if (!interactive || login || noRc || file === '')
70
85
  return undefined;
71
86
  return file;
72
87
  }
@@ -101,18 +116,22 @@ function powershellScriptFile(program, args) {
101
116
  return undefined;
102
117
  }
103
118
  /** File arguments are found before command/script arguments can be mistaken for more host options. */
104
- export function shellScriptFiles(program, args) {
119
+ export function shellScriptFiles(program, args, source = {}) {
105
120
  if (POSIX_SHELLS.has(program)) {
121
+ requireCompleteArguments(source);
106
122
  const files = [];
107
123
  const startup = program === 'bash' ? bashStartupFile(args) : undefined;
108
- const script = posixScriptFile(args);
124
+ const script = posixScriptFile(args, program === 'bash' ? source : {});
109
125
  if (startup !== undefined)
110
126
  files.push(startup);
111
- if (script !== undefined)
127
+ // Known file roles stay visible; only two null roles repeat the same program-level notice.
128
+ const repeatsRuntimeNotice = script === null && startup === null;
129
+ if (script !== undefined && !repeatsRuntimeNotice)
112
130
  files.push(script);
113
131
  return files;
114
132
  }
115
133
  if (getShellType(program) === 'powershell') {
134
+ requireCompleteArguments(source);
116
135
  const script = powershellScriptFile(program, args);
117
136
  if (script !== undefined)
118
137
  return [script];
@@ -47,12 +47,13 @@ export declare function detectAvailableShells(): string[];
47
47
  * A program's name without its folder or extension, lowercased:
48
48
  * C:\Windows\System32\NET.EXE is "net". The folder goes as Windows writes it
49
49
  * (\ or /, or a drive, as in C:sc.exe). POSIX shells outside Windows use
50
- * only / as a folder separator. The extension is .ps1
51
- * (PowerShell runs deploy.ps1 for deploy), or on Windows one of PATHEXT's as
52
- * commands run with it (repaired, #481). WSL runs Windows programs from Linux
50
+ * only / as a folder separator. PowerShell also removes .ps1; on Windows
51
+ * and WSL the extensions in the repaired PATHEXT are removed as commands run
52
+ * with them. WSL runs Windows programs from Linux
53
53
  * (sc.exe stop Spooler), so there too. The command check compares the names it
54
54
  * finds and the blockedCommands entries in this form. POSIX shells on
55
55
  * Windows still accept Windows paths, as Git Bash does.
56
+ * Without a shell type, retain the historical PowerShell-style normalization.
56
57
  */
57
58
  export declare function programName(name: string, shellType?: ShellType): string;
58
59
  /** The kinds of shell a command can run in. The command check has a reader for each. */
@@ -208,17 +208,21 @@ function isWsl() {
208
208
  * A program's name without its folder or extension, lowercased:
209
209
  * C:\Windows\System32\NET.EXE is "net". The folder goes as Windows writes it
210
210
  * (\ or /, or a drive, as in C:sc.exe). POSIX shells outside Windows use
211
- * only / as a folder separator. The extension is .ps1
212
- * (PowerShell runs deploy.ps1 for deploy), or on Windows one of PATHEXT's as
213
- * commands run with it (repaired, #481). WSL runs Windows programs from Linux
211
+ * only / as a folder separator. PowerShell also removes .ps1; on Windows
212
+ * and WSL the extensions in the repaired PATHEXT are removed as commands run
213
+ * with them. WSL runs Windows programs from Linux
214
214
  * (sc.exe stop Spooler), so there too. The command check compares the names it
215
215
  * finds and the blockedCommands entries in this form. POSIX shells on
216
216
  * Windows still accept Windows paths, as Git Bash does.
217
+ * Without a shell type, retain the historical PowerShell-style normalization.
217
218
  */
218
- export function programName(name, shellType) {
219
+ export function programName(name, shellType = 'powershell') {
219
220
  const paths = shellType === 'posix' && !isWindows() ? path.posix : path.win32;
220
221
  const program = paths.basename(name).toLowerCase();
221
- const extensions = ['.ps1', ...(isWindows() || isWsl() ? getRepairedPathExt().split(';') : [])]
222
+ const extensions = [
223
+ ...(shellType === 'powershell' ? ['.ps1'] : []),
224
+ ...(isWindows() || isWsl() ? getRepairedPathExt().split(';') : []),
225
+ ]
222
226
  .map((ext) => ext.trim().toLowerCase());
223
227
  const extension = paths.extname(program);
224
228
  return extension && extensions.includes(extension) ? program.slice(0, -extension.length) : program;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.3.2-alpha.3";
1
+ export declare const VERSION = "0.3.2";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.3.2-alpha.3';
1
+ export const VERSION = '0.3.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wonderwhy-er/desktop-commander",
3
- "version": "0.3.2-alpha.3",
3
+ "version": "0.3.2",
4
4
  "description": "MCP server for terminal operations and file editing",
5
5
  "mcpName": "io.github.wonderwhy-er/desktop-commander",
6
6
  "license": "MIT",
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAEnC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;IACpC,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"command-manager.js","sourceRoot":"","sources":["../src/command-manager.ts"],"names":[],"mappings":"AAAA,O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,CAAC;YACH,mEAAmE;YACnE,4EAA4E;YAC5E,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC;CACJ;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,cAAc,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-field-definitions.js","sourceRoot":"","sources":["../src/config-field-definitions.ts"],"names":[],"mappings":"AAQA,iEAAiE;AACjE,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,eAAe,EAAE;QACf,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,iMAAiM;QAC9M,SAAS,EAAE,OAAO;KACnB;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,iNAAiN;QAC9N,SAAS,EAAE,OAAO;KACnB;IACD,YAAY,EAAE;QACZ,KAAK,EAAE,eAAe;QACtB,WAAW,EAAE,+JAA+J;QAC5K,SAAS,EAAE,QAAQ;KACpB;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,uIAAuI;QACpJ,SAAS,EAAE,SAAS;KACrB;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,iBAAiB;QACxB,WAAW,EAAE,yJAAyJ;QACtK,SAAS,EAAE,QAAQ;KACpB;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,uJAAuJ;QACpK,SAAS,EAAE,QAAQ;KACpB;CACuD,CAAC;AAI3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAqB,CAAC;AAE3F,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;AAC/E,CAAC"}