Creates a new synchronization state for managing communication with a peer. The sync state tracks what changes have been sent and received, enabling efficient incremental synchronization.
Details
IMPORTANT: Sync state is document-independent. The same sync state
is used across multiple sync message exchanges with a specific peer.
The document is passed separately to am_sync_encode() and am_sync_decode().