mcp-adr-analysis-server 2.7.29 → 2.7.31

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 (42) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/package.json +1 -1
  3. package/dist/src/resources/adrs-review-resource.d.ts +0 -82
  4. package/dist/src/resources/adrs-review-resource.d.ts.map +0 -1
  5. package/dist/src/resources/adrs-review-resource.js +0 -160
  6. package/dist/src/resources/adrs-review-resource.js.map +0 -1
  7. package/dist/src/resources/architectural-context-resource.d.ts +0 -95
  8. package/dist/src/resources/architectural-context-resource.d.ts.map +0 -1
  9. package/dist/src/resources/architectural-context-resource.js +0 -428
  10. package/dist/src/resources/architectural-context-resource.js.map +0 -1
  11. package/dist/src/resources/memory-expand-resource.d.ts +0 -90
  12. package/dist/src/resources/memory-expand-resource.d.ts.map +0 -1
  13. package/dist/src/resources/memory-expand-resource.js +0 -176
  14. package/dist/src/resources/memory-expand-resource.js.map +0 -1
  15. package/dist/src/tools/tree-sitter-code-tools.d.ts +0 -189
  16. package/dist/src/tools/tree-sitter-code-tools.d.ts.map +0 -1
  17. package/dist/src/tools/tree-sitter-code-tools.js +0 -647
  18. package/dist/src/tools/tree-sitter-code-tools.js.map +0 -1
  19. package/dist/src/utils/apply-cot-enhancement.d.ts +0 -46
  20. package/dist/src/utils/apply-cot-enhancement.d.ts.map +0 -1
  21. package/dist/src/utils/apply-cot-enhancement.js +0 -165
  22. package/dist/src/utils/apply-cot-enhancement.js.map +0 -1
  23. package/dist/src/utils/deployment-type-registry.d.ts +0 -52
  24. package/dist/src/utils/deployment-type-registry.d.ts.map +0 -1
  25. package/dist/src/utils/deployment-type-registry.js +0 -543
  26. package/dist/src/utils/deployment-type-registry.js.map +0 -1
  27. package/dist/src/utils/index.d.ts +0 -9
  28. package/dist/src/utils/index.d.ts.map +0 -1
  29. package/dist/src/utils/index.js +0 -13
  30. package/dist/src/utils/index.js.map +0 -1
  31. package/dist/src/utils/interactive-approval.d.ts +0 -63
  32. package/dist/src/utils/interactive-approval.d.ts.map +0 -1
  33. package/dist/src/utils/interactive-approval.js +0 -445
  34. package/dist/src/utils/interactive-approval.js.map +0 -1
  35. package/dist/src/utils/location-filter.d.ts +0 -104
  36. package/dist/src/utils/location-filter.d.ts.map +0 -1
  37. package/dist/src/utils/location-filter.js +0 -593
  38. package/dist/src/utils/location-filter.js.map +0 -1
  39. package/dist/src/utils/research-documentation.d.ts +0 -58
  40. package/dist/src/utils/research-documentation.d.ts.map +0 -1
  41. package/dist/src/utils/research-documentation.js +0 -438
  42. package/dist/src/utils/research-documentation.js.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mcp-adr-analysis-server",
3
3
  "mcpName": "io.github.tosin2013/mcp-adr-analysis-server",
4
- "version": "2.7.29",
4
+ "version": "2.7.31",
5
5
  "description": "MCP server for analyzing Architectural Decision Records and project architecture",
6
6
  "main": "dist/src/index.js",
7
7
  "type": "module",
@@ -1,82 +0,0 @@
1
- /**
2
- * ADRs Review Resource - Review specific ADR against code implementation
3
- * URI Pattern: adr://adrs/{id}/review
4
- */
5
- import { URLSearchParams } from 'url';
6
- import { ResourceGenerationResult } from './index.js';
7
- export interface AdrReviewData {
8
- adrId: string;
9
- title: string;
10
- status: string;
11
- complianceScore: number;
12
- codeCompliance: {
13
- implemented: boolean;
14
- partiallyImplemented: boolean;
15
- notImplemented: boolean;
16
- evidence: string[];
17
- gaps: string[];
18
- };
19
- recommendations: {
20
- updateAdr: boolean;
21
- updateCode: boolean;
22
- createPlan: boolean;
23
- actions: string[];
24
- };
25
- analysis: string;
26
- timestamp: string;
27
- projectPath: string;
28
- analysisDepth: string;
29
- }
30
- /**
31
- * Generate ADR review resource showing compliance analysis against code.
32
- *
33
- * Returns a comprehensive review of a specific ADR including:
34
- * - Compliance score against actual implementation
35
- * - Evidence of implementation found in code
36
- * - Gaps between ADR decisions and code
37
- * - Recommendations for updates
38
- *
39
- * **URI Pattern:** `adr://adrs/{id}/review`
40
- *
41
- * **Query Parameters:**
42
- * - `projectPath`: Override project root path (default: process.cwd())
43
- * - `analysisDepth`: 'basic' | 'detailed' | 'comprehensive' (default: 'detailed')
44
- * - `includeTreeSitter`: Use tree-sitter for analysis (default: true)
45
- *
46
- * @param params - URL path parameters containing:
47
- * - id: ADR identifier (e.g., "001", "database-architecture")
48
- * @param searchParams - URL query parameters for customization
49
- *
50
- * @returns Promise resolving to resource generation result containing:
51
- * - data: Complete ADR review data with compliance analysis
52
- * - contentType: "application/json"
53
- * - lastModified: ISO timestamp of generation
54
- * - cacheKey: Unique identifier "adr-review:{id}"
55
- * - ttl: Cache duration (180 seconds / 3 minutes)
56
- * - etag: Entity tag for cache validation
57
- *
58
- * @throws {McpAdrError} When review generation fails
59
- *
60
- * @example
61
- * ```typescript
62
- * // Get review for ADR 001
63
- * const review = await generateAdrsReviewResource(
64
- * { id: '001' },
65
- * new URLSearchParams()
66
- * );
67
- *
68
- * console.log(`Compliance score: ${review.data.complianceScore}/10`);
69
- * console.log(`Gaps: ${review.data.codeCompliance.gaps.join(', ')}`);
70
- *
71
- * // Comprehensive review with custom project path
72
- * const detailed = await generateAdrsReviewResource(
73
- * { id: 'database-architecture' },
74
- * new URLSearchParams('analysisDepth=comprehensive&projectPath=/my/project')
75
- * );
76
- * ```
77
- *
78
- * @since v2.2.0
79
- * @see {@link reviewExistingAdrs} for the underlying review logic
80
- */
81
- export declare function generateAdrsReviewResource(params: Record<string, string>, searchParams: URLSearchParams): Promise<ResourceGenerationResult>;
82
- //# sourceMappingURL=adrs-review-resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adrs-review-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/adrs-review-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAGtD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE;QACd,WAAW,EAAE,OAAO,CAAC;QACrB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,cAAc,EAAE,OAAO,CAAC;QACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,IAAI,EAAE,MAAM,EAAE,CAAC;KAChB,CAAC;IACF,eAAe,EAAE;QACf,SAAS,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,OAAO,CAAC;QACpB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,YAAY,EAAE,eAAe,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CA8FnC"}
@@ -1,160 +0,0 @@
1
- /**
2
- * ADRs Review Resource - Review specific ADR against code implementation
3
- * URI Pattern: adr://adrs/{id}/review
4
- */
5
- import { McpAdrError } from '../types/index.js';
6
- import { resourceCache, generateETag } from './resource-cache.js';
7
- import { resourceRouter } from './resource-router.js';
8
- /**
9
- * Generate ADR review resource showing compliance analysis against code.
10
- *
11
- * Returns a comprehensive review of a specific ADR including:
12
- * - Compliance score against actual implementation
13
- * - Evidence of implementation found in code
14
- * - Gaps between ADR decisions and code
15
- * - Recommendations for updates
16
- *
17
- * **URI Pattern:** `adr://adrs/{id}/review`
18
- *
19
- * **Query Parameters:**
20
- * - `projectPath`: Override project root path (default: process.cwd())
21
- * - `analysisDepth`: 'basic' | 'detailed' | 'comprehensive' (default: 'detailed')
22
- * - `includeTreeSitter`: Use tree-sitter for analysis (default: true)
23
- *
24
- * @param params - URL path parameters containing:
25
- * - id: ADR identifier (e.g., "001", "database-architecture")
26
- * @param searchParams - URL query parameters for customization
27
- *
28
- * @returns Promise resolving to resource generation result containing:
29
- * - data: Complete ADR review data with compliance analysis
30
- * - contentType: "application/json"
31
- * - lastModified: ISO timestamp of generation
32
- * - cacheKey: Unique identifier "adr-review:{id}"
33
- * - ttl: Cache duration (180 seconds / 3 minutes)
34
- * - etag: Entity tag for cache validation
35
- *
36
- * @throws {McpAdrError} When review generation fails
37
- *
38
- * @example
39
- * ```typescript
40
- * // Get review for ADR 001
41
- * const review = await generateAdrsReviewResource(
42
- * { id: '001' },
43
- * new URLSearchParams()
44
- * );
45
- *
46
- * console.log(`Compliance score: ${review.data.complianceScore}/10`);
47
- * console.log(`Gaps: ${review.data.codeCompliance.gaps.join(', ')}`);
48
- *
49
- * // Comprehensive review with custom project path
50
- * const detailed = await generateAdrsReviewResource(
51
- * { id: 'database-architecture' },
52
- * new URLSearchParams('analysisDepth=comprehensive&projectPath=/my/project')
53
- * );
54
- * ```
55
- *
56
- * @since v2.2.0
57
- * @see {@link reviewExistingAdrs} for the underlying review logic
58
- */
59
- export async function generateAdrsReviewResource(params, searchParams) {
60
- const id = params['id'];
61
- if (!id) {
62
- throw new McpAdrError('Missing required parameter: id', 'INVALID_PARAMS');
63
- }
64
- const projectPath = searchParams.get('projectPath') || process.cwd();
65
- const analysisDepth = (searchParams.get('analysisDepth') || 'detailed');
66
- const includeTreeSitter = searchParams.get('includeTreeSitter') !== 'false';
67
- const cacheKey = `adr-review:${id}:${analysisDepth}`;
68
- // Check cache
69
- const cached = await resourceCache.get(cacheKey);
70
- if (cached) {
71
- return cached;
72
- }
73
- try {
74
- // Import the review tool dynamically to avoid circular dependencies
75
- const { reviewExistingAdrs } = await import('../tools/review-existing-adrs-tool.js');
76
- // Perform the review for the specific ADR
77
- const reviewResult = await reviewExistingAdrs({
78
- projectPath,
79
- specificAdr: id,
80
- analysisDepth,
81
- includeTreeSitter,
82
- generateUpdatePlan: true,
83
- });
84
- // Parse the review result to extract structured data
85
- const reviewText = reviewResult.content?.[0]?.text || '';
86
- // Extract compliance score from the review
87
- const scoreMatch = reviewText.match(/Compliance Score[:\s]*(\d+(?:\.\d+)?)/i);
88
- const complianceScore = scoreMatch ? parseFloat(scoreMatch[1]) : 5;
89
- // Extract title
90
- const titleMatch = reviewText.match(/###\s*([^\n]+)/);
91
- const title = titleMatch ? titleMatch[1].trim() : `ADR ${id}`;
92
- // Extract status
93
- const statusMatch = reviewText.match(/Status[:\s]*(\w+)/i);
94
- const status = statusMatch ? statusMatch[1] : 'unknown';
95
- // Build structured review data
96
- const reviewData = {
97
- adrId: id,
98
- title,
99
- status,
100
- complianceScore,
101
- codeCompliance: {
102
- implemented: complianceScore >= 8,
103
- partiallyImplemented: complianceScore >= 5 && complianceScore < 8,
104
- notImplemented: complianceScore < 5,
105
- evidence: extractListItems(reviewText, 'Evidence Found'),
106
- gaps: extractListItems(reviewText, 'Gaps Identified'),
107
- },
108
- recommendations: {
109
- updateAdr: complianceScore < 7,
110
- updateCode: complianceScore < 5,
111
- createPlan: complianceScore < 5,
112
- actions: extractListItems(reviewText, 'Recommendations'),
113
- },
114
- analysis: reviewText,
115
- timestamp: new Date().toISOString(),
116
- projectPath,
117
- analysisDepth,
118
- };
119
- const result = {
120
- data: reviewData,
121
- contentType: 'application/json',
122
- lastModified: new Date().toISOString(),
123
- cacheKey,
124
- ttl: 180, // 3 minutes cache (reviews are somewhat expensive)
125
- etag: generateETag(reviewData),
126
- };
127
- // Cache result
128
- resourceCache.set(cacheKey, result, result.ttl);
129
- return result;
130
- }
131
- catch (error) {
132
- throw new McpAdrError(`Failed to generate ADR review: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
133
- }
134
- }
135
- /**
136
- * Extract list items from a section in the review text
137
- */
138
- function extractListItems(text, sectionName) {
139
- const items = [];
140
- // Find the section
141
- const sectionRegex = new RegExp(`(?:#{1,4}\\s*)?${sectionName}[^\\n]*\\n([\\s\\S]*?)(?=#{1,4}|$)`, 'i');
142
- const sectionMatch = text.match(sectionRegex);
143
- if (sectionMatch && sectionMatch[1]) {
144
- const sectionContent = sectionMatch[1];
145
- // Extract list items (lines starting with - or *)
146
- const listMatches = sectionContent.match(/^[\s]*[-*]\s*(.+)$/gm);
147
- if (listMatches) {
148
- listMatches.forEach(match => {
149
- const item = match.replace(/^[\s]*[-*]\s*/, '').trim();
150
- if (item && !item.startsWith('No ')) {
151
- items.push(item);
152
- }
153
- });
154
- }
155
- }
156
- return items;
157
- }
158
- // Register route
159
- resourceRouter.register('/adrs/{id}/review', generateAdrsReviewResource, 'Review specific ADR against code implementation');
160
- //# sourceMappingURL=adrs-review-resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adrs-review-resource.js","sourceRoot":"","sources":["../../../src/resources/adrs-review-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AA0BtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,MAA8B,EAC9B,YAA6B;IAE7B,MAAM,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAExB,IAAI,CAAC,EAAE,EAAE,CAAC;QACR,MAAM,IAAI,WAAW,CAAC,gCAAgC,EAAE,gBAAgB,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,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resource - Current architectural state and decisions
3
- * URI Pattern: adr://architecture/context
4
- */
5
- import { URLSearchParams } from 'url';
6
- import { ResourceGenerationResult } from './index.js';
7
- import type { KnowledgeGraphManager } from '../utils/knowledge-graph-manager.js';
8
- export interface ArchitecturalContextData {
9
- summary: {
10
- totalAdrs: number;
11
- activeDecisions: number;
12
- deprecatedDecisions: number;
13
- proposedDecisions: number;
14
- technologiesUsed: string[];
15
- architecturalPatterns: string[];
16
- };
17
- decisions: Array<{
18
- id: string;
19
- title: string;
20
- status: string;
21
- category: string;
22
- impact: 'high' | 'medium' | 'low';
23
- dependencies: string[];
24
- }>;
25
- technologyStack: {
26
- frontend: string[];
27
- backend: string[];
28
- database: string[];
29
- infrastructure: string[];
30
- devops: string[];
31
- };
32
- patterns: Array<{
33
- name: string;
34
- description: string;
35
- usedIn: string[];
36
- relatedAdrs: string[];
37
- }>;
38
- recommendations: string[];
39
- timestamp: string;
40
- projectPath: string;
41
- }
42
- /**
43
- * Generate architectural context resource showing current state and decisions.
44
- *
45
- * Returns a comprehensive view of the project's architectural state:
46
- * - Summary of all ADRs by status
47
- * - Technology stack analysis
48
- * - Architectural patterns in use
49
- * - Recommendations for improvements
50
- *
51
- * **URI Pattern:** `adr://architecture/context`
52
- *
53
- * **Query Parameters:**
54
- * - `projectPath`: Override project root path (default: process.cwd())
55
- * - `includeDeprecated`: Include deprecated decisions (default: true)
56
- * - `includeProposed`: Include proposed decisions (default: true)
57
- * - `maxDecisions`: Maximum decisions to return (default: 50)
58
- *
59
- * @param params - URL path parameters (none for this resource)
60
- * @param searchParams - URL query parameters for customization
61
- * @param kgManager - Optional knowledge graph manager instance
62
- *
63
- * @returns Promise resolving to resource generation result containing:
64
- * - data: Complete architectural context data
65
- * - contentType: "application/json"
66
- * - lastModified: ISO timestamp of generation
67
- * - cacheKey: Unique identifier "architectural-context"
68
- * - ttl: Cache duration (300 seconds / 5 minutes)
69
- * - etag: Entity tag for cache validation
70
- *
71
- * @throws {McpAdrError} When context generation fails
72
- *
73
- * @example
74
- * ```typescript
75
- * // Get full architectural context
76
- * const context = await generateArchitecturalContextResource(
77
- * {},
78
- * new URLSearchParams()
79
- * );
80
- *
81
- * console.log(`Total ADRs: ${context.data.summary.totalAdrs}`);
82
- * console.log(`Technologies: ${context.data.summary.technologiesUsed.join(', ')}`);
83
- *
84
- * // Exclude deprecated decisions
85
- * const active = await generateArchitecturalContextResource(
86
- * {},
87
- * new URLSearchParams('includeDeprecated=false')
88
- * );
89
- * ```
90
- *
91
- * @since v2.2.0
92
- * @see {@link KnowledgeGraphManager} for knowledge graph queries
93
- */
94
- export declare function generateArchitecturalContextResource(_params: Record<string, string>, searchParams: URLSearchParams, kgManager?: KnowledgeGraphManager): Promise<ResourceGenerationResult>;
95
- //# sourceMappingURL=architectural-context-resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"architectural-context-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/architectural-context-resource.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAGtC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAEjF,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,iBAAiB,EAAE,MAAM,CAAC;QAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,qBAAqB,EAAE,MAAM,EAAE,CAAC;KACjC,CAAC;IACF,SAAS,EAAE,KAAK,CAAC;QACf,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,K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