PowerSyncWorkerConnector
The PowerSync worker has two responsibilities: Hosting databases and driving the sync client across tabs (not used in Kotlin yet).
Database and sync processes use different protocols, so for shared workers we need to encapsulate messages in a structure indicating which service we need.
Ported from https://github.com/powersync-ja/powersync.dart/blob/f1ab64b8ed8efc2555bbf8de6826ea41c14d0295/packages/powersync/lib/src/web/worker_utils.dart#L55