@inkeep/agents-core 0.0.0-dev-20260126174131 → 0.0.0-dev-20260126204245

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 (35) hide show
  1. package/dist/auth/auth-schema.d.ts +104 -104
  2. package/dist/auth/auth-validation-schemas.d.ts +146 -146
  3. package/dist/auth/auth.d.ts +53 -53
  4. package/dist/auth/permissions.d.ts +13 -13
  5. package/dist/client-exports.d.ts +14 -15
  6. package/dist/constants/execution-limits-shared/defaults.d.ts +1 -1
  7. package/dist/constants/execution-limits-shared/defaults.js +1 -1
  8. package/dist/constants/execution-limits-shared/index.d.ts +1 -1
  9. package/dist/data-access/manage/agents.d.ts +55 -55
  10. package/dist/data-access/manage/artifactComponents.d.ts +12 -12
  11. package/dist/data-access/manage/contextConfigs.d.ts +16 -16
  12. package/dist/data-access/manage/dataComponents.d.ts +4 -4
  13. package/dist/data-access/manage/functionTools.d.ts +14 -14
  14. package/dist/data-access/manage/subAgentExternalAgentRelations.d.ts +12 -12
  15. package/dist/data-access/manage/subAgentRelations.d.ts +24 -24
  16. package/dist/data-access/manage/subAgentTeamAgentRelations.d.ts +12 -12
  17. package/dist/data-access/manage/subAgents.d.ts +33 -33
  18. package/dist/data-access/manage/tools.d.ts +21 -21
  19. package/dist/data-access/manage/tools.js +27 -7
  20. package/dist/data-access/manage/triggers.d.ts +2 -2
  21. package/dist/data-access/runtime/apiKeys.d.ts +16 -16
  22. package/dist/data-access/runtime/conversations.d.ts +23 -23
  23. package/dist/data-access/runtime/messages.d.ts +12 -12
  24. package/dist/data-access/runtime/tasks.d.ts +6 -6
  25. package/dist/db/manage/manage-schema.d.ts +381 -381
  26. package/dist/db/runtime/runtime-schema.d.ts +181 -181
  27. package/dist/types/utility.d.ts +1 -1
  28. package/dist/types/utility.js +2 -1
  29. package/dist/utils/jmespath-utils.js +1 -1
  30. package/dist/utils/mcp-client.d.ts +1 -1
  31. package/dist/utils/mcp-client.js +1 -1
  32. package/dist/validation/dolt-schemas.d.ts +1 -1
  33. package/dist/validation/drizzle-schema-helpers.d.ts +3 -3
  34. package/dist/validation/schemas.d.ts +1892 -1888
  35. package/package.json +1 -1
@@ -18,13 +18,13 @@ declare const getToolById: (db: AgentsManageDatabaseClient) => (params: {
18
18
  scopes: ProjectScopeConfig;
19
19
  toolId: string;
20
20
  }) => Promise<{
21
+ name: string;
22
+ description: string | null;
23
+ tenantId: string;
24
+ projectId: string;
21
25
  id: string;
22
26
  createdAt: string;
23
- name: string;
24
27
  updatedAt: string;
25
- projectId: string;
26
- tenantId: string;
27
- description: string | null;
28
28
  headers: Record<string, string> | null;
29
29
  config: {
30
30
  type: "mcp";
@@ -74,13 +74,13 @@ declare const listTools: (db: AgentsManageDatabaseClient) => (params: {
74
74
  };
75
75
  }>;
76
76
  declare const createTool: (db: AgentsManageDatabaseClient) => (params: ToolInsert) => Promise<{
77
+ name: string;
78
+ description: string | null;
79
+ tenantId: string;
80
+ projectId: string;
77
81
  id: string;
78
82
  createdAt: string;
79
- name: string;
80
83
  updatedAt: string;
81
- projectId: string;
82
- tenantId: string;
83
- description: string | null;
84
84
  headers: Record<string, string> | null;
85
85
  config: {
86
86
  type: "mcp";
@@ -129,15 +129,15 @@ declare const addToolToAgent: (db: AgentsManageDatabaseClient) => (params: {
129
129
  needsApproval?: boolean;
130
130
  }> | null;
131
131
  }) => Promise<{
132
+ tenantId: string;
133
+ projectId: string;
132
134
  id: string;
133
135
  createdAt: string;
134
136
  updatedAt: string;
135
137
  agentId: string;
136
- projectId: string;
137
- tenantId: string;
138
138
  headers: Record<string, string> | null;
139
- subAgentId: string;
140
139
  toolId: string;
140
+ subAgentId: string;
141
141
  toolPolicies: Record<string, {
142
142
  needsApproval?: boolean;
143
143
  }> | null;
@@ -148,15 +148,15 @@ declare const removeToolFromAgent: (db: AgentsManageDatabaseClient) => (params:
148
148
  subAgentId: string;
149
149
  toolId: string;
150
150
  }) => Promise<{
151
+ tenantId: string;
152
+ projectId: string;
151
153
  id: string;
152
154
  createdAt: string;
153
155
  updatedAt: string;
154
156
  agentId: string;
155
- projectId: string;
156
- tenantId: string;
157
157
  headers: Record<string, string> | null;
158
- subAgentId: string;
159
158
  toolId: string;
159
+ subAgentId: string;
160
160
  toolPolicies: Record<string, {
161
161
  needsApproval?: boolean;
162
162
  }> | null;
@@ -176,15 +176,15 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
176
176
  }> | null;
177
177
  relationId?: string;
178
178
  }) => Promise<{
179
+ tenantId: string;
180
+ projectId: string;
179
181
  id: string;
180
182
  createdAt: string;
181
183
  updatedAt: string;
182
184
  agentId: string;
183
- projectId: string;
184
- tenantId: string;
185
185
  headers: Record<string, string> | null;
186
- subAgentId: string;
187
186
  toolId: string;
187
+ subAgentId: string;
188
188
  toolPolicies: Record<string, {
189
189
  needsApproval?: boolean;
190
190
  }> | null;
@@ -196,13 +196,13 @@ declare const upsertSubAgentToolRelation: (db: AgentsManageDatabaseClient) => (p
196
196
  declare const upsertTool: (db: AgentsManageDatabaseClient) => (params: {
197
197
  data: ToolInsert;
198
198
  }) => Promise<{
199
+ name: string;
200
+ description: string | null;
201
+ tenantId: string;
202
+ projectId: string;
199
203
  id: string;
200
204
  createdAt: string;
201
- name: string;
202
205
  updatedAt: string;
203
- projectId: string;
204
- tenantId: string;
205
- description: string | null;
206
206
  headers: Record<string, string> | null;
207
207
  config: {
208
208
  type: "mcp";
@@ -14,8 +14,23 @@ import { isThirdPartyMCPServerAuthenticated } from "../../utils/third-party-mcp-
14
14
  import "../../utils/index.js";
15
15
  import { getCredentialReference, getUserScopedCredentialReference } from "./credentialReferences.js";
16
16
  import { and, count, desc, eq } from "drizzle-orm";
17
+ import { ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
17
18
 
18
19
  //#region src/data-access/manage/tools.ts
20
+ /**
21
+ * Check if an error is a timeout/connection error.
22
+ * Uses MCP SDK ErrorCode for proper type safety.
23
+ */
24
+ function isTimeoutOrConnectionError(error) {
25
+ if (error instanceof McpError) return error.code === ErrorCode.RequestTimeout || error.code === ErrorCode.ConnectionClosed;
26
+ if (error instanceof Error) {
27
+ const message = error.message.toLowerCase();
28
+ const cause = error.cause;
29
+ if (message.includes("timed out") || message.includes("timeout")) return true;
30
+ if (cause?.code === "ETIMEDOUT" || cause?.code === "ECONNABORTED" || cause?.code === "ECONNRESET") return true;
31
+ }
32
+ return false;
33
+ }
19
34
  const logger = getLogger("tools");
20
35
  /**
21
36
  * Extract expiration date from credential data stored in credential store
@@ -188,14 +203,19 @@ const dbResultToMcpTool = async (dbResult, dbClient, credentialStoreRegistry, re
188
203
  status = "healthy";
189
204
  lastErrorComputed = null;
190
205
  } catch (error) {
191
- const toolNeedsAuth = error instanceof Error && await detectAuthenticationRequired({
192
- serverUrl: mcpServerUrl,
193
- error,
194
- logger
195
- });
196
- status = toolNeedsAuth ? "needs_auth" : "unhealthy";
197
206
  const errorMessage = error instanceof Error ? error.message : "Tool discovery failed";
198
- lastErrorComputed = toolNeedsAuth ? `Authentication required - OAuth login needed. ${errorMessage}` : errorMessage;
207
+ if (isTimeoutOrConnectionError(error)) {
208
+ status = "unavailable";
209
+ lastErrorComputed = `Connection failed - the MCP server may be slow or temporarily unreachable.${error instanceof McpError ? ` (MCP error ${error.code})` : ""} ${errorMessage}`;
210
+ } else {
211
+ const toolNeedsAuth = await detectAuthenticationRequired({
212
+ serverUrl: mcpServerUrl,
213
+ error: error instanceof Error ? error : void 0,
214
+ logger
215
+ });
216
+ status = toolNeedsAuth ? "needs_auth" : "unhealthy";
217
+ lastErrorComputed = toolNeedsAuth ? `Authentication required - OAuth login needed. ${errorMessage}` : errorMessage;
218
+ }
199
219
  }
200
220
  if (dbResult.config.mcp.server.url.includes("composio.dev")) {
201
221
  const credentialScope = dbResult.credentialScope || "project";
@@ -40,13 +40,13 @@ 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: "query" | "header" | "body";
44
44
  key: string;
45
45
  prefix?: string | undefined;
46
46
  regex?: string | undefined;
47
47
  };
48
48
  signedComponents: {
49
- source: "literal" | "body" | "header";
49
+ source: "literal" | "header" | "body";
50
50
  required: boolean;
51
51
  key?: string | undefined;
52
52
  value?: string | undefined;
@@ -7,49 +7,49 @@ declare const getApiKeyById: (db: AgentsRunDatabaseClient) => (params: {
7
7
  scopes: ProjectScopeConfig;
8
8
  id: string;
9
9
  }) => Promise<{
10
+ name: string | null;
11
+ tenantId: string;
12
+ projectId: string;
10
13
  id: string;
11
14
  createdAt: string;
12
- name: string | null;
13
15
  updatedAt: string;
14
16
  agentId: string;
15
- projectId: string;
16
- tenantId: string;
17
- expiresAt: string | null;
18
17
  publicId: string;
19
18
  keyHash: string;
20
19
  keyPrefix: string;
21
20
  lastUsedAt: string | null;
21
+ expiresAt: string | null;
22
22
  } | undefined>;
23
23
  declare const getApiKeyByPublicId: (db: AgentsRunDatabaseClient) => (publicId: string) => Promise<{
24
+ name: string | null;
25
+ tenantId: string;
26
+ projectId: string;
24
27
  id: string;
25
28
  createdAt: string;
26
- name: string | null;
27
29
  updatedAt: string;
28
30
  agentId: string;
29
- projectId: string;
30
- tenantId: string;
31
- expiresAt: string | null;
32
31
  publicId: string;
33
32
  keyHash: string;
34
33
  keyPrefix: string;
35
34
  lastUsedAt: string | null;
35
+ expiresAt: string | null;
36
36
  } | undefined>;
37
37
  declare const listApiKeys: (db: AgentsRunDatabaseClient) => (params: {
38
38
  scopes: ProjectScopeConfig;
39
39
  agentId?: string;
40
40
  }) => Promise<{
41
+ name: string | null;
42
+ tenantId: string;
43
+ projectId: string;
41
44
  id: string;
42
45
  createdAt: string;
43
- name: string | null;
44
46
  updatedAt: string;
45
47
  agentId: string;
46
- projectId: string;
47
- tenantId: string;
48
- expiresAt: string | null;
49
48
  publicId: string;
50
49
  keyHash: string;
51
50
  keyPrefix: string;
52
51
  lastUsedAt: string | null;
52
+ expiresAt: string | null;
53
53
  }[]>;
54
54
  declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
55
55
  scopes: ProjectScopeConfig;
@@ -65,18 +65,18 @@ declare const listApiKeysPaginated: (db: AgentsRunDatabaseClient) => (params: {
65
65
  };
66
66
  }>;
67
67
  declare const createApiKey: (db: AgentsRunDatabaseClient) => (params: ApiKeyInsert) => Promise<{
68
+ name: string | null;
69
+ tenantId: string;
70
+ projectId: string;
68
71
  id: string;
69
72
  createdAt: string;
70
- name: string | null;
71
73
  updatedAt: string;
72
74
  agentId: string;
73
- projectId: string;
74
- tenantId: string;
75
- expiresAt: string | null;
76
75
  publicId: string;
77
76
  keyHash: string;
78
77
  keyPrefix: string;
79
78
  lastUsedAt: string | null;
79
+ expiresAt: string | null;
80
80
  }>;
81
81
  declare const updateApiKey: (db: AgentsRunDatabaseClient) => (params: {
82
82
  scopes: ProjectScopeConfig;
@@ -15,20 +15,20 @@ declare const listConversations: (db: AgentsRunDatabaseClient) => (params: {
15
15
  total: number;
16
16
  }>;
17
17
  declare const createConversation: (db: AgentsRunDatabaseClient) => (params: ConversationInsert) => Promise<{
18
+ title: string | null;
19
+ tenantId: string;
20
+ projectId: string;
18
21
  id: string;
19
22
  createdAt: string;
20
23
  updatedAt: string;
21
24
  agentId: string | null;
22
- projectId: string;
23
- tenantId: string;
24
- title: string | null;
25
25
  metadata: ConversationMetadata | null;
26
+ userId: string | null;
26
27
  ref: {
27
- type: "tag" | "commit" | "branch";
28
+ type: "commit" | "tag" | "branch";
28
29
  name: string;
29
30
  hash: string;
30
31
  } | null;
31
- userId: string | null;
32
32
  activeSubAgentId: string;
33
33
  lastContextResolution: string | null;
34
34
  }>;
@@ -43,7 +43,7 @@ declare const updateConversation: (db: AgentsRunDatabaseClient) => (params: {
43
43
  agentId: string | null;
44
44
  activeSubAgentId: string;
45
45
  ref: {
46
- type: "tag" | "commit" | "branch";
46
+ type: "commit" | "tag" | "branch";
47
47
  name: string;
48
48
  hash: string;
49
49
  } | null;
@@ -69,7 +69,7 @@ declare const updateConversationActiveSubAgent: (db: AgentsRunDatabaseClient) =>
69
69
  agentId: string | null;
70
70
  activeSubAgentId: string;
71
71
  ref: {
72
- type: "tag" | "commit" | "branch";
72
+ type: "commit" | "tag" | "branch";
73
73
  name: string;
74
74
  hash: string;
75
75
  } | null;
@@ -84,20 +84,20 @@ declare const getConversation: (db: AgentsRunDatabaseClient) => (params: {
84
84
  scopes: ProjectScopeConfig;
85
85
  conversationId: string;
86
86
  }) => Promise<{
87
+ title: string | null;
88
+ tenantId: string;
89
+ projectId: string;
87
90
  id: string;
88
91
  createdAt: string;
89
92
  updatedAt: string;
90
93
  agentId: string | null;
91
- projectId: string;
92
- tenantId: string;
93
- title: string | null;
94
94
  metadata: ConversationMetadata | null;
95
+ userId: string | null;
95
96
  ref: {
96
- type: "tag" | "commit" | "branch";
97
+ type: "commit" | "tag" | "branch";
97
98
  name: string;
98
99
  hash: string;
99
100
  } | null;
100
- userId: string | null;
101
101
  activeSubAgentId: string;
102
102
  lastContextResolution: string | null;
103
103
  } | undefined>;
@@ -107,7 +107,7 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
107
107
  tenantId: string;
108
108
  id: string;
109
109
  ref: {
110
- type: "tag" | "commit" | "branch";
110
+ type: "commit" | "tag" | "branch";
111
111
  name: string;
112
112
  hash: string;
113
113
  };
@@ -120,20 +120,20 @@ declare const createOrGetConversation: (db: AgentsRunDatabaseClient) => (input:
120
120
  metadata?: ConversationMetadata | null | undefined;
121
121
  contextConfigId?: string | undefined;
122
122
  } | {
123
+ title: string | null;
124
+ tenantId: string;
125
+ projectId: string;
123
126
  id: string;
124
127
  createdAt: string;
125
128
  updatedAt: string;
126
129
  agentId: string | null;
127
- projectId: string;
128
- tenantId: string;
129
- title: string | null;
130
130
  metadata: ConversationMetadata | null;
131
+ userId: string | null;
131
132
  ref: {
132
- type: "tag" | "commit" | "branch";
133
+ type: "commit" | "tag" | "branch";
133
134
  name: string;
134
135
  hash: string;
135
136
  } | null;
136
- userId: string | null;
137
137
  activeSubAgentId: string;
138
138
  lastContextResolution: string | null;
139
139
  }>;
@@ -152,20 +152,20 @@ declare const getActiveAgentForConversation: (db: AgentsRunDatabaseClient) => (p
152
152
  scopes: ProjectScopeConfig;
153
153
  conversationId: string;
154
154
  }) => Promise<{
155
+ title: string | null;
156
+ tenantId: string;
157
+ projectId: string;
155
158
  id: string;
156
159
  createdAt: string;
157
160
  updatedAt: string;
158
161
  agentId: string | null;
159
- projectId: string;
160
- tenantId: string;
161
- title: string | null;
162
162
  metadata: ConversationMetadata | null;
163
+ userId: string | null;
163
164
  ref: {
164
- type: "tag" | "commit" | "branch";
165
+ type: "commit" | "tag" | "branch";
165
166
  name: string;
166
167
  hash: string;
167
168
  } | null;
168
- userId: string | null;
169
169
  activeSubAgentId: string;
170
170
  lastContextResolution: string | null;
171
171
  } | undefined>;
@@ -9,15 +9,15 @@ declare const getMessageById: (db: AgentsRunDatabaseClient) => (params: {
9
9
  scopes: ProjectScopeConfig;
10
10
  messageId: string;
11
11
  }) => Promise<{
12
+ content: MessageContent;
13
+ tenantId: string;
14
+ projectId: string;
12
15
  id: string;
13
16
  createdAt: string;
14
17
  updatedAt: string;
15
- projectId: string;
16
- tenantId: string;
17
18
  metadata: MessageMetadata | null;
18
- content: MessageContent;
19
- role: string;
20
19
  conversationId: string;
20
+ role: string;
21
21
  fromSubAgentId: string | null;
22
22
  toSubAgentId: string | null;
23
23
  fromExternalAgentId: string | null;
@@ -140,15 +140,15 @@ declare const getVisibleMessages: (db: AgentsRunDatabaseClient) => (params: {
140
140
  id: string;
141
141
  }[]>;
142
142
  declare const createMessage: (db: AgentsRunDatabaseClient) => (params: MessageInsert) => Promise<{
143
+ content: MessageContent;
144
+ tenantId: string;
145
+ projectId: string;
143
146
  id: string;
144
147
  createdAt: string;
145
148
  updatedAt: string;
146
- projectId: string;
147
- tenantId: string;
148
149
  metadata: MessageMetadata | null;
149
- content: MessageContent;
150
- role: string;
151
150
  conversationId: string;
151
+ role: string;
152
152
  fromSubAgentId: string | null;
153
153
  toSubAgentId: string | null;
154
154
  fromExternalAgentId: string | null;
@@ -193,15 +193,15 @@ declare const deleteMessage: (db: AgentsRunDatabaseClient) => (params: {
193
193
  scopes: ProjectScopeConfig;
194
194
  messageId: string;
195
195
  }) => Promise<{
196
+ content: MessageContent;
197
+ tenantId: string;
198
+ projectId: string;
196
199
  id: string;
197
200
  createdAt: string;
198
201
  updatedAt: string;
199
- projectId: string;
200
- tenantId: string;
201
202
  metadata: MessageMetadata | null;
202
- content: MessageContent;
203
- role: string;
204
203
  conversationId: string;
204
+ role: string;
205
205
  fromSubAgentId: string | null;
206
206
  toSubAgentId: string | null;
207
207
  fromExternalAgentId: string | null;
@@ -6,20 +6,20 @@ 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
+ status: string;
10
+ tenantId: string;
11
+ projectId: string;
9
12
  id: string;
10
13
  createdAt: string;
11
14
  updatedAt: string;
12
15
  agentId: string;
13
- projectId: string;
14
- tenantId: string;
15
16
  metadata: TaskMetadataConfig | null;
17
+ contextId: string;
16
18
  ref: {
17
- type: "tag" | "commit" | "branch";
19
+ type: "commit" | "tag" | "branch";
18
20
  name: string;
19
21
  hash: string;
20
22
  } | null;
21
- status: string;
22
- contextId: string;
23
23
  subAgentId: string;
24
24
  }>;
25
25
  declare const getTask: (db: AgentsRunDatabaseClient) => (params: {
@@ -36,7 +36,7 @@ declare const updateTask: (db: AgentsRunDatabaseClient) => (params: {
36
36
  updatedAt: string;
37
37
  contextId: string;
38
38
  ref: {
39
- type: "tag" | "commit" | "branch";
39
+ type: "commit" | "tag" | "branch";
40
40
  name: string;
41
41
  hash: string;
42
42
  } | null;