hedgequantx 2.7.61 → 2.7.63
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 +14 -22
package/package.json
CHANGED
package/src/pages/ai-agents.js
CHANGED
|
@@ -232,31 +232,23 @@ const handleCliProxyConnection = async (provider, config, boxWidth) => {
|
|
|
232
232
|
await prompts.waitForEnter();
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
//
|
|
235
|
+
// Wait for login process to save the auth file (it exits on its own after saving)
|
|
236
|
+
const spinner = ora({ text: 'SAVING CREDENTIALS...', color: 'yellow' }).start();
|
|
236
237
|
if (loginResult.childProcess) {
|
|
237
|
-
|
|
238
|
+
await new Promise((resolve) => {
|
|
239
|
+
const timeout = setTimeout(() => {
|
|
240
|
+
try { loginResult.childProcess.kill(); } catch (e) { /* ignore */ }
|
|
241
|
+
resolve();
|
|
242
|
+
}, 10000);
|
|
243
|
+
loginResult.childProcess.on('exit', () => {
|
|
244
|
+
clearTimeout(timeout);
|
|
245
|
+
resolve();
|
|
246
|
+
});
|
|
247
|
+
});
|
|
238
248
|
}
|
|
239
|
-
|
|
240
|
-
// Restart CLIProxy to load new tokens
|
|
241
|
-
const restartSpinner = ora({ text: 'RESTARTING CLIPROXY...', color: 'yellow' }).start();
|
|
242
|
-
await cliproxy.stop();
|
|
249
|
+
spinner.text = 'LOADING MODELS...';
|
|
243
250
|
await new Promise(r => setTimeout(r, 1000));
|
|
244
|
-
await cliproxy.
|
|
245
|
-
await new Promise(r => setTimeout(r, 2000));
|
|
246
|
-
restartSpinner.stop();
|
|
247
|
-
|
|
248
|
-
// Fetch models from CLIProxy (retry a few times if needed)
|
|
249
|
-
let modelsResult = { success: false, models: [] };
|
|
250
|
-
const spinner = ora({ text: 'LOADING MODELS...', color: 'yellow' }).start();
|
|
251
|
-
|
|
252
|
-
for (let i = 0; i < 10; i++) {
|
|
253
|
-
modelsResult = await cliproxy.fetchProviderModels(provider.id);
|
|
254
|
-
if (modelsResult.success && modelsResult.models.length > 0) {
|
|
255
|
-
spinner.stop();
|
|
256
|
-
break;
|
|
257
|
-
}
|
|
258
|
-
await new Promise(r => setTimeout(r, 1000));
|
|
259
|
-
}
|
|
251
|
+
const modelsResult = await cliproxy.fetchProviderModels(provider.id);
|
|
260
252
|
spinner.stop();
|
|
261
253
|
|
|
262
254
|
if (modelsResult.success && modelsResult.models.length > 0) {
|