@inkeep/agents-core 0.58.15 → 0.58.16

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.
@@ -5,12 +5,12 @@ 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
- tenantId: string | null;
9
- projectId: string | null;
8
+ type: AppType;
10
9
  id: string;
11
10
  name: string;
12
- type: AppType;
13
11
  description: string | null;
12
+ tenantId: string | null;
13
+ projectId: string | null;
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
16
  enabled: boolean;
@@ -23,9 +23,9 @@ 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: {
@@ -48,12 +48,12 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
48
48
  };
49
49
  }>;
50
50
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
51
- tenantId: string | null;
52
- projectId: string | null;
51
+ type: AppType;
53
52
  id: string;
54
53
  name: string;
55
- type: AppType;
56
54
  description: string | null;
55
+ tenantId: string | null;
56
+ projectId: string | null;
57
57
  createdAt: string;
58
58
  updatedAt: string;
59
59
  enabled: boolean;
@@ -66,9 +66,9 @@ declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) =>
66
66
  type: "api";
67
67
  api: Record<string, never>;
68
68
  };
69
- lastUsedAt: string | null;
70
- defaultProjectId: string | null;
71
69
  defaultAgentId: string | null;
70
+ defaultProjectId: string | null;
71
+ lastUsedAt: string | null;
72
72
  }>;
73
73
  declare const updateAppForTenant: (db: AgentsRunDatabaseClient) => (params: {
74
74
  scopes: TenantScopeConfig;
@@ -16,21 +16,21 @@ 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;
19
20
  tenantId: string;
20
21
  projectId: string;
21
22
  agentId: string | null;
22
- id: string;
23
- metadata: ConversationMetadata | null;
23
+ title: string | null;
24
24
  createdAt: string;
25
25
  updatedAt: string;
26
- userId: string | null;
27
- activeSubAgentId: string;
26
+ metadata: ConversationMetadata | null;
28
27
  ref: {
29
28
  type: "commit" | "tag" | "branch";
30
29
  name: string;
31
30
  hash: string;
32
31
  } | null;
33
- title: string | null;
32
+ userId: string | null;
33
+ activeSubAgentId: string;
34
34
  lastContextResolution: string | null;
35
35
  }>;
36
36
  declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
@@ -85,21 +85,21 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  scopes: ProjectScopeConfig;
86
86
  conversationId: string;
87
87
  }) => Promise<{
88
+ id: string;
88
89
  tenantId: string;
89
90
  projectId: string;
90
91
  agentId: string | null;
91
- id: string;
92
- metadata: ConversationMetadata | null;
92
+ title: string | null;
93
93
  createdAt: string;
94
94
  updatedAt: string;
95
- userId: string | null;
96
- activeSubAgentId: string;
95
+ metadata: ConversationMetadata | null;
97
96
  ref: {
98
97
  type: "commit" | "tag" | "branch";
99
98
  name: string;
100
99
  hash: string;
101
100
  } | null;
102
- title: string | null;
101
+ userId: string | null;
102
+ activeSubAgentId: string;
103
103
  lastContextResolution: string | null;
104
104
  } | undefined>;
105
105
  declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input: ConversationInsert) => Promise<{
@@ -121,21 +121,21 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  metadata?: ConversationMetadata | null | undefined;
122
122
  contextConfigId?: string | undefined;
123
123
  } | {
124
+ id: string;
124
125
  tenantId: string;
125
126
  projectId: string;
126
127
  agentId: string | null;
127
- id: string;
128
- metadata: ConversationMetadata | null;
128
+ title: string | null;
129
129
  createdAt: string;
130
130
  updatedAt: string;
131
- userId: string | null;
132
- activeSubAgentId: string;
131
+ metadata: ConversationMetadata | null;
133
132
  ref: {
134
133
  type: "commit" | "tag" | "branch";
135
134
  name: string;
136
135
  hash: string;
137
136
  } | null;
138
- title: string | null;
137
+ userId: string | null;
138
+ activeSubAgentId: string;
139
139
  lastContextResolution: string | null;
140
140
  }>;
141
141
  /**
@@ -153,21 +153,21 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  scopes: ProjectScopeConfig;
154
154
  conversationId: string;
155
155
  }) => Promise<{
156
+ id: string;
156
157
  tenantId: string;
157
158
  projectId: string;
158
159
  agentId: string | null;
159
- id: string;
160
- metadata: ConversationMetadata | null;
160
+ title: string | null;
161
161
  createdAt: string;
162
162
  updatedAt: string;
163
- userId: string | null;
164
- activeSubAgentId: string;
163
+ metadata: ConversationMetadata | null;
165
164
  ref: {
166
165
  type: "commit" | "tag" | "branch";
167
166
  name: string;
168
167
  hash: string;
169
168
  } | null;
170
- title: string | null;
169
+ userId: string | null;
170
+ activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
173
173
  /**
@@ -10,14 +10,12 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
+ id: string;
13
14
  tenantId: string;
14
15
  projectId: string;
15
- id: string;
16
- taskId: string | null;
17
- metadata: MessageMetadata | null;
18
- visibility: string;
19
16
  createdAt: string;
20
17
  updatedAt: string;
18
+ metadata: MessageMetadata | null;
21
19
  content: MessageContent;
22
20
  role: string;
23
21
  conversationId: string;
@@ -27,7 +25,9 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
27
25
  toExternalAgentId: string | null;
28
26
  fromTeamAgentId: string | null;
29
27
  toTeamAgentId: string | null;
28
+ visibility: string;
30
29
  messageType: string;
30
+ taskId: string | null;
31
31
  parentMessageId: string | null;
32
32
  a2aTaskId: string | null;
33
33
  a2aSessionId: string | null;
@@ -141,14 +141,12 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
141
141
  id: string;
142
142
  }[]>;
143
143
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
144
+ id: string;
144
145
  tenantId: string;
145
146
  projectId: string;
146
- id: string;
147
- taskId: string | null;
148
- metadata: MessageMetadata | null;
149
- visibility: string;
150
147
  createdAt: string;
151
148
  updatedAt: string;
149
+ metadata: MessageMetadata | null;
152
150
  content: MessageContent;
153
151
  role: string;
154
152
  conversationId: string;
@@ -158,7 +156,9 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageIn
158
156
  toExternalAgentId: string | null;
159
157
  fromTeamAgentId: string | null;
160
158
  toTeamAgentId: string | null;
159
+ visibility: string;
161
160
  messageType: string;
161
+ taskId: string | null;
162
162
  parentMessageId: string | null;
163
163
  a2aTaskId: string | null;
164
164
  a2aSessionId: string | null;
@@ -194,14 +194,12 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
194
194
  scopes: ProjectScopeConfig;
195
195
  messageId: string;
196
196
  }) => Promise<{
197
+ id: string;
197
198
  tenantId: string;
198
199
  projectId: string;
199
- id: string;
200
- taskId: string | null;
201
- metadata: MessageMetadata | null;
202
- visibility: string;
203
200
  createdAt: string;
204
201
  updatedAt: string;
202
+ metadata: MessageMetadata | null;
205
203
  content: MessageContent;
206
204
  role: string;
207
205
  conversationId: string;
@@ -211,7 +209,9 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
211
209
  toExternalAgentId: string | null;
212
210
  fromTeamAgentId: string | null;
213
211
  toTeamAgentId: string | null;
212
+ visibility: string;
214
213
  messageType: string;
214
+ taskId: string | null;
215
215
  parentMessageId: string | null;
216
216
  a2aTaskId: string | null;
217
217
  a2aSessionId: string | null;
@@ -220,5 +220,10 @@ declare const countMessagesByConversation: (db: AgentsRunDatabaseClient) => (par
220
220
  scopes: ProjectScopeConfig;
221
221
  conversationId: string;
222
222
  }) => Promise<number>;
223
+ declare const countVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
224
+ scopes: ProjectScopeConfig;
225
+ conversationId: string;
226
+ visibility?: MessageVisibility[];
227
+ }) => Promise<number>;
223
228
  //#endregion
224
- export { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage };
229
+ export { countMessagesByConversation, countVisibleMessages, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage };
@@ -56,6 +56,11 @@ const countMessagesByConversation = (db) => async (params) => {
56
56
  const total = (await db.select({ count: count() }).from(messages).where(and(projectScopedWhere(messages, params.scopes), eq(messages.conversationId, params.conversationId))))[0]?.count || 0;
57
57
  return typeof total === "string" ? Number.parseInt(total, 10) : total;
58
58
  };
59
+ const countVisibleMessages = (db) => async (params) => {
60
+ const visibilityFilter = params.visibility || ["user-facing"];
61
+ const total = (await db.select({ count: count() }).from(messages).where(and(projectScopedWhere(messages, params.scopes), eq(messages.conversationId, params.conversationId), inArray(messages.visibility, visibilityFilter))))[0]?.count || 0;
62
+ return typeof total === "string" ? Number.parseInt(total, 10) : total;
63
+ };
59
64
 
60
65
  //#endregion
61
- export { countMessagesByConversation, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage };
66
+ export { countMessagesByConversation, countVisibleMessages, createMessage, deleteMessage, getMessageById, getMessagesByConversation, getMessagesByTask, getVisibleMessages, listMessages, updateMessage };
@@ -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;
@@ -7,21 +7,21 @@ import { TaskInsert, TaskSelect } from "../../types/entities.js";
7
7
 
8
8
  //#region src/data-access/runtime/tasks.d.ts
9
9
  declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert) => Promise<{
10
+ id: string;
10
11
  tenantId: string;
11
12
  projectId: string;
12
13
  agentId: string;
13
- subAgentId: string;
14
- id: string;
15
- contextId: string;
16
- metadata: TaskMetadataConfig | null;
17
14
  createdAt: string;
18
15
  updatedAt: string;
16
+ metadata: TaskMetadataConfig | null;
19
17
  ref: {
20
18
  type: "commit" | "tag" | "branch";
21
19
  name: string;
22
20
  hash: string;
23
21
  } | null;
24
22
  status: string;
23
+ subAgentId: string;
24
+ contextId: string;
25
25
  }>;
26
26
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
27
27
  id: string;