@hivegpt/hiveai-angular 0.0.563 → 0.0.565
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/bundles/hivegpt-hiveai-angular.umd.js +21 -11
- package/bundles/hivegpt-hiveai-angular.umd.js.map +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js +1 -1
- package/bundles/hivegpt-hiveai-angular.umd.min.js.map +1 -1
- package/esm2015/lib/components/chat-drawer/chat-drawer.component.js +10 -8
- package/esm2015/lib/components/conversation.service.js +13 -5
- package/esm2015/lib/components/voice-agent/services/voice-agent.service.js +2 -2
- package/fesm2015/hivegpt-hiveai-angular.js +21 -11
- package/fesm2015/hivegpt-hiveai-angular.js.map +1 -1
- package/hivegpt-hiveai-angular.metadata.json +1 -1
- package/lib/components/chat-drawer/chat-drawer.component.d.ts.map +1 -1
- package/lib/components/conversation.service.d.ts +8 -2
- package/lib/components/conversation.service.d.ts.map +1 -1
- package/lib/components/voice-agent/services/voice-agent.service.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -846,9 +846,16 @@
|
|
|
846
846
|
});
|
|
847
847
|
return timestamp + randomHex;
|
|
848
848
|
};
|
|
849
|
-
|
|
849
|
+
/**
|
|
850
|
+
* Returns a stable conversation id persisted in localStorage.
|
|
851
|
+
*
|
|
852
|
+
* IMPORTANT: call-sites should pass an event-specific scope when needed (e.g. eventId)
|
|
853
|
+
* so switching events does not reuse the previous event's conversation thread.
|
|
854
|
+
*/
|
|
855
|
+
ConversationService.prototype.getKey = function (botId, resetKey, scope) {
|
|
850
856
|
if (resetKey === void 0) { resetKey = false; }
|
|
851
|
-
var
|
|
857
|
+
var normalizedScope = scope != null && String(scope).trim() !== '' ? String(scope).trim() : '';
|
|
858
|
+
var storageKey = "" + this.conversationStorageKeyPrefix + botId + (normalizedScope ? "_" + normalizedScope : '');
|
|
852
859
|
var value = localStorage.getItem(storageKey);
|
|
853
860
|
if (!value || resetKey) {
|
|
854
861
|
value = this.generateKey();
|
|
@@ -856,9 +863,10 @@
|
|
|
856
863
|
}
|
|
857
864
|
return value;
|
|
858
865
|
};
|
|
859
|
-
ConversationService.prototype.getSessionKey = function (sessionId, resetKey) {
|
|
866
|
+
ConversationService.prototype.getSessionKey = function (sessionId, resetKey, scope) {
|
|
860
867
|
if (resetKey === void 0) { resetKey = false; }
|
|
861
|
-
var
|
|
868
|
+
var normalizedScope = scope != null && String(scope).trim() !== '' ? String(scope).trim() : '';
|
|
869
|
+
var storageKey = "" + this.sessionStorageKeyPrefix + sessionId + (normalizedScope ? "_" + normalizedScope : '');
|
|
862
870
|
var value = localStorage.getItem(storageKey);
|
|
863
871
|
if (!value || resetKey) {
|
|
864
872
|
value = this.generateKey();
|
|
@@ -2357,7 +2365,7 @@
|
|
|
2357
2365
|
_this.socketService.connectSocketConnection();
|
|
2358
2366
|
setTimeout(function () {
|
|
2359
2367
|
console.log('YES INIT');
|
|
2360
|
-
var conversation_id = _this.conversationService.getKey(_this.botId);
|
|
2368
|
+
var conversation_id = _this.conversationService.getKey(_this.botId, false, _this.eventId);
|
|
2361
2369
|
_this.socketService.registerUserSpecificHiveSocket(_this.botId, conversation_id, _this.orgId);
|
|
2362
2370
|
setTimeout(function () {
|
|
2363
2371
|
_this.listenSockets();
|
|
@@ -3891,8 +3899,8 @@
|
|
|
3891
3899
|
};
|
|
3892
3900
|
ChatDrawerComponent.prototype.fetchChatHistory = function () {
|
|
3893
3901
|
this.loading = true;
|
|
3894
|
-
this.conversationKey = this.conversationService.getKey(this.botId, false);
|
|
3895
|
-
this.conSessionKey = this.conversationService.getSessionKey(this.botId, false);
|
|
3902
|
+
this.conversationKey = this.conversationService.getKey(this.botId, false, this.eventId);
|
|
3903
|
+
this.conSessionKey = this.conversationService.getSessionKey(this.botId, false, this.eventId);
|
|
3896
3904
|
var url = this.environment.BASE_URL + "/conversations/" + this.conversationKey + "?session_id=" + this.conSessionKey;
|
|
3897
3905
|
var headers = new i1.HttpHeaders({
|
|
3898
3906
|
accept: 'application/json',
|
|
@@ -4442,7 +4450,7 @@
|
|
|
4442
4450
|
console.log(message);
|
|
4443
4451
|
this.feedbackDone = true;
|
|
4444
4452
|
this.showFeedBackIconsIndex = null;
|
|
4445
|
-
var conversation_id = this.conversationService.getKey(this.botId);
|
|
4453
|
+
var conversation_id = this.conversationService.getKey(this.botId, false, this.eventId);
|
|
4446
4454
|
var url = this.environment.AGENTS_API + "/Conversation/coPilot/" + this.botId + "/conversation/" + conversation_id + "/helpful-response";
|
|
4447
4455
|
fetch(url, {
|
|
4448
4456
|
method: 'POST',
|
|
@@ -4895,7 +4903,7 @@
|
|
|
4895
4903
|
this.isContentLoaded = false;
|
|
4896
4904
|
console.log('API call function');
|
|
4897
4905
|
this.loading = true;
|
|
4898
|
-
var conversation_id = this.conversationService.getKey(this.botId);
|
|
4906
|
+
var conversation_id = this.conversationService.getKey(this.botId, false, this.eventId);
|
|
4899
4907
|
this.conversationId = conversation_id;
|
|
4900
4908
|
var url = this.environment.AGENTS_API + "/ConversationDocuments?conversationId=" + conversation_id + "&botId=" + this.botId;
|
|
4901
4909
|
var headers = new i1.HttpHeaders({
|
|
@@ -5215,6 +5223,7 @@
|
|
|
5215
5223
|
'hive-bot-id': this.botId,
|
|
5216
5224
|
'domain-authority': this.domainAuthorityValue,
|
|
5217
5225
|
eventUrl: this.eventUrl,
|
|
5226
|
+
eventId: this.eventId,
|
|
5218
5227
|
eventToken: this.eventToken,
|
|
5219
5228
|
};
|
|
5220
5229
|
if (this.workspaceToken) {
|
|
@@ -5279,6 +5288,7 @@
|
|
|
5279
5288
|
'x-api-key': this.apiKey,
|
|
5280
5289
|
'hive-bot-id': this.botId,
|
|
5281
5290
|
'domain-authority': this.domainAuthorityValue,
|
|
5291
|
+
'eventId': this.eventId,
|
|
5282
5292
|
});
|
|
5283
5293
|
this.http.post(url, body, { headers: headers }).subscribe({
|
|
5284
5294
|
next: function (data) {
|
|
@@ -5354,7 +5364,7 @@
|
|
|
5354
5364
|
};
|
|
5355
5365
|
ChatDrawerComponent.prototype.startNewConversation = function () {
|
|
5356
5366
|
var _this = this;
|
|
5357
|
-
this.conversationKey = this.conversationService.getKey(this.botId, true);
|
|
5367
|
+
this.conversationKey = this.conversationService.getKey(this.botId, true, this.eventId);
|
|
5358
5368
|
this.chatLog = [this.chatLog[0]];
|
|
5359
5369
|
this.isChatingWithAi = false;
|
|
5360
5370
|
this.chatSocketInitialized = false;
|
|
@@ -5424,7 +5434,7 @@
|
|
|
5424
5434
|
ChatDrawerComponent.prototype.openVoiceModal = function () {
|
|
5425
5435
|
var _this = this;
|
|
5426
5436
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
5427
|
-
var conversationId = (_b = (_a = this.conversationKey) !== null && _a !== void 0 ? _a : this.conversationService.getKey(this.botId, false)) !== null && _b !== void 0 ? _b : '';
|
|
5437
|
+
var conversationId = (_b = (_a = this.conversationKey) !== null && _a !== void 0 ? _a : this.conversationService.getKey(this.botId, false, this.eventId)) !== null && _b !== void 0 ? _b : '';
|
|
5428
5438
|
this.voiceModalConversationId = conversationId;
|
|
5429
5439
|
this.setupVoiceTranscripts();
|
|
5430
5440
|
// Close existing overlay if any
|