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

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