@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.
Files changed (76) hide show
  1. package/analytics.d.ts +31 -0
  2. package/analytics.d.ts.map +1 -0
  3. package/analytics.js +41 -0
  4. package/analytics.js.map +1 -0
  5. package/api/ai-agent-capabilities.d.ts +16 -19
  6. package/api/ai-agent-capabilities.d.ts.map +1 -1
  7. package/api/ai-agent-capabilities.js +215 -286
  8. package/api/ai-agent-capabilities.js.map +1 -1
  9. package/api/ai-agent-defaults.d.ts +6 -0
  10. package/api/ai-agent-defaults.d.ts.map +1 -0
  11. package/api/ai-agent-defaults.js +33 -0
  12. package/api/ai-agent-defaults.js.map +1 -0
  13. package/api/ai-agent.d.ts +314 -207
  14. package/api/ai-agent.d.ts.map +1 -1
  15. package/api/ai-agent.js +175 -111
  16. package/api/ai-agent.js.map +1 -1
  17. package/api/conversation.d.ts +79 -56
  18. package/api/conversation.d.ts.map +1 -1
  19. package/api/conversation.js +7 -2
  20. package/api/conversation.js.map +1 -1
  21. package/api/feedback.d.ts +5 -0
  22. package/api/feedback.d.ts.map +1 -1
  23. package/api/feedback.js +2 -0
  24. package/api/feedback.js.map +1 -1
  25. package/api/index.d.ts +7 -6
  26. package/api/index.js +7 -6
  27. package/api/link-source.d.ts +4 -4
  28. package/api/link-source.d.ts.map +1 -1
  29. package/api/link-source.js +1 -1
  30. package/api/link-source.js.map +1 -1
  31. package/api/timeline-item.d.ts +79 -67
  32. package/api/timeline-item.d.ts.map +1 -1
  33. package/api/timeline-item.js +3 -1
  34. package/api/timeline-item.js.map +1 -1
  35. package/api/user.d.ts +1 -1
  36. package/api/user.d.ts.map +1 -1
  37. package/api/user.js +2 -2
  38. package/api/user.js.map +1 -1
  39. package/api/visitor.d.ts +225 -1
  40. package/api/visitor.d.ts.map +1 -1
  41. package/api/visitor.js +142 -1
  42. package/api/visitor.js.map +1 -1
  43. package/api/website.d.ts +16 -7
  44. package/api/website.d.ts.map +1 -1
  45. package/api/website.js +16 -2
  46. package/api/website.js.map +1 -1
  47. package/enums.d.ts +2 -0
  48. package/enums.d.ts.map +1 -1
  49. package/enums.js +3 -1
  50. package/enums.js.map +1 -1
  51. package/index.d.ts +10 -8
  52. package/index.d.ts.map +1 -1
  53. package/index.js +10 -8
  54. package/package.json +1 -1
  55. package/realtime-events.d.ts +106 -36
  56. package/realtime-events.d.ts.map +1 -1
  57. package/realtime-events.js +6 -2
  58. package/realtime-events.js.map +1 -1
  59. package/schemas.d.ts +13 -11
  60. package/schemas.d.ts.map +1 -1
  61. package/tool-timeline-policy.d.ts +19 -2
  62. package/tool-timeline-policy.d.ts.map +1 -1
  63. package/tool-timeline-policy.js +29 -6
  64. package/tool-timeline-policy.js.map +1 -1
  65. package/trpc/conversation-hard-limit.d.ts +30 -0
  66. package/trpc/conversation-hard-limit.d.ts.map +1 -0
  67. package/trpc/conversation-hard-limit.js +43 -0
  68. package/trpc/conversation-hard-limit.js.map +1 -0
  69. package/trpc/conversation.d.ts +84 -44
  70. package/trpc/conversation.d.ts.map +1 -1
  71. package/trpc/conversation.js +6 -0
  72. package/trpc/conversation.js.map +1 -1
  73. package/trpc/visitor.d.ts +73 -15
  74. package/trpc/visitor.d.ts.map +1 -1
  75. package/trpc/visitor.js +15 -8
  76. package/trpc/visitor.js.map +1 -1
@@ -41,6 +41,10 @@ declare const conversationRecordSchema: z.ZodObject<{
41
41
  sentimentConfidence: z.ZodNullable<z.ZodNumber>;
42
42
  channel: z.ZodString;
43
43
  title: z.ZodNullable<z.ZodString>;
44
+ titleSource: z.ZodNullable<z.ZodEnum<{
45
+ ai: "ai";
46
+ user: "user";
47
+ }>>;
44
48
  resolutionTime: z.ZodNullable<z.ZodNumber>;
45
49
  visitorRating: z.ZodNullable<z.ZodNumber>;
46
50
  visitorRatingAt: z.ZodNullable<z.ZodString>;
@@ -87,6 +91,10 @@ declare const conversationMutationResponseSchema: z.ZodObject<{
87
91
  sentimentConfidence: z.ZodNullable<z.ZodNumber>;
88
92
  channel: z.ZodString;
89
93
  title: z.ZodNullable<z.ZodString>;
94
+ titleSource: z.ZodNullable<z.ZodEnum<{
95
+ ai: "ai";
96
+ user: "user";
97
+ }>>;
90
98
  resolutionTime: z.ZodNullable<z.ZodNumber>;
91
99
  visitorRating: z.ZodNullable<z.ZodNumber>;
92
100
  visitorRatingAt: z.ZodNullable<z.ZodString>;
@@ -140,6 +148,16 @@ declare const conversationHeaderSchema: z.ZodObject<{
140
148
  websiteId: z.ZodString;
141
149
  channel: z.ZodString;
142
150
  title: z.ZodNullable<z.ZodString>;
151
+ titleSource: z.ZodNullable<z.ZodEnum<{
152
+ ai: "ai";
153
+ user: "user";
154
+ }>>;
155
+ sentiment: z.ZodNullable<z.ZodEnum<{
156
+ positive: "positive";
157
+ negative: "negative";
158
+ neutral: "neutral";
159
+ }>>;
160
+ sentimentConfidence: z.ZodNullable<z.ZodNumber>;
143
161
  resolutionTime: z.ZodNullable<z.ZodNumber>;
144
162
  visitorRating: z.ZodNullable<z.ZodNumber>;
145
163
  visitorRatingAt: z.ZodNullable<z.ZodString>;
@@ -164,8 +182,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
164
182
  conversationId: z.ZodString;
165
183
  organizationId: z.ZodString;
166
184
  visibility: z.ZodEnum<{
167
- private: "private";
168
185
  public: "public";
186
+ private: "private";
169
187
  }>;
170
188
  type: z.ZodEnum<{
171
189
  message: "message";
@@ -192,8 +210,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
192
210
  providerMetadata: z.ZodOptional<z.ZodObject<{
193
211
  cossistant: z.ZodOptional<z.ZodObject<{
194
212
  visibility: z.ZodOptional<z.ZodEnum<{
195
- private: "private";
196
213
  public: "public";
214
+ private: "private";
197
215
  }>>;
198
216
  progressMessage: z.ZodOptional<z.ZodString>;
199
217
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -206,8 +224,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
206
224
  triggerMessageId: z.ZodString;
207
225
  workflowRunId: z.ZodString;
208
226
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
209
- private: "private";
210
227
  public: "public";
228
+ private: "private";
211
229
  }>>;
212
230
  }, z.core.$strip>>;
213
231
  }, z.core.$strip>>;
@@ -227,8 +245,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
227
245
  callProviderMetadata: z.ZodOptional<z.ZodObject<{
228
246
  cossistant: z.ZodOptional<z.ZodObject<{
229
247
  visibility: z.ZodOptional<z.ZodEnum<{
230
- private: "private";
231
248
  public: "public";
249
+ private: "private";
232
250
  }>>;
233
251
  progressMessage: z.ZodOptional<z.ZodString>;
234
252
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -241,8 +259,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
241
259
  triggerMessageId: z.ZodString;
242
260
  workflowRunId: z.ZodString;
243
261
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
244
- private: "private";
245
262
  public: "public";
263
+ private: "private";
246
264
  }>>;
247
265
  }, z.core.$strip>>;
248
266
  }, z.core.$strip>>;
@@ -250,8 +268,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
250
268
  providerMetadata: z.ZodOptional<z.ZodObject<{
251
269
  cossistant: z.ZodOptional<z.ZodObject<{
252
270
  visibility: z.ZodOptional<z.ZodEnum<{
253
- private: "private";
254
271
  public: "public";
272
+ private: "private";
255
273
  }>>;
256
274
  progressMessage: z.ZodOptional<z.ZodString>;
257
275
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -264,8 +282,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
264
282
  triggerMessageId: z.ZodString;
265
283
  workflowRunId: z.ZodString;
266
284
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
267
- private: "private";
268
285
  public: "public";
286
+ private: "private";
269
287
  }>>;
270
288
  }, z.core.$strip>>;
271
289
  }, z.core.$strip>>;
@@ -278,8 +296,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
278
296
  providerMetadata: z.ZodOptional<z.ZodObject<{
279
297
  cossistant: z.ZodOptional<z.ZodObject<{
280
298
  visibility: z.ZodOptional<z.ZodEnum<{
281
- private: "private";
282
299
  public: "public";
300
+ private: "private";
283
301
  }>>;
284
302
  progressMessage: z.ZodOptional<z.ZodString>;
285
303
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -292,8 +310,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
292
310
  triggerMessageId: z.ZodString;
293
311
  workflowRunId: z.ZodString;
294
312
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
295
- private: "private";
296
313
  public: "public";
314
+ private: "private";
297
315
  }>>;
298
316
  }, z.core.$strip>>;
299
317
  }, z.core.$strip>>;
@@ -307,8 +325,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
307
325
  providerMetadata: z.ZodOptional<z.ZodObject<{
308
326
  cossistant: z.ZodOptional<z.ZodObject<{
309
327
  visibility: z.ZodOptional<z.ZodEnum<{
310
- private: "private";
311
328
  public: "public";
329
+ private: "private";
312
330
  }>>;
313
331
  progressMessage: z.ZodOptional<z.ZodString>;
314
332
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -321,8 +339,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
321
339
  triggerMessageId: z.ZodString;
322
340
  workflowRunId: z.ZodString;
323
341
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
324
- private: "private";
325
342
  public: "public";
343
+ private: "private";
326
344
  }>>;
327
345
  }, z.core.$strip>>;
328
346
  }, z.core.$strip>>;
@@ -360,6 +378,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
360
378
  visitor_blocked: "visitor_blocked";
361
379
  visitor_unblocked: "visitor_unblocked";
362
380
  visitor_identified: "visitor_identified";
381
+ ai_paused: "ai_paused";
382
+ ai_resumed: "ai_resumed";
363
383
  }>;
364
384
  actorUserId: z.ZodNullable<z.ZodString>;
365
385
  actorAiAgentId: z.ZodNullable<z.ZodString>;
@@ -385,8 +405,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
385
405
  conversationId: z.ZodString;
386
406
  organizationId: z.ZodString;
387
407
  visibility: z.ZodEnum<{
388
- private: "private";
389
408
  public: "public";
409
+ private: "private";
390
410
  }>;
391
411
  type: z.ZodEnum<{
392
412
  message: "message";
@@ -413,8 +433,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
413
433
  providerMetadata: z.ZodOptional<z.ZodObject<{
414
434
  cossistant: z.ZodOptional<z.ZodObject<{
415
435
  visibility: z.ZodOptional<z.ZodEnum<{
416
- private: "private";
417
436
  public: "public";
437
+ private: "private";
418
438
  }>>;
419
439
  progressMessage: z.ZodOptional<z.ZodString>;
420
440
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -427,8 +447,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
427
447
  triggerMessageId: z.ZodString;
428
448
  workflowRunId: z.ZodString;
429
449
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
430
- private: "private";
431
450
  public: "public";
451
+ private: "private";
432
452
  }>>;
433
453
  }, z.core.$strip>>;
434
454
  }, z.core.$strip>>;
@@ -448,8 +468,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
448
468
  callProviderMetadata: z.ZodOptional<z.ZodObject<{
449
469
  cossistant: z.ZodOptional<z.ZodObject<{
450
470
  visibility: z.ZodOptional<z.ZodEnum<{
451
- private: "private";
452
471
  public: "public";
472
+ private: "private";
453
473
  }>>;
454
474
  progressMessage: z.ZodOptional<z.ZodString>;
455
475
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -462,8 +482,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
462
482
  triggerMessageId: z.ZodString;
463
483
  workflowRunId: z.ZodString;
464
484
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
465
- private: "private";
466
485
  public: "public";
486
+ private: "private";
467
487
  }>>;
468
488
  }, z.core.$strip>>;
469
489
  }, z.core.$strip>>;
@@ -471,8 +491,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
471
491
  providerMetadata: z.ZodOptional<z.ZodObject<{
472
492
  cossistant: z.ZodOptional<z.ZodObject<{
473
493
  visibility: z.ZodOptional<z.ZodEnum<{
474
- private: "private";
475
494
  public: "public";
495
+ private: "private";
476
496
  }>>;
477
497
  progressMessage: z.ZodOptional<z.ZodString>;
478
498
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -485,8 +505,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
485
505
  triggerMessageId: z.ZodString;
486
506
  workflowRunId: z.ZodString;
487
507
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
488
- private: "private";
489
508
  public: "public";
509
+ private: "private";
490
510
  }>>;
491
511
  }, z.core.$strip>>;
492
512
  }, z.core.$strip>>;
@@ -499,8 +519,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
499
519
  providerMetadata: z.ZodOptional<z.ZodObject<{
500
520
  cossistant: z.ZodOptional<z.ZodObject<{
501
521
  visibility: z.ZodOptional<z.ZodEnum<{
502
- private: "private";
503
522
  public: "public";
523
+ private: "private";
504
524
  }>>;
505
525
  progressMessage: z.ZodOptional<z.ZodString>;
506
526
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -513,8 +533,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
513
533
  triggerMessageId: z.ZodString;
514
534
  workflowRunId: z.ZodString;
515
535
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
516
- private: "private";
517
536
  public: "public";
537
+ private: "private";
518
538
  }>>;
519
539
  }, z.core.$strip>>;
520
540
  }, z.core.$strip>>;
@@ -528,8 +548,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
528
548
  providerMetadata: z.ZodOptional<z.ZodObject<{
529
549
  cossistant: z.ZodOptional<z.ZodObject<{
530
550
  visibility: z.ZodOptional<z.ZodEnum<{
531
- private: "private";
532
551
  public: "public";
552
+ private: "private";
533
553
  }>>;
534
554
  progressMessage: z.ZodOptional<z.ZodString>;
535
555
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -542,8 +562,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
542
562
  triggerMessageId: z.ZodString;
543
563
  workflowRunId: z.ZodString;
544
564
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
545
- private: "private";
546
565
  public: "public";
566
+ private: "private";
547
567
  }>>;
548
568
  }, z.core.$strip>>;
549
569
  }, z.core.$strip>>;
@@ -581,6 +601,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
581
601
  visitor_blocked: "visitor_blocked";
582
602
  visitor_unblocked: "visitor_unblocked";
583
603
  visitor_identified: "visitor_identified";
604
+ ai_paused: "ai_paused";
605
+ ai_resumed: "ai_resumed";
584
606
  }>;
585
607
  actorUserId: z.ZodNullable<z.ZodString>;
586
608
  actorAiAgentId: z.ZodNullable<z.ZodString>;
@@ -601,6 +623,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
601
623
  createdAt: z.ZodString;
602
624
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
603
625
  }, z.core.$strip>>;
626
+ dashboardLocked: z.ZodOptional<z.ZodBoolean>;
627
+ dashboardLockReason: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"conversation_limit">, z.ZodNull]>>;
604
628
  viewIds: z.ZodArray<z.ZodString>;
605
629
  seenData: z.ZodArray<z.ZodObject<{
606
630
  id: z.ZodString;
@@ -647,6 +671,16 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
647
671
  websiteId: z.ZodString;
648
672
  channel: z.ZodString;
649
673
  title: z.ZodNullable<z.ZodString>;
674
+ titleSource: z.ZodNullable<z.ZodEnum<{
675
+ ai: "ai";
676
+ user: "user";
677
+ }>>;
678
+ sentiment: z.ZodNullable<z.ZodEnum<{
679
+ positive: "positive";
680
+ negative: "negative";
681
+ neutral: "neutral";
682
+ }>>;
683
+ sentimentConfidence: z.ZodNullable<z.ZodNumber>;
650
684
  resolutionTime: z.ZodNullable<z.ZodNumber>;
651
685
  visitorRating: z.ZodNullable<z.ZodNumber>;
652
686
  visitorRatingAt: z.ZodNullable<z.ZodString>;
@@ -671,8 +705,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
671
705
  conversationId: z.ZodString;
672
706
  organizationId: z.ZodString;
673
707
  visibility: z.ZodEnum<{
674
- private: "private";
675
708
  public: "public";
709
+ private: "private";
676
710
  }>;
677
711
  type: z.ZodEnum<{
678
712
  message: "message";
@@ -699,8 +733,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
699
733
  providerMetadata: z.ZodOptional<z.ZodObject<{
700
734
  cossistant: z.ZodOptional<z.ZodObject<{
701
735
  visibility: z.ZodOptional<z.ZodEnum<{
702
- private: "private";
703
736
  public: "public";
737
+ private: "private";
704
738
  }>>;
705
739
  progressMessage: z.ZodOptional<z.ZodString>;
706
740
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -713,8 +747,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
713
747
  triggerMessageId: z.ZodString;
714
748
  workflowRunId: z.ZodString;
715
749
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
716
- private: "private";
717
750
  public: "public";
751
+ private: "private";
718
752
  }>>;
719
753
  }, z.core.$strip>>;
720
754
  }, z.core.$strip>>;
@@ -734,8 +768,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
734
768
  callProviderMetadata: z.ZodOptional<z.ZodObject<{
735
769
  cossistant: z.ZodOptional<z.ZodObject<{
736
770
  visibility: z.ZodOptional<z.ZodEnum<{
737
- private: "private";
738
771
  public: "public";
772
+ private: "private";
739
773
  }>>;
740
774
  progressMessage: z.ZodOptional<z.ZodString>;
741
775
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -748,8 +782,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
748
782
  triggerMessageId: z.ZodString;
749
783
  workflowRunId: z.ZodString;
750
784
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
751
- private: "private";
752
785
  public: "public";
786
+ private: "private";
753
787
  }>>;
754
788
  }, z.core.$strip>>;
755
789
  }, z.core.$strip>>;
@@ -757,8 +791,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
757
791
  providerMetadata: z.ZodOptional<z.ZodObject<{
758
792
  cossistant: z.ZodOptional<z.ZodObject<{
759
793
  visibility: z.ZodOptional<z.ZodEnum<{
760
- private: "private";
761
794
  public: "public";
795
+ private: "private";
762
796
  }>>;
763
797
  progressMessage: z.ZodOptional<z.ZodString>;
764
798
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -771,8 +805,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
771
805
  triggerMessageId: z.ZodString;
772
806
  workflowRunId: z.ZodString;
773
807
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
774
- private: "private";
775
808
  public: "public";
809
+ private: "private";
776
810
  }>>;
777
811
  }, z.core.$strip>>;
778
812
  }, z.core.$strip>>;
@@ -785,8 +819,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
785
819
  providerMetadata: z.ZodOptional<z.ZodObject<{
786
820
  cossistant: z.ZodOptional<z.ZodObject<{
787
821
  visibility: z.ZodOptional<z.ZodEnum<{
788
- private: "private";
789
822
  public: "public";
823
+ private: "private";
790
824
  }>>;
791
825
  progressMessage: z.ZodOptional<z.ZodString>;
792
826
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -799,8 +833,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
799
833
  triggerMessageId: z.ZodString;
800
834
  workflowRunId: z.ZodString;
801
835
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
802
- private: "private";
803
836
  public: "public";
837
+ private: "private";
804
838
  }>>;
805
839
  }, z.core.$strip>>;
806
840
  }, z.core.$strip>>;
@@ -814,8 +848,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
814
848
  providerMetadata: z.ZodOptional<z.ZodObject<{
815
849
  cossistant: z.ZodOptional<z.ZodObject<{
816
850
  visibility: z.ZodOptional<z.ZodEnum<{
817
- private: "private";
818
851
  public: "public";
852
+ private: "private";
819
853
  }>>;
820
854
  progressMessage: z.ZodOptional<z.ZodString>;
821
855
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -828,8 +862,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
828
862
  triggerMessageId: z.ZodString;
829
863
  workflowRunId: z.ZodString;
830
864
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
831
- private: "private";
832
865
  public: "public";
866
+ private: "private";
833
867
  }>>;
834
868
  }, z.core.$strip>>;
835
869
  }, z.core.$strip>>;
@@ -867,6 +901,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
867
901
  visitor_blocked: "visitor_blocked";
868
902
  visitor_unblocked: "visitor_unblocked";
869
903
  visitor_identified: "visitor_identified";
904
+ ai_paused: "ai_paused";
905
+ ai_resumed: "ai_resumed";
870
906
  }>;
871
907
  actorUserId: z.ZodNullable<z.ZodString>;
872
908
  actorAiAgentId: z.ZodNullable<z.ZodString>;
@@ -892,8 +928,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
892
928
  conversationId: z.ZodString;
893
929
  organizationId: z.ZodString;
894
930
  visibility: z.ZodEnum<{
895
- private: "private";
896
931
  public: "public";
932
+ private: "private";
897
933
  }>;
898
934
  type: z.ZodEnum<{
899
935
  message: "message";
@@ -920,8 +956,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
920
956
  providerMetadata: z.ZodOptional<z.ZodObject<{
921
957
  cossistant: z.ZodOptional<z.ZodObject<{
922
958
  visibility: z.ZodOptional<z.ZodEnum<{
923
- private: "private";
924
959
  public: "public";
960
+ private: "private";
925
961
  }>>;
926
962
  progressMessage: z.ZodOptional<z.ZodString>;
927
963
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -934,8 +970,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
934
970
  triggerMessageId: z.ZodString;
935
971
  workflowRunId: z.ZodString;
936
972
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
937
- private: "private";
938
973
  public: "public";
974
+ private: "private";
939
975
  }>>;
940
976
  }, z.core.$strip>>;
941
977
  }, z.core.$strip>>;
@@ -955,8 +991,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
955
991
  callProviderMetadata: z.ZodOptional<z.ZodObject<{
956
992
  cossistant: z.ZodOptional<z.ZodObject<{
957
993
  visibility: z.ZodOptional<z.ZodEnum<{
958
- private: "private";
959
994
  public: "public";
995
+ private: "private";
960
996
  }>>;
961
997
  progressMessage: z.ZodOptional<z.ZodString>;
962
998
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -969,8 +1005,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
969
1005
  triggerMessageId: z.ZodString;
970
1006
  workflowRunId: z.ZodString;
971
1007
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
972
- private: "private";
973
1008
  public: "public";
1009
+ private: "private";
974
1010
  }>>;
975
1011
  }, z.core.$strip>>;
976
1012
  }, z.core.$strip>>;
@@ -978,8 +1014,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
978
1014
  providerMetadata: z.ZodOptional<z.ZodObject<{
979
1015
  cossistant: z.ZodOptional<z.ZodObject<{
980
1016
  visibility: z.ZodOptional<z.ZodEnum<{
981
- private: "private";
982
1017
  public: "public";
1018
+ private: "private";
983
1019
  }>>;
984
1020
  progressMessage: z.ZodOptional<z.ZodString>;
985
1021
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -992,8 +1028,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
992
1028
  triggerMessageId: z.ZodString;
993
1029
  workflowRunId: z.ZodString;
994
1030
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
995
- private: "private";
996
1031
  public: "public";
1032
+ private: "private";
997
1033
  }>>;
998
1034
  }, z.core.$strip>>;
999
1035
  }, z.core.$strip>>;
@@ -1006,8 +1042,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1006
1042
  providerMetadata: z.ZodOptional<z.ZodObject<{
1007
1043
  cossistant: z.ZodOptional<z.ZodObject<{
1008
1044
  visibility: z.ZodOptional<z.ZodEnum<{
1009
- private: "private";
1010
1045
  public: "public";
1046
+ private: "private";
1011
1047
  }>>;
1012
1048
  progressMessage: z.ZodOptional<z.ZodString>;
1013
1049
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -1020,8 +1056,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1020
1056
  triggerMessageId: z.ZodString;
1021
1057
  workflowRunId: z.ZodString;
1022
1058
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
1023
- private: "private";
1024
1059
  public: "public";
1060
+ private: "private";
1025
1061
  }>>;
1026
1062
  }, z.core.$strip>>;
1027
1063
  }, z.core.$strip>>;
@@ -1035,8 +1071,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1035
1071
  providerMetadata: z.ZodOptional<z.ZodObject<{
1036
1072
  cossistant: z.ZodOptional<z.ZodObject<{
1037
1073
  visibility: z.ZodOptional<z.ZodEnum<{
1038
- private: "private";
1039
1074
  public: "public";
1075
+ private: "private";
1040
1076
  }>>;
1041
1077
  progressMessage: z.ZodOptional<z.ZodString>;
1042
1078
  knowledgeId: z.ZodOptional<z.ZodString>;
@@ -1049,8 +1085,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1049
1085
  triggerMessageId: z.ZodString;
1050
1086
  workflowRunId: z.ZodString;
1051
1087
  triggerVisibility: z.ZodOptional<z.ZodEnum<{
1052
- private: "private";
1053
1088
  public: "public";
1089
+ private: "private";
1054
1090
  }>>;
1055
1091
  }, z.core.$strip>>;
1056
1092
  }, z.core.$strip>>;
@@ -1088,6 +1124,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1088
1124
  visitor_blocked: "visitor_blocked";
1089
1125
  visitor_unblocked: "visitor_unblocked";
1090
1126
  visitor_identified: "visitor_identified";
1127
+ ai_paused: "ai_paused";
1128
+ ai_resumed: "ai_resumed";
1091
1129
  }>;
1092
1130
  actorUserId: z.ZodNullable<z.ZodString>;
1093
1131
  actorAiAgentId: z.ZodNullable<z.ZodString>;
@@ -1108,6 +1146,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
1108
1146
  createdAt: z.ZodString;
1109
1147
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1110
1148
  }, z.core.$strip>>;
1149
+ dashboardLocked: z.ZodOptional<z.ZodBoolean>;
1150
+ dashboardLockReason: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"conversation_limit">, z.ZodNull]>>;
1111
1151
  viewIds: z.ZodArray<z.ZodString>;
1112
1152
  seenData: z.ZodArray<z.ZodObject<{
1113
1153
  id: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.d.ts","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":[],"mappings":";;;cAUa,0BAAwB,CAAA,CAAA;;EAAxB,QAAA,EAAA,UAAA;EAMA,IAAA,EAAA,MAAA;AAOb,CAAA,CAAA;AAQa,cAfA,0BA+CX,EA/CqC,CAAA,CAAA,OA+CrC,CAAA;;;;;;cAxCW,6BAA2B,CAAA,CAAA,YAAA,CAAA,CAAA;;;;;cAQ3B,0BAAwB,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA,SAAA,aAAA;EAAA,SAAA,aAAA;EAkCzB,SAAA,eAAA,YAA0B,CAAA;AAItC,CAAA,eAAa,CAAA;KAJD,0BAAA,GAA6B,CAAA,CAAE,aACnC;cAGK,oCAAkC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAIlC,0BAAwB,CAAA,CAAA;;;;;IAJU,IAAA,EAAA,MAAA;EAAA,CAAA,CAAA;EAIlC,QAAA,WAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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string().nullable(),
35
+ titleSource: z.enum(["ai", "user"]).nullable(),
35
36
  resolutionTime: z.number().nullable(),
36
37
  visitorRating: z.number().int().min(1).max(5).nullable(),
37
38
  visitorRatingAt: z.string().nullable(),
@@ -63,6 +64,9 @@ const conversationHeaderSchema = z.object({
63
64
  websiteId: z.string(),
64
65
  channel: z.string(),
65
66
  title: z.string().nullable(),
67
+ titleSource: z.enum(["ai", "user"]).nullable(),
68
+ sentiment: conversationSentimentSchema,
69
+ sentimentConfidence: z.number().nullable(),
66
70
  resolutionTime: z.number().nullable(),
67
71
  visitorRating: z.number().int().min(1).max(5).nullable(),
68
72
  visitorRatingAt: z.string().nullable(),
@@ -84,6 +88,8 @@ const conversationHeaderSchema = z.object({
84
88
  lastSeenAt: z.string().nullable(),
85
89
  lastMessageTimelineItem: timelineItemSchema.nullable(),
86
90
  lastTimelineItem: timelineItemSchema.nullable(),
91
+ dashboardLocked: z.boolean().optional(),
92
+ dashboardLockReason: z.union([z.literal("conversation_limit"), z.null()]).optional(),
87
93
  viewIds: z.array(z.string()),
88
94
  seenData: z.array(conversationSeenSchema)
89
95
  });
@@ -1 +1 @@
1
- {"version":3,"file":"conversation.js","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { timelineItemSchema } from \"../api/timeline-item\";\nimport { visitorProfileSchema } from \"../api/visitor\";\nimport {\n\tConversationPriority,\n\tConversationSentiment,\n\tConversationStatus,\n} from \"../enums\";\nimport { conversationSeenSchema } from \"../schemas\";\n\nexport const conversationStatusSchema = z.enum([\n\tConversationStatus.OPEN,\n\tConversationStatus.RESOLVED,\n\tConversationStatus.SPAM,\n]);\n\nexport const conversationPrioritySchema = z.enum([\n\tConversationPriority.LOW,\n\tConversationPriority.NORMAL,\n\tConversationPriority.HIGH,\n\tConversationPriority.URGENT,\n]);\n\nexport const conversationSentimentSchema = z\n\t.enum([\n\t\tConversationSentiment.POSITIVE,\n\t\tConversationSentiment.NEGATIVE,\n\t\tConversationSentiment.NEUTRAL,\n\t])\n\t.nullable();\n\nexport const conversationRecordSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\twebsiteId: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\tsentiment: conversationSentimentSchema,\n\tsentimentConfidence: z.number().nullable(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tvisitorRating: z.number().int().min(1).max(5).nullable(),\n\tvisitorRatingAt: z.string().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastMessageBy: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type ConversationRecordResponse = z.infer<\n\ttypeof conversationRecordSchema\n>;\n\nexport const conversationMutationResponseSchema = z.object({\n\tconversation: conversationRecordSchema,\n});\n\nexport const conversationHeaderSchema = z.object({\n\tid: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\tvisitor: visitorProfileSchema,\n\twebsiteId: z.string(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tvisitorRating: z.number().int().min(1).max(5).nullable(),\n\tvisitorRatingAt: z.string().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastSeenAt: z.string().nullable(),\n\tlastMessageTimelineItem: timelineItemSchema.nullable(),\n\tlastTimelineItem: timelineItemSchema.nullable(),\n\tviewIds: z.array(z.string()),\n\tseenData: z.array(conversationSeenSchema),\n});\n\nexport const listConversationHeadersResponseSchema = z.object({\n\titems: z.array(conversationHeaderSchema),\n\tnextCursor: z.string().nullable(),\n});\n\nexport const inboxAnalyticsRangeSchema = z.union([\n\tz.literal(7),\n\tz.literal(14),\n\tz.literal(30),\n]);\n\nexport const inboxAnalyticsRequestSchema = z.object({\n\twebsiteSlug: z.string(),\n\trangeDays: inboxAnalyticsRangeSchema.optional().default(7),\n});\n\nexport const inboxAnalyticsMetricsSchema = z.object({\n\tmedianResponseTimeSeconds: z.number().nullable(),\n\tmedianResolutionTimeSeconds: z.number().nullable(),\n\taiHandledRate: z.number().nullable(),\n\tsatisfactionIndex: z.number().nullable(),\n\tuniqueVisitors: z.number(),\n});\n\nexport const inboxAnalyticsResponseSchema = z.object({\n\trange: z.object({\n\t\trangeDays: inboxAnalyticsRangeSchema,\n\t\tcurrentStart: z.string(),\n\t\tcurrentEnd: z.string(),\n\t\tpreviousStart: z.string(),\n\t\tpreviousEnd: z.string(),\n\t}),\n\tcurrent: inboxAnalyticsMetricsSchema,\n\tprevious: inboxAnalyticsMetricsSchema,\n});\n\nexport type ConversationMutationResponse = z.infer<\n\ttypeof conversationMutationResponseSchema\n>;\n\nexport type ConversationHeader = z.infer<typeof conversationHeaderSchema>;\n\nexport type InboxAnalyticsRequest = z.infer<typeof inboxAnalyticsRequestSchema>;\nexport type InboxAnalyticsResponse = z.infer<\n\ttypeof inboxAnalyticsResponseSchema\n>;\n"],"mappings":";;;;;;;AAUA,MAAa,2BAA2B,EAAE,KAAK;CAC9C,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,CAAC;AAEF,MAAa,6BAA6B,EAAE,KAAK;CAChD,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,CAAC;AAEF,MAAa,8BAA8B,EACzC,KAAK;CACL,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,CAAC,CACD,UAAU;AAEZ,MAAa,2BAA2B,EAAE,OAAO;CAChD,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,QAAQ;CACR,UAAU;CACV,WAAW;CACX,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CAC1C,SAAS,EAAE,QAAQ;CACnB,OAAO,EAAE,QAAQ,CAAC,UAAU;CAC5B,gBAAgB,EAAE,QAAQ,CAAC,UAAU;CACrC,eAAe,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,UAAU;CACxD,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChC,iBAAiB,EAAE,QAAQ,CAAC,UAAU;CACtC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,kBAAkB,EAAE,QAAQ,CAAC,UAAU;CACvC,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CAE1C,aAAa,EAAE,QAAQ,CAAC,UAAU;CAClC,sBAAsB,EAAE,QAAQ,CAAC,UAAU;CAC3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AChC,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,yBAAyB,mBAAmB,UAAU;CACtD,kBAAkB,mBAAmB,UAAU;CAC/C,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC;CAC5B,UAAU,EAAE,MAAM,uBAAuB;CACzC,CAAC;AAEF,MAAa,wCAAwC,EAAE,OAAO;CAC7D,OAAO,EAAE,MAAM,yBAAyB;CACxC,YAAY,EAAE,QAAQ,CAAC,UAAU;CACjC,CAAC;AAEF,MAAa,4BAA4B,EAAE,MAAM;CAChD,EAAE,QAAQ,EAAE;CACZ,EAAE,QAAQ,GAAG;CACb,EAAE,QAAQ,GAAG;CACb,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO;CACnD,aAAa,EAAE,QAAQ;CACvB,WAAW,0BAA0B,UAAU,CAAC,QAAQ,EAAE;CAC1D,CAAC;AAEF,MAAa,8BAA8B,EAAE,OAAO;CACnD,2BAA2B,EAAE,QAAQ,CAAC,UAAU;CAChD,6BAA6B,EAAE,QAAQ,CAAC,UAAU;CAClD,eAAe,EAAE,QAAQ,CAAC,UAAU;CACpC,mBAAmB,EAAE,QAAQ,CAAC,UAAU;CACxC,gBAAgB,EAAE,QAAQ;CAC1B,CAAC;AAEF,MAAa,+BAA+B,EAAE,OAAO;CACpD,OAAO,EAAE,OAAO;EACf,WAAW;EACX,cAAc,EAAE,QAAQ;EACxB,YAAY,EAAE,QAAQ;EACtB,eAAe,EAAE,QAAQ;EACzB,aAAa,EAAE,QAAQ;EACvB,CAAC;CACF,SAAS;CACT,UAAU;CACV,CAAC"}
1
+ {"version":3,"file":"conversation.js","names":[],"sources":["../../src/trpc/conversation.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { timelineItemSchema } from \"../api/timeline-item\";\nimport { visitorProfileSchema } from \"../api/visitor\";\nimport {\n\tConversationPriority,\n\tConversationSentiment,\n\tConversationStatus,\n} from \"../enums\";\nimport { conversationSeenSchema } from \"../schemas\";\n\nexport const conversationStatusSchema = z.enum([\n\tConversationStatus.OPEN,\n\tConversationStatus.RESOLVED,\n\tConversationStatus.SPAM,\n]);\n\nexport const conversationPrioritySchema = z.enum([\n\tConversationPriority.LOW,\n\tConversationPriority.NORMAL,\n\tConversationPriority.HIGH,\n\tConversationPriority.URGENT,\n]);\n\nexport const conversationSentimentSchema = z\n\t.enum([\n\t\tConversationSentiment.POSITIVE,\n\t\tConversationSentiment.NEGATIVE,\n\t\tConversationSentiment.NEUTRAL,\n\t])\n\t.nullable();\n\nexport const conversationRecordSchema = z.object({\n\tid: z.string(),\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\twebsiteId: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\tsentiment: conversationSentimentSchema,\n\tsentimentConfidence: z.number().nullable(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\ttitleSource: z.enum([\"ai\", \"user\"]).nullable(),\n\tresolutionTime: z.number().nullable(),\n\tvisitorRating: z.number().int().min(1).max(5).nullable(),\n\tvisitorRatingAt: z.string().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastMessageBy: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n});\n\nexport type ConversationRecordResponse = z.infer<\n\ttypeof conversationRecordSchema\n>;\n\nexport const conversationMutationResponseSchema = z.object({\n\tconversation: conversationRecordSchema,\n});\n\nexport const conversationHeaderSchema = z.object({\n\tid: z.string(),\n\tstatus: conversationStatusSchema,\n\tpriority: conversationPrioritySchema,\n\torganizationId: z.string(),\n\tvisitorId: z.string(),\n\tvisitor: visitorProfileSchema,\n\twebsiteId: z.string(),\n\tchannel: z.string(),\n\ttitle: z.string().nullable(),\n\ttitleSource: z.enum([\"ai\", \"user\"]).nullable(),\n\tsentiment: conversationSentimentSchema,\n\tsentimentConfidence: z.number().nullable(),\n\tresolutionTime: z.number().nullable(),\n\tvisitorRating: z.number().int().min(1).max(5).nullable(),\n\tvisitorRatingAt: z.string().nullable(),\n\tstartedAt: z.string().nullable(),\n\tfirstResponseAt: z.string().nullable(),\n\tresolvedAt: z.string().nullable(),\n\tresolvedByUserId: z.string().nullable(),\n\tresolvedByAiAgentId: z.string().nullable(),\n\t// Escalation tracking\n\tescalatedAt: z.string().nullable(),\n\tescalatedByAiAgentId: z.string().nullable(),\n\tescalationReason: z.string().nullable(),\n\tescalationHandledAt: z.string().nullable(),\n\tescalationHandledByUserId: z.string().nullable(),\n\t// AI pause control\n\taiPausedUntil: z.string().nullable(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().nullable(),\n\tlastMessageAt: z.string().nullable(),\n\tlastSeenAt: z.string().nullable(),\n\tlastMessageTimelineItem: timelineItemSchema.nullable(),\n\tlastTimelineItem: timelineItemSchema.nullable(),\n\tdashboardLocked: z.boolean().optional(),\n\tdashboardLockReason: z\n\t\t.union([z.literal(\"conversation_limit\"), z.null()])\n\t\t.optional(),\n\tviewIds: z.array(z.string()),\n\tseenData: z.array(conversationSeenSchema),\n});\n\nexport const listConversationHeadersResponseSchema = z.object({\n\titems: z.array(conversationHeaderSchema),\n\tnextCursor: z.string().nullable(),\n});\n\nexport const inboxAnalyticsRangeSchema = z.union([\n\tz.literal(7),\n\tz.literal(14),\n\tz.literal(30),\n]);\n\nexport const inboxAnalyticsRequestSchema = z.object({\n\twebsiteSlug: z.string(),\n\trangeDays: inboxAnalyticsRangeSchema.optional().default(7),\n});\n\nexport const inboxAnalyticsMetricsSchema = z.object({\n\tmedianResponseTimeSeconds: z.number().nullable(),\n\tmedianResolutionTimeSeconds: z.number().nullable(),\n\taiHandledRate: z.number().nullable(),\n\tsatisfactionIndex: z.number().nullable(),\n\tuniqueVisitors: z.number(),\n});\n\nexport const inboxAnalyticsResponseSchema = z.object({\n\trange: z.object({\n\t\trangeDays: inboxAnalyticsRangeSchema,\n\t\tcurrentStart: z.string(),\n\t\tcurrentEnd: z.string(),\n\t\tpreviousStart: z.string(),\n\t\tpreviousEnd: z.string(),\n\t}),\n\tcurrent: inboxAnalyticsMetricsSchema,\n\tprevious: inboxAnalyticsMetricsSchema,\n});\n\nexport type ConversationMutationResponse = z.infer<\n\ttypeof conversationMutationResponseSchema\n>;\n\nexport type ConversationHeader = z.infer<typeof conversationHeaderSchema>;\n\nexport type InboxAnalyticsRequest = z.infer<typeof inboxAnalyticsRequestSchema>;\nexport type InboxAnalyticsResponse = z.infer<\n\ttypeof inboxAnalyticsResponseSchema\n>;\n"],"mappings":";;;;;;;AAUA,MAAa,2BAA2B,EAAE,KAAK;CAC9C,mBAAmB;CACnB,mBAAmB;CACnB,mBAAmB;CACnB,CAAC;AAEF,MAAa,6BAA6B,EAAE,KAAK;CAChD,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,qBAAqB;CACrB,CAAC;AAEF,MAAa,8BAA8B,EACzC,KAAK;CACL,sBAAsB;CACtB,sBAAsB;CACtB,sBAAsB;CACtB,CAAC,CACD,UAAU;AAEZ,MAAa,2BAA2B,EAAE,OAAO;CAChD,IAAI,EAAE,QAAQ;CACd,gBAAgB,EAAE,QAAQ;CAC1B,WAAW,EAAE,QAAQ;CACrB,WAAW,EAAE,QAAQ;CACrB,QAAQ;CACR,UAAU;CACV,WAAW;CACX,qBAAqB,EAAE,QAAQ,CAAC,UAAU;CAC1C,SAAS,EAAE,QAAQ;CACnB,OAAO,EAAE,QAAQ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