arora_websocket/slot.rs
1//! Slot metadata types for the Arora protocol.
2
3use arora_types::value::{Type, Value};
4use serde::{Deserialize, Serialize};
5
6/// Metadata describing an available slot in the system.
7///
8/// Slots represent controllable parameters or observable outputs.
9/// Each slot has a hierarchical path and optional type/constraint information.
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct SlotInfo {
12 /// Hierarchical path identifier (e.g., "face/mouth/open", "body/arm/left/rotation")
13 pub path: String,
14
15 /// Slot kind/category (e.g., "input", "output", "computed")
16 #[serde(skip_serializing_if = "Option::is_none")]
17 pub kind: Option<String>,
18
19 /// The arora Type that this slot accepts/produces
20 #[serde(skip_serializing_if = "Option::is_none")]
21 pub value_type: Option<Type>,
22
23 /// Minimum value constraint (for numeric types)
24 #[serde(skip_serializing_if = "Option::is_none")]
25 pub min: Option<f64>,
26
27 /// Maximum value constraint (for numeric types)
28 #[serde(skip_serializing_if = "Option::is_none")]
29 pub max: Option<f64>,
30
31 /// Default value
32 #[serde(skip_serializing_if = "Option::is_none", default)]
33 pub default_value: Option<Value>,
34
35 /// Human-readable description
36 #[serde(skip_serializing_if = "Option::is_none")]
37 pub description: Option<String>,
38}