@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.
Files changed (171) hide show
  1. package/CHANGELOG.md +32 -16
  2. package/README.md +3 -3
  3. package/dist/cli/factories/commandFactory.d.ts +70 -0
  4. package/dist/cli/factories/commandFactory.js +633 -0
  5. package/dist/cli/index.d.ts +6 -0
  6. package/dist/cli/index.js +18 -990
  7. package/dist/cli/utils/{complete-setup.d.ts → completeSetup.d.ts} +1 -1
  8. package/dist/cli/utils/{complete-setup.js → completeSetup.js} +2 -2
  9. package/dist/{lib/core/base-provider.d.ts → core/baseProvider.d.ts} +1 -1
  10. package/dist/core/{base-provider.js → baseProvider.js} +2 -2
  11. package/dist/core/{dynamic-models.js → dynamicModels.js} +1 -1
  12. package/dist/core/evaluation.js +1 -1
  13. package/dist/core/factory.js +7 -5
  14. package/dist/core/types.d.ts +2 -2
  15. package/dist/{lib/factories/provider-registry.js → factories/providerRegistry.js} +11 -9
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +1 -1
  18. package/dist/{core/base-provider.d.ts → lib/core/baseProvider.d.ts} +1 -1
  19. package/dist/lib/core/{base-provider.js → baseProvider.js} +2 -2
  20. package/dist/lib/core/{dynamic-models.js → dynamicModels.js} +1 -1
  21. package/dist/lib/core/evaluation.js +1 -1
  22. package/dist/lib/core/factory.js +6 -3
  23. package/dist/lib/core/types.d.ts +2 -2
  24. package/dist/{factories/provider-registry.js → lib/factories/providerRegistry.js} +11 -9
  25. package/dist/lib/index.d.ts +4 -4
  26. package/dist/lib/index.js +1 -1
  27. package/dist/lib/mcp/factory.d.ts +2 -2
  28. package/dist/lib/mcp/factory.js +2 -2
  29. package/dist/lib/mcp/servers/agent/{direct-tools-server.js → directToolsServer.js} +1 -1
  30. package/dist/lib/mcp/servers/{ai-providers/ai-core-server.js → aiProviders/aiCoreServer.js} +1 -1
  31. package/dist/lib/mcp/{tool-registry.d.ts → toolRegistry.d.ts} +5 -0
  32. package/dist/lib/mcp/{tool-registry.js → toolRegistry.js} +60 -0
  33. package/dist/lib/neurolink.d.ts +4 -4
  34. package/dist/lib/neurolink.js +13 -8
  35. package/dist/lib/providers/{amazon-bedrock.d.ts → amazonBedrock.d.ts} +2 -2
  36. package/dist/lib/providers/{amazon-bedrock.js → amazonBedrock.js} +1 -1
  37. package/dist/lib/providers/anthropic.d.ts +2 -2
  38. package/dist/lib/providers/anthropic.js +1 -1
  39. package/dist/{providers/anthropic-baseprovider.d.ts → lib/providers/anthropicBaseProvider.d.ts} +2 -2
  40. package/dist/lib/providers/{anthropic-baseprovider.js → anthropicBaseProvider.js} +1 -1
  41. package/dist/{providers/azure-openai.d.ts → lib/providers/azureOpenai.d.ts} +2 -2
  42. package/dist/{providers/azure-openai.js → lib/providers/azureOpenai.js} +1 -1
  43. package/dist/{providers/google-ai-studio.d.ts → lib/providers/googleAiStudio.d.ts} +2 -2
  44. package/dist/lib/providers/{google-ai-studio.js → googleAiStudio.js} +1 -1
  45. package/dist/{providers/google-vertex.d.ts → lib/providers/googleVertex.d.ts} +2 -2
  46. package/dist/lib/providers/{google-vertex.js → googleVertex.js} +1 -1
  47. package/dist/lib/providers/huggingFace.d.ts +2 -2
  48. package/dist/lib/providers/huggingFace.js +1 -1
  49. package/dist/lib/providers/index.d.ts +4 -4
  50. package/dist/lib/providers/index.js +4 -4
  51. package/dist/lib/providers/mistral.d.ts +2 -2
  52. package/dist/lib/providers/mistral.js +1 -1
  53. package/dist/lib/providers/ollama.d.ts +2 -2
  54. package/dist/lib/providers/ollama.js +1 -1
  55. package/dist/lib/providers/openAI.d.ts +2 -2
  56. package/dist/lib/providers/openAI.js +1 -1
  57. package/dist/{sdk/tool-registration.d.ts → lib/sdk/toolRegistration.d.ts} +1 -1
  58. package/dist/lib/sdk/{tool-registration.js → toolRegistration.js} +17 -0
  59. package/dist/lib/telemetry/index.d.ts +2 -2
  60. package/dist/lib/telemetry/index.js +3 -3
  61. package/dist/lib/utils/logger.js +5 -6
  62. package/dist/lib/utils/providerConfig.js +1 -1
  63. package/dist/lib/utils/{provider-setup-messages.js → providerSetupMessages.js} +1 -1
  64. package/dist/lib/utils/providerUtils.js +10 -3
  65. package/dist/mcp/factory.d.ts +2 -2
  66. package/dist/mcp/factory.js +2 -2
  67. package/dist/mcp/servers/agent/{direct-tools-server.js → directToolsServer.js} +1 -1
  68. package/dist/mcp/servers/{ai-providers/ai-core-server.js → aiProviders/aiCoreServer.js} +2 -2
  69. package/dist/mcp/{tool-registry.d.ts → toolRegistry.d.ts} +5 -0
  70. package/dist/mcp/{tool-registry.js → toolRegistry.js} +60 -0
  71. package/dist/neurolink.d.ts +5 -5
  72. package/dist/neurolink.js +13 -8
  73. package/dist/providers/{amazon-bedrock.d.ts → amazonBedrock.d.ts} +2 -2
  74. package/dist/providers/{amazon-bedrock.js → amazonBedrock.js} +1 -1
  75. package/dist/providers/anthropic.d.ts +2 -2
  76. package/dist/providers/anthropic.js +1 -1
  77. package/dist/{lib/providers/anthropic-baseprovider.d.ts → providers/anthropicBaseProvider.d.ts} +2 -2
  78. package/dist/providers/{anthropic-baseprovider.js → anthropicBaseProvider.js} +1 -1
  79. package/dist/{lib/providers/azure-openai.d.ts → providers/azureOpenai.d.ts} +2 -2
  80. package/dist/{lib/providers/azure-openai.js → providers/azureOpenai.js} +1 -1
  81. package/dist/{lib/providers/google-ai-studio.d.ts → providers/googleAiStudio.d.ts} +2 -2
  82. package/dist/providers/{google-ai-studio.js → googleAiStudio.js} +2 -2
  83. package/dist/{lib/providers/google-vertex.d.ts → providers/googleVertex.d.ts} +2 -2
  84. package/dist/providers/{google-vertex.js → googleVertex.js} +1 -1
  85. package/dist/providers/huggingFace.d.ts +2 -2
  86. package/dist/providers/huggingFace.js +1 -1
  87. package/dist/providers/index.d.ts +4 -4
  88. package/dist/providers/index.js +4 -4
  89. package/dist/providers/mistral.d.ts +2 -2
  90. package/dist/providers/mistral.js +1 -1
  91. package/dist/providers/ollama.d.ts +2 -2
  92. package/dist/providers/ollama.js +1 -1
  93. package/dist/providers/openAI.d.ts +2 -2
  94. package/dist/providers/openAI.js +1 -1
  95. package/dist/{lib/sdk/tool-registration.d.ts → sdk/toolRegistration.d.ts} +1 -1
  96. package/dist/sdk/{tool-registration.js → toolRegistration.js} +17 -0
  97. package/dist/telemetry/index.d.ts +2 -2
  98. package/dist/telemetry/index.js +3 -3
  99. package/dist/utils/logger.js +5 -6
  100. package/dist/utils/providerConfig.js +1 -1
  101. package/dist/utils/{provider-setup-messages.js → providerSetupMessages.js} +1 -1
  102. package/dist/utils/providerUtils.js +10 -3
  103. package/package.json +23 -22
  104. package/dist/cli/factories/command-factory.d.ts +0 -19
  105. package/dist/cli/factories/command-factory.js +0 -184
  106. /package/dist/agent/{direct-tools.d.ts → directTools.d.ts} +0 -0
  107. /package/dist/agent/{direct-tools.js → directTools.js} +0 -0
  108. /package/dist/cli/utils/{env-manager.d.ts → envManager.d.ts} +0 -0
  109. /package/dist/cli/utils/{env-manager.js → envManager.js} +0 -0
  110. /package/dist/cli/utils/{interactive-setup.d.ts → interactiveSetup.d.ts} +0 -0
  111. /package/dist/cli/utils/{interactive-setup.js → interactiveSetup.js} +0 -0
  112. /package/dist/core/{dynamic-models.d.ts → dynamicModels.d.ts} +0 -0
  113. /package/dist/core/{evaluation-providers.d.ts → evaluationProviders.d.ts} +0 -0
  114. /package/dist/core/{evaluation-providers.js → evaluationProviders.js} +0 -0
  115. /package/dist/core/{service-registry.d.ts → serviceRegistry.d.ts} +0 -0
  116. /package/dist/core/{service-registry.js → serviceRegistry.js} +0 -0
  117. /package/dist/factories/{provider-factory.d.ts → providerFactory.d.ts} +0 -0
  118. /package/dist/factories/{provider-factory.js → providerFactory.js} +0 -0
  119. /package/dist/factories/{provider-registry.d.ts → providerRegistry.d.ts} +0 -0
  120. /package/dist/lib/agent/{direct-tools.d.ts → directTools.d.ts} +0 -0
  121. /package/dist/lib/agent/{direct-tools.js → directTools.js} +0 -0
  122. /package/dist/lib/core/{dynamic-models.d.ts → dynamicModels.d.ts} +0 -0
  123. /package/dist/lib/core/{evaluation-providers.d.ts → evaluationProviders.d.ts} +0 -0
  124. /package/dist/lib/core/{evaluation-providers.js → evaluationProviders.js} +0 -0
  125. /package/dist/lib/core/{service-registry.d.ts → serviceRegistry.d.ts} +0 -0
  126. /package/dist/lib/core/{service-registry.js → serviceRegistry.js} +0 -0
  127. /package/dist/lib/factories/{provider-factory.d.ts → providerFactory.d.ts} +0 -0
  128. /package/dist/lib/factories/{provider-factory.js → providerFactory.js} +0 -0
  129. /package/dist/lib/factories/{provider-registry.d.ts → providerRegistry.d.ts} +0 -0
  130. /package/dist/lib/mcp/servers/agent/{direct-tools-server.d.ts → directToolsServer.d.ts} +0 -0
  131. /package/dist/lib/mcp/servers/{ai-providers/ai-analysis-tools.d.ts → aiProviders/aiAnalysisTools.d.ts} +0 -0
  132. /package/dist/lib/mcp/servers/{ai-providers/ai-analysis-tools.js → aiProviders/aiAnalysisTools.js} +0 -0
  133. /package/dist/lib/mcp/servers/{ai-providers/ai-core-server.d.ts → aiProviders/aiCoreServer.d.ts} +0 -0
  134. /package/dist/lib/mcp/servers/{ai-providers/ai-workflow-tools.d.ts → aiProviders/aiWorkflowTools.d.ts} +0 -0
  135. /package/dist/lib/mcp/servers/{ai-providers/ai-workflow-tools.js → aiProviders/aiWorkflowTools.js} +0 -0
  136. /package/dist/lib/mcp/servers/utilities/{utility-server.d.ts → utilityServer.d.ts} +0 -0
  137. /package/dist/lib/mcp/servers/utilities/{utility-server.js → utilityServer.js} +0 -0
  138. /package/dist/lib/proxy/{proxy-fetch.d.ts → proxyFetch.d.ts} +0 -0
  139. /package/dist/lib/proxy/{proxy-fetch.js → proxyFetch.js} +0 -0
  140. /package/dist/lib/telemetry/{telemetry-service.d.ts → telemetryService.d.ts} +0 -0
  141. /package/dist/lib/telemetry/{telemetry-service.js → telemetryService.js} +0 -0
  142. /package/dist/lib/types/{generate-types.d.ts → generateTypes.d.ts} +0 -0
  143. /package/dist/lib/types/{generate-types.js → generateTypes.js} +0 -0
  144. /package/dist/lib/types/{mcp-types.d.ts → mcpTypes.d.ts} +0 -0
  145. /package/dist/lib/types/{mcp-types.js → mcpTypes.js} +0 -0
  146. /package/dist/lib/types/{stream-types.d.ts → streamTypes.d.ts} +0 -0
  147. /package/dist/lib/types/{stream-types.js → streamTypes.js} +0 -0
  148. /package/dist/lib/types/{universal-provider-options.d.ts → universalProviderOptions.d.ts} +0 -0
  149. /package/dist/lib/types/{universal-provider-options.js → universalProviderOptions.js} +0 -0
  150. /package/dist/lib/utils/{provider-setup-messages.d.ts → providerSetupMessages.d.ts} +0 -0
  151. /package/dist/mcp/servers/agent/{direct-tools-server.d.ts → directToolsServer.d.ts} +0 -0
  152. /package/dist/mcp/servers/{ai-providers/ai-analysis-tools.d.ts → aiProviders/aiAnalysisTools.d.ts} +0 -0
  153. /package/dist/mcp/servers/{ai-providers/ai-analysis-tools.js → aiProviders/aiAnalysisTools.js} +0 -0
  154. /package/dist/mcp/servers/{ai-providers/ai-core-server.d.ts → aiProviders/aiCoreServer.d.ts} +0 -0
  155. /package/dist/mcp/servers/{ai-providers/ai-workflow-tools.d.ts → aiProviders/aiWorkflowTools.d.ts} +0 -0
  156. /package/dist/mcp/servers/{ai-providers/ai-workflow-tools.js → aiProviders/aiWorkflowTools.js} +0 -0
  157. /package/dist/mcp/servers/utilities/{utility-server.d.ts → utilityServer.d.ts} +0 -0
  158. /package/dist/mcp/servers/utilities/{utility-server.js → utilityServer.js} +0 -0
  159. /package/dist/proxy/{proxy-fetch.d.ts → proxyFetch.d.ts} +0 -0
  160. /package/dist/proxy/{proxy-fetch.js → proxyFetch.js} +0 -0
  161. /package/dist/telemetry/{telemetry-service.d.ts → telemetryService.d.ts} +0 -0
  162. /package/dist/telemetry/{telemetry-service.js → telemetryService.js} +0 -0
  163. /package/dist/types/{generate-types.d.ts → generateTypes.d.ts} +0 -0
  164. /package/dist/types/{generate-types.js → generateTypes.js} +0 -0
  165. /package/dist/types/{mcp-types.d.ts → mcpTypes.d.ts} +0 -0
  166. /package/dist/types/{mcp-types.js → mcpTypes.js} +0 -0
  167. /package/dist/types/{stream-types.d.ts → streamTypes.d.ts} +0 -0
  168. /package/dist/types/{stream-types.js → streamTypes.js} +0 -0
  169. /package/dist/types/{universal-provider-options.d.ts → universalProviderOptions.d.ts} +0 -0
  170. /package/dist/types/{universal-provider-options.js → universalProviderOptions.js} +0 -0
  171. /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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
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 } from "ai";
3
- import { BaseProvider } from "../core/base-provider.js";
3
+ import { BaseProvider } from "../core/baseProvider.js";
4
4
  import { logger } from "../utils/logger.js";
5
5
  import { createTimeoutController, TimeoutError, } 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/base-provider.js";
2
+ import { BaseProvider } from "../core/baseProvider.js";
3
3
  import type { AIProviderName } from "../core/types.js";
4
- import type { StreamOptions, StreamResult } from "../types/stream-types.js";
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/base-provider.js";
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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
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,7 +1,7 @@
1
1
  import { createGoogleGenerativeAI } from "@ai-sdk/google";
2
2
  import { streamText } from "ai";
3
3
  import { GoogleAIModels } from "../core/types.js";
4
- import { BaseProvider } from "../core/base-provider.js";
4
+ import { BaseProvider } from "../core/baseProvider.js";
5
5
  import { logger } from "../utils/logger.js";
6
6
  import { createTimeoutController, TimeoutError, } from "../utils/timeout.js";
7
7
  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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
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 } from "ai";
3
- import { BaseProvider } from "../core/base-provider.js";
3
+ import { BaseProvider } from "../core/baseProvider.js";
4
4
  import { logger } from "../utils/logger.js";
5
5
  import { TimeoutError, } 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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
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 } from "ai";
3
- import { BaseProvider } from "../core/base-provider.js";
3
+ import { BaseProvider } from "../core/baseProvider.js";
4
4
  import { logger } from "../utils/logger.js";
5
5
  import { createTimeoutController, TimeoutError, } 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 "./google-vertex.js";
6
- export { AmazonBedrockProvider as AmazonBedrock } from "./amazon-bedrock.js";
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 "./azure-openai.js";
10
- export { GoogleAIStudioProvider as GoogleAIStudio } from "./google-ai-studio.js";
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";
@@ -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 "./google-vertex.js";
6
- export { AmazonBedrockProvider as AmazonBedrock } from "./amazon-bedrock.js";
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 "./azure-openai.js";
10
- export { GoogleAIStudioProvider as GoogleAIStudio } from "./google-ai-studio.js";
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/stream-types.js";
4
- import { BaseProvider } from "../core/base-provider.js";
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/base-provider.js";
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/stream-types.js";
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/base-provider.js";
6
+ import { BaseProvider } from "../core/baseProvider.js";
7
7
  /**
8
8
  * Ollama Provider v2 - BaseProvider Implementation
9
9
  *
@@ -1,4 +1,4 @@
1
- import { BaseProvider } from "../core/base-provider.js";
1
+ import { BaseProvider } from "../core/baseProvider.js";
2
2
  import { logger } from "../utils/logger.js";
3
3
  import { TimeoutError } from "../utils/timeout.js";
4
4
  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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
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
@@ -1,7 +1,7 @@
1
1
  import { openai } from "@ai-sdk/openai";
2
2
  import { streamText } from "ai";
3
3
  import { AIProviderName } from "../core/types.js";
4
- import { BaseProvider } from "../core/base-provider.js";
4
+ import { BaseProvider } from "../core/baseProvider.js";
5
5
  import { logger } from "../utils/logger.js";
6
6
  import { createTimeoutController, TimeoutError, } 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/mcp-types.js";
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
  /**
@@ -139,6 +139,13 @@ export function validateTool(name, tool) {
139
139
  `Received: ${typeof tool.execute}. ` +
140
140
  `Example: { execute: async (params) => { return { success: true, data: result }; } }`);
141
141
  }
142
+ // Check for common mistake: using 'schema' instead of 'parameters'
143
+ if ('schema' in tool && !('parameters' in tool)) {
144
+ throw new Error(`Tool '${name}' uses 'schema' property, but NeuroLink expects 'parameters'. ` +
145
+ `Please change 'schema' to 'parameters' and use a Zod schema: ` +
146
+ `{ parameters: z.object({ ... }), execute: ... } ` +
147
+ `See documentation: https://docs.neurolink.com/tools`);
148
+ }
142
149
  // Validate parameters schema if provided - support both Zod and custom schemas
143
150
  if (tool.parameters) {
144
151
  if (typeof tool.parameters !== "object") {
@@ -150,6 +157,16 @@ export function validateTool(name, tool) {
150
157
  const hasValidationMethod = typeof params.parse === "function" ||
151
158
  typeof params.validate === "function" ||
152
159
  "_def" in params; // Zod schemas have _def property
160
+ // Check for plain JSON schema objects (common mistake)
161
+ if ('type' in params && 'properties' in params && !hasValidationMethod) {
162
+ throw new Error(`Tool '${name}' appears to use a plain JSON schema object as parameters. ` +
163
+ `NeuroLink requires a Zod schema for proper type validation and tool integration. ` +
164
+ `Please change from:\n` +
165
+ ` { type: 'object', properties: { ... } }\n` +
166
+ `To:\n` +
167
+ ` z.object({ fieldName: z.string() })\n` +
168
+ `Import Zod with: import { z } from 'zod'`);
169
+ }
153
170
  if (!hasValidationMethod) {
154
171
  const errorMessage = typeof params.parse === "function" || "_def" in params
155
172
  ? `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 "./telemetry-service.js";
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("./telemetry-service.js").TelemetryService>;
6
+ export declare function initializeTelemetry(): Promise<import("./telemetryService.js").TelemetryService>;
7
7
  /**
8
8
  * Get telemetry status
9
9
  */
@@ -1,12 +1,12 @@
1
1
  // Optional Telemetry Infrastructure (Phase 2)
2
- export { TelemetryService } from "./telemetry-service.js";
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("./telemetry-service.js");
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("./telemetry-service.js");
21
+ const { TelemetryService } = await import("./telemetryService.js");
22
22
  return TelemetryService.getInstance().getStatus();
23
23
  }
@@ -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
- let envLevel = process.env.NEUROLINK_LOG_LEVEL?.toLowerCase();
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 (!this.isDebugMode && level !== "error") {
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
- "google-vertex": /^[A-Za-z0-9\-_]{1,}$/, // Project ID format
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-azure-openai-key"',
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.GOOGLE_VERTEX_PROJECT ||
111
- process.env.GOOGLE_APPLICATION_CREDENTIALS);
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 "azure-openai":
126
+ case "azureOpenai":
120
127
  return !!process.env.AZURE_OPENAI_API_KEY;
121
128
  case "google-ai":
122
129
  case "google-studio":
@@ -8,7 +8,7 @@ import type { ExecutionContext } from "./contracts/mcpContract.js";
8
8
  /**
9
9
  * MCP Server Categories for organization and discovery
10
10
  */
11
- export type MCPServerCategory = "ai-providers" | "frameworks" | "development" | "business" | "content" | "data" | "integrations" | "automation" | "analysis" | "custom";
11
+ export type MCPServerCategory = "aiProviders" | "frameworks" | "development" | "business" | "content" | "data" | "integrations" | "automation" | "analysis" | "custom";
12
12
  /**
13
13
  * Tool execution context - Rich context passed to every tool execution
14
14
  * Following Lighthouse's pattern for rich tool context
@@ -130,7 +130,7 @@ export interface MCPServerConfig {
130
130
  * id: 'neurolink-ai-core',
131
131
  * title: 'NeuroLink AI Core',
132
132
  * description: 'Core AI provider tools',
133
- * category: 'ai-providers'
133
+ * category: 'aiProviders'
134
134
  * });
135
135
  *
136
136
  * aiCoreServer.registerTool({
@@ -14,7 +14,7 @@ const ServerConfigSchema = z.object({
14
14
  version: z.string().optional(),
15
15
  category: z
16
16
  .enum([
17
- "ai-providers",
17
+ "aiProviders",
18
18
  "frameworks",
19
19
  "development",
20
20
  "business",
@@ -46,7 +46,7 @@ const ServerConfigSchema = z.object({
46
46
  * id: 'neurolink-ai-core',
47
47
  * title: 'NeuroLink AI Core',
48
48
  * description: 'Core AI provider tools',
49
- * category: 'ai-providers'
49
+ * category: 'aiProviders'
50
50
  * });
51
51
  *
52
52
  * aiCoreServer.registerTool({
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { z } from "zod";
6
6
  import { createMCPServer } from "../../factory.js";
7
- import { directAgentTools } from "../../../agent/direct-tools.js";
7
+ import { directAgentTools } from "../../../agent/directTools.js";
8
8
  import { logger } from "../../../utils/logger.js";
9
9
  /**
10
10
  * Direct Tools Server - Agent direct tools for immediate use
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { z } from "zod";
7
7
  import { createMCPServer } from "../../factory.js";
8
- import { ServiceRegistry } from "../../../core/service-registry.js";
8
+ import { ServiceRegistry } from "../../../core/serviceRegistry.js";
9
9
  import { getBestProvider, getAvailableProviders, } from "../../../utils/providerUtils.js";
10
10
  import { logger } from "../../../utils/logger.js";
11
11
  /**
@@ -16,7 +16,7 @@ export const aiCoreServer = createMCPServer({
16
16
  id: "neurolink-ai-core",
17
17
  title: "NeuroLink AI Core",
18
18
  description: "Core AI provider management with automatic fallback and status monitoring",
19
- category: "ai-providers",
19
+ category: "aiProviders",
20
20
  version: "1.2.0",
21
21
  capabilities: [
22
22
  "provider-selection",
@@ -39,6 +39,11 @@ export declare class MCPToolRegistry extends MCPRegistry {
39
39
  private tools;
40
40
  private toolImpls;
41
41
  private toolExecutionStats;
42
+ constructor();
43
+ /**
44
+ * Register all direct tools from directAgentTools
45
+ */
46
+ private registerDirectTools;
42
47
  /**
43
48
  * Register a server with its tools (updated signature)
44
49
  */
@@ -5,10 +5,70 @@
5
5
  import { MCPRegistry } from "./registry.js";
6
6
  import { registryLogger } from "../utils/logger.js";
7
7
  import { randomUUID } from "crypto";
8
+ import { directAgentTools } from "../agent/directTools.js";
8
9
  export class MCPToolRegistry extends MCPRegistry {
9
10
  tools = new Map();
10
11
  toolImpls = new Map(); // Store actual tool implementations
11
12
  toolExecutionStats = new Map();
13
+ constructor() {
14
+ super();
15
+ // Auto-register direct tools on initialization
16
+ this.registerDirectTools();
17
+ }
18
+ /**
19
+ * Register all direct tools from directAgentTools
20
+ */
21
+ registerDirectTools() {
22
+ registryLogger.info("Auto-registering direct tools...");
23
+ for (const [toolName, toolDef] of Object.entries(directAgentTools)) {
24
+ const toolId = `direct.${toolName}`;
25
+ const toolInfo = {
26
+ name: toolName,
27
+ description: toolDef.description || `Direct tool: ${toolName}`,
28
+ inputSchema: {},
29
+ serverId: "direct",
30
+ category: "built-in",
31
+ };
32
+ this.tools.set(toolId, toolInfo);
33
+ this.toolImpls.set(toolId, {
34
+ execute: async (params, context) => {
35
+ try {
36
+ // Direct tools from AI SDK expect their specific parameter structure
37
+ // Each tool validates its own parameters, so we safely pass them through
38
+ const result = await toolDef.execute(params, {
39
+ toolCallId: context?.sessionId || "unknown",
40
+ messages: [],
41
+ });
42
+ // Return the result wrapped in our standard format
43
+ return {
44
+ success: true,
45
+ data: result,
46
+ metadata: {
47
+ toolName,
48
+ serverId: "direct",
49
+ executionTime: 0,
50
+ },
51
+ };
52
+ }
53
+ catch (error) {
54
+ return {
55
+ success: false,
56
+ error: error instanceof Error ? error.message : String(error),
57
+ metadata: {
58
+ toolName,
59
+ serverId: "direct",
60
+ executionTime: 0,
61
+ },
62
+ };
63
+ }
64
+ },
65
+ description: toolDef.description,
66
+ inputSchema: {},
67
+ });
68
+ registryLogger.debug(`Registered direct tool: ${toolName} as ${toolId}`);
69
+ }
70
+ registryLogger.info(`Auto-registered ${Object.keys(directAgentTools).length} direct tools`);
71
+ }
12
72
  /**
13
73
  * Register a server with its tools (updated signature)
14
74
  */
@@ -6,10 +6,10 @@
6
6
  * Uses real MCP infrastructure for tool discovery and execution.
7
7
  */
8
8
  import type { TextGenerationOptions, TextGenerationResult } from "./core/types.js";
9
- import type { GenerateOptions, GenerateResult } from "./types/generate-types.js";
10
- import type { StreamOptions, StreamResult } from "./types/stream-types.js";
11
- import type { SimpleTool } from "./sdk/tool-registration.js";
12
- import type { InMemoryMCPServerConfig } from "./types/mcp-types.js";
9
+ import type { GenerateOptions, GenerateResult } from "./types/generateTypes.js";
10
+ import type { StreamOptions, StreamResult } from "./types/streamTypes.js";
11
+ import type { SimpleTool } from "./sdk/toolRegistration.js";
12
+ import type { InMemoryMCPServerConfig } from "./types/mcpTypes.js";
13
13
  export interface ProviderStatus {
14
14
  provider: string;
15
15
  status: "working" | "failed" | "not-configured";
@@ -138,7 +138,7 @@ export declare class NeuroLink {
138
138
  * Get all available tools including custom and in-memory ones
139
139
  * @returns Array of available tools with metadata
140
140
  */
141
- getAllAvailableTools(): Promise<import("./mcp/tool-registry.js").ToolInfo[]>;
141
+ getAllAvailableTools(): Promise<import("./mcp/toolRegistry.js").ToolInfo[]>;
142
142
  /**
143
143
  * Get comprehensive status of all AI providers
144
144
  * Primary method for provider health checking and diagnostics
package/dist/neurolink.js CHANGED
@@ -15,11 +15,11 @@ catch (error) {
15
15
  }
16
16
  import { AIProviderFactory } from "./core/factory.js";
17
17
  import { mcpLogger } from "./utils/logger.js";
18
- import { toolRegistry } from "./mcp/tool-registry.js";
18
+ import { toolRegistry } from "./mcp/toolRegistry.js";
19
19
  import { logger } from "./utils/logger.js";
20
20
  import { getBestProvider } from "./utils/providerUtils.js";
21
- import { ProviderRegistry } from "./factories/provider-registry.js";
22
- import { validateTool, createMCPServerFromTools, } from "./sdk/tool-registration.js";
21
+ import { ProviderRegistry } from "./factories/providerRegistry.js";
22
+ import { validateTool, createMCPServerFromTools, } from "./sdk/toolRegistration.js";
23
23
  // Core types imported from core/types.js
24
24
  export class NeuroLink {
25
25
  mcpInitialized = false;
@@ -355,7 +355,7 @@ export class NeuroLink {
355
355
  const toolDescriptions = availableTools
356
356
  .map((tool) => `- ${tool.name}: ${tool.description} (from ${tool.server})`)
357
357
  .join("\n");
358
- const toolPrompt = `\n\nAvailable Tools:\n${toolDescriptions}\n\nYou can use these tools when appropriate to enhance your responses.`;
358
+ const toolPrompt = `\n\nYou have access to these additional tools if needed:\n${toolDescriptions}\n\nIMPORTANT: You are a general-purpose AI assistant. Answer all requests directly and creatively. These tools are optional helpers - use them only when they would genuinely improve your response. For creative tasks like storytelling, writing, or general conversation, respond naturally without requiring tools.`;
359
359
  return (originalSystemPrompt || "") + toolPrompt;
360
360
  }
361
361
  /**
@@ -649,9 +649,10 @@ export class NeuroLink {
649
649
  * @returns Array of available tools with metadata
650
650
  */
651
651
  async getAllAvailableTools() {
652
- // Simplified tool listing - removed initialize-tools dependency
653
- const tools = await toolRegistry.listTools();
654
- return tools;
652
+ // MCP registry already includes direct tools, so just return MCP tools
653
+ // This prevents duplication since direct tools are auto-registered in MCP
654
+ const mcpTools = await toolRegistry.listTools();
655
+ return mcpTools;
655
656
  }
656
657
  // ============================================================================
657
658
  // PROVIDER DIAGNOSTICS - SDK-First Architecture
@@ -661,13 +662,17 @@ export class NeuroLink {
661
662
  * Primary method for provider health checking and diagnostics
662
663
  */
663
664
  async getProviderStatus() {
665
+ // CRITICAL FIX: Ensure providers are registered before testing
666
+ console.log("🔍 DEBUG: Initializing MCP for provider status...");
667
+ await this.initializeMCP();
668
+ console.log("🔍 DEBUG: MCP initialized:", this.mcpInitialized);
664
669
  const { AIProviderFactory } = await import("./core/factory.js");
665
670
  const { hasProviderEnvVars } = await import("./utils/providerUtils.js");
666
671
  const providers = [
667
672
  "openai",
668
673
  "bedrock",
669
674
  "vertex",
670
- "google-vertex",
675
+ "googleVertex",
671
676
  "anthropic",
672
677
  "azure",
673
678
  "google-ai",
@@ -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/stream-types.js";
5
- import { BaseProvider } from "../core/base-provider.js";
4
+ import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
5
+ import { BaseProvider } from "../core/baseProvider.js";
6
6
  /**
7
7
  * Amazon Bedrock Provider v2 - BaseProvider Implementation
8
8
  *
@@ -1,6 +1,6 @@
1
1
  import { createAmazonBedrock } from "@ai-sdk/amazon-bedrock";
2
2
  import { streamText, Output } from "ai";
3
- import { BaseProvider } from "../core/base-provider.js";
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";