A woman admitted fatally stabbing her ex-girlfriend to her new prison lover while police listened on a hidden microphone, a court has been told.