@open-mercato/ai-assistant 0.6.1-develop.3246.1.dbef9d7392 → 0.6.1-develop.3256.1.fe3dec2464

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 (133) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/AGENTS.md +82 -18
  3. package/dist/modules/ai_assistant/__integration__/TC-AI-RUNTIME-OVERRIDES-006-model-picker.spec.js +370 -0
  4. package/dist/modules/ai_assistant/__integration__/TC-AI-RUNTIME-OVERRIDES-006-model-picker.spec.js.map +7 -0
  5. package/dist/modules/ai_assistant/api/ai/agents/[agentId]/models/route.js +194 -0
  6. package/dist/modules/ai_assistant/api/ai/agents/[agentId]/models/route.js.map +7 -0
  7. package/dist/modules/ai_assistant/api/ai/agents/route.js +4 -0
  8. package/dist/modules/ai_assistant/api/ai/agents/route.js.map +2 -2
  9. package/dist/modules/ai_assistant/api/ai/chat/route.js +169 -5
  10. package/dist/modules/ai_assistant/api/ai/chat/route.js.map +2 -2
  11. package/dist/modules/ai_assistant/api/route/route.js +38 -19
  12. package/dist/modules/ai_assistant/api/route/route.js.map +3 -3
  13. package/dist/modules/ai_assistant/api/settings/allowlist/route.js +195 -0
  14. package/dist/modules/ai_assistant/api/settings/allowlist/route.js.map +7 -0
  15. package/dist/modules/ai_assistant/api/settings/route.js +537 -22
  16. package/dist/modules/ai_assistant/api/settings/route.js.map +3 -3
  17. package/dist/modules/ai_assistant/backend/config/ai-assistant/agents/AiAgentSettingsPageClient.js +701 -147
  18. package/dist/modules/ai_assistant/backend/config/ai-assistant/agents/AiAgentSettingsPageClient.js.map +2 -2
  19. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/AiTenantAllowlistPageClient.js +338 -0
  20. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/AiTenantAllowlistPageClient.js.map +7 -0
  21. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.js +10 -0
  22. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.js.map +7 -0
  23. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.meta.js +25 -0
  24. package/dist/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.meta.js.map +7 -0
  25. package/dist/modules/ai_assistant/backend/config/ai-assistant/legacy/page.js +1 -1
  26. package/dist/modules/ai_assistant/backend/config/ai-assistant/legacy/page.js.map +2 -2
  27. package/dist/modules/ai_assistant/backend/config/ai-assistant/playground/AiPlaygroundPageClient.js +75 -26
  28. package/dist/modules/ai_assistant/backend/config/ai-assistant/playground/AiPlaygroundPageClient.js.map +2 -2
  29. package/dist/modules/ai_assistant/backend/config/ai-assistant/settings/page.js +10 -0
  30. package/dist/modules/ai_assistant/backend/config/ai-assistant/settings/page.js.map +7 -0
  31. package/dist/modules/ai_assistant/backend/config/ai-assistant/settings/page.meta.js +25 -0
  32. package/dist/modules/ai_assistant/backend/config/ai-assistant/settings/page.meta.js.map +7 -0
  33. package/dist/modules/ai_assistant/components/AiAssistantSettingsPageClient.js +503 -168
  34. package/dist/modules/ai_assistant/components/AiAssistantSettingsPageClient.js.map +2 -2
  35. package/dist/modules/ai_assistant/data/entities/AiAgentRuntimeOverride.js +5 -0
  36. package/dist/modules/ai_assistant/data/entities/AiAgentRuntimeOverride.js.map +7 -0
  37. package/dist/modules/ai_assistant/data/entities/AiTenantModelAllowlist.js +5 -0
  38. package/dist/modules/ai_assistant/data/entities/AiTenantModelAllowlist.js.map +7 -0
  39. package/dist/modules/ai_assistant/data/entities.js +123 -1
  40. package/dist/modules/ai_assistant/data/entities.js.map +2 -2
  41. package/dist/modules/ai_assistant/data/repositories/AiAgentRuntimeOverrideRepository.js +157 -0
  42. package/dist/modules/ai_assistant/data/repositories/AiAgentRuntimeOverrideRepository.js.map +7 -0
  43. package/dist/modules/ai_assistant/data/repositories/AiTenantModelAllowlistRepository.js +77 -0
  44. package/dist/modules/ai_assistant/data/repositories/AiTenantModelAllowlistRepository.js.map +7 -0
  45. package/dist/modules/ai_assistant/frontend/components/AiAssistantSettingsPageClient.js +1 -1
  46. package/dist/modules/ai_assistant/frontend/components/AiAssistantSettingsPageClient.js.map +2 -2
  47. package/dist/modules/ai_assistant/i18n/de.json +90 -1
  48. package/dist/modules/ai_assistant/i18n/en.json +90 -1
  49. package/dist/modules/ai_assistant/i18n/es.json +90 -1
  50. package/dist/modules/ai_assistant/i18n/pl.json +90 -1
  51. package/dist/modules/ai_assistant/lib/agent-registry.js +17 -1
  52. package/dist/modules/ai_assistant/lib/agent-registry.js.map +2 -2
  53. package/dist/modules/ai_assistant/lib/agent-runtime.js +133 -36
  54. package/dist/modules/ai_assistant/lib/agent-runtime.js.map +2 -2
  55. package/dist/modules/ai_assistant/lib/ai-agent-definition.js.map +2 -2
  56. package/dist/modules/ai_assistant/lib/baseurl-allowlist.js +29 -0
  57. package/dist/modules/ai_assistant/lib/baseurl-allowlist.js.map +7 -0
  58. package/dist/modules/ai_assistant/lib/llm-adapters/anthropic.js +4 -1
  59. package/dist/modules/ai_assistant/lib/llm-adapters/anthropic.js.map +2 -2
  60. package/dist/modules/ai_assistant/lib/llm-adapters/google.js +4 -1
  61. package/dist/modules/ai_assistant/lib/llm-adapters/google.js.map +2 -2
  62. package/dist/modules/ai_assistant/lib/model-allowlist.js +211 -0
  63. package/dist/modules/ai_assistant/lib/model-allowlist.js.map +7 -0
  64. package/dist/modules/ai_assistant/lib/model-factory.js +203 -31
  65. package/dist/modules/ai_assistant/lib/model-factory.js.map +2 -2
  66. package/dist/modules/ai_assistant/lib/openai-compatible-presets.js +32 -1
  67. package/dist/modules/ai_assistant/lib/openai-compatible-presets.js.map +2 -2
  68. package/dist/modules/ai_assistant/migrations/Migration20260508140000.js +18 -0
  69. package/dist/modules/ai_assistant/migrations/Migration20260508140000.js.map +7 -0
  70. package/dist/modules/ai_assistant/migrations/Migration20260512090000.js +16 -0
  71. package/dist/modules/ai_assistant/migrations/Migration20260512090000.js.map +7 -0
  72. package/dist/modules/ai_assistant/migrations/Migration20260512130000.js +15 -0
  73. package/dist/modules/ai_assistant/migrations/Migration20260512130000.js.map +7 -0
  74. package/generated/entities/ai_agent_runtime_override/index.ts +13 -0
  75. package/generated/entities/ai_tenant_model_allowlist/index.ts +9 -0
  76. package/generated/entities.ids.generated.ts +2 -0
  77. package/generated/entity-fields-registry.ts +26 -0
  78. package/jest.config.cjs +2 -0
  79. package/package.json +4 -4
  80. package/src/modules/ai_assistant/__integration__/TC-AI-RUNTIME-OVERRIDES-006-model-picker.spec.ts +477 -0
  81. package/src/modules/ai_assistant/__tests__/settings-page-logic.test.ts +116 -0
  82. package/src/modules/ai_assistant/api/ai/agents/[agentId]/models/__tests__/route.test.ts +240 -0
  83. package/src/modules/ai_assistant/api/ai/agents/[agentId]/models/route.ts +251 -0
  84. package/src/modules/ai_assistant/api/ai/agents/route.ts +4 -0
  85. package/src/modules/ai_assistant/api/ai/chat/__tests__/route.test.ts +273 -0
  86. package/src/modules/ai_assistant/api/ai/chat/route.ts +211 -2
  87. package/src/modules/ai_assistant/api/route/route.ts +49 -25
  88. package/src/modules/ai_assistant/api/settings/__tests__/route.test.ts +408 -0
  89. package/src/modules/ai_assistant/api/settings/allowlist/route.ts +221 -0
  90. package/src/modules/ai_assistant/api/settings/route.ts +721 -27
  91. package/src/modules/ai_assistant/backend/config/ai-assistant/agents/AiAgentSettingsPageClient.tsx +858 -177
  92. package/src/modules/ai_assistant/backend/config/ai-assistant/allowlist/AiTenantAllowlistPageClient.tsx +458 -0
  93. package/src/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.meta.ts +23 -0
  94. package/src/modules/ai_assistant/backend/config/ai-assistant/allowlist/page.tsx +12 -0
  95. package/src/modules/ai_assistant/backend/config/ai-assistant/legacy/page.tsx +1 -1
  96. package/src/modules/ai_assistant/backend/config/ai-assistant/playground/AiPlaygroundPageClient.tsx +89 -12
  97. package/src/modules/ai_assistant/backend/config/ai-assistant/settings/page.meta.ts +23 -0
  98. package/src/modules/ai_assistant/backend/config/ai-assistant/settings/page.tsx +18 -0
  99. package/src/modules/ai_assistant/components/AiAssistantSettingsPageClient.tsx +617 -209
  100. package/src/modules/ai_assistant/data/entities/AiAgentRuntimeOverride.ts +7 -0
  101. package/src/modules/ai_assistant/data/entities/AiTenantModelAllowlist.ts +2 -0
  102. package/src/modules/ai_assistant/data/entities.ts +164 -0
  103. package/src/modules/ai_assistant/data/repositories/AiAgentRuntimeOverrideRepository.ts +227 -0
  104. package/src/modules/ai_assistant/data/repositories/AiTenantModelAllowlistRepository.ts +132 -0
  105. package/src/modules/ai_assistant/data/repositories/__tests__/AiAgentRuntimeOverrideRepository.test.ts +337 -0
  106. package/src/modules/ai_assistant/data/repositories/__tests__/AiTenantModelAllowlistRepository.test.ts +181 -0
  107. package/src/modules/ai_assistant/frontend/components/AiAssistantSettingsPageClient.tsx +1 -1
  108. package/src/modules/ai_assistant/i18n/de.json +90 -1
  109. package/src/modules/ai_assistant/i18n/en.json +90 -1
  110. package/src/modules/ai_assistant/i18n/es.json +90 -1
  111. package/src/modules/ai_assistant/i18n/pl.json +90 -1
  112. package/src/modules/ai_assistant/lib/__tests__/agent-runtime-phase4a.test.ts +396 -0
  113. package/src/modules/ai_assistant/lib/__tests__/agent-runtime.test.ts +60 -6
  114. package/src/modules/ai_assistant/lib/__tests__/ai-api-operation-runner.test.ts +4 -2
  115. package/src/modules/ai_assistant/lib/__tests__/baseurl-allowlist.test.ts +75 -0
  116. package/src/modules/ai_assistant/lib/__tests__/llm-adapters-anthropic.test.ts +18 -0
  117. package/src/modules/ai_assistant/lib/__tests__/llm-adapters-google.test.ts +18 -0
  118. package/src/modules/ai_assistant/lib/__tests__/llm-adapters-openai.test.ts +150 -4
  119. package/src/modules/ai_assistant/lib/__tests__/model-allowlist.test.ts +290 -0
  120. package/src/modules/ai_assistant/lib/__tests__/model-factory.test.ts +634 -0
  121. package/src/modules/ai_assistant/lib/agent-registry.ts +20 -1
  122. package/src/modules/ai_assistant/lib/agent-runtime.ts +220 -44
  123. package/src/modules/ai_assistant/lib/ai-agent-definition.ts +48 -0
  124. package/src/modules/ai_assistant/lib/baseurl-allowlist.ts +64 -0
  125. package/src/modules/ai_assistant/lib/llm-adapters/anthropic.ts +11 -1
  126. package/src/modules/ai_assistant/lib/llm-adapters/google.ts +4 -1
  127. package/src/modules/ai_assistant/lib/model-allowlist.ts +407 -0
  128. package/src/modules/ai_assistant/lib/model-factory.ts +486 -58
  129. package/src/modules/ai_assistant/lib/openai-compatible-presets.ts +44 -0
  130. package/src/modules/ai_assistant/migrations/.snapshot-open-mercato.json +704 -235
  131. package/src/modules/ai_assistant/migrations/Migration20260508140000.ts +18 -0
  132. package/src/modules/ai_assistant/migrations/Migration20260512090000.ts +16 -0
  133. package/src/modules/ai_assistant/migrations/Migration20260512130000.ts +13 -0
@@ -1,45 +1,47 @@
1
1
  {
2
+ "name": "public",
2
3
  "namespaces": [
3
4
  "public"
4
5
  ],
5
- "name": "public",
6
6
  "tables": [
7
7
  {
8
+ "name": "ai_agent_mutation_policy_overrides",
9
+ "schema": "public",
8
10
  "columns": {
9
- "id": {
10
- "name": "id",
11
- "type": "uuid",
11
+ "agent_id": {
12
+ "name": "agent_id",
13
+ "type": "text",
12
14
  "unsigned": false,
13
15
  "autoincrement": false,
14
- "primary": true,
16
+ "primary": false,
15
17
  "nullable": false,
16
18
  "unique": false,
17
19
  "length": null,
18
20
  "precision": null,
19
21
  "scale": null,
20
- "default": "gen_random_uuid()",
22
+ "default": null,
21
23
  "comment": null,
22
24
  "enumItems": [],
23
- "mappedType": "uuid"
25
+ "mappedType": "text"
24
26
  },
25
- "tenant_id": {
26
- "name": "tenant_id",
27
- "type": "uuid",
27
+ "created_at": {
28
+ "name": "created_at",
29
+ "type": "timestamptz(6)",
28
30
  "unsigned": false,
29
31
  "autoincrement": false,
30
32
  "primary": false,
31
33
  "nullable": false,
32
34
  "unique": false,
33
- "length": null,
35
+ "length": 6,
34
36
  "precision": null,
35
37
  "scale": null,
36
38
  "default": null,
37
39
  "comment": null,
38
40
  "enumItems": [],
39
- "mappedType": "uuid"
41
+ "mappedType": "datetime"
40
42
  },
41
- "organization_id": {
42
- "name": "organization_id",
43
+ "created_by_user_id": {
44
+ "name": "created_by_user_id",
43
45
  "type": "uuid",
44
46
  "unsigned": false,
45
47
  "autoincrement": false,
@@ -54,21 +56,21 @@
54
56
  "enumItems": [],
55
57
  "mappedType": "uuid"
56
58
  },
57
- "agent_id": {
58
- "name": "agent_id",
59
- "type": "text",
59
+ "id": {
60
+ "name": "id",
61
+ "type": "uuid",
60
62
  "unsigned": false,
61
63
  "autoincrement": false,
62
- "primary": false,
64
+ "primary": true,
63
65
  "nullable": false,
64
66
  "unique": false,
65
67
  "length": null,
66
68
  "precision": null,
67
69
  "scale": null,
68
- "default": null,
70
+ "default": "gen_random_uuid()",
69
71
  "comment": null,
70
72
  "enumItems": [],
71
- "mappedType": "text"
73
+ "mappedType": "uuid"
72
74
  },
73
75
  "mutation_policy": {
74
76
  "name": "mutation_policy",
@@ -102,8 +104,8 @@
102
104
  "enumItems": [],
103
105
  "mappedType": "text"
104
106
  },
105
- "created_by_user_id": {
106
- "name": "created_by_user_id",
107
+ "organization_id": {
108
+ "name": "organization_id",
107
109
  "type": "uuid",
108
110
  "unsigned": false,
109
111
  "autoincrement": false,
@@ -118,25 +120,25 @@
118
120
  "enumItems": [],
119
121
  "mappedType": "uuid"
120
122
  },
121
- "created_at": {
122
- "name": "created_at",
123
- "type": "timestamptz",
123
+ "tenant_id": {
124
+ "name": "tenant_id",
125
+ "type": "uuid",
124
126
  "unsigned": false,
125
127
  "autoincrement": false,
126
128
  "primary": false,
127
129
  "nullable": false,
128
130
  "unique": false,
129
- "length": 6,
131
+ "length": null,
130
132
  "precision": null,
131
133
  "scale": null,
132
134
  "default": null,
133
135
  "comment": null,
134
136
  "enumItems": [],
135
- "mappedType": "datetime"
137
+ "mappedType": "uuid"
136
138
  },
137
139
  "updated_at": {
138
140
  "name": "updated_at",
139
- "type": "timestamptz",
141
+ "type": "timestamptz(6)",
140
142
  "unsigned": false,
141
143
  "autoincrement": false,
142
144
  "primary": false,
@@ -151,89 +153,89 @@
151
153
  "mappedType": "datetime"
152
154
  }
153
155
  },
154
- "name": "ai_agent_mutation_policy_overrides",
155
- "schema": "public",
156
156
  "indexes": [
157
157
  {
158
- "keyName": "ai_agent_mutation_policy_overrides_tenant_agent_idx",
158
+ "columnNames": [
159
+ "id"
160
+ ],
161
+ "composite": false,
162
+ "constraint": true,
163
+ "keyName": "ai_agent_mutation_policy_overrides_pkey",
164
+ "primary": true,
165
+ "unique": true
166
+ },
167
+ {
159
168
  "columnNames": [
160
169
  "tenant_id",
161
170
  "agent_id"
162
171
  ],
163
172
  "composite": true,
164
173
  "constraint": false,
174
+ "keyName": "ai_agent_mutation_policy_overrides_tenant_agent_idx",
165
175
  "primary": false,
166
176
  "unique": false
167
177
  },
168
178
  {
169
- "keyName": "ai_agent_mutation_policy_overrides_tenant_org_agent_uq",
170
179
  "columnNames": [],
171
180
  "composite": false,
172
181
  "constraint": false,
182
+ "keyName": "ai_agent_mutation_policy_overrides_tenant_agent_null_org_uq",
173
183
  "primary": false,
174
184
  "unique": false,
175
- "expression": "create unique index \"ai_agent_mutation_policy_overrides_tenant_org_agent_uq\" on \"ai_agent_mutation_policy_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\") where \"organization_id\" is not null"
185
+ "expression": "create unique index \"ai_agent_mutation_policy_overrides_tenant_agent_null_org_uq\" on \"ai_agent_mutation_policy_overrides\" (\"tenant_id\", \"agent_id\") where \"organization_id\" is null"
176
186
  },
177
187
  {
178
- "keyName": "ai_agent_mutation_policy_overrides_tenant_agent_null_org_uq",
179
188
  "columnNames": [],
180
189
  "composite": false,
181
190
  "constraint": false,
191
+ "keyName": "ai_agent_mutation_policy_overrides_tenant_org_agent_uq",
182
192
  "primary": false,
183
193
  "unique": false,
184
- "expression": "create unique index \"ai_agent_mutation_policy_overrides_tenant_agent_null_org_uq\" on \"ai_agent_mutation_policy_overrides\" (\"tenant_id\", \"agent_id\") where \"organization_id\" is null"
185
- },
186
- {
187
- "keyName": "ai_agent_mutation_policy_overrides_pkey",
188
- "columnNames": [
189
- "id"
190
- ],
191
- "composite": false,
192
- "constraint": true,
193
- "primary": true,
194
- "unique": true
194
+ "expression": "create unique index \"ai_agent_mutation_policy_overrides_tenant_org_agent_uq\" on \"ai_agent_mutation_policy_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\") where \"organization_id\" is not null"
195
195
  }
196
196
  ],
197
197
  "checks": [],
198
198
  "foreignKeys": {},
199
- "nativeEnums": {}
199
+ "comment": null
200
200
  },
201
201
  {
202
+ "name": "ai_agent_prompt_overrides",
203
+ "schema": "public",
202
204
  "columns": {
203
- "id": {
204
- "name": "id",
205
- "type": "uuid",
205
+ "agent_id": {
206
+ "name": "agent_id",
207
+ "type": "text",
206
208
  "unsigned": false,
207
209
  "autoincrement": false,
208
- "primary": true,
210
+ "primary": false,
209
211
  "nullable": false,
210
212
  "unique": false,
211
213
  "length": null,
212
214
  "precision": null,
213
215
  "scale": null,
214
- "default": "gen_random_uuid()",
216
+ "default": null,
215
217
  "comment": null,
216
218
  "enumItems": [],
217
- "mappedType": "uuid"
219
+ "mappedType": "text"
218
220
  },
219
- "tenant_id": {
220
- "name": "tenant_id",
221
- "type": "uuid",
221
+ "created_at": {
222
+ "name": "created_at",
223
+ "type": "timestamptz(6)",
222
224
  "unsigned": false,
223
225
  "autoincrement": false,
224
226
  "primary": false,
225
227
  "nullable": false,
226
228
  "unique": false,
227
- "length": null,
229
+ "length": 6,
228
230
  "precision": null,
229
231
  "scale": null,
230
232
  "default": null,
231
233
  "comment": null,
232
234
  "enumItems": [],
233
- "mappedType": "uuid"
235
+ "mappedType": "datetime"
234
236
  },
235
- "organization_id": {
236
- "name": "organization_id",
237
+ "created_by_user_id": {
238
+ "name": "created_by_user_id",
237
239
  "type": "uuid",
238
240
  "unsigned": false,
239
241
  "autoincrement": false,
@@ -248,29 +250,29 @@
248
250
  "enumItems": [],
249
251
  "mappedType": "uuid"
250
252
  },
251
- "agent_id": {
252
- "name": "agent_id",
253
- "type": "text",
253
+ "id": {
254
+ "name": "id",
255
+ "type": "uuid",
254
256
  "unsigned": false,
255
257
  "autoincrement": false,
256
- "primary": false,
258
+ "primary": true,
257
259
  "nullable": false,
258
260
  "unique": false,
259
261
  "length": null,
260
262
  "precision": null,
261
263
  "scale": null,
262
- "default": null,
264
+ "default": "gen_random_uuid()",
263
265
  "comment": null,
264
266
  "enumItems": [],
265
- "mappedType": "text"
267
+ "mappedType": "uuid"
266
268
  },
267
- "version": {
268
- "name": "version",
269
- "type": "int",
269
+ "notes": {
270
+ "name": "notes",
271
+ "type": "text",
270
272
  "unsigned": false,
271
273
  "autoincrement": false,
272
274
  "primary": false,
273
- "nullable": false,
275
+ "nullable": true,
274
276
  "unique": false,
275
277
  "length": null,
276
278
  "precision": null,
@@ -278,15 +280,15 @@
278
280
  "default": null,
279
281
  "comment": null,
280
282
  "enumItems": [],
281
- "mappedType": "integer"
283
+ "mappedType": "text"
282
284
  },
283
- "sections": {
284
- "name": "sections",
285
- "type": "jsonb",
285
+ "organization_id": {
286
+ "name": "organization_id",
287
+ "type": "uuid",
286
288
  "unsigned": false,
287
289
  "autoincrement": false,
288
290
  "primary": false,
289
- "nullable": false,
291
+ "nullable": true,
290
292
  "unique": false,
291
293
  "length": null,
292
294
  "precision": null,
@@ -294,15 +296,15 @@
294
296
  "default": null,
295
297
  "comment": null,
296
298
  "enumItems": [],
297
- "mappedType": "json"
299
+ "mappedType": "uuid"
298
300
  },
299
- "notes": {
300
- "name": "notes",
301
- "type": "text",
301
+ "sections": {
302
+ "name": "sections",
303
+ "type": "jsonb",
302
304
  "unsigned": false,
303
305
  "autoincrement": false,
304
306
  "primary": false,
305
- "nullable": true,
307
+ "nullable": false,
306
308
  "unique": false,
307
309
  "length": null,
308
310
  "precision": null,
@@ -310,15 +312,15 @@
310
312
  "default": null,
311
313
  "comment": null,
312
314
  "enumItems": [],
313
- "mappedType": "text"
315
+ "mappedType": "json"
314
316
  },
315
- "created_by_user_id": {
316
- "name": "created_by_user_id",
317
+ "tenant_id": {
318
+ "name": "tenant_id",
317
319
  "type": "uuid",
318
320
  "unsigned": false,
319
321
  "autoincrement": false,
320
322
  "primary": false,
321
- "nullable": true,
323
+ "nullable": false,
322
324
  "unique": false,
323
325
  "length": null,
324
326
  "precision": null,
@@ -328,9 +330,9 @@
328
330
  "enumItems": [],
329
331
  "mappedType": "uuid"
330
332
  },
331
- "created_at": {
332
- "name": "created_at",
333
- "type": "timestamptz",
333
+ "updated_at": {
334
+ "name": "updated_at",
335
+ "type": "timestamptz(6)",
334
336
  "unsigned": false,
335
337
  "autoincrement": false,
336
338
  "primary": false,
@@ -344,100 +346,100 @@
344
346
  "enumItems": [],
345
347
  "mappedType": "datetime"
346
348
  },
347
- "updated_at": {
348
- "name": "updated_at",
349
- "type": "timestamptz",
349
+ "version": {
350
+ "name": "version",
351
+ "type": "int",
350
352
  "unsigned": false,
351
353
  "autoincrement": false,
352
354
  "primary": false,
353
355
  "nullable": false,
354
356
  "unique": false,
355
- "length": 6,
357
+ "length": null,
356
358
  "precision": null,
357
359
  "scale": null,
358
360
  "default": null,
359
361
  "comment": null,
360
362
  "enumItems": [],
361
- "mappedType": "datetime"
363
+ "mappedType": "integer"
362
364
  }
363
365
  },
364
- "name": "ai_agent_prompt_overrides",
365
- "schema": "public",
366
366
  "indexes": [
367
367
  {
368
- "keyName": "ai_agent_prompt_overrides_tenant_org_agent_version_idx",
369
- "columnNames": [],
368
+ "columnNames": [
369
+ "id"
370
+ ],
370
371
  "composite": false,
371
- "constraint": false,
372
- "primary": false,
373
- "unique": false,
374
- "expression": "create index \"ai_agent_prompt_overrides_tenant_org_agent_version_idx\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\", \"version\" desc)"
372
+ "constraint": true,
373
+ "keyName": "ai_agent_prompt_overrides_pkey",
374
+ "primary": true,
375
+ "unique": true
375
376
  },
376
377
  {
377
- "keyName": "ai_agent_prompt_overrides_tenant_agent_idx",
378
378
  "columnNames": [
379
379
  "tenant_id",
380
380
  "agent_id"
381
381
  ],
382
382
  "composite": true,
383
383
  "constraint": false,
384
+ "keyName": "ai_agent_prompt_overrides_tenant_agent_idx",
384
385
  "primary": false,
385
386
  "unique": false
386
387
  },
387
388
  {
388
- "keyName": "ai_agent_prompt_overrides_tenant_org_agent_version_uq",
389
389
  "columnNames": [],
390
390
  "composite": false,
391
391
  "constraint": false,
392
+ "keyName": "ai_agent_prompt_overrides_tenant_agent_version_null_org_uq",
392
393
  "primary": false,
393
394
  "unique": false,
394
- "expression": "create unique index \"ai_agent_prompt_overrides_tenant_org_agent_version_uq\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\", \"version\") where \"organization_id\" is not null"
395
+ "expression": "create unique index \"ai_agent_prompt_overrides_tenant_agent_version_null_org_uq\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"agent_id\", \"version\") where \"organization_id\" is null"
395
396
  },
396
397
  {
397
- "keyName": "ai_agent_prompt_overrides_tenant_agent_version_null_org_uq",
398
398
  "columnNames": [],
399
399
  "composite": false,
400
400
  "constraint": false,
401
+ "keyName": "ai_agent_prompt_overrides_tenant_org_agent_version_idx",
401
402
  "primary": false,
402
403
  "unique": false,
403
- "expression": "create unique index \"ai_agent_prompt_overrides_tenant_agent_version_null_org_uq\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"agent_id\", \"version\") where \"organization_id\" is null"
404
+ "expression": "create index \"ai_agent_prompt_overrides_tenant_org_agent_version_idx\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\", \"version\" desc)"
404
405
  },
405
406
  {
406
- "keyName": "ai_agent_prompt_overrides_pkey",
407
- "columnNames": [
408
- "id"
409
- ],
407
+ "columnNames": [],
410
408
  "composite": false,
411
- "constraint": true,
412
- "primary": true,
413
- "unique": true
409
+ "constraint": false,
410
+ "keyName": "ai_agent_prompt_overrides_tenant_org_agent_version_uq",
411
+ "primary": false,
412
+ "unique": false,
413
+ "expression": "create unique index \"ai_agent_prompt_overrides_tenant_org_agent_version_uq\" on \"ai_agent_prompt_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\", \"version\") where \"organization_id\" is not null"
414
414
  }
415
415
  ],
416
416
  "checks": [],
417
417
  "foreignKeys": {},
418
- "nativeEnums": {}
418
+ "comment": null
419
419
  },
420
420
  {
421
+ "name": "ai_agent_runtime_overrides",
422
+ "schema": "public",
421
423
  "columns": {
422
- "id": {
423
- "name": "id",
424
- "type": "uuid",
424
+ "agent_id": {
425
+ "name": "agent_id",
426
+ "type": "varchar(128)",
425
427
  "unsigned": false,
426
428
  "autoincrement": false,
427
- "primary": true,
428
- "nullable": false,
429
+ "primary": false,
430
+ "nullable": true,
429
431
  "unique": false,
430
- "length": null,
432
+ "length": 128,
431
433
  "precision": null,
432
434
  "scale": null,
433
- "default": "gen_random_uuid()",
435
+ "default": null,
434
436
  "comment": null,
435
437
  "enumItems": [],
436
- "mappedType": "uuid"
438
+ "mappedType": "string"
437
439
  },
438
- "tenant_id": {
439
- "name": "tenant_id",
440
- "type": "uuid",
440
+ "allowed_override_models_by_provider": {
441
+ "name": "allowed_override_models_by_provider",
442
+ "type": "jsonb",
441
443
  "unsigned": false,
442
444
  "autoincrement": false,
443
445
  "primary": false,
@@ -446,14 +448,14 @@
446
448
  "length": null,
447
449
  "precision": null,
448
450
  "scale": null,
449
- "default": null,
451
+ "default": "'{}'",
450
452
  "comment": null,
451
453
  "enumItems": [],
452
- "mappedType": "uuid"
454
+ "mappedType": "json"
453
455
  },
454
- "organization_id": {
455
- "name": "organization_id",
456
- "type": "uuid",
456
+ "allowed_override_providers": {
457
+ "name": "allowed_override_providers",
458
+ "type": "jsonb",
457
459
  "unsigned": false,
458
460
  "autoincrement": false,
459
461
  "primary": false,
@@ -465,47 +467,418 @@
465
467
  "default": null,
466
468
  "comment": null,
467
469
  "enumItems": [],
468
- "mappedType": "uuid"
470
+ "mappedType": "json"
469
471
  },
470
- "agent_id": {
471
- "name": "agent_id",
472
- "type": "text",
472
+ "base_url": {
473
+ "name": "base_url",
474
+ "type": "varchar(2048)",
473
475
  "unsigned": false,
474
476
  "autoincrement": false,
475
477
  "primary": false,
476
- "nullable": false,
478
+ "nullable": true,
477
479
  "unique": false,
478
- "length": null,
480
+ "length": 2048,
479
481
  "precision": null,
480
482
  "scale": null,
481
483
  "default": null,
482
484
  "comment": null,
483
485
  "enumItems": [],
484
- "mappedType": "text"
486
+ "mappedType": "string"
485
487
  },
486
- "tool_name": {
487
- "name": "tool_name",
488
- "type": "text",
488
+ "created_at": {
489
+ "name": "created_at",
490
+ "type": "timestamptz(6)",
489
491
  "unsigned": false,
490
492
  "autoincrement": false,
491
493
  "primary": false,
492
494
  "nullable": false,
493
495
  "unique": false,
494
- "length": null,
496
+ "length": 6,
495
497
  "precision": null,
496
498
  "scale": null,
497
499
  "default": null,
498
500
  "comment": null,
499
501
  "enumItems": [],
500
- "mappedType": "text"
502
+ "mappedType": "datetime"
501
503
  },
502
- "conversation_id": {
504
+ "deleted_at": {
505
+ "name": "deleted_at",
506
+ "type": "timestamptz(6)",
507
+ "unsigned": false,
508
+ "autoincrement": false,
509
+ "primary": false,
510
+ "nullable": true,
511
+ "unique": false,
512
+ "length": 6,
513
+ "precision": null,
514
+ "scale": null,
515
+ "default": null,
516
+ "comment": null,
517
+ "enumItems": [],
518
+ "mappedType": "datetime"
519
+ },
520
+ "id": {
521
+ "name": "id",
522
+ "type": "uuid",
523
+ "unsigned": false,
524
+ "autoincrement": false,
525
+ "primary": true,
526
+ "nullable": false,
527
+ "unique": false,
528
+ "length": null,
529
+ "precision": null,
530
+ "scale": null,
531
+ "default": "gen_random_uuid()",
532
+ "comment": null,
533
+ "enumItems": [],
534
+ "mappedType": "uuid"
535
+ },
536
+ "model_id": {
537
+ "name": "model_id",
538
+ "type": "varchar(256)",
539
+ "unsigned": false,
540
+ "autoincrement": false,
541
+ "primary": false,
542
+ "nullable": true,
543
+ "unique": false,
544
+ "length": 256,
545
+ "precision": null,
546
+ "scale": null,
547
+ "default": null,
548
+ "comment": null,
549
+ "enumItems": [],
550
+ "mappedType": "string"
551
+ },
552
+ "organization_id": {
553
+ "name": "organization_id",
554
+ "type": "uuid",
555
+ "unsigned": false,
556
+ "autoincrement": false,
557
+ "primary": false,
558
+ "nullable": true,
559
+ "unique": false,
560
+ "length": null,
561
+ "precision": null,
562
+ "scale": null,
563
+ "default": null,
564
+ "comment": null,
565
+ "enumItems": [],
566
+ "mappedType": "uuid"
567
+ },
568
+ "provider_id": {
569
+ "name": "provider_id",
570
+ "type": "varchar(64)",
571
+ "unsigned": false,
572
+ "autoincrement": false,
573
+ "primary": false,
574
+ "nullable": true,
575
+ "unique": false,
576
+ "length": 64,
577
+ "precision": null,
578
+ "scale": null,
579
+ "default": null,
580
+ "comment": null,
581
+ "enumItems": [],
582
+ "mappedType": "string"
583
+ },
584
+ "tenant_id": {
585
+ "name": "tenant_id",
586
+ "type": "uuid",
587
+ "unsigned": false,
588
+ "autoincrement": false,
589
+ "primary": false,
590
+ "nullable": false,
591
+ "unique": false,
592
+ "length": null,
593
+ "precision": null,
594
+ "scale": null,
595
+ "default": null,
596
+ "comment": null,
597
+ "enumItems": [],
598
+ "mappedType": "uuid"
599
+ },
600
+ "updated_at": {
601
+ "name": "updated_at",
602
+ "type": "timestamptz(6)",
603
+ "unsigned": false,
604
+ "autoincrement": false,
605
+ "primary": false,
606
+ "nullable": false,
607
+ "unique": false,
608
+ "length": 6,
609
+ "precision": null,
610
+ "scale": null,
611
+ "default": null,
612
+ "comment": null,
613
+ "enumItems": [],
614
+ "mappedType": "datetime"
615
+ },
616
+ "updated_by_user_id": {
617
+ "name": "updated_by_user_id",
618
+ "type": "uuid",
619
+ "unsigned": false,
620
+ "autoincrement": false,
621
+ "primary": false,
622
+ "nullable": true,
623
+ "unique": false,
624
+ "length": null,
625
+ "precision": null,
626
+ "scale": null,
627
+ "default": null,
628
+ "comment": null,
629
+ "enumItems": [],
630
+ "mappedType": "uuid"
631
+ }
632
+ },
633
+ "indexes": [
634
+ {
635
+ "columnNames": [
636
+ "id"
637
+ ],
638
+ "composite": false,
639
+ "constraint": true,
640
+ "keyName": "ai_agent_runtime_overrides_pkey",
641
+ "primary": true,
642
+ "unique": true
643
+ },
644
+ {
645
+ "columnNames": [],
646
+ "composite": false,
647
+ "constraint": false,
648
+ "keyName": "ai_agent_runtime_overrides_tenant_agent_null_org_uq",
649
+ "primary": false,
650
+ "unique": false,
651
+ "expression": "create unique index \"ai_agent_runtime_overrides_tenant_agent_null_org_uq\" on \"ai_agent_runtime_overrides\" (\"tenant_id\", \"agent_id\") where \"deleted_at\" is null and \"organization_id\" is null and \"agent_id\" is not null"
652
+ },
653
+ {
654
+ "columnNames": [
655
+ "tenant_id"
656
+ ],
657
+ "composite": false,
658
+ "constraint": false,
659
+ "keyName": "ai_agent_runtime_overrides_tenant_idx",
660
+ "primary": false,
661
+ "unique": false
662
+ },
663
+ {
664
+ "columnNames": [],
665
+ "composite": false,
666
+ "constraint": false,
667
+ "keyName": "ai_agent_runtime_overrides_tenant_null_agent_null_org_uq",
668
+ "primary": false,
669
+ "unique": false,
670
+ "expression": "create unique index \"ai_agent_runtime_overrides_tenant_null_agent_null_org_uq\" on \"ai_agent_runtime_overrides\" (\"tenant_id\") where \"deleted_at\" is null and \"organization_id\" is null and \"agent_id\" is null"
671
+ },
672
+ {
673
+ "columnNames": [],
674
+ "composite": false,
675
+ "constraint": false,
676
+ "keyName": "ai_agent_runtime_overrides_tenant_org_agent_uq",
677
+ "primary": false,
678
+ "unique": false,
679
+ "expression": "create unique index \"ai_agent_runtime_overrides_tenant_org_agent_uq\" on \"ai_agent_runtime_overrides\" (\"tenant_id\", \"organization_id\", \"agent_id\") where \"deleted_at\" is null and \"organization_id\" is not null and \"agent_id\" is not null"
680
+ },
681
+ {
682
+ "columnNames": [],
683
+ "composite": false,
684
+ "constraint": false,
685
+ "keyName": "ai_agent_runtime_overrides_tenant_org_null_agent_uq",
686
+ "primary": false,
687
+ "unique": false,
688
+ "expression": "create unique index \"ai_agent_runtime_overrides_tenant_org_null_agent_uq\" on \"ai_agent_runtime_overrides\" (\"tenant_id\", \"organization_id\") where \"deleted_at\" is null and \"organization_id\" is not null and \"agent_id\" is null"
689
+ }
690
+ ],
691
+ "checks": [],
692
+ "foreignKeys": {},
693
+ "comment": null
694
+ },
695
+ {
696
+ "name": "ai_pending_actions",
697
+ "schema": "public",
698
+ "columns": {
699
+ "agent_id": {
700
+ "name": "agent_id",
701
+ "type": "text",
702
+ "unsigned": false,
703
+ "autoincrement": false,
704
+ "primary": false,
705
+ "nullable": false,
706
+ "unique": false,
707
+ "length": null,
708
+ "precision": null,
709
+ "scale": null,
710
+ "default": null,
711
+ "comment": null,
712
+ "enumItems": [],
713
+ "mappedType": "text"
714
+ },
715
+ "attachment_ids": {
716
+ "name": "attachment_ids",
717
+ "type": "jsonb",
718
+ "unsigned": false,
719
+ "autoincrement": false,
720
+ "primary": false,
721
+ "nullable": false,
722
+ "unique": false,
723
+ "length": null,
724
+ "precision": null,
725
+ "scale": null,
726
+ "default": "'[]'",
727
+ "comment": null,
728
+ "enumItems": [],
729
+ "mappedType": "json"
730
+ },
731
+ "conversation_id": {
503
732
  "name": "conversation_id",
504
733
  "type": "text",
505
734
  "unsigned": false,
506
735
  "autoincrement": false,
507
736
  "primary": false,
508
- "nullable": true,
737
+ "nullable": true,
738
+ "unique": false,
739
+ "length": null,
740
+ "precision": null,
741
+ "scale": null,
742
+ "default": null,
743
+ "comment": null,
744
+ "enumItems": [],
745
+ "mappedType": "text"
746
+ },
747
+ "created_at": {
748
+ "name": "created_at",
749
+ "type": "timestamptz(6)",
750
+ "unsigned": false,
751
+ "autoincrement": false,
752
+ "primary": false,
753
+ "nullable": false,
754
+ "unique": false,
755
+ "length": 6,
756
+ "precision": null,
757
+ "scale": null,
758
+ "default": null,
759
+ "comment": null,
760
+ "enumItems": [],
761
+ "mappedType": "datetime"
762
+ },
763
+ "created_by_user_id": {
764
+ "name": "created_by_user_id",
765
+ "type": "uuid",
766
+ "unsigned": false,
767
+ "autoincrement": false,
768
+ "primary": false,
769
+ "nullable": false,
770
+ "unique": false,
771
+ "length": null,
772
+ "precision": null,
773
+ "scale": null,
774
+ "default": null,
775
+ "comment": null,
776
+ "enumItems": [],
777
+ "mappedType": "uuid"
778
+ },
779
+ "execution_result": {
780
+ "name": "execution_result",
781
+ "type": "jsonb",
782
+ "unsigned": false,
783
+ "autoincrement": false,
784
+ "primary": false,
785
+ "nullable": true,
786
+ "unique": false,
787
+ "length": null,
788
+ "precision": null,
789
+ "scale": null,
790
+ "default": null,
791
+ "comment": null,
792
+ "enumItems": [],
793
+ "mappedType": "json"
794
+ },
795
+ "expires_at": {
796
+ "name": "expires_at",
797
+ "type": "timestamptz(6)",
798
+ "unsigned": false,
799
+ "autoincrement": false,
800
+ "primary": false,
801
+ "nullable": false,
802
+ "unique": false,
803
+ "length": 6,
804
+ "precision": null,
805
+ "scale": null,
806
+ "default": null,
807
+ "comment": null,
808
+ "enumItems": [],
809
+ "mappedType": "datetime"
810
+ },
811
+ "failed_records": {
812
+ "name": "failed_records",
813
+ "type": "jsonb",
814
+ "unsigned": false,
815
+ "autoincrement": false,
816
+ "primary": false,
817
+ "nullable": true,
818
+ "unique": false,
819
+ "length": null,
820
+ "precision": null,
821
+ "scale": null,
822
+ "default": null,
823
+ "comment": null,
824
+ "enumItems": [],
825
+ "mappedType": "json"
826
+ },
827
+ "field_diff": {
828
+ "name": "field_diff",
829
+ "type": "jsonb",
830
+ "unsigned": false,
831
+ "autoincrement": false,
832
+ "primary": false,
833
+ "nullable": false,
834
+ "unique": false,
835
+ "length": null,
836
+ "precision": null,
837
+ "scale": null,
838
+ "default": "'[]'",
839
+ "comment": null,
840
+ "enumItems": [],
841
+ "mappedType": "json"
842
+ },
843
+ "id": {
844
+ "name": "id",
845
+ "type": "uuid",
846
+ "unsigned": false,
847
+ "autoincrement": false,
848
+ "primary": true,
849
+ "nullable": false,
850
+ "unique": false,
851
+ "length": null,
852
+ "precision": null,
853
+ "scale": null,
854
+ "default": "gen_random_uuid()",
855
+ "comment": null,
856
+ "enumItems": [],
857
+ "mappedType": "uuid"
858
+ },
859
+ "idempotency_key": {
860
+ "name": "idempotency_key",
861
+ "type": "text",
862
+ "unsigned": false,
863
+ "autoincrement": false,
864
+ "primary": false,
865
+ "nullable": false,
866
+ "unique": false,
867
+ "length": null,
868
+ "precision": null,
869
+ "scale": null,
870
+ "default": null,
871
+ "comment": null,
872
+ "enumItems": [],
873
+ "mappedType": "text"
874
+ },
875
+ "normalized_input": {
876
+ "name": "normalized_input",
877
+ "type": "jsonb",
878
+ "unsigned": false,
879
+ "autoincrement": false,
880
+ "primary": false,
881
+ "nullable": false,
509
882
  "unique": false,
510
883
  "length": null,
511
884
  "precision": null,
@@ -513,11 +886,11 @@
513
886
  "default": null,
514
887
  "comment": null,
515
888
  "enumItems": [],
516
- "mappedType": "text"
889
+ "mappedType": "json"
517
890
  },
518
- "target_entity_type": {
519
- "name": "target_entity_type",
520
- "type": "text",
891
+ "organization_id": {
892
+ "name": "organization_id",
893
+ "type": "uuid",
521
894
  "unsigned": false,
522
895
  "autoincrement": false,
523
896
  "primary": false,
@@ -529,31 +902,31 @@
529
902
  "default": null,
530
903
  "comment": null,
531
904
  "enumItems": [],
532
- "mappedType": "text"
905
+ "mappedType": "uuid"
533
906
  },
534
- "target_record_id": {
535
- "name": "target_record_id",
907
+ "queue_mode": {
908
+ "name": "queue_mode",
536
909
  "type": "text",
537
910
  "unsigned": false,
538
911
  "autoincrement": false,
539
912
  "primary": false,
540
- "nullable": true,
913
+ "nullable": false,
541
914
  "unique": false,
542
915
  "length": null,
543
916
  "precision": null,
544
917
  "scale": null,
545
- "default": null,
918
+ "default": "'inline'",
546
919
  "comment": null,
547
920
  "enumItems": [],
548
921
  "mappedType": "text"
549
922
  },
550
- "normalized_input": {
551
- "name": "normalized_input",
552
- "type": "jsonb",
923
+ "record_version": {
924
+ "name": "record_version",
925
+ "type": "text",
553
926
  "unsigned": false,
554
927
  "autoincrement": false,
555
928
  "primary": false,
556
- "nullable": false,
929
+ "nullable": true,
557
930
  "unique": false,
558
931
  "length": null,
559
932
  "precision": null,
@@ -561,43 +934,43 @@
561
934
  "default": null,
562
935
  "comment": null,
563
936
  "enumItems": [],
564
- "mappedType": "json"
937
+ "mappedType": "text"
565
938
  },
566
- "field_diff": {
567
- "name": "field_diff",
939
+ "records": {
940
+ "name": "records",
568
941
  "type": "jsonb",
569
942
  "unsigned": false,
570
943
  "autoincrement": false,
571
944
  "primary": false,
572
- "nullable": false,
945
+ "nullable": true,
573
946
  "unique": false,
574
947
  "length": null,
575
948
  "precision": null,
576
949
  "scale": null,
577
- "default": "'[]'",
950
+ "default": null,
578
951
  "comment": null,
579
952
  "enumItems": [],
580
953
  "mappedType": "json"
581
954
  },
582
- "records": {
583
- "name": "records",
584
- "type": "jsonb",
955
+ "resolved_at": {
956
+ "name": "resolved_at",
957
+ "type": "timestamptz(6)",
585
958
  "unsigned": false,
586
959
  "autoincrement": false,
587
960
  "primary": false,
588
961
  "nullable": true,
589
962
  "unique": false,
590
- "length": null,
963
+ "length": 6,
591
964
  "precision": null,
592
965
  "scale": null,
593
966
  "default": null,
594
967
  "comment": null,
595
968
  "enumItems": [],
596
- "mappedType": "json"
969
+ "mappedType": "datetime"
597
970
  },
598
- "failed_records": {
599
- "name": "failed_records",
600
- "type": "jsonb",
971
+ "resolved_by_user_id": {
972
+ "name": "resolved_by_user_id",
973
+ "type": "uuid",
601
974
  "unsigned": false,
602
975
  "autoincrement": false,
603
976
  "primary": false,
@@ -609,7 +982,7 @@
609
982
  "default": null,
610
983
  "comment": null,
611
984
  "enumItems": [],
612
- "mappedType": "json"
985
+ "mappedType": "uuid"
613
986
  },
614
987
  "side_effects_summary": {
615
988
  "name": "side_effects_summary",
@@ -627,13 +1000,13 @@
627
1000
  "enumItems": [],
628
1001
  "mappedType": "text"
629
1002
  },
630
- "record_version": {
631
- "name": "record_version",
1003
+ "status": {
1004
+ "name": "status",
632
1005
  "type": "text",
633
1006
  "unsigned": false,
634
1007
  "autoincrement": false,
635
1008
  "primary": false,
636
- "nullable": true,
1009
+ "nullable": false,
637
1010
  "unique": false,
638
1011
  "length": null,
639
1012
  "precision": null,
@@ -643,29 +1016,29 @@
643
1016
  "enumItems": [],
644
1017
  "mappedType": "text"
645
1018
  },
646
- "attachment_ids": {
647
- "name": "attachment_ids",
648
- "type": "jsonb",
1019
+ "target_entity_type": {
1020
+ "name": "target_entity_type",
1021
+ "type": "text",
649
1022
  "unsigned": false,
650
1023
  "autoincrement": false,
651
1024
  "primary": false,
652
- "nullable": false,
1025
+ "nullable": true,
653
1026
  "unique": false,
654
1027
  "length": null,
655
1028
  "precision": null,
656
1029
  "scale": null,
657
- "default": "'[]'",
1030
+ "default": null,
658
1031
  "comment": null,
659
1032
  "enumItems": [],
660
- "mappedType": "json"
1033
+ "mappedType": "text"
661
1034
  },
662
- "idempotency_key": {
663
- "name": "idempotency_key",
1035
+ "target_record_id": {
1036
+ "name": "target_record_id",
664
1037
  "type": "text",
665
1038
  "unsigned": false,
666
1039
  "autoincrement": false,
667
1040
  "primary": false,
668
- "nullable": false,
1041
+ "nullable": true,
669
1042
  "unique": false,
670
1043
  "length": null,
671
1044
  "precision": null,
@@ -675,8 +1048,8 @@
675
1048
  "enumItems": [],
676
1049
  "mappedType": "text"
677
1050
  },
678
- "created_by_user_id": {
679
- "name": "created_by_user_id",
1051
+ "tenant_id": {
1052
+ "name": "tenant_id",
680
1053
  "type": "uuid",
681
1054
  "unsigned": false,
682
1055
  "autoincrement": false,
@@ -691,8 +1064,8 @@
691
1064
  "enumItems": [],
692
1065
  "mappedType": "uuid"
693
1066
  },
694
- "status": {
695
- "name": "status",
1067
+ "tool_name": {
1068
+ "name": "tool_name",
696
1069
  "type": "text",
697
1070
  "unsigned": false,
698
1071
  "autoincrement": false,
@@ -706,10 +1079,75 @@
706
1079
  "comment": null,
707
1080
  "enumItems": [],
708
1081
  "mappedType": "text"
1082
+ }
1083
+ },
1084
+ "indexes": [
1085
+ {
1086
+ "columnNames": [
1087
+ "id"
1088
+ ],
1089
+ "composite": false,
1090
+ "constraint": true,
1091
+ "keyName": "ai_pending_actions_pkey",
1092
+ "primary": true,
1093
+ "unique": true
709
1094
  },
710
- "queue_mode": {
711
- "name": "queue_mode",
712
- "type": "text",
1095
+ {
1096
+ "columnNames": [],
1097
+ "composite": false,
1098
+ "constraint": false,
1099
+ "keyName": "ai_pending_actions_tenant_idem_null_org_uq",
1100
+ "primary": false,
1101
+ "unique": false,
1102
+ "expression": "create unique index \"ai_pending_actions_tenant_idem_null_org_uq\" on \"ai_pending_actions\" (\"tenant_id\", \"idempotency_key\") where \"organization_id\" is null"
1103
+ },
1104
+ {
1105
+ "columnNames": [
1106
+ "tenant_id",
1107
+ "organization_id",
1108
+ "agent_id",
1109
+ "status"
1110
+ ],
1111
+ "composite": true,
1112
+ "constraint": false,
1113
+ "keyName": "ai_pending_actions_tenant_org_agent_status_idx",
1114
+ "primary": false,
1115
+ "unique": false
1116
+ },
1117
+ {
1118
+ "columnNames": [],
1119
+ "composite": false,
1120
+ "constraint": false,
1121
+ "keyName": "ai_pending_actions_tenant_org_idempotency_uq",
1122
+ "primary": false,
1123
+ "unique": false,
1124
+ "expression": "create unique index \"ai_pending_actions_tenant_org_idempotency_uq\" on \"ai_pending_actions\" (\"tenant_id\", \"organization_id\", \"idempotency_key\") where \"organization_id\" is not null"
1125
+ },
1126
+ {
1127
+ "columnNames": [
1128
+ "tenant_id",
1129
+ "organization_id",
1130
+ "status",
1131
+ "expires_at"
1132
+ ],
1133
+ "composite": true,
1134
+ "constraint": false,
1135
+ "keyName": "ai_pending_actions_tenant_org_status_expires_idx",
1136
+ "primary": false,
1137
+ "unique": false
1138
+ }
1139
+ ],
1140
+ "checks": [],
1141
+ "foreignKeys": {},
1142
+ "comment": null
1143
+ },
1144
+ {
1145
+ "name": "ai_tenant_model_allowlists",
1146
+ "schema": "public",
1147
+ "columns": {
1148
+ "allowed_models_by_provider": {
1149
+ "name": "allowed_models_by_provider",
1150
+ "type": "jsonb",
713
1151
  "unsigned": false,
714
1152
  "autoincrement": false,
715
1153
  "primary": false,
@@ -718,13 +1156,13 @@
718
1156
  "length": null,
719
1157
  "precision": null,
720
1158
  "scale": null,
721
- "default": "'inline'",
1159
+ "default": "'{}'",
722
1160
  "comment": null,
723
1161
  "enumItems": [],
724
- "mappedType": "text"
1162
+ "mappedType": "json"
725
1163
  },
726
- "execution_result": {
727
- "name": "execution_result",
1164
+ "allowed_providers": {
1165
+ "name": "allowed_providers",
728
1166
  "type": "jsonb",
729
1167
  "unsigned": false,
730
1168
  "autoincrement": false,
@@ -741,7 +1179,7 @@
741
1179
  },
742
1180
  "created_at": {
743
1181
  "name": "created_at",
744
- "type": "timestamptz",
1182
+ "type": "timestamptz(6)",
745
1183
  "unsigned": false,
746
1184
  "autoincrement": false,
747
1185
  "primary": false,
@@ -755,13 +1193,13 @@
755
1193
  "enumItems": [],
756
1194
  "mappedType": "datetime"
757
1195
  },
758
- "expires_at": {
759
- "name": "expires_at",
760
- "type": "timestamptz",
1196
+ "deleted_at": {
1197
+ "name": "deleted_at",
1198
+ "type": "timestamptz(6)",
761
1199
  "unsigned": false,
762
1200
  "autoincrement": false,
763
1201
  "primary": false,
764
- "nullable": false,
1202
+ "nullable": true,
765
1203
  "unique": false,
766
1204
  "length": 6,
767
1205
  "precision": null,
@@ -771,14 +1209,62 @@
771
1209
  "enumItems": [],
772
1210
  "mappedType": "datetime"
773
1211
  },
774
- "resolved_at": {
775
- "name": "resolved_at",
776
- "type": "timestamptz",
1212
+ "id": {
1213
+ "name": "id",
1214
+ "type": "uuid",
1215
+ "unsigned": false,
1216
+ "autoincrement": false,
1217
+ "primary": true,
1218
+ "nullable": false,
1219
+ "unique": false,
1220
+ "length": null,
1221
+ "precision": null,
1222
+ "scale": null,
1223
+ "default": "gen_random_uuid()",
1224
+ "comment": null,
1225
+ "enumItems": [],
1226
+ "mappedType": "uuid"
1227
+ },
1228
+ "organization_id": {
1229
+ "name": "organization_id",
1230
+ "type": "uuid",
777
1231
  "unsigned": false,
778
1232
  "autoincrement": false,
779
1233
  "primary": false,
780
1234
  "nullable": true,
781
1235
  "unique": false,
1236
+ "length": null,
1237
+ "precision": null,
1238
+ "scale": null,
1239
+ "default": null,
1240
+ "comment": null,
1241
+ "enumItems": [],
1242
+ "mappedType": "uuid"
1243
+ },
1244
+ "tenant_id": {
1245
+ "name": "tenant_id",
1246
+ "type": "uuid",
1247
+ "unsigned": false,
1248
+ "autoincrement": false,
1249
+ "primary": false,
1250
+ "nullable": false,
1251
+ "unique": false,
1252
+ "length": null,
1253
+ "precision": null,
1254
+ "scale": null,
1255
+ "default": null,
1256
+ "comment": null,
1257
+ "enumItems": [],
1258
+ "mappedType": "uuid"
1259
+ },
1260
+ "updated_at": {
1261
+ "name": "updated_at",
1262
+ "type": "timestamptz(6)",
1263
+ "unsigned": false,
1264
+ "autoincrement": false,
1265
+ "primary": false,
1266
+ "nullable": false,
1267
+ "unique": false,
782
1268
  "length": 6,
783
1269
  "precision": null,
784
1270
  "scale": null,
@@ -787,8 +1273,8 @@
787
1273
  "enumItems": [],
788
1274
  "mappedType": "datetime"
789
1275
  },
790
- "resolved_by_user_id": {
791
- "name": "resolved_by_user_id",
1276
+ "updated_by_user_id": {
1277
+ "name": "updated_by_user_id",
792
1278
  "type": "uuid",
793
1279
  "unsigned": false,
794
1280
  "autoincrement": false,
@@ -804,68 +1290,51 @@
804
1290
  "mappedType": "uuid"
805
1291
  }
806
1292
  },
807
- "name": "ai_pending_actions",
808
- "schema": "public",
809
1293
  "indexes": [
810
1294
  {
811
- "keyName": "ai_pending_actions_tenant_org_agent_status_idx",
812
1295
  "columnNames": [
813
- "tenant_id",
814
- "organization_id",
815
- "agent_id",
816
- "status"
1296
+ "id"
817
1297
  ],
818
- "composite": true,
819
- "constraint": false,
820
- "primary": false,
821
- "unique": false
1298
+ "composite": false,
1299
+ "constraint": true,
1300
+ "keyName": "ai_tenant_model_allowlists_pkey",
1301
+ "primary": true,
1302
+ "unique": true
822
1303
  },
823
1304
  {
824
- "keyName": "ai_pending_actions_tenant_org_status_expires_idx",
825
1305
  "columnNames": [
826
- "tenant_id",
827
- "organization_id",
828
- "status",
829
- "expires_at"
1306
+ "tenant_id"
830
1307
  ],
831
- "composite": true,
1308
+ "composite": false,
832
1309
  "constraint": false,
1310
+ "keyName": "ai_tenant_model_allowlists_tenant_idx",
833
1311
  "primary": false,
834
1312
  "unique": false
835
1313
  },
836
1314
  {
837
- "keyName": "ai_pending_actions_tenant_org_idempotency_uq",
838
1315
  "columnNames": [],
839
1316
  "composite": false,
840
1317
  "constraint": false,
1318
+ "keyName": "ai_tenant_model_allowlists_tenant_null_org_uq",
841
1319
  "primary": false,
842
1320
  "unique": false,
843
- "expression": "create unique index \"ai_pending_actions_tenant_org_idempotency_uq\" on \"ai_pending_actions\" (\"tenant_id\", \"organization_id\", \"idempotency_key\") where \"organization_id\" is not null"
1321
+ "expression": "create unique index \"ai_tenant_model_allowlists_tenant_null_org_uq\" on \"ai_tenant_model_allowlists\" (\"tenant_id\") where \"deleted_at\" is null and \"organization_id\" is null"
844
1322
  },
845
1323
  {
846
- "keyName": "ai_pending_actions_tenant_idem_null_org_uq",
847
1324
  "columnNames": [],
848
1325
  "composite": false,
849
1326
  "constraint": false,
1327
+ "keyName": "ai_tenant_model_allowlists_tenant_org_uq",
850
1328
  "primary": false,
851
1329
  "unique": false,
852
- "expression": "create unique index \"ai_pending_actions_tenant_idem_null_org_uq\" on \"ai_pending_actions\" (\"tenant_id\", \"idempotency_key\") where \"organization_id\" is null"
853
- },
854
- {
855
- "keyName": "ai_pending_actions_pkey",
856
- "columnNames": [
857
- "id"
858
- ],
859
- "composite": false,
860
- "constraint": true,
861
- "primary": true,
862
- "unique": true
1330
+ "expression": "create unique index \"ai_tenant_model_allowlists_tenant_org_uq\" on \"ai_tenant_model_allowlists\" (\"tenant_id\", \"organization_id\") where \"deleted_at\" is null and \"organization_id\" is not null"
863
1331
  }
864
1332
  ],
865
1333
  "checks": [],
866
1334
  "foreignKeys": {},
867
- "nativeEnums": {}
1335
+ "comment": null
868
1336
  }
869
1337
  ],
1338
+ "views": [],
870
1339
  "nativeEnums": {}
871
- }
1340
+ }