rule-based-chat 1.0.0-beta.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/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -0
- package/dist/index.umd.js +2 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/types/conversation/ConversationManager.d.ts +82 -0
- package/dist/types/conversation/ConversationManager.d.ts.map +1 -0
- package/dist/types/conversation/index.d.ts +2 -0
- package/dist/types/conversation/index.d.ts.map +1 -0
- package/dist/types/engine/ChatEngine.d.ts +185 -0
- package/dist/types/engine/ChatEngine.d.ts.map +1 -0
- package/dist/types/engine/ConditionEvaluator.d.ts +106 -0
- package/dist/types/engine/ConditionEvaluator.d.ts.map +1 -0
- package/dist/types/engine/EventEmitter.d.ts +62 -0
- package/dist/types/engine/EventEmitter.d.ts.map +1 -0
- package/dist/types/engine/TemplateEngine.d.ts +42 -0
- package/dist/types/engine/TemplateEngine.d.ts.map +1 -0
- package/dist/types/engine/index.d.ts +5 -0
- package/dist/types/engine/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rules/RuleProcessor.d.ts +118 -0
- package/dist/types/rules/RuleProcessor.d.ts.map +1 -0
- package/dist/types/rules/index.d.ts +2 -0
- package/dist/types/rules/index.d.ts.map +1 -0
- package/dist/types/storage/MemoryStorage.d.ts +50 -0
- package/dist/types/storage/MemoryStorage.d.ts.map +1 -0
- package/dist/types/storage/StorageAdapter.d.ts +39 -0
- package/dist/types/storage/StorageAdapter.d.ts.map +1 -0
- package/dist/types/storage/index.d.ts +3 -0
- package/dist/types/storage/index.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +353 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single option for a question (for multiple choice, buttons, etc.)
|
|
3
|
+
*/
|
|
4
|
+
export interface AnswerOption {
|
|
5
|
+
value: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
displayConditions?: DisplayConditions;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Types of questions/messages the chatbot can send
|
|
12
|
+
*/
|
|
13
|
+
export type MessageType = 'text' | 'single-choice' | 'multi-choice' | 'end';
|
|
14
|
+
/**
|
|
15
|
+
* A node in the conversation flow
|
|
16
|
+
* Each node represents a question or message the bot can send
|
|
17
|
+
*/
|
|
18
|
+
export interface ConversationNode {
|
|
19
|
+
id: string;
|
|
20
|
+
type?: MessageType;
|
|
21
|
+
message: string;
|
|
22
|
+
options?: AnswerOption[];
|
|
23
|
+
conditionalMessages?: ConditionalMessage[];
|
|
24
|
+
displayConditions?: DisplayConditions;
|
|
25
|
+
actions?: ConversationNodeActions;
|
|
26
|
+
validation?: {
|
|
27
|
+
required?: boolean;
|
|
28
|
+
pattern?: string;
|
|
29
|
+
minLength?: number;
|
|
30
|
+
maxLength?: number;
|
|
31
|
+
customValidator?: string;
|
|
32
|
+
};
|
|
33
|
+
metadata?: Record<string, unknown>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Conditional message - alternative message text based on conditions
|
|
37
|
+
*/
|
|
38
|
+
export interface ConditionalMessage {
|
|
39
|
+
conditions: DisplayConditions;
|
|
40
|
+
message: string;
|
|
41
|
+
priority?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A rule that determines which node to go to next based on user's answer
|
|
45
|
+
*/
|
|
46
|
+
export interface TransitionRule {
|
|
47
|
+
fromNodeId: string;
|
|
48
|
+
conditions: RuleCondition[];
|
|
49
|
+
toNodeId: string;
|
|
50
|
+
conditionLogic?: 'and' | 'or';
|
|
51
|
+
priority?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Condition for evaluating a transition rule
|
|
55
|
+
* Supports nested conditions with AND/OR logic
|
|
56
|
+
*/
|
|
57
|
+
export interface RuleCondition {
|
|
58
|
+
field?: 'value' | 'selectedOptions' | 'context' | 'state' | 'custom';
|
|
59
|
+
operator?: 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'matches' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals' | 'in' | 'not_in' | 'exists' | 'not_exists' | 'always';
|
|
60
|
+
value?: string | number | boolean | string[];
|
|
61
|
+
sourceId?: string;
|
|
62
|
+
customEvaluator?: string;
|
|
63
|
+
logic?: 'and' | 'or';
|
|
64
|
+
conditions?: RuleCondition[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The complete conversation flow definition
|
|
68
|
+
*/
|
|
69
|
+
export interface ConversationFlow {
|
|
70
|
+
id: string;
|
|
71
|
+
name: string;
|
|
72
|
+
version: string;
|
|
73
|
+
startNodeId: string;
|
|
74
|
+
nodes: ConversationNode[];
|
|
75
|
+
transitions: TransitionRule[];
|
|
76
|
+
metadata?: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* User's answer to a question
|
|
80
|
+
*/
|
|
81
|
+
export interface UserAnswer {
|
|
82
|
+
nodeId: string;
|
|
83
|
+
value?: string;
|
|
84
|
+
selectedOptions?: string[];
|
|
85
|
+
timestamp: Date;
|
|
86
|
+
metadata?: Record<string, unknown>;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* A message in the conversation history
|
|
90
|
+
*/
|
|
91
|
+
export interface ConversationMessage {
|
|
92
|
+
id: string;
|
|
93
|
+
role: 'bot' | 'user';
|
|
94
|
+
content: string;
|
|
95
|
+
nodeId?: string;
|
|
96
|
+
timestamp: Date;
|
|
97
|
+
metadata?: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Current state of a conversation
|
|
101
|
+
*/
|
|
102
|
+
export interface ConversationState {
|
|
103
|
+
conversationId: string;
|
|
104
|
+
flowId: string;
|
|
105
|
+
currentNodeId: string;
|
|
106
|
+
status: 'active' | 'completed' | 'paused' | 'error';
|
|
107
|
+
answers: UserAnswer[];
|
|
108
|
+
messages: ConversationMessage[];
|
|
109
|
+
context: Record<string, unknown>;
|
|
110
|
+
startedAt: Date;
|
|
111
|
+
updatedAt: Date;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Result returned when processing user input
|
|
115
|
+
*/
|
|
116
|
+
export interface ProcessingResult {
|
|
117
|
+
success: boolean;
|
|
118
|
+
nextNode: ConversationNode | null;
|
|
119
|
+
validationError?: string;
|
|
120
|
+
isComplete: boolean;
|
|
121
|
+
context: Record<string, unknown>;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Configuration options for the ChatEngine
|
|
125
|
+
*/
|
|
126
|
+
export interface ChatEngineConfig {
|
|
127
|
+
defaultFlow?: ConversationFlow;
|
|
128
|
+
enableLogging?: boolean;
|
|
129
|
+
customValidators?: Record<string, ValidatorFunction>;
|
|
130
|
+
customEvaluators?: Record<string, EvaluatorFunction>;
|
|
131
|
+
messageProcessor?: MessageProcessor;
|
|
132
|
+
variableResolvers?: Record<string, VariableResolver>;
|
|
133
|
+
eventHandlers?: EventHandlers;
|
|
134
|
+
conditionEvaluators?: Record<string, ConditionEvaluatorFunction>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Custom validator function type
|
|
138
|
+
*/
|
|
139
|
+
export type ValidatorFunction = (value: string, answer: UserAnswer, state: ConversationState) => boolean | string;
|
|
140
|
+
/**
|
|
141
|
+
* Custom evaluator function type for rule conditions
|
|
142
|
+
*/
|
|
143
|
+
export type EvaluatorFunction = (answer: UserAnswer, state: ConversationState, condition: RuleCondition) => boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Storage adapter interface - implement this for custom storage
|
|
146
|
+
*/
|
|
147
|
+
export interface IStorageAdapter {
|
|
148
|
+
get(conversationId: string): Promise<ConversationState | null>;
|
|
149
|
+
save(state: ConversationState): Promise<void>;
|
|
150
|
+
delete(conversationId: string): Promise<void>;
|
|
151
|
+
exists(conversationId: string): Promise<boolean>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Function type for processing messages before display
|
|
155
|
+
* Can fetch data, calculate values, or transform the message
|
|
156
|
+
*/
|
|
157
|
+
export type MessageProcessor = (message: string, state: ConversationState, node: ConversationNode) => Promise<string> | string;
|
|
158
|
+
/**
|
|
159
|
+
* Template variable resolver function
|
|
160
|
+
* Resolves a single variable like {{userName}} or {{orderTotal}}
|
|
161
|
+
*/
|
|
162
|
+
export type VariableResolver = (variableName: string, state: ConversationState, node: ConversationNode) => Promise<string | number | boolean | null> | string | number | boolean | null;
|
|
163
|
+
/**
|
|
164
|
+
* Event types that can be hooked into
|
|
165
|
+
*/
|
|
166
|
+
export type ChatEventType = 'onConversationStart' | 'onConversationEnd' | 'onBeforeTransition' | 'onAfterTransition' | 'onAnswerRecorded' | 'onValidationError' | 'onConversationPaused' | 'onConversationResumed' | 'onConversationReset' | 'onError';
|
|
167
|
+
/**
|
|
168
|
+
* Base event payload - all events include these fields
|
|
169
|
+
*/
|
|
170
|
+
export interface BaseEventPayload {
|
|
171
|
+
conversationId: string;
|
|
172
|
+
timestamp: Date;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Payload for onConversationStart event
|
|
176
|
+
*/
|
|
177
|
+
export interface ConversationStartPayload extends BaseEventPayload {
|
|
178
|
+
flowId: string;
|
|
179
|
+
firstNode: ConversationNode;
|
|
180
|
+
initialContext: Record<string, unknown>;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Payload for onConversationEnd event
|
|
184
|
+
*/
|
|
185
|
+
export interface ConversationEndPayload extends BaseEventPayload {
|
|
186
|
+
flowId: string;
|
|
187
|
+
finalNode: ConversationNode;
|
|
188
|
+
totalAnswers: number;
|
|
189
|
+
state: ConversationState;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Payload for onBeforeTransition event
|
|
193
|
+
* Return false from handler to cancel the transition
|
|
194
|
+
*/
|
|
195
|
+
export interface BeforeTransitionPayload extends BaseEventPayload {
|
|
196
|
+
fromNode: ConversationNode;
|
|
197
|
+
toNode: ConversationNode;
|
|
198
|
+
answer: UserAnswer;
|
|
199
|
+
state: ConversationState;
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Payload for onAfterTransition event
|
|
203
|
+
*/
|
|
204
|
+
export interface AfterTransitionPayload extends BaseEventPayload {
|
|
205
|
+
fromNode: ConversationNode;
|
|
206
|
+
toNode: ConversationNode;
|
|
207
|
+
answer: UserAnswer;
|
|
208
|
+
state: ConversationState;
|
|
209
|
+
processedMessage: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Payload for onAnswerRecorded event
|
|
213
|
+
*/
|
|
214
|
+
export interface AnswerRecordedPayload extends BaseEventPayload {
|
|
215
|
+
node: ConversationNode;
|
|
216
|
+
answer: UserAnswer;
|
|
217
|
+
state: ConversationState;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Payload for onValidationError event
|
|
221
|
+
*/
|
|
222
|
+
export interface ValidationErrorPayload extends BaseEventPayload {
|
|
223
|
+
node: ConversationNode;
|
|
224
|
+
error: string;
|
|
225
|
+
value?: string;
|
|
226
|
+
selectedOptions?: string[];
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Payload for onConversationPaused event
|
|
230
|
+
*/
|
|
231
|
+
export interface ConversationPausedPayload extends BaseEventPayload {
|
|
232
|
+
currentNode: ConversationNode;
|
|
233
|
+
state: ConversationState;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Payload for onConversationResumed event
|
|
237
|
+
*/
|
|
238
|
+
export interface ConversationResumedPayload extends BaseEventPayload {
|
|
239
|
+
currentNode: ConversationNode;
|
|
240
|
+
state: ConversationState;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Payload for onConversationReset event
|
|
244
|
+
*/
|
|
245
|
+
export interface ConversationResetPayload extends BaseEventPayload {
|
|
246
|
+
flowId: string;
|
|
247
|
+
firstNode: ConversationNode;
|
|
248
|
+
previousAnswersCount: number;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Payload for onError event
|
|
252
|
+
*/
|
|
253
|
+
export interface ErrorPayload extends BaseEventPayload {
|
|
254
|
+
error: Error;
|
|
255
|
+
context: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Map of event types to their payload types
|
|
259
|
+
*/
|
|
260
|
+
export interface ChatEventPayloadMap {
|
|
261
|
+
onConversationStart: ConversationStartPayload;
|
|
262
|
+
onConversationEnd: ConversationEndPayload;
|
|
263
|
+
onBeforeTransition: BeforeTransitionPayload;
|
|
264
|
+
onAfterTransition: AfterTransitionPayload;
|
|
265
|
+
onAnswerRecorded: AnswerRecordedPayload;
|
|
266
|
+
onValidationError: ValidationErrorPayload;
|
|
267
|
+
onConversationPaused: ConversationPausedPayload;
|
|
268
|
+
onConversationResumed: ConversationResumedPayload;
|
|
269
|
+
onConversationReset: ConversationResetPayload;
|
|
270
|
+
onError: ErrorPayload;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Event handler function type
|
|
274
|
+
* For onBeforeTransition, return false to cancel the transition
|
|
275
|
+
*/
|
|
276
|
+
export type EventHandler<T extends ChatEventType> = (payload: ChatEventPayloadMap[T]) => void | boolean | Promise<void> | Promise<boolean>;
|
|
277
|
+
/**
|
|
278
|
+
* Event handlers configuration for ChatEngine
|
|
279
|
+
*/
|
|
280
|
+
export type EventHandlers = {
|
|
281
|
+
[K in ChatEventType]?: EventHandler<K> | EventHandler<K>[];
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Condition operator types for evaluating display conditions
|
|
285
|
+
*/
|
|
286
|
+
export type ConditionOperator = 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'in' | 'not_in' | 'greater_than' | 'less_than' | 'greater_than_or_equals' | 'less_than_or_equals' | 'exists' | 'not_exists' | 'matches' | 'custom';
|
|
287
|
+
/**
|
|
288
|
+
* Source of the value to evaluate
|
|
289
|
+
*/
|
|
290
|
+
export type ConditionSource = 'answer' | 'context' | 'metadata' | 'state' | 'custom';
|
|
291
|
+
/**
|
|
292
|
+
* A single display condition
|
|
293
|
+
*/
|
|
294
|
+
export interface DisplayCondition {
|
|
295
|
+
source: ConditionSource;
|
|
296
|
+
sourceId?: string;
|
|
297
|
+
field?: string;
|
|
298
|
+
operator: ConditionOperator;
|
|
299
|
+
value?: string | number | boolean | string[];
|
|
300
|
+
customEvaluator?: string;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Grouped conditions with logical operators
|
|
304
|
+
*/
|
|
305
|
+
export interface ConditionGroup {
|
|
306
|
+
logic: 'and' | 'or';
|
|
307
|
+
conditions: (DisplayCondition | ConditionGroup)[];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Display conditions can be a single condition, array (AND), or group
|
|
311
|
+
*/
|
|
312
|
+
export type DisplayConditions = DisplayCondition | DisplayCondition[] | ConditionGroup;
|
|
313
|
+
/**
|
|
314
|
+
* Custom condition evaluator function
|
|
315
|
+
*/
|
|
316
|
+
export type ConditionEvaluatorFunction = (state: ConversationState, condition: DisplayCondition) => boolean | Promise<boolean>;
|
|
317
|
+
/**
|
|
318
|
+
* Goto action - allows jumping to any node
|
|
319
|
+
*/
|
|
320
|
+
export interface GotoAction {
|
|
321
|
+
targetNodeId: string;
|
|
322
|
+
preserveHistory?: boolean;
|
|
323
|
+
reason?: string;
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Result of a goto operation
|
|
327
|
+
*/
|
|
328
|
+
export interface GotoResult {
|
|
329
|
+
success: boolean;
|
|
330
|
+
previousNodeId: string | null;
|
|
331
|
+
currentNodeId: string;
|
|
332
|
+
node: ConversationNode | null;
|
|
333
|
+
processedMessage?: string;
|
|
334
|
+
filteredOptions?: AnswerOption[];
|
|
335
|
+
error?: string;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Special actions that can be triggered from nodes
|
|
339
|
+
*/
|
|
340
|
+
export interface NodeAction {
|
|
341
|
+
type: 'goto' | 'restart' | 'end' | 'pause';
|
|
342
|
+
targetNodeId?: string;
|
|
343
|
+
conditions?: RuleCondition[];
|
|
344
|
+
conditionLogic?: 'and' | 'or';
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Extended ConversationNode with actions support
|
|
348
|
+
*/
|
|
349
|
+
export interface ConversationNodeActions {
|
|
350
|
+
onEnter?: NodeAction[];
|
|
351
|
+
onExit?: NodeAction[];
|
|
352
|
+
}
|
|
353
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN,eAAe,GACf,cAAc,GACd,KAAK,CAAC;AAEV;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IAGzB,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC3C,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAEtC,OAAO,CAAC,EAAE,uBAAuB,CAAC;IAGlC,UAAU,CAAC,EAAE;QAC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B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rule-based-chat",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "A package for building a rule-based chatbot",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/types/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/types/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"author": "Manonero",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"dev": "vite",
|
|
23
|
+
"build": "tsc && vite build",
|
|
24
|
+
"preview": "vite preview"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^25.0.3",
|
|
28
|
+
"@types/uuid": "^11.0.0",
|
|
29
|
+
"terser": "^5.44.1",
|
|
30
|
+
"typescript": "~5.9.3",
|
|
31
|
+
"vite": "^7.2.4",
|
|
32
|
+
"vite-plugin-dts": "^4.5.4"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"uuid": "^13.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|