Skip to main content

feagi_api/v1/
dtos.rs

1// Copyright 2025 Neuraville Inc.
2// SPDX-License-Identifier: Apache-2.0
3
4// API Version 1 - Data Transfer Objects
5// These DTOs must match Python FastAPI response structures exactly for backward compatibility
6
7use serde::{Deserialize, Serialize};
8
9/// Health check response (must match Python FastAPI format exactly)
10#[derive(Clone, Debug, Serialize, Deserialize, utoipa::ToSchema)]
11pub struct HealthCheckResponseV1 {
12    /// Overall system status
13    pub status: String,
14
15    /// Is the brain ready to process data?
16    pub brain_readiness: bool,
17
18    /// Is the burst engine running?
19    pub burst_engine: bool,
20
21    /// Total number of neurons
22    pub neuron_count: usize,
23
24    /// Total number of synapses
25    /// TODO: Get from NPU when available
26    pub synapse_count: usize,
27
28    /// Number of cortical areas
29    pub cortical_area_count: usize,
30
31    /// Is the genome valid?
32    /// TODO: Get from genome validator
33    pub genome_validity: bool,
34
35    /// Is InfluxDB available?
36    /// TODO: Get from analytics service
37    pub influxdb_availability: bool,
38
39    /// Path to connectome file
40    /// TODO: Get from state manager
41    pub connectome_path: String,
42
43    /// Genome last modified timestamp
44    /// TODO: Get from genome service
45    pub genome_timestamp: String,
46
47    /// Change tracking state
48    /// TODO: Get from state manager
49    pub change_state: String,
50
51    /// Are changes saved externally?
52    /// TODO: Get from state manager
53    pub changes_saved_externally: bool,
54}
55
56/// Readiness check response
57#[derive(Clone, Debug, Serialize, Deserialize, utoipa::ToSchema)]
58pub struct ReadinessCheckResponseV1 {
59    /// Is the system ready?
60    pub ready: bool,
61
62    /// Component readiness details
63    pub components: ComponentReadiness,
64}
65
66/// Component readiness status
67#[derive(Clone, Debug, Serialize, Deserialize, utoipa::ToSchema)]
68pub struct ComponentReadiness {
69    /// API server ready
70    pub api: bool,
71
72    /// Burst engine ready
73    pub burst_engine: bool,
74
75    /// State manager ready
76    pub state_manager: bool,
77
78    /// Connectome loaded
79    pub connectome: bool,
80}