/**
 * SyncServer singleton — shared across server/index.ts and modules.
 *
 * Participant mode: server maintains its own Automerge docs.
 * On any doc change, debounced-save to disk via doc-persistence.
 */

import { SyncServer } from "./local-first/sync-server";
import { saveDoc } from "./local-first/doc-persistence";

export const syncServer = new SyncServer({
	participantMode: true,
	onDocChange: (docId, doc) => saveDoc(docId, doc),
});
