@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,2085 @@
1
+ {
2
+ "id": "972d104c-b154-420d-a469-a1f552da596f",
3
+ "prevId": "8bf80d9e-8c19-4f37-855e-907039f730c7",
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.principal_role": {
531
+ "name": "principal_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "principal_id": {
535
+ "name": "principal_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
+ "principal_role_principal_id_principal_id_fk": {
557
+ "name": "principal_role_principal_id_principal_id_fk",
558
+ "tableFrom": "principal_role",
559
+ "tableTo": "principal",
560
+ "columnsFrom": ["principal_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "principal_role_role_id_role_id_fk": {
566
+ "name": "principal_role_role_id_role_id_fk",
567
+ "tableFrom": "principal_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "principal_role_principal_id_role_id_pk": {
577
+ "name": "principal_role_principal_id_role_id_pk",
578
+ "columns": ["principal_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.role": {
587
+ "name": "role",
588
+ "schema": "",
589
+ "columns": {
590
+ "id": {
591
+ "name": "id",
592
+ "type": "text",
593
+ "primaryKey": true,
594
+ "notNull": true
595
+ },
596
+ "tenant_id": {
597
+ "name": "tenant_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "name": {
603
+ "name": "name",
604
+ "type": "text",
605
+ "primaryKey": false,
606
+ "notNull": true
607
+ },
608
+ "description": {
609
+ "name": "description",
610
+ "type": "text",
611
+ "primaryKey": false,
612
+ "notNull": false
613
+ },
614
+ "is_system": {
615
+ "name": "is_system",
616
+ "type": "boolean",
617
+ "primaryKey": false,
618
+ "notNull": true,
619
+ "default": false
620
+ },
621
+ "created_at": {
622
+ "name": "created_at",
623
+ "type": "timestamp",
624
+ "primaryKey": false,
625
+ "notNull": true,
626
+ "default": "now()"
627
+ },
628
+ "updated_at": {
629
+ "name": "updated_at",
630
+ "type": "timestamp",
631
+ "primaryKey": false,
632
+ "notNull": true,
633
+ "default": "now()"
634
+ }
635
+ },
636
+ "indexes": {},
637
+ "foreignKeys": {
638
+ "role_tenant_id_tenant_id_fk": {
639
+ "name": "role_tenant_id_tenant_id_fk",
640
+ "tableFrom": "role",
641
+ "tableTo": "tenant",
642
+ "columnsFrom": ["tenant_id"],
643
+ "columnsTo": ["id"],
644
+ "onDelete": "cascade",
645
+ "onUpdate": "no action"
646
+ }
647
+ },
648
+ "compositePrimaryKeys": {},
649
+ "uniqueConstraints": {},
650
+ "policies": {},
651
+ "checkConstraints": {},
652
+ "isRLSEnabled": false
653
+ },
654
+ "public.grant": {
655
+ "name": "grant",
656
+ "schema": "",
657
+ "columns": {
658
+ "id": {
659
+ "name": "id",
660
+ "type": "text",
661
+ "primaryKey": true,
662
+ "notNull": true
663
+ },
664
+ "tenant_id": {
665
+ "name": "tenant_id",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": true
669
+ },
670
+ "role_id": {
671
+ "name": "role_id",
672
+ "type": "text",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "principal_id": {
677
+ "name": "principal_id",
678
+ "type": "text",
679
+ "primaryKey": false,
680
+ "notNull": false
681
+ },
682
+ "resource": {
683
+ "name": "resource",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": true
687
+ },
688
+ "action": {
689
+ "name": "action",
690
+ "type": "text",
691
+ "primaryKey": false,
692
+ "notNull": true
693
+ },
694
+ "effect": {
695
+ "name": "effect",
696
+ "type": "text",
697
+ "primaryKey": false,
698
+ "notNull": true
699
+ },
700
+ "conditions": {
701
+ "name": "conditions",
702
+ "type": "jsonb",
703
+ "primaryKey": false,
704
+ "notNull": false
705
+ },
706
+ "source": {
707
+ "name": "source",
708
+ "type": "text",
709
+ "primaryKey": false,
710
+ "notNull": true
711
+ },
712
+ "expires_at": {
713
+ "name": "expires_at",
714
+ "type": "timestamp",
715
+ "primaryKey": false,
716
+ "notNull": false
717
+ },
718
+ "created_at": {
719
+ "name": "created_at",
720
+ "type": "timestamp",
721
+ "primaryKey": false,
722
+ "notNull": true,
723
+ "default": "now()"
724
+ },
725
+ "updated_at": {
726
+ "name": "updated_at",
727
+ "type": "timestamp",
728
+ "primaryKey": false,
729
+ "notNull": true,
730
+ "default": "now()"
731
+ }
732
+ },
733
+ "indexes": {},
734
+ "foreignKeys": {
735
+ "grant_tenant_id_tenant_id_fk": {
736
+ "name": "grant_tenant_id_tenant_id_fk",
737
+ "tableFrom": "grant",
738
+ "tableTo": "tenant",
739
+ "columnsFrom": ["tenant_id"],
740
+ "columnsTo": ["id"],
741
+ "onDelete": "cascade",
742
+ "onUpdate": "no action"
743
+ },
744
+ "grant_role_id_role_id_fk": {
745
+ "name": "grant_role_id_role_id_fk",
746
+ "tableFrom": "grant",
747
+ "tableTo": "role",
748
+ "columnsFrom": ["role_id"],
749
+ "columnsTo": ["id"],
750
+ "onDelete": "cascade",
751
+ "onUpdate": "no action"
752
+ },
753
+ "grant_principal_id_principal_id_fk": {
754
+ "name": "grant_principal_id_principal_id_fk",
755
+ "tableFrom": "grant",
756
+ "tableTo": "principal",
757
+ "columnsFrom": ["principal_id"],
758
+ "columnsTo": ["id"],
759
+ "onDelete": "cascade",
760
+ "onUpdate": "no action"
761
+ }
762
+ },
763
+ "compositePrimaryKeys": {},
764
+ "uniqueConstraints": {},
765
+ "policies": {},
766
+ "checkConstraints": {},
767
+ "isRLSEnabled": false
768
+ },
769
+ "public.agent": {
770
+ "name": "agent",
771
+ "schema": "",
772
+ "columns": {
773
+ "id": {
774
+ "name": "id",
775
+ "type": "text",
776
+ "primaryKey": true,
777
+ "notNull": true
778
+ },
779
+ "tenant_id": {
780
+ "name": "tenant_id",
781
+ "type": "text",
782
+ "primaryKey": false,
783
+ "notNull": true
784
+ },
785
+ "principal_id": {
786
+ "name": "principal_id",
787
+ "type": "text",
788
+ "primaryKey": false,
789
+ "notNull": false
790
+ },
791
+ "creator_principal_id": {
792
+ "name": "creator_principal_id",
793
+ "type": "text",
794
+ "primaryKey": false,
795
+ "notNull": false
796
+ },
797
+ "name": {
798
+ "name": "name",
799
+ "type": "text",
800
+ "primaryKey": false,
801
+ "notNull": true
802
+ },
803
+ "description": {
804
+ "name": "description",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": false
808
+ },
809
+ "system_prompt": {
810
+ "name": "system_prompt",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": false
814
+ },
815
+ "skills": {
816
+ "name": "skills",
817
+ "type": "jsonb",
818
+ "primaryKey": false,
819
+ "notNull": false
820
+ },
821
+ "context_config": {
822
+ "name": "context_config",
823
+ "type": "jsonb",
824
+ "primaryKey": false,
825
+ "notNull": false
826
+ },
827
+ "initial_state": {
828
+ "name": "initial_state",
829
+ "type": "jsonb",
830
+ "primaryKey": false,
831
+ "notNull": false
832
+ },
833
+ "model_config": {
834
+ "name": "model_config",
835
+ "type": "jsonb",
836
+ "primaryKey": false,
837
+ "notNull": false
838
+ },
839
+ "capabilities": {
840
+ "name": "capabilities",
841
+ "type": "jsonb",
842
+ "primaryKey": false,
843
+ "notNull": false
844
+ },
845
+ "credential_requirements": {
846
+ "name": "credential_requirements",
847
+ "type": "jsonb",
848
+ "primaryKey": false,
849
+ "notNull": false
850
+ },
851
+ "grant_requirements": {
852
+ "name": "grant_requirements",
853
+ "type": "jsonb",
854
+ "primaryKey": false,
855
+ "notNull": false
856
+ },
857
+ "current_version": {
858
+ "name": "current_version",
859
+ "type": "text",
860
+ "primaryKey": false,
861
+ "notNull": true,
862
+ "default": "'1'"
863
+ },
864
+ "status": {
865
+ "name": "status",
866
+ "type": "text",
867
+ "primaryKey": false,
868
+ "notNull": true,
869
+ "default": "'deployed'"
870
+ },
871
+ "created_at": {
872
+ "name": "created_at",
873
+ "type": "timestamp",
874
+ "primaryKey": false,
875
+ "notNull": true,
876
+ "default": "now()"
877
+ },
878
+ "updated_at": {
879
+ "name": "updated_at",
880
+ "type": "timestamp",
881
+ "primaryKey": false,
882
+ "notNull": true,
883
+ "default": "now()"
884
+ }
885
+ },
886
+ "indexes": {},
887
+ "foreignKeys": {
888
+ "agent_tenant_id_tenant_id_fk": {
889
+ "name": "agent_tenant_id_tenant_id_fk",
890
+ "tableFrom": "agent",
891
+ "tableTo": "tenant",
892
+ "columnsFrom": ["tenant_id"],
893
+ "columnsTo": ["id"],
894
+ "onDelete": "cascade",
895
+ "onUpdate": "no action"
896
+ },
897
+ "agent_principal_id_principal_id_fk": {
898
+ "name": "agent_principal_id_principal_id_fk",
899
+ "tableFrom": "agent",
900
+ "tableTo": "principal",
901
+ "columnsFrom": ["principal_id"],
902
+ "columnsTo": ["id"],
903
+ "onDelete": "no action",
904
+ "onUpdate": "no action"
905
+ },
906
+ "agent_creator_principal_id_principal_id_fk": {
907
+ "name": "agent_creator_principal_id_principal_id_fk",
908
+ "tableFrom": "agent",
909
+ "tableTo": "principal",
910
+ "columnsFrom": ["creator_principal_id"],
911
+ "columnsTo": ["id"],
912
+ "onDelete": "no action",
913
+ "onUpdate": "no action"
914
+ }
915
+ },
916
+ "compositePrimaryKeys": {},
917
+ "uniqueConstraints": {},
918
+ "policies": {},
919
+ "checkConstraints": {},
920
+ "isRLSEnabled": false
921
+ },
922
+ "public.agent_version": {
923
+ "name": "agent_version",
924
+ "schema": "",
925
+ "columns": {
926
+ "id": {
927
+ "name": "id",
928
+ "type": "text",
929
+ "primaryKey": true,
930
+ "notNull": true
931
+ },
932
+ "agent_id": {
933
+ "name": "agent_id",
934
+ "type": "text",
935
+ "primaryKey": false,
936
+ "notNull": true
937
+ },
938
+ "version": {
939
+ "name": "version",
940
+ "type": "text",
941
+ "primaryKey": false,
942
+ "notNull": true
943
+ },
944
+ "status": {
945
+ "name": "status",
946
+ "type": "text",
947
+ "primaryKey": false,
948
+ "notNull": true,
949
+ "default": "'active'"
950
+ },
951
+ "created_at": {
952
+ "name": "created_at",
953
+ "type": "timestamp",
954
+ "primaryKey": false,
955
+ "notNull": true,
956
+ "default": "now()"
957
+ }
958
+ },
959
+ "indexes": {},
960
+ "foreignKeys": {
961
+ "agent_version_agent_id_agent_id_fk": {
962
+ "name": "agent_version_agent_id_agent_id_fk",
963
+ "tableFrom": "agent_version",
964
+ "tableTo": "agent",
965
+ "columnsFrom": ["agent_id"],
966
+ "columnsTo": ["id"],
967
+ "onDelete": "cascade",
968
+ "onUpdate": "no action"
969
+ }
970
+ },
971
+ "compositePrimaryKeys": {},
972
+ "uniqueConstraints": {},
973
+ "policies": {},
974
+ "checkConstraints": {},
975
+ "isRLSEnabled": false
976
+ },
977
+ "public.provider": {
978
+ "name": "provider",
979
+ "schema": "",
980
+ "columns": {
981
+ "id": {
982
+ "name": "id",
983
+ "type": "text",
984
+ "primaryKey": true,
985
+ "notNull": true
986
+ },
987
+ "tenant_id": {
988
+ "name": "tenant_id",
989
+ "type": "text",
990
+ "primaryKey": false,
991
+ "notNull": true
992
+ },
993
+ "name": {
994
+ "name": "name",
995
+ "type": "text",
996
+ "primaryKey": false,
997
+ "notNull": true
998
+ },
999
+ "plugin": {
1000
+ "name": "plugin",
1001
+ "type": "text",
1002
+ "primaryKey": false,
1003
+ "notNull": true
1004
+ },
1005
+ "authorization_url": {
1006
+ "name": "authorization_url",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": false
1010
+ },
1011
+ "token_url": {
1012
+ "name": "token_url",
1013
+ "type": "text",
1014
+ "primaryKey": false,
1015
+ "notNull": false
1016
+ },
1017
+ "user_info_url": {
1018
+ "name": "user_info_url",
1019
+ "type": "text",
1020
+ "primaryKey": false,
1021
+ "notNull": false
1022
+ },
1023
+ "scopes": {
1024
+ "name": "scopes",
1025
+ "type": "text[]",
1026
+ "primaryKey": false,
1027
+ "notNull": false
1028
+ },
1029
+ "metadata": {
1030
+ "name": "metadata",
1031
+ "type": "jsonb",
1032
+ "primaryKey": false,
1033
+ "notNull": false
1034
+ },
1035
+ "created_at": {
1036
+ "name": "created_at",
1037
+ "type": "timestamp",
1038
+ "primaryKey": false,
1039
+ "notNull": true,
1040
+ "default": "now()"
1041
+ },
1042
+ "updated_at": {
1043
+ "name": "updated_at",
1044
+ "type": "timestamp",
1045
+ "primaryKey": false,
1046
+ "notNull": true,
1047
+ "default": "now()"
1048
+ }
1049
+ },
1050
+ "indexes": {},
1051
+ "foreignKeys": {
1052
+ "provider_tenant_id_tenant_id_fk": {
1053
+ "name": "provider_tenant_id_tenant_id_fk",
1054
+ "tableFrom": "provider",
1055
+ "tableTo": "tenant",
1056
+ "columnsFrom": ["tenant_id"],
1057
+ "columnsTo": ["id"],
1058
+ "onDelete": "cascade",
1059
+ "onUpdate": "no action"
1060
+ }
1061
+ },
1062
+ "compositePrimaryKeys": {},
1063
+ "uniqueConstraints": {
1064
+ "provider_tenant_name": {
1065
+ "name": "provider_tenant_name",
1066
+ "nullsNotDistinct": false,
1067
+ "columns": ["tenant_id", "name"]
1068
+ }
1069
+ },
1070
+ "policies": {},
1071
+ "checkConstraints": {},
1072
+ "isRLSEnabled": false
1073
+ },
1074
+ "public.oauth_client": {
1075
+ "name": "oauth_client",
1076
+ "schema": "",
1077
+ "columns": {
1078
+ "id": {
1079
+ "name": "id",
1080
+ "type": "text",
1081
+ "primaryKey": true,
1082
+ "notNull": true
1083
+ },
1084
+ "tenant_id": {
1085
+ "name": "tenant_id",
1086
+ "type": "text",
1087
+ "primaryKey": false,
1088
+ "notNull": true
1089
+ },
1090
+ "provider_id": {
1091
+ "name": "provider_id",
1092
+ "type": "text",
1093
+ "primaryKey": false,
1094
+ "notNull": true
1095
+ },
1096
+ "name": {
1097
+ "name": "name",
1098
+ "type": "text",
1099
+ "primaryKey": false,
1100
+ "notNull": true
1101
+ },
1102
+ "client_id": {
1103
+ "name": "client_id",
1104
+ "type": "text",
1105
+ "primaryKey": false,
1106
+ "notNull": true
1107
+ },
1108
+ "client_secret": {
1109
+ "name": "client_secret",
1110
+ "type": "text",
1111
+ "primaryKey": false,
1112
+ "notNull": true
1113
+ },
1114
+ "redirect_uris": {
1115
+ "name": "redirect_uris",
1116
+ "type": "text[]",
1117
+ "primaryKey": false,
1118
+ "notNull": false
1119
+ },
1120
+ "default_scopes": {
1121
+ "name": "default_scopes",
1122
+ "type": "text[]",
1123
+ "primaryKey": false,
1124
+ "notNull": false
1125
+ },
1126
+ "metadata": {
1127
+ "name": "metadata",
1128
+ "type": "jsonb",
1129
+ "primaryKey": false,
1130
+ "notNull": false
1131
+ },
1132
+ "created_at": {
1133
+ "name": "created_at",
1134
+ "type": "timestamp",
1135
+ "primaryKey": false,
1136
+ "notNull": true,
1137
+ "default": "now()"
1138
+ },
1139
+ "updated_at": {
1140
+ "name": "updated_at",
1141
+ "type": "timestamp",
1142
+ "primaryKey": false,
1143
+ "notNull": true,
1144
+ "default": "now()"
1145
+ }
1146
+ },
1147
+ "indexes": {},
1148
+ "foreignKeys": {
1149
+ "oauth_client_tenant_id_tenant_id_fk": {
1150
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1151
+ "tableFrom": "oauth_client",
1152
+ "tableTo": "tenant",
1153
+ "columnsFrom": ["tenant_id"],
1154
+ "columnsTo": ["id"],
1155
+ "onDelete": "cascade",
1156
+ "onUpdate": "no action"
1157
+ },
1158
+ "oauth_client_provider_id_provider_id_fk": {
1159
+ "name": "oauth_client_provider_id_provider_id_fk",
1160
+ "tableFrom": "oauth_client",
1161
+ "tableTo": "provider",
1162
+ "columnsFrom": ["provider_id"],
1163
+ "columnsTo": ["id"],
1164
+ "onDelete": "cascade",
1165
+ "onUpdate": "no action"
1166
+ }
1167
+ },
1168
+ "compositePrimaryKeys": {},
1169
+ "uniqueConstraints": {
1170
+ "oauth_client_tenant_provider": {
1171
+ "name": "oauth_client_tenant_provider",
1172
+ "nullsNotDistinct": false,
1173
+ "columns": ["tenant_id", "provider_id"]
1174
+ }
1175
+ },
1176
+ "policies": {},
1177
+ "checkConstraints": {},
1178
+ "isRLSEnabled": false
1179
+ },
1180
+ "public.credential": {
1181
+ "name": "credential",
1182
+ "schema": "",
1183
+ "columns": {
1184
+ "id": {
1185
+ "name": "id",
1186
+ "type": "text",
1187
+ "primaryKey": true,
1188
+ "notNull": true
1189
+ },
1190
+ "tenant_id": {
1191
+ "name": "tenant_id",
1192
+ "type": "text",
1193
+ "primaryKey": false,
1194
+ "notNull": true
1195
+ },
1196
+ "principal_id": {
1197
+ "name": "principal_id",
1198
+ "type": "text",
1199
+ "primaryKey": false,
1200
+ "notNull": false
1201
+ },
1202
+ "provider_id": {
1203
+ "name": "provider_id",
1204
+ "type": "text",
1205
+ "primaryKey": false,
1206
+ "notNull": true
1207
+ },
1208
+ "oauth_client_id": {
1209
+ "name": "oauth_client_id",
1210
+ "type": "text",
1211
+ "primaryKey": false,
1212
+ "notNull": false
1213
+ },
1214
+ "name": {
1215
+ "name": "name",
1216
+ "type": "text",
1217
+ "primaryKey": false,
1218
+ "notNull": true
1219
+ },
1220
+ "type": {
1221
+ "name": "type",
1222
+ "type": "text",
1223
+ "primaryKey": false,
1224
+ "notNull": true
1225
+ },
1226
+ "description": {
1227
+ "name": "description",
1228
+ "type": "text",
1229
+ "primaryKey": false,
1230
+ "notNull": false
1231
+ },
1232
+ "secret": {
1233
+ "name": "secret",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true
1237
+ },
1238
+ "refresh_secret": {
1239
+ "name": "refresh_secret",
1240
+ "type": "text",
1241
+ "primaryKey": false,
1242
+ "notNull": false
1243
+ },
1244
+ "scopes": {
1245
+ "name": "scopes",
1246
+ "type": "text[]",
1247
+ "primaryKey": false,
1248
+ "notNull": false
1249
+ },
1250
+ "expires_at": {
1251
+ "name": "expires_at",
1252
+ "type": "timestamp",
1253
+ "primaryKey": false,
1254
+ "notNull": false
1255
+ },
1256
+ "status": {
1257
+ "name": "status",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": true,
1261
+ "default": "'active'"
1262
+ },
1263
+ "metadata": {
1264
+ "name": "metadata",
1265
+ "type": "jsonb",
1266
+ "primaryKey": false,
1267
+ "notNull": false
1268
+ },
1269
+ "created_at": {
1270
+ "name": "created_at",
1271
+ "type": "timestamp",
1272
+ "primaryKey": false,
1273
+ "notNull": true,
1274
+ "default": "now()"
1275
+ },
1276
+ "updated_at": {
1277
+ "name": "updated_at",
1278
+ "type": "timestamp",
1279
+ "primaryKey": false,
1280
+ "notNull": true,
1281
+ "default": "now()"
1282
+ }
1283
+ },
1284
+ "indexes": {},
1285
+ "foreignKeys": {
1286
+ "credential_tenant_id_tenant_id_fk": {
1287
+ "name": "credential_tenant_id_tenant_id_fk",
1288
+ "tableFrom": "credential",
1289
+ "tableTo": "tenant",
1290
+ "columnsFrom": ["tenant_id"],
1291
+ "columnsTo": ["id"],
1292
+ "onDelete": "cascade",
1293
+ "onUpdate": "no action"
1294
+ },
1295
+ "credential_principal_id_principal_id_fk": {
1296
+ "name": "credential_principal_id_principal_id_fk",
1297
+ "tableFrom": "credential",
1298
+ "tableTo": "principal",
1299
+ "columnsFrom": ["principal_id"],
1300
+ "columnsTo": ["id"],
1301
+ "onDelete": "set null",
1302
+ "onUpdate": "no action"
1303
+ },
1304
+ "credential_provider_id_provider_id_fk": {
1305
+ "name": "credential_provider_id_provider_id_fk",
1306
+ "tableFrom": "credential",
1307
+ "tableTo": "provider",
1308
+ "columnsFrom": ["provider_id"],
1309
+ "columnsTo": ["id"],
1310
+ "onDelete": "cascade",
1311
+ "onUpdate": "no action"
1312
+ },
1313
+ "credential_oauth_client_id_oauth_client_id_fk": {
1314
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1315
+ "tableFrom": "credential",
1316
+ "tableTo": "oauth_client",
1317
+ "columnsFrom": ["oauth_client_id"],
1318
+ "columnsTo": ["id"],
1319
+ "onDelete": "set null",
1320
+ "onUpdate": "no action"
1321
+ }
1322
+ },
1323
+ "compositePrimaryKeys": {},
1324
+ "uniqueConstraints": {
1325
+ "credential_tenant_name": {
1326
+ "name": "credential_tenant_name",
1327
+ "nullsNotDistinct": false,
1328
+ "columns": ["tenant_id", "name"]
1329
+ }
1330
+ },
1331
+ "policies": {},
1332
+ "checkConstraints": {},
1333
+ "isRLSEnabled": false
1334
+ },
1335
+ "public.transaction": {
1336
+ "name": "transaction",
1337
+ "schema": "",
1338
+ "columns": {
1339
+ "id": {
1340
+ "name": "id",
1341
+ "type": "text",
1342
+ "primaryKey": true,
1343
+ "notNull": true
1344
+ },
1345
+ "wallet_id": {
1346
+ "name": "wallet_id",
1347
+ "type": "text",
1348
+ "primaryKey": false,
1349
+ "notNull": true
1350
+ },
1351
+ "agent_id": {
1352
+ "name": "agent_id",
1353
+ "type": "text",
1354
+ "primaryKey": false,
1355
+ "notNull": false
1356
+ },
1357
+ "direction": {
1358
+ "name": "direction",
1359
+ "type": "text",
1360
+ "primaryKey": false,
1361
+ "notNull": true
1362
+ },
1363
+ "amount": {
1364
+ "name": "amount",
1365
+ "type": "text",
1366
+ "primaryKey": false,
1367
+ "notNull": true
1368
+ },
1369
+ "currency": {
1370
+ "name": "currency",
1371
+ "type": "text",
1372
+ "primaryKey": false,
1373
+ "notNull": true
1374
+ },
1375
+ "recipient_id": {
1376
+ "name": "recipient_id",
1377
+ "type": "text",
1378
+ "primaryKey": false,
1379
+ "notNull": false
1380
+ },
1381
+ "sender_id": {
1382
+ "name": "sender_id",
1383
+ "type": "text",
1384
+ "primaryKey": false,
1385
+ "notNull": false
1386
+ },
1387
+ "request_id": {
1388
+ "name": "request_id",
1389
+ "type": "text",
1390
+ "primaryKey": false,
1391
+ "notNull": false
1392
+ },
1393
+ "status": {
1394
+ "name": "status",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": true,
1398
+ "default": "'pending'"
1399
+ },
1400
+ "created_at": {
1401
+ "name": "created_at",
1402
+ "type": "timestamp",
1403
+ "primaryKey": false,
1404
+ "notNull": true,
1405
+ "default": "now()"
1406
+ }
1407
+ },
1408
+ "indexes": {},
1409
+ "foreignKeys": {
1410
+ "transaction_wallet_id_wallet_id_fk": {
1411
+ "name": "transaction_wallet_id_wallet_id_fk",
1412
+ "tableFrom": "transaction",
1413
+ "tableTo": "wallet",
1414
+ "columnsFrom": ["wallet_id"],
1415
+ "columnsTo": ["id"],
1416
+ "onDelete": "cascade",
1417
+ "onUpdate": "no action"
1418
+ },
1419
+ "transaction_agent_id_agent_id_fk": {
1420
+ "name": "transaction_agent_id_agent_id_fk",
1421
+ "tableFrom": "transaction",
1422
+ "tableTo": "agent",
1423
+ "columnsFrom": ["agent_id"],
1424
+ "columnsTo": ["id"],
1425
+ "onDelete": "set null",
1426
+ "onUpdate": "no action"
1427
+ }
1428
+ },
1429
+ "compositePrimaryKeys": {},
1430
+ "uniqueConstraints": {},
1431
+ "policies": {},
1432
+ "checkConstraints": {},
1433
+ "isRLSEnabled": false
1434
+ },
1435
+ "public.wallet": {
1436
+ "name": "wallet",
1437
+ "schema": "",
1438
+ "columns": {
1439
+ "id": {
1440
+ "name": "id",
1441
+ "type": "text",
1442
+ "primaryKey": true,
1443
+ "notNull": true
1444
+ },
1445
+ "tenant_id": {
1446
+ "name": "tenant_id",
1447
+ "type": "text",
1448
+ "primaryKey": false,
1449
+ "notNull": true
1450
+ },
1451
+ "name": {
1452
+ "name": "name",
1453
+ "type": "text",
1454
+ "primaryKey": false,
1455
+ "notNull": true
1456
+ },
1457
+ "backend_type": {
1458
+ "name": "backend_type",
1459
+ "type": "text",
1460
+ "primaryKey": false,
1461
+ "notNull": true
1462
+ },
1463
+ "currency": {
1464
+ "name": "currency",
1465
+ "type": "text",
1466
+ "primaryKey": false,
1467
+ "notNull": true
1468
+ },
1469
+ "balance": {
1470
+ "name": "balance",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": true,
1474
+ "default": "'0'"
1475
+ },
1476
+ "config": {
1477
+ "name": "config",
1478
+ "type": "jsonb",
1479
+ "primaryKey": false,
1480
+ "notNull": false
1481
+ },
1482
+ "created_at": {
1483
+ "name": "created_at",
1484
+ "type": "timestamp",
1485
+ "primaryKey": false,
1486
+ "notNull": true,
1487
+ "default": "now()"
1488
+ },
1489
+ "updated_at": {
1490
+ "name": "updated_at",
1491
+ "type": "timestamp",
1492
+ "primaryKey": false,
1493
+ "notNull": true,
1494
+ "default": "now()"
1495
+ }
1496
+ },
1497
+ "indexes": {},
1498
+ "foreignKeys": {
1499
+ "wallet_tenant_id_tenant_id_fk": {
1500
+ "name": "wallet_tenant_id_tenant_id_fk",
1501
+ "tableFrom": "wallet",
1502
+ "tableTo": "tenant",
1503
+ "columnsFrom": ["tenant_id"],
1504
+ "columnsTo": ["id"],
1505
+ "onDelete": "cascade",
1506
+ "onUpdate": "no action"
1507
+ }
1508
+ },
1509
+ "compositePrimaryKeys": {},
1510
+ "uniqueConstraints": {},
1511
+ "policies": {},
1512
+ "checkConstraints": {},
1513
+ "isRLSEnabled": false
1514
+ },
1515
+ "public.offering": {
1516
+ "name": "offering",
1517
+ "schema": "",
1518
+ "columns": {
1519
+ "id": {
1520
+ "name": "id",
1521
+ "type": "text",
1522
+ "primaryKey": true,
1523
+ "notNull": true
1524
+ },
1525
+ "agent_id": {
1526
+ "name": "agent_id",
1527
+ "type": "text",
1528
+ "primaryKey": false,
1529
+ "notNull": true
1530
+ },
1531
+ "tenant_id": {
1532
+ "name": "tenant_id",
1533
+ "type": "text",
1534
+ "primaryKey": false,
1535
+ "notNull": true
1536
+ },
1537
+ "name": {
1538
+ "name": "name",
1539
+ "type": "text",
1540
+ "primaryKey": false,
1541
+ "notNull": true
1542
+ },
1543
+ "description": {
1544
+ "name": "description",
1545
+ "type": "text",
1546
+ "primaryKey": false,
1547
+ "notNull": false
1548
+ },
1549
+ "pricing": {
1550
+ "name": "pricing",
1551
+ "type": "jsonb",
1552
+ "primaryKey": false,
1553
+ "notNull": false
1554
+ },
1555
+ "schema": {
1556
+ "name": "schema",
1557
+ "type": "jsonb",
1558
+ "primaryKey": false,
1559
+ "notNull": false
1560
+ },
1561
+ "created_at": {
1562
+ "name": "created_at",
1563
+ "type": "timestamp",
1564
+ "primaryKey": false,
1565
+ "notNull": true,
1566
+ "default": "now()"
1567
+ },
1568
+ "updated_at": {
1569
+ "name": "updated_at",
1570
+ "type": "timestamp",
1571
+ "primaryKey": false,
1572
+ "notNull": true,
1573
+ "default": "now()"
1574
+ }
1575
+ },
1576
+ "indexes": {},
1577
+ "foreignKeys": {
1578
+ "offering_agent_id_agent_id_fk": {
1579
+ "name": "offering_agent_id_agent_id_fk",
1580
+ "tableFrom": "offering",
1581
+ "tableTo": "agent",
1582
+ "columnsFrom": ["agent_id"],
1583
+ "columnsTo": ["id"],
1584
+ "onDelete": "cascade",
1585
+ "onUpdate": "no action"
1586
+ },
1587
+ "offering_tenant_id_tenant_id_fk": {
1588
+ "name": "offering_tenant_id_tenant_id_fk",
1589
+ "tableFrom": "offering",
1590
+ "tableTo": "tenant",
1591
+ "columnsFrom": ["tenant_id"],
1592
+ "columnsTo": ["id"],
1593
+ "onDelete": "cascade",
1594
+ "onUpdate": "no action"
1595
+ }
1596
+ },
1597
+ "compositePrimaryKeys": {},
1598
+ "uniqueConstraints": {},
1599
+ "policies": {},
1600
+ "checkConstraints": {},
1601
+ "isRLSEnabled": false
1602
+ },
1603
+ "public.sidecar": {
1604
+ "name": "sidecar",
1605
+ "schema": "",
1606
+ "columns": {
1607
+ "id": {
1608
+ "name": "id",
1609
+ "type": "text",
1610
+ "primaryKey": true,
1611
+ "notNull": true
1612
+ },
1613
+ "url": {
1614
+ "name": "url",
1615
+ "type": "text",
1616
+ "primaryKey": false,
1617
+ "notNull": true
1618
+ },
1619
+ "status": {
1620
+ "name": "status",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "default": "'online'"
1625
+ },
1626
+ "last_heartbeat": {
1627
+ "name": "last_heartbeat",
1628
+ "type": "timestamp",
1629
+ "primaryKey": false,
1630
+ "notNull": false
1631
+ },
1632
+ "created_at": {
1633
+ "name": "created_at",
1634
+ "type": "timestamp",
1635
+ "primaryKey": false,
1636
+ "notNull": true,
1637
+ "default": "now()"
1638
+ },
1639
+ "updated_at": {
1640
+ "name": "updated_at",
1641
+ "type": "timestamp",
1642
+ "primaryKey": false,
1643
+ "notNull": true,
1644
+ "default": "now()"
1645
+ }
1646
+ },
1647
+ "indexes": {},
1648
+ "foreignKeys": {},
1649
+ "compositePrimaryKeys": {},
1650
+ "uniqueConstraints": {},
1651
+ "policies": {},
1652
+ "checkConstraints": {},
1653
+ "isRLSEnabled": false
1654
+ },
1655
+ "public.agent_session": {
1656
+ "name": "agent_session",
1657
+ "schema": "",
1658
+ "columns": {
1659
+ "id": {
1660
+ "name": "id",
1661
+ "type": "text",
1662
+ "primaryKey": true,
1663
+ "notNull": true
1664
+ },
1665
+ "tenant_id": {
1666
+ "name": "tenant_id",
1667
+ "type": "text",
1668
+ "primaryKey": false,
1669
+ "notNull": true
1670
+ },
1671
+ "agent_id": {
1672
+ "name": "agent_id",
1673
+ "type": "text",
1674
+ "primaryKey": false,
1675
+ "notNull": true
1676
+ },
1677
+ "principal_id": {
1678
+ "name": "principal_id",
1679
+ "type": "text",
1680
+ "primaryKey": false,
1681
+ "notNull": true
1682
+ },
1683
+ "status": {
1684
+ "name": "status",
1685
+ "type": "text",
1686
+ "primaryKey": false,
1687
+ "notNull": true,
1688
+ "default": "'active'"
1689
+ },
1690
+ "created_at": {
1691
+ "name": "created_at",
1692
+ "type": "timestamp",
1693
+ "primaryKey": false,
1694
+ "notNull": true,
1695
+ "default": "now()"
1696
+ },
1697
+ "updated_at": {
1698
+ "name": "updated_at",
1699
+ "type": "timestamp",
1700
+ "primaryKey": false,
1701
+ "notNull": true,
1702
+ "default": "now()"
1703
+ },
1704
+ "ended_at": {
1705
+ "name": "ended_at",
1706
+ "type": "timestamp",
1707
+ "primaryKey": false,
1708
+ "notNull": false
1709
+ }
1710
+ },
1711
+ "indexes": {},
1712
+ "foreignKeys": {
1713
+ "agent_session_tenant_id_tenant_id_fk": {
1714
+ "name": "agent_session_tenant_id_tenant_id_fk",
1715
+ "tableFrom": "agent_session",
1716
+ "tableTo": "tenant",
1717
+ "columnsFrom": ["tenant_id"],
1718
+ "columnsTo": ["id"],
1719
+ "onDelete": "cascade",
1720
+ "onUpdate": "no action"
1721
+ },
1722
+ "agent_session_agent_id_agent_id_fk": {
1723
+ "name": "agent_session_agent_id_agent_id_fk",
1724
+ "tableFrom": "agent_session",
1725
+ "tableTo": "agent",
1726
+ "columnsFrom": ["agent_id"],
1727
+ "columnsTo": ["id"],
1728
+ "onDelete": "cascade",
1729
+ "onUpdate": "no action"
1730
+ },
1731
+ "agent_session_principal_id_principal_id_fk": {
1732
+ "name": "agent_session_principal_id_principal_id_fk",
1733
+ "tableFrom": "agent_session",
1734
+ "tableTo": "principal",
1735
+ "columnsFrom": ["principal_id"],
1736
+ "columnsTo": ["id"],
1737
+ "onDelete": "no action",
1738
+ "onUpdate": "no action"
1739
+ }
1740
+ },
1741
+ "compositePrimaryKeys": {},
1742
+ "uniqueConstraints": {},
1743
+ "policies": {},
1744
+ "checkConstraints": {},
1745
+ "isRLSEnabled": false
1746
+ },
1747
+ "public.agent_instance": {
1748
+ "name": "agent_instance",
1749
+ "schema": "",
1750
+ "columns": {
1751
+ "id": {
1752
+ "name": "id",
1753
+ "type": "text",
1754
+ "primaryKey": true,
1755
+ "notNull": true
1756
+ },
1757
+ "agent_id": {
1758
+ "name": "agent_id",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": true
1762
+ },
1763
+ "tenant_id": {
1764
+ "name": "tenant_id",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": true
1768
+ },
1769
+ "principal_id": {
1770
+ "name": "principal_id",
1771
+ "type": "text",
1772
+ "primaryKey": false,
1773
+ "notNull": true
1774
+ },
1775
+ "address": {
1776
+ "name": "address",
1777
+ "type": "text",
1778
+ "primaryKey": false,
1779
+ "notNull": true
1780
+ },
1781
+ "version_id": {
1782
+ "name": "version_id",
1783
+ "type": "text",
1784
+ "primaryKey": false,
1785
+ "notNull": false
1786
+ },
1787
+ "session_id": {
1788
+ "name": "session_id",
1789
+ "type": "text",
1790
+ "primaryKey": false,
1791
+ "notNull": false
1792
+ },
1793
+ "status": {
1794
+ "name": "status",
1795
+ "type": "text",
1796
+ "primaryKey": false,
1797
+ "notNull": true,
1798
+ "default": "'deployed'"
1799
+ },
1800
+ "sidecar_id": {
1801
+ "name": "sidecar_id",
1802
+ "type": "text",
1803
+ "primaryKey": false,
1804
+ "notNull": false
1805
+ },
1806
+ "public_key": {
1807
+ "name": "public_key",
1808
+ "type": "text",
1809
+ "primaryKey": false,
1810
+ "notNull": false
1811
+ },
1812
+ "kernel_id": {
1813
+ "name": "kernel_id",
1814
+ "type": "text",
1815
+ "primaryKey": false,
1816
+ "notNull": false
1817
+ },
1818
+ "created_at": {
1819
+ "name": "created_at",
1820
+ "type": "timestamp",
1821
+ "primaryKey": false,
1822
+ "notNull": true,
1823
+ "default": "now()"
1824
+ },
1825
+ "updated_at": {
1826
+ "name": "updated_at",
1827
+ "type": "timestamp",
1828
+ "primaryKey": false,
1829
+ "notNull": true,
1830
+ "default": "now()"
1831
+ },
1832
+ "ended_at": {
1833
+ "name": "ended_at",
1834
+ "type": "timestamp",
1835
+ "primaryKey": false,
1836
+ "notNull": false
1837
+ }
1838
+ },
1839
+ "indexes": {},
1840
+ "foreignKeys": {
1841
+ "agent_instance_agent_id_agent_id_fk": {
1842
+ "name": "agent_instance_agent_id_agent_id_fk",
1843
+ "tableFrom": "agent_instance",
1844
+ "tableTo": "agent",
1845
+ "columnsFrom": ["agent_id"],
1846
+ "columnsTo": ["id"],
1847
+ "onDelete": "cascade",
1848
+ "onUpdate": "no action"
1849
+ },
1850
+ "agent_instance_tenant_id_tenant_id_fk": {
1851
+ "name": "agent_instance_tenant_id_tenant_id_fk",
1852
+ "tableFrom": "agent_instance",
1853
+ "tableTo": "tenant",
1854
+ "columnsFrom": ["tenant_id"],
1855
+ "columnsTo": ["id"],
1856
+ "onDelete": "cascade",
1857
+ "onUpdate": "no action"
1858
+ },
1859
+ "agent_instance_principal_id_principal_id_fk": {
1860
+ "name": "agent_instance_principal_id_principal_id_fk",
1861
+ "tableFrom": "agent_instance",
1862
+ "tableTo": "principal",
1863
+ "columnsFrom": ["principal_id"],
1864
+ "columnsTo": ["id"],
1865
+ "onDelete": "no action",
1866
+ "onUpdate": "no action"
1867
+ },
1868
+ "agent_instance_version_id_agent_version_id_fk": {
1869
+ "name": "agent_instance_version_id_agent_version_id_fk",
1870
+ "tableFrom": "agent_instance",
1871
+ "tableTo": "agent_version",
1872
+ "columnsFrom": ["version_id"],
1873
+ "columnsTo": ["id"],
1874
+ "onDelete": "no action",
1875
+ "onUpdate": "no action"
1876
+ },
1877
+ "agent_instance_session_id_agent_session_id_fk": {
1878
+ "name": "agent_instance_session_id_agent_session_id_fk",
1879
+ "tableFrom": "agent_instance",
1880
+ "tableTo": "agent_session",
1881
+ "columnsFrom": ["session_id"],
1882
+ "columnsTo": ["id"],
1883
+ "onDelete": "no action",
1884
+ "onUpdate": "no action"
1885
+ },
1886
+ "agent_instance_sidecar_id_sidecar_id_fk": {
1887
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
1888
+ "tableFrom": "agent_instance",
1889
+ "tableTo": "sidecar",
1890
+ "columnsFrom": ["sidecar_id"],
1891
+ "columnsTo": ["id"],
1892
+ "onDelete": "set null",
1893
+ "onUpdate": "no action"
1894
+ }
1895
+ },
1896
+ "compositePrimaryKeys": {},
1897
+ "uniqueConstraints": {
1898
+ "agent_instance_address_unique": {
1899
+ "name": "agent_instance_address_unique",
1900
+ "nullsNotDistinct": false,
1901
+ "columns": ["address"]
1902
+ }
1903
+ },
1904
+ "policies": {},
1905
+ "checkConstraints": {},
1906
+ "isRLSEnabled": false
1907
+ },
1908
+ "public.message_part": {
1909
+ "name": "message_part",
1910
+ "schema": "",
1911
+ "columns": {
1912
+ "id": {
1913
+ "name": "id",
1914
+ "type": "text",
1915
+ "primaryKey": true,
1916
+ "notNull": true
1917
+ },
1918
+ "message_id": {
1919
+ "name": "message_id",
1920
+ "type": "text",
1921
+ "primaryKey": false,
1922
+ "notNull": true
1923
+ },
1924
+ "session_id": {
1925
+ "name": "session_id",
1926
+ "type": "text",
1927
+ "primaryKey": false,
1928
+ "notNull": true
1929
+ },
1930
+ "type": {
1931
+ "name": "type",
1932
+ "type": "text",
1933
+ "primaryKey": false,
1934
+ "notNull": true
1935
+ },
1936
+ "content": {
1937
+ "name": "content",
1938
+ "type": "text",
1939
+ "primaryKey": false,
1940
+ "notNull": false
1941
+ },
1942
+ "metadata": {
1943
+ "name": "metadata",
1944
+ "type": "jsonb",
1945
+ "primaryKey": false,
1946
+ "notNull": false
1947
+ },
1948
+ "ordinal": {
1949
+ "name": "ordinal",
1950
+ "type": "integer",
1951
+ "primaryKey": false,
1952
+ "notNull": true
1953
+ }
1954
+ },
1955
+ "indexes": {},
1956
+ "foreignKeys": {
1957
+ "message_part_message_id_session_message_id_fk": {
1958
+ "name": "message_part_message_id_session_message_id_fk",
1959
+ "tableFrom": "message_part",
1960
+ "tableTo": "session_message",
1961
+ "columnsFrom": ["message_id"],
1962
+ "columnsTo": ["id"],
1963
+ "onDelete": "cascade",
1964
+ "onUpdate": "no action"
1965
+ },
1966
+ "message_part_session_id_agent_session_id_fk": {
1967
+ "name": "message_part_session_id_agent_session_id_fk",
1968
+ "tableFrom": "message_part",
1969
+ "tableTo": "agent_session",
1970
+ "columnsFrom": ["session_id"],
1971
+ "columnsTo": ["id"],
1972
+ "onDelete": "cascade",
1973
+ "onUpdate": "no action"
1974
+ }
1975
+ },
1976
+ "compositePrimaryKeys": {},
1977
+ "uniqueConstraints": {},
1978
+ "policies": {},
1979
+ "checkConstraints": {},
1980
+ "isRLSEnabled": false
1981
+ },
1982
+ "public.session_message": {
1983
+ "name": "session_message",
1984
+ "schema": "",
1985
+ "columns": {
1986
+ "id": {
1987
+ "name": "id",
1988
+ "type": "text",
1989
+ "primaryKey": true,
1990
+ "notNull": true
1991
+ },
1992
+ "session_id": {
1993
+ "name": "session_id",
1994
+ "type": "text",
1995
+ "primaryKey": false,
1996
+ "notNull": true
1997
+ },
1998
+ "instance_id": {
1999
+ "name": "instance_id",
2000
+ "type": "text",
2001
+ "primaryKey": false,
2002
+ "notNull": false
2003
+ },
2004
+ "tenant_id": {
2005
+ "name": "tenant_id",
2006
+ "type": "text",
2007
+ "primaryKey": false,
2008
+ "notNull": true
2009
+ },
2010
+ "role": {
2011
+ "name": "role",
2012
+ "type": "text",
2013
+ "primaryKey": false,
2014
+ "notNull": true
2015
+ },
2016
+ "from": {
2017
+ "name": "from",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": true
2021
+ },
2022
+ "status": {
2023
+ "name": "status",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": true,
2027
+ "default": "'pending'"
2028
+ },
2029
+ "created_at": {
2030
+ "name": "created_at",
2031
+ "type": "timestamp",
2032
+ "primaryKey": false,
2033
+ "notNull": true,
2034
+ "default": "now()"
2035
+ }
2036
+ },
2037
+ "indexes": {},
2038
+ "foreignKeys": {
2039
+ "session_message_session_id_agent_session_id_fk": {
2040
+ "name": "session_message_session_id_agent_session_id_fk",
2041
+ "tableFrom": "session_message",
2042
+ "tableTo": "agent_session",
2043
+ "columnsFrom": ["session_id"],
2044
+ "columnsTo": ["id"],
2045
+ "onDelete": "cascade",
2046
+ "onUpdate": "no action"
2047
+ },
2048
+ "session_message_instance_id_agent_instance_id_fk": {
2049
+ "name": "session_message_instance_id_agent_instance_id_fk",
2050
+ "tableFrom": "session_message",
2051
+ "tableTo": "agent_instance",
2052
+ "columnsFrom": ["instance_id"],
2053
+ "columnsTo": ["id"],
2054
+ "onDelete": "cascade",
2055
+ "onUpdate": "no action"
2056
+ },
2057
+ "session_message_tenant_id_tenant_id_fk": {
2058
+ "name": "session_message_tenant_id_tenant_id_fk",
2059
+ "tableFrom": "session_message",
2060
+ "tableTo": "tenant",
2061
+ "columnsFrom": ["tenant_id"],
2062
+ "columnsTo": ["id"],
2063
+ "onDelete": "cascade",
2064
+ "onUpdate": "no action"
2065
+ }
2066
+ },
2067
+ "compositePrimaryKeys": {},
2068
+ "uniqueConstraints": {},
2069
+ "policies": {},
2070
+ "checkConstraints": {},
2071
+ "isRLSEnabled": false
2072
+ }
2073
+ },
2074
+ "enums": {},
2075
+ "schemas": {},
2076
+ "sequences": {},
2077
+ "roles": {},
2078
+ "policies": {},
2079
+ "views": {},
2080
+ "_meta": {
2081
+ "columns": {},
2082
+ "schemas": {},
2083
+ "tables": {}
2084
+ }
2085
+ }