@juspay/neurolink 7.49.0 → 7.51.0
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/CHANGELOG.md +13 -0
- package/README.md +12 -9
- package/dist/adapters/providerImageAdapter.js +82 -10
- package/dist/agent/directTools.d.ts +10 -10
- package/dist/agent/directTools.js +5 -3
- package/dist/cli/commands/config.js +1 -0
- package/dist/cli/commands/mcp.js +1 -0
- package/dist/cli/commands/models.js +1 -0
- package/dist/cli/commands/ollama.js +1 -0
- package/dist/cli/commands/setup-anthropic.js +1 -0
- package/dist/cli/commands/setup-azure.js +1 -0
- package/dist/cli/commands/setup-bedrock.js +1 -0
- package/dist/cli/commands/setup-gcp.js +1 -0
- package/dist/cli/commands/setup-google-ai.js +1 -0
- package/dist/cli/commands/setup-huggingface.js +1 -0
- package/dist/cli/commands/setup-mistral.js +1 -0
- package/dist/cli/commands/setup-openai.js +1 -0
- package/dist/cli/commands/setup.js +1 -0
- package/dist/cli/errorHandler.js +1 -0
- package/dist/cli/factories/commandFactory.d.ts +5 -0
- package/dist/cli/factories/commandFactory.js +42 -6
- package/dist/cli/factories/ollamaCommandFactory.js +1 -0
- package/dist/cli/factories/sagemakerCommandFactory.js +1 -0
- package/dist/cli/factories/setupCommandFactory.js +1 -0
- package/dist/cli/index.js +14 -2
- package/dist/cli/loop/conversationSelector.js +1 -0
- package/dist/cli/loop/optionsSchema.js +1 -0
- package/dist/cli/loop/session.js +1 -0
- package/dist/cli/parser.js +1 -0
- package/dist/cli/utils/completeSetup.js +1 -0
- package/dist/cli/utils/envManager.js +1 -0
- package/dist/cli/utils/interactiveSetup.js +1 -0
- package/dist/cli/utils/ollamaUtils.js +1 -0
- package/dist/constants/index.js +1 -1
- package/dist/core/baseProvider.d.ts +14 -0
- package/dist/core/baseProvider.js +106 -23
- package/dist/index.d.ts +11 -5
- package/dist/index.js +11 -10
- package/dist/lib/adapters/providerImageAdapter.js +83 -10
- package/dist/lib/agent/directTools.d.ts +10 -10
- package/dist/lib/agent/directTools.js +6 -3
- package/dist/lib/config/configManager.js +1 -0
- package/dist/lib/config/conversationMemory.js +1 -0
- package/dist/lib/config/taskClassificationConfig.js +1 -0
- package/dist/lib/constants/index.js +2 -1
- package/dist/lib/constants/performance.js +1 -0
- package/dist/lib/constants/retry.js +1 -0
- package/dist/lib/constants/timeouts.js +1 -0
- package/dist/lib/constants/tokens.js +1 -0
- package/dist/lib/core/analytics.js +1 -0
- package/dist/lib/core/baseProvider.d.ts +14 -0
- package/dist/lib/core/baseProvider.js +107 -23
- package/dist/lib/core/constants.js +1 -0
- package/dist/lib/core/conversationMemoryFactory.js +1 -0
- package/dist/lib/core/conversationMemoryInitializer.js +1 -0
- package/dist/lib/core/conversationMemoryManager.js +1 -0
- package/dist/lib/core/dynamicModels.js +1 -0
- package/dist/lib/core/evaluation.js +1 -0
- package/dist/lib/core/evaluationProviders.js +1 -0
- package/dist/lib/core/factory.js +1 -0
- package/dist/lib/core/modelConfiguration.js +1 -0
- package/dist/lib/core/redisConversationMemoryManager.js +1 -0
- package/dist/lib/core/serviceRegistry.js +1 -0
- package/dist/lib/core/streamAnalytics.js +1 -0
- package/dist/lib/evaluation/contextBuilder.js +1 -0
- package/dist/lib/evaluation/index.js +1 -0
- package/dist/lib/evaluation/prompts.js +1 -0
- package/dist/lib/evaluation/ragasEvaluator.js +1 -0
- package/dist/lib/evaluation/retryManager.js +1 -0
- package/dist/lib/evaluation/scoring.js +1 -0
- package/dist/lib/factories/providerFactory.js +1 -0
- package/dist/lib/factories/providerRegistry.js +1 -0
- package/dist/lib/hitl/hitlErrors.js +1 -0
- package/dist/lib/hitl/hitlManager.js +1 -0
- package/dist/lib/hitl/index.js +1 -0
- package/dist/lib/hitl/types.js +1 -0
- package/dist/lib/index.d.ts +11 -5
- package/dist/lib/index.js +12 -10
- package/dist/lib/mcp/externalServerManager.js +1 -0
- package/dist/lib/mcp/factory.js +1 -0
- package/dist/lib/mcp/flexibleToolValidator.js +1 -0
- package/dist/lib/mcp/index.js +1 -0
- package/dist/lib/mcp/mcpCircuitBreaker.js +1 -0
- package/dist/lib/mcp/mcpClientFactory.js +2 -1
- package/dist/lib/mcp/registry.js +1 -0
- package/dist/lib/mcp/servers/agent/directToolsServer.js +2 -0
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +1 -0
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.js +1 -0
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +1 -0
- package/dist/lib/mcp/servers/utilities/utilityServer.js +1 -0
- package/dist/lib/mcp/toolDiscoveryService.js +1 -0
- package/dist/lib/mcp/toolRegistry.js +1 -0
- package/dist/lib/memory/mem0Initializer.js +1 -0
- package/dist/lib/middleware/builtin/analytics.js +1 -0
- package/dist/lib/middleware/builtin/autoEvaluation.js +1 -0
- package/dist/lib/middleware/builtin/guardrails.js +1 -0
- package/dist/lib/middleware/factory.js +1 -0
- package/dist/lib/middleware/index.js +1 -0
- package/dist/lib/middleware/registry.js +1 -0
- package/dist/lib/middleware/utils/guardrailsUtils.js +1 -0
- package/dist/lib/models/modelRegistry.js +1 -0
- package/dist/lib/models/modelResolver.js +2 -0
- package/dist/lib/neurolink.d.ts +41 -6
- package/dist/lib/neurolink.js +276 -5
- package/dist/lib/providers/amazonBedrock.d.ts +1 -0
- package/dist/lib/providers/amazonBedrock.js +166 -14
- package/dist/lib/providers/amazonSagemaker.js +1 -0
- package/dist/lib/providers/anthropic.js +8 -21
- package/dist/lib/providers/anthropicBaseProvider.js +1 -0
- package/dist/lib/providers/azureOpenai.js +6 -21
- package/dist/lib/providers/googleAiStudio.js +6 -21
- package/dist/lib/providers/googleVertex.js +9 -1
- package/dist/lib/providers/huggingFace.js +34 -3
- package/dist/lib/providers/index.js +1 -0
- package/dist/lib/providers/litellm.js +34 -3
- package/dist/lib/providers/mistral.js +32 -2
- package/dist/lib/providers/ollama.d.ts +37 -1
- package/dist/lib/providers/ollama.js +544 -58
- package/dist/lib/providers/openAI.js +6 -21
- package/dist/lib/providers/openaiCompatible.js +41 -4
- package/dist/lib/providers/sagemaker/adaptive-semaphore.js +1 -0
- package/dist/lib/providers/sagemaker/client.js +1 -0
- package/dist/lib/providers/sagemaker/config.js +1 -0
- package/dist/lib/providers/sagemaker/detection.js +1 -0
- package/dist/lib/providers/sagemaker/diagnostics.js +1 -0
- package/dist/lib/providers/sagemaker/error-constants.js +1 -0
- package/dist/lib/providers/sagemaker/errors.js +1 -0
- package/dist/lib/providers/sagemaker/index.js +1 -0
- package/dist/lib/providers/sagemaker/language-model.js +1 -0
- package/dist/lib/providers/sagemaker/parsers.js +1 -0
- package/dist/lib/providers/sagemaker/streaming.js +1 -0
- package/dist/lib/providers/sagemaker/structured-parser.js +1 -0
- package/dist/lib/proxy/awsProxyIntegration.js +1 -0
- package/dist/lib/proxy/proxyFetch.js +1 -0
- package/dist/lib/proxy/utils/noProxyUtils.js +1 -0
- package/dist/lib/sdk/toolRegistration.js +2 -0
- package/dist/lib/services/server/ai/observability/instrumentation.d.ts +57 -0
- package/dist/lib/services/server/ai/observability/instrumentation.js +171 -0
- package/dist/lib/session/globalSessionState.js +38 -1
- package/dist/lib/telemetry/index.d.ts +1 -0
- package/dist/lib/telemetry/index.js +1 -0
- package/dist/lib/telemetry/telemetryService.d.ts +2 -0
- package/dist/lib/telemetry/telemetryService.js +8 -7
- package/dist/lib/types/analytics.js +1 -0
- package/dist/lib/types/cli.js +1 -0
- package/dist/lib/types/common.js +1 -0
- package/dist/lib/types/configTypes.js +1 -0
- package/dist/lib/types/content.d.ts +14 -1
- package/dist/lib/types/content.js +1 -0
- package/dist/lib/types/contextTypes.js +1 -0
- package/dist/lib/types/conversation.d.ts +2 -0
- package/dist/lib/types/conversation.js +1 -0
- package/dist/lib/types/domainTypes.js +1 -0
- package/dist/lib/types/errors.js +1 -0
- package/dist/lib/types/evaluation.js +1 -0
- package/dist/lib/types/evaluationProviders.js +1 -0
- package/dist/lib/types/evaluationTypes.js +1 -0
- package/dist/lib/types/externalMcp.js +1 -0
- package/dist/lib/types/fileTypes.d.ts +44 -0
- package/dist/lib/types/fileTypes.js +1 -0
- package/dist/lib/types/generateTypes.d.ts +1 -0
- package/dist/lib/types/generateTypes.js +1 -0
- package/dist/lib/types/guardrails.js +1 -0
- package/dist/lib/types/index.js +1 -0
- package/dist/lib/types/mcpTypes.js +1 -0
- package/dist/lib/types/middlewareTypes.js +1 -0
- package/dist/lib/types/modelTypes.d.ts +6 -6
- package/dist/lib/types/modelTypes.js +1 -0
- package/dist/lib/types/observability.d.ts +49 -0
- package/dist/lib/types/observability.js +7 -0
- package/dist/lib/types/providers.d.ts +44 -0
- package/dist/lib/types/providers.js +1 -0
- package/dist/lib/types/sdkTypes.js +1 -0
- package/dist/lib/types/serviceTypes.js +1 -0
- package/dist/lib/types/streamTypes.d.ts +1 -0
- package/dist/lib/types/streamTypes.js +1 -0
- package/dist/lib/types/taskClassificationTypes.js +1 -0
- package/dist/lib/types/tools.js +2 -0
- package/dist/lib/types/typeAliases.js +1 -0
- package/dist/lib/types/universalProviderOptions.js +1 -0
- package/dist/lib/utils/analyticsUtils.js +1 -0
- package/dist/lib/utils/conversationMemory.js +1 -0
- package/dist/lib/utils/conversationMemoryUtils.js +1 -0
- package/dist/lib/utils/csvProcessor.js +1 -0
- package/dist/lib/utils/errorHandling.js +1 -0
- package/dist/lib/utils/evaluationUtils.js +1 -0
- package/dist/lib/utils/factoryProcessing.js +1 -0
- package/dist/lib/utils/fileDetector.js +7 -3
- package/dist/lib/utils/imageProcessor.js +1 -0
- package/dist/lib/utils/logger.js +1 -0
- package/dist/lib/utils/loopUtils.js +1 -0
- package/dist/lib/utils/mcpDefaults.js +1 -0
- package/dist/lib/utils/messageBuilder.js +96 -9
- package/dist/lib/utils/modelRouter.js +1 -0
- package/dist/lib/utils/multimodalOptionsBuilder.d.ts +67 -0
- package/dist/lib/utils/multimodalOptionsBuilder.js +65 -0
- package/dist/lib/utils/optionsConversion.js +1 -0
- package/dist/lib/utils/optionsUtils.js +1 -0
- package/dist/lib/utils/parameterValidation.js +1 -0
- package/dist/lib/utils/pdfProcessor.d.ts +10 -0
- package/dist/lib/utils/pdfProcessor.js +199 -0
- package/dist/lib/utils/performance.js +1 -0
- package/dist/lib/utils/promptRedaction.js +1 -0
- package/dist/lib/utils/providerConfig.js +1 -0
- package/dist/lib/utils/providerHealth.js +1 -0
- package/dist/lib/utils/providerSetupMessages.js +1 -0
- package/dist/lib/utils/providerUtils.js +1 -0
- package/dist/lib/utils/redis.js +1 -0
- package/dist/lib/utils/retryHandler.js +1 -0
- package/dist/lib/utils/schemaConversion.js +1 -0
- package/dist/lib/utils/taskClassificationUtils.js +1 -0
- package/dist/lib/utils/taskClassifier.js +1 -0
- package/dist/lib/utils/timeout.js +1 -0
- package/dist/lib/utils/tokenLimits.js +1 -0
- package/dist/lib/utils/toolUtils.js +1 -0
- package/dist/lib/utils/transformationUtils.js +1 -0
- package/dist/lib/utils/typeUtils.js +1 -0
- package/dist/mcp/mcpClientFactory.js +1 -1
- package/dist/mcp/servers/agent/directToolsServer.js +1 -0
- package/dist/models/modelResolver.js +1 -0
- package/dist/neurolink.d.ts +41 -6
- package/dist/neurolink.js +275 -5
- package/dist/providers/amazonBedrock.d.ts +1 -0
- package/dist/providers/amazonBedrock.js +165 -14
- package/dist/providers/anthropic.js +7 -21
- package/dist/providers/azureOpenai.js +5 -21
- package/dist/providers/googleAiStudio.js +5 -21
- package/dist/providers/googleVertex.js +8 -1
- package/dist/providers/huggingFace.js +33 -3
- package/dist/providers/litellm.js +33 -3
- package/dist/providers/mistral.js +31 -2
- package/dist/providers/ollama.d.ts +37 -1
- package/dist/providers/ollama.js +543 -58
- package/dist/providers/openAI.js +5 -21
- package/dist/providers/openaiCompatible.js +40 -4
- package/dist/sdk/toolRegistration.js +1 -0
- package/dist/services/server/ai/observability/instrumentation.d.ts +57 -0
- package/dist/services/server/ai/observability/instrumentation.js +170 -0
- package/dist/session/globalSessionState.js +37 -1
- package/dist/telemetry/index.d.ts +1 -0
- package/dist/telemetry/telemetryService.d.ts +2 -0
- package/dist/telemetry/telemetryService.js +7 -7
- package/dist/types/content.d.ts +14 -1
- package/dist/types/conversation.d.ts +2 -0
- package/dist/types/fileTypes.d.ts +44 -0
- package/dist/types/generateTypes.d.ts +1 -0
- package/dist/types/observability.d.ts +49 -0
- package/dist/types/observability.js +6 -0
- package/dist/types/providers.d.ts +44 -0
- package/dist/types/streamTypes.d.ts +1 -0
- package/dist/types/tools.js +1 -0
- package/dist/utils/fileDetector.js +6 -3
- package/dist/utils/messageBuilder.js +95 -9
- package/dist/utils/multimodalOptionsBuilder.d.ts +67 -0
- package/dist/utils/multimodalOptionsBuilder.js +64 -0
- package/dist/utils/pdfProcessor.d.ts +10 -0
- package/dist/utils/pdfProcessor.js +198 -0
- package/package.json +12 -16
|
@@ -133,6 +133,11 @@ export declare abstract class BaseProvider implements AIProvider {
|
|
|
133
133
|
* Process custom tools from setupToolExecutor
|
|
134
134
|
*/
|
|
135
135
|
private processCustomTools;
|
|
136
|
+
/**
|
|
137
|
+
* Recursively fix JSON Schema for OpenAI strict mode compatibility
|
|
138
|
+
* OpenAI requires additionalProperties: false at ALL levels and preserves required array
|
|
139
|
+
*/
|
|
140
|
+
private fixSchemaForOpenAIStrictMode;
|
|
136
141
|
/**
|
|
137
142
|
* Create an external MCP tool
|
|
138
143
|
*/
|
|
@@ -236,4 +241,13 @@ export declare abstract class BaseProvider implements AIProvider {
|
|
|
236
241
|
* @returns Array of prompt chunks
|
|
237
242
|
*/
|
|
238
243
|
static chunkPrompt(prompt: string, maxChunkSize?: number, overlap?: number): string[];
|
|
244
|
+
/**
|
|
245
|
+
* Create telemetry configuration for Vercel AI SDK experimental_telemetry
|
|
246
|
+
* This enables automatic OpenTelemetry tracing when telemetry is enabled
|
|
247
|
+
*/
|
|
248
|
+
protected getStreamTelemetryConfig(options: StreamOptions | TextGenerationOptions, operationType?: "stream" | "generate"): {
|
|
249
|
+
isEnabled: boolean;
|
|
250
|
+
functionId?: string;
|
|
251
|
+
metadata?: Record<string, string | number | boolean>;
|
|
252
|
+
} | undefined;
|
|
239
253
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { generateText } from "ai";
|
|
2
|
+
import { generateText, tool as createAISDKTool, jsonSchema } from "ai";
|
|
3
3
|
import { MiddlewareFactory } from "../middleware/factory.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { DEFAULT_MAX_STEPS, STEP_LIMITS } from "../core/constants.js";
|
|
6
6
|
import { directAgentTools } from "../agent/directTools.js";
|
|
7
7
|
import { getSafeMaxTokens } from "../utils/tokenLimits.js";
|
|
8
8
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
9
|
+
import { nanoid } from "nanoid";
|
|
10
|
+
import { createAnalytics } from "./analytics.js";
|
|
9
11
|
import { shouldDisableBuiltinTools } from "../utils/toolUtils.js";
|
|
10
12
|
import { buildMessagesArray, buildMultimodalMessagesArray, } from "../utils/messageBuilder.js";
|
|
11
13
|
import { getKeysAsString, getKeyCount } from "../utils/transformationUtils.js";
|
|
@@ -232,8 +234,9 @@ export class BaseProvider {
|
|
|
232
234
|
const hasImages = !!input?.images?.length;
|
|
233
235
|
const hasContent = !!input?.content?.length;
|
|
234
236
|
const hasCSVFiles = !!input?.csvFiles?.length;
|
|
237
|
+
const hasPdfFiles = !!input?.pdfFiles?.length;
|
|
235
238
|
const hasFiles = !!input?.files?.length;
|
|
236
|
-
return hasImages || hasContent || hasCSVFiles || hasFiles;
|
|
239
|
+
return hasImages || hasContent || hasCSVFiles || hasPdfFiles || hasFiles;
|
|
237
240
|
};
|
|
238
241
|
let messages;
|
|
239
242
|
if (hasMultimodalInput(options)) {
|
|
@@ -247,6 +250,7 @@ export class BaseProvider {
|
|
|
247
250
|
images: input?.images,
|
|
248
251
|
content: input?.content,
|
|
249
252
|
csvFiles: input?.csvFiles,
|
|
253
|
+
pdfFiles: input?.pdfFiles,
|
|
250
254
|
files: input?.files,
|
|
251
255
|
},
|
|
252
256
|
csvOptions: options.csvOptions,
|
|
@@ -304,6 +308,7 @@ export class BaseProvider {
|
|
|
304
308
|
toolChoice: shouldUseTools ? "auto" : "none",
|
|
305
309
|
temperature: options.temperature,
|
|
306
310
|
maxTokens: options.maxTokens,
|
|
311
|
+
experimental_telemetry: this.getStreamTelemetryConfig(options, "generate"),
|
|
307
312
|
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
308
313
|
logger.info("Tool execution completed", { toolResults, toolCalls });
|
|
309
314
|
// Handle tool execution storage
|
|
@@ -764,22 +769,24 @@ export class BaseProvider {
|
|
|
764
769
|
async createCustomToolFromDefinition(toolName, toolInfo) {
|
|
765
770
|
try {
|
|
766
771
|
logger.debug(`[BaseProvider] Converting custom tool: ${toolName}`);
|
|
767
|
-
// Convert to AI SDK tool format
|
|
768
|
-
const { tool: createAISDKTool } = await import("ai");
|
|
769
|
-
const { z } = await import("zod");
|
|
770
772
|
let finalSchema;
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
let originalInputSchema;
|
|
774
|
+
// Prioritize parameters (Zod), then inputSchema (JSON Schema)
|
|
775
|
+
if (toolInfo.parameters && this.isZodSchema(toolInfo.parameters)) {
|
|
776
|
+
finalSchema = toolInfo.parameters;
|
|
775
777
|
}
|
|
776
|
-
else if (
|
|
777
|
-
|
|
778
|
-
|
|
778
|
+
else if (toolInfo.inputSchema &&
|
|
779
|
+
typeof toolInfo.inputSchema === "object") {
|
|
780
|
+
// Use original JSON Schema with jsonSchema() wrapper - NO CONVERSION!
|
|
781
|
+
originalInputSchema = toolInfo.inputSchema;
|
|
782
|
+
finalSchema = jsonSchema(originalInputSchema);
|
|
783
|
+
}
|
|
784
|
+
else if (toolInfo.parameters &&
|
|
785
|
+
typeof toolInfo.parameters === "object") {
|
|
786
|
+
finalSchema = convertJsonSchemaToZod(toolInfo.parameters);
|
|
779
787
|
}
|
|
780
788
|
else {
|
|
781
789
|
finalSchema = z.object({});
|
|
782
|
-
logger.debug(`[BaseProvider] ${toolName}: No schema found, using empty object`);
|
|
783
790
|
}
|
|
784
791
|
return createAISDKTool({
|
|
785
792
|
description: toolInfo.description || `Tool ${toolName}`,
|
|
@@ -973,7 +980,7 @@ export class BaseProvider {
|
|
|
973
980
|
{};
|
|
974
981
|
if (toolInfo && typeof toolInfo.execute === "function") {
|
|
975
982
|
const tool = await this.createCustomToolFromDefinition(toolName, toolInfo);
|
|
976
|
-
if (tool) {
|
|
983
|
+
if (tool && !tools[toolName]) {
|
|
977
984
|
tools[toolName] = tool;
|
|
978
985
|
}
|
|
979
986
|
}
|
|
@@ -982,17 +989,58 @@ export class BaseProvider {
|
|
|
982
989
|
customToolsProcessed: this.customTools.size,
|
|
983
990
|
});
|
|
984
991
|
}
|
|
992
|
+
/**
|
|
993
|
+
* Recursively fix JSON Schema for OpenAI strict mode compatibility
|
|
994
|
+
* OpenAI requires additionalProperties: false at ALL levels and preserves required array
|
|
995
|
+
*/
|
|
996
|
+
fixSchemaForOpenAIStrictMode(schema) {
|
|
997
|
+
const fixedSchema = JSON.parse(JSON.stringify(schema));
|
|
998
|
+
if (fixedSchema.type === "object" &&
|
|
999
|
+
fixedSchema.properties &&
|
|
1000
|
+
typeof fixedSchema.properties === "object") {
|
|
1001
|
+
const allPropertyNames = Object.keys(fixedSchema.properties);
|
|
1002
|
+
if (!fixedSchema.required || !Array.isArray(fixedSchema.required)) {
|
|
1003
|
+
fixedSchema.required = [];
|
|
1004
|
+
}
|
|
1005
|
+
fixedSchema.additionalProperties = false;
|
|
1006
|
+
for (const propName of allPropertyNames) {
|
|
1007
|
+
const propValue = fixedSchema.properties[propName];
|
|
1008
|
+
if (propValue && typeof propValue === "object") {
|
|
1009
|
+
if (propValue.type === "object") {
|
|
1010
|
+
fixedSchema.properties[propName] =
|
|
1011
|
+
this.fixSchemaForOpenAIStrictMode(propValue);
|
|
1012
|
+
}
|
|
1013
|
+
else if (propValue.type === "array" &&
|
|
1014
|
+
propValue.items &&
|
|
1015
|
+
typeof propValue.items === "object") {
|
|
1016
|
+
fixedSchema.properties[propName].items =
|
|
1017
|
+
this.fixSchemaForOpenAIStrictMode(propValue.items);
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
return fixedSchema;
|
|
1023
|
+
}
|
|
985
1024
|
/**
|
|
986
1025
|
* Create an external MCP tool
|
|
987
1026
|
*/
|
|
988
1027
|
async createExternalMCPTool(tool) {
|
|
989
1028
|
try {
|
|
990
1029
|
logger.debug(`[BaseProvider] Converting external MCP tool: ${tool.name}`);
|
|
991
|
-
//
|
|
992
|
-
|
|
1030
|
+
// Use original JSON Schema from MCP tool if available, otherwise use permissive schema
|
|
1031
|
+
let finalSchema;
|
|
1032
|
+
if (tool.inputSchema && typeof tool.inputSchema === "object") {
|
|
1033
|
+
// Clone and fix the schema for OpenAI strict mode compatibility
|
|
1034
|
+
const originalSchema = tool.inputSchema;
|
|
1035
|
+
const fixedSchema = this.fixSchemaForOpenAIStrictMode(originalSchema);
|
|
1036
|
+
finalSchema = jsonSchema(fixedSchema);
|
|
1037
|
+
}
|
|
1038
|
+
else {
|
|
1039
|
+
finalSchema = this.createPermissiveZodSchema();
|
|
1040
|
+
}
|
|
993
1041
|
return createAISDKTool({
|
|
994
1042
|
description: tool.description || `External MCP tool ${tool.name}`,
|
|
995
|
-
parameters:
|
|
1043
|
+
parameters: finalSchema,
|
|
996
1044
|
execute: async (params) => {
|
|
997
1045
|
logger.debug(`Executing external MCP tool: ${tool.name}`, {
|
|
998
1046
|
toolName: tool.name,
|
|
@@ -1115,7 +1163,7 @@ export class BaseProvider {
|
|
|
1115
1163
|
logger.debug(`[BaseProvider] Found ${externalTools.length} external MCP tools`);
|
|
1116
1164
|
for (const tool of externalTools) {
|
|
1117
1165
|
const mcpTool = await this.createExternalMCPTool(tool);
|
|
1118
|
-
if (mcpTool) {
|
|
1166
|
+
if (mcpTool && !tools[tool.name]) {
|
|
1119
1167
|
tools[tool.name] = mcpTool;
|
|
1120
1168
|
logger.debug(`[BaseProvider] Successfully added external MCP tool: ${tool.name}`);
|
|
1121
1169
|
}
|
|
@@ -1138,9 +1186,14 @@ export class BaseProvider {
|
|
|
1138
1186
|
// Set empty tools object - MCP tools are handled at a higher level
|
|
1139
1187
|
this.mcpTools = {};
|
|
1140
1188
|
}
|
|
1141
|
-
// Add MCP tools if available
|
|
1189
|
+
// Add MCP tools if available, but don't overwrite existing direct tools
|
|
1190
|
+
// Direct tools (Zod-based) take precedence over MCP tools (JSON Schema)
|
|
1142
1191
|
if (this.mcpTools) {
|
|
1143
|
-
Object.
|
|
1192
|
+
for (const [name, tool] of Object.entries(this.mcpTools)) {
|
|
1193
|
+
if (!tools[name]) {
|
|
1194
|
+
tools[name] = tool;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1144
1197
|
}
|
|
1145
1198
|
}
|
|
1146
1199
|
/**
|
|
@@ -1283,9 +1336,8 @@ export class BaseProvider {
|
|
|
1283
1336
|
*/
|
|
1284
1337
|
async createStreamAnalytics(result, startTime, options) {
|
|
1285
1338
|
try {
|
|
1286
|
-
const { createAnalytics } = await import("./analytics.js");
|
|
1287
1339
|
const analytics = createAnalytics(this.providerName, this.modelName, result, Date.now() - startTime, {
|
|
1288
|
-
requestId: `${this.providerName}-stream-${
|
|
1340
|
+
requestId: `${this.providerName}-stream-${nanoid()}`,
|
|
1289
1341
|
streamingMode: true,
|
|
1290
1342
|
...options.context,
|
|
1291
1343
|
});
|
|
@@ -1518,7 +1570,7 @@ export class BaseProvider {
|
|
|
1518
1570
|
}
|
|
1519
1571
|
const sessionId = options.context?.sessionId ||
|
|
1520
1572
|
options.sessionId ||
|
|
1521
|
-
`session-${
|
|
1573
|
+
`session-${nanoid()}`;
|
|
1522
1574
|
const userId = options.context?.userId ||
|
|
1523
1575
|
options.userId;
|
|
1524
1576
|
try {
|
|
@@ -1565,4 +1617,35 @@ export class BaseProvider {
|
|
|
1565
1617
|
}
|
|
1566
1618
|
return chunks;
|
|
1567
1619
|
}
|
|
1620
|
+
/**
|
|
1621
|
+
* Create telemetry configuration for Vercel AI SDK experimental_telemetry
|
|
1622
|
+
* This enables automatic OpenTelemetry tracing when telemetry is enabled
|
|
1623
|
+
*/
|
|
1624
|
+
getStreamTelemetryConfig(options, operationType = "stream") {
|
|
1625
|
+
// Check if telemetry is enabled via NeuroLink observability config
|
|
1626
|
+
if (!this.neurolink?.isTelemetryEnabled()) {
|
|
1627
|
+
return undefined;
|
|
1628
|
+
}
|
|
1629
|
+
const functionId = `${this.providerName}-${operationType}-${nanoid()}`;
|
|
1630
|
+
const metadata = {
|
|
1631
|
+
provider: this.providerName,
|
|
1632
|
+
model: this.modelName,
|
|
1633
|
+
toolsEnabled: !options.disableTools,
|
|
1634
|
+
neurolink: true,
|
|
1635
|
+
};
|
|
1636
|
+
// Add sessionId if available
|
|
1637
|
+
if ("sessionId" in options && options.sessionId) {
|
|
1638
|
+
const sessionId = options.sessionId;
|
|
1639
|
+
if (typeof sessionId === "string" ||
|
|
1640
|
+
typeof sessionId === "number" ||
|
|
1641
|
+
typeof sessionId === "boolean") {
|
|
1642
|
+
metadata.sessionId = sessionId;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
return {
|
|
1646
|
+
isEnabled: true,
|
|
1647
|
+
functionId,
|
|
1648
|
+
metadata,
|
|
1649
|
+
};
|
|
1650
|
+
}
|
|
1568
1651
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ import { NeuroLink } from "./neurolink.js";
|
|
|
21
21
|
export { NeuroLink };
|
|
22
22
|
export type { ProviderStatus, MCPStatus } from "./neurolink.js";
|
|
23
23
|
export type { MCPServerInfo } from "./types/mcpTypes.js";
|
|
24
|
+
export type { ObservabilityConfig, LangfuseConfig, OpenTelemetryConfig, } from "./types/observability.js";
|
|
25
|
+
import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus } from "./services/server/ai/observability/instrumentation.js";
|
|
26
|
+
export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
|
|
24
27
|
export type { NeuroLinkMiddleware, MiddlewareContext, MiddlewareFactoryOptions, MiddlewarePreset, MiddlewareConfig, } from "./types/middlewareTypes.js";
|
|
25
28
|
export { MiddlewareFactory } from "./middleware/factory.js";
|
|
26
29
|
export declare const VERSION = "1.0.0";
|
|
@@ -35,7 +38,7 @@ export declare const VERSION = "1.0.0";
|
|
|
35
38
|
* const result = await provider.stream({ input: { text: 'Hello, AI!' } });
|
|
36
39
|
* ```
|
|
37
40
|
*/
|
|
38
|
-
export declare function createAIProvider(providerName?: string, modelName?: string): Promise<import("./
|
|
41
|
+
export declare function createAIProvider(providerName?: string, modelName?: string): Promise<import("./index.js").AIProvider>;
|
|
39
42
|
/**
|
|
40
43
|
* Create provider with automatic fallback
|
|
41
44
|
*
|
|
@@ -46,7 +49,7 @@ export declare function createAIProvider(providerName?: string, modelName?: stri
|
|
|
46
49
|
* const { primary, fallback } = await createAIProviderWithFallback('bedrock', 'vertex');
|
|
47
50
|
* ```
|
|
48
51
|
*/
|
|
49
|
-
export declare function createAIProviderWithFallback(primaryProvider?: string, fallbackProvider?: string, modelName?: string): Promise<import("./types/typeAliases.js").ProviderPairResult<import("./
|
|
52
|
+
export declare function createAIProviderWithFallback(primaryProvider?: string, fallbackProvider?: string, modelName?: string): Promise<import("./types/typeAliases.js").ProviderPairResult<import("./index.js").AIProvider>>;
|
|
50
53
|
/**
|
|
51
54
|
* Create the best available provider based on configuration
|
|
52
55
|
*
|
|
@@ -57,7 +60,7 @@ export declare function createAIProviderWithFallback(primaryProvider?: string, f
|
|
|
57
60
|
* const provider = await createBestAIProvider();
|
|
58
61
|
* ```
|
|
59
62
|
*/
|
|
60
|
-
export declare function createBestAIProvider(requestedProvider?: string, modelName?: string): Promise<import("./
|
|
63
|
+
export declare function createBestAIProvider(requestedProvider?: string, modelName?: string): Promise<import("./index.js").AIProvider>;
|
|
61
64
|
/**
|
|
62
65
|
* MCP (Model Context Protocol) Plugin Ecosystem
|
|
63
66
|
*
|
|
@@ -82,10 +85,13 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
|
|
|
82
85
|
export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
|
|
83
86
|
export type { McpMetadata, ExecutionContext, DiscoveredMcp, ToolInfo, ToolExecutionResult, LogLevel, } from "./mcp/index.js";
|
|
84
87
|
export declare function initializeTelemetry(): Promise<boolean>;
|
|
85
|
-
export declare function getTelemetryStatus(): {
|
|
88
|
+
export declare function getTelemetryStatus(): Promise<{
|
|
86
89
|
enabled: boolean;
|
|
87
90
|
initialized: boolean;
|
|
88
|
-
|
|
91
|
+
endpoint?: string;
|
|
92
|
+
service?: string;
|
|
93
|
+
version?: string;
|
|
94
|
+
}>;
|
|
89
95
|
export type { TextGenerationOptions, TextGenerationResult, AnalyticsData, EvaluationData, } from "./types/index.js";
|
|
90
96
|
/**
|
|
91
97
|
* BACKWARD COMPATIBILITY: Legacy generateText function
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,9 @@ export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
|
19
19
|
// Main NeuroLink wrapper class and diagnostic types
|
|
20
20
|
import { NeuroLink } from "./neurolink.js";
|
|
21
21
|
export { NeuroLink };
|
|
22
|
+
import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, } from "./services/server/ai/observability/instrumentation.js";
|
|
23
|
+
import { initializeTelemetry as init, getTelemetryStatus as getStatus, } from "./telemetry/index.js";
|
|
24
|
+
export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
|
|
22
25
|
export { MiddlewareFactory } from "./middleware/factory.js";
|
|
23
26
|
// Version
|
|
24
27
|
export const VERSION = "1.0.0";
|
|
@@ -96,20 +99,18 @@ initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./
|
|
|
96
99
|
// Real-time Services (Phase 1) - Basic SSE functionality only
|
|
97
100
|
// export { createEnhancedChatService } from './chat/index.js';
|
|
98
101
|
// export type * from './services/types.js';
|
|
99
|
-
// Optional Telemetry (Phase 2) -
|
|
102
|
+
// Optional Telemetry (Phase 2) - Telemetry service initialization
|
|
100
103
|
export async function initializeTelemetry() {
|
|
101
|
-
|
|
102
|
-
const { initializeTelemetry: init } = await import("./telemetry/index.js");
|
|
104
|
+
try {
|
|
103
105
|
const result = await init();
|
|
104
|
-
return !!result;
|
|
106
|
+
return !!result;
|
|
105
107
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
export function getTelemetryStatus() {
|
|
109
|
-
if (process.env.NEUROLINK_TELEMETRY_ENABLED === "true") {
|
|
110
|
-
return { enabled: true, initialized: false };
|
|
108
|
+
catch {
|
|
109
|
+
return false;
|
|
111
110
|
}
|
|
112
|
-
|
|
111
|
+
}
|
|
112
|
+
export async function getTelemetryStatus() {
|
|
113
|
+
return getStatus();
|
|
113
114
|
}
|
|
114
115
|
/**
|
|
115
116
|
* BACKWARD COMPATIBILITY: Legacy generateText function
|
|
@@ -20,7 +20,29 @@ export class MultimodalLogger {
|
|
|
20
20
|
* Vision capability definitions for each provider
|
|
21
21
|
*/
|
|
22
22
|
const VISION_CAPABILITIES = {
|
|
23
|
-
openai: [
|
|
23
|
+
openai: [
|
|
24
|
+
// GPT-5 family (released Aug 2025)
|
|
25
|
+
"gpt-5",
|
|
26
|
+
"gpt-5-2025-08-07",
|
|
27
|
+
"gpt-5-pro",
|
|
28
|
+
"gpt-5-mini",
|
|
29
|
+
"gpt-5-nano",
|
|
30
|
+
// GPT-4.1 family (released Apr 2025)
|
|
31
|
+
"gpt-4.1",
|
|
32
|
+
"gpt-4.1-mini",
|
|
33
|
+
"gpt-4.1-nano",
|
|
34
|
+
// o-series reasoning models (released Apr 2025)
|
|
35
|
+
"o3",
|
|
36
|
+
"o3-mini",
|
|
37
|
+
"o4",
|
|
38
|
+
"o4-mini",
|
|
39
|
+
"o4-mini-deep-research",
|
|
40
|
+
// Existing GPT-4 models
|
|
41
|
+
"gpt-4o",
|
|
42
|
+
"gpt-4o-mini",
|
|
43
|
+
"gpt-4-turbo",
|
|
44
|
+
"gpt-4-vision-preview",
|
|
45
|
+
],
|
|
24
46
|
"google-ai": [
|
|
25
47
|
"gemini-2.5-pro",
|
|
26
48
|
"gemini-2.5-flash",
|
|
@@ -29,44 +51,91 @@ const VISION_CAPABILITIES = {
|
|
|
29
51
|
"gemini-pro-vision",
|
|
30
52
|
],
|
|
31
53
|
anthropic: [
|
|
54
|
+
"claude-3-7-sonnet",
|
|
32
55
|
"claude-3-5-sonnet",
|
|
33
56
|
"claude-3-opus",
|
|
34
57
|
"claude-3-sonnet",
|
|
35
58
|
"claude-3-haiku",
|
|
36
59
|
],
|
|
37
60
|
azure: [
|
|
61
|
+
// GPT-5 family
|
|
62
|
+
"gpt-5",
|
|
63
|
+
"gpt-5-pro",
|
|
64
|
+
"gpt-5-mini",
|
|
65
|
+
// GPT-4.1 family
|
|
66
|
+
"gpt-4.1",
|
|
67
|
+
"gpt-4.1-mini",
|
|
68
|
+
"gpt-4.1-nano",
|
|
69
|
+
// Existing GPT-4
|
|
38
70
|
"gpt-4o",
|
|
39
71
|
"gpt-4o-mini",
|
|
40
72
|
"gpt-4-turbo",
|
|
41
73
|
"gpt-4-vision-preview",
|
|
42
|
-
"gpt-4.1",
|
|
43
74
|
"gpt-4",
|
|
44
75
|
],
|
|
45
76
|
vertex: [
|
|
46
77
|
// Gemini models on Vertex AI
|
|
47
78
|
"gemini-2.5-pro",
|
|
48
79
|
"gemini-2.5-flash",
|
|
80
|
+
"gemini-2.0-flash",
|
|
49
81
|
"gemini-1.5-pro",
|
|
50
82
|
"gemini-1.5-flash",
|
|
51
|
-
// Claude models
|
|
83
|
+
// Claude 4.x models (versioned format)
|
|
84
|
+
"claude-sonnet-4-5@",
|
|
85
|
+
"claude-sonnet-4@",
|
|
86
|
+
"claude-opus-4-1@",
|
|
87
|
+
"claude-opus-4@",
|
|
88
|
+
// Claude 3.x models (versioned format)
|
|
89
|
+
"claude-3-7-sonnet@",
|
|
90
|
+
"claude-3-5-sonnet@",
|
|
91
|
+
"claude-opus-3@",
|
|
92
|
+
"claude-haiku-3@",
|
|
93
|
+
// Claude models (non-versioned format)
|
|
94
|
+
"claude-3-7-sonnet",
|
|
52
95
|
"claude-3-5-sonnet",
|
|
53
96
|
"claude-3-opus",
|
|
54
97
|
"claude-3-sonnet",
|
|
55
98
|
"claude-3-haiku",
|
|
56
|
-
"claude-sonnet-3",
|
|
57
99
|
"claude-sonnet-4",
|
|
100
|
+
"claude-sonnet-3",
|
|
58
101
|
"claude-opus-3",
|
|
59
102
|
"claude-haiku-3",
|
|
60
|
-
// Additional
|
|
103
|
+
// Additional patterns for compatibility
|
|
61
104
|
"claude-3.5-sonnet",
|
|
62
105
|
"claude-3.5-haiku",
|
|
63
106
|
"claude-3.0-sonnet",
|
|
64
107
|
"claude-3.0-opus",
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"
|
|
108
|
+
],
|
|
109
|
+
litellm: [
|
|
110
|
+
// LiteLLM proxies to underlying providers
|
|
111
|
+
// List models that support vision when going through the proxy
|
|
112
|
+
"gemini-2.5-pro",
|
|
113
|
+
"gemini-2.5-flash",
|
|
114
|
+
"claude-sonnet-4",
|
|
115
|
+
"claude-sonnet-4-5",
|
|
116
|
+
"claude-opus-4-1",
|
|
117
|
+
"gpt-4o",
|
|
118
|
+
"gpt-4.1",
|
|
119
|
+
"gpt-5",
|
|
120
|
+
],
|
|
121
|
+
ollama: [
|
|
122
|
+
// Llama 4 family (May 2025 - Best vision + tool calling)
|
|
123
|
+
"llama4:scout",
|
|
124
|
+
"llama4:maverick",
|
|
125
|
+
// Llama 3.2 vision
|
|
126
|
+
"llama3.2-vision",
|
|
127
|
+
// Gemma 3 family (SigLIP vision encoder - supports tool calling + vision)
|
|
128
|
+
"gemma3:4b",
|
|
129
|
+
"gemma3:12b",
|
|
130
|
+
"gemma3:27b",
|
|
131
|
+
"gemma3:latest",
|
|
132
|
+
// Mistral Small family (vision + tool calling)
|
|
133
|
+
"mistral-small3.1",
|
|
134
|
+
"mistral-small3.1:large",
|
|
135
|
+
"mistral-small3.1:medium",
|
|
136
|
+
"mistral-small3.1:small",
|
|
137
|
+
// LLaVA (vision-focused)
|
|
138
|
+
"llava",
|
|
70
139
|
],
|
|
71
140
|
};
|
|
72
141
|
/**
|
|
@@ -100,6 +169,9 @@ export class ProviderImageAdapter {
|
|
|
100
169
|
case "vertex":
|
|
101
170
|
adaptedPayload = this.formatForVertex(text, images, model);
|
|
102
171
|
break;
|
|
172
|
+
case "ollama":
|
|
173
|
+
adaptedPayload = this.formatForOpenAI(text, images);
|
|
174
|
+
break;
|
|
103
175
|
default:
|
|
104
176
|
throw new Error(`Vision not supported for provider: ${provider}`);
|
|
105
177
|
}
|
|
@@ -267,3 +339,4 @@ export class ProviderImageAdapter {
|
|
|
267
339
|
return Object.keys(VISION_CAPABILITIES);
|
|
268
340
|
}
|
|
269
341
|
}
|
|
342
|
+
//# sourceMappingURL=providerImageAdapter.js.map
|
|
@@ -349,13 +349,13 @@ export declare const directAgentTools: {
|
|
|
349
349
|
analyzeCSV: import("ai").Tool<z.ZodObject<{
|
|
350
350
|
filePath: z.ZodEffects<z.ZodString, string, string>;
|
|
351
351
|
operation: z.ZodEnum<["count_by_column", "sum_by_column", "average_by_column", "min_max_by_column", "describe"]>;
|
|
352
|
-
column: z.ZodOptional<z.ZodString
|
|
353
|
-
maxRows: z.ZodOptional<z.ZodNumber
|
|
352
|
+
column: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
353
|
+
maxRows: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
354
354
|
}, "strip", z.ZodTypeAny, {
|
|
355
|
+
maxRows: number;
|
|
355
356
|
filePath: string;
|
|
356
357
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
357
|
-
|
|
358
|
-
column?: string | undefined;
|
|
358
|
+
column: string;
|
|
359
359
|
}, {
|
|
360
360
|
filePath: string;
|
|
361
361
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
@@ -364,7 +364,7 @@ export declare const directAgentTools: {
|
|
|
364
364
|
}>, {
|
|
365
365
|
success: boolean;
|
|
366
366
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
367
|
-
column: string
|
|
367
|
+
column: string;
|
|
368
368
|
result: string;
|
|
369
369
|
rowCount: number;
|
|
370
370
|
} | {
|
|
@@ -376,17 +376,17 @@ export declare const directAgentTools: {
|
|
|
376
376
|
success: boolean;
|
|
377
377
|
error: string;
|
|
378
378
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
379
|
-
column: string
|
|
379
|
+
column: string;
|
|
380
380
|
}> & {
|
|
381
381
|
execute: (args: {
|
|
382
|
+
maxRows: number;
|
|
382
383
|
filePath: string;
|
|
383
384
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
384
|
-
|
|
385
|
-
column?: string | undefined;
|
|
385
|
+
column: string;
|
|
386
386
|
}, options: import("ai").ToolExecutionOptions) => PromiseLike<{
|
|
387
387
|
success: boolean;
|
|
388
388
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
389
|
-
column: string
|
|
389
|
+
column: string;
|
|
390
390
|
result: string;
|
|
391
391
|
rowCount: number;
|
|
392
392
|
} | {
|
|
@@ -398,7 +398,7 @@ export declare const directAgentTools: {
|
|
|
398
398
|
success: boolean;
|
|
399
399
|
error: string;
|
|
400
400
|
operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
|
|
401
|
-
column: string
|
|
401
|
+
column: string;
|
|
402
402
|
}>;
|
|
403
403
|
};
|
|
404
404
|
websearchGrounding: import("ai").Tool<z.ZodObject<{
|
|
@@ -31,7 +31,7 @@ export const directAgentTools = {
|
|
|
31
31
|
timezone: z
|
|
32
32
|
.string()
|
|
33
33
|
.optional()
|
|
34
|
-
.describe('Timezone (e.g., "America/New_York", "Asia/Kolkata"). Defaults to local time.'),
|
|
34
|
+
.describe('Timezone (e.g., "America/New_York", "Asia/Kolkata"). Defaults to system local time.'),
|
|
35
35
|
}),
|
|
36
36
|
execute: async ({ timezone }) => {
|
|
37
37
|
try {
|
|
@@ -103,8 +103,8 @@ export const directAgentTools = {
|
|
|
103
103
|
includeHidden: z
|
|
104
104
|
.boolean()
|
|
105
105
|
.optional()
|
|
106
|
-
.
|
|
107
|
-
.
|
|
106
|
+
.default(false)
|
|
107
|
+
.describe("Include hidden files (starting with .)"),
|
|
108
108
|
}),
|
|
109
109
|
execute: async ({ path: dirPath, includeHidden }) => {
|
|
110
110
|
try {
|
|
@@ -377,10 +377,12 @@ export const directAgentTools = {
|
|
|
377
377
|
column: z
|
|
378
378
|
.string()
|
|
379
379
|
.optional()
|
|
380
|
+
.default("")
|
|
380
381
|
.describe("Column name for the operation (required for most operations)"),
|
|
381
382
|
maxRows: z
|
|
382
383
|
.number()
|
|
383
384
|
.optional()
|
|
385
|
+
.default(1000)
|
|
384
386
|
.describe("Maximum rows to process (default: 1000)"),
|
|
385
387
|
}),
|
|
386
388
|
execute: async ({ filePath, operation, column, maxRows = 1000 }) => {
|
|
@@ -784,3 +786,4 @@ export function validateToolStructure() {
|
|
|
784
786
|
return false;
|
|
785
787
|
}
|
|
786
788
|
}
|
|
789
|
+
//# sourceMappingURL=directTools.js.map
|
|
@@ -42,7 +42,7 @@ export const OPERATION_TIMEOUTS = {
|
|
|
42
42
|
};
|
|
43
43
|
// Import the constants from the individual files for use in composite configurations
|
|
44
44
|
import { PROVIDER_TIMEOUTS, MCP_TIMEOUTS, TimeoutUtils, TOOL_TIMEOUTS, } from "./timeouts.js";
|
|
45
|
-
import { RETRY_ATTEMPTS, RETRY_DELAYS, PROVIDER_RETRY, RetryUtils, } from "./retry.js";
|
|
45
|
+
import { RETRY_ATTEMPTS, RETRY_DELAYS, PROVIDER_RETRY, BACKOFF_CONFIG, RetryUtils, } from "./retry.js";
|
|
46
46
|
import { CONCURRENCY_LIMITS, MEMORY_THRESHOLDS, BUFFER_SIZES, } from "./performance.js";
|
|
47
47
|
import { TokenUtils } from "./tokens.js";
|
|
48
48
|
/**
|
|
@@ -193,3 +193,4 @@ export const CONSTANTS_METADATA = {
|
|
|
193
193
|
CATEGORIES: ["timeouts", "retry", "performance", "tokens"],
|
|
194
194
|
COMPATIBILITY: "backward_compatible",
|
|
195
195
|
};
|
|
196
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -387,3 +387,4 @@ export const DEFAULT_CACHE_SIZE = CACHE_CONFIG.DEFAULT_SIZE;
|
|
|
387
387
|
export const NANOSECOND_TO_MS_DIVISOR = UNIT_CONVERSIONS.NANOSECOND_TO_MS_DIVISOR;
|
|
388
388
|
export const TEXT_PREVIEW_LENGTHS_EXPORT = TEXT_PREVIEW_LENGTHS;
|
|
389
389
|
export const PERFORMANCE_THRESHOLDS_EXPORT = PERFORMANCE_THRESHOLDS;
|
|
390
|
+
//# sourceMappingURL=performance.js.map
|
|
@@ -264,3 +264,4 @@ export const DEFAULT_BACKOFF_MULTIPLIER = BACKOFF_CONFIG.MULTIPLIER;
|
|
|
264
264
|
export const CIRCUIT_BREAKER_FAILURE_THRESHOLD = CIRCUIT_BREAKER.FAILURE_THRESHOLD;
|
|
265
265
|
// Single source of truth: re-export from timeouts
|
|
266
266
|
export { CIRCUIT_BREAKER_RESET_MS } from "./timeouts.js";
|
|
267
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -180,3 +180,4 @@ export const DEFAULT_TIMEOUT = TOOL_TIMEOUTS.EXECUTION_DEFAULT_MS;
|
|
|
180
180
|
export const PROVIDER_TEST_TIMEOUT = PROVIDER_TIMEOUTS.TEST_MS;
|
|
181
181
|
export const MCP_INIT_TIMEOUT = MCP_TIMEOUTS.INITIALIZATION_MS;
|
|
182
182
|
export const CIRCUIT_BREAKER_RESET_MS = CIRCUIT_BREAKER_TIMEOUTS.RESET_MS;
|
|
183
|
+
//# sourceMappingURL=timeouts.js.map
|
|
@@ -312,3 +312,4 @@ export const DEFAULT_DOCUMENTATION_MAX_TOKENS = USE_CASE_TOKENS.DOCUMENTATION;
|
|
|
312
312
|
export const ANTHROPIC_SAFE = PROVIDER_TOKEN_LIMITS.ANTHROPIC.default;
|
|
313
313
|
export const OPENAI_STANDARD = PROVIDER_TOKEN_LIMITS.OPENAI.default;
|
|
314
314
|
export const GOOGLE_STANDARD = PROVIDER_TOKEN_LIMITS.GOOGLE_AI.default;
|
|
315
|
+
//# sourceMappingURL=tokens.js.map
|