()
| 161 | private listeners: Array<(models: Model[]) => void> = []; |
| 162 | |
| 163 | private constructor() { |
| 164 | // Load custom servers from localStorage on init |
| 165 | this.loadCustomServersFromStorage(); |
| 166 | |
| 167 | // Subscribe to underlying model managers and forward state changes |
| 168 | // This makes ModelManager the single source of truth for all model state |
| 169 | GemmaModelManager.getInstance().onStateChange(() => { |
| 170 | this.notifyListeners(); |
| 171 | }); |
| 172 | |
| 173 | if (isTauri()) { |
| 174 | NativeLlmManager.getInstance().onStateChange(() => { |
| 175 | this.notifyListeners(); |
| 176 | }); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | public static getInstance(): ModelManager { |
| 181 | if (!ModelManager.instance) { |
nothing calls this directly
no test coverage detected