hedgequantx 2.7.45 → 2.7.47

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.45",
3
+ "version": "2.7.47",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
package/src/app.js CHANGED
@@ -173,12 +173,9 @@ const run = async () => {
173
173
  if (restored) {
174
174
  currentService = connections.getAll()[0].service;
175
175
  await refreshStats();
176
- spinner.succeed('SESSION RESTORED');
177
- } else {
178
- spinner.stop();
179
176
  }
180
177
 
181
- await new Promise(r => setTimeout(r, 500));
178
+ spinner.stop();
182
179
 
183
180
  // Main loop
184
181
  while (true) {
@@ -227,9 +227,6 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
227
227
  return false;
228
228
  }
229
229
 
230
- // Wait for token to be saved
231
- await new Promise(r => setTimeout(r, 3000));
232
-
233
230
  } else {
234
231
  console.log(chalk.gray(' AFTER AUTHENTICATING, PRESS ENTER TO CONTINUE...'));
235
232
  await prompts.waitForEnter();
@@ -240,40 +237,10 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
240
237
  try { loginResult.childProcess.kill(); } catch (e) { /* ignore */ }
241
238
  }
242
239
 
243
- // Restart CLIProxyAPI to load new tokens
244
- const restartSpinner = ora({ text: 'RESTARTING CLIPROXYAPI...', color: 'yellow' }).start();
245
- await cliproxy.stop();
246
- await new Promise(r => setTimeout(r, 2000));
247
- await cliproxy.start();
248
-
249
- // Wait for CLIProxyAPI to be fully ready with models loaded
250
- restartSpinner.text = 'WAITING FOR CLIPROXYAPI TO LOAD TOKENS...';
251
- let modelsResult = { success: false, models: [] };
252
-
253
- let foundModels = false;
254
- for (let i = 0; i < 15; i++) {
255
- await new Promise(r => setTimeout(r, 2000));
256
- restartSpinner.text = `WAITING FOR MODELS... (${(i + 1) * 2}S)`;
257
-
258
- const status = await cliproxy.isRunning();
259
- if (status.running) {
260
- // Check if models are available (tokens loaded)
261
- modelsResult = await cliproxy.fetchProviderModels(provider.id);
262
- if (modelsResult.success && modelsResult.models.length > 0) {
263
- restartSpinner.succeed(`${modelsResult.models.length} MODELS AVAILABLE`);
264
- foundModels = true;
265
- break;
266
- }
267
- }
268
- }
240
+ // Fetch models directly from CLIProxy
241
+ const modelsResult = await cliproxy.fetchProviderModels(provider.id);
269
242
 
270
- // Stop spinner if still running (no models found after 30s)
271
- if (!foundModels) {
272
- restartSpinner.warn('MODELS NOT LOADED - USING AUTO MODE');
273
- }
274
-
275
- // Show model selection or fallback to auto
276
- if (foundModels && modelsResult.models.length > 0) {
243
+ if (modelsResult.success && modelsResult.models.length > 0) {
277
244
  const selectedModel = await selectModelFromList(provider, modelsResult.models, boxWidth);
278
245
  if (selectedModel) {
279
246
  activateProvider(config, provider.id, {
@@ -281,25 +248,22 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
281
248
  modelId: selectedModel.id,
282
249
  modelName: selectedModel.name
283
250
  });
284
- if (saveConfig(config)) {
285
- console.log(chalk.green(`\n ✓ ${provider.name.toUpperCase()} CONNECTED VIA PAID PLAN`));
286
- console.log(chalk.cyan(` MODEL: ${selectedModel.name.toUpperCase()}`));
287
- }
251
+ saveConfig(config);
252
+ console.log(chalk.green(`\n ✓ ${provider.name.toUpperCase()} CONNECTED`));
253
+ console.log(chalk.cyan(` MODEL: ${selectedModel.name.toUpperCase()}`));
288
254
  await prompts.waitForEnter();
289
255
  return true;
290
256
  }
291
257
  }
292
258
 
293
- // No models or user cancelled - use auto mode
259
+ // No models available - use auto mode
294
260
  activateProvider(config, provider.id, {
295
261
  connectionType: 'cliproxy',
296
262
  modelId: null,
297
263
  modelName: 'AUTO'
298
264
  });
299
- if (saveConfig(config)) {
300
- console.log(chalk.green(`\n ✓ ${provider.name.toUpperCase()} CONNECTED VIA PAID PLAN (AUTO MODE)`));
301
- }
302
-
265
+ saveConfig(config);
266
+ console.log(chalk.green(`\n ✓ ${provider.name.toUpperCase()} CONNECTED (AUTO MODE)`));
303
267
  await prompts.waitForEnter();
304
268
  return true;
305
269
  };