N = 2 super-Yang-Mills and supergravity constraints from coupling to a supersymmetric particle