hedgequantx 2.6.113 → 2.6.115
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/menus/ai-agent.js +23 -9
package/package.json
CHANGED
package/src/menus/ai-agent.js
CHANGED
|
@@ -1044,20 +1044,34 @@ const setupProxyOAuth = async (provider, config) => {
|
|
|
1044
1044
|
|
|
1045
1045
|
// Use inquirer directly for reliable input on VPS
|
|
1046
1046
|
const inquirer = require('inquirer');
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1047
|
+
let callbackUrl = '';
|
|
1048
|
+
try {
|
|
1049
|
+
const result = await inquirer.prompt([{
|
|
1050
|
+
type: 'input',
|
|
1051
|
+
name: 'callbackUrl',
|
|
1052
|
+
message: 'Callback URL:',
|
|
1053
|
+
prefix: ' '
|
|
1054
|
+
}]);
|
|
1055
|
+
callbackUrl = result.callbackUrl || '';
|
|
1056
|
+
} catch (e) {
|
|
1057
|
+
// Inquirer failed, try readline directly
|
|
1058
|
+
const readline = require('readline');
|
|
1059
|
+
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
1060
|
+
callbackUrl = await new Promise(resolve => {
|
|
1061
|
+
rl.question(' Callback URL: ', answer => {
|
|
1062
|
+
rl.close();
|
|
1063
|
+
resolve(answer || '');
|
|
1064
|
+
});
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1053
1067
|
|
|
1054
1068
|
if (callbackUrl && callbackUrl.trim()) {
|
|
1055
1069
|
const submitSpinner = ora({ text: 'Submitting callback...', color: 'cyan' }).start();
|
|
1056
1070
|
try {
|
|
1057
1071
|
await proxyManager.submitCallback(callbackUrl.trim(), provider.id);
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
await
|
|
1072
|
+
// Callback succeeded - CLIProxyAPI handles the token exchange
|
|
1073
|
+
// No need to poll waitForAuth, the callback endpoint already did everything
|
|
1074
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
1061
1075
|
authSuccess = true;
|
|
1062
1076
|
submitSpinner.succeed('Authorization successful!');
|
|
1063
1077
|
} catch (submitError) {
|