@intx/db 0.1.2

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 (91) hide show
  1. package/README.md +37 -0
  2. package/drizzle.config.ts +23 -0
  3. package/migrations/.gitkeep +0 -0
  4. package/migrations/0000_brown_wither.sql +50 -0
  5. package/migrations/0001_white_aqueduct.sql +105 -0
  6. package/migrations/0002_clever_falcon.sql +56 -0
  7. package/migrations/0003_stiff_tyrannus.sql +44 -0
  8. package/migrations/0004_rename_capability_to_offering.sql +1 -0
  9. package/migrations/0005_gigantic_cardiac.sql +1 -0
  10. package/migrations/0006_sidecar.sql +8 -0
  11. package/migrations/0007_agent_running_session.sql +1 -0
  12. package/migrations/0008_session.sql +10 -0
  13. package/migrations/0009_session_messages.sql +18 -0
  14. package/migrations/0010_agent_sidecar_pubkey.sql +2 -0
  15. package/migrations/0011_session_message_from.sql +2 -0
  16. package/migrations/0012_agent_instance.sql +22 -0
  17. package/migrations/0013_instance_session_id.sql +2 -0
  18. package/migrations/0014_drop_agent_runtime_columns.sql +12 -0
  19. package/migrations/0015_add_instance_id_to_session_message.sql +2 -0
  20. package/migrations/0016_jazzy_gamma_corps.sql +3 -0
  21. package/migrations/0017_hesitant_marvex.sql +1 -0
  22. package/migrations/0018_natural_sinister_six.sql +5 -0
  23. package/migrations/0019_rename_grant_source_to_origin.sql +1 -0
  24. package/migrations/0020_add_agent_role.sql +9 -0
  25. package/migrations/0021_acoustic_ozymandias.sql +15 -0
  26. package/migrations/0022_material_sleepwalker.sql +27 -0
  27. package/migrations/0023_flawless_scarlet_witch.sql +2 -0
  28. package/migrations/0024_bumpy_sharon_ventura.sql +1 -0
  29. package/migrations/0025_curvy_firestar.sql +26 -0
  30. package/migrations/0026_keen_ultimo.sql +13 -0
  31. package/migrations/0027_git_tokens.sql +21 -0
  32. package/migrations/0028_wet_sugar_man.sql +1 -0
  33. package/migrations/meta/0000_snapshot.json +316 -0
  34. package/migrations/meta/0001_snapshot.json +968 -0
  35. package/migrations/meta/0002_snapshot.json +1315 -0
  36. package/migrations/meta/0003_snapshot.json +1594 -0
  37. package/migrations/meta/0004_snapshot.json +1594 -0
  38. package/migrations/meta/0005_snapshot.json +1600 -0
  39. package/migrations/meta/0011_snapshot.json +1921 -0
  40. package/migrations/meta/0012_snapshot.json +2067 -0
  41. package/migrations/meta/0013_snapshot.json +2082 -0
  42. package/migrations/meta/0014_snapshot.json +2049 -0
  43. package/migrations/meta/0015_snapshot.json +2064 -0
  44. package/migrations/meta/0016_snapshot.json +2085 -0
  45. package/migrations/meta/0017_snapshot.json +2085 -0
  46. package/migrations/meta/0018_snapshot.json +2070 -0
  47. package/migrations/meta/0019_snapshot.json +2070 -0
  48. package/migrations/meta/0020_snapshot.json +2126 -0
  49. package/migrations/meta/0021_snapshot.json +2239 -0
  50. package/migrations/meta/0022_snapshot.json +2425 -0
  51. package/migrations/meta/0023_snapshot.json +2260 -0
  52. package/migrations/meta/0024_snapshot.json +2254 -0
  53. package/migrations/meta/0025_snapshot.json +2418 -0
  54. package/migrations/meta/0026_snapshot.json +2508 -0
  55. package/migrations/meta/0027_snapshot.json +2657 -0
  56. package/migrations/meta/0028_snapshot.json +2657 -0
  57. package/migrations/meta/_journal.json +209 -0
  58. package/package.json +27 -0
  59. package/src/client.ts +24 -0
  60. package/src/config.ts +19 -0
  61. package/src/connection.ts +27 -0
  62. package/src/credential-resolution.ts +378 -0
  63. package/src/grant-store.ts +51 -0
  64. package/src/index.ts +32 -0
  65. package/src/migrate.test.ts +35 -0
  66. package/src/migrate.ts +168 -0
  67. package/src/parse-row.test.ts +113 -0
  68. package/src/parse-row.ts +185 -0
  69. package/src/schema/agent-assets.ts +21 -0
  70. package/src/schema/agents.ts +49 -0
  71. package/src/schema/assets.ts +24 -0
  72. package/src/schema/auth.ts +51 -0
  73. package/src/schema/credentials.ts +43 -0
  74. package/src/schema/git-tokens.ts +83 -0
  75. package/src/schema/grants.ts +26 -0
  76. package/src/schema/index.ts +19 -0
  77. package/src/schema/instances.ts +36 -0
  78. package/src/schema/messages.ts +108 -0
  79. package/src/schema/oauth-clients.ts +26 -0
  80. package/src/schema/offerings.ts +20 -0
  81. package/src/schema/principals.ts +28 -0
  82. package/src/schema/providers.ts +23 -0
  83. package/src/schema/roles.ts +51 -0
  84. package/src/schema/session-assets.ts +49 -0
  85. package/src/schema/sessions.ts +26 -0
  86. package/src/schema/sidecar.ts +14 -0
  87. package/src/schema/tenants.ts +41 -0
  88. package/src/schema/wallets.ts +44 -0
  89. package/src/tenant-hierarchy.ts +34 -0
  90. package/tsconfig.json +4 -0
  91. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,2657 @@
1
+ {
2
+ "id": "28016fda-202f-4943-92d1-ee459239ef69",
3
+ "prevId": "453912ac-d646-4705-b0a1-63f0232269a6",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_agent_id_fk": {
557
+ "name": "agent_role_agent_id_agent_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "tableTo": "agent",
560
+ "columnsFrom": ["agent_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "agent_role_agent_id_role_id_pk": {
577
+ "name": "agent_role_agent_id_role_id_pk",
578
+ "columns": ["agent_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.principal_role": {
587
+ "name": "principal_role",
588
+ "schema": "",
589
+ "columns": {
590
+ "principal_id": {
591
+ "name": "principal_id",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "role_id": {
597
+ "name": "role_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "principal_role_principal_id_principal_id_fk": {
613
+ "name": "principal_role_principal_id_principal_id_fk",
614
+ "tableFrom": "principal_role",
615
+ "tableTo": "principal",
616
+ "columnsFrom": ["principal_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "tableTo": "role",
625
+ "columnsFrom": ["role_id"],
626
+ "columnsTo": ["id"],
627
+ "onDelete": "cascade",
628
+ "onUpdate": "no action"
629
+ }
630
+ },
631
+ "compositePrimaryKeys": {
632
+ "principal_role_principal_id_role_id_pk": {
633
+ "name": "principal_role_principal_id_role_id_pk",
634
+ "columns": ["principal_id", "role_id"]
635
+ }
636
+ },
637
+ "uniqueConstraints": {},
638
+ "policies": {},
639
+ "checkConstraints": {},
640
+ "isRLSEnabled": false
641
+ },
642
+ "public.role": {
643
+ "name": "role",
644
+ "schema": "",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "name": {
659
+ "name": "name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "is_system": {
671
+ "name": "is_system",
672
+ "type": "boolean",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": false
676
+ },
677
+ "created_at": {
678
+ "name": "created_at",
679
+ "type": "timestamp",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "default": "now()"
683
+ },
684
+ "updated_at": {
685
+ "name": "updated_at",
686
+ "type": "timestamp",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "default": "now()"
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {
694
+ "role_tenant_id_tenant_id_fk": {
695
+ "name": "role_tenant_id_tenant_id_fk",
696
+ "tableFrom": "role",
697
+ "tableTo": "tenant",
698
+ "columnsFrom": ["tenant_id"],
699
+ "columnsTo": ["id"],
700
+ "onDelete": "cascade",
701
+ "onUpdate": "no action"
702
+ }
703
+ },
704
+ "compositePrimaryKeys": {},
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.grant": {
711
+ "name": "grant",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true
719
+ },
720
+ "tenant_id": {
721
+ "name": "tenant_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "role_id": {
727
+ "name": "role_id",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "principal_id": {
733
+ "name": "principal_id",
734
+ "type": "text",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "resource": {
739
+ "name": "resource",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "action": {
745
+ "name": "action",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "effect": {
751
+ "name": "effect",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "conditions": {
757
+ "name": "conditions",
758
+ "type": "jsonb",
759
+ "primaryKey": false,
760
+ "notNull": false
761
+ },
762
+ "origin": {
763
+ "name": "origin",
764
+ "type": "text",
765
+ "primaryKey": false,
766
+ "notNull": true
767
+ },
768
+ "expires_at": {
769
+ "name": "expires_at",
770
+ "type": "timestamp",
771
+ "primaryKey": false,
772
+ "notNull": false
773
+ },
774
+ "created_at": {
775
+ "name": "created_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ },
781
+ "updated_at": {
782
+ "name": "updated_at",
783
+ "type": "timestamp",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "now()"
787
+ }
788
+ },
789
+ "indexes": {},
790
+ "foreignKeys": {
791
+ "grant_tenant_id_tenant_id_fk": {
792
+ "name": "grant_tenant_id_tenant_id_fk",
793
+ "tableFrom": "grant",
794
+ "tableTo": "tenant",
795
+ "columnsFrom": ["tenant_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "tableTo": "role",
804
+ "columnsFrom": ["role_id"],
805
+ "columnsTo": ["id"],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "tableTo": "principal",
813
+ "columnsFrom": ["principal_id"],
814
+ "columnsTo": ["id"],
815
+ "onDelete": "cascade",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {},
823
+ "isRLSEnabled": false
824
+ },
825
+ "public.agent": {
826
+ "name": "agent",
827
+ "schema": "",
828
+ "columns": {
829
+ "id": {
830
+ "name": "id",
831
+ "type": "text",
832
+ "primaryKey": true,
833
+ "notNull": true
834
+ },
835
+ "tenant_id": {
836
+ "name": "tenant_id",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "creator_principal_id": {
842
+ "name": "creator_principal_id",
843
+ "type": "text",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "name": {
848
+ "name": "name",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "description": {
854
+ "name": "description",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": false
858
+ },
859
+ "system_prompt": {
860
+ "name": "system_prompt",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": false
864
+ },
865
+ "context_config": {
866
+ "name": "context_config",
867
+ "type": "jsonb",
868
+ "primaryKey": false,
869
+ "notNull": false
870
+ },
871
+ "initial_state": {
872
+ "name": "initial_state",
873
+ "type": "jsonb",
874
+ "primaryKey": false,
875
+ "notNull": false
876
+ },
877
+ "model_config": {
878
+ "name": "model_config",
879
+ "type": "jsonb",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "capabilities": {
884
+ "name": "capabilities",
885
+ "type": "jsonb",
886
+ "primaryKey": false,
887
+ "notNull": false
888
+ },
889
+ "credential_requirements": {
890
+ "name": "credential_requirements",
891
+ "type": "jsonb",
892
+ "primaryKey": false,
893
+ "notNull": false
894
+ },
895
+ "grant_requirements": {
896
+ "name": "grant_requirements",
897
+ "type": "jsonb",
898
+ "primaryKey": false,
899
+ "notNull": false
900
+ },
901
+ "current_version": {
902
+ "name": "current_version",
903
+ "type": "text",
904
+ "primaryKey": false,
905
+ "notNull": true,
906
+ "default": "'1'"
907
+ },
908
+ "status": {
909
+ "name": "status",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "default": "'deployed'"
914
+ },
915
+ "created_at": {
916
+ "name": "created_at",
917
+ "type": "timestamp",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "default": "now()"
921
+ },
922
+ "updated_at": {
923
+ "name": "updated_at",
924
+ "type": "timestamp",
925
+ "primaryKey": false,
926
+ "notNull": true,
927
+ "default": "now()"
928
+ }
929
+ },
930
+ "indexes": {},
931
+ "foreignKeys": {
932
+ "agent_tenant_id_tenant_id_fk": {
933
+ "name": "agent_tenant_id_tenant_id_fk",
934
+ "tableFrom": "agent",
935
+ "tableTo": "tenant",
936
+ "columnsFrom": ["tenant_id"],
937
+ "columnsTo": ["id"],
938
+ "onDelete": "cascade",
939
+ "onUpdate": "no action"
940
+ },
941
+ "agent_creator_principal_id_principal_id_fk": {
942
+ "name": "agent_creator_principal_id_principal_id_fk",
943
+ "tableFrom": "agent",
944
+ "tableTo": "principal",
945
+ "columnsFrom": ["creator_principal_id"],
946
+ "columnsTo": ["id"],
947
+ "onDelete": "no action",
948
+ "onUpdate": "no action"
949
+ }
950
+ },
951
+ "compositePrimaryKeys": {},
952
+ "uniqueConstraints": {},
953
+ "policies": {},
954
+ "checkConstraints": {},
955
+ "isRLSEnabled": false
956
+ },
957
+ "public.agent_version": {
958
+ "name": "agent_version",
959
+ "schema": "",
960
+ "columns": {
961
+ "id": {
962
+ "name": "id",
963
+ "type": "text",
964
+ "primaryKey": true,
965
+ "notNull": true
966
+ },
967
+ "agent_id": {
968
+ "name": "agent_id",
969
+ "type": "text",
970
+ "primaryKey": false,
971
+ "notNull": true
972
+ },
973
+ "version": {
974
+ "name": "version",
975
+ "type": "text",
976
+ "primaryKey": false,
977
+ "notNull": true
978
+ },
979
+ "status": {
980
+ "name": "status",
981
+ "type": "text",
982
+ "primaryKey": false,
983
+ "notNull": true,
984
+ "default": "'active'"
985
+ },
986
+ "created_at": {
987
+ "name": "created_at",
988
+ "type": "timestamp",
989
+ "primaryKey": false,
990
+ "notNull": true,
991
+ "default": "now()"
992
+ }
993
+ },
994
+ "indexes": {},
995
+ "foreignKeys": {
996
+ "agent_version_agent_id_agent_id_fk": {
997
+ "name": "agent_version_agent_id_agent_id_fk",
998
+ "tableFrom": "agent_version",
999
+ "tableTo": "agent",
1000
+ "columnsFrom": ["agent_id"],
1001
+ "columnsTo": ["id"],
1002
+ "onDelete": "cascade",
1003
+ "onUpdate": "no action"
1004
+ }
1005
+ },
1006
+ "compositePrimaryKeys": {},
1007
+ "uniqueConstraints": {},
1008
+ "policies": {},
1009
+ "checkConstraints": {},
1010
+ "isRLSEnabled": false
1011
+ },
1012
+ "public.provider": {
1013
+ "name": "provider",
1014
+ "schema": "",
1015
+ "columns": {
1016
+ "id": {
1017
+ "name": "id",
1018
+ "type": "text",
1019
+ "primaryKey": true,
1020
+ "notNull": true
1021
+ },
1022
+ "tenant_id": {
1023
+ "name": "tenant_id",
1024
+ "type": "text",
1025
+ "primaryKey": false,
1026
+ "notNull": true
1027
+ },
1028
+ "name": {
1029
+ "name": "name",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": true
1033
+ },
1034
+ "plugin": {
1035
+ "name": "plugin",
1036
+ "type": "text",
1037
+ "primaryKey": false,
1038
+ "notNull": true
1039
+ },
1040
+ "authorization_url": {
1041
+ "name": "authorization_url",
1042
+ "type": "text",
1043
+ "primaryKey": false,
1044
+ "notNull": false
1045
+ },
1046
+ "token_url": {
1047
+ "name": "token_url",
1048
+ "type": "text",
1049
+ "primaryKey": false,
1050
+ "notNull": false
1051
+ },
1052
+ "user_info_url": {
1053
+ "name": "user_info_url",
1054
+ "type": "text",
1055
+ "primaryKey": false,
1056
+ "notNull": false
1057
+ },
1058
+ "scopes": {
1059
+ "name": "scopes",
1060
+ "type": "text[]",
1061
+ "primaryKey": false,
1062
+ "notNull": false
1063
+ },
1064
+ "metadata": {
1065
+ "name": "metadata",
1066
+ "type": "jsonb",
1067
+ "primaryKey": false,
1068
+ "notNull": false
1069
+ },
1070
+ "created_at": {
1071
+ "name": "created_at",
1072
+ "type": "timestamp",
1073
+ "primaryKey": false,
1074
+ "notNull": true,
1075
+ "default": "now()"
1076
+ },
1077
+ "updated_at": {
1078
+ "name": "updated_at",
1079
+ "type": "timestamp",
1080
+ "primaryKey": false,
1081
+ "notNull": true,
1082
+ "default": "now()"
1083
+ }
1084
+ },
1085
+ "indexes": {},
1086
+ "foreignKeys": {
1087
+ "provider_tenant_id_tenant_id_fk": {
1088
+ "name": "provider_tenant_id_tenant_id_fk",
1089
+ "tableFrom": "provider",
1090
+ "tableTo": "tenant",
1091
+ "columnsFrom": ["tenant_id"],
1092
+ "columnsTo": ["id"],
1093
+ "onDelete": "cascade",
1094
+ "onUpdate": "no action"
1095
+ }
1096
+ },
1097
+ "compositePrimaryKeys": {},
1098
+ "uniqueConstraints": {
1099
+ "provider_tenant_name": {
1100
+ "name": "provider_tenant_name",
1101
+ "nullsNotDistinct": false,
1102
+ "columns": ["tenant_id", "name"]
1103
+ }
1104
+ },
1105
+ "policies": {},
1106
+ "checkConstraints": {},
1107
+ "isRLSEnabled": false
1108
+ },
1109
+ "public.oauth_client": {
1110
+ "name": "oauth_client",
1111
+ "schema": "",
1112
+ "columns": {
1113
+ "id": {
1114
+ "name": "id",
1115
+ "type": "text",
1116
+ "primaryKey": true,
1117
+ "notNull": true
1118
+ },
1119
+ "tenant_id": {
1120
+ "name": "tenant_id",
1121
+ "type": "text",
1122
+ "primaryKey": false,
1123
+ "notNull": true
1124
+ },
1125
+ "provider_id": {
1126
+ "name": "provider_id",
1127
+ "type": "text",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "name": {
1132
+ "name": "name",
1133
+ "type": "text",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "client_id": {
1138
+ "name": "client_id",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "client_secret": {
1144
+ "name": "client_secret",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": true
1148
+ },
1149
+ "redirect_uris": {
1150
+ "name": "redirect_uris",
1151
+ "type": "text[]",
1152
+ "primaryKey": false,
1153
+ "notNull": false
1154
+ },
1155
+ "default_scopes": {
1156
+ "name": "default_scopes",
1157
+ "type": "text[]",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "metadata": {
1162
+ "name": "metadata",
1163
+ "type": "jsonb",
1164
+ "primaryKey": false,
1165
+ "notNull": false
1166
+ },
1167
+ "created_at": {
1168
+ "name": "created_at",
1169
+ "type": "timestamp",
1170
+ "primaryKey": false,
1171
+ "notNull": true,
1172
+ "default": "now()"
1173
+ },
1174
+ "updated_at": {
1175
+ "name": "updated_at",
1176
+ "type": "timestamp",
1177
+ "primaryKey": false,
1178
+ "notNull": true,
1179
+ "default": "now()"
1180
+ }
1181
+ },
1182
+ "indexes": {},
1183
+ "foreignKeys": {
1184
+ "oauth_client_tenant_id_tenant_id_fk": {
1185
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1186
+ "tableFrom": "oauth_client",
1187
+ "tableTo": "tenant",
1188
+ "columnsFrom": ["tenant_id"],
1189
+ "columnsTo": ["id"],
1190
+ "onDelete": "cascade",
1191
+ "onUpdate": "no action"
1192
+ },
1193
+ "oauth_client_provider_id_provider_id_fk": {
1194
+ "name": "oauth_client_provider_id_provider_id_fk",
1195
+ "tableFrom": "oauth_client",
1196
+ "tableTo": "provider",
1197
+ "columnsFrom": ["provider_id"],
1198
+ "columnsTo": ["id"],
1199
+ "onDelete": "cascade",
1200
+ "onUpdate": "no action"
1201
+ }
1202
+ },
1203
+ "compositePrimaryKeys": {},
1204
+ "uniqueConstraints": {
1205
+ "oauth_client_tenant_provider": {
1206
+ "name": "oauth_client_tenant_provider",
1207
+ "nullsNotDistinct": false,
1208
+ "columns": ["tenant_id", "provider_id"]
1209
+ }
1210
+ },
1211
+ "policies": {},
1212
+ "checkConstraints": {},
1213
+ "isRLSEnabled": false
1214
+ },
1215
+ "public.credential": {
1216
+ "name": "credential",
1217
+ "schema": "",
1218
+ "columns": {
1219
+ "id": {
1220
+ "name": "id",
1221
+ "type": "text",
1222
+ "primaryKey": true,
1223
+ "notNull": true
1224
+ },
1225
+ "tenant_id": {
1226
+ "name": "tenant_id",
1227
+ "type": "text",
1228
+ "primaryKey": false,
1229
+ "notNull": true
1230
+ },
1231
+ "principal_id": {
1232
+ "name": "principal_id",
1233
+ "type": "text",
1234
+ "primaryKey": false,
1235
+ "notNull": false
1236
+ },
1237
+ "provider_id": {
1238
+ "name": "provider_id",
1239
+ "type": "text",
1240
+ "primaryKey": false,
1241
+ "notNull": true
1242
+ },
1243
+ "oauth_client_id": {
1244
+ "name": "oauth_client_id",
1245
+ "type": "text",
1246
+ "primaryKey": false,
1247
+ "notNull": false
1248
+ },
1249
+ "name": {
1250
+ "name": "name",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": true
1254
+ },
1255
+ "type": {
1256
+ "name": "type",
1257
+ "type": "text",
1258
+ "primaryKey": false,
1259
+ "notNull": true
1260
+ },
1261
+ "description": {
1262
+ "name": "description",
1263
+ "type": "text",
1264
+ "primaryKey": false,
1265
+ "notNull": false
1266
+ },
1267
+ "secret": {
1268
+ "name": "secret",
1269
+ "type": "text",
1270
+ "primaryKey": false,
1271
+ "notNull": true
1272
+ },
1273
+ "refresh_secret": {
1274
+ "name": "refresh_secret",
1275
+ "type": "text",
1276
+ "primaryKey": false,
1277
+ "notNull": false
1278
+ },
1279
+ "scopes": {
1280
+ "name": "scopes",
1281
+ "type": "text[]",
1282
+ "primaryKey": false,
1283
+ "notNull": false
1284
+ },
1285
+ "expires_at": {
1286
+ "name": "expires_at",
1287
+ "type": "timestamp",
1288
+ "primaryKey": false,
1289
+ "notNull": false
1290
+ },
1291
+ "status": {
1292
+ "name": "status",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": true,
1296
+ "default": "'active'"
1297
+ },
1298
+ "metadata": {
1299
+ "name": "metadata",
1300
+ "type": "jsonb",
1301
+ "primaryKey": false,
1302
+ "notNull": false
1303
+ },
1304
+ "created_at": {
1305
+ "name": "created_at",
1306
+ "type": "timestamp",
1307
+ "primaryKey": false,
1308
+ "notNull": true,
1309
+ "default": "now()"
1310
+ },
1311
+ "updated_at": {
1312
+ "name": "updated_at",
1313
+ "type": "timestamp",
1314
+ "primaryKey": false,
1315
+ "notNull": true,
1316
+ "default": "now()"
1317
+ }
1318
+ },
1319
+ "indexes": {},
1320
+ "foreignKeys": {
1321
+ "credential_tenant_id_tenant_id_fk": {
1322
+ "name": "credential_tenant_id_tenant_id_fk",
1323
+ "tableFrom": "credential",
1324
+ "tableTo": "tenant",
1325
+ "columnsFrom": ["tenant_id"],
1326
+ "columnsTo": ["id"],
1327
+ "onDelete": "cascade",
1328
+ "onUpdate": "no action"
1329
+ },
1330
+ "credential_principal_id_principal_id_fk": {
1331
+ "name": "credential_principal_id_principal_id_fk",
1332
+ "tableFrom": "credential",
1333
+ "tableTo": "principal",
1334
+ "columnsFrom": ["principal_id"],
1335
+ "columnsTo": ["id"],
1336
+ "onDelete": "set null",
1337
+ "onUpdate": "no action"
1338
+ },
1339
+ "credential_provider_id_provider_id_fk": {
1340
+ "name": "credential_provider_id_provider_id_fk",
1341
+ "tableFrom": "credential",
1342
+ "tableTo": "provider",
1343
+ "columnsFrom": ["provider_id"],
1344
+ "columnsTo": ["id"],
1345
+ "onDelete": "cascade",
1346
+ "onUpdate": "no action"
1347
+ },
1348
+ "credential_oauth_client_id_oauth_client_id_fk": {
1349
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1350
+ "tableFrom": "credential",
1351
+ "tableTo": "oauth_client",
1352
+ "columnsFrom": ["oauth_client_id"],
1353
+ "columnsTo": ["id"],
1354
+ "onDelete": "set null",
1355
+ "onUpdate": "no action"
1356
+ }
1357
+ },
1358
+ "compositePrimaryKeys": {},
1359
+ "uniqueConstraints": {
1360
+ "credential_tenant_name": {
1361
+ "name": "credential_tenant_name",
1362
+ "nullsNotDistinct": false,
1363
+ "columns": ["tenant_id", "name"]
1364
+ }
1365
+ },
1366
+ "policies": {},
1367
+ "checkConstraints": {},
1368
+ "isRLSEnabled": false
1369
+ },
1370
+ "public.asset": {
1371
+ "name": "asset",
1372
+ "schema": "",
1373
+ "columns": {
1374
+ "id": {
1375
+ "name": "id",
1376
+ "type": "text",
1377
+ "primaryKey": true,
1378
+ "notNull": true
1379
+ },
1380
+ "tenant_id": {
1381
+ "name": "tenant_id",
1382
+ "type": "text",
1383
+ "primaryKey": false,
1384
+ "notNull": true
1385
+ },
1386
+ "kind": {
1387
+ "name": "kind",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": true
1391
+ },
1392
+ "name": {
1393
+ "name": "name",
1394
+ "type": "text",
1395
+ "primaryKey": false,
1396
+ "notNull": true
1397
+ },
1398
+ "display_name": {
1399
+ "name": "display_name",
1400
+ "type": "text",
1401
+ "primaryKey": false,
1402
+ "notNull": false
1403
+ },
1404
+ "creator_principal_id": {
1405
+ "name": "creator_principal_id",
1406
+ "type": "text",
1407
+ "primaryKey": false,
1408
+ "notNull": false
1409
+ },
1410
+ "created_at": {
1411
+ "name": "created_at",
1412
+ "type": "timestamp",
1413
+ "primaryKey": false,
1414
+ "notNull": true,
1415
+ "default": "now()"
1416
+ },
1417
+ "updated_at": {
1418
+ "name": "updated_at",
1419
+ "type": "timestamp",
1420
+ "primaryKey": false,
1421
+ "notNull": true,
1422
+ "default": "now()"
1423
+ }
1424
+ },
1425
+ "indexes": {},
1426
+ "foreignKeys": {
1427
+ "asset_tenant_id_tenant_id_fk": {
1428
+ "name": "asset_tenant_id_tenant_id_fk",
1429
+ "tableFrom": "asset",
1430
+ "tableTo": "tenant",
1431
+ "columnsFrom": ["tenant_id"],
1432
+ "columnsTo": ["id"],
1433
+ "onDelete": "cascade",
1434
+ "onUpdate": "no action"
1435
+ },
1436
+ "asset_creator_principal_id_principal_id_fk": {
1437
+ "name": "asset_creator_principal_id_principal_id_fk",
1438
+ "tableFrom": "asset",
1439
+ "tableTo": "principal",
1440
+ "columnsFrom": ["creator_principal_id"],
1441
+ "columnsTo": ["id"],
1442
+ "onDelete": "set null",
1443
+ "onUpdate": "no action"
1444
+ }
1445
+ },
1446
+ "compositePrimaryKeys": {},
1447
+ "uniqueConstraints": {
1448
+ "asset_tenant_kind_name": {
1449
+ "name": "asset_tenant_kind_name",
1450
+ "nullsNotDistinct": false,
1451
+ "columns": ["tenant_id", "kind", "name"]
1452
+ }
1453
+ },
1454
+ "policies": {},
1455
+ "checkConstraints": {},
1456
+ "isRLSEnabled": false
1457
+ },
1458
+ "public.agent_asset": {
1459
+ "name": "agent_asset",
1460
+ "schema": "",
1461
+ "columns": {
1462
+ "id": {
1463
+ "name": "id",
1464
+ "type": "text",
1465
+ "primaryKey": true,
1466
+ "notNull": true
1467
+ },
1468
+ "agent_id": {
1469
+ "name": "agent_id",
1470
+ "type": "text",
1471
+ "primaryKey": false,
1472
+ "notNull": true
1473
+ },
1474
+ "asset_id": {
1475
+ "name": "asset_id",
1476
+ "type": "text",
1477
+ "primaryKey": false,
1478
+ "notNull": true
1479
+ },
1480
+ "ref": {
1481
+ "name": "ref",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": true
1485
+ },
1486
+ "access_mode": {
1487
+ "name": "access_mode",
1488
+ "type": "text",
1489
+ "primaryKey": false,
1490
+ "notNull": true,
1491
+ "default": "'read-only'"
1492
+ },
1493
+ "created_at": {
1494
+ "name": "created_at",
1495
+ "type": "timestamp",
1496
+ "primaryKey": false,
1497
+ "notNull": true,
1498
+ "default": "now()"
1499
+ }
1500
+ },
1501
+ "indexes": {},
1502
+ "foreignKeys": {
1503
+ "agent_asset_agent_id_agent_id_fk": {
1504
+ "name": "agent_asset_agent_id_agent_id_fk",
1505
+ "tableFrom": "agent_asset",
1506
+ "tableTo": "agent",
1507
+ "columnsFrom": ["agent_id"],
1508
+ "columnsTo": ["id"],
1509
+ "onDelete": "cascade",
1510
+ "onUpdate": "no action"
1511
+ },
1512
+ "agent_asset_asset_id_asset_id_fk": {
1513
+ "name": "agent_asset_asset_id_asset_id_fk",
1514
+ "tableFrom": "agent_asset",
1515
+ "tableTo": "asset",
1516
+ "columnsFrom": ["asset_id"],
1517
+ "columnsTo": ["id"],
1518
+ "onDelete": "cascade",
1519
+ "onUpdate": "no action"
1520
+ }
1521
+ },
1522
+ "compositePrimaryKeys": {},
1523
+ "uniqueConstraints": {
1524
+ "agent_asset_agent_asset": {
1525
+ "name": "agent_asset_agent_asset",
1526
+ "nullsNotDistinct": false,
1527
+ "columns": ["agent_id", "asset_id"]
1528
+ }
1529
+ },
1530
+ "policies": {},
1531
+ "checkConstraints": {},
1532
+ "isRLSEnabled": false
1533
+ },
1534
+ "public.transaction": {
1535
+ "name": "transaction",
1536
+ "schema": "",
1537
+ "columns": {
1538
+ "id": {
1539
+ "name": "id",
1540
+ "type": "text",
1541
+ "primaryKey": true,
1542
+ "notNull": true
1543
+ },
1544
+ "wallet_id": {
1545
+ "name": "wallet_id",
1546
+ "type": "text",
1547
+ "primaryKey": false,
1548
+ "notNull": true
1549
+ },
1550
+ "agent_id": {
1551
+ "name": "agent_id",
1552
+ "type": "text",
1553
+ "primaryKey": false,
1554
+ "notNull": false
1555
+ },
1556
+ "direction": {
1557
+ "name": "direction",
1558
+ "type": "text",
1559
+ "primaryKey": false,
1560
+ "notNull": true
1561
+ },
1562
+ "amount": {
1563
+ "name": "amount",
1564
+ "type": "text",
1565
+ "primaryKey": false,
1566
+ "notNull": true
1567
+ },
1568
+ "currency": {
1569
+ "name": "currency",
1570
+ "type": "text",
1571
+ "primaryKey": false,
1572
+ "notNull": true
1573
+ },
1574
+ "recipient_id": {
1575
+ "name": "recipient_id",
1576
+ "type": "text",
1577
+ "primaryKey": false,
1578
+ "notNull": false
1579
+ },
1580
+ "sender_id": {
1581
+ "name": "sender_id",
1582
+ "type": "text",
1583
+ "primaryKey": false,
1584
+ "notNull": false
1585
+ },
1586
+ "request_id": {
1587
+ "name": "request_id",
1588
+ "type": "text",
1589
+ "primaryKey": false,
1590
+ "notNull": false
1591
+ },
1592
+ "status": {
1593
+ "name": "status",
1594
+ "type": "text",
1595
+ "primaryKey": false,
1596
+ "notNull": true,
1597
+ "default": "'pending'"
1598
+ },
1599
+ "created_at": {
1600
+ "name": "created_at",
1601
+ "type": "timestamp",
1602
+ "primaryKey": false,
1603
+ "notNull": true,
1604
+ "default": "now()"
1605
+ }
1606
+ },
1607
+ "indexes": {},
1608
+ "foreignKeys": {
1609
+ "transaction_wallet_id_wallet_id_fk": {
1610
+ "name": "transaction_wallet_id_wallet_id_fk",
1611
+ "tableFrom": "transaction",
1612
+ "tableTo": "wallet",
1613
+ "columnsFrom": ["wallet_id"],
1614
+ "columnsTo": ["id"],
1615
+ "onDelete": "cascade",
1616
+ "onUpdate": "no action"
1617
+ },
1618
+ "transaction_agent_id_agent_id_fk": {
1619
+ "name": "transaction_agent_id_agent_id_fk",
1620
+ "tableFrom": "transaction",
1621
+ "tableTo": "agent",
1622
+ "columnsFrom": ["agent_id"],
1623
+ "columnsTo": ["id"],
1624
+ "onDelete": "set null",
1625
+ "onUpdate": "no action"
1626
+ }
1627
+ },
1628
+ "compositePrimaryKeys": {},
1629
+ "uniqueConstraints": {},
1630
+ "policies": {},
1631
+ "checkConstraints": {},
1632
+ "isRLSEnabled": false
1633
+ },
1634
+ "public.wallet": {
1635
+ "name": "wallet",
1636
+ "schema": "",
1637
+ "columns": {
1638
+ "id": {
1639
+ "name": "id",
1640
+ "type": "text",
1641
+ "primaryKey": true,
1642
+ "notNull": true
1643
+ },
1644
+ "tenant_id": {
1645
+ "name": "tenant_id",
1646
+ "type": "text",
1647
+ "primaryKey": false,
1648
+ "notNull": true
1649
+ },
1650
+ "name": {
1651
+ "name": "name",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": true
1655
+ },
1656
+ "backend_type": {
1657
+ "name": "backend_type",
1658
+ "type": "text",
1659
+ "primaryKey": false,
1660
+ "notNull": true
1661
+ },
1662
+ "currency": {
1663
+ "name": "currency",
1664
+ "type": "text",
1665
+ "primaryKey": false,
1666
+ "notNull": true
1667
+ },
1668
+ "balance": {
1669
+ "name": "balance",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": true,
1673
+ "default": "'0'"
1674
+ },
1675
+ "config": {
1676
+ "name": "config",
1677
+ "type": "jsonb",
1678
+ "primaryKey": false,
1679
+ "notNull": false
1680
+ },
1681
+ "created_at": {
1682
+ "name": "created_at",
1683
+ "type": "timestamp",
1684
+ "primaryKey": false,
1685
+ "notNull": true,
1686
+ "default": "now()"
1687
+ },
1688
+ "updated_at": {
1689
+ "name": "updated_at",
1690
+ "type": "timestamp",
1691
+ "primaryKey": false,
1692
+ "notNull": true,
1693
+ "default": "now()"
1694
+ }
1695
+ },
1696
+ "indexes": {},
1697
+ "foreignKeys": {
1698
+ "wallet_tenant_id_tenant_id_fk": {
1699
+ "name": "wallet_tenant_id_tenant_id_fk",
1700
+ "tableFrom": "wallet",
1701
+ "tableTo": "tenant",
1702
+ "columnsFrom": ["tenant_id"],
1703
+ "columnsTo": ["id"],
1704
+ "onDelete": "cascade",
1705
+ "onUpdate": "no action"
1706
+ }
1707
+ },
1708
+ "compositePrimaryKeys": {},
1709
+ "uniqueConstraints": {},
1710
+ "policies": {},
1711
+ "checkConstraints": {},
1712
+ "isRLSEnabled": false
1713
+ },
1714
+ "public.offering": {
1715
+ "name": "offering",
1716
+ "schema": "",
1717
+ "columns": {
1718
+ "id": {
1719
+ "name": "id",
1720
+ "type": "text",
1721
+ "primaryKey": true,
1722
+ "notNull": true
1723
+ },
1724
+ "agent_id": {
1725
+ "name": "agent_id",
1726
+ "type": "text",
1727
+ "primaryKey": false,
1728
+ "notNull": true
1729
+ },
1730
+ "tenant_id": {
1731
+ "name": "tenant_id",
1732
+ "type": "text",
1733
+ "primaryKey": false,
1734
+ "notNull": true
1735
+ },
1736
+ "name": {
1737
+ "name": "name",
1738
+ "type": "text",
1739
+ "primaryKey": false,
1740
+ "notNull": true
1741
+ },
1742
+ "description": {
1743
+ "name": "description",
1744
+ "type": "text",
1745
+ "primaryKey": false,
1746
+ "notNull": false
1747
+ },
1748
+ "pricing": {
1749
+ "name": "pricing",
1750
+ "type": "jsonb",
1751
+ "primaryKey": false,
1752
+ "notNull": false
1753
+ },
1754
+ "schema": {
1755
+ "name": "schema",
1756
+ "type": "jsonb",
1757
+ "primaryKey": false,
1758
+ "notNull": false
1759
+ },
1760
+ "created_at": {
1761
+ "name": "created_at",
1762
+ "type": "timestamp",
1763
+ "primaryKey": false,
1764
+ "notNull": true,
1765
+ "default": "now()"
1766
+ },
1767
+ "updated_at": {
1768
+ "name": "updated_at",
1769
+ "type": "timestamp",
1770
+ "primaryKey": false,
1771
+ "notNull": true,
1772
+ "default": "now()"
1773
+ }
1774
+ },
1775
+ "indexes": {},
1776
+ "foreignKeys": {
1777
+ "offering_agent_id_agent_id_fk": {
1778
+ "name": "offering_agent_id_agent_id_fk",
1779
+ "tableFrom": "offering",
1780
+ "tableTo": "agent",
1781
+ "columnsFrom": ["agent_id"],
1782
+ "columnsTo": ["id"],
1783
+ "onDelete": "cascade",
1784
+ "onUpdate": "no action"
1785
+ },
1786
+ "offering_tenant_id_tenant_id_fk": {
1787
+ "name": "offering_tenant_id_tenant_id_fk",
1788
+ "tableFrom": "offering",
1789
+ "tableTo": "tenant",
1790
+ "columnsFrom": ["tenant_id"],
1791
+ "columnsTo": ["id"],
1792
+ "onDelete": "cascade",
1793
+ "onUpdate": "no action"
1794
+ }
1795
+ },
1796
+ "compositePrimaryKeys": {},
1797
+ "uniqueConstraints": {},
1798
+ "policies": {},
1799
+ "checkConstraints": {},
1800
+ "isRLSEnabled": false
1801
+ },
1802
+ "public.sidecar": {
1803
+ "name": "sidecar",
1804
+ "schema": "",
1805
+ "columns": {
1806
+ "id": {
1807
+ "name": "id",
1808
+ "type": "text",
1809
+ "primaryKey": true,
1810
+ "notNull": true
1811
+ },
1812
+ "url": {
1813
+ "name": "url",
1814
+ "type": "text",
1815
+ "primaryKey": false,
1816
+ "notNull": true
1817
+ },
1818
+ "status": {
1819
+ "name": "status",
1820
+ "type": "text",
1821
+ "primaryKey": false,
1822
+ "notNull": true,
1823
+ "default": "'online'"
1824
+ },
1825
+ "last_heartbeat": {
1826
+ "name": "last_heartbeat",
1827
+ "type": "timestamp",
1828
+ "primaryKey": false,
1829
+ "notNull": false
1830
+ },
1831
+ "created_at": {
1832
+ "name": "created_at",
1833
+ "type": "timestamp",
1834
+ "primaryKey": false,
1835
+ "notNull": true,
1836
+ "default": "now()"
1837
+ },
1838
+ "updated_at": {
1839
+ "name": "updated_at",
1840
+ "type": "timestamp",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "default": "now()"
1844
+ }
1845
+ },
1846
+ "indexes": {},
1847
+ "foreignKeys": {},
1848
+ "compositePrimaryKeys": {},
1849
+ "uniqueConstraints": {},
1850
+ "policies": {},
1851
+ "checkConstraints": {},
1852
+ "isRLSEnabled": false
1853
+ },
1854
+ "public.agent_session": {
1855
+ "name": "agent_session",
1856
+ "schema": "",
1857
+ "columns": {
1858
+ "id": {
1859
+ "name": "id",
1860
+ "type": "text",
1861
+ "primaryKey": true,
1862
+ "notNull": true
1863
+ },
1864
+ "tenant_id": {
1865
+ "name": "tenant_id",
1866
+ "type": "text",
1867
+ "primaryKey": false,
1868
+ "notNull": true
1869
+ },
1870
+ "agent_id": {
1871
+ "name": "agent_id",
1872
+ "type": "text",
1873
+ "primaryKey": false,
1874
+ "notNull": true
1875
+ },
1876
+ "principal_id": {
1877
+ "name": "principal_id",
1878
+ "type": "text",
1879
+ "primaryKey": false,
1880
+ "notNull": true
1881
+ },
1882
+ "status": {
1883
+ "name": "status",
1884
+ "type": "text",
1885
+ "primaryKey": false,
1886
+ "notNull": true,
1887
+ "default": "'active'"
1888
+ },
1889
+ "created_at": {
1890
+ "name": "created_at",
1891
+ "type": "timestamp",
1892
+ "primaryKey": false,
1893
+ "notNull": true,
1894
+ "default": "now()"
1895
+ },
1896
+ "updated_at": {
1897
+ "name": "updated_at",
1898
+ "type": "timestamp",
1899
+ "primaryKey": false,
1900
+ "notNull": true,
1901
+ "default": "now()"
1902
+ },
1903
+ "ended_at": {
1904
+ "name": "ended_at",
1905
+ "type": "timestamp",
1906
+ "primaryKey": false,
1907
+ "notNull": false
1908
+ }
1909
+ },
1910
+ "indexes": {},
1911
+ "foreignKeys": {
1912
+ "agent_session_tenant_id_tenant_id_fk": {
1913
+ "name": "agent_session_tenant_id_tenant_id_fk",
1914
+ "tableFrom": "agent_session",
1915
+ "tableTo": "tenant",
1916
+ "columnsFrom": ["tenant_id"],
1917
+ "columnsTo": ["id"],
1918
+ "onDelete": "cascade",
1919
+ "onUpdate": "no action"
1920
+ },
1921
+ "agent_session_agent_id_agent_id_fk": {
1922
+ "name": "agent_session_agent_id_agent_id_fk",
1923
+ "tableFrom": "agent_session",
1924
+ "tableTo": "agent",
1925
+ "columnsFrom": ["agent_id"],
1926
+ "columnsTo": ["id"],
1927
+ "onDelete": "cascade",
1928
+ "onUpdate": "no action"
1929
+ },
1930
+ "agent_session_principal_id_principal_id_fk": {
1931
+ "name": "agent_session_principal_id_principal_id_fk",
1932
+ "tableFrom": "agent_session",
1933
+ "tableTo": "principal",
1934
+ "columnsFrom": ["principal_id"],
1935
+ "columnsTo": ["id"],
1936
+ "onDelete": "no action",
1937
+ "onUpdate": "no action"
1938
+ }
1939
+ },
1940
+ "compositePrimaryKeys": {},
1941
+ "uniqueConstraints": {},
1942
+ "policies": {},
1943
+ "checkConstraints": {},
1944
+ "isRLSEnabled": false
1945
+ },
1946
+ "public.agent_instance": {
1947
+ "name": "agent_instance",
1948
+ "schema": "",
1949
+ "columns": {
1950
+ "id": {
1951
+ "name": "id",
1952
+ "type": "text",
1953
+ "primaryKey": true,
1954
+ "notNull": true
1955
+ },
1956
+ "agent_id": {
1957
+ "name": "agent_id",
1958
+ "type": "text",
1959
+ "primaryKey": false,
1960
+ "notNull": true
1961
+ },
1962
+ "tenant_id": {
1963
+ "name": "tenant_id",
1964
+ "type": "text",
1965
+ "primaryKey": false,
1966
+ "notNull": true
1967
+ },
1968
+ "principal_id": {
1969
+ "name": "principal_id",
1970
+ "type": "text",
1971
+ "primaryKey": false,
1972
+ "notNull": true
1973
+ },
1974
+ "address": {
1975
+ "name": "address",
1976
+ "type": "text",
1977
+ "primaryKey": false,
1978
+ "notNull": true
1979
+ },
1980
+ "version_id": {
1981
+ "name": "version_id",
1982
+ "type": "text",
1983
+ "primaryKey": false,
1984
+ "notNull": false
1985
+ },
1986
+ "session_id": {
1987
+ "name": "session_id",
1988
+ "type": "text",
1989
+ "primaryKey": false,
1990
+ "notNull": false
1991
+ },
1992
+ "status": {
1993
+ "name": "status",
1994
+ "type": "text",
1995
+ "primaryKey": false,
1996
+ "notNull": true,
1997
+ "default": "'deployed'"
1998
+ },
1999
+ "sidecar_id": {
2000
+ "name": "sidecar_id",
2001
+ "type": "text",
2002
+ "primaryKey": false,
2003
+ "notNull": false
2004
+ },
2005
+ "public_key": {
2006
+ "name": "public_key",
2007
+ "type": "text",
2008
+ "primaryKey": false,
2009
+ "notNull": false
2010
+ },
2011
+ "kernel_id": {
2012
+ "name": "kernel_id",
2013
+ "type": "text",
2014
+ "primaryKey": false,
2015
+ "notNull": false
2016
+ },
2017
+ "created_at": {
2018
+ "name": "created_at",
2019
+ "type": "timestamp",
2020
+ "primaryKey": false,
2021
+ "notNull": true,
2022
+ "default": "now()"
2023
+ },
2024
+ "updated_at": {
2025
+ "name": "updated_at",
2026
+ "type": "timestamp",
2027
+ "primaryKey": false,
2028
+ "notNull": true,
2029
+ "default": "now()"
2030
+ },
2031
+ "ended_at": {
2032
+ "name": "ended_at",
2033
+ "type": "timestamp",
2034
+ "primaryKey": false,
2035
+ "notNull": false
2036
+ }
2037
+ },
2038
+ "indexes": {},
2039
+ "foreignKeys": {
2040
+ "agent_instance_agent_id_agent_id_fk": {
2041
+ "name": "agent_instance_agent_id_agent_id_fk",
2042
+ "tableFrom": "agent_instance",
2043
+ "tableTo": "agent",
2044
+ "columnsFrom": ["agent_id"],
2045
+ "columnsTo": ["id"],
2046
+ "onDelete": "cascade",
2047
+ "onUpdate": "no action"
2048
+ },
2049
+ "agent_instance_tenant_id_tenant_id_fk": {
2050
+ "name": "agent_instance_tenant_id_tenant_id_fk",
2051
+ "tableFrom": "agent_instance",
2052
+ "tableTo": "tenant",
2053
+ "columnsFrom": ["tenant_id"],
2054
+ "columnsTo": ["id"],
2055
+ "onDelete": "cascade",
2056
+ "onUpdate": "no action"
2057
+ },
2058
+ "agent_instance_principal_id_principal_id_fk": {
2059
+ "name": "agent_instance_principal_id_principal_id_fk",
2060
+ "tableFrom": "agent_instance",
2061
+ "tableTo": "principal",
2062
+ "columnsFrom": ["principal_id"],
2063
+ "columnsTo": ["id"],
2064
+ "onDelete": "no action",
2065
+ "onUpdate": "no action"
2066
+ },
2067
+ "agent_instance_version_id_agent_version_id_fk": {
2068
+ "name": "agent_instance_version_id_agent_version_id_fk",
2069
+ "tableFrom": "agent_instance",
2070
+ "tableTo": "agent_version",
2071
+ "columnsFrom": ["version_id"],
2072
+ "columnsTo": ["id"],
2073
+ "onDelete": "no action",
2074
+ "onUpdate": "no action"
2075
+ },
2076
+ "agent_instance_session_id_agent_session_id_fk": {
2077
+ "name": "agent_instance_session_id_agent_session_id_fk",
2078
+ "tableFrom": "agent_instance",
2079
+ "tableTo": "agent_session",
2080
+ "columnsFrom": ["session_id"],
2081
+ "columnsTo": ["id"],
2082
+ "onDelete": "no action",
2083
+ "onUpdate": "no action"
2084
+ },
2085
+ "agent_instance_sidecar_id_sidecar_id_fk": {
2086
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
2087
+ "tableFrom": "agent_instance",
2088
+ "tableTo": "sidecar",
2089
+ "columnsFrom": ["sidecar_id"],
2090
+ "columnsTo": ["id"],
2091
+ "onDelete": "set null",
2092
+ "onUpdate": "no action"
2093
+ }
2094
+ },
2095
+ "compositePrimaryKeys": {},
2096
+ "uniqueConstraints": {
2097
+ "agent_instance_address_unique": {
2098
+ "name": "agent_instance_address_unique",
2099
+ "nullsNotDistinct": false,
2100
+ "columns": ["address"]
2101
+ }
2102
+ },
2103
+ "policies": {},
2104
+ "checkConstraints": {},
2105
+ "isRLSEnabled": false
2106
+ },
2107
+ "public.session_asset": {
2108
+ "name": "session_asset",
2109
+ "schema": "",
2110
+ "columns": {
2111
+ "instance_id": {
2112
+ "name": "instance_id",
2113
+ "type": "text",
2114
+ "primaryKey": false,
2115
+ "notNull": true
2116
+ },
2117
+ "agent_asset_id": {
2118
+ "name": "agent_asset_id",
2119
+ "type": "text",
2120
+ "primaryKey": false,
2121
+ "notNull": true
2122
+ },
2123
+ "mount_path": {
2124
+ "name": "mount_path",
2125
+ "type": "text",
2126
+ "primaryKey": false,
2127
+ "notNull": true
2128
+ },
2129
+ "asset_pack_sha": {
2130
+ "name": "asset_pack_sha",
2131
+ "type": "text",
2132
+ "primaryKey": false,
2133
+ "notNull": true
2134
+ },
2135
+ "source_commit_sha": {
2136
+ "name": "source_commit_sha",
2137
+ "type": "text",
2138
+ "primaryKey": false,
2139
+ "notNull": true
2140
+ },
2141
+ "materialized_at": {
2142
+ "name": "materialized_at",
2143
+ "type": "timestamp",
2144
+ "primaryKey": false,
2145
+ "notNull": true,
2146
+ "default": "now()"
2147
+ }
2148
+ },
2149
+ "indexes": {
2150
+ "session_asset_pack_sha_idx": {
2151
+ "name": "session_asset_pack_sha_idx",
2152
+ "columns": [
2153
+ {
2154
+ "expression": "asset_pack_sha",
2155
+ "isExpression": false,
2156
+ "asc": true,
2157
+ "nulls": "last"
2158
+ }
2159
+ ],
2160
+ "isUnique": false,
2161
+ "concurrently": false,
2162
+ "method": "btree",
2163
+ "with": {}
2164
+ }
2165
+ },
2166
+ "foreignKeys": {
2167
+ "session_asset_instance_id_agent_instance_id_fk": {
2168
+ "name": "session_asset_instance_id_agent_instance_id_fk",
2169
+ "tableFrom": "session_asset",
2170
+ "tableTo": "agent_instance",
2171
+ "columnsFrom": ["instance_id"],
2172
+ "columnsTo": ["id"],
2173
+ "onDelete": "cascade",
2174
+ "onUpdate": "no action"
2175
+ },
2176
+ "session_asset_agent_asset_id_agent_asset_id_fk": {
2177
+ "name": "session_asset_agent_asset_id_agent_asset_id_fk",
2178
+ "tableFrom": "session_asset",
2179
+ "tableTo": "agent_asset",
2180
+ "columnsFrom": ["agent_asset_id"],
2181
+ "columnsTo": ["id"],
2182
+ "onDelete": "cascade",
2183
+ "onUpdate": "no action"
2184
+ }
2185
+ },
2186
+ "compositePrimaryKeys": {
2187
+ "session_asset_instance_id_agent_asset_id_pk": {
2188
+ "name": "session_asset_instance_id_agent_asset_id_pk",
2189
+ "columns": ["instance_id", "agent_asset_id"]
2190
+ }
2191
+ },
2192
+ "uniqueConstraints": {},
2193
+ "policies": {},
2194
+ "checkConstraints": {},
2195
+ "isRLSEnabled": false
2196
+ },
2197
+ "public.inference_turn": {
2198
+ "name": "inference_turn",
2199
+ "schema": "",
2200
+ "columns": {
2201
+ "id": {
2202
+ "name": "id",
2203
+ "type": "text",
2204
+ "primaryKey": true,
2205
+ "notNull": true
2206
+ },
2207
+ "session_id": {
2208
+ "name": "session_id",
2209
+ "type": "text",
2210
+ "primaryKey": false,
2211
+ "notNull": true
2212
+ },
2213
+ "instance_id": {
2214
+ "name": "instance_id",
2215
+ "type": "text",
2216
+ "primaryKey": false,
2217
+ "notNull": true
2218
+ },
2219
+ "tenant_id": {
2220
+ "name": "tenant_id",
2221
+ "type": "text",
2222
+ "primaryKey": false,
2223
+ "notNull": true
2224
+ },
2225
+ "model": {
2226
+ "name": "model",
2227
+ "type": "text",
2228
+ "primaryKey": false,
2229
+ "notNull": true
2230
+ },
2231
+ "status": {
2232
+ "name": "status",
2233
+ "type": "text",
2234
+ "primaryKey": false,
2235
+ "notNull": true,
2236
+ "default": "'running'"
2237
+ },
2238
+ "started_at": {
2239
+ "name": "started_at",
2240
+ "type": "timestamp",
2241
+ "primaryKey": false,
2242
+ "notNull": true
2243
+ },
2244
+ "ended_at": {
2245
+ "name": "ended_at",
2246
+ "type": "timestamp",
2247
+ "primaryKey": false,
2248
+ "notNull": false
2249
+ }
2250
+ },
2251
+ "indexes": {
2252
+ "inference_turn_instance_id_started_at_idx": {
2253
+ "name": "inference_turn_instance_id_started_at_idx",
2254
+ "columns": [
2255
+ {
2256
+ "expression": "instance_id",
2257
+ "isExpression": false,
2258
+ "asc": true,
2259
+ "nulls": "last"
2260
+ },
2261
+ {
2262
+ "expression": "started_at",
2263
+ "isExpression": false,
2264
+ "asc": true,
2265
+ "nulls": "last"
2266
+ }
2267
+ ],
2268
+ "isUnique": false,
2269
+ "concurrently": false,
2270
+ "method": "btree",
2271
+ "with": {}
2272
+ }
2273
+ },
2274
+ "foreignKeys": {
2275
+ "inference_turn_session_id_agent_session_id_fk": {
2276
+ "name": "inference_turn_session_id_agent_session_id_fk",
2277
+ "tableFrom": "inference_turn",
2278
+ "tableTo": "agent_session",
2279
+ "columnsFrom": ["session_id"],
2280
+ "columnsTo": ["id"],
2281
+ "onDelete": "cascade",
2282
+ "onUpdate": "no action"
2283
+ },
2284
+ "inference_turn_instance_id_agent_instance_id_fk": {
2285
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2286
+ "tableFrom": "inference_turn",
2287
+ "tableTo": "agent_instance",
2288
+ "columnsFrom": ["instance_id"],
2289
+ "columnsTo": ["id"],
2290
+ "onDelete": "cascade",
2291
+ "onUpdate": "no action"
2292
+ },
2293
+ "inference_turn_tenant_id_tenant_id_fk": {
2294
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2295
+ "tableFrom": "inference_turn",
2296
+ "tableTo": "tenant",
2297
+ "columnsFrom": ["tenant_id"],
2298
+ "columnsTo": ["id"],
2299
+ "onDelete": "cascade",
2300
+ "onUpdate": "no action"
2301
+ }
2302
+ },
2303
+ "compositePrimaryKeys": {},
2304
+ "uniqueConstraints": {},
2305
+ "policies": {},
2306
+ "checkConstraints": {},
2307
+ "isRLSEnabled": false
2308
+ },
2309
+ "public.session_mail": {
2310
+ "name": "session_mail",
2311
+ "schema": "",
2312
+ "columns": {
2313
+ "id": {
2314
+ "name": "id",
2315
+ "type": "text",
2316
+ "primaryKey": true,
2317
+ "notNull": true
2318
+ },
2319
+ "session_id": {
2320
+ "name": "session_id",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": true
2324
+ },
2325
+ "instance_id": {
2326
+ "name": "instance_id",
2327
+ "type": "text",
2328
+ "primaryKey": false,
2329
+ "notNull": false
2330
+ },
2331
+ "tenant_id": {
2332
+ "name": "tenant_id",
2333
+ "type": "text",
2334
+ "primaryKey": false,
2335
+ "notNull": true
2336
+ },
2337
+ "direction": {
2338
+ "name": "direction",
2339
+ "type": "text",
2340
+ "primaryKey": false,
2341
+ "notNull": true
2342
+ },
2343
+ "status": {
2344
+ "name": "status",
2345
+ "type": "text",
2346
+ "primaryKey": false,
2347
+ "notNull": true,
2348
+ "default": "'pending'"
2349
+ },
2350
+ "raw": {
2351
+ "name": "raw",
2352
+ "type": "bytea",
2353
+ "primaryKey": false,
2354
+ "notNull": true
2355
+ },
2356
+ "created_at": {
2357
+ "name": "created_at",
2358
+ "type": "timestamp",
2359
+ "primaryKey": false,
2360
+ "notNull": true,
2361
+ "default": "now()"
2362
+ }
2363
+ },
2364
+ "indexes": {
2365
+ "session_mail_instance_id_created_at_idx": {
2366
+ "name": "session_mail_instance_id_created_at_idx",
2367
+ "columns": [
2368
+ {
2369
+ "expression": "instance_id",
2370
+ "isExpression": false,
2371
+ "asc": true,
2372
+ "nulls": "last"
2373
+ },
2374
+ {
2375
+ "expression": "created_at",
2376
+ "isExpression": false,
2377
+ "asc": true,
2378
+ "nulls": "last"
2379
+ }
2380
+ ],
2381
+ "isUnique": false,
2382
+ "concurrently": false,
2383
+ "method": "btree",
2384
+ "with": {}
2385
+ }
2386
+ },
2387
+ "foreignKeys": {
2388
+ "session_mail_session_id_agent_session_id_fk": {
2389
+ "name": "session_mail_session_id_agent_session_id_fk",
2390
+ "tableFrom": "session_mail",
2391
+ "tableTo": "agent_session",
2392
+ "columnsFrom": ["session_id"],
2393
+ "columnsTo": ["id"],
2394
+ "onDelete": "cascade",
2395
+ "onUpdate": "no action"
2396
+ },
2397
+ "session_mail_instance_id_agent_instance_id_fk": {
2398
+ "name": "session_mail_instance_id_agent_instance_id_fk",
2399
+ "tableFrom": "session_mail",
2400
+ "tableTo": "agent_instance",
2401
+ "columnsFrom": ["instance_id"],
2402
+ "columnsTo": ["id"],
2403
+ "onDelete": "set null",
2404
+ "onUpdate": "no action"
2405
+ },
2406
+ "session_mail_tenant_id_tenant_id_fk": {
2407
+ "name": "session_mail_tenant_id_tenant_id_fk",
2408
+ "tableFrom": "session_mail",
2409
+ "tableTo": "tenant",
2410
+ "columnsFrom": ["tenant_id"],
2411
+ "columnsTo": ["id"],
2412
+ "onDelete": "cascade",
2413
+ "onUpdate": "no action"
2414
+ }
2415
+ },
2416
+ "compositePrimaryKeys": {},
2417
+ "uniqueConstraints": {},
2418
+ "policies": {},
2419
+ "checkConstraints": {},
2420
+ "isRLSEnabled": false
2421
+ },
2422
+ "public.turn_part": {
2423
+ "name": "turn_part",
2424
+ "schema": "",
2425
+ "columns": {
2426
+ "id": {
2427
+ "name": "id",
2428
+ "type": "text",
2429
+ "primaryKey": true,
2430
+ "notNull": true
2431
+ },
2432
+ "turn_id": {
2433
+ "name": "turn_id",
2434
+ "type": "text",
2435
+ "primaryKey": false,
2436
+ "notNull": true
2437
+ },
2438
+ "session_id": {
2439
+ "name": "session_id",
2440
+ "type": "text",
2441
+ "primaryKey": false,
2442
+ "notNull": true
2443
+ },
2444
+ "type": {
2445
+ "name": "type",
2446
+ "type": "text",
2447
+ "primaryKey": false,
2448
+ "notNull": true
2449
+ },
2450
+ "content": {
2451
+ "name": "content",
2452
+ "type": "text",
2453
+ "primaryKey": false,
2454
+ "notNull": false
2455
+ },
2456
+ "metadata": {
2457
+ "name": "metadata",
2458
+ "type": "jsonb",
2459
+ "primaryKey": false,
2460
+ "notNull": false
2461
+ },
2462
+ "ordinal": {
2463
+ "name": "ordinal",
2464
+ "type": "integer",
2465
+ "primaryKey": false,
2466
+ "notNull": true
2467
+ }
2468
+ },
2469
+ "indexes": {},
2470
+ "foreignKeys": {
2471
+ "turn_part_turn_id_inference_turn_id_fk": {
2472
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2473
+ "tableFrom": "turn_part",
2474
+ "tableTo": "inference_turn",
2475
+ "columnsFrom": ["turn_id"],
2476
+ "columnsTo": ["id"],
2477
+ "onDelete": "cascade",
2478
+ "onUpdate": "no action"
2479
+ },
2480
+ "turn_part_session_id_agent_session_id_fk": {
2481
+ "name": "turn_part_session_id_agent_session_id_fk",
2482
+ "tableFrom": "turn_part",
2483
+ "tableTo": "agent_session",
2484
+ "columnsFrom": ["session_id"],
2485
+ "columnsTo": ["id"],
2486
+ "onDelete": "cascade",
2487
+ "onUpdate": "no action"
2488
+ }
2489
+ },
2490
+ "compositePrimaryKeys": {},
2491
+ "uniqueConstraints": {},
2492
+ "policies": {},
2493
+ "checkConstraints": {},
2494
+ "isRLSEnabled": false
2495
+ },
2496
+ "public.git_token": {
2497
+ "name": "git_token",
2498
+ "schema": "",
2499
+ "columns": {
2500
+ "id": {
2501
+ "name": "id",
2502
+ "type": "text",
2503
+ "primaryKey": true,
2504
+ "notNull": true
2505
+ },
2506
+ "tenant_id": {
2507
+ "name": "tenant_id",
2508
+ "type": "text",
2509
+ "primaryKey": false,
2510
+ "notNull": false
2511
+ },
2512
+ "user_id": {
2513
+ "name": "user_id",
2514
+ "type": "text",
2515
+ "primaryKey": false,
2516
+ "notNull": true
2517
+ },
2518
+ "principal_id": {
2519
+ "name": "principal_id",
2520
+ "type": "text",
2521
+ "primaryKey": false,
2522
+ "notNull": false
2523
+ },
2524
+ "name": {
2525
+ "name": "name",
2526
+ "type": "text",
2527
+ "primaryKey": false,
2528
+ "notNull": true
2529
+ },
2530
+ "kind": {
2531
+ "name": "kind",
2532
+ "type": "text",
2533
+ "primaryKey": false,
2534
+ "notNull": true
2535
+ },
2536
+ "token_hash_sha256": {
2537
+ "name": "token_hash_sha256",
2538
+ "type": "bytea",
2539
+ "primaryKey": false,
2540
+ "notNull": true
2541
+ },
2542
+ "resource": {
2543
+ "name": "resource",
2544
+ "type": "text",
2545
+ "primaryKey": false,
2546
+ "notNull": true
2547
+ },
2548
+ "ref_pattern": {
2549
+ "name": "ref_pattern",
2550
+ "type": "text",
2551
+ "primaryKey": false,
2552
+ "notNull": true
2553
+ },
2554
+ "actions": {
2555
+ "name": "actions",
2556
+ "type": "text[]",
2557
+ "primaryKey": false,
2558
+ "notNull": true
2559
+ },
2560
+ "expires_at": {
2561
+ "name": "expires_at",
2562
+ "type": "timestamp with time zone",
2563
+ "primaryKey": false,
2564
+ "notNull": true
2565
+ },
2566
+ "revoked_at": {
2567
+ "name": "revoked_at",
2568
+ "type": "timestamp with time zone",
2569
+ "primaryKey": false,
2570
+ "notNull": false
2571
+ },
2572
+ "created_at": {
2573
+ "name": "created_at",
2574
+ "type": "timestamp with time zone",
2575
+ "primaryKey": false,
2576
+ "notNull": true,
2577
+ "default": "now()"
2578
+ }
2579
+ },
2580
+ "indexes": {
2581
+ "git_token_user_id_name_active_idx": {
2582
+ "name": "git_token_user_id_name_active_idx",
2583
+ "columns": [
2584
+ {
2585
+ "expression": "user_id",
2586
+ "isExpression": false,
2587
+ "asc": true,
2588
+ "nulls": "last"
2589
+ },
2590
+ {
2591
+ "expression": "name",
2592
+ "isExpression": false,
2593
+ "asc": true,
2594
+ "nulls": "last"
2595
+ }
2596
+ ],
2597
+ "isUnique": true,
2598
+ "where": "\"git_token\".\"revoked_at\" is null",
2599
+ "concurrently": false,
2600
+ "method": "btree",
2601
+ "with": {}
2602
+ }
2603
+ },
2604
+ "foreignKeys": {
2605
+ "git_token_tenant_id_tenant_id_fk": {
2606
+ "name": "git_token_tenant_id_tenant_id_fk",
2607
+ "tableFrom": "git_token",
2608
+ "tableTo": "tenant",
2609
+ "columnsFrom": ["tenant_id"],
2610
+ "columnsTo": ["id"],
2611
+ "onDelete": "no action",
2612
+ "onUpdate": "no action"
2613
+ },
2614
+ "git_token_user_id_user_id_fk": {
2615
+ "name": "git_token_user_id_user_id_fk",
2616
+ "tableFrom": "git_token",
2617
+ "tableTo": "user",
2618
+ "columnsFrom": ["user_id"],
2619
+ "columnsTo": ["id"],
2620
+ "onDelete": "cascade",
2621
+ "onUpdate": "no action"
2622
+ },
2623
+ "git_token_principal_id_principal_id_fk": {
2624
+ "name": "git_token_principal_id_principal_id_fk",
2625
+ "tableFrom": "git_token",
2626
+ "tableTo": "principal",
2627
+ "columnsFrom": ["principal_id"],
2628
+ "columnsTo": ["id"],
2629
+ "onDelete": "cascade",
2630
+ "onUpdate": "no action"
2631
+ }
2632
+ },
2633
+ "compositePrimaryKeys": {},
2634
+ "uniqueConstraints": {
2635
+ "git_token_token_hash_sha256_unique": {
2636
+ "name": "git_token_token_hash_sha256_unique",
2637
+ "nullsNotDistinct": false,
2638
+ "columns": ["token_hash_sha256"]
2639
+ }
2640
+ },
2641
+ "policies": {},
2642
+ "checkConstraints": {},
2643
+ "isRLSEnabled": false
2644
+ }
2645
+ },
2646
+ "enums": {},
2647
+ "schemas": {},
2648
+ "sequences": {},
2649
+ "roles": {},
2650
+ "policies": {},
2651
+ "views": {},
2652
+ "_meta": {
2653
+ "columns": {},
2654
+ "schemas": {},
2655
+ "tables": {}
2656
+ }
2657
+ }