@servicetitan/titan-chatbot-api 7.1.2 → 9.0.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/CHANGELOG.md +25 -0
- package/dist/api-client/__mocks__/chatbot-api-client.mock.d.ts +1 -0
- package/dist/api-client/__mocks__/chatbot-api-client.mock.d.ts.map +1 -1
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js +22 -47
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js.map +1 -1
- package/dist/api-client/base/chatbot-api-client.d.ts +7 -0
- package/dist/api-client/base/chatbot-api-client.d.ts.map +1 -1
- package/dist/api-client/base/chatbot-api-client.js +3 -4
- package/dist/api-client/base/chatbot-api-client.js.map +1 -1
- package/dist/api-client/index.d.ts +2 -2
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +12 -7
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/models/__mocks__/models.mock.js +154 -124
- package/dist/api-client/models/__mocks__/models.mock.js.map +1 -1
- package/dist/api-client/models/index.d.ts +2 -1
- package/dist/api-client/models/index.d.ts.map +1 -1
- package/dist/api-client/models/index.js +8 -7
- package/dist/api-client/models/index.js.map +1 -1
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.d.ts +2 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.d.ts.map +1 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.js +240 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.js.map +1 -0
- package/dist/api-client/titan-chat/__tests__/native-client.test.js +6 -6
- package/dist/api-client/titan-chat/__tests__/native-client.test.js.map +1 -1
- package/dist/api-client/titan-chat/chatbot-api-client.d.ts +11 -0
- package/dist/api-client/titan-chat/chatbot-api-client.d.ts.map +1 -1
- package/dist/api-client/titan-chat/chatbot-api-client.js +69 -35
- package/dist/api-client/titan-chat/chatbot-api-client.js.map +1 -1
- package/dist/api-client/titan-chat/index.d.ts +2 -1
- package/dist/api-client/titan-chat/index.d.ts.map +1 -1
- package/dist/api-client/titan-chat/index.js +1 -0
- package/dist/api-client/titan-chat/index.js.map +1 -1
- package/dist/api-client/titan-chat/native-client.js +359 -812
- package/dist/api-client/titan-chat/native-client.js.map +1 -1
- package/dist/api-client/utils/__tests__/model-utils.test.js +454 -191
- package/dist/api-client/utils/__tests__/model-utils.test.js.map +1 -1
- package/dist/api-client/utils/model-utils.d.ts.map +1 -1
- package/dist/api-client/utils/model-utils.js +28 -25
- package/dist/api-client/utils/model-utils.js.map +1 -1
- package/dist/hooks/use-customization-chatbot.js +2 -1
- package/dist/hooks/use-customization-chatbot.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/models/__tests__/chatbot-customizations.test.d.ts +2 -0
- package/dist/models/__tests__/chatbot-customizations.test.d.ts.map +1 -0
- package/dist/models/__tests__/chatbot-customizations.test.js +36 -0
- package/dist/models/__tests__/chatbot-customizations.test.js.map +1 -0
- package/dist/models/chatbot-customizations.d.ts +17 -0
- package/dist/models/chatbot-customizations.d.ts.map +1 -1
- package/dist/models/chatbot-customizations.js +7 -1
- package/dist/models/chatbot-customizations.js.map +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.d.ts +2 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.d.ts.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.js +107 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.js.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.d.ts +2 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.d.ts.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.js +312 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.js.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js +267 -172
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui.store.test.js +61 -64
- package/dist/stores/__tests__/chatbot-ui.store.test.js.map +1 -1
- package/dist/stores/__tests__/filter.store.test.js +243 -116
- package/dist/stores/__tests__/filter.store.test.js.map +1 -1
- package/dist/stores/__tests__/initialize.store.test.js +9 -8
- package/dist/stores/__tests__/initialize.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js +8 -7
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback.store.test.js +34 -27
- package/dist/stores/__tests__/message-feedback.store.test.js.map +1 -1
- package/dist/stores/__tests__/session-feedback.store.test.js +9 -8
- package/dist/stores/__tests__/session-feedback.store.test.js.map +1 -1
- package/dist/stores/chatbot-ui-backend.store.d.ts +26 -2
- package/dist/stores/chatbot-ui-backend.store.d.ts.map +1 -1
- package/dist/stores/chatbot-ui-backend.store.js +295 -239
- package/dist/stores/chatbot-ui-backend.store.js.map +1 -1
- package/dist/stores/chatbot-ui.store.js +73 -46
- package/dist/stores/chatbot-ui.store.js.map +1 -1
- package/dist/stores/filter.store.js +298 -378
- package/dist/stores/filter.store.js.map +1 -1
- package/dist/stores/index.d.ts +5 -3
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +3 -2
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/initialize.store.js +55 -51
- package/dist/stores/initialize.store.js.map +1 -1
- package/dist/stores/message-feedback-base.store.js +2 -1
- package/dist/stores/message-feedback-base.store.js.map +1 -1
- package/dist/stores/message-feedback-guardrail.store.js +50 -47
- package/dist/stores/message-feedback-guardrail.store.js.map +1 -1
- package/dist/stores/message-feedback.store.js +84 -89
- package/dist/stores/message-feedback.store.js.map +1 -1
- package/dist/stores/session-feedback.store.js +46 -39
- package/dist/stores/session-feedback.store.js.map +1 -1
- package/dist/streaming/__tests__/agent-stream.test.d.ts +2 -0
- package/dist/streaming/__tests__/agent-stream.test.d.ts.map +1 -0
- package/dist/streaming/__tests__/agent-stream.test.js +92 -0
- package/dist/streaming/__tests__/agent-stream.test.js.map +1 -0
- package/dist/streaming/agent-stream.d.ts +83 -0
- package/dist/streaming/agent-stream.d.ts.map +1 -0
- package/dist/streaming/agent-stream.js +28 -0
- package/dist/streaming/agent-stream.js.map +1 -0
- package/dist/streaming/index.d.ts +3 -0
- package/dist/streaming/index.d.ts.map +1 -0
- package/dist/streaming/index.js +4 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/streaming/run-agent-stream.d.ts +23 -0
- package/dist/streaming/run-agent-stream.d.ts.map +1 -0
- package/dist/streaming/run-agent-stream.js +83 -0
- package/dist/streaming/run-agent-stream.js.map +1 -0
- package/dist/utils/__tests__/axios-utils.test.js +8 -7
- package/dist/utils/__tests__/axios-utils.test.js.map +1 -1
- package/dist/utils/axios-utils.js +9 -7
- package/dist/utils/axios-utils.js.map +1 -1
- package/dist/utils/test-utils.js +5 -5
- package/dist/utils/test-utils.js.map +1 -1
- package/package.json +6 -3
- package/src/api-client/__mocks__/chatbot-api-client.mock.ts +1 -0
- package/src/api-client/base/chatbot-api-client.ts +11 -0
- package/src/api-client/index.ts +2 -7
- package/src/api-client/models/index.ts +15 -13
- package/src/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.ts +208 -0
- package/src/api-client/titan-chat/chatbot-api-client.ts +46 -0
- package/src/api-client/titan-chat/index.ts +2 -1
- package/src/api-client/utils/model-utils.ts +4 -8
- package/src/index.ts +7 -2
- package/src/models/__tests__/chatbot-customizations.test.ts +26 -0
- package/src/models/chatbot-customizations.ts +20 -0
- package/src/stores/__tests__/chatbot-ui-backend.store.observability.test.ts +105 -0
- package/src/stores/__tests__/chatbot-ui-backend.store.streaming.test.ts +261 -0
- package/src/stores/chatbot-ui-backend.store.ts +179 -4
- package/src/stores/index.ts +5 -12
- package/src/streaming/__tests__/agent-stream.test.ts +80 -0
- package/src/streaming/agent-stream.ts +103 -0
- package/src/streaming/index.ts +2 -0
- package/src/streaming/run-agent-stream.ts +109 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/api-client/help-center/__tests__/converter-from-models.test.d.ts +0 -2
- package/dist/api-client/help-center/__tests__/converter-from-models.test.d.ts.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js +0 -34
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-to-models.test.d.ts +0 -2
- package/dist/api-client/help-center/__tests__/converter-to-models.test.d.ts.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js +0 -82
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js.map +0 -1
- package/dist/api-client/help-center/chatbot-api-client.d.ts +0 -32
- package/dist/api-client/help-center/chatbot-api-client.d.ts.map +0 -1
- package/dist/api-client/help-center/chatbot-api-client.js +0 -102
- package/dist/api-client/help-center/chatbot-api-client.js.map +0 -1
- package/dist/api-client/help-center/converter-from-models.d.ts +0 -13
- package/dist/api-client/help-center/converter-from-models.d.ts.map +0 -1
- package/dist/api-client/help-center/converter-from-models.js +0 -114
- package/dist/api-client/help-center/converter-from-models.js.map +0 -1
- package/dist/api-client/help-center/converter-to-models.d.ts +0 -13
- package/dist/api-client/help-center/converter-to-models.d.ts.map +0 -1
- package/dist/api-client/help-center/converter-to-models.js +0 -98
- package/dist/api-client/help-center/converter-to-models.js.map +0 -1
- package/dist/api-client/help-center/index.d.ts +0 -2
- package/dist/api-client/help-center/index.d.ts.map +0 -1
- package/dist/api-client/help-center/index.js +0 -2
- package/dist/api-client/help-center/index.js.map +0 -1
- package/dist/api-client/help-center/native-client.d.ts +0 -1268
- package/dist/api-client/help-center/native-client.d.ts.map +0 -1
- package/dist/api-client/help-center/native-client.js +0 -6242
- package/dist/api-client/help-center/native-client.js.map +0 -1
- package/src/api-client/help-center/__tests__/converter-from-models.test.ts +0 -41
- package/src/api-client/help-center/__tests__/converter-to-models.test.ts +0 -89
- package/src/api-client/help-center/chatbot-api-client.ts +0 -122
- package/src/api-client/help-center/converter-from-models.ts +0 -133
- package/src/api-client/help-center/converter-to-models.ts +0 -127
- package/src/api-client/help-center/index.ts +0 -1
- package/src/api-client/help-center/native-client.ts +0 -5727
|
@@ -1,86 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
2
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
16
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for
|
|
17
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
18
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
8
21
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
return function
|
|
12
|
-
|
|
22
|
+
}
|
|
23
|
+
function _ts_param(paramIndex, decorator) {
|
|
24
|
+
return function(target, key) {
|
|
25
|
+
decorator(target, key, paramIndex);
|
|
26
|
+
};
|
|
27
|
+
}
|
|
13
28
|
import { inject, injectable } from '@servicetitan/react-ioc';
|
|
14
29
|
import { FieldState, FormState } from 'formstate';
|
|
15
30
|
import { action, computed, makeObservable, observable } from 'mobx';
|
|
16
31
|
import { Models } from '../api-client';
|
|
17
|
-
import { CHATBOT_UI_STORE_TOKEN } from './chatbot-ui.store';
|
|
18
|
-
|
|
32
|
+
import { CHATBOT_UI_STORE_TOKEN, IChatbotUiStore } from './chatbot-ui.store';
|
|
33
|
+
export class MessageFeedbackStore {
|
|
19
34
|
get isCommentAlwaysRequired() {
|
|
20
|
-
var
|
|
21
|
-
|
|
35
|
+
var _ref;
|
|
36
|
+
var _this_chatbotUiStore_customizations_feedback;
|
|
37
|
+
return (_ref = (_this_chatbotUiStore_customizations_feedback = this.chatbotUiStore.customizations.feedback) === null || _this_chatbotUiStore_customizations_feedback === void 0 ? void 0 : _this_chatbotUiStore_customizations_feedback.isCommentAlwaysRequired) !== null && _ref !== void 0 ? _ref : false;
|
|
22
38
|
}
|
|
23
39
|
get isTextAreaVisible() {
|
|
24
40
|
return this.isCommentAlwaysRequired || this.formState.$.other.value;
|
|
25
41
|
}
|
|
26
42
|
get isValid() {
|
|
27
|
-
return
|
|
28
|
-
this.formState.$.unclear.value ||
|
|
29
|
-
this.formState.$.notFull.value ||
|
|
30
|
-
this.formState.$.incorrect.value ||
|
|
31
|
-
this.formState.$.other.value);
|
|
32
|
-
}
|
|
33
|
-
constructor(chatbotUiStore) {
|
|
34
|
-
Object.defineProperty(this, "chatbotUiStore", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: chatbotUiStore
|
|
39
|
-
});
|
|
40
|
-
Object.defineProperty(this, "formState", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: void 0
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(this, "createFormState", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: () => {
|
|
51
|
-
const formState = new FormState({
|
|
52
|
-
unrelated: new FieldState(false),
|
|
53
|
-
unclear: new FieldState(false),
|
|
54
|
-
notFull: new FieldState(false),
|
|
55
|
-
incorrect: new FieldState(false),
|
|
56
|
-
other: new FieldState(false),
|
|
57
|
-
otherComment: new FieldState('')
|
|
58
|
-
.validators($ => {
|
|
59
|
-
if (this.isCommentAlwaysRequired) {
|
|
60
|
-
// Internal users can't submit empty feedback
|
|
61
|
-
return $ ? false : 'Enter details.';
|
|
62
|
-
}
|
|
63
|
-
// External users can submit empty feedback if "Other" is not selected
|
|
64
|
-
if (!this.formState.$.other.value) {
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
return $ ? false : 'Enter details.';
|
|
68
|
-
})
|
|
69
|
-
.disableAutoValidation(),
|
|
70
|
-
}).validators($ => {
|
|
71
|
-
const nothingSelected = !$.unrelated.value &&
|
|
72
|
-
!$.unclear.value &&
|
|
73
|
-
!$.notFull.value &&
|
|
74
|
-
!$.incorrect.value &&
|
|
75
|
-
!$.other.value;
|
|
76
|
-
return nothingSelected ? 'At least one item has to be selected.' : false;
|
|
77
|
-
});
|
|
78
|
-
formState.disableAutoValidation();
|
|
79
|
-
return formState;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
this.formState = this.createFormState();
|
|
83
|
-
makeObservable(this);
|
|
43
|
+
return this.formState.$.unrelated.value || this.formState.$.unclear.value || this.formState.$.notFull.value || this.formState.$.incorrect.value || this.formState.$.other.value;
|
|
84
44
|
}
|
|
85
45
|
export() {
|
|
86
46
|
const fs = this.formState.$;
|
|
@@ -102,41 +62,76 @@ let MessageFeedbackStore = class MessageFeedbackStore {
|
|
|
102
62
|
}
|
|
103
63
|
const feedback = {
|
|
104
64
|
rating: Models.FeedbackRatings.ThumbsDown,
|
|
105
|
-
options
|
|
65
|
+
options
|
|
106
66
|
};
|
|
107
67
|
if (fs.otherComment.value) {
|
|
108
68
|
feedback.description = fs.otherComment.value;
|
|
109
69
|
}
|
|
110
70
|
return feedback;
|
|
111
71
|
}
|
|
112
|
-
|
|
113
|
-
|
|
72
|
+
constructor(chatbotUiStore){
|
|
73
|
+
_define_property(this, "chatbotUiStore", void 0);
|
|
74
|
+
_define_property(this, "formState", void 0);
|
|
75
|
+
_define_property(this, "createFormState", void 0);
|
|
76
|
+
this.chatbotUiStore = chatbotUiStore;
|
|
77
|
+
this.createFormState = ()=>{
|
|
78
|
+
const formState = new FormState({
|
|
79
|
+
unrelated: new FieldState(false),
|
|
80
|
+
unclear: new FieldState(false),
|
|
81
|
+
notFull: new FieldState(false),
|
|
82
|
+
incorrect: new FieldState(false),
|
|
83
|
+
other: new FieldState(false),
|
|
84
|
+
otherComment: new FieldState('').validators(($)=>{
|
|
85
|
+
if (this.isCommentAlwaysRequired) {
|
|
86
|
+
// Internal users can't submit empty feedback
|
|
87
|
+
return $ ? false : 'Enter details.';
|
|
88
|
+
}
|
|
89
|
+
// External users can submit empty feedback if "Other" is not selected
|
|
90
|
+
if (!this.formState.$.other.value) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
return $ ? false : 'Enter details.';
|
|
94
|
+
}).disableAutoValidation()
|
|
95
|
+
}).validators(($)=>{
|
|
96
|
+
const nothingSelected = !$.unrelated.value && !$.unclear.value && !$.notFull.value && !$.incorrect.value && !$.other.value;
|
|
97
|
+
return nothingSelected ? 'At least one item has to be selected.' : false;
|
|
98
|
+
});
|
|
99
|
+
formState.disableAutoValidation();
|
|
100
|
+
return formState;
|
|
101
|
+
};
|
|
102
|
+
this.formState = this.createFormState();
|
|
103
|
+
makeObservable(this);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
_ts_decorate([
|
|
114
107
|
observable,
|
|
115
|
-
|
|
108
|
+
_ts_metadata("design:type", typeof MessageFeedbackFormState === "undefined" ? Object : MessageFeedbackFormState)
|
|
116
109
|
], MessageFeedbackStore.prototype, "formState", void 0);
|
|
117
|
-
|
|
110
|
+
_ts_decorate([
|
|
118
111
|
computed,
|
|
119
|
-
|
|
120
|
-
|
|
112
|
+
_ts_metadata("design:type", void 0),
|
|
113
|
+
_ts_metadata("design:paramtypes", [])
|
|
121
114
|
], MessageFeedbackStore.prototype, "isCommentAlwaysRequired", null);
|
|
122
|
-
|
|
115
|
+
_ts_decorate([
|
|
123
116
|
computed,
|
|
124
|
-
|
|
125
|
-
|
|
117
|
+
_ts_metadata("design:type", void 0),
|
|
118
|
+
_ts_metadata("design:paramtypes", [])
|
|
126
119
|
], MessageFeedbackStore.prototype, "isTextAreaVisible", null);
|
|
127
|
-
|
|
120
|
+
_ts_decorate([
|
|
128
121
|
computed,
|
|
129
|
-
|
|
130
|
-
|
|
122
|
+
_ts_metadata("design:type", void 0),
|
|
123
|
+
_ts_metadata("design:paramtypes", [])
|
|
131
124
|
], MessageFeedbackStore.prototype, "isValid", null);
|
|
132
|
-
|
|
133
|
-
action
|
|
134
|
-
__metadata("design:type", Object)
|
|
125
|
+
_ts_decorate([
|
|
126
|
+
action
|
|
135
127
|
], MessageFeedbackStore.prototype, "createFormState", void 0);
|
|
136
|
-
MessageFeedbackStore =
|
|
128
|
+
MessageFeedbackStore = _ts_decorate([
|
|
137
129
|
injectable(),
|
|
138
|
-
|
|
139
|
-
|
|
130
|
+
_ts_param(0, inject(CHATBOT_UI_STORE_TOKEN)),
|
|
131
|
+
_ts_metadata("design:type", Function),
|
|
132
|
+
_ts_metadata("design:paramtypes", [
|
|
133
|
+
typeof IChatbotUiStore === "undefined" ? Object : IChatbotUiStore
|
|
134
|
+
])
|
|
140
135
|
], MessageFeedbackStore);
|
|
141
|
-
|
|
136
|
+
|
|
142
137
|
//# sourceMappingURL=message-feedback.store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/stores/message-feedback.store.ts"],"sourcesContent":["import { inject, injectable } from '@servicetitan/react-ioc';\nimport { FieldState, FormState } from 'formstate';\nimport { action, computed, makeObservable, observable } from 'mobx';\nimport { Models } from '../api-client';\nimport { CHATBOT_UI_STORE_TOKEN, IChatbotUiStore } from './chatbot-ui.store';\nimport { FeedbackDraft, IMessageFeedbackBaseStore } from './message-feedback-base.store';\n\nexport type MessageFeedbackFormState = FormState<{\n unrelated: FieldState<boolean>;\n unclear: FieldState<boolean>;\n notFull: FieldState<boolean>;\n incorrect: FieldState<boolean>;\n other: FieldState<boolean>;\n otherComment: FieldState<string>;\n}>;\n\n@injectable()\nexport class MessageFeedbackStore implements IMessageFeedbackBaseStore<MessageFeedbackFormState> {\n @observable formState!: MessageFeedbackFormState;\n\n @computed get isCommentAlwaysRequired() {\n return this.chatbotUiStore.customizations.feedback?.isCommentAlwaysRequired ?? false;\n }\n\n @computed get isTextAreaVisible() {\n return this.isCommentAlwaysRequired || this.formState.$.other.value;\n }\n\n @computed get isValid() {\n return (\n this.formState.$.unrelated.value ||\n this.formState.$.unclear.value ||\n this.formState.$.notFull.value ||\n this.formState.$.incorrect.value ||\n this.formState.$.other.value\n );\n }\n\n constructor(@inject(CHATBOT_UI_STORE_TOKEN) private readonly chatbotUiStore: IChatbotUiStore) {\n this.formState = this.createFormState();\n makeObservable(this);\n }\n\n export(): FeedbackDraft {\n const fs = this.formState.$;\n const options: Models.FeedbackOptions[] = [];\n if (fs.unrelated.value) {\n options.push(Models.FeedbackOptions.Unrelated);\n }\n if (fs.unclear.value) {\n options.push(Models.FeedbackOptions.Unclear);\n }\n if (fs.notFull.value) {\n options.push(Models.FeedbackOptions.Incomplete);\n }\n if (fs.incorrect.value) {\n options.push(Models.FeedbackOptions.Incorrect);\n }\n if (fs.other.value) {\n options.push(Models.FeedbackOptions.Other);\n }\n const feedback: FeedbackDraft = {\n rating: Models.FeedbackRatings.ThumbsDown,\n options,\n };\n if (fs.otherComment.value) {\n feedback.description = fs.otherComment.value;\n }\n return feedback;\n }\n\n @action\n private createFormState = (): MessageFeedbackFormState => {\n const formState = new FormState({\n unrelated: new FieldState(false),\n unclear: new FieldState(false),\n notFull: new FieldState(false),\n incorrect: new FieldState(false),\n other: new FieldState(false),\n otherComment: new FieldState('')\n .validators($ => {\n if (this.isCommentAlwaysRequired) {\n // Internal users can't submit empty feedback\n return $ ? false : 'Enter details.';\n }\n // External users can submit empty feedback if \"Other\" is not selected\n if (!this.formState.$.other.value) {\n return false;\n }\n return $ ? false : 'Enter details.';\n })\n .disableAutoValidation(),\n }).validators($ => {\n const nothingSelected =\n !$.unrelated.value &&\n !$.unclear.value &&\n !$.notFull.value &&\n !$.incorrect.value &&\n !$.other.value;\n return nothingSelected ? 'At least one item has to be selected.' : false;\n });\n formState.disableAutoValidation();\n return formState;\n };\n}\n"],"names":["inject","injectable","FieldState","FormState","action","computed","makeObservable","observable","Models","CHATBOT_UI_STORE_TOKEN","IChatbotUiStore","MessageFeedbackStore","isCommentAlwaysRequired","chatbotUiStore","customizations","feedback","isTextAreaVisible","formState","$","other","value","isValid","unrelated","unclear","notFull","incorrect","export","fs","options","push","FeedbackOptions","Unrelated","Unclear","Incomplete","Incorrect","Other","rating","FeedbackRatings","ThumbsDown","otherComment","description","createFormState","validators","disableAutoValidation","nothingSelected"],"mappings":"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"}
|
|
@@ -1,26 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
2
15
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
16
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for
|
|
17
|
+
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
18
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
}
|
|
7
|
-
|
|
19
|
+
}
|
|
20
|
+
function _ts_metadata(k, v) {
|
|
8
21
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
}
|
|
22
|
+
}
|
|
10
23
|
import { injectable } from '@servicetitan/react-ioc';
|
|
11
24
|
import { FieldState, FormState } from 'formstate';
|
|
12
25
|
import { computed, makeObservable, observable } from 'mobx';
|
|
13
26
|
import { Models } from '../api-client';
|
|
14
|
-
|
|
27
|
+
import { FeedbackDraft } from './message-feedback-base.store';
|
|
28
|
+
export class SessionFeedbackStore {
|
|
15
29
|
get isValid() {
|
|
16
30
|
return this.formState.$.thumbs.value !== 0;
|
|
17
31
|
}
|
|
18
32
|
get feedback() {
|
|
19
33
|
return {
|
|
20
|
-
rating: this.formState.$.thumbs.value > 0
|
|
21
|
-
|
|
22
|
-
: Models.FeedbackRatings.ThumbsDown,
|
|
23
|
-
description: this.formState.$.comment.value || undefined,
|
|
34
|
+
rating: this.formState.$.thumbs.value > 0 ? Models.FeedbackRatings.ThumbsUp : Models.FeedbackRatings.ThumbsDown,
|
|
35
|
+
description: this.formState.$.comment.value || undefined
|
|
24
36
|
};
|
|
25
37
|
}
|
|
26
38
|
get isThumbsUp() {
|
|
@@ -29,46 +41,41 @@ let SessionFeedbackStore = class SessionFeedbackStore {
|
|
|
29
41
|
get isThumbsDown() {
|
|
30
42
|
return this.formState.$.thumbs.value < 0;
|
|
31
43
|
}
|
|
32
|
-
constructor()
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
value: new FormState({
|
|
38
|
-
thumbs: new FieldState(0),
|
|
39
|
-
comment: new FieldState(''),
|
|
40
|
-
})
|
|
41
|
-
});
|
|
44
|
+
constructor(){
|
|
45
|
+
_define_property(this, "formState", new FormState({
|
|
46
|
+
thumbs: new FieldState(0),
|
|
47
|
+
comment: new FieldState('')
|
|
48
|
+
}));
|
|
42
49
|
makeObservable(this);
|
|
43
50
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
observable
|
|
47
|
-
__metadata("design:type", Object)
|
|
51
|
+
}
|
|
52
|
+
_ts_decorate([
|
|
53
|
+
observable
|
|
48
54
|
], SessionFeedbackStore.prototype, "formState", void 0);
|
|
49
|
-
|
|
55
|
+
_ts_decorate([
|
|
50
56
|
computed,
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
_ts_metadata("design:type", void 0),
|
|
58
|
+
_ts_metadata("design:paramtypes", [])
|
|
53
59
|
], SessionFeedbackStore.prototype, "isValid", null);
|
|
54
|
-
|
|
60
|
+
_ts_decorate([
|
|
55
61
|
computed,
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
_ts_metadata("design:type", typeof FeedbackDraft === "undefined" ? Object : FeedbackDraft),
|
|
63
|
+
_ts_metadata("design:paramtypes", [])
|
|
58
64
|
], SessionFeedbackStore.prototype, "feedback", null);
|
|
59
|
-
|
|
65
|
+
_ts_decorate([
|
|
60
66
|
computed,
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
_ts_metadata("design:type", void 0),
|
|
68
|
+
_ts_metadata("design:paramtypes", [])
|
|
63
69
|
], SessionFeedbackStore.prototype, "isThumbsUp", null);
|
|
64
|
-
|
|
70
|
+
_ts_decorate([
|
|
65
71
|
computed,
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
_ts_metadata("design:type", void 0),
|
|
73
|
+
_ts_metadata("design:paramtypes", [])
|
|
68
74
|
], SessionFeedbackStore.prototype, "isThumbsDown", null);
|
|
69
|
-
SessionFeedbackStore =
|
|
75
|
+
SessionFeedbackStore = _ts_decorate([
|
|
70
76
|
injectable(),
|
|
71
|
-
|
|
77
|
+
_ts_metadata("design:type", Function),
|
|
78
|
+
_ts_metadata("design:paramtypes", [])
|
|
72
79
|
], SessionFeedbackStore);
|
|
73
|
-
|
|
80
|
+
|
|
74
81
|
//# sourceMappingURL=session-feedback.store.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../src/stores/session-feedback.store.ts"],"sourcesContent":["import { injectable } from '@servicetitan/react-ioc';\nimport { FieldState, FormState } from 'formstate';\nimport { computed, makeObservable, observable } from 'mobx';\nimport { Models } from '../api-client';\nimport { FeedbackDraft } from './message-feedback-base.store';\n\n@injectable()\nexport class SessionFeedbackStore {\n @observable\n formState = new FormState({\n thumbs: new FieldState<number>(0),\n comment: new FieldState<string>(''),\n });\n\n @computed\n get isValid() {\n return this.formState.$.thumbs.value !== 0;\n }\n\n @computed\n get feedback(): FeedbackDraft {\n return {\n rating:\n this.formState.$.thumbs.value > 0\n ? Models.FeedbackRatings.ThumbsUp\n : Models.FeedbackRatings.ThumbsDown,\n description: this.formState.$.comment.value || undefined,\n };\n }\n\n @computed\n get isThumbsUp() {\n return this.formState.$.thumbs.value > 0;\n }\n\n @computed\n get isThumbsDown() {\n return this.formState.$.thumbs.value < 0;\n }\n\n constructor() {\n makeObservable(this);\n }\n}\n"],"names":["injectable","FieldState","FormState","computed","makeObservable","observable","Models","FeedbackDraft","SessionFeedbackStore","isValid","formState","$","thumbs","value","feedback","rating","FeedbackRatings","ThumbsUp","ThumbsDown","description","comment","undefined","isThumbsUp","isThumbsDown"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,UAAU,QAAQ,0BAA0B;AACrD,SAASC,UAAU,EAAEC,SAAS,QAAQ,YAAY;AAClD,SAASC,QAAQ,EAAEC,cAAc,EAAEC,UAAU,QAAQ,OAAO;AAC5D,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,aAAa,QAAQ,gCAAgC;AAG9D,OAAO,MAAMC;IAOT,IACIC,UAAU;QACV,OAAO,IAAI,CAACC,SAAS,CAACC,CAAC,CAACC,MAAM,CAACC,KAAK,KAAK;IAC7C;IAEA,IACIC,WAA0B;QAC1B,OAAO;YACHC,QACI,IAAI,CAACL,SAAS,CAACC,CAAC,CAACC,MAAM,CAACC,KAAK,GAAG,IAC1BP,OAAOU,eAAe,CAACC,QAAQ,GAC/BX,OAAOU,eAAe,CAACE,UAAU;YAC3CC,aAAa,IAAI,CAACT,SAAS,CAACC,CAAC,CAACS,OAAO,CAACP,KAAK,IAAIQ;QACnD;IACJ;IAEA,IACIC,aAAa;QACb,OAAO,IAAI,CAACZ,SAAS,CAACC,CAAC,CAACC,MAAM,CAACC,KAAK,GAAG;IAC3C;IAEA,IACIU,eAAe;QACf,OAAO,IAAI,CAACb,SAAS,CAACC,CAAC,CAACC,MAAM,CAACC,KAAK,GAAG;IAC3C;IAEA,aAAc;QAhCd,uBACAH,aAAY,IAAIR,UAAU;YACtBU,QAAQ,IAAIX,WAAmB;YAC/BmB,SAAS,IAAInB,WAAmB;QACpC;QA6BIG,eAAe,IAAI;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-stream.test.d.ts","sourceRoot":"","sources":["../../../src/streaming/__tests__/agent-stream.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { describe, expect, test } from '@jest/globals';
|
|
2
|
+
import { Models } from '../../api-client';
|
|
3
|
+
import { convertAgentFinishToBotMessage } from '../agent-stream';
|
|
4
|
+
describe('convertAgentFinishToBotMessage', ()=>{
|
|
5
|
+
test('preserves the backend BotMessage fields verbatim', ()=>{
|
|
6
|
+
// Real Bifurcation payload: backend sends guardFlag "BI" + isGuardrailed true.
|
|
7
|
+
const message = convertAgentFinishToBotMessage({
|
|
8
|
+
answer: 'pick one',
|
|
9
|
+
guardFlag: 'BI',
|
|
10
|
+
isGuardrailed: true,
|
|
11
|
+
sessionId: 122,
|
|
12
|
+
status: 'Bifurcation'
|
|
13
|
+
});
|
|
14
|
+
expect(message).toBeInstanceOf(Models.BotMessage);
|
|
15
|
+
expect(message.answer).toBe('pick one');
|
|
16
|
+
expect(message.guardFlag).toBe('BI');
|
|
17
|
+
expect(message.isGuardrailed).toBe(true);
|
|
18
|
+
expect(message.sessionId).toBe(122);
|
|
19
|
+
});
|
|
20
|
+
test('ignores streaming-only metadata (status, durationMs, runId, seq)', ()=>{
|
|
21
|
+
const message = convertAgentFinishToBotMessage({
|
|
22
|
+
answer: 'ok',
|
|
23
|
+
guardFlag: 'N',
|
|
24
|
+
isGuardrailed: false,
|
|
25
|
+
status: 'Success',
|
|
26
|
+
durationMs: 13603,
|
|
27
|
+
runId: 'ec66a0b47d99430a99b964f7478aadd7',
|
|
28
|
+
seq: 6
|
|
29
|
+
});
|
|
30
|
+
const json = message.toJSON();
|
|
31
|
+
expect(json).not.toHaveProperty('status');
|
|
32
|
+
expect(json).not.toHaveProperty('durationMs');
|
|
33
|
+
expect(json).not.toHaveProperty('runId');
|
|
34
|
+
expect(json).not.toHaveProperty('seq');
|
|
35
|
+
});
|
|
36
|
+
test('wraps nested data into serializable instances (toJSON does not throw)', ()=>{
|
|
37
|
+
var _message_scoredUrls, _message_agentOptions, _message_workflowPlan;
|
|
38
|
+
// Mirrors the decoded SSE JSON: nested data arrives as plain objects, not class instances.
|
|
39
|
+
const payload = {
|
|
40
|
+
answer: 'final',
|
|
41
|
+
guardFlag: 'BI',
|
|
42
|
+
isGuardrailed: true,
|
|
43
|
+
sessionId: 3,
|
|
44
|
+
scoredUrls: [
|
|
45
|
+
{
|
|
46
|
+
url: 'https://kb/1',
|
|
47
|
+
score: 0.9,
|
|
48
|
+
title: 'Doc'
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
agentOptions: [
|
|
52
|
+
{
|
|
53
|
+
agentId: 'playwright',
|
|
54
|
+
passPhrase: 'Do it for me',
|
|
55
|
+
caption: 'Auto'
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
workflowPlan: {
|
|
59
|
+
displayName: 'Refund',
|
|
60
|
+
estimatedRuntimeSec: 5,
|
|
61
|
+
steps: [
|
|
62
|
+
{
|
|
63
|
+
number: 1,
|
|
64
|
+
description: 'Look up order'
|
|
65
|
+
}
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const message = convertAgentFinishToBotMessage(payload);
|
|
70
|
+
/*
|
|
71
|
+
* Regression: persisting chat state calls BotMessage.toJSON(), which iterates these and
|
|
72
|
+
* calls item.toJSON() on each — it threw "item.toJSON is not a function" for plain objects.
|
|
73
|
+
*/ expect(()=>JSON.stringify(message)).not.toThrow();
|
|
74
|
+
expect((_message_scoredUrls = message.scoredUrls) === null || _message_scoredUrls === void 0 ? void 0 : _message_scoredUrls[0]).toBeInstanceOf(Models.ScoredUrl);
|
|
75
|
+
expect((_message_agentOptions = message.agentOptions) === null || _message_agentOptions === void 0 ? void 0 : _message_agentOptions[0]).toBeInstanceOf(Models.AgentOption);
|
|
76
|
+
expect(message.workflowPlan).toBeInstanceOf(Models.WorkflowPlan);
|
|
77
|
+
expect((_message_workflowPlan = message.workflowPlan) === null || _message_workflowPlan === void 0 ? void 0 : _message_workflowPlan.steps[0]).toBeInstanceOf(Models.WorkflowStep);
|
|
78
|
+
});
|
|
79
|
+
test('handles a minimal payload with no nested data', ()=>{
|
|
80
|
+
const message = convertAgentFinishToBotMessage({
|
|
81
|
+
answer: 'x',
|
|
82
|
+
guardFlag: 'N',
|
|
83
|
+
isGuardrailed: false
|
|
84
|
+
});
|
|
85
|
+
expect(message.scoredUrls).toBeUndefined();
|
|
86
|
+
expect(message.agentOptions).toBeUndefined();
|
|
87
|
+
expect(message.workflowPlan).toBeUndefined();
|
|
88
|
+
expect(()=>JSON.stringify(message)).not.toThrow();
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=agent-stream.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/streaming/__tests__/agent-stream.test.ts"],"sourcesContent":["import { describe, expect, test } from '@jest/globals';\nimport { Models } from '../../api-client';\nimport { convertAgentFinishToBotMessage } from '../agent-stream';\n\ndescribe('convertAgentFinishToBotMessage', () => {\n test('preserves the backend BotMessage fields verbatim', () => {\n // Real Bifurcation payload: backend sends guardFlag \"BI\" + isGuardrailed true.\n const message = convertAgentFinishToBotMessage({\n answer: 'pick one',\n guardFlag: 'BI',\n isGuardrailed: true,\n sessionId: 122,\n status: 'Bifurcation',\n });\n\n expect(message).toBeInstanceOf(Models.BotMessage);\n expect(message.answer).toBe('pick one');\n expect(message.guardFlag).toBe('BI');\n expect(message.isGuardrailed).toBe(true);\n expect(message.sessionId).toBe(122);\n });\n\n test('ignores streaming-only metadata (status, durationMs, runId, seq)', () => {\n const message = convertAgentFinishToBotMessage({\n answer: 'ok',\n guardFlag: 'N',\n isGuardrailed: false,\n status: 'Success',\n durationMs: 13603,\n runId: 'ec66a0b47d99430a99b964f7478aadd7',\n seq: 6,\n });\n\n const json = message.toJSON();\n expect(json).not.toHaveProperty('status');\n expect(json).not.toHaveProperty('durationMs');\n expect(json).not.toHaveProperty('runId');\n expect(json).not.toHaveProperty('seq');\n });\n\n test('wraps nested data into serializable instances (toJSON does not throw)', () => {\n // Mirrors the decoded SSE JSON: nested data arrives as plain objects, not class instances.\n const payload: any = {\n answer: 'final',\n guardFlag: 'BI',\n isGuardrailed: true,\n sessionId: 3,\n scoredUrls: [{ url: 'https://kb/1', score: 0.9, title: 'Doc' }],\n agentOptions: [{ agentId: 'playwright', passPhrase: 'Do it for me', caption: 'Auto' }],\n workflowPlan: {\n displayName: 'Refund',\n estimatedRuntimeSec: 5,\n steps: [{ number: 1, description: 'Look up order' }],\n },\n };\n const message = convertAgentFinishToBotMessage(payload);\n\n /*\n * Regression: persisting chat state calls BotMessage.toJSON(), which iterates these and\n * calls item.toJSON() on each — it threw \"item.toJSON is not a function\" for plain objects.\n */\n expect(() => JSON.stringify(message)).not.toThrow();\n expect(message.scoredUrls?.[0]).toBeInstanceOf(Models.ScoredUrl);\n expect(message.agentOptions?.[0]).toBeInstanceOf(Models.AgentOption);\n expect(message.workflowPlan).toBeInstanceOf(Models.WorkflowPlan);\n expect(message.workflowPlan?.steps[0]).toBeInstanceOf(Models.WorkflowStep);\n });\n\n test('handles a minimal payload with no nested data', () => {\n const message = convertAgentFinishToBotMessage({\n answer: 'x',\n guardFlag: 'N',\n isGuardrailed: false,\n });\n expect(message.scoredUrls).toBeUndefined();\n expect(message.agentOptions).toBeUndefined();\n expect(message.workflowPlan).toBeUndefined();\n expect(() => JSON.stringify(message)).not.toThrow();\n });\n});\n"],"names":["describe","expect","test","Models","convertAgentFinishToBotMessage","message","answer","guardFlag","isGuardrailed","sessionId","status","toBeInstanceOf","BotMessage","toBe","durationMs","runId","seq","json","toJSON","not","toHaveProperty","payload","scoredUrls","url","score","title","agentOptions","agentId","passPhrase","caption","workflowPlan","displayName","estimatedRuntimeSec","steps","number","description","JSON","stringify","toThrow","ScoredUrl","AgentOption","WorkflowPlan","WorkflowStep","toBeUndefined"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,IAAI,QAAQ,gBAAgB;AACvD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,8BAA8B,QAAQ,kBAAkB;AAEjEJ,SAAS,kCAAkC;IACvCE,KAAK,oDAAoD;QACrD,+EAA+E;QAC/E,MAAMG,UAAUD,+BAA+B;YAC3CE,QAAQ;YACRC,WAAW;YACXC,eAAe;YACfC,WAAW;YACXC,QAAQ;QACZ;QAEAT,OAAOI,SAASM,cAAc,CAACR,OAAOS,UAAU;QAChDX,OAAOI,QAAQC,MAAM,EAAEO,IAAI,CAAC;QAC5BZ,OAAOI,QAAQE,SAAS,EAAEM,IAAI,CAAC;QAC/BZ,OAAOI,QAAQG,aAAa,EAAEK,IAAI,CAAC;QACnCZ,OAAOI,QAAQI,SAAS,EAAEI,IAAI,CAAC;IACnC;IAEAX,KAAK,oEAAoE;QACrE,MAAMG,UAAUD,+BAA+B;YAC3CE,QAAQ;YACRC,WAAW;YACXC,eAAe;YACfE,QAAQ;YACRI,YAAY;YACZC,OAAO;YACPC,KAAK;QACT;QAEA,MAAMC,OAAOZ,QAAQa,MAAM;QAC3BjB,OAAOgB,MAAME,GAAG,CAACC,cAAc,CAAC;QAChCnB,OAAOgB,MAAME,GAAG,CAACC,cAAc,CAAC;QAChCnB,OAAOgB,MAAME,GAAG,CAACC,cAAc,CAAC;QAChCnB,OAAOgB,MAAME,GAAG,CAACC,cAAc,CAAC;IACpC;IAEAlB,KAAK,yEAAyE;YAsBnEG,qBACAA,uBAEAA;QAxBP,2FAA2F;QAC3F,MAAMgB,UAAe;YACjBf,QAAQ;YACRC,WAAW;YACXC,eAAe;YACfC,WAAW;YACXa,YAAY;gBAAC;oBAAEC,KAAK;oBAAgBC,OAAO;oBAAKC,OAAO;gBAAM;aAAE;YAC/DC,cAAc;gBAAC;oBAAEC,SAAS;oBAAcC,YAAY;oBAAgBC,SAAS;gBAAO;aAAE;YACtFC,cAAc;gBACVC,aAAa;gBACbC,qBAAqB;gBACrBC,OAAO;oBAAC;wBAAEC,QAAQ;wBAAGC,aAAa;oBAAgB;iBAAE;YACxD;QACJ;QACA,MAAM9B,UAAUD,+BAA+BiB;QAE/C;;;SAGC,GACDpB,OAAO,IAAMmC,KAAKC,SAAS,CAAChC,UAAUc,GAAG,CAACmB,OAAO;QACjDrC,QAAOI,sBAAAA,QAAQiB,UAAU,cAAlBjB,0CAAAA,mBAAoB,CAAC,EAAE,EAAEM,cAAc,CAACR,OAAOoC,SAAS;QAC/DtC,QAAOI,wBAAAA,QAAQqB,YAAY,cAApBrB,4CAAAA,qBAAsB,CAAC,EAAE,EAAEM,cAAc,CAACR,OAAOqC,WAAW;QACnEvC,OAAOI,QAAQyB,YAAY,EAAEnB,cAAc,CAACR,OAAOsC,YAAY;QAC/DxC,QAAOI,wBAAAA,QAAQyB,YAAY,cAApBzB,4CAAAA,sBAAsB4B,KAAK,CAAC,EAAE,EAAEtB,cAAc,CAACR,OAAOuC,YAAY;IAC7E;IAEAxC,KAAK,iDAAiD;QAClD,MAAMG,UAAUD,+BAA+B;YAC3CE,QAAQ;YACRC,WAAW;YACXC,eAAe;QACnB;QACAP,OAAOI,QAAQiB,UAAU,EAAEqB,aAAa;QACxC1C,OAAOI,QAAQqB,YAAY,EAAEiB,aAAa;QAC1C1C,OAAOI,QAAQyB,YAAY,EAAEa,aAAa;QAC1C1C,OAAO,IAAMmC,KAAKC,SAAS,CAAChC,UAAUc,GAAG,CAACmB,OAAO;IACrD;AACJ"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Models } from '../api-client';
|
|
2
|
+
/** Final run status reported by the backend on `run.finished`. */
|
|
3
|
+
export type AgentRunStatus = 'Success' | 'Guardrailed' | 'PendingApproval' | 'Bifurcation' | 'Error' | 'Timeout';
|
|
4
|
+
export interface AgentPlanStep {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AgentInputOption {
|
|
10
|
+
label: string;
|
|
11
|
+
value: string;
|
|
12
|
+
style?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface AgentInputRequest {
|
|
15
|
+
kind: string;
|
|
16
|
+
prompt?: string;
|
|
17
|
+
options?: AgentInputOption[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decoded payload of the terminal `run.finished` event. The backend sends a full `BotMessage`
|
|
21
|
+
* (same field names: `answer`, `guardFlag`, `isGuardrailed`, `scoredUrls`, `agentOptions`,
|
|
22
|
+
* `workflowPlan`, `sessionId`, …) plus a little streaming-only metadata — so the mapping to the
|
|
23
|
+
* shared model is trivial (see {@link convertAgentFinishToBotMessage}).
|
|
24
|
+
*/
|
|
25
|
+
export interface AgentRunFinishedData extends Models.IBotMessage {
|
|
26
|
+
/** Final run status (streaming-only metadata, not part of the BotMessage model). */
|
|
27
|
+
status?: AgentRunStatus;
|
|
28
|
+
/** Total run duration in ms (streaming-only metadata). */
|
|
29
|
+
durationMs?: number;
|
|
30
|
+
/** Backend run identifier (streaming-only metadata). */
|
|
31
|
+
runId?: string;
|
|
32
|
+
/** Monotonic event sequence number (streaming-only metadata). */
|
|
33
|
+
seq?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Callbacks + config the consumer supplies to a streamed message. Maps the chatbot's agent events
|
|
37
|
+
* onto progress updates and exposes the generic connection lifecycle for logging / keepalive / fallback.
|
|
38
|
+
*/
|
|
39
|
+
export interface AgentStreamHandlers {
|
|
40
|
+
/** Inactivity threshold before `onInactivity` fires (defaults applied by the caller). */
|
|
41
|
+
inactivityTimeoutMs?: number;
|
|
42
|
+
onStatus?(text: string): void;
|
|
43
|
+
onText?(text: string): void;
|
|
44
|
+
onPlan?(steps: AgentPlanStep[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Marks the plan step with the given id as the active one (earlier steps become done, later
|
|
47
|
+
* ones stay pending). Driven by an explicit `activeStepId` on `plan.proposed` or a `stepId` on
|
|
48
|
+
* `status.changed` when the backend supplies it; absent that, the first step is activated on
|
|
49
|
+
* `plan.proposed`. Mid-plan advancement therefore requires backend step correlation.
|
|
50
|
+
*/
|
|
51
|
+
onStepActive?(id: string): void;
|
|
52
|
+
onInputRequested?(request: AgentInputRequest): void;
|
|
53
|
+
onInactivity?(): void;
|
|
54
|
+
onConnected?(): void;
|
|
55
|
+
onDisconnected?(): void;
|
|
56
|
+
onTimeout?(): void;
|
|
57
|
+
onCompleted?(): void;
|
|
58
|
+
}
|
|
59
|
+
/** Raised when the backend emits a `run.error` event. */
|
|
60
|
+
export declare class AgentStreamError extends Error {
|
|
61
|
+
constructor(message?: string);
|
|
62
|
+
}
|
|
63
|
+
/** Path of the v2 streaming endpoint, appended to the configured base URL. */
|
|
64
|
+
export declare const AGENT_STREAM_PATH = "/api/v2/message/stream";
|
|
65
|
+
/** SSE event names emitted by the backend agent pipeline. */
|
|
66
|
+
export declare const AGENT_EVENT: {
|
|
67
|
+
readonly RunStarted: "run.started";
|
|
68
|
+
readonly RunFinished: "run.finished";
|
|
69
|
+
readonly RunError: "run.error";
|
|
70
|
+
readonly StatusChanged: "status.changed";
|
|
71
|
+
readonly TextAppended: "text.appended";
|
|
72
|
+
readonly PlanProposed: "plan.proposed";
|
|
73
|
+
readonly InputRequested: "input.requested";
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Map a terminal `run.finished` payload to the shared `BotMessage` model. The payload is already
|
|
77
|
+
* BotMessage-shaped, so `fromJS` does everything: it reads the backend's `guardFlag`/`isGuardrailed`
|
|
78
|
+
* verbatim, wraps nested data into real instances (`scoredUrls`, `agentOptions`, `workflowPlan` and
|
|
79
|
+
* its `steps`/`inputs`) so `toJSON()` can serialize it for session storage, and ignores the
|
|
80
|
+
* streaming-only metadata (`status`, `durationMs`, `runId`, `seq`).
|
|
81
|
+
*/
|
|
82
|
+
export declare function convertAgentFinishToBotMessage(data: AgentRunFinishedData): Models.BotMessage;
|
|
83
|
+
//# sourceMappingURL=agent-stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-stream.d.ts","sourceRoot":"","sources":["../../src/streaming/agent-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEvC,kEAAkE;AAClE,MAAM,MAAM,cAAc,GACpB,SAAS,GACT,aAAa,GACb,iBAAiB,GACjB,aAAa,GACb,OAAO,GACP,SAAS,CAAC;AAEhB,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAChC;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,MAAM,CAAC,WAAW;IAC5D,oFAAoF;IACpF,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wDAAwD;IACxD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,yFAAyF;IACzF,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG,IAAI,CAAC;IACtC;;;;;OAKG;IACH,YAAY,CAAC,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpD,YAAY,CAAC,IAAI,IAAI,CAAC;IACtB,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB,cAAc,CAAC,IAAI,IAAI,CAAC;IACxB,SAAS,CAAC,IAAI,IAAI,CAAC;IACnB,WAAW,CAAC,IAAI,IAAI,CAAC;CACxB;AAED,yDAAyD;AACzD,qBAAa,gBAAiB,SAAQ,KAAK;gBAC3B,OAAO,CAAC,EAAE,MAAM;CAI/B;AAED,8EAA8E;AAC9E,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D,6DAA6D;AAC7D,eAAO,MAAM,WAAW;;;;;;;;CAQd,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,oBAAoB,GAAG,MAAM,CAAC,UAAU,CAE5F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Models } from '../api-client';
|
|
2
|
+
/** Raised when the backend emits a `run.error` event. */ export class AgentStreamError extends Error {
|
|
3
|
+
constructor(message){
|
|
4
|
+
super(message !== null && message !== void 0 ? message : 'Something went wrong during this step. Please try again.');
|
|
5
|
+
this.name = 'AgentStreamError';
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Path of the v2 streaming endpoint, appended to the configured base URL. */ export const AGENT_STREAM_PATH = '/api/v2/message/stream';
|
|
9
|
+
/** SSE event names emitted by the backend agent pipeline. */ export const AGENT_EVENT = {
|
|
10
|
+
RunStarted: 'run.started',
|
|
11
|
+
RunFinished: 'run.finished',
|
|
12
|
+
RunError: 'run.error',
|
|
13
|
+
StatusChanged: 'status.changed',
|
|
14
|
+
TextAppended: 'text.appended',
|
|
15
|
+
PlanProposed: 'plan.proposed',
|
|
16
|
+
InputRequested: 'input.requested'
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Map a terminal `run.finished` payload to the shared `BotMessage` model. The payload is already
|
|
20
|
+
* BotMessage-shaped, so `fromJS` does everything: it reads the backend's `guardFlag`/`isGuardrailed`
|
|
21
|
+
* verbatim, wraps nested data into real instances (`scoredUrls`, `agentOptions`, `workflowPlan` and
|
|
22
|
+
* its `steps`/`inputs`) so `toJSON()` can serialize it for session storage, and ignores the
|
|
23
|
+
* streaming-only metadata (`status`, `durationMs`, `runId`, `seq`).
|
|
24
|
+
*/ export function convertAgentFinishToBotMessage(data) {
|
|
25
|
+
return Models.BotMessage.fromJS(data);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=agent-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/streaming/agent-stream.ts"],"sourcesContent":["import { Models } from '../api-client';\n\n/** Final run status reported by the backend on `run.finished`. */\nexport type AgentRunStatus =\n | 'Success'\n | 'Guardrailed'\n | 'PendingApproval'\n | 'Bifurcation'\n | 'Error'\n | 'Timeout';\n\nexport interface AgentPlanStep {\n id: string;\n title: string;\n description?: string;\n}\n\nexport interface AgentInputOption {\n label: string;\n value: string;\n style?: string;\n}\n\nexport interface AgentInputRequest {\n kind: string;\n prompt?: string;\n options?: AgentInputOption[];\n}\n\n/**\n * Decoded payload of the terminal `run.finished` event. The backend sends a full `BotMessage`\n * (same field names: `answer`, `guardFlag`, `isGuardrailed`, `scoredUrls`, `agentOptions`,\n * `workflowPlan`, `sessionId`, …) plus a little streaming-only metadata — so the mapping to the\n * shared model is trivial (see {@link convertAgentFinishToBotMessage}).\n */\nexport interface AgentRunFinishedData extends Models.IBotMessage {\n /** Final run status (streaming-only metadata, not part of the BotMessage model). */\n status?: AgentRunStatus;\n /** Total run duration in ms (streaming-only metadata). */\n durationMs?: number;\n /** Backend run identifier (streaming-only metadata). */\n runId?: string;\n /** Monotonic event sequence number (streaming-only metadata). */\n seq?: number;\n}\n\n/**\n * Callbacks + config the consumer supplies to a streamed message. Maps the chatbot's agent events\n * onto progress updates and exposes the generic connection lifecycle for logging / keepalive / fallback.\n */\nexport interface AgentStreamHandlers {\n /** Inactivity threshold before `onInactivity` fires (defaults applied by the caller). */\n inactivityTimeoutMs?: number;\n onStatus?(text: string): void;\n onText?(text: string): void;\n onPlan?(steps: AgentPlanStep[]): void;\n /**\n * Marks the plan step with the given id as the active one (earlier steps become done, later\n * ones stay pending). Driven by an explicit `activeStepId` on `plan.proposed` or a `stepId` on\n * `status.changed` when the backend supplies it; absent that, the first step is activated on\n * `plan.proposed`. Mid-plan advancement therefore requires backend step correlation.\n */\n onStepActive?(id: string): void;\n onInputRequested?(request: AgentInputRequest): void;\n onInactivity?(): void;\n onConnected?(): void;\n onDisconnected?(): void;\n onTimeout?(): void;\n onCompleted?(): void;\n}\n\n/** Raised when the backend emits a `run.error` event. */\nexport class AgentStreamError extends Error {\n constructor(message?: string) {\n super(message ?? 'Something went wrong during this step. Please try again.');\n this.name = 'AgentStreamError';\n }\n}\n\n/** Path of the v2 streaming endpoint, appended to the configured base URL. */\nexport const AGENT_STREAM_PATH = '/api/v2/message/stream';\n\n/** SSE event names emitted by the backend agent pipeline. */\nexport const AGENT_EVENT = {\n RunStarted: 'run.started',\n RunFinished: 'run.finished',\n RunError: 'run.error',\n StatusChanged: 'status.changed',\n TextAppended: 'text.appended',\n PlanProposed: 'plan.proposed',\n InputRequested: 'input.requested',\n} as const;\n\n/**\n * Map a terminal `run.finished` payload to the shared `BotMessage` model. The payload is already\n * BotMessage-shaped, so `fromJS` does everything: it reads the backend's `guardFlag`/`isGuardrailed`\n * verbatim, wraps nested data into real instances (`scoredUrls`, `agentOptions`, `workflowPlan` and\n * its `steps`/`inputs`) so `toJSON()` can serialize it for session storage, and ignores the\n * streaming-only metadata (`status`, `durationMs`, `runId`, `seq`).\n */\nexport function convertAgentFinishToBotMessage(data: AgentRunFinishedData): Models.BotMessage {\n return Models.BotMessage.fromJS(data);\n}\n"],"names":["Models","AgentStreamError","Error","message","name","AGENT_STREAM_PATH","AGENT_EVENT","RunStarted","RunFinished","RunError","StatusChanged","TextAppended","PlanProposed","InputRequested","convertAgentFinishToBotMessage","data","BotMessage","fromJS"],"mappings":"AAAA,SAASA,MAAM,QAAQ,gBAAgB;AAuEvC,uDAAuD,GACvD,OAAO,MAAMC,yBAAyBC;IAClC,YAAYC,OAAgB,CAAE;QAC1B,KAAK,CAACA,oBAAAA,qBAAAA,UAAW;QACjB,IAAI,CAACC,IAAI,GAAG;IAChB;AACJ;AAEA,4EAA4E,GAC5E,OAAO,MAAMC,oBAAoB,yBAAyB;AAE1D,2DAA2D,GAC3D,OAAO,MAAMC,cAAc;IACvBC,YAAY;IACZC,aAAa;IACbC,UAAU;IACVC,eAAe;IACfC,cAAc;IACdC,cAAc;IACdC,gBAAgB;AACpB,EAAW;AAEX;;;;;;CAMC,GACD,OAAO,SAASC,+BAA+BC,IAA0B;IACrE,OAAOf,OAAOgB,UAAU,CAACC,MAAM,CAACF;AACpC"}
|