@schilling.mark.a/atdd-guardian 1.0.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/CHANGELOG.md +37 -0
- package/CONTRIBUTING.md +154 -0
- package/DISTRIBUTION.md +366 -0
- package/LICENSE +21 -0
- package/QUICKSTART.md +194 -0
- package/README.md +406 -0
- package/SHARING.md +223 -0
- package/dist/constants.d.ts +19 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +38 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +72 -0
- package/dist/index.js.map +1 -0
- package/dist/schemas/tool-schemas.d.ts +404 -0
- package/dist/schemas/tool-schemas.d.ts.map +1 -0
- package/dist/schemas/tool-schemas.js +267 -0
- package/dist/schemas/tool-schemas.js.map +1 -0
- package/dist/services/context-review.d.ts +65 -0
- package/dist/services/context-review.d.ts.map +1 -0
- package/dist/services/context-review.js +300 -0
- package/dist/services/context-review.js.map +1 -0
- package/dist/services/formatter.d.ts +10 -0
- package/dist/services/formatter.d.ts.map +1 -0
- package/dist/services/formatter.js +173 -0
- package/dist/services/formatter.js.map +1 -0
- package/dist/services/phase-gate.d.ts +38 -0
- package/dist/services/phase-gate.d.ts.map +1 -0
- package/dist/services/phase-gate.js +309 -0
- package/dist/services/phase-gate.js.map +1 -0
- package/dist/services/review-engine.d.ts +26 -0
- package/dist/services/review-engine.d.ts.map +1 -0
- package/dist/services/review-engine.js +235 -0
- package/dist/services/review-engine.js.map +1 -0
- package/dist/services/rule-loader.d.ts +19 -0
- package/dist/services/rule-loader.d.ts.map +1 -0
- package/dist/services/rule-loader.js +91 -0
- package/dist/services/rule-loader.js.map +1 -0
- package/dist/services/session-manager.d.ts +75 -0
- package/dist/services/session-manager.d.ts.map +1 -0
- package/dist/services/session-manager.js +244 -0
- package/dist/services/session-manager.js.map +1 -0
- package/dist/services/test-runner.d.ts +53 -0
- package/dist/services/test-runner.d.ts.map +1 -0
- package/dist/services/test-runner.js +199 -0
- package/dist/services/test-runner.js.map +1 -0
- package/dist/tools/review-tools.d.ts +26 -0
- package/dist/tools/review-tools.d.ts.map +1 -0
- package/dist/tools/review-tools.js +904 -0
- package/dist/tools/review-tools.js.map +1 -0
- package/dist/types.d.ts +339 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +13 -0
- package/dist/types.js.map +1 -0
- package/examples/README.md +119 -0
- package/examples/mcp-config.json +11 -0
- package/examples/test-config.json +7 -0
- package/package.json +48 -0
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schemas for MCP Tool Inputs (v2 — Context-Aware)
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
export declare const StartFeatureInputSchema: z.ZodObject<{
|
|
6
|
+
projectRoot: z.ZodString;
|
|
7
|
+
storyId: z.ZodString;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
acceptanceCriteria: z.ZodArray<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
text: z.ZodString;
|
|
13
|
+
testStatus: z.ZodDefault<z.ZodEnum<["no-test", "red", "green", "skipped"]>>;
|
|
14
|
+
testFile: z.ZodOptional<z.ZodString>;
|
|
15
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
16
|
+
unitCycles: z.ZodDefault<z.ZodArray<z.ZodAny, "many">>;
|
|
17
|
+
}, "strip", z.ZodTypeAny, {
|
|
18
|
+
id: string;
|
|
19
|
+
text: string;
|
|
20
|
+
testStatus: "no-test" | "red" | "green" | "skipped";
|
|
21
|
+
unitCycles: any[];
|
|
22
|
+
testFile?: string | undefined;
|
|
23
|
+
notes?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
id: string;
|
|
26
|
+
text: string;
|
|
27
|
+
testStatus?: "no-test" | "red" | "green" | "skipped" | undefined;
|
|
28
|
+
testFile?: string | undefined;
|
|
29
|
+
notes?: string | undefined;
|
|
30
|
+
unitCycles?: any[] | undefined;
|
|
31
|
+
}>, "many">;
|
|
32
|
+
architectureDecisions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
decision: z.ZodString;
|
|
35
|
+
rationale: z.ZodString;
|
|
36
|
+
implications: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
decidedBy: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
id: string;
|
|
40
|
+
decision: string;
|
|
41
|
+
rationale: string;
|
|
42
|
+
implications: string[];
|
|
43
|
+
decidedBy?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
id: string;
|
|
46
|
+
decision: string;
|
|
47
|
+
rationale: string;
|
|
48
|
+
implications: string[];
|
|
49
|
+
decidedBy?: string | undefined;
|
|
50
|
+
}>, "many">>;
|
|
51
|
+
affectedModules: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
52
|
+
expectedFiles: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
53
|
+
path: z.ZodString;
|
|
54
|
+
purpose: z.ZodString;
|
|
55
|
+
fileType: z.ZodDefault<z.ZodEnum<["component", "service", "model", "spec", "e2e", "page-object", "step-def", "module", "pipe", "guard", "interceptor", "directive", "other"]>>;
|
|
56
|
+
status: z.ZodDefault<z.ZodEnum<["planned", "created", "modified", "reviewed"]>>;
|
|
57
|
+
relatedDecisions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
path: string;
|
|
60
|
+
status: "planned" | "created" | "modified" | "reviewed";
|
|
61
|
+
purpose: string;
|
|
62
|
+
fileType: "component" | "service" | "model" | "spec" | "e2e" | "page-object" | "step-def" | "module" | "pipe" | "guard" | "interceptor" | "directive" | "other";
|
|
63
|
+
relatedDecisions?: string[] | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
path: string;
|
|
66
|
+
purpose: string;
|
|
67
|
+
status?: "planned" | "created" | "modified" | "reviewed" | undefined;
|
|
68
|
+
fileType?: "component" | "service" | "model" | "spec" | "e2e" | "page-object" | "step-def" | "module" | "pipe" | "guard" | "interceptor" | "directive" | "other" | undefined;
|
|
69
|
+
relatedDecisions?: string[] | undefined;
|
|
70
|
+
}>, "many">>;
|
|
71
|
+
definitionOfDone: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
72
|
+
id: z.ZodString;
|
|
73
|
+
text: z.ZodString;
|
|
74
|
+
completed: z.ZodDefault<z.ZodBoolean>;
|
|
75
|
+
automatable: z.ZodDefault<z.ZodBoolean>;
|
|
76
|
+
automatedBy: z.ZodOptional<z.ZodString>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
id: string;
|
|
79
|
+
text: string;
|
|
80
|
+
completed: boolean;
|
|
81
|
+
automatable: boolean;
|
|
82
|
+
automatedBy?: string | undefined;
|
|
83
|
+
}, {
|
|
84
|
+
id: string;
|
|
85
|
+
text: string;
|
|
86
|
+
completed?: boolean | undefined;
|
|
87
|
+
automatable?: boolean | undefined;
|
|
88
|
+
automatedBy?: string | undefined;
|
|
89
|
+
}>, "many">>;
|
|
90
|
+
reviewers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
labels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
92
|
+
}, "strict", z.ZodTypeAny, {
|
|
93
|
+
projectRoot: string;
|
|
94
|
+
storyId: string;
|
|
95
|
+
title: string;
|
|
96
|
+
description: string;
|
|
97
|
+
acceptanceCriteria: {
|
|
98
|
+
id: string;
|
|
99
|
+
text: string;
|
|
100
|
+
testStatus: "no-test" | "red" | "green" | "skipped";
|
|
101
|
+
unitCycles: any[];
|
|
102
|
+
testFile?: string | undefined;
|
|
103
|
+
notes?: string | undefined;
|
|
104
|
+
}[];
|
|
105
|
+
architectureDecisions: {
|
|
106
|
+
id: string;
|
|
107
|
+
decision: string;
|
|
108
|
+
rationale: string;
|
|
109
|
+
implications: string[];
|
|
110
|
+
decidedBy?: string | undefined;
|
|
111
|
+
}[];
|
|
112
|
+
affectedModules: string[];
|
|
113
|
+
expectedFiles: {
|
|
114
|
+
path: string;
|
|
115
|
+
status: "planned" | "created" | "modified" | "reviewed";
|
|
116
|
+
purpose: string;
|
|
117
|
+
fileType: "component" | "service" | "model" | "spec" | "e2e" | "page-object" | "step-def" | "module" | "pipe" | "guard" | "interceptor" | "directive" | "other";
|
|
118
|
+
relatedDecisions?: string[] | undefined;
|
|
119
|
+
}[];
|
|
120
|
+
definitionOfDone: {
|
|
121
|
+
id: string;
|
|
122
|
+
text: string;
|
|
123
|
+
completed: boolean;
|
|
124
|
+
automatable: boolean;
|
|
125
|
+
automatedBy?: string | undefined;
|
|
126
|
+
}[];
|
|
127
|
+
reviewers?: string[] | undefined;
|
|
128
|
+
labels?: string[] | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
projectRoot: string;
|
|
131
|
+
storyId: string;
|
|
132
|
+
title: string;
|
|
133
|
+
description: string;
|
|
134
|
+
acceptanceCriteria: {
|
|
135
|
+
id: string;
|
|
136
|
+
text: string;
|
|
137
|
+
testStatus?: "no-test" | "red" | "green" | "skipped" | undefined;
|
|
138
|
+
testFile?: string | undefined;
|
|
139
|
+
notes?: string | undefined;
|
|
140
|
+
unitCycles?: any[] | undefined;
|
|
141
|
+
}[];
|
|
142
|
+
architectureDecisions?: {
|
|
143
|
+
id: string;
|
|
144
|
+
decision: string;
|
|
145
|
+
rationale: string;
|
|
146
|
+
implications: string[];
|
|
147
|
+
decidedBy?: string | undefined;
|
|
148
|
+
}[] | undefined;
|
|
149
|
+
affectedModules?: string[] | undefined;
|
|
150
|
+
expectedFiles?: {
|
|
151
|
+
path: string;
|
|
152
|
+
purpose: string;
|
|
153
|
+
status?: "planned" | "created" | "modified" | "reviewed" | undefined;
|
|
154
|
+
fileType?: "component" | "service" | "model" | "spec" | "e2e" | "page-object" | "step-def" | "module" | "pipe" | "guard" | "interceptor" | "directive" | "other" | undefined;
|
|
155
|
+
relatedDecisions?: string[] | undefined;
|
|
156
|
+
}[] | undefined;
|
|
157
|
+
definitionOfDone?: {
|
|
158
|
+
id: string;
|
|
159
|
+
text: string;
|
|
160
|
+
completed?: boolean | undefined;
|
|
161
|
+
automatable?: boolean | undefined;
|
|
162
|
+
automatedBy?: string | undefined;
|
|
163
|
+
}[] | undefined;
|
|
164
|
+
reviewers?: string[] | undefined;
|
|
165
|
+
labels?: string[] | undefined;
|
|
166
|
+
}>;
|
|
167
|
+
export type StartFeatureInput = z.infer<typeof StartFeatureInputSchema>;
|
|
168
|
+
export declare const AdvancePhaseInputSchema: z.ZodObject<{
|
|
169
|
+
projectRoot: z.ZodString;
|
|
170
|
+
phase: z.ZodEnum<["requirements", "test-design", "implementation", "refactor", "pre-pr-review", "pr-submitted", "pr-feedback", "done"]>;
|
|
171
|
+
}, "strict", z.ZodTypeAny, {
|
|
172
|
+
projectRoot: string;
|
|
173
|
+
phase: "requirements" | "test-design" | "implementation" | "refactor" | "pre-pr-review" | "pr-submitted" | "pr-feedback" | "done";
|
|
174
|
+
}, {
|
|
175
|
+
projectRoot: string;
|
|
176
|
+
phase: "requirements" | "test-design" | "implementation" | "refactor" | "pre-pr-review" | "pr-submitted" | "pr-feedback" | "done";
|
|
177
|
+
}>;
|
|
178
|
+
export type AdvancePhaseInput = z.infer<typeof AdvancePhaseInputSchema>;
|
|
179
|
+
export declare const UpdateCriterionInputSchema: z.ZodObject<{
|
|
180
|
+
projectRoot: z.ZodString;
|
|
181
|
+
criterionId: z.ZodString;
|
|
182
|
+
testStatus: z.ZodEnum<["no-test", "red", "green", "skipped"]>;
|
|
183
|
+
testFile: z.ZodOptional<z.ZodString>;
|
|
184
|
+
}, "strict", z.ZodTypeAny, {
|
|
185
|
+
testStatus: "no-test" | "red" | "green" | "skipped";
|
|
186
|
+
projectRoot: string;
|
|
187
|
+
criterionId: string;
|
|
188
|
+
testFile?: string | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
testStatus: "no-test" | "red" | "green" | "skipped";
|
|
191
|
+
projectRoot: string;
|
|
192
|
+
criterionId: string;
|
|
193
|
+
testFile?: string | undefined;
|
|
194
|
+
}>;
|
|
195
|
+
export type UpdateCriterionInput = z.infer<typeof UpdateCriterionInputSchema>;
|
|
196
|
+
export declare const ReviewCodeInputSchema: z.ZodObject<{
|
|
197
|
+
directory: z.ZodString;
|
|
198
|
+
rulesFile: z.ZodOptional<z.ZodString>;
|
|
199
|
+
includePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
200
|
+
excludePatterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
201
|
+
severityFilter: z.ZodOptional<z.ZodArray<z.ZodEnum<["error", "warning", "info"]>, "many">>;
|
|
202
|
+
categoryFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
203
|
+
format: z.ZodDefault<z.ZodEnum<["markdown", "json"]>>;
|
|
204
|
+
}, "strict", z.ZodTypeAny, {
|
|
205
|
+
directory: string;
|
|
206
|
+
format: "markdown" | "json";
|
|
207
|
+
rulesFile?: string | undefined;
|
|
208
|
+
includePatterns?: string[] | undefined;
|
|
209
|
+
excludePatterns?: string[] | undefined;
|
|
210
|
+
severityFilter?: ("error" | "warning" | "info")[] | undefined;
|
|
211
|
+
categoryFilter?: string[] | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
directory: string;
|
|
214
|
+
rulesFile?: string | undefined;
|
|
215
|
+
includePatterns?: string[] | undefined;
|
|
216
|
+
excludePatterns?: string[] | undefined;
|
|
217
|
+
severityFilter?: ("error" | "warning" | "info")[] | undefined;
|
|
218
|
+
categoryFilter?: string[] | undefined;
|
|
219
|
+
format?: "markdown" | "json" | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
export type ReviewCodeInput = z.infer<typeof ReviewCodeInputSchema>;
|
|
222
|
+
export declare const ReviewFileInputSchema: z.ZodObject<{
|
|
223
|
+
filePath: z.ZodString;
|
|
224
|
+
projectRoot: z.ZodString;
|
|
225
|
+
rulesFile: z.ZodOptional<z.ZodString>;
|
|
226
|
+
format: z.ZodDefault<z.ZodEnum<["markdown", "json"]>>;
|
|
227
|
+
}, "strict", z.ZodTypeAny, {
|
|
228
|
+
projectRoot: string;
|
|
229
|
+
format: "markdown" | "json";
|
|
230
|
+
filePath: string;
|
|
231
|
+
rulesFile?: string | undefined;
|
|
232
|
+
}, {
|
|
233
|
+
projectRoot: string;
|
|
234
|
+
filePath: string;
|
|
235
|
+
rulesFile?: string | undefined;
|
|
236
|
+
format?: "markdown" | "json" | undefined;
|
|
237
|
+
}>;
|
|
238
|
+
export type ReviewFileInput = z.infer<typeof ReviewFileInputSchema>;
|
|
239
|
+
export declare const GetContextInputSchema: z.ZodObject<{
|
|
240
|
+
projectRoot: z.ZodString;
|
|
241
|
+
}, "strict", z.ZodTypeAny, {
|
|
242
|
+
projectRoot: string;
|
|
243
|
+
}, {
|
|
244
|
+
projectRoot: string;
|
|
245
|
+
}>;
|
|
246
|
+
export type GetContextInput = z.infer<typeof GetContextInputSchema>;
|
|
247
|
+
export declare const ListRulesInputSchema: z.ZodObject<{
|
|
248
|
+
rulesFile: z.ZodOptional<z.ZodString>;
|
|
249
|
+
category: z.ZodOptional<z.ZodString>;
|
|
250
|
+
}, "strict", z.ZodTypeAny, {
|
|
251
|
+
rulesFile?: string | undefined;
|
|
252
|
+
category?: string | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
rulesFile?: string | undefined;
|
|
255
|
+
category?: string | undefined;
|
|
256
|
+
}>;
|
|
257
|
+
export type ListRulesInput = z.infer<typeof ListRulesInputSchema>;
|
|
258
|
+
export declare const ExplainRuleInputSchema: z.ZodObject<{
|
|
259
|
+
ruleId: z.ZodString;
|
|
260
|
+
rulesFile: z.ZodOptional<z.ZodString>;
|
|
261
|
+
}, "strict", z.ZodTypeAny, {
|
|
262
|
+
ruleId: string;
|
|
263
|
+
rulesFile?: string | undefined;
|
|
264
|
+
}, {
|
|
265
|
+
ruleId: string;
|
|
266
|
+
rulesFile?: string | undefined;
|
|
267
|
+
}>;
|
|
268
|
+
export type ExplainRuleInput = z.infer<typeof ExplainRuleInputSchema>;
|
|
269
|
+
export declare const AddRuleInputSchema: z.ZodObject<{
|
|
270
|
+
rulesFile: z.ZodString;
|
|
271
|
+
id: z.ZodString;
|
|
272
|
+
name: z.ZodString;
|
|
273
|
+
category: z.ZodString;
|
|
274
|
+
severity: z.ZodEnum<["error", "warning", "info"]>;
|
|
275
|
+
description: z.ZodString;
|
|
276
|
+
applicablePhases: z.ZodDefault<z.ZodArray<z.ZodEnum<["requirements", "test-design", "implementation", "refactor", "pre-pr-review", "pr-submitted", "pr-feedback", "done"]>, "many">>;
|
|
277
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
278
|
+
matchIsViolation: z.ZodBoolean;
|
|
279
|
+
appliesTo: z.ZodArray<z.ZodString, "many">;
|
|
280
|
+
excludes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
281
|
+
suggestion: z.ZodString;
|
|
282
|
+
goodExample: z.ZodOptional<z.ZodString>;
|
|
283
|
+
badExample: z.ZodOptional<z.ZodString>;
|
|
284
|
+
}, "strict", z.ZodTypeAny, {
|
|
285
|
+
id: string;
|
|
286
|
+
description: string;
|
|
287
|
+
rulesFile: string;
|
|
288
|
+
category: string;
|
|
289
|
+
name: string;
|
|
290
|
+
severity: "error" | "warning" | "info";
|
|
291
|
+
applicablePhases: ("requirements" | "test-design" | "implementation" | "refactor" | "pre-pr-review" | "pr-submitted" | "pr-feedback" | "done")[];
|
|
292
|
+
matchIsViolation: boolean;
|
|
293
|
+
appliesTo: string[];
|
|
294
|
+
suggestion: string;
|
|
295
|
+
pattern?: string | undefined;
|
|
296
|
+
excludes?: string[] | undefined;
|
|
297
|
+
goodExample?: string | undefined;
|
|
298
|
+
badExample?: string | undefined;
|
|
299
|
+
}, {
|
|
300
|
+
id: string;
|
|
301
|
+
description: string;
|
|
302
|
+
rulesFile: string;
|
|
303
|
+
category: string;
|
|
304
|
+
name: string;
|
|
305
|
+
severity: "error" | "warning" | "info";
|
|
306
|
+
matchIsViolation: boolean;
|
|
307
|
+
appliesTo: string[];
|
|
308
|
+
suggestion: string;
|
|
309
|
+
applicablePhases?: ("requirements" | "test-design" | "implementation" | "refactor" | "pre-pr-review" | "pr-submitted" | "pr-feedback" | "done")[] | undefined;
|
|
310
|
+
pattern?: string | undefined;
|
|
311
|
+
excludes?: string[] | undefined;
|
|
312
|
+
goodExample?: string | undefined;
|
|
313
|
+
badExample?: string | undefined;
|
|
314
|
+
}>;
|
|
315
|
+
export type AddRuleInput = z.infer<typeof AddRuleInputSchema>;
|
|
316
|
+
export declare const RecordPrFeedbackInputSchema: z.ZodObject<{
|
|
317
|
+
projectRoot: z.ZodString;
|
|
318
|
+
feedback: z.ZodArray<z.ZodString, "many">;
|
|
319
|
+
notes: z.ZodDefault<z.ZodString>;
|
|
320
|
+
}, "strict", z.ZodTypeAny, {
|
|
321
|
+
notes: string;
|
|
322
|
+
projectRoot: string;
|
|
323
|
+
feedback: string[];
|
|
324
|
+
}, {
|
|
325
|
+
projectRoot: string;
|
|
326
|
+
feedback: string[];
|
|
327
|
+
notes?: string | undefined;
|
|
328
|
+
}>;
|
|
329
|
+
export type RecordPrFeedbackInput = z.infer<typeof RecordPrFeedbackInputSchema>;
|
|
330
|
+
export declare const StartUnitCycleInputSchema: z.ZodObject<{
|
|
331
|
+
projectRoot: z.ZodString;
|
|
332
|
+
criterionId: z.ZodString;
|
|
333
|
+
unitDescription: z.ZodString;
|
|
334
|
+
testFile: z.ZodString;
|
|
335
|
+
sourceFile: z.ZodString;
|
|
336
|
+
}, "strict", z.ZodTypeAny, {
|
|
337
|
+
testFile: string;
|
|
338
|
+
projectRoot: string;
|
|
339
|
+
criterionId: string;
|
|
340
|
+
unitDescription: string;
|
|
341
|
+
sourceFile: string;
|
|
342
|
+
}, {
|
|
343
|
+
testFile: string;
|
|
344
|
+
projectRoot: string;
|
|
345
|
+
criterionId: string;
|
|
346
|
+
unitDescription: string;
|
|
347
|
+
sourceFile: string;
|
|
348
|
+
}>;
|
|
349
|
+
export type StartUnitCycleInput = z.infer<typeof StartUnitCycleInputSchema>;
|
|
350
|
+
export declare const AdvanceUnitCycleInputSchema: z.ZodObject<{
|
|
351
|
+
projectRoot: z.ZodString;
|
|
352
|
+
criterionId: z.ZodString;
|
|
353
|
+
cycleNumber: z.ZodNumber;
|
|
354
|
+
targetState: z.ZodEnum<["green", "refactored", "abandoned"]>;
|
|
355
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
356
|
+
}, "strict", z.ZodTypeAny, {
|
|
357
|
+
projectRoot: string;
|
|
358
|
+
criterionId: string;
|
|
359
|
+
cycleNumber: number;
|
|
360
|
+
targetState: "green" | "refactored" | "abandoned";
|
|
361
|
+
notes?: string | undefined;
|
|
362
|
+
}, {
|
|
363
|
+
projectRoot: string;
|
|
364
|
+
criterionId: string;
|
|
365
|
+
cycleNumber: number;
|
|
366
|
+
targetState: "green" | "refactored" | "abandoned";
|
|
367
|
+
notes?: string | undefined;
|
|
368
|
+
}>;
|
|
369
|
+
export type AdvanceUnitCycleInput = z.infer<typeof AdvanceUnitCycleInputSchema>;
|
|
370
|
+
export declare const RunTestsInputSchema: z.ZodObject<{
|
|
371
|
+
projectRoot: z.ZodString;
|
|
372
|
+
testLevel: z.ZodEnum<["acceptance", "unit", "all"]>;
|
|
373
|
+
command: z.ZodOptional<z.ZodString>;
|
|
374
|
+
testFile: z.ZodOptional<z.ZodString>;
|
|
375
|
+
relatedCriterionId: z.ZodOptional<z.ZodString>;
|
|
376
|
+
relatedUnitCycle: z.ZodOptional<z.ZodNumber>;
|
|
377
|
+
}, "strict", z.ZodTypeAny, {
|
|
378
|
+
projectRoot: string;
|
|
379
|
+
testLevel: "acceptance" | "unit" | "all";
|
|
380
|
+
testFile?: string | undefined;
|
|
381
|
+
command?: string | undefined;
|
|
382
|
+
relatedCriterionId?: string | undefined;
|
|
383
|
+
relatedUnitCycle?: number | undefined;
|
|
384
|
+
}, {
|
|
385
|
+
projectRoot: string;
|
|
386
|
+
testLevel: "acceptance" | "unit" | "all";
|
|
387
|
+
testFile?: string | undefined;
|
|
388
|
+
command?: string | undefined;
|
|
389
|
+
relatedCriterionId?: string | undefined;
|
|
390
|
+
relatedUnitCycle?: number | undefined;
|
|
391
|
+
}>;
|
|
392
|
+
export type RunTestsInput = z.infer<typeof RunTestsInputSchema>;
|
|
393
|
+
export declare const GetTddStatusInputSchema: z.ZodObject<{
|
|
394
|
+
projectRoot: z.ZodString;
|
|
395
|
+
criterionId: z.ZodOptional<z.ZodString>;
|
|
396
|
+
}, "strict", z.ZodTypeAny, {
|
|
397
|
+
projectRoot: string;
|
|
398
|
+
criterionId?: string | undefined;
|
|
399
|
+
}, {
|
|
400
|
+
projectRoot: string;
|
|
401
|
+
criterionId?: string | undefined;
|
|
402
|
+
}>;
|
|
403
|
+
export type GetTddStatusInput = z.infer<typeof GetTddStatusInputSchema>;
|
|
404
|
+
//# sourceMappingURL=tool-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../src/schemas/tool-schemas.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkExB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BzB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,uBAAuB;;;;;;;;;EAKzB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;EAO5B,CAAC;AAEZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAM9E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;EAOvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,qBAAqB;;;;;;EAIvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,oBAAoB;;;;;;;;;EAKtB,CAAC;AAEZ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,sBAAsB;;;;;;;;;EAKxB,CAAC;AAEZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBpB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,2BAA2B;;;;;;;;;;;;EAS7B,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAoB3B,CAAC;AAEZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;EAa7B,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;EAuBrB,CAAC;AAEZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE,eAAO,MAAM,uBAAuB;;;;;;;;;EAQzB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod Schemas for MCP Tool Inputs (v2 — Context-Aware)
|
|
3
|
+
*/
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
// ─── Shared enums ────────────────────────────────────────────────
|
|
6
|
+
const AtddPhaseEnum = z.enum([
|
|
7
|
+
"requirements",
|
|
8
|
+
"test-design",
|
|
9
|
+
"implementation",
|
|
10
|
+
"refactor",
|
|
11
|
+
"pre-pr-review",
|
|
12
|
+
"pr-submitted",
|
|
13
|
+
"pr-feedback",
|
|
14
|
+
"done",
|
|
15
|
+
]);
|
|
16
|
+
const SeverityEnum = z.enum(["error", "warning", "info"]);
|
|
17
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
18
|
+
// start_feature — Set the story context for everything that follows
|
|
19
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
20
|
+
const AcceptanceCriterionSchema = z.object({
|
|
21
|
+
id: z.string().describe("Unique AC id, e.g. 'AC-1'"),
|
|
22
|
+
text: z.string().describe("The criterion in Given/When/Then or plain language"),
|
|
23
|
+
testStatus: z
|
|
24
|
+
.enum(["no-test", "red", "green", "skipped"])
|
|
25
|
+
.default("no-test"),
|
|
26
|
+
testFile: z.string().optional(),
|
|
27
|
+
notes: z.string().optional(),
|
|
28
|
+
unitCycles: z.array(z.any()).default([]).describe("Managed by start_unit_cycle / advance_unit_cycle tools"),
|
|
29
|
+
});
|
|
30
|
+
const ArchitectureDecisionSchema = z.object({
|
|
31
|
+
id: z.string().describe("Decision id, e.g. 'AD-1'"),
|
|
32
|
+
decision: z.string().describe("What was decided"),
|
|
33
|
+
rationale: z.string().describe("Why"),
|
|
34
|
+
implications: z
|
|
35
|
+
.array(z.string())
|
|
36
|
+
.describe("What this means for implementation"),
|
|
37
|
+
decidedBy: z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
const ExpectedFileSchema = z.object({
|
|
40
|
+
path: z.string().describe("Relative path from project root"),
|
|
41
|
+
purpose: z.string().describe("What this file should contain"),
|
|
42
|
+
fileType: z
|
|
43
|
+
.enum([
|
|
44
|
+
"component", "service", "model", "spec", "e2e",
|
|
45
|
+
"page-object", "step-def", "module", "pipe",
|
|
46
|
+
"guard", "interceptor", "directive", "other",
|
|
47
|
+
])
|
|
48
|
+
.default("other"),
|
|
49
|
+
status: z
|
|
50
|
+
.enum(["planned", "created", "modified", "reviewed"])
|
|
51
|
+
.default("planned"),
|
|
52
|
+
relatedDecisions: z.array(z.string()).optional(),
|
|
53
|
+
});
|
|
54
|
+
const DodItemSchema = z.object({
|
|
55
|
+
id: z.string(),
|
|
56
|
+
text: z.string(),
|
|
57
|
+
completed: z.boolean().default(false),
|
|
58
|
+
automatable: z.boolean().default(false),
|
|
59
|
+
automatedBy: z.string().optional(),
|
|
60
|
+
});
|
|
61
|
+
export const StartFeatureInputSchema = z
|
|
62
|
+
.object({
|
|
63
|
+
projectRoot: z.string().min(1).describe("Absolute path to project root"),
|
|
64
|
+
storyId: z.string().min(1).describe("Jira/ADO story ID, e.g. 'PROJ-1234'"),
|
|
65
|
+
title: z.string().min(1).describe("Story title"),
|
|
66
|
+
description: z.string().describe("Full story description or user story text"),
|
|
67
|
+
acceptanceCriteria: z
|
|
68
|
+
.array(AcceptanceCriterionSchema)
|
|
69
|
+
.min(1)
|
|
70
|
+
.describe("Acceptance criteria — these drive what gets tested and reviewed"),
|
|
71
|
+
architectureDecisions: z
|
|
72
|
+
.array(ArchitectureDecisionSchema)
|
|
73
|
+
.default([])
|
|
74
|
+
.describe("Architecture decisions made for this feature"),
|
|
75
|
+
affectedModules: z
|
|
76
|
+
.array(z.string())
|
|
77
|
+
.default([])
|
|
78
|
+
.describe("Module paths affected by this feature"),
|
|
79
|
+
expectedFiles: z
|
|
80
|
+
.array(ExpectedFileSchema)
|
|
81
|
+
.default([])
|
|
82
|
+
.describe("Files expected to be created or modified"),
|
|
83
|
+
definitionOfDone: z
|
|
84
|
+
.array(DodItemSchema)
|
|
85
|
+
.default([])
|
|
86
|
+
.describe("DoD checklist items"),
|
|
87
|
+
reviewers: z.array(z.string()).optional(),
|
|
88
|
+
labels: z.array(z.string()).optional(),
|
|
89
|
+
})
|
|
90
|
+
.strict();
|
|
91
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
92
|
+
// advance_phase — Move to next ATDD phase
|
|
93
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
94
|
+
export const AdvancePhaseInputSchema = z
|
|
95
|
+
.object({
|
|
96
|
+
projectRoot: z.string().min(1),
|
|
97
|
+
phase: AtddPhaseEnum.describe("The ATDD phase to advance to"),
|
|
98
|
+
})
|
|
99
|
+
.strict();
|
|
100
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
101
|
+
// update_criterion — Update AC test status
|
|
102
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
103
|
+
export const UpdateCriterionInputSchema = z
|
|
104
|
+
.object({
|
|
105
|
+
projectRoot: z.string().min(1),
|
|
106
|
+
criterionId: z.string().min(1).describe("AC id to update, e.g. 'AC-1'"),
|
|
107
|
+
testStatus: z.enum(["no-test", "red", "green", "skipped"]),
|
|
108
|
+
testFile: z.string().optional().describe("Path to the test file covering this AC"),
|
|
109
|
+
})
|
|
110
|
+
.strict();
|
|
111
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
112
|
+
// review_code — Context-aware full review
|
|
113
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
114
|
+
export const ReviewCodeInputSchema = z
|
|
115
|
+
.object({
|
|
116
|
+
directory: z.string().min(1).describe("Absolute path to project root"),
|
|
117
|
+
rulesFile: z.string().optional(),
|
|
118
|
+
includePatterns: z.array(z.string()).optional(),
|
|
119
|
+
excludePatterns: z.array(z.string()).optional(),
|
|
120
|
+
severityFilter: z.array(SeverityEnum).optional(),
|
|
121
|
+
categoryFilter: z.array(z.string()).optional(),
|
|
122
|
+
format: z.enum(["markdown", "json"]).default("markdown"),
|
|
123
|
+
})
|
|
124
|
+
.strict();
|
|
125
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
126
|
+
// review_file — Quick single-file review
|
|
127
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
128
|
+
export const ReviewFileInputSchema = z
|
|
129
|
+
.object({
|
|
130
|
+
filePath: z.string().min(1),
|
|
131
|
+
projectRoot: z.string().min(1),
|
|
132
|
+
rulesFile: z.string().optional(),
|
|
133
|
+
format: z.enum(["markdown", "json"]).default("markdown"),
|
|
134
|
+
})
|
|
135
|
+
.strict();
|
|
136
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
137
|
+
// get_context — Show current feature context and workflow state
|
|
138
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
139
|
+
export const GetContextInputSchema = z
|
|
140
|
+
.object({
|
|
141
|
+
projectRoot: z.string().min(1),
|
|
142
|
+
})
|
|
143
|
+
.strict();
|
|
144
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
145
|
+
// list_rules / explain_rule / add_rule (unchanged from v1)
|
|
146
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
147
|
+
export const ListRulesInputSchema = z
|
|
148
|
+
.object({
|
|
149
|
+
rulesFile: z.string().optional(),
|
|
150
|
+
category: z.string().optional(),
|
|
151
|
+
})
|
|
152
|
+
.strict();
|
|
153
|
+
export const ExplainRuleInputSchema = z
|
|
154
|
+
.object({
|
|
155
|
+
ruleId: z.string().min(1),
|
|
156
|
+
rulesFile: z.string().optional(),
|
|
157
|
+
})
|
|
158
|
+
.strict();
|
|
159
|
+
export const AddRuleInputSchema = z
|
|
160
|
+
.object({
|
|
161
|
+
rulesFile: z.string().min(1),
|
|
162
|
+
id: z.string().min(1),
|
|
163
|
+
name: z.string().min(1),
|
|
164
|
+
category: z.string().min(1),
|
|
165
|
+
severity: SeverityEnum,
|
|
166
|
+
description: z.string().min(1),
|
|
167
|
+
applicablePhases: z.array(AtddPhaseEnum).default(["pre-pr-review"]),
|
|
168
|
+
pattern: z.string().optional(),
|
|
169
|
+
matchIsViolation: z.boolean(),
|
|
170
|
+
appliesTo: z.array(z.string()).min(1),
|
|
171
|
+
excludes: z.array(z.string()).optional(),
|
|
172
|
+
suggestion: z.string().min(1),
|
|
173
|
+
goodExample: z.string().optional(),
|
|
174
|
+
badExample: z.string().optional(),
|
|
175
|
+
})
|
|
176
|
+
.strict();
|
|
177
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
178
|
+
// record_pr_feedback — PDCA Check phase
|
|
179
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
180
|
+
export const RecordPrFeedbackInputSchema = z
|
|
181
|
+
.object({
|
|
182
|
+
projectRoot: z.string().min(1),
|
|
183
|
+
feedback: z
|
|
184
|
+
.array(z.string())
|
|
185
|
+
.min(1)
|
|
186
|
+
.describe("List of PR rejection reasons or reviewer comments"),
|
|
187
|
+
notes: z.string().default("").describe("Additional notes about the feedback"),
|
|
188
|
+
})
|
|
189
|
+
.strict();
|
|
190
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
191
|
+
// start_unit_cycle / advance_unit_cycle — Track nested unit TDD RED→GREEN→REFACTOR
|
|
192
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
193
|
+
export const StartUnitCycleInputSchema = z
|
|
194
|
+
.object({
|
|
195
|
+
projectRoot: z.string().min(1),
|
|
196
|
+
criterionId: z
|
|
197
|
+
.string()
|
|
198
|
+
.min(1)
|
|
199
|
+
.describe("AC id this unit cycle belongs to, e.g. 'AC-1'"),
|
|
200
|
+
unitDescription: z
|
|
201
|
+
.string()
|
|
202
|
+
.min(1)
|
|
203
|
+
.describe("What unit of behavior is being implemented, e.g. 'validate email format'"),
|
|
204
|
+
testFile: z
|
|
205
|
+
.string()
|
|
206
|
+
.min(1)
|
|
207
|
+
.describe("Path to the unit test file"),
|
|
208
|
+
sourceFile: z
|
|
209
|
+
.string()
|
|
210
|
+
.min(1)
|
|
211
|
+
.describe("Path to the production code file"),
|
|
212
|
+
})
|
|
213
|
+
.strict();
|
|
214
|
+
export const AdvanceUnitCycleInputSchema = z
|
|
215
|
+
.object({
|
|
216
|
+
projectRoot: z.string().min(1),
|
|
217
|
+
criterionId: z.string().min(1).describe("AC id"),
|
|
218
|
+
cycleNumber: z.number().int().min(1).describe("Unit cycle number"),
|
|
219
|
+
targetState: z
|
|
220
|
+
.enum(["green", "refactored", "abandoned"])
|
|
221
|
+
.describe("State to advance to: red→green→refactored, or abandoned"),
|
|
222
|
+
notes: z
|
|
223
|
+
.string()
|
|
224
|
+
.optional()
|
|
225
|
+
.describe("Refactoring notes or abandonment reason"),
|
|
226
|
+
})
|
|
227
|
+
.strict();
|
|
228
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
229
|
+
// run_tests — Execute tests and capture results
|
|
230
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
231
|
+
export const RunTestsInputSchema = z
|
|
232
|
+
.object({
|
|
233
|
+
projectRoot: z.string().min(1),
|
|
234
|
+
testLevel: z
|
|
235
|
+
.enum(["acceptance", "unit", "all"])
|
|
236
|
+
.describe("Which tests to run"),
|
|
237
|
+
command: z
|
|
238
|
+
.string()
|
|
239
|
+
.optional()
|
|
240
|
+
.describe("Override the test command (uses config defaults otherwise)"),
|
|
241
|
+
testFile: z
|
|
242
|
+
.string()
|
|
243
|
+
.optional()
|
|
244
|
+
.describe("Run a specific test file"),
|
|
245
|
+
relatedCriterionId: z
|
|
246
|
+
.string()
|
|
247
|
+
.optional()
|
|
248
|
+
.describe("AC id this test run verifies"),
|
|
249
|
+
relatedUnitCycle: z
|
|
250
|
+
.number()
|
|
251
|
+
.optional()
|
|
252
|
+
.describe("Unit cycle number this test run verifies"),
|
|
253
|
+
})
|
|
254
|
+
.strict();
|
|
255
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
256
|
+
// get_tdd_status — Show nested TDD cycle status for an AC
|
|
257
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
258
|
+
export const GetTddStatusInputSchema = z
|
|
259
|
+
.object({
|
|
260
|
+
projectRoot: z.string().min(1),
|
|
261
|
+
criterionId: z
|
|
262
|
+
.string()
|
|
263
|
+
.optional()
|
|
264
|
+
.describe("Specific AC to show. If omitted, shows all ACs."),
|
|
265
|
+
})
|
|
266
|
+
.strict();
|
|
267
|
+
//# sourceMappingURL=tool-schemas.js.map
|