@hunyed15/codecgc 0.1.11 → 0.1.12

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.
@@ -156,6 +156,29 @@ def _terminate_process_tree(process: subprocess.Popen[str]) -> None:
156
156
  process.kill()
157
157
 
158
158
 
159
+ GEMINI_JS_RELATIVE = Path("node_modules") / "@google" / "gemini-cli" / "bundle" / "gemini.js"
160
+
161
+
162
+ def _resolve_gemini_command(cmd: list[str]) -> list[str]:
163
+ """Resolve the gemini CLI command, preferring direct node invocation on Windows."""
164
+ gemini_shim = shutil.which("gemini") or cmd[0]
165
+
166
+ if os.name == "nt":
167
+ shim_dir = Path(gemini_shim).parent
168
+ gemini_js = shim_dir / GEMINI_JS_RELATIVE
169
+ if gemini_js.is_file():
170
+ node_path = shutil.which("node") or "node"
171
+ return [node_path, str(gemini_js)] + cmd[1:]
172
+
173
+ if gemini_shim.lower().endswith((".cmd", ".bat")):
174
+ from subprocess import list2cmdline
175
+ cmd[0] = gemini_shim
176
+ return ["cmd.exe", "/s", "/c", list2cmdline(cmd)]
177
+
178
+ cmd[0] = gemini_shim
179
+ return cmd
180
+
181
+
159
182
  def run_shell_command(
160
183
  cmd: list[str],
161
184
  cwd: str | None = None,
@@ -171,14 +194,7 @@ def run_shell_command(
171
194
  Yields:
172
195
  Output lines from the command
173
196
  """
174
- popen_cmd = cmd
175
-
176
- gemini_path = shutil.which("gemini") or cmd[0]
177
- popen_cmd[0] = gemini_path
178
-
179
- if os.name == "nt" and gemini_path.lower().endswith((".cmd", ".bat")):
180
- from subprocess import list2cmdline
181
- popen_cmd = ["cmd.exe", "/s", "/c", list2cmdline(cmd)]
197
+ popen_cmd = _resolve_gemini_command(cmd)
182
198
 
183
199
  process = subprocess.Popen(
184
200
  popen_cmd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunyed15/codecgc",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Claude-hosted multi-model workflow product shell for CodeCGC.",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",