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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Demo orchestration and presenter guidance
|
| 3 |
+
"""
|
| 4 |
+
|
| 5 |
+
from typing import Dict, List, Optional
|
| 6 |
+
from enum import Enum
|
| 7 |
+
from core.data_models import DemoMode, DemoStep
|
| 8 |
+
|
| 9 |
+
class DemoOrchestrator:
|
| 10 |
+
"""Guide presenter through optimal demo flow"""
|
| 11 |
+
|
| 12 |
+
def __init__(self, mode: DemoMode = DemoMode.INVESTOR):
|
| 13 |
+
self.mode = mode
|
| 14 |
+
self.current_step = 0
|
| 15 |
+
self.steps = self._get_steps_for_mode()
|
| 16 |
+
|
| 17 |
+
def _get_steps_for_mode(self) -> List[DemoStep]:
|
| 18 |
+
"""Get demo steps based on mode"""
|
| 19 |
+
if self.mode == DemoMode.QUICK:
|
| 20 |
+
return [
|
| 21 |
+
DemoStep(
|
| 22 |
+
title="Show Crisis",
|
| 23 |
+
scenario="Cache Miss Storm",
|
| 24 |
+
action="metrics",
|
| 25 |
+
message="Highlight the critical metrics - this is happening right now",
|
| 26 |
+
icon="๐"
|
| 27 |
+
),
|
| 28 |
+
DemoStep(
|
| 29 |
+
title="OSS Analysis",
|
| 30 |
+
scenario="Cache Miss Storm",
|
| 31 |
+
action="oss",
|
| 32 |
+
message="Perfect analysis but requires manual work",
|
| 33 |
+
icon="๐ค"
|
| 34 |
+
),
|
| 35 |
+
DemoStep(
|
| 36 |
+
title="Enterprise Magic",
|
| 37 |
+
scenario="Cache Miss Storm",
|
| 38 |
+
action="enterprise",
|
| 39 |
+
message="Watch ARF fix it automatically in minutes",
|
| 40 |
+
icon="โก"
|
| 41 |
+
)
|
| 42 |
+
]
|
| 43 |
+
else: # INVESTOR mode
|
| 44 |
+
return [
|
| 45 |
+
DemoStep(
|
| 46 |
+
title="Problem Statement",
|
| 47 |
+
scenario="Cache Miss Storm",
|
| 48 |
+
action="metrics",
|
| 49 |
+
message="This critical incident costs $8,500/hour right now",
|
| 50 |
+
icon="๐ฐ"
|
| 51 |
+
),
|
| 52 |
+
DemoStep(
|
| 53 |
+
title="Current Solution (OSS)",
|
| 54 |
+
scenario="Cache Miss Storm",
|
| 55 |
+
action="oss",
|
| 56 |
+
message="Our free edition gives perfect analysis but manual work",
|
| 57 |
+
icon="๐"
|
| 58 |
+
),
|
| 59 |
+
DemoStep(
|
| 60 |
+
title="ARF Solution (Enterprise)",
|
| 61 |
+
scenario="Cache Miss Storm",
|
| 62 |
+
action="enterprise",
|
| 63 |
+
message="Autonomous healing with enterprise safety controls",
|
| 64 |
+
icon="๐"
|
| 65 |
+
),
|
| 66 |
+
DemoStep(
|
| 67 |
+
title="Business Impact",
|
| 68 |
+
scenario=None,
|
| 69 |
+
action="dashboard",
|
| 70 |
+
message="Show how ARF transforms cost centers to profit engines",
|
| 71 |
+
icon="๐"
|
| 72 |
+
),
|
| 73 |
+
DemoStep(
|
| 74 |
+
title="Custom ROI Analysis",
|
| 75 |
+
scenario=None,
|
| 76 |
+
action="roi_calc",
|
| 77 |
+
message="Calculate their specific potential savings",
|
| 78 |
+
icon="๐งฎ"
|
| 79 |
+
)
|
| 80 |
+
]
|
| 81 |
+
|
| 82 |
+
def get_next_guidance(self) -> Dict:
|
| 83 |
+
"""Get next guidance step"""
|
| 84 |
+
if self.current_step >= len(self.steps):
|
| 85 |
+
return self._create_completion_guidance()
|
| 86 |
+
|
| 87 |
+
step = self.steps[self.current_step]
|
| 88 |
+
self.current_step += 1
|
| 89 |
+
|
| 90 |
+
return {
|
| 91 |
+
"title": step.title,
|
| 92 |
+
"scenario": step.scenario,
|
| 93 |
+
"action": step.action,
|
| 94 |
+
"message": step.message,
|
| 95 |
+
"icon": step.icon,
|
| 96 |
+
"html": self._create_guidance_html(step)
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
def _create_guidance_html(self, step: DemoStep) -> str:
|
| 100 |
+
"""Create HTML guidance for presenter"""
|
| 101 |
+
action_desc = self._get_action_description(step.action)
|
| 102 |
+
|
| 103 |
+
return f"""
|
| 104 |
+
<div style='
|
| 105 |
+
padding: 20px;
|
| 106 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 107 |
+
color: white;
|
| 108 |
+
border-radius: 10px;
|
| 109 |
+
margin: 15px 0;
|
| 110 |
+
border-left: 5px solid #4ECDC4;
|
| 111 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 112 |
+
'>
|
| 113 |
+
<div style='display: flex; align-items: center; margin-bottom: 10px;'>
|
| 114 |
+
<span style='font-size: 24px; margin-right: 10px;'>{step.icon}</span>
|
| 115 |
+
<h3 style='margin: 0;'>Step {self.current_step}: {step.title}</h3>
|
| 116 |
+
</div>
|
| 117 |
+
<p style='margin: 0 0 10px 0; font-size: 16px;'><b>What to say:</b> "{step.message}"</p>
|
| 118 |
+
<div style='
|
| 119 |
+
background: rgba(255,255,255,0.1);
|
| 120 |
+
padding: 10px;
|
| 121 |
+
border-radius: 5px;
|
| 122 |
+
margin-top: 10px;
|
| 123 |
+
'>
|
| 124 |
+
<span style='font-size: 14px; opacity: 0.9;'>๐ <b>Action:</b> {action_desc}</span>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
"""
|
| 128 |
+
|
| 129 |
+
def _create_completion_guidance(self) -> Dict:
|
| 130 |
+
"""Create completion guidance"""
|
| 131 |
+
return {
|
| 132 |
+
"title": "Demo Complete",
|
| 133 |
+
"scenario": None,
|
| 134 |
+
"action": "complete",
|
| 135 |
+
"message": "Ready for investor Q&A",
|
| 136 |
+
"icon": "๐",
|
| 137 |
+
"html": """
|
| 138 |
+
<div style='
|
| 139 |
+
padding: 25px;
|
| 140 |
+
background: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
|
| 141 |
+
color: white;
|
| 142 |
+
border-radius: 10px;
|
| 143 |
+
text-align: center;
|
| 144 |
+
margin: 20px 0;
|
| 145 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
| 146 |
+
'>
|
| 147 |
+
<h2 style='margin: 0 0 15px 0;'>๐ Demo Complete!</h2>
|
| 148 |
+
<p style='margin: 0; font-size: 18px;'>Ready for investor Q&A</p>
|
| 149 |
+
<div style='
|
| 150 |
+
margin-top: 20px;
|
| 151 |
+
padding: 15px;
|
| 152 |
+
background: rgba(255,255,255,0.1);
|
| 153 |
+
border-radius: 8px;
|
| 154 |
+
text-align: left;
|
| 155 |
+
'>
|
| 156 |
+
<h4 style='margin: 0 0 10px 0;'>Key Metrics Demonstrated:</h4>
|
| 157 |
+
<div style='display: grid; grid-template-columns: 1fr 1fr; gap: 10px;'>
|
| 158 |
+
<div>โข 85% faster incident resolution</div>
|
| 159 |
+
<div>โข 5.2ร average ROI</div>
|
| 160 |
+
<div>โข 81.7% auto-heal rate</div>
|
| 161 |
+
<div>โข 2-3 month payback</div>
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
</div>
|
| 165 |
+
"""
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
def _get_action_description(self, action: str) -> str:
|
| 169 |
+
"""Get description for action"""
|
| 170 |
+
actions = {
|
| 171 |
+
"metrics": "Show crisis metrics (already displayed)",
|
| 172 |
+
"oss": "Click 'Run OSS Analysis' button",
|
| 173 |
+
"enterprise": "Click 'Execute Enterprise Healing' (toggle approval)",
|
| 174 |
+
"dashboard": "Switch to Business Impact tab",
|
| 175 |
+
"roi_calc": "Adjust sliders and calculate custom ROI",
|
| 176 |
+
"complete": "Proceed to Q&A"
|
| 177 |
+
}
|
| 178 |
+
return actions.get(action, "Continue with demo")
|