class ScreenSession { final String name; final String pid; final bool attached; ScreenSession({ required this.name, required this.pid, required this.attached, }); factory ScreenSession.fromJson(Map json) { return ScreenSession( name: json['name'] ?? '', pid: json['pid'] ?? '', attached: json['attached'] ?? false, ); } Map toJson() { return { 'name': name, 'pid': pid, 'attached': attached, }; } } class Conversation { final String id; final String title; final DateTime createdAt; final int messageCount; Conversation({ required this.id, required this.title, required this.createdAt, required this.messageCount, }); factory Conversation.fromJson(Map json) { return Conversation( id: json['id'], title: json['title'] ?? 'Untitled', createdAt: DateTime.parse(json['created_at']), messageCount: json['message_count'] ?? 0, ); } }