@cossistant/types 0.1.0 → 0.1.2
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/analytics.d.ts +31 -0
- package/analytics.d.ts.map +1 -0
- package/analytics.js +41 -0
- package/analytics.js.map +1 -0
- package/api/ai-agent-capabilities.d.ts +16 -19
- package/api/ai-agent-capabilities.d.ts.map +1 -1
- package/api/ai-agent-capabilities.js +215 -286
- package/api/ai-agent-capabilities.js.map +1 -1
- package/api/ai-agent-defaults.d.ts +6 -0
- package/api/ai-agent-defaults.d.ts.map +1 -0
- package/api/ai-agent-defaults.js +33 -0
- package/api/ai-agent-defaults.js.map +1 -0
- package/api/ai-agent.d.ts +314 -207
- package/api/ai-agent.d.ts.map +1 -1
- package/api/ai-agent.js +175 -111
- package/api/ai-agent.js.map +1 -1
- package/api/conversation.d.ts +79 -56
- package/api/conversation.d.ts.map +1 -1
- package/api/conversation.js +7 -2
- package/api/conversation.js.map +1 -1
- package/api/feedback.d.ts +5 -0
- package/api/feedback.d.ts.map +1 -1
- package/api/feedback.js +2 -0
- package/api/feedback.js.map +1 -1
- package/api/index.d.ts +7 -6
- package/api/index.js +7 -6
- package/api/link-source.d.ts +4 -4
- package/api/link-source.d.ts.map +1 -1
- package/api/link-source.js +1 -1
- package/api/link-source.js.map +1 -1
- package/api/timeline-item.d.ts +79 -67
- package/api/timeline-item.d.ts.map +1 -1
- package/api/timeline-item.js +3 -1
- package/api/timeline-item.js.map +1 -1
- package/api/user.d.ts +1 -1
- package/api/user.d.ts.map +1 -1
- package/api/user.js +2 -2
- package/api/user.js.map +1 -1
- package/api/visitor.d.ts +225 -1
- package/api/visitor.d.ts.map +1 -1
- package/api/visitor.js +142 -1
- package/api/visitor.js.map +1 -1
- package/api/website.d.ts +16 -7
- package/api/website.d.ts.map +1 -1
- package/api/website.js +16 -2
- package/api/website.js.map +1 -1
- package/enums.d.ts +2 -0
- package/enums.d.ts.map +1 -1
- package/enums.js +3 -1
- package/enums.js.map +1 -1
- package/index.d.ts +10 -8
- package/index.d.ts.map +1 -1
- package/index.js +10 -8
- package/package.json +1 -1
- package/realtime-events.d.ts +106 -36
- package/realtime-events.d.ts.map +1 -1
- package/realtime-events.js +6 -2
- package/realtime-events.js.map +1 -1
- package/schemas.d.ts +13 -11
- package/schemas.d.ts.map +1 -1
- package/tool-timeline-policy.d.ts +19 -2
- package/tool-timeline-policy.d.ts.map +1 -1
- package/tool-timeline-policy.js +29 -6
- package/tool-timeline-policy.js.map +1 -1
- package/trpc/conversation-hard-limit.d.ts +30 -0
- package/trpc/conversation-hard-limit.d.ts.map +1 -0
- package/trpc/conversation-hard-limit.js +43 -0
- package/trpc/conversation-hard-limit.js.map +1 -0
- package/trpc/conversation.d.ts +84 -44
- package/trpc/conversation.d.ts.map +1 -1
- package/trpc/conversation.js +6 -0
- package/trpc/conversation.js.map +1 -1
- package/trpc/visitor.d.ts +73 -15
- package/trpc/visitor.d.ts.map +1 -1
- package/trpc/visitor.js +15 -8
- package/trpc/visitor.js.map +1 -1
package/realtime-events.d.ts
CHANGED
|
@@ -88,8 +88,8 @@ declare const realtimeSchema: {
|
|
|
88
88
|
conversationId: z.ZodString;
|
|
89
89
|
organizationId: z.ZodString;
|
|
90
90
|
visibility: z.ZodEnum<{
|
|
91
|
-
private: "private";
|
|
92
91
|
public: "public";
|
|
92
|
+
private: "private";
|
|
93
93
|
}>;
|
|
94
94
|
type: z.ZodEnum<{
|
|
95
95
|
message: "message";
|
|
@@ -134,8 +134,8 @@ declare const realtimeSchema: {
|
|
|
134
134
|
conversationId: z.ZodString;
|
|
135
135
|
organizationId: z.ZodString;
|
|
136
136
|
visibility: z.ZodEnum<{
|
|
137
|
-
private: "private";
|
|
138
137
|
public: "public";
|
|
138
|
+
private: "private";
|
|
139
139
|
}>;
|
|
140
140
|
type: z.ZodEnum<{
|
|
141
141
|
message: "message";
|
|
@@ -162,8 +162,8 @@ declare const realtimeSchema: {
|
|
|
162
162
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
163
163
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
164
164
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
165
|
-
private: "private";
|
|
166
165
|
public: "public";
|
|
166
|
+
private: "private";
|
|
167
167
|
}>>;
|
|
168
168
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
169
169
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -176,8 +176,8 @@ declare const realtimeSchema: {
|
|
|
176
176
|
triggerMessageId: z.ZodString;
|
|
177
177
|
workflowRunId: z.ZodString;
|
|
178
178
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
179
|
-
private: "private";
|
|
180
179
|
public: "public";
|
|
180
|
+
private: "private";
|
|
181
181
|
}>>;
|
|
182
182
|
}, z.core.$strip>>;
|
|
183
183
|
}, z.core.$strip>>;
|
|
@@ -197,8 +197,8 @@ declare const realtimeSchema: {
|
|
|
197
197
|
callProviderMetadata: z.ZodOptional<z.ZodObject<{
|
|
198
198
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
199
199
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
200
|
-
private: "private";
|
|
201
200
|
public: "public";
|
|
201
|
+
private: "private";
|
|
202
202
|
}>>;
|
|
203
203
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
204
204
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -211,8 +211,8 @@ declare const realtimeSchema: {
|
|
|
211
211
|
triggerMessageId: z.ZodString;
|
|
212
212
|
workflowRunId: z.ZodString;
|
|
213
213
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
214
|
-
private: "private";
|
|
215
214
|
public: "public";
|
|
215
|
+
private: "private";
|
|
216
216
|
}>>;
|
|
217
217
|
}, z.core.$strip>>;
|
|
218
218
|
}, z.core.$strip>>;
|
|
@@ -220,8 +220,8 @@ declare const realtimeSchema: {
|
|
|
220
220
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
221
221
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
222
222
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
223
|
-
private: "private";
|
|
224
223
|
public: "public";
|
|
224
|
+
private: "private";
|
|
225
225
|
}>>;
|
|
226
226
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
227
227
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -234,8 +234,8 @@ declare const realtimeSchema: {
|
|
|
234
234
|
triggerMessageId: z.ZodString;
|
|
235
235
|
workflowRunId: z.ZodString;
|
|
236
236
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
237
|
-
private: "private";
|
|
238
237
|
public: "public";
|
|
238
|
+
private: "private";
|
|
239
239
|
}>>;
|
|
240
240
|
}, z.core.$strip>>;
|
|
241
241
|
}, z.core.$strip>>;
|
|
@@ -248,8 +248,8 @@ declare const realtimeSchema: {
|
|
|
248
248
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
249
249
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
250
250
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
251
|
-
private: "private";
|
|
252
251
|
public: "public";
|
|
252
|
+
private: "private";
|
|
253
253
|
}>>;
|
|
254
254
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
255
255
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -262,8 +262,8 @@ declare const realtimeSchema: {
|
|
|
262
262
|
triggerMessageId: z.ZodString;
|
|
263
263
|
workflowRunId: z.ZodString;
|
|
264
264
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
265
|
-
private: "private";
|
|
266
265
|
public: "public";
|
|
266
|
+
private: "private";
|
|
267
267
|
}>>;
|
|
268
268
|
}, z.core.$strip>>;
|
|
269
269
|
}, z.core.$strip>>;
|
|
@@ -277,8 +277,8 @@ declare const realtimeSchema: {
|
|
|
277
277
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
278
278
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
279
279
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
280
|
-
private: "private";
|
|
281
280
|
public: "public";
|
|
281
|
+
private: "private";
|
|
282
282
|
}>>;
|
|
283
283
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
284
284
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -291,8 +291,8 @@ declare const realtimeSchema: {
|
|
|
291
291
|
triggerMessageId: z.ZodString;
|
|
292
292
|
workflowRunId: z.ZodString;
|
|
293
293
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
294
|
-
private: "private";
|
|
295
294
|
public: "public";
|
|
295
|
+
private: "private";
|
|
296
296
|
}>>;
|
|
297
297
|
}, z.core.$strip>>;
|
|
298
298
|
}, z.core.$strip>>;
|
|
@@ -330,6 +330,8 @@ declare const realtimeSchema: {
|
|
|
330
330
|
visitor_blocked: "visitor_blocked";
|
|
331
331
|
visitor_unblocked: "visitor_unblocked";
|
|
332
332
|
visitor_identified: "visitor_identified";
|
|
333
|
+
ai_paused: "ai_paused";
|
|
334
|
+
ai_resumed: "ai_resumed";
|
|
333
335
|
}>;
|
|
334
336
|
actorUserId: z.ZodNullable<z.ZodString>;
|
|
335
337
|
actorAiAgentId: z.ZodNullable<z.ZodString>;
|
|
@@ -383,6 +385,16 @@ declare const realtimeSchema: {
|
|
|
383
385
|
websiteId: z.ZodString;
|
|
384
386
|
channel: z.ZodString;
|
|
385
387
|
title: z.ZodNullable<z.ZodString>;
|
|
388
|
+
titleSource: z.ZodNullable<z.ZodEnum<{
|
|
389
|
+
ai: "ai";
|
|
390
|
+
user: "user";
|
|
391
|
+
}>>;
|
|
392
|
+
sentiment: z.ZodNullable<z.ZodEnum<{
|
|
393
|
+
positive: "positive";
|
|
394
|
+
negative: "negative";
|
|
395
|
+
neutral: "neutral";
|
|
396
|
+
}>>;
|
|
397
|
+
sentimentConfidence: z.ZodNullable<z.ZodNumber>;
|
|
386
398
|
resolutionTime: z.ZodNullable<z.ZodNumber>;
|
|
387
399
|
visitorRating: z.ZodNullable<z.ZodNumber>;
|
|
388
400
|
visitorRatingAt: z.ZodNullable<z.ZodString>;
|
|
@@ -407,8 +419,8 @@ declare const realtimeSchema: {
|
|
|
407
419
|
conversationId: z.ZodString;
|
|
408
420
|
organizationId: z.ZodString;
|
|
409
421
|
visibility: z.ZodEnum<{
|
|
410
|
-
private: "private";
|
|
411
422
|
public: "public";
|
|
423
|
+
private: "private";
|
|
412
424
|
}>;
|
|
413
425
|
type: z.ZodEnum<{
|
|
414
426
|
message: "message";
|
|
@@ -435,8 +447,8 @@ declare const realtimeSchema: {
|
|
|
435
447
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
436
448
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
437
449
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
438
|
-
private: "private";
|
|
439
450
|
public: "public";
|
|
451
|
+
private: "private";
|
|
440
452
|
}>>;
|
|
441
453
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
442
454
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -449,8 +461,8 @@ declare const realtimeSchema: {
|
|
|
449
461
|
triggerMessageId: z.ZodString;
|
|
450
462
|
workflowRunId: z.ZodString;
|
|
451
463
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
452
|
-
private: "private";
|
|
453
464
|
public: "public";
|
|
465
|
+
private: "private";
|
|
454
466
|
}>>;
|
|
455
467
|
}, z.core.$strip>>;
|
|
456
468
|
}, z.core.$strip>>;
|
|
@@ -470,8 +482,8 @@ declare const realtimeSchema: {
|
|
|
470
482
|
callProviderMetadata: z.ZodOptional<z.ZodObject<{
|
|
471
483
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
472
484
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
473
|
-
private: "private";
|
|
474
485
|
public: "public";
|
|
486
|
+
private: "private";
|
|
475
487
|
}>>;
|
|
476
488
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
477
489
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -484,8 +496,8 @@ declare const realtimeSchema: {
|
|
|
484
496
|
triggerMessageId: z.ZodString;
|
|
485
497
|
workflowRunId: z.ZodString;
|
|
486
498
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
487
|
-
private: "private";
|
|
488
499
|
public: "public";
|
|
500
|
+
private: "private";
|
|
489
501
|
}>>;
|
|
490
502
|
}, z.core.$strip>>;
|
|
491
503
|
}, z.core.$strip>>;
|
|
@@ -493,8 +505,8 @@ declare const realtimeSchema: {
|
|
|
493
505
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
494
506
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
495
507
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
496
|
-
private: "private";
|
|
497
508
|
public: "public";
|
|
509
|
+
private: "private";
|
|
498
510
|
}>>;
|
|
499
511
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
500
512
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -507,8 +519,8 @@ declare const realtimeSchema: {
|
|
|
507
519
|
triggerMessageId: z.ZodString;
|
|
508
520
|
workflowRunId: z.ZodString;
|
|
509
521
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
510
|
-
private: "private";
|
|
511
522
|
public: "public";
|
|
523
|
+
private: "private";
|
|
512
524
|
}>>;
|
|
513
525
|
}, z.core.$strip>>;
|
|
514
526
|
}, z.core.$strip>>;
|
|
@@ -521,8 +533,8 @@ declare const realtimeSchema: {
|
|
|
521
533
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
522
534
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
523
535
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
524
|
-
private: "private";
|
|
525
536
|
public: "public";
|
|
537
|
+
private: "private";
|
|
526
538
|
}>>;
|
|
527
539
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
528
540
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -535,8 +547,8 @@ declare const realtimeSchema: {
|
|
|
535
547
|
triggerMessageId: z.ZodString;
|
|
536
548
|
workflowRunId: z.ZodString;
|
|
537
549
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
538
|
-
private: "private";
|
|
539
550
|
public: "public";
|
|
551
|
+
private: "private";
|
|
540
552
|
}>>;
|
|
541
553
|
}, z.core.$strip>>;
|
|
542
554
|
}, z.core.$strip>>;
|
|
@@ -550,8 +562,8 @@ declare const realtimeSchema: {
|
|
|
550
562
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
551
563
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
552
564
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
553
|
-
private: "private";
|
|
554
565
|
public: "public";
|
|
566
|
+
private: "private";
|
|
555
567
|
}>>;
|
|
556
568
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
557
569
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -564,8 +576,8 @@ declare const realtimeSchema: {
|
|
|
564
576
|
triggerMessageId: z.ZodString;
|
|
565
577
|
workflowRunId: z.ZodString;
|
|
566
578
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
567
|
-
private: "private";
|
|
568
579
|
public: "public";
|
|
580
|
+
private: "private";
|
|
569
581
|
}>>;
|
|
570
582
|
}, z.core.$strip>>;
|
|
571
583
|
}, z.core.$strip>>;
|
|
@@ -603,6 +615,8 @@ declare const realtimeSchema: {
|
|
|
603
615
|
visitor_blocked: "visitor_blocked";
|
|
604
616
|
visitor_unblocked: "visitor_unblocked";
|
|
605
617
|
visitor_identified: "visitor_identified";
|
|
618
|
+
ai_paused: "ai_paused";
|
|
619
|
+
ai_resumed: "ai_resumed";
|
|
606
620
|
}>;
|
|
607
621
|
actorUserId: z.ZodNullable<z.ZodString>;
|
|
608
622
|
actorAiAgentId: z.ZodNullable<z.ZodString>;
|
|
@@ -628,8 +642,8 @@ declare const realtimeSchema: {
|
|
|
628
642
|
conversationId: z.ZodString;
|
|
629
643
|
organizationId: z.ZodString;
|
|
630
644
|
visibility: z.ZodEnum<{
|
|
631
|
-
private: "private";
|
|
632
645
|
public: "public";
|
|
646
|
+
private: "private";
|
|
633
647
|
}>;
|
|
634
648
|
type: z.ZodEnum<{
|
|
635
649
|
message: "message";
|
|
@@ -656,8 +670,8 @@ declare const realtimeSchema: {
|
|
|
656
670
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
657
671
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
658
672
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
659
|
-
private: "private";
|
|
660
673
|
public: "public";
|
|
674
|
+
private: "private";
|
|
661
675
|
}>>;
|
|
662
676
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
663
677
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -670,8 +684,8 @@ declare const realtimeSchema: {
|
|
|
670
684
|
triggerMessageId: z.ZodString;
|
|
671
685
|
workflowRunId: z.ZodString;
|
|
672
686
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
673
|
-
private: "private";
|
|
674
687
|
public: "public";
|
|
688
|
+
private: "private";
|
|
675
689
|
}>>;
|
|
676
690
|
}, z.core.$strip>>;
|
|
677
691
|
}, z.core.$strip>>;
|
|
@@ -691,8 +705,8 @@ declare const realtimeSchema: {
|
|
|
691
705
|
callProviderMetadata: z.ZodOptional<z.ZodObject<{
|
|
692
706
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
693
707
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
694
|
-
private: "private";
|
|
695
708
|
public: "public";
|
|
709
|
+
private: "private";
|
|
696
710
|
}>>;
|
|
697
711
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
698
712
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -705,8 +719,8 @@ declare const realtimeSchema: {
|
|
|
705
719
|
triggerMessageId: z.ZodString;
|
|
706
720
|
workflowRunId: z.ZodString;
|
|
707
721
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
708
|
-
private: "private";
|
|
709
722
|
public: "public";
|
|
723
|
+
private: "private";
|
|
710
724
|
}>>;
|
|
711
725
|
}, z.core.$strip>>;
|
|
712
726
|
}, z.core.$strip>>;
|
|
@@ -714,8 +728,8 @@ declare const realtimeSchema: {
|
|
|
714
728
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
715
729
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
716
730
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
717
|
-
private: "private";
|
|
718
731
|
public: "public";
|
|
732
|
+
private: "private";
|
|
719
733
|
}>>;
|
|
720
734
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
721
735
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -728,8 +742,8 @@ declare const realtimeSchema: {
|
|
|
728
742
|
triggerMessageId: z.ZodString;
|
|
729
743
|
workflowRunId: z.ZodString;
|
|
730
744
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
731
|
-
private: "private";
|
|
732
745
|
public: "public";
|
|
746
|
+
private: "private";
|
|
733
747
|
}>>;
|
|
734
748
|
}, z.core.$strip>>;
|
|
735
749
|
}, z.core.$strip>>;
|
|
@@ -742,8 +756,8 @@ declare const realtimeSchema: {
|
|
|
742
756
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
743
757
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
744
758
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
745
|
-
private: "private";
|
|
746
759
|
public: "public";
|
|
760
|
+
private: "private";
|
|
747
761
|
}>>;
|
|
748
762
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
749
763
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -756,8 +770,8 @@ declare const realtimeSchema: {
|
|
|
756
770
|
triggerMessageId: z.ZodString;
|
|
757
771
|
workflowRunId: z.ZodString;
|
|
758
772
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
759
|
-
private: "private";
|
|
760
773
|
public: "public";
|
|
774
|
+
private: "private";
|
|
761
775
|
}>>;
|
|
762
776
|
}, z.core.$strip>>;
|
|
763
777
|
}, z.core.$strip>>;
|
|
@@ -771,8 +785,8 @@ declare const realtimeSchema: {
|
|
|
771
785
|
providerMetadata: z.ZodOptional<z.ZodObject<{
|
|
772
786
|
cossistant: z.ZodOptional<z.ZodObject<{
|
|
773
787
|
visibility: z.ZodOptional<z.ZodEnum<{
|
|
774
|
-
private: "private";
|
|
775
788
|
public: "public";
|
|
789
|
+
private: "private";
|
|
776
790
|
}>>;
|
|
777
791
|
progressMessage: z.ZodOptional<z.ZodString>;
|
|
778
792
|
knowledgeId: z.ZodOptional<z.ZodString>;
|
|
@@ -785,8 +799,8 @@ declare const realtimeSchema: {
|
|
|
785
799
|
triggerMessageId: z.ZodString;
|
|
786
800
|
workflowRunId: z.ZodString;
|
|
787
801
|
triggerVisibility: z.ZodOptional<z.ZodEnum<{
|
|
788
|
-
private: "private";
|
|
789
802
|
public: "public";
|
|
803
|
+
private: "private";
|
|
790
804
|
}>>;
|
|
791
805
|
}, z.core.$strip>>;
|
|
792
806
|
}, z.core.$strip>>;
|
|
@@ -824,6 +838,8 @@ declare const realtimeSchema: {
|
|
|
824
838
|
visitor_blocked: "visitor_blocked";
|
|
825
839
|
visitor_unblocked: "visitor_unblocked";
|
|
826
840
|
visitor_identified: "visitor_identified";
|
|
841
|
+
ai_paused: "ai_paused";
|
|
842
|
+
ai_resumed: "ai_resumed";
|
|
827
843
|
}>;
|
|
828
844
|
actorUserId: z.ZodNullable<z.ZodString>;
|
|
829
845
|
actorAiAgentId: z.ZodNullable<z.ZodString>;
|
|
@@ -844,6 +860,8 @@ declare const realtimeSchema: {
|
|
|
844
860
|
createdAt: z.ZodString;
|
|
845
861
|
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
846
862
|
}, z.core.$strip>>;
|
|
863
|
+
dashboardLocked: z.ZodOptional<z.ZodBoolean>;
|
|
864
|
+
dashboardLockReason: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"conversation_limit">, z.ZodNull]>>;
|
|
847
865
|
viewIds: z.ZodArray<z.ZodString>;
|
|
848
866
|
seenData: z.ZodArray<z.ZodObject<{
|
|
849
867
|
id: z.ZodString;
|
|
@@ -890,6 +908,54 @@ declare const realtimeSchema: {
|
|
|
890
908
|
blockedAt: z.ZodNullable<z.ZodString>;
|
|
891
909
|
blockedByUserId: z.ZodNullable<z.ZodString>;
|
|
892
910
|
isBlocked: z.ZodBoolean;
|
|
911
|
+
attribution: z.ZodNullable<z.ZodObject<{
|
|
912
|
+
version: z.ZodLiteral<1>;
|
|
913
|
+
firstTouch: z.ZodObject<{
|
|
914
|
+
channel: z.ZodEnum<{
|
|
915
|
+
email: "email";
|
|
916
|
+
direct: "direct";
|
|
917
|
+
paid: "paid";
|
|
918
|
+
organic_search: "organic_search";
|
|
919
|
+
social: "social";
|
|
920
|
+
referral: "referral";
|
|
921
|
+
}>;
|
|
922
|
+
isDirect: z.ZodBoolean;
|
|
923
|
+
referrer: z.ZodObject<{
|
|
924
|
+
url: z.ZodNullable<z.ZodString>;
|
|
925
|
+
domain: z.ZodNullable<z.ZodString>;
|
|
926
|
+
}, z.core.$strip>;
|
|
927
|
+
landing: z.ZodObject<{
|
|
928
|
+
url: z.ZodNullable<z.ZodString>;
|
|
929
|
+
path: z.ZodNullable<z.ZodString>;
|
|
930
|
+
title: z.ZodNullable<z.ZodString>;
|
|
931
|
+
}, z.core.$strip>;
|
|
932
|
+
utm: z.ZodObject<{
|
|
933
|
+
source: z.ZodNullable<z.ZodString>;
|
|
934
|
+
medium: z.ZodNullable<z.ZodString>;
|
|
935
|
+
campaign: z.ZodNullable<z.ZodString>;
|
|
936
|
+
content: z.ZodNullable<z.ZodString>;
|
|
937
|
+
term: z.ZodNullable<z.ZodString>;
|
|
938
|
+
}, z.core.$strip>;
|
|
939
|
+
clickIds: z.ZodObject<{
|
|
940
|
+
gclid: z.ZodNullable<z.ZodString>;
|
|
941
|
+
gbraid: z.ZodNullable<z.ZodString>;
|
|
942
|
+
wbraid: z.ZodNullable<z.ZodString>;
|
|
943
|
+
fbclid: z.ZodNullable<z.ZodString>;
|
|
944
|
+
msclkid: z.ZodNullable<z.ZodString>;
|
|
945
|
+
ttclid: z.ZodNullable<z.ZodString>;
|
|
946
|
+
li_fat_id: z.ZodNullable<z.ZodString>;
|
|
947
|
+
twclid: z.ZodNullable<z.ZodString>;
|
|
948
|
+
}, z.core.$strip>;
|
|
949
|
+
capturedAt: z.ZodString;
|
|
950
|
+
}, z.core.$strip>;
|
|
951
|
+
}, z.core.$strip>>;
|
|
952
|
+
currentPage: z.ZodNullable<z.ZodObject<{
|
|
953
|
+
url: z.ZodNullable<z.ZodString>;
|
|
954
|
+
path: z.ZodNullable<z.ZodString>;
|
|
955
|
+
title: z.ZodNullable<z.ZodString>;
|
|
956
|
+
referrerUrl: z.ZodNullable<z.ZodString>;
|
|
957
|
+
updatedAt: z.ZodString;
|
|
958
|
+
}, z.core.$strip>>;
|
|
893
959
|
contact: z.ZodNullable<z.ZodObject<{
|
|
894
960
|
id: z.ZodULID;
|
|
895
961
|
externalId: z.ZodNullable<z.ZodString>;
|
|
@@ -932,6 +998,8 @@ declare const realtimeSchema: {
|
|
|
932
998
|
visitor_blocked: "visitor_blocked";
|
|
933
999
|
visitor_unblocked: "visitor_unblocked";
|
|
934
1000
|
visitor_identified: "visitor_identified";
|
|
1001
|
+
ai_paused: "ai_paused";
|
|
1002
|
+
ai_resumed: "ai_resumed";
|
|
935
1003
|
}>;
|
|
936
1004
|
actorUserId: z.ZodNullable<z.ZodString>;
|
|
937
1005
|
actorAiAgentId: z.ZodNullable<z.ZodString>;
|
|
@@ -976,6 +1044,8 @@ declare const realtimeSchema: {
|
|
|
976
1044
|
resolvedByAiAgentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
977
1045
|
resolutionTime: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
978
1046
|
deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1047
|
+
aiPausedUntil: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1048
|
+
viewIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
979
1049
|
}, z.core.$strip>;
|
|
980
1050
|
aiAgentId: z.ZodNullable<z.ZodString>;
|
|
981
1051
|
}, z.core.$strip>;
|
|
@@ -1070,8 +1140,8 @@ declare const realtimeSchema: {
|
|
|
1070
1140
|
conversationId: z.ZodString;
|
|
1071
1141
|
organizationId: z.ZodString;
|
|
1072
1142
|
visibility: z.ZodEnum<{
|
|
1073
|
-
private: "private";
|
|
1074
1143
|
public: "public";
|
|
1144
|
+
private: "private";
|
|
1075
1145
|
}>;
|
|
1076
1146
|
type: z.ZodEnum<{
|
|
1077
1147
|
message: "message";
|
|
@@ -1163,10 +1233,10 @@ declare const realtimeSchema: {
|
|
|
1163
1233
|
linkSourceId: z.ZodString;
|
|
1164
1234
|
status: z.ZodEnum<{
|
|
1165
1235
|
pending: "pending";
|
|
1166
|
-
mapping: "mapping";
|
|
1167
1236
|
crawling: "crawling";
|
|
1168
1237
|
completed: "completed";
|
|
1169
1238
|
failed: "failed";
|
|
1239
|
+
mapping: "mapping";
|
|
1170
1240
|
}>;
|
|
1171
1241
|
discoveredPagesCount: z.ZodOptional<z.ZodNumber>;
|
|
1172
1242
|
crawledPagesCount: z.ZodOptional<z.ZodNumber>;
|
package/realtime-events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;cAWa,mBAAiB,CAAA,CAAA;;EAAjB,cAAA,aAKX;;;;;;;;AAL4B,cAWjB,cAXiB,EAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEE,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,CAAA,CAAE,cACzD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB;;KAGnB,gBAAA,WACL,oBAAoB,cAAc,KACvC;KAEU,4BAA4B,qBACvC,qBAAqB;;;;iBAKN,gCAAgC,yBACzC,mBAEJ,qBAAqB;;;;iBAQR,gBAAA,yBAAyC;iBAIzC,0BAA0B,0BAClC,cAAc,KACnB,qBAAqB"}
|
package/realtime-events.js
CHANGED
|
@@ -105,7 +105,9 @@ const realtimeSchema = {
|
|
|
105
105
|
ConversationEventType.REOPENED,
|
|
106
106
|
ConversationEventType.VISITOR_BLOCKED,
|
|
107
107
|
ConversationEventType.VISITOR_UNBLOCKED,
|
|
108
|
-
ConversationEventType.VISITOR_IDENTIFIED
|
|
108
|
+
ConversationEventType.VISITOR_IDENTIFIED,
|
|
109
|
+
ConversationEventType.AI_PAUSED,
|
|
110
|
+
ConversationEventType.AI_RESUMED
|
|
109
111
|
]),
|
|
110
112
|
actorUserId: z.string().nullable(),
|
|
111
113
|
actorAiAgentId: z.string().nullable(),
|
|
@@ -145,7 +147,9 @@ const realtimeSchema = {
|
|
|
145
147
|
resolvedByUserId: z.string().nullable().optional(),
|
|
146
148
|
resolvedByAiAgentId: z.string().nullable().optional(),
|
|
147
149
|
resolutionTime: z.number().nullable().optional(),
|
|
148
|
-
deletedAt: z.string().nullable().optional()
|
|
150
|
+
deletedAt: z.string().nullable().optional(),
|
|
151
|
+
aiPausedUntil: z.string().nullable().optional(),
|
|
152
|
+
viewIds: z.array(z.string()).optional()
|
|
149
153
|
}),
|
|
150
154
|
aiAgentId: z.string().nullable()
|
|
151
155
|
}),
|
package/realtime-events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"realtime-events.js","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { visitorResponseSchema } from \"./api/visitor\";\nimport {\n\tConversationEventType,\n\tConversationStatus,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"./enums\";\nimport { conversationSchema } from \"./schemas\";\nimport { conversationHeaderSchema } from \"./trpc/conversation\";\n\nexport const baseRealtimeEvent = z.object({\n\twebsiteId: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string().nullable(),\n\tuserId: z.string().nullable(),\n});\n\n/**\n * Central event system for real-time communication\n * All WebSocket and Redis Pub/Sub events are defined here\n */\nexport const realtimeSchema = {\n\tuserConnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tuserDisconnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorConnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorDisconnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tuserPresenceUpdate: baseRealtimeEvent.extend({\n\t\tuserId: z.string(),\n\t\tstatus: z.enum([\"online\", \"away\", \"offline\"]),\n\t\tlastSeen: z.string(),\n\t}),\n\tconversationSeen: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tlastSeenAt: z.string(),\n\t\t/** The type of actor who marked the conversation as seen */\n\t\tactorType: z.enum([\"visitor\", \"user\", \"ai_agent\"]),\n\t\t/** The actor's ID (matches one of userId, visitorId, or aiAgentId based on actorType) */\n\t\tactorId: z.string(),\n\t}),\n\tconversationTyping: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tisTyping: z.boolean(),\n\t\tvisitorPreview: z.string().max(2000).nullable().optional(),\n\t}),\n\ttimelineItemCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t\tConversationTimelineType.TOOL,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\tconversationCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tconversation: conversationSchema,\n\t\theader: conversationHeaderSchema,\n\t}),\n\tvisitorIdentified: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tvisitor: visitorResponseSchema,\n\t}),\n\tconversationEventCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tevent: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationEventType.ASSIGNED,\n\t\t\t\tConversationEventType.UNASSIGNED,\n\t\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\t\tConversationEventType.TAG_ADDED,\n\t\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\t\tConversationEventType.RESOLVED,\n\t\t\t\tConversationEventType.REOPENED,\n\t\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t\t]),\n\t\t\tactorUserId: z.string().nullable(),\n\t\t\tactorAiAgentId: z.string().nullable(),\n\t\t\ttargetUserId: z.string().nullable(),\n\t\t\ttargetAiAgentId: z.string().nullable(),\n\t\t\tmessage: z.string().nullable(),\n\t\t\tmetadata: z.record(z.string(), z.unknown()).nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tupdatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t}),\n\t}),\n\t// Conversation updated (title, sentiment, escalation status changes, status changes)\n\tconversationUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tupdates: z.object({\n\t\t\ttitle: z.string().nullable().optional(),\n\t\t\tsentiment: z\n\t\t\t\t.enum([\"positive\", \"negative\", \"neutral\"])\n\t\t\t\t.nullable()\n\t\t\t\t.optional(),\n\t\t\tsentimentConfidence: z.number().nullable().optional(),\n\t\t\tescalatedAt: z.string().nullable().optional(),\n\t\t\tescalationReason: z.string().nullable().optional(),\n\t\t\tstatus: z\n\t\t\t\t.enum([\n\t\t\t\t\tConversationStatus.OPEN,\n\t\t\t\t\tConversationStatus.RESOLVED,\n\t\t\t\t\tConversationStatus.SPAM,\n\t\t\t\t])\n\t\t\t\t.optional(),\n\t\t\tpriority: z.enum([\"low\", \"normal\", \"high\", \"urgent\"]).optional(),\n\t\t\tresolvedAt: z.string().nullable().optional(),\n\t\t\tresolvedByUserId: z.string().nullable().optional(),\n\t\t\tresolvedByAiAgentId: z.string().nullable().optional(),\n\t\t\tresolutionTime: z.number().nullable().optional(),\n\t\t\tdeletedAt: z.string().nullable().optional(),\n\t\t}),\n\t\taiAgentId: z.string().nullable(),\n\t}),\n\n\t// =========================================================================\n\t// AI AGENT PROCESSING EVENTS\n\t// For progressive UI updates during AI agent responses\n\t//\n\t// AUDIENCE FIELD:\n\t// - 'all': Send to both dashboard and widget\n\t// - 'dashboard': Send only to dashboard (human agents)\n\t//\n\t// Widget (visitor) connections only receive events with audience='all'\n\t// =========================================================================\n\n\t// Emitted when AI agent starts processing a message\n\taiAgentProcessingStarted: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** ID of the trigger message that started this workflow */\n\t\ttriggerMessageId: z.string(),\n\t\t/** Initial phase of processing */\n\t\tphase: z.string().optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"dashboard\"),\n\t}),\n\n\t// Emitted when AI agent makes a decision about whether to act\n\taiAgentDecisionMade: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Whether the AI decided to take action */\n\t\tshouldAct: z.boolean(),\n\t\t/** Human-readable reason for the decision */\n\t\treason: z.string(),\n\t\t/** Response mode: how the AI is responding */\n\t\tmode: z.enum([\n\t\t\t\"respond_to_visitor\",\n\t\t\t\"respond_to_command\",\n\t\t\t\"background_only\",\n\t\t]),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]),\n\t}),\n\n\t// Emitted for progress updates during AI agent processing\n\taiAgentProcessingProgress: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Current phase: 'thinking', 'searching', 'tool-executing', 'generating', etc. */\n\t\tphase: z.string(),\n\t\t/** Human-readable message for display (widget sees this) */\n\t\tmessage: z.string().nullable(),\n\t\t/** Tool information when phase is tool-related */\n\t\ttool: z\n\t\t\t.object({\n\t\t\t\ttoolCallId: z.string(),\n\t\t\t\ttoolName: z.string(),\n\t\t\t\t/** Tool state: partial (executing), result (success), error (failed) */\n\t\t\t\tstate: z.enum([\"partial\", \"result\", \"error\"]),\n\t\t\t})\n\t\t\t.optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"all\"),\n\t}),\n\n\t// Emitted when AI agent finishes processing\n\taiAgentProcessingCompleted: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Whether processing completed successfully, was skipped, cancelled, or errored */\n\t\tstatus: z.enum([\"success\", \"skipped\", \"cancelled\", \"error\"]),\n\t\t/** Action taken (if status is 'success') */\n\t\taction: z.string().nullable().optional(),\n\t\t/** Reason for skip/cancel/error */\n\t\treason: z.string().nullable().optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"all\"),\n\t}),\n\n\t// =========================================================================\n\t// TIMELINE ITEM UPDATE EVENTS\n\t// For updating timeline items with new parts or state changes\n\t// =========================================================================\n\n\t// Emitted when an entire timeline item is updated (e.g., parts added)\n\ttimelineItemUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t\tConversationTimelineType.TOOL,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\n\t// Emitted for granular part updates (e.g., tool state changes)\n\ttimelineItemPartUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\ttimelineItemId: z.string(),\n\t\t/** Index of the part in the parts array */\n\t\tpartIndex: z.number(),\n\t\t/** The updated part data */\n\t\tpart: z.unknown(),\n\t}),\n\t// Web crawling events\n\tcrawlStarted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tdiscoveredPages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\ttitle: z.string().nullable(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t\ttotalPagesCount: z.number(),\n\t}),\n\tcrawlProgress: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tstatus: z.enum([\"pending\", \"crawling\", \"completed\", \"failed\"]),\n\t\t\tsizeBytes: z.number().optional(),\n\t\t\terror: z.string().nullable().optional(),\n\t\t}),\n\t\tcompletedCount: z.number(),\n\t\ttotalCount: z.number(),\n\t}),\n\tcrawlCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tcrawledPagesCount: z.number(),\n\t\ttotalSizeBytes: z.number(),\n\t\tfailedPagesCount: z.number(),\n\t}),\n\tcrawlFailed: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\terror: z.string(),\n\t}),\n\t// Link source updated (for status changes, etc.)\n\tlinkSourceUpdated: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tstatus: z.enum([\"pending\", \"mapping\", \"crawling\", \"completed\", \"failed\"]),\n\t\tdiscoveredPagesCount: z.number().optional(),\n\t\tcrawledPagesCount: z.number().optional(),\n\t\ttotalSizeBytes: z.number().optional(),\n\t\terrorMessage: z.string().nullable().optional(),\n\t}),\n\t// Emitted after map phase with all discovered URLs (for real-time tree display)\n\tcrawlPagesDiscovered: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\tpath: z.string(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t}),\n\t// Emitted when each page completes scraping (for real-time updates)\n\tcrawlPageCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tsizeBytes: z.number(),\n\t\t\tknowledgeId: z.string(),\n\t\t}),\n\t}),\n\n\t// =========================================================================\n\t// AI TRAINING EVENTS\n\t// For knowledge base embedding generation and progress tracking\n\t// =========================================================================\n\n\t// Emitted when AI training starts\n\ttrainingStarted: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\ttotalItems: z.number(),\n\t}),\n\n\t// Emitted for progress updates during AI training\n\ttrainingProgress: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\tprocessedItems: z.number(),\n\t\ttotalItems: z.number(),\n\t\tcurrentItem: z\n\t\t\t.object({\n\t\t\t\tid: z.string(),\n\t\t\t\ttitle: z.string().nullable(),\n\t\t\t\ttype: z.enum([\"url\", \"faq\", \"article\"]),\n\t\t\t})\n\t\t\t.optional(),\n\t\tpercentage: z.number(),\n\t}),\n\n\t// Emitted when AI training completes successfully\n\ttrainingCompleted: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\ttotalItems: z.number(),\n\t\ttotalChunks: z.number(),\n\t\tduration: z.number(), // milliseconds\n\t}),\n\n\t// Emitted when AI training fails\n\ttrainingFailed: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\terror: z.string(),\n\t}),\n} as const;\n\nexport type RealtimeEventType = keyof typeof realtimeSchema;\n\nexport type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<\n\t(typeof realtimeSchema)[T]\n>;\n\nexport type RealtimeEvent<T extends RealtimeEventType> = {\n\ttype: T;\n\tpayload: RealtimeEventPayload<T>;\n};\n\nexport type AnyRealtimeEvent = {\n\t[K in RealtimeEventType]: RealtimeEvent<K>;\n}[RealtimeEventType];\n\nexport type RealtimeEventData<T extends RealtimeEventType> =\n\tRealtimeEventPayload<T>;\n\n/**\n * Validates an event against its schema\n */\nexport function validateRealtimeEvent<T extends RealtimeEventType>(\n\ttype: T,\n\tdata: unknown\n): RealtimeEventPayload<T> {\n\tconst schema = realtimeSchema[type];\n\treturn schema.parse(data) as RealtimeEventPayload<T>;\n}\n\n/**\n * Type guard to check if a string is a valid event type\n */\nexport function isValidEventType(type: unknown): type is RealtimeEventType {\n\treturn typeof type === \"string\" && type in realtimeSchema;\n}\n\nexport function getEventPayload<T extends RealtimeEventType>(\n\tevent: RealtimeEvent<T>\n): RealtimeEventPayload<T> {\n\treturn event.payload;\n}\n"],"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;CAGF,kBAAkB,kBAAkB,OAAO;EAC1C,WAAW,EAAE,QAAQ;EACrB,gBAAgB,EAAE,QAAQ;EAC1B,YAAY,EAAE,QAAQ;EACtB,aAAa,EACX,OAAO;GACP,IAAI,EAAE,QAAQ;GACd,OAAO,EAAE,QAAQ,CAAC,UAAU;GAC5B,MAAM,EAAE,KAAK;IAAC;IAAO;IAAO;IAAU,CAAC;GACvC,CAAC,CACD,UAAU;EACZ,YAAY,EAAE,QAAQ;EACtB,CAAC;CAGF,mBAAmB,kBAAkB,OAAO;EAC3C,WAAW,EAAE,QAAQ;EACrB,YAAY,EAAE,QAAQ;EACtB,aAAa,EAAE,QAAQ;EACvB,UAAU,EAAE,QAAQ;EACpB,CAAC;CAGF,gBAAgB,kBAAkB,OAAO;EACxC,WAAW,EAAE,QAAQ;EACrB,OAAO,EAAE,QAAQ;EACjB,CAAC;CACF;;;;AAuBD,SAAgB,sBACf,MACA,MAC0B;AAE1B,QADe,eAAe,MAChB,MAAM,KAAK;;;;;AAM1B,SAAgB,iBAAiB,MAA0C;AAC1E,QAAO,OAAO,SAAS,YAAY,QAAQ;;AAG5C,SAAgB,gBACf,OAC0B;AAC1B,QAAO,MAAM"}
|
|
1
|
+
{"version":3,"file":"realtime-events.js","names":[],"sources":["../src/realtime-events.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { visitorResponseSchema } from \"./api/visitor\";\nimport {\n\tConversationEventType,\n\tConversationStatus,\n\tConversationTimelineType,\n\tTimelineItemVisibility,\n} from \"./enums\";\nimport { conversationSchema } from \"./schemas\";\nimport { conversationHeaderSchema } from \"./trpc/conversation\";\n\nexport const baseRealtimeEvent = z.object({\n\twebsiteId: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string().nullable(),\n\tuserId: z.string().nullable(),\n});\n\n/**\n * Central event system for real-time communication\n * All WebSocket and Redis Pub/Sub events are defined here\n */\nexport const realtimeSchema = {\n\tuserConnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tuserDisconnected: baseRealtimeEvent.extend({\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorConnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tvisitorDisconnected: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tconnectionId: z.string(),\n\t}),\n\tuserPresenceUpdate: baseRealtimeEvent.extend({\n\t\tuserId: z.string(),\n\t\tstatus: z.enum([\"online\", \"away\", \"offline\"]),\n\t\tlastSeen: z.string(),\n\t}),\n\tconversationSeen: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tlastSeenAt: z.string(),\n\t\t/** The type of actor who marked the conversation as seen */\n\t\tactorType: z.enum([\"visitor\", \"user\", \"ai_agent\"]),\n\t\t/** The actor's ID (matches one of userId, visitorId, or aiAgentId based on actorType) */\n\t\tactorId: z.string(),\n\t}),\n\tconversationTyping: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tisTyping: z.boolean(),\n\t\tvisitorPreview: z.string().max(2000).nullable().optional(),\n\t}),\n\ttimelineItemCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t\tConversationTimelineType.TOOL,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\tconversationCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tconversation: conversationSchema,\n\t\theader: conversationHeaderSchema,\n\t}),\n\tvisitorIdentified: baseRealtimeEvent.extend({\n\t\tvisitorId: z.string(),\n\t\tvisitor: visitorResponseSchema,\n\t}),\n\tconversationEventCreated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string().nullable(),\n\t\tevent: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationEventType.ASSIGNED,\n\t\t\t\tConversationEventType.UNASSIGNED,\n\t\t\t\tConversationEventType.PARTICIPANT_REQUESTED,\n\t\t\t\tConversationEventType.PARTICIPANT_JOINED,\n\t\t\t\tConversationEventType.PARTICIPANT_LEFT,\n\t\t\t\tConversationEventType.STATUS_CHANGED,\n\t\t\t\tConversationEventType.PRIORITY_CHANGED,\n\t\t\t\tConversationEventType.TAG_ADDED,\n\t\t\t\tConversationEventType.TAG_REMOVED,\n\t\t\t\tConversationEventType.RESOLVED,\n\t\t\t\tConversationEventType.REOPENED,\n\t\t\t\tConversationEventType.VISITOR_BLOCKED,\n\t\t\t\tConversationEventType.VISITOR_UNBLOCKED,\n\t\t\t\tConversationEventType.VISITOR_IDENTIFIED,\n\t\t\t\tConversationEventType.AI_PAUSED,\n\t\t\t\tConversationEventType.AI_RESUMED,\n\t\t\t]),\n\t\t\tactorUserId: z.string().nullable(),\n\t\t\tactorAiAgentId: z.string().nullable(),\n\t\t\ttargetUserId: z.string().nullable(),\n\t\t\ttargetAiAgentId: z.string().nullable(),\n\t\t\tmessage: z.string().nullable(),\n\t\t\tmetadata: z.record(z.string(), z.unknown()).nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tupdatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t}),\n\t}),\n\t// Conversation updated (title, sentiment, escalation status changes, status changes)\n\tconversationUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\tupdates: z.object({\n\t\t\ttitle: z.string().nullable().optional(),\n\t\t\tsentiment: z\n\t\t\t\t.enum([\"positive\", \"negative\", \"neutral\"])\n\t\t\t\t.nullable()\n\t\t\t\t.optional(),\n\t\t\tsentimentConfidence: z.number().nullable().optional(),\n\t\t\tescalatedAt: z.string().nullable().optional(),\n\t\t\tescalationReason: z.string().nullable().optional(),\n\t\t\tstatus: z\n\t\t\t\t.enum([\n\t\t\t\t\tConversationStatus.OPEN,\n\t\t\t\t\tConversationStatus.RESOLVED,\n\t\t\t\t\tConversationStatus.SPAM,\n\t\t\t\t])\n\t\t\t\t.optional(),\n\t\t\tpriority: z.enum([\"low\", \"normal\", \"high\", \"urgent\"]).optional(),\n\t\t\tresolvedAt: z.string().nullable().optional(),\n\t\t\tresolvedByUserId: z.string().nullable().optional(),\n\t\t\tresolvedByAiAgentId: z.string().nullable().optional(),\n\t\t\tresolutionTime: z.number().nullable().optional(),\n\t\t\tdeletedAt: z.string().nullable().optional(),\n\t\t\taiPausedUntil: z.string().nullable().optional(),\n\t\t\tviewIds: z.array(z.string()).optional(),\n\t\t}),\n\t\taiAgentId: z.string().nullable(),\n\t}),\n\n\t// =========================================================================\n\t// AI AGENT PROCESSING EVENTS\n\t// For progressive UI updates during AI agent responses\n\t//\n\t// AUDIENCE FIELD:\n\t// - 'all': Send to both dashboard and widget\n\t// - 'dashboard': Send only to dashboard (human agents)\n\t//\n\t// Widget (visitor) connections only receive events with audience='all'\n\t// =========================================================================\n\n\t// Emitted when AI agent starts processing a message\n\taiAgentProcessingStarted: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** ID of the trigger message that started this workflow */\n\t\ttriggerMessageId: z.string(),\n\t\t/** Initial phase of processing */\n\t\tphase: z.string().optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"dashboard\"),\n\t}),\n\n\t// Emitted when AI agent makes a decision about whether to act\n\taiAgentDecisionMade: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Whether the AI decided to take action */\n\t\tshouldAct: z.boolean(),\n\t\t/** Human-readable reason for the decision */\n\t\treason: z.string(),\n\t\t/** Response mode: how the AI is responding */\n\t\tmode: z.enum([\n\t\t\t\"respond_to_visitor\",\n\t\t\t\"respond_to_command\",\n\t\t\t\"background_only\",\n\t\t]),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]),\n\t}),\n\n\t// Emitted for progress updates during AI agent processing\n\taiAgentProcessingProgress: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Current phase: 'thinking', 'searching', 'tool-executing', 'generating', etc. */\n\t\tphase: z.string(),\n\t\t/** Human-readable message for display (widget sees this) */\n\t\tmessage: z.string().nullable(),\n\t\t/** Tool information when phase is tool-related */\n\t\ttool: z\n\t\t\t.object({\n\t\t\t\ttoolCallId: z.string(),\n\t\t\t\ttoolName: z.string(),\n\t\t\t\t/** Tool state: partial (executing), result (success), error (failed) */\n\t\t\t\tstate: z.enum([\"partial\", \"result\", \"error\"]),\n\t\t\t})\n\t\t\t.optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"all\"),\n\t}),\n\n\t// Emitted when AI agent finishes processing\n\taiAgentProcessingCompleted: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\taiAgentId: z.string(),\n\t\tworkflowRunId: z.string(),\n\t\t/** Whether processing completed successfully, was skipped, cancelled, or errored */\n\t\tstatus: z.enum([\"success\", \"skipped\", \"cancelled\", \"error\"]),\n\t\t/** Action taken (if status is 'success') */\n\t\taction: z.string().nullable().optional(),\n\t\t/** Reason for skip/cancel/error */\n\t\treason: z.string().nullable().optional(),\n\t\t/** Audience: 'all' = everyone, 'dashboard' = team only */\n\t\taudience: z.enum([\"all\", \"dashboard\"]).default(\"all\"),\n\t}),\n\n\t// =========================================================================\n\t// TIMELINE ITEM UPDATE EVENTS\n\t// For updating timeline items with new parts or state changes\n\t// =========================================================================\n\n\t// Emitted when an entire timeline item is updated (e.g., parts added)\n\ttimelineItemUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\titem: z.object({\n\t\t\tid: z.string(),\n\t\t\tconversationId: z.string(),\n\t\t\torganizationId: z.string(),\n\t\t\tvisibility: z.enum([\n\t\t\t\tTimelineItemVisibility.PUBLIC,\n\t\t\t\tTimelineItemVisibility.PRIVATE,\n\t\t\t]),\n\t\t\ttype: z.enum([\n\t\t\t\tConversationTimelineType.MESSAGE,\n\t\t\t\tConversationTimelineType.EVENT,\n\t\t\t\tConversationTimelineType.IDENTIFICATION,\n\t\t\t\tConversationTimelineType.TOOL,\n\t\t\t]),\n\t\t\ttext: z.string().nullable(),\n\t\t\tparts: z.array(z.unknown()),\n\t\t\tuserId: z.string().nullable(),\n\t\t\tvisitorId: z.string().nullable(),\n\t\t\taiAgentId: z.string().nullable(),\n\t\t\tcreatedAt: z.string(),\n\t\t\tdeletedAt: z.string().nullable(),\n\t\t\ttool: z.string().nullable().optional(),\n\t\t}),\n\t}),\n\n\t// Emitted for granular part updates (e.g., tool state changes)\n\ttimelineItemPartUpdated: baseRealtimeEvent.extend({\n\t\tconversationId: z.string(),\n\t\ttimelineItemId: z.string(),\n\t\t/** Index of the part in the parts array */\n\t\tpartIndex: z.number(),\n\t\t/** The updated part data */\n\t\tpart: z.unknown(),\n\t}),\n\t// Web crawling events\n\tcrawlStarted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tdiscoveredPages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\ttitle: z.string().nullable(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t\ttotalPagesCount: z.number(),\n\t}),\n\tcrawlProgress: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tstatus: z.enum([\"pending\", \"crawling\", \"completed\", \"failed\"]),\n\t\t\tsizeBytes: z.number().optional(),\n\t\t\terror: z.string().nullable().optional(),\n\t\t}),\n\t\tcompletedCount: z.number(),\n\t\ttotalCount: z.number(),\n\t}),\n\tcrawlCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\tcrawledPagesCount: z.number(),\n\t\ttotalSizeBytes: z.number(),\n\t\tfailedPagesCount: z.number(),\n\t}),\n\tcrawlFailed: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\turl: z.string(),\n\t\terror: z.string(),\n\t}),\n\t// Link source updated (for status changes, etc.)\n\tlinkSourceUpdated: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tstatus: z.enum([\"pending\", \"mapping\", \"crawling\", \"completed\", \"failed\"]),\n\t\tdiscoveredPagesCount: z.number().optional(),\n\t\tcrawledPagesCount: z.number().optional(),\n\t\ttotalSizeBytes: z.number().optional(),\n\t\terrorMessage: z.string().nullable().optional(),\n\t}),\n\t// Emitted after map phase with all discovered URLs (for real-time tree display)\n\tcrawlPagesDiscovered: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpages: z.array(\n\t\t\tz.object({\n\t\t\t\turl: z.string(),\n\t\t\t\tpath: z.string(),\n\t\t\t\tdepth: z.number(),\n\t\t\t})\n\t\t),\n\t}),\n\t// Emitted when each page completes scraping (for real-time updates)\n\tcrawlPageCompleted: baseRealtimeEvent.extend({\n\t\tlinkSourceId: z.string(),\n\t\tpage: z.object({\n\t\t\turl: z.string(),\n\t\t\ttitle: z.string().nullable(),\n\t\t\tsizeBytes: z.number(),\n\t\t\tknowledgeId: z.string(),\n\t\t}),\n\t}),\n\n\t// =========================================================================\n\t// AI TRAINING EVENTS\n\t// For knowledge base embedding generation and progress tracking\n\t// =========================================================================\n\n\t// Emitted when AI training starts\n\ttrainingStarted: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\ttotalItems: z.number(),\n\t}),\n\n\t// Emitted for progress updates during AI training\n\ttrainingProgress: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\tprocessedItems: z.number(),\n\t\ttotalItems: z.number(),\n\t\tcurrentItem: z\n\t\t\t.object({\n\t\t\t\tid: z.string(),\n\t\t\t\ttitle: z.string().nullable(),\n\t\t\t\ttype: z.enum([\"url\", \"faq\", \"article\"]),\n\t\t\t})\n\t\t\t.optional(),\n\t\tpercentage: z.number(),\n\t}),\n\n\t// Emitted when AI training completes successfully\n\ttrainingCompleted: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\ttotalItems: z.number(),\n\t\ttotalChunks: z.number(),\n\t\tduration: z.number(), // milliseconds\n\t}),\n\n\t// Emitted when AI training fails\n\ttrainingFailed: baseRealtimeEvent.extend({\n\t\taiAgentId: z.string(),\n\t\terror: z.string(),\n\t}),\n} as const;\n\nexport type RealtimeEventType = keyof typeof realtimeSchema;\n\nexport type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<\n\t(typeof realtimeSchema)[T]\n>;\n\nexport type RealtimeEvent<T extends RealtimeEventType> = {\n\ttype: T;\n\tpayload: RealtimeEventPayload<T>;\n};\n\nexport type AnyRealtimeEvent = {\n\t[K in RealtimeEventType]: RealtimeEvent<K>;\n}[RealtimeEventType];\n\nexport type RealtimeEventData<T extends RealtimeEventType> =\n\tRealtimeEventPayload<T>;\n\n/**\n * Validates an event against its schema\n */\nexport function validateRealtimeEvent<T extends RealtimeEventType>(\n\ttype: T,\n\tdata: unknown\n): RealtimeEventPayload<T> {\n\tconst schema = realtimeSchema[type];\n\treturn schema.parse(data) as RealtimeEventPayload<T>;\n}\n\n/**\n * Type guard to check if a string is a valid event type\n */\nexport function isValidEventType(type: unknown): type is RealtimeEventType {\n\treturn typeof type === \"string\" && type in realtimeSchema;\n}\n\nexport function getEventPayload<T extends RealtimeEventType>(\n\tevent: RealtimeEvent<T>\n): RealtimeEventPayload<T> {\n\treturn event.payload;\n}\n"],"mappings":";;;;;;;AAWA,MAAa,oBAAoB,EAAE,OAAO;CACzC,WAAW,EAAE,QAAQ;CACrB,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,QAAQ,EAAE,QAAQ,CAAC,UAAU;CAC7B,CAAC;;;;;AAMF,MAAa,iBAAiB;CAC7B,eAAe,kBAAkB,OAAO,EACvC,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO,EAC1C,cAAc,EAAE,QAAQ,EACxB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,qBAAqB,kBAAkB,OAAO;EAC7C,WAAW,EAAE,QAAQ;EACrB,cAAc,EAAE,QAAQ;EACxB,CAAC;CACF,oBAAoB,kBAAkB,OAAO;EAC5C,QAAQ,EAAE,QAAQ;EAClB,QAAQ,EAAE,KAAK;GAAC;GAAU;GAAQ;GAAU,CAAC;EAC7C,UAAU,EAAE,QAAQ;EACpB,CAAC;CACF,kBAAkB,kBAAkB,OAAO;EAC1C,gBAAgB,EAAE,QAAQ;EAC1B,WAAW,EAAE,QAAQ,CAAC,UAAU;EAChC,YAAY,EAAE,QAAQ;EAEtB,WAAW,EAAE,KA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