/**
 * Shared types for the Competitor Research MCP server and UI apps.
 * @module types
 */

/** Focus areas for competitive research */
export type FocusArea = "pricing" | "features" | "content" | "social" | "seo" | "all";

/** All available focus areas (useful for iteration) */
export const FOCUS_AREAS: FocusArea[] = ["pricing", "features", "content", "social", "seo", "all"];

/** Specific (non-"all") focus areas */
export const SPECIFIC_FOCUS_AREAS: Exclude<FocusArea, "all">[] = [
  "pricing", "features", "content", "social", "seo",
];

/** Company profile submitted via the intake form */
export interface CompanyProfile {
  name: string;
  url: string;
  industry: string;
  description: string;
  valueProps: string[];
}

/** A single competitor entry */
export interface CompetitorEntry {
  name: string;
  url: string;
  notes?: string;
}

/** The full research brief submitted from the intake form */
export interface ResearchBrief {
  company: CompanyProfile;
  competitors: CompetitorEntry[];
  focusAreas: FocusArea[];
}

/** Pricing tier information */
export interface PricingTier {
  name: string;
  price: string;
  features: string[];
}

/** Structured pricing info extracted from a competitor site */
export interface PricingInfo {
  tiers: PricingTier[];
}

/** Social media presence for a single platform */
export interface SocialPresence {
  platform: string;
  followers?: string;
  postingFrequency?: string;
  engagement?: string;
}

/** Content strategy signals */
export interface ContentStrategy {
  blogFrequency?: string;
  topTopics: string[];
  contentTypes: string[];
}

/** SEO metrics extracted from a competitor site */
export interface SeoMetrics {
  estimatedTraffic?: string;
  topKeywords: string[];
  domainAuthority?: string;
}

/** Full analysis result for a single competitor */
export interface CompetitorAnalysis {
  competitor: CompetitorEntry;
  pricing?: PricingInfo;
  features: string[];
  strengths: string[];
  weaknesses: string[];
  socialPresence?: SocialPresence[];
  contentStrategy?: ContentStrategy;
  seoMetrics?: SeoMetrics;
}

/** Position on a market quadrant (for scatter plot) */
export interface PositionQuadrant {
  name: string;
  x: number;
  y: number;
}

/** Complete research result returned by the analysis engine */
export interface ResearchResult {
  brief: ResearchBrief;
  analyses: CompetitorAnalysis[];
  opportunities: string[];
  marketPositioning: PositionQuadrant[];
  generatedAt: string;
}
