Commit ·
be466b5
1
Parent(s): 734561b
feat(ui): implement autopilot visual streaming and dynamic state injection
Browse files- Add AutopilotPhase type (idle/thinking/filling/submitting)
- Rewrite useEpisode hook with history-aware prompt builder and phase management
- Add generateAutopilotPayload() for dynamic LLM context injection
- Rewrite ActionConsole with 6-step autopilot orchestration:
staggered field fills, typewriter justification, countdown auto-submit
- Phase-aware gradient button, shimmer animations, AI badges on filled fields
- Abort-safe ref tracking for mid-animation episode resets
- sre-dashboard/src/components/ActionConsole.tsx +345 -75
- sre-dashboard/src/components/DashboardLayout.tsx +2 -1
- sre-dashboard/src/hooks/useEpisode.ts +111 -33
- sre-dashboard/src/types/sre.ts +2 -0
- sre_frontend_dist/assets/index-6hP2OA7w.js +0 -0
- sre_frontend_dist/assets/index-BXigT_1l.css +2 -0
- sre_frontend_dist/favicon.svg +1 -0
- sre_frontend_dist/icons.svg +24 -0
- sre_frontend_dist/index.html +14 -0
sre-dashboard/src/components/ActionConsole.tsx
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
-
import { useState, useCallback } from 'react';
|
| 2 |
-
import { motion } from 'framer-motion';
|
| 3 |
-
import { Send, Zap, RotateCcw, ChevronDown } from 'lucide-react';
|
| 4 |
import type {
|
| 5 |
TaskName,
|
| 6 |
ContainmentAction,
|
| 7 |
InvestigationQuery,
|
| 8 |
RootCause,
|
| 9 |
Action,
|
|
|
|
| 10 |
} from '../types/sre';
|
| 11 |
import {
|
| 12 |
CONTAINMENT_LABELS,
|
|
@@ -16,15 +17,11 @@ import {
|
|
| 16 |
ROOT_CAUSE_LABELS,
|
| 17 |
} from '../types/sre';
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
isAutopiloting: boolean;
|
| 25 |
-
isDone: boolean;
|
| 26 |
-
hasEpisode: boolean;
|
| 27 |
-
}
|
| 28 |
|
| 29 |
const CONTAINMENT_OPTIONS: ContainmentAction[] = [
|
| 30 |
'scale_up_nodes',
|
|
@@ -52,30 +49,81 @@ const ROOT_CAUSE_OPTIONS: RootCause[] = [
|
|
| 52 |
|
| 53 |
const TASK_OPTIONS: TaskName[] = ['easy', 'medium', 'hard'];
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
interface SelectFieldProps {
|
| 56 |
label: string;
|
| 57 |
value: string;
|
| 58 |
onChange: (v: string) => void;
|
| 59 |
options: Array<{ value: string; label: string; detail?: string }>;
|
| 60 |
-
|
|
|
|
| 61 |
}
|
| 62 |
|
| 63 |
-
function SelectField({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
return (
|
| 65 |
<div className="space-y-1">
|
| 66 |
-
<
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
<select
|
| 71 |
value={value}
|
| 72 |
onChange={(e) => onChange(e.target.value)}
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
>
|
| 76 |
{options.map((opt) => (
|
| 77 |
<option key={opt.value} value={opt.value}>
|
| 78 |
-
{opt.label}
|
|
|
|
| 79 |
</option>
|
| 80 |
))}
|
| 81 |
</select>
|
|
@@ -85,23 +133,115 @@ function SelectField({ label, value, onChange, options, disabled }: SelectFieldP
|
|
| 85 |
);
|
| 86 |
}
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
export function ActionConsole({
|
| 89 |
onSubmit,
|
| 90 |
onAutopilot,
|
|
|
|
| 91 |
onReset,
|
| 92 |
isLoading,
|
| 93 |
-
|
| 94 |
isDone,
|
| 95 |
hasEpisode,
|
| 96 |
}: ActionConsoleProps) {
|
|
|
|
| 97 |
const [containment, setContainment] = useState<ContainmentAction>('do_nothing');
|
| 98 |
const [investigation, setInvestigation] = useState<InvestigationQuery>('none');
|
| 99 |
const [rootCause, setRootCause] = useState<RootCause>('unknown');
|
| 100 |
const [justification, setJustification] = useState('');
|
| 101 |
const [selectedTask, setSelectedTask] = useState<TaskName>('easy');
|
| 102 |
|
| 103 |
-
|
|
|
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
const handleSubmit = useCallback(() => {
|
| 106 |
if (!justification.trim()) return;
|
| 107 |
onSubmit({
|
|
@@ -112,24 +252,68 @@ export function ActionConsole({
|
|
| 112 |
});
|
| 113 |
}, [containment, investigation, rootCause, justification, onSubmit]);
|
| 114 |
|
| 115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
const action = await onAutopilot();
|
| 117 |
-
if (action)
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
}
|
| 125 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
return (
|
| 128 |
<div className="flex flex-col h-full">
|
| 129 |
-
{/* Console Header */}
|
| 130 |
<div className="flex items-center justify-between px-4 py-2 border-b border-sre-border bg-sre-surface/60">
|
| 131 |
-
<span className="text-xs font-mono text-sre-text-muted tracking-wider">
|
| 132 |
-
|
|
|
|
|
|
|
| 133 |
<div className="flex items-center gap-2">
|
| 134 |
<select
|
| 135 |
value={selectedTask}
|
|
@@ -137,7 +321,9 @@ export function ActionConsole({
|
|
| 137 |
className="bg-sre-bg border border-sre-border rounded px-2 py-1 text-xs font-mono text-sre-text-bright"
|
| 138 |
>
|
| 139 |
{TASK_OPTIONS.map((t) => (
|
| 140 |
-
<option key={t} value={t}>
|
|
|
|
|
|
|
| 141 |
))}
|
| 142 |
</select>
|
| 143 |
<button
|
|
@@ -149,11 +335,29 @@ export function ActionConsole({
|
|
| 149 |
{hasEpisode ? 'NEW EPISODE' : 'START'}
|
| 150 |
</button>
|
| 151 |
</div>
|
| 152 |
-
)
|
| 153 |
</div>
|
| 154 |
|
| 155 |
-
{/* Action Form */}
|
| 156 |
<div className="flex-1 overflow-y-auto p-4 space-y-3">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
<SelectField
|
| 158 |
label="Containment Action"
|
| 159 |
value={containment}
|
|
@@ -163,7 +367,8 @@ export function ActionConsole({
|
|
| 163 |
label: CONTAINMENT_LABELS[v],
|
| 164 |
detail: `$${CONTAINMENT_COSTS[v]}`,
|
| 165 |
}))}
|
| 166 |
-
|
|
|
|
| 167 |
/>
|
| 168 |
|
| 169 |
<SelectField
|
|
@@ -175,7 +380,8 @@ export function ActionConsole({
|
|
| 175 |
label: INVESTIGATION_LABELS[v],
|
| 176 |
detail: v !== 'none' ? `$${INVESTIGATION_COST}` : '$0',
|
| 177 |
}))}
|
| 178 |
-
|
|
|
|
| 179 |
/>
|
| 180 |
|
| 181 |
<SelectField
|
|
@@ -186,53 +392,117 @@ export function ActionConsole({
|
|
| 186 |
value: v,
|
| 187 |
label: ROOT_CAUSE_LABELS[v],
|
| 188 |
}))}
|
| 189 |
-
|
|
|
|
| 190 |
/>
|
| 191 |
|
|
|
|
| 192 |
<div className="space-y-1">
|
| 193 |
-
<
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
</div>
|
| 205 |
</div>
|
| 206 |
|
| 207 |
-
{/* Action Buttons */}
|
| 208 |
<div className="p-4 border-t border-sre-border space-y-2">
|
| 209 |
{/* Autopilot Button */}
|
| 210 |
-
<
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
/
|
| 229 |
-
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
{/* Manual Submit */}
|
| 233 |
<button
|
| 234 |
onClick={handleSubmit}
|
| 235 |
-
disabled={
|
| 236 |
className="w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-sre-surface-alt border border-sre-border text-xs font-mono text-sre-text-bright hover:bg-sre-border transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
|
| 237 |
>
|
| 238 |
<Send className="w-3.5 h-3.5" />
|
|
|
|
| 1 |
+
import { useState, useCallback, useRef, useEffect } from 'react';
|
| 2 |
+
import { motion, AnimatePresence } from 'framer-motion';
|
| 3 |
+
import { Send, Zap, RotateCcw, ChevronDown, Bot, Play } from 'lucide-react';
|
| 4 |
import type {
|
| 5 |
TaskName,
|
| 6 |
ContainmentAction,
|
| 7 |
InvestigationQuery,
|
| 8 |
RootCause,
|
| 9 |
Action,
|
| 10 |
+
AutopilotPhase,
|
| 11 |
} from '../types/sre';
|
| 12 |
import {
|
| 13 |
CONTAINMENT_LABELS,
|
|
|
|
| 17 |
ROOT_CAUSE_LABELS,
|
| 18 |
} from '../types/sre';
|
| 19 |
|
| 20 |
+
// ─── Constants ───────────────────────────────────────────────────────────────
|
| 21 |
+
|
| 22 |
+
const FILL_DELAY_MS = 450;
|
| 23 |
+
const TYPEWRITER_MS = 18;
|
| 24 |
+
const SUBMIT_COUNTDOWN_MS = 1500;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
const CONTAINMENT_OPTIONS: ContainmentAction[] = [
|
| 27 |
'scale_up_nodes',
|
|
|
|
| 49 |
|
| 50 |
const TASK_OPTIONS: TaskName[] = ['easy', 'medium', 'hard'];
|
| 51 |
|
| 52 |
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
| 53 |
+
|
| 54 |
+
function wait(ms: number): Promise<void> {
|
| 55 |
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
| 56 |
+
}
|
| 57 |
+
|
| 58 |
+
// ─── Props ───────────────────────────────────────────────────────────────────
|
| 59 |
+
|
| 60 |
+
interface ActionConsoleProps {
|
| 61 |
+
onSubmit: (action: Action) => void;
|
| 62 |
+
onAutopilot: () => Promise<Action | null>;
|
| 63 |
+
onSetAutopilotPhase: (phase: AutopilotPhase) => void;
|
| 64 |
+
onReset: (taskName: TaskName) => void;
|
| 65 |
+
isLoading: boolean;
|
| 66 |
+
autopilotPhase: AutopilotPhase;
|
| 67 |
+
isDone: boolean;
|
| 68 |
+
hasEpisode: boolean;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
// ─── SelectField ─────────────────────────────────────────────────────────────
|
| 72 |
+
|
| 73 |
interface SelectFieldProps {
|
| 74 |
label: string;
|
| 75 |
value: string;
|
| 76 |
onChange: (v: string) => void;
|
| 77 |
options: Array<{ value: string; label: string; detail?: string }>;
|
| 78 |
+
blocked: boolean;
|
| 79 |
+
aiFilled: boolean;
|
| 80 |
}
|
| 81 |
|
| 82 |
+
function SelectField({
|
| 83 |
+
label,
|
| 84 |
+
value,
|
| 85 |
+
onChange,
|
| 86 |
+
options,
|
| 87 |
+
blocked,
|
| 88 |
+
aiFilled,
|
| 89 |
+
}: SelectFieldProps) {
|
| 90 |
return (
|
| 91 |
<div className="space-y-1">
|
| 92 |
+
<div className="flex items-center gap-1.5">
|
| 93 |
+
<label className="text-[10px] font-mono text-sre-text-muted tracking-wider uppercase">
|
| 94 |
+
{label}
|
| 95 |
+
</label>
|
| 96 |
+
<AnimatePresence>
|
| 97 |
+
{aiFilled && (
|
| 98 |
+
<motion.span
|
| 99 |
+
initial={{ opacity: 0, scale: 0.5, x: -4 }}
|
| 100 |
+
animate={{ opacity: 1, scale: 1, x: 0 }}
|
| 101 |
+
exit={{ opacity: 0, scale: 0.5 }}
|
| 102 |
+
className="px-1.5 py-0.5 rounded text-[9px] font-mono font-bold bg-sre-green-dim text-sre-green border border-sre-green/30"
|
| 103 |
+
>
|
| 104 |
+
AI
|
| 105 |
+
</motion.span>
|
| 106 |
+
)}
|
| 107 |
+
</AnimatePresence>
|
| 108 |
+
</div>
|
| 109 |
+
<div className={`relative ${blocked ? 'pointer-events-none' : ''}`}>
|
| 110 |
<select
|
| 111 |
value={value}
|
| 112 |
onChange={(e) => onChange(e.target.value)}
|
| 113 |
+
className={[
|
| 114 |
+
'w-full appearance-none bg-sre-bg rounded-md px-3 py-2 text-xs font-mono text-sre-text-bright',
|
| 115 |
+
'focus:outline-none transition-all duration-300',
|
| 116 |
+
aiFilled
|
| 117 |
+
? 'border border-sre-green/50 shadow-[0_0_12px_rgba(34,197,94,0.15)]'
|
| 118 |
+
: blocked
|
| 119 |
+
? 'border border-sre-border opacity-50'
|
| 120 |
+
: 'border border-sre-border focus:border-sre-accent/50 focus:ring-1 focus:ring-sre-accent/30 cursor-pointer',
|
| 121 |
+
].join(' ')}
|
| 122 |
>
|
| 123 |
{options.map((opt) => (
|
| 124 |
<option key={opt.value} value={opt.value}>
|
| 125 |
+
{opt.label}
|
| 126 |
+
{opt.detail ? ` (${opt.detail})` : ''}
|
| 127 |
</option>
|
| 128 |
))}
|
| 129 |
</select>
|
|
|
|
| 133 |
);
|
| 134 |
}
|
| 135 |
|
| 136 |
+
// ─── Autopilot Button Content ────────────────────────────────────────────────
|
| 137 |
+
|
| 138 |
+
function PulseDots({ count = 3, speed = 1 }: { count?: number; speed?: number }) {
|
| 139 |
+
return (
|
| 140 |
+
<span className="flex gap-0.5 ml-1">
|
| 141 |
+
{Array.from({ length: count }, (_, i) => (
|
| 142 |
+
<motion.span
|
| 143 |
+
key={i}
|
| 144 |
+
animate={{ opacity: [0.3, 1, 0.3] }}
|
| 145 |
+
transition={{ duration: speed, repeat: Infinity, delay: i * 0.2 }}
|
| 146 |
+
className="w-1 h-1 rounded-full bg-white"
|
| 147 |
+
/>
|
| 148 |
+
))}
|
| 149 |
+
</span>
|
| 150 |
+
);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
function AutopilotButtonContent({ phase }: { phase: AutopilotPhase }) {
|
| 154 |
+
switch (phase) {
|
| 155 |
+
case 'thinking':
|
| 156 |
+
return (
|
| 157 |
+
<>
|
| 158 |
+
<Zap className="w-4 h-4" />
|
| 159 |
+
<span>NEMOTRON ANALYZING</span>
|
| 160 |
+
<PulseDots speed={1.2} />
|
| 161 |
+
</>
|
| 162 |
+
);
|
| 163 |
+
case 'filling':
|
| 164 |
+
return (
|
| 165 |
+
<>
|
| 166 |
+
<Bot className="w-4 h-4" />
|
| 167 |
+
<span>AI FILLING FORM</span>
|
| 168 |
+
<PulseDots speed={0.8} />
|
| 169 |
+
</>
|
| 170 |
+
);
|
| 171 |
+
case 'submitting':
|
| 172 |
+
return (
|
| 173 |
+
<>
|
| 174 |
+
<Play className="w-4 h-4" />
|
| 175 |
+
<span>AUTO-EXECUTING</span>
|
| 176 |
+
</>
|
| 177 |
+
);
|
| 178 |
+
default:
|
| 179 |
+
return (
|
| 180 |
+
<>
|
| 181 |
+
<Zap className="w-4 h-4" />
|
| 182 |
+
<span>AUTO-PILOT (RUN AI)</span>
|
| 183 |
+
</>
|
| 184 |
+
);
|
| 185 |
+
}
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
// ─── Gradient per phase ──────────────────────────────────────────────────────
|
| 189 |
+
|
| 190 |
+
function phaseGradient(phase: AutopilotPhase): string {
|
| 191 |
+
switch (phase) {
|
| 192 |
+
case 'thinking':
|
| 193 |
+
return 'linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #38bdf8 100%)';
|
| 194 |
+
case 'filling':
|
| 195 |
+
return 'linear-gradient(135deg, #059669 0%, #22c55e 50%, #38bdf8 100%)';
|
| 196 |
+
case 'submitting':
|
| 197 |
+
return 'linear-gradient(135deg, #0284c7 0%, #38bdf8 50%, #22c55e 100%)';
|
| 198 |
+
default:
|
| 199 |
+
return 'linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #38bdf8 100%)';
|
| 200 |
+
}
|
| 201 |
+
}
|
| 202 |
+
|
| 203 |
+
// ─── Main Component ──────────────────────────────────────────────────────────
|
| 204 |
+
|
| 205 |
export function ActionConsole({
|
| 206 |
onSubmit,
|
| 207 |
onAutopilot,
|
| 208 |
+
onSetAutopilotPhase,
|
| 209 |
onReset,
|
| 210 |
isLoading,
|
| 211 |
+
autopilotPhase,
|
| 212 |
isDone,
|
| 213 |
hasEpisode,
|
| 214 |
}: ActionConsoleProps) {
|
| 215 |
+
// ── Form state (controlled inputs) ──────────────────────────────────────
|
| 216 |
const [containment, setContainment] = useState<ContainmentAction>('do_nothing');
|
| 217 |
const [investigation, setInvestigation] = useState<InvestigationQuery>('none');
|
| 218 |
const [rootCause, setRootCause] = useState<RootCause>('unknown');
|
| 219 |
const [justification, setJustification] = useState('');
|
| 220 |
const [selectedTask, setSelectedTask] = useState<TaskName>('easy');
|
| 221 |
|
| 222 |
+
// ── AI visual state ─────────────────────────────────────────────────────
|
| 223 |
+
const [aiFilledFields, setAiFilledFields] = useState<Set<string>>(new Set());
|
| 224 |
|
| 225 |
+
// Tracks the current autopilot run so stale animations abort on reset/unmount
|
| 226 |
+
const autopilotRunRef = useRef(0);
|
| 227 |
+
|
| 228 |
+
// Reset form fields when episode is cleared
|
| 229 |
+
useEffect(() => {
|
| 230 |
+
if (!hasEpisode) {
|
| 231 |
+
setContainment('do_nothing');
|
| 232 |
+
setInvestigation('none');
|
| 233 |
+
setRootCause('unknown');
|
| 234 |
+
setJustification('');
|
| 235 |
+
setAiFilledFields(new Set());
|
| 236 |
+
autopilotRunRef.current++;
|
| 237 |
+
}
|
| 238 |
+
}, [hasEpisode]);
|
| 239 |
+
|
| 240 |
+
// ── Derived flags ───────────────────────────────────────────────────────
|
| 241 |
+
const isUserBlocked = isLoading || autopilotPhase !== 'idle' || isDone;
|
| 242 |
+
const isAiActive = autopilotPhase === 'filling' || autopilotPhase === 'submitting';
|
| 243 |
+
|
| 244 |
+
// ── Manual submit ───────────────────────────────────────────────────────
|
| 245 |
const handleSubmit = useCallback(() => {
|
| 246 |
if (!justification.trim()) return;
|
| 247 |
onSubmit({
|
|
|
|
| 252 |
});
|
| 253 |
}, [containment, investigation, rootCause, justification, onSubmit]);
|
| 254 |
|
| 255 |
+
// ── Autopilot orchestration ─────────────────────────────────────────────
|
| 256 |
+
const handleAutopilotClick = useCallback(async () => {
|
| 257 |
+
const runId = ++autopilotRunRef.current;
|
| 258 |
+
const isCurrent = () => autopilotRunRef.current === runId;
|
| 259 |
+
|
| 260 |
+
// 1 ── Lock form & reset fields while AI thinks
|
| 261 |
+
setContainment('do_nothing');
|
| 262 |
+
setInvestigation('none');
|
| 263 |
+
setRootCause('unknown');
|
| 264 |
+
setJustification('');
|
| 265 |
+
setAiFilledFields(new Set());
|
| 266 |
+
|
| 267 |
+
// 2 ── Call LLM (hook sets phase → "thinking" → "filling")
|
| 268 |
const action = await onAutopilot();
|
| 269 |
+
if (!action || !isCurrent()) return;
|
| 270 |
+
|
| 271 |
+
// 3 ── Staggered field fill ────────────────────────────────────────────
|
| 272 |
+
await wait(FILL_DELAY_MS);
|
| 273 |
+
if (!isCurrent()) return;
|
| 274 |
+
setContainment(action.containment_action);
|
| 275 |
+
setAiFilledFields(new Set(['containment']));
|
| 276 |
+
|
| 277 |
+
await wait(FILL_DELAY_MS);
|
| 278 |
+
if (!isCurrent()) return;
|
| 279 |
+
setInvestigation(action.investigation_query);
|
| 280 |
+
setAiFilledFields(new Set(['containment', 'investigation']));
|
| 281 |
+
|
| 282 |
+
await wait(FILL_DELAY_MS);
|
| 283 |
+
if (!isCurrent()) return;
|
| 284 |
+
setRootCause(action.declare_root_cause);
|
| 285 |
+
setAiFilledFields(new Set(['containment', 'investigation', 'rootCause']));
|
| 286 |
+
|
| 287 |
+
// 4 ── Typewriter effect on justification ──────────────────────────────
|
| 288 |
+
await wait(200);
|
| 289 |
+
for (let i = 1; i <= action.justification.length; i++) {
|
| 290 |
+
if (!isCurrent()) return;
|
| 291 |
+
setJustification(action.justification.slice(0, i));
|
| 292 |
+
await wait(TYPEWRITER_MS);
|
| 293 |
}
|
| 294 |
+
setAiFilledFields(
|
| 295 |
+
new Set(['containment', 'investigation', 'rootCause', 'justification']),
|
| 296 |
+
);
|
| 297 |
+
|
| 298 |
+
// 5 ── Countdown pause so user can read the justification ──────────────
|
| 299 |
+
onSetAutopilotPhase('submitting');
|
| 300 |
+
await wait(SUBMIT_COUNTDOWN_MS);
|
| 301 |
+
if (!isCurrent()) return;
|
| 302 |
+
|
| 303 |
+
// 6 ── Auto-submit the AI action to the game engine ────────────────────
|
| 304 |
+
onSubmit(action);
|
| 305 |
+
setAiFilledFields(new Set());
|
| 306 |
+
onSetAutopilotPhase('idle');
|
| 307 |
+
}, [onAutopilot, onSubmit, onSetAutopilotPhase]);
|
| 308 |
|
| 309 |
return (
|
| 310 |
<div className="flex flex-col h-full">
|
| 311 |
+
{/* ── Console Header ─────────────────────────────────────────────── */}
|
| 312 |
<div className="flex items-center justify-between px-4 py-2 border-b border-sre-border bg-sre-surface/60">
|
| 313 |
+
<span className="text-xs font-mono text-sre-text-muted tracking-wider">
|
| 314 |
+
ACTION CONSOLE
|
| 315 |
+
</span>
|
| 316 |
+
{(!hasEpisode || isDone) && (
|
| 317 |
<div className="flex items-center gap-2">
|
| 318 |
<select
|
| 319 |
value={selectedTask}
|
|
|
|
| 321 |
className="bg-sre-bg border border-sre-border rounded px-2 py-1 text-xs font-mono text-sre-text-bright"
|
| 322 |
>
|
| 323 |
{TASK_OPTIONS.map((t) => (
|
| 324 |
+
<option key={t} value={t}>
|
| 325 |
+
{t.toUpperCase()}
|
| 326 |
+
</option>
|
| 327 |
))}
|
| 328 |
</select>
|
| 329 |
<button
|
|
|
|
| 335 |
{hasEpisode ? 'NEW EPISODE' : 'START'}
|
| 336 |
</button>
|
| 337 |
</div>
|
| 338 |
+
)}
|
| 339 |
</div>
|
| 340 |
|
| 341 |
+
{/* ── Action Form ────────────────────────────────────────────────── */}
|
| 342 |
<div className="flex-1 overflow-y-auto p-4 space-y-3">
|
| 343 |
+
{/* AI Thinking placeholder in justification area */}
|
| 344 |
+
{autopilotPhase === 'thinking' && (
|
| 345 |
+
<motion.div
|
| 346 |
+
initial={{ opacity: 0, y: 4 }}
|
| 347 |
+
animate={{ opacity: 1, y: 0 }}
|
| 348 |
+
className="flex items-center gap-2 p-2.5 rounded-lg bg-sre-purple-dim border border-sre-purple/20 mb-2"
|
| 349 |
+
>
|
| 350 |
+
<motion.div
|
| 351 |
+
animate={{ rotate: 360 }}
|
| 352 |
+
transition={{ duration: 2, repeat: Infinity, ease: 'linear' }}
|
| 353 |
+
className="w-4 h-4 border-2 border-sre-purple/30 border-t-sre-purple rounded-full"
|
| 354 |
+
/>
|
| 355 |
+
<span className="text-[11px] font-mono text-sre-purple animate-pulse-glow">
|
| 356 |
+
Nemotron-120B is analyzing telemetry...
|
| 357 |
+
</span>
|
| 358 |
+
</motion.div>
|
| 359 |
+
)}
|
| 360 |
+
|
| 361 |
<SelectField
|
| 362 |
label="Containment Action"
|
| 363 |
value={containment}
|
|
|
|
| 367 |
label: CONTAINMENT_LABELS[v],
|
| 368 |
detail: `$${CONTAINMENT_COSTS[v]}`,
|
| 369 |
}))}
|
| 370 |
+
blocked={isUserBlocked}
|
| 371 |
+
aiFilled={aiFilledFields.has('containment')}
|
| 372 |
/>
|
| 373 |
|
| 374 |
<SelectField
|
|
|
|
| 380 |
label: INVESTIGATION_LABELS[v],
|
| 381 |
detail: v !== 'none' ? `$${INVESTIGATION_COST}` : '$0',
|
| 382 |
}))}
|
| 383 |
+
blocked={isUserBlocked}
|
| 384 |
+
aiFilled={aiFilledFields.has('investigation')}
|
| 385 |
/>
|
| 386 |
|
| 387 |
<SelectField
|
|
|
|
| 392 |
value: v,
|
| 393 |
label: ROOT_CAUSE_LABELS[v],
|
| 394 |
}))}
|
| 395 |
+
blocked={isUserBlocked}
|
| 396 |
+
aiFilled={aiFilledFields.has('rootCause')}
|
| 397 |
/>
|
| 398 |
|
| 399 |
+
{/* Justification textarea */}
|
| 400 |
<div className="space-y-1">
|
| 401 |
+
<div className="flex items-center gap-1.5">
|
| 402 |
+
<label className="text-[10px] font-mono text-sre-text-muted tracking-wider uppercase">
|
| 403 |
+
Justification
|
| 404 |
+
</label>
|
| 405 |
+
<AnimatePresence>
|
| 406 |
+
{aiFilledFields.has('justification') && (
|
| 407 |
+
<motion.span
|
| 408 |
+
initial={{ opacity: 0, scale: 0.5, x: -4 }}
|
| 409 |
+
animate={{ opacity: 1, scale: 1, x: 0 }}
|
| 410 |
+
exit={{ opacity: 0, scale: 0.5 }}
|
| 411 |
+
className="px-1.5 py-0.5 rounded text-[9px] font-mono font-bold bg-sre-green-dim text-sre-green border border-sre-green/30"
|
| 412 |
+
>
|
| 413 |
+
AI
|
| 414 |
+
</motion.span>
|
| 415 |
+
)}
|
| 416 |
+
</AnimatePresence>
|
| 417 |
+
</div>
|
| 418 |
+
<div className={isUserBlocked ? 'pointer-events-none' : ''}>
|
| 419 |
+
<textarea
|
| 420 |
+
value={justification}
|
| 421 |
+
onChange={(e) => setJustification(e.target.value)}
|
| 422 |
+
placeholder={
|
| 423 |
+
autopilotPhase === 'thinking'
|
| 424 |
+
? 'Nemotron-120B is analyzing telemetry...'
|
| 425 |
+
: 'Explain your reasoning...'
|
| 426 |
+
}
|
| 427 |
+
rows={3}
|
| 428 |
+
className={[
|
| 429 |
+
'w-full bg-sre-bg rounded-md px-3 py-2 text-xs font-mono text-sre-text-bright',
|
| 430 |
+
'placeholder:text-sre-text-muted/50 focus:outline-none resize-none transition-all duration-300',
|
| 431 |
+
aiFilledFields.has('justification')
|
| 432 |
+
? 'border border-sre-green/50 shadow-[0_0_12px_rgba(34,197,94,0.15)]'
|
| 433 |
+
: isAiActive
|
| 434 |
+
? 'border border-sre-accent/30'
|
| 435 |
+
: isUserBlocked
|
| 436 |
+
? 'border border-sre-border opacity-50'
|
| 437 |
+
: 'border border-sre-border focus:border-sre-accent/50 focus:ring-1 focus:ring-sre-accent/30',
|
| 438 |
+
].join(' ')}
|
| 439 |
+
/>
|
| 440 |
+
</div>
|
| 441 |
</div>
|
| 442 |
</div>
|
| 443 |
|
| 444 |
+
{/* ── Action Buttons ─────────────────────────────────────────────── */}
|
| 445 |
<div className="p-4 border-t border-sre-border space-y-2">
|
| 446 |
{/* Autopilot Button */}
|
| 447 |
+
<div className="relative">
|
| 448 |
+
<motion.button
|
| 449 |
+
onClick={handleAutopilotClick}
|
| 450 |
+
disabled={isUserBlocked || !hasEpisode}
|
| 451 |
+
whileHover={autopilotPhase === 'idle' ? { scale: 1.01 } : undefined}
|
| 452 |
+
whileTap={autopilotPhase === 'idle' ? { scale: 0.99 } : undefined}
|
| 453 |
+
className={[
|
| 454 |
+
'w-full relative overflow-hidden flex items-center justify-center gap-2',
|
| 455 |
+
'px-4 py-2.5 rounded-lg font-mono text-xs font-semibold text-white',
|
| 456 |
+
'disabled:opacity-40 disabled:cursor-not-allowed transition-shadow',
|
| 457 |
+
autopilotPhase === 'idle'
|
| 458 |
+
? 'hover:shadow-[0_0_20px_rgba(168,85,247,0.3)]'
|
| 459 |
+
: '',
|
| 460 |
+
].join(' ')}
|
| 461 |
+
style={{ background: phaseGradient(autopilotPhase) }}
|
| 462 |
+
>
|
| 463 |
+
<AutopilotButtonContent phase={autopilotPhase} />
|
| 464 |
+
|
| 465 |
+
{/* Shimmer sweep during active phases */}
|
| 466 |
+
{autopilotPhase !== 'idle' && (
|
| 467 |
+
<motion.div
|
| 468 |
+
className="absolute inset-0 bg-white/10"
|
| 469 |
+
animate={{ x: ['-100%', '100%'] }}
|
| 470 |
+
transition={{
|
| 471 |
+
duration: autopilotPhase === 'thinking' ? 1.5 : 1,
|
| 472 |
+
repeat: Infinity,
|
| 473 |
+
}}
|
| 474 |
+
style={{ width: '50%' }}
|
| 475 |
+
/>
|
| 476 |
+
)}
|
| 477 |
+
</motion.button>
|
| 478 |
+
|
| 479 |
+
{/* Countdown progress bar during "submitting" phase */}
|
| 480 |
+
<AnimatePresence>
|
| 481 |
+
{autopilotPhase === 'submitting' && (
|
| 482 |
+
<motion.div
|
| 483 |
+
className="absolute bottom-0 left-0 right-0 h-0.5 rounded-b-lg overflow-hidden"
|
| 484 |
+
initial={{ opacity: 0 }}
|
| 485 |
+
animate={{ opacity: 1 }}
|
| 486 |
+
exit={{ opacity: 0 }}
|
| 487 |
+
>
|
| 488 |
+
<motion.div
|
| 489 |
+
className="h-full bg-sre-accent"
|
| 490 |
+
initial={{ width: '100%' }}
|
| 491 |
+
animate={{ width: '0%' }}
|
| 492 |
+
transition={{
|
| 493 |
+
duration: SUBMIT_COUNTDOWN_MS / 1000,
|
| 494 |
+
ease: 'linear',
|
| 495 |
+
}}
|
| 496 |
+
/>
|
| 497 |
+
</motion.div>
|
| 498 |
+
)}
|
| 499 |
+
</AnimatePresence>
|
| 500 |
+
</div>
|
| 501 |
|
| 502 |
{/* Manual Submit */}
|
| 503 |
<button
|
| 504 |
onClick={handleSubmit}
|
| 505 |
+
disabled={isUserBlocked || !hasEpisode || !justification.trim()}
|
| 506 |
className="w-full flex items-center justify-center gap-2 px-4 py-2 rounded-lg bg-sre-surface-alt border border-sre-border text-xs font-mono text-sre-text-bright hover:bg-sre-border transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
|
| 507 |
>
|
| 508 |
<Send className="w-3.5 h-3.5" />
|
sre-dashboard/src/components/DashboardLayout.tsx
CHANGED
|
@@ -93,9 +93,10 @@ export function DashboardLayout() {
|
|
| 93 |
<ActionConsole
|
| 94 |
onSubmit={episode.step}
|
| 95 |
onAutopilot={episode.autopilot}
|
|
|
|
| 96 |
onReset={episode.reset}
|
| 97 |
isLoading={episode.isLoading}
|
| 98 |
-
|
| 99 |
isDone={episode.isDone}
|
| 100 |
hasEpisode={hasEpisode}
|
| 101 |
/>
|
|
|
|
| 93 |
<ActionConsole
|
| 94 |
onSubmit={episode.step}
|
| 95 |
onAutopilot={episode.autopilot}
|
| 96 |
+
onSetAutopilotPhase={episode.setAutopilotPhase}
|
| 97 |
onReset={episode.reset}
|
| 98 |
isLoading={episode.isLoading}
|
| 99 |
+
autopilotPhase={episode.autopilotPhase}
|
| 100 |
isDone={episode.isDone}
|
| 101 |
hasEpisode={hasEpisode}
|
| 102 |
/>
|
sre-dashboard/src/hooks/useEpisode.ts
CHANGED
|
@@ -5,9 +5,12 @@ import type {
|
|
| 5 |
Observation,
|
| 6 |
Reward,
|
| 7 |
EpisodeState,
|
|
|
|
| 8 |
} from '../types/sre';
|
| 9 |
import { resetEpisode, submitStep, runAutopilot } from '../api/client';
|
| 10 |
|
|
|
|
|
|
|
| 11 |
interface TurnRecord {
|
| 12 |
turn: number;
|
| 13 |
action: Action;
|
|
@@ -22,6 +25,7 @@ interface EpisodeHook {
|
|
| 22 |
history: TurnRecord[];
|
| 23 |
isLoading: boolean;
|
| 24 |
isAutopiloting: boolean;
|
|
|
|
| 25 |
error: string | null;
|
| 26 |
isDone: boolean;
|
| 27 |
healerTriggered: boolean;
|
|
@@ -29,63 +33,133 @@ interface EpisodeHook {
|
|
| 29 |
reset: (taskName: TaskName) => Promise<void>;
|
| 30 |
step: (action: Action) => Promise<void>;
|
| 31 |
autopilot: () => Promise<Action | null>;
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
-
|
|
|
|
|
|
|
| 43 |
- Set declare_root_cause to "unknown" while still investigating.
|
| 44 |
- Once evidence is conclusive, declare the root cause to resolve the incident.
|
| 45 |
- Every action costs money. Unnecessary spending lowers your score.
|
| 46 |
- Inaction causes system health to degrade. The system can crash.
|
| 47 |
|
| 48 |
-
|
| 49 |
Turn 1-2: Stabilize with containment AND run investigation queries.
|
| 50 |
Turn 3+: Declare root cause once evidence supports it.
|
| 51 |
Never declare a root cause on turn 1 unless evidence is absolutely conclusive.
|
| 52 |
|
| 53 |
-
|
| 54 |
-
|
| 55 |
{
|
| 56 |
-
"containment_action": "
|
| 57 |
-
"investigation_query": "
|
| 58 |
-
"declare_root_cause": "
|
| 59 |
-
"justification": "1-3 sentence explanation citing specific evidence
|
| 60 |
}`;
|
| 61 |
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
if (Object.keys(obs.investigation_results).length > 0) {
|
| 70 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
}
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
}
|
| 76 |
|
|
|
|
|
|
|
| 77 |
export function useEpisode(): EpisodeHook {
|
| 78 |
const [observation, setObservation] = useState<Observation | null>(null);
|
| 79 |
const [state, setState] = useState<EpisodeState | null>(null);
|
| 80 |
const [reward, setReward] = useState<Reward | null>(null);
|
| 81 |
const [history, setHistory] = useState<TurnRecord[]>([]);
|
| 82 |
const [isLoading, setIsLoading] = useState(false);
|
| 83 |
-
const [
|
| 84 |
const [error, setError] = useState<string | null>(null);
|
| 85 |
const [isDone, setIsDone] = useState(false);
|
| 86 |
const [healerTriggered, setHealerTriggered] = useState(false);
|
| 87 |
const [aiRawResponse, setAiRawResponse] = useState<string | null>(null);
|
| 88 |
|
|
|
|
|
|
|
| 89 |
const reset = useCallback(async (taskName: TaskName) => {
|
| 90 |
setIsLoading(true);
|
| 91 |
setError(null);
|
|
@@ -94,6 +168,7 @@ export function useEpisode(): EpisodeHook {
|
|
| 94 |
setIsDone(false);
|
| 95 |
setHealerTriggered(false);
|
| 96 |
setAiRawResponse(null);
|
|
|
|
| 97 |
try {
|
| 98 |
const res = await resetEpisode(taskName);
|
| 99 |
setObservation(res.observation);
|
|
@@ -132,31 +207,32 @@ export function useEpisode(): EpisodeHook {
|
|
| 132 |
|
| 133 |
const autopilot = useCallback(async (): Promise<Action | null> => {
|
| 134 |
if (!observation) return null;
|
| 135 |
-
|
| 136 |
setError(null);
|
| 137 |
setHealerTriggered(false);
|
| 138 |
try {
|
| 139 |
-
const messages =
|
| 140 |
-
{ role: 'system', content: SRE_SYSTEM_PROMPT },
|
| 141 |
-
{ role: 'user', content: formatObservation(observation) },
|
| 142 |
-
];
|
| 143 |
const res = await runAutopilot(messages);
|
| 144 |
setAiRawResponse(res.content);
|
| 145 |
|
| 146 |
const parsed = JSON.parse(res.content) as Action;
|
| 147 |
-
// If the raw content differs from re-serialized, healer likely intervened
|
| 148 |
const reser = JSON.stringify(parsed);
|
| 149 |
if (res.content.trim() !== reser) {
|
| 150 |
setHealerTriggered(true);
|
| 151 |
}
|
|
|
|
|
|
|
| 152 |
return parsed;
|
| 153 |
} catch (e: unknown) {
|
| 154 |
setError(e instanceof Error ? e.message : 'Autopilot failed');
|
|
|
|
| 155 |
return null;
|
| 156 |
-
} finally {
|
| 157 |
-
setIsAutopiloting(false);
|
| 158 |
}
|
| 159 |
-
}, [observation]);
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
return {
|
| 162 |
observation,
|
|
@@ -165,6 +241,7 @@ export function useEpisode(): EpisodeHook {
|
|
| 165 |
history,
|
| 166 |
isLoading,
|
| 167 |
isAutopiloting,
|
|
|
|
| 168 |
error,
|
| 169 |
isDone,
|
| 170 |
healerTriggered,
|
|
@@ -172,5 +249,6 @@ export function useEpisode(): EpisodeHook {
|
|
| 172 |
reset,
|
| 173 |
step,
|
| 174 |
autopilot,
|
|
|
|
| 175 |
};
|
| 176 |
}
|
|
|
|
| 5 |
Observation,
|
| 6 |
Reward,
|
| 7 |
EpisodeState,
|
| 8 |
+
AutopilotPhase,
|
| 9 |
} from '../types/sre';
|
| 10 |
import { resetEpisode, submitStep, runAutopilot } from '../api/client';
|
| 11 |
|
| 12 |
+
// ─── Types ───────────────────────────────────────────────────────────────────
|
| 13 |
+
|
| 14 |
interface TurnRecord {
|
| 15 |
turn: number;
|
| 16 |
action: Action;
|
|
|
|
| 25 |
history: TurnRecord[];
|
| 26 |
isLoading: boolean;
|
| 27 |
isAutopiloting: boolean;
|
| 28 |
+
autopilotPhase: AutopilotPhase;
|
| 29 |
error: string | null;
|
| 30 |
isDone: boolean;
|
| 31 |
healerTriggered: boolean;
|
|
|
|
| 33 |
reset: (taskName: TaskName) => Promise<void>;
|
| 34 |
step: (action: Action) => Promise<void>;
|
| 35 |
autopilot: () => Promise<Action | null>;
|
| 36 |
+
setAutopilotPhase: (phase: AutopilotPhase) => void;
|
| 37 |
}
|
| 38 |
|
| 39 |
+
// ─── God-Level System Prompt ─────────────────────────────────────────────────
|
| 40 |
+
|
| 41 |
+
const SRE_SYSTEM_PROMPT = `You are an elite, battle-tested Site Reliability Engineer (SRE) leading incident response for a critical cloud infrastructure. A live production incident is currently unfolding.
|
| 42 |
+
|
| 43 |
+
YOUR OBJECTIVES:
|
| 44 |
+
1. CONTAINMENT: Stabilize the system immediately to prevent cascading failures.
|
| 45 |
+
2. INVESTIGATION: Gather concrete telemetry and logs to find the true source of the failure.
|
| 46 |
+
3. RESOLUTION: Declare the root cause ONLY when you have definitive proof. Do not guess.
|
| 47 |
|
| 48 |
+
AVAILABLE ACTIONS:
|
| 49 |
+
- Containment Actions: scale_up_nodes, rate_limit_all, rollback_last_deploy, do_nothing
|
| 50 |
+
- Investigation Queries: analyze_ip_traffic, query_db_locks, check_commit_diffs, check_service_mesh, check_resource_utilization, none
|
| 51 |
+
- Root Cause Declarations: ddos_attack, viral_traffic, bad_code, database_lock, unknown
|
| 52 |
|
| 53 |
+
RULES OF ENGAGEMENT:
|
| 54 |
+
- You must balance budget and system health.
|
| 55 |
+
- If system health is dropping rapidly, prioritize containment over investigation.
|
| 56 |
+
- You will be heavily penalized for declaring a root cause prematurely without sufficient evidence.
|
| 57 |
- Set declare_root_cause to "unknown" while still investigating.
|
| 58 |
- Once evidence is conclusive, declare the root cause to resolve the incident.
|
| 59 |
- Every action costs money. Unnecessary spending lowers your score.
|
| 60 |
- Inaction causes system health to degrade. The system can crash.
|
| 61 |
|
| 62 |
+
STRATEGY:
|
| 63 |
Turn 1-2: Stabilize with containment AND run investigation queries.
|
| 64 |
Turn 3+: Declare root cause once evidence supports it.
|
| 65 |
Never declare a root cause on turn 1 unless evidence is absolutely conclusive.
|
| 66 |
|
| 67 |
+
OUTPUT FORMAT:
|
| 68 |
+
You must respond with a raw, valid JSON object and absolutely nothing else. Do not use markdown formatting, backticks, or conversational filler. The JSON must exactly match this schema:
|
| 69 |
{
|
| 70 |
+
"containment_action": "<exact string from available containment actions>",
|
| 71 |
+
"investigation_query": "<exact string from available investigation queries>",
|
| 72 |
+
"declare_root_cause": "<exact string from available root causes, or 'unknown'>",
|
| 73 |
+
"justification": "<A brief, 1-3 sentence technical explanation citing specific evidence>"
|
| 74 |
}`;
|
| 75 |
|
| 76 |
+
// ─── Dynamic Prompt Builder ──────────────────────────────────────────────────
|
| 77 |
+
|
| 78 |
+
/**
|
| 79 |
+
* Constructs the "user" message for the LLM by injecting the full live
|
| 80 |
+
* observation state and the history of actions already taken. This gives the
|
| 81 |
+
* model complete situational awareness each turn.
|
| 82 |
+
*/
|
| 83 |
+
export function generateAutopilotPayload(
|
| 84 |
+
obs: Observation,
|
| 85 |
+
history: TurnRecord[],
|
| 86 |
+
): Array<{ role: string; content: string }> {
|
| 87 |
+
return [
|
| 88 |
+
{ role: 'system', content: SRE_SYSTEM_PROMPT },
|
| 89 |
+
{ role: 'user', content: buildUserMessage(obs, history) },
|
| 90 |
+
];
|
| 91 |
+
}
|
| 92 |
+
|
| 93 |
+
function buildUserMessage(obs: Observation, history: TurnRecord[]): string {
|
| 94 |
+
const lines: string[] = [];
|
| 95 |
+
|
| 96 |
+
lines.push('=== CURRENT SYSTEM STATE ===');
|
| 97 |
+
lines.push(`INCIDENT: ${obs.incident_id} | Severity: ${obs.severity}`);
|
| 98 |
+
lines.push(`Turn: ${obs.turn_number} | Turns Remaining: ${obs.turns_remaining}`);
|
| 99 |
+
lines.push(`System Health: ${obs.system_health}% | Budget Spent: $${obs.budget_spent}`);
|
| 100 |
+
lines.push('');
|
| 101 |
+
|
| 102 |
+
lines.push('--- Observation ---');
|
| 103 |
+
lines.push(obs.initial_observation);
|
| 104 |
+
lines.push('');
|
| 105 |
+
|
| 106 |
+
lines.push('--- Active Alerts ---');
|
| 107 |
+
for (const a of obs.active_alerts) {
|
| 108 |
+
lines.push(` \u2022 ${a}`);
|
| 109 |
+
}
|
| 110 |
+
lines.push('');
|
| 111 |
+
|
| 112 |
+
lines.push('--- System Metrics ---');
|
| 113 |
+
for (const [k, v] of Object.entries(obs.system_metrics)) {
|
| 114 |
+
lines.push(` ${k}: ${v}`);
|
| 115 |
+
}
|
| 116 |
+
lines.push('');
|
| 117 |
|
| 118 |
if (Object.keys(obs.investigation_results).length > 0) {
|
| 119 |
+
lines.push('--- Investigation Results (EVIDENCE GATHERED) ---');
|
| 120 |
+
for (const [k, v] of Object.entries(obs.investigation_results)) {
|
| 121 |
+
lines.push(` [${k}]: ${v}`);
|
| 122 |
+
}
|
| 123 |
+
lines.push('');
|
| 124 |
}
|
| 125 |
|
| 126 |
+
lines.push('--- Timeline ---');
|
| 127 |
+
for (const t of obs.timeline) {
|
| 128 |
+
lines.push(` ${t}`);
|
| 129 |
+
}
|
| 130 |
+
|
| 131 |
+
if (history.length > 0) {
|
| 132 |
+
lines.push('');
|
| 133 |
+
lines.push('=== PREVIOUS ACTIONS TAKEN ===');
|
| 134 |
+
for (const h of history) {
|
| 135 |
+
lines.push(
|
| 136 |
+
`Turn ${h.turn}: containment=${h.action.containment_action}, ` +
|
| 137 |
+
`investigation=${h.action.investigation_query}, ` +
|
| 138 |
+
`root_cause=${h.action.declare_root_cause}`,
|
| 139 |
+
);
|
| 140 |
+
lines.push(` Justification: ${h.action.justification}`);
|
| 141 |
+
}
|
| 142 |
+
}
|
| 143 |
+
|
| 144 |
+
return lines.join('\n');
|
| 145 |
}
|
| 146 |
|
| 147 |
+
// ─── Hook ────────────────────────────────────────────────────────────────────
|
| 148 |
+
|
| 149 |
export function useEpisode(): EpisodeHook {
|
| 150 |
const [observation, setObservation] = useState<Observation | null>(null);
|
| 151 |
const [state, setState] = useState<EpisodeState | null>(null);
|
| 152 |
const [reward, setReward] = useState<Reward | null>(null);
|
| 153 |
const [history, setHistory] = useState<TurnRecord[]>([]);
|
| 154 |
const [isLoading, setIsLoading] = useState(false);
|
| 155 |
+
const [autopilotPhase, setAutopilotPhase] = useState<AutopilotPhase>('idle');
|
| 156 |
const [error, setError] = useState<string | null>(null);
|
| 157 |
const [isDone, setIsDone] = useState(false);
|
| 158 |
const [healerTriggered, setHealerTriggered] = useState(false);
|
| 159 |
const [aiRawResponse, setAiRawResponse] = useState<string | null>(null);
|
| 160 |
|
| 161 |
+
const isAutopiloting = autopilotPhase !== 'idle';
|
| 162 |
+
|
| 163 |
const reset = useCallback(async (taskName: TaskName) => {
|
| 164 |
setIsLoading(true);
|
| 165 |
setError(null);
|
|
|
|
| 168 |
setIsDone(false);
|
| 169 |
setHealerTriggered(false);
|
| 170 |
setAiRawResponse(null);
|
| 171 |
+
setAutopilotPhase('idle');
|
| 172 |
try {
|
| 173 |
const res = await resetEpisode(taskName);
|
| 174 |
setObservation(res.observation);
|
|
|
|
| 207 |
|
| 208 |
const autopilot = useCallback(async (): Promise<Action | null> => {
|
| 209 |
if (!observation) return null;
|
| 210 |
+
setAutopilotPhase('thinking');
|
| 211 |
setError(null);
|
| 212 |
setHealerTriggered(false);
|
| 213 |
try {
|
| 214 |
+
const messages = generateAutopilotPayload(observation, history);
|
|
|
|
|
|
|
|
|
|
| 215 |
const res = await runAutopilot(messages);
|
| 216 |
setAiRawResponse(res.content);
|
| 217 |
|
| 218 |
const parsed = JSON.parse(res.content) as Action;
|
|
|
|
| 219 |
const reser = JSON.stringify(parsed);
|
| 220 |
if (res.content.trim() !== reser) {
|
| 221 |
setHealerTriggered(true);
|
| 222 |
}
|
| 223 |
+
|
| 224 |
+
setAutopilotPhase('filling');
|
| 225 |
return parsed;
|
| 226 |
} catch (e: unknown) {
|
| 227 |
setError(e instanceof Error ? e.message : 'Autopilot failed');
|
| 228 |
+
setAutopilotPhase('idle');
|
| 229 |
return null;
|
|
|
|
|
|
|
| 230 |
}
|
| 231 |
+
}, [observation, history]);
|
| 232 |
+
|
| 233 |
+
const setPhase = useCallback((phase: AutopilotPhase) => {
|
| 234 |
+
setAutopilotPhase(phase);
|
| 235 |
+
}, []);
|
| 236 |
|
| 237 |
return {
|
| 238 |
observation,
|
|
|
|
| 241 |
history,
|
| 242 |
isLoading,
|
| 243 |
isAutopiloting,
|
| 244 |
+
autopilotPhase,
|
| 245 |
error,
|
| 246 |
isDone,
|
| 247 |
healerTriggered,
|
|
|
|
| 249 |
reset,
|
| 250 |
step,
|
| 251 |
autopilot,
|
| 252 |
+
setAutopilotPhase: setPhase,
|
| 253 |
};
|
| 254 |
}
|
sre-dashboard/src/types/sre.ts
CHANGED
|
@@ -23,6 +23,8 @@ export type RootCause =
|
|
| 23 |
| 'database_lock'
|
| 24 |
| 'unknown';
|
| 25 |
|
|
|
|
|
|
|
| 26 |
export interface Action {
|
| 27 |
containment_action: ContainmentAction;
|
| 28 |
investigation_query: InvestigationQuery;
|
|
|
|
| 23 |
| 'database_lock'
|
| 24 |
| 'unknown';
|
| 25 |
|
| 26 |
+
export type AutopilotPhase = 'idle' | 'thinking' | 'filling' | 'submitting';
|
| 27 |
+
|
| 28 |
export interface Action {
|
| 29 |
containment_action: ContainmentAction;
|
| 30 |
investigation_query: InvestigationQuery;
|
sre_frontend_dist/assets/index-6hP2OA7w.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
sre_frontend_dist/assets/index-BXigT_1l.css
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
|
| 2 |
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:"Inter", system-ui, -apple-system, sans-serif;--font-mono:"JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-sm:24rem;--container-md:28rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-wide:.025em;--tracking-wider:.05em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--radius-2xl:1rem;--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-sre-bg:#0a0e17;--color-sre-surface:#111827;--color-sre-surface-alt:#1a2234;--color-sre-border:#1e293b;--color-sre-border-bright:#334155;--color-sre-text:#94a3b8;--color-sre-text-bright:#e2e8f0;--color-sre-text-muted:#64748b;--color-sre-accent:#38bdf8;--color-sre-accent-dim:#38bdf826;--color-sre-green:#22c55e;--color-sre-green-dim:#22c55e26;--color-sre-yellow:#eab308;--color-sre-yellow-dim:#eab30826;--color-sre-orange:#f97316;--color-sre-orange-dim:#f9731626;--color-sre-red:#ef4444;--color-sre-red-dim:#ef444426;--color-sre-purple:#a855f7;--color-sre-purple-dim:#a855f726;--animate-pulse-glow:pulse-glow 2s ease-in-out infinite}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.right-0{right:calc(var(--spacing) * 0)}.right-2\.5{right:calc(var(--spacing) * 2.5)}.bottom-0{bottom:calc(var(--spacing) * 0)}.left-0{left:calc(var(--spacing) * 0)}.z-40{z-index:40}.z-50{z-index:50}.mx-5{margin-inline:calc(var(--spacing) * 5)}.mx-8{margin-inline:calc(var(--spacing) * 8)}.mx-auto{margin-inline:auto}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-auto{margin-left:auto}.flex{display:flex}.grid{display:grid}.h-0\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-64{height:calc(var(--spacing) * 64)}.h-full{height:100%}.h-screen{height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-16{width:calc(var(--spacing) * 16)}.w-80{width:calc(var(--spacing) * 80)}.w-\[420px\]{width:420px}.w-full{width:100%}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-pulse-glow{animation:var(--animate-pulse-glow)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-b-lg{border-bottom-right-radius:var(--radius-lg);border-bottom-left-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-sre-accent\/20{border-color:#38bdf833}@supports (color:color-mix(in lab, red, red)){.border-sre-accent\/20{border-color:color-mix(in oklab, var(--color-sre-accent) 20%, transparent)}}.border-sre-accent\/30{border-color:#38bdf84d}@supports (color:color-mix(in lab, red, red)){.border-sre-accent\/30{border-color:color-mix(in oklab, var(--color-sre-accent) 30%, transparent)}}.border-sre-border{border-color:var(--color-sre-border)}.border-sre-green\/30{border-color:#22c55e4d}@supports (color:color-mix(in lab, red, red)){.border-sre-green\/30{border-color:color-mix(in oklab, var(--color-sre-green) 30%, transparent)}}.border-sre-green\/50{border-color:#22c55e80}@supports (color:color-mix(in lab, red, red)){.border-sre-green\/50{border-color:color-mix(in oklab, var(--color-sre-green) 50%, transparent)}}.border-sre-orange\/20{border-color:#f9731633}@supports (color:color-mix(in lab, red, red)){.border-sre-orange\/20{border-color:color-mix(in oklab, var(--color-sre-orange) 20%, transparent)}}.border-sre-orange\/30{border-color:#f973164d}@supports (color:color-mix(in lab, red, red)){.border-sre-orange\/30{border-color:color-mix(in oklab, var(--color-sre-orange) 30%, transparent)}}.border-sre-purple\/20{border-color:#a855f733}@supports (color:color-mix(in lab, red, red)){.border-sre-purple\/20{border-color:color-mix(in oklab, var(--color-sre-purple) 20%, transparent)}}.border-sre-purple\/30{border-color:#a855f74d}@supports (color:color-mix(in lab, red, red)){.border-sre-purple\/30{border-color:color-mix(in oklab, var(--color-sre-purple) 30%, transparent)}}.border-sre-red\/30{border-color:#ef44444d}@supports (color:color-mix(in lab, red, red)){.border-sre-red\/30{border-color:color-mix(in oklab, var(--color-sre-red) 30%, transparent)}}.border-sre-yellow\/30{border-color:#eab3084d}@supports (color:color-mix(in lab, red, red)){.border-sre-yellow\/30{border-color:color-mix(in oklab, var(--color-sre-yellow) 30%, transparent)}}.border-t-sre-purple{border-top-color:var(--color-sre-purple)}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-sre-accent{background-color:var(--color-sre-accent)}.bg-sre-accent-dim{background-color:var(--color-sre-accent-dim)}.bg-sre-bg{background-color:var(--color-sre-bg)}.bg-sre-bg\/80{background-color:#0a0e17cc}@supports (color:color-mix(in lab, red, red)){.bg-sre-bg\/80{background-color:color-mix(in oklab, var(--color-sre-bg) 80%, transparent)}}.bg-sre-green{background-color:var(--color-sre-green)}.bg-sre-green-dim{background-color:var(--color-sre-green-dim)}.bg-sre-orange{background-color:var(--color-sre-orange)}.bg-sre-orange-dim{background-color:var(--color-sre-orange-dim)}.bg-sre-purple-dim{background-color:var(--color-sre-purple-dim)}.bg-sre-red{background-color:var(--color-sre-red)}.bg-sre-red-dim{background-color:var(--color-sre-red-dim)}.bg-sre-surface{background-color:var(--color-sre-surface)}.bg-sre-surface-alt{background-color:var(--color-sre-surface-alt)}.bg-sre-surface-alt\/50{background-color:#1a223480}@supports (color:color-mix(in lab, red, red)){.bg-sre-surface-alt\/50{background-color:color-mix(in oklab, var(--color-sre-surface-alt) 50%, transparent)}}.bg-sre-surface\/60{background-color:#11182799}@supports (color:color-mix(in lab, red, red)){.bg-sre-surface\/60{background-color:color-mix(in oklab, var(--color-sre-surface) 60%, transparent)}}.bg-sre-surface\/80{background-color:#111827cc}@supports (color:color-mix(in lab, red, red)){.bg-sre-surface\/80{background-color:color-mix(in oklab, var(--color-sre-surface) 80%, transparent)}}.bg-sre-yellow{background-color:var(--color-sre-yellow)}.bg-sre-yellow-dim{background-color:var(--color-sre-yellow-dim)}.bg-white{background-color:var(--color-white)}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-5{padding-left:calc(var(--spacing) * 5)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.whitespace-pre-wrap{white-space:pre-wrap}.text-sre-accent{color:var(--color-sre-accent)}.text-sre-green{color:var(--color-sre-green)}.text-sre-green\/70{color:#22c55eb3}@supports (color:color-mix(in lab, red, red)){.text-sre-green\/70{color:color-mix(in oklab, var(--color-sre-green) 70%, transparent)}}.text-sre-orange{color:var(--color-sre-orange)}.text-sre-purple{color:var(--color-sre-purple)}.text-sre-red{color:var(--color-sre-red)}.text-sre-text{color:var(--color-sre-text)}.text-sre-text-bright{color:var(--color-sre-text-bright)}.text-sre-text-muted{color:var(--color-sre-text-muted)}.text-sre-yellow{color:var(--color-sre-yellow)}.text-white{color:var(--color-white)}.uppercase{text-transform:uppercase}.italic{font-style:italic}.opacity-0{opacity:0}.opacity-50{opacity:.5}.shadow-\[0_0_12px_rgba\(34\,197\,94\,0\.15\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#22c55e26);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(239\,68\,68\,0\.5\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#ef444480);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_12px_rgba\(249\,115\,22\,0\.4\)\]{--tw-shadow:0 0 12px var(--tw-shadow-color,#f9731666);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-300{--tw-duration:.3s;transition-duration:.3s}@media (hover:hover){.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\[state\=open\]\:rotate-180:is(:where(.group)[data-state=open] *){rotate:180deg}.placeholder\:text-sre-text-muted\/50::placeholder{color:#64748b80}@supports (color:color-mix(in lab, red, red)){.placeholder\:text-sre-text-muted\/50::placeholder{color:color-mix(in oklab, var(--color-sre-text-muted) 50%, transparent)}}@media (hover:hover){.hover\:bg-sre-accent\/25:hover{background-color:#38bdf840}@supports (color:color-mix(in lab, red, red)){.hover\:bg-sre-accent\/25:hover{background-color:color-mix(in oklab, var(--color-sre-accent) 25%, transparent)}}.hover\:bg-sre-border:hover{background-color:var(--color-sre-border)}.hover\:bg-sre-orange\/20:hover{background-color:#f9731633}@supports (color:color-mix(in lab, red, red)){.hover\:bg-sre-orange\/20:hover{background-color:color-mix(in oklab, var(--color-sre-orange) 20%, transparent)}}.hover\:bg-sre-surface-alt:hover{background-color:var(--color-sre-surface-alt)}.hover\:text-sre-text:hover{color:var(--color-sre-text)}.hover\:shadow-\[0_0_20px_rgba\(168\,85\,247\,0\.3\)\]:hover{--tw-shadow:0 0 20px var(--tw-shadow-color,#a855f74d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\:border-sre-accent\/50:focus{border-color:#38bdf880}@supports (color:color-mix(in lab, red, red)){.focus\:border-sre-accent\/50:focus{border-color:color-mix(in oklab, var(--color-sre-accent) 50%, transparent)}}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-sre-accent\/30:focus{--tw-ring-color:#38bdf84d}@supports (color:color-mix(in lab, red, red)){.focus\:ring-sre-accent\/30:focus{--tw-ring-color:color-mix(in oklab, var(--color-sre-accent) 30%, transparent)}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}}@keyframes pulse-glow{0%,to{opacity:1}50%{opacity:.6}}@keyframes slide-up{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}body{background:var(--color-sre-bg);color:var(--color-sre-text);font-family:var(--font-sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0}#root{flex-direction:column;min-height:100dvh;display:flex}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--color-sre-border-bright);border-radius:3px}::-webkit-scrollbar-thumb:hover{background:var(--color-sre-text-muted)}.font-mono{font-family:var(--font-mono)}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}
|
sre_frontend_dist/favicon.svg
ADDED
|
|
sre_frontend_dist/icons.svg
ADDED
|
|
sre_frontend_dist/index.html
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!doctype html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
+
<title>sre-dashboard</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-6hP2OA7w.js"></script>
|
| 9 |
+
<link rel="stylesheet" crossorigin href="/assets/index-BXigT_1l.css">
|
| 10 |
+
</head>
|
| 11 |
+
<body>
|
| 12 |
+
<div id="root"></div>
|
| 13 |
+
</body>
|
| 14 |
+
</html>
|