()
| 173 | private listeners: Array<(models: Model[]) => void> = []; |
| 174 | |
| 175 | private constructor() { |
| 176 | // Load custom servers from localStorage on init |
| 177 | this.loadCustomServersFromStorage(); |
| 178 | |
| 179 | // Subscribe to underlying model managers and forward state changes |
| 180 | // This makes ModelManager the single source of truth for all model state |
| 181 | GemmaModelManager.getInstance().onStateChange(() => { |
| 182 | this.notifyListeners(); |
| 183 | }); |
| 184 | |
| 185 | if (isTauri()) { |
| 186 | NativeLlmManager.getInstance().onStateChange(() => { |
| 187 | this.notifyListeners(); |
| 188 | }); |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | public static getInstance(): ModelManager { |
| 193 | if (!ModelManager.instance) { |
nothing calls this directly
no test coverage detected