Mary was causing harm whether she accepted that or not
I'm pretty sure it was the typhoid and not Mary that was causing harm. This is a pretty important distinction because I don't see Mary as having violated the NAP. Ultimately, the people who were infected by her cooking were responsible for their own infection because they didn't demand an infection-free guarantee from the restaurant they were eating at. However, if there were such a guarantee in place, then it would be the fault of the restaurant for employing her when there was a risk of her being infected, and this leaves them open to the liability. If they did check with Mary on her condition, and she lied about it, then she has acted fraudulently and there are anarchist solutions for this.
Anarchism does require people to demand the safety they want, though. The power comes from the interaction at the time of trade. If people truly don't think that infectious diseases are a major issue with respect to eating out, they they will risk it. Otherwise, they will make the choice to demand their food sources will have liability.