I am so sorry this happened and I would like to help. How long have you been together and how was your marriage prior? The person she had an affair with was she interested in him long term?
I am so sorry for what you are going through. I understand how this can not be easy at all. She is surely giving you mixed messages and that is unfair to you. It seems as if she wants more attention from you and she may believe that things being different will be only temporary. I would try to express to her how you want to change for the better and give her more attention. Ask her if she truly wants to work at it. She needs to be willing to work at it and have motivation that things can be different. You may want to write her a letter as well as give her some space then see where that goes in a few days. It seems that she has many mixed emotions and she may not even be aware of her own feelings. Sometimes people do not realize or appreciate what they have until it is gone. Therefore, even though she is saying she does not want you when the reality hits her feelings may very well change. I would give this a little time for it to all play out. You both have been together a long time to just end it as such. Stay positive and take it day by day. In the meantime try to focus on making yourself happy and keeping busy. You can also dwell on how you can give her more attention and make her feel beautiful. Thinking about these changes can help prepare you for when she does come back. All the best to you!