@agent-team-foundation/first-tree-hub 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1451 @@
1
+ {
2
+ "id": "9a12714c-7ded-4a41-9fd8-8e2aa92a647e",
3
+ "prevId": "be78162b-42e3-4a83-9972-06b1dd19b7d4",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.adapter_agent_mappings": {
8
+ "name": "adapter_agent_mappings",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "serial",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "platform": {
18
+ "name": "platform",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "external_user_id": {
24
+ "name": "external_user_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "agent_id": {
30
+ "name": "agent_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "bound_via": {
36
+ "name": "bound_via",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "display_name": {
42
+ "name": "display_name",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "metadata": {
48
+ "name": "metadata",
49
+ "type": "jsonb",
50
+ "primaryKey": false,
51
+ "notNull": true,
52
+ "default": "'{}'::jsonb"
53
+ },
54
+ "created_at": {
55
+ "name": "created_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {},
63
+ "foreignKeys": {
64
+ "adapter_agent_mappings_agent_id_agents_uuid_fk": {
65
+ "name": "adapter_agent_mappings_agent_id_agents_uuid_fk",
66
+ "tableFrom": "adapter_agent_mappings",
67
+ "tableTo": "agents",
68
+ "columnsFrom": [
69
+ "agent_id"
70
+ ],
71
+ "columnsTo": [
72
+ "uuid"
73
+ ],
74
+ "onDelete": "no action",
75
+ "onUpdate": "no action"
76
+ }
77
+ },
78
+ "compositePrimaryKeys": {},
79
+ "uniqueConstraints": {
80
+ "uq_adapter_agent_mapping": {
81
+ "name": "uq_adapter_agent_mapping",
82
+ "nullsNotDistinct": false,
83
+ "columns": [
84
+ "platform",
85
+ "external_user_id"
86
+ ]
87
+ }
88
+ },
89
+ "policies": {},
90
+ "checkConstraints": {},
91
+ "isRLSEnabled": false
92
+ },
93
+ "public.adapter_chat_mappings": {
94
+ "name": "adapter_chat_mappings",
95
+ "schema": "",
96
+ "columns": {
97
+ "id": {
98
+ "name": "id",
99
+ "type": "serial",
100
+ "primaryKey": true,
101
+ "notNull": true
102
+ },
103
+ "platform": {
104
+ "name": "platform",
105
+ "type": "text",
106
+ "primaryKey": false,
107
+ "notNull": true
108
+ },
109
+ "external_channel_id": {
110
+ "name": "external_channel_id",
111
+ "type": "text",
112
+ "primaryKey": false,
113
+ "notNull": true
114
+ },
115
+ "chat_id": {
116
+ "name": "chat_id",
117
+ "type": "text",
118
+ "primaryKey": false,
119
+ "notNull": true
120
+ },
121
+ "thread_id": {
122
+ "name": "thread_id",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": false
126
+ },
127
+ "metadata": {
128
+ "name": "metadata",
129
+ "type": "jsonb",
130
+ "primaryKey": false,
131
+ "notNull": true,
132
+ "default": "'{}'::jsonb"
133
+ },
134
+ "created_at": {
135
+ "name": "created_at",
136
+ "type": "timestamp with time zone",
137
+ "primaryKey": false,
138
+ "notNull": true,
139
+ "default": "now()"
140
+ }
141
+ },
142
+ "indexes": {},
143
+ "foreignKeys": {
144
+ "adapter_chat_mappings_chat_id_chats_id_fk": {
145
+ "name": "adapter_chat_mappings_chat_id_chats_id_fk",
146
+ "tableFrom": "adapter_chat_mappings",
147
+ "tableTo": "chats",
148
+ "columnsFrom": [
149
+ "chat_id"
150
+ ],
151
+ "columnsTo": [
152
+ "id"
153
+ ],
154
+ "onDelete": "no action",
155
+ "onUpdate": "no action"
156
+ }
157
+ },
158
+ "compositePrimaryKeys": {},
159
+ "uniqueConstraints": {},
160
+ "policies": {},
161
+ "checkConstraints": {},
162
+ "isRLSEnabled": false
163
+ },
164
+ "public.adapter_configs": {
165
+ "name": "adapter_configs",
166
+ "schema": "",
167
+ "columns": {
168
+ "id": {
169
+ "name": "id",
170
+ "type": "serial",
171
+ "primaryKey": true,
172
+ "notNull": true
173
+ },
174
+ "platform": {
175
+ "name": "platform",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": true
179
+ },
180
+ "agent_id": {
181
+ "name": "agent_id",
182
+ "type": "text",
183
+ "primaryKey": false,
184
+ "notNull": true
185
+ },
186
+ "credentials": {
187
+ "name": "credentials",
188
+ "type": "jsonb",
189
+ "primaryKey": false,
190
+ "notNull": true
191
+ },
192
+ "status": {
193
+ "name": "status",
194
+ "type": "text",
195
+ "primaryKey": false,
196
+ "notNull": true,
197
+ "default": "'active'"
198
+ },
199
+ "created_at": {
200
+ "name": "created_at",
201
+ "type": "timestamp with time zone",
202
+ "primaryKey": false,
203
+ "notNull": true,
204
+ "default": "now()"
205
+ },
206
+ "updated_at": {
207
+ "name": "updated_at",
208
+ "type": "timestamp with time zone",
209
+ "primaryKey": false,
210
+ "notNull": true,
211
+ "default": "now()"
212
+ }
213
+ },
214
+ "indexes": {},
215
+ "foreignKeys": {
216
+ "adapter_configs_agent_id_agents_uuid_fk": {
217
+ "name": "adapter_configs_agent_id_agents_uuid_fk",
218
+ "tableFrom": "adapter_configs",
219
+ "tableTo": "agents",
220
+ "columnsFrom": [
221
+ "agent_id"
222
+ ],
223
+ "columnsTo": [
224
+ "uuid"
225
+ ],
226
+ "onDelete": "no action",
227
+ "onUpdate": "no action"
228
+ }
229
+ },
230
+ "compositePrimaryKeys": {},
231
+ "uniqueConstraints": {
232
+ "uq_adapter_configs_agent_platform": {
233
+ "name": "uq_adapter_configs_agent_platform",
234
+ "nullsNotDistinct": false,
235
+ "columns": [
236
+ "agent_id",
237
+ "platform"
238
+ ]
239
+ }
240
+ },
241
+ "policies": {},
242
+ "checkConstraints": {},
243
+ "isRLSEnabled": false
244
+ },
245
+ "public.adapter_message_references": {
246
+ "name": "adapter_message_references",
247
+ "schema": "",
248
+ "columns": {
249
+ "id": {
250
+ "name": "id",
251
+ "type": "serial",
252
+ "primaryKey": true,
253
+ "notNull": true
254
+ },
255
+ "message_id": {
256
+ "name": "message_id",
257
+ "type": "text",
258
+ "primaryKey": false,
259
+ "notNull": true
260
+ },
261
+ "platform": {
262
+ "name": "platform",
263
+ "type": "text",
264
+ "primaryKey": false,
265
+ "notNull": true
266
+ },
267
+ "external_message_id": {
268
+ "name": "external_message_id",
269
+ "type": "text",
270
+ "primaryKey": false,
271
+ "notNull": true
272
+ },
273
+ "external_channel_id": {
274
+ "name": "external_channel_id",
275
+ "type": "text",
276
+ "primaryKey": false,
277
+ "notNull": true
278
+ },
279
+ "created_at": {
280
+ "name": "created_at",
281
+ "type": "timestamp with time zone",
282
+ "primaryKey": false,
283
+ "notNull": true,
284
+ "default": "now()"
285
+ }
286
+ },
287
+ "indexes": {},
288
+ "foreignKeys": {
289
+ "adapter_message_references_message_id_messages_id_fk": {
290
+ "name": "adapter_message_references_message_id_messages_id_fk",
291
+ "tableFrom": "adapter_message_references",
292
+ "tableTo": "messages",
293
+ "columnsFrom": [
294
+ "message_id"
295
+ ],
296
+ "columnsTo": [
297
+ "id"
298
+ ],
299
+ "onDelete": "no action",
300
+ "onUpdate": "no action"
301
+ }
302
+ },
303
+ "compositePrimaryKeys": {},
304
+ "uniqueConstraints": {
305
+ "uq_adapter_message_ref": {
306
+ "name": "uq_adapter_message_ref",
307
+ "nullsNotDistinct": false,
308
+ "columns": [
309
+ "message_id",
310
+ "platform"
311
+ ]
312
+ }
313
+ },
314
+ "policies": {},
315
+ "checkConstraints": {},
316
+ "isRLSEnabled": false
317
+ },
318
+ "public.admin_users": {
319
+ "name": "admin_users",
320
+ "schema": "",
321
+ "columns": {
322
+ "id": {
323
+ "name": "id",
324
+ "type": "text",
325
+ "primaryKey": true,
326
+ "notNull": true
327
+ },
328
+ "username": {
329
+ "name": "username",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": true
333
+ },
334
+ "password_hash": {
335
+ "name": "password_hash",
336
+ "type": "text",
337
+ "primaryKey": false,
338
+ "notNull": true
339
+ },
340
+ "role": {
341
+ "name": "role",
342
+ "type": "text",
343
+ "primaryKey": false,
344
+ "notNull": true,
345
+ "default": "'admin'"
346
+ },
347
+ "created_at": {
348
+ "name": "created_at",
349
+ "type": "timestamp with time zone",
350
+ "primaryKey": false,
351
+ "notNull": true,
352
+ "default": "now()"
353
+ },
354
+ "last_login_at": {
355
+ "name": "last_login_at",
356
+ "type": "timestamp with time zone",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ }
360
+ },
361
+ "indexes": {},
362
+ "foreignKeys": {},
363
+ "compositePrimaryKeys": {},
364
+ "uniqueConstraints": {
365
+ "admin_users_username_unique": {
366
+ "name": "admin_users_username_unique",
367
+ "nullsNotDistinct": false,
368
+ "columns": [
369
+ "username"
370
+ ]
371
+ }
372
+ },
373
+ "policies": {},
374
+ "checkConstraints": {},
375
+ "isRLSEnabled": false
376
+ },
377
+ "public.agent_chat_sessions": {
378
+ "name": "agent_chat_sessions",
379
+ "schema": "",
380
+ "columns": {
381
+ "agent_id": {
382
+ "name": "agent_id",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": true
386
+ },
387
+ "chat_id": {
388
+ "name": "chat_id",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": true
392
+ },
393
+ "state": {
394
+ "name": "state",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": true
398
+ },
399
+ "updated_at": {
400
+ "name": "updated_at",
401
+ "type": "timestamp with time zone",
402
+ "primaryKey": false,
403
+ "notNull": true,
404
+ "default": "now()"
405
+ }
406
+ },
407
+ "indexes": {},
408
+ "foreignKeys": {
409
+ "agent_chat_sessions_agent_id_agents_uuid_fk": {
410
+ "name": "agent_chat_sessions_agent_id_agents_uuid_fk",
411
+ "tableFrom": "agent_chat_sessions",
412
+ "tableTo": "agents",
413
+ "columnsFrom": [
414
+ "agent_id"
415
+ ],
416
+ "columnsTo": [
417
+ "uuid"
418
+ ],
419
+ "onDelete": "cascade",
420
+ "onUpdate": "no action"
421
+ },
422
+ "agent_chat_sessions_chat_id_chats_id_fk": {
423
+ "name": "agent_chat_sessions_chat_id_chats_id_fk",
424
+ "tableFrom": "agent_chat_sessions",
425
+ "tableTo": "chats",
426
+ "columnsFrom": [
427
+ "chat_id"
428
+ ],
429
+ "columnsTo": [
430
+ "id"
431
+ ],
432
+ "onDelete": "cascade",
433
+ "onUpdate": "no action"
434
+ }
435
+ },
436
+ "compositePrimaryKeys": {
437
+ "agent_chat_sessions_agent_id_chat_id_pk": {
438
+ "name": "agent_chat_sessions_agent_id_chat_id_pk",
439
+ "columns": [
440
+ "agent_id",
441
+ "chat_id"
442
+ ]
443
+ }
444
+ },
445
+ "uniqueConstraints": {},
446
+ "policies": {},
447
+ "checkConstraints": {},
448
+ "isRLSEnabled": false
449
+ },
450
+ "public.agent_presence": {
451
+ "name": "agent_presence",
452
+ "schema": "",
453
+ "columns": {
454
+ "agent_id": {
455
+ "name": "agent_id",
456
+ "type": "text",
457
+ "primaryKey": true,
458
+ "notNull": true
459
+ },
460
+ "status": {
461
+ "name": "status",
462
+ "type": "text",
463
+ "primaryKey": false,
464
+ "notNull": true,
465
+ "default": "'offline'"
466
+ },
467
+ "instance_id": {
468
+ "name": "instance_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": false
472
+ },
473
+ "connected_at": {
474
+ "name": "connected_at",
475
+ "type": "timestamp with time zone",
476
+ "primaryKey": false,
477
+ "notNull": false
478
+ },
479
+ "last_seen_at": {
480
+ "name": "last_seen_at",
481
+ "type": "timestamp with time zone",
482
+ "primaryKey": false,
483
+ "notNull": true,
484
+ "default": "now()"
485
+ },
486
+ "client_id": {
487
+ "name": "client_id",
488
+ "type": "text",
489
+ "primaryKey": false,
490
+ "notNull": false
491
+ },
492
+ "runtime_type": {
493
+ "name": "runtime_type",
494
+ "type": "text",
495
+ "primaryKey": false,
496
+ "notNull": false
497
+ },
498
+ "runtime_version": {
499
+ "name": "runtime_version",
500
+ "type": "text",
501
+ "primaryKey": false,
502
+ "notNull": false
503
+ },
504
+ "runtime_state": {
505
+ "name": "runtime_state",
506
+ "type": "text",
507
+ "primaryKey": false,
508
+ "notNull": false
509
+ },
510
+ "active_sessions": {
511
+ "name": "active_sessions",
512
+ "type": "integer",
513
+ "primaryKey": false,
514
+ "notNull": false
515
+ },
516
+ "total_sessions": {
517
+ "name": "total_sessions",
518
+ "type": "integer",
519
+ "primaryKey": false,
520
+ "notNull": false
521
+ },
522
+ "runtime_updated_at": {
523
+ "name": "runtime_updated_at",
524
+ "type": "timestamp with time zone",
525
+ "primaryKey": false,
526
+ "notNull": false
527
+ }
528
+ },
529
+ "indexes": {},
530
+ "foreignKeys": {
531
+ "agent_presence_agent_id_agents_uuid_fk": {
532
+ "name": "agent_presence_agent_id_agents_uuid_fk",
533
+ "tableFrom": "agent_presence",
534
+ "tableTo": "agents",
535
+ "columnsFrom": [
536
+ "agent_id"
537
+ ],
538
+ "columnsTo": [
539
+ "uuid"
540
+ ],
541
+ "onDelete": "cascade",
542
+ "onUpdate": "no action"
543
+ },
544
+ "agent_presence_client_id_clients_id_fk": {
545
+ "name": "agent_presence_client_id_clients_id_fk",
546
+ "tableFrom": "agent_presence",
547
+ "tableTo": "clients",
548
+ "columnsFrom": [
549
+ "client_id"
550
+ ],
551
+ "columnsTo": [
552
+ "id"
553
+ ],
554
+ "onDelete": "set null",
555
+ "onUpdate": "no action"
556
+ }
557
+ },
558
+ "compositePrimaryKeys": {},
559
+ "uniqueConstraints": {},
560
+ "policies": {},
561
+ "checkConstraints": {},
562
+ "isRLSEnabled": false
563
+ },
564
+ "public.agent_tokens": {
565
+ "name": "agent_tokens",
566
+ "schema": "",
567
+ "columns": {
568
+ "id": {
569
+ "name": "id",
570
+ "type": "text",
571
+ "primaryKey": true,
572
+ "notNull": true
573
+ },
574
+ "agent_id": {
575
+ "name": "agent_id",
576
+ "type": "text",
577
+ "primaryKey": false,
578
+ "notNull": true
579
+ },
580
+ "token_hash": {
581
+ "name": "token_hash",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": true
585
+ },
586
+ "name": {
587
+ "name": "name",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false
591
+ },
592
+ "expires_at": {
593
+ "name": "expires_at",
594
+ "type": "timestamp with time zone",
595
+ "primaryKey": false,
596
+ "notNull": false
597
+ },
598
+ "revoked_at": {
599
+ "name": "revoked_at",
600
+ "type": "timestamp with time zone",
601
+ "primaryKey": false,
602
+ "notNull": false
603
+ },
604
+ "created_at": {
605
+ "name": "created_at",
606
+ "type": "timestamp with time zone",
607
+ "primaryKey": false,
608
+ "notNull": true,
609
+ "default": "now()"
610
+ },
611
+ "last_used_at": {
612
+ "name": "last_used_at",
613
+ "type": "timestamp with time zone",
614
+ "primaryKey": false,
615
+ "notNull": false
616
+ }
617
+ },
618
+ "indexes": {
619
+ "idx_agent_tokens_agent": {
620
+ "name": "idx_agent_tokens_agent",
621
+ "columns": [
622
+ {
623
+ "expression": "agent_id",
624
+ "isExpression": false,
625
+ "asc": true,
626
+ "nulls": "last"
627
+ }
628
+ ],
629
+ "isUnique": false,
630
+ "concurrently": false,
631
+ "method": "btree",
632
+ "with": {}
633
+ },
634
+ "idx_agent_tokens_hash": {
635
+ "name": "idx_agent_tokens_hash",
636
+ "columns": [
637
+ {
638
+ "expression": "token_hash",
639
+ "isExpression": false,
640
+ "asc": true,
641
+ "nulls": "last"
642
+ }
643
+ ],
644
+ "isUnique": false,
645
+ "concurrently": false,
646
+ "method": "btree",
647
+ "with": {}
648
+ }
649
+ },
650
+ "foreignKeys": {
651
+ "agent_tokens_agent_id_agents_uuid_fk": {
652
+ "name": "agent_tokens_agent_id_agents_uuid_fk",
653
+ "tableFrom": "agent_tokens",
654
+ "tableTo": "agents",
655
+ "columnsFrom": [
656
+ "agent_id"
657
+ ],
658
+ "columnsTo": [
659
+ "uuid"
660
+ ],
661
+ "onDelete": "cascade",
662
+ "onUpdate": "no action"
663
+ }
664
+ },
665
+ "compositePrimaryKeys": {},
666
+ "uniqueConstraints": {},
667
+ "policies": {},
668
+ "checkConstraints": {},
669
+ "isRLSEnabled": false
670
+ },
671
+ "public.agents": {
672
+ "name": "agents",
673
+ "schema": "",
674
+ "columns": {
675
+ "uuid": {
676
+ "name": "uuid",
677
+ "type": "text",
678
+ "primaryKey": true,
679
+ "notNull": true
680
+ },
681
+ "name": {
682
+ "name": "name",
683
+ "type": "text",
684
+ "primaryKey": false,
685
+ "notNull": false
686
+ },
687
+ "organization_id": {
688
+ "name": "organization_id",
689
+ "type": "text",
690
+ "primaryKey": false,
691
+ "notNull": true,
692
+ "default": "'default'"
693
+ },
694
+ "type": {
695
+ "name": "type",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": true
699
+ },
700
+ "display_name": {
701
+ "name": "display_name",
702
+ "type": "text",
703
+ "primaryKey": false,
704
+ "notNull": false
705
+ },
706
+ "delegate_mention": {
707
+ "name": "delegate_mention",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": false
711
+ },
712
+ "profile": {
713
+ "name": "profile",
714
+ "type": "text",
715
+ "primaryKey": false,
716
+ "notNull": false
717
+ },
718
+ "inbox_id": {
719
+ "name": "inbox_id",
720
+ "type": "text",
721
+ "primaryKey": false,
722
+ "notNull": true
723
+ },
724
+ "status": {
725
+ "name": "status",
726
+ "type": "text",
727
+ "primaryKey": false,
728
+ "notNull": true,
729
+ "default": "'active'"
730
+ },
731
+ "source": {
732
+ "name": "source",
733
+ "type": "text",
734
+ "primaryKey": false,
735
+ "notNull": false
736
+ },
737
+ "cloud_user_id": {
738
+ "name": "cloud_user_id",
739
+ "type": "text",
740
+ "primaryKey": false,
741
+ "notNull": false
742
+ },
743
+ "public": {
744
+ "name": "public",
745
+ "type": "boolean",
746
+ "primaryKey": false,
747
+ "notNull": true,
748
+ "default": false
749
+ },
750
+ "metadata": {
751
+ "name": "metadata",
752
+ "type": "jsonb",
753
+ "primaryKey": false,
754
+ "notNull": true,
755
+ "default": "'{}'::jsonb"
756
+ },
757
+ "created_at": {
758
+ "name": "created_at",
759
+ "type": "timestamp with time zone",
760
+ "primaryKey": false,
761
+ "notNull": true,
762
+ "default": "now()"
763
+ },
764
+ "updated_at": {
765
+ "name": "updated_at",
766
+ "type": "timestamp with time zone",
767
+ "primaryKey": false,
768
+ "notNull": true,
769
+ "default": "now()"
770
+ }
771
+ },
772
+ "indexes": {
773
+ "idx_agents_org": {
774
+ "name": "idx_agents_org",
775
+ "columns": [
776
+ {
777
+ "expression": "organization_id",
778
+ "isExpression": false,
779
+ "asc": true,
780
+ "nulls": "last"
781
+ }
782
+ ],
783
+ "isUnique": false,
784
+ "concurrently": false,
785
+ "method": "btree",
786
+ "with": {}
787
+ }
788
+ },
789
+ "foreignKeys": {
790
+ "agents_organization_id_organizations_id_fk": {
791
+ "name": "agents_organization_id_organizations_id_fk",
792
+ "tableFrom": "agents",
793
+ "tableTo": "organizations",
794
+ "columnsFrom": [
795
+ "organization_id"
796
+ ],
797
+ "columnsTo": [
798
+ "id"
799
+ ],
800
+ "onDelete": "no action",
801
+ "onUpdate": "no action"
802
+ }
803
+ },
804
+ "compositePrimaryKeys": {},
805
+ "uniqueConstraints": {
806
+ "agents_inbox_id_unique": {
807
+ "name": "agents_inbox_id_unique",
808
+ "nullsNotDistinct": false,
809
+ "columns": [
810
+ "inbox_id"
811
+ ]
812
+ },
813
+ "uq_agents_org_name": {
814
+ "name": "uq_agents_org_name",
815
+ "nullsNotDistinct": false,
816
+ "columns": [
817
+ "organization_id",
818
+ "name"
819
+ ]
820
+ }
821
+ },
822
+ "policies": {},
823
+ "checkConstraints": {},
824
+ "isRLSEnabled": false
825
+ },
826
+ "public.chat_participants": {
827
+ "name": "chat_participants",
828
+ "schema": "",
829
+ "columns": {
830
+ "chat_id": {
831
+ "name": "chat_id",
832
+ "type": "text",
833
+ "primaryKey": false,
834
+ "notNull": true
835
+ },
836
+ "agent_id": {
837
+ "name": "agent_id",
838
+ "type": "text",
839
+ "primaryKey": false,
840
+ "notNull": true
841
+ },
842
+ "role": {
843
+ "name": "role",
844
+ "type": "text",
845
+ "primaryKey": false,
846
+ "notNull": true,
847
+ "default": "'member'"
848
+ },
849
+ "mode": {
850
+ "name": "mode",
851
+ "type": "text",
852
+ "primaryKey": false,
853
+ "notNull": true,
854
+ "default": "'full'"
855
+ },
856
+ "joined_at": {
857
+ "name": "joined_at",
858
+ "type": "timestamp with time zone",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "default": "now()"
862
+ }
863
+ },
864
+ "indexes": {
865
+ "idx_participants_agent": {
866
+ "name": "idx_participants_agent",
867
+ "columns": [
868
+ {
869
+ "expression": "agent_id",
870
+ "isExpression": false,
871
+ "asc": true,
872
+ "nulls": "last"
873
+ }
874
+ ],
875
+ "isUnique": false,
876
+ "concurrently": false,
877
+ "method": "btree",
878
+ "with": {}
879
+ }
880
+ },
881
+ "foreignKeys": {
882
+ "chat_participants_chat_id_chats_id_fk": {
883
+ "name": "chat_participants_chat_id_chats_id_fk",
884
+ "tableFrom": "chat_participants",
885
+ "tableTo": "chats",
886
+ "columnsFrom": [
887
+ "chat_id"
888
+ ],
889
+ "columnsTo": [
890
+ "id"
891
+ ],
892
+ "onDelete": "cascade",
893
+ "onUpdate": "no action"
894
+ },
895
+ "chat_participants_agent_id_agents_uuid_fk": {
896
+ "name": "chat_participants_agent_id_agents_uuid_fk",
897
+ "tableFrom": "chat_participants",
898
+ "tableTo": "agents",
899
+ "columnsFrom": [
900
+ "agent_id"
901
+ ],
902
+ "columnsTo": [
903
+ "uuid"
904
+ ],
905
+ "onDelete": "no action",
906
+ "onUpdate": "no action"
907
+ }
908
+ },
909
+ "compositePrimaryKeys": {
910
+ "chat_participants_chat_id_agent_id_pk": {
911
+ "name": "chat_participants_chat_id_agent_id_pk",
912
+ "columns": [
913
+ "chat_id",
914
+ "agent_id"
915
+ ]
916
+ }
917
+ },
918
+ "uniqueConstraints": {},
919
+ "policies": {},
920
+ "checkConstraints": {},
921
+ "isRLSEnabled": false
922
+ },
923
+ "public.chats": {
924
+ "name": "chats",
925
+ "schema": "",
926
+ "columns": {
927
+ "id": {
928
+ "name": "id",
929
+ "type": "text",
930
+ "primaryKey": true,
931
+ "notNull": true
932
+ },
933
+ "organization_id": {
934
+ "name": "organization_id",
935
+ "type": "text",
936
+ "primaryKey": false,
937
+ "notNull": true,
938
+ "default": "'default'"
939
+ },
940
+ "type": {
941
+ "name": "type",
942
+ "type": "text",
943
+ "primaryKey": false,
944
+ "notNull": true,
945
+ "default": "'direct'"
946
+ },
947
+ "topic": {
948
+ "name": "topic",
949
+ "type": "text",
950
+ "primaryKey": false,
951
+ "notNull": false
952
+ },
953
+ "lifecycle_policy": {
954
+ "name": "lifecycle_policy",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": false,
958
+ "default": "'persistent'"
959
+ },
960
+ "parent_chat_id": {
961
+ "name": "parent_chat_id",
962
+ "type": "text",
963
+ "primaryKey": false,
964
+ "notNull": false
965
+ },
966
+ "metadata": {
967
+ "name": "metadata",
968
+ "type": "jsonb",
969
+ "primaryKey": false,
970
+ "notNull": true,
971
+ "default": "'{}'::jsonb"
972
+ },
973
+ "created_at": {
974
+ "name": "created_at",
975
+ "type": "timestamp with time zone",
976
+ "primaryKey": false,
977
+ "notNull": true,
978
+ "default": "now()"
979
+ },
980
+ "updated_at": {
981
+ "name": "updated_at",
982
+ "type": "timestamp with time zone",
983
+ "primaryKey": false,
984
+ "notNull": true,
985
+ "default": "now()"
986
+ }
987
+ },
988
+ "indexes": {},
989
+ "foreignKeys": {
990
+ "chats_organization_id_organizations_id_fk": {
991
+ "name": "chats_organization_id_organizations_id_fk",
992
+ "tableFrom": "chats",
993
+ "tableTo": "organizations",
994
+ "columnsFrom": [
995
+ "organization_id"
996
+ ],
997
+ "columnsTo": [
998
+ "id"
999
+ ],
1000
+ "onDelete": "no action",
1001
+ "onUpdate": "no action"
1002
+ }
1003
+ },
1004
+ "compositePrimaryKeys": {},
1005
+ "uniqueConstraints": {},
1006
+ "policies": {},
1007
+ "checkConstraints": {},
1008
+ "isRLSEnabled": false
1009
+ },
1010
+ "public.clients": {
1011
+ "name": "clients",
1012
+ "schema": "",
1013
+ "columns": {
1014
+ "id": {
1015
+ "name": "id",
1016
+ "type": "text",
1017
+ "primaryKey": true,
1018
+ "notNull": true
1019
+ },
1020
+ "status": {
1021
+ "name": "status",
1022
+ "type": "text",
1023
+ "primaryKey": false,
1024
+ "notNull": true,
1025
+ "default": "'disconnected'"
1026
+ },
1027
+ "sdk_version": {
1028
+ "name": "sdk_version",
1029
+ "type": "text",
1030
+ "primaryKey": false,
1031
+ "notNull": false
1032
+ },
1033
+ "hostname": {
1034
+ "name": "hostname",
1035
+ "type": "text",
1036
+ "primaryKey": false,
1037
+ "notNull": false
1038
+ },
1039
+ "os": {
1040
+ "name": "os",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": false
1044
+ },
1045
+ "instance_id": {
1046
+ "name": "instance_id",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": false
1050
+ },
1051
+ "connected_at": {
1052
+ "name": "connected_at",
1053
+ "type": "timestamp with time zone",
1054
+ "primaryKey": false,
1055
+ "notNull": false
1056
+ },
1057
+ "last_seen_at": {
1058
+ "name": "last_seen_at",
1059
+ "type": "timestamp with time zone",
1060
+ "primaryKey": false,
1061
+ "notNull": true,
1062
+ "default": "now()"
1063
+ },
1064
+ "metadata": {
1065
+ "name": "metadata",
1066
+ "type": "jsonb",
1067
+ "primaryKey": false,
1068
+ "notNull": false
1069
+ }
1070
+ },
1071
+ "indexes": {},
1072
+ "foreignKeys": {},
1073
+ "compositePrimaryKeys": {},
1074
+ "uniqueConstraints": {},
1075
+ "policies": {},
1076
+ "checkConstraints": {},
1077
+ "isRLSEnabled": false
1078
+ },
1079
+ "public.inbox_entries": {
1080
+ "name": "inbox_entries",
1081
+ "schema": "",
1082
+ "columns": {
1083
+ "id": {
1084
+ "name": "id",
1085
+ "type": "bigserial",
1086
+ "primaryKey": true,
1087
+ "notNull": true
1088
+ },
1089
+ "inbox_id": {
1090
+ "name": "inbox_id",
1091
+ "type": "text",
1092
+ "primaryKey": false,
1093
+ "notNull": true
1094
+ },
1095
+ "message_id": {
1096
+ "name": "message_id",
1097
+ "type": "text",
1098
+ "primaryKey": false,
1099
+ "notNull": true
1100
+ },
1101
+ "chat_id": {
1102
+ "name": "chat_id",
1103
+ "type": "text",
1104
+ "primaryKey": false,
1105
+ "notNull": false
1106
+ },
1107
+ "status": {
1108
+ "name": "status",
1109
+ "type": "text",
1110
+ "primaryKey": false,
1111
+ "notNull": true,
1112
+ "default": "'pending'"
1113
+ },
1114
+ "retry_count": {
1115
+ "name": "retry_count",
1116
+ "type": "integer",
1117
+ "primaryKey": false,
1118
+ "notNull": true,
1119
+ "default": 0
1120
+ },
1121
+ "created_at": {
1122
+ "name": "created_at",
1123
+ "type": "timestamp with time zone",
1124
+ "primaryKey": false,
1125
+ "notNull": true,
1126
+ "default": "now()"
1127
+ },
1128
+ "delivered_at": {
1129
+ "name": "delivered_at",
1130
+ "type": "timestamp with time zone",
1131
+ "primaryKey": false,
1132
+ "notNull": false
1133
+ },
1134
+ "acked_at": {
1135
+ "name": "acked_at",
1136
+ "type": "timestamp with time zone",
1137
+ "primaryKey": false,
1138
+ "notNull": false
1139
+ }
1140
+ },
1141
+ "indexes": {
1142
+ "idx_inbox_pending": {
1143
+ "name": "idx_inbox_pending",
1144
+ "columns": [
1145
+ {
1146
+ "expression": "inbox_id",
1147
+ "isExpression": false,
1148
+ "asc": true,
1149
+ "nulls": "last"
1150
+ },
1151
+ {
1152
+ "expression": "created_at",
1153
+ "isExpression": false,
1154
+ "asc": true,
1155
+ "nulls": "last"
1156
+ }
1157
+ ],
1158
+ "isUnique": false,
1159
+ "concurrently": false,
1160
+ "method": "btree",
1161
+ "with": {}
1162
+ }
1163
+ },
1164
+ "foreignKeys": {
1165
+ "inbox_entries_message_id_messages_id_fk": {
1166
+ "name": "inbox_entries_message_id_messages_id_fk",
1167
+ "tableFrom": "inbox_entries",
1168
+ "tableTo": "messages",
1169
+ "columnsFrom": [
1170
+ "message_id"
1171
+ ],
1172
+ "columnsTo": [
1173
+ "id"
1174
+ ],
1175
+ "onDelete": "no action",
1176
+ "onUpdate": "no action"
1177
+ }
1178
+ },
1179
+ "compositePrimaryKeys": {},
1180
+ "uniqueConstraints": {
1181
+ "uq_inbox_delivery": {
1182
+ "name": "uq_inbox_delivery",
1183
+ "nullsNotDistinct": false,
1184
+ "columns": [
1185
+ "inbox_id",
1186
+ "message_id",
1187
+ "chat_id"
1188
+ ]
1189
+ }
1190
+ },
1191
+ "policies": {},
1192
+ "checkConstraints": {},
1193
+ "isRLSEnabled": false
1194
+ },
1195
+ "public.messages": {
1196
+ "name": "messages",
1197
+ "schema": "",
1198
+ "columns": {
1199
+ "id": {
1200
+ "name": "id",
1201
+ "type": "text",
1202
+ "primaryKey": true,
1203
+ "notNull": true
1204
+ },
1205
+ "chat_id": {
1206
+ "name": "chat_id",
1207
+ "type": "text",
1208
+ "primaryKey": false,
1209
+ "notNull": true
1210
+ },
1211
+ "sender_id": {
1212
+ "name": "sender_id",
1213
+ "type": "text",
1214
+ "primaryKey": false,
1215
+ "notNull": true
1216
+ },
1217
+ "format": {
1218
+ "name": "format",
1219
+ "type": "text",
1220
+ "primaryKey": false,
1221
+ "notNull": true
1222
+ },
1223
+ "content": {
1224
+ "name": "content",
1225
+ "type": "jsonb",
1226
+ "primaryKey": false,
1227
+ "notNull": true
1228
+ },
1229
+ "metadata": {
1230
+ "name": "metadata",
1231
+ "type": "jsonb",
1232
+ "primaryKey": false,
1233
+ "notNull": true,
1234
+ "default": "'{}'::jsonb"
1235
+ },
1236
+ "reply_to_inbox": {
1237
+ "name": "reply_to_inbox",
1238
+ "type": "text",
1239
+ "primaryKey": false,
1240
+ "notNull": false
1241
+ },
1242
+ "reply_to_chat": {
1243
+ "name": "reply_to_chat",
1244
+ "type": "text",
1245
+ "primaryKey": false,
1246
+ "notNull": false
1247
+ },
1248
+ "in_reply_to": {
1249
+ "name": "in_reply_to",
1250
+ "type": "text",
1251
+ "primaryKey": false,
1252
+ "notNull": false
1253
+ },
1254
+ "created_at": {
1255
+ "name": "created_at",
1256
+ "type": "timestamp with time zone",
1257
+ "primaryKey": false,
1258
+ "notNull": true,
1259
+ "default": "now()"
1260
+ }
1261
+ },
1262
+ "indexes": {
1263
+ "idx_messages_chat_time": {
1264
+ "name": "idx_messages_chat_time",
1265
+ "columns": [
1266
+ {
1267
+ "expression": "chat_id",
1268
+ "isExpression": false,
1269
+ "asc": true,
1270
+ "nulls": "last"
1271
+ },
1272
+ {
1273
+ "expression": "created_at",
1274
+ "isExpression": false,
1275
+ "asc": true,
1276
+ "nulls": "last"
1277
+ }
1278
+ ],
1279
+ "isUnique": false,
1280
+ "concurrently": false,
1281
+ "method": "btree",
1282
+ "with": {}
1283
+ },
1284
+ "idx_messages_in_reply_to": {
1285
+ "name": "idx_messages_in_reply_to",
1286
+ "columns": [
1287
+ {
1288
+ "expression": "in_reply_to",
1289
+ "isExpression": false,
1290
+ "asc": true,
1291
+ "nulls": "last"
1292
+ }
1293
+ ],
1294
+ "isUnique": false,
1295
+ "concurrently": false,
1296
+ "method": "btree",
1297
+ "with": {}
1298
+ }
1299
+ },
1300
+ "foreignKeys": {
1301
+ "messages_chat_id_chats_id_fk": {
1302
+ "name": "messages_chat_id_chats_id_fk",
1303
+ "tableFrom": "messages",
1304
+ "tableTo": "chats",
1305
+ "columnsFrom": [
1306
+ "chat_id"
1307
+ ],
1308
+ "columnsTo": [
1309
+ "id"
1310
+ ],
1311
+ "onDelete": "no action",
1312
+ "onUpdate": "no action"
1313
+ }
1314
+ },
1315
+ "compositePrimaryKeys": {},
1316
+ "uniqueConstraints": {},
1317
+ "policies": {},
1318
+ "checkConstraints": {},
1319
+ "isRLSEnabled": false
1320
+ },
1321
+ "public.organizations": {
1322
+ "name": "organizations",
1323
+ "schema": "",
1324
+ "columns": {
1325
+ "id": {
1326
+ "name": "id",
1327
+ "type": "text",
1328
+ "primaryKey": true,
1329
+ "notNull": true
1330
+ },
1331
+ "display_name": {
1332
+ "name": "display_name",
1333
+ "type": "text",
1334
+ "primaryKey": false,
1335
+ "notNull": true
1336
+ },
1337
+ "max_agents": {
1338
+ "name": "max_agents",
1339
+ "type": "integer",
1340
+ "primaryKey": false,
1341
+ "notNull": true,
1342
+ "default": 0
1343
+ },
1344
+ "max_messages_per_minute": {
1345
+ "name": "max_messages_per_minute",
1346
+ "type": "integer",
1347
+ "primaryKey": false,
1348
+ "notNull": true,
1349
+ "default": 0
1350
+ },
1351
+ "features": {
1352
+ "name": "features",
1353
+ "type": "jsonb",
1354
+ "primaryKey": false,
1355
+ "notNull": true,
1356
+ "default": "'{}'::jsonb"
1357
+ },
1358
+ "created_at": {
1359
+ "name": "created_at",
1360
+ "type": "timestamp with time zone",
1361
+ "primaryKey": false,
1362
+ "notNull": true,
1363
+ "default": "now()"
1364
+ },
1365
+ "updated_at": {
1366
+ "name": "updated_at",
1367
+ "type": "timestamp with time zone",
1368
+ "primaryKey": false,
1369
+ "notNull": true,
1370
+ "default": "now()"
1371
+ }
1372
+ },
1373
+ "indexes": {},
1374
+ "foreignKeys": {},
1375
+ "compositePrimaryKeys": {},
1376
+ "uniqueConstraints": {},
1377
+ "policies": {},
1378
+ "checkConstraints": {},
1379
+ "isRLSEnabled": false
1380
+ },
1381
+ "public.server_instances": {
1382
+ "name": "server_instances",
1383
+ "schema": "",
1384
+ "columns": {
1385
+ "instance_id": {
1386
+ "name": "instance_id",
1387
+ "type": "text",
1388
+ "primaryKey": true,
1389
+ "notNull": true
1390
+ },
1391
+ "last_heartbeat": {
1392
+ "name": "last_heartbeat",
1393
+ "type": "timestamp with time zone",
1394
+ "primaryKey": false,
1395
+ "notNull": true,
1396
+ "default": "now()"
1397
+ }
1398
+ },
1399
+ "indexes": {},
1400
+ "foreignKeys": {},
1401
+ "compositePrimaryKeys": {},
1402
+ "uniqueConstraints": {},
1403
+ "policies": {},
1404
+ "checkConstraints": {},
1405
+ "isRLSEnabled": false
1406
+ },
1407
+ "public.system_configs": {
1408
+ "name": "system_configs",
1409
+ "schema": "",
1410
+ "columns": {
1411
+ "key": {
1412
+ "name": "key",
1413
+ "type": "text",
1414
+ "primaryKey": true,
1415
+ "notNull": true
1416
+ },
1417
+ "value": {
1418
+ "name": "value",
1419
+ "type": "jsonb",
1420
+ "primaryKey": false,
1421
+ "notNull": true
1422
+ },
1423
+ "updated_at": {
1424
+ "name": "updated_at",
1425
+ "type": "timestamp with time zone",
1426
+ "primaryKey": false,
1427
+ "notNull": true,
1428
+ "default": "now()"
1429
+ }
1430
+ },
1431
+ "indexes": {},
1432
+ "foreignKeys": {},
1433
+ "compositePrimaryKeys": {},
1434
+ "uniqueConstraints": {},
1435
+ "policies": {},
1436
+ "checkConstraints": {},
1437
+ "isRLSEnabled": false
1438
+ }
1439
+ },
1440
+ "enums": {},
1441
+ "schemas": {},
1442
+ "sequences": {},
1443
+ "roles": {},
1444
+ "policies": {},
1445
+ "views": {},
1446
+ "_meta": {
1447
+ "columns": {},
1448
+ "schemas": {},
1449
+ "tables": {}
1450
+ }
1451
+ }