import { type Ref } from '#imports'; import type { FetchError } from 'ofetch'; export interface WorkerInfo { id: string; name: string | null; status: 'connected' | 'disconnected' | string; runtime: 'rust' | 'node' | 'python' | string | null; version: string | null; os: string | null; pid: number | null; ip_address: string; connected_at_ms: number; active_invocations: number; function_count: number; functions?: string[]; latest_metrics: WorkerMetrics | null; isolation?: 'in-process' | 'sidecar' | 'plugin' | string; description?: string | null; } export interface WorkerMetrics { cpu_percent: number; memory_heap_used: number; memory_heap_total: number; memory_rss: number; memory_external: number; cpu_user_micros: number; cpu_system_micros: number; event_loop_lag_ms: number; uptime_seconds: number; timestamp_ms: number; runtime: string; } export interface HealthComponent { status: string; details: Record; } export interface EngineHealth { status: string; version: string; timestamp: number; components: Record; } export interface WorkersData { health: EngineHealth | null; healthError: string | null; workers: WorkerInfo[]; workersError: string | null; } /** * Composable for fetching engine health + worker list. * Polls every 5 seconds to give a live production view. */ export declare function useWorkers(pollIntervalMs?: number): { data: Ref; refresh: () => Promise; status: Ref<'idle' | 'pending' | 'success' | 'error'>; error: Ref; engineOnline: Ref; };