File size: 5,189 Bytes
7aeb73a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import os
import gradio as gr

# ============================================================
# Config (HF Variables fallback-safe)
# ============================================================

PFI_SPACE_URL = os.getenv(
    "PFI_SPACE_URL",
    "https://huggingface.co/spaces/MightHubHumAI/pfi-elite-preview"
)

FINC2E_SPACE_URL = os.getenv(
    "FINC2E_SPACE_URL",
    "https://huggingface.co/spaces/MightHubHumAI/FinC2E-Governance"
)

ENGAGEMENT_EMAIL = os.getenv("ENGAGEMENT_EMAIL", "engagement@bpm.ba")
GOVERNANCE_EMAIL = os.getenv("GOVERNANCE_EMAIL", "governance@bpm.ba")

TITLE = "HumAI MightHub"
TAGLINE = "Human-Centered AI Systems for Governance, Compliance & Institutional Decision-Making"

DISCLAIMER = (
    "This portal provides informational content and controlled previews only. "
    "No financial advice, trading signals, legal advice, or decision execution is provided. "
    "Users remain fully responsible for all decisions made based on external information."
)

LICENSING_TIERS = [
    ("Preview", "Open research preview. Limited usage. No personalization. No execution."),
    ("Licensed", "Access codes, higher throughput, structured reasoning layers."),
    ("Enterprise Pilot", "Policy-bound deployments, audit logs, governance workflows, SLAs."),
]


# ============================================================
# Helpers
# ============================================================

def mailto(email: str, subject: str) -> str:
    return f"mailto:{email}?subject={subject.replace(' ', '%20')}"

def build_access_request(org: str, use_case: str) -> str:
    org = org.strip() or "ORGANIZATION / INDIVIDUAL"
    use_case = use_case.strip() or "USE-CASE DESCRIPTION"

    return f"""
ACCESS REQUEST – HumAI MightHub

Organization / Individual:
{org}

Use-case description:
{use_case}

Regulatory context:
(public / internal / confidential / regulated)

Desired access tier:
(Preview / Licensed / Enterprise Pilot)

Contact email:
"""

# ============================================================
# UI
# ============================================================

with gr.Blocks(theme=gr.themes.Soft(), title=TITLE) as demo:

    gr.Markdown(f"""
# {TITLE}

**{TAGLINE}**

**Governance-First — Always.**  
We build AI systems that do not replace responsibility — *they structure it*.
""")

    gr.Markdown("### What this is")
    gr.Markdown("""
- Governance-first AI portal
- Human-in-the-loop by design
- Non-executive, non-autonomous systems
- Audit-ready reasoning interfaces
""")

    gr.Markdown("### Available Previews")

    with gr.Row():
        with gr.Column():
            gr.Markdown("""
### 🧠 Personal Financial Intelligence (PFI)
High-density financial reasoning under strict constraints.
""")
            gr.Button(
                "Open PFI Preview",
                variant="primary"
            ).click(
                None,
                js=f"() => window.open('{PFI_SPACE_URL}', '_blank')"
            )

        with gr.Column():
            gr.Markdown("""
### 🛡️ FinC2E — Governance Gateway
Compliance & risk reasoning for regulated environments.
""")
            gr.Button(
                "Open FinC2E Preview",
                variant="secondary"
            ).click(
                None,
                js=f"() => window.open('{FINC2E_SPACE_URL}', '_blank')"
            )

    gr.Markdown("---")
    gr.Markdown("## Licensing & Access")

    tier_md = "\n".join([f"- **{name}** — {desc}" for name, desc in LICENSING_TIERS])
    gr.Markdown(tier_md)

    gr.Markdown("### Request Licensed / Enterprise Access")

    with gr.Row():
        org_input = gr.Textbox(
            label="Organization / Individual",
            placeholder="e.g. Bank, Fund, Regulator, Enterprise"
        )
        use_case_input = gr.Textbox(
            label="Use-case description",
            lines=3,
            placeholder="e.g. AML triage, portfolio risk framing, audit-ready explanations"
        )

    template_out = gr.Textbox(
        label="Copy-paste access request",
        lines=10
    )

    gr.Button("Generate access request template").click(
        build_access_request,
        inputs=[org_input, use_case_input],
        outputs=template_out
    )

    gr.Markdown("### Contact")

    with gr.Row():
        gr.Button("Email Engagement").click(
            None,
            js=f"() => window.location.href='{mailto(ENGAGEMENT_EMAIL, 'HumAI Access Request')}'"
        )
        gr.Button("Email Governance").click(
            None,
            js=f"() => window.location.href='{mailto(GOVERNANCE_EMAIL, 'Governance & Compliance Inquiry')}'"
        )

    gr.Markdown("---")
    gr.Markdown("## Governance & Safety")
    gr.Markdown("""
- Human-in-the-loop by design  
- No autonomous execution  
- No trading signals or financial advice  
- Policy-bound operation for regulated environments  
""")

    gr.Markdown(f"**Disclaimer:** {DISCLAIMER}")
    gr.Markdown("© 2026 BPM RED Academy. All rights reserved.")

# ============================================================
# Launch
# ============================================================

if __name__ == "__main__":
    demo.launch()