@inkeep/agents-core 0.0.0-dev-20260317081523 → 0.0.0-dev-20260317210645

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.
@@ -6,13 +6,16 @@ import { AppInsert, AppSelect, AppUpdate } from "../../types/entities.js";
6
6
  //#region src/data-access/runtime/apps.d.ts
7
7
  declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promise<{
8
8
  type: AppType;
9
- id: string;
10
9
  name: string;
11
10
  description: string | null;
12
- tenantId: string | null;
13
- projectId: string | null;
11
+ id: string;
14
12
  createdAt: string;
15
13
  updatedAt: string;
14
+ tenantId: string | null;
15
+ projectId: string | null;
16
+ lastUsedAt: string | null;
17
+ defaultProjectId: string | null;
18
+ defaultAgentId: string | null;
16
19
  enabled: boolean;
17
20
  config: {
18
21
  type: "web_client";
@@ -23,9 +26,6 @@ declare const getAppById: (db: AgentsRunDatabaseClient) => (id: string) => Promi
23
26
  type: "api";
24
27
  api: Record<string, never>;
25
28
  };
26
- lastUsedAt: string | null;
27
- defaultProjectId: string | null;
28
- defaultAgentId: string | null;
29
29
  } | undefined>;
30
30
  declare const updateAppLastUsed: (db: AgentsRunDatabaseClient) => (id: string) => Promise<void>;
31
31
  declare const getAppByIdForTenant: (db: AgentsRunDatabaseClient) => (params: {
@@ -49,13 +49,16 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
49
49
  }>;
50
50
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
51
51
  type: AppType;
52
- id: string;
53
52
  name: string;
54
53
  description: string | null;
55
- tenantId: string | null;
56
- projectId: string | null;
54
+ id: string;
57
55
  createdAt: string;
58
56
  updatedAt: string;
57
+ tenantId: string | null;
58
+ projectId: string | null;
59
+ lastUsedAt: string | null;
60
+ defaultProjectId: string | null;
61
+ defaultAgentId: string | null;
59
62
  enabled: boolean;
60
63
  config: {
61
64
  type: "web_client";
@@ -66,9 +69,6 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
66
69
  type: "api";
67
70
  api: Record<string, never>;
68
71
  };
69
- lastUsedAt: string | null;
70
- defaultProjectId: string | null;
71
- defaultAgentId: string | null;
72
72
  }>;
73
73
  declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
74
74
  scopes: TenantScopeConfig;
@@ -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
- id: string;
20
- tenantId: string;
21
- projectId: string;
22
- agentId: string | null;
23
19
  title: string | null;
20
+ id: string;
24
21
  createdAt: string;
25
22
  updatedAt: string;
26
- metadata: ConversationMetadata | null;
27
23
  ref: {
28
- type: "tag" | "commit" | "branch";
24
+ type: "commit" | "tag" | "branch";
29
25
  name: string;
30
26
  hash: string;
31
27
  } | null;
32
28
  userId: string | null;
29
+ metadata: ConversationMetadata | null;
30
+ tenantId: string;
31
+ projectId: string;
32
+ agentId: 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: "tag" | "commit" | "branch";
47
+ type: "commit" | "tag" | "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: "tag" | "commit" | "branch";
73
+ type: "commit" | "tag" | "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
- id: string;
89
- tenantId: string;
90
- projectId: string;
91
- agentId: string | null;
92
88
  title: string | null;
89
+ id: string;
93
90
  createdAt: string;
94
91
  updatedAt: string;
95
- metadata: ConversationMetadata | null;
96
92
  ref: {
97
- type: "tag" | "commit" | "branch";
93
+ type: "commit" | "tag" | "branch";
98
94
  name: string;
99
95
  hash: string;
100
96
  } | null;
101
97
  userId: string | null;
98
+ metadata: ConversationMetadata | null;
99
+ tenantId: string;
100
+ projectId: string;
101
+ agentId: 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: "tag" | "commit" | "branch";
111
+ type: "commit" | "tag" | "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
- id: string;
125
- tenantId: string;
126
- projectId: string;
127
- agentId: string | null;
128
124
  title: string | null;
125
+ id: string;
129
126
  createdAt: string;
130
127
  updatedAt: string;
131
- metadata: ConversationMetadata | null;
132
128
  ref: {
133
- type: "tag" | "commit" | "branch";
129
+ type: "commit" | "tag" | "branch";
134
130
  name: string;
135
131
  hash: string;
136
132
  } | null;
137
133
  userId: string | null;
134
+ metadata: ConversationMetadata | null;
135
+ tenantId: string;
136
+ projectId: string;
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
- id: string;
157
- tenantId: string;
158
- projectId: string;
159
- agentId: string | null;
160
156
  title: string | null;
157
+ id: string;
161
158
  createdAt: string;
162
159
  updatedAt: string;
163
- metadata: ConversationMetadata | null;
164
160
  ref: {
165
- type: "tag" | "commit" | "branch";
161
+ type: "commit" | "tag" | "branch";
166
162
  name: string;
167
163
  hash: string;
168
164
  } | null;
169
165
  userId: string | null;
166
+ metadata: ConversationMetadata | null;
167
+ tenantId: string;
168
+ projectId: string;
169
+ agentId: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -11,25 +11,25 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
11
11
  messageId: string;
12
12
  }) => Promise<{
13
13
  id: string;
14
- tenantId: string;
15
- projectId: string;
16
14
  createdAt: string;
17
15
  updatedAt: string;
18
16
  metadata: MessageMetadata | null;
19
- content: MessageContent;
20
17
  role: string;
18
+ content: MessageContent;
19
+ tenantId: string;
20
+ projectId: string;
21
+ conversationId: 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: {
@@ -140,27 +140,30 @@ 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;
145
- tenantId: string;
146
- projectId: string;
147
148
  createdAt: string;
148
149
  updatedAt: string;
149
150
  metadata: MessageMetadata | null;
150
- content: MessageContent;
151
151
  role: string;
152
+ content: MessageContent;
153
+ tenantId: string;
154
+ projectId: string;
155
+ conversationId: string;
152
156
  fromSubAgentId: string | null;
153
157
  toSubAgentId: string | null;
154
158
  fromExternalAgentId: string | null;
155
159
  toExternalAgentId: string | null;
156
- taskId: string | null;
157
- a2aTaskId: string | null;
158
- conversationId: string;
159
160
  fromTeamAgentId: string | null;
160
161
  toTeamAgentId: string | null;
161
162
  visibility: string;
162
163
  messageType: string;
164
+ taskId: string | null;
163
165
  parentMessageId: string | null;
166
+ a2aTaskId: string | null;
164
167
  a2aSessionId: string | null;
165
168
  }>;
166
169
  declare const updateMessage: (db: AgentsRunDatabaseClient) => (params: {
@@ -195,25 +198,25 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
195
198
  messageId: string;
196
199
  }) => Promise<{
197
200
  id: string;
198
- tenantId: string;
199
- projectId: string;
200
201
  createdAt: string;
201
202
  updatedAt: string;
202
203
  metadata: MessageMetadata | null;
203
- content: MessageContent;
204
204
  role: string;
205
+ content: MessageContent;
206
+ tenantId: string;
207
+ projectId: string;
208
+ conversationId: string;
205
209
  fromSubAgentId: string | null;
206
210
  toSubAgentId: string | null;
207
211
  fromExternalAgentId: string | null;
208
212
  toExternalAgentId: string | null;
209
- taskId: string | null;
210
- a2aTaskId: string | null;
211
- conversationId: string;
212
213
  fromTeamAgentId: string | null;
213
214
  toTeamAgentId: string | null;
214
215
  visibility: string;
215
216
  messageType: string;
217
+ taskId: string | null;
216
218
  parentMessageId: string | null;
219
+ a2aTaskId: string | null;
217
220
  a2aSessionId: string | null;
218
221
  }>;
219
222
  declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -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" | "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;
@@ -8,20 +8,20 @@ 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;
14
11
  createdAt: string;
15
12
  updatedAt: string;
16
- metadata: TaskMetadataConfig | null;
17
13
  ref: {
18
- type: "tag" | "commit" | "branch";
14
+ type: "commit" | "tag" | "branch";
19
15
  name: string;
20
16
  hash: string;
21
17
  } | null;
18
+ metadata: TaskMetadataConfig | null;
22
19
  status: string;
23
- subAgentId: string;
20
+ tenantId: string;
21
+ projectId: string;
22
+ agentId: string;
24
23
  contextId: string;
24
+ subAgentId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
27
27
  id: string;
@@ -39,7 +39,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
39
39
  updatedAt: string;
40
40
  contextId: string;
41
41
  ref: {
42
- type: "tag" | "commit" | "branch";
42
+ type: "commit" | "tag" | "branch";
43
43
  name: string;
44
44
  hash: string;
45
45
  } | null;
@@ -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: "header" | "literal" | "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: "header" | "literal" | "body";
861
861
  required: boolean;
862
862
  key?: string | undefined;
863
863
  value?: string | undefined;
@@ -216,7 +216,7 @@ declare const conversations: drizzle_orm_pg_core1577.PgTableWithColumns<{
216
216
  dataType: "json";
217
217
  columnType: "PgJsonb";
218
218
  data: {
219
- type: "tag" | "commit" | "branch";
219
+ type: "commit" | "tag" | "branch";
220
220
  name: string;
221
221
  hash: string;
222
222
  };
@@ -232,7 +232,7 @@ declare const conversations: drizzle_orm_pg_core1577.PgTableWithColumns<{
232
232
  generated: undefined;
233
233
  }, {}, {
234
234
  $type: {
235
- type: "tag" | "commit" | "branch";
235
+ type: "commit" | "tag" | "branch";
236
236
  name: string;
237
237
  hash: string;
238
238
  };
@@ -413,7 +413,7 @@ declare const tasks: drizzle_orm_pg_core1577.PgTableWithColumns<{
413
413
  dataType: "json";
414
414
  columnType: "PgJsonb";
415
415
  data: {
416
- type: "tag" | "commit" | "branch";
416
+ type: "commit" | "tag" | "branch";
417
417
  name: string;
418
418
  hash: string;
419
419
  };
@@ -429,7 +429,7 @@ declare const tasks: drizzle_orm_pg_core1577.PgTableWithColumns<{
429
429
  generated: undefined;
430
430
  }, {}, {
431
431
  $type: {
432
- type: "tag" | "commit" | "branch";
432
+ type: "commit" | "tag" | "branch";
433
433
  name: string;
434
434
  hash: string;
435
435
  };
@@ -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" | "failed" | "running" | "completed" | "cancelled";
2112
+ data: "pending" | "running" | "completed" | "failed" | "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" | "failed" | "running" | "completed" | "cancelled";
2125
+ $type: "pending" | "running" | "completed" | "failed" | "cancelled";
2126
2126
  }>;
2127
2127
  scheduledFor: drizzle_orm_pg_core1577.PgColumn<{
2128
2128
  name: "scheduled_for";
@@ -3344,7 +3344,7 @@ declare const contextCache: drizzle_orm_pg_core1577.PgTableWithColumns<{
3344
3344
  dataType: "json";
3345
3345
  columnType: "PgJsonb";
3346
3346
  data: {
3347
- type: "tag" | "commit" | "branch";
3347
+ type: "commit" | "tag" | "branch";
3348
3348
  name: string;
3349
3349
  hash: string;
3350
3350
  };
@@ -3360,7 +3360,7 @@ declare const contextCache: drizzle_orm_pg_core1577.PgTableWithColumns<{
3360
3360
  generated: undefined;
3361
3361
  }, {}, {
3362
3362
  $type: {
3363
- type: "tag" | "commit" | "branch";
3363
+ type: "commit" | "tag" | "branch";
3364
3364
  name: string;
3365
3365
  hash: string;
3366
3366
  };
@@ -4378,7 +4378,7 @@ declare const workAppGitHubInstallations: drizzle_orm_pg_core1577.PgTableWithCol
4378
4378
  tableName: "work_app_github_installations";
4379
4379
  dataType: "string";
4380
4380
  columnType: "PgVarchar";
4381
- data: "User" | "Organization";
4381
+ data: "Organization" | "User";
4382
4382
  driverParam: string;
4383
4383
  notNull: true;
4384
4384
  hasDefault: false;
@@ -4391,7 +4391,7 @@ declare const workAppGitHubInstallations: drizzle_orm_pg_core1577.PgTableWithCol
4391
4391
  generated: undefined;
4392
4392
  }, {}, {
4393
4393
  length: 20;
4394
- $type: "User" | "Organization";
4394
+ $type: "Organization" | "User";
4395
4395
  }>;
4396
4396
  status: drizzle_orm_pg_core1577.PgColumn<{
4397
4397
  name: "status";