push updated state to clients over SSE (ISS-129)
CI / build + unit + e2e (pull_request) Successful in 11m7s

This commit is contained in:
2026-09-22 20:44:13 +00:00
parent 9b2938a5b0
commit 1983d17099
13 changed files with 354 additions and 21 deletions
+16
View File
@@ -51,6 +51,22 @@ export const openApiSpec = {
},
},
},
'/api/events': {
get: {
summary: 'Live state stream (SSE)',
description:
'Server-Sent Events feed of full game-state snapshots (v0.57.0, ISS-129) — the current snapshot is sent immediately on connect and a fresh one after every sim tick (~1 s), so clients can subscribe instead of polling /api/state. Each event\'s data payload is JSON with exactly the StateSnapshot shape; comment lines starting with ":" are heartbeats.',
operationId: 'subscribeToEvents',
responses: {
200: {
description: 'SSE stream of state snapshots (text/event-stream)',
content: {
'text/event-stream': { schema: { type: 'string' } },
},
},
},
},
},
'/api/version': {
get: {
summary: 'App version',