/** * Agent Registry with Memory Integration * Provides persistent storage and coordination for agent management */ import { DistributedMemorySystem } from "../memory/distributed-memory.js"; import { AgentState, AgentType, AgentStatus } from "../swarm/types.js"; import { EventEmitter } from "node:events"; export interface AgentCoordinationData { agentId: string; data: { taskAssignments?: Record; collaborations?: string[]; state?: Record; capabilities?: Record; [key: string]: unknown; }; timestamp: Date; } export interface AgentMetadata { registeredBy: string; version: string; lastSeen?: Date; platform?: string; environment?: string; [key: string]: unknown; } export interface AgentRegistryEntry { agent: AgentState; createdAt: Date; lastUpdated: Date; tags: string[]; metadata: AgentMetadata; } export interface AgentQuery { type?: AgentType; status?: AgentStatus; tags?: string[]; healthThreshold?: number; namePattern?: string; createdAfter?: Date; lastActiveAfter?: Date; } export interface AgentStatistics { totalAgents: number; byType: Record; byStatus: Record; averageHealth: number; activeAgents: number; totalUptime: number; tasksCompleted: number; successRate: number; } /** * Centralized agent registry with persistent storage */ export declare class AgentRegistry extends EventEmitter { private memory; private namespace; private cache; private cacheExpiry; private lastCacheUpdate; constructor(memory: DistributedMemorySystem, namespace?: string); initialize(): Promise; /** * Register a new agent in the registry */ registerAgent(agent: AgentState, tags?: string[]): Promise; /** * Update agent information in registry */ updateAgent(agentId: string, updates: Partial): Promise; /** * Remove agent from registry */ unregisterAgent(agentId: string, preserveHistory?: boolean): Promise; /** * Get agent by ID */ getAgent(agentId: string): Promise; /** * Get agent entry with metadata */ getAgentEntry(agentId: string): Promise; /** * Query agents by criteria */ queryAgents(query?: AgentQuery): Promise; /** * Get all registered agents */ getAllAgents(): Promise; /** * Get agents by type */ getAgentsByType(type: AgentType): Promise; /** * Get agents by status */ getAgentsByStatus(status: AgentStatus): Promise; /** * Get healthy agents */ getHealthyAgents(threshold?: number): Promise; /** * Get registry statistics */ getStatistics(): Promise; /** * Search agents by capabilities */ searchByCapabilities(requiredCapabilities: string[]): Promise; /** * Find best agent for task */ findBestAgent(taskType: string, requiredCapabilities?: string[], preferredAgent?: string): Promise; /** * Store agent coordination data */ storeCoordinationData(agentId: string, data: AgentCoordinationData["data"]): Promise; /** * Retrieve agent coordination data */ getCoordinationData(agentId: string): Promise; private isValidAgentRegistryEntry; private isValidCoordinationData; private loadFromMemory; private refreshCacheIfNeeded; private isCacheValid; private getAgentKey; private getArchiveKey; private calculateAgentScore; } //# sourceMappingURL=agent-registry.d.ts.map