@juspay/neurolink 6.2.1 → 7.1.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 +32 -16
- package/README.md +3 -3
- package/dist/cli/factories/commandFactory.d.ts +70 -0
- package/dist/cli/factories/commandFactory.js +633 -0
- package/dist/cli/index.d.ts +6 -0
- package/dist/cli/index.js +18 -990
- package/dist/cli/utils/{complete-setup.d.ts → completeSetup.d.ts} +1 -1
- package/dist/cli/utils/{complete-setup.js → completeSetup.js} +2 -2
- package/dist/{lib/core/base-provider.d.ts → core/baseProvider.d.ts} +1 -1
- package/dist/core/{base-provider.js → baseProvider.js} +2 -2
- package/dist/core/{dynamic-models.js → dynamicModels.js} +1 -1
- package/dist/core/evaluation.js +1 -1
- package/dist/core/factory.js +7 -5
- package/dist/core/types.d.ts +2 -2
- package/dist/{lib/factories/provider-registry.js → factories/providerRegistry.js} +11 -9
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/{core/base-provider.d.ts → lib/core/baseProvider.d.ts} +1 -1
- package/dist/lib/core/{base-provider.js → baseProvider.js} +2 -2
- package/dist/lib/core/{dynamic-models.js → dynamicModels.js} +1 -1
- package/dist/lib/core/evaluation.js +1 -1
- package/dist/lib/core/factory.js +6 -3
- package/dist/lib/core/types.d.ts +2 -2
- package/dist/{factories/provider-registry.js → lib/factories/providerRegistry.js} +11 -9
- package/dist/lib/index.d.ts +4 -4
- package/dist/lib/index.js +1 -1
- package/dist/lib/mcp/factory.d.ts +2 -2
- package/dist/lib/mcp/factory.js +2 -2
- package/dist/lib/mcp/servers/agent/{direct-tools-server.js → directToolsServer.js} +1 -1
- package/dist/lib/mcp/servers/{ai-providers/ai-core-server.js → aiProviders/aiCoreServer.js} +1 -1
- package/dist/lib/mcp/{tool-registry.d.ts → toolRegistry.d.ts} +5 -0
- package/dist/lib/mcp/{tool-registry.js → toolRegistry.js} +60 -0
- package/dist/lib/neurolink.d.ts +4 -4
- package/dist/lib/neurolink.js +13 -8
- package/dist/lib/providers/{amazon-bedrock.d.ts → amazonBedrock.d.ts} +2 -2
- package/dist/lib/providers/{amazon-bedrock.js → amazonBedrock.js} +1 -1
- package/dist/lib/providers/anthropic.d.ts +2 -2
- package/dist/lib/providers/anthropic.js +1 -1
- package/dist/{providers/anthropic-baseprovider.d.ts → lib/providers/anthropicBaseProvider.d.ts} +2 -2
- package/dist/lib/providers/{anthropic-baseprovider.js → anthropicBaseProvider.js} +1 -1
- package/dist/{providers/azure-openai.d.ts → lib/providers/azureOpenai.d.ts} +2 -2
- package/dist/{providers/azure-openai.js → lib/providers/azureOpenai.js} +1 -1
- package/dist/{providers/google-ai-studio.d.ts → lib/providers/googleAiStudio.d.ts} +2 -2
- package/dist/lib/providers/{google-ai-studio.js → googleAiStudio.js} +1 -1
- package/dist/{providers/google-vertex.d.ts → lib/providers/googleVertex.d.ts} +2 -2
- package/dist/lib/providers/{google-vertex.js → googleVertex.js} +1 -1
- package/dist/lib/providers/huggingFace.d.ts +2 -2
- package/dist/lib/providers/huggingFace.js +1 -1
- package/dist/lib/providers/index.d.ts +4 -4
- package/dist/lib/providers/index.js +4 -4
- package/dist/lib/providers/mistral.d.ts +2 -2
- package/dist/lib/providers/mistral.js +1 -1
- package/dist/lib/providers/ollama.d.ts +2 -2
- package/dist/lib/providers/ollama.js +1 -1
- package/dist/lib/providers/openAI.d.ts +2 -2
- package/dist/lib/providers/openAI.js +1 -1
- package/dist/{sdk/tool-registration.d.ts → lib/sdk/toolRegistration.d.ts} +1 -1
- package/dist/lib/sdk/{tool-registration.js → toolRegistration.js} +17 -0
- package/dist/lib/telemetry/index.d.ts +2 -2
- package/dist/lib/telemetry/index.js +3 -3
- package/dist/lib/utils/logger.js +5 -6
- package/dist/lib/utils/providerConfig.js +1 -1
- package/dist/lib/utils/{provider-setup-messages.js → providerSetupMessages.js} +1 -1
- package/dist/lib/utils/providerUtils.js +10 -3
- package/dist/mcp/factory.d.ts +2 -2
- package/dist/mcp/factory.js +2 -2
- package/dist/mcp/servers/agent/{direct-tools-server.js → directToolsServer.js} +1 -1
- package/dist/mcp/servers/{ai-providers/ai-core-server.js → aiProviders/aiCoreServer.js} +2 -2
- package/dist/mcp/{tool-registry.d.ts → toolRegistry.d.ts} +5 -0
- package/dist/mcp/{tool-registry.js → toolRegistry.js} +60 -0
- package/dist/neurolink.d.ts +5 -5
- package/dist/neurolink.js +13 -8
- package/dist/providers/{amazon-bedrock.d.ts → amazonBedrock.d.ts} +2 -2
- package/dist/providers/{amazon-bedrock.js → amazonBedrock.js} +1 -1
- package/dist/providers/anthropic.d.ts +2 -2
- package/dist/providers/anthropic.js +1 -1
- package/dist/{lib/providers/anthropic-baseprovider.d.ts → providers/anthropicBaseProvider.d.ts} +2 -2
- package/dist/providers/{anthropic-baseprovider.js → anthropicBaseProvider.js} +1 -1
- package/dist/{lib/providers/azure-openai.d.ts → providers/azureOpenai.d.ts} +2 -2
- package/dist/{lib/providers/azure-openai.js → providers/azureOpenai.js} +1 -1
- package/dist/{lib/providers/google-ai-studio.d.ts → providers/googleAiStudio.d.ts} +2 -2
- package/dist/providers/{google-ai-studio.js → googleAiStudio.js} +2 -2
- package/dist/{lib/providers/google-vertex.d.ts → providers/googleVertex.d.ts} +2 -2
- package/dist/providers/{google-vertex.js → googleVertex.js} +1 -1
- package/dist/providers/huggingFace.d.ts +2 -2
- package/dist/providers/huggingFace.js +1 -1
- package/dist/providers/index.d.ts +4 -4
- package/dist/providers/index.js +4 -4
- package/dist/providers/mistral.d.ts +2 -2
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/ollama.d.ts +2 -2
- package/dist/providers/ollama.js +1 -1
- package/dist/providers/openAI.d.ts +2 -2
- package/dist/providers/openAI.js +1 -1
- package/dist/{lib/sdk/tool-registration.d.ts → sdk/toolRegistration.d.ts} +1 -1
- package/dist/sdk/{tool-registration.js → toolRegistration.js} +17 -0
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/index.js +3 -3
- package/dist/utils/logger.js +5 -6
- package/dist/utils/providerConfig.js +1 -1
- package/dist/utils/{provider-setup-messages.js → providerSetupMessages.js} +1 -1
- package/dist/utils/providerUtils.js +10 -3
- package/package.json +23 -22
- package/dist/cli/factories/command-factory.d.ts +0 -19
- package/dist/cli/factories/command-factory.js +0 -184
- /package/dist/agent/{direct-tools.d.ts → directTools.d.ts} +0 -0
- /package/dist/agent/{direct-tools.js → directTools.js} +0 -0
- /package/dist/cli/utils/{env-manager.d.ts → envManager.d.ts} +0 -0
- /package/dist/cli/utils/{env-manager.js → envManager.js} +0 -0
- /package/dist/cli/utils/{interactive-setup.d.ts → interactiveSetup.d.ts} +0 -0
- /package/dist/cli/utils/{interactive-setup.js → interactiveSetup.js} +0 -0
- /package/dist/core/{dynamic-models.d.ts → dynamicModels.d.ts} +0 -0
- /package/dist/core/{evaluation-providers.d.ts → evaluationProviders.d.ts} +0 -0
- /package/dist/core/{evaluation-providers.js → evaluationProviders.js} +0 -0
- /package/dist/core/{service-registry.d.ts → serviceRegistry.d.ts} +0 -0
- /package/dist/core/{service-registry.js → serviceRegistry.js} +0 -0
- /package/dist/factories/{provider-factory.d.ts → providerFactory.d.ts} +0 -0
- /package/dist/factories/{provider-factory.js → providerFactory.js} +0 -0
- /package/dist/factories/{provider-registry.d.ts → providerRegistry.d.ts} +0 -0
- /package/dist/lib/agent/{direct-tools.d.ts → directTools.d.ts} +0 -0
- /package/dist/lib/agent/{direct-tools.js → directTools.js} +0 -0
- /package/dist/lib/core/{dynamic-models.d.ts → dynamicModels.d.ts} +0 -0
- /package/dist/lib/core/{evaluation-providers.d.ts → evaluationProviders.d.ts} +0 -0
- /package/dist/lib/core/{evaluation-providers.js → evaluationProviders.js} +0 -0
- /package/dist/lib/core/{service-registry.d.ts → serviceRegistry.d.ts} +0 -0
- /package/dist/lib/core/{service-registry.js → serviceRegistry.js} +0 -0
- /package/dist/lib/factories/{provider-factory.d.ts → providerFactory.d.ts} +0 -0
- /package/dist/lib/factories/{provider-factory.js → providerFactory.js} +0 -0
- /package/dist/lib/factories/{provider-registry.d.ts → providerRegistry.d.ts} +0 -0
- /package/dist/lib/mcp/servers/agent/{direct-tools-server.d.ts → directToolsServer.d.ts} +0 -0
- /package/dist/lib/mcp/servers/{ai-providers/ai-analysis-tools.d.ts → aiProviders/aiAnalysisTools.d.ts} +0 -0
- /package/dist/lib/mcp/servers/{ai-providers/ai-analysis-tools.js → aiProviders/aiAnalysisTools.js} +0 -0
- /package/dist/lib/mcp/servers/{ai-providers/ai-core-server.d.ts → aiProviders/aiCoreServer.d.ts} +0 -0
- /package/dist/lib/mcp/servers/{ai-providers/ai-workflow-tools.d.ts → aiProviders/aiWorkflowTools.d.ts} +0 -0
- /package/dist/lib/mcp/servers/{ai-providers/ai-workflow-tools.js → aiProviders/aiWorkflowTools.js} +0 -0
- /package/dist/lib/mcp/servers/utilities/{utility-server.d.ts → utilityServer.d.ts} +0 -0
- /package/dist/lib/mcp/servers/utilities/{utility-server.js → utilityServer.js} +0 -0
- /package/dist/lib/proxy/{proxy-fetch.d.ts → proxyFetch.d.ts} +0 -0
- /package/dist/lib/proxy/{proxy-fetch.js → proxyFetch.js} +0 -0
- /package/dist/lib/telemetry/{telemetry-service.d.ts → telemetryService.d.ts} +0 -0
- /package/dist/lib/telemetry/{telemetry-service.js → telemetryService.js} +0 -0
- /package/dist/lib/types/{generate-types.d.ts → generateTypes.d.ts} +0 -0
- /package/dist/lib/types/{generate-types.js → generateTypes.js} +0 -0
- /package/dist/lib/types/{mcp-types.d.ts → mcpTypes.d.ts} +0 -0
- /package/dist/lib/types/{mcp-types.js → mcpTypes.js} +0 -0
- /package/dist/lib/types/{stream-types.d.ts → streamTypes.d.ts} +0 -0
- /package/dist/lib/types/{stream-types.js → streamTypes.js} +0 -0
- /package/dist/lib/types/{universal-provider-options.d.ts → universalProviderOptions.d.ts} +0 -0
- /package/dist/lib/types/{universal-provider-options.js → universalProviderOptions.js} +0 -0
- /package/dist/lib/utils/{provider-setup-messages.d.ts → providerSetupMessages.d.ts} +0 -0
- /package/dist/mcp/servers/agent/{direct-tools-server.d.ts → directToolsServer.d.ts} +0 -0
- /package/dist/mcp/servers/{ai-providers/ai-analysis-tools.d.ts → aiProviders/aiAnalysisTools.d.ts} +0 -0
- /package/dist/mcp/servers/{ai-providers/ai-analysis-tools.js → aiProviders/aiAnalysisTools.js} +0 -0
- /package/dist/mcp/servers/{ai-providers/ai-core-server.d.ts → aiProviders/aiCoreServer.d.ts} +0 -0
- /package/dist/mcp/servers/{ai-providers/ai-workflow-tools.d.ts → aiProviders/aiWorkflowTools.d.ts} +0 -0
- /package/dist/mcp/servers/{ai-providers/ai-workflow-tools.js → aiProviders/aiWorkflowTools.js} +0 -0
- /package/dist/mcp/servers/utilities/{utility-server.d.ts → utilityServer.d.ts} +0 -0
- /package/dist/mcp/servers/utilities/{utility-server.js → utilityServer.js} +0 -0
- /package/dist/proxy/{proxy-fetch.d.ts → proxyFetch.d.ts} +0 -0
- /package/dist/proxy/{proxy-fetch.js → proxyFetch.js} +0 -0
- /package/dist/telemetry/{telemetry-service.d.ts → telemetryService.d.ts} +0 -0
- /package/dist/telemetry/{telemetry-service.js → telemetryService.js} +0 -0
- /package/dist/types/{generate-types.d.ts → generateTypes.d.ts} +0 -0
- /package/dist/types/{generate-types.js → generateTypes.js} +0 -0
- /package/dist/types/{mcp-types.d.ts → mcpTypes.d.ts} +0 -0
- /package/dist/types/{mcp-types.js → mcpTypes.js} +0 -0
- /package/dist/types/{stream-types.d.ts → streamTypes.d.ts} +0 -0
- /package/dist/types/{stream-types.js → streamTypes.js} +0 -0
- /package/dist/types/{universal-provider-options.d.ts → universalProviderOptions.d.ts} +0 -0
- /package/dist/types/{universal-provider-options.js → universalProviderOptions.js} +0 -0
- /package/dist/utils/{provider-setup-messages.d.ts → providerSetupMessages.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* Anthropic Provider v2 - BaseProvider Implementation
|
|
8
8
|
* Fixed syntax and enhanced with proper error handling
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { anthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
6
6
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
package/dist/{lib/providers/anthropic-baseprovider.d.ts → providers/anthropicBaseProvider.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* Anthropic provider implementation using BaseProvider pattern
|
|
8
8
|
* Migrated from direct API calls to Vercel AI SDK (@ai-sdk/anthropic)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
6
6
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
|
-
import { BaseProvider } from "../core/
|
|
2
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
export declare class AzureOpenAIProvider extends BaseProvider {
|
|
6
6
|
private apiKey;
|
|
7
7
|
private resourceName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAzure } from "@ai-sdk/azure";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { validateApiKey, createAzureAPIKeyConfig, createAzureEndpointConfig, } from "../utils/providerConfig.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
export class AzureOpenAIProvider extends BaseProvider {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* Google AI Studio provider implementation using BaseProvider
|
|
8
8
|
* Migrated from original GoogleAIStudio class to new factory pattern
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
3
|
import { GoogleAIModels } from "../core/types.js";
|
|
4
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
7
7
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
8
|
-
import { createProxyFetch } from "../proxy/
|
|
8
|
+
import { createProxyFetch } from "../proxy/proxyFetch.js";
|
|
9
9
|
// Environment variable setup
|
|
10
10
|
if (!process.env.GOOGLE_GENERATIVE_AI_API_KEY &&
|
|
11
11
|
process.env.GOOGLE_AI_API_KEY) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* Google Vertex AI Provider v2 - BaseProvider Implementation
|
|
8
8
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVertex, } from "@ai-sdk/google-vertex";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
6
6
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import type { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* HuggingFace Provider - BaseProvider Implementation
|
|
8
8
|
* Using AI SDK with HuggingFace's OpenAI-compatible endpoint
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createOpenAI } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
6
6
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Provider exports for Vercel AI SDK integration
|
|
3
3
|
* This file centralizes all AI provider classes for easy import and usage
|
|
4
4
|
*/
|
|
5
|
-
export { GoogleVertexProvider as GoogleVertexAI } from "./
|
|
6
|
-
export { AmazonBedrockProvider as AmazonBedrock } from "./
|
|
5
|
+
export { GoogleVertexProvider as GoogleVertexAI } from "./googleVertex.js";
|
|
6
|
+
export { AmazonBedrockProvider as AmazonBedrock } from "./amazonBedrock.js";
|
|
7
7
|
export { OpenAIProvider as OpenAI } from "./openAI.js";
|
|
8
8
|
export { AnthropicProvider as AnthropicProvider } from "./anthropic.js";
|
|
9
|
-
export { AzureOpenAIProvider } from "./
|
|
10
|
-
export { GoogleAIStudioProvider as GoogleAIStudio } from "./
|
|
9
|
+
export { AzureOpenAIProvider } from "./azureOpenai.js";
|
|
10
|
+
export { GoogleAIStudioProvider as GoogleAIStudio } from "./googleAiStudio.js";
|
|
11
11
|
export { HuggingFaceProvider as HuggingFace } from "./huggingFace.js";
|
|
12
12
|
export { OllamaProvider as Ollama } from "./ollama.js";
|
|
13
13
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
package/dist/providers/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Provider exports for Vercel AI SDK integration
|
|
3
3
|
* This file centralizes all AI provider classes for easy import and usage
|
|
4
4
|
*/
|
|
5
|
-
export { GoogleVertexProvider as GoogleVertexAI } from "./
|
|
6
|
-
export { AmazonBedrockProvider as AmazonBedrock } from "./
|
|
5
|
+
export { GoogleVertexProvider as GoogleVertexAI } from "./googleVertex.js";
|
|
6
|
+
export { AmazonBedrockProvider as AmazonBedrock } from "./amazonBedrock.js";
|
|
7
7
|
export { OpenAIProvider as OpenAI } from "./openAI.js";
|
|
8
8
|
export { AnthropicProvider as AnthropicProvider } from "./anthropic.js";
|
|
9
|
-
export { AzureOpenAIProvider } from "./
|
|
10
|
-
export { GoogleAIStudioProvider as GoogleAIStudio } from "./
|
|
9
|
+
export { AzureOpenAIProvider } from "./azureOpenai.js";
|
|
10
|
+
export { GoogleAIStudioProvider as GoogleAIStudio } from "./googleAiStudio.js";
|
|
11
11
|
export { HuggingFaceProvider as HuggingFace } from "./huggingFace.js";
|
|
12
12
|
export { OllamaProvider as Ollama } from "./ollama.js";
|
|
13
13
|
export { MistralProvider as MistralAI } from "./mistral.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { AIProviderName, TextGenerationOptions, EnhancedGenerateResult } from "../core/types.js";
|
|
3
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
4
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
4
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
/**
|
|
6
6
|
* Mistral AI Provider v2 - BaseProvider Implementation
|
|
7
7
|
* Supports official AI-SDK integration with all Mistral models
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createMistral } from "@ai-sdk/mistral";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { BaseProvider } from "../core/
|
|
3
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
4
|
import { logger } from "../utils/logger.js";
|
|
5
5
|
import { createAnalytics } from "../core/analytics.js";
|
|
6
6
|
import { validateApiKey, createMistralConfig, getProviderModel, } from "../utils/providerConfig.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { AIProviderName } from "../core/types.js";
|
|
2
2
|
import type { LanguageModelV1 } from "ai";
|
|
3
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
3
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
4
4
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
5
5
|
import type { Schema } from "ai";
|
|
6
|
-
import { BaseProvider } from "../core/
|
|
6
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
7
7
|
/**
|
|
8
8
|
* Ollama Provider v2 - BaseProvider Implementation
|
|
9
9
|
*
|
package/dist/providers/ollama.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { streamText, Output } from "ai";
|
|
2
|
-
import { BaseProvider } from "../core/
|
|
2
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
3
|
import { logger } from "../utils/logger.js";
|
|
4
4
|
import { getDefaultTimeout, TimeoutError } from "../utils/timeout.js";
|
|
5
5
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
3
|
import { AIProviderName } from "../core/types.js";
|
|
4
|
-
import type { StreamOptions, StreamResult } from "../types/
|
|
5
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* OpenAI Provider v2 - BaseProvider Implementation
|
|
8
8
|
* Migrated to use factory pattern with exact Google AI provider pattern
|
package/dist/providers/openAI.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { openai } from "@ai-sdk/openai";
|
|
2
2
|
import { streamText, Output } from "ai";
|
|
3
3
|
import { AIProviderName } from "../core/types.js";
|
|
4
|
-
import { BaseProvider } from "../core/
|
|
4
|
+
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError, getDefaultTimeout, } from "../utils/timeout.js";
|
|
7
7
|
import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import type { Tool } from "ai";
|
|
7
7
|
import { logger } from "../utils/logger.js";
|
|
8
|
-
import type { InMemoryMCPServerConfig, InMemoryToolInfo } from "../types/
|
|
8
|
+
import type { InMemoryMCPServerConfig, InMemoryToolInfo } from "../types/mcpTypes.js";
|
|
9
9
|
import type { ToolArgs, ToolContext as CoreToolContext, ToolResult, SimpleTool as CoreSimpleTool } from "../types/tools.js";
|
|
10
10
|
import type { JsonValue } from "../types/common.js";
|
|
11
11
|
/**
|
|
@@ -140,6 +140,13 @@ export function validateTool(name, tool) {
|
|
|
140
140
|
`Received: ${typeof tool.execute}. ` +
|
|
141
141
|
`Example: { execute: async (params) => { return { success: true, data: result }; } }`);
|
|
142
142
|
}
|
|
143
|
+
// Check for common mistake: using 'schema' instead of 'parameters'
|
|
144
|
+
if ('schema' in tool && !('parameters' in tool)) {
|
|
145
|
+
throw new Error(`Tool '${name}' uses 'schema' property, but NeuroLink expects 'parameters'. ` +
|
|
146
|
+
`Please change 'schema' to 'parameters' and use a Zod schema: ` +
|
|
147
|
+
`{ parameters: z.object({ ... }), execute: ... } ` +
|
|
148
|
+
`See documentation: https://docs.neurolink.com/tools`);
|
|
149
|
+
}
|
|
143
150
|
// Validate parameters schema if provided - support both Zod and custom schemas
|
|
144
151
|
if (tool.parameters) {
|
|
145
152
|
if (typeof tool.parameters !== "object") {
|
|
@@ -151,6 +158,16 @@ export function validateTool(name, tool) {
|
|
|
151
158
|
const hasValidationMethod = typeof params.parse === "function" ||
|
|
152
159
|
typeof params.validate === "function" ||
|
|
153
160
|
"_def" in params; // Zod schemas have _def property
|
|
161
|
+
// Check for plain JSON schema objects (common mistake)
|
|
162
|
+
if ('type' in params && 'properties' in params && !hasValidationMethod) {
|
|
163
|
+
throw new Error(`Tool '${name}' appears to use a plain JSON schema object as parameters. ` +
|
|
164
|
+
`NeuroLink requires a Zod schema for proper type validation and tool integration. ` +
|
|
165
|
+
`Please change from:\n` +
|
|
166
|
+
` { type: 'object', properties: { ... } }\n` +
|
|
167
|
+
`To:\n` +
|
|
168
|
+
` z.object({ fieldName: z.string() })\n` +
|
|
169
|
+
`Import Zod with: import { z } from 'zod'`);
|
|
170
|
+
}
|
|
154
171
|
if (!hasValidationMethod) {
|
|
155
172
|
const errorMessage = typeof params.parse === "function" || "_def" in params
|
|
156
173
|
? `Tool '${name}' has a Zod-like schema but validation failed. Ensure it's a valid Zod schema: z.object({ ... })`
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { TelemetryService, type HealthMetrics } from "./
|
|
1
|
+
export { TelemetryService, type HealthMetrics } from "./telemetryService.js";
|
|
2
2
|
/**
|
|
3
3
|
* Initialize telemetry for NeuroLink
|
|
4
4
|
* OPTIONAL - Only works when NEUROLINK_TELEMETRY_ENABLED=true
|
|
5
5
|
*/
|
|
6
|
-
export declare function initializeTelemetry(): Promise<import("./
|
|
6
|
+
export declare function initializeTelemetry(): Promise<import("./telemetryService.js").TelemetryService>;
|
|
7
7
|
/**
|
|
8
8
|
* Get telemetry status
|
|
9
9
|
*/
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Optional Telemetry Infrastructure (Phase 2)
|
|
2
|
-
export { TelemetryService } from "./
|
|
2
|
+
export { TelemetryService } from "./telemetryService.js";
|
|
3
3
|
import { logger } from "../utils/logger.js";
|
|
4
4
|
/**
|
|
5
5
|
* Initialize telemetry for NeuroLink
|
|
6
6
|
* OPTIONAL - Only works when NEUROLINK_TELEMETRY_ENABLED=true
|
|
7
7
|
*/
|
|
8
8
|
export async function initializeTelemetry() {
|
|
9
|
-
const { TelemetryService } = await import("./
|
|
9
|
+
const { TelemetryService } = await import("./telemetryService.js");
|
|
10
10
|
const telemetry = TelemetryService.getInstance();
|
|
11
11
|
if (telemetry.isEnabled()) {
|
|
12
12
|
await telemetry.initialize();
|
|
@@ -18,6 +18,6 @@ export async function initializeTelemetry() {
|
|
|
18
18
|
* Get telemetry status
|
|
19
19
|
*/
|
|
20
20
|
export async function getTelemetryStatus() {
|
|
21
|
-
const { TelemetryService } = await import("./
|
|
21
|
+
const { TelemetryService } = await import("./telemetryService.js");
|
|
22
22
|
return TelemetryService.getInstance().getStatus();
|
|
23
23
|
}
|
package/dist/utils/logger.js
CHANGED
|
@@ -23,11 +23,7 @@ class NeuroLinkLogger {
|
|
|
23
23
|
process.argv.includes("--debug") ||
|
|
24
24
|
process.env.NEUROLINK_DEBUG === "true";
|
|
25
25
|
// Check NEUROLINK_LOG_LEVEL for consistency with the unified NeuroLink logger
|
|
26
|
-
|
|
27
|
-
// Fallback to MCP_LOG_LEVEL for backward compatibility (if needed)
|
|
28
|
-
if (!envLevel) {
|
|
29
|
-
envLevel = process.env.MCP_LOG_LEVEL?.toLowerCase();
|
|
30
|
-
}
|
|
26
|
+
const envLevel = process.env.NEUROLINK_LOG_LEVEL?.toLowerCase();
|
|
31
27
|
if (envLevel && ["debug", "info", "warn", "error"].includes(envLevel)) {
|
|
32
28
|
this.logLevel = envLevel;
|
|
33
29
|
}
|
|
@@ -36,8 +32,11 @@ class NeuroLinkLogger {
|
|
|
36
32
|
this.logLevel = level;
|
|
37
33
|
}
|
|
38
34
|
shouldLog(level) {
|
|
35
|
+
// Dynamic debug mode check to handle CLI middleware timing
|
|
36
|
+
const currentDebugMode = process.argv.includes("--debug") ||
|
|
37
|
+
process.env.NEUROLINK_DEBUG === "true";
|
|
39
38
|
// Hide all logs except errors unless debugging
|
|
40
|
-
if (!
|
|
39
|
+
if (!currentDebugMode && level !== "error") {
|
|
41
40
|
return false;
|
|
42
41
|
}
|
|
43
42
|
const levels = ["debug", "info", "warn", "error"];
|
|
@@ -15,7 +15,7 @@ const API_KEY_FORMATS = {
|
|
|
15
15
|
mistral: /^[A-Za-z0-9]{32}$/,
|
|
16
16
|
azure: /^[A-Za-z0-9]{32,}$/,
|
|
17
17
|
aws: /^[A-Z0-9]{20}$/, // Access Key ID format
|
|
18
|
-
|
|
18
|
+
googleVertex: /^[A-Za-z0-9\-_]{1,}$/, // Project ID format
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* Validates API key format for a specific provider
|
|
@@ -57,7 +57,7 @@ export function getProviderSetupMessage(provider, missingVars) {
|
|
|
57
57
|
azure: {
|
|
58
58
|
guide: "Set up Azure OpenAI resource and create deployment",
|
|
59
59
|
envVars: [
|
|
60
|
-
'AZURE_OPENAI_API_KEY="your-
|
|
60
|
+
'AZURE_OPENAI_API_KEY="your-azureOpenai-key"',
|
|
61
61
|
'AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/"',
|
|
62
62
|
'AZURE_OPENAI_DEPLOYMENT_ID="your-deployment-name"',
|
|
63
63
|
"# Optional:",
|
|
@@ -105,10 +105,17 @@ export function hasProviderEnvVars(provider) {
|
|
|
105
105
|
case "aws":
|
|
106
106
|
return !!(process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY);
|
|
107
107
|
case "vertex":
|
|
108
|
+
case "googlevertex":
|
|
108
109
|
case "google":
|
|
109
110
|
case "gemini":
|
|
110
|
-
return !!(process.env.
|
|
111
|
-
process.env.
|
|
111
|
+
return !!((process.env.GOOGLE_CLOUD_PROJECT_ID ||
|
|
112
|
+
process.env.VERTEX_PROJECT_ID ||
|
|
113
|
+
process.env.GOOGLE_VERTEX_PROJECT ||
|
|
114
|
+
process.env.GOOGLE_CLOUD_PROJECT) &&
|
|
115
|
+
(process.env.GOOGLE_APPLICATION_CREDENTIALS ||
|
|
116
|
+
process.env.GOOGLE_SERVICE_ACCOUNT_KEY ||
|
|
117
|
+
(process.env.GOOGLE_AUTH_CLIENT_EMAIL &&
|
|
118
|
+
process.env.GOOGLE_AUTH_PRIVATE_KEY)));
|
|
112
119
|
case "openai":
|
|
113
120
|
case "gpt":
|
|
114
121
|
return !!process.env.OPENAI_API_KEY;
|
|
@@ -116,7 +123,7 @@ export function hasProviderEnvVars(provider) {
|
|
|
116
123
|
case "claude":
|
|
117
124
|
return !!process.env.ANTHROPIC_API_KEY;
|
|
118
125
|
case "azure":
|
|
119
|
-
case "
|
|
126
|
+
case "azureOpenai":
|
|
120
127
|
return !!process.env.AZURE_OPENAI_API_KEY;
|
|
121
128
|
case "google-ai":
|
|
122
129
|
case "google-studio":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|
|
@@ -37,48 +37,48 @@
|
|
|
37
37
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
|
38
38
|
"test": "vitest",
|
|
39
39
|
"test:run": "vitest run",
|
|
40
|
-
"test:
|
|
41
|
-
"
|
|
40
|
+
"test:dynamicModels": "node test-dynamicModels.js",
|
|
41
|
+
"modelServer": "node scripts/modelServer.js",
|
|
42
42
|
"lint": "prettier --check . && eslint .",
|
|
43
43
|
"format": "prettier --write .",
|
|
44
44
|
"changeset": "changeset",
|
|
45
45
|
"changeset:version": "changeset version && git add --all",
|
|
46
46
|
"// ===== NEUROLINK DEVELOPER EXPERIENCE ENHANCEMENT 2.0 =====": "",
|
|
47
47
|
"// Environment & Setup (pnpm-first)": "",
|
|
48
|
-
"setup": "pnpm install && node tools/automation/
|
|
48
|
+
"setup": "pnpm install && node tools/automation/environmentManager.js",
|
|
49
49
|
"setup:complete": "pnpm run setup && pnpm run project:organize && pnpm run env:validate",
|
|
50
|
-
"env:setup": "node tools/automation/
|
|
51
|
-
"env:validate": "node tools/automation/
|
|
52
|
-
"env:backup": "node tools/automation/
|
|
53
|
-
"env:list-backups": "node tools/automation/
|
|
50
|
+
"env:setup": "node tools/automation/environmentManager.js",
|
|
51
|
+
"env:validate": "node tools/automation/environmentManager.js --validate",
|
|
52
|
+
"env:backup": "node tools/automation/environmentManager.js --backup",
|
|
53
|
+
"env:list-backups": "node tools/automation/environmentManager.js --list-backups",
|
|
54
54
|
"// Project Management & Analysis": "",
|
|
55
|
-
"project:analyze": "node tools/automation/
|
|
56
|
-
"project:cleanup": "node tools/automation/
|
|
57
|
-
"project:organize": "node tools/automation/
|
|
58
|
-
"project:health": "node tools/development/
|
|
55
|
+
"project:analyze": "node tools/automation/scriptAnalyzer.js",
|
|
56
|
+
"project:cleanup": "node tools/automation/scriptAnalyzer.js --execute",
|
|
57
|
+
"project:organize": "node tools/automation/projectOrganizer.js",
|
|
58
|
+
"project:health": "node tools/development/healthMonitor.js",
|
|
59
59
|
"// Shell Script Conversion": "",
|
|
60
|
-
"convert:shell-scripts": "node tools/automation/
|
|
61
|
-
"convert:specific": "node tools/automation/
|
|
60
|
+
"convert:shell-scripts": "node tools/automation/shellConverter.js",
|
|
61
|
+
"convert:specific": "node tools/automation/shellConverter.js --specific",
|
|
62
62
|
"// Testing (Enhanced & Adaptive)": "",
|
|
63
|
-
"test:smart": "node tools/testing/
|
|
64
|
-
"test:providers": "node tools/testing/
|
|
65
|
-
"test:performance": "node tools/testing/
|
|
63
|
+
"test:smart": "node tools/testing/adaptiveTestRunner.js",
|
|
64
|
+
"test:providers": "node tools/testing/providerValidator.js",
|
|
65
|
+
"test:performance": "node tools/testing/performanceMonitor.js",
|
|
66
66
|
"test:coverage": "vitest run --coverage",
|
|
67
67
|
"test:ci": "pnpm run test:smart && pnpm run test:coverage",
|
|
68
68
|
"// Content Generation (Cross-platform JS)": "",
|
|
69
69
|
"content:screenshots": "node tools/content/screenshot-automation.js",
|
|
70
|
-
"content:videos": "node tools/converted-scripts/
|
|
71
|
-
"content:cleanup": "node tools/converted-scripts/
|
|
70
|
+
"content:videos": "node tools/converted-scripts/generateAllVideos.js",
|
|
71
|
+
"content:cleanup": "node tools/converted-scripts/cleanupHashNamedVideos.js",
|
|
72
72
|
"content:all": "pnpm run content:screenshots && pnpm run content:videos",
|
|
73
73
|
"// Documentation Automation": "",
|
|
74
|
-
"docs:validate": "node tools/content/
|
|
74
|
+
"docs:validate": "node tools/content/documentationSync.js --validate",
|
|
75
75
|
"docs:generate": "pnpm run docs:validate && pnpm run content:screenshots",
|
|
76
76
|
"// Development & Monitoring": "",
|
|
77
77
|
"dev:full": "node tools/development/dev-server.js",
|
|
78
|
-
"dev:health": "node tools/development/
|
|
78
|
+
"dev:health": "node tools/development/healthMonitor.js",
|
|
79
79
|
"dev:demo": "concurrently \"pnpm run dev\" \"node neurolink-demo/complete-enhanced-server.js\"",
|
|
80
80
|
"// Build & Deploy (Complete Pipeline)": "",
|
|
81
|
-
"build:complete": "node tools/automation/
|
|
81
|
+
"build:complete": "node tools/automation/buildSystem.js",
|
|
82
82
|
"build:analyze": "node tools/development/dependency-analyzer.js",
|
|
83
83
|
"// Quality & Maintenance": "",
|
|
84
84
|
"quality:all": "pnpm run lint && pnpm run format && pnpm run test:ci",
|
|
@@ -243,6 +243,7 @@
|
|
|
243
243
|
"pnpm": {
|
|
244
244
|
"onlyBuiltDependencies": [
|
|
245
245
|
"esbuild",
|
|
246
|
+
"protobufjs",
|
|
246
247
|
"puppeteer"
|
|
247
248
|
]
|
|
248
249
|
},
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CommandModule } from "yargs";
|
|
2
|
-
import type { UnknownRecord } from "../../lib/types/common.js";
|
|
3
|
-
/**
|
|
4
|
-
* CLI Command Factory for generate commands
|
|
5
|
-
*/
|
|
6
|
-
export declare class CLICommandFactory {
|
|
7
|
-
/**
|
|
8
|
-
* Create the new primary 'generate' command
|
|
9
|
-
*/
|
|
10
|
-
static createGenerateCommand(): CommandModule;
|
|
11
|
-
/**
|
|
12
|
-
* Execute provider status command
|
|
13
|
-
*/
|
|
14
|
-
executeProviderStatus(argv: UnknownRecord): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Execute the generate command
|
|
17
|
-
*/
|
|
18
|
-
private static executeGenerate;
|
|
19
|
-
}
|