@hyperdrive.bot/bmad-workflow 1.0.16 → 1.0.18

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.
@@ -165,8 +165,13 @@ export class ClaudeAgentRunner {
165
165
  tempFile,
166
166
  }, 'Executing command with temp file');
167
167
  // Use exec instead of spawn for better shell compatibility
168
+ // Note: setting CLAUDECODE to undefined in a spread does NOT remove it —
169
+ // Node coerces undefined to the string "undefined", which is still truthy.
170
+ // We must delete the key from the env object to fully unset it.
171
+ const env = { ...process.env };
172
+ delete env.CLAUDECODE;
168
173
  const { stderr, stdout } = await execAsync(command, {
169
- env: process.env,
174
+ env,
170
175
  maxBuffer: 10 * 1024 * 1024, // 10MB buffer
171
176
  shell: process.env.SHELL || '/bin/bash',
172
177
  timeout,
@@ -44,7 +44,7 @@
44
44
  * ```
45
45
  */
46
46
  import type pino from 'pino';
47
- import type { InputDetectionResult, WorkflowConfig, WorkflowResult } from '../../models/index.js';
47
+ import type { InputDetectionResult, WorkflowCallbacks, WorkflowConfig, WorkflowResult } from '../../models/index.js';
48
48
  import type { AIProviderRunner } from '../agents/agent-runner.js';
49
49
  import type { WorkflowLogger } from '../logging/workflow-logger.js';
50
50
  import { FileManager } from '../file-system/file-manager.js';
@@ -95,6 +95,8 @@ export interface WorkflowOrchestratorConfig {
95
95
  storyTypeDetector: StoryTypeDetector;
96
96
  /** Optional WorkflowLogger for pipeline progress tracking */
97
97
  workflowLogger?: WorkflowLogger;
98
+ /** Optional lifecycle event callbacks for workflow observability */
99
+ callbacks?: WorkflowCallbacks;
98
100
  }
99
101
  /**
100
102
  * Options for building an epic creation prompt
@@ -136,6 +138,7 @@ export interface StoryPromptOptions {
136
138
  export declare class WorkflowOrchestrator {
137
139
  private readonly agentRunner;
138
140
  private readonly batchProcessor;
141
+ private readonly callbacks?;
139
142
  private readonly epicParser;
140
143
  private readonly fileManager;
141
144
  private readonly fileScaffolder;
@@ -202,6 +205,35 @@ export declare class WorkflowOrchestrator {
202
205
  * @private
203
206
  */
204
207
  private buildSuccessResult;
208
+ /**
209
+ * Invoke a callback safely, catching and logging any errors
210
+ *
211
+ * All callback invocations are wrapped in try-catch to prevent
212
+ * callback errors from interrupting workflow execution.
213
+ *
214
+ * @param callbackName - Name of the callback for logging
215
+ * @param callback - The callback function to invoke
216
+ * @param context - The context to pass to the callback
217
+ * @private
218
+ */
219
+ private invokeCallback;
220
+ /**
221
+ * Invoke the onSpawnOutput callback safely
222
+ *
223
+ * @param callback - The callback function to invoke
224
+ * @param context - The spawn context
225
+ * @param output - The output text
226
+ * @private
227
+ */
228
+ private invokeSpawnOutputCallback;
229
+ /**
230
+ * Invoke the onError callback safely
231
+ *
232
+ * @param error - The error that occurred
233
+ * @param options - Additional context for the error
234
+ * @private
235
+ */
236
+ private invokeErrorCallback;
205
237
  /**
206
238
  * Check which files already exist in a directory
207
239
  *