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