mcp-adr-analysis-server 2.1.22 → 2.1.28
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 +63 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +370 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/tools/adr-aggregator-tools.d.ts +185 -0
- package/dist/src/tools/adr-aggregator-tools.d.ts.map +1 -0
- package/dist/src/tools/adr-aggregator-tools.js +872 -0
- package/dist/src/tools/adr-aggregator-tools.js.map +1 -0
- package/dist/src/tools/analyze-gaps-tool.d.ts +57 -0
- package/dist/src/tools/analyze-gaps-tool.d.ts.map +1 -0
- package/dist/src/tools/analyze-gaps-tool.js +727 -0
- package/dist/src/tools/analyze-gaps-tool.js.map +1 -0
- package/dist/src/tools/tool-catalog.d.ts +1 -1
- package/dist/src/tools/tool-catalog.d.ts.map +1 -1
- package/dist/src/tools/tool-catalog.js +382 -0
- package/dist/src/tools/tool-catalog.js.map +1 -1
- package/dist/src/tools/tool-dispatcher.d.ts.map +1 -1
- package/dist/src/tools/tool-dispatcher.js +4 -0
- package/dist/src/tools/tool-dispatcher.js.map +1 -1
- package/dist/src/types/adr-aggregator.d.ts +692 -0
- package/dist/src/types/adr-aggregator.d.ts.map +1 -0
- package/dist/src/types/adr-aggregator.js +8 -0
- package/dist/src/types/adr-aggregator.js.map +1 -0
- package/dist/src/types/index.d.ts +3 -2
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/memory-entities.d.ts +48 -48
- package/dist/src/utils/adr-aggregator-client.d.ts +177 -0
- package/dist/src/utils/adr-aggregator-client.d.ts.map +1 -0
- package/dist/src/utils/adr-aggregator-client.js +396 -0
- package/dist/src/utils/adr-aggregator-client.js.map +1 -0
- package/dist/src/utils/config.d.ts +3 -0
- package/dist/src/utils/config.d.ts.map +1 -1
- package/dist/src/utils/config.js +13 -0
- package/dist/src/utils/config.js.map +1 -1
- package/dist/src/utils/git-remote-detector.d.ts +67 -0
- package/dist/src/utils/git-remote-detector.d.ts.map +1 -0
- package/dist/src/utils/git-remote-detector.js +194 -0
- package/dist/src/utils/git-remote-detector.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,692 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADR Aggregator API Types
|
|
3
|
+
* Type definitions for bidirectional sync with https://adraggregator.com
|
|
4
|
+
*
|
|
5
|
+
* @see NEW_FEATURE.md for API documentation
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* ADR Aggregator subscription tier
|
|
9
|
+
*/
|
|
10
|
+
export type AggregatorTier = 'free' | 'pro' | 'team';
|
|
11
|
+
/**
|
|
12
|
+
* API error response from ADR Aggregator
|
|
13
|
+
*/
|
|
14
|
+
export interface AggregatorError {
|
|
15
|
+
code: string;
|
|
16
|
+
message: string;
|
|
17
|
+
tier_required?: AggregatorTier;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Repository identification for API requests
|
|
21
|
+
*/
|
|
22
|
+
export interface RepositoryIdentifier {
|
|
23
|
+
/** Repository name in format "owner/repo" - auto-detected from git remote */
|
|
24
|
+
repository_name: string;
|
|
25
|
+
/** Optional branch name */
|
|
26
|
+
branch?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Request payload for syncing ADRs to the aggregator
|
|
30
|
+
*/
|
|
31
|
+
export interface SyncAdrRequest extends RepositoryIdentifier {
|
|
32
|
+
/** Array of ADRs to sync */
|
|
33
|
+
adrs: SyncAdrPayload[];
|
|
34
|
+
/** If true, replace all ADRs instead of incremental sync */
|
|
35
|
+
full_sync?: boolean;
|
|
36
|
+
/** Include analysis metadata in sync */
|
|
37
|
+
include_metadata?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Individual ADR payload for sync
|
|
41
|
+
*/
|
|
42
|
+
export interface SyncAdrPayload {
|
|
43
|
+
/** File path relative to project root */
|
|
44
|
+
path: string;
|
|
45
|
+
/** ADR title */
|
|
46
|
+
title: string;
|
|
47
|
+
/** ADR status */
|
|
48
|
+
status: 'proposed' | 'accepted' | 'deprecated' | 'superseded';
|
|
49
|
+
/** Full markdown content */
|
|
50
|
+
content: string;
|
|
51
|
+
/** Optional analysis metadata */
|
|
52
|
+
analysis_metadata?: AnalysisMetadata;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Analysis metadata attached to synced ADRs
|
|
56
|
+
*/
|
|
57
|
+
export interface AnalysisMetadata {
|
|
58
|
+
/** Timeline and staleness information */
|
|
59
|
+
timeline?: TimelineMetadata;
|
|
60
|
+
/** Security scan results */
|
|
61
|
+
security_scan?: SecurityScanMetadata;
|
|
62
|
+
/** Code linking information */
|
|
63
|
+
code_linking?: CodeLinkingMetadata;
|
|
64
|
+
/** Generated Mermaid diagrams */
|
|
65
|
+
mermaid_diagrams?: MermaidDiagramsMetadata;
|
|
66
|
+
/** Deployment pattern detection */
|
|
67
|
+
deployment_pattern?: DeploymentPatternMetadata;
|
|
68
|
+
/** Research context */
|
|
69
|
+
research?: ResearchMetadata;
|
|
70
|
+
/** Detected architectural patterns */
|
|
71
|
+
patterns_detected?: string[];
|
|
72
|
+
/** Confidence score of analysis (0-1) */
|
|
73
|
+
confidence_score?: number;
|
|
74
|
+
/** Related source files */
|
|
75
|
+
related_files?: string[];
|
|
76
|
+
/** Timestamp of last analysis */
|
|
77
|
+
last_analyzed?: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Timeline and staleness metadata
|
|
81
|
+
*/
|
|
82
|
+
export interface TimelineMetadata {
|
|
83
|
+
created: {
|
|
84
|
+
date: string;
|
|
85
|
+
source: string;
|
|
86
|
+
author?: string;
|
|
87
|
+
};
|
|
88
|
+
last_modified: {
|
|
89
|
+
date: string;
|
|
90
|
+
source: string;
|
|
91
|
+
author?: string;
|
|
92
|
+
};
|
|
93
|
+
staleness: 'fresh' | 'recent' | 'stale' | 'very_stale';
|
|
94
|
+
staleness_score: number;
|
|
95
|
+
days_since_modified: number;
|
|
96
|
+
review_recommended: boolean;
|
|
97
|
+
related_code_changes?: number;
|
|
98
|
+
action_items?: ActionItem[];
|
|
99
|
+
evolution?: EvolutionEvent[];
|
|
100
|
+
}
|
|
101
|
+
export interface ActionItem {
|
|
102
|
+
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
103
|
+
action: string;
|
|
104
|
+
reason: string;
|
|
105
|
+
}
|
|
106
|
+
export interface EvolutionEvent {
|
|
107
|
+
date: string;
|
|
108
|
+
event: 'created' | 'status_change' | 'modified';
|
|
109
|
+
status?: string;
|
|
110
|
+
change_summary?: string;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Security scan metadata
|
|
114
|
+
*/
|
|
115
|
+
export interface SecurityScanMetadata {
|
|
116
|
+
has_sensitive_content: boolean;
|
|
117
|
+
masked_sections: MaskedSection[];
|
|
118
|
+
risk_level: 'low' | 'medium' | 'high' | 'critical';
|
|
119
|
+
risk_score: number;
|
|
120
|
+
recommendations: string[];
|
|
121
|
+
}
|
|
122
|
+
export interface MaskedSection {
|
|
123
|
+
type: string;
|
|
124
|
+
original_location: {
|
|
125
|
+
line: number;
|
|
126
|
+
column: number;
|
|
127
|
+
};
|
|
128
|
+
masking_strategy: 'full_redaction' | 'partial';
|
|
129
|
+
placeholder: string;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Code linking metadata
|
|
133
|
+
*/
|
|
134
|
+
export interface CodeLinkingMetadata {
|
|
135
|
+
method: 'ast_analysis' | 'keyword_matching' | 'manual';
|
|
136
|
+
language?: string;
|
|
137
|
+
linked_files: LinkedFile[];
|
|
138
|
+
keywords_used: string[];
|
|
139
|
+
unlinked_mentions?: UnlinkedMention[];
|
|
140
|
+
}
|
|
141
|
+
export interface LinkedFile {
|
|
142
|
+
path: string;
|
|
143
|
+
confidence: number;
|
|
144
|
+
match_type: string;
|
|
145
|
+
lines_analyzed?: number;
|
|
146
|
+
relevant_sections?: {
|
|
147
|
+
start_line: number;
|
|
148
|
+
end_line: number;
|
|
149
|
+
description: string;
|
|
150
|
+
}[];
|
|
151
|
+
}
|
|
152
|
+
export interface UnlinkedMention {
|
|
153
|
+
file: string;
|
|
154
|
+
reason: string;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Mermaid diagrams metadata
|
|
158
|
+
*/
|
|
159
|
+
export interface MermaidDiagramsMetadata {
|
|
160
|
+
workflow?: string;
|
|
161
|
+
relationships?: string;
|
|
162
|
+
impact_flow?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Deployment pattern metadata
|
|
166
|
+
*/
|
|
167
|
+
export interface DeploymentPatternMetadata {
|
|
168
|
+
detected_platform: string;
|
|
169
|
+
confidence: number;
|
|
170
|
+
detection_evidence: string[];
|
|
171
|
+
pattern_id: string;
|
|
172
|
+
authoritative_sources: AuthoritativeSource[];
|
|
173
|
+
deployment_phases: DeploymentPhase[];
|
|
174
|
+
}
|
|
175
|
+
export interface AuthoritativeSource {
|
|
176
|
+
url: string;
|
|
177
|
+
title: string;
|
|
178
|
+
priority: number;
|
|
179
|
+
}
|
|
180
|
+
export interface DeploymentPhase {
|
|
181
|
+
order: number;
|
|
182
|
+
name: string;
|
|
183
|
+
commands: string[];
|
|
184
|
+
validation: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Research metadata
|
|
188
|
+
*/
|
|
189
|
+
export interface ResearchMetadata {
|
|
190
|
+
questions_investigated: string[];
|
|
191
|
+
sources_consulted: ResearchSource[];
|
|
192
|
+
alternatives_considered: AlternativeOption[];
|
|
193
|
+
research_date: string;
|
|
194
|
+
}
|
|
195
|
+
export interface ResearchSource {
|
|
196
|
+
url: string;
|
|
197
|
+
title: string;
|
|
198
|
+
relevance_score: number;
|
|
199
|
+
key_insights?: string[];
|
|
200
|
+
}
|
|
201
|
+
export interface AlternativeOption {
|
|
202
|
+
option: string;
|
|
203
|
+
pros: string[];
|
|
204
|
+
cons: string[];
|
|
205
|
+
rejected_reason: string;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Response from sync endpoint
|
|
209
|
+
*/
|
|
210
|
+
export interface SyncAdrResponse {
|
|
211
|
+
success: boolean;
|
|
212
|
+
repository: string;
|
|
213
|
+
synced_count: number;
|
|
214
|
+
errors?: AggregatorError[];
|
|
215
|
+
sync_id: string;
|
|
216
|
+
timestamp: string;
|
|
217
|
+
tier?: AggregatorTier;
|
|
218
|
+
limits?: {
|
|
219
|
+
maxRepos: string;
|
|
220
|
+
maxADRsPerRepo: string;
|
|
221
|
+
};
|
|
222
|
+
truncated?: boolean;
|
|
223
|
+
truncated_count?: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Request for getting ADR context
|
|
227
|
+
*/
|
|
228
|
+
export interface GetContextRequest extends RepositoryIdentifier {
|
|
229
|
+
/** Include Mermaid diagrams (Pro+ tier) */
|
|
230
|
+
include_diagrams?: boolean;
|
|
231
|
+
/** Include timeline data */
|
|
232
|
+
include_timeline?: boolean;
|
|
233
|
+
/** Include code links (Pro+ tier) */
|
|
234
|
+
include_code_links?: boolean;
|
|
235
|
+
/** Include research context (Pro+ tier) */
|
|
236
|
+
include_research?: boolean;
|
|
237
|
+
/** Filter by staleness level */
|
|
238
|
+
staleness_filter?: 'all' | 'fresh' | 'stale' | 'very_stale';
|
|
239
|
+
/** Knowledge graph depth (Team tier) */
|
|
240
|
+
graph_depth?: number;
|
|
241
|
+
/** Include full ADR content */
|
|
242
|
+
include_content?: boolean;
|
|
243
|
+
/** Include relationships */
|
|
244
|
+
include_relationships?: boolean;
|
|
245
|
+
/** Include summary */
|
|
246
|
+
include_summary?: boolean;
|
|
247
|
+
/** Maximum ADRs to return */
|
|
248
|
+
max_adrs?: number;
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Response from get context endpoint
|
|
252
|
+
*/
|
|
253
|
+
export interface GetContextResponse {
|
|
254
|
+
repository: string;
|
|
255
|
+
adrs: AdrContext[];
|
|
256
|
+
summary: {
|
|
257
|
+
total_adrs: number;
|
|
258
|
+
by_status: Record<string, number>;
|
|
259
|
+
average_staleness: number;
|
|
260
|
+
};
|
|
261
|
+
adr_count?: number;
|
|
262
|
+
last_synced?: string;
|
|
263
|
+
tier?: AggregatorTier;
|
|
264
|
+
limits?: {
|
|
265
|
+
maxADRs: number;
|
|
266
|
+
includeFullContent: boolean;
|
|
267
|
+
advancedAnalysis: boolean;
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Individual ADR context data
|
|
272
|
+
*/
|
|
273
|
+
export interface AdrContext {
|
|
274
|
+
id?: string;
|
|
275
|
+
path: string;
|
|
276
|
+
title: string;
|
|
277
|
+
status: string;
|
|
278
|
+
summary?: string;
|
|
279
|
+
timeline?: TimelineMetadata;
|
|
280
|
+
diagrams?: MermaidDiagramsMetadata;
|
|
281
|
+
code_links?: CodeLinkingMetadata;
|
|
282
|
+
research?: ResearchMetadata;
|
|
283
|
+
relationships?: Array<{
|
|
284
|
+
type: string;
|
|
285
|
+
target: string;
|
|
286
|
+
}>;
|
|
287
|
+
content?: string;
|
|
288
|
+
synced_at?: string;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Request for staleness report
|
|
292
|
+
*/
|
|
293
|
+
export interface GetStalenessReportRequest extends RepositoryIdentifier {
|
|
294
|
+
/** Days threshold for considering ADR stale */
|
|
295
|
+
threshold?: number;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Response from staleness report endpoint
|
|
299
|
+
*/
|
|
300
|
+
export interface GetStalenessReportResponse {
|
|
301
|
+
repository: string;
|
|
302
|
+
report_date: string;
|
|
303
|
+
summary: {
|
|
304
|
+
total_adrs: number;
|
|
305
|
+
fresh: number;
|
|
306
|
+
recent: number;
|
|
307
|
+
stale: number;
|
|
308
|
+
very_stale: number;
|
|
309
|
+
};
|
|
310
|
+
stale_adrs: StaleAdr[];
|
|
311
|
+
governance: {
|
|
312
|
+
review_cycle_compliance: number;
|
|
313
|
+
overdue_reviews: number;
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Stale ADR details
|
|
318
|
+
*/
|
|
319
|
+
export interface StaleAdr {
|
|
320
|
+
path: string;
|
|
321
|
+
title: string;
|
|
322
|
+
days_since_modified: number;
|
|
323
|
+
staleness: string;
|
|
324
|
+
recommended_action: string;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Request for ADR templates
|
|
328
|
+
*/
|
|
329
|
+
export interface GetTemplatesRequest {
|
|
330
|
+
/** Filter by domain (web_application, microservices, api, etc.) */
|
|
331
|
+
domain?: string;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Response from templates endpoint
|
|
335
|
+
*/
|
|
336
|
+
export interface GetTemplatesResponse {
|
|
337
|
+
templates: Record<string, DomainTemplate>;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Domain-specific template with best practices and anti-patterns
|
|
341
|
+
*/
|
|
342
|
+
export interface DomainTemplate {
|
|
343
|
+
best_practices: BestPractice[];
|
|
344
|
+
anti_patterns: AntiPattern[];
|
|
345
|
+
}
|
|
346
|
+
export interface BestPractice {
|
|
347
|
+
id: string;
|
|
348
|
+
name: string;
|
|
349
|
+
description: string;
|
|
350
|
+
adr_template: string;
|
|
351
|
+
}
|
|
352
|
+
export interface AntiPattern {
|
|
353
|
+
id: string;
|
|
354
|
+
name: string;
|
|
355
|
+
description: string;
|
|
356
|
+
detection_hints: string[];
|
|
357
|
+
recommendation: string;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* Request for Mermaid diagrams
|
|
361
|
+
*/
|
|
362
|
+
export interface GetDiagramsRequest extends RepositoryIdentifier {
|
|
363
|
+
/** Optional specific ADR path */
|
|
364
|
+
adr_path?: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Response from diagrams endpoint
|
|
368
|
+
*/
|
|
369
|
+
export interface GetDiagramsResponse {
|
|
370
|
+
repository: string;
|
|
371
|
+
diagrams: AdrDiagram[];
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Diagrams for a single ADR
|
|
375
|
+
*/
|
|
376
|
+
export interface AdrDiagram {
|
|
377
|
+
adr_path: string;
|
|
378
|
+
workflow_diagram?: string;
|
|
379
|
+
relationship_diagram?: string;
|
|
380
|
+
impact_diagram?: string;
|
|
381
|
+
generated_at: string;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Request for ADR compliance validation
|
|
385
|
+
*/
|
|
386
|
+
export interface ValidateComplianceRequest extends RepositoryIdentifier {
|
|
387
|
+
/** Specific ADR paths to validate */
|
|
388
|
+
adr_paths?: string[];
|
|
389
|
+
/** Type of validation to perform */
|
|
390
|
+
validation_type?: 'implementation' | 'architecture' | 'security' | 'all';
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Response from compliance validation endpoint
|
|
394
|
+
*/
|
|
395
|
+
export interface ValidateComplianceResponse {
|
|
396
|
+
repository: string;
|
|
397
|
+
validation_results: ComplianceResult[];
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Compliance validation result for a single ADR
|
|
401
|
+
*/
|
|
402
|
+
export interface ComplianceResult {
|
|
403
|
+
adr_path: string;
|
|
404
|
+
compliance_score: number;
|
|
405
|
+
status: 'compliant' | 'partial' | 'non_compliant';
|
|
406
|
+
findings: ComplianceFinding[];
|
|
407
|
+
linked_files_validated: number;
|
|
408
|
+
recommendations: string[];
|
|
409
|
+
}
|
|
410
|
+
export interface ComplianceFinding {
|
|
411
|
+
type: 'success' | 'warning' | 'error';
|
|
412
|
+
description: string;
|
|
413
|
+
severity?: 'low' | 'medium' | 'high' | 'critical';
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* Request for knowledge graph
|
|
417
|
+
*/
|
|
418
|
+
export interface GetKnowledgeGraphRequest {
|
|
419
|
+
/** Scope of the graph */
|
|
420
|
+
scope?: 'repository' | 'organization';
|
|
421
|
+
/** Optional repository filter when scope is organization */
|
|
422
|
+
repository_name?: string;
|
|
423
|
+
/** Include analytics and insights */
|
|
424
|
+
include_analytics?: boolean;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Response from knowledge graph endpoint
|
|
428
|
+
*/
|
|
429
|
+
export interface GetKnowledgeGraphResponse {
|
|
430
|
+
organization_id?: string;
|
|
431
|
+
repository?: string;
|
|
432
|
+
total_repositories?: number;
|
|
433
|
+
graph: {
|
|
434
|
+
nodes: KnowledgeGraphNode[];
|
|
435
|
+
relationships: KnowledgeGraphRelationship[];
|
|
436
|
+
cross_repo_patterns?: CrossRepoPattern[];
|
|
437
|
+
};
|
|
438
|
+
insights?: {
|
|
439
|
+
most_connected_adrs: string[];
|
|
440
|
+
orphan_decisions: string[];
|
|
441
|
+
pattern_trends: PatternTrend[];
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Node in the knowledge graph
|
|
446
|
+
*/
|
|
447
|
+
export interface KnowledgeGraphNode {
|
|
448
|
+
id: string;
|
|
449
|
+
type: 'decision' | 'code' | 'pattern' | 'technology';
|
|
450
|
+
title?: string;
|
|
451
|
+
path?: string;
|
|
452
|
+
status?: string;
|
|
453
|
+
technologies?: string[];
|
|
454
|
+
name?: string;
|
|
455
|
+
language?: string;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Relationship between nodes in the knowledge graph
|
|
459
|
+
*/
|
|
460
|
+
export interface KnowledgeGraphRelationship {
|
|
461
|
+
source: string;
|
|
462
|
+
target: string;
|
|
463
|
+
type: 'implements' | 'depends_on' | 'supersedes' | 'applies' | 'conflicts_with';
|
|
464
|
+
confidence?: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* Cross-repository pattern
|
|
468
|
+
*/
|
|
469
|
+
export interface CrossRepoPattern {
|
|
470
|
+
pattern: string;
|
|
471
|
+
repositories: string[];
|
|
472
|
+
adr_count: number;
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Pattern trend over time
|
|
476
|
+
*/
|
|
477
|
+
export interface PatternTrend {
|
|
478
|
+
pattern: string;
|
|
479
|
+
trend: 'increasing' | 'stable' | 'decreasing';
|
|
480
|
+
count: number;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Gap type indicating direction of the gap
|
|
484
|
+
*/
|
|
485
|
+
export type GapType = 'adr_to_code' | 'code_to_adr';
|
|
486
|
+
/**
|
|
487
|
+
* Gap severity level
|
|
488
|
+
*/
|
|
489
|
+
export type GapSeverity = 'error' | 'warning' | 'info';
|
|
490
|
+
/**
|
|
491
|
+
* Individual gap item
|
|
492
|
+
*
|
|
493
|
+
* @see API: POST /functions/v1/mcp-report-code-gaps
|
|
494
|
+
*/
|
|
495
|
+
export interface CodeGap {
|
|
496
|
+
/** Direction of the gap */
|
|
497
|
+
gap_type: GapType;
|
|
498
|
+
/** Severity level */
|
|
499
|
+
severity: GapSeverity;
|
|
500
|
+
/** Human-readable title */
|
|
501
|
+
title: string;
|
|
502
|
+
/** ADR path (for adr_to_code gaps) */
|
|
503
|
+
adr_path?: string;
|
|
504
|
+
/** Referenced file that doesn't exist (for adr_to_code gaps) */
|
|
505
|
+
referenced_file?: string;
|
|
506
|
+
/** Whether file existence was verified by the MCP server */
|
|
507
|
+
verified?: boolean;
|
|
508
|
+
/** Code pattern detected (for code_to_adr gaps) - free-form string, e.g., "ioredis client usage" */
|
|
509
|
+
detected_pattern?: string;
|
|
510
|
+
/** Code files where the pattern was detected (for code_to_adr gaps) */
|
|
511
|
+
code_files?: string[];
|
|
512
|
+
/** Suggested ADR title (for code_to_adr gaps) */
|
|
513
|
+
suggested_adr_title?: string;
|
|
514
|
+
/** Additional context or description */
|
|
515
|
+
description?: string;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Analysis summary statistics
|
|
519
|
+
*/
|
|
520
|
+
export interface GapAnalysisSummary {
|
|
521
|
+
/** Number of files scanned */
|
|
522
|
+
files_scanned: number;
|
|
523
|
+
/** Number of ADRs checked */
|
|
524
|
+
adrs_checked: number;
|
|
525
|
+
/** Technologies detected in the codebase */
|
|
526
|
+
technologies_detected: string[];
|
|
527
|
+
/** Architectural patterns detected */
|
|
528
|
+
patterns_detected?: string[];
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Request payload for reporting code gaps
|
|
532
|
+
*/
|
|
533
|
+
export interface ReportCodeGapsRequest extends RepositoryIdentifier {
|
|
534
|
+
/** ISO timestamp of when analysis was performed */
|
|
535
|
+
analyzed_at: string;
|
|
536
|
+
/** Array of detected gaps */
|
|
537
|
+
gaps: CodeGap[];
|
|
538
|
+
/** Analysis summary */
|
|
539
|
+
analysis_summary: GapAnalysisSummary;
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Response from report code gaps endpoint
|
|
543
|
+
*
|
|
544
|
+
* @see API: POST /functions/v1/mcp-report-code-gaps
|
|
545
|
+
*/
|
|
546
|
+
export interface ReportCodeGapsResponse {
|
|
547
|
+
success: boolean;
|
|
548
|
+
repository_name: string;
|
|
549
|
+
summary: {
|
|
550
|
+
gaps_inserted: number;
|
|
551
|
+
gaps_updated: number;
|
|
552
|
+
total_open_gaps: number;
|
|
553
|
+
adr_to_code_issues: number;
|
|
554
|
+
code_to_adr_gaps: number;
|
|
555
|
+
files_scanned: number;
|
|
556
|
+
adrs_checked: number;
|
|
557
|
+
technologies_detected: string[];
|
|
558
|
+
};
|
|
559
|
+
/** Any errors during processing */
|
|
560
|
+
errors?: AggregatorError[];
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* Request for getting current gaps
|
|
564
|
+
*/
|
|
565
|
+
export interface GetCodeGapsRequest extends RepositoryIdentifier {
|
|
566
|
+
/** Filter by gap type */
|
|
567
|
+
gap_type?: GapType;
|
|
568
|
+
/** Filter by severity */
|
|
569
|
+
severity?: GapSeverity;
|
|
570
|
+
/** Include dismissed gaps */
|
|
571
|
+
include_dismissed?: boolean;
|
|
572
|
+
/** Include resolved gaps */
|
|
573
|
+
include_resolved?: boolean;
|
|
574
|
+
}
|
|
575
|
+
/**
|
|
576
|
+
* Gap with status information
|
|
577
|
+
*/
|
|
578
|
+
export interface CodeGapWithStatus extends CodeGap {
|
|
579
|
+
/** Unique gap ID */
|
|
580
|
+
id: string;
|
|
581
|
+
/** Current status */
|
|
582
|
+
status: 'open' | 'dismissed' | 'resolved';
|
|
583
|
+
/** When the gap was first detected */
|
|
584
|
+
first_detected: string;
|
|
585
|
+
/** When the gap was last seen */
|
|
586
|
+
last_seen: string;
|
|
587
|
+
/** Who dismissed/resolved it (if applicable) */
|
|
588
|
+
resolved_by?: string;
|
|
589
|
+
/** Resolution notes */
|
|
590
|
+
resolution_notes?: string;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Response from get code gaps endpoint
|
|
594
|
+
*/
|
|
595
|
+
export interface GetCodeGapsResponse {
|
|
596
|
+
repository: string;
|
|
597
|
+
gaps: CodeGapWithStatus[];
|
|
598
|
+
summary: {
|
|
599
|
+
total: number;
|
|
600
|
+
by_type: Record<GapType, number>;
|
|
601
|
+
by_severity: Record<GapSeverity, number>;
|
|
602
|
+
by_status: Record<string, number>;
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* ADR implementation status values
|
|
607
|
+
*/
|
|
608
|
+
export type ImplementationStatus = 'not_started' | 'in_progress' | 'implemented' | 'deprecated' | 'blocked';
|
|
609
|
+
/**
|
|
610
|
+
* Individual ADR implementation status update
|
|
611
|
+
*/
|
|
612
|
+
export interface ImplementationStatusUpdate {
|
|
613
|
+
/** Path to the ADR file relative to project root */
|
|
614
|
+
adr_path: string;
|
|
615
|
+
/** New implementation status */
|
|
616
|
+
implementation_status: ImplementationStatus;
|
|
617
|
+
/** Optional notes about the status change */
|
|
618
|
+
notes?: string;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Request payload for updating ADR implementation status
|
|
622
|
+
*
|
|
623
|
+
* @see API: POST /functions/v1/mcp-update-implementation-status
|
|
624
|
+
*/
|
|
625
|
+
export interface UpdateImplementationStatusRequest {
|
|
626
|
+
/** Repository name in format "owner/repo" */
|
|
627
|
+
repository_name: string;
|
|
628
|
+
/** Array of status updates to apply */
|
|
629
|
+
updates: ImplementationStatusUpdate[];
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Response from update implementation status endpoint
|
|
633
|
+
*
|
|
634
|
+
* @see API: POST /functions/v1/mcp-update-implementation-status
|
|
635
|
+
*/
|
|
636
|
+
export interface UpdateImplementationStatusResponse {
|
|
637
|
+
success: boolean;
|
|
638
|
+
repository: string;
|
|
639
|
+
updated_count: number;
|
|
640
|
+
errors?: AggregatorError[];
|
|
641
|
+
timestamp: string;
|
|
642
|
+
tier?: AggregatorTier;
|
|
643
|
+
}
|
|
644
|
+
/**
|
|
645
|
+
* Request for getting ADR priorities for roadmap/backlog planning
|
|
646
|
+
*
|
|
647
|
+
* @see API: GET /functions/v1/mcp-get-priorities
|
|
648
|
+
*/
|
|
649
|
+
export interface GetPrioritiesRequest extends RepositoryIdentifier {
|
|
650
|
+
/** Include AI-based priority recommendations */
|
|
651
|
+
include_ai?: boolean;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Individual ADR priority data
|
|
655
|
+
*/
|
|
656
|
+
export interface AdrPriority {
|
|
657
|
+
/** Path to the ADR file relative to project root */
|
|
658
|
+
adr_path: string;
|
|
659
|
+
/** ADR title */
|
|
660
|
+
title: string;
|
|
661
|
+
/** Priority score (0-100, higher = more urgent) */
|
|
662
|
+
priority_score: number;
|
|
663
|
+
/** ADR paths this ADR depends on (prerequisites) */
|
|
664
|
+
dependencies: string[];
|
|
665
|
+
/** ADR paths that block this ADR from being implemented */
|
|
666
|
+
blockers: string[];
|
|
667
|
+
/** Current implementation status */
|
|
668
|
+
implementation_status: ImplementationStatus;
|
|
669
|
+
/** Number of code/documentation gaps related to this ADR */
|
|
670
|
+
gap_count: number;
|
|
671
|
+
/** Whether this priority was determined by AI analysis */
|
|
672
|
+
ai_prioritized?: boolean;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Response from get priorities endpoint
|
|
676
|
+
*
|
|
677
|
+
* @see API: GET /functions/v1/mcp-get-priorities
|
|
678
|
+
*/
|
|
679
|
+
export interface GetPrioritiesResponse {
|
|
680
|
+
repository: string;
|
|
681
|
+
priorities: AdrPriority[];
|
|
682
|
+
summary: {
|
|
683
|
+
total_adrs: number;
|
|
684
|
+
implemented: number;
|
|
685
|
+
in_progress: number;
|
|
686
|
+
not_started: number;
|
|
687
|
+
blocked: number;
|
|
688
|
+
total_gaps: number;
|
|
689
|
+
};
|
|
690
|
+
tier?: AggregatorTier;
|
|
691
|
+
}
|
|
692
|
+
//# sourceMappingURL=adr-aggregator.d.ts.map
|