@makerkit/prd 0.0.0-stage → 0.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.
Files changed (54) hide show
  1. package/.turbo/turbo-build.log +46 -0
  2. package/.turbo/turbo-test.log +21 -0
  3. package/.turbo/turbo-typecheck.log +1 -0
  4. package/README.md +64 -2
  5. package/dist/LICENSE +21 -0
  6. package/dist/README.md +65 -0
  7. package/dist/index.d.ts +227 -0
  8. package/dist/index.js +1897 -0
  9. package/dist/index.mjs +1791 -0
  10. package/dist/mcp.d.ts +9 -0
  11. package/dist/mcp.js +532 -0
  12. package/dist/mcp.mjs +531 -0
  13. package/dist/node.d.ts +19 -0
  14. package/dist/node.js +94 -0
  15. package/dist/node.mjs +92 -0
  16. package/dist/package.json +49 -0
  17. package/dist/prd.service-DSBp8sMl.d.ts +2327 -0
  18. package/dist/prompts-Bber0S1Z.mjs +778 -0
  19. package/dist/prompts-CIX8IeAx.js +1233 -0
  20. package/package.json +66 -4
  21. package/src/__tests__/agent-workflow.test.ts +377 -0
  22. package/src/__tests__/attachments.test.ts +475 -0
  23. package/src/__tests__/node.test.ts +141 -0
  24. package/src/__tests__/plan-check.test.ts +229 -0
  25. package/src/__tests__/planning.test.ts +1059 -0
  26. package/src/__tests__/prd-operations.test.ts +423 -0
  27. package/src/__tests__/prd.service.test.ts +477 -0
  28. package/src/__tests__/prd.tool.test.ts +282 -0
  29. package/src/__tests__/templates.test.ts +141 -0
  30. package/src/applicability.ts +73 -0
  31. package/src/attachment-paths.ts +78 -0
  32. package/src/attachments.ts +160 -0
  33. package/src/edge-cases.ts +52 -0
  34. package/src/index.ts +35 -0
  35. package/src/markdown.ts +268 -0
  36. package/src/mcp/index.ts +839 -0
  37. package/src/mcp/tool-response.ts +85 -0
  38. package/src/node.ts +146 -0
  39. package/src/open-questions.ts +93 -0
  40. package/src/plan-check.ts +282 -0
  41. package/src/planning-operations.ts +429 -0
  42. package/src/prd-operations.ts +690 -0
  43. package/src/prd.service.ts +1051 -0
  44. package/src/prompts.ts +110 -0
  45. package/src/safe-file-name.ts +42 -0
  46. package/src/schema.ts +976 -0
  47. package/src/templates.ts +173 -0
  48. package/src/testing/fake-mcp-server.ts +81 -0
  49. package/src/types.ts +333 -0
  50. package/tsconfig.json +23 -0
  51. package/tsconfig.lib.json +8 -0
  52. package/tsconfig.spec.json +7 -0
  53. package/tsdown.config.mts +11 -0
  54. package/vitest.config.mts +8 -0
@@ -0,0 +1,2327 @@
1
+ import { z } from "zod/v3";
2
+ //#region src/types.d.ts
3
+ interface CustomPhase {
4
+ id: string;
5
+ name: string;
6
+ description: string;
7
+ color: string;
8
+ order: number;
9
+ userStoryIds: string[];
10
+ }
11
+ type StoryStatus = 'not_started' | 'research' | 'in_progress' | 'review' | 'completed' | 'blocked';
12
+ type StoryPriority = 'P0' | 'P1' | 'P2' | 'P3';
13
+ type StoryComplexity = 'XS' | 'S' | 'M' | 'L' | 'XL';
14
+ /** Recorded when a story is marked completed and the project checks passed. */
15
+ interface StoryVerification {
16
+ verifiedAt: string;
17
+ checks: string[];
18
+ passed: true;
19
+ }
20
+ /**
21
+ * A hand-off note an agent writes when it finishes working on a story, so the
22
+ * next story (often a fresh session with an empty context) knows what changed.
23
+ */
24
+ interface StoryLogEntry {
25
+ at: string;
26
+ /** Plain-language list of what a human should now be able to try. */
27
+ whatsNew: string[];
28
+ /** Decisions, gotchas and file locations for the next agent. */
29
+ technicalNotes: string[];
30
+ /**
31
+ * Where the work departed from the PRD and why, so the person approving
32
+ * the story and the review_story prompt can judge it. Absent when there
33
+ * were none, and on logs written before it existed.
34
+ */
35
+ deviations?: string[];
36
+ }
37
+ interface UserStory {
38
+ id: string;
39
+ title: string;
40
+ userStory: string;
41
+ businessValue: string;
42
+ acceptanceCriteria: string[];
43
+ status: StoryStatus;
44
+ priority: StoryPriority;
45
+ estimatedComplexity: StoryComplexity;
46
+ dependencies: string[];
47
+ notes?: string;
48
+ completedAt?: string;
49
+ verification?: StoryVerification;
50
+ log?: StoryLogEntry[];
51
+ /**
52
+ * Where this story is tested: the public entry points (a route, a server
53
+ * action, a service function) whose behaviour the tests exercise.
54
+ */
55
+ testSeams?: string[];
56
+ /** Ids of the PRD's attachments this story uses, e.g. a mockup. */
57
+ attachmentIds?: string[];
58
+ /**
59
+ * Design notes for this story only: layout, states and copy that the PRD's
60
+ * design guidance does not cover. Binding, like the guidance.
61
+ */
62
+ designNotes?: string[];
63
+ /**
64
+ * Security notes for this story only: the specific abuse to defend against
65
+ * and how. Binding, like the PRD's security considerations.
66
+ */
67
+ securityNotes?: string[];
68
+ }
69
+ /**
70
+ * A file or link the plan refers to: a mockup, a screenshot, reference docs.
71
+ * Files live in the PRD's own folder, `.prds/<prd name>/`, next to its JSON
72
+ * file. Exactly one of `path` and `url` is set.
73
+ */
74
+ interface Attachment {
75
+ id: string;
76
+ title: string;
77
+ /** Relative to the PRD's folder, e.g. `mockups/approve-view.png`. */
78
+ path?: string;
79
+ url?: string;
80
+ /** What to take from it, e.g. "Layout only; colours are placeholders". */
81
+ note?: string;
82
+ }
83
+ /**
84
+ * Something that can go wrong or is easy to get wrong (bad input, partial
85
+ * success, retries, permissions, concurrency, time zones, limits...) and what
86
+ * should happen. An open case is undecided: an agent must ask, not assume.
87
+ */
88
+ interface EdgeCase {
89
+ id: string;
90
+ case: string;
91
+ /** What should happen. Required once the case is decided. */
92
+ expectedBehavior: string;
93
+ status: 'open' | 'decided';
94
+ /** Stories it applies to; absent means the whole PRD. */
95
+ storyIds?: string[];
96
+ }
97
+ /**
98
+ * A decision the plan still needs. Written so a person can answer it without
99
+ * the conversation it came from: why it matters, the options and the
100
+ * recommended one. Answering it records a decision and removes it.
101
+ */
102
+ interface OpenQuestion {
103
+ id: string;
104
+ question: string;
105
+ /** What goes wrong if an agent guesses instead. */
106
+ why?: string;
107
+ options?: string[];
108
+ /** The suggested answer, usually one of the options. */
109
+ recommended?: string;
110
+ /** Stories that cannot be built until it is answered. */
111
+ storyIds?: string[];
112
+ }
113
+ /** Optional parts of a PRD that can be marked not applicable. */
114
+ type NotApplicableTopic = 'dataModel' | 'outsideServices' | 'security' | 'design' | 'qualityBar' | 'edgeCases' | 'rollout' | 'measurement' | 'glossary' | 'risks';
115
+ /** A term the team has agreed on, so people and agents use the same words. */
116
+ interface GlossaryTerm {
117
+ term: string;
118
+ definition: string;
119
+ /** Synonyms that should not be used for this concept. */
120
+ avoid: string[];
121
+ }
122
+ interface RiskItem {
123
+ id: string;
124
+ description: string;
125
+ mitigation: string;
126
+ owner: string;
127
+ severity: 'low' | 'medium' | 'high';
128
+ }
129
+ interface CrossDependency {
130
+ id: string;
131
+ name: string;
132
+ description: string;
133
+ blocking: boolean;
134
+ owner?: string;
135
+ }
136
+ interface DecisionLogEntry {
137
+ id: string;
138
+ date: string;
139
+ decision: string;
140
+ rationale: string;
141
+ owner?: string;
142
+ status: 'proposed' | 'accepted' | 'superseded';
143
+ /**
144
+ * What the decision is about, e.g. `story:US001:dependencies`. Optional so
145
+ * hand-written decision logs stay valid; deleting a story supersedes the
146
+ * accepted decisions whose topic names it.
147
+ */
148
+ topic?: string;
149
+ }
150
+ interface AgentTaskPacket {
151
+ id: string;
152
+ title: string;
153
+ scope: string;
154
+ doneCriteria: string[];
155
+ testPlan: string[];
156
+ likelyFiles: string[];
157
+ linkedStoryIds: string[];
158
+ dependencies: string[];
159
+ }
160
+ interface StoryTraceabilityMap {
161
+ storyId: string;
162
+ featureId: string;
163
+ acceptanceCriteriaIds: string[];
164
+ successMetricIds: string[];
165
+ }
166
+ /**
167
+ * Text fields may use Markdown. Longer text (the overview, problem, solution
168
+ * description, story notes, decision rationale) may use any block Markdown;
169
+ * items of a list (acceptance criteria, non-goals, story log entries...) are
170
+ * rendered as bullets, so they keep to inline Markdown: bold, italics, code
171
+ * and links. Raw HTML is not rendered.
172
+ */
173
+ interface StructuredPRD {
174
+ introduction: {
175
+ title: string;
176
+ overview: string;
177
+ lastUpdated: string;
178
+ };
179
+ problemStatement: {
180
+ problem: string;
181
+ marketOpportunity: string;
182
+ targetUsers: string[];
183
+ };
184
+ solutionOverview: {
185
+ description: string;
186
+ keyFeatures: string[];
187
+ successMetrics: string[];
188
+ };
189
+ nonGoals: string[];
190
+ outOfScope: string[];
191
+ assumptions: string[];
192
+ openQuestions: OpenQuestion[];
193
+ risks: RiskItem[];
194
+ dependencies: CrossDependency[];
195
+ userStories: UserStory[];
196
+ customPhases: CustomPhase[];
197
+ storyTraceability: StoryTraceabilityMap[];
198
+ technicalRequirements: {
199
+ constraints: string[];
200
+ integrationNeeds: string[];
201
+ complianceRequirements: string[];
202
+ };
203
+ technicalContracts: {
204
+ apis: string[];
205
+ dataModels: string[];
206
+ permissions: string[];
207
+ integrationBoundaries: string[];
208
+ };
209
+ acceptanceCriteria: {
210
+ global: string[];
211
+ qualityStandards: string[];
212
+ };
213
+ constraints: {
214
+ timeline: string;
215
+ budget?: string;
216
+ resources: string[];
217
+ nonNegotiables: string[];
218
+ };
219
+ rolloutPlan: {
220
+ featureFlags: string[];
221
+ migrationPlan: string[];
222
+ rolloutPhases: string[];
223
+ rollbackConditions: string[];
224
+ };
225
+ measurementPlan: {
226
+ events: string[];
227
+ dashboards: string[];
228
+ baselineMetrics: string[];
229
+ targetMetrics: string[];
230
+ guardrailMetrics: string[];
231
+ };
232
+ /** Things that can go wrong and what should happen. */
233
+ edgeCases: EdgeCase[];
234
+ /**
235
+ * Standing design rules for every story (components to use, tone, layout,
236
+ * empty and error states...). Individual design choices are decisions with a
237
+ * `design:` topic in the decision log.
238
+ */
239
+ designGuidance: string[];
240
+ /**
241
+ * Standing security rules for every story: input validation, secrets,
242
+ * rate limits, tenant isolation... Who can do what is in
243
+ * technicalContracts.permissions; sensitive data and compliance in
244
+ * technicalRequirements.complianceRequirements.
245
+ */
246
+ securityConsiderations: string[];
247
+ /**
248
+ * Parts that do not apply to this PRD, with the reason. The plan check does
249
+ * not ask for them and agents should not invent them.
250
+ */
251
+ notApplicable: Partial<Record<NotApplicableTopic, string>>;
252
+ decisionLog: DecisionLogEntry[];
253
+ glossary: GlossaryTerm[];
254
+ attachments: Attachment[];
255
+ agentTaskPackets: AgentTaskPacket[];
256
+ changeLog: string[];
257
+ metadata: {
258
+ version: string;
259
+ created: string;
260
+ lastUpdated: string;
261
+ lastValidatedAt: string;
262
+ approver: string;
263
+ /**
264
+ * High-water mark for story numbering. Story ids are quoted in commits and
265
+ * conversations, so a deleted id must never be handed to a different
266
+ * story: `max(existing) + 1` would recycle US002 as soon as US002 (the
267
+ * highest) was deleted. Absent on PRDs written before this existed, which
268
+ * fall back to the highest id present.
269
+ */
270
+ lastStoryNumber?: number;
271
+ /** High-water mark for attachment ids, for the same reason. */
272
+ lastAttachmentNumber?: number;
273
+ /** High-water mark for open question ids, for the same reason. */
274
+ lastQuestionNumber?: number;
275
+ /**
276
+ * Incremented on every save. A write whose PRD was read at an older
277
+ * revision is rejected, so two writers (an agent and the Board) cannot
278
+ * silently overwrite each other. Absent on files written before it existed.
279
+ */
280
+ revision?: number;
281
+ };
282
+ progress: {
283
+ overall: number;
284
+ completed: number;
285
+ total: number;
286
+ blocked: number;
287
+ };
288
+ }
289
+ //#endregion
290
+ //#region src/schema.d.ts
291
+ declare const StoryStatusSchema: z.ZodEnum<["not_started", "research", "in_progress", "review", "completed", "blocked"]>;
292
+ declare const StoryPrioritySchema: z.ZodEnum<["P0", "P1", "P2", "P3"]>;
293
+ declare const StoryComplexitySchema: z.ZodEnum<["XS", "S", "M", "L", "XL"]>;
294
+ declare const PrdSummarySchema: z.ZodObject<{
295
+ filename: z.ZodString;
296
+ title: z.ZodString;
297
+ last_updated: z.ZodString;
298
+ progress: z.ZodNumber;
299
+ total_stories: z.ZodNumber;
300
+ completed_stories: z.ZodNumber;
301
+ blocked_stories: z.ZodNumber;
302
+ }, "strip", z.ZodTypeAny, {
303
+ filename: string;
304
+ title: string;
305
+ last_updated: string;
306
+ progress: number;
307
+ total_stories: number;
308
+ completed_stories: number;
309
+ blocked_stories: number;
310
+ }, {
311
+ filename: string;
312
+ title: string;
313
+ last_updated: string;
314
+ progress: number;
315
+ total_stories: number;
316
+ completed_stories: number;
317
+ blocked_stories: number;
318
+ }>;
319
+ declare const ListPrdsInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
320
+ declare const ListPrdsOutputSchema: z.ZodObject<{
321
+ prds: z.ZodArray<z.ZodObject<{
322
+ filename: z.ZodString;
323
+ title: z.ZodString;
324
+ last_updated: z.ZodString;
325
+ progress: z.ZodNumber;
326
+ total_stories: z.ZodNumber;
327
+ completed_stories: z.ZodNumber;
328
+ blocked_stories: z.ZodNumber;
329
+ }, "strip", z.ZodTypeAny, {
330
+ filename: string;
331
+ title: string;
332
+ last_updated: string;
333
+ progress: number;
334
+ total_stories: number;
335
+ completed_stories: number;
336
+ blocked_stories: number;
337
+ }, {
338
+ filename: string;
339
+ title: string;
340
+ last_updated: string;
341
+ progress: number;
342
+ total_stories: number;
343
+ completed_stories: number;
344
+ blocked_stories: number;
345
+ }>, "many">;
346
+ total: z.ZodNumber;
347
+ prds_dir: z.ZodString;
348
+ /** Files that could not be read or parsed and were skipped. */
349
+ warnings: z.ZodArray<z.ZodString, "many">;
350
+ }, "strip", z.ZodTypeAny, {
351
+ prds: {
352
+ filename: string;
353
+ title: string;
354
+ last_updated: string;
355
+ progress: number;
356
+ total_stories: number;
357
+ completed_stories: number;
358
+ blocked_stories: number;
359
+ }[];
360
+ total: number;
361
+ prds_dir: string;
362
+ warnings: string[];
363
+ }, {
364
+ prds: {
365
+ filename: string;
366
+ title: string;
367
+ last_updated: string;
368
+ progress: number;
369
+ total_stories: number;
370
+ completed_stories: number;
371
+ blocked_stories: number;
372
+ }[];
373
+ total: number;
374
+ prds_dir: string;
375
+ warnings: string[];
376
+ }>;
377
+ declare const GetPrdInputSchema: z.ZodObject<{
378
+ filename: z.ZodString;
379
+ }, "strip", z.ZodTypeAny, {
380
+ filename: string;
381
+ }, {
382
+ filename: string;
383
+ }>;
384
+ declare const GetPrdOutputSchema: z.ZodObject<{
385
+ filename: z.ZodString;
386
+ path: z.ZodString;
387
+ /** Full normalised PRD document. */
388
+ prd: z.ZodType<StructuredPRD, z.ZodTypeDef, StructuredPRD>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ filename: string;
391
+ path: string;
392
+ prd: StructuredPRD;
393
+ }, {
394
+ filename: string;
395
+ path: string;
396
+ prd: StructuredPRD;
397
+ }>;
398
+ declare const CreatePrdInputSchema: z.ZodObject<{
399
+ title: z.ZodString;
400
+ overview: z.ZodString;
401
+ problemStatement: z.ZodString;
402
+ marketOpportunity: z.ZodString;
403
+ targetUsers: z.ZodArray<z.ZodString, "many">;
404
+ solutionDescription: z.ZodString;
405
+ keyFeatures: z.ZodArray<z.ZodString, "many">;
406
+ successMetrics: z.ZodArray<z.ZodString, "many">;
407
+ nonGoals: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
408
+ outOfScope: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
409
+ assumptions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
410
+ openQuestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
411
+ template: z.ZodOptional<z.ZodEnum<["saas-feature", "internal-tool", "integration", "mvp"]>>;
412
+ }, "strip", z.ZodTypeAny, {
413
+ title: string;
414
+ overview: string;
415
+ problemStatement: string;
416
+ marketOpportunity: string;
417
+ targetUsers: string[];
418
+ solutionDescription: string;
419
+ keyFeatures: string[];
420
+ successMetrics: string[];
421
+ nonGoals?: string[] | undefined;
422
+ outOfScope?: string[] | undefined;
423
+ assumptions?: string[] | undefined;
424
+ openQuestions?: string[] | undefined;
425
+ template?: "saas-feature" | "internal-tool" | "integration" | "mvp" | undefined;
426
+ }, {
427
+ title: string;
428
+ overview: string;
429
+ problemStatement: string;
430
+ marketOpportunity: string;
431
+ targetUsers: string[];
432
+ solutionDescription: string;
433
+ keyFeatures: string[];
434
+ successMetrics: string[];
435
+ nonGoals?: string[] | undefined;
436
+ outOfScope?: string[] | undefined;
437
+ assumptions?: string[] | undefined;
438
+ openQuestions?: string[] | undefined;
439
+ template?: "saas-feature" | "internal-tool" | "integration" | "mvp" | undefined;
440
+ }>;
441
+ declare const CreatePrdOutputSchema: z.ZodObject<{
442
+ status: z.ZodLiteral<"success">;
443
+ filename: z.ZodString;
444
+ path: z.ZodString;
445
+ }, "strip", z.ZodTypeAny, {
446
+ filename: string;
447
+ path: string;
448
+ status: "success";
449
+ }, {
450
+ filename: string;
451
+ path: string;
452
+ status: "success";
453
+ }>;
454
+ declare const DeletePrdInputSchema: z.ZodObject<{
455
+ filename: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ filename: string;
458
+ }, {
459
+ filename: string;
460
+ }>;
461
+ declare const DeletePrdOutputSchema: z.ZodObject<{
462
+ status: z.ZodLiteral<"success">;
463
+ filename: z.ZodString;
464
+ }, "strip", z.ZodTypeAny, {
465
+ filename: string;
466
+ status: "success";
467
+ }, {
468
+ filename: string;
469
+ status: "success";
470
+ }>;
471
+ declare const AddUserStoryInputSchema: z.ZodObject<{
472
+ filename: z.ZodString;
473
+ userType: z.ZodString;
474
+ action: z.ZodString;
475
+ benefit: z.ZodString;
476
+ acceptanceCriteria: z.ZodArray<z.ZodString, "many">;
477
+ priority: z.ZodDefault<z.ZodEnum<["P0", "P1", "P2", "P3"]>>;
478
+ /** Defaults to the first few words of `action`, which is rarely what you want. */
479
+ title: z.ZodOptional<z.ZodString>;
480
+ /**
481
+ * Defaults to a guess from the number of acceptance criteria — a measure of
482
+ * how verbose the story is, not how hard it is. Set it explicitly.
483
+ */
484
+ estimatedComplexity: z.ZodOptional<z.ZodEnum<["XS", "S", "M", "L", "XL"]>>;
485
+ testSeams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
486
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
487
+ phaseId: z.ZodOptional<z.ZodString>;
488
+ attachmentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
489
+ designNotes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
490
+ securityNotes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ filename: string;
493
+ userType: string;
494
+ action: string;
495
+ benefit: string;
496
+ acceptanceCriteria: string[];
497
+ priority: "P0" | "P1" | "P2" | "P3";
498
+ title?: string | undefined;
499
+ estimatedComplexity?: "XS" | "S" | "M" | "L" | "XL" | undefined;
500
+ testSeams?: string[] | undefined;
501
+ dependencies?: string[] | undefined;
502
+ phaseId?: string | undefined;
503
+ attachmentIds?: string[] | undefined;
504
+ designNotes?: string[] | undefined;
505
+ securityNotes?: string[] | undefined;
506
+ }, {
507
+ filename: string;
508
+ userType: string;
509
+ action: string;
510
+ benefit: string;
511
+ acceptanceCriteria: string[];
512
+ title?: string | undefined;
513
+ priority?: "P0" | "P1" | "P2" | "P3" | undefined;
514
+ estimatedComplexity?: "XS" | "S" | "M" | "L" | "XL" | undefined;
515
+ testSeams?: string[] | undefined;
516
+ dependencies?: string[] | undefined;
517
+ phaseId?: string | undefined;
518
+ attachmentIds?: string[] | undefined;
519
+ designNotes?: string[] | undefined;
520
+ securityNotes?: string[] | undefined;
521
+ }>;
522
+ declare const AddUserStoryOutputSchema: z.ZodObject<{
523
+ story_id: z.ZodString;
524
+ title: z.ZodString;
525
+ complexity: z.ZodEnum<["XS", "S", "M", "L", "XL"]>;
526
+ total_stories: z.ZodNumber;
527
+ }, "strip", z.ZodTypeAny, {
528
+ title: string;
529
+ total_stories: number;
530
+ story_id: string;
531
+ complexity: "XS" | "S" | "M" | "L" | "XL";
532
+ }, {
533
+ title: string;
534
+ total_stories: number;
535
+ story_id: string;
536
+ complexity: "XS" | "S" | "M" | "L" | "XL";
537
+ }>;
538
+ declare const UpdateStoryStatusInputSchema: z.ZodObject<{
539
+ filename: z.ZodString;
540
+ storyId: z.ZodString;
541
+ status: z.ZodEnum<["not_started", "research", "in_progress", "review", "completed", "blocked"]>;
542
+ notes: z.ZodOptional<z.ZodString>;
543
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
544
+ }, "strip", z.ZodTypeAny, {
545
+ filename: string;
546
+ status: "not_started" | "research" | "in_progress" | "review" | "completed" | "blocked";
547
+ storyId: string;
548
+ notes?: string | undefined;
549
+ expectedRevision?: number | undefined;
550
+ }, {
551
+ filename: string;
552
+ status: "not_started" | "research" | "in_progress" | "review" | "completed" | "blocked";
553
+ storyId: string;
554
+ notes?: string | undefined;
555
+ expectedRevision?: number | undefined;
556
+ }>;
557
+ declare const StoryVerificationSchema: z.ZodObject<{
558
+ verified_at: z.ZodString;
559
+ checks: z.ZodArray<z.ZodString, "many">;
560
+ passed: z.ZodLiteral<true>;
561
+ }, "strip", z.ZodTypeAny, {
562
+ verified_at: string;
563
+ checks: string[];
564
+ passed: true;
565
+ }, {
566
+ verified_at: string;
567
+ checks: string[];
568
+ passed: true;
569
+ }>;
570
+ declare const UpdateStoryStatusOutputSchema: z.ZodObject<{
571
+ story_id: z.ZodString;
572
+ title: z.ZodString;
573
+ status: z.ZodEnum<["not_started", "research", "in_progress", "review", "completed", "blocked"]>;
574
+ progress: z.ZodNumber;
575
+ /** Present only when the story was marked completed and checks ran. */
576
+ verification: z.ZodNullable<z.ZodObject<{
577
+ verified_at: z.ZodString;
578
+ checks: z.ZodArray<z.ZodString, "many">;
579
+ passed: z.ZodLiteral<true>;
580
+ }, "strip", z.ZodTypeAny, {
581
+ verified_at: string;
582
+ checks: string[];
583
+ passed: true;
584
+ }, {
585
+ verified_at: string;
586
+ checks: string[];
587
+ passed: true;
588
+ }>>;
589
+ }, "strip", z.ZodTypeAny, {
590
+ title: string;
591
+ progress: number;
592
+ status: "not_started" | "research" | "in_progress" | "review" | "completed" | "blocked";
593
+ story_id: string;
594
+ verification: {
595
+ verified_at: string;
596
+ checks: string[];
597
+ passed: true;
598
+ } | null;
599
+ }, {
600
+ title: string;
601
+ progress: number;
602
+ status: "not_started" | "research" | "in_progress" | "review" | "completed" | "blocked";
603
+ story_id: string;
604
+ verification: {
605
+ verified_at: string;
606
+ checks: string[];
607
+ passed: true;
608
+ } | null;
609
+ }>;
610
+ declare const UpdateUserStoryInputSchema: z.ZodObject<{
611
+ filename: z.ZodString;
612
+ storyId: z.ZodString;
613
+ /** Every field is optional: only the ones supplied are changed. */
614
+ title: z.ZodOptional<z.ZodString>;
615
+ userType: z.ZodOptional<z.ZodString>;
616
+ action: z.ZodOptional<z.ZodString>;
617
+ benefit: z.ZodOptional<z.ZodString>;
618
+ businessValue: z.ZodOptional<z.ZodString>;
619
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
620
+ priority: z.ZodOptional<z.ZodEnum<["P0", "P1", "P2", "P3"]>>;
621
+ estimatedComplexity: z.ZodOptional<z.ZodEnum<["XS", "S", "M", "L", "XL"]>>;
622
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
623
+ notes: z.ZodOptional<z.ZodString>;
624
+ testSeams: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
625
+ attachmentIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
626
+ designNotes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
627
+ securityNotes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
628
+ phaseId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
629
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
630
+ }, "strip", z.ZodTypeAny, {
631
+ filename: string;
632
+ storyId: string;
633
+ title?: string | undefined;
634
+ userType?: string | undefined;
635
+ action?: string | undefined;
636
+ benefit?: string | undefined;
637
+ acceptanceCriteria?: string[] | undefined;
638
+ priority?: "P0" | "P1" | "P2" | "P3" | undefined;
639
+ estimatedComplexity?: "XS" | "S" | "M" | "L" | "XL" | undefined;
640
+ testSeams?: string[] | undefined;
641
+ dependencies?: string[] | undefined;
642
+ phaseId?: string | null | undefined;
643
+ attachmentIds?: string[] | undefined;
644
+ designNotes?: string[] | undefined;
645
+ securityNotes?: string[] | undefined;
646
+ notes?: string | undefined;
647
+ expectedRevision?: number | undefined;
648
+ businessValue?: string | undefined;
649
+ }, {
650
+ filename: string;
651
+ storyId: string;
652
+ title?: string | undefined;
653
+ userType?: string | undefined;
654
+ action?: string | undefined;
655
+ benefit?: string | undefined;
656
+ acceptanceCriteria?: string[] | undefined;
657
+ priority?: "P0" | "P1" | "P2" | "P3" | undefined;
658
+ estimatedComplexity?: "XS" | "S" | "M" | "L" | "XL" | undefined;
659
+ testSeams?: string[] | undefined;
660
+ dependencies?: string[] | undefined;
661
+ phaseId?: string | null | undefined;
662
+ attachmentIds?: string[] | undefined;
663
+ designNotes?: string[] | undefined;
664
+ securityNotes?: string[] | undefined;
665
+ notes?: string | undefined;
666
+ expectedRevision?: number | undefined;
667
+ businessValue?: string | undefined;
668
+ }>;
669
+ declare const UpdateUserStoryOutputSchema: z.ZodObject<{
670
+ story_id: z.ZodString;
671
+ title: z.ZodString;
672
+ updated_fields: z.ZodArray<z.ZodString, "many">;
673
+ story: z.ZodRecord<z.ZodString, z.ZodUnknown>;
674
+ }, "strip", z.ZodTypeAny, {
675
+ title: string;
676
+ story_id: string;
677
+ updated_fields: string[];
678
+ story: Record<string, unknown>;
679
+ }, {
680
+ title: string;
681
+ story_id: string;
682
+ updated_fields: string[];
683
+ story: Record<string, unknown>;
684
+ }>;
685
+ declare const DeleteUserStoryInputSchema: z.ZodObject<{
686
+ filename: z.ZodString;
687
+ storyId: z.ZodString;
688
+ }, "strip", z.ZodTypeAny, {
689
+ filename: string;
690
+ storyId: string;
691
+ }, {
692
+ filename: string;
693
+ storyId: string;
694
+ }>;
695
+ declare const DeleteUserStoryOutputSchema: z.ZodObject<{
696
+ story_id: z.ZodString;
697
+ title: z.ZodString;
698
+ total_stories: z.ZodNumber;
699
+ progress: z.ZodNumber;
700
+ /** Stories that listed the deleted one as a dependency, now cleaned up. */
701
+ dependency_references_removed: z.ZodArray<z.ZodString, "many">;
702
+ phases_updated: z.ZodArray<z.ZodString, "many">;
703
+ }, "strip", z.ZodTypeAny, {
704
+ title: string;
705
+ progress: number;
706
+ total_stories: number;
707
+ story_id: string;
708
+ dependency_references_removed: string[];
709
+ phases_updated: string[];
710
+ }, {
711
+ title: string;
712
+ progress: number;
713
+ total_stories: number;
714
+ story_id: string;
715
+ dependency_references_removed: string[];
716
+ phases_updated: string[];
717
+ }>;
718
+ declare const CreateCustomPhaseInputSchema: z.ZodObject<{
719
+ filename: z.ZodString;
720
+ name: z.ZodString;
721
+ description: z.ZodDefault<z.ZodString>;
722
+ color: z.ZodDefault<z.ZodString>;
723
+ }, "strip", z.ZodTypeAny, {
724
+ filename: string;
725
+ name: string;
726
+ description: string;
727
+ color: string;
728
+ }, {
729
+ filename: string;
730
+ name: string;
731
+ description?: string | undefined;
732
+ color?: string | undefined;
733
+ }>;
734
+ declare const CustomPhaseSchema: z.ZodObject<{
735
+ id: z.ZodString;
736
+ name: z.ZodString;
737
+ description: z.ZodString;
738
+ color: z.ZodString;
739
+ order: z.ZodNumber;
740
+ user_story_ids: z.ZodArray<z.ZodString, "many">;
741
+ }, "strip", z.ZodTypeAny, {
742
+ name: string;
743
+ description: string;
744
+ color: string;
745
+ id: string;
746
+ order: number;
747
+ user_story_ids: string[];
748
+ }, {
749
+ name: string;
750
+ description: string;
751
+ color: string;
752
+ id: string;
753
+ order: number;
754
+ user_story_ids: string[];
755
+ }>;
756
+ declare const CreateCustomPhaseOutputSchema: z.ZodObject<{
757
+ phase: z.ZodObject<{
758
+ id: z.ZodString;
759
+ name: z.ZodString;
760
+ description: z.ZodString;
761
+ color: z.ZodString;
762
+ order: z.ZodNumber;
763
+ user_story_ids: z.ZodArray<z.ZodString, "many">;
764
+ }, "strip", z.ZodTypeAny, {
765
+ name: string;
766
+ description: string;
767
+ color: string;
768
+ id: string;
769
+ order: number;
770
+ user_story_ids: string[];
771
+ }, {
772
+ name: string;
773
+ description: string;
774
+ color: string;
775
+ id: string;
776
+ order: number;
777
+ user_story_ids: string[];
778
+ }>;
779
+ total_phases: z.ZodNumber;
780
+ }, "strip", z.ZodTypeAny, {
781
+ phase: {
782
+ name: string;
783
+ description: string;
784
+ color: string;
785
+ id: string;
786
+ order: number;
787
+ user_story_ids: string[];
788
+ };
789
+ total_phases: number;
790
+ }, {
791
+ phase: {
792
+ name: string;
793
+ description: string;
794
+ color: string;
795
+ id: string;
796
+ order: number;
797
+ user_story_ids: string[];
798
+ };
799
+ total_phases: number;
800
+ }>;
801
+ declare const AssignStoryToPhaseInputSchema: z.ZodObject<{
802
+ filename: z.ZodString;
803
+ storyId: z.ZodString;
804
+ /** Omit to remove the story from every phase. */
805
+ phaseId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
806
+ }, "strip", z.ZodTypeAny, {
807
+ filename: string;
808
+ phaseId: string | null;
809
+ storyId: string;
810
+ }, {
811
+ filename: string;
812
+ storyId: string;
813
+ phaseId?: string | null | undefined;
814
+ }>;
815
+ declare const AssignStoryToPhaseOutputSchema: z.ZodObject<{
816
+ story_id: z.ZodString;
817
+ phase_id: z.ZodNullable<z.ZodString>;
818
+ phase_name: z.ZodNullable<z.ZodString>;
819
+ moved_from: z.ZodNullable<z.ZodString>;
820
+ }, "strip", z.ZodTypeAny, {
821
+ story_id: string;
822
+ phase_id: string | null;
823
+ phase_name: string | null;
824
+ moved_from: string | null;
825
+ }, {
826
+ story_id: string;
827
+ phase_id: string | null;
828
+ phase_name: string | null;
829
+ moved_from: string | null;
830
+ }>;
831
+ declare const ExportPrdMarkdownInputSchema: z.ZodObject<{
832
+ filename: z.ZodString;
833
+ }, "strip", z.ZodTypeAny, {
834
+ filename: string;
835
+ }, {
836
+ filename: string;
837
+ }>;
838
+ declare const ExportPrdMarkdownOutputSchema: z.ZodObject<{
839
+ markdown_file: z.ZodString;
840
+ path: z.ZodString;
841
+ }, "strip", z.ZodTypeAny, {
842
+ path: string;
843
+ markdown_file: string;
844
+ }, {
845
+ path: string;
846
+ markdown_file: string;
847
+ }>;
848
+ declare const GetImplementationPromptsInputSchema: z.ZodObject<{
849
+ filename: z.ZodString;
850
+ }, "strip", z.ZodTypeAny, {
851
+ filename: string;
852
+ }, {
853
+ filename: string;
854
+ }>;
855
+ declare const GetImplementationPromptsOutputSchema: z.ZodObject<{
856
+ prompts: z.ZodArray<z.ZodString, "many">;
857
+ total: z.ZodNumber;
858
+ }, "strip", z.ZodTypeAny, {
859
+ total: number;
860
+ prompts: string[];
861
+ }, {
862
+ total: number;
863
+ prompts: string[];
864
+ }>;
865
+ declare const GetImprovementSuggestionsInputSchema: z.ZodObject<{
866
+ filename: z.ZodString;
867
+ }, "strip", z.ZodTypeAny, {
868
+ filename: string;
869
+ }, {
870
+ filename: string;
871
+ }>;
872
+ declare const GetImprovementSuggestionsOutputSchema: z.ZodObject<{
873
+ suggestions: z.ZodArray<z.ZodString, "many">;
874
+ total: z.ZodNumber;
875
+ }, "strip", z.ZodTypeAny, {
876
+ total: number;
877
+ suggestions: string[];
878
+ }, {
879
+ total: number;
880
+ suggestions: string[];
881
+ }>;
882
+ declare const GetProjectStatusInputSchema: z.ZodObject<{
883
+ filename: z.ZodString;
884
+ }, "strip", z.ZodTypeAny, {
885
+ filename: string;
886
+ }, {
887
+ filename: string;
888
+ }>;
889
+ declare const GetProjectStatusOutputSchema: z.ZodObject<{
890
+ progress: z.ZodNumber;
891
+ summary: z.ZodString;
892
+ next_steps: z.ZodArray<z.ZodString, "many">;
893
+ blockers: z.ZodArray<z.ZodObject<{
894
+ id: z.ZodString;
895
+ title: z.ZodString;
896
+ notes: z.ZodNullable<z.ZodString>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ title: string;
899
+ notes: string | null;
900
+ id: string;
901
+ }, {
902
+ title: string;
903
+ notes: string | null;
904
+ id: string;
905
+ }>, "many">;
906
+ open_questions: z.ZodArray<z.ZodString, "many">;
907
+ high_risks: z.ZodArray<z.ZodObject<{
908
+ id: z.ZodString;
909
+ description: z.ZodString;
910
+ mitigation: z.ZodString;
911
+ owner: z.ZodString;
912
+ }, "strip", z.ZodTypeAny, {
913
+ description: string;
914
+ id: string;
915
+ mitigation: string;
916
+ owner: string;
917
+ }, {
918
+ description: string;
919
+ id: string;
920
+ mitigation: string;
921
+ owner: string;
922
+ }>, "many">;
923
+ }, "strip", z.ZodTypeAny, {
924
+ progress: number;
925
+ summary: string;
926
+ next_steps: string[];
927
+ blockers: {
928
+ title: string;
929
+ notes: string | null;
930
+ id: string;
931
+ }[];
932
+ open_questions: string[];
933
+ high_risks: {
934
+ description: string;
935
+ id: string;
936
+ mitigation: string;
937
+ owner: string;
938
+ }[];
939
+ }, {
940
+ progress: number;
941
+ summary: string;
942
+ next_steps: string[];
943
+ blockers: {
944
+ title: string;
945
+ notes: string | null;
946
+ id: string;
947
+ }[];
948
+ open_questions: string[];
949
+ high_risks: {
950
+ description: string;
951
+ id: string;
952
+ mitigation: string;
953
+ owner: string;
954
+ }[];
955
+ }>;
956
+ declare const StoryLogEntrySchema: z.ZodObject<{
957
+ at: z.ZodString;
958
+ whatsNew: z.ZodArray<z.ZodString, "many">;
959
+ technicalNotes: z.ZodArray<z.ZodString, "many">;
960
+ deviations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
961
+ }, "strip", z.ZodTypeAny, {
962
+ at: string;
963
+ whatsNew: string[];
964
+ technicalNotes: string[];
965
+ deviations?: string[] | undefined;
966
+ }, {
967
+ at: string;
968
+ whatsNew: string[];
969
+ technicalNotes: string[];
970
+ deviations?: string[] | undefined;
971
+ }>;
972
+ declare const GetNextStoryInputSchema: z.ZodObject<{
973
+ filename: z.ZodString;
974
+ }, "strip", z.ZodTypeAny, {
975
+ filename: string;
976
+ }, {
977
+ filename: string;
978
+ }>;
979
+ declare const GetNextStoryOutputSchema: z.ZodObject<{
980
+ /** Null when nothing is ready: all done, in progress, or waiting. */
981
+ story: z.ZodNullable<z.ZodType<UserStory, z.ZodTypeDef, UserStory>>;
982
+ ready_count: z.ZodNumber;
983
+ in_progress: z.ZodArray<z.ZodString, "many">;
984
+ waiting: z.ZodArray<z.ZodObject<{
985
+ id: z.ZodString;
986
+ title: z.ZodString;
987
+ waiting_on: z.ZodArray<z.ZodString, "many">;
988
+ }, "strip", z.ZodTypeAny, {
989
+ title: string;
990
+ id: string;
991
+ waiting_on: string[];
992
+ }, {
993
+ title: string;
994
+ id: string;
995
+ waiting_on: string[];
996
+ }>, "many">;
997
+ }, "strip", z.ZodTypeAny, {
998
+ in_progress: string[];
999
+ story: UserStory | null;
1000
+ ready_count: number;
1001
+ waiting: {
1002
+ title: string;
1003
+ id: string;
1004
+ waiting_on: string[];
1005
+ }[];
1006
+ }, {
1007
+ in_progress: string[];
1008
+ story: UserStory | null;
1009
+ ready_count: number;
1010
+ waiting: {
1011
+ title: string;
1012
+ id: string;
1013
+ waiting_on: string[];
1014
+ }[];
1015
+ }>;
1016
+ declare const GetStoryInputSchema: z.ZodObject<{
1017
+ filename: z.ZodString;
1018
+ storyId: z.ZodString;
1019
+ }, "strip", z.ZodTypeAny, {
1020
+ filename: string;
1021
+ storyId: string;
1022
+ }, {
1023
+ filename: string;
1024
+ storyId: string;
1025
+ }>;
1026
+ /** An attachment with its file path relative to the project root. */
1027
+ declare const StoryAttachmentSchema: z.ZodObject<{
1028
+ id: z.ZodString;
1029
+ title: z.ZodString;
1030
+ path: z.ZodOptional<z.ZodString>;
1031
+ url: z.ZodOptional<z.ZodString>;
1032
+ note: z.ZodOptional<z.ZodString>;
1033
+ }, "strip", z.ZodTypeAny, {
1034
+ title: string;
1035
+ id: string;
1036
+ path?: string | undefined;
1037
+ url?: string | undefined;
1038
+ note?: string | undefined;
1039
+ }, {
1040
+ title: string;
1041
+ id: string;
1042
+ path?: string | undefined;
1043
+ url?: string | undefined;
1044
+ note?: string | undefined;
1045
+ }>;
1046
+ declare const GetStoryOutputSchema: z.ZodObject<{
1047
+ prd: z.ZodObject<{
1048
+ title: z.ZodString;
1049
+ overview: z.ZodString;
1050
+ non_goals: z.ZodArray<z.ZodString, "many">;
1051
+ out_of_scope: z.ZodArray<z.ZodString, "many">;
1052
+ global_acceptance_criteria: z.ZodArray<z.ZodString, "many">;
1053
+ /** Every attachment in the PRD, for references shared across stories. */
1054
+ attachments: z.ZodArray<z.ZodObject<{
1055
+ id: z.ZodString;
1056
+ title: z.ZodString;
1057
+ path: z.ZodOptional<z.ZodString>;
1058
+ url: z.ZodOptional<z.ZodString>;
1059
+ note: z.ZodOptional<z.ZodString>;
1060
+ }, "strip", z.ZodTypeAny, {
1061
+ title: string;
1062
+ id: string;
1063
+ path?: string | undefined;
1064
+ url?: string | undefined;
1065
+ note?: string | undefined;
1066
+ }, {
1067
+ title: string;
1068
+ id: string;
1069
+ path?: string | undefined;
1070
+ url?: string | undefined;
1071
+ note?: string | undefined;
1072
+ }>, "many">;
1073
+ }, "strip", z.ZodTypeAny, {
1074
+ title: string;
1075
+ overview: string;
1076
+ non_goals: string[];
1077
+ out_of_scope: string[];
1078
+ global_acceptance_criteria: string[];
1079
+ attachments: {
1080
+ title: string;
1081
+ id: string;
1082
+ path?: string | undefined;
1083
+ url?: string | undefined;
1084
+ note?: string | undefined;
1085
+ }[];
1086
+ }, {
1087
+ title: string;
1088
+ overview: string;
1089
+ non_goals: string[];
1090
+ out_of_scope: string[];
1091
+ global_acceptance_criteria: string[];
1092
+ attachments: {
1093
+ title: string;
1094
+ id: string;
1095
+ path?: string | undefined;
1096
+ url?: string | undefined;
1097
+ note?: string | undefined;
1098
+ }[];
1099
+ }>;
1100
+ story: z.ZodType<UserStory, z.ZodTypeDef, UserStory>;
1101
+ /** The attachments this story uses. */
1102
+ attachments: z.ZodArray<z.ZodObject<{
1103
+ id: z.ZodString;
1104
+ title: z.ZodString;
1105
+ path: z.ZodOptional<z.ZodString>;
1106
+ url: z.ZodOptional<z.ZodString>;
1107
+ note: z.ZodOptional<z.ZodString>;
1108
+ }, "strip", z.ZodTypeAny, {
1109
+ title: string;
1110
+ id: string;
1111
+ path?: string | undefined;
1112
+ url?: string | undefined;
1113
+ note?: string | undefined;
1114
+ }, {
1115
+ title: string;
1116
+ id: string;
1117
+ path?: string | undefined;
1118
+ url?: string | undefined;
1119
+ note?: string | undefined;
1120
+ }>, "many">;
1121
+ phase: z.ZodNullable<z.ZodObject<{
1122
+ id: z.ZodString;
1123
+ name: z.ZodString;
1124
+ }, "strip", z.ZodTypeAny, {
1125
+ name: string;
1126
+ id: string;
1127
+ }, {
1128
+ name: string;
1129
+ id: string;
1130
+ }>>;
1131
+ /**
1132
+ * Edge cases for this story (linked to it, or to the whole PRD). Decided
1133
+ * ones are binding behaviour; open ones must be asked about, not assumed.
1134
+ */
1135
+ edge_cases: z.ZodArray<z.ZodObject<{
1136
+ id: z.ZodString;
1137
+ case: z.ZodString;
1138
+ expectedBehavior: z.ZodString;
1139
+ status: z.ZodEnum<["open", "decided"]>;
1140
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1141
+ }, "strip", z.ZodTypeAny, {
1142
+ status: "open" | "decided";
1143
+ id: string;
1144
+ case: string;
1145
+ expectedBehavior: string;
1146
+ storyIds?: string[] | undefined;
1147
+ }, {
1148
+ status: "open" | "decided";
1149
+ id: string;
1150
+ case: string;
1151
+ expectedBehavior: string;
1152
+ storyIds?: string[] | undefined;
1153
+ }>, "many">;
1154
+ /** Open questions that block this story: ask, do not guess. */
1155
+ open_questions: z.ZodArray<z.ZodObject<{
1156
+ id: z.ZodString;
1157
+ question: z.ZodString;
1158
+ why: z.ZodOptional<z.ZodString>;
1159
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1160
+ recommended: z.ZodOptional<z.ZodString>;
1161
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1162
+ }, "strip", z.ZodTypeAny, {
1163
+ id: string;
1164
+ question: string;
1165
+ options?: string[] | undefined;
1166
+ storyIds?: string[] | undefined;
1167
+ why?: string | undefined;
1168
+ recommended?: string | undefined;
1169
+ }, {
1170
+ id: string;
1171
+ question: string;
1172
+ options?: string[] | undefined;
1173
+ storyIds?: string[] | undefined;
1174
+ why?: string | undefined;
1175
+ recommended?: string | undefined;
1176
+ }>, "many">;
1177
+ /** Who can do what, sensitive data and standing security rules. Binding. */
1178
+ security: z.ZodObject<{
1179
+ permissions: z.ZodArray<z.ZodString, "many">;
1180
+ compliance: z.ZodArray<z.ZodString, "many">;
1181
+ considerations: z.ZodArray<z.ZodString, "many">;
1182
+ }, "strip", z.ZodTypeAny, {
1183
+ permissions: string[];
1184
+ compliance: string[];
1185
+ considerations: string[];
1186
+ }, {
1187
+ permissions: string[];
1188
+ compliance: string[];
1189
+ considerations: string[];
1190
+ }>;
1191
+ /** Parts of the PRD that do not apply, with the reason: do not invent them. */
1192
+ not_applicable: z.ZodRecord<z.ZodString, z.ZodString>;
1193
+ /** Standing design rules and accepted design decisions. */
1194
+ design: z.ZodObject<{
1195
+ guidance: z.ZodArray<z.ZodString, "many">;
1196
+ decisions: z.ZodArray<z.ZodObject<{
1197
+ id: z.ZodString;
1198
+ decision: z.ZodString;
1199
+ rationale: z.ZodString;
1200
+ }, "strip", z.ZodTypeAny, {
1201
+ id: string;
1202
+ decision: string;
1203
+ rationale: string;
1204
+ }, {
1205
+ id: string;
1206
+ decision: string;
1207
+ rationale: string;
1208
+ }>, "many">;
1209
+ }, "strip", z.ZodTypeAny, {
1210
+ guidance: string[];
1211
+ decisions: {
1212
+ id: string;
1213
+ decision: string;
1214
+ rationale: string;
1215
+ }[];
1216
+ }, {
1217
+ guidance: string[];
1218
+ decisions: {
1219
+ id: string;
1220
+ decision: string;
1221
+ rationale: string;
1222
+ }[];
1223
+ }>;
1224
+ dependencies: z.ZodArray<z.ZodObject<{
1225
+ id: z.ZodString;
1226
+ title: z.ZodNullable<z.ZodString>;
1227
+ status: z.ZodNullable<z.ZodString>;
1228
+ log: z.ZodArray<z.ZodObject<{
1229
+ at: z.ZodString;
1230
+ whatsNew: z.ZodArray<z.ZodString, "many">;
1231
+ technicalNotes: z.ZodArray<z.ZodString, "many">;
1232
+ deviations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1233
+ }, "strip", z.ZodTypeAny, {
1234
+ at: string;
1235
+ whatsNew: string[];
1236
+ technicalNotes: string[];
1237
+ deviations?: string[] | undefined;
1238
+ }, {
1239
+ at: string;
1240
+ whatsNew: string[];
1241
+ technicalNotes: string[];
1242
+ deviations?: string[] | undefined;
1243
+ }>, "many">;
1244
+ }, "strip", z.ZodTypeAny, {
1245
+ title: string | null;
1246
+ status: string | null;
1247
+ id: string;
1248
+ log: {
1249
+ at: string;
1250
+ whatsNew: string[];
1251
+ technicalNotes: string[];
1252
+ deviations?: string[] | undefined;
1253
+ }[];
1254
+ }, {
1255
+ title: string | null;
1256
+ status: string | null;
1257
+ id: string;
1258
+ log: {
1259
+ at: string;
1260
+ whatsNew: string[];
1261
+ technicalNotes: string[];
1262
+ deviations?: string[] | undefined;
1263
+ }[];
1264
+ }>, "many">;
1265
+ previous_story: z.ZodNullable<z.ZodObject<{
1266
+ id: z.ZodString;
1267
+ title: z.ZodString;
1268
+ log: z.ZodArray<z.ZodObject<{
1269
+ at: z.ZodString;
1270
+ whatsNew: z.ZodArray<z.ZodString, "many">;
1271
+ technicalNotes: z.ZodArray<z.ZodString, "many">;
1272
+ deviations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1273
+ }, "strip", z.ZodTypeAny, {
1274
+ at: string;
1275
+ whatsNew: string[];
1276
+ technicalNotes: string[];
1277
+ deviations?: string[] | undefined;
1278
+ }, {
1279
+ at: string;
1280
+ whatsNew: string[];
1281
+ technicalNotes: string[];
1282
+ deviations?: string[] | undefined;
1283
+ }>, "many">;
1284
+ }, "strip", z.ZodTypeAny, {
1285
+ title: string;
1286
+ id: string;
1287
+ log: {
1288
+ at: string;
1289
+ whatsNew: string[];
1290
+ technicalNotes: string[];
1291
+ deviations?: string[] | undefined;
1292
+ }[];
1293
+ }, {
1294
+ title: string;
1295
+ id: string;
1296
+ log: {
1297
+ at: string;
1298
+ whatsNew: string[];
1299
+ technicalNotes: string[];
1300
+ deviations?: string[] | undefined;
1301
+ }[];
1302
+ }>>;
1303
+ }, "strip", z.ZodTypeAny, {
1304
+ prd: {
1305
+ title: string;
1306
+ overview: string;
1307
+ non_goals: string[];
1308
+ out_of_scope: string[];
1309
+ global_acceptance_criteria: string[];
1310
+ attachments: {
1311
+ title: string;
1312
+ id: string;
1313
+ path?: string | undefined;
1314
+ url?: string | undefined;
1315
+ note?: string | undefined;
1316
+ }[];
1317
+ };
1318
+ dependencies: {
1319
+ title: string | null;
1320
+ status: string | null;
1321
+ id: string;
1322
+ log: {
1323
+ at: string;
1324
+ whatsNew: string[];
1325
+ technicalNotes: string[];
1326
+ deviations?: string[] | undefined;
1327
+ }[];
1328
+ }[];
1329
+ story: UserStory;
1330
+ phase: {
1331
+ name: string;
1332
+ id: string;
1333
+ } | null;
1334
+ open_questions: {
1335
+ id: string;
1336
+ question: string;
1337
+ options?: string[] | undefined;
1338
+ storyIds?: string[] | undefined;
1339
+ why?: string | undefined;
1340
+ recommended?: string | undefined;
1341
+ }[];
1342
+ attachments: {
1343
+ title: string;
1344
+ id: string;
1345
+ path?: string | undefined;
1346
+ url?: string | undefined;
1347
+ note?: string | undefined;
1348
+ }[];
1349
+ edge_cases: {
1350
+ status: "open" | "decided";
1351
+ id: string;
1352
+ case: string;
1353
+ expectedBehavior: string;
1354
+ storyIds?: string[] | undefined;
1355
+ }[];
1356
+ security: {
1357
+ permissions: string[];
1358
+ compliance: string[];
1359
+ considerations: string[];
1360
+ };
1361
+ not_applicable: Record<string, string>;
1362
+ design: {
1363
+ guidance: string[];
1364
+ decisions: {
1365
+ id: string;
1366
+ decision: string;
1367
+ rationale: string;
1368
+ }[];
1369
+ };
1370
+ previous_story: {
1371
+ title: string;
1372
+ id: string;
1373
+ log: {
1374
+ at: string;
1375
+ whatsNew: string[];
1376
+ technicalNotes: string[];
1377
+ deviations?: string[] | undefined;
1378
+ }[];
1379
+ } | null;
1380
+ }, {
1381
+ prd: {
1382
+ title: string;
1383
+ overview: string;
1384
+ non_goals: string[];
1385
+ out_of_scope: string[];
1386
+ global_acceptance_criteria: string[];
1387
+ attachments: {
1388
+ title: string;
1389
+ id: string;
1390
+ path?: string | undefined;
1391
+ url?: string | undefined;
1392
+ note?: string | undefined;
1393
+ }[];
1394
+ };
1395
+ dependencies: {
1396
+ title: string | null;
1397
+ status: string | null;
1398
+ id: string;
1399
+ log: {
1400
+ at: string;
1401
+ whatsNew: string[];
1402
+ technicalNotes: string[];
1403
+ deviations?: string[] | undefined;
1404
+ }[];
1405
+ }[];
1406
+ story: UserStory;
1407
+ phase: {
1408
+ name: string;
1409
+ id: string;
1410
+ } | null;
1411
+ open_questions: {
1412
+ id: string;
1413
+ question: string;
1414
+ options?: string[] | undefined;
1415
+ storyIds?: string[] | undefined;
1416
+ why?: string | undefined;
1417
+ recommended?: string | undefined;
1418
+ }[];
1419
+ attachments: {
1420
+ title: string;
1421
+ id: string;
1422
+ path?: string | undefined;
1423
+ url?: string | undefined;
1424
+ note?: string | undefined;
1425
+ }[];
1426
+ edge_cases: {
1427
+ status: "open" | "decided";
1428
+ id: string;
1429
+ case: string;
1430
+ expectedBehavior: string;
1431
+ storyIds?: string[] | undefined;
1432
+ }[];
1433
+ security: {
1434
+ permissions: string[];
1435
+ compliance: string[];
1436
+ considerations: string[];
1437
+ };
1438
+ not_applicable: Record<string, string>;
1439
+ design: {
1440
+ guidance: string[];
1441
+ decisions: {
1442
+ id: string;
1443
+ decision: string;
1444
+ rationale: string;
1445
+ }[];
1446
+ };
1447
+ previous_story: {
1448
+ title: string;
1449
+ id: string;
1450
+ log: {
1451
+ at: string;
1452
+ whatsNew: string[];
1453
+ technicalNotes: string[];
1454
+ deviations?: string[] | undefined;
1455
+ }[];
1456
+ } | null;
1457
+ }>;
1458
+ declare const AddStoryLogInputSchema: z.ZodObject<{
1459
+ filename: z.ZodString;
1460
+ storyId: z.ZodString;
1461
+ whatsNew: z.ZodArray<z.ZodString, "many">;
1462
+ technicalNotes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1463
+ deviations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1464
+ }, "strip", z.ZodTypeAny, {
1465
+ filename: string;
1466
+ storyId: string;
1467
+ whatsNew: string[];
1468
+ technicalNotes: string[];
1469
+ deviations?: string[] | undefined;
1470
+ }, {
1471
+ filename: string;
1472
+ storyId: string;
1473
+ whatsNew: string[];
1474
+ technicalNotes?: string[] | undefined;
1475
+ deviations?: string[] | undefined;
1476
+ }>;
1477
+ declare const AddStoryLogOutputSchema: z.ZodObject<{
1478
+ story_id: z.ZodString;
1479
+ entries: z.ZodNumber;
1480
+ }, "strip", z.ZodTypeAny, {
1481
+ entries: number;
1482
+ story_id: string;
1483
+ }, {
1484
+ entries: number;
1485
+ story_id: string;
1486
+ }>;
1487
+ /**
1488
+ * Accepted `value` for each `update_prd_section` section. Object sections are
1489
+ * merged (only the keys supplied change); list sections are replaced.
1490
+ */
1491
+ declare const PrdSectionValueSchemas: {
1492
+ readonly introduction: z.ZodObject<{
1493
+ title: z.ZodOptional<z.ZodString>;
1494
+ overview: z.ZodOptional<z.ZodString>;
1495
+ }, "strict", z.ZodTypeAny, {
1496
+ title?: string | undefined;
1497
+ overview?: string | undefined;
1498
+ }, {
1499
+ title?: string | undefined;
1500
+ overview?: string | undefined;
1501
+ }>;
1502
+ readonly problemStatement: z.ZodObject<{
1503
+ problem: z.ZodOptional<z.ZodString>;
1504
+ marketOpportunity: z.ZodOptional<z.ZodString>;
1505
+ targetUsers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1506
+ }, "strict", z.ZodTypeAny, {
1507
+ marketOpportunity?: string | undefined;
1508
+ targetUsers?: string[] | undefined;
1509
+ problem?: string | undefined;
1510
+ }, {
1511
+ marketOpportunity?: string | undefined;
1512
+ targetUsers?: string[] | undefined;
1513
+ problem?: string | undefined;
1514
+ }>;
1515
+ readonly solutionOverview: z.ZodObject<{
1516
+ description: z.ZodOptional<z.ZodString>;
1517
+ keyFeatures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1518
+ successMetrics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1519
+ }, "strict", z.ZodTypeAny, {
1520
+ keyFeatures?: string[] | undefined;
1521
+ successMetrics?: string[] | undefined;
1522
+ description?: string | undefined;
1523
+ }, {
1524
+ keyFeatures?: string[] | undefined;
1525
+ successMetrics?: string[] | undefined;
1526
+ description?: string | undefined;
1527
+ }>;
1528
+ readonly nonGoals: z.ZodArray<z.ZodString, "many">;
1529
+ readonly outOfScope: z.ZodArray<z.ZodString, "many">;
1530
+ readonly assumptions: z.ZodArray<z.ZodString, "many">;
1531
+ readonly openQuestions: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
1532
+ id: z.ZodOptional<z.ZodString>;
1533
+ question: z.ZodString;
1534
+ why: z.ZodOptional<z.ZodString>;
1535
+ options: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1536
+ recommended: z.ZodOptional<z.ZodString>;
1537
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1538
+ }, "strip", z.ZodTypeAny, {
1539
+ question: string;
1540
+ options?: string[] | undefined;
1541
+ id?: string | undefined;
1542
+ storyIds?: string[] | undefined;
1543
+ why?: string | undefined;
1544
+ recommended?: string | undefined;
1545
+ }, {
1546
+ question: string;
1547
+ options?: string[] | undefined;
1548
+ id?: string | undefined;
1549
+ storyIds?: string[] | undefined;
1550
+ why?: string | undefined;
1551
+ recommended?: string | undefined;
1552
+ }>]>, "many">;
1553
+ readonly technicalRequirements: z.ZodObject<{
1554
+ constraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1555
+ integrationNeeds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1556
+ complianceRequirements: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1557
+ }, "strict", z.ZodTypeAny, {
1558
+ constraints?: string[] | undefined;
1559
+ integrationNeeds?: string[] | undefined;
1560
+ complianceRequirements?: string[] | undefined;
1561
+ }, {
1562
+ constraints?: string[] | undefined;
1563
+ integrationNeeds?: string[] | undefined;
1564
+ complianceRequirements?: string[] | undefined;
1565
+ }>;
1566
+ readonly technicalContracts: z.ZodObject<{
1567
+ apis: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1568
+ dataModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1569
+ permissions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1570
+ integrationBoundaries: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1571
+ }, "strict", z.ZodTypeAny, {
1572
+ permissions?: string[] | undefined;
1573
+ apis?: string[] | undefined;
1574
+ dataModels?: string[] | undefined;
1575
+ integrationBoundaries?: string[] | undefined;
1576
+ }, {
1577
+ permissions?: string[] | undefined;
1578
+ apis?: string[] | undefined;
1579
+ dataModels?: string[] | undefined;
1580
+ integrationBoundaries?: string[] | undefined;
1581
+ }>;
1582
+ readonly acceptanceCriteria: z.ZodObject<{
1583
+ global: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1584
+ qualityStandards: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1585
+ }, "strict", z.ZodTypeAny, {
1586
+ global?: string[] | undefined;
1587
+ qualityStandards?: string[] | undefined;
1588
+ }, {
1589
+ global?: string[] | undefined;
1590
+ qualityStandards?: string[] | undefined;
1591
+ }>;
1592
+ readonly constraints: z.ZodObject<{
1593
+ timeline: z.ZodOptional<z.ZodString>;
1594
+ budget: z.ZodOptional<z.ZodString>;
1595
+ resources: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1596
+ nonNegotiables: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1597
+ }, "strict", z.ZodTypeAny, {
1598
+ timeline?: string | undefined;
1599
+ budget?: string | undefined;
1600
+ resources?: string[] | undefined;
1601
+ nonNegotiables?: string[] | undefined;
1602
+ }, {
1603
+ timeline?: string | undefined;
1604
+ budget?: string | undefined;
1605
+ resources?: string[] | undefined;
1606
+ nonNegotiables?: string[] | undefined;
1607
+ }>;
1608
+ readonly rolloutPlan: z.ZodObject<{
1609
+ featureFlags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1610
+ migrationPlan: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1611
+ rolloutPhases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1612
+ rollbackConditions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1613
+ }, "strict", z.ZodTypeAny, {
1614
+ featureFlags?: string[] | undefined;
1615
+ migrationPlan?: string[] | undefined;
1616
+ rolloutPhases?: string[] | undefined;
1617
+ rollbackConditions?: string[] | undefined;
1618
+ }, {
1619
+ featureFlags?: string[] | undefined;
1620
+ migrationPlan?: string[] | undefined;
1621
+ rolloutPhases?: string[] | undefined;
1622
+ rollbackConditions?: string[] | undefined;
1623
+ }>;
1624
+ readonly measurementPlan: z.ZodObject<{
1625
+ events: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1626
+ dashboards: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1627
+ baselineMetrics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1628
+ targetMetrics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1629
+ guardrailMetrics: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1630
+ }, "strict", z.ZodTypeAny, {
1631
+ events?: string[] | undefined;
1632
+ dashboards?: string[] | undefined;
1633
+ baselineMetrics?: string[] | undefined;
1634
+ targetMetrics?: string[] | undefined;
1635
+ guardrailMetrics?: string[] | undefined;
1636
+ }, {
1637
+ events?: string[] | undefined;
1638
+ dashboards?: string[] | undefined;
1639
+ baselineMetrics?: string[] | undefined;
1640
+ targetMetrics?: string[] | undefined;
1641
+ guardrailMetrics?: string[] | undefined;
1642
+ }>;
1643
+ readonly risks: z.ZodArray<z.ZodObject<{
1644
+ id: z.ZodOptional<z.ZodString>;
1645
+ description: z.ZodString;
1646
+ mitigation: z.ZodString;
1647
+ owner: z.ZodString;
1648
+ severity: z.ZodEnum<["low", "medium", "high"]>;
1649
+ }, "strip", z.ZodTypeAny, {
1650
+ description: string;
1651
+ mitigation: string;
1652
+ owner: string;
1653
+ severity: "low" | "medium" | "high";
1654
+ id?: string | undefined;
1655
+ }, {
1656
+ description: string;
1657
+ mitigation: string;
1658
+ owner: string;
1659
+ severity: "low" | "medium" | "high";
1660
+ id?: string | undefined;
1661
+ }>, "many">;
1662
+ readonly dependencies: z.ZodArray<z.ZodObject<{
1663
+ id: z.ZodOptional<z.ZodString>;
1664
+ name: z.ZodString;
1665
+ description: z.ZodString;
1666
+ blocking: z.ZodBoolean;
1667
+ owner: z.ZodOptional<z.ZodString>;
1668
+ }, "strip", z.ZodTypeAny, {
1669
+ name: string;
1670
+ description: string;
1671
+ blocking: boolean;
1672
+ id?: string | undefined;
1673
+ owner?: string | undefined;
1674
+ }, {
1675
+ name: string;
1676
+ description: string;
1677
+ blocking: boolean;
1678
+ id?: string | undefined;
1679
+ owner?: string | undefined;
1680
+ }>, "many">;
1681
+ readonly edgeCases: z.ZodArray<z.ZodEffects<z.ZodObject<{
1682
+ id: z.ZodOptional<z.ZodString>;
1683
+ case: z.ZodString;
1684
+ expectedBehavior: z.ZodDefault<z.ZodString>;
1685
+ status: z.ZodDefault<z.ZodEnum<["open", "decided"]>>;
1686
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1687
+ }, "strip", z.ZodTypeAny, {
1688
+ status: "open" | "decided";
1689
+ case: string;
1690
+ expectedBehavior: string;
1691
+ id?: string | undefined;
1692
+ storyIds?: string[] | undefined;
1693
+ }, {
1694
+ case: string;
1695
+ status?: "open" | "decided" | undefined;
1696
+ id?: string | undefined;
1697
+ expectedBehavior?: string | undefined;
1698
+ storyIds?: string[] | undefined;
1699
+ }>, {
1700
+ status: "open" | "decided";
1701
+ case: string;
1702
+ expectedBehavior: string;
1703
+ id?: string | undefined;
1704
+ storyIds?: string[] | undefined;
1705
+ }, {
1706
+ case: string;
1707
+ status?: "open" | "decided" | undefined;
1708
+ id?: string | undefined;
1709
+ expectedBehavior?: string | undefined;
1710
+ storyIds?: string[] | undefined;
1711
+ }>, "many">;
1712
+ readonly designGuidance: z.ZodArray<z.ZodString, "many">;
1713
+ readonly securityConsiderations: z.ZodArray<z.ZodString, "many">;
1714
+ };
1715
+ type PrdSection = keyof typeof PrdSectionValueSchemas;
1716
+ declare const UpdatePrdSectionInputSchema: z.ZodObject<{
1717
+ filename: z.ZodString;
1718
+ section: z.ZodEnum<["problemStatement" | "nonGoals" | "outOfScope" | "assumptions" | "openQuestions" | "acceptanceCriteria" | "dependencies" | "constraints" | "introduction" | "solutionOverview" | "technicalRequirements" | "technicalContracts" | "rolloutPlan" | "measurementPlan" | "risks" | "edgeCases" | "designGuidance" | "securityConsiderations", ...("problemStatement" | "nonGoals" | "outOfScope" | "assumptions" | "openQuestions" | "acceptanceCriteria" | "dependencies" | "constraints" | "introduction" | "solutionOverview" | "technicalRequirements" | "technicalContracts" | "rolloutPlan" | "measurementPlan" | "risks" | "edgeCases" | "designGuidance" | "securityConsiderations")[]]>;
1719
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1720
+ value: z.ZodUnknown;
1721
+ }, "strip", z.ZodTypeAny, {
1722
+ filename: string;
1723
+ section: "problemStatement" | "nonGoals" | "outOfScope" | "assumptions" | "openQuestions" | "acceptanceCriteria" | "dependencies" | "constraints" | "introduction" | "solutionOverview" | "technicalRequirements" | "technicalContracts" | "rolloutPlan" | "measurementPlan" | "risks" | "edgeCases" | "designGuidance" | "securityConsiderations";
1724
+ value?: unknown;
1725
+ expectedRevision?: number | undefined;
1726
+ }, {
1727
+ filename: string;
1728
+ section: "problemStatement" | "nonGoals" | "outOfScope" | "assumptions" | "openQuestions" | "acceptanceCriteria" | "dependencies" | "constraints" | "introduction" | "solutionOverview" | "technicalRequirements" | "technicalContracts" | "rolloutPlan" | "measurementPlan" | "risks" | "edgeCases" | "designGuidance" | "securityConsiderations";
1729
+ value?: unknown;
1730
+ expectedRevision?: number | undefined;
1731
+ }>;
1732
+ declare const UpdatePrdSectionOutputSchema: z.ZodObject<{
1733
+ section: z.ZodString;
1734
+ updated: z.ZodArray<z.ZodString, "many">;
1735
+ }, "strip", z.ZodTypeAny, {
1736
+ section: string;
1737
+ updated: string[];
1738
+ }, {
1739
+ section: string;
1740
+ updated: string[];
1741
+ }>;
1742
+ declare const NotApplicableTopicSchema: z.ZodEnum<["dataModel", "outsideServices", "security", "design", "qualityBar", "edgeCases", "rollout", "measurement", "glossary", "risks"]>;
1743
+ declare const MarkNotApplicableInputSchema: z.ZodObject<{
1744
+ filename: z.ZodString;
1745
+ topic: z.ZodEnum<["dataModel", "outsideServices", "security", "design", "qualityBar", "edgeCases", "rollout", "measurement", "glossary", "risks"]>;
1746
+ notApplicable: z.ZodDefault<z.ZodBoolean>;
1747
+ reason: z.ZodOptional<z.ZodString>;
1748
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1749
+ }, "strip", z.ZodTypeAny, {
1750
+ filename: string;
1751
+ topic: "security" | "design" | "risks" | "edgeCases" | "dataModel" | "outsideServices" | "qualityBar" | "rollout" | "measurement" | "glossary";
1752
+ notApplicable: boolean;
1753
+ expectedRevision?: number | undefined;
1754
+ reason?: string | undefined;
1755
+ }, {
1756
+ filename: string;
1757
+ topic: "security" | "design" | "risks" | "edgeCases" | "dataModel" | "outsideServices" | "qualityBar" | "rollout" | "measurement" | "glossary";
1758
+ expectedRevision?: number | undefined;
1759
+ notApplicable?: boolean | undefined;
1760
+ reason?: string | undefined;
1761
+ }>;
1762
+ declare const MarkNotApplicableOutputSchema: z.ZodObject<{
1763
+ topic: z.ZodEnum<["dataModel", "outsideServices", "security", "design", "qualityBar", "edgeCases", "rollout", "measurement", "glossary", "risks"]>;
1764
+ not_applicable: z.ZodBoolean;
1765
+ reason: z.ZodNullable<z.ZodString>;
1766
+ }, "strip", z.ZodTypeAny, {
1767
+ not_applicable: boolean;
1768
+ topic: "security" | "design" | "risks" | "edgeCases" | "dataModel" | "outsideServices" | "qualityBar" | "rollout" | "measurement" | "glossary";
1769
+ reason: string | null;
1770
+ }, {
1771
+ not_applicable: boolean;
1772
+ topic: "security" | "design" | "risks" | "edgeCases" | "dataModel" | "outsideServices" | "qualityBar" | "rollout" | "measurement" | "glossary";
1773
+ reason: string | null;
1774
+ }>;
1775
+ declare const AddDecisionInputSchema: z.ZodObject<{
1776
+ filename: z.ZodString;
1777
+ decision: z.ZodString;
1778
+ rationale: z.ZodString;
1779
+ owner: z.ZodOptional<z.ZodString>;
1780
+ topic: z.ZodOptional<z.ZodString>;
1781
+ status: z.ZodDefault<z.ZodEnum<["proposed", "accepted"]>>;
1782
+ supersedes: z.ZodOptional<z.ZodString>;
1783
+ }, "strip", z.ZodTypeAny, {
1784
+ filename: string;
1785
+ status: "proposed" | "accepted";
1786
+ decision: string;
1787
+ rationale: string;
1788
+ owner?: string | undefined;
1789
+ topic?: string | undefined;
1790
+ supersedes?: string | undefined;
1791
+ }, {
1792
+ filename: string;
1793
+ decision: string;
1794
+ rationale: string;
1795
+ status?: "proposed" | "accepted" | undefined;
1796
+ owner?: string | undefined;
1797
+ topic?: string | undefined;
1798
+ supersedes?: string | undefined;
1799
+ }>;
1800
+ declare const AddDecisionOutputSchema: z.ZodObject<{
1801
+ decision_id: z.ZodString;
1802
+ superseded: z.ZodNullable<z.ZodString>;
1803
+ total_decisions: z.ZodNumber;
1804
+ }, "strip", z.ZodTypeAny, {
1805
+ decision_id: string;
1806
+ superseded: string | null;
1807
+ total_decisions: number;
1808
+ }, {
1809
+ decision_id: string;
1810
+ superseded: string | null;
1811
+ total_decisions: number;
1812
+ }>;
1813
+ declare const AddAttachmentInputSchema: z.ZodObject<{
1814
+ filename: z.ZodString;
1815
+ title: z.ZodString;
1816
+ path: z.ZodOptional<z.ZodString>;
1817
+ url: z.ZodOptional<z.ZodString>;
1818
+ note: z.ZodOptional<z.ZodString>;
1819
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1820
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1821
+ }, "strip", z.ZodTypeAny, {
1822
+ filename: string;
1823
+ title: string;
1824
+ path?: string | undefined;
1825
+ expectedRevision?: number | undefined;
1826
+ url?: string | undefined;
1827
+ note?: string | undefined;
1828
+ storyIds?: string[] | undefined;
1829
+ }, {
1830
+ filename: string;
1831
+ title: string;
1832
+ path?: string | undefined;
1833
+ expectedRevision?: number | undefined;
1834
+ url?: string | undefined;
1835
+ note?: string | undefined;
1836
+ storyIds?: string[] | undefined;
1837
+ }>;
1838
+ declare const AddAttachmentOutputSchema: z.ZodObject<{
1839
+ attachment_id: z.ZodString;
1840
+ /** The file relative to the project root, or null for a link. */
1841
+ path: z.ZodNullable<z.ZodString>;
1842
+ stories_updated: z.ZodArray<z.ZodString, "many">;
1843
+ total_attachments: z.ZodNumber;
1844
+ }, "strip", z.ZodTypeAny, {
1845
+ path: string | null;
1846
+ attachment_id: string;
1847
+ stories_updated: string[];
1848
+ total_attachments: number;
1849
+ }, {
1850
+ path: string | null;
1851
+ attachment_id: string;
1852
+ stories_updated: string[];
1853
+ total_attachments: number;
1854
+ }>;
1855
+ declare const RemoveAttachmentInputSchema: z.ZodObject<{
1856
+ filename: z.ZodString;
1857
+ attachmentId: z.ZodString;
1858
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1859
+ }, "strip", z.ZodTypeAny, {
1860
+ filename: string;
1861
+ attachmentId: string;
1862
+ expectedRevision?: number | undefined;
1863
+ }, {
1864
+ filename: string;
1865
+ attachmentId: string;
1866
+ expectedRevision?: number | undefined;
1867
+ }>;
1868
+ declare const UpdateAttachmentInputSchema: z.ZodObject<{
1869
+ filename: z.ZodString;
1870
+ attachmentId: z.ZodString;
1871
+ title: z.ZodOptional<z.ZodString>;
1872
+ note: z.ZodOptional<z.ZodString>;
1873
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1874
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1875
+ }, "strip", z.ZodTypeAny, {
1876
+ filename: string;
1877
+ attachmentId: string;
1878
+ title?: string | undefined;
1879
+ expectedRevision?: number | undefined;
1880
+ note?: string | undefined;
1881
+ storyIds?: string[] | undefined;
1882
+ }, {
1883
+ filename: string;
1884
+ attachmentId: string;
1885
+ title?: string | undefined;
1886
+ expectedRevision?: number | undefined;
1887
+ note?: string | undefined;
1888
+ storyIds?: string[] | undefined;
1889
+ }>;
1890
+ declare const UpdateAttachmentOutputSchema: z.ZodObject<{
1891
+ attachment_id: z.ZodString;
1892
+ stories_updated: z.ZodArray<z.ZodString, "many">;
1893
+ }, "strip", z.ZodTypeAny, {
1894
+ attachment_id: string;
1895
+ stories_updated: string[];
1896
+ }, {
1897
+ attachment_id: string;
1898
+ stories_updated: string[];
1899
+ }>;
1900
+ declare const RemoveAttachmentOutputSchema: z.ZodObject<{
1901
+ attachment_id: z.ZodString;
1902
+ stories_updated: z.ZodArray<z.ZodString, "many">;
1903
+ total_attachments: z.ZodNumber;
1904
+ }, "strip", z.ZodTypeAny, {
1905
+ attachment_id: string;
1906
+ stories_updated: string[];
1907
+ total_attachments: number;
1908
+ }, {
1909
+ attachment_id: string;
1910
+ stories_updated: string[];
1911
+ total_attachments: number;
1912
+ }>;
1913
+ declare const ResolveOpenQuestionInputSchema: z.ZodEffects<z.ZodObject<{
1914
+ filename: z.ZodString;
1915
+ questionId: z.ZodOptional<z.ZodString>;
1916
+ question: z.ZodOptional<z.ZodString>;
1917
+ answer: z.ZodString;
1918
+ recordDecision: z.ZodDefault<z.ZodBoolean>;
1919
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1920
+ }, "strip", z.ZodTypeAny, {
1921
+ filename: string;
1922
+ answer: string;
1923
+ recordDecision: boolean;
1924
+ expectedRevision?: number | undefined;
1925
+ question?: string | undefined;
1926
+ questionId?: string | undefined;
1927
+ }, {
1928
+ filename: string;
1929
+ answer: string;
1930
+ expectedRevision?: number | undefined;
1931
+ question?: string | undefined;
1932
+ questionId?: string | undefined;
1933
+ recordDecision?: boolean | undefined;
1934
+ }>, {
1935
+ filename: string;
1936
+ answer: string;
1937
+ recordDecision: boolean;
1938
+ expectedRevision?: number | undefined;
1939
+ question?: string | undefined;
1940
+ questionId?: string | undefined;
1941
+ }, {
1942
+ filename: string;
1943
+ answer: string;
1944
+ expectedRevision?: number | undefined;
1945
+ question?: string | undefined;
1946
+ questionId?: string | undefined;
1947
+ recordDecision?: boolean | undefined;
1948
+ }>;
1949
+ declare const DecideEdgeCaseInputSchema: z.ZodObject<{
1950
+ filename: z.ZodString;
1951
+ edgeCaseId: z.ZodString;
1952
+ expectedBehavior: z.ZodString;
1953
+ expectedRevision: z.ZodOptional<z.ZodNumber>;
1954
+ }, "strip", z.ZodTypeAny, {
1955
+ filename: string;
1956
+ expectedBehavior: string;
1957
+ edgeCaseId: string;
1958
+ expectedRevision?: number | undefined;
1959
+ }, {
1960
+ filename: string;
1961
+ expectedBehavior: string;
1962
+ edgeCaseId: string;
1963
+ expectedRevision?: number | undefined;
1964
+ }>;
1965
+ declare const DecideEdgeCaseOutputSchema: z.ZodObject<{
1966
+ edge_case_id: z.ZodString;
1967
+ open_edge_cases: z.ZodNumber;
1968
+ }, "strip", z.ZodTypeAny, {
1969
+ edge_case_id: string;
1970
+ open_edge_cases: number;
1971
+ }, {
1972
+ edge_case_id: string;
1973
+ open_edge_cases: number;
1974
+ }>;
1975
+ declare const ResolveOpenQuestionOutputSchema: z.ZodObject<{
1976
+ remaining_questions: z.ZodNumber;
1977
+ decision_id: z.ZodNullable<z.ZodString>;
1978
+ }, "strip", z.ZodTypeAny, {
1979
+ decision_id: string | null;
1980
+ remaining_questions: number;
1981
+ }, {
1982
+ decision_id: string | null;
1983
+ remaining_questions: number;
1984
+ }>;
1985
+ declare const AddGlossaryTermInputSchema: z.ZodObject<{
1986
+ filename: z.ZodString;
1987
+ term: z.ZodString;
1988
+ definition: z.ZodString;
1989
+ avoid: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1990
+ }, "strip", z.ZodTypeAny, {
1991
+ filename: string;
1992
+ term: string;
1993
+ definition: string;
1994
+ avoid: string[];
1995
+ }, {
1996
+ filename: string;
1997
+ term: string;
1998
+ definition: string;
1999
+ avoid?: string[] | undefined;
2000
+ }>;
2001
+ declare const AddGlossaryTermOutputSchema: z.ZodObject<{
2002
+ term: z.ZodString;
2003
+ replaced: z.ZodBoolean;
2004
+ total_terms: z.ZodNumber;
2005
+ }, "strip", z.ZodTypeAny, {
2006
+ term: string;
2007
+ replaced: boolean;
2008
+ total_terms: number;
2009
+ }, {
2010
+ term: string;
2011
+ replaced: boolean;
2012
+ total_terms: number;
2013
+ }>;
2014
+ declare const UpdatePhaseInputSchema: z.ZodObject<{
2015
+ filename: z.ZodString;
2016
+ phaseId: z.ZodString;
2017
+ name: z.ZodOptional<z.ZodString>;
2018
+ description: z.ZodOptional<z.ZodString>;
2019
+ color: z.ZodOptional<z.ZodString>;
2020
+ }, "strip", z.ZodTypeAny, {
2021
+ filename: string;
2022
+ phaseId: string;
2023
+ name?: string | undefined;
2024
+ description?: string | undefined;
2025
+ color?: string | undefined;
2026
+ }, {
2027
+ filename: string;
2028
+ phaseId: string;
2029
+ name?: string | undefined;
2030
+ description?: string | undefined;
2031
+ color?: string | undefined;
2032
+ }>;
2033
+ declare const DeletePhaseInputSchema: z.ZodObject<{
2034
+ filename: z.ZodString;
2035
+ phaseId: z.ZodString;
2036
+ }, "strip", z.ZodTypeAny, {
2037
+ filename: string;
2038
+ phaseId: string;
2039
+ }, {
2040
+ filename: string;
2041
+ phaseId: string;
2042
+ }>;
2043
+ declare const ReorderPhasesInputSchema: z.ZodObject<{
2044
+ filename: z.ZodString;
2045
+ phaseIds: z.ZodArray<z.ZodString, "many">;
2046
+ }, "strip", z.ZodTypeAny, {
2047
+ filename: string;
2048
+ phaseIds: string[];
2049
+ }, {
2050
+ filename: string;
2051
+ phaseIds: string[];
2052
+ }>;
2053
+ declare const PhasesOutputSchema: z.ZodObject<{
2054
+ phases: z.ZodArray<z.ZodObject<{
2055
+ id: z.ZodString;
2056
+ name: z.ZodString;
2057
+ order: z.ZodNumber;
2058
+ user_story_ids: z.ZodArray<z.ZodString, "many">;
2059
+ }, "strip", z.ZodTypeAny, {
2060
+ name: string;
2061
+ id: string;
2062
+ order: number;
2063
+ user_story_ids: string[];
2064
+ }, {
2065
+ name: string;
2066
+ id: string;
2067
+ order: number;
2068
+ user_story_ids: string[];
2069
+ }>, "many">;
2070
+ }, "strip", z.ZodTypeAny, {
2071
+ phases: {
2072
+ name: string;
2073
+ id: string;
2074
+ order: number;
2075
+ user_story_ids: string[];
2076
+ }[];
2077
+ }, {
2078
+ phases: {
2079
+ name: string;
2080
+ id: string;
2081
+ order: number;
2082
+ user_story_ids: string[];
2083
+ }[];
2084
+ }>;
2085
+ declare const CheckPlanInputSchema: z.ZodObject<{
2086
+ filename: z.ZodString;
2087
+ }, "strip", z.ZodTypeAny, {
2088
+ filename: string;
2089
+ }, {
2090
+ filename: string;
2091
+ }>;
2092
+ declare const CheckPlanOutputSchema: z.ZodObject<{
2093
+ /** False while any required item is open. */
2094
+ ready_to_build: z.ZodBoolean;
2095
+ items: z.ZodArray<z.ZodObject<{
2096
+ id: z.ZodString;
2097
+ section: z.ZodString;
2098
+ message: z.ZodString;
2099
+ severity: z.ZodEnum<["required", "recommended"]>;
2100
+ storyIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2101
+ }, "strip", z.ZodTypeAny, {
2102
+ message: string;
2103
+ id: string;
2104
+ severity: "recommended" | "required";
2105
+ section: string;
2106
+ storyIds?: string[] | undefined;
2107
+ }, {
2108
+ message: string;
2109
+ id: string;
2110
+ severity: "recommended" | "required";
2111
+ section: string;
2112
+ storyIds?: string[] | undefined;
2113
+ }>, "many">;
2114
+ }, "strip", z.ZodTypeAny, {
2115
+ ready_to_build: boolean;
2116
+ items: {
2117
+ message: string;
2118
+ id: string;
2119
+ severity: "recommended" | "required";
2120
+ section: string;
2121
+ storyIds?: string[] | undefined;
2122
+ }[];
2123
+ }, {
2124
+ ready_to_build: boolean;
2125
+ items: {
2126
+ message: string;
2127
+ id: string;
2128
+ severity: "recommended" | "required";
2129
+ section: string;
2130
+ storyIds?: string[] | undefined;
2131
+ }[];
2132
+ }>;
2133
+ type CheckPlanOutput = z.infer<typeof CheckPlanOutputSchema>;
2134
+ declare const ListTemplatesInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
2135
+ declare const ListTemplatesOutputSchema: z.ZodObject<{
2136
+ templates: z.ZodArray<z.ZodObject<{
2137
+ id: z.ZodString;
2138
+ name: z.ZodString;
2139
+ description: z.ZodString;
2140
+ when_to_use: z.ZodString;
2141
+ }, "strip", z.ZodTypeAny, {
2142
+ name: string;
2143
+ description: string;
2144
+ id: string;
2145
+ when_to_use: string;
2146
+ }, {
2147
+ name: string;
2148
+ description: string;
2149
+ id: string;
2150
+ when_to_use: string;
2151
+ }>, "many">;
2152
+ }, "strip", z.ZodTypeAny, {
2153
+ templates: {
2154
+ name: string;
2155
+ description: string;
2156
+ id: string;
2157
+ when_to_use: string;
2158
+ }[];
2159
+ }, {
2160
+ templates: {
2161
+ name: string;
2162
+ description: string;
2163
+ id: string;
2164
+ when_to_use: string;
2165
+ }[];
2166
+ }>;
2167
+ type ListTemplatesOutput = z.infer<typeof ListTemplatesOutputSchema>;
2168
+ type PrdSummary = z.infer<typeof PrdSummarySchema>;
2169
+ type ListPrdsOutput = z.infer<typeof ListPrdsOutputSchema>;
2170
+ type GetPrdInput = z.infer<typeof GetPrdInputSchema>;
2171
+ type GetPrdOutput = z.infer<typeof GetPrdOutputSchema>;
2172
+ type CreatePrdInput = z.infer<typeof CreatePrdInputSchema>;
2173
+ type CreatePrdOutput = z.infer<typeof CreatePrdOutputSchema>;
2174
+ type DeletePrdInput = z.infer<typeof DeletePrdInputSchema>;
2175
+ type DeletePrdOutput = z.infer<typeof DeletePrdOutputSchema>;
2176
+ type AddUserStoryInput = z.infer<typeof AddUserStoryInputSchema>;
2177
+ type AddUserStoryOutput = z.infer<typeof AddUserStoryOutputSchema>;
2178
+ type UpdateStoryStatusInput = z.infer<typeof UpdateStoryStatusInputSchema>;
2179
+ type UpdateStoryStatusOutput = z.infer<typeof UpdateStoryStatusOutputSchema>;
2180
+ type ExportPrdMarkdownInput = z.infer<typeof ExportPrdMarkdownInputSchema>;
2181
+ type ExportPrdMarkdownOutput = z.infer<typeof ExportPrdMarkdownOutputSchema>;
2182
+ type GetImplementationPromptsOutput = z.infer<typeof GetImplementationPromptsOutputSchema>;
2183
+ type GetImprovementSuggestionsOutput = z.infer<typeof GetImprovementSuggestionsOutputSchema>;
2184
+ type GetProjectStatusOutput = z.infer<typeof GetProjectStatusOutputSchema>;
2185
+ type UpdateUserStoryInput = z.infer<typeof UpdateUserStoryInputSchema>;
2186
+ type UpdateUserStoryOutput = z.infer<typeof UpdateUserStoryOutputSchema>;
2187
+ type DeleteUserStoryInput = z.infer<typeof DeleteUserStoryInputSchema>;
2188
+ type DeleteUserStoryOutput = z.infer<typeof DeleteUserStoryOutputSchema>;
2189
+ type CreateCustomPhaseInput = z.infer<typeof CreateCustomPhaseInputSchema>;
2190
+ type CreateCustomPhaseOutput = z.infer<typeof CreateCustomPhaseOutputSchema>;
2191
+ type AssignStoryToPhaseInput = z.infer<typeof AssignStoryToPhaseInputSchema>;
2192
+ type AssignStoryToPhaseOutput = z.infer<typeof AssignStoryToPhaseOutputSchema>;
2193
+ type GetNextStoryOutput = z.infer<typeof GetNextStoryOutputSchema>;
2194
+ type GetStoryInput = z.infer<typeof GetStoryInputSchema>;
2195
+ type GetStoryOutput = z.infer<typeof GetStoryOutputSchema>;
2196
+ type AddStoryLogInput = z.infer<typeof AddStoryLogInputSchema>;
2197
+ type AddStoryLogOutput = z.infer<typeof AddStoryLogOutputSchema>;
2198
+ type UpdatePrdSectionInput = z.infer<typeof UpdatePrdSectionInputSchema>;
2199
+ type MarkNotApplicableInput = z.infer<typeof MarkNotApplicableInputSchema>;
2200
+ type MarkNotApplicableOutput = z.infer<typeof MarkNotApplicableOutputSchema>;
2201
+ type UpdatePrdSectionOutput = z.infer<typeof UpdatePrdSectionOutputSchema>;
2202
+ type AddDecisionInput = z.infer<typeof AddDecisionInputSchema>;
2203
+ type AddDecisionOutput = z.infer<typeof AddDecisionOutputSchema>;
2204
+ type AddAttachmentInput = z.infer<typeof AddAttachmentInputSchema>;
2205
+ type AddAttachmentOutput = z.infer<typeof AddAttachmentOutputSchema>;
2206
+ type UpdateAttachmentInput = z.infer<typeof UpdateAttachmentInputSchema>;
2207
+ type UpdateAttachmentOutput = z.infer<typeof UpdateAttachmentOutputSchema>;
2208
+ type RemoveAttachmentInput = z.infer<typeof RemoveAttachmentInputSchema>;
2209
+ type RemoveAttachmentOutput = z.infer<typeof RemoveAttachmentOutputSchema>;
2210
+ type StoryAttachment = z.infer<typeof StoryAttachmentSchema>;
2211
+ type DecideEdgeCaseInput = z.infer<typeof DecideEdgeCaseInputSchema>;
2212
+ type DecideEdgeCaseOutput = z.infer<typeof DecideEdgeCaseOutputSchema>;
2213
+ type ResolveOpenQuestionInput = z.infer<typeof ResolveOpenQuestionInputSchema>;
2214
+ type ResolveOpenQuestionOutput = z.infer<typeof ResolveOpenQuestionOutputSchema>;
2215
+ type AddGlossaryTermInput = z.infer<typeof AddGlossaryTermInputSchema>;
2216
+ type AddGlossaryTermOutput = z.infer<typeof AddGlossaryTermOutputSchema>;
2217
+ type UpdatePhaseInput = z.infer<typeof UpdatePhaseInputSchema>;
2218
+ type DeletePhaseInput = z.infer<typeof DeletePhaseInputSchema>;
2219
+ type ReorderPhasesInput = z.infer<typeof ReorderPhasesInputSchema>;
2220
+ type PhasesOutput = z.infer<typeof PhasesOutputSchema>;
2221
+ //#endregion
2222
+ //#region src/prd.service.d.ts
2223
+ interface PrdVerificationDiagnostic {
2224
+ file: string;
2225
+ line: number | null;
2226
+ message: string;
2227
+ severity: string;
2228
+ }
2229
+ interface PrdVerificationResult {
2230
+ passed: boolean;
2231
+ /** Scripts that ran, e.g. ['typecheck', 'lint']. */
2232
+ checks: string[];
2233
+ errors: number;
2234
+ warnings: number;
2235
+ diagnostics: PrdVerificationDiagnostic[];
2236
+ /** Human-readable reasons for checks that failed without diagnostics. */
2237
+ messages: string[];
2238
+ }
2239
+ interface PrdDeps {
2240
+ rootPath: string;
2241
+ readdir(path: string): Promise<string[]>;
2242
+ readFile(path: string): Promise<string>;
2243
+ writeFile(path: string, content: string): Promise<void>;
2244
+ /** Must not throw when the directory already exists. */
2245
+ mkdir(path: string): Promise<void>;
2246
+ unlink(path: string): Promise<void>;
2247
+ fileExists(path: string): Promise<boolean>;
2248
+ now(): Date;
2249
+ /**
2250
+ * Runs the project's checks before a story may be marked completed. When
2251
+ * the result is not passing the status change is rejected, so "completed"
2252
+ * always means "the code verifies", not "the agent believes it is done".
2253
+ */
2254
+ verifyCompletion(): Promise<PrdVerificationResult>;
2255
+ }
2256
+ /**
2257
+ * A write was based on an older revision of the PRD than the one on disk:
2258
+ * someone else (an agent, Loop, another editor) changed it in between. Read
2259
+ * the PRD again and retry; never overwrite.
2260
+ */
2261
+ declare class PrdRevisionConflictError extends Error {
2262
+ readonly filename: string;
2263
+ readonly expectedRevision: number;
2264
+ readonly currentRevision: number;
2265
+ readonly code = "PRD_REVISION_CONFLICT";
2266
+ constructor(filename: string, expectedRevision: number, currentRevision: number);
2267
+ }
2268
+ declare function createPrdService(deps: PrdDeps): PrdService;
2269
+ declare class PrdService {
2270
+ private readonly deps;
2271
+ constructor(deps: PrdDeps);
2272
+ get prdsDir(): string;
2273
+ list(): Promise<ListPrdsOutput>;
2274
+ get(input: GetPrdInput): Promise<GetPrdOutput>;
2275
+ create(input: CreatePrdInput): Promise<CreatePrdOutput>;
2276
+ delete(input: DeletePrdInput): Promise<DeletePrdOutput>;
2277
+ addUserStory(input: AddUserStoryInput): Promise<AddUserStoryOutput>;
2278
+ updateUserStory(input: UpdateUserStoryInput): Promise<UpdateUserStoryOutput>;
2279
+ deleteUserStory(input: DeleteUserStoryInput): Promise<DeleteUserStoryOutput>;
2280
+ createCustomPhase(input: CreateCustomPhaseInput): Promise<CreateCustomPhaseOutput>;
2281
+ assignStoryToPhase(input: AssignStoryToPhaseInput): Promise<AssignStoryToPhaseOutput>;
2282
+ updateStoryStatus(input: UpdateStoryStatusInput): Promise<UpdateStoryStatusOutput>;
2283
+ exportMarkdown(input: ExportPrdMarkdownInput): Promise<ExportPrdMarkdownOutput>;
2284
+ getImplementationPrompts(filename: string): Promise<GetImplementationPromptsOutput>;
2285
+ getImprovementSuggestions(filename: string): Promise<GetImprovementSuggestionsOutput>;
2286
+ listTemplates(): ListTemplatesOutput;
2287
+ checkPlan(filename: string): Promise<CheckPlanOutput>;
2288
+ getProjectStatus(filename: string): Promise<GetProjectStatusOutput>;
2289
+ updatePrdSection(input: UpdatePrdSectionInput): Promise<UpdatePrdSectionOutput>;
2290
+ /** Mark a part of the PRD (not) applicable, e.g. no rollout for an internal tool. */
2291
+ markNotApplicable(input: MarkNotApplicableInput): Promise<MarkNotApplicableOutput>;
2292
+ addDecision(input: AddDecisionInput): Promise<AddDecisionOutput>;
2293
+ resolveOpenQuestion(input: ResolveOpenQuestionInput): Promise<ResolveOpenQuestionOutput>;
2294
+ decideEdgeCase(input: DecideEdgeCaseInput): Promise<DecideEdgeCaseOutput>;
2295
+ addGlossaryTerm(input: AddGlossaryTermInput): Promise<AddGlossaryTermOutput>;
2296
+ updatePhase(input: UpdatePhaseInput): Promise<PhasesOutput>;
2297
+ deletePhase(input: DeletePhaseInput): Promise<PhasesOutput>;
2298
+ reorderPhases(input: ReorderPhasesInput): Promise<PhasesOutput>;
2299
+ getNextStory(filename: string): Promise<GetNextStoryOutput>;
2300
+ getStory(input: GetStoryInput): Promise<GetStoryOutput>;
2301
+ addStoryLog(input: AddStoryLogInput): Promise<AddStoryLogOutput>;
2302
+ /** Files must already be in the PRD's folder, `.prds/<prd name>/`. */
2303
+ addAttachment(input: AddAttachmentInput): Promise<AddAttachmentOutput>;
2304
+ /** Changes an attachment's title, note or the stories that use it. */
2305
+ updateAttachment(input: UpdateAttachmentInput): Promise<UpdateAttachmentOutput>;
2306
+ /** Removes the attachment from the PRD and its stories; the file stays. */
2307
+ removeAttachment(input: RemoveAttachmentInput): Promise<RemoveAttachmentOutput>;
2308
+ /** Load → transform → save for operations that only touch the PRD. */
2309
+ /**
2310
+ * Load, change and save a PRD. With `expectedRevision` (the revision the
2311
+ * caller's change is based on, e.g. what a person saw before editing), the
2312
+ * change is rejected when the PRD has moved on since.
2313
+ */
2314
+ private mutate;
2315
+ /**
2316
+ * Load and normalise a PRD. The file name is validated here, at the
2317
+ * filesystem boundary, so every caller (including the dev tool) is covered.
2318
+ */
2319
+ load(filename: string): Promise<StructuredPRD>;
2320
+ private save;
2321
+ private listFilenames;
2322
+ private safeName;
2323
+ private today;
2324
+ }
2325
+ declare function normalizePrd(input: unknown, today: string): StructuredPRD;
2326
+ //#endregion
2327
+ export { DeletePrdOutputSchema as $, ResolveOpenQuestionOutput as $t, AssignStoryToPhaseOutput as A, DecisionLogEntry as An, ListPrdsOutputSchema as At, CreatePrdInputSchema as B, StoryTraceabilityMap as Bn, PhasesOutputSchema as Bt, AddStoryLogOutputSchema as C, UpdateUserStoryInputSchema as Cn, GetProjectStatusOutputSchema as Ct, AddUserStoryOutputSchema as D, Attachment as Dn, GetStoryOutputSchema as Dt, AddUserStoryOutput as E, AgentTaskPacket as En, GetStoryOutput as Et, CreateCustomPhaseInput as F, RiskItem as Fn, MarkNotApplicableInputSchema as Ft, DecideEdgeCaseInputSchema as G, RemoveAttachmentInput as Gt, CreatePrdOutputSchema as H, StructuredPRD as Hn, PrdSectionValueSchemas as Ht, CreateCustomPhaseInputSchema as I, StoryComplexity as In, MarkNotApplicableOutput as It, DeletePhaseInput as J, RemoveAttachmentOutputSchema as Jt, DecideEdgeCaseOutput as K, RemoveAttachmentInputSchema as Kt, CreateCustomPhaseOutput as L, StoryLogEntry as Ln, MarkNotApplicableOutputSchema as Lt, CheckPlanInputSchema as M, GlossaryTerm as Mn, ListTemplatesOutput as Mt, CheckPlanOutput as N, NotApplicableTopic as Nn, ListTemplatesOutputSchema as Nt, AssignStoryToPhaseInput as O, CrossDependency as On, ListPrdsInputSchema as Ot, CheckPlanOutputSchema as P, OpenQuestion as Pn, MarkNotApplicableInput as Pt, DeletePrdOutput as Q, ResolveOpenQuestionInputSchema as Qt, CreateCustomPhaseOutputSchema as R, StoryPriority as Rn, NotApplicableTopicSchema as Rt, AddStoryLogOutput as S, UpdateUserStoryInput as Sn, GetProjectStatusOutput as St, AddUserStoryInputSchema as T, UpdateUserStoryOutputSchema as Tn, GetStoryInputSchema as Tt, CustomPhaseSchema as U, UserStory as Un, PrdSummary as Ut, CreatePrdOutput as V, StoryVerification as Vn, PrdSection as Vt, DecideEdgeCaseInput as W, PrdSummarySchema as Wt, DeletePrdInput as X, ReorderPhasesInputSchema as Xt, DeletePhaseInputSchema as Y, ReorderPhasesInput as Yt, DeletePrdInputSchema as Z, ResolveOpenQuestionInput as Zt, AddGlossaryTermInputSchema as _, UpdatePrdSectionOutputSchema as _n, GetPrdInput as _t, PrdVerificationResult as a, StoryPrioritySchema as an, ExportPrdMarkdownInputSchema as at, AddStoryLogInput as b, UpdateStoryStatusOutput as bn, GetPrdOutputSchema as bt, AddAttachmentInput as c, UpdateAttachmentInput as cn, GetImplementationPromptsInputSchema as ct, AddAttachmentOutputSchema as d, UpdateAttachmentOutputSchema as dn, GetImprovementSuggestionsInputSchema as dt, ResolveOpenQuestionOutputSchema as en, DeleteUserStoryInput as et, AddDecisionInput as f, UpdatePhaseInput as fn, GetImprovementSuggestionsOutput as ft, AddGlossaryTermInput as g, UpdatePrdSectionOutput as gn, GetNextStoryOutputSchema as gt, AddDecisionOutputSchema as h, UpdatePrdSectionInputSchema as hn, GetNextStoryOutput as ht, PrdVerificationDiagnostic as i, StoryLogEntrySchema as in, ExportPrdMarkdownInput as it, AssignStoryToPhaseOutputSchema as j, EdgeCase as jn, ListTemplatesInputSchema as jt, AssignStoryToPhaseInputSchema as k, CustomPhase as kn, ListPrdsOutput as kt, AddAttachmentInputSchema as l, UpdateAttachmentInputSchema as ln, GetImplementationPromptsOutput as lt, AddDecisionOutput as m, UpdatePrdSectionInput as mn, GetNextStoryInputSchema as mt, PrdRevisionConflictError as n, StoryAttachmentSchema as nn, DeleteUserStoryOutput as nt, createPrdService as o, StoryStatusSchema as on, ExportPrdMarkdownOutput as ot, AddDecisionInputSchema as p, UpdatePhaseInputSchema as pn, GetImprovementSuggestionsOutputSchema as pt, DecideEdgeCaseOutputSchema as q, RemoveAttachmentOutput as qt, PrdService as r, StoryComplexitySchema as rn, DeleteUserStoryOutputSchema as rt, normalizePrd as s, StoryVerificationSchema as sn, ExportPrdMarkdownOutputSchema as st, PrdDeps as t, StoryAttachment as tn, DeleteUserStoryInputSchema as tt, AddAttachmentOutput as u, UpdateAttachmentOutput as un, GetImplementationPromptsOutputSchema as ut, AddGlossaryTermOutput as v, UpdateStoryStatusInput as vn, GetPrdInputSchema as vt, AddUserStoryInput as w, UpdateUserStoryOutput as wn, GetStoryInput as wt, AddStoryLogInputSchema as x, UpdateStoryStatusOutputSchema as xn, GetProjectStatusInputSchema as xt, AddGlossaryTermOutputSchema as y, UpdateStoryStatusInputSchema as yn, GetPrdOutput as yt, CreatePrdInput as z, StoryStatus as zn, PhasesOutput as zt };