@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,2254 @@
1
+ {
2
+ "id": "35afd034-b48a-4596-96bb-aeae56ca0d18",
3
+ "prevId": "4e954dae-4184-4959-9436-2952eaedc787",
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
+ "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.transaction": {
1371
+ "name": "transaction",
1372
+ "schema": "",
1373
+ "columns": {
1374
+ "id": {
1375
+ "name": "id",
1376
+ "type": "text",
1377
+ "primaryKey": true,
1378
+ "notNull": true
1379
+ },
1380
+ "wallet_id": {
1381
+ "name": "wallet_id",
1382
+ "type": "text",
1383
+ "primaryKey": false,
1384
+ "notNull": true
1385
+ },
1386
+ "agent_id": {
1387
+ "name": "agent_id",
1388
+ "type": "text",
1389
+ "primaryKey": false,
1390
+ "notNull": false
1391
+ },
1392
+ "direction": {
1393
+ "name": "direction",
1394
+ "type": "text",
1395
+ "primaryKey": false,
1396
+ "notNull": true
1397
+ },
1398
+ "amount": {
1399
+ "name": "amount",
1400
+ "type": "text",
1401
+ "primaryKey": false,
1402
+ "notNull": true
1403
+ },
1404
+ "currency": {
1405
+ "name": "currency",
1406
+ "type": "text",
1407
+ "primaryKey": false,
1408
+ "notNull": true
1409
+ },
1410
+ "recipient_id": {
1411
+ "name": "recipient_id",
1412
+ "type": "text",
1413
+ "primaryKey": false,
1414
+ "notNull": false
1415
+ },
1416
+ "sender_id": {
1417
+ "name": "sender_id",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": false
1421
+ },
1422
+ "request_id": {
1423
+ "name": "request_id",
1424
+ "type": "text",
1425
+ "primaryKey": false,
1426
+ "notNull": false
1427
+ },
1428
+ "status": {
1429
+ "name": "status",
1430
+ "type": "text",
1431
+ "primaryKey": false,
1432
+ "notNull": true,
1433
+ "default": "'pending'"
1434
+ },
1435
+ "created_at": {
1436
+ "name": "created_at",
1437
+ "type": "timestamp",
1438
+ "primaryKey": false,
1439
+ "notNull": true,
1440
+ "default": "now()"
1441
+ }
1442
+ },
1443
+ "indexes": {},
1444
+ "foreignKeys": {
1445
+ "transaction_wallet_id_wallet_id_fk": {
1446
+ "name": "transaction_wallet_id_wallet_id_fk",
1447
+ "tableFrom": "transaction",
1448
+ "tableTo": "wallet",
1449
+ "columnsFrom": ["wallet_id"],
1450
+ "columnsTo": ["id"],
1451
+ "onDelete": "cascade",
1452
+ "onUpdate": "no action"
1453
+ },
1454
+ "transaction_agent_id_agent_id_fk": {
1455
+ "name": "transaction_agent_id_agent_id_fk",
1456
+ "tableFrom": "transaction",
1457
+ "tableTo": "agent",
1458
+ "columnsFrom": ["agent_id"],
1459
+ "columnsTo": ["id"],
1460
+ "onDelete": "set null",
1461
+ "onUpdate": "no action"
1462
+ }
1463
+ },
1464
+ "compositePrimaryKeys": {},
1465
+ "uniqueConstraints": {},
1466
+ "policies": {},
1467
+ "checkConstraints": {},
1468
+ "isRLSEnabled": false
1469
+ },
1470
+ "public.wallet": {
1471
+ "name": "wallet",
1472
+ "schema": "",
1473
+ "columns": {
1474
+ "id": {
1475
+ "name": "id",
1476
+ "type": "text",
1477
+ "primaryKey": true,
1478
+ "notNull": true
1479
+ },
1480
+ "tenant_id": {
1481
+ "name": "tenant_id",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": true
1485
+ },
1486
+ "name": {
1487
+ "name": "name",
1488
+ "type": "text",
1489
+ "primaryKey": false,
1490
+ "notNull": true
1491
+ },
1492
+ "backend_type": {
1493
+ "name": "backend_type",
1494
+ "type": "text",
1495
+ "primaryKey": false,
1496
+ "notNull": true
1497
+ },
1498
+ "currency": {
1499
+ "name": "currency",
1500
+ "type": "text",
1501
+ "primaryKey": false,
1502
+ "notNull": true
1503
+ },
1504
+ "balance": {
1505
+ "name": "balance",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "default": "'0'"
1510
+ },
1511
+ "config": {
1512
+ "name": "config",
1513
+ "type": "jsonb",
1514
+ "primaryKey": false,
1515
+ "notNull": false
1516
+ },
1517
+ "created_at": {
1518
+ "name": "created_at",
1519
+ "type": "timestamp",
1520
+ "primaryKey": false,
1521
+ "notNull": true,
1522
+ "default": "now()"
1523
+ },
1524
+ "updated_at": {
1525
+ "name": "updated_at",
1526
+ "type": "timestamp",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "default": "now()"
1530
+ }
1531
+ },
1532
+ "indexes": {},
1533
+ "foreignKeys": {
1534
+ "wallet_tenant_id_tenant_id_fk": {
1535
+ "name": "wallet_tenant_id_tenant_id_fk",
1536
+ "tableFrom": "wallet",
1537
+ "tableTo": "tenant",
1538
+ "columnsFrom": ["tenant_id"],
1539
+ "columnsTo": ["id"],
1540
+ "onDelete": "cascade",
1541
+ "onUpdate": "no action"
1542
+ }
1543
+ },
1544
+ "compositePrimaryKeys": {},
1545
+ "uniqueConstraints": {},
1546
+ "policies": {},
1547
+ "checkConstraints": {},
1548
+ "isRLSEnabled": false
1549
+ },
1550
+ "public.offering": {
1551
+ "name": "offering",
1552
+ "schema": "",
1553
+ "columns": {
1554
+ "id": {
1555
+ "name": "id",
1556
+ "type": "text",
1557
+ "primaryKey": true,
1558
+ "notNull": true
1559
+ },
1560
+ "agent_id": {
1561
+ "name": "agent_id",
1562
+ "type": "text",
1563
+ "primaryKey": false,
1564
+ "notNull": true
1565
+ },
1566
+ "tenant_id": {
1567
+ "name": "tenant_id",
1568
+ "type": "text",
1569
+ "primaryKey": false,
1570
+ "notNull": true
1571
+ },
1572
+ "name": {
1573
+ "name": "name",
1574
+ "type": "text",
1575
+ "primaryKey": false,
1576
+ "notNull": true
1577
+ },
1578
+ "description": {
1579
+ "name": "description",
1580
+ "type": "text",
1581
+ "primaryKey": false,
1582
+ "notNull": false
1583
+ },
1584
+ "pricing": {
1585
+ "name": "pricing",
1586
+ "type": "jsonb",
1587
+ "primaryKey": false,
1588
+ "notNull": false
1589
+ },
1590
+ "schema": {
1591
+ "name": "schema",
1592
+ "type": "jsonb",
1593
+ "primaryKey": false,
1594
+ "notNull": false
1595
+ },
1596
+ "created_at": {
1597
+ "name": "created_at",
1598
+ "type": "timestamp",
1599
+ "primaryKey": false,
1600
+ "notNull": true,
1601
+ "default": "now()"
1602
+ },
1603
+ "updated_at": {
1604
+ "name": "updated_at",
1605
+ "type": "timestamp",
1606
+ "primaryKey": false,
1607
+ "notNull": true,
1608
+ "default": "now()"
1609
+ }
1610
+ },
1611
+ "indexes": {},
1612
+ "foreignKeys": {
1613
+ "offering_agent_id_agent_id_fk": {
1614
+ "name": "offering_agent_id_agent_id_fk",
1615
+ "tableFrom": "offering",
1616
+ "tableTo": "agent",
1617
+ "columnsFrom": ["agent_id"],
1618
+ "columnsTo": ["id"],
1619
+ "onDelete": "cascade",
1620
+ "onUpdate": "no action"
1621
+ },
1622
+ "offering_tenant_id_tenant_id_fk": {
1623
+ "name": "offering_tenant_id_tenant_id_fk",
1624
+ "tableFrom": "offering",
1625
+ "tableTo": "tenant",
1626
+ "columnsFrom": ["tenant_id"],
1627
+ "columnsTo": ["id"],
1628
+ "onDelete": "cascade",
1629
+ "onUpdate": "no action"
1630
+ }
1631
+ },
1632
+ "compositePrimaryKeys": {},
1633
+ "uniqueConstraints": {},
1634
+ "policies": {},
1635
+ "checkConstraints": {},
1636
+ "isRLSEnabled": false
1637
+ },
1638
+ "public.sidecar": {
1639
+ "name": "sidecar",
1640
+ "schema": "",
1641
+ "columns": {
1642
+ "id": {
1643
+ "name": "id",
1644
+ "type": "text",
1645
+ "primaryKey": true,
1646
+ "notNull": true
1647
+ },
1648
+ "url": {
1649
+ "name": "url",
1650
+ "type": "text",
1651
+ "primaryKey": false,
1652
+ "notNull": true
1653
+ },
1654
+ "status": {
1655
+ "name": "status",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": true,
1659
+ "default": "'online'"
1660
+ },
1661
+ "last_heartbeat": {
1662
+ "name": "last_heartbeat",
1663
+ "type": "timestamp",
1664
+ "primaryKey": false,
1665
+ "notNull": false
1666
+ },
1667
+ "created_at": {
1668
+ "name": "created_at",
1669
+ "type": "timestamp",
1670
+ "primaryKey": false,
1671
+ "notNull": true,
1672
+ "default": "now()"
1673
+ },
1674
+ "updated_at": {
1675
+ "name": "updated_at",
1676
+ "type": "timestamp",
1677
+ "primaryKey": false,
1678
+ "notNull": true,
1679
+ "default": "now()"
1680
+ }
1681
+ },
1682
+ "indexes": {},
1683
+ "foreignKeys": {},
1684
+ "compositePrimaryKeys": {},
1685
+ "uniqueConstraints": {},
1686
+ "policies": {},
1687
+ "checkConstraints": {},
1688
+ "isRLSEnabled": false
1689
+ },
1690
+ "public.agent_session": {
1691
+ "name": "agent_session",
1692
+ "schema": "",
1693
+ "columns": {
1694
+ "id": {
1695
+ "name": "id",
1696
+ "type": "text",
1697
+ "primaryKey": true,
1698
+ "notNull": true
1699
+ },
1700
+ "tenant_id": {
1701
+ "name": "tenant_id",
1702
+ "type": "text",
1703
+ "primaryKey": false,
1704
+ "notNull": true
1705
+ },
1706
+ "agent_id": {
1707
+ "name": "agent_id",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": true
1711
+ },
1712
+ "principal_id": {
1713
+ "name": "principal_id",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true
1717
+ },
1718
+ "status": {
1719
+ "name": "status",
1720
+ "type": "text",
1721
+ "primaryKey": false,
1722
+ "notNull": true,
1723
+ "default": "'active'"
1724
+ },
1725
+ "created_at": {
1726
+ "name": "created_at",
1727
+ "type": "timestamp",
1728
+ "primaryKey": false,
1729
+ "notNull": true,
1730
+ "default": "now()"
1731
+ },
1732
+ "updated_at": {
1733
+ "name": "updated_at",
1734
+ "type": "timestamp",
1735
+ "primaryKey": false,
1736
+ "notNull": true,
1737
+ "default": "now()"
1738
+ },
1739
+ "ended_at": {
1740
+ "name": "ended_at",
1741
+ "type": "timestamp",
1742
+ "primaryKey": false,
1743
+ "notNull": false
1744
+ }
1745
+ },
1746
+ "indexes": {},
1747
+ "foreignKeys": {
1748
+ "agent_session_tenant_id_tenant_id_fk": {
1749
+ "name": "agent_session_tenant_id_tenant_id_fk",
1750
+ "tableFrom": "agent_session",
1751
+ "tableTo": "tenant",
1752
+ "columnsFrom": ["tenant_id"],
1753
+ "columnsTo": ["id"],
1754
+ "onDelete": "cascade",
1755
+ "onUpdate": "no action"
1756
+ },
1757
+ "agent_session_agent_id_agent_id_fk": {
1758
+ "name": "agent_session_agent_id_agent_id_fk",
1759
+ "tableFrom": "agent_session",
1760
+ "tableTo": "agent",
1761
+ "columnsFrom": ["agent_id"],
1762
+ "columnsTo": ["id"],
1763
+ "onDelete": "cascade",
1764
+ "onUpdate": "no action"
1765
+ },
1766
+ "agent_session_principal_id_principal_id_fk": {
1767
+ "name": "agent_session_principal_id_principal_id_fk",
1768
+ "tableFrom": "agent_session",
1769
+ "tableTo": "principal",
1770
+ "columnsFrom": ["principal_id"],
1771
+ "columnsTo": ["id"],
1772
+ "onDelete": "no action",
1773
+ "onUpdate": "no action"
1774
+ }
1775
+ },
1776
+ "compositePrimaryKeys": {},
1777
+ "uniqueConstraints": {},
1778
+ "policies": {},
1779
+ "checkConstraints": {},
1780
+ "isRLSEnabled": false
1781
+ },
1782
+ "public.agent_instance": {
1783
+ "name": "agent_instance",
1784
+ "schema": "",
1785
+ "columns": {
1786
+ "id": {
1787
+ "name": "id",
1788
+ "type": "text",
1789
+ "primaryKey": true,
1790
+ "notNull": true
1791
+ },
1792
+ "agent_id": {
1793
+ "name": "agent_id",
1794
+ "type": "text",
1795
+ "primaryKey": false,
1796
+ "notNull": true
1797
+ },
1798
+ "tenant_id": {
1799
+ "name": "tenant_id",
1800
+ "type": "text",
1801
+ "primaryKey": false,
1802
+ "notNull": true
1803
+ },
1804
+ "principal_id": {
1805
+ "name": "principal_id",
1806
+ "type": "text",
1807
+ "primaryKey": false,
1808
+ "notNull": true
1809
+ },
1810
+ "address": {
1811
+ "name": "address",
1812
+ "type": "text",
1813
+ "primaryKey": false,
1814
+ "notNull": true
1815
+ },
1816
+ "version_id": {
1817
+ "name": "version_id",
1818
+ "type": "text",
1819
+ "primaryKey": false,
1820
+ "notNull": false
1821
+ },
1822
+ "session_id": {
1823
+ "name": "session_id",
1824
+ "type": "text",
1825
+ "primaryKey": false,
1826
+ "notNull": false
1827
+ },
1828
+ "status": {
1829
+ "name": "status",
1830
+ "type": "text",
1831
+ "primaryKey": false,
1832
+ "notNull": true,
1833
+ "default": "'deployed'"
1834
+ },
1835
+ "sidecar_id": {
1836
+ "name": "sidecar_id",
1837
+ "type": "text",
1838
+ "primaryKey": false,
1839
+ "notNull": false
1840
+ },
1841
+ "public_key": {
1842
+ "name": "public_key",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": false
1846
+ },
1847
+ "kernel_id": {
1848
+ "name": "kernel_id",
1849
+ "type": "text",
1850
+ "primaryKey": false,
1851
+ "notNull": false
1852
+ },
1853
+ "created_at": {
1854
+ "name": "created_at",
1855
+ "type": "timestamp",
1856
+ "primaryKey": false,
1857
+ "notNull": true,
1858
+ "default": "now()"
1859
+ },
1860
+ "updated_at": {
1861
+ "name": "updated_at",
1862
+ "type": "timestamp",
1863
+ "primaryKey": false,
1864
+ "notNull": true,
1865
+ "default": "now()"
1866
+ },
1867
+ "ended_at": {
1868
+ "name": "ended_at",
1869
+ "type": "timestamp",
1870
+ "primaryKey": false,
1871
+ "notNull": false
1872
+ }
1873
+ },
1874
+ "indexes": {},
1875
+ "foreignKeys": {
1876
+ "agent_instance_agent_id_agent_id_fk": {
1877
+ "name": "agent_instance_agent_id_agent_id_fk",
1878
+ "tableFrom": "agent_instance",
1879
+ "tableTo": "agent",
1880
+ "columnsFrom": ["agent_id"],
1881
+ "columnsTo": ["id"],
1882
+ "onDelete": "cascade",
1883
+ "onUpdate": "no action"
1884
+ },
1885
+ "agent_instance_tenant_id_tenant_id_fk": {
1886
+ "name": "agent_instance_tenant_id_tenant_id_fk",
1887
+ "tableFrom": "agent_instance",
1888
+ "tableTo": "tenant",
1889
+ "columnsFrom": ["tenant_id"],
1890
+ "columnsTo": ["id"],
1891
+ "onDelete": "cascade",
1892
+ "onUpdate": "no action"
1893
+ },
1894
+ "agent_instance_principal_id_principal_id_fk": {
1895
+ "name": "agent_instance_principal_id_principal_id_fk",
1896
+ "tableFrom": "agent_instance",
1897
+ "tableTo": "principal",
1898
+ "columnsFrom": ["principal_id"],
1899
+ "columnsTo": ["id"],
1900
+ "onDelete": "no action",
1901
+ "onUpdate": "no action"
1902
+ },
1903
+ "agent_instance_version_id_agent_version_id_fk": {
1904
+ "name": "agent_instance_version_id_agent_version_id_fk",
1905
+ "tableFrom": "agent_instance",
1906
+ "tableTo": "agent_version",
1907
+ "columnsFrom": ["version_id"],
1908
+ "columnsTo": ["id"],
1909
+ "onDelete": "no action",
1910
+ "onUpdate": "no action"
1911
+ },
1912
+ "agent_instance_session_id_agent_session_id_fk": {
1913
+ "name": "agent_instance_session_id_agent_session_id_fk",
1914
+ "tableFrom": "agent_instance",
1915
+ "tableTo": "agent_session",
1916
+ "columnsFrom": ["session_id"],
1917
+ "columnsTo": ["id"],
1918
+ "onDelete": "no action",
1919
+ "onUpdate": "no action"
1920
+ },
1921
+ "agent_instance_sidecar_id_sidecar_id_fk": {
1922
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
1923
+ "tableFrom": "agent_instance",
1924
+ "tableTo": "sidecar",
1925
+ "columnsFrom": ["sidecar_id"],
1926
+ "columnsTo": ["id"],
1927
+ "onDelete": "set null",
1928
+ "onUpdate": "no action"
1929
+ }
1930
+ },
1931
+ "compositePrimaryKeys": {},
1932
+ "uniqueConstraints": {
1933
+ "agent_instance_address_unique": {
1934
+ "name": "agent_instance_address_unique",
1935
+ "nullsNotDistinct": false,
1936
+ "columns": ["address"]
1937
+ }
1938
+ },
1939
+ "policies": {},
1940
+ "checkConstraints": {},
1941
+ "isRLSEnabled": false
1942
+ },
1943
+ "public.inference_turn": {
1944
+ "name": "inference_turn",
1945
+ "schema": "",
1946
+ "columns": {
1947
+ "id": {
1948
+ "name": "id",
1949
+ "type": "text",
1950
+ "primaryKey": true,
1951
+ "notNull": true
1952
+ },
1953
+ "session_id": {
1954
+ "name": "session_id",
1955
+ "type": "text",
1956
+ "primaryKey": false,
1957
+ "notNull": true
1958
+ },
1959
+ "instance_id": {
1960
+ "name": "instance_id",
1961
+ "type": "text",
1962
+ "primaryKey": false,
1963
+ "notNull": true
1964
+ },
1965
+ "tenant_id": {
1966
+ "name": "tenant_id",
1967
+ "type": "text",
1968
+ "primaryKey": false,
1969
+ "notNull": true
1970
+ },
1971
+ "model": {
1972
+ "name": "model",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": true
1976
+ },
1977
+ "status": {
1978
+ "name": "status",
1979
+ "type": "text",
1980
+ "primaryKey": false,
1981
+ "notNull": true,
1982
+ "default": "'running'"
1983
+ },
1984
+ "started_at": {
1985
+ "name": "started_at",
1986
+ "type": "timestamp",
1987
+ "primaryKey": false,
1988
+ "notNull": true
1989
+ },
1990
+ "ended_at": {
1991
+ "name": "ended_at",
1992
+ "type": "timestamp",
1993
+ "primaryKey": false,
1994
+ "notNull": false
1995
+ }
1996
+ },
1997
+ "indexes": {
1998
+ "inference_turn_instance_id_started_at_idx": {
1999
+ "name": "inference_turn_instance_id_started_at_idx",
2000
+ "columns": [
2001
+ {
2002
+ "expression": "instance_id",
2003
+ "isExpression": false,
2004
+ "asc": true,
2005
+ "nulls": "last"
2006
+ },
2007
+ {
2008
+ "expression": "started_at",
2009
+ "isExpression": false,
2010
+ "asc": true,
2011
+ "nulls": "last"
2012
+ }
2013
+ ],
2014
+ "isUnique": false,
2015
+ "concurrently": false,
2016
+ "method": "btree",
2017
+ "with": {}
2018
+ }
2019
+ },
2020
+ "foreignKeys": {
2021
+ "inference_turn_session_id_agent_session_id_fk": {
2022
+ "name": "inference_turn_session_id_agent_session_id_fk",
2023
+ "tableFrom": "inference_turn",
2024
+ "tableTo": "agent_session",
2025
+ "columnsFrom": ["session_id"],
2026
+ "columnsTo": ["id"],
2027
+ "onDelete": "cascade",
2028
+ "onUpdate": "no action"
2029
+ },
2030
+ "inference_turn_instance_id_agent_instance_id_fk": {
2031
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2032
+ "tableFrom": "inference_turn",
2033
+ "tableTo": "agent_instance",
2034
+ "columnsFrom": ["instance_id"],
2035
+ "columnsTo": ["id"],
2036
+ "onDelete": "cascade",
2037
+ "onUpdate": "no action"
2038
+ },
2039
+ "inference_turn_tenant_id_tenant_id_fk": {
2040
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2041
+ "tableFrom": "inference_turn",
2042
+ "tableTo": "tenant",
2043
+ "columnsFrom": ["tenant_id"],
2044
+ "columnsTo": ["id"],
2045
+ "onDelete": "cascade",
2046
+ "onUpdate": "no action"
2047
+ }
2048
+ },
2049
+ "compositePrimaryKeys": {},
2050
+ "uniqueConstraints": {},
2051
+ "policies": {},
2052
+ "checkConstraints": {},
2053
+ "isRLSEnabled": false
2054
+ },
2055
+ "public.session_mail": {
2056
+ "name": "session_mail",
2057
+ "schema": "",
2058
+ "columns": {
2059
+ "id": {
2060
+ "name": "id",
2061
+ "type": "text",
2062
+ "primaryKey": true,
2063
+ "notNull": true
2064
+ },
2065
+ "session_id": {
2066
+ "name": "session_id",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": true
2070
+ },
2071
+ "instance_id": {
2072
+ "name": "instance_id",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "tenant_id": {
2078
+ "name": "tenant_id",
2079
+ "type": "text",
2080
+ "primaryKey": false,
2081
+ "notNull": true
2082
+ },
2083
+ "direction": {
2084
+ "name": "direction",
2085
+ "type": "text",
2086
+ "primaryKey": false,
2087
+ "notNull": true
2088
+ },
2089
+ "status": {
2090
+ "name": "status",
2091
+ "type": "text",
2092
+ "primaryKey": false,
2093
+ "notNull": true,
2094
+ "default": "'pending'"
2095
+ },
2096
+ "raw": {
2097
+ "name": "raw",
2098
+ "type": "bytea",
2099
+ "primaryKey": false,
2100
+ "notNull": true
2101
+ },
2102
+ "created_at": {
2103
+ "name": "created_at",
2104
+ "type": "timestamp",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "default": "now()"
2108
+ }
2109
+ },
2110
+ "indexes": {
2111
+ "session_mail_instance_id_created_at_idx": {
2112
+ "name": "session_mail_instance_id_created_at_idx",
2113
+ "columns": [
2114
+ {
2115
+ "expression": "instance_id",
2116
+ "isExpression": false,
2117
+ "asc": true,
2118
+ "nulls": "last"
2119
+ },
2120
+ {
2121
+ "expression": "created_at",
2122
+ "isExpression": false,
2123
+ "asc": true,
2124
+ "nulls": "last"
2125
+ }
2126
+ ],
2127
+ "isUnique": false,
2128
+ "concurrently": false,
2129
+ "method": "btree",
2130
+ "with": {}
2131
+ }
2132
+ },
2133
+ "foreignKeys": {
2134
+ "session_mail_session_id_agent_session_id_fk": {
2135
+ "name": "session_mail_session_id_agent_session_id_fk",
2136
+ "tableFrom": "session_mail",
2137
+ "tableTo": "agent_session",
2138
+ "columnsFrom": ["session_id"],
2139
+ "columnsTo": ["id"],
2140
+ "onDelete": "cascade",
2141
+ "onUpdate": "no action"
2142
+ },
2143
+ "session_mail_instance_id_agent_instance_id_fk": {
2144
+ "name": "session_mail_instance_id_agent_instance_id_fk",
2145
+ "tableFrom": "session_mail",
2146
+ "tableTo": "agent_instance",
2147
+ "columnsFrom": ["instance_id"],
2148
+ "columnsTo": ["id"],
2149
+ "onDelete": "set null",
2150
+ "onUpdate": "no action"
2151
+ },
2152
+ "session_mail_tenant_id_tenant_id_fk": {
2153
+ "name": "session_mail_tenant_id_tenant_id_fk",
2154
+ "tableFrom": "session_mail",
2155
+ "tableTo": "tenant",
2156
+ "columnsFrom": ["tenant_id"],
2157
+ "columnsTo": ["id"],
2158
+ "onDelete": "cascade",
2159
+ "onUpdate": "no action"
2160
+ }
2161
+ },
2162
+ "compositePrimaryKeys": {},
2163
+ "uniqueConstraints": {},
2164
+ "policies": {},
2165
+ "checkConstraints": {},
2166
+ "isRLSEnabled": false
2167
+ },
2168
+ "public.turn_part": {
2169
+ "name": "turn_part",
2170
+ "schema": "",
2171
+ "columns": {
2172
+ "id": {
2173
+ "name": "id",
2174
+ "type": "text",
2175
+ "primaryKey": true,
2176
+ "notNull": true
2177
+ },
2178
+ "turn_id": {
2179
+ "name": "turn_id",
2180
+ "type": "text",
2181
+ "primaryKey": false,
2182
+ "notNull": true
2183
+ },
2184
+ "session_id": {
2185
+ "name": "session_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": true
2189
+ },
2190
+ "type": {
2191
+ "name": "type",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": true
2195
+ },
2196
+ "content": {
2197
+ "name": "content",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": false
2201
+ },
2202
+ "metadata": {
2203
+ "name": "metadata",
2204
+ "type": "jsonb",
2205
+ "primaryKey": false,
2206
+ "notNull": false
2207
+ },
2208
+ "ordinal": {
2209
+ "name": "ordinal",
2210
+ "type": "integer",
2211
+ "primaryKey": false,
2212
+ "notNull": true
2213
+ }
2214
+ },
2215
+ "indexes": {},
2216
+ "foreignKeys": {
2217
+ "turn_part_turn_id_inference_turn_id_fk": {
2218
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2219
+ "tableFrom": "turn_part",
2220
+ "tableTo": "inference_turn",
2221
+ "columnsFrom": ["turn_id"],
2222
+ "columnsTo": ["id"],
2223
+ "onDelete": "cascade",
2224
+ "onUpdate": "no action"
2225
+ },
2226
+ "turn_part_session_id_agent_session_id_fk": {
2227
+ "name": "turn_part_session_id_agent_session_id_fk",
2228
+ "tableFrom": "turn_part",
2229
+ "tableTo": "agent_session",
2230
+ "columnsFrom": ["session_id"],
2231
+ "columnsTo": ["id"],
2232
+ "onDelete": "cascade",
2233
+ "onUpdate": "no action"
2234
+ }
2235
+ },
2236
+ "compositePrimaryKeys": {},
2237
+ "uniqueConstraints": {},
2238
+ "policies": {},
2239
+ "checkConstraints": {},
2240
+ "isRLSEnabled": false
2241
+ }
2242
+ },
2243
+ "enums": {},
2244
+ "schemas": {},
2245
+ "sequences": {},
2246
+ "roles": {},
2247
+ "policies": {},
2248
+ "views": {},
2249
+ "_meta": {
2250
+ "columns": {},
2251
+ "schemas": {},
2252
+ "tables": {}
2253
+ }
2254
+ }