@kavchat/core 0.0.1 → 0.0.3

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.
@@ -0,0 +1,1308 @@
1
+ {
2
+ "scenarios": [
3
+ {
4
+ "name": "queued, agent joins, messages out of order and duplicated, agent closes",
5
+ "locale": "en",
6
+ "start": {
7
+ "id": "c1",
8
+ "state": "queued",
9
+ "departmentId": "d1",
10
+ "agent": null,
11
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
12
+ "closeReason": null,
13
+ "ticket": null,
14
+ "lastSeq": 1,
15
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
16
+ },
17
+ "steps": [
18
+ {
19
+ "do": "start",
20
+ "state": "queued",
21
+ "agent": null,
22
+ "ticket": null,
23
+ "lastSeq": 0,
24
+ "seqs": [],
25
+ "pending": [],
26
+ "lines": [],
27
+ "status": "Waiting for a representative (1:45)",
28
+ "waitLeft": 105
29
+ },
30
+ {
31
+ "do": {
32
+ "event": {
33
+ "seq": 1,
34
+ "type": "conversation.queued",
35
+ "author": {
36
+ "kind": "system"
37
+ },
38
+ "text": null,
39
+ "data": {
40
+ "departmentId": "d1",
41
+ "deadline": "2026-01-01T12:01:45.000Z"
42
+ },
43
+ "clientId": null,
44
+ "at": "2026-01-01T12:00:01.000Z"
45
+ }
46
+ },
47
+ "state": "queued",
48
+ "agent": null,
49
+ "ticket": null,
50
+ "lastSeq": 1,
51
+ "seqs": [
52
+ 1
53
+ ],
54
+ "pending": [],
55
+ "lines": [],
56
+ "status": "Waiting for a representative (1:45)",
57
+ "waitLeft": 105
58
+ },
59
+ {
60
+ "do": {
61
+ "pending": {
62
+ "clientId": "cid_visitor_1",
63
+ "text": "Hello, is anyone there?"
64
+ }
65
+ },
66
+ "state": "queued",
67
+ "agent": null,
68
+ "ticket": null,
69
+ "lastSeq": 1,
70
+ "seqs": [
71
+ 1
72
+ ],
73
+ "pending": [
74
+ {
75
+ "clientId": "cid_visitor_1",
76
+ "status": "sending"
77
+ }
78
+ ],
79
+ "lines": [
80
+ {
81
+ "key": "pcid_visitor_1",
82
+ "kind": "visitor",
83
+ "text": "Hello, is anyone there?",
84
+ "status": "sending"
85
+ }
86
+ ],
87
+ "status": "Waiting for a representative (1:45)",
88
+ "waitLeft": 105
89
+ },
90
+ {
91
+ "do": {
92
+ "event": {
93
+ "seq": 2,
94
+ "type": "message",
95
+ "author": {
96
+ "kind": "visitor"
97
+ },
98
+ "text": "Hello, is anyone there?",
99
+ "data": {},
100
+ "clientId": "cid_visitor_1",
101
+ "at": "2026-01-01T12:00:02.000Z"
102
+ }
103
+ },
104
+ "state": "queued",
105
+ "agent": null,
106
+ "ticket": null,
107
+ "lastSeq": 2,
108
+ "seqs": [
109
+ 1,
110
+ 2
111
+ ],
112
+ "pending": [],
113
+ "lines": [
114
+ {
115
+ "key": "e2",
116
+ "kind": "visitor",
117
+ "text": "Hello, is anyone there?"
118
+ }
119
+ ],
120
+ "status": "Waiting for a representative (1:45)",
121
+ "waitLeft": 105
122
+ },
123
+ {
124
+ "do": {
125
+ "event": {
126
+ "seq": 2,
127
+ "type": "message",
128
+ "author": {
129
+ "kind": "visitor"
130
+ },
131
+ "text": "Hello, is anyone there?",
132
+ "data": {},
133
+ "clientId": "cid_visitor_1",
134
+ "at": "2026-01-01T12:00:02.000Z"
135
+ }
136
+ },
137
+ "state": "queued",
138
+ "agent": null,
139
+ "ticket": null,
140
+ "lastSeq": 2,
141
+ "seqs": [
142
+ 1,
143
+ 2
144
+ ],
145
+ "pending": [],
146
+ "lines": [
147
+ {
148
+ "key": "e2",
149
+ "kind": "visitor",
150
+ "text": "Hello, is anyone there?"
151
+ }
152
+ ],
153
+ "status": "Waiting for a representative (1:45)",
154
+ "waitLeft": 105
155
+ },
156
+ {
157
+ "do": {
158
+ "event": {
159
+ "seq": 5,
160
+ "type": "message",
161
+ "author": {
162
+ "kind": "agent",
163
+ "name": "Dana"
164
+ },
165
+ "text": "How can I help?",
166
+ "data": {},
167
+ "clientId": null,
168
+ "at": "2026-01-01T12:00:05.000Z"
169
+ }
170
+ },
171
+ "state": "queued",
172
+ "agent": null,
173
+ "ticket": null,
174
+ "lastSeq": 5,
175
+ "seqs": [
176
+ 1,
177
+ 2,
178
+ 5
179
+ ],
180
+ "pending": [],
181
+ "lines": [
182
+ {
183
+ "key": "e2",
184
+ "kind": "visitor",
185
+ "text": "Hello, is anyone there?"
186
+ },
187
+ {
188
+ "key": "e5",
189
+ "kind": "agent",
190
+ "text": "How can I help?",
191
+ "name": "Dana"
192
+ }
193
+ ],
194
+ "status": "Waiting for a representative (1:45)",
195
+ "waitLeft": 105
196
+ },
197
+ {
198
+ "do": {
199
+ "event": {
200
+ "seq": 4,
201
+ "type": "agent.joined",
202
+ "author": {
203
+ "kind": "system"
204
+ },
205
+ "text": null,
206
+ "data": {
207
+ "agent": {
208
+ "name": "Dana"
209
+ }
210
+ },
211
+ "clientId": null,
212
+ "at": "2026-01-01T12:00:04.000Z"
213
+ }
214
+ },
215
+ "state": "active",
216
+ "agent": "Dana",
217
+ "ticket": null,
218
+ "lastSeq": 5,
219
+ "seqs": [
220
+ 1,
221
+ 2,
222
+ 4,
223
+ 5
224
+ ],
225
+ "pending": [],
226
+ "lines": [
227
+ {
228
+ "key": "e2",
229
+ "kind": "visitor",
230
+ "text": "Hello, is anyone there?"
231
+ },
232
+ {
233
+ "key": "e4",
234
+ "kind": "system",
235
+ "text": "Dana joined the chat"
236
+ },
237
+ {
238
+ "key": "e5",
239
+ "kind": "agent",
240
+ "text": "How can I help?",
241
+ "name": "Dana"
242
+ }
243
+ ],
244
+ "status": "Chatting with Dana",
245
+ "waitLeft": null
246
+ },
247
+ {
248
+ "do": {
249
+ "conversation": {
250
+ "id": "c1",
251
+ "state": "active",
252
+ "departmentId": "d1",
253
+ "agent": {
254
+ "name": "Dana"
255
+ },
256
+ "queueDeadline": null,
257
+ "closeReason": null,
258
+ "ticket": null,
259
+ "lastSeq": 5,
260
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
261
+ }
262
+ },
263
+ "state": "active",
264
+ "agent": "Dana",
265
+ "ticket": null,
266
+ "lastSeq": 5,
267
+ "seqs": [
268
+ 1,
269
+ 2,
270
+ 4,
271
+ 5
272
+ ],
273
+ "pending": [],
274
+ "lines": [
275
+ {
276
+ "key": "e2",
277
+ "kind": "visitor",
278
+ "text": "Hello, is anyone there?"
279
+ },
280
+ {
281
+ "key": "e4",
282
+ "kind": "system",
283
+ "text": "Dana joined the chat"
284
+ },
285
+ {
286
+ "key": "e5",
287
+ "kind": "agent",
288
+ "text": "How can I help?",
289
+ "name": "Dana"
290
+ }
291
+ ],
292
+ "status": "Chatting with Dana",
293
+ "waitLeft": null
294
+ },
295
+ {
296
+ "do": {
297
+ "event": {
298
+ "seq": 7,
299
+ "type": "conversation.closed",
300
+ "author": {
301
+ "kind": "system"
302
+ },
303
+ "text": null,
304
+ "data": {
305
+ "reason": "agent"
306
+ },
307
+ "clientId": null,
308
+ "at": "2026-01-01T12:00:07.000Z"
309
+ }
310
+ },
311
+ "state": "closed",
312
+ "agent": "Dana",
313
+ "ticket": null,
314
+ "lastSeq": 7,
315
+ "seqs": [
316
+ 1,
317
+ 2,
318
+ 4,
319
+ 5,
320
+ 7
321
+ ],
322
+ "pending": [],
323
+ "lines": [
324
+ {
325
+ "key": "e2",
326
+ "kind": "visitor",
327
+ "text": "Hello, is anyone there?"
328
+ },
329
+ {
330
+ "key": "e4",
331
+ "kind": "system",
332
+ "text": "Dana joined the chat"
333
+ },
334
+ {
335
+ "key": "e5",
336
+ "kind": "agent",
337
+ "text": "How can I help?",
338
+ "name": "Dana"
339
+ },
340
+ {
341
+ "key": "e7",
342
+ "kind": "system",
343
+ "text": "The chat has ended"
344
+ }
345
+ ],
346
+ "status": "The chat has ended",
347
+ "waitLeft": null
348
+ },
349
+ {
350
+ "do": {
351
+ "conversation": {
352
+ "id": "c1",
353
+ "state": "active",
354
+ "departmentId": "d1",
355
+ "agent": {
356
+ "name": "Dana"
357
+ },
358
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
359
+ "closeReason": null,
360
+ "ticket": null,
361
+ "lastSeq": 5,
362
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
363
+ }
364
+ },
365
+ "state": "closed",
366
+ "agent": "Dana",
367
+ "ticket": null,
368
+ "lastSeq": 7,
369
+ "seqs": [
370
+ 1,
371
+ 2,
372
+ 4,
373
+ 5,
374
+ 7
375
+ ],
376
+ "pending": [],
377
+ "lines": [
378
+ {
379
+ "key": "e2",
380
+ "kind": "visitor",
381
+ "text": "Hello, is anyone there?"
382
+ },
383
+ {
384
+ "key": "e4",
385
+ "kind": "system",
386
+ "text": "Dana joined the chat"
387
+ },
388
+ {
389
+ "key": "e5",
390
+ "kind": "agent",
391
+ "text": "How can I help?",
392
+ "name": "Dana"
393
+ },
394
+ {
395
+ "key": "e7",
396
+ "kind": "system",
397
+ "text": "The chat has ended"
398
+ }
399
+ ],
400
+ "status": "The chat has ended",
401
+ "waitLeft": null
402
+ }
403
+ ]
404
+ },
405
+ {
406
+ "name": "reconnect replay overlaps what was already shown",
407
+ "locale": "he",
408
+ "start": {
409
+ "id": "c1",
410
+ "state": "active",
411
+ "departmentId": "d1",
412
+ "agent": {
413
+ "name": "דנה"
414
+ },
415
+ "queueDeadline": null,
416
+ "closeReason": null,
417
+ "ticket": null,
418
+ "lastSeq": 1,
419
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
420
+ },
421
+ "steps": [
422
+ {
423
+ "do": "start",
424
+ "state": "active",
425
+ "agent": "דנה",
426
+ "ticket": null,
427
+ "lastSeq": 0,
428
+ "seqs": [],
429
+ "pending": [],
430
+ "lines": [],
431
+ "status": "בשיחה עם דנה",
432
+ "waitLeft": null
433
+ },
434
+ {
435
+ "do": {
436
+ "event": {
437
+ "seq": 1,
438
+ "type": "message",
439
+ "author": {
440
+ "kind": "agent",
441
+ "name": "דנה"
442
+ },
443
+ "text": "שלום!",
444
+ "data": {},
445
+ "clientId": null,
446
+ "at": "2026-01-01T12:00:01.000Z"
447
+ }
448
+ },
449
+ "state": "active",
450
+ "agent": "דנה",
451
+ "ticket": null,
452
+ "lastSeq": 1,
453
+ "seqs": [
454
+ 1
455
+ ],
456
+ "pending": [],
457
+ "lines": [
458
+ {
459
+ "key": "e1",
460
+ "kind": "agent",
461
+ "text": "שלום!",
462
+ "name": "דנה"
463
+ }
464
+ ],
465
+ "status": "בשיחה עם דנה",
466
+ "waitLeft": null
467
+ },
468
+ {
469
+ "do": {
470
+ "event": {
471
+ "seq": 2,
472
+ "type": "message",
473
+ "author": {
474
+ "kind": "visitor"
475
+ },
476
+ "text": "היי",
477
+ "data": {},
478
+ "clientId": "cid_visitor_2",
479
+ "at": "2026-01-01T12:00:02.000Z"
480
+ }
481
+ },
482
+ "state": "active",
483
+ "agent": "דנה",
484
+ "ticket": null,
485
+ "lastSeq": 2,
486
+ "seqs": [
487
+ 1,
488
+ 2
489
+ ],
490
+ "pending": [],
491
+ "lines": [
492
+ {
493
+ "key": "e1",
494
+ "kind": "agent",
495
+ "text": "שלום!",
496
+ "name": "דנה"
497
+ },
498
+ {
499
+ "key": "e2",
500
+ "kind": "visitor",
501
+ "text": "היי"
502
+ }
503
+ ],
504
+ "status": "בשיחה עם דנה",
505
+ "waitLeft": null
506
+ },
507
+ {
508
+ "do": {
509
+ "sync": {
510
+ "conversation": {
511
+ "id": "c1",
512
+ "state": "active",
513
+ "departmentId": "d1",
514
+ "agent": {
515
+ "name": "דנה"
516
+ },
517
+ "queueDeadline": null,
518
+ "closeReason": null,
519
+ "ticket": null,
520
+ "lastSeq": 4,
521
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
522
+ },
523
+ "events": [
524
+ {
525
+ "seq": 2,
526
+ "type": "message",
527
+ "author": {
528
+ "kind": "visitor"
529
+ },
530
+ "text": "היי",
531
+ "data": {},
532
+ "clientId": "cid_visitor_2",
533
+ "at": "2026-01-01T12:00:02.000Z"
534
+ },
535
+ {
536
+ "seq": 4,
537
+ "type": "message",
538
+ "author": {
539
+ "kind": "agent",
540
+ "name": "דנה"
541
+ },
542
+ "text": "איך אפשר לעזור?",
543
+ "data": {},
544
+ "clientId": null,
545
+ "at": "2026-01-01T12:00:04.000Z"
546
+ }
547
+ ]
548
+ }
549
+ },
550
+ "state": "active",
551
+ "agent": "דנה",
552
+ "ticket": null,
553
+ "lastSeq": 4,
554
+ "seqs": [
555
+ 1,
556
+ 2,
557
+ 4
558
+ ],
559
+ "pending": [],
560
+ "lines": [
561
+ {
562
+ "key": "e1",
563
+ "kind": "agent",
564
+ "text": "שלום!",
565
+ "name": "דנה"
566
+ },
567
+ {
568
+ "key": "e2",
569
+ "kind": "visitor",
570
+ "text": "היי"
571
+ },
572
+ {
573
+ "key": "e4",
574
+ "kind": "agent",
575
+ "text": "איך אפשר לעזור?",
576
+ "name": "דנה"
577
+ }
578
+ ],
579
+ "status": "בשיחה עם דנה",
580
+ "waitLeft": null
581
+ },
582
+ {
583
+ "do": {
584
+ "event": {
585
+ "seq": 6,
586
+ "type": "agent.joined",
587
+ "author": {
588
+ "kind": "system"
589
+ },
590
+ "text": null,
591
+ "data": {
592
+ "agent": {
593
+ "name": "יוסי"
594
+ }
595
+ },
596
+ "clientId": null,
597
+ "at": "2026-01-01T12:00:06.000Z"
598
+ }
599
+ },
600
+ "state": "active",
601
+ "agent": "יוסי",
602
+ "ticket": null,
603
+ "lastSeq": 6,
604
+ "seqs": [
605
+ 1,
606
+ 2,
607
+ 4,
608
+ 6
609
+ ],
610
+ "pending": [],
611
+ "lines": [
612
+ {
613
+ "key": "e1",
614
+ "kind": "agent",
615
+ "text": "שלום!",
616
+ "name": "דנה"
617
+ },
618
+ {
619
+ "key": "e2",
620
+ "kind": "visitor",
621
+ "text": "היי"
622
+ },
623
+ {
624
+ "key": "e4",
625
+ "kind": "agent",
626
+ "text": "איך אפשר לעזור?",
627
+ "name": "דנה"
628
+ },
629
+ {
630
+ "key": "e6",
631
+ "kind": "system",
632
+ "text": "עכשיו בשיחה: יוסי"
633
+ }
634
+ ],
635
+ "status": "בשיחה עם יוסי",
636
+ "waitLeft": null
637
+ },
638
+ {
639
+ "do": {
640
+ "event": {
641
+ "seq": 99,
642
+ "type": "some.future.type",
643
+ "author": {
644
+ "kind": "system"
645
+ },
646
+ "text": "ignored",
647
+ "data": {},
648
+ "clientId": null,
649
+ "at": "2026-01-01T12:01:39.000Z"
650
+ }
651
+ },
652
+ "state": "active",
653
+ "agent": "יוסי",
654
+ "ticket": null,
655
+ "lastSeq": 99,
656
+ "seqs": [
657
+ 1,
658
+ 2,
659
+ 4,
660
+ 6,
661
+ 99
662
+ ],
663
+ "pending": [],
664
+ "lines": [
665
+ {
666
+ "key": "e1",
667
+ "kind": "agent",
668
+ "text": "שלום!",
669
+ "name": "דנה"
670
+ },
671
+ {
672
+ "key": "e2",
673
+ "kind": "visitor",
674
+ "text": "היי"
675
+ },
676
+ {
677
+ "key": "e4",
678
+ "kind": "agent",
679
+ "text": "איך אפשר לעזור?",
680
+ "name": "דנה"
681
+ },
682
+ {
683
+ "key": "e6",
684
+ "kind": "system",
685
+ "text": "עכשיו בשיחה: יוסי"
686
+ }
687
+ ],
688
+ "status": "בשיחה עם יוסי",
689
+ "waitLeft": null
690
+ }
691
+ ]
692
+ },
693
+ {
694
+ "name": "pending message fails, is retried, and is confirmed once",
695
+ "locale": "en",
696
+ "start": {
697
+ "id": "c1",
698
+ "state": "active",
699
+ "departmentId": "d1",
700
+ "agent": {
701
+ "name": "Dana"
702
+ },
703
+ "queueDeadline": null,
704
+ "closeReason": null,
705
+ "ticket": null,
706
+ "lastSeq": 1,
707
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
708
+ },
709
+ "steps": [
710
+ {
711
+ "do": "start",
712
+ "state": "active",
713
+ "agent": "Dana",
714
+ "ticket": null,
715
+ "lastSeq": 0,
716
+ "seqs": [],
717
+ "pending": [],
718
+ "lines": [],
719
+ "status": "Chatting with Dana",
720
+ "waitLeft": null
721
+ },
722
+ {
723
+ "do": {
724
+ "pending": {
725
+ "clientId": "cid_retry_001",
726
+ "text": "My order is late"
727
+ }
728
+ },
729
+ "state": "active",
730
+ "agent": "Dana",
731
+ "ticket": null,
732
+ "lastSeq": 0,
733
+ "seqs": [],
734
+ "pending": [
735
+ {
736
+ "clientId": "cid_retry_001",
737
+ "status": "sending"
738
+ }
739
+ ],
740
+ "lines": [
741
+ {
742
+ "key": "pcid_retry_001",
743
+ "kind": "visitor",
744
+ "text": "My order is late",
745
+ "status": "sending"
746
+ }
747
+ ],
748
+ "status": "Chatting with Dana",
749
+ "waitLeft": null
750
+ },
751
+ {
752
+ "do": {
753
+ "setPending": {
754
+ "clientId": "cid_retry_001",
755
+ "status": "failed"
756
+ }
757
+ },
758
+ "state": "active",
759
+ "agent": "Dana",
760
+ "ticket": null,
761
+ "lastSeq": 0,
762
+ "seqs": [],
763
+ "pending": [
764
+ {
765
+ "clientId": "cid_retry_001",
766
+ "status": "failed"
767
+ }
768
+ ],
769
+ "lines": [
770
+ {
771
+ "key": "pcid_retry_001",
772
+ "kind": "visitor",
773
+ "text": "My order is late",
774
+ "status": "failed"
775
+ }
776
+ ],
777
+ "status": "Chatting with Dana",
778
+ "waitLeft": null
779
+ },
780
+ {
781
+ "do": {
782
+ "setPending": {
783
+ "clientId": "cid_retry_001",
784
+ "status": "sending"
785
+ }
786
+ },
787
+ "state": "active",
788
+ "agent": "Dana",
789
+ "ticket": null,
790
+ "lastSeq": 0,
791
+ "seqs": [],
792
+ "pending": [
793
+ {
794
+ "clientId": "cid_retry_001",
795
+ "status": "sending"
796
+ }
797
+ ],
798
+ "lines": [
799
+ {
800
+ "key": "pcid_retry_001",
801
+ "kind": "visitor",
802
+ "text": "My order is late",
803
+ "status": "sending"
804
+ }
805
+ ],
806
+ "status": "Chatting with Dana",
807
+ "waitLeft": null
808
+ },
809
+ {
810
+ "do": {
811
+ "pending": {
812
+ "clientId": "cid_retry_001",
813
+ "text": "My order is late"
814
+ }
815
+ },
816
+ "state": "active",
817
+ "agent": "Dana",
818
+ "ticket": null,
819
+ "lastSeq": 0,
820
+ "seqs": [],
821
+ "pending": [
822
+ {
823
+ "clientId": "cid_retry_001",
824
+ "status": "sending"
825
+ }
826
+ ],
827
+ "lines": [
828
+ {
829
+ "key": "pcid_retry_001",
830
+ "kind": "visitor",
831
+ "text": "My order is late",
832
+ "status": "sending"
833
+ }
834
+ ],
835
+ "status": "Chatting with Dana",
836
+ "waitLeft": null
837
+ },
838
+ {
839
+ "do": {
840
+ "event": {
841
+ "seq": 3,
842
+ "type": "message",
843
+ "author": {
844
+ "kind": "visitor"
845
+ },
846
+ "text": "My order is late",
847
+ "data": {},
848
+ "clientId": "cid_retry_001",
849
+ "at": "2026-01-01T12:00:03.000Z"
850
+ }
851
+ },
852
+ "state": "active",
853
+ "agent": "Dana",
854
+ "ticket": null,
855
+ "lastSeq": 3,
856
+ "seqs": [
857
+ 3
858
+ ],
859
+ "pending": [],
860
+ "lines": [
861
+ {
862
+ "key": "e3",
863
+ "kind": "visitor",
864
+ "text": "My order is late"
865
+ }
866
+ ],
867
+ "status": "Chatting with Dana",
868
+ "waitLeft": null
869
+ },
870
+ {
871
+ "do": {
872
+ "pending": {
873
+ "clientId": "cid_retry_001",
874
+ "text": "My order is late"
875
+ }
876
+ },
877
+ "state": "active",
878
+ "agent": "Dana",
879
+ "ticket": null,
880
+ "lastSeq": 3,
881
+ "seqs": [
882
+ 3
883
+ ],
884
+ "pending": [],
885
+ "lines": [
886
+ {
887
+ "key": "e3",
888
+ "kind": "visitor",
889
+ "text": "My order is late"
890
+ }
891
+ ],
892
+ "status": "Chatting with Dana",
893
+ "waitLeft": null
894
+ }
895
+ ]
896
+ },
897
+ {
898
+ "name": "nobody answers in time: the chat becomes a ticket, the number arrives later",
899
+ "locale": "en",
900
+ "start": {
901
+ "id": "c1",
902
+ "state": "queued",
903
+ "departmentId": "d1",
904
+ "agent": null,
905
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
906
+ "closeReason": null,
907
+ "ticket": null,
908
+ "lastSeq": 1,
909
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
910
+ },
911
+ "steps": [
912
+ {
913
+ "do": "start",
914
+ "state": "queued",
915
+ "agent": null,
916
+ "ticket": null,
917
+ "lastSeq": 0,
918
+ "seqs": [],
919
+ "pending": [],
920
+ "lines": [],
921
+ "status": "Waiting for a representative (1:45)",
922
+ "waitLeft": 105
923
+ },
924
+ {
925
+ "do": {
926
+ "event": {
927
+ "seq": 1,
928
+ "type": "conversation.queued",
929
+ "author": {
930
+ "kind": "system"
931
+ },
932
+ "text": null,
933
+ "data": {
934
+ "departmentId": "d1",
935
+ "deadline": "2026-01-01T12:01:45.000Z"
936
+ },
937
+ "clientId": null,
938
+ "at": "2026-01-01T12:00:01.000Z"
939
+ }
940
+ },
941
+ "state": "queued",
942
+ "agent": null,
943
+ "ticket": null,
944
+ "lastSeq": 1,
945
+ "seqs": [
946
+ 1
947
+ ],
948
+ "pending": [],
949
+ "lines": [],
950
+ "status": "Waiting for a representative (1:45)",
951
+ "waitLeft": 105
952
+ },
953
+ {
954
+ "do": {
955
+ "conversation": {
956
+ "id": "c1",
957
+ "state": "ticket",
958
+ "departmentId": "d1",
959
+ "agent": null,
960
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
961
+ "closeReason": null,
962
+ "ticket": {
963
+ "number": null,
964
+ "reason": "timeout"
965
+ },
966
+ "lastSeq": 2,
967
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
968
+ }
969
+ },
970
+ "state": "ticket",
971
+ "agent": null,
972
+ "ticket": {
973
+ "number": null,
974
+ "reason": "timeout"
975
+ },
976
+ "lastSeq": 1,
977
+ "seqs": [
978
+ 1
979
+ ],
980
+ "pending": [],
981
+ "lines": [],
982
+ "status": "No representative was free in time, so we saved your chat as a request. We got your message and will get back to you soon.",
983
+ "waitLeft": null
984
+ },
985
+ {
986
+ "do": {
987
+ "event": {
988
+ "seq": 2,
989
+ "type": "conversation.ticket",
990
+ "author": {
991
+ "kind": "system"
992
+ },
993
+ "text": null,
994
+ "data": {
995
+ "reason": "timeout",
996
+ "ticketNumber": 1042
997
+ },
998
+ "clientId": null,
999
+ "at": "2026-01-01T12:00:02.000Z"
1000
+ }
1001
+ },
1002
+ "state": "ticket",
1003
+ "agent": null,
1004
+ "ticket": {
1005
+ "number": 1042,
1006
+ "reason": "timeout"
1007
+ },
1008
+ "lastSeq": 2,
1009
+ "seqs": [
1010
+ 1,
1011
+ 2
1012
+ ],
1013
+ "pending": [],
1014
+ "lines": [
1015
+ {
1016
+ "key": "e2",
1017
+ "kind": "system",
1018
+ "text": "We got your message and will get back to you soon. Request #1042"
1019
+ }
1020
+ ],
1021
+ "status": "No representative was free in time, so we saved your chat as a request. We got your message and will get back to you soon. Request #1042",
1022
+ "waitLeft": null
1023
+ },
1024
+ {
1025
+ "do": {
1026
+ "conversation": {
1027
+ "id": "c1",
1028
+ "state": "ticket",
1029
+ "departmentId": "d1",
1030
+ "agent": null,
1031
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
1032
+ "closeReason": null,
1033
+ "ticket": {
1034
+ "number": null,
1035
+ "reason": "timeout"
1036
+ },
1037
+ "lastSeq": 2,
1038
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
1039
+ }
1040
+ },
1041
+ "state": "ticket",
1042
+ "agent": null,
1043
+ "ticket": {
1044
+ "number": 1042,
1045
+ "reason": "timeout"
1046
+ },
1047
+ "lastSeq": 2,
1048
+ "seqs": [
1049
+ 1,
1050
+ 2
1051
+ ],
1052
+ "pending": [],
1053
+ "lines": [
1054
+ {
1055
+ "key": "e2",
1056
+ "kind": "system",
1057
+ "text": "We got your message and will get back to you soon. Request #1042"
1058
+ }
1059
+ ],
1060
+ "status": "No representative was free in time, so we saved your chat as a request. We got your message and will get back to you soon. Request #1042",
1061
+ "waitLeft": null
1062
+ }
1063
+ ]
1064
+ },
1065
+ {
1066
+ "name": "leave a message instead (events only, no conversation object)",
1067
+ "locale": "he",
1068
+ "start": {
1069
+ "id": "c1",
1070
+ "state": "queued",
1071
+ "departmentId": "d1",
1072
+ "agent": null,
1073
+ "queueDeadline": "2026-01-01T12:01:45.000Z",
1074
+ "closeReason": null,
1075
+ "ticket": null,
1076
+ "lastSeq": 1,
1077
+ "credentialExpiresAt": "2026-01-02T00:00:00.000Z"
1078
+ },
1079
+ "steps": [
1080
+ {
1081
+ "do": "start",
1082
+ "state": "queued",
1083
+ "agent": null,
1084
+ "ticket": null,
1085
+ "lastSeq": 0,
1086
+ "seqs": [],
1087
+ "pending": [],
1088
+ "lines": [],
1089
+ "status": "ממתינים לנציג (1:45)",
1090
+ "waitLeft": 105
1091
+ },
1092
+ {
1093
+ "do": {
1094
+ "event": {
1095
+ "seq": 2,
1096
+ "type": "message",
1097
+ "author": {
1098
+ "kind": "visitor"
1099
+ },
1100
+ "text": "אחזור מחר",
1101
+ "data": {},
1102
+ "clientId": "cid_leave_01",
1103
+ "at": "2026-01-01T12:00:02.000Z"
1104
+ }
1105
+ },
1106
+ "state": "queued",
1107
+ "agent": null,
1108
+ "ticket": null,
1109
+ "lastSeq": 2,
1110
+ "seqs": [
1111
+ 2
1112
+ ],
1113
+ "pending": [],
1114
+ "lines": [
1115
+ {
1116
+ "key": "e2",
1117
+ "kind": "visitor",
1118
+ "text": "אחזור מחר"
1119
+ }
1120
+ ],
1121
+ "status": "ממתינים לנציג (1:45)",
1122
+ "waitLeft": 105
1123
+ },
1124
+ {
1125
+ "do": {
1126
+ "event": {
1127
+ "seq": 3,
1128
+ "type": "conversation.ticket",
1129
+ "author": {
1130
+ "kind": "system"
1131
+ },
1132
+ "text": null,
1133
+ "data": {
1134
+ "reason": "visitor",
1135
+ "ticketNumber": 77
1136
+ },
1137
+ "clientId": null,
1138
+ "at": "2026-01-01T12:00:03.000Z"
1139
+ }
1140
+ },
1141
+ "state": "ticket",
1142
+ "agent": null,
1143
+ "ticket": {
1144
+ "number": 77,
1145
+ "reason": "visitor"
1146
+ },
1147
+ "lastSeq": 3,
1148
+ "seqs": [
1149
+ 2,
1150
+ 3
1151
+ ],
1152
+ "pending": [],
1153
+ "lines": [
1154
+ {
1155
+ "key": "e2",
1156
+ "kind": "visitor",
1157
+ "text": "אחזור מחר"
1158
+ },
1159
+ {
1160
+ "key": "e3",
1161
+ "kind": "system",
1162
+ "text": "קיבלנו את ההודעה ונחזור אליכם בהקדם. פנייה מספר 77"
1163
+ }
1164
+ ],
1165
+ "status": "קיבלנו את ההודעה ונחזור אליכם בהקדם. פנייה מספר 77",
1166
+ "waitLeft": null
1167
+ }
1168
+ ]
1169
+ }
1170
+ ],
1171
+ "backoff": [
1172
+ {
1173
+ "attempt": 0,
1174
+ "random": 0,
1175
+ "ms": 700
1176
+ },
1177
+ {
1178
+ "attempt": 0,
1179
+ "random": 0.5,
1180
+ "ms": 1000
1181
+ },
1182
+ {
1183
+ "attempt": 0,
1184
+ "random": 1,
1185
+ "ms": 1300
1186
+ },
1187
+ {
1188
+ "attempt": 1,
1189
+ "random": 0.5,
1190
+ "ms": 2000
1191
+ },
1192
+ {
1193
+ "attempt": 2,
1194
+ "random": 0.5,
1195
+ "ms": 4000
1196
+ },
1197
+ {
1198
+ "attempt": 3,
1199
+ "random": 0.5,
1200
+ "ms": 8000
1201
+ },
1202
+ {
1203
+ "attempt": 4,
1204
+ "random": 0.5,
1205
+ "ms": 16000
1206
+ },
1207
+ {
1208
+ "attempt": 5,
1209
+ "random": 0.5,
1210
+ "ms": 30000
1211
+ },
1212
+ {
1213
+ "attempt": 9,
1214
+ "random": 0.5,
1215
+ "ms": 30000
1216
+ },
1217
+ {
1218
+ "attempt": 9,
1219
+ "random": 1,
1220
+ "ms": 39000
1221
+ }
1222
+ ],
1223
+ "liveChip": {
1224
+ "input": [
1225
+ {
1226
+ "id": "script:a",
1227
+ "label": "A",
1228
+ "kind": "button"
1229
+ },
1230
+ {
1231
+ "id": "contact",
1232
+ "label": "Talk to our team",
1233
+ "kind": "contact",
1234
+ "prefill": "where is my order"
1235
+ }
1236
+ ],
1237
+ "label": "Talk to a representative",
1238
+ "output": [
1239
+ {
1240
+ "id": "script:a",
1241
+ "label": "A",
1242
+ "kind": "button"
1243
+ },
1244
+ {
1245
+ "id": "live",
1246
+ "label": "Talk to a representative",
1247
+ "kind": "live",
1248
+ "prefill": "where is my order"
1249
+ },
1250
+ {
1251
+ "id": "contact",
1252
+ "label": "Talk to our team",
1253
+ "kind": "contact",
1254
+ "prefill": "where is my order"
1255
+ }
1256
+ ]
1257
+ },
1258
+ "unavailable": [
1259
+ {
1260
+ "reason": "closed",
1261
+ "locale": "en",
1262
+ "time": "09:00",
1263
+ "text": "Our representatives are not available right now and will be back at 09:00. Leave a message and we will get back to you."
1264
+ },
1265
+ {
1266
+ "reason": "closed",
1267
+ "locale": "he",
1268
+ "time": "09:00",
1269
+ "text": "הנציגים לא זמינים כרגע ויחזרו ב-09:00. השאירו הודעה ונחזור אליכם."
1270
+ },
1271
+ {
1272
+ "reason": "no_agents",
1273
+ "locale": "en",
1274
+ "time": null,
1275
+ "text": "All our representatives are busy right now. Leave a message and we will get back to you."
1276
+ },
1277
+ {
1278
+ "reason": "no_agents",
1279
+ "locale": "he",
1280
+ "time": null,
1281
+ "text": "כל הנציגים עסוקים כרגע. השאירו הודעה ונחזור אליכם."
1282
+ },
1283
+ {
1284
+ "reason": "quota",
1285
+ "locale": "en",
1286
+ "time": null,
1287
+ "text": ""
1288
+ },
1289
+ {
1290
+ "reason": "quota",
1291
+ "locale": "he",
1292
+ "time": null,
1293
+ "text": ""
1294
+ },
1295
+ {
1296
+ "reason": "disabled",
1297
+ "locale": "en",
1298
+ "time": null,
1299
+ "text": ""
1300
+ },
1301
+ {
1302
+ "reason": "disabled",
1303
+ "locale": "he",
1304
+ "time": null,
1305
+ "text": ""
1306
+ }
1307
+ ]
1308
+ }