Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUvc2e3bdec71d8
diff --git a/package.json b/package.json
index 21af8ab4a6..bbfa825a2b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "claude-flow",
- "version": "3.1.0-alpha.10",
+ "version": "3.1.0-alpha.12",
"description": "Enterprise AI agent orchestration for Claude Code - Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
"main": "dist/index.js",
"type": "module",
diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json
index b745950203..3e97771362 100644
--- a/v3/@claude-flow/cli/package.json
+++ b/v3/@claude-flow/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/cli",
- "version": "3.1.0-alpha.10",
+ "version": "3.1.0-alpha.12",
"type": "module",
"description": "Claude Flow CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
"main": "dist/src/index.js",
diff --git a/v3/@claude-flow/cli/src/commands/hooks.ts b/v3/@claude-flow/cli/src/commands/hooks.ts
index 197264734a..480473d59b 100644
--- a/v3/@claude-flow/cli/src/commands/hooks.ts
+++ b/v3/@claude-flow/cli/src/commands/hooks.ts
@@ -4190,6 +4190,239 @@ const modelStatsCommand: Command = {
}
};
+// Teammate Idle command - Agent Teams integration
+const teammateIdleCommand: Command = {
+ name: 'teammate-idle',
+ description: 'Handle idle teammate in Agent Teams - auto-assign tasks or notify lead',
+ options: [
+ {
+ name: 'auto-assign',
+ short: 'a',
+ description: 'Automatically assign pending tasks to idle teammate',
+ type: 'boolean',
+ default: true
+ },
+ {
+ name: 'check-task-list',
+ short: 'c',
+ description: 'Check shared task list for available work',
+ type: 'boolean',
+ default: true
+ },
+ {
+ name: 'teammate-id',
+ short: 't',
+ description: 'ID of the idle teammate',
+ type: 'string'
+ },
+ {
+ name: 'team-name',
+ description: 'Team name for context',
+ type: 'string'
+ }
+ ],
+ examples: [
+ { command: 'claude-flow hooks teammate-idle --auto-assign true', description: 'Auto-assign tasks to idle teammate' },
+ { command: 'claude-flow hooks teammate-idle -t worker-1 --check-task-list', description: 'Check tasks for specific teammate' }
+ ],
+ action: async (ctx: CommandContext): Promise<CommandResult> => {
+ const autoAssign = ctx.flags.autoAssign !== false;
+ const checkTaskList = ctx.flags.checkTaskList !== false;
+ const teammateId = ctx.flags.teammateId as string;
+ const teamName = ctx.flags.teamName as string;
+
+ if (ctx.flags.format !== 'json') {
+ output.printInfo(`Teammate idle hook triggered${teammateId ? ` for: ${output.highlight(teammateId)}` : ''}`);
+ }
+
+ try {
+ const result = await callMCPTool<{
+ success: boolean;
+ teammateId: string;
+ action: 'assigned' | 'waiting' | 'notified';
+ taskAssigned?: {
+ taskId: string;
+ subject: string;
+ priority: string;
+ };
+ pendingTasks: number;
+ message: string;
+ }>('hooks_teammate-idle', {
+ autoAssign,
+ checkTaskList,
+ teammateId,
+ teamName,
+ timestamp: Date.now(),
+ });
+
+ if (ctx.flags.format === 'json') {
+ output.printJson(result);
+ return { success: true, data: result };
+ }
+
+ output.writeln();
+ if (result.action === 'assigned' && result.taskAssigned) {
+ output.printSuccess(`Task assigned: ${result.taskAssigned.subject}`);
+ output.printList([
+ `Task ID: ${result.taskAssigned.taskId}`,
+ `Priority: ${result.taskAssigned.priority}`,
+ `Pending tasks remaining: ${result.pendingTasks}`
+ ]);
+ } else if (result.action === 'waiting') {
+ output.printInfo('No pending tasks available - teammate waiting for work');
+ } else {
+ output.printInfo(`Team lead notified: ${result.message}`);
+ }
+
+ return { success: true, data: result };
+ } catch (error) {
+ // Graceful fallback - don't fail hard, just report
+ if (ctx.flags.format === 'json') {
+ output.printJson({ success: true, action: 'waiting', message: 'Teammate idle - no MCP server' });
+ } else {
+ output.printInfo('Teammate idle - awaiting task assignment');
+ }
+ return { success: true };
+ }
+ }
+};
+
+// Task Completed command - Agent Teams integration
+const taskCompletedCommand: Command = {
+ name: 'task-completed',
+ description: 'Handle task completion in Agent Teams - train patterns and notify lead',
+ options: [
+ {
+ name: 'task-id',
+ short: 'i',
+ description: 'ID of the completed task',
+ type: 'string',
+ required: true
+ },
+ {
+ name: 'train-patterns',
+ short: 'p',
+ description: 'Train neural patterns from successful task',
+ type: 'boolean',
+ default: true
+ },
+ {
+ name: 'notify-lead',
+ short: 'n',
+ description: 'Notify team lead of task completion',
+ type: 'boolean',
+ default: true
+ },
+ {
+ name: 'success',
+ short: 's',
+ description: 'Whether the task succeeded',
+ type: 'boolean',
+ default: true
+ },
+ {
+ name: 'quality',
+ short: 'q',
+ description: 'Quality score (0-1)',
+ type: 'number'
+ },
+ {
+ name: 'teammate-id',
+ short: 't',
+ description: 'ID of the teammate that completed the task',
+ type: 'string'
+ }
+ ],
+ examples: [
+ { command: 'claude-flow hooks task-completed -i task-123 --train-patterns', description: 'Complete task and train patterns' },
+ { command: 'claude-flow hooks task-completed -i task-456 --notify-lead --quality 0.95', description: 'Complete with quality score' }
+ ],
+ action: async (ctx: CommandContext): Promise<CommandResult> => {
+ const taskId = ctx.args[0] || ctx.flags.taskId as string;
+ const trainPatterns = ctx.flags.trainPatterns !== false;
+ const notifyLead = ctx.flags.notifyLead !== false;
+ const success = ctx.flags.success !== false;
+ const quality = ctx.flags.quality as number;
+ const teammateId = ctx.flags.teammateId as string;
+
+ if (!taskId) {
+ output.printError('Task ID is required. Use --task-id or -i flag.');
+ return { success: false, exitCode: 1 };
+ }
+
+ if (ctx.flags.format !== 'json') {
+ output.printInfo(`Task completed: ${output.highlight(taskId)}`);
+ }
+
+ try {
+ const result = await callMCPTool<{
+ success: boolean;
+ taskId: string;
+ patternsLearned: number;
+ leadNotified: boolean;
+ metrics: {
+ duration: number;
+ quality: number;
+ learningUpdates: number;
+ };
+ nextTask?: {
+ taskId: string;
+ subject: string;
+ };
+ }>('hooks_task-completed', {
+ taskId,
+ trainPatterns,
+ notifyLead,
+ success,
+ quality,
+ teammateId,
+ timestamp: Date.now(),
+ });
+
+ if (ctx.flags.format === 'json') {
+ output.printJson(result);
+ return { success: true, data: result };
+ }
+
+ output.writeln();
+ output.printSuccess(`Task ${taskId} marked complete`);
+
+ output.writeln();
+ output.writeln(output.bold('Completion Metrics'));
+ output.printTable({
+ columns: [
+ { key: 'metric', header: 'Metric', width: 25 },
+ { key: 'value', header: 'Value', width: 20, align: 'right' }
+ ],
+ data: [
+ { metric: 'Patterns Learned', value: result.patternsLearned },
+ { metric: 'Quality Score', value: quality ? `${(quality * 100).toFixed(0)}%` : 'N/A' },
+ { metric: 'Lead Notified', value: result.leadNotified ? 'Yes' : 'No' },
+ { metric: 'Learning Updates', value: result.metrics?.learningUpdates || 0 }
+ ]
+ });
+
+ if (result.nextTask) {
+ output.writeln();
+ output.printInfo(`Next available task: ${result.nextTask.subject}`);
+ }
+
+ return { success: true, data: result };
+ } catch (error) {
+ // Graceful fallback
+ if (ctx.flags.format === 'json') {
+ output.printJson({ success: true, taskId, message: 'Task completed - patterns pending' });
+ } else {
+ output.printSuccess(`Task ${taskId} completed`);
+ if (trainPatterns) {
+ output.printInfo('Pattern training queued for next sync');
+ }
+ }
+ return { success: true };
+ }
+ }
+};
+
// Main hooks command
export const hooksCommand: Command = {
name: 'hooks',
diff --git a/v3/@claude-flow/codex/package.json b/v3/@claude-flow/codex/package.json
index 6e0ad4b529..8163037520 100644
--- a/v3/@claude-flow/codex/package.json
+++ b/v3/@claude-flow/codex/package.json
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/codex",
- "version": "3.0.0-alpha.8",
+ "version": "3.0.0-alpha.9",
"description": "Codex CLI integration for Claude Flow - OpenAI Codex platform adapter",
"type": "module",
"main": "./dist/index.js",