Parsoid/JS and Parsoid/PHP currently has some knowledge of what mode it is running in.
But, given that Parsoid, the composer lib, has dependencies injected via the entry interface in src/Parsoid,php, only scripts, tools, and production config code needs to know about these modes so they can inject the appropriate objects. Core Parsoid should simply query these objects for information and merrily carry along with its work.
Eliminating that will require some amount of code refactoring and is probably best done while integrating Parsoid/PHP with the core parser. This phab task tracks that work.