Some checks failed
CI / Typecheck & Lint (pull_request) Failing after 0s
- artifacts/api-server/src/routes/events.ts: WebSocket bridge at /api/ws
EventBus → Matrix protocol (agent_state, job_created, job_complete, agent_count, ping)
- artifacts/api-server/src/index.ts: HTTP server wraps WS attachment on /api/ws
- artifacts/api-server/src/app.ts: Serve Matrix dist at /tower with __dirname-based
path (fix process.cwd() resolution when CWD is api-server dir)
- the-matrix/js/agents.js: Extended update() with 4 visual states:
idle/active/thinking/working (glow, ring speed, emissive intensity, scale all vary)
- the-matrix/index.html: Rewritten with sliding payment panel (step machine:
input → eval-invoice → work-invoice → result), ⚡ SUBMIT JOB button
- the-matrix/js/payment.js: Full job submission flow; create→eval→work→result
with stub payment support and polling
- the-matrix/js/main.js: Import initPaymentPanel, call on firstInit; fix SW path
to use BASE_URL
- the-matrix/js/websocket.js: Auto-derive WS URL from window.location
- scripts/e2e-test.sh: Full E2E integration test — 10/10 PASS verified
Closes integration sprint T001-T005. E2E verified: Mode1 + Mode2 full flows pass.
30 lines
863 B
TypeScript
30 lines
863 B
TypeScript
import { createServer } from "http";
|
|
import app from "./app.js";
|
|
import { attachWebSocketServer } from "./routes/events.js";
|
|
import { rootLogger } from "./lib/logger.js";
|
|
|
|
const rawPort = process.env["PORT"];
|
|
|
|
if (!rawPort) {
|
|
throw new Error("PORT environment variable is required but was not provided.");
|
|
}
|
|
|
|
const port = Number(rawPort);
|
|
|
|
if (Number.isNaN(port) || port <= 0) {
|
|
throw new Error(`Invalid PORT value: "${rawPort}"`);
|
|
}
|
|
|
|
const server = createServer(app);
|
|
attachWebSocketServer(server);
|
|
|
|
server.listen(port, () => {
|
|
rootLogger.info("server started", { port });
|
|
const domain = process.env["REPLIT_DEV_DOMAIN"];
|
|
if (domain) {
|
|
rootLogger.info("public url", { url: `https://${domain}/api/ui` });
|
|
rootLogger.info("tower url", { url: `https://${domain}/tower` });
|
|
rootLogger.info("ws url", { url: `wss://${domain}/api/ws` });
|
|
}
|
|
});
|