@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,2157 @@
1
+ {
2
+ "id": "ca23cfca-e0e5-4c45-b359-864dbd624395",
3
+ "prevId": "cf4013e8-5562-4a51-a9b1-db7a502eb4fb",
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.invites": {
898
+ "name": "invites",
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
+ "team_id": {
909
+ "name": "team_id",
910
+ "type": "uuid",
911
+ "primaryKey": false,
912
+ "notNull": true
913
+ },
914
+ "code": {
915
+ "name": "code",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": true
919
+ },
920
+ "created_by": {
921
+ "name": "created_by",
922
+ "type": "uuid",
923
+ "primaryKey": false,
924
+ "notNull": false
925
+ },
926
+ "expires_at": {
927
+ "name": "expires_at",
928
+ "type": "timestamp with time zone",
929
+ "primaryKey": false,
930
+ "notNull": true
931
+ },
932
+ "uses": {
933
+ "name": "uses",
934
+ "type": "integer",
935
+ "primaryKey": false,
936
+ "notNull": true,
937
+ "default": 0
938
+ },
939
+ "max_uses": {
940
+ "name": "max_uses",
941
+ "type": "integer",
942
+ "primaryKey": false,
943
+ "notNull": false
944
+ },
945
+ "created_at": {
946
+ "name": "created_at",
947
+ "type": "timestamp with time zone",
948
+ "primaryKey": false,
949
+ "notNull": true,
950
+ "default": "now()"
951
+ }
952
+ },
953
+ "indexes": {},
954
+ "foreignKeys": {
955
+ "invites_team_id_teams_id_fk": {
956
+ "name": "invites_team_id_teams_id_fk",
957
+ "tableFrom": "invites",
958
+ "tableTo": "teams",
959
+ "columnsFrom": [
960
+ "team_id"
961
+ ],
962
+ "columnsTo": [
963
+ "id"
964
+ ],
965
+ "onDelete": "cascade",
966
+ "onUpdate": "no action"
967
+ },
968
+ "invites_created_by_users_id_fk": {
969
+ "name": "invites_created_by_users_id_fk",
970
+ "tableFrom": "invites",
971
+ "tableTo": "users",
972
+ "columnsFrom": [
973
+ "created_by"
974
+ ],
975
+ "columnsTo": [
976
+ "id"
977
+ ],
978
+ "onDelete": "no action",
979
+ "onUpdate": "no action"
980
+ }
981
+ },
982
+ "compositePrimaryKeys": {},
983
+ "uniqueConstraints": {
984
+ "invites_code_unique": {
985
+ "name": "invites_code_unique",
986
+ "nullsNotDistinct": false,
987
+ "columns": [
988
+ "code"
989
+ ]
990
+ }
991
+ },
992
+ "policies": {},
993
+ "checkConstraints": {},
994
+ "isRLSEnabled": false
995
+ },
996
+ "public.memberships": {
997
+ "name": "memberships",
998
+ "schema": "",
999
+ "columns": {
1000
+ "team_id": {
1001
+ "name": "team_id",
1002
+ "type": "uuid",
1003
+ "primaryKey": false,
1004
+ "notNull": true
1005
+ },
1006
+ "user_id": {
1007
+ "name": "user_id",
1008
+ "type": "uuid",
1009
+ "primaryKey": false,
1010
+ "notNull": true
1011
+ },
1012
+ "role": {
1013
+ "name": "role",
1014
+ "type": "text",
1015
+ "primaryKey": false,
1016
+ "notNull": true,
1017
+ "default": "'member'"
1018
+ },
1019
+ "created_at": {
1020
+ "name": "created_at",
1021
+ "type": "timestamp with time zone",
1022
+ "primaryKey": false,
1023
+ "notNull": true,
1024
+ "default": "now()"
1025
+ }
1026
+ },
1027
+ "indexes": {},
1028
+ "foreignKeys": {
1029
+ "memberships_team_id_teams_id_fk": {
1030
+ "name": "memberships_team_id_teams_id_fk",
1031
+ "tableFrom": "memberships",
1032
+ "tableTo": "teams",
1033
+ "columnsFrom": [
1034
+ "team_id"
1035
+ ],
1036
+ "columnsTo": [
1037
+ "id"
1038
+ ],
1039
+ "onDelete": "cascade",
1040
+ "onUpdate": "no action"
1041
+ },
1042
+ "memberships_user_id_users_id_fk": {
1043
+ "name": "memberships_user_id_users_id_fk",
1044
+ "tableFrom": "memberships",
1045
+ "tableTo": "users",
1046
+ "columnsFrom": [
1047
+ "user_id"
1048
+ ],
1049
+ "columnsTo": [
1050
+ "id"
1051
+ ],
1052
+ "onDelete": "cascade",
1053
+ "onUpdate": "no action"
1054
+ }
1055
+ },
1056
+ "compositePrimaryKeys": {
1057
+ "memberships_team_id_user_id_pk": {
1058
+ "name": "memberships_team_id_user_id_pk",
1059
+ "columns": [
1060
+ "team_id",
1061
+ "user_id"
1062
+ ]
1063
+ }
1064
+ },
1065
+ "uniqueConstraints": {},
1066
+ "policies": {},
1067
+ "checkConstraints": {},
1068
+ "isRLSEnabled": false
1069
+ },
1070
+ "public.messages": {
1071
+ "name": "messages",
1072
+ "schema": "",
1073
+ "columns": {
1074
+ "id": {
1075
+ "name": "id",
1076
+ "type": "uuid",
1077
+ "primaryKey": true,
1078
+ "notNull": true,
1079
+ "default": "gen_random_uuid()"
1080
+ },
1081
+ "session_id": {
1082
+ "name": "session_id",
1083
+ "type": "uuid",
1084
+ "primaryKey": false,
1085
+ "notNull": true
1086
+ },
1087
+ "author_id": {
1088
+ "name": "author_id",
1089
+ "type": "uuid",
1090
+ "primaryKey": false,
1091
+ "notNull": false
1092
+ },
1093
+ "token_id": {
1094
+ "name": "token_id",
1095
+ "type": "uuid",
1096
+ "primaryKey": false,
1097
+ "notNull": false
1098
+ },
1099
+ "kind": {
1100
+ "name": "kind",
1101
+ "type": "text",
1102
+ "primaryKey": false,
1103
+ "notNull": true,
1104
+ "default": "'note'"
1105
+ },
1106
+ "via": {
1107
+ "name": "via",
1108
+ "type": "text",
1109
+ "primaryKey": false,
1110
+ "notNull": false
1111
+ },
1112
+ "body": {
1113
+ "name": "body",
1114
+ "type": "text",
1115
+ "primaryKey": false,
1116
+ "notNull": true
1117
+ },
1118
+ "attachments": {
1119
+ "name": "attachments",
1120
+ "type": "jsonb",
1121
+ "primaryKey": false,
1122
+ "notNull": false
1123
+ },
1124
+ "created_at": {
1125
+ "name": "created_at",
1126
+ "type": "timestamp with time zone",
1127
+ "primaryKey": false,
1128
+ "notNull": true,
1129
+ "default": "now()"
1130
+ }
1131
+ },
1132
+ "indexes": {
1133
+ "messages_session_created": {
1134
+ "name": "messages_session_created",
1135
+ "columns": [
1136
+ {
1137
+ "expression": "session_id",
1138
+ "isExpression": false,
1139
+ "asc": true,
1140
+ "nulls": "last"
1141
+ },
1142
+ {
1143
+ "expression": "created_at",
1144
+ "isExpression": false,
1145
+ "asc": true,
1146
+ "nulls": "last"
1147
+ }
1148
+ ],
1149
+ "isUnique": false,
1150
+ "concurrently": false,
1151
+ "method": "btree",
1152
+ "with": {}
1153
+ }
1154
+ },
1155
+ "foreignKeys": {
1156
+ "messages_session_id_debug_sessions_id_fk": {
1157
+ "name": "messages_session_id_debug_sessions_id_fk",
1158
+ "tableFrom": "messages",
1159
+ "tableTo": "debug_sessions",
1160
+ "columnsFrom": [
1161
+ "session_id"
1162
+ ],
1163
+ "columnsTo": [
1164
+ "id"
1165
+ ],
1166
+ "onDelete": "cascade",
1167
+ "onUpdate": "no action"
1168
+ },
1169
+ "messages_author_id_users_id_fk": {
1170
+ "name": "messages_author_id_users_id_fk",
1171
+ "tableFrom": "messages",
1172
+ "tableTo": "users",
1173
+ "columnsFrom": [
1174
+ "author_id"
1175
+ ],
1176
+ "columnsTo": [
1177
+ "id"
1178
+ ],
1179
+ "onDelete": "no action",
1180
+ "onUpdate": "no action"
1181
+ },
1182
+ "messages_token_id_tokens_id_fk": {
1183
+ "name": "messages_token_id_tokens_id_fk",
1184
+ "tableFrom": "messages",
1185
+ "tableTo": "tokens",
1186
+ "columnsFrom": [
1187
+ "token_id"
1188
+ ],
1189
+ "columnsTo": [
1190
+ "id"
1191
+ ],
1192
+ "onDelete": "set null",
1193
+ "onUpdate": "no action"
1194
+ }
1195
+ },
1196
+ "compositePrimaryKeys": {},
1197
+ "uniqueConstraints": {},
1198
+ "policies": {},
1199
+ "checkConstraints": {},
1200
+ "isRLSEnabled": false
1201
+ },
1202
+ "public.policy_bundles": {
1203
+ "name": "policy_bundles",
1204
+ "schema": "",
1205
+ "columns": {
1206
+ "id": {
1207
+ "name": "id",
1208
+ "type": "uuid",
1209
+ "primaryKey": true,
1210
+ "notNull": true,
1211
+ "default": "gen_random_uuid()"
1212
+ },
1213
+ "team_id": {
1214
+ "name": "team_id",
1215
+ "type": "uuid",
1216
+ "primaryKey": false,
1217
+ "notNull": true
1218
+ },
1219
+ "project_id": {
1220
+ "name": "project_id",
1221
+ "type": "uuid",
1222
+ "primaryKey": false,
1223
+ "notNull": false
1224
+ },
1225
+ "scope_key": {
1226
+ "name": "scope_key",
1227
+ "type": "text",
1228
+ "primaryKey": false,
1229
+ "notNull": true
1230
+ },
1231
+ "version": {
1232
+ "name": "version",
1233
+ "type": "integer",
1234
+ "primaryKey": false,
1235
+ "notNull": true
1236
+ },
1237
+ "status": {
1238
+ "name": "status",
1239
+ "type": "text",
1240
+ "primaryKey": false,
1241
+ "notNull": true,
1242
+ "default": "'active'"
1243
+ },
1244
+ "document": {
1245
+ "name": "document",
1246
+ "type": "jsonb",
1247
+ "primaryKey": false,
1248
+ "notNull": true
1249
+ },
1250
+ "hash": {
1251
+ "name": "hash",
1252
+ "type": "text",
1253
+ "primaryKey": false,
1254
+ "notNull": true
1255
+ },
1256
+ "created_by": {
1257
+ "name": "created_by",
1258
+ "type": "uuid",
1259
+ "primaryKey": false,
1260
+ "notNull": false
1261
+ },
1262
+ "created_at": {
1263
+ "name": "created_at",
1264
+ "type": "timestamp with time zone",
1265
+ "primaryKey": false,
1266
+ "notNull": true,
1267
+ "default": "now()"
1268
+ }
1269
+ },
1270
+ "indexes": {
1271
+ "policy_bundles_team_scope_version": {
1272
+ "name": "policy_bundles_team_scope_version",
1273
+ "columns": [
1274
+ {
1275
+ "expression": "team_id",
1276
+ "isExpression": false,
1277
+ "asc": true,
1278
+ "nulls": "last"
1279
+ },
1280
+ {
1281
+ "expression": "scope_key",
1282
+ "isExpression": false,
1283
+ "asc": true,
1284
+ "nulls": "last"
1285
+ },
1286
+ {
1287
+ "expression": "version",
1288
+ "isExpression": false,
1289
+ "asc": true,
1290
+ "nulls": "last"
1291
+ }
1292
+ ],
1293
+ "isUnique": true,
1294
+ "concurrently": false,
1295
+ "method": "btree",
1296
+ "with": {}
1297
+ }
1298
+ },
1299
+ "foreignKeys": {
1300
+ "policy_bundles_team_id_teams_id_fk": {
1301
+ "name": "policy_bundles_team_id_teams_id_fk",
1302
+ "tableFrom": "policy_bundles",
1303
+ "tableTo": "teams",
1304
+ "columnsFrom": [
1305
+ "team_id"
1306
+ ],
1307
+ "columnsTo": [
1308
+ "id"
1309
+ ],
1310
+ "onDelete": "cascade",
1311
+ "onUpdate": "no action"
1312
+ },
1313
+ "policy_bundles_project_id_projects_id_fk": {
1314
+ "name": "policy_bundles_project_id_projects_id_fk",
1315
+ "tableFrom": "policy_bundles",
1316
+ "tableTo": "projects",
1317
+ "columnsFrom": [
1318
+ "project_id"
1319
+ ],
1320
+ "columnsTo": [
1321
+ "id"
1322
+ ],
1323
+ "onDelete": "cascade",
1324
+ "onUpdate": "no action"
1325
+ },
1326
+ "policy_bundles_created_by_users_id_fk": {
1327
+ "name": "policy_bundles_created_by_users_id_fk",
1328
+ "tableFrom": "policy_bundles",
1329
+ "tableTo": "users",
1330
+ "columnsFrom": [
1331
+ "created_by"
1332
+ ],
1333
+ "columnsTo": [
1334
+ "id"
1335
+ ],
1336
+ "onDelete": "set null",
1337
+ "onUpdate": "no action"
1338
+ }
1339
+ },
1340
+ "compositePrimaryKeys": {},
1341
+ "uniqueConstraints": {},
1342
+ "policies": {},
1343
+ "checkConstraints": {},
1344
+ "isRLSEnabled": false
1345
+ },
1346
+ "public.policy_receipts": {
1347
+ "name": "policy_receipts",
1348
+ "schema": "",
1349
+ "columns": {
1350
+ "run_id": {
1351
+ "name": "run_id",
1352
+ "type": "uuid",
1353
+ "primaryKey": true,
1354
+ "notNull": true
1355
+ },
1356
+ "expected_hash": {
1357
+ "name": "expected_hash",
1358
+ "type": "text",
1359
+ "primaryKey": false,
1360
+ "notNull": true
1361
+ },
1362
+ "reported_hash": {
1363
+ "name": "reported_hash",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": false
1367
+ },
1368
+ "drift": {
1369
+ "name": "drift",
1370
+ "type": "boolean",
1371
+ "primaryKey": false,
1372
+ "notNull": true,
1373
+ "default": false
1374
+ },
1375
+ "created_at": {
1376
+ "name": "created_at",
1377
+ "type": "timestamp with time zone",
1378
+ "primaryKey": false,
1379
+ "notNull": true,
1380
+ "default": "now()"
1381
+ }
1382
+ },
1383
+ "indexes": {},
1384
+ "foreignKeys": {
1385
+ "policy_receipts_run_id_agent_runs_id_fk": {
1386
+ "name": "policy_receipts_run_id_agent_runs_id_fk",
1387
+ "tableFrom": "policy_receipts",
1388
+ "tableTo": "agent_runs",
1389
+ "columnsFrom": [
1390
+ "run_id"
1391
+ ],
1392
+ "columnsTo": [
1393
+ "id"
1394
+ ],
1395
+ "onDelete": "cascade",
1396
+ "onUpdate": "no action"
1397
+ }
1398
+ },
1399
+ "compositePrimaryKeys": {},
1400
+ "uniqueConstraints": {},
1401
+ "policies": {},
1402
+ "checkConstraints": {},
1403
+ "isRLSEnabled": false
1404
+ },
1405
+ "public.projects": {
1406
+ "name": "projects",
1407
+ "schema": "",
1408
+ "columns": {
1409
+ "id": {
1410
+ "name": "id",
1411
+ "type": "uuid",
1412
+ "primaryKey": true,
1413
+ "notNull": true,
1414
+ "default": "gen_random_uuid()"
1415
+ },
1416
+ "team_id": {
1417
+ "name": "team_id",
1418
+ "type": "uuid",
1419
+ "primaryKey": false,
1420
+ "notNull": true
1421
+ },
1422
+ "name": {
1423
+ "name": "name",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": true
1427
+ },
1428
+ "slug": {
1429
+ "name": "slug",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": true
1433
+ },
1434
+ "created_by": {
1435
+ "name": "created_by",
1436
+ "type": "uuid",
1437
+ "primaryKey": false,
1438
+ "notNull": false
1439
+ },
1440
+ "created_at": {
1441
+ "name": "created_at",
1442
+ "type": "timestamp with time zone",
1443
+ "primaryKey": false,
1444
+ "notNull": true,
1445
+ "default": "now()"
1446
+ }
1447
+ },
1448
+ "indexes": {
1449
+ "projects_team_slug": {
1450
+ "name": "projects_team_slug",
1451
+ "columns": [
1452
+ {
1453
+ "expression": "team_id",
1454
+ "isExpression": false,
1455
+ "asc": true,
1456
+ "nulls": "last"
1457
+ },
1458
+ {
1459
+ "expression": "slug",
1460
+ "isExpression": false,
1461
+ "asc": true,
1462
+ "nulls": "last"
1463
+ }
1464
+ ],
1465
+ "isUnique": true,
1466
+ "concurrently": false,
1467
+ "method": "btree",
1468
+ "with": {}
1469
+ }
1470
+ },
1471
+ "foreignKeys": {
1472
+ "projects_team_id_teams_id_fk": {
1473
+ "name": "projects_team_id_teams_id_fk",
1474
+ "tableFrom": "projects",
1475
+ "tableTo": "teams",
1476
+ "columnsFrom": [
1477
+ "team_id"
1478
+ ],
1479
+ "columnsTo": [
1480
+ "id"
1481
+ ],
1482
+ "onDelete": "cascade",
1483
+ "onUpdate": "no action"
1484
+ },
1485
+ "projects_created_by_users_id_fk": {
1486
+ "name": "projects_created_by_users_id_fk",
1487
+ "tableFrom": "projects",
1488
+ "tableTo": "users",
1489
+ "columnsFrom": [
1490
+ "created_by"
1491
+ ],
1492
+ "columnsTo": [
1493
+ "id"
1494
+ ],
1495
+ "onDelete": "no action",
1496
+ "onUpdate": "no action"
1497
+ }
1498
+ },
1499
+ "compositePrimaryKeys": {},
1500
+ "uniqueConstraints": {},
1501
+ "policies": {},
1502
+ "checkConstraints": {},
1503
+ "isRLSEnabled": false
1504
+ },
1505
+ "public.read_state": {
1506
+ "name": "read_state",
1507
+ "schema": "",
1508
+ "columns": {
1509
+ "user_id": {
1510
+ "name": "user_id",
1511
+ "type": "uuid",
1512
+ "primaryKey": false,
1513
+ "notNull": true
1514
+ },
1515
+ "session_id": {
1516
+ "name": "session_id",
1517
+ "type": "uuid",
1518
+ "primaryKey": false,
1519
+ "notNull": true
1520
+ },
1521
+ "last_read_at": {
1522
+ "name": "last_read_at",
1523
+ "type": "timestamp with time zone",
1524
+ "primaryKey": false,
1525
+ "notNull": true,
1526
+ "default": "now()"
1527
+ }
1528
+ },
1529
+ "indexes": {},
1530
+ "foreignKeys": {
1531
+ "read_state_user_id_users_id_fk": {
1532
+ "name": "read_state_user_id_users_id_fk",
1533
+ "tableFrom": "read_state",
1534
+ "tableTo": "users",
1535
+ "columnsFrom": [
1536
+ "user_id"
1537
+ ],
1538
+ "columnsTo": [
1539
+ "id"
1540
+ ],
1541
+ "onDelete": "cascade",
1542
+ "onUpdate": "no action"
1543
+ },
1544
+ "read_state_session_id_debug_sessions_id_fk": {
1545
+ "name": "read_state_session_id_debug_sessions_id_fk",
1546
+ "tableFrom": "read_state",
1547
+ "tableTo": "debug_sessions",
1548
+ "columnsFrom": [
1549
+ "session_id"
1550
+ ],
1551
+ "columnsTo": [
1552
+ "id"
1553
+ ],
1554
+ "onDelete": "cascade",
1555
+ "onUpdate": "no action"
1556
+ }
1557
+ },
1558
+ "compositePrimaryKeys": {
1559
+ "read_state_user_id_session_id_pk": {
1560
+ "name": "read_state_user_id_session_id_pk",
1561
+ "columns": [
1562
+ "user_id",
1563
+ "session_id"
1564
+ ]
1565
+ }
1566
+ },
1567
+ "uniqueConstraints": {},
1568
+ "policies": {},
1569
+ "checkConstraints": {},
1570
+ "isRLSEnabled": false
1571
+ },
1572
+ "public.snapshots": {
1573
+ "name": "snapshots",
1574
+ "schema": "",
1575
+ "columns": {
1576
+ "id": {
1577
+ "name": "id",
1578
+ "type": "uuid",
1579
+ "primaryKey": true,
1580
+ "notNull": true,
1581
+ "default": "gen_random_uuid()"
1582
+ },
1583
+ "team_id": {
1584
+ "name": "team_id",
1585
+ "type": "uuid",
1586
+ "primaryKey": false,
1587
+ "notNull": true
1588
+ },
1589
+ "user_id": {
1590
+ "name": "user_id",
1591
+ "type": "uuid",
1592
+ "primaryKey": false,
1593
+ "notNull": true
1594
+ },
1595
+ "repo": {
1596
+ "name": "repo",
1597
+ "type": "text",
1598
+ "primaryKey": false,
1599
+ "notNull": false
1600
+ },
1601
+ "project_id": {
1602
+ "name": "project_id",
1603
+ "type": "uuid",
1604
+ "primaryKey": false,
1605
+ "notNull": false
1606
+ },
1607
+ "token_id": {
1608
+ "name": "token_id",
1609
+ "type": "uuid",
1610
+ "primaryKey": false,
1611
+ "notNull": false
1612
+ },
1613
+ "data": {
1614
+ "name": "data",
1615
+ "type": "jsonb",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "created_at": {
1620
+ "name": "created_at",
1621
+ "type": "timestamp with time zone",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "default": "now()"
1625
+ }
1626
+ },
1627
+ "indexes": {
1628
+ "snapshots_team_user_created": {
1629
+ "name": "snapshots_team_user_created",
1630
+ "columns": [
1631
+ {
1632
+ "expression": "team_id",
1633
+ "isExpression": false,
1634
+ "asc": true,
1635
+ "nulls": "last"
1636
+ },
1637
+ {
1638
+ "expression": "user_id",
1639
+ "isExpression": false,
1640
+ "asc": true,
1641
+ "nulls": "last"
1642
+ },
1643
+ {
1644
+ "expression": "created_at",
1645
+ "isExpression": false,
1646
+ "asc": true,
1647
+ "nulls": "last"
1648
+ }
1649
+ ],
1650
+ "isUnique": false,
1651
+ "concurrently": false,
1652
+ "method": "btree",
1653
+ "with": {}
1654
+ }
1655
+ },
1656
+ "foreignKeys": {
1657
+ "snapshots_team_id_teams_id_fk": {
1658
+ "name": "snapshots_team_id_teams_id_fk",
1659
+ "tableFrom": "snapshots",
1660
+ "tableTo": "teams",
1661
+ "columnsFrom": [
1662
+ "team_id"
1663
+ ],
1664
+ "columnsTo": [
1665
+ "id"
1666
+ ],
1667
+ "onDelete": "cascade",
1668
+ "onUpdate": "no action"
1669
+ },
1670
+ "snapshots_user_id_users_id_fk": {
1671
+ "name": "snapshots_user_id_users_id_fk",
1672
+ "tableFrom": "snapshots",
1673
+ "tableTo": "users",
1674
+ "columnsFrom": [
1675
+ "user_id"
1676
+ ],
1677
+ "columnsTo": [
1678
+ "id"
1679
+ ],
1680
+ "onDelete": "cascade",
1681
+ "onUpdate": "no action"
1682
+ },
1683
+ "snapshots_project_id_projects_id_fk": {
1684
+ "name": "snapshots_project_id_projects_id_fk",
1685
+ "tableFrom": "snapshots",
1686
+ "tableTo": "projects",
1687
+ "columnsFrom": [
1688
+ "project_id"
1689
+ ],
1690
+ "columnsTo": [
1691
+ "id"
1692
+ ],
1693
+ "onDelete": "cascade",
1694
+ "onUpdate": "no action"
1695
+ },
1696
+ "snapshots_token_id_tokens_id_fk": {
1697
+ "name": "snapshots_token_id_tokens_id_fk",
1698
+ "tableFrom": "snapshots",
1699
+ "tableTo": "tokens",
1700
+ "columnsFrom": [
1701
+ "token_id"
1702
+ ],
1703
+ "columnsTo": [
1704
+ "id"
1705
+ ],
1706
+ "onDelete": "set null",
1707
+ "onUpdate": "no action"
1708
+ }
1709
+ },
1710
+ "compositePrimaryKeys": {},
1711
+ "uniqueConstraints": {},
1712
+ "policies": {},
1713
+ "checkConstraints": {},
1714
+ "isRLSEnabled": false
1715
+ },
1716
+ "public.teams": {
1717
+ "name": "teams",
1718
+ "schema": "",
1719
+ "columns": {
1720
+ "id": {
1721
+ "name": "id",
1722
+ "type": "uuid",
1723
+ "primaryKey": true,
1724
+ "notNull": true,
1725
+ "default": "gen_random_uuid()"
1726
+ },
1727
+ "name": {
1728
+ "name": "name",
1729
+ "type": "text",
1730
+ "primaryKey": false,
1731
+ "notNull": true
1732
+ },
1733
+ "slug": {
1734
+ "name": "slug",
1735
+ "type": "text",
1736
+ "primaryKey": false,
1737
+ "notNull": true
1738
+ },
1739
+ "created_by": {
1740
+ "name": "created_by",
1741
+ "type": "uuid",
1742
+ "primaryKey": false,
1743
+ "notNull": false
1744
+ },
1745
+ "webhook_url": {
1746
+ "name": "webhook_url",
1747
+ "type": "text",
1748
+ "primaryKey": false,
1749
+ "notNull": false
1750
+ },
1751
+ "plan": {
1752
+ "name": "plan",
1753
+ "type": "text",
1754
+ "primaryKey": false,
1755
+ "notNull": true,
1756
+ "default": "'free'"
1757
+ },
1758
+ "inbound_token": {
1759
+ "name": "inbound_token",
1760
+ "type": "text",
1761
+ "primaryKey": false,
1762
+ "notNull": false
1763
+ },
1764
+ "created_at": {
1765
+ "name": "created_at",
1766
+ "type": "timestamp with time zone",
1767
+ "primaryKey": false,
1768
+ "notNull": true,
1769
+ "default": "now()"
1770
+ }
1771
+ },
1772
+ "indexes": {},
1773
+ "foreignKeys": {
1774
+ "teams_created_by_users_id_fk": {
1775
+ "name": "teams_created_by_users_id_fk",
1776
+ "tableFrom": "teams",
1777
+ "tableTo": "users",
1778
+ "columnsFrom": [
1779
+ "created_by"
1780
+ ],
1781
+ "columnsTo": [
1782
+ "id"
1783
+ ],
1784
+ "onDelete": "no action",
1785
+ "onUpdate": "no action"
1786
+ }
1787
+ },
1788
+ "compositePrimaryKeys": {},
1789
+ "uniqueConstraints": {
1790
+ "teams_slug_unique": {
1791
+ "name": "teams_slug_unique",
1792
+ "nullsNotDistinct": false,
1793
+ "columns": [
1794
+ "slug"
1795
+ ]
1796
+ },
1797
+ "teams_inbound_token_unique": {
1798
+ "name": "teams_inbound_token_unique",
1799
+ "nullsNotDistinct": false,
1800
+ "columns": [
1801
+ "inbound_token"
1802
+ ]
1803
+ }
1804
+ },
1805
+ "policies": {},
1806
+ "checkConstraints": {},
1807
+ "isRLSEnabled": false
1808
+ },
1809
+ "public.tokens": {
1810
+ "name": "tokens",
1811
+ "schema": "",
1812
+ "columns": {
1813
+ "id": {
1814
+ "name": "id",
1815
+ "type": "uuid",
1816
+ "primaryKey": true,
1817
+ "notNull": true,
1818
+ "default": "gen_random_uuid()"
1819
+ },
1820
+ "user_id": {
1821
+ "name": "user_id",
1822
+ "type": "uuid",
1823
+ "primaryKey": false,
1824
+ "notNull": true
1825
+ },
1826
+ "name": {
1827
+ "name": "name",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": true
1831
+ },
1832
+ "token_hash": {
1833
+ "name": "token_hash",
1834
+ "type": "text",
1835
+ "primaryKey": false,
1836
+ "notNull": true
1837
+ },
1838
+ "prefix": {
1839
+ "name": "prefix",
1840
+ "type": "text",
1841
+ "primaryKey": false,
1842
+ "notNull": true
1843
+ },
1844
+ "last_used_at": {
1845
+ "name": "last_used_at",
1846
+ "type": "timestamp with time zone",
1847
+ "primaryKey": false,
1848
+ "notNull": false
1849
+ },
1850
+ "revoked_at": {
1851
+ "name": "revoked_at",
1852
+ "type": "timestamp with time zone",
1853
+ "primaryKey": false,
1854
+ "notNull": false
1855
+ },
1856
+ "created_at": {
1857
+ "name": "created_at",
1858
+ "type": "timestamp with time zone",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "default": "now()"
1862
+ }
1863
+ },
1864
+ "indexes": {},
1865
+ "foreignKeys": {
1866
+ "tokens_user_id_users_id_fk": {
1867
+ "name": "tokens_user_id_users_id_fk",
1868
+ "tableFrom": "tokens",
1869
+ "tableTo": "users",
1870
+ "columnsFrom": [
1871
+ "user_id"
1872
+ ],
1873
+ "columnsTo": [
1874
+ "id"
1875
+ ],
1876
+ "onDelete": "cascade",
1877
+ "onUpdate": "no action"
1878
+ }
1879
+ },
1880
+ "compositePrimaryKeys": {},
1881
+ "uniqueConstraints": {
1882
+ "tokens_token_hash_unique": {
1883
+ "name": "tokens_token_hash_unique",
1884
+ "nullsNotDistinct": false,
1885
+ "columns": [
1886
+ "token_hash"
1887
+ ]
1888
+ }
1889
+ },
1890
+ "policies": {},
1891
+ "checkConstraints": {},
1892
+ "isRLSEnabled": false
1893
+ },
1894
+ "public.users": {
1895
+ "name": "users",
1896
+ "schema": "",
1897
+ "columns": {
1898
+ "id": {
1899
+ "name": "id",
1900
+ "type": "uuid",
1901
+ "primaryKey": true,
1902
+ "notNull": true,
1903
+ "default": "gen_random_uuid()"
1904
+ },
1905
+ "github_id": {
1906
+ "name": "github_id",
1907
+ "type": "bigint",
1908
+ "primaryKey": false,
1909
+ "notNull": false
1910
+ },
1911
+ "username": {
1912
+ "name": "username",
1913
+ "type": "text",
1914
+ "primaryKey": false,
1915
+ "notNull": true
1916
+ },
1917
+ "password_hash": {
1918
+ "name": "password_hash",
1919
+ "type": "text",
1920
+ "primaryKey": false,
1921
+ "notNull": false
1922
+ },
1923
+ "display_name": {
1924
+ "name": "display_name",
1925
+ "type": "text",
1926
+ "primaryKey": false,
1927
+ "notNull": false
1928
+ },
1929
+ "email": {
1930
+ "name": "email",
1931
+ "type": "text",
1932
+ "primaryKey": false,
1933
+ "notNull": false
1934
+ },
1935
+ "avatar_url": {
1936
+ "name": "avatar_url",
1937
+ "type": "text",
1938
+ "primaryKey": false,
1939
+ "notNull": false
1940
+ },
1941
+ "created_at": {
1942
+ "name": "created_at",
1943
+ "type": "timestamp with time zone",
1944
+ "primaryKey": false,
1945
+ "notNull": true,
1946
+ "default": "now()"
1947
+ }
1948
+ },
1949
+ "indexes": {},
1950
+ "foreignKeys": {},
1951
+ "compositePrimaryKeys": {},
1952
+ "uniqueConstraints": {
1953
+ "users_github_id_unique": {
1954
+ "name": "users_github_id_unique",
1955
+ "nullsNotDistinct": false,
1956
+ "columns": [
1957
+ "github_id"
1958
+ ]
1959
+ },
1960
+ "users_username_unique": {
1961
+ "name": "users_username_unique",
1962
+ "nullsNotDistinct": false,
1963
+ "columns": [
1964
+ "username"
1965
+ ]
1966
+ }
1967
+ },
1968
+ "policies": {},
1969
+ "checkConstraints": {},
1970
+ "isRLSEnabled": false
1971
+ },
1972
+ "public.web_sessions": {
1973
+ "name": "web_sessions",
1974
+ "schema": "",
1975
+ "columns": {
1976
+ "id": {
1977
+ "name": "id",
1978
+ "type": "text",
1979
+ "primaryKey": true,
1980
+ "notNull": true
1981
+ },
1982
+ "user_id": {
1983
+ "name": "user_id",
1984
+ "type": "uuid",
1985
+ "primaryKey": false,
1986
+ "notNull": true
1987
+ },
1988
+ "expires_at": {
1989
+ "name": "expires_at",
1990
+ "type": "timestamp with time zone",
1991
+ "primaryKey": false,
1992
+ "notNull": true
1993
+ },
1994
+ "created_at": {
1995
+ "name": "created_at",
1996
+ "type": "timestamp with time zone",
1997
+ "primaryKey": false,
1998
+ "notNull": true,
1999
+ "default": "now()"
2000
+ }
2001
+ },
2002
+ "indexes": {},
2003
+ "foreignKeys": {
2004
+ "web_sessions_user_id_users_id_fk": {
2005
+ "name": "web_sessions_user_id_users_id_fk",
2006
+ "tableFrom": "web_sessions",
2007
+ "tableTo": "users",
2008
+ "columnsFrom": [
2009
+ "user_id"
2010
+ ],
2011
+ "columnsTo": [
2012
+ "id"
2013
+ ],
2014
+ "onDelete": "cascade",
2015
+ "onUpdate": "no action"
2016
+ }
2017
+ },
2018
+ "compositePrimaryKeys": {},
2019
+ "uniqueConstraints": {},
2020
+ "policies": {},
2021
+ "checkConstraints": {},
2022
+ "isRLSEnabled": false
2023
+ },
2024
+ "public.work_claims": {
2025
+ "name": "work_claims",
2026
+ "schema": "",
2027
+ "columns": {
2028
+ "id": {
2029
+ "name": "id",
2030
+ "type": "uuid",
2031
+ "primaryKey": true,
2032
+ "notNull": true,
2033
+ "default": "gen_random_uuid()"
2034
+ },
2035
+ "run_id": {
2036
+ "name": "run_id",
2037
+ "type": "uuid",
2038
+ "primaryKey": false,
2039
+ "notNull": true
2040
+ },
2041
+ "resource_type": {
2042
+ "name": "resource_type",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": true
2046
+ },
2047
+ "resource_key": {
2048
+ "name": "resource_key",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": true
2052
+ },
2053
+ "access": {
2054
+ "name": "access",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": true,
2058
+ "default": "'write'"
2059
+ },
2060
+ "lease_expires_at": {
2061
+ "name": "lease_expires_at",
2062
+ "type": "timestamp with time zone",
2063
+ "primaryKey": false,
2064
+ "notNull": true
2065
+ },
2066
+ "created_at": {
2067
+ "name": "created_at",
2068
+ "type": "timestamp with time zone",
2069
+ "primaryKey": false,
2070
+ "notNull": true,
2071
+ "default": "now()"
2072
+ }
2073
+ },
2074
+ "indexes": {
2075
+ "work_claims_run_resource": {
2076
+ "name": "work_claims_run_resource",
2077
+ "columns": [
2078
+ {
2079
+ "expression": "run_id",
2080
+ "isExpression": false,
2081
+ "asc": true,
2082
+ "nulls": "last"
2083
+ },
2084
+ {
2085
+ "expression": "resource_type",
2086
+ "isExpression": false,
2087
+ "asc": true,
2088
+ "nulls": "last"
2089
+ },
2090
+ {
2091
+ "expression": "resource_key",
2092
+ "isExpression": false,
2093
+ "asc": true,
2094
+ "nulls": "last"
2095
+ },
2096
+ {
2097
+ "expression": "access",
2098
+ "isExpression": false,
2099
+ "asc": true,
2100
+ "nulls": "last"
2101
+ }
2102
+ ],
2103
+ "isUnique": true,
2104
+ "concurrently": false,
2105
+ "method": "btree",
2106
+ "with": {}
2107
+ },
2108
+ "work_claims_lease": {
2109
+ "name": "work_claims_lease",
2110
+ "columns": [
2111
+ {
2112
+ "expression": "lease_expires_at",
2113
+ "isExpression": false,
2114
+ "asc": true,
2115
+ "nulls": "last"
2116
+ }
2117
+ ],
2118
+ "isUnique": false,
2119
+ "concurrently": false,
2120
+ "method": "btree",
2121
+ "with": {}
2122
+ }
2123
+ },
2124
+ "foreignKeys": {
2125
+ "work_claims_run_id_agent_runs_id_fk": {
2126
+ "name": "work_claims_run_id_agent_runs_id_fk",
2127
+ "tableFrom": "work_claims",
2128
+ "tableTo": "agent_runs",
2129
+ "columnsFrom": [
2130
+ "run_id"
2131
+ ],
2132
+ "columnsTo": [
2133
+ "id"
2134
+ ],
2135
+ "onDelete": "cascade",
2136
+ "onUpdate": "no action"
2137
+ }
2138
+ },
2139
+ "compositePrimaryKeys": {},
2140
+ "uniqueConstraints": {},
2141
+ "policies": {},
2142
+ "checkConstraints": {},
2143
+ "isRLSEnabled": false
2144
+ }
2145
+ },
2146
+ "enums": {},
2147
+ "schemas": {},
2148
+ "sequences": {},
2149
+ "roles": {},
2150
+ "policies": {},
2151
+ "views": {},
2152
+ "_meta": {
2153
+ "columns": {},
2154
+ "schemas": {},
2155
+ "tables": {}
2156
+ }
2157
+ }