mcp-image 0.1.0 → 0.2.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/README.md +41 -17
- package/dist/api/geminiClient.d.ts +2 -12
- package/dist/api/geminiClient.d.ts.map +1 -1
- package/dist/api/geminiClient.js +28 -56
- package/dist/api/geminiClient.js.map +1 -1
- package/dist/api/geminiTextClient.d.ts +42 -0
- package/dist/api/geminiTextClient.d.ts.map +1 -0
- package/dist/api/geminiTextClient.js +198 -0
- package/dist/api/geminiTextClient.js.map +1 -0
- package/dist/business/__tests__/mocks/mcpSamplingClient.mock.d.ts +84 -0
- package/dist/business/__tests__/mocks/mcpSamplingClient.mock.d.ts.map +1 -0
- package/dist/business/__tests__/mocks/mcpSamplingClient.mock.js +100 -0
- package/dist/business/__tests__/mocks/mcpSamplingClient.mock.js.map +1 -0
- package/dist/business/bestPracticesEngine.d.ts +149 -0
- package/dist/business/bestPracticesEngine.d.ts.map +1 -0
- package/dist/business/bestPracticesEngine.js +781 -0
- package/dist/business/bestPracticesEngine.js.map +1 -0
- package/dist/business/complexityAssessment.d.ts +132 -0
- package/dist/business/complexityAssessment.d.ts.map +1 -0
- package/dist/business/complexityAssessment.js +488 -0
- package/dist/business/complexityAssessment.js.map +1 -0
- package/dist/business/fallbackStrategies.d.ts +177 -0
- package/dist/business/fallbackStrategies.d.ts.map +1 -0
- package/dist/business/fallbackStrategies.js +368 -0
- package/dist/business/fallbackStrategies.js.map +1 -0
- package/dist/business/imageGenerator.d.ts.map +1 -1
- package/dist/business/imageGenerator.js +26 -5
- package/dist/business/imageGenerator.js.map +1 -1
- package/dist/business/multiImage/aspectRatioController.d.ts +77 -0
- package/dist/business/multiImage/aspectRatioController.d.ts.map +1 -0
- package/dist/business/multiImage/aspectRatioController.js +580 -0
- package/dist/business/multiImage/aspectRatioController.js.map +1 -0
- package/dist/business/multiImage/multiImageCoordinator.d.ts +142 -0
- package/dist/business/multiImage/multiImageCoordinator.d.ts.map +1 -0
- package/dist/business/multiImage/multiImageCoordinator.js +801 -0
- package/dist/business/multiImage/multiImageCoordinator.js.map +1 -0
- package/dist/business/pomlTemplateEngine.d.ts +206 -0
- package/dist/business/pomlTemplateEngine.d.ts.map +1 -0
- package/dist/business/pomlTemplateEngine.js +737 -0
- package/dist/business/pomlTemplateEngine.js.map +1 -0
- package/dist/business/promptOrchestrator.d.ts +173 -0
- package/dist/business/promptOrchestrator.d.ts.map +1 -0
- package/dist/business/promptOrchestrator.js +490 -0
- package/dist/business/promptOrchestrator.js.map +1 -0
- package/dist/business/responseBuilder.d.ts +2 -2
- package/dist/business/responseBuilder.d.ts.map +1 -1
- package/dist/business/responseBuilder.js +6 -1
- package/dist/business/responseBuilder.js.map +1 -1
- package/dist/business/structuredPromptGenerator.d.ts +54 -0
- package/dist/business/structuredPromptGenerator.d.ts.map +1 -0
- package/dist/business/structuredPromptGenerator.js +208 -0
- package/dist/business/structuredPromptGenerator.js.map +1 -0
- package/dist/business/templateNormalizer.d.ts +81 -0
- package/dist/business/templateNormalizer.d.ts.map +1 -0
- package/dist/business/templateNormalizer.js +659 -0
- package/dist/business/templateNormalizer.js.map +1 -0
- package/dist/documentation/apiContractValidation.d.ts +62 -0
- package/dist/documentation/apiContractValidation.d.ts.map +1 -0
- package/dist/documentation/apiContractValidation.js +305 -0
- package/dist/documentation/apiContractValidation.js.map +1 -0
- package/dist/infrastructure/concurrency/concurrencyManager.d.ts +101 -0
- package/dist/infrastructure/concurrency/concurrencyManager.d.ts.map +1 -0
- package/dist/infrastructure/concurrency/concurrencyManager.js +345 -0
- package/dist/infrastructure/concurrency/concurrencyManager.js.map +1 -0
- package/dist/infrastructure/config/secureConfigManager.d.ts +319 -0
- package/dist/infrastructure/config/secureConfigManager.d.ts.map +1 -0
- package/dist/infrastructure/config/secureConfigManager.js +600 -0
- package/dist/infrastructure/config/secureConfigManager.js.map +1 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandler.d.ts +229 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandler.d.ts.map +1 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandler.js +61 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandler.js.map +1 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.d.ts +133 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.d.ts.map +1 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.js +569 -0
- package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.js.map +1 -0
- package/dist/infrastructure/mcp/MCPSamplingClient.d.ts +19 -0
- package/dist/infrastructure/mcp/MCPSamplingClient.d.ts.map +1 -0
- package/dist/infrastructure/mcp/MCPSamplingClient.js +31 -0
- package/dist/infrastructure/mcp/MCPSamplingClient.js.map +1 -0
- package/dist/infrastructure/mcp/RealMCPSamplingClient.d.ts +59 -0
- package/dist/infrastructure/mcp/RealMCPSamplingClient.d.ts.map +1 -0
- package/dist/infrastructure/mcp/RealMCPSamplingClient.js +271 -0
- package/dist/infrastructure/mcp/RealMCPSamplingClient.js.map +1 -0
- package/dist/infrastructure/metadata/generationMetadata.d.ts +72 -0
- package/dist/infrastructure/metadata/generationMetadata.d.ts.map +1 -0
- package/dist/infrastructure/metadata/generationMetadata.js +228 -0
- package/dist/infrastructure/metadata/generationMetadata.js.map +1 -0
- package/dist/infrastructure/monitoring/OrchestrationMetrics.d.ts +106 -0
- package/dist/infrastructure/monitoring/OrchestrationMetrics.d.ts.map +1 -0
- package/dist/infrastructure/monitoring/OrchestrationMetrics.js +456 -0
- package/dist/infrastructure/monitoring/OrchestrationMetrics.js.map +1 -0
- package/dist/infrastructure/monitoring/alertingSystem.d.ts +135 -0
- package/dist/infrastructure/monitoring/alertingSystem.d.ts.map +1 -0
- package/dist/infrastructure/monitoring/alertingSystem.js +549 -0
- package/dist/infrastructure/monitoring/alertingSystem.js.map +1 -0
- package/dist/infrastructure/optimization/performanceOptimizer.d.ts +89 -0
- package/dist/infrastructure/optimization/performanceOptimizer.d.ts.map +1 -0
- package/dist/infrastructure/optimization/performanceOptimizer.js +375 -0
- package/dist/infrastructure/optimization/performanceOptimizer.js.map +1 -0
- package/dist/infrastructure/security/AdvancedContentFilter.d.ts +99 -0
- package/dist/infrastructure/security/AdvancedContentFilter.d.ts.map +1 -0
- package/dist/infrastructure/security/AdvancedContentFilter.js +363 -0
- package/dist/infrastructure/security/AdvancedContentFilter.js.map +1 -0
- package/dist/infrastructure/security/MCPSecurityValidator.d.ts +62 -0
- package/dist/infrastructure/security/MCPSecurityValidator.d.ts.map +1 -0
- package/dist/infrastructure/security/MCPSecurityValidator.js +129 -0
- package/dist/infrastructure/security/MCPSecurityValidator.js.map +1 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddleware.d.ts +304 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddleware.d.ts.map +1 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddleware.js +61 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddleware.js.map +1 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.d.ts +62 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.d.ts.map +1 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.js +591 -0
- package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.js.map +1 -0
- package/dist/infrastructure/security/SecureMCPClient.d.ts +154 -0
- package/dist/infrastructure/security/SecureMCPClient.d.ts.map +1 -0
- package/dist/infrastructure/security/SecureMCPClient.js +292 -0
- package/dist/infrastructure/security/SecureMCPClient.js.map +1 -0
- package/dist/infrastructure/security/SecurityIncidentManager.d.ts +142 -0
- package/dist/infrastructure/security/SecurityIncidentManager.d.ts.map +1 -0
- package/dist/infrastructure/security/SecurityIncidentManager.js +260 -0
- package/dist/infrastructure/security/SecurityIncidentManager.js.map +1 -0
- package/dist/infrastructure/security/apiKeyManager.d.ts +297 -0
- package/dist/infrastructure/security/apiKeyManager.d.ts.map +1 -0
- package/dist/infrastructure/security/apiKeyManager.js +254 -0
- package/dist/infrastructure/security/apiKeyManager.js.map +1 -0
- package/dist/infrastructure/security/dataSanitizer.d.ts +157 -0
- package/dist/infrastructure/security/dataSanitizer.d.ts.map +1 -0
- package/dist/infrastructure/security/dataSanitizer.js +525 -0
- package/dist/infrastructure/security/dataSanitizer.js.map +1 -0
- package/dist/infrastructure/validation/inputValidator.d.ts +54 -0
- package/dist/infrastructure/validation/inputValidator.d.ts.map +1 -0
- package/dist/infrastructure/validation/inputValidator.js +362 -0
- package/dist/infrastructure/validation/inputValidator.js.map +1 -0
- package/dist/integration/parameterOptimizer.d.ts +69 -0
- package/dist/integration/parameterOptimizer.d.ts.map +1 -0
- package/dist/integration/parameterOptimizer.js +317 -0
- package/dist/integration/parameterOptimizer.js.map +1 -0
- package/dist/integration/twoStageProcessor.d.ts +66 -0
- package/dist/integration/twoStageProcessor.d.ts.map +1 -0
- package/dist/integration/twoStageProcessor.js +348 -0
- package/dist/integration/twoStageProcessor.js.map +1 -0
- package/dist/server/handlers/structuredPromptHandler.d.ts +65 -0
- package/dist/server/handlers/structuredPromptHandler.d.ts.map +1 -0
- package/dist/server/handlers/structuredPromptHandler.js +314 -0
- package/dist/server/handlers/structuredPromptHandler.js.map +1 -0
- package/dist/server/mcpServer.d.ts +16 -35
- package/dist/server/mcpServer.d.ts.map +1 -1
- package/dist/server/mcpServer.js +111 -150
- package/dist/server/mcpServer.js.map +1 -1
- package/dist/server/mcpServerWithOrchestration.d.ts +98 -0
- package/dist/server/mcpServerWithOrchestration.d.ts.map +1 -0
- package/dist/server/mcpServerWithOrchestration.js +284 -0
- package/dist/server/mcpServerWithOrchestration.js.map +1 -0
- package/dist/types/mcpOrchestrationTypes.d.ts +135 -0
- package/dist/types/mcpOrchestrationTypes.d.ts.map +1 -0
- package/dist/types/mcpOrchestrationTypes.js +28 -0
- package/dist/types/mcpOrchestrationTypes.js.map +1 -0
- package/dist/types/multiImageTypes.d.ts +328 -0
- package/dist/types/multiImageTypes.d.ts.map +1 -0
- package/dist/types/multiImageTypes.js +27 -0
- package/dist/types/multiImageTypes.js.map +1 -0
- package/dist/types/performanceTypes.d.ts +300 -0
- package/dist/types/performanceTypes.d.ts.map +1 -0
- package/dist/types/performanceTypes.js +50 -0
- package/dist/types/performanceTypes.js.map +1 -0
- package/dist/types/twoStageTypes.d.ts +123 -0
- package/dist/types/twoStageTypes.d.ts.map +1 -0
- package/dist/types/twoStageTypes.js +7 -0
- package/dist/types/twoStageTypes.js.map +1 -0
- package/dist/utils/config.d.ts +1 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +1 -0
- package/dist/utils/config.js.map +1 -1
- package/package.json +11 -4
- package/vitest.config.mjs +0 -47
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Orchestration Error Handler Implementation - Comprehensive error management
|
|
4
|
+
* Provides intelligent recovery, fallback strategies, and robust error handling
|
|
5
|
+
* Implements all error scenarios for structured prompt generation orchestration
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.OrchestrationErrorHandlerImpl = void 0;
|
|
9
|
+
const result_1 = require("../../types/result");
|
|
10
|
+
const orchestrationErrorHandler_1 = require("./orchestrationErrorHandler");
|
|
11
|
+
/**
|
|
12
|
+
* Default recovery options
|
|
13
|
+
*/
|
|
14
|
+
const DEFAULT_RECOVERY_OPTIONS = {
|
|
15
|
+
maxRetries: 3,
|
|
16
|
+
retryDelay: 1000,
|
|
17
|
+
enableFallback: true,
|
|
18
|
+
fallbackStrategy: 'graceful_degradation',
|
|
19
|
+
gracefulDegradation: true,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Default network recovery configuration
|
|
23
|
+
*/
|
|
24
|
+
const DEFAULT_NETWORK_CONFIG = {
|
|
25
|
+
maxRetries: 3,
|
|
26
|
+
baseDelay: 1000,
|
|
27
|
+
maxDelay: 30000,
|
|
28
|
+
timeoutMultiplier: 2,
|
|
29
|
+
enableExponentialBackoff: true,
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* OrchestrationErrorHandler implementation with comprehensive error management
|
|
33
|
+
*/
|
|
34
|
+
class OrchestrationErrorHandlerImpl {
|
|
35
|
+
constructor(networkConfig = DEFAULT_NETWORK_CONFIG) {
|
|
36
|
+
this.errorCounts = new Map();
|
|
37
|
+
this.errorTimestamps = new Map();
|
|
38
|
+
this.networkConfig = { ...networkConfig };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Handle errors with comprehensive recovery strategies
|
|
42
|
+
*/
|
|
43
|
+
async handleError(error, context, recoveryOptions = DEFAULT_RECOVERY_OPTIONS) {
|
|
44
|
+
const diagnosticInfo = this.createDiagnosticInfo(error, context);
|
|
45
|
+
const errorSeverity = this.classifyError(error);
|
|
46
|
+
const userMessage = this.generateUserMessage(error, context);
|
|
47
|
+
// Track error occurrence
|
|
48
|
+
this.trackErrorOccurrence(error, context);
|
|
49
|
+
// Determine recovery strategy based on error type and context
|
|
50
|
+
const recoveryAction = this.determineRecoveryAction(error, context, recoveryOptions, errorSeverity);
|
|
51
|
+
let fallbackApplied = false;
|
|
52
|
+
let result;
|
|
53
|
+
try {
|
|
54
|
+
switch (recoveryAction) {
|
|
55
|
+
case orchestrationErrorHandler_1.RecoveryAction.RETRY:
|
|
56
|
+
result = await this.attemptRetry(error, context, recoveryOptions);
|
|
57
|
+
break;
|
|
58
|
+
case orchestrationErrorHandler_1.RecoveryAction.FALLBACK:
|
|
59
|
+
result = await this.applyFallback(error, context);
|
|
60
|
+
fallbackApplied = true;
|
|
61
|
+
break;
|
|
62
|
+
case orchestrationErrorHandler_1.RecoveryAction.GRACEFUL_DEGRADATION:
|
|
63
|
+
result = await this.applyGracefulDegradation(error, context);
|
|
64
|
+
fallbackApplied = true;
|
|
65
|
+
break;
|
|
66
|
+
default:
|
|
67
|
+
// Return failure with comprehensive information
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
const success = result !== undefined;
|
|
71
|
+
const response = {
|
|
72
|
+
success,
|
|
73
|
+
fallbackApplied,
|
|
74
|
+
userMessage,
|
|
75
|
+
diagnosticInfo,
|
|
76
|
+
recoveryAction,
|
|
77
|
+
};
|
|
78
|
+
if (success) {
|
|
79
|
+
response.data = result;
|
|
80
|
+
}
|
|
81
|
+
return response;
|
|
82
|
+
}
|
|
83
|
+
catch (recoveryError) {
|
|
84
|
+
// Recovery attempt failed
|
|
85
|
+
return {
|
|
86
|
+
success: false,
|
|
87
|
+
fallbackApplied: false,
|
|
88
|
+
userMessage: this.generateFallbackUserMessage(error, recoveryError, context),
|
|
89
|
+
diagnosticInfo: {
|
|
90
|
+
...diagnosticInfo,
|
|
91
|
+
contextData: {
|
|
92
|
+
...diagnosticInfo.contextData,
|
|
93
|
+
recoveryError: recoveryError instanceof Error ? recoveryError.message : 'Unknown recovery error',
|
|
94
|
+
originalError: error.message,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
recoveryAction: orchestrationErrorHandler_1.RecoveryAction.FAIL_SAFE,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Validate input with detailed error reporting
|
|
103
|
+
*/
|
|
104
|
+
async validateInput(input, schema) {
|
|
105
|
+
const errors = [];
|
|
106
|
+
const warnings = [];
|
|
107
|
+
// Type validation
|
|
108
|
+
if (schema.type === 'string' && typeof input !== 'string') {
|
|
109
|
+
errors.push({
|
|
110
|
+
field: 'root',
|
|
111
|
+
message: `Expected type string, got ${typeof input}`,
|
|
112
|
+
severity: orchestrationErrorHandler_1.ErrorSeverity.FATAL,
|
|
113
|
+
suggestion: `Please provide input of type ${schema.type}`,
|
|
114
|
+
code: 'TYPE_MISMATCH',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
// String-specific validations
|
|
118
|
+
if (schema.type === 'string' && typeof input === 'string') {
|
|
119
|
+
if (schema.minLength !== undefined && input.length < schema.minLength) {
|
|
120
|
+
errors.push({
|
|
121
|
+
field: 'root',
|
|
122
|
+
message: `Input too short. Minimum length: ${schema.minLength}, got: ${input.length}`,
|
|
123
|
+
severity: orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE,
|
|
124
|
+
suggestion: 'Provide a more detailed input',
|
|
125
|
+
code: 'MIN_LENGTH_VIOLATION',
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (schema.maxLength !== undefined && input.length > schema.maxLength) {
|
|
129
|
+
warnings.push({
|
|
130
|
+
field: 'root',
|
|
131
|
+
message: `Input exceeds recommended length: ${schema.maxLength}, got: ${input.length}`,
|
|
132
|
+
suggestion: 'Consider shortening the input for better processing',
|
|
133
|
+
code: 'MAX_LENGTH_WARNING',
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
if (schema.pattern && !schema.pattern.test(input)) {
|
|
137
|
+
errors.push({
|
|
138
|
+
field: 'root',
|
|
139
|
+
message: 'Input does not match required pattern',
|
|
140
|
+
severity: orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE,
|
|
141
|
+
suggestion: 'Ensure input follows the expected format',
|
|
142
|
+
code: 'PATTERN_MISMATCH',
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const isValid = errors.length === 0;
|
|
147
|
+
return {
|
|
148
|
+
valid: isValid,
|
|
149
|
+
errors,
|
|
150
|
+
warnings,
|
|
151
|
+
normalizedInput: isValid ? input : undefined,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Manage resource contention for concurrent operations
|
|
156
|
+
*/
|
|
157
|
+
async manageResourceContention(operation) {
|
|
158
|
+
try {
|
|
159
|
+
// This is a simplified implementation
|
|
160
|
+
// In a real system, this would integrate with the ConcurrencyManager
|
|
161
|
+
// Check if operation can proceed based on priority and current load
|
|
162
|
+
const canProceed = await this.checkOperationViability(operation);
|
|
163
|
+
if (!canProceed) {
|
|
164
|
+
return (0, result_1.Err)(new Error(`Resource contention detected for operation ${operation.id}. System at capacity.`));
|
|
165
|
+
}
|
|
166
|
+
return (0, result_1.Ok)({ message: 'Operation can proceed', operationId: operation.id });
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
return (0, result_1.Err)(new Error(`Failed to manage resource contention: ${error}`));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Handle network-specific errors with intelligent retry
|
|
174
|
+
*/
|
|
175
|
+
async handleNetworkErrors(networkError, context) {
|
|
176
|
+
const errorType = this.classifyNetworkError(networkError);
|
|
177
|
+
switch (errorType) {
|
|
178
|
+
case orchestrationErrorHandler_1.NetworkErrorType.TIMEOUT:
|
|
179
|
+
return this.handleTimeout(networkError, context);
|
|
180
|
+
case orchestrationErrorHandler_1.NetworkErrorType.RATE_LIMIT:
|
|
181
|
+
return this.handleRateLimit(networkError, context);
|
|
182
|
+
case orchestrationErrorHandler_1.NetworkErrorType.CONNECTION_FAILED:
|
|
183
|
+
return this.handleConnectionFailure(networkError, context);
|
|
184
|
+
case orchestrationErrorHandler_1.NetworkErrorType.SERVICE_UNAVAILABLE:
|
|
185
|
+
return this.handleServiceUnavailable(networkError, context);
|
|
186
|
+
case orchestrationErrorHandler_1.NetworkErrorType.AUTHENTICATION_FAILED:
|
|
187
|
+
return this.handleAuthenticationFailure(networkError, context);
|
|
188
|
+
default:
|
|
189
|
+
return this.handleUnknownNetworkError(networkError, context);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Classify errors for appropriate handling strategy
|
|
194
|
+
*/
|
|
195
|
+
classifyError(error) {
|
|
196
|
+
const errorMessage = error.message.toLowerCase();
|
|
197
|
+
// Fatal errors - cannot recover
|
|
198
|
+
if (errorMessage.includes('authentication') ||
|
|
199
|
+
errorMessage.includes('permission denied') ||
|
|
200
|
+
errorMessage.includes('invalid api key')) {
|
|
201
|
+
return orchestrationErrorHandler_1.ErrorSeverity.FATAL;
|
|
202
|
+
}
|
|
203
|
+
// Degraded service - partial functionality available
|
|
204
|
+
if (errorMessage.includes('rate limit') ||
|
|
205
|
+
errorMessage.includes('quota exceeded') ||
|
|
206
|
+
errorMessage.includes('service unavailable') ||
|
|
207
|
+
errorMessage.includes('timeout')) {
|
|
208
|
+
return orchestrationErrorHandler_1.ErrorSeverity.DEGRADED;
|
|
209
|
+
}
|
|
210
|
+
// API and processing errors that can be recovered with fallback
|
|
211
|
+
if (errorMessage.includes('invalid api response') ||
|
|
212
|
+
errorMessage.includes('malformed') ||
|
|
213
|
+
errorMessage.includes('json') ||
|
|
214
|
+
errorMessage.includes('missing') ||
|
|
215
|
+
errorMessage.includes('empty prompt') ||
|
|
216
|
+
errorMessage.includes('unsafe content')) {
|
|
217
|
+
return orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE;
|
|
218
|
+
}
|
|
219
|
+
// Default to recoverable for unknown errors
|
|
220
|
+
return orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Generate user-friendly error messages
|
|
224
|
+
*/
|
|
225
|
+
generateUserMessage(error, context) {
|
|
226
|
+
const errorSeverity = this.classifyError(error);
|
|
227
|
+
const operation = context.operation.replace(/_/g, ' ');
|
|
228
|
+
const errorMessage = error.message.toLowerCase();
|
|
229
|
+
// Special handling for specific error scenarios - these take priority
|
|
230
|
+
if (errorMessage.includes('invalid api response') || errorMessage.includes('malformed')) {
|
|
231
|
+
return 'API response issue detected. processing continued using alternative methods.';
|
|
232
|
+
}
|
|
233
|
+
if (errorMessage.includes('json') || error instanceof SyntaxError) {
|
|
234
|
+
return 'Structured prompt generation experiencing temporary issue. System will continue processing.';
|
|
235
|
+
}
|
|
236
|
+
if (errorMessage.includes('missing') && errorMessage.includes('field')) {
|
|
237
|
+
return 'Data structure issue resolved using alternative processing methods.';
|
|
238
|
+
}
|
|
239
|
+
if (errorMessage.includes('empty prompt')) {
|
|
240
|
+
return 'Empty prompt detected - using creative fallback approach for image generation.';
|
|
241
|
+
}
|
|
242
|
+
switch (errorSeverity) {
|
|
243
|
+
case orchestrationErrorHandler_1.ErrorSeverity.FATAL:
|
|
244
|
+
return `Unable to complete ${operation}. Please check your configuration and try again.`;
|
|
245
|
+
case orchestrationErrorHandler_1.ErrorSeverity.DEGRADED:
|
|
246
|
+
return `${operation} is experiencing temporary issues. Processing continued with alternative methods.`;
|
|
247
|
+
case orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE:
|
|
248
|
+
if (context.retryCount > 0) {
|
|
249
|
+
return `Retrying ${operation} (attempt ${context.retryCount + 1}). Please wait a moment.`;
|
|
250
|
+
}
|
|
251
|
+
return `Temporary issue with ${operation}. The system will attempt to recover automatically.`;
|
|
252
|
+
default:
|
|
253
|
+
return `An unexpected issue occurred during ${operation}. Please try again.`;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Create diagnostic information for debugging
|
|
258
|
+
*/
|
|
259
|
+
createDiagnosticInfo(error, context) {
|
|
260
|
+
const contextData = {
|
|
261
|
+
operation: context.operation,
|
|
262
|
+
stage: context.stage,
|
|
263
|
+
sessionId: context.sessionId,
|
|
264
|
+
retryCount: context.retryCount,
|
|
265
|
+
userFacing: context.userFacing,
|
|
266
|
+
errorName: error.name,
|
|
267
|
+
errorMessage: error.message,
|
|
268
|
+
metadata: context.metadata || {},
|
|
269
|
+
};
|
|
270
|
+
// Add specific data for missing fields errors
|
|
271
|
+
if (error.message.toLowerCase().includes('missing') &&
|
|
272
|
+
error.message.toLowerCase().includes('field')) {
|
|
273
|
+
contextData['missingFields'] = ['structuredPrompt'];
|
|
274
|
+
}
|
|
275
|
+
return {
|
|
276
|
+
errorCode: this.generateErrorCode(error, context),
|
|
277
|
+
timestamp: new Date(),
|
|
278
|
+
stackTrace: error.stack || '',
|
|
279
|
+
contextData,
|
|
280
|
+
requestId: this.generateRequestId(context),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
// Private helper methods
|
|
284
|
+
/**
|
|
285
|
+
* Track error occurrence for pattern detection
|
|
286
|
+
*/
|
|
287
|
+
trackErrorOccurrence(error, context) {
|
|
288
|
+
const errorKey = `${context.operation}_${error.name}`;
|
|
289
|
+
// Update count
|
|
290
|
+
const currentCount = this.errorCounts.get(errorKey) || 0;
|
|
291
|
+
this.errorCounts.set(errorKey, currentCount + 1);
|
|
292
|
+
// Update timestamps
|
|
293
|
+
const timestamps = this.errorTimestamps.get(errorKey) || [];
|
|
294
|
+
timestamps.push(new Date());
|
|
295
|
+
// Keep only recent timestamps (last 10 minutes)
|
|
296
|
+
const tenMinutesAgo = new Date(Date.now() - 10 * 60 * 1000);
|
|
297
|
+
const recentTimestamps = timestamps.filter((ts) => ts > tenMinutesAgo);
|
|
298
|
+
this.errorTimestamps.set(errorKey, recentTimestamps);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Determine appropriate recovery action
|
|
302
|
+
*/
|
|
303
|
+
determineRecoveryAction(error, context, options, severity) {
|
|
304
|
+
if (severity === orchestrationErrorHandler_1.ErrorSeverity.FATAL) {
|
|
305
|
+
return orchestrationErrorHandler_1.RecoveryAction.FAIL_SAFE;
|
|
306
|
+
}
|
|
307
|
+
// For API response errors, always attempt fallback first
|
|
308
|
+
const errorMessage = error.message.toLowerCase();
|
|
309
|
+
if (errorMessage.includes('invalid api response') ||
|
|
310
|
+
errorMessage.includes('malformed') ||
|
|
311
|
+
errorMessage.includes('json') ||
|
|
312
|
+
errorMessage.includes('missing') ||
|
|
313
|
+
errorMessage.includes('empty prompt')) {
|
|
314
|
+
return orchestrationErrorHandler_1.RecoveryAction.FALLBACK;
|
|
315
|
+
}
|
|
316
|
+
if (context.retryCount < options.maxRetries && severity === orchestrationErrorHandler_1.ErrorSeverity.RECOVERABLE) {
|
|
317
|
+
return orchestrationErrorHandler_1.RecoveryAction.RETRY;
|
|
318
|
+
}
|
|
319
|
+
if (options.enableFallback) {
|
|
320
|
+
return severity === orchestrationErrorHandler_1.ErrorSeverity.DEGRADED
|
|
321
|
+
? orchestrationErrorHandler_1.RecoveryAction.GRACEFUL_DEGRADATION
|
|
322
|
+
: orchestrationErrorHandler_1.RecoveryAction.FALLBACK;
|
|
323
|
+
}
|
|
324
|
+
return orchestrationErrorHandler_1.RecoveryAction.FAIL_SAFE;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Attempt retry with exponential backoff
|
|
328
|
+
*/
|
|
329
|
+
async attemptRetry(_error, context, options) {
|
|
330
|
+
const delay = this.calculateRetryDelay(context.retryCount, options.retryDelay);
|
|
331
|
+
await this.delay(delay);
|
|
332
|
+
// In a real implementation, this would re-execute the original operation
|
|
333
|
+
// For now, return undefined to indicate retry attempt was made
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Apply fallback processing
|
|
338
|
+
*/
|
|
339
|
+
async applyFallback(_error, context) {
|
|
340
|
+
// Implement context-specific fallback logic
|
|
341
|
+
switch (context.stage) {
|
|
342
|
+
case orchestrationErrorHandler_1.ProcessingStage.POML_STRUCTURING:
|
|
343
|
+
// Fallback to basic prompt structuring
|
|
344
|
+
return { fallbackType: 'basic_structuring', originalPrompt: true };
|
|
345
|
+
case orchestrationErrorHandler_1.ProcessingStage.BEST_PRACTICES:
|
|
346
|
+
// Fallback to original prompt without enhancement
|
|
347
|
+
return { fallbackType: 'original_prompt', enhanced: false };
|
|
348
|
+
case orchestrationErrorHandler_1.ProcessingStage.INPUT_VALIDATION:
|
|
349
|
+
// Provide creative fallback for empty prompts
|
|
350
|
+
return {
|
|
351
|
+
fallbackType: 'creative_fallback',
|
|
352
|
+
prompt: 'Generate a creative image',
|
|
353
|
+
};
|
|
354
|
+
default:
|
|
355
|
+
// Generic fallback
|
|
356
|
+
return { fallbackType: 'generic_fallback', processed: true };
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Apply graceful degradation
|
|
361
|
+
*/
|
|
362
|
+
async applyGracefulDegradation(_error, context) {
|
|
363
|
+
// Provide partial functionality based on context
|
|
364
|
+
switch (context.stage) {
|
|
365
|
+
case orchestrationErrorHandler_1.ProcessingStage.BEST_PRACTICES:
|
|
366
|
+
// Apply simplified best practices
|
|
367
|
+
return { degradedType: 'simplified_enhancement', partial: true };
|
|
368
|
+
default:
|
|
369
|
+
// Generic graceful degradation
|
|
370
|
+
return { degradedType: 'basic_processing', functional: true };
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Generate fallback user message when recovery fails
|
|
375
|
+
*/
|
|
376
|
+
generateFallbackUserMessage(_originalError, _recoveryError, context) {
|
|
377
|
+
return `Unable to recover from ${context.operation.replace(/_/g, ' ')} error. Please try again later or contact support if the issue persists.`;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Check if operation can proceed given current constraints
|
|
381
|
+
*/
|
|
382
|
+
async checkOperationViability(operation) {
|
|
383
|
+
// Simplified viability check
|
|
384
|
+
// In real implementation, this would check actual system resources
|
|
385
|
+
// Allow operation if estimated duration is reasonable
|
|
386
|
+
return operation.estimatedDuration < 5 * 60 * 1000; // 5 minutes max
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
389
|
+
* Classify network error for specific handling
|
|
390
|
+
*/
|
|
391
|
+
classifyNetworkError(error) {
|
|
392
|
+
if (error.type) {
|
|
393
|
+
return error.type;
|
|
394
|
+
}
|
|
395
|
+
const message = error.message.toLowerCase();
|
|
396
|
+
if (message.includes('timeout')) {
|
|
397
|
+
return orchestrationErrorHandler_1.NetworkErrorType.TIMEOUT;
|
|
398
|
+
}
|
|
399
|
+
if (message.includes('rate limit') || message.includes('429')) {
|
|
400
|
+
return orchestrationErrorHandler_1.NetworkErrorType.RATE_LIMIT;
|
|
401
|
+
}
|
|
402
|
+
if (message.includes('connection') || message.includes('ECONNREFUSED')) {
|
|
403
|
+
return orchestrationErrorHandler_1.NetworkErrorType.CONNECTION_FAILED;
|
|
404
|
+
}
|
|
405
|
+
if (message.includes('service unavailable') || message.includes('503')) {
|
|
406
|
+
return orchestrationErrorHandler_1.NetworkErrorType.SERVICE_UNAVAILABLE;
|
|
407
|
+
}
|
|
408
|
+
if (message.includes('401') || message.includes('403')) {
|
|
409
|
+
return orchestrationErrorHandler_1.NetworkErrorType.AUTHENTICATION_FAILED;
|
|
410
|
+
}
|
|
411
|
+
return orchestrationErrorHandler_1.NetworkErrorType.UNKNOWN;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Handle timeout errors
|
|
415
|
+
*/
|
|
416
|
+
async handleTimeout(_error, context) {
|
|
417
|
+
if (context.retryCount < this.networkConfig.maxRetries) {
|
|
418
|
+
const backoffDelay = this.calculateExponentialBackoff(context.retryCount);
|
|
419
|
+
return {
|
|
420
|
+
action: orchestrationErrorHandler_1.RecoveryAction.RETRY,
|
|
421
|
+
message: `Request timed out - retrying in ${Math.round(backoffDelay / 1000)} seconds`,
|
|
422
|
+
userFacing: true,
|
|
423
|
+
estimatedRecoveryTime: backoffDelay,
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
action: orchestrationErrorHandler_1.RecoveryAction.FALLBACK,
|
|
428
|
+
message: 'Request timeout - using simplified processing',
|
|
429
|
+
userFacing: true,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Handle rate limit errors
|
|
434
|
+
*/
|
|
435
|
+
async handleRateLimit(error, _context) {
|
|
436
|
+
const retryAfter = error.retryAfter || 60; // Default 60 seconds
|
|
437
|
+
return {
|
|
438
|
+
action: orchestrationErrorHandler_1.RecoveryAction.RETRY,
|
|
439
|
+
message: `Rate limit reached - retrying in ${retryAfter} seconds`,
|
|
440
|
+
userFacing: true,
|
|
441
|
+
estimatedRecoveryTime: retryAfter * 1000,
|
|
442
|
+
additionalData: { retryAfter },
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Handle connection failures
|
|
447
|
+
*/
|
|
448
|
+
async handleConnectionFailure(_error, context) {
|
|
449
|
+
if (context.retryCount < 2) {
|
|
450
|
+
// Fewer retries for connection issues
|
|
451
|
+
return {
|
|
452
|
+
action: orchestrationErrorHandler_1.RecoveryAction.RETRY,
|
|
453
|
+
message: 'Connection issue - retrying with different endpoint',
|
|
454
|
+
userFacing: true,
|
|
455
|
+
estimatedRecoveryTime: 5000,
|
|
456
|
+
};
|
|
457
|
+
}
|
|
458
|
+
return {
|
|
459
|
+
action: orchestrationErrorHandler_1.RecoveryAction.FALLBACK,
|
|
460
|
+
message: 'Connection unavailable - using cached or simplified processing',
|
|
461
|
+
userFacing: true,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Handle service unavailable errors
|
|
466
|
+
*/
|
|
467
|
+
async handleServiceUnavailable(_error, _context) {
|
|
468
|
+
return {
|
|
469
|
+
action: orchestrationErrorHandler_1.RecoveryAction.GRACEFUL_DEGRADATION,
|
|
470
|
+
message: 'Service temporarily unavailable - continuing with reduced functionality',
|
|
471
|
+
userFacing: true,
|
|
472
|
+
estimatedRecoveryTime: 120000, // 2 minutes
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Handle authentication failures
|
|
477
|
+
*/
|
|
478
|
+
async handleAuthenticationFailure(_error, _context) {
|
|
479
|
+
return {
|
|
480
|
+
action: orchestrationErrorHandler_1.RecoveryAction.FAIL_SAFE,
|
|
481
|
+
message: 'Authentication failed - please check your API configuration',
|
|
482
|
+
userFacing: true,
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Handle unknown network errors
|
|
487
|
+
*/
|
|
488
|
+
async handleUnknownNetworkError(_error, context) {
|
|
489
|
+
if (context.retryCount < 1) {
|
|
490
|
+
// Single retry for unknown errors
|
|
491
|
+
return {
|
|
492
|
+
action: orchestrationErrorHandler_1.RecoveryAction.RETRY,
|
|
493
|
+
message: 'Network issue detected - attempting retry',
|
|
494
|
+
userFacing: true,
|
|
495
|
+
estimatedRecoveryTime: 3000,
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
return {
|
|
499
|
+
action: orchestrationErrorHandler_1.RecoveryAction.FALLBACK,
|
|
500
|
+
message: 'Network error - continuing with alternative processing',
|
|
501
|
+
userFacing: true,
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Calculate retry delay with exponential backoff
|
|
506
|
+
*/
|
|
507
|
+
calculateRetryDelay(retryCount, baseDelay) {
|
|
508
|
+
return Math.min(baseDelay * 2 ** retryCount, this.networkConfig.maxDelay);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Calculate exponential backoff delay
|
|
512
|
+
*/
|
|
513
|
+
calculateExponentialBackoff(retryCount) {
|
|
514
|
+
const delay = this.networkConfig.baseDelay * this.networkConfig.timeoutMultiplier ** retryCount;
|
|
515
|
+
return Math.min(delay, this.networkConfig.maxDelay);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Sleep for specified milliseconds
|
|
519
|
+
*/
|
|
520
|
+
async delay(ms) {
|
|
521
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Generate error code based on error and context
|
|
525
|
+
*/
|
|
526
|
+
generateErrorCode(error, context) {
|
|
527
|
+
const errorMessage = error.message.toLowerCase();
|
|
528
|
+
// Special error codes based on message content
|
|
529
|
+
if (errorMessage.includes('invalid api response') || errorMessage.includes('malformed')) {
|
|
530
|
+
return 'INVALID_API_RESPONSE';
|
|
531
|
+
}
|
|
532
|
+
if (errorMessage.includes('json') || error instanceof SyntaxError) {
|
|
533
|
+
return 'MALFORMED_JSON';
|
|
534
|
+
}
|
|
535
|
+
if (errorMessage.includes('missing') && errorMessage.includes('field')) {
|
|
536
|
+
return 'MISSING_REQUIRED_FIELD';
|
|
537
|
+
}
|
|
538
|
+
if (errorMessage.includes('empty prompt')) {
|
|
539
|
+
return 'EMPTY_PROMPT';
|
|
540
|
+
}
|
|
541
|
+
if (errorMessage.includes('oversized') || errorMessage.includes('too long')) {
|
|
542
|
+
return 'PROMPT_TOO_LONG';
|
|
543
|
+
}
|
|
544
|
+
if (errorMessage.includes('encoding')) {
|
|
545
|
+
return 'ENCODING_ERROR';
|
|
546
|
+
}
|
|
547
|
+
if (errorMessage.includes('timeout')) {
|
|
548
|
+
return 'OPERATION_TIMEOUT';
|
|
549
|
+
}
|
|
550
|
+
if (errorMessage.includes('rate limit') || errorMessage.includes('quota')) {
|
|
551
|
+
return 'RATE_LIMIT_EXCEEDED';
|
|
552
|
+
}
|
|
553
|
+
if (errorMessage.includes('configuration') || errorMessage.includes('config')) {
|
|
554
|
+
return 'CONFIGURATION_ERROR';
|
|
555
|
+
}
|
|
556
|
+
// Default fallback with context
|
|
557
|
+
const stage = context.stage.toUpperCase();
|
|
558
|
+
const errorType = error.name.toUpperCase().replace('ERROR', '');
|
|
559
|
+
return `${stage}_${errorType}_${Date.now().toString().slice(-4)}`;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Generate unique request ID
|
|
563
|
+
*/
|
|
564
|
+
generateRequestId(context) {
|
|
565
|
+
return `${context.sessionId}-${context.operation}-${Date.now()}`;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
exports.OrchestrationErrorHandlerImpl = OrchestrationErrorHandlerImpl;
|
|
569
|
+
//# sourceMappingURL=orchestrationErrorHandlerImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestrationErrorHandlerImpl.js","sourceRoot":"","sources":["../../../src/infrastructure/errorHandling/orchestrationErrorHandlerImpl.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAGH,+CAA4C;AAa5C,2EAKoC;AAapC;;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C9B,CAAC;QAED,gCAAgC;QAChC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,CAAA;QACzC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA;QAC/D,OAAO,GAAG,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACnE,CAAC;IAED;;OAEG;IACK,iBAAiB,CAAC,OAAqB;QAC7C,OAAO,GAAG,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAA;IAClE,CAAC;CACF;AAzrBD,sEAyrBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Sampling Client Exports and Factory
|
|
3
|
+
* Clean architecture with no environment-based branching
|
|
4
|
+
*/
|
|
5
|
+
export type { MCPSamplingClient, MCPSamplingConfig, MCPSamplingResult, } from '../../business/__tests__/mocks/mcpSamplingClient.mock';
|
|
6
|
+
export { RealMCPSamplingClient } from './RealMCPSamplingClient';
|
|
7
|
+
export { RealMCPSamplingClient as MCPSamplingClientImpl } from './RealMCPSamplingClient';
|
|
8
|
+
import { RealMCPSamplingClient } from './RealMCPSamplingClient';
|
|
9
|
+
import type { MCPSamplingConfig } from '../../business/__tests__/mocks/mcpSamplingClient.mock';
|
|
10
|
+
/**
|
|
11
|
+
* Factory function to create MCP Sampling Client
|
|
12
|
+
* Always returns the real implementation for production use
|
|
13
|
+
* Tests should explicitly use MockMCPSamplingClient
|
|
14
|
+
*
|
|
15
|
+
* @param config - Configuration for the client
|
|
16
|
+
* @returns RealMCPSamplingClient instance
|
|
17
|
+
*/
|
|
18
|
+
export declare function createMCPSamplingClient(config?: Partial<MCPSamplingConfig>): RealMCPSamplingClient;
|
|
19
|
+
//# sourceMappingURL=MCPSamplingClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MCPSamplingClient.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/mcp/MCPSamplingClient.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uDAAuD,CAAA;AAG9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,EAAE,qBAAqB,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAExF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAA;AAE9F;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAClC,qBAAqB,CAOvB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* MCP Sampling Client Exports and Factory
|
|
4
|
+
* Clean architecture with no environment-based branching
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.MCPSamplingClientImpl = exports.RealMCPSamplingClient = void 0;
|
|
8
|
+
exports.createMCPSamplingClient = createMCPSamplingClient;
|
|
9
|
+
// Re-export the real implementation
|
|
10
|
+
var RealMCPSamplingClient_1 = require("./RealMCPSamplingClient");
|
|
11
|
+
Object.defineProperty(exports, "RealMCPSamplingClient", { enumerable: true, get: function () { return RealMCPSamplingClient_1.RealMCPSamplingClient; } });
|
|
12
|
+
var RealMCPSamplingClient_2 = require("./RealMCPSamplingClient");
|
|
13
|
+
Object.defineProperty(exports, "MCPSamplingClientImpl", { enumerable: true, get: function () { return RealMCPSamplingClient_2.RealMCPSamplingClient; } });
|
|
14
|
+
const RealMCPSamplingClient_3 = require("./RealMCPSamplingClient");
|
|
15
|
+
/**
|
|
16
|
+
* Factory function to create MCP Sampling Client
|
|
17
|
+
* Always returns the real implementation for production use
|
|
18
|
+
* Tests should explicitly use MockMCPSamplingClient
|
|
19
|
+
*
|
|
20
|
+
* @param config - Configuration for the client
|
|
21
|
+
* @returns RealMCPSamplingClient instance
|
|
22
|
+
*/
|
|
23
|
+
function createMCPSamplingClient(config) {
|
|
24
|
+
return new RealMCPSamplingClient_3.RealMCPSamplingClient({
|
|
25
|
+
timeout: 30000,
|
|
26
|
+
maxAttempts: 3,
|
|
27
|
+
enableLogging: false,
|
|
28
|
+
...config,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=MCPSamplingClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MCPSamplingClient.js","sourceRoot":"","sources":["../../../src/infrastructure/mcp/MCPSamplingClient.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwBH,0DASC;AAxBD,oCAAoC;AACpC,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,iEAAwF;AAA/E,8HAAA,qBAAqB,OAAyB;AAEvD,mEAA+D;AAG/D;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACrC,MAAmC;IAEnC,OAAO,IAAI,6CAAqB,CAAC;QAC/B,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,KAAK;QACpB,GAAG,MAAM;KACV,CAAC,CAAA;AACJ,CAAC"}
|