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