diff --git a/app.js b/app.js index ac5e752a..decbf0db 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,10 @@ import { ReasoningTrace } from './nexus/components/reasoning-trace.js'; // NEXUS v1.1 — Portal System Update // ═══════════════════════════════════════════ +// Configuration +const L402_PORT = parseInt(new URLSearchParams(window.location.search).get('l402_port') || '8080'); +const L402_URL = `http://localhost:${L402_PORT}/api/cost-estimate`; + const NEXUS = { colors: { primary: 0x4af0c0, @@ -681,7 +685,7 @@ function updateGOFAI(delta, elapsed) { // Simulate calibration update calibrator.update({ input_tokens: 100, complexity_score: 0.5 }, 0.06); - if (Math.random() > 0.95) l402Client.fetchWithL402("http://localhost:8080/api/cost-estimate"); + if (Math.random() > 0.95) l402Client.fetchWithL402(L402_URL); } metaLayer.track(startTime); diff --git a/l402_server.py b/l402_server.py index e83d929e..b9988c50 100644 --- a/l402_server.py +++ b/l402_server.py @@ -3,6 +3,7 @@ from http.server import HTTPServer, BaseHTTPRequestHandler import json import secrets +import os class L402Handler(BaseHTTPRequestHandler): def do_GET(self): @@ -25,7 +26,9 @@ class L402Handler(BaseHTTPRequestHandler): self.send_response(404) self.end_headers() -def run(server_class=HTTPServer, handler_class=L402Handler, port=8080): +def run(server_class=HTTPServer, handler_class=L402Handler, port=None): + if port is None: + port = int(os.environ.get('L402_PORT', 8080)) server_address = ('', port) httpd = server_class(server_address, handler_class) print(f"Starting L402 Skeleton Server on port {port}...") diff --git a/mempalace/fleet_api.py b/mempalace/fleet_api.py index 76b3c0be..ccc8d965 100644 --- a/mempalace/fleet_api.py +++ b/mempalace/fleet_api.py @@ -27,7 +27,7 @@ Usage: python mempalace/fleet_api.py # Custom host/port/palace: - FLEET_PALACE_PATH=/data/fleet python mempalace/fleet_api.py --host 0.0.0.0 --port 8080 + FLEET_PALACE_PATH=/data/fleet python mempalace/fleet_api.py --host 0.0.0.0 --port 7772 Refs: #1078, #1075, #1085 """