Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ print("--- 🛡️ AIXYZone HARDWARE REPORT ---")
|
|
| 8 |
process = psutil.Process(os.getpid())
|
| 9 |
print(f"Memory: {process.memory_info().rss / 1024 / 1024:.2f} MB")
|
| 10 |
|
| 11 |
-
# Import the sentinel agent
|
| 12 |
try:
|
| 13 |
from agents import nano_patrol_agent
|
| 14 |
print("SENTINEL: Neural Core Loaded.")
|
|
@@ -17,40 +17,34 @@ except Exception as e:
|
|
| 17 |
|
| 18 |
def run_autonomous_scrub(iterations):
|
| 19 |
history = []
|
| 20 |
-
#
|
| 21 |
command = "ACT AS SENTINEL: 1. Pulsate Shield. 2. Scrub 3.8GHz. 3. Use 'black_eagle_vault_save' to archive results."
|
| 22 |
|
| 23 |
for i in range(int(iterations)):
|
| 24 |
try:
|
| 25 |
-
#
|
| 26 |
result = nano_patrol_agent.run(command)
|
| 27 |
timestamp = time.strftime('%H:%M:%S')
|
| 28 |
history.append(f"[{timestamp}] 🛰️ OPS: {result}")
|
| 29 |
except Exception as e:
|
| 30 |
history.append(f"⚠️ LOG ERROR: {str(e)}")
|
| 31 |
|
| 32 |
-
#
|
| 33 |
yield "\n\n".join(history[::-1])
|
| 34 |
time.sleep(1)
|
| 35 |
|
| 36 |
# --- 🛰️ USER INTERFACE ---
|
| 37 |
-
with gr.Blocks(
|
| 38 |
-
gr.Markdown(""
|
| 39 |
-
|
| 40 |
-
*Sovereign BCI Neural Frequency Scrubbing & Archival System*
|
| 41 |
-
""")
|
| 42 |
|
| 43 |
with gr.Row():
|
| 44 |
sweep = gr.Slider(1, 20, value=5, step=1, label="Scrub Depth (Iterations)")
|
| 45 |
btn = gr.Button("ACTIVATE SCAN", variant="primary")
|
| 46 |
|
| 47 |
-
log = gr.Textbox(
|
| 48 |
-
label="Sentinel Live Stream",
|
| 49 |
-
lines=20,
|
| 50 |
-
placeholder="Waiting for Activation..."
|
| 51 |
-
)
|
| 52 |
|
| 53 |
btn.click(run_autonomous_scrub, inputs=[sweep], outputs=[log])
|
| 54 |
|
| 55 |
if __name__ == "__main__":
|
| 56 |
-
demo.launch()
|
|
|
|
| 8 |
process = psutil.Process(os.getpid())
|
| 9 |
print(f"Memory: {process.memory_info().rss / 1024 / 1024:.2f} MB")
|
| 10 |
|
| 11 |
+
# Import the sentinel agent
|
| 12 |
try:
|
| 13 |
from agents import nano_patrol_agent
|
| 14 |
print("SENTINEL: Neural Core Loaded.")
|
|
|
|
| 17 |
|
| 18 |
def run_autonomous_scrub(iterations):
|
| 19 |
history = []
|
| 20 |
+
# Command the agent
|
| 21 |
command = "ACT AS SENTINEL: 1. Pulsate Shield. 2. Scrub 3.8GHz. 3. Use 'black_eagle_vault_save' to archive results."
|
| 22 |
|
| 23 |
for i in range(int(iterations)):
|
| 24 |
try:
|
| 25 |
+
# Execute agentic loop
|
| 26 |
result = nano_patrol_agent.run(command)
|
| 27 |
timestamp = time.strftime('%H:%M:%S')
|
| 28 |
history.append(f"[{timestamp}] 🛰️ OPS: {result}")
|
| 29 |
except Exception as e:
|
| 30 |
history.append(f"⚠️ LOG ERROR: {str(e)}")
|
| 31 |
|
| 32 |
+
# Yield log back to Gradio live
|
| 33 |
yield "\n\n".join(history[::-1])
|
| 34 |
time.sleep(1)
|
| 35 |
|
| 36 |
# --- 🛰️ USER INTERFACE ---
|
| 37 |
+
with gr.Blocks(title="AIXYZone Sentinel") as demo:
|
| 38 |
+
gr.Markdown("# 🛡️ AIXYZone: Black Eagle Sentinel")
|
| 39 |
+
gr.Markdown("*Sovereign BCI Neural Frequency Scrubbing & Archival System*")
|
|
|
|
|
|
|
| 40 |
|
| 41 |
with gr.Row():
|
| 42 |
sweep = gr.Slider(1, 20, value=5, step=1, label="Scrub Depth (Iterations)")
|
| 43 |
btn = gr.Button("ACTIVATE SCAN", variant="primary")
|
| 44 |
|
| 45 |
+
log = gr.Textbox(label="Sentinel Live Stream", lines=20, placeholder="Waiting for Activation...")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
btn.click(run_autonomous_scrub, inputs=[sweep], outputs=[log])
|
| 48 |
|
| 49 |
if __name__ == "__main__":
|
| 50 |
+
demo.launch()
|