polydev-ai 1.5.3 → 1.6.0

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 +21 -3
  2. package/package.json +1 -1
package/lib/cliManager.js CHANGED
@@ -42,6 +42,9 @@ class CLIManager {
42
42
  id: 'claude_code',
43
43
  name: 'Claude Code',
44
44
  command: process.env.CLAUDE_CODE_PATH || 'claude',
45
+ // Model configuration: use env var or default to 'haiku' for speed
46
+ // Options: haiku (fastest), sonnet (balanced), opus (most capable)
47
+ model: process.env.POLYDEV_CLAUDE_MODEL || 'haiku',
45
48
  subcommands: {
46
49
  chat: [],
47
50
  version: ['--version'],
@@ -55,6 +58,9 @@ class CLIManager {
55
58
  id: 'codex_cli',
56
59
  name: 'Codex CLI',
57
60
  command: process.env.CODEX_CLI_PATH || 'codex',
61
+ // Model configuration: use env var or default to 'gpt-4o-mini' for speed
62
+ // Options: gpt-4o-mini (fastest), gpt-4o, o3-mini, o1, etc.
63
+ model: process.env.POLYDEV_CODEX_MODEL || 'gpt-4o-mini',
58
64
  subcommands: {
59
65
  chat: ['chat'],
60
66
  version: ['--version'],
@@ -72,6 +78,8 @@ class CLIManager {
72
78
  id: 'gemini_cli',
73
79
  name: 'Gemini CLI',
74
80
  command: process.env.GEMINI_CLI_PATH || 'gemini',
81
+ // Model configuration for Gemini
82
+ model: process.env.POLYDEV_GEMINI_MODEL || 'gemini-2.0-flash',
75
83
  subcommands: {
76
84
  chat: ['chat'],
77
85
  version: ['--version'],
@@ -437,13 +445,15 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
437
445
  if (providerId === 'codex_cli') {
438
446
  const execArgs = promptVariants.find(args => args.includes('exec')) || promptVariants[0];
439
447
  try {
440
- const content = await this.executeCodexExec(provider.command, execArgs, prompt, timeoutMs);
448
+ // Pass model configuration to Codex
449
+ const content = await this.executeCodexExec(provider.command, execArgs, prompt, timeoutMs, provider.model);
441
450
  return {
442
451
  success: true,
443
452
  content,
444
453
  tokens_used: this.estimateTokens(prompt + content),
445
454
  latency_ms: Date.now() - startTime,
446
455
  provider: providerId,
456
+ model: provider.model,
447
457
  mode: 'args',
448
458
  timestamp: new Date()
449
459
  };
@@ -453,6 +463,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
453
463
  error: `CLI execution failed: ${error instanceof Error ? error.message : String(error)}`,
454
464
  latency_ms: Date.now() - startTime,
455
465
  provider: providerId,
466
+ model: provider.model,
456
467
  mode,
457
468
  timestamp: new Date()
458
469
  };
@@ -462,7 +473,9 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
462
473
  let lastErrorMessage = null;
463
474
 
464
475
  for (const promptArgs of promptVariants) {
465
- const args = Array.isArray(promptArgs) ? [...promptArgs, prompt] : [prompt];
476
+ // Add model parameter for Claude Code
477
+ const modelArgs = provider.model ? ['--model', provider.model] : [];
478
+ const args = Array.isArray(promptArgs) ? [...promptArgs, ...modelArgs, prompt] : [...modelArgs, prompt];
466
479
  try {
467
480
  const result = await this.executeCliCommand(
468
481
  provider.command,
@@ -480,6 +493,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
480
493
  tokens_used: this.estimateTokens(prompt + content),
481
494
  latency_ms: Date.now() - startTime,
482
495
  provider: providerId,
496
+ model: provider.model,
483
497
  mode: 'args',
484
498
  timestamp: new Date()
485
499
  };
@@ -609,7 +623,7 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
609
623
  });
610
624
  }
611
625
 
612
- async executeCodexExec(executable, commandArgs, prompt, timeoutMs) {
626
+ async executeCodexExec(executable, commandArgs, prompt, timeoutMs, model) {
613
627
  if (!executable) {
614
628
  throw new Error('Missing Codex executable');
615
629
  }
@@ -619,8 +633,12 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
619
633
  }
620
634
 
621
635
  const workingDir = process.cwd();
636
+
637
+ // Build args with model configuration if specified
638
+ const modelArgs = model ? ['-c', `model="${model}"`] : [];
622
639
  const args = [
623
640
  ...commandArgs,
641
+ ...modelArgs,
624
642
  '--sandbox',
625
643
  'workspace-write',
626
644
  '--skip-git-repo-check',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "Agentic workflow assistant with CLI integration - get diverse perspectives from multiple LLMs when stuck or need enhanced reasoning",
5
5
  "keywords": [
6
6
  "mcp",