File size: 3,516 Bytes
bbe2211
7655fd6
 
a438938
bbe2211
d203412
7655fd6
 
d6a094c
 
7655fd6
 
 
 
 
 
 
 
 
 
a438938
7655fd6
 
a438938
 
 
 
 
 
 
7655fd6
 
 
1d377e2
7655fd6
 
1d377e2
a438938
ebdbbf6
a438938
1d377e2
a438938
1d377e2
 
ebdbbf6
a438938
 
1d377e2
ebdbbf6
 
 
 
a438938
 
1d377e2
a438938
 
 
 
7655fd6
ebdbbf6
7655fd6
 
 
ebdbbf6
a438938
ebdbbf6
a438938
 
 
 
7655fd6
d203412
7655fd6
 
 
d6a094c
a438938
ebdbbf6
7655fd6
a438938
7655fd6
ebdbbf6
7655fd6
d6a094c
7655fd6
 
 
d6a094c
a438938
ebdbbf6
a438938
 
 
 
7655fd6
16a1427
7655fd6
 
 
16a1427
a438938
16a1427
a438938
 
 
 
7655fd6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
"""
Minimalist, Math-First ARF UI Components
Compatible with Gradio 6+ and Hugging Face Spaces
Version: v1.1
"""

from __future__ import annotations
from typing import Dict, List, Any, Optional
import gradio as gr

# -----------------------------
# Header & Footer
# -----------------------------
def create_header(version: str = "3.3.6", is_enterprise: bool = False):
    """Minimalist header with version and mode."""
    header_text = f"🚀 Agentic Reliability Framework v{version} · "
    header_text += "ENTERPRISE" if is_enterprise else "OSS Edition"
    return gr.Markdown(header_text, elem_classes=["mono"])

def create_footer():
    """Minimalist footer."""
    return gr.Markdown("ARF © 2025 · Self-Healing Agentic Systems", elem_classes=["mono"])

# -----------------------------
# Status Bar
# -----------------------------
def create_status_bar():
    """Minimalist status bar."""
    return gr.Markdown("**Status:** idle", elem_classes=["mono"])

# -----------------------------
# Tab 1: Incident Demo
# -----------------------------
def create_tab1_incident_demo(
    scenarios: Dict[str, Any],
    healing_intents: Optional[List[Dict[str, Any]]] = None
):
    """Minimalist Incident Demo tab."""
    with gr.Column():
        # Scenario selector
        scenario_dropdown = gr.Dropdown(
            label="Incident Scenario",
            choices=list(scenarios.keys()),
            value=list(scenarios.keys())[0],
        )

        # Execution mode selector
        execution_mode = gr.Radio(
            label="Execution Mode",
            choices=["advisory", "approval", "autonomous"],
            value="advisory",
        )

        # Run analysis button
        run_button = gr.Button("Run Analysis", variant="primary")

        # Display area for metrics/results
        metrics_display = gr.Markdown("```\nExecution state: idle\n```", elem_classes=["mono"])

    return scenario_dropdown, execution_mode, run_button, metrics_display

# -----------------------------
# Tab 2: Business ROI
# -----------------------------
def create_tab2_business_roi():
    """Minimalist Business ROI display."""
    with gr.Column():
        roi_markdown = gr.Markdown(
            "## Business Impact & ROI\n```\nROI calculations will appear here\n```",
            elem_classes=["mono"]
        )
    return roi_markdown

# -----------------------------
# Tab 3: Enterprise Features
# -----------------------------
def create_tab3_enterprise_features():
    """Minimalist Enterprise Features display."""
    with gr.Column():
        features_markdown = gr.Markdown(
            "## Enterprise Features\n- Full audit trail\n- Approval modes\n- Automated healing\n",
            elem_classes=["mono"]
        )
    return features_markdown

# -----------------------------
# Tab 4: Audit Trail
# -----------------------------
def create_tab4_audit_trail():
    """Minimalist Audit Trail display."""
    with gr.Column():
        audit_markdown = gr.Markdown(
            "## Audit Trail & History\n```\nRecent actions will appear here\n```",
            elem_classes=["mono"]
        )
    return audit_markdown

# -----------------------------
# Tab 5: Learning Engine
# -----------------------------
def create_tab5_learning_engine():
    """Minimalist Learning Engine display."""
    with gr.Column():
        learning_markdown = gr.Markdown(
            "## Learning Engine Stats\n```\nModel improvements and patterns\n```",
            elem_classes=["mono"]
        )
    return learning_markdown