feagi_agent/sdk/common/
common_enums.rs1#[derive(Default, Debug, Copy, Clone, PartialOrd, PartialEq, Eq)]
2pub enum AgentConnectionState {
3 #[default]
4 Disconnected,
5 Connecting,
6 Authenticating,
7 Running,
8 Reconnecting,
9}
10
11impl AgentConnectionState {
12 pub fn change_state_and_return_before_and_after(
13 current_state_var: &mut AgentConnectionState,
14 new_state: AgentConnectionState,
15 ) -> Option<(AgentConnectionState, AgentConnectionState)> {
16 if *current_state_var == new_state {
17 return None;
18 }
19 let prior_state = *current_state_var;
20 *current_state_var = new_state;
21 Some((prior_state, new_state))
22 }
23
24 pub fn is_active(&self) -> bool {
25 *self != AgentConnectionState::Disconnected
26 }
27}
28
29use serde::{Deserialize, Serialize};
30
31#[derive(Debug, Copy, Clone, PartialOrd, PartialEq, Eq, Hash, Serialize, Deserialize)]
32#[serde(rename_all = "snake_case")]
33pub enum AgentCapabilities {
34 SendSensorData,
35 ReceiveMotorData,
36 ReceiveNeuronVisualizations,
37}
38
39#[derive(Debug, Clone, PartialOrd, PartialEq, Eq)]
40pub enum FeagiConnectionConfiguration {
41 NeuroRoboticsStudio,
42 DummyTesting,
43 ZMQDirect { host: String },
44 WebsocketDirect { host: String },
45}