@juspay/neurolink 7.53.3 → 7.53.5
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 +8 -0
- package/README.md +1 -0
- package/dist/cli/commands/config.d.ts +18 -18
- package/dist/cli/loop/optionsSchema.js +5 -0
- package/dist/core/baseProvider.js +19 -4
- package/dist/index.d.ts +1 -1
- package/dist/lib/agent/directTools.d.ts +3 -3
- package/dist/lib/core/baseProvider.js +19 -4
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/neurolink.js +2 -0
- package/dist/lib/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/lib/types/common.d.ts +5 -5
- package/dist/lib/types/generateTypes.d.ts +3 -0
- package/dist/lib/types/modelTypes.d.ts +31 -14
- package/dist/lib/types/tools.d.ts +16 -1
- package/dist/lib/types/utilities.d.ts +131 -0
- package/dist/lib/types/utilities.js +1 -1
- package/dist/lib/utils/errorHandling.d.ts +2 -28
- package/dist/lib/utils/errorHandling.js +1 -20
- package/dist/lib/utils/logger.d.ts +2 -23
- package/dist/lib/utils/modelRouter.d.ts +1 -17
- package/dist/lib/utils/optionsConversion.d.ts +0 -5
- package/dist/lib/utils/optionsUtils.d.ts +1 -70
- package/dist/lib/utils/parameterValidation.d.ts +9 -22
- package/dist/lib/utils/performance.d.ts +1 -13
- package/dist/lib/utils/promptRedaction.d.ts +1 -8
- package/dist/lib/utils/providerUtils.d.ts +2 -10
- package/dist/lib/utils/redis.d.ts +1 -1
- package/dist/lib/utils/redis.js +0 -1
- package/dist/lib/utils/retryHandler.d.ts +1 -8
- package/dist/neurolink.js +2 -0
- package/dist/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/types/common.d.ts +5 -5
- package/dist/types/generateTypes.d.ts +3 -0
- package/dist/types/modelTypes.d.ts +17 -0
- package/dist/types/tools.d.ts +16 -1
- package/dist/types/utilities.d.ts +131 -0
- package/dist/types/utilities.js +1 -1
- package/dist/utils/errorHandling.d.ts +2 -28
- package/dist/utils/errorHandling.js +1 -20
- package/dist/utils/logger.d.ts +2 -23
- package/dist/utils/modelRouter.d.ts +1 -17
- package/dist/utils/optionsConversion.d.ts +0 -5
- package/dist/utils/optionsUtils.d.ts +1 -70
- package/dist/utils/parameterValidation.d.ts +9 -22
- package/dist/utils/performance.d.ts +1 -13
- package/dist/utils/promptRedaction.d.ts +1 -8
- package/dist/utils/providerUtils.d.ts +2 -10
- package/dist/utils/redis.d.ts +1 -1
- package/dist/utils/redis.js +0 -1
- package/dist/utils/retryHandler.d.ts +1 -8
- package/package.json +1 -1
package/dist/types/tools.d.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import type { ErrorInfo, JsonObject, JsonValue, Result, UnknownRecord } from "./common.js";
|
|
7
|
-
import type { StandardRecord, ZodUnknownSchema } from "./typeAliases.js";
|
|
7
|
+
import type { StandardRecord, StringArray, ZodUnknownSchema } from "./typeAliases.js";
|
|
8
|
+
import type { ValidationError } from "../utils/parameterValidation.js";
|
|
8
9
|
/**
|
|
9
10
|
* Commonly used Zod schema type aliases for cleaner type declarations
|
|
10
11
|
*/
|
|
@@ -336,6 +337,20 @@ export type ToolCallResult = {
|
|
|
336
337
|
result: ToolResult;
|
|
337
338
|
formattedForAI: string;
|
|
338
339
|
};
|
|
340
|
+
/**
|
|
341
|
+
* Result of a validation operation
|
|
342
|
+
* Contains validation status, errors, warnings, and suggestions for improvement
|
|
343
|
+
*/
|
|
344
|
+
export type EnhancedValidationResult = {
|
|
345
|
+
/** Whether the validation passed without errors */
|
|
346
|
+
isValid: boolean;
|
|
347
|
+
/** Array of validation errors that must be fixed */
|
|
348
|
+
errors: ValidationError[];
|
|
349
|
+
/** Array of warning messages that should be addressed */
|
|
350
|
+
warnings: string[];
|
|
351
|
+
/** Array of suggestions to improve the validated object */
|
|
352
|
+
suggestions: StringArray;
|
|
353
|
+
};
|
|
339
354
|
/**
|
|
340
355
|
* Type guard for tool result
|
|
341
356
|
*/
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility module types - extracted from utils module files
|
|
3
3
|
*/
|
|
4
|
+
import { ErrorCategory, ErrorSeverity } from "../constants/enums.js";
|
|
5
|
+
import type { UnifiedGenerationOptions } from "./generateTypes.js";
|
|
6
|
+
import type { ExecutionContext } from "./tools.js";
|
|
7
|
+
/**
|
|
8
|
+
* Represents the available logging severity levels.
|
|
9
|
+
* - debug: Detailed information for debugging purposes
|
|
10
|
+
* - info: General information about system operation
|
|
11
|
+
* - warn: Potential issues that don't prevent operation
|
|
12
|
+
* - error: Critical issues that may cause failures
|
|
13
|
+
*/
|
|
14
|
+
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
4
15
|
export type TimeoutConfig = {
|
|
5
16
|
operation: string;
|
|
6
17
|
timeout?: number | string;
|
|
@@ -40,6 +51,126 @@ export type ParsedProxyConfig = {
|
|
|
40
51
|
};
|
|
41
52
|
cleanUrl: string;
|
|
42
53
|
};
|
|
54
|
+
/**
|
|
55
|
+
* Represents a single log entry in the logging system.
|
|
56
|
+
* Each entry contains metadata about the log event along with the actual message.
|
|
57
|
+
*/
|
|
58
|
+
export type LogEntry = {
|
|
59
|
+
/** The severity level of the log entry */
|
|
60
|
+
level: LogLevel;
|
|
61
|
+
/** The text message to be logged */
|
|
62
|
+
message: string;
|
|
63
|
+
/** When the log entry was created */
|
|
64
|
+
timestamp: Date;
|
|
65
|
+
/** Optional additional data associated with the log entry (objects, arrays, etc.) */
|
|
66
|
+
data?: unknown;
|
|
67
|
+
};
|
|
68
|
+
export type StructuredError = {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
category: ErrorCategory;
|
|
72
|
+
severity: ErrorSeverity;
|
|
73
|
+
retriable: boolean;
|
|
74
|
+
context?: Record<string, unknown>;
|
|
75
|
+
originalError?: Error;
|
|
76
|
+
timestamp: Date;
|
|
77
|
+
toolName?: string;
|
|
78
|
+
serverId?: string;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Enhancement types for different optimization strategies
|
|
82
|
+
*/
|
|
83
|
+
export type EnhancementType = "streaming-optimization" | "mcp-integration" | "legacy-migration" | "context-conversion" | "domain-configuration" | "batch-parallel-enhancement" | "batch-hybrid-enhancement" | "batch-dependency-enhancement";
|
|
84
|
+
/**
|
|
85
|
+
* Enhancement options for modifying GenerateOptions
|
|
86
|
+
*/
|
|
87
|
+
export type EnhancementOptions = {
|
|
88
|
+
enhancementType: EnhancementType;
|
|
89
|
+
streamingOptions?: {
|
|
90
|
+
enabled?: boolean;
|
|
91
|
+
chunkSize?: number;
|
|
92
|
+
bufferSize?: number;
|
|
93
|
+
enableProgress?: boolean;
|
|
94
|
+
preferStreaming?: boolean;
|
|
95
|
+
};
|
|
96
|
+
mcpOptions?: {
|
|
97
|
+
enableToolRegistry?: boolean;
|
|
98
|
+
contextAware?: boolean;
|
|
99
|
+
executionContext?: ExecutionContext;
|
|
100
|
+
};
|
|
101
|
+
legacyMigration?: {
|
|
102
|
+
legacyContext?: Record<string, unknown>;
|
|
103
|
+
domainType?: string;
|
|
104
|
+
preserveFields?: boolean;
|
|
105
|
+
};
|
|
106
|
+
domainConfiguration?: {
|
|
107
|
+
domainType: string;
|
|
108
|
+
keyTerms?: string[];
|
|
109
|
+
failurePatterns?: string[];
|
|
110
|
+
successPatterns?: string[];
|
|
111
|
+
evaluationCriteria?: Record<string, unknown>;
|
|
112
|
+
};
|
|
113
|
+
performance?: {
|
|
114
|
+
enableAnalytics?: boolean;
|
|
115
|
+
enableEvaluation?: boolean;
|
|
116
|
+
timeout?: number;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Enhancement result with metadata
|
|
121
|
+
*/
|
|
122
|
+
export type EnhancementResult = {
|
|
123
|
+
options: UnifiedGenerationOptions;
|
|
124
|
+
metadata: {
|
|
125
|
+
enhancementApplied: boolean;
|
|
126
|
+
enhancementType: EnhancementType;
|
|
127
|
+
processingTime: number;
|
|
128
|
+
configurationUsed: Record<string, unknown>;
|
|
129
|
+
warnings: string[];
|
|
130
|
+
recommendations: string[];
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Plugin-based conflict detection system
|
|
135
|
+
* Extensible and configurable enhancement conflict resolution
|
|
136
|
+
*/
|
|
137
|
+
export type ConflictDetectionPlugin = {
|
|
138
|
+
/** Plugin name for identification */
|
|
139
|
+
name: string;
|
|
140
|
+
/** Plugin version for compatibility checks */
|
|
141
|
+
version: string;
|
|
142
|
+
/** Check if two enhancement types conflict */
|
|
143
|
+
detectConflict(enhancementA: EnhancementType, enhancementB: EnhancementType, optionsA?: EnhancementOptions, optionsB?: EnhancementOptions): boolean;
|
|
144
|
+
/** Get conflict severity (low, medium, high) */
|
|
145
|
+
getConflictSeverity?(enhancementA: EnhancementType, enhancementB: EnhancementType): "low" | "medium" | "high";
|
|
146
|
+
/** Suggest resolution strategies */
|
|
147
|
+
suggestResolution?(enhancementA: EnhancementType, enhancementB: EnhancementType): string[];
|
|
148
|
+
};
|
|
149
|
+
export type RetryOptions = {
|
|
150
|
+
maxAttempts?: number;
|
|
151
|
+
initialDelay?: number;
|
|
152
|
+
maxDelay?: number;
|
|
153
|
+
backoffMultiplier?: number;
|
|
154
|
+
retryCondition?: (error: unknown) => boolean;
|
|
155
|
+
onRetry?: (attempt: number, error: unknown) => void;
|
|
156
|
+
};
|
|
157
|
+
export type PromptRedactionOptions = {
|
|
158
|
+
/** Maximum length of redacted prompt */
|
|
159
|
+
maxLength?: number;
|
|
160
|
+
/** Whether to show word count */
|
|
161
|
+
showWordCount?: boolean;
|
|
162
|
+
/** Mask character to use for redaction */
|
|
163
|
+
maskChar?: string;
|
|
164
|
+
};
|
|
165
|
+
/**
|
|
166
|
+
* Validation results for environment variables
|
|
167
|
+
*/
|
|
168
|
+
export type EnvVarValidationResult = {
|
|
169
|
+
isValid: boolean;
|
|
170
|
+
missingVars: string[];
|
|
171
|
+
invalidVars: string[];
|
|
172
|
+
warnings: string[];
|
|
173
|
+
};
|
|
43
174
|
/**
|
|
44
175
|
* Interface for mem0 Memory instance methods based on actual mem0ai/oss API
|
|
45
176
|
*/
|
package/dist/types/utilities.js
CHANGED
|
@@ -2,34 +2,8 @@
|
|
|
2
2
|
* Robust Error Handling Utilities for NeuroLink
|
|
3
3
|
* Provides structured error management for tool execution and system operations
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
TIMEOUT = "timeout",
|
|
8
|
-
NETWORK = "network",
|
|
9
|
-
RESOURCE = "resource",
|
|
10
|
-
PERMISSION = "permission",
|
|
11
|
-
CONFIGURATION = "configuration",
|
|
12
|
-
EXECUTION = "execution",
|
|
13
|
-
SYSTEM = "system"
|
|
14
|
-
}
|
|
15
|
-
export declare enum ErrorSeverity {
|
|
16
|
-
LOW = "low",
|
|
17
|
-
MEDIUM = "medium",
|
|
18
|
-
HIGH = "high",
|
|
19
|
-
CRITICAL = "critical"
|
|
20
|
-
}
|
|
21
|
-
export type StructuredError = {
|
|
22
|
-
code: string;
|
|
23
|
-
message: string;
|
|
24
|
-
category: ErrorCategory;
|
|
25
|
-
severity: ErrorSeverity;
|
|
26
|
-
retriable: boolean;
|
|
27
|
-
context?: Record<string, unknown>;
|
|
28
|
-
originalError?: Error;
|
|
29
|
-
timestamp: Date;
|
|
30
|
-
toolName?: string;
|
|
31
|
-
serverId?: string;
|
|
32
|
-
};
|
|
5
|
+
import { ErrorCategory, ErrorSeverity } from "../constants/enums.js";
|
|
6
|
+
import type { StructuredError } from "../types/utilities.js";
|
|
33
7
|
export declare const ERROR_CODES: {
|
|
34
8
|
readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
|
|
35
9
|
readonly TOOL_EXECUTION_FAILED: "TOOL_EXECUTION_FAILED";
|
|
@@ -2,27 +2,8 @@
|
|
|
2
2
|
* Robust Error Handling Utilities for NeuroLink
|
|
3
3
|
* Provides structured error management for tool execution and system operations
|
|
4
4
|
*/
|
|
5
|
+
import { ErrorCategory, ErrorSeverity } from "../constants/enums.js";
|
|
5
6
|
import { logger } from "./logger.js";
|
|
6
|
-
// Error categories for proper handling
|
|
7
|
-
export var ErrorCategory;
|
|
8
|
-
(function (ErrorCategory) {
|
|
9
|
-
ErrorCategory["VALIDATION"] = "validation";
|
|
10
|
-
ErrorCategory["TIMEOUT"] = "timeout";
|
|
11
|
-
ErrorCategory["NETWORK"] = "network";
|
|
12
|
-
ErrorCategory["RESOURCE"] = "resource";
|
|
13
|
-
ErrorCategory["PERMISSION"] = "permission";
|
|
14
|
-
ErrorCategory["CONFIGURATION"] = "configuration";
|
|
15
|
-
ErrorCategory["EXECUTION"] = "execution";
|
|
16
|
-
ErrorCategory["SYSTEM"] = "system";
|
|
17
|
-
})(ErrorCategory || (ErrorCategory = {}));
|
|
18
|
-
// Error severity levels
|
|
19
|
-
export var ErrorSeverity;
|
|
20
|
-
(function (ErrorSeverity) {
|
|
21
|
-
ErrorSeverity["LOW"] = "low";
|
|
22
|
-
ErrorSeverity["MEDIUM"] = "medium";
|
|
23
|
-
ErrorSeverity["HIGH"] = "high";
|
|
24
|
-
ErrorSeverity["CRITICAL"] = "critical";
|
|
25
|
-
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
26
7
|
// Error codes for different scenarios
|
|
27
8
|
export const ERROR_CODES = {
|
|
28
9
|
// Tool errors
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -13,28 +13,7 @@
|
|
|
13
13
|
* - Structured data support for complex objects
|
|
14
14
|
* - Tabular data display
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
* Represents the available logging severity levels.
|
|
18
|
-
* - debug: Detailed information for debugging purposes
|
|
19
|
-
* - info: General information about system operation
|
|
20
|
-
* - warn: Potential issues that don't prevent operation
|
|
21
|
-
* - error: Critical issues that may cause failures
|
|
22
|
-
*/
|
|
23
|
-
export type LogLevel = "debug" | "info" | "warn" | "error";
|
|
24
|
-
/**
|
|
25
|
-
* Represents a single log entry in the logging system.
|
|
26
|
-
* Each entry contains metadata about the log event along with the actual message.
|
|
27
|
-
*/
|
|
28
|
-
interface LogEntry {
|
|
29
|
-
/** The severity level of the log entry */
|
|
30
|
-
level: LogLevel;
|
|
31
|
-
/** The text message to be logged */
|
|
32
|
-
message: string;
|
|
33
|
-
/** When the log entry was created */
|
|
34
|
-
timestamp: Date;
|
|
35
|
-
/** Optional additional data associated with the log entry (objects, arrays, etc.) */
|
|
36
|
-
data?: unknown;
|
|
37
|
-
}
|
|
16
|
+
import type { LogEntry, LogLevel } from "../types/utilities.js";
|
|
38
17
|
declare class NeuroLinkLogger {
|
|
39
18
|
private logLevel;
|
|
40
19
|
private logs;
|
|
@@ -236,4 +215,4 @@ export declare const LogLevels: {
|
|
|
236
215
|
readonly warn: "warn";
|
|
237
216
|
readonly error: "error";
|
|
238
217
|
};
|
|
239
|
-
export
|
|
218
|
+
export {};
|
|
@@ -2,23 +2,7 @@
|
|
|
2
2
|
* Model Router for NeuroLink Orchestration
|
|
3
3
|
* Routes tasks to optimal models based on classification and requirements
|
|
4
4
|
*/
|
|
5
|
-
import type {
|
|
6
|
-
export type ModelRoute = {
|
|
7
|
-
provider: string;
|
|
8
|
-
model: string;
|
|
9
|
-
reasoning: string;
|
|
10
|
-
confidence: number;
|
|
11
|
-
};
|
|
12
|
-
export type ModelRoutingOptions = {
|
|
13
|
-
/** Override the task classification */
|
|
14
|
-
forceTaskType?: TaskType;
|
|
15
|
-
/** Require specific performance characteristics */
|
|
16
|
-
requireFast?: boolean;
|
|
17
|
-
/** Require specific capability (reasoning, creativity, etc.) */
|
|
18
|
-
requireCapability?: string;
|
|
19
|
-
/** Fallback strategy if primary choice fails */
|
|
20
|
-
fallbackStrategy?: "fast" | "reasoning" | "auto";
|
|
21
|
-
};
|
|
5
|
+
import type { ModelRoute, ModelRoutingOptions } from "../types/modelTypes.js";
|
|
22
6
|
/**
|
|
23
7
|
* Model configurations for different task types and providers
|
|
24
8
|
*/
|
|
@@ -17,11 +17,6 @@ export declare function convertGenerateToStreamOptions(generateOptions: Generate
|
|
|
17
17
|
* Useful for fallback scenarios and unified processing
|
|
18
18
|
*/
|
|
19
19
|
export declare function convertStreamToGenerateOptions(streamOptions: StreamOptions): GenerateOptions;
|
|
20
|
-
/**
|
|
21
|
-
* Create a unified options interface that works with both methods
|
|
22
|
-
* Useful for factory utilities that need to work with either type
|
|
23
|
-
*/
|
|
24
|
-
export type UnifiedOptions = GenerateOptions & StreamOptions;
|
|
25
20
|
/**
|
|
26
21
|
* Check if options object has factory configuration
|
|
27
22
|
* Useful for determining if enhanced processing is needed
|
|
@@ -5,60 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { GenerateOptions, UnifiedGenerationOptions } from "../types/generateTypes.js";
|
|
7
7
|
import type { StreamOptions } from "../types/streamTypes.js";
|
|
8
|
-
import type {
|
|
9
|
-
/**
|
|
10
|
-
* Enhancement types for different optimization strategies
|
|
11
|
-
*/
|
|
12
|
-
export type EnhancementType = "streaming-optimization" | "mcp-integration" | "legacy-migration" | "context-conversion" | "domain-configuration" | "batch-parallel-enhancement" | "batch-hybrid-enhancement" | "batch-dependency-enhancement";
|
|
13
|
-
/**
|
|
14
|
-
* Enhancement options for modifying GenerateOptions
|
|
15
|
-
*/
|
|
16
|
-
export interface EnhancementOptions {
|
|
17
|
-
enhancementType: EnhancementType;
|
|
18
|
-
streamingOptions?: {
|
|
19
|
-
enabled?: boolean;
|
|
20
|
-
chunkSize?: number;
|
|
21
|
-
bufferSize?: number;
|
|
22
|
-
enableProgress?: boolean;
|
|
23
|
-
preferStreaming?: boolean;
|
|
24
|
-
};
|
|
25
|
-
mcpOptions?: {
|
|
26
|
-
enableToolRegistry?: boolean;
|
|
27
|
-
contextAware?: boolean;
|
|
28
|
-
executionContext?: ExecutionContext;
|
|
29
|
-
};
|
|
30
|
-
legacyMigration?: {
|
|
31
|
-
legacyContext?: Record<string, unknown>;
|
|
32
|
-
domainType?: string;
|
|
33
|
-
preserveFields?: boolean;
|
|
34
|
-
};
|
|
35
|
-
domainConfiguration?: {
|
|
36
|
-
domainType: string;
|
|
37
|
-
keyTerms?: string[];
|
|
38
|
-
failurePatterns?: string[];
|
|
39
|
-
successPatterns?: string[];
|
|
40
|
-
evaluationCriteria?: Record<string, unknown>;
|
|
41
|
-
};
|
|
42
|
-
performance?: {
|
|
43
|
-
enableAnalytics?: boolean;
|
|
44
|
-
enableEvaluation?: boolean;
|
|
45
|
-
timeout?: number;
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Enhancement result with metadata
|
|
50
|
-
*/
|
|
51
|
-
export interface EnhancementResult {
|
|
52
|
-
options: UnifiedGenerationOptions;
|
|
53
|
-
metadata: {
|
|
54
|
-
enhancementApplied: boolean;
|
|
55
|
-
enhancementType: EnhancementType;
|
|
56
|
-
processingTime: number;
|
|
57
|
-
configurationUsed: Record<string, unknown>;
|
|
58
|
-
warnings: string[];
|
|
59
|
-
recommendations: string[];
|
|
60
|
-
};
|
|
61
|
-
}
|
|
8
|
+
import type { ConflictDetectionPlugin, EnhancementOptions, EnhancementResult, EnhancementType } from "../types/utilities.js";
|
|
62
9
|
/**
|
|
63
10
|
* Options Enhancement Utility Class
|
|
64
11
|
* Main utility for enhancing GenerateOptions with factory patterns
|
|
@@ -176,22 +123,6 @@ export declare function migrateLegacyContext(options: GenerateOptions, legacyCon
|
|
|
176
123
|
* Automatically detects independent enhancements for parallel processing
|
|
177
124
|
*/
|
|
178
125
|
export declare function batchEnhance(options: GenerateOptions, enhancements: EnhancementOptions[]): EnhancementResult;
|
|
179
|
-
/**
|
|
180
|
-
* Plugin-based conflict detection system
|
|
181
|
-
* Extensible and configurable enhancement conflict resolution
|
|
182
|
-
*/
|
|
183
|
-
export interface ConflictDetectionPlugin {
|
|
184
|
-
/** Plugin name for identification */
|
|
185
|
-
name: string;
|
|
186
|
-
/** Plugin version for compatibility checks */
|
|
187
|
-
version: string;
|
|
188
|
-
/** Check if two enhancement types conflict */
|
|
189
|
-
detectConflict(enhancementA: EnhancementType, enhancementB: EnhancementType, optionsA?: EnhancementOptions, optionsB?: EnhancementOptions): boolean;
|
|
190
|
-
/** Get conflict severity (low, medium, high) */
|
|
191
|
-
getConflictSeverity?(enhancementA: EnhancementType, enhancementB: EnhancementType): "low" | "medium" | "high";
|
|
192
|
-
/** Suggest resolution strategies */
|
|
193
|
-
suggestResolution?(enhancementA: EnhancementType, enhancementB: EnhancementType): string[];
|
|
194
|
-
}
|
|
195
126
|
/**
|
|
196
127
|
* Plugin registry for managing conflict detection plugins
|
|
197
128
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Provides consistent parameter validation across all tool interfaces
|
|
4
4
|
*/
|
|
5
5
|
import type { ValidationSchema, StringArray } from "../types/typeAliases.js";
|
|
6
|
+
import type { EnhancedValidationResult } from "../types/tools.js";
|
|
6
7
|
/**
|
|
7
8
|
* Custom error class for parameter validation failures
|
|
8
9
|
* Provides detailed information about validation errors including field context and suggestions
|
|
@@ -20,20 +21,6 @@ export declare class ValidationError extends Error {
|
|
|
20
21
|
*/
|
|
21
22
|
constructor(message: string, field?: string | undefined, code?: string | undefined, suggestions?: StringArray | undefined);
|
|
22
23
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Result of a validation operation
|
|
25
|
-
* Contains validation status, errors, warnings, and suggestions for improvement
|
|
26
|
-
*/
|
|
27
|
-
export interface ValidationResult {
|
|
28
|
-
/** Whether the validation passed without errors */
|
|
29
|
-
isValid: boolean;
|
|
30
|
-
/** Array of validation errors that must be fixed */
|
|
31
|
-
errors: ValidationError[];
|
|
32
|
-
/** Array of warning messages that should be addressed */
|
|
33
|
-
warnings: string[];
|
|
34
|
-
/** Array of suggestions to improve the validated object */
|
|
35
|
-
suggestions: StringArray;
|
|
36
|
-
}
|
|
37
24
|
/**
|
|
38
25
|
* Validate that a string parameter is present and non-empty
|
|
39
26
|
*/
|
|
@@ -61,23 +48,23 @@ export declare function validateToolDescription(description: unknown): Validatio
|
|
|
61
48
|
/**
|
|
62
49
|
* Validate MCP tool structure comprehensively
|
|
63
50
|
*/
|
|
64
|
-
export declare function validateMCPTool(tool: unknown):
|
|
51
|
+
export declare function validateMCPTool(tool: unknown): EnhancedValidationResult;
|
|
65
52
|
/**
|
|
66
53
|
* Validate text generation options
|
|
67
54
|
*/
|
|
68
|
-
export declare function validateTextGenerationOptions(options: unknown):
|
|
55
|
+
export declare function validateTextGenerationOptions(options: unknown): EnhancedValidationResult;
|
|
69
56
|
/**
|
|
70
57
|
* Validate stream options
|
|
71
58
|
*/
|
|
72
|
-
export declare function validateStreamOptions(options: unknown):
|
|
59
|
+
export declare function validateStreamOptions(options: unknown): EnhancedValidationResult;
|
|
73
60
|
/**
|
|
74
61
|
* Validate generate options (unified interface)
|
|
75
62
|
*/
|
|
76
|
-
export declare function validateGenerateOptions(options: unknown):
|
|
63
|
+
export declare function validateGenerateOptions(options: unknown): EnhancedValidationResult;
|
|
77
64
|
/**
|
|
78
65
|
* Validate tool execution parameters
|
|
79
66
|
*/
|
|
80
|
-
export declare function validateToolExecutionParams(toolName: string, params: unknown, expectedSchema?: ValidationSchema):
|
|
67
|
+
export declare function validateToolExecutionParams(toolName: string, params: unknown, expectedSchema?: ValidationSchema): EnhancedValidationResult;
|
|
81
68
|
/**
|
|
82
69
|
* Validate multiple tools at once
|
|
83
70
|
*/
|
|
@@ -85,13 +72,13 @@ export declare function validateToolBatch(tools: Record<string, unknown>): {
|
|
|
85
72
|
isValid: boolean;
|
|
86
73
|
validTools: string[];
|
|
87
74
|
invalidTools: string[];
|
|
88
|
-
results: Record<string,
|
|
75
|
+
results: Record<string, EnhancedValidationResult>;
|
|
89
76
|
};
|
|
90
77
|
/**
|
|
91
78
|
* Create a validation error summary for logging
|
|
92
79
|
*/
|
|
93
|
-
export declare function createValidationSummary(result:
|
|
80
|
+
export declare function createValidationSummary(result: EnhancedValidationResult): string;
|
|
94
81
|
/**
|
|
95
82
|
* Check if validation result has only warnings (no errors)
|
|
96
83
|
*/
|
|
97
|
-
export declare function hasOnlyWarnings(result:
|
|
84
|
+
export declare function hasOnlyWarnings(result: EnhancedValidationResult): boolean;
|
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
* Performance measurement and memory management utilities
|
|
3
3
|
* Part of Sub-phase 3.3.1-3.3.2 optimization efforts
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
startTime: number;
|
|
7
|
-
endTime?: number;
|
|
8
|
-
duration?: number;
|
|
9
|
-
memoryStart: NodeJS.MemoryUsage;
|
|
10
|
-
memoryEnd?: NodeJS.MemoryUsage;
|
|
11
|
-
memoryDelta?: {
|
|
12
|
-
rss: number;
|
|
13
|
-
heapTotal: number;
|
|
14
|
-
heapUsed: number;
|
|
15
|
-
external: number;
|
|
16
|
-
};
|
|
17
|
-
}
|
|
5
|
+
import type { PerformanceMetrics } from "../types/analytics.js";
|
|
18
6
|
/**
|
|
19
7
|
* Performance measurement utility for tracking operations
|
|
20
8
|
*/
|
|
@@ -2,14 +2,7 @@
|
|
|
2
2
|
* Prompt redaction utilities for safe logging
|
|
3
3
|
* Provides consistent prompt masking across NeuroLink components
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
/** Maximum length of redacted prompt */
|
|
7
|
-
maxLength?: number;
|
|
8
|
-
/** Whether to show word count */
|
|
9
|
-
showWordCount?: boolean;
|
|
10
|
-
/** Mask character to use for redaction */
|
|
11
|
-
maskChar?: string;
|
|
12
|
-
}
|
|
5
|
+
import type { PromptRedactionOptions } from "../types/utilities.js";
|
|
13
6
|
/**
|
|
14
7
|
* Redact a prompt for safe logging
|
|
15
8
|
* Truncates to maxLength and optionally shows word count
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ProviderError } from "../types/
|
|
1
|
+
import type { ProviderError } from "../types/providers.js";
|
|
2
|
+
import type { EnvVarValidationResult } from "../types/utilities.js";
|
|
2
3
|
/**
|
|
3
4
|
* Get the best available provider based on real-time availability checks
|
|
4
5
|
* Enhanced version consolidated from providerUtils-fixed.ts
|
|
@@ -6,15 +7,6 @@ import type { ProviderError } from "../types/index.js";
|
|
|
6
7
|
* @returns The best provider name to use
|
|
7
8
|
*/
|
|
8
9
|
export declare function getBestProvider(requestedProvider?: string): Promise<string>;
|
|
9
|
-
/**
|
|
10
|
-
* Validation results for environment variables
|
|
11
|
-
*/
|
|
12
|
-
export interface EnvVarValidationResult {
|
|
13
|
-
isValid: boolean;
|
|
14
|
-
missingVars: string[];
|
|
15
|
-
invalidVars: string[];
|
|
16
|
-
warnings: string[];
|
|
17
|
-
}
|
|
18
10
|
/**
|
|
19
11
|
* Validate environment variable values for a provider
|
|
20
12
|
* Addresses GitHub Copilot comment about adding environment variable validation
|
package/dist/utils/redis.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Helper functions for Redis storage operations
|
|
4
4
|
*/
|
|
5
5
|
import { createClient } from "redis";
|
|
6
|
-
type RedisClient = ReturnType<typeof createClient>;
|
|
7
6
|
import type { RedisStorageConfig, RedisConversationObject } from "../types/conversation.js";
|
|
7
|
+
type RedisClient = ReturnType<typeof createClient>;
|
|
8
8
|
/**
|
|
9
9
|
* Creates a Redis client with the provided configuration
|
|
10
10
|
*/
|
package/dist/utils/redis.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Retry and resilience utilities for NeuroLink
|
|
3
3
|
* Part of Sub-phase 3.3.3 - Edge Case Handling
|
|
4
4
|
*/
|
|
5
|
+
import type { RetryOptions } from "../types/utilities.js";
|
|
5
6
|
/**
|
|
6
7
|
* Calculate exponential backoff delay with jitter
|
|
7
8
|
* @param attempt - Current attempt number (1-based)
|
|
@@ -12,14 +13,6 @@
|
|
|
12
13
|
* @returns Calculated delay in milliseconds
|
|
13
14
|
*/
|
|
14
15
|
export declare function calculateBackoffDelay(attempt: number, initialDelay?: number, multiplier?: number, maxDelay?: number, addJitter?: boolean): number;
|
|
15
|
-
export interface RetryOptions {
|
|
16
|
-
maxAttempts?: number;
|
|
17
|
-
initialDelay?: number;
|
|
18
|
-
maxDelay?: number;
|
|
19
|
-
backoffMultiplier?: number;
|
|
20
|
-
retryCondition?: (error: unknown) => boolean;
|
|
21
|
-
onRetry?: (attempt: number, error: unknown) => void;
|
|
22
|
-
}
|
|
23
16
|
/**
|
|
24
17
|
* Error types that are typically retryable
|
|
25
18
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "7.53.
|
|
3
|
+
"version": "7.53.5",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|