@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.
Files changed (44) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/cli/commands/config.d.ts +18 -18
  3. package/dist/index.d.ts +1 -1
  4. package/dist/lib/agent/directTools.d.ts +3 -3
  5. package/dist/lib/index.d.ts +1 -1
  6. package/dist/lib/providers/sagemaker/language-model.d.ts +2 -2
  7. package/dist/lib/types/common.d.ts +5 -5
  8. package/dist/lib/types/modelTypes.d.ts +31 -14
  9. package/dist/lib/types/tools.d.ts +16 -1
  10. package/dist/lib/types/utilities.d.ts +131 -0
  11. package/dist/lib/types/utilities.js +1 -1
  12. package/dist/lib/utils/errorHandling.d.ts +2 -28
  13. package/dist/lib/utils/errorHandling.js +1 -20
  14. package/dist/lib/utils/logger.d.ts +2 -23
  15. package/dist/lib/utils/modelRouter.d.ts +1 -17
  16. package/dist/lib/utils/optionsConversion.d.ts +0 -5
  17. package/dist/lib/utils/optionsUtils.d.ts +1 -70
  18. package/dist/lib/utils/parameterValidation.d.ts +9 -22
  19. package/dist/lib/utils/performance.d.ts +1 -13
  20. package/dist/lib/utils/promptRedaction.d.ts +1 -8
  21. package/dist/lib/utils/providerUtils.d.ts +2 -10
  22. package/dist/lib/utils/redis.d.ts +1 -1
  23. package/dist/lib/utils/redis.js +0 -1
  24. package/dist/lib/utils/retryHandler.d.ts +1 -8
  25. package/dist/providers/sagemaker/language-model.d.ts +2 -2
  26. package/dist/types/common.d.ts +5 -5
  27. package/dist/types/modelTypes.d.ts +17 -0
  28. package/dist/types/tools.d.ts +16 -1
  29. package/dist/types/utilities.d.ts +131 -0
  30. package/dist/types/utilities.js +1 -1
  31. package/dist/utils/errorHandling.d.ts +2 -28
  32. package/dist/utils/errorHandling.js +1 -20
  33. package/dist/utils/logger.d.ts +2 -23
  34. package/dist/utils/modelRouter.d.ts +1 -17
  35. package/dist/utils/optionsConversion.d.ts +0 -5
  36. package/dist/utils/optionsUtils.d.ts +1 -70
  37. package/dist/utils/parameterValidation.d.ts +9 -22
  38. package/dist/utils/performance.d.ts +1 -13
  39. package/dist/utils/promptRedaction.d.ts +1 -8
  40. package/dist/utils/providerUtils.d.ts +2 -10
  41. package/dist/utils/redis.d.ts +1 -1
  42. package/dist/utils/redis.js +0 -1
  43. package/dist/utils/retryHandler.d.ts +1 -8
  44. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ ## [7.53.5](https://github.com/juspay/neurolink/compare/v7.53.4...v7.53.5) (2025-11-06)
2
+
1
3
  ## [7.53.4](https://github.com/juspay/neurolink/compare/v7.53.3...v7.53.4) (2025-11-05)
2
4
 
3
5
  ### Bug Fixes
@@ -18,9 +18,9 @@ declare const ConfigSchema: z.ZodObject<{
18
18
  apiKey?: string | undefined;
19
19
  baseURL?: string | undefined;
20
20
  }, {
21
- model?: string | undefined;
22
21
  apiKey?: string | undefined;
23
22
  baseURL?: string | undefined;
23
+ model?: string | undefined;
24
24
  }>>;
25
25
  bedrock: z.ZodOptional<z.ZodObject<{
26
26
  region: z.ZodOptional<z.ZodString>;
@@ -73,8 +73,8 @@ declare const ConfigSchema: z.ZodObject<{
73
73
  model: string;
74
74
  apiKey?: string | undefined;
75
75
  }, {
76
- model?: string | undefined;
77
76
  apiKey?: string | undefined;
77
+ model?: string | undefined;
78
78
  }>>;
79
79
  azure: z.ZodOptional<z.ZodObject<{
80
80
  apiKey: z.ZodOptional<z.ZodString>;
@@ -87,8 +87,8 @@ declare const ConfigSchema: z.ZodObject<{
87
87
  endpoint?: string | undefined;
88
88
  deploymentId?: string | undefined;
89
89
  }, {
90
- model?: string | undefined;
91
90
  apiKey?: string | undefined;
91
+ model?: string | undefined;
92
92
  endpoint?: string | undefined;
93
93
  deploymentId?: string | undefined;
94
94
  }>>;
@@ -99,8 +99,8 @@ declare const ConfigSchema: z.ZodObject<{
99
99
  model: string;
100
100
  apiKey?: string | undefined;
101
101
  }, {
102
- model?: string | undefined;
103
102
  apiKey?: string | undefined;
103
+ model?: string | undefined;
104
104
  }>>;
105
105
  huggingface: z.ZodOptional<z.ZodObject<{
106
106
  apiKey: z.ZodOptional<z.ZodString>;
@@ -109,8 +109,8 @@ declare const ConfigSchema: z.ZodObject<{
109
109
  model: string;
110
110
  apiKey?: string | undefined;
111
111
  }, {
112
- model?: string | undefined;
113
112
  apiKey?: string | undefined;
113
+ model?: string | undefined;
114
114
  }>>;
115
115
  ollama: z.ZodOptional<z.ZodObject<{
116
116
  baseUrl: z.ZodDefault<z.ZodString>;
@@ -132,8 +132,8 @@ declare const ConfigSchema: z.ZodObject<{
132
132
  model: string;
133
133
  apiKey?: string | undefined;
134
134
  }, {
135
- model?: string | undefined;
136
135
  apiKey?: string | undefined;
136
+ model?: string | undefined;
137
137
  }>>;
138
138
  }, "strip", z.ZodTypeAny, {
139
139
  bedrock?: {
@@ -193,9 +193,9 @@ declare const ConfigSchema: z.ZodObject<{
193
193
  sessionToken?: string | undefined;
194
194
  } | undefined;
195
195
  openai?: {
196
- model?: string | undefined;
197
196
  apiKey?: string | undefined;
198
197
  baseURL?: string | undefined;
198
+ model?: string | undefined;
199
199
  } | undefined;
200
200
  vertex?: {
201
201
  model?: string | undefined;
@@ -207,22 +207,22 @@ declare const ConfigSchema: z.ZodObject<{
207
207
  privateKey?: string | undefined;
208
208
  } | undefined;
209
209
  anthropic?: {
210
- model?: string | undefined;
211
210
  apiKey?: string | undefined;
211
+ model?: string | undefined;
212
212
  } | undefined;
213
213
  azure?: {
214
- model?: string | undefined;
215
214
  apiKey?: string | undefined;
215
+ model?: string | undefined;
216
216
  endpoint?: string | undefined;
217
217
  deploymentId?: string | undefined;
218
218
  } | undefined;
219
219
  "google-ai"?: {
220
- model?: string | undefined;
221
220
  apiKey?: string | undefined;
221
+ model?: string | undefined;
222
222
  } | undefined;
223
223
  huggingface?: {
224
- model?: string | undefined;
225
224
  apiKey?: string | undefined;
225
+ model?: string | undefined;
226
226
  } | undefined;
227
227
  ollama?: {
228
228
  timeout?: number | undefined;
@@ -230,8 +230,8 @@ declare const ConfigSchema: z.ZodObject<{
230
230
  baseUrl?: string | undefined;
231
231
  } | undefined;
232
232
  mistral?: {
233
- model?: string | undefined;
234
233
  apiKey?: string | undefined;
234
+ model?: string | undefined;
235
235
  } | undefined;
236
236
  }>>;
237
237
  profiles: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>;
@@ -562,9 +562,9 @@ declare const ConfigSchema: z.ZodObject<{
562
562
  sessionToken?: string | undefined;
563
563
  } | undefined;
564
564
  openai?: {
565
- model?: string | undefined;
566
565
  apiKey?: string | undefined;
567
566
  baseURL?: string | undefined;
567
+ model?: string | undefined;
568
568
  } | undefined;
569
569
  vertex?: {
570
570
  model?: string | undefined;
@@ -576,22 +576,22 @@ declare const ConfigSchema: z.ZodObject<{
576
576
  privateKey?: string | undefined;
577
577
  } | undefined;
578
578
  anthropic?: {
579
- model?: string | undefined;
580
579
  apiKey?: string | undefined;
580
+ model?: string | undefined;
581
581
  } | undefined;
582
582
  azure?: {
583
- model?: string | undefined;
584
583
  apiKey?: string | undefined;
584
+ model?: string | undefined;
585
585
  endpoint?: string | undefined;
586
586
  deploymentId?: string | undefined;
587
587
  } | undefined;
588
588
  "google-ai"?: {
589
- model?: string | undefined;
590
589
  apiKey?: string | undefined;
590
+ model?: string | undefined;
591
591
  } | undefined;
592
592
  huggingface?: {
593
- model?: string | undefined;
594
593
  apiKey?: string | undefined;
594
+ model?: string | undefined;
595
595
  } | undefined;
596
596
  ollama?: {
597
597
  timeout?: number | undefined;
@@ -599,8 +599,8 @@ declare const ConfigSchema: z.ZodObject<{
599
599
  baseUrl?: string | undefined;
600
600
  } | undefined;
601
601
  mistral?: {
602
- model?: string | undefined;
603
602
  apiKey?: string | undefined;
603
+ model?: string | undefined;
604
604
  } | undefined;
605
605
  } | undefined;
606
606
  defaultProvider?: "bedrock" | "openai" | "vertex" | "anthropic" | "azure" | "google-ai" | "huggingface" | "ollama" | "mistral" | "auto" | undefined;
package/dist/index.d.ts CHANGED
@@ -86,7 +86,7 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
86
86
  export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
87
87
  export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
88
88
  export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
89
- export type { LogLevel } from "./utils/logger.js";
89
+ export type { LogLevel } from "./types/utilities.js";
90
90
  export declare function initializeTelemetry(): Promise<boolean>;
91
91
  export declare function getTelemetryStatus(): Promise<{
92
92
  enabled: boolean;
@@ -352,13 +352,13 @@ export declare const directAgentTools: {
352
352
  column: z.ZodDefault<z.ZodOptional<z.ZodString>>;
353
353
  maxRows: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
354
354
  }, "strip", z.ZodTypeAny, {
355
+ operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
355
356
  maxRows: number;
356
357
  filePath: string;
357
- operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
358
358
  column: string;
359
359
  }, {
360
- filePath: string;
361
360
  operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
361
+ filePath: string;
362
362
  maxRows?: number | undefined;
363
363
  column?: string | undefined;
364
364
  }>, {
@@ -379,9 +379,9 @@ export declare const directAgentTools: {
379
379
  column: string;
380
380
  }> & {
381
381
  execute: (args: {
382
+ operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
382
383
  maxRows: number;
383
384
  filePath: string;
384
- operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
385
385
  column: string;
386
386
  }, options: import("ai").ToolExecutionOptions) => PromiseLike<{
387
387
  success: boolean;
@@ -86,7 +86,7 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
86
86
  export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
87
87
  export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
88
88
  export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
89
- export type { LogLevel } from "./utils/logger.js";
89
+ export type { LogLevel } from "./types/utilities.js";
90
90
  export declare function initializeTelemetry(): Promise<boolean>;
91
91
  export declare function getTelemetryStatus(): Promise<{
92
92
  enabled: boolean;
@@ -131,7 +131,7 @@ export declare class SageMakerLanguageModel implements LanguageModelV1 {
131
131
  provider: string;
132
132
  specificationVersion: string;
133
133
  endpointName: string;
134
- modelType: "custom" | "huggingface" | "mistral" | "claude" | "llama" | "jumpstart" | undefined;
134
+ modelType: "huggingface" | "mistral" | "llama" | "claude" | "jumpstart" | "custom" | undefined;
135
135
  region: string;
136
136
  };
137
137
  /**
@@ -178,7 +178,7 @@ export declare class SageMakerLanguageModel implements LanguageModelV1 {
178
178
  provider: string;
179
179
  specificationVersion: string;
180
180
  endpointName: string;
181
- modelType: "custom" | "huggingface" | "mistral" | "claude" | "llama" | "jumpstart" | undefined;
181
+ modelType: "huggingface" | "mistral" | "llama" | "claude" | "jumpstart" | "custom" | undefined;
182
182
  region: string;
183
183
  };
184
184
  }
@@ -120,11 +120,11 @@ export type NeuroLinkEvents = {
120
120
  * TypeScript utility for typed EventEmitter
121
121
  * Flexible interface to support both typed and legacy event patterns
122
122
  */
123
- export interface TypedEventEmitter<TEvents extends Record<string, unknown>> {
124
- on<K extends keyof TEvents>(event: K, listener: (...args: unknown[]) => void): this;
123
+ export type TypedEventEmitter<TEvents extends Record<string, unknown>> = {
124
+ on<K extends keyof TEvents>(event: K, listener: (...args: unknown[]) => void): TypedEventEmitter<TEvents>;
125
125
  emit<K extends keyof TEvents>(event: K, ...args: unknown[]): boolean;
126
- off<K extends keyof TEvents>(event: K, listener: (...args: unknown[]) => void): this;
127
- removeAllListeners<K extends keyof TEvents>(event?: K): this;
126
+ off<K extends keyof TEvents>(event: K, listener: (...args: unknown[]) => void): TypedEventEmitter<TEvents>;
127
+ removeAllListeners<K extends keyof TEvents>(event?: K): TypedEventEmitter<TEvents>;
128
128
  listenerCount<K extends keyof TEvents>(event: K): number;
129
129
  listeners<K extends keyof TEvents>(event: K): Array<(...args: unknown[]) => void>;
130
- }
130
+ };
@@ -5,6 +5,7 @@
5
5
  import { z } from "zod";
6
6
  import type { JsonValue } from "./common.js";
7
7
  import { AIProviderName } from "../constants/enums.js";
8
+ import type { TaskType } from "./taskClassificationTypes.js";
8
9
  /**
9
10
  * Model performance tier definition
10
11
  */
@@ -87,10 +88,10 @@ export declare const ModelConfigSchema: z.ZodObject<{
87
88
  contextWindow: z.ZodNumber;
88
89
  releaseDate: z.ZodString;
89
90
  }, "strip", z.ZodTypeAny, {
90
- id: string;
91
- displayName: string;
92
91
  capabilities: string[];
92
+ id: string;
93
93
  deprecated: boolean;
94
+ displayName: string;
94
95
  pricing: {
95
96
  input: number;
96
97
  output: number;
@@ -98,10 +99,10 @@ export declare const ModelConfigSchema: z.ZodObject<{
98
99
  contextWindow: number;
99
100
  releaseDate: string;
100
101
  }, {
101
- id: string;
102
- displayName: string;
103
102
  capabilities: string[];
103
+ id: string;
104
104
  deprecated: boolean;
105
+ displayName: string;
105
106
  pricing: {
106
107
  input: number;
107
108
  output: number;
@@ -133,10 +134,10 @@ export declare const ModelRegistrySchema: z.ZodObject<{
133
134
  contextWindow: z.ZodNumber;
134
135
  releaseDate: z.ZodString;
135
136
  }, "strip", z.ZodTypeAny, {
136
- id: string;
137
- displayName: string;
138
137
  capabilities: string[];
138
+ id: string;
139
139
  deprecated: boolean;
140
+ displayName: string;
140
141
  pricing: {
141
142
  input: number;
142
143
  output: number;
@@ -144,10 +145,10 @@ export declare const ModelRegistrySchema: z.ZodObject<{
144
145
  contextWindow: number;
145
146
  releaseDate: string;
146
147
  }, {
147
- id: string;
148
- displayName: string;
149
148
  capabilities: string[];
149
+ id: string;
150
150
  deprecated: boolean;
151
+ displayName: string;
151
152
  pricing: {
152
153
  input: number;
153
154
  output: number;
@@ -159,11 +160,12 @@ export declare const ModelRegistrySchema: z.ZodObject<{
159
160
  defaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
160
161
  }, "strip", z.ZodTypeAny, {
161
162
  version: string;
163
+ lastUpdated: string;
162
164
  models: Record<string, Record<string, {
163
- id: string;
164
- displayName: string;
165
165
  capabilities: string[];
166
+ id: string;
166
167
  deprecated: boolean;
168
+ displayName: string;
167
169
  pricing: {
168
170
  input: number;
169
171
  output: number;
@@ -171,16 +173,16 @@ export declare const ModelRegistrySchema: z.ZodObject<{
171
173
  contextWindow: number;
172
174
  releaseDate: string;
173
175
  }>>;
174
- lastUpdated: string;
175
176
  aliases?: Record<string, string> | undefined;
176
177
  defaults?: Record<string, string> | undefined;
177
178
  }, {
178
179
  version: string;
180
+ lastUpdated: string;
179
181
  models: Record<string, Record<string, {
180
- id: string;
181
- displayName: string;
182
182
  capabilities: string[];
183
+ id: string;
183
184
  deprecated: boolean;
185
+ displayName: string;
184
186
  pricing: {
185
187
  input: number;
186
188
  output: number;
@@ -188,7 +190,6 @@ export declare const ModelRegistrySchema: z.ZodObject<{
188
190
  contextWindow: number;
189
191
  releaseDate: string;
190
192
  }>>;
191
- lastUpdated: string;
192
193
  aliases?: Record<string, string> | undefined;
193
194
  defaults?: Record<string, string> | undefined;
194
195
  }>;
@@ -328,3 +329,19 @@ export type ModelComparison = {
328
329
  };
329
330
  };
330
331
  };
332
+ export type ModelRoute = {
333
+ provider: string;
334
+ model: string;
335
+ reasoning: string;
336
+ confidence: number;
337
+ };
338
+ export type ModelRoutingOptions = {
339
+ /** Override the task classification */
340
+ forceTaskType?: TaskType;
341
+ /** Require specific performance characteristics */
342
+ requireFast?: boolean;
343
+ /** Require specific capability (reasoning, creativity, etc.) */
344
+ requireCapability?: string;
345
+ /** Fallback strategy if primary choice fails */
346
+ fallbackStrategy?: "fast" | "reasoning" | "auto";
347
+ };
@@ -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
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
2
  * Utility module types - extracted from utils module files
3
3
  */
4
- export {};
4
+ import { ErrorCategory, ErrorSeverity } from "../constants/enums.js";
5
5
  //# sourceMappingURL=utilities.js.map
@@ -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
- export declare enum ErrorCategory {
6
- VALIDATION = "validation",
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
@@ -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 type { LogEntry };
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 { TaskType } from "../types/taskClassificationTypes.js";
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
  */