@intx/db 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +23 -4
  3. package/dist/approval-store.d.ts +52 -0
  4. package/dist/approval-store.js +79 -0
  5. package/dist/asset-resolution.d.ts +52 -0
  6. package/dist/asset-resolution.js +66 -0
  7. package/dist/catalog-resolution.d.ts +76 -0
  8. package/dist/catalog-resolution.js +151 -0
  9. package/dist/client.d.ts +19 -0
  10. package/dist/client.js +18 -0
  11. package/dist/config.d.ts +11 -0
  12. package/dist/config.js +16 -0
  13. package/dist/connection.d.ts +3 -0
  14. package/dist/connection.js +26 -0
  15. package/dist/credential-resolution.d.ts +222 -0
  16. package/dist/credential-resolution.js +255 -0
  17. package/dist/grant-store.d.ts +3 -0
  18. package/dist/grant-store.js +59 -0
  19. package/dist/index.d.ts +22 -0
  20. package/dist/index.js +20 -0
  21. package/dist/migrate.d.ts +36 -0
  22. package/dist/migrate.js +135 -0
  23. package/dist/model-source-resolution.d.ts +115 -0
  24. package/dist/model-source-resolution.js +291 -0
  25. package/dist/parse-row.d.ts +373 -0
  26. package/dist/parse-row.js +232 -0
  27. package/dist/pg-error.d.ts +3 -0
  28. package/dist/pg-error.js +19 -0
  29. package/dist/pricing.d.ts +15 -0
  30. package/dist/pricing.js +24 -0
  31. package/dist/rekey-credential-secrets.d.ts +13 -0
  32. package/dist/rekey-credential-secrets.js +61 -0
  33. package/dist/schema/approvals.d.ts +245 -0
  34. package/dist/schema/approvals.js +52 -0
  35. package/dist/schema/assets.d.ts +143 -0
  36. package/{src/schema/assets.ts → dist/schema/assets.js} +7 -16
  37. package/dist/schema/auth.d.ts +606 -0
  38. package/dist/schema/auth.js +47 -0
  39. package/dist/schema/catalog.d.ts +811 -0
  40. package/dist/schema/catalog.js +108 -0
  41. package/dist/schema/column-types.d.ts +26 -0
  42. package/dist/schema/column-types.js +15 -0
  43. package/dist/schema/credentials.d.ts +305 -0
  44. package/{src/schema/credentials.ts → dist/schema/credentials.js} +16 -22
  45. package/dist/schema/git-tokens.d.ts +256 -0
  46. package/{src/schema/git-tokens.ts → dist/schema/git-tokens.js} +16 -39
  47. package/dist/schema/grants.d.ts +211 -0
  48. package/dist/schema/grants.js +30 -0
  49. package/dist/schema/index.d.ts +25 -0
  50. package/dist/schema/index.js +25 -0
  51. package/dist/schema/messages.d.ts +414 -0
  52. package/dist/schema/messages.js +82 -0
  53. package/dist/schema/oauth-clients.d.ts +246 -0
  54. package/{src/schema/oauth-clients.ts → dist/schema/oauth-clients.js} +8 -14
  55. package/dist/schema/offerings.d.ts +160 -0
  56. package/dist/schema/offerings.js +24 -0
  57. package/dist/schema/principals.d.ts +128 -0
  58. package/dist/schema/principals.js +23 -0
  59. package/dist/schema/providers.d.ts +237 -0
  60. package/dist/schema/providers.js +22 -0
  61. package/dist/schema/roles.d.ts +242 -0
  62. package/dist/schema/roles.js +37 -0
  63. package/dist/schema/session-assets.d.ts +92 -0
  64. package/dist/schema/session-assets.js +45 -0
  65. package/dist/schema/sessions.d.ts +143 -0
  66. package/dist/schema/sessions.js +29 -0
  67. package/dist/schema/sidecar-allocation.d.ts +406 -0
  68. package/dist/schema/sidecar-allocation.js +57 -0
  69. package/dist/schema/sidecar.d.ts +145 -0
  70. package/dist/schema/sidecar.js +28 -0
  71. package/dist/schema/signal-correlations.d.ts +177 -0
  72. package/dist/schema/signal-correlations.js +31 -0
  73. package/dist/schema/tenants.d.ts +235 -0
  74. package/{src/schema/tenants.ts → dist/schema/tenants.js} +10 -27
  75. package/dist/schema/wallets.d.ts +354 -0
  76. package/dist/schema/wallets.js +43 -0
  77. package/dist/schema/workflow-definitions.d.ts +371 -0
  78. package/dist/schema/workflow-definitions.js +97 -0
  79. package/dist/schema/workflow-run-dispatch.d.ts +328 -0
  80. package/dist/schema/workflow-run-dispatch.js +56 -0
  81. package/dist/schema/workflow-run-execution.d.ts +126 -0
  82. package/dist/schema/workflow-run-execution.js +48 -0
  83. package/dist/schema/workflow-run-launch-spec.d.ts +200 -0
  84. package/dist/schema/workflow-run-launch-spec.js +26 -0
  85. package/dist/schema/workflow-run.d.ts +230 -0
  86. package/dist/schema/workflow-run.js +102 -0
  87. package/dist/sidecar-allocation-store.d.ts +171 -0
  88. package/dist/sidecar-allocation-store.js +512 -0
  89. package/dist/signal-correlation-store.d.ts +36 -0
  90. package/dist/signal-correlation-store.js +63 -0
  91. package/dist/tenant-hierarchy.d.ts +23 -0
  92. package/dist/tenant-hierarchy.js +60 -0
  93. package/dist/workflow-definition-store.d.ts +55 -0
  94. package/dist/workflow-definition-store.js +93 -0
  95. package/dist/workflow-run-dispatch-store.d.ts +80 -0
  96. package/dist/workflow-run-dispatch-store.js +298 -0
  97. package/dist/workflow-run-launch-spec-store.d.ts +13 -0
  98. package/dist/workflow-run-launch-spec-store.js +30 -0
  99. package/dist/workflow-run-store.d.ts +54 -0
  100. package/dist/workflow-run-store.js +85 -0
  101. package/migrations/0029_loose_warlock.sql +1 -0
  102. package/migrations/0030_session_asset_audit_split.sql +5 -0
  103. package/migrations/0031_gigantic_nicolaos.sql +68 -0
  104. package/migrations/0032_lethal_misty_knight.sql +1 -0
  105. package/migrations/0033_old_payback.sql +1 -0
  106. package/migrations/0034_sleepy_songbird.sql +11 -0
  107. package/migrations/0035_violet_giant_man.sql +3 -0
  108. package/migrations/0036_sharp_the_executioner.sql +2 -0
  109. package/migrations/0037_credential_use_backfill.sql +39 -0
  110. package/migrations/0038_chilly_blacklash.sql +37 -0
  111. package/migrations/0039_quick_carnage.sql +2 -0
  112. package/migrations/0040_reshape_approval_origin.sql +24 -0
  113. package/migrations/0041_make_approval_timeout_at_nullable.sql +1 -0
  114. package/migrations/0042_youthful_mantis.sql +2 -0
  115. package/migrations/0043_signal_correlation_deployment_fk.sql +1 -0
  116. package/migrations/0044_model_offering_quirks.sql +1 -0
  117. package/migrations/0045_create_workflow_run.sql +13 -0
  118. package/migrations/0046_approval_signal_correlation_run_fk.sql +2 -0
  119. package/migrations/0047_create_workflow_definition.sql +30 -0
  120. package/migrations/0048_workflow_definition_origin_agent_id.sql +2 -0
  121. package/migrations/0049_curly_omega_flight.sql +2 -0
  122. package/migrations/0050_late_crystal.sql +10 -0
  123. package/migrations/0051_funny_madelyne_pryor.sql +1 -0
  124. package/migrations/0052_drop_inference_turn_instance_fk.sql +1 -0
  125. package/migrations/0053_session_mail_session_id_index.sql +1 -0
  126. package/migrations/0054_rekey_instance_grants_to_workflow_run.sql +10 -0
  127. package/migrations/0055_backfill_anchor_workflow_runs.sql +69 -0
  128. package/migrations/0056_repoint_deployment_fks_to_anchor_run.sql +32 -0
  129. package/migrations/0057_drop_workflow_deployment_projection.sql +22 -0
  130. package/migrations/0058_repoint_offering_fk_to_definition.sql +41 -0
  131. package/migrations/0059_repoint_transaction_fk_to_run.sql +10 -0
  132. package/migrations/0060_drop_session_mail_instance_fk.sql +6 -0
  133. package/migrations/0061_drop_session_asset_instance_fk.sql +7 -0
  134. package/migrations/0062_drop_agent_asset_table.sql +11 -0
  135. package/migrations/0063_repoint_agent_role_fk_to_definition.sql +39 -0
  136. package/migrations/0064_repoint_agent_session_fk_to_definition.sql +47 -0
  137. package/migrations/0065_add_workflow_definition_model_requirements.sql +37 -0
  138. package/migrations/0066_rekey_agent_definition_principals_to_workflow.sql +27 -0
  139. package/migrations/0067_add_workflow_definition_kind.sql +10 -0
  140. package/migrations/0068_drop_agent_tables_and_origin_agent_id.sql +31 -0
  141. package/migrations/0069_drop_workflow_definition_kind.sql +10 -0
  142. package/migrations/0070_flashy_proteus.sql +13 -0
  143. package/migrations/0072_add_workflow_definition_credential_bindings.sql +1 -0
  144. package/migrations/0073_grant_target_exactly_one_check.sql +13 -0
  145. package/migrations/0074_add_provider_api_base_url.sql +1 -0
  146. package/migrations/0075_workflow_run_launch_spec.sql +17 -0
  147. package/migrations/0076_sidecar_allocation.sql +40 -0
  148. package/migrations/0077_workflow_run_dispatch.sql +29 -0
  149. package/migrations/0078_workflow_run_dispatch_kind.sql +2 -0
  150. package/migrations/0079_rename_workflow_run_deployment_id_to_anchor_run_id.sql +4 -0
  151. package/migrations/0080_rename_correlation_approval_deployment_id_to_anchor_run_id.sql +9 -0
  152. package/migrations/0081_workflow_definition_content_hash_and_approved_wire_hash.sql +4 -0
  153. package/migrations/0082_blue_black_queen.sql +1 -0
  154. package/migrations/0083_replace_launch_spec_snapshot_with_frozen_bundle.sql +3 -0
  155. package/migrations/0084_delete_orphaned_credential_grants.sql +22 -0
  156. package/migrations/meta/0029_snapshot.json +2664 -0
  157. package/migrations/meta/0030_snapshot.json +2670 -0
  158. package/migrations/meta/0031_snapshot.json +3100 -0
  159. package/migrations/meta/0032_snapshot.json +3106 -0
  160. package/migrations/meta/0033_snapshot.json +3112 -0
  161. package/migrations/meta/0034_snapshot.json +3198 -0
  162. package/migrations/meta/0035_snapshot.json +3225 -0
  163. package/migrations/meta/0036_snapshot.json +3237 -0
  164. package/migrations/meta/0037_snapshot.json +3237 -0
  165. package/migrations/meta/0038_snapshot.json +3470 -0
  166. package/migrations/meta/0039_snapshot.json +3470 -0
  167. package/migrations/meta/0040_snapshot.json +3489 -0
  168. package/migrations/meta/0041_snapshot.json +3489 -0
  169. package/migrations/meta/0042_snapshot.json +3489 -0
  170. package/migrations/meta/0043_snapshot.json +3498 -0
  171. package/migrations/meta/0044_snapshot.json +3504 -0
  172. package/migrations/meta/0045_snapshot.json +3589 -0
  173. package/migrations/meta/0046_snapshot.json +3607 -0
  174. package/migrations/meta/0047_snapshot.json +3832 -0
  175. package/migrations/meta/0048_snapshot.json +3853 -0
  176. package/migrations/meta/0049_snapshot.json +3854 -0
  177. package/migrations/meta/0050_snapshot.json +3924 -0
  178. package/migrations/meta/0051_snapshot.json +3940 -0
  179. package/migrations/meta/0052_snapshot.json +3931 -0
  180. package/migrations/meta/0053_snapshot.json +3952 -0
  181. package/migrations/meta/0054_snapshot.json +3952 -0
  182. package/migrations/meta/0055_snapshot.json +3952 -0
  183. package/migrations/meta/0056_snapshot.json +3952 -0
  184. package/migrations/meta/0057_snapshot.json +3839 -0
  185. package/migrations/meta/0058_snapshot.json +3839 -0
  186. package/migrations/meta/0059_snapshot.json +3839 -0
  187. package/migrations/meta/0060_snapshot.json +3830 -0
  188. package/migrations/meta/0061_snapshot.json +3821 -0
  189. package/migrations/meta/0062_snapshot.json +3723 -0
  190. package/migrations/meta/0063_snapshot.json +3723 -0
  191. package/migrations/meta/0064_snapshot.json +3723 -0
  192. package/migrations/meta/0065_snapshot.json +3729 -0
  193. package/migrations/meta/0066_snapshot.json +3729 -0
  194. package/migrations/meta/0067_snapshot.json +3736 -0
  195. package/migrations/meta/0068_snapshot.json +3347 -0
  196. package/migrations/meta/0069_snapshot.json +3340 -0
  197. package/migrations/meta/0070_snapshot.json +3444 -0
  198. package/migrations/meta/0072_snapshot.json +3450 -0
  199. package/migrations/meta/0073_snapshot.json +3455 -0
  200. package/migrations/meta/0074_snapshot.json +3461 -0
  201. package/migrations/meta/0075_snapshot.json +3567 -0
  202. package/migrations/meta/0076_snapshot.json +3851 -0
  203. package/migrations/meta/0077_snapshot.json +4067 -0
  204. package/migrations/meta/0078_snapshot.json +4078 -0
  205. package/migrations/meta/0079_snapshot.json +4078 -0
  206. package/migrations/meta/0080_snapshot.json +4078 -0
  207. package/migrations/meta/0081_snapshot.json +4096 -0
  208. package/migrations/meta/0082_snapshot.json +4102 -0
  209. package/migrations/meta/0083_snapshot.json +4096 -0
  210. package/migrations/meta/0084_snapshot.json +4096 -0
  211. package/migrations/meta/_journal.json +385 -0
  212. package/package.json +25 -11
  213. package/drizzle.config.ts +0 -23
  214. package/src/client.ts +0 -24
  215. package/src/config.ts +0 -19
  216. package/src/connection.ts +0 -27
  217. package/src/credential-resolution.ts +0 -378
  218. package/src/grant-store.ts +0 -51
  219. package/src/index.ts +0 -32
  220. package/src/migrate.test.ts +0 -35
  221. package/src/migrate.ts +0 -168
  222. package/src/parse-row.test.ts +0 -113
  223. package/src/parse-row.ts +0 -185
  224. package/src/schema/agent-assets.ts +0 -21
  225. package/src/schema/agents.ts +0 -49
  226. package/src/schema/auth.ts +0 -51
  227. package/src/schema/grants.ts +0 -26
  228. package/src/schema/index.ts +0 -19
  229. package/src/schema/instances.ts +0 -36
  230. package/src/schema/messages.ts +0 -108
  231. package/src/schema/offerings.ts +0 -20
  232. package/src/schema/principals.ts +0 -28
  233. package/src/schema/providers.ts +0 -23
  234. package/src/schema/roles.ts +0 -51
  235. package/src/schema/session-assets.ts +0 -49
  236. package/src/schema/sessions.ts +0 -26
  237. package/src/schema/sidecar.ts +0 -14
  238. package/src/schema/wallets.ts +0 -44
  239. package/src/tenant-hierarchy.ts +0 -34
  240. package/tsconfig.json +0 -4
  241. package/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,3100 @@
1
+ {
2
+ "id": "b6c66169-b785-456c-b218-1fc5c3d51add",
3
+ "prevId": "2637eb27-5f72-4079-88dd-1f1d6ab26395",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_agent_id_fk": {
557
+ "name": "agent_role_agent_id_agent_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "tableTo": "agent",
560
+ "columnsFrom": ["agent_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "agent_role_agent_id_role_id_pk": {
577
+ "name": "agent_role_agent_id_role_id_pk",
578
+ "columns": ["agent_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.principal_role": {
587
+ "name": "principal_role",
588
+ "schema": "",
589
+ "columns": {
590
+ "principal_id": {
591
+ "name": "principal_id",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "role_id": {
597
+ "name": "role_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "principal_role_principal_id_principal_id_fk": {
613
+ "name": "principal_role_principal_id_principal_id_fk",
614
+ "tableFrom": "principal_role",
615
+ "tableTo": "principal",
616
+ "columnsFrom": ["principal_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "tableTo": "role",
625
+ "columnsFrom": ["role_id"],
626
+ "columnsTo": ["id"],
627
+ "onDelete": "cascade",
628
+ "onUpdate": "no action"
629
+ }
630
+ },
631
+ "compositePrimaryKeys": {
632
+ "principal_role_principal_id_role_id_pk": {
633
+ "name": "principal_role_principal_id_role_id_pk",
634
+ "columns": ["principal_id", "role_id"]
635
+ }
636
+ },
637
+ "uniqueConstraints": {},
638
+ "policies": {},
639
+ "checkConstraints": {},
640
+ "isRLSEnabled": false
641
+ },
642
+ "public.role": {
643
+ "name": "role",
644
+ "schema": "",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "name": {
659
+ "name": "name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "is_system": {
671
+ "name": "is_system",
672
+ "type": "boolean",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": false
676
+ },
677
+ "created_at": {
678
+ "name": "created_at",
679
+ "type": "timestamp",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "default": "now()"
683
+ },
684
+ "updated_at": {
685
+ "name": "updated_at",
686
+ "type": "timestamp",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "default": "now()"
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {
694
+ "role_tenant_id_tenant_id_fk": {
695
+ "name": "role_tenant_id_tenant_id_fk",
696
+ "tableFrom": "role",
697
+ "tableTo": "tenant",
698
+ "columnsFrom": ["tenant_id"],
699
+ "columnsTo": ["id"],
700
+ "onDelete": "cascade",
701
+ "onUpdate": "no action"
702
+ }
703
+ },
704
+ "compositePrimaryKeys": {},
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.grant": {
711
+ "name": "grant",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true
719
+ },
720
+ "tenant_id": {
721
+ "name": "tenant_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "role_id": {
727
+ "name": "role_id",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "principal_id": {
733
+ "name": "principal_id",
734
+ "type": "text",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "resource": {
739
+ "name": "resource",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "action": {
745
+ "name": "action",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "effect": {
751
+ "name": "effect",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "conditions": {
757
+ "name": "conditions",
758
+ "type": "jsonb",
759
+ "primaryKey": false,
760
+ "notNull": false
761
+ },
762
+ "origin": {
763
+ "name": "origin",
764
+ "type": "text",
765
+ "primaryKey": false,
766
+ "notNull": true
767
+ },
768
+ "expires_at": {
769
+ "name": "expires_at",
770
+ "type": "timestamp",
771
+ "primaryKey": false,
772
+ "notNull": false
773
+ },
774
+ "created_at": {
775
+ "name": "created_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ },
781
+ "updated_at": {
782
+ "name": "updated_at",
783
+ "type": "timestamp",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "now()"
787
+ }
788
+ },
789
+ "indexes": {},
790
+ "foreignKeys": {
791
+ "grant_tenant_id_tenant_id_fk": {
792
+ "name": "grant_tenant_id_tenant_id_fk",
793
+ "tableFrom": "grant",
794
+ "tableTo": "tenant",
795
+ "columnsFrom": ["tenant_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "tableTo": "role",
804
+ "columnsFrom": ["role_id"],
805
+ "columnsTo": ["id"],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "tableTo": "principal",
813
+ "columnsFrom": ["principal_id"],
814
+ "columnsTo": ["id"],
815
+ "onDelete": "cascade",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {},
823
+ "isRLSEnabled": false
824
+ },
825
+ "public.agent": {
826
+ "name": "agent",
827
+ "schema": "",
828
+ "columns": {
829
+ "id": {
830
+ "name": "id",
831
+ "type": "text",
832
+ "primaryKey": true,
833
+ "notNull": true
834
+ },
835
+ "tenant_id": {
836
+ "name": "tenant_id",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "creator_principal_id": {
842
+ "name": "creator_principal_id",
843
+ "type": "text",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "name": {
848
+ "name": "name",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "description": {
854
+ "name": "description",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": false
858
+ },
859
+ "system_prompt": {
860
+ "name": "system_prompt",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": false
864
+ },
865
+ "context_config": {
866
+ "name": "context_config",
867
+ "type": "jsonb",
868
+ "primaryKey": false,
869
+ "notNull": false
870
+ },
871
+ "initial_state": {
872
+ "name": "initial_state",
873
+ "type": "jsonb",
874
+ "primaryKey": false,
875
+ "notNull": false
876
+ },
877
+ "model_config": {
878
+ "name": "model_config",
879
+ "type": "jsonb",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "capabilities": {
884
+ "name": "capabilities",
885
+ "type": "jsonb",
886
+ "primaryKey": false,
887
+ "notNull": false
888
+ },
889
+ "credential_requirements": {
890
+ "name": "credential_requirements",
891
+ "type": "jsonb",
892
+ "primaryKey": false,
893
+ "notNull": false
894
+ },
895
+ "tool_packages": {
896
+ "name": "tool_packages",
897
+ "type": "jsonb",
898
+ "primaryKey": false,
899
+ "notNull": true,
900
+ "default": "'[]'::jsonb"
901
+ },
902
+ "grant_requirements": {
903
+ "name": "grant_requirements",
904
+ "type": "jsonb",
905
+ "primaryKey": false,
906
+ "notNull": false
907
+ },
908
+ "current_version": {
909
+ "name": "current_version",
910
+ "type": "text",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "default": "'1'"
914
+ },
915
+ "status": {
916
+ "name": "status",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "default": "'deployed'"
921
+ },
922
+ "created_at": {
923
+ "name": "created_at",
924
+ "type": "timestamp",
925
+ "primaryKey": false,
926
+ "notNull": true,
927
+ "default": "now()"
928
+ },
929
+ "updated_at": {
930
+ "name": "updated_at",
931
+ "type": "timestamp",
932
+ "primaryKey": false,
933
+ "notNull": true,
934
+ "default": "now()"
935
+ }
936
+ },
937
+ "indexes": {},
938
+ "foreignKeys": {
939
+ "agent_tenant_id_tenant_id_fk": {
940
+ "name": "agent_tenant_id_tenant_id_fk",
941
+ "tableFrom": "agent",
942
+ "tableTo": "tenant",
943
+ "columnsFrom": ["tenant_id"],
944
+ "columnsTo": ["id"],
945
+ "onDelete": "cascade",
946
+ "onUpdate": "no action"
947
+ },
948
+ "agent_creator_principal_id_principal_id_fk": {
949
+ "name": "agent_creator_principal_id_principal_id_fk",
950
+ "tableFrom": "agent",
951
+ "tableTo": "principal",
952
+ "columnsFrom": ["creator_principal_id"],
953
+ "columnsTo": ["id"],
954
+ "onDelete": "no action",
955
+ "onUpdate": "no action"
956
+ }
957
+ },
958
+ "compositePrimaryKeys": {},
959
+ "uniqueConstraints": {},
960
+ "policies": {},
961
+ "checkConstraints": {},
962
+ "isRLSEnabled": false
963
+ },
964
+ "public.agent_version": {
965
+ "name": "agent_version",
966
+ "schema": "",
967
+ "columns": {
968
+ "id": {
969
+ "name": "id",
970
+ "type": "text",
971
+ "primaryKey": true,
972
+ "notNull": true
973
+ },
974
+ "agent_id": {
975
+ "name": "agent_id",
976
+ "type": "text",
977
+ "primaryKey": false,
978
+ "notNull": true
979
+ },
980
+ "version": {
981
+ "name": "version",
982
+ "type": "text",
983
+ "primaryKey": false,
984
+ "notNull": true
985
+ },
986
+ "status": {
987
+ "name": "status",
988
+ "type": "text",
989
+ "primaryKey": false,
990
+ "notNull": true,
991
+ "default": "'active'"
992
+ },
993
+ "created_at": {
994
+ "name": "created_at",
995
+ "type": "timestamp",
996
+ "primaryKey": false,
997
+ "notNull": true,
998
+ "default": "now()"
999
+ }
1000
+ },
1001
+ "indexes": {},
1002
+ "foreignKeys": {
1003
+ "agent_version_agent_id_agent_id_fk": {
1004
+ "name": "agent_version_agent_id_agent_id_fk",
1005
+ "tableFrom": "agent_version",
1006
+ "tableTo": "agent",
1007
+ "columnsFrom": ["agent_id"],
1008
+ "columnsTo": ["id"],
1009
+ "onDelete": "cascade",
1010
+ "onUpdate": "no action"
1011
+ }
1012
+ },
1013
+ "compositePrimaryKeys": {},
1014
+ "uniqueConstraints": {},
1015
+ "policies": {},
1016
+ "checkConstraints": {},
1017
+ "isRLSEnabled": false
1018
+ },
1019
+ "public.provider": {
1020
+ "name": "provider",
1021
+ "schema": "",
1022
+ "columns": {
1023
+ "id": {
1024
+ "name": "id",
1025
+ "type": "text",
1026
+ "primaryKey": true,
1027
+ "notNull": true
1028
+ },
1029
+ "tenant_id": {
1030
+ "name": "tenant_id",
1031
+ "type": "text",
1032
+ "primaryKey": false,
1033
+ "notNull": true
1034
+ },
1035
+ "name": {
1036
+ "name": "name",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true
1040
+ },
1041
+ "plugin": {
1042
+ "name": "plugin",
1043
+ "type": "text",
1044
+ "primaryKey": false,
1045
+ "notNull": true
1046
+ },
1047
+ "authorization_url": {
1048
+ "name": "authorization_url",
1049
+ "type": "text",
1050
+ "primaryKey": false,
1051
+ "notNull": false
1052
+ },
1053
+ "token_url": {
1054
+ "name": "token_url",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": false
1058
+ },
1059
+ "user_info_url": {
1060
+ "name": "user_info_url",
1061
+ "type": "text",
1062
+ "primaryKey": false,
1063
+ "notNull": false
1064
+ },
1065
+ "scopes": {
1066
+ "name": "scopes",
1067
+ "type": "text[]",
1068
+ "primaryKey": false,
1069
+ "notNull": false
1070
+ },
1071
+ "metadata": {
1072
+ "name": "metadata",
1073
+ "type": "jsonb",
1074
+ "primaryKey": false,
1075
+ "notNull": false
1076
+ },
1077
+ "created_at": {
1078
+ "name": "created_at",
1079
+ "type": "timestamp",
1080
+ "primaryKey": false,
1081
+ "notNull": true,
1082
+ "default": "now()"
1083
+ },
1084
+ "updated_at": {
1085
+ "name": "updated_at",
1086
+ "type": "timestamp",
1087
+ "primaryKey": false,
1088
+ "notNull": true,
1089
+ "default": "now()"
1090
+ }
1091
+ },
1092
+ "indexes": {},
1093
+ "foreignKeys": {
1094
+ "provider_tenant_id_tenant_id_fk": {
1095
+ "name": "provider_tenant_id_tenant_id_fk",
1096
+ "tableFrom": "provider",
1097
+ "tableTo": "tenant",
1098
+ "columnsFrom": ["tenant_id"],
1099
+ "columnsTo": ["id"],
1100
+ "onDelete": "cascade",
1101
+ "onUpdate": "no action"
1102
+ }
1103
+ },
1104
+ "compositePrimaryKeys": {},
1105
+ "uniqueConstraints": {
1106
+ "provider_tenant_name": {
1107
+ "name": "provider_tenant_name",
1108
+ "nullsNotDistinct": false,
1109
+ "columns": ["tenant_id", "name"]
1110
+ }
1111
+ },
1112
+ "policies": {},
1113
+ "checkConstraints": {},
1114
+ "isRLSEnabled": false
1115
+ },
1116
+ "public.oauth_client": {
1117
+ "name": "oauth_client",
1118
+ "schema": "",
1119
+ "columns": {
1120
+ "id": {
1121
+ "name": "id",
1122
+ "type": "text",
1123
+ "primaryKey": true,
1124
+ "notNull": true
1125
+ },
1126
+ "tenant_id": {
1127
+ "name": "tenant_id",
1128
+ "type": "text",
1129
+ "primaryKey": false,
1130
+ "notNull": true
1131
+ },
1132
+ "provider_id": {
1133
+ "name": "provider_id",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": true
1137
+ },
1138
+ "name": {
1139
+ "name": "name",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": true
1143
+ },
1144
+ "client_id": {
1145
+ "name": "client_id",
1146
+ "type": "text",
1147
+ "primaryKey": false,
1148
+ "notNull": true
1149
+ },
1150
+ "client_secret": {
1151
+ "name": "client_secret",
1152
+ "type": "text",
1153
+ "primaryKey": false,
1154
+ "notNull": true
1155
+ },
1156
+ "redirect_uris": {
1157
+ "name": "redirect_uris",
1158
+ "type": "text[]",
1159
+ "primaryKey": false,
1160
+ "notNull": false
1161
+ },
1162
+ "default_scopes": {
1163
+ "name": "default_scopes",
1164
+ "type": "text[]",
1165
+ "primaryKey": false,
1166
+ "notNull": false
1167
+ },
1168
+ "metadata": {
1169
+ "name": "metadata",
1170
+ "type": "jsonb",
1171
+ "primaryKey": false,
1172
+ "notNull": false
1173
+ },
1174
+ "created_at": {
1175
+ "name": "created_at",
1176
+ "type": "timestamp",
1177
+ "primaryKey": false,
1178
+ "notNull": true,
1179
+ "default": "now()"
1180
+ },
1181
+ "updated_at": {
1182
+ "name": "updated_at",
1183
+ "type": "timestamp",
1184
+ "primaryKey": false,
1185
+ "notNull": true,
1186
+ "default": "now()"
1187
+ }
1188
+ },
1189
+ "indexes": {},
1190
+ "foreignKeys": {
1191
+ "oauth_client_tenant_id_tenant_id_fk": {
1192
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1193
+ "tableFrom": "oauth_client",
1194
+ "tableTo": "tenant",
1195
+ "columnsFrom": ["tenant_id"],
1196
+ "columnsTo": ["id"],
1197
+ "onDelete": "cascade",
1198
+ "onUpdate": "no action"
1199
+ },
1200
+ "oauth_client_provider_id_provider_id_fk": {
1201
+ "name": "oauth_client_provider_id_provider_id_fk",
1202
+ "tableFrom": "oauth_client",
1203
+ "tableTo": "provider",
1204
+ "columnsFrom": ["provider_id"],
1205
+ "columnsTo": ["id"],
1206
+ "onDelete": "cascade",
1207
+ "onUpdate": "no action"
1208
+ }
1209
+ },
1210
+ "compositePrimaryKeys": {},
1211
+ "uniqueConstraints": {
1212
+ "oauth_client_tenant_provider": {
1213
+ "name": "oauth_client_tenant_provider",
1214
+ "nullsNotDistinct": false,
1215
+ "columns": ["tenant_id", "provider_id"]
1216
+ }
1217
+ },
1218
+ "policies": {},
1219
+ "checkConstraints": {},
1220
+ "isRLSEnabled": false
1221
+ },
1222
+ "public.credential": {
1223
+ "name": "credential",
1224
+ "schema": "",
1225
+ "columns": {
1226
+ "id": {
1227
+ "name": "id",
1228
+ "type": "text",
1229
+ "primaryKey": true,
1230
+ "notNull": true
1231
+ },
1232
+ "tenant_id": {
1233
+ "name": "tenant_id",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true
1237
+ },
1238
+ "principal_id": {
1239
+ "name": "principal_id",
1240
+ "type": "text",
1241
+ "primaryKey": false,
1242
+ "notNull": false
1243
+ },
1244
+ "provider_id": {
1245
+ "name": "provider_id",
1246
+ "type": "text",
1247
+ "primaryKey": false,
1248
+ "notNull": true
1249
+ },
1250
+ "oauth_client_id": {
1251
+ "name": "oauth_client_id",
1252
+ "type": "text",
1253
+ "primaryKey": false,
1254
+ "notNull": false
1255
+ },
1256
+ "name": {
1257
+ "name": "name",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": true
1261
+ },
1262
+ "type": {
1263
+ "name": "type",
1264
+ "type": "text",
1265
+ "primaryKey": false,
1266
+ "notNull": true
1267
+ },
1268
+ "description": {
1269
+ "name": "description",
1270
+ "type": "text",
1271
+ "primaryKey": false,
1272
+ "notNull": false
1273
+ },
1274
+ "secret": {
1275
+ "name": "secret",
1276
+ "type": "text",
1277
+ "primaryKey": false,
1278
+ "notNull": true
1279
+ },
1280
+ "refresh_secret": {
1281
+ "name": "refresh_secret",
1282
+ "type": "text",
1283
+ "primaryKey": false,
1284
+ "notNull": false
1285
+ },
1286
+ "scopes": {
1287
+ "name": "scopes",
1288
+ "type": "text[]",
1289
+ "primaryKey": false,
1290
+ "notNull": false
1291
+ },
1292
+ "expires_at": {
1293
+ "name": "expires_at",
1294
+ "type": "timestamp",
1295
+ "primaryKey": false,
1296
+ "notNull": false
1297
+ },
1298
+ "status": {
1299
+ "name": "status",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": true,
1303
+ "default": "'active'"
1304
+ },
1305
+ "metadata": {
1306
+ "name": "metadata",
1307
+ "type": "jsonb",
1308
+ "primaryKey": false,
1309
+ "notNull": false
1310
+ },
1311
+ "created_at": {
1312
+ "name": "created_at",
1313
+ "type": "timestamp",
1314
+ "primaryKey": false,
1315
+ "notNull": true,
1316
+ "default": "now()"
1317
+ },
1318
+ "updated_at": {
1319
+ "name": "updated_at",
1320
+ "type": "timestamp",
1321
+ "primaryKey": false,
1322
+ "notNull": true,
1323
+ "default": "now()"
1324
+ }
1325
+ },
1326
+ "indexes": {},
1327
+ "foreignKeys": {
1328
+ "credential_tenant_id_tenant_id_fk": {
1329
+ "name": "credential_tenant_id_tenant_id_fk",
1330
+ "tableFrom": "credential",
1331
+ "tableTo": "tenant",
1332
+ "columnsFrom": ["tenant_id"],
1333
+ "columnsTo": ["id"],
1334
+ "onDelete": "cascade",
1335
+ "onUpdate": "no action"
1336
+ },
1337
+ "credential_principal_id_principal_id_fk": {
1338
+ "name": "credential_principal_id_principal_id_fk",
1339
+ "tableFrom": "credential",
1340
+ "tableTo": "principal",
1341
+ "columnsFrom": ["principal_id"],
1342
+ "columnsTo": ["id"],
1343
+ "onDelete": "set null",
1344
+ "onUpdate": "no action"
1345
+ },
1346
+ "credential_provider_id_provider_id_fk": {
1347
+ "name": "credential_provider_id_provider_id_fk",
1348
+ "tableFrom": "credential",
1349
+ "tableTo": "provider",
1350
+ "columnsFrom": ["provider_id"],
1351
+ "columnsTo": ["id"],
1352
+ "onDelete": "cascade",
1353
+ "onUpdate": "no action"
1354
+ },
1355
+ "credential_oauth_client_id_oauth_client_id_fk": {
1356
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1357
+ "tableFrom": "credential",
1358
+ "tableTo": "oauth_client",
1359
+ "columnsFrom": ["oauth_client_id"],
1360
+ "columnsTo": ["id"],
1361
+ "onDelete": "set null",
1362
+ "onUpdate": "no action"
1363
+ }
1364
+ },
1365
+ "compositePrimaryKeys": {},
1366
+ "uniqueConstraints": {
1367
+ "credential_tenant_name": {
1368
+ "name": "credential_tenant_name",
1369
+ "nullsNotDistinct": false,
1370
+ "columns": ["tenant_id", "name"]
1371
+ }
1372
+ },
1373
+ "policies": {},
1374
+ "checkConstraints": {},
1375
+ "isRLSEnabled": false
1376
+ },
1377
+ "public.asset": {
1378
+ "name": "asset",
1379
+ "schema": "",
1380
+ "columns": {
1381
+ "id": {
1382
+ "name": "id",
1383
+ "type": "text",
1384
+ "primaryKey": true,
1385
+ "notNull": true
1386
+ },
1387
+ "tenant_id": {
1388
+ "name": "tenant_id",
1389
+ "type": "text",
1390
+ "primaryKey": false,
1391
+ "notNull": true
1392
+ },
1393
+ "kind": {
1394
+ "name": "kind",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": true
1398
+ },
1399
+ "name": {
1400
+ "name": "name",
1401
+ "type": "text",
1402
+ "primaryKey": false,
1403
+ "notNull": true
1404
+ },
1405
+ "display_name": {
1406
+ "name": "display_name",
1407
+ "type": "text",
1408
+ "primaryKey": false,
1409
+ "notNull": false
1410
+ },
1411
+ "creator_principal_id": {
1412
+ "name": "creator_principal_id",
1413
+ "type": "text",
1414
+ "primaryKey": false,
1415
+ "notNull": false
1416
+ },
1417
+ "created_at": {
1418
+ "name": "created_at",
1419
+ "type": "timestamp",
1420
+ "primaryKey": false,
1421
+ "notNull": true,
1422
+ "default": "now()"
1423
+ },
1424
+ "updated_at": {
1425
+ "name": "updated_at",
1426
+ "type": "timestamp",
1427
+ "primaryKey": false,
1428
+ "notNull": true,
1429
+ "default": "now()"
1430
+ }
1431
+ },
1432
+ "indexes": {},
1433
+ "foreignKeys": {
1434
+ "asset_tenant_id_tenant_id_fk": {
1435
+ "name": "asset_tenant_id_tenant_id_fk",
1436
+ "tableFrom": "asset",
1437
+ "tableTo": "tenant",
1438
+ "columnsFrom": ["tenant_id"],
1439
+ "columnsTo": ["id"],
1440
+ "onDelete": "cascade",
1441
+ "onUpdate": "no action"
1442
+ },
1443
+ "asset_creator_principal_id_principal_id_fk": {
1444
+ "name": "asset_creator_principal_id_principal_id_fk",
1445
+ "tableFrom": "asset",
1446
+ "tableTo": "principal",
1447
+ "columnsFrom": ["creator_principal_id"],
1448
+ "columnsTo": ["id"],
1449
+ "onDelete": "set null",
1450
+ "onUpdate": "no action"
1451
+ }
1452
+ },
1453
+ "compositePrimaryKeys": {},
1454
+ "uniqueConstraints": {
1455
+ "asset_tenant_kind_name": {
1456
+ "name": "asset_tenant_kind_name",
1457
+ "nullsNotDistinct": false,
1458
+ "columns": ["tenant_id", "kind", "name"]
1459
+ }
1460
+ },
1461
+ "policies": {},
1462
+ "checkConstraints": {},
1463
+ "isRLSEnabled": false
1464
+ },
1465
+ "public.agent_asset": {
1466
+ "name": "agent_asset",
1467
+ "schema": "",
1468
+ "columns": {
1469
+ "id": {
1470
+ "name": "id",
1471
+ "type": "text",
1472
+ "primaryKey": true,
1473
+ "notNull": true
1474
+ },
1475
+ "agent_id": {
1476
+ "name": "agent_id",
1477
+ "type": "text",
1478
+ "primaryKey": false,
1479
+ "notNull": true
1480
+ },
1481
+ "asset_id": {
1482
+ "name": "asset_id",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "ref": {
1488
+ "name": "ref",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": true
1492
+ },
1493
+ "access_mode": {
1494
+ "name": "access_mode",
1495
+ "type": "text",
1496
+ "primaryKey": false,
1497
+ "notNull": true,
1498
+ "default": "'read-only'"
1499
+ },
1500
+ "created_at": {
1501
+ "name": "created_at",
1502
+ "type": "timestamp",
1503
+ "primaryKey": false,
1504
+ "notNull": true,
1505
+ "default": "now()"
1506
+ }
1507
+ },
1508
+ "indexes": {},
1509
+ "foreignKeys": {
1510
+ "agent_asset_agent_id_agent_id_fk": {
1511
+ "name": "agent_asset_agent_id_agent_id_fk",
1512
+ "tableFrom": "agent_asset",
1513
+ "tableTo": "agent",
1514
+ "columnsFrom": ["agent_id"],
1515
+ "columnsTo": ["id"],
1516
+ "onDelete": "cascade",
1517
+ "onUpdate": "no action"
1518
+ },
1519
+ "agent_asset_asset_id_asset_id_fk": {
1520
+ "name": "agent_asset_asset_id_asset_id_fk",
1521
+ "tableFrom": "agent_asset",
1522
+ "tableTo": "asset",
1523
+ "columnsFrom": ["asset_id"],
1524
+ "columnsTo": ["id"],
1525
+ "onDelete": "cascade",
1526
+ "onUpdate": "no action"
1527
+ }
1528
+ },
1529
+ "compositePrimaryKeys": {},
1530
+ "uniqueConstraints": {
1531
+ "agent_asset_agent_asset": {
1532
+ "name": "agent_asset_agent_asset",
1533
+ "nullsNotDistinct": false,
1534
+ "columns": ["agent_id", "asset_id"]
1535
+ }
1536
+ },
1537
+ "policies": {},
1538
+ "checkConstraints": {},
1539
+ "isRLSEnabled": false
1540
+ },
1541
+ "public.transaction": {
1542
+ "name": "transaction",
1543
+ "schema": "",
1544
+ "columns": {
1545
+ "id": {
1546
+ "name": "id",
1547
+ "type": "text",
1548
+ "primaryKey": true,
1549
+ "notNull": true
1550
+ },
1551
+ "wallet_id": {
1552
+ "name": "wallet_id",
1553
+ "type": "text",
1554
+ "primaryKey": false,
1555
+ "notNull": true
1556
+ },
1557
+ "agent_id": {
1558
+ "name": "agent_id",
1559
+ "type": "text",
1560
+ "primaryKey": false,
1561
+ "notNull": false
1562
+ },
1563
+ "direction": {
1564
+ "name": "direction",
1565
+ "type": "text",
1566
+ "primaryKey": false,
1567
+ "notNull": true
1568
+ },
1569
+ "amount": {
1570
+ "name": "amount",
1571
+ "type": "text",
1572
+ "primaryKey": false,
1573
+ "notNull": true
1574
+ },
1575
+ "currency": {
1576
+ "name": "currency",
1577
+ "type": "text",
1578
+ "primaryKey": false,
1579
+ "notNull": true
1580
+ },
1581
+ "recipient_id": {
1582
+ "name": "recipient_id",
1583
+ "type": "text",
1584
+ "primaryKey": false,
1585
+ "notNull": false
1586
+ },
1587
+ "sender_id": {
1588
+ "name": "sender_id",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": false
1592
+ },
1593
+ "request_id": {
1594
+ "name": "request_id",
1595
+ "type": "text",
1596
+ "primaryKey": false,
1597
+ "notNull": false
1598
+ },
1599
+ "status": {
1600
+ "name": "status",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": true,
1604
+ "default": "'pending'"
1605
+ },
1606
+ "created_at": {
1607
+ "name": "created_at",
1608
+ "type": "timestamp",
1609
+ "primaryKey": false,
1610
+ "notNull": true,
1611
+ "default": "now()"
1612
+ }
1613
+ },
1614
+ "indexes": {},
1615
+ "foreignKeys": {
1616
+ "transaction_wallet_id_wallet_id_fk": {
1617
+ "name": "transaction_wallet_id_wallet_id_fk",
1618
+ "tableFrom": "transaction",
1619
+ "tableTo": "wallet",
1620
+ "columnsFrom": ["wallet_id"],
1621
+ "columnsTo": ["id"],
1622
+ "onDelete": "cascade",
1623
+ "onUpdate": "no action"
1624
+ },
1625
+ "transaction_agent_id_agent_id_fk": {
1626
+ "name": "transaction_agent_id_agent_id_fk",
1627
+ "tableFrom": "transaction",
1628
+ "tableTo": "agent",
1629
+ "columnsFrom": ["agent_id"],
1630
+ "columnsTo": ["id"],
1631
+ "onDelete": "set null",
1632
+ "onUpdate": "no action"
1633
+ }
1634
+ },
1635
+ "compositePrimaryKeys": {},
1636
+ "uniqueConstraints": {},
1637
+ "policies": {},
1638
+ "checkConstraints": {},
1639
+ "isRLSEnabled": false
1640
+ },
1641
+ "public.wallet": {
1642
+ "name": "wallet",
1643
+ "schema": "",
1644
+ "columns": {
1645
+ "id": {
1646
+ "name": "id",
1647
+ "type": "text",
1648
+ "primaryKey": true,
1649
+ "notNull": true
1650
+ },
1651
+ "tenant_id": {
1652
+ "name": "tenant_id",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": true
1656
+ },
1657
+ "name": {
1658
+ "name": "name",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true
1662
+ },
1663
+ "backend_type": {
1664
+ "name": "backend_type",
1665
+ "type": "text",
1666
+ "primaryKey": false,
1667
+ "notNull": true
1668
+ },
1669
+ "currency": {
1670
+ "name": "currency",
1671
+ "type": "text",
1672
+ "primaryKey": false,
1673
+ "notNull": true
1674
+ },
1675
+ "balance": {
1676
+ "name": "balance",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": true,
1680
+ "default": "'0'"
1681
+ },
1682
+ "config": {
1683
+ "name": "config",
1684
+ "type": "jsonb",
1685
+ "primaryKey": false,
1686
+ "notNull": false
1687
+ },
1688
+ "created_at": {
1689
+ "name": "created_at",
1690
+ "type": "timestamp",
1691
+ "primaryKey": false,
1692
+ "notNull": true,
1693
+ "default": "now()"
1694
+ },
1695
+ "updated_at": {
1696
+ "name": "updated_at",
1697
+ "type": "timestamp",
1698
+ "primaryKey": false,
1699
+ "notNull": true,
1700
+ "default": "now()"
1701
+ }
1702
+ },
1703
+ "indexes": {},
1704
+ "foreignKeys": {
1705
+ "wallet_tenant_id_tenant_id_fk": {
1706
+ "name": "wallet_tenant_id_tenant_id_fk",
1707
+ "tableFrom": "wallet",
1708
+ "tableTo": "tenant",
1709
+ "columnsFrom": ["tenant_id"],
1710
+ "columnsTo": ["id"],
1711
+ "onDelete": "cascade",
1712
+ "onUpdate": "no action"
1713
+ }
1714
+ },
1715
+ "compositePrimaryKeys": {},
1716
+ "uniqueConstraints": {},
1717
+ "policies": {},
1718
+ "checkConstraints": {},
1719
+ "isRLSEnabled": false
1720
+ },
1721
+ "public.offering": {
1722
+ "name": "offering",
1723
+ "schema": "",
1724
+ "columns": {
1725
+ "id": {
1726
+ "name": "id",
1727
+ "type": "text",
1728
+ "primaryKey": true,
1729
+ "notNull": true
1730
+ },
1731
+ "agent_id": {
1732
+ "name": "agent_id",
1733
+ "type": "text",
1734
+ "primaryKey": false,
1735
+ "notNull": true
1736
+ },
1737
+ "tenant_id": {
1738
+ "name": "tenant_id",
1739
+ "type": "text",
1740
+ "primaryKey": false,
1741
+ "notNull": true
1742
+ },
1743
+ "name": {
1744
+ "name": "name",
1745
+ "type": "text",
1746
+ "primaryKey": false,
1747
+ "notNull": true
1748
+ },
1749
+ "description": {
1750
+ "name": "description",
1751
+ "type": "text",
1752
+ "primaryKey": false,
1753
+ "notNull": false
1754
+ },
1755
+ "pricing": {
1756
+ "name": "pricing",
1757
+ "type": "jsonb",
1758
+ "primaryKey": false,
1759
+ "notNull": false
1760
+ },
1761
+ "schema": {
1762
+ "name": "schema",
1763
+ "type": "jsonb",
1764
+ "primaryKey": false,
1765
+ "notNull": false
1766
+ },
1767
+ "created_at": {
1768
+ "name": "created_at",
1769
+ "type": "timestamp",
1770
+ "primaryKey": false,
1771
+ "notNull": true,
1772
+ "default": "now()"
1773
+ },
1774
+ "updated_at": {
1775
+ "name": "updated_at",
1776
+ "type": "timestamp",
1777
+ "primaryKey": false,
1778
+ "notNull": true,
1779
+ "default": "now()"
1780
+ }
1781
+ },
1782
+ "indexes": {},
1783
+ "foreignKeys": {
1784
+ "offering_agent_id_agent_id_fk": {
1785
+ "name": "offering_agent_id_agent_id_fk",
1786
+ "tableFrom": "offering",
1787
+ "tableTo": "agent",
1788
+ "columnsFrom": ["agent_id"],
1789
+ "columnsTo": ["id"],
1790
+ "onDelete": "cascade",
1791
+ "onUpdate": "no action"
1792
+ },
1793
+ "offering_tenant_id_tenant_id_fk": {
1794
+ "name": "offering_tenant_id_tenant_id_fk",
1795
+ "tableFrom": "offering",
1796
+ "tableTo": "tenant",
1797
+ "columnsFrom": ["tenant_id"],
1798
+ "columnsTo": ["id"],
1799
+ "onDelete": "cascade",
1800
+ "onUpdate": "no action"
1801
+ }
1802
+ },
1803
+ "compositePrimaryKeys": {},
1804
+ "uniqueConstraints": {},
1805
+ "policies": {},
1806
+ "checkConstraints": {},
1807
+ "isRLSEnabled": false
1808
+ },
1809
+ "public.model": {
1810
+ "name": "model",
1811
+ "schema": "",
1812
+ "columns": {
1813
+ "id": {
1814
+ "name": "id",
1815
+ "type": "text",
1816
+ "primaryKey": true,
1817
+ "notNull": true
1818
+ },
1819
+ "tenant_id": {
1820
+ "name": "tenant_id",
1821
+ "type": "text",
1822
+ "primaryKey": false,
1823
+ "notNull": true
1824
+ },
1825
+ "canonical_name": {
1826
+ "name": "canonical_name",
1827
+ "type": "text",
1828
+ "primaryKey": false,
1829
+ "notNull": true
1830
+ },
1831
+ "display_name": {
1832
+ "name": "display_name",
1833
+ "type": "text",
1834
+ "primaryKey": false,
1835
+ "notNull": false
1836
+ },
1837
+ "description": {
1838
+ "name": "description",
1839
+ "type": "text",
1840
+ "primaryKey": false,
1841
+ "notNull": false
1842
+ },
1843
+ "disabled": {
1844
+ "name": "disabled",
1845
+ "type": "boolean",
1846
+ "primaryKey": false,
1847
+ "notNull": true,
1848
+ "default": false
1849
+ },
1850
+ "created_at": {
1851
+ "name": "created_at",
1852
+ "type": "timestamp",
1853
+ "primaryKey": false,
1854
+ "notNull": true,
1855
+ "default": "now()"
1856
+ },
1857
+ "updated_at": {
1858
+ "name": "updated_at",
1859
+ "type": "timestamp",
1860
+ "primaryKey": false,
1861
+ "notNull": true,
1862
+ "default": "now()"
1863
+ }
1864
+ },
1865
+ "indexes": {},
1866
+ "foreignKeys": {
1867
+ "model_tenant_id_tenant_id_fk": {
1868
+ "name": "model_tenant_id_tenant_id_fk",
1869
+ "tableFrom": "model",
1870
+ "tableTo": "tenant",
1871
+ "columnsFrom": ["tenant_id"],
1872
+ "columnsTo": ["id"],
1873
+ "onDelete": "cascade",
1874
+ "onUpdate": "no action"
1875
+ }
1876
+ },
1877
+ "compositePrimaryKeys": {},
1878
+ "uniqueConstraints": {
1879
+ "model_tenant_canonical_name": {
1880
+ "name": "model_tenant_canonical_name",
1881
+ "nullsNotDistinct": false,
1882
+ "columns": ["tenant_id", "canonical_name"]
1883
+ }
1884
+ },
1885
+ "policies": {},
1886
+ "checkConstraints": {},
1887
+ "isRLSEnabled": false
1888
+ },
1889
+ "public.model_offering": {
1890
+ "name": "model_offering",
1891
+ "schema": "",
1892
+ "columns": {
1893
+ "id": {
1894
+ "name": "id",
1895
+ "type": "text",
1896
+ "primaryKey": true,
1897
+ "notNull": true
1898
+ },
1899
+ "tenant_id": {
1900
+ "name": "tenant_id",
1901
+ "type": "text",
1902
+ "primaryKey": false,
1903
+ "notNull": true
1904
+ },
1905
+ "model_id": {
1906
+ "name": "model_id",
1907
+ "type": "text",
1908
+ "primaryKey": false,
1909
+ "notNull": true
1910
+ },
1911
+ "provider_id": {
1912
+ "name": "provider_id",
1913
+ "type": "text",
1914
+ "primaryKey": false,
1915
+ "notNull": true
1916
+ },
1917
+ "priority": {
1918
+ "name": "priority",
1919
+ "type": "integer",
1920
+ "primaryKey": false,
1921
+ "notNull": true
1922
+ },
1923
+ "deployment_tags": {
1924
+ "name": "deployment_tags",
1925
+ "type": "text[]",
1926
+ "primaryKey": false,
1927
+ "notNull": true,
1928
+ "default": "'{}'"
1929
+ },
1930
+ "capabilities": {
1931
+ "name": "capabilities",
1932
+ "type": "text[]",
1933
+ "primaryKey": false,
1934
+ "notNull": true,
1935
+ "default": "'{}'"
1936
+ },
1937
+ "disabled": {
1938
+ "name": "disabled",
1939
+ "type": "boolean",
1940
+ "primaryKey": false,
1941
+ "notNull": true,
1942
+ "default": false
1943
+ },
1944
+ "created_at": {
1945
+ "name": "created_at",
1946
+ "type": "timestamp",
1947
+ "primaryKey": false,
1948
+ "notNull": true,
1949
+ "default": "now()"
1950
+ },
1951
+ "updated_at": {
1952
+ "name": "updated_at",
1953
+ "type": "timestamp",
1954
+ "primaryKey": false,
1955
+ "notNull": true,
1956
+ "default": "now()"
1957
+ }
1958
+ },
1959
+ "indexes": {},
1960
+ "foreignKeys": {
1961
+ "model_offering_tenant_id_tenant_id_fk": {
1962
+ "name": "model_offering_tenant_id_tenant_id_fk",
1963
+ "tableFrom": "model_offering",
1964
+ "tableTo": "tenant",
1965
+ "columnsFrom": ["tenant_id"],
1966
+ "columnsTo": ["id"],
1967
+ "onDelete": "cascade",
1968
+ "onUpdate": "no action"
1969
+ },
1970
+ "model_offering_model_id_model_id_fk": {
1971
+ "name": "model_offering_model_id_model_id_fk",
1972
+ "tableFrom": "model_offering",
1973
+ "tableTo": "model",
1974
+ "columnsFrom": ["model_id"],
1975
+ "columnsTo": ["id"],
1976
+ "onDelete": "cascade",
1977
+ "onUpdate": "no action"
1978
+ },
1979
+ "model_offering_provider_id_model_provider_id_fk": {
1980
+ "name": "model_offering_provider_id_model_provider_id_fk",
1981
+ "tableFrom": "model_offering",
1982
+ "tableTo": "model_provider",
1983
+ "columnsFrom": ["provider_id"],
1984
+ "columnsTo": ["id"],
1985
+ "onDelete": "cascade",
1986
+ "onUpdate": "no action"
1987
+ }
1988
+ },
1989
+ "compositePrimaryKeys": {},
1990
+ "uniqueConstraints": {
1991
+ "model_offering_tenant_model_provider": {
1992
+ "name": "model_offering_tenant_model_provider",
1993
+ "nullsNotDistinct": false,
1994
+ "columns": ["tenant_id", "model_id", "provider_id"]
1995
+ }
1996
+ },
1997
+ "policies": {},
1998
+ "checkConstraints": {},
1999
+ "isRLSEnabled": false
2000
+ },
2001
+ "public.model_pricing": {
2002
+ "name": "model_pricing",
2003
+ "schema": "",
2004
+ "columns": {
2005
+ "id": {
2006
+ "name": "id",
2007
+ "type": "text",
2008
+ "primaryKey": true,
2009
+ "notNull": true
2010
+ },
2011
+ "tenant_id": {
2012
+ "name": "tenant_id",
2013
+ "type": "text",
2014
+ "primaryKey": false,
2015
+ "notNull": true
2016
+ },
2017
+ "offering_id": {
2018
+ "name": "offering_id",
2019
+ "type": "text",
2020
+ "primaryKey": false,
2021
+ "notNull": true
2022
+ },
2023
+ "currency": {
2024
+ "name": "currency",
2025
+ "type": "text",
2026
+ "primaryKey": false,
2027
+ "notNull": true
2028
+ },
2029
+ "input_token_price": {
2030
+ "name": "input_token_price",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": false
2034
+ },
2035
+ "output_token_price": {
2036
+ "name": "output_token_price",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": false
2040
+ },
2041
+ "cache_read_token_price": {
2042
+ "name": "cache_read_token_price",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": false
2046
+ },
2047
+ "cache_write_token_price": {
2048
+ "name": "cache_write_token_price",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": false
2052
+ },
2053
+ "thinking_token_price": {
2054
+ "name": "thinking_token_price",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false
2058
+ },
2059
+ "per_request_fee": {
2060
+ "name": "per_request_fee",
2061
+ "type": "text",
2062
+ "primaryKey": false,
2063
+ "notNull": false
2064
+ },
2065
+ "per_image_fee": {
2066
+ "name": "per_image_fee",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": false
2070
+ },
2071
+ "per_audio_fee": {
2072
+ "name": "per_audio_fee",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "effective_from": {
2078
+ "name": "effective_from",
2079
+ "type": "timestamp with time zone",
2080
+ "primaryKey": false,
2081
+ "notNull": true
2082
+ },
2083
+ "created_at": {
2084
+ "name": "created_at",
2085
+ "type": "timestamp with time zone",
2086
+ "primaryKey": false,
2087
+ "notNull": true,
2088
+ "default": "now()"
2089
+ }
2090
+ },
2091
+ "indexes": {},
2092
+ "foreignKeys": {
2093
+ "model_pricing_tenant_id_tenant_id_fk": {
2094
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2095
+ "tableFrom": "model_pricing",
2096
+ "tableTo": "tenant",
2097
+ "columnsFrom": ["tenant_id"],
2098
+ "columnsTo": ["id"],
2099
+ "onDelete": "cascade",
2100
+ "onUpdate": "no action"
2101
+ },
2102
+ "model_pricing_offering_id_model_offering_id_fk": {
2103
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2104
+ "tableFrom": "model_pricing",
2105
+ "tableTo": "model_offering",
2106
+ "columnsFrom": ["offering_id"],
2107
+ "columnsTo": ["id"],
2108
+ "onDelete": "cascade",
2109
+ "onUpdate": "no action"
2110
+ }
2111
+ },
2112
+ "compositePrimaryKeys": {},
2113
+ "uniqueConstraints": {
2114
+ "model_pricing_offering_currency_effective_from": {
2115
+ "name": "model_pricing_offering_currency_effective_from",
2116
+ "nullsNotDistinct": false,
2117
+ "columns": ["offering_id", "currency", "effective_from"]
2118
+ }
2119
+ },
2120
+ "policies": {},
2121
+ "checkConstraints": {},
2122
+ "isRLSEnabled": false
2123
+ },
2124
+ "public.model_provider": {
2125
+ "name": "model_provider",
2126
+ "schema": "",
2127
+ "columns": {
2128
+ "id": {
2129
+ "name": "id",
2130
+ "type": "text",
2131
+ "primaryKey": true,
2132
+ "notNull": true
2133
+ },
2134
+ "tenant_id": {
2135
+ "name": "tenant_id",
2136
+ "type": "text",
2137
+ "primaryKey": false,
2138
+ "notNull": true
2139
+ },
2140
+ "name": {
2141
+ "name": "name",
2142
+ "type": "text",
2143
+ "primaryKey": false,
2144
+ "notNull": true
2145
+ },
2146
+ "plugin": {
2147
+ "name": "plugin",
2148
+ "type": "text",
2149
+ "primaryKey": false,
2150
+ "notNull": true
2151
+ },
2152
+ "base_url": {
2153
+ "name": "base_url",
2154
+ "type": "text",
2155
+ "primaryKey": false,
2156
+ "notNull": true
2157
+ },
2158
+ "credential_id": {
2159
+ "name": "credential_id",
2160
+ "type": "text",
2161
+ "primaryKey": false,
2162
+ "notNull": false
2163
+ },
2164
+ "wallet_id": {
2165
+ "name": "wallet_id",
2166
+ "type": "text",
2167
+ "primaryKey": false,
2168
+ "notNull": false
2169
+ },
2170
+ "disabled": {
2171
+ "name": "disabled",
2172
+ "type": "boolean",
2173
+ "primaryKey": false,
2174
+ "notNull": true,
2175
+ "default": false
2176
+ },
2177
+ "created_at": {
2178
+ "name": "created_at",
2179
+ "type": "timestamp",
2180
+ "primaryKey": false,
2181
+ "notNull": true,
2182
+ "default": "now()"
2183
+ },
2184
+ "updated_at": {
2185
+ "name": "updated_at",
2186
+ "type": "timestamp",
2187
+ "primaryKey": false,
2188
+ "notNull": true,
2189
+ "default": "now()"
2190
+ }
2191
+ },
2192
+ "indexes": {},
2193
+ "foreignKeys": {
2194
+ "model_provider_tenant_id_tenant_id_fk": {
2195
+ "name": "model_provider_tenant_id_tenant_id_fk",
2196
+ "tableFrom": "model_provider",
2197
+ "tableTo": "tenant",
2198
+ "columnsFrom": ["tenant_id"],
2199
+ "columnsTo": ["id"],
2200
+ "onDelete": "cascade",
2201
+ "onUpdate": "no action"
2202
+ },
2203
+ "model_provider_credential_id_credential_id_fk": {
2204
+ "name": "model_provider_credential_id_credential_id_fk",
2205
+ "tableFrom": "model_provider",
2206
+ "tableTo": "credential",
2207
+ "columnsFrom": ["credential_id"],
2208
+ "columnsTo": ["id"],
2209
+ "onDelete": "restrict",
2210
+ "onUpdate": "no action"
2211
+ },
2212
+ "model_provider_wallet_id_wallet_id_fk": {
2213
+ "name": "model_provider_wallet_id_wallet_id_fk",
2214
+ "tableFrom": "model_provider",
2215
+ "tableTo": "wallet",
2216
+ "columnsFrom": ["wallet_id"],
2217
+ "columnsTo": ["id"],
2218
+ "onDelete": "restrict",
2219
+ "onUpdate": "no action"
2220
+ }
2221
+ },
2222
+ "compositePrimaryKeys": {},
2223
+ "uniqueConstraints": {
2224
+ "model_provider_tenant_name": {
2225
+ "name": "model_provider_tenant_name",
2226
+ "nullsNotDistinct": false,
2227
+ "columns": ["tenant_id", "name"]
2228
+ }
2229
+ },
2230
+ "policies": {},
2231
+ "checkConstraints": {
2232
+ "model_provider_auth_xor": {
2233
+ "name": "model_provider_auth_xor",
2234
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2235
+ }
2236
+ },
2237
+ "isRLSEnabled": false
2238
+ },
2239
+ "public.sidecar": {
2240
+ "name": "sidecar",
2241
+ "schema": "",
2242
+ "columns": {
2243
+ "id": {
2244
+ "name": "id",
2245
+ "type": "text",
2246
+ "primaryKey": true,
2247
+ "notNull": true
2248
+ },
2249
+ "url": {
2250
+ "name": "url",
2251
+ "type": "text",
2252
+ "primaryKey": false,
2253
+ "notNull": true
2254
+ },
2255
+ "status": {
2256
+ "name": "status",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": true,
2260
+ "default": "'online'"
2261
+ },
2262
+ "last_heartbeat": {
2263
+ "name": "last_heartbeat",
2264
+ "type": "timestamp",
2265
+ "primaryKey": false,
2266
+ "notNull": false
2267
+ },
2268
+ "created_at": {
2269
+ "name": "created_at",
2270
+ "type": "timestamp",
2271
+ "primaryKey": false,
2272
+ "notNull": true,
2273
+ "default": "now()"
2274
+ },
2275
+ "updated_at": {
2276
+ "name": "updated_at",
2277
+ "type": "timestamp",
2278
+ "primaryKey": false,
2279
+ "notNull": true,
2280
+ "default": "now()"
2281
+ }
2282
+ },
2283
+ "indexes": {},
2284
+ "foreignKeys": {},
2285
+ "compositePrimaryKeys": {},
2286
+ "uniqueConstraints": {},
2287
+ "policies": {},
2288
+ "checkConstraints": {},
2289
+ "isRLSEnabled": false
2290
+ },
2291
+ "public.agent_session": {
2292
+ "name": "agent_session",
2293
+ "schema": "",
2294
+ "columns": {
2295
+ "id": {
2296
+ "name": "id",
2297
+ "type": "text",
2298
+ "primaryKey": true,
2299
+ "notNull": true
2300
+ },
2301
+ "tenant_id": {
2302
+ "name": "tenant_id",
2303
+ "type": "text",
2304
+ "primaryKey": false,
2305
+ "notNull": true
2306
+ },
2307
+ "agent_id": {
2308
+ "name": "agent_id",
2309
+ "type": "text",
2310
+ "primaryKey": false,
2311
+ "notNull": true
2312
+ },
2313
+ "principal_id": {
2314
+ "name": "principal_id",
2315
+ "type": "text",
2316
+ "primaryKey": false,
2317
+ "notNull": true
2318
+ },
2319
+ "status": {
2320
+ "name": "status",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": true,
2324
+ "default": "'active'"
2325
+ },
2326
+ "created_at": {
2327
+ "name": "created_at",
2328
+ "type": "timestamp",
2329
+ "primaryKey": false,
2330
+ "notNull": true,
2331
+ "default": "now()"
2332
+ },
2333
+ "updated_at": {
2334
+ "name": "updated_at",
2335
+ "type": "timestamp",
2336
+ "primaryKey": false,
2337
+ "notNull": true,
2338
+ "default": "now()"
2339
+ },
2340
+ "ended_at": {
2341
+ "name": "ended_at",
2342
+ "type": "timestamp",
2343
+ "primaryKey": false,
2344
+ "notNull": false
2345
+ }
2346
+ },
2347
+ "indexes": {},
2348
+ "foreignKeys": {
2349
+ "agent_session_tenant_id_tenant_id_fk": {
2350
+ "name": "agent_session_tenant_id_tenant_id_fk",
2351
+ "tableFrom": "agent_session",
2352
+ "tableTo": "tenant",
2353
+ "columnsFrom": ["tenant_id"],
2354
+ "columnsTo": ["id"],
2355
+ "onDelete": "cascade",
2356
+ "onUpdate": "no action"
2357
+ },
2358
+ "agent_session_agent_id_agent_id_fk": {
2359
+ "name": "agent_session_agent_id_agent_id_fk",
2360
+ "tableFrom": "agent_session",
2361
+ "tableTo": "agent",
2362
+ "columnsFrom": ["agent_id"],
2363
+ "columnsTo": ["id"],
2364
+ "onDelete": "cascade",
2365
+ "onUpdate": "no action"
2366
+ },
2367
+ "agent_session_principal_id_principal_id_fk": {
2368
+ "name": "agent_session_principal_id_principal_id_fk",
2369
+ "tableFrom": "agent_session",
2370
+ "tableTo": "principal",
2371
+ "columnsFrom": ["principal_id"],
2372
+ "columnsTo": ["id"],
2373
+ "onDelete": "no action",
2374
+ "onUpdate": "no action"
2375
+ }
2376
+ },
2377
+ "compositePrimaryKeys": {},
2378
+ "uniqueConstraints": {},
2379
+ "policies": {},
2380
+ "checkConstraints": {},
2381
+ "isRLSEnabled": false
2382
+ },
2383
+ "public.agent_instance": {
2384
+ "name": "agent_instance",
2385
+ "schema": "",
2386
+ "columns": {
2387
+ "id": {
2388
+ "name": "id",
2389
+ "type": "text",
2390
+ "primaryKey": true,
2391
+ "notNull": true
2392
+ },
2393
+ "agent_id": {
2394
+ "name": "agent_id",
2395
+ "type": "text",
2396
+ "primaryKey": false,
2397
+ "notNull": true
2398
+ },
2399
+ "tenant_id": {
2400
+ "name": "tenant_id",
2401
+ "type": "text",
2402
+ "primaryKey": false,
2403
+ "notNull": true
2404
+ },
2405
+ "principal_id": {
2406
+ "name": "principal_id",
2407
+ "type": "text",
2408
+ "primaryKey": false,
2409
+ "notNull": true
2410
+ },
2411
+ "address": {
2412
+ "name": "address",
2413
+ "type": "text",
2414
+ "primaryKey": false,
2415
+ "notNull": true
2416
+ },
2417
+ "version_id": {
2418
+ "name": "version_id",
2419
+ "type": "text",
2420
+ "primaryKey": false,
2421
+ "notNull": false
2422
+ },
2423
+ "session_id": {
2424
+ "name": "session_id",
2425
+ "type": "text",
2426
+ "primaryKey": false,
2427
+ "notNull": false
2428
+ },
2429
+ "status": {
2430
+ "name": "status",
2431
+ "type": "text",
2432
+ "primaryKey": false,
2433
+ "notNull": true,
2434
+ "default": "'deployed'"
2435
+ },
2436
+ "sidecar_id": {
2437
+ "name": "sidecar_id",
2438
+ "type": "text",
2439
+ "primaryKey": false,
2440
+ "notNull": false
2441
+ },
2442
+ "public_key": {
2443
+ "name": "public_key",
2444
+ "type": "text",
2445
+ "primaryKey": false,
2446
+ "notNull": false
2447
+ },
2448
+ "kernel_id": {
2449
+ "name": "kernel_id",
2450
+ "type": "text",
2451
+ "primaryKey": false,
2452
+ "notNull": false
2453
+ },
2454
+ "created_at": {
2455
+ "name": "created_at",
2456
+ "type": "timestamp",
2457
+ "primaryKey": false,
2458
+ "notNull": true,
2459
+ "default": "now()"
2460
+ },
2461
+ "updated_at": {
2462
+ "name": "updated_at",
2463
+ "type": "timestamp",
2464
+ "primaryKey": false,
2465
+ "notNull": true,
2466
+ "default": "now()"
2467
+ },
2468
+ "ended_at": {
2469
+ "name": "ended_at",
2470
+ "type": "timestamp",
2471
+ "primaryKey": false,
2472
+ "notNull": false
2473
+ }
2474
+ },
2475
+ "indexes": {},
2476
+ "foreignKeys": {
2477
+ "agent_instance_agent_id_agent_id_fk": {
2478
+ "name": "agent_instance_agent_id_agent_id_fk",
2479
+ "tableFrom": "agent_instance",
2480
+ "tableTo": "agent",
2481
+ "columnsFrom": ["agent_id"],
2482
+ "columnsTo": ["id"],
2483
+ "onDelete": "cascade",
2484
+ "onUpdate": "no action"
2485
+ },
2486
+ "agent_instance_tenant_id_tenant_id_fk": {
2487
+ "name": "agent_instance_tenant_id_tenant_id_fk",
2488
+ "tableFrom": "agent_instance",
2489
+ "tableTo": "tenant",
2490
+ "columnsFrom": ["tenant_id"],
2491
+ "columnsTo": ["id"],
2492
+ "onDelete": "cascade",
2493
+ "onUpdate": "no action"
2494
+ },
2495
+ "agent_instance_principal_id_principal_id_fk": {
2496
+ "name": "agent_instance_principal_id_principal_id_fk",
2497
+ "tableFrom": "agent_instance",
2498
+ "tableTo": "principal",
2499
+ "columnsFrom": ["principal_id"],
2500
+ "columnsTo": ["id"],
2501
+ "onDelete": "no action",
2502
+ "onUpdate": "no action"
2503
+ },
2504
+ "agent_instance_version_id_agent_version_id_fk": {
2505
+ "name": "agent_instance_version_id_agent_version_id_fk",
2506
+ "tableFrom": "agent_instance",
2507
+ "tableTo": "agent_version",
2508
+ "columnsFrom": ["version_id"],
2509
+ "columnsTo": ["id"],
2510
+ "onDelete": "no action",
2511
+ "onUpdate": "no action"
2512
+ },
2513
+ "agent_instance_session_id_agent_session_id_fk": {
2514
+ "name": "agent_instance_session_id_agent_session_id_fk",
2515
+ "tableFrom": "agent_instance",
2516
+ "tableTo": "agent_session",
2517
+ "columnsFrom": ["session_id"],
2518
+ "columnsTo": ["id"],
2519
+ "onDelete": "no action",
2520
+ "onUpdate": "no action"
2521
+ },
2522
+ "agent_instance_sidecar_id_sidecar_id_fk": {
2523
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
2524
+ "tableFrom": "agent_instance",
2525
+ "tableTo": "sidecar",
2526
+ "columnsFrom": ["sidecar_id"],
2527
+ "columnsTo": ["id"],
2528
+ "onDelete": "set null",
2529
+ "onUpdate": "no action"
2530
+ }
2531
+ },
2532
+ "compositePrimaryKeys": {},
2533
+ "uniqueConstraints": {
2534
+ "agent_instance_address_unique": {
2535
+ "name": "agent_instance_address_unique",
2536
+ "nullsNotDistinct": false,
2537
+ "columns": ["address"]
2538
+ }
2539
+ },
2540
+ "policies": {},
2541
+ "checkConstraints": {},
2542
+ "isRLSEnabled": false
2543
+ },
2544
+ "public.session_asset": {
2545
+ "name": "session_asset",
2546
+ "schema": "",
2547
+ "columns": {
2548
+ "instance_id": {
2549
+ "name": "instance_id",
2550
+ "type": "text",
2551
+ "primaryKey": false,
2552
+ "notNull": true
2553
+ },
2554
+ "agent_asset_id": {
2555
+ "name": "agent_asset_id",
2556
+ "type": "text",
2557
+ "primaryKey": false,
2558
+ "notNull": false
2559
+ },
2560
+ "mount_path": {
2561
+ "name": "mount_path",
2562
+ "type": "text",
2563
+ "primaryKey": false,
2564
+ "notNull": true
2565
+ },
2566
+ "asset_pack_sha": {
2567
+ "name": "asset_pack_sha",
2568
+ "type": "text",
2569
+ "primaryKey": false,
2570
+ "notNull": true
2571
+ },
2572
+ "source_commit_sha": {
2573
+ "name": "source_commit_sha",
2574
+ "type": "text",
2575
+ "primaryKey": false,
2576
+ "notNull": true
2577
+ },
2578
+ "source": {
2579
+ "name": "source",
2580
+ "type": "text",
2581
+ "primaryKey": false,
2582
+ "notNull": true
2583
+ },
2584
+ "materialized_at": {
2585
+ "name": "materialized_at",
2586
+ "type": "timestamp",
2587
+ "primaryKey": false,
2588
+ "notNull": true,
2589
+ "default": "now()"
2590
+ }
2591
+ },
2592
+ "indexes": {
2593
+ "session_asset_pack_sha_idx": {
2594
+ "name": "session_asset_pack_sha_idx",
2595
+ "columns": [
2596
+ {
2597
+ "expression": "asset_pack_sha",
2598
+ "isExpression": false,
2599
+ "asc": true,
2600
+ "nulls": "last"
2601
+ }
2602
+ ],
2603
+ "isUnique": false,
2604
+ "concurrently": false,
2605
+ "method": "btree",
2606
+ "with": {}
2607
+ }
2608
+ },
2609
+ "foreignKeys": {
2610
+ "session_asset_instance_id_agent_instance_id_fk": {
2611
+ "name": "session_asset_instance_id_agent_instance_id_fk",
2612
+ "tableFrom": "session_asset",
2613
+ "tableTo": "agent_instance",
2614
+ "columnsFrom": ["instance_id"],
2615
+ "columnsTo": ["id"],
2616
+ "onDelete": "cascade",
2617
+ "onUpdate": "no action"
2618
+ },
2619
+ "session_asset_agent_asset_id_agent_asset_id_fk": {
2620
+ "name": "session_asset_agent_asset_id_agent_asset_id_fk",
2621
+ "tableFrom": "session_asset",
2622
+ "tableTo": "agent_asset",
2623
+ "columnsFrom": ["agent_asset_id"],
2624
+ "columnsTo": ["id"],
2625
+ "onDelete": "cascade",
2626
+ "onUpdate": "no action"
2627
+ }
2628
+ },
2629
+ "compositePrimaryKeys": {
2630
+ "session_asset_instance_id_mount_path_pk": {
2631
+ "name": "session_asset_instance_id_mount_path_pk",
2632
+ "columns": ["instance_id", "mount_path"]
2633
+ }
2634
+ },
2635
+ "uniqueConstraints": {},
2636
+ "policies": {},
2637
+ "checkConstraints": {},
2638
+ "isRLSEnabled": false
2639
+ },
2640
+ "public.inference_turn": {
2641
+ "name": "inference_turn",
2642
+ "schema": "",
2643
+ "columns": {
2644
+ "id": {
2645
+ "name": "id",
2646
+ "type": "text",
2647
+ "primaryKey": true,
2648
+ "notNull": true
2649
+ },
2650
+ "session_id": {
2651
+ "name": "session_id",
2652
+ "type": "text",
2653
+ "primaryKey": false,
2654
+ "notNull": true
2655
+ },
2656
+ "instance_id": {
2657
+ "name": "instance_id",
2658
+ "type": "text",
2659
+ "primaryKey": false,
2660
+ "notNull": true
2661
+ },
2662
+ "tenant_id": {
2663
+ "name": "tenant_id",
2664
+ "type": "text",
2665
+ "primaryKey": false,
2666
+ "notNull": true
2667
+ },
2668
+ "model": {
2669
+ "name": "model",
2670
+ "type": "text",
2671
+ "primaryKey": false,
2672
+ "notNull": true
2673
+ },
2674
+ "status": {
2675
+ "name": "status",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": true,
2679
+ "default": "'running'"
2680
+ },
2681
+ "started_at": {
2682
+ "name": "started_at",
2683
+ "type": "timestamp",
2684
+ "primaryKey": false,
2685
+ "notNull": true
2686
+ },
2687
+ "ended_at": {
2688
+ "name": "ended_at",
2689
+ "type": "timestamp",
2690
+ "primaryKey": false,
2691
+ "notNull": false
2692
+ }
2693
+ },
2694
+ "indexes": {
2695
+ "inference_turn_instance_id_started_at_idx": {
2696
+ "name": "inference_turn_instance_id_started_at_idx",
2697
+ "columns": [
2698
+ {
2699
+ "expression": "instance_id",
2700
+ "isExpression": false,
2701
+ "asc": true,
2702
+ "nulls": "last"
2703
+ },
2704
+ {
2705
+ "expression": "started_at",
2706
+ "isExpression": false,
2707
+ "asc": true,
2708
+ "nulls": "last"
2709
+ }
2710
+ ],
2711
+ "isUnique": false,
2712
+ "concurrently": false,
2713
+ "method": "btree",
2714
+ "with": {}
2715
+ }
2716
+ },
2717
+ "foreignKeys": {
2718
+ "inference_turn_session_id_agent_session_id_fk": {
2719
+ "name": "inference_turn_session_id_agent_session_id_fk",
2720
+ "tableFrom": "inference_turn",
2721
+ "tableTo": "agent_session",
2722
+ "columnsFrom": ["session_id"],
2723
+ "columnsTo": ["id"],
2724
+ "onDelete": "cascade",
2725
+ "onUpdate": "no action"
2726
+ },
2727
+ "inference_turn_instance_id_agent_instance_id_fk": {
2728
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2729
+ "tableFrom": "inference_turn",
2730
+ "tableTo": "agent_instance",
2731
+ "columnsFrom": ["instance_id"],
2732
+ "columnsTo": ["id"],
2733
+ "onDelete": "cascade",
2734
+ "onUpdate": "no action"
2735
+ },
2736
+ "inference_turn_tenant_id_tenant_id_fk": {
2737
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2738
+ "tableFrom": "inference_turn",
2739
+ "tableTo": "tenant",
2740
+ "columnsFrom": ["tenant_id"],
2741
+ "columnsTo": ["id"],
2742
+ "onDelete": "cascade",
2743
+ "onUpdate": "no action"
2744
+ }
2745
+ },
2746
+ "compositePrimaryKeys": {},
2747
+ "uniqueConstraints": {},
2748
+ "policies": {},
2749
+ "checkConstraints": {},
2750
+ "isRLSEnabled": false
2751
+ },
2752
+ "public.session_mail": {
2753
+ "name": "session_mail",
2754
+ "schema": "",
2755
+ "columns": {
2756
+ "id": {
2757
+ "name": "id",
2758
+ "type": "text",
2759
+ "primaryKey": true,
2760
+ "notNull": true
2761
+ },
2762
+ "session_id": {
2763
+ "name": "session_id",
2764
+ "type": "text",
2765
+ "primaryKey": false,
2766
+ "notNull": true
2767
+ },
2768
+ "instance_id": {
2769
+ "name": "instance_id",
2770
+ "type": "text",
2771
+ "primaryKey": false,
2772
+ "notNull": false
2773
+ },
2774
+ "tenant_id": {
2775
+ "name": "tenant_id",
2776
+ "type": "text",
2777
+ "primaryKey": false,
2778
+ "notNull": true
2779
+ },
2780
+ "direction": {
2781
+ "name": "direction",
2782
+ "type": "text",
2783
+ "primaryKey": false,
2784
+ "notNull": true
2785
+ },
2786
+ "status": {
2787
+ "name": "status",
2788
+ "type": "text",
2789
+ "primaryKey": false,
2790
+ "notNull": true,
2791
+ "default": "'pending'"
2792
+ },
2793
+ "raw": {
2794
+ "name": "raw",
2795
+ "type": "bytea",
2796
+ "primaryKey": false,
2797
+ "notNull": true
2798
+ },
2799
+ "created_at": {
2800
+ "name": "created_at",
2801
+ "type": "timestamp",
2802
+ "primaryKey": false,
2803
+ "notNull": true,
2804
+ "default": "now()"
2805
+ }
2806
+ },
2807
+ "indexes": {
2808
+ "session_mail_instance_id_created_at_idx": {
2809
+ "name": "session_mail_instance_id_created_at_idx",
2810
+ "columns": [
2811
+ {
2812
+ "expression": "instance_id",
2813
+ "isExpression": false,
2814
+ "asc": true,
2815
+ "nulls": "last"
2816
+ },
2817
+ {
2818
+ "expression": "created_at",
2819
+ "isExpression": false,
2820
+ "asc": true,
2821
+ "nulls": "last"
2822
+ }
2823
+ ],
2824
+ "isUnique": false,
2825
+ "concurrently": false,
2826
+ "method": "btree",
2827
+ "with": {}
2828
+ }
2829
+ },
2830
+ "foreignKeys": {
2831
+ "session_mail_session_id_agent_session_id_fk": {
2832
+ "name": "session_mail_session_id_agent_session_id_fk",
2833
+ "tableFrom": "session_mail",
2834
+ "tableTo": "agent_session",
2835
+ "columnsFrom": ["session_id"],
2836
+ "columnsTo": ["id"],
2837
+ "onDelete": "cascade",
2838
+ "onUpdate": "no action"
2839
+ },
2840
+ "session_mail_instance_id_agent_instance_id_fk": {
2841
+ "name": "session_mail_instance_id_agent_instance_id_fk",
2842
+ "tableFrom": "session_mail",
2843
+ "tableTo": "agent_instance",
2844
+ "columnsFrom": ["instance_id"],
2845
+ "columnsTo": ["id"],
2846
+ "onDelete": "set null",
2847
+ "onUpdate": "no action"
2848
+ },
2849
+ "session_mail_tenant_id_tenant_id_fk": {
2850
+ "name": "session_mail_tenant_id_tenant_id_fk",
2851
+ "tableFrom": "session_mail",
2852
+ "tableTo": "tenant",
2853
+ "columnsFrom": ["tenant_id"],
2854
+ "columnsTo": ["id"],
2855
+ "onDelete": "cascade",
2856
+ "onUpdate": "no action"
2857
+ }
2858
+ },
2859
+ "compositePrimaryKeys": {},
2860
+ "uniqueConstraints": {},
2861
+ "policies": {},
2862
+ "checkConstraints": {},
2863
+ "isRLSEnabled": false
2864
+ },
2865
+ "public.turn_part": {
2866
+ "name": "turn_part",
2867
+ "schema": "",
2868
+ "columns": {
2869
+ "id": {
2870
+ "name": "id",
2871
+ "type": "text",
2872
+ "primaryKey": true,
2873
+ "notNull": true
2874
+ },
2875
+ "turn_id": {
2876
+ "name": "turn_id",
2877
+ "type": "text",
2878
+ "primaryKey": false,
2879
+ "notNull": true
2880
+ },
2881
+ "session_id": {
2882
+ "name": "session_id",
2883
+ "type": "text",
2884
+ "primaryKey": false,
2885
+ "notNull": true
2886
+ },
2887
+ "type": {
2888
+ "name": "type",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "content": {
2894
+ "name": "content",
2895
+ "type": "text",
2896
+ "primaryKey": false,
2897
+ "notNull": false
2898
+ },
2899
+ "metadata": {
2900
+ "name": "metadata",
2901
+ "type": "jsonb",
2902
+ "primaryKey": false,
2903
+ "notNull": false
2904
+ },
2905
+ "ordinal": {
2906
+ "name": "ordinal",
2907
+ "type": "integer",
2908
+ "primaryKey": false,
2909
+ "notNull": true
2910
+ }
2911
+ },
2912
+ "indexes": {},
2913
+ "foreignKeys": {
2914
+ "turn_part_turn_id_inference_turn_id_fk": {
2915
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2916
+ "tableFrom": "turn_part",
2917
+ "tableTo": "inference_turn",
2918
+ "columnsFrom": ["turn_id"],
2919
+ "columnsTo": ["id"],
2920
+ "onDelete": "cascade",
2921
+ "onUpdate": "no action"
2922
+ },
2923
+ "turn_part_session_id_agent_session_id_fk": {
2924
+ "name": "turn_part_session_id_agent_session_id_fk",
2925
+ "tableFrom": "turn_part",
2926
+ "tableTo": "agent_session",
2927
+ "columnsFrom": ["session_id"],
2928
+ "columnsTo": ["id"],
2929
+ "onDelete": "cascade",
2930
+ "onUpdate": "no action"
2931
+ }
2932
+ },
2933
+ "compositePrimaryKeys": {},
2934
+ "uniqueConstraints": {},
2935
+ "policies": {},
2936
+ "checkConstraints": {},
2937
+ "isRLSEnabled": false
2938
+ },
2939
+ "public.git_token": {
2940
+ "name": "git_token",
2941
+ "schema": "",
2942
+ "columns": {
2943
+ "id": {
2944
+ "name": "id",
2945
+ "type": "text",
2946
+ "primaryKey": true,
2947
+ "notNull": true
2948
+ },
2949
+ "tenant_id": {
2950
+ "name": "tenant_id",
2951
+ "type": "text",
2952
+ "primaryKey": false,
2953
+ "notNull": false
2954
+ },
2955
+ "user_id": {
2956
+ "name": "user_id",
2957
+ "type": "text",
2958
+ "primaryKey": false,
2959
+ "notNull": true
2960
+ },
2961
+ "principal_id": {
2962
+ "name": "principal_id",
2963
+ "type": "text",
2964
+ "primaryKey": false,
2965
+ "notNull": false
2966
+ },
2967
+ "name": {
2968
+ "name": "name",
2969
+ "type": "text",
2970
+ "primaryKey": false,
2971
+ "notNull": true
2972
+ },
2973
+ "kind": {
2974
+ "name": "kind",
2975
+ "type": "text",
2976
+ "primaryKey": false,
2977
+ "notNull": true
2978
+ },
2979
+ "token_hash_sha256": {
2980
+ "name": "token_hash_sha256",
2981
+ "type": "bytea",
2982
+ "primaryKey": false,
2983
+ "notNull": true
2984
+ },
2985
+ "resource": {
2986
+ "name": "resource",
2987
+ "type": "text",
2988
+ "primaryKey": false,
2989
+ "notNull": true
2990
+ },
2991
+ "ref_pattern": {
2992
+ "name": "ref_pattern",
2993
+ "type": "text",
2994
+ "primaryKey": false,
2995
+ "notNull": true
2996
+ },
2997
+ "actions": {
2998
+ "name": "actions",
2999
+ "type": "text[]",
3000
+ "primaryKey": false,
3001
+ "notNull": true
3002
+ },
3003
+ "expires_at": {
3004
+ "name": "expires_at",
3005
+ "type": "timestamp with time zone",
3006
+ "primaryKey": false,
3007
+ "notNull": true
3008
+ },
3009
+ "revoked_at": {
3010
+ "name": "revoked_at",
3011
+ "type": "timestamp with time zone",
3012
+ "primaryKey": false,
3013
+ "notNull": false
3014
+ },
3015
+ "created_at": {
3016
+ "name": "created_at",
3017
+ "type": "timestamp with time zone",
3018
+ "primaryKey": false,
3019
+ "notNull": true,
3020
+ "default": "now()"
3021
+ }
3022
+ },
3023
+ "indexes": {
3024
+ "git_token_user_id_name_active_idx": {
3025
+ "name": "git_token_user_id_name_active_idx",
3026
+ "columns": [
3027
+ {
3028
+ "expression": "user_id",
3029
+ "isExpression": false,
3030
+ "asc": true,
3031
+ "nulls": "last"
3032
+ },
3033
+ {
3034
+ "expression": "name",
3035
+ "isExpression": false,
3036
+ "asc": true,
3037
+ "nulls": "last"
3038
+ }
3039
+ ],
3040
+ "isUnique": true,
3041
+ "where": "\"git_token\".\"revoked_at\" is null",
3042
+ "concurrently": false,
3043
+ "method": "btree",
3044
+ "with": {}
3045
+ }
3046
+ },
3047
+ "foreignKeys": {
3048
+ "git_token_tenant_id_tenant_id_fk": {
3049
+ "name": "git_token_tenant_id_tenant_id_fk",
3050
+ "tableFrom": "git_token",
3051
+ "tableTo": "tenant",
3052
+ "columnsFrom": ["tenant_id"],
3053
+ "columnsTo": ["id"],
3054
+ "onDelete": "no action",
3055
+ "onUpdate": "no action"
3056
+ },
3057
+ "git_token_user_id_user_id_fk": {
3058
+ "name": "git_token_user_id_user_id_fk",
3059
+ "tableFrom": "git_token",
3060
+ "tableTo": "user",
3061
+ "columnsFrom": ["user_id"],
3062
+ "columnsTo": ["id"],
3063
+ "onDelete": "cascade",
3064
+ "onUpdate": "no action"
3065
+ },
3066
+ "git_token_principal_id_principal_id_fk": {
3067
+ "name": "git_token_principal_id_principal_id_fk",
3068
+ "tableFrom": "git_token",
3069
+ "tableTo": "principal",
3070
+ "columnsFrom": ["principal_id"],
3071
+ "columnsTo": ["id"],
3072
+ "onDelete": "cascade",
3073
+ "onUpdate": "no action"
3074
+ }
3075
+ },
3076
+ "compositePrimaryKeys": {},
3077
+ "uniqueConstraints": {
3078
+ "git_token_token_hash_sha256_unique": {
3079
+ "name": "git_token_token_hash_sha256_unique",
3080
+ "nullsNotDistinct": false,
3081
+ "columns": ["token_hash_sha256"]
3082
+ }
3083
+ },
3084
+ "policies": {},
3085
+ "checkConstraints": {},
3086
+ "isRLSEnabled": false
3087
+ }
3088
+ },
3089
+ "enums": {},
3090
+ "schemas": {},
3091
+ "sequences": {},
3092
+ "roles": {},
3093
+ "policies": {},
3094
+ "views": {},
3095
+ "_meta": {
3096
+ "columns": {},
3097
+ "schemas": {},
3098
+ "tables": {}
3099
+ }
3100
+ }