(provider, activePlugin)
| 2773 | const AUTH_PROFILES_DIR = path.join(HOME_DIR, '.config', 'opencode-studio', 'auth-profiles'); |
| 2774 | |
| 2775 | const getProfileDir = (provider, activePlugin) => { |
| 2776 | let ns = provider; |
| 2777 | if (provider === 'google') { |
| 2778 | ns = 'google.antigravity'; |
| 2779 | const nsDir = path.join(AUTH_PROFILES_DIR, ns); |
| 2780 | const plainDir = path.join(AUTH_PROFILES_DIR, 'google'); |
| 2781 | const nsHas = fs.existsSync(nsDir) && fs.readdirSync(nsDir).filter(f => f.endsWith('.json')).length > 0; |
| 2782 | const plainHas = fs.existsSync(plainDir) && fs.readdirSync(plainDir).filter(f => f.endsWith('.json')).length > 0; |
| 2783 | |
| 2784 | // Debug |
| 2785 | console.log(`[Auth] getProfileDir: ns=${ns}, nsHas=${nsHas}, plainHas=${plainHas}`); |
| 2786 | |
| 2787 | if (!nsHas && plainHas) return plainDir; |
| 2788 | } |
| 2789 | return path.join(AUTH_PROFILES_DIR, ns); |
| 2790 | }; |
| 2791 | |
| 2792 | const listAuthProfiles = (p, activePlugin) => { |
| 2793 | const d = getProfileDir(p, activePlugin); |
no outgoing calls
no test coverage detected