@inkeep/agents-core 0.79.0 → 0.80.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 (49) hide show
  1. package/dist/auth/auth-schema.d.ts +227 -227
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.js +1 -1
  4. package/dist/auth/permissions.d.ts +9 -9
  5. package/dist/data-access/index.d.ts +2 -1
  6. package/dist/data-access/index.js +2 -1
  7. package/dist/data-access/manage/agents.d.ts +20 -20
  8. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  9. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  10. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  11. package/dist/data-access/manage/functionTools.d.ts +16 -16
  12. package/dist/data-access/manage/skills.d.ts +12 -12
  13. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  14. package/dist/data-access/manage/subAgentRelations.d.ts +32 -32
  15. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  16. package/dist/data-access/manage/subAgents.d.ts +12 -12
  17. package/dist/data-access/manage/tools.d.ts +24 -24
  18. package/dist/data-access/manage/tools.js +33 -8
  19. package/dist/data-access/manage/triggers.d.ts +4 -4
  20. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  21. package/dist/data-access/runtime/apps.d.ts +17 -17
  22. package/dist/data-access/runtime/conversations.d.ts +32 -32
  23. package/dist/data-access/runtime/evalRuns.d.ts +5 -0
  24. package/dist/data-access/runtime/evalRuns.js +3 -0
  25. package/dist/data-access/runtime/events.d.ts +4 -4
  26. package/dist/data-access/runtime/feedback.d.ts +8 -8
  27. package/dist/data-access/runtime/feedback.js +2 -2
  28. package/dist/data-access/runtime/messages.d.ts +27 -27
  29. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +5 -5
  30. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +2 -2
  31. package/dist/data-access/runtime/tasks.d.ts +6 -6
  32. package/dist/data-access/runtime/toolApprovalDecisions.d.ts +37 -0
  33. package/dist/data-access/runtime/toolApprovalDecisions.js +76 -0
  34. package/dist/db/manage/manage-schema.d.ts +506 -506
  35. package/dist/db/runtime/runtime-schema.d.ts +602 -454
  36. package/dist/db/runtime/runtime-schema.js +30 -1
  37. package/dist/index.d.ts +3 -2
  38. package/dist/index.js +3 -2
  39. package/dist/utils/json-schema-walk.d.ts +50 -0
  40. package/dist/utils/json-schema-walk.js +202 -0
  41. package/dist/utils/mcp-client.js +14 -32
  42. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  43. package/dist/validation/schemas/skills.d.ts +45 -45
  44. package/dist/validation/schemas.d.ts +2248 -2247
  45. package/dist/validation/schemas.js +1 -0
  46. package/drizzle/runtime/0044_productive_bromley.sql +12 -0
  47. package/drizzle/runtime/meta/0044_snapshot.json +6386 -0
  48. package/drizzle/runtime/meta/_journal.json +7 -0
  49. package/package.json +5 -1
@@ -10,12 +10,12 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
10
10
  relationId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- createdAt: string;
14
- updatedAt: string;
15
- projectId: string;
16
13
  tenantId: string;
14
+ createdAt: string;
17
15
  agentId: string;
16
+ projectId: string;
18
17
  subAgentId: string;
18
+ updatedAt: string;
19
19
  headers: Record<string, string> | null;
20
20
  externalAgentId: string;
21
21
  } | undefined>;
@@ -45,12 +45,12 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
47
  id: string;
48
- createdAt: string;
49
- updatedAt: string;
50
- projectId: string;
51
48
  tenantId: string;
49
+ createdAt: string;
52
50
  agentId: string;
51
+ projectId: string;
53
52
  subAgentId: string;
53
+ updatedAt: string;
54
54
  headers: Record<string, string> | null;
55
55
  externalAgentId: string;
56
56
  }[]>;
@@ -58,12 +58,12 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
60
  id: string;
61
- createdAt: string;
62
- updatedAt: string;
63
- projectId: string;
64
61
  tenantId: string;
62
+ createdAt: string;
65
63
  agentId: string;
64
+ projectId: string;
66
65
  subAgentId: string;
66
+ updatedAt: string;
67
67
  headers: Record<string, string> | null;
68
68
  externalAgentId: string;
69
69
  }[]>;
@@ -187,12 +187,12 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
187
187
  };
188
188
  }) => Promise<{
189
189
  id: string;
190
- createdAt: string;
191
- updatedAt: string;
192
- projectId: string;
193
190
  tenantId: string;
191
+ createdAt: string;
194
192
  agentId: string;
193
+ projectId: string;
195
194
  subAgentId: string;
195
+ updatedAt: string;
196
196
  headers: Record<string, string> | null;
197
197
  externalAgentId: string;
198
198
  }>;
@@ -204,12 +204,12 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
204
204
  externalAgentId: string;
205
205
  }) => Promise<{
206
206
  id: string;
207
- createdAt: string;
208
- updatedAt: string;
209
- projectId: string;
210
207
  tenantId: string;
208
+ createdAt: string;
211
209
  agentId: string;
210
+ projectId: string;
212
211
  subAgentId: string;
212
+ updatedAt: string;
213
213
  headers: Record<string, string> | null;
214
214
  externalAgentId: string;
215
215
  } | undefined>;
@@ -225,12 +225,12 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
225
225
  };
226
226
  }) => Promise<{
227
227
  id: string;
228
- createdAt: string;
229
- updatedAt: string;
230
- projectId: string;
231
228
  tenantId: string;
229
+ createdAt: string;
232
230
  agentId: string;
231
+ projectId: string;
233
232
  subAgentId: string;
233
+ updatedAt: string;
234
234
  headers: Record<string, string> | null;
235
235
  externalAgentId: string;
236
236
  }>;
@@ -10,14 +10,14 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
10
10
  relationId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- createdAt: string;
14
- updatedAt: string;
15
- projectId: string;
16
13
  tenantId: string;
14
+ createdAt: string;
17
15
  agentId: string;
16
+ projectId: string;
17
+ updatedAt: string;
18
+ relationType: string | null;
18
19
  sourceSubAgentId: string;
19
20
  targetSubAgentId: string | null;
20
- relationType: string | null;
21
21
  } | undefined>;
22
22
  declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
23
23
  scopes: AgentScopeConfig;
@@ -45,27 +45,27 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
47
  id: string;
48
- createdAt: string;
49
- updatedAt: string;
50
- projectId: string;
51
48
  tenantId: string;
49
+ createdAt: string;
52
50
  agentId: string;
51
+ projectId: string;
52
+ updatedAt: string;
53
+ relationType: string | null;
53
54
  sourceSubAgentId: string;
54
55
  targetSubAgentId: string | null;
55
- relationType: string | null;
56
56
  }[]>;
57
57
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
60
  id: string;
61
- createdAt: string;
62
- updatedAt: string;
63
- projectId: string;
64
61
  tenantId: string;
62
+ createdAt: string;
65
63
  agentId: string;
64
+ projectId: string;
65
+ updatedAt: string;
66
+ relationType: string | null;
66
67
  sourceSubAgentId: string;
67
68
  targetSubAgentId: string | null;
68
- relationType: string | null;
69
69
  }[]>;
70
70
  declare const getAgentRelationsBySource: (db: AgentsManageDatabaseClient) => (params: {
71
71
  scopes: AgentScopeConfig;
@@ -127,14 +127,14 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
127
127
  }>;
128
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
129
129
  id: string;
130
- createdAt: string;
131
- updatedAt: string;
132
- projectId: string;
133
130
  tenantId: string;
131
+ createdAt: string;
134
132
  agentId: string;
133
+ projectId: string;
134
+ updatedAt: string;
135
+ relationType: string | null;
135
136
  sourceSubAgentId: string;
136
137
  targetSubAgentId: string | null;
137
- relationType: string | null;
138
138
  }>;
139
139
  /**
140
140
  * Check if sub-agent relation exists by agent, source, target, and relation type
@@ -146,28 +146,28 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
146
146
  relationType: string;
147
147
  }) => Promise<{
148
148
  id: string;
149
- createdAt: string;
150
- updatedAt: string;
151
- projectId: string;
152
149
  tenantId: string;
150
+ createdAt: string;
153
151
  agentId: string;
152
+ projectId: string;
153
+ updatedAt: string;
154
+ relationType: string | null;
154
155
  sourceSubAgentId: string;
155
156
  targetSubAgentId: string | null;
156
- relationType: string | null;
157
157
  } | undefined>;
158
158
  /**
159
159
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
160
160
  */
161
161
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
162
162
  id: string;
163
- createdAt: string;
164
- updatedAt: string;
165
- projectId: string;
166
163
  tenantId: string;
164
+ createdAt: string;
167
165
  agentId: string;
166
+ projectId: string;
167
+ updatedAt: string;
168
+ relationType: string | null;
168
169
  sourceSubAgentId: string;
169
170
  targetSubAgentId: string | null;
170
- relationType: string | null;
171
171
  }>;
172
172
  declare const updateAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
173
173
  scopes: AgentScopeConfig;
@@ -205,18 +205,18 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
205
205
  };
206
206
  }) => Promise<{
207
207
  id: string;
208
- createdAt: string;
209
- updatedAt: string;
210
- projectId: string;
211
208
  tenantId: string;
209
+ createdAt: string;
212
210
  agentId: string;
211
+ projectId: string;
213
212
  subAgentId: string;
214
213
  toolId: string;
214
+ updatedAt: string;
215
215
  headers: Record<string, string> | null;
216
+ selectedTools: string[] | null;
216
217
  toolPolicies: Record<string, {
217
218
  needsApproval?: boolean;
218
219
  }> | null;
219
- selectedTools: string[] | null;
220
220
  }>;
221
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
222
222
  scopes: AgentScopeConfig;
@@ -249,18 +249,18 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
249
249
  relationId: string;
250
250
  }) => Promise<{
251
251
  id: string;
252
- createdAt: string;
253
- updatedAt: string;
254
- projectId: string;
255
252
  tenantId: string;
253
+ createdAt: string;
256
254
  agentId: string;
255
+ projectId: string;
257
256
  subAgentId: string;
258
257
  toolId: string;
258
+ updatedAt: string;
259
259
  headers: Record<string, string> | null;
260
+ selectedTools: string[] | null;
260
261
  toolPolicies: Record<string, {
261
262
  needsApproval?: boolean;
262
263
  }> | null;
263
- selectedTools: string[] | null;
264
264
  } | undefined>;
265
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
266
266
  scopes: SubAgentScopeConfig;
@@ -10,12 +10,12 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
10
10
  relationId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
- createdAt: string;
14
- updatedAt: string;
15
- projectId: string;
16
13
  tenantId: string;
14
+ createdAt: string;
17
15
  agentId: string;
16
+ projectId: string;
18
17
  subAgentId: string;
18
+ updatedAt: string;
19
19
  headers: Record<string, string> | null;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
@@ -45,12 +45,12 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
47
  id: string;
48
- createdAt: string;
49
- updatedAt: string;
50
- projectId: string;
51
48
  tenantId: string;
49
+ createdAt: string;
52
50
  agentId: string;
51
+ projectId: string;
53
52
  subAgentId: string;
53
+ updatedAt: string;
54
54
  headers: Record<string, string> | null;
55
55
  targetAgentId: string;
56
56
  }[]>;
@@ -58,12 +58,12 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
60
  id: string;
61
- createdAt: string;
62
- updatedAt: string;
63
- projectId: string;
64
61
  tenantId: string;
62
+ createdAt: string;
65
63
  agentId: string;
64
+ projectId: string;
66
65
  subAgentId: string;
66
+ updatedAt: string;
67
67
  headers: Record<string, string> | null;
68
68
  targetAgentId: string;
69
69
  }[]>;
@@ -223,12 +223,12 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
223
223
  };
224
224
  }) => Promise<{
225
225
  id: string;
226
- createdAt: string;
227
- updatedAt: string;
228
- projectId: string;
229
226
  tenantId: string;
227
+ createdAt: string;
230
228
  agentId: string;
229
+ projectId: string;
231
230
  subAgentId: string;
231
+ updatedAt: string;
232
232
  headers: Record<string, string> | null;
233
233
  targetAgentId: string;
234
234
  }>;
@@ -240,12 +240,12 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
240
240
  targetAgentId: string;
241
241
  }) => Promise<{
242
242
  id: string;
243
- createdAt: string;
244
- updatedAt: string;
245
- projectId: string;
246
243
  tenantId: string;
244
+ createdAt: string;
247
245
  agentId: string;
246
+ projectId: string;
248
247
  subAgentId: string;
248
+ updatedAt: string;
249
249
  headers: Record<string, string> | null;
250
250
  targetAgentId: string;
251
251
  } | undefined>;
@@ -261,12 +261,12 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
261
261
  };
262
262
  }) => Promise<{
263
263
  id: string;
264
- createdAt: string;
265
- updatedAt: string;
266
- projectId: string;
267
264
  tenantId: string;
265
+ createdAt: string;
268
266
  agentId: string;
267
+ projectId: string;
269
268
  subAgentId: string;
269
+ updatedAt: string;
270
270
  headers: Record<string, string> | null;
271
271
  targetAgentId: string;
272
272
  }>;
@@ -10,12 +10,13 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
+ tenantId: string;
14
+ createdAt: string;
13
15
  name: string;
14
16
  description: string | null;
15
- createdAt: string;
16
- updatedAt: string;
17
+ agentId: string;
17
18
  projectId: string;
18
- tenantId: string;
19
+ updatedAt: string;
19
20
  models: {
20
21
  base?: {
21
22
  model?: string | undefined;
@@ -39,7 +40,6 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
39
40
  stopWhen: {
40
41
  stepCountIs?: number | undefined;
41
42
  } | null;
42
- agentId: string;
43
43
  prompt: string | null;
44
44
  conversationHistoryConfig: ConversationHistoryConfig | null;
45
45
  outputContract: {
@@ -56,12 +56,13 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
56
56
  scopes: AgentScopeConfig;
57
57
  }) => Promise<{
58
58
  id: string;
59
+ tenantId: string;
60
+ createdAt: string;
59
61
  name: string;
60
62
  description: string | null;
61
- createdAt: string;
62
- updatedAt: string;
63
+ agentId: string;
63
64
  projectId: string;
64
- tenantId: string;
65
+ updatedAt: string;
65
66
  models: {
66
67
  base?: {
67
68
  model?: string | undefined;
@@ -85,7 +86,6 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
85
86
  stopWhen: {
86
87
  stepCountIs?: number | undefined;
87
88
  } | null;
88
- agentId: string;
89
89
  prompt: string | null;
90
90
  conversationHistoryConfig: ConversationHistoryConfig | null;
91
91
  outputContract: {
@@ -155,12 +155,13 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
155
155
  }>;
156
156
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
157
157
  id: string;
158
+ tenantId: string;
159
+ createdAt: string;
158
160
  name: string;
159
161
  description: string | null;
160
- createdAt: string;
161
- updatedAt: string;
162
+ agentId: string;
162
163
  projectId: string;
163
- tenantId: string;
164
+ updatedAt: string;
164
165
  models: {
165
166
  base?: {
166
167
  model?: string | undefined;
@@ -184,7 +185,6 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
184
185
  stopWhen: {
185
186
  stepCountIs?: number | undefined;
186
187
  } | null;
187
- agentId: string;
188
188
  prompt: string | null;
189
189
  conversationHistoryConfig: ConversationHistoryConfig | null;
190
190
  outputContract: {
@@ -21,19 +21,19 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
21
21
  toolId: string;
22
22
  }) => Promise<{
23
23
  id: string;
24
+ tenantId: string;
25
+ createdAt: string;
24
26
  name: string;
25
27
  description: string | null;
26
- createdAt: string;
27
- updatedAt: string;
28
28
  projectId: string;
29
- tenantId: string;
30
- headers: Record<string, string> | null;
29
+ updatedAt: string;
31
30
  config: {
32
31
  type: "mcp";
33
32
  mcp: ToolMcpConfig;
34
33
  };
35
34
  credentialReferenceId: string | null;
36
35
  credentialScope: string;
36
+ headers: Record<string, string> | null;
37
37
  imageUrl: string | null;
38
38
  capabilities: ToolServerCapabilities | null;
39
39
  lastError: string | null;
@@ -79,19 +79,19 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
79
79
  }>;
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
81
  id: string;
82
+ tenantId: string;
83
+ createdAt: string;
82
84
  name: string;
83
85
  description: string | null;
84
- createdAt: string;
85
- updatedAt: string;
86
86
  projectId: string;
87
- tenantId: string;
88
- headers: Record<string, string> | null;
87
+ updatedAt: string;
89
88
  config: {
90
89
  type: "mcp";
91
90
  mcp: ToolMcpConfig;
92
91
  };
93
92
  credentialReferenceId: string | null;
94
93
  credentialScope: string;
94
+ headers: Record<string, string> | null;
95
95
  imageUrl: string | null;
96
96
  capabilities: ToolServerCapabilities | null;
97
97
  lastError: string | null;
@@ -136,18 +136,18 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
136
136
  }> | null;
137
137
  }) => Promise<{
138
138
  id: string;
139
- createdAt: string;
140
- updatedAt: string;
141
- projectId: string;
142
139
  tenantId: string;
140
+ createdAt: string;
143
141
  agentId: string;
142
+ projectId: string;
144
143
  subAgentId: string;
145
144
  toolId: string;
145
+ updatedAt: string;
146
146
  headers: Record<string, string> | null;
147
+ selectedTools: string[] | null;
147
148
  toolPolicies: Record<string, {
148
149
  needsApproval?: boolean;
149
150
  }> | null;
150
- selectedTools: string[] | null;
151
151
  }>;
152
152
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
153
153
  scopes: AgentScopeConfig;
@@ -155,18 +155,18 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
155
155
  toolId: string;
156
156
  }) => Promise<{
157
157
  id: string;
158
- createdAt: string;
159
- updatedAt: string;
160
- projectId: string;
161
158
  tenantId: string;
159
+ createdAt: string;
162
160
  agentId: string;
161
+ projectId: string;
163
162
  subAgentId: string;
164
163
  toolId: string;
164
+ updatedAt: string;
165
165
  headers: Record<string, string> | null;
166
+ selectedTools: string[] | null;
166
167
  toolPolicies: Record<string, {
167
168
  needsApproval?: boolean;
168
169
  }> | null;
169
- selectedTools: string[] | null;
170
170
  }>;
171
171
  /**
172
172
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -183,18 +183,18 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
183
183
  relationId?: string;
184
184
  }) => Promise<{
185
185
  id: string;
186
- createdAt: string;
187
- updatedAt: string;
188
- projectId: string;
189
186
  tenantId: string;
187
+ createdAt: string;
190
188
  agentId: string;
189
+ projectId: string;
191
190
  subAgentId: string;
192
191
  toolId: string;
192
+ updatedAt: string;
193
193
  headers: Record<string, string> | null;
194
+ selectedTools: string[] | null;
194
195
  toolPolicies: Record<string, {
195
196
  needsApproval?: boolean;
196
197
  }> | null;
197
- selectedTools: string[] | null;
198
198
  }>;
199
199
  /**
200
200
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -203,19 +203,19 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
203
203
  data: ToolInsert;
204
204
  }) => Promise<{
205
205
  id: string;
206
+ tenantId: string;
207
+ createdAt: string;
206
208
  name: string;
207
209
  description: string | null;
208
- createdAt: string;
209
- updatedAt: string;
210
210
  projectId: string;
211
- tenantId: string;
212
- headers: Record<string, string> | null;
211
+ updatedAt: string;
213
212
  config: {
214
213
  type: "mcp";
215
214
  mcp: ToolMcpConfig;
216
215
  };
217
216
  credentialReferenceId: string | null;
218
217
  credentialScope: string;
218
+ headers: Record<string, string> | null;
219
219
  imageUrl: string | null;
220
220
  capabilities: ToolServerCapabilities | null;
221
221
  lastError: string | null;
@@ -3,6 +3,7 @@ import { CredentialStoreType, MCPServerType, MCPTransportType } from "../../type
3
3
  import { detectAuthenticationRequired } from "../../utils/auth-detection.js";
4
4
  import { env } from "../../env.js";
5
5
  import { getLogger } from "../../utils/logger.js";
6
+ import { convertZodToJsonSchema } from "../../utils/schema-conversion.js";
6
7
  import { configureComposioMCPServer } from "../../utils/third-party-mcp-servers/composio-client.js";
7
8
  import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-servers/third-party-check.js";
8
9
  import { getCredentialStoreLookupKeyFromRetrievalParams } from "../../utils/credential-store-utils.js";
@@ -20,6 +21,7 @@ import { toISODateString } from "../../utils/date.js";
20
21
  import { McpClient } from "../../utils/mcp-client.js";
21
22
  import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "../../utils/work-app-mcp.js";
22
23
  import "../../utils/index.js";
24
+ import { unwrapJsonSchemaWrapper } from "../../utils/json-schema-walk.js";
23
25
  import { isGithubWorkAppTool } from "../runtime/github-work-app-installations.js";
24
26
  import { getCredentialReference, getUserScopedCredentialReference } from "./credentialReferences.js";
25
27
  import { and, count, desc, eq } from "drizzle-orm";
@@ -97,15 +99,38 @@ async function getCredentialExpiresAt(credentialReference, credentialStoreRegist
97
99
  * - parameters (direct) - alternative format
98
100
  * - schema - another possible location
99
101
  */
100
- function extractInputSchema(toolDef, _toolName, _toolOverrides) {
101
- return extractOriginalSchema(toolDef);
102
+ function extractInputSchema(toolDef, toolName, _toolOverrides) {
103
+ return extractOriginalSchema(toolDef, toolName);
102
104
  }
103
- function extractOriginalSchema(toolDef) {
104
- if (toolDef.inputSchema) return toolDef.inputSchema;
105
- if (toolDef.parameters?.properties) return toolDef.parameters.properties;
106
- if (toolDef.parameters && typeof toolDef.parameters === "object") return toolDef.parameters;
107
- if (toolDef.schema) return toolDef.schema;
108
- return {};
105
+ /**
106
+ * Normalize a tool's schema to plain JSON Schema for the manage UI. `McpClient.tools()`
107
+ * builds the schema as a Zod (via `z.fromJSONSchema`) or an AI SDK `jsonSchema()` wrapper;
108
+ * the UI needs JSON Schema so its shared walker can resolve $ref, unwrap nullables, expand
109
+ * union variants, and surface enums. Plain JSON Schema passes through unchanged.
110
+ */
111
+ function toJsonSchemaForDisplay(raw, toolName) {
112
+ if (!raw || typeof raw !== "object") return raw;
113
+ const unwrapped = unwrapJsonSchemaWrapper(raw);
114
+ if (unwrapped !== raw) return unwrapped;
115
+ if (typeof raw.safeParse === "function" || typeof raw.parse === "function") try {
116
+ return convertZodToJsonSchema(raw);
117
+ } catch (error) {
118
+ logger.warn({
119
+ toolName,
120
+ error: error instanceof Error ? error.message : String(error)
121
+ }, "Failed to convert MCP tool schema to JSON Schema; tool will display no parameters");
122
+ return {};
123
+ }
124
+ return raw;
125
+ }
126
+ function extractOriginalSchema(toolDef, toolName) {
127
+ let raw;
128
+ if (toolDef.inputSchema) raw = toolDef.inputSchema;
129
+ else if (toolDef.parameters?.properties) raw = toolDef.parameters.properties;
130
+ else if (toolDef.parameters && typeof toolDef.parameters === "object") raw = toolDef.parameters;
131
+ else if (toolDef.schema) raw = toolDef.schema;
132
+ else return {};
133
+ return toJsonSchemaForDisplay(raw, toolName);
109
134
  }
110
135
  const convertToMCPToolConfig = (tool) => {
111
136
  if (tool.config.type !== "mcp") throw new Error(`Cannot convert non-MCP tool to MCP config: ${tool.id}`);
@@ -40,13 +40,13 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
40
40
  algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
41
41
  encoding: "hex" | "base64";
42
42
  signature: {
43
- source: "query" | "body" | "header";
43
+ source: "query" | "header" | "body";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
47
47
  };
48
48
  signedComponents: {
49
- source: "literal" | "body" | "header";
49
+ source: "literal" | "header" | "body";
50
50
  required: boolean;
51
51
  key?: string | undefined;
52
52
  value?: string | undefined;
@@ -131,10 +131,10 @@ declare const createTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
131
131
  triggerId: string;
132
132
  userId: string;
133
133
  }) => Promise<{
134
- createdAt: string;
135
- projectId: string;
136
134
  tenantId: string;
135
+ createdAt: string;
137
136
  agentId: string;
137
+ projectId: string;
138
138
  userId: string;
139
139
  triggerId: string;
140
140
  }>;