@inkeep/agents-core 0.0.0-dev-20260227232900 → 0.0.0-dev-20260228010733

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.
@@ -130,16 +130,20 @@ const discoverToolsFromServer = async (tool, credentialReference, credentialStor
130
130
  });
131
131
  await client.connect();
132
132
  const serverTools = await client.tools();
133
+ const serverInstructions = client.getInstructions()?.replace(/\u0000/g, "");
133
134
  await client.disconnect();
134
135
  const toolOverrides = tool.config.mcp.toolOverrides;
135
- return Object.entries(serverTools).map(([name, toolDef]) => {
136
- const schema = extractInputSchema(toolDef, name, toolOverrides);
137
- return {
138
- name,
139
- description: toolDef.description || "",
140
- inputSchema: schema
141
- };
142
- });
136
+ return {
137
+ tools: Object.entries(serverTools).map(([name, toolDef]) => {
138
+ const schema = extractInputSchema(toolDef, name, toolOverrides);
139
+ return {
140
+ name,
141
+ description: toolDef.description || "",
142
+ inputSchema: schema
143
+ };
144
+ }),
145
+ serverInstructions
146
+ };
143
147
  } catch (error) {
144
148
  logger.error({
145
149
  toolId: tool.id,
@@ -189,6 +193,7 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
189
193
  let lastErrorComputed;
190
194
  let expiresAt;
191
195
  let createdBy;
196
+ let serverInstructions;
192
197
  const credentialReference = credentialReferenceId && dbResult.credentialScope !== "user" ? await getCredentialReference(dbClient)({
193
198
  scopes: {
194
199
  tenantId: dbResult.tenantId,
@@ -209,7 +214,9 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
209
214
  }
210
215
  const mcpServerUrl = dbResult.config.mcp.server.url;
211
216
  try {
212
- availableTools = await discoverToolsFromServer(dbResult, credentialReference, credentialStoreRegistry, userId);
217
+ const discoveryResult = await discoverToolsFromServer(dbResult, credentialReference, credentialStoreRegistry, userId);
218
+ availableTools = discoveryResult.tools;
219
+ serverInstructions = discoveryResult.serverInstructions;
213
220
  status = "healthy";
214
221
  lastErrorComputed = null;
215
222
  } catch (error) {
@@ -235,6 +242,10 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
235
242
  }
236
243
  }
237
244
  const now = (/* @__PURE__ */ new Date()).toISOString();
245
+ const updatedCapabilities = {
246
+ ...capabilities,
247
+ ...serverInstructions !== void 0 && { serverInstructions }
248
+ };
238
249
  try {
239
250
  await updateTool(dbClient)({
240
251
  scopes: {
@@ -244,7 +255,8 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
244
255
  toolId: dbResult.id,
245
256
  data: {
246
257
  updatedAt: now,
247
- lastError: lastErrorComputed
258
+ lastError: lastErrorComputed,
259
+ capabilities: updatedCapabilities
248
260
  }
249
261
  });
250
262
  } catch (updateError) {
@@ -258,7 +270,7 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
258
270
  ...rest,
259
271
  status,
260
272
  availableTools,
261
- capabilities: capabilities || void 0,
273
+ capabilities: Object.keys(updatedCapabilities).length > 0 ? updatedCapabilities : void 0,
262
274
  credentialReferenceId: credentialReferenceId || void 0,
263
275
  createdAt: toISODateString(createdAt),
264
276
  createdBy: createdBy || void 0,
@@ -46,7 +46,7 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
46
46
  regex?: string | undefined;
47
47
  };
48
48
  signedComponents: {
49
- source: "header" | "literal" | "body";
49
+ source: "literal" | "header" | "body";
50
50
  required: boolean;
51
51
  key?: string | undefined;
52
52
  value?: string | undefined;
@@ -8,49 +8,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- name: string | null;
12
- tenantId: string;
13
- projectId: string;
14
- agentId: string;
15
11
  id: string;
12
+ name: string | null;
16
13
  createdAt: string;
17
14
  updatedAt: string;
18
15
  expiresAt: string | null;
16
+ tenantId: string;
17
+ lastUsedAt: string | null;
18
+ projectId: string;
19
+ agentId: string;
19
20
  publicId: string;
20
21
  keyHash: string;
21
22
  keyPrefix: string;
22
- lastUsedAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- name: string | null;
26
- tenantId: string;
27
- projectId: string;
28
- agentId: string;
29
25
  id: string;
26
+ name: string | null;
30
27
  createdAt: string;
31
28
  updatedAt: string;
32
29
  expiresAt: string | null;
30
+ tenantId: string;
31
+ lastUsedAt: string | null;
32
+ projectId: string;
33
+ agentId: string;
33
34
  publicId: string;
34
35
  keyHash: string;
35
36
  keyPrefix: string;
36
- lastUsedAt: string | null;
37
37
  } | undefined>;
38
38
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
- name: string | null;
43
- tenantId: string;
44
- projectId: string;
45
- agentId: string;
46
42
  id: string;
43
+ name: string | null;
47
44
  createdAt: string;
48
45
  updatedAt: string;
49
46
  expiresAt: string | null;
47
+ tenantId: string;
48
+ lastUsedAt: string | null;
49
+ projectId: string;
50
+ agentId: string;
50
51
  publicId: string;
51
52
  keyHash: string;
52
53
  keyPrefix: string;
53
- lastUsedAt: string | null;
54
54
  }[]>;
55
55
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
56
56
  scopes: ProjectScopeConfig;
@@ -66,18 +66,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  };
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
- name: string | null;
70
- tenantId: string;
71
- projectId: string;
72
- agentId: string;
73
69
  id: string;
70
+ name: string | null;
74
71
  createdAt: string;
75
72
  updatedAt: string;
76
73
  expiresAt: string | null;
74
+ tenantId: string;
75
+ lastUsedAt: string | null;
76
+ projectId: string;
77
+ agentId: string;
77
78
  publicId: string;
78
79
  keyHash: string;
79
80
  keyPrefix: string;
80
- lastUsedAt: string | null;
81
81
  }>;
82
82
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
83
83
  scopes: ProjectScopeConfig;
@@ -16,10 +16,6 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
16
16
  total: number;
17
17
  }>;
18
18
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
19
- title: string | null;
20
- tenantId: string;
21
- projectId: string;
22
- agentId: string | null;
23
19
  id: string;
24
20
  createdAt: string;
25
21
  updatedAt: string;
@@ -30,6 +26,10 @@ declare const createConversation: (db: AgentsRunDatabaseClient) => (params: Conv
30
26
  } | null;
31
27
  userId: string | null;
32
28
  metadata: ConversationMetadata | null;
29
+ tenantId: string;
30
+ projectId: string;
31
+ agentId: string | null;
32
+ title: string | null;
33
33
  activeSubAgentId: string;
34
34
  lastContextResolution: string | null;
35
35
  }>;
@@ -85,10 +85,6 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
85
85
  scopes: ProjectScopeConfig;
86
86
  conversationId: string;
87
87
  }) => Promise<{
88
- title: string | null;
89
- tenantId: string;
90
- projectId: string;
91
- agentId: string | null;
92
88
  id: string;
93
89
  createdAt: string;
94
90
  updatedAt: string;
@@ -99,6 +95,10 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
99
95
  } | null;
100
96
  userId: string | null;
101
97
  metadata: ConversationMetadata | null;
98
+ tenantId: string;
99
+ projectId: string;
100
+ agentId: string | null;
101
+ title: string | null;
102
102
  activeSubAgentId: string;
103
103
  lastContextResolution: string | null;
104
104
  } | undefined>;
@@ -121,10 +121,6 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
121
121
  metadata?: ConversationMetadata | null | undefined;
122
122
  contextConfigId?: string | undefined;
123
123
  } | {
124
- title: string | null;
125
- tenantId: string;
126
- projectId: string;
127
- agentId: string | null;
128
124
  id: string;
129
125
  createdAt: string;
130
126
  updatedAt: string;
@@ -135,6 +131,10 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
135
131
  } | null;
136
132
  userId: string | null;
137
133
  metadata: ConversationMetadata | null;
134
+ tenantId: string;
135
+ projectId: string;
136
+ agentId: string | null;
137
+ title: string | null;
138
138
  activeSubAgentId: string;
139
139
  lastContextResolution: string | null;
140
140
  }>;
@@ -153,10 +153,6 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
153
153
  scopes: ProjectScopeConfig;
154
154
  conversationId: string;
155
155
  }) => Promise<{
156
- title: string | null;
157
- tenantId: string;
158
- projectId: string;
159
- agentId: string | null;
160
156
  id: string;
161
157
  createdAt: string;
162
158
  updatedAt: string;
@@ -167,6 +163,10 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
167
163
  } | null;
168
164
  userId: string | null;
169
165
  metadata: ConversationMetadata | null;
166
+ tenantId: string;
167
+ projectId: string;
168
+ agentId: string | null;
169
+ title: string | null;
170
170
  activeSubAgentId: string;
171
171
  lastContextResolution: string | null;
172
172
  } | undefined>;
@@ -10,13 +10,14 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
10
10
  scopes: ProjectScopeConfig;
11
11
  messageId: string;
12
12
  }) => Promise<{
13
- tenantId: string;
14
- projectId: string;
15
13
  id: string;
16
14
  createdAt: string;
17
15
  updatedAt: string;
18
16
  metadata: MessageMetadata | null;
19
17
  role: string;
18
+ tenantId: string;
19
+ projectId: string;
20
+ content: MessageContent;
20
21
  conversationId: string;
21
22
  fromSubAgentId: string | null;
22
23
  toSubAgentId: string | null;
@@ -24,7 +25,6 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
24
25
  toExternalAgentId: string | null;
25
26
  fromTeamAgentId: string | null;
26
27
  toTeamAgentId: string | null;
27
- content: MessageContent;
28
28
  visibility: string;
29
29
  messageType: string;
30
30
  taskId: string | null;
@@ -141,13 +141,14 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
141
141
  id: string;
142
142
  }[]>;
143
143
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
144
- tenantId: string;
145
- projectId: string;
146
144
  id: string;
147
145
  createdAt: string;
148
146
  updatedAt: string;
149
147
  metadata: MessageMetadata | null;
150
148
  role: string;
149
+ tenantId: string;
150
+ projectId: string;
151
+ content: MessageContent;
151
152
  conversationId: string;
152
153
  fromSubAgentId: string | null;
153
154
  toSubAgentId: string | null;
@@ -155,7 +156,6 @@ declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageIn
155
156
  toExternalAgentId: string | null;
156
157
  fromTeamAgentId: string | null;
157
158
  toTeamAgentId: string | null;
158
- content: MessageContent;
159
159
  visibility: string;
160
160
  messageType: string;
161
161
  taskId: string | null;
@@ -194,13 +194,14 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
194
194
  scopes: ProjectScopeConfig;
195
195
  messageId: string;
196
196
  }) => Promise<{
197
- tenantId: string;
198
- projectId: string;
199
197
  id: string;
200
198
  createdAt: string;
201
199
  updatedAt: string;
202
200
  metadata: MessageMetadata | null;
203
201
  role: string;
202
+ tenantId: string;
203
+ projectId: string;
204
+ content: MessageContent;
204
205
  conversationId: string;
205
206
  fromSubAgentId: string | null;
206
207
  toSubAgentId: string | null;
@@ -208,7 +209,6 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
208
209
  toExternalAgentId: string | null;
209
210
  fromTeamAgentId: string | null;
210
211
  toTeamAgentId: string | null;
211
- content: MessageContent;
212
212
  visibility: string;
213
213
  messageType: string;
214
214
  taskId: string | null;
@@ -6,10 +6,6 @@ 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
- tenantId: string;
10
- projectId: string;
11
- agentId: string;
12
- subAgentId: string;
13
9
  id: string;
14
10
  createdAt: string;
15
11
  updatedAt: string;
@@ -20,6 +16,10 @@ declare const createTask: (db: AgentsRunDatabaseClient) => (params: TaskInsert)
20
16
  } | null;
21
17
  metadata: TaskMetadataConfig | null;
22
18
  status: string;
19
+ tenantId: string;
20
+ projectId: string;
21
+ agentId: string;
22
+ subAgentId: string;
23
23
  contextId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {