@crewx/sdk 0.9.0-rc.83 → 0.9.0-rc.85

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,3047 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "5d10778d-7f1b-4e62-8de9-f9bfb9929491",
5
+ "prevId": "727f5573-7cdf-457b-bc25-ac8ff673cb2f",
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
+ "prompt": {
115
+ "name": "prompt",
116
+ "type": "text",
117
+ "primaryKey": false,
118
+ "notNull": true,
119
+ "autoincrement": false
120
+ },
121
+ "mode": {
122
+ "name": "mode",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true,
126
+ "autoincrement": false,
127
+ "default": "'execute'"
128
+ },
129
+ "status": {
130
+ "name": "status",
131
+ "type": "text",
132
+ "primaryKey": false,
133
+ "notNull": true,
134
+ "autoincrement": false,
135
+ "default": "'running'"
136
+ },
137
+ "result": {
138
+ "name": "result",
139
+ "type": "text",
140
+ "primaryKey": false,
141
+ "notNull": false,
142
+ "autoincrement": false
143
+ },
144
+ "error": {
145
+ "name": "error",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false,
149
+ "autoincrement": false
150
+ },
151
+ "started_at": {
152
+ "name": "started_at",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": true,
156
+ "autoincrement": false
157
+ },
158
+ "completed_at": {
159
+ "name": "completed_at",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": false,
163
+ "autoincrement": false
164
+ },
165
+ "duration_ms": {
166
+ "name": "duration_ms",
167
+ "type": "integer",
168
+ "primaryKey": false,
169
+ "notNull": false,
170
+ "autoincrement": false
171
+ },
172
+ "metadata": {
173
+ "name": "metadata",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": false,
177
+ "autoincrement": false
178
+ },
179
+ "workspace_id": {
180
+ "name": "workspace_id",
181
+ "type": "text",
182
+ "primaryKey": false,
183
+ "notNull": false,
184
+ "autoincrement": false
185
+ },
186
+ "trace_id": {
187
+ "name": "trace_id",
188
+ "type": "text",
189
+ "primaryKey": false,
190
+ "notNull": false,
191
+ "autoincrement": false
192
+ },
193
+ "parent_task_id": {
194
+ "name": "parent_task_id",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": false,
198
+ "autoincrement": false
199
+ },
200
+ "caller_agent_id": {
201
+ "name": "caller_agent_id",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": false,
205
+ "autoincrement": false
206
+ },
207
+ "model": {
208
+ "name": "model",
209
+ "type": "text",
210
+ "primaryKey": false,
211
+ "notNull": false,
212
+ "autoincrement": false
213
+ },
214
+ "platform": {
215
+ "name": "platform",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": false,
219
+ "autoincrement": false,
220
+ "default": "'cli'"
221
+ },
222
+ "crewx_version": {
223
+ "name": "crewx_version",
224
+ "type": "text",
225
+ "primaryKey": false,
226
+ "notNull": false,
227
+ "autoincrement": false
228
+ },
229
+ "input_tokens": {
230
+ "name": "input_tokens",
231
+ "type": "integer",
232
+ "primaryKey": false,
233
+ "notNull": false,
234
+ "autoincrement": false,
235
+ "default": 0
236
+ },
237
+ "output_tokens": {
238
+ "name": "output_tokens",
239
+ "type": "integer",
240
+ "primaryKey": false,
241
+ "notNull": false,
242
+ "autoincrement": false,
243
+ "default": 0
244
+ },
245
+ "cost_usd": {
246
+ "name": "cost_usd",
247
+ "type": "real",
248
+ "primaryKey": false,
249
+ "notNull": false,
250
+ "autoincrement": false,
251
+ "default": 0
252
+ },
253
+ "pid": {
254
+ "name": "pid",
255
+ "type": "integer",
256
+ "primaryKey": false,
257
+ "notNull": false,
258
+ "autoincrement": false
259
+ },
260
+ "rendered_prompt": {
261
+ "name": "rendered_prompt",
262
+ "type": "text",
263
+ "primaryKey": false,
264
+ "notNull": false,
265
+ "autoincrement": false
266
+ },
267
+ "command": {
268
+ "name": "command",
269
+ "type": "text",
270
+ "primaryKey": false,
271
+ "notNull": false,
272
+ "autoincrement": false
273
+ },
274
+ "coding_agent_command": {
275
+ "name": "coding_agent_command",
276
+ "type": "text",
277
+ "primaryKey": false,
278
+ "notNull": false,
279
+ "autoincrement": false
280
+ },
281
+ "exit_code": {
282
+ "name": "exit_code",
283
+ "type": "integer",
284
+ "primaryKey": false,
285
+ "notNull": false,
286
+ "autoincrement": false
287
+ },
288
+ "logs": {
289
+ "name": "logs",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": false,
293
+ "autoincrement": false
294
+ },
295
+ "log_storage": {
296
+ "name": "log_storage",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": true,
300
+ "autoincrement": false,
301
+ "default": "'blob'"
302
+ },
303
+ "last_log_seq": {
304
+ "name": "last_log_seq",
305
+ "type": "integer",
306
+ "primaryKey": false,
307
+ "notNull": true,
308
+ "autoincrement": false,
309
+ "default": 0
310
+ },
311
+ "log_revision": {
312
+ "name": "log_revision",
313
+ "type": "integer",
314
+ "primaryKey": false,
315
+ "notNull": true,
316
+ "autoincrement": false,
317
+ "default": 0
318
+ },
319
+ "thread_id": {
320
+ "name": "thread_id",
321
+ "type": "text",
322
+ "primaryKey": false,
323
+ "notNull": false,
324
+ "autoincrement": false
325
+ },
326
+ "workspace_ref": {
327
+ "name": "workspace_ref",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": false,
331
+ "autoincrement": false
332
+ },
333
+ "project_id": {
334
+ "name": "project_id",
335
+ "type": "text",
336
+ "primaryKey": false,
337
+ "notNull": false,
338
+ "autoincrement": false
339
+ },
340
+ "project_ref": {
341
+ "name": "project_ref",
342
+ "type": "text",
343
+ "primaryKey": false,
344
+ "notNull": false,
345
+ "autoincrement": false
346
+ },
347
+ "cached_input_tokens": {
348
+ "name": "cached_input_tokens",
349
+ "type": "integer",
350
+ "primaryKey": false,
351
+ "notNull": false,
352
+ "autoincrement": false,
353
+ "default": 0
354
+ },
355
+ "run_epoch": {
356
+ "name": "run_epoch",
357
+ "type": "integer",
358
+ "primaryKey": false,
359
+ "notNull": false,
360
+ "autoincrement": false,
361
+ "default": 0
362
+ }
363
+ },
364
+ "indexes": {
365
+ "idx_tasks_agent_id": {
366
+ "name": "idx_tasks_agent_id",
367
+ "columns": [
368
+ "agent_id"
369
+ ],
370
+ "isUnique": false
371
+ },
372
+ "idx_tasks_status": {
373
+ "name": "idx_tasks_status",
374
+ "columns": [
375
+ "status"
376
+ ],
377
+ "isUnique": false
378
+ },
379
+ "idx_tasks_started_at": {
380
+ "name": "idx_tasks_started_at",
381
+ "columns": [
382
+ "started_at"
383
+ ],
384
+ "isUnique": false
385
+ },
386
+ "idx_tasks_trace_id": {
387
+ "name": "idx_tasks_trace_id",
388
+ "columns": [
389
+ "trace_id"
390
+ ],
391
+ "isUnique": false
392
+ },
393
+ "idx_tasks_parent_task_id": {
394
+ "name": "idx_tasks_parent_task_id",
395
+ "columns": [
396
+ "parent_task_id"
397
+ ],
398
+ "isUnique": false
399
+ },
400
+ "idx_tasks_crewx_version": {
401
+ "name": "idx_tasks_crewx_version",
402
+ "columns": [
403
+ "crewx_version"
404
+ ],
405
+ "isUnique": false
406
+ },
407
+ "idx_tasks_pid": {
408
+ "name": "idx_tasks_pid",
409
+ "columns": [
410
+ "pid"
411
+ ],
412
+ "isUnique": false
413
+ },
414
+ "idx_tasks_thread_id": {
415
+ "name": "idx_tasks_thread_id",
416
+ "columns": [
417
+ "thread_id"
418
+ ],
419
+ "isUnique": false
420
+ },
421
+ "idx_tasks_workspace_id": {
422
+ "name": "idx_tasks_workspace_id",
423
+ "columns": [
424
+ "workspace_id"
425
+ ],
426
+ "isUnique": false
427
+ },
428
+ "idx_tasks_workspace_ref": {
429
+ "name": "idx_tasks_workspace_ref",
430
+ "columns": [
431
+ "workspace_ref"
432
+ ],
433
+ "isUnique": false
434
+ },
435
+ "idx_tasks_project_id": {
436
+ "name": "idx_tasks_project_id",
437
+ "columns": [
438
+ "project_id"
439
+ ],
440
+ "isUnique": false
441
+ },
442
+ "idx_tasks_ws_started": {
443
+ "name": "idx_tasks_ws_started",
444
+ "columns": [
445
+ "workspace_id",
446
+ "started_at"
447
+ ],
448
+ "isUnique": false
449
+ }
450
+ },
451
+ "foreignKeys": {},
452
+ "compositePrimaryKeys": {},
453
+ "uniqueConstraints": {},
454
+ "checkConstraints": {
455
+ "tasks_log_storage_ck": {
456
+ "name": "tasks_log_storage_ck",
457
+ "value": "\"tasks\".\"log_storage\" IN ('blob', 'events')"
458
+ }
459
+ }
460
+ },
461
+ "task_log_events": {
462
+ "name": "task_log_events",
463
+ "columns": {
464
+ "id": {
465
+ "name": "id",
466
+ "type": "integer",
467
+ "primaryKey": true,
468
+ "notNull": true,
469
+ "autoincrement": false
470
+ },
471
+ "task_id": {
472
+ "name": "task_id",
473
+ "type": "text",
474
+ "primaryKey": false,
475
+ "notNull": true,
476
+ "autoincrement": false
477
+ },
478
+ "seq": {
479
+ "name": "seq",
480
+ "type": "integer",
481
+ "primaryKey": false,
482
+ "notNull": true,
483
+ "autoincrement": false
484
+ },
485
+ "timestamp": {
486
+ "name": "timestamp",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true,
490
+ "autoincrement": false
491
+ },
492
+ "level": {
493
+ "name": "level",
494
+ "type": "text",
495
+ "primaryKey": false,
496
+ "notNull": true,
497
+ "autoincrement": false
498
+ },
499
+ "message": {
500
+ "name": "message",
501
+ "type": "text",
502
+ "primaryKey": false,
503
+ "notNull": true,
504
+ "autoincrement": false
505
+ }
506
+ },
507
+ "indexes": {
508
+ "task_log_events_task_seq_uq": {
509
+ "name": "task_log_events_task_seq_uq",
510
+ "columns": [
511
+ "task_id",
512
+ "seq"
513
+ ],
514
+ "isUnique": true
515
+ },
516
+ "task_log_events_timestamp_id_idx": {
517
+ "name": "task_log_events_timestamp_id_idx",
518
+ "columns": [
519
+ "timestamp",
520
+ "id"
521
+ ],
522
+ "isUnique": false
523
+ }
524
+ },
525
+ "foreignKeys": {
526
+ "task_log_events_task_id_tasks_id_fk": {
527
+ "name": "task_log_events_task_id_tasks_id_fk",
528
+ "tableFrom": "task_log_events",
529
+ "tableTo": "tasks",
530
+ "columnsFrom": [
531
+ "task_id"
532
+ ],
533
+ "columnsTo": [
534
+ "id"
535
+ ],
536
+ "onDelete": "cascade",
537
+ "onUpdate": "no action"
538
+ }
539
+ },
540
+ "compositePrimaryKeys": {},
541
+ "uniqueConstraints": {},
542
+ "checkConstraints": {}
543
+ },
544
+ "threads": {
545
+ "name": "threads",
546
+ "columns": {
547
+ "id": {
548
+ "name": "id",
549
+ "type": "text",
550
+ "primaryKey": true,
551
+ "notNull": true,
552
+ "autoincrement": false
553
+ },
554
+ "workspace_id": {
555
+ "name": "workspace_id",
556
+ "type": "text",
557
+ "primaryKey": false,
558
+ "notNull": false,
559
+ "autoincrement": false
560
+ },
561
+ "platform": {
562
+ "name": "platform",
563
+ "type": "text",
564
+ "primaryKey": false,
565
+ "notNull": true,
566
+ "autoincrement": false,
567
+ "default": "'cli'"
568
+ },
569
+ "title": {
570
+ "name": "title",
571
+ "type": "text",
572
+ "primaryKey": false,
573
+ "notNull": false,
574
+ "autoincrement": false
575
+ },
576
+ "first_message": {
577
+ "name": "first_message",
578
+ "type": "text",
579
+ "primaryKey": false,
580
+ "notNull": false,
581
+ "autoincrement": false
582
+ },
583
+ "last_message": {
584
+ "name": "last_message",
585
+ "type": "text",
586
+ "primaryKey": false,
587
+ "notNull": false,
588
+ "autoincrement": false
589
+ },
590
+ "message_count": {
591
+ "name": "message_count",
592
+ "type": "integer",
593
+ "primaryKey": false,
594
+ "notNull": true,
595
+ "autoincrement": false,
596
+ "default": 0
597
+ },
598
+ "created_at": {
599
+ "name": "created_at",
600
+ "type": "text",
601
+ "primaryKey": false,
602
+ "notNull": true,
603
+ "autoincrement": false
604
+ },
605
+ "updated_at": {
606
+ "name": "updated_at",
607
+ "type": "text",
608
+ "primaryKey": false,
609
+ "notNull": true,
610
+ "autoincrement": false
611
+ },
612
+ "metadata": {
613
+ "name": "metadata",
614
+ "type": "text",
615
+ "primaryKey": false,
616
+ "notNull": false,
617
+ "autoincrement": false
618
+ },
619
+ "title_locked": {
620
+ "name": "title_locked",
621
+ "type": "integer",
622
+ "primaryKey": false,
623
+ "notNull": true,
624
+ "autoincrement": false,
625
+ "default": 0
626
+ },
627
+ "pinned": {
628
+ "name": "pinned",
629
+ "type": "integer",
630
+ "primaryKey": false,
631
+ "notNull": true,
632
+ "autoincrement": false,
633
+ "default": 0
634
+ },
635
+ "starred": {
636
+ "name": "starred",
637
+ "type": "integer",
638
+ "primaryKey": false,
639
+ "notNull": true,
640
+ "autoincrement": false,
641
+ "default": 0
642
+ }
643
+ },
644
+ "indexes": {
645
+ "idx_threads_updated_at": {
646
+ "name": "idx_threads_updated_at",
647
+ "columns": [
648
+ "updated_at"
649
+ ],
650
+ "isUnique": false
651
+ },
652
+ "idx_threads_workspace_id": {
653
+ "name": "idx_threads_workspace_id",
654
+ "columns": [
655
+ "workspace_id"
656
+ ],
657
+ "isUnique": false
658
+ },
659
+ "idx_threads_ws_updated": {
660
+ "name": "idx_threads_ws_updated",
661
+ "columns": [
662
+ "workspace_id",
663
+ "updated_at"
664
+ ],
665
+ "isUnique": false
666
+ },
667
+ "idx_threads_title": {
668
+ "name": "idx_threads_title",
669
+ "columns": [
670
+ "title"
671
+ ],
672
+ "isUnique": false
673
+ },
674
+ "idx_threads_workspace_thread_state": {
675
+ "name": "idx_threads_workspace_thread_state",
676
+ "columns": [
677
+ "workspace_id",
678
+ "json_extract(metadata, '$.threadTitle.state')"
679
+ ],
680
+ "isUnique": false
681
+ },
682
+ "idx_threads_workspace_thread_priority": {
683
+ "name": "idx_threads_workspace_thread_priority",
684
+ "columns": [
685
+ "workspace_id",
686
+ "json_extract(metadata, '$.threadTitle.priority')"
687
+ ],
688
+ "isUnique": false
689
+ }
690
+ },
691
+ "foreignKeys": {
692
+ "threads_workspace_id_workspaces_id_fk": {
693
+ "name": "threads_workspace_id_workspaces_id_fk",
694
+ "tableFrom": "threads",
695
+ "tableTo": "workspaces",
696
+ "columnsFrom": [
697
+ "workspace_id"
698
+ ],
699
+ "columnsTo": [
700
+ "id"
701
+ ],
702
+ "onDelete": "set null",
703
+ "onUpdate": "no action"
704
+ }
705
+ },
706
+ "compositePrimaryKeys": {},
707
+ "uniqueConstraints": {},
708
+ "checkConstraints": {}
709
+ },
710
+ "spans": {
711
+ "name": "spans",
712
+ "columns": {
713
+ "id": {
714
+ "name": "id",
715
+ "type": "text",
716
+ "primaryKey": true,
717
+ "notNull": true,
718
+ "autoincrement": false
719
+ },
720
+ "task_id": {
721
+ "name": "task_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": false,
725
+ "autoincrement": false
726
+ },
727
+ "parent_span_id": {
728
+ "name": "parent_span_id",
729
+ "type": "text",
730
+ "primaryKey": false,
731
+ "notNull": false,
732
+ "autoincrement": false
733
+ },
734
+ "name": {
735
+ "name": "name",
736
+ "type": "text",
737
+ "primaryKey": false,
738
+ "notNull": true,
739
+ "autoincrement": false
740
+ },
741
+ "kind": {
742
+ "name": "kind",
743
+ "type": "text",
744
+ "primaryKey": false,
745
+ "notNull": true,
746
+ "autoincrement": false,
747
+ "default": "'internal'"
748
+ },
749
+ "status": {
750
+ "name": "status",
751
+ "type": "text",
752
+ "primaryKey": false,
753
+ "notNull": true,
754
+ "autoincrement": false,
755
+ "default": "'ok'"
756
+ },
757
+ "started_at": {
758
+ "name": "started_at",
759
+ "type": "text",
760
+ "primaryKey": false,
761
+ "notNull": true,
762
+ "autoincrement": false
763
+ },
764
+ "completed_at": {
765
+ "name": "completed_at",
766
+ "type": "text",
767
+ "primaryKey": false,
768
+ "notNull": false,
769
+ "autoincrement": false
770
+ },
771
+ "duration_ms": {
772
+ "name": "duration_ms",
773
+ "type": "integer",
774
+ "primaryKey": false,
775
+ "notNull": false,
776
+ "autoincrement": false
777
+ },
778
+ "input": {
779
+ "name": "input",
780
+ "type": "text",
781
+ "primaryKey": false,
782
+ "notNull": false,
783
+ "autoincrement": false
784
+ },
785
+ "output": {
786
+ "name": "output",
787
+ "type": "text",
788
+ "primaryKey": false,
789
+ "notNull": false,
790
+ "autoincrement": false
791
+ },
792
+ "error": {
793
+ "name": "error",
794
+ "type": "text",
795
+ "primaryKey": false,
796
+ "notNull": false,
797
+ "autoincrement": false
798
+ },
799
+ "attributes": {
800
+ "name": "attributes",
801
+ "type": "text",
802
+ "primaryKey": false,
803
+ "notNull": false,
804
+ "autoincrement": false
805
+ }
806
+ },
807
+ "indexes": {
808
+ "idx_spans_task_id": {
809
+ "name": "idx_spans_task_id",
810
+ "columns": [
811
+ "task_id"
812
+ ],
813
+ "isUnique": false
814
+ },
815
+ "idx_spans_parent_span_id": {
816
+ "name": "idx_spans_parent_span_id",
817
+ "columns": [
818
+ "parent_span_id"
819
+ ],
820
+ "isUnique": false
821
+ }
822
+ },
823
+ "foreignKeys": {
824
+ "spans_task_id_tasks_id_fk": {
825
+ "name": "spans_task_id_tasks_id_fk",
826
+ "tableFrom": "spans",
827
+ "tableTo": "tasks",
828
+ "columnsFrom": [
829
+ "task_id"
830
+ ],
831
+ "columnsTo": [
832
+ "id"
833
+ ],
834
+ "onDelete": "set null",
835
+ "onUpdate": "no action"
836
+ },
837
+ "spans_parent_span_id_spans_id_fk": {
838
+ "name": "spans_parent_span_id_spans_id_fk",
839
+ "tableFrom": "spans",
840
+ "tableTo": "spans",
841
+ "columnsFrom": [
842
+ "parent_span_id"
843
+ ],
844
+ "columnsTo": [
845
+ "id"
846
+ ],
847
+ "onDelete": "set null",
848
+ "onUpdate": "no action"
849
+ }
850
+ },
851
+ "compositePrimaryKeys": {},
852
+ "uniqueConstraints": {},
853
+ "checkConstraints": {}
854
+ },
855
+ "tool_calls": {
856
+ "name": "tool_calls",
857
+ "columns": {
858
+ "id": {
859
+ "name": "id",
860
+ "type": "text",
861
+ "primaryKey": true,
862
+ "notNull": true,
863
+ "autoincrement": false
864
+ },
865
+ "task_id": {
866
+ "name": "task_id",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": false,
870
+ "autoincrement": false
871
+ },
872
+ "session_id": {
873
+ "name": "session_id",
874
+ "type": "text",
875
+ "primaryKey": false,
876
+ "notNull": false,
877
+ "autoincrement": false
878
+ },
879
+ "tool_name": {
880
+ "name": "tool_name",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": true,
884
+ "autoincrement": false
885
+ },
886
+ "files": {
887
+ "name": "files",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": false,
891
+ "autoincrement": false
892
+ },
893
+ "input": {
894
+ "name": "input",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false,
898
+ "autoincrement": false
899
+ },
900
+ "output": {
901
+ "name": "output",
902
+ "type": "text",
903
+ "primaryKey": false,
904
+ "notNull": false,
905
+ "autoincrement": false
906
+ },
907
+ "duration_ms": {
908
+ "name": "duration_ms",
909
+ "type": "integer",
910
+ "primaryKey": false,
911
+ "notNull": false,
912
+ "autoincrement": false
913
+ },
914
+ "timestamp": {
915
+ "name": "timestamp",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": true,
919
+ "autoincrement": false
920
+ }
921
+ },
922
+ "indexes": {
923
+ "idx_tool_calls_task_id": {
924
+ "name": "idx_tool_calls_task_id",
925
+ "columns": [
926
+ "task_id"
927
+ ],
928
+ "isUnique": false
929
+ },
930
+ "idx_tool_calls_tool_name": {
931
+ "name": "idx_tool_calls_tool_name",
932
+ "columns": [
933
+ "tool_name"
934
+ ],
935
+ "isUnique": false
936
+ },
937
+ "idx_tool_calls_timestamp": {
938
+ "name": "idx_tool_calls_timestamp",
939
+ "columns": [
940
+ "timestamp"
941
+ ],
942
+ "isUnique": false
943
+ }
944
+ },
945
+ "foreignKeys": {
946
+ "tool_calls_task_id_tasks_id_fk": {
947
+ "name": "tool_calls_task_id_tasks_id_fk",
948
+ "tableFrom": "tool_calls",
949
+ "tableTo": "tasks",
950
+ "columnsFrom": [
951
+ "task_id"
952
+ ],
953
+ "columnsTo": [
954
+ "id"
955
+ ],
956
+ "onDelete": "cascade",
957
+ "onUpdate": "no action"
958
+ }
959
+ },
960
+ "compositePrimaryKeys": {},
961
+ "uniqueConstraints": {},
962
+ "checkConstraints": {}
963
+ },
964
+ "thread_boxes": {
965
+ "name": "thread_boxes",
966
+ "columns": {
967
+ "id": {
968
+ "name": "id",
969
+ "type": "text",
970
+ "primaryKey": true,
971
+ "notNull": true,
972
+ "autoincrement": false
973
+ },
974
+ "thread_id": {
975
+ "name": "thread_id",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": true,
979
+ "autoincrement": false
980
+ },
981
+ "seq": {
982
+ "name": "seq",
983
+ "type": "integer",
984
+ "primaryKey": false,
985
+ "notNull": true,
986
+ "autoincrement": false
987
+ },
988
+ "first_task_id": {
989
+ "name": "first_task_id",
990
+ "type": "text",
991
+ "primaryKey": false,
992
+ "notNull": true,
993
+ "autoincrement": false
994
+ },
995
+ "mid_task_id": {
996
+ "name": "mid_task_id",
997
+ "type": "text",
998
+ "primaryKey": false,
999
+ "notNull": true,
1000
+ "autoincrement": false
1001
+ },
1002
+ "last_task_id": {
1003
+ "name": "last_task_id",
1004
+ "type": "text",
1005
+ "primaryKey": false,
1006
+ "notNull": true,
1007
+ "autoincrement": false
1008
+ },
1009
+ "task_count": {
1010
+ "name": "task_count",
1011
+ "type": "integer",
1012
+ "primaryKey": false,
1013
+ "notNull": true,
1014
+ "autoincrement": false
1015
+ },
1016
+ "summary": {
1017
+ "name": "summary",
1018
+ "type": "text",
1019
+ "primaryKey": false,
1020
+ "notNull": false,
1021
+ "autoincrement": false
1022
+ },
1023
+ "source_tokens": {
1024
+ "name": "source_tokens",
1025
+ "type": "integer",
1026
+ "primaryKey": false,
1027
+ "notNull": true,
1028
+ "autoincrement": false
1029
+ },
1030
+ "summary_tokens": {
1031
+ "name": "summary_tokens",
1032
+ "type": "integer",
1033
+ "primaryKey": false,
1034
+ "notNull": false,
1035
+ "autoincrement": false
1036
+ },
1037
+ "created_at": {
1038
+ "name": "created_at",
1039
+ "type": "text",
1040
+ "primaryKey": false,
1041
+ "notNull": true,
1042
+ "autoincrement": false
1043
+ }
1044
+ },
1045
+ "indexes": {
1046
+ "idx_thread_boxes_thread_id": {
1047
+ "name": "idx_thread_boxes_thread_id",
1048
+ "columns": [
1049
+ "thread_id"
1050
+ ],
1051
+ "isUnique": false
1052
+ },
1053
+ "idx_thread_boxes_seq": {
1054
+ "name": "idx_thread_boxes_seq",
1055
+ "columns": [
1056
+ "thread_id",
1057
+ "seq"
1058
+ ],
1059
+ "isUnique": false
1060
+ },
1061
+ "thread_boxes_thread_id_seq_unique": {
1062
+ "name": "thread_boxes_thread_id_seq_unique",
1063
+ "columns": [
1064
+ "thread_id",
1065
+ "seq"
1066
+ ],
1067
+ "isUnique": true
1068
+ }
1069
+ },
1070
+ "foreignKeys": {
1071
+ "thread_boxes_thread_id_threads_id_fk": {
1072
+ "name": "thread_boxes_thread_id_threads_id_fk",
1073
+ "tableFrom": "thread_boxes",
1074
+ "tableTo": "threads",
1075
+ "columnsFrom": [
1076
+ "thread_id"
1077
+ ],
1078
+ "columnsTo": [
1079
+ "id"
1080
+ ],
1081
+ "onDelete": "cascade",
1082
+ "onUpdate": "no action"
1083
+ }
1084
+ },
1085
+ "compositePrimaryKeys": {},
1086
+ "uniqueConstraints": {},
1087
+ "checkConstraints": {}
1088
+ },
1089
+ "request_logs": {
1090
+ "name": "request_logs",
1091
+ "columns": {
1092
+ "id": {
1093
+ "name": "id",
1094
+ "type": "text",
1095
+ "primaryKey": true,
1096
+ "notNull": true,
1097
+ "autoincrement": false
1098
+ },
1099
+ "path": {
1100
+ "name": "path",
1101
+ "type": "text",
1102
+ "primaryKey": false,
1103
+ "notNull": true,
1104
+ "autoincrement": false
1105
+ },
1106
+ "method": {
1107
+ "name": "method",
1108
+ "type": "text",
1109
+ "primaryKey": false,
1110
+ "notNull": true,
1111
+ "autoincrement": false
1112
+ },
1113
+ "status_code": {
1114
+ "name": "status_code",
1115
+ "type": "integer",
1116
+ "primaryKey": false,
1117
+ "notNull": true,
1118
+ "autoincrement": false
1119
+ },
1120
+ "duration_ms": {
1121
+ "name": "duration_ms",
1122
+ "type": "integer",
1123
+ "primaryKey": false,
1124
+ "notNull": true,
1125
+ "autoincrement": false
1126
+ },
1127
+ "ip": {
1128
+ "name": "ip",
1129
+ "type": "text",
1130
+ "primaryKey": false,
1131
+ "notNull": false,
1132
+ "autoincrement": false
1133
+ },
1134
+ "request_headers": {
1135
+ "name": "request_headers",
1136
+ "type": "text",
1137
+ "primaryKey": false,
1138
+ "notNull": false,
1139
+ "autoincrement": false
1140
+ },
1141
+ "response_headers": {
1142
+ "name": "response_headers",
1143
+ "type": "text",
1144
+ "primaryKey": false,
1145
+ "notNull": false,
1146
+ "autoincrement": false
1147
+ },
1148
+ "request_body": {
1149
+ "name": "request_body",
1150
+ "type": "text",
1151
+ "primaryKey": false,
1152
+ "notNull": false,
1153
+ "autoincrement": false
1154
+ },
1155
+ "response_body": {
1156
+ "name": "response_body",
1157
+ "type": "text",
1158
+ "primaryKey": false,
1159
+ "notNull": false,
1160
+ "autoincrement": false
1161
+ },
1162
+ "query": {
1163
+ "name": "query",
1164
+ "type": "text",
1165
+ "primaryKey": false,
1166
+ "notNull": false,
1167
+ "autoincrement": false
1168
+ },
1169
+ "user_id": {
1170
+ "name": "user_id",
1171
+ "type": "text",
1172
+ "primaryKey": false,
1173
+ "notNull": false,
1174
+ "autoincrement": false
1175
+ },
1176
+ "project_id": {
1177
+ "name": "project_id",
1178
+ "type": "text",
1179
+ "primaryKey": false,
1180
+ "notNull": false,
1181
+ "autoincrement": false
1182
+ },
1183
+ "partition_key": {
1184
+ "name": "partition_key",
1185
+ "type": "text",
1186
+ "primaryKey": false,
1187
+ "notNull": true,
1188
+ "autoincrement": false
1189
+ },
1190
+ "timestamp": {
1191
+ "name": "timestamp",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": true,
1195
+ "autoincrement": false,
1196
+ "default": "(datetime('now'))"
1197
+ },
1198
+ "metadata": {
1199
+ "name": "metadata",
1200
+ "type": "text",
1201
+ "primaryKey": false,
1202
+ "notNull": false,
1203
+ "autoincrement": false
1204
+ }
1205
+ },
1206
+ "indexes": {
1207
+ "idx_request_logs_timestamp": {
1208
+ "name": "idx_request_logs_timestamp",
1209
+ "columns": [
1210
+ "timestamp"
1211
+ ],
1212
+ "isUnique": false
1213
+ },
1214
+ "idx_request_logs_path": {
1215
+ "name": "idx_request_logs_path",
1216
+ "columns": [
1217
+ "path"
1218
+ ],
1219
+ "isUnique": false
1220
+ },
1221
+ "idx_request_logs_status_code": {
1222
+ "name": "idx_request_logs_status_code",
1223
+ "columns": [
1224
+ "status_code"
1225
+ ],
1226
+ "isUnique": false
1227
+ },
1228
+ "idx_request_logs_partition_key": {
1229
+ "name": "idx_request_logs_partition_key",
1230
+ "columns": [
1231
+ "partition_key"
1232
+ ],
1233
+ "isUnique": false
1234
+ }
1235
+ },
1236
+ "foreignKeys": {},
1237
+ "compositePrimaryKeys": {},
1238
+ "uniqueConstraints": {},
1239
+ "checkConstraints": {}
1240
+ },
1241
+ "usage_limit_snapshots": {
1242
+ "name": "usage_limit_snapshots",
1243
+ "columns": {
1244
+ "id": {
1245
+ "name": "id",
1246
+ "type": "text",
1247
+ "primaryKey": true,
1248
+ "notNull": true,
1249
+ "autoincrement": false
1250
+ },
1251
+ "provider": {
1252
+ "name": "provider",
1253
+ "type": "text",
1254
+ "primaryKey": false,
1255
+ "notNull": true,
1256
+ "autoincrement": false
1257
+ },
1258
+ "account_ref": {
1259
+ "name": "account_ref",
1260
+ "type": "text",
1261
+ "primaryKey": false,
1262
+ "notNull": true,
1263
+ "autoincrement": false,
1264
+ "default": "'default'"
1265
+ },
1266
+ "limit_window": {
1267
+ "name": "limit_window",
1268
+ "type": "text",
1269
+ "primaryKey": false,
1270
+ "notNull": true,
1271
+ "autoincrement": false
1272
+ },
1273
+ "bucket_start": {
1274
+ "name": "bucket_start",
1275
+ "type": "text",
1276
+ "primaryKey": false,
1277
+ "notNull": true,
1278
+ "autoincrement": false
1279
+ },
1280
+ "captured_at": {
1281
+ "name": "captured_at",
1282
+ "type": "text",
1283
+ "primaryKey": false,
1284
+ "notNull": true,
1285
+ "autoincrement": false
1286
+ },
1287
+ "used_percent": {
1288
+ "name": "used_percent",
1289
+ "type": "integer",
1290
+ "primaryKey": false,
1291
+ "notNull": true,
1292
+ "autoincrement": false
1293
+ },
1294
+ "remaining_percent": {
1295
+ "name": "remaining_percent",
1296
+ "type": "integer",
1297
+ "primaryKey": false,
1298
+ "notNull": true,
1299
+ "autoincrement": false
1300
+ },
1301
+ "resets_at": {
1302
+ "name": "resets_at",
1303
+ "type": "text",
1304
+ "primaryKey": false,
1305
+ "notNull": false,
1306
+ "autoincrement": false
1307
+ },
1308
+ "source": {
1309
+ "name": "source",
1310
+ "type": "text",
1311
+ "primaryKey": false,
1312
+ "notNull": true,
1313
+ "autoincrement": false
1314
+ },
1315
+ "metadata": {
1316
+ "name": "metadata",
1317
+ "type": "text",
1318
+ "primaryKey": false,
1319
+ "notNull": false,
1320
+ "autoincrement": false
1321
+ }
1322
+ },
1323
+ "indexes": {
1324
+ "uniq_usage_limit_snapshots_bucket": {
1325
+ "name": "uniq_usage_limit_snapshots_bucket",
1326
+ "columns": [
1327
+ "provider",
1328
+ "account_ref",
1329
+ "limit_window",
1330
+ "bucket_start"
1331
+ ],
1332
+ "isUnique": true
1333
+ },
1334
+ "idx_usage_limit_snapshots_window_bucket": {
1335
+ "name": "idx_usage_limit_snapshots_window_bucket",
1336
+ "columns": [
1337
+ "limit_window",
1338
+ "bucket_start"
1339
+ ],
1340
+ "isUnique": false
1341
+ },
1342
+ "idx_usage_limit_snapshots_provider_window_bucket": {
1343
+ "name": "idx_usage_limit_snapshots_provider_window_bucket",
1344
+ "columns": [
1345
+ "provider",
1346
+ "limit_window",
1347
+ "bucket_start"
1348
+ ],
1349
+ "isUnique": false
1350
+ }
1351
+ },
1352
+ "foreignKeys": {},
1353
+ "compositePrimaryKeys": {},
1354
+ "uniqueConstraints": {},
1355
+ "checkConstraints": {}
1356
+ },
1357
+ "usage_reports": {
1358
+ "name": "usage_reports",
1359
+ "columns": {
1360
+ "id": {
1361
+ "name": "id",
1362
+ "type": "text",
1363
+ "primaryKey": true,
1364
+ "notNull": true,
1365
+ "autoincrement": false
1366
+ },
1367
+ "workspace_id": {
1368
+ "name": "workspace_id",
1369
+ "type": "text",
1370
+ "primaryKey": false,
1371
+ "notNull": true,
1372
+ "autoincrement": false
1373
+ },
1374
+ "month": {
1375
+ "name": "month",
1376
+ "type": "text",
1377
+ "primaryKey": false,
1378
+ "notNull": true,
1379
+ "autoincrement": false
1380
+ },
1381
+ "generated_at": {
1382
+ "name": "generated_at",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": true,
1386
+ "autoincrement": false
1387
+ },
1388
+ "source_range": {
1389
+ "name": "source_range",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "autoincrement": false
1394
+ },
1395
+ "tier": {
1396
+ "name": "tier",
1397
+ "type": "text",
1398
+ "primaryKey": false,
1399
+ "notNull": true,
1400
+ "autoincrement": false
1401
+ },
1402
+ "total_tokens": {
1403
+ "name": "total_tokens",
1404
+ "type": "integer",
1405
+ "primaryKey": false,
1406
+ "notNull": true,
1407
+ "autoincrement": false
1408
+ },
1409
+ "total_cost_usd": {
1410
+ "name": "total_cost_usd",
1411
+ "type": "real",
1412
+ "primaryKey": false,
1413
+ "notNull": true,
1414
+ "autoincrement": false
1415
+ },
1416
+ "payload": {
1417
+ "name": "payload",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true,
1421
+ "autoincrement": false
1422
+ },
1423
+ "payload_hash": {
1424
+ "name": "payload_hash",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": false,
1428
+ "autoincrement": false
1429
+ },
1430
+ "signature": {
1431
+ "name": "signature",
1432
+ "type": "text",
1433
+ "primaryKey": false,
1434
+ "notNull": false,
1435
+ "autoincrement": false
1436
+ },
1437
+ "signed_at": {
1438
+ "name": "signed_at",
1439
+ "type": "text",
1440
+ "primaryKey": false,
1441
+ "notNull": false,
1442
+ "autoincrement": false
1443
+ },
1444
+ "issuer": {
1445
+ "name": "issuer",
1446
+ "type": "text",
1447
+ "primaryKey": false,
1448
+ "notNull": false,
1449
+ "autoincrement": false
1450
+ }
1451
+ },
1452
+ "indexes": {
1453
+ "uniq_usage_reports_ws_month": {
1454
+ "name": "uniq_usage_reports_ws_month",
1455
+ "columns": [
1456
+ "workspace_id",
1457
+ "month"
1458
+ ],
1459
+ "isUnique": true
1460
+ }
1461
+ },
1462
+ "foreignKeys": {},
1463
+ "compositePrimaryKeys": {},
1464
+ "uniqueConstraints": {},
1465
+ "checkConstraints": {}
1466
+ },
1467
+ "notification_reads": {
1468
+ "name": "notification_reads",
1469
+ "columns": {
1470
+ "notification_id": {
1471
+ "name": "notification_id",
1472
+ "type": "text",
1473
+ "primaryKey": false,
1474
+ "notNull": true,
1475
+ "autoincrement": false
1476
+ },
1477
+ "user_id": {
1478
+ "name": "user_id",
1479
+ "type": "text",
1480
+ "primaryKey": false,
1481
+ "notNull": true,
1482
+ "autoincrement": false
1483
+ },
1484
+ "read_at": {
1485
+ "name": "read_at",
1486
+ "type": "text",
1487
+ "primaryKey": false,
1488
+ "notNull": true,
1489
+ "autoincrement": false
1490
+ }
1491
+ },
1492
+ "indexes": {},
1493
+ "foreignKeys": {},
1494
+ "compositePrimaryKeys": {
1495
+ "notification_reads_notification_id_user_id_pk": {
1496
+ "columns": [
1497
+ "notification_id",
1498
+ "user_id"
1499
+ ],
1500
+ "name": "notification_reads_notification_id_user_id_pk"
1501
+ }
1502
+ },
1503
+ "uniqueConstraints": {},
1504
+ "checkConstraints": {}
1505
+ },
1506
+ "notifications": {
1507
+ "name": "notifications",
1508
+ "columns": {
1509
+ "id": {
1510
+ "name": "id",
1511
+ "type": "text",
1512
+ "primaryKey": true,
1513
+ "notNull": true,
1514
+ "autoincrement": false
1515
+ },
1516
+ "workspace_id": {
1517
+ "name": "workspace_id",
1518
+ "type": "text",
1519
+ "primaryKey": false,
1520
+ "notNull": true,
1521
+ "autoincrement": false
1522
+ },
1523
+ "agent_id": {
1524
+ "name": "agent_id",
1525
+ "type": "text",
1526
+ "primaryKey": false,
1527
+ "notNull": false,
1528
+ "autoincrement": false
1529
+ },
1530
+ "task_id": {
1531
+ "name": "task_id",
1532
+ "type": "text",
1533
+ "primaryKey": false,
1534
+ "notNull": false,
1535
+ "autoincrement": false
1536
+ },
1537
+ "thread_id": {
1538
+ "name": "thread_id",
1539
+ "type": "text",
1540
+ "primaryKey": false,
1541
+ "notNull": false,
1542
+ "autoincrement": false
1543
+ },
1544
+ "source": {
1545
+ "name": "source",
1546
+ "type": "text",
1547
+ "primaryKey": false,
1548
+ "notNull": true,
1549
+ "autoincrement": false,
1550
+ "default": "'agent'"
1551
+ },
1552
+ "level": {
1553
+ "name": "level",
1554
+ "type": "text",
1555
+ "primaryKey": false,
1556
+ "notNull": true,
1557
+ "autoincrement": false,
1558
+ "default": "'info'"
1559
+ },
1560
+ "title": {
1561
+ "name": "title",
1562
+ "type": "text",
1563
+ "primaryKey": false,
1564
+ "notNull": true,
1565
+ "autoincrement": false
1566
+ },
1567
+ "body": {
1568
+ "name": "body",
1569
+ "type": "text",
1570
+ "primaryKey": false,
1571
+ "notNull": false,
1572
+ "autoincrement": false
1573
+ },
1574
+ "target_user_id": {
1575
+ "name": "target_user_id",
1576
+ "type": "text",
1577
+ "primaryKey": false,
1578
+ "notNull": false,
1579
+ "autoincrement": false
1580
+ },
1581
+ "created_at": {
1582
+ "name": "created_at",
1583
+ "type": "text",
1584
+ "primaryKey": false,
1585
+ "notNull": true,
1586
+ "autoincrement": false
1587
+ },
1588
+ "metadata": {
1589
+ "name": "metadata",
1590
+ "type": "text",
1591
+ "primaryKey": false,
1592
+ "notNull": false,
1593
+ "autoincrement": false
1594
+ }
1595
+ },
1596
+ "indexes": {
1597
+ "idx_notifications_ws_created": {
1598
+ "name": "idx_notifications_ws_created",
1599
+ "columns": [
1600
+ "workspace_id",
1601
+ "\"created_at\" DESC"
1602
+ ],
1603
+ "isUnique": false
1604
+ }
1605
+ },
1606
+ "foreignKeys": {},
1607
+ "compositePrimaryKeys": {},
1608
+ "uniqueConstraints": {},
1609
+ "checkConstraints": {}
1610
+ },
1611
+ "agent_suggestions": {
1612
+ "name": "agent_suggestions",
1613
+ "columns": {
1614
+ "id": {
1615
+ "name": "id",
1616
+ "type": "text",
1617
+ "primaryKey": true,
1618
+ "notNull": true,
1619
+ "autoincrement": false
1620
+ },
1621
+ "workspace_id": {
1622
+ "name": "workspace_id",
1623
+ "type": "text",
1624
+ "primaryKey": false,
1625
+ "notNull": true,
1626
+ "autoincrement": false
1627
+ },
1628
+ "agent_id": {
1629
+ "name": "agent_id",
1630
+ "type": "text",
1631
+ "primaryKey": false,
1632
+ "notNull": true,
1633
+ "autoincrement": false
1634
+ },
1635
+ "task_id": {
1636
+ "name": "task_id",
1637
+ "type": "text",
1638
+ "primaryKey": false,
1639
+ "notNull": false,
1640
+ "autoincrement": false
1641
+ },
1642
+ "type": {
1643
+ "name": "type",
1644
+ "type": "text",
1645
+ "primaryKey": false,
1646
+ "notNull": true,
1647
+ "autoincrement": false
1648
+ },
1649
+ "status": {
1650
+ "name": "status",
1651
+ "type": "text",
1652
+ "primaryKey": false,
1653
+ "notNull": true,
1654
+ "autoincrement": false,
1655
+ "default": "'pending'"
1656
+ },
1657
+ "payload": {
1658
+ "name": "payload",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true,
1662
+ "autoincrement": false
1663
+ },
1664
+ "applied_commit_sha": {
1665
+ "name": "applied_commit_sha",
1666
+ "type": "text",
1667
+ "primaryKey": false,
1668
+ "notNull": false,
1669
+ "autoincrement": false
1670
+ },
1671
+ "created_at": {
1672
+ "name": "created_at",
1673
+ "type": "text",
1674
+ "primaryKey": false,
1675
+ "notNull": true,
1676
+ "autoincrement": false
1677
+ },
1678
+ "updated_at": {
1679
+ "name": "updated_at",
1680
+ "type": "text",
1681
+ "primaryKey": false,
1682
+ "notNull": true,
1683
+ "autoincrement": false
1684
+ }
1685
+ },
1686
+ "indexes": {
1687
+ "idx_agent_suggestions_ws_agent": {
1688
+ "name": "idx_agent_suggestions_ws_agent",
1689
+ "columns": [
1690
+ "workspace_id",
1691
+ "agent_id"
1692
+ ],
1693
+ "isUnique": false
1694
+ },
1695
+ "idx_agent_suggestions_ws_created": {
1696
+ "name": "idx_agent_suggestions_ws_created",
1697
+ "columns": [
1698
+ "workspace_id",
1699
+ "created_at"
1700
+ ],
1701
+ "isUnique": false
1702
+ }
1703
+ },
1704
+ "foreignKeys": {},
1705
+ "compositePrimaryKeys": {},
1706
+ "uniqueConstraints": {},
1707
+ "checkConstraints": {}
1708
+ },
1709
+ "ui_instances": {
1710
+ "name": "ui_instances",
1711
+ "columns": {
1712
+ "id": {
1713
+ "name": "id",
1714
+ "type": "text",
1715
+ "primaryKey": true,
1716
+ "notNull": true,
1717
+ "autoincrement": false
1718
+ },
1719
+ "definition_id": {
1720
+ "name": "definition_id",
1721
+ "type": "text",
1722
+ "primaryKey": false,
1723
+ "notNull": true,
1724
+ "autoincrement": false
1725
+ },
1726
+ "definition_version": {
1727
+ "name": "definition_version",
1728
+ "type": "integer",
1729
+ "primaryKey": false,
1730
+ "notNull": true,
1731
+ "autoincrement": false
1732
+ },
1733
+ "definition_hash": {
1734
+ "name": "definition_hash",
1735
+ "type": "text",
1736
+ "primaryKey": false,
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
+ "thread_id": {
1748
+ "name": "thread_id",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": true,
1752
+ "autoincrement": false
1753
+ },
1754
+ "anchor_task_id": {
1755
+ "name": "anchor_task_id",
1756
+ "type": "text",
1757
+ "primaryKey": false,
1758
+ "notNull": false,
1759
+ "autoincrement": false
1760
+ },
1761
+ "domain_ref_json": {
1762
+ "name": "domain_ref_json",
1763
+ "type": "text",
1764
+ "primaryKey": false,
1765
+ "notNull": true,
1766
+ "autoincrement": false
1767
+ },
1768
+ "state_json": {
1769
+ "name": "state_json",
1770
+ "type": "text",
1771
+ "primaryKey": false,
1772
+ "notNull": true,
1773
+ "autoincrement": false
1774
+ },
1775
+ "revision": {
1776
+ "name": "revision",
1777
+ "type": "integer",
1778
+ "primaryKey": false,
1779
+ "notNull": true,
1780
+ "autoincrement": false,
1781
+ "default": 0
1782
+ },
1783
+ "status": {
1784
+ "name": "status",
1785
+ "type": "text",
1786
+ "primaryKey": false,
1787
+ "notNull": true,
1788
+ "autoincrement": false,
1789
+ "default": "'active'"
1790
+ },
1791
+ "granted_capabilities_json": {
1792
+ "name": "granted_capabilities_json",
1793
+ "type": "text",
1794
+ "primaryKey": false,
1795
+ "notNull": true,
1796
+ "autoincrement": false,
1797
+ "default": "'[]'"
1798
+ },
1799
+ "created_at": {
1800
+ "name": "created_at",
1801
+ "type": "integer",
1802
+ "primaryKey": false,
1803
+ "notNull": true,
1804
+ "autoincrement": false
1805
+ },
1806
+ "updated_at": {
1807
+ "name": "updated_at",
1808
+ "type": "integer",
1809
+ "primaryKey": false,
1810
+ "notNull": true,
1811
+ "autoincrement": false
1812
+ }
1813
+ },
1814
+ "indexes": {
1815
+ "ui_instances_workspace_thread_idx": {
1816
+ "name": "ui_instances_workspace_thread_idx",
1817
+ "columns": [
1818
+ "workspace_id",
1819
+ "thread_id"
1820
+ ],
1821
+ "isUnique": false
1822
+ }
1823
+ },
1824
+ "foreignKeys": {},
1825
+ "compositePrimaryKeys": {},
1826
+ "uniqueConstraints": {},
1827
+ "checkConstraints": {
1828
+ "ui_instances_id_ck": {
1829
+ "name": "ui_instances_id_ck",
1830
+ "value": "length(\"ui_instances\".\"id\") BETWEEN 5 AND 128 AND \"ui_instances\".\"id\" GLOB 'uic_*'"
1831
+ },
1832
+ "ui_instances_definition_id_ck": {
1833
+ "name": "ui_instances_definition_id_ck",
1834
+ "value": "length(\"ui_instances\".\"definition_id\") BETWEEN 1 AND 128"
1835
+ },
1836
+ "ui_instances_definition_version_ck": {
1837
+ "name": "ui_instances_definition_version_ck",
1838
+ "value": "\"ui_instances\".\"definition_version\" >= 1"
1839
+ },
1840
+ "ui_instances_definition_hash_ck": {
1841
+ "name": "ui_instances_definition_hash_ck",
1842
+ "value": "length(\"ui_instances\".\"definition_hash\") = 64 AND \"ui_instances\".\"definition_hash\" NOT GLOB '*[^0-9a-f]*'"
1843
+ },
1844
+ "ui_instances_workspace_id_ck": {
1845
+ "name": "ui_instances_workspace_id_ck",
1846
+ "value": "length(\"ui_instances\".\"workspace_id\") BETWEEN 1 AND 256"
1847
+ },
1848
+ "ui_instances_thread_id_ck": {
1849
+ "name": "ui_instances_thread_id_ck",
1850
+ "value": "length(\"ui_instances\".\"thread_id\") BETWEEN 1 AND 256"
1851
+ },
1852
+ "ui_instances_domain_ref_json_ck": {
1853
+ "name": "ui_instances_domain_ref_json_ck",
1854
+ "value": "json_valid(\"ui_instances\".\"domain_ref_json\") AND json_type(\"ui_instances\".\"domain_ref_json\") = 'object'"
1855
+ },
1856
+ "ui_instances_state_json_ck": {
1857
+ "name": "ui_instances_state_json_ck",
1858
+ "value": "json_valid(\"ui_instances\".\"state_json\") AND json_type(\"ui_instances\".\"state_json\") = 'object'"
1859
+ },
1860
+ "ui_instances_revision_ck": {
1861
+ "name": "ui_instances_revision_ck",
1862
+ "value": "\"ui_instances\".\"revision\" >= 0"
1863
+ },
1864
+ "ui_instances_status_ck": {
1865
+ "name": "ui_instances_status_ck",
1866
+ "value": "\"ui_instances\".\"status\" IN ('active', 'completed', 'expired', 'revoked', 'unsupported')"
1867
+ },
1868
+ "ui_instances_granted_capabilities_json_ck": {
1869
+ "name": "ui_instances_granted_capabilities_json_ck",
1870
+ "value": "json_valid(\"ui_instances\".\"granted_capabilities_json\") AND json_type(\"ui_instances\".\"granted_capabilities_json\") = 'array'"
1871
+ },
1872
+ "ui_instances_created_at_ck": {
1873
+ "name": "ui_instances_created_at_ck",
1874
+ "value": "\"ui_instances\".\"created_at\" >= 0"
1875
+ },
1876
+ "ui_instances_updated_at_ck": {
1877
+ "name": "ui_instances_updated_at_ck",
1878
+ "value": "\"ui_instances\".\"updated_at\" >= \"ui_instances\".\"created_at\""
1879
+ }
1880
+ }
1881
+ },
1882
+ "ui_action_receipts": {
1883
+ "name": "ui_action_receipts",
1884
+ "columns": {
1885
+ "id": {
1886
+ "name": "id",
1887
+ "type": "text",
1888
+ "primaryKey": true,
1889
+ "notNull": true,
1890
+ "autoincrement": false
1891
+ },
1892
+ "instance_id": {
1893
+ "name": "instance_id",
1894
+ "type": "text",
1895
+ "primaryKey": false,
1896
+ "notNull": true,
1897
+ "autoincrement": false
1898
+ },
1899
+ "request_id": {
1900
+ "name": "request_id",
1901
+ "type": "text",
1902
+ "primaryKey": false,
1903
+ "notNull": true,
1904
+ "autoincrement": false
1905
+ },
1906
+ "action_id": {
1907
+ "name": "action_id",
1908
+ "type": "text",
1909
+ "primaryKey": false,
1910
+ "notNull": true,
1911
+ "autoincrement": false
1912
+ },
1913
+ "actor_json": {
1914
+ "name": "actor_json",
1915
+ "type": "text",
1916
+ "primaryKey": false,
1917
+ "notNull": true,
1918
+ "autoincrement": false
1919
+ },
1920
+ "source": {
1921
+ "name": "source",
1922
+ "type": "text",
1923
+ "primaryKey": false,
1924
+ "notNull": true,
1925
+ "autoincrement": false
1926
+ },
1927
+ "expected_revision": {
1928
+ "name": "expected_revision",
1929
+ "type": "integer",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "autoincrement": false
1933
+ },
1934
+ "before_revision": {
1935
+ "name": "before_revision",
1936
+ "type": "integer",
1937
+ "primaryKey": false,
1938
+ "notNull": true,
1939
+ "autoincrement": false
1940
+ },
1941
+ "after_revision": {
1942
+ "name": "after_revision",
1943
+ "type": "integer",
1944
+ "primaryKey": false,
1945
+ "notNull": false,
1946
+ "autoincrement": false
1947
+ },
1948
+ "status": {
1949
+ "name": "status",
1950
+ "type": "text",
1951
+ "primaryKey": false,
1952
+ "notNull": true,
1953
+ "autoincrement": false
1954
+ },
1955
+ "outcome": {
1956
+ "name": "outcome",
1957
+ "type": "text",
1958
+ "primaryKey": false,
1959
+ "notNull": false,
1960
+ "autoincrement": false
1961
+ },
1962
+ "input_json": {
1963
+ "name": "input_json",
1964
+ "type": "text",
1965
+ "primaryKey": false,
1966
+ "notNull": true,
1967
+ "autoincrement": false
1968
+ },
1969
+ "result_json": {
1970
+ "name": "result_json",
1971
+ "type": "text",
1972
+ "primaryKey": false,
1973
+ "notNull": false,
1974
+ "autoincrement": false
1975
+ },
1976
+ "error_code": {
1977
+ "name": "error_code",
1978
+ "type": "text",
1979
+ "primaryKey": false,
1980
+ "notNull": false,
1981
+ "autoincrement": false
1982
+ },
1983
+ "requested_at": {
1984
+ "name": "requested_at",
1985
+ "type": "integer",
1986
+ "primaryKey": false,
1987
+ "notNull": true,
1988
+ "autoincrement": false
1989
+ },
1990
+ "settled_at": {
1991
+ "name": "settled_at",
1992
+ "type": "integer",
1993
+ "primaryKey": false,
1994
+ "notNull": false,
1995
+ "autoincrement": false
1996
+ }
1997
+ },
1998
+ "indexes": {
1999
+ "ui_action_receipts_instance_request_uq": {
2000
+ "name": "ui_action_receipts_instance_request_uq",
2001
+ "columns": [
2002
+ "instance_id",
2003
+ "request_id"
2004
+ ],
2005
+ "isUnique": true
2006
+ },
2007
+ "ui_action_receipts_instance_id_idx": {
2008
+ "name": "ui_action_receipts_instance_id_idx",
2009
+ "columns": [
2010
+ "instance_id"
2011
+ ],
2012
+ "isUnique": false
2013
+ },
2014
+ "ui_action_receipts_requested_at_idx": {
2015
+ "name": "ui_action_receipts_requested_at_idx",
2016
+ "columns": [
2017
+ "requested_at"
2018
+ ],
2019
+ "isUnique": false
2020
+ }
2021
+ },
2022
+ "foreignKeys": {},
2023
+ "compositePrimaryKeys": {},
2024
+ "uniqueConstraints": {},
2025
+ "checkConstraints": {
2026
+ "ui_action_receipts_id_ck": {
2027
+ "name": "ui_action_receipts_id_ck",
2028
+ "value": "length(\"ui_action_receipts\".\"id\") BETWEEN 5 AND 128"
2029
+ },
2030
+ "ui_action_receipts_instance_id_ck": {
2031
+ "name": "ui_action_receipts_instance_id_ck",
2032
+ "value": "length(\"ui_action_receipts\".\"instance_id\") BETWEEN 1 AND 128"
2033
+ },
2034
+ "ui_action_receipts_request_id_ck": {
2035
+ "name": "ui_action_receipts_request_id_ck",
2036
+ "value": "length(\"ui_action_receipts\".\"request_id\") BETWEEN 1 AND 128"
2037
+ },
2038
+ "ui_action_receipts_action_id_ck": {
2039
+ "name": "ui_action_receipts_action_id_ck",
2040
+ "value": "length(\"ui_action_receipts\".\"action_id\") BETWEEN 1 AND 128"
2041
+ },
2042
+ "ui_action_receipts_actor_json_ck": {
2043
+ "name": "ui_action_receipts_actor_json_ck",
2044
+ "value": "json_valid(\"ui_action_receipts\".\"actor_json\") AND json_type(\"ui_action_receipts\".\"actor_json\") = 'object'"
2045
+ },
2046
+ "ui_action_receipts_source_ck": {
2047
+ "name": "ui_action_receipts_source_ck",
2048
+ "value": "\"ui_action_receipts\".\"source\" IN ('ui_host', 'cli', 'system')"
2049
+ },
2050
+ "ui_action_receipts_expected_revision_ck": {
2051
+ "name": "ui_action_receipts_expected_revision_ck",
2052
+ "value": "\"ui_action_receipts\".\"expected_revision\" >= 0"
2053
+ },
2054
+ "ui_action_receipts_before_revision_ck": {
2055
+ "name": "ui_action_receipts_before_revision_ck",
2056
+ "value": "\"ui_action_receipts\".\"before_revision\" >= 0"
2057
+ },
2058
+ "ui_action_receipts_after_revision_ck": {
2059
+ "name": "ui_action_receipts_after_revision_ck",
2060
+ "value": "\"ui_action_receipts\".\"after_revision\" IS NULL OR \"ui_action_receipts\".\"after_revision\" >= 0"
2061
+ },
2062
+ "ui_action_receipts_status_ck": {
2063
+ "name": "ui_action_receipts_status_ck",
2064
+ "value": "\"ui_action_receipts\".\"status\" IN ('requested', 'settled')"
2065
+ },
2066
+ "ui_action_receipts_outcome_ck": {
2067
+ "name": "ui_action_receipts_outcome_ck",
2068
+ "value": "\"ui_action_receipts\".\"outcome\" IS NULL OR \"ui_action_receipts\".\"outcome\" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')"
2069
+ },
2070
+ "ui_action_receipts_input_json_ck": {
2071
+ "name": "ui_action_receipts_input_json_ck",
2072
+ "value": "json_valid(\"ui_action_receipts\".\"input_json\") AND json_type(\"ui_action_receipts\".\"input_json\") = 'object'"
2073
+ },
2074
+ "ui_action_receipts_result_json_ck": {
2075
+ "name": "ui_action_receipts_result_json_ck",
2076
+ "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')"
2077
+ },
2078
+ "ui_action_receipts_requested_at_ck": {
2079
+ "name": "ui_action_receipts_requested_at_ck",
2080
+ "value": "\"ui_action_receipts\".\"requested_at\" >= 0"
2081
+ },
2082
+ "ui_action_receipts_settled_at_ck": {
2083
+ "name": "ui_action_receipts_settled_at_ck",
2084
+ "value": "\"ui_action_receipts\".\"settled_at\" IS NULL OR \"ui_action_receipts\".\"settled_at\" >= \"ui_action_receipts\".\"requested_at\""
2085
+ },
2086
+ "ui_action_receipts_status_transition_ck": {
2087
+ "name": "ui_action_receipts_status_transition_ck",
2088
+ "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 )"
2089
+ }
2090
+ }
2091
+ },
2092
+ "project_criteria": {
2093
+ "name": "project_criteria",
2094
+ "columns": {
2095
+ "id": {
2096
+ "name": "id",
2097
+ "type": "text",
2098
+ "primaryKey": true,
2099
+ "notNull": true,
2100
+ "autoincrement": false
2101
+ },
2102
+ "project_id": {
2103
+ "name": "project_id",
2104
+ "type": "text",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "autoincrement": false
2108
+ },
2109
+ "position": {
2110
+ "name": "position",
2111
+ "type": "integer",
2112
+ "primaryKey": false,
2113
+ "notNull": true,
2114
+ "autoincrement": false
2115
+ },
2116
+ "statement": {
2117
+ "name": "statement",
2118
+ "type": "text",
2119
+ "primaryKey": false,
2120
+ "notNull": true,
2121
+ "autoincrement": false
2122
+ },
2123
+ "verify_status": {
2124
+ "name": "verify_status",
2125
+ "type": "text",
2126
+ "primaryKey": false,
2127
+ "notNull": true,
2128
+ "autoincrement": false,
2129
+ "default": "'pending'"
2130
+ },
2131
+ "verified_at": {
2132
+ "name": "verified_at",
2133
+ "type": "text",
2134
+ "primaryKey": false,
2135
+ "notNull": false,
2136
+ "autoincrement": false
2137
+ },
2138
+ "evidence_json": {
2139
+ "name": "evidence_json",
2140
+ "type": "text",
2141
+ "primaryKey": false,
2142
+ "notNull": true,
2143
+ "autoincrement": false,
2144
+ "default": "'[]'"
2145
+ },
2146
+ "created_at": {
2147
+ "name": "created_at",
2148
+ "type": "text",
2149
+ "primaryKey": false,
2150
+ "notNull": true,
2151
+ "autoincrement": false
2152
+ },
2153
+ "updated_at": {
2154
+ "name": "updated_at",
2155
+ "type": "text",
2156
+ "primaryKey": false,
2157
+ "notNull": true,
2158
+ "autoincrement": false
2159
+ }
2160
+ },
2161
+ "indexes": {
2162
+ "project_criteria_project_position_uq": {
2163
+ "name": "project_criteria_project_position_uq",
2164
+ "columns": [
2165
+ "project_id",
2166
+ "position"
2167
+ ],
2168
+ "isUnique": true
2169
+ }
2170
+ },
2171
+ "foreignKeys": {
2172
+ "project_criteria_project_id_projects_id_fk": {
2173
+ "name": "project_criteria_project_id_projects_id_fk",
2174
+ "tableFrom": "project_criteria",
2175
+ "tableTo": "projects",
2176
+ "columnsFrom": [
2177
+ "project_id"
2178
+ ],
2179
+ "columnsTo": [
2180
+ "id"
2181
+ ],
2182
+ "onDelete": "cascade",
2183
+ "onUpdate": "no action"
2184
+ }
2185
+ },
2186
+ "compositePrimaryKeys": {},
2187
+ "uniqueConstraints": {},
2188
+ "checkConstraints": {
2189
+ "project_criteria_id_ck": {
2190
+ "name": "project_criteria_id_ck",
2191
+ "value": "\"project_criteria\".\"id\" GLOB 'pjc_*'"
2192
+ },
2193
+ "project_criteria_verify_status_ck": {
2194
+ "name": "project_criteria_verify_status_ck",
2195
+ "value": "\"project_criteria\".\"verify_status\" IN ('pending', 'verifying', 'passed', 'failed')"
2196
+ },
2197
+ "project_criteria_evidence_json_ck": {
2198
+ "name": "project_criteria_evidence_json_ck",
2199
+ "value": "json_valid(\"project_criteria\".\"evidence_json\") AND json_type(\"project_criteria\".\"evidence_json\") = 'array'"
2200
+ }
2201
+ }
2202
+ },
2203
+ "project_events": {
2204
+ "name": "project_events",
2205
+ "columns": {
2206
+ "id": {
2207
+ "name": "id",
2208
+ "type": "text",
2209
+ "primaryKey": true,
2210
+ "notNull": true,
2211
+ "autoincrement": false
2212
+ },
2213
+ "project_id": {
2214
+ "name": "project_id",
2215
+ "type": "text",
2216
+ "primaryKey": false,
2217
+ "notNull": true,
2218
+ "autoincrement": false
2219
+ },
2220
+ "seq": {
2221
+ "name": "seq",
2222
+ "type": "integer",
2223
+ "primaryKey": false,
2224
+ "notNull": true,
2225
+ "autoincrement": false
2226
+ },
2227
+ "actor_type": {
2228
+ "name": "actor_type",
2229
+ "type": "text",
2230
+ "primaryKey": false,
2231
+ "notNull": true,
2232
+ "autoincrement": false
2233
+ },
2234
+ "actor_id": {
2235
+ "name": "actor_id",
2236
+ "type": "text",
2237
+ "primaryKey": false,
2238
+ "notNull": false,
2239
+ "autoincrement": false
2240
+ },
2241
+ "type": {
2242
+ "name": "type",
2243
+ "type": "text",
2244
+ "primaryKey": false,
2245
+ "notNull": true,
2246
+ "autoincrement": false
2247
+ },
2248
+ "title": {
2249
+ "name": "title",
2250
+ "type": "text",
2251
+ "primaryKey": false,
2252
+ "notNull": true,
2253
+ "autoincrement": false
2254
+ },
2255
+ "summary": {
2256
+ "name": "summary",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": false,
2260
+ "autoincrement": false
2261
+ },
2262
+ "payload_json": {
2263
+ "name": "payload_json",
2264
+ "type": "text",
2265
+ "primaryKey": false,
2266
+ "notNull": true,
2267
+ "autoincrement": false,
2268
+ "default": "'{}'"
2269
+ },
2270
+ "created_at": {
2271
+ "name": "created_at",
2272
+ "type": "text",
2273
+ "primaryKey": false,
2274
+ "notNull": true,
2275
+ "autoincrement": false
2276
+ }
2277
+ },
2278
+ "indexes": {
2279
+ "project_events_project_seq_uq": {
2280
+ "name": "project_events_project_seq_uq",
2281
+ "columns": [
2282
+ "project_id",
2283
+ "seq"
2284
+ ],
2285
+ "isUnique": true
2286
+ }
2287
+ },
2288
+ "foreignKeys": {
2289
+ "project_events_project_id_projects_id_fk": {
2290
+ "name": "project_events_project_id_projects_id_fk",
2291
+ "tableFrom": "project_events",
2292
+ "tableTo": "projects",
2293
+ "columnsFrom": [
2294
+ "project_id"
2295
+ ],
2296
+ "columnsTo": [
2297
+ "id"
2298
+ ],
2299
+ "onDelete": "restrict",
2300
+ "onUpdate": "no action"
2301
+ }
2302
+ },
2303
+ "compositePrimaryKeys": {},
2304
+ "uniqueConstraints": {},
2305
+ "checkConstraints": {
2306
+ "project_events_id_ck": {
2307
+ "name": "project_events_id_ck",
2308
+ "value": "\"project_events\".\"id\" GLOB 'pje_*'"
2309
+ },
2310
+ "project_events_actor_type_ck": {
2311
+ "name": "project_events_actor_type_ck",
2312
+ "value": "\"project_events\".\"actor_type\" IN ('user', 'project_manager', 'system')"
2313
+ },
2314
+ "project_events_payload_json_ck": {
2315
+ "name": "project_events_payload_json_ck",
2316
+ "value": "json_valid(\"project_events\".\"payload_json\") AND json_type(\"project_events\".\"payload_json\") = 'object'"
2317
+ }
2318
+ }
2319
+ },
2320
+ "projects": {
2321
+ "name": "projects",
2322
+ "columns": {
2323
+ "id": {
2324
+ "name": "id",
2325
+ "type": "text",
2326
+ "primaryKey": true,
2327
+ "notNull": true,
2328
+ "autoincrement": false
2329
+ },
2330
+ "workspace_id": {
2331
+ "name": "workspace_id",
2332
+ "type": "text",
2333
+ "primaryKey": false,
2334
+ "notNull": true,
2335
+ "autoincrement": false
2336
+ },
2337
+ "name": {
2338
+ "name": "name",
2339
+ "type": "text",
2340
+ "primaryKey": false,
2341
+ "notNull": true,
2342
+ "autoincrement": false
2343
+ },
2344
+ "outcome": {
2345
+ "name": "outcome",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": true,
2349
+ "autoincrement": false
2350
+ },
2351
+ "due_date": {
2352
+ "name": "due_date",
2353
+ "type": "text",
2354
+ "primaryKey": false,
2355
+ "notNull": false,
2356
+ "autoincrement": false
2357
+ },
2358
+ "scene": {
2359
+ "name": "scene",
2360
+ "type": "text",
2361
+ "primaryKey": false,
2362
+ "notNull": true,
2363
+ "autoincrement": false,
2364
+ "default": "'planning'"
2365
+ },
2366
+ "stages_json": {
2367
+ "name": "stages_json",
2368
+ "type": "text",
2369
+ "primaryKey": false,
2370
+ "notNull": true,
2371
+ "autoincrement": false
2372
+ },
2373
+ "stage_index": {
2374
+ "name": "stage_index",
2375
+ "type": "integer",
2376
+ "primaryKey": false,
2377
+ "notNull": true,
2378
+ "autoincrement": false
2379
+ },
2380
+ "created_at": {
2381
+ "name": "created_at",
2382
+ "type": "text",
2383
+ "primaryKey": false,
2384
+ "notNull": true,
2385
+ "autoincrement": false
2386
+ },
2387
+ "updated_at": {
2388
+ "name": "updated_at",
2389
+ "type": "text",
2390
+ "primaryKey": false,
2391
+ "notNull": true,
2392
+ "autoincrement": false
2393
+ },
2394
+ "accepted_at": {
2395
+ "name": "accepted_at",
2396
+ "type": "text",
2397
+ "primaryKey": false,
2398
+ "notNull": false,
2399
+ "autoincrement": false
2400
+ },
2401
+ "archived_at": {
2402
+ "name": "archived_at",
2403
+ "type": "text",
2404
+ "primaryKey": false,
2405
+ "notNull": false,
2406
+ "autoincrement": false
2407
+ }
2408
+ },
2409
+ "indexes": {},
2410
+ "foreignKeys": {},
2411
+ "compositePrimaryKeys": {},
2412
+ "uniqueConstraints": {},
2413
+ "checkConstraints": {
2414
+ "projects_id_ck": {
2415
+ "name": "projects_id_ck",
2416
+ "value": "\"projects\".\"id\" GLOB 'prj_*'"
2417
+ },
2418
+ "projects_scene_ck": {
2419
+ "name": "projects_scene_ck",
2420
+ "value": "\"projects\".\"scene\" IN ('planning', 'plan_review', 'running', 'human_wait', 'limit_wait', 'failed_stop', 'analyzing_feedback', 'replanned', 'awaiting_review', 'accepted')"
2421
+ },
2422
+ "projects_stages_json_ck": {
2423
+ "name": "projects_stages_json_ck",
2424
+ "value": "json_valid(\"projects\".\"stages_json\") AND json_type(\"projects\".\"stages_json\") = 'array'"
2425
+ },
2426
+ "projects_stage_index_ck": {
2427
+ "name": "projects_stage_index_ck",
2428
+ "value": "\"projects\".\"stage_index\" >= 1"
2429
+ }
2430
+ }
2431
+ },
2432
+ "common_codes": {
2433
+ "name": "common_codes",
2434
+ "columns": {
2435
+ "code_group": {
2436
+ "name": "code_group",
2437
+ "type": "text",
2438
+ "primaryKey": false,
2439
+ "notNull": true,
2440
+ "autoincrement": false
2441
+ },
2442
+ "code": {
2443
+ "name": "code",
2444
+ "type": "text",
2445
+ "primaryKey": false,
2446
+ "notNull": true,
2447
+ "autoincrement": false
2448
+ },
2449
+ "code_name": {
2450
+ "name": "code_name",
2451
+ "type": "text",
2452
+ "primaryKey": false,
2453
+ "notNull": false,
2454
+ "autoincrement": false
2455
+ },
2456
+ "color": {
2457
+ "name": "color",
2458
+ "type": "text",
2459
+ "primaryKey": false,
2460
+ "notNull": true,
2461
+ "autoincrement": false,
2462
+ "default": "'gray'"
2463
+ },
2464
+ "sort_order": {
2465
+ "name": "sort_order",
2466
+ "type": "integer",
2467
+ "primaryKey": false,
2468
+ "notNull": true,
2469
+ "autoincrement": false
2470
+ },
2471
+ "workspace_id": {
2472
+ "name": "workspace_id",
2473
+ "type": "text",
2474
+ "primaryKey": false,
2475
+ "notNull": false,
2476
+ "autoincrement": false
2477
+ },
2478
+ "is_builtin": {
2479
+ "name": "is_builtin",
2480
+ "type": "integer",
2481
+ "primaryKey": false,
2482
+ "notNull": true,
2483
+ "autoincrement": false,
2484
+ "default": 0
2485
+ },
2486
+ "is_archived": {
2487
+ "name": "is_archived",
2488
+ "type": "integer",
2489
+ "primaryKey": false,
2490
+ "notNull": true,
2491
+ "autoincrement": false,
2492
+ "default": 0
2493
+ },
2494
+ "metadata": {
2495
+ "name": "metadata",
2496
+ "type": "text",
2497
+ "primaryKey": false,
2498
+ "notNull": false,
2499
+ "autoincrement": false
2500
+ },
2501
+ "created_at": {
2502
+ "name": "created_at",
2503
+ "type": "text",
2504
+ "primaryKey": false,
2505
+ "notNull": true,
2506
+ "autoincrement": false
2507
+ },
2508
+ "updated_at": {
2509
+ "name": "updated_at",
2510
+ "type": "text",
2511
+ "primaryKey": false,
2512
+ "notNull": true,
2513
+ "autoincrement": false
2514
+ }
2515
+ },
2516
+ "indexes": {
2517
+ "idx_common_codes_group_archived_order": {
2518
+ "name": "idx_common_codes_group_archived_order",
2519
+ "columns": [
2520
+ "code_group",
2521
+ "is_archived",
2522
+ "sort_order"
2523
+ ],
2524
+ "isUnique": false
2525
+ }
2526
+ },
2527
+ "foreignKeys": {},
2528
+ "compositePrimaryKeys": {
2529
+ "common_codes_code_group_code_pk": {
2530
+ "columns": [
2531
+ "code_group",
2532
+ "code"
2533
+ ],
2534
+ "name": "common_codes_code_group_code_pk"
2535
+ }
2536
+ },
2537
+ "uniqueConstraints": {},
2538
+ "checkConstraints": {
2539
+ "common_codes_metadata_ck": {
2540
+ "name": "common_codes_metadata_ck",
2541
+ "value": "\"common_codes\".\"metadata\" IS NULL OR (json_valid(\"common_codes\".\"metadata\") AND json_type(\"common_codes\".\"metadata\") = 'object')"
2542
+ },
2543
+ "common_codes_builtin_ck": {
2544
+ "name": "common_codes_builtin_ck",
2545
+ "value": "\"common_codes\".\"is_builtin\" IN (0, 1)"
2546
+ },
2547
+ "common_codes_archived_ck": {
2548
+ "name": "common_codes_archived_ck",
2549
+ "value": "\"common_codes\".\"is_archived\" IN (0, 1)"
2550
+ }
2551
+ }
2552
+ },
2553
+ "thread_events": {
2554
+ "name": "thread_events",
2555
+ "columns": {
2556
+ "id": {
2557
+ "name": "id",
2558
+ "type": "text",
2559
+ "primaryKey": true,
2560
+ "notNull": true,
2561
+ "autoincrement": false
2562
+ },
2563
+ "thread_id": {
2564
+ "name": "thread_id",
2565
+ "type": "text",
2566
+ "primaryKey": false,
2567
+ "notNull": true,
2568
+ "autoincrement": false
2569
+ },
2570
+ "seq": {
2571
+ "name": "seq",
2572
+ "type": "integer",
2573
+ "primaryKey": false,
2574
+ "notNull": true,
2575
+ "autoincrement": false
2576
+ },
2577
+ "type": {
2578
+ "name": "type",
2579
+ "type": "text",
2580
+ "primaryKey": false,
2581
+ "notNull": true,
2582
+ "autoincrement": false
2583
+ },
2584
+ "actor_type": {
2585
+ "name": "actor_type",
2586
+ "type": "text",
2587
+ "primaryKey": false,
2588
+ "notNull": true,
2589
+ "autoincrement": false
2590
+ },
2591
+ "payload_json": {
2592
+ "name": "payload_json",
2593
+ "type": "text",
2594
+ "primaryKey": false,
2595
+ "notNull": true,
2596
+ "autoincrement": false
2597
+ },
2598
+ "created_at": {
2599
+ "name": "created_at",
2600
+ "type": "text",
2601
+ "primaryKey": false,
2602
+ "notNull": true,
2603
+ "autoincrement": false
2604
+ },
2605
+ "actor_id": {
2606
+ "name": "actor_id",
2607
+ "type": "text",
2608
+ "primaryKey": false,
2609
+ "notNull": false,
2610
+ "autoincrement": false
2611
+ },
2612
+ "task_id": {
2613
+ "name": "task_id",
2614
+ "type": "text",
2615
+ "primaryKey": false,
2616
+ "notNull": false,
2617
+ "autoincrement": false
2618
+ },
2619
+ "highlight_id": {
2620
+ "name": "highlight_id",
2621
+ "type": "text",
2622
+ "primaryKey": false,
2623
+ "notNull": false,
2624
+ "autoincrement": false
2625
+ }
2626
+ },
2627
+ "indexes": {
2628
+ "idx_thread_events_thread_seq": {
2629
+ "name": "idx_thread_events_thread_seq",
2630
+ "columns": [
2631
+ "thread_id",
2632
+ "seq"
2633
+ ],
2634
+ "isUnique": false
2635
+ },
2636
+ "idx_thread_events_thread_created": {
2637
+ "name": "idx_thread_events_thread_created",
2638
+ "columns": [
2639
+ "thread_id",
2640
+ "created_at"
2641
+ ],
2642
+ "isUnique": false
2643
+ },
2644
+ "thread_events_thread_seq_uq": {
2645
+ "name": "thread_events_thread_seq_uq",
2646
+ "columns": [
2647
+ "thread_id",
2648
+ "seq"
2649
+ ],
2650
+ "isUnique": true
2651
+ }
2652
+ },
2653
+ "foreignKeys": {
2654
+ "thread_events_thread_id_threads_id_fk": {
2655
+ "name": "thread_events_thread_id_threads_id_fk",
2656
+ "tableFrom": "thread_events",
2657
+ "tableTo": "threads",
2658
+ "columnsFrom": [
2659
+ "thread_id"
2660
+ ],
2661
+ "columnsTo": [
2662
+ "id"
2663
+ ],
2664
+ "onDelete": "cascade",
2665
+ "onUpdate": "no action"
2666
+ }
2667
+ },
2668
+ "compositePrimaryKeys": {},
2669
+ "uniqueConstraints": {},
2670
+ "checkConstraints": {
2671
+ "thread_events_type_ck": {
2672
+ "name": "thread_events_type_ck",
2673
+ "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')"
2674
+ },
2675
+ "thread_events_actor_type_ck": {
2676
+ "name": "thread_events_actor_type_ck",
2677
+ "value": "\"thread_events\".\"actor_type\" IN ('user', 'agent', 'system')"
2678
+ },
2679
+ "thread_events_payload_json_ck": {
2680
+ "name": "thread_events_payload_json_ck",
2681
+ "value": "json_valid(\"thread_events\".\"payload_json\") AND json_type(\"thread_events\".\"payload_json\") = 'object'"
2682
+ }
2683
+ }
2684
+ },
2685
+ "thread_highlight_runs": {
2686
+ "name": "thread_highlight_runs",
2687
+ "columns": {
2688
+ "id": {
2689
+ "name": "id",
2690
+ "type": "text",
2691
+ "primaryKey": true,
2692
+ "notNull": true,
2693
+ "autoincrement": false
2694
+ },
2695
+ "thread_id": {
2696
+ "name": "thread_id",
2697
+ "type": "text",
2698
+ "primaryKey": false,
2699
+ "notNull": true,
2700
+ "autoincrement": false
2701
+ },
2702
+ "request_id": {
2703
+ "name": "request_id",
2704
+ "type": "text",
2705
+ "primaryKey": false,
2706
+ "notNull": true,
2707
+ "autoincrement": false
2708
+ },
2709
+ "status": {
2710
+ "name": "status",
2711
+ "type": "text",
2712
+ "primaryKey": false,
2713
+ "notNull": true,
2714
+ "autoincrement": false
2715
+ },
2716
+ "detector_version": {
2717
+ "name": "detector_version",
2718
+ "type": "text",
2719
+ "primaryKey": false,
2720
+ "notNull": true,
2721
+ "autoincrement": false
2722
+ },
2723
+ "requested_at": {
2724
+ "name": "requested_at",
2725
+ "type": "text",
2726
+ "primaryKey": false,
2727
+ "notNull": true,
2728
+ "autoincrement": false
2729
+ },
2730
+ "started_at": {
2731
+ "name": "started_at",
2732
+ "type": "text",
2733
+ "primaryKey": false,
2734
+ "notNull": false,
2735
+ "autoincrement": false
2736
+ },
2737
+ "completed_at": {
2738
+ "name": "completed_at",
2739
+ "type": "text",
2740
+ "primaryKey": false,
2741
+ "notNull": false,
2742
+ "autoincrement": false
2743
+ },
2744
+ "error_code": {
2745
+ "name": "error_code",
2746
+ "type": "text",
2747
+ "primaryKey": false,
2748
+ "notNull": false,
2749
+ "autoincrement": false
2750
+ },
2751
+ "previous_auto_count": {
2752
+ "name": "previous_auto_count",
2753
+ "type": "integer",
2754
+ "primaryKey": false,
2755
+ "notNull": false,
2756
+ "autoincrement": false
2757
+ },
2758
+ "new_auto_count": {
2759
+ "name": "new_auto_count",
2760
+ "type": "integer",
2761
+ "primaryKey": false,
2762
+ "notNull": false,
2763
+ "autoincrement": false
2764
+ }
2765
+ },
2766
+ "indexes": {
2767
+ "thread_highlight_runs_thread_request_uq": {
2768
+ "name": "thread_highlight_runs_thread_request_uq",
2769
+ "columns": [
2770
+ "thread_id",
2771
+ "request_id"
2772
+ ],
2773
+ "isUnique": true
2774
+ },
2775
+ "thread_highlight_runs_in_progress_thread_uq": {
2776
+ "name": "thread_highlight_runs_in_progress_thread_uq",
2777
+ "columns": [
2778
+ "thread_id"
2779
+ ],
2780
+ "isUnique": true,
2781
+ "where": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running')"
2782
+ },
2783
+ "idx_thread_highlight_runs_thread_status_requested": {
2784
+ "name": "idx_thread_highlight_runs_thread_status_requested",
2785
+ "columns": [
2786
+ "thread_id",
2787
+ "status",
2788
+ "requested_at"
2789
+ ],
2790
+ "isUnique": false
2791
+ }
2792
+ },
2793
+ "foreignKeys": {
2794
+ "thread_highlight_runs_thread_id_threads_id_fk": {
2795
+ "name": "thread_highlight_runs_thread_id_threads_id_fk",
2796
+ "tableFrom": "thread_highlight_runs",
2797
+ "tableTo": "threads",
2798
+ "columnsFrom": [
2799
+ "thread_id"
2800
+ ],
2801
+ "columnsTo": [
2802
+ "id"
2803
+ ],
2804
+ "onDelete": "cascade",
2805
+ "onUpdate": "no action"
2806
+ }
2807
+ },
2808
+ "compositePrimaryKeys": {},
2809
+ "uniqueConstraints": {},
2810
+ "checkConstraints": {
2811
+ "thread_highlight_runs_status_ck": {
2812
+ "name": "thread_highlight_runs_status_ck",
2813
+ "value": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running', 'completed', 'failed')"
2814
+ },
2815
+ "thread_highlight_runs_counts_ck": {
2816
+ "name": "thread_highlight_runs_counts_ck",
2817
+ "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)"
2818
+ }
2819
+ }
2820
+ },
2821
+ "thread_highlights": {
2822
+ "name": "thread_highlights",
2823
+ "columns": {
2824
+ "id": {
2825
+ "name": "id",
2826
+ "type": "text",
2827
+ "primaryKey": true,
2828
+ "notNull": true,
2829
+ "autoincrement": false
2830
+ },
2831
+ "thread_id": {
2832
+ "name": "thread_id",
2833
+ "type": "text",
2834
+ "primaryKey": false,
2835
+ "notNull": true,
2836
+ "autoincrement": false
2837
+ },
2838
+ "source": {
2839
+ "name": "source",
2840
+ "type": "text",
2841
+ "primaryKey": false,
2842
+ "notNull": true,
2843
+ "autoincrement": false
2844
+ },
2845
+ "kind": {
2846
+ "name": "kind",
2847
+ "type": "text",
2848
+ "primaryKey": false,
2849
+ "notNull": true,
2850
+ "autoincrement": false
2851
+ },
2852
+ "status": {
2853
+ "name": "status",
2854
+ "type": "text",
2855
+ "primaryKey": false,
2856
+ "notNull": true,
2857
+ "autoincrement": false,
2858
+ "default": "'active'"
2859
+ },
2860
+ "text": {
2861
+ "name": "text",
2862
+ "type": "text",
2863
+ "primaryKey": false,
2864
+ "notNull": false,
2865
+ "autoincrement": false
2866
+ },
2867
+ "covers_from_task_id": {
2868
+ "name": "covers_from_task_id",
2869
+ "type": "text",
2870
+ "primaryKey": false,
2871
+ "notNull": true,
2872
+ "autoincrement": false
2873
+ },
2874
+ "covers_to_task_id": {
2875
+ "name": "covers_to_task_id",
2876
+ "type": "text",
2877
+ "primaryKey": false,
2878
+ "notNull": true,
2879
+ "autoincrement": false
2880
+ },
2881
+ "revision": {
2882
+ "name": "revision",
2883
+ "type": "integer",
2884
+ "primaryKey": false,
2885
+ "notNull": true,
2886
+ "autoincrement": false,
2887
+ "default": 0
2888
+ },
2889
+ "created_at": {
2890
+ "name": "created_at",
2891
+ "type": "text",
2892
+ "primaryKey": false,
2893
+ "notNull": true,
2894
+ "autoincrement": false
2895
+ },
2896
+ "updated_at": {
2897
+ "name": "updated_at",
2898
+ "type": "text",
2899
+ "primaryKey": false,
2900
+ "notNull": true,
2901
+ "autoincrement": false
2902
+ },
2903
+ "agent_id": {
2904
+ "name": "agent_id",
2905
+ "type": "text",
2906
+ "primaryKey": false,
2907
+ "notNull": false,
2908
+ "autoincrement": false
2909
+ },
2910
+ "source_task_id": {
2911
+ "name": "source_task_id",
2912
+ "type": "text",
2913
+ "primaryKey": false,
2914
+ "notNull": false,
2915
+ "autoincrement": false
2916
+ },
2917
+ "detector_version": {
2918
+ "name": "detector_version",
2919
+ "type": "text",
2920
+ "primaryKey": false,
2921
+ "notNull": false,
2922
+ "autoincrement": false
2923
+ },
2924
+ "content_fingerprint": {
2925
+ "name": "content_fingerprint",
2926
+ "type": "text",
2927
+ "primaryKey": false,
2928
+ "notNull": false,
2929
+ "autoincrement": false
2930
+ },
2931
+ "dismissed_at": {
2932
+ "name": "dismissed_at",
2933
+ "type": "text",
2934
+ "primaryKey": false,
2935
+ "notNull": false,
2936
+ "autoincrement": false
2937
+ }
2938
+ },
2939
+ "indexes": {
2940
+ "idx_thread_highlights_thread_status_created": {
2941
+ "name": "idx_thread_highlights_thread_status_created",
2942
+ "columns": [
2943
+ "thread_id",
2944
+ "status",
2945
+ "created_at"
2946
+ ],
2947
+ "isUnique": false
2948
+ },
2949
+ "idx_thread_highlights_thread_covers": {
2950
+ "name": "idx_thread_highlights_thread_covers",
2951
+ "columns": [
2952
+ "thread_id",
2953
+ "covers_from_task_id",
2954
+ "covers_to_task_id"
2955
+ ],
2956
+ "isUnique": false
2957
+ },
2958
+ "thread_highlights_auto_idempotency_uq": {
2959
+ "name": "thread_highlights_auto_idempotency_uq",
2960
+ "columns": [
2961
+ "thread_id",
2962
+ "source_task_id",
2963
+ "detector_version",
2964
+ "content_fingerprint"
2965
+ ],
2966
+ "isUnique": true,
2967
+ "where": "\"thread_highlights\".\"source\" = 'auto'"
2968
+ }
2969
+ },
2970
+ "foreignKeys": {
2971
+ "thread_highlights_thread_id_threads_id_fk": {
2972
+ "name": "thread_highlights_thread_id_threads_id_fk",
2973
+ "tableFrom": "thread_highlights",
2974
+ "tableTo": "threads",
2975
+ "columnsFrom": [
2976
+ "thread_id"
2977
+ ],
2978
+ "columnsTo": [
2979
+ "id"
2980
+ ],
2981
+ "onDelete": "cascade",
2982
+ "onUpdate": "no action"
2983
+ }
2984
+ },
2985
+ "compositePrimaryKeys": {},
2986
+ "uniqueConstraints": {},
2987
+ "checkConstraints": {
2988
+ "thread_highlights_source_ck": {
2989
+ "name": "thread_highlights_source_ck",
2990
+ "value": "\"thread_highlights\".\"source\" IN ('auto', 'manual')"
2991
+ },
2992
+ "thread_highlights_kind_ck": {
2993
+ "name": "thread_highlights_kind_ck",
2994
+ "value": "\"thread_highlights\".\"kind\" IN ('decision', 'judgment', 'issue', 'result', 'pivot')"
2995
+ },
2996
+ "thread_highlights_status_ck": {
2997
+ "name": "thread_highlights_status_ck",
2998
+ "value": "\"thread_highlights\".\"status\" IN ('active', 'dismissed')"
2999
+ },
3000
+ "thread_highlights_active_text_ck": {
3001
+ "name": "thread_highlights_active_text_ck",
3002
+ "value": "\"thread_highlights\".\"status\" = 'dismissed' OR (\"thread_highlights\".\"text\" IS NOT NULL AND length(\"thread_highlights\".\"text\") > 0)"
3003
+ },
3004
+ "thread_highlights_covers_ck": {
3005
+ "name": "thread_highlights_covers_ck",
3006
+ "value": "length(\"thread_highlights\".\"covers_from_task_id\") > 0 AND length(\"thread_highlights\".\"covers_to_task_id\") > 0"
3007
+ },
3008
+ "thread_highlights_auto_key_ck": {
3009
+ "name": "thread_highlights_auto_key_ck",
3010
+ "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)"
3011
+ }
3012
+ }
3013
+ }
3014
+ },
3015
+ "views": {},
3016
+ "enums": {},
3017
+ "_meta": {
3018
+ "schemas": {},
3019
+ "tables": {},
3020
+ "columns": {}
3021
+ },
3022
+ "internal": {
3023
+ "indexes": {
3024
+ "idx_threads_workspace_thread_state": {
3025
+ "columns": {
3026
+ "json_extract(metadata, '$.threadTitle.state')": {
3027
+ "isExpression": true
3028
+ }
3029
+ }
3030
+ },
3031
+ "idx_threads_workspace_thread_priority": {
3032
+ "columns": {
3033
+ "json_extract(metadata, '$.threadTitle.priority')": {
3034
+ "isExpression": true
3035
+ }
3036
+ }
3037
+ },
3038
+ "idx_notifications_ws_created": {
3039
+ "columns": {
3040
+ "\"created_at\" DESC": {
3041
+ "isExpression": true
3042
+ }
3043
+ }
3044
+ }
3045
+ }
3046
+ }
3047
+ }