polydev-ai 1.10.8 → 1.10.10
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.
- package/lib/cliManager.js +3 -1
- package/lib/tunnelClient.js +31 -10
- package/package.json +2 -2
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',
|
package/lib/tunnelClient.js
CHANGED
|
@@ -273,16 +273,37 @@ class TunnelClient {
|
|
|
273
273
|
const latencyMs = Date.now() - startTime;
|
|
274
274
|
|
|
275
275
|
if (result.success) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
276
|
+
// Detect CLI error responses returned as "successful" content
|
|
277
|
+
// (e.g., claude_code returns "Invalid API key" with success=true)
|
|
278
|
+
const content = result.content || '';
|
|
279
|
+
const CLI_ERROR_PATTERNS = [
|
|
280
|
+
'Invalid API key',
|
|
281
|
+
'Authentication required',
|
|
282
|
+
'Please sign in',
|
|
283
|
+
'rate limit exceeded',
|
|
284
|
+
'quota exceeded',
|
|
285
|
+
];
|
|
286
|
+
const isErrorContent = CLI_ERROR_PATTERNS.some(p => content.includes(p));
|
|
287
|
+
|
|
288
|
+
if (isErrorContent) {
|
|
289
|
+
console.error(`[Tunnel] Request ${request.id} CLI returned error as content: ${content.substring(0, 100)}`);
|
|
290
|
+
await this.sendResponse({
|
|
291
|
+
request_id: request.id,
|
|
292
|
+
error: `CLI auth error: ${content}. Re-authenticate your ${request.provider} CLI.`,
|
|
293
|
+
latency_ms: latencyMs,
|
|
294
|
+
});
|
|
295
|
+
} else {
|
|
296
|
+
console.error(`[Tunnel] Request ${request.id} completed (${latencyMs}ms)`);
|
|
297
|
+
await this.sendResponse({
|
|
298
|
+
request_id: request.id,
|
|
299
|
+
content,
|
|
300
|
+
model_used: result.model || result.detectedModel || request.provider,
|
|
301
|
+
tokens_used: result.tokens_used || null,
|
|
302
|
+
input_tokens: result.input_tokens || null,
|
|
303
|
+
output_tokens: result.output_tokens || null,
|
|
304
|
+
latency_ms: latencyMs,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
286
307
|
} else {
|
|
287
308
|
console.error(`[Tunnel] Request ${request.id} CLI error: ${result.error}`);
|
|
288
309
|
await this.sendResponse({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "polydev-ai",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.10",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.x <=22.x"
|
|
6
6
|
},
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"marked": "^16.2.1",
|
|
83
83
|
"next": "^15.5.7",
|
|
84
84
|
"open": "^11.0.0",
|
|
85
|
-
"polydev-ai": "^1.10.
|
|
85
|
+
"polydev-ai": "^1.10.8",
|
|
86
86
|
"posthog-js": "^1.157.2",
|
|
87
87
|
"prismjs": "^1.30.0",
|
|
88
88
|
"react": "^18.3.1",
|