@juspay/neurolink 7.53.4 → 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 +2 -0
- package/dist/cli/commands/config.d.ts +18 -18
- package/dist/index.d.ts +1 -1
- package/dist/lib/agent/directTools.d.ts +3 -3
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/lib/types/common.d.ts +5 -5
- 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/providers/sagemaker/language-model.d.ts +2 -2
- package/dist/types/common.d.ts +5 -5
- 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
|
@@ -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",
|