The previous three posts covered how events flow from the SDK to the UI, how the timeline renders, and how tool cards visualize. This final post looks at SwiftWork's infrastructure — how data is stored, how state is restored, how Markdown is rendered, how code is highlighted, and how API keys are managed. These components are independent, but all essential to making the app usable. SwiftData Model Layer SwiftWork uses SwiftData for persistence, registering four models: // SwiftWorkApp.swift . modelContainer ( for : [ Session . self , Event . self , AppConfiguration . self , PermissionRule . self ]) Enter fullscreen mode Exit fullscreen mode Session @Model final class Session { @Attribute ( . unique ) var id : UUID var title : String var createdAt : Date var updatedAt : Date var workspacePath : String ? @Relationship ( deleteRule : . cascade , inverse : \ Event .…