@inkeep/agents-core 0.58.17 → 0.58.19

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 (33) hide show
  1. package/dist/client-exports.d.ts +4 -4
  2. package/dist/constants/models.d.ts +2 -0
  3. package/dist/constants/models.js +2 -0
  4. package/dist/data-access/index.d.ts +2 -2
  5. package/dist/data-access/index.js +2 -2
  6. package/dist/data-access/manage/agents.d.ts +48 -48
  7. package/dist/data-access/manage/artifactComponents.d.ts +14 -14
  8. package/dist/data-access/manage/contextConfigs.d.ts +20 -20
  9. package/dist/data-access/manage/dataComponents.d.ts +6 -6
  10. package/dist/data-access/manage/functionTools.d.ts +16 -16
  11. package/dist/data-access/manage/skills.d.ts +15 -15
  12. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +18 -18
  13. package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
  14. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  15. package/dist/data-access/manage/subAgents.d.ts +24 -24
  16. package/dist/data-access/manage/tools.d.ts +21 -21
  17. package/dist/data-access/manage/triggers.d.ts +2 -2
  18. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  19. package/dist/data-access/runtime/apps.d.ts +29 -16
  20. package/dist/data-access/runtime/apps.js +14 -7
  21. package/dist/data-access/runtime/conversations.d.ts +16 -16
  22. package/dist/data-access/runtime/messages.d.ts +10 -7
  23. package/dist/data-access/runtime/messages.js +4 -1
  24. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  25. package/dist/data-access/runtime/tasks.d.ts +3 -3
  26. package/dist/db/manage/manage-schema.d.ts +4 -4
  27. package/dist/db/runtime/runtime-schema.d.ts +2 -2
  28. package/dist/index.d.ts +2 -2
  29. package/dist/index.js +2 -2
  30. package/dist/middleware/no-auth.d.ts +2 -2
  31. package/dist/validation/schemas.d.ts +562 -580
  32. package/dist/validation/schemas.js +3 -3
  33. package/package.json +1 -1
@@ -1,18 +1,18 @@
1
- import { TenantScopeConfig } from "../../db/manage/scope-definitions.js";
1
+ import { ProjectScopeConfig, TenantScopeConfig } from "../../db/manage/scope-definitions.js";
2
2
  import { AppType, PaginationConfig } from "../../types/utility.js";
3
3
  import { AgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
4
4
  import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
5
5
 
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
- type: AppType;
9
- name: string;
10
8
  id: string;
9
+ name: string;
10
+ description: string | null;
11
+ tenantId: string | null;
12
+ projectId: string | null;
13
+ type: AppType;
11
14
  createdAt: string;
12
15
  updatedAt: string;
13
- projectId: string | null;
14
- tenantId: string | null;
15
- description: string | null;
16
16
  enabled: boolean;
17
17
  config: {
18
18
  type: "web_client";
@@ -23,15 +23,19 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
23
23
  type: "api";
24
24
  api: Record<string, never>;
25
25
  };
26
- lastUsedAt: string | null;
27
- defaultProjectId: string | null;
28
26
  defaultAgentId: string | null;
27
+ defaultProjectId: string | null;
28
+ lastUsedAt: string | null;
29
29
  } | undefined>;
30
30
  declare const updateAppLastUsed: (db: AgentsRunDatabaseClient) => (id: string) => Promise<void>;
31
31
  declare const getAppByIdForTenant: (db: AgentsRunDatabaseClient) => (params: {
32
32
  scopes: TenantScopeConfig;
33
33
  id: string;
34
34
  }) => Promise<AppSelect | undefined>;
35
+ declare const getAppByIdForProject: (db: AgentsRunDatabaseClient) => (params: {
36
+ scopes: ProjectScopeConfig;
37
+ id: string;
38
+ }) => Promise<AppSelect | undefined>;
35
39
  declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
36
40
  scopes: TenantScopeConfig & {
37
41
  projectId?: string;
@@ -48,14 +52,14 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
48
52
  };
49
53
  }>;
50
54
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
51
- type: AppType;
52
- name: string;
53
55
  id: string;
56
+ name: string;
57
+ description: string | null;
58
+ tenantId: string | null;
59
+ projectId: string | null;
60
+ type: AppType;
54
61
  createdAt: string;
55
62
  updatedAt: string;
56
- projectId: string | null;
57
- tenantId: string | null;
58
- description: string | null;
59
63
  enabled: boolean;
60
64
  config: {
61
65
  type: "web_client";
@@ -66,19 +70,28 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
66
70
  type: "api";
67
71
  api: Record<string, never>;
68
72
  };
69
- lastUsedAt: string | null;
70
- defaultProjectId: string | null;
71
73
  defaultAgentId: string | null;
74
+ defaultProjectId: string | null;
75
+ lastUsedAt: string | null;
72
76
  }>;
73
77
  declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
74
78
  scopes: TenantScopeConfig;
75
79
  id: string;
76
80
  data: AppUpdate;
77
81
  }) => Promise<AppSelect | undefined>;
82
+ declare const updateAppForProject: (db: AgentsRunDatabaseClient) => (params: {
83
+ scopes: ProjectScopeConfig;
84
+ id: string;
85
+ data: AppUpdate;
86
+ }) => Promise<AppSelect | undefined>;
78
87
  declare const deleteAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
79
88
  scopes: TenantScopeConfig;
80
89
  id: string;
81
90
  }) => Promise<boolean>;
91
+ declare const deleteAppForProject: (db: AgentsRunDatabaseClient) => (params: {
92
+ scopes: ProjectScopeConfig;
93
+ id: string;
94
+ }) => Promise<boolean>;
82
95
  declare const deleteAppsByProject: (db: AgentsRunDatabaseClient) => (tenantId: string, projectId: string) => Promise<number>;
83
96
  declare const clearAppDefaultsByProject: (db: AgentsRunDatabaseClient) => (tenantId: string, projectId: string) => Promise<number>;
84
97
  declare const clearAppDefaultsByAgent: (db: AgentsRunDatabaseClient) => (tenantId: string, agentId: string) => Promise<number>;
@@ -110,4 +123,4 @@ declare const updateApp: (db: AgentsRunDatabaseClient) => (params: {
110
123
  }>;
111
124
  declare const deleteApp: (db: AgentsRunDatabaseClient) => (id: string) => Promise<boolean>;
112
125
  //#endregion
113
- export { clearAppDefaultsByAgent, clearAppDefaultsByProject, createApp, deleteApp, deleteAppForTenant, deleteAppsByProject, getAppById, getAppByIdForTenant, listAppsPaginated, updateApp, updateAppForTenant, updateAppLastUsed };
126
+ export { clearAppDefaultsByAgent, clearAppDefaultsByProject, createApp, deleteApp, deleteAppForProject, deleteAppForTenant, deleteAppsByProject, getAppById, getAppByIdForProject, getAppByIdForTenant, listAppsPaginated, updateApp, updateAppForProject, updateAppForTenant, updateAppLastUsed };
@@ -1,5 +1,5 @@
1
1
  import { apps } from "../../db/runtime/runtime-schema.js";
2
- import { tenantScopedWhere } from "../manage/scope-helpers.js";
2
+ import { projectScopedWhere, tenantScopedWhere } from "../manage/scope-helpers.js";
3
3
  import { and, count, desc, eq } from "drizzle-orm";
4
4
 
5
5
  //#region src/data-access/runtime/apps.ts
@@ -12,6 +12,9 @@ const updateAppLastUsed = (db) => async (id) => {
12
12
  const getAppByIdForTenant = (db) => async (params) => {
13
13
  return db.query.apps.findFirst({ where: and(eq(apps.id, params.id), tenantScopedWhere(apps, params.scopes)) });
14
14
  };
15
+ const getAppByIdForProject = (db) => async (params) => {
16
+ return db.query.apps.findFirst({ where: and(eq(apps.id, params.id), projectScopedWhere(apps, params.scopes)) });
17
+ };
15
18
  const listAppsPaginated = (db) => async (params) => {
16
19
  const page = params.pagination?.page || 1;
17
20
  const limit = Math.min(params.pagination?.limit || 10, 100);
@@ -42,17 +45,21 @@ const createApp = (db) => async (params) => {
42
45
  }).returning();
43
46
  return app;
44
47
  };
45
- const updateAppForTenant = (db) => async (params) => {
48
+ const _updateApp = (db, scopeWhere) => async (id, data) => {
46
49
  const now = (/* @__PURE__ */ new Date()).toISOString();
47
50
  const [updatedApp] = await db.update(apps).set({
48
- ...params.data,
51
+ ...data,
49
52
  updatedAt: now
50
- }).where(and(eq(apps.id, params.id), tenantScopedWhere(apps, params.scopes))).returning();
53
+ }).where(and(eq(apps.id, id), scopeWhere)).returning();
51
54
  return updatedApp;
52
55
  };
53
- const deleteAppForTenant = (db) => async (params) => {
54
- return (await db.delete(apps).where(and(eq(apps.id, params.id), tenantScopedWhere(apps, params.scopes))).returning()).length > 0;
56
+ const _deleteApp = (db, scopeWhere) => async (id) => {
57
+ return (await db.delete(apps).where(and(eq(apps.id, id), scopeWhere)).returning()).length > 0;
55
58
  };
59
+ const updateAppForTenant = (db) => async (params) => _updateApp(db, tenantScopedWhere(apps, params.scopes))(params.id, params.data);
60
+ const updateAppForProject = (db) => async (params) => _updateApp(db, projectScopedWhere(apps, params.scopes))(params.id, params.data);
61
+ const deleteAppForTenant = (db) => async (params) => _deleteApp(db, tenantScopedWhere(apps, params.scopes))(params.id);
62
+ const deleteAppForProject = (db) => async (params) => _deleteApp(db, projectScopedWhere(apps, params.scopes))(params.id);
56
63
  const deleteAppsByProject = (db) => async (tenantId, projectId) => {
57
64
  return (await db.delete(apps).where(and(tenantScopedWhere(apps, { tenantId }), eq(apps.projectId, projectId))).returning()).length;
58
65
  };
@@ -84,4 +91,4 @@ const deleteApp = (db) => async (id) => {
84
91
  };
85
92
 
86
93
  //#endregion
87
- export { clearAppDefaultsByAgent, clearAppDefaultsByProject, createApp, deleteApp, deleteAppForTenant, deleteAppsByProject, getAppById, getAppByIdForTenant, listAppsPaginated, updateApp, updateAppForTenant, updateAppLastUsed };
94
+ export { clearAppDefaultsByAgent, clearAppDefaultsByProject, createApp, deleteApp, deleteAppForProject, deleteAppForTenant, deleteAppsByProject, getAppById, getAppByIdForProject, getAppByIdForTenant, listAppsPaginated, updateApp, updateAppForProject, updateAppForTenant, updateAppLastUsed };
@@ -17,12 +17,12 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
17
17
  }>;
18
18
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
19
19
  id: string;
20
- createdAt: string;
21
- updatedAt: string;
22
- agentId: string | null;
23
- projectId: string;
24
20
  tenantId: string;
21
+ projectId: string;
22
+ agentId: string | null;
25
23
  title: string | null;
24
+ createdAt: string;
25
+ updatedAt: string;
26
26
  metadata: ConversationMetadata | null;
27
27
  ref: {
28
28
  type: "tag" | "commit" | "branch";
@@ -86,12 +86,12 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
86
86
  conversationId: string;
87
87
  }) => Promise<{
88
88
  id: string;
89
- createdAt: string;
90
- updatedAt: string;
91
- agentId: string | null;
92
- projectId: string;
93
89
  tenantId: string;
90
+ projectId: string;
91
+ agentId: string | null;
94
92
  title: string | null;
93
+ createdAt: string;
94
+ updatedAt: string;
95
95
  metadata: ConversationMetadata | null;
96
96
  ref: {
97
97
  type: "tag" | "commit" | "branch";
@@ -122,12 +122,12 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
122
122
  contextConfigId?: string | undefined;
123
123
  } | {
124
124
  id: string;
125
- createdAt: string;
126
- updatedAt: string;
127
- agentId: string | null;
128
- projectId: string;
129
125
  tenantId: string;
126
+ projectId: string;
127
+ agentId: string | null;
130
128
  title: string | null;
129
+ createdAt: string;
130
+ updatedAt: string;
131
131
  metadata: ConversationMetadata | null;
132
132
  ref: {
133
133
  type: "tag" | "commit" | "branch";
@@ -154,12 +154,12 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
154
154
  conversationId: string;
155
155
  }) => Promise<{
156
156
  id: string;
157
- createdAt: string;
158
- updatedAt: string;
159
- agentId: string | null;
160
- projectId: string;
161
157
  tenantId: string;
158
+ projectId: string;
159
+ agentId: string | null;
162
160
  title: string | null;
161
+ createdAt: string;
162
+ updatedAt: string;
163
163
  metadata: ConversationMetadata | null;
164
164
  ref: {
165
165
  type: "tag" | "commit" | "branch";
@@ -11,10 +11,10 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
11
11
  messageId: string;
12
12
  }) => Promise<{
13
13
  id: string;
14
+ tenantId: string;
15
+ projectId: string;
14
16
  createdAt: string;
15
17
  updatedAt: string;
16
- projectId: string;
17
- tenantId: string;
18
18
  metadata: MessageMetadata | null;
19
19
  content: MessageContent;
20
20
  role: string;
@@ -140,12 +140,15 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  tenantId: string;
141
141
  id: string;
142
142
  }[]>;
143
- declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
+ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: {
144
+ scopes: ProjectScopeConfig;
145
+ data: Omit<MessageInsert, "tenantId" | "projectId">;
146
+ }) => Promise<{
144
147
  id: string;
148
+ tenantId: string;
149
+ projectId: string;
145
150
  createdAt: string;
146
151
  updatedAt: string;
147
- projectId: string;
148
- tenantId: string;
149
152
  metadata: MessageMetadata | null;
150
153
  content: MessageContent;
151
154
  role: string;
@@ -195,10 +198,10 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
195
198
  messageId: string;
196
199
  }) => Promise<{
197
200
  id: string;
201
+ tenantId: string;
202
+ projectId: string;
198
203
  createdAt: string;
199
204
  updatedAt: string;
200
- projectId: string;
201
- tenantId: string;
202
205
  metadata: MessageMetadata | null;
203
206
  content: MessageContent;
204
207
  role: string;
@@ -32,9 +32,12 @@ const getVisibleMessages = (db) => async (params) => {
32
32
  return await db.select().from(messages).where(and(projectScopedWhere(messages, params.scopes), eq(messages.conversationId, params.conversationId), inArray(messages.visibility, visibilityFilter))).limit(limit).offset(offset).orderBy(asc(messages.createdAt));
33
33
  };
34
34
  const createMessage = (db) => async (params) => {
35
+ const { scopes, data } = params;
35
36
  const now = (/* @__PURE__ */ new Date()).toISOString();
36
37
  const [created] = await db.insert(messages).values({
37
- ...params,
38
+ ...data,
39
+ tenantId: scopes.tenantId,
40
+ projectId: scopes.projectId,
38
41
  createdAt: now,
39
42
  updatedAt: now
40
43
  }).returning();
@@ -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;
@@ -8,11 +8,11 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
8
8
  //#region src/data-access/runtime/tasks.d.ts
9
9
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
10
10
  id: string;
11
+ tenantId: string;
12
+ projectId: string;
13
+ agentId: string;
11
14
  createdAt: string;
12
15
  updatedAt: string;
13
- agentId: string;
14
- projectId: string;
15
- tenantId: string;
16
16
  metadata: TaskMetadataConfig | null;
17
17
  ref: {
18
18
  type: "tag" | "commit" | "branch";
@@ -814,13 +814,13 @@ declare const triggers: drizzle_orm_pg_core1870.PgTableWithColumns<{
814
814
  algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
815
815
  encoding: "hex" | "base64";
816
816
  signature: {
817
- source: "query" | "body" | "header";
817
+ source: "query" | "header" | "body";
818
818
  key: string;
819
819
  prefix?: string | undefined;
820
820
  regex?: string | undefined;
821
821
  };
822
822
  signedComponents: {
823
- source: "literal" | "body" | "header";
823
+ source: "literal" | "header" | "body";
824
824
  required: boolean;
825
825
  key?: string | undefined;
826
826
  value?: string | undefined;
@@ -851,13 +851,13 @@ declare const triggers: drizzle_orm_pg_core1870.PgTableWithColumns<{
851
851
  algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
852
852
  encoding: "hex" | "base64";
853
853
  signature: {
854
- source: "query" | "body" | "header";
854
+ source: "query" | "header" | "body";
855
855
  key: string;
856
856
  prefix?: string | undefined;
857
857
  regex?: string | undefined;
858
858
  };
859
859
  signedComponents: {
860
- source: "literal" | "body" | "header";
860
+ source: "literal" | "header" | "body";
861
861
  required: boolean;
862
862
  key?: string | undefined;
863
863
  value?: string | undefined;
@@ -2109,7 +2109,7 @@ declare const scheduledTriggerInvocations: drizzle_orm_pg_core1577.PgTableWithCo
2109
2109
  tableName: "scheduled_trigger_invocations";
2110
2110
  dataType: "string";
2111
2111
  columnType: "PgVarchar";
2112
- data: "pending" | "running" | "completed" | "failed" | "cancelled";
2112
+ data: "pending" | "failed" | "running" | "completed" | "cancelled";
2113
2113
  driverParam: string;
2114
2114
  notNull: true;
2115
2115
  hasDefault: false;
@@ -2122,7 +2122,7 @@ declare const scheduledTriggerInvocations: drizzle_orm_pg_core1577.PgTableWithCo
2122
2122
  generated: undefined;
2123
2123
  }, {}, {
2124
2124
  length: 50;
2125
- $type: "pending" | "running" | "completed" | "failed" | "cancelled";
2125
+ $type: "pending" | "failed" | "running" | "completed" | "cancelled";
2126
2126
  }>;
2127
2127
  scheduledFor: drizzle_orm_pg_core1577.PgColumn<{
2128
2128
  name: "scheduled_for";