@botonic/core 0.39.0 → 0.40.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/lib/cjs/models/ai-agents.d.ts +25 -8
- package/lib/cjs/models/hubtype-analytics.d.ts +17 -0
- package/lib/cjs/models/hubtype-analytics.js +1 -0
- package/lib/cjs/models/hubtype-analytics.js.map +1 -1
- package/lib/esm/models/ai-agents.d.ts +25 -8
- package/lib/esm/models/hubtype-analytics.d.ts +17 -0
- package/lib/esm/models/hubtype-analytics.js +1 -0
- package/lib/esm/models/hubtype-analytics.js.map +1 -1
- package/package.json +2 -3
- package/src/models/ai-agents.ts +25 -5
- package/src/models/hubtype-analytics.ts +18 -0
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export interface BaseMessage {
|
|
2
2
|
type: 'text' | 'textWithButtons' | 'carousel' | 'exit';
|
|
3
3
|
}
|
|
4
|
+
export interface Button {
|
|
5
|
+
text: string;
|
|
6
|
+
payload?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
}
|
|
4
9
|
export interface TextMessage extends BaseMessage {
|
|
5
10
|
type: 'text';
|
|
6
11
|
content: {
|
|
@@ -11,17 +16,14 @@ export interface TextWithButtonsMessage extends BaseMessage {
|
|
|
11
16
|
type: 'textWithButtons';
|
|
12
17
|
content: {
|
|
13
18
|
text: string;
|
|
14
|
-
buttons:
|
|
19
|
+
buttons: Button[];
|
|
15
20
|
};
|
|
16
21
|
}
|
|
17
22
|
interface CarouselElement {
|
|
18
23
|
title: string;
|
|
19
24
|
subtitle: string;
|
|
20
25
|
image: string;
|
|
21
|
-
button:
|
|
22
|
-
text: string;
|
|
23
|
-
url: string;
|
|
24
|
-
};
|
|
26
|
+
button: Button;
|
|
25
27
|
}
|
|
26
28
|
export interface CarouselMessage extends BaseMessage {
|
|
27
29
|
type: 'carousel';
|
|
@@ -37,9 +39,24 @@ export type AgenticOutputMessage = Exclude<OutputMessage, ExitMessage>;
|
|
|
37
39
|
export interface RunResult {
|
|
38
40
|
messages: AgenticOutputMessage[];
|
|
39
41
|
toolsExecuted: string[];
|
|
42
|
+
memoryLength: number;
|
|
40
43
|
exit: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
error: boolean;
|
|
45
|
+
inputGuardrailsTriggered: string[];
|
|
46
|
+
outputGuardrailsTriggered: string[];
|
|
47
|
+
}
|
|
48
|
+
export type InferenceResponse = RunResult;
|
|
49
|
+
export interface GuardrailRule {
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
export interface AiAgentArgs {
|
|
54
|
+
name: string;
|
|
55
|
+
instructions: string;
|
|
56
|
+
activeTools?: {
|
|
57
|
+
name: string;
|
|
58
|
+
}[];
|
|
59
|
+
inputGuardrailRules?: GuardrailRule[];
|
|
60
|
+
sourceIds?: string[];
|
|
43
61
|
}
|
|
44
|
-
export type InferenceResponse = RunResult | undefined;
|
|
45
62
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare enum EventAction {
|
|
2
|
+
AiAgent = "ai_agent",
|
|
2
3
|
FeedbackCase = "feedback_case",
|
|
3
4
|
FeedbackMessage = "feedback_message",
|
|
4
5
|
FeedbackConversation = "feedback_conversation",
|
|
@@ -98,6 +99,22 @@ export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
|
98
99
|
knowledgebaseMessageId: string;
|
|
99
100
|
userInput: string;
|
|
100
101
|
}
|
|
102
|
+
export interface EventAiAgent extends HtBaseEventProps {
|
|
103
|
+
action: EventAction.AiAgent;
|
|
104
|
+
flowThreadId: string;
|
|
105
|
+
flowId: string;
|
|
106
|
+
flowName: string;
|
|
107
|
+
flowNodeId: string;
|
|
108
|
+
flowNodeContentId: string;
|
|
109
|
+
flowNodeIsMeaningful: boolean;
|
|
110
|
+
toolsExecuted: string[];
|
|
111
|
+
inputMessageId: string;
|
|
112
|
+
memoryLength: number;
|
|
113
|
+
inputGuardrailsTriggered: string[];
|
|
114
|
+
outputGuardrailsTriggered: string[];
|
|
115
|
+
exit: boolean;
|
|
116
|
+
error: boolean;
|
|
117
|
+
}
|
|
101
118
|
export declare enum KnowledgebaseFailReason {
|
|
102
119
|
NoKnowledge = "no_knowledge",
|
|
103
120
|
Hallucination = "hallucination"
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WebviewEndFailType = exports.KnowledgebaseFailReason = exports.EventAction = void 0;
|
|
4
4
|
var EventAction;
|
|
5
5
|
(function (EventAction) {
|
|
6
|
+
EventAction["AiAgent"] = "ai_agent";
|
|
6
7
|
EventAction["FeedbackCase"] = "feedback_case";
|
|
7
8
|
EventAction["FeedbackMessage"] = "feedback_message";
|
|
8
9
|
EventAction["FeedbackConversation"] = "feedback_conversation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubtype-analytics.js","sourceRoot":"","sources":["../../../src/models/hubtype-analytics.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"hubtype-analytics.js","sourceRoot":"","sources":["../../../src/models/hubtype-analytics.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,mCAAoB,CAAA;IACpB,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,6DAA8C,CAAA;IAC9C,+DAAgD,CAAA;IAChD,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,+CAAgC,CAAA;IAChC,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,yCAA0B,CAAA;IAC1B,gCAAiB,CAAA;AACnB,CAAC,EAlBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAkBtB;AAkHD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AA6BD,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yDAAmC,CAAA;IACnC,4CAAsB,CAAA;IACtB,0DAAoC,CAAA;AACtC,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export interface BaseMessage {
|
|
2
2
|
type: 'text' | 'textWithButtons' | 'carousel' | 'exit';
|
|
3
3
|
}
|
|
4
|
+
export interface Button {
|
|
5
|
+
text: string;
|
|
6
|
+
payload?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
}
|
|
4
9
|
export interface TextMessage extends BaseMessage {
|
|
5
10
|
type: 'text';
|
|
6
11
|
content: {
|
|
@@ -11,17 +16,14 @@ export interface TextWithButtonsMessage extends BaseMessage {
|
|
|
11
16
|
type: 'textWithButtons';
|
|
12
17
|
content: {
|
|
13
18
|
text: string;
|
|
14
|
-
buttons:
|
|
19
|
+
buttons: Button[];
|
|
15
20
|
};
|
|
16
21
|
}
|
|
17
22
|
interface CarouselElement {
|
|
18
23
|
title: string;
|
|
19
24
|
subtitle: string;
|
|
20
25
|
image: string;
|
|
21
|
-
button:
|
|
22
|
-
text: string;
|
|
23
|
-
url: string;
|
|
24
|
-
};
|
|
26
|
+
button: Button;
|
|
25
27
|
}
|
|
26
28
|
export interface CarouselMessage extends BaseMessage {
|
|
27
29
|
type: 'carousel';
|
|
@@ -37,9 +39,24 @@ export type AgenticOutputMessage = Exclude<OutputMessage, ExitMessage>;
|
|
|
37
39
|
export interface RunResult {
|
|
38
40
|
messages: AgenticOutputMessage[];
|
|
39
41
|
toolsExecuted: string[];
|
|
42
|
+
memoryLength: number;
|
|
40
43
|
exit: boolean;
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
error: boolean;
|
|
45
|
+
inputGuardrailsTriggered: string[];
|
|
46
|
+
outputGuardrailsTriggered: string[];
|
|
47
|
+
}
|
|
48
|
+
export type InferenceResponse = RunResult;
|
|
49
|
+
export interface GuardrailRule {
|
|
50
|
+
name: string;
|
|
51
|
+
description: string;
|
|
52
|
+
}
|
|
53
|
+
export interface AiAgentArgs {
|
|
54
|
+
name: string;
|
|
55
|
+
instructions: string;
|
|
56
|
+
activeTools?: {
|
|
57
|
+
name: string;
|
|
58
|
+
}[];
|
|
59
|
+
inputGuardrailRules?: GuardrailRule[];
|
|
60
|
+
sourceIds?: string[];
|
|
43
61
|
}
|
|
44
|
-
export type InferenceResponse = RunResult | undefined;
|
|
45
62
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare enum EventAction {
|
|
2
|
+
AiAgent = "ai_agent",
|
|
2
3
|
FeedbackCase = "feedback_case",
|
|
3
4
|
FeedbackMessage = "feedback_message",
|
|
4
5
|
FeedbackConversation = "feedback_conversation",
|
|
@@ -98,6 +99,22 @@ export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
|
98
99
|
knowledgebaseMessageId: string;
|
|
99
100
|
userInput: string;
|
|
100
101
|
}
|
|
102
|
+
export interface EventAiAgent extends HtBaseEventProps {
|
|
103
|
+
action: EventAction.AiAgent;
|
|
104
|
+
flowThreadId: string;
|
|
105
|
+
flowId: string;
|
|
106
|
+
flowName: string;
|
|
107
|
+
flowNodeId: string;
|
|
108
|
+
flowNodeContentId: string;
|
|
109
|
+
flowNodeIsMeaningful: boolean;
|
|
110
|
+
toolsExecuted: string[];
|
|
111
|
+
inputMessageId: string;
|
|
112
|
+
memoryLength: number;
|
|
113
|
+
inputGuardrailsTriggered: string[];
|
|
114
|
+
outputGuardrailsTriggered: string[];
|
|
115
|
+
exit: boolean;
|
|
116
|
+
error: boolean;
|
|
117
|
+
}
|
|
101
118
|
export declare enum KnowledgebaseFailReason {
|
|
102
119
|
NoKnowledge = "no_knowledge",
|
|
103
120
|
Hallucination = "hallucination"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hubtype-analytics.js","sourceRoot":"","sources":["../../../src/models/hubtype-analytics.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"hubtype-analytics.js","sourceRoot":"","sources":["../../../src/models/hubtype-analytics.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,WAkBX;AAlBD,WAAY,WAAW;IACrB,mCAAoB,CAAA;IACpB,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,6DAA8C,CAAA;IAC9C,+DAAgD,CAAA;IAChD,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,+CAAgC,CAAA;IAChC,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,yCAA0B,CAAA;IAC1B,gCAAiB,CAAA;AACnB,CAAC,EAlBW,WAAW,KAAX,WAAW,QAkBtB;AAkHD,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AA6BD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yDAAmC,CAAA;IACnC,4CAAsB,CAAA;IACtB,0DAAoC,CAAA;AACtC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Build Chatbots using React",
|
|
6
6
|
"main": "./lib/cjs/index.js",
|
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
"decode": "^0.3.0",
|
|
35
35
|
"pako": "^2.1.0",
|
|
36
36
|
"process": "^0.11.10",
|
|
37
|
-
"pusher-js": "^5.1.1"
|
|
38
|
-
"ulid": "^2.3.0"
|
|
37
|
+
"pusher-js": "^5.1.1"
|
|
39
38
|
},
|
|
40
39
|
"devDependencies": {
|
|
41
40
|
"@types/minipass": "^3.3.5",
|
package/src/models/ai-agents.ts
CHANGED
|
@@ -2,6 +2,12 @@ export interface BaseMessage {
|
|
|
2
2
|
type: 'text' | 'textWithButtons' | 'carousel' | 'exit'
|
|
3
3
|
}
|
|
4
4
|
|
|
5
|
+
export interface Button {
|
|
6
|
+
text: string
|
|
7
|
+
payload?: string
|
|
8
|
+
url?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
5
11
|
export interface TextMessage extends BaseMessage {
|
|
6
12
|
type: 'text'
|
|
7
13
|
content: {
|
|
@@ -13,7 +19,7 @@ export interface TextWithButtonsMessage extends BaseMessage {
|
|
|
13
19
|
type: 'textWithButtons'
|
|
14
20
|
content: {
|
|
15
21
|
text: string
|
|
16
|
-
buttons:
|
|
22
|
+
buttons: Button[]
|
|
17
23
|
}
|
|
18
24
|
}
|
|
19
25
|
|
|
@@ -21,7 +27,7 @@ interface CarouselElement {
|
|
|
21
27
|
title: string
|
|
22
28
|
subtitle: string
|
|
23
29
|
image: string
|
|
24
|
-
button:
|
|
30
|
+
button: Button
|
|
25
31
|
}
|
|
26
32
|
|
|
27
33
|
export interface CarouselMessage extends BaseMessage {
|
|
@@ -46,9 +52,23 @@ export type AgenticOutputMessage = Exclude<OutputMessage, ExitMessage>
|
|
|
46
52
|
export interface RunResult {
|
|
47
53
|
messages: AgenticOutputMessage[]
|
|
48
54
|
toolsExecuted: string[]
|
|
55
|
+
memoryLength: number
|
|
49
56
|
exit: boolean
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
error: boolean
|
|
58
|
+
inputGuardrailsTriggered: string[]
|
|
59
|
+
outputGuardrailsTriggered: string[]
|
|
52
60
|
}
|
|
53
61
|
|
|
54
|
-
export type InferenceResponse = RunResult
|
|
62
|
+
export type InferenceResponse = RunResult
|
|
63
|
+
|
|
64
|
+
export interface GuardrailRule {
|
|
65
|
+
name: string
|
|
66
|
+
description: string
|
|
67
|
+
}
|
|
68
|
+
export interface AiAgentArgs {
|
|
69
|
+
name: string
|
|
70
|
+
instructions: string
|
|
71
|
+
activeTools?: { name: string }[]
|
|
72
|
+
inputGuardrailRules?: GuardrailRule[]
|
|
73
|
+
sourceIds?: string[]
|
|
74
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export enum EventAction {
|
|
2
|
+
AiAgent = 'ai_agent',
|
|
2
3
|
FeedbackCase = 'feedback_case',
|
|
3
4
|
FeedbackMessage = 'feedback_message',
|
|
4
5
|
FeedbackConversation = 'feedback_conversation',
|
|
@@ -112,6 +113,23 @@ export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
|
112
113
|
userInput: string
|
|
113
114
|
}
|
|
114
115
|
|
|
116
|
+
export interface EventAiAgent extends HtBaseEventProps {
|
|
117
|
+
action: EventAction.AiAgent
|
|
118
|
+
flowThreadId: string
|
|
119
|
+
flowId: string
|
|
120
|
+
flowName: string
|
|
121
|
+
flowNodeId: string
|
|
122
|
+
flowNodeContentId: string
|
|
123
|
+
flowNodeIsMeaningful: boolean
|
|
124
|
+
toolsExecuted: string[]
|
|
125
|
+
inputMessageId: string
|
|
126
|
+
memoryLength: number
|
|
127
|
+
inputGuardrailsTriggered: string[]
|
|
128
|
+
outputGuardrailsTriggered: string[]
|
|
129
|
+
exit: boolean
|
|
130
|
+
error: boolean
|
|
131
|
+
}
|
|
132
|
+
|
|
115
133
|
export enum KnowledgebaseFailReason {
|
|
116
134
|
NoKnowledge = 'no_knowledge',
|
|
117
135
|
Hallucination = 'hallucination',
|