@hyperdrive.bot/bmad-workflow 1.0.17 → 1.0.19

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 (110) hide show
  1. package/dist/commands/config/show.js +8 -2
  2. package/dist/commands/decompose.js +26 -5
  3. package/dist/commands/epics/create.d.ts +1 -0
  4. package/dist/commands/mcp/add.d.ts +16 -0
  5. package/dist/commands/mcp/add.js +77 -0
  6. package/dist/commands/mcp/credential/get.d.ts +14 -0
  7. package/dist/commands/mcp/credential/get.js +35 -0
  8. package/dist/commands/mcp/credential/list.d.ts +17 -0
  9. package/dist/commands/mcp/credential/list.js +67 -0
  10. package/dist/commands/mcp/credential/remove.d.ts +18 -0
  11. package/dist/commands/mcp/credential/remove.js +84 -0
  12. package/dist/commands/mcp/credential/set.d.ts +16 -0
  13. package/dist/commands/mcp/credential/set.js +41 -0
  14. package/dist/commands/mcp/credential/validate.d.ts +12 -0
  15. package/dist/commands/mcp/credential/validate.js +150 -0
  16. package/dist/commands/mcp/list.d.ts +17 -0
  17. package/dist/commands/mcp/list.js +80 -0
  18. package/dist/commands/mcp/logs.d.ts +15 -0
  19. package/dist/commands/mcp/logs.js +64 -0
  20. package/dist/commands/mcp/preset.d.ts +15 -0
  21. package/dist/commands/mcp/preset.js +84 -0
  22. package/dist/commands/mcp/remove.d.ts +14 -0
  23. package/dist/commands/mcp/remove.js +36 -0
  24. package/dist/commands/mcp/start.d.ts +12 -0
  25. package/dist/commands/mcp/start.js +80 -0
  26. package/dist/commands/mcp/status.d.ts +30 -0
  27. package/dist/commands/mcp/status.js +180 -0
  28. package/dist/commands/mcp/stop.d.ts +12 -0
  29. package/dist/commands/mcp/stop.js +47 -0
  30. package/dist/commands/stories/create.d.ts +1 -0
  31. package/dist/commands/stories/develop.d.ts +1 -0
  32. package/dist/commands/stories/qa.js +34 -75
  33. package/dist/commands/stories/review.d.ts +124 -0
  34. package/dist/commands/stories/review.js +516 -0
  35. package/dist/commands/workflow.d.ts +89 -0
  36. package/dist/commands/workflow.js +487 -14
  37. package/dist/mcp/types.d.ts +99 -0
  38. package/dist/mcp/types.js +7 -0
  39. package/dist/mcp/utils/docker-utils.d.ts +56 -0
  40. package/dist/mcp/utils/docker-utils.js +108 -0
  41. package/dist/mcp/utils/template-loader.d.ts +21 -0
  42. package/dist/mcp/utils/template-loader.js +60 -0
  43. package/dist/models/agent-options.d.ts +10 -1
  44. package/dist/models/index.d.ts +1 -0
  45. package/dist/models/index.js +1 -0
  46. package/dist/models/workflow-callbacks.d.ts +251 -0
  47. package/dist/models/workflow-callbacks.js +10 -0
  48. package/dist/models/workflow-config.d.ts +77 -0
  49. package/dist/models/workflow-result.d.ts +7 -0
  50. package/dist/services/WorkflowReporter.d.ts +165 -0
  51. package/dist/services/WorkflowReporter.js +691 -0
  52. package/dist/services/agents/claude-agent-runner.js +25 -4
  53. package/dist/services/file-system/path-resolver.d.ts +10 -0
  54. package/dist/services/file-system/path-resolver.js +12 -0
  55. package/dist/services/mcp/mcp-config-manager.d.ts +54 -0
  56. package/dist/services/mcp/mcp-config-manager.js +146 -0
  57. package/dist/services/mcp/mcp-context-injector.d.ts +92 -0
  58. package/dist/services/mcp/mcp-context-injector.js +168 -0
  59. package/dist/services/mcp/mcp-credential-manager.d.ts +48 -0
  60. package/dist/services/mcp/mcp-credential-manager.js +124 -0
  61. package/dist/services/mcp/mcp-health-checker.d.ts +56 -0
  62. package/dist/services/mcp/mcp-health-checker.js +162 -0
  63. package/dist/services/mcp/types/health-types.d.ts +31 -0
  64. package/dist/services/mcp/types/health-types.js +7 -0
  65. package/dist/services/orchestration/dependency-graph-executor.js +1 -1
  66. package/dist/services/orchestration/task-decomposition-service.d.ts +2 -1
  67. package/dist/services/orchestration/task-decomposition-service.js +90 -36
  68. package/dist/services/orchestration/workflow-orchestrator.d.ts +87 -3
  69. package/dist/services/orchestration/workflow-orchestrator.js +1169 -289
  70. package/dist/services/review/ai-review-scanner.d.ts +66 -0
  71. package/dist/services/review/ai-review-scanner.js +142 -0
  72. package/dist/services/review/coderabbit-scanner.d.ts +25 -0
  73. package/dist/services/review/coderabbit-scanner.js +31 -0
  74. package/dist/services/review/index.d.ts +20 -0
  75. package/dist/services/review/index.js +15 -0
  76. package/dist/services/review/lint-scanner.d.ts +46 -0
  77. package/dist/services/review/lint-scanner.js +172 -0
  78. package/dist/services/review/review-config.d.ts +62 -0
  79. package/dist/services/review/review-config.js +91 -0
  80. package/dist/services/review/review-phase-executor.d.ts +69 -0
  81. package/dist/services/review/review-phase-executor.js +152 -0
  82. package/dist/services/review/review-queue.d.ts +98 -0
  83. package/dist/services/review/review-queue.js +174 -0
  84. package/dist/services/review/review-reporter.d.ts +94 -0
  85. package/dist/services/review/review-reporter.js +386 -0
  86. package/dist/services/review/scanner-factory.d.ts +42 -0
  87. package/dist/services/review/scanner-factory.js +60 -0
  88. package/dist/services/review/self-heal-loop.d.ts +58 -0
  89. package/dist/services/review/self-heal-loop.js +132 -0
  90. package/dist/services/review/severity-classifier.d.ts +17 -0
  91. package/dist/services/review/severity-classifier.js +314 -0
  92. package/dist/services/review/tech-debt-tracker.d.ts +52 -0
  93. package/dist/services/review/tech-debt-tracker.js +245 -0
  94. package/dist/services/review/types.d.ts +93 -0
  95. package/dist/services/review/types.js +23 -0
  96. package/dist/services/scaffolding/workflow-session-scaffolder.d.ts +182 -0
  97. package/dist/services/scaffolding/workflow-session-scaffolder.js +236 -0
  98. package/dist/services/validation/config-validator.d.ts +84 -0
  99. package/dist/services/validation/config-validator.js +78 -0
  100. package/dist/utils/colors.d.ts +10 -10
  101. package/dist/utils/colors.js +15 -15
  102. package/dist/utils/credential-utils.d.ts +14 -0
  103. package/dist/utils/credential-utils.js +19 -0
  104. package/dist/utils/duration.d.ts +41 -0
  105. package/dist/utils/duration.js +89 -0
  106. package/dist/utils/listr2-helpers.d.ts +216 -0
  107. package/dist/utils/listr2-helpers.js +334 -0
  108. package/dist/utils/shared-flags.d.ts +1 -0
  109. package/dist/utils/shared-flags.js +11 -2
  110. package/package.json +6 -3
@@ -1,3 +1,4 @@
1
+ import type { Severity } from '../services/review/types.js';
1
2
  /**
2
3
  * Configuration for workflow execution across all phases
3
4
  *
@@ -77,6 +78,31 @@ export interface WorkflowConfig {
77
78
  * - OpenCode: anthropic/claude-3-5-sonnet, openai/gpt-4o
78
79
  */
79
80
  model?: string;
81
+ /**
82
+ * Enable MCP tool discovery in agent prompts
83
+ *
84
+ * When true, MCP context (available tools/instructions) is prepended to
85
+ * agent prompts before each spawn. Requires McpContextInjector to be
86
+ * configured in the orchestrator.
87
+ * @default false
88
+ */
89
+ mcp?: boolean;
90
+ /**
91
+ * Restrict MCP injection to specific workflow phases
92
+ *
93
+ * When set, only the listed phases receive MCP tool context.
94
+ * When omitted (and mcp=true), all phases receive MCP context.
95
+ * @example ['epic', 'dev'] — only epic and dev phases get MCP tools
96
+ */
97
+ mcpPhases?: string[];
98
+ /**
99
+ * MCP preset name for tool configuration
100
+ *
101
+ * Overrides the configured preset for the pipeline run.
102
+ * Presets define which MCP servers and tools are available.
103
+ * @example 'research'
104
+ */
105
+ mcpPreset?: string;
80
106
  /**
81
107
  * Filename prefix for generated files
82
108
  *
@@ -90,6 +116,37 @@ export interface WorkflowConfig {
90
116
  * @default 'claude'
91
117
  */
92
118
  provider?: 'claude' | 'gemini' | 'opencode';
119
+ /**
120
+ * Run automated code review between dev and QA phases
121
+ *
122
+ * When true, completed stories are reviewed before forwarding to QA.
123
+ * In pipeline mode, review runs concurrently via ReviewQueue.
124
+ * Only PASS stories proceed to QA; FAIL stories are excluded with a warning.
125
+ * @default false
126
+ */
127
+ review?: boolean;
128
+ /**
129
+ * Minimum severity that blocks the pipeline during review
130
+ *
131
+ * Issues at or above this severity after self-heal will cause a FAIL verdict.
132
+ * @default Severity.HIGH
133
+ */
134
+ reviewBlockOn?: Severity;
135
+ /**
136
+ * Maximum self-heal iterations during review
137
+ *
138
+ * Controls how many scan→fix cycles the review phase attempts before
139
+ * giving up on blocking issues.
140
+ * @default 3
141
+ */
142
+ reviewMaxFix?: number;
143
+ /**
144
+ * List of scanner IDs to enable during review
145
+ *
146
+ * When specified, only these scanners are used (e.g., ['lint', 'ai']).
147
+ * When omitted, all configured scanners run.
148
+ */
149
+ reviewScanners?: string[];
93
150
  /**
94
151
  * Run QA workflow after development completes
95
152
  *
@@ -119,6 +176,13 @@ export interface WorkflowConfig {
119
176
  * @example ['docs/architecture.md', 'docs/tech-stack.md']
120
177
  */
121
178
  references: string[];
179
+ /**
180
+ * Absolute path to the workflow session directory
181
+ *
182
+ * When set, session-level reports (review summary, tech debt backlog)
183
+ * are written to this directory. When undefined, session reports are skipped.
184
+ */
185
+ sessionDir?: string;
122
186
  /**
123
187
  * Skip development phase
124
188
  *
@@ -147,8 +211,21 @@ export interface WorkflowConfig {
147
211
  * @default 60
148
212
  */
149
213
  storyInterval: number;
214
+ /**
215
+ * AI review scanner timeout in milliseconds
216
+ *
217
+ * Overrides the global timeout for the AI review phase only.
218
+ * When not set, falls back to the global timeout or the default (5 minutes).
219
+ * Accepts human-readable durations via CLI (e.g., "10m", "1h").
220
+ * @default 300_000 (5 minutes)
221
+ */
222
+ reviewTimeout?: number;
150
223
  /**
151
224
  * Agent execution timeout in milliseconds
225
+ *
226
+ * Global timeout ceiling for all agent spawns, review scanners, and
227
+ * infrastructure operations. Accepts human-readable durations via CLI
228
+ * (e.g., "45m", "1h", "90m").
152
229
  * @default 2_700_000 (45 minutes)
153
230
  */
154
231
  timeout?: number;
@@ -141,6 +141,13 @@ export interface WorkflowResult {
141
141
  * Undefined if QA phase was skipped or not executed.
142
142
  */
143
143
  qaPhase?: PhaseResult;
144
+ /**
145
+ * Review phase result
146
+ *
147
+ * Undefined if review phase was skipped or not executed.
148
+ * Present when config.review === true.
149
+ */
150
+ reviewPhase?: PhaseResult;
144
151
  /**
145
152
  * Story creation phase result
146
153
  *
@@ -0,0 +1,165 @@
1
+ /**
2
+ * WorkflowReporter
3
+ *
4
+ * Real-time progress visualization for multi-layer parallel workflow execution
5
+ * using listr2. Implements the WorkflowCallbacks interface to observe workflow
6
+ * lifecycle events without coupling to orchestration internals.
7
+ *
8
+ * Features:
9
+ * - Top-level phase task groups with emoji-annotated titles
10
+ * - Nested concurrent task groups for parallel spawn layers
11
+ * - Live status updates for spawn transitions (queued → running → completed/failed)
12
+ * - Collapsible layer summaries on completion
13
+ */
14
+ import type { WorkflowCallbacks } from '../models/workflow-callbacks.js';
15
+ /**
16
+ * Configuration options for WorkflowReporter
17
+ */
18
+ export interface WorkflowReporterOptions {
19
+ /**
20
+ * Maximum terminal width for output formatting (default: 80)
21
+ */
22
+ maxWidth?: number;
23
+ /**
24
+ * Disable color output
25
+ */
26
+ noColor?: boolean;
27
+ /**
28
+ * Force non-TTY mode (use simple renderer)
29
+ * When true or when process.stdout.isTTY is false, disables spinners
30
+ * and uses plain-text output without ANSI escape codes
31
+ */
32
+ nonTTY?: boolean;
33
+ /**
34
+ * Enable verbose output mode (show spawn output inline in real-time)
35
+ * When enabled, spawn outputs are streamed with visual delimiters
36
+ */
37
+ verbose?: boolean;
38
+ }
39
+ /**
40
+ * Summary data for the final dashboard display
41
+ */
42
+ export interface DashboardSummary {
43
+ /** Number of failed spawns */
44
+ failedCount: number;
45
+ /** Number of successful spawns */
46
+ passedCount: number;
47
+ /** Per-phase breakdown */
48
+ phases: Array<{
49
+ duration: number;
50
+ failed: number;
51
+ name: string;
52
+ passed: number;
53
+ }>;
54
+ /** Absolute path to the session report file */
55
+ sessionReportPath?: string;
56
+ /** Total duration in milliseconds */
57
+ totalDuration: number;
58
+ /** Total number of spawns across all phases */
59
+ totalSpawns: number;
60
+ }
61
+ /**
62
+ * WorkflowReporter provides real-time structured progress visualization
63
+ * of multi-layer parallel execution using listr2.
64
+ *
65
+ * Usage:
66
+ * ```typescript
67
+ * const reporter = new WorkflowReporter({ verbose: false })
68
+ * orchestrator.setCallbacks(reporter.getCallbacks())
69
+ * // ... workflow execution ...
70
+ * reporter.dispose()
71
+ * ```
72
+ */
73
+ export declare class WorkflowReporter {
74
+ private currentPhaseIndex;
75
+ private currentPhaseName;
76
+ private disposed;
77
+ private readonly options;
78
+ private phaseOrder;
79
+ private phases;
80
+ private listrInstance;
81
+ private listrPromise;
82
+ private phaseTransitionChain;
83
+ private phaseTaskResolver;
84
+ private phaseTaskOutput;
85
+ private phaseTaskTitle;
86
+ private currentTaskPhase;
87
+ private pendingTitle;
88
+ private pendingOutput;
89
+ private tickerInterval;
90
+ private tickerFrame;
91
+ private static readonly SPINNER_FRAMES;
92
+ constructor(options?: WorkflowReporterOptions);
93
+ /**
94
+ * Display final boxed dashboard with workflow summary (AC: #4)
95
+ */
96
+ displayFinalDashboard(summary: DashboardSummary): void;
97
+ /**
98
+ * Dispose of resources and clean up listr2 instance
99
+ */
100
+ dispose(): void;
101
+ /**
102
+ * Get the workflow callbacks interface for registering with orchestrator
103
+ */
104
+ getCallbacks(): WorkflowCallbacks;
105
+ /**
106
+ * Get the configured max width for output formatting
107
+ */
108
+ getMaxWidth(): number;
109
+ /**
110
+ * Check if reporter has been disposed
111
+ */
112
+ isDisposed(): boolean;
113
+ /**
114
+ * Check if reporter is in TTY mode
115
+ */
116
+ isTTYMode(): boolean;
117
+ /**
118
+ * Check if reporter is in verbose mode
119
+ */
120
+ isVerboseMode(): boolean;
121
+ /**
122
+ * Wait for all listr2 tasks to complete (called after orchestrator finishes)
123
+ */
124
+ waitForCompletion(): Promise<void>;
125
+ /**
126
+ * Clean up the current listr2 instance — resolve pending tasks and wait for
127
+ * the renderer to finish so the next phase gets a clean terminal.
128
+ */
129
+ private cleanupCurrentListr;
130
+ /**
131
+ * Create a new listr2 instance for a phase. The phase gets a single top-level
132
+ * task with a spinner. Spawn progress is piped as task output (shown below the
133
+ * spinner line). The task resolves when handlePhaseComplete fires.
134
+ *
135
+ * Phase transitions are chained: old instance is fully cleaned up before the
136
+ * new one starts rendering, preventing two renderers fighting over stdout.
137
+ */
138
+ private createPhaseListr;
139
+ /**
140
+ * Display a phase banner. In verbose mode, shows a full formatBox banner.
141
+ * In non-verbose TTY mode, the listr2 spinner is the only display (no banner).
142
+ * In non-TTY mode, shows a plain-text header.
143
+ */
144
+ private displayPhaseBanner;
145
+ private displayPlainTextDashboard;
146
+ private displayRichDashboard;
147
+ private handlePhaseStart;
148
+ private handlePhaseComplete;
149
+ private handleLayerStart;
150
+ private handleLayerComplete;
151
+ private handleSpawnStart;
152
+ /**
153
+ * Live-tick the phase title — rotates through running spawns with elapsed time.
154
+ * Called every 2s by the ticker interval AND once immediately on spawn start.
155
+ */
156
+ private stopTicker;
157
+ /**
158
+ * Build and render all spawn lines with per-item spinners + elapsed time.
159
+ * Called every second by the ticker interval AND once on spawn start/complete.
160
+ */
161
+ private tickSpawns;
162
+ private handleSpawnComplete;
163
+ private handleSpawnOutput;
164
+ private handleError;
165
+ }