@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,3470 @@
1
+ {
2
+ "id": "4c3e77e1-abe9-4cfa-ac80-0b9176d4d82b",
3
+ "prevId": "3c96750f-3332-4fd9-9163-88eea70047c4",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.account": {
8
+ "name": "account",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "text",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "user_id": {
18
+ "name": "user_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "account_id": {
24
+ "name": "account_id",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "provider_id": {
30
+ "name": "provider_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": true
34
+ },
35
+ "access_token": {
36
+ "name": "access_token",
37
+ "type": "text",
38
+ "primaryKey": false,
39
+ "notNull": false
40
+ },
41
+ "refresh_token": {
42
+ "name": "refresh_token",
43
+ "type": "text",
44
+ "primaryKey": false,
45
+ "notNull": false
46
+ },
47
+ "access_token_expires_at": {
48
+ "name": "access_token_expires_at",
49
+ "type": "timestamp",
50
+ "primaryKey": false,
51
+ "notNull": false
52
+ },
53
+ "refresh_token_expires_at": {
54
+ "name": "refresh_token_expires_at",
55
+ "type": "timestamp",
56
+ "primaryKey": false,
57
+ "notNull": false
58
+ },
59
+ "scope": {
60
+ "name": "scope",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false
64
+ },
65
+ "id_token": {
66
+ "name": "id_token",
67
+ "type": "text",
68
+ "primaryKey": false,
69
+ "notNull": false
70
+ },
71
+ "password": {
72
+ "name": "password",
73
+ "type": "text",
74
+ "primaryKey": false,
75
+ "notNull": false
76
+ },
77
+ "created_at": {
78
+ "name": "created_at",
79
+ "type": "timestamp",
80
+ "primaryKey": false,
81
+ "notNull": true,
82
+ "default": "now()"
83
+ },
84
+ "updated_at": {
85
+ "name": "updated_at",
86
+ "type": "timestamp",
87
+ "primaryKey": false,
88
+ "notNull": true,
89
+ "default": "now()"
90
+ }
91
+ },
92
+ "indexes": {},
93
+ "foreignKeys": {
94
+ "account_user_id_user_id_fk": {
95
+ "name": "account_user_id_user_id_fk",
96
+ "tableFrom": "account",
97
+ "tableTo": "user",
98
+ "columnsFrom": ["user_id"],
99
+ "columnsTo": ["id"],
100
+ "onDelete": "cascade",
101
+ "onUpdate": "no action"
102
+ }
103
+ },
104
+ "compositePrimaryKeys": {},
105
+ "uniqueConstraints": {},
106
+ "policies": {},
107
+ "checkConstraints": {},
108
+ "isRLSEnabled": false
109
+ },
110
+ "public.session": {
111
+ "name": "session",
112
+ "schema": "",
113
+ "columns": {
114
+ "id": {
115
+ "name": "id",
116
+ "type": "text",
117
+ "primaryKey": true,
118
+ "notNull": true
119
+ },
120
+ "user_id": {
121
+ "name": "user_id",
122
+ "type": "text",
123
+ "primaryKey": false,
124
+ "notNull": true
125
+ },
126
+ "token": {
127
+ "name": "token",
128
+ "type": "text",
129
+ "primaryKey": false,
130
+ "notNull": true
131
+ },
132
+ "expires_at": {
133
+ "name": "expires_at",
134
+ "type": "timestamp",
135
+ "primaryKey": false,
136
+ "notNull": true
137
+ },
138
+ "ip_address": {
139
+ "name": "ip_address",
140
+ "type": "text",
141
+ "primaryKey": false,
142
+ "notNull": false
143
+ },
144
+ "user_agent": {
145
+ "name": "user_agent",
146
+ "type": "text",
147
+ "primaryKey": false,
148
+ "notNull": false
149
+ },
150
+ "created_at": {
151
+ "name": "created_at",
152
+ "type": "timestamp",
153
+ "primaryKey": false,
154
+ "notNull": true,
155
+ "default": "now()"
156
+ },
157
+ "updated_at": {
158
+ "name": "updated_at",
159
+ "type": "timestamp",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "default": "now()"
163
+ }
164
+ },
165
+ "indexes": {},
166
+ "foreignKeys": {
167
+ "session_user_id_user_id_fk": {
168
+ "name": "session_user_id_user_id_fk",
169
+ "tableFrom": "session",
170
+ "tableTo": "user",
171
+ "columnsFrom": ["user_id"],
172
+ "columnsTo": ["id"],
173
+ "onDelete": "cascade",
174
+ "onUpdate": "no action"
175
+ }
176
+ },
177
+ "compositePrimaryKeys": {},
178
+ "uniqueConstraints": {
179
+ "session_token_unique": {
180
+ "name": "session_token_unique",
181
+ "nullsNotDistinct": false,
182
+ "columns": ["token"]
183
+ }
184
+ },
185
+ "policies": {},
186
+ "checkConstraints": {},
187
+ "isRLSEnabled": false
188
+ },
189
+ "public.user": {
190
+ "name": "user",
191
+ "schema": "",
192
+ "columns": {
193
+ "id": {
194
+ "name": "id",
195
+ "type": "text",
196
+ "primaryKey": true,
197
+ "notNull": true
198
+ },
199
+ "name": {
200
+ "name": "name",
201
+ "type": "text",
202
+ "primaryKey": false,
203
+ "notNull": true
204
+ },
205
+ "email": {
206
+ "name": "email",
207
+ "type": "text",
208
+ "primaryKey": false,
209
+ "notNull": true
210
+ },
211
+ "email_verified": {
212
+ "name": "email_verified",
213
+ "type": "boolean",
214
+ "primaryKey": false,
215
+ "notNull": true,
216
+ "default": false
217
+ },
218
+ "image": {
219
+ "name": "image",
220
+ "type": "text",
221
+ "primaryKey": false,
222
+ "notNull": false
223
+ },
224
+ "created_at": {
225
+ "name": "created_at",
226
+ "type": "timestamp",
227
+ "primaryKey": false,
228
+ "notNull": true,
229
+ "default": "now()"
230
+ },
231
+ "updated_at": {
232
+ "name": "updated_at",
233
+ "type": "timestamp",
234
+ "primaryKey": false,
235
+ "notNull": true,
236
+ "default": "now()"
237
+ }
238
+ },
239
+ "indexes": {},
240
+ "foreignKeys": {},
241
+ "compositePrimaryKeys": {},
242
+ "uniqueConstraints": {
243
+ "user_email_unique": {
244
+ "name": "user_email_unique",
245
+ "nullsNotDistinct": false,
246
+ "columns": ["email"]
247
+ }
248
+ },
249
+ "policies": {},
250
+ "checkConstraints": {},
251
+ "isRLSEnabled": false
252
+ },
253
+ "public.verification": {
254
+ "name": "verification",
255
+ "schema": "",
256
+ "columns": {
257
+ "id": {
258
+ "name": "id",
259
+ "type": "text",
260
+ "primaryKey": true,
261
+ "notNull": true
262
+ },
263
+ "identifier": {
264
+ "name": "identifier",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "text",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "expires_at": {
276
+ "name": "expires_at",
277
+ "type": "timestamp",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "created_at": {
282
+ "name": "created_at",
283
+ "type": "timestamp",
284
+ "primaryKey": false,
285
+ "notNull": true,
286
+ "default": "now()"
287
+ },
288
+ "updated_at": {
289
+ "name": "updated_at",
290
+ "type": "timestamp",
291
+ "primaryKey": false,
292
+ "notNull": true,
293
+ "default": "now()"
294
+ }
295
+ },
296
+ "indexes": {},
297
+ "foreignKeys": {},
298
+ "compositePrimaryKeys": {},
299
+ "uniqueConstraints": {},
300
+ "policies": {},
301
+ "checkConstraints": {},
302
+ "isRLSEnabled": false
303
+ },
304
+ "public.federation_trust": {
305
+ "name": "federation_trust",
306
+ "schema": "",
307
+ "columns": {
308
+ "id": {
309
+ "name": "id",
310
+ "type": "text",
311
+ "primaryKey": true,
312
+ "notNull": true
313
+ },
314
+ "tenant_id": {
315
+ "name": "tenant_id",
316
+ "type": "text",
317
+ "primaryKey": false,
318
+ "notNull": true
319
+ },
320
+ "target_tenant_id": {
321
+ "name": "target_tenant_id",
322
+ "type": "text",
323
+ "primaryKey": false,
324
+ "notNull": true
325
+ },
326
+ "direction": {
327
+ "name": "direction",
328
+ "type": "text",
329
+ "primaryKey": false,
330
+ "notNull": true
331
+ },
332
+ "created_at": {
333
+ "name": "created_at",
334
+ "type": "timestamp",
335
+ "primaryKey": false,
336
+ "notNull": true,
337
+ "default": "now()"
338
+ }
339
+ },
340
+ "indexes": {},
341
+ "foreignKeys": {
342
+ "federation_trust_tenant_id_tenant_id_fk": {
343
+ "name": "federation_trust_tenant_id_tenant_id_fk",
344
+ "tableFrom": "federation_trust",
345
+ "tableTo": "tenant",
346
+ "columnsFrom": ["tenant_id"],
347
+ "columnsTo": ["id"],
348
+ "onDelete": "cascade",
349
+ "onUpdate": "no action"
350
+ },
351
+ "federation_trust_target_tenant_id_tenant_id_fk": {
352
+ "name": "federation_trust_target_tenant_id_tenant_id_fk",
353
+ "tableFrom": "federation_trust",
354
+ "tableTo": "tenant",
355
+ "columnsFrom": ["target_tenant_id"],
356
+ "columnsTo": ["id"],
357
+ "onDelete": "cascade",
358
+ "onUpdate": "no action"
359
+ }
360
+ },
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {
363
+ "federation_trust_tenant_id_target_tenant_id_unique": {
364
+ "name": "federation_trust_tenant_id_target_tenant_id_unique",
365
+ "nullsNotDistinct": false,
366
+ "columns": ["tenant_id", "target_tenant_id"]
367
+ }
368
+ },
369
+ "policies": {},
370
+ "checkConstraints": {},
371
+ "isRLSEnabled": false
372
+ },
373
+ "public.tenant": {
374
+ "name": "tenant",
375
+ "schema": "",
376
+ "columns": {
377
+ "id": {
378
+ "name": "id",
379
+ "type": "text",
380
+ "primaryKey": true,
381
+ "notNull": true
382
+ },
383
+ "name": {
384
+ "name": "name",
385
+ "type": "text",
386
+ "primaryKey": false,
387
+ "notNull": true
388
+ },
389
+ "slug": {
390
+ "name": "slug",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true
394
+ },
395
+ "domain": {
396
+ "name": "domain",
397
+ "type": "text",
398
+ "primaryKey": false,
399
+ "notNull": true
400
+ },
401
+ "parent_id": {
402
+ "name": "parent_id",
403
+ "type": "text",
404
+ "primaryKey": false,
405
+ "notNull": false
406
+ },
407
+ "config": {
408
+ "name": "config",
409
+ "type": "jsonb",
410
+ "primaryKey": false,
411
+ "notNull": false
412
+ },
413
+ "created_at": {
414
+ "name": "created_at",
415
+ "type": "timestamp",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "default": "now()"
419
+ },
420
+ "updated_at": {
421
+ "name": "updated_at",
422
+ "type": "timestamp",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "default": "now()"
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {
430
+ "tenant_parent_id_tenant_id_fk": {
431
+ "name": "tenant_parent_id_tenant_id_fk",
432
+ "tableFrom": "tenant",
433
+ "tableTo": "tenant",
434
+ "columnsFrom": ["parent_id"],
435
+ "columnsTo": ["id"],
436
+ "onDelete": "no action",
437
+ "onUpdate": "no action"
438
+ }
439
+ },
440
+ "compositePrimaryKeys": {},
441
+ "uniqueConstraints": {
442
+ "tenant_slug_unique": {
443
+ "name": "tenant_slug_unique",
444
+ "nullsNotDistinct": false,
445
+ "columns": ["slug"]
446
+ },
447
+ "tenant_domain_unique": {
448
+ "name": "tenant_domain_unique",
449
+ "nullsNotDistinct": false,
450
+ "columns": ["domain"]
451
+ }
452
+ },
453
+ "policies": {},
454
+ "checkConstraints": {},
455
+ "isRLSEnabled": false
456
+ },
457
+ "public.principal": {
458
+ "name": "principal",
459
+ "schema": "",
460
+ "columns": {
461
+ "id": {
462
+ "name": "id",
463
+ "type": "text",
464
+ "primaryKey": true,
465
+ "notNull": true
466
+ },
467
+ "tenant_id": {
468
+ "name": "tenant_id",
469
+ "type": "text",
470
+ "primaryKey": false,
471
+ "notNull": true
472
+ },
473
+ "kind": {
474
+ "name": "kind",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true
478
+ },
479
+ "ref_id": {
480
+ "name": "ref_id",
481
+ "type": "text",
482
+ "primaryKey": false,
483
+ "notNull": true
484
+ },
485
+ "status": {
486
+ "name": "status",
487
+ "type": "text",
488
+ "primaryKey": false,
489
+ "notNull": true
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "timestamp",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "default": "now()"
497
+ },
498
+ "updated_at": {
499
+ "name": "updated_at",
500
+ "type": "timestamp",
501
+ "primaryKey": false,
502
+ "notNull": true,
503
+ "default": "now()"
504
+ }
505
+ },
506
+ "indexes": {},
507
+ "foreignKeys": {
508
+ "principal_tenant_id_tenant_id_fk": {
509
+ "name": "principal_tenant_id_tenant_id_fk",
510
+ "tableFrom": "principal",
511
+ "tableTo": "tenant",
512
+ "columnsFrom": ["tenant_id"],
513
+ "columnsTo": ["id"],
514
+ "onDelete": "cascade",
515
+ "onUpdate": "no action"
516
+ }
517
+ },
518
+ "compositePrimaryKeys": {},
519
+ "uniqueConstraints": {
520
+ "principal_tenant_id_kind_ref_id_unique": {
521
+ "name": "principal_tenant_id_kind_ref_id_unique",
522
+ "nullsNotDistinct": false,
523
+ "columns": ["tenant_id", "kind", "ref_id"]
524
+ }
525
+ },
526
+ "policies": {},
527
+ "checkConstraints": {},
528
+ "isRLSEnabled": false
529
+ },
530
+ "public.agent_role": {
531
+ "name": "agent_role",
532
+ "schema": "",
533
+ "columns": {
534
+ "agent_id": {
535
+ "name": "agent_id",
536
+ "type": "text",
537
+ "primaryKey": false,
538
+ "notNull": true
539
+ },
540
+ "role_id": {
541
+ "name": "role_id",
542
+ "type": "text",
543
+ "primaryKey": false,
544
+ "notNull": true
545
+ },
546
+ "created_at": {
547
+ "name": "created_at",
548
+ "type": "timestamp",
549
+ "primaryKey": false,
550
+ "notNull": true,
551
+ "default": "now()"
552
+ }
553
+ },
554
+ "indexes": {},
555
+ "foreignKeys": {
556
+ "agent_role_agent_id_agent_id_fk": {
557
+ "name": "agent_role_agent_id_agent_id_fk",
558
+ "tableFrom": "agent_role",
559
+ "tableTo": "agent",
560
+ "columnsFrom": ["agent_id"],
561
+ "columnsTo": ["id"],
562
+ "onDelete": "cascade",
563
+ "onUpdate": "no action"
564
+ },
565
+ "agent_role_role_id_role_id_fk": {
566
+ "name": "agent_role_role_id_role_id_fk",
567
+ "tableFrom": "agent_role",
568
+ "tableTo": "role",
569
+ "columnsFrom": ["role_id"],
570
+ "columnsTo": ["id"],
571
+ "onDelete": "cascade",
572
+ "onUpdate": "no action"
573
+ }
574
+ },
575
+ "compositePrimaryKeys": {
576
+ "agent_role_agent_id_role_id_pk": {
577
+ "name": "agent_role_agent_id_role_id_pk",
578
+ "columns": ["agent_id", "role_id"]
579
+ }
580
+ },
581
+ "uniqueConstraints": {},
582
+ "policies": {},
583
+ "checkConstraints": {},
584
+ "isRLSEnabled": false
585
+ },
586
+ "public.principal_role": {
587
+ "name": "principal_role",
588
+ "schema": "",
589
+ "columns": {
590
+ "principal_id": {
591
+ "name": "principal_id",
592
+ "type": "text",
593
+ "primaryKey": false,
594
+ "notNull": true
595
+ },
596
+ "role_id": {
597
+ "name": "role_id",
598
+ "type": "text",
599
+ "primaryKey": false,
600
+ "notNull": true
601
+ },
602
+ "created_at": {
603
+ "name": "created_at",
604
+ "type": "timestamp",
605
+ "primaryKey": false,
606
+ "notNull": true,
607
+ "default": "now()"
608
+ }
609
+ },
610
+ "indexes": {},
611
+ "foreignKeys": {
612
+ "principal_role_principal_id_principal_id_fk": {
613
+ "name": "principal_role_principal_id_principal_id_fk",
614
+ "tableFrom": "principal_role",
615
+ "tableTo": "principal",
616
+ "columnsFrom": ["principal_id"],
617
+ "columnsTo": ["id"],
618
+ "onDelete": "cascade",
619
+ "onUpdate": "no action"
620
+ },
621
+ "principal_role_role_id_role_id_fk": {
622
+ "name": "principal_role_role_id_role_id_fk",
623
+ "tableFrom": "principal_role",
624
+ "tableTo": "role",
625
+ "columnsFrom": ["role_id"],
626
+ "columnsTo": ["id"],
627
+ "onDelete": "cascade",
628
+ "onUpdate": "no action"
629
+ }
630
+ },
631
+ "compositePrimaryKeys": {
632
+ "principal_role_principal_id_role_id_pk": {
633
+ "name": "principal_role_principal_id_role_id_pk",
634
+ "columns": ["principal_id", "role_id"]
635
+ }
636
+ },
637
+ "uniqueConstraints": {},
638
+ "policies": {},
639
+ "checkConstraints": {},
640
+ "isRLSEnabled": false
641
+ },
642
+ "public.role": {
643
+ "name": "role",
644
+ "schema": "",
645
+ "columns": {
646
+ "id": {
647
+ "name": "id",
648
+ "type": "text",
649
+ "primaryKey": true,
650
+ "notNull": true
651
+ },
652
+ "tenant_id": {
653
+ "name": "tenant_id",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "name": {
659
+ "name": "name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": true
663
+ },
664
+ "description": {
665
+ "name": "description",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false
669
+ },
670
+ "is_system": {
671
+ "name": "is_system",
672
+ "type": "boolean",
673
+ "primaryKey": false,
674
+ "notNull": true,
675
+ "default": false
676
+ },
677
+ "created_at": {
678
+ "name": "created_at",
679
+ "type": "timestamp",
680
+ "primaryKey": false,
681
+ "notNull": true,
682
+ "default": "now()"
683
+ },
684
+ "updated_at": {
685
+ "name": "updated_at",
686
+ "type": "timestamp",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "default": "now()"
690
+ }
691
+ },
692
+ "indexes": {},
693
+ "foreignKeys": {
694
+ "role_tenant_id_tenant_id_fk": {
695
+ "name": "role_tenant_id_tenant_id_fk",
696
+ "tableFrom": "role",
697
+ "tableTo": "tenant",
698
+ "columnsFrom": ["tenant_id"],
699
+ "columnsTo": ["id"],
700
+ "onDelete": "cascade",
701
+ "onUpdate": "no action"
702
+ }
703
+ },
704
+ "compositePrimaryKeys": {},
705
+ "uniqueConstraints": {},
706
+ "policies": {},
707
+ "checkConstraints": {},
708
+ "isRLSEnabled": false
709
+ },
710
+ "public.grant": {
711
+ "name": "grant",
712
+ "schema": "",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true
719
+ },
720
+ "tenant_id": {
721
+ "name": "tenant_id",
722
+ "type": "text",
723
+ "primaryKey": false,
724
+ "notNull": true
725
+ },
726
+ "role_id": {
727
+ "name": "role_id",
728
+ "type": "text",
729
+ "primaryKey": false,
730
+ "notNull": false
731
+ },
732
+ "principal_id": {
733
+ "name": "principal_id",
734
+ "type": "text",
735
+ "primaryKey": false,
736
+ "notNull": false
737
+ },
738
+ "resource": {
739
+ "name": "resource",
740
+ "type": "text",
741
+ "primaryKey": false,
742
+ "notNull": true
743
+ },
744
+ "action": {
745
+ "name": "action",
746
+ "type": "text",
747
+ "primaryKey": false,
748
+ "notNull": true
749
+ },
750
+ "effect": {
751
+ "name": "effect",
752
+ "type": "text",
753
+ "primaryKey": false,
754
+ "notNull": true
755
+ },
756
+ "conditions": {
757
+ "name": "conditions",
758
+ "type": "jsonb",
759
+ "primaryKey": false,
760
+ "notNull": false
761
+ },
762
+ "origin": {
763
+ "name": "origin",
764
+ "type": "text",
765
+ "primaryKey": false,
766
+ "notNull": true
767
+ },
768
+ "expires_at": {
769
+ "name": "expires_at",
770
+ "type": "timestamp",
771
+ "primaryKey": false,
772
+ "notNull": false
773
+ },
774
+ "created_at": {
775
+ "name": "created_at",
776
+ "type": "timestamp",
777
+ "primaryKey": false,
778
+ "notNull": true,
779
+ "default": "now()"
780
+ },
781
+ "updated_at": {
782
+ "name": "updated_at",
783
+ "type": "timestamp",
784
+ "primaryKey": false,
785
+ "notNull": true,
786
+ "default": "now()"
787
+ }
788
+ },
789
+ "indexes": {},
790
+ "foreignKeys": {
791
+ "grant_tenant_id_tenant_id_fk": {
792
+ "name": "grant_tenant_id_tenant_id_fk",
793
+ "tableFrom": "grant",
794
+ "tableTo": "tenant",
795
+ "columnsFrom": ["tenant_id"],
796
+ "columnsTo": ["id"],
797
+ "onDelete": "cascade",
798
+ "onUpdate": "no action"
799
+ },
800
+ "grant_role_id_role_id_fk": {
801
+ "name": "grant_role_id_role_id_fk",
802
+ "tableFrom": "grant",
803
+ "tableTo": "role",
804
+ "columnsFrom": ["role_id"],
805
+ "columnsTo": ["id"],
806
+ "onDelete": "cascade",
807
+ "onUpdate": "no action"
808
+ },
809
+ "grant_principal_id_principal_id_fk": {
810
+ "name": "grant_principal_id_principal_id_fk",
811
+ "tableFrom": "grant",
812
+ "tableTo": "principal",
813
+ "columnsFrom": ["principal_id"],
814
+ "columnsTo": ["id"],
815
+ "onDelete": "cascade",
816
+ "onUpdate": "no action"
817
+ }
818
+ },
819
+ "compositePrimaryKeys": {},
820
+ "uniqueConstraints": {},
821
+ "policies": {},
822
+ "checkConstraints": {},
823
+ "isRLSEnabled": false
824
+ },
825
+ "public.approval": {
826
+ "name": "approval",
827
+ "schema": "",
828
+ "columns": {
829
+ "id": {
830
+ "name": "id",
831
+ "type": "text",
832
+ "primaryKey": true,
833
+ "notNull": true
834
+ },
835
+ "tenant_id": {
836
+ "name": "tenant_id",
837
+ "type": "text",
838
+ "primaryKey": false,
839
+ "notNull": true
840
+ },
841
+ "instance_id": {
842
+ "name": "instance_id",
843
+ "type": "text",
844
+ "primaryKey": false,
845
+ "notNull": true
846
+ },
847
+ "agent_id": {
848
+ "name": "agent_id",
849
+ "type": "text",
850
+ "primaryKey": false,
851
+ "notNull": true
852
+ },
853
+ "origin_principal_id": {
854
+ "name": "origin_principal_id",
855
+ "type": "text",
856
+ "primaryKey": false,
857
+ "notNull": true
858
+ },
859
+ "correlation_id": {
860
+ "name": "correlation_id",
861
+ "type": "text",
862
+ "primaryKey": false,
863
+ "notNull": true
864
+ },
865
+ "tool_definition": {
866
+ "name": "tool_definition",
867
+ "type": "jsonb",
868
+ "primaryKey": false,
869
+ "notNull": false
870
+ },
871
+ "tool_arguments": {
872
+ "name": "tool_arguments",
873
+ "type": "jsonb",
874
+ "primaryKey": false,
875
+ "notNull": false
876
+ },
877
+ "scope": {
878
+ "name": "scope",
879
+ "type": "text",
880
+ "primaryKey": false,
881
+ "notNull": false
882
+ },
883
+ "status": {
884
+ "name": "status",
885
+ "type": "text",
886
+ "primaryKey": false,
887
+ "notNull": true,
888
+ "default": "'pending'"
889
+ },
890
+ "origin_kind": {
891
+ "name": "origin_kind",
892
+ "type": "text",
893
+ "primaryKey": false,
894
+ "notNull": true
895
+ },
896
+ "timeout_at": {
897
+ "name": "timeout_at",
898
+ "type": "timestamp",
899
+ "primaryKey": false,
900
+ "notNull": true
901
+ },
902
+ "resolved_at": {
903
+ "name": "resolved_at",
904
+ "type": "timestamp",
905
+ "primaryKey": false,
906
+ "notNull": false
907
+ },
908
+ "created_at": {
909
+ "name": "created_at",
910
+ "type": "timestamp",
911
+ "primaryKey": false,
912
+ "notNull": true,
913
+ "default": "now()"
914
+ },
915
+ "updated_at": {
916
+ "name": "updated_at",
917
+ "type": "timestamp",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "default": "now()"
921
+ }
922
+ },
923
+ "indexes": {},
924
+ "foreignKeys": {
925
+ "approval_tenant_id_tenant_id_fk": {
926
+ "name": "approval_tenant_id_tenant_id_fk",
927
+ "tableFrom": "approval",
928
+ "tableTo": "tenant",
929
+ "columnsFrom": ["tenant_id"],
930
+ "columnsTo": ["id"],
931
+ "onDelete": "cascade",
932
+ "onUpdate": "no action"
933
+ },
934
+ "approval_instance_id_agent_instance_id_fk": {
935
+ "name": "approval_instance_id_agent_instance_id_fk",
936
+ "tableFrom": "approval",
937
+ "tableTo": "agent_instance",
938
+ "columnsFrom": ["instance_id"],
939
+ "columnsTo": ["id"],
940
+ "onDelete": "cascade",
941
+ "onUpdate": "no action"
942
+ },
943
+ "approval_agent_id_agent_id_fk": {
944
+ "name": "approval_agent_id_agent_id_fk",
945
+ "tableFrom": "approval",
946
+ "tableTo": "agent",
947
+ "columnsFrom": ["agent_id"],
948
+ "columnsTo": ["id"],
949
+ "onDelete": "cascade",
950
+ "onUpdate": "no action"
951
+ },
952
+ "approval_origin_principal_id_principal_id_fk": {
953
+ "name": "approval_origin_principal_id_principal_id_fk",
954
+ "tableFrom": "approval",
955
+ "tableTo": "principal",
956
+ "columnsFrom": ["origin_principal_id"],
957
+ "columnsTo": ["id"],
958
+ "onDelete": "cascade",
959
+ "onUpdate": "no action"
960
+ }
961
+ },
962
+ "compositePrimaryKeys": {},
963
+ "uniqueConstraints": {
964
+ "approval_correlation_id_unique": {
965
+ "name": "approval_correlation_id_unique",
966
+ "nullsNotDistinct": false,
967
+ "columns": ["correlation_id"]
968
+ }
969
+ },
970
+ "policies": {},
971
+ "checkConstraints": {},
972
+ "isRLSEnabled": false
973
+ },
974
+ "public.signal_correlation": {
975
+ "name": "signal_correlation",
976
+ "schema": "",
977
+ "columns": {
978
+ "correlation_id": {
979
+ "name": "correlation_id",
980
+ "type": "text",
981
+ "primaryKey": true,
982
+ "notNull": true
983
+ },
984
+ "tenant_id": {
985
+ "name": "tenant_id",
986
+ "type": "text",
987
+ "primaryKey": false,
988
+ "notNull": true
989
+ },
990
+ "deployment_id": {
991
+ "name": "deployment_id",
992
+ "type": "text",
993
+ "primaryKey": false,
994
+ "notNull": true
995
+ },
996
+ "agent_address": {
997
+ "name": "agent_address",
998
+ "type": "text",
999
+ "primaryKey": false,
1000
+ "notNull": true
1001
+ },
1002
+ "run_id": {
1003
+ "name": "run_id",
1004
+ "type": "text",
1005
+ "primaryKey": false,
1006
+ "notNull": true
1007
+ },
1008
+ "signal_name": {
1009
+ "name": "signal_name",
1010
+ "type": "text",
1011
+ "primaryKey": false,
1012
+ "notNull": true
1013
+ },
1014
+ "kind": {
1015
+ "name": "kind",
1016
+ "type": "text",
1017
+ "primaryKey": false,
1018
+ "notNull": true
1019
+ },
1020
+ "signal_id": {
1021
+ "name": "signal_id",
1022
+ "type": "text",
1023
+ "primaryKey": false,
1024
+ "notNull": false
1025
+ },
1026
+ "resolved_at": {
1027
+ "name": "resolved_at",
1028
+ "type": "timestamp",
1029
+ "primaryKey": false,
1030
+ "notNull": false
1031
+ },
1032
+ "created_at": {
1033
+ "name": "created_at",
1034
+ "type": "timestamp",
1035
+ "primaryKey": false,
1036
+ "notNull": true,
1037
+ "default": "now()"
1038
+ }
1039
+ },
1040
+ "indexes": {},
1041
+ "foreignKeys": {
1042
+ "signal_correlation_tenant_id_tenant_id_fk": {
1043
+ "name": "signal_correlation_tenant_id_tenant_id_fk",
1044
+ "tableFrom": "signal_correlation",
1045
+ "tableTo": "tenant",
1046
+ "columnsFrom": ["tenant_id"],
1047
+ "columnsTo": ["id"],
1048
+ "onDelete": "cascade",
1049
+ "onUpdate": "no action"
1050
+ }
1051
+ },
1052
+ "compositePrimaryKeys": {},
1053
+ "uniqueConstraints": {},
1054
+ "policies": {},
1055
+ "checkConstraints": {},
1056
+ "isRLSEnabled": false
1057
+ },
1058
+ "public.agent": {
1059
+ "name": "agent",
1060
+ "schema": "",
1061
+ "columns": {
1062
+ "id": {
1063
+ "name": "id",
1064
+ "type": "text",
1065
+ "primaryKey": true,
1066
+ "notNull": true
1067
+ },
1068
+ "tenant_id": {
1069
+ "name": "tenant_id",
1070
+ "type": "text",
1071
+ "primaryKey": false,
1072
+ "notNull": true
1073
+ },
1074
+ "creator_principal_id": {
1075
+ "name": "creator_principal_id",
1076
+ "type": "text",
1077
+ "primaryKey": false,
1078
+ "notNull": true
1079
+ },
1080
+ "name": {
1081
+ "name": "name",
1082
+ "type": "text",
1083
+ "primaryKey": false,
1084
+ "notNull": true
1085
+ },
1086
+ "description": {
1087
+ "name": "description",
1088
+ "type": "text",
1089
+ "primaryKey": false,
1090
+ "notNull": false
1091
+ },
1092
+ "system_prompt": {
1093
+ "name": "system_prompt",
1094
+ "type": "text",
1095
+ "primaryKey": false,
1096
+ "notNull": false
1097
+ },
1098
+ "context_config": {
1099
+ "name": "context_config",
1100
+ "type": "jsonb",
1101
+ "primaryKey": false,
1102
+ "notNull": false
1103
+ },
1104
+ "initial_state": {
1105
+ "name": "initial_state",
1106
+ "type": "jsonb",
1107
+ "primaryKey": false,
1108
+ "notNull": false
1109
+ },
1110
+ "model_config": {
1111
+ "name": "model_config",
1112
+ "type": "jsonb",
1113
+ "primaryKey": false,
1114
+ "notNull": false
1115
+ },
1116
+ "capabilities": {
1117
+ "name": "capabilities",
1118
+ "type": "jsonb",
1119
+ "primaryKey": false,
1120
+ "notNull": false
1121
+ },
1122
+ "credential_requirements": {
1123
+ "name": "credential_requirements",
1124
+ "type": "jsonb",
1125
+ "primaryKey": false,
1126
+ "notNull": false
1127
+ },
1128
+ "model_requirements": {
1129
+ "name": "model_requirements",
1130
+ "type": "jsonb",
1131
+ "primaryKey": false,
1132
+ "notNull": false
1133
+ },
1134
+ "tool_packages": {
1135
+ "name": "tool_packages",
1136
+ "type": "jsonb",
1137
+ "primaryKey": false,
1138
+ "notNull": true,
1139
+ "default": "'[]'::jsonb"
1140
+ },
1141
+ "grant_requirements": {
1142
+ "name": "grant_requirements",
1143
+ "type": "jsonb",
1144
+ "primaryKey": false,
1145
+ "notNull": false
1146
+ },
1147
+ "current_version": {
1148
+ "name": "current_version",
1149
+ "type": "text",
1150
+ "primaryKey": false,
1151
+ "notNull": true,
1152
+ "default": "'1'"
1153
+ },
1154
+ "status": {
1155
+ "name": "status",
1156
+ "type": "text",
1157
+ "primaryKey": false,
1158
+ "notNull": true,
1159
+ "default": "'deployed'"
1160
+ },
1161
+ "created_at": {
1162
+ "name": "created_at",
1163
+ "type": "timestamp",
1164
+ "primaryKey": false,
1165
+ "notNull": true,
1166
+ "default": "now()"
1167
+ },
1168
+ "updated_at": {
1169
+ "name": "updated_at",
1170
+ "type": "timestamp",
1171
+ "primaryKey": false,
1172
+ "notNull": true,
1173
+ "default": "now()"
1174
+ }
1175
+ },
1176
+ "indexes": {},
1177
+ "foreignKeys": {
1178
+ "agent_tenant_id_tenant_id_fk": {
1179
+ "name": "agent_tenant_id_tenant_id_fk",
1180
+ "tableFrom": "agent",
1181
+ "tableTo": "tenant",
1182
+ "columnsFrom": ["tenant_id"],
1183
+ "columnsTo": ["id"],
1184
+ "onDelete": "cascade",
1185
+ "onUpdate": "no action"
1186
+ },
1187
+ "agent_creator_principal_id_principal_id_fk": {
1188
+ "name": "agent_creator_principal_id_principal_id_fk",
1189
+ "tableFrom": "agent",
1190
+ "tableTo": "principal",
1191
+ "columnsFrom": ["creator_principal_id"],
1192
+ "columnsTo": ["id"],
1193
+ "onDelete": "no action",
1194
+ "onUpdate": "no action"
1195
+ }
1196
+ },
1197
+ "compositePrimaryKeys": {},
1198
+ "uniqueConstraints": {},
1199
+ "policies": {},
1200
+ "checkConstraints": {},
1201
+ "isRLSEnabled": false
1202
+ },
1203
+ "public.agent_version": {
1204
+ "name": "agent_version",
1205
+ "schema": "",
1206
+ "columns": {
1207
+ "id": {
1208
+ "name": "id",
1209
+ "type": "text",
1210
+ "primaryKey": true,
1211
+ "notNull": true
1212
+ },
1213
+ "agent_id": {
1214
+ "name": "agent_id",
1215
+ "type": "text",
1216
+ "primaryKey": false,
1217
+ "notNull": true
1218
+ },
1219
+ "version": {
1220
+ "name": "version",
1221
+ "type": "text",
1222
+ "primaryKey": false,
1223
+ "notNull": true
1224
+ },
1225
+ "status": {
1226
+ "name": "status",
1227
+ "type": "text",
1228
+ "primaryKey": false,
1229
+ "notNull": true,
1230
+ "default": "'active'"
1231
+ },
1232
+ "created_at": {
1233
+ "name": "created_at",
1234
+ "type": "timestamp",
1235
+ "primaryKey": false,
1236
+ "notNull": true,
1237
+ "default": "now()"
1238
+ }
1239
+ },
1240
+ "indexes": {},
1241
+ "foreignKeys": {
1242
+ "agent_version_agent_id_agent_id_fk": {
1243
+ "name": "agent_version_agent_id_agent_id_fk",
1244
+ "tableFrom": "agent_version",
1245
+ "tableTo": "agent",
1246
+ "columnsFrom": ["agent_id"],
1247
+ "columnsTo": ["id"],
1248
+ "onDelete": "cascade",
1249
+ "onUpdate": "no action"
1250
+ }
1251
+ },
1252
+ "compositePrimaryKeys": {},
1253
+ "uniqueConstraints": {},
1254
+ "policies": {},
1255
+ "checkConstraints": {},
1256
+ "isRLSEnabled": false
1257
+ },
1258
+ "public.provider": {
1259
+ "name": "provider",
1260
+ "schema": "",
1261
+ "columns": {
1262
+ "id": {
1263
+ "name": "id",
1264
+ "type": "text",
1265
+ "primaryKey": true,
1266
+ "notNull": true
1267
+ },
1268
+ "tenant_id": {
1269
+ "name": "tenant_id",
1270
+ "type": "text",
1271
+ "primaryKey": false,
1272
+ "notNull": true
1273
+ },
1274
+ "name": {
1275
+ "name": "name",
1276
+ "type": "text",
1277
+ "primaryKey": false,
1278
+ "notNull": true
1279
+ },
1280
+ "plugin": {
1281
+ "name": "plugin",
1282
+ "type": "text",
1283
+ "primaryKey": false,
1284
+ "notNull": true
1285
+ },
1286
+ "authorization_url": {
1287
+ "name": "authorization_url",
1288
+ "type": "text",
1289
+ "primaryKey": false,
1290
+ "notNull": false
1291
+ },
1292
+ "token_url": {
1293
+ "name": "token_url",
1294
+ "type": "text",
1295
+ "primaryKey": false,
1296
+ "notNull": false
1297
+ },
1298
+ "user_info_url": {
1299
+ "name": "user_info_url",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": false
1303
+ },
1304
+ "scopes": {
1305
+ "name": "scopes",
1306
+ "type": "text[]",
1307
+ "primaryKey": false,
1308
+ "notNull": false
1309
+ },
1310
+ "metadata": {
1311
+ "name": "metadata",
1312
+ "type": "jsonb",
1313
+ "primaryKey": false,
1314
+ "notNull": false
1315
+ },
1316
+ "created_at": {
1317
+ "name": "created_at",
1318
+ "type": "timestamp",
1319
+ "primaryKey": false,
1320
+ "notNull": true,
1321
+ "default": "now()"
1322
+ },
1323
+ "updated_at": {
1324
+ "name": "updated_at",
1325
+ "type": "timestamp",
1326
+ "primaryKey": false,
1327
+ "notNull": true,
1328
+ "default": "now()"
1329
+ }
1330
+ },
1331
+ "indexes": {},
1332
+ "foreignKeys": {
1333
+ "provider_tenant_id_tenant_id_fk": {
1334
+ "name": "provider_tenant_id_tenant_id_fk",
1335
+ "tableFrom": "provider",
1336
+ "tableTo": "tenant",
1337
+ "columnsFrom": ["tenant_id"],
1338
+ "columnsTo": ["id"],
1339
+ "onDelete": "cascade",
1340
+ "onUpdate": "no action"
1341
+ }
1342
+ },
1343
+ "compositePrimaryKeys": {},
1344
+ "uniqueConstraints": {
1345
+ "provider_tenant_name": {
1346
+ "name": "provider_tenant_name",
1347
+ "nullsNotDistinct": false,
1348
+ "columns": ["tenant_id", "name"]
1349
+ }
1350
+ },
1351
+ "policies": {},
1352
+ "checkConstraints": {},
1353
+ "isRLSEnabled": false
1354
+ },
1355
+ "public.oauth_client": {
1356
+ "name": "oauth_client",
1357
+ "schema": "",
1358
+ "columns": {
1359
+ "id": {
1360
+ "name": "id",
1361
+ "type": "text",
1362
+ "primaryKey": true,
1363
+ "notNull": true
1364
+ },
1365
+ "tenant_id": {
1366
+ "name": "tenant_id",
1367
+ "type": "text",
1368
+ "primaryKey": false,
1369
+ "notNull": true
1370
+ },
1371
+ "provider_id": {
1372
+ "name": "provider_id",
1373
+ "type": "text",
1374
+ "primaryKey": false,
1375
+ "notNull": true
1376
+ },
1377
+ "name": {
1378
+ "name": "name",
1379
+ "type": "text",
1380
+ "primaryKey": false,
1381
+ "notNull": true
1382
+ },
1383
+ "client_id": {
1384
+ "name": "client_id",
1385
+ "type": "text",
1386
+ "primaryKey": false,
1387
+ "notNull": true
1388
+ },
1389
+ "client_secret": {
1390
+ "name": "client_secret",
1391
+ "type": "text",
1392
+ "primaryKey": false,
1393
+ "notNull": true
1394
+ },
1395
+ "redirect_uris": {
1396
+ "name": "redirect_uris",
1397
+ "type": "text[]",
1398
+ "primaryKey": false,
1399
+ "notNull": false
1400
+ },
1401
+ "default_scopes": {
1402
+ "name": "default_scopes",
1403
+ "type": "text[]",
1404
+ "primaryKey": false,
1405
+ "notNull": false
1406
+ },
1407
+ "metadata": {
1408
+ "name": "metadata",
1409
+ "type": "jsonb",
1410
+ "primaryKey": false,
1411
+ "notNull": false
1412
+ },
1413
+ "created_at": {
1414
+ "name": "created_at",
1415
+ "type": "timestamp",
1416
+ "primaryKey": false,
1417
+ "notNull": true,
1418
+ "default": "now()"
1419
+ },
1420
+ "updated_at": {
1421
+ "name": "updated_at",
1422
+ "type": "timestamp",
1423
+ "primaryKey": false,
1424
+ "notNull": true,
1425
+ "default": "now()"
1426
+ }
1427
+ },
1428
+ "indexes": {},
1429
+ "foreignKeys": {
1430
+ "oauth_client_tenant_id_tenant_id_fk": {
1431
+ "name": "oauth_client_tenant_id_tenant_id_fk",
1432
+ "tableFrom": "oauth_client",
1433
+ "tableTo": "tenant",
1434
+ "columnsFrom": ["tenant_id"],
1435
+ "columnsTo": ["id"],
1436
+ "onDelete": "cascade",
1437
+ "onUpdate": "no action"
1438
+ },
1439
+ "oauth_client_provider_id_provider_id_fk": {
1440
+ "name": "oauth_client_provider_id_provider_id_fk",
1441
+ "tableFrom": "oauth_client",
1442
+ "tableTo": "provider",
1443
+ "columnsFrom": ["provider_id"],
1444
+ "columnsTo": ["id"],
1445
+ "onDelete": "cascade",
1446
+ "onUpdate": "no action"
1447
+ }
1448
+ },
1449
+ "compositePrimaryKeys": {},
1450
+ "uniqueConstraints": {
1451
+ "oauth_client_tenant_provider": {
1452
+ "name": "oauth_client_tenant_provider",
1453
+ "nullsNotDistinct": false,
1454
+ "columns": ["tenant_id", "provider_id"]
1455
+ }
1456
+ },
1457
+ "policies": {},
1458
+ "checkConstraints": {},
1459
+ "isRLSEnabled": false
1460
+ },
1461
+ "public.credential": {
1462
+ "name": "credential",
1463
+ "schema": "",
1464
+ "columns": {
1465
+ "id": {
1466
+ "name": "id",
1467
+ "type": "text",
1468
+ "primaryKey": true,
1469
+ "notNull": true
1470
+ },
1471
+ "tenant_id": {
1472
+ "name": "tenant_id",
1473
+ "type": "text",
1474
+ "primaryKey": false,
1475
+ "notNull": true
1476
+ },
1477
+ "principal_id": {
1478
+ "name": "principal_id",
1479
+ "type": "text",
1480
+ "primaryKey": false,
1481
+ "notNull": false
1482
+ },
1483
+ "provider_id": {
1484
+ "name": "provider_id",
1485
+ "type": "text",
1486
+ "primaryKey": false,
1487
+ "notNull": true
1488
+ },
1489
+ "oauth_client_id": {
1490
+ "name": "oauth_client_id",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": false
1494
+ },
1495
+ "name": {
1496
+ "name": "name",
1497
+ "type": "text",
1498
+ "primaryKey": false,
1499
+ "notNull": true
1500
+ },
1501
+ "type": {
1502
+ "name": "type",
1503
+ "type": "text",
1504
+ "primaryKey": false,
1505
+ "notNull": true
1506
+ },
1507
+ "description": {
1508
+ "name": "description",
1509
+ "type": "text",
1510
+ "primaryKey": false,
1511
+ "notNull": false
1512
+ },
1513
+ "secret": {
1514
+ "name": "secret",
1515
+ "type": "text",
1516
+ "primaryKey": false,
1517
+ "notNull": true
1518
+ },
1519
+ "refresh_secret": {
1520
+ "name": "refresh_secret",
1521
+ "type": "text",
1522
+ "primaryKey": false,
1523
+ "notNull": false
1524
+ },
1525
+ "scopes": {
1526
+ "name": "scopes",
1527
+ "type": "text[]",
1528
+ "primaryKey": false,
1529
+ "notNull": false
1530
+ },
1531
+ "expires_at": {
1532
+ "name": "expires_at",
1533
+ "type": "timestamp",
1534
+ "primaryKey": false,
1535
+ "notNull": false
1536
+ },
1537
+ "status": {
1538
+ "name": "status",
1539
+ "type": "text",
1540
+ "primaryKey": false,
1541
+ "notNull": true,
1542
+ "default": "'active'"
1543
+ },
1544
+ "metadata": {
1545
+ "name": "metadata",
1546
+ "type": "jsonb",
1547
+ "primaryKey": false,
1548
+ "notNull": false
1549
+ },
1550
+ "created_at": {
1551
+ "name": "created_at",
1552
+ "type": "timestamp",
1553
+ "primaryKey": false,
1554
+ "notNull": true,
1555
+ "default": "now()"
1556
+ },
1557
+ "updated_at": {
1558
+ "name": "updated_at",
1559
+ "type": "timestamp",
1560
+ "primaryKey": false,
1561
+ "notNull": true,
1562
+ "default": "now()"
1563
+ }
1564
+ },
1565
+ "indexes": {},
1566
+ "foreignKeys": {
1567
+ "credential_tenant_id_tenant_id_fk": {
1568
+ "name": "credential_tenant_id_tenant_id_fk",
1569
+ "tableFrom": "credential",
1570
+ "tableTo": "tenant",
1571
+ "columnsFrom": ["tenant_id"],
1572
+ "columnsTo": ["id"],
1573
+ "onDelete": "cascade",
1574
+ "onUpdate": "no action"
1575
+ },
1576
+ "credential_principal_id_principal_id_fk": {
1577
+ "name": "credential_principal_id_principal_id_fk",
1578
+ "tableFrom": "credential",
1579
+ "tableTo": "principal",
1580
+ "columnsFrom": ["principal_id"],
1581
+ "columnsTo": ["id"],
1582
+ "onDelete": "set null",
1583
+ "onUpdate": "no action"
1584
+ },
1585
+ "credential_provider_id_provider_id_fk": {
1586
+ "name": "credential_provider_id_provider_id_fk",
1587
+ "tableFrom": "credential",
1588
+ "tableTo": "provider",
1589
+ "columnsFrom": ["provider_id"],
1590
+ "columnsTo": ["id"],
1591
+ "onDelete": "cascade",
1592
+ "onUpdate": "no action"
1593
+ },
1594
+ "credential_oauth_client_id_oauth_client_id_fk": {
1595
+ "name": "credential_oauth_client_id_oauth_client_id_fk",
1596
+ "tableFrom": "credential",
1597
+ "tableTo": "oauth_client",
1598
+ "columnsFrom": ["oauth_client_id"],
1599
+ "columnsTo": ["id"],
1600
+ "onDelete": "set null",
1601
+ "onUpdate": "no action"
1602
+ }
1603
+ },
1604
+ "compositePrimaryKeys": {},
1605
+ "uniqueConstraints": {
1606
+ "credential_tenant_name": {
1607
+ "name": "credential_tenant_name",
1608
+ "nullsNotDistinct": false,
1609
+ "columns": ["tenant_id", "name"]
1610
+ }
1611
+ },
1612
+ "policies": {},
1613
+ "checkConstraints": {},
1614
+ "isRLSEnabled": false
1615
+ },
1616
+ "public.asset": {
1617
+ "name": "asset",
1618
+ "schema": "",
1619
+ "columns": {
1620
+ "id": {
1621
+ "name": "id",
1622
+ "type": "text",
1623
+ "primaryKey": true,
1624
+ "notNull": true
1625
+ },
1626
+ "tenant_id": {
1627
+ "name": "tenant_id",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": true
1631
+ },
1632
+ "kind": {
1633
+ "name": "kind",
1634
+ "type": "text",
1635
+ "primaryKey": false,
1636
+ "notNull": true
1637
+ },
1638
+ "name": {
1639
+ "name": "name",
1640
+ "type": "text",
1641
+ "primaryKey": false,
1642
+ "notNull": true
1643
+ },
1644
+ "display_name": {
1645
+ "name": "display_name",
1646
+ "type": "text",
1647
+ "primaryKey": false,
1648
+ "notNull": false
1649
+ },
1650
+ "creator_principal_id": {
1651
+ "name": "creator_principal_id",
1652
+ "type": "text",
1653
+ "primaryKey": false,
1654
+ "notNull": false
1655
+ },
1656
+ "created_at": {
1657
+ "name": "created_at",
1658
+ "type": "timestamp",
1659
+ "primaryKey": false,
1660
+ "notNull": true,
1661
+ "default": "now()"
1662
+ },
1663
+ "updated_at": {
1664
+ "name": "updated_at",
1665
+ "type": "timestamp",
1666
+ "primaryKey": false,
1667
+ "notNull": true,
1668
+ "default": "now()"
1669
+ }
1670
+ },
1671
+ "indexes": {},
1672
+ "foreignKeys": {
1673
+ "asset_tenant_id_tenant_id_fk": {
1674
+ "name": "asset_tenant_id_tenant_id_fk",
1675
+ "tableFrom": "asset",
1676
+ "tableTo": "tenant",
1677
+ "columnsFrom": ["tenant_id"],
1678
+ "columnsTo": ["id"],
1679
+ "onDelete": "cascade",
1680
+ "onUpdate": "no action"
1681
+ },
1682
+ "asset_creator_principal_id_principal_id_fk": {
1683
+ "name": "asset_creator_principal_id_principal_id_fk",
1684
+ "tableFrom": "asset",
1685
+ "tableTo": "principal",
1686
+ "columnsFrom": ["creator_principal_id"],
1687
+ "columnsTo": ["id"],
1688
+ "onDelete": "set null",
1689
+ "onUpdate": "no action"
1690
+ }
1691
+ },
1692
+ "compositePrimaryKeys": {},
1693
+ "uniqueConstraints": {
1694
+ "asset_tenant_kind_name": {
1695
+ "name": "asset_tenant_kind_name",
1696
+ "nullsNotDistinct": false,
1697
+ "columns": ["tenant_id", "kind", "name"]
1698
+ }
1699
+ },
1700
+ "policies": {},
1701
+ "checkConstraints": {},
1702
+ "isRLSEnabled": false
1703
+ },
1704
+ "public.agent_asset": {
1705
+ "name": "agent_asset",
1706
+ "schema": "",
1707
+ "columns": {
1708
+ "id": {
1709
+ "name": "id",
1710
+ "type": "text",
1711
+ "primaryKey": true,
1712
+ "notNull": true
1713
+ },
1714
+ "agent_id": {
1715
+ "name": "agent_id",
1716
+ "type": "text",
1717
+ "primaryKey": false,
1718
+ "notNull": true
1719
+ },
1720
+ "asset_id": {
1721
+ "name": "asset_id",
1722
+ "type": "text",
1723
+ "primaryKey": false,
1724
+ "notNull": true
1725
+ },
1726
+ "ref": {
1727
+ "name": "ref",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": true
1731
+ },
1732
+ "access_mode": {
1733
+ "name": "access_mode",
1734
+ "type": "text",
1735
+ "primaryKey": false,
1736
+ "notNull": true,
1737
+ "default": "'read-only'"
1738
+ },
1739
+ "created_at": {
1740
+ "name": "created_at",
1741
+ "type": "timestamp",
1742
+ "primaryKey": false,
1743
+ "notNull": true,
1744
+ "default": "now()"
1745
+ }
1746
+ },
1747
+ "indexes": {},
1748
+ "foreignKeys": {
1749
+ "agent_asset_agent_id_agent_id_fk": {
1750
+ "name": "agent_asset_agent_id_agent_id_fk",
1751
+ "tableFrom": "agent_asset",
1752
+ "tableTo": "agent",
1753
+ "columnsFrom": ["agent_id"],
1754
+ "columnsTo": ["id"],
1755
+ "onDelete": "cascade",
1756
+ "onUpdate": "no action"
1757
+ },
1758
+ "agent_asset_asset_id_asset_id_fk": {
1759
+ "name": "agent_asset_asset_id_asset_id_fk",
1760
+ "tableFrom": "agent_asset",
1761
+ "tableTo": "asset",
1762
+ "columnsFrom": ["asset_id"],
1763
+ "columnsTo": ["id"],
1764
+ "onDelete": "cascade",
1765
+ "onUpdate": "no action"
1766
+ }
1767
+ },
1768
+ "compositePrimaryKeys": {},
1769
+ "uniqueConstraints": {
1770
+ "agent_asset_agent_asset": {
1771
+ "name": "agent_asset_agent_asset",
1772
+ "nullsNotDistinct": false,
1773
+ "columns": ["agent_id", "asset_id"]
1774
+ }
1775
+ },
1776
+ "policies": {},
1777
+ "checkConstraints": {},
1778
+ "isRLSEnabled": false
1779
+ },
1780
+ "public.transaction": {
1781
+ "name": "transaction",
1782
+ "schema": "",
1783
+ "columns": {
1784
+ "id": {
1785
+ "name": "id",
1786
+ "type": "text",
1787
+ "primaryKey": true,
1788
+ "notNull": true
1789
+ },
1790
+ "wallet_id": {
1791
+ "name": "wallet_id",
1792
+ "type": "text",
1793
+ "primaryKey": false,
1794
+ "notNull": true
1795
+ },
1796
+ "agent_id": {
1797
+ "name": "agent_id",
1798
+ "type": "text",
1799
+ "primaryKey": false,
1800
+ "notNull": false
1801
+ },
1802
+ "direction": {
1803
+ "name": "direction",
1804
+ "type": "text",
1805
+ "primaryKey": false,
1806
+ "notNull": true
1807
+ },
1808
+ "amount": {
1809
+ "name": "amount",
1810
+ "type": "text",
1811
+ "primaryKey": false,
1812
+ "notNull": true
1813
+ },
1814
+ "currency": {
1815
+ "name": "currency",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": true
1819
+ },
1820
+ "recipient_id": {
1821
+ "name": "recipient_id",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": false
1825
+ },
1826
+ "sender_id": {
1827
+ "name": "sender_id",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": false
1831
+ },
1832
+ "request_id": {
1833
+ "name": "request_id",
1834
+ "type": "text",
1835
+ "primaryKey": false,
1836
+ "notNull": false
1837
+ },
1838
+ "status": {
1839
+ "name": "status",
1840
+ "type": "text",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "default": "'pending'"
1844
+ },
1845
+ "created_at": {
1846
+ "name": "created_at",
1847
+ "type": "timestamp",
1848
+ "primaryKey": false,
1849
+ "notNull": true,
1850
+ "default": "now()"
1851
+ }
1852
+ },
1853
+ "indexes": {},
1854
+ "foreignKeys": {
1855
+ "transaction_wallet_id_wallet_id_fk": {
1856
+ "name": "transaction_wallet_id_wallet_id_fk",
1857
+ "tableFrom": "transaction",
1858
+ "tableTo": "wallet",
1859
+ "columnsFrom": ["wallet_id"],
1860
+ "columnsTo": ["id"],
1861
+ "onDelete": "cascade",
1862
+ "onUpdate": "no action"
1863
+ },
1864
+ "transaction_agent_id_agent_id_fk": {
1865
+ "name": "transaction_agent_id_agent_id_fk",
1866
+ "tableFrom": "transaction",
1867
+ "tableTo": "agent",
1868
+ "columnsFrom": ["agent_id"],
1869
+ "columnsTo": ["id"],
1870
+ "onDelete": "set null",
1871
+ "onUpdate": "no action"
1872
+ }
1873
+ },
1874
+ "compositePrimaryKeys": {},
1875
+ "uniqueConstraints": {},
1876
+ "policies": {},
1877
+ "checkConstraints": {},
1878
+ "isRLSEnabled": false
1879
+ },
1880
+ "public.wallet": {
1881
+ "name": "wallet",
1882
+ "schema": "",
1883
+ "columns": {
1884
+ "id": {
1885
+ "name": "id",
1886
+ "type": "text",
1887
+ "primaryKey": true,
1888
+ "notNull": true
1889
+ },
1890
+ "tenant_id": {
1891
+ "name": "tenant_id",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": true
1895
+ },
1896
+ "name": {
1897
+ "name": "name",
1898
+ "type": "text",
1899
+ "primaryKey": false,
1900
+ "notNull": true
1901
+ },
1902
+ "backend_type": {
1903
+ "name": "backend_type",
1904
+ "type": "text",
1905
+ "primaryKey": false,
1906
+ "notNull": true
1907
+ },
1908
+ "currency": {
1909
+ "name": "currency",
1910
+ "type": "text",
1911
+ "primaryKey": false,
1912
+ "notNull": true
1913
+ },
1914
+ "balance": {
1915
+ "name": "balance",
1916
+ "type": "text",
1917
+ "primaryKey": false,
1918
+ "notNull": true,
1919
+ "default": "'0'"
1920
+ },
1921
+ "config": {
1922
+ "name": "config",
1923
+ "type": "jsonb",
1924
+ "primaryKey": false,
1925
+ "notNull": false
1926
+ },
1927
+ "created_at": {
1928
+ "name": "created_at",
1929
+ "type": "timestamp",
1930
+ "primaryKey": false,
1931
+ "notNull": true,
1932
+ "default": "now()"
1933
+ },
1934
+ "updated_at": {
1935
+ "name": "updated_at",
1936
+ "type": "timestamp",
1937
+ "primaryKey": false,
1938
+ "notNull": true,
1939
+ "default": "now()"
1940
+ }
1941
+ },
1942
+ "indexes": {},
1943
+ "foreignKeys": {
1944
+ "wallet_tenant_id_tenant_id_fk": {
1945
+ "name": "wallet_tenant_id_tenant_id_fk",
1946
+ "tableFrom": "wallet",
1947
+ "tableTo": "tenant",
1948
+ "columnsFrom": ["tenant_id"],
1949
+ "columnsTo": ["id"],
1950
+ "onDelete": "cascade",
1951
+ "onUpdate": "no action"
1952
+ }
1953
+ },
1954
+ "compositePrimaryKeys": {},
1955
+ "uniqueConstraints": {},
1956
+ "policies": {},
1957
+ "checkConstraints": {},
1958
+ "isRLSEnabled": false
1959
+ },
1960
+ "public.offering": {
1961
+ "name": "offering",
1962
+ "schema": "",
1963
+ "columns": {
1964
+ "id": {
1965
+ "name": "id",
1966
+ "type": "text",
1967
+ "primaryKey": true,
1968
+ "notNull": true
1969
+ },
1970
+ "agent_id": {
1971
+ "name": "agent_id",
1972
+ "type": "text",
1973
+ "primaryKey": false,
1974
+ "notNull": true
1975
+ },
1976
+ "tenant_id": {
1977
+ "name": "tenant_id",
1978
+ "type": "text",
1979
+ "primaryKey": false,
1980
+ "notNull": true
1981
+ },
1982
+ "name": {
1983
+ "name": "name",
1984
+ "type": "text",
1985
+ "primaryKey": false,
1986
+ "notNull": true
1987
+ },
1988
+ "description": {
1989
+ "name": "description",
1990
+ "type": "text",
1991
+ "primaryKey": false,
1992
+ "notNull": false
1993
+ },
1994
+ "pricing": {
1995
+ "name": "pricing",
1996
+ "type": "jsonb",
1997
+ "primaryKey": false,
1998
+ "notNull": false
1999
+ },
2000
+ "schema": {
2001
+ "name": "schema",
2002
+ "type": "jsonb",
2003
+ "primaryKey": false,
2004
+ "notNull": false
2005
+ },
2006
+ "created_at": {
2007
+ "name": "created_at",
2008
+ "type": "timestamp",
2009
+ "primaryKey": false,
2010
+ "notNull": true,
2011
+ "default": "now()"
2012
+ },
2013
+ "updated_at": {
2014
+ "name": "updated_at",
2015
+ "type": "timestamp",
2016
+ "primaryKey": false,
2017
+ "notNull": true,
2018
+ "default": "now()"
2019
+ }
2020
+ },
2021
+ "indexes": {},
2022
+ "foreignKeys": {
2023
+ "offering_agent_id_agent_id_fk": {
2024
+ "name": "offering_agent_id_agent_id_fk",
2025
+ "tableFrom": "offering",
2026
+ "tableTo": "agent",
2027
+ "columnsFrom": ["agent_id"],
2028
+ "columnsTo": ["id"],
2029
+ "onDelete": "cascade",
2030
+ "onUpdate": "no action"
2031
+ },
2032
+ "offering_tenant_id_tenant_id_fk": {
2033
+ "name": "offering_tenant_id_tenant_id_fk",
2034
+ "tableFrom": "offering",
2035
+ "tableTo": "tenant",
2036
+ "columnsFrom": ["tenant_id"],
2037
+ "columnsTo": ["id"],
2038
+ "onDelete": "cascade",
2039
+ "onUpdate": "no action"
2040
+ }
2041
+ },
2042
+ "compositePrimaryKeys": {},
2043
+ "uniqueConstraints": {},
2044
+ "policies": {},
2045
+ "checkConstraints": {},
2046
+ "isRLSEnabled": false
2047
+ },
2048
+ "public.model": {
2049
+ "name": "model",
2050
+ "schema": "",
2051
+ "columns": {
2052
+ "id": {
2053
+ "name": "id",
2054
+ "type": "text",
2055
+ "primaryKey": true,
2056
+ "notNull": true
2057
+ },
2058
+ "tenant_id": {
2059
+ "name": "tenant_id",
2060
+ "type": "text",
2061
+ "primaryKey": false,
2062
+ "notNull": true
2063
+ },
2064
+ "canonical_name": {
2065
+ "name": "canonical_name",
2066
+ "type": "text",
2067
+ "primaryKey": false,
2068
+ "notNull": true
2069
+ },
2070
+ "display_name": {
2071
+ "name": "display_name",
2072
+ "type": "text",
2073
+ "primaryKey": false,
2074
+ "notNull": false
2075
+ },
2076
+ "description": {
2077
+ "name": "description",
2078
+ "type": "text",
2079
+ "primaryKey": false,
2080
+ "notNull": false
2081
+ },
2082
+ "disabled": {
2083
+ "name": "disabled",
2084
+ "type": "boolean",
2085
+ "primaryKey": false,
2086
+ "notNull": true,
2087
+ "default": false
2088
+ },
2089
+ "created_at": {
2090
+ "name": "created_at",
2091
+ "type": "timestamp",
2092
+ "primaryKey": false,
2093
+ "notNull": true,
2094
+ "default": "now()"
2095
+ },
2096
+ "updated_at": {
2097
+ "name": "updated_at",
2098
+ "type": "timestamp",
2099
+ "primaryKey": false,
2100
+ "notNull": true,
2101
+ "default": "now()"
2102
+ }
2103
+ },
2104
+ "indexes": {},
2105
+ "foreignKeys": {
2106
+ "model_tenant_id_tenant_id_fk": {
2107
+ "name": "model_tenant_id_tenant_id_fk",
2108
+ "tableFrom": "model",
2109
+ "tableTo": "tenant",
2110
+ "columnsFrom": ["tenant_id"],
2111
+ "columnsTo": ["id"],
2112
+ "onDelete": "cascade",
2113
+ "onUpdate": "no action"
2114
+ }
2115
+ },
2116
+ "compositePrimaryKeys": {},
2117
+ "uniqueConstraints": {
2118
+ "model_tenant_canonical_name": {
2119
+ "name": "model_tenant_canonical_name",
2120
+ "nullsNotDistinct": false,
2121
+ "columns": ["tenant_id", "canonical_name"]
2122
+ }
2123
+ },
2124
+ "policies": {},
2125
+ "checkConstraints": {},
2126
+ "isRLSEnabled": false
2127
+ },
2128
+ "public.model_offering": {
2129
+ "name": "model_offering",
2130
+ "schema": "",
2131
+ "columns": {
2132
+ "id": {
2133
+ "name": "id",
2134
+ "type": "text",
2135
+ "primaryKey": true,
2136
+ "notNull": true
2137
+ },
2138
+ "tenant_id": {
2139
+ "name": "tenant_id",
2140
+ "type": "text",
2141
+ "primaryKey": false,
2142
+ "notNull": true
2143
+ },
2144
+ "model_id": {
2145
+ "name": "model_id",
2146
+ "type": "text",
2147
+ "primaryKey": false,
2148
+ "notNull": true
2149
+ },
2150
+ "provider_id": {
2151
+ "name": "provider_id",
2152
+ "type": "text",
2153
+ "primaryKey": false,
2154
+ "notNull": true
2155
+ },
2156
+ "priority": {
2157
+ "name": "priority",
2158
+ "type": "integer",
2159
+ "primaryKey": false,
2160
+ "notNull": true
2161
+ },
2162
+ "deployment_tags": {
2163
+ "name": "deployment_tags",
2164
+ "type": "text[]",
2165
+ "primaryKey": false,
2166
+ "notNull": true,
2167
+ "default": "'{}'"
2168
+ },
2169
+ "capabilities": {
2170
+ "name": "capabilities",
2171
+ "type": "text[]",
2172
+ "primaryKey": false,
2173
+ "notNull": true,
2174
+ "default": "'{}'"
2175
+ },
2176
+ "disabled": {
2177
+ "name": "disabled",
2178
+ "type": "boolean",
2179
+ "primaryKey": false,
2180
+ "notNull": true,
2181
+ "default": false
2182
+ },
2183
+ "created_at": {
2184
+ "name": "created_at",
2185
+ "type": "timestamp",
2186
+ "primaryKey": false,
2187
+ "notNull": true,
2188
+ "default": "now()"
2189
+ },
2190
+ "updated_at": {
2191
+ "name": "updated_at",
2192
+ "type": "timestamp",
2193
+ "primaryKey": false,
2194
+ "notNull": true,
2195
+ "default": "now()"
2196
+ }
2197
+ },
2198
+ "indexes": {},
2199
+ "foreignKeys": {
2200
+ "model_offering_tenant_id_tenant_id_fk": {
2201
+ "name": "model_offering_tenant_id_tenant_id_fk",
2202
+ "tableFrom": "model_offering",
2203
+ "tableTo": "tenant",
2204
+ "columnsFrom": ["tenant_id"],
2205
+ "columnsTo": ["id"],
2206
+ "onDelete": "cascade",
2207
+ "onUpdate": "no action"
2208
+ },
2209
+ "model_offering_model_id_model_id_fk": {
2210
+ "name": "model_offering_model_id_model_id_fk",
2211
+ "tableFrom": "model_offering",
2212
+ "tableTo": "model",
2213
+ "columnsFrom": ["model_id"],
2214
+ "columnsTo": ["id"],
2215
+ "onDelete": "cascade",
2216
+ "onUpdate": "no action"
2217
+ },
2218
+ "model_offering_provider_id_model_provider_id_fk": {
2219
+ "name": "model_offering_provider_id_model_provider_id_fk",
2220
+ "tableFrom": "model_offering",
2221
+ "tableTo": "model_provider",
2222
+ "columnsFrom": ["provider_id"],
2223
+ "columnsTo": ["id"],
2224
+ "onDelete": "cascade",
2225
+ "onUpdate": "no action"
2226
+ }
2227
+ },
2228
+ "compositePrimaryKeys": {},
2229
+ "uniqueConstraints": {
2230
+ "model_offering_tenant_model_provider": {
2231
+ "name": "model_offering_tenant_model_provider",
2232
+ "nullsNotDistinct": false,
2233
+ "columns": ["tenant_id", "model_id", "provider_id"]
2234
+ }
2235
+ },
2236
+ "policies": {},
2237
+ "checkConstraints": {},
2238
+ "isRLSEnabled": false
2239
+ },
2240
+ "public.model_pricing": {
2241
+ "name": "model_pricing",
2242
+ "schema": "",
2243
+ "columns": {
2244
+ "id": {
2245
+ "name": "id",
2246
+ "type": "text",
2247
+ "primaryKey": true,
2248
+ "notNull": true
2249
+ },
2250
+ "tenant_id": {
2251
+ "name": "tenant_id",
2252
+ "type": "text",
2253
+ "primaryKey": false,
2254
+ "notNull": true
2255
+ },
2256
+ "offering_id": {
2257
+ "name": "offering_id",
2258
+ "type": "text",
2259
+ "primaryKey": false,
2260
+ "notNull": true
2261
+ },
2262
+ "currency": {
2263
+ "name": "currency",
2264
+ "type": "text",
2265
+ "primaryKey": false,
2266
+ "notNull": true
2267
+ },
2268
+ "input_token_price": {
2269
+ "name": "input_token_price",
2270
+ "type": "text",
2271
+ "primaryKey": false,
2272
+ "notNull": false
2273
+ },
2274
+ "output_token_price": {
2275
+ "name": "output_token_price",
2276
+ "type": "text",
2277
+ "primaryKey": false,
2278
+ "notNull": false
2279
+ },
2280
+ "cache_read_token_price": {
2281
+ "name": "cache_read_token_price",
2282
+ "type": "text",
2283
+ "primaryKey": false,
2284
+ "notNull": false
2285
+ },
2286
+ "cache_write_token_price": {
2287
+ "name": "cache_write_token_price",
2288
+ "type": "text",
2289
+ "primaryKey": false,
2290
+ "notNull": false
2291
+ },
2292
+ "thinking_token_price": {
2293
+ "name": "thinking_token_price",
2294
+ "type": "text",
2295
+ "primaryKey": false,
2296
+ "notNull": false
2297
+ },
2298
+ "per_request_fee": {
2299
+ "name": "per_request_fee",
2300
+ "type": "text",
2301
+ "primaryKey": false,
2302
+ "notNull": false
2303
+ },
2304
+ "per_image_fee": {
2305
+ "name": "per_image_fee",
2306
+ "type": "text",
2307
+ "primaryKey": false,
2308
+ "notNull": false
2309
+ },
2310
+ "per_audio_fee": {
2311
+ "name": "per_audio_fee",
2312
+ "type": "text",
2313
+ "primaryKey": false,
2314
+ "notNull": false
2315
+ },
2316
+ "effective_from": {
2317
+ "name": "effective_from",
2318
+ "type": "timestamp with time zone",
2319
+ "primaryKey": false,
2320
+ "notNull": true
2321
+ },
2322
+ "created_at": {
2323
+ "name": "created_at",
2324
+ "type": "timestamp with time zone",
2325
+ "primaryKey": false,
2326
+ "notNull": true,
2327
+ "default": "now()"
2328
+ }
2329
+ },
2330
+ "indexes": {},
2331
+ "foreignKeys": {
2332
+ "model_pricing_tenant_id_tenant_id_fk": {
2333
+ "name": "model_pricing_tenant_id_tenant_id_fk",
2334
+ "tableFrom": "model_pricing",
2335
+ "tableTo": "tenant",
2336
+ "columnsFrom": ["tenant_id"],
2337
+ "columnsTo": ["id"],
2338
+ "onDelete": "cascade",
2339
+ "onUpdate": "no action"
2340
+ },
2341
+ "model_pricing_offering_id_model_offering_id_fk": {
2342
+ "name": "model_pricing_offering_id_model_offering_id_fk",
2343
+ "tableFrom": "model_pricing",
2344
+ "tableTo": "model_offering",
2345
+ "columnsFrom": ["offering_id"],
2346
+ "columnsTo": ["id"],
2347
+ "onDelete": "cascade",
2348
+ "onUpdate": "no action"
2349
+ }
2350
+ },
2351
+ "compositePrimaryKeys": {},
2352
+ "uniqueConstraints": {
2353
+ "model_pricing_offering_currency_effective_from": {
2354
+ "name": "model_pricing_offering_currency_effective_from",
2355
+ "nullsNotDistinct": false,
2356
+ "columns": ["offering_id", "currency", "effective_from"]
2357
+ }
2358
+ },
2359
+ "policies": {},
2360
+ "checkConstraints": {},
2361
+ "isRLSEnabled": false
2362
+ },
2363
+ "public.model_provider": {
2364
+ "name": "model_provider",
2365
+ "schema": "",
2366
+ "columns": {
2367
+ "id": {
2368
+ "name": "id",
2369
+ "type": "text",
2370
+ "primaryKey": true,
2371
+ "notNull": true
2372
+ },
2373
+ "tenant_id": {
2374
+ "name": "tenant_id",
2375
+ "type": "text",
2376
+ "primaryKey": false,
2377
+ "notNull": true
2378
+ },
2379
+ "name": {
2380
+ "name": "name",
2381
+ "type": "text",
2382
+ "primaryKey": false,
2383
+ "notNull": true
2384
+ },
2385
+ "plugin": {
2386
+ "name": "plugin",
2387
+ "type": "text",
2388
+ "primaryKey": false,
2389
+ "notNull": true
2390
+ },
2391
+ "base_url": {
2392
+ "name": "base_url",
2393
+ "type": "text",
2394
+ "primaryKey": false,
2395
+ "notNull": true
2396
+ },
2397
+ "credential_id": {
2398
+ "name": "credential_id",
2399
+ "type": "text",
2400
+ "primaryKey": false,
2401
+ "notNull": false
2402
+ },
2403
+ "wallet_id": {
2404
+ "name": "wallet_id",
2405
+ "type": "text",
2406
+ "primaryKey": false,
2407
+ "notNull": false
2408
+ },
2409
+ "disabled": {
2410
+ "name": "disabled",
2411
+ "type": "boolean",
2412
+ "primaryKey": false,
2413
+ "notNull": true,
2414
+ "default": false
2415
+ },
2416
+ "created_at": {
2417
+ "name": "created_at",
2418
+ "type": "timestamp",
2419
+ "primaryKey": false,
2420
+ "notNull": true,
2421
+ "default": "now()"
2422
+ },
2423
+ "updated_at": {
2424
+ "name": "updated_at",
2425
+ "type": "timestamp",
2426
+ "primaryKey": false,
2427
+ "notNull": true,
2428
+ "default": "now()"
2429
+ }
2430
+ },
2431
+ "indexes": {},
2432
+ "foreignKeys": {
2433
+ "model_provider_tenant_id_tenant_id_fk": {
2434
+ "name": "model_provider_tenant_id_tenant_id_fk",
2435
+ "tableFrom": "model_provider",
2436
+ "tableTo": "tenant",
2437
+ "columnsFrom": ["tenant_id"],
2438
+ "columnsTo": ["id"],
2439
+ "onDelete": "cascade",
2440
+ "onUpdate": "no action"
2441
+ },
2442
+ "model_provider_credential_id_credential_id_fk": {
2443
+ "name": "model_provider_credential_id_credential_id_fk",
2444
+ "tableFrom": "model_provider",
2445
+ "tableTo": "credential",
2446
+ "columnsFrom": ["credential_id"],
2447
+ "columnsTo": ["id"],
2448
+ "onDelete": "restrict",
2449
+ "onUpdate": "no action"
2450
+ },
2451
+ "model_provider_wallet_id_wallet_id_fk": {
2452
+ "name": "model_provider_wallet_id_wallet_id_fk",
2453
+ "tableFrom": "model_provider",
2454
+ "tableTo": "wallet",
2455
+ "columnsFrom": ["wallet_id"],
2456
+ "columnsTo": ["id"],
2457
+ "onDelete": "restrict",
2458
+ "onUpdate": "no action"
2459
+ }
2460
+ },
2461
+ "compositePrimaryKeys": {},
2462
+ "uniqueConstraints": {
2463
+ "model_provider_tenant_name": {
2464
+ "name": "model_provider_tenant_name",
2465
+ "nullsNotDistinct": false,
2466
+ "columns": ["tenant_id", "name"]
2467
+ }
2468
+ },
2469
+ "policies": {},
2470
+ "checkConstraints": {
2471
+ "model_provider_auth_xor": {
2472
+ "name": "model_provider_auth_xor",
2473
+ "value": "(\"model_provider\".\"credential_id\" is not null) <> (\"model_provider\".\"wallet_id\" is not null)"
2474
+ }
2475
+ },
2476
+ "isRLSEnabled": false
2477
+ },
2478
+ "public.sidecar": {
2479
+ "name": "sidecar",
2480
+ "schema": "",
2481
+ "columns": {
2482
+ "id": {
2483
+ "name": "id",
2484
+ "type": "text",
2485
+ "primaryKey": true,
2486
+ "notNull": true
2487
+ },
2488
+ "url": {
2489
+ "name": "url",
2490
+ "type": "text",
2491
+ "primaryKey": false,
2492
+ "notNull": true
2493
+ },
2494
+ "token_hash_sha256": {
2495
+ "name": "token_hash_sha256",
2496
+ "type": "bytea",
2497
+ "primaryKey": false,
2498
+ "notNull": true
2499
+ },
2500
+ "status": {
2501
+ "name": "status",
2502
+ "type": "text",
2503
+ "primaryKey": false,
2504
+ "notNull": true,
2505
+ "default": "'online'"
2506
+ },
2507
+ "last_heartbeat": {
2508
+ "name": "last_heartbeat",
2509
+ "type": "timestamp",
2510
+ "primaryKey": false,
2511
+ "notNull": false
2512
+ },
2513
+ "created_at": {
2514
+ "name": "created_at",
2515
+ "type": "timestamp",
2516
+ "primaryKey": false,
2517
+ "notNull": true,
2518
+ "default": "now()"
2519
+ },
2520
+ "updated_at": {
2521
+ "name": "updated_at",
2522
+ "type": "timestamp",
2523
+ "primaryKey": false,
2524
+ "notNull": true,
2525
+ "default": "now()"
2526
+ }
2527
+ },
2528
+ "indexes": {},
2529
+ "foreignKeys": {},
2530
+ "compositePrimaryKeys": {},
2531
+ "uniqueConstraints": {
2532
+ "sidecar_token_hash_sha256_unique": {
2533
+ "name": "sidecar_token_hash_sha256_unique",
2534
+ "nullsNotDistinct": false,
2535
+ "columns": ["token_hash_sha256"]
2536
+ }
2537
+ },
2538
+ "policies": {},
2539
+ "checkConstraints": {},
2540
+ "isRLSEnabled": false
2541
+ },
2542
+ "public.agent_session": {
2543
+ "name": "agent_session",
2544
+ "schema": "",
2545
+ "columns": {
2546
+ "id": {
2547
+ "name": "id",
2548
+ "type": "text",
2549
+ "primaryKey": true,
2550
+ "notNull": true
2551
+ },
2552
+ "tenant_id": {
2553
+ "name": "tenant_id",
2554
+ "type": "text",
2555
+ "primaryKey": false,
2556
+ "notNull": true
2557
+ },
2558
+ "agent_id": {
2559
+ "name": "agent_id",
2560
+ "type": "text",
2561
+ "primaryKey": false,
2562
+ "notNull": true
2563
+ },
2564
+ "principal_id": {
2565
+ "name": "principal_id",
2566
+ "type": "text",
2567
+ "primaryKey": false,
2568
+ "notNull": true
2569
+ },
2570
+ "status": {
2571
+ "name": "status",
2572
+ "type": "text",
2573
+ "primaryKey": false,
2574
+ "notNull": true,
2575
+ "default": "'active'"
2576
+ },
2577
+ "created_at": {
2578
+ "name": "created_at",
2579
+ "type": "timestamp",
2580
+ "primaryKey": false,
2581
+ "notNull": true,
2582
+ "default": "now()"
2583
+ },
2584
+ "updated_at": {
2585
+ "name": "updated_at",
2586
+ "type": "timestamp",
2587
+ "primaryKey": false,
2588
+ "notNull": true,
2589
+ "default": "now()"
2590
+ },
2591
+ "ended_at": {
2592
+ "name": "ended_at",
2593
+ "type": "timestamp",
2594
+ "primaryKey": false,
2595
+ "notNull": false
2596
+ }
2597
+ },
2598
+ "indexes": {},
2599
+ "foreignKeys": {
2600
+ "agent_session_tenant_id_tenant_id_fk": {
2601
+ "name": "agent_session_tenant_id_tenant_id_fk",
2602
+ "tableFrom": "agent_session",
2603
+ "tableTo": "tenant",
2604
+ "columnsFrom": ["tenant_id"],
2605
+ "columnsTo": ["id"],
2606
+ "onDelete": "cascade",
2607
+ "onUpdate": "no action"
2608
+ },
2609
+ "agent_session_agent_id_agent_id_fk": {
2610
+ "name": "agent_session_agent_id_agent_id_fk",
2611
+ "tableFrom": "agent_session",
2612
+ "tableTo": "agent",
2613
+ "columnsFrom": ["agent_id"],
2614
+ "columnsTo": ["id"],
2615
+ "onDelete": "cascade",
2616
+ "onUpdate": "no action"
2617
+ },
2618
+ "agent_session_principal_id_principal_id_fk": {
2619
+ "name": "agent_session_principal_id_principal_id_fk",
2620
+ "tableFrom": "agent_session",
2621
+ "tableTo": "principal",
2622
+ "columnsFrom": ["principal_id"],
2623
+ "columnsTo": ["id"],
2624
+ "onDelete": "no action",
2625
+ "onUpdate": "no action"
2626
+ }
2627
+ },
2628
+ "compositePrimaryKeys": {},
2629
+ "uniqueConstraints": {},
2630
+ "policies": {},
2631
+ "checkConstraints": {},
2632
+ "isRLSEnabled": false
2633
+ },
2634
+ "public.agent_instance": {
2635
+ "name": "agent_instance",
2636
+ "schema": "",
2637
+ "columns": {
2638
+ "id": {
2639
+ "name": "id",
2640
+ "type": "text",
2641
+ "primaryKey": true,
2642
+ "notNull": true
2643
+ },
2644
+ "agent_id": {
2645
+ "name": "agent_id",
2646
+ "type": "text",
2647
+ "primaryKey": false,
2648
+ "notNull": true
2649
+ },
2650
+ "tenant_id": {
2651
+ "name": "tenant_id",
2652
+ "type": "text",
2653
+ "primaryKey": false,
2654
+ "notNull": true
2655
+ },
2656
+ "principal_id": {
2657
+ "name": "principal_id",
2658
+ "type": "text",
2659
+ "primaryKey": false,
2660
+ "notNull": true
2661
+ },
2662
+ "address": {
2663
+ "name": "address",
2664
+ "type": "text",
2665
+ "primaryKey": false,
2666
+ "notNull": true
2667
+ },
2668
+ "version_id": {
2669
+ "name": "version_id",
2670
+ "type": "text",
2671
+ "primaryKey": false,
2672
+ "notNull": false
2673
+ },
2674
+ "session_id": {
2675
+ "name": "session_id",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": false
2679
+ },
2680
+ "status": {
2681
+ "name": "status",
2682
+ "type": "text",
2683
+ "primaryKey": false,
2684
+ "notNull": true,
2685
+ "default": "'deployed'"
2686
+ },
2687
+ "sidecar_id": {
2688
+ "name": "sidecar_id",
2689
+ "type": "text",
2690
+ "primaryKey": false,
2691
+ "notNull": false
2692
+ },
2693
+ "public_key": {
2694
+ "name": "public_key",
2695
+ "type": "text",
2696
+ "primaryKey": false,
2697
+ "notNull": false
2698
+ },
2699
+ "kernel_id": {
2700
+ "name": "kernel_id",
2701
+ "type": "text",
2702
+ "primaryKey": false,
2703
+ "notNull": false
2704
+ },
2705
+ "model_preferences": {
2706
+ "name": "model_preferences",
2707
+ "type": "jsonb",
2708
+ "primaryKey": false,
2709
+ "notNull": false
2710
+ },
2711
+ "created_at": {
2712
+ "name": "created_at",
2713
+ "type": "timestamp",
2714
+ "primaryKey": false,
2715
+ "notNull": true,
2716
+ "default": "now()"
2717
+ },
2718
+ "updated_at": {
2719
+ "name": "updated_at",
2720
+ "type": "timestamp",
2721
+ "primaryKey": false,
2722
+ "notNull": true,
2723
+ "default": "now()"
2724
+ },
2725
+ "ended_at": {
2726
+ "name": "ended_at",
2727
+ "type": "timestamp",
2728
+ "primaryKey": false,
2729
+ "notNull": false
2730
+ }
2731
+ },
2732
+ "indexes": {},
2733
+ "foreignKeys": {
2734
+ "agent_instance_agent_id_agent_id_fk": {
2735
+ "name": "agent_instance_agent_id_agent_id_fk",
2736
+ "tableFrom": "agent_instance",
2737
+ "tableTo": "agent",
2738
+ "columnsFrom": ["agent_id"],
2739
+ "columnsTo": ["id"],
2740
+ "onDelete": "cascade",
2741
+ "onUpdate": "no action"
2742
+ },
2743
+ "agent_instance_tenant_id_tenant_id_fk": {
2744
+ "name": "agent_instance_tenant_id_tenant_id_fk",
2745
+ "tableFrom": "agent_instance",
2746
+ "tableTo": "tenant",
2747
+ "columnsFrom": ["tenant_id"],
2748
+ "columnsTo": ["id"],
2749
+ "onDelete": "cascade",
2750
+ "onUpdate": "no action"
2751
+ },
2752
+ "agent_instance_principal_id_principal_id_fk": {
2753
+ "name": "agent_instance_principal_id_principal_id_fk",
2754
+ "tableFrom": "agent_instance",
2755
+ "tableTo": "principal",
2756
+ "columnsFrom": ["principal_id"],
2757
+ "columnsTo": ["id"],
2758
+ "onDelete": "no action",
2759
+ "onUpdate": "no action"
2760
+ },
2761
+ "agent_instance_version_id_agent_version_id_fk": {
2762
+ "name": "agent_instance_version_id_agent_version_id_fk",
2763
+ "tableFrom": "agent_instance",
2764
+ "tableTo": "agent_version",
2765
+ "columnsFrom": ["version_id"],
2766
+ "columnsTo": ["id"],
2767
+ "onDelete": "no action",
2768
+ "onUpdate": "no action"
2769
+ },
2770
+ "agent_instance_session_id_agent_session_id_fk": {
2771
+ "name": "agent_instance_session_id_agent_session_id_fk",
2772
+ "tableFrom": "agent_instance",
2773
+ "tableTo": "agent_session",
2774
+ "columnsFrom": ["session_id"],
2775
+ "columnsTo": ["id"],
2776
+ "onDelete": "no action",
2777
+ "onUpdate": "no action"
2778
+ },
2779
+ "agent_instance_sidecar_id_sidecar_id_fk": {
2780
+ "name": "agent_instance_sidecar_id_sidecar_id_fk",
2781
+ "tableFrom": "agent_instance",
2782
+ "tableTo": "sidecar",
2783
+ "columnsFrom": ["sidecar_id"],
2784
+ "columnsTo": ["id"],
2785
+ "onDelete": "set null",
2786
+ "onUpdate": "no action"
2787
+ }
2788
+ },
2789
+ "compositePrimaryKeys": {},
2790
+ "uniqueConstraints": {
2791
+ "agent_instance_address_unique": {
2792
+ "name": "agent_instance_address_unique",
2793
+ "nullsNotDistinct": false,
2794
+ "columns": ["address"]
2795
+ }
2796
+ },
2797
+ "policies": {},
2798
+ "checkConstraints": {},
2799
+ "isRLSEnabled": false
2800
+ },
2801
+ "public.session_asset": {
2802
+ "name": "session_asset",
2803
+ "schema": "",
2804
+ "columns": {
2805
+ "instance_id": {
2806
+ "name": "instance_id",
2807
+ "type": "text",
2808
+ "primaryKey": false,
2809
+ "notNull": true
2810
+ },
2811
+ "agent_asset_id": {
2812
+ "name": "agent_asset_id",
2813
+ "type": "text",
2814
+ "primaryKey": false,
2815
+ "notNull": false
2816
+ },
2817
+ "mount_path": {
2818
+ "name": "mount_path",
2819
+ "type": "text",
2820
+ "primaryKey": false,
2821
+ "notNull": true
2822
+ },
2823
+ "asset_pack_sha": {
2824
+ "name": "asset_pack_sha",
2825
+ "type": "text",
2826
+ "primaryKey": false,
2827
+ "notNull": true
2828
+ },
2829
+ "source_commit_sha": {
2830
+ "name": "source_commit_sha",
2831
+ "type": "text",
2832
+ "primaryKey": false,
2833
+ "notNull": true
2834
+ },
2835
+ "source": {
2836
+ "name": "source",
2837
+ "type": "text",
2838
+ "primaryKey": false,
2839
+ "notNull": true
2840
+ },
2841
+ "materialized_at": {
2842
+ "name": "materialized_at",
2843
+ "type": "timestamp",
2844
+ "primaryKey": false,
2845
+ "notNull": true,
2846
+ "default": "now()"
2847
+ }
2848
+ },
2849
+ "indexes": {
2850
+ "session_asset_pack_sha_idx": {
2851
+ "name": "session_asset_pack_sha_idx",
2852
+ "columns": [
2853
+ {
2854
+ "expression": "asset_pack_sha",
2855
+ "isExpression": false,
2856
+ "asc": true,
2857
+ "nulls": "last"
2858
+ }
2859
+ ],
2860
+ "isUnique": false,
2861
+ "concurrently": false,
2862
+ "method": "btree",
2863
+ "with": {}
2864
+ }
2865
+ },
2866
+ "foreignKeys": {
2867
+ "session_asset_instance_id_agent_instance_id_fk": {
2868
+ "name": "session_asset_instance_id_agent_instance_id_fk",
2869
+ "tableFrom": "session_asset",
2870
+ "tableTo": "agent_instance",
2871
+ "columnsFrom": ["instance_id"],
2872
+ "columnsTo": ["id"],
2873
+ "onDelete": "cascade",
2874
+ "onUpdate": "no action"
2875
+ },
2876
+ "session_asset_agent_asset_id_agent_asset_id_fk": {
2877
+ "name": "session_asset_agent_asset_id_agent_asset_id_fk",
2878
+ "tableFrom": "session_asset",
2879
+ "tableTo": "agent_asset",
2880
+ "columnsFrom": ["agent_asset_id"],
2881
+ "columnsTo": ["id"],
2882
+ "onDelete": "cascade",
2883
+ "onUpdate": "no action"
2884
+ }
2885
+ },
2886
+ "compositePrimaryKeys": {
2887
+ "session_asset_instance_id_mount_path_pk": {
2888
+ "name": "session_asset_instance_id_mount_path_pk",
2889
+ "columns": ["instance_id", "mount_path"]
2890
+ }
2891
+ },
2892
+ "uniqueConstraints": {},
2893
+ "policies": {},
2894
+ "checkConstraints": {},
2895
+ "isRLSEnabled": false
2896
+ },
2897
+ "public.inference_turn": {
2898
+ "name": "inference_turn",
2899
+ "schema": "",
2900
+ "columns": {
2901
+ "id": {
2902
+ "name": "id",
2903
+ "type": "text",
2904
+ "primaryKey": true,
2905
+ "notNull": true
2906
+ },
2907
+ "session_id": {
2908
+ "name": "session_id",
2909
+ "type": "text",
2910
+ "primaryKey": false,
2911
+ "notNull": true
2912
+ },
2913
+ "instance_id": {
2914
+ "name": "instance_id",
2915
+ "type": "text",
2916
+ "primaryKey": false,
2917
+ "notNull": true
2918
+ },
2919
+ "tenant_id": {
2920
+ "name": "tenant_id",
2921
+ "type": "text",
2922
+ "primaryKey": false,
2923
+ "notNull": true
2924
+ },
2925
+ "model": {
2926
+ "name": "model",
2927
+ "type": "text",
2928
+ "primaryKey": false,
2929
+ "notNull": true
2930
+ },
2931
+ "status": {
2932
+ "name": "status",
2933
+ "type": "text",
2934
+ "primaryKey": false,
2935
+ "notNull": true,
2936
+ "default": "'running'"
2937
+ },
2938
+ "started_at": {
2939
+ "name": "started_at",
2940
+ "type": "timestamp",
2941
+ "primaryKey": false,
2942
+ "notNull": true
2943
+ },
2944
+ "ended_at": {
2945
+ "name": "ended_at",
2946
+ "type": "timestamp",
2947
+ "primaryKey": false,
2948
+ "notNull": false
2949
+ }
2950
+ },
2951
+ "indexes": {
2952
+ "inference_turn_instance_id_started_at_idx": {
2953
+ "name": "inference_turn_instance_id_started_at_idx",
2954
+ "columns": [
2955
+ {
2956
+ "expression": "instance_id",
2957
+ "isExpression": false,
2958
+ "asc": true,
2959
+ "nulls": "last"
2960
+ },
2961
+ {
2962
+ "expression": "started_at",
2963
+ "isExpression": false,
2964
+ "asc": true,
2965
+ "nulls": "last"
2966
+ }
2967
+ ],
2968
+ "isUnique": false,
2969
+ "concurrently": false,
2970
+ "method": "btree",
2971
+ "with": {}
2972
+ }
2973
+ },
2974
+ "foreignKeys": {
2975
+ "inference_turn_session_id_agent_session_id_fk": {
2976
+ "name": "inference_turn_session_id_agent_session_id_fk",
2977
+ "tableFrom": "inference_turn",
2978
+ "tableTo": "agent_session",
2979
+ "columnsFrom": ["session_id"],
2980
+ "columnsTo": ["id"],
2981
+ "onDelete": "cascade",
2982
+ "onUpdate": "no action"
2983
+ },
2984
+ "inference_turn_instance_id_agent_instance_id_fk": {
2985
+ "name": "inference_turn_instance_id_agent_instance_id_fk",
2986
+ "tableFrom": "inference_turn",
2987
+ "tableTo": "agent_instance",
2988
+ "columnsFrom": ["instance_id"],
2989
+ "columnsTo": ["id"],
2990
+ "onDelete": "cascade",
2991
+ "onUpdate": "no action"
2992
+ },
2993
+ "inference_turn_tenant_id_tenant_id_fk": {
2994
+ "name": "inference_turn_tenant_id_tenant_id_fk",
2995
+ "tableFrom": "inference_turn",
2996
+ "tableTo": "tenant",
2997
+ "columnsFrom": ["tenant_id"],
2998
+ "columnsTo": ["id"],
2999
+ "onDelete": "cascade",
3000
+ "onUpdate": "no action"
3001
+ }
3002
+ },
3003
+ "compositePrimaryKeys": {},
3004
+ "uniqueConstraints": {},
3005
+ "policies": {},
3006
+ "checkConstraints": {},
3007
+ "isRLSEnabled": false
3008
+ },
3009
+ "public.session_mail": {
3010
+ "name": "session_mail",
3011
+ "schema": "",
3012
+ "columns": {
3013
+ "id": {
3014
+ "name": "id",
3015
+ "type": "text",
3016
+ "primaryKey": true,
3017
+ "notNull": true
3018
+ },
3019
+ "session_id": {
3020
+ "name": "session_id",
3021
+ "type": "text",
3022
+ "primaryKey": false,
3023
+ "notNull": true
3024
+ },
3025
+ "instance_id": {
3026
+ "name": "instance_id",
3027
+ "type": "text",
3028
+ "primaryKey": false,
3029
+ "notNull": false
3030
+ },
3031
+ "tenant_id": {
3032
+ "name": "tenant_id",
3033
+ "type": "text",
3034
+ "primaryKey": false,
3035
+ "notNull": true
3036
+ },
3037
+ "direction": {
3038
+ "name": "direction",
3039
+ "type": "text",
3040
+ "primaryKey": false,
3041
+ "notNull": true
3042
+ },
3043
+ "status": {
3044
+ "name": "status",
3045
+ "type": "text",
3046
+ "primaryKey": false,
3047
+ "notNull": true,
3048
+ "default": "'pending'"
3049
+ },
3050
+ "raw": {
3051
+ "name": "raw",
3052
+ "type": "bytea",
3053
+ "primaryKey": false,
3054
+ "notNull": true
3055
+ },
3056
+ "created_at": {
3057
+ "name": "created_at",
3058
+ "type": "timestamp",
3059
+ "primaryKey": false,
3060
+ "notNull": true,
3061
+ "default": "now()"
3062
+ }
3063
+ },
3064
+ "indexes": {
3065
+ "session_mail_instance_id_created_at_idx": {
3066
+ "name": "session_mail_instance_id_created_at_idx",
3067
+ "columns": [
3068
+ {
3069
+ "expression": "instance_id",
3070
+ "isExpression": false,
3071
+ "asc": true,
3072
+ "nulls": "last"
3073
+ },
3074
+ {
3075
+ "expression": "created_at",
3076
+ "isExpression": false,
3077
+ "asc": true,
3078
+ "nulls": "last"
3079
+ }
3080
+ ],
3081
+ "isUnique": false,
3082
+ "concurrently": false,
3083
+ "method": "btree",
3084
+ "with": {}
3085
+ }
3086
+ },
3087
+ "foreignKeys": {
3088
+ "session_mail_session_id_agent_session_id_fk": {
3089
+ "name": "session_mail_session_id_agent_session_id_fk",
3090
+ "tableFrom": "session_mail",
3091
+ "tableTo": "agent_session",
3092
+ "columnsFrom": ["session_id"],
3093
+ "columnsTo": ["id"],
3094
+ "onDelete": "cascade",
3095
+ "onUpdate": "no action"
3096
+ },
3097
+ "session_mail_instance_id_agent_instance_id_fk": {
3098
+ "name": "session_mail_instance_id_agent_instance_id_fk",
3099
+ "tableFrom": "session_mail",
3100
+ "tableTo": "agent_instance",
3101
+ "columnsFrom": ["instance_id"],
3102
+ "columnsTo": ["id"],
3103
+ "onDelete": "set null",
3104
+ "onUpdate": "no action"
3105
+ },
3106
+ "session_mail_tenant_id_tenant_id_fk": {
3107
+ "name": "session_mail_tenant_id_tenant_id_fk",
3108
+ "tableFrom": "session_mail",
3109
+ "tableTo": "tenant",
3110
+ "columnsFrom": ["tenant_id"],
3111
+ "columnsTo": ["id"],
3112
+ "onDelete": "cascade",
3113
+ "onUpdate": "no action"
3114
+ }
3115
+ },
3116
+ "compositePrimaryKeys": {},
3117
+ "uniqueConstraints": {},
3118
+ "policies": {},
3119
+ "checkConstraints": {},
3120
+ "isRLSEnabled": false
3121
+ },
3122
+ "public.turn_part": {
3123
+ "name": "turn_part",
3124
+ "schema": "",
3125
+ "columns": {
3126
+ "id": {
3127
+ "name": "id",
3128
+ "type": "text",
3129
+ "primaryKey": true,
3130
+ "notNull": true
3131
+ },
3132
+ "turn_id": {
3133
+ "name": "turn_id",
3134
+ "type": "text",
3135
+ "primaryKey": false,
3136
+ "notNull": true
3137
+ },
3138
+ "session_id": {
3139
+ "name": "session_id",
3140
+ "type": "text",
3141
+ "primaryKey": false,
3142
+ "notNull": true
3143
+ },
3144
+ "type": {
3145
+ "name": "type",
3146
+ "type": "text",
3147
+ "primaryKey": false,
3148
+ "notNull": true
3149
+ },
3150
+ "content": {
3151
+ "name": "content",
3152
+ "type": "text",
3153
+ "primaryKey": false,
3154
+ "notNull": false
3155
+ },
3156
+ "metadata": {
3157
+ "name": "metadata",
3158
+ "type": "jsonb",
3159
+ "primaryKey": false,
3160
+ "notNull": false
3161
+ },
3162
+ "ordinal": {
3163
+ "name": "ordinal",
3164
+ "type": "integer",
3165
+ "primaryKey": false,
3166
+ "notNull": true
3167
+ }
3168
+ },
3169
+ "indexes": {},
3170
+ "foreignKeys": {
3171
+ "turn_part_turn_id_inference_turn_id_fk": {
3172
+ "name": "turn_part_turn_id_inference_turn_id_fk",
3173
+ "tableFrom": "turn_part",
3174
+ "tableTo": "inference_turn",
3175
+ "columnsFrom": ["turn_id"],
3176
+ "columnsTo": ["id"],
3177
+ "onDelete": "cascade",
3178
+ "onUpdate": "no action"
3179
+ },
3180
+ "turn_part_session_id_agent_session_id_fk": {
3181
+ "name": "turn_part_session_id_agent_session_id_fk",
3182
+ "tableFrom": "turn_part",
3183
+ "tableTo": "agent_session",
3184
+ "columnsFrom": ["session_id"],
3185
+ "columnsTo": ["id"],
3186
+ "onDelete": "cascade",
3187
+ "onUpdate": "no action"
3188
+ }
3189
+ },
3190
+ "compositePrimaryKeys": {},
3191
+ "uniqueConstraints": {},
3192
+ "policies": {},
3193
+ "checkConstraints": {},
3194
+ "isRLSEnabled": false
3195
+ },
3196
+ "public.git_token": {
3197
+ "name": "git_token",
3198
+ "schema": "",
3199
+ "columns": {
3200
+ "id": {
3201
+ "name": "id",
3202
+ "type": "text",
3203
+ "primaryKey": true,
3204
+ "notNull": true
3205
+ },
3206
+ "tenant_id": {
3207
+ "name": "tenant_id",
3208
+ "type": "text",
3209
+ "primaryKey": false,
3210
+ "notNull": false
3211
+ },
3212
+ "user_id": {
3213
+ "name": "user_id",
3214
+ "type": "text",
3215
+ "primaryKey": false,
3216
+ "notNull": true
3217
+ },
3218
+ "principal_id": {
3219
+ "name": "principal_id",
3220
+ "type": "text",
3221
+ "primaryKey": false,
3222
+ "notNull": false
3223
+ },
3224
+ "name": {
3225
+ "name": "name",
3226
+ "type": "text",
3227
+ "primaryKey": false,
3228
+ "notNull": true
3229
+ },
3230
+ "kind": {
3231
+ "name": "kind",
3232
+ "type": "text",
3233
+ "primaryKey": false,
3234
+ "notNull": true
3235
+ },
3236
+ "token_hash_sha256": {
3237
+ "name": "token_hash_sha256",
3238
+ "type": "bytea",
3239
+ "primaryKey": false,
3240
+ "notNull": true
3241
+ },
3242
+ "resource": {
3243
+ "name": "resource",
3244
+ "type": "text",
3245
+ "primaryKey": false,
3246
+ "notNull": true
3247
+ },
3248
+ "ref_pattern": {
3249
+ "name": "ref_pattern",
3250
+ "type": "text",
3251
+ "primaryKey": false,
3252
+ "notNull": true
3253
+ },
3254
+ "actions": {
3255
+ "name": "actions",
3256
+ "type": "text[]",
3257
+ "primaryKey": false,
3258
+ "notNull": true
3259
+ },
3260
+ "expires_at": {
3261
+ "name": "expires_at",
3262
+ "type": "timestamp with time zone",
3263
+ "primaryKey": false,
3264
+ "notNull": true
3265
+ },
3266
+ "revoked_at": {
3267
+ "name": "revoked_at",
3268
+ "type": "timestamp with time zone",
3269
+ "primaryKey": false,
3270
+ "notNull": false
3271
+ },
3272
+ "created_at": {
3273
+ "name": "created_at",
3274
+ "type": "timestamp with time zone",
3275
+ "primaryKey": false,
3276
+ "notNull": true,
3277
+ "default": "now()"
3278
+ }
3279
+ },
3280
+ "indexes": {
3281
+ "git_token_user_id_name_active_idx": {
3282
+ "name": "git_token_user_id_name_active_idx",
3283
+ "columns": [
3284
+ {
3285
+ "expression": "user_id",
3286
+ "isExpression": false,
3287
+ "asc": true,
3288
+ "nulls": "last"
3289
+ },
3290
+ {
3291
+ "expression": "name",
3292
+ "isExpression": false,
3293
+ "asc": true,
3294
+ "nulls": "last"
3295
+ }
3296
+ ],
3297
+ "isUnique": true,
3298
+ "where": "\"git_token\".\"revoked_at\" is null",
3299
+ "concurrently": false,
3300
+ "method": "btree",
3301
+ "with": {}
3302
+ }
3303
+ },
3304
+ "foreignKeys": {
3305
+ "git_token_tenant_id_tenant_id_fk": {
3306
+ "name": "git_token_tenant_id_tenant_id_fk",
3307
+ "tableFrom": "git_token",
3308
+ "tableTo": "tenant",
3309
+ "columnsFrom": ["tenant_id"],
3310
+ "columnsTo": ["id"],
3311
+ "onDelete": "no action",
3312
+ "onUpdate": "no action"
3313
+ },
3314
+ "git_token_user_id_user_id_fk": {
3315
+ "name": "git_token_user_id_user_id_fk",
3316
+ "tableFrom": "git_token",
3317
+ "tableTo": "user",
3318
+ "columnsFrom": ["user_id"],
3319
+ "columnsTo": ["id"],
3320
+ "onDelete": "cascade",
3321
+ "onUpdate": "no action"
3322
+ },
3323
+ "git_token_principal_id_principal_id_fk": {
3324
+ "name": "git_token_principal_id_principal_id_fk",
3325
+ "tableFrom": "git_token",
3326
+ "tableTo": "principal",
3327
+ "columnsFrom": ["principal_id"],
3328
+ "columnsTo": ["id"],
3329
+ "onDelete": "cascade",
3330
+ "onUpdate": "no action"
3331
+ }
3332
+ },
3333
+ "compositePrimaryKeys": {},
3334
+ "uniqueConstraints": {
3335
+ "git_token_token_hash_sha256_unique": {
3336
+ "name": "git_token_token_hash_sha256_unique",
3337
+ "nullsNotDistinct": false,
3338
+ "columns": ["token_hash_sha256"]
3339
+ }
3340
+ },
3341
+ "policies": {},
3342
+ "checkConstraints": {},
3343
+ "isRLSEnabled": false
3344
+ },
3345
+ "public.workflow_deployment": {
3346
+ "name": "workflow_deployment",
3347
+ "schema": "",
3348
+ "columns": {
3349
+ "id": {
3350
+ "name": "id",
3351
+ "type": "text",
3352
+ "primaryKey": true,
3353
+ "notNull": true
3354
+ },
3355
+ "tenant_id": {
3356
+ "name": "tenant_id",
3357
+ "type": "text",
3358
+ "primaryKey": false,
3359
+ "notNull": true
3360
+ },
3361
+ "definition_asset_id": {
3362
+ "name": "definition_asset_id",
3363
+ "type": "text",
3364
+ "primaryKey": false,
3365
+ "notNull": true
3366
+ },
3367
+ "address": {
3368
+ "name": "address",
3369
+ "type": "text",
3370
+ "primaryKey": false,
3371
+ "notNull": true
3372
+ },
3373
+ "public_key": {
3374
+ "name": "public_key",
3375
+ "type": "text",
3376
+ "primaryKey": false,
3377
+ "notNull": false
3378
+ },
3379
+ "status": {
3380
+ "name": "status",
3381
+ "type": "text",
3382
+ "primaryKey": false,
3383
+ "notNull": true,
3384
+ "default": "'deployed'"
3385
+ },
3386
+ "created_at": {
3387
+ "name": "created_at",
3388
+ "type": "timestamp",
3389
+ "primaryKey": false,
3390
+ "notNull": true,
3391
+ "default": "now()"
3392
+ }
3393
+ },
3394
+ "indexes": {
3395
+ "workflow_deployment_tenant_idx": {
3396
+ "name": "workflow_deployment_tenant_idx",
3397
+ "columns": [
3398
+ {
3399
+ "expression": "tenant_id",
3400
+ "isExpression": false,
3401
+ "asc": true,
3402
+ "nulls": "last"
3403
+ },
3404
+ {
3405
+ "expression": "created_at",
3406
+ "isExpression": false,
3407
+ "asc": true,
3408
+ "nulls": "last"
3409
+ }
3410
+ ],
3411
+ "isUnique": false,
3412
+ "concurrently": false,
3413
+ "method": "btree",
3414
+ "with": {}
3415
+ },
3416
+ "workflow_deployment_address_idx": {
3417
+ "name": "workflow_deployment_address_idx",
3418
+ "columns": [
3419
+ {
3420
+ "expression": "address",
3421
+ "isExpression": false,
3422
+ "asc": true,
3423
+ "nulls": "last"
3424
+ }
3425
+ ],
3426
+ "isUnique": true,
3427
+ "concurrently": false,
3428
+ "method": "btree",
3429
+ "with": {}
3430
+ }
3431
+ },
3432
+ "foreignKeys": {
3433
+ "workflow_deployment_tenant_id_tenant_id_fk": {
3434
+ "name": "workflow_deployment_tenant_id_tenant_id_fk",
3435
+ "tableFrom": "workflow_deployment",
3436
+ "tableTo": "tenant",
3437
+ "columnsFrom": ["tenant_id"],
3438
+ "columnsTo": ["id"],
3439
+ "onDelete": "cascade",
3440
+ "onUpdate": "no action"
3441
+ },
3442
+ "workflow_deployment_definition_asset_id_asset_id_fk": {
3443
+ "name": "workflow_deployment_definition_asset_id_asset_id_fk",
3444
+ "tableFrom": "workflow_deployment",
3445
+ "tableTo": "asset",
3446
+ "columnsFrom": ["definition_asset_id"],
3447
+ "columnsTo": ["id"],
3448
+ "onDelete": "cascade",
3449
+ "onUpdate": "no action"
3450
+ }
3451
+ },
3452
+ "compositePrimaryKeys": {},
3453
+ "uniqueConstraints": {},
3454
+ "policies": {},
3455
+ "checkConstraints": {},
3456
+ "isRLSEnabled": false
3457
+ }
3458
+ },
3459
+ "enums": {},
3460
+ "schemas": {},
3461
+ "sequences": {},
3462
+ "roles": {},
3463
+ "policies": {},
3464
+ "views": {},
3465
+ "_meta": {
3466
+ "columns": {},
3467
+ "schemas": {},
3468
+ "tables": {}
3469
+ }
3470
+ }