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