@juspay/neurolink 7.53.1 → 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 (182) hide show
  1. package/CHANGELOG.md +4 -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 +7 -4
  23. package/dist/index.js +3 -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 +7 -4
  37. package/dist/lib/index.js +3 -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/session/globalSessionState.js +1 -26
  78. package/dist/lib/types/analytics.d.ts +13 -0
  79. package/dist/lib/types/cli.d.ts +253 -0
  80. package/dist/lib/types/configTypes.d.ts +14 -0
  81. package/dist/lib/types/configTypes.js +1 -0
  82. package/dist/lib/types/fileTypes.d.ts +4 -4
  83. package/dist/lib/types/generateTypes.d.ts +1 -1
  84. package/dist/lib/types/generateTypes.js +1 -1
  85. package/dist/lib/types/guardrails.d.ts +13 -0
  86. package/dist/{hitl/types.d.ts → lib/types/hitlTypes.d.ts} +18 -18
  87. package/dist/lib/{hitl/types.js → types/hitlTypes.js} +1 -1
  88. package/dist/lib/types/index.d.ts +3 -1
  89. package/dist/lib/types/index.js +4 -0
  90. package/dist/lib/types/mcpTypes.d.ts +16 -12
  91. package/dist/lib/types/modelTypes.d.ts +113 -25
  92. package/dist/lib/types/modelTypes.js +1 -0
  93. package/dist/lib/types/observability.d.ts +6 -6
  94. package/dist/lib/types/providers.d.ts +43 -93
  95. package/dist/lib/types/providers.js +1 -118
  96. package/dist/lib/types/sdkTypes.d.ts +1 -1
  97. package/dist/lib/types/streamTypes.d.ts +2 -1
  98. package/dist/lib/types/streamTypes.js +1 -1
  99. package/dist/lib/types/taskClassificationTypes.d.ts +8 -8
  100. package/dist/lib/types/universalProviderOptions.d.ts +12 -12
  101. package/dist/lib/types/utilities.d.ts +48 -0
  102. package/dist/lib/utils/errorHandling.d.ts +2 -2
  103. package/dist/lib/utils/modelRouter.d.ts +4 -4
  104. package/dist/lib/utils/observabilityHelpers.d.ts +27 -0
  105. package/dist/lib/utils/observabilityHelpers.js +48 -0
  106. package/dist/lib/utils/providerHealth.d.ts +5 -23
  107. package/dist/lib/utils/providerHealth.js +1 -1
  108. package/dist/lib/utils/providerSetupMessages.js +1 -1
  109. package/dist/lib/utils/providerUtils.js +1 -0
  110. package/dist/mcp/index.d.ts +1 -4
  111. package/dist/mcp/index.js +0 -6
  112. package/dist/memory/mem0Initializer.d.ts +1 -35
  113. package/dist/middleware/builtin/guardrails.d.ts +0 -1
  114. package/dist/middleware/utils/guardrailsUtils.d.ts +1 -14
  115. package/dist/models/modelRegistry.d.ts +2 -90
  116. package/dist/models/modelRegistry.js +2 -1
  117. package/dist/models/modelResolver.d.ts +1 -41
  118. package/dist/models/modelResolver.js +0 -1
  119. package/dist/neurolink.d.ts +4 -40
  120. package/dist/neurolink.js +3 -3
  121. package/dist/providers/amazonBedrock.d.ts +2 -1
  122. package/dist/providers/amazonBedrock.js +1 -0
  123. package/dist/providers/amazonSagemaker.d.ts +1 -1
  124. package/dist/providers/amazonSagemaker.js +1 -0
  125. package/dist/providers/anthropic.d.ts +1 -1
  126. package/dist/providers/anthropic.js +1 -1
  127. package/dist/providers/anthropicBaseProvider.d.ts +1 -1
  128. package/dist/providers/anthropicBaseProvider.js +1 -1
  129. package/dist/providers/azureOpenai.d.ts +1 -1
  130. package/dist/providers/azureOpenai.js +1 -1
  131. package/dist/providers/googleAiStudio.d.ts +1 -1
  132. package/dist/providers/googleAiStudio.js +1 -1
  133. package/dist/providers/googleVertex.d.ts +1 -1
  134. package/dist/providers/googleVertex.js +1 -0
  135. package/dist/providers/huggingFace.d.ts +1 -1
  136. package/dist/providers/huggingFace.js +1 -0
  137. package/dist/providers/index.d.ts +0 -1
  138. package/dist/providers/litellm.d.ts +1 -1
  139. package/dist/providers/litellm.js +1 -0
  140. package/dist/providers/mistral.d.ts +1 -1
  141. package/dist/providers/mistral.js +1 -0
  142. package/dist/providers/ollama.d.ts +1 -1
  143. package/dist/providers/ollama.js +1 -0
  144. package/dist/providers/openAI.d.ts +1 -1
  145. package/dist/providers/openAI.js +1 -1
  146. package/dist/providers/openaiCompatible.d.ts +1 -1
  147. package/dist/providers/openaiCompatible.js +1 -0
  148. package/dist/proxy/proxyFetch.js +2 -0
  149. package/dist/session/globalSessionState.js +1 -26
  150. package/dist/types/analytics.d.ts +13 -0
  151. package/dist/types/cli.d.ts +253 -0
  152. package/dist/types/configTypes.d.ts +14 -0
  153. package/dist/types/configTypes.js +1 -0
  154. package/dist/types/fileTypes.d.ts +4 -4
  155. package/dist/types/generateTypes.d.ts +1 -1
  156. package/dist/types/generateTypes.js +1 -1
  157. package/dist/types/guardrails.d.ts +13 -0
  158. package/dist/{lib/hitl/types.d.ts → types/hitlTypes.d.ts} +18 -18
  159. package/dist/types/index.d.ts +3 -1
  160. package/dist/types/index.js +4 -0
  161. package/dist/types/mcpTypes.d.ts +16 -12
  162. package/dist/types/modelTypes.d.ts +113 -25
  163. package/dist/types/modelTypes.js +1 -0
  164. package/dist/types/observability.d.ts +6 -6
  165. package/dist/types/providers.d.ts +43 -93
  166. package/dist/types/providers.js +1 -118
  167. package/dist/types/sdkTypes.d.ts +1 -1
  168. package/dist/types/streamTypes.d.ts +2 -1
  169. package/dist/types/streamTypes.js +1 -1
  170. package/dist/types/taskClassificationTypes.d.ts +8 -8
  171. package/dist/types/universalProviderOptions.d.ts +12 -12
  172. package/dist/types/utilities.d.ts +48 -0
  173. package/dist/utils/errorHandling.d.ts +2 -2
  174. package/dist/utils/modelRouter.d.ts +4 -4
  175. package/dist/utils/observabilityHelpers.d.ts +27 -0
  176. package/dist/utils/observabilityHelpers.js +47 -0
  177. package/dist/utils/providerHealth.d.ts +5 -23
  178. package/dist/utils/providerHealth.js +1 -1
  179. package/dist/utils/providerSetupMessages.js +1 -1
  180. package/dist/utils/providerUtils.js +1 -0
  181. package/package.json +1 -1
  182. /package/dist/{hitl/types.js → types/hitlTypes.js} +0 -0
@@ -1,13 +1,4 @@
1
- /**
2
- * Configuration options for the provider registry
3
- */
4
- export interface ProviderRegistryOptions {
5
- /**
6
- * Enable loading of manual MCP configurations from .mcp-config.json
7
- * Should only be true for CLI mode, false for SDK mode
8
- */
9
- enableManualMCP?: boolean;
10
- }
1
+ import type { ProviderRegistryOptions } from "../types/index.js";
11
2
  /**
12
3
  * Provider Registry - registers all providers with the factory
13
4
  * This is where we migrate providers one by one to the new pattern
@@ -1,9 +1,6 @@
1
1
  import { ProviderFactory } from "./providerFactory.js";
2
- // Lazy loading all providers to avoid circular dependencies
3
- // Removed all static imports - providers loaded dynamically when needed
4
- // This breaks the circular dependency chain completely
5
- import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../types/index.js";
6
2
  import { logger } from "../utils/logger.js";
3
+ import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../constants/enums.js";
7
4
  /**
8
5
  * Provider Registry - registers all providers with the factory
9
6
  * This is where we migrate providers one by one to the new pattern
@@ -6,7 +6,7 @@
6
6
  * for enterprise-grade AI safety.
7
7
  */
8
8
  import { EventEmitter } from "events";
9
- import type { HITLConfig, ConfirmationResult, HITLStatistics } from "./types.js";
9
+ import type { HITLConfig, ConfirmationResult, HITLStatistics } from "../types/hitlTypes.js";
10
10
  /**
11
11
  * HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
12
12
  *
@@ -4,5 +4,4 @@
4
4
  * Simple barrel export for HITL components.
5
5
  */
6
6
  export { HITLManager } from "./hitlManager.js";
7
- export type { HITLConfig, HITLRule, ConfirmationRequest, ConfirmationResult, ConfirmationRequestEvent, ConfirmationResponseEvent, ConfirmationTimeoutEvent, HITLStatistics, HITLAuditLog, } from "./types.js";
8
7
  export { HITLError, HITLUserRejectedError, HITLTimeoutError, HITLConfigurationError, } from "./hitlErrors.js";
package/dist/index.d.ts CHANGED
@@ -8,20 +8,21 @@
8
8
  */
9
9
  import { AIProviderFactory } from "./core/factory.js";
10
10
  export { AIProviderFactory };
11
- export type { AIProvider, AIProviderName, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
11
+ export type { AIProvider, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
12
12
  export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
13
13
  export type { ToolContext } from "./sdk/toolRegistration.js";
14
14
  export { validateTool } from "./sdk/toolRegistration.js";
15
15
  export type { ToolResult, ToolDefinition } from "./types/tools.js";
16
- export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
16
+ export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
17
+ export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
17
18
  export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
18
19
  export { dynamicModelProvider } from "./core/dynamicModels.js";
19
20
  export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
20
21
  import { NeuroLink } from "./neurolink.js";
21
22
  export { NeuroLink };
22
- export type { ProviderStatus, MCPStatus } from "./neurolink.js";
23
23
  export type { MCPServerInfo } from "./types/mcpTypes.js";
24
24
  export type { ObservabilityConfig, LangfuseConfig, OpenTelemetryConfig, } from "./types/observability.js";
25
+ export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
25
26
  import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus } from "./services/server/ai/observability/instrumentation.js";
26
27
  export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
27
28
  export type { NeuroLinkMiddleware, MiddlewareContext, MiddlewareFactoryOptions, MiddlewarePreset, MiddlewareConfig, } from "./types/middlewareTypes.js";
@@ -83,7 +84,9 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
83
84
  * ```
84
85
  */
85
86
  export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
86
- export type { McpMetadata, ExecutionContext, DiscoveredMcp, ToolInfo, ToolExecutionResult, LogLevel, } from "./mcp/index.js";
87
+ export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
88
+ export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
89
+ export type { LogLevel } from "./utils/logger.js";
87
90
  export declare function initializeTelemetry(): Promise<boolean>;
88
91
  export declare function getTelemetryStatus(): Promise<{
89
92
  enabled: boolean;
package/dist/index.js CHANGED
@@ -11,7 +11,8 @@ import { AIProviderFactory } from "./core/factory.js";
11
11
  export { AIProviderFactory };
12
12
  export { validateTool } from "./sdk/toolRegistration.js";
13
13
  // Model enums
14
- export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
14
+ export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
15
+ export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
15
16
  // Utility exports
16
17
  export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
17
18
  // Dynamic Models exports
@@ -19,6 +20,7 @@ export { dynamicModelProvider } from "./core/dynamicModels.js";
19
20
  // Main NeuroLink wrapper class and diagnostic types
20
21
  import { NeuroLink } from "./neurolink.js";
21
22
  export { NeuroLink };
23
+ export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
22
24
  import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, } from "./services/server/ai/observability/instrumentation.js";
23
25
  import { initializeTelemetry as init, getTelemetryStatus as getStatus, } from "./telemetry/index.js";
24
26
  export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Supported AI Provider Names
3
+ */
4
+ export declare enum AIProviderName {
5
+ BEDROCK = "bedrock",
6
+ OPENAI = "openai",
7
+ OPENAI_COMPATIBLE = "openai-compatible",
8
+ VERTEX = "vertex",
9
+ ANTHROPIC = "anthropic",
10
+ AZURE = "azure",
11
+ GOOGLE_AI = "google-ai",
12
+ HUGGINGFACE = "huggingface",
13
+ OLLAMA = "ollama",
14
+ MISTRAL = "mistral",
15
+ LITELLM = "litellm",
16
+ SAGEMAKER = "sagemaker",
17
+ AUTO = "auto"
18
+ }
19
+ /**
20
+ * Supported Models for Amazon Bedrock
21
+ */
22
+ export declare enum BedrockModels {
23
+ CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
24
+ CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
25
+ CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
26
+ CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
27
+ }
28
+ /**
29
+ * Supported Models for OpenAI
30
+ */
31
+ export declare enum OpenAIModels {
32
+ GPT_4 = "gpt-4",
33
+ GPT_4_TURBO = "gpt-4-turbo",
34
+ GPT_4O = "gpt-4o",
35
+ GPT_4O_MINI = "gpt-4o-mini",
36
+ GPT_3_5_TURBO = "gpt-3.5-turbo",
37
+ O1_PREVIEW = "o1-preview",
38
+ O1_MINI = "o1-mini"
39
+ }
40
+ /**
41
+ * Supported Models for Google Vertex AI
42
+ */
43
+ export declare enum VertexModels {
44
+ CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
45
+ CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
46
+ CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
47
+ CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
48
+ CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
49
+ CLAUDE_3_OPUS = "claude-3-opus-20240229",
50
+ CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
51
+ GEMINI_2_5_PRO = "gemini-2.5-pro",
52
+ GEMINI_2_5_FLASH = "gemini-2.5-flash",
53
+ GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
54
+ GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
55
+ GEMINI_1_5_PRO = "gemini-1.5-pro",
56
+ GEMINI_1_5_FLASH = "gemini-1.5-flash"
57
+ }
58
+ /**
59
+ * Supported Models for Google AI Studio
60
+ */
61
+ export declare enum GoogleAIModels {
62
+ GEMINI_2_5_PRO = "gemini-2.5-pro",
63
+ GEMINI_2_5_FLASH = "gemini-2.5-flash",
64
+ GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
65
+ GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
66
+ GEMINI_1_5_PRO = "gemini-1.5-pro",
67
+ GEMINI_1_5_FLASH = "gemini-1.5-flash",
68
+ GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
69
+ }
70
+ /**
71
+ * Supported Models for Anthropic (Direct API)
72
+ */
73
+ export declare enum AnthropicModels {
74
+ CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
75
+ CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
76
+ CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
77
+ CLAUDE_3_OPUS = "claude-3-opus-20240229",
78
+ CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
79
+ }
80
+ /**
81
+ * API Versions for various providers
82
+ */
83
+ export declare enum APIVersions {
84
+ AZURE_LATEST = "2025-04-01-preview",
85
+ AZURE_STABLE = "2024-10-21",
86
+ AZURE_LEGACY = "2023-12-01-preview",
87
+ OPENAI_CURRENT = "v1",
88
+ OPENAI_BETA = "v1-beta",
89
+ GOOGLE_AI_CURRENT = "v1",
90
+ GOOGLE_AI_BETA = "v1beta",
91
+ ANTHROPIC_CURRENT = "2023-06-01"
92
+ }
93
+ export declare enum ErrorCategory {
94
+ VALIDATION = "validation",
95
+ TIMEOUT = "timeout",
96
+ NETWORK = "network",
97
+ RESOURCE = "resource",
98
+ PERMISSION = "permission",
99
+ CONFIGURATION = "configuration",
100
+ EXECUTION = "execution",
101
+ SYSTEM = "system"
102
+ }
103
+ export declare enum ErrorSeverity {
104
+ LOW = "low",
105
+ MEDIUM = "medium",
106
+ HIGH = "high",
107
+ CRITICAL = "critical"
108
+ }
@@ -0,0 +1,139 @@
1
+ // ============================================================================
2
+ // ENUMS
3
+ // ============================================================================
4
+ /**
5
+ * Supported AI Provider Names
6
+ */
7
+ export var AIProviderName;
8
+ (function (AIProviderName) {
9
+ AIProviderName["BEDROCK"] = "bedrock";
10
+ AIProviderName["OPENAI"] = "openai";
11
+ AIProviderName["OPENAI_COMPATIBLE"] = "openai-compatible";
12
+ AIProviderName["VERTEX"] = "vertex";
13
+ AIProviderName["ANTHROPIC"] = "anthropic";
14
+ AIProviderName["AZURE"] = "azure";
15
+ AIProviderName["GOOGLE_AI"] = "google-ai";
16
+ AIProviderName["HUGGINGFACE"] = "huggingface";
17
+ AIProviderName["OLLAMA"] = "ollama";
18
+ AIProviderName["MISTRAL"] = "mistral";
19
+ AIProviderName["LITELLM"] = "litellm";
20
+ AIProviderName["SAGEMAKER"] = "sagemaker";
21
+ AIProviderName["AUTO"] = "auto";
22
+ })(AIProviderName || (AIProviderName = {}));
23
+ /**
24
+ * Supported Models for Amazon Bedrock
25
+ */
26
+ export var BedrockModels;
27
+ (function (BedrockModels) {
28
+ BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
29
+ BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
30
+ BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
31
+ BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
32
+ })(BedrockModels || (BedrockModels = {}));
33
+ /**
34
+ * Supported Models for OpenAI
35
+ */
36
+ export var OpenAIModels;
37
+ (function (OpenAIModels) {
38
+ OpenAIModels["GPT_4"] = "gpt-4";
39
+ OpenAIModels["GPT_4_TURBO"] = "gpt-4-turbo";
40
+ OpenAIModels["GPT_4O"] = "gpt-4o";
41
+ OpenAIModels["GPT_4O_MINI"] = "gpt-4o-mini";
42
+ OpenAIModels["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
43
+ OpenAIModels["O1_PREVIEW"] = "o1-preview";
44
+ OpenAIModels["O1_MINI"] = "o1-mini";
45
+ })(OpenAIModels || (OpenAIModels = {}));
46
+ /**
47
+ * Supported Models for Google Vertex AI
48
+ */
49
+ export var VertexModels;
50
+ (function (VertexModels) {
51
+ // Claude 4 Series (Latest - May 2025)
52
+ VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
53
+ VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
54
+ // Claude 3.5 Series (Still supported)
55
+ VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
56
+ VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
57
+ // Claude 3 Series (Legacy support)
58
+ VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
59
+ VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
60
+ VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
61
+ // Gemini 2.5 Series (Latest - 2025)
62
+ VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
63
+ VertexModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
64
+ VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
65
+ // Gemini 2.0 Series
66
+ VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
67
+ // Gemini 1.5 Series (Legacy support)
68
+ VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
69
+ VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
70
+ })(VertexModels || (VertexModels = {}));
71
+ /**
72
+ * Supported Models for Google AI Studio
73
+ */
74
+ export var GoogleAIModels;
75
+ (function (GoogleAIModels) {
76
+ // Gemini 2.5 Series (Latest - 2025)
77
+ GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
78
+ GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
79
+ GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
80
+ // Gemini 2.0 Series
81
+ GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
82
+ // Gemini 1.5 Series (Legacy support)
83
+ GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
84
+ GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
85
+ GoogleAIModels["GEMINI_1_5_FLASH_LITE"] = "gemini-1.5-flash-lite";
86
+ })(GoogleAIModels || (GoogleAIModels = {}));
87
+ /**
88
+ * Supported Models for Anthropic (Direct API)
89
+ */
90
+ export var AnthropicModels;
91
+ (function (AnthropicModels) {
92
+ // Claude 3.5 Series (Latest)
93
+ AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
94
+ AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
95
+ // Claude 3 Series (Legacy support)
96
+ AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
97
+ AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
98
+ AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
99
+ })(AnthropicModels || (AnthropicModels = {}));
100
+ /**
101
+ * API Versions for various providers
102
+ */
103
+ export var APIVersions;
104
+ (function (APIVersions) {
105
+ // Azure OpenAI API versions
106
+ APIVersions["AZURE_LATEST"] = "2025-04-01-preview";
107
+ APIVersions["AZURE_STABLE"] = "2024-10-21";
108
+ APIVersions["AZURE_LEGACY"] = "2023-12-01-preview";
109
+ // OpenAI API versions
110
+ APIVersions["OPENAI_CURRENT"] = "v1";
111
+ APIVersions["OPENAI_BETA"] = "v1-beta";
112
+ // Google AI API versions
113
+ APIVersions["GOOGLE_AI_CURRENT"] = "v1";
114
+ APIVersions["GOOGLE_AI_BETA"] = "v1beta";
115
+ // Anthropic API versions
116
+ APIVersions["ANTHROPIC_CURRENT"] = "2023-06-01";
117
+ // Other provider versions can be added here
118
+ })(APIVersions || (APIVersions = {}));
119
+ // Error categories for proper handling
120
+ export var ErrorCategory;
121
+ (function (ErrorCategory) {
122
+ ErrorCategory["VALIDATION"] = "validation";
123
+ ErrorCategory["TIMEOUT"] = "timeout";
124
+ ErrorCategory["NETWORK"] = "network";
125
+ ErrorCategory["RESOURCE"] = "resource";
126
+ ErrorCategory["PERMISSION"] = "permission";
127
+ ErrorCategory["CONFIGURATION"] = "configuration";
128
+ ErrorCategory["EXECUTION"] = "execution";
129
+ ErrorCategory["SYSTEM"] = "system";
130
+ })(ErrorCategory || (ErrorCategory = {}));
131
+ // Error severity levels
132
+ export var ErrorSeverity;
133
+ (function (ErrorSeverity) {
134
+ ErrorSeverity["LOW"] = "low";
135
+ ErrorSeverity["MEDIUM"] = "medium";
136
+ ErrorSeverity["HIGH"] = "high";
137
+ ErrorSeverity["CRITICAL"] = "critical";
138
+ })(ErrorSeverity || (ErrorSeverity = {}));
139
+ //# sourceMappingURL=enums.js.map
@@ -1,6 +1,7 @@
1
1
  import type { ValidationSchema } from "../types/typeAliases.js";
2
2
  import type { Tool, LanguageModelV1 } from "ai";
3
- import type { AIProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, AnalyticsData, AIProviderName } from "../types/index.js";
3
+ import type { AIProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, AnalyticsData } from "../types/index.js";
4
+ import { AIProviderName } from "../constants/enums.js";
4
5
  import type { EvaluationData } from "../index.js";
5
6
  import type { MiddlewareFactoryOptions } from "../types/middlewareTypes.js";
6
7
  import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { generateText, tool as createAISDKTool, jsonSchema } from "ai";
3
+ import { AIProviderName } from "../constants/enums.js";
3
4
  import { MiddlewareFactory } from "../middleware/factory.js";
4
5
  import { logger } from "../utils/logger.js";
5
6
  import { DEFAULT_MAX_STEPS, STEP_LIMITS } from "../core/constants.js";
@@ -1,4 +1,5 @@
1
- import type { AIProvider, AIProviderName, SupportedModelName } from "../types/index.js";
1
+ import type { AIProvider, SupportedModelName } from "../types/index.js";
2
+ import { AIProviderName } from "../constants/enums.js";
2
3
  import type { UnknownRecord } from "../types/common.js";
3
4
  import type { ProviderPairResult } from "../types/typeAliases.js";
4
5
  /**
@@ -5,6 +5,7 @@ import { ProviderRegistry } from "../factories/providerRegistry.js";
5
5
  import { getBestProvider } from "../utils/providerUtils.js";
6
6
  import { logger } from "../utils/logger.js";
7
7
  import { dynamicModelProvider } from "./dynamicModels.js";
8
+ import { AIProviderName } from "../constants/enums.js";
8
9
  const componentIdentifier = "aiProviderFactory";
9
10
  /**
10
11
  * Factory for creating AI provider instances with centralized configuration
@@ -1,5 +1,6 @@
1
- import type { AIProvider, AIProviderName } from "../types/index.js";
1
+ import type { AIProvider } from "../types/index.js";
2
2
  import type { UnknownRecord } from "../types/common.js";
3
+ import { AIProviderName } from "../constants/enums.js";
3
4
  /**
4
5
  * Provider constructor interface - supports both sync constructors and async factory functions
5
6
  */
@@ -1,4 +1,5 @@
1
1
  import { logger } from "../utils/logger.js";
2
+ import { AIProviderName } from "../constants/enums.js";
2
3
  /**
3
4
  * True Factory Pattern implementation for AI Providers
4
5
  * Uses registration-based approach to eliminate switch statements
@@ -1,13 +1,4 @@
1
- /**
2
- * Configuration options for the provider registry
3
- */
4
- export interface ProviderRegistryOptions {
5
- /**
6
- * Enable loading of manual MCP configurations from .mcp-config.json
7
- * Should only be true for CLI mode, false for SDK mode
8
- */
9
- enableManualMCP?: boolean;
10
- }
1
+ import type { ProviderRegistryOptions } from "../types/index.js";
11
2
  /**
12
3
  * Provider Registry - registers all providers with the factory
13
4
  * This is where we migrate providers one by one to the new pattern
@@ -1,9 +1,6 @@
1
1
  import { ProviderFactory } from "./providerFactory.js";
2
- // Lazy loading all providers to avoid circular dependencies
3
- // Removed all static imports - providers loaded dynamically when needed
4
- // This breaks the circular dependency chain completely
5
- import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../types/index.js";
6
2
  import { logger } from "../utils/logger.js";
3
+ import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../constants/enums.js";
7
4
  /**
8
5
  * Provider Registry - registers all providers with the factory
9
6
  * This is where we migrate providers one by one to the new pattern
@@ -6,7 +6,7 @@
6
6
  * for enterprise-grade AI safety.
7
7
  */
8
8
  import { EventEmitter } from "events";
9
- import type { HITLConfig, ConfirmationResult, HITLStatistics } from "./types.js";
9
+ import type { HITLConfig, ConfirmationResult, HITLStatistics } from "../types/hitlTypes.js";
10
10
  /**
11
11
  * HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
12
12
  *
@@ -4,5 +4,4 @@
4
4
  * Simple barrel export for HITL components.
5
5
  */
6
6
  export { HITLManager } from "./hitlManager.js";
7
- export type { HITLConfig, HITLRule, ConfirmationRequest, ConfirmationResult, ConfirmationRequestEvent, ConfirmationResponseEvent, ConfirmationTimeoutEvent, HITLStatistics, HITLAuditLog, } from "./types.js";
8
7
  export { HITLError, HITLUserRejectedError, HITLTimeoutError, HITLConfigurationError, } from "./hitlErrors.js";
@@ -8,20 +8,21 @@
8
8
  */
9
9
  import { AIProviderFactory } from "./core/factory.js";
10
10
  export { AIProviderFactory };
11
- export type { AIProvider, AIProviderName, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
11
+ export type { AIProvider, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
12
12
  export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
13
13
  export type { ToolContext } from "./sdk/toolRegistration.js";
14
14
  export { validateTool } from "./sdk/toolRegistration.js";
15
15
  export type { ToolResult, ToolDefinition } from "./types/tools.js";
16
- export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
16
+ export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
17
+ export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
17
18
  export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
18
19
  export { dynamicModelProvider } from "./core/dynamicModels.js";
19
20
  export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
20
21
  import { NeuroLink } from "./neurolink.js";
21
22
  export { NeuroLink };
22
- export type { ProviderStatus, MCPStatus } from "./neurolink.js";
23
23
  export type { MCPServerInfo } from "./types/mcpTypes.js";
24
24
  export type { ObservabilityConfig, LangfuseConfig, OpenTelemetryConfig, } from "./types/observability.js";
25
+ export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
25
26
  import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus } from "./services/server/ai/observability/instrumentation.js";
26
27
  export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
27
28
  export type { NeuroLinkMiddleware, MiddlewareContext, MiddlewareFactoryOptions, MiddlewarePreset, MiddlewareConfig, } from "./types/middlewareTypes.js";
@@ -83,7 +84,9 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
83
84
  * ```
84
85
  */
85
86
  export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
86
- export type { McpMetadata, ExecutionContext, DiscoveredMcp, ToolInfo, ToolExecutionResult, LogLevel, } from "./mcp/index.js";
87
+ export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
88
+ export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
89
+ export type { LogLevel } from "./utils/logger.js";
87
90
  export declare function initializeTelemetry(): Promise<boolean>;
88
91
  export declare function getTelemetryStatus(): Promise<{
89
92
  enabled: boolean;
package/dist/lib/index.js CHANGED
@@ -11,7 +11,8 @@ import { AIProviderFactory } from "./core/factory.js";
11
11
  export { AIProviderFactory };
12
12
  export { validateTool } from "./sdk/toolRegistration.js";
13
13
  // Model enums
14
- export { BedrockModels, OpenAIModels, VertexModels, DEFAULT_PROVIDER_CONFIGS, } from "./types/index.js";
14
+ export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
15
+ export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
15
16
  // Utility exports
16
17
  export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
17
18
  // Dynamic Models exports
@@ -19,6 +20,7 @@ export { dynamicModelProvider } from "./core/dynamicModels.js";
19
20
  // Main NeuroLink wrapper class and diagnostic types
20
21
  import { NeuroLink } from "./neurolink.js";
21
22
  export { NeuroLink };
23
+ export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
22
24
  import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, } from "./services/server/ai/observability/instrumentation.js";
23
25
  import { initializeTelemetry as init, getTelemetryStatus as getStatus, } from "./telemetry/index.js";
24
26
  export { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, };
@@ -3,11 +3,8 @@
3
3
  * Universal AI Development Platform with Extensible Plugin Architecture
4
4
  * Implementation based on research blueprint
5
5
  */
6
- export type { McpMetadata, DiscoveredMcp } from "../types/mcpTypes.js";
7
- export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "../types/tools.js";
8
- export { mcpLogger } from "../utils/logger.js";
9
- export type { LogLevel } from "../utils/logger.js";
10
6
  import type { McpMetadata } from "../types/mcpTypes.js";
7
+ export { mcpLogger } from "../utils/logger.js";
11
8
  /**
12
9
  * Initialize the MCP ecosystem - simplified
13
10
  */
@@ -1,9 +1,3 @@
1
- /**
2
- * MCP Ecosystem - Main Export
3
- * Universal AI Development Platform with Extensible Plugin Architecture
4
- * Implementation based on research blueprint
5
- */
6
- // Core functionality exports
7
1
  export { mcpLogger } from "../utils/logger.js";
8
2
  /**
9
3
  * Initialize the MCP ecosystem - simplified
@@ -3,41 +3,7 @@
3
3
  * Simple initialization logic for mem0ai/oss integration
4
4
  */
5
5
  import type { MemoryConfig } from "mem0ai/oss";
6
- /**
7
- * Interface for mem0 Memory instance methods based on actual mem0ai/oss API
8
- */
9
- export interface Mem0Memory {
10
- search(query: string, config: {
11
- userId?: string;
12
- limit?: number;
13
- }): Promise<{
14
- results: Array<{
15
- memory: string;
16
- id: string;
17
- }>;
18
- }>;
19
- add(messages: string, config: {
20
- userId?: string;
21
- metadata?: Record<string, unknown>;
22
- }): Promise<{
23
- results: Array<{
24
- id: string;
25
- memory: string;
26
- }>;
27
- }>;
28
- get(memoryId: string): Promise<{
29
- id: string;
30
- memory: string;
31
- } | null>;
32
- update(memoryId: string, data: string): Promise<{
33
- message: string;
34
- }>;
35
- delete(memoryId: string): Promise<{
36
- message: string;
37
- }>;
38
- history(memoryId: string): Promise<unknown[]>;
39
- reset(): Promise<void>;
40
- }
6
+ import type { Mem0Memory } from "../types/utilities.js";
41
7
  /**
42
8
  * Initialize mem0 memory instance with configuration
43
9
  */
@@ -1,6 +1,5 @@
1
1
  import type { NeuroLinkMiddleware } from "../../types/middlewareTypes.js";
2
2
  import type { GuardrailsMiddlewareConfig } from "../../types/guardrails.js";
3
- export type { GuardrailsMiddlewareConfig } from "../../types/guardrails.js";
4
3
  /**
5
4
  * Create Guardrails AI middleware for content filtering and policy enforcement
6
5
  * @param config Configuration for the guardrails middleware
@@ -1,4 +1,4 @@
1
- import type { PrecallEvaluationResult, PrecallEvaluationConfig, EvaluationActionResult, BadWordsConfig } from "../../types/guardrails.js";
1
+ import type { BadWordsConfig, ContentFilteringResult, EvaluationActionResult, PrecallEvaluationConfig, PrecallEvaluationResult } from "../../types/guardrails.js";
2
2
  import type { LanguageModelV1CallOptions } from "ai";
3
3
  export declare const DEFAULT_EVALUATION_PROMPT = "\nEvaluate the following user input for safety and appropriateness. Respond ONLY with valid JSON:\n\n{\n \"overall\": \"safe|unsafe|suspicious|inappropriate\",\n \"safetyScore\": <1-10>,\n \"appropriatenessScore\": <1-10>,\n \"confidenceLevel\": <1-10>,\n \"issues\": [\n {\n \"category\": \"explicit_content|hate_speech|violence|personal_info|spam|other\",\n \"severity\": \"low|medium|high|critical\",\n \"description\": \"Brief description\"\n }\n ],\n \"suggestedAction\": \"allow|block|sanitize|warn\",\n \"reasoning\": \"Brief explanation\"\n}\n\nUser Input: \"{USER_INPUT}\"\n";
4
4
  /**
@@ -40,19 +40,6 @@ export declare function createBlockedResponse(): {
40
40
  };
41
41
  };
42
42
  export declare function createBlockedStream(): ReadableStream<any>;
43
- /**
44
- * Result from content filtering operation
45
- */
46
- export interface ContentFilteringResult {
47
- filteredText: string;
48
- hasChanges: boolean;
49
- appliedFilters: string[];
50
- filteringStats: {
51
- regexPatternsApplied: number;
52
- stringFiltersApplied: number;
53
- totalMatches: number;
54
- };
55
- }
56
43
  /**
57
44
  * Apply content filtering using bad words configuration
58
45
  * Handles both regex patterns and string lists with proper priority