// Type declarations for @wengine-ai/llms
// Manually maintained to avoid path alias issues

export interface ProviderHealthState {
  provider: string;
  model: string;
  status: 'closed' | 'open' | 'half-open';
  failureCount: number;
  successCount: number;
  lastFailureTime: number;
  lastProbeTime: number;
  lastError?: string;
}

export interface HealthPoolConfig {
  enabled?: boolean;
  failureThreshold?: number;
  probeIntervalMinutes?: number;
  halfOpenSuccessThreshold?: number;
}

export class ProviderHealthStore {
  constructor(config?: HealthPoolConfig);
  recordSuccess(provider: string, model: string): void;
  recordFailure(provider: string, model: string, error?: string): void;
  getState(provider: string, model: string): ProviderHealthState | undefined;
  isAvailable(provider: string, model: string): boolean;
  getPriority(provider: string, model: string): number;
  needsProbe(state: ProviderHealthState): boolean;
  markProbeAttempt(provider: string, model: string): void;
  clear(): void;
  getAllStates(): ProviderHealthState[];
  getFailPoolModels(): string[];
  getHalfOpenModels(): string[];
  stopProbeTimer(): void;
}

export function getHealthStore(config?: HealthPoolConfig): ProviderHealthStore;
export function resetHealthStore(): void;