/**
 * AI Engine Personalities — Static Profile Data
 * ────────────────────────────────────────────────
 * Static characterization of how major AI engines discover, rank, and cite
 * web content. Used to generate engine-specific optimization guidance.
 *
 * Internal module — vendor names in this file are ACCEPTABLE in customer-facing
 * output ONLY because the engine names are the product being discussed.
 * Claude is listed here as an AI search engine, not as the LLM powering this audit.
 */

export interface AiEngineProfile {
  engineId: string;
  displayName: string;
  parentCompany: string;
  citationStyle: string;
  preferredContentTypes: string[];
  schemaPriorities: string[];
  eAtSensitivity: "high" | "medium" | "low";
  recencyBias: "high" | "medium" | "low";
  optimizationApproach: [string, string, string, string]; // exactly 4 bullets
}

export const AI_ENGINE_PROFILES: AiEngineProfile[] = [
  {
    engineId: "chatgpt",
    displayName: "ChatGPT",
    parentCompany: "OpenAI",
    citationStyle: "Synthesizes multiple sources into narrative answers with inline source links; tends to prefer authoritative reference pages over blog content",
    preferredContentTypes: ["how-to guides", "service pages", "FAQ pages", "authoritative reference articles", "structured definitions"],
    schemaPriorities: ["FAQPage", "HowTo", "Article", "Organization"],
    eAtSensitivity: "high",
    recencyBias: "medium",
    optimizationApproach: [
      "Structure key pages as direct answers to high-intent queries — ChatGPT favors pages that answer a question completely rather than pages optimized for ranking",
      "Add FAQPage schema to service and FAQ pages to increase structured data eligibility for synthesis",
      "Build author authority signals: bio pages, credential listings, and expert attribution increase E-E-A-T scoring",
      "Use clear, topically focused headings (H2/H3) that mirror natural language questions your audience would ask",
    ],
  },
  {
    engineId: "perplexity",
    displayName: "Perplexity",
    parentCompany: "Perplexity AI",
    citationStyle: "Aggressive multi-source citation with numbered inline references; heavily rewards recency and domain authority signals for competitive queries",
    preferredContentTypes: ["comparison pages", "listicles", "updated how-to content", "data-driven articles", "case studies"],
    schemaPriorities: ["Article", "FAQPage", "HowTo", "AggregateRating"],
    eAtSensitivity: "medium",
    recencyBias: "high",
    optimizationApproach: [
      "Publish date metadata is critical for Perplexity — add datePublished and dateModified to Article schema and keep core pages refreshed quarterly",
      "Create comparison and listicle content that aggregates options; Perplexity actively sources these for queries like 'best X for Y'",
      "Build referring domain breadth: Perplexity's citation algorithm is strongly correlated with linking domain count vs total backlinks",
      "Use concise, scannable paragraphs under 80 words — Perplexity extracts short passages directly, and long dense paragraphs are skipped",
    ],
  },
  {
    engineId: "claude",
    displayName: "Claude",
    parentCompany: "Anthropic",
    citationStyle: "Synthesizes content into narrative responses with a preference for nuanced, multi-perspective sources; values transparency and factual grounding",
    preferredContentTypes: ["in-depth explainers", "process documentation", "ethical/policy content", "research summaries", "balanced analysis"],
    schemaPriorities: ["Article", "Organization", "FAQPage", "HowTo"],
    eAtSensitivity: "high",
    recencyBias: "low",
    optimizationApproach: [
      "Publish substantive, well-structured content that explores a topic from multiple angles — Claude favors depth and nuance over keyword-optimized brevity",
      "Establish organizational credibility through clear About and team pages with professional credentials prominently displayed",
      "Avoid hyperbolic or sales-heavy copy — Claude applies higher skepticism to promotional content and rewards neutral, evidence-based framing",
      "Internal linking to supporting evidence, case studies, or methodology pages increases the trust signals Claude uses for citation selection",
    ],
  },
  {
    engineId: "gemini",
    displayName: "Gemini",
    parentCompany: "Google",
    citationStyle: "Deep integration with Google Search signals; highly correlated with traditional SEO authority metrics and structured data richness",
    preferredContentTypes: ["local service pages", "product pages", "knowledge-base articles", "review-rich content", "authoritative guides"],
    schemaPriorities: ["LocalBusiness", "Product", "AggregateRating", "FAQPage", "Organization"],
    eAtSensitivity: "high",
    recencyBias: "medium",
    optimizationApproach: [
      "Traditional SEO health is the strongest predictor of Gemini citation — strong domain rank, clean technical SEO, and well-optimized page titles directly improve Gemini visibility",
      "LocalBusiness and AggregateRating schema are critical for local and transactional queries; Gemini pulls structured data directly into AI Overview cards",
      "Build Google Knowledge Panel signals: verified Google Business Profile, consistent NAP across directories, and Organization schema with logo and contactPoint",
      "Core Web Vitals performance matters for Gemini AI Overviews — pages with poor LCP or CLS are less likely to be featured even with strong content",
    ],
  },
  {
    engineId: "copilot",
    displayName: "Microsoft Copilot",
    parentCompany: "Microsoft",
    citationStyle: "Powered by Bing indexing; rewards commercial content and transactional intent pages; frequently cites product and service comparison pages",
    preferredContentTypes: ["product pages", "service landing pages", "transactional content", "comparison guides", "professional service pages"],
    schemaPriorities: ["Product", "Service", "Organization", "AggregateRating", "LocalBusiness"],
    eAtSensitivity: "medium",
    recencyBias: "medium",
    optimizationApproach: [
      "Verify Bing Webmaster Tools indexing — Copilot uses Bing's index and many sites have crawl issues on Bing that do not appear in Google Search Console",
      "Service and product schema with pricing signals and service area data strongly increase Copilot commercial query visibility",
      "Transactional landing pages (quote, booking, contact) benefit most from Copilot optimization; commercial intent signals are weighted higher than informational content",
      "Microsoft values professional trust signals: LinkedIn company page authority, Bing Places listing, and BBB or professional association citations improve entity recognition",
    ],
  },
];

export function getEngineProfile(engineId: string): AiEngineProfile | undefined {
  return AI_ENGINE_PROFILES.find((p) => p.engineId === engineId);
}
