@elqnt/chat 1.0.3 → 1.0.4

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,6 +1,7 @@
1
- import { d as UseWebSocketChatBaseReturn, C as Chat, H as ChatUser, U as UseWebSocketChatBaseConfig } from '../use-websocket-chat-base-CZDONnTz.mjs';
2
- import '@elqnt/types';
1
+ import { Chat, ChatUser } from '../models/index.mjs';
2
+ import { UseWebSocketChatBaseReturn, UseWebSocketChatBaseConfig } from './use-websocket-chat-base.mjs';
3
3
  import '@elqnt/kg';
4
+ import '@elqnt/types';
4
5
  import '@elqnt/docs';
5
6
 
6
7
  interface UseWebSocketChatAdminReturn extends UseWebSocketChatBaseReturn {
@@ -1,6 +1,7 @@
1
- import { d as UseWebSocketChatBaseReturn, C as Chat, H as ChatUser, U as UseWebSocketChatBaseConfig } from '../use-websocket-chat-base-CZDONnTz.js';
2
- import '@elqnt/types';
1
+ import { Chat, ChatUser } from '../models/index.js';
2
+ import { UseWebSocketChatBaseReturn, UseWebSocketChatBaseConfig } from './use-websocket-chat-base.js';
3
3
  import '@elqnt/kg';
4
+ import '@elqnt/types';
4
5
  import '@elqnt/docs';
5
6
 
6
7
  interface UseWebSocketChatAdminReturn extends UseWebSocketChatBaseReturn {
@@ -1,4 +1,70 @@
1
- import '@elqnt/types';
2
- export { c as ConnectionMetrics, b as ConnectionState, L as Logger, Q as QueueConfig, R as RetryConfig, U as UseWebSocketChatBaseConfig, d as UseWebSocketChatBaseReturn, W as WebSocketError, u as useWebSocketChatBase } from '../use-websocket-chat-base-CZDONnTz.mjs';
1
+ import { ProductNameTS } from '@elqnt/types';
2
+ import { ChatEvent } from '../models/index.mjs';
3
3
  import '@elqnt/kg';
4
4
  import '@elqnt/docs';
5
+
6
+ type ConnectionState = "disconnected" | "connecting" | "connected" | "reconnecting";
7
+ interface WebSocketError {
8
+ code: "CONNECTION_FAILED" | "PARSE_ERROR" | "SEND_FAILED" | "TIMEOUT" | "NETWORK_ERROR";
9
+ message: string;
10
+ retryable: boolean;
11
+ timestamp: number;
12
+ }
13
+ interface RetryConfig {
14
+ maxRetries?: number;
15
+ intervals?: number[];
16
+ backoffMultiplier?: number;
17
+ maxBackoffTime?: number;
18
+ }
19
+ interface ConnectionMetrics {
20
+ latency: number;
21
+ messagesSent: number;
22
+ messagesReceived: number;
23
+ messagesQueued: number;
24
+ reconnectCount: number;
25
+ lastError?: WebSocketError;
26
+ connectedAt?: number;
27
+ lastMessageAt?: number;
28
+ }
29
+ interface QueueConfig {
30
+ maxSize?: number;
31
+ dropStrategy?: "oldest" | "newest";
32
+ }
33
+ interface Logger {
34
+ debug: (message: string, ...args: any[]) => void;
35
+ info: (message: string, ...args: any[]) => void;
36
+ warn: (message: string, ...args: any[]) => void;
37
+ error: (message: string, ...args: any[]) => void;
38
+ }
39
+ interface UseWebSocketChatBaseConfig {
40
+ serverBaseUrl: string;
41
+ orgId: string;
42
+ clientType: "customer" | "humanAgent" | "observer";
43
+ product: ProductNameTS;
44
+ onMessage?: (event: ChatEvent) => void;
45
+ retryConfig?: RetryConfig;
46
+ queueConfig?: QueueConfig;
47
+ debug?: boolean;
48
+ logger?: Logger;
49
+ heartbeatInterval?: number;
50
+ heartbeatTimeout?: number;
51
+ }
52
+ interface UseWebSocketChatBaseReturn {
53
+ connectionState: ConnectionState;
54
+ isConnected: boolean;
55
+ sendMessage: (event: Omit<ChatEvent, "timestamp">, overrideUserId?: string) => Promise<void>;
56
+ error: WebSocketError | undefined;
57
+ connect: (userId: string) => Promise<void>;
58
+ startNewChat: (userId: string, data?: {
59
+ [key: string]: any;
60
+ }) => Promise<string>;
61
+ startTime: Date | undefined;
62
+ disconnect: (intentional?: boolean) => void;
63
+ metrics: ConnectionMetrics;
64
+ on: (eventType: string, handler: (data: any) => void) => () => void;
65
+ off: (eventType: string, handler: (data: any) => void) => void;
66
+ clearError: () => void;
67
+ }
68
+ declare const useWebSocketChatBase: ({ serverBaseUrl, orgId, clientType, product, onMessage, retryConfig, queueConfig, debug, logger, heartbeatInterval, heartbeatTimeout, }: UseWebSocketChatBaseConfig) => UseWebSocketChatBaseReturn;
69
+
70
+ export { type ConnectionMetrics, type ConnectionState, type Logger, type QueueConfig, type RetryConfig, type UseWebSocketChatBaseConfig, type UseWebSocketChatBaseReturn, type WebSocketError, useWebSocketChatBase };
@@ -1,4 +1,70 @@
1
- import '@elqnt/types';
2
- export { c as ConnectionMetrics, b as ConnectionState, L as Logger, Q as QueueConfig, R as RetryConfig, U as UseWebSocketChatBaseConfig, d as UseWebSocketChatBaseReturn, W as WebSocketError, u as useWebSocketChatBase } from '../use-websocket-chat-base-CZDONnTz.js';
1
+ import { ProductNameTS } from '@elqnt/types';
2
+ import { ChatEvent } from '../models/index.js';
3
3
  import '@elqnt/kg';
4
4
  import '@elqnt/docs';
5
+
6
+ type ConnectionState = "disconnected" | "connecting" | "connected" | "reconnecting";
7
+ interface WebSocketError {
8
+ code: "CONNECTION_FAILED" | "PARSE_ERROR" | "SEND_FAILED" | "TIMEOUT" | "NETWORK_ERROR";
9
+ message: string;
10
+ retryable: boolean;
11
+ timestamp: number;
12
+ }
13
+ interface RetryConfig {
14
+ maxRetries?: number;
15
+ intervals?: number[];
16
+ backoffMultiplier?: number;
17
+ maxBackoffTime?: number;
18
+ }
19
+ interface ConnectionMetrics {
20
+ latency: number;
21
+ messagesSent: number;
22
+ messagesReceived: number;
23
+ messagesQueued: number;
24
+ reconnectCount: number;
25
+ lastError?: WebSocketError;
26
+ connectedAt?: number;
27
+ lastMessageAt?: number;
28
+ }
29
+ interface QueueConfig {
30
+ maxSize?: number;
31
+ dropStrategy?: "oldest" | "newest";
32
+ }
33
+ interface Logger {
34
+ debug: (message: string, ...args: any[]) => void;
35
+ info: (message: string, ...args: any[]) => void;
36
+ warn: (message: string, ...args: any[]) => void;
37
+ error: (message: string, ...args: any[]) => void;
38
+ }
39
+ interface UseWebSocketChatBaseConfig {
40
+ serverBaseUrl: string;
41
+ orgId: string;
42
+ clientType: "customer" | "humanAgent" | "observer";
43
+ product: ProductNameTS;
44
+ onMessage?: (event: ChatEvent) => void;
45
+ retryConfig?: RetryConfig;
46
+ queueConfig?: QueueConfig;
47
+ debug?: boolean;
48
+ logger?: Logger;
49
+ heartbeatInterval?: number;
50
+ heartbeatTimeout?: number;
51
+ }
52
+ interface UseWebSocketChatBaseReturn {
53
+ connectionState: ConnectionState;
54
+ isConnected: boolean;
55
+ sendMessage: (event: Omit<ChatEvent, "timestamp">, overrideUserId?: string) => Promise<void>;
56
+ error: WebSocketError | undefined;
57
+ connect: (userId: string) => Promise<void>;
58
+ startNewChat: (userId: string, data?: {
59
+ [key: string]: any;
60
+ }) => Promise<string>;
61
+ startTime: Date | undefined;
62
+ disconnect: (intentional?: boolean) => void;
63
+ metrics: ConnectionMetrics;
64
+ on: (eventType: string, handler: (data: any) => void) => () => void;
65
+ off: (eventType: string, handler: (data: any) => void) => void;
66
+ clearError: () => void;
67
+ }
68
+ declare const useWebSocketChatBase: ({ serverBaseUrl, orgId, clientType, product, onMessage, retryConfig, queueConfig, debug, logger, heartbeatInterval, heartbeatTimeout, }: UseWebSocketChatBaseConfig) => UseWebSocketChatBaseReturn;
69
+
70
+ export { type ConnectionMetrics, type ConnectionState, type Logger, type QueueConfig, type RetryConfig, type UseWebSocketChatBaseConfig, type UseWebSocketChatBaseReturn, type WebSocketError, useWebSocketChatBase };
@@ -1,6 +1,7 @@
1
- import { d as UseWebSocketChatBaseReturn, a as ChatMessage, H as ChatUser, U as UseWebSocketChatBaseConfig } from '../use-websocket-chat-base-CZDONnTz.mjs';
2
- import '@elqnt/types';
1
+ import { ChatMessage, ChatUser } from '../models/index.mjs';
2
+ import { UseWebSocketChatBaseReturn, UseWebSocketChatBaseConfig } from './use-websocket-chat-base.mjs';
3
3
  import '@elqnt/kg';
4
+ import '@elqnt/types';
4
5
  import '@elqnt/docs';
5
6
 
6
7
  interface UseWebSocketChatCustomerReturn extends UseWebSocketChatBaseReturn {
@@ -1,6 +1,7 @@
1
- import { d as UseWebSocketChatBaseReturn, a as ChatMessage, H as ChatUser, U as UseWebSocketChatBaseConfig } from '../use-websocket-chat-base-CZDONnTz.js';
2
- import '@elqnt/types';
1
+ import { ChatMessage, ChatUser } from '../models/index.js';
2
+ import { UseWebSocketChatBaseReturn, UseWebSocketChatBaseConfig } from './use-websocket-chat-base.js';
3
3
  import '@elqnt/kg';
4
+ import '@elqnt/types';
4
5
  import '@elqnt/docs';
5
6
 
6
7
  interface UseWebSocketChatCustomerReturn extends UseWebSocketChatBaseReturn {
package/dist/index.d.mts CHANGED
@@ -1,12 +1,13 @@
1
1
  import React$1 from 'react';
2
- import { C as Chat, a as ChatMessage } from './use-websocket-chat-base-CZDONnTz.mjs';
3
- export { bP as Action, d1 as AgentQueue, P as AgentSession, J as AgentStatus, M as AgentStatusAway, N as AgentStatusBusy, O as AgentStatusOffline, K as AgentStatusOnline, I as AgentStatusTS, ci as AssignChatToAgentRequest, cj as AssignChatToAgentResponse, dn as AssignChatToAgentSubject, bO as Attachment, bu as AttachmentFile, bv as AttachmentType, bG as AttachmentTypeActions, bE as AttachmentTypeArticles, bz as AttachmentTypeAudio, bH as AttachmentTypeBullets, bJ as AttachmentTypeData, bw as AttachmentTypeDocument, bx as AttachmentTypeDocumentAnalysis, bL as AttachmentTypeDocumentSources, by as AttachmentTypeImage, bK as AttachmentTypeKGNodes, bB as AttachmentTypeLocation, bF as AttachmentTypeRecords, bC as AttachmentTypeReferences, bI as AttachmentTypeSticker, bD as AttachmentTypeSubsections, bM as AttachmentTypeTS, bA as AttachmentTypeVideo, c8 as ChatArchivalRequest, c9 as ChatArchivalResponse, di as ChatArchiveSubjectPattern, s as ChatContext, bQ as ChatEvent, S as ChatEventType, aV as ChatEventTypeAgentActivityPing, aW as ChatEventTypeAgentChatAssigned, aX as ChatEventTypeAgentChatCompleted, b4 as ChatEventTypeAgentContextUpdate, b6 as ChatEventTypeAgentExecutionEnded, b5 as ChatEventTypeAgentExecutionStarted, aT as ChatEventTypeAgentSessionEnd, aS as ChatEventTypeAgentSessionStart, aU as ChatEventTypeAgentStatusChange, ak as ChatEventTypeBlockUser, a_ as ChatEventTypeCSATRequest, b0 as ChatEventTypeCSATResponse, a$ as ChatEventTypeCSATSurvey, aR as ChatEventTypeChatEnded, ad as ChatEventTypeChatRemoved, ac as ChatEventTypeChatUpdated, ai as ChatEventTypeClientAction, aj as ChatEventTypeClientActionCallback, al as ChatEventTypeCreateRoom, ap as ChatEventTypeDeleteRoom, _ as ChatEventTypeDelivered, aQ as ChatEventTypeEndChat, a0 as ChatEventTypeError, aY as ChatEventTypeGetAgents, aZ as ChatEventTypeGetAgentsResponse, aO as ChatEventTypeGetOnlineUsers, a7 as ChatEventTypeHumanAgentJoined, a8 as ChatEventTypeHumanAgentLeft, at as ChatEventTypeInviteUser, an as ChatEventTypeJoinRoom, ao as ChatEventTypeLeaveRoom, ab as ChatEventTypeListChats, ay as ChatEventTypeListRooms, b7 as ChatEventTypeLoadAgentContext, b8 as ChatEventTypeLoadAgentContextResponse, a2 as ChatEventTypeLoadChat, a3 as ChatEventTypeLoadChatResponse, aE as ChatEventTypeMentionUser, a4 as ChatEventTypeMessage, aB as ChatEventTypeMessageDeleted, aG as ChatEventTypeMessageDeletedResponse, aA as ChatEventTypeMessageEdited, aF as ChatEventTypeMessageEditedResponse, aC as ChatEventTypeMessageReaction, aH as ChatEventTypeMessageReactionResponse, aD as ChatEventTypeMessageReply, a6 as ChatEventTypeMessageStatusUpdate, bg as ChatEventTypeNewChat, bh as ChatEventTypeNewChatCreated, a9 as ChatEventTypeObserverJoined, aa as ChatEventTypeObserverLeft, aP as ChatEventTypeOnlineUsersResponse, bi as ChatEventTypePing, ba as ChatEventTypePlanApproved, bc as ChatEventTypePlanCompleted, b9 as ChatEventTypePlanPendingApproval, bb as ChatEventTypePlanRejected, bj as ChatEventTypePong, Z as ChatEventTypeRead, $ as ChatEventTypeReconnected, am as ChatEventTypeRoomCreated, aq as ChatEventTypeRoomDeleted, as as ChatEventTypeRoomUpdated, av as ChatEventTypeRoomUserJoined, aw as ChatEventTypeRoomUserLeft, az as ChatEventTypeRoomsResponse, be as ChatEventTypeStepCompleted, bf as ChatEventTypeStepFailed, bd as ChatEventTypeStepStarted, Y as ChatEventTypeStoppedTyping, b3 as ChatEventTypeSummaryUpdate, ae as ChatEventTypeSyncMetadata, af as ChatEventTypeSyncMetadataResponse, ag as ChatEventTypeSyncUserSession, ah as ChatEventTypeSyncUserSessionResponse, bk as ChatEventTypeTS, X as ChatEventTypeTyping, ar as ChatEventTypeUpdateRoom, aL as ChatEventTypeUserActivity, aN as ChatEventTypeUserActivityUpdate, au as ChatEventTypeUserInvited, T as ChatEventTypeUserJoined, V as ChatEventTypeUserLeft, aM as ChatEventTypeUserPresenceChanged, aJ as ChatEventTypeUserPresenceEnd, aI as ChatEventTypeUserPresenceStart, ax as ChatEventTypeUserRemoved, aK as ChatEventTypeUserStatusChange, b2 as ChatEventTypeUserSuggestedActionSelected, b1 as ChatEventTypeUserSuggestedActions, a1 as ChatEventTypeWaiting, a5 as ChatEventTypeWaitingForAgent, t as ChatFlow, bR as ChatGrading, c7 as ChatProductReference, db as ChatQueueInfo, bY as ChatRateLimits, x as ChatRole, z as ChatRoleAI, E as ChatRoleDataQuery, A as ChatRoleEvent, B as ChatRoleHumanAgent, D as ChatRoleObserver, F as ChatRoleSystem, w as ChatRoleTS, G as ChatRoleTool, y as ChatRoleUser, bS as ChatSession, bX as ChatSessionPreferences, bT as ChatSessionStatus, bU as ChatSessionStatusActive, bW as ChatSessionStatusExpired, bV as ChatSessionStatusIdle, f as ChatStatus, i as ChatStatusAbandoned, g as ChatStatusActive, k as ChatStatusArchived, j as ChatStatusClosed, h as ChatStatusDisconnected, e as ChatStatusTS, c4 as ChatSummary, v as ChatTool, m as ChatType, n as ChatTypeCustomerSupport, q as ChatTypeDirect, r as ChatTypeGroup, p as ChatTypePrivateRoom, o as ChatTypePublicRoom, l as ChatTypeTS, H as ChatUser, ck as CompleteChatByAgentRequest, cl as CompleteChatByAgentResponse, dp as CompleteChatByAgentSubject, c as ConnectionMetrics, b as ConnectionState, d3 as CreateAgentQueueRequest, d4 as CreateAgentQueueResponse, dt as CreateAgentQueueSubject, d9 as DeleteAgentQueueRequest, da as DeleteAgentQueueResponse, dw as DeleteAgentQueueSubject, bN as DocumentSource, bs as EmojiReaction, cc as EndAgentSessionRequest, cd as EndAgentSessionResponse, dk as EndAgentSessionSubject, cJ as GetActiveChatCountRequest, cK as GetActiveChatCountResponse, dd as GetActiveChatCountSubject, cL as GetActiveChatsRequest, cM as GetActiveChatsResponse, df as GetActiveChatsSubject, d2 as GetAgentQueuesFilter, d5 as GetAgentQueuesRequest, d6 as GetAgentQueuesResponse, du as GetAgentQueuesSubject, cm as GetAgentSessionRequest, cn as GetAgentSessionResponse, dq as GetAgentSessionSubject, c5 as GetChatRequest, c6 as GetChatResponse, dh as GetChatSubject, cT as GetDailyChatCountRequest, cU as GetDailyChatCountResponse, dz as GetDailyChatCountSubject, cq as GetOnlineAgentCountRequest, cr as GetOnlineAgentCountResponse, ds as GetOnlineAgentCountSubject, co as GetOnlineAgentsRequest, cp as GetOnlineAgentsResponse, dr as GetOnlineAgentsSubject, cF as GetOnlineUsersRequest, cG as GetOnlineUsersResponse, dB as GetOnlineUsersSubject, cu as GetQueueChatCountRequest, cv as GetQueueChatCountResponse, dy as GetQueueChatCountSubject, cs as GetQueueChatsRequest, ct as GetQueueChatsResponse, dx as GetQueueChatsSubject, cR as GetUserChatsRequest, cS as GetUserChatsResponse, dg as GetUserChatsSubject, cN as GetWaitingForAgentChatCountRequest, cO as GetWaitingForAgentChatCountResponse, dc as GetWaitingForAgentChatCountSubject, cP as GetWaitingForAgentChatsRequest, cQ as GetWaitingForAgentChatsResponse, de as GetWaitingForAgentChatsSubject, bZ as LLMConfig, c0 as LLMFunction, b_ as LLMMemoryConfig, c2 as LLMResponse, b$ as LLMTool, c3 as LLMUsage, bt as Location, L as Logger, bl as MessageStatus, bo as MessageStatusDelivered, bq as MessageStatusFailed, bp as MessageStatusRead, bm as MessageStatusSending, bn as MessageStatusSent, br as MessageStatusTS, Q as QueueConfig, cY as QueueType, d0 as QueueTypeComplexity, c$ as QueueTypeDepartment, cX as QueueTypeOptionTS, c_ as QueueTypePriority, cZ as QueueTypeSkill, cW as QueueTypeTS, cV as QueueTypes, R as RetryConfig, dD as SetupOrgSubject, ca as StartAgentSessionRequest, cb as StartAgentSessionResponse, dj as StartAgentSessionSubject, c1 as ToolCall, cH as TriggerAnalyticsScanRequest, cI as TriggerAnalyticsScanResponse, dC as TriggerAnalyticsScanSubject, cg as UpdateAgentLastActivityRequest, ch as UpdateAgentLastActivityResponse, dm as UpdateAgentLastActivitySubject, d7 as UpdateAgentQueueRequest, d8 as UpdateAgentQueueResponse, dv as UpdateAgentQueueSubject, ce as UpdateAgentStatusRequest, cf as UpdateAgentStatusResponse, dl as UpdateAgentStatusSubject, cD as UpdateUserStatusRequest, cE as UpdateUserStatusResponse, dA as UpdateUserStatusSubject, U as UseWebSocketChatBaseConfig, d as UseWebSocketChatBaseReturn, cC as UserSession, cx as UserStatus, cz as UserStatusAway, cA as UserStatusBusy, cB as UserStatusOffline, cy as UserStatusOnline, cw as UserStatusTS, W as WebSocketError, u as useWebSocketChatBase } from './use-websocket-chat-base-CZDONnTz.mjs';
2
+ import { Chat, ChatMessage } from './models/index.mjs';
3
+ export { Action, AgentQueue, AgentSession, AgentStatus, AgentStatusAway, AgentStatusBusy, AgentStatusOffline, AgentStatusOnline, AgentStatusTS, AssignChatToAgentRequest, AssignChatToAgentResponse, AssignChatToAgentSubject, Attachment, AttachmentFile, AttachmentType, AttachmentTypeActions, AttachmentTypeArticles, AttachmentTypeAudio, AttachmentTypeBullets, AttachmentTypeData, AttachmentTypeDocument, AttachmentTypeDocumentAnalysis, AttachmentTypeDocumentSources, AttachmentTypeImage, AttachmentTypeKGNodes, AttachmentTypeLocation, AttachmentTypeRecords, AttachmentTypeReferences, AttachmentTypeSticker, AttachmentTypeSubsections, AttachmentTypeTS, AttachmentTypeVideo, ChatArchivalRequest, ChatArchivalResponse, ChatArchiveSubjectPattern, ChatContext, ChatEvent, ChatEventType, ChatEventTypeAgentActivityPing, ChatEventTypeAgentChatAssigned, ChatEventTypeAgentChatCompleted, ChatEventTypeAgentContextUpdate, ChatEventTypeAgentExecutionEnded, ChatEventTypeAgentExecutionStarted, ChatEventTypeAgentSessionEnd, ChatEventTypeAgentSessionStart, ChatEventTypeAgentStatusChange, ChatEventTypeBlockUser, ChatEventTypeCSATRequest, ChatEventTypeCSATResponse, ChatEventTypeCSATSurvey, ChatEventTypeChatEnded, ChatEventTypeChatRemoved, ChatEventTypeChatUpdated, ChatEventTypeClientAction, ChatEventTypeClientActionCallback, ChatEventTypeCreateRoom, ChatEventTypeDeleteRoom, ChatEventTypeDelivered, ChatEventTypeEndChat, ChatEventTypeError, ChatEventTypeGetAgents, ChatEventTypeGetAgentsResponse, ChatEventTypeGetOnlineUsers, ChatEventTypeHumanAgentJoined, ChatEventTypeHumanAgentLeft, ChatEventTypeInviteUser, ChatEventTypeJoinRoom, ChatEventTypeLeaveRoom, ChatEventTypeListChats, ChatEventTypeListRooms, ChatEventTypeLoadAgentContext, ChatEventTypeLoadAgentContextResponse, ChatEventTypeLoadChat, ChatEventTypeLoadChatResponse, ChatEventTypeMentionUser, ChatEventTypeMessage, ChatEventTypeMessageDeleted, ChatEventTypeMessageDeletedResponse, ChatEventTypeMessageEdited, ChatEventTypeMessageEditedResponse, ChatEventTypeMessageReaction, ChatEventTypeMessageReactionResponse, ChatEventTypeMessageReply, ChatEventTypeMessageStatusUpdate, ChatEventTypeNewChat, ChatEventTypeNewChatCreated, ChatEventTypeObserverJoined, ChatEventTypeObserverLeft, ChatEventTypeOnlineUsersResponse, ChatEventTypePing, ChatEventTypePlanApproved, ChatEventTypePlanCompleted, ChatEventTypePlanPendingApproval, ChatEventTypePlanRejected, ChatEventTypePong, ChatEventTypeRead, ChatEventTypeReconnected, ChatEventTypeRoomCreated, ChatEventTypeRoomDeleted, ChatEventTypeRoomUpdated, ChatEventTypeRoomUserJoined, ChatEventTypeRoomUserLeft, ChatEventTypeRoomsResponse, ChatEventTypeStepCompleted, ChatEventTypeStepFailed, ChatEventTypeStepStarted, ChatEventTypeStoppedTyping, ChatEventTypeSummaryUpdate, ChatEventTypeSyncMetadata, ChatEventTypeSyncMetadataResponse, ChatEventTypeSyncUserSession, ChatEventTypeSyncUserSessionResponse, ChatEventTypeTS, ChatEventTypeTyping, ChatEventTypeUpdateRoom, ChatEventTypeUserActivity, ChatEventTypeUserActivityUpdate, ChatEventTypeUserInvited, ChatEventTypeUserJoined, ChatEventTypeUserLeft, ChatEventTypeUserPresenceChanged, ChatEventTypeUserPresenceEnd, ChatEventTypeUserPresenceStart, ChatEventTypeUserRemoved, ChatEventTypeUserStatusChange, ChatEventTypeUserSuggestedActionSelected, ChatEventTypeUserSuggestedActions, ChatEventTypeWaiting, ChatEventTypeWaitingForAgent, ChatFlow, ChatGrading, ChatProductReference, ChatQueueInfo, ChatRateLimits, ChatRole, ChatRoleAI, ChatRoleDataQuery, ChatRoleEvent, ChatRoleHumanAgent, ChatRoleObserver, ChatRoleSystem, ChatRoleTS, ChatRoleTool, ChatRoleUser, ChatSession, ChatSessionPreferences, ChatSessionStatus, ChatSessionStatusActive, ChatSessionStatusExpired, ChatSessionStatusIdle, ChatStatus, ChatStatusAbandoned, ChatStatusActive, ChatStatusArchived, ChatStatusClosed, ChatStatusDisconnected, ChatStatusTS, ChatSummary, ChatTool, ChatType, ChatTypeCustomerSupport, ChatTypeDirect, ChatTypeGroup, ChatTypePrivateRoom, ChatTypePublicRoom, ChatTypeTS, ChatUser, CompleteChatByAgentRequest, CompleteChatByAgentResponse, CompleteChatByAgentSubject, CreateAgentQueueRequest, CreateAgentQueueResponse, CreateAgentQueueSubject, DeleteAgentQueueRequest, DeleteAgentQueueResponse, DeleteAgentQueueSubject, DocumentSource, EmojiReaction, EndAgentSessionRequest, EndAgentSessionResponse, EndAgentSessionSubject, GetActiveChatCountRequest, GetActiveChatCountResponse, GetActiveChatCountSubject, GetActiveChatsRequest, GetActiveChatsResponse, GetActiveChatsSubject, GetAgentQueuesFilter, GetAgentQueuesRequest, GetAgentQueuesResponse, GetAgentQueuesSubject, GetAgentSessionRequest, GetAgentSessionResponse, GetAgentSessionSubject, GetChatRequest, GetChatResponse, GetChatSubject, GetDailyChatCountRequest, GetDailyChatCountResponse, GetDailyChatCountSubject, GetOnlineAgentCountRequest, GetOnlineAgentCountResponse, GetOnlineAgentCountSubject, GetOnlineAgentsRequest, GetOnlineAgentsResponse, GetOnlineAgentsSubject, GetOnlineUsersRequest, GetOnlineUsersResponse, GetOnlineUsersSubject, GetQueueChatCountRequest, GetQueueChatCountResponse, GetQueueChatCountSubject, GetQueueChatsRequest, GetQueueChatsResponse, GetQueueChatsSubject, GetUserChatsRequest, GetUserChatsResponse, GetUserChatsSubject, GetWaitingForAgentChatCountRequest, GetWaitingForAgentChatCountResponse, GetWaitingForAgentChatCountSubject, GetWaitingForAgentChatsRequest, GetWaitingForAgentChatsResponse, GetWaitingForAgentChatsSubject, LLMConfig, LLMFunction, LLMMemoryConfig, LLMResponse, LLMTool, LLMUsage, Location, MessageStatus, MessageStatusDelivered, MessageStatusFailed, MessageStatusRead, MessageStatusSending, MessageStatusSent, MessageStatusTS, QueueType, QueueTypeComplexity, QueueTypeDepartment, QueueTypeOptionTS, QueueTypePriority, QueueTypeSkill, QueueTypeTS, QueueTypes, SetupOrgSubject, StartAgentSessionRequest, StartAgentSessionResponse, StartAgentSessionSubject, ToolCall, TriggerAnalyticsScanRequest, TriggerAnalyticsScanResponse, TriggerAnalyticsScanSubject, UpdateAgentLastActivityRequest, UpdateAgentLastActivityResponse, UpdateAgentLastActivitySubject, UpdateAgentQueueRequest, UpdateAgentQueueResponse, UpdateAgentQueueSubject, UpdateAgentStatusRequest, UpdateAgentStatusResponse, UpdateAgentStatusSubject, UpdateUserStatusRequest, UpdateUserStatusResponse, UpdateUserStatusSubject, UserSession, UserStatus, UserStatusAway, UserStatusBusy, UserStatusOffline, UserStatusOnline, UserStatusTS } from './models/index.mjs';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ProductNameTS } from '@elqnt/types';
6
6
  import { UseWebSocketChatCustomerReturn } from './hooks/use-websocket-chat-customer.mjs';
7
7
  export { UseWebSocketChatCustomerConfig, useWebSocketChatCustomer } from './hooks/use-websocket-chat-customer.mjs';
8
8
  import { UseWebSocketChatAdminReturn } from './hooks/use-websocket-chat-admin.mjs';
9
9
  export { useWebSocketChatAdmin } from './hooks/use-websocket-chat-admin.mjs';
10
+ export { ConnectionMetrics, ConnectionState, Logger, QueueConfig, RetryConfig, UseWebSocketChatBaseConfig, UseWebSocketChatBaseReturn, WebSocketError, useWebSocketChatBase } from './hooks/use-websocket-chat-base.mjs';
10
11
  import '@elqnt/kg';
11
12
  import '@elqnt/docs';
12
13
 
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
1
  import React$1 from 'react';
2
- import { C as Chat, a as ChatMessage } from './use-websocket-chat-base-CZDONnTz.js';
3
- export { bP as Action, d1 as AgentQueue, P as AgentSession, J as AgentStatus, M as AgentStatusAway, N as AgentStatusBusy, O as AgentStatusOffline, K as AgentStatusOnline, I as AgentStatusTS, ci as AssignChatToAgentRequest, cj as AssignChatToAgentResponse, dn as AssignChatToAgentSubject, bO as Attachment, bu as AttachmentFile, bv as AttachmentType, bG as AttachmentTypeActions, bE as AttachmentTypeArticles, bz as AttachmentTypeAudio, bH as AttachmentTypeBullets, bJ as AttachmentTypeData, bw as AttachmentTypeDocument, bx as AttachmentTypeDocumentAnalysis, bL as AttachmentTypeDocumentSources, by as AttachmentTypeImage, bK as AttachmentTypeKGNodes, bB as AttachmentTypeLocation, bF as AttachmentTypeRecords, bC as AttachmentTypeReferences, bI as AttachmentTypeSticker, bD as AttachmentTypeSubsections, bM as AttachmentTypeTS, bA as AttachmentTypeVideo, c8 as ChatArchivalRequest, c9 as ChatArchivalResponse, di as ChatArchiveSubjectPattern, s as ChatContext, bQ as ChatEvent, S as ChatEventType, aV as ChatEventTypeAgentActivityPing, aW as ChatEventTypeAgentChatAssigned, aX as ChatEventTypeAgentChatCompleted, b4 as ChatEventTypeAgentContextUpdate, b6 as ChatEventTypeAgentExecutionEnded, b5 as ChatEventTypeAgentExecutionStarted, aT as ChatEventTypeAgentSessionEnd, aS as ChatEventTypeAgentSessionStart, aU as ChatEventTypeAgentStatusChange, ak as ChatEventTypeBlockUser, a_ as ChatEventTypeCSATRequest, b0 as ChatEventTypeCSATResponse, a$ as ChatEventTypeCSATSurvey, aR as ChatEventTypeChatEnded, ad as ChatEventTypeChatRemoved, ac as ChatEventTypeChatUpdated, ai as ChatEventTypeClientAction, aj as ChatEventTypeClientActionCallback, al as ChatEventTypeCreateRoom, ap as ChatEventTypeDeleteRoom, _ as ChatEventTypeDelivered, aQ as ChatEventTypeEndChat, a0 as ChatEventTypeError, aY as ChatEventTypeGetAgents, aZ as ChatEventTypeGetAgentsResponse, aO as ChatEventTypeGetOnlineUsers, a7 as ChatEventTypeHumanAgentJoined, a8 as ChatEventTypeHumanAgentLeft, at as ChatEventTypeInviteUser, an as ChatEventTypeJoinRoom, ao as ChatEventTypeLeaveRoom, ab as ChatEventTypeListChats, ay as ChatEventTypeListRooms, b7 as ChatEventTypeLoadAgentContext, b8 as ChatEventTypeLoadAgentContextResponse, a2 as ChatEventTypeLoadChat, a3 as ChatEventTypeLoadChatResponse, aE as ChatEventTypeMentionUser, a4 as ChatEventTypeMessage, aB as ChatEventTypeMessageDeleted, aG as ChatEventTypeMessageDeletedResponse, aA as ChatEventTypeMessageEdited, aF as ChatEventTypeMessageEditedResponse, aC as ChatEventTypeMessageReaction, aH as ChatEventTypeMessageReactionResponse, aD as ChatEventTypeMessageReply, a6 as ChatEventTypeMessageStatusUpdate, bg as ChatEventTypeNewChat, bh as ChatEventTypeNewChatCreated, a9 as ChatEventTypeObserverJoined, aa as ChatEventTypeObserverLeft, aP as ChatEventTypeOnlineUsersResponse, bi as ChatEventTypePing, ba as ChatEventTypePlanApproved, bc as ChatEventTypePlanCompleted, b9 as ChatEventTypePlanPendingApproval, bb as ChatEventTypePlanRejected, bj as ChatEventTypePong, Z as ChatEventTypeRead, $ as ChatEventTypeReconnected, am as ChatEventTypeRoomCreated, aq as ChatEventTypeRoomDeleted, as as ChatEventTypeRoomUpdated, av as ChatEventTypeRoomUserJoined, aw as ChatEventTypeRoomUserLeft, az as ChatEventTypeRoomsResponse, be as ChatEventTypeStepCompleted, bf as ChatEventTypeStepFailed, bd as ChatEventTypeStepStarted, Y as ChatEventTypeStoppedTyping, b3 as ChatEventTypeSummaryUpdate, ae as ChatEventTypeSyncMetadata, af as ChatEventTypeSyncMetadataResponse, ag as ChatEventTypeSyncUserSession, ah as ChatEventTypeSyncUserSessionResponse, bk as ChatEventTypeTS, X as ChatEventTypeTyping, ar as ChatEventTypeUpdateRoom, aL as ChatEventTypeUserActivity, aN as ChatEventTypeUserActivityUpdate, au as ChatEventTypeUserInvited, T as ChatEventTypeUserJoined, V as ChatEventTypeUserLeft, aM as ChatEventTypeUserPresenceChanged, aJ as ChatEventTypeUserPresenceEnd, aI as ChatEventTypeUserPresenceStart, ax as ChatEventTypeUserRemoved, aK as ChatEventTypeUserStatusChange, b2 as ChatEventTypeUserSuggestedActionSelected, b1 as ChatEventTypeUserSuggestedActions, a1 as ChatEventTypeWaiting, a5 as ChatEventTypeWaitingForAgent, t as ChatFlow, bR as ChatGrading, c7 as ChatProductReference, db as ChatQueueInfo, bY as ChatRateLimits, x as ChatRole, z as ChatRoleAI, E as ChatRoleDataQuery, A as ChatRoleEvent, B as ChatRoleHumanAgent, D as ChatRoleObserver, F as ChatRoleSystem, w as ChatRoleTS, G as ChatRoleTool, y as ChatRoleUser, bS as ChatSession, bX as ChatSessionPreferences, bT as ChatSessionStatus, bU as ChatSessionStatusActive, bW as ChatSessionStatusExpired, bV as ChatSessionStatusIdle, f as ChatStatus, i as ChatStatusAbandoned, g as ChatStatusActive, k as ChatStatusArchived, j as ChatStatusClosed, h as ChatStatusDisconnected, e as ChatStatusTS, c4 as ChatSummary, v as ChatTool, m as ChatType, n as ChatTypeCustomerSupport, q as ChatTypeDirect, r as ChatTypeGroup, p as ChatTypePrivateRoom, o as ChatTypePublicRoom, l as ChatTypeTS, H as ChatUser, ck as CompleteChatByAgentRequest, cl as CompleteChatByAgentResponse, dp as CompleteChatByAgentSubject, c as ConnectionMetrics, b as ConnectionState, d3 as CreateAgentQueueRequest, d4 as CreateAgentQueueResponse, dt as CreateAgentQueueSubject, d9 as DeleteAgentQueueRequest, da as DeleteAgentQueueResponse, dw as DeleteAgentQueueSubject, bN as DocumentSource, bs as EmojiReaction, cc as EndAgentSessionRequest, cd as EndAgentSessionResponse, dk as EndAgentSessionSubject, cJ as GetActiveChatCountRequest, cK as GetActiveChatCountResponse, dd as GetActiveChatCountSubject, cL as GetActiveChatsRequest, cM as GetActiveChatsResponse, df as GetActiveChatsSubject, d2 as GetAgentQueuesFilter, d5 as GetAgentQueuesRequest, d6 as GetAgentQueuesResponse, du as GetAgentQueuesSubject, cm as GetAgentSessionRequest, cn as GetAgentSessionResponse, dq as GetAgentSessionSubject, c5 as GetChatRequest, c6 as GetChatResponse, dh as GetChatSubject, cT as GetDailyChatCountRequest, cU as GetDailyChatCountResponse, dz as GetDailyChatCountSubject, cq as GetOnlineAgentCountRequest, cr as GetOnlineAgentCountResponse, ds as GetOnlineAgentCountSubject, co as GetOnlineAgentsRequest, cp as GetOnlineAgentsResponse, dr as GetOnlineAgentsSubject, cF as GetOnlineUsersRequest, cG as GetOnlineUsersResponse, dB as GetOnlineUsersSubject, cu as GetQueueChatCountRequest, cv as GetQueueChatCountResponse, dy as GetQueueChatCountSubject, cs as GetQueueChatsRequest, ct as GetQueueChatsResponse, dx as GetQueueChatsSubject, cR as GetUserChatsRequest, cS as GetUserChatsResponse, dg as GetUserChatsSubject, cN as GetWaitingForAgentChatCountRequest, cO as GetWaitingForAgentChatCountResponse, dc as GetWaitingForAgentChatCountSubject, cP as GetWaitingForAgentChatsRequest, cQ as GetWaitingForAgentChatsResponse, de as GetWaitingForAgentChatsSubject, bZ as LLMConfig, c0 as LLMFunction, b_ as LLMMemoryConfig, c2 as LLMResponse, b$ as LLMTool, c3 as LLMUsage, bt as Location, L as Logger, bl as MessageStatus, bo as MessageStatusDelivered, bq as MessageStatusFailed, bp as MessageStatusRead, bm as MessageStatusSending, bn as MessageStatusSent, br as MessageStatusTS, Q as QueueConfig, cY as QueueType, d0 as QueueTypeComplexity, c$ as QueueTypeDepartment, cX as QueueTypeOptionTS, c_ as QueueTypePriority, cZ as QueueTypeSkill, cW as QueueTypeTS, cV as QueueTypes, R as RetryConfig, dD as SetupOrgSubject, ca as StartAgentSessionRequest, cb as StartAgentSessionResponse, dj as StartAgentSessionSubject, c1 as ToolCall, cH as TriggerAnalyticsScanRequest, cI as TriggerAnalyticsScanResponse, dC as TriggerAnalyticsScanSubject, cg as UpdateAgentLastActivityRequest, ch as UpdateAgentLastActivityResponse, dm as UpdateAgentLastActivitySubject, d7 as UpdateAgentQueueRequest, d8 as UpdateAgentQueueResponse, dv as UpdateAgentQueueSubject, ce as UpdateAgentStatusRequest, cf as UpdateAgentStatusResponse, dl as UpdateAgentStatusSubject, cD as UpdateUserStatusRequest, cE as UpdateUserStatusResponse, dA as UpdateUserStatusSubject, U as UseWebSocketChatBaseConfig, d as UseWebSocketChatBaseReturn, cC as UserSession, cx as UserStatus, cz as UserStatusAway, cA as UserStatusBusy, cB as UserStatusOffline, cy as UserStatusOnline, cw as UserStatusTS, W as WebSocketError, u as useWebSocketChatBase } from './use-websocket-chat-base-CZDONnTz.js';
2
+ import { Chat, ChatMessage } from './models/index.js';
3
+ export { Action, AgentQueue, AgentSession, AgentStatus, AgentStatusAway, AgentStatusBusy, AgentStatusOffline, AgentStatusOnline, AgentStatusTS, AssignChatToAgentRequest, AssignChatToAgentResponse, AssignChatToAgentSubject, Attachment, AttachmentFile, AttachmentType, AttachmentTypeActions, AttachmentTypeArticles, AttachmentTypeAudio, AttachmentTypeBullets, AttachmentTypeData, AttachmentTypeDocument, AttachmentTypeDocumentAnalysis, AttachmentTypeDocumentSources, AttachmentTypeImage, AttachmentTypeKGNodes, AttachmentTypeLocation, AttachmentTypeRecords, AttachmentTypeReferences, AttachmentTypeSticker, AttachmentTypeSubsections, AttachmentTypeTS, AttachmentTypeVideo, ChatArchivalRequest, ChatArchivalResponse, ChatArchiveSubjectPattern, ChatContext, ChatEvent, ChatEventType, ChatEventTypeAgentActivityPing, ChatEventTypeAgentChatAssigned, ChatEventTypeAgentChatCompleted, ChatEventTypeAgentContextUpdate, ChatEventTypeAgentExecutionEnded, ChatEventTypeAgentExecutionStarted, ChatEventTypeAgentSessionEnd, ChatEventTypeAgentSessionStart, ChatEventTypeAgentStatusChange, ChatEventTypeBlockUser, ChatEventTypeCSATRequest, ChatEventTypeCSATResponse, ChatEventTypeCSATSurvey, ChatEventTypeChatEnded, ChatEventTypeChatRemoved, ChatEventTypeChatUpdated, ChatEventTypeClientAction, ChatEventTypeClientActionCallback, ChatEventTypeCreateRoom, ChatEventTypeDeleteRoom, ChatEventTypeDelivered, ChatEventTypeEndChat, ChatEventTypeError, ChatEventTypeGetAgents, ChatEventTypeGetAgentsResponse, ChatEventTypeGetOnlineUsers, ChatEventTypeHumanAgentJoined, ChatEventTypeHumanAgentLeft, ChatEventTypeInviteUser, ChatEventTypeJoinRoom, ChatEventTypeLeaveRoom, ChatEventTypeListChats, ChatEventTypeListRooms, ChatEventTypeLoadAgentContext, ChatEventTypeLoadAgentContextResponse, ChatEventTypeLoadChat, ChatEventTypeLoadChatResponse, ChatEventTypeMentionUser, ChatEventTypeMessage, ChatEventTypeMessageDeleted, ChatEventTypeMessageDeletedResponse, ChatEventTypeMessageEdited, ChatEventTypeMessageEditedResponse, ChatEventTypeMessageReaction, ChatEventTypeMessageReactionResponse, ChatEventTypeMessageReply, ChatEventTypeMessageStatusUpdate, ChatEventTypeNewChat, ChatEventTypeNewChatCreated, ChatEventTypeObserverJoined, ChatEventTypeObserverLeft, ChatEventTypeOnlineUsersResponse, ChatEventTypePing, ChatEventTypePlanApproved, ChatEventTypePlanCompleted, ChatEventTypePlanPendingApproval, ChatEventTypePlanRejected, ChatEventTypePong, ChatEventTypeRead, ChatEventTypeReconnected, ChatEventTypeRoomCreated, ChatEventTypeRoomDeleted, ChatEventTypeRoomUpdated, ChatEventTypeRoomUserJoined, ChatEventTypeRoomUserLeft, ChatEventTypeRoomsResponse, ChatEventTypeStepCompleted, ChatEventTypeStepFailed, ChatEventTypeStepStarted, ChatEventTypeStoppedTyping, ChatEventTypeSummaryUpdate, ChatEventTypeSyncMetadata, ChatEventTypeSyncMetadataResponse, ChatEventTypeSyncUserSession, ChatEventTypeSyncUserSessionResponse, ChatEventTypeTS, ChatEventTypeTyping, ChatEventTypeUpdateRoom, ChatEventTypeUserActivity, ChatEventTypeUserActivityUpdate, ChatEventTypeUserInvited, ChatEventTypeUserJoined, ChatEventTypeUserLeft, ChatEventTypeUserPresenceChanged, ChatEventTypeUserPresenceEnd, ChatEventTypeUserPresenceStart, ChatEventTypeUserRemoved, ChatEventTypeUserStatusChange, ChatEventTypeUserSuggestedActionSelected, ChatEventTypeUserSuggestedActions, ChatEventTypeWaiting, ChatEventTypeWaitingForAgent, ChatFlow, ChatGrading, ChatProductReference, ChatQueueInfo, ChatRateLimits, ChatRole, ChatRoleAI, ChatRoleDataQuery, ChatRoleEvent, ChatRoleHumanAgent, ChatRoleObserver, ChatRoleSystem, ChatRoleTS, ChatRoleTool, ChatRoleUser, ChatSession, ChatSessionPreferences, ChatSessionStatus, ChatSessionStatusActive, ChatSessionStatusExpired, ChatSessionStatusIdle, ChatStatus, ChatStatusAbandoned, ChatStatusActive, ChatStatusArchived, ChatStatusClosed, ChatStatusDisconnected, ChatStatusTS, ChatSummary, ChatTool, ChatType, ChatTypeCustomerSupport, ChatTypeDirect, ChatTypeGroup, ChatTypePrivateRoom, ChatTypePublicRoom, ChatTypeTS, ChatUser, CompleteChatByAgentRequest, CompleteChatByAgentResponse, CompleteChatByAgentSubject, CreateAgentQueueRequest, CreateAgentQueueResponse, CreateAgentQueueSubject, DeleteAgentQueueRequest, DeleteAgentQueueResponse, DeleteAgentQueueSubject, DocumentSource, EmojiReaction, EndAgentSessionRequest, EndAgentSessionResponse, EndAgentSessionSubject, GetActiveChatCountRequest, GetActiveChatCountResponse, GetActiveChatCountSubject, GetActiveChatsRequest, GetActiveChatsResponse, GetActiveChatsSubject, GetAgentQueuesFilter, GetAgentQueuesRequest, GetAgentQueuesResponse, GetAgentQueuesSubject, GetAgentSessionRequest, GetAgentSessionResponse, GetAgentSessionSubject, GetChatRequest, GetChatResponse, GetChatSubject, GetDailyChatCountRequest, GetDailyChatCountResponse, GetDailyChatCountSubject, GetOnlineAgentCountRequest, GetOnlineAgentCountResponse, GetOnlineAgentCountSubject, GetOnlineAgentsRequest, GetOnlineAgentsResponse, GetOnlineAgentsSubject, GetOnlineUsersRequest, GetOnlineUsersResponse, GetOnlineUsersSubject, GetQueueChatCountRequest, GetQueueChatCountResponse, GetQueueChatCountSubject, GetQueueChatsRequest, GetQueueChatsResponse, GetQueueChatsSubject, GetUserChatsRequest, GetUserChatsResponse, GetUserChatsSubject, GetWaitingForAgentChatCountRequest, GetWaitingForAgentChatCountResponse, GetWaitingForAgentChatCountSubject, GetWaitingForAgentChatsRequest, GetWaitingForAgentChatsResponse, GetWaitingForAgentChatsSubject, LLMConfig, LLMFunction, LLMMemoryConfig, LLMResponse, LLMTool, LLMUsage, Location, MessageStatus, MessageStatusDelivered, MessageStatusFailed, MessageStatusRead, MessageStatusSending, MessageStatusSent, MessageStatusTS, QueueType, QueueTypeComplexity, QueueTypeDepartment, QueueTypeOptionTS, QueueTypePriority, QueueTypeSkill, QueueTypeTS, QueueTypes, SetupOrgSubject, StartAgentSessionRequest, StartAgentSessionResponse, StartAgentSessionSubject, ToolCall, TriggerAnalyticsScanRequest, TriggerAnalyticsScanResponse, TriggerAnalyticsScanSubject, UpdateAgentLastActivityRequest, UpdateAgentLastActivityResponse, UpdateAgentLastActivitySubject, UpdateAgentQueueRequest, UpdateAgentQueueResponse, UpdateAgentQueueSubject, UpdateAgentStatusRequest, UpdateAgentStatusResponse, UpdateAgentStatusSubject, UpdateUserStatusRequest, UpdateUserStatusResponse, UpdateUserStatusSubject, UserSession, UserStatus, UserStatusAway, UserStatusBusy, UserStatusOffline, UserStatusOnline, UserStatusTS } from './models/index.js';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import { ProductNameTS } from '@elqnt/types';
6
6
  import { UseWebSocketChatCustomerReturn } from './hooks/use-websocket-chat-customer.js';
7
7
  export { UseWebSocketChatCustomerConfig, useWebSocketChatCustomer } from './hooks/use-websocket-chat-customer.js';
8
8
  import { UseWebSocketChatAdminReturn } from './hooks/use-websocket-chat-admin.js';
9
9
  export { useWebSocketChatAdmin } from './hooks/use-websocket-chat-admin.js';
10
+ export { ConnectionMetrics, ConnectionState, Logger, QueueConfig, RetryConfig, UseWebSocketChatBaseConfig, UseWebSocketChatBaseReturn, WebSocketError, useWebSocketChatBase } from './hooks/use-websocket-chat-base.js';
10
11
  import '@elqnt/kg';
11
12
  import '@elqnt/docs';
12
13
 
@@ -1,5 +1,5 @@
1
- import { Variable, ResponseMetadata, ProductNameTS } from '@elqnt/types';
2
1
  import { KGNode } from '@elqnt/kg';
2
+ import { Variable, ResponseMetadata } from '@elqnt/types';
3
3
  import { DocumentAnalysisResult, BoundingRegion, PageInfo } from '@elqnt/docs';
4
4
 
5
5
  type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';
@@ -922,68 +922,4 @@ declare const TriggerAnalyticsScanSubject = "chat.analytics.trigger-scan";
922
922
  */
923
923
  declare const SetupOrgSubject = "chat.org.setup";
924
924
 
925
- type ConnectionState = "disconnected" | "connecting" | "connected" | "reconnecting";
926
- interface WebSocketError {
927
- code: "CONNECTION_FAILED" | "PARSE_ERROR" | "SEND_FAILED" | "TIMEOUT" | "NETWORK_ERROR";
928
- message: string;
929
- retryable: boolean;
930
- timestamp: number;
931
- }
932
- interface RetryConfig {
933
- maxRetries?: number;
934
- intervals?: number[];
935
- backoffMultiplier?: number;
936
- maxBackoffTime?: number;
937
- }
938
- interface ConnectionMetrics {
939
- latency: number;
940
- messagesSent: number;
941
- messagesReceived: number;
942
- messagesQueued: number;
943
- reconnectCount: number;
944
- lastError?: WebSocketError;
945
- connectedAt?: number;
946
- lastMessageAt?: number;
947
- }
948
- interface QueueConfig {
949
- maxSize?: number;
950
- dropStrategy?: "oldest" | "newest";
951
- }
952
- interface Logger {
953
- debug: (message: string, ...args: any[]) => void;
954
- info: (message: string, ...args: any[]) => void;
955
- warn: (message: string, ...args: any[]) => void;
956
- error: (message: string, ...args: any[]) => void;
957
- }
958
- interface UseWebSocketChatBaseConfig {
959
- serverBaseUrl: string;
960
- orgId: string;
961
- clientType: "customer" | "humanAgent" | "observer";
962
- product: ProductNameTS;
963
- onMessage?: (event: ChatEvent) => void;
964
- retryConfig?: RetryConfig;
965
- queueConfig?: QueueConfig;
966
- debug?: boolean;
967
- logger?: Logger;
968
- heartbeatInterval?: number;
969
- heartbeatTimeout?: number;
970
- }
971
- interface UseWebSocketChatBaseReturn {
972
- connectionState: ConnectionState;
973
- isConnected: boolean;
974
- sendMessage: (event: Omit<ChatEvent, "timestamp">, overrideUserId?: string) => Promise<void>;
975
- error: WebSocketError | undefined;
976
- connect: (userId: string) => Promise<void>;
977
- startNewChat: (userId: string, data?: {
978
- [key: string]: any;
979
- }) => Promise<string>;
980
- startTime: Date | undefined;
981
- disconnect: (intentional?: boolean) => void;
982
- metrics: ConnectionMetrics;
983
- on: (eventType: string, handler: (data: any) => void) => () => void;
984
- off: (eventType: string, handler: (data: any) => void) => void;
985
- clearError: () => void;
986
- }
987
- declare const useWebSocketChatBase: ({ serverBaseUrl, orgId, clientType, product, onMessage, retryConfig, queueConfig, debug, logger, heartbeatInterval, heartbeatTimeout, }: UseWebSocketChatBaseConfig) => UseWebSocketChatBaseReturn;
988
-
989
- export { ChatEventTypeReconnected as $, ChatRoleEvent as A, ChatRoleHumanAgent as B, type Chat as C, ChatRoleObserver as D, ChatRoleDataQuery as E, ChatRoleSystem as F, ChatRoleTool as G, type ChatUser as H, type AgentStatusTS as I, type AgentStatus as J, AgentStatusOnline as K, type Logger as L, AgentStatusAway as M, AgentStatusBusy as N, AgentStatusOffline as O, type AgentSession as P, type QueueConfig as Q, type RetryConfig as R, type ChatEventType as S, ChatEventTypeUserJoined as T, type UseWebSocketChatBaseConfig as U, ChatEventTypeUserLeft as V, type WebSocketError as W, ChatEventTypeTyping as X, ChatEventTypeStoppedTyping as Y, ChatEventTypeRead as Z, ChatEventTypeDelivered as _, type ChatMessage as a, ChatEventTypeCSATSurvey as a$, ChatEventTypeError as a0, ChatEventTypeWaiting as a1, ChatEventTypeLoadChat as a2, ChatEventTypeLoadChatResponse as a3, ChatEventTypeMessage as a4, ChatEventTypeWaitingForAgent as a5, ChatEventTypeMessageStatusUpdate as a6, ChatEventTypeHumanAgentJoined as a7, ChatEventTypeHumanAgentLeft as a8, ChatEventTypeObserverJoined as a9, ChatEventTypeMessageEdited as aA, ChatEventTypeMessageDeleted as aB, ChatEventTypeMessageReaction as aC, ChatEventTypeMessageReply as aD, ChatEventTypeMentionUser as aE, ChatEventTypeMessageEditedResponse as aF, ChatEventTypeMessageDeletedResponse as aG, ChatEventTypeMessageReactionResponse as aH, ChatEventTypeUserPresenceStart as aI, ChatEventTypeUserPresenceEnd as aJ, ChatEventTypeUserStatusChange as aK, ChatEventTypeUserActivity as aL, ChatEventTypeUserPresenceChanged as aM, ChatEventTypeUserActivityUpdate as aN, ChatEventTypeGetOnlineUsers as aO, ChatEventTypeOnlineUsersResponse as aP, ChatEventTypeEndChat as aQ, ChatEventTypeChatEnded as aR, ChatEventTypeAgentSessionStart as aS, ChatEventTypeAgentSessionEnd as aT, ChatEventTypeAgentStatusChange as aU, ChatEventTypeAgentActivityPing as aV, ChatEventTypeAgentChatAssigned as aW, ChatEventTypeAgentChatCompleted as aX, ChatEventTypeGetAgents as aY, ChatEventTypeGetAgentsResponse as aZ, ChatEventTypeCSATRequest as a_, ChatEventTypeObserverLeft as aa, ChatEventTypeListChats as ab, ChatEventTypeChatUpdated as ac, ChatEventTypeChatRemoved as ad, ChatEventTypeSyncMetadata as ae, ChatEventTypeSyncMetadataResponse as af, ChatEventTypeSyncUserSession as ag, ChatEventTypeSyncUserSessionResponse as ah, ChatEventTypeClientAction as ai, ChatEventTypeClientActionCallback as aj, ChatEventTypeBlockUser as ak, ChatEventTypeCreateRoom as al, ChatEventTypeRoomCreated as am, ChatEventTypeJoinRoom as an, ChatEventTypeLeaveRoom as ao, ChatEventTypeDeleteRoom as ap, ChatEventTypeRoomDeleted as aq, ChatEventTypeUpdateRoom as ar, ChatEventTypeRoomUpdated as as, ChatEventTypeInviteUser as at, ChatEventTypeUserInvited as au, ChatEventTypeRoomUserJoined as av, ChatEventTypeRoomUserLeft as aw, ChatEventTypeUserRemoved as ax, ChatEventTypeListRooms as ay, ChatEventTypeRoomsResponse as az, type ConnectionState as b, type LLMTool as b$, ChatEventTypeCSATResponse as b0, ChatEventTypeUserSuggestedActions as b1, ChatEventTypeUserSuggestedActionSelected as b2, ChatEventTypeSummaryUpdate as b3, ChatEventTypeAgentContextUpdate as b4, ChatEventTypeAgentExecutionStarted as b5, ChatEventTypeAgentExecutionEnded as b6, ChatEventTypeLoadAgentContext as b7, ChatEventTypeLoadAgentContextResponse as b8, ChatEventTypePlanPendingApproval as b9, AttachmentTypeVideo as bA, AttachmentTypeLocation as bB, AttachmentTypeReferences as bC, AttachmentTypeSubsections as bD, AttachmentTypeArticles as bE, AttachmentTypeRecords as bF, AttachmentTypeActions as bG, AttachmentTypeBullets as bH, AttachmentTypeSticker as bI, AttachmentTypeData as bJ, AttachmentTypeKGNodes as bK, AttachmentTypeDocumentSources as bL, type AttachmentTypeTS as bM, type DocumentSource as bN, type Attachment as bO, type Action as bP, type ChatEvent as bQ, type ChatGrading as bR, type ChatSession as bS, type ChatSessionStatus as bT, ChatSessionStatusActive as bU, ChatSessionStatusIdle as bV, ChatSessionStatusExpired as bW, type ChatSessionPreferences as bX, type ChatRateLimits as bY, type LLMConfig as bZ, type LLMMemoryConfig as b_, ChatEventTypePlanApproved as ba, ChatEventTypePlanRejected as bb, ChatEventTypePlanCompleted as bc, ChatEventTypeStepStarted as bd, ChatEventTypeStepCompleted as be, ChatEventTypeStepFailed as bf, ChatEventTypeNewChat as bg, ChatEventTypeNewChatCreated as bh, ChatEventTypePing as bi, ChatEventTypePong as bj, type ChatEventTypeTS as bk, type MessageStatus as bl, MessageStatusSending as bm, MessageStatusSent as bn, MessageStatusDelivered as bo, MessageStatusRead as bp, MessageStatusFailed as bq, type MessageStatusTS as br, type EmojiReaction as bs, type Location as bt, type AttachmentFile as bu, type AttachmentType as bv, AttachmentTypeDocument as bw, AttachmentTypeDocumentAnalysis as bx, AttachmentTypeImage as by, AttachmentTypeAudio as bz, type ConnectionMetrics as c, QueueTypeDepartment as c$, type LLMFunction as c0, type ToolCall as c1, type LLMResponse as c2, type LLMUsage as c3, type ChatSummary as c4, type GetChatRequest as c5, type GetChatResponse as c6, type ChatProductReference as c7, type ChatArchivalRequest as c8, type ChatArchivalResponse as c9, UserStatusBusy as cA, UserStatusOffline as cB, type UserSession as cC, type UpdateUserStatusRequest as cD, type UpdateUserStatusResponse as cE, type GetOnlineUsersRequest as cF, type GetOnlineUsersResponse as cG, type TriggerAnalyticsScanRequest as cH, type TriggerAnalyticsScanResponse as cI, type GetActiveChatCountRequest as cJ, type GetActiveChatCountResponse as cK, type GetActiveChatsRequest as cL, type GetActiveChatsResponse as cM, type GetWaitingForAgentChatCountRequest as cN, type GetWaitingForAgentChatCountResponse as cO, type GetWaitingForAgentChatsRequest as cP, type GetWaitingForAgentChatsResponse as cQ, type GetUserChatsRequest as cR, type GetUserChatsResponse as cS, type GetDailyChatCountRequest as cT, type GetDailyChatCountResponse as cU, QueueTypes as cV, type QueueTypeTS as cW, type QueueTypeOptionTS as cX, type QueueType as cY, QueueTypeSkill as cZ, QueueTypePriority as c_, type StartAgentSessionRequest as ca, type StartAgentSessionResponse as cb, type EndAgentSessionRequest as cc, type EndAgentSessionResponse as cd, type UpdateAgentStatusRequest as ce, type UpdateAgentStatusResponse as cf, type UpdateAgentLastActivityRequest as cg, type UpdateAgentLastActivityResponse as ch, type AssignChatToAgentRequest as ci, type AssignChatToAgentResponse as cj, type CompleteChatByAgentRequest as ck, type CompleteChatByAgentResponse as cl, type GetAgentSessionRequest as cm, type GetAgentSessionResponse as cn, type GetOnlineAgentsRequest as co, type GetOnlineAgentsResponse as cp, type GetOnlineAgentCountRequest as cq, type GetOnlineAgentCountResponse as cr, type GetQueueChatsRequest as cs, type GetQueueChatsResponse as ct, type GetQueueChatCountRequest as cu, type GetQueueChatCountResponse as cv, type UserStatusTS as cw, type UserStatus as cx, UserStatusOnline as cy, UserStatusAway as cz, type UseWebSocketChatBaseReturn as d, QueueTypeComplexity as d0, type AgentQueue as d1, type GetAgentQueuesFilter as d2, type CreateAgentQueueRequest as d3, type CreateAgentQueueResponse as d4, type GetAgentQueuesRequest as d5, type GetAgentQueuesResponse as d6, type UpdateAgentQueueRequest as d7, type UpdateAgentQueueResponse as d8, type DeleteAgentQueueRequest as d9, UpdateUserStatusSubject as dA, GetOnlineUsersSubject as dB, TriggerAnalyticsScanSubject as dC, SetupOrgSubject as dD, type DeleteAgentQueueResponse as da, type ChatQueueInfo as db, GetWaitingForAgentChatCountSubject as dc, GetActiveChatCountSubject as dd, GetWaitingForAgentChatsSubject as de, GetActiveChatsSubject as df, GetUserChatsSubject as dg, GetChatSubject as dh, ChatArchiveSubjectPattern as di, StartAgentSessionSubject as dj, EndAgentSessionSubject as dk, UpdateAgentStatusSubject as dl, UpdateAgentLastActivitySubject as dm, AssignChatToAgentSubject as dn, CompleteChatByAgentSubject as dp, GetAgentSessionSubject as dq, GetOnlineAgentsSubject as dr, GetOnlineAgentCountSubject as ds, CreateAgentQueueSubject as dt, GetAgentQueuesSubject as du, UpdateAgentQueueSubject as dv, DeleteAgentQueueSubject as dw, GetQueueChatsSubject as dx, GetQueueChatCountSubject as dy, GetDailyChatCountSubject as dz, type ChatStatusTS as e, type ChatStatus as f, ChatStatusActive as g, ChatStatusDisconnected as h, ChatStatusAbandoned as i, ChatStatusClosed as j, ChatStatusArchived as k, type ChatTypeTS as l, type ChatType as m, ChatTypeCustomerSupport as n, ChatTypePublicRoom as o, ChatTypePrivateRoom as p, ChatTypeDirect as q, ChatTypeGroup as r, type ChatContext as s, type ChatFlow as t, useWebSocketChatBase as u, type ChatTool as v, type ChatRoleTS as w, type ChatRole as x, ChatRoleUser as y, ChatRoleAI as z };
925
+ export { type Action, type AgentQueue, type AgentSession, type AgentStatus, AgentStatusAway, AgentStatusBusy, AgentStatusOffline, AgentStatusOnline, type AgentStatusTS, type AssignChatToAgentRequest, type AssignChatToAgentResponse, AssignChatToAgentSubject, type Attachment, type AttachmentFile, type AttachmentType, AttachmentTypeActions, AttachmentTypeArticles, AttachmentTypeAudio, AttachmentTypeBullets, AttachmentTypeData, AttachmentTypeDocument, AttachmentTypeDocumentAnalysis, AttachmentTypeDocumentSources, AttachmentTypeImage, AttachmentTypeKGNodes, AttachmentTypeLocation, AttachmentTypeRecords, AttachmentTypeReferences, AttachmentTypeSticker, AttachmentTypeSubsections, type AttachmentTypeTS, AttachmentTypeVideo, type Chat, type ChatArchivalRequest, type ChatArchivalResponse, ChatArchiveSubjectPattern, type ChatContext, type ChatEvent, type ChatEventType, ChatEventTypeAgentActivityPing, ChatEventTypeAgentChatAssigned, ChatEventTypeAgentChatCompleted, ChatEventTypeAgentContextUpdate, ChatEventTypeAgentExecutionEnded, ChatEventTypeAgentExecutionStarted, ChatEventTypeAgentSessionEnd, ChatEventTypeAgentSessionStart, ChatEventTypeAgentStatusChange, ChatEventTypeBlockUser, ChatEventTypeCSATRequest, ChatEventTypeCSATResponse, ChatEventTypeCSATSurvey, ChatEventTypeChatEnded, ChatEventTypeChatRemoved, ChatEventTypeChatUpdated, ChatEventTypeClientAction, ChatEventTypeClientActionCallback, ChatEventTypeCreateRoom, ChatEventTypeDeleteRoom, ChatEventTypeDelivered, ChatEventTypeEndChat, ChatEventTypeError, ChatEventTypeGetAgents, ChatEventTypeGetAgentsResponse, ChatEventTypeGetOnlineUsers, ChatEventTypeHumanAgentJoined, ChatEventTypeHumanAgentLeft, ChatEventTypeInviteUser, ChatEventTypeJoinRoom, ChatEventTypeLeaveRoom, ChatEventTypeListChats, ChatEventTypeListRooms, ChatEventTypeLoadAgentContext, ChatEventTypeLoadAgentContextResponse, ChatEventTypeLoadChat, ChatEventTypeLoadChatResponse, ChatEventTypeMentionUser, ChatEventTypeMessage, ChatEventTypeMessageDeleted, ChatEventTypeMessageDeletedResponse, ChatEventTypeMessageEdited, ChatEventTypeMessageEditedResponse, ChatEventTypeMessageReaction, ChatEventTypeMessageReactionResponse, ChatEventTypeMessageReply, ChatEventTypeMessageStatusUpdate, ChatEventTypeNewChat, ChatEventTypeNewChatCreated, ChatEventTypeObserverJoined, ChatEventTypeObserverLeft, ChatEventTypeOnlineUsersResponse, ChatEventTypePing, ChatEventTypePlanApproved, ChatEventTypePlanCompleted, ChatEventTypePlanPendingApproval, ChatEventTypePlanRejected, ChatEventTypePong, ChatEventTypeRead, ChatEventTypeReconnected, ChatEventTypeRoomCreated, ChatEventTypeRoomDeleted, ChatEventTypeRoomUpdated, ChatEventTypeRoomUserJoined, ChatEventTypeRoomUserLeft, ChatEventTypeRoomsResponse, ChatEventTypeStepCompleted, ChatEventTypeStepFailed, ChatEventTypeStepStarted, ChatEventTypeStoppedTyping, ChatEventTypeSummaryUpdate, ChatEventTypeSyncMetadata, ChatEventTypeSyncMetadataResponse, ChatEventTypeSyncUserSession, ChatEventTypeSyncUserSessionResponse, type ChatEventTypeTS, ChatEventTypeTyping, ChatEventTypeUpdateRoom, ChatEventTypeUserActivity, ChatEventTypeUserActivityUpdate, ChatEventTypeUserInvited, ChatEventTypeUserJoined, ChatEventTypeUserLeft, ChatEventTypeUserPresenceChanged, ChatEventTypeUserPresenceEnd, ChatEventTypeUserPresenceStart, ChatEventTypeUserRemoved, ChatEventTypeUserStatusChange, ChatEventTypeUserSuggestedActionSelected, ChatEventTypeUserSuggestedActions, ChatEventTypeWaiting, ChatEventTypeWaitingForAgent, type ChatFlow, type ChatGrading, type ChatMessage, type ChatProductReference, type ChatQueueInfo, type ChatRateLimits, type ChatRole, ChatRoleAI, ChatRoleDataQuery, ChatRoleEvent, ChatRoleHumanAgent, ChatRoleObserver, ChatRoleSystem, type ChatRoleTS, ChatRoleTool, ChatRoleUser, type ChatSession, type ChatSessionPreferences, type ChatSessionStatus, ChatSessionStatusActive, ChatSessionStatusExpired, ChatSessionStatusIdle, type ChatStatus, ChatStatusAbandoned, ChatStatusActive, ChatStatusArchived, ChatStatusClosed, ChatStatusDisconnected, type ChatStatusTS, type ChatSummary, type ChatTool, type ChatType, ChatTypeCustomerSupport, ChatTypeDirect, ChatTypeGroup, ChatTypePrivateRoom, ChatTypePublicRoom, type ChatTypeTS, type ChatUser, type CompleteChatByAgentRequest, type CompleteChatByAgentResponse, CompleteChatByAgentSubject, type CreateAgentQueueRequest, type CreateAgentQueueResponse, CreateAgentQueueSubject, type DeleteAgentQueueRequest, type DeleteAgentQueueResponse, DeleteAgentQueueSubject, type DocumentSource, type EmojiReaction, type EndAgentSessionRequest, type EndAgentSessionResponse, EndAgentSessionSubject, type GetActiveChatCountRequest, type GetActiveChatCountResponse, GetActiveChatCountSubject, type GetActiveChatsRequest, type GetActiveChatsResponse, GetActiveChatsSubject, type GetAgentQueuesFilter, type GetAgentQueuesRequest, type GetAgentQueuesResponse, GetAgentQueuesSubject, type GetAgentSessionRequest, type GetAgentSessionResponse, GetAgentSessionSubject, type GetChatRequest, type GetChatResponse, GetChatSubject, type GetDailyChatCountRequest, type GetDailyChatCountResponse, GetDailyChatCountSubject, type GetOnlineAgentCountRequest, type GetOnlineAgentCountResponse, GetOnlineAgentCountSubject, type GetOnlineAgentsRequest, type GetOnlineAgentsResponse, GetOnlineAgentsSubject, type GetOnlineUsersRequest, type GetOnlineUsersResponse, GetOnlineUsersSubject, type GetQueueChatCountRequest, type GetQueueChatCountResponse, GetQueueChatCountSubject, type GetQueueChatsRequest, type GetQueueChatsResponse, GetQueueChatsSubject, type GetUserChatsRequest, type GetUserChatsResponse, GetUserChatsSubject, type GetWaitingForAgentChatCountRequest, type GetWaitingForAgentChatCountResponse, GetWaitingForAgentChatCountSubject, type GetWaitingForAgentChatsRequest, type GetWaitingForAgentChatsResponse, GetWaitingForAgentChatsSubject, type LLMConfig, type LLMFunction, type LLMMemoryConfig, type LLMResponse, type LLMTool, type LLMUsage, type Location, type MessageStatus, MessageStatusDelivered, MessageStatusFailed, MessageStatusRead, MessageStatusSending, MessageStatusSent, type MessageStatusTS, type QueueType, QueueTypeComplexity, QueueTypeDepartment, type QueueTypeOptionTS, QueueTypePriority, QueueTypeSkill, type QueueTypeTS, QueueTypes, SetupOrgSubject, type StartAgentSessionRequest, type StartAgentSessionResponse, StartAgentSessionSubject, type ToolCall, type TriggerAnalyticsScanRequest, type TriggerAnalyticsScanResponse, TriggerAnalyticsScanSubject, type UpdateAgentLastActivityRequest, type UpdateAgentLastActivityResponse, UpdateAgentLastActivitySubject, type UpdateAgentQueueRequest, type UpdateAgentQueueResponse, UpdateAgentQueueSubject, type UpdateAgentStatusRequest, type UpdateAgentStatusResponse, UpdateAgentStatusSubject, type UpdateUserStatusRequest, type UpdateUserStatusResponse, UpdateUserStatusSubject, type UserSession, type UserStatus, UserStatusAway, UserStatusBusy, UserStatusOffline, UserStatusOnline, type UserStatusTS };
@@ -1,5 +1,5 @@
1
- import { Variable, ResponseMetadata, ProductNameTS } from '@elqnt/types';
2
1
  import { KGNode } from '@elqnt/kg';
2
+ import { Variable, ResponseMetadata } from '@elqnt/types';
3
3
  import { DocumentAnalysisResult, BoundingRegion, PageInfo } from '@elqnt/docs';
4
4
 
5
5
  type ChatStatusTS = 'active' | 'disconnected' | 'abandoned' | 'closed' | 'archived';
@@ -922,68 +922,4 @@ declare const TriggerAnalyticsScanSubject = "chat.analytics.trigger-scan";
922
922
  */
923
923
  declare const SetupOrgSubject = "chat.org.setup";
924
924
 
925
- type ConnectionState = "disconnected" | "connecting" | "connected" | "reconnecting";
926
- interface WebSocketError {
927
- code: "CONNECTION_FAILED" | "PARSE_ERROR" | "SEND_FAILED" | "TIMEOUT" | "NETWORK_ERROR";
928
- message: string;
929
- retryable: boolean;
930
- timestamp: number;
931
- }
932
- interface RetryConfig {
933
- maxRetries?: number;
934
- intervals?: number[];
935
- backoffMultiplier?: number;
936
- maxBackoffTime?: number;
937
- }
938
- interface ConnectionMetrics {
939
- latency: number;
940
- messagesSent: number;
941
- messagesReceived: number;
942
- messagesQueued: number;
943
- reconnectCount: number;
944
- lastError?: WebSocketError;
945
- connectedAt?: number;
946
- lastMessageAt?: number;
947
- }
948
- interface QueueConfig {
949
- maxSize?: number;
950
- dropStrategy?: "oldest" | "newest";
951
- }
952
- interface Logger {
953
- debug: (message: string, ...args: any[]) => void;
954
- info: (message: string, ...args: any[]) => void;
955
- warn: (message: string, ...args: any[]) => void;
956
- error: (message: string, ...args: any[]) => void;
957
- }
958
- interface UseWebSocketChatBaseConfig {
959
- serverBaseUrl: string;
960
- orgId: string;
961
- clientType: "customer" | "humanAgent" | "observer";
962
- product: ProductNameTS;
963
- onMessage?: (event: ChatEvent) => void;
964
- retryConfig?: RetryConfig;
965
- queueConfig?: QueueConfig;
966
- debug?: boolean;
967
- logger?: Logger;
968
- heartbeatInterval?: number;
969
- heartbeatTimeout?: number;
970
- }
971
- interface UseWebSocketChatBaseReturn {
972
- connectionState: ConnectionState;
973
- isConnected: boolean;
974
- sendMessage: (event: Omit<ChatEvent, "timestamp">, overrideUserId?: string) => Promise<void>;
975
- error: WebSocketError | undefined;
976
- connect: (userId: string) => Promise<void>;
977
- startNewChat: (userId: string, data?: {
978
- [key: string]: any;
979
- }) => Promise<string>;
980
- startTime: Date | undefined;
981
- disconnect: (intentional?: boolean) => void;
982
- metrics: ConnectionMetrics;
983
- on: (eventType: string, handler: (data: any) => void) => () => void;
984
- off: (eventType: string, handler: (data: any) => void) => void;
985
- clearError: () => void;
986
- }
987
- declare const useWebSocketChatBase: ({ serverBaseUrl, orgId, clientType, product, onMessage, retryConfig, queueConfig, debug, logger, heartbeatInterval, heartbeatTimeout, }: UseWebSocketChatBaseConfig) => UseWebSocketChatBaseReturn;
988
-
989
- export { ChatEventTypeReconnected as $, ChatRoleEvent as A, ChatRoleHumanAgent as B, type Chat as C, ChatRoleObserver as D, ChatRoleDataQuery as E, ChatRoleSystem as F, ChatRoleTool as G, type ChatUser as H, type AgentStatusTS as I, type AgentStatus as J, AgentStatusOnline as K, type Logger as L, AgentStatusAway as M, AgentStatusBusy as N, AgentStatusOffline as O, type AgentSession as P, type QueueConfig as Q, type RetryConfig as R, type ChatEventType as S, ChatEventTypeUserJoined as T, type UseWebSocketChatBaseConfig as U, ChatEventTypeUserLeft as V, type WebSocketError as W, ChatEventTypeTyping as X, ChatEventTypeStoppedTyping as Y, ChatEventTypeRead as Z, ChatEventTypeDelivered as _, type ChatMessage as a, ChatEventTypeCSATSurvey as a$, ChatEventTypeError as a0, ChatEventTypeWaiting as a1, ChatEventTypeLoadChat as a2, ChatEventTypeLoadChatResponse as a3, ChatEventTypeMessage as a4, ChatEventTypeWaitingForAgent as a5, ChatEventTypeMessageStatusUpdate as a6, ChatEventTypeHumanAgentJoined as a7, ChatEventTypeHumanAgentLeft as a8, ChatEventTypeObserverJoined as a9, ChatEventTypeMessageEdited as aA, ChatEventTypeMessageDeleted as aB, ChatEventTypeMessageReaction as aC, ChatEventTypeMessageReply as aD, ChatEventTypeMentionUser as aE, ChatEventTypeMessageEditedResponse as aF, ChatEventTypeMessageDeletedResponse as aG, ChatEventTypeMessageReactionResponse as aH, ChatEventTypeUserPresenceStart as aI, ChatEventTypeUserPresenceEnd as aJ, ChatEventTypeUserStatusChange as aK, ChatEventTypeUserActivity as aL, ChatEventTypeUserPresenceChanged as aM, ChatEventTypeUserActivityUpdate as aN, ChatEventTypeGetOnlineUsers as aO, ChatEventTypeOnlineUsersResponse as aP, ChatEventTypeEndChat as aQ, ChatEventTypeChatEnded as aR, ChatEventTypeAgentSessionStart as aS, ChatEventTypeAgentSessionEnd as aT, ChatEventTypeAgentStatusChange as aU, ChatEventTypeAgentActivityPing as aV, ChatEventTypeAgentChatAssigned as aW, ChatEventTypeAgentChatCompleted as aX, ChatEventTypeGetAgents as aY, ChatEventTypeGetAgentsResponse as aZ, ChatEventTypeCSATRequest as a_, ChatEventTypeObserverLeft as aa, ChatEventTypeListChats as ab, ChatEventTypeChatUpdated as ac, ChatEventTypeChatRemoved as ad, ChatEventTypeSyncMetadata as ae, ChatEventTypeSyncMetadataResponse as af, ChatEventTypeSyncUserSession as ag, ChatEventTypeSyncUserSessionResponse as ah, ChatEventTypeClientAction as ai, ChatEventTypeClientActionCallback as aj, ChatEventTypeBlockUser as ak, ChatEventTypeCreateRoom as al, ChatEventTypeRoomCreated as am, ChatEventTypeJoinRoom as an, ChatEventTypeLeaveRoom as ao, ChatEventTypeDeleteRoom as ap, ChatEventTypeRoomDeleted as aq, ChatEventTypeUpdateRoom as ar, ChatEventTypeRoomUpdated as as, ChatEventTypeInviteUser as at, ChatEventTypeUserInvited as au, ChatEventTypeRoomUserJoined as av, ChatEventTypeRoomUserLeft as aw, ChatEventTypeUserRemoved as ax, ChatEventTypeListRooms as ay, ChatEventTypeRoomsResponse as az, type ConnectionState as b, type LLMTool as b$, ChatEventTypeCSATResponse as b0, ChatEventTypeUserSuggestedActions as b1, ChatEventTypeUserSuggestedActionSelected as b2, ChatEventTypeSummaryUpdate as b3, ChatEventTypeAgentContextUpdate as b4, ChatEventTypeAgentExecutionStarted as b5, ChatEventTypeAgentExecutionEnded as b6, ChatEventTypeLoadAgentContext as b7, ChatEventTypeLoadAgentContextResponse as b8, ChatEventTypePlanPendingApproval as b9, AttachmentTypeVideo as bA, AttachmentTypeLocation as bB, AttachmentTypeReferences as bC, AttachmentTypeSubsections as bD, AttachmentTypeArticles as bE, AttachmentTypeRecords as bF, AttachmentTypeActions as bG, AttachmentTypeBullets as bH, AttachmentTypeSticker as bI, AttachmentTypeData as bJ, AttachmentTypeKGNodes as bK, AttachmentTypeDocumentSources as bL, type AttachmentTypeTS as bM, type DocumentSource as bN, type Attachment as bO, type Action as bP, type ChatEvent as bQ, type ChatGrading as bR, type ChatSession as bS, type ChatSessionStatus as bT, ChatSessionStatusActive as bU, ChatSessionStatusIdle as bV, ChatSessionStatusExpired as bW, type ChatSessionPreferences as bX, type ChatRateLimits as bY, type LLMConfig as bZ, type LLMMemoryConfig as b_, ChatEventTypePlanApproved as ba, ChatEventTypePlanRejected as bb, ChatEventTypePlanCompleted as bc, ChatEventTypeStepStarted as bd, ChatEventTypeStepCompleted as be, ChatEventTypeStepFailed as bf, ChatEventTypeNewChat as bg, ChatEventTypeNewChatCreated as bh, ChatEventTypePing as bi, ChatEventTypePong as bj, type ChatEventTypeTS as bk, type MessageStatus as bl, MessageStatusSending as bm, MessageStatusSent as bn, MessageStatusDelivered as bo, MessageStatusRead as bp, MessageStatusFailed as bq, type MessageStatusTS as br, type EmojiReaction as bs, type Location as bt, type AttachmentFile as bu, type AttachmentType as bv, AttachmentTypeDocument as bw, AttachmentTypeDocumentAnalysis as bx, AttachmentTypeImage as by, AttachmentTypeAudio as bz, type ConnectionMetrics as c, QueueTypeDepartment as c$, type LLMFunction as c0, type ToolCall as c1, type LLMResponse as c2, type LLMUsage as c3, type ChatSummary as c4, type GetChatRequest as c5, type GetChatResponse as c6, type ChatProductReference as c7, type ChatArchivalRequest as c8, type ChatArchivalResponse as c9, UserStatusBusy as cA, UserStatusOffline as cB, type UserSession as cC, type UpdateUserStatusRequest as cD, type UpdateUserStatusResponse as cE, type GetOnlineUsersRequest as cF, type GetOnlineUsersResponse as cG, type TriggerAnalyticsScanRequest as cH, type TriggerAnalyticsScanResponse as cI, type GetActiveChatCountRequest as cJ, type GetActiveChatCountResponse as cK, type GetActiveChatsRequest as cL, type GetActiveChatsResponse as cM, type GetWaitingForAgentChatCountRequest as cN, type GetWaitingForAgentChatCountResponse as cO, type GetWaitingForAgentChatsRequest as cP, type GetWaitingForAgentChatsResponse as cQ, type GetUserChatsRequest as cR, type GetUserChatsResponse as cS, type GetDailyChatCountRequest as cT, type GetDailyChatCountResponse as cU, QueueTypes as cV, type QueueTypeTS as cW, type QueueTypeOptionTS as cX, type QueueType as cY, QueueTypeSkill as cZ, QueueTypePriority as c_, type StartAgentSessionRequest as ca, type StartAgentSessionResponse as cb, type EndAgentSessionRequest as cc, type EndAgentSessionResponse as cd, type UpdateAgentStatusRequest as ce, type UpdateAgentStatusResponse as cf, type UpdateAgentLastActivityRequest as cg, type UpdateAgentLastActivityResponse as ch, type AssignChatToAgentRequest as ci, type AssignChatToAgentResponse as cj, type CompleteChatByAgentRequest as ck, type CompleteChatByAgentResponse as cl, type GetAgentSessionRequest as cm, type GetAgentSessionResponse as cn, type GetOnlineAgentsRequest as co, type GetOnlineAgentsResponse as cp, type GetOnlineAgentCountRequest as cq, type GetOnlineAgentCountResponse as cr, type GetQueueChatsRequest as cs, type GetQueueChatsResponse as ct, type GetQueueChatCountRequest as cu, type GetQueueChatCountResponse as cv, type UserStatusTS as cw, type UserStatus as cx, UserStatusOnline as cy, UserStatusAway as cz, type UseWebSocketChatBaseReturn as d, QueueTypeComplexity as d0, type AgentQueue as d1, type GetAgentQueuesFilter as d2, type CreateAgentQueueRequest as d3, type CreateAgentQueueResponse as d4, type GetAgentQueuesRequest as d5, type GetAgentQueuesResponse as d6, type UpdateAgentQueueRequest as d7, type UpdateAgentQueueResponse as d8, type DeleteAgentQueueRequest as d9, UpdateUserStatusSubject as dA, GetOnlineUsersSubject as dB, TriggerAnalyticsScanSubject as dC, SetupOrgSubject as dD, type DeleteAgentQueueResponse as da, type ChatQueueInfo as db, GetWaitingForAgentChatCountSubject as dc, GetActiveChatCountSubject as dd, GetWaitingForAgentChatsSubject as de, GetActiveChatsSubject as df, GetUserChatsSubject as dg, GetChatSubject as dh, ChatArchiveSubjectPattern as di, StartAgentSessionSubject as dj, EndAgentSessionSubject as dk, UpdateAgentStatusSubject as dl, UpdateAgentLastActivitySubject as dm, AssignChatToAgentSubject as dn, CompleteChatByAgentSubject as dp, GetAgentSessionSubject as dq, GetOnlineAgentsSubject as dr, GetOnlineAgentCountSubject as ds, CreateAgentQueueSubject as dt, GetAgentQueuesSubject as du, UpdateAgentQueueSubject as dv, DeleteAgentQueueSubject as dw, GetQueueChatsSubject as dx, GetQueueChatCountSubject as dy, GetDailyChatCountSubject as dz, type ChatStatusTS as e, type ChatStatus as f, ChatStatusActive as g, ChatStatusDisconnected as h, ChatStatusAbandoned as i, ChatStatusClosed as j, ChatStatusArchived as k, type ChatTypeTS as l, type ChatType as m, ChatTypeCustomerSupport as n, ChatTypePublicRoom as o, ChatTypePrivateRoom as p, ChatTypeDirect as q, ChatTypeGroup as r, type ChatContext as s, type ChatFlow as t, useWebSocketChatBase as u, type ChatTool as v, type ChatRoleTS as w, type ChatRole as x, ChatRoleUser as y, ChatRoleAI as z };
925
+ export { type Action, type AgentQueue, type AgentSession, type AgentStatus, AgentStatusAway, AgentStatusBusy, AgentStatusOffline, AgentStatusOnline, type AgentStatusTS, type AssignChatToAgentRequest, type AssignChatToAgentResponse, AssignChatToAgentSubject, type Attachment, type AttachmentFile, type AttachmentType, AttachmentTypeActions, AttachmentTypeArticles, AttachmentTypeAudio, AttachmentTypeBullets, AttachmentTypeData, AttachmentTypeDocument, AttachmentTypeDocumentAnalysis, AttachmentTypeDocumentSources, AttachmentTypeImage, AttachmentTypeKGNodes, AttachmentTypeLocation, AttachmentTypeRecords, AttachmentTypeReferences, AttachmentTypeSticker, AttachmentTypeSubsections, type AttachmentTypeTS, AttachmentTypeVideo, type Chat, type ChatArchivalRequest, type ChatArchivalResponse, ChatArchiveSubjectPattern, type ChatContext, type ChatEvent, type ChatEventType, ChatEventTypeAgentActivityPing, ChatEventTypeAgentChatAssigned, ChatEventTypeAgentChatCompleted, ChatEventTypeAgentContextUpdate, ChatEventTypeAgentExecutionEnded, ChatEventTypeAgentExecutionStarted, ChatEventTypeAgentSessionEnd, ChatEventTypeAgentSessionStart, ChatEventTypeAgentStatusChange, ChatEventTypeBlockUser, ChatEventTypeCSATRequest, ChatEventTypeCSATResponse, ChatEventTypeCSATSurvey, ChatEventTypeChatEnded, ChatEventTypeChatRemoved, ChatEventTypeChatUpdated, ChatEventTypeClientAction, ChatEventTypeClientActionCallback, ChatEventTypeCreateRoom, ChatEventTypeDeleteRoom, ChatEventTypeDelivered, ChatEventTypeEndChat, ChatEventTypeError, ChatEventTypeGetAgents, ChatEventTypeGetAgentsResponse, ChatEventTypeGetOnlineUsers, ChatEventTypeHumanAgentJoined, ChatEventTypeHumanAgentLeft, ChatEventTypeInviteUser, ChatEventTypeJoinRoom, ChatEventTypeLeaveRoom, ChatEventTypeListChats, ChatEventTypeListRooms, ChatEventTypeLoadAgentContext, ChatEventTypeLoadAgentContextResponse, ChatEventTypeLoadChat, ChatEventTypeLoadChatResponse, ChatEventTypeMentionUser, ChatEventTypeMessage, ChatEventTypeMessageDeleted, ChatEventTypeMessageDeletedResponse, ChatEventTypeMessageEdited, ChatEventTypeMessageEditedResponse, ChatEventTypeMessageReaction, ChatEventTypeMessageReactionResponse, ChatEventTypeMessageReply, ChatEventTypeMessageStatusUpdate, ChatEventTypeNewChat, ChatEventTypeNewChatCreated, ChatEventTypeObserverJoined, ChatEventTypeObserverLeft, ChatEventTypeOnlineUsersResponse, ChatEventTypePing, ChatEventTypePlanApproved, ChatEventTypePlanCompleted, ChatEventTypePlanPendingApproval, ChatEventTypePlanRejected, ChatEventTypePong, ChatEventTypeRead, ChatEventTypeReconnected, ChatEventTypeRoomCreated, ChatEventTypeRoomDeleted, ChatEventTypeRoomUpdated, ChatEventTypeRoomUserJoined, ChatEventTypeRoomUserLeft, ChatEventTypeRoomsResponse, ChatEventTypeStepCompleted, ChatEventTypeStepFailed, ChatEventTypeStepStarted, ChatEventTypeStoppedTyping, ChatEventTypeSummaryUpdate, ChatEventTypeSyncMetadata, ChatEventTypeSyncMetadataResponse, ChatEventTypeSyncUserSession, ChatEventTypeSyncUserSessionResponse, type ChatEventTypeTS, ChatEventTypeTyping, ChatEventTypeUpdateRoom, ChatEventTypeUserActivity, ChatEventTypeUserActivityUpdate, ChatEventTypeUserInvited, ChatEventTypeUserJoined, ChatEventTypeUserLeft, ChatEventTypeUserPresenceChanged, ChatEventTypeUserPresenceEnd, ChatEventTypeUserPresenceStart, ChatEventTypeUserRemoved, ChatEventTypeUserStatusChange, ChatEventTypeUserSuggestedActionSelected, ChatEventTypeUserSuggestedActions, ChatEventTypeWaiting, ChatEventTypeWaitingForAgent, type ChatFlow, type ChatGrading, type ChatMessage, type ChatProductReference, type ChatQueueInfo, type ChatRateLimits, type ChatRole, ChatRoleAI, ChatRoleDataQuery, ChatRoleEvent, ChatRoleHumanAgent, ChatRoleObserver, ChatRoleSystem, type ChatRoleTS, ChatRoleTool, ChatRoleUser, type ChatSession, type ChatSessionPreferences, type ChatSessionStatus, ChatSessionStatusActive, ChatSessionStatusExpired, ChatSessionStatusIdle, type ChatStatus, ChatStatusAbandoned, ChatStatusActive, ChatStatusArchived, ChatStatusClosed, ChatStatusDisconnected, type ChatStatusTS, type ChatSummary, type ChatTool, type ChatType, ChatTypeCustomerSupport, ChatTypeDirect, ChatTypeGroup, ChatTypePrivateRoom, ChatTypePublicRoom, type ChatTypeTS, type ChatUser, type CompleteChatByAgentRequest, type CompleteChatByAgentResponse, CompleteChatByAgentSubject, type CreateAgentQueueRequest, type CreateAgentQueueResponse, CreateAgentQueueSubject, type DeleteAgentQueueRequest, type DeleteAgentQueueResponse, DeleteAgentQueueSubject, type DocumentSource, type EmojiReaction, type EndAgentSessionRequest, type EndAgentSessionResponse, EndAgentSessionSubject, type GetActiveChatCountRequest, type GetActiveChatCountResponse, GetActiveChatCountSubject, type GetActiveChatsRequest, type GetActiveChatsResponse, GetActiveChatsSubject, type GetAgentQueuesFilter, type GetAgentQueuesRequest, type GetAgentQueuesResponse, GetAgentQueuesSubject, type GetAgentSessionRequest, type GetAgentSessionResponse, GetAgentSessionSubject, type GetChatRequest, type GetChatResponse, GetChatSubject, type GetDailyChatCountRequest, type GetDailyChatCountResponse, GetDailyChatCountSubject, type GetOnlineAgentCountRequest, type GetOnlineAgentCountResponse, GetOnlineAgentCountSubject, type GetOnlineAgentsRequest, type GetOnlineAgentsResponse, GetOnlineAgentsSubject, type GetOnlineUsersRequest, type GetOnlineUsersResponse, GetOnlineUsersSubject, type GetQueueChatCountRequest, type GetQueueChatCountResponse, GetQueueChatCountSubject, type GetQueueChatsRequest, type GetQueueChatsResponse, GetQueueChatsSubject, type GetUserChatsRequest, type GetUserChatsResponse, GetUserChatsSubject, type GetWaitingForAgentChatCountRequest, type GetWaitingForAgentChatCountResponse, GetWaitingForAgentChatCountSubject, type GetWaitingForAgentChatsRequest, type GetWaitingForAgentChatsResponse, GetWaitingForAgentChatsSubject, type LLMConfig, type LLMFunction, type LLMMemoryConfig, type LLMResponse, type LLMTool, type LLMUsage, type Location, type MessageStatus, MessageStatusDelivered, MessageStatusFailed, MessageStatusRead, MessageStatusSending, MessageStatusSent, type MessageStatusTS, type QueueType, QueueTypeComplexity, QueueTypeDepartment, type QueueTypeOptionTS, QueueTypePriority, QueueTypeSkill, type QueueTypeTS, QueueTypes, SetupOrgSubject, type StartAgentSessionRequest, type StartAgentSessionResponse, StartAgentSessionSubject, type ToolCall, type TriggerAnalyticsScanRequest, type TriggerAnalyticsScanResponse, TriggerAnalyticsScanSubject, type UpdateAgentLastActivityRequest, type UpdateAgentLastActivityResponse, UpdateAgentLastActivitySubject, type UpdateAgentQueueRequest, type UpdateAgentQueueResponse, UpdateAgentQueueSubject, type UpdateAgentStatusRequest, type UpdateAgentStatusResponse, UpdateAgentStatusSubject, type UpdateUserStatusRequest, type UpdateUserStatusResponse, UpdateUserStatusSubject, type UserSession, type UserStatus, UserStatusAway, UserStatusBusy, UserStatusOffline, UserStatusOnline, type UserStatusTS };