mcp-adr-analysis-server 1.1.0
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/LICENSE +21 -0
- package/README.md +608 -0
- package/dist/src/index.d.ts +10 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +1722 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts +24 -0
- package/dist/src/prompts/adr-suggestion-prompts.d.ts.map +1 -0
- package/dist/src/prompts/adr-suggestion-prompts.js +383 -0
- package/dist/src/prompts/adr-suggestion-prompts.js.map +1 -0
- package/dist/src/prompts/analysis-prompts.d.ts +24 -0
- package/dist/src/prompts/analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/analysis-prompts.js +489 -0
- package/dist/src/prompts/analysis-prompts.js.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts +54 -0
- package/dist/src/prompts/deployment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/deployment-analysis-prompts.js +712 -0
- package/dist/src/prompts/deployment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts +34 -0
- package/dist/src/prompts/environment-analysis-prompts.d.ts.map +1 -0
- package/dist/src/prompts/environment-analysis-prompts.js +724 -0
- package/dist/src/prompts/environment-analysis-prompts.js.map +1 -0
- package/dist/src/prompts/index.d.ts +43 -0
- package/dist/src/prompts/index.d.ts.map +1 -0
- package/dist/src/prompts/index.js +384 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/prompts/research-integration-prompts.d.ts +43 -0
- package/dist/src/prompts/research-integration-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-integration-prompts.js +398 -0
- package/dist/src/prompts/research-integration-prompts.js.map +1 -0
- package/dist/src/prompts/research-question-prompts.d.ts +75 -0
- package/dist/src/prompts/research-question-prompts.d.ts.map +1 -0
- package/dist/src/prompts/research-question-prompts.js +695 -0
- package/dist/src/prompts/research-question-prompts.js.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts +63 -0
- package/dist/src/prompts/rule-generation-prompts.d.ts.map +1 -0
- package/dist/src/prompts/rule-generation-prompts.js +630 -0
- package/dist/src/prompts/rule-generation-prompts.js.map +1 -0
- package/dist/src/prompts/security-prompts.d.ts +23 -0
- package/dist/src/prompts/security-prompts.d.ts.map +1 -0
- package/dist/src/prompts/security-prompts.js +287 -0
- package/dist/src/prompts/security-prompts.js.map +1 -0
- package/dist/src/resources/index.d.ts +24 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +458 -0
- package/dist/src/resources/index.js.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts +40 -0
- package/dist/src/tools/adr-suggestion-tool.d.ts.map +1 -0
- package/dist/src/tools/adr-suggestion-tool.js +338 -0
- package/dist/src/tools/adr-suggestion-tool.js.map +1 -0
- package/dist/src/tools/content-masking-tool.d.ts +52 -0
- package/dist/src/tools/content-masking-tool.d.ts.map +1 -0
- package/dist/src/tools/content-masking-tool.js +206 -0
- package/dist/src/tools/content-masking-tool.js.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts +39 -0
- package/dist/src/tools/deployment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/deployment-analysis-tool.js +310 -0
- package/dist/src/tools/deployment-analysis-tool.js.map +1 -0
- package/dist/src/tools/environment-analysis-tool.d.ts +16 -0
- package/dist/src/tools/environment-analysis-tool.d.ts.map +1 -0
- package/dist/src/tools/environment-analysis-tool.js +298 -0
- package/dist/src/tools/environment-analysis-tool.js.map +1 -0
- package/dist/src/tools/research-integration-tool.d.ts +44 -0
- package/dist/src/tools/research-integration-tool.d.ts.map +1 -0
- package/dist/src/tools/research-integration-tool.js +429 -0
- package/dist/src/tools/research-integration-tool.js.map +1 -0
- package/dist/src/tools/research-question-tool.d.ts +55 -0
- package/dist/src/tools/research-question-tool.d.ts.map +1 -0
- package/dist/src/tools/research-question-tool.js +333 -0
- package/dist/src/tools/research-question-tool.js.map +1 -0
- package/dist/src/tools/rule-generation-tool.d.ts +49 -0
- package/dist/src/tools/rule-generation-tool.d.ts.map +1 -0
- package/dist/src/tools/rule-generation-tool.js +432 -0
- package/dist/src/tools/rule-generation-tool.js.map +1 -0
- package/dist/src/types/index.d.ts +531 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +129 -0
- package/dist/src/types/index.js.map +1 -0
- package/dist/src/utils/adr-suggestions.d.ts +104 -0
- package/dist/src/utils/adr-suggestions.d.ts.map +1 -0
- package/dist/src/utils/adr-suggestions.js +228 -0
- package/dist/src/utils/adr-suggestions.js.map +1 -0
- package/dist/src/utils/cache.d.ts +51 -0
- package/dist/src/utils/cache.d.ts.map +1 -0
- package/dist/src/utils/cache.js +243 -0
- package/dist/src/utils/cache.js.map +1 -0
- package/dist/src/utils/config.d.ts +65 -0
- package/dist/src/utils/config.d.ts.map +1 -0
- package/dist/src/utils/config.js +118 -0
- package/dist/src/utils/config.js.map +1 -0
- package/dist/src/utils/content-masking.d.ts +79 -0
- package/dist/src/utils/content-masking.d.ts.map +1 -0
- package/dist/src/utils/content-masking.js +203 -0
- package/dist/src/utils/content-masking.js.map +1 -0
- package/dist/src/utils/deployment-analysis.d.ts +67 -0
- package/dist/src/utils/deployment-analysis.d.ts.map +1 -0
- package/dist/src/utils/deployment-analysis.js +263 -0
- package/dist/src/utils/deployment-analysis.js.map +1 -0
- package/dist/src/utils/environment-analysis.d.ts +76 -0
- package/dist/src/utils/environment-analysis.d.ts.map +1 -0
- package/dist/src/utils/environment-analysis.js +329 -0
- package/dist/src/utils/environment-analysis.js.map +1 -0
- package/dist/src/utils/file-system.d.ts +63 -0
- package/dist/src/utils/file-system.d.ts.map +1 -0
- package/dist/src/utils/file-system.js +189 -0
- package/dist/src/utils/file-system.js.map +1 -0
- package/dist/src/utils/output-masking.d.ts +45 -0
- package/dist/src/utils/output-masking.d.ts.map +1 -0
- package/dist/src/utils/output-masking.js +200 -0
- package/dist/src/utils/output-masking.js.map +1 -0
- package/dist/src/utils/research-documentation.d.ts +58 -0
- package/dist/src/utils/research-documentation.d.ts.map +1 -0
- package/dist/src/utils/research-documentation.js +438 -0
- package/dist/src/utils/research-documentation.js.map +1 -0
- package/dist/src/utils/research-integration.d.ts +89 -0
- package/dist/src/utils/research-integration.d.ts.map +1 -0
- package/dist/src/utils/research-integration.js +432 -0
- package/dist/src/utils/research-integration.js.map +1 -0
- package/dist/src/utils/research-questions.d.ts +97 -0
- package/dist/src/utils/research-questions.d.ts.map +1 -0
- package/dist/src/utils/research-questions.js +319 -0
- package/dist/src/utils/research-questions.js.map +1 -0
- package/dist/src/utils/rule-format.d.ts +76 -0
- package/dist/src/utils/rule-format.d.ts.map +1 -0
- package/dist/src/utils/rule-format.js +257 -0
- package/dist/src/utils/rule-format.js.map +1 -0
- package/dist/src/utils/rule-generation.d.ts +86 -0
- package/dist/src/utils/rule-generation.d.ts.map +1 -0
- package/dist/src/utils/rule-generation.js +330 -0
- package/dist/src/utils/rule-generation.js.map +1 -0
- package/package.json +71 -0
|
@@ -0,0 +1,531 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core TypeScript interfaces for MCP ADR Analysis Server
|
|
3
|
+
* Based on shrimp-rules.md requirements
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export interface Adr {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
status: 'proposed' | 'accepted' | 'deprecated' | 'superseded';
|
|
10
|
+
date: string;
|
|
11
|
+
context: string;
|
|
12
|
+
decision: string;
|
|
13
|
+
consequences: string;
|
|
14
|
+
implementationPlan?: string;
|
|
15
|
+
filePath: string;
|
|
16
|
+
tags?: string[];
|
|
17
|
+
relatedAdrs?: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const AdrSchema: z.ZodObject<{
|
|
20
|
+
id: z.ZodString;
|
|
21
|
+
title: z.ZodString;
|
|
22
|
+
status: z.ZodEnum<["proposed", "accepted", "deprecated", "superseded"]>;
|
|
23
|
+
date: z.ZodString;
|
|
24
|
+
context: z.ZodString;
|
|
25
|
+
decision: z.ZodString;
|
|
26
|
+
consequences: z.ZodString;
|
|
27
|
+
implementationPlan: z.ZodOptional<z.ZodString>;
|
|
28
|
+
filePath: z.ZodString;
|
|
29
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
30
|
+
relatedAdrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
}, "strip", z.ZodTypeAny, {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
35
|
+
date: string;
|
|
36
|
+
context: string;
|
|
37
|
+
decision: string;
|
|
38
|
+
consequences: string;
|
|
39
|
+
filePath: string;
|
|
40
|
+
implementationPlan?: string | undefined;
|
|
41
|
+
tags?: string[] | undefined;
|
|
42
|
+
relatedAdrs?: string[] | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
id: string;
|
|
45
|
+
title: string;
|
|
46
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
47
|
+
date: string;
|
|
48
|
+
context: string;
|
|
49
|
+
decision: string;
|
|
50
|
+
consequences: string;
|
|
51
|
+
filePath: string;
|
|
52
|
+
implementationPlan?: string | undefined;
|
|
53
|
+
tags?: string[] | undefined;
|
|
54
|
+
relatedAdrs?: string[] | undefined;
|
|
55
|
+
}>;
|
|
56
|
+
export interface DetectedTechnology {
|
|
57
|
+
name: string;
|
|
58
|
+
category: 'framework' | 'library' | 'database' | 'cloud' | 'devops' | 'language' | 'tool';
|
|
59
|
+
version?: string;
|
|
60
|
+
confidence: number;
|
|
61
|
+
evidence: string[];
|
|
62
|
+
filePaths: string[];
|
|
63
|
+
description?: string;
|
|
64
|
+
}
|
|
65
|
+
export declare const DetectedTechnologySchema: z.ZodObject<{
|
|
66
|
+
name: z.ZodString;
|
|
67
|
+
category: z.ZodEnum<["framework", "library", "database", "cloud", "devops", "language", "tool"]>;
|
|
68
|
+
version: z.ZodOptional<z.ZodString>;
|
|
69
|
+
confidence: z.ZodNumber;
|
|
70
|
+
evidence: z.ZodArray<z.ZodString, "many">;
|
|
71
|
+
filePaths: z.ZodArray<z.ZodString, "many">;
|
|
72
|
+
description: z.ZodOptional<z.ZodString>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
name: string;
|
|
75
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
76
|
+
confidence: number;
|
|
77
|
+
evidence: string[];
|
|
78
|
+
filePaths: string[];
|
|
79
|
+
version?: string | undefined;
|
|
80
|
+
description?: string | undefined;
|
|
81
|
+
}, {
|
|
82
|
+
name: string;
|
|
83
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
84
|
+
confidence: number;
|
|
85
|
+
evidence: string[];
|
|
86
|
+
filePaths: string[];
|
|
87
|
+
version?: string | undefined;
|
|
88
|
+
description?: string | undefined;
|
|
89
|
+
}>;
|
|
90
|
+
export interface DetectedPattern {
|
|
91
|
+
name: string;
|
|
92
|
+
type: 'architectural' | 'structural' | 'organizational' | 'communication' | 'testing' | 'data';
|
|
93
|
+
confidence: number;
|
|
94
|
+
description: string;
|
|
95
|
+
evidence: string[];
|
|
96
|
+
filePaths: string[];
|
|
97
|
+
suboptimal?: boolean;
|
|
98
|
+
recommendations?: string[];
|
|
99
|
+
}
|
|
100
|
+
export declare const DetectedPatternSchema: z.ZodObject<{
|
|
101
|
+
name: z.ZodString;
|
|
102
|
+
type: z.ZodEnum<["architectural", "structural", "organizational", "communication", "testing", "data"]>;
|
|
103
|
+
confidence: z.ZodNumber;
|
|
104
|
+
description: z.ZodString;
|
|
105
|
+
evidence: z.ZodArray<z.ZodString, "many">;
|
|
106
|
+
filePaths: z.ZodArray<z.ZodString, "many">;
|
|
107
|
+
suboptimal: z.ZodOptional<z.ZodBoolean>;
|
|
108
|
+
recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
111
|
+
name: string;
|
|
112
|
+
confidence: number;
|
|
113
|
+
evidence: string[];
|
|
114
|
+
filePaths: string[];
|
|
115
|
+
description: string;
|
|
116
|
+
suboptimal?: boolean | undefined;
|
|
117
|
+
recommendations?: string[] | undefined;
|
|
118
|
+
}, {
|
|
119
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
120
|
+
name: string;
|
|
121
|
+
confidence: number;
|
|
122
|
+
evidence: string[];
|
|
123
|
+
filePaths: string[];
|
|
124
|
+
description: string;
|
|
125
|
+
suboptimal?: boolean | undefined;
|
|
126
|
+
recommendations?: string[] | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
export interface ArchitecturalKnowledgeGraph {
|
|
129
|
+
projectId: string;
|
|
130
|
+
timestamp: string;
|
|
131
|
+
adrs: Adr[];
|
|
132
|
+
technologies: DetectedTechnology[];
|
|
133
|
+
patterns: DetectedPattern[];
|
|
134
|
+
rules: Rule[];
|
|
135
|
+
relationships: Relationship[];
|
|
136
|
+
metadata: ProjectMetadata;
|
|
137
|
+
}
|
|
138
|
+
export interface Relationship {
|
|
139
|
+
source: string;
|
|
140
|
+
target: string;
|
|
141
|
+
type: 'implements' | 'depends_on' | 'conflicts_with' | 'supersedes' | 'relates_to';
|
|
142
|
+
strength: number;
|
|
143
|
+
description?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface ProjectMetadata {
|
|
146
|
+
name: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
version?: string;
|
|
149
|
+
lastAnalyzed: string;
|
|
150
|
+
analysisVersion: string;
|
|
151
|
+
fileCount: number;
|
|
152
|
+
directoryCount: number;
|
|
153
|
+
}
|
|
154
|
+
export declare const ArchitecturalKnowledgeGraphSchema: z.ZodObject<{
|
|
155
|
+
projectId: z.ZodString;
|
|
156
|
+
timestamp: z.ZodString;
|
|
157
|
+
adrs: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
title: z.ZodString;
|
|
160
|
+
status: z.ZodEnum<["proposed", "accepted", "deprecated", "superseded"]>;
|
|
161
|
+
date: z.ZodString;
|
|
162
|
+
context: z.ZodString;
|
|
163
|
+
decision: z.ZodString;
|
|
164
|
+
consequences: z.ZodString;
|
|
165
|
+
implementationPlan: z.ZodOptional<z.ZodString>;
|
|
166
|
+
filePath: z.ZodString;
|
|
167
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
168
|
+
relatedAdrs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
id: string;
|
|
171
|
+
title: string;
|
|
172
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
173
|
+
date: string;
|
|
174
|
+
context: string;
|
|
175
|
+
decision: string;
|
|
176
|
+
consequences: string;
|
|
177
|
+
filePath: string;
|
|
178
|
+
implementationPlan?: string | undefined;
|
|
179
|
+
tags?: string[] | undefined;
|
|
180
|
+
relatedAdrs?: string[] | undefined;
|
|
181
|
+
}, {
|
|
182
|
+
id: string;
|
|
183
|
+
title: string;
|
|
184
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
185
|
+
date: string;
|
|
186
|
+
context: string;
|
|
187
|
+
decision: string;
|
|
188
|
+
consequences: string;
|
|
189
|
+
filePath: string;
|
|
190
|
+
implementationPlan?: string | undefined;
|
|
191
|
+
tags?: string[] | undefined;
|
|
192
|
+
relatedAdrs?: string[] | undefined;
|
|
193
|
+
}>, "many">;
|
|
194
|
+
technologies: z.ZodArray<z.ZodObject<{
|
|
195
|
+
name: z.ZodString;
|
|
196
|
+
category: z.ZodEnum<["framework", "library", "database", "cloud", "devops", "language", "tool"]>;
|
|
197
|
+
version: z.ZodOptional<z.ZodString>;
|
|
198
|
+
confidence: z.ZodNumber;
|
|
199
|
+
evidence: z.ZodArray<z.ZodString, "many">;
|
|
200
|
+
filePaths: z.ZodArray<z.ZodString, "many">;
|
|
201
|
+
description: z.ZodOptional<z.ZodString>;
|
|
202
|
+
}, "strip", z.ZodTypeAny, {
|
|
203
|
+
name: string;
|
|
204
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
205
|
+
confidence: number;
|
|
206
|
+
evidence: string[];
|
|
207
|
+
filePaths: string[];
|
|
208
|
+
version?: string | undefined;
|
|
209
|
+
description?: string | undefined;
|
|
210
|
+
}, {
|
|
211
|
+
name: string;
|
|
212
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
213
|
+
confidence: number;
|
|
214
|
+
evidence: string[];
|
|
215
|
+
filePaths: string[];
|
|
216
|
+
version?: string | undefined;
|
|
217
|
+
description?: string | undefined;
|
|
218
|
+
}>, "many">;
|
|
219
|
+
patterns: z.ZodArray<z.ZodObject<{
|
|
220
|
+
name: z.ZodString;
|
|
221
|
+
type: z.ZodEnum<["architectural", "structural", "organizational", "communication", "testing", "data"]>;
|
|
222
|
+
confidence: z.ZodNumber;
|
|
223
|
+
description: z.ZodString;
|
|
224
|
+
evidence: z.ZodArray<z.ZodString, "many">;
|
|
225
|
+
filePaths: z.ZodArray<z.ZodString, "many">;
|
|
226
|
+
suboptimal: z.ZodOptional<z.ZodBoolean>;
|
|
227
|
+
recommendations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
228
|
+
}, "strip", z.ZodTypeAny, {
|
|
229
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
230
|
+
name: string;
|
|
231
|
+
confidence: number;
|
|
232
|
+
evidence: string[];
|
|
233
|
+
filePaths: string[];
|
|
234
|
+
description: string;
|
|
235
|
+
suboptimal?: boolean | undefined;
|
|
236
|
+
recommendations?: string[] | undefined;
|
|
237
|
+
}, {
|
|
238
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
239
|
+
name: string;
|
|
240
|
+
confidence: number;
|
|
241
|
+
evidence: string[];
|
|
242
|
+
filePaths: string[];
|
|
243
|
+
description: string;
|
|
244
|
+
suboptimal?: boolean | undefined;
|
|
245
|
+
recommendations?: string[] | undefined;
|
|
246
|
+
}>, "many">;
|
|
247
|
+
rules: z.ZodArray<z.ZodAny, "many">;
|
|
248
|
+
relationships: z.ZodArray<z.ZodObject<{
|
|
249
|
+
source: z.ZodString;
|
|
250
|
+
target: z.ZodString;
|
|
251
|
+
type: z.ZodEnum<["implements", "depends_on", "conflicts_with", "supersedes", "relates_to"]>;
|
|
252
|
+
strength: z.ZodNumber;
|
|
253
|
+
description: z.ZodOptional<z.ZodString>;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to";
|
|
256
|
+
source: string;
|
|
257
|
+
target: string;
|
|
258
|
+
strength: number;
|
|
259
|
+
description?: string | undefined;
|
|
260
|
+
}, {
|
|
261
|
+
type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to";
|
|
262
|
+
source: string;
|
|
263
|
+
target: string;
|
|
264
|
+
strength: number;
|
|
265
|
+
description?: string | undefined;
|
|
266
|
+
}>, "many">;
|
|
267
|
+
metadata: z.ZodObject<{
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
description: z.ZodOptional<z.ZodString>;
|
|
270
|
+
version: z.ZodOptional<z.ZodString>;
|
|
271
|
+
lastAnalyzed: z.ZodString;
|
|
272
|
+
analysisVersion: z.ZodString;
|
|
273
|
+
fileCount: z.ZodNumber;
|
|
274
|
+
directoryCount: z.ZodNumber;
|
|
275
|
+
}, "strip", z.ZodTypeAny, {
|
|
276
|
+
name: string;
|
|
277
|
+
lastAnalyzed: string;
|
|
278
|
+
analysisVersion: string;
|
|
279
|
+
fileCount: number;
|
|
280
|
+
directoryCount: number;
|
|
281
|
+
version?: string | undefined;
|
|
282
|
+
description?: string | undefined;
|
|
283
|
+
}, {
|
|
284
|
+
name: string;
|
|
285
|
+
lastAnalyzed: string;
|
|
286
|
+
analysisVersion: string;
|
|
287
|
+
fileCount: number;
|
|
288
|
+
directoryCount: number;
|
|
289
|
+
version?: string | undefined;
|
|
290
|
+
description?: string | undefined;
|
|
291
|
+
}>;
|
|
292
|
+
}, "strip", z.ZodTypeAny, {
|
|
293
|
+
projectId: string;
|
|
294
|
+
timestamp: string;
|
|
295
|
+
adrs: {
|
|
296
|
+
id: string;
|
|
297
|
+
title: string;
|
|
298
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
299
|
+
date: string;
|
|
300
|
+
context: string;
|
|
301
|
+
decision: string;
|
|
302
|
+
consequences: string;
|
|
303
|
+
filePath: string;
|
|
304
|
+
implementationPlan?: string | undefined;
|
|
305
|
+
tags?: string[] | undefined;
|
|
306
|
+
relatedAdrs?: string[] | undefined;
|
|
307
|
+
}[];
|
|
308
|
+
technologies: {
|
|
309
|
+
name: string;
|
|
310
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
311
|
+
confidence: number;
|
|
312
|
+
evidence: string[];
|
|
313
|
+
filePaths: string[];
|
|
314
|
+
version?: string | undefined;
|
|
315
|
+
description?: string | undefined;
|
|
316
|
+
}[];
|
|
317
|
+
patterns: {
|
|
318
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
319
|
+
name: string;
|
|
320
|
+
confidence: number;
|
|
321
|
+
evidence: string[];
|
|
322
|
+
filePaths: string[];
|
|
323
|
+
description: string;
|
|
324
|
+
suboptimal?: boolean | undefined;
|
|
325
|
+
recommendations?: string[] | undefined;
|
|
326
|
+
}[];
|
|
327
|
+
rules: any[];
|
|
328
|
+
relationships: {
|
|
329
|
+
type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to";
|
|
330
|
+
source: string;
|
|
331
|
+
target: string;
|
|
332
|
+
strength: number;
|
|
333
|
+
description?: string | undefined;
|
|
334
|
+
}[];
|
|
335
|
+
metadata: {
|
|
336
|
+
name: string;
|
|
337
|
+
lastAnalyzed: string;
|
|
338
|
+
analysisVersion: string;
|
|
339
|
+
fileCount: number;
|
|
340
|
+
directoryCount: number;
|
|
341
|
+
version?: string | undefined;
|
|
342
|
+
description?: string | undefined;
|
|
343
|
+
};
|
|
344
|
+
}, {
|
|
345
|
+
projectId: string;
|
|
346
|
+
timestamp: string;
|
|
347
|
+
adrs: {
|
|
348
|
+
id: string;
|
|
349
|
+
title: string;
|
|
350
|
+
status: "proposed" | "accepted" | "deprecated" | "superseded";
|
|
351
|
+
date: string;
|
|
352
|
+
context: string;
|
|
353
|
+
decision: string;
|
|
354
|
+
consequences: string;
|
|
355
|
+
filePath: string;
|
|
356
|
+
implementationPlan?: string | undefined;
|
|
357
|
+
tags?: string[] | undefined;
|
|
358
|
+
relatedAdrs?: string[] | undefined;
|
|
359
|
+
}[];
|
|
360
|
+
technologies: {
|
|
361
|
+
name: string;
|
|
362
|
+
category: "framework" | "library" | "database" | "cloud" | "devops" | "language" | "tool";
|
|
363
|
+
confidence: number;
|
|
364
|
+
evidence: string[];
|
|
365
|
+
filePaths: string[];
|
|
366
|
+
version?: string | undefined;
|
|
367
|
+
description?: string | undefined;
|
|
368
|
+
}[];
|
|
369
|
+
patterns: {
|
|
370
|
+
type: "architectural" | "structural" | "organizational" | "communication" | "testing" | "data";
|
|
371
|
+
name: string;
|
|
372
|
+
confidence: number;
|
|
373
|
+
evidence: string[];
|
|
374
|
+
filePaths: string[];
|
|
375
|
+
description: string;
|
|
376
|
+
suboptimal?: boolean | undefined;
|
|
377
|
+
recommendations?: string[] | undefined;
|
|
378
|
+
}[];
|
|
379
|
+
rules: any[];
|
|
380
|
+
relationships: {
|
|
381
|
+
type: "implements" | "depends_on" | "conflicts_with" | "supersedes" | "relates_to";
|
|
382
|
+
source: string;
|
|
383
|
+
target: string;
|
|
384
|
+
strength: number;
|
|
385
|
+
description?: string | undefined;
|
|
386
|
+
}[];
|
|
387
|
+
metadata: {
|
|
388
|
+
name: string;
|
|
389
|
+
lastAnalyzed: string;
|
|
390
|
+
analysisVersion: string;
|
|
391
|
+
fileCount: number;
|
|
392
|
+
directoryCount: number;
|
|
393
|
+
version?: string | undefined;
|
|
394
|
+
description?: string | undefined;
|
|
395
|
+
};
|
|
396
|
+
}>;
|
|
397
|
+
export interface AdrTask {
|
|
398
|
+
id: string;
|
|
399
|
+
adrId: string;
|
|
400
|
+
title: string;
|
|
401
|
+
description: string;
|
|
402
|
+
status: 'pending' | 'in_progress' | 'completed' | 'blocked';
|
|
403
|
+
priority: 'low' | 'medium' | 'high' | 'critical';
|
|
404
|
+
estimatedEffort?: string;
|
|
405
|
+
assignee?: string;
|
|
406
|
+
dueDate?: string;
|
|
407
|
+
dependencies?: string[];
|
|
408
|
+
verificationCriteria?: string;
|
|
409
|
+
completionEvidence?: string[];
|
|
410
|
+
}
|
|
411
|
+
export declare const AdrTaskSchema: z.ZodObject<{
|
|
412
|
+
id: z.ZodString;
|
|
413
|
+
adrId: z.ZodString;
|
|
414
|
+
title: z.ZodString;
|
|
415
|
+
description: z.ZodString;
|
|
416
|
+
status: z.ZodEnum<["pending", "in_progress", "completed", "blocked"]>;
|
|
417
|
+
priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
418
|
+
estimatedEffort: z.ZodOptional<z.ZodString>;
|
|
419
|
+
assignee: z.ZodOptional<z.ZodString>;
|
|
420
|
+
dueDate: z.ZodOptional<z.ZodString>;
|
|
421
|
+
dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
422
|
+
verificationCriteria: z.ZodOptional<z.ZodString>;
|
|
423
|
+
completionEvidence: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
424
|
+
}, "strip", z.ZodTypeAny, {
|
|
425
|
+
id: string;
|
|
426
|
+
title: string;
|
|
427
|
+
status: "pending" | "in_progress" | "completed" | "blocked";
|
|
428
|
+
description: string;
|
|
429
|
+
adrId: string;
|
|
430
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
431
|
+
estimatedEffort?: string | undefined;
|
|
432
|
+
assignee?: string | undefined;
|
|
433
|
+
dueDate?: string | undefined;
|
|
434
|
+
dependencies?: string[] | undefined;
|
|
435
|
+
verificationCriteria?: string | undefined;
|
|
436
|
+
completionEvidence?: string[] | undefined;
|
|
437
|
+
}, {
|
|
438
|
+
id: string;
|
|
439
|
+
title: string;
|
|
440
|
+
status: "pending" | "in_progress" | "completed" | "blocked";
|
|
441
|
+
description: string;
|
|
442
|
+
adrId: string;
|
|
443
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
444
|
+
estimatedEffort?: string | undefined;
|
|
445
|
+
assignee?: string | undefined;
|
|
446
|
+
dueDate?: string | undefined;
|
|
447
|
+
dependencies?: string[] | undefined;
|
|
448
|
+
verificationCriteria?: string | undefined;
|
|
449
|
+
completionEvidence?: string[] | undefined;
|
|
450
|
+
}>;
|
|
451
|
+
export interface Rule {
|
|
452
|
+
id: string;
|
|
453
|
+
name: string;
|
|
454
|
+
description: string;
|
|
455
|
+
type: 'architectural' | 'coding' | 'security' | 'performance' | 'documentation';
|
|
456
|
+
severity: 'info' | 'warning' | 'error' | 'critical';
|
|
457
|
+
pattern: string;
|
|
458
|
+
message: string;
|
|
459
|
+
source: 'adr' | 'inferred' | 'user_defined';
|
|
460
|
+
sourceId?: string;
|
|
461
|
+
enabled: boolean;
|
|
462
|
+
tags?: string[];
|
|
463
|
+
}
|
|
464
|
+
export declare const RuleSchema: z.ZodObject<{
|
|
465
|
+
id: z.ZodString;
|
|
466
|
+
name: z.ZodString;
|
|
467
|
+
description: z.ZodString;
|
|
468
|
+
type: z.ZodEnum<["architectural", "coding", "security", "performance", "documentation"]>;
|
|
469
|
+
severity: z.ZodEnum<["info", "warning", "error", "critical"]>;
|
|
470
|
+
pattern: z.ZodString;
|
|
471
|
+
message: z.ZodString;
|
|
472
|
+
source: z.ZodEnum<["adr", "inferred", "user_defined"]>;
|
|
473
|
+
sourceId: z.ZodOptional<z.ZodString>;
|
|
474
|
+
enabled: z.ZodBoolean;
|
|
475
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
476
|
+
}, "strip", z.ZodTypeAny, {
|
|
477
|
+
id: string;
|
|
478
|
+
message: string;
|
|
479
|
+
type: "architectural" | "coding" | "security" | "performance" | "documentation";
|
|
480
|
+
name: string;
|
|
481
|
+
description: string;
|
|
482
|
+
source: "adr" | "inferred" | "user_defined";
|
|
483
|
+
severity: "critical" | "info" | "warning" | "error";
|
|
484
|
+
pattern: string;
|
|
485
|
+
enabled: boolean;
|
|
486
|
+
tags?: string[] | undefined;
|
|
487
|
+
sourceId?: string | undefined;
|
|
488
|
+
}, {
|
|
489
|
+
id: string;
|
|
490
|
+
message: string;
|
|
491
|
+
type: "architectural" | "coding" | "security" | "performance" | "documentation";
|
|
492
|
+
name: string;
|
|
493
|
+
description: string;
|
|
494
|
+
source: "adr" | "inferred" | "user_defined";
|
|
495
|
+
severity: "critical" | "info" | "warning" | "error";
|
|
496
|
+
pattern: string;
|
|
497
|
+
enabled: boolean;
|
|
498
|
+
tags?: string[] | undefined;
|
|
499
|
+
sourceId?: string | undefined;
|
|
500
|
+
}>;
|
|
501
|
+
export declare class McpAdrError extends Error {
|
|
502
|
+
readonly code: string;
|
|
503
|
+
readonly details?: Record<string, unknown>;
|
|
504
|
+
constructor(message: string, code: string, details?: Record<string, unknown>);
|
|
505
|
+
}
|
|
506
|
+
export declare class ValidationError extends McpAdrError {
|
|
507
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
508
|
+
}
|
|
509
|
+
export declare class FileSystemError extends McpAdrError {
|
|
510
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
511
|
+
}
|
|
512
|
+
export declare class AnalysisError extends McpAdrError {
|
|
513
|
+
constructor(message: string, details?: Record<string, unknown>);
|
|
514
|
+
}
|
|
515
|
+
export type ConfidenceLevel = 'low' | 'medium' | 'high';
|
|
516
|
+
export interface AnalysisResult<T> {
|
|
517
|
+
data: T;
|
|
518
|
+
confidence: number;
|
|
519
|
+
timestamp: string;
|
|
520
|
+
source: string;
|
|
521
|
+
warnings?: string[];
|
|
522
|
+
errors?: string[];
|
|
523
|
+
}
|
|
524
|
+
export interface CacheEntry<T> {
|
|
525
|
+
key: string;
|
|
526
|
+
data: T;
|
|
527
|
+
timestamp: string;
|
|
528
|
+
ttl: number;
|
|
529
|
+
metadata?: Record<string, unknown>;
|
|
530
|
+
}
|
|
531
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,YAAY,GAAG,YAAY,CAAC;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYpB,CAAC;AAMH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IAC1F,OAAO,CAAC,EAAE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CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC;IACR,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core TypeScript interfaces for MCP ADR Analysis Server
|
|
3
|
+
* Based on shrimp-rules.md requirements
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
export const AdrSchema = z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
title: z.string(),
|
|
9
|
+
status: z.enum(['proposed', 'accepted', 'deprecated', 'superseded']),
|
|
10
|
+
date: z.string(),
|
|
11
|
+
context: z.string(),
|
|
12
|
+
decision: z.string(),
|
|
13
|
+
consequences: z.string(),
|
|
14
|
+
implementationPlan: z.string().optional(),
|
|
15
|
+
filePath: z.string(),
|
|
16
|
+
tags: z.array(z.string()).optional(),
|
|
17
|
+
relatedAdrs: z.array(z.string()).optional(),
|
|
18
|
+
});
|
|
19
|
+
export const DetectedTechnologySchema = z.object({
|
|
20
|
+
name: z.string(),
|
|
21
|
+
category: z.enum(['framework', 'library', 'database', 'cloud', 'devops', 'language', 'tool']),
|
|
22
|
+
version: z.string().optional(),
|
|
23
|
+
confidence: z.number().min(0).max(1),
|
|
24
|
+
evidence: z.array(z.string()),
|
|
25
|
+
filePaths: z.array(z.string()),
|
|
26
|
+
description: z.string().optional(),
|
|
27
|
+
});
|
|
28
|
+
export const DetectedPatternSchema = z.object({
|
|
29
|
+
name: z.string(),
|
|
30
|
+
type: z.enum([
|
|
31
|
+
'architectural',
|
|
32
|
+
'structural',
|
|
33
|
+
'organizational',
|
|
34
|
+
'communication',
|
|
35
|
+
'testing',
|
|
36
|
+
'data',
|
|
37
|
+
]),
|
|
38
|
+
confidence: z.number().min(0).max(1),
|
|
39
|
+
description: z.string(),
|
|
40
|
+
evidence: z.array(z.string()),
|
|
41
|
+
filePaths: z.array(z.string()),
|
|
42
|
+
suboptimal: z.boolean().optional(),
|
|
43
|
+
recommendations: z.array(z.string()).optional(),
|
|
44
|
+
});
|
|
45
|
+
export const ArchitecturalKnowledgeGraphSchema = z.object({
|
|
46
|
+
projectId: z.string(),
|
|
47
|
+
timestamp: z.string(),
|
|
48
|
+
adrs: z.array(AdrSchema),
|
|
49
|
+
technologies: z.array(DetectedTechnologySchema),
|
|
50
|
+
patterns: z.array(DetectedPatternSchema),
|
|
51
|
+
rules: z.array(z.any()), // Will be defined by RuleSchema
|
|
52
|
+
relationships: z.array(z.object({
|
|
53
|
+
source: z.string(),
|
|
54
|
+
target: z.string(),
|
|
55
|
+
type: z.enum(['implements', 'depends_on', 'conflicts_with', 'supersedes', 'relates_to']),
|
|
56
|
+
strength: z.number().min(0).max(1),
|
|
57
|
+
description: z.string().optional(),
|
|
58
|
+
})),
|
|
59
|
+
metadata: z.object({
|
|
60
|
+
name: z.string(),
|
|
61
|
+
description: z.string().optional(),
|
|
62
|
+
version: z.string().optional(),
|
|
63
|
+
lastAnalyzed: z.string(),
|
|
64
|
+
analysisVersion: z.string(),
|
|
65
|
+
fileCount: z.number(),
|
|
66
|
+
directoryCount: z.number(),
|
|
67
|
+
}),
|
|
68
|
+
});
|
|
69
|
+
export const AdrTaskSchema = z.object({
|
|
70
|
+
id: z.string(),
|
|
71
|
+
adrId: z.string(),
|
|
72
|
+
title: z.string(),
|
|
73
|
+
description: z.string(),
|
|
74
|
+
status: z.enum(['pending', 'in_progress', 'completed', 'blocked']),
|
|
75
|
+
priority: z.enum(['low', 'medium', 'high', 'critical']),
|
|
76
|
+
estimatedEffort: z.string().optional(),
|
|
77
|
+
assignee: z.string().optional(),
|
|
78
|
+
dueDate: z.string().optional(),
|
|
79
|
+
dependencies: z.array(z.string()).optional(),
|
|
80
|
+
verificationCriteria: z.string().optional(),
|
|
81
|
+
completionEvidence: z.array(z.string()).optional(),
|
|
82
|
+
});
|
|
83
|
+
export const RuleSchema = z.object({
|
|
84
|
+
id: z.string(),
|
|
85
|
+
name: z.string(),
|
|
86
|
+
description: z.string(),
|
|
87
|
+
type: z.enum(['architectural', 'coding', 'security', 'performance', 'documentation']),
|
|
88
|
+
severity: z.enum(['info', 'warning', 'error', 'critical']),
|
|
89
|
+
pattern: z.string(),
|
|
90
|
+
message: z.string(),
|
|
91
|
+
source: z.enum(['adr', 'inferred', 'user_defined']),
|
|
92
|
+
sourceId: z.string().optional(),
|
|
93
|
+
enabled: z.boolean(),
|
|
94
|
+
tags: z.array(z.string()).optional(),
|
|
95
|
+
});
|
|
96
|
+
// ============================================================================
|
|
97
|
+
// Error Types
|
|
98
|
+
// ============================================================================
|
|
99
|
+
export class McpAdrError extends Error {
|
|
100
|
+
code;
|
|
101
|
+
details;
|
|
102
|
+
constructor(message, code, details) {
|
|
103
|
+
super(message);
|
|
104
|
+
this.name = 'McpAdrError';
|
|
105
|
+
this.code = code;
|
|
106
|
+
if (details !== undefined) {
|
|
107
|
+
this.details = details;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export class ValidationError extends McpAdrError {
|
|
112
|
+
constructor(message, details) {
|
|
113
|
+
super(message, 'VALIDATION_ERROR', details);
|
|
114
|
+
this.name = 'ValidationError';
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
export class FileSystemError extends McpAdrError {
|
|
118
|
+
constructor(message, details) {
|
|
119
|
+
super(message, 'FILESYSTEM_ERROR', details);
|
|
120
|
+
this.name = 'FileSystemError';
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
export class AnalysisError extends McpAdrError {
|
|
124
|
+
constructor(message, details) {
|
|
125
|
+
super(message, 'ANALYSIS_ERROR', details);
|
|
126
|
+
this.name = 'AnalysisError';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;IACpE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAgBH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,E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