The gripping logic is ran through the GripMotionControllers.
GripObjectByInterface and DropObjectByInterface mostly.
I run a backend in c++, but leave the front end and actual logic of when to grip and drop up to the end user to retain the most flexibility.