@inkeep/agents-core 0.59.0 → 0.59.1

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 (55) hide show
  1. package/dist/auth/auth-schema.d.ts +86 -86
  2. package/dist/auth/auth-validation-schemas.d.ts +154 -154
  3. package/dist/client-exports.d.ts +2 -2
  4. package/dist/client-exports.js +2 -2
  5. package/dist/constants/{allowed-image-formats.d.ts → allowed-file-formats.d.ts} +4 -3
  6. package/dist/constants/{allowed-image-formats.js → allowed-file-formats.js} +13 -10
  7. package/dist/credential-stores/composio-store.d.ts +28 -0
  8. package/dist/credential-stores/composio-store.js +53 -0
  9. package/dist/credential-stores/default-constants.d.ts +2 -1
  10. package/dist/credential-stores/default-constants.js +2 -1
  11. package/dist/credential-stores/defaults.js +3 -1
  12. package/dist/credential-stores/index.d.ts +3 -2
  13. package/dist/credential-stores/index.js +3 -2
  14. package/dist/data-access/index.d.ts +2 -2
  15. package/dist/data-access/index.js +2 -2
  16. package/dist/data-access/manage/agents.d.ts +30 -30
  17. package/dist/data-access/manage/artifactComponents.d.ts +10 -10
  18. package/dist/data-access/manage/contextConfigs.d.ts +8 -8
  19. package/dist/data-access/manage/dataComponents.d.ts +2 -2
  20. package/dist/data-access/manage/functionTools.d.ts +14 -14
  21. package/dist/data-access/manage/skills.d.ts +19 -19
  22. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +24 -24
  23. package/dist/data-access/manage/subAgentRelations.d.ts +22 -22
  24. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +18 -18
  25. package/dist/data-access/manage/subAgents.d.ts +18 -18
  26. package/dist/data-access/manage/tools.d.ts +30 -30
  27. package/dist/data-access/manage/tools.js +17 -5
  28. package/dist/data-access/manage/triggers.d.ts +1 -1
  29. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  30. package/dist/data-access/runtime/apps.d.ts +12 -12
  31. package/dist/data-access/runtime/conversations.d.ts +24 -24
  32. package/dist/data-access/runtime/messages.d.ts +21 -21
  33. package/dist/data-access/runtime/scheduledTriggerInvocations.d.ts +10 -1
  34. package/dist/data-access/runtime/scheduledTriggerInvocations.js +13 -1
  35. package/dist/data-access/runtime/tasks.d.ts +6 -6
  36. package/dist/db/manage/manage-schema.d.ts +359 -359
  37. package/dist/db/runtime/runtime-schema.d.ts +298 -298
  38. package/dist/index.d.ts +5 -4
  39. package/dist/index.js +6 -5
  40. package/dist/middleware/no-auth.d.ts +2 -2
  41. package/dist/types/utility.d.ts +1 -0
  42. package/dist/types/utility.js +2 -1
  43. package/dist/utils/credential-store-utils.js +1 -0
  44. package/dist/utils/index.d.ts +2 -2
  45. package/dist/utils/index.js +4 -4
  46. package/dist/utils/third-party-mcp-servers/composio-client.d.ts +20 -4
  47. package/dist/utils/third-party-mcp-servers/composio-client.js +51 -25
  48. package/dist/utils/third-party-mcp-servers/index.d.ts +2 -2
  49. package/dist/utils/third-party-mcp-servers/index.js +2 -2
  50. package/dist/utils/third-party-mcp-servers/third-party-check.d.ts +3 -4
  51. package/dist/utils/third-party-mcp-servers/third-party-check.js +1 -2
  52. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  53. package/dist/validation/schemas.d.ts +2037 -2016
  54. package/dist/validation/schemas.js +3 -1
  55. package/package.json +4 -4
@@ -10,11 +10,11 @@ declare const getAgentRelationById: (db: AgentsManageDatabaseClient) => (params:
10
10
  relationId: string;
11
11
  }) => Promise<{
12
12
  id: string;
13
+ createdAt: string;
14
+ updatedAt: string;
13
15
  tenantId: string;
14
16
  projectId: string;
15
17
  agentId: string;
16
- createdAt: string;
17
- updatedAt: string;
18
18
  sourceSubAgentId: string;
19
19
  targetSubAgentId: string | null;
20
20
  relationType: string | null;
@@ -45,11 +45,11 @@ declare const getAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
47
  id: string;
48
+ createdAt: string;
49
+ updatedAt: string;
48
50
  tenantId: string;
49
51
  projectId: string;
50
52
  agentId: string;
51
- createdAt: string;
52
- updatedAt: string;
53
53
  sourceSubAgentId: string;
54
54
  targetSubAgentId: string | null;
55
55
  relationType: string | null;
@@ -58,11 +58,11 @@ declare const getAgentRelationsByAgent: (db: AgentsManageDatabaseClient) => (par
58
58
  scopes: AgentScopeConfig;
59
59
  }) => Promise<{
60
60
  id: string;
61
+ createdAt: string;
62
+ updatedAt: string;
61
63
  tenantId: string;
62
64
  projectId: string;
63
65
  agentId: string;
64
- createdAt: string;
65
- updatedAt: string;
66
66
  sourceSubAgentId: string;
67
67
  targetSubAgentId: string | null;
68
68
  relationType: string | null;
@@ -127,11 +127,11 @@ declare const getRelatedAgentsForAgent: (db: AgentsManageDatabaseClient) => (par
127
127
  }>;
128
128
  declare const createSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
129
129
  id: string;
130
+ createdAt: string;
131
+ updatedAt: string;
130
132
  tenantId: string;
131
133
  projectId: string;
132
134
  agentId: string;
133
- createdAt: string;
134
- updatedAt: string;
135
135
  sourceSubAgentId: string;
136
136
  targetSubAgentId: string | null;
137
137
  relationType: string | null;
@@ -146,11 +146,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
146
146
  relationType: string;
147
147
  }) => Promise<{
148
148
  id: string;
149
+ createdAt: string;
150
+ updatedAt: string;
149
151
  tenantId: string;
150
152
  projectId: string;
151
153
  agentId: string;
152
- createdAt: string;
153
- updatedAt: string;
154
154
  sourceSubAgentId: string;
155
155
  targetSubAgentId: string | null;
156
156
  relationType: string | null;
@@ -160,11 +160,11 @@ declare const getAgentRelationByParams: (db: AgentsManageDatabaseClient) => (par
160
160
  */
161
161
  declare const upsertSubAgentRelation: (db: AgentsManageDatabaseClient) => (params: SubAgentRelationInsert) => Promise<{
162
162
  id: string;
163
+ createdAt: string;
164
+ updatedAt: string;
163
165
  tenantId: string;
164
166
  projectId: string;
165
167
  agentId: string;
166
- createdAt: string;
167
- updatedAt: string;
168
168
  sourceSubAgentId: string;
169
169
  targetSubAgentId: string | null;
170
170
  relationType: string | null;
@@ -204,19 +204,19 @@ declare const createAgentToolRelation: (db: AgentsManageDatabaseClient) => (para
204
204
  }> | null;
205
205
  };
206
206
  }) => Promise<{
207
+ headers: Record<string, string> | null;
207
208
  id: string;
209
+ createdAt: string;
210
+ updatedAt: string;
208
211
  tenantId: string;
209
212
  projectId: string;
210
213
  agentId: string;
211
- createdAt: string;
212
- updatedAt: string;
214
+ subAgentId: string;
213
215
  toolId: string;
214
- headers: Record<string, string> | null;
216
+ selectedTools: string[] | null;
215
217
  toolPolicies: Record<string, {
216
218
  needsApproval?: boolean;
217
219
  }> | null;
218
- subAgentId: string;
219
- selectedTools: string[] | null;
220
220
  }>;
221
221
  declare const updateAgentToolRelation: (db: AgentsManageDatabaseClient) => (params: {
222
222
  scopes: AgentScopeConfig;
@@ -248,19 +248,19 @@ declare const getAgentToolRelationById: (db: AgentsManageDatabaseClient) => (par
248
248
  scopes: SubAgentScopeConfig;
249
249
  relationId: string;
250
250
  }) => Promise<{
251
+ headers: Record<string, string> | null;
251
252
  id: string;
253
+ createdAt: string;
254
+ updatedAt: string;
252
255
  tenantId: string;
253
256
  projectId: string;
254
257
  agentId: string;
255
- createdAt: string;
256
- updatedAt: string;
258
+ subAgentId: string;
257
259
  toolId: string;
258
- headers: Record<string, string> | null;
260
+ selectedTools: string[] | null;
259
261
  toolPolicies: Record<string, {
260
262
  needsApproval?: boolean;
261
263
  }> | null;
262
- subAgentId: string;
263
- selectedTools: string[] | null;
264
264
  } | undefined>;
265
265
  declare const getAgentToolRelationByAgent: (db: AgentsManageDatabaseClient) => (params: {
266
266
  scopes: SubAgentScopeConfig;
@@ -9,13 +9,13 @@ declare const getSubAgentTeamAgentRelationById: (db: AgentsManageDatabaseClient)
9
9
  scopes: SubAgentScopeConfig;
10
10
  relationId: string;
11
11
  }) => Promise<{
12
+ headers: Record<string, string> | null;
12
13
  id: string;
14
+ createdAt: string;
15
+ updatedAt: string;
13
16
  tenantId: string;
14
17
  projectId: string;
15
18
  agentId: string;
16
- createdAt: string;
17
- updatedAt: string;
18
- headers: Record<string, string> | null;
19
19
  subAgentId: string;
20
20
  targetAgentId: string;
21
21
  } | undefined>;
@@ -44,26 +44,26 @@ declare const listSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) =
44
44
  declare const getSubAgentTeamAgentRelations: (db: AgentsManageDatabaseClient) => (params: {
45
45
  scopes: SubAgentScopeConfig;
46
46
  }) => Promise<{
47
+ headers: Record<string, string> | null;
47
48
  id: string;
49
+ createdAt: string;
50
+ updatedAt: string;
48
51
  tenantId: string;
49
52
  projectId: string;
50
53
  agentId: string;
51
- createdAt: string;
52
- updatedAt: string;
53
- headers: Record<string, string> | null;
54
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
+ headers: Record<string, string> | null;
60
61
  id: string;
62
+ createdAt: string;
63
+ updatedAt: string;
61
64
  tenantId: string;
62
65
  projectId: string;
63
66
  agentId: string;
64
- createdAt: string;
65
- updatedAt: string;
66
- headers: Record<string, string> | null;
67
67
  subAgentId: string;
68
68
  targetAgentId: string;
69
69
  }[]>;
@@ -210,13 +210,13 @@ declare const createSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
210
210
  headers?: Record<string, string> | null;
211
211
  };
212
212
  }) => Promise<{
213
+ headers: Record<string, string> | null;
213
214
  id: string;
215
+ createdAt: string;
216
+ updatedAt: string;
214
217
  tenantId: string;
215
218
  projectId: string;
216
219
  agentId: string;
217
- createdAt: string;
218
- updatedAt: string;
219
- headers: Record<string, string> | null;
220
220
  subAgentId: string;
221
221
  targetAgentId: string;
222
222
  }>;
@@ -227,13 +227,13 @@ declare const getSubAgentTeamAgentRelationByParams: (db: AgentsManageDatabaseCli
227
227
  scopes: SubAgentScopeConfig;
228
228
  targetAgentId: string;
229
229
  }) => Promise<{
230
+ headers: Record<string, string> | null;
230
231
  id: string;
232
+ createdAt: string;
233
+ updatedAt: string;
231
234
  tenantId: string;
232
235
  projectId: string;
233
236
  agentId: string;
234
- createdAt: string;
235
- updatedAt: string;
236
- headers: Record<string, string> | null;
237
237
  subAgentId: string;
238
238
  targetAgentId: string;
239
239
  } | undefined>;
@@ -248,13 +248,13 @@ declare const upsertSubAgentTeamAgentRelation: (db: AgentsManageDatabaseClient)
248
248
  headers?: Record<string, string> | null;
249
249
  };
250
250
  }) => Promise<{
251
+ headers: Record<string, string> | null;
251
252
  id: string;
253
+ createdAt: string;
254
+ updatedAt: string;
252
255
  tenantId: string;
253
256
  projectId: string;
254
257
  agentId: string;
255
- createdAt: string;
256
- updatedAt: string;
257
- headers: Record<string, string> | null;
258
258
  subAgentId: string;
259
259
  targetAgentId: string;
260
260
  }>;
@@ -9,14 +9,14 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
9
9
  scopes: AgentScopeConfig;
10
10
  subAgentId: string;
11
11
  }) => Promise<{
12
- id: string;
13
12
  name: string;
14
- description: string | null;
13
+ id: string;
14
+ createdAt: string;
15
+ updatedAt: string;
15
16
  tenantId: string;
16
17
  projectId: string;
17
18
  agentId: string;
18
- prompt: string | null;
19
- conversationHistoryConfig: ConversationHistoryConfig | null;
19
+ description: string | null;
20
20
  models: {
21
21
  base?: {
22
22
  model?: string | undefined;
@@ -34,20 +34,20 @@ declare const getSubAgentById: (db: AgentsManageDatabaseClient) => (params: {
34
34
  stopWhen: {
35
35
  stepCountIs?: number | undefined;
36
36
  } | null;
37
- createdAt: string;
38
- updatedAt: string;
37
+ prompt: string | null;
38
+ conversationHistoryConfig: ConversationHistoryConfig | null;
39
39
  } | undefined>;
40
40
  declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
41
41
  scopes: AgentScopeConfig;
42
42
  }) => Promise<{
43
- id: string;
44
43
  name: string;
45
- description: string | null;
44
+ id: string;
45
+ createdAt: string;
46
+ updatedAt: string;
46
47
  tenantId: string;
47
48
  projectId: string;
48
49
  agentId: string;
49
- prompt: string | null;
50
- conversationHistoryConfig: ConversationHistoryConfig | null;
50
+ description: string | null;
51
51
  models: {
52
52
  base?: {
53
53
  model?: string | undefined;
@@ -65,8 +65,8 @@ declare const listSubAgents: (db: AgentsManageDatabaseClient) => (params: {
65
65
  stopWhen: {
66
66
  stepCountIs?: number | undefined;
67
67
  } | null;
68
- createdAt: string;
69
- updatedAt: string;
68
+ prompt: string | null;
69
+ conversationHistoryConfig: ConversationHistoryConfig | null;
70
70
  }[]>;
71
71
  declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (params: {
72
72
  scopes: AgentScopeConfig;
@@ -109,14 +109,14 @@ declare const listSubAgentsPaginated: (db: AgentsManageDatabaseClient) => (param
109
109
  };
110
110
  }>;
111
111
  declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAgentInsert) => Promise<{
112
- id: string;
113
112
  name: string;
114
- description: string | null;
113
+ id: string;
114
+ createdAt: string;
115
+ updatedAt: string;
115
116
  tenantId: string;
116
117
  projectId: string;
117
118
  agentId: string;
118
- prompt: string | null;
119
- conversationHistoryConfig: ConversationHistoryConfig | null;
119
+ description: string | null;
120
120
  models: {
121
121
  base?: {
122
122
  model?: string | undefined;
@@ -134,8 +134,8 @@ declare const createSubAgent: (db: AgentsManageDatabaseClient) => (params: SubAg
134
134
  stopWhen: {
135
135
  stepCountIs?: number | undefined;
136
136
  } | null;
137
- createdAt: string;
138
- updatedAt: string;
137
+ prompt: string | null;
138
+ conversationHistoryConfig: ConversationHistoryConfig | null;
139
139
  }>;
140
140
  declare const updateSubAgent: (db: AgentsManageDatabaseClient) => (params: {
141
141
  scopes: AgentScopeConfig;
@@ -20,14 +20,14 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
20
20
  scopes: ProjectScopeConfig;
21
21
  toolId: string;
22
22
  }) => Promise<{
23
- id: string;
23
+ headers: Record<string, string> | null;
24
24
  name: string;
25
- description: string | null;
26
- tenantId: string;
27
- projectId: string;
25
+ id: string;
28
26
  createdAt: string;
29
27
  updatedAt: string;
30
- headers: Record<string, string> | null;
28
+ tenantId: string;
29
+ projectId: string;
30
+ description: string | null;
31
31
  config: {
32
32
  type: "mcp";
33
33
  mcp: ToolMcpConfig;
@@ -78,14 +78,14 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
78
78
  };
79
79
  }>;
80
80
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
81
- id: string;
81
+ headers: Record<string, string> | null;
82
82
  name: string;
83
- description: string | null;
84
- tenantId: string;
85
- projectId: string;
83
+ id: string;
86
84
  createdAt: string;
87
85
  updatedAt: string;
88
- headers: Record<string, string> | null;
86
+ tenantId: string;
87
+ projectId: string;
88
+ description: string | null;
89
89
  config: {
90
90
  type: "mcp";
91
91
  mcp: ToolMcpConfig;
@@ -135,38 +135,38 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
135
135
  needsApproval?: boolean;
136
136
  }> | null;
137
137
  }) => Promise<{
138
+ headers: Record<string, string> | null;
138
139
  id: string;
140
+ createdAt: string;
141
+ updatedAt: string;
139
142
  tenantId: string;
140
143
  projectId: string;
141
144
  agentId: string;
142
- createdAt: string;
143
- updatedAt: string;
145
+ subAgentId: string;
144
146
  toolId: string;
145
- headers: Record<string, string> | null;
147
+ selectedTools: string[] | null;
146
148
  toolPolicies: Record<string, {
147
149
  needsApproval?: boolean;
148
150
  }> | null;
149
- subAgentId: string;
150
- selectedTools: string[] | null;
151
151
  }>;
152
152
  declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params: {
153
153
  scopes: AgentScopeConfig;
154
154
  subAgentId: string;
155
155
  toolId: string;
156
156
  }) => Promise<{
157
+ headers: Record<string, string> | null;
157
158
  id: string;
159
+ createdAt: string;
160
+ updatedAt: string;
158
161
  tenantId: string;
159
162
  projectId: string;
160
163
  agentId: string;
161
- createdAt: string;
162
- updatedAt: string;
164
+ subAgentId: string;
163
165
  toolId: string;
164
- headers: Record<string, string> | null;
166
+ selectedTools: string[] | null;
165
167
  toolPolicies: Record<string, {
166
168
  needsApproval?: boolean;
167
169
  }> | null;
168
- subAgentId: string;
169
- selectedTools: string[] | null;
170
170
  }>;
171
171
  /**
172
172
  * Upsert agent-tool relation (create if it doesn't exist, update if it does)
@@ -182,19 +182,19 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
182
182
  }> | null;
183
183
  relationId?: string;
184
184
  }) => Promise<{
185
+ headers: Record<string, string> | null;
185
186
  id: string;
187
+ createdAt: string;
188
+ updatedAt: string;
186
189
  tenantId: string;
187
190
  projectId: string;
188
191
  agentId: string;
189
- createdAt: string;
190
- updatedAt: string;
192
+ subAgentId: string;
191
193
  toolId: string;
192
- headers: Record<string, string> | null;
194
+ selectedTools: string[] | null;
193
195
  toolPolicies: Record<string, {
194
196
  needsApproval?: boolean;
195
197
  }> | null;
196
- subAgentId: string;
197
- selectedTools: string[] | null;
198
198
  }>;
199
199
  /**
200
200
  * Upsert a tool (create if it doesn't exist, update if it does)
@@ -202,14 +202,14 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
202
202
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
203
203
  data: ToolInsert;
204
204
  }) => Promise<{
205
- id: string;
205
+ headers: Record<string, string> | null;
206
206
  name: string;
207
- description: string | null;
208
- tenantId: string;
209
- projectId: string;
207
+ id: string;
210
208
  createdAt: string;
211
209
  updatedAt: string;
212
- headers: Record<string, string> | null;
210
+ tenantId: string;
211
+ projectId: string;
212
+ description: string | null;
213
213
  config: {
214
214
  type: "mcp";
215
215
  mcp: ToolMcpConfig;
@@ -3,6 +3,8 @@ import { CredentialStoreType, MCPServerType, MCPTransportType } from "../../type
3
3
  import { detectAuthenticationRequired } from "../../utils/auth-detection.js";
4
4
  import { env } from "../../env.js";
5
5
  import { getLogger } from "../../utils/logger.js";
6
+ import { configureComposioMCPServer } from "../../utils/third-party-mcp-servers/composio-client.js";
7
+ import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-servers/third-party-check.js";
6
8
  import { getCredentialStoreLookupKeyFromRetrievalParams } from "../../utils/credential-store-utils.js";
7
9
  import { CredentialStuffer } from "../../credential-stuffer/CredentialStuffer.js";
8
10
  import "../../credential-stuffer/index.js";
@@ -16,8 +18,6 @@ import { updateAgentToolRelation } from "./subAgentRelations.js";
16
18
  import { isSerializationError } from "../../retry/retryable-errors.js";
17
19
  import { toISODateString } from "../../utils/date.js";
18
20
  import { McpClient } from "../../utils/mcp-client.js";
19
- import { configureComposioMCPServer } from "../../utils/third-party-mcp-servers/composio-client.js";
20
- import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-servers/third-party-check.js";
21
21
  import { TRUSTED_WORK_APP_MCP_PATHS, isTrustedWorkAppMcpUrl } from "../../utils/work-app-mcp.js";
22
22
  import "../../utils/index.js";
23
23
  import { isGithubWorkAppTool } from "../runtime/github-work-app-installations.js";
@@ -122,7 +122,12 @@ const discoverToolsFromServer = async (tool, credentialReference, credentialStor
122
122
  reconnectionOptions: tool.config.mcp.transport?.reconnectionOptions,
123
123
  sessionId: tool.config.mcp.transport?.sessionId
124
124
  };
125
- configureComposioMCPServer(serverConfig, tool.tenantId, tool.projectId, tool.credentialScope === "user" ? "user" : "project", userId);
125
+ const composioConnectedAccountId = credentialReference?.retrievalParams?.connectedAccountId;
126
+ if (composioConnectedAccountId) configureComposioMCPServer(serverConfig, tool.tenantId, tool.projectId, tool.credentialScope === "user" ? "user" : "project", userId, composioConnectedAccountId);
127
+ else if (serverConfig.url?.toString().includes("composio.dev")) logger.warn({
128
+ toolName: tool.name,
129
+ toolId: tool.id
130
+ }, "Composio tool missing connectedAccountId — skipping auth injection to prevent credential leakage");
126
131
  const urlString = String(serverConfig.url);
127
132
  if (isGithubWorkAppTool(tool) && isTrustedWorkAppMcpUrl(urlString, TRUSTED_WORK_APP_MCP_PATHS.github, env.INKEEP_AGENTS_API_URL)) serverConfig.headers = {
128
133
  ...serverConfig.headers,
@@ -248,11 +253,18 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
248
253
  lastErrorComputed = toolNeedsAuth ? `Authentication required - OAuth login needed. ${errorMessage}` : errorMessage;
249
254
  }
250
255
  }
251
- if (dbResult.config.mcp.server.url.includes("composio.dev")) {
256
+ if (dbResult.config.mcp.server.url.includes("composio.dev")) if (!!!credentialReference?.retrievalParams?.connectedAccountId) {
257
+ status = "needs_auth";
258
+ lastErrorComputed = "Third-party authentication required. Connect your account to pin a specific credential.";
259
+ } else {
252
260
  const credentialScope = dbResult.credentialScope || "project";
253
- if (!await isThirdPartyMCPServerAuthenticated(dbResult.tenantId, dbResult.projectId, mcpServerUrl, credentialScope, userId)) {
261
+ const authResult = await isThirdPartyMCPServerAuthenticated(dbResult.tenantId, dbResult.projectId, mcpServerUrl, credentialScope, userId);
262
+ if (!authResult.authenticated && !authResult.error) {
254
263
  status = "needs_auth";
255
264
  lastErrorComputed = "Third-party authentication required. Try authenticating again.";
265
+ } else if (authResult.error) {
266
+ status = "unavailable";
267
+ lastErrorComputed = "Could not verify third-party authentication status. The service may be temporarily unavailable.";
256
268
  }
257
269
  }
258
270
  const now = (/* @__PURE__ */ new Date()).toISOString();
@@ -40,7 +40,7 @@ declare const listTriggersPaginated: (db: AgentsManageDatabaseClient) => (params
40
40
  algorithm: "sha256" | "sha512" | "sha384" | "sha1" | "md5";
41
41
  encoding: "hex" | "base64";
42
42
  signature: {
43
- source: "query" | "body" | "header";
43
+ source: "body" | "query" | "header";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
@@ -8,28 +8,28 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
8
8
  scopes: ProjectScopeConfig;
9
9
  id: string;
10
10
  }) => Promise<{
11
- id: string;
12
11
  name: string | null;
12
+ id: string;
13
+ createdAt: string;
14
+ expiresAt: string | null;
15
+ updatedAt: string;
13
16
  tenantId: string;
14
17
  projectId: string;
15
18
  agentId: string;
16
- createdAt: string;
17
- updatedAt: string;
18
- expiresAt: string | null;
19
19
  publicId: string;
20
20
  keyHash: string;
21
21
  keyPrefix: string;
22
22
  lastUsedAt: string | null;
23
23
  } | undefined>;
24
24
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
25
- id: string;
26
25
  name: string | null;
26
+ id: string;
27
+ createdAt: string;
28
+ expiresAt: string | null;
29
+ updatedAt: string;
27
30
  tenantId: string;
28
31
  projectId: string;
29
32
  agentId: string;
30
- createdAt: string;
31
- updatedAt: string;
32
- expiresAt: string | null;
33
33
  publicId: string;
34
34
  keyHash: string;
35
35
  keyPrefix: string;
@@ -39,14 +39,14 @@ declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
39
39
  scopes: ProjectScopeConfig;
40
40
  agentId?: string;
41
41
  }) => Promise<{
42
- id: string;
43
42
  name: string | null;
43
+ id: string;
44
+ createdAt: string;
45
+ expiresAt: string | null;
46
+ updatedAt: string;
44
47
  tenantId: string;
45
48
  projectId: string;
46
49
  agentId: string;
47
- createdAt: string;
48
- updatedAt: string;
49
- expiresAt: string | null;
50
50
  publicId: string;
51
51
  keyHash: string;
52
52
  keyPrefix: string;
@@ -66,14 +66,14 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
66
66
  };
67
67
  }>;
68
68
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
69
- id: string;
70
69
  name: string | null;
70
+ id: string;
71
+ createdAt: string;
72
+ expiresAt: string | null;
73
+ updatedAt: string;
71
74
  tenantId: string;
72
75
  projectId: string;
73
76
  agentId: string;
74
- createdAt: string;
75
- updatedAt: string;
76
- expiresAt: string | null;
77
77
  publicId: string;
78
78
  keyHash: string;
79
79
  keyPrefix: string;
@@ -5,15 +5,15 @@ 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
- id: string;
9
- name: string;
10
- description: string | null;
11
- tenantId: string | null;
12
- projectId: string | null;
8
+ enabled: boolean;
13
9
  type: AppType;
10
+ name: string;
11
+ id: string;
14
12
  createdAt: string;
15
13
  updatedAt: string;
16
- enabled: boolean;
14
+ tenantId: string | null;
15
+ projectId: string | null;
16
+ description: string | null;
17
17
  config: {
18
18
  type: "web_client";
19
19
  webClient: {
@@ -52,15 +52,15 @@ declare const listAppsPaginated: (db: AgentsRunDatabaseClient) => (params: {
52
52
  };
53
53
  }>;
54
54
  declare const createApp: (db: AgentsRunDatabaseClient) => (params: AppInsert) => Promise<{
55
- id: string;
56
- name: string;
57
- description: string | null;
58
- tenantId: string | null;
59
- projectId: string | null;
55
+ enabled: boolean;
60
56
  type: AppType;
57
+ name: string;
58
+ id: string;
61
59
  createdAt: string;
62
60
  updatedAt: string;
63
- enabled: boolean;
61
+ tenantId: string | null;
62
+ projectId: string | null;
63
+ description: string | null;
64
64
  config: {
65
65
  type: "web_client";
66
66
  webClient: {