@inkeep/agents-core 0.70.4 → 0.70.7

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 (50) hide show
  1. package/dist/auth/auth-schema.d.ts +227 -227
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/auth/auth.js +39 -12
  4. package/dist/auth/init.js +14 -15
  5. package/dist/auth/password-policy-rules.d.ts +18 -0
  6. package/dist/auth/password-policy-rules.js +32 -0
  7. package/dist/auth/password-policy.d.ts +10 -0
  8. package/dist/auth/password-policy.js +88 -0
  9. package/dist/auth/permissions.d.ts +9 -9
  10. package/dist/auth/session-hooks.d.ts +11 -0
  11. package/dist/auth/session-hooks.js +27 -0
  12. package/dist/client-exports.d.ts +2 -2
  13. package/dist/client-exports.js +2 -2
  14. package/dist/data-access/index.d.ts +2 -2
  15. package/dist/data-access/index.js +2 -2
  16. package/dist/data-access/manage/agents.d.ts +21 -21
  17. package/dist/data-access/manage/artifactComponents.d.ts +14 -14
  18. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  19. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  20. package/dist/data-access/manage/functionTools.d.ts +16 -16
  21. package/dist/data-access/manage/skills.d.ts +13 -13
  22. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  23. package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
  24. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  25. package/dist/data-access/manage/subAgents.d.ts +15 -15
  26. package/dist/data-access/manage/tools.d.ts +21 -21
  27. package/dist/data-access/manage/triggers.d.ts +2 -2
  28. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  29. package/dist/data-access/runtime/apps.d.ts +8 -8
  30. package/dist/data-access/runtime/conversations.d.ts +24 -24
  31. package/dist/data-access/runtime/conversations.js +2 -2
  32. package/dist/data-access/runtime/feedback.d.ts +9 -7
  33. package/dist/data-access/runtime/feedback.js +11 -1
  34. package/dist/data-access/runtime/messages.d.ts +24 -24
  35. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +4 -4
  36. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +2 -2
  37. package/dist/data-access/runtime/tasks.d.ts +6 -6
  38. package/dist/db/manage/manage-schema.d.ts +453 -453
  39. package/dist/db/runtime/runtime-schema.d.ts +425 -425
  40. package/dist/index.d.ts +3 -3
  41. package/dist/index.js +3 -3
  42. package/dist/middleware/inherited-auth.d.ts +5 -5
  43. package/dist/middleware/no-auth.d.ts +2 -2
  44. package/dist/setup/setup.js +3 -2
  45. package/dist/validation/index.d.ts +2 -2
  46. package/dist/validation/index.js +2 -2
  47. package/dist/validation/schemas/skills.d.ts +49 -49
  48. package/dist/validation/schemas.d.ts +2245 -2229
  49. package/dist/validation/schemas.js +9 -1
  50. package/package.json +9 -1
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- tenantId: string;
12
- projectId: string;
13
- agentId: string;
14
- name: string | null;
15
11
  id: string;
12
+ name: string | null;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ expiresAt: string | null;
16
+ tenantId: string;
17
+ projectId: string;
18
+ agentId: string;
18
19
  publicId: string;
19
20
  keyHash: string;
20
21
  keyPrefix: string;
21
22
  lastUsedAt: string | null;
22
- expiresAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- tenantId: string;
26
- projectId: string;
27
- agentId: string;
28
- name: string | null;
29
25
  id: string;
26
+ name: string | null;
30
27
  createdAt: string;
31
28
  updatedAt: string;
29
+ expiresAt: string | null;
30
+ tenantId: string;
31
+ projectId: string;
32
+ agentId: string;
32
33
  publicId: string;
33
34
  keyHash: string;
34
35
  keyPrefix: string;
35
36
  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
- tenantId: string;
43
- projectId: string;
44
- agentId: string;
45
- name: string | null;
46
42
  id: string;
43
+ name: string | null;
47
44
  createdAt: string;
48
45
  updatedAt: string;
46
+ expiresAt: string | null;
47
+ tenantId: string;
48
+ projectId: string;
49
+ agentId: string;
49
50
  publicId: string;
50
51
  keyHash: string;
51
52
  keyPrefix: string;
52
53
  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
- tenantId: string;
70
- projectId: string;
71
- agentId: string;
72
- name: string | null;
73
69
  id: string;
70
+ name: string | null;
74
71
  createdAt: string;
75
72
  updatedAt: string;
73
+ expiresAt: string | null;
74
+ tenantId: string;
75
+ projectId: string;
76
+ agentId: string;
76
77
  publicId: string;
77
78
  keyHash: string;
78
79
  keyPrefix: string;
79
80
  lastUsedAt: string | null;
80
- expiresAt: string | null;
81
81
  }>;
82
82
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
83
83
  scopes: ProjectScopeConfig;
@@ -6,13 +6,13 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
8
  type: AppType;
9
- tenantId: string | null;
10
- description: string | null;
11
- projectId: string | null;
12
- name: string;
13
9
  id: string;
10
+ name: string;
14
11
  createdAt: string;
15
12
  updatedAt: string;
13
+ description: string | null;
14
+ tenantId: string | null;
15
+ projectId: string | null;
16
16
  enabled: boolean;
17
17
  prompt: string | null;
18
18
  config: {
@@ -75,13 +75,13 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
75
75
  }>;
76
76
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
77
77
  type: AppType;
78
- tenantId: string | null;
79
- description: string | null;
80
- projectId: string | null;
81
- name: string;
82
78
  id: string;
79
+ name: string;
83
80
  createdAt: string;
84
81
  updatedAt: string;
82
+ description: string | null;
83
+ tenantId: string | null;
84
+ projectId: string | null;
85
85
  enabled: boolean;
86
86
  prompt: string | null;
87
87
  config: {
@@ -15,20 +15,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
15
15
  total: number;
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
- tenantId: string;
19
- userId: string | null;
20
- title: string | null;
21
- projectId: string;
22
- agentId: string | null;
23
18
  id: string;
24
19
  createdAt: string;
25
20
  updatedAt: string;
26
- metadata: ConversationMetadata | null;
27
21
  ref: {
28
22
  type: "commit" | "tag" | "branch";
29
23
  name: string;
30
24
  hash: string;
31
25
  } | null;
26
+ userId: string | null;
27
+ metadata: ConversationMetadata | null;
28
+ tenantId: string;
29
+ projectId: string;
30
+ agentId: string | null;
31
+ title: string | null;
32
32
  activeSubAgentId: string;
33
33
  lastContextResolution: string | null;
34
34
  }>;
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
84
84
  scopes: ProjectScopeConfig;
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
- tenantId: string;
88
- userId: string | null;
89
- title: string | null;
90
- projectId: string;
91
- agentId: string | null;
92
87
  id: string;
93
88
  createdAt: string;
94
89
  updatedAt: string;
95
- metadata: ConversationMetadata | null;
96
90
  ref: {
97
91
  type: "commit" | "tag" | "branch";
98
92
  name: string;
99
93
  hash: string;
100
94
  } | null;
95
+ userId: string | null;
96
+ metadata: ConversationMetadata | null;
97
+ tenantId: string;
98
+ projectId: string;
99
+ agentId: string | null;
100
+ title: string | null;
101
101
  activeSubAgentId: string;
102
102
  lastContextResolution: string | null;
103
103
  } | undefined>;
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
120
120
  metadata?: ConversationMetadata | null | undefined;
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
- tenantId: string;
124
- userId: string | null;
125
- title: string | null;
126
- projectId: string;
127
- agentId: string | null;
128
123
  id: string;
129
124
  createdAt: string;
130
125
  updatedAt: string;
131
- metadata: ConversationMetadata | null;
132
126
  ref: {
133
127
  type: "commit" | "tag" | "branch";
134
128
  name: string;
135
129
  hash: string;
136
130
  } | null;
131
+ userId: string | null;
132
+ metadata: ConversationMetadata | null;
133
+ tenantId: string;
134
+ projectId: string;
135
+ agentId: string | null;
136
+ title: string | null;
137
137
  activeSubAgentId: string;
138
138
  lastContextResolution: string | null;
139
139
  }>;
@@ -152,20 +152,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
152
152
  scopes: ProjectScopeConfig;
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
- tenantId: string;
156
- userId: string | null;
157
- title: string | null;
158
- projectId: string;
159
- agentId: string | null;
160
155
  id: string;
161
156
  createdAt: string;
162
157
  updatedAt: string;
163
- metadata: ConversationMetadata | null;
164
158
  ref: {
165
159
  type: "commit" | "tag" | "branch";
166
160
  name: string;
167
161
  hash: string;
168
162
  } | null;
163
+ userId: string | null;
164
+ metadata: ConversationMetadata | null;
165
+ tenantId: string;
166
+ projectId: string;
167
+ agentId: string | null;
168
+ title: string | null;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -101,14 +101,14 @@ function extractMessageText(content) {
101
101
  /**
102
102
  * Apply context window management by truncating or summarizing old messages
103
103
  */
104
- function applyContextWindowManagement(messageHistory, maxTokens) {
104
+ function applyContextWindowManagement(messageHistory, maxOutputTokens) {
105
105
  const estimateTokens = (text) => Math.ceil(text.length / 4);
106
106
  let totalTokens = 0;
107
107
  const managedHistory = [];
108
108
  for (let i = messageHistory.length - 1; i >= 0; i--) {
109
109
  const message = messageHistory[i];
110
110
  const messageTokens = estimateTokens(extractMessageText(message.content));
111
- if (totalTokens + messageTokens <= maxTokens) {
111
+ if (totalTokens + messageTokens <= maxOutputTokens) {
112
112
  managedHistory.unshift(message);
113
113
  totalTokens += messageTokens;
114
114
  } else {
@@ -1,5 +1,6 @@
1
1
  import { ProjectScopeConfig } from "../../db/manage/scope-definitions.js";
2
2
  import { PaginationConfig } from "../../types/utility.js";
3
+ import { feedback } from "../../db/runtime/runtime-schema.js";
3
4
  import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
4
5
  import "../../types/index.js";
5
6
  import { FeedbackInsert, FeedbackUpdate } from "../../types/entities.js";
@@ -70,15 +71,16 @@ declare const getFeedbackByIds: (db: AgentsRunDatabaseClient) => (params: {
70
71
  }[]>;
71
72
  declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: FeedbackInsert) => Promise<{
72
73
  type: "positive" | "negative";
73
- tenantId: string;
74
- projectId: string;
75
- details: string | null;
76
74
  id: string;
77
75
  createdAt: string;
78
76
  updatedAt: string;
77
+ tenantId: string;
78
+ projectId: string;
79
79
  conversationId: string;
80
80
  messageId: string | null;
81
+ details: string | null;
81
82
  }>;
83
+ declare const createFeedbackBulk: (db: AgentsRunDatabaseClient) => (items: FeedbackInsert[]) => Promise<(typeof feedback.$inferSelect)[]>;
82
84
  declare const updateFeedback: (db: AgentsRunDatabaseClient) => (params: {
83
85
  scopes: ProjectScopeConfig;
84
86
  feedbackId: string;
@@ -99,14 +101,14 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
99
101
  feedbackId: string;
100
102
  }) => Promise<{
101
103
  type: "positive" | "negative";
102
- tenantId: string;
103
- projectId: string;
104
- details: string | null;
105
104
  id: string;
106
105
  createdAt: string;
107
106
  updatedAt: string;
107
+ tenantId: string;
108
+ projectId: string;
108
109
  conversationId: string;
109
110
  messageId: string | null;
111
+ details: string | null;
110
112
  }>;
111
113
  //#endregion
112
- export { createFeedback, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
114
+ export { createFeedback, createFeedbackBulk, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
@@ -82,6 +82,16 @@ const createFeedback = (db) => async (params) => {
82
82
  }).returning();
83
83
  return created;
84
84
  };
85
+ const createFeedbackBulk = (db) => async (items) => {
86
+ if (items.length === 0) return [];
87
+ const now = (/* @__PURE__ */ new Date()).toISOString();
88
+ const values = items.map((item) => ({
89
+ ...item,
90
+ createdAt: now,
91
+ updatedAt: now
92
+ }));
93
+ return db.insert(feedback).values(values).returning();
94
+ };
85
95
  const updateFeedback = (db) => async (params) => {
86
96
  const now = (/* @__PURE__ */ new Date()).toISOString();
87
97
  const [updated] = await db.update(feedback).set({
@@ -96,4 +106,4 @@ const deleteFeedback = (db) => async (params) => {
96
106
  };
97
107
 
98
108
  //#endregion
99
- export { createFeedback, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
109
+ export { createFeedback, createFeedbackBulk, deleteFeedback, getFeedbackById, getFeedbackByIds, listFeedback, listFeedbackByConversation, updateFeedback };
@@ -10,26 +10,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
+ id: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ metadata: MessageMetadata | null;
17
+ role: string;
13
18
  tenantId: string;
14
19
  projectId: string;
15
20
  content: MessageContent;
21
+ conversationId: string;
16
22
  fromSubAgentId: string | null;
17
23
  toSubAgentId: string | null;
18
24
  fromExternalAgentId: string | null;
19
25
  toExternalAgentId: string | null;
20
- taskId: string | null;
21
- a2aTaskId: string | null;
22
- id: string;
23
- createdAt: string;
24
- updatedAt: string;
25
- metadata: MessageMetadata | null;
26
- conversationId: string;
27
- role: 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: {
@@ -144,26 +144,26 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
144
144
  scopes: ProjectScopeConfig;
145
145
  data: Omit<MessageInsert, "tenantId" | "projectId">;
146
146
  }) => Promise<{
147
+ id: string;
148
+ createdAt: string;
149
+ updatedAt: string;
150
+ metadata: MessageMetadata | null;
151
+ role: string;
147
152
  tenantId: string;
148
153
  projectId: string;
149
154
  content: MessageContent;
155
+ conversationId: string;
150
156
  fromSubAgentId: string | null;
151
157
  toSubAgentId: string | null;
152
158
  fromExternalAgentId: string | null;
153
159
  toExternalAgentId: string | null;
154
- taskId: string | null;
155
- a2aTaskId: string | null;
156
- id: string;
157
- createdAt: string;
158
- updatedAt: string;
159
- metadata: MessageMetadata | null;
160
- conversationId: string;
161
- role: string;
162
160
  fromTeamAgentId: string | null;
163
161
  toTeamAgentId: string | null;
164
162
  visibility: string;
165
163
  messageType: string;
164
+ taskId: string | null;
166
165
  parentMessageId: string | null;
166
+ a2aTaskId: string | null;
167
167
  a2aSessionId: string | null;
168
168
  }>;
169
169
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -197,26 +197,26 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
197
197
  scopes: ProjectScopeConfig;
198
198
  messageId: string;
199
199
  }) => Promise<{
200
+ id: string;
201
+ createdAt: string;
202
+ updatedAt: string;
203
+ metadata: MessageMetadata | null;
204
+ role: string;
200
205
  tenantId: string;
201
206
  projectId: string;
202
207
  content: MessageContent;
208
+ conversationId: string;
203
209
  fromSubAgentId: string | null;
204
210
  toSubAgentId: string | null;
205
211
  fromExternalAgentId: string | null;
206
212
  toExternalAgentId: string | null;
207
- taskId: string | null;
208
- a2aTaskId: string | null;
209
- id: string;
210
- createdAt: string;
211
- updatedAt: string;
212
- metadata: MessageMetadata | null;
213
- conversationId: string;
214
- role: string;
215
213
  fromTeamAgentId: string | null;
216
214
  toTeamAgentId: string | null;
217
215
  visibility: string;
218
216
  messageType: string;
217
+ taskId: string | null;
219
218
  parentMessageId: string | null;
219
+ a2aTaskId: string | null;
220
220
  a2aSessionId: string | null;
221
221
  }>;
222
222
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -40,7 +40,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
43
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
43
+ status: "pending" | "running" | "completed" | "failed" | "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" | "failed" | "running" | "completed" | "cancelled";
202
+ status: "pending" | "running" | "completed" | "failed" | "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" | "failed" | "running" | "completed" | "cancelled";
242
+ status: "pending" | "running" | "completed" | "failed" | "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" | "failed" | "running" | "completed" | "cancelled";
295
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
296
296
  scheduledFor: string;
297
297
  startedAt: string | null;
298
298
  completedAt: string | null;
@@ -15,9 +15,9 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
15
15
  scheduledTriggerId: string;
16
16
  userId: string;
17
17
  }) => Promise<{
18
- tenantId: string;
19
- userId: string;
20
18
  createdAt: string;
19
+ userId: string;
20
+ tenantId: string;
21
21
  scheduledTriggerId: string;
22
22
  }>;
23
23
  declare const deleteScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (params: {
@@ -7,20 +7,20 @@ 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
- agentId: string;
13
- subAgentId: string;
14
- status: string;
15
10
  id: string;
16
11
  createdAt: string;
17
12
  updatedAt: string;
18
- metadata: TaskMetadataConfig | null;
19
13
  ref: {
20
14
  type: "commit" | "tag" | "branch";
21
15
  name: string;
22
16
  hash: string;
23
17
  } | null;
18
+ metadata: TaskMetadataConfig | null;
19
+ status: string;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string;
23
+ subAgentId: string;
24
24
  contextId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {