@inkeep/agents-core 0.56.2 → 0.57.0

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 +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 +6 -0
  5. package/dist/auth/permissions.d.ts +13 -13
  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 +26 -26
  11. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  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 +14 -14
  15. package/dist/data-access/manage/skills.d.ts +19 -19
  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 +18 -18
  20. package/dist/data-access/manage/tools.d.ts +18 -18
  21. package/dist/data-access/manage/triggers.d.ts +2 -2
  22. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  23. package/dist/data-access/runtime/conversations.d.ts +24 -24
  24. package/dist/data-access/runtime/messages.d.ts +21 -21
  25. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  26. package/dist/data-access/runtime/tasks.d.ts +6 -6
  27. package/dist/data-access/runtime/userProfiles.d.ts +14 -0
  28. package/dist/data-access/runtime/userProfiles.js +45 -0
  29. package/dist/db/manage/manage-schema.d.ts +361 -361
  30. package/dist/db/runtime/runtime-schema.d.ts +384 -270
  31. package/dist/db/runtime/runtime-schema.js +14 -1
  32. package/dist/index.d.ts +5 -4
  33. package/dist/index.js +4 -3
  34. package/dist/types/entities.d.ts +7 -2
  35. package/dist/types/index.d.ts +2 -2
  36. package/dist/utils/error.d.ts +51 -51
  37. package/dist/utils/model-factory.d.ts +10 -2
  38. package/dist/utils/model-factory.js +21 -13
  39. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  40. package/dist/validation/index.d.ts +2 -2
  41. package/dist/validation/index.js +2 -2
  42. package/dist/validation/schemas.d.ts +2159 -1914
  43. package/dist/validation/schemas.js +16 -2
  44. package/drizzle/runtime/0019_easy_bedlam.sql +24 -0
  45. package/drizzle/runtime/meta/0019_snapshot.json +4003 -0
  46. package/drizzle/runtime/meta/_journal.json +7 -0
  47. package/package.json +1 -1
@@ -34,7 +34,7 @@ declare const listScheduledTriggerInvocationsPaginated: (db: AgentsRunDatabaseCl
34
34
  }) => Promise<{
35
35
  data: {
36
36
  scheduledTriggerId: string;
37
- status: "pending" | "running" | "completed" | "failed" | "cancelled";
37
+ status: "pending" | "failed" | "running" | "completed" | "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" | "running" | "completed" | "failed" | "cancelled";
177
+ status: "pending" | "failed" | "running" | "completed" | "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" | "running" | "completed" | "failed" | "cancelled";
211
+ status: "pending" | "failed" | "running" | "completed" | "cancelled";
212
212
  scheduledFor: string;
213
213
  startedAt: string | null;
214
214
  completedAt: string | null;
@@ -6,21 +6,21 @@ 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;
13
11
  createdAt: string;
14
- updatedAt: string;
15
12
  metadata: TaskMetadataConfig | null;
13
+ updatedAt: string;
14
+ projectId: string;
15
+ agentId: string;
16
16
  subAgentId: string;
17
+ status: string;
18
+ contextId: string;
17
19
  ref: {
18
20
  type: "commit" | "tag" | "branch";
19
21
  name: string;
20
22
  hash: string;
21
23
  } | null;
22
- status: string;
23
- contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
26
26
  id: string;
@@ -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 };