How to get list of ALL available automatic tasks via API?

How do I get list of ALL automatic tasks (to be precise, a list of their internal IDs, which can be then used in FileBasedProject.RunAutomaticTask method) available in particular Studio instance?
I.e. not only the default Studio built-in tasks, but also any eventual installed plugins' tasks... in other words, all tasks which are normally listed in the dropdown after clicking on the Batch Tasks ribbon button.

And similarly for the Task Sequences - how do I get a list of ALL task sequences, including user-defined ones etc.

I'm trying to create a way to run batch task(s) on project from command line. It already works with the built-in tasks (because I can get their IDs from the AutomaticTaskTemplateIds class). But I don't know how to get the "other" IDs...