@juspay/neurolink 5.3.0 → 6.0.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 (273) hide show
  1. package/CHANGELOG.md +76 -2
  2. package/dist/chat/client-utils.d.ts +3 -0
  3. package/dist/chat/client-utils.js +22 -5
  4. package/dist/chat/index.d.ts +4 -7
  5. package/dist/chat/index.js +0 -8
  6. package/dist/chat/session-storage.d.ts +2 -2
  7. package/dist/chat/session.d.ts +4 -3
  8. package/dist/chat/session.js +1 -1
  9. package/dist/chat/sse-handler.js +13 -21
  10. package/dist/chat/types.d.ts +3 -2
  11. package/dist/chat/websocket-chat-handler.d.ts +4 -3
  12. package/dist/chat/websocket-chat-handler.js +12 -12
  13. package/dist/cli/commands/config.d.ts +2 -2
  14. package/dist/cli/commands/mcp.d.ts +3 -2
  15. package/dist/cli/commands/mcp.js +39 -29
  16. package/dist/cli/commands/ollama.js +8 -4
  17. package/dist/cli/factories/command-factory.d.ts +2 -1
  18. package/dist/cli/index.js +22 -19
  19. package/dist/core/analytics.d.ts +3 -2
  20. package/dist/core/analytics.js +16 -7
  21. package/dist/core/base-provider.d.ts +35 -7
  22. package/dist/core/base-provider.js +36 -13
  23. package/dist/core/defaults.d.ts +2 -1
  24. package/dist/core/evaluation.d.ts +4 -4
  25. package/dist/core/evaluation.js +17 -7
  26. package/dist/core/factory.d.ts +3 -2
  27. package/dist/core/service-registry.d.ts +4 -4
  28. package/dist/core/types.d.ts +11 -4
  29. package/dist/factories/compatibility-factory.d.ts +16 -1
  30. package/dist/factories/compatibility-factory.js +3 -1
  31. package/dist/factories/provider-factory.d.ts +5 -4
  32. package/dist/factories/provider-factory.js +15 -24
  33. package/dist/factories/provider-generate-factory.js +26 -20
  34. package/dist/lib/chat/client-utils.d.ts +3 -0
  35. package/dist/lib/chat/client-utils.js +22 -5
  36. package/dist/lib/chat/index.d.ts +4 -7
  37. package/dist/lib/chat/index.js +0 -8
  38. package/dist/lib/chat/session-storage.d.ts +2 -2
  39. package/dist/lib/chat/session.d.ts +4 -3
  40. package/dist/lib/chat/session.js +1 -1
  41. package/dist/lib/chat/sse-handler.js +13 -21
  42. package/dist/lib/chat/types.d.ts +3 -2
  43. package/dist/lib/chat/websocket-chat-handler.d.ts +4 -3
  44. package/dist/lib/chat/websocket-chat-handler.js +12 -12
  45. package/dist/lib/core/analytics.d.ts +3 -2
  46. package/dist/lib/core/analytics.js +16 -7
  47. package/dist/lib/core/base-provider.d.ts +35 -7
  48. package/dist/lib/core/base-provider.js +36 -13
  49. package/dist/lib/core/defaults.d.ts +2 -1
  50. package/dist/lib/core/evaluation.d.ts +4 -4
  51. package/dist/lib/core/evaluation.js +17 -7
  52. package/dist/lib/core/factory.d.ts +3 -2
  53. package/dist/lib/core/service-registry.d.ts +4 -4
  54. package/dist/lib/core/types.d.ts +11 -4
  55. package/dist/lib/factories/compatibility-factory.d.ts +16 -1
  56. package/dist/lib/factories/compatibility-factory.js +3 -1
  57. package/dist/lib/factories/provider-factory.d.ts +5 -4
  58. package/dist/lib/factories/provider-factory.js +15 -24
  59. package/dist/lib/factories/provider-generate-factory.js +26 -20
  60. package/dist/lib/mcp/adapters/plugin-bridge.d.ts +5 -4
  61. package/dist/lib/mcp/adapters/plugin-bridge.js +13 -6
  62. package/dist/lib/mcp/client.d.ts +2 -1
  63. package/dist/lib/mcp/client.js +12 -10
  64. package/dist/lib/mcp/context-manager.d.ts +1 -1
  65. package/dist/lib/mcp/contracts/mcp-contract.d.ts +15 -8
  66. package/dist/lib/mcp/core/plugin-manager.d.ts +3 -2
  67. package/dist/lib/mcp/core/plugin-manager.js +1 -1
  68. package/dist/lib/mcp/demo/plugin-demo.js +3 -1
  69. package/dist/lib/mcp/dynamic-chain-executor.d.ts +64 -40
  70. package/dist/lib/mcp/dynamic-chain-executor.js +3 -3
  71. package/dist/lib/mcp/dynamic-orchestrator.d.ts +14 -8
  72. package/dist/lib/mcp/ecosystem.d.ts +4 -4
  73. package/dist/lib/mcp/error-manager.d.ts +2 -2
  74. package/dist/lib/mcp/error-recovery.d.ts +4 -3
  75. package/dist/lib/mcp/external-client.d.ts +1 -1
  76. package/dist/lib/mcp/external-client.js +14 -10
  77. package/dist/lib/mcp/external-manager.d.ts +3 -3
  78. package/dist/lib/mcp/external-manager.js +9 -3
  79. package/dist/lib/mcp/factory.d.ts +7 -7
  80. package/dist/lib/mcp/function-calling.d.ts +3 -2
  81. package/dist/lib/mcp/health-monitor.d.ts +2 -1
  82. package/dist/lib/mcp/health-monitor.js +16 -7
  83. package/dist/lib/mcp/index.d.ts +5 -5
  84. package/dist/lib/mcp/initialize-tools.d.ts +2 -1
  85. package/dist/lib/mcp/initialize-tools.js +10 -2
  86. package/dist/lib/mcp/manager.d.ts +2 -1
  87. package/dist/lib/mcp/neurolink-mcp-client.js +1 -1
  88. package/dist/lib/mcp/orchestrator.d.ts +13 -12
  89. package/dist/lib/mcp/orchestrator.js +10 -8
  90. package/dist/lib/mcp/plugin-manager.js +4 -2
  91. package/dist/lib/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
  92. package/dist/lib/mcp/plugins/core/filesystem-mcp.js +5 -2
  93. package/dist/lib/mcp/plugins/filesystem-mcp.d.ts +2 -1
  94. package/dist/lib/mcp/registry.d.ts +2 -1
  95. package/dist/lib/mcp/registry.js +2 -1
  96. package/dist/lib/mcp/security-manager.d.ts +4 -2
  97. package/dist/lib/mcp/servers/agent/direct-tools-server.js +18 -6
  98. package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
  99. package/dist/lib/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
  100. package/dist/lib/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
  101. package/dist/lib/mcp/servers/ai-providers/ai-core-server.js +15 -133
  102. package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
  103. package/dist/lib/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
  104. package/dist/lib/mcp/session-manager.d.ts +4 -3
  105. package/dist/lib/mcp/session-persistence.js +5 -2
  106. package/dist/lib/mcp/tool-integration.d.ts +3 -2
  107. package/dist/lib/mcp/tool-integration.js +3 -1
  108. package/dist/lib/mcp/tool-registry.d.ts +18 -1
  109. package/dist/lib/mcp/tool-registry.js +11 -8
  110. package/dist/lib/mcp/transport-manager.d.ts +2 -1
  111. package/dist/lib/mcp/transport-manager.js +5 -1
  112. package/dist/lib/mcp/unified-mcp.d.ts +5 -5
  113. package/dist/lib/mcp/unified-registry.d.ts +18 -2
  114. package/dist/lib/mcp/unified-registry.js +52 -3
  115. package/dist/lib/neurolink.d.ts +2 -2
  116. package/dist/lib/neurolink.js +40 -15
  117. package/dist/lib/providers/amazon-bedrock.d.ts +1 -1
  118. package/dist/lib/providers/amazon-bedrock.js +8 -7
  119. package/dist/lib/providers/analytics-helper.d.ts +8 -23
  120. package/dist/lib/providers/analytics-helper.js +95 -33
  121. package/dist/lib/providers/anthropic-baseprovider.d.ts +3 -3
  122. package/dist/lib/providers/anthropic-baseprovider.js +6 -5
  123. package/dist/lib/providers/anthropic.d.ts +2 -2
  124. package/dist/lib/providers/anthropic.js +11 -4
  125. package/dist/lib/providers/azure-openai.d.ts +5 -4
  126. package/dist/lib/providers/azure-openai.js +10 -4
  127. package/dist/lib/providers/function-calling-provider.d.ts +2 -2
  128. package/dist/lib/providers/function-calling-provider.js +1 -1
  129. package/dist/lib/providers/google-ai-studio.d.ts +2 -2
  130. package/dist/lib/providers/google-ai-studio.js +9 -3
  131. package/dist/lib/providers/google-vertex.d.ts +2 -2
  132. package/dist/lib/providers/google-vertex.js +18 -12
  133. package/dist/lib/providers/huggingFace.d.ts +1 -1
  134. package/dist/lib/providers/huggingFace.js +8 -4
  135. package/dist/lib/providers/mcp-provider.d.ts +3 -3
  136. package/dist/lib/providers/mistral.d.ts +34 -27
  137. package/dist/lib/providers/mistral.js +115 -107
  138. package/dist/lib/providers/ollama.d.ts +2 -1
  139. package/dist/lib/providers/ollama.js +43 -3
  140. package/dist/lib/providers/openAI.d.ts +1 -1
  141. package/dist/lib/providers/openAI.js +8 -4
  142. package/dist/lib/proxy/proxy-fetch.js +3 -2
  143. package/dist/lib/sdk/tool-extension.d.ts +12 -12
  144. package/dist/lib/sdk/tool-extension.js +2 -1
  145. package/dist/lib/sdk/tool-registration.d.ts +16 -12
  146. package/dist/lib/sdk/tool-registration.js +3 -2
  147. package/dist/lib/services/types.d.ts +5 -4
  148. package/dist/lib/services/websocket/websocket-server.d.ts +1 -1
  149. package/dist/lib/services/websocket/websocket-server.js +1 -1
  150. package/dist/lib/telemetry/telemetry-service.js +1 -1
  151. package/dist/lib/types/cli.d.ts +247 -0
  152. package/dist/lib/types/cli.js +22 -0
  153. package/dist/lib/types/common.d.ts +76 -0
  154. package/dist/lib/types/common.js +52 -0
  155. package/dist/lib/types/generate-types.d.ts +6 -6
  156. package/dist/lib/types/index.d.ts +12 -0
  157. package/dist/lib/types/index.js +12 -0
  158. package/dist/lib/types/mcp-types.d.ts +7 -7
  159. package/dist/lib/types/providers.d.ts +158 -0
  160. package/dist/lib/types/providers.js +23 -0
  161. package/dist/lib/types/stream-types.d.ts +4 -3
  162. package/dist/lib/types/tools.d.ts +154 -0
  163. package/dist/lib/types/tools.js +24 -0
  164. package/dist/lib/utils/logger.d.ts +5 -5
  165. package/dist/lib/utils/provider-validation.d.ts +2 -1
  166. package/dist/mcp/adapters/plugin-bridge.d.ts +5 -4
  167. package/dist/mcp/adapters/plugin-bridge.js +13 -6
  168. package/dist/mcp/client.d.ts +2 -1
  169. package/dist/mcp/client.js +12 -10
  170. package/dist/mcp/context-manager.d.ts +1 -1
  171. package/dist/mcp/contracts/mcp-contract.d.ts +15 -8
  172. package/dist/mcp/core/plugin-manager.d.ts +3 -2
  173. package/dist/mcp/core/plugin-manager.js +1 -1
  174. package/dist/mcp/demo/plugin-demo.js +3 -1
  175. package/dist/mcp/dynamic-chain-executor.d.ts +64 -40
  176. package/dist/mcp/dynamic-chain-executor.js +3 -3
  177. package/dist/mcp/dynamic-orchestrator.d.ts +14 -8
  178. package/dist/mcp/dynamic-orchestrator.js +1 -1
  179. package/dist/mcp/ecosystem.d.ts +4 -4
  180. package/dist/mcp/error-manager.d.ts +2 -2
  181. package/dist/mcp/error-recovery.d.ts +4 -3
  182. package/dist/mcp/external-client.d.ts +1 -1
  183. package/dist/mcp/external-client.js +14 -10
  184. package/dist/mcp/external-manager.d.ts +3 -3
  185. package/dist/mcp/external-manager.js +9 -3
  186. package/dist/mcp/factory.d.ts +7 -7
  187. package/dist/mcp/function-calling.d.ts +3 -2
  188. package/dist/mcp/health-monitor.d.ts +2 -1
  189. package/dist/mcp/health-monitor.js +16 -7
  190. package/dist/mcp/index.d.ts +5 -5
  191. package/dist/mcp/initialize-tools.d.ts +2 -1
  192. package/dist/mcp/initialize-tools.js +10 -2
  193. package/dist/mcp/manager.d.ts +2 -1
  194. package/dist/mcp/neurolink-mcp-client.js +1 -1
  195. package/dist/mcp/orchestrator.d.ts +13 -12
  196. package/dist/mcp/orchestrator.js +10 -8
  197. package/dist/mcp/plugin-manager.js +4 -2
  198. package/dist/mcp/plugins/core/filesystem-mcp.d.ts +3 -2
  199. package/dist/mcp/plugins/core/filesystem-mcp.js +5 -2
  200. package/dist/mcp/plugins/filesystem-mcp.d.ts +2 -1
  201. package/dist/mcp/registry.d.ts +2 -1
  202. package/dist/mcp/registry.js +2 -1
  203. package/dist/mcp/security-manager.d.ts +4 -2
  204. package/dist/mcp/servers/agent/direct-tools-server.js +19 -6
  205. package/dist/mcp/servers/ai-providers/ai-analysis-tools.d.ts +1 -16
  206. package/dist/mcp/servers/ai-providers/ai-analysis-tools.js +21 -17
  207. package/dist/mcp/servers/ai-providers/ai-core-server.d.ts +2 -2
  208. package/dist/mcp/servers/ai-providers/ai-core-server.js +15 -132
  209. package/dist/mcp/servers/ai-providers/ai-workflow-tools.d.ts +1 -97
  210. package/dist/mcp/servers/ai-providers/ai-workflow-tools.js +18 -18
  211. package/dist/mcp/session-manager.d.ts +4 -3
  212. package/dist/mcp/session-persistence.js +5 -2
  213. package/dist/mcp/tool-integration.d.ts +3 -2
  214. package/dist/mcp/tool-integration.js +3 -1
  215. package/dist/mcp/tool-registry.d.ts +18 -1
  216. package/dist/mcp/tool-registry.js +11 -8
  217. package/dist/mcp/transport-manager.d.ts +2 -1
  218. package/dist/mcp/transport-manager.js +5 -1
  219. package/dist/mcp/unified-mcp.d.ts +5 -5
  220. package/dist/mcp/unified-registry.d.ts +18 -2
  221. package/dist/mcp/unified-registry.js +52 -3
  222. package/dist/neurolink.d.ts +2 -2
  223. package/dist/neurolink.js +40 -15
  224. package/dist/providers/amazon-bedrock.d.ts +1 -1
  225. package/dist/providers/amazon-bedrock.js +8 -7
  226. package/dist/providers/analytics-helper.d.ts +8 -23
  227. package/dist/providers/analytics-helper.js +95 -33
  228. package/dist/providers/anthropic-baseprovider.d.ts +3 -3
  229. package/dist/providers/anthropic-baseprovider.js +6 -5
  230. package/dist/providers/anthropic.d.ts +2 -2
  231. package/dist/providers/anthropic.js +11 -4
  232. package/dist/providers/azure-openai.d.ts +5 -4
  233. package/dist/providers/azure-openai.js +10 -4
  234. package/dist/providers/function-calling-provider.d.ts +2 -2
  235. package/dist/providers/function-calling-provider.js +1 -1
  236. package/dist/providers/google-ai-studio.d.ts +2 -2
  237. package/dist/providers/google-ai-studio.js +9 -3
  238. package/dist/providers/google-vertex.d.ts +2 -2
  239. package/dist/providers/google-vertex.js +18 -12
  240. package/dist/providers/huggingFace.d.ts +1 -1
  241. package/dist/providers/huggingFace.js +8 -4
  242. package/dist/providers/mcp-provider.d.ts +3 -3
  243. package/dist/providers/mistral.d.ts +34 -27
  244. package/dist/providers/mistral.js +116 -108
  245. package/dist/providers/ollama.d.ts +2 -1
  246. package/dist/providers/ollama.js +43 -3
  247. package/dist/providers/openAI.d.ts +1 -1
  248. package/dist/providers/openAI.js +8 -4
  249. package/dist/proxy/proxy-fetch.js +3 -2
  250. package/dist/sdk/tool-extension.d.ts +12 -12
  251. package/dist/sdk/tool-extension.js +2 -1
  252. package/dist/sdk/tool-registration.d.ts +16 -12
  253. package/dist/sdk/tool-registration.js +3 -2
  254. package/dist/services/types.d.ts +5 -4
  255. package/dist/services/websocket/websocket-server.d.ts +1 -1
  256. package/dist/services/websocket/websocket-server.js +2 -1
  257. package/dist/telemetry/telemetry-service.js +1 -1
  258. package/dist/types/cli.d.ts +247 -0
  259. package/dist/types/cli.js +22 -0
  260. package/dist/types/common.d.ts +76 -0
  261. package/dist/types/common.js +52 -0
  262. package/dist/types/generate-types.d.ts +6 -6
  263. package/dist/types/index.d.ts +12 -0
  264. package/dist/types/index.js +12 -0
  265. package/dist/types/mcp-types.d.ts +7 -7
  266. package/dist/types/providers.d.ts +158 -0
  267. package/dist/types/providers.js +23 -0
  268. package/dist/types/stream-types.d.ts +4 -3
  269. package/dist/types/tools.d.ts +154 -0
  270. package/dist/types/tools.js +25 -0
  271. package/dist/utils/logger.d.ts +5 -5
  272. package/dist/utils/provider-validation.d.ts +2 -1
  273. package/package.json +1 -1
@@ -30,7 +30,7 @@ export declare class FunctionCallingProvider implements AIProvider {
30
30
  * PRIMARY METHOD: Stream content using AI (recommended for new code)
31
31
  * Future-ready for multi-modal capabilities with current text focus
32
32
  */
33
- stream(optionsOrPrompt: StreamOptions | string, analysisSchema?: any): Promise<StreamResult>;
33
+ stream(optionsOrPrompt: StreamOptions | string, analysisSchema?: Schema): Promise<StreamResult>;
34
34
  /**
35
35
  * Generate text with real function calling support
36
36
  */
@@ -117,7 +117,7 @@ export declare class FunctionCallingProvider implements AIProvider {
117
117
  /**
118
118
  * Short alias for generate() - CLI-SDK consistency
119
119
  */
120
- gen(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: any): Promise<EnhancedGenerateResult | null>;
120
+ gen(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: Schema): Promise<EnhancedGenerateResult | null>;
121
121
  }
122
122
  /**
123
123
  * Create a function-calling enhanced version of any AI provider
@@ -344,7 +344,7 @@ export class FunctionCallingProvider {
344
344
  if (typeof provider.getModel === "function") {
345
345
  mcpLogger.debug(`[${functionTag}] Found getModel method on provider`);
346
346
  const model = await provider.getModel();
347
- return { model };
347
+ return { model: model };
348
348
  }
349
349
  mcpLogger.warn(`[${functionTag}] Could not find model on provider`);
350
350
  return null;
@@ -8,14 +8,14 @@ import { BaseProvider } from "../core/base-provider.js";
8
8
  * Migrated from original GoogleAIStudio class to new factory pattern
9
9
  */
10
10
  export declare class GoogleAIStudioProvider extends BaseProvider {
11
- constructor(modelName?: string, sdk?: any);
11
+ constructor(modelName?: string, sdk?: unknown);
12
12
  protected getProviderName(): AIProviderName;
13
13
  protected getDefaultModel(): string;
14
14
  /**
15
15
  * šŸ”§ PHASE 2: Return AI SDK model instance for tool calling
16
16
  */
17
17
  protected getAISDKModel(): LanguageModelV1;
18
- protected handleProviderError(error: any): Error;
18
+ protected handleProviderError(error: unknown): Error;
19
19
  protected executeStream(options: StreamOptions, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<StreamResult>;
20
20
  private getApiKey;
21
21
  private validateStreamOptions;
@@ -44,13 +44,19 @@ export class GoogleAIStudioProvider extends BaseProvider {
44
44
  if (error instanceof TimeoutError) {
45
45
  return new Error(`Google AI request timed out: ${error.message}`);
46
46
  }
47
- if (error?.message?.includes("API_KEY_INVALID")) {
47
+ const errorRecord = error;
48
+ if (typeof errorRecord?.message === "string" &&
49
+ errorRecord.message.includes("API_KEY_INVALID")) {
48
50
  return new Error("Invalid Google AI API key. Please check your GOOGLE_AI_API_KEY environment variable.");
49
51
  }
50
- if (error?.message?.includes("RATE_LIMIT_EXCEEDED")) {
52
+ if (typeof errorRecord?.message === "string" &&
53
+ errorRecord.message.includes("RATE_LIMIT_EXCEEDED")) {
51
54
  return new Error("Google AI rate limit exceeded. Please try again later.");
52
55
  }
53
- return new Error(`Google AI error: ${error?.message || "Unknown error"}`);
56
+ const message = typeof errorRecord?.message === "string"
57
+ ? errorRecord.message
58
+ : "Unknown error";
59
+ return new Error(`Google AI error: ${message}`);
54
60
  }
55
61
  // executeGenerate removed - BaseProvider handles all generation with tools
56
62
  async executeStream(options, analysisSchema) {
@@ -21,7 +21,7 @@ export declare class GoogleVertexProvider extends BaseProvider {
21
21
  private projectId;
22
22
  private location;
23
23
  private cachedAnthropicModel;
24
- constructor(modelName?: string);
24
+ constructor(modelName?: string, sdk?: unknown);
25
25
  protected getProviderName(): AIProviderName;
26
26
  protected getDefaultModel(): string;
27
27
  /**
@@ -30,7 +30,7 @@ export declare class GoogleVertexProvider extends BaseProvider {
30
30
  */
31
31
  protected getAISDKModel(): Promise<LanguageModelV1>;
32
32
  protected executeStream(options: StreamOptions, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<StreamResult>;
33
- protected handleProviderError(error: any): Error;
33
+ protected handleProviderError(error: unknown): Error;
34
34
  private validateStreamOptions;
35
35
  /**
36
36
  * Check if Anthropic models are available
@@ -15,7 +15,8 @@ async function getCreateVertexAnthropic() {
15
15
  _anthropicImportAttempted = true;
16
16
  try {
17
17
  // Try to import the anthropic module - available in @ai-sdk/google-vertex ^2.2.0+
18
- const anthropicModule = await import("@ai-sdk/google-vertex/anthropic");
18
+ // Use proper dynamic import without eval() for security
19
+ const anthropicModule = (await import("@ai-sdk/google-vertex/anthropic"));
19
20
  _createVertexAnthropic = anthropicModule.createVertexAnthropic;
20
21
  logger.debug("[GoogleVertexAI] Anthropic module successfully loaded");
21
22
  return _createVertexAnthropic;
@@ -69,8 +70,8 @@ export class GoogleVertexProvider extends BaseProvider {
69
70
  projectId;
70
71
  location;
71
72
  cachedAnthropicModel = null;
72
- constructor(modelName) {
73
- super(modelName, "vertex");
73
+ constructor(modelName, sdk) {
74
+ super(modelName, "vertex", sdk);
74
75
  // Validate Google Cloud credentials
75
76
  if (!hasGoogleCredentials()) {
76
77
  throw new Error(`āŒ Google Vertex AI Provider Configuration Error\n\nMissing Google Cloud authentication. One of the following is required:\n\nšŸ”§ Option 1: Service Account Key File\nGOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json\n\nšŸ”§ Option 2: Service Account Key (Base64)\nGOOGLE_SERVICE_ACCOUNT_KEY=base64_encoded_key\n\nšŸ”§ Option 3: Individual Credentials\nGOOGLE_AUTH_CLIENT_EMAIL=your-service-account@project.iam.gserviceaccount.com\nGOOGLE_AUTH_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----...\n\nšŸ”§ Step 4: Restart Application\nRestart your application to load the new environment variables.`);
@@ -147,22 +148,27 @@ export class GoogleVertexProvider extends BaseProvider {
147
148
  }
148
149
  }
149
150
  handleProviderError(error) {
150
- if (error.name === "TimeoutError") {
151
+ const errorRecord = error;
152
+ if (typeof errorRecord?.name === "string" &&
153
+ errorRecord.name === "TimeoutError") {
151
154
  return new TimeoutError(`Google Vertex AI request timed out. Consider increasing timeout or using a lighter model.`, this.defaultTimeout);
152
155
  }
153
- if (error.message?.includes("PERMISSION_DENIED")) {
156
+ const message = typeof errorRecord?.message === "string"
157
+ ? errorRecord.message
158
+ : "Unknown error occurred";
159
+ if (message.includes("PERMISSION_DENIED")) {
154
160
  return new Error(`āŒ Google Vertex AI Permission Denied\n\nYour Google Cloud credentials don't have permission to access Vertex AI.\n\nšŸ”§ Required Steps:\n1. Ensure your service account has Vertex AI User role\n2. Check if Vertex AI API is enabled in your project\n3. Verify your project ID is correct\n4. Confirm your location/region has Vertex AI available`);
155
161
  }
156
- if (error.message?.includes("NOT_FOUND")) {
157
- return new Error(`āŒ Google Vertex AI Model Not Found\n\n${error.message}\n\nšŸ”§ Check:\n1. Model name is correct (e.g., 'gemini-1.5-pro')\n2. Model is available in your region (${this.location})\n3. Your project has access to the model\n4. Model supports your request parameters`);
162
+ if (message.includes("NOT_FOUND")) {
163
+ return new Error(`āŒ Google Vertex AI Model Not Found\n\n${message}\n\nšŸ”§ Check:\n1. Model name is correct (e.g., 'gemini-1.5-pro')\n2. Model is available in your region (${this.location})\n3. Your project has access to the model\n4. Model supports your request parameters`);
158
164
  }
159
- if (error.message?.includes("QUOTA_EXCEEDED")) {
160
- return new Error(`āŒ Google Vertex AI Quota Exceeded\n\n${error.message}\n\nšŸ”§ Solutions:\n1. Check your Vertex AI quotas in Google Cloud Console\n2. Request quota increase if needed\n3. Try a different model or reduce request frequency\n4. Consider using a different region`);
165
+ if (message.includes("QUOTA_EXCEEDED")) {
166
+ return new Error(`āŒ Google Vertex AI Quota Exceeded\n\n${message}\n\nšŸ”§ Solutions:\n1. Check your Vertex AI quotas in Google Cloud Console\n2. Request quota increase if needed\n3. Try a different model or reduce request frequency\n4. Consider using a different region`);
161
167
  }
162
- if (error.message?.includes("INVALID_ARGUMENT")) {
163
- return new Error(`āŒ Google Vertex AI Invalid Request\n\n${error.message}\n\nšŸ”§ Check:\n1. Request parameters are within model limits\n2. Input text is properly formatted\n3. Temperature and other settings are valid\n4. Model supports your request type`);
168
+ if (message.includes("INVALID_ARGUMENT")) {
169
+ return new Error(`āŒ Google Vertex AI Invalid Request\n\n${message}\n\nšŸ”§ Check:\n1. Request parameters are within model limits\n2. Input text is properly formatted\n3. Temperature and other settings are valid\n4. Model supports your request type`);
164
170
  }
165
- return new Error(`āŒ Google Vertex AI Provider Error\n\n${error.message || "Unknown error occurred"}\n\nšŸ”§ Troubleshooting:\n1. Check Google Cloud credentials and permissions\n2. Verify project ID and location settings\n3. Ensure Vertex AI API is enabled\n4. Check network connectivity`);
171
+ return new Error(`āŒ Google Vertex AI Provider Error\n\n${message}\n\nšŸ”§ Troubleshooting:\n1. Check Google Cloud credentials and permissions\n2. Verify project ID and location settings\n3. Ensure Vertex AI API is enabled\n4. Check network connectivity`);
166
172
  }
167
173
  validateStreamOptions(options) {
168
174
  if (!options.input?.text?.trim()) {
@@ -33,7 +33,7 @@ export declare class HuggingFaceProvider extends BaseProvider {
33
33
  * Returns the Vercel AI SDK model instance for HuggingFace
34
34
  */
35
35
  protected getAISDKModel(): LanguageModelV1;
36
- protected handleProviderError(error: any): Error;
36
+ protected handleProviderError(error: unknown): Error;
37
37
  private validateStreamOptions;
38
38
  }
39
39
  export default HuggingFaceProvider;
@@ -114,14 +114,18 @@ export class HuggingFaceProvider extends BaseProvider {
114
114
  if (error instanceof TimeoutError) {
115
115
  return new Error(`HuggingFace request timed out: ${error.message}`);
116
116
  }
117
- if (error?.message?.includes("API_TOKEN_INVALID") ||
118
- error?.message?.includes("Invalid token")) {
117
+ const errorObj = error;
118
+ const message = errorObj?.message && typeof errorObj.message === "string"
119
+ ? errorObj.message
120
+ : "Unknown error";
121
+ if (message.includes("API_TOKEN_INVALID") ||
122
+ message.includes("Invalid token")) {
119
123
  return new Error("Invalid HuggingFace API token. Please check your HUGGING_FACE_API_KEY environment variable.");
120
124
  }
121
- if (error?.message?.includes("rate limit")) {
125
+ if (message.includes("rate limit")) {
122
126
  return new Error("HuggingFace rate limit exceeded. Please try again later.");
123
127
  }
124
- return new Error(`HuggingFace error: ${error?.message || "Unknown error"}`);
128
+ return new Error(`HuggingFace error: ${message}`);
125
129
  }
126
130
  // ===================
127
131
  // PRIVATE VALIDATION METHODS
@@ -2,7 +2,7 @@
2
2
  * NeuroLink MCP-Aware AI Provider
3
3
  * Integrates MCP tools with AI providers following Lighthouse's pattern
4
4
  */
5
- import type { AIProvider, TextGenerationOptions, EnhancedGenerateResult } from "../core/types.js";
5
+ import type { AIProvider, TextGenerationOptions } from "../core/types.js";
6
6
  import type { Schema } from "ai";
7
7
  import type { GenerateResult } from "../types/generate-types.js";
8
8
  import type { ZodType, ZodTypeDef } from "zod";
@@ -37,7 +37,7 @@ export declare class MCPAwareProvider implements AIProvider {
37
37
  * PRIMARY METHOD: Stream content using AI (recommended for new code)
38
38
  * Future-ready for multi-modal capabilities with current text focus
39
39
  */
40
- stream(optionsOrPrompt: StreamOptions | string, analysisSchema?: any): Promise<StreamResult>;
40
+ stream(optionsOrPrompt: StreamOptions | string, analysisSchema?: unknown): Promise<StreamResult>;
41
41
  generate(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<GenerateResult>;
42
42
  /**
43
43
  * Detect if the prompt is requesting tool usage
@@ -63,7 +63,7 @@ export declare class MCPAwareProvider implements AIProvider {
63
63
  /**
64
64
  * Short alias for generate() - CLI-SDK consistency
65
65
  */
66
- gen(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: any): Promise<EnhancedGenerateResult | null>;
66
+ gen(optionsOrPrompt: TextGenerationOptions | string, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<GenerateResult>;
67
67
  }
68
68
  /**
69
69
  * Create an MCP-aware provider
@@ -1,42 +1,49 @@
1
- import type { ZodType, ZodTypeDef } from "zod";
2
- import { type Schema, type LanguageModelV1 } from "ai";
3
- import type { AIProviderName } from "../core/types.js";
1
+ import { type LanguageModelV1 } from "ai";
2
+ import type { AIProviderName, TextGenerationOptions, EnhancedGenerateResult } from "../core/types.js";
4
3
  import type { StreamOptions, StreamResult } from "../types/stream-types.js";
5
4
  import { BaseProvider } from "../core/base-provider.js";
6
5
  /**
7
6
  * Mistral AI Provider v2 - BaseProvider Implementation
8
- *
9
- * PHASE 3.6: Simple BaseProvider wrap around existing @ai-sdk/mistral implementation
10
- *
11
- * Features:
12
- * - Extends BaseProvider for shared functionality
13
- * - Uses pre-configured Mistral instance for efficiency
14
- * - Enhanced error handling with setup guidance
15
- * - Supports all Mistral models (mistral-small, mistral-medium, mistral-large)
7
+ * Supports official AI-SDK integration with all Mistral models
16
8
  */
17
9
  export declare class MistralProvider extends BaseProvider {
18
- private mistral;
19
10
  private model;
20
- constructor(modelName?: string, sdk?: any);
21
- protected getProviderName(): AIProviderName;
22
- protected getDefaultModel(): string;
11
+ constructor(modelName?: string, sdk?: unknown);
23
12
  /**
24
- * Returns the Vercel AI SDK model instance for Mistral
13
+ * Generate text using Mistral API
25
14
  */
26
- protected getAISDKModel(): LanguageModelV1;
27
- protected executeStream(options: StreamOptions, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<StreamResult>;
28
- protected handleProviderError(error: any): Error;
29
- private validateStreamOptions;
15
+ generate(options: TextGenerationOptions): Promise<EnhancedGenerateResult>;
30
16
  /**
31
- * Check available Mistral models
32
- * @returns Array of available model names
17
+ * Stream text generation using Mistral API
33
18
  */
34
- getAvailableModels(): string[];
19
+ executeStream(options: StreamOptions): Promise<StreamResult>;
35
20
  /**
36
- * Get recommended model based on use case
37
- * @param useCase - The intended use case
38
- * @returns Recommended model name
21
+ * Get default model name for this provider
39
22
  */
40
- getRecommendedModel(useCase: "speed" | "balanced" | "quality"): string;
23
+ getDefaultModel(): string;
24
+ /**
25
+ * Get provider name
26
+ */
27
+ getProviderName(): AIProviderName;
28
+ /**
29
+ * Get AI SDK model instance
30
+ */
31
+ getAISDKModel(): LanguageModelV1;
32
+ /**
33
+ * Handle provider-specific errors
34
+ */
35
+ handleProviderError(error: unknown): Error;
36
+ /**
37
+ * Validate provider configuration
38
+ */
39
+ validateConfiguration(): Promise<boolean>;
40
+ /**
41
+ * Get provider-specific configuration
42
+ */
43
+ getConfiguration(): {
44
+ provider: AIProviderName;
45
+ model: string;
46
+ defaultModel: string;
47
+ };
41
48
  }
42
49
  export default MistralProvider;
@@ -2,159 +2,167 @@ import { createMistral } from "@ai-sdk/mistral";
2
2
  import { streamText } from "ai";
3
3
  import { BaseProvider } from "../core/base-provider.js";
4
4
  import { logger } from "../utils/logger.js";
5
- import { TimeoutError, } from "../utils/timeout.js";
6
- import { DEFAULT_MAX_TOKENS } from "../core/constants.js";
5
+ import { createAnalytics } from "./analytics-helper.js";
7
6
  // Configuration helpers
8
7
  const getMistralApiKey = () => {
9
8
  const apiKey = process.env.MISTRAL_API_KEY;
10
9
  if (!apiKey) {
11
- throw new Error(`āŒ Mistral AI Provider Configuration Error\n\nMissing required environment variable: MISTRAL_API_KEY\n\nšŸ”§ Step 1: Get Mistral AI API Key\n1. Visit: https://console.mistral.ai/\n2. Sign in or create an account\n3. Go to API Keys section\n4. Create a new API key\n\nšŸ”§ Step 2: Set Environment Variable\nAdd to your .env file:\nMISTRAL_API_KEY=your_api_key_here\n\nšŸ”§ Step 3: Restart Application\nRestart your application to load the new environment variables.`);
10
+ throw new Error("Mistral API key not found. Please set MISTRAL_API_KEY environment variable.");
12
11
  }
13
12
  return apiKey;
14
13
  };
15
14
  const getDefaultMistralModel = () => {
16
- return process.env.MISTRAL_MODEL || "mistral-small";
17
- };
18
- const hasMistralCredentials = () => {
19
- return !!process.env.MISTRAL_API_KEY;
15
+ return process.env.MISTRAL_MODEL || "mistral-large-latest";
20
16
  };
21
17
  /**
22
18
  * Mistral AI Provider v2 - BaseProvider Implementation
23
- *
24
- * PHASE 3.6: Simple BaseProvider wrap around existing @ai-sdk/mistral implementation
25
- *
26
- * Features:
27
- * - Extends BaseProvider for shared functionality
28
- * - Uses pre-configured Mistral instance for efficiency
29
- * - Enhanced error handling with setup guidance
30
- * - Supports all Mistral models (mistral-small, mistral-medium, mistral-large)
19
+ * Supports official AI-SDK integration with all Mistral models
31
20
  */
32
21
  export class MistralProvider extends BaseProvider {
33
- mistral;
34
22
  model;
35
23
  constructor(modelName, sdk) {
36
- super(modelName, "mistral", sdk);
37
- // Validate Mistral API credentials
38
- if (!hasMistralCredentials()) {
39
- throw new Error(`āŒ Mistral AI Provider Configuration Error\n\nMissing Mistral AI API key.\n\nšŸ”§ Required Environment Variable:\nMISTRAL_API_KEY=your_api_key_here\n\nšŸ”§ Get API Key:\n1. Visit: https://console.mistral.ai/\n2. Sign in or create account\n3. Generate API key\n4. Add to .env file\n\nšŸ”§ Restart Application\nRestart your application to load the new environment variables.`);
40
- }
41
- // Initialize Mistral provider
42
- this.mistral = createMistral({
43
- apiKey: getMistralApiKey(),
24
+ // Type guard for NeuroLinkSDK parameter validation
25
+ const validatedSdk = sdk && typeof sdk === "object" && "getInMemoryServers" in sdk
26
+ ? sdk
27
+ : undefined;
28
+ super(modelName, "mistral", validatedSdk);
29
+ // Initialize Mistral model with API key validation
30
+ const apiKey = getMistralApiKey();
31
+ const mistral = createMistral({
32
+ apiKey: apiKey,
44
33
  });
45
- // Pre-initialize model for efficiency
46
- this.model = this.mistral(this.modelName || getDefaultMistralModel());
47
- logger.debug("Mistral AI BaseProvider v2 initialized", {
34
+ this.model = mistral(this.modelName || getDefaultMistralModel());
35
+ logger.debug("Mistral Provider v2 initialized", {
48
36
  modelName: this.modelName,
49
- provider: this.providerName,
37
+ providerName: this.providerName,
50
38
  });
51
39
  }
52
- getProviderName() {
53
- return "mistral";
54
- }
55
- getDefaultModel() {
56
- return getDefaultMistralModel();
57
- }
58
40
  /**
59
- * Returns the Vercel AI SDK model instance for Mistral
41
+ * Generate text using Mistral API
60
42
  */
61
- getAISDKModel() {
62
- return this.model;
43
+ async generate(options) {
44
+ const startTime = Date.now();
45
+ try {
46
+ const result = await this.model.doGenerate({
47
+ inputFormat: "prompt",
48
+ mode: { type: "regular" },
49
+ prompt: [
50
+ {
51
+ role: "user",
52
+ content: [{ type: "text", text: options.prompt || "" }],
53
+ },
54
+ ],
55
+ temperature: options.temperature,
56
+ maxTokens: options.maxTokens,
57
+ });
58
+ const responseTime = Date.now() - startTime;
59
+ // Extract token usage and text content
60
+ const tokenUsage = result.usage;
61
+ const textContent = result.text || "";
62
+ // Create analytics data using helper
63
+ const analytics = createAnalytics("mistral", this.modelName, { usage: tokenUsage, content: textContent }, responseTime, { requestId: `mistral-${Date.now()}` });
64
+ return {
65
+ content: textContent,
66
+ usage: {
67
+ inputTokens: tokenUsage?.promptTokens || 0,
68
+ outputTokens: tokenUsage?.completionTokens || 0,
69
+ totalTokens: (tokenUsage?.promptTokens || 0) +
70
+ (tokenUsage?.completionTokens || 0),
71
+ },
72
+ provider: this.providerName,
73
+ model: this.modelName,
74
+ analytics,
75
+ };
76
+ }
77
+ catch (error) {
78
+ const responseTime = Date.now() - startTime;
79
+ logger.error("Mistral generation failed", {
80
+ error: error instanceof Error ? error.message : String(error),
81
+ responseTime,
82
+ });
83
+ throw new Error(`Mistral generation failed: ${error instanceof Error ? error.message : String(error)}`);
84
+ }
63
85
  }
64
- // executeGenerate removed - BaseProvider handles all generation with tools
65
- async executeStream(options, analysisSchema) {
86
+ /**
87
+ * Stream text generation using Mistral API
88
+ */
89
+ async executeStream(options) {
90
+ const startTime = Date.now();
66
91
  try {
67
- this.validateStreamOptions(options);
68
- const result = await streamText({
92
+ const stream = await streamText({
69
93
  model: this.model,
70
- prompt: options.input.text,
71
- system: options.systemPrompt,
72
- maxTokens: options.maxTokens || DEFAULT_MAX_TOKENS,
94
+ prompt: options.prompt || "",
73
95
  temperature: options.temperature,
96
+ maxTokens: options.maxTokens,
74
97
  });
75
98
  return {
76
99
  stream: (async function* () {
77
- for await (const chunk of result.textStream) {
100
+ for await (const chunk of stream.textStream) {
78
101
  yield { content: chunk };
79
102
  }
80
103
  })(),
81
104
  provider: this.providerName,
82
105
  model: this.modelName,
106
+ metadata: {
107
+ startTime,
108
+ },
83
109
  };
84
110
  }
85
111
  catch (error) {
86
- throw this.handleProviderError(error);
112
+ logger.error("Mistral streaming failed", {
113
+ error: error instanceof Error ? error.message : String(error),
114
+ });
115
+ throw new Error(`Mistral streaming failed: ${error instanceof Error ? error.message : String(error)}`);
87
116
  }
88
117
  }
89
- handleProviderError(error) {
90
- if (error.name === "TimeoutError") {
91
- return new TimeoutError(`Mistral AI request timed out. Consider increasing timeout or using a lighter model.`, this.defaultTimeout);
92
- }
93
- if (error.message?.includes("401") ||
94
- error.message?.includes("Unauthorized")) {
95
- return new Error(`āŒ Mistral AI Authentication Error\n\nYour API key is invalid or expired.\n\nšŸ”§ Steps to Fix:\n1. Check your MISTRAL_API_KEY in .env file\n2. Verify the API key is correct and active\n3. Generate a new API key if needed at https://console.mistral.ai/\n4. Restart your application after updating`);
96
- }
97
- if (error.message?.includes("403") ||
98
- error.message?.includes("Forbidden")) {
99
- return new Error(`āŒ Mistral AI Access Denied\n\nYour account doesn't have permission to access this model.\n\nšŸ”§ Possible Solutions:\n1. Check if your account has access to the model: ${this.modelName}\n2. Try a different model (e.g., 'mistral-small')\n3. Verify your subscription status\n4. Contact Mistral AI support if needed`);
100
- }
101
- if (error.message?.includes("429") ||
102
- error.message?.includes("rate limit")) {
103
- return new Error(`āŒ Mistral AI Rate Limit Exceeded\n\n${error.message}\n\nšŸ”§ Solutions:\n1. Wait a moment before retrying\n2. Reduce request frequency\n3. Check your usage quotas\n4. Consider upgrading your plan`);
104
- }
105
- if (error.message?.includes("400") ||
106
- error.message?.includes("Bad Request")) {
107
- return new Error(`āŒ Mistral AI Invalid Request\n\n${error.message}\n\nšŸ”§ Check:\n1. Input text is properly formatted\n2. Model name is correct: ${this.modelName}\n3. Parameters are within limits\n4. Request format matches API requirements`);
108
- }
109
- if (error.message?.includes("404") ||
110
- error.message?.includes("Not Found")) {
111
- return new Error(`āŒ Mistral AI Model Not Found\n\nModel '${this.modelName}' is not available.\n\nšŸ”§ Available Models:\n- mistral-small (fastest, cost-effective)\n- mistral-medium (balanced performance)\n- mistral-large (highest quality)\n\nšŸ”§ Fix: Update MISTRAL_MODEL environment variable`);
112
- }
113
- return new Error(`āŒ Mistral AI Provider Error\n\n${error.message || "Unknown error occurred"}\n\nšŸ”§ Troubleshooting:\n1. Check API key and network connectivity\n2. Verify model availability\n3. Review request parameters\n4. Check Mistral AI status page`);
118
+ /**
119
+ * Get default model name for this provider
120
+ */
121
+ getDefaultModel() {
122
+ return getDefaultMistralModel();
114
123
  }
115
- validateStreamOptions(options) {
116
- if (!options.input?.text?.trim()) {
117
- throw new Error("Prompt is required for streaming");
118
- }
119
- if (options.maxTokens &&
120
- (options.maxTokens < 1 || options.maxTokens > 32768)) {
121
- throw new Error("maxTokens must be between 1 and 32768 for Mistral AI");
122
- }
123
- if (options.temperature &&
124
- (options.temperature < 0 || options.temperature > 1)) {
125
- throw new Error("temperature must be between 0 and 1");
126
- }
124
+ /**
125
+ * Get provider name
126
+ */
127
+ getProviderName() {
128
+ return this.providerName;
127
129
  }
128
130
  /**
129
- * Check available Mistral models
130
- * @returns Array of available model names
131
+ * Get AI SDK model instance
131
132
  */
132
- getAvailableModels() {
133
- return [
134
- "mistral-small",
135
- "mistral-medium",
136
- "mistral-large",
137
- "mistral-7b-instruct",
138
- "mistral-8x7b-instruct",
139
- "mistral-8x22b-instruct",
140
- ];
133
+ getAISDKModel() {
134
+ return this.model;
141
135
  }
142
136
  /**
143
- * Get recommended model based on use case
144
- * @param useCase - The intended use case
145
- * @returns Recommended model name
137
+ * Handle provider-specific errors
146
138
  */
147
- getRecommendedModel(useCase) {
148
- switch (useCase) {
149
- case "speed":
150
- return "mistral-small";
151
- case "balanced":
152
- return "mistral-medium";
153
- case "quality":
154
- return "mistral-large";
155
- default:
156
- return "mistral-small";
139
+ handleProviderError(error) {
140
+ if (error instanceof Error) {
141
+ return error;
157
142
  }
143
+ return new Error(`Mistral provider error: ${String(error)}`);
144
+ }
145
+ /**
146
+ * Validate provider configuration
147
+ */
148
+ async validateConfiguration() {
149
+ try {
150
+ getMistralApiKey();
151
+ return true;
152
+ }
153
+ catch {
154
+ return false;
155
+ }
156
+ }
157
+ /**
158
+ * Get provider-specific configuration
159
+ */
160
+ getConfiguration() {
161
+ return {
162
+ provider: this.providerName,
163
+ model: this.modelName,
164
+ defaultModel: getDefaultMistralModel(),
165
+ };
158
166
  }
159
167
  }
160
168
  export default MistralProvider;
@@ -24,6 +24,7 @@ export declare class OllamaProvider extends BaseProvider {
24
24
  protected getDefaultModel(): string;
25
25
  /**
26
26
  * Returns the Vercel AI SDK model instance for Ollama
27
+ * The OllamaLanguageModel implements LanguageModelV1 interface properly
27
28
  */
28
29
  protected getAISDKModel(): LanguageModelV1;
29
30
  /**
@@ -52,7 +53,7 @@ export declare class OllamaProvider extends BaseProvider {
52
53
  supportsTools(): boolean;
53
54
  protected executeStream(options: StreamOptions, analysisSchema?: ZodType<unknown, ZodTypeDef, unknown> | Schema<unknown>): Promise<StreamResult>;
54
55
  private createOllamaStream;
55
- protected handleProviderError(error: any): Error;
56
+ protected handleProviderError(error: unknown): Error;
56
57
  private validateStreamOptions;
57
58
  /**
58
59
  * Check if Ollama service is healthy and accessible