@inkeep/agents-core 0.63.1 → 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.
Files changed (54) hide show
  1. package/dist/auth/auth-schema.d.ts +86 -86
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.d.ts +6 -6
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/client-exports.d.ts +5 -2
  6. package/dist/client-exports.js +6 -2
  7. package/dist/data-access/index.d.ts +2 -2
  8. package/dist/data-access/index.js +2 -2
  9. package/dist/data-access/manage/agents.d.ts +30 -30
  10. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  11. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  12. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  13. package/dist/data-access/manage/functionTools.d.ts +18 -18
  14. package/dist/data-access/manage/projectFull.js +42 -44
  15. package/dist/data-access/manage/skills.d.ts +85 -37
  16. package/dist/data-access/manage/skills.js +259 -46
  17. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  18. package/dist/data-access/manage/subAgentRelations.d.ts +30 -30
  19. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
  20. package/dist/data-access/manage/subAgents.d.ts +18 -18
  21. package/dist/data-access/manage/tools.d.ts +33 -33
  22. package/dist/data-access/manage/triggers.d.ts +1 -1
  23. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  24. package/dist/data-access/runtime/apps.d.ts +8 -8
  25. package/dist/data-access/runtime/conversations.d.ts +20 -20
  26. package/dist/data-access/runtime/messages.d.ts +24 -24
  27. package/dist/data-access/runtime/tasks.d.ts +5 -5
  28. package/dist/db/manage/manage-schema.d.ts +163 -4
  29. package/dist/db/manage/manage-schema.js +52 -2
  30. package/dist/db/runtime/runtime-schema.d.ts +369 -369
  31. package/dist/index.d.ts +8 -5
  32. package/dist/index.js +7 -4
  33. package/dist/types/entities.d.ts +11 -2
  34. package/dist/types/index.d.ts +2 -2
  35. package/dist/utils/index.d.ts +2 -1
  36. package/dist/utils/index.js +2 -1
  37. package/dist/utils/skill-files.d.ts +17 -0
  38. package/dist/utils/skill-files.js +29 -0
  39. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  40. package/dist/validation/drizzle-schema-helpers.js +1 -2
  41. package/dist/validation/index.d.ts +4 -2
  42. package/dist/validation/index.js +4 -2
  43. package/dist/validation/schemas/shared.d.ts +38 -0
  44. package/dist/validation/schemas/shared.js +63 -0
  45. package/dist/validation/schemas/skills.d.ts +602 -0
  46. package/dist/validation/schemas/skills.js +128 -0
  47. package/dist/validation/schemas.d.ts +2741 -3277
  48. package/dist/validation/schemas.js +4 -109
  49. package/drizzle/manage/0014_complex_firebird.sql +15 -0
  50. package/drizzle/manage/0015_backfill_skill_files.sql +61 -0
  51. package/drizzle/manage/meta/0014_snapshot.json +3821 -0
  52. package/drizzle/manage/meta/0015_snapshot.json +3821 -0
  53. package/drizzle/manage/meta/_journal.json +14 -0
  54. 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 createSkill = (db) => async (data) => {
30
- const now = (/* @__PURE__ */ new Date()).toISOString();
31
- const insertData = {
32
- ...data,
33
- id: data.name,
34
- createdAt: now,
35
- updatedAt: now
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
- const [result] = await db.insert(skills).values(insertData).returning();
38
- return result;
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
- const now = (/* @__PURE__ */ new Date()).toISOString();
42
- const baseData = {
43
- ...data,
44
- id: data.name
45
- };
46
- const scopes = {
47
- tenantId: baseData.tenantId,
48
- projectId: baseData.projectId
49
- };
50
- if (await db.query.skills.findFirst({ where: and(projectScopedWhere(skills, scopes), eq(skills.id, baseData.id)) })) {
51
- const [result$1] = await db.update(skills).set({
52
- name: baseData.name,
53
- description: baseData.description,
54
- content: baseData.content,
55
- metadata: baseData.metadata,
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
- }).where(and(projectScopedWhere(skills, scopes), eq(skills.id, baseData.id))).returning();
58
- logger.info({ skillId: baseData.id }, "Updated skill");
59
- return result$1;
60
- }
61
- const insertData = {
62
- ...baseData,
63
- createdAt: now,
64
- updatedAt: now
65
- };
66
- const [result] = await db.insert(skills).values(insertData).returning();
67
- logger.info({ skillId: baseData.id }, "Created skill");
68
- return result;
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
- const { tenantId: _, projectId: _2, ...data } = params.data;
72
- const updateData = {
73
- ...data,
74
- updatedAt: (/* @__PURE__ */ new Date()).toISOString()
75
- };
76
- const [result] = await db.update(skills).set(updateData).where(and(projectScopedWhere(skills, params.scopes), eq(skills.id, params.skillId))).returning();
77
- return result ?? null;
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 };
@@ -9,13 +9,13 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
- agentId: string;
15
- subAgentId: string;
16
12
  id: string;
17
13
  createdAt: string;
18
14
  updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
17
+ agentId: string;
18
+ subAgentId: string;
19
19
  headers: Record<string, string> | null;
20
20
  externalAgentId: string;
21
21
  } | undefined>;
@@ -44,26 +44,26 @@ declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClien
44
44
  declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
- subAgentId: string;
51
47
  id: string;
52
48
  createdAt: string;
53
49
  updatedAt: string;
50
+ projectId: string;
51
+ tenantId: string;
52
+ agentId: string;
53
+ subAgentId: string;
54
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
- tenantId: string;
61
- projectId: string;
62
- agentId: string;
63
- subAgentId: string;
64
60
  id: string;
65
61
  createdAt: string;
66
62
  updatedAt: string;
63
+ projectId: string;
64
+ tenantId: string;
65
+ agentId: string;
66
+ subAgentId: string;
67
67
  headers: Record<string, string> | null;
68
68
  externalAgentId: string;
69
69
  }[]>;
@@ -180,13 +180,13 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
180
180
  headers?: Record<string, string> | null;
181
181
  };
182
182
  }) => Promise<{
183
- tenantId: string;
184
- projectId: string;
185
- agentId: string;
186
- subAgentId: string;
187
183
  id: string;
188
184
  createdAt: string;
189
185
  updatedAt: string;
186
+ projectId: string;
187
+ tenantId: string;
188
+ agentId: string;
189
+ subAgentId: string;
190
190
  headers: Record<string, string> | null;
191
191
  externalAgentId: string;
192
192
  }>;
@@ -197,13 +197,13 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
197
197
  scopes: SubAgentScopeConfig;
198
198
  externalAgentId: string;
199
199
  }) => Promise<{
200
- tenantId: string;
201
- projectId: string;
202
- agentId: string;
203
- subAgentId: string;
204
200
  id: string;
205
201
  createdAt: string;
206
202
  updatedAt: string;
203
+ projectId: string;
204
+ tenantId: string;
205
+ agentId: string;
206
+ subAgentId: string;
207
207
  headers: Record<string, string> | null;
208
208
  externalAgentId: string;
209
209
  } | undefined>;
@@ -218,13 +218,13 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
218
218
  headers?: Record<string, string> | null;
219
219
  };
220
220
  }) => Promise<{
221
- tenantId: string;
222
- projectId: string;
223
- agentId: string;
224
- subAgentId: string;
225
221
  id: string;
226
222
  createdAt: string;
227
223
  updatedAt: string;
224
+ projectId: string;
225
+ tenantId: string;
226
+ agentId: string;
227
+ subAgentId: string;
228
228
  headers: Record<string, string> | null;
229
229
  externalAgentId: string;
230
230
  }>;
@@ -9,12 +9,12 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
9
9
  scopes: AgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
- agentId: string;
15
12
  id: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
17
+ agentId: string;
18
18
  sourceSubAgentId: string;
19
19
  targetSubAgentId: string | null;
20
20
  relationType: string | null;
@@ -44,12 +44,12 @@ declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
47
  id: string;
51
48
  createdAt: string;
52
49
  updatedAt: string;
50
+ projectId: string;
51
+ tenantId: string;
52
+ agentId: string;
53
53
  sourceSubAgentId: string;
54
54
  targetSubAgentId: string | null;
55
55
  relationType: string | null;
@@ -57,12 +57,12 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
57
57
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- projectId: string;
62
- agentId: string;
63
60
  id: string;
64
61
  createdAt: string;
65
62
  updatedAt: string;
63
+ projectId: string;
64
+ tenantId: string;
65
+ agentId: string;
66
66
  sourceSubAgentId: string;
67
67
  targetSubAgentId: string | null;
68
68
  relationType: string | null;
@@ -126,12 +126,12 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
126
126
  }[];
127
127
  }>;
128
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
129
- tenantId: string;
130
- projectId: string;
131
- agentId: string;
132
129
  id: string;
133
130
  createdAt: string;
134
131
  updatedAt: string;
132
+ projectId: string;
133
+ tenantId: string;
134
+ agentId: string;
135
135
  sourceSubAgentId: string;
136
136
  targetSubAgentId: string | null;
137
137
  relationType: string | null;
@@ -145,12 +145,12 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
145
145
  targetSubAgentId?: string;
146
146
  relationType: string;
147
147
  }) => Promise<{
148
- tenantId: string;
149
- projectId: string;
150
- agentId: string;
151
148
  id: string;
152
149
  createdAt: string;
153
150
  updatedAt: string;
151
+ projectId: string;
152
+ tenantId: string;
153
+ agentId: string;
154
154
  sourceSubAgentId: string;
155
155
  targetSubAgentId: string | null;
156
156
  relationType: string | null;
@@ -159,12 +159,12 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
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
- tenantId: string;
163
- projectId: string;
164
- agentId: string;
165
162
  id: string;
166
163
  createdAt: string;
167
164
  updatedAt: string;
165
+ projectId: string;
166
+ tenantId: string;
167
+ agentId: string;
168
168
  sourceSubAgentId: string;
169
169
  targetSubAgentId: string | null;
170
170
  relationType: string | null;
@@ -204,19 +204,19 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
204
204
  }> | null;
205
205
  };
206
206
  }) => Promise<{
207
- tenantId: string;
208
- projectId: string;
209
- agentId: string;
210
- subAgentId: string;
211
- toolId: string;
212
207
  id: string;
213
208
  createdAt: string;
214
209
  updatedAt: string;
210
+ projectId: string;
211
+ tenantId: string;
212
+ agentId: string;
213
+ subAgentId: string;
215
214
  headers: Record<string, string> | null;
216
- selectedTools: string[] | null;
215
+ toolId: string;
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;
@@ -248,19 +248,19 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
248
248
  scopes: SubAgentScopeConfig;
249
249
  relationId: string;
250
250
  }) => Promise<{
251
- tenantId: string;
252
- projectId: string;
253
- agentId: string;
254
- subAgentId: string;
255
- toolId: string;
256
251
  id: string;
257
252
  createdAt: string;
258
253
  updatedAt: string;
254
+ projectId: string;
255
+ tenantId: string;
256
+ agentId: string;
257
+ subAgentId: string;
259
258
  headers: Record<string, string> | null;
260
- selectedTools: string[] | null;
259
+ toolId: string;
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;
@@ -9,13 +9,13 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- projectId: string;
14
- agentId: string;
15
- subAgentId: string;
16
12
  id: string;
17
13
  createdAt: string;
18
14
  updatedAt: string;
15
+ projectId: string;
16
+ tenantId: string;
17
+ agentId: string;
18
+ subAgentId: string;
19
19
  headers: Record<string, string> | null;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
@@ -44,26 +44,26 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
44
44
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
- subAgentId: string;
51
47
  id: string;
52
48
  createdAt: string;
53
49
  updatedAt: string;
50
+ projectId: string;
51
+ tenantId: string;
52
+ agentId: string;
53
+ subAgentId: string;
54
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
- tenantId: string;
61
- projectId: string;
62
- agentId: string;
63
- subAgentId: string;
64
60
  id: string;
65
61
  createdAt: string;
66
62
  updatedAt: string;
63
+ projectId: string;
64
+ tenantId: string;
65
+ agentId: string;
66
+ subAgentId: string;
67
67
  headers: Record<string, string> | null;
68
68
  targetAgentId: string;
69
69
  }[]>;
@@ -210,13 +210,13 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
210
210
  headers?: Record<string, string> | null;
211
211
  };
212
212
  }) => Promise<{
213
- tenantId: string;
214
- projectId: string;
215
- agentId: string;
216
- subAgentId: string;
217
213
  id: string;
218
214
  createdAt: string;
219
215
  updatedAt: string;
216
+ projectId: string;
217
+ tenantId: string;
218
+ agentId: string;
219
+ subAgentId: string;
220
220
  headers: Record<string, string> | null;
221
221
  targetAgentId: string;
222
222
  }>;
@@ -227,13 +227,13 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
227
227
  scopes: SubAgentScopeConfig;
228
228
  targetAgentId: string;
229
229
  }) => Promise<{
230
- tenantId: string;
231
- projectId: string;
232
- agentId: string;
233
- subAgentId: string;
234
230
  id: string;
235
231
  createdAt: string;
236
232
  updatedAt: string;
233
+ projectId: string;
234
+ tenantId: string;
235
+ agentId: string;
236
+ subAgentId: string;
237
237
  headers: Record<string, string> | null;
238
238
  targetAgentId: string;
239
239
  } | undefined>;
@@ -248,13 +248,13 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
248
248
  headers?: Record<string, string> | null;
249
249
  };
250
250
  }) => Promise<{
251
- tenantId: string;
252
- projectId: string;
253
- agentId: string;
254
- subAgentId: string;
255
251
  id: string;
256
252
  createdAt: string;
257
253
  updatedAt: string;
254
+ projectId: string;
255
+ tenantId: string;
256
+ agentId: string;
257
+ subAgentId: string;
258
258
  headers: Record<string, string> | null;
259
259
  targetAgentId: string;
260
260
  }>;