superbrain-server 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/start.py +35 -0
package/package.json
CHANGED
package/payload/start.py
CHANGED
|
@@ -1266,6 +1266,41 @@ def launch_backend():
|
|
|
1266
1266
|
# ══════════════════════════════════════════════════════════════════════════════
|
|
1267
1267
|
# Main
|
|
1268
1268
|
# ══════════════════════════════════════════════════════════════════════════════
|
|
1269
|
+
|
|
1270
|
+
def launch_backend_status():
|
|
1271
|
+
h1("SuperBrain Status")
|
|
1272
|
+
|
|
1273
|
+
token = "UNKNOWN"
|
|
1274
|
+
if TOKEN_FILE.exists():
|
|
1275
|
+
token = TOKEN_FILE.read_text(encoding="utf-8").strip()
|
|
1276
|
+
|
|
1277
|
+
url = "NOT_FOUND"
|
|
1278
|
+
log_file = BACKEND_DIR / "config" / "localtunnel.log"
|
|
1279
|
+
if log_file.exists():
|
|
1280
|
+
match = re.search(r"your url is: (https://[^\s]+)", log_file.read_text(encoding="utf-8"))
|
|
1281
|
+
if match:
|
|
1282
|
+
url = match.group(1)
|
|
1283
|
+
|
|
1284
|
+
if url == "NOT_FOUND":
|
|
1285
|
+
warn("Could not find a running localtunnel URL in config/localtunnel.log.")
|
|
1286
|
+
nl()
|
|
1287
|
+
print(" Wait 5 seconds, or run 'superbrain-server' to start the server.")
|
|
1288
|
+
return
|
|
1289
|
+
|
|
1290
|
+
_display_connect_qr(url, token)
|
|
1291
|
+
|
|
1292
|
+
local_url = "http://127.0.0.1:5000"
|
|
1293
|
+
local_ip = _detect_local_ip()
|
|
1294
|
+
network_url = f"http://{local_ip}:5000"
|
|
1295
|
+
|
|
1296
|
+
nl()
|
|
1297
|
+
print(f" Local URL ? {CYAN}{local_url}{RESET}")
|
|
1298
|
+
print(f" Network URL ? {CYAN}{network_url}{RESET}")
|
|
1299
|
+
print(f" Public URL ? {CYAN}{url}{RESET} (localtunnel)")
|
|
1300
|
+
print(f" API docs ? {CYAN}{local_url}/docs{RESET}")
|
|
1301
|
+
print(f" Access Token ? {BOLD}{MAGENTA}{token}{RESET}")
|
|
1302
|
+
nl()
|
|
1303
|
+
|
|
1269
1304
|
def main():
|
|
1270
1305
|
os.chdir(BASE_DIR)
|
|
1271
1306
|
banner()
|