polydev-ai 1.10.9 → 1.10.11

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 +20 -2
  2. package/package.json +1 -1
package/lib/cliManager.js CHANGED
@@ -628,12 +628,14 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
628
628
  if (model && providerId === 'claude_code') {
629
629
  // Map common model names to Claude CLI aliases/full names
630
630
  const claudeModelMap = {
631
+ 'claude-opus-4-6': 'opus',
631
632
  'claude-opus-4-5': 'opus',
632
633
  'claude-opus-4.5': 'opus',
633
634
  'claude-4.5-opus': 'opus',
634
635
  'claude-opus-4-5-20250514': 'opus',
636
+ 'claude-sonnet-4-6': 'sonnet',
635
637
  'claude-sonnet-4-5': 'sonnet',
636
- 'claude-sonnet-4.5': 'sonnet',
638
+ 'claude-sonnet-4.5': 'sonnet',
637
639
  'claude-4.5-sonnet': 'sonnet',
638
640
  'claude-sonnet-4-5-20250514': 'sonnet',
639
641
  'claude-3-5-sonnet': 'sonnet',
@@ -685,6 +687,17 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
685
687
  // Special handling for Claude Code JSON output
686
688
  if (providerId === 'claude_code') {
687
689
  const jsonResult = this.parseClaudeCodeJsonResponse(result.stdout || '');
690
+ if (jsonResult && jsonResult.is_error) {
691
+ // CLI returned a structured error (e.g., "Invalid API key", "Failed to authenticate")
692
+ console.error(`[Polydev CLI] Claude Code CLI error: ${jsonResult.error}`);
693
+ return {
694
+ success: false,
695
+ error: `CLI error: ${jsonResult.error}`,
696
+ latency_ms: Date.now() - startTime,
697
+ provider: providerId,
698
+ timestamp: new Date()
699
+ };
700
+ }
688
701
  if (jsonResult) {
689
702
  console.log(`[Polydev CLI] Claude Code detected model: ${jsonResult.model_used} (from JSON output)`);
690
703
  return {
@@ -1041,7 +1054,12 @@ This is a known issue with @google/gemini-cli@0.3.4 and older Node.js versions.`
1041
1054
  if (json.type !== 'result' || !json.result) {
1042
1055
  return null;
1043
1056
  }
1044
-
1057
+
1058
+ // Check if CLI reported an error (e.g., "Invalid API key", "Failed to authenticate")
1059
+ if (json.is_error) {
1060
+ return { is_error: true, error: json.result };
1061
+ }
1062
+
1045
1063
  // Extract content
1046
1064
  const content = json.result;
1047
1065
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polydev-ai",
3
- "version": "1.10.9",
3
+ "version": "1.10.11",
4
4
  "engines": {
5
5
  "node": ">=20.x <=22.x"
6
6
  },