hooks.js: implement ropc hooks.