vibe-gate-mcp 0.1.6 → 0.1.7

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
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.1.7] - 2026-09-24
11
+
12
+ ### Fixed
13
+
14
+ - Detect and launch Windows `.cmd` and `.bat` CLI shims through `cmd.exe` while keeping native executables on the direct spawn path.
15
+
16
+ ### Tests
17
+
18
+ - Cover Windows `PATHEXT` shim resolution and safely quoted batch-shim invocation.
19
+
10
20
  ## [0.1.6] - 2026-09-24
11
21
 
12
22
  ### Added
package/dist/index.mjs CHANGED
@@ -2477,6 +2477,42 @@ function createOpenCodeProvider(apiKey, model, plan = OPENCODE_PLANS.ZEN) {
2477
2477
  } };
2478
2478
  }
2479
2479
  //#endregion
2480
+ //#region src/llm/cli-command.ts
2481
+ /** Platform-specific executable lookup and process invocation for local CLIs. */
2482
+ const WINDOWS_EXECUTABLE_EXTENSIONS = /* @__PURE__ */ new Set([
2483
+ ".COM",
2484
+ ".EXE",
2485
+ ".BAT",
2486
+ ".CMD"
2487
+ ]);
2488
+ const WINDOWS_BATCH_EXTENSIONS = /* @__PURE__ */ new Set([".BAT", ".CMD"]);
2489
+ function executableExtensions(command, isWindows, pathExt = process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD") {
2490
+ if (!isWindows || extname(command)) return [""];
2491
+ return pathExt.split(";").filter((extension) => WINDOWS_EXECUTABLE_EXTENSIONS.has(extension.toUpperCase()));
2492
+ }
2493
+ function quoteCmdToken(value) {
2494
+ if (/[%"\0\r\n]/.test(value)) throw new Error("Windows CLI arguments cannot contain percent signs, quotes, or line breaks.");
2495
+ return `"${value}"`;
2496
+ }
2497
+ function buildCliSpawnTarget(command, args, platform = process.platform, comspec = process.env.ComSpec ?? process.env.COMSPEC ?? "cmd.exe") {
2498
+ const extension = extname(command).toUpperCase();
2499
+ if (platform !== "win32" || !WINDOWS_BATCH_EXTENSIONS.has(extension)) return {
2500
+ command,
2501
+ args
2502
+ };
2503
+ return {
2504
+ command: comspec,
2505
+ args: [
2506
+ "/d",
2507
+ "/s",
2508
+ "/v:off",
2509
+ "/c",
2510
+ `"${[command, ...args].map(quoteCmdToken).join(" ")}"`
2511
+ ],
2512
+ windowsVerbatimArguments: true
2513
+ };
2514
+ }
2515
+ //#endregion
2480
2516
  //#region src/llm/cli.ts
2481
2517
  /**
2482
2518
  * Local authenticated CLI providers. These CLIs receive the complete review
@@ -2520,11 +2556,13 @@ function sanitizeStderr(stderr) {
2520
2556
  }
2521
2557
  function runCli({ command, args, cwd, input, timeoutMs, label, env, keepCredentialEnvKeys }) {
2522
2558
  return new Promise((resolve, reject) => {
2523
- const child = spawn(command, args, {
2559
+ const target = buildCliSpawnTarget(command, args);
2560
+ const child = spawn(target.command, target.args, {
2524
2561
  cwd,
2525
2562
  env: createChildEnv(env, keepCredentialEnvKeys),
2526
2563
  shell: false,
2527
2564
  windowsHide: true,
2565
+ ...target.windowsVerbatimArguments ? { windowsVerbatimArguments: true } : {},
2528
2566
  stdio: [
2529
2567
  "pipe",
2530
2568
  "pipe",
@@ -3030,10 +3068,6 @@ function commandSearchBases(command) {
3030
3068
  if (isAbsolute(command) || command.includes("/") || command.includes("\\")) return [resolve(command)];
3031
3069
  return (process.env.PATH ?? process.env.Path ?? "").split(delimiter).filter(Boolean).map((dir) => join(dir, command));
3032
3070
  }
3033
- function executableExtensions(command, isWindows) {
3034
- if (!isWindows || extname(command)) return [""];
3035
- return (process.env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((extension) => [".COM", ".EXE"].includes(extension.toUpperCase()));
3036
- }
3037
3071
  function canExecute(path, isWindows) {
3038
3072
  try {
3039
3073
  accessSync(path, isWindows ? constants.F_OK : constants.X_OK);
@@ -8,6 +8,8 @@ The CLI is installed locally, but its model request still goes to the provider.
8
8
 
9
9
  When `CRITIC_PROVIDER` is empty or unset, Vibe-Gate checks local CLI executables in this order: Codex (`codex`), Claude Code (`claude`), Cursor Agent (`agent`, then legacy `cursor-agent`), and OpenCode CLI (`opencode`). OpenCode CLI is considered only with a `provider/model` `CRITIC_MODEL`, and that model format moves it to the front of the default order. Configured `*_CLI_PATH` values are checked before default PATH names, using the same provider order. The first tool response reports the selected CLI in `providerNotice`. Detection checks whether the executable is available; it does not verify that the CLI is signed in. If the selected CLI needs login, Vibe-Gate returns its error and does not switch to another account or service. If no local CLI is found, Vibe-Gate retains its OpenAI default and requires `OPENAI_API_KEY`. Set `CRITIC_PROVIDER` to select a provider explicitly.
10
10
 
11
+ On Windows, discovery follows `PATHEXT` for `.COM`, `.EXE`, `.BAT`, and `.CMD` files. Batch shims (`.bat` and `.cmd`) run through `cmd.exe`; native executables run directly.
12
+
11
13
  | `CRITIC_PROVIDER` | Command | Sign in | Model selection |
12
14
  | ----------------- | ----------------------------------------- | ---------------------------------------------- | -------------------------------------------------- |
13
15
  | `codex-cli` | `codex` | `codex login` | Optional `CRITIC_MODEL` |
@@ -16,7 +16,7 @@
16
16
 
17
17
  ### Local CLI not found or not authenticated
18
18
 
19
- **Cause:** IDE-launched MCP servers may have a shorter `PATH` than an interactive terminal, or the CLI may not have an account session for this OS user.
19
+ **Cause:** IDE-launched MCP servers may have a shorter `PATH` than an interactive terminal, or the CLI may not have an account session for this OS user. On Windows, the CLI shim may be a `.cmd` or `.bat` file listed in `PATHEXT`.
20
20
 
21
21
  **Fix:** Run the CLI's login flow in a terminal as the same user running the IDE, then set its matching `*_CLI_PATH` to the absolute executable path if needed. For Cursor, `cursor-agent` remains the `CRITIC_PROVIDER` value, while the current executable is `agent`; `cursor-agent` is only a legacy fallback. For Claude Code, `claude auth login` defaults to Claude subscription sign-in; `--console` selects API billing. See [CLI_PROVIDERS.md](CLI_PROVIDERS.md) for provider-specific setup.
22
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-gate-mcp",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "type": "module",
5
5
  "description": "Adversarial Quality Gate MCP for vibe-coding: IDE AI vs Critic AI, human decides on deadlock",
6
6
  "license": "MIT",