types.ts941 BView on GitHub
export type ChatFilter = 'all' | 'in_crm' | 'unread' | 'unknown';

/** Shape returned by outbound.linkedin.messaging.listChats (chat row + counterpart). */
export interface LinkedinChatRow {
  chatId: string;
  unipileAccountId: string;
  chatType: string;
  personId: string | null;
  accountContactId: string | null;
  conversationId: string | null;
  relevanceState: string; // unknown | relevant | promoted | dropped | snoozed
  promotedReason: string | null;
  lastMessageAt: string | Date | null;
  lastMessageSnippet: string | null;
  lastMessageFromSelf: boolean;
  unreadCount: number;
  isMuted: boolean;
  counterpartName: string | null;
  counterpartHeadline: string | null;
  counterpartPublicId: string | null;
}

/** A message normalized for rendering (from either the T3 CRM rows or a live Unipile fetch). */
export interface ChatMessageView {
  id: string;
  text: string;
  fromSelf: boolean;
  at: string | Date | null;
}