@agent-team-foundation/first-tree-hub 0.6.0 → 0.6.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.
@@ -0,0 +1,1938 @@
1
+ {
2
+ "id": "f55bc045-94f1-4d84-8b7e-04b4cde18af7",
3
+ "prevId": "8d7f2a41-6c5b-4e8f-9a12-3b4d5e6f7a8c",
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
+ },
693
+ "type": {
694
+ "name": "type",
695
+ "type": "text",
696
+ "primaryKey": false,
697
+ "notNull": true
698
+ },
699
+ "display_name": {
700
+ "name": "display_name",
701
+ "type": "text",
702
+ "primaryKey": false,
703
+ "notNull": false
704
+ },
705
+ "delegate_mention": {
706
+ "name": "delegate_mention",
707
+ "type": "text",
708
+ "primaryKey": false,
709
+ "notNull": false
710
+ },
711
+ "profile": {
712
+ "name": "profile",
713
+ "type": "text",
714
+ "primaryKey": false,
715
+ "notNull": false
716
+ },
717
+ "inbox_id": {
718
+ "name": "inbox_id",
719
+ "type": "text",
720
+ "primaryKey": false,
721
+ "notNull": true
722
+ },
723
+ "status": {
724
+ "name": "status",
725
+ "type": "text",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "default": "'active'"
729
+ },
730
+ "source": {
731
+ "name": "source",
732
+ "type": "text",
733
+ "primaryKey": false,
734
+ "notNull": false
735
+ },
736
+ "cloud_user_id": {
737
+ "name": "cloud_user_id",
738
+ "type": "text",
739
+ "primaryKey": false,
740
+ "notNull": false
741
+ },
742
+ "visibility": {
743
+ "name": "visibility",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true,
747
+ "default": "'private'"
748
+ },
749
+ "metadata": {
750
+ "name": "metadata",
751
+ "type": "jsonb",
752
+ "primaryKey": false,
753
+ "notNull": true,
754
+ "default": "'{}'::jsonb"
755
+ },
756
+ "created_at": {
757
+ "name": "created_at",
758
+ "type": "timestamp with time zone",
759
+ "primaryKey": false,
760
+ "notNull": true,
761
+ "default": "now()"
762
+ },
763
+ "updated_at": {
764
+ "name": "updated_at",
765
+ "type": "timestamp with time zone",
766
+ "primaryKey": false,
767
+ "notNull": true,
768
+ "default": "now()"
769
+ }
770
+ },
771
+ "indexes": {
772
+ "idx_agents_org": {
773
+ "name": "idx_agents_org",
774
+ "columns": [
775
+ {
776
+ "expression": "organization_id",
777
+ "isExpression": false,
778
+ "asc": true,
779
+ "nulls": "last"
780
+ }
781
+ ],
782
+ "isUnique": false,
783
+ "concurrently": false,
784
+ "method": "btree",
785
+ "with": {}
786
+ },
787
+ "idx_agents_visibility_org": {
788
+ "name": "idx_agents_visibility_org",
789
+ "columns": [
790
+ {
791
+ "expression": "organization_id",
792
+ "isExpression": false,
793
+ "asc": true,
794
+ "nulls": "last"
795
+ },
796
+ {
797
+ "expression": "visibility",
798
+ "isExpression": false,
799
+ "asc": true,
800
+ "nulls": "last"
801
+ }
802
+ ],
803
+ "isUnique": false,
804
+ "concurrently": false,
805
+ "method": "btree",
806
+ "with": {}
807
+ }
808
+ },
809
+ "foreignKeys": {
810
+ "agents_organization_id_organizations_id_fk": {
811
+ "name": "agents_organization_id_organizations_id_fk",
812
+ "tableFrom": "agents",
813
+ "tableTo": "organizations",
814
+ "columnsFrom": [
815
+ "organization_id"
816
+ ],
817
+ "columnsTo": [
818
+ "id"
819
+ ],
820
+ "onDelete": "no action",
821
+ "onUpdate": "no action"
822
+ }
823
+ },
824
+ "compositePrimaryKeys": {},
825
+ "uniqueConstraints": {
826
+ "agents_inbox_id_unique": {
827
+ "name": "agents_inbox_id_unique",
828
+ "nullsNotDistinct": false,
829
+ "columns": [
830
+ "inbox_id"
831
+ ]
832
+ },
833
+ "uq_agents_org_name": {
834
+ "name": "uq_agents_org_name",
835
+ "nullsNotDistinct": false,
836
+ "columns": [
837
+ "organization_id",
838
+ "name"
839
+ ]
840
+ }
841
+ },
842
+ "policies": {},
843
+ "checkConstraints": {},
844
+ "isRLSEnabled": false
845
+ },
846
+ "public.chat_participants": {
847
+ "name": "chat_participants",
848
+ "schema": "",
849
+ "columns": {
850
+ "chat_id": {
851
+ "name": "chat_id",
852
+ "type": "text",
853
+ "primaryKey": false,
854
+ "notNull": true
855
+ },
856
+ "agent_id": {
857
+ "name": "agent_id",
858
+ "type": "text",
859
+ "primaryKey": false,
860
+ "notNull": true
861
+ },
862
+ "role": {
863
+ "name": "role",
864
+ "type": "text",
865
+ "primaryKey": false,
866
+ "notNull": true,
867
+ "default": "'member'"
868
+ },
869
+ "mode": {
870
+ "name": "mode",
871
+ "type": "text",
872
+ "primaryKey": false,
873
+ "notNull": true,
874
+ "default": "'full'"
875
+ },
876
+ "joined_at": {
877
+ "name": "joined_at",
878
+ "type": "timestamp with time zone",
879
+ "primaryKey": false,
880
+ "notNull": true,
881
+ "default": "now()"
882
+ }
883
+ },
884
+ "indexes": {
885
+ "idx_participants_agent": {
886
+ "name": "idx_participants_agent",
887
+ "columns": [
888
+ {
889
+ "expression": "agent_id",
890
+ "isExpression": false,
891
+ "asc": true,
892
+ "nulls": "last"
893
+ }
894
+ ],
895
+ "isUnique": false,
896
+ "concurrently": false,
897
+ "method": "btree",
898
+ "with": {}
899
+ }
900
+ },
901
+ "foreignKeys": {
902
+ "chat_participants_chat_id_chats_id_fk": {
903
+ "name": "chat_participants_chat_id_chats_id_fk",
904
+ "tableFrom": "chat_participants",
905
+ "tableTo": "chats",
906
+ "columnsFrom": [
907
+ "chat_id"
908
+ ],
909
+ "columnsTo": [
910
+ "id"
911
+ ],
912
+ "onDelete": "cascade",
913
+ "onUpdate": "no action"
914
+ },
915
+ "chat_participants_agent_id_agents_uuid_fk": {
916
+ "name": "chat_participants_agent_id_agents_uuid_fk",
917
+ "tableFrom": "chat_participants",
918
+ "tableTo": "agents",
919
+ "columnsFrom": [
920
+ "agent_id"
921
+ ],
922
+ "columnsTo": [
923
+ "uuid"
924
+ ],
925
+ "onDelete": "no action",
926
+ "onUpdate": "no action"
927
+ }
928
+ },
929
+ "compositePrimaryKeys": {
930
+ "chat_participants_chat_id_agent_id_pk": {
931
+ "name": "chat_participants_chat_id_agent_id_pk",
932
+ "columns": [
933
+ "chat_id",
934
+ "agent_id"
935
+ ]
936
+ }
937
+ },
938
+ "uniqueConstraints": {},
939
+ "policies": {},
940
+ "checkConstraints": {},
941
+ "isRLSEnabled": false
942
+ },
943
+ "public.chats": {
944
+ "name": "chats",
945
+ "schema": "",
946
+ "columns": {
947
+ "id": {
948
+ "name": "id",
949
+ "type": "text",
950
+ "primaryKey": true,
951
+ "notNull": true
952
+ },
953
+ "organization_id": {
954
+ "name": "organization_id",
955
+ "type": "text",
956
+ "primaryKey": false,
957
+ "notNull": true
958
+ },
959
+ "type": {
960
+ "name": "type",
961
+ "type": "text",
962
+ "primaryKey": false,
963
+ "notNull": true,
964
+ "default": "'direct'"
965
+ },
966
+ "topic": {
967
+ "name": "topic",
968
+ "type": "text",
969
+ "primaryKey": false,
970
+ "notNull": false
971
+ },
972
+ "lifecycle_policy": {
973
+ "name": "lifecycle_policy",
974
+ "type": "text",
975
+ "primaryKey": false,
976
+ "notNull": false,
977
+ "default": "'persistent'"
978
+ },
979
+ "parent_chat_id": {
980
+ "name": "parent_chat_id",
981
+ "type": "text",
982
+ "primaryKey": false,
983
+ "notNull": false
984
+ },
985
+ "metadata": {
986
+ "name": "metadata",
987
+ "type": "jsonb",
988
+ "primaryKey": false,
989
+ "notNull": true,
990
+ "default": "'{}'::jsonb"
991
+ },
992
+ "created_at": {
993
+ "name": "created_at",
994
+ "type": "timestamp with time zone",
995
+ "primaryKey": false,
996
+ "notNull": true,
997
+ "default": "now()"
998
+ },
999
+ "updated_at": {
1000
+ "name": "updated_at",
1001
+ "type": "timestamp with time zone",
1002
+ "primaryKey": false,
1003
+ "notNull": true,
1004
+ "default": "now()"
1005
+ }
1006
+ },
1007
+ "indexes": {},
1008
+ "foreignKeys": {
1009
+ "chats_organization_id_organizations_id_fk": {
1010
+ "name": "chats_organization_id_organizations_id_fk",
1011
+ "tableFrom": "chats",
1012
+ "tableTo": "organizations",
1013
+ "columnsFrom": [
1014
+ "organization_id"
1015
+ ],
1016
+ "columnsTo": [
1017
+ "id"
1018
+ ],
1019
+ "onDelete": "no action",
1020
+ "onUpdate": "no action"
1021
+ }
1022
+ },
1023
+ "compositePrimaryKeys": {},
1024
+ "uniqueConstraints": {},
1025
+ "policies": {},
1026
+ "checkConstraints": {},
1027
+ "isRLSEnabled": false
1028
+ },
1029
+ "public.clients": {
1030
+ "name": "clients",
1031
+ "schema": "",
1032
+ "columns": {
1033
+ "id": {
1034
+ "name": "id",
1035
+ "type": "text",
1036
+ "primaryKey": true,
1037
+ "notNull": true
1038
+ },
1039
+ "status": {
1040
+ "name": "status",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": true,
1044
+ "default": "'disconnected'"
1045
+ },
1046
+ "sdk_version": {
1047
+ "name": "sdk_version",
1048
+ "type": "text",
1049
+ "primaryKey": false,
1050
+ "notNull": false
1051
+ },
1052
+ "hostname": {
1053
+ "name": "hostname",
1054
+ "type": "text",
1055
+ "primaryKey": false,
1056
+ "notNull": false
1057
+ },
1058
+ "os": {
1059
+ "name": "os",
1060
+ "type": "text",
1061
+ "primaryKey": false,
1062
+ "notNull": false
1063
+ },
1064
+ "instance_id": {
1065
+ "name": "instance_id",
1066
+ "type": "text",
1067
+ "primaryKey": false,
1068
+ "notNull": false
1069
+ },
1070
+ "connected_at": {
1071
+ "name": "connected_at",
1072
+ "type": "timestamp with time zone",
1073
+ "primaryKey": false,
1074
+ "notNull": false
1075
+ },
1076
+ "last_seen_at": {
1077
+ "name": "last_seen_at",
1078
+ "type": "timestamp with time zone",
1079
+ "primaryKey": false,
1080
+ "notNull": true,
1081
+ "default": "now()"
1082
+ },
1083
+ "metadata": {
1084
+ "name": "metadata",
1085
+ "type": "jsonb",
1086
+ "primaryKey": false,
1087
+ "notNull": false
1088
+ }
1089
+ },
1090
+ "indexes": {},
1091
+ "foreignKeys": {},
1092
+ "compositePrimaryKeys": {},
1093
+ "uniqueConstraints": {},
1094
+ "policies": {},
1095
+ "checkConstraints": {},
1096
+ "isRLSEnabled": false
1097
+ },
1098
+ "public.inbox_entries": {
1099
+ "name": "inbox_entries",
1100
+ "schema": "",
1101
+ "columns": {
1102
+ "id": {
1103
+ "name": "id",
1104
+ "type": "bigserial",
1105
+ "primaryKey": true,
1106
+ "notNull": true
1107
+ },
1108
+ "inbox_id": {
1109
+ "name": "inbox_id",
1110
+ "type": "text",
1111
+ "primaryKey": false,
1112
+ "notNull": true
1113
+ },
1114
+ "message_id": {
1115
+ "name": "message_id",
1116
+ "type": "text",
1117
+ "primaryKey": false,
1118
+ "notNull": true
1119
+ },
1120
+ "chat_id": {
1121
+ "name": "chat_id",
1122
+ "type": "text",
1123
+ "primaryKey": false,
1124
+ "notNull": false
1125
+ },
1126
+ "status": {
1127
+ "name": "status",
1128
+ "type": "text",
1129
+ "primaryKey": false,
1130
+ "notNull": true,
1131
+ "default": "'pending'"
1132
+ },
1133
+ "retry_count": {
1134
+ "name": "retry_count",
1135
+ "type": "integer",
1136
+ "primaryKey": false,
1137
+ "notNull": true,
1138
+ "default": 0
1139
+ },
1140
+ "created_at": {
1141
+ "name": "created_at",
1142
+ "type": "timestamp with time zone",
1143
+ "primaryKey": false,
1144
+ "notNull": true,
1145
+ "default": "now()"
1146
+ },
1147
+ "delivered_at": {
1148
+ "name": "delivered_at",
1149
+ "type": "timestamp with time zone",
1150
+ "primaryKey": false,
1151
+ "notNull": false
1152
+ },
1153
+ "acked_at": {
1154
+ "name": "acked_at",
1155
+ "type": "timestamp with time zone",
1156
+ "primaryKey": false,
1157
+ "notNull": false
1158
+ }
1159
+ },
1160
+ "indexes": {
1161
+ "idx_inbox_pending": {
1162
+ "name": "idx_inbox_pending",
1163
+ "columns": [
1164
+ {
1165
+ "expression": "inbox_id",
1166
+ "isExpression": false,
1167
+ "asc": true,
1168
+ "nulls": "last"
1169
+ },
1170
+ {
1171
+ "expression": "created_at",
1172
+ "isExpression": false,
1173
+ "asc": true,
1174
+ "nulls": "last"
1175
+ }
1176
+ ],
1177
+ "isUnique": false,
1178
+ "concurrently": false,
1179
+ "method": "btree",
1180
+ "with": {}
1181
+ }
1182
+ },
1183
+ "foreignKeys": {
1184
+ "inbox_entries_message_id_messages_id_fk": {
1185
+ "name": "inbox_entries_message_id_messages_id_fk",
1186
+ "tableFrom": "inbox_entries",
1187
+ "tableTo": "messages",
1188
+ "columnsFrom": [
1189
+ "message_id"
1190
+ ],
1191
+ "columnsTo": [
1192
+ "id"
1193
+ ],
1194
+ "onDelete": "no action",
1195
+ "onUpdate": "no action"
1196
+ }
1197
+ },
1198
+ "compositePrimaryKeys": {},
1199
+ "uniqueConstraints": {
1200
+ "uq_inbox_delivery": {
1201
+ "name": "uq_inbox_delivery",
1202
+ "nullsNotDistinct": false,
1203
+ "columns": [
1204
+ "inbox_id",
1205
+ "message_id",
1206
+ "chat_id"
1207
+ ]
1208
+ }
1209
+ },
1210
+ "policies": {},
1211
+ "checkConstraints": {},
1212
+ "isRLSEnabled": false
1213
+ },
1214
+ "public.messages": {
1215
+ "name": "messages",
1216
+ "schema": "",
1217
+ "columns": {
1218
+ "id": {
1219
+ "name": "id",
1220
+ "type": "text",
1221
+ "primaryKey": true,
1222
+ "notNull": true
1223
+ },
1224
+ "chat_id": {
1225
+ "name": "chat_id",
1226
+ "type": "text",
1227
+ "primaryKey": false,
1228
+ "notNull": true
1229
+ },
1230
+ "sender_id": {
1231
+ "name": "sender_id",
1232
+ "type": "text",
1233
+ "primaryKey": false,
1234
+ "notNull": true
1235
+ },
1236
+ "format": {
1237
+ "name": "format",
1238
+ "type": "text",
1239
+ "primaryKey": false,
1240
+ "notNull": true
1241
+ },
1242
+ "content": {
1243
+ "name": "content",
1244
+ "type": "jsonb",
1245
+ "primaryKey": false,
1246
+ "notNull": true
1247
+ },
1248
+ "metadata": {
1249
+ "name": "metadata",
1250
+ "type": "jsonb",
1251
+ "primaryKey": false,
1252
+ "notNull": true,
1253
+ "default": "'{}'::jsonb"
1254
+ },
1255
+ "reply_to_inbox": {
1256
+ "name": "reply_to_inbox",
1257
+ "type": "text",
1258
+ "primaryKey": false,
1259
+ "notNull": false
1260
+ },
1261
+ "reply_to_chat": {
1262
+ "name": "reply_to_chat",
1263
+ "type": "text",
1264
+ "primaryKey": false,
1265
+ "notNull": false
1266
+ },
1267
+ "in_reply_to": {
1268
+ "name": "in_reply_to",
1269
+ "type": "text",
1270
+ "primaryKey": false,
1271
+ "notNull": false
1272
+ },
1273
+ "source": {
1274
+ "name": "source",
1275
+ "type": "text",
1276
+ "primaryKey": false,
1277
+ "notNull": false
1278
+ },
1279
+ "created_at": {
1280
+ "name": "created_at",
1281
+ "type": "timestamp with time zone",
1282
+ "primaryKey": false,
1283
+ "notNull": true,
1284
+ "default": "now()"
1285
+ }
1286
+ },
1287
+ "indexes": {
1288
+ "idx_messages_chat_time": {
1289
+ "name": "idx_messages_chat_time",
1290
+ "columns": [
1291
+ {
1292
+ "expression": "chat_id",
1293
+ "isExpression": false,
1294
+ "asc": true,
1295
+ "nulls": "last"
1296
+ },
1297
+ {
1298
+ "expression": "created_at",
1299
+ "isExpression": false,
1300
+ "asc": true,
1301
+ "nulls": "last"
1302
+ }
1303
+ ],
1304
+ "isUnique": false,
1305
+ "concurrently": false,
1306
+ "method": "btree",
1307
+ "with": {}
1308
+ },
1309
+ "idx_messages_in_reply_to": {
1310
+ "name": "idx_messages_in_reply_to",
1311
+ "columns": [
1312
+ {
1313
+ "expression": "in_reply_to",
1314
+ "isExpression": false,
1315
+ "asc": true,
1316
+ "nulls": "last"
1317
+ }
1318
+ ],
1319
+ "isUnique": false,
1320
+ "concurrently": false,
1321
+ "method": "btree",
1322
+ "with": {}
1323
+ }
1324
+ },
1325
+ "foreignKeys": {
1326
+ "messages_chat_id_chats_id_fk": {
1327
+ "name": "messages_chat_id_chats_id_fk",
1328
+ "tableFrom": "messages",
1329
+ "tableTo": "chats",
1330
+ "columnsFrom": [
1331
+ "chat_id"
1332
+ ],
1333
+ "columnsTo": [
1334
+ "id"
1335
+ ],
1336
+ "onDelete": "no action",
1337
+ "onUpdate": "no action"
1338
+ }
1339
+ },
1340
+ "compositePrimaryKeys": {},
1341
+ "uniqueConstraints": {},
1342
+ "policies": {},
1343
+ "checkConstraints": {},
1344
+ "isRLSEnabled": false
1345
+ },
1346
+ "public.notifications": {
1347
+ "name": "notifications",
1348
+ "schema": "",
1349
+ "columns": {
1350
+ "id": {
1351
+ "name": "id",
1352
+ "type": "text",
1353
+ "primaryKey": true,
1354
+ "notNull": true
1355
+ },
1356
+ "organization_id": {
1357
+ "name": "organization_id",
1358
+ "type": "text",
1359
+ "primaryKey": false,
1360
+ "notNull": true
1361
+ },
1362
+ "type": {
1363
+ "name": "type",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": true
1367
+ },
1368
+ "severity": {
1369
+ "name": "severity",
1370
+ "type": "text",
1371
+ "primaryKey": false,
1372
+ "notNull": true
1373
+ },
1374
+ "agent_id": {
1375
+ "name": "agent_id",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": false
1379
+ },
1380
+ "chat_id": {
1381
+ "name": "chat_id",
1382
+ "type": "text",
1383
+ "primaryKey": false,
1384
+ "notNull": false
1385
+ },
1386
+ "message": {
1387
+ "name": "message",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": true
1391
+ },
1392
+ "read": {
1393
+ "name": "read",
1394
+ "type": "boolean",
1395
+ "primaryKey": false,
1396
+ "notNull": true,
1397
+ "default": false
1398
+ },
1399
+ "created_at": {
1400
+ "name": "created_at",
1401
+ "type": "timestamp with time zone",
1402
+ "primaryKey": false,
1403
+ "notNull": true,
1404
+ "default": "now()"
1405
+ }
1406
+ },
1407
+ "indexes": {
1408
+ "idx_notifications_org_created": {
1409
+ "name": "idx_notifications_org_created",
1410
+ "columns": [
1411
+ {
1412
+ "expression": "organization_id",
1413
+ "isExpression": false,
1414
+ "asc": true,
1415
+ "nulls": "last"
1416
+ },
1417
+ {
1418
+ "expression": "created_at",
1419
+ "isExpression": false,
1420
+ "asc": true,
1421
+ "nulls": "last"
1422
+ }
1423
+ ],
1424
+ "isUnique": false,
1425
+ "concurrently": false,
1426
+ "method": "btree",
1427
+ "with": {}
1428
+ },
1429
+ "idx_notifications_agent": {
1430
+ "name": "idx_notifications_agent",
1431
+ "columns": [
1432
+ {
1433
+ "expression": "agent_id",
1434
+ "isExpression": false,
1435
+ "asc": true,
1436
+ "nulls": "last"
1437
+ }
1438
+ ],
1439
+ "isUnique": false,
1440
+ "concurrently": false,
1441
+ "method": "btree",
1442
+ "with": {}
1443
+ },
1444
+ "idx_notifications_org_read": {
1445
+ "name": "idx_notifications_org_read",
1446
+ "columns": [
1447
+ {
1448
+ "expression": "organization_id",
1449
+ "isExpression": false,
1450
+ "asc": true,
1451
+ "nulls": "last"
1452
+ },
1453
+ {
1454
+ "expression": "read",
1455
+ "isExpression": false,
1456
+ "asc": true,
1457
+ "nulls": "last"
1458
+ }
1459
+ ],
1460
+ "isUnique": false,
1461
+ "concurrently": false,
1462
+ "method": "btree",
1463
+ "with": {}
1464
+ }
1465
+ },
1466
+ "foreignKeys": {},
1467
+ "compositePrimaryKeys": {},
1468
+ "uniqueConstraints": {},
1469
+ "policies": {},
1470
+ "checkConstraints": {},
1471
+ "isRLSEnabled": false
1472
+ },
1473
+ "public.organizations": {
1474
+ "name": "organizations",
1475
+ "schema": "",
1476
+ "columns": {
1477
+ "id": {
1478
+ "name": "id",
1479
+ "type": "text",
1480
+ "primaryKey": true,
1481
+ "notNull": true
1482
+ },
1483
+ "name": {
1484
+ "name": "name",
1485
+ "type": "text",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ },
1489
+ "display_name": {
1490
+ "name": "display_name",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": true
1494
+ },
1495
+ "max_agents": {
1496
+ "name": "max_agents",
1497
+ "type": "integer",
1498
+ "primaryKey": false,
1499
+ "notNull": true,
1500
+ "default": 0
1501
+ },
1502
+ "max_messages_per_minute": {
1503
+ "name": "max_messages_per_minute",
1504
+ "type": "integer",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "default": 0
1508
+ },
1509
+ "features": {
1510
+ "name": "features",
1511
+ "type": "jsonb",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "default": "'{}'::jsonb"
1515
+ },
1516
+ "created_at": {
1517
+ "name": "created_at",
1518
+ "type": "timestamp with time zone",
1519
+ "primaryKey": false,
1520
+ "notNull": true,
1521
+ "default": "now()"
1522
+ },
1523
+ "updated_at": {
1524
+ "name": "updated_at",
1525
+ "type": "timestamp with time zone",
1526
+ "primaryKey": false,
1527
+ "notNull": true,
1528
+ "default": "now()"
1529
+ }
1530
+ },
1531
+ "indexes": {},
1532
+ "foreignKeys": {},
1533
+ "compositePrimaryKeys": {},
1534
+ "uniqueConstraints": {
1535
+ "organizations_name_unique": {
1536
+ "name": "organizations_name_unique",
1537
+ "nullsNotDistinct": false,
1538
+ "columns": [
1539
+ "name"
1540
+ ]
1541
+ }
1542
+ },
1543
+ "policies": {},
1544
+ "checkConstraints": {},
1545
+ "isRLSEnabled": false
1546
+ },
1547
+ "public.server_instances": {
1548
+ "name": "server_instances",
1549
+ "schema": "",
1550
+ "columns": {
1551
+ "instance_id": {
1552
+ "name": "instance_id",
1553
+ "type": "text",
1554
+ "primaryKey": true,
1555
+ "notNull": true
1556
+ },
1557
+ "last_heartbeat": {
1558
+ "name": "last_heartbeat",
1559
+ "type": "timestamp with time zone",
1560
+ "primaryKey": false,
1561
+ "notNull": true,
1562
+ "default": "now()"
1563
+ }
1564
+ },
1565
+ "indexes": {},
1566
+ "foreignKeys": {},
1567
+ "compositePrimaryKeys": {},
1568
+ "uniqueConstraints": {},
1569
+ "policies": {},
1570
+ "checkConstraints": {},
1571
+ "isRLSEnabled": false
1572
+ },
1573
+ "public.session_outputs": {
1574
+ "name": "session_outputs",
1575
+ "schema": "",
1576
+ "columns": {
1577
+ "id": {
1578
+ "name": "id",
1579
+ "type": "text",
1580
+ "primaryKey": true,
1581
+ "notNull": true
1582
+ },
1583
+ "agent_id": {
1584
+ "name": "agent_id",
1585
+ "type": "text",
1586
+ "primaryKey": false,
1587
+ "notNull": true
1588
+ },
1589
+ "chat_id": {
1590
+ "name": "chat_id",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": true
1594
+ },
1595
+ "content": {
1596
+ "name": "content",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": true,
1600
+ "default": "''"
1601
+ },
1602
+ "updated_at": {
1603
+ "name": "updated_at",
1604
+ "type": "timestamp with time zone",
1605
+ "primaryKey": false,
1606
+ "notNull": true,
1607
+ "default": "now()"
1608
+ }
1609
+ },
1610
+ "indexes": {
1611
+ "idx_session_outputs_agent_chat": {
1612
+ "name": "idx_session_outputs_agent_chat",
1613
+ "columns": [
1614
+ {
1615
+ "expression": "agent_id",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ },
1620
+ {
1621
+ "expression": "chat_id",
1622
+ "isExpression": false,
1623
+ "asc": true,
1624
+ "nulls": "last"
1625
+ }
1626
+ ],
1627
+ "isUnique": false,
1628
+ "concurrently": false,
1629
+ "method": "btree",
1630
+ "with": {}
1631
+ }
1632
+ },
1633
+ "foreignKeys": {},
1634
+ "compositePrimaryKeys": {},
1635
+ "uniqueConstraints": {},
1636
+ "policies": {},
1637
+ "checkConstraints": {},
1638
+ "isRLSEnabled": false
1639
+ },
1640
+ "public.system_configs": {
1641
+ "name": "system_configs",
1642
+ "schema": "",
1643
+ "columns": {
1644
+ "key": {
1645
+ "name": "key",
1646
+ "type": "text",
1647
+ "primaryKey": true,
1648
+ "notNull": true
1649
+ },
1650
+ "value": {
1651
+ "name": "value",
1652
+ "type": "jsonb",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "updated_at": {
1657
+ "name": "updated_at",
1658
+ "type": "timestamp with time zone",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "default": "now()"
1662
+ }
1663
+ },
1664
+ "indexes": {},
1665
+ "foreignKeys": {},
1666
+ "compositePrimaryKeys": {},
1667
+ "uniqueConstraints": {},
1668
+ "policies": {},
1669
+ "checkConstraints": {},
1670
+ "isRLSEnabled": false
1671
+ },
1672
+ "public.task_chats": {
1673
+ "name": "task_chats",
1674
+ "schema": "",
1675
+ "columns": {
1676
+ "task_id": {
1677
+ "name": "task_id",
1678
+ "type": "text",
1679
+ "primaryKey": false,
1680
+ "notNull": true
1681
+ },
1682
+ "chat_id": {
1683
+ "name": "chat_id",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": true
1687
+ },
1688
+ "linked_by_agent_id": {
1689
+ "name": "linked_by_agent_id",
1690
+ "type": "text",
1691
+ "primaryKey": false,
1692
+ "notNull": false
1693
+ },
1694
+ "linked_at": {
1695
+ "name": "linked_at",
1696
+ "type": "timestamp with time zone",
1697
+ "primaryKey": false,
1698
+ "notNull": true,
1699
+ "default": "now()"
1700
+ }
1701
+ },
1702
+ "indexes": {
1703
+ "idx_task_chats_chat": {
1704
+ "name": "idx_task_chats_chat",
1705
+ "columns": [
1706
+ {
1707
+ "expression": "chat_id",
1708
+ "isExpression": false,
1709
+ "asc": true,
1710
+ "nulls": "last"
1711
+ }
1712
+ ],
1713
+ "isUnique": false,
1714
+ "concurrently": false,
1715
+ "method": "btree",
1716
+ "with": {}
1717
+ }
1718
+ },
1719
+ "foreignKeys": {},
1720
+ "compositePrimaryKeys": {
1721
+ "task_chats_task_id_chat_id_pk": {
1722
+ "name": "task_chats_task_id_chat_id_pk",
1723
+ "columns": [
1724
+ "task_id",
1725
+ "chat_id"
1726
+ ]
1727
+ }
1728
+ },
1729
+ "uniqueConstraints": {},
1730
+ "policies": {},
1731
+ "checkConstraints": {},
1732
+ "isRLSEnabled": false
1733
+ },
1734
+ "public.tasks": {
1735
+ "name": "tasks",
1736
+ "schema": "",
1737
+ "columns": {
1738
+ "id": {
1739
+ "name": "id",
1740
+ "type": "text",
1741
+ "primaryKey": true,
1742
+ "notNull": true
1743
+ },
1744
+ "organization_id": {
1745
+ "name": "organization_id",
1746
+ "type": "text",
1747
+ "primaryKey": false,
1748
+ "notNull": true
1749
+ },
1750
+ "title": {
1751
+ "name": "title",
1752
+ "type": "text",
1753
+ "primaryKey": false,
1754
+ "notNull": true
1755
+ },
1756
+ "body": {
1757
+ "name": "body",
1758
+ "type": "text",
1759
+ "primaryKey": false,
1760
+ "notNull": true,
1761
+ "default": "''"
1762
+ },
1763
+ "status": {
1764
+ "name": "status",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "assignee_agent_id": {
1770
+ "name": "assignee_agent_id",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": false
1774
+ },
1775
+ "created_by_type": {
1776
+ "name": "created_by_type",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": true
1780
+ },
1781
+ "created_by_id": {
1782
+ "name": "created_by_id",
1783
+ "type": "text",
1784
+ "primaryKey": false,
1785
+ "notNull": true
1786
+ },
1787
+ "origin_ref": {
1788
+ "name": "origin_ref",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": false
1792
+ },
1793
+ "result": {
1794
+ "name": "result",
1795
+ "type": "text",
1796
+ "primaryKey": false,
1797
+ "notNull": false
1798
+ },
1799
+ "metadata": {
1800
+ "name": "metadata",
1801
+ "type": "jsonb",
1802
+ "primaryKey": false,
1803
+ "notNull": true,
1804
+ "default": "'{}'::jsonb"
1805
+ },
1806
+ "created_at": {
1807
+ "name": "created_at",
1808
+ "type": "timestamp with time zone",
1809
+ "primaryKey": false,
1810
+ "notNull": true,
1811
+ "default": "now()"
1812
+ },
1813
+ "updated_at": {
1814
+ "name": "updated_at",
1815
+ "type": "timestamp with time zone",
1816
+ "primaryKey": false,
1817
+ "notNull": true,
1818
+ "default": "now()"
1819
+ },
1820
+ "cancelled_at": {
1821
+ "name": "cancelled_at",
1822
+ "type": "timestamp with time zone",
1823
+ "primaryKey": false,
1824
+ "notNull": false
1825
+ },
1826
+ "cancelled_by_type": {
1827
+ "name": "cancelled_by_type",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": false
1831
+ },
1832
+ "cancelled_by_id": {
1833
+ "name": "cancelled_by_id",
1834
+ "type": "text",
1835
+ "primaryKey": false,
1836
+ "notNull": false
1837
+ }
1838
+ },
1839
+ "indexes": {
1840
+ "idx_tasks_org_status": {
1841
+ "name": "idx_tasks_org_status",
1842
+ "columns": [
1843
+ {
1844
+ "expression": "organization_id",
1845
+ "isExpression": false,
1846
+ "asc": true,
1847
+ "nulls": "last"
1848
+ },
1849
+ {
1850
+ "expression": "status",
1851
+ "isExpression": false,
1852
+ "asc": true,
1853
+ "nulls": "last"
1854
+ }
1855
+ ],
1856
+ "isUnique": false,
1857
+ "concurrently": false,
1858
+ "method": "btree",
1859
+ "with": {}
1860
+ },
1861
+ "idx_tasks_assignee_status": {
1862
+ "name": "idx_tasks_assignee_status",
1863
+ "columns": [
1864
+ {
1865
+ "expression": "assignee_agent_id",
1866
+ "isExpression": false,
1867
+ "asc": true,
1868
+ "nulls": "last"
1869
+ },
1870
+ {
1871
+ "expression": "status",
1872
+ "isExpression": false,
1873
+ "asc": true,
1874
+ "nulls": "last"
1875
+ }
1876
+ ],
1877
+ "isUnique": false,
1878
+ "concurrently": false,
1879
+ "method": "btree",
1880
+ "with": {}
1881
+ },
1882
+ "idx_tasks_origin_ref": {
1883
+ "name": "idx_tasks_origin_ref",
1884
+ "columns": [
1885
+ {
1886
+ "expression": "origin_ref",
1887
+ "isExpression": false,
1888
+ "asc": true,
1889
+ "nulls": "last"
1890
+ }
1891
+ ],
1892
+ "isUnique": false,
1893
+ "concurrently": false,
1894
+ "method": "btree",
1895
+ "with": {}
1896
+ },
1897
+ "idx_tasks_org_created_at": {
1898
+ "name": "idx_tasks_org_created_at",
1899
+ "columns": [
1900
+ {
1901
+ "expression": "organization_id",
1902
+ "isExpression": false,
1903
+ "asc": true,
1904
+ "nulls": "last"
1905
+ },
1906
+ {
1907
+ "expression": "created_at",
1908
+ "isExpression": false,
1909
+ "asc": true,
1910
+ "nulls": "last"
1911
+ }
1912
+ ],
1913
+ "isUnique": false,
1914
+ "concurrently": false,
1915
+ "method": "btree",
1916
+ "with": {}
1917
+ }
1918
+ },
1919
+ "foreignKeys": {},
1920
+ "compositePrimaryKeys": {},
1921
+ "uniqueConstraints": {},
1922
+ "policies": {},
1923
+ "checkConstraints": {},
1924
+ "isRLSEnabled": false
1925
+ }
1926
+ },
1927
+ "enums": {},
1928
+ "schemas": {},
1929
+ "sequences": {},
1930
+ "roles": {},
1931
+ "policies": {},
1932
+ "views": {},
1933
+ "_meta": {
1934
+ "columns": {},
1935
+ "schemas": {},
1936
+ "tables": {}
1937
+ }
1938
+ }