polydev-ai 1.10.14 → 1.10.15

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.
Files changed (2) hide show
  1. package/lib/cliManager.js +81 -69
  2. package/package.json +1 -1
package/lib/cliManager.js CHANGED
@@ -56,7 +56,7 @@ class CLIManager {
56
56
  chat: [],
57
57
  version: ['--version'],
58
58
  auth_status: ['--print', 'test auth'], // Use --print to test auth
59
- test_prompt: ['--print', '--output-format', 'json'] // Use JSON output to get model info
59
+ test_prompt: ['--print', '--output-format', 'json', '--max-turns', '1'] // JSON output, single turn (no tool calls)
60
60
  },
61
61
  install_instructions: 'Install via: npm install -g @anthropic-ai/claude-code',
62
62
  auth_instructions: 'Authenticate with Claude Code'
@@ -846,29 +846,33 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
846
846
  // Explicitly pass environment to ensure HOME is available for CLI tools
847
847
  // that read config from ~/.config or similar paths (e.g., Gemini CLI)
848
848
  // Also include flags to suppress update prompts and browser opening
849
- env: {
850
- ...process.env,
851
- HOME: process.env.HOME || os.homedir(),
852
- // Strip API keys that could override CLI OAuth auth
853
- ANTHROPIC_API_KEY: '',
854
- // Suppress interactive prompts and update checks
855
- NO_COLOR: '1',
856
- TERM: 'dumb',
857
- NONINTERACTIVE: '1',
858
- // Prevent browser opening (OAuth, updates, etc.)
859
- NO_BROWSER: '1',
860
- BROWSER: 'echo', // Redirect browser opening to no-op
861
- DISPLAY: '', // Prevent X11 browser opening
862
- HEADLESS: '1',
863
- // CLI-specific flags to suppress updates
864
- CODEX_DISABLE_UPDATE_CHECK: '1',
865
- CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
866
- GEMINI_NO_BROWSER: '1',
867
- GOOGLE_NO_BROWSER: '1',
868
- // Prevent package manager update prompts
869
- npm_config_update_notifier: 'false',
870
- NO_UPDATE_NOTIFIER: '1'
871
- }
849
+ env: (() => {
850
+ const env = {
851
+ ...process.env,
852
+ HOME: process.env.HOME || os.homedir(),
853
+ // Suppress interactive prompts and update checks
854
+ NO_COLOR: '1',
855
+ TERM: 'dumb',
856
+ NONINTERACTIVE: '1',
857
+ // Prevent browser opening (OAuth, updates, etc.)
858
+ NO_BROWSER: '1',
859
+ BROWSER: 'echo', // Redirect browser opening to no-op
860
+ DISPLAY: '', // Prevent X11 browser opening
861
+ HEADLESS: '1',
862
+ // CLI-specific flags to suppress updates
863
+ CODEX_DISABLE_UPDATE_CHECK: '1',
864
+ CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
865
+ GEMINI_NO_BROWSER: '1',
866
+ GOOGLE_NO_BROWSER: '1',
867
+ // Prevent package manager update prompts
868
+ npm_config_update_notifier: 'false',
869
+ NO_UPDATE_NOTIFIER: '1'
870
+ };
871
+ // Fully remove ANTHROPIC_API_KEY — empty string still triggers
872
+ // Claude CLI's "Invalid API key" error (GitHub #8327)
873
+ delete env.ANTHROPIC_API_KEY;
874
+ return env;
875
+ })()
872
876
  });
873
877
 
874
878
  if (child.stdin) {
@@ -1154,29 +1158,33 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1154
1158
  const child = spawn(executable, args, {
1155
1159
  stdio: ['pipe', 'pipe', 'pipe'],
1156
1160
  shell: process.platform === 'win32',
1157
- env: {
1158
- ...process.env,
1159
- TMPDIR: tmpDir,
1160
- TEMP: tmpDir,
1161
- TMP: tmpDir,
1162
- HOME: process.env.HOME || os.homedir(),
1163
- // Strip API keys that could override CLI OAuth auth
1164
- ANTHROPIC_API_KEY: '',
1165
- // Suppress interactive prompts and update checks
1166
- NO_COLOR: '1',
1167
- TERM: 'dumb',
1168
- NONINTERACTIVE: '1',
1169
- // Prevent browser opening (OAuth, updates, etc.)
1170
- NO_BROWSER: '1',
1171
- BROWSER: 'echo',
1172
- DISPLAY: '',
1173
- HEADLESS: '1',
1174
- // CLI-specific flags to suppress updates
1175
- CODEX_DISABLE_UPDATE_CHECK: '1',
1176
- // Prevent package manager update prompts
1177
- npm_config_update_notifier: 'false',
1178
- NO_UPDATE_NOTIFIER: '1'
1179
- }
1161
+ env: (() => {
1162
+ const env = {
1163
+ ...process.env,
1164
+ TMPDIR: tmpDir,
1165
+ TEMP: tmpDir,
1166
+ TMP: tmpDir,
1167
+ HOME: process.env.HOME || os.homedir(),
1168
+ // Suppress interactive prompts and update checks
1169
+ NO_COLOR: '1',
1170
+ TERM: 'dumb',
1171
+ NONINTERACTIVE: '1',
1172
+ // Prevent browser opening (OAuth, updates, etc.)
1173
+ NO_BROWSER: '1',
1174
+ BROWSER: 'echo',
1175
+ DISPLAY: '',
1176
+ HEADLESS: '1',
1177
+ // CLI-specific flags to suppress updates
1178
+ CODEX_DISABLE_UPDATE_CHECK: '1',
1179
+ // Prevent package manager update prompts
1180
+ npm_config_update_notifier: 'false',
1181
+ NO_UPDATE_NOTIFIER: '1'
1182
+ };
1183
+ // Fully remove ANTHROPIC_API_KEY — empty string still triggers
1184
+ // Claude CLI's "Invalid API key" error (GitHub #8327)
1185
+ delete env.ANTHROPIC_API_KEY;
1186
+ return env;
1187
+ })()
1180
1188
  });
1181
1189
 
1182
1190
  console.log(`[CLI Debug] Spawning Codex process: ${executable} ${args.join(' ')}`);
@@ -1421,7 +1429,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1421
1429
  */
1422
1430
  buildStreamingArgs(providerId, prompt, model = null) {
1423
1431
  if (providerId === 'claude_code') {
1424
- const args = ['-p', '--output-format', 'stream-json', '--verbose', '--include-partial-messages'];
1432
+ const args = ['-p', '--output-format', 'stream-json', '--verbose', '--include-partial-messages', '--max-turns', '1'];
1425
1433
 
1426
1434
  // Add model flag if specified
1427
1435
  if (model) {
@@ -1486,27 +1494,31 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1486
1494
  const child = spawn(provider.command, args, {
1487
1495
  stdio: ['pipe', 'pipe', 'pipe'],
1488
1496
  shell: process.platform === 'win32',
1489
- env: {
1490
- ...process.env,
1491
- HOME: process.env.HOME || os.homedir(),
1492
- // Strip API keys that could override CLI OAuth auth
1493
- ANTHROPIC_API_KEY: '',
1494
- // Suppress interactive prompts and update checks
1495
- NO_COLOR: '1',
1496
- TERM: 'dumb',
1497
- NONINTERACTIVE: '1',
1498
- // Prevent browser opening (OAuth, updates, etc.)
1499
- NO_BROWSER: '1',
1500
- BROWSER: 'echo',
1501
- DISPLAY: '',
1502
- HEADLESS: '1',
1503
- CODEX_DISABLE_UPDATE_CHECK: '1',
1504
- CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
1505
- GEMINI_NO_BROWSER: '1',
1506
- GOOGLE_NO_BROWSER: '1',
1507
- npm_config_update_notifier: 'false',
1508
- NO_UPDATE_NOTIFIER: '1'
1509
- }
1497
+ env: (() => {
1498
+ const env = {
1499
+ ...process.env,
1500
+ HOME: process.env.HOME || os.homedir(),
1501
+ // Suppress interactive prompts and update checks
1502
+ NO_COLOR: '1',
1503
+ TERM: 'dumb',
1504
+ NONINTERACTIVE: '1',
1505
+ // Prevent browser opening (OAuth, updates, etc.)
1506
+ NO_BROWSER: '1',
1507
+ BROWSER: 'echo',
1508
+ DISPLAY: '',
1509
+ HEADLESS: '1',
1510
+ CODEX_DISABLE_UPDATE_CHECK: '1',
1511
+ CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
1512
+ GEMINI_NO_BROWSER: '1',
1513
+ GOOGLE_NO_BROWSER: '1',
1514
+ npm_config_update_notifier: 'false',
1515
+ NO_UPDATE_NOTIFIER: '1'
1516
+ };
1517
+ // Fully remove ANTHROPIC_API_KEY — empty string still triggers
1518
+ // Claude CLI's "Invalid API key" error (GitHub #8327)
1519
+ delete env.ANTHROPIC_API_KEY;
1520
+ return env;
1521
+ })()
1510
1522
  });
1511
1523
 
1512
1524
  // Close stdin immediately to prevent hanging (critical for Gemini CLI)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.10.14",
3
+ "version": "1.10.15",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },