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