Ana Edey of the Solviva
books designed and used a toilet system, also used the same system for the kitchen water of a big restaurant, where the black water went through a
compost worm bin. She intentionally used all kinds of commercial cleaning products to see if they would harm the worms, and she has been using it for 20 years and says nothing has harmed the worms yet.
Personally in my greywater system I try to avoid too much sodium and table salt, but I use moderate amounts of soap and dish detergent and the soil microbes and plants don't seem to mind. We've had our bathing black water go to willow
trees for almost 20 years and the trees love it, though there are no earthworms in the area anyway so I can't speak to that. That's the washing waste water from 50 - 100 teenagers who use god-know-what-all kinds of "products" on their hair, skin, etc.