@inkeep/agents-core 0.0.0-dev-20260309140215 → 0.0.0-dev-20260309145022

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 (33) hide show
  1. package/dist/auth/auth-validation-schemas.d.ts +135 -135
  2. package/dist/auth/auth.d.ts +9 -9
  3. package/dist/auth/permissions.d.ts +9 -9
  4. package/dist/client-exports.d.ts +2 -2
  5. package/dist/data-access/manage/agents.d.ts +20 -20
  6. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  7. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  8. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  9. package/dist/data-access/manage/functionTools.d.ts +16 -16
  10. package/dist/data-access/manage/skills.d.ts +13 -13
  11. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  12. package/dist/data-access/manage/subAgentRelations.d.ts +32 -32
  13. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
  14. package/dist/data-access/manage/subAgents.d.ts +12 -12
  15. package/dist/data-access/manage/tools.d.ts +21 -21
  16. package/dist/data-access/manage/tools.js +2 -0
  17. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  18. package/dist/data-access/runtime/cascade-delete.js +2 -2
  19. package/dist/data-access/runtime/conversations.d.ts +31 -31
  20. package/dist/data-access/runtime/github-work-app-installations.d.ts +25 -5
  21. package/dist/data-access/runtime/github-work-app-installations.js +20 -17
  22. package/dist/data-access/runtime/messages.d.ts +18 -18
  23. package/dist/data-access/runtime/tasks.d.ts +8 -8
  24. package/dist/db/manage/manage-schema.d.ts +449 -449
  25. package/dist/db/runtime/runtime-schema.d.ts +318 -318
  26. package/dist/db/runtime/runtime-schema.js +5 -1
  27. package/dist/utils/error.d.ts +51 -51
  28. package/dist/validation/dolt-schemas.d.ts +1 -1
  29. package/dist/validation/schemas.d.ts +1634 -1634
  30. package/drizzle/runtime/0021_careful_xorn.sql +2 -0
  31. package/drizzle/runtime/meta/0021_snapshot.json +4124 -0
  32. package/drizzle/runtime/meta/_journal.json +7 -0
  33. package/package.json +1 -1
@@ -187,7 +187,11 @@ declare const setMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (para
187
187
  * Get MCP tool repository access entries
188
188
  * These entries are used when mode='selected'. Check mode via getMcpToolAccessMode().
189
189
  */
190
- declare const getMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<{
190
+ declare const getMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (scope: {
191
+ tenantId: string;
192
+ projectId: string;
193
+ toolId: string;
194
+ }) => Promise<{
191
195
  id: string;
192
196
  toolId: string;
193
197
  tenantId: string;
@@ -201,7 +205,11 @@ declare const getMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (tool
201
205
  * If the tool's access mode is 'all', returns all repositories the project has access to.
202
206
  * If mode is 'selected' (or not set), returns only explicitly granted repositories.
203
207
  */
204
- declare const getMcpToolRepositoryAccessWithDetails: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<(WorkAppGitHubRepositorySelect & {
208
+ declare const getMcpToolRepositoryAccessWithDetails: (db: AgentsRunDatabaseClient) => (scope: {
209
+ tenantId: string;
210
+ projectId: string;
211
+ toolId: string;
212
+ }) => Promise<(WorkAppGitHubRepositorySelect & {
205
213
  accessId: string;
206
214
  installationAccountLogin: string;
207
215
  installationId: string;
@@ -209,7 +217,11 @@ declare const getMcpToolRepositoryAccessWithDetails: (db: AgentsRunDatabaseClien
209
217
  /**
210
218
  * Remove all MCP tool repository access for a specific tool
211
219
  */
212
- declare const clearMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<number>;
220
+ declare const clearMcpToolRepositoryAccess: (db: AgentsRunDatabaseClient) => (scope: {
221
+ tenantId: string;
222
+ projectId: string;
223
+ toolId: string;
224
+ }) => Promise<number>;
213
225
  declare const isGithubWorkAppTool: (tool: ToolSelect | McpTool) => boolean | undefined;
214
226
  type WorkAppGitHubAccessMode = 'all' | 'selected';
215
227
  /**
@@ -252,10 +264,18 @@ declare const setMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (params: {
252
264
  * Get the access mode for an MCP tool's GitHub repository access.
253
265
  * Returns 'selected' if no mode is explicitly set (fail-safe default).
254
266
  */
255
- declare const getMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<WorkAppGitHubAccessMode>;
267
+ declare const getMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (scope: {
268
+ tenantId: string;
269
+ projectId: string;
270
+ toolId: string;
271
+ }) => Promise<WorkAppGitHubAccessMode>;
256
272
  /**
257
273
  * Delete the access mode entry for an MCP tool
258
274
  */
259
- declare const deleteMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (toolId: string) => Promise<boolean>;
275
+ declare const deleteMcpToolAccessMode: (db: AgentsRunDatabaseClient) => (scope: {
276
+ tenantId: string;
277
+ projectId: string;
278
+ toolId: string;
279
+ }) => Promise<boolean>;
260
280
  //#endregion
261
281
  export { WorkAppGitHubAccessMode, addRepositories, checkProjectRepositoryAccess, clearMcpToolRepositoryAccess, clearProjectRepositoryAccess, createInstallation, deleteInstallation, deleteMcpToolAccessMode, deleteProjectAccessMode, disconnectInstallation, getInstallationByGitHubId, getInstallationById, getInstallationsByTenantId, getMcpToolAccessMode, getMcpToolRepositoryAccess, getMcpToolRepositoryAccessWithDetails, getProjectAccessMode, getProjectRepositoryAccess, getProjectRepositoryAccessWithDetails, getRepositoriesByInstallationId, getRepositoriesByTenantId, getRepositoryByFullName, getRepositoryById, getRepositoryCount, getRepositoryCountsByTenantId, isGithubWorkAppTool, removeRepositories, setMcpToolAccessMode, setMcpToolRepositoryAccess, setProjectAccessMode, setProjectRepositoryAccess, syncRepositories, updateInstallationStatus, updateInstallationStatusByGitHubId, validateRepositoryOwnership };
@@ -327,7 +327,7 @@ const getRepositoryCountsByTenantId = (db) => async (params) => {
327
327
  */
328
328
  const setMcpToolRepositoryAccess = (db) => async (params) => {
329
329
  const now = (/* @__PURE__ */ new Date()).toISOString();
330
- await db.delete(workAppGitHubMcpToolRepositoryAccess).where(eq(workAppGitHubMcpToolRepositoryAccess.toolId, params.toolId));
330
+ await db.delete(workAppGitHubMcpToolRepositoryAccess).where(and(eq(workAppGitHubMcpToolRepositoryAccess.tenantId, params.tenantId), eq(workAppGitHubMcpToolRepositoryAccess.projectId, params.projectId), eq(workAppGitHubMcpToolRepositoryAccess.toolId, params.toolId)));
331
331
  if (params.repositoryIds.length > 0) await db.insert(workAppGitHubMcpToolRepositoryAccess).values(params.repositoryIds.map((repoId) => ({
332
332
  id: generateId(),
333
333
  toolId: params.toolId,
@@ -342,23 +342,22 @@ const setMcpToolRepositoryAccess = (db) => async (params) => {
342
342
  * Get MCP tool repository access entries
343
343
  * These entries are used when mode='selected'. Check mode via getMcpToolAccessMode().
344
344
  */
345
- const getMcpToolRepositoryAccess = (db) => async (toolId) => {
346
- return await db.select().from(workAppGitHubMcpToolRepositoryAccess).where(eq(workAppGitHubMcpToolRepositoryAccess.toolId, toolId));
345
+ const getMcpToolRepositoryAccess = (db) => async (scope) => {
346
+ return await db.select().from(workAppGitHubMcpToolRepositoryAccess).where(and(eq(workAppGitHubMcpToolRepositoryAccess.tenantId, scope.tenantId), eq(workAppGitHubMcpToolRepositoryAccess.projectId, scope.projectId), eq(workAppGitHubMcpToolRepositoryAccess.toolId, scope.toolId)));
347
347
  };
348
348
  /**
349
349
  * Get MCP tool repository access with full repository details.
350
350
  * If the tool's access mode is 'all', returns all repositories the project has access to.
351
351
  * If mode is 'selected' (or not set), returns only explicitly granted repositories.
352
352
  */
353
- const getMcpToolRepositoryAccessWithDetails = (db) => async (toolId) => {
354
- const accessMode = (await db.select({
353
+ const getMcpToolRepositoryAccessWithDetails = (db) => async (scope) => {
354
+ if ((await db.select({
355
355
  mode: workAppGitHubMcpToolAccessMode.mode,
356
356
  projectId: workAppGitHubMcpToolAccessMode.projectId,
357
357
  tenantId: workAppGitHubMcpToolAccessMode.tenantId
358
- }).from(workAppGitHubMcpToolAccessMode).where(eq(workAppGitHubMcpToolAccessMode.toolId, toolId)).limit(1))[0];
359
- if (accessMode?.mode === "all") return getProjectRepositoryAccessWithDetails(db)({
360
- tenantId: accessMode.tenantId,
361
- projectId: accessMode.projectId
358
+ }).from(workAppGitHubMcpToolAccessMode).where(and(eq(workAppGitHubMcpToolAccessMode.tenantId, scope.tenantId), eq(workAppGitHubMcpToolAccessMode.projectId, scope.projectId), eq(workAppGitHubMcpToolAccessMode.toolId, scope.toolId))).limit(1))[0]?.mode === "all") return getProjectRepositoryAccessWithDetails(db)({
359
+ tenantId: scope.tenantId,
360
+ projectId: scope.projectId
362
361
  });
363
362
  return await db.select({
364
363
  accessId: workAppGitHubMcpToolRepositoryAccess.id,
@@ -372,13 +371,13 @@ const getMcpToolRepositoryAccessWithDetails = (db) => async (toolId) => {
372
371
  createdAt: workAppGitHubRepositories.createdAt,
373
372
  updatedAt: workAppGitHubRepositories.updatedAt,
374
373
  installationAccountLogin: workAppGitHubInstallations.accountLogin
375
- }).from(workAppGitHubMcpToolRepositoryAccess).innerJoin(workAppGitHubRepositories, eq(workAppGitHubMcpToolRepositoryAccess.repositoryDbId, workAppGitHubRepositories.id)).innerJoin(workAppGitHubInstallations, eq(workAppGitHubRepositories.installationDbId, workAppGitHubInstallations.id)).where(eq(workAppGitHubMcpToolRepositoryAccess.toolId, toolId));
374
+ }).from(workAppGitHubMcpToolRepositoryAccess).innerJoin(workAppGitHubRepositories, eq(workAppGitHubMcpToolRepositoryAccess.repositoryDbId, workAppGitHubRepositories.id)).innerJoin(workAppGitHubInstallations, eq(workAppGitHubRepositories.installationDbId, workAppGitHubInstallations.id)).where(and(eq(workAppGitHubMcpToolRepositoryAccess.tenantId, scope.tenantId), eq(workAppGitHubMcpToolRepositoryAccess.projectId, scope.projectId), eq(workAppGitHubMcpToolRepositoryAccess.toolId, scope.toolId)));
376
375
  };
377
376
  /**
378
377
  * Remove all MCP tool repository access for a specific tool
379
378
  */
380
- const clearMcpToolRepositoryAccess = (db) => async (toolId) => {
381
- return (await db.delete(workAppGitHubMcpToolRepositoryAccess).where(eq(workAppGitHubMcpToolRepositoryAccess.toolId, toolId)).returning()).length;
379
+ const clearMcpToolRepositoryAccess = (db) => async (scope) => {
380
+ return (await db.delete(workAppGitHubMcpToolRepositoryAccess).where(and(eq(workAppGitHubMcpToolRepositoryAccess.tenantId, scope.tenantId), eq(workAppGitHubMcpToolRepositoryAccess.projectId, scope.projectId), eq(workAppGitHubMcpToolRepositoryAccess.toolId, scope.toolId))).returning()).length;
382
381
  };
383
382
  const isGithubWorkAppTool = (tool) => {
384
383
  return tool.isWorkApp && tool.config.mcp.server.url.includes("/github/mcp");
@@ -432,7 +431,11 @@ const setMcpToolAccessMode = (db) => async (params) => {
432
431
  createdAt: now,
433
432
  updatedAt: now
434
433
  }).onConflictDoUpdate({
435
- target: [workAppGitHubMcpToolAccessMode.toolId],
434
+ target: [
435
+ workAppGitHubMcpToolAccessMode.tenantId,
436
+ workAppGitHubMcpToolAccessMode.projectId,
437
+ workAppGitHubMcpToolAccessMode.toolId
438
+ ],
436
439
  set: {
437
440
  mode: params.mode,
438
441
  updatedAt: now
@@ -443,14 +446,14 @@ const setMcpToolAccessMode = (db) => async (params) => {
443
446
  * Get the access mode for an MCP tool's GitHub repository access.
444
447
  * Returns 'selected' if no mode is explicitly set (fail-safe default).
445
448
  */
446
- const getMcpToolAccessMode = (db) => async (toolId) => {
447
- return (await db.select({ mode: workAppGitHubMcpToolAccessMode.mode }).from(workAppGitHubMcpToolAccessMode).where(eq(workAppGitHubMcpToolAccessMode.toolId, toolId)).limit(1))[0]?.mode ?? "selected";
449
+ const getMcpToolAccessMode = (db) => async (scope) => {
450
+ return (await db.select({ mode: workAppGitHubMcpToolAccessMode.mode }).from(workAppGitHubMcpToolAccessMode).where(and(eq(workAppGitHubMcpToolAccessMode.tenantId, scope.tenantId), eq(workAppGitHubMcpToolAccessMode.projectId, scope.projectId), eq(workAppGitHubMcpToolAccessMode.toolId, scope.toolId))).limit(1))[0]?.mode ?? "selected";
448
451
  };
449
452
  /**
450
453
  * Delete the access mode entry for an MCP tool
451
454
  */
452
- const deleteMcpToolAccessMode = (db) => async (toolId) => {
453
- return (await db.delete(workAppGitHubMcpToolAccessMode).where(eq(workAppGitHubMcpToolAccessMode.toolId, toolId)).returning()).length > 0;
455
+ const deleteMcpToolAccessMode = (db) => async (scope) => {
456
+ return (await db.delete(workAppGitHubMcpToolAccessMode).where(and(eq(workAppGitHubMcpToolAccessMode.tenantId, scope.tenantId), eq(workAppGitHubMcpToolAccessMode.projectId, scope.projectId), eq(workAppGitHubMcpToolAccessMode.toolId, scope.toolId))).returning()).length > 0;
454
457
  };
455
458
 
456
459
  //#endregion
@@ -11,25 +11,25 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
11
11
  messageId: string;
12
12
  }) => Promise<{
13
13
  id: string;
14
- tenantId: string;
15
- projectId: string;
16
14
  createdAt: string;
17
15
  updatedAt: string;
18
16
  metadata: MessageMetadata | null;
19
- content: MessageContent;
20
17
  role: string;
18
+ conversationId: string;
19
+ projectId: string;
20
+ tenantId: string;
21
+ content: MessageContent;
21
22
  fromSubAgentId: string | null;
22
23
  toSubAgentId: string | null;
23
24
  fromExternalAgentId: string | null;
24
25
  toExternalAgentId: string | null;
25
- taskId: string | null;
26
- a2aTaskId: string | null;
27
- conversationId: string;
28
26
  fromTeamAgentId: string | null;
29
27
  toTeamAgentId: string | null;
30
28
  visibility: string;
31
29
  messageType: string;
30
+ taskId: string | null;
32
31
  parentMessageId: string | null;
32
+ a2aTaskId: string | null;
33
33
  a2aSessionId: string | null;
34
34
  } | undefined>;
35
35
  declare const listMessages: (db: AgentsRunDatabaseClient) => (params: {
@@ -142,25 +142,25 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
142
142
  }[]>;
143
143
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
144
144
  id: string;
145
- tenantId: string;
146
- projectId: string;
147
145
  createdAt: string;
148
146
  updatedAt: string;
149
147
  metadata: MessageMetadata | null;
150
- content: MessageContent;
151
148
  role: string;
149
+ conversationId: string;
150
+ projectId: string;
151
+ tenantId: string;
152
+ content: MessageContent;
152
153
  fromSubAgentId: string | null;
153
154
  toSubAgentId: string | null;
154
155
  fromExternalAgentId: string | null;
155
156
  toExternalAgentId: string | null;
156
- taskId: string | null;
157
- a2aTaskId: string | null;
158
- conversationId: string;
159
157
  fromTeamAgentId: string | null;
160
158
  toTeamAgentId: string | null;
161
159
  visibility: string;
162
160
  messageType: string;
161
+ taskId: string | null;
163
162
  parentMessageId: string | null;
163
+ a2aTaskId: string | null;
164
164
  a2aSessionId: string | null;
165
165
  }>;
166
166
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -195,25 +195,25 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
195
195
  messageId: string;
196
196
  }) => Promise<{
197
197
  id: string;
198
- tenantId: string;
199
- projectId: string;
200
198
  createdAt: string;
201
199
  updatedAt: string;
202
200
  metadata: MessageMetadata | null;
203
- content: MessageContent;
204
201
  role: string;
202
+ conversationId: string;
203
+ projectId: string;
204
+ tenantId: string;
205
+ content: MessageContent;
205
206
  fromSubAgentId: string | null;
206
207
  toSubAgentId: string | null;
207
208
  fromExternalAgentId: string | null;
208
209
  toExternalAgentId: string | null;
209
- taskId: string | null;
210
- a2aTaskId: string | null;
211
- conversationId: string;
212
210
  fromTeamAgentId: string | null;
213
211
  toTeamAgentId: string | null;
214
212
  visibility: string;
215
213
  messageType: string;
214
+ taskId: string | null;
216
215
  parentMessageId: string | null;
216
+ a2aTaskId: string | null;
217
217
  a2aSessionId: string | null;
218
218
  }>;
219
219
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -7,19 +7,19 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
7
7
  //#region src/data-access/runtime/tasks.d.ts
8
8
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
9
9
  id: string;
10
- tenantId: string;
11
- projectId: string;
12
- agentId: string;
13
10
  createdAt: string;
14
11
  updatedAt: string;
15
- metadata: TaskMetadataConfig | null;
16
- subAgentId: string;
17
- status: string;
18
12
  ref: {
19
- type: "tag" | "commit" | "branch";
13
+ type: "commit" | "tag" | "branch";
20
14
  name: string;
21
15
  hash: string;
22
16
  } | null;
17
+ metadata: TaskMetadataConfig | null;
18
+ status: string;
19
+ agentId: string;
20
+ projectId: string;
21
+ tenantId: string;
22
+ subAgentId: string;
23
23
  contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "tag" | "commit" | "branch";
39
+ type: "commit" | "tag" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;