@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,2260 @@
1
+ {
2
+ "id": "4e954dae-4184-4959-9436-2952eaedc787",
3
+ "prevId": "730bd5cb-9397-4e44-b477-c58d30c87a7e",
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": false
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
+ "skills": {
866
+ "name": "skills",
867
+ "type": "jsonb",
868
+ "primaryKey": false,
869
+ "notNull": false
870
+ },
871
+ "context_config": {
872
+ "name": "context_config",
873
+ "type": "jsonb",
874
+ "primaryKey": false,
875
+ "notNull": false
876
+ },
877
+ "initial_state": {
878
+ "name": "initial_state",
879
+ "type": "jsonb",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "model_config": {
884
+ "name": "model_config",
885
+ "type": "jsonb",
886
+ "primaryKey": false,
887
+ "notNull": false
888
+ },
889
+ "capabilities": {
890
+ "name": "capabilities",
891
+ "type": "jsonb",
892
+ "primaryKey": false,
893
+ "notNull": false
894
+ },
895
+ "credential_requirements": {
896
+ "name": "credential_requirements",
897
+ "type": "jsonb",
898
+ "primaryKey": false,
899
+ "notNull": false
900
+ },
901
+ "grant_requirements": {
902
+ "name": "grant_requirements",
903
+ "type": "jsonb",
904
+ "primaryKey": false,
905
+ "notNull": false
906
+ },
907
+ "current_version": {
908
+ "name": "current_version",
909
+ "type": "text",
910
+ "primaryKey": false,
911
+ "notNull": true,
912
+ "default": "'1'"
913
+ },
914
+ "status": {
915
+ "name": "status",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": true,
919
+ "default": "'deployed'"
920
+ },
921
+ "created_at": {
922
+ "name": "created_at",
923
+ "type": "timestamp",
924
+ "primaryKey": false,
925
+ "notNull": true,
926
+ "default": "now()"
927
+ },
928
+ "updated_at": {
929
+ "name": "updated_at",
930
+ "type": "timestamp",
931
+ "primaryKey": false,
932
+ "notNull": true,
933
+ "default": "now()"
934
+ }
935
+ },
936
+ "indexes": {},
937
+ "foreignKeys": {
938
+ "agent_tenant_id_tenant_id_fk": {
939
+ "name": "agent_tenant_id_tenant_id_fk",
940
+ "tableFrom": "agent",
941
+ "tableTo": "tenant",
942
+ "columnsFrom": ["tenant_id"],
943
+ "columnsTo": ["id"],
944
+ "onDelete": "cascade",
945
+ "onUpdate": "no action"
946
+ },
947
+ "agent_creator_principal_id_principal_id_fk": {
948
+ "name": "agent_creator_principal_id_principal_id_fk",
949
+ "tableFrom": "agent",
950
+ "tableTo": "principal",
951
+ "columnsFrom": ["creator_principal_id"],
952
+ "columnsTo": ["id"],
953
+ "onDelete": "no action",
954
+ "onUpdate": "no action"
955
+ }
956
+ },
957
+ "compositePrimaryKeys": {},
958
+ "uniqueConstraints": {},
959
+ "policies": {},
960
+ "checkConstraints": {},
961
+ "isRLSEnabled": false
962
+ },
963
+ "public.agent_version": {
964
+ "name": "agent_version",
965
+ "schema": "",
966
+ "columns": {
967
+ "id": {
968
+ "name": "id",
969
+ "type": "text",
970
+ "primaryKey": true,
971
+ "notNull": true
972
+ },
973
+ "agent_id": {
974
+ "name": "agent_id",
975
+ "type": "text",
976
+ "primaryKey": false,
977
+ "notNull": true
978
+ },
979
+ "version": {
980
+ "name": "version",
981
+ "type": "text",
982
+ "primaryKey": false,
983
+ "notNull": true
984
+ },
985
+ "status": {
986
+ "name": "status",
987
+ "type": "text",
988
+ "primaryKey": false,
989
+ "notNull": true,
990
+ "default": "'active'"
991
+ },
992
+ "created_at": {
993
+ "name": "created_at",
994
+ "type": "timestamp",
995
+ "primaryKey": false,
996
+ "notNull": true,
997
+ "default": "now()"
998
+ }
999
+ },
1000
+ "indexes": {},
1001
+ "foreignKeys": {
1002
+ "agent_version_agent_id_agent_id_fk": {
1003
+ "name": "agent_version_agent_id_agent_id_fk",
1004
+ "tableFrom": "agent_version",
1005
+ "tableTo": "agent",
1006
+ "columnsFrom": ["agent_id"],
1007
+ "columnsTo": ["id"],
1008
+ "onDelete": "cascade",
1009
+ "onUpdate": "no action"
1010
+ }
1011
+ },
1012
+ "compositePrimaryKeys": {},
1013
+ "uniqueConstraints": {},
1014
+ "policies": {},
1015
+ "checkConstraints": {},
1016
+ "isRLSEnabled": false
1017
+ },
1018
+ "public.provider": {
1019
+ "name": "provider",
1020
+ "schema": "",
1021
+ "columns": {
1022
+ "id": {
1023
+ "name": "id",
1024
+ "type": "text",
1025
+ "primaryKey": true,
1026
+ "notNull": true
1027
+ },
1028
+ "tenant_id": {
1029
+ "name": "tenant_id",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": true
1033
+ },
1034
+ "name": {
1035
+ "name": "name",
1036
+ "type": "text",
1037
+ "primaryKey": false,
1038
+ "notNull": true
1039
+ },
1040
+ "plugin": {
1041
+ "name": "plugin",
1042
+ "type": "text",
1043
+ "primaryKey": false,
1044
+ "notNull": true
1045
+ },
1046
+ "authorization_url": {
1047
+ "name": "authorization_url",
1048
+ "type": "text",
1049
+ "primaryKey": false,
1050
+ "notNull": false
1051
+ },
1052
+ "token_url": {
1053
+ "name": "token_url",
1054
+ "type": "text",
1055
+ "primaryKey": false,
1056
+ "notNull": false
1057
+ },
1058
+ "user_info_url": {
1059
+ "name": "user_info_url",
1060
+ "type": "text",
1061
+ "primaryKey": false,
1062
+ "notNull": false
1063
+ },
1064
+ "scopes": {
1065
+ "name": "scopes",
1066
+ "type": "text[]",
1067
+ "primaryKey": false,
1068
+ "notNull": false
1069
+ },
1070
+ "metadata": {
1071
+ "name": "metadata",
1072
+ "type": "jsonb",
1073
+ "primaryKey": false,
1074
+ "notNull": false
1075
+ },
1076
+ "created_at": {
1077
+ "name": "created_at",
1078
+ "type": "timestamp",
1079
+ "primaryKey": false,
1080
+ "notNull": true,
1081
+ "default": "now()"
1082
+ },
1083
+ "updated_at": {
1084
+ "name": "updated_at",
1085
+ "type": "timestamp",
1086
+ "primaryKey": false,
1087
+ "notNull": true,
1088
+ "default": "now()"
1089
+ }
1090
+ },
1091
+ "indexes": {},
1092
+ "foreignKeys": {
1093
+ "provider_tenant_id_tenant_id_fk": {
1094
+ "name": "provider_tenant_id_tenant_id_fk",
1095
+ "tableFrom": "provider",
1096
+ "tableTo": "tenant",
1097
+ "columnsFrom": ["tenant_id"],
1098
+ "columnsTo": ["id"],
1099
+ "onDelete": "cascade",
1100
+ "onUpdate": "no action"
1101
+ }
1102
+ },
1103
+ "compositePrimaryKeys": {},
1104
+ "uniqueConstraints": {
1105
+ "provider_tenant_name": {
1106
+ "name": "provider_tenant_name",
1107
+ "nullsNotDistinct": false,
1108
+ "columns": ["tenant_id", "name"]
1109
+ }
1110
+ },
1111
+ "policies": {},
1112
+ "checkConstraints": {},
1113
+ "isRLSEnabled": false
1114
+ },
1115
+ "public.oauth_client": {
1116
+ "name": "oauth_client",
1117
+ "schema": "",
1118
+ "columns": {
1119
+ "id": {
1120
+ "name": "id",
1121
+ "type": "text",
1122
+ "primaryKey": true,
1123
+ "notNull": true
1124
+ },
1125
+ "tenant_id": {
1126
+ "name": "tenant_id",
1127
+ "type": "text",
1128
+ "primaryKey": false,
1129
+ "notNull": true
1130
+ },
1131
+ "provider_id": {
1132
+ "name": "provider_id",
1133
+ "type": "text",
1134
+ "primaryKey": false,
1135
+ "notNull": true
1136
+ },
1137
+ "name": {
1138
+ "name": "name",
1139
+ "type": "text",
1140
+ "primaryKey": false,
1141
+ "notNull": true
1142
+ },
1143
+ "client_id": {
1144
+ "name": "client_id",
1145
+ "type": "text",
1146
+ "primaryKey": false,
1147
+ "notNull": true
1148
+ },
1149
+ "client_secret": {
1150
+ "name": "client_secret",
1151
+ "type": "text",
1152
+ "primaryKey": false,
1153
+ "notNull": true
1154
+ },
1155
+ "redirect_uris": {
1156
+ "name": "redirect_uris",
1157
+ "type": "text[]",
1158
+ "primaryKey": false,
1159
+ "notNull": false
1160
+ },
1161
+ "default_scopes": {
1162
+ "name": "default_scopes",
1163
+ "type": "text[]",
1164
+ "primaryKey": false,
1165
+ "notNull": false
1166
+ },
1167
+ "metadata": {
1168
+ "name": "metadata",
1169
+ "type": "jsonb",
1170
+ "primaryKey": false,
1171
+ "notNull": false
1172
+ },
1173
+ "created_at": {
1174
+ "name": "created_at",
1175
+ "type": "timestamp",
1176
+ "primaryKey": false,
1177
+ "notNull": true,
1178
+ "default": "now()"
1179
+ },
1180
+ "updated_at": {
1181
+ "name": "updated_at",
1182
+ "type": "timestamp",
1183
+ "primaryKey": false,
1184
+ "notNull": true,
1185
+ "default": "now()"
1186
+ }
1187
+ },
1188
+ "indexes": {},
1189
+ "foreignKeys": {
1190
+ "oauth_client_tenant_id_tenant_id_fk": {
1191
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1192
+ "tableFrom": "oauth_client",
1193
+ "tableTo": "tenant",
1194
+ "columnsFrom": ["tenant_id"],
1195
+ "columnsTo": ["id"],
1196
+ "onDelete": "cascade",
1197
+ "onUpdate": "no action"
1198
+ },
1199
+ "oauth_client_provider_id_provider_id_fk": {
1200
+ "name": "oauth_client_provider_id_provider_id_fk",
1201
+ "tableFrom": "oauth_client",
1202
+ "tableTo": "provider",
1203
+ "columnsFrom": ["provider_id"],
1204
+ "columnsTo": ["id"],
1205
+ "onDelete": "cascade",
1206
+ "onUpdate": "no action"
1207
+ }
1208
+ },
1209
+ "compositePrimaryKeys": {},
1210
+ "uniqueConstraints": {
1211
+ "oauth_client_tenant_provider": {
1212
+ "name": "oauth_client_tenant_provider",
1213
+ "nullsNotDistinct": false,
1214
+ "columns": ["tenant_id", "provider_id"]
1215
+ }
1216
+ },
1217
+ "policies": {},
1218
+ "checkConstraints": {},
1219
+ "isRLSEnabled": false
1220
+ },
1221
+ "public.credential": {
1222
+ "name": "credential",
1223
+ "schema": "",
1224
+ "columns": {
1225
+ "id": {
1226
+ "name": "id",
1227
+ "type": "text",
1228
+ "primaryKey": true,
1229
+ "notNull": true
1230
+ },
1231
+ "tenant_id": {
1232
+ "name": "tenant_id",
1233
+ "type": "text",
1234
+ "primaryKey": false,
1235
+ "notNull": true
1236
+ },
1237
+ "principal_id": {
1238
+ "name": "principal_id",
1239
+ "type": "text",
1240
+ "primaryKey": false,
1241
+ "notNull": false
1242
+ },
1243
+ "provider_id": {
1244
+ "name": "provider_id",
1245
+ "type": "text",
1246
+ "primaryKey": false,
1247
+ "notNull": true
1248
+ },
1249
+ "oauth_client_id": {
1250
+ "name": "oauth_client_id",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": false
1254
+ },
1255
+ "name": {
1256
+ "name": "name",
1257
+ "type": "text",
1258
+ "primaryKey": false,
1259
+ "notNull": true
1260
+ },
1261
+ "type": {
1262
+ "name": "type",
1263
+ "type": "text",
1264
+ "primaryKey": false,
1265
+ "notNull": true
1266
+ },
1267
+ "description": {
1268
+ "name": "description",
1269
+ "type": "text",
1270
+ "primaryKey": false,
1271
+ "notNull": false
1272
+ },
1273
+ "secret": {
1274
+ "name": "secret",
1275
+ "type": "text",
1276
+ "primaryKey": false,
1277
+ "notNull": true
1278
+ },
1279
+ "refresh_secret": {
1280
+ "name": "refresh_secret",
1281
+ "type": "text",
1282
+ "primaryKey": false,
1283
+ "notNull": false
1284
+ },
1285
+ "scopes": {
1286
+ "name": "scopes",
1287
+ "type": "text[]",
1288
+ "primaryKey": false,
1289
+ "notNull": false
1290
+ },
1291
+ "expires_at": {
1292
+ "name": "expires_at",
1293
+ "type": "timestamp",
1294
+ "primaryKey": false,
1295
+ "notNull": false
1296
+ },
1297
+ "status": {
1298
+ "name": "status",
1299
+ "type": "text",
1300
+ "primaryKey": false,
1301
+ "notNull": true,
1302
+ "default": "'active'"
1303
+ },
1304
+ "metadata": {
1305
+ "name": "metadata",
1306
+ "type": "jsonb",
1307
+ "primaryKey": false,
1308
+ "notNull": false
1309
+ },
1310
+ "created_at": {
1311
+ "name": "created_at",
1312
+ "type": "timestamp",
1313
+ "primaryKey": false,
1314
+ "notNull": true,
1315
+ "default": "now()"
1316
+ },
1317
+ "updated_at": {
1318
+ "name": "updated_at",
1319
+ "type": "timestamp",
1320
+ "primaryKey": false,
1321
+ "notNull": true,
1322
+ "default": "now()"
1323
+ }
1324
+ },
1325
+ "indexes": {},
1326
+ "foreignKeys": {
1327
+ "credential_tenant_id_tenant_id_fk": {
1328
+ "name": "credential_tenant_id_tenant_id_fk",
1329
+ "tableFrom": "credential",
1330
+ "tableTo": "tenant",
1331
+ "columnsFrom": ["tenant_id"],
1332
+ "columnsTo": ["id"],
1333
+ "onDelete": "cascade",
1334
+ "onUpdate": "no action"
1335
+ },
1336
+ "credential_principal_id_principal_id_fk": {
1337
+ "name": "credential_principal_id_principal_id_fk",
1338
+ "tableFrom": "credential",
1339
+ "tableTo": "principal",
1340
+ "columnsFrom": ["principal_id"],
1341
+ "columnsTo": ["id"],
1342
+ "onDelete": "set null",
1343
+ "onUpdate": "no action"
1344
+ },
1345
+ "credential_provider_id_provider_id_fk": {
1346
+ "name": "credential_provider_id_provider_id_fk",
1347
+ "tableFrom": "credential",
1348
+ "tableTo": "provider",
1349
+ "columnsFrom": ["provider_id"],
1350
+ "columnsTo": ["id"],
1351
+ "onDelete": "cascade",
1352
+ "onUpdate": "no action"
1353
+ },
1354
+ "credential_oauth_client_id_oauth_client_id_fk": {
1355
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1356
+ "tableFrom": "credential",
1357
+ "tableTo": "oauth_client",
1358
+ "columnsFrom": ["oauth_client_id"],
1359
+ "columnsTo": ["id"],
1360
+ "onDelete": "set null",
1361
+ "onUpdate": "no action"
1362
+ }
1363
+ },
1364
+ "compositePrimaryKeys": {},
1365
+ "uniqueConstraints": {
1366
+ "credential_tenant_name": {
1367
+ "name": "credential_tenant_name",
1368
+ "nullsNotDistinct": false,
1369
+ "columns": ["tenant_id", "name"]
1370
+ }
1371
+ },
1372
+ "policies": {},
1373
+ "checkConstraints": {},
1374
+ "isRLSEnabled": false
1375
+ },
1376
+ "public.transaction": {
1377
+ "name": "transaction",
1378
+ "schema": "",
1379
+ "columns": {
1380
+ "id": {
1381
+ "name": "id",
1382
+ "type": "text",
1383
+ "primaryKey": true,
1384
+ "notNull": true
1385
+ },
1386
+ "wallet_id": {
1387
+ "name": "wallet_id",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": true
1391
+ },
1392
+ "agent_id": {
1393
+ "name": "agent_id",
1394
+ "type": "text",
1395
+ "primaryKey": false,
1396
+ "notNull": false
1397
+ },
1398
+ "direction": {
1399
+ "name": "direction",
1400
+ "type": "text",
1401
+ "primaryKey": false,
1402
+ "notNull": true
1403
+ },
1404
+ "amount": {
1405
+ "name": "amount",
1406
+ "type": "text",
1407
+ "primaryKey": false,
1408
+ "notNull": true
1409
+ },
1410
+ "currency": {
1411
+ "name": "currency",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": true
1415
+ },
1416
+ "recipient_id": {
1417
+ "name": "recipient_id",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": false
1421
+ },
1422
+ "sender_id": {
1423
+ "name": "sender_id",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": false
1427
+ },
1428
+ "request_id": {
1429
+ "name": "request_id",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": false
1433
+ },
1434
+ "status": {
1435
+ "name": "status",
1436
+ "type": "text",
1437
+ "primaryKey": false,
1438
+ "notNull": true,
1439
+ "default": "'pending'"
1440
+ },
1441
+ "created_at": {
1442
+ "name": "created_at",
1443
+ "type": "timestamp",
1444
+ "primaryKey": false,
1445
+ "notNull": true,
1446
+ "default": "now()"
1447
+ }
1448
+ },
1449
+ "indexes": {},
1450
+ "foreignKeys": {
1451
+ "transaction_wallet_id_wallet_id_fk": {
1452
+ "name": "transaction_wallet_id_wallet_id_fk",
1453
+ "tableFrom": "transaction",
1454
+ "tableTo": "wallet",
1455
+ "columnsFrom": ["wallet_id"],
1456
+ "columnsTo": ["id"],
1457
+ "onDelete": "cascade",
1458
+ "onUpdate": "no action"
1459
+ },
1460
+ "transaction_agent_id_agent_id_fk": {
1461
+ "name": "transaction_agent_id_agent_id_fk",
1462
+ "tableFrom": "transaction",
1463
+ "tableTo": "agent",
1464
+ "columnsFrom": ["agent_id"],
1465
+ "columnsTo": ["id"],
1466
+ "onDelete": "set null",
1467
+ "onUpdate": "no action"
1468
+ }
1469
+ },
1470
+ "compositePrimaryKeys": {},
1471
+ "uniqueConstraints": {},
1472
+ "policies": {},
1473
+ "checkConstraints": {},
1474
+ "isRLSEnabled": false
1475
+ },
1476
+ "public.wallet": {
1477
+ "name": "wallet",
1478
+ "schema": "",
1479
+ "columns": {
1480
+ "id": {
1481
+ "name": "id",
1482
+ "type": "text",
1483
+ "primaryKey": true,
1484
+ "notNull": true
1485
+ },
1486
+ "tenant_id": {
1487
+ "name": "tenant_id",
1488
+ "type": "text",
1489
+ "primaryKey": false,
1490
+ "notNull": true
1491
+ },
1492
+ "name": {
1493
+ "name": "name",
1494
+ "type": "text",
1495
+ "primaryKey": false,
1496
+ "notNull": true
1497
+ },
1498
+ "backend_type": {
1499
+ "name": "backend_type",
1500
+ "type": "text",
1501
+ "primaryKey": false,
1502
+ "notNull": true
1503
+ },
1504
+ "currency": {
1505
+ "name": "currency",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true
1509
+ },
1510
+ "balance": {
1511
+ "name": "balance",
1512
+ "type": "text",
1513
+ "primaryKey": false,
1514
+ "notNull": true,
1515
+ "default": "'0'"
1516
+ },
1517
+ "config": {
1518
+ "name": "config",
1519
+ "type": "jsonb",
1520
+ "primaryKey": false,
1521
+ "notNull": false
1522
+ },
1523
+ "created_at": {
1524
+ "name": "created_at",
1525
+ "type": "timestamp",
1526
+ "primaryKey": false,
1527
+ "notNull": true,
1528
+ "default": "now()"
1529
+ },
1530
+ "updated_at": {
1531
+ "name": "updated_at",
1532
+ "type": "timestamp",
1533
+ "primaryKey": false,
1534
+ "notNull": true,
1535
+ "default": "now()"
1536
+ }
1537
+ },
1538
+ "indexes": {},
1539
+ "foreignKeys": {
1540
+ "wallet_tenant_id_tenant_id_fk": {
1541
+ "name": "wallet_tenant_id_tenant_id_fk",
1542
+ "tableFrom": "wallet",
1543
+ "tableTo": "tenant",
1544
+ "columnsFrom": ["tenant_id"],
1545
+ "columnsTo": ["id"],
1546
+ "onDelete": "cascade",
1547
+ "onUpdate": "no action"
1548
+ }
1549
+ },
1550
+ "compositePrimaryKeys": {},
1551
+ "uniqueConstraints": {},
1552
+ "policies": {},
1553
+ "checkConstraints": {},
1554
+ "isRLSEnabled": false
1555
+ },
1556
+ "public.offering": {
1557
+ "name": "offering",
1558
+ "schema": "",
1559
+ "columns": {
1560
+ "id": {
1561
+ "name": "id",
1562
+ "type": "text",
1563
+ "primaryKey": true,
1564
+ "notNull": true
1565
+ },
1566
+ "agent_id": {
1567
+ "name": "agent_id",
1568
+ "type": "text",
1569
+ "primaryKey": false,
1570
+ "notNull": true
1571
+ },
1572
+ "tenant_id": {
1573
+ "name": "tenant_id",
1574
+ "type": "text",
1575
+ "primaryKey": false,
1576
+ "notNull": true
1577
+ },
1578
+ "name": {
1579
+ "name": "name",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": true
1583
+ },
1584
+ "description": {
1585
+ "name": "description",
1586
+ "type": "text",
1587
+ "primaryKey": false,
1588
+ "notNull": false
1589
+ },
1590
+ "pricing": {
1591
+ "name": "pricing",
1592
+ "type": "jsonb",
1593
+ "primaryKey": false,
1594
+ "notNull": false
1595
+ },
1596
+ "schema": {
1597
+ "name": "schema",
1598
+ "type": "jsonb",
1599
+ "primaryKey": false,
1600
+ "notNull": false
1601
+ },
1602
+ "created_at": {
1603
+ "name": "created_at",
1604
+ "type": "timestamp",
1605
+ "primaryKey": false,
1606
+ "notNull": true,
1607
+ "default": "now()"
1608
+ },
1609
+ "updated_at": {
1610
+ "name": "updated_at",
1611
+ "type": "timestamp",
1612
+ "primaryKey": false,
1613
+ "notNull": true,
1614
+ "default": "now()"
1615
+ }
1616
+ },
1617
+ "indexes": {},
1618
+ "foreignKeys": {
1619
+ "offering_agent_id_agent_id_fk": {
1620
+ "name": "offering_agent_id_agent_id_fk",
1621
+ "tableFrom": "offering",
1622
+ "tableTo": "agent",
1623
+ "columnsFrom": ["agent_id"],
1624
+ "columnsTo": ["id"],
1625
+ "onDelete": "cascade",
1626
+ "onUpdate": "no action"
1627
+ },
1628
+ "offering_tenant_id_tenant_id_fk": {
1629
+ "name": "offering_tenant_id_tenant_id_fk",
1630
+ "tableFrom": "offering",
1631
+ "tableTo": "tenant",
1632
+ "columnsFrom": ["tenant_id"],
1633
+ "columnsTo": ["id"],
1634
+ "onDelete": "cascade",
1635
+ "onUpdate": "no action"
1636
+ }
1637
+ },
1638
+ "compositePrimaryKeys": {},
1639
+ "uniqueConstraints": {},
1640
+ "policies": {},
1641
+ "checkConstraints": {},
1642
+ "isRLSEnabled": false
1643
+ },
1644
+ "public.sidecar": {
1645
+ "name": "sidecar",
1646
+ "schema": "",
1647
+ "columns": {
1648
+ "id": {
1649
+ "name": "id",
1650
+ "type": "text",
1651
+ "primaryKey": true,
1652
+ "notNull": true
1653
+ },
1654
+ "url": {
1655
+ "name": "url",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": true
1659
+ },
1660
+ "status": {
1661
+ "name": "status",
1662
+ "type": "text",
1663
+ "primaryKey": false,
1664
+ "notNull": true,
1665
+ "default": "'online'"
1666
+ },
1667
+ "last_heartbeat": {
1668
+ "name": "last_heartbeat",
1669
+ "type": "timestamp",
1670
+ "primaryKey": false,
1671
+ "notNull": false
1672
+ },
1673
+ "created_at": {
1674
+ "name": "created_at",
1675
+ "type": "timestamp",
1676
+ "primaryKey": false,
1677
+ "notNull": true,
1678
+ "default": "now()"
1679
+ },
1680
+ "updated_at": {
1681
+ "name": "updated_at",
1682
+ "type": "timestamp",
1683
+ "primaryKey": false,
1684
+ "notNull": true,
1685
+ "default": "now()"
1686
+ }
1687
+ },
1688
+ "indexes": {},
1689
+ "foreignKeys": {},
1690
+ "compositePrimaryKeys": {},
1691
+ "uniqueConstraints": {},
1692
+ "policies": {},
1693
+ "checkConstraints": {},
1694
+ "isRLSEnabled": false
1695
+ },
1696
+ "public.agent_session": {
1697
+ "name": "agent_session",
1698
+ "schema": "",
1699
+ "columns": {
1700
+ "id": {
1701
+ "name": "id",
1702
+ "type": "text",
1703
+ "primaryKey": true,
1704
+ "notNull": true
1705
+ },
1706
+ "tenant_id": {
1707
+ "name": "tenant_id",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": true
1711
+ },
1712
+ "agent_id": {
1713
+ "name": "agent_id",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true
1717
+ },
1718
+ "principal_id": {
1719
+ "name": "principal_id",
1720
+ "type": "text",
1721
+ "primaryKey": false,
1722
+ "notNull": true
1723
+ },
1724
+ "status": {
1725
+ "name": "status",
1726
+ "type": "text",
1727
+ "primaryKey": false,
1728
+ "notNull": true,
1729
+ "default": "'active'"
1730
+ },
1731
+ "created_at": {
1732
+ "name": "created_at",
1733
+ "type": "timestamp",
1734
+ "primaryKey": false,
1735
+ "notNull": true,
1736
+ "default": "now()"
1737
+ },
1738
+ "updated_at": {
1739
+ "name": "updated_at",
1740
+ "type": "timestamp",
1741
+ "primaryKey": false,
1742
+ "notNull": true,
1743
+ "default": "now()"
1744
+ },
1745
+ "ended_at": {
1746
+ "name": "ended_at",
1747
+ "type": "timestamp",
1748
+ "primaryKey": false,
1749
+ "notNull": false
1750
+ }
1751
+ },
1752
+ "indexes": {},
1753
+ "foreignKeys": {
1754
+ "agent_session_tenant_id_tenant_id_fk": {
1755
+ "name": "agent_session_tenant_id_tenant_id_fk",
1756
+ "tableFrom": "agent_session",
1757
+ "tableTo": "tenant",
1758
+ "columnsFrom": ["tenant_id"],
1759
+ "columnsTo": ["id"],
1760
+ "onDelete": "cascade",
1761
+ "onUpdate": "no action"
1762
+ },
1763
+ "agent_session_agent_id_agent_id_fk": {
1764
+ "name": "agent_session_agent_id_agent_id_fk",
1765
+ "tableFrom": "agent_session",
1766
+ "tableTo": "agent",
1767
+ "columnsFrom": ["agent_id"],
1768
+ "columnsTo": ["id"],
1769
+ "onDelete": "cascade",
1770
+ "onUpdate": "no action"
1771
+ },
1772
+ "agent_session_principal_id_principal_id_fk": {
1773
+ "name": "agent_session_principal_id_principal_id_fk",
1774
+ "tableFrom": "agent_session",
1775
+ "tableTo": "principal",
1776
+ "columnsFrom": ["principal_id"],
1777
+ "columnsTo": ["id"],
1778
+ "onDelete": "no action",
1779
+ "onUpdate": "no action"
1780
+ }
1781
+ },
1782
+ "compositePrimaryKeys": {},
1783
+ "uniqueConstraints": {},
1784
+ "policies": {},
1785
+ "checkConstraints": {},
1786
+ "isRLSEnabled": false
1787
+ },
1788
+ "public.agent_instance": {
1789
+ "name": "agent_instance",
1790
+ "schema": "",
1791
+ "columns": {
1792
+ "id": {
1793
+ "name": "id",
1794
+ "type": "text",
1795
+ "primaryKey": true,
1796
+ "notNull": true
1797
+ },
1798
+ "agent_id": {
1799
+ "name": "agent_id",
1800
+ "type": "text",
1801
+ "primaryKey": false,
1802
+ "notNull": true
1803
+ },
1804
+ "tenant_id": {
1805
+ "name": "tenant_id",
1806
+ "type": "text",
1807
+ "primaryKey": false,
1808
+ "notNull": true
1809
+ },
1810
+ "principal_id": {
1811
+ "name": "principal_id",
1812
+ "type": "text",
1813
+ "primaryKey": false,
1814
+ "notNull": true
1815
+ },
1816
+ "address": {
1817
+ "name": "address",
1818
+ "type": "text",
1819
+ "primaryKey": false,
1820
+ "notNull": true
1821
+ },
1822
+ "version_id": {
1823
+ "name": "version_id",
1824
+ "type": "text",
1825
+ "primaryKey": false,
1826
+ "notNull": false
1827
+ },
1828
+ "session_id": {
1829
+ "name": "session_id",
1830
+ "type": "text",
1831
+ "primaryKey": false,
1832
+ "notNull": false
1833
+ },
1834
+ "status": {
1835
+ "name": "status",
1836
+ "type": "text",
1837
+ "primaryKey": false,
1838
+ "notNull": true,
1839
+ "default": "'deployed'"
1840
+ },
1841
+ "sidecar_id": {
1842
+ "name": "sidecar_id",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": false
1846
+ },
1847
+ "public_key": {
1848
+ "name": "public_key",
1849
+ "type": "text",
1850
+ "primaryKey": false,
1851
+ "notNull": false
1852
+ },
1853
+ "kernel_id": {
1854
+ "name": "kernel_id",
1855
+ "type": "text",
1856
+ "primaryKey": false,
1857
+ "notNull": false
1858
+ },
1859
+ "created_at": {
1860
+ "name": "created_at",
1861
+ "type": "timestamp",
1862
+ "primaryKey": false,
1863
+ "notNull": true,
1864
+ "default": "now()"
1865
+ },
1866
+ "updated_at": {
1867
+ "name": "updated_at",
1868
+ "type": "timestamp",
1869
+ "primaryKey": false,
1870
+ "notNull": true,
1871
+ "default": "now()"
1872
+ },
1873
+ "ended_at": {
1874
+ "name": "ended_at",
1875
+ "type": "timestamp",
1876
+ "primaryKey": false,
1877
+ "notNull": false
1878
+ }
1879
+ },
1880
+ "indexes": {},
1881
+ "foreignKeys": {
1882
+ "agent_instance_agent_id_agent_id_fk": {
1883
+ "name": "agent_instance_agent_id_agent_id_fk",
1884
+ "tableFrom": "agent_instance",
1885
+ "tableTo": "agent",
1886
+ "columnsFrom": ["agent_id"],
1887
+ "columnsTo": ["id"],
1888
+ "onDelete": "cascade",
1889
+ "onUpdate": "no action"
1890
+ },
1891
+ "agent_instance_tenant_id_tenant_id_fk": {
1892
+ "name": "agent_instance_tenant_id_tenant_id_fk",
1893
+ "tableFrom": "agent_instance",
1894
+ "tableTo": "tenant",
1895
+ "columnsFrom": ["tenant_id"],
1896
+ "columnsTo": ["id"],
1897
+ "onDelete": "cascade",
1898
+ "onUpdate": "no action"
1899
+ },
1900
+ "agent_instance_principal_id_principal_id_fk": {
1901
+ "name": "agent_instance_principal_id_principal_id_fk",
1902
+ "tableFrom": "agent_instance",
1903
+ "tableTo": "principal",
1904
+ "columnsFrom": ["principal_id"],
1905
+ "columnsTo": ["id"],
1906
+ "onDelete": "no action",
1907
+ "onUpdate": "no action"
1908
+ },
1909
+ "agent_instance_version_id_agent_version_id_fk": {
1910
+ "name": "agent_instance_version_id_agent_version_id_fk",
1911
+ "tableFrom": "agent_instance",
1912
+ "tableTo": "agent_version",
1913
+ "columnsFrom": ["version_id"],
1914
+ "columnsTo": ["id"],
1915
+ "onDelete": "no action",
1916
+ "onUpdate": "no action"
1917
+ },
1918
+ "agent_instance_session_id_agent_session_id_fk": {
1919
+ "name": "agent_instance_session_id_agent_session_id_fk",
1920
+ "tableFrom": "agent_instance",
1921
+ "tableTo": "agent_session",
1922
+ "columnsFrom": ["session_id"],
1923
+ "columnsTo": ["id"],
1924
+ "onDelete": "no action",
1925
+ "onUpdate": "no action"
1926
+ },
1927
+ "agent_instance_sidecar_id_sidecar_id_fk": {
1928
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
1929
+ "tableFrom": "agent_instance",
1930
+ "tableTo": "sidecar",
1931
+ "columnsFrom": ["sidecar_id"],
1932
+ "columnsTo": ["id"],
1933
+ "onDelete": "set null",
1934
+ "onUpdate": "no action"
1935
+ }
1936
+ },
1937
+ "compositePrimaryKeys": {},
1938
+ "uniqueConstraints": {
1939
+ "agent_instance_address_unique": {
1940
+ "name": "agent_instance_address_unique",
1941
+ "nullsNotDistinct": false,
1942
+ "columns": ["address"]
1943
+ }
1944
+ },
1945
+ "policies": {},
1946
+ "checkConstraints": {},
1947
+ "isRLSEnabled": false
1948
+ },
1949
+ "public.inference_turn": {
1950
+ "name": "inference_turn",
1951
+ "schema": "",
1952
+ "columns": {
1953
+ "id": {
1954
+ "name": "id",
1955
+ "type": "text",
1956
+ "primaryKey": true,
1957
+ "notNull": true
1958
+ },
1959
+ "session_id": {
1960
+ "name": "session_id",
1961
+ "type": "text",
1962
+ "primaryKey": false,
1963
+ "notNull": true
1964
+ },
1965
+ "instance_id": {
1966
+ "name": "instance_id",
1967
+ "type": "text",
1968
+ "primaryKey": false,
1969
+ "notNull": true
1970
+ },
1971
+ "tenant_id": {
1972
+ "name": "tenant_id",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": true
1976
+ },
1977
+ "model": {
1978
+ "name": "model",
1979
+ "type": "text",
1980
+ "primaryKey": false,
1981
+ "notNull": true
1982
+ },
1983
+ "status": {
1984
+ "name": "status",
1985
+ "type": "text",
1986
+ "primaryKey": false,
1987
+ "notNull": true,
1988
+ "default": "'running'"
1989
+ },
1990
+ "started_at": {
1991
+ "name": "started_at",
1992
+ "type": "timestamp",
1993
+ "primaryKey": false,
1994
+ "notNull": true
1995
+ },
1996
+ "ended_at": {
1997
+ "name": "ended_at",
1998
+ "type": "timestamp",
1999
+ "primaryKey": false,
2000
+ "notNull": false
2001
+ }
2002
+ },
2003
+ "indexes": {
2004
+ "inference_turn_instance_id_started_at_idx": {
2005
+ "name": "inference_turn_instance_id_started_at_idx",
2006
+ "columns": [
2007
+ {
2008
+ "expression": "instance_id",
2009
+ "isExpression": false,
2010
+ "asc": true,
2011
+ "nulls": "last"
2012
+ },
2013
+ {
2014
+ "expression": "started_at",
2015
+ "isExpression": false,
2016
+ "asc": true,
2017
+ "nulls": "last"
2018
+ }
2019
+ ],
2020
+ "isUnique": false,
2021
+ "concurrently": false,
2022
+ "method": "btree",
2023
+ "with": {}
2024
+ }
2025
+ },
2026
+ "foreignKeys": {
2027
+ "inference_turn_session_id_agent_session_id_fk": {
2028
+ "name": "inference_turn_session_id_agent_session_id_fk",
2029
+ "tableFrom": "inference_turn",
2030
+ "tableTo": "agent_session",
2031
+ "columnsFrom": ["session_id"],
2032
+ "columnsTo": ["id"],
2033
+ "onDelete": "cascade",
2034
+ "onUpdate": "no action"
2035
+ },
2036
+ "inference_turn_instance_id_agent_instance_id_fk": {
2037
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2038
+ "tableFrom": "inference_turn",
2039
+ "tableTo": "agent_instance",
2040
+ "columnsFrom": ["instance_id"],
2041
+ "columnsTo": ["id"],
2042
+ "onDelete": "cascade",
2043
+ "onUpdate": "no action"
2044
+ },
2045
+ "inference_turn_tenant_id_tenant_id_fk": {
2046
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2047
+ "tableFrom": "inference_turn",
2048
+ "tableTo": "tenant",
2049
+ "columnsFrom": ["tenant_id"],
2050
+ "columnsTo": ["id"],
2051
+ "onDelete": "cascade",
2052
+ "onUpdate": "no action"
2053
+ }
2054
+ },
2055
+ "compositePrimaryKeys": {},
2056
+ "uniqueConstraints": {},
2057
+ "policies": {},
2058
+ "checkConstraints": {},
2059
+ "isRLSEnabled": false
2060
+ },
2061
+ "public.session_mail": {
2062
+ "name": "session_mail",
2063
+ "schema": "",
2064
+ "columns": {
2065
+ "id": {
2066
+ "name": "id",
2067
+ "type": "text",
2068
+ "primaryKey": true,
2069
+ "notNull": true
2070
+ },
2071
+ "session_id": {
2072
+ "name": "session_id",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": true
2076
+ },
2077
+ "instance_id": {
2078
+ "name": "instance_id",
2079
+ "type": "text",
2080
+ "primaryKey": false,
2081
+ "notNull": false
2082
+ },
2083
+ "tenant_id": {
2084
+ "name": "tenant_id",
2085
+ "type": "text",
2086
+ "primaryKey": false,
2087
+ "notNull": true
2088
+ },
2089
+ "direction": {
2090
+ "name": "direction",
2091
+ "type": "text",
2092
+ "primaryKey": false,
2093
+ "notNull": true
2094
+ },
2095
+ "status": {
2096
+ "name": "status",
2097
+ "type": "text",
2098
+ "primaryKey": false,
2099
+ "notNull": true,
2100
+ "default": "'pending'"
2101
+ },
2102
+ "raw": {
2103
+ "name": "raw",
2104
+ "type": "bytea",
2105
+ "primaryKey": false,
2106
+ "notNull": true
2107
+ },
2108
+ "created_at": {
2109
+ "name": "created_at",
2110
+ "type": "timestamp",
2111
+ "primaryKey": false,
2112
+ "notNull": true,
2113
+ "default": "now()"
2114
+ }
2115
+ },
2116
+ "indexes": {
2117
+ "session_mail_instance_id_created_at_idx": {
2118
+ "name": "session_mail_instance_id_created_at_idx",
2119
+ "columns": [
2120
+ {
2121
+ "expression": "instance_id",
2122
+ "isExpression": false,
2123
+ "asc": true,
2124
+ "nulls": "last"
2125
+ },
2126
+ {
2127
+ "expression": "created_at",
2128
+ "isExpression": false,
2129
+ "asc": true,
2130
+ "nulls": "last"
2131
+ }
2132
+ ],
2133
+ "isUnique": false,
2134
+ "concurrently": false,
2135
+ "method": "btree",
2136
+ "with": {}
2137
+ }
2138
+ },
2139
+ "foreignKeys": {
2140
+ "session_mail_session_id_agent_session_id_fk": {
2141
+ "name": "session_mail_session_id_agent_session_id_fk",
2142
+ "tableFrom": "session_mail",
2143
+ "tableTo": "agent_session",
2144
+ "columnsFrom": ["session_id"],
2145
+ "columnsTo": ["id"],
2146
+ "onDelete": "cascade",
2147
+ "onUpdate": "no action"
2148
+ },
2149
+ "session_mail_instance_id_agent_instance_id_fk": {
2150
+ "name": "session_mail_instance_id_agent_instance_id_fk",
2151
+ "tableFrom": "session_mail",
2152
+ "tableTo": "agent_instance",
2153
+ "columnsFrom": ["instance_id"],
2154
+ "columnsTo": ["id"],
2155
+ "onDelete": "set null",
2156
+ "onUpdate": "no action"
2157
+ },
2158
+ "session_mail_tenant_id_tenant_id_fk": {
2159
+ "name": "session_mail_tenant_id_tenant_id_fk",
2160
+ "tableFrom": "session_mail",
2161
+ "tableTo": "tenant",
2162
+ "columnsFrom": ["tenant_id"],
2163
+ "columnsTo": ["id"],
2164
+ "onDelete": "cascade",
2165
+ "onUpdate": "no action"
2166
+ }
2167
+ },
2168
+ "compositePrimaryKeys": {},
2169
+ "uniqueConstraints": {},
2170
+ "policies": {},
2171
+ "checkConstraints": {},
2172
+ "isRLSEnabled": false
2173
+ },
2174
+ "public.turn_part": {
2175
+ "name": "turn_part",
2176
+ "schema": "",
2177
+ "columns": {
2178
+ "id": {
2179
+ "name": "id",
2180
+ "type": "text",
2181
+ "primaryKey": true,
2182
+ "notNull": true
2183
+ },
2184
+ "turn_id": {
2185
+ "name": "turn_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": true
2189
+ },
2190
+ "session_id": {
2191
+ "name": "session_id",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": true
2195
+ },
2196
+ "type": {
2197
+ "name": "type",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": true
2201
+ },
2202
+ "content": {
2203
+ "name": "content",
2204
+ "type": "text",
2205
+ "primaryKey": false,
2206
+ "notNull": false
2207
+ },
2208
+ "metadata": {
2209
+ "name": "metadata",
2210
+ "type": "jsonb",
2211
+ "primaryKey": false,
2212
+ "notNull": false
2213
+ },
2214
+ "ordinal": {
2215
+ "name": "ordinal",
2216
+ "type": "integer",
2217
+ "primaryKey": false,
2218
+ "notNull": true
2219
+ }
2220
+ },
2221
+ "indexes": {},
2222
+ "foreignKeys": {
2223
+ "turn_part_turn_id_inference_turn_id_fk": {
2224
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2225
+ "tableFrom": "turn_part",
2226
+ "tableTo": "inference_turn",
2227
+ "columnsFrom": ["turn_id"],
2228
+ "columnsTo": ["id"],
2229
+ "onDelete": "cascade",
2230
+ "onUpdate": "no action"
2231
+ },
2232
+ "turn_part_session_id_agent_session_id_fk": {
2233
+ "name": "turn_part_session_id_agent_session_id_fk",
2234
+ "tableFrom": "turn_part",
2235
+ "tableTo": "agent_session",
2236
+ "columnsFrom": ["session_id"],
2237
+ "columnsTo": ["id"],
2238
+ "onDelete": "cascade",
2239
+ "onUpdate": "no action"
2240
+ }
2241
+ },
2242
+ "compositePrimaryKeys": {},
2243
+ "uniqueConstraints": {},
2244
+ "policies": {},
2245
+ "checkConstraints": {},
2246
+ "isRLSEnabled": false
2247
+ }
2248
+ },
2249
+ "enums": {},
2250
+ "schemas": {},
2251
+ "sequences": {},
2252
+ "roles": {},
2253
+ "policies": {},
2254
+ "views": {},
2255
+ "_meta": {
2256
+ "columns": {},
2257
+ "schemas": {},
2258
+ "tables": {}
2259
+ }
2260
+ }