/** * Conversation API Service * Handles conversation creation, listing, and agent messaging */ export interface CreateConversationRequest { title?: string; } export interface ConversationResponse { uuid: string; title: string; user_uuid: string; company_uuid: string; message_count: number; created_at: string; updated_at: string; } export interface ConversationListItem { uuid: string; status: string; message_count: number; last_message_at: string | null; joined_at: string | null; closed_at: string | null; archived_at: string | null; created_at: string; updated_at: string; } export interface ConversationListResponse { conversations: ConversationListItem[]; pagination: { page: number; page_size: number; total: number; has_more: boolean; }; } export interface ConversationMessage { uuid: string; content: string; type: 'user' | 'assistant' | 'agent' | 'system'; author_id: number | null; author_name: string | null; created_at: string; pending?: boolean; } export interface ConversationMessagesResponse { messages: ConversationMessage[]; pagination: { page: number; page_size: number; total: number; has_more: boolean; }; } export interface JoinConversationResponse { message: ConversationMessage; } /** * Create a new conversation */ export declare function createConversation(request: CreateConversationRequest, apiUrl?: string): Promise; /** * Get conversation by UUID */ export declare function getConversation(uuid: string, apiUrl?: string): Promise; /** * Get paginated conversations for agent UI */ export declare function getConversations(token: string, page?: number, pageSize?: number, orderBy?: string, apiUrl?: string, status?: 'active' | 'archived'): Promise; /** * Get messages within a conversation */ export declare function getConversationMessages(token: string, conversationUuid: string, page?: number, pageSize?: number, apiUrl?: string): Promise; /** * Join a conversation as an agent */ export declare function joinConversation(token: string, conversationUuid: string, apiUrl?: string): Promise; /** * Close a conversation as an agent */ export declare function closeConversation(token: string, conversationUuid: string, apiUrl?: string): Promise; /** * Archive a conversation as an agent */ export declare function archiveConversation(token: string, conversationUuid: string, apiUrl?: string): Promise<{ success: boolean; archived_at: string; }>; /** * Send agent-authored message */ export declare function sendAgentMessage(token: string, conversationUuid: string, content: string, apiUrl?: string): Promise;