mcp-adr-analysis-server 2.7.30 → 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.
- package/dist/.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/resources/adrs-review-resource.d.ts +0 -82
- package/dist/src/resources/adrs-review-resource.d.ts.map +0 -1
- package/dist/src/resources/adrs-review-resource.js +0 -160
- package/dist/src/resources/adrs-review-resource.js.map +0 -1
- package/dist/src/resources/architectural-context-resource.d.ts +0 -95
- package/dist/src/resources/architectural-context-resource.d.ts.map +0 -1
- package/dist/src/resources/architectural-context-resource.js +0 -428
- package/dist/src/resources/architectural-context-resource.js.map +0 -1
- package/dist/src/resources/memory-expand-resource.d.ts +0 -90
- package/dist/src/resources/memory-expand-resource.d.ts.map +0 -1
- package/dist/src/resources/memory-expand-resource.js +0 -176
- package/dist/src/resources/memory-expand-resource.js.map +0 -1
- package/dist/src/utils/index.d.ts +0 -9
- package/dist/src/utils/index.d.ts.map +0 -1
- package/dist/src/utils/index.js +0 -13
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/interactive-approval.d.ts +0 -63
- package/dist/src/utils/interactive-approval.d.ts.map +0 -1
- package/dist/src/utils/interactive-approval.js +0 -445
- package/dist/src/utils/interactive-approval.js.map +0 -1
- package/dist/src/utils/location-filter.d.ts +0 -104
- package/dist/src/utils/location-filter.d.ts.map +0 -1
- package/dist/src/utils/location-filter.js +0 -593
- package/dist/src/utils/location-filter.js.map +0 -1
|
@@ -1,428 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Architectural Context Resource - Current architectural state and decisions
|
|
3
|
-
* URI Pattern: adr://architecture/context
|
|
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 architectural context resource showing current state and decisions.
|
|
10
|
-
*
|
|
11
|
-
* Returns a comprehensive view of the project's architectural state:
|
|
12
|
-
* - Summary of all ADRs by status
|
|
13
|
-
* - Technology stack analysis
|
|
14
|
-
* - Architectural patterns in use
|
|
15
|
-
* - Recommendations for improvements
|
|
16
|
-
*
|
|
17
|
-
* **URI Pattern:** `adr://architecture/context`
|
|
18
|
-
*
|
|
19
|
-
* **Query Parameters:**
|
|
20
|
-
* - `projectPath`: Override project root path (default: process.cwd())
|
|
21
|
-
* - `includeDeprecated`: Include deprecated decisions (default: true)
|
|
22
|
-
* - `includeProposed`: Include proposed decisions (default: true)
|
|
23
|
-
* - `maxDecisions`: Maximum decisions to return (default: 50)
|
|
24
|
-
*
|
|
25
|
-
* @param params - URL path parameters (none for this resource)
|
|
26
|
-
* @param searchParams - URL query parameters for customization
|
|
27
|
-
* @param kgManager - Optional knowledge graph manager instance
|
|
28
|
-
*
|
|
29
|
-
* @returns Promise resolving to resource generation result containing:
|
|
30
|
-
* - data: Complete architectural context data
|
|
31
|
-
* - contentType: "application/json"
|
|
32
|
-
* - lastModified: ISO timestamp of generation
|
|
33
|
-
* - cacheKey: Unique identifier "architectural-context"
|
|
34
|
-
* - ttl: Cache duration (300 seconds / 5 minutes)
|
|
35
|
-
* - etag: Entity tag for cache validation
|
|
36
|
-
*
|
|
37
|
-
* @throws {McpAdrError} When context generation fails
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* // Get full architectural context
|
|
42
|
-
* const context = await generateArchitecturalContextResource(
|
|
43
|
-
* {},
|
|
44
|
-
* new URLSearchParams()
|
|
45
|
-
* );
|
|
46
|
-
*
|
|
47
|
-
* console.log(`Total ADRs: ${context.data.summary.totalAdrs}`);
|
|
48
|
-
* console.log(`Technologies: ${context.data.summary.technologiesUsed.join(', ')}`);
|
|
49
|
-
*
|
|
50
|
-
* // Exclude deprecated decisions
|
|
51
|
-
* const active = await generateArchitecturalContextResource(
|
|
52
|
-
* {},
|
|
53
|
-
* new URLSearchParams('includeDeprecated=false')
|
|
54
|
-
* );
|
|
55
|
-
* ```
|
|
56
|
-
*
|
|
57
|
-
* @since v2.2.0
|
|
58
|
-
* @see {@link KnowledgeGraphManager} for knowledge graph queries
|
|
59
|
-
*/
|
|
60
|
-
export async function generateArchitecturalContextResource(_params, searchParams, kgManager) {
|
|
61
|
-
const projectPath = searchParams.get('projectPath') || process.cwd();
|
|
62
|
-
const includeDeprecated = searchParams.get('includeDeprecated') !== 'false';
|
|
63
|
-
const includeProposed = searchParams.get('includeProposed') !== 'false';
|
|
64
|
-
const maxDecisions = parseInt(searchParams.get('maxDecisions') || '50', 10);
|
|
65
|
-
const cacheKey = 'architectural-context';
|
|
66
|
-
// Check cache
|
|
67
|
-
const cached = await resourceCache.get(cacheKey);
|
|
68
|
-
if (cached) {
|
|
69
|
-
return cached;
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
// Discover ADRs to build context
|
|
73
|
-
const { discoverAdrsInDirectory } = await import('../utils/adr-discovery.js');
|
|
74
|
-
const pathModule = await import('path');
|
|
75
|
-
const adrDirectory = pathModule.resolve(projectPath, process.env['ADR_DIRECTORY'] || 'docs/adrs');
|
|
76
|
-
const discoveryResult = await discoverAdrsInDirectory(adrDirectory, projectPath, {
|
|
77
|
-
includeContent: true,
|
|
78
|
-
includeTimeline: false,
|
|
79
|
-
});
|
|
80
|
-
// Categorize ADRs by status
|
|
81
|
-
const statusCounts = {
|
|
82
|
-
accepted: 0,
|
|
83
|
-
deprecated: 0,
|
|
84
|
-
proposed: 0,
|
|
85
|
-
superseded: 0,
|
|
86
|
-
unknown: 0,
|
|
87
|
-
};
|
|
88
|
-
const technologies = new Set();
|
|
89
|
-
const patterns = new Set();
|
|
90
|
-
const decisions = [];
|
|
91
|
-
for (const adr of discoveryResult.adrs) {
|
|
92
|
-
const status = (adr.status || 'unknown').toLowerCase();
|
|
93
|
-
if (status in statusCounts) {
|
|
94
|
-
statusCounts[status]++;
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
statusCounts.unknown++;
|
|
98
|
-
}
|
|
99
|
-
// Skip deprecated if not requested
|
|
100
|
-
if (!includeDeprecated && status === 'deprecated')
|
|
101
|
-
continue;
|
|
102
|
-
if (!includeProposed && status === 'proposed')
|
|
103
|
-
continue;
|
|
104
|
-
// Extract technologies from content
|
|
105
|
-
const content = `${adr.context || ''} ${adr.decision || ''} ${adr.consequences || ''}`;
|
|
106
|
-
extractTechnologies(content, technologies);
|
|
107
|
-
extractPatterns(content, patterns);
|
|
108
|
-
// Add to decisions list
|
|
109
|
-
if (decisions.length < maxDecisions) {
|
|
110
|
-
decisions.push({
|
|
111
|
-
id: adr.filename.replace(/\.md$/, ''),
|
|
112
|
-
title: adr.title || 'Untitled',
|
|
113
|
-
status: adr.status || 'unknown',
|
|
114
|
-
category: categorizeAdr(adr.title || '', content),
|
|
115
|
-
impact: determineImpact(content),
|
|
116
|
-
dependencies: extractDependencies(content),
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
// Build technology stack
|
|
121
|
-
const technologyStack = categorizeTechnologies([...technologies]);
|
|
122
|
-
// Build patterns list
|
|
123
|
-
const patternsList = [...patterns].map(pattern => ({
|
|
124
|
-
name: pattern,
|
|
125
|
-
description: getPatternDescription(pattern),
|
|
126
|
-
usedIn: findPatternUsage(pattern, discoveryResult.adrs),
|
|
127
|
-
relatedAdrs: findRelatedAdrs(pattern, discoveryResult.adrs),
|
|
128
|
-
}));
|
|
129
|
-
// Generate recommendations
|
|
130
|
-
const recommendations = generateRecommendations(discoveryResult.adrs, statusCounts, [
|
|
131
|
-
...technologies,
|
|
132
|
-
]);
|
|
133
|
-
// Get additional context from knowledge graph if available
|
|
134
|
-
if (kgManager) {
|
|
135
|
-
try {
|
|
136
|
-
const kg = await kgManager.loadKnowledgeGraph();
|
|
137
|
-
if (kg && kg.intents) {
|
|
138
|
-
// Extract technologies and patterns from intent goals
|
|
139
|
-
kg.intents.forEach((intent) => {
|
|
140
|
-
if (intent.parsedGoals) {
|
|
141
|
-
intent.parsedGoals.forEach((goal) => {
|
|
142
|
-
// Simple heuristic to extract tech/pattern mentions
|
|
143
|
-
const lowerGoal = goal.toLowerCase();
|
|
144
|
-
if (lowerGoal.includes('technology') || lowerGoal.includes('framework')) {
|
|
145
|
-
// Could extract specific technologies here
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
catch {
|
|
153
|
-
// Knowledge graph not available
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
const contextData = {
|
|
157
|
-
summary: {
|
|
158
|
-
totalAdrs: discoveryResult.totalAdrs,
|
|
159
|
-
activeDecisions: statusCounts.accepted,
|
|
160
|
-
deprecatedDecisions: statusCounts.deprecated,
|
|
161
|
-
proposedDecisions: statusCounts.proposed,
|
|
162
|
-
technologiesUsed: [...technologies].sort(),
|
|
163
|
-
architecturalPatterns: [...patterns].sort(),
|
|
164
|
-
},
|
|
165
|
-
decisions,
|
|
166
|
-
technologyStack,
|
|
167
|
-
patterns: patternsList,
|
|
168
|
-
recommendations,
|
|
169
|
-
timestamp: new Date().toISOString(),
|
|
170
|
-
projectPath,
|
|
171
|
-
};
|
|
172
|
-
const result = {
|
|
173
|
-
data: contextData,
|
|
174
|
-
contentType: 'application/json',
|
|
175
|
-
lastModified: new Date().toISOString(),
|
|
176
|
-
cacheKey,
|
|
177
|
-
ttl: 300, // 5 minutes cache
|
|
178
|
-
etag: generateETag(contextData),
|
|
179
|
-
};
|
|
180
|
-
// Cache result
|
|
181
|
-
resourceCache.set(cacheKey, result, result.ttl);
|
|
182
|
-
return result;
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
throw new McpAdrError(`Failed to generate architectural context: ${error instanceof Error ? error.message : String(error)}`, 'RESOURCE_GENERATION_ERROR');
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Extract technologies from content
|
|
190
|
-
*/
|
|
191
|
-
function extractTechnologies(content, technologies) {
|
|
192
|
-
const techPatterns = [
|
|
193
|
-
/\b(React|Vue|Angular|Svelte|Next\.js|Nuxt|Gatsby)\b/gi,
|
|
194
|
-
/\b(Node\.js|Express|Fastify|NestJS|Koa)\b/gi,
|
|
195
|
-
/\b(Python|Django|Flask|FastAPI)\b/gi,
|
|
196
|
-
/\b(PostgreSQL|MySQL|MongoDB|Redis|Elasticsearch)\b/gi,
|
|
197
|
-
/\b(Docker|Kubernetes|AWS|Azure|GCP)\b/gi,
|
|
198
|
-
/\b(Terraform|Ansible|Jenkins|GitHub Actions)\b/gi,
|
|
199
|
-
/\b(GraphQL|REST|gRPC|WebSocket)\b/gi,
|
|
200
|
-
/\b(TypeScript|JavaScript|Java|Go|Rust)\b/gi,
|
|
201
|
-
];
|
|
202
|
-
techPatterns.forEach(pattern => {
|
|
203
|
-
const matches = content.match(pattern);
|
|
204
|
-
if (matches) {
|
|
205
|
-
matches.forEach(match => technologies.add(match));
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Extract architectural patterns from content
|
|
211
|
-
*/
|
|
212
|
-
function extractPatterns(content, patterns) {
|
|
213
|
-
const patternKeywords = [
|
|
214
|
-
'microservices',
|
|
215
|
-
'monolith',
|
|
216
|
-
'event-driven',
|
|
217
|
-
'cqrs',
|
|
218
|
-
'event sourcing',
|
|
219
|
-
'hexagonal',
|
|
220
|
-
'clean architecture',
|
|
221
|
-
'mvc',
|
|
222
|
-
'mvvm',
|
|
223
|
-
'repository pattern',
|
|
224
|
-
'service layer',
|
|
225
|
-
'domain-driven',
|
|
226
|
-
'api gateway',
|
|
227
|
-
'saga pattern',
|
|
228
|
-
'circuit breaker',
|
|
229
|
-
];
|
|
230
|
-
const lowerContent = content.toLowerCase();
|
|
231
|
-
patternKeywords.forEach(pattern => {
|
|
232
|
-
if (lowerContent.includes(pattern)) {
|
|
233
|
-
patterns.add(pattern
|
|
234
|
-
.split(' ')
|
|
235
|
-
.map(w => w.charAt(0).toUpperCase() + w.slice(1))
|
|
236
|
-
.join(' '));
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Categorize an ADR based on its title and content
|
|
242
|
-
*/
|
|
243
|
-
function categorizeAdr(title, content) {
|
|
244
|
-
const lowerTitle = title.toLowerCase();
|
|
245
|
-
const lowerContent = content.toLowerCase();
|
|
246
|
-
if (lowerTitle.includes('database') || lowerContent.includes('database'))
|
|
247
|
-
return 'data';
|
|
248
|
-
if (lowerTitle.includes('api') || lowerContent.includes('api endpoint'))
|
|
249
|
-
return 'api';
|
|
250
|
-
if (lowerTitle.includes('auth') || lowerContent.includes('authentication'))
|
|
251
|
-
return 'security';
|
|
252
|
-
if (lowerTitle.includes('deploy') || lowerContent.includes('deployment'))
|
|
253
|
-
return 'infrastructure';
|
|
254
|
-
if (lowerTitle.includes('test') || lowerContent.includes('testing'))
|
|
255
|
-
return 'testing';
|
|
256
|
-
if (lowerTitle.includes('ui') || lowerTitle.includes('frontend'))
|
|
257
|
-
return 'frontend';
|
|
258
|
-
if (lowerTitle.includes('backend') || lowerTitle.includes('service'))
|
|
259
|
-
return 'backend';
|
|
260
|
-
return 'general';
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Determine impact level of an ADR
|
|
264
|
-
*/
|
|
265
|
-
function determineImpact(content) {
|
|
266
|
-
const lowerContent = content.toLowerCase();
|
|
267
|
-
// High impact indicators
|
|
268
|
-
if (lowerContent.includes('critical') ||
|
|
269
|
-
lowerContent.includes('breaking change') ||
|
|
270
|
-
lowerContent.includes('major refactor') ||
|
|
271
|
-
lowerContent.includes('security vulnerability')) {
|
|
272
|
-
return 'high';
|
|
273
|
-
}
|
|
274
|
-
// Low impact indicators
|
|
275
|
-
if (lowerContent.includes('minor') ||
|
|
276
|
-
lowerContent.includes('small change') ||
|
|
277
|
-
lowerContent.includes('optimization')) {
|
|
278
|
-
return 'low';
|
|
279
|
-
}
|
|
280
|
-
return 'medium';
|
|
281
|
-
}
|
|
282
|
-
/**
|
|
283
|
-
* Extract dependencies from content
|
|
284
|
-
*/
|
|
285
|
-
function extractDependencies(content) {
|
|
286
|
-
const deps = [];
|
|
287
|
-
const depMatch = content.match(/ADR[-\s]?(\d+)/gi);
|
|
288
|
-
if (depMatch) {
|
|
289
|
-
depMatch.forEach(match => {
|
|
290
|
-
const id = match.replace(/ADR[-\s]?/i, '');
|
|
291
|
-
deps.push(`adr-${id.padStart(3, '0')}`);
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
return [...new Set(deps)];
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Categorize technologies into stack layers
|
|
298
|
-
*/
|
|
299
|
-
function categorizeTechnologies(techs) {
|
|
300
|
-
const stack = {
|
|
301
|
-
frontend: [],
|
|
302
|
-
backend: [],
|
|
303
|
-
database: [],
|
|
304
|
-
infrastructure: [],
|
|
305
|
-
devops: [],
|
|
306
|
-
};
|
|
307
|
-
const categories = {
|
|
308
|
-
React: 'frontend',
|
|
309
|
-
Vue: 'frontend',
|
|
310
|
-
Angular: 'frontend',
|
|
311
|
-
Svelte: 'frontend',
|
|
312
|
-
'Next.js': 'frontend',
|
|
313
|
-
Nuxt: 'frontend',
|
|
314
|
-
TypeScript: 'frontend',
|
|
315
|
-
JavaScript: 'frontend',
|
|
316
|
-
'Node.js': 'backend',
|
|
317
|
-
Express: 'backend',
|
|
318
|
-
Fastify: 'backend',
|
|
319
|
-
NestJS: 'backend',
|
|
320
|
-
Python: 'backend',
|
|
321
|
-
Django: 'backend',
|
|
322
|
-
Flask: 'backend',
|
|
323
|
-
FastAPI: 'backend',
|
|
324
|
-
Java: 'backend',
|
|
325
|
-
Go: 'backend',
|
|
326
|
-
Rust: 'backend',
|
|
327
|
-
PostgreSQL: 'database',
|
|
328
|
-
MySQL: 'database',
|
|
329
|
-
MongoDB: 'database',
|
|
330
|
-
Redis: 'database',
|
|
331
|
-
Elasticsearch: 'database',
|
|
332
|
-
Docker: 'infrastructure',
|
|
333
|
-
Kubernetes: 'infrastructure',
|
|
334
|
-
AWS: 'infrastructure',
|
|
335
|
-
Azure: 'infrastructure',
|
|
336
|
-
GCP: 'infrastructure',
|
|
337
|
-
Terraform: 'devops',
|
|
338
|
-
Ansible: 'devops',
|
|
339
|
-
Jenkins: 'devops',
|
|
340
|
-
'GitHub Actions': 'devops',
|
|
341
|
-
};
|
|
342
|
-
techs.forEach(tech => {
|
|
343
|
-
const category = categories[tech];
|
|
344
|
-
if (category && !stack[category].includes(tech)) {
|
|
345
|
-
stack[category].push(tech);
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
return stack;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Get description for a pattern
|
|
352
|
-
*/
|
|
353
|
-
function getPatternDescription(pattern) {
|
|
354
|
-
const descriptions = {
|
|
355
|
-
Microservices: 'Distributed architecture with independently deployable services',
|
|
356
|
-
Monolith: 'Single deployable unit containing all functionality',
|
|
357
|
-
'Event-driven': 'Asynchronous communication through events',
|
|
358
|
-
CQRS: 'Command Query Responsibility Segregation',
|
|
359
|
-
'Event Sourcing': 'Storing state as sequence of events',
|
|
360
|
-
Hexagonal: 'Ports and adapters architecture',
|
|
361
|
-
'Clean Architecture': 'Dependency rule with concentric layers',
|
|
362
|
-
MVC: 'Model-View-Controller pattern',
|
|
363
|
-
MVVM: 'Model-View-ViewModel pattern',
|
|
364
|
-
'Repository Pattern': 'Abstraction layer for data access',
|
|
365
|
-
'Service Layer': 'Business logic encapsulation',
|
|
366
|
-
'Domain-driven': 'Design based on domain model',
|
|
367
|
-
'Api Gateway': 'Single entry point for microservices',
|
|
368
|
-
'Saga Pattern': 'Distributed transaction management',
|
|
369
|
-
'Circuit Breaker': 'Fault tolerance pattern',
|
|
370
|
-
};
|
|
371
|
-
return descriptions[pattern] || 'Architectural pattern';
|
|
372
|
-
}
|
|
373
|
-
/**
|
|
374
|
-
* Find ADRs that use a pattern
|
|
375
|
-
*/
|
|
376
|
-
function findPatternUsage(pattern, adrs) {
|
|
377
|
-
const lowerPattern = pattern.toLowerCase();
|
|
378
|
-
return adrs
|
|
379
|
-
.filter(adr => {
|
|
380
|
-
const content = `${adr.title || ''} ${adr.context || ''} ${adr.decision || ''}`.toLowerCase();
|
|
381
|
-
return content.includes(lowerPattern);
|
|
382
|
-
})
|
|
383
|
-
.map(adr => adr.filename.replace(/\.md$/, ''))
|
|
384
|
-
.slice(0, 5);
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* Find ADRs related to a pattern
|
|
388
|
-
*/
|
|
389
|
-
function findRelatedAdrs(pattern, adrs) {
|
|
390
|
-
return findPatternUsage(pattern, adrs);
|
|
391
|
-
}
|
|
392
|
-
/**
|
|
393
|
-
* Generate recommendations based on analysis
|
|
394
|
-
*/
|
|
395
|
-
function generateRecommendations(adrs, statusCounts, technologies) {
|
|
396
|
-
const recommendations = [];
|
|
397
|
-
// Check for proposed ADRs that need review
|
|
398
|
-
const proposedCount = statusCounts['proposed'] || 0;
|
|
399
|
-
if (proposedCount > 3) {
|
|
400
|
-
recommendations.push(`Review ${proposedCount} proposed ADRs for acceptance`);
|
|
401
|
-
}
|
|
402
|
-
// Check for missing documentation areas
|
|
403
|
-
const hasSecurityAdr = adrs.some(adr => (adr.title || '').toLowerCase().includes('security') ||
|
|
404
|
-
(adr.title || '').toLowerCase().includes('auth'));
|
|
405
|
-
if (!hasSecurityAdr) {
|
|
406
|
-
recommendations.push('Consider documenting security decisions in an ADR');
|
|
407
|
-
}
|
|
408
|
-
// Check for deprecated decisions
|
|
409
|
-
const deprecatedCount = statusCounts['deprecated'] || 0;
|
|
410
|
-
if (deprecatedCount > 0) {
|
|
411
|
-
recommendations.push(`Review ${deprecatedCount} deprecated ADRs for removal or updates`);
|
|
412
|
-
}
|
|
413
|
-
// Technology recommendations
|
|
414
|
-
if (technologies.length < 5) {
|
|
415
|
-
recommendations.push('Consider documenting technology choices in ADRs');
|
|
416
|
-
}
|
|
417
|
-
// General recommendation
|
|
418
|
-
if (adrs.length < 3) {
|
|
419
|
-
recommendations.push('Consider creating ADRs for key architectural decisions');
|
|
420
|
-
}
|
|
421
|
-
if (recommendations.length === 0) {
|
|
422
|
-
recommendations.push('Architectural documentation appears up-to-date');
|
|
423
|
-
}
|
|
424
|
-
return recommendations;
|
|
425
|
-
}
|
|
426
|
-
// Register route
|
|
427
|
-
resourceRouter.register('/architecture/context', generateArchitecturalContextResource, 'Current architectural state and decisions');
|
|
428
|
-
//# sourceMappingURL=architectural-context-resource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"architectural-context-resource.js","sourceRoot":"","sources":["../../../src/resources/architectural-context-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;AAsCtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,MAAM,CAAC,KAAK,UAAU,oCAAoC,CACxD,OAA+B,EAC/B,YAA6B,EAC7B,SAAiC;IAEjC,MAAM,WAAW,GAAG,YAAY,CAAC,GAAG,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACrE,MAAM,iBAAiB,GAAG,YAAY,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,OAAO,CAAC;IAC5E,MAAM,eAAe,GAAG,YAAY,CAAC,GAAG,CAAC,iBAAiB,CAAC,KAAK,OAAO,CAAC;IACxE,MAAM,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,EA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,CAAC;IACF,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,eAAe,CAAC,IAAI,CAAC,mDAAmD,CAAC,CAAC;IAC5E,CAAC;IAED,iCAAiC;IACjC,MAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACxD,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;QACxB,eAAe,CAAC,IAAI,CAAC,UAAU,eAAe,yCAAyC,CAAC,CAAC;IAC3F,CAAC;IAED,6BAA6B;IAC7B,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5B,eAAe,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAC1E,CAAC;IAED,yBAAyB;IACzB,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpB,eAAe,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,eAAe,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IACzE,CAAC;IAED,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,iBAAiB;AACjB,cAAc,CAAC,QAAQ,CACrB,uBAAuB,EACvB,oCAAoC,EACpC,2CAA2C,CAC5C,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Expand Resource - Detailed view of a specific memory entity
|
|
3
|
-
* URI Pattern: adr://memory/{key}
|
|
4
|
-
*/
|
|
5
|
-
import { URLSearchParams } from 'url';
|
|
6
|
-
import { ResourceGenerationResult } from './index.js';
|
|
7
|
-
import type { MemoryEntityManager } from '../utils/memory-entity-manager.js';
|
|
8
|
-
export interface MemoryExpandData {
|
|
9
|
-
key: string;
|
|
10
|
-
entity: {
|
|
11
|
-
id: string;
|
|
12
|
-
type: string;
|
|
13
|
-
name: string;
|
|
14
|
-
content: any;
|
|
15
|
-
metadata: Record<string, any>;
|
|
16
|
-
tags: string[];
|
|
17
|
-
confidence: number;
|
|
18
|
-
lastModified: string;
|
|
19
|
-
created: string;
|
|
20
|
-
accessCount: number;
|
|
21
|
-
} | null;
|
|
22
|
-
relationships: Array<{
|
|
23
|
-
targetId: string;
|
|
24
|
-
targetName: string;
|
|
25
|
-
relationshipType: string;
|
|
26
|
-
strength: number;
|
|
27
|
-
}>;
|
|
28
|
-
relatedEntities: Array<{
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
type: string;
|
|
32
|
-
relevance: number;
|
|
33
|
-
}>;
|
|
34
|
-
timestamp: string;
|
|
35
|
-
found: boolean;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Generate memory expand resource showing detailed entity information.
|
|
39
|
-
*
|
|
40
|
-
* Returns complete details about a specific memory entity including:
|
|
41
|
-
* - Full entity content and metadata
|
|
42
|
-
* - All relationships to other entities
|
|
43
|
-
* - Related entities by relevance
|
|
44
|
-
* - Access statistics
|
|
45
|
-
*
|
|
46
|
-
* **URI Pattern:** `adr://memory/{key}`
|
|
47
|
-
*
|
|
48
|
-
* **Query Parameters:**
|
|
49
|
-
* - `includeRelated`: Include related entities (default: true)
|
|
50
|
-
* - `relationshipDepth`: Depth of relationships to traverse (default: 2)
|
|
51
|
-
* - `maxRelated`: Maximum related entities to return (default: 10)
|
|
52
|
-
*
|
|
53
|
-
* @param params - URL path parameters containing:
|
|
54
|
-
* - key: Memory entity key/ID
|
|
55
|
-
* @param searchParams - URL query parameters for customization
|
|
56
|
-
* @param memoryManager - Optional memory entity manager instance
|
|
57
|
-
*
|
|
58
|
-
* @returns Promise resolving to resource generation result containing:
|
|
59
|
-
* - data: Complete memory entity data with relationships
|
|
60
|
-
* - contentType: "application/json"
|
|
61
|
-
* - lastModified: ISO timestamp of generation
|
|
62
|
-
* - cacheKey: Unique identifier "memory-expand:{key}"
|
|
63
|
-
* - ttl: Cache duration (60 seconds / 1 minute)
|
|
64
|
-
* - etag: Entity tag for cache validation
|
|
65
|
-
*
|
|
66
|
-
* @throws {McpAdrError} When memory expansion fails
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```typescript
|
|
70
|
-
* // Get expanded memory entity
|
|
71
|
-
* const memory = await generateMemoryExpandResource(
|
|
72
|
-
* { key: 'adr-001' },
|
|
73
|
-
* new URLSearchParams()
|
|
74
|
-
* );
|
|
75
|
-
*
|
|
76
|
-
* console.log(`Entity type: ${memory.data.entity?.type}`);
|
|
77
|
-
* console.log(`Relationships: ${memory.data.relationships.length}`);
|
|
78
|
-
*
|
|
79
|
-
* // With custom depth
|
|
80
|
-
* const deep = await generateMemoryExpandResource(
|
|
81
|
-
* { key: 'architecture-context' },
|
|
82
|
-
* new URLSearchParams('relationshipDepth=3&maxRelated=20')
|
|
83
|
-
* );
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* @since v2.2.0
|
|
87
|
-
* @see {@link MemoryEntityManager} for memory management
|
|
88
|
-
*/
|
|
89
|
-
export declare function generateMemoryExpandResource(params: Record<string, string>, searchParams: URLSearchParams, memoryManager?: MemoryEntityManager): Promise<ResourceGenerationResult>;
|
|
90
|
-
//# sourceMappingURL=memory-expand-resource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"memory-expand-resource.d.ts","sourceRoot":"","sources":["../../../src/resources/memory-expand-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,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,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