Refactor DocSessionRegistry + fix Vitest config for Automerge master
Extract docSession module-level state (ydocRegistry, titleListeners, visibilityListenerInstalled) into a DocSessionRegistry class. Tests now instantiate a fresh registry per test instead of calling a test-only reset function exported from production code. The module-level acquireDocSession/subscribeEntryTitleChanges wrappers delegate to a default singleton so no callers change. Also fix Vitest picking @automerge/automerge's browser entry (base64 WASM, OOMs) by externalising the package and passing --conditions=node to forked workers so Node picks the disk-loading entry instead. Remove importOriginal() from habitatDocumentsProvider.test.ts to avoid pulling in libp2p's native addon during mock setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>