hedgequantx 2.7.74 → 2.7.76
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/package.json +1 -1
- package/src/pages/ai-agents.js +21 -15
package/package.json
CHANGED
package/src/pages/ai-agents.js
CHANGED
|
@@ -141,21 +141,18 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
141
141
|
console.log(chalk.green(' ✓ CLIPROXYAPI IS RUNNING'));
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
const selectedModel = await selectModelFromList(provider, modelsResult.models, boxWidth);
|
|
144
|
+
// First, check if models are already available (existing auth)
|
|
145
|
+
console.log(chalk.gray(` CHECKING EXISTING AUTHENTICATION...`));
|
|
146
|
+
|
|
147
|
+
const existingModels = await cliproxy.fetchProviderModels(provider.id);
|
|
148
|
+
|
|
149
|
+
// Debug output
|
|
150
|
+
console.log(chalk.gray(` > RESULT: success=${existingModels.success}, models=${existingModels.models?.length || 0}, error=${existingModels.error || 'none'}`));
|
|
151
|
+
|
|
152
|
+
if (existingModels.success && existingModels.models.length > 0) {
|
|
153
|
+
// Models already available - skip OAuth, go directly to model selection
|
|
154
|
+
console.log(chalk.green(` ✓ ALREADY AUTHENTICATED`));
|
|
155
|
+
const selectedModel = await selectModelFromList(provider, existingModels.models, boxWidth);
|
|
159
156
|
if (!selectedModel) return false;
|
|
160
157
|
|
|
161
158
|
activateProvider(config, provider.id, {
|
|
@@ -172,6 +169,15 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
172
169
|
return true;
|
|
173
170
|
}
|
|
174
171
|
|
|
172
|
+
// Check if provider supports OAuth
|
|
173
|
+
const oauthProviders = ['anthropic', 'openai', 'google', 'qwen'];
|
|
174
|
+
if (!oauthProviders.includes(provider.id)) {
|
|
175
|
+
console.log(chalk.red(` NO MODELS AVAILABLE FOR ${provider.name.toUpperCase()}`));
|
|
176
|
+
console.log(chalk.gray(' THIS PROVIDER MAY REQUIRE API KEY CONNECTION.'));
|
|
177
|
+
await prompts.waitForEnter();
|
|
178
|
+
return false;
|
|
179
|
+
}
|
|
180
|
+
|
|
175
181
|
// OAuth flow - get login URL
|
|
176
182
|
console.log(chalk.cyan(`\n STARTING OAUTH LOGIN FOR ${provider.name.toUpperCase()}...`));
|
|
177
183
|
const loginResult = await cliproxy.getLoginUrl(provider.id);
|