@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
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
|
*/
|
package/dist/types/providers.js
CHANGED
|
@@ -1,124 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Provider-specific type definitions for NeuroLink
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
// ENUMS
|
|
6
|
-
// ============================================================================
|
|
7
|
-
/**
|
|
8
|
-
* Supported AI Provider Names
|
|
9
|
-
*/
|
|
10
|
-
export var AIProviderName;
|
|
11
|
-
(function (AIProviderName) {
|
|
12
|
-
AIProviderName["BEDROCK"] = "bedrock";
|
|
13
|
-
AIProviderName["OPENAI"] = "openai";
|
|
14
|
-
AIProviderName["OPENAI_COMPATIBLE"] = "openai-compatible";
|
|
15
|
-
AIProviderName["VERTEX"] = "vertex";
|
|
16
|
-
AIProviderName["ANTHROPIC"] = "anthropic";
|
|
17
|
-
AIProviderName["AZURE"] = "azure";
|
|
18
|
-
AIProviderName["GOOGLE_AI"] = "google-ai";
|
|
19
|
-
AIProviderName["HUGGINGFACE"] = "huggingface";
|
|
20
|
-
AIProviderName["OLLAMA"] = "ollama";
|
|
21
|
-
AIProviderName["MISTRAL"] = "mistral";
|
|
22
|
-
AIProviderName["LITELLM"] = "litellm";
|
|
23
|
-
AIProviderName["SAGEMAKER"] = "sagemaker";
|
|
24
|
-
AIProviderName["AUTO"] = "auto";
|
|
25
|
-
})(AIProviderName || (AIProviderName = {}));
|
|
26
|
-
/**
|
|
27
|
-
* Supported Models for Amazon Bedrock
|
|
28
|
-
*/
|
|
29
|
-
export var BedrockModels;
|
|
30
|
-
(function (BedrockModels) {
|
|
31
|
-
BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
32
|
-
BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
|
|
33
|
-
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
|
|
34
|
-
BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
35
|
-
})(BedrockModels || (BedrockModels = {}));
|
|
36
|
-
/**
|
|
37
|
-
* Supported Models for OpenAI
|
|
38
|
-
*/
|
|
39
|
-
export var OpenAIModels;
|
|
40
|
-
(function (OpenAIModels) {
|
|
41
|
-
OpenAIModels["GPT_4"] = "gpt-4";
|
|
42
|
-
OpenAIModels["GPT_4_TURBO"] = "gpt-4-turbo";
|
|
43
|
-
OpenAIModels["GPT_4O"] = "gpt-4o";
|
|
44
|
-
OpenAIModels["GPT_4O_MINI"] = "gpt-4o-mini";
|
|
45
|
-
OpenAIModels["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
|
|
46
|
-
OpenAIModels["O1_PREVIEW"] = "o1-preview";
|
|
47
|
-
OpenAIModels["O1_MINI"] = "o1-mini";
|
|
48
|
-
})(OpenAIModels || (OpenAIModels = {}));
|
|
49
|
-
/**
|
|
50
|
-
* Supported Models for Google Vertex AI
|
|
51
|
-
*/
|
|
52
|
-
export var VertexModels;
|
|
53
|
-
(function (VertexModels) {
|
|
54
|
-
// Claude 4 Series (Latest - May 2025)
|
|
55
|
-
VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
|
|
56
|
-
VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
|
|
57
|
-
// Claude 3.5 Series (Still supported)
|
|
58
|
-
VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
59
|
-
VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
60
|
-
// Claude 3 Series (Legacy support)
|
|
61
|
-
VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
62
|
-
VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
63
|
-
VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
64
|
-
// Gemini 2.5 Series (Latest - 2025)
|
|
65
|
-
VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
66
|
-
VertexModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
67
|
-
VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
68
|
-
// Gemini 2.0 Series
|
|
69
|
-
VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
70
|
-
// Gemini 1.5 Series (Legacy support)
|
|
71
|
-
VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
72
|
-
VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
73
|
-
})(VertexModels || (VertexModels = {}));
|
|
74
|
-
/**
|
|
75
|
-
* Supported Models for Google AI Studio
|
|
76
|
-
*/
|
|
77
|
-
export var GoogleAIModels;
|
|
78
|
-
(function (GoogleAIModels) {
|
|
79
|
-
// Gemini 2.5 Series (Latest - 2025)
|
|
80
|
-
GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
81
|
-
GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
82
|
-
GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
83
|
-
// Gemini 2.0 Series
|
|
84
|
-
GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
85
|
-
// Gemini 1.5 Series (Legacy support)
|
|
86
|
-
GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
87
|
-
GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
88
|
-
GoogleAIModels["GEMINI_1_5_FLASH_LITE"] = "gemini-1.5-flash-lite";
|
|
89
|
-
})(GoogleAIModels || (GoogleAIModels = {}));
|
|
90
|
-
/**
|
|
91
|
-
* Supported Models for Anthropic (Direct API)
|
|
92
|
-
*/
|
|
93
|
-
export var AnthropicModels;
|
|
94
|
-
(function (AnthropicModels) {
|
|
95
|
-
// Claude 3.5 Series (Latest)
|
|
96
|
-
AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
97
|
-
AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
98
|
-
// Claude 3 Series (Legacy support)
|
|
99
|
-
AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
100
|
-
AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
101
|
-
AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
102
|
-
})(AnthropicModels || (AnthropicModels = {}));
|
|
103
|
-
/**
|
|
104
|
-
* API Versions for various providers
|
|
105
|
-
*/
|
|
106
|
-
export var APIVersions;
|
|
107
|
-
(function (APIVersions) {
|
|
108
|
-
// Azure OpenAI API versions
|
|
109
|
-
APIVersions["AZURE_LATEST"] = "2025-04-01-preview";
|
|
110
|
-
APIVersions["AZURE_STABLE"] = "2024-10-21";
|
|
111
|
-
APIVersions["AZURE_LEGACY"] = "2023-12-01-preview";
|
|
112
|
-
// OpenAI API versions
|
|
113
|
-
APIVersions["OPENAI_CURRENT"] = "v1";
|
|
114
|
-
APIVersions["OPENAI_BETA"] = "v1-beta";
|
|
115
|
-
// Google AI API versions
|
|
116
|
-
APIVersions["GOOGLE_AI_CURRENT"] = "v1";
|
|
117
|
-
APIVersions["GOOGLE_AI_BETA"] = "v1beta";
|
|
118
|
-
// Anthropic API versions
|
|
119
|
-
APIVersions["ANTHROPIC_CURRENT"] = "2023-06-01";
|
|
120
|
-
// Other provider versions can be added here
|
|
121
|
-
})(APIVersions || (APIVersions = {}));
|
|
4
|
+
import { AIProviderName, AnthropicModels, BedrockModels, GoogleAIModels, OpenAIModels, VertexModels, } from "../constants/enums.js";
|
|
122
5
|
/**
|
|
123
6
|
* Default model aliases for easy reference
|
|
124
7
|
*/
|
package/dist/types/sdkTypes.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ ToolCallResults, ToolCalls, StreamOptions, StreamingOptions, EnhancedStreamProvi
|
|
|
11
11
|
export type { TypedEventEmitter, NeuroLinkEvents, StreamEvent, AsyncFunction, SyncFunction, AnyFunction, } from "./common.js";
|
|
12
12
|
export type { NeuroLinkConfig, ProviderConfig, PerformanceConfig, CacheConfig, FallbackConfig, RetryConfig, AnalyticsConfig, ToolConfig, BackupInfo, BackupMetadata, ConfigValidationResult, ConfigUpdateOptions, } from "./configTypes.js";
|
|
13
13
|
export type { ToolArgs, ToolContext, ToolResult, ToolDefinition, SimpleTool, AvailableTool, ToolExecution, BaseToolArgs, ToolExecutionEvent, ToolExecutionSummary, ToolExecutionContext, ToolExecutionMetadata, ToolParameterSchema, ZodUnknownSchema, ZodAnySchema, ZodObjectSchema, ZodStringSchema, } from "./tools.js";
|
|
14
|
-
export type { AISDKModel, ProviderError, AIModelProviderConfig,
|
|
14
|
+
export type { AISDKModel, ProviderError, AIModelProviderConfig, ProviderName, ModelCapability, ModelUseCase, ModelFilter, ModelResolutionContext, ModelStats, ModelPricing, ProviderCapabilities, } from "./providers.js";
|
|
15
15
|
export type { GenerateOptions, GenerateResult, UnifiedGenerationOptions, EnhancedProvider, FactoryEnhancedProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, } from "./generateTypes.js";
|
|
16
16
|
export type { TokenUsage, AnalyticsData } from "./analytics.js";
|
|
17
17
|
export type { TextContent, ImageContent, Content, VisionCapability, ProviderImageFormat, ProcessedImage, MultimodalMessage, ProviderMultimodalPayload, } from "./content.js";
|
|
@@ -2,7 +2,8 @@ import type { Tool } from "ai";
|
|
|
2
2
|
import type { ValidationSchema, StandardRecord } from "./typeAliases.js";
|
|
3
3
|
import type { AIModelProviderConfig } from "./providers.js";
|
|
4
4
|
import type { TextContent, ImageContent } from "./content.js";
|
|
5
|
-
import type {
|
|
5
|
+
import type { AnalyticsData, ToolExecutionEvent, ToolExecutionSummary } from "../types/index.js";
|
|
6
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
6
7
|
import type { TokenUsage } from "./analytics.js";
|
|
7
8
|
import type { EvaluationData } from "../index.js";
|
|
8
9
|
import type { UnknownRecord, JsonValue } from "./common.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
@@ -9,29 +9,29 @@ export type TaskType = "fast" | "reasoning";
|
|
|
9
9
|
/**
|
|
10
10
|
* Result of task classification analysis
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type TaskClassification = {
|
|
13
13
|
/** The classified task type */
|
|
14
14
|
type: TaskType;
|
|
15
15
|
/** Confidence score (0-1) in the classification */
|
|
16
16
|
confidence: number;
|
|
17
17
|
/** Human-readable explanation of the classification decision */
|
|
18
18
|
reasoning: string;
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
/**
|
|
21
21
|
* Internal scoring data used during classification analysis
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export type ClassificationScores = {
|
|
24
24
|
/** Score indicating likelihood of fast task */
|
|
25
25
|
fastScore: number;
|
|
26
26
|
/** Score indicating likelihood of reasoning task */
|
|
27
27
|
reasoningScore: number;
|
|
28
28
|
/** Array of reasons contributing to the scores */
|
|
29
29
|
reasons: string[];
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
/**
|
|
32
32
|
* Statistics for batch classification analysis
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type ClassificationStats = {
|
|
35
35
|
/** Total number of prompts analyzed */
|
|
36
36
|
total: number;
|
|
37
37
|
/** Number of prompts classified as fast */
|
|
@@ -40,13 +40,13 @@ export interface ClassificationStats {
|
|
|
40
40
|
reasoning: number;
|
|
41
41
|
/** Average confidence across all classifications */
|
|
42
42
|
averageConfidence: number;
|
|
43
|
-
}
|
|
43
|
+
};
|
|
44
44
|
/**
|
|
45
45
|
* Validation result for testing classification accuracy
|
|
46
46
|
*/
|
|
47
|
-
export
|
|
47
|
+
export type ClassificationValidation = {
|
|
48
48
|
/** Whether the classification matched the expected result */
|
|
49
49
|
correct: boolean;
|
|
50
50
|
/** The actual classification result */
|
|
51
51
|
classification: TaskClassification;
|
|
52
|
-
}
|
|
52
|
+
};
|