@inkeep/agents-core 0.37.0 → 0.37.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-schema.d.ts +47 -1
- package/dist/auth/auth-schema.js +1 -1
- package/dist/auth/auth-validation-schemas.d.ts +35 -1
- package/dist/auth/auth-validation-schemas.js +18 -18
- package/dist/auth/auth.d.ts +23 -23
- package/dist/auth/auth.js +13 -5
- package/dist/auth/permissions.d.ts +9 -9
- package/dist/auth/permissions.js +1 -1
- package/dist/{auth-detection-CGqhPDnj.d.ts → auth-detection-7G0Dxt55.d.ts} +11 -0
- package/dist/{chunk-ICZLNCX7.js → chunk-3HACEHXF.js} +370 -71
- package/dist/{chunk-32YRH2S7.js → chunk-5QZSNATS.js} +63 -67
- package/dist/{chunk-SSRRHYU4.js → chunk-6CYQZ5KX.js} +4 -5
- package/dist/{chunk-SLQW43IV.js → chunk-BJLC7EI4.js} +4 -5
- package/dist/chunk-CMNLBV2A.js +39 -0
- package/dist/{chunk-NFYCSHD3.js → chunk-DEYPSEXR.js} +2 -1
- package/dist/chunk-GENLXHZ4.js +159 -0
- package/dist/{chunk-VMSYBWFH.js → chunk-JNBVHWXX.js} +7 -4
- package/dist/{chunk-TGESM3JG.js → chunk-MQMMFK2K.js} +14 -3
- package/dist/{chunk-Q5U2SVA6.js → chunk-RUTYLJB7.js} +11 -7
- package/dist/{chunk-VQXQOGJU.js → chunk-XHODTX4H.js} +313 -315
- package/dist/{chunk-MB2ZIPZS.js → chunk-YSFXXC6K.js} +5 -5
- package/dist/{chunk-SG75RA63.js → chunk-ZSYMSL55.js} +2 -2
- package/dist/{client-CnpNkGsH.d.ts → client-B3nwdklT.d.ts} +1 -1
- package/dist/client-exports.d.ts +10 -8
- package/dist/client-exports.js +126 -127
- package/dist/constants/schema-validation/index.js +1 -1
- package/dist/credential-stores/index.d.ts +4 -5
- package/dist/credential-stores/index.js +1 -1
- package/dist/db/schema.d.ts +3 -4
- package/dist/db/schema.js +2 -2
- package/dist/db/test-client.d.ts +4 -5
- package/dist/db/test-client.js +1 -1
- package/dist/index.d.ts +675 -558
- package/dist/index.js +297 -76
- package/dist/{schema-Cgkp_geg.d.ts → schema-BhYTubhP.d.ts} +24 -1
- package/dist/server-CHLmv-Jb.d.ts +127 -0
- package/dist/types/index.d.ts +34 -115
- package/dist/types/index.js +1 -1
- package/dist/{utility-C_tTZ7-k.d.ts → utility-5USfJ5Xd.d.ts} +588 -459
- package/dist/utils/schema-conversion.d.ts +1 -1
- package/dist/utils/schema-conversion.js +1 -1
- package/dist/validation/index.d.ts +131 -132
- package/dist/validation/index.js +2 -2
- package/drizzle/{0001_fair_malice.sql → 0001_calm_sheva_callister.sql} +1 -16
- package/drizzle/0002_puzzling_goblin_queen.sql +8 -0
- package/drizzle/0003_sweet_human_robot.sql +8 -0
- package/drizzle/meta/0001_snapshot.json +7 -1
- package/drizzle/meta/0002_snapshot.json +3637 -0
- package/drizzle/meta/0003_snapshot.json +3643 -0
- package/drizzle/meta/_journal.json +16 -2
- package/package.json +11 -3
- package/dist/chunk-CUM6BY2Y.js +0 -320
- package/dist/chunk-H2F72PDA.js +0 -15
- package/dist/chunk-NOPEANIU.js +0 -82
- package/dist/chunk-OUXC23J7.js +0 -12534
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { loadEnvironmentFiles, env } from './chunk-
|
|
1
|
+
import { loadEnvironmentFiles, env } from './chunk-RUTYLJB7.js';
|
|
2
2
|
import { getLogger } from './chunk-DN4B564Y.js';
|
|
3
3
|
import { CredentialStoreType, MCPTransportType } from './chunk-YFHT5M2R.js';
|
|
4
|
-
import {
|
|
4
|
+
import { z } from '@hono/zod-openapi';
|
|
5
5
|
import { customAlphabet } from 'nanoid';
|
|
6
6
|
import { scrypt, randomBytes, timingSafeEqual } from 'crypto';
|
|
7
7
|
import { promisify } from 'util';
|
|
@@ -14,6 +14,12 @@ import { CallToolResultSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
|
14
14
|
import { tool } from 'ai';
|
|
15
15
|
import { asyncExitHook, gracefulExit } from 'exit-hook';
|
|
16
16
|
import { match } from 'ts-pattern';
|
|
17
|
+
import { createAnthropic, anthropic } from '@ai-sdk/anthropic';
|
|
18
|
+
import { createGateway, gateway } from '@ai-sdk/gateway';
|
|
19
|
+
import { createGoogleGenerativeAI, google } from '@ai-sdk/google';
|
|
20
|
+
import { createOpenAI, openai } from '@ai-sdk/openai';
|
|
21
|
+
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
22
|
+
import { createOpenRouter, openrouter } from '@openrouter/ai-sdk-provider';
|
|
17
23
|
import * as jose from 'jose';
|
|
18
24
|
import { SignJWT, jwtVerify } from 'jose';
|
|
19
25
|
import { Composio } from '@composio/core';
|
|
@@ -47,14 +53,12 @@ var executionLimitsSharedDefaults = {
|
|
|
47
53
|
// Increased from 4,000 to 8,000 to accommodate tool results in conversation history.
|
|
48
54
|
CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT: 8e3
|
|
49
55
|
};
|
|
50
|
-
|
|
51
|
-
// src/constants/execution-limits-shared/index.ts
|
|
52
56
|
loadEnvironmentFiles();
|
|
53
|
-
var constantsSchema =
|
|
57
|
+
var constantsSchema = z.object(
|
|
54
58
|
Object.fromEntries(
|
|
55
59
|
Object.keys(executionLimitsSharedDefaults).map((key) => [
|
|
56
60
|
`AGENTS_${key}`,
|
|
57
|
-
|
|
61
|
+
z.coerce.number().optional()
|
|
58
62
|
])
|
|
59
63
|
)
|
|
60
64
|
);
|
|
@@ -179,11 +183,18 @@ function normalizeDateString(dateString) {
|
|
|
179
183
|
}
|
|
180
184
|
const pgTimestampPattern = /^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}(\.\d{1,3})?$/;
|
|
181
185
|
if (pgTimestampPattern.test(dateString)) {
|
|
182
|
-
return dateString.replace(" ", "T")
|
|
186
|
+
return `${dateString.replace(" ", "T")}Z`;
|
|
183
187
|
}
|
|
184
188
|
return dateString;
|
|
185
189
|
}
|
|
186
|
-
|
|
190
|
+
function toISODateString(dateValue) {
|
|
191
|
+
if (typeof dateValue === "string") {
|
|
192
|
+
const normalized = normalizeDateString(dateValue);
|
|
193
|
+
return typeof normalized === "string" ? normalized : normalized.toISOString();
|
|
194
|
+
}
|
|
195
|
+
return dateValue.toISOString();
|
|
196
|
+
}
|
|
197
|
+
var ErrorCode = z.enum([
|
|
187
198
|
"bad_request",
|
|
188
199
|
"unauthorized",
|
|
189
200
|
"forbidden",
|
|
@@ -202,28 +213,28 @@ var errorCodeToHttpStatus = {
|
|
|
202
213
|
internal_server_error: 500
|
|
203
214
|
};
|
|
204
215
|
var ERROR_DOCS_BASE_URL = "https://docs.inkeep.com/agents-api/errors";
|
|
205
|
-
var problemDetailsSchema =
|
|
216
|
+
var problemDetailsSchema = z.object({
|
|
206
217
|
// type: z.string().url().openapi({
|
|
207
218
|
// description: "A URI reference that identifies the problem type.",
|
|
208
219
|
// example: `${ERROR_DOCS_BASE_URL}#not-found`,
|
|
209
220
|
// }),
|
|
210
|
-
title:
|
|
221
|
+
title: z.string().openapi({
|
|
211
222
|
description: "A short, human-readable summary of the problem type.",
|
|
212
223
|
example: "Resource Not Found"
|
|
213
224
|
}),
|
|
214
|
-
status:
|
|
225
|
+
status: z.number().int().openapi({
|
|
215
226
|
description: "The HTTP status code.",
|
|
216
227
|
example: 404
|
|
217
228
|
}),
|
|
218
|
-
detail:
|
|
229
|
+
detail: z.string().openapi({
|
|
219
230
|
description: "A human-readable explanation specific to this occurrence of the problem.",
|
|
220
231
|
example: "The requested resource was not found."
|
|
221
232
|
}),
|
|
222
|
-
instance:
|
|
233
|
+
instance: z.string().optional().openapi({
|
|
223
234
|
description: "A URI reference that identifies the specific occurrence of the problem.",
|
|
224
235
|
example: "/conversations/123"
|
|
225
236
|
}),
|
|
226
|
-
requestId:
|
|
237
|
+
requestId: z.string().optional().openapi({
|
|
227
238
|
description: "A unique identifier for the request, useful for troubleshooting.",
|
|
228
239
|
example: "req_1234567890"
|
|
229
240
|
}),
|
|
@@ -232,13 +243,13 @@ var problemDetailsSchema = external_exports.object({
|
|
|
232
243
|
example: "not_found"
|
|
233
244
|
})
|
|
234
245
|
}).openapi("ProblemDetails");
|
|
235
|
-
var errorResponseSchema =
|
|
236
|
-
error:
|
|
246
|
+
var errorResponseSchema = z.object({
|
|
247
|
+
error: z.object({
|
|
237
248
|
code: ErrorCode.openapi({
|
|
238
249
|
description: "A short code indicating the error code returned.",
|
|
239
250
|
example: "not_found"
|
|
240
251
|
}),
|
|
241
|
-
message:
|
|
252
|
+
message: z.string().openapi({
|
|
242
253
|
description: "A human readable error message.",
|
|
243
254
|
example: "The requested resource was not found."
|
|
244
255
|
})
|
|
@@ -248,7 +259,8 @@ function createApiError({
|
|
|
248
259
|
code,
|
|
249
260
|
message,
|
|
250
261
|
instance,
|
|
251
|
-
requestId
|
|
262
|
+
requestId,
|
|
263
|
+
extensions
|
|
252
264
|
}) {
|
|
253
265
|
const status = errorCodeToHttpStatus[code];
|
|
254
266
|
const title = getTitleFromCode(code);
|
|
@@ -263,7 +275,8 @@ function createApiError({
|
|
|
263
275
|
const errorMessage = message.length > 100 ? `${message.substring(0, 97)}...` : message;
|
|
264
276
|
const responseBody = {
|
|
265
277
|
...problemDetails,
|
|
266
|
-
error: { code, message: errorMessage }
|
|
278
|
+
error: { code, message: errorMessage },
|
|
279
|
+
...extensions && extensions
|
|
267
280
|
};
|
|
268
281
|
const res = new Response(JSON.stringify(responseBody), {
|
|
269
282
|
status,
|
|
@@ -376,15 +389,15 @@ var errorSchemaFactory = (code, description) => ({
|
|
|
376
389
|
content: {
|
|
377
390
|
"application/problem+json": {
|
|
378
391
|
schema: problemDetailsSchema.extend({
|
|
379
|
-
code:
|
|
392
|
+
code: z.literal(code).openapi({
|
|
380
393
|
description: "A short code indicating the error code returned.",
|
|
381
394
|
example: code
|
|
382
395
|
}),
|
|
383
|
-
detail:
|
|
396
|
+
detail: z.string().openapi({
|
|
384
397
|
description: "A detailed explanation specific to this occurrence of the problem, providing context and specifics about what went wrong.",
|
|
385
398
|
example: description
|
|
386
399
|
}),
|
|
387
|
-
title:
|
|
400
|
+
title: z.string().openapi({
|
|
388
401
|
description: "A short, human-readable summary of the problem type.",
|
|
389
402
|
example: getTitleFromCode(code)
|
|
390
403
|
}),
|
|
@@ -392,16 +405,16 @@ var errorSchemaFactory = (code, description) => ({
|
|
|
392
405
|
// description: "A URI reference that identifies the problem type.",
|
|
393
406
|
// example: `${ERROR_DOCS_BASE_URL}#${code}`,
|
|
394
407
|
// }),
|
|
395
|
-
status:
|
|
408
|
+
status: z.number().int().openapi({
|
|
396
409
|
description: "The HTTP status code.",
|
|
397
410
|
example: errorCodeToHttpStatus[code]
|
|
398
411
|
}),
|
|
399
|
-
error:
|
|
400
|
-
code:
|
|
412
|
+
error: z.object({
|
|
413
|
+
code: z.literal(code).openapi({
|
|
401
414
|
description: "A short code indicating the error code returned.",
|
|
402
415
|
example: code
|
|
403
416
|
}),
|
|
404
|
-
message:
|
|
417
|
+
message: z.string().openapi({
|
|
405
418
|
description: "A concise error message suitable for display to end users. May be truncated if the full detail is long.",
|
|
406
419
|
example: description.length > 100 ? `${description.substring(0, 97)}...` : description
|
|
407
420
|
})
|
|
@@ -462,6 +475,28 @@ function getRequestExecutionContext(c) {
|
|
|
462
475
|
}
|
|
463
476
|
return executionContext;
|
|
464
477
|
}
|
|
478
|
+
|
|
479
|
+
// src/utils/format-messages.ts
|
|
480
|
+
function formatMessagesForLLM(messages) {
|
|
481
|
+
return messages.map((message) => {
|
|
482
|
+
const role = message.role === "user" ? "user" : message.role === "agent" ? "assistant" : "system";
|
|
483
|
+
const content = typeof message.content === "object" && message.content && "text" in message.content ? message.content.text : String(message.content || "");
|
|
484
|
+
return {
|
|
485
|
+
role,
|
|
486
|
+
content,
|
|
487
|
+
timestamp: message.createdAt,
|
|
488
|
+
fromSubAgentId: message.fromSubAgentId
|
|
489
|
+
};
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
function formatMessagesForLLMContext(messages) {
|
|
493
|
+
const formattedMessages = formatMessagesForLLM(messages);
|
|
494
|
+
return formattedMessages.map((msg) => {
|
|
495
|
+
const roleLabel = msg.role === "user" ? "User" : msg.role === "assistant" ? "Agent" : "System";
|
|
496
|
+
const agentInfo = msg.fromSubAgentId ? ` (${msg.fromSubAgentId})` : "";
|
|
497
|
+
return `${roleLabel}${agentInfo}: ${msg.content}`;
|
|
498
|
+
}).join("\n\n");
|
|
499
|
+
}
|
|
465
500
|
var McpClient = class {
|
|
466
501
|
name;
|
|
467
502
|
client;
|
|
@@ -579,7 +614,7 @@ var McpClient = class {
|
|
|
579
614
|
try {
|
|
580
615
|
const createZodSchema = (inputSchema) => {
|
|
581
616
|
if (!inputSchema || !inputSchema.properties) {
|
|
582
|
-
return
|
|
617
|
+
return z.object({});
|
|
583
618
|
}
|
|
584
619
|
const zodProperties = {};
|
|
585
620
|
for (const [key, prop] of Object.entries(inputSchema.properties)) {
|
|
@@ -587,19 +622,22 @@ var McpClient = class {
|
|
|
587
622
|
let zodType;
|
|
588
623
|
switch (propDef.type) {
|
|
589
624
|
case "string":
|
|
590
|
-
zodType =
|
|
625
|
+
zodType = z.string();
|
|
591
626
|
break;
|
|
592
627
|
case "number":
|
|
593
|
-
zodType =
|
|
628
|
+
zodType = z.number();
|
|
594
629
|
break;
|
|
595
630
|
case "boolean":
|
|
596
|
-
zodType =
|
|
631
|
+
zodType = z.boolean();
|
|
597
632
|
break;
|
|
598
633
|
case "array":
|
|
599
|
-
zodType =
|
|
634
|
+
zodType = z.array(z.any());
|
|
635
|
+
break;
|
|
636
|
+
case "object":
|
|
637
|
+
zodType = createZodSchema(propDef);
|
|
600
638
|
break;
|
|
601
639
|
default:
|
|
602
|
-
zodType =
|
|
640
|
+
zodType = z.any();
|
|
603
641
|
}
|
|
604
642
|
if (propDef.description) {
|
|
605
643
|
zodType = zodType.describe(propDef.description);
|
|
@@ -610,7 +648,7 @@ var McpClient = class {
|
|
|
610
648
|
}
|
|
611
649
|
zodProperties[key] = zodType;
|
|
612
650
|
}
|
|
613
|
-
return
|
|
651
|
+
return z.object(zodProperties);
|
|
614
652
|
};
|
|
615
653
|
const schema = createZodSchema(def.inputSchema);
|
|
616
654
|
const createdTool = tool({
|
|
@@ -636,7 +674,268 @@ var McpClient = class {
|
|
|
636
674
|
return results;
|
|
637
675
|
}
|
|
638
676
|
};
|
|
639
|
-
var logger2 = getLogger("
|
|
677
|
+
var logger2 = getLogger("ModelFactory");
|
|
678
|
+
var nimDefault = createOpenAICompatible({
|
|
679
|
+
name: "nim",
|
|
680
|
+
baseURL: "https://integrate.api.nvidia.com/v1",
|
|
681
|
+
headers: {
|
|
682
|
+
Authorization: `Bearer ${process.env.NIM_API_KEY}`
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
var ModelFactory = class _ModelFactory {
|
|
686
|
+
/**
|
|
687
|
+
* Create a provider instance with custom configuration
|
|
688
|
+
*/
|
|
689
|
+
static createProvider(provider, config) {
|
|
690
|
+
switch (provider) {
|
|
691
|
+
case "anthropic":
|
|
692
|
+
return createAnthropic(config);
|
|
693
|
+
case "openai":
|
|
694
|
+
return createOpenAI(config);
|
|
695
|
+
case "google":
|
|
696
|
+
return createGoogleGenerativeAI(config);
|
|
697
|
+
case "openrouter":
|
|
698
|
+
return {
|
|
699
|
+
...createOpenRouter(config),
|
|
700
|
+
textEmbeddingModel: () => {
|
|
701
|
+
throw new Error("OpenRouter does not support text embeddings");
|
|
702
|
+
},
|
|
703
|
+
imageModel: () => {
|
|
704
|
+
throw new Error("OpenRouter does not support image generation");
|
|
705
|
+
}
|
|
706
|
+
};
|
|
707
|
+
case "gateway":
|
|
708
|
+
return createGateway(config);
|
|
709
|
+
case "nim": {
|
|
710
|
+
const nimConfig = {
|
|
711
|
+
name: "nim",
|
|
712
|
+
baseURL: "https://integrate.api.nvidia.com/v1",
|
|
713
|
+
headers: {
|
|
714
|
+
Authorization: `Bearer ${process.env.NIM_API_KEY}`
|
|
715
|
+
},
|
|
716
|
+
...config
|
|
717
|
+
};
|
|
718
|
+
return createOpenAICompatible(nimConfig);
|
|
719
|
+
}
|
|
720
|
+
case "custom": {
|
|
721
|
+
if (!config.baseURL && !config.baseUrl) {
|
|
722
|
+
throw new Error(
|
|
723
|
+
"Custom provider requires baseURL. Please provide it in providerOptions.baseURL or providerOptions.baseUrl"
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
const customConfig = {
|
|
727
|
+
name: "custom",
|
|
728
|
+
baseURL: config.baseURL || config.baseUrl,
|
|
729
|
+
headers: {
|
|
730
|
+
...process.env.CUSTOM_LLM_API_KEY && {
|
|
731
|
+
Authorization: `Bearer ${process.env.CUSTOM_LLM_API_KEY}`
|
|
732
|
+
},
|
|
733
|
+
...config.headers || {}
|
|
734
|
+
},
|
|
735
|
+
...config
|
|
736
|
+
};
|
|
737
|
+
logger2.info(
|
|
738
|
+
{
|
|
739
|
+
config: {
|
|
740
|
+
baseURL: customConfig.baseURL,
|
|
741
|
+
hasApiKey: !!process.env.CUSTOM_LLM_API_KEY,
|
|
742
|
+
apiKeyPrefix: `${process.env.CUSTOM_LLM_API_KEY?.substring(0, 10)}...`,
|
|
743
|
+
headers: Object.keys(customConfig.headers || {})
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"Creating custom OpenAI-compatible provider"
|
|
747
|
+
);
|
|
748
|
+
return createOpenAICompatible(customConfig);
|
|
749
|
+
}
|
|
750
|
+
default:
|
|
751
|
+
throw new Error(`Unsupported provider: ${provider}`);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
/**
|
|
755
|
+
* Extract provider configuration from providerOptions
|
|
756
|
+
* Only includes settings that go to the provider constructor (baseURL, apiKey, etc.)
|
|
757
|
+
*/
|
|
758
|
+
static extractProviderConfig(providerOptions) {
|
|
759
|
+
if (!providerOptions) {
|
|
760
|
+
return {};
|
|
761
|
+
}
|
|
762
|
+
const providerConfig = {};
|
|
763
|
+
if (providerOptions.baseUrl || providerOptions.baseURL) {
|
|
764
|
+
providerConfig.baseURL = providerOptions.baseUrl || providerOptions.baseURL;
|
|
765
|
+
}
|
|
766
|
+
if (providerOptions.headers) {
|
|
767
|
+
providerConfig.headers = providerOptions.headers;
|
|
768
|
+
}
|
|
769
|
+
if (providerOptions.gateway) {
|
|
770
|
+
Object.assign(providerConfig, providerOptions.gateway);
|
|
771
|
+
}
|
|
772
|
+
if (providerOptions.nim) {
|
|
773
|
+
Object.assign(providerConfig, providerOptions.nim);
|
|
774
|
+
}
|
|
775
|
+
if (providerOptions.custom) {
|
|
776
|
+
Object.assign(providerConfig, providerOptions.custom);
|
|
777
|
+
}
|
|
778
|
+
return providerConfig;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Create a language model instance from configuration
|
|
782
|
+
* Throws error if no config provided - models must be configured at project level
|
|
783
|
+
*/
|
|
784
|
+
static createModel(config) {
|
|
785
|
+
if (!config?.model?.trim()) {
|
|
786
|
+
throw new Error(
|
|
787
|
+
"Model configuration is required. Please configure models at the project level."
|
|
788
|
+
);
|
|
789
|
+
}
|
|
790
|
+
const modelSettings = config;
|
|
791
|
+
if (!modelSettings.model) {
|
|
792
|
+
throw new Error("Model configuration is required");
|
|
793
|
+
}
|
|
794
|
+
const modelString = modelSettings.model.trim();
|
|
795
|
+
const { provider, modelName } = _ModelFactory.parseModelString(modelString);
|
|
796
|
+
logger2.debug(
|
|
797
|
+
{
|
|
798
|
+
provider,
|
|
799
|
+
model: modelName,
|
|
800
|
+
fullModelString: modelSettings.model,
|
|
801
|
+
hasProviderOptions: !!modelSettings.providerOptions
|
|
802
|
+
},
|
|
803
|
+
"Creating language model from config"
|
|
804
|
+
);
|
|
805
|
+
const providerConfig = _ModelFactory.extractProviderConfig(modelSettings.providerOptions);
|
|
806
|
+
if (Object.keys(providerConfig).length > 0) {
|
|
807
|
+
logger2.info({ config: providerConfig }, `Applying custom ${provider} provider configuration`);
|
|
808
|
+
const customProvider = _ModelFactory.createProvider(provider, providerConfig);
|
|
809
|
+
return customProvider.languageModel(modelName);
|
|
810
|
+
}
|
|
811
|
+
switch (provider) {
|
|
812
|
+
case "anthropic":
|
|
813
|
+
return anthropic(modelName);
|
|
814
|
+
case "openai":
|
|
815
|
+
return openai(modelName);
|
|
816
|
+
case "google":
|
|
817
|
+
return google(modelName);
|
|
818
|
+
case "openrouter":
|
|
819
|
+
return openrouter(modelName);
|
|
820
|
+
case "gateway":
|
|
821
|
+
return gateway(modelName);
|
|
822
|
+
case "nim":
|
|
823
|
+
return nimDefault(modelName);
|
|
824
|
+
case "custom":
|
|
825
|
+
throw new Error(
|
|
826
|
+
"Custom provider requires configuration. Please provide baseURL in providerOptions.custom.baseURL or providerOptions.baseURL"
|
|
827
|
+
);
|
|
828
|
+
default:
|
|
829
|
+
throw new Error(
|
|
830
|
+
`Unsupported provider: ${provider}. Supported providers are: ${_ModelFactory.BUILT_IN_PROVIDERS.join(", ")}. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).`
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Built-in providers that have special handling
|
|
836
|
+
*/
|
|
837
|
+
static BUILT_IN_PROVIDERS = [
|
|
838
|
+
"anthropic",
|
|
839
|
+
"openai",
|
|
840
|
+
"google",
|
|
841
|
+
"openrouter",
|
|
842
|
+
"gateway",
|
|
843
|
+
"nim",
|
|
844
|
+
"custom"
|
|
845
|
+
];
|
|
846
|
+
/**
|
|
847
|
+
* Parse model string to extract provider and model name
|
|
848
|
+
* Examples: "anthropic/claude-sonnet-4" -> { provider: "anthropic", modelName: "claude-sonnet-4" }
|
|
849
|
+
* "openrouter/anthropic/claude-sonnet-4" -> { provider: "openrouter", modelName: "anthropic/claude-sonnet-4" }
|
|
850
|
+
* "claude-sonnet-4" -> { provider: "anthropic", modelName: "claude-sonnet-4" } (default to anthropic)
|
|
851
|
+
*/
|
|
852
|
+
static parseModelString(modelString) {
|
|
853
|
+
if (modelString.includes("/")) {
|
|
854
|
+
const [provider, ...modelParts] = modelString.split("/");
|
|
855
|
+
const normalizedProvider = provider.toLowerCase();
|
|
856
|
+
if (!_ModelFactory.BUILT_IN_PROVIDERS.includes(normalizedProvider)) {
|
|
857
|
+
throw new Error(
|
|
858
|
+
`Unsupported provider: ${normalizedProvider}. Supported providers are: ${_ModelFactory.BUILT_IN_PROVIDERS.join(", ")}. To access other models, use OpenRouter (openrouter/model-id), Vercel AI Gateway (gateway/model-id), NVIDIA NIM (nim/model-id), or Custom OpenAI-compatible (custom/model-id).`
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
return {
|
|
862
|
+
provider: normalizedProvider,
|
|
863
|
+
modelName: modelParts.join("/")
|
|
864
|
+
};
|
|
865
|
+
}
|
|
866
|
+
throw new Error(`No provider specified in model string: ${modelString}`);
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Get generation parameters from provider options
|
|
870
|
+
* These are parameters that get passed to generateText/streamText calls
|
|
871
|
+
*/
|
|
872
|
+
static getGenerationParams(providerOptions) {
|
|
873
|
+
if (!providerOptions) {
|
|
874
|
+
return {};
|
|
875
|
+
}
|
|
876
|
+
const excludedKeys = [
|
|
877
|
+
"apiKey",
|
|
878
|
+
"baseURL",
|
|
879
|
+
"baseUrl",
|
|
880
|
+
"maxDuration",
|
|
881
|
+
"headers",
|
|
882
|
+
"gateway",
|
|
883
|
+
"nim",
|
|
884
|
+
"custom"
|
|
885
|
+
];
|
|
886
|
+
const params = {};
|
|
887
|
+
for (const [key, value] of Object.entries(providerOptions)) {
|
|
888
|
+
if (!excludedKeys.includes(key) && value !== void 0) {
|
|
889
|
+
params[key] = value;
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
return params;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Prepare complete generation configuration from model settings
|
|
896
|
+
* Returns model instance and generation parameters ready to spread into generateText/streamText
|
|
897
|
+
* Includes maxDuration if specified in provider options (in seconds, following Vercel standard)
|
|
898
|
+
*/
|
|
899
|
+
static prepareGenerationConfig(modelSettings) {
|
|
900
|
+
const modelString = modelSettings?.model?.trim();
|
|
901
|
+
const model = _ModelFactory.createModel({
|
|
902
|
+
model: modelString,
|
|
903
|
+
providerOptions: modelSettings?.providerOptions
|
|
904
|
+
});
|
|
905
|
+
const generationParams = _ModelFactory.getGenerationParams(modelSettings?.providerOptions);
|
|
906
|
+
const maxDuration = modelSettings?.providerOptions?.maxDuration;
|
|
907
|
+
return {
|
|
908
|
+
model,
|
|
909
|
+
...generationParams,
|
|
910
|
+
...maxDuration !== void 0 && { maxDuration }
|
|
911
|
+
};
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Validate model settingsuration
|
|
915
|
+
* Basic validation only - let AI SDK handle parameter-specific validation
|
|
916
|
+
*/
|
|
917
|
+
static validateConfig(config) {
|
|
918
|
+
const errors = [];
|
|
919
|
+
if (!config.model) {
|
|
920
|
+
errors.push("Model name is required");
|
|
921
|
+
}
|
|
922
|
+
if (config.providerOptions) {
|
|
923
|
+
if (config.providerOptions.apiKey) {
|
|
924
|
+
errors.push(
|
|
925
|
+
"API keys should not be stored in provider options. Use environment variables (ANTHROPIC_API_KEY, OPENAI_API_KEY) or credential store instead."
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
if (config.providerOptions.maxDuration !== void 0) {
|
|
929
|
+
const maxDuration = config.providerOptions.maxDuration;
|
|
930
|
+
if (typeof maxDuration !== "number" || maxDuration <= 0) {
|
|
931
|
+
errors.push("maxDuration must be a positive number (in seconds)");
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
return errors;
|
|
936
|
+
}
|
|
937
|
+
};
|
|
938
|
+
var logger3 = getLogger("service-token-auth");
|
|
640
939
|
function getJwtSecret() {
|
|
641
940
|
const secret = env.INKEEP_AGENTS_JWT_SIGNING_SECRET;
|
|
642
941
|
const dev_secret = "insecure-dev-secret-change-in-production-min-32-chars";
|
|
@@ -646,7 +945,7 @@ function getJwtSecret() {
|
|
|
646
945
|
"INKEEP_AGENTS_JWT_SIGNING_SECRET environment variable is required in production"
|
|
647
946
|
);
|
|
648
947
|
}
|
|
649
|
-
|
|
948
|
+
logger3.warn(
|
|
650
949
|
{},
|
|
651
950
|
"INKEEP_AGENTS_JWT_SIGNING_SECRET not set, using insecure default. DO NOT USE IN PRODUCTION!"
|
|
652
951
|
);
|
|
@@ -661,7 +960,7 @@ async function generateServiceToken(params) {
|
|
|
661
960
|
tenantId: params.tenantId,
|
|
662
961
|
projectId: params.projectId
|
|
663
962
|
}).setProtectedHeader({ alg: "HS256", typ: "JWT" }).setIssuer("inkeep-agents").setSubject(params.originAgentId).setAudience(params.targetAgentId).setIssuedAt().setExpirationTime("5m").sign(secret);
|
|
664
|
-
|
|
963
|
+
logger3.debug(
|
|
665
964
|
{
|
|
666
965
|
originAgentId: params.originAgentId,
|
|
667
966
|
targetAgentId: params.targetAgentId,
|
|
@@ -671,7 +970,7 @@ async function generateServiceToken(params) {
|
|
|
671
970
|
);
|
|
672
971
|
return token;
|
|
673
972
|
} catch (error) {
|
|
674
|
-
|
|
973
|
+
logger3.error({ error }, "Failed to generate service token");
|
|
675
974
|
throw new Error("Failed to generate service token");
|
|
676
975
|
}
|
|
677
976
|
}
|
|
@@ -683,7 +982,7 @@ async function verifyServiceToken(token) {
|
|
|
683
982
|
algorithms: ["HS256"]
|
|
684
983
|
});
|
|
685
984
|
if (typeof payload.sub !== "string" || typeof payload.aud !== "string" || typeof payload.tenantId !== "string" || typeof payload.projectId !== "string") {
|
|
686
|
-
|
|
985
|
+
logger3.warn({ payload }, "Invalid service token: missing required claims");
|
|
687
986
|
return {
|
|
688
987
|
valid: false,
|
|
689
988
|
error: "Invalid token: missing required claims"
|
|
@@ -698,7 +997,7 @@ async function verifyServiceToken(token) {
|
|
|
698
997
|
iat: payload.iat,
|
|
699
998
|
exp: payload.exp
|
|
700
999
|
};
|
|
701
|
-
|
|
1000
|
+
logger3.debug(
|
|
702
1001
|
{
|
|
703
1002
|
originAgentId: validPayload.sub,
|
|
704
1003
|
targetAgentId: validPayload.aud,
|
|
@@ -712,13 +1011,13 @@ async function verifyServiceToken(token) {
|
|
|
712
1011
|
};
|
|
713
1012
|
} catch (error) {
|
|
714
1013
|
if (error instanceof Error) {
|
|
715
|
-
|
|
1014
|
+
logger3.warn({ error: error.message }, "Team agent token verification failed");
|
|
716
1015
|
return {
|
|
717
1016
|
valid: false,
|
|
718
1017
|
error: error.message
|
|
719
1018
|
};
|
|
720
1019
|
}
|
|
721
|
-
|
|
1020
|
+
logger3.warn({ error }, "Team agent token verification failed with unknown error");
|
|
722
1021
|
return {
|
|
723
1022
|
valid: false,
|
|
724
1023
|
error: "Token verification failed"
|
|
@@ -727,7 +1026,7 @@ async function verifyServiceToken(token) {
|
|
|
727
1026
|
}
|
|
728
1027
|
function validateTenantId(payload, expectedTenantId) {
|
|
729
1028
|
if (payload.tenantId !== expectedTenantId) {
|
|
730
|
-
|
|
1029
|
+
logger3.warn(
|
|
731
1030
|
{
|
|
732
1031
|
tokenTenantId: payload.tenantId,
|
|
733
1032
|
expectedTenantId,
|
|
@@ -742,7 +1041,7 @@ function validateTenantId(payload, expectedTenantId) {
|
|
|
742
1041
|
}
|
|
743
1042
|
function validateTargetAgent(payload, expectedTargetAgentId) {
|
|
744
1043
|
if (payload.aud !== expectedTargetAgentId) {
|
|
745
|
-
|
|
1044
|
+
logger3.warn(
|
|
746
1045
|
{
|
|
747
1046
|
tokenTargetAgentId: payload.aud,
|
|
748
1047
|
expectedTargetAgentId,
|
|
@@ -793,7 +1092,7 @@ async function verifyTempToken(publicKeyPem, token) {
|
|
|
793
1092
|
}
|
|
794
1093
|
return payload;
|
|
795
1094
|
}
|
|
796
|
-
var
|
|
1095
|
+
var logger4 = getLogger("composio-client");
|
|
797
1096
|
var TOOLKIT_TO_CATEGORY = {
|
|
798
1097
|
github: "development",
|
|
799
1098
|
gitlab: "development",
|
|
@@ -867,21 +1166,21 @@ function addUserIdToUrl(url, userId) {
|
|
|
867
1166
|
async function deleteComposioConnectedAccount(accountId) {
|
|
868
1167
|
const composioInstance = getComposioInstance();
|
|
869
1168
|
if (!composioInstance) {
|
|
870
|
-
|
|
1169
|
+
logger4.info({}, "Composio not configured, skipping account deletion");
|
|
871
1170
|
return false;
|
|
872
1171
|
}
|
|
873
1172
|
try {
|
|
874
1173
|
await composioInstance.connectedAccounts.delete(accountId);
|
|
875
1174
|
return true;
|
|
876
1175
|
} catch (error) {
|
|
877
|
-
|
|
1176
|
+
logger4.warn({ error }, "Error deleting Composio connected account");
|
|
878
1177
|
return false;
|
|
879
1178
|
}
|
|
880
1179
|
}
|
|
881
1180
|
async function fetchComposioConnectedAccounts(derivedUserId) {
|
|
882
1181
|
const composioInstance = getComposioInstance();
|
|
883
1182
|
if (!composioInstance) {
|
|
884
|
-
|
|
1183
|
+
logger4.info({}, "Composio not configured, skipping connected accounts fetch");
|
|
885
1184
|
return null;
|
|
886
1185
|
}
|
|
887
1186
|
try {
|
|
@@ -890,25 +1189,25 @@ async function fetchComposioConnectedAccounts(derivedUserId) {
|
|
|
890
1189
|
});
|
|
891
1190
|
return connectedAccounts;
|
|
892
1191
|
} catch (error) {
|
|
893
|
-
|
|
1192
|
+
logger4.error({ error }, "Error fetching Composio connected accounts");
|
|
894
1193
|
return null;
|
|
895
1194
|
}
|
|
896
1195
|
}
|
|
897
1196
|
async function isComposioMCPServerAuthenticated(tenantId, projectId, mcpServerUrl) {
|
|
898
1197
|
const composioApiKey = process.env.COMPOSIO_API_KEY;
|
|
899
1198
|
if (!composioApiKey) {
|
|
900
|
-
|
|
1199
|
+
logger4.info({}, "Composio API key not configured, skipping auth check");
|
|
901
1200
|
return false;
|
|
902
1201
|
}
|
|
903
1202
|
const serverId = extractComposioServerId(mcpServerUrl);
|
|
904
1203
|
if (!serverId) {
|
|
905
|
-
|
|
1204
|
+
logger4.info({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
906
1205
|
return false;
|
|
907
1206
|
}
|
|
908
1207
|
const derivedUserId = deriveComposioUserId(tenantId, projectId);
|
|
909
1208
|
const composioInstance = getComposioInstance();
|
|
910
1209
|
if (!composioInstance) {
|
|
911
|
-
|
|
1210
|
+
logger4.info({}, "Composio not configured, skipping auth check");
|
|
912
1211
|
return false;
|
|
913
1212
|
}
|
|
914
1213
|
try {
|
|
@@ -926,7 +1225,7 @@ async function isComposioMCPServerAuthenticated(tenantId, projectId, mcpServerUr
|
|
|
926
1225
|
);
|
|
927
1226
|
return !!activeAccount;
|
|
928
1227
|
} catch (error) {
|
|
929
|
-
|
|
1228
|
+
logger4.error({ error, mcpServerUrl }, "Error checking Composio authentication status");
|
|
930
1229
|
return false;
|
|
931
1230
|
}
|
|
932
1231
|
}
|
|
@@ -950,7 +1249,7 @@ function transformComposioServerData(composioMcpServer, isAuthenticated, url, th
|
|
|
950
1249
|
async function ensureComposioAccount(composioMcpServer, derivedUserId, initiatedAccounts) {
|
|
951
1250
|
const firstAuthConfigId = composioMcpServer.authConfigIds[0];
|
|
952
1251
|
if (!firstAuthConfigId) {
|
|
953
|
-
|
|
1252
|
+
logger4.error({ serverId: composioMcpServer.id }, "No auth config ID found for MCP server");
|
|
954
1253
|
return null;
|
|
955
1254
|
}
|
|
956
1255
|
const existingInitiatedAccount = initiatedAccounts.find(
|
|
@@ -962,7 +1261,7 @@ async function ensureComposioAccount(composioMcpServer, derivedUserId, initiated
|
|
|
962
1261
|
try {
|
|
963
1262
|
const composioInstance = getComposioInstance();
|
|
964
1263
|
if (!composioInstance) {
|
|
965
|
-
|
|
1264
|
+
logger4.error({ serverId: composioMcpServer.id }, "Composio not configured");
|
|
966
1265
|
return null;
|
|
967
1266
|
}
|
|
968
1267
|
const createAccountResponse = await composioInstance.connectedAccounts.link(
|
|
@@ -971,7 +1270,7 @@ async function ensureComposioAccount(composioMcpServer, derivedUserId, initiated
|
|
|
971
1270
|
);
|
|
972
1271
|
return createAccountResponse.redirectUrl ?? null;
|
|
973
1272
|
} catch (error) {
|
|
974
|
-
|
|
1273
|
+
logger4.error(
|
|
975
1274
|
{ serverId: composioMcpServer.id, error },
|
|
976
1275
|
"Error creating connected account for MCP server"
|
|
977
1276
|
);
|
|
@@ -1008,13 +1307,13 @@ async function transformComposioServer(composioMcpServer, authenticatedAuthConfi
|
|
|
1008
1307
|
async function fetchComposioServers(tenantId, projectId) {
|
|
1009
1308
|
const composioApiKey = process.env.COMPOSIO_API_KEY;
|
|
1010
1309
|
if (!composioApiKey) {
|
|
1011
|
-
|
|
1310
|
+
logger4.info({}, "COMPOSIO_API_KEY not configured, skipping Composio servers");
|
|
1012
1311
|
return [];
|
|
1013
1312
|
}
|
|
1014
1313
|
const derivedUserId = deriveComposioUserId(tenantId, projectId);
|
|
1015
1314
|
const composioInstance = getComposioInstance();
|
|
1016
1315
|
if (!composioInstance) {
|
|
1017
|
-
|
|
1316
|
+
logger4.info({}, "Composio not configured, returning empty list");
|
|
1018
1317
|
return [];
|
|
1019
1318
|
}
|
|
1020
1319
|
try {
|
|
@@ -1051,26 +1350,26 @@ async function fetchComposioServers(tenantId, projectId) {
|
|
|
1051
1350
|
);
|
|
1052
1351
|
return validServers;
|
|
1053
1352
|
} catch (error) {
|
|
1054
|
-
|
|
1353
|
+
logger4.error({ error }, "Failed to fetch Composio servers");
|
|
1055
1354
|
return [];
|
|
1056
1355
|
}
|
|
1057
1356
|
}
|
|
1058
1357
|
async function fetchSingleComposioServer(tenantId, projectId, mcpServerUrl) {
|
|
1059
1358
|
const composioApiKey = process.env.COMPOSIO_API_KEY;
|
|
1060
1359
|
if (!composioApiKey) {
|
|
1061
|
-
|
|
1360
|
+
logger4.debug({}, "COMPOSIO_API_KEY not configured");
|
|
1062
1361
|
return null;
|
|
1063
1362
|
}
|
|
1064
1363
|
const derivedUserId = deriveComposioUserId(tenantId, projectId);
|
|
1065
1364
|
const composioInstance = getComposioInstance();
|
|
1066
1365
|
if (!composioInstance) {
|
|
1067
|
-
|
|
1366
|
+
logger4.info({}, "Composio not configured, returning null");
|
|
1068
1367
|
return null;
|
|
1069
1368
|
}
|
|
1070
1369
|
try {
|
|
1071
1370
|
const serverId = extractComposioServerId(mcpServerUrl);
|
|
1072
1371
|
if (!serverId) {
|
|
1073
|
-
|
|
1372
|
+
logger4.error({ mcpServerUrl }, "Could not extract Composio server ID from URL");
|
|
1074
1373
|
return null;
|
|
1075
1374
|
}
|
|
1076
1375
|
const composioMcpServer = await composioInstance.mcp.get(serverId);
|
|
@@ -1094,23 +1393,23 @@ async function fetchSingleComposioServer(tenantId, projectId, mcpServerUrl) {
|
|
|
1094
1393
|
);
|
|
1095
1394
|
return transformedServer;
|
|
1096
1395
|
} catch (error) {
|
|
1097
|
-
|
|
1396
|
+
logger4.error({ error, mcpServerUrl }, "Failed to fetch single Composio server");
|
|
1098
1397
|
return null;
|
|
1099
1398
|
}
|
|
1100
1399
|
}
|
|
1101
1400
|
|
|
1102
1401
|
// src/utils/third-party-mcp-servers/third-party-check.ts
|
|
1103
|
-
var
|
|
1402
|
+
var logger5 = getLogger("third-party-check");
|
|
1104
1403
|
async function isThirdPartyMCPServerAuthenticated(tenantId, projectId, mcpServerUrl) {
|
|
1105
1404
|
const composioServerId = extractComposioServerId(mcpServerUrl);
|
|
1106
1405
|
if (composioServerId) {
|
|
1107
|
-
|
|
1406
|
+
logger5.debug({ mcpServerUrl }, "Detected Composio MCP server, checking auth status");
|
|
1108
1407
|
return isComposioMCPServerAuthenticated(tenantId, projectId, mcpServerUrl);
|
|
1109
1408
|
}
|
|
1110
|
-
|
|
1409
|
+
logger5.info({ mcpServerUrl }, "Unknown third-party MCP server provider");
|
|
1111
1410
|
return false;
|
|
1112
1411
|
}
|
|
1113
|
-
var
|
|
1412
|
+
var logger6 = getLogger("tracer");
|
|
1114
1413
|
var createNoOpSpan = () => ({
|
|
1115
1414
|
setAttributes: () => ({}),
|
|
1116
1415
|
recordException: () => ({}),
|
|
@@ -1139,23 +1438,23 @@ var noopTracer = {
|
|
|
1139
1438
|
return createNoOpSpan();
|
|
1140
1439
|
}
|
|
1141
1440
|
};
|
|
1142
|
-
function setSpanWithError(span, error,
|
|
1441
|
+
function setSpanWithError(span, error, logger7, logMessage) {
|
|
1143
1442
|
span.recordException(error);
|
|
1144
1443
|
span.setStatus({
|
|
1145
1444
|
code: SpanStatusCode.ERROR,
|
|
1146
1445
|
message: error.message
|
|
1147
1446
|
});
|
|
1148
|
-
if (
|
|
1149
|
-
|
|
1447
|
+
if (logger7 && logMessage) {
|
|
1448
|
+
logger7.error({ error: error.message }, logMessage);
|
|
1150
1449
|
}
|
|
1151
1450
|
}
|
|
1152
1451
|
function getTracer(serviceName, serviceVersion) {
|
|
1153
1452
|
try {
|
|
1154
1453
|
return trace.getTracer(serviceName, serviceVersion);
|
|
1155
1454
|
} catch (_error) {
|
|
1156
|
-
|
|
1455
|
+
logger6.debug({}, "OpenTelemetry tracer not available, using no-op tracer");
|
|
1157
1456
|
return noopTracer;
|
|
1158
1457
|
}
|
|
1159
1458
|
}
|
|
1160
1459
|
|
|
1161
|
-
export { CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ERROR_DOCS_BASE_URL, ErrorCode, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, createExecutionContext, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, extractComposioServerId, extractPublicId, fetchComposioServers, fetchSingleComposioServer, generateApiKey, generateId, generateServiceToken, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getRequestExecutionContext, getTracer, handleApiError, hashApiKey, isApiKeyExpired, isComposioMCPServerAuthenticated, isThirdPartyMCPServerAuthenticated, maskApiKey, normalizeDateString, problemDetailsSchema, setSpanWithError, signTempToken, validateApiKey, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken, verifyTempToken };
|
|
1460
|
+
export { CONVERSATION_HISTORY_DEFAULT_LIMIT, CONVERSATION_HISTORY_MAX_OUTPUT_TOKENS_DEFAULT, ERROR_DOCS_BASE_URL, ErrorCode, MCP_TOOL_CONNECTION_TIMEOUT_MS, MCP_TOOL_INITIAL_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RECONNECTION_DELAY_MS, MCP_TOOL_MAX_RETRIES, MCP_TOOL_RECONNECTION_DELAY_GROWTH_FACTOR, McpClient, ModelFactory, commonCreateErrorResponses, commonDeleteErrorResponses, commonGetErrorResponses, commonUpdateErrorResponses, createApiError, createExecutionContext, errorResponseSchema, errorSchemaFactory, executionLimitsSharedDefaults, extractComposioServerId, extractPublicId, fetchComposioServers, fetchSingleComposioServer, formatMessagesForLLM, formatMessagesForLLMContext, generateApiKey, generateId, generateServiceToken, getConversationId, getCredentialStoreLookupKeyFromRetrievalParams, getRequestExecutionContext, getTracer, handleApiError, hashApiKey, isApiKeyExpired, isComposioMCPServerAuthenticated, isThirdPartyMCPServerAuthenticated, maskApiKey, normalizeDateString, problemDetailsSchema, setSpanWithError, signTempToken, toISODateString, validateApiKey, validateTargetAgent, validateTenantId, verifyAuthorizationHeader, verifyServiceToken, verifyTempToken };
|