Skip to main content

feagi_agent/command_and_control/
health_check_message.rs

1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[allow(clippy::large_enum_variant)]
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum HealthCheckMessage {
7    FeagiHealthCheckRequest,
8    FeagiHealthCheckResponse(HealthCheckResponse),
9}
10
11// TODO: This is a copy of "crates/feagi-api/src/endpoints/system.rs/HealthCheckResponse" that is stored here for now. We should consider moving this potentially
12// TODO: I see a lot of generic types here, especially string keys. Maybe we need somehting better?
13#[allow(non_snake_case)] // Field name matches Python API for compatibility
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct HealthCheckResponse {
16    pub burst_engine: bool,
17    pub connected_agents: Option<i32>,
18    pub influxdb_availability: bool,
19    pub neuron_count_max: i64,
20    pub synapse_count_max: i64,
21    pub latest_changes_saved_externally: bool,
22    pub genome_availability: bool,
23    pub genome_validity: Option<bool>,
24    pub brain_readiness: bool,
25    pub feagi_session: Option<i64>,
26    pub fitness: Option<f64>,
27    pub cortical_area_count: Option<i32>,
28    pub neuron_count: Option<i64>,
29    pub memory_neuron_count: Option<i64>,
30    pub regular_neuron_count: Option<i64>,
31    pub synapse_count: Option<i64>,
32    pub estimated_brain_size_in_MB: Option<f64>,
33    pub genome_num: Option<i32>,
34    pub genome_timestamp: Option<i64>,
35    pub simulation_timestep: Option<f64>,
36    pub memory_area_stats: Option<HashMap<String, HashMap<String, serde_json::Value>>>,
37    pub amalgamation_pending: Option<HashMap<String, serde_json::Value>>,
38    /// Hash of brain regions (hierarchy, membership, and properties)
39    #[serde(skip_serializing_if = "Option::is_none")]
40    pub brain_regions_hash: Option<u64>,
41    /// Hash of cortical areas and properties (excluding mappings)
42    #[serde(skip_serializing_if = "Option::is_none")]
43    pub cortical_areas_hash: Option<u64>,
44    /// Hash of brain geometry (area positions/dimensions and 2D coordinates)
45    #[serde(skip_serializing_if = "Option::is_none")]
46    pub brain_geometry_hash: Option<u64>,
47    /// Hash of morphology registry
48    #[serde(skip_serializing_if = "Option::is_none")]
49    pub morphologies_hash: Option<u64>,
50    /// Hash of cortical mappings
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub cortical_mappings_hash: Option<u64>,
53    /// Hash of agent data (ids, capabilities, connection properties)
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub agent_data_hash: Option<u64>,
56    /// Root brain region ID (UUID string) for O(1) root lookup
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub brain_regions_root: Option<String>,
59    // /// Fatigue information (index, active state, and breakdown of contributing elements)
60    //#[serde(skip_serializing_if = "Option::is_none")]
61    //pub fatigue: Option<FatigueInfo>,
62}