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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.7.74",
3
+ "version": "2.7.76",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -141,21 +141,18 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
141
141
  console.log(chalk.green(' ✓ CLIPROXYAPI IS RUNNING'));
142
142
  }
143
143
 
144
- // Check if provider supports OAuth
145
- const oauthProviders = ['anthropic', 'openai', 'google', 'qwen'];
146
- if (!oauthProviders.includes(provider.id)) {
147
- // Try to fetch models directly
148
- console.log(chalk.gray(` CHECKING AVAILABLE MODELS FOR ${provider.name.toUpperCase()}...`));
149
- const modelsResult = await cliproxy.fetchProviderModels(provider.id);
150
-
151
- if (!modelsResult.success || modelsResult.models.length === 0) {
152
- console.log(chalk.red(` NO MODELS AVAILABLE FOR ${provider.name.toUpperCase()}`));
153
- console.log(chalk.gray(' THIS PROVIDER MAY REQUIRE API KEY CONNECTION.'));
154
- await prompts.waitForEnter();
155
- return false;
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);