@inkeep/agents-core 0.70.2 → 0.70.3
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/data-access/manage/agents.d.ts +20 -20
- package/dist/data-access/manage/functionTools.d.ts +2 -2
- package/dist/data-access/manage/skills.d.ts +3 -3
- package/dist/data-access/manage/subAgentRelations.d.ts +2 -2
- package/dist/data-access/manage/tools.d.ts +6 -6
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apps.d.ts +1 -1
- package/dist/data-access/runtime/apps.js +2 -2
- package/dist/data-access/runtime/conversations.d.ts +4 -4
- package/dist/data-access/runtime/messages.d.ts +3 -3
- package/dist/db/manage/manage-schema.d.ts +362 -362
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/schemas/skills.d.ts +25 -25
- package/dist/validation/schemas.d.ts +425 -425
- package/package.json +1 -1
|
@@ -18,6 +18,8 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
18
18
|
prompt: string | null;
|
|
19
19
|
tenantId: string;
|
|
20
20
|
projectId: string;
|
|
21
|
+
defaultSubAgentId: string | null;
|
|
22
|
+
contextConfigId: string | null;
|
|
21
23
|
models: {
|
|
22
24
|
base?: {
|
|
23
25
|
model?: string | undefined;
|
|
@@ -38,11 +40,6 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
38
40
|
allowedProviders?: string[] | undefined;
|
|
39
41
|
} | undefined;
|
|
40
42
|
} | null;
|
|
41
|
-
stopWhen: {
|
|
42
|
-
transferCountIs?: number | undefined;
|
|
43
|
-
} | null;
|
|
44
|
-
defaultSubAgentId: string | null;
|
|
45
|
-
contextConfigId: string | null;
|
|
46
43
|
statusUpdates: {
|
|
47
44
|
enabled?: boolean | undefined;
|
|
48
45
|
numEvents?: number | undefined;
|
|
@@ -58,6 +55,9 @@ declare const getAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
58
55
|
} | undefined;
|
|
59
56
|
}[] | undefined;
|
|
60
57
|
} | null;
|
|
58
|
+
stopWhen: {
|
|
59
|
+
transferCountIs?: number | undefined;
|
|
60
|
+
} | null;
|
|
61
61
|
executionMode: "classic" | "durable";
|
|
62
62
|
} | null>;
|
|
63
63
|
declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -71,6 +71,8 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
71
71
|
prompt: string | null;
|
|
72
72
|
tenantId: string;
|
|
73
73
|
projectId: string;
|
|
74
|
+
defaultSubAgentId: string | null;
|
|
75
|
+
contextConfigId: string | null;
|
|
74
76
|
models: {
|
|
75
77
|
base?: {
|
|
76
78
|
model?: string | undefined;
|
|
@@ -91,11 +93,6 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
91
93
|
allowedProviders?: string[] | undefined;
|
|
92
94
|
} | undefined;
|
|
93
95
|
} | null;
|
|
94
|
-
stopWhen: {
|
|
95
|
-
transferCountIs?: number | undefined;
|
|
96
|
-
} | null;
|
|
97
|
-
defaultSubAgentId: string | null;
|
|
98
|
-
contextConfigId: string | null;
|
|
99
96
|
statusUpdates: {
|
|
100
97
|
enabled?: boolean | undefined;
|
|
101
98
|
numEvents?: number | undefined;
|
|
@@ -111,6 +108,9 @@ declare const getAgentWithDefaultSubAgent: (db: AgentsManageDatabaseClient) => (
|
|
|
111
108
|
} | undefined;
|
|
112
109
|
}[] | undefined;
|
|
113
110
|
} | null;
|
|
111
|
+
stopWhen: {
|
|
112
|
+
transferCountIs?: number | undefined;
|
|
113
|
+
} | null;
|
|
114
114
|
executionMode: "classic" | "durable";
|
|
115
115
|
defaultSubAgent: {
|
|
116
116
|
id: string;
|
|
@@ -159,6 +159,8 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
159
159
|
prompt: string | null;
|
|
160
160
|
tenantId: string;
|
|
161
161
|
projectId: string;
|
|
162
|
+
defaultSubAgentId: string | null;
|
|
163
|
+
contextConfigId: string | null;
|
|
162
164
|
models: {
|
|
163
165
|
base?: {
|
|
164
166
|
model?: string | undefined;
|
|
@@ -179,11 +181,6 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
179
181
|
allowedProviders?: string[] | undefined;
|
|
180
182
|
} | undefined;
|
|
181
183
|
} | null;
|
|
182
|
-
stopWhen: {
|
|
183
|
-
transferCountIs?: number | undefined;
|
|
184
|
-
} | null;
|
|
185
|
-
defaultSubAgentId: string | null;
|
|
186
|
-
contextConfigId: string | null;
|
|
187
184
|
statusUpdates: {
|
|
188
185
|
enabled?: boolean | undefined;
|
|
189
186
|
numEvents?: number | undefined;
|
|
@@ -199,6 +196,9 @@ declare const listAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
199
196
|
} | undefined;
|
|
200
197
|
}[] | undefined;
|
|
201
198
|
} | null;
|
|
199
|
+
stopWhen: {
|
|
200
|
+
transferCountIs?: number | undefined;
|
|
201
|
+
} | null;
|
|
202
202
|
executionMode: "classic" | "durable";
|
|
203
203
|
}[]>;
|
|
204
204
|
declare const listAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -289,6 +289,8 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
289
289
|
prompt: string | null;
|
|
290
290
|
tenantId: string;
|
|
291
291
|
projectId: string;
|
|
292
|
+
defaultSubAgentId: string | null;
|
|
293
|
+
contextConfigId: string | null;
|
|
292
294
|
models: {
|
|
293
295
|
base?: {
|
|
294
296
|
model?: string | undefined;
|
|
@@ -309,11 +311,6 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
309
311
|
allowedProviders?: string[] | undefined;
|
|
310
312
|
} | undefined;
|
|
311
313
|
} | null;
|
|
312
|
-
stopWhen: {
|
|
313
|
-
transferCountIs?: number | undefined;
|
|
314
|
-
} | null;
|
|
315
|
-
defaultSubAgentId: string | null;
|
|
316
|
-
contextConfigId: string | null;
|
|
317
314
|
statusUpdates: {
|
|
318
315
|
enabled?: boolean | undefined;
|
|
319
316
|
numEvents?: number | undefined;
|
|
@@ -329,6 +326,9 @@ declare const createAgent: (db: AgentsManageDatabaseClient) => (data: AgentInser
|
|
|
329
326
|
} | undefined;
|
|
330
327
|
}[] | undefined;
|
|
331
328
|
} | null;
|
|
329
|
+
stopWhen: {
|
|
330
|
+
transferCountIs?: number | undefined;
|
|
331
|
+
} | null;
|
|
332
332
|
executionMode: "classic" | "durable";
|
|
333
333
|
}>;
|
|
334
334
|
declare const updateAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -164,10 +164,10 @@ declare const addFunctionToolToSubAgent: (db: AgentsManageDatabaseClient) => (pa
|
|
|
164
164
|
projectId: string;
|
|
165
165
|
agentId: string;
|
|
166
166
|
subAgentId: string;
|
|
167
|
+
functionToolId: string;
|
|
167
168
|
toolPolicies: Record<string, {
|
|
168
169
|
needsApproval?: boolean;
|
|
169
170
|
}> | null;
|
|
170
|
-
functionToolId: string;
|
|
171
171
|
}>;
|
|
172
172
|
/**
|
|
173
173
|
* Update an agent-function tool relation
|
|
@@ -229,10 +229,10 @@ declare const associateFunctionToolWithSubAgent: (db: AgentsManageDatabaseClient
|
|
|
229
229
|
projectId: string;
|
|
230
230
|
agentId: string;
|
|
231
231
|
subAgentId: string;
|
|
232
|
+
functionToolId: string;
|
|
232
233
|
toolPolicies: Record<string, {
|
|
233
234
|
needsApproval?: boolean;
|
|
234
235
|
}> | null;
|
|
235
|
-
functionToolId: string;
|
|
236
236
|
}>;
|
|
237
237
|
//#endregion
|
|
238
238
|
export { addFunctionToolToSubAgent, associateFunctionToolWithSubAgent, createFunctionTool, deleteFunctionTool, getFunctionToolById, getFunctionToolsForSubAgent, getSubAgentsUsingFunctionTool, isFunctionToolAssociatedWithSubAgent, listFunctionTools, removeFunctionToolFromSubAgent, updateFunctionTool, updateSubAgentFunctionToolRelation, upsertFunctionTool, upsertSubAgentFunctionToolRelation };
|
|
@@ -21,9 +21,9 @@ declare const getSkillById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
21
21
|
updatedAt: string;
|
|
22
22
|
metadata: Record<string, string> | null;
|
|
23
23
|
description: string;
|
|
24
|
-
content: string;
|
|
25
24
|
tenantId: string;
|
|
26
25
|
projectId: string;
|
|
26
|
+
content: string;
|
|
27
27
|
} | null>;
|
|
28
28
|
declare const getSkillByIdWithFiles: (db: AgentsManageDatabaseClient) => (params: {
|
|
29
29
|
scopes: ProjectScopeConfig;
|
|
@@ -116,9 +116,9 @@ declare const upsertSkill: (db: AgentsManageDatabaseClient) => (data: SkillApiIn
|
|
|
116
116
|
updatedAt: string;
|
|
117
117
|
metadata: Record<string, string> | null;
|
|
118
118
|
description: string;
|
|
119
|
-
content: string;
|
|
120
119
|
tenantId: string;
|
|
121
120
|
projectId: string;
|
|
121
|
+
content: string;
|
|
122
122
|
}>;
|
|
123
123
|
declare const updateSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
124
124
|
scopes: ProjectScopeConfig;
|
|
@@ -145,10 +145,10 @@ declare const upsertSubAgentSkill: (db: AgentsManageDatabaseClient) => (params:
|
|
|
145
145
|
tenantId: string;
|
|
146
146
|
projectId: string;
|
|
147
147
|
agentId: string;
|
|
148
|
-
skillId: string;
|
|
149
148
|
subAgentId: string;
|
|
150
149
|
index: number;
|
|
151
150
|
alwaysLoaded: boolean;
|
|
151
|
+
skillId: string;
|
|
152
152
|
}>;
|
|
153
153
|
declare const deleteSubAgentSkill: (db: AgentsManageDatabaseClient) => (params: {
|
|
154
154
|
scopes: AgentScopeConfig;
|
|
@@ -213,10 +213,10 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
213
213
|
agentId: string;
|
|
214
214
|
subAgentId: string;
|
|
215
215
|
toolId: string;
|
|
216
|
-
selectedTools: string[] | null;
|
|
217
216
|
toolPolicies: Record<string, {
|
|
218
217
|
needsApproval?: boolean;
|
|
219
218
|
}> | null;
|
|
219
|
+
selectedTools: string[] | null;
|
|
220
220
|
}>;
|
|
221
221
|
declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
222
222
|
scopes: AgentScopeConfig;
|
|
@@ -257,10 +257,10 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
257
257
|
agentId: string;
|
|
258
258
|
subAgentId: string;
|
|
259
259
|
toolId: string;
|
|
260
|
-
selectedTools: string[] | null;
|
|
261
260
|
toolPolicies: Record<string, {
|
|
262
261
|
needsApproval?: boolean;
|
|
263
262
|
}> | null;
|
|
263
|
+
selectedTools: string[] | null;
|
|
264
264
|
} | undefined>;
|
|
265
265
|
declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
266
266
|
scopes: SubAgentScopeConfig;
|
|
@@ -28,11 +28,11 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
28
28
|
headers: Record<string, string> | null;
|
|
29
29
|
tenantId: string;
|
|
30
30
|
projectId: string;
|
|
31
|
-
credentialReferenceId: string | null;
|
|
32
31
|
config: {
|
|
33
32
|
type: "mcp";
|
|
34
33
|
mcp: ToolMcpConfig;
|
|
35
34
|
};
|
|
35
|
+
credentialReferenceId: string | null;
|
|
36
36
|
credentialScope: string;
|
|
37
37
|
imageUrl: string | null;
|
|
38
38
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -86,11 +86,11 @@ declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInser
|
|
|
86
86
|
headers: Record<string, string> | null;
|
|
87
87
|
tenantId: string;
|
|
88
88
|
projectId: string;
|
|
89
|
-
credentialReferenceId: string | null;
|
|
90
89
|
config: {
|
|
91
90
|
type: "mcp";
|
|
92
91
|
mcp: ToolMcpConfig;
|
|
93
92
|
};
|
|
93
|
+
credentialReferenceId: string | null;
|
|
94
94
|
credentialScope: string;
|
|
95
95
|
imageUrl: string | null;
|
|
96
96
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -144,10 +144,10 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
144
144
|
agentId: string;
|
|
145
145
|
subAgentId: string;
|
|
146
146
|
toolId: string;
|
|
147
|
-
selectedTools: string[] | null;
|
|
148
147
|
toolPolicies: Record<string, {
|
|
149
148
|
needsApproval?: boolean;
|
|
150
149
|
}> | null;
|
|
150
|
+
selectedTools: string[] | null;
|
|
151
151
|
}>;
|
|
152
152
|
declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
153
153
|
scopes: AgentScopeConfig;
|
|
@@ -163,10 +163,10 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
|
|
|
163
163
|
agentId: string;
|
|
164
164
|
subAgentId: string;
|
|
165
165
|
toolId: string;
|
|
166
|
-
selectedTools: string[] | null;
|
|
167
166
|
toolPolicies: Record<string, {
|
|
168
167
|
needsApproval?: boolean;
|
|
169
168
|
}> | 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)
|
|
@@ -191,10 +191,10 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
|
|
|
191
191
|
agentId: string;
|
|
192
192
|
subAgentId: string;
|
|
193
193
|
toolId: string;
|
|
194
|
-
selectedTools: string[] | null;
|
|
195
194
|
toolPolicies: Record<string, {
|
|
196
195
|
needsApproval?: boolean;
|
|
197
196
|
}> | null;
|
|
197
|
+
selectedTools: string[] | null;
|
|
198
198
|
}>;
|
|
199
199
|
/**
|
|
200
200
|
* Upsert a tool (create if it doesn't exist, update if it does)
|
|
@@ -210,11 +210,11 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
210
210
|
headers: Record<string, string> | null;
|
|
211
211
|
tenantId: string;
|
|
212
212
|
projectId: string;
|
|
213
|
-
credentialReferenceId: string | null;
|
|
214
213
|
config: {
|
|
215
214
|
type: "mcp";
|
|
216
215
|
mcp: ToolMcpConfig;
|
|
217
216
|
};
|
|
217
|
+
credentialReferenceId: string | null;
|
|
218
218
|
credentialScope: string;
|
|
219
219
|
imageUrl: string | null;
|
|
220
220
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -37,8 +37,8 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
|
|
|
37
37
|
authentication: unknown;
|
|
38
38
|
signingSecretCredentialReferenceId: string | null;
|
|
39
39
|
signatureVerification: {
|
|
40
|
-
algorithm: "
|
|
41
|
-
encoding: "
|
|
40
|
+
algorithm: "md5" | "sha256" | "sha512" | "sha384" | "sha1";
|
|
41
|
+
encoding: "base64" | "hex";
|
|
42
42
|
signature: {
|
|
43
43
|
source: "query" | "body" | "header";
|
|
44
44
|
key: string;
|
|
@@ -60,7 +60,7 @@ declare const getAppByIdForProject: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
60
60
|
}) => Promise<AppSelect | undefined>;
|
|
61
61
|
declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
|
|
62
62
|
scopes: TenantScopeConfig & {
|
|
63
|
-
|
|
63
|
+
projectIds?: string[];
|
|
64
64
|
};
|
|
65
65
|
pagination?: PaginationConfig;
|
|
66
66
|
type?: AppType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { apps } from "../../db/runtime/runtime-schema.js";
|
|
2
2
|
import { projectScopedWhere, tenantScopedWhere } from "../manage/scope-helpers.js";
|
|
3
|
-
import { and, count, desc, eq } from "drizzle-orm";
|
|
3
|
+
import { and, count, desc, eq, inArray } from "drizzle-orm";
|
|
4
4
|
|
|
5
5
|
//#region src/data-access/runtime/apps.ts
|
|
6
6
|
const getAppById = (db) => async (id) => {
|
|
@@ -20,7 +20,7 @@ const listAppsPaginated = (db) => async (params) => {
|
|
|
20
20
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
21
21
|
const offset = (page - 1) * limit;
|
|
22
22
|
const conditions = [tenantScopedWhere(apps, params.scopes)];
|
|
23
|
-
if (params.scopes.
|
|
23
|
+
if (params.scopes.projectIds && params.scopes.projectIds.length > 0) conditions.push(inArray(apps.projectId, params.scopes.projectIds));
|
|
24
24
|
if (params.type) conditions.push(eq(apps.type, params.type));
|
|
25
25
|
const whereClause = and(...conditions);
|
|
26
26
|
const [data, totalResult] = await Promise.all([db.select().from(apps).where(whereClause).limit(limit).offset(offset).orderBy(desc(apps.createdAt)), db.select({ count: count() }).from(apps).where(whereClause)]);
|
|
@@ -25,9 +25,9 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
|
|
|
25
25
|
} | null;
|
|
26
26
|
userId: string | null;
|
|
27
27
|
metadata: ConversationMetadata | null;
|
|
28
|
-
title: string | null;
|
|
29
28
|
tenantId: string;
|
|
30
29
|
projectId: string;
|
|
30
|
+
title: string | null;
|
|
31
31
|
agentId: string | null;
|
|
32
32
|
activeSubAgentId: string;
|
|
33
33
|
lastContextResolution: string | null;
|
|
@@ -94,9 +94,9 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
94
94
|
} | null;
|
|
95
95
|
userId: string | null;
|
|
96
96
|
metadata: ConversationMetadata | null;
|
|
97
|
-
title: string | null;
|
|
98
97
|
tenantId: string;
|
|
99
98
|
projectId: string;
|
|
99
|
+
title: string | null;
|
|
100
100
|
agentId: string | null;
|
|
101
101
|
activeSubAgentId: string;
|
|
102
102
|
lastContextResolution: string | null;
|
|
@@ -130,9 +130,9 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
|
|
|
130
130
|
} | null;
|
|
131
131
|
userId: string | null;
|
|
132
132
|
metadata: ConversationMetadata | null;
|
|
133
|
-
title: string | null;
|
|
134
133
|
tenantId: string;
|
|
135
134
|
projectId: string;
|
|
135
|
+
title: string | null;
|
|
136
136
|
agentId: string | null;
|
|
137
137
|
activeSubAgentId: string;
|
|
138
138
|
lastContextResolution: string | null;
|
|
@@ -162,9 +162,9 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
|
|
|
162
162
|
} | null;
|
|
163
163
|
userId: string | null;
|
|
164
164
|
metadata: ConversationMetadata | null;
|
|
165
|
-
title: string | null;
|
|
166
165
|
tenantId: string;
|
|
167
166
|
projectId: string;
|
|
167
|
+
title: string | null;
|
|
168
168
|
agentId: string | null;
|
|
169
169
|
activeSubAgentId: string;
|
|
170
170
|
lastContextResolution: string | null;
|
|
@@ -15,9 +15,9 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
15
15
|
updatedAt: string;
|
|
16
16
|
metadata: MessageMetadata | null;
|
|
17
17
|
role: string;
|
|
18
|
-
content: MessageContent;
|
|
19
18
|
tenantId: string;
|
|
20
19
|
projectId: string;
|
|
20
|
+
content: MessageContent;
|
|
21
21
|
conversationId: string;
|
|
22
22
|
fromSubAgentId: string | null;
|
|
23
23
|
toSubAgentId: string | null;
|
|
@@ -149,9 +149,9 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
149
149
|
updatedAt: string;
|
|
150
150
|
metadata: MessageMetadata | null;
|
|
151
151
|
role: string;
|
|
152
|
-
content: MessageContent;
|
|
153
152
|
tenantId: string;
|
|
154
153
|
projectId: string;
|
|
154
|
+
content: MessageContent;
|
|
155
155
|
conversationId: string;
|
|
156
156
|
fromSubAgentId: string | null;
|
|
157
157
|
toSubAgentId: string | null;
|
|
@@ -202,9 +202,9 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
|
|
|
202
202
|
updatedAt: string;
|
|
203
203
|
metadata: MessageMetadata | null;
|
|
204
204
|
role: string;
|
|
205
|
-
content: MessageContent;
|
|
206
205
|
tenantId: string;
|
|
207
206
|
projectId: string;
|
|
207
|
+
content: MessageContent;
|
|
208
208
|
conversationId: string;
|
|
209
209
|
fromSubAgentId: string | null;
|
|
210
210
|
toSubAgentId: string | null;
|