- Flutter app with chat and terminal screens - WebSocket integration for real-time chat - xterm integration for screen sessions - Markdown rendering with code blocks - JWT authentication Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
51 lines
1.0 KiB
Dart
51 lines
1.0 KiB
Dart
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<String, dynamic> json) {
|
|
return ScreenSession(
|
|
name: json['name'] ?? '',
|
|
pid: json['pid'] ?? '',
|
|
attached: json['attached'] ?? false,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> 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<String, dynamic> json) {
|
|
return Conversation(
|
|
id: json['id'],
|
|
title: json['title'] ?? 'Untitled',
|
|
createdAt: DateTime.parse(json['created_at']),
|
|
messageCount: json['message_count'] ?? 0,
|
|
);
|
|
}
|
|
}
|