Add AI-powered mental wellness features: Reflection Companion, Pattern Tags, Weekly Digest

Three new Foundation Models features to deepen user engagement with mental wellness:

1. AI Reflection Companion — personalized feedback after completing guided reflections,
   referencing the user's actual words with personality-pack-adapted tone
2. Mood Pattern Tags — auto-extracts theme tags (work, family, stress, etc.) from notes
   and reflections, displayed as colored pills on entries
3. Weekly Emotional Digest — BGTask-scheduled Sunday digest with headline, summary,
   highlight, and intention; shown as card in Insights tab with notification

All features: on-device (zero cost), premium-gated, iOS 26+ with graceful degradation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Trey t
2026-04-04 00:47:28 -05:00
parent 43ff239781
commit ab8d8fbdc0
18 changed files with 1076 additions and 3 deletions

View File

@@ -135,6 +135,28 @@ class LocalNotification {
// MARK: - Debug: Send All Personality Pack Notifications
// MARK: - Weekly Digest Notification
public class func scheduleDigestNotification(headline: String, personalityPack: PersonalityPack) {
let content = UNMutableNotificationContent()
content.title = String(localized: "Your Weekly Digest")
content.body = headline
content.sound = .default
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)
let request = UNNotificationRequest(
identifier: "weekly-digest-\(UUID().uuidString)",
content: content,
trigger: trigger
)
UNUserNotificationCenter.current().add(request) { error in
if let error = error {
print("Failed to schedule digest notification: \(error)")
}
}
}
#if DEBUG
/// Sends one notification from each personality pack, staggered over 10 seconds for screenshot
public class func sendAllPersonalityNotificationsForScreenshot() {