hedgequantx 2.6.111 → 2.6.112
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
package/src/menus/ai-agent.js
CHANGED
|
@@ -1047,7 +1047,7 @@ const setupProxyOAuth = async (provider, config) => {
|
|
|
1047
1047
|
if (callbackUrl && callbackUrl.trim()) {
|
|
1048
1048
|
const submitSpinner = ora({ text: 'Submitting callback...', color: 'cyan' }).start();
|
|
1049
1049
|
try {
|
|
1050
|
-
await proxyManager.submitCallback(callbackUrl.trim());
|
|
1050
|
+
await proxyManager.submitCallback(callbackUrl.trim(), provider.id);
|
|
1051
1051
|
submitSpinner.text = 'Verifying authorization...';
|
|
1052
1052
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
1053
1053
|
await proxyManager.waitForAuth(authState, 10000, () => {});
|
|
@@ -532,11 +532,12 @@ const waitForAuth = async (state, timeoutMs = 300000, onStatus = () => {}) => {
|
|
|
532
532
|
|
|
533
533
|
/**
|
|
534
534
|
* Submit OAuth callback URL manually (for remote/VPS use)
|
|
535
|
-
* Extracts code and state from callback URL and submits to
|
|
535
|
+
* Extracts code and state from callback URL and submits to proxy via main port
|
|
536
536
|
* @param {string} callbackUrl - Full callback URL (http://localhost:54545/callback?code=xxx&state=yyy)
|
|
537
|
+
* @param {string} provider - Provider ID (anthropic, openai, gemini, qwen, iflow)
|
|
537
538
|
* @returns {Promise<boolean>}
|
|
538
539
|
*/
|
|
539
|
-
const submitCallback = async (callbackUrl) => {
|
|
540
|
+
const submitCallback = async (callbackUrl, provider = 'anthropic') => {
|
|
540
541
|
// Parse the callback URL
|
|
541
542
|
let url;
|
|
542
543
|
try {
|
|
@@ -552,13 +553,24 @@ const submitCallback = async (callbackUrl) => {
|
|
|
552
553
|
throw new Error('Missing code or state in callback URL');
|
|
553
554
|
}
|
|
554
555
|
|
|
555
|
-
//
|
|
556
|
+
// Map provider to callback endpoint
|
|
557
|
+
const callbackEndpoints = {
|
|
558
|
+
anthropic: '/anthropic/callback',
|
|
559
|
+
openai: '/codex/callback',
|
|
560
|
+
gemini: '/gemini/callback',
|
|
561
|
+
qwen: '/qwen/callback',
|
|
562
|
+
iflow: '/iflow/callback'
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
const endpoint = callbackEndpoints[provider] || '/anthropic/callback';
|
|
566
|
+
|
|
567
|
+
// Submit to proxy via main port (8317)
|
|
556
568
|
return new Promise((resolve, reject) => {
|
|
557
|
-
const callbackPath =
|
|
569
|
+
const callbackPath = `${endpoint}?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state)}`;
|
|
558
570
|
|
|
559
571
|
const req = http.request({
|
|
560
572
|
hostname: '127.0.0.1',
|
|
561
|
-
port:
|
|
573
|
+
port: PROXY_PORT,
|
|
562
574
|
path: callbackPath,
|
|
563
575
|
method: 'GET',
|
|
564
576
|
timeout: 30000
|