@inkeep/agents-core 0.63.0 → 0.63.2
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 +86 -86
- package/dist/auth/auth-validation-schemas.d.ts +154 -154
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/client-exports.d.ts +5 -2
- package/dist/client-exports.js +6 -2
- package/dist/data-access/index.d.ts +2 -2
- package/dist/data-access/index.js +2 -2
- package/dist/data-access/manage/agents.d.ts +14 -14
- package/dist/data-access/manage/artifactComponents.d.ts +6 -6
- package/dist/data-access/manage/contextConfigs.d.ts +4 -4
- package/dist/data-access/manage/dataComponents.d.ts +2 -2
- package/dist/data-access/manage/functionTools.d.ts +8 -8
- package/dist/data-access/manage/projectFull.js +42 -44
- package/dist/data-access/manage/skills.d.ts +82 -34
- package/dist/data-access/manage/skills.js +259 -46
- package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
- package/dist/data-access/manage/subAgents.d.ts +6 -6
- package/dist/data-access/manage/tools.d.ts +21 -21
- package/dist/data-access/manage/triggers.d.ts +2 -2
- package/dist/data-access/runtime/apiKeys.d.ts +8 -8
- package/dist/data-access/runtime/apps.d.ts +8 -8
- package/dist/data-access/runtime/conversations.d.ts +24 -24
- package/dist/data-access/runtime/messages.d.ts +21 -21
- package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
- package/dist/data-access/runtime/tasks.d.ts +6 -6
- package/dist/db/manage/manage-schema.d.ts +503 -344
- package/dist/db/manage/manage-schema.js +52 -2
- package/dist/db/runtime/runtime-schema.d.ts +369 -369
- package/dist/index.d.ts +8 -5
- package/dist/index.js +7 -4
- package/dist/types/entities.d.ts +11 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/error.d.ts +51 -51
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.js +2 -1
- package/dist/utils/skill-files.d.ts +17 -0
- package/dist/utils/skill-files.js +29 -0
- package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
- package/dist/validation/drizzle-schema-helpers.js +1 -2
- package/dist/validation/index.d.ts +4 -2
- package/dist/validation/index.js +4 -2
- package/dist/validation/schemas/shared.d.ts +38 -0
- package/dist/validation/schemas/shared.js +63 -0
- package/dist/validation/schemas/skills.d.ts +602 -0
- package/dist/validation/schemas/skills.js +128 -0
- package/dist/validation/schemas.d.ts +2635 -3171
- package/dist/validation/schemas.js +4 -109
- package/drizzle/manage/0014_complex_firebird.sql +15 -0
- package/drizzle/manage/0015_backfill_skill_files.sql +61 -0
- package/drizzle/manage/meta/0014_snapshot.json +3821 -0
- package/drizzle/manage/meta/0015_snapshot.json +3821 -0
- package/drizzle/manage/meta/_journal.json +14 -0
- package/package.json +4 -2
|
@@ -1,14 +1,152 @@
|
|
|
1
|
-
import { skills, subAgentSkills } from "../../db/manage/manage-schema.js";
|
|
1
|
+
import { skillFiles, skills, subAgentSkills } from "../../db/manage/manage-schema.js";
|
|
2
|
+
import { SKILL_ENTRY_FILE_PATH, parseSkillFromMarkdown } from "../../utils/skill-files.js";
|
|
3
|
+
import { SkillFrontmatterSchema } from "../../validation/schemas/skills.js";
|
|
2
4
|
import { getLogger } from "../../utils/logger.js";
|
|
3
|
-
import { deriveRelationId } from "../../utils/conversations.js";
|
|
5
|
+
import { deriveRelationId, generateId } from "../../utils/conversations.js";
|
|
4
6
|
import { agentScopedWhere, projectScopedWhere, subAgentScopedWhere } from "./scope-helpers.js";
|
|
5
7
|
import { and, asc, count, desc, eq, inArray } from "drizzle-orm";
|
|
6
8
|
|
|
7
9
|
//#region src/data-access/manage/skills.ts
|
|
8
10
|
const logger = getLogger("skills-dal");
|
|
11
|
+
async function replaceSkillFiles(db, params) {
|
|
12
|
+
const existingFiles = await db.select().from(skillFiles).where(and(eq(skillFiles.tenantId, params.scopes.tenantId), eq(skillFiles.projectId, params.scopes.projectId), eq(skillFiles.skillId, params.skillId)));
|
|
13
|
+
const nextFilePaths = new Set(params.files.map((file) => file.filePath));
|
|
14
|
+
const existingByPath = new Map(existingFiles.map((file) => [file.filePath, file]));
|
|
15
|
+
const fileIdsToDelete = existingFiles.filter((file) => !nextFilePaths.has(file.filePath)).map((file) => file.id);
|
|
16
|
+
if (fileIdsToDelete.length) await db.delete(skillFiles).where(and(projectScopedWhere(skillFiles, params.scopes), eq(skillFiles.skillId, params.skillId), inArray(skillFiles.id, fileIdsToDelete)));
|
|
17
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
18
|
+
const filesToInsert = [];
|
|
19
|
+
for (const file of params.files) {
|
|
20
|
+
const existingFile = existingByPath.get(file.filePath);
|
|
21
|
+
if (!existingFile) {
|
|
22
|
+
filesToInsert.push({
|
|
23
|
+
tenantId: params.scopes.tenantId,
|
|
24
|
+
projectId: params.scopes.projectId,
|
|
25
|
+
skillId: params.skillId,
|
|
26
|
+
id: generateId(),
|
|
27
|
+
filePath: file.filePath,
|
|
28
|
+
content: file.content,
|
|
29
|
+
createdAt: now,
|
|
30
|
+
updatedAt: now
|
|
31
|
+
});
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
await db.update(skillFiles).set({
|
|
35
|
+
content: file.content,
|
|
36
|
+
updatedAt: now
|
|
37
|
+
}).where(and(projectScopedWhere(skillFiles, params.scopes), eq(skillFiles.skillId, params.skillId), eq(skillFiles.id, existingFile.id)));
|
|
38
|
+
}
|
|
39
|
+
if (filesToInsert.length) await db.insert(skillFiles).values(filesToInsert);
|
|
40
|
+
return (await getSkillFilesBySkillIds(db)({
|
|
41
|
+
scopes: params.scopes,
|
|
42
|
+
skillIds: [params.skillId]
|
|
43
|
+
}))[params.skillId] ?? [];
|
|
44
|
+
}
|
|
45
|
+
const getSkillFilesBySkillIds = (db) => async (params) => {
|
|
46
|
+
if (!params.skillIds.length) return {};
|
|
47
|
+
return (await db.select().from(skillFiles).where(and(eq(skillFiles.tenantId, params.scopes.tenantId), eq(skillFiles.projectId, params.scopes.projectId), inArray(skillFiles.skillId, params.skillIds))).orderBy(asc(skillFiles.filePath))).reduce((acc, file) => {
|
|
48
|
+
acc[file.skillId] ??= [];
|
|
49
|
+
acc[file.skillId].push(file);
|
|
50
|
+
return acc;
|
|
51
|
+
}, {});
|
|
52
|
+
};
|
|
9
53
|
const getSkillById = (db) => async (params) => {
|
|
10
54
|
return await db.query.skills.findFirst({ where: and(projectScopedWhere(skills, params.scopes), eq(skills.id, params.skillId)) }) ?? null;
|
|
11
55
|
};
|
|
56
|
+
const getSkillByIdWithFiles = (db) => async (params) => {
|
|
57
|
+
const skill = await getSkillById(db)(params);
|
|
58
|
+
if (!skill) return null;
|
|
59
|
+
const files = await getSkillFilesBySkillIds(db)({
|
|
60
|
+
scopes: params.scopes,
|
|
61
|
+
skillIds: [params.skillId]
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
...skill,
|
|
65
|
+
files: files[params.skillId] ?? []
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
const getSkillFileById = (db) => async (params) => {
|
|
69
|
+
return await db.query.skillFiles.findFirst({ where: and(projectScopedWhere(skillFiles, params.scopes), eq(skillFiles.skillId, params.skillId), eq(skillFiles.id, params.fileId)) }) ?? null;
|
|
70
|
+
};
|
|
71
|
+
const createSkillFileById = (db) => async (params) => {
|
|
72
|
+
const skill = await getSkillByIdWithFiles(db)({
|
|
73
|
+
scopes: params.scopes,
|
|
74
|
+
skillId: params.skillId
|
|
75
|
+
});
|
|
76
|
+
if (!skill) return null;
|
|
77
|
+
if (params.data.filePath === SKILL_ENTRY_FILE_PATH) throw new Error(`Use the skill update flow to manage ${SKILL_ENTRY_FILE_PATH}`);
|
|
78
|
+
if (skill.files.some((file) => file.filePath === params.data.filePath)) throw new Error(`Skill file already exists at path "${params.data.filePath}"`);
|
|
79
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
80
|
+
const [createdFile] = await db.insert(skillFiles).values({
|
|
81
|
+
tenantId: params.scopes.tenantId,
|
|
82
|
+
projectId: params.scopes.projectId,
|
|
83
|
+
skillId: params.skillId,
|
|
84
|
+
id: generateId(),
|
|
85
|
+
filePath: params.data.filePath,
|
|
86
|
+
content: params.data.content,
|
|
87
|
+
createdAt: now,
|
|
88
|
+
updatedAt: now
|
|
89
|
+
}).returning();
|
|
90
|
+
return createdFile ?? null;
|
|
91
|
+
};
|
|
92
|
+
function buildEntryFileUpdateData(params) {
|
|
93
|
+
const parsed = parseSkillFromMarkdown(params.content);
|
|
94
|
+
const frontmatterResult = SkillFrontmatterSchema.safeParse(parsed.frontmatter);
|
|
95
|
+
if (!frontmatterResult.success) throw new Error(frontmatterResult.error.issues[0]?.message ?? "Invalid SKILL.md frontmatter");
|
|
96
|
+
if (frontmatterResult.data.name !== params.skillId) throw new Error("SKILL.md name must match the skill id");
|
|
97
|
+
return {
|
|
98
|
+
description: frontmatterResult.data.description,
|
|
99
|
+
metadata: frontmatterResult.data.metadata ?? null,
|
|
100
|
+
content: parsed.content,
|
|
101
|
+
files: params.files
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
const updateSkillFileById = (db) => async (params) => {
|
|
105
|
+
const skill = await getSkillByIdWithFiles(db)({
|
|
106
|
+
scopes: params.scopes,
|
|
107
|
+
skillId: params.skillId
|
|
108
|
+
});
|
|
109
|
+
if (!skill) return null;
|
|
110
|
+
const existingFile = skill.files.find((file) => file.id === params.fileId);
|
|
111
|
+
if (!existingFile) return null;
|
|
112
|
+
const files = skill.files.map((file) => ({
|
|
113
|
+
filePath: file.filePath,
|
|
114
|
+
content: file.id === params.fileId ? params.content : file.content
|
|
115
|
+
}));
|
|
116
|
+
const data = existingFile.filePath === SKILL_ENTRY_FILE_PATH ? buildEntryFileUpdateData({
|
|
117
|
+
skillId: params.skillId,
|
|
118
|
+
files,
|
|
119
|
+
content: params.content
|
|
120
|
+
}) : { files };
|
|
121
|
+
if (!await updateSkill(db)({
|
|
122
|
+
scopes: params.scopes,
|
|
123
|
+
skillId: params.skillId,
|
|
124
|
+
data
|
|
125
|
+
})) return null;
|
|
126
|
+
return await getSkillFileById(db)({
|
|
127
|
+
scopes: params.scopes,
|
|
128
|
+
skillId: params.skillId,
|
|
129
|
+
fileId: params.fileId
|
|
130
|
+
});
|
|
131
|
+
};
|
|
132
|
+
const deleteSkillFileById = (db) => async (params) => {
|
|
133
|
+
const skill = await getSkillByIdWithFiles(db)({
|
|
134
|
+
scopes: params.scopes,
|
|
135
|
+
skillId: params.skillId
|
|
136
|
+
});
|
|
137
|
+
if (!skill) return null;
|
|
138
|
+
const existingFile = skill.files.find((file) => file.id === params.fileId);
|
|
139
|
+
if (!existingFile) return null;
|
|
140
|
+
if (existingFile.filePath === SKILL_ENTRY_FILE_PATH) throw new Error("Use the skill delete flow to remove SKILL.md");
|
|
141
|
+
return await updateSkill(db)({
|
|
142
|
+
scopes: params.scopes,
|
|
143
|
+
skillId: params.skillId,
|
|
144
|
+
data: { files: skill.files.filter((file) => file.id !== params.fileId).map((file) => ({
|
|
145
|
+
filePath: file.filePath,
|
|
146
|
+
content: file.content
|
|
147
|
+
})) }
|
|
148
|
+
}) !== null;
|
|
149
|
+
};
|
|
12
150
|
const listSkills = (db) => async (params) => {
|
|
13
151
|
const page = params.pagination?.page || 1;
|
|
14
152
|
const limit = Math.min(params.pagination?.limit || 10, 100);
|
|
@@ -26,55 +164,130 @@ const listSkills = (db) => async (params) => {
|
|
|
26
164
|
}
|
|
27
165
|
};
|
|
28
166
|
};
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
167
|
+
const listSkillsWithFiles = (db) => async (params) => {
|
|
168
|
+
const result = await listSkills(db)(params);
|
|
169
|
+
const skillIds = result.data.map((skill) => skill.id);
|
|
170
|
+
const filesBySkillId = await getSkillFilesBySkillIds(db)({
|
|
171
|
+
scopes: params.scopes,
|
|
172
|
+
skillIds
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
...result,
|
|
176
|
+
data: result.data.map((skill) => ({
|
|
177
|
+
...skill,
|
|
178
|
+
files: filesBySkillId[skill.id] ?? []
|
|
179
|
+
}))
|
|
36
180
|
};
|
|
37
|
-
|
|
38
|
-
|
|
181
|
+
};
|
|
182
|
+
const createSkill = (db) => async (data) => {
|
|
183
|
+
return await db.transaction(async (tx) => {
|
|
184
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
185
|
+
const insertData = {
|
|
186
|
+
tenantId: data.tenantId,
|
|
187
|
+
projectId: data.projectId,
|
|
188
|
+
id: data.name,
|
|
189
|
+
name: data.name,
|
|
190
|
+
description: data.description,
|
|
191
|
+
content: data.content,
|
|
192
|
+
metadata: data.metadata ?? null,
|
|
193
|
+
createdAt: now,
|
|
194
|
+
updatedAt: now
|
|
195
|
+
};
|
|
196
|
+
const [result] = await tx.insert(skills).values(insertData).returning();
|
|
197
|
+
await replaceSkillFiles(tx, {
|
|
198
|
+
scopes: {
|
|
199
|
+
tenantId: data.tenantId,
|
|
200
|
+
projectId: data.projectId
|
|
201
|
+
},
|
|
202
|
+
skillId: result.id,
|
|
203
|
+
files: data.files
|
|
204
|
+
});
|
|
205
|
+
const createdSkill = await getSkillByIdWithFiles(tx)({
|
|
206
|
+
scopes: {
|
|
207
|
+
tenantId: data.tenantId,
|
|
208
|
+
projectId: data.projectId
|
|
209
|
+
},
|
|
210
|
+
skillId: result.id
|
|
211
|
+
});
|
|
212
|
+
if (!createdSkill) throw new Error(`Failed to load created skill "${result.id}"`);
|
|
213
|
+
return createdSkill;
|
|
214
|
+
});
|
|
39
215
|
};
|
|
40
216
|
const upsertSkill = (db) => async (data) => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
217
|
+
return await db.transaction(async (tx) => {
|
|
218
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
219
|
+
const baseData = {
|
|
220
|
+
tenantId: data.tenantId,
|
|
221
|
+
projectId: data.projectId,
|
|
222
|
+
id: data.name,
|
|
223
|
+
name: data.name,
|
|
224
|
+
description: data.description,
|
|
225
|
+
content: data.content,
|
|
226
|
+
metadata: data.metadata ?? null
|
|
227
|
+
};
|
|
228
|
+
const scopes = {
|
|
229
|
+
tenantId: baseData.tenantId,
|
|
230
|
+
projectId: baseData.projectId
|
|
231
|
+
};
|
|
232
|
+
const existing = await tx.query.skills.findFirst({ where: and(projectScopedWhere(skills, scopes), eq(skills.id, baseData.id)) });
|
|
233
|
+
const files = data.files;
|
|
234
|
+
if (existing) {
|
|
235
|
+
const [result$1] = await tx.update(skills).set({
|
|
236
|
+
name: baseData.name,
|
|
237
|
+
description: baseData.description,
|
|
238
|
+
content: baseData.content,
|
|
239
|
+
metadata: baseData.metadata,
|
|
240
|
+
updatedAt: now
|
|
241
|
+
}).where(and(projectScopedWhere(skills, scopes), eq(skills.id, baseData.id))).returning();
|
|
242
|
+
await replaceSkillFiles(tx, {
|
|
243
|
+
scopes: {
|
|
244
|
+
tenantId: baseData.tenantId,
|
|
245
|
+
projectId: baseData.projectId
|
|
246
|
+
},
|
|
247
|
+
skillId: baseData.id,
|
|
248
|
+
files
|
|
249
|
+
});
|
|
250
|
+
logger.info({ skillId: baseData.id }, "Updated skill");
|
|
251
|
+
return result$1;
|
|
252
|
+
}
|
|
253
|
+
const insertData = {
|
|
254
|
+
...baseData,
|
|
255
|
+
createdAt: now,
|
|
56
256
|
updatedAt: now
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
257
|
+
};
|
|
258
|
+
const [result] = await tx.insert(skills).values(insertData).returning();
|
|
259
|
+
await replaceSkillFiles(tx, {
|
|
260
|
+
scopes: {
|
|
261
|
+
tenantId: baseData.tenantId,
|
|
262
|
+
projectId: baseData.projectId
|
|
263
|
+
},
|
|
264
|
+
skillId: baseData.id,
|
|
265
|
+
files
|
|
266
|
+
});
|
|
267
|
+
logger.info({ skillId: baseData.id }, "Created skill");
|
|
268
|
+
return result;
|
|
269
|
+
});
|
|
69
270
|
};
|
|
70
271
|
const updateSkill = (db) => async (params) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
272
|
+
return await db.transaction(async (tx) => {
|
|
273
|
+
if (!await tx.query.skills.findFirst({ where: and(eq(skills.tenantId, params.scopes.tenantId), eq(skills.projectId, params.scopes.projectId), eq(skills.id, params.skillId)) })) return null;
|
|
274
|
+
const { description, metadata, content } = params.data;
|
|
275
|
+
const updateData = { updatedAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
276
|
+
if (description !== void 0) updateData.description = description;
|
|
277
|
+
if (metadata !== void 0) updateData.metadata = metadata;
|
|
278
|
+
if (content !== void 0) updateData.content = content;
|
|
279
|
+
if (!params.data.files) throw new Error("Skill updates must include files");
|
|
280
|
+
const [result] = await tx.update(skills).set(updateData).where(and(projectScopedWhere(skills, params.scopes), eq(skills.id, params.skillId))).returning();
|
|
281
|
+
await replaceSkillFiles(tx, {
|
|
282
|
+
scopes: params.scopes,
|
|
283
|
+
skillId: params.skillId,
|
|
284
|
+
files: params.data.files
|
|
285
|
+
});
|
|
286
|
+
return result ? await getSkillByIdWithFiles(tx)({
|
|
287
|
+
scopes: params.scopes,
|
|
288
|
+
skillId: params.skillId
|
|
289
|
+
}) : null;
|
|
290
|
+
});
|
|
78
291
|
};
|
|
79
292
|
const deleteSkill = (db) => async (params) => {
|
|
80
293
|
return (await db.delete(skills).where(and(projectScopedWhere(skills, params.scopes), eq(skills.id, params.skillId))).returning()).length > 0;
|
|
@@ -123,4 +336,4 @@ const deleteSubAgentSkill = (db) => async (params) => {
|
|
|
123
336
|
};
|
|
124
337
|
|
|
125
338
|
//#endregion
|
|
126
|
-
export { createSkill, deleteSkill, deleteSubAgentSkill, getSkillById, getSkillsForSubAgents, listSkills, updateSkill, upsertSkill, upsertSubAgentSkill };
|
|
339
|
+
export { createSkill, createSkillFileById, deleteSkill, deleteSkillFileById, deleteSubAgentSkill, getSkillById, getSkillByIdWithFiles, getSkillFileById, getSkillFilesBySkillIds, getSkillsForSubAgents, listSkills, listSkillsWithFiles, updateSkill, updateSkillFileById, upsertSkill, upsertSubAgentSkill };
|
|
@@ -12,11 +12,11 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
headers: Record<string, string> | null;
|
|
16
|
-
tenantId: string;
|
|
17
15
|
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
18
17
|
agentId: string;
|
|
19
18
|
subAgentId: string;
|
|
19
|
+
headers: Record<string, string> | null;
|
|
20
20
|
externalAgentId: string;
|
|
21
21
|
} | undefined>;
|
|
22
22
|
declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -47,11 +47,11 @@ declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient
|
|
|
47
47
|
id: string;
|
|
48
48
|
createdAt: string;
|
|
49
49
|
updatedAt: string;
|
|
50
|
-
headers: Record<string, string> | null;
|
|
51
|
-
tenantId: string;
|
|
52
50
|
projectId: string;
|
|
51
|
+
tenantId: string;
|
|
53
52
|
agentId: string;
|
|
54
53
|
subAgentId: string;
|
|
54
|
+
headers: Record<string, string> | null;
|
|
55
55
|
externalAgentId: string;
|
|
56
56
|
}[]>;
|
|
57
57
|
declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -60,11 +60,11 @@ declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabas
|
|
|
60
60
|
id: string;
|
|
61
61
|
createdAt: string;
|
|
62
62
|
updatedAt: string;
|
|
63
|
-
headers: Record<string, string> | null;
|
|
64
|
-
tenantId: string;
|
|
65
63
|
projectId: string;
|
|
64
|
+
tenantId: string;
|
|
66
65
|
agentId: string;
|
|
67
66
|
subAgentId: string;
|
|
67
|
+
headers: Record<string, string> | null;
|
|
68
68
|
externalAgentId: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -183,11 +183,11 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
183
183
|
id: string;
|
|
184
184
|
createdAt: string;
|
|
185
185
|
updatedAt: string;
|
|
186
|
-
headers: Record<string, string> | null;
|
|
187
|
-
tenantId: string;
|
|
188
186
|
projectId: string;
|
|
187
|
+
tenantId: string;
|
|
189
188
|
agentId: string;
|
|
190
189
|
subAgentId: string;
|
|
190
|
+
headers: Record<string, string> | null;
|
|
191
191
|
externalAgentId: string;
|
|
192
192
|
}>;
|
|
193
193
|
/**
|
|
@@ -200,11 +200,11 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
|
|
|
200
200
|
id: string;
|
|
201
201
|
createdAt: string;
|
|
202
202
|
updatedAt: string;
|
|
203
|
-
headers: Record<string, string> | null;
|
|
204
|
-
tenantId: string;
|
|
205
203
|
projectId: string;
|
|
204
|
+
tenantId: string;
|
|
206
205
|
agentId: string;
|
|
207
206
|
subAgentId: string;
|
|
207
|
+
headers: Record<string, string> | null;
|
|
208
208
|
externalAgentId: string;
|
|
209
209
|
} | undefined>;
|
|
210
210
|
/**
|
|
@@ -221,11 +221,11 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
|
|
|
221
221
|
id: string;
|
|
222
222
|
createdAt: string;
|
|
223
223
|
updatedAt: string;
|
|
224
|
-
headers: Record<string, string> | null;
|
|
225
|
-
tenantId: string;
|
|
226
224
|
projectId: string;
|
|
225
|
+
tenantId: string;
|
|
227
226
|
agentId: string;
|
|
228
227
|
subAgentId: string;
|
|
228
|
+
headers: Record<string, string> | null;
|
|
229
229
|
externalAgentId: string;
|
|
230
230
|
}>;
|
|
231
231
|
declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -12,8 +12,8 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
tenantId: string;
|
|
16
15
|
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
17
17
|
agentId: string;
|
|
18
18
|
sourceSubAgentId: string;
|
|
19
19
|
targetSubAgentId: string | null;
|
|
@@ -47,8 +47,8 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
47
47
|
id: string;
|
|
48
48
|
createdAt: string;
|
|
49
49
|
updatedAt: string;
|
|
50
|
-
tenantId: string;
|
|
51
50
|
projectId: string;
|
|
51
|
+
tenantId: string;
|
|
52
52
|
agentId: string;
|
|
53
53
|
sourceSubAgentId: string;
|
|
54
54
|
targetSubAgentId: string | null;
|
|
@@ -60,8 +60,8 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
|
|
|
60
60
|
id: string;
|
|
61
61
|
createdAt: string;
|
|
62
62
|
updatedAt: string;
|
|
63
|
-
tenantId: string;
|
|
64
63
|
projectId: string;
|
|
64
|
+
tenantId: string;
|
|
65
65
|
agentId: string;
|
|
66
66
|
sourceSubAgentId: string;
|
|
67
67
|
targetSubAgentId: string | null;
|
|
@@ -129,8 +129,8 @@ declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
129
129
|
id: string;
|
|
130
130
|
createdAt: string;
|
|
131
131
|
updatedAt: string;
|
|
132
|
-
tenantId: string;
|
|
133
132
|
projectId: string;
|
|
133
|
+
tenantId: string;
|
|
134
134
|
agentId: string;
|
|
135
135
|
sourceSubAgentId: string;
|
|
136
136
|
targetSubAgentId: string | null;
|
|
@@ -148,8 +148,8 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
|
|
|
148
148
|
id: string;
|
|
149
149
|
createdAt: string;
|
|
150
150
|
updatedAt: string;
|
|
151
|
-
tenantId: string;
|
|
152
151
|
projectId: string;
|
|
152
|
+
tenantId: string;
|
|
153
153
|
agentId: string;
|
|
154
154
|
sourceSubAgentId: string;
|
|
155
155
|
targetSubAgentId: string | null;
|
|
@@ -162,8 +162,8 @@ declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (param
|
|
|
162
162
|
id: string;
|
|
163
163
|
createdAt: string;
|
|
164
164
|
updatedAt: string;
|
|
165
|
-
tenantId: string;
|
|
166
165
|
projectId: string;
|
|
166
|
+
tenantId: string;
|
|
167
167
|
agentId: string;
|
|
168
168
|
sourceSubAgentId: string;
|
|
169
169
|
targetSubAgentId: string | null;
|
|
@@ -207,16 +207,16 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
|
|
|
207
207
|
id: string;
|
|
208
208
|
createdAt: string;
|
|
209
209
|
updatedAt: string;
|
|
210
|
-
headers: Record<string, string> | null;
|
|
211
|
-
tenantId: string;
|
|
212
210
|
projectId: string;
|
|
211
|
+
tenantId: string;
|
|
213
212
|
agentId: string;
|
|
214
213
|
subAgentId: string;
|
|
214
|
+
headers: Record<string, string> | null;
|
|
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;
|
|
@@ -251,16 +251,16 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
|
|
|
251
251
|
id: string;
|
|
252
252
|
createdAt: string;
|
|
253
253
|
updatedAt: string;
|
|
254
|
-
headers: Record<string, string> | null;
|
|
255
|
-
tenantId: string;
|
|
256
254
|
projectId: string;
|
|
255
|
+
tenantId: string;
|
|
257
256
|
agentId: string;
|
|
258
257
|
subAgentId: string;
|
|
258
|
+
headers: Record<string, string> | null;
|
|
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;
|
|
@@ -12,11 +12,11 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
|
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: string;
|
|
14
14
|
updatedAt: string;
|
|
15
|
-
headers: Record<string, string> | null;
|
|
16
|
-
tenantId: string;
|
|
17
15
|
projectId: string;
|
|
16
|
+
tenantId: string;
|
|
18
17
|
agentId: string;
|
|
19
18
|
subAgentId: string;
|
|
19
|
+
headers: Record<string, string> | null;
|
|
20
20
|
targetAgentId: string;
|
|
21
21
|
} | undefined>;
|
|
22
22
|
declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -47,11 +47,11 @@ declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =>
|
|
|
47
47
|
id: string;
|
|
48
48
|
createdAt: string;
|
|
49
49
|
updatedAt: string;
|
|
50
|
-
headers: Record<string, string> | null;
|
|
51
|
-
tenantId: string;
|
|
52
50
|
projectId: string;
|
|
51
|
+
tenantId: string;
|
|
53
52
|
agentId: string;
|
|
54
53
|
subAgentId: string;
|
|
54
|
+
headers: Record<string, string> | null;
|
|
55
55
|
targetAgentId: string;
|
|
56
56
|
}[]>;
|
|
57
57
|
declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -60,11 +60,11 @@ declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseCli
|
|
|
60
60
|
id: string;
|
|
61
61
|
createdAt: string;
|
|
62
62
|
updatedAt: string;
|
|
63
|
-
headers: Record<string, string> | null;
|
|
64
|
-
tenantId: string;
|
|
65
63
|
projectId: string;
|
|
64
|
+
tenantId: string;
|
|
66
65
|
agentId: string;
|
|
67
66
|
subAgentId: string;
|
|
67
|
+
headers: Record<string, string> | null;
|
|
68
68
|
targetAgentId: string;
|
|
69
69
|
}[]>;
|
|
70
70
|
declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -213,11 +213,11 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
213
213
|
id: string;
|
|
214
214
|
createdAt: string;
|
|
215
215
|
updatedAt: string;
|
|
216
|
-
headers: Record<string, string> | null;
|
|
217
|
-
tenantId: string;
|
|
218
216
|
projectId: string;
|
|
217
|
+
tenantId: string;
|
|
219
218
|
agentId: string;
|
|
220
219
|
subAgentId: string;
|
|
220
|
+
headers: Record<string, string> | null;
|
|
221
221
|
targetAgentId: string;
|
|
222
222
|
}>;
|
|
223
223
|
/**
|
|
@@ -230,11 +230,11 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
|
|
|
230
230
|
id: string;
|
|
231
231
|
createdAt: string;
|
|
232
232
|
updatedAt: string;
|
|
233
|
-
headers: Record<string, string> | null;
|
|
234
|
-
tenantId: string;
|
|
235
233
|
projectId: string;
|
|
234
|
+
tenantId: string;
|
|
236
235
|
agentId: string;
|
|
237
236
|
subAgentId: string;
|
|
237
|
+
headers: Record<string, string> | null;
|
|
238
238
|
targetAgentId: string;
|
|
239
239
|
} | undefined>;
|
|
240
240
|
/**
|
|
@@ -251,11 +251,11 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
|
|
|
251
251
|
id: string;
|
|
252
252
|
createdAt: string;
|
|
253
253
|
updatedAt: string;
|
|
254
|
-
headers: Record<string, string> | null;
|
|
255
|
-
tenantId: string;
|
|
256
254
|
projectId: string;
|
|
255
|
+
tenantId: string;
|
|
257
256
|
agentId: string;
|
|
258
257
|
subAgentId: string;
|
|
258
|
+
headers: Record<string, string> | null;
|
|
259
259
|
targetAgentId: string;
|
|
260
260
|
}>;
|
|
261
261
|
declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
|
|
@@ -11,9 +11,10 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
11
11
|
}) => Promise<{
|
|
12
12
|
id: string;
|
|
13
13
|
name: string;
|
|
14
|
+
description: string | null;
|
|
14
15
|
createdAt: string;
|
|
15
16
|
updatedAt: string;
|
|
16
|
-
|
|
17
|
+
projectId: string;
|
|
17
18
|
tenantId: string;
|
|
18
19
|
models: {
|
|
19
20
|
base?: {
|
|
@@ -32,7 +33,6 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
32
33
|
stopWhen: {
|
|
33
34
|
stepCountIs?: number | undefined;
|
|
34
35
|
} | null;
|
|
35
|
-
projectId: string;
|
|
36
36
|
agentId: string;
|
|
37
37
|
prompt: string | null;
|
|
38
38
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
@@ -42,9 +42,10 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
42
42
|
}) => Promise<{
|
|
43
43
|
id: string;
|
|
44
44
|
name: string;
|
|
45
|
+
description: string | null;
|
|
45
46
|
createdAt: string;
|
|
46
47
|
updatedAt: string;
|
|
47
|
-
|
|
48
|
+
projectId: string;
|
|
48
49
|
tenantId: string;
|
|
49
50
|
models: {
|
|
50
51
|
base?: {
|
|
@@ -63,7 +64,6 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
|
|
|
63
64
|
stopWhen: {
|
|
64
65
|
stepCountIs?: number | undefined;
|
|
65
66
|
} | null;
|
|
66
|
-
projectId: string;
|
|
67
67
|
agentId: string;
|
|
68
68
|
prompt: string | null;
|
|
69
69
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|
|
@@ -111,9 +111,10 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
|
|
|
111
111
|
declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
|
|
112
112
|
id: string;
|
|
113
113
|
name: string;
|
|
114
|
+
description: string | null;
|
|
114
115
|
createdAt: string;
|
|
115
116
|
updatedAt: string;
|
|
116
|
-
|
|
117
|
+
projectId: string;
|
|
117
118
|
tenantId: string;
|
|
118
119
|
models: {
|
|
119
120
|
base?: {
|
|
@@ -132,7 +133,6 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
|
|
|
132
133
|
stopWhen: {
|
|
133
134
|
stepCountIs?: number | undefined;
|
|
134
135
|
} | null;
|
|
135
|
-
projectId: string;
|
|
136
136
|
agentId: string;
|
|
137
137
|
prompt: string | null;
|
|
138
138
|
conversationHistoryConfig: ConversationHistoryConfig | null;
|