Optionaloptions: Partial<LiveKitWorkerRoomClientOptions>Connects the worker to the LiveKit room. Never hangs: spawn failure, early worker death, or the connect timeout falls back to the in-process client (when a fallback factory is configured) and logs once; LiveKit-level join errors are rethrown as-is.
Disconnects from the room and terminates the worker (never waits longer than the disconnect timeout).
Drops all queued outbound audio immediately across the worker thread boundary.
Returns the current participant roster (including the bot).
Returns the most recent telemetry snapshot (refreshed in the background; see RefreshTelemetry).
Registers the inbound per-participant subscribed-audio callback. "Latest handler wins."
Registers the handler for a change in what the room is shown of the avatar (the worker's, or the fallback client's).
Registers the room-disconnected callback. Raised on server-side room close AND when the media worker cannot be recovered (restarts exhausted, rejoin rejected, token too old), with a reason string.
Registers the participant-connected callback.
Registers the participant-disconnected callback (identity of the participant that left).
Registers the inbound video handler (frames the worker sampled and encoded, or the fallback client's).
Registers the handler for a camera or screen that stopped being read after sending frames.
Publishes one raw PCM audio frame with zero-copy ArrayBuffer transfer.
Hands one avatar piece to the worker, which decodes and publishes it, transferring its buffer (zero-copy): the bot's only video out. An init segment is copied first, for a restarted worker; one that comes while the worker restarts is kept for it too. Other pieces are dropped until the worker has joined.
Publishes a reliable message on the room data channel (the room-native "chat").
Requests a fresh snapshot from the worker (request/response) and resolves with it.
Production implementation of NativeRoomClient that runs media processing in a dedicated
worker_threads.Workerthread.