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