/** * Resource Service * * Collects system resources (RAM, GPU) with defensive timeouts. * Resource collection is OPTIONAL and must NEVER block core functionality. */ export interface GPUDevice { index: number; name: string; memoryUsed: number; memoryTotal: number; utilization?: number; temperature?: number; } export interface GPUInfo { vendor: 'nvidia' | 'amd'; devices: GPUDevice[]; totalUsed: number; totalMemory: number; } export interface RAMInfo { used: number; total: number; percent: number; } export interface ServerResources { hostname: string; ram: RAMInfo; gpus: GPUInfo | null; gpuError?: 'timeout' | 'not_found' | 'parse_error' | 'command_failed'; collectedAt: number; } /** * Resource Service - Singleton * * Provides cached, non-blocking access to system resources. */ declare class ResourceService { private cache; private cacheTime; private collecting; private hostname; private hasLoggedOnce; constructor(); /** * Get resources - NEVER blocks, returns cached or empty * Triggers async collection if cache is stale */ getResources(): ServerResources; /** * Force refresh - waits for collection but still has timeout protection * Use sparingly (e.g., on explicit user request) */ refreshResources(): Promise; /** * Check if cached data is stale */ isStale(): boolean; /** * Get empty resources (fallback) */ private getEmptyResources; /** * Async collection - runs in background, updates cache */ private collectAsync; } export declare function getResourceService(): ResourceService; export { ResourceService };