1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! Types for `alien dev` status file output
use crate::DeploymentStatus;
use alien_error::AlienError;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
/// Overall status of the dev server
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct DevStatus {
/// Dev server process ID
pub pid: u32,
/// Platform (always "local" for dev server)
pub platform: String,
/// Stack ID (always "dev" for dev server)
pub stack_id: String,
/// Path to state directory
pub state_dir: String,
/// Dev server API URL (e.g., http://localhost:9090)
pub api_url: String,
/// ISO 8601 timestamp when dev server started
pub started_at: String,
/// Overall dev server status
pub status: DevStatusState,
/// Agents being managed by this dev server (keyed by agent name)
pub agents: HashMap<String, AgentStatus>,
/// ISO 8601 timestamp of last status update
pub last_updated: String,
/// Global error if dev server itself has an error
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<AlienError>,
}
/// Overall dev server status
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub enum DevStatusState {
/// Dev server is starting up
Initializing,
/// At least one agent is running
Ready,
/// Dev server or agents encountered errors
Error,
/// Dev server is shutting down
ShuttingDown,
}
/// Status of a single agent in the dev server
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct AgentStatus {
/// Deployment ID (e.g., dep_xyz123)
pub id: String,
/// Agent name (from --agent-name flag)
pub name: String,
/// Commands endpoint URL for the deployment
#[serde(skip_serializing_if = "Option::is_none")]
pub commands_url: Option<String>,
/// Deployment status (running, provisioning, etc.)
pub status: DeploymentStatus,
/// Resources deployed by this agent (keyed by resource name)
pub resources: HashMap<String, DevResourceInfo>,
/// ISO 8601 timestamp when agent was created
pub created_at: String,
/// Error if this agent has failed
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<AlienError>,
}
/// Information about a deployed resource
#[derive(Debug, Clone, Serialize, Deserialize)]
#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
#[serde(rename_all = "camelCase")]
pub struct DevResourceInfo {
/// Resource URL (e.g., http://localhost:8080)
pub url: String,
/// Resource type ("worker" | "container")
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}