@elqnt/chat 3.0.0 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../models/index.ts","../../models/chat-models.ts"],"sourcesContent":["export * from \"./chat-models\";\n","// Code generated by tygo. DO NOT EDIT.\n// NOTE: @elqnt/kg and @elqnt/docs imports made generic for platform independence.\n// If you need strong typing for these, import the types separately and cast.\n\nimport { Variable } from \"@elqnt/types\";\nimport { ResponseMetadata, ProductNameTS } from \"@elqnt/types\";\n\n/**\n * Generic placeholder for KGNode when @elqnt/kg is not available.\n * Import from @elqnt/kg for full type support.\n */\nexport type KGNode = {\n id: string;\n type: string;\n properties?: Record<string, unknown>;\n [key: string]: unknown;\n};\n\n/**\n * Generic placeholder for DocumentAnalysisResult when @elqnt/docs is not available.\n * Import from @elqnt/docs for full type support.\n */\nexport type DocumentAnalysisResult = {\n pages?: unknown[];\n content?: string;\n [key: string]: unknown;\n};\n\n//////////\n// source: chat-models.go\n\nexport type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';\nexport type ChatStatus = string;\nexport const ChatStatusActive: ChatStatus = \"active\";\nexport const ChatStatusDisconnected: ChatStatus = \"disconnected\";\nexport const ChatStatusAbandoned: ChatStatus = \"abandoned\";\nexport const ChatStatusClosed: ChatStatus = \"closed\";\nexport const ChatStatusArchived: ChatStatus = \"archived\";\nexport type ChatTypeTS = 'customer_support' | 'public_room' | 'private_room' | 'direct' | 'group';\nexport type ChatType = string;\nexport const ChatTypeCustomerSupport: ChatType = \"customer_support\"; // Existing customer support chats\nexport const ChatTypePublicRoom: ChatType = \"public_room\"; // Public collaboration room\nexport const ChatTypePrivateRoom: ChatType = \"private_room\"; // Private collaboration room\nexport const ChatTypeDirect: ChatType = \"direct\"; // 1-on-1 direct message\nexport const ChatTypeGroup: ChatType = \"group\"; // Group chat/room\nexport interface Chat {\n orgId: string;\n key: string;\n title: string;\n messages: ChatMessage[];\n lastUpdated: number /* int64 */;\n startTime: number /* int64 */;\n users: ChatUser[];\n status: ChatStatusTS;\n aiEngaged: boolean;\n humanAgentEngaged: boolean;\n isWaiting: boolean;\n isWaitingForAgent: boolean;\n callRequested?: boolean;\n callStarted?: boolean;\n userRating?: number /* int */;\n metadata?: { [key: string]: any};\n grading?: ChatGrading;\n flow?: ChatFlow;\n context?: ChatContext;\n csatSent?: boolean;\n csatSentTime?: number /* int64 */;\n csatResponse?: any /* agents.CSATResponse */;\n /**\n * Active skills for this chat session\n */\n activeSkills?: any /* agents.Skill */[];\n /**\n * OpenAI Responses API - stores the last response ID for conversation continuity\n */\n lastResponseId?: string;\n /**\n * AgentContext - reference to structured context stored in separate NATS KV bucket\n * Key format: {agentId}:{chatKey} in bucket agent-contexts-org-{orgId}\n */\n agentContextKey?: string;\n /**\n * Chat Pin\n */\n pinned?: boolean;\n /**\n * Collab-specific fields\n */\n chatType?: ChatTypeTS;\n description?: string;\n}\nexport interface ChatContext {\n memory: { [key: string]: any};\n turnCount: number /* int */;\n lastIntent: string;\n activeTopic: string;\n}\nexport interface ChatFlow {\n flowDefinitionId: string;\n flowInstanceId?: string;\n flowInstanceLastUpdated?: number /* int64 */;\n tools?: ChatTool[];\n}\nexport interface ChatTool {\n name: string;\n description: string;\n type: string; // function, action, data_query etc\n parameters?: { [key: string]: any};\n}\nexport type ChatRoleTS = 'user' | 'ai' | 'event' | 'humanAgent' | 'observer' | 'dataQuery' | 'system' | 'tool';\nexport type ChatRole = string;\nexport const ChatRoleUser: ChatRole = \"user\";\nexport const ChatRoleAI: ChatRole = \"ai\";\nexport const ChatRoleEvent: ChatRole = \"event\";\nexport const ChatRoleHumanAgent: ChatRole = \"humanAgent\";\nexport const ChatRoleObserver: ChatRole = \"observer\";\nexport const ChatRoleDataQuery: ChatRole = \"dataQuery\";\nexport const ChatRoleSystem: ChatRole = \"system\";\nexport const ChatRoleTool: ChatRole = \"tool\";\nexport interface ChatUser {\n id: string;\n role: ChatRoleTS;\n name: string;\n email: string;\n phone?: string;\n authProvider: string;\n authToken: string;\n metadata?: { [key: string]: any};\n}\nexport type AgentStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type AgentStatus = string;\nexport const AgentStatusOnline: AgentStatus = \"online\";\nexport const AgentStatusAway: AgentStatus = \"away\";\nexport const AgentStatusBusy: AgentStatus = \"busy\";\nexport const AgentStatusOffline: AgentStatus = \"offline\";\n/**\n * AgentSession represents an active agent session stored in Redis\n */\nexport interface AgentSession {\n agentId: string;\n orgId: string;\n onlineSince: number /* int64 */; // Unix timestamp\n lastActivity: number /* int64 */; // Unix timestamp\n status: AgentStatusTS;\n chatsHandled: number /* int */;\n activeChats: string[]; // Chat keys currently handling\n userAgent?: string;\n ipAddress?: string;\n metadata?: { [key: string]: any};\n}\nexport type ChatEventType = string;\n/**\n * ** user events\n */\nexport const ChatEventTypeUserJoined: ChatEventType = \"user_joined\";\nexport const ChatEventTypeUserLeft: ChatEventType = \"user_left\";\nexport const ChatEventTypeTyping: ChatEventType = \"typing\";\nexport const ChatEventTypeStoppedTyping: ChatEventType = \"stopped_typing\";\nexport const ChatEventTypeRead: ChatEventType = \"read\";\nexport const ChatEventTypeDelivered: ChatEventType = \"delivered\";\nexport const ChatEventTypeReconnected: ChatEventType = \"reconnected\";\nexport const ChatEventTypeError: ChatEventType = \"error\";\nexport const ChatEventTypeWaiting: ChatEventType = \"waiting\";\nexport const ChatEventTypeLoadChat: ChatEventType = \"load_chat\";\nexport const ChatEventTypeLoadChatResponse: ChatEventType = \"load_chat_response\";\nexport const ChatEventTypeMessage: ChatEventType = \"message\";\nexport const ChatEventTypeWaitingForAgent: ChatEventType = \"waiting_for_agent\";\nexport const ChatEventTypeMessageStatusUpdate: ChatEventType = \"message_status_update\";\nexport const ChatEventTypeHumanAgentJoined: ChatEventType = \"human_agent_joined\";\nexport const ChatEventTypeHumanAgentLeft: ChatEventType = \"human_agent_left\";\nexport const ChatEventTypeObserverJoined: ChatEventType = \"observer_joined\";\nexport const ChatEventTypeObserverLeft: ChatEventType = \"observer_left\";\nexport const ChatEventTypeListChats: ChatEventType = \"list_chats\";\nexport const ChatEventTypeChatUpdated: ChatEventType = \"chat_updated\";\nexport const ChatEventTypeChatRemoved: ChatEventType = \"chat_removed\";\nexport const ChatEventTypeSyncMetadata: ChatEventType = \"sync_metadata\";\nexport const ChatEventTypeSyncMetadataResponse: ChatEventType = \"sync_metadata_response\";\nexport const ChatEventTypeSyncUserSession: ChatEventType = \"sync_user_session\";\nexport const ChatEventTypeSyncUserSessionResponse: ChatEventType = \"sync_user_session_response\";\nexport const ChatEventTypeClientAction: ChatEventType = \"client_action\";\nexport const ChatEventTypeClientActionCallback: ChatEventType = \"client_action_callback\";\nexport const ChatEventTypeBlockUser: ChatEventType = \"block_user\";\n/**\n * ** collab room management events\n */\nexport const ChatEventTypeCreateRoom: ChatEventType = \"create_room\";\nexport const ChatEventTypeRoomCreated: ChatEventType = \"room_created\";\nexport const ChatEventTypeJoinRoom: ChatEventType = \"join_room\";\nexport const ChatEventTypeLeaveRoom: ChatEventType = \"leave_room\";\nexport const ChatEventTypeDeleteRoom: ChatEventType = \"delete_room\";\nexport const ChatEventTypeRoomDeleted: ChatEventType = \"room_deleted\";\nexport const ChatEventTypeUpdateRoom: ChatEventType = \"update_room\";\nexport const ChatEventTypeRoomUpdated: ChatEventType = \"room_updated\";\nexport const ChatEventTypeInviteUser: ChatEventType = \"invite_user\";\nexport const ChatEventTypeUserInvited: ChatEventType = \"user_invited\";\nexport const ChatEventTypeRoomUserJoined: ChatEventType = \"room_user_joined\";\nexport const ChatEventTypeRoomUserLeft: ChatEventType = \"room_user_left\";\nexport const ChatEventTypeUserRemoved: ChatEventType = \"user_removed\";\nexport const ChatEventTypeListRooms: ChatEventType = \"list_rooms\";\nexport const ChatEventTypeRoomsResponse: ChatEventType = \"rooms_response\";\n/**\n * ** collab message events\n */\nexport const ChatEventTypeMessageEdited: ChatEventType = \"message_edited\";\nexport const ChatEventTypeMessageDeleted: ChatEventType = \"message_deleted\";\nexport const ChatEventTypeMessageReaction: ChatEventType = \"message_reaction\";\nexport const ChatEventTypeMessageReply: ChatEventType = \"message_reply\";\nexport const ChatEventTypeMentionUser: ChatEventType = \"mention_user\";\nexport const ChatEventTypeMessageEditedResponse: ChatEventType = \"message_edited_response\";\nexport const ChatEventTypeMessageDeletedResponse: ChatEventType = \"message_deleted_response\";\nexport const ChatEventTypeMessageReactionResponse: ChatEventType = \"message_reaction_response\";\n/**\n * ** collab user presence events\n */\nexport const ChatEventTypeUserPresenceStart: ChatEventType = \"user_presence_start\";\nexport const ChatEventTypeUserPresenceEnd: ChatEventType = \"user_presence_end\";\nexport const ChatEventTypeUserStatusChange: ChatEventType = \"user_status_change\";\nexport const ChatEventTypeUserActivity: ChatEventType = \"user_activity\";\nexport const ChatEventTypeUserPresenceChanged: ChatEventType = \"user_presence_changed\";\nexport const ChatEventTypeUserActivityUpdate: ChatEventType = \"user_activity_update\";\nexport const ChatEventTypeGetOnlineUsers: ChatEventType = \"get_online_users\";\nexport const ChatEventTypeOnlineUsersResponse: ChatEventType = \"online_users\";\n/**\n * ** shop assist events\n */\nexport const ChatEventTypeEndChat: ChatEventType = \"end_chat\";\nexport const ChatEventTypeChatEnded: ChatEventType = \"chat_ended\";\n/**\n * ** agent session events\n */\nexport const ChatEventTypeAgentSessionStart: ChatEventType = \"agent_session_start\";\nexport const ChatEventTypeAgentSessionEnd: ChatEventType = \"agent_session_end\";\nexport const ChatEventTypeAgentStatusChange: ChatEventType = \"agent_status_change\";\nexport const ChatEventTypeAgentActivityPing: ChatEventType = \"agent_activity_ping\";\nexport const ChatEventTypeAgentChatAssigned: ChatEventType = \"agent_chat_assigned\";\nexport const ChatEventTypeAgentChatCompleted: ChatEventType = \"agent_chat_completed\";\n/**\n * ** AI agents retrieval events\n */\nexport const ChatEventTypeGetAgents: ChatEventType = \"get_agents\";\nexport const ChatEventTypeGetAgentsResponse: ChatEventType = \"get_agents_response\";\n/**\n * ** CSAT events\n */\nexport const ChatEventTypeCSATRequest: ChatEventType = \"csat_request\"; // Internal: scheduler requests chat to send CSAT\nexport const ChatEventTypeCSATSurvey: ChatEventType = \"show_csat_survey\";\nexport const ChatEventTypeCSATResponse: ChatEventType = \"csat_response\";\n/**\n * ** User Suggested Actions events\n */\nexport const ChatEventTypeUserSuggestedActions: ChatEventType = \"user_suggested_actions\";\nexport const ChatEventTypeUserSuggestedActionSelected: ChatEventType = \"user_suggested_action_selected\";\n/**\n * ** Summary events\n */\nexport const ChatEventTypeSummaryUpdate: ChatEventType = \"summary_update\";\n/**\n * ** Agent Context events\n */\nexport const ChatEventTypeAgentContextUpdate: ChatEventType = \"agent_context_update\";\nexport const ChatEventTypeAgentExecutionStarted: ChatEventType = \"agent_execution_started\";\nexport const ChatEventTypeAgentExecutionEnded: ChatEventType = \"agent_execution_ended\";\nexport const ChatEventTypeLoadAgentContext: ChatEventType = \"load_agent_context\";\nexport const ChatEventTypeLoadAgentContextResponse: ChatEventType = \"load_agent_context_response\";\n/**\n * ** Plan → Approve → Execute events\n */\nexport const ChatEventTypePlanPendingApproval: ChatEventType = \"plan_pending_approval\";\nexport const ChatEventTypePlanApproved: ChatEventType = \"plan_approved\";\nexport const ChatEventTypePlanRejected: ChatEventType = \"plan_rejected\";\nexport const ChatEventTypePlanCompleted: ChatEventType = \"plan_completed\";\nexport const ChatEventTypeStepStarted: ChatEventType = \"step_started\";\nexport const ChatEventTypeStepCompleted: ChatEventType = \"step_completed\";\nexport const ChatEventTypeStepFailed: ChatEventType = \"step_failed\";\n/**\n * ** New Chat events\n */\nexport const ChatEventTypeNewChat: ChatEventType = \"new_chat\";\nexport const ChatEventTypeNewChatCreated: ChatEventType = \"new_chat_created\";\n/**\n * ** Heartbeat events\n */\nexport const ChatEventTypePing: ChatEventType = \"ping\";\nexport const ChatEventTypePong: ChatEventType = \"pong\";\n/**\n * ** Skill activation events\n */\nexport const ChatEventTypeSkillActivate: ChatEventType = \"skill_activate\";\nexport const ChatEventTypeSkillDeactivate: ChatEventType = \"skill_deactivate\";\nexport const ChatEventTypeSkillsChanged: ChatEventType = \"skills_changed\";\n/**\n * ** Attachment processing events (deferred document processing)\n */\nexport const ChatEventTypeAttachmentProcessingStarted: ChatEventType = \"attachment_processing_started\";\nexport const ChatEventTypeAttachmentProcessingProgress: ChatEventType = \"attachment_processing_progress\";\nexport const ChatEventTypeAttachmentProcessingComplete: ChatEventType = \"attachment_processing_complete\";\nexport const ChatEventTypeAttachmentProcessingError: ChatEventType = \"attachment_processing_error\";\nexport const ChatEventTypeRetryAttachment: ChatEventType = \"retry_attachment\";\nexport type ChatEventTypeTS =\n | \"message\"\n | \"user_joined\"\n | \"user_left\"\n | \"typing\"\n | \"stopped_typing\"\n | \"read\"\n | \"delivered\"\n | \"reconnected\"\n | \"error\"\n | \"message_status_update\"\n | \"load_chat\"\n | \"load_chat_response\"\n | \"waiting\"\n | \"waiting_for_agent\"\n | \"human_agent_joined\"\n | \"end_chat\"\n | \"chat_ended\"\n | \"human_agent_left\"\n | \"observer_joined\"\n | \"observer_left\"\n | \"list_chats\"\n | \"chat_updated\"\n | \"chat_removed\"\n | \"sync_metadata\"\n | \"sync_metadata_response\"\n | \"sync_user_session\"\n | \"sync_user_session_response\"\n | \"agent_session_start\"\n | \"agent_session_end\"\n | \"agent_status_change\"\n | \"agent_activity_ping\"\n | \"agent_chat_assigned\"\n | \"agent_chat_completed\"\n | \"client_action\"\n | \"client_action_callback\"\n | \"show_csat_survey\"\n | \"csat_response\"\n | \"user_suggested_actions\"\n | \"user_suggested_action_selected\"\n | \"summary_update\"\n | \"agent_context_update\"\n | \"agent_execution_started\"\n | \"agent_execution_ended\"\n | \"load_agent_context\"\n | \"load_agent_context_response\"\n | \"plan_pending_approval\"\n | \"plan_approved\"\n | \"plan_rejected\"\n | \"plan_completed\"\n | \"step_started\"\n | \"step_completed\"\n | \"step_failed\"\n | \"new_chat\"\n | \"new_chat_created\"\n | \"block_user\"\n | \"ping\"\n | \"pong\"\n | \"create_room\"\n | \"room_created\"\n | \"join_room\"\n | \"leave_room\"\n | \"delete_room\"\n | \"room_deleted\"\n | \"update_room\"\n | \"room_updated\"\n | \"invite_user\"\n | \"user_invited\"\n | \"room_user_joined\"\n | \"room_user_left\"\n | \"user_removed\"\n | \"list_rooms\"\n | \"rooms_response\"\n | \"message_edited\"\n | \"message_deleted\"\n | \"message_reaction\"\n | \"message_reply\"\n | \"mention_user\"\n | \"message_edited_response\"\n | \"message_deleted_response\"\n | \"message_reaction_response\"\n | \"user_presence_start\"\n | \"user_presence_end\"\n | \"user_status_change\"\n | \"user_activity\"\n | \"user_presence_changed\"\n | \"user_activity_update\"\n | \"get_online_users\"\n | \"online_users\"\n | \"get_agents\"\n | \"get_agents_response\"\n | \"skill_activate\"\n | \"skill_deactivate\"\n | \"skills_changed\"\n | \"attachment_processing_started\"\n | \"attachment_processing_progress\"\n | \"attachment_processing_complete\"\n | \"attachment_processing_error\"\n | \"retry_attachment\";\nexport type MessageStatus = string;\nexport const MessageStatusSending: MessageStatus = \"sending\";\nexport const MessageStatusSent: MessageStatus = \"sent\";\nexport const MessageStatusDelivered: MessageStatus = \"delivered\";\nexport const MessageStatusRead: MessageStatus = \"read\";\nexport const MessageStatusFailed: MessageStatus = \"failed\";\nexport type MessageStatusTS =\n | \"sending\"\n | \"sent\"\n | \"delivered\"\n | \"read\"\n | \"failed\";\n/**\n * EmojiReaction represents an emoji reaction to a message\n */\nexport interface EmojiReaction {\n emoji: string;\n count: number /* int */;\n users?: string[]; // List of user IDs who reacted\n}\n/**\n * Location represents geographical coordinates\n */\nexport interface Location {\n latitude: number /* float64 */;\n longitude: number /* float64 */;\n address?: string;\n}\n/**\n * AttachmentFile represents a file within an attachment\n */\nexport interface AttachmentFile {\n type: string;\n url: string;\n thumbnailUrl?: string;\n name?: string;\n size?: number /* int64 */;\n}\nexport type AttachmentType = string;\n/**\n * Attachment types for both user and system attachments\n */\nexport const AttachmentTypeDocument: AttachmentType = \"document\";\nexport const AttachmentTypeDocumentAnalysis: AttachmentType = \"document_analysis\";\nexport const AttachmentTypeImage: AttachmentType = \"image\";\nexport const AttachmentTypeAudio: AttachmentType = \"audio\";\nexport const AttachmentTypeVideo: AttachmentType = \"video\";\nexport const AttachmentTypeLocation: AttachmentType = \"location\";\nexport const AttachmentTypeReferences: AttachmentType = \"references\";\nexport const AttachmentTypeSubsections: AttachmentType = \"subsections\";\nexport const AttachmentTypeArticles: AttachmentType = \"articles\";\nexport const AttachmentTypeRecords: AttachmentType = \"records\";\nexport const AttachmentTypeActions: AttachmentType = \"actions\";\nexport const AttachmentTypeBullets: AttachmentType = \"bullets\";\nexport const AttachmentTypeSticker: AttachmentType = \"sticker\";\nexport const AttachmentTypeData: AttachmentType = \"data\";\nexport const AttachmentTypeKGNodes: AttachmentType = \"kgNodes\";\nexport const AttachmentTypeDocumentSources: AttachmentType = \"document_sources\";\nexport const AttachmentTypeSpreadsheet: AttachmentType = \"spreadsheet\"; // Excel, CSV files\nexport const AttachmentTypeDataFile: AttachmentType = \"data_file\"; // JSON, XML, YAML files\n\nexport type AttachmentTypeTS =\n | \"document\"\n | \"document_analysis\"\n | \"image\"\n | \"audio\"\n | \"video\"\n | \"location\"\n | \"references\"\n | \"subsections\"\n | \"articles\"\n | \"records\"\n | \"actions\"\n | \"bullets\"\n | \"sticker\"\n | \"data\"\n | \"kgNodes\"\n | \"document_sources\"\n | \"spreadsheet\"\n | \"data_file\";\n\n/**\n * DocumentSource represents an aggregated document source with page references\n * Used to display source cards in chat responses after document search\n */\nexport interface DocumentSource {\n doc_id: string;\n title: string;\n url: string;\n page_numbers: number /* int */[];\n reference_count: number /* int */;\n bounding_regions?: any /* docs.BoundingRegion */[];\n page_infos?: any /* docs.PageInfo */[]; // Page dimensions for coordinate scaling\n}\n/**\n * Attachment represents any type of attachment to a message\n */\nexport interface Attachment {\n type: AttachmentTypeTS;\n documentAnalysis?: DocumentAnalysisResult;\n title?: string;\n url: string;\n files?: AttachmentFile[]; // Associated files\n location?: Location; // Location data if applicable\n data?: { [key: string]: Variable};\n kgNodes?: KGNode[];\n actions?: Action[];\n documentSources?: DocumentSource[];\n /**\n * Smart document processing fields\n */\n fileMetadata?: any /* docs.AttachmentFileMetadata */; // Client-side extracted file metadata\n processing?: any /* docs.ProcessingResult */; // Smart processing result\n}\nexport interface Action {\n id: string;\n title: string;\n icon?: string;\n description?: string;\n onAction?: () => void;\n}\n/**\n * ChatMessage represents the core message structure\n */\nexport interface ChatMessage {\n /**\n * Core fields\n */\n id: string;\n role: ChatRoleTS;\n content: string;\n time: number /* int64 */;\n status: MessageStatusTS;\n /**\n * Sender information\n */\n senderId: string;\n senderName?: string;\n /**\n * Timing\n */\n createdAt: number /* int64 */;\n updatedAt?: number /* int64 */;\n /**\n * Message relations\n */\n replyTo?: string;\n threadId?: string;\n mentions?: string[];\n /**\n * Attachments and reactions\n */\n attachments?: Attachment[];\n reactions?: EmojiReaction[];\n /**\n * Additional data\n */\n variables?: { [key: string]: Variable};\n /**\n * Tool call\n */\n name?: string;\n toolCallId?: string;\n toolCalls?: ToolCall[];\n /**\n * LLM usage\n */\n llmUsage?: LLMUsage;\n}\nexport interface ChatEvent {\n type: ChatEventTypeTS;\n orgId: string;\n chatKey: string;\n userId: string;\n timestamp: number /* int64 */;\n data?: { [key: string]: any};\n message?: ChatMessage;\n}\nexport interface ChatGrading {\n chatKey: string;\n grade: number /* int */;\n topic: string;\n summary: string;\n}\nexport interface ChatSession {\n id: string;\n status: ChatSessionStatus;\n user?: ChatUser;\n activeChatKey?: string;\n preferences?: ChatSessionPreferences;\n lastActivity: number /* int64 */;\n expiresAt: number /* int64 */;\n metadata?: { [key: string]: any};\n}\nexport type ChatSessionStatus = string;\nexport const ChatSessionStatusActive: ChatSessionStatus = \"active\";\nexport const ChatSessionStatusIdle: ChatSessionStatus = \"idle\";\nexport const ChatSessionStatusExpired: ChatSessionStatus = \"expired\";\nexport interface ChatSessionPreferences {\n language: string;\n theme: string;\n notifications: boolean;\n timeZone: string;\n messageDisplay: string; // compact/expanded\n autoTranslate: boolean;\n rateLimits?: ChatRateLimits;\n}\nexport interface ChatRateLimits {\n maxMessagesPerMinute: number /* int */;\n maxTokensPerDay: number /* int */;\n cooldownPeriod: number /* int */; // seconds\n}\n/**\n * ==========================\n * todo: move to common/llm\n */\nexport interface LLMConfig {\n Provider: string;\n Model: string;\n Temperature: number /* float64 */;\n MaxTokens: number /* int */;\n SystemPrompt: string;\n Tools: LLMTool[];\n Memory?: LLMMemoryConfig;\n}\nexport interface LLMMemoryConfig {\n MaxMessages: number /* int */;\n IncludeSystem: boolean;\n WindowSize: number /* int */; // Token window size\n Strategy: string; // e.g., \"sliding\", \"summarize\"\n}\nexport interface LLMTool {\n Name: string;\n Type: string;\n Function: LLMFunction;\n}\nexport interface LLMFunction {\n Name: string;\n Description: string;\n Parameters: any /* types.JSONSchema */;\n}\nexport interface ToolCall {\n Name: string;\n Arguments: { [key: string]: any};\n ID: string;\n Description: string;\n}\nexport interface LLMResponse {\n Content: string;\n ToolCalls: ToolCall[];\n Usage?: LLMUsage;\n ResponseId: string; // OpenAI Responses API - the response ID for conversation continuity\n}\nexport interface LLMUsage {\n inputTokens: number /* int64 */;\n outputTokens: number /* int64 */;\n totalTokens: number /* int64 */;\n}\n/**\n * ChatSummary represents lightweight chat information for caching and listing\n */\nexport interface ChatSummary {\n chatKey: string;\n title: string;\n userId?: string;\n status: ChatStatus;\n lastUpdated: number /* int64 */;\n waitingSince?: number /* int64 */; // Only populated for waiting chats\n pinned?: boolean;\n metadata?: { [key: string]: any};\n}\nexport interface GetChatRequest {\n orgId: string;\n chatKey: string;\n}\nexport interface GetChatResponse {\n chat?: Chat;\n metadata: ResponseMetadata;\n}\nexport interface ChatProductReference {\n id: string;\n title: string;\n price: number /* float64 */;\n image?: string;\n url?: string;\n}\n/**\n * Chat Archival Models\n */\nexport interface ChatArchivalRequest {\n orgId: string;\n chatKey: string;\n chat: Chat;\n}\nexport interface ChatArchivalResponse {\n success: boolean;\n error?: string;\n message?: string;\n}\n/**\n * Agent Session Request/Response Models\n */\nexport interface StartAgentSessionRequest {\n orgId: string;\n agentId: string;\n userAgent?: string;\n ipAddress?: string;\n}\nexport interface StartAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface EndAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface EndAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentStatusRequest {\n orgId: string;\n agentId: string;\n status: AgentStatusTS;\n}\nexport interface UpdateAgentStatusResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentLastActivityRequest {\n orgId: string;\n agentId: string;\n}\nexport interface UpdateAgentLastActivityResponse {\n metadata: ResponseMetadata;\n}\nexport interface AssignChatToAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface AssignChatToAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface CompleteChatByAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface CompleteChatByAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface GetAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface GetAgentSessionResponse {\n session?: AgentSession;\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentsRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentsResponse {\n sessions: AgentSession[];\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentCountRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\n/**\n * Queue-specific chat request/response types\n */\nexport interface GetQueueChatsRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\nexport interface GetQueueChatCountRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport type UserStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type UserStatus = string;\nexport const UserStatusOnline: UserStatus = \"online\";\nexport const UserStatusAway: UserStatus = \"away\";\nexport const UserStatusBusy: UserStatus = \"busy\";\nexport const UserStatusOffline: UserStatus = \"offline\";\n/**\n * UserSession for tracking online users\n */\nexport interface UserSession {\n orgId: string;\n userId: string;\n userName: string;\n status: UserStatusTS;\n onlineSince: number /* int64 */;\n lastActivity: number /* int64 */;\n}\n/**\n * User status update requests\n */\nexport interface UpdateUserStatusRequest {\n orgId: string;\n userId: string;\n status: UserStatusTS;\n}\nexport interface UpdateUserStatusResponse {\n metadata: ResponseMetadata;\n}\n/**\n * Get online users\n */\nexport interface GetOnlineUsersRequest {\n orgId: string;\n}\nexport interface GetOnlineUsersResponse {\n metadata: ResponseMetadata;\n users: UserSession[];\n}\n/**\n * Analytics Trigger Models\n */\nexport interface TriggerAnalyticsScanRequest {\n org_id?: string; // Optional: if empty, scans all orgs\n}\nexport interface TriggerAnalyticsScanResponse {\n metadata: ResponseMetadata;\n chats_archived: number /* int */;\n}\n/**\n * AttachmentProcessingStartedData is sent when attachment processing begins\n */\nexport interface AttachmentProcessingStartedData {\n attachmentId: string;\n fileName: string;\n strategy: string;\n}\n/**\n * AttachmentProcessingProgressData is sent during attachment processing\n */\nexport interface AttachmentProcessingProgressData {\n attachmentId: string;\n percent: number /* int */;\n stage: string;\n message: string;\n}\n/**\n * AttachmentProcessingCompleteData is sent when attachment processing completes\n */\nexport interface AttachmentProcessingCompleteData {\n attachmentId: string;\n result?: any /* docs.ProcessingResult */;\n}\n/**\n * AttachmentProcessingErrorData is sent when attachment processing fails\n */\nexport interface AttachmentProcessingErrorData {\n attachmentId: string;\n error: string;\n retryable: boolean;\n}\n/**\n * RetryAttachmentData is sent by frontend to retry a failed attachment\n */\nexport interface RetryAttachmentData {\n attachmentId: string;\n}\n\n//////////\n// source: chat-stats-models.go\n\n/**\n * Active chat requests/responses\n */\nexport interface GetActiveChatCountRequest {\n orgId: string;\n}\nexport interface GetActiveChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetActiveChatsRequest {\n orgId: string;\n pastHours?: number /* float64 */; // 0 means all, 0.5 means past 30 min, 1 means past hour, etc.\n}\nexport interface GetActiveChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * Waiting for agent requests/responses\n */\nexport interface GetWaitingForAgentChatCountRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetWaitingForAgentChatsRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * User chats requests/responses\n */\nexport interface GetUserChatsRequest {\n orgId: string;\n userId: string;\n limit?: number /* int */; // Number of chats to return (default 15)\n offset?: number /* int */; // Number of chats to skip (for pagination)\n}\nexport interface GetUserChatsResponse {\n chats: ChatSummary[];\n total: number /* int */; // Total number of chats for this user\n hasMore: boolean; // Whether there are more chats to load\n metadata: ResponseMetadata;\n}\n/**\n * Daily counter requests/responses\n */\nexport interface GetDailyChatCountRequest {\n orgId: string;\n date: string /* RFC3339 */;\n timezone: string;\n}\nexport interface GetDailyChatCountResponse {\n count: number /* int64 */;\n date: string;\n timezone: string;\n metadata: any /* types.ResponseMetadata */;\n}\n\n//////////\n// source: queue-models.go\n\n\n// Queue types\nexport const QueueTypes = {\n skill: { value: 'skill', label: 'Skill-based', description: 'Route by agent expertise and skills' },\n priority: { value: 'priority', label: 'Priority-based', description: 'Route by customer tier and urgency level' },\n department: { value: 'department', label: 'Department-based', description: 'Route by business function alignment' },\n complexity: { value: 'complexity', label: 'Complexity-based', description: 'Route by issue difficulty assessment' },\n} as const;\n\nexport type QueueTypeTS = keyof typeof QueueTypes;\nexport type QueueTypeOptionTS = typeof QueueTypes[QueueTypeTS];\n\n/**\n * QueueType represents the routing algorithm type\n */\nexport type QueueType = string;\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeSkill: QueueType = \"skill\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypePriority: QueueType = \"priority\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeDepartment: QueueType = \"department\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeComplexity: QueueType = \"complexity\";\n/**\n * AgentQueue represents an individual queue within a queue type\n */\nexport interface AgentQueue {\n id: string /* uuid */;\n orgId: string;\n type: QueueTypeTS; // \"skill\", \"priority\", etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case for metadata matching)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable display name)\n description: string;\n agentIds: string[]; // Agents assigned to this queue\n config: { [key: string]: any}; // Extensible configuration\n isActive: boolean;\n isDefault: boolean; // Default queue for unmatched chats\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n createdBy?: string;\n updatedBy?: string;\n}\n/**\n * GetAgentQueuesFilter represents filtering options for agent queues\n */\nexport interface GetAgentQueuesFilter {\n type?: QueueType;\n isActive?: boolean;\n}\n/**\n * Agent Queue Operations\n */\nexport interface CreateAgentQueueRequest {\n orgId: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n createdBy?: string;\n updatedBy?: string;\n}\nexport interface CreateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface GetAgentQueuesRequest {\n orgId: string;\n type?: QueueType; // Filter by queue type\n isActive?: boolean; // Filter by active status\n}\nexport interface GetAgentQueuesResponse {\n queues: (AgentQueue | undefined)[];\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface UpdateAgentQueueRequest {\n orgId: string;\n id: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n updatedBy?: string;\n}\nexport interface UpdateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface DeleteAgentQueueRequest {\n orgId: string;\n id: string;\n}\nexport interface DeleteAgentQueueResponse {\n metadata: any /* types.ResponseMetadata */;\n}\n/**\n * ChatQueueInfo extends Chat with queue routing information\n */\nexport interface ChatQueueInfo {\n recommendedQueueId?: string /* uuid */;\n recommendedQueueName?: string;\n assignedQueueId?: string /* uuid */;\n assignedQueueName?: string;\n}\n\n//////////\n// source: subjects.go\n\nexport const GetWaitingForAgentChatCountSubject = \"chat.get_waiting_for_agent_chat_count\";\nexport const GetActiveChatCountSubject = \"chat.get_active_chat_count\";\nexport const GetWaitingForAgentChatsSubject = \"chat.get_waiting_for_agent_chats\";\nexport const GetActiveChatsSubject = \"chat.get_active_chats\";\nexport const GetUserChatsSubject = \"chat.get_user_chats\";\nexport const GetChatSubject = \"chat.get_chat\";\n/**\n * Chat Archival Subjects\n */\nexport const ChatArchiveSubjectPattern = \"chat.archive.%s.server\"; // %s = channel/product (e.g., shop-assist, gov-services)\n/**\n * Agent Session Subjects\n */\nexport const StartAgentSessionSubject = \"chat.agent_session.start\";\nexport const EndAgentSessionSubject = \"chat.agent_session.end\";\nexport const UpdateAgentStatusSubject = \"chat.agent_session.update_status\";\nexport const UpdateAgentLastActivitySubject = \"chat.agent_session.update_last_activity\";\nexport const AssignChatToAgentSubject = \"chat.agent_session.assign_chat\";\nexport const CompleteChatByAgentSubject = \"chat.agent_session.complete_chat\";\nexport const GetAgentSessionSubject = \"chat.agent_session.get\";\nexport const GetOnlineAgentsSubject = \"chat.agent_session.get_online_agents\";\nexport const GetOnlineAgentCountSubject = \"chat.agent_session.get_online_agent_count\";\n/**\n * Queue Management Subjects\n */\nexport const CreateAgentQueueSubject = \"chat.agent_queue.create\";\nexport const GetAgentQueuesSubject = \"chat.agent_queue.get\";\nexport const UpdateAgentQueueSubject = \"chat.agent_queue.update\";\nexport const DeleteAgentQueueSubject = \"chat.agent_queue.delete\";\n/**\n * Queue-specific Chat Subjects\n */\nexport const GetQueueChatsSubject = \"chat.queue.get_chats\";\nexport const GetQueueChatCountSubject = \"chat.queue.get_chat_count\";\n/**\n * Daily Counter Subjects\n */\nexport const GetDailyChatCountSubject = \"chat.get_daily_chat_count\";\n/**\n * User Status Subjects\n */\nexport const UpdateUserStatusSubject = \"chat.user.status.update\";\nexport const GetOnlineUsersSubject = \"chat.users.online.get\";\n/**\n * Analytics Trigger Subjects\n */\nexport const TriggerAnalyticsScanSubject = \"chat.analytics.trigger-scan\";\n/**\n * Org Setup Subject\n */\nexport const SetupOrgSubject = \"chat.org.setup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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AM,oBAAgC;AA2JtC,IAAM,aAAa;AAAA,EACxB,OAAO,EAAE,OAAO,SAAS,OAAO,eAAe,aAAa,sCAAsC;AAAA,EAClG,UAAU,EAAE,OAAO,YAAY,OAAO,kBAAkB,aAAa,2CAA2C;AAAA,EAChH,YAAY,EAAE,OAAO,cAAc,OAAO,oBAAoB,aAAa,uCAAuC;AAAA,EAClH,YAAY,EAAE,OAAO,cAAc,OAAO,oBAAoB,aAAa,uCAAuC;AACpH;AAYO,IAAM,iBAA4B;AAIlC,IAAM,oBAA+B;AAIrC,IAAM,sBAAiC;AAIvC,IAAM,sBAAiC;AA2FvC,IAAM,qCAAqC;AAC3C,IAAM,4BAA4B;AAClC,IAAM,iCAAiC;AACvC,IAAM,wBAAwB;AAC9B,IAAM,sBAAsB;AAC5B,IAAM,iBAAiB;AAIvB,IAAM,4BAA4B;AAIlC,IAAM,2BAA2B;AACjC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,iCAAiC;AACvC,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,6BAA6B;AAInC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAIhC,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AAIjC,IAAM,2BAA2B;AAIjC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAI9B,IAAM,8BAA8B;AAIpC,IAAM,kBAAkB;","names":[]}
1
+ {"version":3,"sources":["../../models/index.ts","../../models/chat-models.ts"],"sourcesContent":["export * from \"./chat-models\";\n","// Code generated by tygo. DO NOT EDIT.\nimport { KGNode } from \"@elqnt/kg\";\nimport { Variable } from \"@elqnt/types\";\nimport { ResponseMetadata, ProductNameTS } from \"@elqnt/types\";\nimport { DocumentAnalysisResult } from \"@elqnt/docs\";\n\n//////////\n// source: chat-models.go\n\nexport type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';\nexport type ChatStatus = string;\nexport const ChatStatusActive: ChatStatus = \"active\";\nexport const ChatStatusDisconnected: ChatStatus = \"disconnected\";\nexport const ChatStatusAbandoned: ChatStatus = \"abandoned\";\nexport const ChatStatusClosed: ChatStatus = \"closed\";\nexport const ChatStatusArchived: ChatStatus = \"archived\";\nexport type ChatTypeTS = 'customer_support' | 'public_room' | 'private_room' | 'direct' | 'group';\nexport type ChatType = string;\nexport const ChatTypeCustomerSupport: ChatType = \"customer_support\"; // Existing customer support chats\nexport const ChatTypePublicRoom: ChatType = \"public_room\"; // Public collaboration room\nexport const ChatTypePrivateRoom: ChatType = \"private_room\"; // Private collaboration room\nexport const ChatTypeDirect: ChatType = \"direct\"; // 1-on-1 direct message\nexport const ChatTypeGroup: ChatType = \"group\"; // Group chat/room\nexport interface Chat {\n orgId: string;\n key: string;\n title: string;\n messages: ChatMessage[];\n lastUpdated: number /* int64 */;\n startTime: number /* int64 */;\n users: ChatUser[];\n status: ChatStatusTS;\n aiEngaged: boolean;\n humanAgentEngaged: boolean;\n isWaiting: boolean;\n isWaitingForAgent: boolean;\n callRequested?: boolean;\n callStarted?: boolean;\n userRating?: number /* int */;\n metadata?: { [key: string]: any};\n grading?: ChatGrading;\n flow?: ChatFlow;\n context?: ChatContext;\n csatSent?: boolean;\n csatSentTime?: number /* int64 */;\n csatResponse?: any /* agents.CSATResponse */;\n /**\n * Active skills for this chat session\n */\n activeSkills?: any /* agents.Skill */[];\n /**\n * OpenAI Responses API - stores the last response ID for conversation continuity\n */\n lastResponseId?: string;\n /**\n * AgentContext - reference to structured context stored in separate NATS KV bucket\n * Key format: {agentId}:{chatKey} in bucket agent-contexts-org-{orgId}\n */\n agentContextKey?: string;\n /**\n * Chat Pin\n */\n pinned?: boolean;\n /**\n * Collab-specific fields\n */\n chatType?: ChatTypeTS;\n description?: string;\n}\nexport interface ChatContext {\n memory: { [key: string]: any};\n turnCount: number /* int */;\n lastIntent: string;\n activeTopic: string;\n}\nexport interface ChatFlow {\n flowDefinitionId: string;\n flowInstanceId?: string;\n flowInstanceLastUpdated?: number /* int64 */;\n tools?: ChatTool[];\n}\nexport interface ChatTool {\n name: string;\n description: string;\n type: string; // function, action, data_query etc\n parameters?: { [key: string]: any};\n}\nexport type ChatRoleTS = 'user' | 'ai' | 'event' | 'humanAgent' | 'observer' | 'dataQuery' | 'system' | 'tool';\nexport type ChatRole = string;\nexport const ChatRoleUser: ChatRole = \"user\";\nexport const ChatRoleAI: ChatRole = \"ai\";\nexport const ChatRoleEvent: ChatRole = \"event\";\nexport const ChatRoleHumanAgent: ChatRole = \"humanAgent\";\nexport const ChatRoleObserver: ChatRole = \"observer\";\nexport const ChatRoleDataQuery: ChatRole = \"dataQuery\";\nexport const ChatRoleSystem: ChatRole = \"system\";\nexport const ChatRoleTool: ChatRole = \"tool\";\nexport interface ChatUser {\n id: string;\n role: ChatRoleTS;\n name: string;\n email: string;\n phone?: string;\n authProvider: string;\n authToken: string;\n metadata?: { [key: string]: any};\n}\nexport type AgentStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type AgentStatus = string;\nexport const AgentStatusOnline: AgentStatus = \"online\";\nexport const AgentStatusAway: AgentStatus = \"away\";\nexport const AgentStatusBusy: AgentStatus = \"busy\";\nexport const AgentStatusOffline: AgentStatus = \"offline\";\n/**\n * AgentSession represents an active agent session stored in Redis\n */\nexport interface AgentSession {\n agentId: string;\n orgId: string;\n onlineSince: number /* int64 */; // Unix timestamp\n lastActivity: number /* int64 */; // Unix timestamp\n status: AgentStatusTS;\n chatsHandled: number /* int */;\n activeChats: string[]; // Chat keys currently handling\n userAgent?: string;\n ipAddress?: string;\n metadata?: { [key: string]: any};\n}\nexport type ChatEventType = string;\n/**\n * ** user events\n */\nexport const ChatEventTypeUserJoined: ChatEventType = \"user_joined\";\nexport const ChatEventTypeUserLeft: ChatEventType = \"user_left\";\nexport const ChatEventTypeTyping: ChatEventType = \"typing\";\nexport const ChatEventTypeStoppedTyping: ChatEventType = \"stopped_typing\";\nexport const ChatEventTypeRead: ChatEventType = \"read\";\nexport const ChatEventTypeDelivered: ChatEventType = \"delivered\";\nexport const ChatEventTypeReconnected: ChatEventType = \"reconnected\";\nexport const ChatEventTypeError: ChatEventType = \"error\";\nexport const ChatEventTypeWaiting: ChatEventType = \"waiting\";\nexport const ChatEventTypeLoadChat: ChatEventType = \"load_chat\";\nexport const ChatEventTypeLoadChatResponse: ChatEventType = \"load_chat_response\";\nexport const ChatEventTypeMessage: ChatEventType = \"message\";\nexport const ChatEventTypeWaitingForAgent: ChatEventType = \"waiting_for_agent\";\nexport const ChatEventTypeMessageStatusUpdate: ChatEventType = \"message_status_update\";\nexport const ChatEventTypeHumanAgentJoined: ChatEventType = \"human_agent_joined\";\nexport const ChatEventTypeHumanAgentLeft: ChatEventType = \"human_agent_left\";\nexport const ChatEventTypeObserverJoined: ChatEventType = \"observer_joined\";\nexport const ChatEventTypeObserverLeft: ChatEventType = \"observer_left\";\nexport const ChatEventTypeListChats: ChatEventType = \"list_chats\";\nexport const ChatEventTypeChatUpdated: ChatEventType = \"chat_updated\";\nexport const ChatEventTypeChatRemoved: ChatEventType = \"chat_removed\";\nexport const ChatEventTypeSyncMetadata: ChatEventType = \"sync_metadata\";\nexport const ChatEventTypeSyncMetadataResponse: ChatEventType = \"sync_metadata_response\";\nexport const ChatEventTypeSyncUserSession: ChatEventType = \"sync_user_session\";\nexport const ChatEventTypeSyncUserSessionResponse: ChatEventType = \"sync_user_session_response\";\nexport const ChatEventTypeClientAction: ChatEventType = \"client_action\";\nexport const ChatEventTypeClientActionCallback: ChatEventType = \"client_action_callback\";\nexport const ChatEventTypeBlockUser: ChatEventType = \"block_user\";\n/**\n * ** collab room management events\n */\nexport const ChatEventTypeCreateRoom: ChatEventType = \"create_room\";\nexport const ChatEventTypeRoomCreated: ChatEventType = \"room_created\";\nexport const ChatEventTypeJoinRoom: ChatEventType = \"join_room\";\nexport const ChatEventTypeLeaveRoom: ChatEventType = \"leave_room\";\nexport const ChatEventTypeDeleteRoom: ChatEventType = \"delete_room\";\nexport const ChatEventTypeRoomDeleted: ChatEventType = \"room_deleted\";\nexport const ChatEventTypeUpdateRoom: ChatEventType = \"update_room\";\nexport const ChatEventTypeRoomUpdated: ChatEventType = \"room_updated\";\nexport const ChatEventTypeInviteUser: ChatEventType = \"invite_user\";\nexport const ChatEventTypeUserInvited: ChatEventType = \"user_invited\";\nexport const ChatEventTypeRoomUserJoined: ChatEventType = \"room_user_joined\";\nexport const ChatEventTypeRoomUserLeft: ChatEventType = \"room_user_left\";\nexport const ChatEventTypeUserRemoved: ChatEventType = \"user_removed\";\nexport const ChatEventTypeListRooms: ChatEventType = \"list_rooms\";\nexport const ChatEventTypeRoomsResponse: ChatEventType = \"rooms_response\";\n/**\n * ** collab message events\n */\nexport const ChatEventTypeMessageEdited: ChatEventType = \"message_edited\";\nexport const ChatEventTypeMessageDeleted: ChatEventType = \"message_deleted\";\nexport const ChatEventTypeMessageReaction: ChatEventType = \"message_reaction\";\nexport const ChatEventTypeMessageReply: ChatEventType = \"message_reply\";\nexport const ChatEventTypeMentionUser: ChatEventType = \"mention_user\";\nexport const ChatEventTypeMessageEditedResponse: ChatEventType = \"message_edited_response\";\nexport const ChatEventTypeMessageDeletedResponse: ChatEventType = \"message_deleted_response\";\nexport const ChatEventTypeMessageReactionResponse: ChatEventType = \"message_reaction_response\";\n/**\n * ** collab user presence events\n */\nexport const ChatEventTypeUserPresenceStart: ChatEventType = \"user_presence_start\";\nexport const ChatEventTypeUserPresenceEnd: ChatEventType = \"user_presence_end\";\nexport const ChatEventTypeUserStatusChange: ChatEventType = \"user_status_change\";\nexport const ChatEventTypeUserActivity: ChatEventType = \"user_activity\";\nexport const ChatEventTypeUserPresenceChanged: ChatEventType = \"user_presence_changed\";\nexport const ChatEventTypeUserActivityUpdate: ChatEventType = \"user_activity_update\";\nexport const ChatEventTypeGetOnlineUsers: ChatEventType = \"get_online_users\";\nexport const ChatEventTypeOnlineUsersResponse: ChatEventType = \"online_users\";\n/**\n * ** shop assist events\n */\nexport const ChatEventTypeEndChat: ChatEventType = \"end_chat\";\nexport const ChatEventTypeChatEnded: ChatEventType = \"chat_ended\";\n/**\n * ** agent session events\n */\nexport const ChatEventTypeAgentSessionStart: ChatEventType = \"agent_session_start\";\nexport const ChatEventTypeAgentSessionEnd: ChatEventType = \"agent_session_end\";\nexport const ChatEventTypeAgentStatusChange: ChatEventType = \"agent_status_change\";\nexport const ChatEventTypeAgentActivityPing: ChatEventType = \"agent_activity_ping\";\nexport const ChatEventTypeAgentChatAssigned: ChatEventType = \"agent_chat_assigned\";\nexport const ChatEventTypeAgentChatCompleted: ChatEventType = \"agent_chat_completed\";\n/**\n * ** AI agents retrieval events\n */\nexport const ChatEventTypeGetAgents: ChatEventType = \"get_agents\";\nexport const ChatEventTypeGetAgentsResponse: ChatEventType = \"get_agents_response\";\n/**\n * ** CSAT events\n */\nexport const ChatEventTypeCSATRequest: ChatEventType = \"csat_request\"; // Internal: scheduler requests chat to send CSAT\nexport const ChatEventTypeCSATSurvey: ChatEventType = \"show_csat_survey\";\nexport const ChatEventTypeCSATResponse: ChatEventType = \"csat_response\";\n/**\n * ** User Suggested Actions events\n */\nexport const ChatEventTypeUserSuggestedActions: ChatEventType = \"user_suggested_actions\";\nexport const ChatEventTypeUserSuggestedActionSelected: ChatEventType = \"user_suggested_action_selected\";\n/**\n * ** Summary events\n */\nexport const ChatEventTypeSummaryUpdate: ChatEventType = \"summary_update\";\n/**\n * ** Agent Context events\n */\nexport const ChatEventTypeAgentContextUpdate: ChatEventType = \"agent_context_update\";\nexport const ChatEventTypeAgentExecutionStarted: ChatEventType = \"agent_execution_started\";\nexport const ChatEventTypeAgentExecutionEnded: ChatEventType = \"agent_execution_ended\";\nexport const ChatEventTypeLoadAgentContext: ChatEventType = \"load_agent_context\";\nexport const ChatEventTypeLoadAgentContextResponse: ChatEventType = \"load_agent_context_response\";\n/**\n * ** Plan → Approve → Execute events\n */\nexport const ChatEventTypePlanPendingApproval: ChatEventType = \"plan_pending_approval\";\nexport const ChatEventTypePlanApproved: ChatEventType = \"plan_approved\";\nexport const ChatEventTypePlanRejected: ChatEventType = \"plan_rejected\";\nexport const ChatEventTypePlanCompleted: ChatEventType = \"plan_completed\";\nexport const ChatEventTypeStepStarted: ChatEventType = \"step_started\";\nexport const ChatEventTypeStepCompleted: ChatEventType = \"step_completed\";\nexport const ChatEventTypeStepFailed: ChatEventType = \"step_failed\";\n/**\n * ** New Chat events\n */\nexport const ChatEventTypeNewChat: ChatEventType = \"new_chat\";\nexport const ChatEventTypeNewChatCreated: ChatEventType = \"new_chat_created\";\n/**\n * ** Heartbeat events\n */\nexport const ChatEventTypePing: ChatEventType = \"ping\";\nexport const ChatEventTypePong: ChatEventType = \"pong\";\n/**\n * ** Skill activation events\n */\nexport const ChatEventTypeSkillActivate: ChatEventType = \"skill_activate\";\nexport const ChatEventTypeSkillDeactivate: ChatEventType = \"skill_deactivate\";\nexport const ChatEventTypeSkillsChanged: ChatEventType = \"skills_changed\";\n/**\n * ** Attachment processing events (deferred document processing)\n */\nexport const ChatEventTypeAttachmentProcessingStarted: ChatEventType = \"attachment_processing_started\";\nexport const ChatEventTypeAttachmentProcessingProgress: ChatEventType = \"attachment_processing_progress\";\nexport const ChatEventTypeAttachmentProcessingComplete: ChatEventType = \"attachment_processing_complete\";\nexport const ChatEventTypeAttachmentProcessingError: ChatEventType = \"attachment_processing_error\";\nexport const ChatEventTypeRetryAttachment: ChatEventType = \"retry_attachment\";\nexport type ChatEventTypeTS =\n | \"message\"\n | \"user_joined\"\n | \"user_left\"\n | \"typing\"\n | \"stopped_typing\"\n | \"read\"\n | \"delivered\"\n | \"reconnected\"\n | \"error\"\n | \"message_status_update\"\n | \"load_chat\"\n | \"load_chat_response\"\n | \"waiting\"\n | \"waiting_for_agent\"\n | \"human_agent_joined\"\n | \"end_chat\"\n | \"chat_ended\"\n | \"human_agent_left\"\n | \"observer_joined\"\n | \"observer_left\"\n | \"list_chats\"\n | \"chat_updated\"\n | \"chat_removed\"\n | \"sync_metadata\"\n | \"sync_metadata_response\"\n | \"sync_user_session\"\n | \"sync_user_session_response\"\n | \"agent_session_start\"\n | \"agent_session_end\"\n | \"agent_status_change\"\n | \"agent_activity_ping\"\n | \"agent_chat_assigned\"\n | \"agent_chat_completed\"\n | \"client_action\"\n | \"client_action_callback\"\n | \"show_csat_survey\"\n | \"csat_response\"\n | \"user_suggested_actions\"\n | \"user_suggested_action_selected\"\n | \"summary_update\"\n | \"agent_context_update\"\n | \"agent_execution_started\"\n | \"agent_execution_ended\"\n | \"load_agent_context\"\n | \"load_agent_context_response\"\n | \"plan_pending_approval\"\n | \"plan_approved\"\n | \"plan_rejected\"\n | \"plan_completed\"\n | \"step_started\"\n | \"step_completed\"\n | \"step_failed\"\n | \"new_chat\"\n | \"new_chat_created\"\n | \"block_user\"\n | \"ping\"\n | \"pong\"\n | \"create_room\"\n | \"room_created\"\n | \"join_room\"\n | \"leave_room\"\n | \"delete_room\"\n | \"room_deleted\"\n | \"update_room\"\n | \"room_updated\"\n | \"invite_user\"\n | \"user_invited\"\n | \"room_user_joined\"\n | \"room_user_left\"\n | \"user_removed\"\n | \"list_rooms\"\n | \"rooms_response\"\n | \"message_edited\"\n | \"message_deleted\"\n | \"message_reaction\"\n | \"message_reply\"\n | \"mention_user\"\n | \"message_edited_response\"\n | \"message_deleted_response\"\n | \"message_reaction_response\"\n | \"user_presence_start\"\n | \"user_presence_end\"\n | \"user_status_change\"\n | \"user_activity\"\n | \"user_presence_changed\"\n | \"user_activity_update\"\n | \"get_online_users\"\n | \"online_users\"\n | \"get_agents\"\n | \"get_agents_response\"\n | \"skill_activate\"\n | \"skill_deactivate\"\n | \"skills_changed\"\n | \"attachment_processing_started\"\n | \"attachment_processing_progress\"\n | \"attachment_processing_complete\"\n | \"attachment_processing_error\"\n | \"retry_attachment\";\nexport type MessageStatus = string;\nexport const MessageStatusSending: MessageStatus = \"sending\";\nexport const MessageStatusSent: MessageStatus = \"sent\";\nexport const MessageStatusDelivered: MessageStatus = \"delivered\";\nexport const MessageStatusRead: MessageStatus = \"read\";\nexport const MessageStatusFailed: MessageStatus = \"failed\";\nexport type MessageStatusTS =\n | \"sending\"\n | \"sent\"\n | \"delivered\"\n | \"read\"\n | \"failed\";\n/**\n * EmojiReaction represents an emoji reaction to a message\n */\nexport interface EmojiReaction {\n emoji: string;\n count: number /* int */;\n users?: string[]; // List of user IDs who reacted\n}\n/**\n * Location represents geographical coordinates\n */\nexport interface Location {\n latitude: number /* float64 */;\n longitude: number /* float64 */;\n address?: string;\n}\n/**\n * AttachmentFile represents a file within an attachment\n */\nexport interface AttachmentFile {\n type: string;\n url: string;\n thumbnailUrl?: string;\n name?: string;\n size?: number /* int64 */;\n}\nexport type AttachmentType = string;\n/**\n * Attachment types for both user and system attachments\n */\nexport const AttachmentTypeDocument: AttachmentType = \"document\";\nexport const AttachmentTypeDocumentAnalysis: AttachmentType = \"document_analysis\";\nexport const AttachmentTypeImage: AttachmentType = \"image\";\nexport const AttachmentTypeAudio: AttachmentType = \"audio\";\nexport const AttachmentTypeVideo: AttachmentType = \"video\";\nexport const AttachmentTypeLocation: AttachmentType = \"location\";\nexport const AttachmentTypeReferences: AttachmentType = \"references\";\nexport const AttachmentTypeSubsections: AttachmentType = \"subsections\";\nexport const AttachmentTypeArticles: AttachmentType = \"articles\";\nexport const AttachmentTypeRecords: AttachmentType = \"records\";\nexport const AttachmentTypeActions: AttachmentType = \"actions\";\nexport const AttachmentTypeBullets: AttachmentType = \"bullets\";\nexport const AttachmentTypeSticker: AttachmentType = \"sticker\";\nexport const AttachmentTypeData: AttachmentType = \"data\";\nexport const AttachmentTypeKGNodes: AttachmentType = \"kgNodes\";\nexport const AttachmentTypeDocumentSources: AttachmentType = \"document_sources\";\nexport const AttachmentTypeSpreadsheet: AttachmentType = \"spreadsheet\"; // Excel, CSV files\nexport const AttachmentTypeDataFile: AttachmentType = \"data_file\"; // JSON, XML, YAML files\n\nexport type AttachmentTypeTS =\n | \"document\"\n | \"document_analysis\"\n | \"image\"\n | \"audio\"\n | \"video\"\n | \"location\"\n | \"references\"\n | \"subsections\"\n | \"articles\"\n | \"records\"\n | \"actions\"\n | \"bullets\"\n | \"sticker\"\n | \"data\"\n | \"kgNodes\"\n | \"document_sources\"\n | \"spreadsheet\"\n | \"data_file\";\n\n/**\n * DocumentSource represents an aggregated document source with page references\n * Used to display source cards in chat responses after document search\n */\nexport interface DocumentSource {\n doc_id: string;\n title: string;\n url: string;\n page_numbers: number /* int */[];\n reference_count: number /* int */;\n bounding_regions?: any /* docs.BoundingRegion */[];\n page_infos?: any /* docs.PageInfo */[]; // Page dimensions for coordinate scaling\n}\n/**\n * Attachment represents any type of attachment to a message\n */\nexport interface Attachment {\n type: AttachmentTypeTS;\n documentAnalysis?: DocumentAnalysisResult;\n title?: string;\n url: string;\n files?: AttachmentFile[]; // Associated files\n location?: Location; // Location data if applicable\n data?: { [key: string]: Variable};\n kgNodes?: KGNode[];\n actions?: Action[];\n documentSources?: DocumentSource[];\n /**\n * Smart document processing fields\n */\n fileMetadata?: any /* docs.AttachmentFileMetadata */; // Client-side extracted file metadata\n processing?: any /* docs.ProcessingResult */; // Smart processing result\n}\nexport interface Action {\n id: string;\n title: string;\n icon?: string;\n description?: string;\n onAction?: () => void;\n}\n/**\n * ChatMessage represents the core message structure\n */\nexport interface ChatMessage {\n /**\n * Core fields\n */\n id: string;\n role: ChatRoleTS;\n content: string;\n time: number /* int64 */;\n status: MessageStatusTS;\n /**\n * Sender information\n */\n senderId: string;\n senderName?: string;\n /**\n * Timing\n */\n createdAt: number /* int64 */;\n updatedAt?: number /* int64 */;\n /**\n * Message relations\n */\n replyTo?: string;\n threadId?: string;\n mentions?: string[];\n /**\n * Attachments and reactions\n */\n attachments?: Attachment[];\n reactions?: EmojiReaction[];\n /**\n * Additional data\n */\n variables?: { [key: string]: Variable};\n /**\n * Tool call\n */\n name?: string;\n toolCallId?: string;\n toolCalls?: ToolCall[];\n /**\n * LLM usage\n */\n llmUsage?: LLMUsage;\n}\nexport interface ChatEvent {\n type: ChatEventTypeTS;\n orgId: string;\n chatKey: string;\n userId: string;\n timestamp: number /* int64 */;\n data?: { [key: string]: any};\n message?: ChatMessage;\n}\nexport interface ChatGrading {\n chatKey: string;\n grade: number /* int */;\n topic: string;\n summary: string;\n}\nexport interface ChatSession {\n id: string;\n status: ChatSessionStatus;\n user?: ChatUser;\n activeChatKey?: string;\n preferences?: ChatSessionPreferences;\n lastActivity: number /* int64 */;\n expiresAt: number /* int64 */;\n metadata?: { [key: string]: any};\n}\nexport type ChatSessionStatus = string;\nexport const ChatSessionStatusActive: ChatSessionStatus = \"active\";\nexport const ChatSessionStatusIdle: ChatSessionStatus = \"idle\";\nexport const ChatSessionStatusExpired: ChatSessionStatus = \"expired\";\nexport interface ChatSessionPreferences {\n language: string;\n theme: string;\n notifications: boolean;\n timeZone: string;\n messageDisplay: string; // compact/expanded\n autoTranslate: boolean;\n rateLimits?: ChatRateLimits;\n}\nexport interface ChatRateLimits {\n maxMessagesPerMinute: number /* int */;\n maxTokensPerDay: number /* int */;\n cooldownPeriod: number /* int */; // seconds\n}\n/**\n * ==========================\n * todo: move to common/llm\n */\nexport interface LLMConfig {\n Provider: string;\n Model: string;\n Temperature: number /* float64 */;\n MaxTokens: number /* int */;\n SystemPrompt: string;\n Tools: LLMTool[];\n Memory?: LLMMemoryConfig;\n}\nexport interface LLMMemoryConfig {\n MaxMessages: number /* int */;\n IncludeSystem: boolean;\n WindowSize: number /* int */; // Token window size\n Strategy: string; // e.g., \"sliding\", \"summarize\"\n}\nexport interface LLMTool {\n Name: string;\n Type: string;\n Function: LLMFunction;\n}\nexport interface LLMFunction {\n Name: string;\n Description: string;\n Parameters: any /* types.JSONSchema */;\n}\nexport interface ToolCall {\n Name: string;\n Arguments: { [key: string]: any};\n ID: string;\n Description: string;\n}\nexport interface LLMResponse {\n Content: string;\n ToolCalls: ToolCall[];\n Usage?: LLMUsage;\n ResponseId: string; // OpenAI Responses API - the response ID for conversation continuity\n}\nexport interface LLMUsage {\n inputTokens: number /* int64 */;\n outputTokens: number /* int64 */;\n totalTokens: number /* int64 */;\n}\n/**\n * ChatSummary represents lightweight chat information for caching and listing\n */\nexport interface ChatSummary {\n chatKey: string;\n title: string;\n userId?: string;\n status: ChatStatus;\n lastUpdated: number /* int64 */;\n waitingSince?: number /* int64 */; // Only populated for waiting chats\n pinned?: boolean;\n metadata?: { [key: string]: any};\n}\nexport interface GetChatRequest {\n orgId: string;\n chatKey: string;\n}\nexport interface GetChatResponse {\n chat?: Chat;\n metadata: ResponseMetadata;\n}\nexport interface ChatProductReference {\n id: string;\n title: string;\n price: number /* float64 */;\n image?: string;\n url?: string;\n}\n/**\n * Chat Archival Models\n */\nexport interface ChatArchivalRequest {\n orgId: string;\n chatKey: string;\n chat: Chat;\n}\nexport interface ChatArchivalResponse {\n success: boolean;\n error?: string;\n message?: string;\n}\n/**\n * Agent Session Request/Response Models\n */\nexport interface StartAgentSessionRequest {\n orgId: string;\n agentId: string;\n userAgent?: string;\n ipAddress?: string;\n}\nexport interface StartAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface EndAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface EndAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentStatusRequest {\n orgId: string;\n agentId: string;\n status: AgentStatusTS;\n}\nexport interface UpdateAgentStatusResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentLastActivityRequest {\n orgId: string;\n agentId: string;\n}\nexport interface UpdateAgentLastActivityResponse {\n metadata: ResponseMetadata;\n}\nexport interface AssignChatToAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface AssignChatToAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface CompleteChatByAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface CompleteChatByAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface GetAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface GetAgentSessionResponse {\n session?: AgentSession;\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentsRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentsResponse {\n sessions: AgentSession[];\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentCountRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\n/**\n * Queue-specific chat request/response types\n */\nexport interface GetQueueChatsRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\nexport interface GetQueueChatCountRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport type UserStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type UserStatus = string;\nexport const UserStatusOnline: UserStatus = \"online\";\nexport const UserStatusAway: UserStatus = \"away\";\nexport const UserStatusBusy: UserStatus = \"busy\";\nexport const UserStatusOffline: UserStatus = \"offline\";\n/**\n * UserSession for tracking online users\n */\nexport interface UserSession {\n orgId: string;\n userId: string;\n userName: string;\n status: UserStatusTS;\n onlineSince: number /* int64 */;\n lastActivity: number /* int64 */;\n}\n/**\n * User status update requests\n */\nexport interface UpdateUserStatusRequest {\n orgId: string;\n userId: string;\n status: UserStatusTS;\n}\nexport interface UpdateUserStatusResponse {\n metadata: ResponseMetadata;\n}\n/**\n * Get online users\n */\nexport interface GetOnlineUsersRequest {\n orgId: string;\n}\nexport interface GetOnlineUsersResponse {\n metadata: ResponseMetadata;\n users: UserSession[];\n}\n/**\n * Analytics Trigger Models\n */\nexport interface TriggerAnalyticsScanRequest {\n org_id?: string; // Optional: if empty, scans all orgs\n}\nexport interface TriggerAnalyticsScanResponse {\n metadata: ResponseMetadata;\n chats_archived: number /* int */;\n}\n/**\n * AttachmentProcessingStartedData is sent when attachment processing begins\n */\nexport interface AttachmentProcessingStartedData {\n attachmentId: string;\n fileName: string;\n strategy: string;\n}\n/**\n * AttachmentProcessingProgressData is sent during attachment processing\n */\nexport interface AttachmentProcessingProgressData {\n attachmentId: string;\n percent: number /* int */;\n stage: string;\n message: string;\n}\n/**\n * AttachmentProcessingCompleteData is sent when attachment processing completes\n */\nexport interface AttachmentProcessingCompleteData {\n attachmentId: string;\n result?: any /* docs.ProcessingResult */;\n}\n/**\n * AttachmentProcessingErrorData is sent when attachment processing fails\n */\nexport interface AttachmentProcessingErrorData {\n attachmentId: string;\n error: string;\n retryable: boolean;\n}\n/**\n * RetryAttachmentData is sent by frontend to retry a failed attachment\n */\nexport interface RetryAttachmentData {\n attachmentId: string;\n}\n\n//////////\n// source: chat-stats-models.go\n\n/**\n * Active chat requests/responses\n */\nexport interface GetActiveChatCountRequest {\n orgId: string;\n}\nexport interface GetActiveChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetActiveChatsRequest {\n orgId: string;\n pastHours?: number /* float64 */; // 0 means all, 0.5 means past 30 min, 1 means past hour, etc.\n}\nexport interface GetActiveChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * Waiting for agent requests/responses\n */\nexport interface GetWaitingForAgentChatCountRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetWaitingForAgentChatsRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * User chats requests/responses\n */\nexport interface GetUserChatsRequest {\n orgId: string;\n userId: string;\n limit?: number /* int */; // Number of chats to return (default 15)\n offset?: number /* int */; // Number of chats to skip (for pagination)\n}\nexport interface GetUserChatsResponse {\n chats: ChatSummary[];\n total: number /* int */; // Total number of chats for this user\n hasMore: boolean; // Whether there are more chats to load\n metadata: ResponseMetadata;\n}\n/**\n * Daily counter requests/responses\n */\nexport interface GetDailyChatCountRequest {\n orgId: string;\n date: string /* RFC3339 */;\n timezone: string;\n}\nexport interface GetDailyChatCountResponse {\n count: number /* int64 */;\n date: string;\n timezone: string;\n metadata: any /* types.ResponseMetadata */;\n}\n\n//////////\n// source: queue-models.go\n\n\n// Queue types\nexport const QueueTypes = {\n skill: { value: 'skill', label: 'Skill-based', description: 'Route by agent expertise and skills' },\n priority: { value: 'priority', label: 'Priority-based', description: 'Route by customer tier and urgency level' },\n department: { value: 'department', label: 'Department-based', description: 'Route by business function alignment' },\n complexity: { value: 'complexity', label: 'Complexity-based', description: 'Route by issue difficulty assessment' },\n} as const;\n\nexport type QueueTypeTS = keyof typeof QueueTypes;\nexport type QueueTypeOptionTS = typeof QueueTypes[QueueTypeTS];\n\n/**\n * QueueType represents the routing algorithm type\n */\nexport type QueueType = string;\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeSkill: QueueType = \"skill\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypePriority: QueueType = \"priority\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeDepartment: QueueType = \"department\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeComplexity: QueueType = \"complexity\";\n/**\n * AgentQueue represents an individual queue within a queue type\n */\nexport interface AgentQueue {\n id: string /* uuid */;\n orgId: string;\n type: QueueTypeTS; // \"skill\", \"priority\", etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case for metadata matching)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable display name)\n description: string;\n agentIds: string[]; // Agents assigned to this queue\n config: { [key: string]: any}; // Extensible configuration\n isActive: boolean;\n isDefault: boolean; // Default queue for unmatched chats\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n createdBy?: string;\n updatedBy?: string;\n}\n/**\n * GetAgentQueuesFilter represents filtering options for agent queues\n */\nexport interface GetAgentQueuesFilter {\n type?: QueueType;\n isActive?: boolean;\n}\n/**\n * Agent Queue Operations\n */\nexport interface CreateAgentQueueRequest {\n orgId: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n createdBy?: string;\n updatedBy?: string;\n}\nexport interface CreateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface GetAgentQueuesRequest {\n orgId: string;\n type?: QueueType; // Filter by queue type\n isActive?: boolean; // Filter by active status\n}\nexport interface GetAgentQueuesResponse {\n queues: (AgentQueue | undefined)[];\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface UpdateAgentQueueRequest {\n orgId: string;\n id: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n updatedBy?: string;\n}\nexport interface UpdateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface DeleteAgentQueueRequest {\n orgId: string;\n id: string;\n}\nexport interface DeleteAgentQueueResponse {\n metadata: any /* types.ResponseMetadata */;\n}\n/**\n * ChatQueueInfo extends Chat with queue routing information\n */\nexport interface ChatQueueInfo {\n recommendedQueueId?: string /* uuid */;\n recommendedQueueName?: string;\n assignedQueueId?: string /* uuid */;\n assignedQueueName?: string;\n}\n\n//////////\n// source: subjects.go\n\nexport const GetWaitingForAgentChatCountSubject = \"chat.get_waiting_for_agent_chat_count\";\nexport const GetActiveChatCountSubject = \"chat.get_active_chat_count\";\nexport const GetWaitingForAgentChatsSubject = \"chat.get_waiting_for_agent_chats\";\nexport const GetActiveChatsSubject = \"chat.get_active_chats\";\nexport const GetUserChatsSubject = \"chat.get_user_chats\";\nexport const GetChatSubject = \"chat.get_chat\";\n/**\n * Chat Archival Subjects\n */\nexport const ChatArchiveSubjectPattern = \"chat.archive.%s.server\"; // %s = channel/product (e.g., shop-assist, gov-services)\n/**\n * Agent Session Subjects\n */\nexport const StartAgentSessionSubject = \"chat.agent_session.start\";\nexport const EndAgentSessionSubject = \"chat.agent_session.end\";\nexport const UpdateAgentStatusSubject = \"chat.agent_session.update_status\";\nexport const UpdateAgentLastActivitySubject = \"chat.agent_session.update_last_activity\";\nexport const AssignChatToAgentSubject = \"chat.agent_session.assign_chat\";\nexport const CompleteChatByAgentSubject = \"chat.agent_session.complete_chat\";\nexport const GetAgentSessionSubject = \"chat.agent_session.get\";\nexport const GetOnlineAgentsSubject = \"chat.agent_session.get_online_agents\";\nexport const GetOnlineAgentCountSubject = \"chat.agent_session.get_online_agent_count\";\n/**\n * Queue Management Subjects\n */\nexport const CreateAgentQueueSubject = \"chat.agent_queue.create\";\nexport const GetAgentQueuesSubject = \"chat.agent_queue.get\";\nexport const UpdateAgentQueueSubject = \"chat.agent_queue.update\";\nexport const DeleteAgentQueueSubject = \"chat.agent_queue.delete\";\n/**\n * Queue-specific Chat Subjects\n */\nexport const GetQueueChatsSubject = \"chat.queue.get_chats\";\nexport const GetQueueChatCountSubject = \"chat.queue.get_chat_count\";\n/**\n * Daily Counter Subjects\n */\nexport const GetDailyChatCountSubject = \"chat.get_daily_chat_count\";\n/**\n * User Status Subjects\n */\nexport const UpdateUserStatusSubject = \"chat.user.status.update\";\nexport const GetOnlineUsersSubject = \"chat.users.online.get\";\n/**\n * Analytics Trigger Subjects\n */\nexport const TriggerAnalyticsScanSubject = \"chat.analytics.trigger-scan\";\n/**\n * Org Setup Subject\n */\nexport const SetupOrgSubject = \"chat.org.setup\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA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AyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,6BAA6B;AAInC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAIhC,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AAIjC,IAAM,2BAA2B;AAIjC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAI9B,IAAM,8BAA8B;AAIpC,IAAM,kBAAkB;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../models/chat-models.ts"],"sourcesContent":["// Code generated by tygo. DO NOT EDIT.\n// NOTE: @elqnt/kg and @elqnt/docs imports made generic for platform independence.\n// If you need strong typing for these, import the types separately and cast.\n\nimport { Variable } from \"@elqnt/types\";\nimport { ResponseMetadata, ProductNameTS } from \"@elqnt/types\";\n\n/**\n * Generic placeholder for KGNode when @elqnt/kg is not available.\n * Import from @elqnt/kg for full type support.\n */\nexport type KGNode = {\n id: string;\n type: string;\n properties?: Record<string, unknown>;\n [key: string]: unknown;\n};\n\n/**\n * Generic placeholder for DocumentAnalysisResult when @elqnt/docs is not available.\n * Import from @elqnt/docs for full type support.\n */\nexport type DocumentAnalysisResult = {\n pages?: unknown[];\n content?: string;\n [key: string]: unknown;\n};\n\n//////////\n// source: chat-models.go\n\nexport type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';\nexport type ChatStatus = string;\nexport const ChatStatusActive: ChatStatus = \"active\";\nexport const ChatStatusDisconnected: ChatStatus = \"disconnected\";\nexport const ChatStatusAbandoned: ChatStatus = \"abandoned\";\nexport const ChatStatusClosed: ChatStatus = \"closed\";\nexport const ChatStatusArchived: ChatStatus = \"archived\";\nexport type ChatTypeTS = 'customer_support' | 'public_room' | 'private_room' | 'direct' | 'group';\nexport type ChatType = string;\nexport const ChatTypeCustomerSupport: ChatType = \"customer_support\"; // Existing customer support chats\nexport const ChatTypePublicRoom: ChatType = \"public_room\"; // Public collaboration room\nexport const ChatTypePrivateRoom: ChatType = \"private_room\"; // Private collaboration room\nexport const ChatTypeDirect: ChatType = \"direct\"; // 1-on-1 direct message\nexport const ChatTypeGroup: ChatType = \"group\"; // Group chat/room\nexport interface Chat {\n orgId: string;\n key: string;\n title: string;\n messages: ChatMessage[];\n lastUpdated: number /* int64 */;\n startTime: number /* int64 */;\n users: ChatUser[];\n status: ChatStatusTS;\n aiEngaged: boolean;\n humanAgentEngaged: boolean;\n isWaiting: boolean;\n isWaitingForAgent: boolean;\n callRequested?: boolean;\n callStarted?: boolean;\n userRating?: number /* int */;\n metadata?: { [key: string]: any};\n grading?: ChatGrading;\n flow?: ChatFlow;\n context?: ChatContext;\n csatSent?: boolean;\n csatSentTime?: number /* int64 */;\n csatResponse?: any /* agents.CSATResponse */;\n /**\n * Active skills for this chat session\n */\n activeSkills?: any /* agents.Skill */[];\n /**\n * OpenAI Responses API - stores the last response ID for conversation continuity\n */\n lastResponseId?: string;\n /**\n * AgentContext - reference to structured context stored in separate NATS KV bucket\n * Key format: {agentId}:{chatKey} in bucket agent-contexts-org-{orgId}\n */\n agentContextKey?: string;\n /**\n * Chat Pin\n */\n pinned?: boolean;\n /**\n * Collab-specific fields\n */\n chatType?: ChatTypeTS;\n description?: string;\n}\nexport interface ChatContext {\n memory: { [key: string]: any};\n turnCount: number /* int */;\n lastIntent: string;\n activeTopic: string;\n}\nexport interface ChatFlow {\n flowDefinitionId: string;\n flowInstanceId?: string;\n flowInstanceLastUpdated?: number /* int64 */;\n tools?: ChatTool[];\n}\nexport interface ChatTool {\n name: string;\n description: string;\n type: string; // function, action, data_query etc\n parameters?: { [key: string]: any};\n}\nexport type ChatRoleTS = 'user' | 'ai' | 'event' | 'humanAgent' | 'observer' | 'dataQuery' | 'system' | 'tool';\nexport type ChatRole = string;\nexport const ChatRoleUser: ChatRole = \"user\";\nexport const ChatRoleAI: ChatRole = \"ai\";\nexport const ChatRoleEvent: ChatRole = \"event\";\nexport const ChatRoleHumanAgent: ChatRole = \"humanAgent\";\nexport const ChatRoleObserver: ChatRole = \"observer\";\nexport const ChatRoleDataQuery: ChatRole = \"dataQuery\";\nexport const ChatRoleSystem: ChatRole = \"system\";\nexport const ChatRoleTool: ChatRole = \"tool\";\nexport interface ChatUser {\n id: string;\n role: ChatRoleTS;\n name: string;\n email: string;\n phone?: string;\n authProvider: string;\n authToken: string;\n metadata?: { [key: string]: any};\n}\nexport type AgentStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type AgentStatus = string;\nexport const AgentStatusOnline: AgentStatus = \"online\";\nexport const AgentStatusAway: AgentStatus = \"away\";\nexport const AgentStatusBusy: AgentStatus = \"busy\";\nexport const AgentStatusOffline: AgentStatus = \"offline\";\n/**\n * AgentSession represents an active agent session stored in Redis\n */\nexport interface AgentSession {\n agentId: string;\n orgId: string;\n onlineSince: number /* int64 */; // Unix timestamp\n lastActivity: number /* int64 */; // Unix timestamp\n status: AgentStatusTS;\n chatsHandled: number /* int */;\n activeChats: string[]; // Chat keys currently handling\n userAgent?: string;\n ipAddress?: string;\n metadata?: { [key: string]: any};\n}\nexport type ChatEventType = string;\n/**\n * ** user events\n */\nexport const ChatEventTypeUserJoined: ChatEventType = \"user_joined\";\nexport const ChatEventTypeUserLeft: ChatEventType = \"user_left\";\nexport const ChatEventTypeTyping: ChatEventType = \"typing\";\nexport const ChatEventTypeStoppedTyping: ChatEventType = \"stopped_typing\";\nexport const ChatEventTypeRead: ChatEventType = \"read\";\nexport const ChatEventTypeDelivered: ChatEventType = \"delivered\";\nexport const ChatEventTypeReconnected: ChatEventType = \"reconnected\";\nexport const ChatEventTypeError: ChatEventType = \"error\";\nexport const ChatEventTypeWaiting: ChatEventType = \"waiting\";\nexport const ChatEventTypeLoadChat: ChatEventType = \"load_chat\";\nexport const ChatEventTypeLoadChatResponse: ChatEventType = \"load_chat_response\";\nexport const ChatEventTypeMessage: ChatEventType = \"message\";\nexport const ChatEventTypeWaitingForAgent: ChatEventType = \"waiting_for_agent\";\nexport const ChatEventTypeMessageStatusUpdate: ChatEventType = \"message_status_update\";\nexport const ChatEventTypeHumanAgentJoined: ChatEventType = \"human_agent_joined\";\nexport const ChatEventTypeHumanAgentLeft: ChatEventType = \"human_agent_left\";\nexport const ChatEventTypeObserverJoined: ChatEventType = \"observer_joined\";\nexport const ChatEventTypeObserverLeft: ChatEventType = \"observer_left\";\nexport const ChatEventTypeListChats: ChatEventType = \"list_chats\";\nexport const ChatEventTypeChatUpdated: ChatEventType = \"chat_updated\";\nexport const ChatEventTypeChatRemoved: ChatEventType = \"chat_removed\";\nexport const ChatEventTypeSyncMetadata: ChatEventType = \"sync_metadata\";\nexport const ChatEventTypeSyncMetadataResponse: ChatEventType = \"sync_metadata_response\";\nexport const ChatEventTypeSyncUserSession: ChatEventType = \"sync_user_session\";\nexport const ChatEventTypeSyncUserSessionResponse: ChatEventType = \"sync_user_session_response\";\nexport const ChatEventTypeClientAction: ChatEventType = \"client_action\";\nexport const ChatEventTypeClientActionCallback: ChatEventType = \"client_action_callback\";\nexport const ChatEventTypeBlockUser: ChatEventType = \"block_user\";\n/**\n * ** collab room management events\n */\nexport const ChatEventTypeCreateRoom: ChatEventType = \"create_room\";\nexport const ChatEventTypeRoomCreated: ChatEventType = \"room_created\";\nexport const ChatEventTypeJoinRoom: ChatEventType = \"join_room\";\nexport const ChatEventTypeLeaveRoom: ChatEventType = \"leave_room\";\nexport const ChatEventTypeDeleteRoom: ChatEventType = \"delete_room\";\nexport const ChatEventTypeRoomDeleted: ChatEventType = \"room_deleted\";\nexport const ChatEventTypeUpdateRoom: ChatEventType = \"update_room\";\nexport const ChatEventTypeRoomUpdated: ChatEventType = \"room_updated\";\nexport const ChatEventTypeInviteUser: ChatEventType = \"invite_user\";\nexport const ChatEventTypeUserInvited: ChatEventType = \"user_invited\";\nexport const ChatEventTypeRoomUserJoined: ChatEventType = \"room_user_joined\";\nexport const ChatEventTypeRoomUserLeft: ChatEventType = \"room_user_left\";\nexport const ChatEventTypeUserRemoved: ChatEventType = \"user_removed\";\nexport const ChatEventTypeListRooms: ChatEventType = \"list_rooms\";\nexport const ChatEventTypeRoomsResponse: ChatEventType = \"rooms_response\";\n/**\n * ** collab message events\n */\nexport const ChatEventTypeMessageEdited: ChatEventType = \"message_edited\";\nexport const ChatEventTypeMessageDeleted: ChatEventType = \"message_deleted\";\nexport const ChatEventTypeMessageReaction: ChatEventType = \"message_reaction\";\nexport const ChatEventTypeMessageReply: ChatEventType = \"message_reply\";\nexport const ChatEventTypeMentionUser: ChatEventType = \"mention_user\";\nexport const ChatEventTypeMessageEditedResponse: ChatEventType = \"message_edited_response\";\nexport const ChatEventTypeMessageDeletedResponse: ChatEventType = \"message_deleted_response\";\nexport const ChatEventTypeMessageReactionResponse: ChatEventType = \"message_reaction_response\";\n/**\n * ** collab user presence events\n */\nexport const ChatEventTypeUserPresenceStart: ChatEventType = \"user_presence_start\";\nexport const ChatEventTypeUserPresenceEnd: ChatEventType = \"user_presence_end\";\nexport const ChatEventTypeUserStatusChange: ChatEventType = \"user_status_change\";\nexport const ChatEventTypeUserActivity: ChatEventType = \"user_activity\";\nexport const ChatEventTypeUserPresenceChanged: ChatEventType = \"user_presence_changed\";\nexport const ChatEventTypeUserActivityUpdate: ChatEventType = \"user_activity_update\";\nexport const ChatEventTypeGetOnlineUsers: ChatEventType = \"get_online_users\";\nexport const ChatEventTypeOnlineUsersResponse: ChatEventType = \"online_users\";\n/**\n * ** shop assist events\n */\nexport const ChatEventTypeEndChat: ChatEventType = \"end_chat\";\nexport const ChatEventTypeChatEnded: ChatEventType = \"chat_ended\";\n/**\n * ** agent session events\n */\nexport const ChatEventTypeAgentSessionStart: ChatEventType = \"agent_session_start\";\nexport const ChatEventTypeAgentSessionEnd: ChatEventType = \"agent_session_end\";\nexport const ChatEventTypeAgentStatusChange: ChatEventType = \"agent_status_change\";\nexport const ChatEventTypeAgentActivityPing: ChatEventType = \"agent_activity_ping\";\nexport const ChatEventTypeAgentChatAssigned: ChatEventType = \"agent_chat_assigned\";\nexport const ChatEventTypeAgentChatCompleted: ChatEventType = \"agent_chat_completed\";\n/**\n * ** AI agents retrieval events\n */\nexport const ChatEventTypeGetAgents: ChatEventType = \"get_agents\";\nexport const ChatEventTypeGetAgentsResponse: ChatEventType = \"get_agents_response\";\n/**\n * ** CSAT events\n */\nexport const ChatEventTypeCSATRequest: ChatEventType = \"csat_request\"; // Internal: scheduler requests chat to send CSAT\nexport const ChatEventTypeCSATSurvey: ChatEventType = \"show_csat_survey\";\nexport const ChatEventTypeCSATResponse: ChatEventType = \"csat_response\";\n/**\n * ** User Suggested Actions events\n */\nexport const ChatEventTypeUserSuggestedActions: ChatEventType = \"user_suggested_actions\";\nexport const ChatEventTypeUserSuggestedActionSelected: ChatEventType = \"user_suggested_action_selected\";\n/**\n * ** Summary events\n */\nexport const ChatEventTypeSummaryUpdate: ChatEventType = \"summary_update\";\n/**\n * ** Agent Context events\n */\nexport const ChatEventTypeAgentContextUpdate: ChatEventType = \"agent_context_update\";\nexport const ChatEventTypeAgentExecutionStarted: ChatEventType = \"agent_execution_started\";\nexport const ChatEventTypeAgentExecutionEnded: ChatEventType = \"agent_execution_ended\";\nexport const ChatEventTypeLoadAgentContext: ChatEventType = \"load_agent_context\";\nexport const ChatEventTypeLoadAgentContextResponse: ChatEventType = \"load_agent_context_response\";\n/**\n * ** Plan → Approve → Execute events\n */\nexport const ChatEventTypePlanPendingApproval: ChatEventType = \"plan_pending_approval\";\nexport const ChatEventTypePlanApproved: ChatEventType = \"plan_approved\";\nexport const ChatEventTypePlanRejected: ChatEventType = \"plan_rejected\";\nexport const ChatEventTypePlanCompleted: ChatEventType = \"plan_completed\";\nexport const ChatEventTypeStepStarted: ChatEventType = \"step_started\";\nexport const ChatEventTypeStepCompleted: ChatEventType = \"step_completed\";\nexport const ChatEventTypeStepFailed: ChatEventType = \"step_failed\";\n/**\n * ** New Chat events\n */\nexport const ChatEventTypeNewChat: ChatEventType = \"new_chat\";\nexport const ChatEventTypeNewChatCreated: ChatEventType = \"new_chat_created\";\n/**\n * ** Heartbeat events\n */\nexport const ChatEventTypePing: ChatEventType = \"ping\";\nexport const ChatEventTypePong: ChatEventType = \"pong\";\n/**\n * ** Skill activation events\n */\nexport const ChatEventTypeSkillActivate: ChatEventType = \"skill_activate\";\nexport const ChatEventTypeSkillDeactivate: ChatEventType = \"skill_deactivate\";\nexport const ChatEventTypeSkillsChanged: ChatEventType = \"skills_changed\";\n/**\n * ** Attachment processing events (deferred document processing)\n */\nexport const ChatEventTypeAttachmentProcessingStarted: ChatEventType = \"attachment_processing_started\";\nexport const ChatEventTypeAttachmentProcessingProgress: ChatEventType = \"attachment_processing_progress\";\nexport const ChatEventTypeAttachmentProcessingComplete: ChatEventType = \"attachment_processing_complete\";\nexport const ChatEventTypeAttachmentProcessingError: ChatEventType = \"attachment_processing_error\";\nexport const ChatEventTypeRetryAttachment: ChatEventType = \"retry_attachment\";\nexport type ChatEventTypeTS =\n | \"message\"\n | \"user_joined\"\n | \"user_left\"\n | \"typing\"\n | \"stopped_typing\"\n | \"read\"\n | \"delivered\"\n | \"reconnected\"\n | \"error\"\n | \"message_status_update\"\n | \"load_chat\"\n | \"load_chat_response\"\n | \"waiting\"\n | \"waiting_for_agent\"\n | \"human_agent_joined\"\n | \"end_chat\"\n | \"chat_ended\"\n | \"human_agent_left\"\n | \"observer_joined\"\n | \"observer_left\"\n | \"list_chats\"\n | \"chat_updated\"\n | \"chat_removed\"\n | \"sync_metadata\"\n | \"sync_metadata_response\"\n | \"sync_user_session\"\n | \"sync_user_session_response\"\n | \"agent_session_start\"\n | \"agent_session_end\"\n | \"agent_status_change\"\n | \"agent_activity_ping\"\n | \"agent_chat_assigned\"\n | \"agent_chat_completed\"\n | \"client_action\"\n | \"client_action_callback\"\n | \"show_csat_survey\"\n | \"csat_response\"\n | \"user_suggested_actions\"\n | \"user_suggested_action_selected\"\n | \"summary_update\"\n | \"agent_context_update\"\n | \"agent_execution_started\"\n | \"agent_execution_ended\"\n | \"load_agent_context\"\n | \"load_agent_context_response\"\n | \"plan_pending_approval\"\n | \"plan_approved\"\n | \"plan_rejected\"\n | \"plan_completed\"\n | \"step_started\"\n | \"step_completed\"\n | \"step_failed\"\n | \"new_chat\"\n | \"new_chat_created\"\n | \"block_user\"\n | \"ping\"\n | \"pong\"\n | \"create_room\"\n | \"room_created\"\n | \"join_room\"\n | \"leave_room\"\n | \"delete_room\"\n | \"room_deleted\"\n | \"update_room\"\n | \"room_updated\"\n | \"invite_user\"\n | \"user_invited\"\n | \"room_user_joined\"\n | \"room_user_left\"\n | \"user_removed\"\n | \"list_rooms\"\n | \"rooms_response\"\n | \"message_edited\"\n | \"message_deleted\"\n | \"message_reaction\"\n | \"message_reply\"\n | \"mention_user\"\n | \"message_edited_response\"\n | \"message_deleted_response\"\n | \"message_reaction_response\"\n | \"user_presence_start\"\n | \"user_presence_end\"\n | \"user_status_change\"\n | \"user_activity\"\n | \"user_presence_changed\"\n | \"user_activity_update\"\n | \"get_online_users\"\n | \"online_users\"\n | \"get_agents\"\n | \"get_agents_response\"\n | \"skill_activate\"\n | \"skill_deactivate\"\n | \"skills_changed\"\n | \"attachment_processing_started\"\n | \"attachment_processing_progress\"\n | \"attachment_processing_complete\"\n | \"attachment_processing_error\"\n | \"retry_attachment\";\nexport type MessageStatus = string;\nexport const MessageStatusSending: MessageStatus = \"sending\";\nexport const MessageStatusSent: MessageStatus = \"sent\";\nexport const MessageStatusDelivered: MessageStatus = \"delivered\";\nexport const MessageStatusRead: MessageStatus = \"read\";\nexport const MessageStatusFailed: MessageStatus = \"failed\";\nexport type MessageStatusTS =\n | \"sending\"\n | \"sent\"\n | \"delivered\"\n | \"read\"\n | \"failed\";\n/**\n * EmojiReaction represents an emoji reaction to a message\n */\nexport interface EmojiReaction {\n emoji: string;\n count: number /* int */;\n users?: string[]; // List of user IDs who reacted\n}\n/**\n * Location represents geographical coordinates\n */\nexport interface Location {\n latitude: number /* float64 */;\n longitude: number /* float64 */;\n address?: string;\n}\n/**\n * AttachmentFile represents a file within an attachment\n */\nexport interface AttachmentFile {\n type: string;\n url: string;\n thumbnailUrl?: string;\n name?: string;\n size?: number /* int64 */;\n}\nexport type AttachmentType = string;\n/**\n * Attachment types for both user and system attachments\n */\nexport const AttachmentTypeDocument: AttachmentType = \"document\";\nexport const AttachmentTypeDocumentAnalysis: AttachmentType = \"document_analysis\";\nexport const AttachmentTypeImage: AttachmentType = \"image\";\nexport const AttachmentTypeAudio: AttachmentType = \"audio\";\nexport const AttachmentTypeVideo: AttachmentType = \"video\";\nexport const AttachmentTypeLocation: AttachmentType = \"location\";\nexport const AttachmentTypeReferences: AttachmentType = \"references\";\nexport const AttachmentTypeSubsections: AttachmentType = \"subsections\";\nexport const AttachmentTypeArticles: AttachmentType = \"articles\";\nexport const AttachmentTypeRecords: AttachmentType = \"records\";\nexport const AttachmentTypeActions: AttachmentType = \"actions\";\nexport const AttachmentTypeBullets: AttachmentType = \"bullets\";\nexport const AttachmentTypeSticker: AttachmentType = \"sticker\";\nexport const AttachmentTypeData: AttachmentType = \"data\";\nexport const AttachmentTypeKGNodes: AttachmentType = \"kgNodes\";\nexport const AttachmentTypeDocumentSources: AttachmentType = \"document_sources\";\nexport const AttachmentTypeSpreadsheet: AttachmentType = \"spreadsheet\"; // Excel, CSV files\nexport const AttachmentTypeDataFile: AttachmentType = \"data_file\"; // JSON, XML, YAML files\n\nexport type AttachmentTypeTS =\n | \"document\"\n | \"document_analysis\"\n | \"image\"\n | \"audio\"\n | \"video\"\n | \"location\"\n | \"references\"\n | \"subsections\"\n | \"articles\"\n | \"records\"\n | \"actions\"\n | \"bullets\"\n | \"sticker\"\n | \"data\"\n | \"kgNodes\"\n | \"document_sources\"\n | \"spreadsheet\"\n | \"data_file\";\n\n/**\n * DocumentSource represents an aggregated document source with page references\n * Used to display source cards in chat responses after document search\n */\nexport interface DocumentSource {\n doc_id: string;\n title: string;\n url: string;\n page_numbers: number /* int */[];\n reference_count: number /* int */;\n bounding_regions?: any /* docs.BoundingRegion */[];\n page_infos?: any /* docs.PageInfo */[]; // Page dimensions for coordinate scaling\n}\n/**\n * Attachment represents any type of attachment to a message\n */\nexport interface Attachment {\n type: AttachmentTypeTS;\n documentAnalysis?: DocumentAnalysisResult;\n title?: string;\n url: string;\n files?: AttachmentFile[]; // Associated files\n location?: Location; // Location data if applicable\n data?: { [key: string]: Variable};\n kgNodes?: KGNode[];\n actions?: Action[];\n documentSources?: DocumentSource[];\n /**\n * Smart document processing fields\n */\n fileMetadata?: any /* docs.AttachmentFileMetadata */; // Client-side extracted file metadata\n processing?: any /* docs.ProcessingResult */; // Smart processing result\n}\nexport interface Action {\n id: string;\n title: string;\n icon?: string;\n description?: string;\n onAction?: () => void;\n}\n/**\n * ChatMessage represents the core message structure\n */\nexport interface ChatMessage {\n /**\n * Core fields\n */\n id: string;\n role: ChatRoleTS;\n content: string;\n time: number /* int64 */;\n status: MessageStatusTS;\n /**\n * Sender information\n */\n senderId: string;\n senderName?: string;\n /**\n * Timing\n */\n createdAt: number /* int64 */;\n updatedAt?: number /* int64 */;\n /**\n * Message relations\n */\n replyTo?: string;\n threadId?: string;\n mentions?: string[];\n /**\n * Attachments and reactions\n */\n attachments?: Attachment[];\n reactions?: EmojiReaction[];\n /**\n * Additional data\n */\n variables?: { [key: string]: Variable};\n /**\n * Tool call\n */\n name?: string;\n toolCallId?: string;\n toolCalls?: ToolCall[];\n /**\n * LLM usage\n */\n llmUsage?: LLMUsage;\n}\nexport interface ChatEvent {\n type: ChatEventTypeTS;\n orgId: string;\n chatKey: string;\n userId: string;\n timestamp: number /* int64 */;\n data?: { [key: string]: any};\n message?: ChatMessage;\n}\nexport interface ChatGrading {\n chatKey: string;\n grade: number /* int */;\n topic: string;\n summary: string;\n}\nexport interface ChatSession {\n id: string;\n status: ChatSessionStatus;\n user?: ChatUser;\n activeChatKey?: string;\n preferences?: ChatSessionPreferences;\n lastActivity: number /* int64 */;\n expiresAt: number /* int64 */;\n metadata?: { [key: string]: any};\n}\nexport type ChatSessionStatus = string;\nexport const ChatSessionStatusActive: ChatSessionStatus = \"active\";\nexport const ChatSessionStatusIdle: ChatSessionStatus = \"idle\";\nexport const ChatSessionStatusExpired: ChatSessionStatus = \"expired\";\nexport interface ChatSessionPreferences {\n language: string;\n theme: string;\n notifications: boolean;\n timeZone: string;\n messageDisplay: string; // compact/expanded\n autoTranslate: boolean;\n rateLimits?: ChatRateLimits;\n}\nexport interface ChatRateLimits {\n maxMessagesPerMinute: number /* int */;\n maxTokensPerDay: number /* int */;\n cooldownPeriod: number /* int */; // seconds\n}\n/**\n * ==========================\n * todo: move to common/llm\n */\nexport interface LLMConfig {\n Provider: string;\n Model: string;\n Temperature: number /* float64 */;\n MaxTokens: number /* int */;\n SystemPrompt: string;\n Tools: LLMTool[];\n Memory?: LLMMemoryConfig;\n}\nexport interface LLMMemoryConfig {\n MaxMessages: number /* int */;\n IncludeSystem: boolean;\n WindowSize: number /* int */; // Token window size\n Strategy: string; // e.g., \"sliding\", \"summarize\"\n}\nexport interface LLMTool {\n Name: string;\n Type: string;\n Function: LLMFunction;\n}\nexport interface LLMFunction {\n Name: string;\n Description: string;\n Parameters: any /* types.JSONSchema */;\n}\nexport interface ToolCall {\n Name: string;\n Arguments: { [key: string]: any};\n ID: string;\n Description: string;\n}\nexport interface LLMResponse {\n Content: string;\n ToolCalls: ToolCall[];\n Usage?: LLMUsage;\n ResponseId: string; // OpenAI Responses API - the response ID for conversation continuity\n}\nexport interface LLMUsage {\n inputTokens: number /* int64 */;\n outputTokens: number /* int64 */;\n totalTokens: number /* int64 */;\n}\n/**\n * ChatSummary represents lightweight chat information for caching and listing\n */\nexport interface ChatSummary {\n chatKey: string;\n title: string;\n userId?: string;\n status: ChatStatus;\n lastUpdated: number /* int64 */;\n waitingSince?: number /* int64 */; // Only populated for waiting chats\n pinned?: boolean;\n metadata?: { [key: string]: any};\n}\nexport interface GetChatRequest {\n orgId: string;\n chatKey: string;\n}\nexport interface GetChatResponse {\n chat?: Chat;\n metadata: ResponseMetadata;\n}\nexport interface ChatProductReference {\n id: string;\n title: string;\n price: number /* float64 */;\n image?: string;\n url?: string;\n}\n/**\n * Chat Archival Models\n */\nexport interface ChatArchivalRequest {\n orgId: string;\n chatKey: string;\n chat: Chat;\n}\nexport interface ChatArchivalResponse {\n success: boolean;\n error?: string;\n message?: string;\n}\n/**\n * Agent Session Request/Response Models\n */\nexport interface StartAgentSessionRequest {\n orgId: string;\n agentId: string;\n userAgent?: string;\n ipAddress?: string;\n}\nexport interface StartAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface EndAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface EndAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentStatusRequest {\n orgId: string;\n agentId: string;\n status: AgentStatusTS;\n}\nexport interface UpdateAgentStatusResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentLastActivityRequest {\n orgId: string;\n agentId: string;\n}\nexport interface UpdateAgentLastActivityResponse {\n metadata: ResponseMetadata;\n}\nexport interface AssignChatToAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface AssignChatToAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface CompleteChatByAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface CompleteChatByAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface GetAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface GetAgentSessionResponse {\n session?: AgentSession;\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentsRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentsResponse {\n sessions: AgentSession[];\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentCountRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\n/**\n * Queue-specific chat request/response types\n */\nexport interface GetQueueChatsRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\nexport interface GetQueueChatCountRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport type UserStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type UserStatus = string;\nexport const UserStatusOnline: UserStatus = \"online\";\nexport const UserStatusAway: UserStatus = \"away\";\nexport const UserStatusBusy: UserStatus = \"busy\";\nexport const UserStatusOffline: UserStatus = \"offline\";\n/**\n * UserSession for tracking online users\n */\nexport interface UserSession {\n orgId: string;\n userId: string;\n userName: string;\n status: UserStatusTS;\n onlineSince: number /* int64 */;\n lastActivity: number /* int64 */;\n}\n/**\n * User status update requests\n */\nexport interface UpdateUserStatusRequest {\n orgId: string;\n userId: string;\n status: UserStatusTS;\n}\nexport interface UpdateUserStatusResponse {\n metadata: ResponseMetadata;\n}\n/**\n * Get online users\n */\nexport interface GetOnlineUsersRequest {\n orgId: string;\n}\nexport interface GetOnlineUsersResponse {\n metadata: ResponseMetadata;\n users: UserSession[];\n}\n/**\n * Analytics Trigger Models\n */\nexport interface TriggerAnalyticsScanRequest {\n org_id?: string; // Optional: if empty, scans all orgs\n}\nexport interface TriggerAnalyticsScanResponse {\n metadata: ResponseMetadata;\n chats_archived: number /* int */;\n}\n/**\n * AttachmentProcessingStartedData is sent when attachment processing begins\n */\nexport interface AttachmentProcessingStartedData {\n attachmentId: string;\n fileName: string;\n strategy: string;\n}\n/**\n * AttachmentProcessingProgressData is sent during attachment processing\n */\nexport interface AttachmentProcessingProgressData {\n attachmentId: string;\n percent: number /* int */;\n stage: string;\n message: string;\n}\n/**\n * AttachmentProcessingCompleteData is sent when attachment processing completes\n */\nexport interface AttachmentProcessingCompleteData {\n attachmentId: string;\n result?: any /* docs.ProcessingResult */;\n}\n/**\n * AttachmentProcessingErrorData is sent when attachment processing fails\n */\nexport interface AttachmentProcessingErrorData {\n attachmentId: string;\n error: string;\n retryable: boolean;\n}\n/**\n * RetryAttachmentData is sent by frontend to retry a failed attachment\n */\nexport interface RetryAttachmentData {\n attachmentId: string;\n}\n\n//////////\n// source: chat-stats-models.go\n\n/**\n * Active chat requests/responses\n */\nexport interface GetActiveChatCountRequest {\n orgId: string;\n}\nexport interface GetActiveChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetActiveChatsRequest {\n orgId: string;\n pastHours?: number /* float64 */; // 0 means all, 0.5 means past 30 min, 1 means past hour, etc.\n}\nexport interface GetActiveChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * Waiting for agent requests/responses\n */\nexport interface GetWaitingForAgentChatCountRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetWaitingForAgentChatsRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * User chats requests/responses\n */\nexport interface GetUserChatsRequest {\n orgId: string;\n userId: string;\n limit?: number /* int */; // Number of chats to return (default 15)\n offset?: number /* int */; // Number of chats to skip (for pagination)\n}\nexport interface GetUserChatsResponse {\n chats: ChatSummary[];\n total: number /* int */; // Total number of chats for this user\n hasMore: boolean; // Whether there are more chats to load\n metadata: ResponseMetadata;\n}\n/**\n * Daily counter requests/responses\n */\nexport interface GetDailyChatCountRequest {\n orgId: string;\n date: string /* RFC3339 */;\n timezone: string;\n}\nexport interface GetDailyChatCountResponse {\n count: number /* int64 */;\n date: string;\n timezone: string;\n metadata: any /* types.ResponseMetadata */;\n}\n\n//////////\n// source: queue-models.go\n\n\n// Queue types\nexport const QueueTypes = {\n skill: { value: 'skill', label: 'Skill-based', description: 'Route by agent expertise and skills' },\n priority: { value: 'priority', label: 'Priority-based', description: 'Route by customer tier and urgency level' },\n department: { value: 'department', label: 'Department-based', description: 'Route by business function alignment' },\n complexity: { value: 'complexity', label: 'Complexity-based', description: 'Route by issue difficulty assessment' },\n} as const;\n\nexport type QueueTypeTS = keyof typeof QueueTypes;\nexport type QueueTypeOptionTS = typeof QueueTypes[QueueTypeTS];\n\n/**\n * QueueType represents the routing algorithm type\n */\nexport type QueueType = string;\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeSkill: QueueType = \"skill\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypePriority: QueueType = \"priority\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeDepartment: QueueType = \"department\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeComplexity: QueueType = \"complexity\";\n/**\n * AgentQueue represents an individual queue within a queue type\n */\nexport interface AgentQueue {\n id: string /* uuid */;\n orgId: string;\n type: QueueTypeTS; // \"skill\", \"priority\", etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case for metadata matching)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable display name)\n description: string;\n agentIds: string[]; // Agents assigned to this queue\n config: { [key: string]: any}; // Extensible configuration\n isActive: boolean;\n isDefault: boolean; // Default queue for unmatched chats\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n createdBy?: string;\n updatedBy?: string;\n}\n/**\n * GetAgentQueuesFilter represents filtering options for agent queues\n */\nexport interface GetAgentQueuesFilter {\n type?: QueueType;\n isActive?: boolean;\n}\n/**\n * Agent Queue Operations\n */\nexport interface CreateAgentQueueRequest {\n orgId: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n createdBy?: string;\n updatedBy?: string;\n}\nexport interface CreateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface GetAgentQueuesRequest {\n orgId: string;\n type?: QueueType; // Filter by queue type\n isActive?: boolean; // Filter by active status\n}\nexport interface GetAgentQueuesResponse {\n queues: (AgentQueue | undefined)[];\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface UpdateAgentQueueRequest {\n orgId: string;\n id: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n updatedBy?: string;\n}\nexport interface UpdateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface DeleteAgentQueueRequest {\n orgId: string;\n id: string;\n}\nexport interface DeleteAgentQueueResponse {\n metadata: any /* types.ResponseMetadata */;\n}\n/**\n * ChatQueueInfo extends Chat with queue routing information\n */\nexport interface ChatQueueInfo {\n recommendedQueueId?: string /* uuid */;\n recommendedQueueName?: string;\n assignedQueueId?: string /* uuid */;\n assignedQueueName?: string;\n}\n\n//////////\n// source: subjects.go\n\nexport const GetWaitingForAgentChatCountSubject = \"chat.get_waiting_for_agent_chat_count\";\nexport const GetActiveChatCountSubject = \"chat.get_active_chat_count\";\nexport const GetWaitingForAgentChatsSubject = \"chat.get_waiting_for_agent_chats\";\nexport const GetActiveChatsSubject = \"chat.get_active_chats\";\nexport const GetUserChatsSubject = \"chat.get_user_chats\";\nexport const GetChatSubject = \"chat.get_chat\";\n/**\n * Chat Archival Subjects\n */\nexport const ChatArchiveSubjectPattern = \"chat.archive.%s.server\"; // %s = channel/product (e.g., shop-assist, gov-services)\n/**\n * Agent Session Subjects\n */\nexport const StartAgentSessionSubject = \"chat.agent_session.start\";\nexport const EndAgentSessionSubject = \"chat.agent_session.end\";\nexport const UpdateAgentStatusSubject = \"chat.agent_session.update_status\";\nexport const UpdateAgentLastActivitySubject = \"chat.agent_session.update_last_activity\";\nexport const AssignChatToAgentSubject = \"chat.agent_session.assign_chat\";\nexport const CompleteChatByAgentSubject = \"chat.agent_session.complete_chat\";\nexport const GetAgentSessionSubject = \"chat.agent_session.get\";\nexport const GetOnlineAgentsSubject = \"chat.agent_session.get_online_agents\";\nexport const GetOnlineAgentCountSubject = \"chat.agent_session.get_online_agent_count\";\n/**\n * Queue Management Subjects\n */\nexport const CreateAgentQueueSubject = \"chat.agent_queue.create\";\nexport const GetAgentQueuesSubject = \"chat.agent_queue.get\";\nexport const UpdateAgentQueueSubject = \"chat.agent_queue.update\";\nexport const DeleteAgentQueueSubject = \"chat.agent_queue.delete\";\n/**\n * Queue-specific Chat Subjects\n */\nexport const GetQueueChatsSubject = \"chat.queue.get_chats\";\nexport const GetQueueChatCountSubject = \"chat.queue.get_chat_count\";\n/**\n * Daily Counter Subjects\n */\nexport const GetDailyChatCountSubject = \"chat.get_daily_chat_count\";\n/**\n * User Status Subjects\n */\nexport const UpdateUserStatusSubject = \"chat.user.status.update\";\nexport const GetOnlineUsersSubject = \"chat.users.online.get\";\n/**\n * Analytics Trigger Subjects\n */\nexport const TriggerAnalyticsScanSubject = \"chat.analytics.trigger-scan\";\n/**\n * Org Setup Subject\n */\nexport const SetupOrgSubject = \"chat.org.setup\";\n"],"mappings":";;;AAiCO,IAAM,mBAA+B;AACrC,IAAM,yBAAqC;AAC3C,IAAM,sBAAkC;AACxC,IAAM,mBAA+B;AACrC,IAAM,qBAAiC;AAGvC,IAAM,0BAAoC;AAC1C,IAAM,qBAA+B;AACrC,IAAM,sBAAgC;AACtC,IAAM,iBAA2B;AACjC,IAAM,gBAA0B;AAmEhC,IAAM,eAAyB;AAC/B,IAAM,aAAuB;AAC7B,IAAM,gBAA0B;AAChC,IAAM,qBAA+B;AACrC,IAAM,mBAA6B;AACnC,IAAM,oBAA8B;AACpC,IAAM,iBAA2B;AACjC,IAAM,eAAyB;AAa/B,IAAM,oBAAiC;AACvC,IAAM,kBAA+B;AACrC,IAAM,kBAA+B;AACrC,IAAM,qBAAkC;AAo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ourcesContent":["// Code generated by tygo. DO NOT EDIT.\nimport { KGNode } from \"@elqnt/kg\";\nimport { Variable } from \"@elqnt/types\";\nimport { ResponseMetadata, ProductNameTS } from \"@elqnt/types\";\nimport { DocumentAnalysisResult } from \"@elqnt/docs\";\n\n//////////\n// source: chat-models.go\n\nexport type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';\nexport type ChatStatus = string;\nexport const ChatStatusActive: ChatStatus = \"active\";\nexport const ChatStatusDisconnected: ChatStatus = \"disconnected\";\nexport const ChatStatusAbandoned: ChatStatus = \"abandoned\";\nexport const ChatStatusClosed: ChatStatus = \"closed\";\nexport const ChatStatusArchived: ChatStatus = \"archived\";\nexport type ChatTypeTS = 'customer_support' | 'public_room' | 'private_room' | 'direct' | 'group';\nexport type ChatType = string;\nexport const ChatTypeCustomerSupport: ChatType = \"customer_support\"; // Existing customer support chats\nexport const ChatTypePublicRoom: ChatType = \"public_room\"; // Public collaboration room\nexport const ChatTypePrivateRoom: ChatType = \"private_room\"; // Private collaboration room\nexport const ChatTypeDirect: ChatType = \"direct\"; // 1-on-1 direct message\nexport const ChatTypeGroup: ChatType = \"group\"; // Group chat/room\nexport interface Chat {\n orgId: string;\n key: string;\n title: string;\n messages: ChatMessage[];\n lastUpdated: number /* int64 */;\n startTime: number /* int64 */;\n users: ChatUser[];\n status: ChatStatusTS;\n aiEngaged: boolean;\n humanAgentEngaged: boolean;\n isWaiting: boolean;\n isWaitingForAgent: boolean;\n callRequested?: boolean;\n callStarted?: boolean;\n userRating?: number /* int */;\n metadata?: { [key: string]: any};\n grading?: ChatGrading;\n flow?: ChatFlow;\n context?: ChatContext;\n csatSent?: boolean;\n csatSentTime?: number /* int64 */;\n csatResponse?: any /* agents.CSATResponse */;\n /**\n * Active skills for this chat session\n */\n activeSkills?: any /* agents.Skill */[];\n /**\n * OpenAI Responses API - stores the last response ID for conversation continuity\n */\n lastResponseId?: string;\n /**\n * AgentContext - reference to structured context stored in separate NATS KV bucket\n * Key format: {agentId}:{chatKey} in bucket agent-contexts-org-{orgId}\n */\n agentContextKey?: string;\n /**\n * Chat Pin\n */\n pinned?: boolean;\n /**\n * Collab-specific fields\n */\n chatType?: ChatTypeTS;\n description?: string;\n}\nexport interface ChatContext {\n memory: { [key: string]: any};\n turnCount: number /* int */;\n lastIntent: string;\n activeTopic: string;\n}\nexport interface ChatFlow {\n flowDefinitionId: string;\n flowInstanceId?: string;\n flowInstanceLastUpdated?: number /* int64 */;\n tools?: ChatTool[];\n}\nexport interface ChatTool {\n name: string;\n description: string;\n type: string; // function, action, data_query etc\n parameters?: { [key: string]: any};\n}\nexport type ChatRoleTS = 'user' | 'ai' | 'event' | 'humanAgent' | 'observer' | 'dataQuery' | 'system' | 'tool';\nexport type ChatRole = string;\nexport const ChatRoleUser: ChatRole = \"user\";\nexport const ChatRoleAI: ChatRole = \"ai\";\nexport const ChatRoleEvent: ChatRole = \"event\";\nexport const ChatRoleHumanAgent: ChatRole = \"humanAgent\";\nexport const ChatRoleObserver: ChatRole = \"observer\";\nexport const ChatRoleDataQuery: ChatRole = \"dataQuery\";\nexport const ChatRoleSystem: ChatRole = \"system\";\nexport const ChatRoleTool: ChatRole = \"tool\";\nexport interface ChatUser {\n id: string;\n role: ChatRoleTS;\n name: string;\n email: string;\n phone?: string;\n authProvider: string;\n authToken: string;\n metadata?: { [key: string]: any};\n}\nexport type AgentStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type AgentStatus = string;\nexport const AgentStatusOnline: AgentStatus = \"online\";\nexport const AgentStatusAway: AgentStatus = \"away\";\nexport const AgentStatusBusy: AgentStatus = \"busy\";\nexport const AgentStatusOffline: AgentStatus = \"offline\";\n/**\n * AgentSession represents an active agent session stored in Redis\n */\nexport interface AgentSession {\n agentId: string;\n orgId: string;\n onlineSince: number /* int64 */; // Unix timestamp\n lastActivity: number /* int64 */; // Unix timestamp\n status: AgentStatusTS;\n chatsHandled: number /* int */;\n activeChats: string[]; // Chat keys currently handling\n userAgent?: string;\n ipAddress?: string;\n metadata?: { [key: string]: any};\n}\nexport type ChatEventType = string;\n/**\n * ** user events\n */\nexport const ChatEventTypeUserJoined: ChatEventType = \"user_joined\";\nexport const ChatEventTypeUserLeft: ChatEventType = \"user_left\";\nexport const ChatEventTypeTyping: ChatEventType = \"typing\";\nexport const ChatEventTypeStoppedTyping: ChatEventType = \"stopped_typing\";\nexport const ChatEventTypeRead: ChatEventType = \"read\";\nexport const ChatEventTypeDelivered: ChatEventType = \"delivered\";\nexport const ChatEventTypeReconnected: ChatEventType = \"reconnected\";\nexport const ChatEventTypeError: ChatEventType = \"error\";\nexport const ChatEventTypeWaiting: ChatEventType = \"waiting\";\nexport const ChatEventTypeLoadChat: ChatEventType = \"load_chat\";\nexport const ChatEventTypeLoadChatResponse: ChatEventType = \"load_chat_response\";\nexport const ChatEventTypeMessage: ChatEventType = \"message\";\nexport const ChatEventTypeWaitingForAgent: ChatEventType = \"waiting_for_agent\";\nexport const ChatEventTypeMessageStatusUpdate: ChatEventType = \"message_status_update\";\nexport const ChatEventTypeHumanAgentJoined: ChatEventType = \"human_agent_joined\";\nexport const ChatEventTypeHumanAgentLeft: ChatEventType = \"human_agent_left\";\nexport const ChatEventTypeObserverJoined: ChatEventType = \"observer_joined\";\nexport const ChatEventTypeObserverLeft: ChatEventType = \"observer_left\";\nexport const ChatEventTypeListChats: ChatEventType = \"list_chats\";\nexport const ChatEventTypeChatUpdated: ChatEventType = \"chat_updated\";\nexport const ChatEventTypeChatRemoved: ChatEventType = \"chat_removed\";\nexport const ChatEventTypeSyncMetadata: ChatEventType = \"sync_metadata\";\nexport const ChatEventTypeSyncMetadataResponse: ChatEventType = \"sync_metadata_response\";\nexport const ChatEventTypeSyncUserSession: ChatEventType = \"sync_user_session\";\nexport const ChatEventTypeSyncUserSessionResponse: ChatEventType = \"sync_user_session_response\";\nexport const ChatEventTypeClientAction: ChatEventType = \"client_action\";\nexport const ChatEventTypeClientActionCallback: ChatEventType = \"client_action_callback\";\nexport const ChatEventTypeBlockUser: ChatEventType = \"block_user\";\n/**\n * ** collab room management events\n */\nexport const ChatEventTypeCreateRoom: ChatEventType = \"create_room\";\nexport const ChatEventTypeRoomCreated: ChatEventType = \"room_created\";\nexport const ChatEventTypeJoinRoom: ChatEventType = \"join_room\";\nexport const ChatEventTypeLeaveRoom: ChatEventType = \"leave_room\";\nexport const ChatEventTypeDeleteRoom: ChatEventType = \"delete_room\";\nexport const ChatEventTypeRoomDeleted: ChatEventType = \"room_deleted\";\nexport const ChatEventTypeUpdateRoom: ChatEventType = \"update_room\";\nexport const ChatEventTypeRoomUpdated: ChatEventType = \"room_updated\";\nexport const ChatEventTypeInviteUser: ChatEventType = \"invite_user\";\nexport const ChatEventTypeUserInvited: ChatEventType = \"user_invited\";\nexport const ChatEventTypeRoomUserJoined: ChatEventType = \"room_user_joined\";\nexport const ChatEventTypeRoomUserLeft: ChatEventType = \"room_user_left\";\nexport const ChatEventTypeUserRemoved: ChatEventType = \"user_removed\";\nexport const ChatEventTypeListRooms: ChatEventType = \"list_rooms\";\nexport const ChatEventTypeRoomsResponse: ChatEventType = \"rooms_response\";\n/**\n * ** collab message events\n */\nexport const ChatEventTypeMessageEdited: ChatEventType = \"message_edited\";\nexport const ChatEventTypeMessageDeleted: ChatEventType = \"message_deleted\";\nexport const ChatEventTypeMessageReaction: ChatEventType = \"message_reaction\";\nexport const ChatEventTypeMessageReply: ChatEventType = \"message_reply\";\nexport const ChatEventTypeMentionUser: ChatEventType = \"mention_user\";\nexport const ChatEventTypeMessageEditedResponse: ChatEventType = \"message_edited_response\";\nexport const ChatEventTypeMessageDeletedResponse: ChatEventType = \"message_deleted_response\";\nexport const ChatEventTypeMessageReactionResponse: ChatEventType = \"message_reaction_response\";\n/**\n * ** collab user presence events\n */\nexport const ChatEventTypeUserPresenceStart: ChatEventType = \"user_presence_start\";\nexport const ChatEventTypeUserPresenceEnd: ChatEventType = \"user_presence_end\";\nexport const ChatEventTypeUserStatusChange: ChatEventType = \"user_status_change\";\nexport const ChatEventTypeUserActivity: ChatEventType = \"user_activity\";\nexport const ChatEventTypeUserPresenceChanged: ChatEventType = \"user_presence_changed\";\nexport const ChatEventTypeUserActivityUpdate: ChatEventType = \"user_activity_update\";\nexport const ChatEventTypeGetOnlineUsers: ChatEventType = \"get_online_users\";\nexport const ChatEventTypeOnlineUsersResponse: ChatEventType = \"online_users\";\n/**\n * ** shop assist events\n */\nexport const ChatEventTypeEndChat: ChatEventType = \"end_chat\";\nexport const ChatEventTypeChatEnded: ChatEventType = \"chat_ended\";\n/**\n * ** agent session events\n */\nexport const ChatEventTypeAgentSessionStart: ChatEventType = \"agent_session_start\";\nexport const ChatEventTypeAgentSessionEnd: ChatEventType = \"agent_session_end\";\nexport const ChatEventTypeAgentStatusChange: ChatEventType = \"agent_status_change\";\nexport const ChatEventTypeAgentActivityPing: ChatEventType = \"agent_activity_ping\";\nexport const ChatEventTypeAgentChatAssigned: ChatEventType = \"agent_chat_assigned\";\nexport const ChatEventTypeAgentChatCompleted: ChatEventType = \"agent_chat_completed\";\n/**\n * ** AI agents retrieval events\n */\nexport const ChatEventTypeGetAgents: ChatEventType = \"get_agents\";\nexport const ChatEventTypeGetAgentsResponse: ChatEventType = \"get_agents_response\";\n/**\n * ** CSAT events\n */\nexport const ChatEventTypeCSATRequest: ChatEventType = \"csat_request\"; // Internal: scheduler requests chat to send CSAT\nexport const ChatEventTypeCSATSurvey: ChatEventType = \"show_csat_survey\";\nexport const ChatEventTypeCSATResponse: ChatEventType = \"csat_response\";\n/**\n * ** User Suggested Actions events\n */\nexport const ChatEventTypeUserSuggestedActions: ChatEventType = \"user_suggested_actions\";\nexport const ChatEventTypeUserSuggestedActionSelected: ChatEventType = \"user_suggested_action_selected\";\n/**\n * ** Summary events\n */\nexport const ChatEventTypeSummaryUpdate: ChatEventType = \"summary_update\";\n/**\n * ** Agent Context events\n */\nexport const ChatEventTypeAgentContextUpdate: ChatEventType = \"agent_context_update\";\nexport const ChatEventTypeAgentExecutionStarted: ChatEventType = \"agent_execution_started\";\nexport const ChatEventTypeAgentExecutionEnded: ChatEventType = \"agent_execution_ended\";\nexport const ChatEventTypeLoadAgentContext: ChatEventType = \"load_agent_context\";\nexport const ChatEventTypeLoadAgentContextResponse: ChatEventType = \"load_agent_context_response\";\n/**\n * ** Plan → Approve → Execute events\n */\nexport const ChatEventTypePlanPendingApproval: ChatEventType = \"plan_pending_approval\";\nexport const ChatEventTypePlanApproved: ChatEventType = \"plan_approved\";\nexport const ChatEventTypePlanRejected: ChatEventType = \"plan_rejected\";\nexport const ChatEventTypePlanCompleted: ChatEventType = \"plan_completed\";\nexport const ChatEventTypeStepStarted: ChatEventType = \"step_started\";\nexport const ChatEventTypeStepCompleted: ChatEventType = \"step_completed\";\nexport const ChatEventTypeStepFailed: ChatEventType = \"step_failed\";\n/**\n * ** New Chat events\n */\nexport const ChatEventTypeNewChat: ChatEventType = \"new_chat\";\nexport const ChatEventTypeNewChatCreated: ChatEventType = \"new_chat_created\";\n/**\n * ** Heartbeat events\n */\nexport const ChatEventTypePing: ChatEventType = \"ping\";\nexport const ChatEventTypePong: ChatEventType = \"pong\";\n/**\n * ** Skill activation events\n */\nexport const ChatEventTypeSkillActivate: ChatEventType = \"skill_activate\";\nexport const ChatEventTypeSkillDeactivate: ChatEventType = \"skill_deactivate\";\nexport const ChatEventTypeSkillsChanged: ChatEventType = \"skills_changed\";\n/**\n * ** Attachment processing events (deferred document processing)\n */\nexport const ChatEventTypeAttachmentProcessingStarted: ChatEventType = \"attachment_processing_started\";\nexport const ChatEventTypeAttachmentProcessingProgress: ChatEventType = \"attachment_processing_progress\";\nexport const ChatEventTypeAttachmentProcessingComplete: ChatEventType = \"attachment_processing_complete\";\nexport const ChatEventTypeAttachmentProcessingError: ChatEventType = \"attachment_processing_error\";\nexport const ChatEventTypeRetryAttachment: ChatEventType = \"retry_attachment\";\nexport type ChatEventTypeTS =\n | \"message\"\n | \"user_joined\"\n | \"user_left\"\n | \"typing\"\n | \"stopped_typing\"\n | \"read\"\n | \"delivered\"\n | \"reconnected\"\n | \"error\"\n | \"message_status_update\"\n | \"load_chat\"\n | \"load_chat_response\"\n | \"waiting\"\n | \"waiting_for_agent\"\n | \"human_agent_joined\"\n | \"end_chat\"\n | \"chat_ended\"\n | \"human_agent_left\"\n | \"observer_joined\"\n | \"observer_left\"\n | \"list_chats\"\n | \"chat_updated\"\n | \"chat_removed\"\n | \"sync_metadata\"\n | \"sync_metadata_response\"\n | \"sync_user_session\"\n | \"sync_user_session_response\"\n | \"agent_session_start\"\n | \"agent_session_end\"\n | \"agent_status_change\"\n | \"agent_activity_ping\"\n | \"agent_chat_assigned\"\n | \"agent_chat_completed\"\n | \"client_action\"\n | \"client_action_callback\"\n | \"show_csat_survey\"\n | \"csat_response\"\n | \"user_suggested_actions\"\n | \"user_suggested_action_selected\"\n | \"summary_update\"\n | \"agent_context_update\"\n | \"agent_execution_started\"\n | \"agent_execution_ended\"\n | \"load_agent_context\"\n | \"load_agent_context_response\"\n | \"plan_pending_approval\"\n | \"plan_approved\"\n | \"plan_rejected\"\n | \"plan_completed\"\n | \"step_started\"\n | \"step_completed\"\n | \"step_failed\"\n | \"new_chat\"\n | \"new_chat_created\"\n | \"block_user\"\n | \"ping\"\n | \"pong\"\n | \"create_room\"\n | \"room_created\"\n | \"join_room\"\n | \"leave_room\"\n | \"delete_room\"\n | \"room_deleted\"\n | \"update_room\"\n | \"room_updated\"\n | \"invite_user\"\n | \"user_invited\"\n | \"room_user_joined\"\n | \"room_user_left\"\n | \"user_removed\"\n | \"list_rooms\"\n | \"rooms_response\"\n | \"message_edited\"\n | \"message_deleted\"\n | \"message_reaction\"\n | \"message_reply\"\n | \"mention_user\"\n | \"message_edited_response\"\n | \"message_deleted_response\"\n | \"message_reaction_response\"\n | \"user_presence_start\"\n | \"user_presence_end\"\n | \"user_status_change\"\n | \"user_activity\"\n | \"user_presence_changed\"\n | \"user_activity_update\"\n | \"get_online_users\"\n | \"online_users\"\n | \"get_agents\"\n | \"get_agents_response\"\n | \"skill_activate\"\n | \"skill_deactivate\"\n | \"skills_changed\"\n | \"attachment_processing_started\"\n | \"attachment_processing_progress\"\n | \"attachment_processing_complete\"\n | \"attachment_processing_error\"\n | \"retry_attachment\";\nexport type MessageStatus = string;\nexport const MessageStatusSending: MessageStatus = \"sending\";\nexport const MessageStatusSent: MessageStatus = \"sent\";\nexport const MessageStatusDelivered: MessageStatus = \"delivered\";\nexport const MessageStatusRead: MessageStatus = \"read\";\nexport const MessageStatusFailed: MessageStatus = \"failed\";\nexport type MessageStatusTS =\n | \"sending\"\n | \"sent\"\n | \"delivered\"\n | \"read\"\n | \"failed\";\n/**\n * EmojiReaction represents an emoji reaction to a message\n */\nexport interface EmojiReaction {\n emoji: string;\n count: number /* int */;\n users?: string[]; // List of user IDs who reacted\n}\n/**\n * Location represents geographical coordinates\n */\nexport interface Location {\n latitude: number /* float64 */;\n longitude: number /* float64 */;\n address?: string;\n}\n/**\n * AttachmentFile represents a file within an attachment\n */\nexport interface AttachmentFile {\n type: string;\n url: string;\n thumbnailUrl?: string;\n name?: string;\n size?: number /* int64 */;\n}\nexport type AttachmentType = string;\n/**\n * Attachment types for both user and system attachments\n */\nexport const AttachmentTypeDocument: AttachmentType = \"document\";\nexport const AttachmentTypeDocumentAnalysis: AttachmentType = \"document_analysis\";\nexport const AttachmentTypeImage: AttachmentType = \"image\";\nexport const AttachmentTypeAudio: AttachmentType = \"audio\";\nexport const AttachmentTypeVideo: AttachmentType = \"video\";\nexport const AttachmentTypeLocation: AttachmentType = \"location\";\nexport const AttachmentTypeReferences: AttachmentType = \"references\";\nexport const AttachmentTypeSubsections: AttachmentType = \"subsections\";\nexport const AttachmentTypeArticles: AttachmentType = \"articles\";\nexport const AttachmentTypeRecords: AttachmentType = \"records\";\nexport const AttachmentTypeActions: AttachmentType = \"actions\";\nexport const AttachmentTypeBullets: AttachmentType = \"bullets\";\nexport const AttachmentTypeSticker: AttachmentType = \"sticker\";\nexport const AttachmentTypeData: AttachmentType = \"data\";\nexport const AttachmentTypeKGNodes: AttachmentType = \"kgNodes\";\nexport const AttachmentTypeDocumentSources: AttachmentType = \"document_sources\";\nexport const AttachmentTypeSpreadsheet: AttachmentType = \"spreadsheet\"; // Excel, CSV files\nexport const AttachmentTypeDataFile: AttachmentType = \"data_file\"; // JSON, XML, YAML files\n\nexport type AttachmentTypeTS =\n | \"document\"\n | \"document_analysis\"\n | \"image\"\n | \"audio\"\n | \"video\"\n | \"location\"\n | \"references\"\n | \"subsections\"\n | \"articles\"\n | \"records\"\n | \"actions\"\n | \"bullets\"\n | \"sticker\"\n | \"data\"\n | \"kgNodes\"\n | \"document_sources\"\n | \"spreadsheet\"\n | \"data_file\";\n\n/**\n * DocumentSource represents an aggregated document source with page references\n * Used to display source cards in chat responses after document search\n */\nexport interface DocumentSource {\n doc_id: string;\n title: string;\n url: string;\n page_numbers: number /* int */[];\n reference_count: number /* int */;\n bounding_regions?: any /* docs.BoundingRegion */[];\n page_infos?: any /* docs.PageInfo */[]; // Page dimensions for coordinate scaling\n}\n/**\n * Attachment represents any type of attachment to a message\n */\nexport interface Attachment {\n type: AttachmentTypeTS;\n documentAnalysis?: DocumentAnalysisResult;\n title?: string;\n url: string;\n files?: AttachmentFile[]; // Associated files\n location?: Location; // Location data if applicable\n data?: { [key: string]: Variable};\n kgNodes?: KGNode[];\n actions?: Action[];\n documentSources?: DocumentSource[];\n /**\n * Smart document processing fields\n */\n fileMetadata?: any /* docs.AttachmentFileMetadata */; // Client-side extracted file metadata\n processing?: any /* docs.ProcessingResult */; // Smart processing result\n}\nexport interface Action {\n id: string;\n title: string;\n icon?: string;\n description?: string;\n onAction?: () => void;\n}\n/**\n * ChatMessage represents the core message structure\n */\nexport interface ChatMessage {\n /**\n * Core fields\n */\n id: string;\n role: ChatRoleTS;\n content: string;\n time: number /* int64 */;\n status: MessageStatusTS;\n /**\n * Sender information\n */\n senderId: string;\n senderName?: string;\n /**\n * Timing\n */\n createdAt: number /* int64 */;\n updatedAt?: number /* int64 */;\n /**\n * Message relations\n */\n replyTo?: string;\n threadId?: string;\n mentions?: string[];\n /**\n * Attachments and reactions\n */\n attachments?: Attachment[];\n reactions?: EmojiReaction[];\n /**\n * Additional data\n */\n variables?: { [key: string]: Variable};\n /**\n * Tool call\n */\n name?: string;\n toolCallId?: string;\n toolCalls?: ToolCall[];\n /**\n * LLM usage\n */\n llmUsage?: LLMUsage;\n}\nexport interface ChatEvent {\n type: ChatEventTypeTS;\n orgId: string;\n chatKey: string;\n userId: string;\n timestamp: number /* int64 */;\n data?: { [key: string]: any};\n message?: ChatMessage;\n}\nexport interface ChatGrading {\n chatKey: string;\n grade: number /* int */;\n topic: string;\n summary: string;\n}\nexport interface ChatSession {\n id: string;\n status: ChatSessionStatus;\n user?: ChatUser;\n activeChatKey?: string;\n preferences?: ChatSessionPreferences;\n lastActivity: number /* int64 */;\n expiresAt: number /* int64 */;\n metadata?: { [key: string]: any};\n}\nexport type ChatSessionStatus = string;\nexport const ChatSessionStatusActive: ChatSessionStatus = \"active\";\nexport const ChatSessionStatusIdle: ChatSessionStatus = \"idle\";\nexport const ChatSessionStatusExpired: ChatSessionStatus = \"expired\";\nexport interface ChatSessionPreferences {\n language: string;\n theme: string;\n notifications: boolean;\n timeZone: string;\n messageDisplay: string; // compact/expanded\n autoTranslate: boolean;\n rateLimits?: ChatRateLimits;\n}\nexport interface ChatRateLimits {\n maxMessagesPerMinute: number /* int */;\n maxTokensPerDay: number /* int */;\n cooldownPeriod: number /* int */; // seconds\n}\n/**\n * ==========================\n * todo: move to common/llm\n */\nexport interface LLMConfig {\n Provider: string;\n Model: string;\n Temperature: number /* float64 */;\n MaxTokens: number /* int */;\n SystemPrompt: string;\n Tools: LLMTool[];\n Memory?: LLMMemoryConfig;\n}\nexport interface LLMMemoryConfig {\n MaxMessages: number /* int */;\n IncludeSystem: boolean;\n WindowSize: number /* int */; // Token window size\n Strategy: string; // e.g., \"sliding\", \"summarize\"\n}\nexport interface LLMTool {\n Name: string;\n Type: string;\n Function: LLMFunction;\n}\nexport interface LLMFunction {\n Name: string;\n Description: string;\n Parameters: any /* types.JSONSchema */;\n}\nexport interface ToolCall {\n Name: string;\n Arguments: { [key: string]: any};\n ID: string;\n Description: string;\n}\nexport interface LLMResponse {\n Content: string;\n ToolCalls: ToolCall[];\n Usage?: LLMUsage;\n ResponseId: string; // OpenAI Responses API - the response ID for conversation continuity\n}\nexport interface LLMUsage {\n inputTokens: number /* int64 */;\n outputTokens: number /* int64 */;\n totalTokens: number /* int64 */;\n}\n/**\n * ChatSummary represents lightweight chat information for caching and listing\n */\nexport interface ChatSummary {\n chatKey: string;\n title: string;\n userId?: string;\n status: ChatStatus;\n lastUpdated: number /* int64 */;\n waitingSince?: number /* int64 */; // Only populated for waiting chats\n pinned?: boolean;\n metadata?: { [key: string]: any};\n}\nexport interface GetChatRequest {\n orgId: string;\n chatKey: string;\n}\nexport interface GetChatResponse {\n chat?: Chat;\n metadata: ResponseMetadata;\n}\nexport interface ChatProductReference {\n id: string;\n title: string;\n price: number /* float64 */;\n image?: string;\n url?: string;\n}\n/**\n * Chat Archival Models\n */\nexport interface ChatArchivalRequest {\n orgId: string;\n chatKey: string;\n chat: Chat;\n}\nexport interface ChatArchivalResponse {\n success: boolean;\n error?: string;\n message?: string;\n}\n/**\n * Agent Session Request/Response Models\n */\nexport interface StartAgentSessionRequest {\n orgId: string;\n agentId: string;\n userAgent?: string;\n ipAddress?: string;\n}\nexport interface StartAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface EndAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface EndAgentSessionResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentStatusRequest {\n orgId: string;\n agentId: string;\n status: AgentStatusTS;\n}\nexport interface UpdateAgentStatusResponse {\n metadata: ResponseMetadata;\n}\nexport interface UpdateAgentLastActivityRequest {\n orgId: string;\n agentId: string;\n}\nexport interface UpdateAgentLastActivityResponse {\n metadata: ResponseMetadata;\n}\nexport interface AssignChatToAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface AssignChatToAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface CompleteChatByAgentRequest {\n orgId: string;\n agentId: string;\n chatKey: string;\n}\nexport interface CompleteChatByAgentResponse {\n metadata: ResponseMetadata;\n}\nexport interface GetAgentSessionRequest {\n orgId: string;\n agentId: string;\n}\nexport interface GetAgentSessionResponse {\n session?: AgentSession;\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentsRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentsResponse {\n sessions: AgentSession[];\n metadata: ResponseMetadata;\n}\nexport interface GetOnlineAgentCountRequest {\n orgId: string;\n}\nexport interface GetOnlineAgentCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\n/**\n * Queue-specific chat request/response types\n */\nexport interface GetQueueChatsRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\nexport interface GetQueueChatCountRequest {\n orgId: string;\n queueId: string;\n}\nexport interface GetQueueChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport type UserStatusTS = 'online' | 'away' | 'busy' | 'offline';\nexport type UserStatus = string;\nexport const UserStatusOnline: UserStatus = \"online\";\nexport const UserStatusAway: UserStatus = \"away\";\nexport const UserStatusBusy: UserStatus = \"busy\";\nexport const UserStatusOffline: UserStatus = \"offline\";\n/**\n * UserSession for tracking online users\n */\nexport interface UserSession {\n orgId: string;\n userId: string;\n userName: string;\n status: UserStatusTS;\n onlineSince: number /* int64 */;\n lastActivity: number /* int64 */;\n}\n/**\n * User status update requests\n */\nexport interface UpdateUserStatusRequest {\n orgId: string;\n userId: string;\n status: UserStatusTS;\n}\nexport interface UpdateUserStatusResponse {\n metadata: ResponseMetadata;\n}\n/**\n * Get online users\n */\nexport interface GetOnlineUsersRequest {\n orgId: string;\n}\nexport interface GetOnlineUsersResponse {\n metadata: ResponseMetadata;\n users: UserSession[];\n}\n/**\n * Analytics Trigger Models\n */\nexport interface TriggerAnalyticsScanRequest {\n org_id?: string; // Optional: if empty, scans all orgs\n}\nexport interface TriggerAnalyticsScanResponse {\n metadata: ResponseMetadata;\n chats_archived: number /* int */;\n}\n/**\n * AttachmentProcessingStartedData is sent when attachment processing begins\n */\nexport interface AttachmentProcessingStartedData {\n attachmentId: string;\n fileName: string;\n strategy: string;\n}\n/**\n * AttachmentProcessingProgressData is sent during attachment processing\n */\nexport interface AttachmentProcessingProgressData {\n attachmentId: string;\n percent: number /* int */;\n stage: string;\n message: string;\n}\n/**\n * AttachmentProcessingCompleteData is sent when attachment processing completes\n */\nexport interface AttachmentProcessingCompleteData {\n attachmentId: string;\n result?: any /* docs.ProcessingResult */;\n}\n/**\n * AttachmentProcessingErrorData is sent when attachment processing fails\n */\nexport interface AttachmentProcessingErrorData {\n attachmentId: string;\n error: string;\n retryable: boolean;\n}\n/**\n * RetryAttachmentData is sent by frontend to retry a failed attachment\n */\nexport interface RetryAttachmentData {\n attachmentId: string;\n}\n\n//////////\n// source: chat-stats-models.go\n\n/**\n * Active chat requests/responses\n */\nexport interface GetActiveChatCountRequest {\n orgId: string;\n}\nexport interface GetActiveChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetActiveChatsRequest {\n orgId: string;\n pastHours?: number /* float64 */; // 0 means all, 0.5 means past 30 min, 1 means past hour, etc.\n}\nexport interface GetActiveChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * Waiting for agent requests/responses\n */\nexport interface GetWaitingForAgentChatCountRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatCountResponse {\n count: number /* int */;\n metadata: ResponseMetadata;\n}\nexport interface GetWaitingForAgentChatsRequest {\n orgId: string;\n}\nexport interface GetWaitingForAgentChatsResponse {\n chats: ChatSummary[];\n metadata: ResponseMetadata;\n}\n/**\n * User chats requests/responses\n */\nexport interface GetUserChatsRequest {\n orgId: string;\n userId: string;\n limit?: number /* int */; // Number of chats to return (default 15)\n offset?: number /* int */; // Number of chats to skip (for pagination)\n}\nexport interface GetUserChatsResponse {\n chats: ChatSummary[];\n total: number /* int */; // Total number of chats for this user\n hasMore: boolean; // Whether there are more chats to load\n metadata: ResponseMetadata;\n}\n/**\n * Daily counter requests/responses\n */\nexport interface GetDailyChatCountRequest {\n orgId: string;\n date: string /* RFC3339 */;\n timezone: string;\n}\nexport interface GetDailyChatCountResponse {\n count: number /* int64 */;\n date: string;\n timezone: string;\n metadata: any /* types.ResponseMetadata */;\n}\n\n//////////\n// source: queue-models.go\n\n\n// Queue types\nexport const QueueTypes = {\n skill: { value: 'skill', label: 'Skill-based', description: 'Route by agent expertise and skills' },\n priority: { value: 'priority', label: 'Priority-based', description: 'Route by customer tier and urgency level' },\n department: { value: 'department', label: 'Department-based', description: 'Route by business function alignment' },\n complexity: { value: 'complexity', label: 'Complexity-based', description: 'Route by issue difficulty assessment' },\n} as const;\n\nexport type QueueTypeTS = keyof typeof QueueTypes;\nexport type QueueTypeOptionTS = typeof QueueTypes[QueueTypeTS];\n\n/**\n * QueueType represents the routing algorithm type\n */\nexport type QueueType = string;\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeSkill: QueueType = \"skill\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypePriority: QueueType = \"priority\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeDepartment: QueueType = \"department\";\n/**\n * Queue Type Constants - These are hardcoded routing algorithms, not admin-configurable\n */\nexport const QueueTypeComplexity: QueueType = \"complexity\";\n/**\n * AgentQueue represents an individual queue within a queue type\n */\nexport interface AgentQueue {\n id: string /* uuid */;\n orgId: string;\n type: QueueTypeTS; // \"skill\", \"priority\", etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case for metadata matching)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable display name)\n description: string;\n agentIds: string[]; // Agents assigned to this queue\n config: { [key: string]: any}; // Extensible configuration\n isActive: boolean;\n isDefault: boolean; // Default queue for unmatched chats\n createdAt: string /* RFC3339 */;\n updatedAt: string /* RFC3339 */;\n createdBy?: string;\n updatedBy?: string;\n}\n/**\n * GetAgentQueuesFilter represents filtering options for agent queues\n */\nexport interface GetAgentQueuesFilter {\n type?: QueueType;\n isActive?: boolean;\n}\n/**\n * Agent Queue Operations\n */\nexport interface CreateAgentQueueRequest {\n orgId: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n createdBy?: string;\n updatedBy?: string;\n}\nexport interface CreateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface GetAgentQueuesRequest {\n orgId: string;\n type?: QueueType; // Filter by queue type\n isActive?: boolean; // Filter by active status\n}\nexport interface GetAgentQueuesResponse {\n queues: (AgentQueue | undefined)[];\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface UpdateAgentQueueRequest {\n orgId: string;\n id: string;\n type: QueueType; // QueueTypeSkill, QueueTypePriority, etc.\n name: string; // 'technical_support', 'sales', etc. (snake_case)\n title: string; // 'Technical Support', 'Sales', etc. (human-readable)\n description: string;\n agentIds?: string[];\n config?: { [key: string]: any};\n isDefault?: boolean;\n updatedBy?: string;\n}\nexport interface UpdateAgentQueueResponse {\n queue?: AgentQueue;\n metadata: any /* types.ResponseMetadata */;\n}\nexport interface DeleteAgentQueueRequest {\n orgId: string;\n id: string;\n}\nexport interface DeleteAgentQueueResponse {\n metadata: any /* types.ResponseMetadata */;\n}\n/**\n * ChatQueueInfo extends Chat with queue routing information\n */\nexport interface ChatQueueInfo {\n recommendedQueueId?: string /* uuid */;\n recommendedQueueName?: string;\n assignedQueueId?: string /* uuid */;\n assignedQueueName?: string;\n}\n\n//////////\n// source: subjects.go\n\nexport const GetWaitingForAgentChatCountSubject = \"chat.get_waiting_for_agent_chat_count\";\nexport const GetActiveChatCountSubject = \"chat.get_active_chat_count\";\nexport const GetWaitingForAgentChatsSubject = \"chat.get_waiting_for_agent_chats\";\nexport const GetActiveChatsSubject = \"chat.get_active_chats\";\nexport const GetUserChatsSubject = \"chat.get_user_chats\";\nexport const GetChatSubject = \"chat.get_chat\";\n/**\n * Chat Archival Subjects\n */\nexport const ChatArchiveSubjectPattern = \"chat.archive.%s.server\"; // %s = channel/product (e.g., shop-assist, gov-services)\n/**\n * Agent Session Subjects\n */\nexport const StartAgentSessionSubject = \"chat.agent_session.start\";\nexport const EndAgentSessionSubject = \"chat.agent_session.end\";\nexport const UpdateAgentStatusSubject = \"chat.agent_session.update_status\";\nexport const UpdateAgentLastActivitySubject = \"chat.agent_session.update_last_activity\";\nexport const AssignChatToAgentSubject = \"chat.agent_session.assign_chat\";\nexport const CompleteChatByAgentSubject = \"chat.agent_session.complete_chat\";\nexport const GetAgentSessionSubject = \"chat.agent_session.get\";\nexport const GetOnlineAgentsSubject = \"chat.agent_session.get_online_agents\";\nexport const GetOnlineAgentCountSubject = \"chat.agent_session.get_online_agent_count\";\n/**\n * Queue Management Subjects\n */\nexport const CreateAgentQueueSubject = \"chat.agent_queue.create\";\nexport const GetAgentQueuesSubject = \"chat.agent_queue.get\";\nexport const UpdateAgentQueueSubject = \"chat.agent_queue.update\";\nexport const DeleteAgentQueueSubject = \"chat.agent_queue.delete\";\n/**\n * Queue-specific Chat Subjects\n */\nexport const GetQueueChatsSubject = \"chat.queue.get_chats\";\nexport const GetQueueChatCountSubject = \"chat.queue.get_chat_count\";\n/**\n * Daily Counter Subjects\n */\nexport const GetDailyChatCountSubject = \"chat.get_daily_chat_count\";\n/**\n * User Status Subjects\n */\nexport const UpdateUserStatusSubject = \"chat.user.status.update\";\nexport const GetOnlineUsersSubject = \"chat.users.online.get\";\n/**\n * Analytics Trigger Subjects\n */\nexport const TriggerAnalyticsScanSubject = \"chat.analytics.trigger-scan\";\n/**\n * Org Setup Subject\n */\nexport const SetupOrgSubject = \"chat.org.setup\";\n"],"mappings":";;;AAWO,IAAM,mBAA+B;AACrC,IAAM,yBAAqC;AAC3C,IAAM,sBAAkC;AACxC,IAAM,mBAA+B;AACrC,IAAM,qBAAiC;AAGvC,IAAM,0BAAoC;AAC1C,IAAM,qBAA+B;AACrC,IAAM,sBAAgC;AACtC,IAAM,iBAA2B;AACjC,IAAM,gBAA0B;AAmEhC,IAAM,eAAyB;AAC/B,IAAM,aAAuB;AAC7B,IAAM,gBAA0B;AAChC,IAAM,qBAA+B;AACrC,IAAM,mBAA6B;AACnC,IAAM,oBAA8B;AACpC,IAAM,iBAA2B;AACjC,IAAM,eAAyB;AAa/B,IAAM,oBAAiC;AACvC,IAAM,kBAA+B;AACrC,IAAM,kBAA+B;AACrC,IAAM,qBAAkC;AAoBxC,IAAM,0BAAyC;AAC/C,IAAM,wBAAuC;AAC7C,IAAM,sBAAqC;AAC3C,IAAM,6BAA4C;AAClD,IAAM,oBAAmC;AACzC,IAAM,yBAAwC;AAC9C,IAAM,2BAA0C;AAChD,IAAM,qBAAoC;AAC1C,IAAM,uBAAsC;AAC5C,IAAM,wBAAuC;AAC7C,IAAM,gCAA+C;AACrD,IAAM,uBAAsC;AAC5C,IAAM,+BAA8C;AACpD,IAAM,mCAAkD;AACxD,IAAM,gCAA+C;AACrD,IAAM,8BAA6C;AACnD,IAAM,8BAA6C;AACnD,IAAM,4BAA2C;AACjD,IAAM,yBAAwC;AAC9C,IAAM,2BAA0C;AAChD,IAAM,2BAA0C;AAChD,IAAM,4BAA2C;AACjD,IAAM,oCAAmD;AACzD,IAAM,+BAA8C;AACpD,IAAM,uCAAsD;AAC5D,IAAM,4BAA2C;AACjD,IAAM,oCAAmD;AACzD,IAAM,yBAAwC;AAI9C,IAAM,0BAAyC;AAC/C,IAAM,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FvC,IAAM,qCAAqC;AAC3C,IAAM,4BAA4B;AAClC,IAAM,iCAAiC;AACvC,IAAM,wBAAwB;AAC9B,IAAM,sBAAsB;AAC5B,IAAM,iBAAiB;AAIvB,IAAM,4BAA4B;AAIlC,IAAM,2BAA2B;AACjC,IAAM,yBAAyB;AAC/B,IAAM,2BAA2B;AACjC,IAAM,iCAAiC;AACvC,IAAM,2BAA2B;AACjC,IAAM,6BAA6B;AACnC,IAAM,yBAAyB;AAC/B,IAAM,yBAAyB;AAC/B,IAAM,6BAA6B;AAInC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAC9B,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAIhC,IAAM,uBAAuB;AAC7B,IAAM,2BAA2B;AAIjC,IAAM,2BAA2B;AAIjC,IAAM,0BAA0B;AAChC,IAAM,wBAAwB;AAI9B,IAAM,8BAA8B;AAIpC,IAAM,kBAAkB;","names":[]}
@@ -1,7 +1,9 @@
1
- import { R as RetryConfig, T as TransportLogger, C as ChatTransport, a as TransportConfig } from '../types-BB5nRdZs.mjs';
2
- export { b as ConnectionMetrics, c as CreateChatOptions, D as DEFAULT_RETRY_CONFIG, E as EndChatOptions, d as EventHandler, L as LoadChatOptions, S as SendMessageOptions, e as TransportError, f as TransportFactory, g as TransportState, U as Unsubscribe, h as calculateRetryInterval, i as createLogger } from '../types-BB5nRdZs.mjs';
1
+ import { R as RetryConfig, T as TransportLogger, C as ChatTransport, a as TransportConfig } from '../types-CQHtUQ6p.mjs';
2
+ export { b as ConnectionMetrics, c as CreateChatOptions, D as DEFAULT_RETRY_CONFIG, E as EndChatOptions, d as EventHandler, L as LoadChatOptions, S as SendMessageOptions, e as TransportError, f as TransportFactory, g as TransportState, U as Unsubscribe, h as calculateRetryInterval, i as createLogger } from '../types-CQHtUQ6p.mjs';
3
3
  import { ChatEvent } from '../models/index.mjs';
4
+ import '@elqnt/kg';
4
5
  import '@elqnt/types';
6
+ import '@elqnt/docs';
5
7
 
6
8
  /**
7
9
  * SSE Transport (Browser)
@@ -1,7 +1,9 @@
1
- import { R as RetryConfig, T as TransportLogger, C as ChatTransport, a as TransportConfig } from '../types-CNvuxtcv.js';
2
- export { b as ConnectionMetrics, c as CreateChatOptions, D as DEFAULT_RETRY_CONFIG, E as EndChatOptions, d as EventHandler, L as LoadChatOptions, S as SendMessageOptions, e as TransportError, f as TransportFactory, g as TransportState, U as Unsubscribe, h as calculateRetryInterval, i as createLogger } from '../types-CNvuxtcv.js';
1
+ import { R as RetryConfig, T as TransportLogger, C as ChatTransport, a as TransportConfig } from '../types-7UNI1iYv.js';
2
+ export { b as ConnectionMetrics, c as CreateChatOptions, D as DEFAULT_RETRY_CONFIG, E as EndChatOptions, d as EventHandler, L as LoadChatOptions, S as SendMessageOptions, e as TransportError, f as TransportFactory, g as TransportState, U as Unsubscribe, h as calculateRetryInterval, i as createLogger } from '../types-7UNI1iYv.js';
3
3
  import { ChatEvent } from '../models/index.js';
4
+ import '@elqnt/kg';
4
5
  import '@elqnt/types';
6
+ import '@elqnt/docs';
5
7
 
6
8
  /**
7
9
  * SSE Transport (Browser)
@@ -121,7 +121,11 @@ function createSSETransport(options = {}) {
121
121
  const errorText = await response.text();
122
122
  throw new Error(`API error: ${response.status} - ${errorText}`);
123
123
  }
124
- return response.json();
124
+ const json = await response.json();
125
+ if (json && typeof json === "object" && "data" in json) {
126
+ return json.data;
127
+ }
128
+ return json;
125
129
  }
126
130
  function handleMessage(event) {
127
131
  if (!event.data || event.data === "") return;
@@ -330,6 +334,37 @@ function createSSETransport(options = {}) {
330
334
  });
331
335
  metrics.messagesSent++;
332
336
  },
337
+ async createChat(options2) {
338
+ if (!config) {
339
+ throw new Error("Transport not connected");
340
+ }
341
+ const response = await sendRest("create", {
342
+ orgId: options2.orgId,
343
+ userId: options2.userId,
344
+ metadata: options2.metadata
345
+ });
346
+ if (!response?.chatKey) {
347
+ throw new Error("Failed to create chat: no chatKey returned");
348
+ }
349
+ return { chatKey: response.chatKey };
350
+ },
351
+ async loadChatData(options2) {
352
+ if (!config) {
353
+ throw new Error("Transport not connected");
354
+ }
355
+ const response = await sendRest("load", {
356
+ orgId: options2.orgId,
357
+ chatKey: options2.chatKey,
358
+ userId: options2.userId
359
+ });
360
+ if (!response?.chat) {
361
+ throw new Error("Failed to load chat: no chat data returned");
362
+ }
363
+ return {
364
+ chat: response.chat,
365
+ agentId: response.agentId
366
+ };
367
+ },
333
368
  onMessage(handler) {
334
369
  globalHandlers.add(handler);
335
370
  return () => globalHandlers.delete(handler);
@@ -426,7 +461,11 @@ function createFetchSSETransport(options = {}) {
426
461
  const errorText = await response.text();
427
462
  throw new Error(`API error: ${response.status} - ${errorText}`);
428
463
  }
429
- return response.json();
464
+ const json = await response.json();
465
+ if (json && typeof json === "object" && "data" in json) {
466
+ return json.data;
467
+ }
468
+ return json;
430
469
  }
431
470
  function parseSSEChunk(chunk) {
432
471
  const events = [];
@@ -671,6 +710,37 @@ function createFetchSSETransport(options = {}) {
671
710
  });
672
711
  metrics.messagesSent++;
673
712
  },
713
+ async createChat(options2) {
714
+ if (!config) {
715
+ throw new Error("Transport not connected");
716
+ }
717
+ const response = await sendRest("create", {
718
+ orgId: options2.orgId,
719
+ userId: options2.userId,
720
+ metadata: options2.metadata
721
+ });
722
+ if (!response?.chatKey) {
723
+ throw new Error("Failed to create chat: no chatKey returned");
724
+ }
725
+ return { chatKey: response.chatKey };
726
+ },
727
+ async loadChatData(options2) {
728
+ if (!config) {
729
+ throw new Error("Transport not connected");
730
+ }
731
+ const response = await sendRest("load", {
732
+ orgId: options2.orgId,
733
+ chatKey: options2.chatKey,
734
+ userId: options2.userId
735
+ });
736
+ if (!response?.chat) {
737
+ throw new Error("Failed to load chat: no chat data returned");
738
+ }
739
+ return {
740
+ chat: response.chat,
741
+ agentId: response.agentId
742
+ };
743
+ },
674
744
  onMessage(handler) {
675
745
  globalHandlers.add(handler);
676
746
  return () => globalHandlers.delete(handler);
@@ -753,6 +823,33 @@ function createWhatsAppTransport(options = {}) {
753
823
  );
754
824
  metrics.messagesSent++;
755
825
  },
826
+ async createChat(options2) {
827
+ logger.warn(
828
+ "WhatsApp createChat is a stub. WhatsApp chats are created via incoming webhooks."
829
+ );
830
+ return { chatKey: `whatsapp_${options2.userId}_${Date.now()}` };
831
+ },
832
+ async loadChatData(options2) {
833
+ logger.warn(
834
+ "WhatsApp loadChatData is a stub. Implement backend API call."
835
+ );
836
+ return {
837
+ chat: {
838
+ orgId: options2.orgId,
839
+ key: options2.chatKey,
840
+ title: "WhatsApp Chat",
841
+ messages: [],
842
+ lastUpdated: Date.now(),
843
+ startTime: Date.now(),
844
+ users: [],
845
+ status: "active",
846
+ aiEngaged: false,
847
+ humanAgentEngaged: false,
848
+ isWaiting: false,
849
+ isWaitingForAgent: false
850
+ }
851
+ };
852
+ },
756
853
  onMessage(handler) {
757
854
  globalHandlers.add(handler);
758
855
  return () => globalHandlers.delete(handler);