@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
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { generateText, tool as createAISDKTool, jsonSchema } from "ai";
|
|
2
|
+
import { generateText, tool as createAISDKTool, jsonSchema, Output } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { MiddlewareFactory } from "../middleware/factory.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { DEFAULT_MAX_STEPS, STEP_LIMITS } from "../core/constants.js";
|
|
@@ -300,6 +301,9 @@ export class BaseProvider {
|
|
|
300
301
|
*/
|
|
301
302
|
async executeGeneration(model, messages, tools, options) {
|
|
302
303
|
const shouldUseTools = !options.disableTools && this.supportsTools();
|
|
304
|
+
const useStructuredOutput = !!options.schema &&
|
|
305
|
+
(options.output?.format === "json" ||
|
|
306
|
+
options.output?.format === "structured");
|
|
303
307
|
return await generateText({
|
|
304
308
|
model,
|
|
305
309
|
messages,
|
|
@@ -308,6 +312,10 @@ export class BaseProvider {
|
|
|
308
312
|
toolChoice: shouldUseTools ? "auto" : "none",
|
|
309
313
|
temperature: options.temperature,
|
|
310
314
|
maxTokens: options.maxTokens,
|
|
315
|
+
...(useStructuredOutput &&
|
|
316
|
+
options.schema && {
|
|
317
|
+
experimental_output: Output.object({ schema: options.schema }),
|
|
318
|
+
}),
|
|
311
319
|
experimental_telemetry: this.getStreamTelemetryConfig(options, "generate"),
|
|
312
320
|
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
313
321
|
logger.info("Tool execution completed", { toolResults, toolCalls });
|
|
@@ -438,9 +446,17 @@ export class BaseProvider {
|
|
|
438
446
|
/**
|
|
439
447
|
* Format the enhanced result
|
|
440
448
|
*/
|
|
441
|
-
formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions) {
|
|
449
|
+
formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions, options) {
|
|
450
|
+
// Only access experimental_output if we set a schema
|
|
451
|
+
// (accessing it when not set throws an error)
|
|
452
|
+
const useStructuredOutput = !!options.schema &&
|
|
453
|
+
(options.output?.format === "json" ||
|
|
454
|
+
options.output?.format === "structured");
|
|
455
|
+
const content = useStructuredOutput
|
|
456
|
+
? JSON.stringify(generateResult.experimental_output)
|
|
457
|
+
: generateResult.text;
|
|
442
458
|
return {
|
|
443
|
-
content
|
|
459
|
+
content,
|
|
444
460
|
usage: {
|
|
445
461
|
input: generateResult.usage?.promptTokens || 0,
|
|
446
462
|
output: generateResult.usage?.completionTokens || 0,
|
|
@@ -578,7 +594,7 @@ export class BaseProvider {
|
|
|
578
594
|
const responseTime = Date.now() - startTime;
|
|
579
595
|
await this.recordPerformanceMetrics(generateResult.usage, responseTime);
|
|
580
596
|
const { toolsUsed, toolExecutions } = this.extractToolInformation(generateResult);
|
|
581
|
-
const enhancedResult = this.formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions);
|
|
597
|
+
const enhancedResult = this.formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions, options);
|
|
582
598
|
return await this.enhanceResult(enhancedResult, options, startTime);
|
|
583
599
|
}
|
|
584
600
|
catch (error) {
|
package/dist/core/factory.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AIProvider,
|
|
1
|
+
import type { AIProvider, SupportedModelName } from "../types/index.js";
|
|
2
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
2
3
|
import type { UnknownRecord } from "../types/common.js";
|
|
3
4
|
import type { ProviderPairResult } from "../types/typeAliases.js";
|
|
4
5
|
/**
|
package/dist/core/factory.js
CHANGED
|
@@ -5,6 +5,7 @@ import { ProviderRegistry } from "../factories/providerRegistry.js";
|
|
|
5
5
|
import { getBestProvider } from "../utils/providerUtils.js";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { dynamicModelProvider } from "./dynamicModels.js";
|
|
8
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
8
9
|
const componentIdentifier = "aiProviderFactory";
|
|
9
10
|
/**
|
|
10
11
|
* Factory for creating AI provider instances with centralized configuration
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AIProvider
|
|
1
|
+
import type { AIProvider } from "../types/index.js";
|
|
2
2
|
import type { UnknownRecord } from "../types/common.js";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
/**
|
|
4
5
|
* Provider constructor interface - supports both sync constructors and async factory functions
|
|
5
6
|
*/
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Configuration options for the provider registry
|
|
3
|
-
*/
|
|
4
|
-
export interface ProviderRegistryOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Enable loading of manual MCP configurations from .mcp-config.json
|
|
7
|
-
* Should only be true for CLI mode, false for SDK mode
|
|
8
|
-
*/
|
|
9
|
-
enableManualMCP?: boolean;
|
|
10
|
-
}
|
|
1
|
+
import type { ProviderRegistryOptions } from "../types/index.js";
|
|
11
2
|
/**
|
|
12
3
|
* Provider Registry - registers all providers with the factory
|
|
13
4
|
* This is where we migrate providers one by one to the new pattern
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ProviderFactory } from "./providerFactory.js";
|
|
2
|
-
// Lazy loading all providers to avoid circular dependencies
|
|
3
|
-
// Removed all static imports - providers loaded dynamically when needed
|
|
4
|
-
// This breaks the circular dependency chain completely
|
|
5
|
-
import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../types/index.js";
|
|
6
2
|
import { logger } from "../utils/logger.js";
|
|
3
|
+
import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../constants/enums.js";
|
|
7
4
|
/**
|
|
8
5
|
* Provider Registry - registers all providers with the factory
|
|
9
6
|
* This is where we migrate providers one by one to the new pattern
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* for enterprise-grade AI safety.
|
|
7
7
|
*/
|
|
8
8
|
import { EventEmitter } from "events";
|
|
9
|
-
import type { HITLConfig, ConfirmationResult, HITLStatistics } from "
|
|
9
|
+
import type { HITLConfig, ConfirmationResult, HITLStatistics } from "../types/hitlTypes.js";
|
|
10
10
|
/**
|
|
11
11
|
* HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
|
|
12
12
|
*
|
package/dist/hitl/index.d.ts
CHANGED
|
@@ -4,5 +4,4 @@
|
|
|
4
4
|
* Simple barrel export for HITL components.
|
|
5
5
|
*/
|
|
6
6
|
export { HITLManager } from "./hitlManager.js";
|
|
7
|
-
export type { HITLConfig, HITLRule, ConfirmationRequest, ConfirmationResult, ConfirmationRequestEvent, ConfirmationResponseEvent, ConfirmationTimeoutEvent, HITLStatistics, HITLAuditLog, } from "./types.js";
|
|
8
7
|
export { HITLError, HITLUserRejectedError, HITLTimeoutError, HITLConfigurationError, } from "./hitlErrors.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AIProviderFactory } from "./core/factory.js";
|
|
10
10
|
export { AIProviderFactory };
|
|
11
|
-
export type { AIProvider,
|
|
11
|
+
export type { AIProvider, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
|
|
12
12
|
export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
|
|
13
13
|
export type { ToolContext } from "./sdk/toolRegistration.js";
|
|
14
14
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
15
15
|
export type { ToolResult, ToolDefinition } from "./types/tools.js";
|
|
16
|
-
export {
|
|
16
|
+
export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
|
|
17
|
+
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
17
18
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
18
19
|
export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
19
20
|
export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
|
|
20
21
|
import { NeuroLink } from "./neurolink.js";
|
|
21
22
|
export { NeuroLink };
|
|
22
|
-
export type { ProviderStatus, MCPStatus } from "./neurolink.js";
|
|
23
23
|
export type { MCPServerInfo } from "./types/mcpTypes.js";
|
|
24
24
|
export type { ObservabilityConfig, LangfuseConfig, OpenTelemetryConfig, } from "./types/observability.js";
|
|
25
25
|
export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
|
|
@@ -84,7 +84,9 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
|
|
87
|
-
export type { McpMetadata,
|
|
87
|
+
export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
|
|
88
|
+
export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
|
|
89
|
+
export type { LogLevel } from "./utils/logger.js";
|
|
88
90
|
export declare function initializeTelemetry(): Promise<boolean>;
|
|
89
91
|
export declare function getTelemetryStatus(): Promise<{
|
|
90
92
|
enabled: boolean;
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,8 @@ import { AIProviderFactory } from "./core/factory.js";
|
|
|
11
11
|
export { AIProviderFactory };
|
|
12
12
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
13
13
|
// Model enums
|
|
14
|
-
export {
|
|
14
|
+
export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
|
|
15
|
+
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
15
16
|
// Utility exports
|
|
16
17
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
17
18
|
// Dynamic Models exports
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported AI Provider Names
|
|
3
|
+
*/
|
|
4
|
+
export declare enum AIProviderName {
|
|
5
|
+
BEDROCK = "bedrock",
|
|
6
|
+
OPENAI = "openai",
|
|
7
|
+
OPENAI_COMPATIBLE = "openai-compatible",
|
|
8
|
+
VERTEX = "vertex",
|
|
9
|
+
ANTHROPIC = "anthropic",
|
|
10
|
+
AZURE = "azure",
|
|
11
|
+
GOOGLE_AI = "google-ai",
|
|
12
|
+
HUGGINGFACE = "huggingface",
|
|
13
|
+
OLLAMA = "ollama",
|
|
14
|
+
MISTRAL = "mistral",
|
|
15
|
+
LITELLM = "litellm",
|
|
16
|
+
SAGEMAKER = "sagemaker",
|
|
17
|
+
AUTO = "auto"
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Supported Models for Amazon Bedrock
|
|
21
|
+
*/
|
|
22
|
+
export declare enum BedrockModels {
|
|
23
|
+
CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
24
|
+
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
|
|
25
|
+
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20240620-v1:0",
|
|
26
|
+
CLAUDE_3_7_SONNET = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0"
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Supported Models for OpenAI
|
|
30
|
+
*/
|
|
31
|
+
export declare enum OpenAIModels {
|
|
32
|
+
GPT_4 = "gpt-4",
|
|
33
|
+
GPT_4_TURBO = "gpt-4-turbo",
|
|
34
|
+
GPT_4O = "gpt-4o",
|
|
35
|
+
GPT_4O_MINI = "gpt-4o-mini",
|
|
36
|
+
GPT_3_5_TURBO = "gpt-3.5-turbo",
|
|
37
|
+
O1_PREVIEW = "o1-preview",
|
|
38
|
+
O1_MINI = "o1-mini"
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Supported Models for Google Vertex AI
|
|
42
|
+
*/
|
|
43
|
+
export declare enum VertexModels {
|
|
44
|
+
CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
|
|
45
|
+
CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
|
|
46
|
+
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
47
|
+
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
48
|
+
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
49
|
+
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
50
|
+
CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
|
|
51
|
+
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
52
|
+
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
53
|
+
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
54
|
+
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
55
|
+
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
56
|
+
GEMINI_1_5_FLASH = "gemini-1.5-flash"
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Supported Models for Google AI Studio
|
|
60
|
+
*/
|
|
61
|
+
export declare enum GoogleAIModels {
|
|
62
|
+
GEMINI_2_5_PRO = "gemini-2.5-pro",
|
|
63
|
+
GEMINI_2_5_FLASH = "gemini-2.5-flash",
|
|
64
|
+
GEMINI_2_5_FLASH_LITE = "gemini-2.5-flash-lite",
|
|
65
|
+
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
66
|
+
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
67
|
+
GEMINI_1_5_FLASH = "gemini-1.5-flash",
|
|
68
|
+
GEMINI_1_5_FLASH_LITE = "gemini-1.5-flash-lite"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Supported Models for Anthropic (Direct API)
|
|
72
|
+
*/
|
|
73
|
+
export declare enum AnthropicModels {
|
|
74
|
+
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
75
|
+
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
76
|
+
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
77
|
+
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
78
|
+
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* API Versions for various providers
|
|
82
|
+
*/
|
|
83
|
+
export declare enum APIVersions {
|
|
84
|
+
AZURE_LATEST = "2025-04-01-preview",
|
|
85
|
+
AZURE_STABLE = "2024-10-21",
|
|
86
|
+
AZURE_LEGACY = "2023-12-01-preview",
|
|
87
|
+
OPENAI_CURRENT = "v1",
|
|
88
|
+
OPENAI_BETA = "v1-beta",
|
|
89
|
+
GOOGLE_AI_CURRENT = "v1",
|
|
90
|
+
GOOGLE_AI_BETA = "v1beta",
|
|
91
|
+
ANTHROPIC_CURRENT = "2023-06-01"
|
|
92
|
+
}
|
|
93
|
+
export declare enum ErrorCategory {
|
|
94
|
+
VALIDATION = "validation",
|
|
95
|
+
TIMEOUT = "timeout",
|
|
96
|
+
NETWORK = "network",
|
|
97
|
+
RESOURCE = "resource",
|
|
98
|
+
PERMISSION = "permission",
|
|
99
|
+
CONFIGURATION = "configuration",
|
|
100
|
+
EXECUTION = "execution",
|
|
101
|
+
SYSTEM = "system"
|
|
102
|
+
}
|
|
103
|
+
export declare enum ErrorSeverity {
|
|
104
|
+
LOW = "low",
|
|
105
|
+
MEDIUM = "medium",
|
|
106
|
+
HIGH = "high",
|
|
107
|
+
CRITICAL = "critical"
|
|
108
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// ENUMS
|
|
3
|
+
// ============================================================================
|
|
4
|
+
/**
|
|
5
|
+
* Supported AI Provider Names
|
|
6
|
+
*/
|
|
7
|
+
export var AIProviderName;
|
|
8
|
+
(function (AIProviderName) {
|
|
9
|
+
AIProviderName["BEDROCK"] = "bedrock";
|
|
10
|
+
AIProviderName["OPENAI"] = "openai";
|
|
11
|
+
AIProviderName["OPENAI_COMPATIBLE"] = "openai-compatible";
|
|
12
|
+
AIProviderName["VERTEX"] = "vertex";
|
|
13
|
+
AIProviderName["ANTHROPIC"] = "anthropic";
|
|
14
|
+
AIProviderName["AZURE"] = "azure";
|
|
15
|
+
AIProviderName["GOOGLE_AI"] = "google-ai";
|
|
16
|
+
AIProviderName["HUGGINGFACE"] = "huggingface";
|
|
17
|
+
AIProviderName["OLLAMA"] = "ollama";
|
|
18
|
+
AIProviderName["MISTRAL"] = "mistral";
|
|
19
|
+
AIProviderName["LITELLM"] = "litellm";
|
|
20
|
+
AIProviderName["SAGEMAKER"] = "sagemaker";
|
|
21
|
+
AIProviderName["AUTO"] = "auto";
|
|
22
|
+
})(AIProviderName || (AIProviderName = {}));
|
|
23
|
+
/**
|
|
24
|
+
* Supported Models for Amazon Bedrock
|
|
25
|
+
*/
|
|
26
|
+
export var BedrockModels;
|
|
27
|
+
(function (BedrockModels) {
|
|
28
|
+
BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
29
|
+
BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
|
|
30
|
+
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20240620-v1:0";
|
|
31
|
+
BedrockModels["CLAUDE_3_7_SONNET"] = "arn:aws:bedrock:us-east-2:225681119357:inference-profile/us.anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
32
|
+
})(BedrockModels || (BedrockModels = {}));
|
|
33
|
+
/**
|
|
34
|
+
* Supported Models for OpenAI
|
|
35
|
+
*/
|
|
36
|
+
export var OpenAIModels;
|
|
37
|
+
(function (OpenAIModels) {
|
|
38
|
+
OpenAIModels["GPT_4"] = "gpt-4";
|
|
39
|
+
OpenAIModels["GPT_4_TURBO"] = "gpt-4-turbo";
|
|
40
|
+
OpenAIModels["GPT_4O"] = "gpt-4o";
|
|
41
|
+
OpenAIModels["GPT_4O_MINI"] = "gpt-4o-mini";
|
|
42
|
+
OpenAIModels["GPT_3_5_TURBO"] = "gpt-3.5-turbo";
|
|
43
|
+
OpenAIModels["O1_PREVIEW"] = "o1-preview";
|
|
44
|
+
OpenAIModels["O1_MINI"] = "o1-mini";
|
|
45
|
+
})(OpenAIModels || (OpenAIModels = {}));
|
|
46
|
+
/**
|
|
47
|
+
* Supported Models for Google Vertex AI
|
|
48
|
+
*/
|
|
49
|
+
export var VertexModels;
|
|
50
|
+
(function (VertexModels) {
|
|
51
|
+
// Claude 4 Series (Latest - May 2025)
|
|
52
|
+
VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
|
|
53
|
+
VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
|
|
54
|
+
// Claude 3.5 Series (Still supported)
|
|
55
|
+
VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
56
|
+
VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
57
|
+
// Claude 3 Series (Legacy support)
|
|
58
|
+
VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
59
|
+
VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
60
|
+
VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
61
|
+
// Gemini 2.5 Series (Latest - 2025)
|
|
62
|
+
VertexModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
63
|
+
VertexModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
64
|
+
VertexModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
65
|
+
// Gemini 2.0 Series
|
|
66
|
+
VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
67
|
+
// Gemini 1.5 Series (Legacy support)
|
|
68
|
+
VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
69
|
+
VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
70
|
+
})(VertexModels || (VertexModels = {}));
|
|
71
|
+
/**
|
|
72
|
+
* Supported Models for Google AI Studio
|
|
73
|
+
*/
|
|
74
|
+
export var GoogleAIModels;
|
|
75
|
+
(function (GoogleAIModels) {
|
|
76
|
+
// Gemini 2.5 Series (Latest - 2025)
|
|
77
|
+
GoogleAIModels["GEMINI_2_5_PRO"] = "gemini-2.5-pro";
|
|
78
|
+
GoogleAIModels["GEMINI_2_5_FLASH"] = "gemini-2.5-flash";
|
|
79
|
+
GoogleAIModels["GEMINI_2_5_FLASH_LITE"] = "gemini-2.5-flash-lite";
|
|
80
|
+
// Gemini 2.0 Series
|
|
81
|
+
GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
82
|
+
// Gemini 1.5 Series (Legacy support)
|
|
83
|
+
GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
84
|
+
GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
85
|
+
GoogleAIModels["GEMINI_1_5_FLASH_LITE"] = "gemini-1.5-flash-lite";
|
|
86
|
+
})(GoogleAIModels || (GoogleAIModels = {}));
|
|
87
|
+
/**
|
|
88
|
+
* Supported Models for Anthropic (Direct API)
|
|
89
|
+
*/
|
|
90
|
+
export var AnthropicModels;
|
|
91
|
+
(function (AnthropicModels) {
|
|
92
|
+
// Claude 3.5 Series (Latest)
|
|
93
|
+
AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
94
|
+
AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
95
|
+
// Claude 3 Series (Legacy support)
|
|
96
|
+
AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
97
|
+
AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
98
|
+
AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
99
|
+
})(AnthropicModels || (AnthropicModels = {}));
|
|
100
|
+
/**
|
|
101
|
+
* API Versions for various providers
|
|
102
|
+
*/
|
|
103
|
+
export var APIVersions;
|
|
104
|
+
(function (APIVersions) {
|
|
105
|
+
// Azure OpenAI API versions
|
|
106
|
+
APIVersions["AZURE_LATEST"] = "2025-04-01-preview";
|
|
107
|
+
APIVersions["AZURE_STABLE"] = "2024-10-21";
|
|
108
|
+
APIVersions["AZURE_LEGACY"] = "2023-12-01-preview";
|
|
109
|
+
// OpenAI API versions
|
|
110
|
+
APIVersions["OPENAI_CURRENT"] = "v1";
|
|
111
|
+
APIVersions["OPENAI_BETA"] = "v1-beta";
|
|
112
|
+
// Google AI API versions
|
|
113
|
+
APIVersions["GOOGLE_AI_CURRENT"] = "v1";
|
|
114
|
+
APIVersions["GOOGLE_AI_BETA"] = "v1beta";
|
|
115
|
+
// Anthropic API versions
|
|
116
|
+
APIVersions["ANTHROPIC_CURRENT"] = "2023-06-01";
|
|
117
|
+
// Other provider versions can be added here
|
|
118
|
+
})(APIVersions || (APIVersions = {}));
|
|
119
|
+
// Error categories for proper handling
|
|
120
|
+
export var ErrorCategory;
|
|
121
|
+
(function (ErrorCategory) {
|
|
122
|
+
ErrorCategory["VALIDATION"] = "validation";
|
|
123
|
+
ErrorCategory["TIMEOUT"] = "timeout";
|
|
124
|
+
ErrorCategory["NETWORK"] = "network";
|
|
125
|
+
ErrorCategory["RESOURCE"] = "resource";
|
|
126
|
+
ErrorCategory["PERMISSION"] = "permission";
|
|
127
|
+
ErrorCategory["CONFIGURATION"] = "configuration";
|
|
128
|
+
ErrorCategory["EXECUTION"] = "execution";
|
|
129
|
+
ErrorCategory["SYSTEM"] = "system";
|
|
130
|
+
})(ErrorCategory || (ErrorCategory = {}));
|
|
131
|
+
// Error severity levels
|
|
132
|
+
export var ErrorSeverity;
|
|
133
|
+
(function (ErrorSeverity) {
|
|
134
|
+
ErrorSeverity["LOW"] = "low";
|
|
135
|
+
ErrorSeverity["MEDIUM"] = "medium";
|
|
136
|
+
ErrorSeverity["HIGH"] = "high";
|
|
137
|
+
ErrorSeverity["CRITICAL"] = "critical";
|
|
138
|
+
})(ErrorSeverity || (ErrorSeverity = {}));
|
|
139
|
+
//# sourceMappingURL=enums.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ValidationSchema } from "../types/typeAliases.js";
|
|
2
2
|
import type { Tool, LanguageModelV1 } from "ai";
|
|
3
|
-
import type { AIProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, AnalyticsData
|
|
3
|
+
import type { AIProvider, TextGenerationOptions, TextGenerationResult, EnhancedGenerateResult, AnalyticsData } from "../types/index.js";
|
|
4
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
4
5
|
import type { EvaluationData } from "../index.js";
|
|
5
6
|
import type { MiddlewareFactoryOptions } from "../types/middlewareTypes.js";
|
|
6
7
|
import type { StreamOptions, StreamResult } from "../types/streamTypes.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { generateText, tool as createAISDKTool, jsonSchema } from "ai";
|
|
2
|
+
import { generateText, tool as createAISDKTool, jsonSchema, Output } from "ai";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
import { MiddlewareFactory } from "../middleware/factory.js";
|
|
4
5
|
import { logger } from "../utils/logger.js";
|
|
5
6
|
import { DEFAULT_MAX_STEPS, STEP_LIMITS } from "../core/constants.js";
|
|
@@ -300,6 +301,9 @@ export class BaseProvider {
|
|
|
300
301
|
*/
|
|
301
302
|
async executeGeneration(model, messages, tools, options) {
|
|
302
303
|
const shouldUseTools = !options.disableTools && this.supportsTools();
|
|
304
|
+
const useStructuredOutput = !!options.schema &&
|
|
305
|
+
(options.output?.format === "json" ||
|
|
306
|
+
options.output?.format === "structured");
|
|
303
307
|
return await generateText({
|
|
304
308
|
model,
|
|
305
309
|
messages,
|
|
@@ -308,6 +312,10 @@ export class BaseProvider {
|
|
|
308
312
|
toolChoice: shouldUseTools ? "auto" : "none",
|
|
309
313
|
temperature: options.temperature,
|
|
310
314
|
maxTokens: options.maxTokens,
|
|
315
|
+
...(useStructuredOutput &&
|
|
316
|
+
options.schema && {
|
|
317
|
+
experimental_output: Output.object({ schema: options.schema }),
|
|
318
|
+
}),
|
|
311
319
|
experimental_telemetry: this.getStreamTelemetryConfig(options, "generate"),
|
|
312
320
|
onStepFinish: ({ toolCalls, toolResults }) => {
|
|
313
321
|
logger.info("Tool execution completed", { toolResults, toolCalls });
|
|
@@ -438,9 +446,17 @@ export class BaseProvider {
|
|
|
438
446
|
/**
|
|
439
447
|
* Format the enhanced result
|
|
440
448
|
*/
|
|
441
|
-
formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions) {
|
|
449
|
+
formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions, options) {
|
|
450
|
+
// Only access experimental_output if we set a schema
|
|
451
|
+
// (accessing it when not set throws an error)
|
|
452
|
+
const useStructuredOutput = !!options.schema &&
|
|
453
|
+
(options.output?.format === "json" ||
|
|
454
|
+
options.output?.format === "structured");
|
|
455
|
+
const content = useStructuredOutput
|
|
456
|
+
? JSON.stringify(generateResult.experimental_output)
|
|
457
|
+
: generateResult.text;
|
|
442
458
|
return {
|
|
443
|
-
content
|
|
459
|
+
content,
|
|
444
460
|
usage: {
|
|
445
461
|
input: generateResult.usage?.promptTokens || 0,
|
|
446
462
|
output: generateResult.usage?.completionTokens || 0,
|
|
@@ -578,7 +594,7 @@ export class BaseProvider {
|
|
|
578
594
|
const responseTime = Date.now() - startTime;
|
|
579
595
|
await this.recordPerformanceMetrics(generateResult.usage, responseTime);
|
|
580
596
|
const { toolsUsed, toolExecutions } = this.extractToolInformation(generateResult);
|
|
581
|
-
const enhancedResult = this.formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions);
|
|
597
|
+
const enhancedResult = this.formatEnhancedResult(generateResult, tools, toolsUsed, toolExecutions, options);
|
|
582
598
|
return await this.enhanceResult(enhancedResult, options, startTime);
|
|
583
599
|
}
|
|
584
600
|
catch (error) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { AIProvider,
|
|
1
|
+
import type { AIProvider, SupportedModelName } from "../types/index.js";
|
|
2
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
2
3
|
import type { UnknownRecord } from "../types/common.js";
|
|
3
4
|
import type { ProviderPairResult } from "../types/typeAliases.js";
|
|
4
5
|
/**
|
package/dist/lib/core/factory.js
CHANGED
|
@@ -5,6 +5,7 @@ import { ProviderRegistry } from "../factories/providerRegistry.js";
|
|
|
5
5
|
import { getBestProvider } from "../utils/providerUtils.js";
|
|
6
6
|
import { logger } from "../utils/logger.js";
|
|
7
7
|
import { dynamicModelProvider } from "./dynamicModels.js";
|
|
8
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
8
9
|
const componentIdentifier = "aiProviderFactory";
|
|
9
10
|
/**
|
|
10
11
|
* Factory for creating AI provider instances with centralized configuration
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { AIProvider
|
|
1
|
+
import type { AIProvider } from "../types/index.js";
|
|
2
2
|
import type { UnknownRecord } from "../types/common.js";
|
|
3
|
+
import { AIProviderName } from "../constants/enums.js";
|
|
3
4
|
/**
|
|
4
5
|
* Provider constructor interface - supports both sync constructors and async factory functions
|
|
5
6
|
*/
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Configuration options for the provider registry
|
|
3
|
-
*/
|
|
4
|
-
export interface ProviderRegistryOptions {
|
|
5
|
-
/**
|
|
6
|
-
* Enable loading of manual MCP configurations from .mcp-config.json
|
|
7
|
-
* Should only be true for CLI mode, false for SDK mode
|
|
8
|
-
*/
|
|
9
|
-
enableManualMCP?: boolean;
|
|
10
|
-
}
|
|
1
|
+
import type { ProviderRegistryOptions } from "../types/index.js";
|
|
11
2
|
/**
|
|
12
3
|
* Provider Registry - registers all providers with the factory
|
|
13
4
|
* This is where we migrate providers one by one to the new pattern
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ProviderFactory } from "./providerFactory.js";
|
|
2
|
-
// Lazy loading all providers to avoid circular dependencies
|
|
3
|
-
// Removed all static imports - providers loaded dynamically when needed
|
|
4
|
-
// This breaks the circular dependency chain completely
|
|
5
|
-
import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../types/index.js";
|
|
6
2
|
import { logger } from "../utils/logger.js";
|
|
3
|
+
import { AIProviderName, GoogleAIModels, OpenAIModels, } from "../constants/enums.js";
|
|
7
4
|
/**
|
|
8
5
|
* Provider Registry - registers all providers with the factory
|
|
9
6
|
* This is where we migrate providers one by one to the new pattern
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* for enterprise-grade AI safety.
|
|
7
7
|
*/
|
|
8
8
|
import { EventEmitter } from "events";
|
|
9
|
-
import type { HITLConfig, ConfirmationResult, HITLStatistics } from "
|
|
9
|
+
import type { HITLConfig, ConfirmationResult, HITLStatistics } from "../types/hitlTypes.js";
|
|
10
10
|
/**
|
|
11
11
|
* HITLManager - Central orchestrator for Human-in-the-Loop safety mechanisms
|
|
12
12
|
*
|
package/dist/lib/hitl/index.d.ts
CHANGED
|
@@ -4,5 +4,4 @@
|
|
|
4
4
|
* Simple barrel export for HITL components.
|
|
5
5
|
*/
|
|
6
6
|
export { HITLManager } from "./hitlManager.js";
|
|
7
|
-
export type { HITLConfig, HITLRule, ConfirmationRequest, ConfirmationResult, ConfirmationRequestEvent, ConfirmationResponseEvent, ConfirmationTimeoutEvent, HITLStatistics, HITLAuditLog, } from "./types.js";
|
|
8
7
|
export { HITLError, HITLUserRejectedError, HITLTimeoutError, HITLConfigurationError, } from "./hitlErrors.js";
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { AIProviderFactory } from "./core/factory.js";
|
|
10
10
|
export { AIProviderFactory };
|
|
11
|
-
export type { AIProvider,
|
|
11
|
+
export type { AIProvider, AIModelProviderConfig, StreamingOptions, ProviderAttempt, SupportedModelName, } from "./types/index.js";
|
|
12
12
|
export type { GenerateOptions, GenerateResult, EnhancedProvider, } from "./types/generateTypes.js";
|
|
13
13
|
export type { ToolContext } from "./sdk/toolRegistration.js";
|
|
14
14
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
15
15
|
export type { ToolResult, ToolDefinition } from "./types/tools.js";
|
|
16
|
-
export {
|
|
16
|
+
export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
|
|
17
|
+
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
17
18
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
18
19
|
export { dynamicModelProvider } from "./core/dynamicModels.js";
|
|
19
20
|
export type { DynamicModelConfig, ModelRegistry } from "./types/modelTypes.js";
|
|
20
21
|
import { NeuroLink } from "./neurolink.js";
|
|
21
22
|
export { NeuroLink };
|
|
22
|
-
export type { ProviderStatus, MCPStatus } from "./neurolink.js";
|
|
23
23
|
export type { MCPServerInfo } from "./types/mcpTypes.js";
|
|
24
24
|
export type { ObservabilityConfig, LangfuseConfig, OpenTelemetryConfig, } from "./types/observability.js";
|
|
25
25
|
export { buildObservabilityConfigFromEnv } from "./utils/observabilityHelpers.js";
|
|
@@ -84,7 +84,9 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
export { initializeMCPEcosystem, listMCPs, executeMCP, getMCPStats, mcpLogger, } from "./mcp/index.js";
|
|
87
|
-
export type { McpMetadata,
|
|
87
|
+
export type { McpMetadata, DiscoveredMcp } from "./types/mcpTypes.js";
|
|
88
|
+
export type { ExecutionContext, ToolInfo, ToolExecutionResult, } from "./types/tools.js";
|
|
89
|
+
export type { LogLevel } from "./utils/logger.js";
|
|
88
90
|
export declare function initializeTelemetry(): Promise<boolean>;
|
|
89
91
|
export declare function getTelemetryStatus(): Promise<{
|
|
90
92
|
enabled: boolean;
|
package/dist/lib/index.js
CHANGED
|
@@ -11,7 +11,8 @@ import { AIProviderFactory } from "./core/factory.js";
|
|
|
11
11
|
export { AIProviderFactory };
|
|
12
12
|
export { validateTool } from "./sdk/toolRegistration.js";
|
|
13
13
|
// Model enums
|
|
14
|
-
export {
|
|
14
|
+
export { DEFAULT_PROVIDER_CONFIGS } from "./types/index.js";
|
|
15
|
+
export { AIProviderName, BedrockModels, OpenAIModels, VertexModels, } from "./constants/enums.js";
|
|
15
16
|
// Utility exports
|
|
16
17
|
export { getBestProvider, getAvailableProviders, isValidProvider, } from "./utils/providerUtils.js";
|
|
17
18
|
// Dynamic Models exports
|
package/dist/lib/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/lib/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
|