/** * Connection Mode Detector for Humancy plugin * * Implements hybrid detection with fallback: * 1. Check configuration for explicit mode preference * 2. If not configured, auto-detect: Direct → Cloud → Offline */ import type { AgencyCoreAPI } from '@generacy-ai/agency'; import { ConnectionMode, type ConnectionState } from './types.js'; /** * Connection mode detector with hybrid detection and fallback */ export declare class ConnectionModeDetector { private state; private coreAPI?; constructor(); /** * Initialize detector with core API access */ initialize(coreAPI: AgencyCoreAPI): void; /** * Detect the appropriate connection mode * * Priority: * 1. Explicit config preference * 2. Direct mode (if Humancy extension detected) * 3. Cloud mode (if API config present) * 4. Offline (fallback) */ detect(): Promise; /** * Get explicit mode from configuration */ private getConfiguredMode; /** * Detect if Humancy VS Code extension is available locally * * In a real implementation, this would check for IPC availability * or a health endpoint. For now, we check for environment signals. */ private detectDirectMode; /** * Check if API configuration is available for cloud mode */ private hasApiConfig; /** * Get HTTP client info for cloud mode */ private getHttpClientInfo; /** * Get the API URL from config or environment */ getApiUrl(): string; /** * Get the API key from config or environment */ getApiKey(): string | undefined; /** * Check if API key is configured */ hasApiKey(): boolean; /** * Get the request timeout from config */ getTimeout(): number; /** * Get current connection state */ getState(): ConnectionState; /** * Get current connection mode */ getMode(): ConnectionMode; /** * Check if currently connected */ isConnected(): boolean; /** * Update connection state after a communication attempt */ updateConnectionState(success: boolean, error?: string): void; /** * Force a specific mode (useful for testing or manual override) */ setMode(mode: ConnectionMode): void; } //# sourceMappingURL=detector.d.ts.map