@inkeep/agents-core 0.41.0 → 0.41.2
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.
- package/dist/auth/auth.d.ts +46 -18
- package/dist/auth/auth.js +17 -1
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/data-access/agents.d.ts +21 -21
- package/dist/data-access/apiKeys.d.ts +20 -20
- package/dist/data-access/artifactComponents.d.ts +10 -10
- package/dist/data-access/contextConfigs.d.ts +12 -12
- package/dist/data-access/conversations.d.ts +12 -12
- package/dist/data-access/dataComponents.d.ts +4 -4
- package/dist/data-access/functionTools.d.ts +8 -8
- package/dist/data-access/messages.d.ts +9 -9
- package/dist/data-access/subAgentExternalAgentRelations.d.ts +24 -24
- package/dist/data-access/subAgentRelations.d.ts +30 -30
- package/dist/data-access/subAgentTeamAgentRelations.d.ts +18 -18
- package/dist/data-access/subAgents.d.ts +15 -15
- package/dist/data-access/tasks.d.ts +4 -4
- package/dist/data-access/tools.d.ts +36 -36
- package/dist/utils/model-factory.js +13 -1
- package/dist/validation/schemas.d.ts +82 -82
- package/package.json +3 -1
|
@@ -12,19 +12,19 @@ declare const getToolById: (db: DatabaseClient) => (params: {
|
|
|
12
12
|
scopes: ProjectScopeConfig;
|
|
13
13
|
toolId: string;
|
|
14
14
|
}) => Promise<{
|
|
15
|
+
tenantId: string;
|
|
16
|
+
projectId: string;
|
|
15
17
|
id: string;
|
|
16
18
|
name: string;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
updatedAt: string;
|
|
19
19
|
description: string | null;
|
|
20
|
-
headers: Record<string, string> | null;
|
|
21
|
-
tenantId: string;
|
|
22
|
-
projectId: string;
|
|
23
|
-
credentialReferenceId: string | null;
|
|
24
20
|
config: {
|
|
25
21
|
type: "mcp";
|
|
26
22
|
mcp: ToolMcpConfig;
|
|
27
23
|
};
|
|
24
|
+
credentialReferenceId: string | null;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
headers: Record<string, string> | null;
|
|
28
28
|
credentialScope: string;
|
|
29
29
|
imageUrl: string | null;
|
|
30
30
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -61,19 +61,19 @@ declare const listTools: (db: DatabaseClient) => (params: {
|
|
|
61
61
|
};
|
|
62
62
|
}>;
|
|
63
63
|
declare const createTool: (db: DatabaseClient) => (params: ToolInsert) => Promise<{
|
|
64
|
+
tenantId: string;
|
|
65
|
+
projectId: string;
|
|
64
66
|
id: string;
|
|
65
67
|
name: string;
|
|
66
|
-
createdAt: string;
|
|
67
|
-
updatedAt: string;
|
|
68
68
|
description: string | null;
|
|
69
|
-
headers: Record<string, string> | null;
|
|
70
|
-
tenantId: string;
|
|
71
|
-
projectId: string;
|
|
72
|
-
credentialReferenceId: string | null;
|
|
73
69
|
config: {
|
|
74
70
|
type: "mcp";
|
|
75
71
|
mcp: ToolMcpConfig;
|
|
76
72
|
};
|
|
73
|
+
credentialReferenceId: string | null;
|
|
74
|
+
createdAt: string;
|
|
75
|
+
updatedAt: string;
|
|
76
|
+
headers: Record<string, string> | null;
|
|
77
77
|
credentialScope: string;
|
|
78
78
|
imageUrl: string | null;
|
|
79
79
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -116,38 +116,38 @@ declare const addToolToAgent: (db: DatabaseClient) => (params: {
|
|
|
116
116
|
needsApproval?: boolean;
|
|
117
117
|
}> | null;
|
|
118
118
|
}) => Promise<{
|
|
119
|
-
id: string;
|
|
120
|
-
createdAt: string;
|
|
121
|
-
updatedAt: string;
|
|
122
|
-
headers: Record<string, string> | null;
|
|
123
119
|
tenantId: string;
|
|
124
120
|
projectId: string;
|
|
121
|
+
id: string;
|
|
125
122
|
agentId: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
updatedAt: string;
|
|
126
125
|
toolId: string;
|
|
127
|
-
|
|
128
|
-
selectedTools: string[] | null;
|
|
126
|
+
headers: Record<string, string> | null;
|
|
129
127
|
toolPolicies: Record<string, {
|
|
130
128
|
needsApproval?: boolean;
|
|
131
129
|
}> | null;
|
|
130
|
+
subAgentId: string;
|
|
131
|
+
selectedTools: string[] | null;
|
|
132
132
|
}>;
|
|
133
133
|
declare const removeToolFromAgent: (db: DatabaseClient) => (params: {
|
|
134
134
|
scopes: AgentScopeConfig;
|
|
135
135
|
subAgentId: string;
|
|
136
136
|
toolId: string;
|
|
137
137
|
}) => Promise<{
|
|
138
|
-
id: string;
|
|
139
|
-
createdAt: string;
|
|
140
|
-
updatedAt: string;
|
|
141
|
-
headers: Record<string, string> | null;
|
|
142
138
|
tenantId: string;
|
|
143
139
|
projectId: string;
|
|
140
|
+
id: string;
|
|
144
141
|
agentId: string;
|
|
142
|
+
createdAt: string;
|
|
143
|
+
updatedAt: string;
|
|
145
144
|
toolId: string;
|
|
146
|
-
|
|
147
|
-
selectedTools: string[] | null;
|
|
145
|
+
headers: Record<string, string> | null;
|
|
148
146
|
toolPolicies: Record<string, {
|
|
149
147
|
needsApproval?: boolean;
|
|
150
148
|
}> | null;
|
|
149
|
+
subAgentId: string;
|
|
150
|
+
selectedTools: string[] | null;
|
|
151
151
|
}>;
|
|
152
152
|
/**
|
|
153
153
|
* Upsert agent-tool relation (create if it doesn't exist, update if it does)
|
|
@@ -163,19 +163,19 @@ declare const upsertSubAgentToolRelation: (db: DatabaseClient) => (params: {
|
|
|
163
163
|
}> | null;
|
|
164
164
|
relationId?: string;
|
|
165
165
|
}) => Promise<{
|
|
166
|
-
id: string;
|
|
167
|
-
createdAt: string;
|
|
168
|
-
updatedAt: string;
|
|
169
|
-
headers: Record<string, string> | null;
|
|
170
166
|
tenantId: string;
|
|
171
167
|
projectId: string;
|
|
168
|
+
id: string;
|
|
172
169
|
agentId: string;
|
|
170
|
+
createdAt: string;
|
|
171
|
+
updatedAt: string;
|
|
173
172
|
toolId: string;
|
|
174
|
-
|
|
175
|
-
selectedTools: string[] | null;
|
|
173
|
+
headers: Record<string, string> | null;
|
|
176
174
|
toolPolicies: Record<string, {
|
|
177
175
|
needsApproval?: boolean;
|
|
178
176
|
}> | null;
|
|
177
|
+
subAgentId: string;
|
|
178
|
+
selectedTools: string[] | null;
|
|
179
179
|
}>;
|
|
180
180
|
/**
|
|
181
181
|
* Upsert a tool (create if it doesn't exist, update if it does)
|
|
@@ -183,19 +183,19 @@ declare const upsertSubAgentToolRelation: (db: DatabaseClient) => (params: {
|
|
|
183
183
|
declare const upsertTool: (db: DatabaseClient) => (params: {
|
|
184
184
|
data: ToolInsert;
|
|
185
185
|
}) => Promise<{
|
|
186
|
+
tenantId: string;
|
|
187
|
+
projectId: string;
|
|
186
188
|
id: string;
|
|
187
189
|
name: string;
|
|
188
|
-
createdAt: string;
|
|
189
|
-
updatedAt: string;
|
|
190
190
|
description: string | null;
|
|
191
|
-
headers: Record<string, string> | null;
|
|
192
|
-
tenantId: string;
|
|
193
|
-
projectId: string;
|
|
194
|
-
credentialReferenceId: string | null;
|
|
195
191
|
config: {
|
|
196
192
|
type: "mcp";
|
|
197
193
|
mcp: ToolMcpConfig;
|
|
198
194
|
};
|
|
195
|
+
credentialReferenceId: string | null;
|
|
196
|
+
createdAt: string;
|
|
197
|
+
updatedAt: string;
|
|
198
|
+
headers: Record<string, string> | null;
|
|
199
199
|
credentialScope: string;
|
|
200
200
|
imageUrl: string | null;
|
|
201
201
|
capabilities: ToolServerCapabilities | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { getLogger } from "./logger.js";
|
|
2
2
|
import { anthropic, createAnthropic } from "@ai-sdk/anthropic";
|
|
3
|
+
import { createAzure } from "@ai-sdk/azure";
|
|
3
4
|
import { createGateway, gateway } from "@ai-sdk/gateway";
|
|
4
5
|
import { createGoogleGenerativeAI, google } from "@ai-sdk/google";
|
|
5
6
|
import { createOpenAI, openai } from "@ai-sdk/openai";
|
|
@@ -25,6 +26,12 @@ var ModelFactory = class ModelFactory {
|
|
|
25
26
|
static createProvider(provider, config) {
|
|
26
27
|
switch (provider) {
|
|
27
28
|
case "anthropic": return createAnthropic(config);
|
|
29
|
+
case "azure":
|
|
30
|
+
if (!config.resourceName && !config.baseURL) {
|
|
31
|
+
const errorMessage = !!process.env.AZURE_OPENAI_API_KEY ? "Azure provider requires either resourceName or baseURL in provider options. Provide resourceName for standard Azure OpenAI, or baseURL for custom endpoints." : "Azure provider requires either resourceName or baseURL in provider options, and AZURE_OPENAI_API_KEY environment variable must be set. Provide resourceName for standard Azure OpenAI, or baseURL for custom endpoints.";
|
|
32
|
+
throw new Error(errorMessage);
|
|
33
|
+
}
|
|
34
|
+
return createAzure(config);
|
|
28
35
|
case "openai": return createOpenAI(config);
|
|
29
36
|
case "google": return createGoogleGenerativeAI(config);
|
|
30
37
|
case "openrouter": return createOpenRouter(config);
|
|
@@ -66,6 +73,8 @@ var ModelFactory = class ModelFactory {
|
|
|
66
73
|
const providerConfig = {};
|
|
67
74
|
if (providerOptions.baseUrl || providerOptions.baseURL) providerConfig.baseURL = providerOptions.baseUrl || providerOptions.baseURL;
|
|
68
75
|
if (providerOptions.headers) providerConfig.headers = providerOptions.headers;
|
|
76
|
+
if (providerOptions.resourceName) providerConfig.resourceName = providerOptions.resourceName;
|
|
77
|
+
if (providerOptions.apiVersion) providerConfig.apiVersion = providerOptions.apiVersion;
|
|
69
78
|
if (providerOptions.gateway) Object.assign(providerConfig, providerOptions.gateway);
|
|
70
79
|
if (providerOptions.nim) Object.assign(providerConfig, providerOptions.nim);
|
|
71
80
|
if (providerOptions.custom) Object.assign(providerConfig, providerOptions.custom);
|
|
@@ -88,7 +97,7 @@ var ModelFactory = class ModelFactory {
|
|
|
88
97
|
hasProviderOptions: !!modelSettings.providerOptions
|
|
89
98
|
}, "Creating language model from config");
|
|
90
99
|
const providerConfig = ModelFactory.extractProviderConfig(modelSettings.providerOptions);
|
|
91
|
-
if (Object.keys(providerConfig).length > 0) {
|
|
100
|
+
if (provider === "azure" || Object.keys(providerConfig).length > 0) {
|
|
92
101
|
logger.info({ config: providerConfig }, `Applying custom ${provider} provider configuration`);
|
|
93
102
|
return ModelFactory.createProvider(provider, providerConfig).languageModel(modelName);
|
|
94
103
|
}
|
|
@@ -108,6 +117,7 @@ var ModelFactory = class ModelFactory {
|
|
|
108
117
|
*/
|
|
109
118
|
static BUILT_IN_PROVIDERS = [
|
|
110
119
|
"anthropic",
|
|
120
|
+
"azure",
|
|
111
121
|
"openai",
|
|
112
122
|
"google",
|
|
113
123
|
"openrouter",
|
|
@@ -143,6 +153,8 @@ var ModelFactory = class ModelFactory {
|
|
|
143
153
|
"apiKey",
|
|
144
154
|
"baseURL",
|
|
145
155
|
"baseUrl",
|
|
156
|
+
"resourceName",
|
|
157
|
+
"apiVersion",
|
|
146
158
|
"maxDuration",
|
|
147
159
|
"headers",
|
|
148
160
|
"gateway",
|