A divorce, and clear settlement of assets and debts, may be the best thing for both of you. Once it is final, you may be able to help her more from the outside without being held responsible for her problems.
If you can keep the lines of communication open with her friend, not even mentioning her mental health, just by saying that your divorce is not acrimonious, it will help a lot. Then when she demonstrates her mental illness to her friend, they can talk to you, instead of just turning her out on the street.
The friend is aware of everything already.