1#![allow(dead_code)]
10
11mod runner;
12mod scenarios;
13
14pub use runner::{DemoRunner, DemoState};
15pub use scenarios::{
16 archaeology::CodebaseArchaeologyScenario, bug_hunt::BugHuntSafariScenario,
17 factory::FeatureFactoryScenario, token_challenge::TokenChallengeScenario, DemoScenario,
18};
19
20use std::time::Duration;
21
22#[derive(Debug, Clone)]
24pub struct DemoConfig {
25 pub speed_multiplier: f32,
27 pub auto_advance: bool,
29 pub step_delay: Duration,
31 pub particles_enabled: bool,
33 pub max_particles: usize,
35}
36
37impl Default for DemoConfig {
38 fn default() -> Self {
39 Self {
40 speed_multiplier: 1.0,
41 auto_advance: false,
42 step_delay: Duration::from_millis(500),
43 particles_enabled: true,
44 max_particles: 100,
45 }
46 }
47}
48
49impl DemoConfig {
50 pub fn fast() -> Self {
52 Self {
53 speed_multiplier: 2.0,
54 auto_advance: true,
55 step_delay: Duration::from_millis(200),
56 ..Default::default()
57 }
58 }
59
60 pub fn presentation() -> Self {
62 Self {
63 speed_multiplier: 0.75,
64 auto_advance: false,
65 step_delay: Duration::from_secs(1),
66 max_particles: 200,
67 ..Default::default()
68 }
69 }
70}
71
72#[derive(Debug, Clone)]
74pub enum DemoEvent {
75 ScenarioStarted { name: String },
77 StageCompleted { stage: usize, total: usize },
79 AgentAction { agent: String, action: String },
81 MessageSent {
83 from: String,
84 to: String,
85 msg_type: String,
86 },
87 TokensProcessed { count: u64, rate: f64 },
89 EffectTriggered { effect_type: String, x: f32, y: f32 },
91 ScenarioCompleted { duration_secs: f32 },
93}
94
95#[cfg(test)]
96mod tests {
97 use super::*;
98
99 #[test]
100 fn test_demo_config_default() {
101 let config = DemoConfig::default();
102 assert!((config.speed_multiplier - 1.0).abs() < 0.001);
103 assert!(!config.auto_advance);
104 assert!(config.particles_enabled);
105 }
106
107 #[test]
108 fn test_demo_config_fast() {
109 let config = DemoConfig::fast();
110 assert!(config.speed_multiplier > 1.0);
111 assert!(config.auto_advance);
112 }
113
114 #[test]
115 fn test_demo_config_presentation() {
116 let config = DemoConfig::presentation();
117 assert!(config.speed_multiplier < 1.0);
118 assert!(!config.auto_advance);
119 assert!(config.max_particles > 100);
120 }
121}