- Add have_ids, need_ids, complete fields to NegOpenResponse proto
- Fix ID encoding in server: decode hex strings to binary before sending
- Fix event sending order: send NEG-MSG response before EVENT envelopes
- Client now waits for expected events after reconciliation completes
- Store received events from peer in sync client message loop
This enables bidirectional event sync via NIP-77 negentropy. The server
can now push events it has that the client needs, in addition to the
client pushing events to the server.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Message[]byte`protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`// Negentropy protocol message to send back
Errorstring`protobuf:"bytes,2,opt,name=error,proto3" json:"error,omitempty"`// Error message if failed
HaveIds[][]byte`protobuf:"bytes,2,rep,name=have_ids,json=haveIds,proto3" json:"have_ids,omitempty"`// Event IDs we have that client needs (if initial reconciliation completes)
NeedIds[][]byte`protobuf:"bytes,3,rep,name=need_ids,json=needIds,proto3" json:"need_ids,omitempty"`// Event IDs we need from client (if initial reconciliation completes)
Completebool`protobuf:"varint,4,opt,name=complete,proto3" json:"complete,omitempty"`// True if reconciliation completed in first round
Errorstring`protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`// Error message if failed