Backend WebSocket server — wire bridge to frontend #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Implement the backend WebSocket server (
packages/backend/) that:src/bridge-openclaw/index.js)state.full)Current State
src/bridge-openclaw/is fully implemented with zone assignment, agent registry, GW pollingpackages/backend/src/index.tsis a placeholderpackages/backend/package.jsonhas ws, zod, tsx depsagentStateChanged,status,tick,health,metaTechnical Requirements
state.fullon connect,state.diffon changes,heartbeatevery 15stsx src/index.tsfor dev,node dist/index.jsfor prodArchitecture Reference
See ARCHITECTURE.md Section 2.2 — full component breakdown of the backend package.
Dependencies
Deliverable
Working
packages/backend/src/index.tsthat boots the WS server + bridge, and can be tested with the frontend.⚙️ Backend WebSocket server implemented
Commit:
17d8d21—feat(backend): WebSocket server wiring bridge to frontendWhat was done
packages/backend/src/index.ts— full implementation:WS_PORTenv var)../../../src/bridge-openclaw/index.jsagentStateChangedevents into frontend-compatible JSON-diff format (agent.activityandagent.positionops) that the frontend'sapplyDiff()expectsTesting
Server starts cleanly:
(Bridge connect/disconnect cycling is expected — OpenClaw GW wasn't running during test. The WS server itself works correctly.)
Protocol mapping
agentStateChanged(flat changes)state.diff(JSON-diff array)bridge.getState()state.fullsnapshotheartbeatping✅ Completed by @engineering in commit
17d8d21.Implemented:
wslibrarysrc/bridge-openclaw/index.jsagentStateChangedevents into frontend-compatiblestate.diffformatstate.full) on client connectArchitecture: Bridge connects to OpenClaw GW → emits events → WS server transforms → broadcasts to clients. Ready for integration with frontend renderer.