@juspay/neurolink 7.53.2 → 7.53.3

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 (176) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/agent/directTools.d.ts +3 -3
  3. package/dist/cli/commands/config.d.ts +62 -62
  4. package/dist/cli/commands/setup-google-ai.js +1 -1
  5. package/dist/cli/loop/optionsSchema.d.ts +1 -8
  6. package/dist/cli/loop/optionsSchema.js +1 -1
  7. package/dist/cli/utils/envManager.d.ts +1 -11
  8. package/dist/cli/utils/interactiveSetup.d.ts +1 -1
  9. package/dist/cli/utils/interactiveSetup.js +1 -1
  10. package/dist/constants/enums.d.ts +108 -0
  11. package/dist/constants/enums.js +138 -0
  12. package/dist/core/baseProvider.d.ts +2 -1
  13. package/dist/core/baseProvider.js +1 -0
  14. package/dist/core/factory.d.ts +2 -1
  15. package/dist/core/factory.js +1 -0
  16. package/dist/factories/providerFactory.d.ts +2 -1
  17. package/dist/factories/providerFactory.js +1 -0
  18. package/dist/factories/providerRegistry.d.ts +1 -10
  19. package/dist/factories/providerRegistry.js +1 -4
  20. package/dist/hitl/hitlManager.d.ts +1 -1
  21. package/dist/hitl/index.d.ts +0 -1
  22. package/dist/index.d.ts +6 -4
  23. package/dist/index.js +2 -1
  24. package/dist/lib/constants/enums.d.ts +108 -0
  25. package/dist/lib/constants/enums.js +139 -0
  26. package/dist/lib/core/baseProvider.d.ts +2 -1
  27. package/dist/lib/core/baseProvider.js +1 -0
  28. package/dist/lib/core/factory.d.ts +2 -1
  29. package/dist/lib/core/factory.js +1 -0
  30. package/dist/lib/factories/providerFactory.d.ts +2 -1
  31. package/dist/lib/factories/providerFactory.js +1 -0
  32. package/dist/lib/factories/providerRegistry.d.ts +1 -10
  33. package/dist/lib/factories/providerRegistry.js +1 -4
  34. package/dist/lib/hitl/hitlManager.d.ts +1 -1
  35. package/dist/lib/hitl/index.d.ts +0 -1
  36. package/dist/lib/index.d.ts +6 -4
  37. package/dist/lib/index.js +2 -1
  38. package/dist/lib/mcp/index.d.ts +1 -4
  39. package/dist/lib/mcp/index.js +0 -6
  40. package/dist/lib/memory/mem0Initializer.d.ts +1 -35
  41. package/dist/lib/middleware/builtin/guardrails.d.ts +0 -1
  42. package/dist/lib/middleware/utils/guardrailsUtils.d.ts +1 -14
  43. package/dist/lib/models/modelRegistry.d.ts +2 -90
  44. package/dist/lib/models/modelRegistry.js +2 -1
  45. package/dist/lib/models/modelResolver.d.ts +1 -41
  46. package/dist/lib/models/modelResolver.js +0 -1
  47. package/dist/lib/neurolink.d.ts +4 -40
  48. package/dist/lib/neurolink.js +3 -3
  49. package/dist/lib/providers/amazonBedrock.d.ts +2 -1
  50. package/dist/lib/providers/amazonBedrock.js +1 -0
  51. package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
  52. package/dist/lib/providers/amazonSagemaker.js +1 -0
  53. package/dist/lib/providers/anthropic.d.ts +1 -1
  54. package/dist/lib/providers/anthropic.js +1 -1
  55. package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
  56. package/dist/lib/providers/anthropicBaseProvider.js +1 -1
  57. package/dist/lib/providers/azureOpenai.d.ts +1 -1
  58. package/dist/lib/providers/azureOpenai.js +1 -1
  59. package/dist/lib/providers/googleAiStudio.d.ts +1 -1
  60. package/dist/lib/providers/googleAiStudio.js +1 -1
  61. package/dist/lib/providers/googleVertex.d.ts +1 -1
  62. package/dist/lib/providers/googleVertex.js +1 -0
  63. package/dist/lib/providers/huggingFace.d.ts +1 -1
  64. package/dist/lib/providers/huggingFace.js +1 -0
  65. package/dist/lib/providers/index.d.ts +0 -1
  66. package/dist/lib/providers/litellm.d.ts +1 -1
  67. package/dist/lib/providers/litellm.js +1 -0
  68. package/dist/lib/providers/mistral.d.ts +1 -1
  69. package/dist/lib/providers/mistral.js +1 -0
  70. package/dist/lib/providers/ollama.d.ts +1 -1
  71. package/dist/lib/providers/ollama.js +1 -0
  72. package/dist/lib/providers/openAI.d.ts +1 -1
  73. package/dist/lib/providers/openAI.js +1 -1
  74. package/dist/lib/providers/openaiCompatible.d.ts +1 -1
  75. package/dist/lib/providers/openaiCompatible.js +1 -0
  76. package/dist/lib/proxy/proxyFetch.js +2 -0
  77. package/dist/lib/types/analytics.d.ts +13 -0
  78. package/dist/lib/types/cli.d.ts +253 -0
  79. package/dist/lib/types/configTypes.d.ts +14 -0
  80. package/dist/lib/types/configTypes.js +1 -0
  81. package/dist/lib/types/fileTypes.d.ts +4 -4
  82. package/dist/lib/types/generateTypes.d.ts +1 -1
  83. package/dist/lib/types/generateTypes.js +1 -1
  84. package/dist/lib/types/guardrails.d.ts +13 -0
  85. package/dist/{hitl/types.d.ts → lib/types/hitlTypes.d.ts} +18 -18
  86. package/dist/lib/{hitl/types.js → types/hitlTypes.js} +1 -1
  87. package/dist/lib/types/index.d.ts +3 -1
  88. package/dist/lib/types/index.js +4 -0
  89. package/dist/lib/types/mcpTypes.d.ts +16 -12
  90. package/dist/lib/types/modelTypes.d.ts +113 -25
  91. package/dist/lib/types/modelTypes.js +1 -0
  92. package/dist/lib/types/observability.d.ts +6 -6
  93. package/dist/lib/types/providers.d.ts +43 -93
  94. package/dist/lib/types/providers.js +1 -118
  95. package/dist/lib/types/sdkTypes.d.ts +1 -1
  96. package/dist/lib/types/streamTypes.d.ts +2 -1
  97. package/dist/lib/types/streamTypes.js +1 -1
  98. package/dist/lib/types/taskClassificationTypes.d.ts +8 -8
  99. package/dist/lib/types/universalProviderOptions.d.ts +12 -12
  100. package/dist/lib/types/utilities.d.ts +48 -0
  101. package/dist/lib/utils/errorHandling.d.ts +2 -2
  102. package/dist/lib/utils/modelRouter.d.ts +4 -4
  103. package/dist/lib/utils/providerHealth.d.ts +5 -23
  104. package/dist/lib/utils/providerHealth.js +1 -1
  105. package/dist/lib/utils/providerSetupMessages.js +1 -1
  106. package/dist/lib/utils/providerUtils.js +1 -0
  107. package/dist/mcp/index.d.ts +1 -4
  108. package/dist/mcp/index.js +0 -6
  109. package/dist/memory/mem0Initializer.d.ts +1 -35
  110. package/dist/middleware/builtin/guardrails.d.ts +0 -1
  111. package/dist/middleware/utils/guardrailsUtils.d.ts +1 -14
  112. package/dist/models/modelRegistry.d.ts +2 -90
  113. package/dist/models/modelRegistry.js +2 -1
  114. package/dist/models/modelResolver.d.ts +1 -41
  115. package/dist/models/modelResolver.js +0 -1
  116. package/dist/neurolink.d.ts +4 -40
  117. package/dist/neurolink.js +3 -3
  118. package/dist/providers/amazonBedrock.d.ts +2 -1
  119. package/dist/providers/amazonBedrock.js +1 -0
  120. package/dist/providers/amazonSagemaker.d.ts +1 -1
  121. package/dist/providers/amazonSagemaker.js +1 -0
  122. package/dist/providers/anthropic.d.ts +1 -1
  123. package/dist/providers/anthropic.js +1 -1
  124. package/dist/providers/anthropicBaseProvider.d.ts +1 -1
  125. package/dist/providers/anthropicBaseProvider.js +1 -1
  126. package/dist/providers/azureOpenai.d.ts +1 -1
  127. package/dist/providers/azureOpenai.js +1 -1
  128. package/dist/providers/googleAiStudio.d.ts +1 -1
  129. package/dist/providers/googleAiStudio.js +1 -1
  130. package/dist/providers/googleVertex.d.ts +1 -1
  131. package/dist/providers/googleVertex.js +1 -0
  132. package/dist/providers/huggingFace.d.ts +1 -1
  133. package/dist/providers/huggingFace.js +1 -0
  134. package/dist/providers/index.d.ts +0 -1
  135. package/dist/providers/litellm.d.ts +1 -1
  136. package/dist/providers/litellm.js +1 -0
  137. package/dist/providers/mistral.d.ts +1 -1
  138. package/dist/providers/mistral.js +1 -0
  139. package/dist/providers/ollama.d.ts +1 -1
  140. package/dist/providers/ollama.js +1 -0
  141. package/dist/providers/openAI.d.ts +1 -1
  142. package/dist/providers/openAI.js +1 -1
  143. package/dist/providers/openaiCompatible.d.ts +1 -1
  144. package/dist/providers/openaiCompatible.js +1 -0
  145. package/dist/proxy/proxyFetch.js +2 -0
  146. package/dist/types/analytics.d.ts +13 -0
  147. package/dist/types/cli.d.ts +253 -0
  148. package/dist/types/configTypes.d.ts +14 -0
  149. package/dist/types/configTypes.js +1 -0
  150. package/dist/types/fileTypes.d.ts +4 -4
  151. package/dist/types/generateTypes.d.ts +1 -1
  152. package/dist/types/generateTypes.js +1 -1
  153. package/dist/types/guardrails.d.ts +13 -0
  154. package/dist/{lib/hitl/types.d.ts → types/hitlTypes.d.ts} +18 -18
  155. package/dist/types/index.d.ts +3 -1
  156. package/dist/types/index.js +4 -0
  157. package/dist/types/mcpTypes.d.ts +16 -12
  158. package/dist/types/modelTypes.d.ts +113 -25
  159. package/dist/types/modelTypes.js +1 -0
  160. package/dist/types/observability.d.ts +6 -6
  161. package/dist/types/providers.d.ts +43 -93
  162. package/dist/types/providers.js +1 -118
  163. package/dist/types/sdkTypes.d.ts +1 -1
  164. package/dist/types/streamTypes.d.ts +2 -1
  165. package/dist/types/streamTypes.js +1 -1
  166. package/dist/types/taskClassificationTypes.d.ts +8 -8
  167. package/dist/types/universalProviderOptions.d.ts +12 -12
  168. package/dist/types/utilities.d.ts +48 -0
  169. package/dist/utils/errorHandling.d.ts +2 -2
  170. package/dist/utils/modelRouter.d.ts +4 -4
  171. package/dist/utils/providerHealth.d.ts +5 -23
  172. package/dist/utils/providerHealth.js +1 -1
  173. package/dist/utils/providerSetupMessages.js +1 -1
  174. package/dist/utils/providerUtils.js +1 -0
  175. package/package.json +1 -1
  176. /package/dist/{hitl/types.js → types/hitlTypes.js} +0 -0
@@ -25,6 +25,10 @@ export * from "./serviceTypes.js";
25
25
  export * from "./evaluationProviders.js";
26
26
  // SDK Types - Core types for external developers
27
27
  export * from "./sdkTypes.js";
28
+ // Utilities Types - Utility module types (selective export to avoid conflicts)
29
+ export * from "./utilities.js";
30
+ // Middleware Types - Middleware system types
31
+ export * from "./middlewareTypes.js";
28
32
  // File detection and processing types
29
33
  export * from "./fileTypes.js";
30
34
  // Content types for multimodal support
@@ -163,6 +163,22 @@ export type MCPToolMetadata = {
163
163
  * MCP Server Registry Entry - For Object.entries() usage
164
164
  */
165
165
  export type MCPServerRegistryEntry = [string, MCPServerInfo];
166
+ export type MCPStatus = {
167
+ mcpInitialized: boolean;
168
+ totalServers: number;
169
+ availableServers: number;
170
+ autoDiscoveredCount: number;
171
+ totalTools: number;
172
+ autoDiscoveredServers: MCPServerInfo[];
173
+ customToolsCount: number;
174
+ inMemoryServersCount: number;
175
+ externalMCPServersCount?: number;
176
+ externalMCPConnectedCount?: number;
177
+ externalMCPFailedCount?: number;
178
+ externalMCPServers?: MCPServerInfo[];
179
+ error?: string;
180
+ [key: string]: unknown;
181
+ };
166
182
  /**
167
183
  * Call record for circuit breaker statistics tracking
168
184
  * Extracted from mcpCircuitBreaker.ts for centralized type management
@@ -342,18 +358,6 @@ export type McpMetadata = {
342
358
  repository?: string;
343
359
  category?: string;
344
360
  };
345
- /**
346
- * Provider status information
347
- * Moved from src/lib/mcp/contracts/mcpContract.ts
348
- */
349
- export type ProviderStatus = {
350
- available: boolean;
351
- lastCheck: number;
352
- reason?: string;
353
- model?: string;
354
- cost?: number;
355
- latencyMs?: number;
356
- };
357
361
  /**
358
362
  * Tool discovery result
359
363
  * Moved from src/lib/mcp/toolDiscoveryService.ts
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { z } from "zod";
6
6
  import type { JsonValue } from "./common.js";
7
+ import { AIProviderName } from "../constants/enums.js";
7
8
  /**
8
9
  * Model performance tier definition
9
10
  */
@@ -200,43 +201,130 @@ export type DynamicModelConfig = z.infer<typeof ModelConfigSchema>;
200
201
  */
201
202
  export type ModelRegistry = z.infer<typeof ModelRegistrySchema>;
202
203
  /**
203
- * Model name constants structure
204
+ * Model capabilities interface
204
205
  */
205
- export type ModelNameConstants = {
206
- readonly [provider: string]: {
207
- readonly FAST: string;
208
- readonly BALANCED: string;
209
- readonly QUALITY: string;
210
- };
206
+ export type ModelCapabilities = {
207
+ vision: boolean;
208
+ functionCalling: boolean;
209
+ codeGeneration: boolean;
210
+ reasoning: boolean;
211
+ multimodal: boolean;
212
+ streaming: boolean;
213
+ jsonMode: boolean;
211
214
  };
212
215
  /**
213
- * Model metadata for registry
216
+ * Model pricing information
214
217
  */
215
- export type ModelMetadata = {
216
- version: string;
217
- lastUpdated: string;
218
- modelCount: number;
218
+ export type ModelPricingInfo = {
219
+ inputCostPer1K: number;
220
+ outputCostPer1K: number;
221
+ currency: string;
222
+ };
223
+ /**
224
+ * Model performance characteristics
225
+ */
226
+ export type ModelPerformance = {
227
+ speed: "fast" | "medium" | "slow";
228
+ quality: "high" | "medium" | "low";
229
+ accuracy: "high" | "medium" | "low";
219
230
  };
220
231
  /**
221
- * Model search options
232
+ * Model limitations and constraints
222
233
  */
223
- export type ModelSearchOptions = {
224
- provider?: string;
225
- maxPrice?: number;
226
- excludeDeprecated?: boolean;
234
+ export type ModelLimits = {
235
+ maxContextTokens: number;
236
+ maxOutputTokens: number;
237
+ maxRequestsPerMinute?: number;
238
+ maxRequestsPerDay?: number;
239
+ };
240
+ /**
241
+ * Use case suitability scores (1-10 scale)
242
+ */
243
+ export type UseCaseSuitability = {
244
+ coding: number;
245
+ creative: number;
246
+ analysis: number;
247
+ conversation: number;
248
+ reasoning: number;
249
+ translation: number;
250
+ summarization: number;
251
+ };
252
+ /**
253
+ * Complete model information
254
+ */
255
+ export type ModelInfo = {
256
+ id: string;
257
+ name: string;
258
+ provider: AIProviderName;
259
+ description: string;
260
+ capabilities: ModelCapabilities;
261
+ pricing: ModelPricingInfo;
262
+ performance: ModelPerformance;
263
+ limits: ModelLimits;
264
+ useCases: UseCaseSuitability;
265
+ aliases: string[];
266
+ deprecated: boolean;
267
+ isLocal: boolean;
268
+ releaseDate?: string;
269
+ category: "general" | "coding" | "creative" | "vision" | "reasoning";
227
270
  };
228
271
  /**
229
- * Model search result
272
+ * Model search filters
273
+ */
274
+ export type ModelSearchFilters = {
275
+ provider?: AIProviderName | AIProviderName[];
276
+ capability?: keyof ModelCapabilities | (keyof ModelCapabilities)[];
277
+ useCase?: keyof UseCaseSuitability;
278
+ maxCost?: number;
279
+ minContextSize?: number;
280
+ maxContextSize?: number;
281
+ performance?: ModelPerformance["speed"] | ModelPerformance["quality"];
282
+ category?: ModelInfo["category"] | ModelInfo["category"][];
283
+ };
284
+ /**
285
+ * Model search result with ranking
230
286
  */
231
287
  export type ModelSearchResult = {
232
- provider: string;
233
- model: string;
234
- config: DynamicModelConfig;
288
+ model: ModelInfo;
289
+ score: number;
290
+ matchReasons: string[];
291
+ };
292
+ /**
293
+ * Model recommendation context
294
+ */
295
+ export type RecommendationContext = {
296
+ useCase?: keyof UseCaseSuitability;
297
+ maxCost?: number;
298
+ minQuality?: "low" | "medium" | "high";
299
+ requireCapabilities?: (keyof ModelCapabilities)[];
300
+ excludeProviders?: AIProviderName[];
301
+ contextSize?: number;
302
+ preferLocal?: boolean;
235
303
  };
236
304
  /**
237
- * Cost information structure
305
+ * Model recommendation result
238
306
  */
239
- export type CostInfo = {
240
- input: number;
241
- output: number;
307
+ export type ModelRecommendation = {
308
+ model: ModelInfo;
309
+ score: number;
310
+ reasoning: string[];
311
+ alternatives: ModelInfo[];
312
+ };
313
+ /**
314
+ * Model comparison result
315
+ */
316
+ export type ModelComparison = {
317
+ models: ModelInfo[];
318
+ comparison: {
319
+ capabilities: Record<keyof ModelCapabilities, ModelInfo[]>;
320
+ pricing: {
321
+ cheapest: ModelInfo;
322
+ mostExpensive: ModelInfo;
323
+ };
324
+ performance: Record<string, ModelInfo[]>;
325
+ contextSize: {
326
+ largest: ModelInfo;
327
+ smallest: ModelInfo;
328
+ };
329
+ };
242
330
  };
@@ -3,6 +3,7 @@
3
3
  * Consolidates all model configuration, dynamic model, and provider model types
4
4
  */
5
5
  import { z } from "zod";
6
+ import { AIProviderName } from "../constants/enums.js";
6
7
  /**
7
8
  * Zod schema for model configuration validation
8
9
  */
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * Langfuse observability configuration
8
8
  */
9
- export interface LangfuseConfig {
9
+ export type LangfuseConfig = {
10
10
  /** Whether Langfuse is enabled */
11
11
  enabled: boolean;
12
12
  /** Langfuse public key */
@@ -24,11 +24,11 @@ export interface LangfuseConfig {
24
24
  environment?: string;
25
25
  /** Release/version identifier */
26
26
  release?: string;
27
- }
27
+ };
28
28
  /**
29
29
  * OpenTelemetry configuration
30
30
  */
31
- export interface OpenTelemetryConfig {
31
+ export type OpenTelemetryConfig = {
32
32
  /** Whether OpenTelemetry is enabled */
33
33
  enabled: boolean;
34
34
  /** OTLP endpoint URL */
@@ -37,13 +37,13 @@ export interface OpenTelemetryConfig {
37
37
  serviceName?: string;
38
38
  /** Service version */
39
39
  serviceVersion?: string;
40
- }
40
+ };
41
41
  /**
42
42
  * Complete observability configuration for Neurolink SDK
43
43
  */
44
- export interface ObservabilityConfig {
44
+ export type ObservabilityConfig = {
45
45
  /** Langfuse configuration */
46
46
  langfuse?: LangfuseConfig;
47
47
  /** OpenTelemetry configuration */
48
48
  openTelemetry?: OpenTelemetryConfig;
49
- }
49
+ };
@@ -2,103 +2,12 @@
2
2
  * Provider-specific type definitions for NeuroLink
3
3
  */
4
4
  import type { UnknownRecord, JsonValue } from "./common.js";
5
+ import { AIProviderName, AnthropicModels, BedrockModels, GoogleAIModels, OpenAIModels, VertexModels } from "../constants/enums.js";
5
6
  import type { Tool } from "ai";
6
7
  import type { ValidationSchema } from "./typeAliases.js";
7
8
  import type { EnhancedGenerateResult, GenerateResult, TextGenerationOptions } from "./generateTypes.js";
8
9
  import type { StreamOptions, StreamResult } from "./streamTypes.js";
9
10
  import type { ExternalMCPToolInfo } from "./externalMcp.js";
10
- /**
11
- * Supported AI Provider Names
12
- */
13
- export declare enum AIProviderName {
14
- BEDROCK = "bedrock",
15
- OPENAI = "openai",
16
- OPENAI_COMPATIBLE = "openai-compatible",
17
- VERTEX = "vertex",
18
- ANTHROPIC = "anthropic",
19
- AZURE = "azure",
20
- GOOGLE_AI = "google-ai",
21
- HUGGINGFACE = "huggingface",
22
- OLLAMA = "ollama",
23
- MISTRAL = "mistral",
24
- LITELLM = "litellm",
25
- SAGEMAKER = "sagemaker",
26
- AUTO = "auto"
27
- }
28
- /**
29
- * Supported Models for Amazon Bedrock
30
- */
31
- export declare enum BedrockModels {
32
- CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
33
- CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
34
- CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
35
- CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
36
- }
37
- /**
38
- * Supported Models for OpenAI
39
- */
40
- export declare enum OpenAIModels {
41
- GPT_4 = "gpt-4",
42
- GPT_4_TURBO = "gpt-4-turbo",
43
- GPT_4O = "gpt-4o",
44
- GPT_4O_MINI = "gpt-4o-mini",
45
- GPT_3_5_TURBO = "gpt-3.5-turbo",
46
- O1_PREVIEW = "o1-preview",
47
- O1_MINI = "o1-mini"
48
- }
49
- /**
50
- * Supported Models for Google Vertex AI
51
- */
52
- export declare enum VertexModels {
53
- CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
54
- CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
55
- CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
56
- CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
57
- CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
58
- CLAUDE_3_OPUS = "claude-3-opus-20240229",
59
- CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
60
- GEMINI_2_5_PRO = "gemini-2.5-pro",
61
- GEMINI_2_5_FLASH = "gemini-2.5-flash",
62
- GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
63
- GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
64
- GEMINI_1_5_PRO = "gemini-1.5-pro",
65
- GEMINI_1_5_FLASH = "gemini-1.5-flash"
66
- }
67
- /**
68
- * Supported Models for Google AI Studio
69
- */
70
- export declare enum GoogleAIModels {
71
- GEMINI_2_5_PRO = "gemini-2.5-pro",
72
- GEMINI_2_5_FLASH = "gemini-2.5-flash",
73
- GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
74
- GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
75
- GEMINI_1_5_PRO = "gemini-1.5-pro",
76
- GEMINI_1_5_FLASH = "gemini-1.5-flash",
77
- GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
78
- }
79
- /**
80
- * Supported Models for Anthropic (Direct API)
81
- */
82
- export declare enum AnthropicModels {
83
- CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
84
- CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
85
- CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
86
- CLAUDE_3_OPUS = "claude-3-opus-20240229",
87
- CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
88
- }
89
- /**
90
- * API Versions for various providers
91
- */
92
- export declare enum APIVersions {
93
- AZURE_LATEST = "2025-04-01-preview",
94
- AZURE_STABLE = "2024-10-21",
95
- AZURE_LEGACY = "2023-12-01-preview",
96
- OPENAI_CURRENT = "v1",
97
- OPENAI_BETA = "v1-beta",
98
- GOOGLE_AI_CURRENT = "v1",
99
- GOOGLE_AI_BETA = "v1beta",
100
- ANTHROPIC_CURRENT = "2023-06-01"
101
- }
102
11
  /**
103
12
  * Generic AI SDK model interface
104
13
  */
@@ -112,7 +21,19 @@ export type SupportedModelName = BedrockModels | OpenAIModels | VertexModels | G
112
21
  /**
113
22
  * Extract provider names from enum
114
23
  */
115
- export type ProviderName = keyof typeof AIProviderName;
24
+ export type ProviderName = (typeof AIProviderName)[keyof typeof AIProviderName];
25
+ /**
26
+ * Provider status information
27
+ */
28
+ export type ProviderStatus = {
29
+ provider: string;
30
+ status: "working" | "failed" | "not-configured";
31
+ configured: boolean;
32
+ authenticated: boolean;
33
+ error?: string;
34
+ responseTime?: number;
35
+ model?: string;
36
+ };
116
37
  /**
117
38
  * Provider error information
118
39
  */
@@ -344,6 +265,16 @@ export type ProviderRegistration = {
344
265
  capabilities?: ProviderCapabilities;
345
266
  defaultConfig?: IndividualProviderConfig;
346
267
  };
268
+ /**
269
+ * Configuration options for the provider registry
270
+ */
271
+ export type ProviderRegistryOptions = {
272
+ /**
273
+ * Enable loading of manual MCP configurations from .mcp-config.json
274
+ * Should only be true for CLI mode, false for SDK mode
275
+ */
276
+ enableManualMCP?: boolean;
277
+ };
347
278
  /**
348
279
  * Provider metadata type
349
280
  */
@@ -1060,6 +991,25 @@ export type SageMakerGenerateResult = {
1060
991
  toolCalls?: SageMakerToolCall[];
1061
992
  object?: unknown;
1062
993
  };
994
+ export type ProviderHealthStatusOptions = {
995
+ provider: AIProviderName;
996
+ isHealthy: boolean;
997
+ isConfigured: boolean;
998
+ hasApiKey: boolean;
999
+ lastChecked: Date;
1000
+ error?: string;
1001
+ warning?: string;
1002
+ responseTime?: number;
1003
+ configurationIssues: string[];
1004
+ recommendations: string[];
1005
+ };
1006
+ export type ProviderHealthCheckOptions = {
1007
+ timeout?: number;
1008
+ includeConnectivityTest?: boolean;
1009
+ includeModelValidation?: boolean;
1010
+ cacheResults?: boolean;
1011
+ maxCacheAge?: number;
1012
+ };
1063
1013
  /**
1064
1014
  * Amazon Bedrock specific types
1065
1015
  */
@@ -1,124 +1,7 @@
1
1
  /**
2
2
  * Provider-specific type definitions for NeuroLink
3
3
  */
4
- // ============================================================================
5
- // ENUMS
6
- // ============================================================================
7
- /**
8
- * Supported AI Provider Names
9
- */
10
- export var AIProviderName;
11
- (function (AIProviderName) {
12
- AIProviderName["BEDROCK"] = "bedrock";
13
- AIProviderName["OPENAI"] = "openai";
14
- AIProviderName["OPENAI_COMPATIBLE"] = "openai-compatible";
15
- AIProviderName["VERTEX"] = "vertex";
16
- AIProviderName["ANTHROPIC"] = "anthropic";
17
- AIProviderName["AZURE"] = "azure";
18
- AIProviderName["GOOGLE_AI"] = "google-ai";
19
- AIProviderName["HUGGINGFACE"] = "huggingface";
20
- AIProviderName["OLLAMA"] = "ollama";
21
- AIProviderName["MISTRAL"] = "mistral";
22
- AIProviderName["LITELLM"] = "litellm";
23
- AIProviderName["SAGEMAKER"] = "sagemaker";
24
- AIProviderName["AUTO"] = "auto";
25
- })(AIProviderName || (AIProviderName = {}));
26
- /**
27
- * Supported Models for Amazon Bedrock
28
- */
29
- export var BedrockModels;
30
- (function (BedrockModels) {
31
- BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
32
- BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
33
- BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
34
- BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
35
- })(BedrockModels || (BedrockModels = {}));
36
- /**
37
- * Supported Models for OpenAI
38
- */
39
- export var OpenAIModels;
40
- (function (OpenAIModels) {
41
- OpenAIModels["GPT_4"] = "gpt-4";
42
- OpenAIModels["GPT_4_TURBO"] = "gpt-4-turbo";
43
- OpenAIModels["GPT_4O"] = "gpt-4o";
44
- OpenAIModels["GPT_4O_MINI"] = "gpt-4o-mini";
45
- OpenAIModels["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
46
- OpenAIModels["O1_PREVIEW"] = "o1-preview";
47
- OpenAIModels["O1_MINI"] = "o1-mini";
48
- })(OpenAIModels || (OpenAIModels = {}));
49
- /**
50
- * Supported Models for Google Vertex AI
51
- */
52
- export var VertexModels;
53
- (function (VertexModels) {
54
- // Claude 4 Series (Latest - May 2025)
55
- VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
56
- VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
57
- // Claude 3.5 Series (Still supported)
58
- VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
59
- VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
60
- // Claude 3 Series (Legacy support)
61
- VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
62
- VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
63
- VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
64
- // Gemini 2.5 Series (Latest - 2025)
65
- VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
66
- VertexModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
67
- VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
68
- // Gemini 2.0 Series
69
- VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
70
- // Gemini 1.5 Series (Legacy support)
71
- VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
72
- VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
73
- })(VertexModels || (VertexModels = {}));
74
- /**
75
- * Supported Models for Google AI Studio
76
- */
77
- export var GoogleAIModels;
78
- (function (GoogleAIModels) {
79
- // Gemini 2.5 Series (Latest - 2025)
80
- GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
81
- GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
82
- GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
83
- // Gemini 2.0 Series
84
- GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
85
- // Gemini 1.5 Series (Legacy support)
86
- GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
87
- GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
88
- GoogleAIModels["GEMINI_1_5_FLASH_LITE"] = "gemini-1.5-flash-lite";
89
- })(GoogleAIModels || (GoogleAIModels = {}));
90
- /**
91
- * Supported Models for Anthropic (Direct API)
92
- */
93
- export var AnthropicModels;
94
- (function (AnthropicModels) {
95
- // Claude 3.5 Series (Latest)
96
- AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
97
- AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
98
- // Claude 3 Series (Legacy support)
99
- AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
100
- AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
101
- AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
102
- })(AnthropicModels || (AnthropicModels = {}));
103
- /**
104
- * API Versions for various providers
105
- */
106
- export var APIVersions;
107
- (function (APIVersions) {
108
- // Azure OpenAI API versions
109
- APIVersions["AZURE_LATEST"] = "2025-04-01-preview";
110
- APIVersions["AZURE_STABLE"] = "2024-10-21";
111
- APIVersions["AZURE_LEGACY"] = "2023-12-01-preview";
112
- // OpenAI API versions
113
- APIVersions["OPENAI_CURRENT"] = "v1";
114
- APIVersions["OPENAI_BETA"] = "v1-beta";
115
- // Google AI API versions
116
- APIVersions["GOOGLE_AI_CURRENT"] = "v1";
117
- APIVersions["GOOGLE_AI_BETA"] = "v1beta";
118
- // Anthropic API versions
119
- APIVersions["ANTHROPIC_CURRENT"] = "2023-06-01";
120
- // Other provider versions can be added here
121
- })(APIVersions || (APIVersions = {}));
4
+ import { AIProviderName, AnthropicModels, BedrockModels, GoogleAIModels, OpenAIModels, VertexModels, } from "../constants/enums.js";
122
5
  /**
123
6
  * Default model aliases for easy reference
124
7
  */
@@ -11,7 +11,7 @@ ToolCallResults, ToolCalls, StreamOptions, StreamingOptions, EnhancedStreamProvi
11
11
  export type { TypedEventEmitter, NeuroLinkEvents, StreamEvent, AsyncFunction, SyncFunction, AnyFunction, } from "./common.js";
12
12
  export type { NeuroLinkConfig, ProviderConfig, PerformanceConfig, CacheConfig, FallbackConfig, RetryConfig, AnalyticsConfig, ToolConfig, BackupInfo, BackupMetadata, ConfigValidationResult, ConfigUpdateOptions, } from "./configTypes.js";
13
13
  export type { ToolArgs, ToolContext, ToolResult, ToolDefinition, SimpleTool, AvailableTool, ToolExecution, BaseToolArgs, ToolExecutionEvent, ToolExecutionSummary, ToolExecutionContext, ToolExecutionMetadata, ToolParameterSchema, ZodUnknownSchema, ZodAnySchema, ZodObjectSchema, ZodStringSchema, } from "./tools.js";
14
- export type { AISDKModel, ProviderError, AIModelProviderConfig, AIProviderName, ProviderName, ModelCapability, ModelUseCase, ModelFilter, ModelResolutionContext, ModelStats, ModelPricing, ProviderCapabilities, } from "./providers.js";
14
+ export type { AISDKModel, ProviderError, AIModelProviderConfig, ProviderName, ModelCapability, ModelUseCase, ModelFilter, ModelResolutionContext, ModelStats, ModelPricing, ProviderCapabilities, } from "./providers.js";
15
15
  export type { GenerateOptions, GenerateResult, UnifiedGenerationOptions, EnhancedProvider, FactoryEnhancedProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, } from "./generateTypes.js";
16
16
  export type { TokenUsage, AnalyticsData } from "./analytics.js";
17
17
  export type { TextContent, ImageContent, Content, VisionCapability, ProviderImageFormat, ProcessedImage, MultimodalMessage, ProviderMultimodalPayload, } from "./content.js";
@@ -2,7 +2,8 @@ import type { Tool } from "ai";
2
2
  import type { ValidationSchema, StandardRecord } from "./typeAliases.js";
3
3
  import type { AIModelProviderConfig } from "./providers.js";
4
4
  import type { TextContent, ImageContent } from "./content.js";
5
- import type { AIProviderName, AnalyticsData, ToolExecutionEvent, ToolExecutionSummary } from "../types/index.js";
5
+ import type { AnalyticsData, ToolExecutionEvent, ToolExecutionSummary } from "../types/index.js";
6
+ import { AIProviderName } from "../constants/enums.js";
6
7
  import type { TokenUsage } from "./analytics.js";
7
8
  import type { EvaluationData } from "../index.js";
8
9
  import type { UnknownRecord, JsonValue } from "./common.js";
@@ -1 +1 @@
1
- export {};
1
+ import { AIProviderName } from "../constants/enums.js";
@@ -9,29 +9,29 @@ export type TaskType = "fast" | "reasoning";
9
9
  /**
10
10
  * Result of task classification analysis
11
11
  */
12
- export interface TaskClassification {
12
+ export type TaskClassification = {
13
13
  /** The classified task type */
14
14
  type: TaskType;
15
15
  /** Confidence score (0-1) in the classification */
16
16
  confidence: number;
17
17
  /** Human-readable explanation of the classification decision */
18
18
  reasoning: string;
19
- }
19
+ };
20
20
  /**
21
21
  * Internal scoring data used during classification analysis
22
22
  */
23
- export interface ClassificationScores {
23
+ export type ClassificationScores = {
24
24
  /** Score indicating likelihood of fast task */
25
25
  fastScore: number;
26
26
  /** Score indicating likelihood of reasoning task */
27
27
  reasoningScore: number;
28
28
  /** Array of reasons contributing to the scores */
29
29
  reasons: string[];
30
- }
30
+ };
31
31
  /**
32
32
  * Statistics for batch classification analysis
33
33
  */
34
- export interface ClassificationStats {
34
+ export type ClassificationStats = {
35
35
  /** Total number of prompts analyzed */
36
36
  total: number;
37
37
  /** Number of prompts classified as fast */
@@ -40,13 +40,13 @@ export interface ClassificationStats {
40
40
  reasoning: number;
41
41
  /** Average confidence across all classifications */
42
42
  averageConfidence: number;
43
- }
43
+ };
44
44
  /**
45
45
  * Validation result for testing classification accuracy
46
46
  */
47
- export interface ClassificationValidation {
47
+ export type ClassificationValidation = {
48
48
  /** Whether the classification matched the expected result */
49
49
  correct: boolean;
50
50
  /** The actual classification result */
51
51
  classification: TaskClassification;
52
- }
52
+ };