@ykurilov/agent-chat-storage-postgres 0.56.0 → 0.57.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,1111 @@
1
+ {
2
+ "id": "1eee5ec2-c59b-4c8a-8ba3-6c7aa200c4e9",
3
+ "prevId": "3bfcf4f0-e4b0-4e35-bcae-c5fcc5599a88",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "agent_chat.branch_selections": {
8
+ "name": "branch_selections",
9
+ "schema": "agent_chat",
10
+ "columns": {
11
+ "seq": {
12
+ "name": "seq",
13
+ "type": "bigint",
14
+ "primaryKey": false,
15
+ "notNull": true,
16
+ "identity": {
17
+ "type": "always",
18
+ "name": "branch_selections_seq_seq",
19
+ "schema": "agent_chat",
20
+ "increment": "1",
21
+ "startWith": "1",
22
+ "minValue": "1",
23
+ "maxValue": "9223372036854775807",
24
+ "cache": "1",
25
+ "cycle": false
26
+ }
27
+ },
28
+ "id": {
29
+ "name": "id",
30
+ "type": "text",
31
+ "primaryKey": true,
32
+ "notNull": true
33
+ },
34
+ "chat_id": {
35
+ "name": "chat_id",
36
+ "type": "text",
37
+ "primaryKey": false,
38
+ "notNull": true
39
+ },
40
+ "message_id": {
41
+ "name": "message_id",
42
+ "type": "text",
43
+ "primaryKey": false,
44
+ "notNull": true
45
+ },
46
+ "selected_at": {
47
+ "name": "selected_at",
48
+ "type": "text",
49
+ "primaryKey": false,
50
+ "notNull": true
51
+ }
52
+ },
53
+ "indexes": {
54
+ "branch_selections_chat_seq_idx": {
55
+ "name": "branch_selections_chat_seq_idx",
56
+ "columns": [
57
+ {
58
+ "expression": "chat_id",
59
+ "isExpression": false,
60
+ "asc": true,
61
+ "nulls": "last"
62
+ },
63
+ {
64
+ "expression": "seq",
65
+ "isExpression": false,
66
+ "asc": true,
67
+ "nulls": "last"
68
+ }
69
+ ],
70
+ "isUnique": false,
71
+ "concurrently": false,
72
+ "method": "btree",
73
+ "with": {}
74
+ }
75
+ },
76
+ "foreignKeys": {
77
+ "branch_selections_chat_id_chats_id_fk": {
78
+ "name": "branch_selections_chat_id_chats_id_fk",
79
+ "tableFrom": "branch_selections",
80
+ "tableTo": "chats",
81
+ "schemaTo": "agent_chat",
82
+ "columnsFrom": [
83
+ "chat_id"
84
+ ],
85
+ "columnsTo": [
86
+ "id"
87
+ ],
88
+ "onDelete": "cascade",
89
+ "onUpdate": "no action"
90
+ }
91
+ },
92
+ "compositePrimaryKeys": {},
93
+ "uniqueConstraints": {},
94
+ "policies": {},
95
+ "checkConstraints": {},
96
+ "isRLSEnabled": false
97
+ },
98
+ "agent_chat.chat_turn_leases": {
99
+ "name": "chat_turn_leases",
100
+ "schema": "agent_chat",
101
+ "columns": {
102
+ "chat_id": {
103
+ "name": "chat_id",
104
+ "type": "text",
105
+ "primaryKey": true,
106
+ "notNull": true
107
+ },
108
+ "holder": {
109
+ "name": "holder",
110
+ "type": "text",
111
+ "primaryKey": false,
112
+ "notNull": true
113
+ },
114
+ "until": {
115
+ "name": "until",
116
+ "type": "timestamp with time zone",
117
+ "primaryKey": false,
118
+ "notNull": true
119
+ }
120
+ },
121
+ "indexes": {},
122
+ "foreignKeys": {},
123
+ "compositePrimaryKeys": {},
124
+ "uniqueConstraints": {},
125
+ "policies": {},
126
+ "checkConstraints": {},
127
+ "isRLSEnabled": false
128
+ },
129
+ "agent_chat.chats": {
130
+ "name": "chats",
131
+ "schema": "agent_chat",
132
+ "columns": {
133
+ "id": {
134
+ "name": "id",
135
+ "type": "text",
136
+ "primaryKey": true,
137
+ "notNull": true
138
+ },
139
+ "owner_id": {
140
+ "name": "owner_id",
141
+ "type": "text",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "model_id": {
146
+ "name": "model_id",
147
+ "type": "text",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "provider_id": {
152
+ "name": "provider_id",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true
156
+ },
157
+ "reasoning": {
158
+ "name": "reasoning",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": false
162
+ },
163
+ "title": {
164
+ "name": "title",
165
+ "type": "text",
166
+ "primaryKey": false,
167
+ "notNull": false
168
+ },
169
+ "origin": {
170
+ "name": "origin",
171
+ "type": "text",
172
+ "primaryKey": false,
173
+ "notNull": false
174
+ },
175
+ "subject_key": {
176
+ "name": "subject_key",
177
+ "type": "text",
178
+ "primaryKey": false,
179
+ "notNull": false
180
+ },
181
+ "subject_data": {
182
+ "name": "subject_data",
183
+ "type": "json",
184
+ "primaryKey": false,
185
+ "notNull": false
186
+ },
187
+ "closed": {
188
+ "name": "closed",
189
+ "type": "json",
190
+ "primaryKey": false,
191
+ "notNull": false
192
+ },
193
+ "created_at": {
194
+ "name": "created_at",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": true
198
+ },
199
+ "updated_at": {
200
+ "name": "updated_at",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ }
205
+ },
206
+ "indexes": {
207
+ "chats_owner_updated_idx": {
208
+ "name": "chats_owner_updated_idx",
209
+ "columns": [
210
+ {
211
+ "expression": "owner_id",
212
+ "isExpression": false,
213
+ "asc": true,
214
+ "nulls": "last"
215
+ },
216
+ {
217
+ "expression": "updated_at",
218
+ "isExpression": false,
219
+ "asc": true,
220
+ "nulls": "last"
221
+ }
222
+ ],
223
+ "isUnique": false,
224
+ "concurrently": false,
225
+ "method": "btree",
226
+ "with": {}
227
+ },
228
+ "chats_owner_subject_idx": {
229
+ "name": "chats_owner_subject_idx",
230
+ "columns": [
231
+ {
232
+ "expression": "owner_id",
233
+ "isExpression": false,
234
+ "asc": true,
235
+ "nulls": "last"
236
+ },
237
+ {
238
+ "expression": "subject_key",
239
+ "isExpression": false,
240
+ "asc": true,
241
+ "nulls": "last"
242
+ }
243
+ ],
244
+ "isUnique": true,
245
+ "concurrently": false,
246
+ "method": "btree",
247
+ "with": {}
248
+ }
249
+ },
250
+ "foreignKeys": {},
251
+ "compositePrimaryKeys": {},
252
+ "uniqueConstraints": {},
253
+ "policies": {},
254
+ "checkConstraints": {},
255
+ "isRLSEnabled": false
256
+ },
257
+ "agent_chat.compactions": {
258
+ "name": "compactions",
259
+ "schema": "agent_chat",
260
+ "columns": {
261
+ "seq": {
262
+ "name": "seq",
263
+ "type": "bigint",
264
+ "primaryKey": false,
265
+ "notNull": true,
266
+ "identity": {
267
+ "type": "always",
268
+ "name": "compactions_seq_seq",
269
+ "schema": "agent_chat",
270
+ "increment": "1",
271
+ "startWith": "1",
272
+ "minValue": "1",
273
+ "maxValue": "9223372036854775807",
274
+ "cache": "1",
275
+ "cycle": false
276
+ }
277
+ },
278
+ "id": {
279
+ "name": "id",
280
+ "type": "text",
281
+ "primaryKey": true,
282
+ "notNull": true
283
+ },
284
+ "chat_id": {
285
+ "name": "chat_id",
286
+ "type": "text",
287
+ "primaryKey": false,
288
+ "notNull": true
289
+ },
290
+ "from_message_id": {
291
+ "name": "from_message_id",
292
+ "type": "text",
293
+ "primaryKey": false,
294
+ "notNull": true
295
+ },
296
+ "through_message_id": {
297
+ "name": "through_message_id",
298
+ "type": "text",
299
+ "primaryKey": false,
300
+ "notNull": true
301
+ },
302
+ "summary": {
303
+ "name": "summary",
304
+ "type": "text",
305
+ "primaryKey": false,
306
+ "notNull": true
307
+ },
308
+ "summary_tokens": {
309
+ "name": "summary_tokens",
310
+ "type": "integer",
311
+ "primaryKey": false,
312
+ "notNull": true
313
+ },
314
+ "model_id": {
315
+ "name": "model_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "provider_id": {
321
+ "name": "provider_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "usage": {
327
+ "name": "usage",
328
+ "type": "json",
329
+ "primaryKey": false,
330
+ "notNull": false
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "text",
335
+ "primaryKey": false,
336
+ "notNull": true
337
+ }
338
+ },
339
+ "indexes": {
340
+ "compactions_chat_seq_idx": {
341
+ "name": "compactions_chat_seq_idx",
342
+ "columns": [
343
+ {
344
+ "expression": "chat_id",
345
+ "isExpression": false,
346
+ "asc": true,
347
+ "nulls": "last"
348
+ },
349
+ {
350
+ "expression": "seq",
351
+ "isExpression": false,
352
+ "asc": true,
353
+ "nulls": "last"
354
+ }
355
+ ],
356
+ "isUnique": false,
357
+ "concurrently": false,
358
+ "method": "btree",
359
+ "with": {}
360
+ }
361
+ },
362
+ "foreignKeys": {
363
+ "compactions_chat_id_chats_id_fk": {
364
+ "name": "compactions_chat_id_chats_id_fk",
365
+ "tableFrom": "compactions",
366
+ "tableTo": "chats",
367
+ "schemaTo": "agent_chat",
368
+ "columnsFrom": [
369
+ "chat_id"
370
+ ],
371
+ "columnsTo": [
372
+ "id"
373
+ ],
374
+ "onDelete": "cascade",
375
+ "onUpdate": "no action"
376
+ }
377
+ },
378
+ "compositePrimaryKeys": {},
379
+ "uniqueConstraints": {},
380
+ "policies": {},
381
+ "checkConstraints": {},
382
+ "isRLSEnabled": false
383
+ },
384
+ "agent_chat.memory_notes": {
385
+ "name": "memory_notes",
386
+ "schema": "agent_chat",
387
+ "columns": {
388
+ "id": {
389
+ "name": "id",
390
+ "type": "text",
391
+ "primaryKey": true,
392
+ "notNull": true
393
+ },
394
+ "owner_id": {
395
+ "name": "owner_id",
396
+ "type": "text",
397
+ "primaryKey": false,
398
+ "notNull": true
399
+ },
400
+ "categories": {
401
+ "name": "categories",
402
+ "type": "jsonb",
403
+ "primaryKey": false,
404
+ "notNull": true
405
+ },
406
+ "content": {
407
+ "name": "content",
408
+ "type": "text",
409
+ "primaryKey": false,
410
+ "notNull": true
411
+ },
412
+ "version": {
413
+ "name": "version",
414
+ "type": "integer",
415
+ "primaryKey": false,
416
+ "notNull": true,
417
+ "default": 1
418
+ },
419
+ "created_at": {
420
+ "name": "created_at",
421
+ "type": "timestamp with time zone",
422
+ "primaryKey": false,
423
+ "notNull": true
424
+ },
425
+ "updated_at": {
426
+ "name": "updated_at",
427
+ "type": "timestamp with time zone",
428
+ "primaryKey": false,
429
+ "notNull": true
430
+ },
431
+ "merged_into": {
432
+ "name": "merged_into",
433
+ "type": "text",
434
+ "primaryKey": false,
435
+ "notNull": false
436
+ }
437
+ },
438
+ "indexes": {
439
+ "memory_notes_owner_updated_idx": {
440
+ "name": "memory_notes_owner_updated_idx",
441
+ "columns": [
442
+ {
443
+ "expression": "owner_id",
444
+ "isExpression": false,
445
+ "asc": true,
446
+ "nulls": "last"
447
+ },
448
+ {
449
+ "expression": "updated_at",
450
+ "isExpression": false,
451
+ "asc": true,
452
+ "nulls": "last"
453
+ }
454
+ ],
455
+ "isUnique": false,
456
+ "concurrently": false,
457
+ "method": "btree",
458
+ "with": {}
459
+ },
460
+ "memory_notes_merged_into_idx": {
461
+ "name": "memory_notes_merged_into_idx",
462
+ "columns": [
463
+ {
464
+ "expression": "merged_into",
465
+ "isExpression": false,
466
+ "asc": true,
467
+ "nulls": "last"
468
+ }
469
+ ],
470
+ "isUnique": false,
471
+ "concurrently": false,
472
+ "method": "btree",
473
+ "with": {}
474
+ }
475
+ },
476
+ "foreignKeys": {},
477
+ "compositePrimaryKeys": {},
478
+ "uniqueConstraints": {},
479
+ "policies": {},
480
+ "checkConstraints": {},
481
+ "isRLSEnabled": false
482
+ },
483
+ "agent_chat.memory_optimization_runs": {
484
+ "name": "memory_optimization_runs",
485
+ "schema": "agent_chat",
486
+ "columns": {
487
+ "id": {
488
+ "name": "id",
489
+ "type": "text",
490
+ "primaryKey": true,
491
+ "notNull": true
492
+ },
493
+ "owner_id": {
494
+ "name": "owner_id",
495
+ "type": "text",
496
+ "primaryKey": false,
497
+ "notNull": true
498
+ },
499
+ "started_at": {
500
+ "name": "started_at",
501
+ "type": "timestamp with time zone",
502
+ "primaryKey": false,
503
+ "notNull": true
504
+ },
505
+ "finished_at": {
506
+ "name": "finished_at",
507
+ "type": "timestamp with time zone",
508
+ "primaryKey": false,
509
+ "notNull": false
510
+ },
511
+ "status": {
512
+ "name": "status",
513
+ "type": "text",
514
+ "primaryKey": false,
515
+ "notNull": true
516
+ },
517
+ "groups": {
518
+ "name": "groups",
519
+ "type": "jsonb",
520
+ "primaryKey": false,
521
+ "notNull": true,
522
+ "default": "'[]'::jsonb"
523
+ },
524
+ "error": {
525
+ "name": "error",
526
+ "type": "text",
527
+ "primaryKey": false,
528
+ "notNull": false
529
+ },
530
+ "usage_record_id": {
531
+ "name": "usage_record_id",
532
+ "type": "text",
533
+ "primaryKey": false,
534
+ "notNull": false
535
+ }
536
+ },
537
+ "indexes": {
538
+ "memory_optimization_runs_owner_started_idx": {
539
+ "name": "memory_optimization_runs_owner_started_idx",
540
+ "columns": [
541
+ {
542
+ "expression": "owner_id",
543
+ "isExpression": false,
544
+ "asc": true,
545
+ "nulls": "last"
546
+ },
547
+ {
548
+ "expression": "started_at",
549
+ "isExpression": false,
550
+ "asc": true,
551
+ "nulls": "last"
552
+ }
553
+ ],
554
+ "isUnique": false,
555
+ "concurrently": false,
556
+ "method": "btree",
557
+ "with": {}
558
+ },
559
+ "memory_optimization_runs_one_running_idx": {
560
+ "name": "memory_optimization_runs_one_running_idx",
561
+ "columns": [
562
+ {
563
+ "expression": "owner_id",
564
+ "isExpression": false,
565
+ "asc": true,
566
+ "nulls": "last"
567
+ }
568
+ ],
569
+ "isUnique": true,
570
+ "where": "\"agent_chat\".\"memory_optimization_runs\".\"status\" = 'running'",
571
+ "concurrently": false,
572
+ "method": "btree",
573
+ "with": {}
574
+ }
575
+ },
576
+ "foreignKeys": {},
577
+ "compositePrimaryKeys": {},
578
+ "uniqueConstraints": {},
579
+ "policies": {},
580
+ "checkConstraints": {},
581
+ "isRLSEnabled": false
582
+ },
583
+ "agent_chat.messages": {
584
+ "name": "messages",
585
+ "schema": "agent_chat",
586
+ "columns": {
587
+ "seq": {
588
+ "name": "seq",
589
+ "type": "bigint",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "identity": {
593
+ "type": "always",
594
+ "name": "messages_seq_seq",
595
+ "schema": "agent_chat",
596
+ "increment": "1",
597
+ "startWith": "1",
598
+ "minValue": "1",
599
+ "maxValue": "9223372036854775807",
600
+ "cache": "1",
601
+ "cycle": false
602
+ }
603
+ },
604
+ "id": {
605
+ "name": "id",
606
+ "type": "text",
607
+ "primaryKey": true,
608
+ "notNull": true
609
+ },
610
+ "chat_id": {
611
+ "name": "chat_id",
612
+ "type": "text",
613
+ "primaryKey": false,
614
+ "notNull": true
615
+ },
616
+ "parent_id": {
617
+ "name": "parent_id",
618
+ "type": "text",
619
+ "primaryKey": false,
620
+ "notNull": false
621
+ },
622
+ "role": {
623
+ "name": "role",
624
+ "type": "text",
625
+ "primaryKey": false,
626
+ "notNull": true
627
+ },
628
+ "parts": {
629
+ "name": "parts",
630
+ "type": "json",
631
+ "primaryKey": false,
632
+ "notNull": true
633
+ },
634
+ "format_version": {
635
+ "name": "format_version",
636
+ "type": "integer",
637
+ "primaryKey": false,
638
+ "notNull": true
639
+ },
640
+ "status": {
641
+ "name": "status",
642
+ "type": "text",
643
+ "primaryKey": false,
644
+ "notNull": true
645
+ },
646
+ "model_id": {
647
+ "name": "model_id",
648
+ "type": "text",
649
+ "primaryKey": false,
650
+ "notNull": false
651
+ },
652
+ "provider_id": {
653
+ "name": "provider_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": false
657
+ },
658
+ "usage": {
659
+ "name": "usage",
660
+ "type": "json",
661
+ "primaryKey": false,
662
+ "notNull": false
663
+ },
664
+ "reasoning_durations_ms": {
665
+ "name": "reasoning_durations_ms",
666
+ "type": "json",
667
+ "primaryKey": false,
668
+ "notNull": true
669
+ },
670
+ "error": {
671
+ "name": "error",
672
+ "type": "json",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "voice_cut": {
677
+ "name": "voice_cut",
678
+ "type": "json",
679
+ "primaryKey": false,
680
+ "notNull": false
681
+ },
682
+ "after_turn": {
683
+ "name": "after_turn",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": false
687
+ },
688
+ "created_at": {
689
+ "name": "created_at",
690
+ "type": "text",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "alive_at": {
695
+ "name": "alive_at",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": false
699
+ }
700
+ },
701
+ "indexes": {
702
+ "messages_chat_created_idx": {
703
+ "name": "messages_chat_created_idx",
704
+ "columns": [
705
+ {
706
+ "expression": "chat_id",
707
+ "isExpression": false,
708
+ "asc": true,
709
+ "nulls": "last"
710
+ },
711
+ {
712
+ "expression": "created_at",
713
+ "isExpression": false,
714
+ "asc": true,
715
+ "nulls": "last"
716
+ },
717
+ {
718
+ "expression": "seq",
719
+ "isExpression": false,
720
+ "asc": true,
721
+ "nulls": "last"
722
+ }
723
+ ],
724
+ "isUnique": false,
725
+ "concurrently": false,
726
+ "method": "btree",
727
+ "with": {}
728
+ },
729
+ "messages_streaming_idx": {
730
+ "name": "messages_streaming_idx",
731
+ "columns": [
732
+ {
733
+ "expression": "status",
734
+ "isExpression": false,
735
+ "asc": true,
736
+ "nulls": "last"
737
+ }
738
+ ],
739
+ "isUnique": false,
740
+ "where": "\"agent_chat\".\"messages\".\"status\" = 'streaming'",
741
+ "concurrently": false,
742
+ "method": "btree",
743
+ "with": {}
744
+ },
745
+ "messages_after_turn_pending_idx": {
746
+ "name": "messages_after_turn_pending_idx",
747
+ "columns": [
748
+ {
749
+ "expression": "after_turn",
750
+ "isExpression": false,
751
+ "asc": true,
752
+ "nulls": "last"
753
+ }
754
+ ],
755
+ "isUnique": false,
756
+ "where": "\"agent_chat\".\"messages\".\"after_turn\" = 'pending'",
757
+ "concurrently": false,
758
+ "method": "btree",
759
+ "with": {}
760
+ }
761
+ },
762
+ "foreignKeys": {
763
+ "messages_chat_id_chats_id_fk": {
764
+ "name": "messages_chat_id_chats_id_fk",
765
+ "tableFrom": "messages",
766
+ "tableTo": "chats",
767
+ "schemaTo": "agent_chat",
768
+ "columnsFrom": [
769
+ "chat_id"
770
+ ],
771
+ "columnsTo": [
772
+ "id"
773
+ ],
774
+ "onDelete": "cascade",
775
+ "onUpdate": "no action"
776
+ }
777
+ },
778
+ "compositePrimaryKeys": {},
779
+ "uniqueConstraints": {},
780
+ "policies": {},
781
+ "checkConstraints": {},
782
+ "isRLSEnabled": false
783
+ },
784
+ "agent_chat.pending_bursts": {
785
+ "name": "pending_bursts",
786
+ "schema": "agent_chat",
787
+ "columns": {
788
+ "chat_id": {
789
+ "name": "chat_id",
790
+ "type": "text",
791
+ "primaryKey": true,
792
+ "notNull": true
793
+ },
794
+ "owner_id": {
795
+ "name": "owner_id",
796
+ "type": "text",
797
+ "primaryKey": false,
798
+ "notNull": true
799
+ },
800
+ "message_id": {
801
+ "name": "message_id",
802
+ "type": "text",
803
+ "primaryKey": false,
804
+ "notNull": true
805
+ },
806
+ "due_at": {
807
+ "name": "due_at",
808
+ "type": "timestamp with time zone",
809
+ "primaryKey": false,
810
+ "notNull": true
811
+ },
812
+ "holder": {
813
+ "name": "holder",
814
+ "type": "text",
815
+ "primaryKey": false,
816
+ "notNull": true
817
+ },
818
+ "held_until": {
819
+ "name": "held_until",
820
+ "type": "timestamp with time zone",
821
+ "primaryKey": false,
822
+ "notNull": true
823
+ },
824
+ "page": {
825
+ "name": "page",
826
+ "type": "jsonb",
827
+ "primaryKey": false,
828
+ "notNull": false
829
+ }
830
+ },
831
+ "indexes": {},
832
+ "foreignKeys": {},
833
+ "compositePrimaryKeys": {},
834
+ "uniqueConstraints": {},
835
+ "policies": {},
836
+ "checkConstraints": {},
837
+ "isRLSEnabled": false
838
+ },
839
+ "agent_chat.spending_limit_states": {
840
+ "name": "spending_limit_states",
841
+ "schema": "agent_chat",
842
+ "columns": {
843
+ "key": {
844
+ "name": "key",
845
+ "type": "text",
846
+ "primaryKey": true,
847
+ "notNull": true
848
+ },
849
+ "value": {
850
+ "name": "value",
851
+ "type": "text",
852
+ "primaryKey": false,
853
+ "notNull": true
854
+ },
855
+ "version": {
856
+ "name": "version",
857
+ "type": "integer",
858
+ "primaryKey": false,
859
+ "notNull": true
860
+ },
861
+ "updated_at": {
862
+ "name": "updated_at",
863
+ "type": "text",
864
+ "primaryKey": false,
865
+ "notNull": true
866
+ }
867
+ },
868
+ "indexes": {},
869
+ "foreignKeys": {},
870
+ "compositePrimaryKeys": {},
871
+ "uniqueConstraints": {},
872
+ "policies": {},
873
+ "checkConstraints": {},
874
+ "isRLSEnabled": false
875
+ },
876
+ "agent_chat.usage_records": {
877
+ "name": "usage_records",
878
+ "schema": "agent_chat",
879
+ "columns": {
880
+ "id": {
881
+ "name": "id",
882
+ "type": "text",
883
+ "primaryKey": true,
884
+ "notNull": true
885
+ },
886
+ "owner_id": {
887
+ "name": "owner_id",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": true
891
+ },
892
+ "chat_id": {
893
+ "name": "chat_id",
894
+ "type": "text",
895
+ "primaryKey": false,
896
+ "notNull": true
897
+ },
898
+ "message_id": {
899
+ "name": "message_id",
900
+ "type": "text",
901
+ "primaryKey": false,
902
+ "notNull": false
903
+ },
904
+ "source": {
905
+ "name": "source",
906
+ "type": "text",
907
+ "primaryKey": false,
908
+ "notNull": true
909
+ },
910
+ "model_id": {
911
+ "name": "model_id",
912
+ "type": "text",
913
+ "primaryKey": false,
914
+ "notNull": true
915
+ },
916
+ "provider_id": {
917
+ "name": "provider_id",
918
+ "type": "text",
919
+ "primaryKey": false,
920
+ "notNull": true
921
+ },
922
+ "input_tokens": {
923
+ "name": "input_tokens",
924
+ "type": "bigint",
925
+ "primaryKey": false,
926
+ "notNull": true
927
+ },
928
+ "cached_input_tokens": {
929
+ "name": "cached_input_tokens",
930
+ "type": "bigint",
931
+ "primaryKey": false,
932
+ "notNull": true
933
+ },
934
+ "cache_write_tokens": {
935
+ "name": "cache_write_tokens",
936
+ "type": "bigint",
937
+ "primaryKey": false,
938
+ "notNull": true
939
+ },
940
+ "output_tokens": {
941
+ "name": "output_tokens",
942
+ "type": "bigint",
943
+ "primaryKey": false,
944
+ "notNull": true
945
+ },
946
+ "reasoning_tokens": {
947
+ "name": "reasoning_tokens",
948
+ "type": "bigint",
949
+ "primaryKey": false,
950
+ "notNull": true
951
+ },
952
+ "cost_usd": {
953
+ "name": "cost_usd",
954
+ "type": "double precision",
955
+ "primaryKey": false,
956
+ "notNull": true
957
+ },
958
+ "created_at": {
959
+ "name": "created_at",
960
+ "type": "text",
961
+ "primaryKey": false,
962
+ "notNull": true
963
+ },
964
+ "estimated": {
965
+ "name": "estimated",
966
+ "type": "boolean",
967
+ "primaryKey": false,
968
+ "notNull": true,
969
+ "default": false
970
+ }
971
+ },
972
+ "indexes": {
973
+ "usage_records_owner_created_idx": {
974
+ "name": "usage_records_owner_created_idx",
975
+ "columns": [
976
+ {
977
+ "expression": "owner_id",
978
+ "isExpression": false,
979
+ "asc": true,
980
+ "nulls": "last"
981
+ },
982
+ {
983
+ "expression": "created_at",
984
+ "isExpression": false,
985
+ "asc": true,
986
+ "nulls": "last"
987
+ }
988
+ ],
989
+ "isUnique": false,
990
+ "concurrently": false,
991
+ "method": "btree",
992
+ "with": {}
993
+ },
994
+ "usage_records_chat_created_idx": {
995
+ "name": "usage_records_chat_created_idx",
996
+ "columns": [
997
+ {
998
+ "expression": "chat_id",
999
+ "isExpression": false,
1000
+ "asc": true,
1001
+ "nulls": "last"
1002
+ },
1003
+ {
1004
+ "expression": "created_at",
1005
+ "isExpression": false,
1006
+ "asc": true,
1007
+ "nulls": "last"
1008
+ }
1009
+ ],
1010
+ "isUnique": false,
1011
+ "concurrently": false,
1012
+ "method": "btree",
1013
+ "with": {}
1014
+ }
1015
+ },
1016
+ "foreignKeys": {},
1017
+ "compositePrimaryKeys": {},
1018
+ "uniqueConstraints": {},
1019
+ "policies": {},
1020
+ "checkConstraints": {},
1021
+ "isRLSEnabled": false
1022
+ },
1023
+ "agent_chat.user_model_choices": {
1024
+ "name": "user_model_choices",
1025
+ "schema": "agent_chat",
1026
+ "columns": {
1027
+ "owner_id": {
1028
+ "name": "owner_id",
1029
+ "type": "text",
1030
+ "primaryKey": true,
1031
+ "notNull": true
1032
+ },
1033
+ "model_id": {
1034
+ "name": "model_id",
1035
+ "type": "text",
1036
+ "primaryKey": false,
1037
+ "notNull": true
1038
+ },
1039
+ "provider_id": {
1040
+ "name": "provider_id",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": true
1044
+ },
1045
+ "reasoning": {
1046
+ "name": "reasoning",
1047
+ "type": "text",
1048
+ "primaryKey": false,
1049
+ "notNull": false
1050
+ },
1051
+ "updated_at": {
1052
+ "name": "updated_at",
1053
+ "type": "text",
1054
+ "primaryKey": false,
1055
+ "notNull": true
1056
+ }
1057
+ },
1058
+ "indexes": {},
1059
+ "foreignKeys": {},
1060
+ "compositePrimaryKeys": {},
1061
+ "uniqueConstraints": {},
1062
+ "policies": {},
1063
+ "checkConstraints": {},
1064
+ "isRLSEnabled": false
1065
+ },
1066
+ "agent_chat.voice_choices": {
1067
+ "name": "voice_choices",
1068
+ "schema": "agent_chat",
1069
+ "columns": {
1070
+ "owner_id": {
1071
+ "name": "owner_id",
1072
+ "type": "text",
1073
+ "primaryKey": true,
1074
+ "notNull": true
1075
+ },
1076
+ "voice_id": {
1077
+ "name": "voice_id",
1078
+ "type": "text",
1079
+ "primaryKey": false,
1080
+ "notNull": true
1081
+ },
1082
+ "updated_at": {
1083
+ "name": "updated_at",
1084
+ "type": "text",
1085
+ "primaryKey": false,
1086
+ "notNull": true
1087
+ }
1088
+ },
1089
+ "indexes": {},
1090
+ "foreignKeys": {},
1091
+ "compositePrimaryKeys": {},
1092
+ "uniqueConstraints": {},
1093
+ "policies": {},
1094
+ "checkConstraints": {},
1095
+ "isRLSEnabled": false
1096
+ }
1097
+ },
1098
+ "enums": {},
1099
+ "schemas": {
1100
+ "agent_chat": "agent_chat"
1101
+ },
1102
+ "sequences": {},
1103
+ "roles": {},
1104
+ "policies": {},
1105
+ "views": {},
1106
+ "_meta": {
1107
+ "columns": {},
1108
+ "schemas": {},
1109
+ "tables": {}
1110
+ }
1111
+ }