import type { FabricEvent, FabricEventCallback, JsonObject } from './types.js'; export type ApprovalNotificationState = 'requested' | 'escalated' | 'resolved'; export interface ApprovalNotification { id: string; approvalId: string; sessionId: string; state: ApprovalNotificationState; eventType: FabricEvent['type']; timestamp: string; tenantId?: string; decision?: 'approved' | 'denied' | 'expired'; reason?: string; subject?: string; audience?: string; deepLink?: string; data: JsonObject; } export interface ApprovalNotifier { send(notification: ApprovalNotification): Promise; } export interface ApprovalNotificationDeliveryStore { /** Atomically claim a notification id. False means another delivery owns or completed it. */ claim(id: string): Promise; delivered(id: string): Promise; deadLettered(id: string): Promise; } export interface ApprovalNotificationDeadLetter { notification: ApprovalNotification; attempts: number; error: string; failedAt: string; } export interface ApprovalNotificationHandlerOptions { notifier: ApprovalNotifier; baseUrl?: string; retries?: number; retryDelayMs?: (attempt: number) => number; store?: ApprovalNotificationDeliveryStore; deadLetter?: (record: ApprovalNotificationDeadLetter) => void | Promise; audit?: (record: { notification: ApprovalNotification; outcome: 'delivered' | 'dead_lettered' | 'deduplicated'; attempts: number; error?: string; }) => void | Promise; onError?: (error: unknown, notification: ApprovalNotification) => void; } /** Process-local atomic delivery state for development and single-process hosts. */ export declare function inMemoryApprovalNotificationStore(): ApprovalNotificationDeliveryStore; /** Convert approval events into retryable, deduplicated notifications. This callback never throws. */ export declare function approvalNotificationHandler(options: ApprovalNotificationHandlerOptions): FabricEventCallback; export declare function webhookApprovalNotifier(options: { url: string; headers?: Record; fetch?: typeof fetch; }): ApprovalNotifier; /** Slack incoming-webhook notifier. The webhook URL remains in host configuration, never event data. */ export declare function slackApprovalNotifier(options: { webhookUrl: string; fetch?: typeof fetch; }): ApprovalNotifier; export declare function approvalNotificationFromEvent(event: FabricEvent, baseUrl?: string): ApprovalNotification | undefined; //# sourceMappingURL=approval-notifier.d.ts.map