hedgequantx 2.7.75 → 2.7.77

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.75",
3
+ "version": "2.7.77",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -125,7 +125,7 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
125
125
  spinner.succeed('CLIPROXYAPI INSTALLED');
126
126
  }
127
127
 
128
- // Check if running, start if not
128
+ // Check if running, start if not (or restart if config missing)
129
129
  let status = await cliproxy.isRunning();
130
130
  if (!status.running) {
131
131
  const spinner = ora({ text: 'STARTING CLIPROXYAPI...', color: 'yellow' }).start();
@@ -138,13 +138,31 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
138
138
  }
139
139
  spinner.succeed('CLIPROXYAPI STARTED');
140
140
  } else {
141
- console.log(chalk.green(' ✓ CLIPROXYAPI IS RUNNING'));
141
+ // Running, but check if config exists (for proper API key auth)
142
+ const configPath = require('path').join(require('os').homedir(), '.hqx', 'cliproxy', 'config.yaml');
143
+ if (!require('fs').existsSync(configPath)) {
144
+ console.log(chalk.yellow(' RESTARTING CLIPROXYAPI WITH PROPER CONFIG...'));
145
+ await cliproxy.stop();
146
+ const startResult = await cliproxy.start();
147
+ if (!startResult.success) {
148
+ console.log(chalk.red(` FAILED TO RESTART: ${startResult.error.toUpperCase()}`));
149
+ await prompts.waitForEnter();
150
+ return false;
151
+ }
152
+ console.log(chalk.green(' ✓ CLIPROXYAPI RESTARTED'));
153
+ } else {
154
+ console.log(chalk.green(' ✓ CLIPROXYAPI IS RUNNING'));
155
+ }
142
156
  }
143
157
 
144
158
  // First, check if models are already available (existing auth)
145
159
  console.log(chalk.gray(` CHECKING EXISTING AUTHENTICATION...`));
160
+
146
161
  const existingModels = await cliproxy.fetchProviderModels(provider.id);
147
162
 
163
+ // Debug output
164
+ console.log(chalk.gray(` > RESULT: success=${existingModels.success}, models=${existingModels.models?.length || 0}, error=${existingModels.error || 'none'}`));
165
+
148
166
  if (existingModels.success && existingModels.models.length > 0) {
149
167
  // Models already available - skip OAuth, go directly to model selection
150
168
  console.log(chalk.green(` ✓ ALREADY AUTHENTICATED`));