@inkeep/agents-core 0.0.0-dev-20260227232555 → 0.0.0-dev-20260227235547

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 (53) hide show
  1. package/dist/auth/auth-schema.d.ts +107 -107
  2. package/dist/auth/auth-validation-schemas.d.ts +152 -152
  3. package/dist/auth/auth.d.ts +28 -28
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/client-exports.d.ts +5 -5
  6. package/dist/client-exports.js +2 -2
  7. package/dist/data-access/index.d.ts +2 -2
  8. package/dist/data-access/index.js +3 -3
  9. package/dist/data-access/manage/agents.d.ts +47 -47
  10. package/dist/data-access/manage/agents.js +19 -1
  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 +18 -18
  15. package/dist/data-access/manage/skills.d.ts +14 -14
  16. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  17. package/dist/data-access/manage/subAgentRelations.d.ts +28 -28
  18. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +24 -24
  19. package/dist/data-access/manage/subAgents.d.ts +21 -21
  20. package/dist/data-access/manage/tools.d.ts +24 -24
  21. package/dist/data-access/manage/tools.js +24 -12
  22. package/dist/data-access/runtime/apiKeys.d.ts +20 -20
  23. package/dist/data-access/runtime/cascade-delete.d.ts +2 -0
  24. package/dist/data-access/runtime/cascade-delete.js +19 -4
  25. package/dist/data-access/runtime/conversations.d.ts +24 -24
  26. package/dist/data-access/runtime/messages.d.ts +18 -18
  27. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +3 -3
  28. package/dist/data-access/runtime/tasks.d.ts +7 -7
  29. package/dist/data-access/runtime/workAppSlack.d.ts +8 -2
  30. package/dist/data-access/runtime/workAppSlack.js +63 -2
  31. package/dist/db/manage/manage-schema.d.ts +447 -447
  32. package/dist/db/runtime/runtime-schema.d.ts +346 -310
  33. package/dist/db/runtime/runtime-schema.js +12 -4
  34. package/dist/index.d.ts +3 -3
  35. package/dist/index.js +4 -4
  36. package/dist/middleware/no-auth.d.ts +2 -2
  37. package/dist/types/utility.d.ts +1 -0
  38. package/dist/utils/error.d.ts +51 -51
  39. package/dist/utils/mcp-client.d.ts +1 -0
  40. package/dist/utils/mcp-client.js +3 -0
  41. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  42. package/dist/validation/index.d.ts +2 -2
  43. package/dist/validation/index.js +2 -2
  44. package/dist/validation/schemas.d.ts +2931 -1843
  45. package/dist/validation/schemas.js +12 -2
  46. package/drizzle/runtime/0016_white_eddie_brock.sql +1 -0
  47. package/drizzle/runtime/0017_remarkable_starfox.sql +3 -0
  48. package/drizzle/runtime/0018_orange_union_jack.sql +6 -0
  49. package/drizzle/runtime/meta/0016_snapshot.json +3766 -0
  50. package/drizzle/runtime/meta/0017_snapshot.json +3785 -0
  51. package/drizzle/runtime/meta/0018_snapshot.json +3929 -0
  52. package/drizzle/runtime/meta/_journal.json +21 -0
  53. package/package.json +1 -1
@@ -9,15 +9,15 @@ declare const getSubAgentExternalAgentRelationById: (db: AgentsManageDatabaseCli
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- agentId: string;
14
- projectId: string;
15
12
  id: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
18
- subAgentId: string;
15
+ tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
19
18
  headers: Record<string, string> | null;
20
19
  externalAgentId: string;
20
+ subAgentId: string;
21
21
  } | undefined>;
22
22
  declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
23
23
  scopes: SubAgentScopeConfig;
@@ -44,28 +44,28 @@ declare const listSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClien
44
44
  declare const getSubAgentExternalAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- agentId: string;
49
- projectId: string;
50
47
  id: string;
51
48
  createdAt: string;
52
49
  updatedAt: string;
53
- subAgentId: string;
50
+ tenantId: string;
51
+ projectId: string;
52
+ agentId: string;
54
53
  headers: Record<string, string> | null;
55
54
  externalAgentId: string;
55
+ subAgentId: string;
56
56
  }[]>;
57
57
  declare const getSubAgentExternalAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- agentId: string;
62
- projectId: string;
63
60
  id: string;
64
61
  createdAt: string;
65
62
  updatedAt: string;
66
- subAgentId: string;
63
+ tenantId: string;
64
+ projectId: string;
65
+ agentId: string;
67
66
  headers: Record<string, string> | null;
68
67
  externalAgentId: string;
68
+ subAgentId: string;
69
69
  }[]>;
70
70
  declare const getSubAgentExternalAgentRelationsByExternalAgent: (db: AgentsManageDatabaseClient) => (params: {
71
71
  scopes: AgentScopeConfig;
@@ -180,15 +180,15 @@ declare const createSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
180
180
  headers?: Record<string, string> | null;
181
181
  };
182
182
  }) => Promise<{
183
- tenantId: string;
184
- agentId: string;
185
- projectId: string;
186
183
  id: string;
187
184
  createdAt: string;
188
185
  updatedAt: string;
189
- subAgentId: string;
186
+ tenantId: string;
187
+ projectId: string;
188
+ agentId: string;
190
189
  headers: Record<string, string> | null;
191
190
  externalAgentId: string;
191
+ subAgentId: string;
192
192
  }>;
193
193
  /**
194
194
  * Check if sub-agent external agent relation exists by params
@@ -197,15 +197,15 @@ declare const getSubAgentExternalAgentRelationByParams: (db: AgentsManageDatabas
197
197
  scopes: SubAgentScopeConfig;
198
198
  externalAgentId: string;
199
199
  }) => Promise<{
200
- tenantId: string;
201
- agentId: string;
202
- projectId: string;
203
200
  id: string;
204
201
  createdAt: string;
205
202
  updatedAt: string;
206
- subAgentId: string;
203
+ tenantId: string;
204
+ projectId: string;
205
+ agentId: string;
207
206
  headers: Record<string, string> | null;
208
207
  externalAgentId: string;
208
+ subAgentId: string;
209
209
  } | undefined>;
210
210
  /**
211
211
  * Upsert sub-agent external agent relation (create if it doesn't exist, update if it does)
@@ -218,15 +218,15 @@ declare const upsertSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClie
218
218
  headers?: Record<string, string> | null;
219
219
  };
220
220
  }) => Promise<{
221
- tenantId: string;
222
- agentId: string;
223
- projectId: string;
224
221
  id: string;
225
222
  createdAt: string;
226
223
  updatedAt: string;
227
- subAgentId: string;
224
+ tenantId: string;
225
+ projectId: string;
226
+ agentId: string;
228
227
  headers: Record<string, string> | null;
229
228
  externalAgentId: string;
229
+ subAgentId: string;
230
230
  }>;
231
231
  declare const updateSubAgentExternalAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
232
232
  scopes: SubAgentScopeConfig;
@@ -9,12 +9,12 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
9
9
  scopes: AgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- agentId: string;
14
- projectId: string;
15
12
  id: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
15
+ tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
18
18
  sourceSubAgentId: string;
19
19
  targetSubAgentId: string | null;
20
20
  relationType: string | null;
@@ -44,12 +44,12 @@ declare const listAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
44
44
  declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- agentId: string;
49
- projectId: string;
50
47
  id: string;
51
48
  createdAt: string;
52
49
  updatedAt: string;
50
+ tenantId: string;
51
+ projectId: string;
52
+ agentId: string;
53
53
  sourceSubAgentId: string;
54
54
  targetSubAgentId: string | null;
55
55
  relationType: string | null;
@@ -57,12 +57,12 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
57
57
  declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- agentId: string;
62
- projectId: string;
63
60
  id: string;
64
61
  createdAt: string;
65
62
  updatedAt: string;
63
+ tenantId: string;
64
+ projectId: string;
65
+ agentId: string;
66
66
  sourceSubAgentId: string;
67
67
  targetSubAgentId: string | null;
68
68
  relationType: string | null;
@@ -126,12 +126,12 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
126
126
  }[];
127
127
  }>;
128
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
129
- tenantId: string;
130
- agentId: string;
131
- projectId: string;
132
129
  id: string;
133
130
  createdAt: string;
134
131
  updatedAt: string;
132
+ tenantId: string;
133
+ projectId: string;
134
+ agentId: string;
135
135
  sourceSubAgentId: string;
136
136
  targetSubAgentId: string | null;
137
137
  relationType: string | null;
@@ -145,12 +145,12 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
145
145
  targetSubAgentId?: string;
146
146
  relationType: string;
147
147
  }) => Promise<{
148
- tenantId: string;
149
- agentId: string;
150
- projectId: string;
151
148
  id: string;
152
149
  createdAt: string;
153
150
  updatedAt: string;
151
+ tenantId: string;
152
+ projectId: string;
153
+ agentId: string;
154
154
  sourceSubAgentId: string;
155
155
  targetSubAgentId: string | null;
156
156
  relationType: string | null;
@@ -159,12 +159,12 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
159
159
  * Upsert agent relation (create if it doesn't exist, no-op if it does)
160
160
  */
161
161
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
162
- tenantId: string;
163
- agentId: string;
164
- projectId: string;
165
162
  id: string;
166
163
  createdAt: string;
167
164
  updatedAt: string;
165
+ tenantId: string;
166
+ projectId: string;
167
+ agentId: string;
168
168
  sourceSubAgentId: string;
169
169
  targetSubAgentId: string | null;
170
170
  relationType: string | null;
@@ -204,18 +204,18 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
204
204
  }> | null;
205
205
  };
206
206
  }) => Promise<{
207
- tenantId: string;
208
- agentId: string;
209
- projectId: string;
210
207
  id: string;
211
208
  createdAt: string;
212
209
  updatedAt: string;
213
- subAgentId: string;
214
- headers: Record<string, string> | null;
210
+ tenantId: string;
211
+ projectId: string;
212
+ agentId: string;
215
213
  toolId: string;
214
+ headers: Record<string, string> | null;
216
215
  toolPolicies: Record<string, {
217
216
  needsApproval?: boolean;
218
217
  }> | null;
218
+ subAgentId: string;
219
219
  selectedTools: string[] | null;
220
220
  }>;
221
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -248,18 +248,18 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
248
248
  scopes: SubAgentScopeConfig;
249
249
  relationId: string;
250
250
  }) => Promise<{
251
- tenantId: string;
252
- agentId: string;
253
- projectId: string;
254
251
  id: string;
255
252
  createdAt: string;
256
253
  updatedAt: string;
257
- subAgentId: string;
258
- headers: Record<string, string> | null;
254
+ tenantId: string;
255
+ projectId: string;
256
+ agentId: string;
259
257
  toolId: string;
258
+ headers: Record<string, string> | null;
260
259
  toolPolicies: Record<string, {
261
260
  needsApproval?: boolean;
262
261
  }> | null;
262
+ subAgentId: string;
263
263
  selectedTools: string[] | null;
264
264
  } | undefined>;
265
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -9,14 +9,14 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- agentId: string;
14
- projectId: string;
15
12
  id: string;
16
13
  createdAt: string;
17
14
  updatedAt: string;
18
- subAgentId: string;
15
+ tenantId: string;
16
+ projectId: string;
17
+ agentId: string;
19
18
  headers: Record<string, string> | null;
19
+ subAgentId: string;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
22
22
  declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
@@ -44,27 +44,27 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
44
44
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
- tenantId: string;
48
- agentId: string;
49
- projectId: string;
50
47
  id: string;
51
48
  createdAt: string;
52
49
  updatedAt: string;
53
- subAgentId: string;
50
+ tenantId: string;
51
+ projectId: string;
52
+ agentId: string;
54
53
  headers: Record<string, string> | null;
54
+ subAgentId: string;
55
55
  targetAgentId: string;
56
56
  }[]>;
57
57
  declare const getSubAgentTeamAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (params: {
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
- tenantId: string;
61
- agentId: string;
62
- projectId: string;
63
60
  id: string;
64
61
  createdAt: string;
65
62
  updatedAt: string;
66
- subAgentId: string;
63
+ tenantId: string;
64
+ projectId: string;
65
+ agentId: string;
67
66
  headers: Record<string, string> | null;
67
+ subAgentId: string;
68
68
  targetAgentId: string;
69
69
  }[]>;
70
70
  declare const getSubAgentTeamAgentRelationsByTeamAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -210,14 +210,14 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
210
210
  headers?: Record<string, string> | null;
211
211
  };
212
212
  }) => Promise<{
213
- tenantId: string;
214
- agentId: string;
215
- projectId: string;
216
213
  id: string;
217
214
  createdAt: string;
218
215
  updatedAt: string;
219
- subAgentId: string;
216
+ tenantId: string;
217
+ projectId: string;
218
+ agentId: string;
220
219
  headers: Record<string, string> | null;
220
+ subAgentId: string;
221
221
  targetAgentId: string;
222
222
  }>;
223
223
  /**
@@ -227,14 +227,14 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
227
227
  scopes: SubAgentScopeConfig;
228
228
  targetAgentId: string;
229
229
  }) => Promise<{
230
- tenantId: string;
231
- agentId: string;
232
- projectId: string;
233
230
  id: string;
234
231
  createdAt: string;
235
232
  updatedAt: string;
236
- subAgentId: string;
233
+ tenantId: string;
234
+ projectId: string;
235
+ agentId: string;
237
236
  headers: Record<string, string> | null;
237
+ subAgentId: string;
238
238
  targetAgentId: string;
239
239
  } | undefined>;
240
240
  /**
@@ -248,14 +248,14 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
248
248
  headers?: Record<string, string> | null;
249
249
  };
250
250
  }) => Promise<{
251
- tenantId: string;
252
- agentId: string;
253
- projectId: string;
254
251
  id: string;
255
252
  createdAt: string;
256
253
  updatedAt: string;
257
- subAgentId: string;
254
+ tenantId: string;
255
+ projectId: string;
256
+ agentId: string;
258
257
  headers: Record<string, string> | null;
258
+ subAgentId: string;
259
259
  targetAgentId: string;
260
260
  }>;
261
261
  declare const updateSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient) => (params: {
@@ -9,12 +9,14 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
9
9
  scopes: AgentScopeConfig;
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
- tenantId: string;
13
- description: string | null;
14
- agentId: string;
15
- projectId: string;
16
12
  id: string;
17
13
  name: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ tenantId: string;
17
+ projectId: string;
18
+ agentId: string;
19
+ description: string | null;
18
20
  models: {
19
21
  base?: {
20
22
  model?: string | undefined;
@@ -29,23 +31,23 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
29
31
  providerOptions?: Record<string, any> | undefined;
30
32
  } | undefined;
31
33
  } | null;
34
+ prompt: string | null;
32
35
  stopWhen: {
33
36
  stepCountIs?: number | undefined;
34
37
  } | null;
35
- createdAt: string;
36
- updatedAt: string;
37
- prompt: string | null;
38
38
  conversationHistoryConfig: ConversationHistoryConfig | null;
39
39
  } | undefined>;
40
40
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
41
41
  scopes: AgentScopeConfig;
42
42
  }) => Promise<{
43
- tenantId: string;
44
- description: string | null;
45
- agentId: string;
46
- projectId: string;
47
43
  id: string;
48
44
  name: string;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ tenantId: string;
48
+ projectId: string;
49
+ agentId: string;
50
+ description: string | null;
49
51
  models: {
50
52
  base?: {
51
53
  model?: string | undefined;
@@ -60,12 +62,10 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
60
62
  providerOptions?: Record<string, any> | undefined;
61
63
  } | undefined;
62
64
  } | null;
65
+ prompt: string | null;
63
66
  stopWhen: {
64
67
  stepCountIs?: number | undefined;
65
68
  } | null;
66
- createdAt: string;
67
- updatedAt: string;
68
- prompt: string | null;
69
69
  conversationHistoryConfig: ConversationHistoryConfig | null;
70
70
  }[]>;
71
71
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
@@ -109,12 +109,14 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
109
109
  };
110
110
  }>;
111
111
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
112
- tenantId: string;
113
- description: string | null;
114
- agentId: string;
115
- projectId: string;
116
112
  id: string;
117
113
  name: string;
114
+ createdAt: string;
115
+ updatedAt: string;
116
+ tenantId: string;
117
+ projectId: string;
118
+ agentId: string;
119
+ description: string | null;
118
120
  models: {
119
121
  base?: {
120
122
  model?: string | undefined;
@@ -129,12 +131,10 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
129
131
  providerOptions?: Record<string, any> | undefined;
130
132
  } | undefined;
131
133
  } | null;
134
+ prompt: string | null;
132
135
  stopWhen: {
133
136
  stepCountIs?: number | undefined;
134
137
  } | null;
135
- createdAt: string;
136
- updatedAt: string;
137
- prompt: string | null;
138
138
  conversationHistoryConfig: ConversationHistoryConfig | null;
139
139
  }>;
140
140
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -19,13 +19,13 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
19
19
  scopes: ProjectScopeConfig;
20
20
  toolId: string;
21
21
  }) => Promise<{
22
- tenantId: string;
23
- description: string | null;
24
- projectId: string;
25
22
  id: string;
26
23
  name: string;
27
24
  createdAt: string;
28
25
  updatedAt: string;
26
+ tenantId: string;
27
+ projectId: string;
28
+ description: string | null;
29
29
  headers: Record<string, string> | null;
30
30
  config: {
31
31
  type: "mcp";
@@ -77,13 +77,13 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
77
77
  };
78
78
  }>;
79
79
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
80
- tenantId: string;
81
- description: string | null;
82
- projectId: string;
83
80
  id: string;
84
81
  name: string;
85
82
  createdAt: string;
86
83
  updatedAt: string;
84
+ tenantId: string;
85
+ projectId: string;
86
+ description: string | null;
87
87
  headers: Record<string, string> | null;
88
88
  config: {
89
89
  type: "mcp";
@@ -134,18 +134,18 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
134
134
  needsApproval?: boolean;
135
135
  }> | null;
136
136
  }) => Promise<{
137
- tenantId: string;
138
- agentId: string;
139
- projectId: string;
140
137
  id: string;
141
138
  createdAt: string;
142
139
  updatedAt: string;
143
- subAgentId: string;
144
- headers: Record<string, string> | null;
140
+ tenantId: string;
141
+ projectId: string;
142
+ agentId: string;
145
143
  toolId: string;
144
+ headers: Record<string, string> | null;
146
145
  toolPolicies: Record<string, {
147
146
  needsApproval?: boolean;
148
147
  }> | null;
148
+ subAgentId: string;
149
149
  selectedTools: string[] | null;
150
150
  }>;
151
151
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
@@ -153,18 +153,18 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
153
153
  subAgentId: string;
154
154
  toolId: string;
155
155
  }) => Promise<{
156
- tenantId: string;
157
- agentId: string;
158
- projectId: string;
159
156
  id: string;
160
157
  createdAt: string;
161
158
  updatedAt: string;
162
- subAgentId: string;
163
- headers: Record<string, string> | null;
159
+ tenantId: string;
160
+ projectId: string;
161
+ agentId: string;
164
162
  toolId: string;
163
+ headers: Record<string, string> | null;
165
164
  toolPolicies: Record<string, {
166
165
  needsApproval?: boolean;
167
166
  }> | null;
167
+ subAgentId: string;
168
168
  selectedTools: string[] | null;
169
169
  }>;
170
170
  /**
@@ -181,18 +181,18 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
181
181
  }> | null;
182
182
  relationId?: string;
183
183
  }) => Promise<{
184
- tenantId: string;
185
- agentId: string;
186
- projectId: string;
187
184
  id: string;
188
185
  createdAt: string;
189
186
  updatedAt: string;
190
- subAgentId: string;
191
- headers: Record<string, string> | null;
187
+ tenantId: string;
188
+ projectId: string;
189
+ agentId: string;
192
190
  toolId: string;
191
+ headers: Record<string, string> | null;
193
192
  toolPolicies: Record<string, {
194
193
  needsApproval?: boolean;
195
194
  }> | null;
195
+ subAgentId: string;
196
196
  selectedTools: string[] | null;
197
197
  }>;
198
198
  /**
@@ -201,13 +201,13 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
201
201
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
202
202
  data: ToolInsert;
203
203
  }) => Promise<{
204
- tenantId: string;
205
- description: string | null;
206
- projectId: string;
207
204
  id: string;
208
205
  name: string;
209
206
  createdAt: string;
210
207
  updatedAt: string;
208
+ tenantId: string;
209
+ projectId: string;
210
+ description: string | null;
211
211
  headers: Record<string, string> | null;
212
212
  config: {
213
213
  type: "mcp";
@@ -9,13 +9,13 @@ import "../../credential-stuffer/index.js";
9
9
  import { createAgentsRunDatabaseClient } from "../../db/runtime/runtime-client.js";
10
10
  import { generateId } from "../../utils/conversations.js";
11
11
  import { getActiveBranch } from "../../dolt/schema-sync.js";
12
+ import { cascadeDeleteByTool } from "../runtime/cascade-delete.js";
12
13
  import { updateAgentToolRelation } from "./subAgentRelations.js";
13
14
  import { toISODateString } from "../../utils/date.js";
14
15
  import { McpClient } from "../../utils/mcp-client.js";
15
16
  import { configureComposioMCPServer } from "../../utils/third-party-mcp-servers/composio-client.js";
16
17
  import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-servers/third-party-check.js";
17
18
  import "../../utils/index.js";
18
- import { cascadeDeleteByTool } from "../runtime/cascade-delete.js";
19
19
  import { isGithubWorkAppTool } from "../runtime/github-work-app-installations.js";
20
20
  import { getCredentialReference, getUserScopedCredentialReference } from "./credentialReferences.js";
21
21
  import { and, count, desc, eq } from "drizzle-orm";
@@ -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,