packages/local-browser exports ReplicaClient, ReplicaOwner (the RPC handler layer), SessionManager, Presence, BrowserReplica, BrowserSqlite (index.ts) - but NO reusable tab/worker ownership coordinator. The election/handoff/takeover logic that decides which tab owns the durable replica lives entirely in the test-browser example apps; a consumer building a multi-tab app must hand-roll it.
For a package that documents browser ownership as a feature, the coordinator is the load-bearing piece and it is not shipped. The confirmed correctness defects in that hand-rolled logic (stranded tabs on takeover, wrong health-check target, leaked sessions - filed separately) are exactly what a well-tested shipped coordinator would prevent.
Direction: extract a reusable, tested ownership coordinator (Web Locks or leader-election over BroadcastChannel/SharedWorker) into packages/local-browser/src with an explicit Layer, covering election, takeover, handoff to existing tabs, DB-worker liveness, and session cleanup on tab close.
packages/local-browser exports ReplicaClient, ReplicaOwner (the RPC handler layer), SessionManager, Presence, BrowserReplica, BrowserSqlite (index.ts) - but NO reusable tab/worker ownership coordinator. The election/handoff/takeover logic that decides which tab owns the durable replica lives entirely in the test-browser example apps; a consumer building a multi-tab app must hand-roll it.
For a package that documents browser ownership as a feature, the coordinator is the load-bearing piece and it is not shipped. The confirmed correctness defects in that hand-rolled logic (stranded tabs on takeover, wrong health-check target, leaked sessions - filed separately) are exactly what a well-tested shipped coordinator would prevent.
Direction: extract a reusable, tested ownership coordinator (Web Locks or leader-election over BroadcastChannel/SharedWorker) into packages/local-browser/src with an explicit Layer, covering election, takeover, handoff to existing tabs, DB-worker liveness, and session cleanup on tab close.