@wrongstack/cli 0.256.0 → 0.256.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.
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { makeProviderFromConfig, capabilitiesFor, buildProviderFactoriesFromRegi
14
14
  import { getProcessRegistry, builtinToolsPack, TIER1_TOOLS, rememberTool, forgetTool, searchMemoryTool, relatedMemoryTool, runStartupIndex, isIndexableFile, enqueueReindex, cancelPendingReindexes, shutdownCodebaseIndexHost, resetIndexCircuitBreaker } from '@wrongstack/tools';
15
15
  import { DefaultSessionStore } from '@wrongstack/core/storage';
16
16
  import { WebSocketServer, WebSocket } from 'ws';
17
- import { spawn, exec, execFileSync } from 'child_process';
17
+ import { spawn, execFile, execFileSync } from 'child_process';
18
18
  import { MCPRegistry, MCPServer, serveHttp, serveStdio } from '@wrongstack/mcp';
19
19
  import * as fs2 from 'fs';
20
20
  import { writeFileSync, existsSync, readFileSync } from 'fs';
@@ -4549,7 +4549,7 @@ async function runWebUI(opts) {
4549
4549
  opts.agent.ctx.provider.id,
4550
4550
  opts.agent.ctx.model
4551
4551
  );
4552
- const registryMax = m?.capabilities?.maxContext;
4552
+ const registryMax = m?.capabilities.maxContext;
4553
4553
  maxContext = registryMax ?? opts.agent.ctx.provider.capabilities?.maxContext ?? 0;
4554
4554
  const rates = getCostRates(m);
4555
4555
  inputCost = rates.input;
@@ -8648,24 +8648,24 @@ var DEFAULT_TIMEOUT_MS = 6e4;
8648
8648
  var MAX_OUTPUT_LINES = 500;
8649
8649
  function runCommand(cmd, cwd, timeout) {
8650
8650
  return new Promise((resolve10) => {
8651
- exec(
8652
- cmd,
8653
- {
8654
- cwd,
8655
- timeout,
8656
- maxBuffer: 2 * 1024 * 1024,
8657
- // 2 MB
8658
- windowsHide: true
8659
- },
8660
- (error, stdout, stderr) => {
8661
- resolve10({
8662
- stdout,
8663
- stderr,
8664
- exitCode: error?.code ?? 0,
8665
- killed: error?.killed ?? false
8666
- });
8667
- }
8668
- );
8651
+ const opts = {
8652
+ cwd,
8653
+ timeout,
8654
+ maxBuffer: 2 * 1024 * 1024,
8655
+ // 2 MB
8656
+ windowsHide: true,
8657
+ // On POSIX: no shell → command string is a literal argument.
8658
+ // On Windows: shell:true → cmd.exe /c "..." handles quoting.
8659
+ shell: process.platform === "win32" ? true : false
8660
+ };
8661
+ execFile(cmd, [], opts, (error, stdout, stderr) => {
8662
+ resolve10({
8663
+ stdout,
8664
+ stderr,
8665
+ exitCode: typeof error?.code === "number" ? error.code : 0,
8666
+ killed: error?.killed ?? false
8667
+ });
8668
+ });
8669
8669
  });
8670
8670
  }
8671
8671
  function formatOutput(cmd, result, elapsed) {