@juspay/neurolink 7.53.2 → 7.53.3
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/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 +1 -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 +1 -0
- 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 +1 -0
- 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 +3 -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 +1 -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 +3 -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 +1 -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
|
@@ -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 "$lib/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/dist/mcp/index.d.ts
CHANGED
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
* Universal AI Development Platform with Extensible Plugin Architecture
|
|
4
4
|
* Implementation based on research blueprint
|
|
5
5
|
*/
|
|
6
|
-
export type { McpMetadata, DiscoveredMcp } from "../types/mcpTypes.js";
|
|
7
|
-
export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "../types/tools.js";
|
|
8
|
-
export { mcpLogger } from "../utils/logger.js";
|
|
9
|
-
export type { LogLevel } from "../utils/logger.js";
|
|
10
6
|
import type { McpMetadata } from "../types/mcpTypes.js";
|
|
7
|
+
export { mcpLogger } from "../utils/logger.js";
|
|
11
8
|
/**
|
|
12
9
|
* Initialize the MCP ecosystem - simplified
|
|
13
10
|
*/
|
package/dist/mcp/index.js
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP Ecosystem - Main Export
|
|
3
|
-
* Universal AI Development Platform with Extensible Plugin Architecture
|
|
4
|
-
* Implementation based on research blueprint
|
|
5
|
-
*/
|
|
6
|
-
// Core functionality exports
|
|
7
1
|
export { mcpLogger } from "../utils/logger.js";
|
|
8
2
|
/**
|
|
9
3
|
* Initialize the MCP ecosystem - simplified
|
|
@@ -3,41 +3,7 @@
|
|
|
3
3
|
* Simple initialization logic for mem0ai/oss integration
|
|
4
4
|
*/
|
|
5
5
|
import type { MemoryConfig } from "mem0ai/oss";
|
|
6
|
-
|
|
7
|
-
* Interface for mem0 Memory instance methods based on actual mem0ai/oss API
|
|
8
|
-
*/
|
|
9
|
-
export interface Mem0Memory {
|
|
10
|
-
search(query: string, config: {
|
|
11
|
-
userId?: string;
|
|
12
|
-
limit?: number;
|
|
13
|
-
}): Promise<{
|
|
14
|
-
results: Array<{
|
|
15
|
-
memory: string;
|
|
16
|
-
id: string;
|
|
17
|
-
}>;
|
|
18
|
-
}>;
|
|
19
|
-
add(messages: string, config: {
|
|
20
|
-
userId?: string;
|
|
21
|
-
metadata?: Record<string, unknown>;
|
|
22
|
-
}): Promise<{
|
|
23
|
-
results: Array<{
|
|
24
|
-
id: string;
|
|
25
|
-
memory: string;
|
|
26
|
-
}>;
|
|
27
|
-
}>;
|
|
28
|
-
get(memoryId: string): Promise<{
|
|
29
|
-
id: string;
|
|
30
|
-
memory: string;
|
|
31
|
-
} | null>;
|
|
32
|
-
update(memoryId: string, data: string): Promise<{
|
|
33
|
-
message: string;
|
|
34
|
-
}>;
|
|
35
|
-
delete(memoryId: string): Promise<{
|
|
36
|
-
message: string;
|
|
37
|
-
}>;
|
|
38
|
-
history(memoryId: string): Promise<unknown[]>;
|
|
39
|
-
reset(): Promise<void>;
|
|
40
|
-
}
|
|
6
|
+
import type { Mem0Memory } from "../types/utilities.js";
|
|
41
7
|
/**
|
|
42
8
|
* Initialize mem0 memory instance with configuration
|
|
43
9
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { NeuroLinkMiddleware } from "../../types/middlewareTypes.js";
|
|
2
2
|
import type { GuardrailsMiddlewareConfig } from "../../types/guardrails.js";
|
|
3
|
-
export type { GuardrailsMiddlewareConfig } from "../../types/guardrails.js";
|
|
4
3
|
/**
|
|
5
4
|
* Create Guardrails AI middleware for content filtering and policy enforcement
|
|
6
5
|
* @param config Configuration for the guardrails middleware
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BadWordsConfig, ContentFilteringResult, EvaluationActionResult, PrecallEvaluationConfig, PrecallEvaluationResult } from "../../types/guardrails.js";
|
|
2
2
|
import type { LanguageModelV1CallOptions } from "ai";
|
|
3
3
|
export declare const DEFAULT_EVALUATION_PROMPT = "\nEvaluate the following user input for safety and appropriateness. Respond ONLY with valid JSON:\n\n{\n \"overall\": \"safe|unsafe|suspicious|inappropriate\",\n \"safetyScore\": <1-10>,\n \"appropriatenessScore\": <1-10>,\n \"confidenceLevel\": <1-10>,\n \"issues\": [\n {\n \"category\": \"explicit_content|hate_speech|violence|personal_info|spam|other\",\n \"severity\": \"low|medium|high|critical\",\n \"description\": \"Brief description\"\n }\n ],\n \"suggestedAction\": \"allow|block|sanitize|warn\",\n \"reasoning\": \"Brief explanation\"\n}\n\nUser Input: \"{USER_INPUT}\"\n";
|
|
4
4
|
/**
|
|
@@ -40,19 +40,6 @@ export declare function createBlockedResponse(): {
|
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
42
|
export declare function createBlockedStream(): ReadableStream<any>;
|
|
43
|
-
/**
|
|
44
|
-
* Result from content filtering operation
|
|
45
|
-
*/
|
|
46
|
-
export interface ContentFilteringResult {
|
|
47
|
-
filteredText: string;
|
|
48
|
-
hasChanges: boolean;
|
|
49
|
-
appliedFilters: string[];
|
|
50
|
-
filteringStats: {
|
|
51
|
-
regexPatternsApplied: number;
|
|
52
|
-
stringFiltersApplied: number;
|
|
53
|
-
totalMatches: number;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
43
|
/**
|
|
57
44
|
* Apply content filtering using bad words configuration
|
|
58
45
|
* Handles both regex patterns and string lists with proper priority
|
|
@@ -3,97 +3,9 @@
|
|
|
3
3
|
* Provides centralized model data for models command system
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import { AIProviderName } from "../
|
|
6
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
7
7
|
import type { JsonValue } from "../types/common.js";
|
|
8
|
-
|
|
9
|
-
* Model capabilities interface
|
|
10
|
-
*/
|
|
11
|
-
export interface ModelCapabilities {
|
|
12
|
-
vision: boolean;
|
|
13
|
-
functionCalling: boolean;
|
|
14
|
-
codeGeneration: boolean;
|
|
15
|
-
reasoning: boolean;
|
|
16
|
-
multimodal: boolean;
|
|
17
|
-
streaming: boolean;
|
|
18
|
-
jsonMode: boolean;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Model pricing information
|
|
22
|
-
*/
|
|
23
|
-
export interface ModelPricing {
|
|
24
|
-
inputCostPer1K: number;
|
|
25
|
-
outputCostPer1K: number;
|
|
26
|
-
currency: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Model performance characteristics
|
|
30
|
-
*/
|
|
31
|
-
export interface ModelPerformance {
|
|
32
|
-
speed: "fast" | "medium" | "slow";
|
|
33
|
-
quality: "high" | "medium" | "low";
|
|
34
|
-
accuracy: "high" | "medium" | "low";
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Model limitations and constraints
|
|
38
|
-
*/
|
|
39
|
-
export interface ModelLimits {
|
|
40
|
-
maxContextTokens: number;
|
|
41
|
-
maxOutputTokens: number;
|
|
42
|
-
maxRequestsPerMinute?: number;
|
|
43
|
-
maxRequestsPerDay?: number;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Use case suitability scores (1-10 scale)
|
|
47
|
-
*/
|
|
48
|
-
export interface UseCaseSuitability {
|
|
49
|
-
coding: number;
|
|
50
|
-
creative: number;
|
|
51
|
-
analysis: number;
|
|
52
|
-
conversation: number;
|
|
53
|
-
reasoning: number;
|
|
54
|
-
translation: number;
|
|
55
|
-
summarization: number;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Complete model information
|
|
59
|
-
*/
|
|
60
|
-
export interface ModelInfo {
|
|
61
|
-
id: string;
|
|
62
|
-
name: string;
|
|
63
|
-
provider: AIProviderName;
|
|
64
|
-
description: string;
|
|
65
|
-
capabilities: ModelCapabilities;
|
|
66
|
-
pricing: ModelPricing;
|
|
67
|
-
performance: ModelPerformance;
|
|
68
|
-
limits: ModelLimits;
|
|
69
|
-
useCases: UseCaseSuitability;
|
|
70
|
-
aliases: string[];
|
|
71
|
-
deprecated: boolean;
|
|
72
|
-
isLocal: boolean;
|
|
73
|
-
releaseDate?: string;
|
|
74
|
-
category: "general" | "coding" | "creative" | "vision" | "reasoning";
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Model search filters
|
|
78
|
-
*/
|
|
79
|
-
export interface ModelSearchFilters {
|
|
80
|
-
provider?: AIProviderName | AIProviderName[];
|
|
81
|
-
capability?: keyof ModelCapabilities | (keyof ModelCapabilities)[];
|
|
82
|
-
useCase?: keyof UseCaseSuitability;
|
|
83
|
-
maxCost?: number;
|
|
84
|
-
minContextSize?: number;
|
|
85
|
-
maxContextSize?: number;
|
|
86
|
-
performance?: ModelPerformance["speed"] | ModelPerformance["quality"];
|
|
87
|
-
category?: ModelInfo["category"] | ModelInfo["category"][];
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Model search result with ranking
|
|
91
|
-
*/
|
|
92
|
-
export interface ModelSearchResult {
|
|
93
|
-
model: ModelInfo;
|
|
94
|
-
score: number;
|
|
95
|
-
matchReasons: string[];
|
|
96
|
-
}
|
|
8
|
+
import type { ModelInfo } from "../types/modelTypes.js";
|
|
97
9
|
/**
|
|
98
10
|
* Comprehensive model registry
|
|
99
11
|
*/
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* Provides centralized model data for models command system
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { DEFAULT_MODEL_ALIASES } from "../types/providers.js";
|
|
7
|
+
import { AIProviderName, OpenAIModels, GoogleAIModels, AnthropicModels, } from "../constants/enums.js";
|
|
7
8
|
/**
|
|
8
9
|
* Comprehensive model registry
|
|
9
10
|
*/
|
|
@@ -3,48 +3,8 @@
|
|
|
3
3
|
* Provides model resolution, search, and recommendation functionality
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import { AIProviderName } from "../types/index.js";
|
|
7
6
|
import type { JsonValue } from "../types/common.js";
|
|
8
|
-
import {
|
|
9
|
-
/**
|
|
10
|
-
* Model recommendation context
|
|
11
|
-
*/
|
|
12
|
-
export interface RecommendationContext {
|
|
13
|
-
useCase?: keyof UseCaseSuitability;
|
|
14
|
-
maxCost?: number;
|
|
15
|
-
minQuality?: "low" | "medium" | "high";
|
|
16
|
-
requireCapabilities?: (keyof ModelCapabilities)[];
|
|
17
|
-
excludeProviders?: AIProviderName[];
|
|
18
|
-
contextSize?: number;
|
|
19
|
-
preferLocal?: boolean;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Model recommendation result
|
|
23
|
-
*/
|
|
24
|
-
export interface ModelRecommendation {
|
|
25
|
-
model: ModelInfo;
|
|
26
|
-
score: number;
|
|
27
|
-
reasoning: string[];
|
|
28
|
-
alternatives: ModelInfo[];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Model comparison result
|
|
32
|
-
*/
|
|
33
|
-
export interface ModelComparison {
|
|
34
|
-
models: ModelInfo[];
|
|
35
|
-
comparison: {
|
|
36
|
-
capabilities: Record<keyof ModelCapabilities, ModelInfo[]>;
|
|
37
|
-
pricing: {
|
|
38
|
-
cheapest: ModelInfo;
|
|
39
|
-
mostExpensive: ModelInfo;
|
|
40
|
-
};
|
|
41
|
-
performance: Record<string, ModelInfo[]>;
|
|
42
|
-
contextSize: {
|
|
43
|
-
largest: ModelInfo;
|
|
44
|
-
smallest: ModelInfo;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
7
|
+
import type { ModelComparison, ModelInfo, ModelRecommendation, ModelSearchFilters, ModelSearchResult, RecommendationContext } from "../types/modelTypes.js";
|
|
48
8
|
/**
|
|
49
9
|
* Model resolver class with advanced search and recommendation functionality
|
|
50
10
|
*/
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Provides model resolution, search, and recommendation functionality
|
|
4
4
|
* Part of Phase 4.1 - Models Command System
|
|
5
5
|
*/
|
|
6
|
-
import { AIProviderName } from "../types/index.js";
|
|
7
6
|
import { MODEL_REGISTRY, MODEL_ALIASES, USE_CASE_RECOMMENDATIONS, getAllModels, getModelById, getModelsByProvider, getAvailableProviders, calculateCost, formatModelForDisplay, } from "./modelRegistry.js";
|
|
8
7
|
import { isNonNullObject } from "../utils/typeUtils.js";
|
|
9
8
|
/**
|
package/dist/neurolink.d.ts
CHANGED
|
@@ -5,57 +5,21 @@
|
|
|
5
5
|
* Enhanced AI provider system with natural MCP tool access.
|
|
6
6
|
* Uses real MCP infrastructure for tool discovery and execution.
|
|
7
7
|
*/
|
|
8
|
-
import type { TextGenerationOptions, TextGenerationResult } from "./types/index.js";
|
|
9
|
-
import { MCPToolRegistry } from "./mcp/toolRegistry.js";
|
|
8
|
+
import type { TextGenerationOptions, TextGenerationResult, ProviderStatus } from "./types/index.js";
|
|
10
9
|
import type { GenerateOptions, GenerateResult } from "./types/generateTypes.js";
|
|
11
10
|
import type { StreamOptions, StreamResult } from "./types/streamTypes.js";
|
|
12
|
-
import type { MCPServerInfo,
|
|
11
|
+
import type { MCPExecutableTool, MCPServerInfo, MCPStatus } from "./types/mcpTypes.js";
|
|
13
12
|
import type { ToolInfo } from "./types/tools.js";
|
|
14
13
|
import type { NeuroLinkEvents, TypedEventEmitter } from "./types/common.js";
|
|
15
14
|
import type { ToolExecutionContext, ToolExecutionSummary } from "./types/tools.js";
|
|
16
15
|
import type { JsonObject } from "./types/common.js";
|
|
17
16
|
import type { BatchOperationResult } from "./types/typeAliases.js";
|
|
18
|
-
import type {
|
|
17
|
+
import type { ChatMessage } from "./types/conversation.js";
|
|
19
18
|
import { ConversationMemoryManager } from "./core/conversationMemoryManager.js";
|
|
20
19
|
import { RedisConversationMemoryManager } from "./core/redisConversationMemoryManager.js";
|
|
21
|
-
import type { HITLConfig } from "./hitl/types.js";
|
|
22
20
|
import type { ExternalMCPServerInstance, ExternalMCPOperationResult, ExternalMCPToolInfo } from "./types/externalMcp.js";
|
|
23
21
|
import type { ObservabilityConfig } from "./types/observability.js";
|
|
24
|
-
|
|
25
|
-
* Configuration object for NeuroLink constructor.
|
|
26
|
-
*/
|
|
27
|
-
export interface NeurolinkConstructorConfig {
|
|
28
|
-
conversationMemory?: Partial<ConversationMemoryConfig>;
|
|
29
|
-
enableOrchestration?: boolean;
|
|
30
|
-
hitl?: HITLConfig;
|
|
31
|
-
toolRegistry?: MCPToolRegistry;
|
|
32
|
-
observability?: ObservabilityConfig;
|
|
33
|
-
}
|
|
34
|
-
export interface ProviderStatus {
|
|
35
|
-
provider: string;
|
|
36
|
-
status: "working" | "failed" | "not-configured";
|
|
37
|
-
configured: boolean;
|
|
38
|
-
authenticated: boolean;
|
|
39
|
-
error?: string;
|
|
40
|
-
responseTime?: number;
|
|
41
|
-
model?: string;
|
|
42
|
-
}
|
|
43
|
-
export interface MCPStatus {
|
|
44
|
-
mcpInitialized: boolean;
|
|
45
|
-
totalServers: number;
|
|
46
|
-
availableServers: number;
|
|
47
|
-
autoDiscoveredCount: number;
|
|
48
|
-
totalTools: number;
|
|
49
|
-
autoDiscoveredServers: MCPServerInfo[];
|
|
50
|
-
customToolsCount: number;
|
|
51
|
-
inMemoryServersCount: number;
|
|
52
|
-
externalMCPServersCount?: number;
|
|
53
|
-
externalMCPConnectedCount?: number;
|
|
54
|
-
externalMCPFailedCount?: number;
|
|
55
|
-
externalMCPServers?: MCPServerInfo[];
|
|
56
|
-
error?: string;
|
|
57
|
-
[key: string]: unknown;
|
|
58
|
-
}
|
|
22
|
+
import type { NeurolinkConstructorConfig } from "./types/configTypes.js";
|
|
59
23
|
export declare class NeuroLink {
|
|
60
24
|
private mcpInitialized;
|
|
61
25
|
private emitter;
|
package/dist/neurolink.js
CHANGED
|
@@ -14,6 +14,9 @@ catch {
|
|
|
14
14
|
// Environment variables should be set externally in production
|
|
15
15
|
}
|
|
16
16
|
import { AIProviderFactory } from "./core/factory.js";
|
|
17
|
+
import { isNonNullObject } from "./utils/typeUtils.js";
|
|
18
|
+
import { isZodSchema } from "./utils/schemaConversion.js";
|
|
19
|
+
import { AIProviderName } from "./constants/enums.js";
|
|
17
20
|
import { mcpLogger } from "./utils/logger.js";
|
|
18
21
|
import { SYSTEM_LIMITS } from "./core/constants.js";
|
|
19
22
|
import { NANOSECOND_TO_MS_DIVISOR, TOOL_TIMEOUTS, RETRY_ATTEMPTS, RETRY_DELAYS, CIRCUIT_BREAKER, CIRCUIT_BREAKER_RESET_MS, MEMORY_THRESHOLDS, PROVIDER_TIMEOUTS, PERFORMANCE_THRESHOLDS, } from "./constants/index.js";
|
|
@@ -42,9 +45,6 @@ import { directToolsServer } from "./mcp/servers/agent/directToolsServer.js";
|
|
|
42
45
|
import { ModelRouter } from "./utils/modelRouter.js";
|
|
43
46
|
import { BinaryTaskClassifier } from "./utils/taskClassifier.js";
|
|
44
47
|
import { initializeOpenTelemetry, shutdownOpenTelemetry, flushOpenTelemetry, getLangfuseHealthStatus, } from "./services/server/ai/observability/instrumentation.js";
|
|
45
|
-
import { isNonNullObject } from "./utils/typeUtils.js";
|
|
46
|
-
import { isZodSchema } from "./utils/schemaConversion.js";
|
|
47
|
-
// Core types imported from "./types/index.js"
|
|
48
48
|
export class NeuroLink {
|
|
49
49
|
mcpInitialized = false;
|
|
50
50
|
emitter = new EventEmitter();
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BedrockRuntimeClient } from "@aws-sdk/client-bedrock-runtime";
|
|
2
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
|
-
import type {
|
|
3
|
+
import type { EnhancedGenerateResult, TextGenerationOptions } from "../types/index.js";
|
|
4
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
5
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
6
|
import type { NeuroLink } from "../neurolink.js";
|
|
6
7
|
export declare class AmazonBedrockProvider extends BaseProvider {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BedrockRuntimeClient, ConverseCommand, ConverseStreamCommand, ImageFormat, } from "@aws-sdk/client-bedrock-runtime";
|
|
2
2
|
import { BedrockClient, ListFoundationModelsCommand, } from "@aws-sdk/client-bedrock";
|
|
3
3
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { convertZodToJsonSchema } from "../utils/schemaConversion.js";
|
|
6
7
|
import { buildMultimodalMessagesArray } from "../utils/messageBuilder.js";
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
8
8
|
import type { Schema, LanguageModelV1 } from "ai";
|
|
9
|
-
import
|
|
9
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
10
10
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
11
11
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
12
12
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This module provides a simplified SageMaker provider that extends BaseProvider
|
|
5
5
|
* and integrates with the NeuroLink ecosystem using existing patterns.
|
|
6
6
|
*/
|
|
7
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
7
8
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
8
9
|
import { logger } from "../utils/logger.js";
|
|
9
10
|
// SageMaker-specific imports
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AIProviderName, AnthropicModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ZodType, ZodTypeDef } from "zod";
|
|
2
2
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { AnthropicModels } from "../
|
|
3
|
+
import { AIProviderName, AnthropicModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LanguageModelV1 } from "ai";
|
|
2
2
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
export declare class AzureOpenAIProvider extends BaseProvider {
|
|
6
6
|
private apiKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAzure } from "@ai-sdk/azure";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
3
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
4
|
-
import { APIVersions } from "../
|
|
4
|
+
import { AIProviderName, APIVersions } from "../constants/enums.js";
|
|
5
5
|
import { validateApiKey, createAzureAPIKeyConfig, createAzureEndpointConfig, } from "../utils/providerConfig.js";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { buildMessagesArray, buildMultimodalMessagesArray, convertToCoreMessages, } from "../utils/messageBuilder.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Schema, type LanguageModelV1 } from "ai";
|
|
2
2
|
import type { ZodUnknownSchema } from "../types/typeAliases.js";
|
|
3
|
-
import
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
4
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
5
5
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
6
6
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createGoogleGenerativeAI } from "@ai-sdk/google";
|
|
2
2
|
import { streamText } from "ai";
|
|
3
|
-
import { GoogleAIModels } from "../
|
|
3
|
+
import { AIProviderName, GoogleAIModels } from "../constants/enums.js";
|
|
4
4
|
import { BaseProvider } from "../core/baseProvider.js";
|
|
5
5
|
import { logger } from "../utils/logger.js";
|
|
6
6
|
import { createTimeoutController, TimeoutError } from "../utils/timeout.js";
|