@matteai/stma-server 0.11.0

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 (43) hide show
  1. package/dist/index.js +18444 -0
  2. package/dist/index.js.map +1 -0
  3. package/drizzle/0000_nappy_franklin_storm.sql +115 -0
  4. package/drizzle/0001_grey_ogun.sql +1 -0
  5. package/drizzle/0002_crazy_vindicator.sql +1 -0
  6. package/drizzle/0003_tan_puma.sql +1 -0
  7. package/drizzle/0004_dry_selene.sql +40 -0
  8. package/drizzle/0005_hot_the_fallen.sql +103 -0
  9. package/drizzle/0006_cooing_cargill.sql +42 -0
  10. package/drizzle/0007_public_slyde.sql +12 -0
  11. package/drizzle/0008_loving_maestro.sql +9 -0
  12. package/drizzle/0009_cultured_bucky.sql +15 -0
  13. package/drizzle/0010_dazzling_mephisto.sql +26 -0
  14. package/drizzle/0011_kind_toxin.sql +20 -0
  15. package/drizzle/0012_ordinary_jamie_braddock.sql +31 -0
  16. package/drizzle/0013_warm_silk_fever.sql +7 -0
  17. package/drizzle/0014_talented_squadron_sinister.sql +22 -0
  18. package/drizzle/0015_wild_bill_hollister.sql +8 -0
  19. package/drizzle/0016_lucky_shooting_star.sql +8 -0
  20. package/drizzle/0017_same_blindfold.sql +21 -0
  21. package/drizzle/0018_premium_namora.sql +20 -0
  22. package/drizzle/0019_brown_dragon_lord.sql +6 -0
  23. package/drizzle/meta/0000_snapshot.json +845 -0
  24. package/drizzle/meta/0001_snapshot.json +851 -0
  25. package/drizzle/meta/0002_snapshot.json +857 -0
  26. package/drizzle/meta/0003_snapshot.json +863 -0
  27. package/drizzle/meta/0004_snapshot.json +1204 -0
  28. package/drizzle/meta/0005_snapshot.json +2063 -0
  29. package/drizzle/meta/0006_snapshot.json +2080 -0
  30. package/drizzle/meta/0007_snapshot.json +2157 -0
  31. package/drizzle/meta/0008_snapshot.json +2216 -0
  32. package/drizzle/meta/0009_snapshot.json +2314 -0
  33. package/drizzle/meta/0010_snapshot.json +2431 -0
  34. package/drizzle/meta/0011_snapshot.json +2608 -0
  35. package/drizzle/meta/0012_snapshot.json +2870 -0
  36. package/drizzle/meta/0013_snapshot.json +2918 -0
  37. package/drizzle/meta/0014_snapshot.json +3081 -0
  38. package/drizzle/meta/0015_snapshot.json +3093 -0
  39. package/drizzle/meta/0017_snapshot.json +3271 -0
  40. package/drizzle/meta/0018_snapshot.json +3430 -0
  41. package/drizzle/meta/0019_snapshot.json +3466 -0
  42. package/drizzle/meta/_journal.json +146 -0
  43. package/package.json +67 -0
@@ -0,0 +1,2314 @@
1
+ {
2
+ "id": "529fabb8-cc7a-4fc8-a850-8d5260a13e68",
3
+ "prevId": "48aec53b-e3eb-4434-9a4a-76459777cc30",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.activity": {
8
+ "name": "activity",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "team_id": {
19
+ "name": "team_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "project_id": {
25
+ "name": "project_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": false
29
+ },
30
+ "user_id": {
31
+ "name": "user_id",
32
+ "type": "uuid",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "token_id": {
37
+ "name": "token_id",
38
+ "type": "uuid",
39
+ "primaryKey": false,
40
+ "notNull": false
41
+ },
42
+ "action": {
43
+ "name": "action",
44
+ "type": "text",
45
+ "primaryKey": false,
46
+ "notNull": true
47
+ },
48
+ "detail": {
49
+ "name": "detail",
50
+ "type": "text",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "created_at": {
55
+ "name": "created_at",
56
+ "type": "timestamp with time zone",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": "now()"
60
+ }
61
+ },
62
+ "indexes": {
63
+ "activity_team_created": {
64
+ "name": "activity_team_created",
65
+ "columns": [
66
+ {
67
+ "expression": "team_id",
68
+ "isExpression": false,
69
+ "asc": true,
70
+ "nulls": "last"
71
+ },
72
+ {
73
+ "expression": "created_at",
74
+ "isExpression": false,
75
+ "asc": true,
76
+ "nulls": "last"
77
+ }
78
+ ],
79
+ "isUnique": false,
80
+ "concurrently": false,
81
+ "method": "btree",
82
+ "with": {}
83
+ }
84
+ },
85
+ "foreignKeys": {
86
+ "activity_team_id_teams_id_fk": {
87
+ "name": "activity_team_id_teams_id_fk",
88
+ "tableFrom": "activity",
89
+ "tableTo": "teams",
90
+ "columnsFrom": [
91
+ "team_id"
92
+ ],
93
+ "columnsTo": [
94
+ "id"
95
+ ],
96
+ "onDelete": "cascade",
97
+ "onUpdate": "no action"
98
+ },
99
+ "activity_project_id_projects_id_fk": {
100
+ "name": "activity_project_id_projects_id_fk",
101
+ "tableFrom": "activity",
102
+ "tableTo": "projects",
103
+ "columnsFrom": [
104
+ "project_id"
105
+ ],
106
+ "columnsTo": [
107
+ "id"
108
+ ],
109
+ "onDelete": "set null",
110
+ "onUpdate": "no action"
111
+ },
112
+ "activity_user_id_users_id_fk": {
113
+ "name": "activity_user_id_users_id_fk",
114
+ "tableFrom": "activity",
115
+ "tableTo": "users",
116
+ "columnsFrom": [
117
+ "user_id"
118
+ ],
119
+ "columnsTo": [
120
+ "id"
121
+ ],
122
+ "onDelete": "set null",
123
+ "onUpdate": "no action"
124
+ },
125
+ "activity_token_id_tokens_id_fk": {
126
+ "name": "activity_token_id_tokens_id_fk",
127
+ "tableFrom": "activity",
128
+ "tableTo": "tokens",
129
+ "columnsFrom": [
130
+ "token_id"
131
+ ],
132
+ "columnsTo": [
133
+ "id"
134
+ ],
135
+ "onDelete": "set null",
136
+ "onUpdate": "no action"
137
+ }
138
+ },
139
+ "compositePrimaryKeys": {},
140
+ "uniqueConstraints": {},
141
+ "policies": {},
142
+ "checkConstraints": {},
143
+ "isRLSEnabled": false
144
+ },
145
+ "public.agent_events": {
146
+ "name": "agent_events",
147
+ "schema": "",
148
+ "columns": {
149
+ "id": {
150
+ "name": "id",
151
+ "type": "uuid",
152
+ "primaryKey": true,
153
+ "notNull": true,
154
+ "default": "gen_random_uuid()"
155
+ },
156
+ "run_id": {
157
+ "name": "run_id",
158
+ "type": "uuid",
159
+ "primaryKey": false,
160
+ "notNull": true
161
+ },
162
+ "type": {
163
+ "name": "type",
164
+ "type": "text",
165
+ "primaryKey": false,
166
+ "notNull": true
167
+ },
168
+ "detail": {
169
+ "name": "detail",
170
+ "type": "jsonb",
171
+ "primaryKey": false,
172
+ "notNull": false
173
+ },
174
+ "created_at": {
175
+ "name": "created_at",
176
+ "type": "timestamp with time zone",
177
+ "primaryKey": false,
178
+ "notNull": true,
179
+ "default": "now()"
180
+ }
181
+ },
182
+ "indexes": {
183
+ "agent_events_run_created": {
184
+ "name": "agent_events_run_created",
185
+ "columns": [
186
+ {
187
+ "expression": "run_id",
188
+ "isExpression": false,
189
+ "asc": true,
190
+ "nulls": "last"
191
+ },
192
+ {
193
+ "expression": "created_at",
194
+ "isExpression": false,
195
+ "asc": true,
196
+ "nulls": "last"
197
+ }
198
+ ],
199
+ "isUnique": false,
200
+ "concurrently": false,
201
+ "method": "btree",
202
+ "with": {}
203
+ }
204
+ },
205
+ "foreignKeys": {
206
+ "agent_events_run_id_agent_runs_id_fk": {
207
+ "name": "agent_events_run_id_agent_runs_id_fk",
208
+ "tableFrom": "agent_events",
209
+ "tableTo": "agent_runs",
210
+ "columnsFrom": [
211
+ "run_id"
212
+ ],
213
+ "columnsTo": [
214
+ "id"
215
+ ],
216
+ "onDelete": "cascade",
217
+ "onUpdate": "no action"
218
+ }
219
+ },
220
+ "compositePrimaryKeys": {},
221
+ "uniqueConstraints": {},
222
+ "policies": {},
223
+ "checkConstraints": {},
224
+ "isRLSEnabled": false
225
+ },
226
+ "public.agent_installations": {
227
+ "name": "agent_installations",
228
+ "schema": "",
229
+ "columns": {
230
+ "id": {
231
+ "name": "id",
232
+ "type": "uuid",
233
+ "primaryKey": true,
234
+ "notNull": true,
235
+ "default": "gen_random_uuid()"
236
+ },
237
+ "user_id": {
238
+ "name": "user_id",
239
+ "type": "uuid",
240
+ "primaryKey": false,
241
+ "notNull": true
242
+ },
243
+ "name": {
244
+ "name": "name",
245
+ "type": "text",
246
+ "primaryKey": false,
247
+ "notNull": true
248
+ },
249
+ "client_type": {
250
+ "name": "client_type",
251
+ "type": "text",
252
+ "primaryKey": false,
253
+ "notNull": true,
254
+ "default": "'generic'"
255
+ },
256
+ "client_version": {
257
+ "name": "client_version",
258
+ "type": "text",
259
+ "primaryKey": false,
260
+ "notNull": false
261
+ },
262
+ "device_fingerprint": {
263
+ "name": "device_fingerprint",
264
+ "type": "text",
265
+ "primaryKey": false,
266
+ "notNull": true
267
+ },
268
+ "capabilities": {
269
+ "name": "capabilities",
270
+ "type": "jsonb",
271
+ "primaryKey": false,
272
+ "notNull": true,
273
+ "default": "'[]'::jsonb"
274
+ },
275
+ "last_seen_at": {
276
+ "name": "last_seen_at",
277
+ "type": "timestamp with time zone",
278
+ "primaryKey": false,
279
+ "notNull": true,
280
+ "default": "now()"
281
+ },
282
+ "revoked_at": {
283
+ "name": "revoked_at",
284
+ "type": "timestamp with time zone",
285
+ "primaryKey": false,
286
+ "notNull": false
287
+ },
288
+ "created_at": {
289
+ "name": "created_at",
290
+ "type": "timestamp with time zone",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {
297
+ "agent_installations_user_device_name": {
298
+ "name": "agent_installations_user_device_name",
299
+ "columns": [
300
+ {
301
+ "expression": "user_id",
302
+ "isExpression": false,
303
+ "asc": true,
304
+ "nulls": "last"
305
+ },
306
+ {
307
+ "expression": "device_fingerprint",
308
+ "isExpression": false,
309
+ "asc": true,
310
+ "nulls": "last"
311
+ },
312
+ {
313
+ "expression": "name",
314
+ "isExpression": false,
315
+ "asc": true,
316
+ "nulls": "last"
317
+ }
318
+ ],
319
+ "isUnique": true,
320
+ "concurrently": false,
321
+ "method": "btree",
322
+ "with": {}
323
+ }
324
+ },
325
+ "foreignKeys": {
326
+ "agent_installations_user_id_users_id_fk": {
327
+ "name": "agent_installations_user_id_users_id_fk",
328
+ "tableFrom": "agent_installations",
329
+ "tableTo": "users",
330
+ "columnsFrom": [
331
+ "user_id"
332
+ ],
333
+ "columnsTo": [
334
+ "id"
335
+ ],
336
+ "onDelete": "cascade",
337
+ "onUpdate": "no action"
338
+ }
339
+ },
340
+ "compositePrimaryKeys": {},
341
+ "uniqueConstraints": {},
342
+ "policies": {},
343
+ "checkConstraints": {},
344
+ "isRLSEnabled": false
345
+ },
346
+ "public.agent_runs": {
347
+ "name": "agent_runs",
348
+ "schema": "",
349
+ "columns": {
350
+ "id": {
351
+ "name": "id",
352
+ "type": "uuid",
353
+ "primaryKey": true,
354
+ "notNull": true,
355
+ "default": "gen_random_uuid()"
356
+ },
357
+ "installation_id": {
358
+ "name": "installation_id",
359
+ "type": "uuid",
360
+ "primaryKey": false,
361
+ "notNull": true
362
+ },
363
+ "team_id": {
364
+ "name": "team_id",
365
+ "type": "uuid",
366
+ "primaryKey": false,
367
+ "notNull": true
368
+ },
369
+ "project_id": {
370
+ "name": "project_id",
371
+ "type": "uuid",
372
+ "primaryKey": false,
373
+ "notNull": false
374
+ },
375
+ "task_key": {
376
+ "name": "task_key",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": false
380
+ },
381
+ "intent": {
382
+ "name": "intent",
383
+ "type": "text",
384
+ "primaryKey": false,
385
+ "notNull": false
386
+ },
387
+ "repo": {
388
+ "name": "repo",
389
+ "type": "text",
390
+ "primaryKey": false,
391
+ "notNull": false
392
+ },
393
+ "branch": {
394
+ "name": "branch",
395
+ "type": "text",
396
+ "primaryKey": false,
397
+ "notNull": false
398
+ },
399
+ "worktree": {
400
+ "name": "worktree",
401
+ "type": "text",
402
+ "primaryKey": false,
403
+ "notNull": false
404
+ },
405
+ "base_sha": {
406
+ "name": "base_sha",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": false
410
+ },
411
+ "status": {
412
+ "name": "status",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "default": "'starting'"
417
+ },
418
+ "policy_hash": {
419
+ "name": "policy_hash",
420
+ "type": "text",
421
+ "primaryKey": false,
422
+ "notNull": false
423
+ },
424
+ "environment_fingerprint": {
425
+ "name": "environment_fingerprint",
426
+ "type": "text",
427
+ "primaryKey": false,
428
+ "notNull": false
429
+ },
430
+ "started_at": {
431
+ "name": "started_at",
432
+ "type": "timestamp with time zone",
433
+ "primaryKey": false,
434
+ "notNull": true,
435
+ "default": "now()"
436
+ },
437
+ "last_heartbeat_at": {
438
+ "name": "last_heartbeat_at",
439
+ "type": "timestamp with time zone",
440
+ "primaryKey": false,
441
+ "notNull": true,
442
+ "default": "now()"
443
+ },
444
+ "ended_at": {
445
+ "name": "ended_at",
446
+ "type": "timestamp with time zone",
447
+ "primaryKey": false,
448
+ "notNull": false
449
+ }
450
+ },
451
+ "indexes": {
452
+ "agent_runs_team_status_heartbeat": {
453
+ "name": "agent_runs_team_status_heartbeat",
454
+ "columns": [
455
+ {
456
+ "expression": "team_id",
457
+ "isExpression": false,
458
+ "asc": true,
459
+ "nulls": "last"
460
+ },
461
+ {
462
+ "expression": "status",
463
+ "isExpression": false,
464
+ "asc": true,
465
+ "nulls": "last"
466
+ },
467
+ {
468
+ "expression": "last_heartbeat_at",
469
+ "isExpression": false,
470
+ "asc": true,
471
+ "nulls": "last"
472
+ }
473
+ ],
474
+ "isUnique": false,
475
+ "concurrently": false,
476
+ "method": "btree",
477
+ "with": {}
478
+ },
479
+ "agent_runs_installation_started": {
480
+ "name": "agent_runs_installation_started",
481
+ "columns": [
482
+ {
483
+ "expression": "installation_id",
484
+ "isExpression": false,
485
+ "asc": true,
486
+ "nulls": "last"
487
+ },
488
+ {
489
+ "expression": "started_at",
490
+ "isExpression": false,
491
+ "asc": true,
492
+ "nulls": "last"
493
+ }
494
+ ],
495
+ "isUnique": false,
496
+ "concurrently": false,
497
+ "method": "btree",
498
+ "with": {}
499
+ }
500
+ },
501
+ "foreignKeys": {
502
+ "agent_runs_installation_id_agent_installations_id_fk": {
503
+ "name": "agent_runs_installation_id_agent_installations_id_fk",
504
+ "tableFrom": "agent_runs",
505
+ "tableTo": "agent_installations",
506
+ "columnsFrom": [
507
+ "installation_id"
508
+ ],
509
+ "columnsTo": [
510
+ "id"
511
+ ],
512
+ "onDelete": "cascade",
513
+ "onUpdate": "no action"
514
+ },
515
+ "agent_runs_team_id_teams_id_fk": {
516
+ "name": "agent_runs_team_id_teams_id_fk",
517
+ "tableFrom": "agent_runs",
518
+ "tableTo": "teams",
519
+ "columnsFrom": [
520
+ "team_id"
521
+ ],
522
+ "columnsTo": [
523
+ "id"
524
+ ],
525
+ "onDelete": "cascade",
526
+ "onUpdate": "no action"
527
+ },
528
+ "agent_runs_project_id_projects_id_fk": {
529
+ "name": "agent_runs_project_id_projects_id_fk",
530
+ "tableFrom": "agent_runs",
531
+ "tableTo": "projects",
532
+ "columnsFrom": [
533
+ "project_id"
534
+ ],
535
+ "columnsTo": [
536
+ "id"
537
+ ],
538
+ "onDelete": "set null",
539
+ "onUpdate": "no action"
540
+ }
541
+ },
542
+ "compositePrimaryKeys": {},
543
+ "uniqueConstraints": {},
544
+ "policies": {},
545
+ "checkConstraints": {},
546
+ "isRLSEnabled": false
547
+ },
548
+ "public.crm_contacts": {
549
+ "name": "crm_contacts",
550
+ "schema": "",
551
+ "columns": {
552
+ "id": {
553
+ "name": "id",
554
+ "type": "uuid",
555
+ "primaryKey": true,
556
+ "notNull": true,
557
+ "default": "gen_random_uuid()"
558
+ },
559
+ "name": {
560
+ "name": "name",
561
+ "type": "text",
562
+ "primaryKey": false,
563
+ "notNull": true
564
+ },
565
+ "org": {
566
+ "name": "org",
567
+ "type": "text",
568
+ "primaryKey": false,
569
+ "notNull": false
570
+ },
571
+ "contact": {
572
+ "name": "contact",
573
+ "type": "text",
574
+ "primaryKey": false,
575
+ "notNull": false
576
+ },
577
+ "status": {
578
+ "name": "status",
579
+ "type": "text",
580
+ "primaryKey": false,
581
+ "notNull": true,
582
+ "default": "'lead'"
583
+ },
584
+ "source": {
585
+ "name": "source",
586
+ "type": "text",
587
+ "primaryKey": false,
588
+ "notNull": false
589
+ },
590
+ "notes": {
591
+ "name": "notes",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": false
595
+ },
596
+ "next_action_at": {
597
+ "name": "next_action_at",
598
+ "type": "timestamp with time zone",
599
+ "primaryKey": false,
600
+ "notNull": false
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp with time zone",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ },
609
+ "updated_at": {
610
+ "name": "updated_at",
611
+ "type": "timestamp with time zone",
612
+ "primaryKey": false,
613
+ "notNull": true,
614
+ "default": "now()"
615
+ }
616
+ },
617
+ "indexes": {},
618
+ "foreignKeys": {},
619
+ "compositePrimaryKeys": {},
620
+ "uniqueConstraints": {},
621
+ "policies": {},
622
+ "checkConstraints": {},
623
+ "isRLSEnabled": false
624
+ },
625
+ "public.debug_sessions": {
626
+ "name": "debug_sessions",
627
+ "schema": "",
628
+ "columns": {
629
+ "id": {
630
+ "name": "id",
631
+ "type": "uuid",
632
+ "primaryKey": true,
633
+ "notNull": true,
634
+ "default": "gen_random_uuid()"
635
+ },
636
+ "team_id": {
637
+ "name": "team_id",
638
+ "type": "uuid",
639
+ "primaryKey": false,
640
+ "notNull": true
641
+ },
642
+ "project_id": {
643
+ "name": "project_id",
644
+ "type": "uuid",
645
+ "primaryKey": false,
646
+ "notNull": false
647
+ },
648
+ "kind": {
649
+ "name": "kind",
650
+ "type": "text",
651
+ "primaryKey": false,
652
+ "notNull": true,
653
+ "default": "'debug'"
654
+ },
655
+ "title": {
656
+ "name": "title",
657
+ "type": "text",
658
+ "primaryKey": false,
659
+ "notNull": true
660
+ },
661
+ "status": {
662
+ "name": "status",
663
+ "type": "text",
664
+ "primaryKey": false,
665
+ "notNull": true,
666
+ "default": "'open'"
667
+ },
668
+ "opened_by": {
669
+ "name": "opened_by",
670
+ "type": "uuid",
671
+ "primaryKey": false,
672
+ "notNull": false
673
+ },
674
+ "context": {
675
+ "name": "context",
676
+ "type": "jsonb",
677
+ "primaryKey": false,
678
+ "notNull": false
679
+ },
680
+ "resolution": {
681
+ "name": "resolution",
682
+ "type": "jsonb",
683
+ "primaryKey": false,
684
+ "notNull": false
685
+ },
686
+ "created_at": {
687
+ "name": "created_at",
688
+ "type": "timestamp with time zone",
689
+ "primaryKey": false,
690
+ "notNull": true,
691
+ "default": "now()"
692
+ },
693
+ "resolved_at": {
694
+ "name": "resolved_at",
695
+ "type": "timestamp with time zone",
696
+ "primaryKey": false,
697
+ "notNull": false
698
+ }
699
+ },
700
+ "indexes": {
701
+ "debug_sessions_team_announcements": {
702
+ "name": "debug_sessions_team_announcements",
703
+ "columns": [
704
+ {
705
+ "expression": "team_id",
706
+ "isExpression": false,
707
+ "asc": true,
708
+ "nulls": "last"
709
+ }
710
+ ],
711
+ "isUnique": true,
712
+ "where": "kind = 'announcements'",
713
+ "concurrently": false,
714
+ "method": "btree",
715
+ "with": {}
716
+ }
717
+ },
718
+ "foreignKeys": {
719
+ "debug_sessions_team_id_teams_id_fk": {
720
+ "name": "debug_sessions_team_id_teams_id_fk",
721
+ "tableFrom": "debug_sessions",
722
+ "tableTo": "teams",
723
+ "columnsFrom": [
724
+ "team_id"
725
+ ],
726
+ "columnsTo": [
727
+ "id"
728
+ ],
729
+ "onDelete": "cascade",
730
+ "onUpdate": "no action"
731
+ },
732
+ "debug_sessions_project_id_projects_id_fk": {
733
+ "name": "debug_sessions_project_id_projects_id_fk",
734
+ "tableFrom": "debug_sessions",
735
+ "tableTo": "projects",
736
+ "columnsFrom": [
737
+ "project_id"
738
+ ],
739
+ "columnsTo": [
740
+ "id"
741
+ ],
742
+ "onDelete": "set null",
743
+ "onUpdate": "no action"
744
+ },
745
+ "debug_sessions_opened_by_users_id_fk": {
746
+ "name": "debug_sessions_opened_by_users_id_fk",
747
+ "tableFrom": "debug_sessions",
748
+ "tableTo": "users",
749
+ "columnsFrom": [
750
+ "opened_by"
751
+ ],
752
+ "columnsTo": [
753
+ "id"
754
+ ],
755
+ "onDelete": "no action",
756
+ "onUpdate": "no action"
757
+ }
758
+ },
759
+ "compositePrimaryKeys": {},
760
+ "uniqueConstraints": {},
761
+ "policies": {},
762
+ "checkConstraints": {},
763
+ "isRLSEnabled": false
764
+ },
765
+ "public.environment_baselines": {
766
+ "name": "environment_baselines",
767
+ "schema": "",
768
+ "columns": {
769
+ "id": {
770
+ "name": "id",
771
+ "type": "uuid",
772
+ "primaryKey": true,
773
+ "notNull": true,
774
+ "default": "gen_random_uuid()"
775
+ },
776
+ "team_id": {
777
+ "name": "team_id",
778
+ "type": "uuid",
779
+ "primaryKey": false,
780
+ "notNull": true
781
+ },
782
+ "project_id": {
783
+ "name": "project_id",
784
+ "type": "uuid",
785
+ "primaryKey": false,
786
+ "notNull": true
787
+ },
788
+ "data": {
789
+ "name": "data",
790
+ "type": "jsonb",
791
+ "primaryKey": false,
792
+ "notNull": true
793
+ },
794
+ "fingerprint": {
795
+ "name": "fingerprint",
796
+ "type": "text",
797
+ "primaryKey": false,
798
+ "notNull": true
799
+ },
800
+ "active": {
801
+ "name": "active",
802
+ "type": "boolean",
803
+ "primaryKey": false,
804
+ "notNull": true,
805
+ "default": true
806
+ },
807
+ "created_by": {
808
+ "name": "created_by",
809
+ "type": "uuid",
810
+ "primaryKey": false,
811
+ "notNull": false
812
+ },
813
+ "created_at": {
814
+ "name": "created_at",
815
+ "type": "timestamp with time zone",
816
+ "primaryKey": false,
817
+ "notNull": true,
818
+ "default": "now()"
819
+ }
820
+ },
821
+ "indexes": {
822
+ "environment_baselines_project_active": {
823
+ "name": "environment_baselines_project_active",
824
+ "columns": [
825
+ {
826
+ "expression": "project_id",
827
+ "isExpression": false,
828
+ "asc": true,
829
+ "nulls": "last"
830
+ },
831
+ {
832
+ "expression": "active",
833
+ "isExpression": false,
834
+ "asc": true,
835
+ "nulls": "last"
836
+ },
837
+ {
838
+ "expression": "created_at",
839
+ "isExpression": false,
840
+ "asc": true,
841
+ "nulls": "last"
842
+ }
843
+ ],
844
+ "isUnique": false,
845
+ "concurrently": false,
846
+ "method": "btree",
847
+ "with": {}
848
+ }
849
+ },
850
+ "foreignKeys": {
851
+ "environment_baselines_team_id_teams_id_fk": {
852
+ "name": "environment_baselines_team_id_teams_id_fk",
853
+ "tableFrom": "environment_baselines",
854
+ "tableTo": "teams",
855
+ "columnsFrom": [
856
+ "team_id"
857
+ ],
858
+ "columnsTo": [
859
+ "id"
860
+ ],
861
+ "onDelete": "cascade",
862
+ "onUpdate": "no action"
863
+ },
864
+ "environment_baselines_project_id_projects_id_fk": {
865
+ "name": "environment_baselines_project_id_projects_id_fk",
866
+ "tableFrom": "environment_baselines",
867
+ "tableTo": "projects",
868
+ "columnsFrom": [
869
+ "project_id"
870
+ ],
871
+ "columnsTo": [
872
+ "id"
873
+ ],
874
+ "onDelete": "cascade",
875
+ "onUpdate": "no action"
876
+ },
877
+ "environment_baselines_created_by_users_id_fk": {
878
+ "name": "environment_baselines_created_by_users_id_fk",
879
+ "tableFrom": "environment_baselines",
880
+ "tableTo": "users",
881
+ "columnsFrom": [
882
+ "created_by"
883
+ ],
884
+ "columnsTo": [
885
+ "id"
886
+ ],
887
+ "onDelete": "set null",
888
+ "onUpdate": "no action"
889
+ }
890
+ },
891
+ "compositePrimaryKeys": {},
892
+ "uniqueConstraints": {},
893
+ "policies": {},
894
+ "checkConstraints": {},
895
+ "isRLSEnabled": false
896
+ },
897
+ "public.error_events": {
898
+ "name": "error_events",
899
+ "schema": "",
900
+ "columns": {
901
+ "id": {
902
+ "name": "id",
903
+ "type": "uuid",
904
+ "primaryKey": true,
905
+ "notNull": true,
906
+ "default": "gen_random_uuid()"
907
+ },
908
+ "at": {
909
+ "name": "at",
910
+ "type": "timestamp with time zone",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "default": "now()"
914
+ },
915
+ "kind": {
916
+ "name": "kind",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "default": "'http'"
921
+ },
922
+ "method": {
923
+ "name": "method",
924
+ "type": "text",
925
+ "primaryKey": false,
926
+ "notNull": false
927
+ },
928
+ "path": {
929
+ "name": "path",
930
+ "type": "text",
931
+ "primaryKey": false,
932
+ "notNull": false
933
+ },
934
+ "status": {
935
+ "name": "status",
936
+ "type": "integer",
937
+ "primaryKey": false,
938
+ "notNull": false
939
+ },
940
+ "message": {
941
+ "name": "message",
942
+ "type": "text",
943
+ "primaryKey": false,
944
+ "notNull": true
945
+ },
946
+ "stack": {
947
+ "name": "stack",
948
+ "type": "text",
949
+ "primaryKey": false,
950
+ "notNull": false
951
+ },
952
+ "user_id": {
953
+ "name": "user_id",
954
+ "type": "text",
955
+ "primaryKey": false,
956
+ "notNull": false
957
+ },
958
+ "team_slug": {
959
+ "name": "team_slug",
960
+ "type": "text",
961
+ "primaryKey": false,
962
+ "notNull": false
963
+ },
964
+ "request_id": {
965
+ "name": "request_id",
966
+ "type": "text",
967
+ "primaryKey": false,
968
+ "notNull": false
969
+ }
970
+ },
971
+ "indexes": {
972
+ "error_events_at": {
973
+ "name": "error_events_at",
974
+ "columns": [
975
+ {
976
+ "expression": "at",
977
+ "isExpression": false,
978
+ "asc": false,
979
+ "nulls": "last"
980
+ }
981
+ ],
982
+ "isUnique": false,
983
+ "concurrently": false,
984
+ "method": "btree",
985
+ "with": {}
986
+ }
987
+ },
988
+ "foreignKeys": {},
989
+ "compositePrimaryKeys": {},
990
+ "uniqueConstraints": {},
991
+ "policies": {},
992
+ "checkConstraints": {},
993
+ "isRLSEnabled": false
994
+ },
995
+ "public.invites": {
996
+ "name": "invites",
997
+ "schema": "",
998
+ "columns": {
999
+ "id": {
1000
+ "name": "id",
1001
+ "type": "uuid",
1002
+ "primaryKey": true,
1003
+ "notNull": true,
1004
+ "default": "gen_random_uuid()"
1005
+ },
1006
+ "team_id": {
1007
+ "name": "team_id",
1008
+ "type": "uuid",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "code": {
1013
+ "name": "code",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": true
1017
+ },
1018
+ "created_by": {
1019
+ "name": "created_by",
1020
+ "type": "uuid",
1021
+ "primaryKey": false,
1022
+ "notNull": false
1023
+ },
1024
+ "expires_at": {
1025
+ "name": "expires_at",
1026
+ "type": "timestamp with time zone",
1027
+ "primaryKey": false,
1028
+ "notNull": true
1029
+ },
1030
+ "uses": {
1031
+ "name": "uses",
1032
+ "type": "integer",
1033
+ "primaryKey": false,
1034
+ "notNull": true,
1035
+ "default": 0
1036
+ },
1037
+ "max_uses": {
1038
+ "name": "max_uses",
1039
+ "type": "integer",
1040
+ "primaryKey": false,
1041
+ "notNull": false
1042
+ },
1043
+ "created_at": {
1044
+ "name": "created_at",
1045
+ "type": "timestamp with time zone",
1046
+ "primaryKey": false,
1047
+ "notNull": true,
1048
+ "default": "now()"
1049
+ }
1050
+ },
1051
+ "indexes": {},
1052
+ "foreignKeys": {
1053
+ "invites_team_id_teams_id_fk": {
1054
+ "name": "invites_team_id_teams_id_fk",
1055
+ "tableFrom": "invites",
1056
+ "tableTo": "teams",
1057
+ "columnsFrom": [
1058
+ "team_id"
1059
+ ],
1060
+ "columnsTo": [
1061
+ "id"
1062
+ ],
1063
+ "onDelete": "cascade",
1064
+ "onUpdate": "no action"
1065
+ },
1066
+ "invites_created_by_users_id_fk": {
1067
+ "name": "invites_created_by_users_id_fk",
1068
+ "tableFrom": "invites",
1069
+ "tableTo": "users",
1070
+ "columnsFrom": [
1071
+ "created_by"
1072
+ ],
1073
+ "columnsTo": [
1074
+ "id"
1075
+ ],
1076
+ "onDelete": "no action",
1077
+ "onUpdate": "no action"
1078
+ }
1079
+ },
1080
+ "compositePrimaryKeys": {},
1081
+ "uniqueConstraints": {
1082
+ "invites_code_unique": {
1083
+ "name": "invites_code_unique",
1084
+ "nullsNotDistinct": false,
1085
+ "columns": [
1086
+ "code"
1087
+ ]
1088
+ }
1089
+ },
1090
+ "policies": {},
1091
+ "checkConstraints": {},
1092
+ "isRLSEnabled": false
1093
+ },
1094
+ "public.memberships": {
1095
+ "name": "memberships",
1096
+ "schema": "",
1097
+ "columns": {
1098
+ "team_id": {
1099
+ "name": "team_id",
1100
+ "type": "uuid",
1101
+ "primaryKey": false,
1102
+ "notNull": true
1103
+ },
1104
+ "user_id": {
1105
+ "name": "user_id",
1106
+ "type": "uuid",
1107
+ "primaryKey": false,
1108
+ "notNull": true
1109
+ },
1110
+ "role": {
1111
+ "name": "role",
1112
+ "type": "text",
1113
+ "primaryKey": false,
1114
+ "notNull": true,
1115
+ "default": "'member'"
1116
+ },
1117
+ "created_at": {
1118
+ "name": "created_at",
1119
+ "type": "timestamp with time zone",
1120
+ "primaryKey": false,
1121
+ "notNull": true,
1122
+ "default": "now()"
1123
+ }
1124
+ },
1125
+ "indexes": {},
1126
+ "foreignKeys": {
1127
+ "memberships_team_id_teams_id_fk": {
1128
+ "name": "memberships_team_id_teams_id_fk",
1129
+ "tableFrom": "memberships",
1130
+ "tableTo": "teams",
1131
+ "columnsFrom": [
1132
+ "team_id"
1133
+ ],
1134
+ "columnsTo": [
1135
+ "id"
1136
+ ],
1137
+ "onDelete": "cascade",
1138
+ "onUpdate": "no action"
1139
+ },
1140
+ "memberships_user_id_users_id_fk": {
1141
+ "name": "memberships_user_id_users_id_fk",
1142
+ "tableFrom": "memberships",
1143
+ "tableTo": "users",
1144
+ "columnsFrom": [
1145
+ "user_id"
1146
+ ],
1147
+ "columnsTo": [
1148
+ "id"
1149
+ ],
1150
+ "onDelete": "cascade",
1151
+ "onUpdate": "no action"
1152
+ }
1153
+ },
1154
+ "compositePrimaryKeys": {
1155
+ "memberships_team_id_user_id_pk": {
1156
+ "name": "memberships_team_id_user_id_pk",
1157
+ "columns": [
1158
+ "team_id",
1159
+ "user_id"
1160
+ ]
1161
+ }
1162
+ },
1163
+ "uniqueConstraints": {},
1164
+ "policies": {},
1165
+ "checkConstraints": {},
1166
+ "isRLSEnabled": false
1167
+ },
1168
+ "public.messages": {
1169
+ "name": "messages",
1170
+ "schema": "",
1171
+ "columns": {
1172
+ "id": {
1173
+ "name": "id",
1174
+ "type": "uuid",
1175
+ "primaryKey": true,
1176
+ "notNull": true,
1177
+ "default": "gen_random_uuid()"
1178
+ },
1179
+ "session_id": {
1180
+ "name": "session_id",
1181
+ "type": "uuid",
1182
+ "primaryKey": false,
1183
+ "notNull": true
1184
+ },
1185
+ "author_id": {
1186
+ "name": "author_id",
1187
+ "type": "uuid",
1188
+ "primaryKey": false,
1189
+ "notNull": false
1190
+ },
1191
+ "token_id": {
1192
+ "name": "token_id",
1193
+ "type": "uuid",
1194
+ "primaryKey": false,
1195
+ "notNull": false
1196
+ },
1197
+ "kind": {
1198
+ "name": "kind",
1199
+ "type": "text",
1200
+ "primaryKey": false,
1201
+ "notNull": true,
1202
+ "default": "'note'"
1203
+ },
1204
+ "via": {
1205
+ "name": "via",
1206
+ "type": "text",
1207
+ "primaryKey": false,
1208
+ "notNull": false
1209
+ },
1210
+ "body": {
1211
+ "name": "body",
1212
+ "type": "text",
1213
+ "primaryKey": false,
1214
+ "notNull": true
1215
+ },
1216
+ "attachments": {
1217
+ "name": "attachments",
1218
+ "type": "jsonb",
1219
+ "primaryKey": false,
1220
+ "notNull": false
1221
+ },
1222
+ "created_at": {
1223
+ "name": "created_at",
1224
+ "type": "timestamp with time zone",
1225
+ "primaryKey": false,
1226
+ "notNull": true,
1227
+ "default": "now()"
1228
+ }
1229
+ },
1230
+ "indexes": {
1231
+ "messages_session_created": {
1232
+ "name": "messages_session_created",
1233
+ "columns": [
1234
+ {
1235
+ "expression": "session_id",
1236
+ "isExpression": false,
1237
+ "asc": true,
1238
+ "nulls": "last"
1239
+ },
1240
+ {
1241
+ "expression": "created_at",
1242
+ "isExpression": false,
1243
+ "asc": true,
1244
+ "nulls": "last"
1245
+ }
1246
+ ],
1247
+ "isUnique": false,
1248
+ "concurrently": false,
1249
+ "method": "btree",
1250
+ "with": {}
1251
+ }
1252
+ },
1253
+ "foreignKeys": {
1254
+ "messages_session_id_debug_sessions_id_fk": {
1255
+ "name": "messages_session_id_debug_sessions_id_fk",
1256
+ "tableFrom": "messages",
1257
+ "tableTo": "debug_sessions",
1258
+ "columnsFrom": [
1259
+ "session_id"
1260
+ ],
1261
+ "columnsTo": [
1262
+ "id"
1263
+ ],
1264
+ "onDelete": "cascade",
1265
+ "onUpdate": "no action"
1266
+ },
1267
+ "messages_author_id_users_id_fk": {
1268
+ "name": "messages_author_id_users_id_fk",
1269
+ "tableFrom": "messages",
1270
+ "tableTo": "users",
1271
+ "columnsFrom": [
1272
+ "author_id"
1273
+ ],
1274
+ "columnsTo": [
1275
+ "id"
1276
+ ],
1277
+ "onDelete": "no action",
1278
+ "onUpdate": "no action"
1279
+ },
1280
+ "messages_token_id_tokens_id_fk": {
1281
+ "name": "messages_token_id_tokens_id_fk",
1282
+ "tableFrom": "messages",
1283
+ "tableTo": "tokens",
1284
+ "columnsFrom": [
1285
+ "token_id"
1286
+ ],
1287
+ "columnsTo": [
1288
+ "id"
1289
+ ],
1290
+ "onDelete": "set null",
1291
+ "onUpdate": "no action"
1292
+ }
1293
+ },
1294
+ "compositePrimaryKeys": {},
1295
+ "uniqueConstraints": {},
1296
+ "policies": {},
1297
+ "checkConstraints": {},
1298
+ "isRLSEnabled": false
1299
+ },
1300
+ "public.policy_bundles": {
1301
+ "name": "policy_bundles",
1302
+ "schema": "",
1303
+ "columns": {
1304
+ "id": {
1305
+ "name": "id",
1306
+ "type": "uuid",
1307
+ "primaryKey": true,
1308
+ "notNull": true,
1309
+ "default": "gen_random_uuid()"
1310
+ },
1311
+ "team_id": {
1312
+ "name": "team_id",
1313
+ "type": "uuid",
1314
+ "primaryKey": false,
1315
+ "notNull": true
1316
+ },
1317
+ "project_id": {
1318
+ "name": "project_id",
1319
+ "type": "uuid",
1320
+ "primaryKey": false,
1321
+ "notNull": false
1322
+ },
1323
+ "scope_key": {
1324
+ "name": "scope_key",
1325
+ "type": "text",
1326
+ "primaryKey": false,
1327
+ "notNull": true
1328
+ },
1329
+ "version": {
1330
+ "name": "version",
1331
+ "type": "integer",
1332
+ "primaryKey": false,
1333
+ "notNull": true
1334
+ },
1335
+ "status": {
1336
+ "name": "status",
1337
+ "type": "text",
1338
+ "primaryKey": false,
1339
+ "notNull": true,
1340
+ "default": "'active'"
1341
+ },
1342
+ "document": {
1343
+ "name": "document",
1344
+ "type": "jsonb",
1345
+ "primaryKey": false,
1346
+ "notNull": true
1347
+ },
1348
+ "hash": {
1349
+ "name": "hash",
1350
+ "type": "text",
1351
+ "primaryKey": false,
1352
+ "notNull": true
1353
+ },
1354
+ "created_by": {
1355
+ "name": "created_by",
1356
+ "type": "uuid",
1357
+ "primaryKey": false,
1358
+ "notNull": false
1359
+ },
1360
+ "created_at": {
1361
+ "name": "created_at",
1362
+ "type": "timestamp with time zone",
1363
+ "primaryKey": false,
1364
+ "notNull": true,
1365
+ "default": "now()"
1366
+ }
1367
+ },
1368
+ "indexes": {
1369
+ "policy_bundles_team_scope_version": {
1370
+ "name": "policy_bundles_team_scope_version",
1371
+ "columns": [
1372
+ {
1373
+ "expression": "team_id",
1374
+ "isExpression": false,
1375
+ "asc": true,
1376
+ "nulls": "last"
1377
+ },
1378
+ {
1379
+ "expression": "scope_key",
1380
+ "isExpression": false,
1381
+ "asc": true,
1382
+ "nulls": "last"
1383
+ },
1384
+ {
1385
+ "expression": "version",
1386
+ "isExpression": false,
1387
+ "asc": true,
1388
+ "nulls": "last"
1389
+ }
1390
+ ],
1391
+ "isUnique": true,
1392
+ "concurrently": false,
1393
+ "method": "btree",
1394
+ "with": {}
1395
+ }
1396
+ },
1397
+ "foreignKeys": {
1398
+ "policy_bundles_team_id_teams_id_fk": {
1399
+ "name": "policy_bundles_team_id_teams_id_fk",
1400
+ "tableFrom": "policy_bundles",
1401
+ "tableTo": "teams",
1402
+ "columnsFrom": [
1403
+ "team_id"
1404
+ ],
1405
+ "columnsTo": [
1406
+ "id"
1407
+ ],
1408
+ "onDelete": "cascade",
1409
+ "onUpdate": "no action"
1410
+ },
1411
+ "policy_bundles_project_id_projects_id_fk": {
1412
+ "name": "policy_bundles_project_id_projects_id_fk",
1413
+ "tableFrom": "policy_bundles",
1414
+ "tableTo": "projects",
1415
+ "columnsFrom": [
1416
+ "project_id"
1417
+ ],
1418
+ "columnsTo": [
1419
+ "id"
1420
+ ],
1421
+ "onDelete": "cascade",
1422
+ "onUpdate": "no action"
1423
+ },
1424
+ "policy_bundles_created_by_users_id_fk": {
1425
+ "name": "policy_bundles_created_by_users_id_fk",
1426
+ "tableFrom": "policy_bundles",
1427
+ "tableTo": "users",
1428
+ "columnsFrom": [
1429
+ "created_by"
1430
+ ],
1431
+ "columnsTo": [
1432
+ "id"
1433
+ ],
1434
+ "onDelete": "set null",
1435
+ "onUpdate": "no action"
1436
+ }
1437
+ },
1438
+ "compositePrimaryKeys": {},
1439
+ "uniqueConstraints": {},
1440
+ "policies": {},
1441
+ "checkConstraints": {},
1442
+ "isRLSEnabled": false
1443
+ },
1444
+ "public.policy_receipts": {
1445
+ "name": "policy_receipts",
1446
+ "schema": "",
1447
+ "columns": {
1448
+ "run_id": {
1449
+ "name": "run_id",
1450
+ "type": "uuid",
1451
+ "primaryKey": true,
1452
+ "notNull": true
1453
+ },
1454
+ "expected_hash": {
1455
+ "name": "expected_hash",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": true
1459
+ },
1460
+ "reported_hash": {
1461
+ "name": "reported_hash",
1462
+ "type": "text",
1463
+ "primaryKey": false,
1464
+ "notNull": false
1465
+ },
1466
+ "drift": {
1467
+ "name": "drift",
1468
+ "type": "boolean",
1469
+ "primaryKey": false,
1470
+ "notNull": true,
1471
+ "default": false
1472
+ },
1473
+ "created_at": {
1474
+ "name": "created_at",
1475
+ "type": "timestamp with time zone",
1476
+ "primaryKey": false,
1477
+ "notNull": true,
1478
+ "default": "now()"
1479
+ }
1480
+ },
1481
+ "indexes": {},
1482
+ "foreignKeys": {
1483
+ "policy_receipts_run_id_agent_runs_id_fk": {
1484
+ "name": "policy_receipts_run_id_agent_runs_id_fk",
1485
+ "tableFrom": "policy_receipts",
1486
+ "tableTo": "agent_runs",
1487
+ "columnsFrom": [
1488
+ "run_id"
1489
+ ],
1490
+ "columnsTo": [
1491
+ "id"
1492
+ ],
1493
+ "onDelete": "cascade",
1494
+ "onUpdate": "no action"
1495
+ }
1496
+ },
1497
+ "compositePrimaryKeys": {},
1498
+ "uniqueConstraints": {},
1499
+ "policies": {},
1500
+ "checkConstraints": {},
1501
+ "isRLSEnabled": false
1502
+ },
1503
+ "public.projects": {
1504
+ "name": "projects",
1505
+ "schema": "",
1506
+ "columns": {
1507
+ "id": {
1508
+ "name": "id",
1509
+ "type": "uuid",
1510
+ "primaryKey": true,
1511
+ "notNull": true,
1512
+ "default": "gen_random_uuid()"
1513
+ },
1514
+ "team_id": {
1515
+ "name": "team_id",
1516
+ "type": "uuid",
1517
+ "primaryKey": false,
1518
+ "notNull": true
1519
+ },
1520
+ "name": {
1521
+ "name": "name",
1522
+ "type": "text",
1523
+ "primaryKey": false,
1524
+ "notNull": true
1525
+ },
1526
+ "slug": {
1527
+ "name": "slug",
1528
+ "type": "text",
1529
+ "primaryKey": false,
1530
+ "notNull": true
1531
+ },
1532
+ "created_by": {
1533
+ "name": "created_by",
1534
+ "type": "uuid",
1535
+ "primaryKey": false,
1536
+ "notNull": false
1537
+ },
1538
+ "created_at": {
1539
+ "name": "created_at",
1540
+ "type": "timestamp with time zone",
1541
+ "primaryKey": false,
1542
+ "notNull": true,
1543
+ "default": "now()"
1544
+ }
1545
+ },
1546
+ "indexes": {
1547
+ "projects_team_slug": {
1548
+ "name": "projects_team_slug",
1549
+ "columns": [
1550
+ {
1551
+ "expression": "team_id",
1552
+ "isExpression": false,
1553
+ "asc": true,
1554
+ "nulls": "last"
1555
+ },
1556
+ {
1557
+ "expression": "slug",
1558
+ "isExpression": false,
1559
+ "asc": true,
1560
+ "nulls": "last"
1561
+ }
1562
+ ],
1563
+ "isUnique": true,
1564
+ "concurrently": false,
1565
+ "method": "btree",
1566
+ "with": {}
1567
+ }
1568
+ },
1569
+ "foreignKeys": {
1570
+ "projects_team_id_teams_id_fk": {
1571
+ "name": "projects_team_id_teams_id_fk",
1572
+ "tableFrom": "projects",
1573
+ "tableTo": "teams",
1574
+ "columnsFrom": [
1575
+ "team_id"
1576
+ ],
1577
+ "columnsTo": [
1578
+ "id"
1579
+ ],
1580
+ "onDelete": "cascade",
1581
+ "onUpdate": "no action"
1582
+ },
1583
+ "projects_created_by_users_id_fk": {
1584
+ "name": "projects_created_by_users_id_fk",
1585
+ "tableFrom": "projects",
1586
+ "tableTo": "users",
1587
+ "columnsFrom": [
1588
+ "created_by"
1589
+ ],
1590
+ "columnsTo": [
1591
+ "id"
1592
+ ],
1593
+ "onDelete": "no action",
1594
+ "onUpdate": "no action"
1595
+ }
1596
+ },
1597
+ "compositePrimaryKeys": {},
1598
+ "uniqueConstraints": {},
1599
+ "policies": {},
1600
+ "checkConstraints": {},
1601
+ "isRLSEnabled": false
1602
+ },
1603
+ "public.read_state": {
1604
+ "name": "read_state",
1605
+ "schema": "",
1606
+ "columns": {
1607
+ "user_id": {
1608
+ "name": "user_id",
1609
+ "type": "uuid",
1610
+ "primaryKey": false,
1611
+ "notNull": true
1612
+ },
1613
+ "session_id": {
1614
+ "name": "session_id",
1615
+ "type": "uuid",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "last_read_at": {
1620
+ "name": "last_read_at",
1621
+ "type": "timestamp with time zone",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "default": "now()"
1625
+ }
1626
+ },
1627
+ "indexes": {},
1628
+ "foreignKeys": {
1629
+ "read_state_user_id_users_id_fk": {
1630
+ "name": "read_state_user_id_users_id_fk",
1631
+ "tableFrom": "read_state",
1632
+ "tableTo": "users",
1633
+ "columnsFrom": [
1634
+ "user_id"
1635
+ ],
1636
+ "columnsTo": [
1637
+ "id"
1638
+ ],
1639
+ "onDelete": "cascade",
1640
+ "onUpdate": "no action"
1641
+ },
1642
+ "read_state_session_id_debug_sessions_id_fk": {
1643
+ "name": "read_state_session_id_debug_sessions_id_fk",
1644
+ "tableFrom": "read_state",
1645
+ "tableTo": "debug_sessions",
1646
+ "columnsFrom": [
1647
+ "session_id"
1648
+ ],
1649
+ "columnsTo": [
1650
+ "id"
1651
+ ],
1652
+ "onDelete": "cascade",
1653
+ "onUpdate": "no action"
1654
+ }
1655
+ },
1656
+ "compositePrimaryKeys": {
1657
+ "read_state_user_id_session_id_pk": {
1658
+ "name": "read_state_user_id_session_id_pk",
1659
+ "columns": [
1660
+ "user_id",
1661
+ "session_id"
1662
+ ]
1663
+ }
1664
+ },
1665
+ "uniqueConstraints": {},
1666
+ "policies": {},
1667
+ "checkConstraints": {},
1668
+ "isRLSEnabled": false
1669
+ },
1670
+ "public.snapshots": {
1671
+ "name": "snapshots",
1672
+ "schema": "",
1673
+ "columns": {
1674
+ "id": {
1675
+ "name": "id",
1676
+ "type": "uuid",
1677
+ "primaryKey": true,
1678
+ "notNull": true,
1679
+ "default": "gen_random_uuid()"
1680
+ },
1681
+ "team_id": {
1682
+ "name": "team_id",
1683
+ "type": "uuid",
1684
+ "primaryKey": false,
1685
+ "notNull": true
1686
+ },
1687
+ "user_id": {
1688
+ "name": "user_id",
1689
+ "type": "uuid",
1690
+ "primaryKey": false,
1691
+ "notNull": true
1692
+ },
1693
+ "repo": {
1694
+ "name": "repo",
1695
+ "type": "text",
1696
+ "primaryKey": false,
1697
+ "notNull": false
1698
+ },
1699
+ "project_id": {
1700
+ "name": "project_id",
1701
+ "type": "uuid",
1702
+ "primaryKey": false,
1703
+ "notNull": false
1704
+ },
1705
+ "token_id": {
1706
+ "name": "token_id",
1707
+ "type": "uuid",
1708
+ "primaryKey": false,
1709
+ "notNull": false
1710
+ },
1711
+ "device_label": {
1712
+ "name": "device_label",
1713
+ "type": "text",
1714
+ "primaryKey": false,
1715
+ "notNull": true,
1716
+ "default": "'default'"
1717
+ },
1718
+ "device_id": {
1719
+ "name": "device_id",
1720
+ "type": "uuid",
1721
+ "primaryKey": false,
1722
+ "notNull": false
1723
+ },
1724
+ "data": {
1725
+ "name": "data",
1726
+ "type": "jsonb",
1727
+ "primaryKey": false,
1728
+ "notNull": true
1729
+ },
1730
+ "created_at": {
1731
+ "name": "created_at",
1732
+ "type": "timestamp with time zone",
1733
+ "primaryKey": false,
1734
+ "notNull": true,
1735
+ "default": "now()"
1736
+ }
1737
+ },
1738
+ "indexes": {
1739
+ "snapshots_team_user_created": {
1740
+ "name": "snapshots_team_user_created",
1741
+ "columns": [
1742
+ {
1743
+ "expression": "team_id",
1744
+ "isExpression": false,
1745
+ "asc": true,
1746
+ "nulls": "last"
1747
+ },
1748
+ {
1749
+ "expression": "user_id",
1750
+ "isExpression": false,
1751
+ "asc": true,
1752
+ "nulls": "last"
1753
+ },
1754
+ {
1755
+ "expression": "created_at",
1756
+ "isExpression": false,
1757
+ "asc": true,
1758
+ "nulls": "last"
1759
+ }
1760
+ ],
1761
+ "isUnique": false,
1762
+ "concurrently": false,
1763
+ "method": "btree",
1764
+ "with": {}
1765
+ },
1766
+ "snapshots_team_user_device_created": {
1767
+ "name": "snapshots_team_user_device_created",
1768
+ "columns": [
1769
+ {
1770
+ "expression": "team_id",
1771
+ "isExpression": false,
1772
+ "asc": true,
1773
+ "nulls": "last"
1774
+ },
1775
+ {
1776
+ "expression": "user_id",
1777
+ "isExpression": false,
1778
+ "asc": true,
1779
+ "nulls": "last"
1780
+ },
1781
+ {
1782
+ "expression": "device_label",
1783
+ "isExpression": false,
1784
+ "asc": true,
1785
+ "nulls": "last"
1786
+ },
1787
+ {
1788
+ "expression": "created_at",
1789
+ "isExpression": false,
1790
+ "asc": true,
1791
+ "nulls": "last"
1792
+ }
1793
+ ],
1794
+ "isUnique": false,
1795
+ "concurrently": false,
1796
+ "method": "btree",
1797
+ "with": {}
1798
+ }
1799
+ },
1800
+ "foreignKeys": {
1801
+ "snapshots_team_id_teams_id_fk": {
1802
+ "name": "snapshots_team_id_teams_id_fk",
1803
+ "tableFrom": "snapshots",
1804
+ "tableTo": "teams",
1805
+ "columnsFrom": [
1806
+ "team_id"
1807
+ ],
1808
+ "columnsTo": [
1809
+ "id"
1810
+ ],
1811
+ "onDelete": "cascade",
1812
+ "onUpdate": "no action"
1813
+ },
1814
+ "snapshots_user_id_users_id_fk": {
1815
+ "name": "snapshots_user_id_users_id_fk",
1816
+ "tableFrom": "snapshots",
1817
+ "tableTo": "users",
1818
+ "columnsFrom": [
1819
+ "user_id"
1820
+ ],
1821
+ "columnsTo": [
1822
+ "id"
1823
+ ],
1824
+ "onDelete": "cascade",
1825
+ "onUpdate": "no action"
1826
+ },
1827
+ "snapshots_project_id_projects_id_fk": {
1828
+ "name": "snapshots_project_id_projects_id_fk",
1829
+ "tableFrom": "snapshots",
1830
+ "tableTo": "projects",
1831
+ "columnsFrom": [
1832
+ "project_id"
1833
+ ],
1834
+ "columnsTo": [
1835
+ "id"
1836
+ ],
1837
+ "onDelete": "cascade",
1838
+ "onUpdate": "no action"
1839
+ },
1840
+ "snapshots_token_id_tokens_id_fk": {
1841
+ "name": "snapshots_token_id_tokens_id_fk",
1842
+ "tableFrom": "snapshots",
1843
+ "tableTo": "tokens",
1844
+ "columnsFrom": [
1845
+ "token_id"
1846
+ ],
1847
+ "columnsTo": [
1848
+ "id"
1849
+ ],
1850
+ "onDelete": "set null",
1851
+ "onUpdate": "no action"
1852
+ },
1853
+ "snapshots_device_id_agent_installations_id_fk": {
1854
+ "name": "snapshots_device_id_agent_installations_id_fk",
1855
+ "tableFrom": "snapshots",
1856
+ "tableTo": "agent_installations",
1857
+ "columnsFrom": [
1858
+ "device_id"
1859
+ ],
1860
+ "columnsTo": [
1861
+ "id"
1862
+ ],
1863
+ "onDelete": "set null",
1864
+ "onUpdate": "no action"
1865
+ }
1866
+ },
1867
+ "compositePrimaryKeys": {},
1868
+ "uniqueConstraints": {},
1869
+ "policies": {},
1870
+ "checkConstraints": {},
1871
+ "isRLSEnabled": false
1872
+ },
1873
+ "public.teams": {
1874
+ "name": "teams",
1875
+ "schema": "",
1876
+ "columns": {
1877
+ "id": {
1878
+ "name": "id",
1879
+ "type": "uuid",
1880
+ "primaryKey": true,
1881
+ "notNull": true,
1882
+ "default": "gen_random_uuid()"
1883
+ },
1884
+ "name": {
1885
+ "name": "name",
1886
+ "type": "text",
1887
+ "primaryKey": false,
1888
+ "notNull": true
1889
+ },
1890
+ "slug": {
1891
+ "name": "slug",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": true
1895
+ },
1896
+ "created_by": {
1897
+ "name": "created_by",
1898
+ "type": "uuid",
1899
+ "primaryKey": false,
1900
+ "notNull": false
1901
+ },
1902
+ "webhook_url": {
1903
+ "name": "webhook_url",
1904
+ "type": "text",
1905
+ "primaryKey": false,
1906
+ "notNull": false
1907
+ },
1908
+ "plan": {
1909
+ "name": "plan",
1910
+ "type": "text",
1911
+ "primaryKey": false,
1912
+ "notNull": true,
1913
+ "default": "'free'"
1914
+ },
1915
+ "inbound_token": {
1916
+ "name": "inbound_token",
1917
+ "type": "text",
1918
+ "primaryKey": false,
1919
+ "notNull": false
1920
+ },
1921
+ "created_at": {
1922
+ "name": "created_at",
1923
+ "type": "timestamp with time zone",
1924
+ "primaryKey": false,
1925
+ "notNull": true,
1926
+ "default": "now()"
1927
+ }
1928
+ },
1929
+ "indexes": {},
1930
+ "foreignKeys": {
1931
+ "teams_created_by_users_id_fk": {
1932
+ "name": "teams_created_by_users_id_fk",
1933
+ "tableFrom": "teams",
1934
+ "tableTo": "users",
1935
+ "columnsFrom": [
1936
+ "created_by"
1937
+ ],
1938
+ "columnsTo": [
1939
+ "id"
1940
+ ],
1941
+ "onDelete": "no action",
1942
+ "onUpdate": "no action"
1943
+ }
1944
+ },
1945
+ "compositePrimaryKeys": {},
1946
+ "uniqueConstraints": {
1947
+ "teams_slug_unique": {
1948
+ "name": "teams_slug_unique",
1949
+ "nullsNotDistinct": false,
1950
+ "columns": [
1951
+ "slug"
1952
+ ]
1953
+ },
1954
+ "teams_inbound_token_unique": {
1955
+ "name": "teams_inbound_token_unique",
1956
+ "nullsNotDistinct": false,
1957
+ "columns": [
1958
+ "inbound_token"
1959
+ ]
1960
+ }
1961
+ },
1962
+ "policies": {},
1963
+ "checkConstraints": {},
1964
+ "isRLSEnabled": false
1965
+ },
1966
+ "public.tokens": {
1967
+ "name": "tokens",
1968
+ "schema": "",
1969
+ "columns": {
1970
+ "id": {
1971
+ "name": "id",
1972
+ "type": "uuid",
1973
+ "primaryKey": true,
1974
+ "notNull": true,
1975
+ "default": "gen_random_uuid()"
1976
+ },
1977
+ "user_id": {
1978
+ "name": "user_id",
1979
+ "type": "uuid",
1980
+ "primaryKey": false,
1981
+ "notNull": true
1982
+ },
1983
+ "name": {
1984
+ "name": "name",
1985
+ "type": "text",
1986
+ "primaryKey": false,
1987
+ "notNull": true
1988
+ },
1989
+ "token_hash": {
1990
+ "name": "token_hash",
1991
+ "type": "text",
1992
+ "primaryKey": false,
1993
+ "notNull": true
1994
+ },
1995
+ "prefix": {
1996
+ "name": "prefix",
1997
+ "type": "text",
1998
+ "primaryKey": false,
1999
+ "notNull": true
2000
+ },
2001
+ "last_used_at": {
2002
+ "name": "last_used_at",
2003
+ "type": "timestamp with time zone",
2004
+ "primaryKey": false,
2005
+ "notNull": false
2006
+ },
2007
+ "revoked_at": {
2008
+ "name": "revoked_at",
2009
+ "type": "timestamp with time zone",
2010
+ "primaryKey": false,
2011
+ "notNull": false
2012
+ },
2013
+ "created_at": {
2014
+ "name": "created_at",
2015
+ "type": "timestamp with time zone",
2016
+ "primaryKey": false,
2017
+ "notNull": true,
2018
+ "default": "now()"
2019
+ }
2020
+ },
2021
+ "indexes": {},
2022
+ "foreignKeys": {
2023
+ "tokens_user_id_users_id_fk": {
2024
+ "name": "tokens_user_id_users_id_fk",
2025
+ "tableFrom": "tokens",
2026
+ "tableTo": "users",
2027
+ "columnsFrom": [
2028
+ "user_id"
2029
+ ],
2030
+ "columnsTo": [
2031
+ "id"
2032
+ ],
2033
+ "onDelete": "cascade",
2034
+ "onUpdate": "no action"
2035
+ }
2036
+ },
2037
+ "compositePrimaryKeys": {},
2038
+ "uniqueConstraints": {
2039
+ "tokens_token_hash_unique": {
2040
+ "name": "tokens_token_hash_unique",
2041
+ "nullsNotDistinct": false,
2042
+ "columns": [
2043
+ "token_hash"
2044
+ ]
2045
+ }
2046
+ },
2047
+ "policies": {},
2048
+ "checkConstraints": {},
2049
+ "isRLSEnabled": false
2050
+ },
2051
+ "public.users": {
2052
+ "name": "users",
2053
+ "schema": "",
2054
+ "columns": {
2055
+ "id": {
2056
+ "name": "id",
2057
+ "type": "uuid",
2058
+ "primaryKey": true,
2059
+ "notNull": true,
2060
+ "default": "gen_random_uuid()"
2061
+ },
2062
+ "github_id": {
2063
+ "name": "github_id",
2064
+ "type": "bigint",
2065
+ "primaryKey": false,
2066
+ "notNull": false
2067
+ },
2068
+ "username": {
2069
+ "name": "username",
2070
+ "type": "text",
2071
+ "primaryKey": false,
2072
+ "notNull": true
2073
+ },
2074
+ "password_hash": {
2075
+ "name": "password_hash",
2076
+ "type": "text",
2077
+ "primaryKey": false,
2078
+ "notNull": false
2079
+ },
2080
+ "display_name": {
2081
+ "name": "display_name",
2082
+ "type": "text",
2083
+ "primaryKey": false,
2084
+ "notNull": false
2085
+ },
2086
+ "email": {
2087
+ "name": "email",
2088
+ "type": "text",
2089
+ "primaryKey": false,
2090
+ "notNull": false
2091
+ },
2092
+ "avatar_url": {
2093
+ "name": "avatar_url",
2094
+ "type": "text",
2095
+ "primaryKey": false,
2096
+ "notNull": false
2097
+ },
2098
+ "created_at": {
2099
+ "name": "created_at",
2100
+ "type": "timestamp with time zone",
2101
+ "primaryKey": false,
2102
+ "notNull": true,
2103
+ "default": "now()"
2104
+ }
2105
+ },
2106
+ "indexes": {},
2107
+ "foreignKeys": {},
2108
+ "compositePrimaryKeys": {},
2109
+ "uniqueConstraints": {
2110
+ "users_github_id_unique": {
2111
+ "name": "users_github_id_unique",
2112
+ "nullsNotDistinct": false,
2113
+ "columns": [
2114
+ "github_id"
2115
+ ]
2116
+ },
2117
+ "users_username_unique": {
2118
+ "name": "users_username_unique",
2119
+ "nullsNotDistinct": false,
2120
+ "columns": [
2121
+ "username"
2122
+ ]
2123
+ }
2124
+ },
2125
+ "policies": {},
2126
+ "checkConstraints": {},
2127
+ "isRLSEnabled": false
2128
+ },
2129
+ "public.web_sessions": {
2130
+ "name": "web_sessions",
2131
+ "schema": "",
2132
+ "columns": {
2133
+ "id": {
2134
+ "name": "id",
2135
+ "type": "text",
2136
+ "primaryKey": true,
2137
+ "notNull": true
2138
+ },
2139
+ "user_id": {
2140
+ "name": "user_id",
2141
+ "type": "uuid",
2142
+ "primaryKey": false,
2143
+ "notNull": true
2144
+ },
2145
+ "expires_at": {
2146
+ "name": "expires_at",
2147
+ "type": "timestamp with time zone",
2148
+ "primaryKey": false,
2149
+ "notNull": true
2150
+ },
2151
+ "created_at": {
2152
+ "name": "created_at",
2153
+ "type": "timestamp with time zone",
2154
+ "primaryKey": false,
2155
+ "notNull": true,
2156
+ "default": "now()"
2157
+ }
2158
+ },
2159
+ "indexes": {},
2160
+ "foreignKeys": {
2161
+ "web_sessions_user_id_users_id_fk": {
2162
+ "name": "web_sessions_user_id_users_id_fk",
2163
+ "tableFrom": "web_sessions",
2164
+ "tableTo": "users",
2165
+ "columnsFrom": [
2166
+ "user_id"
2167
+ ],
2168
+ "columnsTo": [
2169
+ "id"
2170
+ ],
2171
+ "onDelete": "cascade",
2172
+ "onUpdate": "no action"
2173
+ }
2174
+ },
2175
+ "compositePrimaryKeys": {},
2176
+ "uniqueConstraints": {},
2177
+ "policies": {},
2178
+ "checkConstraints": {},
2179
+ "isRLSEnabled": false
2180
+ },
2181
+ "public.work_claims": {
2182
+ "name": "work_claims",
2183
+ "schema": "",
2184
+ "columns": {
2185
+ "id": {
2186
+ "name": "id",
2187
+ "type": "uuid",
2188
+ "primaryKey": true,
2189
+ "notNull": true,
2190
+ "default": "gen_random_uuid()"
2191
+ },
2192
+ "run_id": {
2193
+ "name": "run_id",
2194
+ "type": "uuid",
2195
+ "primaryKey": false,
2196
+ "notNull": true
2197
+ },
2198
+ "resource_type": {
2199
+ "name": "resource_type",
2200
+ "type": "text",
2201
+ "primaryKey": false,
2202
+ "notNull": true
2203
+ },
2204
+ "resource_key": {
2205
+ "name": "resource_key",
2206
+ "type": "text",
2207
+ "primaryKey": false,
2208
+ "notNull": true
2209
+ },
2210
+ "access": {
2211
+ "name": "access",
2212
+ "type": "text",
2213
+ "primaryKey": false,
2214
+ "notNull": true,
2215
+ "default": "'write'"
2216
+ },
2217
+ "lease_expires_at": {
2218
+ "name": "lease_expires_at",
2219
+ "type": "timestamp with time zone",
2220
+ "primaryKey": false,
2221
+ "notNull": true
2222
+ },
2223
+ "created_at": {
2224
+ "name": "created_at",
2225
+ "type": "timestamp with time zone",
2226
+ "primaryKey": false,
2227
+ "notNull": true,
2228
+ "default": "now()"
2229
+ }
2230
+ },
2231
+ "indexes": {
2232
+ "work_claims_run_resource": {
2233
+ "name": "work_claims_run_resource",
2234
+ "columns": [
2235
+ {
2236
+ "expression": "run_id",
2237
+ "isExpression": false,
2238
+ "asc": true,
2239
+ "nulls": "last"
2240
+ },
2241
+ {
2242
+ "expression": "resource_type",
2243
+ "isExpression": false,
2244
+ "asc": true,
2245
+ "nulls": "last"
2246
+ },
2247
+ {
2248
+ "expression": "resource_key",
2249
+ "isExpression": false,
2250
+ "asc": true,
2251
+ "nulls": "last"
2252
+ },
2253
+ {
2254
+ "expression": "access",
2255
+ "isExpression": false,
2256
+ "asc": true,
2257
+ "nulls": "last"
2258
+ }
2259
+ ],
2260
+ "isUnique": true,
2261
+ "concurrently": false,
2262
+ "method": "btree",
2263
+ "with": {}
2264
+ },
2265
+ "work_claims_lease": {
2266
+ "name": "work_claims_lease",
2267
+ "columns": [
2268
+ {
2269
+ "expression": "lease_expires_at",
2270
+ "isExpression": false,
2271
+ "asc": true,
2272
+ "nulls": "last"
2273
+ }
2274
+ ],
2275
+ "isUnique": false,
2276
+ "concurrently": false,
2277
+ "method": "btree",
2278
+ "with": {}
2279
+ }
2280
+ },
2281
+ "foreignKeys": {
2282
+ "work_claims_run_id_agent_runs_id_fk": {
2283
+ "name": "work_claims_run_id_agent_runs_id_fk",
2284
+ "tableFrom": "work_claims",
2285
+ "tableTo": "agent_runs",
2286
+ "columnsFrom": [
2287
+ "run_id"
2288
+ ],
2289
+ "columnsTo": [
2290
+ "id"
2291
+ ],
2292
+ "onDelete": "cascade",
2293
+ "onUpdate": "no action"
2294
+ }
2295
+ },
2296
+ "compositePrimaryKeys": {},
2297
+ "uniqueConstraints": {},
2298
+ "policies": {},
2299
+ "checkConstraints": {},
2300
+ "isRLSEnabled": false
2301
+ }
2302
+ },
2303
+ "enums": {},
2304
+ "schemas": {},
2305
+ "sequences": {},
2306
+ "roles": {},
2307
+ "policies": {},
2308
+ "views": {},
2309
+ "_meta": {
2310
+ "columns": {},
2311
+ "schemas": {},
2312
+ "tables": {}
2313
+ }
2314
+ }