@crewx/sdk 0.9.0-rc.174 → 0.9.0-rc.175

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