@inkeep/agents-core 0.55.3 → 0.56.1

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 (48) hide show
  1. package/dist/auth/auth-schema.d.ts +85 -85
  2. package/dist/auth/auth-validation-schemas.d.ts +152 -152
  3. package/dist/auth/auth.d.ts +28 -28
  4. package/dist/auth/auth.js +2 -2
  5. package/dist/auth/permissions.d.ts +13 -13
  6. package/dist/client-exports.d.ts +4 -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 +37 -37
  11. package/dist/data-access/manage/agents.js +25 -11
  12. package/dist/data-access/manage/artifactComponents.d.ts +8 -8
  13. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  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 +22 -22
  19. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  20. package/dist/data-access/manage/subAgents.d.ts +15 -15
  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 +31 -31
  28. package/dist/data-access/runtime/messages.d.ts +9 -9
  29. package/dist/data-access/runtime/tasks.d.ts +9 -9
  30. package/dist/data-access/runtime/users.d.ts +5 -1
  31. package/dist/data-access/runtime/users.js +14 -1
  32. package/dist/db/manage/manage-schema.d.ts +397 -359
  33. package/dist/db/manage/manage-schema.js +2 -0
  34. package/dist/db/runtime/runtime-schema.d.ts +272 -272
  35. package/dist/index.d.ts +4 -4
  36. package/dist/index.js +4 -4
  37. package/dist/validation/dolt-schemas.d.ts +1 -1
  38. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  39. package/dist/validation/index.d.ts +2 -2
  40. package/dist/validation/index.js +2 -2
  41. package/dist/validation/schemas.d.ts +1869 -1700
  42. package/dist/validation/schemas.js +18 -5
  43. package/drizzle/manage/0012_petite_weapon_omega.sql +2 -0
  44. package/drizzle/manage/meta/0012_snapshot.json +3697 -0
  45. package/drizzle/manage/meta/_journal.json +7 -0
  46. package/package.json +1 -1
  47. package/dist/auth/cleanup.d.ts +0 -12
  48. package/dist/auth/cleanup.js +0 -43
@@ -19,17 +19,17 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
19
19
  id: string;
20
20
  createdAt: string;
21
21
  updatedAt: string;
22
- agentId: string | null;
23
- projectId: string;
24
- tenantId: string;
25
- title: string | null;
26
- metadata: ConversationMetadata | null;
27
- userId: string | null;
28
22
  ref: {
29
- type: "commit" | "tag" | "branch";
23
+ type: "tag" | "commit" | "branch";
30
24
  name: string;
31
25
  hash: string;
32
26
  } | null;
27
+ userId: string | null;
28
+ metadata: ConversationMetadata | null;
29
+ tenantId: string;
30
+ projectId: string;
31
+ agentId: string | null;
32
+ title: string | null;
33
33
  activeSubAgentId: string;
34
34
  lastContextResolution: string | null;
35
35
  }>;
@@ -44,7 +44,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
44
44
  agentId: string | null;
45
45
  activeSubAgentId: string;
46
46
  ref: {
47
- type: "commit" | "tag" | "branch";
47
+ type: "tag" | "commit" | "branch";
48
48
  name: string;
49
49
  hash: string;
50
50
  } | null;
@@ -70,7 +70,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
70
70
  agentId: string | null;
71
71
  activeSubAgentId: string;
72
72
  ref: {
73
- type: "commit" | "tag" | "branch";
73
+ type: "tag" | "commit" | "branch";
74
74
  name: string;
75
75
  hash: string;
76
76
  } | null;
@@ -88,17 +88,17 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
88
88
  id: string;
89
89
  createdAt: string;
90
90
  updatedAt: string;
91
- agentId: string | null;
92
- projectId: string;
93
- tenantId: string;
94
- title: string | null;
95
- metadata: ConversationMetadata | null;
96
- userId: string | null;
97
91
  ref: {
98
- type: "commit" | "tag" | "branch";
92
+ type: "tag" | "commit" | "branch";
99
93
  name: string;
100
94
  hash: string;
101
95
  } | null;
96
+ userId: string | null;
97
+ metadata: ConversationMetadata | null;
98
+ tenantId: string;
99
+ projectId: string;
100
+ agentId: string | null;
101
+ title: string | null;
102
102
  activeSubAgentId: string;
103
103
  lastContextResolution: string | null;
104
104
  } | undefined>;
@@ -108,7 +108,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
108
108
  tenantId: string;
109
109
  id: string;
110
110
  ref: {
111
- type: "commit" | "tag" | "branch";
111
+ type: "tag" | "commit" | "branch";
112
112
  name: string;
113
113
  hash: string;
114
114
  };
@@ -124,17 +124,17 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
124
124
  id: string;
125
125
  createdAt: string;
126
126
  updatedAt: string;
127
- agentId: string | null;
128
- projectId: string;
129
- tenantId: string;
130
- title: string | null;
131
- metadata: ConversationMetadata | null;
132
- userId: string | null;
133
127
  ref: {
134
- type: "commit" | "tag" | "branch";
128
+ type: "tag" | "commit" | "branch";
135
129
  name: string;
136
130
  hash: string;
137
131
  } | null;
132
+ userId: string | null;
133
+ metadata: ConversationMetadata | null;
134
+ tenantId: string;
135
+ projectId: string;
136
+ agentId: string | null;
137
+ title: string | null;
138
138
  activeSubAgentId: string;
139
139
  lastContextResolution: string | null;
140
140
  }>;
@@ -156,17 +156,17 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
156
156
  id: string;
157
157
  createdAt: string;
158
158
  updatedAt: string;
159
- agentId: string | null;
160
- projectId: string;
161
- tenantId: string;
162
- title: string | null;
163
- metadata: ConversationMetadata | null;
164
- userId: string | null;
165
159
  ref: {
166
- type: "commit" | "tag" | "branch";
160
+ type: "tag" | "commit" | "branch";
167
161
  name: string;
168
162
  hash: string;
169
163
  } | null;
164
+ userId: string | null;
165
+ metadata: ConversationMetadata | null;
166
+ tenantId: string;
167
+ projectId: string;
168
+ agentId: string | null;
169
+ title: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -13,12 +13,12 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
13
13
  id: string;
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
- projectId: string;
17
- tenantId: string;
18
16
  metadata: MessageMetadata | null;
17
+ role: string;
18
+ tenantId: string;
19
+ projectId: string;
19
20
  content: MessageContent;
20
21
  conversationId: string;
21
- role: string;
22
22
  fromSubAgentId: string | null;
23
23
  toSubAgentId: string | null;
24
24
  fromExternalAgentId: string | null;
@@ -144,12 +144,12 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageIn
144
144
  id: string;
145
145
  createdAt: string;
146
146
  updatedAt: string;
147
- projectId: string;
148
- tenantId: string;
149
147
  metadata: MessageMetadata | null;
148
+ role: string;
149
+ tenantId: string;
150
+ projectId: string;
150
151
  content: MessageContent;
151
152
  conversationId: string;
152
- role: string;
153
153
  fromSubAgentId: string | null;
154
154
  toSubAgentId: string | null;
155
155
  fromExternalAgentId: string | null;
@@ -197,12 +197,12 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
197
197
  id: string;
198
198
  createdAt: string;
199
199
  updatedAt: string;
200
- projectId: string;
201
- tenantId: string;
202
200
  metadata: MessageMetadata | null;
201
+ role: string;
202
+ tenantId: string;
203
+ projectId: string;
203
204
  content: MessageContent;
204
205
  conversationId: string;
205
- role: string;
206
206
  fromSubAgentId: string | null;
207
207
  toSubAgentId: string | null;
208
208
  fromExternalAgentId: string | null;
@@ -9,18 +9,18 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
9
9
  id: string;
10
10
  createdAt: string;
11
11
  updatedAt: string;
12
- agentId: string;
13
- projectId: string;
14
- tenantId: string;
15
- subAgentId: string;
16
- metadata: TaskMetadataConfig | null;
17
- status: string;
18
- contextId: string;
19
12
  ref: {
20
- type: "commit" | "tag" | "branch";
13
+ type: "tag" | "commit" | "branch";
21
14
  name: string;
22
15
  hash: string;
23
16
  } | null;
17
+ metadata: TaskMetadataConfig | null;
18
+ status: string;
19
+ tenantId: string;
20
+ projectId: string;
21
+ agentId: string;
22
+ subAgentId: string;
23
+ contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
26
26
  id: string;
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "commit" | "tag" | "branch";
39
+ type: "tag" | "commit" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;
@@ -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 };