A hook runs handler(event, ctx) for one event of the catalog (see gptr_api()$features) or
for a plugin channel named "<plugin>:<topic>". What the handler may return depends on the
event: patches for tool_result, a decision for tool_call, nothing for notifications.
Handlers of tool_call, permission_request and document_write fail closed: an error blocks
or denies, and a tool_call answer with an unknown decision (anything but "block",
"modify" with an input list, or "allow"; for example "deny") blocks.