@inkeep/agents-core 0.68.4 → 0.69.0

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 (61) hide show
  1. package/dist/auth/auth-schema.d.ts +227 -227
  2. package/dist/auth/auth-validation-schemas.d.ts +137 -137
  3. package/dist/auth/auth.d.ts +9 -9
  4. package/dist/auth/authz/config.d.ts +33 -7
  5. package/dist/auth/authz/config.js +18 -8
  6. package/dist/auth/authz/credential-gateway.d.ts +57 -0
  7. package/dist/auth/authz/credential-gateway.js +118 -0
  8. package/dist/auth/authz/index.d.ts +4 -3
  9. package/dist/auth/authz/index.js +4 -3
  10. package/dist/auth/authz/types.d.ts +8 -1
  11. package/dist/auth/authz/types.js +7 -3
  12. package/dist/auth/entitlement-lock.js +2 -4
  13. package/dist/auth/entitlements.js +1 -1
  14. package/dist/auth/permissions.d.ts +13 -13
  15. package/dist/auth/support-copilot-platforms.d.ts +147 -0
  16. package/dist/auth/support-copilot-platforms.js +120 -0
  17. package/dist/client-exports.d.ts +3 -2
  18. package/dist/client-exports.js +3 -2
  19. package/dist/context/TemplateEngine.d.ts +17 -1
  20. package/dist/context/TemplateEngine.js +37 -3
  21. package/dist/data-access/index.d.ts +2 -2
  22. package/dist/data-access/index.js +2 -2
  23. package/dist/data-access/manage/agents.d.ts +30 -30
  24. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  25. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  26. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  27. package/dist/data-access/manage/functionTools.d.ts +12 -12
  28. package/dist/data-access/manage/skills.d.ts +11 -11
  29. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  30. package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
  31. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  32. package/dist/data-access/manage/subAgents.d.ts +18 -18
  33. package/dist/data-access/manage/tools.d.ts +30 -30
  34. package/dist/data-access/manage/triggers.d.ts +1 -1
  35. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  36. package/dist/data-access/runtime/apps.d.ts +37 -13
  37. package/dist/data-access/runtime/conversations.d.ts +12 -12
  38. package/dist/data-access/runtime/entitlements.d.ts +2 -1
  39. package/dist/data-access/runtime/entitlements.js +5 -1
  40. package/dist/data-access/runtime/feedback.d.ts +6 -6
  41. package/dist/data-access/runtime/messages.d.ts +12 -12
  42. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
  43. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
  44. package/dist/data-access/runtime/tasks.d.ts +4 -4
  45. package/dist/db/manage/manage-schema.d.ts +358 -358
  46. package/dist/db/runtime/runtime-schema.d.ts +433 -417
  47. package/dist/index.d.ts +7 -5
  48. package/dist/index.js +7 -5
  49. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js +1 -1
  50. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js +1 -1
  51. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js +1 -1
  52. package/dist/node_modules/.pnpm/{vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_93023d256ff9ed909ae8f0d436c922a0 → vitest@3.2.4_@edge-runtime_vm@3.2.0_@types_debug@4.1.12_@types_node@20.19.27_jiti@2.6.1_e422349b438eb7189cab8b1648fc0621}/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js +1 -1
  53. package/dist/test-utils/mocks/logger.js +1 -1
  54. package/dist/utils/apiKeys.js +1 -1
  55. package/dist/validation/index.d.ts +2 -2
  56. package/dist/validation/index.js +2 -2
  57. package/dist/validation/schemas/skills.d.ts +25 -25
  58. package/dist/validation/schemas.d.ts +2144 -1956
  59. package/dist/validation/schemas.js +16 -2
  60. package/package.json +1 -1
  61. package/spicedb/schema.zed +27 -0
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- id: string;
12
11
  name: string | null;
13
- createdAt: string;
14
- updatedAt: string;
15
12
  tenantId: string;
16
13
  projectId: string;
14
+ id: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
17
  agentId: string;
18
- expiresAt: string | null;
19
18
  publicId: string;
20
19
  keyHash: string;
21
20
  keyPrefix: string;
22
21
  lastUsedAt: string | null;
22
+ expiresAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- id: string;
26
25
  name: string | null;
27
- createdAt: string;
28
- updatedAt: string;
29
26
  tenantId: string;
30
27
  projectId: string;
28
+ id: string;
29
+ createdAt: string;
30
+ updatedAt: string;
31
31
  agentId: string;
32
- expiresAt: string | null;
33
32
  publicId: string;
34
33
  keyHash: string;
35
34
  keyPrefix: string;
36
35
  lastUsedAt: string | null;
36
+ expiresAt: string | null;
37
37
  } | undefined>;
38
38
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
- id: string;
43
42
  name: string | null;
44
- createdAt: string;
45
- updatedAt: string;
46
43
  tenantId: string;
47
44
  projectId: string;
45
+ id: string;
46
+ createdAt: string;
47
+ updatedAt: string;
48
48
  agentId: string;
49
- expiresAt: string | null;
50
49
  publicId: string;
51
50
  keyHash: string;
52
51
  keyPrefix: string;
53
52
  lastUsedAt: string | null;
53
+ expiresAt: string | null;
54
54
  }[]>;
55
55
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
56
56
  scopes: ProjectScopeConfig;
@@ -66,18 +66,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  };
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
- id: string;
70
69
  name: string | null;
71
- createdAt: string;
72
- updatedAt: string;
73
70
  tenantId: string;
74
71
  projectId: string;
72
+ id: string;
73
+ createdAt: string;
74
+ updatedAt: string;
75
75
  agentId: string;
76
- expiresAt: string | null;
77
76
  publicId: string;
78
77
  keyHash: string;
79
78
  keyPrefix: string;
80
79
  lastUsedAt: string | null;
80
+ expiresAt: string | null;
81
81
  }>;
82
82
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
83
83
  scopes: ProjectScopeConfig;
@@ -5,16 +5,16 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
5
5
 
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
- id: string;
8
+ type: AppType;
9
9
  name: string;
10
10
  description: string | null;
11
- type: AppType;
12
- createdAt: string;
13
- updatedAt: string;
14
11
  tenantId: string | null;
15
12
  projectId: string | null;
16
- enabled: boolean;
13
+ id: string;
14
+ createdAt: string;
15
+ updatedAt: string;
17
16
  prompt: string | null;
17
+ enabled: boolean;
18
18
  config: {
19
19
  type: "web_client";
20
20
  webClient: {
@@ -34,7 +34,15 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
34
34
  } | {
35
35
  type: "support_copilot";
36
36
  supportCopilot: {
37
- credentialReferenceIds: string[];
37
+ platform: string;
38
+ credentialReferenceId?: string | undefined;
39
+ quickActions?: {
40
+ group: string;
41
+ actions: {
42
+ label: string;
43
+ prompt: string;
44
+ }[];
45
+ }[] | undefined;
38
46
  };
39
47
  };
40
48
  lastUsedAt: string | null;
@@ -66,16 +74,16 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
74
  };
67
75
  }>;
68
76
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
69
- id: string;
77
+ type: AppType;
70
78
  name: string;
71
79
  description: string | null;
72
- type: AppType;
73
- createdAt: string;
74
- updatedAt: string;
75
80
  tenantId: string | null;
76
81
  projectId: string | null;
77
- enabled: boolean;
82
+ id: string;
83
+ createdAt: string;
84
+ updatedAt: string;
78
85
  prompt: string | null;
86
+ enabled: boolean;
79
87
  config: {
80
88
  type: "web_client";
81
89
  webClient: {
@@ -95,7 +103,15 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
95
103
  } | {
96
104
  type: "support_copilot";
97
105
  supportCopilot: {
98
- credentialReferenceIds: string[];
106
+ platform: string;
107
+ credentialReferenceId?: string | undefined;
108
+ quickActions?: {
109
+ group: string;
110
+ actions: {
111
+ label: string;
112
+ prompt: string;
113
+ }[];
114
+ }[] | undefined;
99
115
  };
100
116
  };
101
117
  lastUsedAt: string | null;
@@ -170,7 +186,15 @@ declare const updateApp: (db: AgentsRunDatabaseClient) => (params: {
170
186
  } | {
171
187
  type: "support_copilot";
172
188
  supportCopilot: {
173
- credentialReferenceIds: string[];
189
+ platform: string;
190
+ credentialReferenceId?: string | undefined;
191
+ quickActions?: {
192
+ group: string;
193
+ actions: {
194
+ label: string;
195
+ prompt: string;
196
+ }[];
197
+ }[] | undefined;
174
198
  };
175
199
  };
176
200
  lastUsedAt: string | null;
@@ -15,13 +15,13 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
15
15
  total: number;
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
- id: string;
19
18
  title: string | null;
19
+ tenantId: string;
20
+ projectId: string;
21
+ id: string;
20
22
  createdAt: string;
21
23
  updatedAt: string;
22
- tenantId: string;
23
24
  metadata: ConversationMetadata | null;
24
- projectId: string;
25
25
  agentId: string | null;
26
26
  userId: string | null;
27
27
  ref: {
@@ -84,13 +84,13 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
84
84
  scopes: ProjectScopeConfig;
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
- id: string;
88
87
  title: string | null;
88
+ tenantId: string;
89
+ projectId: string;
90
+ id: string;
89
91
  createdAt: string;
90
92
  updatedAt: string;
91
- tenantId: string;
92
93
  metadata: ConversationMetadata | null;
93
- projectId: string;
94
94
  agentId: string | null;
95
95
  userId: string | null;
96
96
  ref: {
@@ -120,13 +120,13 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
120
120
  metadata?: ConversationMetadata | null | undefined;
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
- id: string;
124
123
  title: string | null;
124
+ tenantId: string;
125
+ projectId: string;
126
+ id: string;
125
127
  createdAt: string;
126
128
  updatedAt: string;
127
- tenantId: string;
128
129
  metadata: ConversationMetadata | null;
129
- projectId: string;
130
130
  agentId: string | null;
131
131
  userId: string | null;
132
132
  ref: {
@@ -152,13 +152,13 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
152
152
  scopes: ProjectScopeConfig;
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
- id: string;
156
155
  title: string | null;
156
+ tenantId: string;
157
+ projectId: string;
158
+ id: string;
157
159
  createdAt: string;
158
160
  updatedAt: string;
159
- tenantId: string;
160
161
  metadata: ConversationMetadata | null;
161
- projectId: string;
162
162
  agentId: string | null;
163
163
  userId: string | null;
164
164
  ref: {
@@ -6,8 +6,9 @@ declare const listOrgEntitlements: (db: AgentsRunDatabaseClient) => (orgId: stri
6
6
  maxValue: number;
7
7
  }>>;
8
8
  declare function dalResolveEntitlement(db: AgentsRunDatabaseClient, orgId: string, resourceType: string): Promise<number | null>;
9
+ declare function dalSelectEntitlementForUpdate(tx: AgentsRunDatabaseClient, orgId: string, resourceType: string): Promise<number | null>;
9
10
  declare function dalGetServiceAccountUserId(db: AgentsRunDatabaseClient, orgId: string): Promise<string | null>;
10
11
  declare function dalCountMembersByRoleBucket(db: AgentsRunDatabaseClient, orgId: string, isAdminBucket: boolean, serviceAccountUserId: string | null): Promise<number>;
11
12
  declare function dalSumSeatEntitlements(db: AgentsRunDatabaseClient, orgId: string): Promise<number | null>;
12
13
  //#endregion
13
- export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, listOrgEntitlements };
14
+ export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSelectEntitlementForUpdate, dalSumSeatEntitlements, listOrgEntitlements };
@@ -14,6 +14,10 @@ async function dalResolveEntitlement(db, orgId, resourceType) {
14
14
  if (rows.length === 0) return null;
15
15
  return rows[0].maxValue;
16
16
  }
17
+ async function dalSelectEntitlementForUpdate(tx, orgId, resourceType) {
18
+ const rows = await tx.select({ maxValue: orgEntitlement.maxValue }).from(orgEntitlement).where(and(eq(orgEntitlement.organizationId, orgId), eq(orgEntitlement.resourceType, resourceType))).for("update");
19
+ return rows.length === 0 ? null : rows[0].maxValue;
20
+ }
17
21
  async function dalGetServiceAccountUserId(db, orgId) {
18
22
  return (await db.select({ serviceAccountUserId: organization.serviceAccountUserId }).from(organization).where(eq(organization.id, orgId)))[0]?.serviceAccountUserId ?? null;
19
23
  }
@@ -30,4 +34,4 @@ async function dalSumSeatEntitlements(db, orgId) {
30
34
  }
31
35
 
32
36
  //#endregion
33
- export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSumSeatEntitlements, listOrgEntitlements };
37
+ export { dalCountMembersByRoleBucket, dalGetServiceAccountUserId, dalResolveEntitlement, dalSelectEntitlementForUpdate, dalSumSeatEntitlements, listOrgEntitlements };
@@ -58,12 +58,12 @@ declare const listFeedback: (db: AgentsRunDatabaseClient) => (params: {
58
58
  total: number;
59
59
  }>;
60
60
  declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
61
- id: string;
62
61
  type: "positive" | "negative";
63
- createdAt: string;
64
- updatedAt: string;
65
62
  tenantId: string;
66
63
  projectId: string;
64
+ id: string;
65
+ createdAt: string;
66
+ updatedAt: string;
67
67
  conversationId: string;
68
68
  messageId: string | null;
69
69
  details: string | null;
@@ -87,12 +87,12 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
87
87
  scopes: ProjectScopeConfig;
88
88
  feedbackId: string;
89
89
  }) => Promise<{
90
- id: string;
91
90
  type: "positive" | "negative";
92
- createdAt: string;
93
- updatedAt: string;
94
91
  tenantId: string;
95
92
  projectId: string;
93
+ id: string;
94
+ createdAt: string;
95
+ updatedAt: string;
96
96
  conversationId: string;
97
97
  messageId: string | null;
98
98
  details: string | null;
@@ -10,15 +10,15 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
+ content: MessageContent;
14
+ tenantId: string;
15
+ projectId: string;
13
16
  id: string;
14
17
  createdAt: string;
15
18
  updatedAt: string;
16
- tenantId: string;
17
19
  metadata: MessageMetadata | null;
18
- content: MessageContent;
19
- projectId: string;
20
- role: string;
21
20
  conversationId: string;
21
+ role: string;
22
22
  fromSubAgentId: string | null;
23
23
  toSubAgentId: string | null;
24
24
  fromExternalAgentId: string | null;
@@ -144,15 +144,15 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
144
144
  scopes: ProjectScopeConfig;
145
145
  data: Omit<MessageInsert, "tenantId" | "projectId">;
146
146
  }) => Promise<{
147
+ content: MessageContent;
148
+ tenantId: string;
149
+ projectId: string;
147
150
  id: string;
148
151
  createdAt: string;
149
152
  updatedAt: string;
150
- tenantId: string;
151
153
  metadata: MessageMetadata | null;
152
- content: MessageContent;
153
- projectId: string;
154
- role: string;
155
154
  conversationId: string;
155
+ role: string;
156
156
  fromSubAgentId: string | null;
157
157
  toSubAgentId: string | null;
158
158
  fromExternalAgentId: string | null;
@@ -197,15 +197,15 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
197
197
  scopes: ProjectScopeConfig;
198
198
  messageId: string;
199
199
  }) => Promise<{
200
+ content: MessageContent;
201
+ tenantId: string;
202
+ projectId: string;
200
203
  id: string;
201
204
  createdAt: string;
202
205
  updatedAt: string;
203
- tenantId: string;
204
206
  metadata: MessageMetadata | null;
205
- content: MessageContent;
206
- projectId: string;
207
- role: string;
208
207
  conversationId: string;
208
+ role: string;
209
209
  fromSubAgentId: string | null;
210
210
  toSubAgentId: string | null;
211
211
  fromExternalAgentId: string | null;
@@ -40,7 +40,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
43
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
43
+ status: "pending" | "failed" | "running" | "completed" | "cancelled";
44
44
  scheduledFor: string;
45
45
  startedAt: string | null;
46
46
  completedAt: string | null;
@@ -199,7 +199,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
199
199
  name: string;
200
200
  hash: string;
201
201
  } | null;
202
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
202
+ status: "pending" | "failed" | "running" | "completed" | "cancelled";
203
203
  scheduledFor: string;
204
204
  startedAt: string | null;
205
205
  completedAt: string | null;
@@ -239,7 +239,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
239
239
  name: string;
240
240
  hash: string;
241
241
  } | null;
242
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
242
+ status: "pending" | "failed" | "running" | "completed" | "cancelled";
243
243
  scheduledFor: string;
244
244
  startedAt: string | null;
245
245
  completedAt: string | null;
@@ -292,7 +292,7 @@ declare const listScheduledTriggerInvocationsByTriggerId: (db: AgentsRunDatabase
292
292
  name: string;
293
293
  hash: string;
294
294
  } | null;
295
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
295
+ status: "pending" | "failed" | "running" | "completed" | "cancelled";
296
296
  scheduledFor: string;
297
297
  startedAt: string | null;
298
298
  completedAt: string | null;
@@ -15,8 +15,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
15
15
  scheduledTriggerId: string;
16
16
  userId: string;
17
17
  }) => Promise<{
18
- createdAt: string;
19
18
  tenantId: string;
19
+ createdAt: string;
20
20
  userId: string;
21
21
  scheduledTriggerId: string;
22
22
  }>;
@@ -7,21 +7,21 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
7
7
 
8
8
  //#region src/data-access/runtime/tasks.d.ts
9
9
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
10
+ tenantId: string;
11
+ projectId: string;
12
+ status: string;
10
13
  id: string;
11
14
  createdAt: string;
12
15
  updatedAt: string;
13
- tenantId: string;
14
16
  metadata: TaskMetadataConfig | null;
15
- projectId: string;
16
17
  agentId: string;
17
- subAgentId: string;
18
18
  ref: {
19
19
  type: "commit" | "tag" | "branch";
20
20
  name: string;
21
21
  hash: string;
22
22
  } | null;
23
- status: string;
24
23
  contextId: string;
24
+ subAgentId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
27
27
  id: string;