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