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.
Files changed (178) hide show
  1. package/README.md +41 -17
  2. package/dist/api/geminiClient.d.ts +2 -12
  3. package/dist/api/geminiClient.d.ts.map +1 -1
  4. package/dist/api/geminiClient.js +28 -56
  5. package/dist/api/geminiClient.js.map +1 -1
  6. package/dist/api/geminiTextClient.d.ts +42 -0
  7. package/dist/api/geminiTextClient.d.ts.map +1 -0
  8. package/dist/api/geminiTextClient.js +198 -0
  9. package/dist/api/geminiTextClient.js.map +1 -0
  10. package/dist/business/__tests__/mocks/mcpSamplingClient.mock.d.ts +84 -0
  11. package/dist/business/__tests__/mocks/mcpSamplingClient.mock.d.ts.map +1 -0
  12. package/dist/business/__tests__/mocks/mcpSamplingClient.mock.js +100 -0
  13. package/dist/business/__tests__/mocks/mcpSamplingClient.mock.js.map +1 -0
  14. package/dist/business/bestPracticesEngine.d.ts +149 -0
  15. package/dist/business/bestPracticesEngine.d.ts.map +1 -0
  16. package/dist/business/bestPracticesEngine.js +781 -0
  17. package/dist/business/bestPracticesEngine.js.map +1 -0
  18. package/dist/business/complexityAssessment.d.ts +132 -0
  19. package/dist/business/complexityAssessment.d.ts.map +1 -0
  20. package/dist/business/complexityAssessment.js +488 -0
  21. package/dist/business/complexityAssessment.js.map +1 -0
  22. package/dist/business/fallbackStrategies.d.ts +177 -0
  23. package/dist/business/fallbackStrategies.d.ts.map +1 -0
  24. package/dist/business/fallbackStrategies.js +368 -0
  25. package/dist/business/fallbackStrategies.js.map +1 -0
  26. package/dist/business/imageGenerator.d.ts.map +1 -1
  27. package/dist/business/imageGenerator.js +26 -5
  28. package/dist/business/imageGenerator.js.map +1 -1
  29. package/dist/business/multiImage/aspectRatioController.d.ts +77 -0
  30. package/dist/business/multiImage/aspectRatioController.d.ts.map +1 -0
  31. package/dist/business/multiImage/aspectRatioController.js +580 -0
  32. package/dist/business/multiImage/aspectRatioController.js.map +1 -0
  33. package/dist/business/multiImage/multiImageCoordinator.d.ts +142 -0
  34. package/dist/business/multiImage/multiImageCoordinator.d.ts.map +1 -0
  35. package/dist/business/multiImage/multiImageCoordinator.js +801 -0
  36. package/dist/business/multiImage/multiImageCoordinator.js.map +1 -0
  37. package/dist/business/pomlTemplateEngine.d.ts +206 -0
  38. package/dist/business/pomlTemplateEngine.d.ts.map +1 -0
  39. package/dist/business/pomlTemplateEngine.js +737 -0
  40. package/dist/business/pomlTemplateEngine.js.map +1 -0
  41. package/dist/business/promptOrchestrator.d.ts +173 -0
  42. package/dist/business/promptOrchestrator.d.ts.map +1 -0
  43. package/dist/business/promptOrchestrator.js +490 -0
  44. package/dist/business/promptOrchestrator.js.map +1 -0
  45. package/dist/business/responseBuilder.d.ts +2 -2
  46. package/dist/business/responseBuilder.d.ts.map +1 -1
  47. package/dist/business/responseBuilder.js +6 -1
  48. package/dist/business/responseBuilder.js.map +1 -1
  49. package/dist/business/structuredPromptGenerator.d.ts +54 -0
  50. package/dist/business/structuredPromptGenerator.d.ts.map +1 -0
  51. package/dist/business/structuredPromptGenerator.js +208 -0
  52. package/dist/business/structuredPromptGenerator.js.map +1 -0
  53. package/dist/business/templateNormalizer.d.ts +81 -0
  54. package/dist/business/templateNormalizer.d.ts.map +1 -0
  55. package/dist/business/templateNormalizer.js +659 -0
  56. package/dist/business/templateNormalizer.js.map +1 -0
  57. package/dist/documentation/apiContractValidation.d.ts +62 -0
  58. package/dist/documentation/apiContractValidation.d.ts.map +1 -0
  59. package/dist/documentation/apiContractValidation.js +305 -0
  60. package/dist/documentation/apiContractValidation.js.map +1 -0
  61. package/dist/infrastructure/concurrency/concurrencyManager.d.ts +101 -0
  62. package/dist/infrastructure/concurrency/concurrencyManager.d.ts.map +1 -0
  63. package/dist/infrastructure/concurrency/concurrencyManager.js +345 -0
  64. package/dist/infrastructure/concurrency/concurrencyManager.js.map +1 -0
  65. package/dist/infrastructure/config/secureConfigManager.d.ts +319 -0
  66. package/dist/infrastructure/config/secureConfigManager.d.ts.map +1 -0
  67. package/dist/infrastructure/config/secureConfigManager.js +600 -0
  68. package/dist/infrastructure/config/secureConfigManager.js.map +1 -0
  69. package/dist/infrastructure/errorHandling/orchestrationErrorHandler.d.ts +229 -0
  70. package/dist/infrastructure/errorHandling/orchestrationErrorHandler.d.ts.map +1 -0
  71. package/dist/infrastructure/errorHandling/orchestrationErrorHandler.js +61 -0
  72. package/dist/infrastructure/errorHandling/orchestrationErrorHandler.js.map +1 -0
  73. package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.d.ts +133 -0
  74. package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.d.ts.map +1 -0
  75. package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.js +569 -0
  76. package/dist/infrastructure/errorHandling/orchestrationErrorHandlerImpl.js.map +1 -0
  77. package/dist/infrastructure/mcp/MCPSamplingClient.d.ts +19 -0
  78. package/dist/infrastructure/mcp/MCPSamplingClient.d.ts.map +1 -0
  79. package/dist/infrastructure/mcp/MCPSamplingClient.js +31 -0
  80. package/dist/infrastructure/mcp/MCPSamplingClient.js.map +1 -0
  81. package/dist/infrastructure/mcp/RealMCPSamplingClient.d.ts +59 -0
  82. package/dist/infrastructure/mcp/RealMCPSamplingClient.d.ts.map +1 -0
  83. package/dist/infrastructure/mcp/RealMCPSamplingClient.js +271 -0
  84. package/dist/infrastructure/mcp/RealMCPSamplingClient.js.map +1 -0
  85. package/dist/infrastructure/metadata/generationMetadata.d.ts +72 -0
  86. package/dist/infrastructure/metadata/generationMetadata.d.ts.map +1 -0
  87. package/dist/infrastructure/metadata/generationMetadata.js +228 -0
  88. package/dist/infrastructure/metadata/generationMetadata.js.map +1 -0
  89. package/dist/infrastructure/monitoring/OrchestrationMetrics.d.ts +106 -0
  90. package/dist/infrastructure/monitoring/OrchestrationMetrics.d.ts.map +1 -0
  91. package/dist/infrastructure/monitoring/OrchestrationMetrics.js +456 -0
  92. package/dist/infrastructure/monitoring/OrchestrationMetrics.js.map +1 -0
  93. package/dist/infrastructure/monitoring/alertingSystem.d.ts +135 -0
  94. package/dist/infrastructure/monitoring/alertingSystem.d.ts.map +1 -0
  95. package/dist/infrastructure/monitoring/alertingSystem.js +549 -0
  96. package/dist/infrastructure/monitoring/alertingSystem.js.map +1 -0
  97. package/dist/infrastructure/optimization/performanceOptimizer.d.ts +89 -0
  98. package/dist/infrastructure/optimization/performanceOptimizer.d.ts.map +1 -0
  99. package/dist/infrastructure/optimization/performanceOptimizer.js +375 -0
  100. package/dist/infrastructure/optimization/performanceOptimizer.js.map +1 -0
  101. package/dist/infrastructure/security/AdvancedContentFilter.d.ts +99 -0
  102. package/dist/infrastructure/security/AdvancedContentFilter.d.ts.map +1 -0
  103. package/dist/infrastructure/security/AdvancedContentFilter.js +363 -0
  104. package/dist/infrastructure/security/AdvancedContentFilter.js.map +1 -0
  105. package/dist/infrastructure/security/MCPSecurityValidator.d.ts +62 -0
  106. package/dist/infrastructure/security/MCPSecurityValidator.d.ts.map +1 -0
  107. package/dist/infrastructure/security/MCPSecurityValidator.js +129 -0
  108. package/dist/infrastructure/security/MCPSecurityValidator.js.map +1 -0
  109. package/dist/infrastructure/security/OrchestrationSecurityMiddleware.d.ts +304 -0
  110. package/dist/infrastructure/security/OrchestrationSecurityMiddleware.d.ts.map +1 -0
  111. package/dist/infrastructure/security/OrchestrationSecurityMiddleware.js +61 -0
  112. package/dist/infrastructure/security/OrchestrationSecurityMiddleware.js.map +1 -0
  113. package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.d.ts +62 -0
  114. package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.d.ts.map +1 -0
  115. package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.js +591 -0
  116. package/dist/infrastructure/security/OrchestrationSecurityMiddlewareImpl.js.map +1 -0
  117. package/dist/infrastructure/security/SecureMCPClient.d.ts +154 -0
  118. package/dist/infrastructure/security/SecureMCPClient.d.ts.map +1 -0
  119. package/dist/infrastructure/security/SecureMCPClient.js +292 -0
  120. package/dist/infrastructure/security/SecureMCPClient.js.map +1 -0
  121. package/dist/infrastructure/security/SecurityIncidentManager.d.ts +142 -0
  122. package/dist/infrastructure/security/SecurityIncidentManager.d.ts.map +1 -0
  123. package/dist/infrastructure/security/SecurityIncidentManager.js +260 -0
  124. package/dist/infrastructure/security/SecurityIncidentManager.js.map +1 -0
  125. package/dist/infrastructure/security/apiKeyManager.d.ts +297 -0
  126. package/dist/infrastructure/security/apiKeyManager.d.ts.map +1 -0
  127. package/dist/infrastructure/security/apiKeyManager.js +254 -0
  128. package/dist/infrastructure/security/apiKeyManager.js.map +1 -0
  129. package/dist/infrastructure/security/dataSanitizer.d.ts +157 -0
  130. package/dist/infrastructure/security/dataSanitizer.d.ts.map +1 -0
  131. package/dist/infrastructure/security/dataSanitizer.js +525 -0
  132. package/dist/infrastructure/security/dataSanitizer.js.map +1 -0
  133. package/dist/infrastructure/validation/inputValidator.d.ts +54 -0
  134. package/dist/infrastructure/validation/inputValidator.d.ts.map +1 -0
  135. package/dist/infrastructure/validation/inputValidator.js +362 -0
  136. package/dist/infrastructure/validation/inputValidator.js.map +1 -0
  137. package/dist/integration/parameterOptimizer.d.ts +69 -0
  138. package/dist/integration/parameterOptimizer.d.ts.map +1 -0
  139. package/dist/integration/parameterOptimizer.js +317 -0
  140. package/dist/integration/parameterOptimizer.js.map +1 -0
  141. package/dist/integration/twoStageProcessor.d.ts +66 -0
  142. package/dist/integration/twoStageProcessor.d.ts.map +1 -0
  143. package/dist/integration/twoStageProcessor.js +348 -0
  144. package/dist/integration/twoStageProcessor.js.map +1 -0
  145. package/dist/server/handlers/structuredPromptHandler.d.ts +65 -0
  146. package/dist/server/handlers/structuredPromptHandler.d.ts.map +1 -0
  147. package/dist/server/handlers/structuredPromptHandler.js +314 -0
  148. package/dist/server/handlers/structuredPromptHandler.js.map +1 -0
  149. package/dist/server/mcpServer.d.ts +16 -35
  150. package/dist/server/mcpServer.d.ts.map +1 -1
  151. package/dist/server/mcpServer.js +111 -150
  152. package/dist/server/mcpServer.js.map +1 -1
  153. package/dist/server/mcpServerWithOrchestration.d.ts +98 -0
  154. package/dist/server/mcpServerWithOrchestration.d.ts.map +1 -0
  155. package/dist/server/mcpServerWithOrchestration.js +284 -0
  156. package/dist/server/mcpServerWithOrchestration.js.map +1 -0
  157. package/dist/types/mcpOrchestrationTypes.d.ts +135 -0
  158. package/dist/types/mcpOrchestrationTypes.d.ts.map +1 -0
  159. package/dist/types/mcpOrchestrationTypes.js +28 -0
  160. package/dist/types/mcpOrchestrationTypes.js.map +1 -0
  161. package/dist/types/multiImageTypes.d.ts +328 -0
  162. package/dist/types/multiImageTypes.d.ts.map +1 -0
  163. package/dist/types/multiImageTypes.js +27 -0
  164. package/dist/types/multiImageTypes.js.map +1 -0
  165. package/dist/types/performanceTypes.d.ts +300 -0
  166. package/dist/types/performanceTypes.d.ts.map +1 -0
  167. package/dist/types/performanceTypes.js +50 -0
  168. package/dist/types/performanceTypes.js.map +1 -0
  169. package/dist/types/twoStageTypes.d.ts +123 -0
  170. package/dist/types/twoStageTypes.d.ts.map +1 -0
  171. package/dist/types/twoStageTypes.js +7 -0
  172. package/dist/types/twoStageTypes.js.map +1 -0
  173. package/dist/utils/config.d.ts +1 -0
  174. package/dist/utils/config.d.ts.map +1 -1
  175. package/dist/utils/config.js +1 -0
  176. package/dist/utils/config.js.map +1 -1
  177. package/package.json +11 -4
  178. package/vitest.config.mjs +0 -47
@@ -0,0 +1,284 @@
1
+ "use strict";
2
+ /**
3
+ * MCP Server with Orchestration Support
4
+ * Extends basic MCP server with structured prompt generation capabilities
5
+ * Maintains 100% backward compatibility with existing functionality
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.MCPServerWithOrchestration = void 0;
9
+ // Base server functionality
10
+ const mcpServer_1 = require("./mcpServer");
11
+ const mcpOrchestrationTypes_1 = require("../types/mcpOrchestrationTypes");
12
+ const promptOrchestrator_1 = require("../business/promptOrchestrator");
13
+ const structuredPromptHandler_1 = require("./handlers/structuredPromptHandler");
14
+ // Business logic and API clients
15
+ const geminiTextClient_1 = require("../api/geminiTextClient");
16
+ const bestPracticesEngine_1 = require("../business/bestPracticesEngine");
17
+ const inputValidator_1 = require("../business/inputValidator");
18
+ const pomlTemplateEngine_1 = require("../business/pomlTemplateEngine");
19
+ // Utilities
20
+ const config_1 = require("../utils/config");
21
+ const logger_1 = require("../utils/logger");
22
+ const errorHandler_1 = require("./errorHandler");
23
+ /**
24
+ * MCP Server with orchestration capabilities
25
+ * Extends basic MCP server while maintaining backward compatibility
26
+ */
27
+ class MCPServerWithOrchestration extends mcpServer_1.MCPServerImpl {
28
+ constructor(config = {}, orchestrationConfig = {}, dependencies = {}) {
29
+ super(config, dependencies);
30
+ this.structuredPromptHandler = null;
31
+ this.geminiTextClient = null;
32
+ this.orchestrator = null;
33
+ this.orchestrationConfig = { ...mcpOrchestrationTypes_1.DEFAULT_ORCHESTRATION_CONFIG, ...orchestrationConfig };
34
+ // Initialize orchestration components if provided
35
+ if (dependencies.structuredPromptHandler) {
36
+ this.structuredPromptHandler = dependencies.structuredPromptHandler;
37
+ }
38
+ if (dependencies.geminiTextClient) {
39
+ this.geminiTextClient = dependencies.geminiTextClient;
40
+ }
41
+ if (dependencies.structuredPromptOrchestrator) {
42
+ this.orchestrator = dependencies.structuredPromptOrchestrator;
43
+ }
44
+ }
45
+ /**
46
+ * Enable structured prompt generation with orchestration components
47
+ */
48
+ async enableStructuredPromptGeneration(config) {
49
+ try {
50
+ if (config) {
51
+ this.orchestrationConfig = { ...this.orchestrationConfig, ...config };
52
+ }
53
+ // Initialize components if not already done
54
+ if (!this.orchestrator) {
55
+ await this.initializeOrchestrationComponents();
56
+ }
57
+ if (!this.orchestrator) {
58
+ throw new Error('Failed to initialize orchestration components');
59
+ }
60
+ // Create structured prompt handler or update existing
61
+ if (!this.structuredPromptHandler) {
62
+ this.structuredPromptHandler = new structuredPromptHandler_1.StructuredPromptHandler(this.orchestrator, this.orchestrationConfig, { logger: new logger_1.Logger() });
63
+ }
64
+ else {
65
+ // Update existing handler with new config
66
+ this.structuredPromptHandler.updateConfig(this.orchestrationConfig);
67
+ }
68
+ this.orchestrationConfig.enableOrchestration = true;
69
+ const logger = new logger_1.Logger();
70
+ logger.info('mcp-orchestration', 'Structured prompt generation enabled', {
71
+ mode: this.orchestrationConfig.orchestrationMode,
72
+ progressNotifications: this.orchestrationConfig.progressNotifications,
73
+ });
74
+ }
75
+ catch (error) {
76
+ const logger = new logger_1.Logger();
77
+ logger.error('mcp-orchestration', 'Failed to enable structured prompt generation', error);
78
+ throw error;
79
+ }
80
+ }
81
+ /**
82
+ * Get current orchestration status
83
+ */
84
+ getOrchestrationStatus() {
85
+ if (!this.structuredPromptHandler) {
86
+ return {
87
+ enabled: false,
88
+ mode: this.orchestrationConfig.orchestrationMode,
89
+ statistics: {
90
+ totalAttempts: 0,
91
+ successfulAttempts: 0,
92
+ failedAttempts: 0,
93
+ averageProcessingTime: 0,
94
+ },
95
+ };
96
+ }
97
+ return this.structuredPromptHandler.getOrchestrationStatus();
98
+ }
99
+ /**
100
+ * Update orchestration configuration
101
+ */
102
+ updateOrchestrationConfig(newConfig) {
103
+ this.orchestrationConfig = { ...this.orchestrationConfig, ...newConfig };
104
+ if (this.structuredPromptHandler) {
105
+ this.structuredPromptHandler.updateConfig(newConfig);
106
+ }
107
+ }
108
+ /**
109
+ * Override getToolsList to include orchestration parameters
110
+ */
111
+ getToolsList() {
112
+ const baseTools = super.getToolsList();
113
+ // Extend generate_image tool with orchestration parameters
114
+ const generateImageTool = baseTools.tools.find((tool) => tool.name === 'generate_image');
115
+ if (generateImageTool && this.orchestrationConfig.enableOrchestration) {
116
+ // Extend properties with orchestration parameter
117
+ const properties = generateImageTool.inputSchema.properties;
118
+ properties['useStructuredPrompt'] = {
119
+ type: 'boolean',
120
+ description: 'Enable structured prompt generation with 2-stage orchestration (optional, default: false)',
121
+ default: false,
122
+ };
123
+ // Update description to mention orchestration
124
+ generateImageTool.description =
125
+ 'Generate image with specified prompt and optional structured prompt enhancement';
126
+ }
127
+ return baseTools;
128
+ }
129
+ /**
130
+ * Override callTool to handle orchestration
131
+ */
132
+ async callTool(name, args, progressToken) {
133
+ try {
134
+ if (name === 'generate_image') {
135
+ return await this.handleGenerateImageWithOrchestration(args, progressToken);
136
+ }
137
+ // Delegate to parent for other tools
138
+ return await super.callTool(name, args, progressToken);
139
+ }
140
+ catch (error) {
141
+ const logger = new logger_1.Logger();
142
+ logger.error('mcp-orchestration', 'Tool execution failed', error, {
143
+ toolName: name,
144
+ args,
145
+ });
146
+ return errorHandler_1.ErrorHandler.handleError(error);
147
+ }
148
+ }
149
+ /**
150
+ * Handle generate_image with optional orchestration
151
+ */
152
+ async handleGenerateImageWithOrchestration(params, progressToken) {
153
+ const startTime = new Date();
154
+ // Use ErrorHandler.wrapWithResultType for safe execution
155
+ const result = await errorHandler_1.ErrorHandler.wrapWithResultType(async () => {
156
+ const logger = new logger_1.Logger();
157
+ // Validate input parameters (same as base implementation)
158
+ const validationResult = (0, inputValidator_1.validateGenerateImageParams)(params);
159
+ if (!validationResult.success) {
160
+ throw validationResult.error;
161
+ }
162
+ const server = this.getServerInstance();
163
+ let structuredPrompt = params.prompt;
164
+ let orchestrationResult = undefined;
165
+ let orchestrationTime = 0;
166
+ // Apply structured prompt generation if requested and enabled
167
+ if (params.useStructuredPrompt &&
168
+ this.orchestrationConfig.enableOrchestration &&
169
+ this.structuredPromptHandler) {
170
+ logger.info('mcp-orchestration', 'Starting structured prompt generation', {
171
+ originalPrompt: params.prompt,
172
+ });
173
+ const orchestrationStart = new Date();
174
+ const orchestrationOptions = {
175
+ ...params.orchestrationOptions,
176
+ // Map feature parameters to orchestration options (only when defined)
177
+ ...(params.maintainCharacterConsistency !== undefined && {
178
+ maintainCharacterConsistency: params.maintainCharacterConsistency,
179
+ }),
180
+ ...(params.blendImages !== undefined && { blendImages: params.blendImages }),
181
+ ...(params.useWorldKnowledge !== undefined && {
182
+ useWorldKnowledge: params.useWorldKnowledge,
183
+ }),
184
+ };
185
+ const orchestrationRes = await this.structuredPromptHandler.processStructuredPrompt(params.prompt, orchestrationOptions, server || undefined, progressToken);
186
+ orchestrationTime = new Date().getTime() - orchestrationStart.getTime();
187
+ if (orchestrationRes.success) {
188
+ structuredPrompt = orchestrationRes.data.structuredPrompt;
189
+ orchestrationResult = orchestrationRes.data;
190
+ logger.info('mcp-orchestration', 'Structured prompt generation successful', {
191
+ originalLength: params.prompt.length,
192
+ enhancedLength: structuredPrompt.length,
193
+ orchestrationTime,
194
+ });
195
+ }
196
+ else {
197
+ logger.warn('mcp-orchestration', 'Structured prompt generation failed, using original', {
198
+ error: orchestrationRes.error.message,
199
+ });
200
+ // Continue with original prompt (graceful fallback)
201
+ }
202
+ }
203
+ // Update progress for image generation phase
204
+ if (server && progressToken) {
205
+ await server.notification({
206
+ method: 'notifications/progress',
207
+ params: {
208
+ progressToken,
209
+ progress: orchestrationResult ? 80 : 50,
210
+ total: 100,
211
+ message: 'Starting image generation...',
212
+ },
213
+ });
214
+ }
215
+ // Call parent implementation with structured prompt
216
+ const updatedParams = { ...params, prompt: structuredPrompt };
217
+ const baseResult = await super.callTool('generate_image', updatedParams, progressToken);
218
+ // Enhance result with orchestration metadata
219
+ const totalTime = new Date().getTime() - startTime.getTime();
220
+ const imageGenerationTime = totalTime - orchestrationTime;
221
+ const enhancedResult = {
222
+ content: baseResult.content || [],
223
+ usedStructuredPrompt: !!params.useStructuredPrompt && !!orchestrationResult,
224
+ ...(orchestrationResult && { orchestrationResult }),
225
+ metadata: {
226
+ totalProcessingTime: totalTime,
227
+ ...(orchestrationTime > 0 && { orchestrationTime }),
228
+ imageGenerationTime,
229
+ fallbackUsed: !!(params.useStructuredPrompt && !orchestrationResult),
230
+ },
231
+ };
232
+ return enhancedResult;
233
+ });
234
+ if (!result.ok) {
235
+ return errorHandler_1.ErrorHandler.handleError(result.error);
236
+ }
237
+ // Return result with orchestration metadata
238
+ const orchestrationResult = result.value;
239
+ return {
240
+ content: orchestrationResult.content
241
+ .filter((item) => item.type === 'text')
242
+ .map((item) => ({
243
+ type: 'text',
244
+ text: item.text || 'Image generated successfully',
245
+ })),
246
+ structuredContent: orchestrationResult,
247
+ };
248
+ }
249
+ /**
250
+ * Initialize orchestration components
251
+ */
252
+ async initializeOrchestrationComponents() {
253
+ try {
254
+ // Load configuration
255
+ const configResult = (0, config_1.getConfig)();
256
+ if (!configResult.success) {
257
+ throw configResult.error;
258
+ }
259
+ // Initialize Gemini Text Client
260
+ if (!this.geminiTextClient) {
261
+ const geminiTextClientResult = (0, geminiTextClient_1.createGeminiTextClient)(configResult.data);
262
+ if (!geminiTextClientResult.success) {
263
+ throw geminiTextClientResult.error;
264
+ }
265
+ this.geminiTextClient = geminiTextClientResult.data;
266
+ }
267
+ // Initialize Best Practices Engine
268
+ const bestPracticesEngine = new bestPracticesEngine_1.BestPracticesEngineImpl();
269
+ // Initialize POML Template Engine
270
+ const pomlTemplateEngine = new pomlTemplateEngine_1.POMLTemplateEngineImpl();
271
+ // Initialize Orchestrator
272
+ this.orchestrator = new promptOrchestrator_1.StructuredPromptOrchestratorImpl(this.geminiTextClient, bestPracticesEngine, pomlTemplateEngine);
273
+ const logger = new logger_1.Logger();
274
+ logger.info('mcp-orchestration', 'Orchestration components initialized successfully');
275
+ }
276
+ catch (error) {
277
+ const logger = new logger_1.Logger();
278
+ logger.error('mcp-orchestration', 'Failed to initialize orchestration components', error);
279
+ throw error;
280
+ }
281
+ }
282
+ }
283
+ exports.MCPServerWithOrchestration = MCPServerWithOrchestration;
284
+ //# sourceMappingURL=mcpServerWithOrchestration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpServerWithOrchestration.js","sourceRoot":"","sources":["../../src/server/mcpServerWithOrchestration.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,4BAA4B;AAC5B,2CAAuE;AAUvE,0EAA6E;AAO7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YAAY,GAAG,IAAI,qDAAgC,CACtD,IAAI,CAAC,gBAAgB,EACrB,mBAAmB,EACnB,kBAAkB,CACnB,CAAA;YAED,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA;YAC3B,MAAM,CAAC,IAAI,CAAC,mBAAmB,EAAE,mDAAmD,CAAC,CAAA;QACvF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA;YAC3B,MAAM,CAAC,KAAK,CACV,mBAAmB,EACnB,+CAA+C,EAC/C,KAAc,CACf,CAAA;YACD,MAAM,KAAK,CAAA;QACb,CAAC;IACH,CAAC;CACF;AA/UD,gEA+UC"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Type definitions for MCP orchestration integration
3
+ * Extends existing MCP types with structured prompt generation capabilities
4
+ */
5
+ import type { OrchestrationResult } from '../business/promptOrchestrator';
6
+ /**
7
+ * Orchestration configuration for MCP server
8
+ */
9
+ export interface MCPOrchestrationConfig {
10
+ /**
11
+ * Orchestration processing mode
12
+ * - full: POML + all 7 best practices
13
+ * - essential: POML + essential 3 practices
14
+ * - minimal: best practices only, no POML
15
+ */
16
+ orchestrationMode: 'full' | 'essential' | 'minimal';
17
+ /**
18
+ * Enable progress notifications during orchestration
19
+ */
20
+ progressNotifications: boolean;
21
+ /**
22
+ * Fallback behavior when orchestration fails
23
+ */
24
+ fallbackBehavior: FallbackBehavior;
25
+ }
26
+ /**
27
+ * Fallback behavior options
28
+ */
29
+ export type FallbackBehavior = 'graceful' | 'retry' | 'fail';
30
+ /**
31
+ * Orchestration status information
32
+ */
33
+ export interface OrchestrationStatus {
34
+ /**
35
+ * Whether orchestration is currently enabled
36
+ */
37
+ enabled: boolean;
38
+ /**
39
+ * Current orchestration mode
40
+ */
41
+ mode: MCPOrchestrationConfig['orchestrationMode'];
42
+ /**
43
+ * Processing statistics
44
+ */
45
+ statistics: {
46
+ /**
47
+ * Total orchestration attempts
48
+ */
49
+ totalAttempts: number;
50
+ /**
51
+ * Successful orchestrations
52
+ */
53
+ successfulAttempts: number;
54
+ /**
55
+ * Failed orchestrations
56
+ */
57
+ failedAttempts: number;
58
+ /**
59
+ * Average processing time in milliseconds
60
+ */
61
+ averageProcessingTime: number;
62
+ };
63
+ /**
64
+ * Last orchestration result (if any)
65
+ */
66
+ lastResult?: OrchestrationResult;
67
+ }
68
+ /**
69
+ * MCP tool call result with orchestration metadata
70
+ */
71
+ export interface MCPOrchestrationResult {
72
+ /**
73
+ * Standard MCP content array
74
+ */
75
+ content: Array<{
76
+ type: 'text' | 'image';
77
+ text?: string;
78
+ data?: string;
79
+ mimeType?: string;
80
+ }>;
81
+ /**
82
+ * Whether structured prompt was used
83
+ */
84
+ usedStructuredPrompt: boolean;
85
+ /**
86
+ * Orchestration result details (if structured prompt was used)
87
+ */
88
+ orchestrationResult?: OrchestrationResult;
89
+ /**
90
+ * Processing metadata
91
+ */
92
+ metadata: {
93
+ /**
94
+ * Total processing time including orchestration
95
+ */
96
+ totalProcessingTime: number;
97
+ /**
98
+ * Time spent on orchestration (if applicable)
99
+ */
100
+ orchestrationTime?: number;
101
+ /**
102
+ * Time spent on image generation
103
+ */
104
+ imageGenerationTime: number;
105
+ /**
106
+ * Whether fallback was used
107
+ */
108
+ fallbackUsed: boolean;
109
+ };
110
+ }
111
+ /**
112
+ * Progress notification stages for orchestration
113
+ */
114
+ export declare enum OrchestrationProgressStage {
115
+ STARTING = "starting",
116
+ POML_PROCESSING = "poml_processing",
117
+ BEST_PRACTICES_APPLYING = "best_practices_applying",
118
+ ORCHESTRATION_COMPLETE = "orchestration_complete",
119
+ IMAGE_GENERATION_STARTING = "image_generation_starting",
120
+ IMAGE_GENERATION_COMPLETE = "image_generation_complete"
121
+ }
122
+ /**
123
+ * Progress notification message for orchestration stages
124
+ */
125
+ export interface OrchestrationProgressMessage {
126
+ stage: OrchestrationProgressStage;
127
+ message: string;
128
+ progress: number;
129
+ total: number;
130
+ }
131
+ /**
132
+ * Default orchestration configuration
133
+ */
134
+ export declare const DEFAULT_ORCHESTRATION_CONFIG: MCPOrchestrationConfig;
135
+ //# sourceMappingURL=mcpOrchestrationTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpOrchestrationTypes.d.ts","sourceRoot":"","sources":["../../src/types/mcpOrchestrationTypes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAIzE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,iBAAiB,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAA;IAEnD;;OAEG;IACH,qBAAqB,EAAE,OAAO,CAAA;IAE9B;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAA;CACnC;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,OAAO,GACP,MAAM,CAAA;AAEV;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAEhB;;OAEG;IACH,IAAI,EAAE,sBAAsB,CAAC,mBAAmB,CAAC,CAAA;IAEjD;;OAEG;IACH,UAAU,EAAE;QACV;;WAEG;QACH,aAAa,EAAE,MAAM,CAAA;QAErB;;WAEG;QACH,kBAAkB,EAAE,MAAM,CAAA;QAE1B;;WAEG;QACH,cAAc,EAAE,MAAM,CAAA;QAEtB;;WAEG;QACH,qBAAqB,EAAE,MAAM,CAAA;KAC9B,CAAA;IAED;;OAEG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAA;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,CAAC,CAAA;IAEF;;OAEG;IACH,oBAAoB,EAAE,OAAO,CAAA;IAE7B;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAA;IAEzC;;OAEG;IACH,QAAQ,EAAE;QACR;;WAEG;QACH,mBAAmB,EAAE,MAAM,CAAA;QAE3B;;WAEG;QACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;QAE1B;;WAEG;QACH,mBAAmB,EAAE,MAAM,CAAA;QAE3B;;WAEG;QACH,YAAY,EAAE,OAAO,CAAA;KACtB,CAAA;CACF;AAED;;GAEG;AACH,oBAAY,0BAA0B;IACpC,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;IACjD,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,0BAA0B,CAAA;IACjC,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,sBAI1C,CAAA"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * Type definitions for MCP orchestration integration
4
+ * Extends existing MCP types with structured prompt generation capabilities
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.DEFAULT_ORCHESTRATION_CONFIG = exports.OrchestrationProgressStage = void 0;
8
+ /**
9
+ * Progress notification stages for orchestration
10
+ */
11
+ var OrchestrationProgressStage;
12
+ (function (OrchestrationProgressStage) {
13
+ OrchestrationProgressStage["STARTING"] = "starting";
14
+ OrchestrationProgressStage["POML_PROCESSING"] = "poml_processing";
15
+ OrchestrationProgressStage["BEST_PRACTICES_APPLYING"] = "best_practices_applying";
16
+ OrchestrationProgressStage["ORCHESTRATION_COMPLETE"] = "orchestration_complete";
17
+ OrchestrationProgressStage["IMAGE_GENERATION_STARTING"] = "image_generation_starting";
18
+ OrchestrationProgressStage["IMAGE_GENERATION_COMPLETE"] = "image_generation_complete";
19
+ })(OrchestrationProgressStage || (exports.OrchestrationProgressStage = OrchestrationProgressStage = {}));
20
+ /**
21
+ * Default orchestration configuration
22
+ */
23
+ exports.DEFAULT_ORCHESTRATION_CONFIG = {
24
+ orchestrationMode: 'full',
25
+ progressNotifications: true,
26
+ fallbackBehavior: 'graceful',
27
+ };
28
+ //# sourceMappingURL=mcpOrchestrationTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcpOrchestrationTypes.js","sourceRoot":"","sources":["../../src/types/mcpOrchestrationTypes.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoIH;;GAEG;AACH,IAAY,0BAOX;AAPD,WAAY,0BAA0B;IACpC,mDAAqB,CAAA;IACrB,iEAAmC,CAAA;IACnC,iFAAmD,CAAA;IACnD,+EAAiD,CAAA;IACjD,qFAAuD,CAAA;IACvD,qFAAuD,CAAA;AACzD,CAAC,EAPW,0BAA0B,0CAA1B,0BAA0B,QAOrC;AAYD;;GAEG;AACU,QAAA,4BAA4B,GAA2B;IAClE,iBAAiB,EAAE,MAAM;IACzB,qBAAqB,EAAE,IAAI;IAC3B,gBAAgB,EAAE,UAAU;CAC7B,CAAA"}