@cossistant/core 0.0.29 → 0.0.31

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.
Files changed (57) hide show
  1. package/_virtual/rolldown_runtime.js +27 -12
  2. package/ai-sdk-utils.d.ts +141 -0
  3. package/ai-sdk-utils.d.ts.map +1 -0
  4. package/ai-sdk-utils.js +255 -0
  5. package/ai-sdk-utils.js.map +1 -0
  6. package/client.d.ts +9 -6
  7. package/client.d.ts.map +1 -1
  8. package/client.js +12 -2
  9. package/client.js.map +1 -1
  10. package/index.d.ts +3 -1
  11. package/index.js +3 -1
  12. package/package.json +1 -1
  13. package/privacy-filter.d.ts +112 -0
  14. package/privacy-filter.d.ts.map +1 -0
  15. package/privacy-filter.js +170 -0
  16. package/privacy-filter.js.map +1 -0
  17. package/rest-client.d.ts +7 -4
  18. package/rest-client.d.ts.map +1 -1
  19. package/rest-client.js +31 -5
  20. package/rest-client.js.map +1 -1
  21. package/store/conversations-store.d.ts +1 -1
  22. package/store/conversations-store.d.ts.map +1 -1
  23. package/store/conversations-store.js +2 -1
  24. package/store/conversations-store.js.map +1 -1
  25. package/store/seen-store.d.ts +2 -2
  26. package/store/seen-store.d.ts.map +1 -1
  27. package/store/seen-store.js +5 -1
  28. package/store/seen-store.js.map +1 -1
  29. package/store/timeline-items-store.d.ts +5 -5
  30. package/store/timeline-items-store.d.ts.map +1 -1
  31. package/store/timeline-items-store.js +1 -1
  32. package/store/timeline-items-store.js.map +1 -1
  33. package/store/typing-store.d.ts +1 -1
  34. package/store/typing-store.d.ts.map +1 -1
  35. package/store/typing-store.js +12 -19
  36. package/store/typing-store.js.map +1 -1
  37. package/types/src/api/contact.d.ts.map +1 -0
  38. package/{conversation.d.ts → types/src/api/conversation.d.ts} +468 -71
  39. package/types/src/api/conversation.d.ts.map +1 -0
  40. package/types/src/api/timeline-item.d.ts +602 -0
  41. package/types/src/api/timeline-item.d.ts.map +1 -0
  42. package/types/src/api/timeline-item.js +67 -19
  43. package/types/src/api/timeline-item.js.map +1 -1
  44. package/types/src/api/upload.d.ts.map +1 -0
  45. package/{realtime-events.d.ts → types/src/realtime-events.d.ts} +444 -42
  46. package/types/src/realtime-events.d.ts.map +1 -0
  47. package/{schemas.d.ts → types/src/schemas.d.ts} +92 -14
  48. package/types/src/schemas.d.ts.map +1 -0
  49. package/contact.d.ts.map +0 -1
  50. package/conversation.d.ts.map +0 -1
  51. package/realtime-events.d.ts.map +0 -1
  52. package/schemas.d.ts.map +0 -1
  53. package/timeline-item.d.ts +0 -298
  54. package/timeline-item.d.ts.map +0 -1
  55. package/upload.d.ts.map +0 -1
  56. /package/{contact.d.ts → types/src/api/contact.d.ts} +0 -0
  57. /package/{upload.d.ts → types/src/api/upload.d.ts} +0 -0
@@ -55,6 +55,12 @@ declare const realtimeSchema: {
55
55
  conversationId: z.ZodString;
56
56
  aiAgentId: z.ZodNullable<z.ZodString>;
57
57
  lastSeenAt: z.ZodString;
58
+ actorType: z.ZodEnum<{
59
+ user: "user";
60
+ visitor: "visitor";
61
+ ai_agent: "ai_agent";
62
+ }>;
63
+ actorId: z.ZodString;
58
64
  }, z.core.$strip>;
59
65
  readonly conversationTyping: z.ZodObject<{
60
66
  websiteId: z.ZodString;
@@ -113,6 +119,8 @@ declare const realtimeSchema: {
113
119
  open: "open";
114
120
  spam: "spam";
115
121
  }>>;
122
+ visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
123
+ visitorRatingAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
116
124
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
117
125
  visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
118
126
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
@@ -133,6 +141,96 @@ declare const realtimeSchema: {
133
141
  parts: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
134
142
  type: z.ZodLiteral<"text">;
135
143
  text: z.ZodString;
144
+ state: z.ZodOptional<z.ZodEnum<{
145
+ streaming: "streaming";
146
+ done: "done";
147
+ }>>;
148
+ }, z.core.$strip>, z.ZodObject<{
149
+ type: z.ZodLiteral<"reasoning">;
150
+ text: z.ZodString;
151
+ state: z.ZodOptional<z.ZodEnum<{
152
+ streaming: "streaming";
153
+ done: "done";
154
+ }>>;
155
+ providerMetadata: z.ZodOptional<z.ZodObject<{
156
+ cossistant: z.ZodOptional<z.ZodObject<{
157
+ visibility: z.ZodOptional<z.ZodEnum<{
158
+ public: "public";
159
+ private: "private";
160
+ }>>;
161
+ progressMessage: z.ZodOptional<z.ZodString>;
162
+ knowledgeId: z.ZodOptional<z.ZodString>;
163
+ }, z.core.$strip>>;
164
+ }, z.core.$loose>>;
165
+ }, z.core.$strip>, z.ZodObject<{
166
+ type: z.ZodString;
167
+ toolCallId: z.ZodString;
168
+ toolName: z.ZodString;
169
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
170
+ output: z.ZodOptional<z.ZodUnknown>;
171
+ state: z.ZodEnum<{
172
+ error: "error";
173
+ partial: "partial";
174
+ result: "result";
175
+ }>;
176
+ errorText: z.ZodOptional<z.ZodString>;
177
+ providerMetadata: z.ZodOptional<z.ZodObject<{
178
+ cossistant: z.ZodOptional<z.ZodObject<{
179
+ visibility: z.ZodOptional<z.ZodEnum<{
180
+ public: "public";
181
+ private: "private";
182
+ }>>;
183
+ progressMessage: z.ZodOptional<z.ZodString>;
184
+ knowledgeId: z.ZodOptional<z.ZodString>;
185
+ }, z.core.$strip>>;
186
+ }, z.core.$loose>>;
187
+ }, z.core.$strip>, z.ZodObject<{
188
+ type: z.ZodLiteral<"source-url">;
189
+ sourceId: z.ZodString;
190
+ url: z.ZodString;
191
+ title: z.ZodOptional<z.ZodString>;
192
+ providerMetadata: z.ZodOptional<z.ZodObject<{
193
+ cossistant: z.ZodOptional<z.ZodObject<{
194
+ visibility: z.ZodOptional<z.ZodEnum<{
195
+ public: "public";
196
+ private: "private";
197
+ }>>;
198
+ progressMessage: z.ZodOptional<z.ZodString>;
199
+ knowledgeId: z.ZodOptional<z.ZodString>;
200
+ }, z.core.$strip>>;
201
+ }, z.core.$loose>>;
202
+ }, z.core.$strip>, z.ZodObject<{
203
+ type: z.ZodLiteral<"source-document">;
204
+ sourceId: z.ZodString;
205
+ mediaType: z.ZodString;
206
+ title: z.ZodString;
207
+ filename: z.ZodOptional<z.ZodString>;
208
+ providerMetadata: z.ZodOptional<z.ZodObject<{
209
+ cossistant: z.ZodOptional<z.ZodObject<{
210
+ visibility: z.ZodOptional<z.ZodEnum<{
211
+ public: "public";
212
+ private: "private";
213
+ }>>;
214
+ progressMessage: z.ZodOptional<z.ZodString>;
215
+ knowledgeId: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strip>>;
217
+ }, z.core.$loose>>;
218
+ }, z.core.$strip>, z.ZodObject<{
219
+ type: z.ZodLiteral<"step-start">;
220
+ }, z.core.$strip>, z.ZodObject<{
221
+ type: z.ZodLiteral<"file">;
222
+ url: z.ZodString;
223
+ mediaType: z.ZodString;
224
+ filename: z.ZodOptional<z.ZodString>;
225
+ size: z.ZodOptional<z.ZodNumber>;
226
+ }, z.core.$strip>, z.ZodObject<{
227
+ type: z.ZodLiteral<"image">;
228
+ url: z.ZodString;
229
+ mediaType: z.ZodString;
230
+ filename: z.ZodOptional<z.ZodString>;
231
+ size: z.ZodOptional<z.ZodNumber>;
232
+ width: z.ZodOptional<z.ZodNumber>;
233
+ height: z.ZodOptional<z.ZodNumber>;
136
234
  }, z.core.$strip>, z.ZodObject<{
137
235
  type: z.ZodLiteral<"event">;
138
236
  eventType: z.ZodEnum<{
@@ -156,20 +254,6 @@ declare const realtimeSchema: {
156
254
  targetUserId: z.ZodNullable<z.ZodString>;
157
255
  targetAiAgentId: z.ZodNullable<z.ZodString>;
158
256
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
159
- }, z.core.$strip>, z.ZodObject<{
160
- type: z.ZodLiteral<"image">;
161
- url: z.ZodString;
162
- mediaType: z.ZodString;
163
- fileName: z.ZodOptional<z.ZodString>;
164
- size: z.ZodOptional<z.ZodNumber>;
165
- width: z.ZodOptional<z.ZodNumber>;
166
- height: z.ZodOptional<z.ZodNumber>;
167
- }, z.core.$strip>, z.ZodObject<{
168
- type: z.ZodLiteral<"file">;
169
- url: z.ZodString;
170
- mediaType: z.ZodString;
171
- fileName: z.ZodOptional<z.ZodString>;
172
- size: z.ZodOptional<z.ZodNumber>;
173
257
  }, z.core.$strip>, z.ZodObject<{
174
258
  type: z.ZodLiteral<"metadata">;
175
259
  source: z.ZodEnum<{
@@ -218,6 +302,8 @@ declare const realtimeSchema: {
218
302
  channel: z.ZodString;
219
303
  title: z.ZodNullable<z.ZodString>;
220
304
  resolutionTime: z.ZodNullable<z.ZodNumber>;
305
+ visitorRating: z.ZodNullable<z.ZodNumber>;
306
+ visitorRatingAt: z.ZodNullable<z.ZodString>;
221
307
  startedAt: z.ZodNullable<z.ZodString>;
222
308
  firstResponseAt: z.ZodNullable<z.ZodString>;
223
309
  resolvedAt: z.ZodNullable<z.ZodString>;
@@ -252,6 +338,96 @@ declare const realtimeSchema: {
252
338
  parts: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
253
339
  type: z.ZodLiteral<"text">;
254
340
  text: z.ZodString;
341
+ state: z.ZodOptional<z.ZodEnum<{
342
+ streaming: "streaming";
343
+ done: "done";
344
+ }>>;
345
+ }, z.core.$strip>, z.ZodObject<{
346
+ type: z.ZodLiteral<"reasoning">;
347
+ text: z.ZodString;
348
+ state: z.ZodOptional<z.ZodEnum<{
349
+ streaming: "streaming";
350
+ done: "done";
351
+ }>>;
352
+ providerMetadata: z.ZodOptional<z.ZodObject<{
353
+ cossistant: z.ZodOptional<z.ZodObject<{
354
+ visibility: z.ZodOptional<z.ZodEnum<{
355
+ public: "public";
356
+ private: "private";
357
+ }>>;
358
+ progressMessage: z.ZodOptional<z.ZodString>;
359
+ knowledgeId: z.ZodOptional<z.ZodString>;
360
+ }, z.core.$strip>>;
361
+ }, z.core.$loose>>;
362
+ }, z.core.$strip>, z.ZodObject<{
363
+ type: z.ZodString;
364
+ toolCallId: z.ZodString;
365
+ toolName: z.ZodString;
366
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
367
+ output: z.ZodOptional<z.ZodUnknown>;
368
+ state: z.ZodEnum<{
369
+ error: "error";
370
+ partial: "partial";
371
+ result: "result";
372
+ }>;
373
+ errorText: z.ZodOptional<z.ZodString>;
374
+ providerMetadata: z.ZodOptional<z.ZodObject<{
375
+ cossistant: z.ZodOptional<z.ZodObject<{
376
+ visibility: z.ZodOptional<z.ZodEnum<{
377
+ public: "public";
378
+ private: "private";
379
+ }>>;
380
+ progressMessage: z.ZodOptional<z.ZodString>;
381
+ knowledgeId: z.ZodOptional<z.ZodString>;
382
+ }, z.core.$strip>>;
383
+ }, z.core.$loose>>;
384
+ }, z.core.$strip>, z.ZodObject<{
385
+ type: z.ZodLiteral<"source-url">;
386
+ sourceId: z.ZodString;
387
+ url: z.ZodString;
388
+ title: z.ZodOptional<z.ZodString>;
389
+ providerMetadata: z.ZodOptional<z.ZodObject<{
390
+ cossistant: z.ZodOptional<z.ZodObject<{
391
+ visibility: z.ZodOptional<z.ZodEnum<{
392
+ public: "public";
393
+ private: "private";
394
+ }>>;
395
+ progressMessage: z.ZodOptional<z.ZodString>;
396
+ knowledgeId: z.ZodOptional<z.ZodString>;
397
+ }, z.core.$strip>>;
398
+ }, z.core.$loose>>;
399
+ }, z.core.$strip>, z.ZodObject<{
400
+ type: z.ZodLiteral<"source-document">;
401
+ sourceId: z.ZodString;
402
+ mediaType: z.ZodString;
403
+ title: z.ZodString;
404
+ filename: z.ZodOptional<z.ZodString>;
405
+ providerMetadata: z.ZodOptional<z.ZodObject<{
406
+ cossistant: z.ZodOptional<z.ZodObject<{
407
+ visibility: z.ZodOptional<z.ZodEnum<{
408
+ public: "public";
409
+ private: "private";
410
+ }>>;
411
+ progressMessage: z.ZodOptional<z.ZodString>;
412
+ knowledgeId: z.ZodOptional<z.ZodString>;
413
+ }, z.core.$strip>>;
414
+ }, z.core.$loose>>;
415
+ }, z.core.$strip>, z.ZodObject<{
416
+ type: z.ZodLiteral<"step-start">;
417
+ }, z.core.$strip>, z.ZodObject<{
418
+ type: z.ZodLiteral<"file">;
419
+ url: z.ZodString;
420
+ mediaType: z.ZodString;
421
+ filename: z.ZodOptional<z.ZodString>;
422
+ size: z.ZodOptional<z.ZodNumber>;
423
+ }, z.core.$strip>, z.ZodObject<{
424
+ type: z.ZodLiteral<"image">;
425
+ url: z.ZodString;
426
+ mediaType: z.ZodString;
427
+ filename: z.ZodOptional<z.ZodString>;
428
+ size: z.ZodOptional<z.ZodNumber>;
429
+ width: z.ZodOptional<z.ZodNumber>;
430
+ height: z.ZodOptional<z.ZodNumber>;
255
431
  }, z.core.$strip>, z.ZodObject<{
256
432
  type: z.ZodLiteral<"event">;
257
433
  eventType: z.ZodEnum<{
@@ -275,20 +451,6 @@ declare const realtimeSchema: {
275
451
  targetUserId: z.ZodNullable<z.ZodString>;
276
452
  targetAiAgentId: z.ZodNullable<z.ZodString>;
277
453
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
278
- }, z.core.$strip>, z.ZodObject<{
279
- type: z.ZodLiteral<"image">;
280
- url: z.ZodString;
281
- mediaType: z.ZodString;
282
- fileName: z.ZodOptional<z.ZodString>;
283
- size: z.ZodOptional<z.ZodNumber>;
284
- width: z.ZodOptional<z.ZodNumber>;
285
- height: z.ZodOptional<z.ZodNumber>;
286
- }, z.core.$strip>, z.ZodObject<{
287
- type: z.ZodLiteral<"file">;
288
- url: z.ZodString;
289
- mediaType: z.ZodString;
290
- fileName: z.ZodOptional<z.ZodString>;
291
- size: z.ZodOptional<z.ZodNumber>;
292
454
  }, z.core.$strip>, z.ZodObject<{
293
455
  type: z.ZodLiteral<"metadata">;
294
456
  source: z.ZodEnum<{
@@ -321,6 +483,96 @@ declare const realtimeSchema: {
321
483
  parts: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
322
484
  type: z.ZodLiteral<"text">;
323
485
  text: z.ZodString;
486
+ state: z.ZodOptional<z.ZodEnum<{
487
+ streaming: "streaming";
488
+ done: "done";
489
+ }>>;
490
+ }, z.core.$strip>, z.ZodObject<{
491
+ type: z.ZodLiteral<"reasoning">;
492
+ text: z.ZodString;
493
+ state: z.ZodOptional<z.ZodEnum<{
494
+ streaming: "streaming";
495
+ done: "done";
496
+ }>>;
497
+ providerMetadata: z.ZodOptional<z.ZodObject<{
498
+ cossistant: z.ZodOptional<z.ZodObject<{
499
+ visibility: z.ZodOptional<z.ZodEnum<{
500
+ public: "public";
501
+ private: "private";
502
+ }>>;
503
+ progressMessage: z.ZodOptional<z.ZodString>;
504
+ knowledgeId: z.ZodOptional<z.ZodString>;
505
+ }, z.core.$strip>>;
506
+ }, z.core.$loose>>;
507
+ }, z.core.$strip>, z.ZodObject<{
508
+ type: z.ZodString;
509
+ toolCallId: z.ZodString;
510
+ toolName: z.ZodString;
511
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
512
+ output: z.ZodOptional<z.ZodUnknown>;
513
+ state: z.ZodEnum<{
514
+ error: "error";
515
+ partial: "partial";
516
+ result: "result";
517
+ }>;
518
+ errorText: z.ZodOptional<z.ZodString>;
519
+ providerMetadata: z.ZodOptional<z.ZodObject<{
520
+ cossistant: z.ZodOptional<z.ZodObject<{
521
+ visibility: z.ZodOptional<z.ZodEnum<{
522
+ public: "public";
523
+ private: "private";
524
+ }>>;
525
+ progressMessage: z.ZodOptional<z.ZodString>;
526
+ knowledgeId: z.ZodOptional<z.ZodString>;
527
+ }, z.core.$strip>>;
528
+ }, z.core.$loose>>;
529
+ }, z.core.$strip>, z.ZodObject<{
530
+ type: z.ZodLiteral<"source-url">;
531
+ sourceId: z.ZodString;
532
+ url: z.ZodString;
533
+ title: z.ZodOptional<z.ZodString>;
534
+ providerMetadata: z.ZodOptional<z.ZodObject<{
535
+ cossistant: z.ZodOptional<z.ZodObject<{
536
+ visibility: z.ZodOptional<z.ZodEnum<{
537
+ public: "public";
538
+ private: "private";
539
+ }>>;
540
+ progressMessage: z.ZodOptional<z.ZodString>;
541
+ knowledgeId: z.ZodOptional<z.ZodString>;
542
+ }, z.core.$strip>>;
543
+ }, z.core.$loose>>;
544
+ }, z.core.$strip>, z.ZodObject<{
545
+ type: z.ZodLiteral<"source-document">;
546
+ sourceId: z.ZodString;
547
+ mediaType: z.ZodString;
548
+ title: z.ZodString;
549
+ filename: z.ZodOptional<z.ZodString>;
550
+ providerMetadata: z.ZodOptional<z.ZodObject<{
551
+ cossistant: z.ZodOptional<z.ZodObject<{
552
+ visibility: z.ZodOptional<z.ZodEnum<{
553
+ public: "public";
554
+ private: "private";
555
+ }>>;
556
+ progressMessage: z.ZodOptional<z.ZodString>;
557
+ knowledgeId: z.ZodOptional<z.ZodString>;
558
+ }, z.core.$strip>>;
559
+ }, z.core.$loose>>;
560
+ }, z.core.$strip>, z.ZodObject<{
561
+ type: z.ZodLiteral<"step-start">;
562
+ }, z.core.$strip>, z.ZodObject<{
563
+ type: z.ZodLiteral<"file">;
564
+ url: z.ZodString;
565
+ mediaType: z.ZodString;
566
+ filename: z.ZodOptional<z.ZodString>;
567
+ size: z.ZodOptional<z.ZodNumber>;
568
+ }, z.core.$strip>, z.ZodObject<{
569
+ type: z.ZodLiteral<"image">;
570
+ url: z.ZodString;
571
+ mediaType: z.ZodString;
572
+ filename: z.ZodOptional<z.ZodString>;
573
+ size: z.ZodOptional<z.ZodNumber>;
574
+ width: z.ZodOptional<z.ZodNumber>;
575
+ height: z.ZodOptional<z.ZodNumber>;
324
576
  }, z.core.$strip>, z.ZodObject<{
325
577
  type: z.ZodLiteral<"event">;
326
578
  eventType: z.ZodEnum<{
@@ -344,20 +596,6 @@ declare const realtimeSchema: {
344
596
  targetUserId: z.ZodNullable<z.ZodString>;
345
597
  targetAiAgentId: z.ZodNullable<z.ZodString>;
346
598
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
347
- }, z.core.$strip>, z.ZodObject<{
348
- type: z.ZodLiteral<"image">;
349
- url: z.ZodString;
350
- mediaType: z.ZodString;
351
- fileName: z.ZodOptional<z.ZodString>;
352
- size: z.ZodOptional<z.ZodNumber>;
353
- width: z.ZodOptional<z.ZodNumber>;
354
- height: z.ZodOptional<z.ZodNumber>;
355
- }, z.core.$strip>, z.ZodObject<{
356
- type: z.ZodLiteral<"file">;
357
- url: z.ZodString;
358
- mediaType: z.ZodString;
359
- fileName: z.ZodOptional<z.ZodString>;
360
- size: z.ZodOptional<z.ZodNumber>;
361
599
  }, z.core.$strip>, z.ZodObject<{
362
600
  type: z.ZodLiteral<"metadata">;
363
601
  source: z.ZodEnum<{
@@ -491,6 +729,125 @@ declare const realtimeSchema: {
491
729
  }, z.core.$strip>;
492
730
  aiAgentId: z.ZodNullable<z.ZodString>;
493
731
  }, z.core.$strip>;
732
+ readonly aiAgentProcessingStarted: z.ZodObject<{
733
+ websiteId: z.ZodString;
734
+ organizationId: z.ZodString;
735
+ visitorId: z.ZodNullable<z.ZodString>;
736
+ userId: z.ZodNullable<z.ZodString>;
737
+ conversationId: z.ZodString;
738
+ aiAgentId: z.ZodString;
739
+ workflowRunId: z.ZodString;
740
+ triggerMessageId: z.ZodString;
741
+ phase: z.ZodOptional<z.ZodString>;
742
+ audience: z.ZodDefault<z.ZodEnum<{
743
+ all: "all";
744
+ dashboard: "dashboard";
745
+ }>>;
746
+ }, z.core.$strip>;
747
+ readonly aiAgentDecisionMade: z.ZodObject<{
748
+ websiteId: z.ZodString;
749
+ organizationId: z.ZodString;
750
+ visitorId: z.ZodNullable<z.ZodString>;
751
+ userId: z.ZodNullable<z.ZodString>;
752
+ conversationId: z.ZodString;
753
+ aiAgentId: z.ZodString;
754
+ workflowRunId: z.ZodString;
755
+ shouldAct: z.ZodBoolean;
756
+ reason: z.ZodString;
757
+ mode: z.ZodEnum<{
758
+ respond_to_visitor: "respond_to_visitor";
759
+ respond_to_command: "respond_to_command";
760
+ background_only: "background_only";
761
+ }>;
762
+ audience: z.ZodEnum<{
763
+ all: "all";
764
+ dashboard: "dashboard";
765
+ }>;
766
+ }, z.core.$strip>;
767
+ readonly aiAgentProcessingProgress: z.ZodObject<{
768
+ websiteId: z.ZodString;
769
+ organizationId: z.ZodString;
770
+ visitorId: z.ZodNullable<z.ZodString>;
771
+ userId: z.ZodNullable<z.ZodString>;
772
+ conversationId: z.ZodString;
773
+ aiAgentId: z.ZodString;
774
+ workflowRunId: z.ZodString;
775
+ phase: z.ZodString;
776
+ message: z.ZodNullable<z.ZodString>;
777
+ tool: z.ZodOptional<z.ZodObject<{
778
+ toolCallId: z.ZodString;
779
+ toolName: z.ZodString;
780
+ state: z.ZodEnum<{
781
+ error: "error";
782
+ partial: "partial";
783
+ result: "result";
784
+ }>;
785
+ }, z.core.$strip>>;
786
+ audience: z.ZodDefault<z.ZodEnum<{
787
+ all: "all";
788
+ dashboard: "dashboard";
789
+ }>>;
790
+ }, z.core.$strip>;
791
+ readonly aiAgentProcessingCompleted: z.ZodObject<{
792
+ websiteId: z.ZodString;
793
+ organizationId: z.ZodString;
794
+ visitorId: z.ZodNullable<z.ZodString>;
795
+ userId: z.ZodNullable<z.ZodString>;
796
+ conversationId: z.ZodString;
797
+ aiAgentId: z.ZodString;
798
+ workflowRunId: z.ZodString;
799
+ status: z.ZodEnum<{
800
+ success: "success";
801
+ error: "error";
802
+ skipped: "skipped";
803
+ cancelled: "cancelled";
804
+ }>;
805
+ action: z.ZodOptional<z.ZodNullable<z.ZodString>>;
806
+ reason: z.ZodOptional<z.ZodNullable<z.ZodString>>;
807
+ audience: z.ZodDefault<z.ZodEnum<{
808
+ all: "all";
809
+ dashboard: "dashboard";
810
+ }>>;
811
+ }, z.core.$strip>;
812
+ readonly timelineItemUpdated: z.ZodObject<{
813
+ websiteId: z.ZodString;
814
+ organizationId: z.ZodString;
815
+ visitorId: z.ZodNullable<z.ZodString>;
816
+ userId: z.ZodNullable<z.ZodString>;
817
+ conversationId: z.ZodString;
818
+ item: z.ZodObject<{
819
+ id: z.ZodString;
820
+ conversationId: z.ZodString;
821
+ organizationId: z.ZodString;
822
+ visibility: z.ZodEnum<{
823
+ public: "public";
824
+ private: "private";
825
+ }>;
826
+ type: z.ZodEnum<{
827
+ message: "message";
828
+ event: "event";
829
+ identification: "identification";
830
+ }>;
831
+ text: z.ZodNullable<z.ZodString>;
832
+ parts: z.ZodArray<z.ZodUnknown>;
833
+ userId: z.ZodNullable<z.ZodString>;
834
+ visitorId: z.ZodNullable<z.ZodString>;
835
+ aiAgentId: z.ZodNullable<z.ZodString>;
836
+ createdAt: z.ZodString;
837
+ deletedAt: z.ZodNullable<z.ZodString>;
838
+ tool: z.ZodOptional<z.ZodNullable<z.ZodString>>;
839
+ }, z.core.$strip>;
840
+ }, z.core.$strip>;
841
+ readonly timelineItemPartUpdated: z.ZodObject<{
842
+ websiteId: z.ZodString;
843
+ organizationId: z.ZodString;
844
+ visitorId: z.ZodNullable<z.ZodString>;
845
+ userId: z.ZodNullable<z.ZodString>;
846
+ conversationId: z.ZodString;
847
+ timelineItemId: z.ZodString;
848
+ partIndex: z.ZodNumber;
849
+ part: z.ZodUnknown;
850
+ }, z.core.$strip>;
494
851
  readonly crawlStarted: z.ZodObject<{
495
852
  websiteId: z.ZodString;
496
853
  organizationId: z.ZodString;
@@ -590,6 +947,51 @@ declare const realtimeSchema: {
590
947
  knowledgeId: z.ZodString;
591
948
  }, z.core.$strip>;
592
949
  }, z.core.$strip>;
950
+ readonly trainingStarted: z.ZodObject<{
951
+ websiteId: z.ZodString;
952
+ organizationId: z.ZodString;
953
+ visitorId: z.ZodNullable<z.ZodString>;
954
+ userId: z.ZodNullable<z.ZodString>;
955
+ aiAgentId: z.ZodString;
956
+ totalItems: z.ZodNumber;
957
+ }, z.core.$strip>;
958
+ readonly trainingProgress: z.ZodObject<{
959
+ websiteId: z.ZodString;
960
+ organizationId: z.ZodString;
961
+ visitorId: z.ZodNullable<z.ZodString>;
962
+ userId: z.ZodNullable<z.ZodString>;
963
+ aiAgentId: z.ZodString;
964
+ processedItems: z.ZodNumber;
965
+ totalItems: z.ZodNumber;
966
+ currentItem: z.ZodOptional<z.ZodObject<{
967
+ id: z.ZodString;
968
+ title: z.ZodNullable<z.ZodString>;
969
+ type: z.ZodEnum<{
970
+ url: "url";
971
+ faq: "faq";
972
+ article: "article";
973
+ }>;
974
+ }, z.core.$strip>>;
975
+ percentage: z.ZodNumber;
976
+ }, z.core.$strip>;
977
+ readonly trainingCompleted: z.ZodObject<{
978
+ websiteId: z.ZodString;
979
+ organizationId: z.ZodString;
980
+ visitorId: z.ZodNullable<z.ZodString>;
981
+ userId: z.ZodNullable<z.ZodString>;
982
+ aiAgentId: z.ZodString;
983
+ totalItems: z.ZodNumber;
984
+ totalChunks: z.ZodNumber;
985
+ duration: z.ZodNumber;
986
+ }, z.core.$strip>;
987
+ readonly trainingFailed: z.ZodObject<{
988
+ websiteId: z.ZodString;
989
+ organizationId: z.ZodString;
990
+ visitorId: z.ZodNullable<z.ZodString>;
991
+ userId: z.ZodNullable<z.ZodString>;
992
+ aiAgentId: z.ZodString;
993
+ error: z.ZodString;
994
+ }, z.core.$strip>;
593
995
  };
594
996
  type RealtimeEventType = keyof typeof realtimeSchema;
595
997
  type RealtimeEventPayload<T extends RealtimeEventType> = z.infer<(typeof realtimeSchema)[T]>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtime-events.d.ts","names":[],"sources":["../../../../types/src/realtime-events.ts"],"sourcesContent":[],"mappings":";;;;;;;;cAqBa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8VD,iBAAA,gBAAiC;KAEjC,+BAA+B,qBAAqB,CAAA,CAAE,cACzD,gBAAgB;KAGb,wBAAwB;QAC7B;WACG,qBAAqB"}
@@ -14,6 +14,8 @@ declare const conversationSchema: z.ZodObject<{
14
14
  open: "open";
15
15
  spam: "spam";
16
16
  }>>;
17
+ visitorRating: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
18
+ visitorRatingAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
19
  deletedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
18
20
  visitorLastSeenAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
19
21
  lastTimelineItem: z.ZodOptional<z.ZodObject<{
@@ -34,6 +36,96 @@ declare const conversationSchema: z.ZodObject<{
34
36
  parts: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
35
37
  type: z.ZodLiteral<"text">;
36
38
  text: z.ZodString;
39
+ state: z.ZodOptional<z.ZodEnum<{
40
+ streaming: "streaming";
41
+ done: "done";
42
+ }>>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<"reasoning">;
45
+ text: z.ZodString;
46
+ state: z.ZodOptional<z.ZodEnum<{
47
+ streaming: "streaming";
48
+ done: "done";
49
+ }>>;
50
+ providerMetadata: z.ZodOptional<z.ZodObject<{
51
+ cossistant: z.ZodOptional<z.ZodObject<{
52
+ visibility: z.ZodOptional<z.ZodEnum<{
53
+ public: "public";
54
+ private: "private";
55
+ }>>;
56
+ progressMessage: z.ZodOptional<z.ZodString>;
57
+ knowledgeId: z.ZodOptional<z.ZodString>;
58
+ }, z.core.$strip>>;
59
+ }, z.core.$loose>>;
60
+ }, z.core.$strip>, z.ZodObject<{
61
+ type: z.ZodString;
62
+ toolCallId: z.ZodString;
63
+ toolName: z.ZodString;
64
+ input: z.ZodRecord<z.ZodString, z.ZodUnknown>;
65
+ output: z.ZodOptional<z.ZodUnknown>;
66
+ state: z.ZodEnum<{
67
+ error: "error";
68
+ partial: "partial";
69
+ result: "result";
70
+ }>;
71
+ errorText: z.ZodOptional<z.ZodString>;
72
+ providerMetadata: z.ZodOptional<z.ZodObject<{
73
+ cossistant: z.ZodOptional<z.ZodObject<{
74
+ visibility: z.ZodOptional<z.ZodEnum<{
75
+ public: "public";
76
+ private: "private";
77
+ }>>;
78
+ progressMessage: z.ZodOptional<z.ZodString>;
79
+ knowledgeId: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>>;
81
+ }, z.core.$loose>>;
82
+ }, z.core.$strip>, z.ZodObject<{
83
+ type: z.ZodLiteral<"source-url">;
84
+ sourceId: z.ZodString;
85
+ url: z.ZodString;
86
+ title: z.ZodOptional<z.ZodString>;
87
+ providerMetadata: z.ZodOptional<z.ZodObject<{
88
+ cossistant: z.ZodOptional<z.ZodObject<{
89
+ visibility: z.ZodOptional<z.ZodEnum<{
90
+ public: "public";
91
+ private: "private";
92
+ }>>;
93
+ progressMessage: z.ZodOptional<z.ZodString>;
94
+ knowledgeId: z.ZodOptional<z.ZodString>;
95
+ }, z.core.$strip>>;
96
+ }, z.core.$loose>>;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ type: z.ZodLiteral<"source-document">;
99
+ sourceId: z.ZodString;
100
+ mediaType: z.ZodString;
101
+ title: z.ZodString;
102
+ filename: z.ZodOptional<z.ZodString>;
103
+ providerMetadata: z.ZodOptional<z.ZodObject<{
104
+ cossistant: z.ZodOptional<z.ZodObject<{
105
+ visibility: z.ZodOptional<z.ZodEnum<{
106
+ public: "public";
107
+ private: "private";
108
+ }>>;
109
+ progressMessage: z.ZodOptional<z.ZodString>;
110
+ knowledgeId: z.ZodOptional<z.ZodString>;
111
+ }, z.core.$strip>>;
112
+ }, z.core.$loose>>;
113
+ }, z.core.$strip>, z.ZodObject<{
114
+ type: z.ZodLiteral<"step-start">;
115
+ }, z.core.$strip>, z.ZodObject<{
116
+ type: z.ZodLiteral<"file">;
117
+ url: z.ZodString;
118
+ mediaType: z.ZodString;
119
+ filename: z.ZodOptional<z.ZodString>;
120
+ size: z.ZodOptional<z.ZodNumber>;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ type: z.ZodLiteral<"image">;
123
+ url: z.ZodString;
124
+ mediaType: z.ZodString;
125
+ filename: z.ZodOptional<z.ZodString>;
126
+ size: z.ZodOptional<z.ZodNumber>;
127
+ width: z.ZodOptional<z.ZodNumber>;
128
+ height: z.ZodOptional<z.ZodNumber>;
37
129
  }, z.core.$strip>, z.ZodObject<{
38
130
  type: z.ZodLiteral<"event">;
39
131
  eventType: z.ZodEnum<{
@@ -57,20 +149,6 @@ declare const conversationSchema: z.ZodObject<{
57
149
  targetUserId: z.ZodNullable<z.ZodString>;
58
150
  targetAiAgentId: z.ZodNullable<z.ZodString>;
59
151
  message: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
- }, z.core.$strip>, z.ZodObject<{
61
- type: z.ZodLiteral<"image">;
62
- url: z.ZodString;
63
- mediaType: z.ZodString;
64
- fileName: z.ZodOptional<z.ZodString>;
65
- size: z.ZodOptional<z.ZodNumber>;
66
- width: z.ZodOptional<z.ZodNumber>;
67
- height: z.ZodOptional<z.ZodNumber>;
68
- }, z.core.$strip>, z.ZodObject<{
69
- type: z.ZodLiteral<"file">;
70
- url: z.ZodString;
71
- mediaType: z.ZodString;
72
- fileName: z.ZodOptional<z.ZodString>;
73
- size: z.ZodOptional<z.ZodNumber>;
74
152
  }, z.core.$strip>, z.ZodObject<{
75
153
  type: z.ZodLiteral<"metadata">;
76
154
  source: z.ZodEnum<{
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","names":[],"sources":["../../../../types/src/schemas.ts"],"sourcesContent":[],"mappings":";;;;cAkBa,oBAAkB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqBnB,YAAA,GAAe,CAAA,CAAE,aAAa;cAE7B,wBAAsB,CAAA,CAAA;;;;;;;;EAvBJ,SAAA,aAAA;EAAA,SAAA,eAAA,YAAA,CAAA;AAqB/B,CAAA,eAAY,CAAA;AAEC,KAYD,gBAAA,GAAmB,CAAA,CAAE,KAF/B,CAAA,OAE4C,sBAF5C,CAAA"}