Role grant offer WebSocket notification specs, builders, and the narrow
NotificationSender interface that decouples offer/revoke send sites
from ConnectionRegistry.
These RemoteNotificationActionSpecs cover the consentful-role-grants
lifecycle events the server pushes to affected accounts:
role_grant_offer_received → recipient's sockets when an offer is createdrole_grant_offer_retracted → recipient's sockets when a grantor retractsrole_grant_offer_accepted → grantor's sockets when the recipient acceptsrole_grant_offer_declined → grantor's sockets when the recipient declinesrole_grant_offer_supersede → grantor's sockets when a sibling accept,
a revoke of the resulting role_grant, or destruction of the parent scope
row obsoletes their pending offerrole_grant_revoked → revokee's sockets when one of their active
role_grants is revoked by the role_grant_revoke action (companion to the
role_grant_revoke audit event)
Payloads are flat and normalized — RoleGrantOfferJson for the offer-lifecycle
notifications (decline reason rides on offer.decline_reason, not a
sibling field), and {role_grant_id, role, scope_kind, scope_id, reason}
for role_grant_revoked. The revokee/grantor/recipient account id travels
via the send target (the NotificationSender.send_to_account argument),
not in the payload. The params schemas are @fuzdev/fuz_schema schemas.
role_grant_offer_notification_actions holds the specs as handler-less
actions. to_ws_actions (actions/protocol.ts) appends them to the WS
action set of an RPC list that carries the role_grant_offer actions, so the
surface lists them on the WS endpoint as remote_notification methods. An
inbound frame for one is still answered method_not_found, as no handler is
registered. Under DEV,
create_role_grant_offer_actions checks each params object it sends
against its spec's input (create_validated_notification_sender);
production sends unchecked.