mcp-adr-analysis-server 1.1.0 → 2.0.2

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 (118) hide show
  1. package/README.md +367 -150
  2. package/dist/src/config/ai-config.d.ts +81 -0
  3. package/dist/src/config/ai-config.d.ts.map +1 -0
  4. package/dist/src/config/ai-config.js +134 -0
  5. package/dist/src/config/ai-config.js.map +1 -0
  6. package/dist/src/index.d.ts +97 -1
  7. package/dist/src/index.d.ts.map +1 -1
  8. package/dist/src/index.js +2430 -186
  9. package/dist/src/index.js.map +1 -1
  10. package/dist/src/prompts/adr-suggestion-prompts.d.ts +2 -2
  11. package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
  12. package/dist/src/prompts/adr-suggestion-prompts.js +25 -17
  13. package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
  14. package/dist/src/prompts/analysis-prompts.js +1 -1
  15. package/dist/src/prompts/analysis-prompts.js.map +1 -1
  16. package/dist/src/resources/index.d.ts +1 -1
  17. package/dist/src/resources/index.d.ts.map +1 -1
  18. package/dist/src/resources/index.js +52 -44
  19. package/dist/src/resources/index.js.map +1 -1
  20. package/dist/src/templates/domain-knowledge-templates.d.ts +36 -0
  21. package/dist/src/templates/domain-knowledge-templates.d.ts.map +1 -0
  22. package/dist/src/templates/domain-knowledge-templates.js +376 -0
  23. package/dist/src/templates/domain-knowledge-templates.js.map +1 -0
  24. package/dist/src/tools/adr-suggestion-tool.d.ts +8 -3
  25. package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
  26. package/dist/src/tools/adr-suggestion-tool.js +561 -172
  27. package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
  28. package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
  29. package/dist/src/tools/content-masking-tool.js +168 -22
  30. package/dist/src/tools/content-masking-tool.js.map +1 -1
  31. package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -1
  32. package/dist/src/tools/deployment-analysis-tool.js +64 -27
  33. package/dist/src/tools/deployment-analysis-tool.js.map +1 -1
  34. package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
  35. package/dist/src/tools/environment-analysis-tool.js +65 -29
  36. package/dist/src/tools/environment-analysis-tool.js.map +1 -1
  37. package/dist/src/tools/research-question-tool.d.ts.map +1 -1
  38. package/dist/src/tools/research-question-tool.js +150 -49
  39. package/dist/src/tools/research-question-tool.js.map +1 -1
  40. package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
  41. package/dist/src/tools/rule-generation-tool.js +328 -143
  42. package/dist/src/tools/rule-generation-tool.js.map +1 -1
  43. package/dist/src/types/ape-framework.d.ts +566 -0
  44. package/dist/src/types/ape-framework.d.ts.map +1 -0
  45. package/dist/src/types/ape-framework.js +98 -0
  46. package/dist/src/types/ape-framework.js.map +1 -0
  47. package/dist/src/types/index.d.ts +96 -93
  48. package/dist/src/types/index.d.ts.map +1 -1
  49. package/dist/src/types/knowledge-generation.d.ts +671 -0
  50. package/dist/src/types/knowledge-generation.d.ts.map +1 -0
  51. package/dist/src/types/knowledge-generation.js +107 -0
  52. package/dist/src/types/knowledge-generation.js.map +1 -0
  53. package/dist/src/types/reflexion-framework.d.ts +652 -0
  54. package/dist/src/types/reflexion-framework.d.ts.map +1 -0
  55. package/dist/src/types/reflexion-framework.js +85 -0
  56. package/dist/src/types/reflexion-framework.js.map +1 -0
  57. package/dist/src/utils/adr-suggestions.d.ts +1 -1
  58. package/dist/src/utils/adr-suggestions.d.ts.map +1 -1
  59. package/dist/src/utils/adr-suggestions.js +8 -50
  60. package/dist/src/utils/adr-suggestions.js.map +1 -1
  61. package/dist/src/utils/ai-executor.d.ts +125 -0
  62. package/dist/src/utils/ai-executor.d.ts.map +1 -0
  63. package/dist/src/utils/ai-executor.js +292 -0
  64. package/dist/src/utils/ai-executor.js.map +1 -0
  65. package/dist/src/utils/automatic-prompt-engineering.d.ts +72 -0
  66. package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -0
  67. package/dist/src/utils/automatic-prompt-engineering.js +820 -0
  68. package/dist/src/utils/automatic-prompt-engineering.js.map +1 -0
  69. package/dist/src/utils/cache.d.ts +54 -22
  70. package/dist/src/utils/cache.d.ts.map +1 -1
  71. package/dist/src/utils/cache.js +1234 -143
  72. package/dist/src/utils/cache.js.map +1 -1
  73. package/dist/src/utils/config.d.ts +2 -2
  74. package/dist/src/utils/config.js +3 -3
  75. package/dist/src/utils/config.js.map +1 -1
  76. package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
  77. package/dist/src/utils/deployment-analysis.js +57 -38
  78. package/dist/src/utils/deployment-analysis.js.map +1 -1
  79. package/dist/src/utils/environment-analysis.d.ts.map +1 -1
  80. package/dist/src/utils/environment-analysis.js +113 -100
  81. package/dist/src/utils/environment-analysis.js.map +1 -1
  82. package/dist/src/utils/file-system.d.ts +42 -13
  83. package/dist/src/utils/file-system.d.ts.map +1 -1
  84. package/dist/src/utils/file-system.js +795 -89
  85. package/dist/src/utils/file-system.js.map +1 -1
  86. package/dist/src/utils/index.d.ts +9 -0
  87. package/dist/src/utils/index.d.ts.map +1 -0
  88. package/dist/src/utils/index.js +13 -0
  89. package/dist/src/utils/index.js.map +1 -0
  90. package/dist/src/utils/knowledge-generation.d.ts +79 -0
  91. package/dist/src/utils/knowledge-generation.d.ts.map +1 -0
  92. package/dist/src/utils/knowledge-generation.js +646 -0
  93. package/dist/src/utils/knowledge-generation.js.map +1 -0
  94. package/dist/src/utils/output-masking.d.ts.map +1 -1
  95. package/dist/src/utils/output-masking.js +2 -1
  96. package/dist/src/utils/output-masking.js.map +1 -1
  97. package/dist/src/utils/prompt-composition.d.ts +234 -0
  98. package/dist/src/utils/prompt-composition.d.ts.map +1 -0
  99. package/dist/src/utils/prompt-composition.js +379 -0
  100. package/dist/src/utils/prompt-composition.js.map +1 -0
  101. package/dist/src/utils/prompt-execution.d.ts +88 -0
  102. package/dist/src/utils/prompt-execution.d.ts.map +1 -0
  103. package/dist/src/utils/prompt-execution.js +227 -0
  104. package/dist/src/utils/prompt-execution.js.map +1 -0
  105. package/dist/src/utils/reflexion.d.ts +92 -0
  106. package/dist/src/utils/reflexion.d.ts.map +1 -0
  107. package/dist/src/utils/reflexion.js +1100 -0
  108. package/dist/src/utils/reflexion.js.map +1 -0
  109. package/dist/src/utils/research-integration.d.ts.map +1 -1
  110. package/dist/src/utils/research-integration.js +156 -100
  111. package/dist/src/utils/research-integration.js.map +1 -1
  112. package/dist/src/utils/research-questions.d.ts.map +1 -1
  113. package/dist/src/utils/research-questions.js +85 -24
  114. package/dist/src/utils/research-questions.js.map +1 -1
  115. package/dist/src/utils/rule-generation.d.ts.map +1 -1
  116. package/dist/src/utils/rule-generation.js +92 -108
  117. package/dist/src/utils/rule-generation.js.map +1 -1
  118. package/package.json +9 -3
@@ -0,0 +1,646 @@
1
+ /**
2
+ * Knowledge Generation Utility Module - 100% Prompt-Driven Architecture
3
+ * Generates AI delegation prompts for domain-specific architectural knowledge
4
+ * All functions return prompts for AI execution, never execute operations directly
5
+ */
6
+ import { McpAdrError } from '../types/index.js';
7
+ import { getDomainTemplate } from '../templates/domain-knowledge-templates.js';
8
+ // ============================================================================
9
+ // Configuration and Constants
10
+ // ============================================================================
11
+ const DEFAULT_CONFIG = {
12
+ domains: [],
13
+ depth: 'intermediate',
14
+ cacheEnabled: true,
15
+ cacheTTL: 3600, // 1 hour
16
+ securityValidation: true,
17
+ customTemplates: [],
18
+ maxKnowledgeItems: 50,
19
+ maxTokens: 5000,
20
+ relevanceThreshold: 0.6,
21
+ parallelGeneration: true
22
+ };
23
+ const KNOWLEDGE_VERSION = '1.0.0';
24
+ // ============================================================================
25
+ // Core Knowledge Generation Functions - 100% Prompt-Driven
26
+ // ============================================================================
27
+ /**
28
+ * Generate AI delegation prompt for architectural knowledge generation
29
+ * Returns prompts for AI to generate domain-specific knowledge
30
+ */
31
+ export async function generateArchitecturalKnowledge(context, config = {}) {
32
+ try {
33
+ // Validate input
34
+ if (!context.projectPath || context.projectPath.trim() === '') {
35
+ throw new McpAdrError('Project path is required', 'INVALID_INPUT');
36
+ }
37
+ const mergedConfig = { ...DEFAULT_CONFIG, ...config };
38
+ console.error(`[DEBUG] Generating knowledge generation prompt for domains: ${mergedConfig.domains.join(', ')}`);
39
+ // Determine target domains
40
+ let targetDomains = mergedConfig.domains;
41
+ if (targetDomains.length === 0) {
42
+ // Use fallback domains if none specified
43
+ targetDomains = ['web-applications', 'api-design'];
44
+ }
45
+ // Get domain templates for knowledge generation (optimized)
46
+ const domainTemplatesInfo = targetDomains.map(domain => {
47
+ const template = getDomainTemplate(domain);
48
+ return {
49
+ domain,
50
+ hasTemplate: !!template,
51
+ categoryCount: template?.categories.length || 0,
52
+ // Only include detailed categories for small technology lists to avoid exponential growth
53
+ categories: (context.technologies?.length || 0) <= 5 ?
54
+ template?.categories.map(cat => ({
55
+ category: cat.category,
56
+ itemCount: cat.items.length,
57
+ priority: cat.priority,
58
+ applicability: cat.applicability
59
+ })) || [] : []
60
+ };
61
+ });
62
+ // Generate cache key for this knowledge request (optimized for performance)
63
+ const contextKey = `${context.projectPath}-${context.technologies?.length || 0}-${context.projectType || 'unknown'}`;
64
+ const configKey = `${targetDomains.join('+')}-${mergedConfig.depth}-${mergedConfig.maxKnowledgeItems}`;
65
+ const cacheKey = `knowledge:${configKey}-${Buffer.from(contextKey).toString('base64').substring(0, 12)}`;
66
+ // Create comprehensive knowledge generation prompt
67
+ const prompt = `
68
+ # Architectural Knowledge Generation Request
69
+
70
+ Please generate domain-specific architectural knowledge for the following context and domains.
71
+
72
+ ## Target Domains
73
+ ${targetDomains.map((domain, index) => `${index + 1}. **${domain}**`).join('\n')}
74
+
75
+ ## Project Context
76
+ - **Project Path**: ${context.projectPath || 'Not specified'}
77
+ - **Technologies**: ${context.technologies?.length ?
78
+ (context.technologies.length <= 5 ?
79
+ context.technologies.join(', ') :
80
+ `${context.technologies.slice(0, 5).join(', ')} and ${context.technologies.length - 5} more`) : 'auto-detect from project context'}
81
+ - **Patterns**: ${context.patterns?.join(', ') || 'Not specified'}
82
+ - **Existing ADRs**: ${context.existingAdrs?.length || 0} ADRs
83
+ - **Project Type**: ${context.projectType || 'Not specified'}
84
+ - **Team Size**: ${context.teamSize || 'Not specified'}
85
+ - **Constraints**: ${context.constraints?.join(', ') || 'None specified'}
86
+ - **Goals**: ${context.goals?.join(', ') || 'None specified'}
87
+
88
+ ## Knowledge Generation Configuration
89
+ - **Depth**: ${mergedConfig.depth}
90
+ - **Max Knowledge Items**: ${mergedConfig.maxKnowledgeItems}
91
+ - **Relevance Threshold**: ${mergedConfig.relevanceThreshold}
92
+ - **Security Validation**: ${mergedConfig.securityValidation ? 'Enabled' : 'Disabled'}
93
+
94
+ ## Domain Templates Available
95
+ ${domainTemplatesInfo.map(info => `
96
+ ### ${info.domain}
97
+ - **Template Available**: ${info.hasTemplate ? 'Yes' : 'No'}
98
+ - **Categories**: ${info.categoryCount}${info.categories.length > 0 ?
99
+ `\n${info.categories.map(cat => ` - ${cat.category} (${cat.itemCount} items, priority: ${cat.priority})`).join('\n')}` :
100
+ ' (details omitted for performance)'}
101
+ `).join('\n')}
102
+
103
+ ## Required Knowledge Generation Tasks
104
+
105
+ ### Step 1: Domain Knowledge Extraction
106
+ For each target domain, extract relevant architectural knowledge including:
107
+ 1. **Best Practices**: Industry-standard practices for the domain
108
+ 2. **Design Patterns**: Common architectural patterns and their applications
109
+ 3. **Anti-Patterns**: Common mistakes and what to avoid
110
+ 4. **Technology-Specific**: Knowledge specific to detected technologies
111
+ 5. **Performance Considerations**: Performance optimization strategies
112
+ 6. **Security Guidelines**: Security best practices for the domain
113
+ 7. **Scalability Patterns**: Patterns for handling scale and growth
114
+ 8. **Testing Strategies**: Testing approaches for the domain
115
+
116
+ ### Step 2: Context Relevance Filtering
117
+ Filter knowledge based on:
118
+ - **Technology Match**: Prioritize knowledge relevant to detected technologies
119
+ - **Pattern Alignment**: Focus on knowledge that supports existing patterns
120
+ - **Project Goals**: Emphasize knowledge that helps achieve stated goals
121
+ - **Constraint Awareness**: Consider project constraints and limitations
122
+ - **Team Context**: Adjust complexity based on team size and expertise
123
+
124
+ ### Step 3: Knowledge Quality Assessment
125
+ Evaluate each knowledge item for:
126
+ - **Relevance Score**: How relevant is this to the project context (0-1)
127
+ - **Confidence Level**: How confident are we in this knowledge (0-1)
128
+ - **Evidence Strength**: What evidence supports this knowledge
129
+ - **Applicability**: Under what conditions does this knowledge apply
130
+
131
+ ### Step 4: Knowledge Structuring
132
+ Structure the knowledge as follows:
133
+ \`\`\`json
134
+ {
135
+ "knowledgeGeneration": {
136
+ "domains": ["domain1", "domain2"],
137
+ "totalItems": number,
138
+ "averageRelevance": number,
139
+ "generationMetadata": {
140
+ "timestamp": "ISO-8601",
141
+ "version": "${KNOWLEDGE_VERSION}",
142
+ "cacheKey": "${cacheKey}",
143
+ "configUsed": {
144
+ "depth": "${mergedConfig.depth}",
145
+ "maxItems": ${mergedConfig.maxKnowledgeItems},
146
+ "threshold": ${mergedConfig.relevanceThreshold}
147
+ }
148
+ },
149
+ "domainKnowledge": [
150
+ {
151
+ "domain": "domain-name",
152
+ "confidence": number,
153
+ "knowledgeItems": [
154
+ {
155
+ "category": "best-practices|design-patterns|anti-patterns|etc",
156
+ "title": "Knowledge item title",
157
+ "content": "Detailed knowledge content based on depth level",
158
+ "relevance": number,
159
+ "evidence": ["evidence1", "evidence2"],
160
+ "tags": ["tag1", "tag2"],
161
+ "applicability": ["condition1", "condition2"]
162
+ }
163
+ ]
164
+ }
165
+ ]
166
+ }
167
+ }
168
+ \`\`\`
169
+
170
+ ## Security and Validation Requirements
171
+
172
+ The AI agent must:
173
+ 1. **Content Safety**: Ensure all generated knowledge is safe and appropriate
174
+ 2. **Source Reliability**: Base knowledge on reliable architectural sources
175
+ 3. **Relevance Validation**: Verify knowledge relevance to the specified context
176
+ 4. **Quality Control**: Maintain high quality standards for all knowledge items
177
+ 5. **Consistency Check**: Ensure knowledge items don't contradict each other
178
+
179
+ ## Cache Integration
180
+
181
+ If caching is enabled:
182
+ 1. **Cache Key**: Use the provided cache key: \`${cacheKey}\`
183
+ 2. **Cache TTL**: ${mergedConfig.cacheTTL} seconds
184
+ 3. **Cache Validation**: Verify cached knowledge is still relevant and up-to-date
185
+
186
+ ## Expected Output
187
+
188
+ Generate comprehensive architectural knowledge that:
189
+ - Covers all specified domains thoroughly
190
+ - Is highly relevant to the project context
191
+ - Provides actionable insights and guidance
192
+ - Maintains consistency with architectural best practices
193
+ - Includes proper evidence and justification
194
+ - Follows the specified JSON structure exactly
195
+
196
+ The generated knowledge will be used to enhance architectural decision-making and provide context-aware guidance for the project.
197
+ `;
198
+ const instructions = `
199
+ # Knowledge Generation Instructions
200
+
201
+ This is a comprehensive architectural knowledge generation task. You must:
202
+
203
+ 1. **Analyze Context**: Understand the project context and requirements
204
+ 2. **Extract Knowledge**: Generate domain-specific architectural knowledge
205
+ 3. **Filter by Relevance**: Apply relevance filtering based on context
206
+ 4. **Structure Output**: Format according to the specified JSON schema
207
+ 5. **Validate Quality**: Ensure high-quality, actionable knowledge
208
+ 6. **Apply Security**: Follow all security and validation requirements
209
+
210
+ ## Quality Standards
211
+ - All knowledge must be accurate and up-to-date
212
+ - Content must be relevant to the specified domains and context
213
+ - Evidence must support each knowledge item
214
+ - Output must follow the exact JSON structure provided
215
+
216
+ ## Success Criteria
217
+ - Knowledge covers all specified domains
218
+ - Relevance scores are above the threshold (${mergedConfig.relevanceThreshold})
219
+ - Total items don't exceed the limit (${mergedConfig.maxKnowledgeItems})
220
+ - All required fields are populated correctly
221
+ - Security validation passes for all content
222
+ `;
223
+ return {
224
+ prompt,
225
+ instructions,
226
+ context: {
227
+ operation: 'knowledge_generation',
228
+ domains: targetDomains,
229
+ config: mergedConfig,
230
+ depth: mergedConfig.depth,
231
+ cacheKey,
232
+ securityLevel: 'high',
233
+ expectedFormat: 'json'
234
+ }
235
+ };
236
+ }
237
+ catch (error) {
238
+ throw new McpAdrError(`Failed to generate knowledge generation prompt: ${error instanceof Error ? error.message : String(error)}`, 'PROMPT_GENERATION_ERROR');
239
+ }
240
+ }
241
+ /**
242
+ * Generate prompt for enhancing an existing prompt with domain-specific knowledge
243
+ * Returns AI delegation prompt for knowledge-enhanced prompt creation
244
+ */
245
+ export async function enhancePromptWithKnowledge(originalPrompt, domains, context = {}, config = {}) {
246
+ try {
247
+ console.error(`[DEBUG] Generating prompt enhancement request for domains: ${domains.join(', ')}`);
248
+ const mergedConfig = { ...DEFAULT_CONFIG, ...config, domains };
249
+ // Merge context from original prompt with provided context
250
+ const enhancedContext = {
251
+ projectPath: './default-project', // Fallback project path
252
+ ...originalPrompt.context,
253
+ ...context
254
+ };
255
+ // Generate knowledge generation prompt first
256
+ const knowledgePrompt = await generateArchitecturalKnowledge(enhancedContext, mergedConfig);
257
+ const prompt = `
258
+ # Prompt Enhancement with Architectural Knowledge
259
+
260
+ Please enhance the following prompt with domain-specific architectural knowledge.
261
+
262
+ ## Original Prompt
263
+ \`\`\`
264
+ ${originalPrompt.prompt}
265
+ \`\`\`
266
+
267
+ ## Original Instructions
268
+ \`\`\`
269
+ ${originalPrompt.instructions}
270
+ \`\`\`
271
+
272
+ ## Knowledge Generation Task
273
+ ${knowledgePrompt.prompt}
274
+
275
+ ## Enhancement Requirements
276
+
277
+ ### Step 1: Generate Domain Knowledge
278
+ Execute the knowledge generation task above to obtain domain-specific architectural knowledge for: ${domains.join(', ')}
279
+
280
+ ### Step 2: Integrate Knowledge with Original Prompt
281
+ Combine the generated knowledge with the original prompt by:
282
+ 1. **Prepending Knowledge Context**: Add the generated knowledge as context before the original prompt
283
+ 2. **Maintaining Original Intent**: Preserve the original prompt's purpose and requirements
284
+ 3. **Enhancing Decision Quality**: Use the knowledge to improve decision-making capabilities
285
+ 4. **Providing Evidence**: Include architectural evidence and best practices
286
+
287
+ ### Step 3: Create Enhanced Prompt Structure
288
+ Format the enhanced prompt as:
289
+ \`\`\`
290
+ # Enhanced Prompt with Architectural Knowledge
291
+
292
+ ## Domain-Specific Knowledge
293
+ [Insert generated architectural knowledge here]
294
+
295
+ ## Original Task
296
+ [Insert original prompt here]
297
+
298
+ ## Knowledge-Informed Approach
299
+ [Explain how the knowledge should inform the task execution]
300
+ \`\`\`
301
+
302
+ ## Quality Requirements
303
+ - Maintain the original prompt's core objectives
304
+ - Seamlessly integrate architectural knowledge
305
+ - Provide clear guidance on using the knowledge
306
+ - Ensure the enhanced prompt is actionable and specific
307
+
308
+ ## Expected Output Format
309
+ Return the enhanced prompt that combines architectural knowledge with the original task requirements.
310
+ `;
311
+ const instructions = `
312
+ # Prompt Enhancement Instructions
313
+
314
+ You must:
315
+ 1. **Execute Knowledge Generation**: Generate domain knowledge using the provided knowledge generation prompt
316
+ 2. **Preserve Original Intent**: Maintain all original prompt requirements and objectives
317
+ 3. **Integrate Seamlessly**: Combine knowledge and original prompt in a coherent way
318
+ 4. **Enhance Decision Quality**: Use knowledge to improve the quality of decisions and recommendations
319
+ 5. **Provide Clear Structure**: Create a well-structured enhanced prompt
320
+
321
+ ## Success Criteria
322
+ - Original prompt objectives are preserved
323
+ - Domain knowledge is properly integrated
324
+ - Enhanced prompt is more informative and context-aware
325
+ - Output maintains clarity and actionability
326
+ `;
327
+ return {
328
+ prompt,
329
+ instructions,
330
+ context: {
331
+ ...originalPrompt.context, // Preserve original context
332
+ operation: 'prompt_enhancement',
333
+ domains,
334
+ originalPrompt,
335
+ config: mergedConfig,
336
+ knowledgeEnhanced: true,
337
+ securityLevel: 'high',
338
+ expectedFormat: 'enhanced_prompt'
339
+ }
340
+ };
341
+ }
342
+ catch (error) {
343
+ console.error('[ERROR] Prompt enhancement generation failed:', error);
344
+ throw new McpAdrError(`Failed to generate prompt enhancement: ${error instanceof Error ? error.message : String(error)}`, 'PROMPT_ENHANCEMENT_ERROR');
345
+ }
346
+ }
347
+ /**
348
+ * Generate prompt for detecting architectural domains from project context
349
+ * Returns AI delegation prompt for domain detection
350
+ */
351
+ export async function detectArchitecturalDomains(projectContext) {
352
+ try {
353
+ console.error(`[DEBUG] Generating domain detection prompt for project: ${projectContext.path}`);
354
+ const prompt = `
355
+ # Architectural Domain Detection Request
356
+
357
+ Please analyze the project context and detect the most relevant architectural domains.
358
+
359
+ ## Project Information
360
+ - **Project Path**: ${projectContext.path}
361
+ - **Project Name**: ${projectContext.name || 'Not specified'}
362
+ - **Description**: ${projectContext.description || 'Not specified'}
363
+
364
+ ## Technology Stack
365
+ ${projectContext.technologies.length > 0
366
+ ? projectContext.technologies.map((tech, index) => `${index + 1}. ${tech}`).join('\n')
367
+ : 'No technologies specified'}
368
+
369
+ ## File Types Present
370
+ ${projectContext.fileTypes.length > 0
371
+ ? projectContext.fileTypes.map((type, index) => `${index + 1}. ${type}`).join('\n')
372
+ : 'No file types specified'}
373
+
374
+ ## Directory Structure
375
+ ${projectContext.directoryStructure.length > 0
376
+ ? projectContext.directoryStructure.map((dir, index) => `${index + 1}. ${dir}`).join('\n')
377
+ : 'No directory structure provided'}
378
+
379
+ ## Package Files
380
+ ${projectContext.packageFiles.length > 0
381
+ ? projectContext.packageFiles.map((file, index) => `${index + 1}. ${file}`).join('\n')
382
+ : 'No package files found'}
383
+
384
+ ## Configuration Files
385
+ ${projectContext.configFiles.length > 0
386
+ ? projectContext.configFiles.map((file, index) => `${index + 1}. ${file}`).join('\n')
387
+ : 'No configuration files found'}
388
+
389
+ ## Available Architectural Domains
390
+ 1. **web-applications** - Frontend web applications (React, Vue, Angular, etc.)
391
+ 2. **mobile-applications** - Mobile app development (React Native, Flutter, etc.)
392
+ 3. **microservices** - Microservices architecture and distributed systems
393
+ 4. **database-design** - Database design and data management
394
+ 5. **cloud-infrastructure** - Cloud platforms and infrastructure (AWS, Azure, GCP)
395
+ 6. **devops-cicd** - DevOps practices and CI/CD pipelines
396
+ 7. **security-patterns** - Security architecture and patterns
397
+ 8. **performance-optimization** - Performance optimization strategies
398
+ 9. **api-design** - API design and development (REST, GraphQL)
399
+ 10. **data-architecture** - Data architecture and analytics
400
+
401
+ ## Domain Detection Criteria
402
+
403
+ ### Technology Mapping
404
+ - **Web Applications**: React, Vue, Angular, Svelte, Next.js, Nuxt, Gatsby, HTML, CSS, JavaScript, TypeScript
405
+ - **Mobile Applications**: React Native, Flutter, Ionic, Xamarin, Swift, Kotlin
406
+ - **Microservices**: Docker, Kubernetes, Consul, Istio, Envoy, Service Mesh
407
+ - **Database Design**: MongoDB, PostgreSQL, MySQL, Redis, Prisma, TypeORM, Sequelize
408
+ - **Cloud Infrastructure**: AWS, Azure, GCP, Terraform, CloudFormation, Serverless
409
+ - **DevOps/CI-CD**: Jenkins, GitHub Actions, GitLab CI, Docker, Kubernetes, Ansible
410
+ - **API Design**: Express, Fastify, Koa, NestJS, GraphQL, Apollo, REST
411
+ - **Security**: OAuth, JWT, HTTPS, Encryption, Authentication, Authorization
412
+
413
+ ### File Type Indicators
414
+ - **.tsx, .jsx, .vue, .html** → Web Applications
415
+ - **.swift, .kt, .dart** → Mobile Applications
416
+ - **.dockerfile, docker-compose.yml** → Microservices/Cloud
417
+ - **.sql, .prisma, migrations/** → Database Design
418
+ - **.tf, .yml (CI/CD)** → DevOps/Infrastructure
419
+
420
+ ### Configuration File Indicators
421
+ - **package.json, yarn.lock** → Web/Node.js ecosystem
422
+ - **Dockerfile, docker-compose.yml** → Containerization
423
+ - **terraform files** → Infrastructure as Code
424
+ - **CI/CD config files** → DevOps practices
425
+
426
+ ## Required Analysis Tasks
427
+
428
+ ### Step 1: Technology Analysis
429
+ Analyze the provided technologies and map them to architectural domains based on the criteria above.
430
+
431
+ ### Step 2: File Type Analysis
432
+ Examine file types to identify development patterns and architectural approaches.
433
+
434
+ ### Step 3: Configuration Analysis
435
+ Review configuration files to understand deployment and infrastructure patterns.
436
+
437
+ ### Step 4: Confidence Scoring
438
+ Assign confidence scores (0-1) for each detected domain based on:
439
+ - Number of matching technologies
440
+ - Strength of evidence
441
+ - Consistency of indicators
442
+
443
+ ### Step 5: Evidence Collection
444
+ Document specific evidence for each detected domain including:
445
+ - Matching technologies
446
+ - Relevant file types
447
+ - Supporting configuration files
448
+
449
+ ## Expected Output Format
450
+ \`\`\`json
451
+ {
452
+ "domainDetection": {
453
+ "detectedDomains": ["domain1", "domain2"],
454
+ "confidence": number,
455
+ "evidence": [
456
+ {
457
+ "domain": "domain-name",
458
+ "confidence": number,
459
+ "evidence": ["evidence1", "evidence2"],
460
+ "sources": ["source1", "source2"]
461
+ }
462
+ ],
463
+ "recommendations": ["recommendation1", "recommendation2"],
464
+ "fallbackDomains": ["fallback1", "fallback2"],
465
+ "metadata": {
466
+ "analysisTimestamp": "ISO-8601",
467
+ "projectPath": "${projectContext.path}",
468
+ "technologiesAnalyzed": ${projectContext.technologies.length},
469
+ "fileTypesAnalyzed": ${projectContext.fileTypes.length}
470
+ }
471
+ }
472
+ }
473
+ \`\`\`
474
+
475
+ ## Quality Requirements
476
+ - Detect at least 1-3 most relevant domains
477
+ - Provide confidence scores above 0.6 for primary domains
478
+ - Include specific evidence for each detection
479
+ - Offer fallback domains if detection confidence is low
480
+ - Ensure recommendations are actionable and specific
481
+
482
+ The detected domains will be used for generating relevant architectural knowledge and guidance.
483
+ `;
484
+ const instructions = `
485
+ # Domain Detection Instructions
486
+
487
+ You must:
488
+ 1. **Analyze All Context**: Examine technologies, file types, directories, and configuration files
489
+ 2. **Apply Detection Criteria**: Use the provided mapping criteria to identify domains
490
+ 3. **Calculate Confidence**: Assign realistic confidence scores based on evidence strength
491
+ 4. **Collect Evidence**: Document specific evidence supporting each domain detection
492
+ 5. **Provide Recommendations**: Suggest additional domains or clarifications if needed
493
+ 6. **Format Output**: Follow the exact JSON structure provided
494
+
495
+ ## Success Criteria
496
+ - At least one domain detected with confidence > 0.6
497
+ - All detected domains have supporting evidence
498
+ - Output follows the specified JSON format exactly
499
+ - Recommendations are helpful and actionable
500
+ `;
501
+ return {
502
+ prompt,
503
+ instructions,
504
+ context: {
505
+ operation: 'domain_detection',
506
+ projectContext,
507
+ availableDomains: [
508
+ 'web-applications', 'mobile-applications', 'microservices',
509
+ 'database-design', 'cloud-infrastructure', 'devops-cicd',
510
+ 'security-patterns', 'performance-optimization', 'api-design', 'data-architecture'
511
+ ],
512
+ securityLevel: 'medium',
513
+ expectedFormat: 'json'
514
+ }
515
+ };
516
+ }
517
+ catch (error) {
518
+ console.error('[ERROR] Domain detection prompt generation failed:', error);
519
+ throw new McpAdrError(`Failed to generate domain detection prompt: ${error instanceof Error ? error.message : String(error)}`, 'DOMAIN_DETECTION_ERROR');
520
+ }
521
+ }
522
+ // ============================================================================
523
+ // Utility Functions for Prompt Generation
524
+ // ============================================================================
525
+ /**
526
+ * Generate cache key for knowledge generation requests
527
+ */
528
+ export function generateKnowledgeCacheKey(domains, context, config) {
529
+ const contextHash = Buffer.from(JSON.stringify(context)).toString('base64').substring(0, 16);
530
+ const configHash = Buffer.from(JSON.stringify(config)).toString('base64').substring(0, 16);
531
+ return `knowledge:${domains.join('+')}-${contextHash}-${configHash}`;
532
+ }
533
+ /**
534
+ * Get available domain templates information for prompt generation
535
+ */
536
+ export function getAvailableDomainsInfo() {
537
+ const availableDomains = [
538
+ 'web-applications', 'mobile-applications', 'microservices',
539
+ 'database-design', 'cloud-infrastructure', 'devops-cicd',
540
+ 'security-patterns', 'performance-optimization', 'api-design', 'data-architecture'
541
+ ];
542
+ return availableDomains.map(domain => {
543
+ const template = getDomainTemplate(domain);
544
+ return {
545
+ domain,
546
+ hasTemplate: !!template,
547
+ categoryCount: template?.categories.length || 0
548
+ };
549
+ });
550
+ }
551
+ /**
552
+ * Validate knowledge generation inputs
553
+ */
554
+ export function validateKnowledgeGenerationInputs(context, config) {
555
+ if (!context) {
556
+ throw new McpAdrError('Context is required for knowledge generation', 'INVALID_INPUT');
557
+ }
558
+ if (config.domains && config.domains.length > 10) {
559
+ throw new McpAdrError('Too many domains specified (maximum 10)', 'INVALID_INPUT');
560
+ }
561
+ if (config.maxKnowledgeItems && config.maxKnowledgeItems > 200) {
562
+ throw new McpAdrError('Maximum knowledge items limit exceeded (maximum 200)', 'INVALID_INPUT');
563
+ }
564
+ if (config.relevanceThreshold && (config.relevanceThreshold < 0 || config.relevanceThreshold > 1)) {
565
+ throw new McpAdrError('Relevance threshold must be between 0 and 1', 'INVALID_INPUT');
566
+ }
567
+ }
568
+ // ============================================================================
569
+ // Export Functions for External Use
570
+ // ============================================================================
571
+ /**
572
+ * Get default knowledge generation configuration
573
+ */
574
+ export function getDefaultKnowledgeConfig() {
575
+ return { ...DEFAULT_CONFIG };
576
+ }
577
+ /**
578
+ * Check if a domain has an available template
579
+ */
580
+ export function isDomainSupported(domain) {
581
+ return getDomainTemplate(domain) !== undefined;
582
+ }
583
+ /**
584
+ * Get supported architectural domains
585
+ */
586
+ export function getSupportedDomains() {
587
+ return [
588
+ 'web-applications', 'mobile-applications', 'microservices',
589
+ 'database-design', 'cloud-infrastructure', 'devops-cicd',
590
+ 'security-patterns', 'performance-optimization', 'api-design', 'data-architecture'
591
+ ];
592
+ }
593
+ /**
594
+ * Get supported knowledge depths
595
+ */
596
+ export function getSupportedDepths() {
597
+ return ['basic', 'intermediate', 'advanced'];
598
+ }
599
+ /**
600
+ * Validate knowledge generation configuration
601
+ */
602
+ export function validateKnowledgeConfig(config) {
603
+ if (config.maxKnowledgeItems && config.maxKnowledgeItems <= 0) {
604
+ throw new Error('Max knowledge items must be positive');
605
+ }
606
+ if (config.maxTokens !== undefined && config.maxTokens <= 0) {
607
+ throw new Error('Max tokens must be positive');
608
+ }
609
+ if (config.depth && !['basic', 'intermediate', 'advanced'].includes(config.depth)) {
610
+ throw new Error('Invalid depth');
611
+ }
612
+ if (config.domains && config.domains.length === 0) {
613
+ throw new Error('At least one domain must be specified');
614
+ }
615
+ }
616
+ /**
617
+ * Create domain-specific knowledge configuration
618
+ */
619
+ export function createDomainKnowledgeConfig(domain) {
620
+ return {
621
+ domains: [domain],
622
+ depth: 'intermediate',
623
+ cacheEnabled: true,
624
+ maxKnowledgeItems: 50
625
+ };
626
+ }
627
+ /**
628
+ * Generate domain-specific knowledge
629
+ */
630
+ export async function generateDomainKnowledge(domain, depth) {
631
+ const supportedDomains = getSupportedDomains();
632
+ if (!supportedDomains.includes(domain)) {
633
+ throw new Error(`Unsupported domain: ${domain}`);
634
+ }
635
+ return {
636
+ prompt: `Domain Knowledge Generation Request for ${domain}`,
637
+ instructions: `Generate ${depth} level knowledge for ${domain}`,
638
+ context: {
639
+ operation: 'knowledge_generation',
640
+ domain,
641
+ depth,
642
+ knowledgeGenerated: true
643
+ }
644
+ };
645
+ }
646
+ //# sourceMappingURL=knowledge-generation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"knowledge-generation.js","sourceRoot":"","sources":["../../../src/utils/knowledge-generation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAE/E,+EAA+E;AAC/E,8BAA8B;AAC9B,+EAA+E;AAE/E,MAAM,cAAc,GAAwC;IAC1D,OAAO,EAAE,EAAE;IACX,KAAK,EAAE,cAAc;IACrB,YAAY,EAAE,IAAI;IAClB,QAAQ,EAAE,IAAI,EAAE,SAAS;IACzB,kBAAkB,EAAE,IAAI;IACxB,eAAe,EAAE,EAAE;IACnB,iBAAiB,EAAE,EAAE;IACrB,SAAS,EAAE,IAAI;IACf,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,IAAI;CACzB,CAAC;AAEF,MAAM,iBAAiB,GAAG,OAAO,CAAC;AAElC,+EAA+E;AAC/E,2DAA2D;AAC3D,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,OAA6B,EAC7B,SAAoC,EAAE;IAEtC,IAAI,CAAC;QACH,iBAAiB;QACjB,IAAI,CAAC,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YAC9D,MAAM,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