Do you find it difficult to translate AI strategies into user input? Or those methods are inaccessible for some reason?
If yes, then one way you can solve this is by not putting your game logic into
onMouseDown and similar functions. If you keep the general logics separate, those input functions will just invoke the needed logics code (or maybe queue some actions, if you're going for a more robust approach). By itself it's not very different, you just have your code in another function now and have to call it. But on the other hand, your AI now does not need to create "input events" and can perform in-game actions directly (or, again, queue them).
Once you think about strategy for your AI from the point of implementation, you will see, that it needs to interact with your game world anyway. For example, even to press buttons, your AI needs to know what's going on in the game world. It needs access to your game state and it needs to be able to observe/read all the values that affect its actions. And if AI has all that, it can just as well affect that state, without producing mouse click events.