require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
const sb = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY);
sb.from('tasks').select('source,created_at').eq('status','open').then(r=>{
  const sources = {};
  r.data.forEach(t=>{
    const k = t.source || 'no-source';
    sources[k] = (sources[k]||0)+1;
  });
  console.log('Total:',r.data.length);
  console.log(sources);
});
