import type { SignalSource } from '@cat-cafe/shared';

/**
 * Tier 1 global AI labs: Anthropic, OpenAI, Google, Meta,
 * Microsoft/Apple/AWS, xAI, Mistral, Cohere, Together AI, Groq.
 */
export const TIER1_GLOBAL_SOURCES: readonly SignalSource[] = [
  // ── Anthropic (P0 — 铲屎官特别指出) ──────────────────────────
  {
    id: 'anthropic-news',
    name: 'Anthropic Newsroom',
    url: 'https://www.anthropic.com/news',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .news-item' },
    schedule: { frequency: 'daily' },
  },
  {
    id: 'anthropic-research',
    name: 'Anthropic Research',
    url: 'https://www.anthropic.com/research',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .research-item, a[href*="/research/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'anthropic-engineering',
    name: 'Anthropic Engineering',
    url: 'https://www.anthropic.com/engineering',
    tier: 1,
    category: 'engineering',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .engineering-item, a[href*="/engineering/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'anthropic-alignment',
    name: 'Anthropic Alignment Science',
    url: 'https://alignment.anthropic.com/',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .post-item, a[href*="/blog/"]' },
    schedule: { frequency: 'manual' },
  },

  // ── OpenAI ────────────────────────────────────────────────────
  {
    id: 'openai-news-rss',
    name: 'OpenAI News RSS',
    url: 'https://openai.com/news/rss.xml',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'rss' },
    schedule: { frequency: 'daily' },
  },
  {
    id: 'openai-research',
    name: 'OpenAI Research',
    url: 'https://openai.com/research/',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, a[href*="/research/"]' },
    schedule: { frequency: 'manual' },
  },

  // ── Google (DeepMind + Research) ──────────────────────────────
  {
    id: 'deepmind-blog',
    name: 'Google DeepMind Blog',
    url: 'https://deepmind.google/blog/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .blog-card, a[href*="/blog/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'deepmind-publications',
    name: 'Google DeepMind Publications',
    url: 'https://deepmind.google/research/publications/',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .publication-card' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'google-research-blog',
    name: 'Google Research Blog',
    url: 'https://research.google/blog/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .blog-card' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'google-blog-ai',
    name: 'Google Blog AI',
    url: 'https://blog.google/technology/ai/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .uni-blog-article' },
    schedule: { frequency: 'manual' },
  },

  // ── Meta AI ───────────────────────────────────────────────────
  {
    id: 'meta-ai-blog',
    name: 'Meta AI Blog',
    url: 'https://ai.meta.com/blog/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .blog-post-card, a[href*="/blog/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'meta-research-publications',
    name: 'Meta Research Publications',
    url: 'https://research.facebook.com/publications/',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .publication-card' },
    schedule: { frequency: 'manual' },
  },

  // ── Microsoft + Apple + AWS ───────────────────────────────────
  {
    id: 'microsoft-research-rss',
    name: 'Microsoft Research Blog',
    url: 'https://www.microsoft.com/en-us/research/blog/feed/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'rss' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'apple-ml-rss',
    name: 'Apple ML Research',
    url: 'https://machinelearning.apple.com/feed.xml',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'rss' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'aws-ml-blog-rss',
    name: 'AWS ML Blog',
    url: 'https://aws.amazon.com/blogs/machine-learning/feed/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'rss' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'amazon-science',
    name: 'Amazon Science',
    url: 'https://www.amazon.science/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .card, a[href*="/publications/"]' },
    schedule: { frequency: 'manual' },
  },

  // ── Other global labs ─────────────────────────────────────────
  {
    id: 'xai-blog',
    name: 'xAI Blog',
    url: 'https://x.ai/blog',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .blog-post, a[href*="/blog/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'mistral-news',
    name: 'Mistral AI News',
    url: 'https://mistral.ai/news/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, a[href*="/news/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'cohere-research',
    name: 'Cohere Research',
    url: 'https://cohere.com/research',
    tier: 1,
    category: 'research',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .card' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'together-ai-blog',
    name: 'Together AI Blog',
    url: 'https://www.together.ai/blog',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .blog-card, a[href*="/blog/"]' },
    schedule: { frequency: 'manual' },
  },
  {
    id: 'groq-news',
    name: 'Groq News',
    url: 'https://groq.com/news/',
    tier: 1,
    category: 'official',
    enabled: true,
    fetch: { method: 'webpage', selector: 'article, .news-item' },
    schedule: { frequency: 'manual' },
  },
];
