@inkeep/agents-core 0.70.5 → 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 (42) 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.d.ts +122 -122
  4. package/dist/auth/auth.js +13 -7
  5. package/dist/auth/init.js +4 -2
  6. package/dist/auth/password-policy.d.ts +2 -2
  7. package/dist/auth/permissions.d.ts +13 -13
  8. package/dist/auth/session-hooks.d.ts +11 -0
  9. package/dist/auth/session-hooks.js +27 -0
  10. package/dist/client-exports.d.ts +2 -2
  11. package/dist/client-exports.js +2 -2
  12. package/dist/data-access/index.d.ts +2 -2
  13. package/dist/data-access/index.js +2 -2
  14. package/dist/data-access/manage/agents.d.ts +21 -21
  15. package/dist/data-access/manage/artifactComponents.d.ts +2 -2
  16. package/dist/data-access/manage/functionTools.d.ts +4 -4
  17. package/dist/data-access/manage/skills.d.ts +5 -5
  18. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +6 -6
  19. package/dist/data-access/manage/subAgentRelations.d.ts +4 -4
  20. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +6 -6
  21. package/dist/data-access/manage/subAgents.d.ts +15 -15
  22. package/dist/data-access/manage/tools.d.ts +15 -15
  23. package/dist/data-access/manage/triggers.d.ts +1 -1
  24. package/dist/data-access/runtime/apiKeys.d.ts +4 -4
  25. package/dist/data-access/runtime/apps.d.ts +2 -2
  26. package/dist/data-access/runtime/conversations.d.ts +24 -24
  27. package/dist/data-access/runtime/conversations.js +2 -2
  28. package/dist/data-access/runtime/feedback.d.ts +3 -1
  29. package/dist/data-access/runtime/feedback.js +11 -1
  30. package/dist/data-access/runtime/messages.d.ts +6 -6
  31. package/dist/data-access/runtime/scheduledTriggerUsers.d.ts +1 -1
  32. package/dist/data-access/runtime/tasks.d.ts +6 -6
  33. package/dist/db/manage/manage-schema.d.ts +453 -453
  34. package/dist/db/runtime/runtime-schema.d.ts +421 -421
  35. package/dist/index.d.ts +3 -3
  36. package/dist/index.js +3 -3
  37. package/dist/validation/index.d.ts +2 -2
  38. package/dist/validation/index.js +2 -2
  39. package/dist/validation/schemas/skills.d.ts +39 -39
  40. package/dist/validation/schemas.d.ts +1960 -1944
  41. package/dist/validation/schemas.js +9 -1
  42. package/package.json +1 -1
@@ -22,18 +22,18 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
22
22
  }) => Promise<{
23
23
  id: string;
24
24
  name: string;
25
- description: string | null;
26
25
  createdAt: string;
27
26
  updatedAt: string;
27
+ description: string | null;
28
28
  tenantId: string;
29
29
  projectId: string;
30
- headers: Record<string, string> | null;
30
+ credentialReferenceId: string | null;
31
31
  config: {
32
32
  type: "mcp";
33
33
  mcp: ToolMcpConfig;
34
34
  };
35
- credentialReferenceId: string | null;
36
35
  credentialScope: string;
36
+ headers: Record<string, string> | null;
37
37
  imageUrl: string | null;
38
38
  capabilities: ToolServerCapabilities | null;
39
39
  lastError: string | null;
@@ -80,18 +80,18 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
81
  id: string;
82
82
  name: string;
83
- description: string | null;
84
83
  createdAt: string;
85
84
  updatedAt: string;
85
+ description: string | null;
86
86
  tenantId: string;
87
87
  projectId: string;
88
- headers: Record<string, string> | null;
88
+ credentialReferenceId: string | null;
89
89
  config: {
90
90
  type: "mcp";
91
91
  mcp: ToolMcpConfig;
92
92
  };
93
- credentialReferenceId: string | null;
94
93
  credentialScope: string;
94
+ headers: Record<string, string> | null;
95
95
  imageUrl: string | null;
96
96
  capabilities: ToolServerCapabilities | null;
97
97
  lastError: string | null;
@@ -141,13 +141,13 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
141
141
  tenantId: string;
142
142
  projectId: string;
143
143
  agentId: string;
144
+ subAgentId: string;
144
145
  toolId: string;
145
146
  headers: Record<string, string> | null;
147
+ selectedTools: string[] | null;
146
148
  toolPolicies: Record<string, {
147
149
  needsApproval?: boolean;
148
150
  }> | null;
149
- subAgentId: string;
150
- selectedTools: string[] | null;
151
151
  }>;
152
152
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
153
153
  scopes: AgentScopeConfig;
@@ -160,13 +160,13 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
160
160
  tenantId: string;
161
161
  projectId: string;
162
162
  agentId: string;
163
+ subAgentId: string;
163
164
  toolId: string;
164
165
  headers: Record<string, string> | null;
166
+ selectedTools: string[] | null;
165
167
  toolPolicies: Record<string, {
166
168
  needsApproval?: boolean;
167
169
  }> | null;
168
- subAgentId: string;
169
- selectedTools: string[] | null;
170
170
  }>;
171
171
  /**
172
172
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -188,13 +188,13 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
188
188
  tenantId: string;
189
189
  projectId: string;
190
190
  agentId: string;
191
+ subAgentId: string;
191
192
  toolId: string;
192
193
  headers: Record<string, string> | null;
194
+ selectedTools: string[] | null;
193
195
  toolPolicies: Record<string, {
194
196
  needsApproval?: boolean;
195
197
  }> | null;
196
- subAgentId: string;
197
- selectedTools: string[] | null;
198
198
  }>;
199
199
  /**
200
200
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -204,18 +204,18 @@ declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
204
204
  }) => Promise<{
205
205
  id: string;
206
206
  name: string;
207
- description: string | null;
208
207
  createdAt: string;
209
208
  updatedAt: string;
209
+ description: string | null;
210
210
  tenantId: string;
211
211
  projectId: string;
212
- headers: Record<string, string> | null;
212
+ credentialReferenceId: string | null;
213
213
  config: {
214
214
  type: "mcp";
215
215
  mcp: ToolMcpConfig;
216
216
  };
217
- credentialReferenceId: string | null;
218
217
  credentialScope: string;
218
+ headers: Record<string, string> | null;
219
219
  imageUrl: string | null;
220
220
  capabilities: ToolServerCapabilities | null;
221
221
  lastError: string | null;
@@ -132,10 +132,10 @@ declare const createTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
132
132
  userId: string;
133
133
  }) => Promise<{
134
134
  createdAt: string;
135
+ userId: string;
135
136
  tenantId: string;
136
137
  projectId: string;
137
138
  agentId: string;
138
- userId: string;
139
139
  triggerId: string;
140
140
  }>;
141
141
  declare const deleteTriggerUser: (db: AgentsManageDatabaseClient) => (params: {
@@ -12,10 +12,10 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
12
12
  name: string | null;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
+ expiresAt: string | null;
15
16
  tenantId: string;
16
17
  projectId: string;
17
18
  agentId: string;
18
- expiresAt: string | null;
19
19
  publicId: string;
20
20
  keyHash: string;
21
21
  keyPrefix: string;
@@ -26,10 +26,10 @@ declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: s
26
26
  name: string | null;
27
27
  createdAt: string;
28
28
  updatedAt: string;
29
+ expiresAt: string | null;
29
30
  tenantId: string;
30
31
  projectId: string;
31
32
  agentId: string;
32
- expiresAt: string | null;
33
33
  publicId: string;
34
34
  keyHash: string;
35
35
  keyPrefix: string;
@@ -43,10 +43,10 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
43
43
  name: string | null;
44
44
  createdAt: string;
45
45
  updatedAt: string;
46
+ expiresAt: string | null;
46
47
  tenantId: string;
47
48
  projectId: string;
48
49
  agentId: string;
49
- expiresAt: string | null;
50
50
  publicId: string;
51
51
  keyHash: string;
52
52
  keyPrefix: string;
@@ -70,10 +70,10 @@ declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInse
70
70
  name: string | null;
71
71
  createdAt: string;
72
72
  updatedAt: string;
73
+ expiresAt: string | null;
73
74
  tenantId: string;
74
75
  projectId: string;
75
76
  agentId: string;
76
- expiresAt: string | null;
77
77
  publicId: string;
78
78
  keyHash: string;
79
79
  keyPrefix: string;
@@ -8,9 +8,9 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
8
8
  type: AppType;
9
9
  id: string;
10
10
  name: string;
11
- description: string | null;
12
11
  createdAt: string;
13
12
  updatedAt: string;
13
+ description: string | null;
14
14
  tenantId: string | null;
15
15
  projectId: string | null;
16
16
  enabled: boolean;
@@ -77,9 +77,9 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
77
77
  type: AppType;
78
78
  id: string;
79
79
  name: string;
80
- description: string | null;
81
80
  createdAt: string;
82
81
  updatedAt: string;
82
+ description: string | null;
83
83
  tenantId: string | null;
84
84
  projectId: string | null;
85
85
  enabled: boolean;
@@ -16,19 +16,19 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
18
  id: string;
19
- title: string | null;
20
19
  createdAt: string;
21
20
  updatedAt: string;
22
- tenantId: string;
23
- projectId: string;
24
- metadata: ConversationMetadata | null;
25
- agentId: string | null;
26
- userId: string | 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
  }>;
@@ -85,19 +85,19 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
87
  id: string;
88
- title: string | null;
89
88
  createdAt: string;
90
89
  updatedAt: string;
91
- tenantId: string;
92
- projectId: string;
93
- metadata: ConversationMetadata | null;
94
- agentId: string | null;
95
- userId: string | 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>;
@@ -121,19 +121,19 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
123
  id: string;
124
- title: string | null;
125
124
  createdAt: string;
126
125
  updatedAt: string;
127
- tenantId: string;
128
- projectId: string;
129
- metadata: ConversationMetadata | null;
130
- agentId: string | null;
131
- userId: string | 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
  }>;
@@ -153,19 +153,19 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
155
  id: string;
156
- title: string | null;
157
156
  createdAt: string;
158
157
  updatedAt: string;
159
- tenantId: string;
160
- projectId: string;
161
- metadata: ConversationMetadata | null;
162
- agentId: string | null;
163
- userId: string | 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";
@@ -79,6 +80,7 @@ declare const createFeedback: (db: AgentsRunDatabaseClient) => (params: Feedback
79
80
  messageId: string | null;
80
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;
@@ -109,4 +111,4 @@ declare const deleteFeedback: (db: AgentsRunDatabaseClient) => (params: {
109
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 };
@@ -13,11 +13,11 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
13
13
  id: string;
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
+ metadata: MessageMetadata | null;
17
+ role: string;
16
18
  tenantId: string;
17
19
  projectId: string;
18
- metadata: MessageMetadata | null;
19
20
  content: MessageContent;
20
- role: string;
21
21
  conversationId: string;
22
22
  fromSubAgentId: string | null;
23
23
  toSubAgentId: string | null;
@@ -147,11 +147,11 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
147
147
  id: string;
148
148
  createdAt: string;
149
149
  updatedAt: string;
150
+ metadata: MessageMetadata | null;
151
+ role: string;
150
152
  tenantId: string;
151
153
  projectId: string;
152
- metadata: MessageMetadata | null;
153
154
  content: MessageContent;
154
- role: string;
155
155
  conversationId: string;
156
156
  fromSubAgentId: string | null;
157
157
  toSubAgentId: string | null;
@@ -200,11 +200,11 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
200
200
  id: string;
201
201
  createdAt: string;
202
202
  updatedAt: string;
203
+ metadata: MessageMetadata | null;
204
+ role: string;
203
205
  tenantId: string;
204
206
  projectId: string;
205
- metadata: MessageMetadata | null;
206
207
  content: MessageContent;
207
- role: string;
208
208
  conversationId: string;
209
209
  fromSubAgentId: string | null;
210
210
  toSubAgentId: string | null;
@@ -16,8 +16,8 @@ declare const createScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (para
16
16
  userId: string;
17
17
  }) => Promise<{
18
18
  createdAt: string;
19
- tenantId: string;
20
19
  userId: string;
20
+ tenantId: string;
21
21
  scheduledTriggerId: string;
22
22
  }>;
23
23
  declare const deleteScheduledTriggerUser: (db: AgentsRunDatabaseClient) => (params: {
@@ -10,17 +10,17 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
10
10
  id: string;
11
11
  createdAt: string;
12
12
  updatedAt: string;
13
- tenantId: string;
14
- projectId: string;
15
- metadata: TaskMetadataConfig | null;
16
- agentId: string;
17
- subAgentId: string;
18
- status: string;
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: {