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

rUv43b4be29a271
diff --git a/v3/@claude-flow/cli/src/services/worker-daemon.ts b/v3/@claude-flow/cli/src/services/worker-daemon.ts
index c130203d70..6816addebb 100644
--- a/v3/@claude-flow/cli/src/services/worker-daemon.ts
+++ b/v3/@claude-flow/cli/src/services/worker-daemon.ts
@@ -153,6 +153,64 @@ export class WorkerDaemon extends EventEmitter {
// Initialize worker states
this.initializeWorkerStates();
+
+ // Initialize headless executor (async, non-blocking)
+ this.initHeadlessExecutor().catch((err) => {
+ this.log('warn', `Headless executor init failed: ${err}`);
+ });
+ }
+
+ /**
+ * Initialize headless executor if Claude Code is available
+ */
+ private async initHeadlessExecutor(): Promise<void> {
+ try {
+ this.headlessExecutor = new HeadlessWorkerExecutor(this.projectRoot, {
+ maxConcurrent: this.config.maxConcurrent,
+ });
+
+ this.headlessAvailable = await this.headlessExecutor.isAvailable();
+
+ if (this.headlessAvailable) {
+ this.log('info', 'Claude Code headless mode available - AI workers enabled');
+
+ // Forward headless executor events
+ this.headlessExecutor.on('execution:start', (data) => {
+ this.emit('headless:start', data);
+ });
+
+ this.headlessExecutor.on('execution:complete', (data) => {
+ this.emit('headless:complete', data);
+ });
+
+ this.headlessExecutor.on('execution:error', (data) => {
+ this.emit('headless:error', data);
+ });
+
+ this.headlessExecutor.on('output', (data) => {
+ this.emit('headless:output', data);
+ });
+ } else {
+ this.log('info', 'Claude Code not found - AI workers will run in local fallback mode');
+ }
+ } catch (error) {
+ this.log('warn', `Failed to initialize headless executor: ${error}`);
+ this.headlessAvailable = false;
+ }
+ }
+
+ /**
+ * Check if headless execution is available
+ */
+ isHeadlessAvailable(): boolean {
+ return this.headlessAvailable;
+ }
+
+ /**
+ * Get headless executor instance
+ */
+ getHeadlessExecutor(): HeadlessWorkerExecutor | null {
+ return this.headlessExecutor;
}
/**