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:

rUv90be7ddac206
diff --git a/v3/@claude-flow/swarm/src/topology-manager.ts b/v3/@claude-flow/swarm/src/topology-manager.ts
index 42b964a4b6..d318ffc3bf 100644
--- a/v3/@claude-flow/swarm/src/topology-manager.ts
+++ b/v3/@claude-flow/swarm/src/topology-manager.ts
@@ -21,6 +21,11 @@ export class TopologyManager extends EventEmitter implements ITopologyManager {
private adjacencyList: Map<string, Set<string>> = new Map();
private lastRebalance: Date = new Date();
+ // O(1) role-based indexes for performance (fixes O(n) find operations)
+ private roleIndex: Map<TopologyNode['role'], Set<string>> = new Map();
+ private queenNode: TopologyNode | null = null;
+ private coordinatorNode: TopologyNode | null = null;
+
constructor(config: Partial<TopologyConfig> = {}) {
super();
this.config = {