llm-cli-gateway 1.5.27 → 1.5.29

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,19 @@
2
2
 
3
3
  All notable changes to the llm-cli-gateway project.
4
4
 
5
+ ## [1.5.29] - 2026-05-25
6
+
7
+ ### Fixed
8
+
9
+ - 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`.
10
+
11
+ ## [1.5.28] - 2026-05-25
12
+
13
+ ### Fixed
14
+
15
+ - Add Windows gateway startup self-healing for a verified pending `llm-cli-gateway.exe.new` bootstrapper update, so a failed staged bootstrapper replacement completes after `llm-cli-gateway start`.
16
+ - Replace the Windows bootstrapper self-replacement helper with a `cmd.exe` script instead of PowerShell to avoid environments that block local PowerShell replacement scripts.
17
+
5
18
  ## [1.5.27] - 2026-05-25
6
19
 
7
20
  ### Fixed
package/dist/executor.js CHANGED
@@ -136,6 +136,12 @@ 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", resolved, ...args],
143
+ };
144
+ }
139
145
  return { command: resolved, args };
140
146
  }
141
147
  function resolveWindowsCommandPath(command, envPath) {
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
4
  import { randomUUID } from "crypto";
5
- import { readFileSync, readdirSync } from "fs";
5
+ import { existsSync, readFileSync, readdirSync, renameSync, unlinkSync } from "fs";
6
6
  import { dirname, join } from "path";
7
7
  import { fileURLToPath } from "url";
8
8
  import { z } from "zod";
@@ -47,6 +47,42 @@ const logger = {
47
47
  }
48
48
  },
49
49
  };
50
+ function startWindowsBootstrapperSelfHeal() {
51
+ if (process.platform !== "win32")
52
+ return;
53
+ const localAppData = process.env.LOCALAPPDATA;
54
+ if (!localAppData)
55
+ return;
56
+ const installDir = join(localAppData, "Programs", "llm-cli-gateway");
57
+ const exePath = join(installDir, "llm-cli-gateway.exe");
58
+ const pendingPath = `${exePath}.new`;
59
+ if (!existsSync(pendingPath))
60
+ return;
61
+ let attempts = 0;
62
+ const maxAttempts = 120;
63
+ const timer = setInterval(() => {
64
+ attempts += 1;
65
+ try {
66
+ if (!existsSync(pendingPath)) {
67
+ clearInterval(timer);
68
+ return;
69
+ }
70
+ if (existsSync(exePath)) {
71
+ unlinkSync(exePath);
72
+ }
73
+ renameSync(pendingPath, exePath);
74
+ clearInterval(timer);
75
+ logger.info(`Completed pending Windows bootstrapper replacement at ${exePath}`);
76
+ }
77
+ catch (error) {
78
+ if (attempts >= maxAttempts) {
79
+ clearInterval(timer);
80
+ logger.warn(`Pending Windows bootstrapper replacement did not complete: ${error}`);
81
+ }
82
+ }
83
+ }, 500);
84
+ timer.unref();
85
+ }
50
86
  function logOptimizationTokens(kind, correlationId, original, optimized) {
51
87
  const originalTokens = estimateTokens(original);
52
88
  const optimizedTokens = estimateTokens(optimized);
@@ -3959,6 +3995,7 @@ process.on("SIGINT", () => shutdown("SIGINT"));
3959
3995
  // Server Startup
3960
3996
  //──────────────────────────────────────────────────────────────────────────────
3961
3997
  async function main() {
3998
+ startWindowsBootstrapperSelfHeal();
3962
3999
  const args = process.argv.slice(2);
3963
4000
  if (args[0] === "doctor") {
3964
4001
  if (args.includes("--json")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "llm-cli-gateway",
3
- "version": "1.5.27",
3
+ "version": "1.5.29",
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",