@inkeep/agents-core 0.0.0-dev-20260304205709 → 0.0.0-dev-20260304210938

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 (43) 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 +6 -0
  5. package/dist/auth/permissions.d.ts +9 -9
  6. package/dist/client-exports.d.ts +2 -2
  7. package/dist/client-exports.js +2 -2
  8. package/dist/data-access/index.d.ts +2 -1
  9. package/dist/data-access/index.js +2 -1
  10. package/dist/data-access/manage/agents.d.ts +11 -11
  11. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  12. package/dist/data-access/manage/contextConfigs.d.ts +12 -12
  13. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  14. package/dist/data-access/manage/functionTools.d.ts +12 -12
  15. package/dist/data-access/manage/skills.d.ts +9 -9
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  17. package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  19. package/dist/data-access/manage/subAgents.d.ts +9 -9
  20. package/dist/data-access/manage/tools.d.ts +15 -15
  21. package/dist/data-access/runtime/apiKeys.d.ts +12 -12
  22. package/dist/data-access/runtime/conversations.d.ts +23 -23
  23. package/dist/data-access/runtime/messages.d.ts +6 -6
  24. package/dist/data-access/runtime/tasks.d.ts +6 -6
  25. package/dist/data-access/runtime/userProfiles.d.ts +14 -0
  26. package/dist/data-access/runtime/userProfiles.js +45 -0
  27. package/dist/db/manage/manage-schema.d.ts +449 -449
  28. package/dist/db/runtime/runtime-schema.d.ts +414 -300
  29. package/dist/db/runtime/runtime-schema.js +14 -1
  30. package/dist/index.d.ts +5 -4
  31. package/dist/index.js +4 -3
  32. package/dist/middleware/no-auth.d.ts +2 -2
  33. package/dist/types/entities.d.ts +7 -2
  34. package/dist/types/index.d.ts +2 -2
  35. package/dist/validation/dolt-schemas.d.ts +1 -1
  36. package/dist/validation/index.d.ts +2 -2
  37. package/dist/validation/index.js +2 -2
  38. package/dist/validation/schemas.d.ts +1692 -1447
  39. package/dist/validation/schemas.js +16 -2
  40. package/drizzle/runtime/0019_easy_bedlam.sql +24 -0
  41. package/drizzle/runtime/meta/0019_snapshot.json +4003 -0
  42. package/drizzle/runtime/meta/_journal.json +7 -0
  43. package/package.json +1 -1
@@ -19,11 +19,11 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
19
19
  scopes: ProjectScopeConfig;
20
20
  toolId: string;
21
21
  }) => Promise<{
22
- projectId: string;
23
- tenantId: string;
24
22
  id: string;
25
23
  name: string;
26
24
  description: string | null;
25
+ tenantId: string;
26
+ projectId: string;
27
27
  createdAt: string;
28
28
  updatedAt: string;
29
29
  headers: Record<string, string> | null;
@@ -77,11 +77,11 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
77
77
  };
78
78
  }>;
79
79
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
80
- projectId: string;
81
- tenantId: string;
82
80
  id: string;
83
81
  name: string;
84
82
  description: string | null;
83
+ tenantId: string;
84
+ projectId: string;
85
85
  createdAt: string;
86
86
  updatedAt: string;
87
87
  headers: Record<string, string> | null;
@@ -134,10 +134,10 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
134
134
  needsApproval?: boolean;
135
135
  }> | null;
136
136
  }) => Promise<{
137
- agentId: string;
138
- projectId: string;
139
- tenantId: string;
140
137
  id: string;
138
+ tenantId: string;
139
+ projectId: string;
140
+ agentId: string;
141
141
  createdAt: string;
142
142
  updatedAt: string;
143
143
  toolId: string;
@@ -153,10 +153,10 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
153
153
  subAgentId: string;
154
154
  toolId: string;
155
155
  }) => Promise<{
156
- agentId: string;
157
- projectId: string;
158
- tenantId: string;
159
156
  id: string;
157
+ tenantId: string;
158
+ projectId: string;
159
+ agentId: string;
160
160
  createdAt: string;
161
161
  updatedAt: string;
162
162
  toolId: string;
@@ -181,10 +181,10 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
181
181
  }> | null;
182
182
  relationId?: string;
183
183
  }) => Promise<{
184
- agentId: string;
185
- projectId: string;
186
- tenantId: string;
187
184
  id: string;
185
+ tenantId: string;
186
+ projectId: string;
187
+ agentId: string;
188
188
  createdAt: string;
189
189
  updatedAt: string;
190
190
  toolId: string;
@@ -201,11 +201,11 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
201
201
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
202
202
  data: ToolInsert;
203
203
  }) => Promise<{
204
- projectId: string;
205
- tenantId: string;
206
204
  id: string;
207
205
  name: string;
208
206
  description: string | null;
207
+ tenantId: string;
208
+ projectId: string;
209
209
  createdAt: string;
210
210
  updatedAt: string;
211
211
  headers: Record<string, string> | null;
@@ -8,11 +8,11 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- agentId: string;
12
- projectId: string;
13
- tenantId: string;
14
11
  id: string;
15
12
  name: string | null;
13
+ tenantId: string;
14
+ projectId: string;
15
+ agentId: string;
16
16
  createdAt: string;
17
17
  updatedAt: string;
18
18
  expiresAt: string | null;
@@ -22,11 +22,11 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
22
22
  lastUsedAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- agentId: string;
26
- projectId: string;
27
- tenantId: string;
28
25
  id: string;
29
26
  name: string | null;
27
+ tenantId: string;
28
+ projectId: string;
29
+ agentId: string;
30
30
  createdAt: string;
31
31
  updatedAt: string;
32
32
  expiresAt: string | null;
@@ -39,11 +39,11 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
- agentId: string;
43
- projectId: string;
44
- tenantId: string;
45
42
  id: string;
46
43
  name: string | null;
44
+ tenantId: string;
45
+ projectId: string;
46
+ agentId: string;
47
47
  createdAt: string;
48
48
  updatedAt: string;
49
49
  expiresAt: string | null;
@@ -66,11 +66,11 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  };
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
- agentId: string;
70
- projectId: string;
71
- tenantId: string;
72
69
  id: string;
73
70
  name: string | null;
71
+ tenantId: string;
72
+ projectId: string;
73
+ agentId: string;
74
74
  createdAt: string;
75
75
  updatedAt: string;
76
76
  expiresAt: string | null;
@@ -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
- agentId: string | null;
20
- projectId: string;
21
- tenantId: string;
22
- userId: string | null;
23
19
  id: string;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string | null;
24
23
  title: string | null;
25
24
  createdAt: string;
26
25
  updatedAt: string;
27
26
  metadata: ConversationMetadata | null;
28
27
  ref: {
29
- type: "commit" | "tag" | "branch";
28
+ type: "tag" | "commit" | "branch";
30
29
  name: string;
31
30
  hash: string;
32
31
  } | null;
32
+ userId: 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;
@@ -85,20 +85,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  scopes: ProjectScopeConfig;
86
86
  conversationId: string;
87
87
  }) => Promise<{
88
- agentId: string | null;
89
- projectId: string;
90
- tenantId: string;
91
- userId: string | null;
92
88
  id: string;
89
+ tenantId: string;
90
+ projectId: string;
91
+ agentId: string | null;
93
92
  title: string | null;
94
93
  createdAt: string;
95
94
  updatedAt: string;
96
95
  metadata: ConversationMetadata | null;
97
96
  ref: {
98
- type: "commit" | "tag" | "branch";
97
+ type: "tag" | "commit" | "branch";
99
98
  name: string;
100
99
  hash: string;
101
100
  } | null;
101
+ userId: 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
  };
@@ -121,20 +121,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  metadata?: ConversationMetadata | null | undefined;
122
122
  contextConfigId?: string | undefined;
123
123
  } | {
124
- agentId: string | null;
125
- projectId: string;
126
- tenantId: string;
127
- userId: string | null;
128
124
  id: string;
125
+ tenantId: string;
126
+ projectId: string;
127
+ agentId: string | null;
129
128
  title: string | null;
130
129
  createdAt: string;
131
130
  updatedAt: string;
132
131
  metadata: ConversationMetadata | null;
133
132
  ref: {
134
- type: "commit" | "tag" | "branch";
133
+ type: "tag" | "commit" | "branch";
135
134
  name: string;
136
135
  hash: string;
137
136
  } | null;
137
+ userId: 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
- agentId: string | null;
157
- projectId: string;
158
- tenantId: string;
159
- userId: string | null;
160
156
  id: string;
157
+ tenantId: string;
158
+ projectId: string;
159
+ agentId: string | null;
161
160
  title: string | null;
162
161
  createdAt: string;
163
162
  updatedAt: string;
164
163
  metadata: ConversationMetadata | null;
165
164
  ref: {
166
- type: "commit" | "tag" | "branch";
165
+ type: "tag" | "commit" | "branch";
167
166
  name: string;
168
167
  hash: string;
169
168
  } | null;
169
+ userId: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -10,9 +10,9 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
- projectId: string;
14
- tenantId: string;
15
13
  id: string;
14
+ tenantId: string;
15
+ projectId: string;
16
16
  createdAt: string;
17
17
  updatedAt: string;
18
18
  metadata: MessageMetadata | null;
@@ -141,9 +141,9 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
141
141
  id: string;
142
142
  }[]>;
143
143
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
144
- projectId: string;
145
- tenantId: string;
146
144
  id: string;
145
+ tenantId: string;
146
+ projectId: string;
147
147
  createdAt: string;
148
148
  updatedAt: string;
149
149
  metadata: MessageMetadata | null;
@@ -194,9 +194,9 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
194
194
  scopes: ProjectScopeConfig;
195
195
  messageId: string;
196
196
  }) => Promise<{
197
- projectId: string;
198
- tenantId: string;
199
197
  id: string;
198
+ tenantId: string;
199
+ projectId: string;
200
200
  createdAt: string;
201
201
  updatedAt: string;
202
202
  metadata: MessageMetadata | 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
- agentId: string;
10
- projectId: string;
11
- tenantId: string;
12
9
  id: string;
10
+ tenantId: string;
11
+ projectId: string;
12
+ agentId: string;
13
13
  createdAt: string;
14
14
  updatedAt: string;
15
15
  metadata: TaskMetadataConfig | null;
16
- subAgentId: string;
17
16
  ref: {
18
- type: "commit" | "tag" | "branch";
17
+ type: "tag" | "commit" | "branch";
19
18
  name: string;
20
19
  hash: string;
21
20
  } | null;
22
21
  status: string;
22
+ subAgentId: string;
23
23
  contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
@@ -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;
@@ -0,0 +1,14 @@
1
+ import { userProfile } from "../../db/runtime/runtime-schema.js";
2
+ import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
3
+
4
+ //#region src/data-access/runtime/userProfiles.d.ts
5
+ type UserProfile = typeof userProfile.$inferSelect;
6
+ type UpsertUserProfileData = {
7
+ timezone?: string | null;
8
+ attributes?: Record<string, unknown>;
9
+ };
10
+ declare const getUserProfile: (db: AgentsRunDatabaseClient) => (userId: string) => Promise<UserProfile | null>;
11
+ declare const createUserProfileIfNotExists: (db: AgentsRunDatabaseClient) => (userId: string) => Promise<void>;
12
+ declare const upsertUserProfile: (db: AgentsRunDatabaseClient) => (userId: string, data: UpsertUserProfileData) => Promise<UserProfile>;
13
+ //#endregion
14
+ export { UpsertUserProfileData, UserProfile, createUserProfileIfNotExists, getUserProfile, upsertUserProfile };
@@ -0,0 +1,45 @@
1
+ import { userProfile } from "../../db/runtime/runtime-schema.js";
2
+ import { generateId } from "../../utils/conversations.js";
3
+ import "../../utils/index.js";
4
+ import { eq } from "drizzle-orm";
5
+
6
+ //#region src/data-access/runtime/userProfiles.ts
7
+ const getUserProfile = (db) => async (userId) => {
8
+ return (await db.select().from(userProfile).where(eq(userProfile.userId, userId)).limit(1))[0] ?? null;
9
+ };
10
+ const createUserProfileIfNotExists = (db) => async (userId) => {
11
+ const id = generateId();
12
+ const now = (/* @__PURE__ */ new Date()).toISOString();
13
+ await db.insert(userProfile).values({
14
+ id,
15
+ userId,
16
+ timezone: null,
17
+ attributes: {},
18
+ createdAt: now,
19
+ updatedAt: now
20
+ }).onConflictDoNothing();
21
+ };
22
+ const upsertUserProfile = (db) => async (userId, data) => {
23
+ const id = generateId();
24
+ const now = (/* @__PURE__ */ new Date()).toISOString();
25
+ const result = await db.insert(userProfile).values({
26
+ id,
27
+ userId,
28
+ timezone: data.timezone ?? null,
29
+ attributes: data.attributes ?? {},
30
+ createdAt: now,
31
+ updatedAt: now
32
+ }).onConflictDoUpdate({
33
+ target: userProfile.userId,
34
+ set: {
35
+ ...data.timezone !== void 0 && { timezone: data.timezone },
36
+ ...data.attributes !== void 0 && { attributes: data.attributes },
37
+ updatedAt: now
38
+ }
39
+ }).returning();
40
+ if (!result[0]) throw new Error(`Failed to upsert user profile for userId: ${userId}`);
41
+ return result[0];
42
+ };
43
+
44
+ //#endregion
45
+ export { createUserProfileIfNotExists, getUserProfile, upsertUserProfile };