import streamlit as st import pandas as pd import requests import time import json import hashlib st.set_page_config(page_title="Autonomous Dispatch Engine", layout="wide") TARGET_ENDPOINT = "http://localhost:8000/api/submit" st.title("📡 Autonomous Payload Dispatch Engine") # Rebuild your payload matrix payload_logs = [] nodes = ["MSRC-US-EAST", "KERNEL-EU-WEST", "APPLE-CNA-PACIFIC", "CISA-VDP-DC", "CERT-CC-CORE", "SEC-EDGAR-WORM"] for i in range(50): cve_id = f"CVE-2026-{10000 + i}" json_str = json.dumps({"dataType": "CVE_RECORD", "cveId": cve_id}) sha_proof = hashlib.sha256(json_str.encode()).hexdigest() payload_logs.append({ "cve": cve_id, "target_node": nodes[i % len(nodes)], "sha256": sha_proof, "schema": "CVE 5.0 / CSAF 2.0" }) df = pd.DataFrame(payload_logs) st.dataframe(df, use_container_width=True) if st.button("🚀 Start Autonomous Transmission"): st.info("Transmission sequence initiated...") progress_bar = st.progress(0) status_text = st.empty() for i, row in df.iterrows(): payload_data = {"cve": row["cve"], "target_node": row["target_node"], "sha256": row["sha256"]} try: res = requests.post(TARGET_ENDPOINT, json=payload_data, timeout=5) if res.status_code == 200: status_text.success(f"Dispatched {row['cve']} to {row['target_node']}") else: status_text.error(f"Failed {row['cve']} - HTTP {res.status_code}") except Exception as e: status_text.error(f"Timeout connecting to {row['target_node']}") progress_bar.progress((i + 1) / len(df)) time.sleep(0.5) st.success("Transmission sequence complete.")