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