@crewx/sdk 0.9.0-rc.74 → 0.9.0-rc.76

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