@elqnt/chat 3.0.3 → 3.3.0
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.
- package/dist/api/index.d.mts +17 -2
- package/dist/api/index.d.ts +17 -2
- package/dist/api/index.js +44 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +35 -14
- package/dist/api/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +40 -5
- package/dist/hooks/index.d.ts +40 -5
- package/dist/hooks/index.js +179 -18
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +178 -18
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +194 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -18
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +129 -2
- package/dist/models/index.d.ts +129 -2
- package/dist/models/index.js +15 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +10 -0
- package/dist/models/index.mjs.map +1 -1
- package/dist/transport/index.js +72 -5
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +72 -5
- package/dist/transport/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -128,6 +128,7 @@ __export(index_exports, {
|
|
|
128
128
|
ChatEventTypeSyncMetadataResponse: () => ChatEventTypeSyncMetadataResponse,
|
|
129
129
|
ChatEventTypeSyncUserSession: () => ChatEventTypeSyncUserSession,
|
|
130
130
|
ChatEventTypeSyncUserSessionResponse: () => ChatEventTypeSyncUserSessionResponse,
|
|
131
|
+
ChatEventTypeTransportReconnected: () => ChatEventTypeTransportReconnected,
|
|
131
132
|
ChatEventTypeTyping: () => ChatEventTypeTyping,
|
|
132
133
|
ChatEventTypeUpdateRoom: () => ChatEventTypeUpdateRoom,
|
|
133
134
|
ChatEventTypeUserActivity: () => ChatEventTypeUserActivity,
|
|
@@ -166,6 +167,7 @@ __export(index_exports, {
|
|
|
166
167
|
ChatTypeGroup: () => ChatTypeGroup,
|
|
167
168
|
ChatTypePrivateRoom: () => ChatTypePrivateRoom,
|
|
168
169
|
ChatTypePublicRoom: () => ChatTypePublicRoom,
|
|
170
|
+
CloseAndDeleteChatSubject: () => CloseAndDeleteChatSubject,
|
|
169
171
|
CompleteChatByAgentSubject: () => CompleteChatByAgentSubject,
|
|
170
172
|
CreateAgentQueueSubject: () => CreateAgentQueueSubject,
|
|
171
173
|
DeleteAgentQueueSubject: () => DeleteAgentQueueSubject,
|
|
@@ -185,6 +187,8 @@ __export(index_exports, {
|
|
|
185
187
|
GetUserChatsSubject: () => GetUserChatsSubject,
|
|
186
188
|
GetWaitingForAgentChatCountSubject: () => GetWaitingForAgentChatCountSubject,
|
|
187
189
|
GetWaitingForAgentChatsSubject: () => GetWaitingForAgentChatsSubject,
|
|
190
|
+
ListIdleChatsSubject: () => ListIdleChatsSubject,
|
|
191
|
+
MarkChatClosedSubject: () => MarkChatClosedSubject,
|
|
188
192
|
MessageStatusDelivered: () => MessageStatusDelivered,
|
|
189
193
|
MessageStatusFailed: () => MessageStatusFailed,
|
|
190
194
|
MessageStatusRead: () => MessageStatusRead,
|
|
@@ -198,6 +202,7 @@ __export(index_exports, {
|
|
|
198
202
|
SetupOrgSubject: () => SetupOrgSubject,
|
|
199
203
|
StartAgentSessionSubject: () => StartAgentSessionSubject,
|
|
200
204
|
TriggerAnalyticsScanSubject: () => TriggerAnalyticsScanSubject,
|
|
205
|
+
TriggerMemorySummarizationSubject: () => TriggerMemorySummarizationSubject,
|
|
201
206
|
UpdateAgentLastActivitySubject: () => UpdateAgentLastActivitySubject,
|
|
202
207
|
UpdateAgentQueueSubject: () => UpdateAgentQueueSubject,
|
|
203
208
|
UpdateAgentStatusSubject: () => UpdateAgentStatusSubject,
|
|
@@ -211,6 +216,7 @@ __export(index_exports, {
|
|
|
211
216
|
useChatHistory: () => useChatHistory,
|
|
212
217
|
useChatMonitoring: () => useChatMonitoring,
|
|
213
218
|
useHumanAgentSessions: () => useHumanAgentSessions,
|
|
219
|
+
useMemory: () => useMemory,
|
|
214
220
|
useOptionsRef: () => useOptionsRef
|
|
215
221
|
});
|
|
216
222
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -327,6 +333,7 @@ function createSSETransport(options = {}) {
|
|
|
327
333
|
function setupEventListeners(es) {
|
|
328
334
|
es.addEventListener("message", handleMessage);
|
|
329
335
|
const eventTypes = [
|
|
336
|
+
"error",
|
|
330
337
|
"reconnected",
|
|
331
338
|
"typing",
|
|
332
339
|
"stopped_typing",
|
|
@@ -336,21 +343,53 @@ function createSSETransport(options = {}) {
|
|
|
336
343
|
"human_agent_left",
|
|
337
344
|
"chat_ended",
|
|
338
345
|
"chat_updated",
|
|
346
|
+
"chat_removed",
|
|
339
347
|
"load_chat_response",
|
|
340
348
|
"new_chat_created",
|
|
341
349
|
"show_csat_survey",
|
|
342
350
|
"csat_response",
|
|
343
351
|
"user_suggested_actions",
|
|
352
|
+
"user_suggested_action_selected",
|
|
344
353
|
"agent_execution_started",
|
|
345
354
|
"agent_execution_ended",
|
|
346
355
|
"agent_context_update",
|
|
356
|
+
"load_agent_context_response",
|
|
347
357
|
"plan_pending_approval",
|
|
358
|
+
"plan_approved",
|
|
359
|
+
"plan_rejected",
|
|
348
360
|
"step_started",
|
|
349
361
|
"step_completed",
|
|
350
362
|
"step_failed",
|
|
351
363
|
"plan_completed",
|
|
352
364
|
"skills_changed",
|
|
353
|
-
"summary_update"
|
|
365
|
+
"summary_update",
|
|
366
|
+
"message_status_update",
|
|
367
|
+
"delivered",
|
|
368
|
+
"read",
|
|
369
|
+
"sync_metadata_response",
|
|
370
|
+
"sync_user_session_response",
|
|
371
|
+
"client_action",
|
|
372
|
+
"client_action_callback",
|
|
373
|
+
"attachment_processing_started",
|
|
374
|
+
"attachment_processing_progress",
|
|
375
|
+
"attachment_processing_complete",
|
|
376
|
+
"attachment_processing_error",
|
|
377
|
+
"observer_joined",
|
|
378
|
+
"observer_left",
|
|
379
|
+
"block_user",
|
|
380
|
+
"message_edited",
|
|
381
|
+
"message_deleted",
|
|
382
|
+
"message_reaction",
|
|
383
|
+
"user_presence_changed",
|
|
384
|
+
"online_users",
|
|
385
|
+
"get_agents_response",
|
|
386
|
+
"room_created",
|
|
387
|
+
"room_updated",
|
|
388
|
+
"room_deleted",
|
|
389
|
+
"rooms_response",
|
|
390
|
+
"room_user_joined",
|
|
391
|
+
"room_user_left",
|
|
392
|
+
"user_invited"
|
|
354
393
|
];
|
|
355
394
|
eventTypes.forEach((type) => {
|
|
356
395
|
es.addEventListener(type, handleMessage);
|
|
@@ -397,18 +436,34 @@ function createSSETransport(options = {}) {
|
|
|
397
436
|
state = retryCount > 0 ? "reconnecting" : "connecting";
|
|
398
437
|
return new Promise((resolve, reject) => {
|
|
399
438
|
const connectionStart = Date.now();
|
|
400
|
-
const
|
|
439
|
+
const streamParams = new URLSearchParams({
|
|
440
|
+
orgId: cfg.orgId,
|
|
441
|
+
userId: cfg.userId,
|
|
442
|
+
clientType: cfg.clientType
|
|
443
|
+
});
|
|
444
|
+
if (cfg.chatKey) streamParams.set("chatId", cfg.chatKey);
|
|
445
|
+
const url = `${cfg.baseUrl}/stream?${streamParams.toString()}`;
|
|
401
446
|
logger.debug("Connecting to:", url);
|
|
402
447
|
const es = new EventSource(url);
|
|
403
448
|
es.onopen = () => {
|
|
404
449
|
const connectionTime = Date.now() - connectionStart;
|
|
405
450
|
logger.info(`Connected in ${connectionTime}ms`);
|
|
451
|
+
const wasReconnect = retryCount > 0;
|
|
406
452
|
state = "connected";
|
|
407
453
|
error = void 0;
|
|
408
454
|
retryCount = 0;
|
|
409
455
|
metrics.connectedAt = Date.now();
|
|
410
456
|
metrics.latency = connectionTime;
|
|
411
457
|
setupEventListeners(es);
|
|
458
|
+
if (wasReconnect) {
|
|
459
|
+
emit({
|
|
460
|
+
type: "transport_reconnected",
|
|
461
|
+
orgId: cfg.orgId,
|
|
462
|
+
chatKey: cfg.chatKey || "",
|
|
463
|
+
userId: cfg.userId,
|
|
464
|
+
timestamp: Date.now()
|
|
465
|
+
});
|
|
466
|
+
}
|
|
412
467
|
resolve();
|
|
413
468
|
};
|
|
414
469
|
es.onerror = () => {
|
|
@@ -457,7 +512,8 @@ function createSSETransport(options = {}) {
|
|
|
457
512
|
orgId: event.orgId,
|
|
458
513
|
chatKey: event.chatKey,
|
|
459
514
|
userId: event.userId,
|
|
460
|
-
message: event.message
|
|
515
|
+
message: event.message,
|
|
516
|
+
...event.data ? { data: event.data } : {}
|
|
461
517
|
});
|
|
462
518
|
break;
|
|
463
519
|
case "typing":
|
|
@@ -678,7 +734,13 @@ function createFetchSSETransport(options = {}) {
|
|
|
678
734
|
return events;
|
|
679
735
|
}
|
|
680
736
|
async function startStream(cfg) {
|
|
681
|
-
const
|
|
737
|
+
const streamParams = new URLSearchParams({
|
|
738
|
+
orgId: cfg.orgId,
|
|
739
|
+
userId: cfg.userId,
|
|
740
|
+
clientType: cfg.clientType
|
|
741
|
+
});
|
|
742
|
+
if (cfg.chatKey) streamParams.set("chatId", cfg.chatKey);
|
|
743
|
+
const url = `${cfg.baseUrl}/stream?${streamParams.toString()}`;
|
|
682
744
|
logger.debug("Connecting to:", url);
|
|
683
745
|
abortController = new AbortController();
|
|
684
746
|
const response = await customFetch(url, {
|
|
@@ -784,6 +846,7 @@ function createFetchSSETransport(options = {}) {
|
|
|
784
846
|
state = retryCount > 0 ? "reconnecting" : "connecting";
|
|
785
847
|
const connectionStart = Date.now();
|
|
786
848
|
try {
|
|
849
|
+
const wasReconnect = retryCount > 0;
|
|
787
850
|
await startStream(cfg);
|
|
788
851
|
const connectionTime = Date.now() - connectionStart;
|
|
789
852
|
logger.info(`Connected in ${connectionTime}ms`);
|
|
@@ -792,6 +855,15 @@ function createFetchSSETransport(options = {}) {
|
|
|
792
855
|
retryCount = 0;
|
|
793
856
|
metrics.connectedAt = Date.now();
|
|
794
857
|
metrics.latency = connectionTime;
|
|
858
|
+
if (wasReconnect) {
|
|
859
|
+
emit({
|
|
860
|
+
type: "transport_reconnected",
|
|
861
|
+
orgId: cfg.orgId,
|
|
862
|
+
chatKey: cfg.chatKey || "",
|
|
863
|
+
userId: cfg.userId,
|
|
864
|
+
timestamp: Date.now()
|
|
865
|
+
});
|
|
866
|
+
}
|
|
795
867
|
} catch (err) {
|
|
796
868
|
const connectError = {
|
|
797
869
|
code: "CONNECTION_FAILED",
|
|
@@ -833,7 +905,8 @@ function createFetchSSETransport(options = {}) {
|
|
|
833
905
|
orgId: event.orgId,
|
|
834
906
|
chatKey: event.chatKey,
|
|
835
907
|
userId: event.userId,
|
|
836
|
-
message: event.message
|
|
908
|
+
message: event.message,
|
|
909
|
+
...event.data ? { data: event.data } : {}
|
|
837
910
|
});
|
|
838
911
|
break;
|
|
839
912
|
case "typing":
|
|
@@ -1153,7 +1226,7 @@ function useChat(options) {
|
|
|
1153
1226
|
[orgId, userId]
|
|
1154
1227
|
);
|
|
1155
1228
|
const sendMessage = (0, import_react.useCallback)(
|
|
1156
|
-
async (content, attachments) => {
|
|
1229
|
+
async (content, attachments, data) => {
|
|
1157
1230
|
const transport = transportRef.current;
|
|
1158
1231
|
if (!transport) {
|
|
1159
1232
|
throw new Error("Transport not initialized");
|
|
@@ -1178,7 +1251,8 @@ function useChat(options) {
|
|
|
1178
1251
|
chatKey,
|
|
1179
1252
|
userId,
|
|
1180
1253
|
timestamp: Date.now(),
|
|
1181
|
-
message
|
|
1254
|
+
message,
|
|
1255
|
+
...data ? { data } : {}
|
|
1182
1256
|
});
|
|
1183
1257
|
setMetrics((prev) => ({
|
|
1184
1258
|
...prev,
|
|
@@ -1317,9 +1391,21 @@ function useChat(options) {
|
|
|
1317
1391
|
var import_react3 = require("react");
|
|
1318
1392
|
|
|
1319
1393
|
// api/index.ts
|
|
1394
|
+
var import_browser2 = require("@elqnt/api-client/browser");
|
|
1395
|
+
|
|
1396
|
+
// api/memory.ts
|
|
1320
1397
|
var import_browser = require("@elqnt/api-client/browser");
|
|
1398
|
+
var patchProfileApi = (patch, o) => (0, import_browser.browserApiRequest)("/api/v1/memory/profile", { method: "PATCH", body: patch, ...o });
|
|
1399
|
+
var replaceProfileApi = (p, o) => (0, import_browser.browserApiRequest)("/api/v1/memory/profile", { method: "PUT", body: p, ...o });
|
|
1400
|
+
var clearProfileApi = (o) => (0, import_browser.browserApiRequest)("/api/v1/memory/profile", { method: "DELETE", ...o });
|
|
1401
|
+
var deleteContactApi = (name, o) => (0, import_browser.browserApiRequest)(`/api/v1/memory/profile/contacts/${encodeURIComponent(name)}`, { method: "DELETE", ...o });
|
|
1402
|
+
var deleteNoteApi = (index, o) => (0, import_browser.browserApiRequest)(`/api/v1/memory/profile/notes/${index}`, { method: "DELETE", ...o });
|
|
1403
|
+
var clearSummaryApi = (chatKey, o) => (0, import_browser.browserApiRequest)(`/api/v1/chats/${chatKey}/summary`, { method: "DELETE", ...o });
|
|
1404
|
+
var regenerateSummaryApi = (chatKey, o) => (0, import_browser.browserApiRequest)(`/api/v1/chats/${chatKey}/summary/regenerate`, { method: "POST", ...o });
|
|
1405
|
+
|
|
1406
|
+
// api/index.ts
|
|
1321
1407
|
async function getChatHistoryApi(options) {
|
|
1322
|
-
return (0,
|
|
1408
|
+
return (0, import_browser2.browserApiRequest)("/api/v1/chats", {
|
|
1323
1409
|
method: "POST",
|
|
1324
1410
|
body: {
|
|
1325
1411
|
limit: options.limit || 15,
|
|
@@ -1330,26 +1416,26 @@ async function getChatHistoryApi(options) {
|
|
|
1330
1416
|
});
|
|
1331
1417
|
}
|
|
1332
1418
|
async function getChatApi(chatKey, options) {
|
|
1333
|
-
return (0,
|
|
1419
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/chats/${chatKey}`, {
|
|
1334
1420
|
method: "GET",
|
|
1335
1421
|
...options
|
|
1336
1422
|
});
|
|
1337
1423
|
}
|
|
1338
1424
|
async function updateChatApi(chatKey, updates, options) {
|
|
1339
|
-
return (0,
|
|
1425
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/chats/${chatKey}`, {
|
|
1340
1426
|
method: "PATCH",
|
|
1341
1427
|
body: updates,
|
|
1342
1428
|
...options
|
|
1343
1429
|
});
|
|
1344
1430
|
}
|
|
1345
1431
|
async function deleteChatApi(chatKey, options) {
|
|
1346
|
-
return (0,
|
|
1432
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/chats/${chatKey}`, {
|
|
1347
1433
|
method: "DELETE",
|
|
1348
1434
|
...options
|
|
1349
1435
|
});
|
|
1350
1436
|
}
|
|
1351
1437
|
async function getActiveChatsCountApi(options) {
|
|
1352
|
-
return (0,
|
|
1438
|
+
return (0, import_browser2.browserApiRequest)("/api/v1/chats/active/count", {
|
|
1353
1439
|
method: "GET",
|
|
1354
1440
|
...options
|
|
1355
1441
|
});
|
|
@@ -1358,37 +1444,37 @@ async function getActiveChatsApi(options) {
|
|
|
1358
1444
|
const params = new URLSearchParams();
|
|
1359
1445
|
if (options.pastHours) params.set("pastHours", String(options.pastHours));
|
|
1360
1446
|
const queryString = params.toString();
|
|
1361
|
-
return (0,
|
|
1447
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/chats/active${queryString ? `?${queryString}` : ""}`, {
|
|
1362
1448
|
method: "GET",
|
|
1363
1449
|
...options
|
|
1364
1450
|
});
|
|
1365
1451
|
}
|
|
1366
1452
|
async function getWaitingChatsCountApi(options) {
|
|
1367
|
-
return (0,
|
|
1453
|
+
return (0, import_browser2.browserApiRequest)("/api/v1/chats/waiting/count", {
|
|
1368
1454
|
method: "GET",
|
|
1369
1455
|
...options
|
|
1370
1456
|
});
|
|
1371
1457
|
}
|
|
1372
1458
|
async function getChatsByUserApi(userEmail, options) {
|
|
1373
|
-
return (0,
|
|
1459
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/chats/user/${encodeURIComponent(userEmail)}`, {
|
|
1374
1460
|
method: "GET",
|
|
1375
1461
|
...options
|
|
1376
1462
|
});
|
|
1377
1463
|
}
|
|
1378
1464
|
async function listQueuesApi(options) {
|
|
1379
|
-
return (0,
|
|
1465
|
+
return (0, import_browser2.browserApiRequest)("/api/v1/queues", {
|
|
1380
1466
|
method: "GET",
|
|
1381
1467
|
...options
|
|
1382
1468
|
});
|
|
1383
1469
|
}
|
|
1384
1470
|
async function getOnlineSessionsApi(options) {
|
|
1385
|
-
return (0,
|
|
1471
|
+
return (0, import_browser2.browserApiRequest)("/api/v1/agents/sessions/online", {
|
|
1386
1472
|
method: "GET",
|
|
1387
1473
|
...options
|
|
1388
1474
|
});
|
|
1389
1475
|
}
|
|
1390
1476
|
async function getAgentSessionApi(agentId, options) {
|
|
1391
|
-
return (0,
|
|
1477
|
+
return (0, import_browser2.browserApiRequest)(`/api/v1/agents/sessions/${agentId}`, {
|
|
1392
1478
|
method: "GET",
|
|
1393
1479
|
...options
|
|
1394
1480
|
});
|
|
@@ -1523,6 +1609,85 @@ function useHumanAgentSessions(options) {
|
|
|
1523
1609
|
);
|
|
1524
1610
|
}
|
|
1525
1611
|
|
|
1612
|
+
// hooks/use-memory.ts
|
|
1613
|
+
var import_react6 = require("react");
|
|
1614
|
+
function useMemory(options, initialProfile = null) {
|
|
1615
|
+
const [profile, setProfile] = (0, import_react6.useState)(initialProfile);
|
|
1616
|
+
const [loading, setLoading] = (0, import_react6.useState)(false);
|
|
1617
|
+
const requestCountRef = (0, import_react6.useRef)(0);
|
|
1618
|
+
const runProfileMutation = (0, import_react6.useCallback)(
|
|
1619
|
+
async (fn) => {
|
|
1620
|
+
requestCountRef.current += 1;
|
|
1621
|
+
setLoading(true);
|
|
1622
|
+
try {
|
|
1623
|
+
const response = await fn();
|
|
1624
|
+
if (!response.error && response.data) {
|
|
1625
|
+
setProfile(response.data);
|
|
1626
|
+
return response.data;
|
|
1627
|
+
}
|
|
1628
|
+
return null;
|
|
1629
|
+
} catch {
|
|
1630
|
+
return null;
|
|
1631
|
+
} finally {
|
|
1632
|
+
requestCountRef.current -= 1;
|
|
1633
|
+
if (requestCountRef.current === 0) {
|
|
1634
|
+
setLoading(false);
|
|
1635
|
+
}
|
|
1636
|
+
}
|
|
1637
|
+
},
|
|
1638
|
+
[]
|
|
1639
|
+
);
|
|
1640
|
+
const optionsRef = (0, import_react6.useRef)(options);
|
|
1641
|
+
optionsRef.current = options;
|
|
1642
|
+
const patchProfile = (0, import_react6.useCallback)(
|
|
1643
|
+
(patch) => runProfileMutation(() => patchProfileApi(patch, optionsRef.current)),
|
|
1644
|
+
[runProfileMutation]
|
|
1645
|
+
);
|
|
1646
|
+
const replaceProfile = (0, import_react6.useCallback)(
|
|
1647
|
+
(p) => runProfileMutation(() => replaceProfileApi(p, optionsRef.current)),
|
|
1648
|
+
[runProfileMutation]
|
|
1649
|
+
);
|
|
1650
|
+
const clearProfile = (0, import_react6.useCallback)(
|
|
1651
|
+
() => runProfileMutation(() => clearProfileApi(optionsRef.current)),
|
|
1652
|
+
[runProfileMutation]
|
|
1653
|
+
);
|
|
1654
|
+
const deleteContact = (0, import_react6.useCallback)(
|
|
1655
|
+
(name) => runProfileMutation(() => deleteContactApi(name, optionsRef.current)),
|
|
1656
|
+
[runProfileMutation]
|
|
1657
|
+
);
|
|
1658
|
+
const deleteNote = (0, import_react6.useCallback)(
|
|
1659
|
+
(index) => runProfileMutation(() => deleteNoteApi(index, optionsRef.current)),
|
|
1660
|
+
[runProfileMutation]
|
|
1661
|
+
);
|
|
1662
|
+
const clearSummary = (0, import_react6.useCallback)(
|
|
1663
|
+
async (chatKey) => {
|
|
1664
|
+
await clearSummaryApi(chatKey, optionsRef.current);
|
|
1665
|
+
},
|
|
1666
|
+
[]
|
|
1667
|
+
);
|
|
1668
|
+
const regenerateSummary = (0, import_react6.useCallback)(
|
|
1669
|
+
async (chatKey) => {
|
|
1670
|
+
const response = await regenerateSummaryApi(chatKey, optionsRef.current);
|
|
1671
|
+
if (!response.error && response.data) {
|
|
1672
|
+
return response.data;
|
|
1673
|
+
}
|
|
1674
|
+
return null;
|
|
1675
|
+
},
|
|
1676
|
+
[]
|
|
1677
|
+
);
|
|
1678
|
+
return {
|
|
1679
|
+
profile,
|
|
1680
|
+
loading,
|
|
1681
|
+
patchProfile,
|
|
1682
|
+
replaceProfile,
|
|
1683
|
+
clearProfile,
|
|
1684
|
+
deleteContact,
|
|
1685
|
+
deleteNote,
|
|
1686
|
+
clearSummary,
|
|
1687
|
+
regenerateSummary
|
|
1688
|
+
};
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1526
1691
|
// hooks/index.ts
|
|
1527
1692
|
var import_hooks4 = require("@elqnt/api-client/hooks");
|
|
1528
1693
|
|
|
@@ -1557,6 +1722,7 @@ var ChatEventTypeStoppedTyping = "stopped_typing";
|
|
|
1557
1722
|
var ChatEventTypeRead = "read";
|
|
1558
1723
|
var ChatEventTypeDelivered = "delivered";
|
|
1559
1724
|
var ChatEventTypeReconnected = "reconnected";
|
|
1725
|
+
var ChatEventTypeTransportReconnected = "transport_reconnected";
|
|
1560
1726
|
var ChatEventTypeError = "error";
|
|
1561
1727
|
var ChatEventTypeWaiting = "waiting";
|
|
1562
1728
|
var ChatEventTypeLoadChat = "load_chat";
|
|
@@ -1696,6 +1862,9 @@ var GetActiveChatsSubject = "chat.get_active_chats";
|
|
|
1696
1862
|
var GetUserChatsSubject = "chat.get_user_chats";
|
|
1697
1863
|
var GetChatSubject = "chat.get_chat";
|
|
1698
1864
|
var ChatArchiveSubjectPattern = "chat.archive.%s.server";
|
|
1865
|
+
var ListIdleChatsSubject = "chat.maintenance.list_idle_chats";
|
|
1866
|
+
var CloseAndDeleteChatSubject = "chat.maintenance.close_and_delete_chat";
|
|
1867
|
+
var MarkChatClosedSubject = "chat.maintenance.mark_closed";
|
|
1699
1868
|
var StartAgentSessionSubject = "chat.agent_session.start";
|
|
1700
1869
|
var EndAgentSessionSubject = "chat.agent_session.end";
|
|
1701
1870
|
var UpdateAgentStatusSubject = "chat.agent_session.update_status";
|
|
@@ -1717,6 +1886,7 @@ var GetOnlineUsersSubject = "chat.users.online.get";
|
|
|
1717
1886
|
var TriggerAnalyticsScanSubject = "chat.analytics.trigger-scan";
|
|
1718
1887
|
var SetupOrgSubject = "chat.org.setup";
|
|
1719
1888
|
var GetAgentContextSubject = "chat.agent-context.get";
|
|
1889
|
+
var TriggerMemorySummarizationSubject = "chat.memory.summarize.nightly";
|
|
1720
1890
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1721
1891
|
0 && (module.exports = {
|
|
1722
1892
|
AgentStatusAway,
|
|
@@ -1826,6 +1996,7 @@ var GetAgentContextSubject = "chat.agent-context.get";
|
|
|
1826
1996
|
ChatEventTypeSyncMetadataResponse,
|
|
1827
1997
|
ChatEventTypeSyncUserSession,
|
|
1828
1998
|
ChatEventTypeSyncUserSessionResponse,
|
|
1999
|
+
ChatEventTypeTransportReconnected,
|
|
1829
2000
|
ChatEventTypeTyping,
|
|
1830
2001
|
ChatEventTypeUpdateRoom,
|
|
1831
2002
|
ChatEventTypeUserActivity,
|
|
@@ -1864,6 +2035,7 @@ var GetAgentContextSubject = "chat.agent-context.get";
|
|
|
1864
2035
|
ChatTypeGroup,
|
|
1865
2036
|
ChatTypePrivateRoom,
|
|
1866
2037
|
ChatTypePublicRoom,
|
|
2038
|
+
CloseAndDeleteChatSubject,
|
|
1867
2039
|
CompleteChatByAgentSubject,
|
|
1868
2040
|
CreateAgentQueueSubject,
|
|
1869
2041
|
DeleteAgentQueueSubject,
|
|
@@ -1883,6 +2055,8 @@ var GetAgentContextSubject = "chat.agent-context.get";
|
|
|
1883
2055
|
GetUserChatsSubject,
|
|
1884
2056
|
GetWaitingForAgentChatCountSubject,
|
|
1885
2057
|
GetWaitingForAgentChatsSubject,
|
|
2058
|
+
ListIdleChatsSubject,
|
|
2059
|
+
MarkChatClosedSubject,
|
|
1886
2060
|
MessageStatusDelivered,
|
|
1887
2061
|
MessageStatusFailed,
|
|
1888
2062
|
MessageStatusRead,
|
|
@@ -1896,6 +2070,7 @@ var GetAgentContextSubject = "chat.agent-context.get";
|
|
|
1896
2070
|
SetupOrgSubject,
|
|
1897
2071
|
StartAgentSessionSubject,
|
|
1898
2072
|
TriggerAnalyticsScanSubject,
|
|
2073
|
+
TriggerMemorySummarizationSubject,
|
|
1899
2074
|
UpdateAgentLastActivitySubject,
|
|
1900
2075
|
UpdateAgentQueueSubject,
|
|
1901
2076
|
UpdateAgentStatusSubject,
|
|
@@ -1909,6 +2084,7 @@ var GetAgentContextSubject = "chat.agent-context.get";
|
|
|
1909
2084
|
useChatHistory,
|
|
1910
2085
|
useChatMonitoring,
|
|
1911
2086
|
useHumanAgentSessions,
|
|
2087
|
+
useMemory,
|
|
1912
2088
|
useOptionsRef
|
|
1913
2089
|
});
|
|
1914
2090
|
//# sourceMappingURL=index.js.map
|