/** * Agentic QE v3 - Swarm Topology Implementation * ADR-034: RL-based swarm topology optimization * * Implements a mutable swarm topology for the neural optimizer to modify. */ import type { SwarmTopology, TopologyAgent, TopologyConnection, AgentMetrics } from './types'; /** * Mutable implementation of SwarmTopology for the neural optimizer */ export declare class MutableSwarmTopology implements SwarmTopology { /** Mutable agent list */ private _agents; /** Mutable connection list */ private _connections; /** Topology type */ private _type; /** Topology metadata */ private _metadata; constructor(type?: SwarmTopology['type']); get agents(): TopologyAgent[]; get connections(): TopologyConnection[]; get type(): SwarmTopology['type']; get metadata(): Record; /** * Add an agent to the topology */ addAgent(agent: TopologyAgent): void; /** * Remove an agent and all its connections */ removeAgent(agentId: string): boolean; /** * Get agent by ID */ getAgent(agentId: string): TopologyAgent | undefined; /** * Update agent metrics */ updateAgentMetrics(agentId: string, metrics: Partial): void; /** * Update agent status */ updateAgentStatus(agentId: string, status: TopologyAgent['status']): void; /** * Add a connection between agents */ addConnection(from: string, to: string, weight?: number): void; /** * Remove a connection */ removeConnection(from: string, to: string): boolean; /** * Update connection weight */ updateConnectionWeight(from: string, to: string, delta: number): void; /** * Set connection weight directly */ setConnectionWeight(from: string, to: string, weight: number): void; /** * Check if connection exists */ hasConnection(from: string, to: string): boolean; /** * Get connections for an agent */ getAgentConnections(agentId: string): TopologyConnection[]; /** * Get degree of an agent */ getAgentDegree(agentId: string): number; /** * Get neighbors of an agent */ getNeighbors(agentId: string): string[]; /** * Calculate graph density */ getDensity(): number; /** * Calculate average degree */ getAverageDegree(): number; /** * Calculate minimum degree (approximates min-cut) */ getMinDegree(): number; /** * Calculate average connection weight */ getAverageWeight(): number; /** * Calculate weight variance */ getWeightVariance(): number; /** * Calculate clustering coefficient */ getClusteringCoefficient(): number; /** * Get load statistics */ getLoadStats(): { avg: number; variance: number; idle: number; overloaded: number; }; /** * Export topology to JSON */ toJSON(): { type: string; agents: TopologyAgent[]; connections: TopologyConnection[]; metadata: Record; }; /** * Import topology from JSON */ static fromJSON(data: { type?: string; agents: TopologyAgent[]; connections: TopologyConnection[]; metadata?: Record; }): MutableSwarmTopology; /** * Create a copy of this topology */ clone(): MutableSwarmTopology; } /** * Build a mesh topology where every agent connects to every other */ export declare function buildMeshTopology(agents: TopologyAgent[]): MutableSwarmTopology; /** * Build a ring topology */ export declare function buildRingTopology(agents: TopologyAgent[]): MutableSwarmTopology; /** * Build a star topology with a central hub */ export declare function buildStarTopology(agents: TopologyAgent[], hubId: string): MutableSwarmTopology; /** * Build a hierarchical topology with a coordinator and workers */ export declare function buildHierarchicalTopology(coordinator: TopologyAgent, workers: TopologyAgent[]): MutableSwarmTopology; /** * Create an empty topology */ export declare function createTopology(type?: SwarmTopology['type']): MutableSwarmTopology; /** * Create an agent with default metrics */ export declare function createAgent(id: string, type: string, options?: Partial): TopologyAgent; //# sourceMappingURL=swarm-topology.d.ts.map