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

+4 -2
View File
@@ -12,7 +12,8 @@
- This repository contains independent BepInEx 5.x C# mods for Dyson Sphere Program. HarmonyLib patches game methods at runtime; `UXAssist` is the shared library used directly by `CheatEnabler` and `UniverseGenTweaks`.
- Projects target `net472` or `netstandard2.1` with SDK-style `.csproj` files. Compile-time game references live in `AssemblyFromGame/`.
- `DustbinPreloader` and `LabOptPreloader` are Mono.Cecil preloaders; their main mods consume the injected fields without reflection.
- LiveStreamAssist: [WebSocket architecture, transport migration, and validation](LiveStreamAssist/docs/WebSocketDesign.md).
- LiveStreamAssist: [WebSocket architecture, transport migration, and validation](LiveStreamAssist/docs/WebSocketDesign.md). Overlay JS client: [LiveStreamAssist/js/README.md](LiveStreamAssist/js/README.md).
- LiveStreamAssist JS clients keep `Client` as the JSON-RPC transport, `GameQuery` as the overlay data layer, and `GameText` offline from generated locale/proto dictionaries. Do not have `GameText` call the WebSocket API. Edit `js/src/` and rebuild the bundle with `python LiveStreamAssist/js/scripts/pack_js.py`; refresh `js/generated/dsp-text.js` with `python LiveStreamAssist/js/scripts/generate_text.py` from a local DSP install. Run the JS and Python checks documented in `LiveStreamAssist/js/README.md`.
## Build
@@ -33,6 +34,7 @@
- Performance-sensitive Harmony transpilers must include the standard target/fallback header and use `TranspilerGuard` when a matcher can fail; returning original instructions is the fallback.
- `PatchImpl<T>.Enable(true)` must remain fail-soft: log, unpatch, and leave the patch unset if Harmony application fails so config delegate chains remain consistent.
- Overlay UI state must converge from actual game state on periodic updates, not depend only on one-shot event or patch callbacks. Cloned controls must reset runtime state while retaining source styles; use `UXAssist.UI.Util.GetPreferredWidth` for dynamic text and `ResetButton` for cloned buttons.
- LiveStreamAssist browser overlays must use single-flight polling and discard stale work after connection changes. Compound queries must reject mixed session IDs; cache only positive production indices so newly tracked items remain discoverable.
## Automation Architecture
@@ -52,5 +54,5 @@
## Review Standard
- Fix root causes with minimal focused changes. Do not alter unrelated behavior, add copyright headers, commit changes, or create branches unless requested.
- Fix root causes with minimal focused changes. Do not alter unrelated behavior, add copyright headers, commit changes, push branches, or create branches unless requested. Use normal pushes; do not rewrite remote history unless explicitly requested.
- Before handoff, run the narrowest relevant build or test, then `git diff --check`. Mention unrelated pre-existing failures instead of changing them.