lab-link¶
lab-link is a small synchronization library for laboratory control software.
It keeps Python instrument services authoritative while giving browser UIs a
typed, reactive view of state.
The core protocol is simple:
- A browser connects over WebSocket and receives a state snapshot.
- The server broadcasts JSON Patch updates with version and command metadata.
- The browser sends commands.
- The server validates, performs side effects, commits state, then sends patch and command acknowledgement or a structured command error.
Packages¶
lab-link is intentionally split into two packages:
lab-linkon PyPI: the Starlette/Pydantic backend runtime and Python sync client.lab-linkon npm: framework-neutral browser runtime plus Svelte and React adapters.
Publish both packages from the same git tag and keep their versions aligned. That makes app dependency constraints easy to reason about: backend and frontend protocol changes share one semantic version.