-- Query: Active hosts by conversation type (Dec 11)
-- Result variable: active_hosts_by_type

SELECT
    c.host_id,
    c.type AS conversation_type,
    COUNT(*) AS tool_message_count
FROM hostagentspg.public.tool_messages AS tm
INNER JOIN hostagentspg.public.conversations AS c ON tm.conversation_id = c.id
WHERE tm.tool_timestamp::DATE = '2025-12-11'
GROUP BY c.host_id, c.type
HAVING COUNT(*) >= 1