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