@juspay/neurolink 7.53.2 → 7.53.4
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/agent/directTools.d.ts +3 -3
- package/dist/cli/commands/config.d.ts +62 -62
- package/dist/cli/commands/setup-google-ai.js +1 -1
- package/dist/cli/loop/optionsSchema.d.ts +1 -8
- package/dist/cli/loop/optionsSchema.js +6 -1
- package/dist/cli/utils/envManager.d.ts +1 -11
- package/dist/cli/utils/interactiveSetup.d.ts +1 -1
- package/dist/cli/utils/interactiveSetup.js +1 -1
- package/dist/constants/enums.d.ts +108 -0
- package/dist/constants/enums.js +138 -0
- package/dist/core/baseProvider.d.ts +2 -1
- package/dist/core/baseProvider.js +20 -4
- package/dist/core/factory.d.ts +2 -1
- package/dist/core/factory.js +1 -0
- package/dist/factories/providerFactory.d.ts +2 -1
- package/dist/factories/providerFactory.js +1 -0
- package/dist/factories/providerRegistry.d.ts +1 -10
- package/dist/factories/providerRegistry.js +1 -4
- package/dist/hitl/hitlManager.d.ts +1 -1
- package/dist/hitl/index.d.ts +0 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +2 -1
- package/dist/lib/constants/enums.d.ts +108 -0
- package/dist/lib/constants/enums.js +139 -0
- package/dist/lib/core/baseProvider.d.ts +2 -1
- package/dist/lib/core/baseProvider.js +20 -4
- package/dist/lib/core/factory.d.ts +2 -1
- package/dist/lib/core/factory.js +1 -0
- package/dist/lib/factories/providerFactory.d.ts +2 -1
- package/dist/lib/factories/providerFactory.js +1 -0
- package/dist/lib/factories/providerRegistry.d.ts +1 -10
- package/dist/lib/factories/providerRegistry.js +1 -4
- package/dist/lib/hitl/hitlManager.d.ts +1 -1
- package/dist/lib/hitl/index.d.ts +0 -1
- package/dist/lib/index.d.ts +6 -4
- package/dist/lib/index.js +2 -1
- package/dist/lib/mcp/index.d.ts +1 -4
- package/dist/lib/mcp/index.js +0 -6
- package/dist/lib/memory/mem0Initializer.d.ts +1 -35
- package/dist/lib/middleware/builtin/guardrails.d.ts +0 -1
- package/dist/lib/middleware/utils/guardrailsUtils.d.ts +1 -14
- package/dist/lib/models/modelRegistry.d.ts +2 -90
- package/dist/lib/models/modelRegistry.js +2 -1
- package/dist/lib/models/modelResolver.d.ts +1 -41
- package/dist/lib/models/modelResolver.js +0 -1
- package/dist/lib/neurolink.d.ts +4 -40
- package/dist/lib/neurolink.js +5 -3
- package/dist/lib/providers/amazonBedrock.d.ts +2 -1
- package/dist/lib/providers/amazonBedrock.js +1 -0
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
- package/dist/lib/providers/amazonSagemaker.js +1 -0
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +1 -1
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +1 -1
- 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 +1 -1
- package/dist/lib/providers/googleVertex.d.ts +1 -1
- package/dist/lib/providers/googleVertex.js +1 -0
- package/dist/lib/providers/huggingFace.d.ts +1 -1
- package/dist/lib/providers/huggingFace.js +1 -0
- package/dist/lib/providers/index.d.ts +0 -1
- package/dist/lib/providers/litellm.d.ts +1 -1
- package/dist/lib/providers/litellm.js +1 -0
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/mistral.js +1 -0
- package/dist/lib/providers/ollama.d.ts +1 -1
- package/dist/lib/providers/ollama.js +1 -0
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +1 -1
- package/dist/lib/providers/openaiCompatible.d.ts +1 -1
- package/dist/lib/providers/openaiCompatible.js +1 -0
- package/dist/lib/proxy/proxyFetch.js +2 -0
- package/dist/lib/types/analytics.d.ts +13 -0
- package/dist/lib/types/cli.d.ts +253 -0
- package/dist/lib/types/configTypes.d.ts +14 -0
- package/dist/lib/types/configTypes.js +1 -0
- package/dist/lib/types/fileTypes.d.ts +4 -4
- package/dist/lib/types/generateTypes.d.ts +4 -1
- package/dist/lib/types/generateTypes.js +1 -1
- package/dist/lib/types/guardrails.d.ts +13 -0
- package/dist/{hitl/types.d.ts → lib/types/hitlTypes.d.ts} +18 -18
- package/dist/lib/{hitl/types.js → types/hitlTypes.js} +1 -1
- package/dist/lib/types/index.d.ts +3 -1
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/mcpTypes.d.ts +16 -12
- package/dist/lib/types/modelTypes.d.ts +113 -25
- package/dist/lib/types/modelTypes.js +1 -0
- package/dist/lib/types/observability.d.ts +6 -6
- package/dist/lib/types/providers.d.ts +43 -93
- package/dist/lib/types/providers.js +1 -118
- package/dist/lib/types/sdkTypes.d.ts +1 -1
- package/dist/lib/types/streamTypes.d.ts +2 -1
- package/dist/lib/types/streamTypes.js +1 -1
- package/dist/lib/types/taskClassificationTypes.d.ts +8 -8
- package/dist/lib/types/universalProviderOptions.d.ts +12 -12
- package/dist/lib/types/utilities.d.ts +48 -0
- package/dist/lib/utils/errorHandling.d.ts +2 -2
- package/dist/lib/utils/modelRouter.d.ts +4 -4
- package/dist/lib/utils/providerHealth.d.ts +5 -23
- package/dist/lib/utils/providerHealth.js +1 -1
- package/dist/lib/utils/providerSetupMessages.js +1 -1
- package/dist/lib/utils/providerUtils.js +1 -0
- package/dist/mcp/index.d.ts +1 -4
- package/dist/mcp/index.js +0 -6
- package/dist/memory/mem0Initializer.d.ts +1 -35
- package/dist/middleware/builtin/guardrails.d.ts +0 -1
- package/dist/middleware/utils/guardrailsUtils.d.ts +1 -14
- package/dist/models/modelRegistry.d.ts +2 -90
- package/dist/models/modelRegistry.js +2 -1
- package/dist/models/modelResolver.d.ts +1 -41
- package/dist/models/modelResolver.js +0 -1
- package/dist/neurolink.d.ts +4 -40
- package/dist/neurolink.js +5 -3
- package/dist/providers/amazonBedrock.d.ts +2 -1
- package/dist/providers/amazonBedrock.js +1 -0
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/amazonSagemaker.js +1 -0
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +1 -1
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +1 -1
- 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 +1 -1
- package/dist/providers/googleVertex.d.ts +1 -1
- package/dist/providers/googleVertex.js +1 -0
- package/dist/providers/huggingFace.d.ts +1 -1
- package/dist/providers/huggingFace.js +1 -0
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/litellm.d.ts +1 -1
- package/dist/providers/litellm.js +1 -0
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/mistral.js +1 -0
- package/dist/providers/ollama.d.ts +1 -1
- package/dist/providers/ollama.js +1 -0
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +1 -1
- package/dist/providers/openaiCompatible.d.ts +1 -1
- package/dist/providers/openaiCompatible.js +1 -0
- package/dist/proxy/proxyFetch.js +2 -0
- package/dist/types/analytics.d.ts +13 -0
- package/dist/types/cli.d.ts +253 -0
- package/dist/types/configTypes.d.ts +14 -0
- package/dist/types/configTypes.js +1 -0
- package/dist/types/fileTypes.d.ts +4 -4
- package/dist/types/generateTypes.d.ts +4 -1
- package/dist/types/generateTypes.js +1 -1
- package/dist/types/guardrails.d.ts +13 -0
- package/dist/{lib/hitl/types.d.ts → types/hitlTypes.d.ts} +18 -18
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.js +4 -0
- package/dist/types/mcpTypes.d.ts +16 -12
- package/dist/types/modelTypes.d.ts +113 -25
- package/dist/types/modelTypes.js +1 -0
- package/dist/types/observability.d.ts +6 -6
- package/dist/types/providers.d.ts +43 -93
- package/dist/types/providers.js +1 -118
- package/dist/types/sdkTypes.d.ts +1 -1
- package/dist/types/streamTypes.d.ts +2 -1
- package/dist/types/streamTypes.js +1 -1
- package/dist/types/taskClassificationTypes.d.ts +8 -8
- package/dist/types/universalProviderOptions.d.ts +12 -12
- package/dist/types/utilities.d.ts +48 -0
- package/dist/utils/errorHandling.d.ts +2 -2
- package/dist/utils/modelRouter.d.ts +4 -4
- package/dist/utils/providerHealth.d.ts +5 -23
- package/dist/utils/providerHealth.js +1 -1
- package/dist/utils/providerSetupMessages.js +1 -1
- package/dist/utils/providerUtils.js +1 -0
- package/package.json +1 -1
- /package/dist/{hitl/types.js → types/hitlTypes.js} +0 -0
|
@@ -7,7 +7,7 @@ import type { BaseContext, ContextConfig } from "./contextTypes.js";
|
|
|
7
7
|
* Base configuration interface for all AI providers
|
|
8
8
|
* Uses Parameter Object Pattern for flexible, extensible configuration
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export type UniversalProviderOptions = {
|
|
11
11
|
prompt?: string;
|
|
12
12
|
model?: string;
|
|
13
13
|
temperature?: number;
|
|
@@ -19,7 +19,7 @@ export interface UniversalProviderOptions {
|
|
|
19
19
|
contextConfig?: Partial<ContextConfig>;
|
|
20
20
|
metadata?: Record<string, unknown>;
|
|
21
21
|
extensionOptions?: Record<string, unknown>;
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
/**
|
|
24
24
|
* Generic provider options (without providerType)
|
|
25
25
|
*/
|
|
@@ -28,28 +28,28 @@ export type GenericProviderOptions = Omit<UniversalProviderOptions, "providerTyp
|
|
|
28
28
|
* Provider-specific configuration extensions
|
|
29
29
|
* Discriminated union pattern for type-safe provider configs
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export type OpenAIProviderOptions = UniversalProviderOptions & {
|
|
32
32
|
providerType: "openai";
|
|
33
33
|
organization?: string;
|
|
34
34
|
seed?: number;
|
|
35
35
|
topP?: number;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
36
|
+
};
|
|
37
|
+
export type GoogleAIProviderOptions = UniversalProviderOptions & {
|
|
38
38
|
providerType: "google-ai";
|
|
39
39
|
topK?: number;
|
|
40
40
|
candidateCount?: number;
|
|
41
41
|
stopSequences?: string[];
|
|
42
|
-
}
|
|
43
|
-
export
|
|
42
|
+
};
|
|
43
|
+
export type AnthropicProviderOptions = UniversalProviderOptions & {
|
|
44
44
|
providerType: "anthropic";
|
|
45
45
|
topK?: number;
|
|
46
46
|
stopSequences?: string[];
|
|
47
|
-
}
|
|
48
|
-
export
|
|
47
|
+
};
|
|
48
|
+
export type BedrockProviderOptions = UniversalProviderOptions & {
|
|
49
49
|
providerType: "bedrock";
|
|
50
50
|
inferenceProfileArn?: string;
|
|
51
51
|
region?: string;
|
|
52
|
-
}
|
|
52
|
+
};
|
|
53
53
|
/**
|
|
54
54
|
* Discriminated union for type-safe provider configuration
|
|
55
55
|
* Enables compile-time type checking for provider-specific options
|
|
@@ -59,12 +59,12 @@ export type ProviderSpecificOptions = OpenAIProviderOptions | GoogleAIProviderOp
|
|
|
59
59
|
* Factory configuration interface
|
|
60
60
|
* Supports both universal and provider-specific parameters
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type ProviderFactoryConfig = {
|
|
63
63
|
providerName: string;
|
|
64
64
|
modelName?: string;
|
|
65
65
|
options?: UniversalProviderOptions | ProviderSpecificOptions;
|
|
66
66
|
enableMCP?: boolean;
|
|
67
|
-
}
|
|
67
|
+
};
|
|
68
68
|
/**
|
|
69
69
|
* Parameter normalization utilities
|
|
70
70
|
* Converts between different parameter formats for backward compatibility
|
|
@@ -27,3 +27,51 @@ export type APIValidationResult = {
|
|
|
27
27
|
errorType?: "missing" | "format" | "config";
|
|
28
28
|
error?: string;
|
|
29
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* Parsed proxy configuration
|
|
32
|
+
*/
|
|
33
|
+
export type ParsedProxyConfig = {
|
|
34
|
+
protocol: string;
|
|
35
|
+
hostname: string;
|
|
36
|
+
port: number;
|
|
37
|
+
auth?: {
|
|
38
|
+
username: string;
|
|
39
|
+
password: string;
|
|
40
|
+
};
|
|
41
|
+
cleanUrl: string;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Interface for mem0 Memory instance methods based on actual mem0ai/oss API
|
|
45
|
+
*/
|
|
46
|
+
export type Mem0Memory = {
|
|
47
|
+
search(query: string, config: {
|
|
48
|
+
userId?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
}): Promise<{
|
|
51
|
+
results: Array<{
|
|
52
|
+
memory: string;
|
|
53
|
+
id: string;
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
56
|
+
add(messages: string, config: {
|
|
57
|
+
userId?: string;
|
|
58
|
+
metadata?: Record<string, unknown>;
|
|
59
|
+
}): Promise<{
|
|
60
|
+
results: Array<{
|
|
61
|
+
id: string;
|
|
62
|
+
memory: string;
|
|
63
|
+
}>;
|
|
64
|
+
}>;
|
|
65
|
+
get(memoryId: string): Promise<{
|
|
66
|
+
id: string;
|
|
67
|
+
memory: string;
|
|
68
|
+
} | null>;
|
|
69
|
+
update(memoryId: string, data: string): Promise<{
|
|
70
|
+
message: string;
|
|
71
|
+
}>;
|
|
72
|
+
delete(memoryId: string): Promise<{
|
|
73
|
+
message: string;
|
|
74
|
+
}>;
|
|
75
|
+
history(memoryId: string): Promise<unknown[]>;
|
|
76
|
+
reset(): Promise<void>;
|
|
77
|
+
};
|
|
@@ -18,7 +18,7 @@ export declare enum ErrorSeverity {
|
|
|
18
18
|
HIGH = "high",
|
|
19
19
|
CRITICAL = "critical"
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type StructuredError = {
|
|
22
22
|
code: string;
|
|
23
23
|
message: string;
|
|
24
24
|
category: ErrorCategory;
|
|
@@ -29,7 +29,7 @@ export interface StructuredError {
|
|
|
29
29
|
timestamp: Date;
|
|
30
30
|
toolName?: string;
|
|
31
31
|
serverId?: string;
|
|
32
|
-
}
|
|
32
|
+
};
|
|
33
33
|
export declare const ERROR_CODES: {
|
|
34
34
|
readonly TOOL_NOT_FOUND: "TOOL_NOT_FOUND";
|
|
35
35
|
readonly TOOL_EXECUTION_FAILED: "TOOL_EXECUTION_FAILED";
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* Routes tasks to optimal models based on classification and requirements
|
|
4
4
|
*/
|
|
5
5
|
import type { TaskType } from "../types/taskClassificationTypes.js";
|
|
6
|
-
export
|
|
6
|
+
export type ModelRoute = {
|
|
7
7
|
provider: string;
|
|
8
8
|
model: string;
|
|
9
9
|
reasoning: string;
|
|
10
10
|
confidence: number;
|
|
11
|
-
}
|
|
12
|
-
export
|
|
11
|
+
};
|
|
12
|
+
export type ModelRoutingOptions = {
|
|
13
13
|
/** Override the task classification */
|
|
14
14
|
forceTaskType?: TaskType;
|
|
15
15
|
/** Require specific performance characteristics */
|
|
@@ -18,7 +18,7 @@ export interface ModelRoutingOptions {
|
|
|
18
18
|
requireCapability?: string;
|
|
19
19
|
/** Fallback strategy if primary choice fails */
|
|
20
20
|
fallbackStrategy?: "fast" | "reasoning" | "auto";
|
|
21
|
-
}
|
|
21
|
+
};
|
|
22
22
|
/**
|
|
23
23
|
* Model configurations for different task types and providers
|
|
24
24
|
*/
|
|
@@ -2,26 +2,8 @@
|
|
|
2
2
|
* Provider Health Checking System
|
|
3
3
|
* Prevents 500 errors by validating provider availability and configuration
|
|
4
4
|
*/
|
|
5
|
-
import { AIProviderName } from "../
|
|
6
|
-
|
|
7
|
-
provider: AIProviderName;
|
|
8
|
-
isHealthy: boolean;
|
|
9
|
-
isConfigured: boolean;
|
|
10
|
-
hasApiKey: boolean;
|
|
11
|
-
lastChecked: Date;
|
|
12
|
-
error?: string;
|
|
13
|
-
warning?: string;
|
|
14
|
-
responseTime?: number;
|
|
15
|
-
configurationIssues: string[];
|
|
16
|
-
recommendations: string[];
|
|
17
|
-
}
|
|
18
|
-
export interface ProviderHealthCheckOptions {
|
|
19
|
-
timeout?: number;
|
|
20
|
-
includeConnectivityTest?: boolean;
|
|
21
|
-
includeModelValidation?: boolean;
|
|
22
|
-
cacheResults?: boolean;
|
|
23
|
-
maxCacheAge?: number;
|
|
24
|
-
}
|
|
5
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
6
|
+
import type { ProviderHealthCheckOptions, ProviderHealthStatusOptions } from "../types/providers.js";
|
|
25
7
|
export declare class ProviderHealthChecker {
|
|
26
8
|
private static healthCache;
|
|
27
9
|
private static readonly DEFAULT_TIMEOUT;
|
|
@@ -35,7 +17,7 @@ export declare class ProviderHealthChecker {
|
|
|
35
17
|
/**
|
|
36
18
|
* Comprehensive health check for a provider
|
|
37
19
|
*/
|
|
38
|
-
static checkProviderHealth(providerName: AIProviderName, options?: ProviderHealthCheckOptions): Promise<
|
|
20
|
+
static checkProviderHealth(providerName: AIProviderName, options?: ProviderHealthCheckOptions): Promise<ProviderHealthStatusOptions>;
|
|
39
21
|
/**
|
|
40
22
|
* Check environment configuration for a provider
|
|
41
23
|
*/
|
|
@@ -196,11 +178,11 @@ export declare class ProviderHealthChecker {
|
|
|
196
178
|
/**
|
|
197
179
|
* Get health status for all registered providers
|
|
198
180
|
*/
|
|
199
|
-
static checkAllProvidersHealth(options?: ProviderHealthCheckOptions): Promise<
|
|
181
|
+
static checkAllProvidersHealth(options?: ProviderHealthCheckOptions): Promise<ProviderHealthStatusOptions[]>;
|
|
200
182
|
/**
|
|
201
183
|
* Get a summary of provider health
|
|
202
184
|
*/
|
|
203
|
-
static getHealthSummary(healthStatuses:
|
|
185
|
+
static getHealthSummary(healthStatuses: ProviderHealthStatusOptions[]): {
|
|
204
186
|
total: number;
|
|
205
187
|
healthy: number;
|
|
206
188
|
configured: number;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Prevents 500 errors by validating provider availability and configuration
|
|
4
4
|
*/
|
|
5
5
|
import { logger } from "./logger.js";
|
|
6
|
-
import { AIProviderName, OpenAIModels, GoogleAIModels, AnthropicModels, BedrockModels, } from "../
|
|
6
|
+
import { AIProviderName, OpenAIModels, GoogleAIModels, AnthropicModels, BedrockModels, } from "../constants/enums.js";
|
|
7
7
|
import { API_KEY_LENGTHS, PROJECT_ID_FORMAT } from "./providerConfig.js";
|
|
8
8
|
import { basename } from "path";
|
|
9
9
|
import { createProxyFetch } from "../proxy/proxyFetch.js";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Enhanced Provider Setup Messages
|
|
3
3
|
* Provides detailed setup instructions for AI providers
|
|
4
4
|
*/
|
|
5
|
-
import { OpenAIModels, GoogleAIModels, AnthropicModels, APIVersions, } from "../
|
|
5
|
+
import { OpenAIModels, GoogleAIModels, AnthropicModels, APIVersions, } from "../constants/enums.js";
|
|
6
6
|
/**
|
|
7
7
|
* Generate enhanced error message with setup instructions
|
|
8
8
|
*/
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { AIProviderFactory } from "../core/factory.js";
|
|
6
6
|
import { logger } from "./logger.js";
|
|
7
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
7
8
|
import { ProviderHealthChecker } from "./providerHealth.js";
|
|
8
9
|
import { API_KEY_FORMATS, API_KEY_LENGTHS, PROJECT_ID_FORMAT, } from "./providerConfig.js";
|
|
9
10
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "7.53.
|
|
3
|
+
"version": "7.53.4",
|
|
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",
|
|
File without changes
|