@juspay/neurolink 7.29.2 → 7.30.0
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 +12 -0
- package/dist/cli/commands/config.d.ts +83 -83
- package/dist/cli/commands/mcp.js +39 -9
- package/dist/cli/commands/models.js +25 -21
- package/dist/cli/commands/ollama.js +2 -2
- package/dist/cli/factories/commandFactory.d.ts +8 -0
- package/dist/cli/factories/commandFactory.js +65 -65
- package/dist/cli/factories/ollamaCommandFactory.js +3 -1
- package/dist/cli/factories/sagemakerCommandFactory.js +3 -2
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +11 -11
- package/dist/cli/utils/envManager.js +5 -5
- package/dist/cli/utils/ollamaUtils.d.ts +12 -0
- package/dist/cli/utils/ollamaUtils.js +58 -42
- package/dist/config/configManager.js +5 -2
- package/dist/config/conversationMemoryConfig.js +5 -0
- package/dist/core/analytics.d.ts +2 -24
- package/dist/core/analytics.js +12 -17
- package/dist/core/baseProvider.d.ts +30 -1
- package/dist/core/baseProvider.js +180 -198
- package/dist/core/conversationMemoryManager.d.ts +9 -15
- package/dist/core/conversationMemoryManager.js +98 -57
- package/dist/core/dynamicModels.d.ts +4 -4
- package/dist/core/dynamicModels.js +7 -7
- package/dist/core/evaluation.d.ts +9 -9
- package/dist/core/evaluation.js +117 -65
- package/dist/core/evaluationProviders.d.ts +18 -2
- package/dist/core/evaluationProviders.js +15 -13
- package/dist/core/modelConfiguration.d.ts +63 -0
- package/dist/core/modelConfiguration.js +354 -290
- package/dist/core/streamAnalytics.d.ts +10 -5
- package/dist/core/streamAnalytics.js +10 -10
- package/dist/core/types.d.ts +22 -110
- package/dist/core/types.js +13 -0
- package/dist/factories/providerFactory.js +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/lib/config/configManager.js +5 -2
- package/dist/lib/config/conversationMemoryConfig.js +5 -0
- package/dist/lib/core/analytics.d.ts +2 -24
- package/dist/lib/core/analytics.js +12 -17
- package/dist/lib/core/baseProvider.d.ts +30 -1
- package/dist/lib/core/baseProvider.js +180 -198
- package/dist/lib/core/conversationMemoryManager.d.ts +9 -15
- package/dist/lib/core/conversationMemoryManager.js +98 -57
- package/dist/lib/core/dynamicModels.js +7 -7
- package/dist/lib/core/evaluation.d.ts +9 -9
- package/dist/lib/core/evaluation.js +117 -65
- package/dist/lib/core/evaluationProviders.d.ts +18 -2
- package/dist/lib/core/evaluationProviders.js +15 -13
- package/dist/lib/core/modelConfiguration.d.ts +63 -0
- package/dist/lib/core/modelConfiguration.js +354 -290
- package/dist/lib/core/streamAnalytics.d.ts +10 -5
- package/dist/lib/core/streamAnalytics.js +10 -10
- package/dist/lib/core/types.d.ts +22 -110
- package/dist/lib/core/types.js +13 -0
- package/dist/lib/factories/providerFactory.js +1 -1
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/mcp/externalServerManager.js +15 -6
- package/dist/lib/mcp/factory.js +1 -1
- package/dist/lib/mcp/index.d.ts +1 -1
- package/dist/lib/mcp/index.js +1 -1
- package/dist/lib/mcp/mcpCircuitBreaker.js +5 -1
- package/dist/lib/mcp/mcpClientFactory.js +3 -0
- package/dist/lib/mcp/registry.d.ts +3 -3
- package/dist/lib/mcp/registry.js +3 -3
- package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +5 -5
- package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +6 -6
- package/dist/lib/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/lib/mcp/toolDiscoveryService.js +8 -2
- package/dist/lib/mcp/toolRegistry.js +4 -4
- package/dist/lib/middleware/builtin/analytics.js +4 -4
- package/dist/lib/middleware/builtin/guardrails.js +2 -2
- package/dist/lib/middleware/registry.js +11 -2
- package/dist/lib/models/modelRegistry.d.ts +1 -1
- package/dist/lib/models/modelRegistry.js +3 -3
- package/dist/lib/models/modelResolver.d.ts +1 -1
- package/dist/lib/models/modelResolver.js +2 -2
- package/dist/lib/neurolink.d.ts +116 -9
- package/dist/lib/neurolink.js +718 -956
- package/dist/lib/providers/amazonSagemaker.d.ts +1 -1
- package/dist/lib/providers/amazonSagemaker.js +12 -3
- package/dist/lib/providers/anthropic.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +7 -6
- package/dist/lib/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/lib/providers/anthropicBaseProvider.js +4 -3
- 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 +2 -2
- package/dist/lib/providers/googleVertex.d.ts +40 -0
- package/dist/lib/providers/googleVertex.js +330 -274
- package/dist/lib/providers/huggingFace.js +1 -1
- package/dist/lib/providers/mistral.d.ts +1 -1
- package/dist/lib/providers/mistral.js +2 -2
- package/dist/lib/providers/ollama.d.ts +4 -0
- package/dist/lib/providers/ollama.js +38 -18
- package/dist/lib/providers/openAI.d.ts +1 -1
- package/dist/lib/providers/openAI.js +2 -2
- package/dist/lib/providers/sagemaker/adaptive-semaphore.js +7 -4
- package/dist/lib/providers/sagemaker/client.js +13 -3
- package/dist/lib/providers/sagemaker/config.js +5 -1
- package/dist/lib/providers/sagemaker/detection.js +19 -9
- package/dist/lib/providers/sagemaker/errors.d.ts +8 -1
- package/dist/lib/providers/sagemaker/errors.js +103 -20
- package/dist/lib/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/lib/providers/sagemaker/language-model.js +4 -4
- package/dist/lib/providers/sagemaker/parsers.js +14 -6
- package/dist/lib/providers/sagemaker/streaming.js +14 -3
- package/dist/lib/providers/sagemaker/types.d.ts +1 -1
- package/dist/lib/proxy/awsProxyIntegration.js +1 -1
- package/dist/lib/sdk/toolRegistration.d.ts +1 -1
- package/dist/lib/types/cli.d.ts +80 -8
- package/dist/lib/types/contextTypes.js +2 -2
- package/dist/lib/types/conversationTypes.d.ts +10 -0
- package/dist/lib/types/generateTypes.d.ts +2 -5
- package/dist/lib/types/providers.d.ts +81 -19
- package/dist/lib/types/providers.js +6 -6
- package/dist/lib/types/streamTypes.d.ts +4 -6
- package/dist/lib/types/typeAliases.d.ts +1 -1
- package/dist/lib/utils/analyticsUtils.d.ts +33 -0
- package/dist/lib/utils/analyticsUtils.js +76 -0
- package/dist/lib/utils/conversationMemoryUtils.d.ts +1 -2
- package/dist/lib/utils/conversationMemoryUtils.js +6 -7
- package/dist/lib/utils/errorHandling.js +4 -1
- package/dist/lib/utils/evaluationUtils.d.ts +27 -0
- package/dist/lib/utils/evaluationUtils.js +131 -0
- package/dist/lib/utils/optionsUtils.js +10 -1
- package/dist/lib/utils/performance.d.ts +1 -1
- package/dist/lib/utils/performance.js +15 -3
- package/dist/lib/utils/providerHealth.d.ts +48 -0
- package/dist/lib/utils/providerHealth.js +199 -254
- package/dist/lib/utils/providerUtils.js +2 -2
- package/dist/lib/utils/timeout.js +8 -3
- package/dist/mcp/externalServerManager.js +15 -6
- package/dist/mcp/factory.js +1 -1
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/mcpCircuitBreaker.js +5 -1
- package/dist/mcp/mcpClientFactory.js +3 -0
- package/dist/mcp/registry.d.ts +3 -3
- package/dist/mcp/registry.js +3 -3
- package/dist/mcp/servers/aiProviders/aiAnalysisTools.js +5 -5
- package/dist/mcp/servers/aiProviders/aiWorkflowTools.js +6 -6
- package/dist/mcp/servers/utilities/utilityServer.js +1 -1
- package/dist/mcp/toolDiscoveryService.js +8 -2
- package/dist/mcp/toolRegistry.js +4 -4
- package/dist/middleware/builtin/analytics.js +4 -4
- package/dist/middleware/builtin/guardrails.js +2 -2
- package/dist/middleware/registry.js +11 -2
- package/dist/models/modelRegistry.d.ts +1 -1
- package/dist/models/modelRegistry.js +3 -3
- package/dist/models/modelResolver.d.ts +1 -1
- package/dist/models/modelResolver.js +2 -2
- package/dist/neurolink.d.ts +116 -9
- package/dist/neurolink.js +718 -956
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/amazonSagemaker.js +12 -3
- package/dist/providers/anthropic.d.ts +1 -1
- package/dist/providers/anthropic.js +7 -6
- package/dist/providers/anthropicBaseProvider.d.ts +1 -1
- package/dist/providers/anthropicBaseProvider.js +4 -3
- 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 +2 -2
- package/dist/providers/googleVertex.d.ts +40 -0
- package/dist/providers/googleVertex.js +330 -274
- package/dist/providers/huggingFace.js +1 -1
- package/dist/providers/mistral.d.ts +1 -1
- package/dist/providers/mistral.js +2 -2
- package/dist/providers/ollama.d.ts +4 -0
- package/dist/providers/ollama.js +38 -18
- package/dist/providers/openAI.d.ts +1 -1
- package/dist/providers/openAI.js +2 -2
- package/dist/providers/sagemaker/adaptive-semaphore.js +7 -4
- package/dist/providers/sagemaker/client.js +13 -3
- package/dist/providers/sagemaker/config.js +5 -1
- package/dist/providers/sagemaker/detection.js +19 -9
- package/dist/providers/sagemaker/errors.d.ts +8 -1
- package/dist/providers/sagemaker/errors.js +103 -20
- package/dist/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/providers/sagemaker/language-model.js +4 -4
- package/dist/providers/sagemaker/parsers.js +14 -6
- package/dist/providers/sagemaker/streaming.js +14 -3
- package/dist/providers/sagemaker/types.d.ts +1 -1
- package/dist/proxy/awsProxyIntegration.js +1 -1
- package/dist/sdk/toolRegistration.d.ts +1 -1
- package/dist/types/cli.d.ts +80 -8
- package/dist/types/contextTypes.js +2 -2
- package/dist/types/conversationTypes.d.ts +10 -0
- package/dist/types/generateTypes.d.ts +2 -5
- package/dist/types/providers.d.ts +81 -19
- package/dist/types/providers.js +6 -6
- package/dist/types/streamTypes.d.ts +4 -6
- package/dist/types/typeAliases.d.ts +1 -1
- package/dist/utils/analyticsUtils.d.ts +33 -0
- package/dist/utils/analyticsUtils.js +76 -0
- package/dist/utils/conversationMemoryUtils.d.ts +1 -2
- package/dist/utils/conversationMemoryUtils.js +6 -7
- package/dist/utils/errorHandling.js +4 -1
- package/dist/utils/evaluationUtils.d.ts +27 -0
- package/dist/utils/evaluationUtils.js +131 -0
- package/dist/utils/optionsUtils.js +10 -1
- package/dist/utils/performance.d.ts +1 -1
- package/dist/utils/performance.js +15 -3
- package/dist/utils/providerHealth.d.ts +48 -0
- package/dist/utils/providerHealth.js +199 -254
- package/dist/utils/providerUtils.js +2 -2
- package/dist/utils/timeout.js +8 -3
- package/package.json +1 -1
- package/dist/context/ContextManager.d.ts +0 -28
- package/dist/context/ContextManager.js +0 -113
- package/dist/context/config.d.ts +0 -5
- package/dist/context/config.js +0 -42
- package/dist/context/types.d.ts +0 -20
- package/dist/context/types.js +0 -1
- package/dist/context/utils.d.ts +0 -7
- package/dist/context/utils.js +0 -8
- package/dist/lib/context/ContextManager.d.ts +0 -28
- package/dist/lib/context/ContextManager.js +0 -113
- package/dist/lib/context/config.d.ts +0 -5
- package/dist/lib/context/config.js +0 -42
- package/dist/lib/context/types.d.ts +0 -20
- package/dist/lib/context/types.js +0 -1
- package/dist/lib/context/utils.d.ts +0 -7
- package/dist/lib/context/utils.js +0 -8
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluation utilities for normalizing EvaluationData objects
|
|
3
|
+
* Provides helper functions to handle partial evaluation data and ensure
|
|
4
|
+
* complete EvaluationData objects with safe defaults
|
|
5
|
+
*/
|
|
6
|
+
import type { EvaluationData } from "../types/providers.js";
|
|
7
|
+
/**
|
|
8
|
+
* Normalize partial EvaluationData into a complete EvaluationData object
|
|
9
|
+
* with safe defaults for missing required fields
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeEvaluationData(partial: Partial<EvaluationData>): EvaluationData;
|
|
12
|
+
/**
|
|
13
|
+
* Create a default EvaluationData object for cases where no evaluation was performed
|
|
14
|
+
*/
|
|
15
|
+
export declare function createDefaultEvaluationData(overrides?: Partial<EvaluationData>): EvaluationData;
|
|
16
|
+
/**
|
|
17
|
+
* Check if EvaluationData indicates a successful evaluation
|
|
18
|
+
*/
|
|
19
|
+
export declare function isValidEvaluation(evaluation: EvaluationData): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Create EvaluationData for a failed evaluation attempt
|
|
22
|
+
*/
|
|
23
|
+
export declare function createFailedEvaluationData(error: string, overrides?: Partial<EvaluationData>): EvaluationData;
|
|
24
|
+
/**
|
|
25
|
+
* Merge multiple partial evaluation data objects into a normalized result
|
|
26
|
+
*/
|
|
27
|
+
export declare function mergeEvaluationData(...partials: Partial<EvaluationData>[]): EvaluationData;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluation utilities for normalizing EvaluationData objects
|
|
3
|
+
* Provides helper functions to handle partial evaluation data and ensure
|
|
4
|
+
* complete EvaluationData objects with safe defaults
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default values for required EvaluationData fields
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_EVALUATION_DATA = {
|
|
10
|
+
// Core scores (1-10 scale)
|
|
11
|
+
relevance: 0,
|
|
12
|
+
accuracy: 0,
|
|
13
|
+
completeness: 0,
|
|
14
|
+
overall: 0,
|
|
15
|
+
// Advanced insights
|
|
16
|
+
isOffTopic: false,
|
|
17
|
+
alertSeverity: "none",
|
|
18
|
+
reasoning: "",
|
|
19
|
+
// Metadata
|
|
20
|
+
evaluationModel: "unknown",
|
|
21
|
+
evaluationTime: 0,
|
|
22
|
+
// Enhanced metadata defaults
|
|
23
|
+
evaluationProvider: "unknown",
|
|
24
|
+
evaluationAttempt: 0,
|
|
25
|
+
evaluationConfig: {
|
|
26
|
+
mode: "default",
|
|
27
|
+
fallbackUsed: false,
|
|
28
|
+
costEstimate: 0,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Normalize partial EvaluationData into a complete EvaluationData object
|
|
33
|
+
* with safe defaults for missing required fields
|
|
34
|
+
*/
|
|
35
|
+
export function normalizeEvaluationData(partial) {
|
|
36
|
+
const normalized = {
|
|
37
|
+
...DEFAULT_EVALUATION_DATA,
|
|
38
|
+
...partial,
|
|
39
|
+
};
|
|
40
|
+
// Ensure scores are within valid range (0-10)
|
|
41
|
+
normalized.relevance = Math.max(0, Math.min(10, normalized.relevance));
|
|
42
|
+
normalized.accuracy = Math.max(0, Math.min(10, normalized.accuracy));
|
|
43
|
+
normalized.completeness = Math.max(0, Math.min(10, normalized.completeness));
|
|
44
|
+
normalized.overall = Math.max(0, Math.min(10, normalized.overall));
|
|
45
|
+
// Optional scores
|
|
46
|
+
if (normalized.domainAlignment !== undefined) {
|
|
47
|
+
normalized.domainAlignment = Math.max(0, Math.min(10, normalized.domainAlignment));
|
|
48
|
+
}
|
|
49
|
+
if (normalized.terminologyAccuracy !== undefined) {
|
|
50
|
+
normalized.terminologyAccuracy = Math.max(0, Math.min(10, normalized.terminologyAccuracy));
|
|
51
|
+
}
|
|
52
|
+
if (normalized.toolEffectiveness !== undefined) {
|
|
53
|
+
normalized.toolEffectiveness = Math.max(0, Math.min(10, normalized.toolEffectiveness));
|
|
54
|
+
}
|
|
55
|
+
// Validate alertSeverity enum
|
|
56
|
+
const validSeverities = ["low", "medium", "high", "none"];
|
|
57
|
+
if (!validSeverities.includes(normalized.alertSeverity)) {
|
|
58
|
+
normalized.alertSeverity = "none";
|
|
59
|
+
}
|
|
60
|
+
// Truncate reasoning and suggestedImprovements to enforce length constraints
|
|
61
|
+
normalized.reasoning = truncateString(normalized.reasoning, 150);
|
|
62
|
+
if (normalized.suggestedImprovements) {
|
|
63
|
+
normalized.suggestedImprovements = truncateString(normalized.suggestedImprovements, 100);
|
|
64
|
+
}
|
|
65
|
+
// Ensure evaluationTime is non-negative
|
|
66
|
+
normalized.evaluationTime = Math.max(0, normalized.evaluationTime);
|
|
67
|
+
// Ensure evaluationAttempt is positive
|
|
68
|
+
if (normalized.evaluationAttempt !== undefined) {
|
|
69
|
+
normalized.evaluationAttempt = Math.max(0, normalized.evaluationAttempt);
|
|
70
|
+
}
|
|
71
|
+
// Ensure evaluationConfig has required fields
|
|
72
|
+
if (normalized.evaluationConfig) {
|
|
73
|
+
normalized.evaluationConfig = {
|
|
74
|
+
mode: normalized.evaluationConfig.mode || "default",
|
|
75
|
+
fallbackUsed: Boolean(normalized.evaluationConfig.fallbackUsed),
|
|
76
|
+
costEstimate: Math.max(0, normalized.evaluationConfig.costEstimate || 0),
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return normalized;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Create a default EvaluationData object for cases where no evaluation was performed
|
|
83
|
+
*/
|
|
84
|
+
export function createDefaultEvaluationData(overrides = {}) {
|
|
85
|
+
return normalizeEvaluationData({
|
|
86
|
+
...overrides,
|
|
87
|
+
reasoning: overrides.reasoning || "No evaluation performed",
|
|
88
|
+
evaluationModel: overrides.evaluationModel || "none",
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Check if EvaluationData indicates a successful evaluation
|
|
93
|
+
*/
|
|
94
|
+
export function isValidEvaluation(evaluation) {
|
|
95
|
+
return (evaluation.evaluationModel !== "unknown" &&
|
|
96
|
+
evaluation.evaluationModel !== "none" &&
|
|
97
|
+
evaluation.reasoning.length > 0 &&
|
|
98
|
+
evaluation.overall > 0);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Create EvaluationData for a failed evaluation attempt
|
|
102
|
+
*/
|
|
103
|
+
export function createFailedEvaluationData(error, overrides = {}) {
|
|
104
|
+
return normalizeEvaluationData({
|
|
105
|
+
...overrides,
|
|
106
|
+
reasoning: `Evaluation failed: ${truncateString(error, 100)}`,
|
|
107
|
+
alertSeverity: "medium",
|
|
108
|
+
evaluationModel: overrides.evaluationModel || "error",
|
|
109
|
+
evaluationConfig: {
|
|
110
|
+
mode: "error",
|
|
111
|
+
fallbackUsed: true,
|
|
112
|
+
costEstimate: 0,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Helper function to truncate strings to a maximum length
|
|
118
|
+
*/
|
|
119
|
+
function truncateString(str, maxLength) {
|
|
120
|
+
if (str.length <= maxLength) {
|
|
121
|
+
return str;
|
|
122
|
+
}
|
|
123
|
+
return str.substring(0, maxLength - 3) + "...";
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Merge multiple partial evaluation data objects into a normalized result
|
|
127
|
+
*/
|
|
128
|
+
export function mergeEvaluationData(...partials) {
|
|
129
|
+
const merged = partials.reduce((acc, partial) => ({ ...acc, ...partial }), {});
|
|
130
|
+
return normalizeEvaluationData(merged);
|
|
131
|
+
}
|
|
@@ -42,7 +42,7 @@ export class OptionsEnhancer {
|
|
|
42
42
|
try {
|
|
43
43
|
return new SharedArrayBuffer(4); // 4 bytes for Int32
|
|
44
44
|
}
|
|
45
|
-
catch
|
|
45
|
+
catch {
|
|
46
46
|
// SharedArrayBuffer is defined but not usable (browser CORS headers not set)
|
|
47
47
|
if (typeof logger !== "undefined" && logger?.warn) {
|
|
48
48
|
logger.warn("[OptionsEnhancer] SharedArrayBuffer is defined but not usable. " +
|
|
@@ -304,6 +304,15 @@ export class OptionsEnhancer {
|
|
|
304
304
|
}
|
|
305
305
|
static applyLegacyMigration(options, enhancementOptions) {
|
|
306
306
|
const legacyMigration = enhancementOptions.legacyMigration;
|
|
307
|
+
if (!legacyMigration) {
|
|
308
|
+
throw new Error("Legacy migration configuration is required");
|
|
309
|
+
}
|
|
310
|
+
if (!legacyMigration.legacyContext) {
|
|
311
|
+
throw new Error("Legacy context is required for migration");
|
|
312
|
+
}
|
|
313
|
+
if (!legacyMigration.domainType) {
|
|
314
|
+
throw new Error("Domain type is required for migration");
|
|
315
|
+
}
|
|
307
316
|
// Convert legacy context to execution context
|
|
308
317
|
const executionContext = ContextConverter.convertBusinessContext(legacyMigration.legacyContext, legacyMigration.domainType, {
|
|
309
318
|
preserveLegacyFields: legacyMigration.preserveFields,
|
|
@@ -84,7 +84,7 @@ export declare class MemoryManager {
|
|
|
84
84
|
/**
|
|
85
85
|
* Decorator for tracking performance of async functions
|
|
86
86
|
*/
|
|
87
|
-
export declare function trackPerformance(operationName: string): <T extends (...args: unknown[]) => Promise<unknown>>(
|
|
87
|
+
export declare function trackPerformance(operationName: string): <T extends (...args: unknown[]) => Promise<unknown>>(_target: unknown, _propertyName: string, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T>;
|
|
88
88
|
/**
|
|
89
89
|
* Performance monitoring for CLI operations
|
|
90
90
|
*/
|
|
@@ -63,11 +63,20 @@ export class PerformanceTracker {
|
|
|
63
63
|
return `${operationName}: No metrics available`;
|
|
64
64
|
}
|
|
65
65
|
const memoryMB = (bytes) => (bytes / 1024 / 1024).toFixed(1);
|
|
66
|
+
if (!metric.memoryDelta) {
|
|
67
|
+
return [
|
|
68
|
+
`${operationName}:`,
|
|
69
|
+
` Duration: ${metric.duration}ms`,
|
|
70
|
+
` Memory Delta: Not available`,
|
|
71
|
+
].join("\n");
|
|
72
|
+
}
|
|
73
|
+
const signHeap = metric.memoryDelta.heapUsed >= 0 ? "+" : "-";
|
|
74
|
+
const signRss = metric.memoryDelta.rss >= 0 ? "+" : "-";
|
|
66
75
|
return [
|
|
67
76
|
`${operationName}:`,
|
|
68
77
|
` Duration: ${metric.duration}ms`,
|
|
69
|
-
` Memory Delta:
|
|
70
|
-
` RSS Delta:
|
|
78
|
+
` Memory Delta: ${signHeap}${memoryMB(Math.abs(metric.memoryDelta.heapUsed))}MB heap`,
|
|
79
|
+
` RSS Delta: ${signRss}${memoryMB(Math.abs(metric.memoryDelta.rss))}MB`,
|
|
71
80
|
].join("\n");
|
|
72
81
|
}
|
|
73
82
|
}
|
|
@@ -142,8 +151,11 @@ export class MemoryManager {
|
|
|
142
151
|
* Decorator for tracking performance of async functions
|
|
143
152
|
*/
|
|
144
153
|
export function trackPerformance(operationName) {
|
|
145
|
-
return function (
|
|
154
|
+
return function (_target, _propertyName, descriptor) {
|
|
146
155
|
const method = descriptor.value;
|
|
156
|
+
if (!method) {
|
|
157
|
+
throw new Error(`Method descriptor value is required for performance tracking`);
|
|
158
|
+
}
|
|
147
159
|
descriptor.value = async function (...args) {
|
|
148
160
|
globalTracker.start(operationName);
|
|
149
161
|
try {
|
|
@@ -72,6 +72,54 @@ export declare class ProviderHealthChecker {
|
|
|
72
72
|
* Provider-specific configuration checks
|
|
73
73
|
*/
|
|
74
74
|
private static checkProviderSpecificConfig;
|
|
75
|
+
/**
|
|
76
|
+
* Check Vertex AI configuration
|
|
77
|
+
*/
|
|
78
|
+
private static checkVertexAIConfig;
|
|
79
|
+
/**
|
|
80
|
+
* Get Vertex AI project ID from environment variables
|
|
81
|
+
*/
|
|
82
|
+
private static getVertexProjectId;
|
|
83
|
+
/**
|
|
84
|
+
* Check Vertex AI authentication
|
|
85
|
+
*/
|
|
86
|
+
private static checkVertexAuthentication;
|
|
87
|
+
/**
|
|
88
|
+
* Check Google Application Credentials file
|
|
89
|
+
*/
|
|
90
|
+
private static checkGoogleApplicationCredentials;
|
|
91
|
+
/**
|
|
92
|
+
* Check individual Google credentials
|
|
93
|
+
*/
|
|
94
|
+
private static checkIndividualGoogleCredentials;
|
|
95
|
+
/**
|
|
96
|
+
* Check AWS Bedrock configuration
|
|
97
|
+
*/
|
|
98
|
+
private static checkBedrockConfig;
|
|
99
|
+
/**
|
|
100
|
+
* Check AWS region configuration
|
|
101
|
+
*/
|
|
102
|
+
private static checkAWSRegion;
|
|
103
|
+
/**
|
|
104
|
+
* Check AWS credentials
|
|
105
|
+
*/
|
|
106
|
+
private static checkAWSCredentials;
|
|
107
|
+
/**
|
|
108
|
+
* Check Bedrock models
|
|
109
|
+
*/
|
|
110
|
+
private static checkBedrockModels;
|
|
111
|
+
/**
|
|
112
|
+
* Check Bedrock endpoint
|
|
113
|
+
*/
|
|
114
|
+
private static checkBedrockEndpoint;
|
|
115
|
+
/**
|
|
116
|
+
* Check Azure OpenAI configuration
|
|
117
|
+
*/
|
|
118
|
+
private static checkAzureConfig;
|
|
119
|
+
/**
|
|
120
|
+
* Check Ollama configuration
|
|
121
|
+
*/
|
|
122
|
+
private static checkOllamaConfig;
|
|
75
123
|
/**
|
|
76
124
|
* Get common models for a provider
|
|
77
125
|
*/
|