= 3 ORDER BY hit_count DESC LIMIT 3", [$hour, $dow] ) ?? []; // Map intents to friendly suggestion prompts $intentPrompts = [ 'network_scan' => 'Run a network scan?', 'jellyfin_now_playing' => 'Check what\'s playing on Jellyfin?', 'jellyfin_library' => 'Check the Jellyfin library?', 'ha_scene' => 'Activate a home scene?', 'planner:briefing' => 'Get your daily briefing?', 'vm_suggestions' => 'Check VM resource usage?', 'jellyfin_pause' => 'Pause Jellyfin?', 'focus_mode' => 'Switch to focus mode?', 'show_panels' => 'Show all panels?', ]; $suggestions = []; foreach ($rows as $r) { $intent = $r['intent_name']; if (isset($intentPrompts[$intent])) { $suggestions[] = [ 'intent' => $intent, 'prompt' => $intentPrompts[$intent], 'hit_count' => (int)$r['hit_count'], ]; } } echo json_encode(['suggestions' => $suggestions, 'hour' => $hour, 'dow' => $dow]);