claude-flow 1.0.2 ā 1.0.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/bin/claude-flow +0 -0
- package/package.json +1 -1
- package/src/cli/cli-core.ts +1 -1
- package/src/cli/commands/index.ts +122 -0
package/bin/claude-flow
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/cli/cli-core.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { red, green, yellow, blue, bold, cyan } from "https://deno.land/std@0.22
|
|
|
8
8
|
import { ensureDir } from "https://deno.land/std@0.224.0/fs/mod.ts";
|
|
9
9
|
import { join } from "https://deno.land/std@0.224.0/path/mod.ts";
|
|
10
10
|
|
|
11
|
-
export const VERSION = "1.0.
|
|
11
|
+
export const VERSION = "1.0.2";
|
|
12
12
|
|
|
13
13
|
interface CommandContext {
|
|
14
14
|
args: string[];
|
|
@@ -607,6 +607,128 @@ export function setupCommands(cli: CLI): void {
|
|
|
607
607
|
},
|
|
608
608
|
});
|
|
609
609
|
|
|
610
|
+
// Monitor command
|
|
611
|
+
cli.command({
|
|
612
|
+
name: "monitor",
|
|
613
|
+
description: "Live monitoring dashboard",
|
|
614
|
+
options: [
|
|
615
|
+
{
|
|
616
|
+
name: "interval",
|
|
617
|
+
short: "i",
|
|
618
|
+
description: "Update interval in seconds",
|
|
619
|
+
type: "number",
|
|
620
|
+
default: 2,
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
name: "compact",
|
|
624
|
+
short: "c",
|
|
625
|
+
description: "Compact view mode",
|
|
626
|
+
type: "boolean",
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
name: "focus",
|
|
630
|
+
short: "f",
|
|
631
|
+
description: "Focus on specific component",
|
|
632
|
+
type: "string",
|
|
633
|
+
},
|
|
634
|
+
],
|
|
635
|
+
action: async (ctx: CommandContext) => {
|
|
636
|
+
try {
|
|
637
|
+
const persist = await getPersistence();
|
|
638
|
+
const stats = await persist.getStats();
|
|
639
|
+
|
|
640
|
+
// Check if orchestrator is running
|
|
641
|
+
const isRunning = await Deno.stat("orchestrator.log").then(() => true).catch(() => false);
|
|
642
|
+
|
|
643
|
+
if (!isRunning) {
|
|
644
|
+
warning("Orchestrator is not running. Start it first with 'claude-flow start'");
|
|
645
|
+
return;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
info("Starting live monitoring dashboard...");
|
|
649
|
+
console.log("Press Ctrl+C to exit");
|
|
650
|
+
|
|
651
|
+
// Simple monitoring loop
|
|
652
|
+
const interval = (ctx.flags.interval as number || ctx.flags.i as number || 2) * 1000;
|
|
653
|
+
const isCompact = ctx.flags.compact as boolean || ctx.flags.c as boolean || false;
|
|
654
|
+
let running = true;
|
|
655
|
+
|
|
656
|
+
const cleanup = () => {
|
|
657
|
+
running = false;
|
|
658
|
+
console.log("\nMonitor stopped");
|
|
659
|
+
Deno.exit(0);
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
Deno.addSignalListener("SIGINT", cleanup);
|
|
663
|
+
Deno.addSignalListener("SIGTERM", cleanup);
|
|
664
|
+
|
|
665
|
+
// Hide cursor
|
|
666
|
+
Deno.stdout.writeSync(new TextEncoder().encode('\x1b[?25l'));
|
|
667
|
+
|
|
668
|
+
while (running) {
|
|
669
|
+
try {
|
|
670
|
+
// Clear screen
|
|
671
|
+
console.clear();
|
|
672
|
+
|
|
673
|
+
// Get latest stats
|
|
674
|
+
const currentStats = await persist.getStats();
|
|
675
|
+
const agents = await persist.getActiveAgents();
|
|
676
|
+
const tasks = await persist.getActiveTasks();
|
|
677
|
+
|
|
678
|
+
// Header
|
|
679
|
+
success("Claude-Flow Live Monitor");
|
|
680
|
+
console.log("ā".repeat(50));
|
|
681
|
+
|
|
682
|
+
// System overview
|
|
683
|
+
console.log("\nš System Overview:");
|
|
684
|
+
console.log(` š¢ Status: ${isRunning ? 'Running' : 'Stopped'}`);
|
|
685
|
+
console.log(` š¤ Agents: ${currentStats.activeAgents} active (${currentStats.totalAgents} total)`);
|
|
686
|
+
console.log(` š Tasks: ${currentStats.pendingTasks} pending (${currentStats.totalTasks} total)`);
|
|
687
|
+
console.log(` ā
Completed: ${currentStats.completedTasks} tasks`);
|
|
688
|
+
|
|
689
|
+
// Active agents
|
|
690
|
+
if (agents.length > 0 && !isCompact) {
|
|
691
|
+
console.log("\nš¤ Active Agents:");
|
|
692
|
+
for (const agent of agents.slice(0, 5)) {
|
|
693
|
+
console.log(` ⢠${agent.id.substring(0, 20)}... (${agent.type}) - ${agent.status}`);
|
|
694
|
+
}
|
|
695
|
+
if (agents.length > 5) {
|
|
696
|
+
console.log(` ... and ${agents.length - 5} more`);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
// Active tasks
|
|
701
|
+
if (tasks.length > 0 && !isCompact) {
|
|
702
|
+
console.log("\nš Active Tasks:");
|
|
703
|
+
for (const task of tasks.slice(0, 5)) {
|
|
704
|
+
const assignedTo = task.assignedAgent ? `ā ${task.assignedAgent.substring(0, 15)}...` : '(unassigned)';
|
|
705
|
+
console.log(` ⢠${task.id.substring(0, 20)}... (${task.type}) - ${task.status} ${assignedTo}`);
|
|
706
|
+
}
|
|
707
|
+
if (tasks.length > 5) {
|
|
708
|
+
console.log(` ... and ${tasks.length - 5} more`);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
// Footer
|
|
713
|
+
console.log("\n" + "ā".repeat(50));
|
|
714
|
+
console.log(`Last updated: ${new Date().toLocaleTimeString()} ⢠Interval: ${interval/1000}s`);
|
|
715
|
+
|
|
716
|
+
await new Promise(resolve => setTimeout(resolve, interval));
|
|
717
|
+
} catch (err) {
|
|
718
|
+
error(`Monitor error: ${(err as Error).message}`);
|
|
719
|
+
await new Promise(resolve => setTimeout(resolve, interval));
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
// Show cursor
|
|
724
|
+
Deno.stdout.writeSync(new TextEncoder().encode('\x1b[?25h'));
|
|
725
|
+
|
|
726
|
+
} catch (err) {
|
|
727
|
+
error(`Failed to start monitor: ${(err as Error).message}`);
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
});
|
|
731
|
+
|
|
610
732
|
// Help command
|
|
611
733
|
cli.command({
|
|
612
734
|
name: "help",
|