/** * useConflictNotifications Hook * * Hook for managing real-time conflict notifications. * Listens to WebSocket events for collaboration conflicts. */ /** * Type of conflict notification. */ export type ConflictNotificationType = 'agent_editing' | 'human_conflict' | 'agent_checkpoint' | 'agent_kicked'; /** * A conflict notification. */ export interface ConflictNotification { id: string; type: ConflictNotificationType; agentId?: string; agentName?: string; conflictingRegions?: string[]; message: string; timestamp: string; } /** * Options for useConflictNotifications hook. */ export interface UseConflictNotificationsOptions { /** Auto-dismiss checkpoint notifications */ autoDismissCheckpoints?: boolean; /** Auto-dismiss delay in milliseconds */ autoDismissMs?: number; } /** * Return type for useConflictNotifications hook. */ export interface UseConflictNotificationsReturn { /** Active conflict notifications */ notifications: ConflictNotification[]; /** Dismiss a notification by ID */ dismiss: (id: string) => void; /** Dismiss all notifications */ dismissAll: () => void; } /** * Hook for managing real-time conflict notifications. * * Subscribes to the PresenceContext for WebSocket events and * maintains a list of active conflict notifications. * * @example * ```tsx * function ConflictPanel() { * const { notifications, dismiss, dismissAll } = useConflictNotifications(); * * return ( *