@inkeep/agents-core 0.0.0-dev-20260303063511 → 0.0.0-dev-20260303160903

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 (47) hide show
  1. package/dist/auth/auth-schema.d.ts +107 -107
  2. package/dist/auth/auth-validation-schemas.d.ts +135 -135
  3. package/dist/auth/auth.d.ts +9 -9
  4. package/dist/auth/auth.js +2 -2
  5. package/dist/auth/permissions.d.ts +9 -9
  6. package/dist/client-exports.d.ts +5 -4
  7. package/dist/client-exports.js +2 -2
  8. package/dist/data-access/index.d.ts +3 -3
  9. package/dist/data-access/index.js +3 -3
  10. package/dist/data-access/manage/agents.d.ts +42 -42
  11. package/dist/data-access/manage/agents.js +25 -11
  12. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  13. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  14. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  15. package/dist/data-access/manage/functionTools.d.ts +16 -16
  16. package/dist/data-access/manage/skills.d.ts +13 -13
  17. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  18. package/dist/data-access/manage/subAgentRelations.d.ts +26 -26
  19. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  20. package/dist/data-access/manage/subAgents.d.ts +18 -18
  21. package/dist/data-access/manage/tools.d.ts +21 -21
  22. package/dist/data-access/manage/triggerCleanup.d.ts +12 -0
  23. package/dist/data-access/manage/triggerCleanup.js +51 -0
  24. package/dist/data-access/manage/triggers.d.ts +14 -3
  25. package/dist/data-access/manage/triggers.js +8 -1
  26. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  27. package/dist/data-access/runtime/conversations.d.ts +24 -24
  28. package/dist/data-access/runtime/messages.d.ts +18 -18
  29. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  30. package/dist/data-access/runtime/tasks.d.ts +6 -6
  31. package/dist/data-access/runtime/users.d.ts +5 -1
  32. package/dist/data-access/runtime/users.js +14 -1
  33. package/dist/db/manage/manage-schema.d.ts +489 -451
  34. package/dist/db/manage/manage-schema.js +2 -0
  35. package/dist/db/runtime/runtime-schema.d.ts +294 -294
  36. package/dist/index.d.ts +4 -4
  37. package/dist/index.js +4 -4
  38. package/dist/validation/index.d.ts +2 -2
  39. package/dist/validation/index.js +2 -2
  40. package/dist/validation/schemas.d.ts +1897 -1728
  41. package/dist/validation/schemas.js +18 -5
  42. package/drizzle/manage/0012_petite_weapon_omega.sql +2 -0
  43. package/drizzle/manage/meta/0012_snapshot.json +3697 -0
  44. package/drizzle/manage/meta/_journal.json +7 -0
  45. package/package.json +1 -1
  46. package/dist/auth/cleanup.d.ts +0 -12
  47. package/dist/auth/cleanup.js +0 -43
@@ -8,28 +8,28 @@ 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;
11
14
  id: string;
12
15
  name: string | null;
13
16
  createdAt: string;
14
17
  updatedAt: string;
15
18
  expiresAt: string | null;
16
- tenantId: string;
17
- projectId: string;
18
- agentId: string;
19
19
  publicId: string;
20
20
  keyHash: string;
21
21
  keyPrefix: string;
22
22
  lastUsedAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
+ tenantId: string;
26
+ projectId: string;
27
+ agentId: string;
25
28
  id: string;
26
29
  name: string | null;
27
30
  createdAt: string;
28
31
  updatedAt: string;
29
32
  expiresAt: string | null;
30
- tenantId: string;
31
- projectId: string;
32
- agentId: string;
33
33
  publicId: string;
34
34
  keyHash: string;
35
35
  keyPrefix: string;
@@ -39,14 +39,14 @@ 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;
42
45
  id: string;
43
46
  name: string | null;
44
47
  createdAt: string;
45
48
  updatedAt: string;
46
49
  expiresAt: string | null;
47
- tenantId: string;
48
- projectId: string;
49
- agentId: string;
50
50
  publicId: string;
51
51
  keyHash: string;
52
52
  keyPrefix: string;
@@ -66,14 +66,14 @@ 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;
69
72
  id: string;
70
73
  name: string | null;
71
74
  createdAt: string;
72
75
  updatedAt: string;
73
76
  expiresAt: string | null;
74
- tenantId: string;
75
- projectId: string;
76
- agentId: string;
77
77
  publicId: string;
78
78
  keyHash: string;
79
79
  keyPrefix: string;
@@ -16,20 +16,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
16
16
  total: number;
17
17
  }>;
18
18
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
19
+ title: string | null;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string | null;
19
23
  id: string;
20
24
  createdAt: string;
21
25
  updatedAt: string;
26
+ metadata: ConversationMetadata | null;
27
+ userId: string | null;
22
28
  ref: {
23
29
  type: "commit" | "tag" | "branch";
24
30
  name: string;
25
31
  hash: string;
26
32
  } | null;
27
- userId: string | null;
28
- metadata: ConversationMetadata | null;
29
- tenantId: string;
30
- projectId: string;
31
- title: string | null;
32
- agentId: string | null;
33
33
  activeSubAgentId: string;
34
34
  lastContextResolution: string | null;
35
35
  }>;
@@ -85,20 +85,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  scopes: ProjectScopeConfig;
86
86
  conversationId: string;
87
87
  }) => Promise<{
88
+ title: string | null;
89
+ tenantId: string;
90
+ projectId: string;
91
+ agentId: string | null;
88
92
  id: string;
89
93
  createdAt: string;
90
94
  updatedAt: string;
95
+ metadata: ConversationMetadata | null;
96
+ userId: string | null;
91
97
  ref: {
92
98
  type: "commit" | "tag" | "branch";
93
99
  name: string;
94
100
  hash: string;
95
101
  } | null;
96
- userId: string | null;
97
- metadata: ConversationMetadata | null;
98
- tenantId: string;
99
- projectId: string;
100
- title: string | null;
101
- agentId: string | null;
102
102
  activeSubAgentId: string;
103
103
  lastContextResolution: string | null;
104
104
  } | undefined>;
@@ -121,20 +121,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  metadata?: ConversationMetadata | null | undefined;
122
122
  contextConfigId?: string | undefined;
123
123
  } | {
124
+ title: string | null;
125
+ tenantId: string;
126
+ projectId: string;
127
+ agentId: string | null;
124
128
  id: string;
125
129
  createdAt: string;
126
130
  updatedAt: string;
131
+ metadata: ConversationMetadata | null;
132
+ userId: string | null;
127
133
  ref: {
128
134
  type: "commit" | "tag" | "branch";
129
135
  name: string;
130
136
  hash: string;
131
137
  } | null;
132
- userId: string | null;
133
- metadata: ConversationMetadata | null;
134
- tenantId: string;
135
- projectId: string;
136
- title: string | null;
137
- agentId: string | null;
138
138
  activeSubAgentId: string;
139
139
  lastContextResolution: string | null;
140
140
  }>;
@@ -153,20 +153,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  scopes: ProjectScopeConfig;
154
154
  conversationId: string;
155
155
  }) => Promise<{
156
+ title: string | null;
157
+ tenantId: string;
158
+ projectId: string;
159
+ agentId: string | null;
156
160
  id: string;
157
161
  createdAt: string;
158
162
  updatedAt: string;
163
+ metadata: ConversationMetadata | null;
164
+ userId: string | null;
159
165
  ref: {
160
166
  type: "commit" | "tag" | "branch";
161
167
  name: string;
162
168
  hash: string;
163
169
  } | null;
164
- userId: string | null;
165
- metadata: ConversationMetadata | null;
166
- tenantId: string;
167
- projectId: string;
168
- title: string | null;
169
- agentId: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -10,26 +10,26 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
+ tenantId: string;
14
+ projectId: string;
13
15
  id: string;
14
16
  createdAt: string;
15
17
  updatedAt: string;
16
18
  metadata: MessageMetadata | null;
17
- role: string;
18
- tenantId: string;
19
- projectId: string;
20
19
  content: MessageContent;
20
+ conversationId: string;
21
+ role: string;
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: {
@@ -141,26 +141,26 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
141
141
  id: string;
142
142
  }[]>;
143
143
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
144
+ tenantId: string;
145
+ projectId: string;
144
146
  id: string;
145
147
  createdAt: string;
146
148
  updatedAt: string;
147
149
  metadata: MessageMetadata | null;
148
- role: string;
149
- tenantId: string;
150
- projectId: string;
151
150
  content: MessageContent;
151
+ conversationId: string;
152
+ role: string;
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: {
@@ -194,26 +194,26 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
194
194
  scopes: ProjectScopeConfig;
195
195
  messageId: string;
196
196
  }) => Promise<{
197
+ tenantId: string;
198
+ projectId: string;
197
199
  id: string;
198
200
  createdAt: string;
199
201
  updatedAt: string;
200
202
  metadata: MessageMetadata | null;
201
- role: string;
202
- tenantId: string;
203
- projectId: string;
204
203
  content: MessageContent;
204
+ conversationId: string;
205
+ role: string;
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: {
@@ -34,7 +34,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
34
34
  }) => Promise<{
35
35
  data: {
36
36
  scheduledTriggerId: string;
37
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
37
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
38
38
  scheduledFor: string;
39
39
  startedAt: string | null;
40
40
  completedAt: string | null;
@@ -174,7 +174,7 @@ declare const listUpcomingInvocationsForAgentPaginated: (db: AgentsRunDatabaseCl
174
174
  }) => Promise<{
175
175
  data: {
176
176
  scheduledTriggerId: string;
177
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
177
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
178
178
  scheduledFor: string;
179
179
  startedAt: string | null;
180
180
  completedAt: string | null;
@@ -208,7 +208,7 @@ declare const listProjectScheduledTriggerInvocationsPaginated: (db: AgentsRunDat
208
208
  }) => Promise<{
209
209
  data: {
210
210
  scheduledTriggerId: string;
211
- status: "pending" | "failed" | "running" | "completed" | "cancelled";
211
+ status: "pending" | "running" | "completed" | "failed" | "cancelled";
212
212
  scheduledFor: string;
213
213
  startedAt: string | null;
214
214
  completedAt: string | null;
@@ -6,20 +6,20 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
6
6
 
7
7
  //#region src/data-access/runtime/tasks.d.ts
8
8
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
9
+ tenantId: string;
10
+ projectId: string;
11
+ agentId: string;
12
+ subAgentId: string;
9
13
  id: string;
10
14
  createdAt: string;
11
15
  updatedAt: string;
16
+ metadata: TaskMetadataConfig | null;
17
+ status: string;
12
18
  ref: {
13
19
  type: "commit" | "tag" | "branch";
14
20
  name: string;
15
21
  hash: string;
16
22
  } | null;
17
- metadata: TaskMetadataConfig | null;
18
- status: string;
19
- tenantId: string;
20
- projectId: string;
21
- agentId: string;
22
- subAgentId: string;
23
23
  contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
@@ -19,9 +19,13 @@ declare const getUserByEmail: (db: AgentsRunDatabaseClient) => (email: string) =
19
19
  * Get organization member by email
20
20
  * Returns the user if they are a member of the specified organization
21
21
  */
22
+ declare const getOrganizationMemberByUserId: (db: AgentsRunDatabaseClient) => (organizationId: string, userId: string) => Promise<(User & {
23
+ role: string;
24
+ memberId: string;
25
+ }) | null>;
22
26
  declare const getOrganizationMemberByEmail: (db: AgentsRunDatabaseClient) => (organizationId: string, email: string) => Promise<(User & {
23
27
  role: string;
24
28
  memberId: string;
25
29
  }) | null>;
26
30
  //#endregion
27
- export { getOrganizationMemberByEmail, getUserByEmail, getUserById };
31
+ export { getOrganizationMemberByEmail, getOrganizationMemberByUserId, getUserByEmail, getUserById };
@@ -22,6 +22,19 @@ const getUserByEmail = (db) => async (email) => {
22
22
  * Get organization member by email
23
23
  * Returns the user if they are a member of the specified organization
24
24
  */
25
+ const getOrganizationMemberByUserId = (db) => async (organizationId, userId) => {
26
+ return (await db.select({
27
+ id: user.id,
28
+ name: user.name,
29
+ email: user.email,
30
+ emailVerified: user.emailVerified,
31
+ image: user.image,
32
+ createdAt: user.createdAt,
33
+ updatedAt: user.updatedAt,
34
+ role: member.role,
35
+ memberId: member.id
36
+ }).from(member).innerJoin(user, eq(member.userId, user.id)).where(and(eq(member.organizationId, organizationId), eq(user.id, userId))).limit(1))[0] || null;
37
+ };
25
38
  const getOrganizationMemberByEmail = (db) => async (organizationId, email) => {
26
39
  return (await db.select({
27
40
  id: user.id,
@@ -37,4 +50,4 @@ const getOrganizationMemberByEmail = (db) => async (organizationId, email) => {
37
50
  };
38
51
 
39
52
  //#endregion
40
- export { getOrganizationMemberByEmail, getUserByEmail, getUserById };
53
+ export { getOrganizationMemberByEmail, getOrganizationMemberByUserId, getUserByEmail, getUserById };