Initial commit: Captain Claude Mobile App
- 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>
This commit is contained in:
50
lib/models/session.dart
Normal file
50
lib/models/session.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user