spb/poche Public
Agent personnel 100 % on-device — SwiftUI + Apple Foundation Models + EventKit + SwiftData. Aucune API, aucun serveur.
Swift 100%
1//2// Models.swift3// Poche4//5// Author: Simon-Pierre Boucher6// Contact: contact@spboucher.ai7//89import Foundation10import SwiftData1112// Everything lives locally, encrypted at rest via Data Protection13// (CLAUDE.md §7). No field here ever leaves the device.1415/// Notes are internal to Poche (SwiftData). There is no public API for16/// Apple Notes — the brief's `searchNotes`-against-Notes idea is not17/// buildable (CLAUDE.md §4).18@Model19final class Note {20 var uuid: UUID21 var title: String22 var content: String23 var createdAt: Date24 var updatedAt: Date2526 init(title: String, content: String) {27 self.uuid = UUID()28 self.title = title29 self.content = content30 self.createdAt = .now31 self.updatedAt = .now32 }33}3435@Model36final class TaskItem {37 var uuid: UUID38 var title: String39 var details: String?40 var dueDate: Date?41 var isDone: Bool42 var createdAt: Date43 var updatedAt: Date4445 init(title: String, details: String? = nil, dueDate: Date? = nil) {46 self.uuid = UUID()47 self.title = title48 self.details = details49 self.dueDate = dueDate50 self.isDone = false51 self.createdAt = .now52 self.updatedAt = .now53 }54}5556@Model57final class ConversationRecord {58 var startedAt: Date59 var summary: String?60 @Relationship(deleteRule: .cascade, inverse: \TurnRecord.conversation)61 var turns: [TurnRecord]6263 init() {64 self.startedAt = .now65 self.summary = nil66 self.turns = []67 }68}6970@Model71final class TurnRecord {72 var date: Date73 var role: String74 var text: String75 var conversation: ConversationRecord?7677 init(role: String, text: String) {78 self.date = .now79 self.role = role80 self.text = text81 }82}83