@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,3198 @@
1
+ {
2
+ "id": "b997db7b-976b-4511-8780-9052911edf5c",
3
+ "prevId": "499bce93-ebca-453c-a5f0-936f8f7259f9",
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
+ "model_requirements": {
896
+ "name": "model_requirements",
897
+ "type": "jsonb",
898
+ "primaryKey": false,
899
+ "notNull": false
900
+ },
901
+ "tool_packages": {
902
+ "name": "tool_packages",
903
+ "type": "jsonb",
904
+ "primaryKey": false,
905
+ "notNull": true,
906
+ "default": "'[]'::jsonb"
907
+ },
908
+ "grant_requirements": {
909
+ "name": "grant_requirements",
910
+ "type": "jsonb",
911
+ "primaryKey": false,
912
+ "notNull": false
913
+ },
914
+ "current_version": {
915
+ "name": "current_version",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": true,
919
+ "default": "'1'"
920
+ },
921
+ "status": {
922
+ "name": "status",
923
+ "type": "text",
924
+ "primaryKey": false,
925
+ "notNull": true,
926
+ "default": "'deployed'"
927
+ },
928
+ "created_at": {
929
+ "name": "created_at",
930
+ "type": "timestamp",
931
+ "primaryKey": false,
932
+ "notNull": true,
933
+ "default": "now()"
934
+ },
935
+ "updated_at": {
936
+ "name": "updated_at",
937
+ "type": "timestamp",
938
+ "primaryKey": false,
939
+ "notNull": true,
940
+ "default": "now()"
941
+ }
942
+ },
943
+ "indexes": {},
944
+ "foreignKeys": {
945
+ "agent_tenant_id_tenant_id_fk": {
946
+ "name": "agent_tenant_id_tenant_id_fk",
947
+ "tableFrom": "agent",
948
+ "tableTo": "tenant",
949
+ "columnsFrom": ["tenant_id"],
950
+ "columnsTo": ["id"],
951
+ "onDelete": "cascade",
952
+ "onUpdate": "no action"
953
+ },
954
+ "agent_creator_principal_id_principal_id_fk": {
955
+ "name": "agent_creator_principal_id_principal_id_fk",
956
+ "tableFrom": "agent",
957
+ "tableTo": "principal",
958
+ "columnsFrom": ["creator_principal_id"],
959
+ "columnsTo": ["id"],
960
+ "onDelete": "no action",
961
+ "onUpdate": "no action"
962
+ }
963
+ },
964
+ "compositePrimaryKeys": {},
965
+ "uniqueConstraints": {},
966
+ "policies": {},
967
+ "checkConstraints": {},
968
+ "isRLSEnabled": false
969
+ },
970
+ "public.agent_version": {
971
+ "name": "agent_version",
972
+ "schema": "",
973
+ "columns": {
974
+ "id": {
975
+ "name": "id",
976
+ "type": "text",
977
+ "primaryKey": true,
978
+ "notNull": true
979
+ },
980
+ "agent_id": {
981
+ "name": "agent_id",
982
+ "type": "text",
983
+ "primaryKey": false,
984
+ "notNull": true
985
+ },
986
+ "version": {
987
+ "name": "version",
988
+ "type": "text",
989
+ "primaryKey": false,
990
+ "notNull": true
991
+ },
992
+ "status": {
993
+ "name": "status",
994
+ "type": "text",
995
+ "primaryKey": false,
996
+ "notNull": true,
997
+ "default": "'active'"
998
+ },
999
+ "created_at": {
1000
+ "name": "created_at",
1001
+ "type": "timestamp",
1002
+ "primaryKey": false,
1003
+ "notNull": true,
1004
+ "default": "now()"
1005
+ }
1006
+ },
1007
+ "indexes": {},
1008
+ "foreignKeys": {
1009
+ "agent_version_agent_id_agent_id_fk": {
1010
+ "name": "agent_version_agent_id_agent_id_fk",
1011
+ "tableFrom": "agent_version",
1012
+ "tableTo": "agent",
1013
+ "columnsFrom": ["agent_id"],
1014
+ "columnsTo": ["id"],
1015
+ "onDelete": "cascade",
1016
+ "onUpdate": "no action"
1017
+ }
1018
+ },
1019
+ "compositePrimaryKeys": {},
1020
+ "uniqueConstraints": {},
1021
+ "policies": {},
1022
+ "checkConstraints": {},
1023
+ "isRLSEnabled": false
1024
+ },
1025
+ "public.provider": {
1026
+ "name": "provider",
1027
+ "schema": "",
1028
+ "columns": {
1029
+ "id": {
1030
+ "name": "id",
1031
+ "type": "text",
1032
+ "primaryKey": true,
1033
+ "notNull": true
1034
+ },
1035
+ "tenant_id": {
1036
+ "name": "tenant_id",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": true
1040
+ },
1041
+ "name": {
1042
+ "name": "name",
1043
+ "type": "text",
1044
+ "primaryKey": false,
1045
+ "notNull": true
1046
+ },
1047
+ "plugin": {
1048
+ "name": "plugin",
1049
+ "type": "text",
1050
+ "primaryKey": false,
1051
+ "notNull": true
1052
+ },
1053
+ "authorization_url": {
1054
+ "name": "authorization_url",
1055
+ "type": "text",
1056
+ "primaryKey": false,
1057
+ "notNull": false
1058
+ },
1059
+ "token_url": {
1060
+ "name": "token_url",
1061
+ "type": "text",
1062
+ "primaryKey": false,
1063
+ "notNull": false
1064
+ },
1065
+ "user_info_url": {
1066
+ "name": "user_info_url",
1067
+ "type": "text",
1068
+ "primaryKey": false,
1069
+ "notNull": false
1070
+ },
1071
+ "scopes": {
1072
+ "name": "scopes",
1073
+ "type": "text[]",
1074
+ "primaryKey": false,
1075
+ "notNull": false
1076
+ },
1077
+ "metadata": {
1078
+ "name": "metadata",
1079
+ "type": "jsonb",
1080
+ "primaryKey": false,
1081
+ "notNull": false
1082
+ },
1083
+ "created_at": {
1084
+ "name": "created_at",
1085
+ "type": "timestamp",
1086
+ "primaryKey": false,
1087
+ "notNull": true,
1088
+ "default": "now()"
1089
+ },
1090
+ "updated_at": {
1091
+ "name": "updated_at",
1092
+ "type": "timestamp",
1093
+ "primaryKey": false,
1094
+ "notNull": true,
1095
+ "default": "now()"
1096
+ }
1097
+ },
1098
+ "indexes": {},
1099
+ "foreignKeys": {
1100
+ "provider_tenant_id_tenant_id_fk": {
1101
+ "name": "provider_tenant_id_tenant_id_fk",
1102
+ "tableFrom": "provider",
1103
+ "tableTo": "tenant",
1104
+ "columnsFrom": ["tenant_id"],
1105
+ "columnsTo": ["id"],
1106
+ "onDelete": "cascade",
1107
+ "onUpdate": "no action"
1108
+ }
1109
+ },
1110
+ "compositePrimaryKeys": {},
1111
+ "uniqueConstraints": {
1112
+ "provider_tenant_name": {
1113
+ "name": "provider_tenant_name",
1114
+ "nullsNotDistinct": false,
1115
+ "columns": ["tenant_id", "name"]
1116
+ }
1117
+ },
1118
+ "policies": {},
1119
+ "checkConstraints": {},
1120
+ "isRLSEnabled": false
1121
+ },
1122
+ "public.oauth_client": {
1123
+ "name": "oauth_client",
1124
+ "schema": "",
1125
+ "columns": {
1126
+ "id": {
1127
+ "name": "id",
1128
+ "type": "text",
1129
+ "primaryKey": true,
1130
+ "notNull": true
1131
+ },
1132
+ "tenant_id": {
1133
+ "name": "tenant_id",
1134
+ "type": "text",
1135
+ "primaryKey": false,
1136
+ "notNull": true
1137
+ },
1138
+ "provider_id": {
1139
+ "name": "provider_id",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": true
1143
+ },
1144
+ "name": {
1145
+ "name": "name",
1146
+ "type": "text",
1147
+ "primaryKey": false,
1148
+ "notNull": true
1149
+ },
1150
+ "client_id": {
1151
+ "name": "client_id",
1152
+ "type": "text",
1153
+ "primaryKey": false,
1154
+ "notNull": true
1155
+ },
1156
+ "client_secret": {
1157
+ "name": "client_secret",
1158
+ "type": "text",
1159
+ "primaryKey": false,
1160
+ "notNull": true
1161
+ },
1162
+ "redirect_uris": {
1163
+ "name": "redirect_uris",
1164
+ "type": "text[]",
1165
+ "primaryKey": false,
1166
+ "notNull": false
1167
+ },
1168
+ "default_scopes": {
1169
+ "name": "default_scopes",
1170
+ "type": "text[]",
1171
+ "primaryKey": false,
1172
+ "notNull": false
1173
+ },
1174
+ "metadata": {
1175
+ "name": "metadata",
1176
+ "type": "jsonb",
1177
+ "primaryKey": false,
1178
+ "notNull": false
1179
+ },
1180
+ "created_at": {
1181
+ "name": "created_at",
1182
+ "type": "timestamp",
1183
+ "primaryKey": false,
1184
+ "notNull": true,
1185
+ "default": "now()"
1186
+ },
1187
+ "updated_at": {
1188
+ "name": "updated_at",
1189
+ "type": "timestamp",
1190
+ "primaryKey": false,
1191
+ "notNull": true,
1192
+ "default": "now()"
1193
+ }
1194
+ },
1195
+ "indexes": {},
1196
+ "foreignKeys": {
1197
+ "oauth_client_tenant_id_tenant_id_fk": {
1198
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1199
+ "tableFrom": "oauth_client",
1200
+ "tableTo": "tenant",
1201
+ "columnsFrom": ["tenant_id"],
1202
+ "columnsTo": ["id"],
1203
+ "onDelete": "cascade",
1204
+ "onUpdate": "no action"
1205
+ },
1206
+ "oauth_client_provider_id_provider_id_fk": {
1207
+ "name": "oauth_client_provider_id_provider_id_fk",
1208
+ "tableFrom": "oauth_client",
1209
+ "tableTo": "provider",
1210
+ "columnsFrom": ["provider_id"],
1211
+ "columnsTo": ["id"],
1212
+ "onDelete": "cascade",
1213
+ "onUpdate": "no action"
1214
+ }
1215
+ },
1216
+ "compositePrimaryKeys": {},
1217
+ "uniqueConstraints": {
1218
+ "oauth_client_tenant_provider": {
1219
+ "name": "oauth_client_tenant_provider",
1220
+ "nullsNotDistinct": false,
1221
+ "columns": ["tenant_id", "provider_id"]
1222
+ }
1223
+ },
1224
+ "policies": {},
1225
+ "checkConstraints": {},
1226
+ "isRLSEnabled": false
1227
+ },
1228
+ "public.credential": {
1229
+ "name": "credential",
1230
+ "schema": "",
1231
+ "columns": {
1232
+ "id": {
1233
+ "name": "id",
1234
+ "type": "text",
1235
+ "primaryKey": true,
1236
+ "notNull": true
1237
+ },
1238
+ "tenant_id": {
1239
+ "name": "tenant_id",
1240
+ "type": "text",
1241
+ "primaryKey": false,
1242
+ "notNull": true
1243
+ },
1244
+ "principal_id": {
1245
+ "name": "principal_id",
1246
+ "type": "text",
1247
+ "primaryKey": false,
1248
+ "notNull": false
1249
+ },
1250
+ "provider_id": {
1251
+ "name": "provider_id",
1252
+ "type": "text",
1253
+ "primaryKey": false,
1254
+ "notNull": true
1255
+ },
1256
+ "oauth_client_id": {
1257
+ "name": "oauth_client_id",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": false
1261
+ },
1262
+ "name": {
1263
+ "name": "name",
1264
+ "type": "text",
1265
+ "primaryKey": false,
1266
+ "notNull": true
1267
+ },
1268
+ "type": {
1269
+ "name": "type",
1270
+ "type": "text",
1271
+ "primaryKey": false,
1272
+ "notNull": true
1273
+ },
1274
+ "description": {
1275
+ "name": "description",
1276
+ "type": "text",
1277
+ "primaryKey": false,
1278
+ "notNull": false
1279
+ },
1280
+ "secret": {
1281
+ "name": "secret",
1282
+ "type": "text",
1283
+ "primaryKey": false,
1284
+ "notNull": true
1285
+ },
1286
+ "refresh_secret": {
1287
+ "name": "refresh_secret",
1288
+ "type": "text",
1289
+ "primaryKey": false,
1290
+ "notNull": false
1291
+ },
1292
+ "scopes": {
1293
+ "name": "scopes",
1294
+ "type": "text[]",
1295
+ "primaryKey": false,
1296
+ "notNull": false
1297
+ },
1298
+ "expires_at": {
1299
+ "name": "expires_at",
1300
+ "type": "timestamp",
1301
+ "primaryKey": false,
1302
+ "notNull": false
1303
+ },
1304
+ "status": {
1305
+ "name": "status",
1306
+ "type": "text",
1307
+ "primaryKey": false,
1308
+ "notNull": true,
1309
+ "default": "'active'"
1310
+ },
1311
+ "metadata": {
1312
+ "name": "metadata",
1313
+ "type": "jsonb",
1314
+ "primaryKey": false,
1315
+ "notNull": false
1316
+ },
1317
+ "created_at": {
1318
+ "name": "created_at",
1319
+ "type": "timestamp",
1320
+ "primaryKey": false,
1321
+ "notNull": true,
1322
+ "default": "now()"
1323
+ },
1324
+ "updated_at": {
1325
+ "name": "updated_at",
1326
+ "type": "timestamp",
1327
+ "primaryKey": false,
1328
+ "notNull": true,
1329
+ "default": "now()"
1330
+ }
1331
+ },
1332
+ "indexes": {},
1333
+ "foreignKeys": {
1334
+ "credential_tenant_id_tenant_id_fk": {
1335
+ "name": "credential_tenant_id_tenant_id_fk",
1336
+ "tableFrom": "credential",
1337
+ "tableTo": "tenant",
1338
+ "columnsFrom": ["tenant_id"],
1339
+ "columnsTo": ["id"],
1340
+ "onDelete": "cascade",
1341
+ "onUpdate": "no action"
1342
+ },
1343
+ "credential_principal_id_principal_id_fk": {
1344
+ "name": "credential_principal_id_principal_id_fk",
1345
+ "tableFrom": "credential",
1346
+ "tableTo": "principal",
1347
+ "columnsFrom": ["principal_id"],
1348
+ "columnsTo": ["id"],
1349
+ "onDelete": "set null",
1350
+ "onUpdate": "no action"
1351
+ },
1352
+ "credential_provider_id_provider_id_fk": {
1353
+ "name": "credential_provider_id_provider_id_fk",
1354
+ "tableFrom": "credential",
1355
+ "tableTo": "provider",
1356
+ "columnsFrom": ["provider_id"],
1357
+ "columnsTo": ["id"],
1358
+ "onDelete": "cascade",
1359
+ "onUpdate": "no action"
1360
+ },
1361
+ "credential_oauth_client_id_oauth_client_id_fk": {
1362
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1363
+ "tableFrom": "credential",
1364
+ "tableTo": "oauth_client",
1365
+ "columnsFrom": ["oauth_client_id"],
1366
+ "columnsTo": ["id"],
1367
+ "onDelete": "set null",
1368
+ "onUpdate": "no action"
1369
+ }
1370
+ },
1371
+ "compositePrimaryKeys": {},
1372
+ "uniqueConstraints": {
1373
+ "credential_tenant_name": {
1374
+ "name": "credential_tenant_name",
1375
+ "nullsNotDistinct": false,
1376
+ "columns": ["tenant_id", "name"]
1377
+ }
1378
+ },
1379
+ "policies": {},
1380
+ "checkConstraints": {},
1381
+ "isRLSEnabled": false
1382
+ },
1383
+ "public.asset": {
1384
+ "name": "asset",
1385
+ "schema": "",
1386
+ "columns": {
1387
+ "id": {
1388
+ "name": "id",
1389
+ "type": "text",
1390
+ "primaryKey": true,
1391
+ "notNull": true
1392
+ },
1393
+ "tenant_id": {
1394
+ "name": "tenant_id",
1395
+ "type": "text",
1396
+ "primaryKey": false,
1397
+ "notNull": true
1398
+ },
1399
+ "kind": {
1400
+ "name": "kind",
1401
+ "type": "text",
1402
+ "primaryKey": false,
1403
+ "notNull": true
1404
+ },
1405
+ "name": {
1406
+ "name": "name",
1407
+ "type": "text",
1408
+ "primaryKey": false,
1409
+ "notNull": true
1410
+ },
1411
+ "display_name": {
1412
+ "name": "display_name",
1413
+ "type": "text",
1414
+ "primaryKey": false,
1415
+ "notNull": false
1416
+ },
1417
+ "creator_principal_id": {
1418
+ "name": "creator_principal_id",
1419
+ "type": "text",
1420
+ "primaryKey": false,
1421
+ "notNull": false
1422
+ },
1423
+ "created_at": {
1424
+ "name": "created_at",
1425
+ "type": "timestamp",
1426
+ "primaryKey": false,
1427
+ "notNull": true,
1428
+ "default": "now()"
1429
+ },
1430
+ "updated_at": {
1431
+ "name": "updated_at",
1432
+ "type": "timestamp",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "default": "now()"
1436
+ }
1437
+ },
1438
+ "indexes": {},
1439
+ "foreignKeys": {
1440
+ "asset_tenant_id_tenant_id_fk": {
1441
+ "name": "asset_tenant_id_tenant_id_fk",
1442
+ "tableFrom": "asset",
1443
+ "tableTo": "tenant",
1444
+ "columnsFrom": ["tenant_id"],
1445
+ "columnsTo": ["id"],
1446
+ "onDelete": "cascade",
1447
+ "onUpdate": "no action"
1448
+ },
1449
+ "asset_creator_principal_id_principal_id_fk": {
1450
+ "name": "asset_creator_principal_id_principal_id_fk",
1451
+ "tableFrom": "asset",
1452
+ "tableTo": "principal",
1453
+ "columnsFrom": ["creator_principal_id"],
1454
+ "columnsTo": ["id"],
1455
+ "onDelete": "set null",
1456
+ "onUpdate": "no action"
1457
+ }
1458
+ },
1459
+ "compositePrimaryKeys": {},
1460
+ "uniqueConstraints": {
1461
+ "asset_tenant_kind_name": {
1462
+ "name": "asset_tenant_kind_name",
1463
+ "nullsNotDistinct": false,
1464
+ "columns": ["tenant_id", "kind", "name"]
1465
+ }
1466
+ },
1467
+ "policies": {},
1468
+ "checkConstraints": {},
1469
+ "isRLSEnabled": false
1470
+ },
1471
+ "public.agent_asset": {
1472
+ "name": "agent_asset",
1473
+ "schema": "",
1474
+ "columns": {
1475
+ "id": {
1476
+ "name": "id",
1477
+ "type": "text",
1478
+ "primaryKey": true,
1479
+ "notNull": true
1480
+ },
1481
+ "agent_id": {
1482
+ "name": "agent_id",
1483
+ "type": "text",
1484
+ "primaryKey": false,
1485
+ "notNull": true
1486
+ },
1487
+ "asset_id": {
1488
+ "name": "asset_id",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": true
1492
+ },
1493
+ "ref": {
1494
+ "name": "ref",
1495
+ "type": "text",
1496
+ "primaryKey": false,
1497
+ "notNull": true
1498
+ },
1499
+ "access_mode": {
1500
+ "name": "access_mode",
1501
+ "type": "text",
1502
+ "primaryKey": false,
1503
+ "notNull": true,
1504
+ "default": "'read-only'"
1505
+ },
1506
+ "created_at": {
1507
+ "name": "created_at",
1508
+ "type": "timestamp",
1509
+ "primaryKey": false,
1510
+ "notNull": true,
1511
+ "default": "now()"
1512
+ }
1513
+ },
1514
+ "indexes": {},
1515
+ "foreignKeys": {
1516
+ "agent_asset_agent_id_agent_id_fk": {
1517
+ "name": "agent_asset_agent_id_agent_id_fk",
1518
+ "tableFrom": "agent_asset",
1519
+ "tableTo": "agent",
1520
+ "columnsFrom": ["agent_id"],
1521
+ "columnsTo": ["id"],
1522
+ "onDelete": "cascade",
1523
+ "onUpdate": "no action"
1524
+ },
1525
+ "agent_asset_asset_id_asset_id_fk": {
1526
+ "name": "agent_asset_asset_id_asset_id_fk",
1527
+ "tableFrom": "agent_asset",
1528
+ "tableTo": "asset",
1529
+ "columnsFrom": ["asset_id"],
1530
+ "columnsTo": ["id"],
1531
+ "onDelete": "cascade",
1532
+ "onUpdate": "no action"
1533
+ }
1534
+ },
1535
+ "compositePrimaryKeys": {},
1536
+ "uniqueConstraints": {
1537
+ "agent_asset_agent_asset": {
1538
+ "name": "agent_asset_agent_asset",
1539
+ "nullsNotDistinct": false,
1540
+ "columns": ["agent_id", "asset_id"]
1541
+ }
1542
+ },
1543
+ "policies": {},
1544
+ "checkConstraints": {},
1545
+ "isRLSEnabled": false
1546
+ },
1547
+ "public.transaction": {
1548
+ "name": "transaction",
1549
+ "schema": "",
1550
+ "columns": {
1551
+ "id": {
1552
+ "name": "id",
1553
+ "type": "text",
1554
+ "primaryKey": true,
1555
+ "notNull": true
1556
+ },
1557
+ "wallet_id": {
1558
+ "name": "wallet_id",
1559
+ "type": "text",
1560
+ "primaryKey": false,
1561
+ "notNull": true
1562
+ },
1563
+ "agent_id": {
1564
+ "name": "agent_id",
1565
+ "type": "text",
1566
+ "primaryKey": false,
1567
+ "notNull": false
1568
+ },
1569
+ "direction": {
1570
+ "name": "direction",
1571
+ "type": "text",
1572
+ "primaryKey": false,
1573
+ "notNull": true
1574
+ },
1575
+ "amount": {
1576
+ "name": "amount",
1577
+ "type": "text",
1578
+ "primaryKey": false,
1579
+ "notNull": true
1580
+ },
1581
+ "currency": {
1582
+ "name": "currency",
1583
+ "type": "text",
1584
+ "primaryKey": false,
1585
+ "notNull": true
1586
+ },
1587
+ "recipient_id": {
1588
+ "name": "recipient_id",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": false
1592
+ },
1593
+ "sender_id": {
1594
+ "name": "sender_id",
1595
+ "type": "text",
1596
+ "primaryKey": false,
1597
+ "notNull": false
1598
+ },
1599
+ "request_id": {
1600
+ "name": "request_id",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": false
1604
+ },
1605
+ "status": {
1606
+ "name": "status",
1607
+ "type": "text",
1608
+ "primaryKey": false,
1609
+ "notNull": true,
1610
+ "default": "'pending'"
1611
+ },
1612
+ "created_at": {
1613
+ "name": "created_at",
1614
+ "type": "timestamp",
1615
+ "primaryKey": false,
1616
+ "notNull": true,
1617
+ "default": "now()"
1618
+ }
1619
+ },
1620
+ "indexes": {},
1621
+ "foreignKeys": {
1622
+ "transaction_wallet_id_wallet_id_fk": {
1623
+ "name": "transaction_wallet_id_wallet_id_fk",
1624
+ "tableFrom": "transaction",
1625
+ "tableTo": "wallet",
1626
+ "columnsFrom": ["wallet_id"],
1627
+ "columnsTo": ["id"],
1628
+ "onDelete": "cascade",
1629
+ "onUpdate": "no action"
1630
+ },
1631
+ "transaction_agent_id_agent_id_fk": {
1632
+ "name": "transaction_agent_id_agent_id_fk",
1633
+ "tableFrom": "transaction",
1634
+ "tableTo": "agent",
1635
+ "columnsFrom": ["agent_id"],
1636
+ "columnsTo": ["id"],
1637
+ "onDelete": "set null",
1638
+ "onUpdate": "no action"
1639
+ }
1640
+ },
1641
+ "compositePrimaryKeys": {},
1642
+ "uniqueConstraints": {},
1643
+ "policies": {},
1644
+ "checkConstraints": {},
1645
+ "isRLSEnabled": false
1646
+ },
1647
+ "public.wallet": {
1648
+ "name": "wallet",
1649
+ "schema": "",
1650
+ "columns": {
1651
+ "id": {
1652
+ "name": "id",
1653
+ "type": "text",
1654
+ "primaryKey": true,
1655
+ "notNull": true
1656
+ },
1657
+ "tenant_id": {
1658
+ "name": "tenant_id",
1659
+ "type": "text",
1660
+ "primaryKey": false,
1661
+ "notNull": true
1662
+ },
1663
+ "name": {
1664
+ "name": "name",
1665
+ "type": "text",
1666
+ "primaryKey": false,
1667
+ "notNull": true
1668
+ },
1669
+ "backend_type": {
1670
+ "name": "backend_type",
1671
+ "type": "text",
1672
+ "primaryKey": false,
1673
+ "notNull": true
1674
+ },
1675
+ "currency": {
1676
+ "name": "currency",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": true
1680
+ },
1681
+ "balance": {
1682
+ "name": "balance",
1683
+ "type": "text",
1684
+ "primaryKey": false,
1685
+ "notNull": true,
1686
+ "default": "'0'"
1687
+ },
1688
+ "config": {
1689
+ "name": "config",
1690
+ "type": "jsonb",
1691
+ "primaryKey": false,
1692
+ "notNull": false
1693
+ },
1694
+ "created_at": {
1695
+ "name": "created_at",
1696
+ "type": "timestamp",
1697
+ "primaryKey": false,
1698
+ "notNull": true,
1699
+ "default": "now()"
1700
+ },
1701
+ "updated_at": {
1702
+ "name": "updated_at",
1703
+ "type": "timestamp",
1704
+ "primaryKey": false,
1705
+ "notNull": true,
1706
+ "default": "now()"
1707
+ }
1708
+ },
1709
+ "indexes": {},
1710
+ "foreignKeys": {
1711
+ "wallet_tenant_id_tenant_id_fk": {
1712
+ "name": "wallet_tenant_id_tenant_id_fk",
1713
+ "tableFrom": "wallet",
1714
+ "tableTo": "tenant",
1715
+ "columnsFrom": ["tenant_id"],
1716
+ "columnsTo": ["id"],
1717
+ "onDelete": "cascade",
1718
+ "onUpdate": "no action"
1719
+ }
1720
+ },
1721
+ "compositePrimaryKeys": {},
1722
+ "uniqueConstraints": {},
1723
+ "policies": {},
1724
+ "checkConstraints": {},
1725
+ "isRLSEnabled": false
1726
+ },
1727
+ "public.offering": {
1728
+ "name": "offering",
1729
+ "schema": "",
1730
+ "columns": {
1731
+ "id": {
1732
+ "name": "id",
1733
+ "type": "text",
1734
+ "primaryKey": true,
1735
+ "notNull": true
1736
+ },
1737
+ "agent_id": {
1738
+ "name": "agent_id",
1739
+ "type": "text",
1740
+ "primaryKey": false,
1741
+ "notNull": true
1742
+ },
1743
+ "tenant_id": {
1744
+ "name": "tenant_id",
1745
+ "type": "text",
1746
+ "primaryKey": false,
1747
+ "notNull": true
1748
+ },
1749
+ "name": {
1750
+ "name": "name",
1751
+ "type": "text",
1752
+ "primaryKey": false,
1753
+ "notNull": true
1754
+ },
1755
+ "description": {
1756
+ "name": "description",
1757
+ "type": "text",
1758
+ "primaryKey": false,
1759
+ "notNull": false
1760
+ },
1761
+ "pricing": {
1762
+ "name": "pricing",
1763
+ "type": "jsonb",
1764
+ "primaryKey": false,
1765
+ "notNull": false
1766
+ },
1767
+ "schema": {
1768
+ "name": "schema",
1769
+ "type": "jsonb",
1770
+ "primaryKey": false,
1771
+ "notNull": false
1772
+ },
1773
+ "created_at": {
1774
+ "name": "created_at",
1775
+ "type": "timestamp",
1776
+ "primaryKey": false,
1777
+ "notNull": true,
1778
+ "default": "now()"
1779
+ },
1780
+ "updated_at": {
1781
+ "name": "updated_at",
1782
+ "type": "timestamp",
1783
+ "primaryKey": false,
1784
+ "notNull": true,
1785
+ "default": "now()"
1786
+ }
1787
+ },
1788
+ "indexes": {},
1789
+ "foreignKeys": {
1790
+ "offering_agent_id_agent_id_fk": {
1791
+ "name": "offering_agent_id_agent_id_fk",
1792
+ "tableFrom": "offering",
1793
+ "tableTo": "agent",
1794
+ "columnsFrom": ["agent_id"],
1795
+ "columnsTo": ["id"],
1796
+ "onDelete": "cascade",
1797
+ "onUpdate": "no action"
1798
+ },
1799
+ "offering_tenant_id_tenant_id_fk": {
1800
+ "name": "offering_tenant_id_tenant_id_fk",
1801
+ "tableFrom": "offering",
1802
+ "tableTo": "tenant",
1803
+ "columnsFrom": ["tenant_id"],
1804
+ "columnsTo": ["id"],
1805
+ "onDelete": "cascade",
1806
+ "onUpdate": "no action"
1807
+ }
1808
+ },
1809
+ "compositePrimaryKeys": {},
1810
+ "uniqueConstraints": {},
1811
+ "policies": {},
1812
+ "checkConstraints": {},
1813
+ "isRLSEnabled": false
1814
+ },
1815
+ "public.model": {
1816
+ "name": "model",
1817
+ "schema": "",
1818
+ "columns": {
1819
+ "id": {
1820
+ "name": "id",
1821
+ "type": "text",
1822
+ "primaryKey": true,
1823
+ "notNull": true
1824
+ },
1825
+ "tenant_id": {
1826
+ "name": "tenant_id",
1827
+ "type": "text",
1828
+ "primaryKey": false,
1829
+ "notNull": true
1830
+ },
1831
+ "canonical_name": {
1832
+ "name": "canonical_name",
1833
+ "type": "text",
1834
+ "primaryKey": false,
1835
+ "notNull": true
1836
+ },
1837
+ "display_name": {
1838
+ "name": "display_name",
1839
+ "type": "text",
1840
+ "primaryKey": false,
1841
+ "notNull": false
1842
+ },
1843
+ "description": {
1844
+ "name": "description",
1845
+ "type": "text",
1846
+ "primaryKey": false,
1847
+ "notNull": false
1848
+ },
1849
+ "disabled": {
1850
+ "name": "disabled",
1851
+ "type": "boolean",
1852
+ "primaryKey": false,
1853
+ "notNull": true,
1854
+ "default": false
1855
+ },
1856
+ "created_at": {
1857
+ "name": "created_at",
1858
+ "type": "timestamp",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "default": "now()"
1862
+ },
1863
+ "updated_at": {
1864
+ "name": "updated_at",
1865
+ "type": "timestamp",
1866
+ "primaryKey": false,
1867
+ "notNull": true,
1868
+ "default": "now()"
1869
+ }
1870
+ },
1871
+ "indexes": {},
1872
+ "foreignKeys": {
1873
+ "model_tenant_id_tenant_id_fk": {
1874
+ "name": "model_tenant_id_tenant_id_fk",
1875
+ "tableFrom": "model",
1876
+ "tableTo": "tenant",
1877
+ "columnsFrom": ["tenant_id"],
1878
+ "columnsTo": ["id"],
1879
+ "onDelete": "cascade",
1880
+ "onUpdate": "no action"
1881
+ }
1882
+ },
1883
+ "compositePrimaryKeys": {},
1884
+ "uniqueConstraints": {
1885
+ "model_tenant_canonical_name": {
1886
+ "name": "model_tenant_canonical_name",
1887
+ "nullsNotDistinct": false,
1888
+ "columns": ["tenant_id", "canonical_name"]
1889
+ }
1890
+ },
1891
+ "policies": {},
1892
+ "checkConstraints": {},
1893
+ "isRLSEnabled": false
1894
+ },
1895
+ "public.model_offering": {
1896
+ "name": "model_offering",
1897
+ "schema": "",
1898
+ "columns": {
1899
+ "id": {
1900
+ "name": "id",
1901
+ "type": "text",
1902
+ "primaryKey": true,
1903
+ "notNull": true
1904
+ },
1905
+ "tenant_id": {
1906
+ "name": "tenant_id",
1907
+ "type": "text",
1908
+ "primaryKey": false,
1909
+ "notNull": true
1910
+ },
1911
+ "model_id": {
1912
+ "name": "model_id",
1913
+ "type": "text",
1914
+ "primaryKey": false,
1915
+ "notNull": true
1916
+ },
1917
+ "provider_id": {
1918
+ "name": "provider_id",
1919
+ "type": "text",
1920
+ "primaryKey": false,
1921
+ "notNull": true
1922
+ },
1923
+ "priority": {
1924
+ "name": "priority",
1925
+ "type": "integer",
1926
+ "primaryKey": false,
1927
+ "notNull": true
1928
+ },
1929
+ "deployment_tags": {
1930
+ "name": "deployment_tags",
1931
+ "type": "text[]",
1932
+ "primaryKey": false,
1933
+ "notNull": true,
1934
+ "default": "'{}'"
1935
+ },
1936
+ "capabilities": {
1937
+ "name": "capabilities",
1938
+ "type": "text[]",
1939
+ "primaryKey": false,
1940
+ "notNull": true,
1941
+ "default": "'{}'"
1942
+ },
1943
+ "disabled": {
1944
+ "name": "disabled",
1945
+ "type": "boolean",
1946
+ "primaryKey": false,
1947
+ "notNull": true,
1948
+ "default": false
1949
+ },
1950
+ "created_at": {
1951
+ "name": "created_at",
1952
+ "type": "timestamp",
1953
+ "primaryKey": false,
1954
+ "notNull": true,
1955
+ "default": "now()"
1956
+ },
1957
+ "updated_at": {
1958
+ "name": "updated_at",
1959
+ "type": "timestamp",
1960
+ "primaryKey": false,
1961
+ "notNull": true,
1962
+ "default": "now()"
1963
+ }
1964
+ },
1965
+ "indexes": {},
1966
+ "foreignKeys": {
1967
+ "model_offering_tenant_id_tenant_id_fk": {
1968
+ "name": "model_offering_tenant_id_tenant_id_fk",
1969
+ "tableFrom": "model_offering",
1970
+ "tableTo": "tenant",
1971
+ "columnsFrom": ["tenant_id"],
1972
+ "columnsTo": ["id"],
1973
+ "onDelete": "cascade",
1974
+ "onUpdate": "no action"
1975
+ },
1976
+ "model_offering_model_id_model_id_fk": {
1977
+ "name": "model_offering_model_id_model_id_fk",
1978
+ "tableFrom": "model_offering",
1979
+ "tableTo": "model",
1980
+ "columnsFrom": ["model_id"],
1981
+ "columnsTo": ["id"],
1982
+ "onDelete": "cascade",
1983
+ "onUpdate": "no action"
1984
+ },
1985
+ "model_offering_provider_id_model_provider_id_fk": {
1986
+ "name": "model_offering_provider_id_model_provider_id_fk",
1987
+ "tableFrom": "model_offering",
1988
+ "tableTo": "model_provider",
1989
+ "columnsFrom": ["provider_id"],
1990
+ "columnsTo": ["id"],
1991
+ "onDelete": "cascade",
1992
+ "onUpdate": "no action"
1993
+ }
1994
+ },
1995
+ "compositePrimaryKeys": {},
1996
+ "uniqueConstraints": {
1997
+ "model_offering_tenant_model_provider": {
1998
+ "name": "model_offering_tenant_model_provider",
1999
+ "nullsNotDistinct": false,
2000
+ "columns": ["tenant_id", "model_id", "provider_id"]
2001
+ }
2002
+ },
2003
+ "policies": {},
2004
+ "checkConstraints": {},
2005
+ "isRLSEnabled": false
2006
+ },
2007
+ "public.model_pricing": {
2008
+ "name": "model_pricing",
2009
+ "schema": "",
2010
+ "columns": {
2011
+ "id": {
2012
+ "name": "id",
2013
+ "type": "text",
2014
+ "primaryKey": true,
2015
+ "notNull": true
2016
+ },
2017
+ "tenant_id": {
2018
+ "name": "tenant_id",
2019
+ "type": "text",
2020
+ "primaryKey": false,
2021
+ "notNull": true
2022
+ },
2023
+ "offering_id": {
2024
+ "name": "offering_id",
2025
+ "type": "text",
2026
+ "primaryKey": false,
2027
+ "notNull": true
2028
+ },
2029
+ "currency": {
2030
+ "name": "currency",
2031
+ "type": "text",
2032
+ "primaryKey": false,
2033
+ "notNull": true
2034
+ },
2035
+ "input_token_price": {
2036
+ "name": "input_token_price",
2037
+ "type": "text",
2038
+ "primaryKey": false,
2039
+ "notNull": false
2040
+ },
2041
+ "output_token_price": {
2042
+ "name": "output_token_price",
2043
+ "type": "text",
2044
+ "primaryKey": false,
2045
+ "notNull": false
2046
+ },
2047
+ "cache_read_token_price": {
2048
+ "name": "cache_read_token_price",
2049
+ "type": "text",
2050
+ "primaryKey": false,
2051
+ "notNull": false
2052
+ },
2053
+ "cache_write_token_price": {
2054
+ "name": "cache_write_token_price",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false
2058
+ },
2059
+ "thinking_token_price": {
2060
+ "name": "thinking_token_price",
2061
+ "type": "text",
2062
+ "primaryKey": false,
2063
+ "notNull": false
2064
+ },
2065
+ "per_request_fee": {
2066
+ "name": "per_request_fee",
2067
+ "type": "text",
2068
+ "primaryKey": false,
2069
+ "notNull": false
2070
+ },
2071
+ "per_image_fee": {
2072
+ "name": "per_image_fee",
2073
+ "type": "text",
2074
+ "primaryKey": false,
2075
+ "notNull": false
2076
+ },
2077
+ "per_audio_fee": {
2078
+ "name": "per_audio_fee",
2079
+ "type": "text",
2080
+ "primaryKey": false,
2081
+ "notNull": false
2082
+ },
2083
+ "effective_from": {
2084
+ "name": "effective_from",
2085
+ "type": "timestamp with time zone",
2086
+ "primaryKey": false,
2087
+ "notNull": true
2088
+ },
2089
+ "created_at": {
2090
+ "name": "created_at",
2091
+ "type": "timestamp with time zone",
2092
+ "primaryKey": false,
2093
+ "notNull": true,
2094
+ "default": "now()"
2095
+ }
2096
+ },
2097
+ "indexes": {},
2098
+ "foreignKeys": {
2099
+ "model_pricing_tenant_id_tenant_id_fk": {
2100
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2101
+ "tableFrom": "model_pricing",
2102
+ "tableTo": "tenant",
2103
+ "columnsFrom": ["tenant_id"],
2104
+ "columnsTo": ["id"],
2105
+ "onDelete": "cascade",
2106
+ "onUpdate": "no action"
2107
+ },
2108
+ "model_pricing_offering_id_model_offering_id_fk": {
2109
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2110
+ "tableFrom": "model_pricing",
2111
+ "tableTo": "model_offering",
2112
+ "columnsFrom": ["offering_id"],
2113
+ "columnsTo": ["id"],
2114
+ "onDelete": "cascade",
2115
+ "onUpdate": "no action"
2116
+ }
2117
+ },
2118
+ "compositePrimaryKeys": {},
2119
+ "uniqueConstraints": {
2120
+ "model_pricing_offering_currency_effective_from": {
2121
+ "name": "model_pricing_offering_currency_effective_from",
2122
+ "nullsNotDistinct": false,
2123
+ "columns": ["offering_id", "currency", "effective_from"]
2124
+ }
2125
+ },
2126
+ "policies": {},
2127
+ "checkConstraints": {},
2128
+ "isRLSEnabled": false
2129
+ },
2130
+ "public.model_provider": {
2131
+ "name": "model_provider",
2132
+ "schema": "",
2133
+ "columns": {
2134
+ "id": {
2135
+ "name": "id",
2136
+ "type": "text",
2137
+ "primaryKey": true,
2138
+ "notNull": true
2139
+ },
2140
+ "tenant_id": {
2141
+ "name": "tenant_id",
2142
+ "type": "text",
2143
+ "primaryKey": false,
2144
+ "notNull": true
2145
+ },
2146
+ "name": {
2147
+ "name": "name",
2148
+ "type": "text",
2149
+ "primaryKey": false,
2150
+ "notNull": true
2151
+ },
2152
+ "plugin": {
2153
+ "name": "plugin",
2154
+ "type": "text",
2155
+ "primaryKey": false,
2156
+ "notNull": true
2157
+ },
2158
+ "base_url": {
2159
+ "name": "base_url",
2160
+ "type": "text",
2161
+ "primaryKey": false,
2162
+ "notNull": true
2163
+ },
2164
+ "credential_id": {
2165
+ "name": "credential_id",
2166
+ "type": "text",
2167
+ "primaryKey": false,
2168
+ "notNull": false
2169
+ },
2170
+ "wallet_id": {
2171
+ "name": "wallet_id",
2172
+ "type": "text",
2173
+ "primaryKey": false,
2174
+ "notNull": false
2175
+ },
2176
+ "disabled": {
2177
+ "name": "disabled",
2178
+ "type": "boolean",
2179
+ "primaryKey": false,
2180
+ "notNull": true,
2181
+ "default": false
2182
+ },
2183
+ "created_at": {
2184
+ "name": "created_at",
2185
+ "type": "timestamp",
2186
+ "primaryKey": false,
2187
+ "notNull": true,
2188
+ "default": "now()"
2189
+ },
2190
+ "updated_at": {
2191
+ "name": "updated_at",
2192
+ "type": "timestamp",
2193
+ "primaryKey": false,
2194
+ "notNull": true,
2195
+ "default": "now()"
2196
+ }
2197
+ },
2198
+ "indexes": {},
2199
+ "foreignKeys": {
2200
+ "model_provider_tenant_id_tenant_id_fk": {
2201
+ "name": "model_provider_tenant_id_tenant_id_fk",
2202
+ "tableFrom": "model_provider",
2203
+ "tableTo": "tenant",
2204
+ "columnsFrom": ["tenant_id"],
2205
+ "columnsTo": ["id"],
2206
+ "onDelete": "cascade",
2207
+ "onUpdate": "no action"
2208
+ },
2209
+ "model_provider_credential_id_credential_id_fk": {
2210
+ "name": "model_provider_credential_id_credential_id_fk",
2211
+ "tableFrom": "model_provider",
2212
+ "tableTo": "credential",
2213
+ "columnsFrom": ["credential_id"],
2214
+ "columnsTo": ["id"],
2215
+ "onDelete": "restrict",
2216
+ "onUpdate": "no action"
2217
+ },
2218
+ "model_provider_wallet_id_wallet_id_fk": {
2219
+ "name": "model_provider_wallet_id_wallet_id_fk",
2220
+ "tableFrom": "model_provider",
2221
+ "tableTo": "wallet",
2222
+ "columnsFrom": ["wallet_id"],
2223
+ "columnsTo": ["id"],
2224
+ "onDelete": "restrict",
2225
+ "onUpdate": "no action"
2226
+ }
2227
+ },
2228
+ "compositePrimaryKeys": {},
2229
+ "uniqueConstraints": {
2230
+ "model_provider_tenant_name": {
2231
+ "name": "model_provider_tenant_name",
2232
+ "nullsNotDistinct": false,
2233
+ "columns": ["tenant_id", "name"]
2234
+ }
2235
+ },
2236
+ "policies": {},
2237
+ "checkConstraints": {
2238
+ "model_provider_auth_xor": {
2239
+ "name": "model_provider_auth_xor",
2240
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2241
+ }
2242
+ },
2243
+ "isRLSEnabled": false
2244
+ },
2245
+ "public.sidecar": {
2246
+ "name": "sidecar",
2247
+ "schema": "",
2248
+ "columns": {
2249
+ "id": {
2250
+ "name": "id",
2251
+ "type": "text",
2252
+ "primaryKey": true,
2253
+ "notNull": true
2254
+ },
2255
+ "url": {
2256
+ "name": "url",
2257
+ "type": "text",
2258
+ "primaryKey": false,
2259
+ "notNull": true
2260
+ },
2261
+ "status": {
2262
+ "name": "status",
2263
+ "type": "text",
2264
+ "primaryKey": false,
2265
+ "notNull": true,
2266
+ "default": "'online'"
2267
+ },
2268
+ "last_heartbeat": {
2269
+ "name": "last_heartbeat",
2270
+ "type": "timestamp",
2271
+ "primaryKey": false,
2272
+ "notNull": false
2273
+ },
2274
+ "created_at": {
2275
+ "name": "created_at",
2276
+ "type": "timestamp",
2277
+ "primaryKey": false,
2278
+ "notNull": true,
2279
+ "default": "now()"
2280
+ },
2281
+ "updated_at": {
2282
+ "name": "updated_at",
2283
+ "type": "timestamp",
2284
+ "primaryKey": false,
2285
+ "notNull": true,
2286
+ "default": "now()"
2287
+ }
2288
+ },
2289
+ "indexes": {},
2290
+ "foreignKeys": {},
2291
+ "compositePrimaryKeys": {},
2292
+ "uniqueConstraints": {},
2293
+ "policies": {},
2294
+ "checkConstraints": {},
2295
+ "isRLSEnabled": false
2296
+ },
2297
+ "public.agent_session": {
2298
+ "name": "agent_session",
2299
+ "schema": "",
2300
+ "columns": {
2301
+ "id": {
2302
+ "name": "id",
2303
+ "type": "text",
2304
+ "primaryKey": true,
2305
+ "notNull": true
2306
+ },
2307
+ "tenant_id": {
2308
+ "name": "tenant_id",
2309
+ "type": "text",
2310
+ "primaryKey": false,
2311
+ "notNull": true
2312
+ },
2313
+ "agent_id": {
2314
+ "name": "agent_id",
2315
+ "type": "text",
2316
+ "primaryKey": false,
2317
+ "notNull": true
2318
+ },
2319
+ "principal_id": {
2320
+ "name": "principal_id",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": true
2324
+ },
2325
+ "status": {
2326
+ "name": "status",
2327
+ "type": "text",
2328
+ "primaryKey": false,
2329
+ "notNull": true,
2330
+ "default": "'active'"
2331
+ },
2332
+ "created_at": {
2333
+ "name": "created_at",
2334
+ "type": "timestamp",
2335
+ "primaryKey": false,
2336
+ "notNull": true,
2337
+ "default": "now()"
2338
+ },
2339
+ "updated_at": {
2340
+ "name": "updated_at",
2341
+ "type": "timestamp",
2342
+ "primaryKey": false,
2343
+ "notNull": true,
2344
+ "default": "now()"
2345
+ },
2346
+ "ended_at": {
2347
+ "name": "ended_at",
2348
+ "type": "timestamp",
2349
+ "primaryKey": false,
2350
+ "notNull": false
2351
+ }
2352
+ },
2353
+ "indexes": {},
2354
+ "foreignKeys": {
2355
+ "agent_session_tenant_id_tenant_id_fk": {
2356
+ "name": "agent_session_tenant_id_tenant_id_fk",
2357
+ "tableFrom": "agent_session",
2358
+ "tableTo": "tenant",
2359
+ "columnsFrom": ["tenant_id"],
2360
+ "columnsTo": ["id"],
2361
+ "onDelete": "cascade",
2362
+ "onUpdate": "no action"
2363
+ },
2364
+ "agent_session_agent_id_agent_id_fk": {
2365
+ "name": "agent_session_agent_id_agent_id_fk",
2366
+ "tableFrom": "agent_session",
2367
+ "tableTo": "agent",
2368
+ "columnsFrom": ["agent_id"],
2369
+ "columnsTo": ["id"],
2370
+ "onDelete": "cascade",
2371
+ "onUpdate": "no action"
2372
+ },
2373
+ "agent_session_principal_id_principal_id_fk": {
2374
+ "name": "agent_session_principal_id_principal_id_fk",
2375
+ "tableFrom": "agent_session",
2376
+ "tableTo": "principal",
2377
+ "columnsFrom": ["principal_id"],
2378
+ "columnsTo": ["id"],
2379
+ "onDelete": "no action",
2380
+ "onUpdate": "no action"
2381
+ }
2382
+ },
2383
+ "compositePrimaryKeys": {},
2384
+ "uniqueConstraints": {},
2385
+ "policies": {},
2386
+ "checkConstraints": {},
2387
+ "isRLSEnabled": false
2388
+ },
2389
+ "public.agent_instance": {
2390
+ "name": "agent_instance",
2391
+ "schema": "",
2392
+ "columns": {
2393
+ "id": {
2394
+ "name": "id",
2395
+ "type": "text",
2396
+ "primaryKey": true,
2397
+ "notNull": true
2398
+ },
2399
+ "agent_id": {
2400
+ "name": "agent_id",
2401
+ "type": "text",
2402
+ "primaryKey": false,
2403
+ "notNull": true
2404
+ },
2405
+ "tenant_id": {
2406
+ "name": "tenant_id",
2407
+ "type": "text",
2408
+ "primaryKey": false,
2409
+ "notNull": true
2410
+ },
2411
+ "principal_id": {
2412
+ "name": "principal_id",
2413
+ "type": "text",
2414
+ "primaryKey": false,
2415
+ "notNull": true
2416
+ },
2417
+ "address": {
2418
+ "name": "address",
2419
+ "type": "text",
2420
+ "primaryKey": false,
2421
+ "notNull": true
2422
+ },
2423
+ "version_id": {
2424
+ "name": "version_id",
2425
+ "type": "text",
2426
+ "primaryKey": false,
2427
+ "notNull": false
2428
+ },
2429
+ "session_id": {
2430
+ "name": "session_id",
2431
+ "type": "text",
2432
+ "primaryKey": false,
2433
+ "notNull": false
2434
+ },
2435
+ "status": {
2436
+ "name": "status",
2437
+ "type": "text",
2438
+ "primaryKey": false,
2439
+ "notNull": true,
2440
+ "default": "'deployed'"
2441
+ },
2442
+ "sidecar_id": {
2443
+ "name": "sidecar_id",
2444
+ "type": "text",
2445
+ "primaryKey": false,
2446
+ "notNull": false
2447
+ },
2448
+ "public_key": {
2449
+ "name": "public_key",
2450
+ "type": "text",
2451
+ "primaryKey": false,
2452
+ "notNull": false
2453
+ },
2454
+ "kernel_id": {
2455
+ "name": "kernel_id",
2456
+ "type": "text",
2457
+ "primaryKey": false,
2458
+ "notNull": false
2459
+ },
2460
+ "model_preferences": {
2461
+ "name": "model_preferences",
2462
+ "type": "jsonb",
2463
+ "primaryKey": false,
2464
+ "notNull": false
2465
+ },
2466
+ "created_at": {
2467
+ "name": "created_at",
2468
+ "type": "timestamp",
2469
+ "primaryKey": false,
2470
+ "notNull": true,
2471
+ "default": "now()"
2472
+ },
2473
+ "updated_at": {
2474
+ "name": "updated_at",
2475
+ "type": "timestamp",
2476
+ "primaryKey": false,
2477
+ "notNull": true,
2478
+ "default": "now()"
2479
+ },
2480
+ "ended_at": {
2481
+ "name": "ended_at",
2482
+ "type": "timestamp",
2483
+ "primaryKey": false,
2484
+ "notNull": false
2485
+ }
2486
+ },
2487
+ "indexes": {},
2488
+ "foreignKeys": {
2489
+ "agent_instance_agent_id_agent_id_fk": {
2490
+ "name": "agent_instance_agent_id_agent_id_fk",
2491
+ "tableFrom": "agent_instance",
2492
+ "tableTo": "agent",
2493
+ "columnsFrom": ["agent_id"],
2494
+ "columnsTo": ["id"],
2495
+ "onDelete": "cascade",
2496
+ "onUpdate": "no action"
2497
+ },
2498
+ "agent_instance_tenant_id_tenant_id_fk": {
2499
+ "name": "agent_instance_tenant_id_tenant_id_fk",
2500
+ "tableFrom": "agent_instance",
2501
+ "tableTo": "tenant",
2502
+ "columnsFrom": ["tenant_id"],
2503
+ "columnsTo": ["id"],
2504
+ "onDelete": "cascade",
2505
+ "onUpdate": "no action"
2506
+ },
2507
+ "agent_instance_principal_id_principal_id_fk": {
2508
+ "name": "agent_instance_principal_id_principal_id_fk",
2509
+ "tableFrom": "agent_instance",
2510
+ "tableTo": "principal",
2511
+ "columnsFrom": ["principal_id"],
2512
+ "columnsTo": ["id"],
2513
+ "onDelete": "no action",
2514
+ "onUpdate": "no action"
2515
+ },
2516
+ "agent_instance_version_id_agent_version_id_fk": {
2517
+ "name": "agent_instance_version_id_agent_version_id_fk",
2518
+ "tableFrom": "agent_instance",
2519
+ "tableTo": "agent_version",
2520
+ "columnsFrom": ["version_id"],
2521
+ "columnsTo": ["id"],
2522
+ "onDelete": "no action",
2523
+ "onUpdate": "no action"
2524
+ },
2525
+ "agent_instance_session_id_agent_session_id_fk": {
2526
+ "name": "agent_instance_session_id_agent_session_id_fk",
2527
+ "tableFrom": "agent_instance",
2528
+ "tableTo": "agent_session",
2529
+ "columnsFrom": ["session_id"],
2530
+ "columnsTo": ["id"],
2531
+ "onDelete": "no action",
2532
+ "onUpdate": "no action"
2533
+ },
2534
+ "agent_instance_sidecar_id_sidecar_id_fk": {
2535
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
2536
+ "tableFrom": "agent_instance",
2537
+ "tableTo": "sidecar",
2538
+ "columnsFrom": ["sidecar_id"],
2539
+ "columnsTo": ["id"],
2540
+ "onDelete": "set null",
2541
+ "onUpdate": "no action"
2542
+ }
2543
+ },
2544
+ "compositePrimaryKeys": {},
2545
+ "uniqueConstraints": {
2546
+ "agent_instance_address_unique": {
2547
+ "name": "agent_instance_address_unique",
2548
+ "nullsNotDistinct": false,
2549
+ "columns": ["address"]
2550
+ }
2551
+ },
2552
+ "policies": {},
2553
+ "checkConstraints": {},
2554
+ "isRLSEnabled": false
2555
+ },
2556
+ "public.session_asset": {
2557
+ "name": "session_asset",
2558
+ "schema": "",
2559
+ "columns": {
2560
+ "instance_id": {
2561
+ "name": "instance_id",
2562
+ "type": "text",
2563
+ "primaryKey": false,
2564
+ "notNull": true
2565
+ },
2566
+ "agent_asset_id": {
2567
+ "name": "agent_asset_id",
2568
+ "type": "text",
2569
+ "primaryKey": false,
2570
+ "notNull": false
2571
+ },
2572
+ "mount_path": {
2573
+ "name": "mount_path",
2574
+ "type": "text",
2575
+ "primaryKey": false,
2576
+ "notNull": true
2577
+ },
2578
+ "asset_pack_sha": {
2579
+ "name": "asset_pack_sha",
2580
+ "type": "text",
2581
+ "primaryKey": false,
2582
+ "notNull": true
2583
+ },
2584
+ "source_commit_sha": {
2585
+ "name": "source_commit_sha",
2586
+ "type": "text",
2587
+ "primaryKey": false,
2588
+ "notNull": true
2589
+ },
2590
+ "source": {
2591
+ "name": "source",
2592
+ "type": "text",
2593
+ "primaryKey": false,
2594
+ "notNull": true
2595
+ },
2596
+ "materialized_at": {
2597
+ "name": "materialized_at",
2598
+ "type": "timestamp",
2599
+ "primaryKey": false,
2600
+ "notNull": true,
2601
+ "default": "now()"
2602
+ }
2603
+ },
2604
+ "indexes": {
2605
+ "session_asset_pack_sha_idx": {
2606
+ "name": "session_asset_pack_sha_idx",
2607
+ "columns": [
2608
+ {
2609
+ "expression": "asset_pack_sha",
2610
+ "isExpression": false,
2611
+ "asc": true,
2612
+ "nulls": "last"
2613
+ }
2614
+ ],
2615
+ "isUnique": false,
2616
+ "concurrently": false,
2617
+ "method": "btree",
2618
+ "with": {}
2619
+ }
2620
+ },
2621
+ "foreignKeys": {
2622
+ "session_asset_instance_id_agent_instance_id_fk": {
2623
+ "name": "session_asset_instance_id_agent_instance_id_fk",
2624
+ "tableFrom": "session_asset",
2625
+ "tableTo": "agent_instance",
2626
+ "columnsFrom": ["instance_id"],
2627
+ "columnsTo": ["id"],
2628
+ "onDelete": "cascade",
2629
+ "onUpdate": "no action"
2630
+ },
2631
+ "session_asset_agent_asset_id_agent_asset_id_fk": {
2632
+ "name": "session_asset_agent_asset_id_agent_asset_id_fk",
2633
+ "tableFrom": "session_asset",
2634
+ "tableTo": "agent_asset",
2635
+ "columnsFrom": ["agent_asset_id"],
2636
+ "columnsTo": ["id"],
2637
+ "onDelete": "cascade",
2638
+ "onUpdate": "no action"
2639
+ }
2640
+ },
2641
+ "compositePrimaryKeys": {
2642
+ "session_asset_instance_id_mount_path_pk": {
2643
+ "name": "session_asset_instance_id_mount_path_pk",
2644
+ "columns": ["instance_id", "mount_path"]
2645
+ }
2646
+ },
2647
+ "uniqueConstraints": {},
2648
+ "policies": {},
2649
+ "checkConstraints": {},
2650
+ "isRLSEnabled": false
2651
+ },
2652
+ "public.inference_turn": {
2653
+ "name": "inference_turn",
2654
+ "schema": "",
2655
+ "columns": {
2656
+ "id": {
2657
+ "name": "id",
2658
+ "type": "text",
2659
+ "primaryKey": true,
2660
+ "notNull": true
2661
+ },
2662
+ "session_id": {
2663
+ "name": "session_id",
2664
+ "type": "text",
2665
+ "primaryKey": false,
2666
+ "notNull": true
2667
+ },
2668
+ "instance_id": {
2669
+ "name": "instance_id",
2670
+ "type": "text",
2671
+ "primaryKey": false,
2672
+ "notNull": true
2673
+ },
2674
+ "tenant_id": {
2675
+ "name": "tenant_id",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": true
2679
+ },
2680
+ "model": {
2681
+ "name": "model",
2682
+ "type": "text",
2683
+ "primaryKey": false,
2684
+ "notNull": true
2685
+ },
2686
+ "status": {
2687
+ "name": "status",
2688
+ "type": "text",
2689
+ "primaryKey": false,
2690
+ "notNull": true,
2691
+ "default": "'running'"
2692
+ },
2693
+ "started_at": {
2694
+ "name": "started_at",
2695
+ "type": "timestamp",
2696
+ "primaryKey": false,
2697
+ "notNull": true
2698
+ },
2699
+ "ended_at": {
2700
+ "name": "ended_at",
2701
+ "type": "timestamp",
2702
+ "primaryKey": false,
2703
+ "notNull": false
2704
+ }
2705
+ },
2706
+ "indexes": {
2707
+ "inference_turn_instance_id_started_at_idx": {
2708
+ "name": "inference_turn_instance_id_started_at_idx",
2709
+ "columns": [
2710
+ {
2711
+ "expression": "instance_id",
2712
+ "isExpression": false,
2713
+ "asc": true,
2714
+ "nulls": "last"
2715
+ },
2716
+ {
2717
+ "expression": "started_at",
2718
+ "isExpression": false,
2719
+ "asc": true,
2720
+ "nulls": "last"
2721
+ }
2722
+ ],
2723
+ "isUnique": false,
2724
+ "concurrently": false,
2725
+ "method": "btree",
2726
+ "with": {}
2727
+ }
2728
+ },
2729
+ "foreignKeys": {
2730
+ "inference_turn_session_id_agent_session_id_fk": {
2731
+ "name": "inference_turn_session_id_agent_session_id_fk",
2732
+ "tableFrom": "inference_turn",
2733
+ "tableTo": "agent_session",
2734
+ "columnsFrom": ["session_id"],
2735
+ "columnsTo": ["id"],
2736
+ "onDelete": "cascade",
2737
+ "onUpdate": "no action"
2738
+ },
2739
+ "inference_turn_instance_id_agent_instance_id_fk": {
2740
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2741
+ "tableFrom": "inference_turn",
2742
+ "tableTo": "agent_instance",
2743
+ "columnsFrom": ["instance_id"],
2744
+ "columnsTo": ["id"],
2745
+ "onDelete": "cascade",
2746
+ "onUpdate": "no action"
2747
+ },
2748
+ "inference_turn_tenant_id_tenant_id_fk": {
2749
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2750
+ "tableFrom": "inference_turn",
2751
+ "tableTo": "tenant",
2752
+ "columnsFrom": ["tenant_id"],
2753
+ "columnsTo": ["id"],
2754
+ "onDelete": "cascade",
2755
+ "onUpdate": "no action"
2756
+ }
2757
+ },
2758
+ "compositePrimaryKeys": {},
2759
+ "uniqueConstraints": {},
2760
+ "policies": {},
2761
+ "checkConstraints": {},
2762
+ "isRLSEnabled": false
2763
+ },
2764
+ "public.session_mail": {
2765
+ "name": "session_mail",
2766
+ "schema": "",
2767
+ "columns": {
2768
+ "id": {
2769
+ "name": "id",
2770
+ "type": "text",
2771
+ "primaryKey": true,
2772
+ "notNull": true
2773
+ },
2774
+ "session_id": {
2775
+ "name": "session_id",
2776
+ "type": "text",
2777
+ "primaryKey": false,
2778
+ "notNull": true
2779
+ },
2780
+ "instance_id": {
2781
+ "name": "instance_id",
2782
+ "type": "text",
2783
+ "primaryKey": false,
2784
+ "notNull": false
2785
+ },
2786
+ "tenant_id": {
2787
+ "name": "tenant_id",
2788
+ "type": "text",
2789
+ "primaryKey": false,
2790
+ "notNull": true
2791
+ },
2792
+ "direction": {
2793
+ "name": "direction",
2794
+ "type": "text",
2795
+ "primaryKey": false,
2796
+ "notNull": true
2797
+ },
2798
+ "status": {
2799
+ "name": "status",
2800
+ "type": "text",
2801
+ "primaryKey": false,
2802
+ "notNull": true,
2803
+ "default": "'pending'"
2804
+ },
2805
+ "raw": {
2806
+ "name": "raw",
2807
+ "type": "bytea",
2808
+ "primaryKey": false,
2809
+ "notNull": true
2810
+ },
2811
+ "created_at": {
2812
+ "name": "created_at",
2813
+ "type": "timestamp",
2814
+ "primaryKey": false,
2815
+ "notNull": true,
2816
+ "default": "now()"
2817
+ }
2818
+ },
2819
+ "indexes": {
2820
+ "session_mail_instance_id_created_at_idx": {
2821
+ "name": "session_mail_instance_id_created_at_idx",
2822
+ "columns": [
2823
+ {
2824
+ "expression": "instance_id",
2825
+ "isExpression": false,
2826
+ "asc": true,
2827
+ "nulls": "last"
2828
+ },
2829
+ {
2830
+ "expression": "created_at",
2831
+ "isExpression": false,
2832
+ "asc": true,
2833
+ "nulls": "last"
2834
+ }
2835
+ ],
2836
+ "isUnique": false,
2837
+ "concurrently": false,
2838
+ "method": "btree",
2839
+ "with": {}
2840
+ }
2841
+ },
2842
+ "foreignKeys": {
2843
+ "session_mail_session_id_agent_session_id_fk": {
2844
+ "name": "session_mail_session_id_agent_session_id_fk",
2845
+ "tableFrom": "session_mail",
2846
+ "tableTo": "agent_session",
2847
+ "columnsFrom": ["session_id"],
2848
+ "columnsTo": ["id"],
2849
+ "onDelete": "cascade",
2850
+ "onUpdate": "no action"
2851
+ },
2852
+ "session_mail_instance_id_agent_instance_id_fk": {
2853
+ "name": "session_mail_instance_id_agent_instance_id_fk",
2854
+ "tableFrom": "session_mail",
2855
+ "tableTo": "agent_instance",
2856
+ "columnsFrom": ["instance_id"],
2857
+ "columnsTo": ["id"],
2858
+ "onDelete": "set null",
2859
+ "onUpdate": "no action"
2860
+ },
2861
+ "session_mail_tenant_id_tenant_id_fk": {
2862
+ "name": "session_mail_tenant_id_tenant_id_fk",
2863
+ "tableFrom": "session_mail",
2864
+ "tableTo": "tenant",
2865
+ "columnsFrom": ["tenant_id"],
2866
+ "columnsTo": ["id"],
2867
+ "onDelete": "cascade",
2868
+ "onUpdate": "no action"
2869
+ }
2870
+ },
2871
+ "compositePrimaryKeys": {},
2872
+ "uniqueConstraints": {},
2873
+ "policies": {},
2874
+ "checkConstraints": {},
2875
+ "isRLSEnabled": false
2876
+ },
2877
+ "public.turn_part": {
2878
+ "name": "turn_part",
2879
+ "schema": "",
2880
+ "columns": {
2881
+ "id": {
2882
+ "name": "id",
2883
+ "type": "text",
2884
+ "primaryKey": true,
2885
+ "notNull": true
2886
+ },
2887
+ "turn_id": {
2888
+ "name": "turn_id",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "session_id": {
2894
+ "name": "session_id",
2895
+ "type": "text",
2896
+ "primaryKey": false,
2897
+ "notNull": true
2898
+ },
2899
+ "type": {
2900
+ "name": "type",
2901
+ "type": "text",
2902
+ "primaryKey": false,
2903
+ "notNull": true
2904
+ },
2905
+ "content": {
2906
+ "name": "content",
2907
+ "type": "text",
2908
+ "primaryKey": false,
2909
+ "notNull": false
2910
+ },
2911
+ "metadata": {
2912
+ "name": "metadata",
2913
+ "type": "jsonb",
2914
+ "primaryKey": false,
2915
+ "notNull": false
2916
+ },
2917
+ "ordinal": {
2918
+ "name": "ordinal",
2919
+ "type": "integer",
2920
+ "primaryKey": false,
2921
+ "notNull": true
2922
+ }
2923
+ },
2924
+ "indexes": {},
2925
+ "foreignKeys": {
2926
+ "turn_part_turn_id_inference_turn_id_fk": {
2927
+ "name": "turn_part_turn_id_inference_turn_id_fk",
2928
+ "tableFrom": "turn_part",
2929
+ "tableTo": "inference_turn",
2930
+ "columnsFrom": ["turn_id"],
2931
+ "columnsTo": ["id"],
2932
+ "onDelete": "cascade",
2933
+ "onUpdate": "no action"
2934
+ },
2935
+ "turn_part_session_id_agent_session_id_fk": {
2936
+ "name": "turn_part_session_id_agent_session_id_fk",
2937
+ "tableFrom": "turn_part",
2938
+ "tableTo": "agent_session",
2939
+ "columnsFrom": ["session_id"],
2940
+ "columnsTo": ["id"],
2941
+ "onDelete": "cascade",
2942
+ "onUpdate": "no action"
2943
+ }
2944
+ },
2945
+ "compositePrimaryKeys": {},
2946
+ "uniqueConstraints": {},
2947
+ "policies": {},
2948
+ "checkConstraints": {},
2949
+ "isRLSEnabled": false
2950
+ },
2951
+ "public.git_token": {
2952
+ "name": "git_token",
2953
+ "schema": "",
2954
+ "columns": {
2955
+ "id": {
2956
+ "name": "id",
2957
+ "type": "text",
2958
+ "primaryKey": true,
2959
+ "notNull": true
2960
+ },
2961
+ "tenant_id": {
2962
+ "name": "tenant_id",
2963
+ "type": "text",
2964
+ "primaryKey": false,
2965
+ "notNull": false
2966
+ },
2967
+ "user_id": {
2968
+ "name": "user_id",
2969
+ "type": "text",
2970
+ "primaryKey": false,
2971
+ "notNull": true
2972
+ },
2973
+ "principal_id": {
2974
+ "name": "principal_id",
2975
+ "type": "text",
2976
+ "primaryKey": false,
2977
+ "notNull": false
2978
+ },
2979
+ "name": {
2980
+ "name": "name",
2981
+ "type": "text",
2982
+ "primaryKey": false,
2983
+ "notNull": true
2984
+ },
2985
+ "kind": {
2986
+ "name": "kind",
2987
+ "type": "text",
2988
+ "primaryKey": false,
2989
+ "notNull": true
2990
+ },
2991
+ "token_hash_sha256": {
2992
+ "name": "token_hash_sha256",
2993
+ "type": "bytea",
2994
+ "primaryKey": false,
2995
+ "notNull": true
2996
+ },
2997
+ "resource": {
2998
+ "name": "resource",
2999
+ "type": "text",
3000
+ "primaryKey": false,
3001
+ "notNull": true
3002
+ },
3003
+ "ref_pattern": {
3004
+ "name": "ref_pattern",
3005
+ "type": "text",
3006
+ "primaryKey": false,
3007
+ "notNull": true
3008
+ },
3009
+ "actions": {
3010
+ "name": "actions",
3011
+ "type": "text[]",
3012
+ "primaryKey": false,
3013
+ "notNull": true
3014
+ },
3015
+ "expires_at": {
3016
+ "name": "expires_at",
3017
+ "type": "timestamp with time zone",
3018
+ "primaryKey": false,
3019
+ "notNull": true
3020
+ },
3021
+ "revoked_at": {
3022
+ "name": "revoked_at",
3023
+ "type": "timestamp with time zone",
3024
+ "primaryKey": false,
3025
+ "notNull": false
3026
+ },
3027
+ "created_at": {
3028
+ "name": "created_at",
3029
+ "type": "timestamp with time zone",
3030
+ "primaryKey": false,
3031
+ "notNull": true,
3032
+ "default": "now()"
3033
+ }
3034
+ },
3035
+ "indexes": {
3036
+ "git_token_user_id_name_active_idx": {
3037
+ "name": "git_token_user_id_name_active_idx",
3038
+ "columns": [
3039
+ {
3040
+ "expression": "user_id",
3041
+ "isExpression": false,
3042
+ "asc": true,
3043
+ "nulls": "last"
3044
+ },
3045
+ {
3046
+ "expression": "name",
3047
+ "isExpression": false,
3048
+ "asc": true,
3049
+ "nulls": "last"
3050
+ }
3051
+ ],
3052
+ "isUnique": true,
3053
+ "where": "\"git_token\".\"revoked_at\" is null",
3054
+ "concurrently": false,
3055
+ "method": "btree",
3056
+ "with": {}
3057
+ }
3058
+ },
3059
+ "foreignKeys": {
3060
+ "git_token_tenant_id_tenant_id_fk": {
3061
+ "name": "git_token_tenant_id_tenant_id_fk",
3062
+ "tableFrom": "git_token",
3063
+ "tableTo": "tenant",
3064
+ "columnsFrom": ["tenant_id"],
3065
+ "columnsTo": ["id"],
3066
+ "onDelete": "no action",
3067
+ "onUpdate": "no action"
3068
+ },
3069
+ "git_token_user_id_user_id_fk": {
3070
+ "name": "git_token_user_id_user_id_fk",
3071
+ "tableFrom": "git_token",
3072
+ "tableTo": "user",
3073
+ "columnsFrom": ["user_id"],
3074
+ "columnsTo": ["id"],
3075
+ "onDelete": "cascade",
3076
+ "onUpdate": "no action"
3077
+ },
3078
+ "git_token_principal_id_principal_id_fk": {
3079
+ "name": "git_token_principal_id_principal_id_fk",
3080
+ "tableFrom": "git_token",
3081
+ "tableTo": "principal",
3082
+ "columnsFrom": ["principal_id"],
3083
+ "columnsTo": ["id"],
3084
+ "onDelete": "cascade",
3085
+ "onUpdate": "no action"
3086
+ }
3087
+ },
3088
+ "compositePrimaryKeys": {},
3089
+ "uniqueConstraints": {
3090
+ "git_token_token_hash_sha256_unique": {
3091
+ "name": "git_token_token_hash_sha256_unique",
3092
+ "nullsNotDistinct": false,
3093
+ "columns": ["token_hash_sha256"]
3094
+ }
3095
+ },
3096
+ "policies": {},
3097
+ "checkConstraints": {},
3098
+ "isRLSEnabled": false
3099
+ },
3100
+ "public.workflow_deployment": {
3101
+ "name": "workflow_deployment",
3102
+ "schema": "",
3103
+ "columns": {
3104
+ "id": {
3105
+ "name": "id",
3106
+ "type": "text",
3107
+ "primaryKey": true,
3108
+ "notNull": true
3109
+ },
3110
+ "tenant_id": {
3111
+ "name": "tenant_id",
3112
+ "type": "text",
3113
+ "primaryKey": false,
3114
+ "notNull": true
3115
+ },
3116
+ "definition_asset_id": {
3117
+ "name": "definition_asset_id",
3118
+ "type": "text",
3119
+ "primaryKey": false,
3120
+ "notNull": true
3121
+ },
3122
+ "status": {
3123
+ "name": "status",
3124
+ "type": "text",
3125
+ "primaryKey": false,
3126
+ "notNull": true,
3127
+ "default": "'deployed'"
3128
+ },
3129
+ "created_at": {
3130
+ "name": "created_at",
3131
+ "type": "timestamp",
3132
+ "primaryKey": false,
3133
+ "notNull": true,
3134
+ "default": "now()"
3135
+ }
3136
+ },
3137
+ "indexes": {
3138
+ "workflow_deployment_tenant_idx": {
3139
+ "name": "workflow_deployment_tenant_idx",
3140
+ "columns": [
3141
+ {
3142
+ "expression": "tenant_id",
3143
+ "isExpression": false,
3144
+ "asc": true,
3145
+ "nulls": "last"
3146
+ },
3147
+ {
3148
+ "expression": "created_at",
3149
+ "isExpression": false,
3150
+ "asc": true,
3151
+ "nulls": "last"
3152
+ }
3153
+ ],
3154
+ "isUnique": false,
3155
+ "concurrently": false,
3156
+ "method": "btree",
3157
+ "with": {}
3158
+ }
3159
+ },
3160
+ "foreignKeys": {
3161
+ "workflow_deployment_tenant_id_tenant_id_fk": {
3162
+ "name": "workflow_deployment_tenant_id_tenant_id_fk",
3163
+ "tableFrom": "workflow_deployment",
3164
+ "tableTo": "tenant",
3165
+ "columnsFrom": ["tenant_id"],
3166
+ "columnsTo": ["id"],
3167
+ "onDelete": "cascade",
3168
+ "onUpdate": "no action"
3169
+ },
3170
+ "workflow_deployment_definition_asset_id_asset_id_fk": {
3171
+ "name": "workflow_deployment_definition_asset_id_asset_id_fk",
3172
+ "tableFrom": "workflow_deployment",
3173
+ "tableTo": "asset",
3174
+ "columnsFrom": ["definition_asset_id"],
3175
+ "columnsTo": ["id"],
3176
+ "onDelete": "cascade",
3177
+ "onUpdate": "no action"
3178
+ }
3179
+ },
3180
+ "compositePrimaryKeys": {},
3181
+ "uniqueConstraints": {},
3182
+ "policies": {},
3183
+ "checkConstraints": {},
3184
+ "isRLSEnabled": false
3185
+ }
3186
+ },
3187
+ "enums": {},
3188
+ "schemas": {},
3189
+ "sequences": {},
3190
+ "roles": {},
3191
+ "policies": {},
3192
+ "views": {},
3193
+ "_meta": {
3194
+ "columns": {},
3195
+ "schemas": {},
3196
+ "tables": {}
3197
+ }
3198
+ }