@hunyed15/codecgc 0.1.10 → 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,
@@ -286,8 +302,12 @@ def _execute_gemini_session(
286
302
  "--skip-trust",
287
303
  "--approval-mode",
288
304
  DEFAULT_GEMINI_APPROVAL_MODE,
305
+ "--prompt",
306
+ prompt,
289
307
  "-o",
290
308
  "stream-json",
309
+ "--allowed-mcp-server-names",
310
+ "__codecgc_none__",
291
311
  ]
292
312
 
293
313
  project_policy = _resolve_project_gemini_policy(cd)
@@ -303,8 +323,6 @@ def _execute_gemini_session(
303
323
  if session_id:
304
324
  cmd.extend(["--resume", session_id])
305
325
 
306
- cmd.append(prompt)
307
-
308
326
  gemini_env = {**os.environ, "GEMINI_CLI_TRUST_WORKSPACE": "true"}
309
327
 
310
328
  all_messages = []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunyed15/codecgc",
3
- "version": "0.1.10",
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",