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.
- package/README.md +367 -150
- package/dist/src/config/ai-config.d.ts +81 -0
- package/dist/src/config/ai-config.d.ts.map +1 -0
- package/dist/src/config/ai-config.js +134 -0
- package/dist/src/config/ai-config.js.map +1 -0
- package/dist/src/index.d.ts +97 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2430 -186
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +2 -2
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -1
- package/dist/src/prompts/adr-suggestion-prompts.js +25 -17
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -1
- package/dist/src/prompts/analysis-prompts.js +1 -1
- package/dist/src/prompts/analysis-prompts.js.map +1 -1
- package/dist/src/resources/index.d.ts +1 -1
- package/dist/src/resources/index.d.ts.map +1 -1
- package/dist/src/resources/index.js +52 -44
- package/dist/src/resources/index.js.map +1 -1
- package/dist/src/templates/domain-knowledge-templates.d.ts +36 -0
- package/dist/src/templates/domain-knowledge-templates.d.ts.map +1 -0
- package/dist/src/templates/domain-knowledge-templates.js +376 -0
- package/dist/src/templates/domain-knowledge-templates.js.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts +8 -3
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -1
- package/dist/src/tools/adr-suggestion-tool.js +561 -172
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -1
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -1
- package/dist/src/tools/content-masking-tool.js +168 -22
- package/dist/src/tools/content-masking-tool.js.map +1 -1
- package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/deployment-analysis-tool.js +64 -27
- package/dist/src/tools/deployment-analysis-tool.js.map +1 -1
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -1
- package/dist/src/tools/environment-analysis-tool.js +65 -29
- package/dist/src/tools/environment-analysis-tool.js.map +1 -1
- package/dist/src/tools/research-question-tool.d.ts.map +1 -1
- package/dist/src/tools/research-question-tool.js +150 -49
- package/dist/src/tools/research-question-tool.js.map +1 -1
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -1
- package/dist/src/tools/rule-generation-tool.js +328 -143
- package/dist/src/tools/rule-generation-tool.js.map +1 -1
- package/dist/src/types/ape-framework.d.ts +566 -0
- package/dist/src/types/ape-framework.d.ts.map +1 -0
- package/dist/src/types/ape-framework.js +98 -0
- package/dist/src/types/ape-framework.js.map +1 -0
- package/dist/src/types/index.d.ts +96 -93
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/knowledge-generation.d.ts +671 -0
- package/dist/src/types/knowledge-generation.d.ts.map +1 -0
- package/dist/src/types/knowledge-generation.js +107 -0
- package/dist/src/types/knowledge-generation.js.map +1 -0
- package/dist/src/types/reflexion-framework.d.ts +652 -0
- package/dist/src/types/reflexion-framework.d.ts.map +1 -0
- package/dist/src/types/reflexion-framework.js +85 -0
- package/dist/src/types/reflexion-framework.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +1 -1
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -1
- package/dist/src/utils/adr-suggestions.js +8 -50
- package/dist/src/utils/adr-suggestions.js.map +1 -1
- package/dist/src/utils/ai-executor.d.ts +125 -0
- package/dist/src/utils/ai-executor.d.ts.map +1 -0
- package/dist/src/utils/ai-executor.js +292 -0
- package/dist/src/utils/ai-executor.js.map +1 -0
- package/dist/src/utils/automatic-prompt-engineering.d.ts +72 -0
- package/dist/src/utils/automatic-prompt-engineering.d.ts.map +1 -0
- package/dist/src/utils/automatic-prompt-engineering.js +820 -0
- package/dist/src/utils/automatic-prompt-engineering.js.map +1 -0
- package/dist/src/utils/cache.d.ts +54 -22
- package/dist/src/utils/cache.d.ts.map +1 -1
- package/dist/src/utils/cache.js +1234 -143
- package/dist/src/utils/cache.js.map +1 -1
- package/dist/src/utils/config.d.ts +2 -2
- package/dist/src/utils/config.js +3 -3
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -1
- package/dist/src/utils/deployment-analysis.js +57 -38
- package/dist/src/utils/deployment-analysis.js.map +1 -1
- package/dist/src/utils/environment-analysis.d.ts.map +1 -1
- package/dist/src/utils/environment-analysis.js +113 -100
- package/dist/src/utils/environment-analysis.js.map +1 -1
- package/dist/src/utils/file-system.d.ts +42 -13
- package/dist/src/utils/file-system.d.ts.map +1 -1
- package/dist/src/utils/file-system.js +795 -89
- package/dist/src/utils/file-system.js.map +1 -1
- package/dist/src/utils/index.d.ts +9 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +13 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/knowledge-generation.d.ts +79 -0
- package/dist/src/utils/knowledge-generation.d.ts.map +1 -0
- package/dist/src/utils/knowledge-generation.js +646 -0
- package/dist/src/utils/knowledge-generation.js.map +1 -0
- package/dist/src/utils/output-masking.d.ts.map +1 -1
- package/dist/src/utils/output-masking.js +2 -1
- package/dist/src/utils/output-masking.js.map +1 -1
- package/dist/src/utils/prompt-composition.d.ts +234 -0
- package/dist/src/utils/prompt-composition.d.ts.map +1 -0
- package/dist/src/utils/prompt-composition.js +379 -0
- package/dist/src/utils/prompt-composition.js.map +1 -0
- package/dist/src/utils/prompt-execution.d.ts +88 -0
- package/dist/src/utils/prompt-execution.d.ts.map +1 -0
- package/dist/src/utils/prompt-execution.js +227 -0
- package/dist/src/utils/prompt-execution.js.map +1 -0
- package/dist/src/utils/reflexion.d.ts +92 -0
- package/dist/src/utils/reflexion.d.ts.map +1 -0
- package/dist/src/utils/reflexion.js +1100 -0
- package/dist/src/utils/reflexion.js.map +1 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -1
- package/dist/src/utils/research-integration.js +156 -100
- package/dist/src/utils/research-integration.js.map +1 -1
- package/dist/src/utils/research-questions.d.ts.map +1 -1
- package/dist/src/utils/research-questions.js +85 -24
- package/dist/src/utils/research-questions.js.map +1 -1
- package/dist/src/utils/rule-generation.d.ts.map +1 -1
- package/dist/src/utils/rule-generation.js +92 -108
- package/dist/src/utils/rule-generation.js.map +1 -1
- package/package.json +9 -3
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Configuration for OpenRouter.ai Integration
|
|
3
|
+
*
|
|
4
|
+
* This module handles configuration for AI execution capabilities,
|
|
5
|
+
* allowing the MCP server to execute prompts internally and return
|
|
6
|
+
* actual results instead of prompts.
|
|
7
|
+
*/
|
|
8
|
+
export interface AIConfig {
|
|
9
|
+
/** OpenRouter API key for authentication */
|
|
10
|
+
apiKey: string;
|
|
11
|
+
/** Base URL for OpenRouter API */
|
|
12
|
+
baseURL: string;
|
|
13
|
+
/** Default AI model to use for prompt execution */
|
|
14
|
+
defaultModel: string;
|
|
15
|
+
/** Execution mode: 'full' executes prompts, 'prompt-only' returns prompts */
|
|
16
|
+
executionMode: 'full' | 'prompt-only';
|
|
17
|
+
/** Site URL for OpenRouter rankings (optional) */
|
|
18
|
+
siteUrl?: string;
|
|
19
|
+
/** Site name for OpenRouter rankings (optional) */
|
|
20
|
+
siteName?: string;
|
|
21
|
+
/** Request timeout in milliseconds */
|
|
22
|
+
timeout: number;
|
|
23
|
+
/** Maximum retries for failed requests */
|
|
24
|
+
maxRetries: number;
|
|
25
|
+
/** Temperature for AI responses (0-1) */
|
|
26
|
+
temperature: number;
|
|
27
|
+
/** Maximum tokens for AI responses */
|
|
28
|
+
maxTokens: number;
|
|
29
|
+
/** Enable response caching */
|
|
30
|
+
cacheEnabled: boolean;
|
|
31
|
+
/** Cache TTL in seconds */
|
|
32
|
+
cacheTTL: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ModelConfig {
|
|
35
|
+
/** Model identifier for OpenRouter */
|
|
36
|
+
id: string;
|
|
37
|
+
/** Human-readable model name */
|
|
38
|
+
name: string;
|
|
39
|
+
/** Model provider (openai, anthropic, etc.) */
|
|
40
|
+
provider: string;
|
|
41
|
+
/** Cost per 1K tokens (input) */
|
|
42
|
+
inputCost: number;
|
|
43
|
+
/** Cost per 1K tokens (output) */
|
|
44
|
+
outputCost: number;
|
|
45
|
+
/** Maximum context length */
|
|
46
|
+
contextLength: number;
|
|
47
|
+
/** Recommended use cases */
|
|
48
|
+
useCases: string[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Available AI models for different use cases
|
|
52
|
+
*/
|
|
53
|
+
export declare const AVAILABLE_MODELS: Record<string, ModelConfig>;
|
|
54
|
+
/**
|
|
55
|
+
* Default AI configuration
|
|
56
|
+
*/
|
|
57
|
+
export declare const DEFAULT_AI_CONFIG: Omit<AIConfig, 'siteUrl' | 'siteName'> & {
|
|
58
|
+
siteUrl: string;
|
|
59
|
+
siteName: string;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Load AI configuration from environment variables
|
|
63
|
+
*/
|
|
64
|
+
export declare function loadAIConfig(): AIConfig;
|
|
65
|
+
/**
|
|
66
|
+
* Validate AI configuration
|
|
67
|
+
*/
|
|
68
|
+
export declare function validateAIConfig(config: AIConfig): void;
|
|
69
|
+
/**
|
|
70
|
+
* Get model configuration by ID
|
|
71
|
+
*/
|
|
72
|
+
export declare function getModelConfig(modelId: string): ModelConfig | undefined;
|
|
73
|
+
/**
|
|
74
|
+
* Check if AI execution is enabled
|
|
75
|
+
*/
|
|
76
|
+
export declare function isAIExecutionEnabled(config: AIConfig): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Get recommended model for a specific use case
|
|
79
|
+
*/
|
|
80
|
+
export declare function getRecommendedModel(useCase: string, costSensitive?: boolean): string;
|
|
81
|
+
//# sourceMappingURL=ai-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-config.d.ts","sourceRoot":"","sources":["../../../src/config/ai-config.ts"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a3G,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,IAAI,QAAQ,CAiBvC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAoBvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAGvE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,QAAQ,GAAG,OAAO,CAE9D;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,GAAE,OAAe,GAAG,MAAM,CAiB3F"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Configuration for OpenRouter.ai Integration
|
|
3
|
+
*
|
|
4
|
+
* This module handles configuration for AI execution capabilities,
|
|
5
|
+
* allowing the MCP server to execute prompts internally and return
|
|
6
|
+
* actual results instead of prompts.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Available AI models for different use cases
|
|
10
|
+
*/
|
|
11
|
+
export const AVAILABLE_MODELS = {
|
|
12
|
+
'claude-3-sonnet': {
|
|
13
|
+
id: 'anthropic/claude-3-sonnet',
|
|
14
|
+
name: 'Claude 3 Sonnet',
|
|
15
|
+
provider: 'anthropic',
|
|
16
|
+
inputCost: 3.0,
|
|
17
|
+
outputCost: 15.0,
|
|
18
|
+
contextLength: 200000,
|
|
19
|
+
useCases: ['analysis', 'reasoning', 'code-generation']
|
|
20
|
+
},
|
|
21
|
+
'claude-3-haiku': {
|
|
22
|
+
id: 'anthropic/claude-3-haiku',
|
|
23
|
+
name: 'Claude 3 Haiku',
|
|
24
|
+
provider: 'anthropic',
|
|
25
|
+
inputCost: 0.25,
|
|
26
|
+
outputCost: 1.25,
|
|
27
|
+
contextLength: 200000,
|
|
28
|
+
useCases: ['quick-analysis', 'simple-tasks']
|
|
29
|
+
},
|
|
30
|
+
'gpt-4o': {
|
|
31
|
+
id: 'openai/gpt-4o',
|
|
32
|
+
name: 'GPT-4 Omni',
|
|
33
|
+
provider: 'openai',
|
|
34
|
+
inputCost: 5.0,
|
|
35
|
+
outputCost: 15.0,
|
|
36
|
+
contextLength: 128000,
|
|
37
|
+
useCases: ['analysis', 'reasoning', 'creative-tasks']
|
|
38
|
+
},
|
|
39
|
+
'gpt-4o-mini': {
|
|
40
|
+
id: 'openai/gpt-4o-mini',
|
|
41
|
+
name: 'GPT-4 Omni Mini',
|
|
42
|
+
provider: 'openai',
|
|
43
|
+
inputCost: 0.15,
|
|
44
|
+
outputCost: 0.6,
|
|
45
|
+
contextLength: 128000,
|
|
46
|
+
useCases: ['quick-analysis', 'simple-tasks', 'cost-effective']
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Default AI configuration
|
|
51
|
+
*/
|
|
52
|
+
export const DEFAULT_AI_CONFIG = {
|
|
53
|
+
apiKey: '',
|
|
54
|
+
baseURL: 'https://openrouter.ai/api/v1',
|
|
55
|
+
defaultModel: 'anthropic/claude-3-sonnet',
|
|
56
|
+
executionMode: 'full',
|
|
57
|
+
siteUrl: 'https://github.com/tosin2013/mcp-adr-analysis-server',
|
|
58
|
+
siteName: 'MCP ADR Analysis Server',
|
|
59
|
+
timeout: 60000, // 60 seconds
|
|
60
|
+
maxRetries: 3,
|
|
61
|
+
temperature: 0.1, // Lower for more consistent results
|
|
62
|
+
maxTokens: 4000,
|
|
63
|
+
cacheEnabled: true,
|
|
64
|
+
cacheTTL: 3600 // 1 hour
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Load AI configuration from environment variables
|
|
68
|
+
*/
|
|
69
|
+
export function loadAIConfig() {
|
|
70
|
+
const config = {
|
|
71
|
+
apiKey: process.env['OPENROUTER_API_KEY'] || '',
|
|
72
|
+
baseURL: 'https://openrouter.ai/api/v1',
|
|
73
|
+
defaultModel: process.env['AI_MODEL'] || DEFAULT_AI_CONFIG.defaultModel,
|
|
74
|
+
executionMode: process.env['EXECUTION_MODE'] || DEFAULT_AI_CONFIG.executionMode,
|
|
75
|
+
siteUrl: process.env['SITE_URL'] || DEFAULT_AI_CONFIG.siteUrl,
|
|
76
|
+
siteName: process.env['SITE_NAME'] || DEFAULT_AI_CONFIG.siteName,
|
|
77
|
+
timeout: parseInt(process.env['AI_TIMEOUT'] || '') || DEFAULT_AI_CONFIG.timeout,
|
|
78
|
+
maxRetries: parseInt(process.env['AI_MAX_RETRIES'] || '') || DEFAULT_AI_CONFIG.maxRetries,
|
|
79
|
+
temperature: parseFloat(process.env['AI_TEMPERATURE'] || '') || DEFAULT_AI_CONFIG.temperature,
|
|
80
|
+
maxTokens: parseInt(process.env['AI_MAX_TOKENS'] || '') || DEFAULT_AI_CONFIG.maxTokens,
|
|
81
|
+
cacheEnabled: process.env['AI_CACHE_ENABLED'] !== 'false',
|
|
82
|
+
cacheTTL: parseInt(process.env['AI_CACHE_TTL'] || '') || DEFAULT_AI_CONFIG.cacheTTL
|
|
83
|
+
};
|
|
84
|
+
return config;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Validate AI configuration
|
|
88
|
+
*/
|
|
89
|
+
export function validateAIConfig(config) {
|
|
90
|
+
if (config.executionMode === 'full' && !config.apiKey) {
|
|
91
|
+
throw new Error('OPENROUTER_API_KEY is required when execution mode is "full"');
|
|
92
|
+
}
|
|
93
|
+
if (!AVAILABLE_MODELS[config.defaultModel.replace('anthropic/', '').replace('openai/', '')]) {
|
|
94
|
+
console.warn(`Unknown model: ${config.defaultModel}. Using default.`);
|
|
95
|
+
}
|
|
96
|
+
if (config.temperature < 0 || config.temperature > 1) {
|
|
97
|
+
throw new Error('Temperature must be between 0 and 1');
|
|
98
|
+
}
|
|
99
|
+
if (config.maxTokens < 100 || config.maxTokens > 8000) {
|
|
100
|
+
throw new Error('Max tokens must be between 100 and 8000');
|
|
101
|
+
}
|
|
102
|
+
if (config.timeout < 1000 || config.timeout > 300000) {
|
|
103
|
+
throw new Error('Timeout must be between 1000ms and 300000ms');
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get model configuration by ID
|
|
108
|
+
*/
|
|
109
|
+
export function getModelConfig(modelId) {
|
|
110
|
+
const normalizedId = modelId.replace('anthropic/', '').replace('openai/', '');
|
|
111
|
+
return AVAILABLE_MODELS[normalizedId];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Check if AI execution is enabled
|
|
115
|
+
*/
|
|
116
|
+
export function isAIExecutionEnabled(config) {
|
|
117
|
+
return config.executionMode === 'full' && !!config.apiKey;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get recommended model for a specific use case
|
|
121
|
+
*/
|
|
122
|
+
export function getRecommendedModel(useCase, costSensitive = false) {
|
|
123
|
+
const models = Object.values(AVAILABLE_MODELS);
|
|
124
|
+
const suitableModels = models.filter(model => model.useCases.includes(useCase) || model.useCases.includes('analysis'));
|
|
125
|
+
if (suitableModels.length === 0) {
|
|
126
|
+
return DEFAULT_AI_CONFIG.defaultModel;
|
|
127
|
+
}
|
|
128
|
+
if (costSensitive) {
|
|
129
|
+
// Sort by cost (input + output cost)
|
|
130
|
+
suitableModels.sort((a, b) => (a.inputCost + a.outputCost) - (b.inputCost + b.outputCost));
|
|
131
|
+
}
|
|
132
|
+
return suitableModels[0].id;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=ai-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-config.js","sourceRoot":"","sources":["../../../src/config/ai-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8CH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAgC;IAC3D,iBAAiB,EAAE;QACjB,EAAE,EAAE,2BAA2B;QAC/B,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,WAAW;QACrB,SAAS,EAAE,GAAG;QACd,UAAU,EAAE,IA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AAmB,CAAC,OAAe,EAAE,gBAAyB,KAAK;IACjF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAE/C,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC3C,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CACxE,CAAC;IAEF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,iBAAiB,CAAC,YAAY,CAAC;IACxC,CAAC;IAED,IAAI,aAAa,EAAE,CAAC;QAClB,qCAAqC;QACrC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED,OAAO,cAAc,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;AAC/B,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -6,5 +6,101 @@
|
|
|
6
6
|
* This server provides Tools, Resources, and Prompts for analyzing
|
|
7
7
|
* Architectural Decision Records and project architecture.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Main server class
|
|
11
|
+
*/
|
|
12
|
+
export declare class McpAdrAnalysisServer {
|
|
13
|
+
private server;
|
|
14
|
+
private maskingConfig;
|
|
15
|
+
private config;
|
|
16
|
+
private logger;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* Validate configuration and project setup
|
|
20
|
+
*/
|
|
21
|
+
private validateConfiguration;
|
|
22
|
+
/**
|
|
23
|
+
* Public health check method for testing
|
|
24
|
+
*/
|
|
25
|
+
healthCheck(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* Setup MCP protocol handlers
|
|
28
|
+
*/
|
|
29
|
+
private setupHandlers;
|
|
30
|
+
/**
|
|
31
|
+
* Tool implementations
|
|
32
|
+
*/
|
|
33
|
+
private checkAIExecutionStatus;
|
|
34
|
+
private getWorkflowGuidance;
|
|
35
|
+
private getDevelopmentGuidance;
|
|
36
|
+
private analyzeProjectEcosystem;
|
|
37
|
+
private getArchitecturalContext;
|
|
38
|
+
private generateAdrsFromPrd;
|
|
39
|
+
private generateAdrTodo;
|
|
40
|
+
private compareAdrProgress;
|
|
41
|
+
/**
|
|
42
|
+
* Content masking tool implementations
|
|
43
|
+
*/
|
|
44
|
+
private analyzeContentSecurity;
|
|
45
|
+
private generateContentMasking;
|
|
46
|
+
private configureCustomPatterns;
|
|
47
|
+
private applyBasicContentMasking;
|
|
48
|
+
private validateContentMasking;
|
|
49
|
+
private manageCache;
|
|
50
|
+
private configureOutputMasking;
|
|
51
|
+
/**
|
|
52
|
+
* Helper method to get domains based on PRD type
|
|
53
|
+
*/
|
|
54
|
+
private getPrdTypeDomains;
|
|
55
|
+
/**
|
|
56
|
+
* Helper method to get domains for ecosystem analysis based on technology focus
|
|
57
|
+
*/
|
|
58
|
+
private getEcosystemAnalysisDomains;
|
|
59
|
+
/**
|
|
60
|
+
* Helper method to create base ADR generation prompt
|
|
61
|
+
*/
|
|
62
|
+
private createBaseAdrPrompt;
|
|
63
|
+
/**
|
|
64
|
+
* ADR suggestion tool implementations
|
|
65
|
+
*/
|
|
66
|
+
private suggestAdrs;
|
|
67
|
+
private generateAdrFromDecision;
|
|
68
|
+
private discoverExistingAdrs;
|
|
69
|
+
/**
|
|
70
|
+
* Research integration tool implementations
|
|
71
|
+
*/
|
|
72
|
+
private incorporateResearch;
|
|
73
|
+
private createResearchTemplate;
|
|
74
|
+
private requestActionConfirmation;
|
|
75
|
+
/**
|
|
76
|
+
* Rule generation and validation tool implementations
|
|
77
|
+
*/
|
|
78
|
+
private generateRules;
|
|
79
|
+
private validateRules;
|
|
80
|
+
private createRuleSet;
|
|
81
|
+
/**
|
|
82
|
+
* Environment analysis tool implementation
|
|
83
|
+
*/
|
|
84
|
+
private analyzeEnvironment;
|
|
85
|
+
/**
|
|
86
|
+
* Research question generation tool implementation
|
|
87
|
+
*/
|
|
88
|
+
private generateResearchQuestions;
|
|
89
|
+
/**
|
|
90
|
+
* Deployment analysis tool implementation
|
|
91
|
+
*/
|
|
92
|
+
private analyzeDeploymentProgress;
|
|
93
|
+
/**
|
|
94
|
+
* Apply content masking to MCP response
|
|
95
|
+
*/
|
|
96
|
+
private applyOutputMasking;
|
|
97
|
+
/**
|
|
98
|
+
* Read MCP resource with prompt-driven caching
|
|
99
|
+
*/
|
|
100
|
+
private readResource;
|
|
101
|
+
/**
|
|
102
|
+
* Start the server
|
|
103
|
+
*/
|
|
104
|
+
start(): Promise<void>;
|
|
105
|
+
}
|
|
10
106
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AA0BH;;GAEG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,aAAa,CAAM;IAC3B,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAkC;;IAwBhD;;OAEG;YACW,qBAAqB;IAUnC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAKlC;;OAEG;IACH,OAAO,CAAC,aAAa;IAqwCrB;;OAEG;YACW,sBAAsB;YAgGtB,mBAAmB;YAqMnB,sBAAsB;YAoPtB,uBAAuB;YAqUvB,uBAAuB;YA0PvB,mBAAmB;YA6RnB,eAAe;YAkUf,kBAAkB;IAwZhC;;OAEG;YACW,sBAAsB;YAKtB,sBAAsB;YAKtB,uBAAuB;YAKvB,wBAAwB;YAKxB,sBAAsB;YAKtB,WAAW;YAkJX,sBAAsB;IAuHpC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAazB;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAyDnC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAyF3B;;OAEG;YACW,WAAW;YAKX,uBAAuB;YAKvB,oBAAoB;IAKlC;;OAEG;YACW,mBAAmB;YAKnB,sBAAsB;YAKtB,yBAAyB;IAKvC;;OAEG;YACW,aAAa;YAKb,aAAa;YAKb,aAAa;IAK3B;;OAEG;YACW,kBAAkB;IAKhC;;OAEG;YACW,yBAAyB;IAKvC;;OAEG;YACW,yBAAyB;IAKvC;;OAEG;YACW,kBAAkB;IAWhC;;OAEG;YACW,YAAY;IAmF1B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAa7B"}
|