feat(ui): NEXUSMON operator-grade shell — app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
Public ritual space. Part of the Nexusmon sovereign AI organism.
|
| 4 |
"""
|
| 5 |
from __future__ import annotations
|
|
|
|
| 6 |
import time
|
| 7 |
from pathlib import Path
|
| 8 |
import gradio as gr
|
|
@@ -11,11 +12,37 @@ ORG_URL = "https://huggingface.co/Nexusmon"
|
|
| 11 |
FRONT_DOOR_URL = "https://huggingface.co/spaces/Nexusmon/README"
|
| 12 |
RANKING_URL = "https://huggingface.co/spaces/Nexusmon/hf-nexusmon-ranking"
|
| 13 |
KNOWLEDGE_URL = "https://huggingface.co/spaces/Nexusmon/hf-nexusmon-knowledge"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
def build() -> str:
|
| 16 |
now = time.strftime("%Y-%m-%d %H:%M UTC", time.gmtime())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
return f"""
|
| 18 |
<div class="nx-root">
|
|
|
|
| 19 |
<header class="nx-header">
|
| 20 |
<div class="nx-header-left">
|
| 21 |
<span class="nx-eyebrow">NEXUSMON / public ritual space</span>
|
|
|
|
| 3 |
Public ritual space. Part of the Nexusmon sovereign AI organism.
|
| 4 |
"""
|
| 5 |
from __future__ import annotations
|
| 6 |
+
import base64
|
| 7 |
import time
|
| 8 |
from pathlib import Path
|
| 9 |
import gradio as gr
|
|
|
|
| 12 |
FRONT_DOOR_URL = "https://huggingface.co/spaces/Nexusmon/README"
|
| 13 |
RANKING_URL = "https://huggingface.co/spaces/Nexusmon/hf-nexusmon-ranking"
|
| 14 |
KNOWLEDGE_URL = "https://huggingface.co/spaces/Nexusmon/hf-nexusmon-knowledge"
|
| 15 |
+
PRESENCE_BANNER = "nexusmon-presence.svg"
|
| 16 |
+
|
| 17 |
+
def _presence_banner_src() -> str | None:
|
| 18 |
+
candidates = [
|
| 19 |
+
Path(__file__).resolve().parent / "assets" / PRESENCE_BANNER,
|
| 20 |
+
Path(__file__).resolve().parents[4] / "assets" / PRESENCE_BANNER,
|
| 21 |
+
]
|
| 22 |
+
for candidate in candidates:
|
| 23 |
+
if candidate.is_file():
|
| 24 |
+
encoded = base64.b64encode(candidate.read_bytes()).decode("ascii")
|
| 25 |
+
return f"data:image/svg+xml;base64,{encoded}"
|
| 26 |
+
return None
|
| 27 |
|
| 28 |
def build() -> str:
|
| 29 |
now = time.strftime("%Y-%m-%d %H:%M UTC", time.gmtime())
|
| 30 |
+
banner_src = _presence_banner_src()
|
| 31 |
+
if banner_src:
|
| 32 |
+
banner = f"""
|
| 33 |
+
<div class="nx-presence-frame" style="margin-bottom: 1rem; padding: 0.7rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; background: rgba(255,255,255,0.02); box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);">
|
| 34 |
+
<img src="{banner_src}" alt="NEXUSMON presence banner" style="display:block;width:100%;height:auto;border-radius:18px;" />
|
| 35 |
+
</div>
|
| 36 |
+
""".strip()
|
| 37 |
+
else:
|
| 38 |
+
banner = """
|
| 39 |
+
<div class="nx-presence-frame" style="margin-bottom: 1rem; padding: 1rem 1.2rem; border: 1px solid rgba(255,255,255,0.08); border-radius: 24px; background: rgba(255,255,255,0.02); color: #8fefff; text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.72rem;">
|
| 40 |
+
NEXUSMON presence banner unavailable
|
| 41 |
+
</div>
|
| 42 |
+
""".strip()
|
| 43 |
return f"""
|
| 44 |
<div class="nx-root">
|
| 45 |
+
{banner}
|
| 46 |
<header class="nx-header">
|
| 47 |
<div class="nx-header-left">
|
| 48 |
<span class="nx-eyebrow">NEXUSMON / public ritual space</span>
|