@makerkit/prd 0.0.3 → 0.0.5
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/.turbo/turbo-build.log +78 -0
- package/.turbo/turbo-test.log +19 -0
- package/.turbo/turbo-typecheck.log +6 -0
- package/README.md +7 -1
- package/dist/README.md +71 -0
- package/dist/attachment-paths-BAhRGiib.js +112 -0
- package/dist/attachment-paths-C-SWgoSx.mjs +77 -0
- package/dist/index.d.ts +81 -0
- package/{index.js → dist/index.js} +257 -524
- package/{index.mjs → dist/index.mjs} +189 -462
- package/{mcp.d.ts → dist/mcp.d.ts} +2 -4
- package/{mcp.js → dist/mcp.js} +24 -24
- package/{mcp.mjs → dist/mcp.mjs} +24 -24
- package/{node.d.ts → dist/node.d.ts} +4 -4
- package/{node.js → dist/node.js} +28 -4
- package/{node.mjs → dist/node.mjs} +30 -6
- package/dist/operations.d.ts +141 -0
- package/dist/operations.js +22 -0
- package/dist/operations.mjs +1 -0
- package/dist/package.json +54 -0
- package/dist/prd-operations-BvFxo9bg.mjs +459 -0
- package/dist/prd-operations-CcahfbOy.js +584 -0
- package/dist/prd.service-CTwKZV-3.d.ts +114 -0
- package/{prompts-DJQ4FQ11.js → dist/prompts-1qhax_dj.js} +150 -167
- package/{prompts-B0VejF7q.mjs → dist/prompts-BlsYD0gf.mjs} +121 -132
- package/{prd.service-x5EpOoMv.d.ts → dist/schema-BwTnt0B9.d.ts} +545 -323
- package/package.json +26 -2
- package/src/__tests__/agent-workflow.test.ts +417 -0
- package/src/__tests__/attachments.test.ts +505 -0
- package/src/__tests__/node.test.ts +199 -0
- package/src/__tests__/plan-check.test.ts +390 -0
- package/src/__tests__/planning.test.ts +1137 -0
- package/src/__tests__/prd-operations.test.ts +571 -0
- package/src/__tests__/prd.service.test.ts +652 -0
- package/src/__tests__/prd.tool.test.ts +282 -0
- package/src/__tests__/templates.test.ts +145 -0
- package/src/applicability.ts +73 -0
- package/src/attachment-paths.ts +83 -0
- package/src/attachments.ts +166 -0
- package/src/edge-cases.ts +61 -0
- package/src/index.ts +33 -0
- package/src/markdown.ts +297 -0
- package/src/mcp/index.ts +875 -0
- package/src/mcp/tool-response.ts +85 -0
- package/src/node.ts +184 -0
- package/src/open-questions.ts +98 -0
- package/src/plan-check.ts +385 -0
- package/src/planning-operations.ts +524 -0
- package/src/prd-operations.ts +769 -0
- package/src/prd.service.ts +1165 -0
- package/src/prompts.ts +161 -0
- package/src/safe-file-name.ts +42 -0
- package/src/schema.ts +1090 -0
- package/src/templates.ts +173 -0
- package/src/testing/fake-mcp-server.ts +81 -0
- package/src/types.ts +381 -0
- package/tsconfig.json +23 -0
- package/tsconfig.lib.json +8 -0
- package/tsconfig.spec.json +7 -0
- package/tsdown.config.mts +12 -0
- package/vitest.config.mts +8 -0
- package/index.d.ts +0 -228
- /package/{LICENSE → dist/LICENSE} +0 -0
package/src/schema.ts
ADDED
|
@@ -0,0 +1,1090 @@
|
|
|
1
|
+
import { z } from 'zod/v3';
|
|
2
|
+
|
|
3
|
+
import { TEMPLATE_IDS } from './templates';
|
|
4
|
+
import type { StructuredPRD, UserStory } from './types';
|
|
5
|
+
|
|
6
|
+
const FilenameSchema = z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1)
|
|
9
|
+
.describe('PRD file name in the PRD directory, e.g. notes-feature.json');
|
|
10
|
+
|
|
11
|
+
export const StoryStatusSchema = z.enum([
|
|
12
|
+
'not_started',
|
|
13
|
+
'research',
|
|
14
|
+
'in_progress',
|
|
15
|
+
'review',
|
|
16
|
+
'completed',
|
|
17
|
+
'blocked',
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
export const StoryPrioritySchema = z.enum(['P0', 'P1', 'P2', 'P3']);
|
|
21
|
+
|
|
22
|
+
export const StoryComplexitySchema = z.enum(['XS', 'S', 'M', 'L', 'XL']);
|
|
23
|
+
|
|
24
|
+
export const ProofKindSchema = z.enum([
|
|
25
|
+
'unit',
|
|
26
|
+
'integration',
|
|
27
|
+
'e2e',
|
|
28
|
+
'judge',
|
|
29
|
+
'manual',
|
|
30
|
+
'post-deploy',
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
export const CriterionProofSchema = z.object({
|
|
34
|
+
criterion: z
|
|
35
|
+
.string()
|
|
36
|
+
.min(1)
|
|
37
|
+
.describe('The acceptance criterion this proves, exactly as written'),
|
|
38
|
+
kind: ProofKindSchema.describe(
|
|
39
|
+
'unit/integration/e2e: a test at the lowest seam that can assert it. judge: the reviewing agent scores it against a rubric, for judgment that can be written down (tone, clarity, layout). manual/post-deploy only when the truth lives outside the test environment (a real third party, production-only conditions, human judgment) — never because a test is hard',
|
|
40
|
+
),
|
|
41
|
+
seam: z
|
|
42
|
+
.string()
|
|
43
|
+
.min(1)
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('The entry point or test file the test exercises'),
|
|
46
|
+
reason: z
|
|
47
|
+
.string()
|
|
48
|
+
.min(1)
|
|
49
|
+
.optional()
|
|
50
|
+
.describe(
|
|
51
|
+
'Required for manual and post-deploy: why no test can prove it. For e2e: why a lower seam will not do',
|
|
52
|
+
),
|
|
53
|
+
fallback: z
|
|
54
|
+
.string()
|
|
55
|
+
.min(1)
|
|
56
|
+
.optional()
|
|
57
|
+
.describe(
|
|
58
|
+
'For manual and post-deploy: the strongest automated check still made',
|
|
59
|
+
),
|
|
60
|
+
rubric: z
|
|
61
|
+
.array(z.string().min(1))
|
|
62
|
+
.optional()
|
|
63
|
+
.describe(
|
|
64
|
+
'Required for judge: the points the reviewer scores against, each one checkable, e.g. "Says what failed and what to do next"',
|
|
65
|
+
),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const RoadmapLabelSchema = z.string().trim().min(1).max(120);
|
|
69
|
+
export const PrdCriticalitySchema = z.enum([
|
|
70
|
+
'critical',
|
|
71
|
+
'high',
|
|
72
|
+
'medium',
|
|
73
|
+
'low',
|
|
74
|
+
]);
|
|
75
|
+
export const PrdRoadmapSchema = z.object({
|
|
76
|
+
order: z.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional(),
|
|
77
|
+
criticality: PrdCriticalitySchema.optional(),
|
|
78
|
+
plan: RoadmapLabelSchema.optional(),
|
|
79
|
+
group: RoadmapLabelSchema.optional(),
|
|
80
|
+
section: RoadmapLabelSchema.optional(),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const PrdRoadmapUpdateSchema = z
|
|
84
|
+
.object({
|
|
85
|
+
order: PrdRoadmapSchema.shape.order.nullable(),
|
|
86
|
+
criticality: PrdRoadmapSchema.shape.criticality.nullable(),
|
|
87
|
+
plan: PrdRoadmapSchema.shape.plan.nullable(),
|
|
88
|
+
group: PrdRoadmapSchema.shape.group.nullable(),
|
|
89
|
+
section: PrdRoadmapSchema.shape.section.nullable(),
|
|
90
|
+
})
|
|
91
|
+
.strict();
|
|
92
|
+
|
|
93
|
+
export const PrdSummarySchema = z.object({
|
|
94
|
+
filename: z.string(),
|
|
95
|
+
title: z.string(),
|
|
96
|
+
last_updated: z.string(),
|
|
97
|
+
progress: z.number().int().min(0).max(100),
|
|
98
|
+
total_stories: z.number().int().min(0),
|
|
99
|
+
completed_stories: z.number().int().min(0),
|
|
100
|
+
blocked_stories: z.number().int().min(0),
|
|
101
|
+
roadmap: PrdRoadmapSchema.optional(),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
export const ListPrdsInputSchema = z.object({});
|
|
105
|
+
|
|
106
|
+
export const ListPrdsOutputSchema = z.object({
|
|
107
|
+
prds: z.array(PrdSummarySchema),
|
|
108
|
+
total: z.number().int().min(0),
|
|
109
|
+
prds_dir: z.string(),
|
|
110
|
+
/** Files that could not be read or parsed and were skipped. */
|
|
111
|
+
warnings: z.array(z.string()),
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const GetPrdInputSchema = z.object({ filename: FilenameSchema });
|
|
115
|
+
|
|
116
|
+
export const GetPrdOutputSchema = z.object({
|
|
117
|
+
filename: z.string(),
|
|
118
|
+
path: z.string(),
|
|
119
|
+
/** Full normalised PRD document. */
|
|
120
|
+
prd: z.custom<StructuredPRD>(
|
|
121
|
+
(value) => typeof value === 'object' && value !== null,
|
|
122
|
+
),
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export const CreatePrdInputSchema = z.object({
|
|
126
|
+
title: z.string().min(1),
|
|
127
|
+
overview: z.string(),
|
|
128
|
+
problemStatement: z.string(),
|
|
129
|
+
marketOpportunity: z.string(),
|
|
130
|
+
targetUsers: z.array(z.string()),
|
|
131
|
+
solutionDescription: z.string(),
|
|
132
|
+
keyFeatures: z.array(z.string()),
|
|
133
|
+
successMetrics: z.array(z.string()),
|
|
134
|
+
nonGoals: z.array(z.string()).optional(),
|
|
135
|
+
outOfScope: z.array(z.string()).optional(),
|
|
136
|
+
assumptions: z.array(z.string()).optional(),
|
|
137
|
+
openQuestions: z.array(z.string()).optional(),
|
|
138
|
+
roadmap: PrdRoadmapSchema.strict().optional(),
|
|
139
|
+
template: z
|
|
140
|
+
.enum(TEMPLATE_IDS)
|
|
141
|
+
.optional()
|
|
142
|
+
.describe(
|
|
143
|
+
'Start from a template (see list_templates). Values given here win.',
|
|
144
|
+
),
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export const CreatePrdOutputSchema = z.object({
|
|
148
|
+
status: z.literal('success'),
|
|
149
|
+
filename: z.string(),
|
|
150
|
+
path: z.string(),
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
export const DeletePrdInputSchema = z.object({ filename: FilenameSchema });
|
|
154
|
+
|
|
155
|
+
export const DeletePrdOutputSchema = z.object({
|
|
156
|
+
status: z.literal('success'),
|
|
157
|
+
filename: z.string(),
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
export const AddUserStoryInputSchema = z.object({
|
|
161
|
+
filename: FilenameSchema,
|
|
162
|
+
userType: z.string().min(1),
|
|
163
|
+
action: z.string().min(1),
|
|
164
|
+
benefit: z.string().min(1),
|
|
165
|
+
acceptanceCriteria: z.array(z.string()),
|
|
166
|
+
priority: StoryPrioritySchema.default('P2'),
|
|
167
|
+
/** Defaults to the first few words of `action`, which is rarely what you want. */
|
|
168
|
+
title: z.string().min(1).optional(),
|
|
169
|
+
/**
|
|
170
|
+
* Defaults to a guess from the number of acceptance criteria — a measure of
|
|
171
|
+
* how verbose the story is, not how hard it is. Set it explicitly.
|
|
172
|
+
*/
|
|
173
|
+
estimatedComplexity: StoryComplexitySchema.optional(),
|
|
174
|
+
testSeams: z
|
|
175
|
+
.array(z.string().min(1))
|
|
176
|
+
.optional()
|
|
177
|
+
.describe(
|
|
178
|
+
'Public entry points the tests exercise, e.g. a route or server action',
|
|
179
|
+
),
|
|
180
|
+
proofs: z
|
|
181
|
+
.array(CriterionProofSchema)
|
|
182
|
+
.optional()
|
|
183
|
+
.describe(
|
|
184
|
+
'How each acceptance criterion is proven, one per criterion. Replaces the list',
|
|
185
|
+
),
|
|
186
|
+
dependencies: z
|
|
187
|
+
.array(z.string().min(1))
|
|
188
|
+
.optional()
|
|
189
|
+
.describe('Ids of stories that must be completed first, e.g. ["US001"]'),
|
|
190
|
+
phaseId: z
|
|
191
|
+
.string()
|
|
192
|
+
.min(1)
|
|
193
|
+
.optional()
|
|
194
|
+
.describe('Phase to put the story in, e.g. "PHASE002"'),
|
|
195
|
+
attachmentIds: z
|
|
196
|
+
.array(z.string().min(1))
|
|
197
|
+
.optional()
|
|
198
|
+
.describe('Ids of PRD attachments this story uses, e.g. ["ATT001"]'),
|
|
199
|
+
designNotes: z
|
|
200
|
+
.array(z.string().min(1))
|
|
201
|
+
.optional()
|
|
202
|
+
.describe(
|
|
203
|
+
'Design notes for this story only (layout, empty/loading/error states, copy) beyond the PRD design guidance',
|
|
204
|
+
),
|
|
205
|
+
securityNotes: z
|
|
206
|
+
.array(z.string().min(1))
|
|
207
|
+
.optional()
|
|
208
|
+
.describe(
|
|
209
|
+
'Security notes for this story only: each specific way it could be abused and the defence, beyond the PRD security considerations',
|
|
210
|
+
),
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
export const AddUserStoryOutputSchema = z.object({
|
|
214
|
+
story_id: z.string(),
|
|
215
|
+
title: z.string(),
|
|
216
|
+
complexity: z.enum(['XS', 'S', 'M', 'L', 'XL']),
|
|
217
|
+
total_stories: z.number().int().min(0),
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
export const UpdateStoryStatusInputSchema = z.object({
|
|
221
|
+
filename: FilenameSchema,
|
|
222
|
+
storyId: z.string().min(1),
|
|
223
|
+
status: StoryStatusSchema,
|
|
224
|
+
workerId: z
|
|
225
|
+
.string()
|
|
226
|
+
.trim()
|
|
227
|
+
.min(1)
|
|
228
|
+
.optional()
|
|
229
|
+
.describe(
|
|
230
|
+
'Stable run ID used to claim an active story and to update a story already claimed by this worker.',
|
|
231
|
+
),
|
|
232
|
+
notes: z.string().optional(),
|
|
233
|
+
recordDeviations: z
|
|
234
|
+
.array(z.string().min(1))
|
|
235
|
+
.optional()
|
|
236
|
+
.describe(
|
|
237
|
+
'Only when completing: deviations from the story log, copied exactly, to record as accepted decisions so the PRD says what was built',
|
|
238
|
+
),
|
|
239
|
+
expectedRevision: z
|
|
240
|
+
.number()
|
|
241
|
+
.int()
|
|
242
|
+
.min(0)
|
|
243
|
+
.optional()
|
|
244
|
+
.describe(
|
|
245
|
+
'The PRD revision (metadata.revision) the change is based on, checked before the project checks run. When the PRD changed since, the change is rejected: read it again and retry.',
|
|
246
|
+
),
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
export const StoryVerificationSchema = z.object({
|
|
250
|
+
verified_at: z.string(),
|
|
251
|
+
checks: z.array(z.string()),
|
|
252
|
+
passed: z.literal(true),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export const UpdateStoryStatusOutputSchema = z.object({
|
|
256
|
+
story_id: z.string(),
|
|
257
|
+
title: z.string(),
|
|
258
|
+
status: StoryStatusSchema,
|
|
259
|
+
progress: z.number().int().min(0).max(100),
|
|
260
|
+
/** Present only when the story was marked completed and checks ran. */
|
|
261
|
+
verification: StoryVerificationSchema.nullable(),
|
|
262
|
+
/** Ids of the decisions recorded from the story's deviations. */
|
|
263
|
+
recorded_decisions: z.array(z.string()),
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
export const UpdateUserStoryInputSchema = z.object({
|
|
267
|
+
filename: FilenameSchema,
|
|
268
|
+
storyId: z.string().min(1),
|
|
269
|
+
/** Every field is optional: only the ones supplied are changed. */
|
|
270
|
+
title: z.string().min(1).optional(),
|
|
271
|
+
userType: z.string().min(1).optional(),
|
|
272
|
+
action: z.string().min(1).optional(),
|
|
273
|
+
benefit: z.string().min(1).optional(),
|
|
274
|
+
businessValue: z.string().min(1).optional(),
|
|
275
|
+
acceptanceCriteria: z.array(z.string()).optional(),
|
|
276
|
+
priority: StoryPrioritySchema.optional(),
|
|
277
|
+
estimatedComplexity: StoryComplexitySchema.optional(),
|
|
278
|
+
dependencies: z.array(z.string()).optional(),
|
|
279
|
+
notes: z.string().optional(),
|
|
280
|
+
testSeams: z
|
|
281
|
+
.array(z.string().min(1))
|
|
282
|
+
.optional()
|
|
283
|
+
.describe(
|
|
284
|
+
'Public entry points the tests exercise, e.g. a route or server action',
|
|
285
|
+
),
|
|
286
|
+
proofs: z
|
|
287
|
+
.array(CriterionProofSchema)
|
|
288
|
+
.optional()
|
|
289
|
+
.describe(
|
|
290
|
+
'How each acceptance criterion is proven, one per criterion. Replaces the list',
|
|
291
|
+
),
|
|
292
|
+
attachmentIds: z
|
|
293
|
+
.array(z.string().min(1))
|
|
294
|
+
.optional()
|
|
295
|
+
.describe('Ids of PRD attachments this story uses, e.g. ["ATT001"]'),
|
|
296
|
+
designNotes: z
|
|
297
|
+
.array(z.string().min(1))
|
|
298
|
+
.optional()
|
|
299
|
+
.describe(
|
|
300
|
+
'Design notes for this story only (layout, empty/loading/error states, copy) beyond the PRD design guidance',
|
|
301
|
+
),
|
|
302
|
+
securityNotes: z
|
|
303
|
+
.array(z.string().min(1))
|
|
304
|
+
.optional()
|
|
305
|
+
.describe(
|
|
306
|
+
'Security notes for this story only: each specific way it could be abused and the defence, beyond the PRD security considerations',
|
|
307
|
+
),
|
|
308
|
+
phaseId: z
|
|
309
|
+
.string()
|
|
310
|
+
.min(1)
|
|
311
|
+
.nullable()
|
|
312
|
+
.optional()
|
|
313
|
+
.describe('Move the story to this phase; null removes it from every phase'),
|
|
314
|
+
expectedRevision: z
|
|
315
|
+
.number()
|
|
316
|
+
.int()
|
|
317
|
+
.min(0)
|
|
318
|
+
.optional()
|
|
319
|
+
.describe(
|
|
320
|
+
'The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.',
|
|
321
|
+
),
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
export const UpdateUserStoryOutputSchema = z.object({
|
|
325
|
+
story_id: z.string(),
|
|
326
|
+
title: z.string(),
|
|
327
|
+
updated_fields: z.array(z.string()),
|
|
328
|
+
story: z.record(z.string(), z.unknown()),
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
export const DeleteUserStoryInputSchema = z.object({
|
|
332
|
+
filename: FilenameSchema,
|
|
333
|
+
storyId: z.string().min(1),
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
export const DeleteUserStoryOutputSchema = z.object({
|
|
337
|
+
story_id: z.string(),
|
|
338
|
+
title: z.string(),
|
|
339
|
+
total_stories: z.number().int().min(0),
|
|
340
|
+
progress: z.number().int().min(0).max(100),
|
|
341
|
+
/** Stories that listed the deleted one as a dependency, now cleaned up. */
|
|
342
|
+
dependency_references_removed: z.array(z.string()),
|
|
343
|
+
phases_updated: z.array(z.string()),
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
export const CreateCustomPhaseInputSchema = z.object({
|
|
347
|
+
filename: FilenameSchema,
|
|
348
|
+
name: z.string().min(1),
|
|
349
|
+
description: z.string().default(''),
|
|
350
|
+
color: z
|
|
351
|
+
.string()
|
|
352
|
+
.regex(/^#[0-9a-fA-F]{6}$/, 'Expected a hex colour such as #4f46e5')
|
|
353
|
+
.default('#4f46e5'),
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
export const CustomPhaseSchema = z.object({
|
|
357
|
+
id: z.string(),
|
|
358
|
+
name: z.string(),
|
|
359
|
+
description: z.string(),
|
|
360
|
+
color: z.string(),
|
|
361
|
+
order: z.number().int().min(0),
|
|
362
|
+
user_story_ids: z.array(z.string()),
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
export const CreateCustomPhaseOutputSchema = z.object({
|
|
366
|
+
phase: CustomPhaseSchema,
|
|
367
|
+
total_phases: z.number().int().min(0),
|
|
368
|
+
});
|
|
369
|
+
|
|
370
|
+
export const AssignStoryToPhaseInputSchema = z.object({
|
|
371
|
+
filename: FilenameSchema,
|
|
372
|
+
storyId: z.string().min(1),
|
|
373
|
+
/** Omit to remove the story from every phase. */
|
|
374
|
+
phaseId: z.string().min(1).nullable().default(null),
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
export const AssignStoryToPhaseOutputSchema = z.object({
|
|
378
|
+
story_id: z.string(),
|
|
379
|
+
phase_id: z.string().nullable(),
|
|
380
|
+
phase_name: z.string().nullable(),
|
|
381
|
+
moved_from: z.string().nullable(),
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
export const ExportPrdMarkdownInputSchema = z.object({
|
|
385
|
+
filename: FilenameSchema,
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
export const ExportPrdMarkdownOutputSchema = z.object({
|
|
389
|
+
markdown_file: z.string(),
|
|
390
|
+
path: z.string(),
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
export const GetImplementationPromptsInputSchema = z.object({
|
|
394
|
+
filename: FilenameSchema,
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
export const GetImplementationPromptsOutputSchema = z.object({
|
|
398
|
+
prompts: z.array(z.string()),
|
|
399
|
+
total: z.number().int().min(0),
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
export const GetImprovementSuggestionsInputSchema = z.object({
|
|
403
|
+
filename: FilenameSchema,
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
export const GetImprovementSuggestionsOutputSchema = z.object({
|
|
407
|
+
suggestions: z.array(z.string()),
|
|
408
|
+
total: z.number().int().min(0),
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
export const GetProjectStatusInputSchema = z.object({
|
|
412
|
+
filename: FilenameSchema,
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
export const GetProjectStatusOutputSchema = z.object({
|
|
416
|
+
progress: z.number().int().min(0).max(100),
|
|
417
|
+
summary: z.string(),
|
|
418
|
+
next_steps: z.array(z.string()),
|
|
419
|
+
blockers: z.array(
|
|
420
|
+
z.object({
|
|
421
|
+
id: z.string(),
|
|
422
|
+
title: z.string(),
|
|
423
|
+
notes: z.string().nullable(),
|
|
424
|
+
}),
|
|
425
|
+
),
|
|
426
|
+
open_questions: z.array(z.string()),
|
|
427
|
+
high_risks: z.array(
|
|
428
|
+
z.object({
|
|
429
|
+
id: z.string(),
|
|
430
|
+
description: z.string(),
|
|
431
|
+
mitigation: z.string(),
|
|
432
|
+
owner: z.string(),
|
|
433
|
+
}),
|
|
434
|
+
),
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
const StoryObjectSchema = z.custom<UserStory>(
|
|
438
|
+
(value) => typeof value === 'object' && value !== null,
|
|
439
|
+
);
|
|
440
|
+
|
|
441
|
+
export const StoryLogEntrySchema = z.object({
|
|
442
|
+
at: z.string(),
|
|
443
|
+
whatsNew: z.array(z.string()),
|
|
444
|
+
technicalNotes: z.array(z.string()),
|
|
445
|
+
deviations: z.array(z.string()).optional(),
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
export const GetNextStoryInputSchema = z.object({ filename: FilenameSchema });
|
|
449
|
+
|
|
450
|
+
export const GetNextStoryOutputSchema = z.object({
|
|
451
|
+
/** Null when nothing is ready: all done, in progress, or waiting. */
|
|
452
|
+
story: StoryObjectSchema.nullable(),
|
|
453
|
+
ready_count: z.number().int().min(0),
|
|
454
|
+
in_progress: z.array(z.string()),
|
|
455
|
+
waiting: z.array(
|
|
456
|
+
z.object({
|
|
457
|
+
id: z.string(),
|
|
458
|
+
title: z.string(),
|
|
459
|
+
waiting_on: z.array(z.string()),
|
|
460
|
+
}),
|
|
461
|
+
),
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
export const GetStoryInputSchema = z.object({
|
|
465
|
+
filename: FilenameSchema,
|
|
466
|
+
storyId: z.string().min(1),
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
const StoryLogsSchema = z.array(StoryLogEntrySchema);
|
|
470
|
+
|
|
471
|
+
/** An attachment with its file path relative to the project root. */
|
|
472
|
+
export const StoryAttachmentSchema = z.object({
|
|
473
|
+
id: z.string(),
|
|
474
|
+
title: z.string(),
|
|
475
|
+
path: z.string().optional(),
|
|
476
|
+
url: z.string().optional(),
|
|
477
|
+
note: z.string().optional(),
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
export const GetStoryOutputSchema = z.object({
|
|
481
|
+
prd: z.object({
|
|
482
|
+
title: z.string(),
|
|
483
|
+
overview: z.string(),
|
|
484
|
+
non_goals: z.array(z.string()),
|
|
485
|
+
out_of_scope: z.array(z.string()),
|
|
486
|
+
global_acceptance_criteria: z.array(z.string()),
|
|
487
|
+
/** Every attachment in the PRD, for references shared across stories. */
|
|
488
|
+
attachments: z.array(StoryAttachmentSchema),
|
|
489
|
+
}),
|
|
490
|
+
story: StoryObjectSchema,
|
|
491
|
+
/** The attachments this story uses. */
|
|
492
|
+
attachments: z.array(StoryAttachmentSchema),
|
|
493
|
+
phase: z.object({ id: z.string(), name: z.string() }).nullable(),
|
|
494
|
+
/**
|
|
495
|
+
* Edge cases for this story (linked to it, or to the whole PRD). Decided
|
|
496
|
+
* ones are binding behaviour; open ones must be asked about, not assumed.
|
|
497
|
+
*/
|
|
498
|
+
edge_cases: z.array(
|
|
499
|
+
z.object({
|
|
500
|
+
id: z.string(),
|
|
501
|
+
case: z.string(),
|
|
502
|
+
expectedBehavior: z.string(),
|
|
503
|
+
status: z.enum(['open', 'decided']),
|
|
504
|
+
storyIds: z.array(z.string()).optional(),
|
|
505
|
+
}),
|
|
506
|
+
),
|
|
507
|
+
/** Open questions that block this story: ask, do not guess. */
|
|
508
|
+
open_questions: z.array(
|
|
509
|
+
z.object({
|
|
510
|
+
id: z.string(),
|
|
511
|
+
question: z.string(),
|
|
512
|
+
why: z.string().optional(),
|
|
513
|
+
options: z.array(z.string()).optional(),
|
|
514
|
+
recommended: z.string().optional(),
|
|
515
|
+
storyIds: z.array(z.string()).optional(),
|
|
516
|
+
}),
|
|
517
|
+
),
|
|
518
|
+
/** Who can do what, sensitive data and standing security rules. Binding. */
|
|
519
|
+
security: z.object({
|
|
520
|
+
permissions: z.array(z.string()),
|
|
521
|
+
compliance: z.array(z.string()),
|
|
522
|
+
considerations: z.array(z.string()),
|
|
523
|
+
story_notes: z.array(z.string()),
|
|
524
|
+
}),
|
|
525
|
+
/** Parts of the PRD that do not apply, with the reason: do not invent them. */
|
|
526
|
+
not_applicable: z.record(z.string(), z.string()),
|
|
527
|
+
/** Standing design rules and accepted design decisions. */
|
|
528
|
+
design: z.object({
|
|
529
|
+
guidance: z.array(z.string()),
|
|
530
|
+
story_notes: z.array(z.string()),
|
|
531
|
+
decisions: z.array(
|
|
532
|
+
z.object({ id: z.string(), decision: z.string(), rationale: z.string() }),
|
|
533
|
+
),
|
|
534
|
+
}),
|
|
535
|
+
dependencies: z.array(
|
|
536
|
+
z.object({
|
|
537
|
+
id: z.string(),
|
|
538
|
+
title: z.string().nullable(),
|
|
539
|
+
status: z.string().nullable(),
|
|
540
|
+
log: StoryLogsSchema,
|
|
541
|
+
}),
|
|
542
|
+
),
|
|
543
|
+
previous_story: z
|
|
544
|
+
.object({ id: z.string(), title: z.string(), log: StoryLogsSchema })
|
|
545
|
+
.nullable(),
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
export const AddStoryLogInputSchema = z.object({
|
|
549
|
+
filename: FilenameSchema,
|
|
550
|
+
storyId: z.string().min(1),
|
|
551
|
+
workerId: z.string().trim().min(1).optional(),
|
|
552
|
+
whatsNew: z
|
|
553
|
+
.array(z.string().min(1))
|
|
554
|
+
.min(1)
|
|
555
|
+
.describe('What a person can now try, in plain language'),
|
|
556
|
+
technicalNotes: z
|
|
557
|
+
.array(z.string().min(1))
|
|
558
|
+
.default([])
|
|
559
|
+
.describe('Decisions, gotchas and file locations for the next agent'),
|
|
560
|
+
deviations: z
|
|
561
|
+
.array(z.string().min(1))
|
|
562
|
+
.optional()
|
|
563
|
+
.describe(
|
|
564
|
+
'Where the work departed from the PRD and why: changed criteria, extra or skipped scope, a different approach',
|
|
565
|
+
),
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
export const AddStoryLogOutputSchema = z.object({
|
|
569
|
+
story_id: z.string(),
|
|
570
|
+
entries: z.number().int().min(1),
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
// Planning ------------------------------------------------------------------
|
|
574
|
+
|
|
575
|
+
const StringList = z.array(z.string().min(1));
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* Accepted `value` for each `update_prd_section` section. Object sections are
|
|
579
|
+
* merged (only the keys supplied change); list sections are replaced.
|
|
580
|
+
*/
|
|
581
|
+
export const PrdSectionValueSchemas = {
|
|
582
|
+
roadmap: PrdRoadmapUpdateSchema,
|
|
583
|
+
introduction: z
|
|
584
|
+
.object({ title: z.string().min(1), overview: z.string() })
|
|
585
|
+
.partial()
|
|
586
|
+
.strict(),
|
|
587
|
+
problemStatement: z
|
|
588
|
+
.object({
|
|
589
|
+
problem: z.string(),
|
|
590
|
+
marketOpportunity: z.string(),
|
|
591
|
+
targetUsers: StringList,
|
|
592
|
+
})
|
|
593
|
+
.partial()
|
|
594
|
+
.strict(),
|
|
595
|
+
solutionOverview: z
|
|
596
|
+
.object({
|
|
597
|
+
description: z.string(),
|
|
598
|
+
keyFeatures: StringList,
|
|
599
|
+
successMetrics: StringList,
|
|
600
|
+
})
|
|
601
|
+
.partial()
|
|
602
|
+
.strict(),
|
|
603
|
+
nonGoals: StringList,
|
|
604
|
+
outOfScope: StringList,
|
|
605
|
+
assumptions: StringList,
|
|
606
|
+
openQuestions: z.array(
|
|
607
|
+
z.union([
|
|
608
|
+
z.string().min(1),
|
|
609
|
+
z.object({
|
|
610
|
+
id: z.string().optional(),
|
|
611
|
+
question: z.string().min(1),
|
|
612
|
+
why: z.string().optional(),
|
|
613
|
+
options: z.array(z.string().min(1)).optional(),
|
|
614
|
+
recommended: z.string().optional(),
|
|
615
|
+
storyIds: z.array(z.string().min(1)).optional(),
|
|
616
|
+
}),
|
|
617
|
+
]),
|
|
618
|
+
),
|
|
619
|
+
technicalRequirements: z
|
|
620
|
+
.object({
|
|
621
|
+
constraints: StringList,
|
|
622
|
+
integrationNeeds: StringList,
|
|
623
|
+
complianceRequirements: StringList,
|
|
624
|
+
})
|
|
625
|
+
.partial()
|
|
626
|
+
.strict(),
|
|
627
|
+
technicalContracts: z
|
|
628
|
+
.object({
|
|
629
|
+
apis: StringList,
|
|
630
|
+
dataModels: StringList,
|
|
631
|
+
permissions: StringList,
|
|
632
|
+
integrationBoundaries: StringList,
|
|
633
|
+
})
|
|
634
|
+
.partial()
|
|
635
|
+
.strict(),
|
|
636
|
+
acceptanceCriteria: z
|
|
637
|
+
.object({ global: StringList, qualityStandards: StringList })
|
|
638
|
+
.partial()
|
|
639
|
+
.strict(),
|
|
640
|
+
constraints: z
|
|
641
|
+
.object({
|
|
642
|
+
timeline: z.string(),
|
|
643
|
+
budget: z.string(),
|
|
644
|
+
resources: StringList,
|
|
645
|
+
nonNegotiables: StringList,
|
|
646
|
+
})
|
|
647
|
+
.partial()
|
|
648
|
+
.strict(),
|
|
649
|
+
rolloutPlan: z
|
|
650
|
+
.object({
|
|
651
|
+
featureFlags: StringList,
|
|
652
|
+
migrationPlan: StringList,
|
|
653
|
+
rolloutPhases: StringList,
|
|
654
|
+
rollbackConditions: StringList,
|
|
655
|
+
})
|
|
656
|
+
.partial()
|
|
657
|
+
.strict(),
|
|
658
|
+
measurementPlan: z
|
|
659
|
+
.object({
|
|
660
|
+
events: StringList,
|
|
661
|
+
dashboards: StringList,
|
|
662
|
+
baselineMetrics: StringList,
|
|
663
|
+
targetMetrics: StringList,
|
|
664
|
+
guardrailMetrics: StringList,
|
|
665
|
+
})
|
|
666
|
+
.partial()
|
|
667
|
+
.strict(),
|
|
668
|
+
risks: z.array(
|
|
669
|
+
z.object({
|
|
670
|
+
id: z.string().optional(),
|
|
671
|
+
description: z.string().min(1),
|
|
672
|
+
mitigation: z.string(),
|
|
673
|
+
owner: z.string(),
|
|
674
|
+
severity: z.enum(['low', 'medium', 'high']),
|
|
675
|
+
}),
|
|
676
|
+
),
|
|
677
|
+
dependencies: z.array(
|
|
678
|
+
z.object({
|
|
679
|
+
id: z.string().optional(),
|
|
680
|
+
name: z.string().min(1),
|
|
681
|
+
description: z.string(),
|
|
682
|
+
blocking: z.boolean(),
|
|
683
|
+
owner: z.string().optional(),
|
|
684
|
+
}),
|
|
685
|
+
),
|
|
686
|
+
edgeCases: z.array(
|
|
687
|
+
z
|
|
688
|
+
.object({
|
|
689
|
+
id: z.string().optional(),
|
|
690
|
+
case: z.string().min(1),
|
|
691
|
+
expectedBehavior: z.string().default(''),
|
|
692
|
+
status: z.enum(['open', 'decided']).default('open'),
|
|
693
|
+
storyIds: z.array(z.string().min(1)).optional(),
|
|
694
|
+
})
|
|
695
|
+
.refine(
|
|
696
|
+
(edgeCase) =>
|
|
697
|
+
edgeCase.status === 'open' ||
|
|
698
|
+
edgeCase.expectedBehavior.trim().length > 0,
|
|
699
|
+
{
|
|
700
|
+
message: 'A decided edge case needs its expectedBehavior',
|
|
701
|
+
path: ['expectedBehavior'],
|
|
702
|
+
},
|
|
703
|
+
),
|
|
704
|
+
),
|
|
705
|
+
designGuidance: StringList,
|
|
706
|
+
securityConsiderations: StringList,
|
|
707
|
+
} as const;
|
|
708
|
+
|
|
709
|
+
export type PrdSection = keyof typeof PrdSectionValueSchemas;
|
|
710
|
+
|
|
711
|
+
const PRD_SECTIONS = Object.keys(PrdSectionValueSchemas) as [
|
|
712
|
+
PrdSection,
|
|
713
|
+
...PrdSection[],
|
|
714
|
+
];
|
|
715
|
+
|
|
716
|
+
export const UpdatePrdSectionInputSchema = z.object({
|
|
717
|
+
filename: FilenameSchema,
|
|
718
|
+
section: z.enum(PRD_SECTIONS),
|
|
719
|
+
expectedRevision: z
|
|
720
|
+
.number()
|
|
721
|
+
.int()
|
|
722
|
+
.min(0)
|
|
723
|
+
.optional()
|
|
724
|
+
.describe(
|
|
725
|
+
'The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the update is rejected: read it again and retry.',
|
|
726
|
+
),
|
|
727
|
+
value: z
|
|
728
|
+
.unknown()
|
|
729
|
+
.describe(
|
|
730
|
+
'roadmap takes a partial object with order, criticality, plan, group and section. Pass null to clear a field. Object sections (introduction, problemStatement, solutionOverview, technicalRequirements, technicalContracts, acceptanceCriteria, constraints, rolloutPlan, measurementPlan) take an object and only the keys given change. List sections (nonGoals, outOfScope, assumptions, designGuidance, securityConsiderations) take a string array and replace the list. openQuestions takes an array of { question, why, options, recommended, storyIds } (a plain string is accepted too) and replaces the list; keep the ids of existing questions. risks, dependencies and edgeCases take an array of items and replace the list; items without an id get one. An edge case is { case, expectedBehavior, status: "open" | "decided", storyIds? }; a decided one needs expectedBehavior, and storyIds must name existing stories.',
|
|
731
|
+
),
|
|
732
|
+
});
|
|
733
|
+
|
|
734
|
+
export const UpdatePrdSectionOutputSchema = z.object({
|
|
735
|
+
section: z.string(),
|
|
736
|
+
updated: z.array(z.string()),
|
|
737
|
+
});
|
|
738
|
+
|
|
739
|
+
export const NotApplicableTopicSchema = z.enum([
|
|
740
|
+
'dataModel',
|
|
741
|
+
'outsideServices',
|
|
742
|
+
'security',
|
|
743
|
+
'design',
|
|
744
|
+
'qualityBar',
|
|
745
|
+
'edgeCases',
|
|
746
|
+
'rollout',
|
|
747
|
+
'measurement',
|
|
748
|
+
'glossary',
|
|
749
|
+
'risks',
|
|
750
|
+
]);
|
|
751
|
+
|
|
752
|
+
export const MarkNotApplicableInputSchema = z.object({
|
|
753
|
+
filename: FilenameSchema,
|
|
754
|
+
topic: NotApplicableTopicSchema,
|
|
755
|
+
notApplicable: z
|
|
756
|
+
.boolean()
|
|
757
|
+
.default(true)
|
|
758
|
+
.describe('false marks it applicable again'),
|
|
759
|
+
reason: z
|
|
760
|
+
.string()
|
|
761
|
+
.optional()
|
|
762
|
+
.describe('Why it does not apply, e.g. "Internal tool: no rollout"'),
|
|
763
|
+
expectedRevision: z
|
|
764
|
+
.number()
|
|
765
|
+
.int()
|
|
766
|
+
.min(0)
|
|
767
|
+
.optional()
|
|
768
|
+
.describe(
|
|
769
|
+
'The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.',
|
|
770
|
+
),
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
export const MarkNotApplicableOutputSchema = z.object({
|
|
774
|
+
topic: NotApplicableTopicSchema,
|
|
775
|
+
not_applicable: z.boolean(),
|
|
776
|
+
reason: z.string().nullable(),
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
export const AddDecisionInputSchema = z.object({
|
|
780
|
+
filename: FilenameSchema,
|
|
781
|
+
decision: z.string().min(1),
|
|
782
|
+
rationale: z.string().min(1),
|
|
783
|
+
owner: z.string().optional(),
|
|
784
|
+
topic: z
|
|
785
|
+
.string()
|
|
786
|
+
.optional()
|
|
787
|
+
.describe('What it is about, e.g. "story:US003" or "billing"'),
|
|
788
|
+
status: z.enum(['proposed', 'accepted']).default('accepted'),
|
|
789
|
+
supersedes: z
|
|
790
|
+
.string()
|
|
791
|
+
.optional()
|
|
792
|
+
.describe('Id of an earlier decision this one replaces'),
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
export const AddDecisionOutputSchema = z.object({
|
|
796
|
+
decision_id: z.string(),
|
|
797
|
+
superseded: z.string().nullable(),
|
|
798
|
+
total_decisions: z.number().int().min(1),
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
const ExpectedRevisionSchema = z
|
|
802
|
+
.number()
|
|
803
|
+
.int()
|
|
804
|
+
.min(0)
|
|
805
|
+
.optional()
|
|
806
|
+
.describe(
|
|
807
|
+
'The PRD revision (metadata.revision) this change is based on. When given and the PRD changed since, the change is rejected: read it again and retry.',
|
|
808
|
+
);
|
|
809
|
+
|
|
810
|
+
export const AddAttachmentInputSchema = z.object({
|
|
811
|
+
filename: FilenameSchema,
|
|
812
|
+
title: z.string().min(1).describe('What it is, e.g. "Approve view mockup"'),
|
|
813
|
+
path: z
|
|
814
|
+
.string()
|
|
815
|
+
.min(1)
|
|
816
|
+
.optional()
|
|
817
|
+
.describe(
|
|
818
|
+
'File inside the PRD folder (next to its JSON file), relative to it, e.g. "mockups/approve.png". Save the file there first. Give path or url, not both.',
|
|
819
|
+
),
|
|
820
|
+
url: z
|
|
821
|
+
.string()
|
|
822
|
+
.url()
|
|
823
|
+
.optional()
|
|
824
|
+
.describe('A web page or document link. Give path or url, not both.'),
|
|
825
|
+
note: z
|
|
826
|
+
.string()
|
|
827
|
+
.min(1)
|
|
828
|
+
.optional()
|
|
829
|
+
.describe(
|
|
830
|
+
'What to take from it, e.g. "Layout only; colours are placeholders"',
|
|
831
|
+
),
|
|
832
|
+
storyIds: z
|
|
833
|
+
.array(z.string().min(1))
|
|
834
|
+
.optional()
|
|
835
|
+
.describe('Stories that use it, e.g. ["US003"]'),
|
|
836
|
+
expectedRevision: ExpectedRevisionSchema,
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
export const AddAttachmentOutputSchema = z.object({
|
|
840
|
+
attachment_id: z.string(),
|
|
841
|
+
/** The file relative to the project root, or null for a link. */
|
|
842
|
+
path: z.string().nullable(),
|
|
843
|
+
stories_updated: z.array(z.string()),
|
|
844
|
+
total_attachments: z.number().int().min(1),
|
|
845
|
+
});
|
|
846
|
+
|
|
847
|
+
export const RemoveAttachmentInputSchema = z.object({
|
|
848
|
+
filename: FilenameSchema,
|
|
849
|
+
attachmentId: z.string().min(1),
|
|
850
|
+
expectedRevision: ExpectedRevisionSchema,
|
|
851
|
+
});
|
|
852
|
+
|
|
853
|
+
export const UpdateAttachmentInputSchema = z.object({
|
|
854
|
+
filename: FilenameSchema,
|
|
855
|
+
attachmentId: z.string().min(1),
|
|
856
|
+
title: z.string().min(1).optional(),
|
|
857
|
+
note: z.string().optional().describe('An empty string removes the note'),
|
|
858
|
+
storyIds: z
|
|
859
|
+
.array(z.string().min(1))
|
|
860
|
+
.optional()
|
|
861
|
+
.describe('The stories that use it: links are added and removed to match'),
|
|
862
|
+
expectedRevision: ExpectedRevisionSchema,
|
|
863
|
+
});
|
|
864
|
+
|
|
865
|
+
export const UpdateAttachmentOutputSchema = z.object({
|
|
866
|
+
attachment_id: z.string(),
|
|
867
|
+
stories_updated: z.array(z.string()),
|
|
868
|
+
});
|
|
869
|
+
|
|
870
|
+
export const RemoveAttachmentOutputSchema = z.object({
|
|
871
|
+
attachment_id: z.string(),
|
|
872
|
+
stories_updated: z.array(z.string()),
|
|
873
|
+
total_attachments: z.number().int().min(0),
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
export const ResolveOpenQuestionInputSchema = z
|
|
877
|
+
.object({
|
|
878
|
+
filename: FilenameSchema,
|
|
879
|
+
questionId: z
|
|
880
|
+
.string()
|
|
881
|
+
.min(1)
|
|
882
|
+
.optional()
|
|
883
|
+
.describe('The question id, e.g. Q003'),
|
|
884
|
+
question: z
|
|
885
|
+
.string()
|
|
886
|
+
.min(1)
|
|
887
|
+
.optional()
|
|
888
|
+
.describe('The question text, exactly as listed (when there is no id)'),
|
|
889
|
+
answer: z.string().min(1),
|
|
890
|
+
recordDecision: z
|
|
891
|
+
.boolean()
|
|
892
|
+
.default(true)
|
|
893
|
+
.describe('Also add the answer to the decision log'),
|
|
894
|
+
expectedRevision: ExpectedRevisionSchema,
|
|
895
|
+
})
|
|
896
|
+
.refine((input) => input.questionId || input.question, {
|
|
897
|
+
message: 'Pass questionId or question',
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
export const DecideEdgeCaseInputSchema = z.object({
|
|
901
|
+
filename: FilenameSchema,
|
|
902
|
+
edgeCaseId: z.string().min(1),
|
|
903
|
+
expectedBehavior: z.string().min(1).describe('What should happen'),
|
|
904
|
+
expectedRevision: ExpectedRevisionSchema,
|
|
905
|
+
});
|
|
906
|
+
|
|
907
|
+
export const DecideEdgeCaseOutputSchema = z.object({
|
|
908
|
+
edge_case_id: z.string(),
|
|
909
|
+
open_edge_cases: z.number().int().min(0),
|
|
910
|
+
});
|
|
911
|
+
|
|
912
|
+
export const ResolveOpenQuestionOutputSchema = z.object({
|
|
913
|
+
remaining_questions: z.number().int().min(0),
|
|
914
|
+
decision_id: z.string().nullable(),
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
export const AddGlossaryTermInputSchema = z.object({
|
|
918
|
+
filename: FilenameSchema,
|
|
919
|
+
term: z.string().min(1),
|
|
920
|
+
definition: z.string().min(1),
|
|
921
|
+
avoid: z
|
|
922
|
+
.array(z.string().min(1))
|
|
923
|
+
.default([])
|
|
924
|
+
.describe('Synonyms that should not be used for this concept'),
|
|
925
|
+
});
|
|
926
|
+
|
|
927
|
+
export const AddGlossaryTermOutputSchema = z.object({
|
|
928
|
+
term: z.string(),
|
|
929
|
+
replaced: z.boolean(),
|
|
930
|
+
total_terms: z.number().int().min(1),
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
export const UpdatePhaseInputSchema = z.object({
|
|
934
|
+
filename: FilenameSchema,
|
|
935
|
+
phaseId: z.string().min(1),
|
|
936
|
+
name: z.string().min(1).optional(),
|
|
937
|
+
description: z.string().optional(),
|
|
938
|
+
color: z
|
|
939
|
+
.string()
|
|
940
|
+
.regex(/^#[0-9a-fA-F]{6}$/, 'Expected a hex colour such as #4f46e5')
|
|
941
|
+
.optional(),
|
|
942
|
+
});
|
|
943
|
+
|
|
944
|
+
export const DeletePhaseInputSchema = z.object({
|
|
945
|
+
filename: FilenameSchema,
|
|
946
|
+
phaseId: z.string().min(1),
|
|
947
|
+
});
|
|
948
|
+
|
|
949
|
+
export const ReorderPhasesInputSchema = z.object({
|
|
950
|
+
filename: FilenameSchema,
|
|
951
|
+
phaseIds: z
|
|
952
|
+
.array(z.string().min(1))
|
|
953
|
+
.min(1)
|
|
954
|
+
.describe('Every phase id, in the new order'),
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
export const PhasesOutputSchema = z.object({
|
|
958
|
+
phases: z.array(
|
|
959
|
+
z.object({
|
|
960
|
+
id: z.string(),
|
|
961
|
+
name: z.string(),
|
|
962
|
+
order: z.number().int().min(0),
|
|
963
|
+
user_story_ids: z.array(z.string()),
|
|
964
|
+
}),
|
|
965
|
+
),
|
|
966
|
+
});
|
|
967
|
+
|
|
968
|
+
export const CheckPlanInputSchema = z.object({ filename: FilenameSchema });
|
|
969
|
+
|
|
970
|
+
export const CheckPlanOutputSchema = z.object({
|
|
971
|
+
/** False while any required item is open. */
|
|
972
|
+
ready_to_build: z.boolean(),
|
|
973
|
+
items: z.array(
|
|
974
|
+
z.object({
|
|
975
|
+
id: z.string(),
|
|
976
|
+
section: z.string(),
|
|
977
|
+
message: z.string(),
|
|
978
|
+
severity: z.enum(['required', 'recommended']),
|
|
979
|
+
storyIds: z.array(z.string()).optional(),
|
|
980
|
+
}),
|
|
981
|
+
),
|
|
982
|
+
});
|
|
983
|
+
|
|
984
|
+
export type CheckPlanOutput = z.infer<typeof CheckPlanOutputSchema>;
|
|
985
|
+
|
|
986
|
+
export const ListTemplatesInputSchema = z.object({});
|
|
987
|
+
|
|
988
|
+
export const ListTemplatesOutputSchema = z.object({
|
|
989
|
+
templates: z.array(
|
|
990
|
+
z.object({
|
|
991
|
+
id: z.string(),
|
|
992
|
+
name: z.string(),
|
|
993
|
+
description: z.string(),
|
|
994
|
+
when_to_use: z.string(),
|
|
995
|
+
interview_focus: z.array(z.string()),
|
|
996
|
+
}),
|
|
997
|
+
),
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
export type ListTemplatesOutput = z.infer<typeof ListTemplatesOutputSchema>;
|
|
1001
|
+
|
|
1002
|
+
export type PrdSummary = z.infer<typeof PrdSummarySchema>;
|
|
1003
|
+
export type ListPrdsOutput = z.infer<typeof ListPrdsOutputSchema>;
|
|
1004
|
+
export type GetPrdInput = z.infer<typeof GetPrdInputSchema>;
|
|
1005
|
+
export type GetPrdOutput = z.infer<typeof GetPrdOutputSchema>;
|
|
1006
|
+
export type CreatePrdInput = z.infer<typeof CreatePrdInputSchema>;
|
|
1007
|
+
export type CreatePrdOutput = z.infer<typeof CreatePrdOutputSchema>;
|
|
1008
|
+
export type DeletePrdInput = z.infer<typeof DeletePrdInputSchema>;
|
|
1009
|
+
export type DeletePrdOutput = z.infer<typeof DeletePrdOutputSchema>;
|
|
1010
|
+
export type AddUserStoryInput = z.infer<typeof AddUserStoryInputSchema>;
|
|
1011
|
+
export type AddUserStoryOutput = z.infer<typeof AddUserStoryOutputSchema>;
|
|
1012
|
+
export type UpdateStoryStatusInput = z.infer<
|
|
1013
|
+
typeof UpdateStoryStatusInputSchema
|
|
1014
|
+
>;
|
|
1015
|
+
export type UpdateStoryStatusOutput = z.infer<
|
|
1016
|
+
typeof UpdateStoryStatusOutputSchema
|
|
1017
|
+
>;
|
|
1018
|
+
export type ExportPrdMarkdownInput = z.infer<
|
|
1019
|
+
typeof ExportPrdMarkdownInputSchema
|
|
1020
|
+
>;
|
|
1021
|
+
export type ExportPrdMarkdownOutput = z.infer<
|
|
1022
|
+
typeof ExportPrdMarkdownOutputSchema
|
|
1023
|
+
>;
|
|
1024
|
+
export type GetImplementationPromptsOutput = z.infer<
|
|
1025
|
+
typeof GetImplementationPromptsOutputSchema
|
|
1026
|
+
>;
|
|
1027
|
+
export type GetImprovementSuggestionsOutput = z.infer<
|
|
1028
|
+
typeof GetImprovementSuggestionsOutputSchema
|
|
1029
|
+
>;
|
|
1030
|
+
export type GetProjectStatusOutput = z.infer<
|
|
1031
|
+
typeof GetProjectStatusOutputSchema
|
|
1032
|
+
>;
|
|
1033
|
+
export type UpdateUserStoryInput = z.infer<typeof UpdateUserStoryInputSchema>;
|
|
1034
|
+
export type UpdateUserStoryOutput = z.infer<typeof UpdateUserStoryOutputSchema>;
|
|
1035
|
+
export type DeleteUserStoryInput = z.infer<typeof DeleteUserStoryInputSchema>;
|
|
1036
|
+
export type DeleteUserStoryOutput = z.infer<typeof DeleteUserStoryOutputSchema>;
|
|
1037
|
+
export type CreateCustomPhaseInput = z.infer<
|
|
1038
|
+
typeof CreateCustomPhaseInputSchema
|
|
1039
|
+
>;
|
|
1040
|
+
export type CreateCustomPhaseOutput = z.infer<
|
|
1041
|
+
typeof CreateCustomPhaseOutputSchema
|
|
1042
|
+
>;
|
|
1043
|
+
export type AssignStoryToPhaseInput = z.infer<
|
|
1044
|
+
typeof AssignStoryToPhaseInputSchema
|
|
1045
|
+
>;
|
|
1046
|
+
export type AssignStoryToPhaseOutput = z.infer<
|
|
1047
|
+
typeof AssignStoryToPhaseOutputSchema
|
|
1048
|
+
>;
|
|
1049
|
+
export type GetNextStoryOutput = z.infer<typeof GetNextStoryOutputSchema>;
|
|
1050
|
+
export type GetStoryInput = z.infer<typeof GetStoryInputSchema>;
|
|
1051
|
+
export type GetStoryOutput = z.infer<typeof GetStoryOutputSchema>;
|
|
1052
|
+
export type AddStoryLogInput = z.infer<typeof AddStoryLogInputSchema>;
|
|
1053
|
+
export type AddStoryLogOutput = z.infer<typeof AddStoryLogOutputSchema>;
|
|
1054
|
+
export type UpdatePrdSectionInput = z.infer<typeof UpdatePrdSectionInputSchema>;
|
|
1055
|
+
export type MarkNotApplicableInput = z.infer<
|
|
1056
|
+
typeof MarkNotApplicableInputSchema
|
|
1057
|
+
>;
|
|
1058
|
+
export type MarkNotApplicableOutput = z.infer<
|
|
1059
|
+
typeof MarkNotApplicableOutputSchema
|
|
1060
|
+
>;
|
|
1061
|
+
export type UpdatePrdSectionOutput = z.infer<
|
|
1062
|
+
typeof UpdatePrdSectionOutputSchema
|
|
1063
|
+
>;
|
|
1064
|
+
export type AddDecisionInput = z.infer<typeof AddDecisionInputSchema>;
|
|
1065
|
+
export type AddDecisionOutput = z.infer<typeof AddDecisionOutputSchema>;
|
|
1066
|
+
export type AddAttachmentInput = z.infer<typeof AddAttachmentInputSchema>;
|
|
1067
|
+
export type AddAttachmentOutput = z.infer<typeof AddAttachmentOutputSchema>;
|
|
1068
|
+
export type UpdateAttachmentInput = z.infer<typeof UpdateAttachmentInputSchema>;
|
|
1069
|
+
export type UpdateAttachmentOutput = z.infer<
|
|
1070
|
+
typeof UpdateAttachmentOutputSchema
|
|
1071
|
+
>;
|
|
1072
|
+
export type RemoveAttachmentInput = z.infer<typeof RemoveAttachmentInputSchema>;
|
|
1073
|
+
export type RemoveAttachmentOutput = z.infer<
|
|
1074
|
+
typeof RemoveAttachmentOutputSchema
|
|
1075
|
+
>;
|
|
1076
|
+
export type StoryAttachment = z.infer<typeof StoryAttachmentSchema>;
|
|
1077
|
+
export type DecideEdgeCaseInput = z.infer<typeof DecideEdgeCaseInputSchema>;
|
|
1078
|
+
export type DecideEdgeCaseOutput = z.infer<typeof DecideEdgeCaseOutputSchema>;
|
|
1079
|
+
export type ResolveOpenQuestionInput = z.infer<
|
|
1080
|
+
typeof ResolveOpenQuestionInputSchema
|
|
1081
|
+
>;
|
|
1082
|
+
export type ResolveOpenQuestionOutput = z.infer<
|
|
1083
|
+
typeof ResolveOpenQuestionOutputSchema
|
|
1084
|
+
>;
|
|
1085
|
+
export type AddGlossaryTermInput = z.infer<typeof AddGlossaryTermInputSchema>;
|
|
1086
|
+
export type AddGlossaryTermOutput = z.infer<typeof AddGlossaryTermOutputSchema>;
|
|
1087
|
+
export type UpdatePhaseInput = z.infer<typeof UpdatePhaseInputSchema>;
|
|
1088
|
+
export type DeletePhaseInput = z.infer<typeof DeletePhaseInputSchema>;
|
|
1089
|
+
export type ReorderPhasesInput = z.infer<typeof ReorderPhasesInputSchema>;
|
|
1090
|
+
export type PhasesOutput = z.infer<typeof PhasesOutputSchema>;
|