@inkeep/agents-core 0.79.1 → 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.
- package/dist/auth/auth-schema.d.ts +227 -227
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/auth.js +1 -1
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/data-access/manage/agents.d.ts +40 -40
- package/dist/data-access/manage/artifactComponents.d.ts +8 -8
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +10 -10
- package/dist/data-access/manage/skills.d.ts +10 -10
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/manage/subAgents.d.ts +12 -12
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/manage/tools.js +33 -8
- package/dist/data-access/manage/triggers.d.ts +6 -6
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/apps.d.ts +19 -19
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/evalRuns.d.ts +5 -0
- package/dist/data-access/runtime/evalRuns.js +3 -0
- package/dist/data-access/runtime/events.d.ts +4 -4
- package/dist/data-access/runtime/feedback.d.ts +6 -6
- package/dist/data-access/runtime/feedback.js +2 -2
- package/dist/data-access/runtime/messages.d.ts +15 -15
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +2 -2
- package/dist/data-access/runtime/tasks.d.ts +3 -3
- package/dist/db/manage/manage-schema.d.ts +510 -510
- package/dist/db/runtime/runtime-schema.d.ts +458 -458
- package/dist/utils/json-schema-walk.d.ts +50 -0
- package/dist/utils/json-schema-walk.js +202 -0
- package/dist/utils/mcp-client.js +14 -32
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas/skills.d.ts +19 -19
- package/dist/validation/schemas.d.ts +2415 -2414
- package/dist/validation/schemas.js +1 -0
- package/package.json +5 -1
|
@@ -10,14 +10,14 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
10
10
|
relationId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
|
+
tenantId: string;
|
|
13
14
|
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
15
|
agentId: string;
|
|
16
16
|
projectId: string;
|
|
17
|
-
|
|
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
|
+
tenantId: string;
|
|
48
49
|
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
50
|
agentId: string;
|
|
51
51
|
projectId: string;
|
|
52
|
-
|
|
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
|
+
tenantId: string;
|
|
61
62
|
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
63
|
agentId: string;
|
|
64
64
|
projectId: string;
|
|
65
|
-
|
|
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
|
+
tenantId: string;
|
|
130
131
|
createdAt: string;
|
|
131
|
-
updatedAt: string;
|
|
132
132
|
agentId: string;
|
|
133
133
|
projectId: string;
|
|
134
|
-
|
|
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
|
+
tenantId: string;
|
|
149
150
|
createdAt: string;
|
|
150
|
-
updatedAt: string;
|
|
151
151
|
agentId: string;
|
|
152
152
|
projectId: string;
|
|
153
|
-
|
|
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
|
+
tenantId: string;
|
|
163
164
|
createdAt: string;
|
|
164
|
-
updatedAt: string;
|
|
165
165
|
agentId: string;
|
|
166
166
|
projectId: string;
|
|
167
|
-
|
|
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,14 +205,14 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
205
205
|
};
|
|
206
206
|
}) => Promise<{
|
|
207
207
|
id: string;
|
|
208
|
+
tenantId: string;
|
|
208
209
|
createdAt: string;
|
|
209
|
-
updatedAt: string;
|
|
210
|
-
headers: Record<string, string> | null;
|
|
211
210
|
agentId: string;
|
|
212
211
|
projectId: string;
|
|
213
|
-
tenantId: string;
|
|
214
212
|
subAgentId: string;
|
|
215
213
|
toolId: string;
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
headers: Record<string, string> | null;
|
|
216
216
|
selectedTools: string[] | null;
|
|
217
217
|
toolPolicies: Record<string, {
|
|
218
218
|
needsApproval?: boolean;
|
|
@@ -249,14 +249,14 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
249
249
|
relationId: string;
|
|
250
250
|
}) => Promise<{
|
|
251
251
|
id: string;
|
|
252
|
+
tenantId: string;
|
|
252
253
|
createdAt: string;
|
|
253
|
-
updatedAt: string;
|
|
254
|
-
headers: Record<string, string> | null;
|
|
255
254
|
agentId: string;
|
|
256
255
|
projectId: string;
|
|
257
|
-
tenantId: string;
|
|
258
256
|
subAgentId: string;
|
|
259
257
|
toolId: string;
|
|
258
|
+
updatedAt: string;
|
|
259
|
+
headers: Record<string, string> | null;
|
|
260
260
|
selectedTools: string[] | null;
|
|
261
261
|
toolPolicies: Record<string, {
|
|
262
262
|
needsApproval?: boolean;
|
|
@@ -10,13 +10,13 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
|
|
|
10
10
|
relationId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
|
+
tenantId: string;
|
|
13
14
|
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
|
-
headers: Record<string, string> | null;
|
|
16
15
|
agentId: string;
|
|
17
16
|
projectId: string;
|
|
18
|
-
tenantId: string;
|
|
19
17
|
subAgentId: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
headers: Record<string, string> | null;
|
|
20
20
|
targetAgentId: string;
|
|
21
21
|
} | undefined>;
|
|
22
22
|
declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -45,26 +45,26 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
|
|
|
45
45
|
scopes: SubAgentScopeConfig;
|
|
46
46
|
}) => Promise<{
|
|
47
47
|
id: string;
|
|
48
|
+
tenantId: string;
|
|
48
49
|
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
|
-
headers: Record<string, string> | null;
|
|
51
50
|
agentId: string;
|
|
52
51
|
projectId: string;
|
|
53
|
-
tenantId: string;
|
|
54
52
|
subAgentId: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
headers: Record<string, string> | null;
|
|
55
55
|
targetAgentId: string;
|
|
56
56
|
}[]>;
|
|
57
57
|
declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
58
58
|
scopes: AgentScopeConfig;
|
|
59
59
|
}) => Promise<{
|
|
60
60
|
id: string;
|
|
61
|
+
tenantId: string;
|
|
61
62
|
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
|
-
headers: Record<string, string> | null;
|
|
64
63
|
agentId: string;
|
|
65
64
|
projectId: string;
|
|
66
|
-
tenantId: string;
|
|
67
65
|
subAgentId: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
headers: Record<string, string> | null;
|
|
68
68
|
targetAgentId: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -223,13 +223,13 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
223
223
|
};
|
|
224
224
|
}) => Promise<{
|
|
225
225
|
id: string;
|
|
226
|
+
tenantId: string;
|
|
226
227
|
createdAt: string;
|
|
227
|
-
updatedAt: string;
|
|
228
|
-
headers: Record<string, string> | null;
|
|
229
228
|
agentId: string;
|
|
230
229
|
projectId: string;
|
|
231
|
-
tenantId: string;
|
|
232
230
|
subAgentId: string;
|
|
231
|
+
updatedAt: string;
|
|
232
|
+
headers: Record<string, string> | null;
|
|
233
233
|
targetAgentId: string;
|
|
234
234
|
}>;
|
|
235
235
|
/**
|
|
@@ -240,13 +240,13 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
|
|
|
240
240
|
targetAgentId: string;
|
|
241
241
|
}) => Promise<{
|
|
242
242
|
id: string;
|
|
243
|
+
tenantId: string;
|
|
243
244
|
createdAt: string;
|
|
244
|
-
updatedAt: string;
|
|
245
|
-
headers: Record<string, string> | null;
|
|
246
245
|
agentId: string;
|
|
247
246
|
projectId: string;
|
|
248
|
-
tenantId: string;
|
|
249
247
|
subAgentId: string;
|
|
248
|
+
updatedAt: string;
|
|
249
|
+
headers: Record<string, string> | null;
|
|
250
250
|
targetAgentId: string;
|
|
251
251
|
} | undefined>;
|
|
252
252
|
/**
|
|
@@ -261,13 +261,13 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
261
261
|
};
|
|
262
262
|
}) => Promise<{
|
|
263
263
|
id: string;
|
|
264
|
+
tenantId: string;
|
|
264
265
|
createdAt: string;
|
|
265
|
-
updatedAt: string;
|
|
266
|
-
headers: Record<string, string> | null;
|
|
267
266
|
agentId: string;
|
|
268
267
|
projectId: string;
|
|
269
|
-
tenantId: string;
|
|
270
268
|
subAgentId: string;
|
|
269
|
+
updatedAt: string;
|
|
270
|
+
headers: Record<string, string> | null;
|
|
271
271
|
targetAgentId: string;
|
|
272
272
|
}>;
|
|
273
273
|
declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -10,14 +10,13 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
10
10
|
subAgentId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
|
-
|
|
13
|
+
tenantId: string;
|
|
14
14
|
createdAt: string;
|
|
15
|
-
|
|
15
|
+
name: string;
|
|
16
16
|
description: string | null;
|
|
17
|
-
prompt: string | null;
|
|
18
17
|
agentId: string;
|
|
19
18
|
projectId: string;
|
|
20
|
-
|
|
19
|
+
updatedAt: string;
|
|
21
20
|
models: {
|
|
22
21
|
base?: {
|
|
23
22
|
model?: string | undefined;
|
|
@@ -41,6 +40,7 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
41
40
|
stopWhen: {
|
|
42
41
|
stepCountIs?: number | undefined;
|
|
43
42
|
} | null;
|
|
43
|
+
prompt: string | null;
|
|
44
44
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
45
45
|
outputContract: {
|
|
46
46
|
[x: string]: unknown;
|
|
@@ -56,14 +56,13 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
56
56
|
scopes: AgentScopeConfig;
|
|
57
57
|
}) => Promise<{
|
|
58
58
|
id: string;
|
|
59
|
-
|
|
59
|
+
tenantId: string;
|
|
60
60
|
createdAt: string;
|
|
61
|
-
|
|
61
|
+
name: string;
|
|
62
62
|
description: string | null;
|
|
63
|
-
prompt: string | null;
|
|
64
63
|
agentId: string;
|
|
65
64
|
projectId: string;
|
|
66
|
-
|
|
65
|
+
updatedAt: string;
|
|
67
66
|
models: {
|
|
68
67
|
base?: {
|
|
69
68
|
model?: string | undefined;
|
|
@@ -87,6 +86,7 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
87
86
|
stopWhen: {
|
|
88
87
|
stepCountIs?: number | undefined;
|
|
89
88
|
} | null;
|
|
89
|
+
prompt: string | null;
|
|
90
90
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
91
91
|
outputContract: {
|
|
92
92
|
[x: string]: unknown;
|
|
@@ -155,14 +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
|
-
|
|
158
|
+
tenantId: string;
|
|
159
159
|
createdAt: string;
|
|
160
|
-
|
|
160
|
+
name: string;
|
|
161
161
|
description: string | null;
|
|
162
|
-
prompt: string | null;
|
|
163
162
|
agentId: string;
|
|
164
163
|
projectId: string;
|
|
165
|
-
|
|
164
|
+
updatedAt: string;
|
|
166
165
|
models: {
|
|
167
166
|
base?: {
|
|
168
167
|
model?: string | undefined;
|
|
@@ -186,6 +185,7 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
186
185
|
stopWhen: {
|
|
187
186
|
stepCountIs?: number | undefined;
|
|
188
187
|
} | null;
|
|
188
|
+
prompt: string | null;
|
|
189
189
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
190
190
|
outputContract: {
|
|
191
191
|
[x: string]: unknown;
|
|
@@ -21,19 +21,19 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
21
21
|
toolId: string;
|
|
22
22
|
}) => Promise<{
|
|
23
23
|
id: string;
|
|
24
|
-
|
|
24
|
+
tenantId: string;
|
|
25
25
|
createdAt: string;
|
|
26
|
-
|
|
26
|
+
name: string;
|
|
27
27
|
description: string | null;
|
|
28
|
-
headers: Record<string, string> | null;
|
|
29
28
|
projectId: string;
|
|
30
|
-
|
|
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
|
-
|
|
82
|
+
tenantId: string;
|
|
83
83
|
createdAt: string;
|
|
84
|
-
|
|
84
|
+
name: string;
|
|
85
85
|
description: string | null;
|
|
86
|
-
headers: Record<string, string> | null;
|
|
87
86
|
projectId: string;
|
|
88
|
-
|
|
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,14 +136,14 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
136
136
|
}> | null;
|
|
137
137
|
}) => Promise<{
|
|
138
138
|
id: string;
|
|
139
|
+
tenantId: string;
|
|
139
140
|
createdAt: string;
|
|
140
|
-
updatedAt: string;
|
|
141
|
-
headers: Record<string, string> | null;
|
|
142
141
|
agentId: string;
|
|
143
142
|
projectId: string;
|
|
144
|
-
tenantId: string;
|
|
145
143
|
subAgentId: string;
|
|
146
144
|
toolId: string;
|
|
145
|
+
updatedAt: string;
|
|
146
|
+
headers: Record<string, string> | null;
|
|
147
147
|
selectedTools: string[] | null;
|
|
148
148
|
toolPolicies: Record<string, {
|
|
149
149
|
needsApproval?: boolean;
|
|
@@ -155,14 +155,14 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
|
|
|
155
155
|
toolId: string;
|
|
156
156
|
}) => Promise<{
|
|
157
157
|
id: string;
|
|
158
|
+
tenantId: string;
|
|
158
159
|
createdAt: string;
|
|
159
|
-
updatedAt: string;
|
|
160
|
-
headers: Record<string, string> | null;
|
|
161
160
|
agentId: string;
|
|
162
161
|
projectId: string;
|
|
163
|
-
tenantId: string;
|
|
164
162
|
subAgentId: string;
|
|
165
163
|
toolId: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
headers: Record<string, string> | null;
|
|
166
166
|
selectedTools: string[] | null;
|
|
167
167
|
toolPolicies: Record<string, {
|
|
168
168
|
needsApproval?: boolean;
|
|
@@ -183,14 +183,14 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
183
183
|
relationId?: string;
|
|
184
184
|
}) => Promise<{
|
|
185
185
|
id: string;
|
|
186
|
+
tenantId: string;
|
|
186
187
|
createdAt: string;
|
|
187
|
-
updatedAt: string;
|
|
188
|
-
headers: Record<string, string> | null;
|
|
189
188
|
agentId: string;
|
|
190
189
|
projectId: string;
|
|
191
|
-
tenantId: string;
|
|
192
190
|
subAgentId: string;
|
|
193
191
|
toolId: string;
|
|
192
|
+
updatedAt: string;
|
|
193
|
+
headers: Record<string, string> | null;
|
|
194
194
|
selectedTools: string[] | null;
|
|
195
195
|
toolPolicies: Record<string, {
|
|
196
196
|
needsApproval?: boolean;
|
|
@@ -203,19 +203,19 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
203
203
|
data: ToolInsert;
|
|
204
204
|
}) => Promise<{
|
|
205
205
|
id: string;
|
|
206
|
-
|
|
206
|
+
tenantId: string;
|
|
207
207
|
createdAt: string;
|
|
208
|
-
|
|
208
|
+
name: string;
|
|
209
209
|
description: string | null;
|
|
210
|
-
headers: Record<string, string> | null;
|
|
211
210
|
projectId: string;
|
|
212
|
-
|
|
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,
|
|
101
|
-
return extractOriginalSchema(toolDef);
|
|
102
|
+
function extractInputSchema(toolDef, toolName, _toolOverrides) {
|
|
103
|
+
return extractOriginalSchema(toolDef, toolName);
|
|
102
104
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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}`);
|
|
@@ -37,16 +37,16 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
|
|
|
37
37
|
authentication: unknown;
|
|
38
38
|
signingSecretCredentialReferenceId: string | null;
|
|
39
39
|
signatureVerification: {
|
|
40
|
-
algorithm: "
|
|
41
|
-
encoding: "
|
|
40
|
+
algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
|
|
41
|
+
encoding: "hex" | "base64";
|
|
42
42
|
signature: {
|
|
43
|
-
source: "query" | "
|
|
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" | "
|
|
49
|
+
source: "literal" | "header" | "body";
|
|
50
50
|
required: boolean;
|
|
51
51
|
key?: string | undefined;
|
|
52
52
|
value?: string | undefined;
|
|
@@ -131,11 +131,11 @@ declare const createTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
131
131
|
triggerId: string;
|
|
132
132
|
userId: string;
|
|
133
133
|
}) => Promise<{
|
|
134
|
+
tenantId: string;
|
|
134
135
|
createdAt: string;
|
|
135
|
-
userId: string;
|
|
136
136
|
agentId: string;
|
|
137
137
|
projectId: string;
|
|
138
|
-
|
|
138
|
+
userId: string;
|
|
139
139
|
triggerId: string;
|
|
140
140
|
}>;
|
|
141
141
|
declare const deleteTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -9,48 +9,48 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
9
9
|
id: string;
|
|
10
10
|
}) => Promise<{
|
|
11
11
|
id: string;
|
|
12
|
-
|
|
12
|
+
tenantId: string;
|
|
13
13
|
createdAt: string;
|
|
14
|
-
|
|
15
|
-
expiresAt: string | null;
|
|
14
|
+
name: string | null;
|
|
16
15
|
agentId: string;
|
|
17
16
|
projectId: string;
|
|
18
|
-
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
expiresAt: string | null;
|
|
19
|
+
lastUsedAt: string | null;
|
|
19
20
|
publicId: string;
|
|
20
21
|
keyHash: string;
|
|
21
22
|
keyPrefix: string;
|
|
22
|
-
lastUsedAt: string | null;
|
|
23
23
|
} | undefined>;
|
|
24
24
|
declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
|
|
25
25
|
id: string;
|
|
26
|
-
|
|
26
|
+
tenantId: string;
|
|
27
27
|
createdAt: string;
|
|
28
|
-
|
|
29
|
-
expiresAt: string | null;
|
|
28
|
+
name: string | null;
|
|
30
29
|
agentId: string;
|
|
31
30
|
projectId: string;
|
|
32
|
-
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
expiresAt: string | null;
|
|
33
|
+
lastUsedAt: string | null;
|
|
33
34
|
publicId: string;
|
|
34
35
|
keyHash: string;
|
|
35
36
|
keyPrefix: string;
|
|
36
|
-
lastUsedAt: string | null;
|
|
37
37
|
} | undefined>;
|
|
38
38
|
declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
|
|
39
39
|
scopes: ProjectScopeConfig;
|
|
40
40
|
agentId?: string;
|
|
41
41
|
}) => Promise<{
|
|
42
42
|
id: string;
|
|
43
|
-
|
|
43
|
+
tenantId: string;
|
|
44
44
|
createdAt: string;
|
|
45
|
-
|
|
46
|
-
expiresAt: string | null;
|
|
45
|
+
name: string | null;
|
|
47
46
|
agentId: string;
|
|
48
47
|
projectId: string;
|
|
49
|
-
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
expiresAt: string | null;
|
|
50
|
+
lastUsedAt: string | null;
|
|
50
51
|
publicId: string;
|
|
51
52
|
keyHash: string;
|
|
52
53
|
keyPrefix: string;
|
|
53
|
-
lastUsedAt: string | null;
|
|
54
54
|
}[]>;
|
|
55
55
|
declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
56
56
|
scopes: ProjectScopeConfig;
|
|
@@ -67,17 +67,17 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
67
67
|
}>;
|
|
68
68
|
declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
|
|
69
69
|
id: string;
|
|
70
|
-
|
|
70
|
+
tenantId: string;
|
|
71
71
|
createdAt: string;
|
|
72
|
-
|
|
73
|
-
expiresAt: string | null;
|
|
72
|
+
name: string | null;
|
|
74
73
|
agentId: string;
|
|
75
74
|
projectId: string;
|
|
76
|
-
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
expiresAt: string | null;
|
|
77
|
+
lastUsedAt: string | null;
|
|
77
78
|
publicId: string;
|
|
78
79
|
keyHash: string;
|
|
79
80
|
keyPrefix: string;
|
|
80
|
-
lastUsedAt: string | null;
|
|
81
81
|
}>;
|
|
82
82
|
declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
|
|
83
83
|
scopes: ProjectScopeConfig;
|