Protocol

JSON over TCP, newline-delimited. Client sends one command per connection. Relay processes and responds with a single JSON line.

Client → Relay

{"action":"ping"}
{"action":"list_chats","limit":100}
{"action":"get_messages","chat_guid":"...","limit":50,"describe_images":true}
{"action":"send","chat_guid":"...","text":"hello"}

Relay → Client

{"pong": true}
[{...chat objects...}]
[{...message objects...}]
{"sent": true, "guid":"..."}
{"error":"..."}