opencode-studio-server 1.9.1 → 1.9.3
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 +16 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1470,7 +1470,8 @@ app.post('/api/auth/profiles/:provider/:name/activate', (req, res) => {
|
|
|
1470
1470
|
? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
|
|
1471
1471
|
: provider;
|
|
1472
1472
|
|
|
1473
|
-
const
|
|
1473
|
+
const dir = getProfileDir(provider, activePlugin);
|
|
1474
|
+
const profilePath = path.join(dir, `${name}.json`);
|
|
1474
1475
|
if (!fs.existsSync(profilePath)) return res.status(404).json({ error: 'Profile not found' });
|
|
1475
1476
|
|
|
1476
1477
|
const profileData = JSON.parse(fs.readFileSync(profilePath, 'utf8'));
|
|
@@ -1512,13 +1513,22 @@ app.post('/api/auth/profiles/:provider/:name/activate', (req, res) => {
|
|
|
1512
1513
|
|
|
1513
1514
|
app.delete('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
1514
1515
|
const { provider, name } = req.params;
|
|
1516
|
+
console.log(`[Auth] Deleting profile: ${provider}/${name}`);
|
|
1515
1517
|
const activePlugin = getActiveGooglePlugin();
|
|
1516
1518
|
const namespace = provider === 'google'
|
|
1517
1519
|
? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
|
|
1518
1520
|
: provider;
|
|
1519
1521
|
|
|
1520
|
-
const
|
|
1521
|
-
|
|
1522
|
+
const dir = getProfileDir(provider, activePlugin);
|
|
1523
|
+
const profilePath = path.join(dir, `${name}.json`);
|
|
1524
|
+
console.log(`[Auth] Target path: ${profilePath}, Exists: ${fs.existsSync(profilePath)}`);
|
|
1525
|
+
|
|
1526
|
+
if (fs.existsSync(profilePath)) {
|
|
1527
|
+
fs.unlinkSync(profilePath);
|
|
1528
|
+
console.log(`[Auth] Deleted file`);
|
|
1529
|
+
} else {
|
|
1530
|
+
console.log(`[Auth] File not found`);
|
|
1531
|
+
}
|
|
1522
1532
|
|
|
1523
1533
|
const studio = loadStudioConfig();
|
|
1524
1534
|
if (studio.activeProfiles && studio.activeProfiles[provider] === name) {
|
|
@@ -1554,8 +1564,9 @@ app.put('/api/auth/profiles/:provider/:name', (req, res) => {
|
|
|
1554
1564
|
? (activePlugin === 'antigravity' ? 'google.antigravity' : 'google.gemini')
|
|
1555
1565
|
: provider;
|
|
1556
1566
|
|
|
1557
|
-
const
|
|
1558
|
-
const
|
|
1567
|
+
const dir = getProfileDir(provider, activePlugin);
|
|
1568
|
+
const oldPath = path.join(dir, `${name}.json`);
|
|
1569
|
+
const newPath = path.join(dir, `${newName}.json`);
|
|
1559
1570
|
if (fs.existsSync(oldPath)) fs.renameSync(oldPath, newPath);
|
|
1560
1571
|
|
|
1561
1572
|
const metadata = loadPoolMetadata();
|