tailTranscript (index.ts)

openclaw-pixel-agents · realtime, rest-api, websocket, cli-polling, agent-state

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.

// Source: https://github.com/SweetSophia/openclaw-pixel-agents | License: MIT | Copyright 2026 Sherina
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * 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";
impor

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key