polydev-ai 1.10.13 → 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 -67
  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,30 +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
- // Suppress interactive prompts and update checks
853
- // NOTE: Do NOT set CI=1 here — it forces Claude Code into API key mode,
854
- // skipping OAuth/keychain auth entirely (see GitHub issues #9694, #23568).
855
- // NONINTERACTIVE + NO_BROWSER + HEADLESS + --print are sufficient.
856
- NO_COLOR: '1',
857
- TERM: 'dumb',
858
- NONINTERACTIVE: '1',
859
- // Prevent browser opening (OAuth, updates, etc.)
860
- NO_BROWSER: '1',
861
- BROWSER: 'echo', // Redirect browser opening to no-op
862
- DISPLAY: '', // Prevent X11 browser opening
863
- HEADLESS: '1',
864
- // CLI-specific flags to suppress updates
865
- CODEX_DISABLE_UPDATE_CHECK: '1',
866
- CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
867
- GEMINI_NO_BROWSER: '1',
868
- GOOGLE_NO_BROWSER: '1',
869
- // Prevent package manager update prompts
870
- npm_config_update_notifier: 'false',
871
- NO_UPDATE_NOTIFIER: '1'
872
- }
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
+ })()
873
876
  });
874
877
 
875
878
  if (child.stdin) {
@@ -1155,27 +1158,33 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1155
1158
  const child = spawn(executable, args, {
1156
1159
  stdio: ['pipe', 'pipe', 'pipe'],
1157
1160
  shell: process.platform === 'win32',
1158
- env: {
1159
- ...process.env,
1160
- TMPDIR: tmpDir,
1161
- TEMP: tmpDir,
1162
- TMP: tmpDir,
1163
- HOME: process.env.HOME || os.homedir(),
1164
- // Suppress interactive prompts and update checks
1165
- NO_COLOR: '1',
1166
- TERM: 'dumb',
1167
- NONINTERACTIVE: '1',
1168
- // Prevent browser opening (OAuth, updates, etc.)
1169
- NO_BROWSER: '1',
1170
- BROWSER: 'echo',
1171
- DISPLAY: '',
1172
- HEADLESS: '1',
1173
- // CLI-specific flags to suppress updates
1174
- CODEX_DISABLE_UPDATE_CHECK: '1',
1175
- // Prevent package manager update prompts
1176
- npm_config_update_notifier: 'false',
1177
- NO_UPDATE_NOTIFIER: '1'
1178
- }
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
+ })()
1179
1188
  });
1180
1189
 
1181
1190
  console.log(`[CLI Debug] Spawning Codex process: ${executable} ${args.join(' ')}`);
@@ -1420,7 +1429,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1420
1429
  */
1421
1430
  buildStreamingArgs(providerId, prompt, model = null) {
1422
1431
  if (providerId === 'claude_code') {
1423
- 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'];
1424
1433
 
1425
1434
  // Add model flag if specified
1426
1435
  if (model) {
@@ -1485,26 +1494,31 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1485
1494
  const child = spawn(provider.command, args, {
1486
1495
  stdio: ['pipe', 'pipe', 'pipe'],
1487
1496
  shell: process.platform === 'win32',
1488
- env: {
1489
- ...process.env,
1490
- HOME: process.env.HOME || os.homedir(),
1491
- // Suppress interactive prompts and update checks
1492
- // NOTE: Do NOT set CI=1 — it forces Claude Code into API key mode (GitHub #9694, #23568)
1493
- NO_COLOR: '1',
1494
- TERM: 'dumb',
1495
- NONINTERACTIVE: '1',
1496
- // Prevent browser opening (OAuth, updates, etc.)
1497
- NO_BROWSER: '1',
1498
- BROWSER: 'echo',
1499
- DISPLAY: '',
1500
- HEADLESS: '1',
1501
- CODEX_DISABLE_UPDATE_CHECK: '1',
1502
- CLAUDE_CODE_DISABLE_UPDATE_CHECK: '1',
1503
- GEMINI_NO_BROWSER: '1',
1504
- GOOGLE_NO_BROWSER: '1',
1505
- npm_config_update_notifier: 'false',
1506
- NO_UPDATE_NOTIFIER: '1'
1507
- }
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
+ })()
1508
1522
  });
1509
1523
 
1510
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.13",
3
+ "version": "1.10.15",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },