/**
 * Agent utility functions for lifecycle management
 */
import { AgentRegistryManager } from '../core/agent-registry.js';
/**
 * Check if a port is in use
 */
export declare function isPortInUse(port: number): Promise<boolean>;
/**
 * Check if an agent name already exists in registry
 */
export declare function isDuplicateName(name: string, excludeId?: string): boolean;
/**
 * Find an available port starting from basePort
 */
export declare function findAvailablePort(basePort: number, maxAttempts?: number): Promise<number>;
/**
 * Get port range for agent type
 */
export declare function getPortRange(type: 'master' | 'worker'): {
    start: number;
    end: number;
};
/**
 * Find available port in appropriate range
 */
export declare function findAvailablePortInRange(type: 'master' | 'worker'): Promise<number>;
/**
 * Clean up stale agents from registry
 * - Agents marked offline for more than cleanupThresholdMs
 * - Agents with no recent heartbeat
 */
export declare function cleanupStaleAgents(cleanupThresholdMs?: number, existingRegistry?: AgentRegistryManager): number;
/**
 * Check if an agent endpoint is reachable
 */
/**
 * Check agent health via gRPC Health service.
 * @param grpcAddress - gRPC address (e.g. "localhost:43211")
 */
export declare function checkAgentHealthGrpc(grpcAddress: string, timeoutMs?: number): Promise<boolean>;
export declare function checkAgentHealth(endpoint: string, timeoutMs?: number): Promise<boolean>;
/**
 * Update agent heartbeat
 */
export declare function updateAgentHeartbeat(agentId: string): boolean;
/**
 * Get unique agent name
 */
export declare function getUniqueAgentName(baseName: string): string;
/** Kill process using a port (Windows) */
export declare function killProcessOnPort(port: number): Promise<boolean>;
/** Safe port acquisition with cleanup option */
export declare function acquirePort(port: number, range?: 'master' | 'worker'): Promise<number>;
//# sourceMappingURL=agent-utils.d.ts.map