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