/** * Shared gossipsub topic construction. * * Yjs and Automerge clients use separate topics so they don't attempt * to parse each other's sync messages. */ export function makeGossipsubTopic( uri: string, crdtType?: 'yjs' | 'automerge', ): string { return crdtType === 'automerge' ? `${uri}?crdt=automerge` : uri; }