@inkeep/agents-core 0.78.3 → 0.78.4
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 +137 -137
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +2 -2
- package/dist/client-exports.js +2 -2
- package/dist/data-access/index.d.ts +5 -5
- package/dist/data-access/index.js +5 -5
- package/dist/data-access/manage/agents.d.ts +25 -25
- package/dist/data-access/manage/artifactComponents.d.ts +10 -10
- package/dist/data-access/manage/contextConfigs.d.ts +12 -12
- package/dist/data-access/manage/dataComponents.d.ts +4 -4
- package/dist/data-access/manage/evalConfig.d.ts +19 -2
- package/dist/data-access/manage/evalConfig.js +20 -2
- package/dist/data-access/manage/functionTools.d.ts +14 -14
- package/dist/data-access/manage/skills.d.ts +12 -12
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
- package/dist/data-access/manage/subAgents.d.ts +15 -15
- package/dist/data-access/manage/tools.d.ts +27 -27
- package/dist/data-access/manage/triggers.d.ts +3 -3
- package/dist/data-access/manage/webhookDestinations.d.ts +15 -3
- package/dist/data-access/manage/webhookDestinations.js +26 -8
- package/dist/data-access/runtime/apiKeys.d.ts +20 -20
- package/dist/data-access/runtime/apps.d.ts +14 -14
- package/dist/data-access/runtime/conversations.d.ts +28 -28
- 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/messages.d.ts +27 -27
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +35 -3
- package/dist/data-access/runtime/scheduledTriggerInvocations.js +16 -3
- package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +2 -2
- package/dist/data-access/runtime/scheduledTriggers.d.ts +28 -6
- package/dist/data-access/runtime/scheduledTriggers.js +34 -7
- package/dist/data-access/runtime/tasks.d.ts +4 -4
- package/dist/db/manage/manage-schema.d.ts +783 -482
- package/dist/db/manage/manage-schema.js +120 -2
- package/dist/db/runtime/runtime-schema.d.ts +460 -441
- package/dist/db/runtime/runtime-schema.js +3 -1
- package/dist/evaluation/pass-criteria-evaluator.js +69 -29
- package/dist/index.d.ts +9 -9
- package/dist/index.js +8 -8
- package/dist/types/entities.d.ts +5 -2
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.js +2 -2
- package/dist/types/utility.d.ts +13 -5
- package/dist/types/utility.js +2 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.js +2 -2
- package/dist/validation/schemas/skills.d.ts +40 -40
- package/dist/validation/schemas.d.ts +2347 -2003
- package/dist/validation/schemas.js +64 -10
- package/drizzle/manage/0022_last_nemesis.sql +15 -0
- package/drizzle/manage/0023_flimsy_patriot.sql +13 -0
- package/drizzle/manage/meta/0022_snapshot.json +4216 -0
- package/drizzle/manage/meta/0023_snapshot.json +4317 -0
- package/drizzle/manage/meta/_journal.json +14 -0
- package/drizzle/runtime/0043_normal_beyonder.sql +2 -0
- package/drizzle/runtime/meta/0043_snapshot.json +6304 -0
- package/drizzle/runtime/meta/_journal.json +7 -0
- package/package.json +1 -1
|
@@ -10,13 +10,13 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
10
10
|
relationId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
13
|
tenantId: string;
|
|
16
|
-
|
|
14
|
+
createdAt: string;
|
|
17
15
|
agentId: string;
|
|
18
|
-
|
|
16
|
+
projectId: string;
|
|
19
17
|
subAgentId: string;
|
|
18
|
+
updatedAt: string;
|
|
19
|
+
headers: Record<string, string> | null;
|
|
20
20
|
externalAgentId: string;
|
|
21
21
|
} | undefined>;
|
|
22
22
|
declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -45,26 +45,26 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
45
45
|
scopes: SubAgentScopeConfig;
|
|
46
46
|
}) => Promise<{
|
|
47
47
|
id: string;
|
|
48
|
-
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
48
|
tenantId: string;
|
|
51
|
-
|
|
49
|
+
createdAt: string;
|
|
52
50
|
agentId: string;
|
|
53
|
-
|
|
51
|
+
projectId: string;
|
|
54
52
|
subAgentId: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
headers: Record<string, string> | null;
|
|
55
55
|
externalAgentId: string;
|
|
56
56
|
}[]>;
|
|
57
57
|
declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
58
58
|
scopes: AgentScopeConfig;
|
|
59
59
|
}) => Promise<{
|
|
60
60
|
id: string;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
61
|
tenantId: string;
|
|
64
|
-
|
|
62
|
+
createdAt: string;
|
|
65
63
|
agentId: string;
|
|
66
|
-
|
|
64
|
+
projectId: string;
|
|
67
65
|
subAgentId: string;
|
|
66
|
+
updatedAt: string;
|
|
67
|
+
headers: Record<string, string> | null;
|
|
68
68
|
externalAgentId: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -187,13 +187,13 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
187
187
|
};
|
|
188
188
|
}) => Promise<{
|
|
189
189
|
id: string;
|
|
190
|
-
createdAt: string;
|
|
191
|
-
updatedAt: string;
|
|
192
190
|
tenantId: string;
|
|
193
|
-
|
|
191
|
+
createdAt: string;
|
|
194
192
|
agentId: string;
|
|
195
|
-
|
|
193
|
+
projectId: string;
|
|
196
194
|
subAgentId: string;
|
|
195
|
+
updatedAt: string;
|
|
196
|
+
headers: Record<string, string> | null;
|
|
197
197
|
externalAgentId: string;
|
|
198
198
|
}>;
|
|
199
199
|
/**
|
|
@@ -204,13 +204,13 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
204
204
|
externalAgentId: string;
|
|
205
205
|
}) => Promise<{
|
|
206
206
|
id: string;
|
|
207
|
-
createdAt: string;
|
|
208
|
-
updatedAt: string;
|
|
209
207
|
tenantId: string;
|
|
210
|
-
|
|
208
|
+
createdAt: string;
|
|
211
209
|
agentId: string;
|
|
212
|
-
|
|
210
|
+
projectId: string;
|
|
213
211
|
subAgentId: string;
|
|
212
|
+
updatedAt: string;
|
|
213
|
+
headers: Record<string, string> | null;
|
|
214
214
|
externalAgentId: string;
|
|
215
215
|
} | undefined>;
|
|
216
216
|
/**
|
|
@@ -225,13 +225,13 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
225
225
|
};
|
|
226
226
|
}) => Promise<{
|
|
227
227
|
id: string;
|
|
228
|
-
createdAt: string;
|
|
229
|
-
updatedAt: string;
|
|
230
228
|
tenantId: string;
|
|
231
|
-
|
|
229
|
+
createdAt: string;
|
|
232
230
|
agentId: string;
|
|
233
|
-
|
|
231
|
+
projectId: string;
|
|
234
232
|
subAgentId: string;
|
|
233
|
+
updatedAt: string;
|
|
234
|
+
headers: Record<string, string> | null;
|
|
235
235
|
externalAgentId: string;
|
|
236
236
|
}>;
|
|
237
237
|
declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -10,11 +10,11 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
10
10
|
relationId: string;
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
13
|
tenantId: string;
|
|
16
|
-
|
|
14
|
+
createdAt: string;
|
|
17
15
|
agentId: string;
|
|
16
|
+
projectId: string;
|
|
17
|
+
updatedAt: string;
|
|
18
18
|
sourceSubAgentId: string;
|
|
19
19
|
targetSubAgentId: string | null;
|
|
20
20
|
relationType: string | null;
|
|
@@ -45,11 +45,11 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
45
45
|
scopes: SubAgentScopeConfig;
|
|
46
46
|
}) => Promise<{
|
|
47
47
|
id: string;
|
|
48
|
-
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
48
|
tenantId: string;
|
|
51
|
-
|
|
49
|
+
createdAt: string;
|
|
52
50
|
agentId: string;
|
|
51
|
+
projectId: string;
|
|
52
|
+
updatedAt: string;
|
|
53
53
|
sourceSubAgentId: string;
|
|
54
54
|
targetSubAgentId: string | null;
|
|
55
55
|
relationType: string | null;
|
|
@@ -58,11 +58,11 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
|
|
|
58
58
|
scopes: AgentScopeConfig;
|
|
59
59
|
}) => Promise<{
|
|
60
60
|
id: string;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
61
|
tenantId: string;
|
|
64
|
-
|
|
62
|
+
createdAt: string;
|
|
65
63
|
agentId: string;
|
|
64
|
+
projectId: string;
|
|
65
|
+
updatedAt: string;
|
|
66
66
|
sourceSubAgentId: string;
|
|
67
67
|
targetSubAgentId: string | null;
|
|
68
68
|
relationType: string | null;
|
|
@@ -127,11 +127,11 @@ 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
130
|
tenantId: string;
|
|
133
|
-
|
|
131
|
+
createdAt: string;
|
|
134
132
|
agentId: string;
|
|
133
|
+
projectId: string;
|
|
134
|
+
updatedAt: string;
|
|
135
135
|
sourceSubAgentId: string;
|
|
136
136
|
targetSubAgentId: string | null;
|
|
137
137
|
relationType: string | null;
|
|
@@ -146,11 +146,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
|
|
|
146
146
|
relationType: string;
|
|
147
147
|
}) => Promise<{
|
|
148
148
|
id: string;
|
|
149
|
-
createdAt: string;
|
|
150
|
-
updatedAt: string;
|
|
151
149
|
tenantId: string;
|
|
152
|
-
|
|
150
|
+
createdAt: string;
|
|
153
151
|
agentId: string;
|
|
152
|
+
projectId: string;
|
|
153
|
+
updatedAt: string;
|
|
154
154
|
sourceSubAgentId: string;
|
|
155
155
|
targetSubAgentId: string | null;
|
|
156
156
|
relationType: string | null;
|
|
@@ -160,11 +160,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
|
|
|
160
160
|
*/
|
|
161
161
|
declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
|
|
162
162
|
id: string;
|
|
163
|
-
createdAt: string;
|
|
164
|
-
updatedAt: string;
|
|
165
163
|
tenantId: string;
|
|
166
|
-
|
|
164
|
+
createdAt: string;
|
|
167
165
|
agentId: string;
|
|
166
|
+
projectId: string;
|
|
167
|
+
updatedAt: string;
|
|
168
168
|
sourceSubAgentId: string;
|
|
169
169
|
targetSubAgentId: string | null;
|
|
170
170
|
relationType: string | null;
|
|
@@ -205,14 +205,14 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
205
205
|
};
|
|
206
206
|
}) => Promise<{
|
|
207
207
|
id: string;
|
|
208
|
-
createdAt: string;
|
|
209
|
-
updatedAt: string;
|
|
210
208
|
tenantId: string;
|
|
211
|
-
|
|
209
|
+
createdAt: string;
|
|
212
210
|
agentId: string;
|
|
211
|
+
projectId: string;
|
|
212
|
+
subAgentId: string;
|
|
213
213
|
toolId: string;
|
|
214
|
+
updatedAt: string;
|
|
214
215
|
headers: Record<string, string> | null;
|
|
215
|
-
subAgentId: string;
|
|
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
|
-
createdAt: string;
|
|
253
|
-
updatedAt: string;
|
|
254
252
|
tenantId: string;
|
|
255
|
-
|
|
253
|
+
createdAt: string;
|
|
256
254
|
agentId: string;
|
|
255
|
+
projectId: string;
|
|
256
|
+
subAgentId: string;
|
|
257
257
|
toolId: string;
|
|
258
|
+
updatedAt: string;
|
|
258
259
|
headers: Record<string, string> | null;
|
|
259
|
-
subAgentId: string;
|
|
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
|
-
createdAt: string;
|
|
14
|
-
updatedAt: string;
|
|
15
13
|
tenantId: string;
|
|
16
|
-
|
|
14
|
+
createdAt: string;
|
|
17
15
|
agentId: string;
|
|
18
|
-
|
|
16
|
+
projectId: 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
|
-
createdAt: string;
|
|
49
|
-
updatedAt: string;
|
|
50
48
|
tenantId: string;
|
|
51
|
-
|
|
49
|
+
createdAt: string;
|
|
52
50
|
agentId: string;
|
|
53
|
-
|
|
51
|
+
projectId: 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
|
-
createdAt: string;
|
|
62
|
-
updatedAt: string;
|
|
63
61
|
tenantId: string;
|
|
64
|
-
|
|
62
|
+
createdAt: string;
|
|
65
63
|
agentId: string;
|
|
66
|
-
|
|
64
|
+
projectId: 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
|
-
createdAt: string;
|
|
227
|
-
updatedAt: string;
|
|
228
226
|
tenantId: string;
|
|
229
|
-
|
|
227
|
+
createdAt: string;
|
|
230
228
|
agentId: string;
|
|
231
|
-
|
|
229
|
+
projectId: 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
|
-
createdAt: string;
|
|
244
|
-
updatedAt: string;
|
|
245
243
|
tenantId: string;
|
|
246
|
-
|
|
244
|
+
createdAt: string;
|
|
247
245
|
agentId: string;
|
|
248
|
-
|
|
246
|
+
projectId: 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
|
-
createdAt: string;
|
|
265
|
-
updatedAt: string;
|
|
266
264
|
tenantId: string;
|
|
267
|
-
|
|
265
|
+
createdAt: string;
|
|
268
266
|
agentId: string;
|
|
269
|
-
|
|
267
|
+
projectId: 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,10 +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
|
+
agentId: string;
|
|
18
|
+
projectId: string;
|
|
19
|
+
updatedAt: string;
|
|
17
20
|
models: {
|
|
18
21
|
base?: {
|
|
19
22
|
model?: string | undefined;
|
|
@@ -37,10 +40,7 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
37
40
|
stopWhen: {
|
|
38
41
|
stepCountIs?: number | undefined;
|
|
39
42
|
} | null;
|
|
40
|
-
tenantId: string;
|
|
41
43
|
prompt: string | null;
|
|
42
|
-
projectId: string;
|
|
43
|
-
agentId: string;
|
|
44
44
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
45
45
|
outputContract: {
|
|
46
46
|
[x: string]: unknown;
|
|
@@ -56,10 +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
|
+
agentId: string;
|
|
64
|
+
projectId: string;
|
|
65
|
+
updatedAt: string;
|
|
63
66
|
models: {
|
|
64
67
|
base?: {
|
|
65
68
|
model?: string | undefined;
|
|
@@ -83,10 +86,7 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
83
86
|
stopWhen: {
|
|
84
87
|
stepCountIs?: number | undefined;
|
|
85
88
|
} | null;
|
|
86
|
-
tenantId: string;
|
|
87
89
|
prompt: string | null;
|
|
88
|
-
projectId: string;
|
|
89
|
-
agentId: string;
|
|
90
90
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
91
91
|
outputContract: {
|
|
92
92
|
[x: string]: unknown;
|
|
@@ -155,10 +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
|
+
agentId: string;
|
|
163
|
+
projectId: string;
|
|
164
|
+
updatedAt: string;
|
|
162
165
|
models: {
|
|
163
166
|
base?: {
|
|
164
167
|
model?: string | undefined;
|
|
@@ -182,10 +185,7 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
182
185
|
stopWhen: {
|
|
183
186
|
stepCountIs?: number | undefined;
|
|
184
187
|
} | null;
|
|
185
|
-
tenantId: string;
|
|
186
188
|
prompt: string | null;
|
|
187
|
-
projectId: string;
|
|
188
|
-
agentId: string;
|
|
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
|
-
tenantId: string;
|
|
29
28
|
projectId: string;
|
|
30
|
-
|
|
31
|
-
credentialReferenceId: string | null;
|
|
29
|
+
updatedAt: string;
|
|
32
30
|
config: {
|
|
33
31
|
type: "mcp";
|
|
34
32
|
mcp: ToolMcpConfig;
|
|
35
33
|
};
|
|
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
|
-
tenantId: string;
|
|
87
86
|
projectId: string;
|
|
88
|
-
|
|
89
|
-
credentialReferenceId: string | null;
|
|
87
|
+
updatedAt: string;
|
|
90
88
|
config: {
|
|
91
89
|
type: "mcp";
|
|
92
90
|
mcp: ToolMcpConfig;
|
|
93
91
|
};
|
|
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
|
-
createdAt: string;
|
|
140
|
-
updatedAt: string;
|
|
141
139
|
tenantId: string;
|
|
142
|
-
|
|
140
|
+
createdAt: string;
|
|
143
141
|
agentId: string;
|
|
142
|
+
projectId: string;
|
|
143
|
+
subAgentId: string;
|
|
144
144
|
toolId: string;
|
|
145
|
+
updatedAt: string;
|
|
145
146
|
headers: Record<string, string> | null;
|
|
146
|
-
subAgentId: string;
|
|
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
|
-
createdAt: string;
|
|
159
|
-
updatedAt: string;
|
|
160
158
|
tenantId: string;
|
|
161
|
-
|
|
159
|
+
createdAt: string;
|
|
162
160
|
agentId: string;
|
|
161
|
+
projectId: string;
|
|
162
|
+
subAgentId: string;
|
|
163
163
|
toolId: string;
|
|
164
|
+
updatedAt: string;
|
|
164
165
|
headers: Record<string, string> | null;
|
|
165
|
-
subAgentId: string;
|
|
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
|
-
createdAt: string;
|
|
187
|
-
updatedAt: string;
|
|
188
186
|
tenantId: string;
|
|
189
|
-
|
|
187
|
+
createdAt: string;
|
|
190
188
|
agentId: string;
|
|
189
|
+
projectId: string;
|
|
190
|
+
subAgentId: string;
|
|
191
191
|
toolId: string;
|
|
192
|
+
updatedAt: string;
|
|
192
193
|
headers: Record<string, string> | null;
|
|
193
|
-
subAgentId: string;
|
|
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
|
-
tenantId: string;
|
|
211
210
|
projectId: string;
|
|
212
|
-
|
|
213
|
-
credentialReferenceId: string | null;
|
|
211
|
+
updatedAt: string;
|
|
214
212
|
config: {
|
|
215
213
|
type: "mcp";
|
|
216
214
|
mcp: ToolMcpConfig;
|
|
217
215
|
};
|
|
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;
|
|
@@ -131,11 +131,11 @@ declare const createTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
131
131
|
triggerId: string;
|
|
132
132
|
userId: string;
|
|
133
133
|
}) => Promise<{
|
|
134
|
-
createdAt: string;
|
|
135
|
-
userId: string;
|
|
136
134
|
tenantId: string;
|
|
137
|
-
|
|
135
|
+
createdAt: string;
|
|
138
136
|
agentId: string;
|
|
137
|
+
projectId: string;
|
|
138
|
+
userId: string;
|
|
139
139
|
triggerId: string;
|
|
140
140
|
}>;
|
|
141
141
|
declare const deleteTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -33,13 +33,16 @@ declare const listWebhookDestinationsPaginated: (db: AgentsManageDatabaseClient)
|
|
|
33
33
|
pages: number;
|
|
34
34
|
};
|
|
35
35
|
}>;
|
|
36
|
-
type
|
|
36
|
+
type WebhookDestinationWithScoping = WebhookDestinationSelect & {
|
|
37
37
|
agentIds: string[];
|
|
38
|
+
evaluatorIds: string[];
|
|
38
39
|
};
|
|
40
|
+
/** @deprecated Use {@link WebhookDestinationWithScoping} instead. */
|
|
41
|
+
type WebhookDestinationWithAgents = WebhookDestinationWithScoping;
|
|
39
42
|
declare const listEnabledWebhookDestinations: (db: AgentsManageDatabaseClient) => (params: {
|
|
40
43
|
scopes: ProjectScopeConfig;
|
|
41
44
|
agentId: string;
|
|
42
|
-
}) => Promise<
|
|
45
|
+
}) => Promise<WebhookDestinationWithScoping[]>;
|
|
43
46
|
declare const createWebhookDestination: (db: AgentsManageDatabaseClient) => (params: WebhookDestinationInsert) => Promise<WebhookDestinationSelect>;
|
|
44
47
|
declare const updateWebhookDestination: (db: AgentsManageDatabaseClient) => (params: {
|
|
45
48
|
scopes: ProjectScopeConfig;
|
|
@@ -59,5 +62,14 @@ declare const setWebhookDestinationAgentIds: (db: AgentsManageDatabaseClient) =>
|
|
|
59
62
|
webhookDestinationId: string;
|
|
60
63
|
agentIds: string[];
|
|
61
64
|
}) => Promise<void>;
|
|
65
|
+
declare const getWebhookDestinationEvaluatorIds: (db: AgentsManageDatabaseClient) => (params: {
|
|
66
|
+
scopes: ProjectScopeConfig;
|
|
67
|
+
webhookDestinationId: string;
|
|
68
|
+
}) => Promise<string[]>;
|
|
69
|
+
declare const setWebhookDestinationEvaluatorIds: (db: AgentsManageDatabaseClient) => (params: {
|
|
70
|
+
scopes: ProjectScopeConfig;
|
|
71
|
+
webhookDestinationId: string;
|
|
72
|
+
evaluatorIds: string[];
|
|
73
|
+
}) => Promise<void>;
|
|
62
74
|
//#endregion
|
|
63
|
-
export { WebhookDestinationWithAgents, createWebhookDestination, deleteWebhookDestination, getWebhookDestinationAgentIds, getWebhookDestinationById, listEnabledWebhookDestinations, listWebhookDestinationsPaginated, setWebhookDestinationAgentIds, updateWebhookDestination };
|
|
75
|
+
export { WebhookDestinationWithAgents, WebhookDestinationWithScoping, createWebhookDestination, deleteWebhookDestination, getWebhookDestinationAgentIds, getWebhookDestinationById, getWebhookDestinationEvaluatorIds, listEnabledWebhookDestinations, listWebhookDestinationsPaginated, setWebhookDestinationAgentIds, setWebhookDestinationEvaluatorIds, updateWebhookDestination };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { webhookDestinationAgents, webhookDestinations } from "../../db/manage/manage-schema.js";
|
|
1
|
+
import { webhookDestinationAgents, webhookDestinationEvaluators, webhookDestinations } from "../../db/manage/manage-schema.js";
|
|
2
2
|
import { generateId } from "../../utils/conversations.js";
|
|
3
3
|
import { projectScopedWhere } from "./scope-helpers.js";
|
|
4
4
|
import { and, count, desc, eq, inArray } from "drizzle-orm";
|
|
@@ -65,22 +65,26 @@ const listEnabledWebhookDestinations = (db) => async (params) => {
|
|
|
65
65
|
const { scopes, agentId } = params;
|
|
66
66
|
const rows = await db.select({
|
|
67
67
|
dest: webhookDestinations,
|
|
68
|
-
scopedAgentId: webhookDestinationAgents.agentId
|
|
69
|
-
|
|
68
|
+
scopedAgentId: webhookDestinationAgents.agentId,
|
|
69
|
+
scopedEvaluatorId: webhookDestinationEvaluators.evaluatorId
|
|
70
|
+
}).from(webhookDestinations).leftJoin(webhookDestinationAgents, and(eq(webhookDestinationAgents.tenantId, webhookDestinations.tenantId), eq(webhookDestinationAgents.projectId, webhookDestinations.projectId), eq(webhookDestinationAgents.webhookDestinationId, webhookDestinations.id))).leftJoin(webhookDestinationEvaluators, and(eq(webhookDestinationEvaluators.tenantId, webhookDestinations.tenantId), eq(webhookDestinationEvaluators.projectId, webhookDestinations.projectId), eq(webhookDestinationEvaluators.webhookDestinationId, webhookDestinations.id))).where(and(projectScopedWhere(webhookDestinations, scopes), eq(webhookDestinations.enabled, true)));
|
|
70
71
|
if (rows.length === 0) return [];
|
|
71
72
|
const destMap = /* @__PURE__ */ new Map();
|
|
72
73
|
for (const row of rows) {
|
|
73
74
|
const existing = destMap.get(row.dest.id);
|
|
74
75
|
if (existing) {
|
|
75
|
-
if (row.scopedAgentId) existing.agentIds.
|
|
76
|
+
if (row.scopedAgentId) existing.agentIds.add(row.scopedAgentId);
|
|
77
|
+
if (row.scopedEvaluatorId) existing.evaluatorIds.add(row.scopedEvaluatorId);
|
|
76
78
|
} else destMap.set(row.dest.id, {
|
|
77
79
|
dest: row.dest,
|
|
78
|
-
agentIds: row.scopedAgentId ? [row.scopedAgentId] : []
|
|
80
|
+
agentIds: new Set(row.scopedAgentId ? [row.scopedAgentId] : []),
|
|
81
|
+
evaluatorIds: new Set(row.scopedEvaluatorId ? [row.scopedEvaluatorId] : [])
|
|
79
82
|
});
|
|
80
83
|
}
|
|
81
|
-
return Array.from(destMap.values()).filter(({ agentIds }) => agentIds.
|
|
84
|
+
return Array.from(destMap.values()).filter(({ agentIds }) => agentIds.size === 0 || agentIds.has(agentId)).map(({ dest, agentIds, evaluatorIds }) => ({
|
|
82
85
|
...dest,
|
|
83
|
-
agentIds
|
|
86
|
+
agentIds: Array.from(agentIds),
|
|
87
|
+
evaluatorIds: Array.from(evaluatorIds)
|
|
84
88
|
}));
|
|
85
89
|
};
|
|
86
90
|
const createWebhookDestination = (db) => async (params) => {
|
|
@@ -110,6 +114,20 @@ const setWebhookDestinationAgentIds = (db) => async (params) => {
|
|
|
110
114
|
agentId
|
|
111
115
|
})));
|
|
112
116
|
};
|
|
117
|
+
const getWebhookDestinationEvaluatorIds = (db) => async (params) => {
|
|
118
|
+
return (await db.select({ evaluatorId: webhookDestinationEvaluators.evaluatorId }).from(webhookDestinationEvaluators).where(and(eq(webhookDestinationEvaluators.tenantId, params.scopes.tenantId), eq(webhookDestinationEvaluators.projectId, params.scopes.projectId), eq(webhookDestinationEvaluators.webhookDestinationId, params.webhookDestinationId)))).map((r) => r.evaluatorId);
|
|
119
|
+
};
|
|
120
|
+
const setWebhookDestinationEvaluatorIds = (db) => async (params) => {
|
|
121
|
+
const { scopes, webhookDestinationId, evaluatorIds } = params;
|
|
122
|
+
await db.delete(webhookDestinationEvaluators).where(and(eq(webhookDestinationEvaluators.tenantId, scopes.tenantId), eq(webhookDestinationEvaluators.projectId, scopes.projectId), eq(webhookDestinationEvaluators.webhookDestinationId, webhookDestinationId)));
|
|
123
|
+
if (evaluatorIds.length > 0) await db.insert(webhookDestinationEvaluators).values(evaluatorIds.map((evaluatorId) => ({
|
|
124
|
+
id: generateId(),
|
|
125
|
+
tenantId: scopes.tenantId,
|
|
126
|
+
projectId: scopes.projectId,
|
|
127
|
+
webhookDestinationId,
|
|
128
|
+
evaluatorId
|
|
129
|
+
})));
|
|
130
|
+
};
|
|
113
131
|
|
|
114
132
|
//#endregion
|
|
115
|
-
export { createWebhookDestination, deleteWebhookDestination, getWebhookDestinationAgentIds, getWebhookDestinationById, listEnabledWebhookDestinations, listWebhookDestinationsPaginated, setWebhookDestinationAgentIds, updateWebhookDestination };
|
|
133
|
+
export { createWebhookDestination, deleteWebhookDestination, getWebhookDestinationAgentIds, getWebhookDestinationById, getWebhookDestinationEvaluatorIds, listEnabledWebhookDestinations, listWebhookDestinationsPaginated, setWebhookDestinationAgentIds, setWebhookDestinationEvaluatorIds, updateWebhookDestination };
|