@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,3952 @@
1
+ {
2
+ "id": "1537d65e-9d57-46dc-af4a-0cc19826eb39",
3
+ "prevId": "e59d70b0-8e30-433f-b6ca-a03f832bfd0a",
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
+ "columnsFrom": ["user_id"],
98
+ "tableTo": "user",
99
+ "columnsTo": ["id"],
100
+ "onUpdate": "no action",
101
+ "onDelete": "cascade"
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
+ "columnsFrom": ["user_id"],
171
+ "tableTo": "user",
172
+ "columnsTo": ["id"],
173
+ "onUpdate": "no action",
174
+ "onDelete": "cascade"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "columns": ["token"],
182
+ "nullsNotDistinct": false
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
+ "columns": ["email"],
246
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
346
+ "tableTo": "tenant",
347
+ "columnsTo": ["id"],
348
+ "onUpdate": "no action",
349
+ "onDelete": "cascade"
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
+ "columnsFrom": ["target_tenant_id"],
355
+ "tableTo": "tenant",
356
+ "columnsTo": ["id"],
357
+ "onUpdate": "no action",
358
+ "onDelete": "cascade"
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
+ "columns": ["tenant_id", "target_tenant_id"],
366
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["parent_id"],
434
+ "tableTo": "tenant",
435
+ "columnsTo": ["id"],
436
+ "onUpdate": "no action",
437
+ "onDelete": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "columns": ["slug"],
445
+ "nullsNotDistinct": false
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "columns": ["domain"],
450
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
512
+ "tableTo": "tenant",
513
+ "columnsTo": ["id"],
514
+ "onUpdate": "no action",
515
+ "onDelete": "cascade"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "columns": ["tenant_id", "kind", "ref_id"],
523
+ "nullsNotDistinct": false
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_agent_id_fk": {
557
+ "name": "agent_role_agent_id_agent_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "columnsFrom": ["agent_id"],
560
+ "tableTo": "agent",
561
+ "columnsTo": ["id"],
562
+ "onUpdate": "no action",
563
+ "onDelete": "cascade"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "columnsFrom": ["role_id"],
569
+ "tableTo": "role",
570
+ "columnsTo": ["id"],
571
+ "onUpdate": "no action",
572
+ "onDelete": "cascade"
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
+ "columnsFrom": ["principal_id"],
616
+ "tableTo": "principal",
617
+ "columnsTo": ["id"],
618
+ "onUpdate": "no action",
619
+ "onDelete": "cascade"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "columnsFrom": ["role_id"],
625
+ "tableTo": "role",
626
+ "columnsTo": ["id"],
627
+ "onUpdate": "no action",
628
+ "onDelete": "cascade"
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
+ "columnsFrom": ["tenant_id"],
698
+ "tableTo": "tenant",
699
+ "columnsTo": ["id"],
700
+ "onUpdate": "no action",
701
+ "onDelete": "cascade"
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
+ "columnsFrom": ["tenant_id"],
795
+ "tableTo": "tenant",
796
+ "columnsTo": ["id"],
797
+ "onUpdate": "no action",
798
+ "onDelete": "cascade"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "columnsFrom": ["role_id"],
804
+ "tableTo": "role",
805
+ "columnsTo": ["id"],
806
+ "onUpdate": "no action",
807
+ "onDelete": "cascade"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "columnsFrom": ["principal_id"],
813
+ "tableTo": "principal",
814
+ "columnsTo": ["id"],
815
+ "onUpdate": "no action",
816
+ "onDelete": "cascade"
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
+ "with": {},
942
+ "method": "btree",
943
+ "concurrently": false
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
+ "with": {},
957
+ "method": "btree",
958
+ "concurrently": false
959
+ }
960
+ },
961
+ "foreignKeys": {
962
+ "approval_tenant_id_tenant_id_fk": {
963
+ "name": "approval_tenant_id_tenant_id_fk",
964
+ "tableFrom": "approval",
965
+ "columnsFrom": ["tenant_id"],
966
+ "tableTo": "tenant",
967
+ "columnsTo": ["id"],
968
+ "onUpdate": "no action",
969
+ "onDelete": "cascade"
970
+ },
971
+ "approval_deployment_id_workflow_deployment_id_fk": {
972
+ "name": "approval_deployment_id_workflow_deployment_id_fk",
973
+ "tableFrom": "approval",
974
+ "columnsFrom": ["deployment_id"],
975
+ "tableTo": "workflow_deployment",
976
+ "columnsTo": ["id"],
977
+ "onUpdate": "no action",
978
+ "onDelete": "cascade"
979
+ },
980
+ "approval_run_id_workflow_run_id_fk": {
981
+ "name": "approval_run_id_workflow_run_id_fk",
982
+ "tableFrom": "approval",
983
+ "columnsFrom": ["run_id"],
984
+ "tableTo": "workflow_run",
985
+ "columnsTo": ["id"],
986
+ "onUpdate": "no action",
987
+ "onDelete": "cascade"
988
+ }
989
+ },
990
+ "compositePrimaryKeys": {},
991
+ "uniqueConstraints": {
992
+ "approval_correlation_id_unique": {
993
+ "name": "approval_correlation_id_unique",
994
+ "columns": ["correlation_id"],
995
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
1074
+ "tableTo": "tenant",
1075
+ "columnsTo": ["id"],
1076
+ "onUpdate": "no action",
1077
+ "onDelete": "cascade"
1078
+ },
1079
+ "signal_correlation_deployment_id_workflow_deployment_id_fk": {
1080
+ "name": "signal_correlation_deployment_id_workflow_deployment_id_fk",
1081
+ "tableFrom": "signal_correlation",
1082
+ "columnsFrom": ["deployment_id"],
1083
+ "tableTo": "workflow_deployment",
1084
+ "columnsTo": ["id"],
1085
+ "onUpdate": "no action",
1086
+ "onDelete": "cascade"
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
+ "columnsFrom": ["run_id"],
1092
+ "tableTo": "workflow_run",
1093
+ "columnsTo": ["id"],
1094
+ "onUpdate": "no action",
1095
+ "onDelete": "cascade"
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
+ "columnsFrom": ["tenant_id"],
1228
+ "tableTo": "tenant",
1229
+ "columnsTo": ["id"],
1230
+ "onUpdate": "no action",
1231
+ "onDelete": "cascade"
1232
+ },
1233
+ "agent_creator_principal_id_principal_id_fk": {
1234
+ "name": "agent_creator_principal_id_principal_id_fk",
1235
+ "tableFrom": "agent",
1236
+ "columnsFrom": ["creator_principal_id"],
1237
+ "tableTo": "principal",
1238
+ "columnsTo": ["id"],
1239
+ "onUpdate": "no action",
1240
+ "onDelete": "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
+ "columnsFrom": ["agent_id"],
1292
+ "tableTo": "agent",
1293
+ "columnsTo": ["id"],
1294
+ "onUpdate": "no action",
1295
+ "onDelete": "cascade"
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
+ "columnsFrom": ["tenant_id"],
1383
+ "tableTo": "tenant",
1384
+ "columnsTo": ["id"],
1385
+ "onUpdate": "no action",
1386
+ "onDelete": "cascade"
1387
+ }
1388
+ },
1389
+ "compositePrimaryKeys": {},
1390
+ "uniqueConstraints": {
1391
+ "provider_tenant_name": {
1392
+ "name": "provider_tenant_name",
1393
+ "columns": ["tenant_id", "name"],
1394
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
1480
+ "tableTo": "tenant",
1481
+ "columnsTo": ["id"],
1482
+ "onUpdate": "no action",
1483
+ "onDelete": "cascade"
1484
+ },
1485
+ "oauth_client_provider_id_provider_id_fk": {
1486
+ "name": "oauth_client_provider_id_provider_id_fk",
1487
+ "tableFrom": "oauth_client",
1488
+ "columnsFrom": ["provider_id"],
1489
+ "tableTo": "provider",
1490
+ "columnsTo": ["id"],
1491
+ "onUpdate": "no action",
1492
+ "onDelete": "cascade"
1493
+ }
1494
+ },
1495
+ "compositePrimaryKeys": {},
1496
+ "uniqueConstraints": {
1497
+ "oauth_client_tenant_provider": {
1498
+ "name": "oauth_client_tenant_provider",
1499
+ "columns": ["tenant_id", "provider_id"],
1500
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
1617
+ "tableTo": "tenant",
1618
+ "columnsTo": ["id"],
1619
+ "onUpdate": "no action",
1620
+ "onDelete": "cascade"
1621
+ },
1622
+ "credential_principal_id_principal_id_fk": {
1623
+ "name": "credential_principal_id_principal_id_fk",
1624
+ "tableFrom": "credential",
1625
+ "columnsFrom": ["principal_id"],
1626
+ "tableTo": "principal",
1627
+ "columnsTo": ["id"],
1628
+ "onUpdate": "no action",
1629
+ "onDelete": "set null"
1630
+ },
1631
+ "credential_provider_id_provider_id_fk": {
1632
+ "name": "credential_provider_id_provider_id_fk",
1633
+ "tableFrom": "credential",
1634
+ "columnsFrom": ["provider_id"],
1635
+ "tableTo": "provider",
1636
+ "columnsTo": ["id"],
1637
+ "onUpdate": "no action",
1638
+ "onDelete": "cascade"
1639
+ },
1640
+ "credential_oauth_client_id_oauth_client_id_fk": {
1641
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1642
+ "tableFrom": "credential",
1643
+ "columnsFrom": ["oauth_client_id"],
1644
+ "tableTo": "oauth_client",
1645
+ "columnsTo": ["id"],
1646
+ "onUpdate": "no action",
1647
+ "onDelete": "set null"
1648
+ }
1649
+ },
1650
+ "compositePrimaryKeys": {},
1651
+ "uniqueConstraints": {
1652
+ "credential_tenant_name": {
1653
+ "name": "credential_tenant_name",
1654
+ "columns": ["tenant_id", "name"],
1655
+ "nullsNotDistinct": false
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
+ "columnsFrom": ["tenant_id"],
1723
+ "tableTo": "tenant",
1724
+ "columnsTo": ["id"],
1725
+ "onUpdate": "no action",
1726
+ "onDelete": "cascade"
1727
+ },
1728
+ "asset_creator_principal_id_principal_id_fk": {
1729
+ "name": "asset_creator_principal_id_principal_id_fk",
1730
+ "tableFrom": "asset",
1731
+ "columnsFrom": ["creator_principal_id"],
1732
+ "tableTo": "principal",
1733
+ "columnsTo": ["id"],
1734
+ "onUpdate": "no action",
1735
+ "onDelete": "set null"
1736
+ }
1737
+ },
1738
+ "compositePrimaryKeys": {},
1739
+ "uniqueConstraints": {
1740
+ "asset_tenant_kind_name": {
1741
+ "name": "asset_tenant_kind_name",
1742
+ "columns": ["tenant_id", "kind", "name"],
1743
+ "nullsNotDistinct": false
1744
+ }
1745
+ },
1746
+ "policies": {},
1747
+ "checkConstraints": {},
1748
+ "isRLSEnabled": false
1749
+ },
1750
+ "public.agent_asset": {
1751
+ "name": "agent_asset",
1752
+ "schema": "",
1753
+ "columns": {
1754
+ "id": {
1755
+ "name": "id",
1756
+ "type": "text",
1757
+ "primaryKey": true,
1758
+ "notNull": true
1759
+ },
1760
+ "agent_id": {
1761
+ "name": "agent_id",
1762
+ "type": "text",
1763
+ "primaryKey": false,
1764
+ "notNull": true
1765
+ },
1766
+ "asset_id": {
1767
+ "name": "asset_id",
1768
+ "type": "text",
1769
+ "primaryKey": false,
1770
+ "notNull": true
1771
+ },
1772
+ "ref": {
1773
+ "name": "ref",
1774
+ "type": "text",
1775
+ "primaryKey": false,
1776
+ "notNull": true
1777
+ },
1778
+ "access_mode": {
1779
+ "name": "access_mode",
1780
+ "type": "text",
1781
+ "primaryKey": false,
1782
+ "notNull": true,
1783
+ "default": "'read-only'"
1784
+ },
1785
+ "created_at": {
1786
+ "name": "created_at",
1787
+ "type": "timestamp",
1788
+ "primaryKey": false,
1789
+ "notNull": true,
1790
+ "default": "now()"
1791
+ }
1792
+ },
1793
+ "indexes": {},
1794
+ "foreignKeys": {
1795
+ "agent_asset_agent_id_agent_id_fk": {
1796
+ "name": "agent_asset_agent_id_agent_id_fk",
1797
+ "tableFrom": "agent_asset",
1798
+ "columnsFrom": ["agent_id"],
1799
+ "tableTo": "agent",
1800
+ "columnsTo": ["id"],
1801
+ "onUpdate": "no action",
1802
+ "onDelete": "cascade"
1803
+ },
1804
+ "agent_asset_asset_id_asset_id_fk": {
1805
+ "name": "agent_asset_asset_id_asset_id_fk",
1806
+ "tableFrom": "agent_asset",
1807
+ "columnsFrom": ["asset_id"],
1808
+ "tableTo": "asset",
1809
+ "columnsTo": ["id"],
1810
+ "onUpdate": "no action",
1811
+ "onDelete": "cascade"
1812
+ }
1813
+ },
1814
+ "compositePrimaryKeys": {},
1815
+ "uniqueConstraints": {
1816
+ "agent_asset_agent_asset": {
1817
+ "name": "agent_asset_agent_asset",
1818
+ "columns": ["agent_id", "asset_id"],
1819
+ "nullsNotDistinct": false
1820
+ }
1821
+ },
1822
+ "policies": {},
1823
+ "checkConstraints": {},
1824
+ "isRLSEnabled": false
1825
+ },
1826
+ "public.transaction": {
1827
+ "name": "transaction",
1828
+ "schema": "",
1829
+ "columns": {
1830
+ "id": {
1831
+ "name": "id",
1832
+ "type": "text",
1833
+ "primaryKey": true,
1834
+ "notNull": true
1835
+ },
1836
+ "wallet_id": {
1837
+ "name": "wallet_id",
1838
+ "type": "text",
1839
+ "primaryKey": false,
1840
+ "notNull": true
1841
+ },
1842
+ "agent_id": {
1843
+ "name": "agent_id",
1844
+ "type": "text",
1845
+ "primaryKey": false,
1846
+ "notNull": false
1847
+ },
1848
+ "direction": {
1849
+ "name": "direction",
1850
+ "type": "text",
1851
+ "primaryKey": false,
1852
+ "notNull": true
1853
+ },
1854
+ "amount": {
1855
+ "name": "amount",
1856
+ "type": "text",
1857
+ "primaryKey": false,
1858
+ "notNull": true
1859
+ },
1860
+ "currency": {
1861
+ "name": "currency",
1862
+ "type": "text",
1863
+ "primaryKey": false,
1864
+ "notNull": true
1865
+ },
1866
+ "recipient_id": {
1867
+ "name": "recipient_id",
1868
+ "type": "text",
1869
+ "primaryKey": false,
1870
+ "notNull": false
1871
+ },
1872
+ "sender_id": {
1873
+ "name": "sender_id",
1874
+ "type": "text",
1875
+ "primaryKey": false,
1876
+ "notNull": false
1877
+ },
1878
+ "request_id": {
1879
+ "name": "request_id",
1880
+ "type": "text",
1881
+ "primaryKey": false,
1882
+ "notNull": false
1883
+ },
1884
+ "status": {
1885
+ "name": "status",
1886
+ "type": "text",
1887
+ "primaryKey": false,
1888
+ "notNull": true,
1889
+ "default": "'pending'"
1890
+ },
1891
+ "created_at": {
1892
+ "name": "created_at",
1893
+ "type": "timestamp",
1894
+ "primaryKey": false,
1895
+ "notNull": true,
1896
+ "default": "now()"
1897
+ }
1898
+ },
1899
+ "indexes": {},
1900
+ "foreignKeys": {
1901
+ "transaction_wallet_id_wallet_id_fk": {
1902
+ "name": "transaction_wallet_id_wallet_id_fk",
1903
+ "tableFrom": "transaction",
1904
+ "columnsFrom": ["wallet_id"],
1905
+ "tableTo": "wallet",
1906
+ "columnsTo": ["id"],
1907
+ "onUpdate": "no action",
1908
+ "onDelete": "cascade"
1909
+ },
1910
+ "transaction_agent_id_agent_id_fk": {
1911
+ "name": "transaction_agent_id_agent_id_fk",
1912
+ "tableFrom": "transaction",
1913
+ "columnsFrom": ["agent_id"],
1914
+ "tableTo": "agent",
1915
+ "columnsTo": ["id"],
1916
+ "onUpdate": "no action",
1917
+ "onDelete": "set null"
1918
+ }
1919
+ },
1920
+ "compositePrimaryKeys": {},
1921
+ "uniqueConstraints": {},
1922
+ "policies": {},
1923
+ "checkConstraints": {},
1924
+ "isRLSEnabled": false
1925
+ },
1926
+ "public.wallet": {
1927
+ "name": "wallet",
1928
+ "schema": "",
1929
+ "columns": {
1930
+ "id": {
1931
+ "name": "id",
1932
+ "type": "text",
1933
+ "primaryKey": true,
1934
+ "notNull": true
1935
+ },
1936
+ "tenant_id": {
1937
+ "name": "tenant_id",
1938
+ "type": "text",
1939
+ "primaryKey": false,
1940
+ "notNull": true
1941
+ },
1942
+ "name": {
1943
+ "name": "name",
1944
+ "type": "text",
1945
+ "primaryKey": false,
1946
+ "notNull": true
1947
+ },
1948
+ "backend_type": {
1949
+ "name": "backend_type",
1950
+ "type": "text",
1951
+ "primaryKey": false,
1952
+ "notNull": true
1953
+ },
1954
+ "currency": {
1955
+ "name": "currency",
1956
+ "type": "text",
1957
+ "primaryKey": false,
1958
+ "notNull": true
1959
+ },
1960
+ "balance": {
1961
+ "name": "balance",
1962
+ "type": "text",
1963
+ "primaryKey": false,
1964
+ "notNull": true,
1965
+ "default": "'0'"
1966
+ },
1967
+ "config": {
1968
+ "name": "config",
1969
+ "type": "jsonb",
1970
+ "primaryKey": false,
1971
+ "notNull": false
1972
+ },
1973
+ "created_at": {
1974
+ "name": "created_at",
1975
+ "type": "timestamp",
1976
+ "primaryKey": false,
1977
+ "notNull": true,
1978
+ "default": "now()"
1979
+ },
1980
+ "updated_at": {
1981
+ "name": "updated_at",
1982
+ "type": "timestamp",
1983
+ "primaryKey": false,
1984
+ "notNull": true,
1985
+ "default": "now()"
1986
+ }
1987
+ },
1988
+ "indexes": {},
1989
+ "foreignKeys": {
1990
+ "wallet_tenant_id_tenant_id_fk": {
1991
+ "name": "wallet_tenant_id_tenant_id_fk",
1992
+ "tableFrom": "wallet",
1993
+ "columnsFrom": ["tenant_id"],
1994
+ "tableTo": "tenant",
1995
+ "columnsTo": ["id"],
1996
+ "onUpdate": "no action",
1997
+ "onDelete": "cascade"
1998
+ }
1999
+ },
2000
+ "compositePrimaryKeys": {},
2001
+ "uniqueConstraints": {},
2002
+ "policies": {},
2003
+ "checkConstraints": {},
2004
+ "isRLSEnabled": false
2005
+ },
2006
+ "public.offering": {
2007
+ "name": "offering",
2008
+ "schema": "",
2009
+ "columns": {
2010
+ "id": {
2011
+ "name": "id",
2012
+ "type": "text",
2013
+ "primaryKey": true,
2014
+ "notNull": true
2015
+ },
2016
+ "agent_id": {
2017
+ "name": "agent_id",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": true
2021
+ },
2022
+ "tenant_id": {
2023
+ "name": "tenant_id",
2024
+ "type": "text",
2025
+ "primaryKey": false,
2026
+ "notNull": true
2027
+ },
2028
+ "name": {
2029
+ "name": "name",
2030
+ "type": "text",
2031
+ "primaryKey": false,
2032
+ "notNull": true
2033
+ },
2034
+ "description": {
2035
+ "name": "description",
2036
+ "type": "text",
2037
+ "primaryKey": false,
2038
+ "notNull": false
2039
+ },
2040
+ "pricing": {
2041
+ "name": "pricing",
2042
+ "type": "jsonb",
2043
+ "primaryKey": false,
2044
+ "notNull": false
2045
+ },
2046
+ "schema": {
2047
+ "name": "schema",
2048
+ "type": "jsonb",
2049
+ "primaryKey": false,
2050
+ "notNull": false
2051
+ },
2052
+ "created_at": {
2053
+ "name": "created_at",
2054
+ "type": "timestamp",
2055
+ "primaryKey": false,
2056
+ "notNull": true,
2057
+ "default": "now()"
2058
+ },
2059
+ "updated_at": {
2060
+ "name": "updated_at",
2061
+ "type": "timestamp",
2062
+ "primaryKey": false,
2063
+ "notNull": true,
2064
+ "default": "now()"
2065
+ }
2066
+ },
2067
+ "indexes": {},
2068
+ "foreignKeys": {
2069
+ "offering_agent_id_agent_id_fk": {
2070
+ "name": "offering_agent_id_agent_id_fk",
2071
+ "tableFrom": "offering",
2072
+ "columnsFrom": ["agent_id"],
2073
+ "tableTo": "agent",
2074
+ "columnsTo": ["id"],
2075
+ "onUpdate": "no action",
2076
+ "onDelete": "cascade"
2077
+ },
2078
+ "offering_tenant_id_tenant_id_fk": {
2079
+ "name": "offering_tenant_id_tenant_id_fk",
2080
+ "tableFrom": "offering",
2081
+ "columnsFrom": ["tenant_id"],
2082
+ "tableTo": "tenant",
2083
+ "columnsTo": ["id"],
2084
+ "onUpdate": "no action",
2085
+ "onDelete": "cascade"
2086
+ }
2087
+ },
2088
+ "compositePrimaryKeys": {},
2089
+ "uniqueConstraints": {},
2090
+ "policies": {},
2091
+ "checkConstraints": {},
2092
+ "isRLSEnabled": false
2093
+ },
2094
+ "public.model": {
2095
+ "name": "model",
2096
+ "schema": "",
2097
+ "columns": {
2098
+ "id": {
2099
+ "name": "id",
2100
+ "type": "text",
2101
+ "primaryKey": true,
2102
+ "notNull": true
2103
+ },
2104
+ "tenant_id": {
2105
+ "name": "tenant_id",
2106
+ "type": "text",
2107
+ "primaryKey": false,
2108
+ "notNull": true
2109
+ },
2110
+ "canonical_name": {
2111
+ "name": "canonical_name",
2112
+ "type": "text",
2113
+ "primaryKey": false,
2114
+ "notNull": true
2115
+ },
2116
+ "display_name": {
2117
+ "name": "display_name",
2118
+ "type": "text",
2119
+ "primaryKey": false,
2120
+ "notNull": false
2121
+ },
2122
+ "description": {
2123
+ "name": "description",
2124
+ "type": "text",
2125
+ "primaryKey": false,
2126
+ "notNull": false
2127
+ },
2128
+ "disabled": {
2129
+ "name": "disabled",
2130
+ "type": "boolean",
2131
+ "primaryKey": false,
2132
+ "notNull": true,
2133
+ "default": false
2134
+ },
2135
+ "created_at": {
2136
+ "name": "created_at",
2137
+ "type": "timestamp",
2138
+ "primaryKey": false,
2139
+ "notNull": true,
2140
+ "default": "now()"
2141
+ },
2142
+ "updated_at": {
2143
+ "name": "updated_at",
2144
+ "type": "timestamp",
2145
+ "primaryKey": false,
2146
+ "notNull": true,
2147
+ "default": "now()"
2148
+ }
2149
+ },
2150
+ "indexes": {},
2151
+ "foreignKeys": {
2152
+ "model_tenant_id_tenant_id_fk": {
2153
+ "name": "model_tenant_id_tenant_id_fk",
2154
+ "tableFrom": "model",
2155
+ "columnsFrom": ["tenant_id"],
2156
+ "tableTo": "tenant",
2157
+ "columnsTo": ["id"],
2158
+ "onUpdate": "no action",
2159
+ "onDelete": "cascade"
2160
+ }
2161
+ },
2162
+ "compositePrimaryKeys": {},
2163
+ "uniqueConstraints": {
2164
+ "model_tenant_canonical_name": {
2165
+ "name": "model_tenant_canonical_name",
2166
+ "columns": ["tenant_id", "canonical_name"],
2167
+ "nullsNotDistinct": false
2168
+ }
2169
+ },
2170
+ "policies": {},
2171
+ "checkConstraints": {},
2172
+ "isRLSEnabled": false
2173
+ },
2174
+ "public.model_offering": {
2175
+ "name": "model_offering",
2176
+ "schema": "",
2177
+ "columns": {
2178
+ "id": {
2179
+ "name": "id",
2180
+ "type": "text",
2181
+ "primaryKey": true,
2182
+ "notNull": true
2183
+ },
2184
+ "tenant_id": {
2185
+ "name": "tenant_id",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": true
2189
+ },
2190
+ "model_id": {
2191
+ "name": "model_id",
2192
+ "type": "text",
2193
+ "primaryKey": false,
2194
+ "notNull": true
2195
+ },
2196
+ "provider_id": {
2197
+ "name": "provider_id",
2198
+ "type": "text",
2199
+ "primaryKey": false,
2200
+ "notNull": true
2201
+ },
2202
+ "priority": {
2203
+ "name": "priority",
2204
+ "type": "integer",
2205
+ "primaryKey": false,
2206
+ "notNull": true
2207
+ },
2208
+ "deployment_tags": {
2209
+ "name": "deployment_tags",
2210
+ "type": "text[]",
2211
+ "primaryKey": false,
2212
+ "notNull": true,
2213
+ "default": "'{}'"
2214
+ },
2215
+ "capabilities": {
2216
+ "name": "capabilities",
2217
+ "type": "text[]",
2218
+ "primaryKey": false,
2219
+ "notNull": true,
2220
+ "default": "'{}'"
2221
+ },
2222
+ "quirks": {
2223
+ "name": "quirks",
2224
+ "type": "jsonb",
2225
+ "primaryKey": false,
2226
+ "notNull": false
2227
+ },
2228
+ "disabled": {
2229
+ "name": "disabled",
2230
+ "type": "boolean",
2231
+ "primaryKey": false,
2232
+ "notNull": true,
2233
+ "default": false
2234
+ },
2235
+ "created_at": {
2236
+ "name": "created_at",
2237
+ "type": "timestamp",
2238
+ "primaryKey": false,
2239
+ "notNull": true,
2240
+ "default": "now()"
2241
+ },
2242
+ "updated_at": {
2243
+ "name": "updated_at",
2244
+ "type": "timestamp",
2245
+ "primaryKey": false,
2246
+ "notNull": true,
2247
+ "default": "now()"
2248
+ }
2249
+ },
2250
+ "indexes": {},
2251
+ "foreignKeys": {
2252
+ "model_offering_tenant_id_tenant_id_fk": {
2253
+ "name": "model_offering_tenant_id_tenant_id_fk",
2254
+ "tableFrom": "model_offering",
2255
+ "columnsFrom": ["tenant_id"],
2256
+ "tableTo": "tenant",
2257
+ "columnsTo": ["id"],
2258
+ "onUpdate": "no action",
2259
+ "onDelete": "cascade"
2260
+ },
2261
+ "model_offering_model_id_model_id_fk": {
2262
+ "name": "model_offering_model_id_model_id_fk",
2263
+ "tableFrom": "model_offering",
2264
+ "columnsFrom": ["model_id"],
2265
+ "tableTo": "model",
2266
+ "columnsTo": ["id"],
2267
+ "onUpdate": "no action",
2268
+ "onDelete": "cascade"
2269
+ },
2270
+ "model_offering_provider_id_model_provider_id_fk": {
2271
+ "name": "model_offering_provider_id_model_provider_id_fk",
2272
+ "tableFrom": "model_offering",
2273
+ "columnsFrom": ["provider_id"],
2274
+ "tableTo": "model_provider",
2275
+ "columnsTo": ["id"],
2276
+ "onUpdate": "no action",
2277
+ "onDelete": "cascade"
2278
+ }
2279
+ },
2280
+ "compositePrimaryKeys": {},
2281
+ "uniqueConstraints": {
2282
+ "model_offering_tenant_model_provider": {
2283
+ "name": "model_offering_tenant_model_provider",
2284
+ "columns": ["tenant_id", "model_id", "provider_id"],
2285
+ "nullsNotDistinct": false
2286
+ }
2287
+ },
2288
+ "policies": {},
2289
+ "checkConstraints": {},
2290
+ "isRLSEnabled": false
2291
+ },
2292
+ "public.model_pricing": {
2293
+ "name": "model_pricing",
2294
+ "schema": "",
2295
+ "columns": {
2296
+ "id": {
2297
+ "name": "id",
2298
+ "type": "text",
2299
+ "primaryKey": true,
2300
+ "notNull": true
2301
+ },
2302
+ "tenant_id": {
2303
+ "name": "tenant_id",
2304
+ "type": "text",
2305
+ "primaryKey": false,
2306
+ "notNull": true
2307
+ },
2308
+ "offering_id": {
2309
+ "name": "offering_id",
2310
+ "type": "text",
2311
+ "primaryKey": false,
2312
+ "notNull": true
2313
+ },
2314
+ "currency": {
2315
+ "name": "currency",
2316
+ "type": "text",
2317
+ "primaryKey": false,
2318
+ "notNull": true
2319
+ },
2320
+ "input_token_price": {
2321
+ "name": "input_token_price",
2322
+ "type": "text",
2323
+ "primaryKey": false,
2324
+ "notNull": false
2325
+ },
2326
+ "output_token_price": {
2327
+ "name": "output_token_price",
2328
+ "type": "text",
2329
+ "primaryKey": false,
2330
+ "notNull": false
2331
+ },
2332
+ "cache_read_token_price": {
2333
+ "name": "cache_read_token_price",
2334
+ "type": "text",
2335
+ "primaryKey": false,
2336
+ "notNull": false
2337
+ },
2338
+ "cache_write_token_price": {
2339
+ "name": "cache_write_token_price",
2340
+ "type": "text",
2341
+ "primaryKey": false,
2342
+ "notNull": false
2343
+ },
2344
+ "thinking_token_price": {
2345
+ "name": "thinking_token_price",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": false
2349
+ },
2350
+ "per_request_fee": {
2351
+ "name": "per_request_fee",
2352
+ "type": "text",
2353
+ "primaryKey": false,
2354
+ "notNull": false
2355
+ },
2356
+ "per_image_fee": {
2357
+ "name": "per_image_fee",
2358
+ "type": "text",
2359
+ "primaryKey": false,
2360
+ "notNull": false
2361
+ },
2362
+ "per_audio_fee": {
2363
+ "name": "per_audio_fee",
2364
+ "type": "text",
2365
+ "primaryKey": false,
2366
+ "notNull": false
2367
+ },
2368
+ "effective_from": {
2369
+ "name": "effective_from",
2370
+ "type": "timestamp with time zone",
2371
+ "primaryKey": false,
2372
+ "notNull": true
2373
+ },
2374
+ "created_at": {
2375
+ "name": "created_at",
2376
+ "type": "timestamp with time zone",
2377
+ "primaryKey": false,
2378
+ "notNull": true,
2379
+ "default": "now()"
2380
+ }
2381
+ },
2382
+ "indexes": {},
2383
+ "foreignKeys": {
2384
+ "model_pricing_tenant_id_tenant_id_fk": {
2385
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2386
+ "tableFrom": "model_pricing",
2387
+ "columnsFrom": ["tenant_id"],
2388
+ "tableTo": "tenant",
2389
+ "columnsTo": ["id"],
2390
+ "onUpdate": "no action",
2391
+ "onDelete": "cascade"
2392
+ },
2393
+ "model_pricing_offering_id_model_offering_id_fk": {
2394
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2395
+ "tableFrom": "model_pricing",
2396
+ "columnsFrom": ["offering_id"],
2397
+ "tableTo": "model_offering",
2398
+ "columnsTo": ["id"],
2399
+ "onUpdate": "no action",
2400
+ "onDelete": "cascade"
2401
+ }
2402
+ },
2403
+ "compositePrimaryKeys": {},
2404
+ "uniqueConstraints": {
2405
+ "model_pricing_offering_currency_effective_from": {
2406
+ "name": "model_pricing_offering_currency_effective_from",
2407
+ "columns": ["offering_id", "currency", "effective_from"],
2408
+ "nullsNotDistinct": false
2409
+ }
2410
+ },
2411
+ "policies": {},
2412
+ "checkConstraints": {},
2413
+ "isRLSEnabled": false
2414
+ },
2415
+ "public.model_provider": {
2416
+ "name": "model_provider",
2417
+ "schema": "",
2418
+ "columns": {
2419
+ "id": {
2420
+ "name": "id",
2421
+ "type": "text",
2422
+ "primaryKey": true,
2423
+ "notNull": true
2424
+ },
2425
+ "tenant_id": {
2426
+ "name": "tenant_id",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true
2430
+ },
2431
+ "name": {
2432
+ "name": "name",
2433
+ "type": "text",
2434
+ "primaryKey": false,
2435
+ "notNull": true
2436
+ },
2437
+ "plugin": {
2438
+ "name": "plugin",
2439
+ "type": "text",
2440
+ "primaryKey": false,
2441
+ "notNull": true
2442
+ },
2443
+ "base_url": {
2444
+ "name": "base_url",
2445
+ "type": "text",
2446
+ "primaryKey": false,
2447
+ "notNull": true
2448
+ },
2449
+ "credential_id": {
2450
+ "name": "credential_id",
2451
+ "type": "text",
2452
+ "primaryKey": false,
2453
+ "notNull": false
2454
+ },
2455
+ "wallet_id": {
2456
+ "name": "wallet_id",
2457
+ "type": "text",
2458
+ "primaryKey": false,
2459
+ "notNull": false
2460
+ },
2461
+ "disabled": {
2462
+ "name": "disabled",
2463
+ "type": "boolean",
2464
+ "primaryKey": false,
2465
+ "notNull": true,
2466
+ "default": false
2467
+ },
2468
+ "created_at": {
2469
+ "name": "created_at",
2470
+ "type": "timestamp",
2471
+ "primaryKey": false,
2472
+ "notNull": true,
2473
+ "default": "now()"
2474
+ },
2475
+ "updated_at": {
2476
+ "name": "updated_at",
2477
+ "type": "timestamp",
2478
+ "primaryKey": false,
2479
+ "notNull": true,
2480
+ "default": "now()"
2481
+ }
2482
+ },
2483
+ "indexes": {},
2484
+ "foreignKeys": {
2485
+ "model_provider_tenant_id_tenant_id_fk": {
2486
+ "name": "model_provider_tenant_id_tenant_id_fk",
2487
+ "tableFrom": "model_provider",
2488
+ "columnsFrom": ["tenant_id"],
2489
+ "tableTo": "tenant",
2490
+ "columnsTo": ["id"],
2491
+ "onUpdate": "no action",
2492
+ "onDelete": "cascade"
2493
+ },
2494
+ "model_provider_credential_id_credential_id_fk": {
2495
+ "name": "model_provider_credential_id_credential_id_fk",
2496
+ "tableFrom": "model_provider",
2497
+ "columnsFrom": ["credential_id"],
2498
+ "tableTo": "credential",
2499
+ "columnsTo": ["id"],
2500
+ "onUpdate": "no action",
2501
+ "onDelete": "restrict"
2502
+ },
2503
+ "model_provider_wallet_id_wallet_id_fk": {
2504
+ "name": "model_provider_wallet_id_wallet_id_fk",
2505
+ "tableFrom": "model_provider",
2506
+ "columnsFrom": ["wallet_id"],
2507
+ "tableTo": "wallet",
2508
+ "columnsTo": ["id"],
2509
+ "onUpdate": "no action",
2510
+ "onDelete": "restrict"
2511
+ }
2512
+ },
2513
+ "compositePrimaryKeys": {},
2514
+ "uniqueConstraints": {
2515
+ "model_provider_tenant_name": {
2516
+ "name": "model_provider_tenant_name",
2517
+ "columns": ["tenant_id", "name"],
2518
+ "nullsNotDistinct": false
2519
+ }
2520
+ },
2521
+ "policies": {},
2522
+ "checkConstraints": {
2523
+ "model_provider_auth_xor": {
2524
+ "name": "model_provider_auth_xor",
2525
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2526
+ }
2527
+ },
2528
+ "isRLSEnabled": false
2529
+ },
2530
+ "public.sidecar": {
2531
+ "name": "sidecar",
2532
+ "schema": "",
2533
+ "columns": {
2534
+ "id": {
2535
+ "name": "id",
2536
+ "type": "text",
2537
+ "primaryKey": true,
2538
+ "notNull": true
2539
+ },
2540
+ "url": {
2541
+ "name": "url",
2542
+ "type": "text",
2543
+ "primaryKey": false,
2544
+ "notNull": true
2545
+ },
2546
+ "token_hash_sha256": {
2547
+ "name": "token_hash_sha256",
2548
+ "type": "bytea",
2549
+ "primaryKey": false,
2550
+ "notNull": true
2551
+ },
2552
+ "status": {
2553
+ "name": "status",
2554
+ "type": "text",
2555
+ "primaryKey": false,
2556
+ "notNull": true,
2557
+ "default": "'online'"
2558
+ },
2559
+ "last_heartbeat": {
2560
+ "name": "last_heartbeat",
2561
+ "type": "timestamp",
2562
+ "primaryKey": false,
2563
+ "notNull": false
2564
+ },
2565
+ "created_at": {
2566
+ "name": "created_at",
2567
+ "type": "timestamp",
2568
+ "primaryKey": false,
2569
+ "notNull": true,
2570
+ "default": "now()"
2571
+ },
2572
+ "updated_at": {
2573
+ "name": "updated_at",
2574
+ "type": "timestamp",
2575
+ "primaryKey": false,
2576
+ "notNull": true,
2577
+ "default": "now()"
2578
+ }
2579
+ },
2580
+ "indexes": {},
2581
+ "foreignKeys": {},
2582
+ "compositePrimaryKeys": {},
2583
+ "uniqueConstraints": {
2584
+ "sidecar_token_hash_sha256_unique": {
2585
+ "name": "sidecar_token_hash_sha256_unique",
2586
+ "columns": ["token_hash_sha256"],
2587
+ "nullsNotDistinct": false
2588
+ }
2589
+ },
2590
+ "policies": {},
2591
+ "checkConstraints": {},
2592
+ "isRLSEnabled": false
2593
+ },
2594
+ "public.agent_session": {
2595
+ "name": "agent_session",
2596
+ "schema": "",
2597
+ "columns": {
2598
+ "id": {
2599
+ "name": "id",
2600
+ "type": "text",
2601
+ "primaryKey": true,
2602
+ "notNull": true
2603
+ },
2604
+ "tenant_id": {
2605
+ "name": "tenant_id",
2606
+ "type": "text",
2607
+ "primaryKey": false,
2608
+ "notNull": true
2609
+ },
2610
+ "agent_id": {
2611
+ "name": "agent_id",
2612
+ "type": "text",
2613
+ "primaryKey": false,
2614
+ "notNull": true
2615
+ },
2616
+ "principal_id": {
2617
+ "name": "principal_id",
2618
+ "type": "text",
2619
+ "primaryKey": false,
2620
+ "notNull": true
2621
+ },
2622
+ "status": {
2623
+ "name": "status",
2624
+ "type": "text",
2625
+ "primaryKey": false,
2626
+ "notNull": true,
2627
+ "default": "'active'"
2628
+ },
2629
+ "created_at": {
2630
+ "name": "created_at",
2631
+ "type": "timestamp",
2632
+ "primaryKey": false,
2633
+ "notNull": true,
2634
+ "default": "now()"
2635
+ },
2636
+ "updated_at": {
2637
+ "name": "updated_at",
2638
+ "type": "timestamp",
2639
+ "primaryKey": false,
2640
+ "notNull": true,
2641
+ "default": "now()"
2642
+ },
2643
+ "ended_at": {
2644
+ "name": "ended_at",
2645
+ "type": "timestamp",
2646
+ "primaryKey": false,
2647
+ "notNull": false
2648
+ }
2649
+ },
2650
+ "indexes": {},
2651
+ "foreignKeys": {
2652
+ "agent_session_tenant_id_tenant_id_fk": {
2653
+ "name": "agent_session_tenant_id_tenant_id_fk",
2654
+ "tableFrom": "agent_session",
2655
+ "columnsFrom": ["tenant_id"],
2656
+ "tableTo": "tenant",
2657
+ "columnsTo": ["id"],
2658
+ "onUpdate": "no action",
2659
+ "onDelete": "cascade"
2660
+ },
2661
+ "agent_session_agent_id_agent_id_fk": {
2662
+ "name": "agent_session_agent_id_agent_id_fk",
2663
+ "tableFrom": "agent_session",
2664
+ "columnsFrom": ["agent_id"],
2665
+ "tableTo": "agent",
2666
+ "columnsTo": ["id"],
2667
+ "onUpdate": "no action",
2668
+ "onDelete": "cascade"
2669
+ },
2670
+ "agent_session_principal_id_principal_id_fk": {
2671
+ "name": "agent_session_principal_id_principal_id_fk",
2672
+ "tableFrom": "agent_session",
2673
+ "columnsFrom": ["principal_id"],
2674
+ "tableTo": "principal",
2675
+ "columnsTo": ["id"],
2676
+ "onUpdate": "no action",
2677
+ "onDelete": "no action"
2678
+ }
2679
+ },
2680
+ "compositePrimaryKeys": {},
2681
+ "uniqueConstraints": {},
2682
+ "policies": {},
2683
+ "checkConstraints": {},
2684
+ "isRLSEnabled": false
2685
+ },
2686
+ "public.agent_instance": {
2687
+ "name": "agent_instance",
2688
+ "schema": "",
2689
+ "columns": {
2690
+ "id": {
2691
+ "name": "id",
2692
+ "type": "text",
2693
+ "primaryKey": true,
2694
+ "notNull": true
2695
+ },
2696
+ "agent_id": {
2697
+ "name": "agent_id",
2698
+ "type": "text",
2699
+ "primaryKey": false,
2700
+ "notNull": true
2701
+ },
2702
+ "tenant_id": {
2703
+ "name": "tenant_id",
2704
+ "type": "text",
2705
+ "primaryKey": false,
2706
+ "notNull": true
2707
+ },
2708
+ "principal_id": {
2709
+ "name": "principal_id",
2710
+ "type": "text",
2711
+ "primaryKey": false,
2712
+ "notNull": true
2713
+ },
2714
+ "address": {
2715
+ "name": "address",
2716
+ "type": "text",
2717
+ "primaryKey": false,
2718
+ "notNull": true
2719
+ },
2720
+ "version_id": {
2721
+ "name": "version_id",
2722
+ "type": "text",
2723
+ "primaryKey": false,
2724
+ "notNull": false
2725
+ },
2726
+ "session_id": {
2727
+ "name": "session_id",
2728
+ "type": "text",
2729
+ "primaryKey": false,
2730
+ "notNull": false
2731
+ },
2732
+ "status": {
2733
+ "name": "status",
2734
+ "type": "text",
2735
+ "primaryKey": false,
2736
+ "notNull": true,
2737
+ "default": "'deployed'"
2738
+ },
2739
+ "sidecar_id": {
2740
+ "name": "sidecar_id",
2741
+ "type": "text",
2742
+ "primaryKey": false,
2743
+ "notNull": false
2744
+ },
2745
+ "public_key": {
2746
+ "name": "public_key",
2747
+ "type": "text",
2748
+ "primaryKey": false,
2749
+ "notNull": false
2750
+ },
2751
+ "kernel_id": {
2752
+ "name": "kernel_id",
2753
+ "type": "text",
2754
+ "primaryKey": false,
2755
+ "notNull": false
2756
+ },
2757
+ "model_preferences": {
2758
+ "name": "model_preferences",
2759
+ "type": "jsonb",
2760
+ "primaryKey": false,
2761
+ "notNull": false
2762
+ },
2763
+ "created_at": {
2764
+ "name": "created_at",
2765
+ "type": "timestamp",
2766
+ "primaryKey": false,
2767
+ "notNull": true,
2768
+ "default": "now()"
2769
+ },
2770
+ "updated_at": {
2771
+ "name": "updated_at",
2772
+ "type": "timestamp",
2773
+ "primaryKey": false,
2774
+ "notNull": true,
2775
+ "default": "now()"
2776
+ },
2777
+ "ended_at": {
2778
+ "name": "ended_at",
2779
+ "type": "timestamp",
2780
+ "primaryKey": false,
2781
+ "notNull": false
2782
+ }
2783
+ },
2784
+ "indexes": {},
2785
+ "foreignKeys": {
2786
+ "agent_instance_agent_id_agent_id_fk": {
2787
+ "name": "agent_instance_agent_id_agent_id_fk",
2788
+ "tableFrom": "agent_instance",
2789
+ "columnsFrom": ["agent_id"],
2790
+ "tableTo": "agent",
2791
+ "columnsTo": ["id"],
2792
+ "onUpdate": "no action",
2793
+ "onDelete": "cascade"
2794
+ },
2795
+ "agent_instance_tenant_id_tenant_id_fk": {
2796
+ "name": "agent_instance_tenant_id_tenant_id_fk",
2797
+ "tableFrom": "agent_instance",
2798
+ "columnsFrom": ["tenant_id"],
2799
+ "tableTo": "tenant",
2800
+ "columnsTo": ["id"],
2801
+ "onUpdate": "no action",
2802
+ "onDelete": "cascade"
2803
+ },
2804
+ "agent_instance_principal_id_principal_id_fk": {
2805
+ "name": "agent_instance_principal_id_principal_id_fk",
2806
+ "tableFrom": "agent_instance",
2807
+ "columnsFrom": ["principal_id"],
2808
+ "tableTo": "principal",
2809
+ "columnsTo": ["id"],
2810
+ "onUpdate": "no action",
2811
+ "onDelete": "no action"
2812
+ },
2813
+ "agent_instance_version_id_agent_version_id_fk": {
2814
+ "name": "agent_instance_version_id_agent_version_id_fk",
2815
+ "tableFrom": "agent_instance",
2816
+ "columnsFrom": ["version_id"],
2817
+ "tableTo": "agent_version",
2818
+ "columnsTo": ["id"],
2819
+ "onUpdate": "no action",
2820
+ "onDelete": "no action"
2821
+ },
2822
+ "agent_instance_session_id_agent_session_id_fk": {
2823
+ "name": "agent_instance_session_id_agent_session_id_fk",
2824
+ "tableFrom": "agent_instance",
2825
+ "columnsFrom": ["session_id"],
2826
+ "tableTo": "agent_session",
2827
+ "columnsTo": ["id"],
2828
+ "onUpdate": "no action",
2829
+ "onDelete": "no action"
2830
+ },
2831
+ "agent_instance_sidecar_id_sidecar_id_fk": {
2832
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
2833
+ "tableFrom": "agent_instance",
2834
+ "columnsFrom": ["sidecar_id"],
2835
+ "tableTo": "sidecar",
2836
+ "columnsTo": ["id"],
2837
+ "onUpdate": "no action",
2838
+ "onDelete": "set null"
2839
+ }
2840
+ },
2841
+ "compositePrimaryKeys": {},
2842
+ "uniqueConstraints": {
2843
+ "agent_instance_address_unique": {
2844
+ "name": "agent_instance_address_unique",
2845
+ "columns": ["address"],
2846
+ "nullsNotDistinct": false
2847
+ }
2848
+ },
2849
+ "policies": {},
2850
+ "checkConstraints": {},
2851
+ "isRLSEnabled": false
2852
+ },
2853
+ "public.session_asset": {
2854
+ "name": "session_asset",
2855
+ "schema": "",
2856
+ "columns": {
2857
+ "instance_id": {
2858
+ "name": "instance_id",
2859
+ "type": "text",
2860
+ "primaryKey": false,
2861
+ "notNull": true
2862
+ },
2863
+ "agent_asset_id": {
2864
+ "name": "agent_asset_id",
2865
+ "type": "text",
2866
+ "primaryKey": false,
2867
+ "notNull": false
2868
+ },
2869
+ "mount_path": {
2870
+ "name": "mount_path",
2871
+ "type": "text",
2872
+ "primaryKey": false,
2873
+ "notNull": true
2874
+ },
2875
+ "asset_pack_sha": {
2876
+ "name": "asset_pack_sha",
2877
+ "type": "text",
2878
+ "primaryKey": false,
2879
+ "notNull": true
2880
+ },
2881
+ "source_commit_sha": {
2882
+ "name": "source_commit_sha",
2883
+ "type": "text",
2884
+ "primaryKey": false,
2885
+ "notNull": true
2886
+ },
2887
+ "source": {
2888
+ "name": "source",
2889
+ "type": "text",
2890
+ "primaryKey": false,
2891
+ "notNull": true
2892
+ },
2893
+ "materialized_at": {
2894
+ "name": "materialized_at",
2895
+ "type": "timestamp",
2896
+ "primaryKey": false,
2897
+ "notNull": true,
2898
+ "default": "now()"
2899
+ }
2900
+ },
2901
+ "indexes": {
2902
+ "session_asset_pack_sha_idx": {
2903
+ "name": "session_asset_pack_sha_idx",
2904
+ "columns": [
2905
+ {
2906
+ "expression": "asset_pack_sha",
2907
+ "isExpression": false,
2908
+ "asc": true,
2909
+ "nulls": "last"
2910
+ }
2911
+ ],
2912
+ "isUnique": false,
2913
+ "with": {},
2914
+ "method": "btree",
2915
+ "concurrently": false
2916
+ }
2917
+ },
2918
+ "foreignKeys": {
2919
+ "session_asset_instance_id_agent_instance_id_fk": {
2920
+ "name": "session_asset_instance_id_agent_instance_id_fk",
2921
+ "tableFrom": "session_asset",
2922
+ "columnsFrom": ["instance_id"],
2923
+ "tableTo": "agent_instance",
2924
+ "columnsTo": ["id"],
2925
+ "onUpdate": "no action",
2926
+ "onDelete": "cascade"
2927
+ },
2928
+ "session_asset_agent_asset_id_agent_asset_id_fk": {
2929
+ "name": "session_asset_agent_asset_id_agent_asset_id_fk",
2930
+ "tableFrom": "session_asset",
2931
+ "columnsFrom": ["agent_asset_id"],
2932
+ "tableTo": "agent_asset",
2933
+ "columnsTo": ["id"],
2934
+ "onUpdate": "no action",
2935
+ "onDelete": "cascade"
2936
+ }
2937
+ },
2938
+ "compositePrimaryKeys": {
2939
+ "session_asset_instance_id_mount_path_pk": {
2940
+ "name": "session_asset_instance_id_mount_path_pk",
2941
+ "columns": ["instance_id", "mount_path"]
2942
+ }
2943
+ },
2944
+ "uniqueConstraints": {},
2945
+ "policies": {},
2946
+ "checkConstraints": {},
2947
+ "isRLSEnabled": false
2948
+ },
2949
+ "public.inference_turn": {
2950
+ "name": "inference_turn",
2951
+ "schema": "",
2952
+ "columns": {
2953
+ "id": {
2954
+ "name": "id",
2955
+ "type": "text",
2956
+ "primaryKey": true,
2957
+ "notNull": true
2958
+ },
2959
+ "session_id": {
2960
+ "name": "session_id",
2961
+ "type": "text",
2962
+ "primaryKey": false,
2963
+ "notNull": true
2964
+ },
2965
+ "instance_id": {
2966
+ "name": "instance_id",
2967
+ "type": "text",
2968
+ "primaryKey": false,
2969
+ "notNull": true
2970
+ },
2971
+ "tenant_id": {
2972
+ "name": "tenant_id",
2973
+ "type": "text",
2974
+ "primaryKey": false,
2975
+ "notNull": true
2976
+ },
2977
+ "model": {
2978
+ "name": "model",
2979
+ "type": "text",
2980
+ "primaryKey": false,
2981
+ "notNull": true
2982
+ },
2983
+ "status": {
2984
+ "name": "status",
2985
+ "type": "text",
2986
+ "primaryKey": false,
2987
+ "notNull": true,
2988
+ "default": "'running'"
2989
+ },
2990
+ "started_at": {
2991
+ "name": "started_at",
2992
+ "type": "timestamp",
2993
+ "primaryKey": false,
2994
+ "notNull": true
2995
+ },
2996
+ "ended_at": {
2997
+ "name": "ended_at",
2998
+ "type": "timestamp",
2999
+ "primaryKey": false,
3000
+ "notNull": false
3001
+ }
3002
+ },
3003
+ "indexes": {
3004
+ "inference_turn_instance_id_started_at_idx": {
3005
+ "name": "inference_turn_instance_id_started_at_idx",
3006
+ "columns": [
3007
+ {
3008
+ "expression": "instance_id",
3009
+ "isExpression": false,
3010
+ "asc": true,
3011
+ "nulls": "last"
3012
+ },
3013
+ {
3014
+ "expression": "started_at",
3015
+ "isExpression": false,
3016
+ "asc": true,
3017
+ "nulls": "last"
3018
+ }
3019
+ ],
3020
+ "isUnique": false,
3021
+ "with": {},
3022
+ "method": "btree",
3023
+ "concurrently": false
3024
+ }
3025
+ },
3026
+ "foreignKeys": {
3027
+ "inference_turn_session_id_agent_session_id_fk": {
3028
+ "name": "inference_turn_session_id_agent_session_id_fk",
3029
+ "tableFrom": "inference_turn",
3030
+ "columnsFrom": ["session_id"],
3031
+ "tableTo": "agent_session",
3032
+ "columnsTo": ["id"],
3033
+ "onUpdate": "no action",
3034
+ "onDelete": "cascade"
3035
+ },
3036
+ "inference_turn_tenant_id_tenant_id_fk": {
3037
+ "name": "inference_turn_tenant_id_tenant_id_fk",
3038
+ "tableFrom": "inference_turn",
3039
+ "columnsFrom": ["tenant_id"],
3040
+ "tableTo": "tenant",
3041
+ "columnsTo": ["id"],
3042
+ "onUpdate": "no action",
3043
+ "onDelete": "cascade"
3044
+ }
3045
+ },
3046
+ "compositePrimaryKeys": {},
3047
+ "uniqueConstraints": {},
3048
+ "policies": {},
3049
+ "checkConstraints": {},
3050
+ "isRLSEnabled": false
3051
+ },
3052
+ "public.session_mail": {
3053
+ "name": "session_mail",
3054
+ "schema": "",
3055
+ "columns": {
3056
+ "id": {
3057
+ "name": "id",
3058
+ "type": "text",
3059
+ "primaryKey": true,
3060
+ "notNull": true
3061
+ },
3062
+ "session_id": {
3063
+ "name": "session_id",
3064
+ "type": "text",
3065
+ "primaryKey": false,
3066
+ "notNull": true
3067
+ },
3068
+ "instance_id": {
3069
+ "name": "instance_id",
3070
+ "type": "text",
3071
+ "primaryKey": false,
3072
+ "notNull": false
3073
+ },
3074
+ "tenant_id": {
3075
+ "name": "tenant_id",
3076
+ "type": "text",
3077
+ "primaryKey": false,
3078
+ "notNull": true
3079
+ },
3080
+ "direction": {
3081
+ "name": "direction",
3082
+ "type": "text",
3083
+ "primaryKey": false,
3084
+ "notNull": true
3085
+ },
3086
+ "status": {
3087
+ "name": "status",
3088
+ "type": "text",
3089
+ "primaryKey": false,
3090
+ "notNull": true,
3091
+ "default": "'pending'"
3092
+ },
3093
+ "raw": {
3094
+ "name": "raw",
3095
+ "type": "bytea",
3096
+ "primaryKey": false,
3097
+ "notNull": true
3098
+ },
3099
+ "created_at": {
3100
+ "name": "created_at",
3101
+ "type": "timestamp",
3102
+ "primaryKey": false,
3103
+ "notNull": true,
3104
+ "default": "now()"
3105
+ }
3106
+ },
3107
+ "indexes": {
3108
+ "session_mail_instance_id_created_at_idx": {
3109
+ "name": "session_mail_instance_id_created_at_idx",
3110
+ "columns": [
3111
+ {
3112
+ "expression": "instance_id",
3113
+ "isExpression": false,
3114
+ "asc": true,
3115
+ "nulls": "last"
3116
+ },
3117
+ {
3118
+ "expression": "created_at",
3119
+ "isExpression": false,
3120
+ "asc": true,
3121
+ "nulls": "last"
3122
+ }
3123
+ ],
3124
+ "isUnique": false,
3125
+ "with": {},
3126
+ "method": "btree",
3127
+ "concurrently": false
3128
+ },
3129
+ "session_mail_session_id_created_at_idx": {
3130
+ "name": "session_mail_session_id_created_at_idx",
3131
+ "columns": [
3132
+ {
3133
+ "expression": "session_id",
3134
+ "isExpression": false,
3135
+ "asc": true,
3136
+ "nulls": "last"
3137
+ },
3138
+ {
3139
+ "expression": "created_at",
3140
+ "isExpression": false,
3141
+ "asc": true,
3142
+ "nulls": "last"
3143
+ }
3144
+ ],
3145
+ "isUnique": false,
3146
+ "with": {},
3147
+ "method": "btree",
3148
+ "concurrently": false
3149
+ }
3150
+ },
3151
+ "foreignKeys": {
3152
+ "session_mail_session_id_agent_session_id_fk": {
3153
+ "name": "session_mail_session_id_agent_session_id_fk",
3154
+ "tableFrom": "session_mail",
3155
+ "columnsFrom": ["session_id"],
3156
+ "tableTo": "agent_session",
3157
+ "columnsTo": ["id"],
3158
+ "onUpdate": "no action",
3159
+ "onDelete": "cascade"
3160
+ },
3161
+ "session_mail_instance_id_agent_instance_id_fk": {
3162
+ "name": "session_mail_instance_id_agent_instance_id_fk",
3163
+ "tableFrom": "session_mail",
3164
+ "columnsFrom": ["instance_id"],
3165
+ "tableTo": "agent_instance",
3166
+ "columnsTo": ["id"],
3167
+ "onUpdate": "no action",
3168
+ "onDelete": "set null"
3169
+ },
3170
+ "session_mail_tenant_id_tenant_id_fk": {
3171
+ "name": "session_mail_tenant_id_tenant_id_fk",
3172
+ "tableFrom": "session_mail",
3173
+ "columnsFrom": ["tenant_id"],
3174
+ "tableTo": "tenant",
3175
+ "columnsTo": ["id"],
3176
+ "onUpdate": "no action",
3177
+ "onDelete": "cascade"
3178
+ }
3179
+ },
3180
+ "compositePrimaryKeys": {},
3181
+ "uniqueConstraints": {},
3182
+ "policies": {},
3183
+ "checkConstraints": {},
3184
+ "isRLSEnabled": false
3185
+ },
3186
+ "public.turn_part": {
3187
+ "name": "turn_part",
3188
+ "schema": "",
3189
+ "columns": {
3190
+ "id": {
3191
+ "name": "id",
3192
+ "type": "text",
3193
+ "primaryKey": true,
3194
+ "notNull": true
3195
+ },
3196
+ "turn_id": {
3197
+ "name": "turn_id",
3198
+ "type": "text",
3199
+ "primaryKey": false,
3200
+ "notNull": true
3201
+ },
3202
+ "session_id": {
3203
+ "name": "session_id",
3204
+ "type": "text",
3205
+ "primaryKey": false,
3206
+ "notNull": true
3207
+ },
3208
+ "type": {
3209
+ "name": "type",
3210
+ "type": "text",
3211
+ "primaryKey": false,
3212
+ "notNull": true
3213
+ },
3214
+ "content": {
3215
+ "name": "content",
3216
+ "type": "text",
3217
+ "primaryKey": false,
3218
+ "notNull": false
3219
+ },
3220
+ "metadata": {
3221
+ "name": "metadata",
3222
+ "type": "jsonb",
3223
+ "primaryKey": false,
3224
+ "notNull": false
3225
+ },
3226
+ "ordinal": {
3227
+ "name": "ordinal",
3228
+ "type": "integer",
3229
+ "primaryKey": false,
3230
+ "notNull": true
3231
+ }
3232
+ },
3233
+ "indexes": {},
3234
+ "foreignKeys": {
3235
+ "turn_part_turn_id_inference_turn_id_fk": {
3236
+ "name": "turn_part_turn_id_inference_turn_id_fk",
3237
+ "tableFrom": "turn_part",
3238
+ "columnsFrom": ["turn_id"],
3239
+ "tableTo": "inference_turn",
3240
+ "columnsTo": ["id"],
3241
+ "onUpdate": "no action",
3242
+ "onDelete": "cascade"
3243
+ },
3244
+ "turn_part_session_id_agent_session_id_fk": {
3245
+ "name": "turn_part_session_id_agent_session_id_fk",
3246
+ "tableFrom": "turn_part",
3247
+ "columnsFrom": ["session_id"],
3248
+ "tableTo": "agent_session",
3249
+ "columnsTo": ["id"],
3250
+ "onUpdate": "no action",
3251
+ "onDelete": "cascade"
3252
+ }
3253
+ },
3254
+ "compositePrimaryKeys": {},
3255
+ "uniqueConstraints": {},
3256
+ "policies": {},
3257
+ "checkConstraints": {},
3258
+ "isRLSEnabled": false
3259
+ },
3260
+ "public.git_token": {
3261
+ "name": "git_token",
3262
+ "schema": "",
3263
+ "columns": {
3264
+ "id": {
3265
+ "name": "id",
3266
+ "type": "text",
3267
+ "primaryKey": true,
3268
+ "notNull": true
3269
+ },
3270
+ "tenant_id": {
3271
+ "name": "tenant_id",
3272
+ "type": "text",
3273
+ "primaryKey": false,
3274
+ "notNull": false
3275
+ },
3276
+ "user_id": {
3277
+ "name": "user_id",
3278
+ "type": "text",
3279
+ "primaryKey": false,
3280
+ "notNull": true
3281
+ },
3282
+ "principal_id": {
3283
+ "name": "principal_id",
3284
+ "type": "text",
3285
+ "primaryKey": false,
3286
+ "notNull": false
3287
+ },
3288
+ "name": {
3289
+ "name": "name",
3290
+ "type": "text",
3291
+ "primaryKey": false,
3292
+ "notNull": true
3293
+ },
3294
+ "kind": {
3295
+ "name": "kind",
3296
+ "type": "text",
3297
+ "primaryKey": false,
3298
+ "notNull": true
3299
+ },
3300
+ "token_hash_sha256": {
3301
+ "name": "token_hash_sha256",
3302
+ "type": "bytea",
3303
+ "primaryKey": false,
3304
+ "notNull": true
3305
+ },
3306
+ "resource": {
3307
+ "name": "resource",
3308
+ "type": "text",
3309
+ "primaryKey": false,
3310
+ "notNull": true
3311
+ },
3312
+ "ref_pattern": {
3313
+ "name": "ref_pattern",
3314
+ "type": "text",
3315
+ "primaryKey": false,
3316
+ "notNull": true
3317
+ },
3318
+ "actions": {
3319
+ "name": "actions",
3320
+ "type": "text[]",
3321
+ "primaryKey": false,
3322
+ "notNull": true
3323
+ },
3324
+ "expires_at": {
3325
+ "name": "expires_at",
3326
+ "type": "timestamp with time zone",
3327
+ "primaryKey": false,
3328
+ "notNull": true
3329
+ },
3330
+ "revoked_at": {
3331
+ "name": "revoked_at",
3332
+ "type": "timestamp with time zone",
3333
+ "primaryKey": false,
3334
+ "notNull": false
3335
+ },
3336
+ "created_at": {
3337
+ "name": "created_at",
3338
+ "type": "timestamp with time zone",
3339
+ "primaryKey": false,
3340
+ "notNull": true,
3341
+ "default": "now()"
3342
+ }
3343
+ },
3344
+ "indexes": {
3345
+ "git_token_user_id_name_active_idx": {
3346
+ "name": "git_token_user_id_name_active_idx",
3347
+ "columns": [
3348
+ {
3349
+ "expression": "user_id",
3350
+ "isExpression": false,
3351
+ "asc": true,
3352
+ "nulls": "last"
3353
+ },
3354
+ {
3355
+ "expression": "name",
3356
+ "isExpression": false,
3357
+ "asc": true,
3358
+ "nulls": "last"
3359
+ }
3360
+ ],
3361
+ "isUnique": true,
3362
+ "with": {},
3363
+ "method": "btree",
3364
+ "where": "\"git_token\".\"revoked_at\" is null",
3365
+ "concurrently": false
3366
+ }
3367
+ },
3368
+ "foreignKeys": {
3369
+ "git_token_tenant_id_tenant_id_fk": {
3370
+ "name": "git_token_tenant_id_tenant_id_fk",
3371
+ "tableFrom": "git_token",
3372
+ "columnsFrom": ["tenant_id"],
3373
+ "tableTo": "tenant",
3374
+ "columnsTo": ["id"],
3375
+ "onUpdate": "no action",
3376
+ "onDelete": "no action"
3377
+ },
3378
+ "git_token_user_id_user_id_fk": {
3379
+ "name": "git_token_user_id_user_id_fk",
3380
+ "tableFrom": "git_token",
3381
+ "columnsFrom": ["user_id"],
3382
+ "tableTo": "user",
3383
+ "columnsTo": ["id"],
3384
+ "onUpdate": "no action",
3385
+ "onDelete": "cascade"
3386
+ },
3387
+ "git_token_principal_id_principal_id_fk": {
3388
+ "name": "git_token_principal_id_principal_id_fk",
3389
+ "tableFrom": "git_token",
3390
+ "columnsFrom": ["principal_id"],
3391
+ "tableTo": "principal",
3392
+ "columnsTo": ["id"],
3393
+ "onUpdate": "no action",
3394
+ "onDelete": "cascade"
3395
+ }
3396
+ },
3397
+ "compositePrimaryKeys": {},
3398
+ "uniqueConstraints": {
3399
+ "git_token_token_hash_sha256_unique": {
3400
+ "name": "git_token_token_hash_sha256_unique",
3401
+ "columns": ["token_hash_sha256"],
3402
+ "nullsNotDistinct": false
3403
+ }
3404
+ },
3405
+ "policies": {},
3406
+ "checkConstraints": {},
3407
+ "isRLSEnabled": false
3408
+ },
3409
+ "public.workflow_definition": {
3410
+ "name": "workflow_definition",
3411
+ "schema": "",
3412
+ "columns": {
3413
+ "id": {
3414
+ "name": "id",
3415
+ "type": "text",
3416
+ "primaryKey": true,
3417
+ "notNull": true
3418
+ },
3419
+ "tenant_id": {
3420
+ "name": "tenant_id",
3421
+ "type": "text",
3422
+ "primaryKey": false,
3423
+ "notNull": true
3424
+ },
3425
+ "creator_principal_id": {
3426
+ "name": "creator_principal_id",
3427
+ "type": "text",
3428
+ "primaryKey": false,
3429
+ "notNull": false
3430
+ },
3431
+ "asset_id": {
3432
+ "name": "asset_id",
3433
+ "type": "text",
3434
+ "primaryKey": false,
3435
+ "notNull": false
3436
+ },
3437
+ "origin_agent_id": {
3438
+ "name": "origin_agent_id",
3439
+ "type": "text",
3440
+ "primaryKey": false,
3441
+ "notNull": false
3442
+ },
3443
+ "name": {
3444
+ "name": "name",
3445
+ "type": "text",
3446
+ "primaryKey": false,
3447
+ "notNull": true
3448
+ },
3449
+ "description": {
3450
+ "name": "description",
3451
+ "type": "text",
3452
+ "primaryKey": false,
3453
+ "notNull": false
3454
+ },
3455
+ "grant_requirements": {
3456
+ "name": "grant_requirements",
3457
+ "type": "jsonb",
3458
+ "primaryKey": false,
3459
+ "notNull": false
3460
+ },
3461
+ "current_version": {
3462
+ "name": "current_version",
3463
+ "type": "text",
3464
+ "primaryKey": false,
3465
+ "notNull": true,
3466
+ "default": "'1'"
3467
+ },
3468
+ "status": {
3469
+ "name": "status",
3470
+ "type": "text",
3471
+ "primaryKey": false,
3472
+ "notNull": true,
3473
+ "default": "'deployed'"
3474
+ },
3475
+ "created_at": {
3476
+ "name": "created_at",
3477
+ "type": "timestamp",
3478
+ "primaryKey": false,
3479
+ "notNull": true,
3480
+ "default": "now()"
3481
+ },
3482
+ "updated_at": {
3483
+ "name": "updated_at",
3484
+ "type": "timestamp",
3485
+ "primaryKey": false,
3486
+ "notNull": true,
3487
+ "default": "now()"
3488
+ }
3489
+ },
3490
+ "indexes": {
3491
+ "workflow_definition_tenant_idx": {
3492
+ "name": "workflow_definition_tenant_idx",
3493
+ "columns": [
3494
+ {
3495
+ "expression": "tenant_id",
3496
+ "isExpression": false,
3497
+ "asc": true,
3498
+ "nulls": "last"
3499
+ },
3500
+ {
3501
+ "expression": "created_at",
3502
+ "isExpression": false,
3503
+ "asc": true,
3504
+ "nulls": "last"
3505
+ }
3506
+ ],
3507
+ "isUnique": false,
3508
+ "with": {},
3509
+ "method": "btree",
3510
+ "concurrently": false
3511
+ },
3512
+ "workflow_definition_asset_idx": {
3513
+ "name": "workflow_definition_asset_idx",
3514
+ "columns": [
3515
+ {
3516
+ "expression": "asset_id",
3517
+ "isExpression": false,
3518
+ "asc": true,
3519
+ "nulls": "last"
3520
+ }
3521
+ ],
3522
+ "isUnique": true,
3523
+ "with": {},
3524
+ "method": "btree",
3525
+ "concurrently": false
3526
+ },
3527
+ "workflow_definition_origin_agent_idx": {
3528
+ "name": "workflow_definition_origin_agent_idx",
3529
+ "columns": [
3530
+ {
3531
+ "expression": "origin_agent_id",
3532
+ "isExpression": false,
3533
+ "asc": true,
3534
+ "nulls": "last"
3535
+ }
3536
+ ],
3537
+ "isUnique": true,
3538
+ "with": {},
3539
+ "method": "btree",
3540
+ "where": "\"workflow_definition\".\"origin_agent_id\" is not null",
3541
+ "concurrently": false
3542
+ }
3543
+ },
3544
+ "foreignKeys": {
3545
+ "workflow_definition_tenant_id_tenant_id_fk": {
3546
+ "name": "workflow_definition_tenant_id_tenant_id_fk",
3547
+ "tableFrom": "workflow_definition",
3548
+ "columnsFrom": ["tenant_id"],
3549
+ "tableTo": "tenant",
3550
+ "columnsTo": ["id"],
3551
+ "onUpdate": "no action",
3552
+ "onDelete": "cascade"
3553
+ },
3554
+ "workflow_definition_creator_principal_id_principal_id_fk": {
3555
+ "name": "workflow_definition_creator_principal_id_principal_id_fk",
3556
+ "tableFrom": "workflow_definition",
3557
+ "columnsFrom": ["creator_principal_id"],
3558
+ "tableTo": "principal",
3559
+ "columnsTo": ["id"],
3560
+ "onUpdate": "no action",
3561
+ "onDelete": "no action"
3562
+ },
3563
+ "workflow_definition_asset_id_asset_id_fk": {
3564
+ "name": "workflow_definition_asset_id_asset_id_fk",
3565
+ "tableFrom": "workflow_definition",
3566
+ "columnsFrom": ["asset_id"],
3567
+ "tableTo": "asset",
3568
+ "columnsTo": ["id"],
3569
+ "onUpdate": "no action",
3570
+ "onDelete": "restrict"
3571
+ }
3572
+ },
3573
+ "compositePrimaryKeys": {},
3574
+ "uniqueConstraints": {},
3575
+ "policies": {},
3576
+ "checkConstraints": {},
3577
+ "isRLSEnabled": false
3578
+ },
3579
+ "public.workflow_definition_version": {
3580
+ "name": "workflow_definition_version",
3581
+ "schema": "",
3582
+ "columns": {
3583
+ "id": {
3584
+ "name": "id",
3585
+ "type": "text",
3586
+ "primaryKey": true,
3587
+ "notNull": true
3588
+ },
3589
+ "definition_id": {
3590
+ "name": "definition_id",
3591
+ "type": "text",
3592
+ "primaryKey": false,
3593
+ "notNull": true
3594
+ },
3595
+ "version": {
3596
+ "name": "version",
3597
+ "type": "text",
3598
+ "primaryKey": false,
3599
+ "notNull": true
3600
+ },
3601
+ "status": {
3602
+ "name": "status",
3603
+ "type": "text",
3604
+ "primaryKey": false,
3605
+ "notNull": true,
3606
+ "default": "'active'"
3607
+ },
3608
+ "created_at": {
3609
+ "name": "created_at",
3610
+ "type": "timestamp",
3611
+ "primaryKey": false,
3612
+ "notNull": true,
3613
+ "default": "now()"
3614
+ }
3615
+ },
3616
+ "indexes": {
3617
+ "workflow_definition_version_definition_idx": {
3618
+ "name": "workflow_definition_version_definition_idx",
3619
+ "columns": [
3620
+ {
3621
+ "expression": "definition_id",
3622
+ "isExpression": false,
3623
+ "asc": true,
3624
+ "nulls": "last"
3625
+ }
3626
+ ],
3627
+ "isUnique": false,
3628
+ "with": {},
3629
+ "method": "btree",
3630
+ "concurrently": false
3631
+ }
3632
+ },
3633
+ "foreignKeys": {
3634
+ "workflow_definition_version_definition_id_workflow_definition_id_fk": {
3635
+ "name": "workflow_definition_version_definition_id_workflow_definition_id_fk",
3636
+ "tableFrom": "workflow_definition_version",
3637
+ "columnsFrom": ["definition_id"],
3638
+ "tableTo": "workflow_definition",
3639
+ "columnsTo": ["id"],
3640
+ "onUpdate": "no action",
3641
+ "onDelete": "cascade"
3642
+ }
3643
+ },
3644
+ "compositePrimaryKeys": {},
3645
+ "uniqueConstraints": {
3646
+ "workflow_definition_version_definition_version": {
3647
+ "name": "workflow_definition_version_definition_version",
3648
+ "columns": ["definition_id", "version"],
3649
+ "nullsNotDistinct": false
3650
+ }
3651
+ },
3652
+ "policies": {},
3653
+ "checkConstraints": {},
3654
+ "isRLSEnabled": false
3655
+ },
3656
+ "public.workflow_deployment": {
3657
+ "name": "workflow_deployment",
3658
+ "schema": "",
3659
+ "columns": {
3660
+ "id": {
3661
+ "name": "id",
3662
+ "type": "text",
3663
+ "primaryKey": true,
3664
+ "notNull": true
3665
+ },
3666
+ "tenant_id": {
3667
+ "name": "tenant_id",
3668
+ "type": "text",
3669
+ "primaryKey": false,
3670
+ "notNull": true
3671
+ },
3672
+ "definition_asset_id": {
3673
+ "name": "definition_asset_id",
3674
+ "type": "text",
3675
+ "primaryKey": false,
3676
+ "notNull": true
3677
+ },
3678
+ "address": {
3679
+ "name": "address",
3680
+ "type": "text",
3681
+ "primaryKey": false,
3682
+ "notNull": true
3683
+ },
3684
+ "public_key": {
3685
+ "name": "public_key",
3686
+ "type": "text",
3687
+ "primaryKey": false,
3688
+ "notNull": false
3689
+ },
3690
+ "status": {
3691
+ "name": "status",
3692
+ "type": "text",
3693
+ "primaryKey": false,
3694
+ "notNull": true,
3695
+ "default": "'deployed'"
3696
+ },
3697
+ "created_at": {
3698
+ "name": "created_at",
3699
+ "type": "timestamp",
3700
+ "primaryKey": false,
3701
+ "notNull": true,
3702
+ "default": "now()"
3703
+ }
3704
+ },
3705
+ "indexes": {
3706
+ "workflow_deployment_tenant_idx": {
3707
+ "name": "workflow_deployment_tenant_idx",
3708
+ "columns": [
3709
+ {
3710
+ "expression": "tenant_id",
3711
+ "isExpression": false,
3712
+ "asc": true,
3713
+ "nulls": "last"
3714
+ },
3715
+ {
3716
+ "expression": "created_at",
3717
+ "isExpression": false,
3718
+ "asc": true,
3719
+ "nulls": "last"
3720
+ }
3721
+ ],
3722
+ "isUnique": false,
3723
+ "with": {},
3724
+ "method": "btree",
3725
+ "concurrently": false
3726
+ },
3727
+ "workflow_deployment_address_idx": {
3728
+ "name": "workflow_deployment_address_idx",
3729
+ "columns": [
3730
+ {
3731
+ "expression": "address",
3732
+ "isExpression": false,
3733
+ "asc": true,
3734
+ "nulls": "last"
3735
+ }
3736
+ ],
3737
+ "isUnique": true,
3738
+ "with": {},
3739
+ "method": "btree",
3740
+ "concurrently": false
3741
+ }
3742
+ },
3743
+ "foreignKeys": {
3744
+ "workflow_deployment_tenant_id_tenant_id_fk": {
3745
+ "name": "workflow_deployment_tenant_id_tenant_id_fk",
3746
+ "tableFrom": "workflow_deployment",
3747
+ "columnsFrom": ["tenant_id"],
3748
+ "tableTo": "tenant",
3749
+ "columnsTo": ["id"],
3750
+ "onUpdate": "no action",
3751
+ "onDelete": "cascade"
3752
+ },
3753
+ "workflow_deployment_definition_asset_id_asset_id_fk": {
3754
+ "name": "workflow_deployment_definition_asset_id_asset_id_fk",
3755
+ "tableFrom": "workflow_deployment",
3756
+ "columnsFrom": ["definition_asset_id"],
3757
+ "tableTo": "asset",
3758
+ "columnsTo": ["id"],
3759
+ "onUpdate": "no action",
3760
+ "onDelete": "cascade"
3761
+ }
3762
+ },
3763
+ "compositePrimaryKeys": {},
3764
+ "uniqueConstraints": {},
3765
+ "policies": {},
3766
+ "checkConstraints": {},
3767
+ "isRLSEnabled": false
3768
+ },
3769
+ "public.workflow_run": {
3770
+ "name": "workflow_run",
3771
+ "schema": "",
3772
+ "columns": {
3773
+ "id": {
3774
+ "name": "id",
3775
+ "type": "text",
3776
+ "primaryKey": true,
3777
+ "notNull": true
3778
+ },
3779
+ "definition_id": {
3780
+ "name": "definition_id",
3781
+ "type": "text",
3782
+ "primaryKey": false,
3783
+ "notNull": false
3784
+ },
3785
+ "deployment_id": {
3786
+ "name": "deployment_id",
3787
+ "type": "text",
3788
+ "primaryKey": false,
3789
+ "notNull": false
3790
+ },
3791
+ "tenant_id": {
3792
+ "name": "tenant_id",
3793
+ "type": "text",
3794
+ "primaryKey": false,
3795
+ "notNull": true
3796
+ },
3797
+ "principal_id": {
3798
+ "name": "principal_id",
3799
+ "type": "text",
3800
+ "primaryKey": false,
3801
+ "notNull": false
3802
+ },
3803
+ "status": {
3804
+ "name": "status",
3805
+ "type": "text",
3806
+ "primaryKey": false,
3807
+ "notNull": true,
3808
+ "default": "'running'"
3809
+ },
3810
+ "address": {
3811
+ "name": "address",
3812
+ "type": "text",
3813
+ "primaryKey": false,
3814
+ "notNull": false
3815
+ },
3816
+ "public_key": {
3817
+ "name": "public_key",
3818
+ "type": "text",
3819
+ "primaryKey": false,
3820
+ "notNull": false
3821
+ },
3822
+ "sidecar_id": {
3823
+ "name": "sidecar_id",
3824
+ "type": "text",
3825
+ "primaryKey": false,
3826
+ "notNull": false
3827
+ },
3828
+ "kernel_id": {
3829
+ "name": "kernel_id",
3830
+ "type": "text",
3831
+ "primaryKey": false,
3832
+ "notNull": false
3833
+ },
3834
+ "model_preferences": {
3835
+ "name": "model_preferences",
3836
+ "type": "jsonb",
3837
+ "primaryKey": false,
3838
+ "notNull": false
3839
+ },
3840
+ "created_at": {
3841
+ "name": "created_at",
3842
+ "type": "timestamp",
3843
+ "primaryKey": false,
3844
+ "notNull": true,
3845
+ "default": "now()"
3846
+ },
3847
+ "ended_at": {
3848
+ "name": "ended_at",
3849
+ "type": "timestamp",
3850
+ "primaryKey": false,
3851
+ "notNull": false
3852
+ }
3853
+ },
3854
+ "indexes": {
3855
+ "workflow_run_definition_idx": {
3856
+ "name": "workflow_run_definition_idx",
3857
+ "columns": [
3858
+ {
3859
+ "expression": "definition_id",
3860
+ "isExpression": false,
3861
+ "asc": true,
3862
+ "nulls": "last"
3863
+ }
3864
+ ],
3865
+ "isUnique": false,
3866
+ "with": {},
3867
+ "method": "btree",
3868
+ "concurrently": false
3869
+ },
3870
+ "workflow_run_address_idx": {
3871
+ "name": "workflow_run_address_idx",
3872
+ "columns": [
3873
+ {
3874
+ "expression": "address",
3875
+ "isExpression": false,
3876
+ "asc": true,
3877
+ "nulls": "last"
3878
+ }
3879
+ ],
3880
+ "isUnique": true,
3881
+ "with": {},
3882
+ "method": "btree",
3883
+ "where": "\"workflow_run\".\"address\" is not null",
3884
+ "concurrently": false
3885
+ }
3886
+ },
3887
+ "foreignKeys": {
3888
+ "workflow_run_definition_id_workflow_definition_id_fk": {
3889
+ "name": "workflow_run_definition_id_workflow_definition_id_fk",
3890
+ "tableFrom": "workflow_run",
3891
+ "columnsFrom": ["definition_id"],
3892
+ "tableTo": "workflow_definition",
3893
+ "columnsTo": ["id"],
3894
+ "onUpdate": "no action",
3895
+ "onDelete": "cascade"
3896
+ },
3897
+ "workflow_run_deployment_id_workflow_deployment_id_fk": {
3898
+ "name": "workflow_run_deployment_id_workflow_deployment_id_fk",
3899
+ "tableFrom": "workflow_run",
3900
+ "columnsFrom": ["deployment_id"],
3901
+ "tableTo": "workflow_deployment",
3902
+ "columnsTo": ["id"],
3903
+ "onUpdate": "no action",
3904
+ "onDelete": "cascade"
3905
+ },
3906
+ "workflow_run_tenant_id_tenant_id_fk": {
3907
+ "name": "workflow_run_tenant_id_tenant_id_fk",
3908
+ "tableFrom": "workflow_run",
3909
+ "columnsFrom": ["tenant_id"],
3910
+ "tableTo": "tenant",
3911
+ "columnsTo": ["id"],
3912
+ "onUpdate": "no action",
3913
+ "onDelete": "cascade"
3914
+ },
3915
+ "workflow_run_principal_id_principal_id_fk": {
3916
+ "name": "workflow_run_principal_id_principal_id_fk",
3917
+ "tableFrom": "workflow_run",
3918
+ "columnsFrom": ["principal_id"],
3919
+ "tableTo": "principal",
3920
+ "columnsTo": ["id"],
3921
+ "onUpdate": "no action",
3922
+ "onDelete": "set null"
3923
+ },
3924
+ "workflow_run_sidecar_id_sidecar_id_fk": {
3925
+ "name": "workflow_run_sidecar_id_sidecar_id_fk",
3926
+ "tableFrom": "workflow_run",
3927
+ "columnsFrom": ["sidecar_id"],
3928
+ "tableTo": "sidecar",
3929
+ "columnsTo": ["id"],
3930
+ "onUpdate": "no action",
3931
+ "onDelete": "set null"
3932
+ }
3933
+ },
3934
+ "compositePrimaryKeys": {},
3935
+ "uniqueConstraints": {},
3936
+ "policies": {},
3937
+ "checkConstraints": {},
3938
+ "isRLSEnabled": false
3939
+ }
3940
+ },
3941
+ "enums": {},
3942
+ "schemas": {},
3943
+ "views": {},
3944
+ "sequences": {},
3945
+ "roles": {},
3946
+ "policies": {},
3947
+ "_meta": {
3948
+ "columns": {},
3949
+ "schemas": {},
3950
+ "tables": {}
3951
+ }
3952
+ }