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

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