@trops/dash-core 0.1.407 → 0.1.409

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.
@@ -25715,6 +25715,22 @@ const DEFAULT_TOOL_CACHE_TTL = 5000;
25715
25715
 
25716
25716
  const IS_WINDOWS$1 = process.platform === "win32";
25717
25717
 
25718
+ /**
25719
+ * Quote a string for cmd.exe when `shell: true` is in effect. With
25720
+ * shell:true on Windows, Node joins command+args into one string and
25721
+ * hands it to `cmd.exe /d /s /c`, which tokenizes on whitespace. A
25722
+ * path like `C:\Users\First Name\AppData\Local\Programs\Dash\Dash.exe`
25723
+ * (what `process.execPath` returns for a packaged app when the user's
25724
+ * folder name contains a space) parses as two tokens without quoting
25725
+ * and the spawn fails with ENOENT. No-op when the string has no
25726
+ * whitespace or quote character.
25727
+ */
25728
+ function windowsQuote$1(s) {
25729
+ const str = String(s);
25730
+ if (!/[\s"]/.test(str)) return str;
25731
+ return `"${str.replace(/"/g, '""')}"`;
25732
+ }
25733
+
25718
25734
  /**
25719
25735
  * Cached shell PATH result (resolved once, reused for all spawns).
25720
25736
  */
@@ -26675,7 +26691,13 @@ const mcpController$2 = {
26675
26691
 
26676
26692
  return new Promise((resolve) => {
26677
26693
  const resolvedCmd = resolveNodeCommand(authCommand.command, env);
26678
- const proc = spawn(resolvedCmd.command, resolvedArgs, {
26694
+ const spawnCmd = IS_WINDOWS$1
26695
+ ? windowsQuote$1(resolvedCmd.command)
26696
+ : resolvedCmd.command;
26697
+ const spawnArgs = IS_WINDOWS$1
26698
+ ? resolvedArgs.map(windowsQuote$1)
26699
+ : resolvedArgs;
26700
+ const proc = spawn(spawnCmd, spawnArgs, {
26679
26701
  env: resolvedCmd.env,
26680
26702
  stdio: ["ignore", "pipe", "pipe"],
26681
26703
  // Needed so Windows can launch .cmd/.bat wrappers (npx.cmd, etc).
@@ -28104,7 +28126,8 @@ var schedulerController_1 = schedulerController$2;
28104
28126
  if (!entry.description && manifest.description)
28105
28127
  entry.description = manifest.description;
28106
28128
  if (!entry.author && manifest.author) entry.author = manifest.author;
28107
- if (!entry.version && manifest.version) entry.version = manifest.version;
28129
+ if (!entry.version && manifest.version)
28130
+ entry.version = manifest.version;
28108
28131
  } catch (err) {
28109
28132
  console.warn(
28110
28133
  `[WidgetRegistry] Could not parse dash.json at ${dashJsonPath}:`,
@@ -51449,6 +51472,20 @@ const {
51449
51472
 
51450
51473
  const IS_WINDOWS = process.platform === "win32";
51451
51474
 
51475
+ /**
51476
+ * Quote a string for cmd.exe when `shell: true` is in effect. With
51477
+ * shell:true on Windows, Node joins command+args into one string and
51478
+ * hands it to `cmd.exe /d /s /c`, which tokenizes on whitespace. A
51479
+ * path like `C:\Users\First Name\AppData\...\claude.cmd` would parse
51480
+ * as two tokens (`C:\Users\First` + junk) without quoting. No-op when
51481
+ * the string has no whitespace or quote character.
51482
+ */
51483
+ function windowsQuote(s) {
51484
+ const str = String(s);
51485
+ if (!/[\s"]/.test(str)) return str;
51486
+ return `"${str.replace(/"/g, '""')}"`;
51487
+ }
51488
+
51452
51489
  /**
51453
51490
  * Cached shell PATH result (resolved once, reused for all spawns).
51454
51491
  * Same pattern as mcpController.js.
@@ -51720,7 +51757,9 @@ const cliController$2 = {
51720
51757
  }
51721
51758
  spawnOpts.cwd = cwd;
51722
51759
  }
51723
- const child = spawn(binaryPath, args, spawnOpts);
51760
+ const spawnCmd = IS_WINDOWS ? windowsQuote(binaryPath) : binaryPath;
51761
+ const spawnArgs = IS_WINDOWS ? args.map(windowsQuote) : args;
51762
+ const child = spawn(spawnCmd, spawnArgs, spawnOpts);
51724
51763
 
51725
51764
  activeProcesses.set(requestId, child);
51726
51765