Added Agent Availability screen

This commit is contained in:
2026-08-31 15:27:26 +02:00
parent e7508a4c8e
commit 0561109e3c
8 changed files with 171 additions and 30 deletions
+7 -7
View File
@@ -2,22 +2,22 @@
///
/// See the note in `EAgentType.dart` about ordering and [unknown].
enum EAgentStatus {
offline,
idle,
available,
working,
offline,
error,
unknown;
bool get isOnline => this == EAgentStatus.idle || this == EAgentStatus.working;
bool get isOnline => this == EAgentStatus.available || this == EAgentStatus.working;
String get displayName {
switch (this) {
case EAgentStatus.offline:
return 'Offline';
case EAgentStatus.idle:
return 'Idle';
case EAgentStatus.available:
return 'Available';
case EAgentStatus.working:
return 'Working';
case EAgentStatus.offline:
return 'Offline';
case EAgentStatus.error:
return 'Error';
case EAgentStatus.unknown:
+18 -12
View File
@@ -5,23 +5,29 @@
/// so that it never shadows a real backend value and acts as fallback for
/// values this client does not know yet.
enum EAgentType {
developer,
tester,
reviewer,
manager,
acApi,
logAnalyzer,
coder,
researcher,
securityAnalyst,
journalist,
unknown;
/// Human readable label, e.g. for chips or table cells.
String get displayName {
switch (this) {
case EAgentType.developer:
return 'Developer';
case EAgentType.tester:
return 'Tester';
case EAgentType.reviewer:
return 'Reviewer';
case EAgentType.manager:
return 'Manager';
case EAgentType.acApi:
return 'AC Api';
case EAgentType.logAnalyzer:
return 'Log Analyzer';
case EAgentType.coder:
return 'Coder';
case EAgentType.researcher:
return 'Researcher';
case EAgentType.securityAnalyst:
return 'Security Analyst';
case EAgentType.journalist:
return 'Journalist';
case EAgentType.unknown:
return 'Unknown';
}
+7 -1
View File
@@ -123,8 +123,9 @@ class JsonReader {
}
final text = raw.toString().trim().toLowerCase();
final normalized = _normalizeEnumName(text);
for (final candidate in values) {
if (nameOf(candidate).toLowerCase() == text) {
if (_normalizeEnumName(nameOf(candidate).toLowerCase()) == normalized) {
return candidate;
}
}
@@ -135,4 +136,9 @@ class JsonReader {
}
return fallback;
}
/// Removes separators so that `AC_API` also matches `acApi`.
static String _normalizeEnumName(String value) {
return value.replaceAll(RegExp(r'[^a-z0-9]'), '');
}
}