require('dotenv').config();
const { createClient } = require('@supabase/supabase-js');
const sb = createClient(process.env.SUPABASE_URL, process.env.SUPABASE_SERVICE_KEY);
const KEEP = [
  '8e4037ae-b4a4-4a18-9135-5359dc4d352c',
  '267a31b0-755b-49d1-ba97-384fa2cadf3a',
  'fc199219-76ae-4130-98dd-0a5e5c5fa978'
];
sb.from('tasks').select('id,title,source,created_at').eq('status','open').order('created_at',{ascending:true}).then(r=>{
  const old = r.data.filter(t => (!t.source || !t.source.includes('seeder_v7')) && !KEEP.includes(t.id));
  console.log('Tasks to delete:',old.length);
  old.forEach(t=>console.log(t.id,'|',t.source||'no-source','|',t.title.slice(0,60)));
});
