@claude-flow/cli 3.0.0-alpha.156 → 3.0.0-alpha.158

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.
@@ -1 +1 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAkjI1E,eAAO,MAAM,YAAY,EAAE,OAiG1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../../src/commands/hooks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAiC,MAAM,aAAa,CAAC;AAyjI1E,eAAO,MAAM,YAAY,EAAE,OAiG1B,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -139,9 +139,9 @@ const postEditCommand = {
139
139
  {
140
140
  name: 'success',
141
141
  short: 's',
142
- description: 'Whether the edit was successful (defaults to true)',
142
+ description: 'Whether the edit was successful',
143
143
  type: 'boolean',
144
- default: true
144
+ required: true
145
145
  },
146
146
  {
147
147
  name: 'outcome',
@@ -167,8 +167,10 @@ const postEditCommand = {
167
167
  output.printError('File path is required. Use --file or -f flag.');
168
168
  return { success: false, exitCode: 1 };
169
169
  }
170
- // Default to true if not specified (defensive for hook invocations)
171
- const successValue = success !== undefined ? success : true;
170
+ if (success === undefined) {
171
+ output.printError('Success flag is required. Use --success true/false.');
172
+ return { success: false, exitCode: 1 };
173
+ }
172
174
  output.printInfo(`Recording outcome for: ${output.highlight(filePath)}`);
173
175
  try {
174
176
  // Parse metrics if provided
@@ -185,7 +187,7 @@ const postEditCommand = {
185
187
  // Call MCP tool for post-edit hook
186
188
  const result = await callMCPTool('hooks/post-edit', {
187
189
  filePath,
188
- success: successValue,
190
+ success,
189
191
  outcome: ctx.flags.outcome,
190
192
  metrics,
191
193
  timestamp: Date.now(),
@@ -335,9 +337,9 @@ const postCommandCommand = {
335
337
  {
336
338
  name: 'success',
337
339
  short: 's',
338
- description: 'Whether the command succeeded (defaults to true)',
340
+ description: 'Whether the command succeeded',
339
341
  type: 'boolean',
340
- default: true
342
+ required: true
341
343
  },
342
344
  {
343
345
  name: 'exit-code',
@@ -364,14 +366,16 @@ const postCommandCommand = {
364
366
  output.printError('Command is required. Use --command or -c flag.');
365
367
  return { success: false, exitCode: 1 };
366
368
  }
367
- // Default to true if not specified (defensive for hook invocations)
368
- const successValue = success !== undefined ? success : true;
369
+ if (success === undefined) {
370
+ output.printError('Success flag is required. Use --success true/false.');
371
+ return { success: false, exitCode: 1 };
372
+ }
369
373
  output.printInfo(`Recording command outcome: ${output.highlight(command)}`);
370
374
  try {
371
375
  // Call MCP tool for post-command hook
372
376
  const result = await callMCPTool('hooks/post-command', {
373
377
  command,
374
- success: successValue,
378
+ success,
375
379
  exitCode: ctx.flags.exitCode || 0,
376
380
  duration: ctx.flags.duration,
377
381
  timestamp: Date.now(),
@@ -1277,9 +1281,9 @@ const postTaskCommand = {
1277
1281
  {
1278
1282
  name: 'success',
1279
1283
  short: 's',
1280
- description: 'Whether the task succeeded (defaults to true)',
1284
+ description: 'Whether the task succeeded',
1281
1285
  type: 'boolean',
1282
- default: true
1286
+ required: true
1283
1287
  },
1284
1288
  {
1285
1289
  name: 'quality',
@@ -1302,13 +1306,15 @@ const postTaskCommand = {
1302
1306
  // Auto-generate task ID if not provided
1303
1307
  const taskId = ctx.flags.taskId || `task_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
1304
1308
  const success = ctx.flags.success;
1305
- // Default to true if not specified (defensive for hook invocations)
1306
- const successValue = success !== undefined ? success : true;
1309
+ if (success === undefined) {
1310
+ output.printError('Success flag is required. Use --success true/false.');
1311
+ return { success: false, exitCode: 1 };
1312
+ }
1307
1313
  output.printInfo(`Recording outcome for task: ${output.highlight(taskId)}`);
1308
1314
  try {
1309
1315
  const result = await callMCPTool('hooks/post-task', {
1310
1316
  taskId,
1311
- success: successValue,
1317
+ success,
1312
1318
  quality: ctx.flags.quality,
1313
1319
  agent: ctx.flags.agent,
1314
1320
  timestamp: Date.now(),
@@ -1318,7 +1324,7 @@ const postTaskCommand = {
1318
1324
  return { success: true, data: result };
1319
1325
  }
1320
1326
  output.writeln();
1321
- output.printSuccess(`Task outcome recorded: ${successValue ? 'SUCCESS' : 'FAILED'}`);
1327
+ output.printSuccess(`Task outcome recorded: ${success ? 'SUCCESS' : 'FAILED'}`);
1322
1328
  output.writeln();
1323
1329
  output.writeln(output.bold('Learning Updates'));
1324
1330
  output.printTable({