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 +1 -1
- package/src/app.js +1 -4
- package/src/pages/ai-agents.js +9 -45
package/package.json
CHANGED
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
|
-
|
|
178
|
+
spinner.stop();
|
|
182
179
|
|
|
183
180
|
// Main loop
|
|
184
181
|
while (true) {
|
package/src/pages/ai-agents.js
CHANGED
|
@@ -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
|
-
//
|
|
244
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
285
|
-
|
|
286
|
-
|
|
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
|
|
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
|
-
|
|
300
|
-
|
|
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
|
};
|