llm-cli-gateway 1.5.28 → 1.5.30

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to the llm-cli-gateway project.
4
4
 
5
+ ## [1.5.30] - 2026-05-25
6
+
7
+ ### Fixed
8
+
9
+ - Quote Windows `.cmd` and `.bat` provider shim invocations through `cmd.exe` to preserve paths with spaces and escape command-processor metacharacters in forwarded arguments.
10
+
11
+ ## [1.5.29] - 2026-05-25
12
+
13
+ ### Fixed
14
+
15
+ - Launch Windows `.cmd` and `.bat` provider shims through `cmd.exe` instead of spawning them directly, fixing Gemini npm shim failures reported as `spawn EINVAL` by `gemini_request`, `cli_versions`, and `contracts --probe-installed`.
16
+
5
17
  ## [1.5.28] - 2026-05-25
6
18
 
7
19
  ### Fixed
@@ -19,6 +19,7 @@ export declare function envWithExtendedPath(baseEnv?: NodeJS.ProcessEnv, extende
19
19
  export interface ResolvedSpawnCommand {
20
20
  command: string;
21
21
  args: string[];
22
+ windowsVerbatimArguments?: boolean;
22
23
  }
23
24
  export declare function resolveCommandForSpawn(command: string, args: string[], options?: {
24
25
  envPath?: string;
package/dist/executor.js CHANGED
@@ -136,8 +136,29 @@ export function resolveCommandForSpawn(command, args, options = {}) {
136
136
  args: ["-NoProfile", "-ExecutionPolicy", "Bypass", "-File", resolved, ...args],
137
137
  };
138
138
  }
139
+ if ([".cmd", ".bat"].includes(extname(resolved).toLowerCase())) {
140
+ return {
141
+ command: "cmd.exe",
142
+ args: ["/d", "/s", "/c", `"${buildWindowsCmdCommand(resolved, args)}"`],
143
+ windowsVerbatimArguments: true,
144
+ };
145
+ }
139
146
  return { command: resolved, args };
140
147
  }
148
+ function buildWindowsCmdCommand(command, args) {
149
+ return [escapeWindowsCmdCommand(command), ...args.map(escapeWindowsCmdArgument)].join(" ");
150
+ }
151
+ const WINDOWS_CMD_META_CHARS = /([()\][%!^"`<>&|;, *?])/g;
152
+ function escapeWindowsCmdCommand(value) {
153
+ return win32.normalize(value).replace(WINDOWS_CMD_META_CHARS, "^$1");
154
+ }
155
+ function escapeWindowsCmdArgument(value) {
156
+ let arg = `${value}`;
157
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
158
+ arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
159
+ arg = `"${arg}"`;
160
+ return arg.replace(WINDOWS_CMD_META_CHARS, "^$1");
161
+ }
141
162
  function resolveWindowsCommandPath(command, envPath) {
142
163
  if (/[\\/]/.test(command)) {
143
164
  return existsSync(command) ? command : null;
@@ -260,6 +281,7 @@ export function spawnCliProcess(command, args, options) {
260
281
  cwd: options.cwd,
261
282
  detached,
262
283
  windowsHide: true,
284
+ windowsVerbatimArguments: resolved.windowsVerbatimArguments,
263
285
  stdio: options.stdio,
264
286
  env: options.env,
265
287
  });
@@ -106,6 +106,7 @@ function runCommand(command, args, timeoutMs) {
106
106
  input: "",
107
107
  timeout: timeoutMs,
108
108
  windowsHide: true,
109
+ windowsVerbatimArguments: resolved.windowsVerbatimArguments,
109
110
  });
110
111
  const output = sanitizeOutput(`${result.stdout || ""}\n${result.stderr || ""}`);
111
112
  return {
@@ -551,6 +551,7 @@ export function probeInstalledCliContract(cli, timeoutMs = 5_000) {
551
551
  maxBuffer: 1024 * 1024,
552
552
  env,
553
553
  windowsHide: true,
554
+ windowsVerbatimArguments: resolved.windowsVerbatimArguments,
554
555
  });
555
556
  if (result.error) {
556
557
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-cli-gateway",
3
- "version": "1.5.28",
3
+ "version": "1.5.30",
4
4
  "mcpName": "io.github.verivus-oss/llm-cli-gateway",
5
5
  "description": "MCP server providing unified access to Claude Code, Codex, Gemini, Grok, and Mistral Vibe CLIs with session management, retry logic, async job orchestration, durable job results, and cross-LLM validation.",
6
6
  "license": "MIT",