claude-flow 3.59.1 → 3.59.3
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.
- package/.claude/proven-config.json +1 -1
- package/package.json +1 -1
- package/v3/@claude-flow/cli/bin/cli.js +17 -5
- package/v3/@claude-flow/cli/catalog-manifest.json +2 -2
- package/v3/@claude-flow/cli/dist/src/commands/task.js +13 -1
- package/v3/@claude-flow/cli/dist/src/mcp-tools/task-tools.js +13 -0
- package/v3/@claude-flow/cli/package.json +1 -1
package/package.json
CHANGED
|
@@ -369,11 +369,23 @@ if (isHarness) {
|
|
|
369
369
|
const { CLI } = await import('../dist/src/index.js');
|
|
370
370
|
const cli = new CLI();
|
|
371
371
|
cli.run()
|
|
372
|
-
.then(() => {
|
|
373
|
-
// #1552:
|
|
374
|
-
//
|
|
375
|
-
//
|
|
376
|
-
|
|
372
|
+
.then(async () => {
|
|
373
|
+
// #1552: one-shot commands can leave the memory ControllerRegistry's
|
|
374
|
+
// database handles and timers alive. Close them before relying on the
|
|
375
|
+
// event loop to drain.
|
|
376
|
+
//
|
|
377
|
+
// #3226: calling process.exit(0) here used to race that teardown and
|
|
378
|
+
// intermittently abort on Windows with a libuv UV_HANDLE_CLOSING
|
|
379
|
+
// assertion *after* the command had printed a successful result. Set
|
|
380
|
+
// the exit status and let the loop drain instead.
|
|
381
|
+
if (process.exitCode === undefined) process.exitCode = 0;
|
|
382
|
+
try {
|
|
383
|
+
const { shutdownBridge } = await import('../dist/src/memory/memory-bridge.js');
|
|
384
|
+
if (typeof shutdownBridge === 'function') await shutdownBridge();
|
|
385
|
+
} catch {
|
|
386
|
+
// Cleanup is best-effort: it must never turn a successful command into
|
|
387
|
+
// a failure. Commands that do not use memory simply have nothing to do.
|
|
388
|
+
}
|
|
377
389
|
})
|
|
378
390
|
.catch((error) => {
|
|
379
391
|
console.error('Fatal error:', error.message);
|
|
@@ -363,7 +363,7 @@ const statusCommand = {
|
|
|
363
363
|
`Progress: ${result.progress}%`,
|
|
364
364
|
'',
|
|
365
365
|
`Description: ${result.description}`
|
|
366
|
-
].join('\n'), `Task: ${result.
|
|
366
|
+
].join('\n'), `Task: ${result.taskId}`);
|
|
367
367
|
// Assignment info
|
|
368
368
|
output.writeln();
|
|
369
369
|
output.writeln(output.bold('Assignment'));
|
|
@@ -487,6 +487,18 @@ const cancelCommand = {
|
|
|
487
487
|
taskId,
|
|
488
488
|
reason: reason || 'Cancelled by user via CLI'
|
|
489
489
|
});
|
|
490
|
+
// task_cancel answers an unknown or already-finished task with
|
|
491
|
+
// success: false instead of throwing; report it instead of printing
|
|
492
|
+
// "Task ... cancelled" and exiting 0.
|
|
493
|
+
if (result.success === false) {
|
|
494
|
+
if (ctx.flags.format === 'json') {
|
|
495
|
+
output.printJson(result);
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
output.printError(`Failed to cancel task ${taskId}: ${result.error || 'unknown error'}`);
|
|
499
|
+
}
|
|
500
|
+
return { success: false, exitCode: 1, data: result };
|
|
501
|
+
}
|
|
490
502
|
output.writeln();
|
|
491
503
|
output.printSuccess(`Task ${taskId} cancelled`);
|
|
492
504
|
output.printInfo(`Previous status: ${result.previousStatus}`);
|
|
@@ -499,6 +499,18 @@ export const taskTools = [
|
|
|
499
499
|
const taskId = input.taskId;
|
|
500
500
|
const task = store.tasks[taskId];
|
|
501
501
|
if (task) {
|
|
502
|
+
const previousStatus = task.status;
|
|
503
|
+
// A finished task keeps its outcome: cancelling it used to overwrite a
|
|
504
|
+
// completed task's result and completedAt with a cancel reason.
|
|
505
|
+
if (previousStatus === 'completed' || previousStatus === 'failed' || previousStatus === 'cancelled') {
|
|
506
|
+
return {
|
|
507
|
+
success: false,
|
|
508
|
+
taskId,
|
|
509
|
+
status: previousStatus,
|
|
510
|
+
previousStatus,
|
|
511
|
+
error: `Task is already ${previousStatus}`,
|
|
512
|
+
};
|
|
513
|
+
}
|
|
502
514
|
task.status = 'cancelled';
|
|
503
515
|
task.completedAt = new Date().toISOString();
|
|
504
516
|
task.result = { cancelReason: input.reason || 'Cancelled by user' };
|
|
@@ -508,6 +520,7 @@ export const taskTools = [
|
|
|
508
520
|
success: true,
|
|
509
521
|
taskId: task.taskId,
|
|
510
522
|
status: task.status,
|
|
523
|
+
previousStatus,
|
|
511
524
|
cancelledAt: task.completedAt,
|
|
512
525
|
};
|
|
513
526
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claude-flow/cli",
|
|
3
|
-
"version": "3.59.
|
|
3
|
+
"version": "3.59.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
|
|
6
6
|
"main": "dist/src/index.js",
|