/**
 * Role grant offer WebSocket notification specs, builders, and the narrow
 * `NotificationSender` interface that decouples offer/revoke send sites
 * from `BackendWebsocketTransport`.
 *
 * Six `RemoteNotificationActionSpec`s cover the consentful-role-grants
 * lifecycle events the server pushes to affected accounts:
 *
 * - `role_grant_offer_received` → recipient's sockets when an offer is created
 * - `role_grant_offer_retracted` → recipient's sockets when a grantor retracts
 * - `role_grant_offer_accepted` → grantor's sockets when the recipient accepts
 * - `role_grant_offer_declined` → grantor's sockets when the recipient declines
 * - `role_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 offer
 * - `role_grant_revoke` → revokee's sockets when one of their active role_grants
 *   is revoked (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_id, reason?}` for `role_grant_revoke`. The
 * revokee/grantor/recipient account id travels via the send target (the
 * `NotificationSender.send_to_account` argument), not in the payload.
 *
 * The specs surface as `EventSpec`s via `create_action_event_spec` — callers
 * append `role_grant_offer_notification_specs` to their `event_specs` on
 * `create_app_server` so the surface reflects them and DEV-mode broadcast
 * validation catches payload drift.
 *
 * @module
 */
import { z } from 'zod';
import { type Uuid } from '@fuzdev/fuz_util/id.js';
import type { EventSpec } from '../realtime/sse.js';
import type { JsonrpcNotification } from '../http/jsonrpc.js';
/**
 * Narrow structural capability for sending a JSON-RPC notification to every
 * socket bound to an account.
 *
 * `BackendWebsocketTransport` satisfies this interface — its
 * `send_to_account(account_id, message)` signature accepts the broader
 * `JsonrpcMessageFromServerToClient` type, which is contravariantly
 * compatible with `JsonrpcNotification` here. The interface stays local so
 * handlers don't couple to the concrete transport, and tests can inject a
 * capturing stub with no WS machinery.
 *
 * Returns the number of sockets the notification was sent to — callers
 * typically ignore it (used by telemetry / tests).
 */
export interface NotificationSender {
    send_to_account: (account_id: Uuid, message: JsonrpcNotification) => number;
}
export declare const ROLE_GRANT_OFFER_RECEIVED_NOTIFICATION_METHOD = "role_grant_offer_received";
export declare const ROLE_GRANT_OFFER_RETRACTED_NOTIFICATION_METHOD = "role_grant_offer_retracted";
export declare const ROLE_GRANT_OFFER_ACCEPTED_NOTIFICATION_METHOD = "role_grant_offer_accepted";
export declare const ROLE_GRANT_OFFER_DECLINED_NOTIFICATION_METHOD = "role_grant_offer_declined";
export declare const ROLE_GRANT_OFFER_SUPERSEDE_NOTIFICATION_METHOD = "role_grant_offer_supersede";
export declare const ROLE_GRANT_REVOKE_NOTIFICATION_METHOD = "role_grant_revoke";
/** Params for `role_grant_offer_received` — offer delivered to its recipient. */
export declare const RoleGrantOfferReceivedParams: z.ZodObject<{
    offer: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        role: z.ZodString;
        scope_kind: z.ZodNullable<z.ZodString>;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        message: z.ZodNullable<z.ZodString>;
        created_at: z.ZodString;
        expires_at: z.ZodString;
        accepted_at: z.ZodNullable<z.ZodString>;
        declined_at: z.ZodNullable<z.ZodString>;
        decline_reason: z.ZodNullable<z.ZodString>;
        retracted_at: z.ZodNullable<z.ZodString>;
        superseded_at: z.ZodNullable<z.ZodString>;
        resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    }, z.core.$strict>;
}, z.core.$strict>;
export type RoleGrantOfferReceivedParams = z.infer<typeof RoleGrantOfferReceivedParams>;
/** Params for `role_grant_offer_retracted` — grantor-side retraction. */
export declare const RoleGrantOfferRetractedParams: z.ZodObject<{
    offer: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        role: z.ZodString;
        scope_kind: z.ZodNullable<z.ZodString>;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        message: z.ZodNullable<z.ZodString>;
        created_at: z.ZodString;
        expires_at: z.ZodString;
        accepted_at: z.ZodNullable<z.ZodString>;
        declined_at: z.ZodNullable<z.ZodString>;
        decline_reason: z.ZodNullable<z.ZodString>;
        retracted_at: z.ZodNullable<z.ZodString>;
        superseded_at: z.ZodNullable<z.ZodString>;
        resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    }, z.core.$strict>;
}, z.core.$strict>;
export type RoleGrantOfferRetractedParams = z.infer<typeof RoleGrantOfferRetractedParams>;
/** Params for `role_grant_offer_accepted` — recipient accepted the offer. */
export declare const RoleGrantOfferAcceptedParams: z.ZodObject<{
    offer: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        role: z.ZodString;
        scope_kind: z.ZodNullable<z.ZodString>;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        message: z.ZodNullable<z.ZodString>;
        created_at: z.ZodString;
        expires_at: z.ZodString;
        accepted_at: z.ZodNullable<z.ZodString>;
        declined_at: z.ZodNullable<z.ZodString>;
        decline_reason: z.ZodNullable<z.ZodString>;
        retracted_at: z.ZodNullable<z.ZodString>;
        superseded_at: z.ZodNullable<z.ZodString>;
        resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    }, z.core.$strict>;
}, z.core.$strict>;
export type RoleGrantOfferAcceptedParams = z.infer<typeof RoleGrantOfferAcceptedParams>;
/**
 * Params for `role_grant_offer_declined`. The decline reason (if any) rides along
 * inside `offer.decline_reason` — the DB stamps it on the offer row during
 * decline, so a sibling `reason` field would just duplicate it.
 */
export declare const RoleGrantOfferDeclinedParams: z.ZodObject<{
    offer: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        role: z.ZodString;
        scope_kind: z.ZodNullable<z.ZodString>;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        message: z.ZodNullable<z.ZodString>;
        created_at: z.ZodString;
        expires_at: z.ZodString;
        accepted_at: z.ZodNullable<z.ZodString>;
        declined_at: z.ZodNullable<z.ZodString>;
        decline_reason: z.ZodNullable<z.ZodString>;
        retracted_at: z.ZodNullable<z.ZodString>;
        superseded_at: z.ZodNullable<z.ZodString>;
        resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    }, z.core.$strict>;
}, z.core.$strict>;
export type RoleGrantOfferDeclinedParams = z.infer<typeof RoleGrantOfferDeclinedParams>;
/**
 * Params for `role_grant_offer_supersede`. Fires to the grantor's sockets when
 * their pending offer is obsoleted — either by a sibling accept
 * (`reason: 'sibling_accepted'`), by revoke of the resulting role_grant
 * (`reason: 'role_grant_revoked'`), or by deletion of the parent scope row
 * the offer was bound to (`reason: 'scope_destroyed'`). `cause_id` points
 * at the accepted offer id, the revoked role_grant id, or the destroyed scope
 * row id respectively.
 */
export declare const RoleGrantOfferSupersedeParams: z.ZodObject<{
    offer: z.ZodObject<{
        id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        role: z.ZodString;
        scope_kind: z.ZodNullable<z.ZodString>;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        message: z.ZodNullable<z.ZodString>;
        created_at: z.ZodString;
        expires_at: z.ZodString;
        accepted_at: z.ZodNullable<z.ZodString>;
        declined_at: z.ZodNullable<z.ZodString>;
        decline_reason: z.ZodNullable<z.ZodString>;
        retracted_at: z.ZodNullable<z.ZodString>;
        superseded_at: z.ZodNullable<z.ZodString>;
        resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    }, z.core.$strict>;
    reason: z.ZodEnum<{
        sibling_accepted: "sibling_accepted";
        role_grant_revoked: "role_grant_revoked";
        scope_destroyed: "scope_destroyed";
    }>;
    cause_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
}, z.core.$strict>;
export type RoleGrantOfferSupersedeParams = z.infer<typeof RoleGrantOfferSupersedeParams>;
/**
 * Params for `role_grant_revoke`. Delivered to the revokee's sockets when one
 * of their active role_grants is revoked. Flat wire shape — `revoked_by` is
 * admin-UI-visible but deliberately omitted here (the revokee doesn't need
 * to learn the admin's identity). Target account is implicit in the send
 * target.
 */
export declare const RoleGrantRevokeParams: z.ZodObject<{
    role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
    role: z.ZodString;
    scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
    reason: z.ZodNullable<z.ZodString>;
}, z.core.$strict>;
export type RoleGrantRevokeParams = z.infer<typeof RoleGrantRevokeParams>;
export declare const role_grant_offer_received_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        offer: z.ZodObject<{
            id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            role: z.ZodString;
            scope_kind: z.ZodNullable<z.ZodString>;
            scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            message: z.ZodNullable<z.ZodString>;
            created_at: z.ZodString;
            expires_at: z.ZodString;
            accepted_at: z.ZodNullable<z.ZodString>;
            declined_at: z.ZodNullable<z.ZodString>;
            decline_reason: z.ZodNullable<z.ZodString>;
            retracted_at: z.ZodNullable<z.ZodString>;
            superseded_at: z.ZodNullable<z.ZodString>;
            resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        }, z.core.$strict>;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
export declare const role_grant_offer_retracted_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        offer: z.ZodObject<{
            id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            role: z.ZodString;
            scope_kind: z.ZodNullable<z.ZodString>;
            scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            message: z.ZodNullable<z.ZodString>;
            created_at: z.ZodString;
            expires_at: z.ZodString;
            accepted_at: z.ZodNullable<z.ZodString>;
            declined_at: z.ZodNullable<z.ZodString>;
            decline_reason: z.ZodNullable<z.ZodString>;
            retracted_at: z.ZodNullable<z.ZodString>;
            superseded_at: z.ZodNullable<z.ZodString>;
            resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        }, z.core.$strict>;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
export declare const role_grant_offer_accepted_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        offer: z.ZodObject<{
            id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            role: z.ZodString;
            scope_kind: z.ZodNullable<z.ZodString>;
            scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            message: z.ZodNullable<z.ZodString>;
            created_at: z.ZodString;
            expires_at: z.ZodString;
            accepted_at: z.ZodNullable<z.ZodString>;
            declined_at: z.ZodNullable<z.ZodString>;
            decline_reason: z.ZodNullable<z.ZodString>;
            retracted_at: z.ZodNullable<z.ZodString>;
            superseded_at: z.ZodNullable<z.ZodString>;
            resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        }, z.core.$strict>;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
export declare const role_grant_offer_declined_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        offer: z.ZodObject<{
            id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            role: z.ZodString;
            scope_kind: z.ZodNullable<z.ZodString>;
            scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            message: z.ZodNullable<z.ZodString>;
            created_at: z.ZodString;
            expires_at: z.ZodString;
            accepted_at: z.ZodNullable<z.ZodString>;
            declined_at: z.ZodNullable<z.ZodString>;
            decline_reason: z.ZodNullable<z.ZodString>;
            retracted_at: z.ZodNullable<z.ZodString>;
            superseded_at: z.ZodNullable<z.ZodString>;
            resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        }, z.core.$strict>;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
export declare const role_grant_offer_supersede_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        offer: z.ZodObject<{
            id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            from_actor_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_account_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
            to_actor_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            role: z.ZodString;
            scope_kind: z.ZodNullable<z.ZodString>;
            scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
            message: z.ZodNullable<z.ZodString>;
            created_at: z.ZodString;
            expires_at: z.ZodString;
            accepted_at: z.ZodNullable<z.ZodString>;
            declined_at: z.ZodNullable<z.ZodString>;
            decline_reason: z.ZodNullable<z.ZodString>;
            retracted_at: z.ZodNullable<z.ZodString>;
            superseded_at: z.ZodNullable<z.ZodString>;
            resulting_role_grant_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        }, z.core.$strict>;
        reason: z.ZodEnum<{
            sibling_accepted: "sibling_accepted";
            role_grant_revoked: "role_grant_revoked";
            scope_destroyed: "scope_destroyed";
        }>;
        cause_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
export declare const role_grant_revoke_notification_spec: {
    method: string;
    kind: "remote_notification";
    initiator: "backend";
    auth: null;
    side_effects: true;
    input: z.ZodObject<{
        role_grant_id: z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">;
        role: z.ZodString;
        scope_id: z.ZodNullable<z.core.$ZodBranded<z.ZodUUID, "Uuid", "out">>;
        reason: z.ZodNullable<z.ZodString>;
    }, z.core.$strict>;
    output: z.ZodVoid;
    async: true;
    description: string;
};
/**
 * SSE/WS event specs for the consentful-role-grants notification surface.
 *
 * Pass to `create_app_server`'s `event_specs` so the attack surface reflects
 * them and DEV-mode `create_validated_broadcaster` catches payload drift.
 */
export declare const role_grant_offer_notification_specs: Array<EventSpec>;
export declare const build_role_grant_offer_received_notification: (params: RoleGrantOfferReceivedParams) => JsonrpcNotification;
export declare const build_role_grant_offer_retracted_notification: (params: RoleGrantOfferRetractedParams) => JsonrpcNotification;
export declare const build_role_grant_offer_accepted_notification: (params: RoleGrantOfferAcceptedParams) => JsonrpcNotification;
export declare const build_role_grant_offer_declined_notification: (params: RoleGrantOfferDeclinedParams) => JsonrpcNotification;
export declare const build_role_grant_offer_supersede_notification: (params: RoleGrantOfferSupersedeParams) => JsonrpcNotification;
export declare const build_role_grant_revoke_notification: (params: RoleGrantRevokeParams) => JsonrpcNotification;
//# sourceMappingURL=role_grant_offer_notifications.d.ts.map