@juspay/neurolink 7.53.1 → 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 +4 -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 +7 -4
- package/dist/index.js +3 -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 +7 -4
- package/dist/lib/index.js +3 -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/session/globalSessionState.js +1 -26
- 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/observabilityHelpers.d.ts +27 -0
- package/dist/lib/utils/observabilityHelpers.js +48 -0
- 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/session/globalSessionState.js +1 -26
- 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/observabilityHelpers.d.ts +27 -0
- package/dist/utils/observabilityHelpers.js +47 -0
- 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
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Core HITL configuration interface
|
|
10
10
|
* Controls how the HITL system behaves and what tools require confirmation
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type HITLConfig = {
|
|
13
13
|
/** Master enable/disable switch for HITL functionality */
|
|
14
14
|
enabled: boolean;
|
|
15
15
|
/** Keywords that trigger HITL confirmation (e.g., "delete", "remove", "drop") */
|
|
@@ -26,12 +26,12 @@ export interface HITLConfig {
|
|
|
26
26
|
auditLogging?: boolean;
|
|
27
27
|
/** Advanced custom rules for complex tool scenarios (default: []) */
|
|
28
28
|
customRules?: HITLRule[];
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
/**
|
|
31
31
|
* Custom rule for advanced HITL scenarios
|
|
32
32
|
* Allows enterprises to define complex conditions for when tools require confirmation
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type HITLRule = {
|
|
35
35
|
/** Human-readable name for the rule */
|
|
36
36
|
name: string;
|
|
37
37
|
/** Function that determines if a tool requires confirmation */
|
|
@@ -40,12 +40,12 @@ export interface HITLRule {
|
|
|
40
40
|
requiresConfirmation: boolean;
|
|
41
41
|
/** Custom message to show users when this rule is triggered */
|
|
42
42
|
customMessage?: string;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
/**
|
|
45
45
|
* Internal confirmation request tracking
|
|
46
46
|
* Used by HITLManager to track pending confirmations
|
|
47
47
|
*/
|
|
48
|
-
export
|
|
48
|
+
export type ConfirmationRequest = {
|
|
49
49
|
/** Unique identifier for this confirmation request */
|
|
50
50
|
confirmationId: string;
|
|
51
51
|
/** Name of the tool requiring confirmation */
|
|
@@ -60,12 +60,12 @@ export interface ConfirmationRequest {
|
|
|
60
60
|
resolve: (result: ConfirmationResult) => void;
|
|
61
61
|
/** Promise reject function */
|
|
62
62
|
reject: (error: Error) => void;
|
|
63
|
-
}
|
|
63
|
+
};
|
|
64
64
|
/**
|
|
65
65
|
* Result of a confirmation request
|
|
66
66
|
* Contains user decision and potentially modified arguments
|
|
67
67
|
*/
|
|
68
|
-
export
|
|
68
|
+
export type ConfirmationResult = {
|
|
69
69
|
/** Whether the user approved the tool execution */
|
|
70
70
|
approved: boolean;
|
|
71
71
|
/** Optional reason for rejection (if approved is false) */
|
|
@@ -74,12 +74,12 @@ export interface ConfirmationResult {
|
|
|
74
74
|
modifiedArguments?: unknown;
|
|
75
75
|
/** Time taken for user to respond in milliseconds */
|
|
76
76
|
responseTime: number;
|
|
77
|
-
}
|
|
77
|
+
};
|
|
78
78
|
/**
|
|
79
79
|
* Event payload for confirmation requests
|
|
80
80
|
* Sent to frontends via EventEmitter when tool needs approval
|
|
81
81
|
*/
|
|
82
|
-
export
|
|
82
|
+
export type ConfirmationRequestEvent = {
|
|
83
83
|
type: "hitl:confirmation-request";
|
|
84
84
|
payload: {
|
|
85
85
|
/** Unique ID for tracking this request */
|
|
@@ -108,12 +108,12 @@ export interface ConfirmationRequestEvent {
|
|
|
108
108
|
/** Whether user can modify arguments */
|
|
109
109
|
allowModification: boolean;
|
|
110
110
|
};
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
/**
|
|
113
113
|
* Event payload for confirmation responses
|
|
114
114
|
* Sent from frontends back to HITLManager with user decision
|
|
115
115
|
*/
|
|
116
|
-
export
|
|
116
|
+
export type ConfirmationResponseEvent = {
|
|
117
117
|
type: "hitl:confirmation-response";
|
|
118
118
|
payload: {
|
|
119
119
|
/** Matching confirmation ID from the request */
|
|
@@ -134,12 +134,12 @@ export interface ConfirmationResponseEvent {
|
|
|
134
134
|
userId?: string;
|
|
135
135
|
};
|
|
136
136
|
};
|
|
137
|
-
}
|
|
137
|
+
};
|
|
138
138
|
/**
|
|
139
139
|
* Event payload for confirmation timeouts
|
|
140
140
|
* Emitted when user doesn't respond within timeout period
|
|
141
141
|
*/
|
|
142
|
-
export
|
|
142
|
+
export type ConfirmationTimeoutEvent = {
|
|
143
143
|
type: "hitl:timeout";
|
|
144
144
|
payload: {
|
|
145
145
|
/** Confirmation ID that timed out */
|
|
@@ -149,12 +149,12 @@ export interface ConfirmationTimeoutEvent {
|
|
|
149
149
|
/** Timeout duration in milliseconds */
|
|
150
150
|
timeout: number;
|
|
151
151
|
};
|
|
152
|
-
}
|
|
152
|
+
};
|
|
153
153
|
/**
|
|
154
154
|
* HITL audit log entry
|
|
155
155
|
* Used for compliance and debugging purposes
|
|
156
156
|
*/
|
|
157
|
-
export
|
|
157
|
+
export type HITLAuditLog = {
|
|
158
158
|
/** ISO timestamp of the event */
|
|
159
159
|
timestamp: string;
|
|
160
160
|
/** Type of HITL event */
|
|
@@ -175,12 +175,12 @@ export interface HITLAuditLog {
|
|
|
175
175
|
userAgent?: string;
|
|
176
176
|
/** Response time in milliseconds (if applicable) */
|
|
177
177
|
responseTime?: number;
|
|
178
|
-
}
|
|
178
|
+
};
|
|
179
179
|
/**
|
|
180
180
|
* HITL statistics interface
|
|
181
181
|
* Provides metrics about HITL usage for monitoring
|
|
182
182
|
*/
|
|
183
|
-
export
|
|
183
|
+
export type HITLStatistics = {
|
|
184
184
|
/** Total number of confirmation requests made */
|
|
185
185
|
totalRequests: number;
|
|
186
186
|
/** Number of pending confirmations */
|
|
@@ -193,4 +193,4 @@ export interface HITLStatistics {
|
|
|
193
193
|
rejectedRequests: number;
|
|
194
194
|
/** Number of timed out requests */
|
|
195
195
|
timedOutRequests: number;
|
|
196
|
-
}
|
|
196
|
+
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export type { ToolArgs, ToolContext, ToolResult, ToolDefinition, SimpleTool, Ava
|
|
|
12
12
|
export type { AISDKModel, ProviderError, AIModelProviderConfig, } from "./providers.js";
|
|
13
13
|
export type { BaseCommandArgs, GenerateCommandArgs, MCPCommandArgs, ModelsCommandArgs, CommandResult, GenerateResult, StreamChunk, } from "./cli.js";
|
|
14
14
|
export type { TaskType, TaskClassification, ClassificationScores, ClassificationStats, ClassificationValidation, } from "./taskClassificationTypes.js";
|
|
15
|
-
export type { MCPTransportType, MCPServerConnectionStatus, MCPServerCategory, MCPServerStatus, MCPDiscoveredServer, MCPConnectedServer, MCPToolInfo, MCPExecutableTool, MCPServerMetadata, MCPToolMetadata, MCPServerRegistryEntry, NeuroLinkMCPTool, NeuroLinkMCPServer, NeuroLinkExecutionContext, MCPServerConfig, DiscoveredMcp, McpMetadata,
|
|
15
|
+
export type { MCPTransportType, MCPServerConnectionStatus, MCPServerCategory, MCPServerStatus, MCPDiscoveredServer, MCPConnectedServer, MCPToolInfo, MCPExecutableTool, MCPServerMetadata, MCPToolMetadata, MCPServerRegistryEntry, NeuroLinkMCPTool, NeuroLinkMCPServer, NeuroLinkExecutionContext, MCPServerConfig, DiscoveredMcp, McpMetadata, ToolDiscoveryResult, ExternalToolExecutionOptions, ToolValidationResult, ToolRegistryEvents, CircuitBreakerState, CircuitBreakerConfig, CircuitBreakerStats, CircuitBreakerEvents, McpRegistry, MCPClientResult, FlexibleValidationResult, } from "./mcpTypes.js";
|
|
16
16
|
export type { ExternalMCPServerInstance, ExternalMCPServerStatus, ExternalMCPToolInfo, ExternalMCPServerHealth, ExternalMCPConfigValidation, ExternalMCPOperationResult, ExternalMCPToolContext, ExternalMCPToolResult, ExternalMCPServerEvents, ExternalMCPManagerConfig, } from "./externalMcp.js";
|
|
17
17
|
export type { ModelCapability, ModelUseCase, ModelFilter, ModelResolutionContext, ModelStats, ModelPricing, } from "./providers.js";
|
|
18
18
|
export type { DomainType, DomainConfig, DomainTemplate, DomainConfigOptions, DomainEvaluationCriteria, DomainValidationRule, } from "./domainTypes.js";
|
|
@@ -26,5 +26,7 @@ export * from "./modelTypes.js";
|
|
|
26
26
|
export * from "./serviceTypes.js";
|
|
27
27
|
export * from "./evaluationProviders.js";
|
|
28
28
|
export * from "./sdkTypes.js";
|
|
29
|
+
export * from "./utilities.js";
|
|
30
|
+
export * from "./middlewareTypes.js";
|
|
29
31
|
export * from "./fileTypes.js";
|
|
30
32
|
export * from "./content.js";
|
package/dist/types/index.js
CHANGED
|
@@ -25,6 +25,10 @@ export * from "./serviceTypes.js";
|
|
|
25
25
|
export * from "./evaluationProviders.js";
|
|
26
26
|
// SDK Types - Core types for external developers
|
|
27
27
|
export * from "./sdkTypes.js";
|
|
28
|
+
// Utilities Types - Utility module types (selective export to avoid conflicts)
|
|
29
|
+
export * from "./utilities.js";
|
|
30
|
+
// Middleware Types - Middleware system types
|
|
31
|
+
export * from "./middlewareTypes.js";
|
|
28
32
|
// File detection and processing types
|
|
29
33
|
export * from "./fileTypes.js";
|
|
30
34
|
// Content types for multimodal support
|
package/dist/types/mcpTypes.d.ts
CHANGED
|
@@ -163,6 +163,22 @@ export type MCPToolMetadata = {
|
|
|
163
163
|
* MCP Server Registry Entry - For Object.entries() usage
|
|
164
164
|
*/
|
|
165
165
|
export type MCPServerRegistryEntry = [string, MCPServerInfo];
|
|
166
|
+
export type MCPStatus = {
|
|
167
|
+
mcpInitialized: boolean;
|
|
168
|
+
totalServers: number;
|
|
169
|
+
availableServers: number;
|
|
170
|
+
autoDiscoveredCount: number;
|
|
171
|
+
totalTools: number;
|
|
172
|
+
autoDiscoveredServers: MCPServerInfo[];
|
|
173
|
+
customToolsCount: number;
|
|
174
|
+
inMemoryServersCount: number;
|
|
175
|
+
externalMCPServersCount?: number;
|
|
176
|
+
externalMCPConnectedCount?: number;
|
|
177
|
+
externalMCPFailedCount?: number;
|
|
178
|
+
externalMCPServers?: MCPServerInfo[];
|
|
179
|
+
error?: string;
|
|
180
|
+
[key: string]: unknown;
|
|
181
|
+
};
|
|
166
182
|
/**
|
|
167
183
|
* Call record for circuit breaker statistics tracking
|
|
168
184
|
* Extracted from mcpCircuitBreaker.ts for centralized type management
|
|
@@ -342,18 +358,6 @@ export type McpMetadata = {
|
|
|
342
358
|
repository?: string;
|
|
343
359
|
category?: string;
|
|
344
360
|
};
|
|
345
|
-
/**
|
|
346
|
-
* Provider status information
|
|
347
|
-
* Moved from src/lib/mcp/contracts/mcpContract.ts
|
|
348
|
-
*/
|
|
349
|
-
export type ProviderStatus = {
|
|
350
|
-
available: boolean;
|
|
351
|
-
lastCheck: number;
|
|
352
|
-
reason?: string;
|
|
353
|
-
model?: string;
|
|
354
|
-
cost?: number;
|
|
355
|
-
latencyMs?: number;
|
|
356
|
-
};
|
|
357
361
|
/**
|
|
358
362
|
* Tool discovery result
|
|
359
363
|
* Moved from src/lib/mcp/toolDiscoveryService.ts
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import type { JsonValue } from "./common.js";
|
|
7
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
7
8
|
/**
|
|
8
9
|
* Model performance tier definition
|
|
9
10
|
*/
|
|
@@ -200,43 +201,130 @@ export type DynamicModelConfig = z.infer<typeof ModelConfigSchema>;
|
|
|
200
201
|
*/
|
|
201
202
|
export type ModelRegistry = z.infer<typeof ModelRegistrySchema>;
|
|
202
203
|
/**
|
|
203
|
-
* Model
|
|
204
|
+
* Model capabilities interface
|
|
204
205
|
*/
|
|
205
|
-
export type
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
206
|
+
export type ModelCapabilities = {
|
|
207
|
+
vision: boolean;
|
|
208
|
+
functionCalling: boolean;
|
|
209
|
+
codeGeneration: boolean;
|
|
210
|
+
reasoning: boolean;
|
|
211
|
+
multimodal: boolean;
|
|
212
|
+
streaming: boolean;
|
|
213
|
+
jsonMode: boolean;
|
|
211
214
|
};
|
|
212
215
|
/**
|
|
213
|
-
* Model
|
|
216
|
+
* Model pricing information
|
|
214
217
|
*/
|
|
215
|
-
export type
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
218
|
+
export type ModelPricingInfo = {
|
|
219
|
+
inputCostPer1K: number;
|
|
220
|
+
outputCostPer1K: number;
|
|
221
|
+
currency: string;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Model performance characteristics
|
|
225
|
+
*/
|
|
226
|
+
export type ModelPerformance = {
|
|
227
|
+
speed: "fast" | "medium" | "slow";
|
|
228
|
+
quality: "high" | "medium" | "low";
|
|
229
|
+
accuracy: "high" | "medium" | "low";
|
|
219
230
|
};
|
|
220
231
|
/**
|
|
221
|
-
* Model
|
|
232
|
+
* Model limitations and constraints
|
|
222
233
|
*/
|
|
223
|
-
export type
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
234
|
+
export type ModelLimits = {
|
|
235
|
+
maxContextTokens: number;
|
|
236
|
+
maxOutputTokens: number;
|
|
237
|
+
maxRequestsPerMinute?: number;
|
|
238
|
+
maxRequestsPerDay?: number;
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Use case suitability scores (1-10 scale)
|
|
242
|
+
*/
|
|
243
|
+
export type UseCaseSuitability = {
|
|
244
|
+
coding: number;
|
|
245
|
+
creative: number;
|
|
246
|
+
analysis: number;
|
|
247
|
+
conversation: number;
|
|
248
|
+
reasoning: number;
|
|
249
|
+
translation: number;
|
|
250
|
+
summarization: number;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Complete model information
|
|
254
|
+
*/
|
|
255
|
+
export type ModelInfo = {
|
|
256
|
+
id: string;
|
|
257
|
+
name: string;
|
|
258
|
+
provider: AIProviderName;
|
|
259
|
+
description: string;
|
|
260
|
+
capabilities: ModelCapabilities;
|
|
261
|
+
pricing: ModelPricingInfo;
|
|
262
|
+
performance: ModelPerformance;
|
|
263
|
+
limits: ModelLimits;
|
|
264
|
+
useCases: UseCaseSuitability;
|
|
265
|
+
aliases: string[];
|
|
266
|
+
deprecated: boolean;
|
|
267
|
+
isLocal: boolean;
|
|
268
|
+
releaseDate?: string;
|
|
269
|
+
category: "general" | "coding" | "creative" | "vision" | "reasoning";
|
|
227
270
|
};
|
|
228
271
|
/**
|
|
229
|
-
* Model search
|
|
272
|
+
* Model search filters
|
|
273
|
+
*/
|
|
274
|
+
export type ModelSearchFilters = {
|
|
275
|
+
provider?: AIProviderName | AIProviderName[];
|
|
276
|
+
capability?: keyof ModelCapabilities | (keyof ModelCapabilities)[];
|
|
277
|
+
useCase?: keyof UseCaseSuitability;
|
|
278
|
+
maxCost?: number;
|
|
279
|
+
minContextSize?: number;
|
|
280
|
+
maxContextSize?: number;
|
|
281
|
+
performance?: ModelPerformance["speed"] | ModelPerformance["quality"];
|
|
282
|
+
category?: ModelInfo["category"] | ModelInfo["category"][];
|
|
283
|
+
};
|
|
284
|
+
/**
|
|
285
|
+
* Model search result with ranking
|
|
230
286
|
*/
|
|
231
287
|
export type ModelSearchResult = {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
288
|
+
model: ModelInfo;
|
|
289
|
+
score: number;
|
|
290
|
+
matchReasons: string[];
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Model recommendation context
|
|
294
|
+
*/
|
|
295
|
+
export type RecommendationContext = {
|
|
296
|
+
useCase?: keyof UseCaseSuitability;
|
|
297
|
+
maxCost?: number;
|
|
298
|
+
minQuality?: "low" | "medium" | "high";
|
|
299
|
+
requireCapabilities?: (keyof ModelCapabilities)[];
|
|
300
|
+
excludeProviders?: AIProviderName[];
|
|
301
|
+
contextSize?: number;
|
|
302
|
+
preferLocal?: boolean;
|
|
235
303
|
};
|
|
236
304
|
/**
|
|
237
|
-
*
|
|
305
|
+
* Model recommendation result
|
|
238
306
|
*/
|
|
239
|
-
export type
|
|
240
|
-
|
|
241
|
-
|
|
307
|
+
export type ModelRecommendation = {
|
|
308
|
+
model: ModelInfo;
|
|
309
|
+
score: number;
|
|
310
|
+
reasoning: string[];
|
|
311
|
+
alternatives: ModelInfo[];
|
|
312
|
+
};
|
|
313
|
+
/**
|
|
314
|
+
* Model comparison result
|
|
315
|
+
*/
|
|
316
|
+
export type ModelComparison = {
|
|
317
|
+
models: ModelInfo[];
|
|
318
|
+
comparison: {
|
|
319
|
+
capabilities: Record<keyof ModelCapabilities, ModelInfo[]>;
|
|
320
|
+
pricing: {
|
|
321
|
+
cheapest: ModelInfo;
|
|
322
|
+
mostExpensive: ModelInfo;
|
|
323
|
+
};
|
|
324
|
+
performance: Record<string, ModelInfo[]>;
|
|
325
|
+
contextSize: {
|
|
326
|
+
largest: ModelInfo;
|
|
327
|
+
smallest: ModelInfo;
|
|
328
|
+
};
|
|
329
|
+
};
|
|
242
330
|
};
|
package/dist/types/modelTypes.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* Langfuse observability configuration
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
9
|
+
export type LangfuseConfig = {
|
|
10
10
|
/** Whether Langfuse is enabled */
|
|
11
11
|
enabled: boolean;
|
|
12
12
|
/** Langfuse public key */
|
|
@@ -24,11 +24,11 @@ export interface LangfuseConfig {
|
|
|
24
24
|
environment?: string;
|
|
25
25
|
/** Release/version identifier */
|
|
26
26
|
release?: string;
|
|
27
|
-
}
|
|
27
|
+
};
|
|
28
28
|
/**
|
|
29
29
|
* OpenTelemetry configuration
|
|
30
30
|
*/
|
|
31
|
-
export
|
|
31
|
+
export type OpenTelemetryConfig = {
|
|
32
32
|
/** Whether OpenTelemetry is enabled */
|
|
33
33
|
enabled: boolean;
|
|
34
34
|
/** OTLP endpoint URL */
|
|
@@ -37,13 +37,13 @@ export interface OpenTelemetryConfig {
|
|
|
37
37
|
serviceName?: string;
|
|
38
38
|
/** Service version */
|
|
39
39
|
serviceVersion?: string;
|
|
40
|
-
}
|
|
40
|
+
};
|
|
41
41
|
/**
|
|
42
42
|
* Complete observability configuration for Neurolink SDK
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
44
|
+
export type ObservabilityConfig = {
|
|
45
45
|
/** Langfuse configuration */
|
|
46
46
|
langfuse?: LangfuseConfig;
|
|
47
47
|
/** OpenTelemetry configuration */
|
|
48
48
|
openTelemetry?: OpenTelemetryConfig;
|
|
49
|
-
}
|
|
49
|
+
};
|
|
@@ -2,103 +2,12 @@
|
|
|
2
2
|
* Provider-specific type definitions for NeuroLink
|
|
3
3
|
*/
|
|
4
4
|
import type { UnknownRecord, JsonValue } from "./common.js";
|
|
5
|
+
import { AIProviderName, AnthropicModels, BedrockModels, GoogleAIModels, OpenAIModels, VertexModels } from "../constants/enums.js";
|
|
5
6
|
import type { Tool } from "ai";
|
|
6
7
|
import type { ValidationSchema } from "./typeAliases.js";
|
|
7
8
|
import type { EnhancedGenerateResult, GenerateResult, TextGenerationOptions } from "./generateTypes.js";
|
|
8
9
|
import type { StreamOptions, StreamResult } from "./streamTypes.js";
|
|
9
10
|
import type { ExternalMCPToolInfo } from "./externalMcp.js";
|
|
10
|
-
/**
|
|
11
|
-
* Supported AI Provider Names
|
|
12
|
-
*/
|
|
13
|
-
export declare enum AIProviderName {
|
|
14
|
-
BEDROCK = "bedrock",
|
|
15
|
-
OPENAI = "openai",
|
|
16
|
-
OPENAI_COMPATIBLE = "openai-compatible",
|
|
17
|
-
VERTEX = "vertex",
|
|
18
|
-
ANTHROPIC = "anthropic",
|
|
19
|
-
AZURE = "azure",
|
|
20
|
-
GOOGLE_AI = "google-ai",
|
|
21
|
-
HUGGINGFACE = "huggingface",
|
|
22
|
-
OLLAMA = "ollama",
|
|
23
|
-
MISTRAL = "mistral",
|
|
24
|
-
LITELLM = "litellm",
|
|
25
|
-
SAGEMAKER = "sagemaker",
|
|
26
|
-
AUTO = "auto"
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Supported Models for Amazon Bedrock
|
|
30
|
-
*/
|
|
31
|
-
export declare enum BedrockModels {
|
|
32
|
-
CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
33
|
-
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
|
|
34
|
-
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
35
|
-
CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Supported Models for OpenAI
|
|
39
|
-
*/
|
|
40
|
-
export declare enum OpenAIModels {
|
|
41
|
-
GPT_4 = "gpt-4",
|
|
42
|
-
GPT_4_TURBO = "gpt-4-turbo",
|
|
43
|
-
GPT_4O = "gpt-4o",
|
|
44
|
-
GPT_4O_MINI = "gpt-4o-mini",
|
|
45
|
-
GPT_3_5_TURBO = "gpt-3.5-turbo",
|
|
46
|
-
O1_PREVIEW = "o1-preview",
|
|
47
|
-
O1_MINI = "o1-mini"
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Supported Models for Google Vertex AI
|
|
51
|
-
*/
|
|
52
|
-
export declare enum VertexModels {
|
|
53
|
-
CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
|
|
54
|
-
CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
|
|
55
|
-
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
56
|
-
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
57
|
-
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
58
|
-
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
59
|
-
CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
|
|
60
|
-
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
61
|
-
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
62
|
-
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
63
|
-
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
64
|
-
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
65
|
-
GEMINI_1_5_FLASH = "gemini-1.5-flash"
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Supported Models for Google AI Studio
|
|
69
|
-
*/
|
|
70
|
-
export declare enum GoogleAIModels {
|
|
71
|
-
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
72
|
-
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
73
|
-
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
74
|
-
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
75
|
-
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
76
|
-
GEMINI_1_5_FLASH = "gemini-1.5-flash",
|
|
77
|
-
GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Supported Models for Anthropic (Direct API)
|
|
81
|
-
*/
|
|
82
|
-
export declare enum AnthropicModels {
|
|
83
|
-
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
84
|
-
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
85
|
-
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
86
|
-
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
87
|
-
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* API Versions for various providers
|
|
91
|
-
*/
|
|
92
|
-
export declare enum APIVersions {
|
|
93
|
-
AZURE_LATEST = "2025-04-01-preview",
|
|
94
|
-
AZURE_STABLE = "2024-10-21",
|
|
95
|
-
AZURE_LEGACY = "2023-12-01-preview",
|
|
96
|
-
OPENAI_CURRENT = "v1",
|
|
97
|
-
OPENAI_BETA = "v1-beta",
|
|
98
|
-
GOOGLE_AI_CURRENT = "v1",
|
|
99
|
-
GOOGLE_AI_BETA = "v1beta",
|
|
100
|
-
ANTHROPIC_CURRENT = "2023-06-01"
|
|
101
|
-
}
|
|
102
11
|
/**
|
|
103
12
|
* Generic AI SDK model interface
|
|
104
13
|
*/
|
|
@@ -112,7 +21,19 @@ export type SupportedModelName = BedrockModels | OpenAIModels | VertexModels | G
|
|
|
112
21
|
/**
|
|
113
22
|
* Extract provider names from enum
|
|
114
23
|
*/
|
|
115
|
-
export type ProviderName = keyof typeof AIProviderName;
|
|
24
|
+
export type ProviderName = (typeof AIProviderName)[keyof typeof AIProviderName];
|
|
25
|
+
/**
|
|
26
|
+
* Provider status information
|
|
27
|
+
*/
|
|
28
|
+
export type ProviderStatus = {
|
|
29
|
+
provider: string;
|
|
30
|
+
status: "working" | "failed" | "not-configured";
|
|
31
|
+
configured: boolean;
|
|
32
|
+
authenticated: boolean;
|
|
33
|
+
error?: string;
|
|
34
|
+
responseTime?: number;
|
|
35
|
+
model?: string;
|
|
36
|
+
};
|
|
116
37
|
/**
|
|
117
38
|
* Provider error information
|
|
118
39
|
*/
|
|
@@ -344,6 +265,16 @@ export type ProviderRegistration = {
|
|
|
344
265
|
capabilities?: ProviderCapabilities;
|
|
345
266
|
defaultConfig?: IndividualProviderConfig;
|
|
346
267
|
};
|
|
268
|
+
/**
|
|
269
|
+
* Configuration options for the provider registry
|
|
270
|
+
*/
|
|
271
|
+
export type ProviderRegistryOptions = {
|
|
272
|
+
/**
|
|
273
|
+
* Enable loading of manual MCP configurations from .mcp-config.json
|
|
274
|
+
* Should only be true for CLI mode, false for SDK mode
|
|
275
|
+
*/
|
|
276
|
+
enableManualMCP?: boolean;
|
|
277
|
+
};
|
|
347
278
|
/**
|
|
348
279
|
* Provider metadata type
|
|
349
280
|
*/
|
|
@@ -1060,6 +991,25 @@ export type SageMakerGenerateResult = {
|
|
|
1060
991
|
toolCalls?: SageMakerToolCall[];
|
|
1061
992
|
object?: unknown;
|
|
1062
993
|
};
|
|
994
|
+
export type ProviderHealthStatusOptions = {
|
|
995
|
+
provider: AIProviderName;
|
|
996
|
+
isHealthy: boolean;
|
|
997
|
+
isConfigured: boolean;
|
|
998
|
+
hasApiKey: boolean;
|
|
999
|
+
lastChecked: Date;
|
|
1000
|
+
error?: string;
|
|
1001
|
+
warning?: string;
|
|
1002
|
+
responseTime?: number;
|
|
1003
|
+
configurationIssues: string[];
|
|
1004
|
+
recommendations: string[];
|
|
1005
|
+
};
|
|
1006
|
+
export type ProviderHealthCheckOptions = {
|
|
1007
|
+
timeout?: number;
|
|
1008
|
+
includeConnectivityTest?: boolean;
|
|
1009
|
+
includeModelValidation?: boolean;
|
|
1010
|
+
cacheResults?: boolean;
|
|
1011
|
+
maxCacheAge?: number;
|
|
1012
|
+
};
|
|
1063
1013
|
/**
|
|
1064
1014
|
* Amazon Bedrock specific types
|
|
1065
1015
|
*/
|