polydev-ai 1.9.4 → 1.9.6
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 +9 -0
- package/mcp/stdio-wrapper.js +9 -7
- package/package.json +1 -1
package/lib/cliManager.js
CHANGED
|
@@ -208,6 +208,15 @@ class CLIManager {
|
|
|
208
208
|
if (process.env.POLYDEV_CLI_DEBUG) {
|
|
209
209
|
console.log(`[CLI Debug] File-based auth check for ${provider.id}:`, authenticated);
|
|
210
210
|
}
|
|
211
|
+
} else if (provider.id === 'gemini_cli') {
|
|
212
|
+
// Gemini CLI has no 'auth-status' subcommand — 'gemini auth-status' hangs/times out.
|
|
213
|
+
// Use file-based auth directly (checks ~/.gemini/oauth_creds.json for tokens)
|
|
214
|
+
authenticated = await this.checkAuthenticationByFiles(provider.id);
|
|
215
|
+
|
|
216
|
+
if (process.env.POLYDEV_CLI_DEBUG) {
|
|
217
|
+
console.log(`[CLI Debug] File-based auth check for ${provider.id}:`, authenticated);
|
|
218
|
+
}
|
|
219
|
+
// Note: quota exhaustion is detected at prompt time, not during detection
|
|
211
220
|
} else {
|
|
212
221
|
// For other providers, try command-based auth check first
|
|
213
222
|
try {
|
package/mcp/stdio-wrapper.js
CHANGED
|
@@ -1472,7 +1472,7 @@ Error: ${error.message}`
|
|
|
1472
1472
|
const { available: availableClis } = await this.getAllAvailableProviders();
|
|
1473
1473
|
console.error(`[Stdio Wrapper] Available CLIs: ${availableClis.join(', ') || 'none'}`);
|
|
1474
1474
|
|
|
1475
|
-
//
|
|
1475
|
+
// Get all providers from dashboard (user's configured providers + CLI-only)
|
|
1476
1476
|
const allProviders = this.allProviders || [];
|
|
1477
1477
|
|
|
1478
1478
|
// CLI to provider name mapping
|
|
@@ -1510,22 +1510,24 @@ Error: ${error.message}`
|
|
|
1510
1510
|
const providerName = cliToProviderMap[cliId];
|
|
1511
1511
|
usedProviderNames.add(providerName);
|
|
1512
1512
|
|
|
1513
|
-
// Check if user has a configured model for this provider
|
|
1514
|
-
//
|
|
1513
|
+
// Check if user has a configured model for this provider from their OWN API keys
|
|
1514
|
+
// IMPORTANT: Do NOT use credits-tier model names (they're internal to Polydev's API
|
|
1515
|
+
// and don't match CLI model names, e.g. 'gemini-3-flash' → ModelNotFoundError)
|
|
1516
|
+
// API key entries have no 'tier' field, credits entries have tier='normal'/'eco'/'premium'
|
|
1515
1517
|
const configuredProvider = allProviders.find(p => {
|
|
1516
1518
|
const normalized = normalizeProvider(p.provider);
|
|
1517
|
-
return normalized === providerName;
|
|
1519
|
+
return normalized === providerName && !p.tier; // Only match user's own API keys (no tier)
|
|
1518
1520
|
});
|
|
1519
1521
|
|
|
1520
1522
|
finalProviders.push({
|
|
1521
1523
|
provider: providerName,
|
|
1522
|
-
model: configuredProvider?.model || null,
|
|
1524
|
+
model: configuredProvider?.model || null, // null = use CLI's default model
|
|
1523
1525
|
cliId: cliId,
|
|
1524
1526
|
source: 'cli',
|
|
1525
|
-
tier:
|
|
1527
|
+
tier: null // CLIs don't use credits tiers
|
|
1526
1528
|
});
|
|
1527
1529
|
|
|
1528
|
-
console.error(`[Stdio Wrapper] [CLI-FIRST] Added CLI: ${cliId} (${providerName})${configuredProvider ? ` with
|
|
1530
|
+
console.error(`[Stdio Wrapper] [CLI-FIRST] Added CLI: ${cliId} (${providerName})${configuredProvider ? ` with user API key model: ${configuredProvider.model}` : ' with CLI default'}`);
|
|
1529
1531
|
}
|
|
1530
1532
|
|
|
1531
1533
|
// STEP 2: Fill remaining slots with API/credits providers (skip those already covered by CLI)
|