@juspay/neurolink 7.29.2 → 7.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cli/commands/config.d.ts +83 -83
- package/dist/cli/commands/mcp.js +39 -9
- package/dist/cli/commands/models.js +25 -21
- package/dist/cli/commands/ollama.js +2 -2
- package/dist/cli/factories/commandFactory.d.ts +8 -0
- package/dist/cli/factories/commandFactory.js +65 -65
- package/dist/cli/factories/ollamaCommandFactory.js +3 -1
- package/dist/cli/factories/sagemakerCommandFactory.js +3 -2
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +11 -11
- package/dist/cli/utils/envManager.js +5 -5
- package/dist/cli/utils/ollamaUtils.d.ts +12 -0
- package/dist/cli/utils/ollamaUtils.js +58 -42
- package/dist/config/configManager.js +5 -2
- package/dist/config/conversationMemoryConfig.js +5 -0
- package/dist/core/analytics.d.ts +2 -24
- package/dist/core/analytics.js +12 -17
- package/dist/core/baseProvider.d.ts +30 -1
- package/dist/core/baseProvider.js +180 -198
- package/dist/core/conversationMemoryManager.d.ts +9 -15
- package/dist/core/conversationMemoryManager.js +98 -57
- package/dist/core/dynamicModels.d.ts +4 -4
- package/dist/core/dynamicModels.js +7 -7
- package/dist/core/evaluation.d.ts +9 -9
- package/dist/core/evaluation.js +117 -65
- package/dist/core/evaluationProviders.d.ts +18 -2
- package/dist/core/evaluationProviders.js +15 -13
- package/dist/core/modelConfiguration.d.ts +63 -0
- package/dist/core/modelConfiguration.js +354 -290
- package/dist/core/streamAnalytics.d.ts +10 -5
- package/dist/core/streamAnalytics.js +10 -10
- package/dist/core/types.d.ts +22 -110
- package/dist/core/types.js +13 -0
- package/dist/factories/providerFactory.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/lib/config/configManager.js +5 -2
- package/dist/lib/config/conversationMemoryConfig.js +5 -0
- package/dist/lib/core/analytics.d.ts +2 -24
- package/dist/lib/core/analytics.js +12 -17
- package/dist/lib/core/baseProvider.d.ts +30 -1
- package/dist/lib/core/baseProvider.js +180 -198
- package/dist/lib/core/conversationMemoryManager.d.ts +9 -15
- package/dist/lib/core/conversationMemoryManager.js +98 -57
- package/dist/lib/core/dynamicModels.js +7 -7
- package/dist/lib/core/evaluation.d.ts +9 -9
- package/dist/lib/core/evaluation.js +117 -65
- package/dist/lib/core/evaluationProviders.d.ts +18 -2
- package/dist/lib/core/evaluationProviders.js +15 -13
- package/dist/lib/core/modelConfiguration.d.ts +63 -0
- package/dist/lib/core/modelConfiguration.js +354 -290
- package/dist/lib/core/streamAnalytics.d.ts +10 -5
- package/dist/lib/core/streamAnalytics.js +10 -10
- package/dist/lib/core/types.d.ts +22 -110
- package/dist/lib/core/types.js +13 -0
- package/dist/lib/factories/providerFactory.js +1 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/mcp/externalServerManager.js +15 -6
- package/dist/lib/mcp/factory.js +1 -1
- package/dist/lib/mcp/index.d.ts +1 -1
- package/dist/lib/mcp/index.js +1 -1
- package/dist/lib/mcp/mcpCircuitBreaker.js +5 -1
- package/dist/lib/mcp/mcpClientFactory.js +3 -0
- package/dist/lib/mcp/registry.d.ts +3 -3
- package/dist/lib/mcp/registry.js +3 -3
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +5 -5
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +6 -6
- package/dist/lib/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/lib/mcp/toolDiscoveryService.js +8 -2
- package/dist/lib/mcp/toolRegistry.js +4 -4
- package/dist/lib/middleware/builtin/analytics.js +4 -4
- package/dist/lib/middleware/builtin/guardrails.js +2 -2
- package/dist/lib/middleware/registry.js +11 -2
- package/dist/lib/models/modelRegistry.d.ts +1 -1
- package/dist/lib/models/modelRegistry.js +3 -3
- package/dist/lib/models/modelResolver.d.ts +1 -1
- package/dist/lib/models/modelResolver.js +2 -2
- package/dist/lib/neurolink.d.ts +116 -9
- package/dist/lib/neurolink.js +718 -956
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
- package/dist/lib/providers/amazonSagemaker.js +12 -3
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +7 -6
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +4 -3
- package/dist/lib/providers/azureOpenai.d.ts +1 -1
- package/dist/lib/providers/azureOpenai.js +1 -1
- package/dist/lib/providers/googleAiStudio.d.ts +1 -1
- package/dist/lib/providers/googleAiStudio.js +2 -2
- package/dist/lib/providers/googleVertex.d.ts +40 -0
- package/dist/lib/providers/googleVertex.js +330 -274
- package/dist/lib/providers/huggingFace.js +1 -1
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/mistral.js +2 -2
- package/dist/lib/providers/ollama.d.ts +4 -0
- package/dist/lib/providers/ollama.js +38 -18
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +2 -2
- package/dist/lib/providers/sagemaker/adaptive-semaphore.js +7 -4
- package/dist/lib/providers/sagemaker/client.js +13 -3
- package/dist/lib/providers/sagemaker/config.js +5 -1
- package/dist/lib/providers/sagemaker/detection.js +19 -9
- package/dist/lib/providers/sagemaker/errors.d.ts +8 -1
- package/dist/lib/providers/sagemaker/errors.js +103 -20
- package/dist/lib/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/lib/providers/sagemaker/language-model.js +4 -4
- package/dist/lib/providers/sagemaker/parsers.js +14 -6
- package/dist/lib/providers/sagemaker/streaming.js +14 -3
- package/dist/lib/providers/sagemaker/types.d.ts +1 -1
- package/dist/lib/proxy/awsProxyIntegration.js +1 -1
- package/dist/lib/sdk/toolRegistration.d.ts +1 -1
- package/dist/lib/types/cli.d.ts +80 -8
- package/dist/lib/types/contextTypes.js +2 -2
- package/dist/lib/types/conversationTypes.d.ts +10 -0
- package/dist/lib/types/generateTypes.d.ts +2 -5
- package/dist/lib/types/providers.d.ts +81 -19
- package/dist/lib/types/providers.js +6 -6
- package/dist/lib/types/streamTypes.d.ts +4 -6
- package/dist/lib/types/typeAliases.d.ts +1 -1
- package/dist/lib/utils/analyticsUtils.d.ts +33 -0
- package/dist/lib/utils/analyticsUtils.js +76 -0
- package/dist/lib/utils/conversationMemoryUtils.d.ts +1 -2
- package/dist/lib/utils/conversationMemoryUtils.js +6 -7
- package/dist/lib/utils/errorHandling.js +4 -1
- package/dist/lib/utils/evaluationUtils.d.ts +27 -0
- package/dist/lib/utils/evaluationUtils.js +131 -0
- package/dist/lib/utils/optionsUtils.js +10 -1
- package/dist/lib/utils/performance.d.ts +1 -1
- package/dist/lib/utils/performance.js +15 -3
- package/dist/lib/utils/providerHealth.d.ts +48 -0
- package/dist/lib/utils/providerHealth.js +199 -254
- package/dist/lib/utils/providerUtils.js +2 -2
- package/dist/lib/utils/timeout.js +8 -3
- package/dist/mcp/externalServerManager.js +15 -6
- package/dist/mcp/factory.js +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/mcpCircuitBreaker.js +5 -1
- package/dist/mcp/mcpClientFactory.js +3 -0
- package/dist/mcp/registry.d.ts +3 -3
- package/dist/mcp/registry.js +3 -3
- package/dist/mcp/servers/aiProviders/aiAnalysisTools.js +5 -5
- package/dist/mcp/servers/aiProviders/aiWorkflowTools.js +6 -6
- package/dist/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/mcp/toolDiscoveryService.js +8 -2
- package/dist/mcp/toolRegistry.js +4 -4
- package/dist/middleware/builtin/analytics.js +4 -4
- package/dist/middleware/builtin/guardrails.js +2 -2
- package/dist/middleware/registry.js +11 -2
- package/dist/models/modelRegistry.d.ts +1 -1
- package/dist/models/modelRegistry.js +3 -3
- package/dist/models/modelResolver.d.ts +1 -1
- package/dist/models/modelResolver.js +2 -2
- package/dist/neurolink.d.ts +116 -9
- package/dist/neurolink.js +718 -956
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/amazonSagemaker.js +12 -3
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +7 -6
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +4 -3
- package/dist/providers/azureOpenai.d.ts +1 -1
- package/dist/providers/azureOpenai.js +1 -1
- package/dist/providers/googleAiStudio.d.ts +1 -1
- package/dist/providers/googleAiStudio.js +2 -2
- package/dist/providers/googleVertex.d.ts +40 -0
- package/dist/providers/googleVertex.js +330 -274
- package/dist/providers/huggingFace.js +1 -1
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/mistral.js +2 -2
- package/dist/providers/ollama.d.ts +4 -0
- package/dist/providers/ollama.js +38 -18
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +2 -2
- package/dist/providers/sagemaker/adaptive-semaphore.js +7 -4
- package/dist/providers/sagemaker/client.js +13 -3
- package/dist/providers/sagemaker/config.js +5 -1
- package/dist/providers/sagemaker/detection.js +19 -9
- package/dist/providers/sagemaker/errors.d.ts +8 -1
- package/dist/providers/sagemaker/errors.js +103 -20
- package/dist/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/providers/sagemaker/language-model.js +4 -4
- package/dist/providers/sagemaker/parsers.js +14 -6
- package/dist/providers/sagemaker/streaming.js +14 -3
- package/dist/providers/sagemaker/types.d.ts +1 -1
- package/dist/proxy/awsProxyIntegration.js +1 -1
- package/dist/sdk/toolRegistration.d.ts +1 -1
- package/dist/types/cli.d.ts +80 -8
- package/dist/types/contextTypes.js +2 -2
- package/dist/types/conversationTypes.d.ts +10 -0
- package/dist/types/generateTypes.d.ts +2 -5
- package/dist/types/providers.d.ts +81 -19
- package/dist/types/providers.js +6 -6
- package/dist/types/streamTypes.d.ts +4 -6
- package/dist/types/typeAliases.d.ts +1 -1
- package/dist/utils/analyticsUtils.d.ts +33 -0
- package/dist/utils/analyticsUtils.js +76 -0
- package/dist/utils/conversationMemoryUtils.d.ts +1 -2
- package/dist/utils/conversationMemoryUtils.js +6 -7
- package/dist/utils/errorHandling.js +4 -1
- package/dist/utils/evaluationUtils.d.ts +27 -0
- package/dist/utils/evaluationUtils.js +131 -0
- package/dist/utils/optionsUtils.js +10 -1
- package/dist/utils/performance.d.ts +1 -1
- package/dist/utils/performance.js +15 -3
- package/dist/utils/providerHealth.d.ts +48 -0
- package/dist/utils/providerHealth.js +199 -254
- package/dist/utils/providerUtils.js +2 -2
- package/dist/utils/timeout.js +8 -3
- package/package.json +1 -1
- package/dist/context/ContextManager.d.ts +0 -28
- package/dist/context/ContextManager.js +0 -113
- package/dist/context/config.d.ts +0 -5
- package/dist/context/config.js +0 -42
- package/dist/context/types.d.ts +0 -20
- package/dist/context/types.js +0 -1
- package/dist/context/utils.d.ts +0 -7
- package/dist/context/utils.js +0 -8
- package/dist/lib/context/ContextManager.d.ts +0 -28
- package/dist/lib/context/ContextManager.js +0 -113
- package/dist/lib/context/config.d.ts +0 -5
- package/dist/lib/context/config.js +0 -42
- package/dist/lib/context/types.d.ts +0 -20
- package/dist/lib/context/types.js +0 -1
- package/dist/lib/context/utils.d.ts +0 -7
- package/dist/lib/context/utils.js +0 -8
|
@@ -135,9 +135,9 @@ export class MiddlewareRegistry {
|
|
|
135
135
|
/**
|
|
136
136
|
* Configure middleware with runtime configuration
|
|
137
137
|
*/
|
|
138
|
-
configureMiddleware(middleware, config, globalConfig,
|
|
138
|
+
configureMiddleware(middleware, config, globalConfig, _context) {
|
|
139
139
|
// Merge configurations: global < middleware config < runtime config
|
|
140
|
-
const
|
|
140
|
+
const _mergedConfig = {
|
|
141
141
|
...globalConfig,
|
|
142
142
|
...config?.config,
|
|
143
143
|
};
|
|
@@ -149,6 +149,9 @@ export class MiddlewareRegistry {
|
|
|
149
149
|
wrappedMiddleware.transformParams = async (args) => {
|
|
150
150
|
const startTime = Date.now();
|
|
151
151
|
try {
|
|
152
|
+
if (!middleware.transformParams) {
|
|
153
|
+
throw new Error("transformParams method is required");
|
|
154
|
+
}
|
|
152
155
|
const result = await middleware.transformParams(args);
|
|
153
156
|
this.recordExecution(middleware.metadata.id, startTime, true);
|
|
154
157
|
return result;
|
|
@@ -163,6 +166,9 @@ export class MiddlewareRegistry {
|
|
|
163
166
|
wrappedMiddleware.wrapGenerate = async (args) => {
|
|
164
167
|
const startTime = Date.now();
|
|
165
168
|
try {
|
|
169
|
+
if (!middleware.wrapGenerate) {
|
|
170
|
+
throw new Error("wrapGenerate method is required");
|
|
171
|
+
}
|
|
166
172
|
const result = await middleware.wrapGenerate(args);
|
|
167
173
|
this.recordExecution(middleware.metadata.id, startTime, true);
|
|
168
174
|
return result;
|
|
@@ -177,6 +183,9 @@ export class MiddlewareRegistry {
|
|
|
177
183
|
wrappedMiddleware.wrapStream = async (args) => {
|
|
178
184
|
const startTime = Date.now();
|
|
179
185
|
try {
|
|
186
|
+
if (!middleware.wrapStream) {
|
|
187
|
+
throw new Error("wrapStream method is required");
|
|
188
|
+
}
|
|
180
189
|
const result = await middleware.wrapStream(args);
|
|
181
190
|
this.recordExecution(middleware.metadata.id, startTime, true);
|
|
182
191
|
return result;
|
|
@@ -125,7 +125,7 @@ export declare function getAvailableProviders(): AIProviderName[];
|
|
|
125
125
|
/**
|
|
126
126
|
* Calculate estimated cost for a request
|
|
127
127
|
*/
|
|
128
|
-
export declare function calculateCost(model: ModelInfo,
|
|
128
|
+
export declare function calculateCost(model: ModelInfo, input: number, output: number): number;
|
|
129
129
|
/**
|
|
130
130
|
* Format model for display
|
|
131
131
|
*/
|
|
@@ -445,9 +445,9 @@ export function getAvailableProviders() {
|
|
|
445
445
|
/**
|
|
446
446
|
* Calculate estimated cost for a request
|
|
447
447
|
*/
|
|
448
|
-
export function calculateCost(model,
|
|
449
|
-
const inputCost = (
|
|
450
|
-
const outputCost = (
|
|
448
|
+
export function calculateCost(model, input, output) {
|
|
449
|
+
const inputCost = (input / 1000) * model.pricing.inputCostPer1K;
|
|
450
|
+
const outputCost = (output / 1000) * model.pricing.outputCostPer1K;
|
|
451
451
|
return inputCost + outputCost;
|
|
452
452
|
}
|
|
453
453
|
/**
|
|
@@ -76,7 +76,7 @@ export declare class ModelResolver {
|
|
|
76
76
|
/**
|
|
77
77
|
* Calculate cost comparison for models
|
|
78
78
|
*/
|
|
79
|
-
static calculateCostComparison(models: ModelInfo[],
|
|
79
|
+
static calculateCostComparison(models: ModelInfo[], input?: number, output?: number): Array<{
|
|
80
80
|
model: ModelInfo;
|
|
81
81
|
cost: number;
|
|
82
82
|
costPer1K: number;
|
|
@@ -160,11 +160,11 @@ export class ModelResolver {
|
|
|
160
160
|
/**
|
|
161
161
|
* Calculate cost comparison for models
|
|
162
162
|
*/
|
|
163
|
-
static calculateCostComparison(models,
|
|
163
|
+
static calculateCostComparison(models, input = 1000, output = 500) {
|
|
164
164
|
return models
|
|
165
165
|
.map((model) => ({
|
|
166
166
|
model,
|
|
167
|
-
cost: calculateCost(model,
|
|
167
|
+
cost: calculateCost(model, input, output),
|
|
168
168
|
costPer1K: model.pricing.inputCostPer1K + model.pricing.outputCostPer1K,
|
|
169
169
|
}))
|
|
170
170
|
.sort((a, b) => a.cost - b.cost);
|
package/dist/lib/neurolink.d.ts
CHANGED
|
@@ -39,11 +39,9 @@ export interface MCPStatus {
|
|
|
39
39
|
error?: string;
|
|
40
40
|
[key: string]: unknown;
|
|
41
41
|
}
|
|
42
|
-
import type { ContextManagerConfig } from "./context/types.js";
|
|
43
42
|
export declare class NeuroLink {
|
|
44
43
|
private mcpInitialized;
|
|
45
44
|
private emitter;
|
|
46
|
-
private contextManager;
|
|
47
45
|
private autoDiscoveredServerInfos;
|
|
48
46
|
private externalServerManager;
|
|
49
47
|
private toolCircuitBreakers;
|
|
@@ -90,11 +88,71 @@ export declare class NeuroLink {
|
|
|
90
88
|
constructor(config?: {
|
|
91
89
|
conversationMemory?: Partial<ConversationMemoryConfig>;
|
|
92
90
|
});
|
|
91
|
+
/**
|
|
92
|
+
* Log constructor start with comprehensive environment analysis
|
|
93
|
+
*/
|
|
94
|
+
private logConstructorStart;
|
|
95
|
+
/**
|
|
96
|
+
* Initialize provider registry with security settings
|
|
97
|
+
*/
|
|
98
|
+
private initializeProviderRegistry;
|
|
99
|
+
/**
|
|
100
|
+
* Initialize conversation memory if enabled
|
|
101
|
+
*/
|
|
102
|
+
private initializeConversationMemory;
|
|
103
|
+
/**
|
|
104
|
+
* Initialize external server manager with event handlers
|
|
105
|
+
*/
|
|
106
|
+
private initializeExternalServerManager;
|
|
107
|
+
/**
|
|
108
|
+
* Setup event handlers for external server manager
|
|
109
|
+
*/
|
|
110
|
+
private setupExternalServerEventHandlers;
|
|
111
|
+
/**
|
|
112
|
+
* Log constructor completion with final state summary
|
|
113
|
+
*/
|
|
114
|
+
private logConstructorComplete;
|
|
93
115
|
/**
|
|
94
116
|
* Initialize MCP registry with enhanced error handling and resource cleanup
|
|
95
117
|
* Uses isolated async context to prevent hanging
|
|
96
118
|
*/
|
|
97
119
|
private initializeMCP;
|
|
120
|
+
/**
|
|
121
|
+
* Log MCP initialization start
|
|
122
|
+
*/
|
|
123
|
+
private logMCPInitStart;
|
|
124
|
+
/**
|
|
125
|
+
* Log MCP already initialized
|
|
126
|
+
*/
|
|
127
|
+
private logMCPAlreadyInitialized;
|
|
128
|
+
/**
|
|
129
|
+
* Import performance manager with error handling
|
|
130
|
+
*/
|
|
131
|
+
private importPerformanceManager;
|
|
132
|
+
/**
|
|
133
|
+
* Perform main MCP initialization logic
|
|
134
|
+
*/
|
|
135
|
+
private performMCPInitialization;
|
|
136
|
+
/**
|
|
137
|
+
* Initialize tool registry with timeout protection
|
|
138
|
+
*/
|
|
139
|
+
private initializeToolRegistryInternal;
|
|
140
|
+
/**
|
|
141
|
+
* Initialize provider registry
|
|
142
|
+
*/
|
|
143
|
+
private initializeProviderRegistryInternal;
|
|
144
|
+
/**
|
|
145
|
+
* Register direct tools server
|
|
146
|
+
*/
|
|
147
|
+
private registerDirectToolsServerInternal;
|
|
148
|
+
/**
|
|
149
|
+
* Load MCP configuration from .mcp-config.json
|
|
150
|
+
*/
|
|
151
|
+
private loadMCPConfigurationInternal;
|
|
152
|
+
/**
|
|
153
|
+
* Log MCP initialization completion
|
|
154
|
+
*/
|
|
155
|
+
private logMCPInitComplete;
|
|
98
156
|
/**
|
|
99
157
|
* MAIN ENTRY POINT: Enhanced generate method with new function signature
|
|
100
158
|
* Replaces both generateText and legacy methods
|
|
@@ -107,13 +165,6 @@ export declare class NeuroLink {
|
|
|
107
165
|
* @returns The original prompt text as a string.
|
|
108
166
|
*/
|
|
109
167
|
private _extractOriginalPrompt;
|
|
110
|
-
/**
|
|
111
|
-
* Enables automatic context summarization for the NeuroLink instance.
|
|
112
|
-
* Once enabled, the instance will maintain conversation history and
|
|
113
|
-
* automatically summarize it when it exceeds token limits.
|
|
114
|
-
* @param config Optional configuration to override default summarization settings.
|
|
115
|
-
*/
|
|
116
|
-
enableContextSummarization(config?: Partial<ContextManagerConfig>): void;
|
|
117
168
|
/**
|
|
118
169
|
* Generate AI content using the best available provider with MCP tool integration.
|
|
119
170
|
* This is the primary method for text generation with full feature support.
|
|
@@ -179,6 +230,26 @@ export declare class NeuroLink {
|
|
|
179
230
|
* 5. Store conversation turn for future context
|
|
180
231
|
*/
|
|
181
232
|
private generateTextInternal;
|
|
233
|
+
/**
|
|
234
|
+
* Log generateTextInternal start with comprehensive analysis
|
|
235
|
+
*/
|
|
236
|
+
private logGenerateTextInternalStart;
|
|
237
|
+
/**
|
|
238
|
+
* Emit generation start events
|
|
239
|
+
*/
|
|
240
|
+
private emitGenerationStartEvents;
|
|
241
|
+
/**
|
|
242
|
+
* Initialize conversation memory for generation
|
|
243
|
+
*/
|
|
244
|
+
private initializeConversationMemoryForGeneration;
|
|
245
|
+
/**
|
|
246
|
+
* Attempt MCP generation with retry logic
|
|
247
|
+
*/
|
|
248
|
+
private attemptMCPGeneration;
|
|
249
|
+
/**
|
|
250
|
+
* Perform MCP generation with retry logic
|
|
251
|
+
*/
|
|
252
|
+
private performMCPGenerationRetries;
|
|
182
253
|
/**
|
|
183
254
|
* Try MCP-enhanced generation (no fallback recursion)
|
|
184
255
|
*/
|
|
@@ -257,6 +328,42 @@ export declare class NeuroLink {
|
|
|
257
328
|
* @throws {Error} When conversation memory operations fail (if enabled)
|
|
258
329
|
*/
|
|
259
330
|
stream(options: StreamOptions): Promise<StreamResult>;
|
|
331
|
+
/**
|
|
332
|
+
* Log stream entry point with comprehensive analysis
|
|
333
|
+
*/
|
|
334
|
+
private logStreamEntryPoint;
|
|
335
|
+
/**
|
|
336
|
+
* Log performance baseline
|
|
337
|
+
*/
|
|
338
|
+
private logPerformanceBaseline;
|
|
339
|
+
/**
|
|
340
|
+
* Validate stream input with comprehensive error reporting
|
|
341
|
+
*/
|
|
342
|
+
private validateStreamInput;
|
|
343
|
+
/**
|
|
344
|
+
* Emit stream start events
|
|
345
|
+
*/
|
|
346
|
+
private emitStreamStartEvents;
|
|
347
|
+
/**
|
|
348
|
+
* Create MCP stream
|
|
349
|
+
*/
|
|
350
|
+
private createMCPStream;
|
|
351
|
+
/**
|
|
352
|
+
* Process stream result
|
|
353
|
+
*/
|
|
354
|
+
private processStreamResult;
|
|
355
|
+
/**
|
|
356
|
+
* Emit stream end events
|
|
357
|
+
*/
|
|
358
|
+
private emitStreamEndEvents;
|
|
359
|
+
/**
|
|
360
|
+
* Create stream response
|
|
361
|
+
*/
|
|
362
|
+
private createStreamResponse;
|
|
363
|
+
/**
|
|
364
|
+
* Handle stream error with fallback
|
|
365
|
+
*/
|
|
366
|
+
private handleStreamError;
|
|
260
367
|
/**
|
|
261
368
|
* Get the EventEmitter instance to listen to NeuroLink events for real-time monitoring and debugging.
|
|
262
369
|
* This method provides access to the internal event system that emits events during AI generation,
|