Is there any interface to a running rhino instance? Not server but actual application?

Is there any interface to a running rhino instance?
Not server but actual application and it’s current document and selection, current layer, etc?
Any way to use javascript in a macro, or script?

Thanks