@shepai/cli 1.38.0 → 1.39.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 (115) hide show
  1. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts +1 -0
  2. package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
  3. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts +5 -4
  4. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
  5. package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +36 -14
  6. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts +12 -3
  7. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
  8. package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +88 -8
  9. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.d.ts +35 -0
  10. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.d.ts.map +1 -0
  11. package/dist/packages/core/src/application/use-cases/agents/review-feature.use-case.js +88 -0
  12. package/dist/packages/core/src/domain/generated/output.d.ts +102 -0
  13. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  14. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  15. package/dist/packages/core/src/infrastructure/di/container.js +2 -0
  16. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +51 -0
  17. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
  18. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.js +21 -2
  19. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +1 -0
  20. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
  21. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +3 -0
  22. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +1 -0
  23. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
  24. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +31 -1
  25. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +19 -3
  26. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
  27. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +101 -16
  28. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts +2 -1
  29. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.d.ts.map +1 -1
  30. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/requirements.prompt.js +53 -27
  31. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts +3 -0
  32. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.d.ts.map +1 -1
  33. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/phase-timing-context.js +28 -1
  34. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +3 -0
  35. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
  36. package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +13 -0
  37. package/dist/src/presentation/cli/commands/agent/reject.command.js +1 -1
  38. package/dist/src/presentation/cli/commands/feat/reject.command.d.ts.map +1 -1
  39. package/dist/src/presentation/cli/commands/feat/reject.command.js +6 -4
  40. package/dist/src/presentation/cli/commands/feat/review.command.d.ts +3 -2
  41. package/dist/src/presentation/cli/commands/feat/review.command.d.ts.map +1 -1
  42. package/dist/src/presentation/cli/commands/feat/review.command.js +87 -12
  43. package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
  44. package/dist/src/presentation/cli/commands/feat/show.command.js +38 -3
  45. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.d.ts +30 -0
  46. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.d.ts.map +1 -0
  47. package/dist/src/presentation/tui/prompts/prd-review-question.prompt.js +23 -0
  48. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.d.ts +29 -0
  49. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.d.ts.map +1 -0
  50. package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.js +29 -0
  51. package/dist/src/presentation/tui/wizards/merge-review.wizard.d.ts +13 -0
  52. package/dist/src/presentation/tui/wizards/merge-review.wizard.d.ts.map +1 -0
  53. package/dist/src/presentation/tui/wizards/merge-review.wizard.js +43 -0
  54. package/dist/src/presentation/tui/wizards/plan-review.wizard.d.ts +13 -0
  55. package/dist/src/presentation/tui/wizards/plan-review.wizard.d.ts.map +1 -0
  56. package/dist/src/presentation/tui/wizards/plan-review.wizard.js +43 -0
  57. package/dist/src/presentation/tui/wizards/prd-review.wizard.d.ts +26 -0
  58. package/dist/src/presentation/tui/wizards/prd-review.wizard.d.ts.map +1 -0
  59. package/dist/src/presentation/tui/wizards/prd-review.wizard.js +42 -0
  60. package/dist/tsconfig.build.tsbuildinfo +1 -1
  61. package/package.json +1 -1
  62. package/web/.next/BUILD_ID +1 -1
  63. package/web/.next/build-manifest.json +2 -2
  64. package/web/.next/cache/.previewinfo +1 -1
  65. package/web/.next/cache/.rscinfo +1 -1
  66. package/web/.next/cache/.tsbuildinfo +1 -1
  67. package/web/.next/cache/config.json +3 -3
  68. package/web/.next/fallback-build-manifest.json +2 -2
  69. package/web/.next/prerender-manifest.json +3 -3
  70. package/web/.next/required-server-files.js +1 -1
  71. package/web/.next/required-server-files.json +1 -1
  72. package/web/.next/server/app/_global-error.html +2 -2
  73. package/web/.next/server/app/_global-error.rsc +1 -1
  74. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  75. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  76. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  77. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  78. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  79. package/web/.next/server/app/page/server-reference-manifest.json +9 -9
  80. package/web/.next/server/app/page_client-reference-manifest.js +1 -1
  81. package/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js +1 -1
  82. package/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js.map +1 -1
  83. package/web/.next/server/chunks/ssr/[root-of-the-server]__19354aea._.js +2 -2
  84. package/web/.next/server/chunks/ssr/[root-of-the-server]__f12b60be._.js +1 -1
  85. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  86. package/web/.next/server/chunks/ssr/src_presentation_web_ed0934e5._.js.map +1 -1
  87. package/web/.next/server/pages/500.html +2 -2
  88. package/web/.next/server/server-reference-manifest.js +1 -1
  89. package/web/.next/server/server-reference-manifest.json +10 -10
  90. package/web/.next/standalone/src/presentation/web/.next/BUILD_ID +1 -1
  91. package/web/.next/standalone/src/presentation/web/.next/build-manifest.json +2 -2
  92. package/web/.next/standalone/src/presentation/web/.next/prerender-manifest.json +3 -3
  93. package/web/.next/standalone/src/presentation/web/.next/required-server-files.json +1 -1
  94. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.html +2 -2
  95. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.rsc +1 -1
  96. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  97. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  98. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  99. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  100. package/web/.next/standalone/src/presentation/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  101. package/web/.next/standalone/src/presentation/web/.next/server/app/page/server-reference-manifest.json +9 -9
  102. package/web/.next/standalone/src/presentation/web/.next/server/app/page_client-reference-manifest.js +1 -1
  103. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__03a0dba7._.js +1 -1
  104. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__19354aea._.js +2 -2
  105. package/web/.next/standalone/src/presentation/web/.next/server/chunks/ssr/[root-of-the-server]__f12b60be._.js +1 -1
  106. package/web/.next/standalone/src/presentation/web/.next/server/pages/500.html +2 -2
  107. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.js +1 -1
  108. package/web/.next/standalone/src/presentation/web/.next/server/server-reference-manifest.json +10 -10
  109. package/web/.next/standalone/src/presentation/web/server.js +1 -1
  110. package/web/.next/static/chunks/{eca1959e083d0a45.js → 429ee8f94032181c.js} +1 -1
  111. package/web/.next/trace +1 -1
  112. package/web/.next/trace-build +1 -1
  113. /package/web/.next/static/{yvV-GEMagQiZhZAF0YqQs → t8z43Apwz2m0TFf1MnAKq}/_buildManifest.js +0 -0
  114. /package/web/.next/static/{yvV-GEMagQiZhZAF0YqQs → t8z43Apwz2m0TFf1MnAKq}/_clientMiddlewareManifest.json +0 -0
  115. /package/web/.next/static/{yvV-GEMagQiZhZAF0YqQs → t8z43Apwz2m0TFf1MnAKq}/_ssgManifest.js +0 -0
@@ -6,7 +6,10 @@
6
6
  *
7
7
  * Usage: shep feat show <id>
8
8
  */
9
+ import { readFileSync } from 'node:fs';
10
+ import { join } from 'node:path';
9
11
  import { Command } from 'commander';
12
+ import yaml from 'js-yaml';
10
13
  import { container } from '../../../../../packages/core/src/infrastructure/di/container.js';
11
14
  import { ShowFeatureUseCase } from '../../../../../packages/core/src/application/use-cases/features/show-feature.use-case.js';
12
15
  import { colors, symbols, messages, renderDetailView } from '../../ui/index.js';
@@ -94,6 +97,23 @@ function isProcessAlive(pid) {
94
97
  return false;
95
98
  }
96
99
  }
100
+ /**
101
+ * Load rejection feedback entries from spec.yaml (best-effort).
102
+ */
103
+ function loadRejectionFeedback(specPath) {
104
+ if (!specPath)
105
+ return [];
106
+ try {
107
+ const content = readFileSync(join(specPath, 'spec.yaml'), 'utf-8');
108
+ const spec = yaml.load(content);
109
+ return Array.isArray(spec?.rejectionFeedback)
110
+ ? spec.rejectionFeedback
111
+ : [];
112
+ }
113
+ catch {
114
+ return [];
115
+ }
116
+ }
97
117
  /**
98
118
  * Group timings by agentRunId, preserving order.
99
119
  */
@@ -117,7 +137,7 @@ function renderNodeTiming(t, isLast, isWaiting, isRunTerminal, run, maxDurationM
117
137
  const lines = [];
118
138
  const isSubPhase = t.phase.includes(':');
119
139
  const label = isSubPhase
120
- ? ` \u21b3 ${t.phase.split(':')[1]}`.padEnd(16)
140
+ ? ` \u21b3 rev ${t.phase.split(':')[1]}`.padEnd(16)
121
141
  : (NODE_TO_PHASE[t.phase] ?? t.phase).padEnd(16);
122
142
  // Completed phase - green bar with duration
123
143
  if (t.completedAt && t.durationMs != null) {
@@ -185,7 +205,7 @@ function renderNodeTiming(t, isLast, isWaiting, isRunTerminal, run, maxDurationM
185
205
  /**
186
206
  * Render the full phase timing section, grouped by agent run with lifecycle events.
187
207
  */
188
- function renderPhaseTimings(timings, currentRun) {
208
+ function renderPhaseTimings(timings, currentRun, rejections = []) {
189
209
  const groups = groupTimingsByRun(timings);
190
210
  const multiRun = groups.length > 1;
191
211
  // Compute max duration across ALL timings for consistent bar scaling
@@ -220,12 +240,26 @@ function renderPhaseTimings(timings, currentRun) {
220
240
  currentRun?.status === 'failed' ||
221
241
  currentRun?.status === 'cancelled';
222
242
  const isWaiting = isCurrentRun && currentRun?.status === 'waiting_approval';
243
+ let resumedIdx = 0;
223
244
  for (const [idx, t] of group.timings.entries()) {
224
245
  const isLast = isLastGroup && idx === group.timings.length - 1;
225
246
  // Lifecycle event - render as a marker line
226
247
  if (isLifecycleEvent(t.phase)) {
227
248
  const event = LIFECYCLE_EVENTS[t.phase];
228
249
  if (event) {
250
+ // For resumed events, show rejection feedback if available
251
+ if (t.phase === 'run:resumed' && rejections.length > 0) {
252
+ const feedback = rejections[resumedIdx];
253
+ resumedIdx++;
254
+ if (feedback?.message) {
255
+ const maxLen = 60;
256
+ const msg = feedback.message.length > maxLen
257
+ ? `${feedback.message.slice(0, maxLen)}…`
258
+ : feedback.message;
259
+ lines.push(` ${colors.error(`↩ rejected: "${msg}"`)}`);
260
+ continue;
261
+ }
262
+ }
229
263
  const sym = t.phase === 'run:completed'
230
264
  ? symbols.success
231
265
  : t.phase === 'run:failed' || t.phase === 'run:crashed'
@@ -292,7 +326,8 @@ export function createShowCommand() {
292
326
  });
293
327
  }
294
328
  if (timings.length > 0) {
295
- const lines = renderPhaseTimings(timings, run);
329
+ const rejections = loadRejectionFeedback(feature.specPath);
330
+ const lines = renderPhaseTimings(timings, run, rejections);
296
331
  textBlocks.push({ title: 'Phase Timing', content: lines.join('\n') });
297
332
  }
298
333
  if (run?.status === 'waiting_approval') {
@@ -0,0 +1,30 @@
1
+ /**
2
+ * PRD Review Question Prompt Configuration
3
+ *
4
+ * Creates an @inquirer/select config for reviewing a single open question
5
+ * from the PRD spec.yaml. Users select from the available options.
6
+ */
7
+ import type { QuestionOption } from '../../../../packages/core/src/domain/generated/output.js';
8
+ /**
9
+ * Creates the @inquirer/select configuration for a single open question.
10
+ */
11
+ export declare function createQuestionSelectConfig(question: string, options: QuestionOption[], currentAnswer?: string): {
12
+ message: string;
13
+ choices: {
14
+ name: string;
15
+ value: string;
16
+ description: string;
17
+ }[];
18
+ default: string | undefined;
19
+ theme: {
20
+ readonly prefix: {
21
+ readonly idle: string;
22
+ readonly done: string;
23
+ };
24
+ readonly style: {
25
+ readonly highlight: import("picocolors/types.js").Formatter;
26
+ readonly answer: import("picocolors/types.js").Formatter;
27
+ };
28
+ };
29
+ };
30
+ //# sourceMappingURL=prd-review-question.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prd-review-question.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/prd-review-question.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAEnE;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,cAAc,EAAE,EACzB,aAAa,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;EAcvB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * PRD Review Question Prompt Configuration
3
+ *
4
+ * Creates an @inquirer/select config for reviewing a single open question
5
+ * from the PRD spec.yaml. Users select from the available options.
6
+ */
7
+ import { shepTheme } from '../themes/shep.theme.js';
8
+ /**
9
+ * Creates the @inquirer/select configuration for a single open question.
10
+ */
11
+ export function createQuestionSelectConfig(question, options, currentAnswer) {
12
+ const choices = options.map((opt) => ({
13
+ name: opt.option,
14
+ value: opt.option,
15
+ description: opt.description,
16
+ }));
17
+ return {
18
+ message: question,
19
+ choices,
20
+ default: currentAnswer,
21
+ theme: shepTheme,
22
+ };
23
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * PRD Review Summary Prompt Configuration
3
+ *
4
+ * Creates an @inquirer/select config for the final approve/reject
5
+ * action after reviewing open questions.
6
+ */
7
+ export type ReviewAction = 'approve' | 'reject';
8
+ /**
9
+ * Creates the @inquirer/select configuration for the review action prompt.
10
+ */
11
+ export declare function createReviewActionConfig(changeCount: number): {
12
+ message: string;
13
+ choices: {
14
+ name: string;
15
+ value: ReviewAction;
16
+ description: string;
17
+ }[];
18
+ theme: {
19
+ readonly prefix: {
20
+ readonly idle: string;
21
+ readonly done: string;
22
+ };
23
+ readonly style: {
24
+ readonly highlight: import("picocolors/types.js").Formatter;
25
+ readonly answer: import("picocolors/types.js").Formatter;
26
+ };
27
+ };
28
+ };
29
+ //# sourceMappingURL=prd-review-summary.prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prd-review-summary.prompt.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/prompts/prd-review-summary.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEhD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM;;;;eAShC,YAAY;;;;;;;;;;;;;EAWvC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * PRD Review Summary Prompt Configuration
3
+ *
4
+ * Creates an @inquirer/select config for the final approve/reject
5
+ * action after reviewing open questions.
6
+ */
7
+ import { shepTheme } from '../themes/shep.theme.js';
8
+ /**
9
+ * Creates the @inquirer/select configuration for the review action prompt.
10
+ */
11
+ export function createReviewActionConfig(changeCount) {
12
+ const changeLabel = changeCount > 0 ? ` (${changeCount} change${changeCount !== 1 ? 's' : ''})` : '';
13
+ return {
14
+ message: `Review complete${changeLabel}. What would you like to do?`,
15
+ choices: [
16
+ {
17
+ name: 'Approve and continue',
18
+ value: 'approve',
19
+ description: 'Accept the requirements and proceed to research',
20
+ },
21
+ {
22
+ name: 'Reject and iterate',
23
+ value: 'reject',
24
+ description: 'Provide feedback and re-run requirements',
25
+ },
26
+ ],
27
+ theme: shepTheme,
28
+ };
29
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Merge Review Wizard
3
+ *
4
+ * Placeholder TUI wizard for the merge approval phase.
5
+ * Shows approve/reject action with optional comment.
6
+ */
7
+ export type MergeReviewAction = 'approve' | 'reject';
8
+ export interface MergeReviewWizardResult {
9
+ action: MergeReviewAction;
10
+ feedback?: string;
11
+ }
12
+ export declare function mergeReviewWizard(): Promise<MergeReviewWizardResult>;
13
+ //# sourceMappingURL=merge-review.wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge-review.wizard.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/wizards/merge-review.wizard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,MAAM,iBAAiB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAkC1E"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Merge Review Wizard
3
+ *
4
+ * Placeholder TUI wizard for the merge approval phase.
5
+ * Shows approve/reject action with optional comment.
6
+ */
7
+ import { select, input } from '@inquirer/prompts';
8
+ import { shepTheme } from '../themes/shep.theme.js';
9
+ export async function mergeReviewWizard() {
10
+ const action = await select({
11
+ message: 'Review the merge. What would you like to do?',
12
+ choices: [
13
+ {
14
+ name: 'Approve and merge',
15
+ value: 'approve',
16
+ description: 'Accept the changes and merge the branch',
17
+ },
18
+ {
19
+ name: 'Reject',
20
+ value: 'reject',
21
+ description: 'Provide feedback — implementation will iterate',
22
+ },
23
+ ],
24
+ theme: shepTheme,
25
+ });
26
+ let feedback;
27
+ if (action === 'reject') {
28
+ feedback = await input({
29
+ message: 'What needs to change before merging?',
30
+ theme: shepTheme,
31
+ validate: (value) => value.trim().length > 0 || 'Feedback is required for rejection',
32
+ });
33
+ }
34
+ else {
35
+ feedback = await input({
36
+ message: 'Any comments? (optional, press Enter to skip)',
37
+ theme: shepTheme,
38
+ });
39
+ if (feedback?.trim().length === 0)
40
+ feedback = undefined;
41
+ }
42
+ return { action, feedback };
43
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Plan Review Wizard
3
+ *
4
+ * Placeholder TUI wizard for the plan approval phase.
5
+ * Shows approve/reject action with optional comment.
6
+ */
7
+ export type PlanReviewAction = 'approve' | 'reject';
8
+ export interface PlanReviewWizardResult {
9
+ action: PlanReviewAction;
10
+ feedback?: string;
11
+ }
12
+ export declare function planReviewWizard(): Promise<PlanReviewWizardResult>;
13
+ //# sourceMappingURL=plan-review.wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-review.wizard.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/wizards/plan-review.wizard.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AAEpD,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAkCxE"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Plan Review Wizard
3
+ *
4
+ * Placeholder TUI wizard for the plan approval phase.
5
+ * Shows approve/reject action with optional comment.
6
+ */
7
+ import { select, input } from '@inquirer/prompts';
8
+ import { shepTheme } from '../themes/shep.theme.js';
9
+ export async function planReviewWizard() {
10
+ const action = await select({
11
+ message: 'Review the implementation plan. What would you like to do?',
12
+ choices: [
13
+ {
14
+ name: 'Approve and continue',
15
+ value: 'approve',
16
+ description: 'Accept the plan and proceed to implementation',
17
+ },
18
+ {
19
+ name: 'Reject and iterate',
20
+ value: 'reject',
21
+ description: 'Provide feedback and re-run planning',
22
+ },
23
+ ],
24
+ theme: shepTheme,
25
+ });
26
+ let feedback;
27
+ if (action === 'reject') {
28
+ feedback = await input({
29
+ message: 'What needs to change in the plan?',
30
+ theme: shepTheme,
31
+ validate: (value) => value.trim().length > 0 || 'Feedback is required for rejection',
32
+ });
33
+ }
34
+ else {
35
+ feedback = await input({
36
+ message: 'Any comments? (optional, press Enter to skip)',
37
+ theme: shepTheme,
38
+ });
39
+ if (feedback?.trim().length === 0)
40
+ feedback = undefined;
41
+ }
42
+ return { action, feedback };
43
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * PRD Review Wizard
3
+ *
4
+ * Interactive TUI wizard that walks users through open questions
5
+ * from a PRD spec, lets them change selections, and approve or
6
+ * reject with feedback.
7
+ */
8
+ import { type ReviewAction } from '../prompts/prd-review-summary.prompt.js';
9
+ import type { OpenQuestion } from '../../../../packages/core/src/application/use-cases/agents/review-feature.use-case.js';
10
+ import type { QuestionSelectionChange } from '../../../../packages/core/src/domain/generated/output.js';
11
+ export interface PrdReviewWizardResult {
12
+ action: ReviewAction;
13
+ changedSelections: QuestionSelectionChange[];
14
+ feedback?: string;
15
+ }
16
+ /**
17
+ * Runs the interactive PRD review wizard.
18
+ *
19
+ * Steps:
20
+ * 1. For each open question, show select prompt with current options
21
+ * 2. Track which selections changed from the original
22
+ * 3. Show approve/reject action prompt
23
+ * 4. If reject, prompt for feedback
24
+ */
25
+ export declare function prdReviewWizard(questions: OpenQuestion[]): Promise<PrdReviewWizardResult>;
26
+ //# sourceMappingURL=prd-review.wizard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prd-review.wizard.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/tui/wizards/prd-review.wizard.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2DAA2D,CAAC;AAC9F,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAG5E,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB,iBAAiB,EAAE,uBAAuB,EAAE,CAAC;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4B/F"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * PRD Review Wizard
3
+ *
4
+ * Interactive TUI wizard that walks users through open questions
5
+ * from a PRD spec, lets them change selections, and approve or
6
+ * reject with feedback.
7
+ */
8
+ import { select, input } from '@inquirer/prompts';
9
+ import { createQuestionSelectConfig } from '../prompts/prd-review-question.prompt.js';
10
+ import { createReviewActionConfig, } from '../prompts/prd-review-summary.prompt.js';
11
+ import { shepTheme } from '../themes/shep.theme.js';
12
+ /**
13
+ * Runs the interactive PRD review wizard.
14
+ *
15
+ * Steps:
16
+ * 1. For each open question, show select prompt with current options
17
+ * 2. Track which selections changed from the original
18
+ * 3. Show approve/reject action prompt
19
+ * 4. If reject, prompt for feedback
20
+ */
21
+ export async function prdReviewWizard(questions) {
22
+ const changedSelections = [];
23
+ for (const q of questions) {
24
+ const selected = await select(createQuestionSelectConfig(q.question, q.options, q.selectedOption));
25
+ if (selected !== q.selectedOption) {
26
+ changedSelections.push({
27
+ questionId: q.question,
28
+ selectedOption: selected,
29
+ });
30
+ }
31
+ }
32
+ const action = await select(createReviewActionConfig(changedSelections.length));
33
+ let feedback;
34
+ if (action === 'reject') {
35
+ feedback = await input({
36
+ message: 'What needs to change? (feedback for re-iteration)',
37
+ theme: shepTheme,
38
+ validate: (value) => value.trim().length > 0 || 'Feedback is required for rejection',
39
+ });
40
+ }
41
+ return { action, changedSelections, feedback };
42
+ }