Check JMAP capability AND if AI is enabled in env.file and use this method everywhere where we checked env.file