@crewx/sdk 0.9.0-rc.156 → 0.9.0-rc.157

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,3684 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "47d71565-1a9a-4acc-afe8-364307347188",
5
+ "prevId": "597030d7-02d5-44fa-9a65-b76349fa9a72",
6
+ "tables": {
7
+ "workspaces": {
8
+ "name": "workspaces",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "slug": {
18
+ "name": "slug",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "workspace_path": {
32
+ "name": "workspace_path",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "description": {
39
+ "name": "description",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "is_active": {
46
+ "name": "is_active",
47
+ "type": "integer",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false,
51
+ "default": 1
52
+ },
53
+ "created_at": {
54
+ "name": "created_at",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": true,
58
+ "autoincrement": false
59
+ },
60
+ "updated_at": {
61
+ "name": "updated_at",
62
+ "type": "text",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "autoincrement": false
66
+ },
67
+ "starred": {
68
+ "name": "starred",
69
+ "type": "integer",
70
+ "primaryKey": false,
71
+ "notNull": true,
72
+ "autoincrement": false,
73
+ "default": 0
74
+ }
75
+ },
76
+ "indexes": {
77
+ "workspaces_slug_unique": {
78
+ "name": "workspaces_slug_unique",
79
+ "columns": [
80
+ "slug"
81
+ ],
82
+ "isUnique": true
83
+ }
84
+ },
85
+ "foreignKeys": {},
86
+ "compositePrimaryKeys": {},
87
+ "uniqueConstraints": {},
88
+ "checkConstraints": {}
89
+ },
90
+ "tasks": {
91
+ "name": "tasks",
92
+ "columns": {
93
+ "id": {
94
+ "name": "id",
95
+ "type": "text",
96
+ "primaryKey": true,
97
+ "notNull": true,
98
+ "autoincrement": false
99
+ },
100
+ "agent_id": {
101
+ "name": "agent_id",
102
+ "type": "text",
103
+ "primaryKey": false,
104
+ "notNull": true,
105
+ "autoincrement": false
106
+ },
107
+ "user_id": {
108
+ "name": "user_id",
109
+ "type": "text",
110
+ "primaryKey": false,
111
+ "notNull": false,
112
+ "autoincrement": false
113
+ },
114
+ "actor_kind": {
115
+ "name": "actor_kind",
116
+ "type": "text",
117
+ "primaryKey": false,
118
+ "notNull": false,
119
+ "autoincrement": false
120
+ },
121
+ "actor_id": {
122
+ "name": "actor_id",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": false,
126
+ "autoincrement": false
127
+ },
128
+ "prompt": {
129
+ "name": "prompt",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "mode": {
136
+ "name": "mode",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false,
141
+ "default": "'execute'"
142
+ },
143
+ "status": {
144
+ "name": "status",
145
+ "type": "text",
146
+ "primaryKey": false,
147
+ "notNull": true,
148
+ "autoincrement": false,
149
+ "default": "'running'"
150
+ },
151
+ "result": {
152
+ "name": "result",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": false,
156
+ "autoincrement": false
157
+ },
158
+ "error": {
159
+ "name": "error",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": false,
163
+ "autoincrement": false
164
+ },
165
+ "started_at": {
166
+ "name": "started_at",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": true,
170
+ "autoincrement": false
171
+ },
172
+ "completed_at": {
173
+ "name": "completed_at",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": false,
177
+ "autoincrement": false
178
+ },
179
+ "duration_ms": {
180
+ "name": "duration_ms",
181
+ "type": "integer",
182
+ "primaryKey": false,
183
+ "notNull": false,
184
+ "autoincrement": false
185
+ },
186
+ "metadata": {
187
+ "name": "metadata",
188
+ "type": "text",
189
+ "primaryKey": false,
190
+ "notNull": false,
191
+ "autoincrement": false
192
+ },
193
+ "workspace_id": {
194
+ "name": "workspace_id",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": false,
198
+ "autoincrement": false
199
+ },
200
+ "trace_id": {
201
+ "name": "trace_id",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": false,
205
+ "autoincrement": false
206
+ },
207
+ "parent_task_id": {
208
+ "name": "parent_task_id",
209
+ "type": "text",
210
+ "primaryKey": false,
211
+ "notNull": false,
212
+ "autoincrement": false
213
+ },
214
+ "caller_agent_id": {
215
+ "name": "caller_agent_id",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": false,
219
+ "autoincrement": false
220
+ },
221
+ "model": {
222
+ "name": "model",
223
+ "type": "text",
224
+ "primaryKey": false,
225
+ "notNull": false,
226
+ "autoincrement": false
227
+ },
228
+ "platform": {
229
+ "name": "platform",
230
+ "type": "text",
231
+ "primaryKey": false,
232
+ "notNull": false,
233
+ "autoincrement": false,
234
+ "default": "'cli'"
235
+ },
236
+ "crewx_version": {
237
+ "name": "crewx_version",
238
+ "type": "text",
239
+ "primaryKey": false,
240
+ "notNull": false,
241
+ "autoincrement": false
242
+ },
243
+ "input_tokens": {
244
+ "name": "input_tokens",
245
+ "type": "integer",
246
+ "primaryKey": false,
247
+ "notNull": false,
248
+ "autoincrement": false,
249
+ "default": 0
250
+ },
251
+ "output_tokens": {
252
+ "name": "output_tokens",
253
+ "type": "integer",
254
+ "primaryKey": false,
255
+ "notNull": false,
256
+ "autoincrement": false,
257
+ "default": 0
258
+ },
259
+ "cost_usd": {
260
+ "name": "cost_usd",
261
+ "type": "real",
262
+ "primaryKey": false,
263
+ "notNull": false,
264
+ "autoincrement": false,
265
+ "default": 0
266
+ },
267
+ "pid": {
268
+ "name": "pid",
269
+ "type": "integer",
270
+ "primaryKey": false,
271
+ "notNull": false,
272
+ "autoincrement": false
273
+ },
274
+ "heartbeat_at": {
275
+ "name": "heartbeat_at",
276
+ "type": "text",
277
+ "primaryKey": false,
278
+ "notNull": false,
279
+ "autoincrement": false
280
+ },
281
+ "stop_requested_at": {
282
+ "name": "stop_requested_at",
283
+ "type": "text",
284
+ "primaryKey": false,
285
+ "notNull": false,
286
+ "autoincrement": false
287
+ },
288
+ "stop_requested_epoch": {
289
+ "name": "stop_requested_epoch",
290
+ "type": "integer",
291
+ "primaryKey": false,
292
+ "notNull": false,
293
+ "autoincrement": false
294
+ },
295
+ "rendered_prompt": {
296
+ "name": "rendered_prompt",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": false,
300
+ "autoincrement": false
301
+ },
302
+ "command": {
303
+ "name": "command",
304
+ "type": "text",
305
+ "primaryKey": false,
306
+ "notNull": false,
307
+ "autoincrement": false
308
+ },
309
+ "coding_agent_command": {
310
+ "name": "coding_agent_command",
311
+ "type": "text",
312
+ "primaryKey": false,
313
+ "notNull": false,
314
+ "autoincrement": false
315
+ },
316
+ "exit_code": {
317
+ "name": "exit_code",
318
+ "type": "integer",
319
+ "primaryKey": false,
320
+ "notNull": false,
321
+ "autoincrement": false
322
+ },
323
+ "logs": {
324
+ "name": "logs",
325
+ "type": "text",
326
+ "primaryKey": false,
327
+ "notNull": false,
328
+ "autoincrement": false
329
+ },
330
+ "log_storage": {
331
+ "name": "log_storage",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false,
336
+ "default": "'blob'"
337
+ },
338
+ "last_log_seq": {
339
+ "name": "last_log_seq",
340
+ "type": "integer",
341
+ "primaryKey": false,
342
+ "notNull": true,
343
+ "autoincrement": false,
344
+ "default": 0
345
+ },
346
+ "log_revision": {
347
+ "name": "log_revision",
348
+ "type": "integer",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "autoincrement": false,
352
+ "default": 0
353
+ },
354
+ "thread_id": {
355
+ "name": "thread_id",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false,
359
+ "autoincrement": false
360
+ },
361
+ "workspace_ref": {
362
+ "name": "workspace_ref",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": false,
366
+ "autoincrement": false
367
+ },
368
+ "cwd": {
369
+ "name": "cwd",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": false,
373
+ "autoincrement": false
374
+ },
375
+ "project_id": {
376
+ "name": "project_id",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": false,
380
+ "autoincrement": false
381
+ },
382
+ "project_ref": {
383
+ "name": "project_ref",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": false,
387
+ "autoincrement": false
388
+ },
389
+ "cached_input_tokens": {
390
+ "name": "cached_input_tokens",
391
+ "type": "integer",
392
+ "primaryKey": false,
393
+ "notNull": false,
394
+ "autoincrement": false,
395
+ "default": 0
396
+ },
397
+ "run_epoch": {
398
+ "name": "run_epoch",
399
+ "type": "integer",
400
+ "primaryKey": false,
401
+ "notNull": false,
402
+ "autoincrement": false,
403
+ "default": 0
404
+ },
405
+ "rating": {
406
+ "name": "rating",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": false,
410
+ "autoincrement": false
411
+ },
412
+ "rated_at": {
413
+ "name": "rated_at",
414
+ "type": "text",
415
+ "primaryKey": false,
416
+ "notNull": false,
417
+ "autoincrement": false
418
+ }
419
+ },
420
+ "indexes": {
421
+ "idx_tasks_agent_id": {
422
+ "name": "idx_tasks_agent_id",
423
+ "columns": [
424
+ "agent_id"
425
+ ],
426
+ "isUnique": false
427
+ },
428
+ "idx_tasks_status": {
429
+ "name": "idx_tasks_status",
430
+ "columns": [
431
+ "status"
432
+ ],
433
+ "isUnique": false
434
+ },
435
+ "idx_tasks_started_at": {
436
+ "name": "idx_tasks_started_at",
437
+ "columns": [
438
+ "started_at"
439
+ ],
440
+ "isUnique": false
441
+ },
442
+ "idx_tasks_trace_id": {
443
+ "name": "idx_tasks_trace_id",
444
+ "columns": [
445
+ "trace_id"
446
+ ],
447
+ "isUnique": false
448
+ },
449
+ "idx_tasks_parent_task_id": {
450
+ "name": "idx_tasks_parent_task_id",
451
+ "columns": [
452
+ "parent_task_id"
453
+ ],
454
+ "isUnique": false
455
+ },
456
+ "idx_tasks_crewx_version": {
457
+ "name": "idx_tasks_crewx_version",
458
+ "columns": [
459
+ "crewx_version"
460
+ ],
461
+ "isUnique": false
462
+ },
463
+ "idx_tasks_pid": {
464
+ "name": "idx_tasks_pid",
465
+ "columns": [
466
+ "pid"
467
+ ],
468
+ "isUnique": false
469
+ },
470
+ "idx_tasks_status_heartbeat": {
471
+ "name": "idx_tasks_status_heartbeat",
472
+ "columns": [
473
+ "status",
474
+ "heartbeat_at"
475
+ ],
476
+ "isUnique": false
477
+ },
478
+ "idx_tasks_thread_id": {
479
+ "name": "idx_tasks_thread_id",
480
+ "columns": [
481
+ "thread_id"
482
+ ],
483
+ "isUnique": false
484
+ },
485
+ "idx_tasks_thread_creator": {
486
+ "name": "idx_tasks_thread_creator",
487
+ "columns": [
488
+ "id",
489
+ "thread_id",
490
+ "actor_kind",
491
+ "actor_id"
492
+ ],
493
+ "isUnique": false
494
+ },
495
+ "idx_tasks_workspace_id": {
496
+ "name": "idx_tasks_workspace_id",
497
+ "columns": [
498
+ "workspace_id"
499
+ ],
500
+ "isUnique": false
501
+ },
502
+ "idx_tasks_workspace_ref": {
503
+ "name": "idx_tasks_workspace_ref",
504
+ "columns": [
505
+ "workspace_ref"
506
+ ],
507
+ "isUnique": false
508
+ },
509
+ "idx_tasks_project_id": {
510
+ "name": "idx_tasks_project_id",
511
+ "columns": [
512
+ "project_id"
513
+ ],
514
+ "isUnique": false
515
+ },
516
+ "idx_tasks_ws_started": {
517
+ "name": "idx_tasks_ws_started",
518
+ "columns": [
519
+ "workspace_id",
520
+ "started_at"
521
+ ],
522
+ "isUnique": false
523
+ },
524
+ "idx_tasks_ws_rated": {
525
+ "name": "idx_tasks_ws_rated",
526
+ "columns": [
527
+ "workspace_id",
528
+ "rating",
529
+ "rated_at"
530
+ ],
531
+ "isUnique": false,
532
+ "where": "\"tasks\".\"rating\" IS NOT NULL"
533
+ }
534
+ },
535
+ "foreignKeys": {},
536
+ "compositePrimaryKeys": {},
537
+ "uniqueConstraints": {},
538
+ "checkConstraints": {
539
+ "tasks_log_storage_ck": {
540
+ "name": "tasks_log_storage_ck",
541
+ "value": "\"tasks\".\"log_storage\" IN ('blob', 'events')"
542
+ },
543
+ "tasks_rating_ck": {
544
+ "name": "tasks_rating_ck",
545
+ "value": "\"tasks\".\"rating\" IN ('up', 'down')"
546
+ }
547
+ }
548
+ },
549
+ "task_log_events": {
550
+ "name": "task_log_events",
551
+ "columns": {
552
+ "id": {
553
+ "name": "id",
554
+ "type": "integer",
555
+ "primaryKey": true,
556
+ "notNull": true,
557
+ "autoincrement": false
558
+ },
559
+ "task_id": {
560
+ "name": "task_id",
561
+ "type": "text",
562
+ "primaryKey": false,
563
+ "notNull": true,
564
+ "autoincrement": false
565
+ },
566
+ "seq": {
567
+ "name": "seq",
568
+ "type": "integer",
569
+ "primaryKey": false,
570
+ "notNull": true,
571
+ "autoincrement": false
572
+ },
573
+ "timestamp": {
574
+ "name": "timestamp",
575
+ "type": "text",
576
+ "primaryKey": false,
577
+ "notNull": true,
578
+ "autoincrement": false
579
+ },
580
+ "level": {
581
+ "name": "level",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": true,
585
+ "autoincrement": false
586
+ },
587
+ "message": {
588
+ "name": "message",
589
+ "type": "text",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "autoincrement": false
593
+ }
594
+ },
595
+ "indexes": {
596
+ "task_log_events_task_seq_uq": {
597
+ "name": "task_log_events_task_seq_uq",
598
+ "columns": [
599
+ "task_id",
600
+ "seq"
601
+ ],
602
+ "isUnique": true
603
+ },
604
+ "task_log_events_timestamp_id_idx": {
605
+ "name": "task_log_events_timestamp_id_idx",
606
+ "columns": [
607
+ "timestamp",
608
+ "id"
609
+ ],
610
+ "isUnique": false
611
+ }
612
+ },
613
+ "foreignKeys": {
614
+ "task_log_events_task_id_tasks_id_fk": {
615
+ "name": "task_log_events_task_id_tasks_id_fk",
616
+ "tableFrom": "task_log_events",
617
+ "tableTo": "tasks",
618
+ "columnsFrom": [
619
+ "task_id"
620
+ ],
621
+ "columnsTo": [
622
+ "id"
623
+ ],
624
+ "onDelete": "cascade",
625
+ "onUpdate": "no action"
626
+ }
627
+ },
628
+ "compositePrimaryKeys": {},
629
+ "uniqueConstraints": {},
630
+ "checkConstraints": {}
631
+ },
632
+ "threads": {
633
+ "name": "threads",
634
+ "columns": {
635
+ "id": {
636
+ "name": "id",
637
+ "type": "text",
638
+ "primaryKey": true,
639
+ "notNull": true,
640
+ "autoincrement": false
641
+ },
642
+ "workspace_id": {
643
+ "name": "workspace_id",
644
+ "type": "text",
645
+ "primaryKey": false,
646
+ "notNull": false,
647
+ "autoincrement": false
648
+ },
649
+ "created_by_kind": {
650
+ "name": "created_by_kind",
651
+ "type": "text",
652
+ "primaryKey": false,
653
+ "notNull": false,
654
+ "autoincrement": false
655
+ },
656
+ "created_by_id": {
657
+ "name": "created_by_id",
658
+ "type": "text",
659
+ "primaryKey": false,
660
+ "notNull": false,
661
+ "autoincrement": false
662
+ },
663
+ "created_by_task_id": {
664
+ "name": "created_by_task_id",
665
+ "type": "text",
666
+ "primaryKey": false,
667
+ "notNull": false,
668
+ "autoincrement": false
669
+ },
670
+ "platform": {
671
+ "name": "platform",
672
+ "type": "text",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "autoincrement": false,
676
+ "default": "'cli'"
677
+ },
678
+ "title": {
679
+ "name": "title",
680
+ "type": "text",
681
+ "primaryKey": false,
682
+ "notNull": false,
683
+ "autoincrement": false
684
+ },
685
+ "first_message": {
686
+ "name": "first_message",
687
+ "type": "text",
688
+ "primaryKey": false,
689
+ "notNull": false,
690
+ "autoincrement": false
691
+ },
692
+ "last_message": {
693
+ "name": "last_message",
694
+ "type": "text",
695
+ "primaryKey": false,
696
+ "notNull": false,
697
+ "autoincrement": false
698
+ },
699
+ "message_count": {
700
+ "name": "message_count",
701
+ "type": "integer",
702
+ "primaryKey": false,
703
+ "notNull": true,
704
+ "autoincrement": false,
705
+ "default": 0
706
+ },
707
+ "created_at": {
708
+ "name": "created_at",
709
+ "type": "text",
710
+ "primaryKey": false,
711
+ "notNull": true,
712
+ "autoincrement": false
713
+ },
714
+ "updated_at": {
715
+ "name": "updated_at",
716
+ "type": "text",
717
+ "primaryKey": false,
718
+ "notNull": true,
719
+ "autoincrement": false
720
+ },
721
+ "metadata": {
722
+ "name": "metadata",
723
+ "type": "text",
724
+ "primaryKey": false,
725
+ "notNull": false,
726
+ "autoincrement": false
727
+ },
728
+ "title_locked": {
729
+ "name": "title_locked",
730
+ "type": "integer",
731
+ "primaryKey": false,
732
+ "notNull": true,
733
+ "autoincrement": false,
734
+ "default": 0
735
+ },
736
+ "pinned": {
737
+ "name": "pinned",
738
+ "type": "integer",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "autoincrement": false,
742
+ "default": 0
743
+ },
744
+ "starred": {
745
+ "name": "starred",
746
+ "type": "integer",
747
+ "primaryKey": false,
748
+ "notNull": true,
749
+ "autoincrement": false,
750
+ "default": 0
751
+ }
752
+ },
753
+ "indexes": {
754
+ "idx_threads_updated_at": {
755
+ "name": "idx_threads_updated_at",
756
+ "columns": [
757
+ "updated_at"
758
+ ],
759
+ "isUnique": false
760
+ },
761
+ "idx_threads_workspace_id": {
762
+ "name": "idx_threads_workspace_id",
763
+ "columns": [
764
+ "workspace_id"
765
+ ],
766
+ "isUnique": false
767
+ },
768
+ "idx_threads_ws_updated": {
769
+ "name": "idx_threads_ws_updated",
770
+ "columns": [
771
+ "workspace_id",
772
+ "updated_at"
773
+ ],
774
+ "isUnique": false
775
+ },
776
+ "idx_threads_workspace_created_by_kind_updated_at": {
777
+ "name": "idx_threads_workspace_created_by_kind_updated_at",
778
+ "columns": [
779
+ "workspace_id",
780
+ "created_by_kind",
781
+ "updated_at"
782
+ ],
783
+ "isUnique": false
784
+ },
785
+ "idx_threads_title": {
786
+ "name": "idx_threads_title",
787
+ "columns": [
788
+ "title"
789
+ ],
790
+ "isUnique": false
791
+ },
792
+ "idx_threads_workspace_thread_state": {
793
+ "name": "idx_threads_workspace_thread_state",
794
+ "columns": [
795
+ "workspace_id",
796
+ "json_extract(metadata, '$.threadTitle.state')"
797
+ ],
798
+ "isUnique": false
799
+ },
800
+ "idx_threads_workspace_thread_priority": {
801
+ "name": "idx_threads_workspace_thread_priority",
802
+ "columns": [
803
+ "workspace_id",
804
+ "json_extract(metadata, '$.threadTitle.priority')"
805
+ ],
806
+ "isUnique": false
807
+ }
808
+ },
809
+ "foreignKeys": {
810
+ "threads_workspace_id_workspaces_id_fk": {
811
+ "name": "threads_workspace_id_workspaces_id_fk",
812
+ "tableFrom": "threads",
813
+ "tableTo": "workspaces",
814
+ "columnsFrom": [
815
+ "workspace_id"
816
+ ],
817
+ "columnsTo": [
818
+ "id"
819
+ ],
820
+ "onDelete": "set null",
821
+ "onUpdate": "no action"
822
+ }
823
+ },
824
+ "compositePrimaryKeys": {},
825
+ "uniqueConstraints": {},
826
+ "checkConstraints": {}
827
+ },
828
+ "thread_creator_unverified": {
829
+ "name": "thread_creator_unverified",
830
+ "columns": {
831
+ "thread_id": {
832
+ "name": "thread_id",
833
+ "type": "text",
834
+ "primaryKey": false,
835
+ "notNull": true,
836
+ "autoincrement": false
837
+ },
838
+ "created_by_task_id": {
839
+ "name": "created_by_task_id",
840
+ "type": "text",
841
+ "primaryKey": false,
842
+ "notNull": true,
843
+ "autoincrement": false
844
+ }
845
+ },
846
+ "indexes": {},
847
+ "foreignKeys": {},
848
+ "compositePrimaryKeys": {
849
+ "thread_creator_unverified_thread_id_created_by_task_id_pk": {
850
+ "columns": [
851
+ "thread_id",
852
+ "created_by_task_id"
853
+ ],
854
+ "name": "thread_creator_unverified_thread_id_created_by_task_id_pk"
855
+ }
856
+ },
857
+ "uniqueConstraints": {},
858
+ "checkConstraints": {}
859
+ },
860
+ "spans": {
861
+ "name": "spans",
862
+ "columns": {
863
+ "id": {
864
+ "name": "id",
865
+ "type": "text",
866
+ "primaryKey": true,
867
+ "notNull": true,
868
+ "autoincrement": false
869
+ },
870
+ "task_id": {
871
+ "name": "task_id",
872
+ "type": "text",
873
+ "primaryKey": false,
874
+ "notNull": false,
875
+ "autoincrement": false
876
+ },
877
+ "parent_span_id": {
878
+ "name": "parent_span_id",
879
+ "type": "text",
880
+ "primaryKey": false,
881
+ "notNull": false,
882
+ "autoincrement": false
883
+ },
884
+ "name": {
885
+ "name": "name",
886
+ "type": "text",
887
+ "primaryKey": false,
888
+ "notNull": true,
889
+ "autoincrement": false
890
+ },
891
+ "kind": {
892
+ "name": "kind",
893
+ "type": "text",
894
+ "primaryKey": false,
895
+ "notNull": true,
896
+ "autoincrement": false,
897
+ "default": "'internal'"
898
+ },
899
+ "status": {
900
+ "name": "status",
901
+ "type": "text",
902
+ "primaryKey": false,
903
+ "notNull": true,
904
+ "autoincrement": false,
905
+ "default": "'ok'"
906
+ },
907
+ "started_at": {
908
+ "name": "started_at",
909
+ "type": "text",
910
+ "primaryKey": false,
911
+ "notNull": true,
912
+ "autoincrement": false
913
+ },
914
+ "completed_at": {
915
+ "name": "completed_at",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": false,
919
+ "autoincrement": false
920
+ },
921
+ "duration_ms": {
922
+ "name": "duration_ms",
923
+ "type": "integer",
924
+ "primaryKey": false,
925
+ "notNull": false,
926
+ "autoincrement": false
927
+ },
928
+ "input": {
929
+ "name": "input",
930
+ "type": "text",
931
+ "primaryKey": false,
932
+ "notNull": false,
933
+ "autoincrement": false
934
+ },
935
+ "output": {
936
+ "name": "output",
937
+ "type": "text",
938
+ "primaryKey": false,
939
+ "notNull": false,
940
+ "autoincrement": false
941
+ },
942
+ "error": {
943
+ "name": "error",
944
+ "type": "text",
945
+ "primaryKey": false,
946
+ "notNull": false,
947
+ "autoincrement": false
948
+ },
949
+ "attributes": {
950
+ "name": "attributes",
951
+ "type": "text",
952
+ "primaryKey": false,
953
+ "notNull": false,
954
+ "autoincrement": false
955
+ }
956
+ },
957
+ "indexes": {
958
+ "idx_spans_task_id": {
959
+ "name": "idx_spans_task_id",
960
+ "columns": [
961
+ "task_id"
962
+ ],
963
+ "isUnique": false
964
+ },
965
+ "idx_spans_parent_span_id": {
966
+ "name": "idx_spans_parent_span_id",
967
+ "columns": [
968
+ "parent_span_id"
969
+ ],
970
+ "isUnique": false
971
+ }
972
+ },
973
+ "foreignKeys": {
974
+ "spans_task_id_tasks_id_fk": {
975
+ "name": "spans_task_id_tasks_id_fk",
976
+ "tableFrom": "spans",
977
+ "tableTo": "tasks",
978
+ "columnsFrom": [
979
+ "task_id"
980
+ ],
981
+ "columnsTo": [
982
+ "id"
983
+ ],
984
+ "onDelete": "set null",
985
+ "onUpdate": "no action"
986
+ },
987
+ "spans_parent_span_id_spans_id_fk": {
988
+ "name": "spans_parent_span_id_spans_id_fk",
989
+ "tableFrom": "spans",
990
+ "tableTo": "spans",
991
+ "columnsFrom": [
992
+ "parent_span_id"
993
+ ],
994
+ "columnsTo": [
995
+ "id"
996
+ ],
997
+ "onDelete": "set null",
998
+ "onUpdate": "no action"
999
+ }
1000
+ },
1001
+ "compositePrimaryKeys": {},
1002
+ "uniqueConstraints": {},
1003
+ "checkConstraints": {}
1004
+ },
1005
+ "tool_calls": {
1006
+ "name": "tool_calls",
1007
+ "columns": {
1008
+ "id": {
1009
+ "name": "id",
1010
+ "type": "text",
1011
+ "primaryKey": true,
1012
+ "notNull": true,
1013
+ "autoincrement": false
1014
+ },
1015
+ "task_id": {
1016
+ "name": "task_id",
1017
+ "type": "text",
1018
+ "primaryKey": false,
1019
+ "notNull": false,
1020
+ "autoincrement": false
1021
+ },
1022
+ "session_id": {
1023
+ "name": "session_id",
1024
+ "type": "text",
1025
+ "primaryKey": false,
1026
+ "notNull": false,
1027
+ "autoincrement": false
1028
+ },
1029
+ "tool_name": {
1030
+ "name": "tool_name",
1031
+ "type": "text",
1032
+ "primaryKey": false,
1033
+ "notNull": true,
1034
+ "autoincrement": false
1035
+ },
1036
+ "files": {
1037
+ "name": "files",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": false,
1041
+ "autoincrement": false
1042
+ },
1043
+ "input": {
1044
+ "name": "input",
1045
+ "type": "text",
1046
+ "primaryKey": false,
1047
+ "notNull": false,
1048
+ "autoincrement": false
1049
+ },
1050
+ "output": {
1051
+ "name": "output",
1052
+ "type": "text",
1053
+ "primaryKey": false,
1054
+ "notNull": false,
1055
+ "autoincrement": false
1056
+ },
1057
+ "duration_ms": {
1058
+ "name": "duration_ms",
1059
+ "type": "integer",
1060
+ "primaryKey": false,
1061
+ "notNull": false,
1062
+ "autoincrement": false
1063
+ },
1064
+ "timestamp": {
1065
+ "name": "timestamp",
1066
+ "type": "text",
1067
+ "primaryKey": false,
1068
+ "notNull": true,
1069
+ "autoincrement": false
1070
+ }
1071
+ },
1072
+ "indexes": {
1073
+ "idx_tool_calls_task_id": {
1074
+ "name": "idx_tool_calls_task_id",
1075
+ "columns": [
1076
+ "task_id"
1077
+ ],
1078
+ "isUnique": false
1079
+ },
1080
+ "idx_tool_calls_tool_name": {
1081
+ "name": "idx_tool_calls_tool_name",
1082
+ "columns": [
1083
+ "tool_name"
1084
+ ],
1085
+ "isUnique": false
1086
+ },
1087
+ "idx_tool_calls_timestamp": {
1088
+ "name": "idx_tool_calls_timestamp",
1089
+ "columns": [
1090
+ "timestamp"
1091
+ ],
1092
+ "isUnique": false
1093
+ }
1094
+ },
1095
+ "foreignKeys": {
1096
+ "tool_calls_task_id_tasks_id_fk": {
1097
+ "name": "tool_calls_task_id_tasks_id_fk",
1098
+ "tableFrom": "tool_calls",
1099
+ "tableTo": "tasks",
1100
+ "columnsFrom": [
1101
+ "task_id"
1102
+ ],
1103
+ "columnsTo": [
1104
+ "id"
1105
+ ],
1106
+ "onDelete": "cascade",
1107
+ "onUpdate": "no action"
1108
+ }
1109
+ },
1110
+ "compositePrimaryKeys": {},
1111
+ "uniqueConstraints": {},
1112
+ "checkConstraints": {}
1113
+ },
1114
+ "thread_boxes": {
1115
+ "name": "thread_boxes",
1116
+ "columns": {
1117
+ "id": {
1118
+ "name": "id",
1119
+ "type": "text",
1120
+ "primaryKey": true,
1121
+ "notNull": true,
1122
+ "autoincrement": false
1123
+ },
1124
+ "thread_id": {
1125
+ "name": "thread_id",
1126
+ "type": "text",
1127
+ "primaryKey": false,
1128
+ "notNull": true,
1129
+ "autoincrement": false
1130
+ },
1131
+ "seq": {
1132
+ "name": "seq",
1133
+ "type": "integer",
1134
+ "primaryKey": false,
1135
+ "notNull": true,
1136
+ "autoincrement": false
1137
+ },
1138
+ "first_task_id": {
1139
+ "name": "first_task_id",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": true,
1143
+ "autoincrement": false
1144
+ },
1145
+ "mid_task_id": {
1146
+ "name": "mid_task_id",
1147
+ "type": "text",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "autoincrement": false
1151
+ },
1152
+ "last_task_id": {
1153
+ "name": "last_task_id",
1154
+ "type": "text",
1155
+ "primaryKey": false,
1156
+ "notNull": true,
1157
+ "autoincrement": false
1158
+ },
1159
+ "task_count": {
1160
+ "name": "task_count",
1161
+ "type": "integer",
1162
+ "primaryKey": false,
1163
+ "notNull": true,
1164
+ "autoincrement": false
1165
+ },
1166
+ "summary": {
1167
+ "name": "summary",
1168
+ "type": "text",
1169
+ "primaryKey": false,
1170
+ "notNull": false,
1171
+ "autoincrement": false
1172
+ },
1173
+ "source_tokens": {
1174
+ "name": "source_tokens",
1175
+ "type": "integer",
1176
+ "primaryKey": false,
1177
+ "notNull": true,
1178
+ "autoincrement": false
1179
+ },
1180
+ "summary_tokens": {
1181
+ "name": "summary_tokens",
1182
+ "type": "integer",
1183
+ "primaryKey": false,
1184
+ "notNull": false,
1185
+ "autoincrement": false
1186
+ },
1187
+ "created_at": {
1188
+ "name": "created_at",
1189
+ "type": "text",
1190
+ "primaryKey": false,
1191
+ "notNull": true,
1192
+ "autoincrement": false
1193
+ }
1194
+ },
1195
+ "indexes": {
1196
+ "idx_thread_boxes_thread_id": {
1197
+ "name": "idx_thread_boxes_thread_id",
1198
+ "columns": [
1199
+ "thread_id"
1200
+ ],
1201
+ "isUnique": false
1202
+ },
1203
+ "idx_thread_boxes_seq": {
1204
+ "name": "idx_thread_boxes_seq",
1205
+ "columns": [
1206
+ "thread_id",
1207
+ "seq"
1208
+ ],
1209
+ "isUnique": false
1210
+ },
1211
+ "thread_boxes_thread_id_seq_unique": {
1212
+ "name": "thread_boxes_thread_id_seq_unique",
1213
+ "columns": [
1214
+ "thread_id",
1215
+ "seq"
1216
+ ],
1217
+ "isUnique": true
1218
+ }
1219
+ },
1220
+ "foreignKeys": {
1221
+ "thread_boxes_thread_id_threads_id_fk": {
1222
+ "name": "thread_boxes_thread_id_threads_id_fk",
1223
+ "tableFrom": "thread_boxes",
1224
+ "tableTo": "threads",
1225
+ "columnsFrom": [
1226
+ "thread_id"
1227
+ ],
1228
+ "columnsTo": [
1229
+ "id"
1230
+ ],
1231
+ "onDelete": "cascade",
1232
+ "onUpdate": "no action"
1233
+ }
1234
+ },
1235
+ "compositePrimaryKeys": {},
1236
+ "uniqueConstraints": {},
1237
+ "checkConstraints": {}
1238
+ },
1239
+ "request_logs": {
1240
+ "name": "request_logs",
1241
+ "columns": {
1242
+ "id": {
1243
+ "name": "id",
1244
+ "type": "text",
1245
+ "primaryKey": true,
1246
+ "notNull": true,
1247
+ "autoincrement": false
1248
+ },
1249
+ "path": {
1250
+ "name": "path",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": true,
1254
+ "autoincrement": false
1255
+ },
1256
+ "method": {
1257
+ "name": "method",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": true,
1261
+ "autoincrement": false
1262
+ },
1263
+ "status_code": {
1264
+ "name": "status_code",
1265
+ "type": "integer",
1266
+ "primaryKey": false,
1267
+ "notNull": true,
1268
+ "autoincrement": false
1269
+ },
1270
+ "duration_ms": {
1271
+ "name": "duration_ms",
1272
+ "type": "integer",
1273
+ "primaryKey": false,
1274
+ "notNull": true,
1275
+ "autoincrement": false
1276
+ },
1277
+ "ip": {
1278
+ "name": "ip",
1279
+ "type": "text",
1280
+ "primaryKey": false,
1281
+ "notNull": false,
1282
+ "autoincrement": false
1283
+ },
1284
+ "request_headers": {
1285
+ "name": "request_headers",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": false,
1289
+ "autoincrement": false
1290
+ },
1291
+ "response_headers": {
1292
+ "name": "response_headers",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": false,
1296
+ "autoincrement": false
1297
+ },
1298
+ "request_body": {
1299
+ "name": "request_body",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": false,
1303
+ "autoincrement": false
1304
+ },
1305
+ "response_body": {
1306
+ "name": "response_body",
1307
+ "type": "text",
1308
+ "primaryKey": false,
1309
+ "notNull": false,
1310
+ "autoincrement": false
1311
+ },
1312
+ "query": {
1313
+ "name": "query",
1314
+ "type": "text",
1315
+ "primaryKey": false,
1316
+ "notNull": false,
1317
+ "autoincrement": false
1318
+ },
1319
+ "user_id": {
1320
+ "name": "user_id",
1321
+ "type": "text",
1322
+ "primaryKey": false,
1323
+ "notNull": false,
1324
+ "autoincrement": false
1325
+ },
1326
+ "project_id": {
1327
+ "name": "project_id",
1328
+ "type": "text",
1329
+ "primaryKey": false,
1330
+ "notNull": false,
1331
+ "autoincrement": false
1332
+ },
1333
+ "partition_key": {
1334
+ "name": "partition_key",
1335
+ "type": "text",
1336
+ "primaryKey": false,
1337
+ "notNull": true,
1338
+ "autoincrement": false
1339
+ },
1340
+ "timestamp": {
1341
+ "name": "timestamp",
1342
+ "type": "text",
1343
+ "primaryKey": false,
1344
+ "notNull": true,
1345
+ "autoincrement": false,
1346
+ "default": "(datetime('now'))"
1347
+ },
1348
+ "metadata": {
1349
+ "name": "metadata",
1350
+ "type": "text",
1351
+ "primaryKey": false,
1352
+ "notNull": false,
1353
+ "autoincrement": false
1354
+ }
1355
+ },
1356
+ "indexes": {
1357
+ "idx_request_logs_timestamp": {
1358
+ "name": "idx_request_logs_timestamp",
1359
+ "columns": [
1360
+ "timestamp"
1361
+ ],
1362
+ "isUnique": false
1363
+ },
1364
+ "idx_request_logs_path": {
1365
+ "name": "idx_request_logs_path",
1366
+ "columns": [
1367
+ "path"
1368
+ ],
1369
+ "isUnique": false
1370
+ },
1371
+ "idx_request_logs_status_code": {
1372
+ "name": "idx_request_logs_status_code",
1373
+ "columns": [
1374
+ "status_code"
1375
+ ],
1376
+ "isUnique": false
1377
+ },
1378
+ "idx_request_logs_partition_key": {
1379
+ "name": "idx_request_logs_partition_key",
1380
+ "columns": [
1381
+ "partition_key"
1382
+ ],
1383
+ "isUnique": false
1384
+ }
1385
+ },
1386
+ "foreignKeys": {},
1387
+ "compositePrimaryKeys": {},
1388
+ "uniqueConstraints": {},
1389
+ "checkConstraints": {}
1390
+ },
1391
+ "request_log_daily": {
1392
+ "name": "request_log_daily",
1393
+ "columns": {
1394
+ "day": {
1395
+ "name": "day",
1396
+ "type": "text",
1397
+ "primaryKey": false,
1398
+ "notNull": true,
1399
+ "autoincrement": false
1400
+ },
1401
+ "scope": {
1402
+ "name": "scope",
1403
+ "type": "text",
1404
+ "primaryKey": false,
1405
+ "notNull": true,
1406
+ "autoincrement": false
1407
+ },
1408
+ "ok": {
1409
+ "name": "ok",
1410
+ "type": "integer",
1411
+ "primaryKey": false,
1412
+ "notNull": true,
1413
+ "autoincrement": false
1414
+ },
1415
+ "client": {
1416
+ "name": "client",
1417
+ "type": "integer",
1418
+ "primaryKey": false,
1419
+ "notNull": true,
1420
+ "autoincrement": false
1421
+ },
1422
+ "server": {
1423
+ "name": "server",
1424
+ "type": "integer",
1425
+ "primaryKey": false,
1426
+ "notNull": true,
1427
+ "autoincrement": false
1428
+ },
1429
+ "p50_ms": {
1430
+ "name": "p50_ms",
1431
+ "type": "integer",
1432
+ "primaryKey": false,
1433
+ "notNull": false,
1434
+ "autoincrement": false
1435
+ },
1436
+ "p95_ms": {
1437
+ "name": "p95_ms",
1438
+ "type": "integer",
1439
+ "primaryKey": false,
1440
+ "notNull": false,
1441
+ "autoincrement": false
1442
+ },
1443
+ "computed_at": {
1444
+ "name": "computed_at",
1445
+ "type": "text",
1446
+ "primaryKey": false,
1447
+ "notNull": true,
1448
+ "autoincrement": false
1449
+ }
1450
+ },
1451
+ "indexes": {},
1452
+ "foreignKeys": {},
1453
+ "compositePrimaryKeys": {
1454
+ "request_log_daily_day_scope_pk": {
1455
+ "columns": [
1456
+ "day",
1457
+ "scope"
1458
+ ],
1459
+ "name": "request_log_daily_day_scope_pk"
1460
+ }
1461
+ },
1462
+ "uniqueConstraints": {},
1463
+ "checkConstraints": {}
1464
+ },
1465
+ "usage_limit_snapshots": {
1466
+ "name": "usage_limit_snapshots",
1467
+ "columns": {
1468
+ "id": {
1469
+ "name": "id",
1470
+ "type": "text",
1471
+ "primaryKey": true,
1472
+ "notNull": true,
1473
+ "autoincrement": false
1474
+ },
1475
+ "provider": {
1476
+ "name": "provider",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": true,
1480
+ "autoincrement": false
1481
+ },
1482
+ "account_ref": {
1483
+ "name": "account_ref",
1484
+ "type": "text",
1485
+ "primaryKey": false,
1486
+ "notNull": true,
1487
+ "autoincrement": false,
1488
+ "default": "'default'"
1489
+ },
1490
+ "limit_window": {
1491
+ "name": "limit_window",
1492
+ "type": "text",
1493
+ "primaryKey": false,
1494
+ "notNull": true,
1495
+ "autoincrement": false
1496
+ },
1497
+ "bucket_start": {
1498
+ "name": "bucket_start",
1499
+ "type": "text",
1500
+ "primaryKey": false,
1501
+ "notNull": true,
1502
+ "autoincrement": false
1503
+ },
1504
+ "captured_at": {
1505
+ "name": "captured_at",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "autoincrement": false
1510
+ },
1511
+ "used_percent": {
1512
+ "name": "used_percent",
1513
+ "type": "integer",
1514
+ "primaryKey": false,
1515
+ "notNull": true,
1516
+ "autoincrement": false
1517
+ },
1518
+ "remaining_percent": {
1519
+ "name": "remaining_percent",
1520
+ "type": "integer",
1521
+ "primaryKey": false,
1522
+ "notNull": true,
1523
+ "autoincrement": false
1524
+ },
1525
+ "resets_at": {
1526
+ "name": "resets_at",
1527
+ "type": "text",
1528
+ "primaryKey": false,
1529
+ "notNull": false,
1530
+ "autoincrement": false
1531
+ },
1532
+ "source": {
1533
+ "name": "source",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": true,
1537
+ "autoincrement": false
1538
+ },
1539
+ "metadata": {
1540
+ "name": "metadata",
1541
+ "type": "text",
1542
+ "primaryKey": false,
1543
+ "notNull": false,
1544
+ "autoincrement": false
1545
+ }
1546
+ },
1547
+ "indexes": {
1548
+ "uniq_usage_limit_snapshots_bucket": {
1549
+ "name": "uniq_usage_limit_snapshots_bucket",
1550
+ "columns": [
1551
+ "provider",
1552
+ "account_ref",
1553
+ "limit_window",
1554
+ "bucket_start"
1555
+ ],
1556
+ "isUnique": true
1557
+ },
1558
+ "idx_usage_limit_snapshots_window_bucket": {
1559
+ "name": "idx_usage_limit_snapshots_window_bucket",
1560
+ "columns": [
1561
+ "limit_window",
1562
+ "bucket_start"
1563
+ ],
1564
+ "isUnique": false
1565
+ },
1566
+ "idx_usage_limit_snapshots_provider_window_bucket": {
1567
+ "name": "idx_usage_limit_snapshots_provider_window_bucket",
1568
+ "columns": [
1569
+ "provider",
1570
+ "limit_window",
1571
+ "bucket_start"
1572
+ ],
1573
+ "isUnique": false
1574
+ }
1575
+ },
1576
+ "foreignKeys": {},
1577
+ "compositePrimaryKeys": {},
1578
+ "uniqueConstraints": {},
1579
+ "checkConstraints": {}
1580
+ },
1581
+ "usage_reports": {
1582
+ "name": "usage_reports",
1583
+ "columns": {
1584
+ "id": {
1585
+ "name": "id",
1586
+ "type": "text",
1587
+ "primaryKey": true,
1588
+ "notNull": true,
1589
+ "autoincrement": false
1590
+ },
1591
+ "workspace_id": {
1592
+ "name": "workspace_id",
1593
+ "type": "text",
1594
+ "primaryKey": false,
1595
+ "notNull": true,
1596
+ "autoincrement": false
1597
+ },
1598
+ "month": {
1599
+ "name": "month",
1600
+ "type": "text",
1601
+ "primaryKey": false,
1602
+ "notNull": true,
1603
+ "autoincrement": false
1604
+ },
1605
+ "generated_at": {
1606
+ "name": "generated_at",
1607
+ "type": "text",
1608
+ "primaryKey": false,
1609
+ "notNull": true,
1610
+ "autoincrement": false
1611
+ },
1612
+ "source_range": {
1613
+ "name": "source_range",
1614
+ "type": "text",
1615
+ "primaryKey": false,
1616
+ "notNull": true,
1617
+ "autoincrement": false
1618
+ },
1619
+ "tier": {
1620
+ "name": "tier",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "autoincrement": false
1625
+ },
1626
+ "total_tokens": {
1627
+ "name": "total_tokens",
1628
+ "type": "integer",
1629
+ "primaryKey": false,
1630
+ "notNull": true,
1631
+ "autoincrement": false
1632
+ },
1633
+ "total_cost_usd": {
1634
+ "name": "total_cost_usd",
1635
+ "type": "real",
1636
+ "primaryKey": false,
1637
+ "notNull": true,
1638
+ "autoincrement": false
1639
+ },
1640
+ "payload": {
1641
+ "name": "payload",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": true,
1645
+ "autoincrement": false
1646
+ },
1647
+ "payload_hash": {
1648
+ "name": "payload_hash",
1649
+ "type": "text",
1650
+ "primaryKey": false,
1651
+ "notNull": false,
1652
+ "autoincrement": false
1653
+ },
1654
+ "signature": {
1655
+ "name": "signature",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": false,
1659
+ "autoincrement": false
1660
+ },
1661
+ "signed_at": {
1662
+ "name": "signed_at",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": false,
1666
+ "autoincrement": false
1667
+ },
1668
+ "issuer": {
1669
+ "name": "issuer",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": false,
1673
+ "autoincrement": false
1674
+ }
1675
+ },
1676
+ "indexes": {
1677
+ "uniq_usage_reports_ws_month": {
1678
+ "name": "uniq_usage_reports_ws_month",
1679
+ "columns": [
1680
+ "workspace_id",
1681
+ "month"
1682
+ ],
1683
+ "isUnique": true
1684
+ }
1685
+ },
1686
+ "foreignKeys": {},
1687
+ "compositePrimaryKeys": {},
1688
+ "uniqueConstraints": {},
1689
+ "checkConstraints": {}
1690
+ },
1691
+ "notification_reads": {
1692
+ "name": "notification_reads",
1693
+ "columns": {
1694
+ "notification_id": {
1695
+ "name": "notification_id",
1696
+ "type": "text",
1697
+ "primaryKey": false,
1698
+ "notNull": true,
1699
+ "autoincrement": false
1700
+ },
1701
+ "user_id": {
1702
+ "name": "user_id",
1703
+ "type": "text",
1704
+ "primaryKey": false,
1705
+ "notNull": true,
1706
+ "autoincrement": false
1707
+ },
1708
+ "read_at": {
1709
+ "name": "read_at",
1710
+ "type": "text",
1711
+ "primaryKey": false,
1712
+ "notNull": true,
1713
+ "autoincrement": false
1714
+ }
1715
+ },
1716
+ "indexes": {},
1717
+ "foreignKeys": {},
1718
+ "compositePrimaryKeys": {
1719
+ "notification_reads_notification_id_user_id_pk": {
1720
+ "columns": [
1721
+ "notification_id",
1722
+ "user_id"
1723
+ ],
1724
+ "name": "notification_reads_notification_id_user_id_pk"
1725
+ }
1726
+ },
1727
+ "uniqueConstraints": {},
1728
+ "checkConstraints": {}
1729
+ },
1730
+ "notifications": {
1731
+ "name": "notifications",
1732
+ "columns": {
1733
+ "id": {
1734
+ "name": "id",
1735
+ "type": "text",
1736
+ "primaryKey": true,
1737
+ "notNull": true,
1738
+ "autoincrement": false
1739
+ },
1740
+ "workspace_id": {
1741
+ "name": "workspace_id",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": true,
1745
+ "autoincrement": false
1746
+ },
1747
+ "agent_id": {
1748
+ "name": "agent_id",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": false,
1752
+ "autoincrement": false
1753
+ },
1754
+ "task_id": {
1755
+ "name": "task_id",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": false,
1759
+ "autoincrement": false
1760
+ },
1761
+ "thread_id": {
1762
+ "name": "thread_id",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": false,
1766
+ "autoincrement": false
1767
+ },
1768
+ "source": {
1769
+ "name": "source",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": true,
1773
+ "autoincrement": false,
1774
+ "default": "'agent'"
1775
+ },
1776
+ "level": {
1777
+ "name": "level",
1778
+ "type": "text",
1779
+ "primaryKey": false,
1780
+ "notNull": true,
1781
+ "autoincrement": false,
1782
+ "default": "'info'"
1783
+ },
1784
+ "title": {
1785
+ "name": "title",
1786
+ "type": "text",
1787
+ "primaryKey": false,
1788
+ "notNull": true,
1789
+ "autoincrement": false
1790
+ },
1791
+ "body": {
1792
+ "name": "body",
1793
+ "type": "text",
1794
+ "primaryKey": false,
1795
+ "notNull": false,
1796
+ "autoincrement": false
1797
+ },
1798
+ "target_user_id": {
1799
+ "name": "target_user_id",
1800
+ "type": "text",
1801
+ "primaryKey": false,
1802
+ "notNull": false,
1803
+ "autoincrement": false
1804
+ },
1805
+ "created_at": {
1806
+ "name": "created_at",
1807
+ "type": "text",
1808
+ "primaryKey": false,
1809
+ "notNull": true,
1810
+ "autoincrement": false
1811
+ },
1812
+ "metadata": {
1813
+ "name": "metadata",
1814
+ "type": "text",
1815
+ "primaryKey": false,
1816
+ "notNull": false,
1817
+ "autoincrement": false
1818
+ }
1819
+ },
1820
+ "indexes": {
1821
+ "idx_notifications_ws_created": {
1822
+ "name": "idx_notifications_ws_created",
1823
+ "columns": [
1824
+ "workspace_id",
1825
+ "\"created_at\" DESC"
1826
+ ],
1827
+ "isUnique": false
1828
+ }
1829
+ },
1830
+ "foreignKeys": {},
1831
+ "compositePrimaryKeys": {},
1832
+ "uniqueConstraints": {},
1833
+ "checkConstraints": {}
1834
+ },
1835
+ "agent_suggestions": {
1836
+ "name": "agent_suggestions",
1837
+ "columns": {
1838
+ "id": {
1839
+ "name": "id",
1840
+ "type": "text",
1841
+ "primaryKey": true,
1842
+ "notNull": true,
1843
+ "autoincrement": false
1844
+ },
1845
+ "workspace_id": {
1846
+ "name": "workspace_id",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": true,
1850
+ "autoincrement": false
1851
+ },
1852
+ "agent_id": {
1853
+ "name": "agent_id",
1854
+ "type": "text",
1855
+ "primaryKey": false,
1856
+ "notNull": true,
1857
+ "autoincrement": false
1858
+ },
1859
+ "task_id": {
1860
+ "name": "task_id",
1861
+ "type": "text",
1862
+ "primaryKey": false,
1863
+ "notNull": false,
1864
+ "autoincrement": false
1865
+ },
1866
+ "type": {
1867
+ "name": "type",
1868
+ "type": "text",
1869
+ "primaryKey": false,
1870
+ "notNull": true,
1871
+ "autoincrement": false
1872
+ },
1873
+ "status": {
1874
+ "name": "status",
1875
+ "type": "text",
1876
+ "primaryKey": false,
1877
+ "notNull": true,
1878
+ "autoincrement": false,
1879
+ "default": "'pending'"
1880
+ },
1881
+ "payload": {
1882
+ "name": "payload",
1883
+ "type": "text",
1884
+ "primaryKey": false,
1885
+ "notNull": true,
1886
+ "autoincrement": false
1887
+ },
1888
+ "applied_commit_sha": {
1889
+ "name": "applied_commit_sha",
1890
+ "type": "text",
1891
+ "primaryKey": false,
1892
+ "notNull": false,
1893
+ "autoincrement": false
1894
+ },
1895
+ "created_at": {
1896
+ "name": "created_at",
1897
+ "type": "text",
1898
+ "primaryKey": false,
1899
+ "notNull": true,
1900
+ "autoincrement": false
1901
+ },
1902
+ "updated_at": {
1903
+ "name": "updated_at",
1904
+ "type": "text",
1905
+ "primaryKey": false,
1906
+ "notNull": true,
1907
+ "autoincrement": false
1908
+ }
1909
+ },
1910
+ "indexes": {
1911
+ "idx_agent_suggestions_ws_agent": {
1912
+ "name": "idx_agent_suggestions_ws_agent",
1913
+ "columns": [
1914
+ "workspace_id",
1915
+ "agent_id"
1916
+ ],
1917
+ "isUnique": false
1918
+ },
1919
+ "idx_agent_suggestions_ws_created": {
1920
+ "name": "idx_agent_suggestions_ws_created",
1921
+ "columns": [
1922
+ "workspace_id",
1923
+ "created_at"
1924
+ ],
1925
+ "isUnique": false
1926
+ }
1927
+ },
1928
+ "foreignKeys": {},
1929
+ "compositePrimaryKeys": {},
1930
+ "uniqueConstraints": {},
1931
+ "checkConstraints": {}
1932
+ },
1933
+ "ui_instances": {
1934
+ "name": "ui_instances",
1935
+ "columns": {
1936
+ "id": {
1937
+ "name": "id",
1938
+ "type": "text",
1939
+ "primaryKey": true,
1940
+ "notNull": true,
1941
+ "autoincrement": false
1942
+ },
1943
+ "definition_id": {
1944
+ "name": "definition_id",
1945
+ "type": "text",
1946
+ "primaryKey": false,
1947
+ "notNull": true,
1948
+ "autoincrement": false
1949
+ },
1950
+ "definition_version": {
1951
+ "name": "definition_version",
1952
+ "type": "integer",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "autoincrement": false
1956
+ },
1957
+ "definition_hash": {
1958
+ "name": "definition_hash",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "autoincrement": false
1963
+ },
1964
+ "workspace_id": {
1965
+ "name": "workspace_id",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": true,
1969
+ "autoincrement": false
1970
+ },
1971
+ "thread_id": {
1972
+ "name": "thread_id",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": true,
1976
+ "autoincrement": false
1977
+ },
1978
+ "app_id": {
1979
+ "name": "app_id",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": false,
1983
+ "autoincrement": false
1984
+ },
1985
+ "anchor_task_id": {
1986
+ "name": "anchor_task_id",
1987
+ "type": "text",
1988
+ "primaryKey": false,
1989
+ "notNull": false,
1990
+ "autoincrement": false
1991
+ },
1992
+ "domain_ref_json": {
1993
+ "name": "domain_ref_json",
1994
+ "type": "text",
1995
+ "primaryKey": false,
1996
+ "notNull": true,
1997
+ "autoincrement": false
1998
+ },
1999
+ "state_json": {
2000
+ "name": "state_json",
2001
+ "type": "text",
2002
+ "primaryKey": false,
2003
+ "notNull": true,
2004
+ "autoincrement": false
2005
+ },
2006
+ "revision": {
2007
+ "name": "revision",
2008
+ "type": "integer",
2009
+ "primaryKey": false,
2010
+ "notNull": true,
2011
+ "autoincrement": false,
2012
+ "default": 0
2013
+ },
2014
+ "status": {
2015
+ "name": "status",
2016
+ "type": "text",
2017
+ "primaryKey": false,
2018
+ "notNull": true,
2019
+ "autoincrement": false,
2020
+ "default": "'active'"
2021
+ },
2022
+ "granted_capabilities_json": {
2023
+ "name": "granted_capabilities_json",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": true,
2027
+ "autoincrement": false,
2028
+ "default": "'[]'"
2029
+ },
2030
+ "opened_by_json": {
2031
+ "name": "opened_by_json",
2032
+ "type": "text",
2033
+ "primaryKey": false,
2034
+ "notNull": false,
2035
+ "autoincrement": false
2036
+ },
2037
+ "agent_open_request_json": {
2038
+ "name": "agent_open_request_json",
2039
+ "type": "text",
2040
+ "primaryKey": false,
2041
+ "notNull": false,
2042
+ "autoincrement": false
2043
+ },
2044
+ "created_at": {
2045
+ "name": "created_at",
2046
+ "type": "integer",
2047
+ "primaryKey": false,
2048
+ "notNull": true,
2049
+ "autoincrement": false
2050
+ },
2051
+ "updated_at": {
2052
+ "name": "updated_at",
2053
+ "type": "integer",
2054
+ "primaryKey": false,
2055
+ "notNull": true,
2056
+ "autoincrement": false
2057
+ }
2058
+ },
2059
+ "indexes": {
2060
+ "ui_instances_workspace_thread_idx": {
2061
+ "name": "ui_instances_workspace_thread_idx",
2062
+ "columns": [
2063
+ "workspace_id",
2064
+ "thread_id"
2065
+ ],
2066
+ "isUnique": false
2067
+ },
2068
+ "ui_instances_workspace_thread_app_uq": {
2069
+ "name": "ui_instances_workspace_thread_app_uq",
2070
+ "columns": [
2071
+ "workspace_id",
2072
+ "thread_id",
2073
+ "app_id"
2074
+ ],
2075
+ "isUnique": true,
2076
+ "where": "\"ui_instances\".\"status\" = 'active'"
2077
+ }
2078
+ },
2079
+ "foreignKeys": {},
2080
+ "compositePrimaryKeys": {},
2081
+ "uniqueConstraints": {},
2082
+ "checkConstraints": {
2083
+ "ui_instances_id_ck": {
2084
+ "name": "ui_instances_id_ck",
2085
+ "value": "length(\"ui_instances\".\"id\") BETWEEN 5 AND 128 AND \"ui_instances\".\"id\" GLOB 'uic_*'"
2086
+ },
2087
+ "ui_instances_definition_id_ck": {
2088
+ "name": "ui_instances_definition_id_ck",
2089
+ "value": "length(\"ui_instances\".\"definition_id\") BETWEEN 1 AND 128"
2090
+ },
2091
+ "ui_instances_definition_version_ck": {
2092
+ "name": "ui_instances_definition_version_ck",
2093
+ "value": "\"ui_instances\".\"definition_version\" >= 1"
2094
+ },
2095
+ "ui_instances_definition_hash_ck": {
2096
+ "name": "ui_instances_definition_hash_ck",
2097
+ "value": "length(\"ui_instances\".\"definition_hash\") = 64 AND \"ui_instances\".\"definition_hash\" NOT GLOB '*[^0-9a-f]*'"
2098
+ },
2099
+ "ui_instances_workspace_id_ck": {
2100
+ "name": "ui_instances_workspace_id_ck",
2101
+ "value": "length(\"ui_instances\".\"workspace_id\") BETWEEN 1 AND 256"
2102
+ },
2103
+ "ui_instances_thread_id_ck": {
2104
+ "name": "ui_instances_thread_id_ck",
2105
+ "value": "length(\"ui_instances\".\"thread_id\") BETWEEN 1 AND 256"
2106
+ },
2107
+ "ui_instances_app_id_ck": {
2108
+ "name": "ui_instances_app_id_ck",
2109
+ "value": "\"ui_instances\".\"app_id\" IS NULL OR length(\"ui_instances\".\"app_id\") BETWEEN 1 AND 128"
2110
+ },
2111
+ "ui_instances_domain_ref_json_ck": {
2112
+ "name": "ui_instances_domain_ref_json_ck",
2113
+ "value": "json_valid(\"ui_instances\".\"domain_ref_json\") AND json_type(\"ui_instances\".\"domain_ref_json\") = 'object'"
2114
+ },
2115
+ "ui_instances_state_json_ck": {
2116
+ "name": "ui_instances_state_json_ck",
2117
+ "value": "json_valid(\"ui_instances\".\"state_json\") AND json_type(\"ui_instances\".\"state_json\") = 'object'"
2118
+ },
2119
+ "ui_instances_revision_ck": {
2120
+ "name": "ui_instances_revision_ck",
2121
+ "value": "\"ui_instances\".\"revision\" >= 0"
2122
+ },
2123
+ "ui_instances_status_ck": {
2124
+ "name": "ui_instances_status_ck",
2125
+ "value": "\"ui_instances\".\"status\" IN ('active', 'completed', 'expired', 'revoked', 'unsupported')"
2126
+ },
2127
+ "ui_instances_granted_capabilities_json_ck": {
2128
+ "name": "ui_instances_granted_capabilities_json_ck",
2129
+ "value": "json_valid(\"ui_instances\".\"granted_capabilities_json\") AND json_type(\"ui_instances\".\"granted_capabilities_json\") = 'array'"
2130
+ },
2131
+ "ui_instances_opened_by_json_ck": {
2132
+ "name": "ui_instances_opened_by_json_ck",
2133
+ "value": "\"ui_instances\".\"opened_by_json\" IS NULL OR (json_valid(\"ui_instances\".\"opened_by_json\") AND json_type(\"ui_instances\".\"opened_by_json\") = 'object')"
2134
+ },
2135
+ "ui_instances_created_at_ck": {
2136
+ "name": "ui_instances_created_at_ck",
2137
+ "value": "\"ui_instances\".\"created_at\" >= 0"
2138
+ },
2139
+ "ui_instances_updated_at_ck": {
2140
+ "name": "ui_instances_updated_at_ck",
2141
+ "value": "\"ui_instances\".\"updated_at\" >= \"ui_instances\".\"created_at\""
2142
+ }
2143
+ }
2144
+ },
2145
+ "ui_action_receipts": {
2146
+ "name": "ui_action_receipts",
2147
+ "columns": {
2148
+ "id": {
2149
+ "name": "id",
2150
+ "type": "text",
2151
+ "primaryKey": true,
2152
+ "notNull": true,
2153
+ "autoincrement": false
2154
+ },
2155
+ "instance_id": {
2156
+ "name": "instance_id",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true,
2160
+ "autoincrement": false
2161
+ },
2162
+ "definition_id": {
2163
+ "name": "definition_id",
2164
+ "type": "text",
2165
+ "primaryKey": false,
2166
+ "notNull": false,
2167
+ "autoincrement": false
2168
+ },
2169
+ "definition_version": {
2170
+ "name": "definition_version",
2171
+ "type": "integer",
2172
+ "primaryKey": false,
2173
+ "notNull": false,
2174
+ "autoincrement": false
2175
+ },
2176
+ "definition_hash": {
2177
+ "name": "definition_hash",
2178
+ "type": "text",
2179
+ "primaryKey": false,
2180
+ "notNull": false,
2181
+ "autoincrement": false
2182
+ },
2183
+ "request_id": {
2184
+ "name": "request_id",
2185
+ "type": "text",
2186
+ "primaryKey": false,
2187
+ "notNull": true,
2188
+ "autoincrement": false
2189
+ },
2190
+ "action_id": {
2191
+ "name": "action_id",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": true,
2195
+ "autoincrement": false
2196
+ },
2197
+ "actor_json": {
2198
+ "name": "actor_json",
2199
+ "type": "text",
2200
+ "primaryKey": false,
2201
+ "notNull": true,
2202
+ "autoincrement": false
2203
+ },
2204
+ "source": {
2205
+ "name": "source",
2206
+ "type": "text",
2207
+ "primaryKey": false,
2208
+ "notNull": true,
2209
+ "autoincrement": false
2210
+ },
2211
+ "expected_revision": {
2212
+ "name": "expected_revision",
2213
+ "type": "integer",
2214
+ "primaryKey": false,
2215
+ "notNull": true,
2216
+ "autoincrement": false
2217
+ },
2218
+ "before_revision": {
2219
+ "name": "before_revision",
2220
+ "type": "integer",
2221
+ "primaryKey": false,
2222
+ "notNull": true,
2223
+ "autoincrement": false
2224
+ },
2225
+ "after_revision": {
2226
+ "name": "after_revision",
2227
+ "type": "integer",
2228
+ "primaryKey": false,
2229
+ "notNull": false,
2230
+ "autoincrement": false
2231
+ },
2232
+ "status": {
2233
+ "name": "status",
2234
+ "type": "text",
2235
+ "primaryKey": false,
2236
+ "notNull": true,
2237
+ "autoincrement": false
2238
+ },
2239
+ "outcome": {
2240
+ "name": "outcome",
2241
+ "type": "text",
2242
+ "primaryKey": false,
2243
+ "notNull": false,
2244
+ "autoincrement": false
2245
+ },
2246
+ "input_json": {
2247
+ "name": "input_json",
2248
+ "type": "text",
2249
+ "primaryKey": false,
2250
+ "notNull": true,
2251
+ "autoincrement": false
2252
+ },
2253
+ "result_json": {
2254
+ "name": "result_json",
2255
+ "type": "text",
2256
+ "primaryKey": false,
2257
+ "notNull": false,
2258
+ "autoincrement": false
2259
+ },
2260
+ "error_code": {
2261
+ "name": "error_code",
2262
+ "type": "text",
2263
+ "primaryKey": false,
2264
+ "notNull": false,
2265
+ "autoincrement": false
2266
+ },
2267
+ "requested_at": {
2268
+ "name": "requested_at",
2269
+ "type": "integer",
2270
+ "primaryKey": false,
2271
+ "notNull": true,
2272
+ "autoincrement": false
2273
+ },
2274
+ "settled_at": {
2275
+ "name": "settled_at",
2276
+ "type": "integer",
2277
+ "primaryKey": false,
2278
+ "notNull": false,
2279
+ "autoincrement": false
2280
+ }
2281
+ },
2282
+ "indexes": {
2283
+ "ui_action_receipts_instance_request_uq": {
2284
+ "name": "ui_action_receipts_instance_request_uq",
2285
+ "columns": [
2286
+ "instance_id",
2287
+ "request_id"
2288
+ ],
2289
+ "isUnique": true
2290
+ },
2291
+ "ui_action_receipts_instance_id_idx": {
2292
+ "name": "ui_action_receipts_instance_id_idx",
2293
+ "columns": [
2294
+ "instance_id"
2295
+ ],
2296
+ "isUnique": false
2297
+ },
2298
+ "ui_action_receipts_requested_at_idx": {
2299
+ "name": "ui_action_receipts_requested_at_idx",
2300
+ "columns": [
2301
+ "requested_at"
2302
+ ],
2303
+ "isUnique": false
2304
+ }
2305
+ },
2306
+ "foreignKeys": {},
2307
+ "compositePrimaryKeys": {},
2308
+ "uniqueConstraints": {},
2309
+ "checkConstraints": {
2310
+ "ui_action_receipts_id_ck": {
2311
+ "name": "ui_action_receipts_id_ck",
2312
+ "value": "length(\"ui_action_receipts\".\"id\") BETWEEN 5 AND 128"
2313
+ },
2314
+ "ui_action_receipts_instance_id_ck": {
2315
+ "name": "ui_action_receipts_instance_id_ck",
2316
+ "value": "length(\"ui_action_receipts\".\"instance_id\") BETWEEN 1 AND 128"
2317
+ },
2318
+ "ui_action_receipts_request_id_ck": {
2319
+ "name": "ui_action_receipts_request_id_ck",
2320
+ "value": "length(\"ui_action_receipts\".\"request_id\") BETWEEN 1 AND 128"
2321
+ },
2322
+ "ui_action_receipts_action_id_ck": {
2323
+ "name": "ui_action_receipts_action_id_ck",
2324
+ "value": "length(\"ui_action_receipts\".\"action_id\") BETWEEN 1 AND 128"
2325
+ },
2326
+ "ui_action_receipts_actor_json_ck": {
2327
+ "name": "ui_action_receipts_actor_json_ck",
2328
+ "value": "json_valid(\"ui_action_receipts\".\"actor_json\") AND json_type(\"ui_action_receipts\".\"actor_json\") = 'object'"
2329
+ },
2330
+ "ui_action_receipts_source_ck": {
2331
+ "name": "ui_action_receipts_source_ck",
2332
+ "value": "\"ui_action_receipts\".\"source\" IN ('ui_host', 'cli', 'system', 'mcp')"
2333
+ },
2334
+ "ui_action_receipts_expected_revision_ck": {
2335
+ "name": "ui_action_receipts_expected_revision_ck",
2336
+ "value": "\"ui_action_receipts\".\"expected_revision\" >= 0"
2337
+ },
2338
+ "ui_action_receipts_before_revision_ck": {
2339
+ "name": "ui_action_receipts_before_revision_ck",
2340
+ "value": "\"ui_action_receipts\".\"before_revision\" >= 0"
2341
+ },
2342
+ "ui_action_receipts_after_revision_ck": {
2343
+ "name": "ui_action_receipts_after_revision_ck",
2344
+ "value": "\"ui_action_receipts\".\"after_revision\" IS NULL OR \"ui_action_receipts\".\"after_revision\" >= 0"
2345
+ },
2346
+ "ui_action_receipts_status_ck": {
2347
+ "name": "ui_action_receipts_status_ck",
2348
+ "value": "\"ui_action_receipts\".\"status\" IN ('requested', 'settled')"
2349
+ },
2350
+ "ui_action_receipts_outcome_ck": {
2351
+ "name": "ui_action_receipts_outcome_ck",
2352
+ "value": "\"ui_action_receipts\".\"outcome\" IS NULL OR \"ui_action_receipts\".\"outcome\" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')"
2353
+ },
2354
+ "ui_action_receipts_input_json_ck": {
2355
+ "name": "ui_action_receipts_input_json_ck",
2356
+ "value": "json_valid(\"ui_action_receipts\".\"input_json\") AND json_type(\"ui_action_receipts\".\"input_json\") = 'object'"
2357
+ },
2358
+ "ui_action_receipts_result_json_ck": {
2359
+ "name": "ui_action_receipts_result_json_ck",
2360
+ "value": "\"ui_action_receipts\".\"result_json\" IS NULL OR (json_valid(\"ui_action_receipts\".\"result_json\") AND json_type(\"ui_action_receipts\".\"result_json\") = 'object')"
2361
+ },
2362
+ "ui_action_receipts_requested_at_ck": {
2363
+ "name": "ui_action_receipts_requested_at_ck",
2364
+ "value": "\"ui_action_receipts\".\"requested_at\" >= 0"
2365
+ },
2366
+ "ui_action_receipts_settled_at_ck": {
2367
+ "name": "ui_action_receipts_settled_at_ck",
2368
+ "value": "\"ui_action_receipts\".\"settled_at\" IS NULL OR \"ui_action_receipts\".\"settled_at\" >= \"ui_action_receipts\".\"requested_at\""
2369
+ },
2370
+ "ui_action_receipts_status_transition_ck": {
2371
+ "name": "ui_action_receipts_status_transition_ck",
2372
+ "value": "(\n (\"ui_action_receipts\".\"status\" = 'requested' AND \"ui_action_receipts\".\"after_revision\" IS NULL AND \"ui_action_receipts\".\"outcome\" IS NULL AND \"ui_action_receipts\".\"settled_at\" IS NULL)\n OR\n (\"ui_action_receipts\".\"status\" = 'settled' AND \"ui_action_receipts\".\"after_revision\" IS NOT NULL AND \"ui_action_receipts\".\"outcome\" IS NOT NULL AND \"ui_action_receipts\".\"settled_at\" IS NOT NULL)\n )"
2373
+ }
2374
+ }
2375
+ },
2376
+ "ui_instance_repins": {
2377
+ "name": "ui_instance_repins",
2378
+ "columns": {
2379
+ "instance_id": {
2380
+ "name": "instance_id",
2381
+ "type": "text",
2382
+ "primaryKey": false,
2383
+ "notNull": true,
2384
+ "autoincrement": false
2385
+ },
2386
+ "from_version": {
2387
+ "name": "from_version",
2388
+ "type": "integer",
2389
+ "primaryKey": false,
2390
+ "notNull": true,
2391
+ "autoincrement": false
2392
+ },
2393
+ "from_hash": {
2394
+ "name": "from_hash",
2395
+ "type": "text",
2396
+ "primaryKey": false,
2397
+ "notNull": true,
2398
+ "autoincrement": false
2399
+ },
2400
+ "to_version": {
2401
+ "name": "to_version",
2402
+ "type": "integer",
2403
+ "primaryKey": false,
2404
+ "notNull": true,
2405
+ "autoincrement": false
2406
+ },
2407
+ "to_hash": {
2408
+ "name": "to_hash",
2409
+ "type": "text",
2410
+ "primaryKey": false,
2411
+ "notNull": true,
2412
+ "autoincrement": false
2413
+ },
2414
+ "from_revision": {
2415
+ "name": "from_revision",
2416
+ "type": "integer",
2417
+ "primaryKey": false,
2418
+ "notNull": true,
2419
+ "autoincrement": false
2420
+ },
2421
+ "to_revision": {
2422
+ "name": "to_revision",
2423
+ "type": "integer",
2424
+ "primaryKey": false,
2425
+ "notNull": false,
2426
+ "autoincrement": false
2427
+ },
2428
+ "status": {
2429
+ "name": "status",
2430
+ "type": "text",
2431
+ "primaryKey": false,
2432
+ "notNull": true,
2433
+ "autoincrement": false
2434
+ },
2435
+ "code": {
2436
+ "name": "code",
2437
+ "type": "text",
2438
+ "primaryKey": false,
2439
+ "notNull": false,
2440
+ "autoincrement": false
2441
+ },
2442
+ "attempts": {
2443
+ "name": "attempts",
2444
+ "type": "integer",
2445
+ "primaryKey": false,
2446
+ "notNull": true,
2447
+ "autoincrement": false,
2448
+ "default": 1
2449
+ },
2450
+ "first_at": {
2451
+ "name": "first_at",
2452
+ "type": "integer",
2453
+ "primaryKey": false,
2454
+ "notNull": true,
2455
+ "autoincrement": false
2456
+ },
2457
+ "last_at": {
2458
+ "name": "last_at",
2459
+ "type": "integer",
2460
+ "primaryKey": false,
2461
+ "notNull": true,
2462
+ "autoincrement": false
2463
+ }
2464
+ },
2465
+ "indexes": {},
2466
+ "foreignKeys": {},
2467
+ "compositePrimaryKeys": {
2468
+ "ui_instance_repins_pk": {
2469
+ "columns": [
2470
+ "instance_id",
2471
+ "to_hash"
2472
+ ],
2473
+ "name": "ui_instance_repins_pk"
2474
+ }
2475
+ },
2476
+ "uniqueConstraints": {},
2477
+ "checkConstraints": {
2478
+ "ui_instance_repins_instance_id_ck": {
2479
+ "name": "ui_instance_repins_instance_id_ck",
2480
+ "value": "length(\"ui_instance_repins\".\"instance_id\") BETWEEN 5 AND 128 AND \"ui_instance_repins\".\"instance_id\" GLOB 'uic_*'"
2481
+ },
2482
+ "ui_instance_repins_from_version_ck": {
2483
+ "name": "ui_instance_repins_from_version_ck",
2484
+ "value": "\"ui_instance_repins\".\"from_version\" >= 1"
2485
+ },
2486
+ "ui_instance_repins_to_version_ck": {
2487
+ "name": "ui_instance_repins_to_version_ck",
2488
+ "value": "\"ui_instance_repins\".\"to_version\" >= 1"
2489
+ },
2490
+ "ui_instance_repins_from_hash_ck": {
2491
+ "name": "ui_instance_repins_from_hash_ck",
2492
+ "value": "length(\"ui_instance_repins\".\"from_hash\") = 64 AND \"ui_instance_repins\".\"from_hash\" NOT GLOB '*[^0-9a-f]*'"
2493
+ },
2494
+ "ui_instance_repins_to_hash_ck": {
2495
+ "name": "ui_instance_repins_to_hash_ck",
2496
+ "value": "length(\"ui_instance_repins\".\"to_hash\") = 64 AND \"ui_instance_repins\".\"to_hash\" NOT GLOB '*[^0-9a-f]*'"
2497
+ },
2498
+ "ui_instance_repins_from_revision_ck": {
2499
+ "name": "ui_instance_repins_from_revision_ck",
2500
+ "value": "\"ui_instance_repins\".\"from_revision\" >= 0"
2501
+ },
2502
+ "ui_instance_repins_to_revision_ck": {
2503
+ "name": "ui_instance_repins_to_revision_ck",
2504
+ "value": "\"ui_instance_repins\".\"to_revision\" IS NULL OR \"ui_instance_repins\".\"to_revision\" >= 0"
2505
+ },
2506
+ "ui_instance_repins_status_ck": {
2507
+ "name": "ui_instance_repins_status_ck",
2508
+ "value": "\"ui_instance_repins\".\"status\" IN ('applied', 'deferred', 'failed')"
2509
+ },
2510
+ "ui_instance_repins_attempts_ck": {
2511
+ "name": "ui_instance_repins_attempts_ck",
2512
+ "value": "\"ui_instance_repins\".\"attempts\" >= 1"
2513
+ },
2514
+ "ui_instance_repins_dates_ck": {
2515
+ "name": "ui_instance_repins_dates_ck",
2516
+ "value": "\"ui_instance_repins\".\"first_at\" >= 0 AND \"ui_instance_repins\".\"last_at\" >= \"ui_instance_repins\".\"first_at\""
2517
+ },
2518
+ "ui_instance_repins_result_ck": {
2519
+ "name": "ui_instance_repins_result_ck",
2520
+ "value": "(\n (\"ui_instance_repins\".\"status\" = 'applied' AND \"ui_instance_repins\".\"code\" IS NULL\n AND \"ui_instance_repins\".\"to_revision\" = \"ui_instance_repins\".\"from_revision\" + 1)\n OR\n (\"ui_instance_repins\".\"status\" IN ('deferred', 'failed') AND \"ui_instance_repins\".\"code\" IS NOT NULL\n AND \"ui_instance_repins\".\"to_revision\" IS NULL)\n )"
2521
+ }
2522
+ }
2523
+ },
2524
+ "ui_definition_archive": {
2525
+ "name": "ui_definition_archive",
2526
+ "columns": {
2527
+ "definition_hash": {
2528
+ "name": "definition_hash",
2529
+ "type": "text",
2530
+ "primaryKey": true,
2531
+ "notNull": true,
2532
+ "autoincrement": false
2533
+ },
2534
+ "definition_json": {
2535
+ "name": "definition_json",
2536
+ "type": "text",
2537
+ "primaryKey": false,
2538
+ "notNull": true,
2539
+ "autoincrement": false
2540
+ },
2541
+ "created_at": {
2542
+ "name": "created_at",
2543
+ "type": "integer",
2544
+ "primaryKey": false,
2545
+ "notNull": true,
2546
+ "autoincrement": false
2547
+ }
2548
+ },
2549
+ "indexes": {},
2550
+ "foreignKeys": {},
2551
+ "compositePrimaryKeys": {},
2552
+ "uniqueConstraints": {},
2553
+ "checkConstraints": {
2554
+ "ui_definition_archive_definition_hash_ck": {
2555
+ "name": "ui_definition_archive_definition_hash_ck",
2556
+ "value": "length(\"ui_definition_archive\".\"definition_hash\") = 64 AND \"ui_definition_archive\".\"definition_hash\" NOT GLOB '*[^0-9a-f]*'"
2557
+ },
2558
+ "ui_definition_archive_definition_json_ck": {
2559
+ "name": "ui_definition_archive_definition_json_ck",
2560
+ "value": "json_valid(\"ui_definition_archive\".\"definition_json\") AND json_type(\"ui_definition_archive\".\"definition_json\") = 'object'"
2561
+ },
2562
+ "ui_definition_archive_created_at_ck": {
2563
+ "name": "ui_definition_archive_created_at_ck",
2564
+ "value": "\"ui_definition_archive\".\"created_at\" >= 0"
2565
+ }
2566
+ }
2567
+ },
2568
+ "project_criteria": {
2569
+ "name": "project_criteria",
2570
+ "columns": {
2571
+ "id": {
2572
+ "name": "id",
2573
+ "type": "text",
2574
+ "primaryKey": true,
2575
+ "notNull": true,
2576
+ "autoincrement": false
2577
+ },
2578
+ "project_id": {
2579
+ "name": "project_id",
2580
+ "type": "text",
2581
+ "primaryKey": false,
2582
+ "notNull": true,
2583
+ "autoincrement": false
2584
+ },
2585
+ "position": {
2586
+ "name": "position",
2587
+ "type": "integer",
2588
+ "primaryKey": false,
2589
+ "notNull": true,
2590
+ "autoincrement": false
2591
+ },
2592
+ "statement": {
2593
+ "name": "statement",
2594
+ "type": "text",
2595
+ "primaryKey": false,
2596
+ "notNull": true,
2597
+ "autoincrement": false
2598
+ },
2599
+ "verify_status": {
2600
+ "name": "verify_status",
2601
+ "type": "text",
2602
+ "primaryKey": false,
2603
+ "notNull": true,
2604
+ "autoincrement": false,
2605
+ "default": "'pending'"
2606
+ },
2607
+ "verified_at": {
2608
+ "name": "verified_at",
2609
+ "type": "text",
2610
+ "primaryKey": false,
2611
+ "notNull": false,
2612
+ "autoincrement": false
2613
+ },
2614
+ "evidence_json": {
2615
+ "name": "evidence_json",
2616
+ "type": "text",
2617
+ "primaryKey": false,
2618
+ "notNull": true,
2619
+ "autoincrement": false,
2620
+ "default": "'[]'"
2621
+ },
2622
+ "created_at": {
2623
+ "name": "created_at",
2624
+ "type": "text",
2625
+ "primaryKey": false,
2626
+ "notNull": true,
2627
+ "autoincrement": false
2628
+ },
2629
+ "updated_at": {
2630
+ "name": "updated_at",
2631
+ "type": "text",
2632
+ "primaryKey": false,
2633
+ "notNull": true,
2634
+ "autoincrement": false
2635
+ }
2636
+ },
2637
+ "indexes": {
2638
+ "project_criteria_project_position_uq": {
2639
+ "name": "project_criteria_project_position_uq",
2640
+ "columns": [
2641
+ "project_id",
2642
+ "position"
2643
+ ],
2644
+ "isUnique": true
2645
+ }
2646
+ },
2647
+ "foreignKeys": {
2648
+ "project_criteria_project_id_projects_id_fk": {
2649
+ "name": "project_criteria_project_id_projects_id_fk",
2650
+ "tableFrom": "project_criteria",
2651
+ "tableTo": "projects",
2652
+ "columnsFrom": [
2653
+ "project_id"
2654
+ ],
2655
+ "columnsTo": [
2656
+ "id"
2657
+ ],
2658
+ "onDelete": "cascade",
2659
+ "onUpdate": "no action"
2660
+ }
2661
+ },
2662
+ "compositePrimaryKeys": {},
2663
+ "uniqueConstraints": {},
2664
+ "checkConstraints": {
2665
+ "project_criteria_id_ck": {
2666
+ "name": "project_criteria_id_ck",
2667
+ "value": "\"project_criteria\".\"id\" GLOB 'pjc_*'"
2668
+ },
2669
+ "project_criteria_verify_status_ck": {
2670
+ "name": "project_criteria_verify_status_ck",
2671
+ "value": "\"project_criteria\".\"verify_status\" IN ('pending', 'verifying', 'passed', 'failed')"
2672
+ },
2673
+ "project_criteria_evidence_json_ck": {
2674
+ "name": "project_criteria_evidence_json_ck",
2675
+ "value": "json_valid(\"project_criteria\".\"evidence_json\") AND json_type(\"project_criteria\".\"evidence_json\") = 'array'"
2676
+ }
2677
+ }
2678
+ },
2679
+ "project_events": {
2680
+ "name": "project_events",
2681
+ "columns": {
2682
+ "id": {
2683
+ "name": "id",
2684
+ "type": "text",
2685
+ "primaryKey": true,
2686
+ "notNull": true,
2687
+ "autoincrement": false
2688
+ },
2689
+ "project_id": {
2690
+ "name": "project_id",
2691
+ "type": "text",
2692
+ "primaryKey": false,
2693
+ "notNull": true,
2694
+ "autoincrement": false
2695
+ },
2696
+ "seq": {
2697
+ "name": "seq",
2698
+ "type": "integer",
2699
+ "primaryKey": false,
2700
+ "notNull": true,
2701
+ "autoincrement": false
2702
+ },
2703
+ "actor_type": {
2704
+ "name": "actor_type",
2705
+ "type": "text",
2706
+ "primaryKey": false,
2707
+ "notNull": true,
2708
+ "autoincrement": false
2709
+ },
2710
+ "actor_id": {
2711
+ "name": "actor_id",
2712
+ "type": "text",
2713
+ "primaryKey": false,
2714
+ "notNull": false,
2715
+ "autoincrement": false
2716
+ },
2717
+ "type": {
2718
+ "name": "type",
2719
+ "type": "text",
2720
+ "primaryKey": false,
2721
+ "notNull": true,
2722
+ "autoincrement": false
2723
+ },
2724
+ "title": {
2725
+ "name": "title",
2726
+ "type": "text",
2727
+ "primaryKey": false,
2728
+ "notNull": true,
2729
+ "autoincrement": false
2730
+ },
2731
+ "summary": {
2732
+ "name": "summary",
2733
+ "type": "text",
2734
+ "primaryKey": false,
2735
+ "notNull": false,
2736
+ "autoincrement": false
2737
+ },
2738
+ "payload_json": {
2739
+ "name": "payload_json",
2740
+ "type": "text",
2741
+ "primaryKey": false,
2742
+ "notNull": true,
2743
+ "autoincrement": false,
2744
+ "default": "'{}'"
2745
+ },
2746
+ "created_at": {
2747
+ "name": "created_at",
2748
+ "type": "text",
2749
+ "primaryKey": false,
2750
+ "notNull": true,
2751
+ "autoincrement": false
2752
+ }
2753
+ },
2754
+ "indexes": {
2755
+ "project_events_project_seq_uq": {
2756
+ "name": "project_events_project_seq_uq",
2757
+ "columns": [
2758
+ "project_id",
2759
+ "seq"
2760
+ ],
2761
+ "isUnique": true
2762
+ }
2763
+ },
2764
+ "foreignKeys": {
2765
+ "project_events_project_id_projects_id_fk": {
2766
+ "name": "project_events_project_id_projects_id_fk",
2767
+ "tableFrom": "project_events",
2768
+ "tableTo": "projects",
2769
+ "columnsFrom": [
2770
+ "project_id"
2771
+ ],
2772
+ "columnsTo": [
2773
+ "id"
2774
+ ],
2775
+ "onDelete": "restrict",
2776
+ "onUpdate": "no action"
2777
+ }
2778
+ },
2779
+ "compositePrimaryKeys": {},
2780
+ "uniqueConstraints": {},
2781
+ "checkConstraints": {
2782
+ "project_events_id_ck": {
2783
+ "name": "project_events_id_ck",
2784
+ "value": "\"project_events\".\"id\" GLOB 'pje_*'"
2785
+ },
2786
+ "project_events_actor_type_ck": {
2787
+ "name": "project_events_actor_type_ck",
2788
+ "value": "\"project_events\".\"actor_type\" IN ('user', 'project_manager', 'system')"
2789
+ },
2790
+ "project_events_payload_json_ck": {
2791
+ "name": "project_events_payload_json_ck",
2792
+ "value": "json_valid(\"project_events\".\"payload_json\") AND json_type(\"project_events\".\"payload_json\") = 'object'"
2793
+ }
2794
+ }
2795
+ },
2796
+ "projects": {
2797
+ "name": "projects",
2798
+ "columns": {
2799
+ "id": {
2800
+ "name": "id",
2801
+ "type": "text",
2802
+ "primaryKey": true,
2803
+ "notNull": true,
2804
+ "autoincrement": false
2805
+ },
2806
+ "workspace_id": {
2807
+ "name": "workspace_id",
2808
+ "type": "text",
2809
+ "primaryKey": false,
2810
+ "notNull": true,
2811
+ "autoincrement": false
2812
+ },
2813
+ "name": {
2814
+ "name": "name",
2815
+ "type": "text",
2816
+ "primaryKey": false,
2817
+ "notNull": true,
2818
+ "autoincrement": false
2819
+ },
2820
+ "outcome": {
2821
+ "name": "outcome",
2822
+ "type": "text",
2823
+ "primaryKey": false,
2824
+ "notNull": true,
2825
+ "autoincrement": false
2826
+ },
2827
+ "due_date": {
2828
+ "name": "due_date",
2829
+ "type": "text",
2830
+ "primaryKey": false,
2831
+ "notNull": false,
2832
+ "autoincrement": false
2833
+ },
2834
+ "scene": {
2835
+ "name": "scene",
2836
+ "type": "text",
2837
+ "primaryKey": false,
2838
+ "notNull": true,
2839
+ "autoincrement": false,
2840
+ "default": "'planning'"
2841
+ },
2842
+ "stages_json": {
2843
+ "name": "stages_json",
2844
+ "type": "text",
2845
+ "primaryKey": false,
2846
+ "notNull": true,
2847
+ "autoincrement": false
2848
+ },
2849
+ "stage_index": {
2850
+ "name": "stage_index",
2851
+ "type": "integer",
2852
+ "primaryKey": false,
2853
+ "notNull": true,
2854
+ "autoincrement": false
2855
+ },
2856
+ "created_at": {
2857
+ "name": "created_at",
2858
+ "type": "text",
2859
+ "primaryKey": false,
2860
+ "notNull": true,
2861
+ "autoincrement": false
2862
+ },
2863
+ "updated_at": {
2864
+ "name": "updated_at",
2865
+ "type": "text",
2866
+ "primaryKey": false,
2867
+ "notNull": true,
2868
+ "autoincrement": false
2869
+ },
2870
+ "accepted_at": {
2871
+ "name": "accepted_at",
2872
+ "type": "text",
2873
+ "primaryKey": false,
2874
+ "notNull": false,
2875
+ "autoincrement": false
2876
+ },
2877
+ "archived_at": {
2878
+ "name": "archived_at",
2879
+ "type": "text",
2880
+ "primaryKey": false,
2881
+ "notNull": false,
2882
+ "autoincrement": false
2883
+ }
2884
+ },
2885
+ "indexes": {},
2886
+ "foreignKeys": {},
2887
+ "compositePrimaryKeys": {},
2888
+ "uniqueConstraints": {},
2889
+ "checkConstraints": {
2890
+ "projects_id_ck": {
2891
+ "name": "projects_id_ck",
2892
+ "value": "\"projects\".\"id\" GLOB 'prj_*'"
2893
+ },
2894
+ "projects_scene_ck": {
2895
+ "name": "projects_scene_ck",
2896
+ "value": "\"projects\".\"scene\" IN ('planning', 'plan_review', 'running', 'human_wait', 'limit_wait', 'failed_stop', 'analyzing_feedback', 'replanned', 'awaiting_review', 'accepted')"
2897
+ },
2898
+ "projects_stages_json_ck": {
2899
+ "name": "projects_stages_json_ck",
2900
+ "value": "json_valid(\"projects\".\"stages_json\") AND json_type(\"projects\".\"stages_json\") = 'array'"
2901
+ },
2902
+ "projects_stage_index_ck": {
2903
+ "name": "projects_stage_index_ck",
2904
+ "value": "\"projects\".\"stage_index\" >= 1"
2905
+ }
2906
+ }
2907
+ },
2908
+ "common_codes": {
2909
+ "name": "common_codes",
2910
+ "columns": {
2911
+ "code_group": {
2912
+ "name": "code_group",
2913
+ "type": "text",
2914
+ "primaryKey": false,
2915
+ "notNull": true,
2916
+ "autoincrement": false
2917
+ },
2918
+ "code": {
2919
+ "name": "code",
2920
+ "type": "text",
2921
+ "primaryKey": false,
2922
+ "notNull": true,
2923
+ "autoincrement": false
2924
+ },
2925
+ "code_name": {
2926
+ "name": "code_name",
2927
+ "type": "text",
2928
+ "primaryKey": false,
2929
+ "notNull": false,
2930
+ "autoincrement": false
2931
+ },
2932
+ "color": {
2933
+ "name": "color",
2934
+ "type": "text",
2935
+ "primaryKey": false,
2936
+ "notNull": true,
2937
+ "autoincrement": false,
2938
+ "default": "'gray'"
2939
+ },
2940
+ "sort_order": {
2941
+ "name": "sort_order",
2942
+ "type": "integer",
2943
+ "primaryKey": false,
2944
+ "notNull": true,
2945
+ "autoincrement": false
2946
+ },
2947
+ "workspace_id": {
2948
+ "name": "workspace_id",
2949
+ "type": "text",
2950
+ "primaryKey": false,
2951
+ "notNull": false,
2952
+ "autoincrement": false
2953
+ },
2954
+ "is_builtin": {
2955
+ "name": "is_builtin",
2956
+ "type": "integer",
2957
+ "primaryKey": false,
2958
+ "notNull": true,
2959
+ "autoincrement": false,
2960
+ "default": 0
2961
+ },
2962
+ "is_archived": {
2963
+ "name": "is_archived",
2964
+ "type": "integer",
2965
+ "primaryKey": false,
2966
+ "notNull": true,
2967
+ "autoincrement": false,
2968
+ "default": 0
2969
+ },
2970
+ "metadata": {
2971
+ "name": "metadata",
2972
+ "type": "text",
2973
+ "primaryKey": false,
2974
+ "notNull": false,
2975
+ "autoincrement": false
2976
+ },
2977
+ "created_at": {
2978
+ "name": "created_at",
2979
+ "type": "text",
2980
+ "primaryKey": false,
2981
+ "notNull": true,
2982
+ "autoincrement": false
2983
+ },
2984
+ "updated_at": {
2985
+ "name": "updated_at",
2986
+ "type": "text",
2987
+ "primaryKey": false,
2988
+ "notNull": true,
2989
+ "autoincrement": false
2990
+ }
2991
+ },
2992
+ "indexes": {
2993
+ "idx_common_codes_group_archived_order": {
2994
+ "name": "idx_common_codes_group_archived_order",
2995
+ "columns": [
2996
+ "code_group",
2997
+ "is_archived",
2998
+ "sort_order"
2999
+ ],
3000
+ "isUnique": false
3001
+ }
3002
+ },
3003
+ "foreignKeys": {},
3004
+ "compositePrimaryKeys": {
3005
+ "common_codes_code_group_code_pk": {
3006
+ "columns": [
3007
+ "code_group",
3008
+ "code"
3009
+ ],
3010
+ "name": "common_codes_code_group_code_pk"
3011
+ }
3012
+ },
3013
+ "uniqueConstraints": {},
3014
+ "checkConstraints": {
3015
+ "common_codes_metadata_ck": {
3016
+ "name": "common_codes_metadata_ck",
3017
+ "value": "\"common_codes\".\"metadata\" IS NULL OR (json_valid(\"common_codes\".\"metadata\") AND json_type(\"common_codes\".\"metadata\") = 'object')"
3018
+ },
3019
+ "common_codes_builtin_ck": {
3020
+ "name": "common_codes_builtin_ck",
3021
+ "value": "\"common_codes\".\"is_builtin\" IN (0, 1)"
3022
+ },
3023
+ "common_codes_archived_ck": {
3024
+ "name": "common_codes_archived_ck",
3025
+ "value": "\"common_codes\".\"is_archived\" IN (0, 1)"
3026
+ }
3027
+ }
3028
+ },
3029
+ "thread_events": {
3030
+ "name": "thread_events",
3031
+ "columns": {
3032
+ "id": {
3033
+ "name": "id",
3034
+ "type": "text",
3035
+ "primaryKey": true,
3036
+ "notNull": true,
3037
+ "autoincrement": false
3038
+ },
3039
+ "thread_id": {
3040
+ "name": "thread_id",
3041
+ "type": "text",
3042
+ "primaryKey": false,
3043
+ "notNull": true,
3044
+ "autoincrement": false
3045
+ },
3046
+ "seq": {
3047
+ "name": "seq",
3048
+ "type": "integer",
3049
+ "primaryKey": false,
3050
+ "notNull": true,
3051
+ "autoincrement": false
3052
+ },
3053
+ "type": {
3054
+ "name": "type",
3055
+ "type": "text",
3056
+ "primaryKey": false,
3057
+ "notNull": true,
3058
+ "autoincrement": false
3059
+ },
3060
+ "actor_type": {
3061
+ "name": "actor_type",
3062
+ "type": "text",
3063
+ "primaryKey": false,
3064
+ "notNull": true,
3065
+ "autoincrement": false
3066
+ },
3067
+ "payload_json": {
3068
+ "name": "payload_json",
3069
+ "type": "text",
3070
+ "primaryKey": false,
3071
+ "notNull": true,
3072
+ "autoincrement": false
3073
+ },
3074
+ "created_at": {
3075
+ "name": "created_at",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": true,
3079
+ "autoincrement": false
3080
+ },
3081
+ "actor_id": {
3082
+ "name": "actor_id",
3083
+ "type": "text",
3084
+ "primaryKey": false,
3085
+ "notNull": false,
3086
+ "autoincrement": false
3087
+ },
3088
+ "task_id": {
3089
+ "name": "task_id",
3090
+ "type": "text",
3091
+ "primaryKey": false,
3092
+ "notNull": false,
3093
+ "autoincrement": false
3094
+ },
3095
+ "highlight_id": {
3096
+ "name": "highlight_id",
3097
+ "type": "text",
3098
+ "primaryKey": false,
3099
+ "notNull": false,
3100
+ "autoincrement": false
3101
+ }
3102
+ },
3103
+ "indexes": {
3104
+ "idx_thread_events_thread_seq": {
3105
+ "name": "idx_thread_events_thread_seq",
3106
+ "columns": [
3107
+ "thread_id",
3108
+ "seq"
3109
+ ],
3110
+ "isUnique": false
3111
+ },
3112
+ "idx_thread_events_thread_created": {
3113
+ "name": "idx_thread_events_thread_created",
3114
+ "columns": [
3115
+ "thread_id",
3116
+ "created_at"
3117
+ ],
3118
+ "isUnique": false
3119
+ },
3120
+ "thread_events_thread_seq_uq": {
3121
+ "name": "thread_events_thread_seq_uq",
3122
+ "columns": [
3123
+ "thread_id",
3124
+ "seq"
3125
+ ],
3126
+ "isUnique": true
3127
+ }
3128
+ },
3129
+ "foreignKeys": {
3130
+ "thread_events_thread_id_threads_id_fk": {
3131
+ "name": "thread_events_thread_id_threads_id_fk",
3132
+ "tableFrom": "thread_events",
3133
+ "tableTo": "threads",
3134
+ "columnsFrom": [
3135
+ "thread_id"
3136
+ ],
3137
+ "columnsTo": [
3138
+ "id"
3139
+ ],
3140
+ "onDelete": "cascade",
3141
+ "onUpdate": "no action"
3142
+ }
3143
+ },
3144
+ "compositePrimaryKeys": {},
3145
+ "uniqueConstraints": {},
3146
+ "checkConstraints": {
3147
+ "thread_events_type_ck": {
3148
+ "name": "thread_events_type_ck",
3149
+ "value": "\"thread_events\".\"type\" IN ('thread.snapshot.imported', 'thread.title.changed', 'thread.priority.changed', 'thread.state.changed', 'thread.highlight.created', 'thread.highlight.updated', 'thread.highlight.deleted', 'thread.highlights.regenerated')"
3150
+ },
3151
+ "thread_events_actor_type_ck": {
3152
+ "name": "thread_events_actor_type_ck",
3153
+ "value": "\"thread_events\".\"actor_type\" IN ('user', 'agent', 'system')"
3154
+ },
3155
+ "thread_events_payload_json_ck": {
3156
+ "name": "thread_events_payload_json_ck",
3157
+ "value": "json_valid(\"thread_events\".\"payload_json\") AND json_type(\"thread_events\".\"payload_json\") = 'object'"
3158
+ }
3159
+ }
3160
+ },
3161
+ "thread_highlight_runs": {
3162
+ "name": "thread_highlight_runs",
3163
+ "columns": {
3164
+ "id": {
3165
+ "name": "id",
3166
+ "type": "text",
3167
+ "primaryKey": true,
3168
+ "notNull": true,
3169
+ "autoincrement": false
3170
+ },
3171
+ "thread_id": {
3172
+ "name": "thread_id",
3173
+ "type": "text",
3174
+ "primaryKey": false,
3175
+ "notNull": true,
3176
+ "autoincrement": false
3177
+ },
3178
+ "request_id": {
3179
+ "name": "request_id",
3180
+ "type": "text",
3181
+ "primaryKey": false,
3182
+ "notNull": true,
3183
+ "autoincrement": false
3184
+ },
3185
+ "status": {
3186
+ "name": "status",
3187
+ "type": "text",
3188
+ "primaryKey": false,
3189
+ "notNull": true,
3190
+ "autoincrement": false
3191
+ },
3192
+ "detector_version": {
3193
+ "name": "detector_version",
3194
+ "type": "text",
3195
+ "primaryKey": false,
3196
+ "notNull": true,
3197
+ "autoincrement": false
3198
+ },
3199
+ "requested_at": {
3200
+ "name": "requested_at",
3201
+ "type": "text",
3202
+ "primaryKey": false,
3203
+ "notNull": true,
3204
+ "autoincrement": false
3205
+ },
3206
+ "started_at": {
3207
+ "name": "started_at",
3208
+ "type": "text",
3209
+ "primaryKey": false,
3210
+ "notNull": false,
3211
+ "autoincrement": false
3212
+ },
3213
+ "completed_at": {
3214
+ "name": "completed_at",
3215
+ "type": "text",
3216
+ "primaryKey": false,
3217
+ "notNull": false,
3218
+ "autoincrement": false
3219
+ },
3220
+ "error_code": {
3221
+ "name": "error_code",
3222
+ "type": "text",
3223
+ "primaryKey": false,
3224
+ "notNull": false,
3225
+ "autoincrement": false
3226
+ },
3227
+ "previous_auto_count": {
3228
+ "name": "previous_auto_count",
3229
+ "type": "integer",
3230
+ "primaryKey": false,
3231
+ "notNull": false,
3232
+ "autoincrement": false
3233
+ },
3234
+ "new_auto_count": {
3235
+ "name": "new_auto_count",
3236
+ "type": "integer",
3237
+ "primaryKey": false,
3238
+ "notNull": false,
3239
+ "autoincrement": false
3240
+ }
3241
+ },
3242
+ "indexes": {
3243
+ "thread_highlight_runs_thread_request_uq": {
3244
+ "name": "thread_highlight_runs_thread_request_uq",
3245
+ "columns": [
3246
+ "thread_id",
3247
+ "request_id"
3248
+ ],
3249
+ "isUnique": true
3250
+ },
3251
+ "thread_highlight_runs_in_progress_thread_uq": {
3252
+ "name": "thread_highlight_runs_in_progress_thread_uq",
3253
+ "columns": [
3254
+ "thread_id"
3255
+ ],
3256
+ "isUnique": true,
3257
+ "where": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running')"
3258
+ },
3259
+ "idx_thread_highlight_runs_thread_status_requested": {
3260
+ "name": "idx_thread_highlight_runs_thread_status_requested",
3261
+ "columns": [
3262
+ "thread_id",
3263
+ "status",
3264
+ "requested_at"
3265
+ ],
3266
+ "isUnique": false
3267
+ }
3268
+ },
3269
+ "foreignKeys": {
3270
+ "thread_highlight_runs_thread_id_threads_id_fk": {
3271
+ "name": "thread_highlight_runs_thread_id_threads_id_fk",
3272
+ "tableFrom": "thread_highlight_runs",
3273
+ "tableTo": "threads",
3274
+ "columnsFrom": [
3275
+ "thread_id"
3276
+ ],
3277
+ "columnsTo": [
3278
+ "id"
3279
+ ],
3280
+ "onDelete": "cascade",
3281
+ "onUpdate": "no action"
3282
+ }
3283
+ },
3284
+ "compositePrimaryKeys": {},
3285
+ "uniqueConstraints": {},
3286
+ "checkConstraints": {
3287
+ "thread_highlight_runs_status_ck": {
3288
+ "name": "thread_highlight_runs_status_ck",
3289
+ "value": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running', 'completed', 'failed')"
3290
+ },
3291
+ "thread_highlight_runs_counts_ck": {
3292
+ "name": "thread_highlight_runs_counts_ck",
3293
+ "value": "(\"thread_highlight_runs\".\"previous_auto_count\" IS NULL OR \"thread_highlight_runs\".\"previous_auto_count\" >= 0) AND (\"thread_highlight_runs\".\"new_auto_count\" IS NULL OR \"thread_highlight_runs\".\"new_auto_count\" >= 0)"
3294
+ }
3295
+ }
3296
+ },
3297
+ "thread_highlights": {
3298
+ "name": "thread_highlights",
3299
+ "columns": {
3300
+ "id": {
3301
+ "name": "id",
3302
+ "type": "text",
3303
+ "primaryKey": true,
3304
+ "notNull": true,
3305
+ "autoincrement": false
3306
+ },
3307
+ "thread_id": {
3308
+ "name": "thread_id",
3309
+ "type": "text",
3310
+ "primaryKey": false,
3311
+ "notNull": true,
3312
+ "autoincrement": false
3313
+ },
3314
+ "source": {
3315
+ "name": "source",
3316
+ "type": "text",
3317
+ "primaryKey": false,
3318
+ "notNull": true,
3319
+ "autoincrement": false
3320
+ },
3321
+ "kind": {
3322
+ "name": "kind",
3323
+ "type": "text",
3324
+ "primaryKey": false,
3325
+ "notNull": true,
3326
+ "autoincrement": false
3327
+ },
3328
+ "status": {
3329
+ "name": "status",
3330
+ "type": "text",
3331
+ "primaryKey": false,
3332
+ "notNull": true,
3333
+ "autoincrement": false,
3334
+ "default": "'active'"
3335
+ },
3336
+ "text": {
3337
+ "name": "text",
3338
+ "type": "text",
3339
+ "primaryKey": false,
3340
+ "notNull": false,
3341
+ "autoincrement": false
3342
+ },
3343
+ "covers_from_task_id": {
3344
+ "name": "covers_from_task_id",
3345
+ "type": "text",
3346
+ "primaryKey": false,
3347
+ "notNull": true,
3348
+ "autoincrement": false
3349
+ },
3350
+ "covers_to_task_id": {
3351
+ "name": "covers_to_task_id",
3352
+ "type": "text",
3353
+ "primaryKey": false,
3354
+ "notNull": true,
3355
+ "autoincrement": false
3356
+ },
3357
+ "revision": {
3358
+ "name": "revision",
3359
+ "type": "integer",
3360
+ "primaryKey": false,
3361
+ "notNull": true,
3362
+ "autoincrement": false,
3363
+ "default": 0
3364
+ },
3365
+ "created_at": {
3366
+ "name": "created_at",
3367
+ "type": "text",
3368
+ "primaryKey": false,
3369
+ "notNull": true,
3370
+ "autoincrement": false
3371
+ },
3372
+ "updated_at": {
3373
+ "name": "updated_at",
3374
+ "type": "text",
3375
+ "primaryKey": false,
3376
+ "notNull": true,
3377
+ "autoincrement": false
3378
+ },
3379
+ "agent_id": {
3380
+ "name": "agent_id",
3381
+ "type": "text",
3382
+ "primaryKey": false,
3383
+ "notNull": false,
3384
+ "autoincrement": false
3385
+ },
3386
+ "source_task_id": {
3387
+ "name": "source_task_id",
3388
+ "type": "text",
3389
+ "primaryKey": false,
3390
+ "notNull": false,
3391
+ "autoincrement": false
3392
+ },
3393
+ "detector_version": {
3394
+ "name": "detector_version",
3395
+ "type": "text",
3396
+ "primaryKey": false,
3397
+ "notNull": false,
3398
+ "autoincrement": false
3399
+ },
3400
+ "content_fingerprint": {
3401
+ "name": "content_fingerprint",
3402
+ "type": "text",
3403
+ "primaryKey": false,
3404
+ "notNull": false,
3405
+ "autoincrement": false
3406
+ },
3407
+ "dismissed_at": {
3408
+ "name": "dismissed_at",
3409
+ "type": "text",
3410
+ "primaryKey": false,
3411
+ "notNull": false,
3412
+ "autoincrement": false
3413
+ }
3414
+ },
3415
+ "indexes": {
3416
+ "idx_thread_highlights_thread_status_created": {
3417
+ "name": "idx_thread_highlights_thread_status_created",
3418
+ "columns": [
3419
+ "thread_id",
3420
+ "status",
3421
+ "created_at"
3422
+ ],
3423
+ "isUnique": false
3424
+ },
3425
+ "idx_thread_highlights_thread_covers": {
3426
+ "name": "idx_thread_highlights_thread_covers",
3427
+ "columns": [
3428
+ "thread_id",
3429
+ "covers_from_task_id",
3430
+ "covers_to_task_id"
3431
+ ],
3432
+ "isUnique": false
3433
+ },
3434
+ "thread_highlights_auto_idempotency_uq": {
3435
+ "name": "thread_highlights_auto_idempotency_uq",
3436
+ "columns": [
3437
+ "thread_id",
3438
+ "source_task_id",
3439
+ "detector_version",
3440
+ "content_fingerprint"
3441
+ ],
3442
+ "isUnique": true,
3443
+ "where": "\"thread_highlights\".\"source\" = 'auto'"
3444
+ }
3445
+ },
3446
+ "foreignKeys": {
3447
+ "thread_highlights_thread_id_threads_id_fk": {
3448
+ "name": "thread_highlights_thread_id_threads_id_fk",
3449
+ "tableFrom": "thread_highlights",
3450
+ "tableTo": "threads",
3451
+ "columnsFrom": [
3452
+ "thread_id"
3453
+ ],
3454
+ "columnsTo": [
3455
+ "id"
3456
+ ],
3457
+ "onDelete": "cascade",
3458
+ "onUpdate": "no action"
3459
+ }
3460
+ },
3461
+ "compositePrimaryKeys": {},
3462
+ "uniqueConstraints": {},
3463
+ "checkConstraints": {
3464
+ "thread_highlights_source_ck": {
3465
+ "name": "thread_highlights_source_ck",
3466
+ "value": "\"thread_highlights\".\"source\" IN ('auto', 'manual')"
3467
+ },
3468
+ "thread_highlights_kind_ck": {
3469
+ "name": "thread_highlights_kind_ck",
3470
+ "value": "\"thread_highlights\".\"kind\" IN ('decision', 'judgment', 'issue', 'result', 'pivot')"
3471
+ },
3472
+ "thread_highlights_status_ck": {
3473
+ "name": "thread_highlights_status_ck",
3474
+ "value": "\"thread_highlights\".\"status\" IN ('active', 'dismissed')"
3475
+ },
3476
+ "thread_highlights_active_text_ck": {
3477
+ "name": "thread_highlights_active_text_ck",
3478
+ "value": "\"thread_highlights\".\"status\" = 'dismissed' OR (\"thread_highlights\".\"text\" IS NOT NULL AND length(\"thread_highlights\".\"text\") > 0)"
3479
+ },
3480
+ "thread_highlights_covers_ck": {
3481
+ "name": "thread_highlights_covers_ck",
3482
+ "value": "length(\"thread_highlights\".\"covers_from_task_id\") > 0 AND length(\"thread_highlights\".\"covers_to_task_id\") > 0"
3483
+ },
3484
+ "thread_highlights_auto_key_ck": {
3485
+ "name": "thread_highlights_auto_key_ck",
3486
+ "value": "\"thread_highlights\".\"source\" = 'manual' OR (\"thread_highlights\".\"source\" = 'auto' AND \"thread_highlights\".\"source_task_id\" IS NOT NULL AND \"thread_highlights\".\"detector_version\" IS NOT NULL AND \"thread_highlights\".\"content_fingerprint\" IS NOT NULL AND length(\"thread_highlights\".\"source_task_id\") > 0 AND length(\"thread_highlights\".\"detector_version\") > 0 AND length(\"thread_highlights\".\"content_fingerprint\") > 0)"
3487
+ }
3488
+ }
3489
+ },
3490
+ "storage_metadata": {
3491
+ "name": "storage_metadata",
3492
+ "columns": {
3493
+ "source_kind": {
3494
+ "name": "source_kind",
3495
+ "type": "text",
3496
+ "primaryKey": false,
3497
+ "notNull": true,
3498
+ "autoincrement": false
3499
+ },
3500
+ "source_id": {
3501
+ "name": "source_id",
3502
+ "type": "text",
3503
+ "primaryKey": false,
3504
+ "notNull": true,
3505
+ "autoincrement": false
3506
+ },
3507
+ "utc_ts": {
3508
+ "name": "utc_ts",
3509
+ "type": "text",
3510
+ "primaryKey": false,
3511
+ "notNull": false,
3512
+ "autoincrement": false
3513
+ },
3514
+ "bytes": {
3515
+ "name": "bytes",
3516
+ "type": "integer",
3517
+ "primaryKey": false,
3518
+ "notNull": true,
3519
+ "autoincrement": false
3520
+ }
3521
+ },
3522
+ "indexes": {
3523
+ "idx_storage_metadata_kind_ts_bytes": {
3524
+ "name": "idx_storage_metadata_kind_ts_bytes",
3525
+ "columns": [
3526
+ "source_kind",
3527
+ "utc_ts",
3528
+ "bytes"
3529
+ ],
3530
+ "isUnique": false
3531
+ }
3532
+ },
3533
+ "foreignKeys": {},
3534
+ "compositePrimaryKeys": {
3535
+ "storage_metadata_source_kind_source_id_pk": {
3536
+ "columns": [
3537
+ "source_kind",
3538
+ "source_id"
3539
+ ],
3540
+ "name": "storage_metadata_source_kind_source_id_pk"
3541
+ }
3542
+ },
3543
+ "uniqueConstraints": {},
3544
+ "checkConstraints": {}
3545
+ },
3546
+ "storage_metadata_state": {
3547
+ "name": "storage_metadata_state",
3548
+ "columns": {
3549
+ "unit": {
3550
+ "name": "unit",
3551
+ "type": "text",
3552
+ "primaryKey": true,
3553
+ "notNull": true,
3554
+ "autoincrement": false
3555
+ },
3556
+ "cursor_rowid": {
3557
+ "name": "cursor_rowid",
3558
+ "type": "integer",
3559
+ "primaryKey": false,
3560
+ "notNull": true,
3561
+ "autoincrement": false,
3562
+ "default": 0
3563
+ },
3564
+ "end_rowid": {
3565
+ "name": "end_rowid",
3566
+ "type": "integer",
3567
+ "primaryKey": false,
3568
+ "notNull": false,
3569
+ "autoincrement": false
3570
+ },
3571
+ "complete": {
3572
+ "name": "complete",
3573
+ "type": "integer",
3574
+ "primaryKey": false,
3575
+ "notNull": true,
3576
+ "autoincrement": false,
3577
+ "default": 0
3578
+ },
3579
+ "updated_at": {
3580
+ "name": "updated_at",
3581
+ "type": "text",
3582
+ "primaryKey": false,
3583
+ "notNull": true,
3584
+ "autoincrement": false
3585
+ }
3586
+ },
3587
+ "indexes": {},
3588
+ "foreignKeys": {},
3589
+ "compositePrimaryKeys": {},
3590
+ "uniqueConstraints": {},
3591
+ "checkConstraints": {}
3592
+ },
3593
+ "agent_send_history": {
3594
+ "name": "agent_send_history",
3595
+ "columns": {
3596
+ "workspace_id": {
3597
+ "name": "workspace_id",
3598
+ "type": "text",
3599
+ "primaryKey": false,
3600
+ "notNull": true,
3601
+ "autoincrement": false
3602
+ },
3603
+ "actor_id": {
3604
+ "name": "actor_id",
3605
+ "type": "text",
3606
+ "primaryKey": false,
3607
+ "notNull": true,
3608
+ "autoincrement": false
3609
+ },
3610
+ "agent_id": {
3611
+ "name": "agent_id",
3612
+ "type": "text",
3613
+ "primaryKey": false,
3614
+ "notNull": true,
3615
+ "autoincrement": false
3616
+ },
3617
+ "last_accepted_at": {
3618
+ "name": "last_accepted_at",
3619
+ "type": "text",
3620
+ "primaryKey": false,
3621
+ "notNull": true,
3622
+ "autoincrement": false
3623
+ }
3624
+ },
3625
+ "indexes": {
3626
+ "idx_agent_send_history_recent": {
3627
+ "name": "idx_agent_send_history_recent",
3628
+ "columns": [
3629
+ "workspace_id",
3630
+ "actor_id",
3631
+ "last_accepted_at",
3632
+ "agent_id"
3633
+ ],
3634
+ "isUnique": false
3635
+ }
3636
+ },
3637
+ "foreignKeys": {},
3638
+ "compositePrimaryKeys": {
3639
+ "agent_send_history_workspace_id_actor_id_agent_id_pk": {
3640
+ "columns": [
3641
+ "workspace_id",
3642
+ "actor_id",
3643
+ "agent_id"
3644
+ ],
3645
+ "name": "agent_send_history_workspace_id_actor_id_agent_id_pk"
3646
+ }
3647
+ },
3648
+ "uniqueConstraints": {},
3649
+ "checkConstraints": {}
3650
+ }
3651
+ },
3652
+ "views": {},
3653
+ "enums": {},
3654
+ "_meta": {
3655
+ "schemas": {},
3656
+ "tables": {},
3657
+ "columns": {}
3658
+ },
3659
+ "internal": {
3660
+ "indexes": {
3661
+ "idx_threads_workspace_thread_state": {
3662
+ "columns": {
3663
+ "json_extract(metadata, '$.threadTitle.state')": {
3664
+ "isExpression": true
3665
+ }
3666
+ }
3667
+ },
3668
+ "idx_threads_workspace_thread_priority": {
3669
+ "columns": {
3670
+ "json_extract(metadata, '$.threadTitle.priority')": {
3671
+ "isExpression": true
3672
+ }
3673
+ }
3674
+ },
3675
+ "idx_notifications_ws_created": {
3676
+ "columns": {
3677
+ "\"created_at\" DESC": {
3678
+ "isExpression": true
3679
+ }
3680
+ }
3681
+ }
3682
+ }
3683
+ }
3684
+ }