feat(livestreamassist): add resilient JavaScript overlay client

Add a JSON-RPC client, session-aware game queries, and generated offline locale data. Update research and stats overlays with cancellable single-flight polling and reconnect handling.

Add 41 JavaScript regression tests, Python locale and formatting checks, and generation and validation documentation.
This commit is contained in:
soarqin committed 2026-09-18 01:59:53 +08:00
1 parent 92e6511d91
commit f03d6c758e
25 files changed
+3330 -70

No files matched your search

+6 -1
View File
@@ -26,7 +26,12 @@ Port = 18080
Then connect to `ws://<host>:18080/api/v1`. There is no authentication. Use a LAN bind address or `0.0.0.0` only on trusted networks. Configuration changes require a game restart.
Open [examples/research-overlay.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/research-overlay.html) in a browser or OBS Browser Source to show the current research ID, level, and hash progress. Default URL is `ws://127.0.0.1:18080/api/v1`; override with `?ws=`.
Open the overlay examples in a browser or OBS Browser Source. Default URL is `ws://127.0.0.1:18080/api/v1`; override with `?ws=`.
- [examples/research-overlay.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/research-overlay.html) shows the current research name, level, and hash progress.
- [examples/stats-overlay.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/stats-overlay.html) also shows item production/consumption per minute and Dyson sphere generation.
The overlays use the [JS client](js/README.md): `Client` for JSON-RPC, `GameQuery` for those reads, and `GameText` for localized names and DSP KMG formatting. Keep the `examples/` and `js/` directories side by side when copying an overlay. `GameText` does not call the WebSocket API; regenerate `js/generated/dsp-text.js` from the repository root with `python LiveStreamAssist/js/scripts/generate_text.py`.
- [WebSocket API reference](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/docs/WebSocketApi.md)
- [WebSocket design and transport migration plan](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/docs/WebSocketDesign.md)