OpenClaw Pixel Agents — Backend Server Polls the OpenClaw Gateway for agent states via the CLI and exposes them via REST + WebSocket. Uses `openclaw sessions --all-agents --json` as the data source — simpler and more stable than implementing the full Gateway WebSocket protocol.
/**
* OpenClaw Pixel Agents — Backend Server
*
* Polls the OpenClaw Gateway for agent states via the CLI and exposes them via REST + WebSocket.
* Uses `openclaw sessions --all-agents --json` as the data source — simpler and more stable
* than implementing the full Gateway WebSocket protocol.
*/
import { execFile } from "node:child_process";
import { isIP } from "node:net";
import express from "express";
import { createServer } from "http";
import { Server as SocketIOServer } from "socket.io";
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync, unlinkSync, createReadStream } from "node:fs";
import { stat as statAsync } from "node:fs/promises";
import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
import { join, resolve } from "node:path";
import
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search 40K more like it.
Get a free API key