opencode-studio-server 1.14.6 → 1.14.8
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/proxy-manager.js +18 -1
package/package.json
CHANGED
package/proxy-manager.js
CHANGED
|
@@ -185,11 +185,28 @@ const runLogin = async (provider) => {
|
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
+
const listAccounts = () => {
|
|
189
|
+
if (!fs.existsSync(PROXY_AUTH_DIR)) return [];
|
|
190
|
+
try {
|
|
191
|
+
return fs.readdirSync(PROXY_AUTH_DIR)
|
|
192
|
+
.filter(f => f.endsWith('.json'))
|
|
193
|
+
.map(f => {
|
|
194
|
+
const parts = f.replace('.json', '').split('-');
|
|
195
|
+
const provider = parts[0];
|
|
196
|
+
const email = parts.slice(1).join('-').replace(/_/g, '.').replace('.gmail.com', '@gmail.com');
|
|
197
|
+
return { id: f, provider, email: email || f };
|
|
198
|
+
});
|
|
199
|
+
} catch {
|
|
200
|
+
return [];
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
188
204
|
module.exports = {
|
|
189
205
|
startProxy,
|
|
190
206
|
stopProxy,
|
|
191
207
|
getStatus,
|
|
192
208
|
loadProxyConfig,
|
|
193
209
|
saveProxyConfig,
|
|
194
|
-
runLogin
|
|
210
|
+
runLogin,
|
|
211
|
+
listAccounts
|
|
195
212
|
};
|