opencode-studio-server 1.12.4 → 1.12.6
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/index.js +23 -8
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1384,7 +1384,12 @@ app.get('/api/auth/providers', (req, res) => {
|
|
|
1384
1384
|
{ id: 'openai', name: 'OpenAI', type: 'api', description: 'GPT models' },
|
|
1385
1385
|
{ id: 'xai', name: 'xAI', type: 'api', description: 'Grok models' },
|
|
1386
1386
|
{ id: 'openrouter', name: 'OpenRouter', type: 'api', description: 'Unified LLM API' },
|
|
1387
|
-
{ id: 'github-copilot', name: 'GitHub Copilot', type: 'api', description: 'Copilot models' }
|
|
1387
|
+
{ id: 'github-copilot', name: 'GitHub Copilot', type: 'api', description: 'Copilot models' },
|
|
1388
|
+
{ id: 'mistral', name: 'Mistral AI', type: 'api', description: 'Mistral models' },
|
|
1389
|
+
{ id: 'deepseek', name: 'DeepSeek', type: 'api', description: 'DeepSeek models' },
|
|
1390
|
+
{ id: 'groq', name: 'Groq', type: 'api', description: 'LPU Inference' },
|
|
1391
|
+
{ id: 'amazon-bedrock', name: 'AWS Bedrock', type: 'api', description: 'Amazon Bedrock' },
|
|
1392
|
+
{ id: 'azure', name: 'Azure OpenAI', type: 'api', description: 'Azure OpenAI' }
|
|
1388
1393
|
];
|
|
1389
1394
|
res.json(providers);
|
|
1390
1395
|
});
|
|
@@ -1412,7 +1417,12 @@ app.get('/api/auth', (req, res) => {
|
|
|
1412
1417
|
{ id: 'openai', name: 'OpenAI', type: 'api' },
|
|
1413
1418
|
{ id: 'xai', name: 'xAI', type: 'api' },
|
|
1414
1419
|
{ id: 'openrouter', name: 'OpenRouter', type: 'api' },
|
|
1415
|
-
{ id: 'github-copilot', name: 'GitHub Copilot', type: 'api' }
|
|
1420
|
+
{ id: 'github-copilot', name: 'GitHub Copilot', type: 'api' },
|
|
1421
|
+
{ id: 'mistral', name: 'Mistral AI', type: 'api' },
|
|
1422
|
+
{ id: 'deepseek', name: 'DeepSeek', type: 'api' },
|
|
1423
|
+
{ id: 'groq', name: 'Groq', type: 'api' },
|
|
1424
|
+
{ id: 'amazon-bedrock', name: 'AWS Bedrock', type: 'api' },
|
|
1425
|
+
{ id: 'azure', name: 'Azure OpenAI', type: 'api' }
|
|
1416
1426
|
];
|
|
1417
1427
|
|
|
1418
1428
|
const opencodeCfg = loadConfig();
|
|
@@ -1873,13 +1883,17 @@ function importCurrentGoogleAuthToPool() {
|
|
|
1873
1883
|
if (studio.activeGooglePlugin !== 'antigravity') return;
|
|
1874
1884
|
|
|
1875
1885
|
const authCfg = loadAuthConfig();
|
|
1876
|
-
if (!authCfg
|
|
1886
|
+
if (!authCfg) return;
|
|
1887
|
+
|
|
1888
|
+
// Check google.antigravity first, then google
|
|
1889
|
+
const creds = authCfg['google.antigravity'] || authCfg.google;
|
|
1890
|
+
if (!creds || !creds.email) return;
|
|
1877
1891
|
|
|
1878
1892
|
const namespace = 'google.antigravity';
|
|
1879
1893
|
const profileDir = path.join(AUTH_PROFILES_DIR, namespace);
|
|
1880
1894
|
if (!fs.existsSync(profileDir)) fs.mkdirSync(profileDir, { recursive: true });
|
|
1881
1895
|
|
|
1882
|
-
const email =
|
|
1896
|
+
const email = creds.email;
|
|
1883
1897
|
const profilePath = path.join(profileDir, `${email}.json`);
|
|
1884
1898
|
|
|
1885
1899
|
// Check if we need to sync (new account or updated tokens)
|
|
@@ -1887,7 +1901,7 @@ function importCurrentGoogleAuthToPool() {
|
|
|
1887
1901
|
if (fs.existsSync(profilePath)) {
|
|
1888
1902
|
try {
|
|
1889
1903
|
const current = JSON.parse(fs.readFileSync(profilePath, 'utf8'));
|
|
1890
|
-
if (current.access_token ===
|
|
1904
|
+
if (current.access_token === creds.access_token) {
|
|
1891
1905
|
shouldSync = false;
|
|
1892
1906
|
}
|
|
1893
1907
|
} catch {
|
|
@@ -1897,12 +1911,13 @@ function importCurrentGoogleAuthToPool() {
|
|
|
1897
1911
|
|
|
1898
1912
|
if (shouldSync) {
|
|
1899
1913
|
console.log(`[Auth] Syncing Google login for ${email} to Antigravity pool.`);
|
|
1900
|
-
atomicWriteFileSync(profilePath, JSON.stringify(
|
|
1914
|
+
atomicWriteFileSync(profilePath, JSON.stringify(creds, null, 2));
|
|
1901
1915
|
|
|
1902
1916
|
const metadata = loadPoolMetadata();
|
|
1903
1917
|
if (!metadata[namespace]) metadata[namespace] = {};
|
|
1904
1918
|
|
|
1905
|
-
//
|
|
1919
|
+
// Update metadata
|
|
1920
|
+
// Always update to ensure projectId is captured if added later
|
|
1906
1921
|
if (!metadata[namespace][email]) {
|
|
1907
1922
|
metadata[namespace][email] = {
|
|
1908
1923
|
email: email,
|
|
@@ -1911,8 +1926,8 @@ function importCurrentGoogleAuthToPool() {
|
|
|
1911
1926
|
usageCount: 0,
|
|
1912
1927
|
imported: true
|
|
1913
1928
|
};
|
|
1914
|
-
savePoolMetadata(metadata);
|
|
1915
1929
|
}
|
|
1930
|
+
savePoolMetadata(metadata);
|
|
1916
1931
|
}
|
|
1917
1932
|
}
|
|
1918
1933
|
|