How to get the composer state in a markdown extension


I’m developing a markdown extension refer to these two topics:

Now I want to disable/enable some features based on the category/tag selection and creating-topic/replying state, so how can I get these states in a markdown extension?

I can find out some but not sure API in md.options.discourse object, but seems a lot of functions in it are server-side only(it’s undefined in client-side) and it still does not fit my requirements even client-side accessible.

So that means it’s not possible to implement my idea?