Replace per-keystroke Matrix timeline events with a LiveKit data
channel for real-time Automerge delta delivery:
- Add livekit-client dependency
- New useDocumentRTC hook:
- Calls client._unstable_getRTCTransports() to get SFU URL
- Exchanges Matrix OpenID token with SFU (/sfu/get) for LiveKit JWT
- Connects to LiveKit room in data-only mode (autoSubscribe: false)
- Exposes publishDelta(bytes) and onDeltaRef callback
- Falls back gracefully if no LiveKit transport configured
- DocumentView wiring:
- useDocumentSync now accepts optional rtc transport
- When LiveKit connected: send deltas via data channel (50ms debounce)
- When LiveKit not available: fall back to Matrix timeline events (500ms)
- Matrix event listener disabled when LiveKit is connected
- Snapshots still go via Matrix state events (every 20 deltas + on close)
- __docDebug() now shows rtcConnected status
Benefits: no homeserver rate limiting on deltas, ~50ms latency vs
~500ms+sync, no delta events cluttering the room timeline.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Replace copy-res with a webpack plugin
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Specify writeToDisk=true for webpack-dev-server
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
* Use async fs methods
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
mkdir apps/web/scripts
mv scripts/{cleanup.sh,ci_package.sh,copy-res.ts,deploy.py,package.sh} apps/web/scripts
And a couple of gitignore tweaks
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>