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 edit:

rUv2491b6d58088
diff --git a/v3/@claude-flow/swarm/src/federation-hub.ts b/v3/@claude-flow/swarm/src/federation-hub.ts
index 8e007fdead..b4c99d44e2 100644
--- a/v3/@claude-flow/swarm/src/federation-hub.ts
+++ b/v3/@claude-flow/swarm/src/federation-hub.ts
@@ -208,6 +208,16 @@ export class FederationHub extends EventEmitter {
totalAgentLifespanMs: number;
};
+ // ============================================================================
+ // Secondary Indexes for O(1) Lookups (Performance Optimization)
+ // ============================================================================
+
+ /** Index: swarmId -> Set of agentIds */
+ private agentsBySwarm: Map<SwarmId, Set<EphemeralAgentId>> = new Map();
+
+ /** Index: status -> Set of agentIds */
+ private agentsByStatus: Map<EphemeralAgent['status'], Set<EphemeralAgentId>> = new Map();
+
constructor(config?: FederationConfig) {
super();
this.config = { ...DEFAULT_CONFIG, ...config };