systemprompt_traits/startup_events/
events.rs1use std::time::Duration;
4
5use super::{ModuleInfo, Phase, ServiceInfo};
6
7#[derive(Debug, Clone)]
8#[non_exhaustive]
9pub enum StartupEvent {
10 PhaseStarted {
11 phase: Phase,
12 },
13 PhaseCompleted {
14 phase: Phase,
15 },
16 PhaseFailed {
17 phase: Phase,
18 error: String,
19 },
20
21 PortCheckStarted {
22 port: u16,
23 },
24 PortAvailable {
25 port: u16,
26 },
27 PortConflict {
28 port: u16,
29 pid: u32,
30 },
31 PortConflictResolved {
32 port: u16,
33 },
34 ModulesLoaded {
35 count: usize,
36 modules: Vec<ModuleInfo>,
37 },
38
39 MigrationStarted,
40 MigrationApplied {
41 name: String,
42 },
43 MigrationComplete {
44 applied: usize,
45 skipped: usize,
46 },
47 DatabaseValidated,
48
49 McpServerStarting {
50 name: String,
51 port: u16,
52 },
53 McpServerHealthCheck {
54 name: String,
55 attempt: u8,
56 max_attempts: u8,
57 },
58 McpServerReady {
59 name: String,
60 port: u16,
61 startup_time: Duration,
62 tools: usize,
63 },
64 McpServerFailed {
65 name: String,
66 error: String,
67 },
68 McpServiceCleanup {
69 name: String,
70 reason: String,
71 },
72 McpReconciliationComplete {
73 running: usize,
74 required: usize,
75 },
76
77 AgentStarting {
78 name: String,
79 port: u16,
80 },
81 AgentReady {
82 name: String,
83 port: u16,
84 startup_time: Duration,
85 },
86 AgentFailed {
87 name: String,
88 error: String,
89 },
90 AgentCleanup {
91 name: String,
92 reason: String,
93 },
94 AgentReconciliationComplete {
95 running: usize,
96 total: usize,
97 },
98
99 RoutesConfiguring,
100 RoutesConfigured {
101 module_count: usize,
102 },
103 ExtensionRouteMounted {
104 name: String,
105 path: String,
106 auth_required: bool,
107 },
108 ServerBinding {
109 address: String,
110 },
111 ServerListening {
112 address: String,
113 pid: u32,
114 },
115
116 SchedulerInitializing,
117 SchedulerJobRegistered {
118 name: String,
119 schedule: String,
120 },
121 SchedulerReady {
122 job_count: usize,
123 },
124 BootstrapJobStarted {
125 name: String,
126 },
127 BootstrapJobCompleted {
128 name: String,
129 success: bool,
130 message: Option<String>,
131 },
132
133 Warning {
134 message: String,
135 context: Option<String>,
136 },
137 Error {
138 message: String,
139 fatal: bool,
140 },
141 Info {
142 message: String,
143 },
144
145 StartupComplete {
146 duration: Duration,
147 api_url: String,
148 services: Vec<ServiceInfo>,
149 },
150 StartupFailed {
151 error: String,
152 duration: Duration,
153 },
154}