opencode-studio-server 1.12.0 → 1.12.1

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.
Files changed (2) hide show
  1. package/index.js +24 -24
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -189,7 +189,7 @@ function processLogLine(line) {
189
189
  let namespace = provider;
190
190
  if (provider === 'google') {
191
191
  const activePlugin = getActiveGooglePlugin();
192
- namespace = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
192
+ namespace = 'google.antigravity';
193
193
  }
194
194
 
195
195
  const metadata = loadPoolMetadata();
@@ -1353,7 +1353,7 @@ const AUTH_PROFILES_DIR = path.join(HOME_DIR, '.config', 'opencode-studio', 'aut
1353
1353
  const getProfileDir = (provider, activePlugin) => {
1354
1354
  let ns = provider;
1355
1355
  if (provider === 'google') {
1356
- ns = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1356
+ ns = 'google.antigravity';
1357
1357
  const nsDir = path.join(AUTH_PROFILES_DIR, ns);
1358
1358
  const plainDir = path.join(AUTH_PROFILES_DIR, 'google');
1359
1359
  const nsHas = fs.existsSync(nsDir) && fs.readdirSync(nsDir).filter(f => f.endsWith('.json')).length > 0;
@@ -1448,7 +1448,7 @@ app.get('/api/auth', (req, res) => {
1448
1448
  const saved = listAuthProfiles(p.id, activePlugin);
1449
1449
  let curr = !!authCfg[p.id];
1450
1450
  if (p.id === 'google') {
1451
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1451
+ const key = 'google.antigravity';
1452
1452
  curr = !!authCfg[key] || !!authCfg.google;
1453
1453
  }
1454
1454
  credentials.push({ ...p, active: ac[p.id] || (curr ? 'current' : null), profiles: saved, hasCurrentAuth: curr });
@@ -1475,7 +1475,7 @@ app.get('/api/auth/profiles', (req, res) => {
1475
1475
  // Correct current auth check: handle google vs google.gemini/antigravity
1476
1476
  let curr = !!authCfg[p];
1477
1477
  if (p === 'google') {
1478
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1478
+ const key = 'google.antigravity';
1479
1479
  curr = !!authCfg[key] || !!authCfg.google;
1480
1480
  }
1481
1481
 
@@ -1491,7 +1491,7 @@ app.post('/api/auth/profiles/:provider', (req, res) => {
1491
1491
  const { name } = req.body;
1492
1492
  const activePlugin = getActiveGooglePlugin();
1493
1493
  const namespace = provider === 'google'
1494
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
1494
+ ? ('google.antigravity')
1495
1495
  : provider;
1496
1496
 
1497
1497
  const auth = loadAuthConfig() || {};
@@ -1524,7 +1524,7 @@ app.post('/api/auth/profiles/:provider/:name/activate', (req, res) => {
1524
1524
  const { provider, name } = req.params;
1525
1525
  const activePlugin = getActiveGooglePlugin();
1526
1526
  const namespace = provider === 'google'
1527
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
1527
+ ? ('google.antigravity')
1528
1528
  : provider;
1529
1529
 
1530
1530
  const dir = getProfileDir(provider, activePlugin);
@@ -1542,7 +1542,7 @@ app.post('/api/auth/profiles/:provider/:name/activate', (req, res) => {
1542
1542
 
1543
1543
  // Save both to persistent namespaced key and the shared 'google' key
1544
1544
  if (provider === 'google') {
1545
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1545
+ const key = 'google.antigravity';
1546
1546
  authCfg[key] = profileData;
1547
1547
  }
1548
1548
 
@@ -1574,7 +1574,7 @@ app.delete('/api/auth/profiles/:provider/all', (req, res) => {
1574
1574
  console.log(`[Auth] Deleting ALL profiles for: ${provider}`);
1575
1575
  const activePlugin = getActiveGooglePlugin();
1576
1576
  const namespace = provider === 'google'
1577
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
1577
+ ? ('google.antigravity')
1578
1578
  : provider;
1579
1579
 
1580
1580
  const dir = getProfileDir(provider, activePlugin);
@@ -1595,7 +1595,7 @@ app.delete('/api/auth/profiles/:provider/all', (req, res) => {
1595
1595
  if (authCfg[provider]) {
1596
1596
  delete authCfg[provider];
1597
1597
  if (provider === 'google') {
1598
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1598
+ const key = 'google.antigravity';
1599
1599
  delete authCfg.google;
1600
1600
  delete authCfg[key];
1601
1601
  }
@@ -1618,7 +1618,7 @@ app.delete('/api/auth/profiles/:provider/:name', (req, res) => {
1618
1618
  console.log(`[Auth] Deleting profile: ${provider}/${name}`);
1619
1619
  const activePlugin = getActiveGooglePlugin();
1620
1620
  const namespace = provider === 'google'
1621
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
1621
+ ? ('google.antigravity')
1622
1622
  : provider;
1623
1623
 
1624
1624
  const dir = getProfileDir(provider, activePlugin);
@@ -1640,7 +1640,7 @@ app.delete('/api/auth/profiles/:provider/:name', (req, res) => {
1640
1640
  const authCfg = loadAuthConfig() || {};
1641
1641
  delete authCfg[provider];
1642
1642
  if (provider === 'google') {
1643
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1643
+ const key = 'google.antigravity';
1644
1644
  delete authCfg.google;
1645
1645
  delete authCfg[key];
1646
1646
  }
@@ -1663,7 +1663,7 @@ app.put('/api/auth/profiles/:provider/:name', (req, res) => {
1663
1663
  const { newName } = req.body;
1664
1664
  const activePlugin = getActiveGooglePlugin();
1665
1665
  const namespace = provider === 'google'
1666
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
1666
+ ? ('google.antigravity')
1667
1667
  : provider;
1668
1668
 
1669
1669
  const dir = getProfileDir(provider, activePlugin);
@@ -1813,7 +1813,7 @@ app.delete('/api/auth/:provider', (req, res) => {
1813
1813
  }
1814
1814
 
1815
1815
  if (provider === 'google' && activePlugin) {
1816
- const key = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
1816
+ const key = 'google.antigravity';
1817
1817
  delete authCfg[key];
1818
1818
  }
1819
1819
 
@@ -2036,7 +2036,7 @@ function getAccountStatus(meta, now) {
2036
2036
  function buildAccountPool(provider) {
2037
2037
  const activePlugin = getActiveGooglePlugin();
2038
2038
  const namespace = provider === 'google'
2039
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2039
+ ? ('google.antigravity')
2040
2040
  : provider;
2041
2041
 
2042
2042
  const profileDir = getProfileDir(provider, activePlugin);
@@ -2101,7 +2101,7 @@ function getPoolQuota(provider, pool) {
2101
2101
  const metadata = loadPoolMetadata();
2102
2102
  const activePlugin = getActiveGooglePlugin();
2103
2103
  const namespace = provider === 'google'
2104
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2104
+ ? ('google.antigravity')
2105
2105
  : provider;
2106
2106
 
2107
2107
  const quotaMeta = metadata._quota?.[namespace] || {};
@@ -2151,7 +2151,7 @@ function rotateAccount(provider, reason = 'manual_rotation') {
2151
2151
  // Activate the new account
2152
2152
  const activePlugin = getActiveGooglePlugin();
2153
2153
  const namespace = provider === 'google'
2154
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2154
+ ? ('google.antigravity')
2155
2155
  : provider;
2156
2156
 
2157
2157
  const profilePath = path.join(AUTH_PROFILES_DIR, namespace, `${next.name}.json`);
@@ -2239,7 +2239,7 @@ app.post('/api/auth/pool/limit', (req, res) => {
2239
2239
 
2240
2240
  const activePlugin = getActiveGooglePlugin();
2241
2241
  const namespace = provider === 'google'
2242
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2242
+ ? ('google.antigravity')
2243
2243
  : provider;
2244
2244
 
2245
2245
  const metadata = loadPoolMetadata();
@@ -2269,7 +2269,7 @@ app.put('/api/auth/pool/:name/cooldown', (req, res) => {
2269
2269
 
2270
2270
  const activePlugin = getActiveGooglePlugin();
2271
2271
  const namespace = provider === 'google'
2272
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2272
+ ? ('google.antigravity')
2273
2273
  : provider;
2274
2274
 
2275
2275
  const metadata = loadPoolMetadata();
@@ -2292,7 +2292,7 @@ app.delete('/api/auth/pool/:name/cooldown', (req, res) => {
2292
2292
 
2293
2293
  const activePlugin = getActiveGooglePlugin();
2294
2294
  const namespace = provider === 'google'
2295
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2295
+ ? ('google.antigravity')
2296
2296
  : provider;
2297
2297
 
2298
2298
  const metadata = loadPoolMetadata();
@@ -2311,7 +2311,7 @@ app.post('/api/auth/pool/:name/usage', (req, res) => {
2311
2311
 
2312
2312
  const activePlugin = getActiveGooglePlugin();
2313
2313
  const namespace = provider === 'google'
2314
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2314
+ ? ('google.antigravity')
2315
2315
  : provider;
2316
2316
 
2317
2317
  const metadata = loadPoolMetadata();
@@ -2338,7 +2338,7 @@ app.put('/api/auth/pool/:name/metadata', (req, res) => {
2338
2338
 
2339
2339
  const activePlugin = getActiveGooglePlugin();
2340
2340
  const namespace = provider === 'google'
2341
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2341
+ ? ('google.antigravity')
2342
2342
  : provider;
2343
2343
 
2344
2344
  const metadata = loadPoolMetadata();
@@ -2357,7 +2357,7 @@ app.get('/api/auth/pool/quota', (req, res) => {
2357
2357
  const provider = req.query.provider || 'google';
2358
2358
  const activePlugin = getActiveGooglePlugin();
2359
2359
  const namespace = provider === 'google'
2360
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2360
+ ? ('google.antigravity')
2361
2361
  : provider;
2362
2362
 
2363
2363
  const metadata = loadPoolMetadata();
@@ -2381,7 +2381,7 @@ app.post('/api/auth/pool/quota/limit', (req, res) => {
2381
2381
  const { provider = 'google', limit } = req.body;
2382
2382
  const activePlugin = getActiveGooglePlugin();
2383
2383
  const namespace = provider === 'google'
2384
- ? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
2384
+ ? ('google.antigravity')
2385
2385
  : provider;
2386
2386
 
2387
2387
  const metadata = loadPoolMetadata();
@@ -2714,7 +2714,7 @@ app.post('/api/auth/google/start', async (req, res) => {
2714
2714
 
2715
2715
  const studioConfig = loadStudioConfig();
2716
2716
  const activePlugin = studioConfig.activeGooglePlugin || 'gemini';
2717
- const namespace = activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini';
2717
+ const namespace = 'google.antigravity';
2718
2718
 
2719
2719
  const credentials = {
2720
2720
  refresh_token: tokens.refresh_token,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-studio-server",
3
- "version": "1.12.0",
3
+ "version": "1.12.1",
4
4
  "description": "Backend server for OpenCode Studio - manages opencode configurations",
5
5
  "main": "index.js",
6
6
  "bin": {