import Foundation /// WiFi-only-Default für große Modell-Downloads (Gemma 4 E2B ~1.3 GB, /// E4B ~2.5 GB). User kann via Settings-Toggle auch Mobilfunk erlauben. /// /// Wert pro App in `UserDefaults.standard`. Default `false`. Apps /// reichen den Wert beim Erzeugen eines `LLMRouter` als /// `gemmaAllowsCellular`-Parameter weiter: /// /// ```swift /// LLMRouter( /// preferred: [LLMBackendPreferenceStore.current], /// gemmaAllowsCellular: LLMDownloadOverCellularStore.isAllowed /// ) /// ``` /// /// **Legacy-Migration:** Memoros bisheriger Key /// `memoro.llmDownloadOverCellular` wird beim ersten Read einmalig in /// `mana.llm.allowCellular` überführt. public enum LLMDownloadOverCellularStore { private static let key = "mana.llm.allowCellular" private static let legacyMemoroKey = "memoro.llmDownloadOverCellular" public static var isAllowed: Bool { // 1. Neuer Key if UserDefaults.standard.object(forKey: key) != nil { return UserDefaults.standard.bool(forKey: key) } // 2. Memoro-Legacy if UserDefaults.standard.object(forKey: legacyMemoroKey) != nil { let migrated = UserDefaults.standard.bool(forKey: legacyMemoroKey) set(migrated) UserDefaults.standard.removeObject(forKey: legacyMemoroKey) return migrated } // 3. Default: WiFi-only return false } public static func set(_ value: Bool) { UserDefaults.standard.set(value, forKey: key) } }