namespace ControlCenter;
///
/// Agent operational status derived from OpenClaw Gateway session activity.
/// Maps to the frontend AgentStatus type: 'active' | 'idle' | 'thinking' | 'error'.
///
public enum AgentStatus
{
/// Agent is currently processing a turn.
Active,
/// Agent completed its last turn; no active work.
Idle,
/// LLM call in flight; tokens streaming.
Thinking,
/// Agent encountered an unhandled error.
Error
}
///
/// Extended lifecycle status including offline — not all agents have active sessions.
/// Used internally; clients only see (offline maps to idle).
///
public enum AgentLifecycleStatus
{
Active,
Idle,
Thinking,
Error,
Offline
}
///
/// Pushed to SignalR clients when an agent's status changes.
/// Matches the TypeScript AgentStatusUpdate interface from the design spec.
///
/// Agent identifier, e.g. "otto", "dex".
/// Human-readable name, e.g. "Otto".
/// Role description, e.g. "Orchestrator Agent".
/// Current operational status.
/// Description of the current task, if any.
/// Full session key, e.g. "agent:otto:telegram:direct:8787451565".
/// Channel the agent is operating on, e.g. "telegram".
/// ISO 8601 timestamp of last activity.
/// Error message when status is 'error'.
public record AgentStatusUpdate(
string AgentId,
string DisplayName,
string Role,
string Status,
string? CurrentTask,
string SessionKey,
string Channel,
string LastActivity,
string? ErrorMessage = null
);
///
/// Pushed to SignalR clients when an agent's task progress updates.
/// Matches the TypeScript TaskProgressUpdate interface from the design spec.
///
/// Agent identifier.
/// Description of the current task.
/// Task progress percentage (0–100), if trackable.
/// Elapsed time string, e.g. "04m 12s".
public record TaskProgressUpdate(
string AgentId,
string TaskDescription,
int? Progress,
string? Elapsed
);
///
/// Snapshot of an agent's full card data, sent on initial connection
/// or when the fleet state is requested.
/// Matches the TypeScript AgentCardData interface from the design spec.
///
public record AgentCardData(
string Id,
string DisplayName,
string Role,
string Status,
string? CurrentTask,
int? TaskProgress,
string? TaskElapsed,
string SessionKey,
string Channel,
string LastActivity,
string? ErrorMessage
);