neural_conductor_shared/
lib.rs1use serde::{Deserialize, Serialize};
9
10pub mod protocol;
11pub mod session;
12pub mod message;
13
14pub use anyhow::{anyhow, Result};
15
16pub const PROTOCOL_VERSION: &str = "0.1.0";
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct AgentInfo {
22 pub id: String,
23 pub hostname: String,
24 pub platform: String,
25 pub version: String,
26}
27
28#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)]
30pub struct SessionId(pub String);
31
32impl SessionId {
33 pub fn new() -> Self {
34 Self(format!("session-{}", std::time::SystemTime::now()
36 .duration_since(std::time::UNIX_EPOCH)
37 .unwrap()
38 .as_millis()))
39 }
40}
41
42impl Default for SessionId {
43 fn default() -> Self {
44 Self::new()
45 }
46}
47
48#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
50pub enum TaskStatus {
51 Pending,
52 Running,
53 Completed,
54 Failed,
55 Cancelled,
56}